CyberChef/main.js

278 lines
4.4 MiB
JavaScript
Raw Normal View History

/**
* CyberChef - The Cyber Swiss Army Knife
*
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* Copyright 2016 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1509)}([function(e,t,n){"use strict";var o=n(15),r=n.n(o),p=n(10),a=n(7),i=n(19),b=n(18);function M(e,t,n,o,r,p,a){try{var i=e[p](a),b=i.value}catch(e){return void n(e)}i.done?t(b):Promise.resolve(b).then(o,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var p=e.apply(t,n);function a(e){M(p,o,r,a,i,"next",e)}function i(e){M(p,o,r,a,i,"throw",e)}a(void 0)})}}function z(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,n=null,o=[{key:"chr",value:function(e){if(e>65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<56320&&n>=56320&&n<57344)return 1024*(t-55296)+n-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=new Array(t);return o.fill(n),Array.prototype.map.call(e,function(e,t){o[t]=e}),o}},{key:"truncate",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-n.length)+n),e}},{key:"hex",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(n,"0")}},{key:"bin",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(n,"0")}},{key:"printable",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==typeof window&&window.app&&!window.app.options.treatAsUtf8&&(t=e.byteArrayToChars(e.strToByteArray(t)));return t=t.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u
/**
* Hexadecimal functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!e)return"";for(var o="",r=0;r<e.length;r++)o+=e[r].toString(16).padStart(n,"0")+t;return"0x"===t&&(o="0x"+o),"\\x"===t&&(o="\\x"+o),t.length?o.slice(0,-t.length):o}function p(e){if(!e)return"";for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==t){var r="Auto"===t?/[^a-f\d]/gi:o.a.regexRep(t);e=e.replace(r,"")}for(var p=[],a=0;a<e.length;a+=n)p.push(parseInt(e.substr(a,n),16));return p}var i=["Space","Comma","Semi-colon","Colon","Line feed","CRLF","0x","\\x","None"],b=["Auto"].concat(i)},,,function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"b",function(){return p}),n.d(t,"a",function(){return a});var o=n(0);
/**
* Base64 functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";"string"==typeof e&&(e=o.a.strToByteArray(e)),t=o.a.expandAlphRange(t).join("");for(var n,r,p,a,i,b,M,c="",z=0;z<e.length;)a=(n=e[z++])>>2,i=(3&n)<<4|(r=e[z++])>>4,b=(15&r)<<2|(p=e[z++])>>6,M=63&p,isNaN(r)?b=M=64:isNaN(p)&&(M=64),c+=t.charAt(a)+t.charAt(i)+t.charAt(b)+t.charAt(M);return c}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e)return"string"===n?"":[];t=t||"A-Za-z0-9+/=",t=o.a.expandAlphRange(t).join("");var p,a,i,b,M,c,z=[],s=0;if(r){var u=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(u,"")}for(;s<e.length;)p=t.indexOf(e.charAt(s++))<<2|(b=-1===(b=t.indexOf(e.charAt(s++)||"="))?64:b)>>4,a=(15&b)<<4|(M=-1===(M=t.indexOf(e.charAt(s++)||"="))?64:M)>>2,i=(3&M)<<6|(c=-1===(c=t.indexOf(e.charAt(s++)||"="))?64:c),z.push(p),64!==M&&z.push(a),64!==c&&z.push(i);return"string"===n?o.a.byteArrayToUtf8(z):z}var a=[{name:"Standard (RFC 4648): A-Za-z0-9+/=",value:"A-Za-z0-9+/="},{name:"URL safe (RFC 4648 §5): A-Za-z0-9-_",value:"A-Za-z0-9-_"},{name:"Filename safe: A-Za-z0-9+-=",value:"A-Za-z0-9+\\-="},{name:"itoa64: ./0-9A-Za-z=",value:"./0-9A-Za-z="},{name:"XML: A-Za-z0-9_.",value:"A-Za-z0-9_."},{name:"y64: A-Za-z0-9._-",value:"A-Za-z0-9._-"},{name:"z64: 0-9a-zA-Z+/=",value:"0-9a-zA-Z+/="},{name:"Radix-64 (RFC 4880): 0-9A-Za-z+/=",value:"0-9A-Za-z+/="},{name:"Uuencoding: [space]-_",value:" -_"},{name:"Xxencoding: +-0-9A-Za-z",value:"+\\-0-9A-Za-z"},{name:"BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r",value:"!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},{name:"ROT13: N-ZA-Mn-za-m0-9+/=",value:"N-ZA-Mn-za-m0-9+/="},{name:"UNIX crypt: ./0-9A-Za-z",value:"./0-9A-Za-z"}]},function(e,t,n){var o=n(33),r=n(114),p=n(99),a=n(100),i=n(115),b=function(e,t,n){var M,c,z,s,u=e&b.F,O=e&b.G,d=e&b.S,l=e&b.P,A=e&b.B,f=O?o:d?o[t]||(o[t]={}):(o[t]||{}).prototype,q=O?r:r[t]||(r[t]={}),h=q.prototype||(q.prototype={});for(M in O&&(n=t),n)z=((c=!u&&f&&void 0!==f[M])?f:n)[M],s=A&&c?i(z,o):l&&"function"==typeof z?i(Function.call,z):z,f&&a(f,M,z,e&b.U),q[M]!=z&&p(q,M,s),l&&h[M]!=z&&(h[M]=z)};o.core=r,b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,e.exports=b},,,function(e,t,n){var o,r;!function(p,a){"use strict";void 0===(r="function"==typeof(o=function(){var e=function(){},t="undefined",n=["trace","debug","info","warn","error"];function o(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function r(t,o){for(var r=0;r<n.length;r++){var p=n[r];this[p]=r<t?e:this.methodFactory(p,t,o)}this.log=this.debug}function p(n,p,a){return function(n){"debug"===n&&(n="log");return typeof console!==t&&(void 0!==console[n]?o(console,n):void 0!==console.log?o(console,"log"):e)}(n)||function(e,n,o){return function(){typeof console!==t&&(r.call(this,n,o),this[e].apply(this,arguments))}}.apply(this,arguments)}function a(e,o,a){var i,b=this,M="loglevel";function c(){var e;if(typeof window!==t){try{e=window.localStorage[M]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,o=n.indexOf(encodeURIComponent(M)+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o))[1])}catch(e){}return void 0===b.levels[e]&&(e=void 0),e}}e&&(M+=":"+e),b.name=e,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=a||p,b.getLevel=function(){return i},b.setLevel=function(o,p){if("string"==typeof o&&void 0!==b.levels[o.toUpperCase()]&&(o=b.levels[o.toUpperCase()]),!("number"==typeof o&&o>=0&&o<=b.levels.SILENT))throw"log.setLevel() called with invalid level: "+o;if(i=o,!1!==p&&function(e){var o=(n[e]||"silent").toUpperCase();if(typeof window===t)return;try{return void(window.localStorage[M]=o)}catch(e){}try{window.document.cookie=encodeURIComponent(M)+"="+o+";"}catch(e){}}(o),r.call(b,o,e),typeof console===t&&o<b.levels.SILENT)return"No console availabl
/**
* Binary functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(!e)return"";t=o.a.charRep(t);for(var r="",p=0;p<e.length;p++)r+=e[p].toString(2).padStart(n,"0")+t;return t.length?r.slice(0,-t.length):r}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=o.a.regexRep(t);e=e.replace(r,"");for(var p=[],a=0;a<e.length;a+=n)p.push(parseInt(e.substr(a,n),2));return p}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var o=n(0);
/**
* Decimal functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=o.a.charRep(t);var n=[],r=e.split(t);""===r[r.length-1]&&(r=r.slice(0,r.length-1));for(var p=0;p<r.length;p++)n[p]=parseInt(r[p],10);return n}},,,function(e,t,n){(function(o){var r,p;r=[n(432),n(76),n(1003),n(479),n(665),n(666),n(551),n(480),n(667),n(552),n(668),n(1004),n(324),n(63),n(433),n(669),n(412)],void 0===(p=function(e,t,n,o,r,p,a,i,b,M,c,z,s,u,O,d,l){"use strict";var A=function(e,t){return new A.fn.init(e,t)},f=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function q(e){var t=!!e&&"length"in e&&e.length,n=l(e);return!u(e)&&!O(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}return A.fn=A.prototype={jquery:"3.3.1",constructor:A,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=A.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return A.each(this,e)},map:function(e){return this.pushStack(A.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:p,sort:e.sort,splice:e.splice},A.extend=A.fn.extend=function(){var e,t,n,o,r,p,a=arguments[0]||{},i=1,b=arguments.length,M=!1;for("boolean"==typeof a&&(M=a,a=arguments[i]||{},i++),"object"==typeof a||u(a)||(a={}),i===b&&(a=this,i--);i<b;i++)if(null!=(e=arguments[i]))for(t in e)n=a[t],a!==(o=e[t])&&(M&&o&&(A.isPlainObject(o)||(r=Array.isArray(o)))?(r?(r=!1,p=n&&Array.isArray(n)?n:[]):p=n&&A.isPlainObject(n)?n:{},a[t]=A.extend(M,p,o)):void 0!==o&&(a[t]=o));return a},A.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,o;return!(!e||"[object Object]"!==b.call(e))&&(!(t=n(e))||"function"==typeof(o=M.call(t,"constructor")&&t.constructor)&&c.call(o)===z)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){d(e)},each:function(e,t){var n,o=0;if(q(e))for(n=e.length;o<n&&!1!==t.call(e[o],o,e[o]);o++);else for(o in e)if(!1===t.call(e[o],o,e[o]))break;return e},trim:function(e){return null==e?"":(e+"").replace(f,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(q(Object(e))?A.merge(n,"string"==typeof e?[e]:e):p.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,o=0,r=e.length;o<n;o++)e[r++]=t[o];return e.length=r,e},grep:function(e,t,n){for(var o=[],r=0,p=e.length,a=!n;r<p;r++)!t(e[r],r)!==a&&o.push(e[r]);return o},map:function(e,t,n){var o,p,a=0,i=[];if(q(e))for(o=e.length;a<o;a++)null!=(p=t(e[a],a,n))&&i.push(p);else for(a in e)null!=(p=t(e[a],a,n))&&i.push(p);return r.apply([],i)},guid:1,support:s}),"function"==typeof Symbol&&(A.fn[Symbol.iterator]=e[Symbol.iterator]),A.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){i["[object "+t+"]"]=t.toLowerCase()}),A}.apply(t,r))||(e.exports=p)}).call(this,n(102))},,,,,,,function(e,t,n){var o=n(37);e.exports=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){(e.exports=n(436)).tz.load(n(438))},,,function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},,function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},,function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},,,,,,,function(e,t,n){var o=n(464)("wks"),r=n(315),p=n(33).Symbol,a="function"==typeof p;(e.exports=function(e){return o[e]||(o[e]=a&&p[e]||(a?p:r)("Symbol."+e))}).store=o},,,,,,,,,,,function(e,t,n){e.exports=!n(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(
/**!
* Sortable
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/
/**!
* Sortable
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/
!function(p){"use strict";void 0===(r="function"==typeof(o=p)?o.call(t,n,t,e):o)||(e.exports=r)}(function(){"use strict";if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var e,t,n,o,r,p,a,i,b,M,c,z,s,u,O,d,l,A,f,q,h,m,W,y,g,_=[],L=!1,v=!1,R=!1,B=/\s+/g,w="Sortable"+(new Date).getTime(),X=window,T=X.document,k=X.parseInt,S=X.setTimeout,N=X.jQuery||X.Zepto,C=X.Polymer,D={capture:!1,passive:!1},E="draggable"in T.createElement("div"),H=!navigator.userAgent.match(/(?:Trident.*rv[ :]?11\.|msie)/i)&&((y=T.createElement("x")).style.cssText="pointer-events:auto","auto"===y.style.pointerEvents),F=!1,x=!1,P=Math.abs,Y=Math.min,I=[],j=[],U=function(e,t){var n=re(e),o=k(n.width),r=ce(e,0,t),p=ce(e,1,t),a=r&&re(r),i=p&&re(p),b=a&&k(a.marginLeft)+k(a.marginRight)+r.getBoundingClientRect().width,M=i&&k(i.marginLeft)+k(i.marginRight)+p.getBoundingClientRect().width;return"flex"===n.display?"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal":r&&("block"===a.display||"grid"===a.display||b>=o&&"none"===n.float||p&&"none"===n.float&&b+M>o)?"vertical":"horizontal"},V=function(e,t){if(!e||!e.getBoundingClientRect)return X;var n=e,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=re(n);if(n.clientWidth<n.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!n||!n.getBoundingClientRect||n===T.body)return X;if(o||t)return n;o=!0}}}while(n=n.parentNode);return X},G=de(function(e,t,n,o){if(t.scroll){var r,p,a,c,z=n?n[w]:window,s=t.scrollSensitivity,u=t.scrollSpeed,O=e.clientX,d=e.clientY,l=window.innerWidth,A=window.innerHeight,q=!1;b!==n&&(K(),i=t.scroll,M=t.scrollFn,!0===i&&(i=V(n,!0),b=i));var h=0,m=i;do{var W;if(m&&m!==X?(p=re(W=m),r=m.getBoundingClientRect(),a=W.clientWidth<W.scrollWidth&&("auto"==p.overflowX||"scroll"==p.overflowX)&&(P(r.right-O)<=s)-(P(r.left-O)<=s),c=W.clientHeight<W.scrollHeight&&("auto"==p.overflowY||"scroll"==p.overflowY)&&(P(r.bottom-d)<=s)-(P(r.top-d)<=s)):m===X&&(W=X,a=(l-O<=s)-(O<=s),c=(A-d<=s)-(d<=s)),!_[h])for(var y=0;y<=h;y++)_[y]||(_[y]={});_[h].vx==a&&_[h].vy==c&&_[h].el===W||(_[h].el=W,_[h].vx=a,_[h].vy=c,clearInterval(_[h].pid),!W||0==a&&0==c||(q=!0,_[h].pid=setInterval(function(){o&&0===this.layer&&Q.active._emulateDragOver(!0);var t=_[this.layer].vy?_[this.layer].vy*u:0,n=_[this.layer].vx?_[this.layer].vx*u:0;"function"==typeof M&&"continue"!==M.call(z,n,t,e,f,_[this.layer].el)||(_[this.layer].el===X?X.scrollTo(X.pageXOffset+n,X.pageYOffset+t):(_[this.layer].el.scrollTop+=t,_[this.layer].el.scrollLeft+=n))}.bind({layer:h}),24))),h++}while(t.bubbleScroll&&m!==X&&(m=V(m,!1)));L=q}},30),K=function(){_.forEach(function(e){clearInterval(e.pid)}),_=[]},J=function(e){function t(e,t){return function(n,o,r,p){var a;if(null==e&&t)a=!0;else if(null==e||!1===e)a=!1;else if(t&&"clone"===e)a=e;else if("function"==typeof e)a=e(n,o,r,p);else{var i=(t?n:o).options.group.name;a=!0===e||"string"==typeof e&&e===i||e.join&&e.indexOf(i)>-1}return a||n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name}}var n={},o=e.group;o&&"object"==typeof o||(o={name:o}),n.name=o.name,n.checkPull=t(o.pull,!0),n.checkPut=t(o.put),n.revertClone=o.revertClone,e.group=n},Z=function(t){e&&e.parentNode[w]&&e.parentNode[w]._computeIsAligned(t)};function Q(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(e);this.el=e,this.options=t=le({},t),e[w]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0,draggable:/[uo]l/i.test(e.nodeName)?"li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,touch
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var p=function(){function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.app=n,this.manager=o,this.name=t.name,this.type=t.type,this.value=t.value,this.disabled=t.disabled||!1,this.hint=t.hint||!1,this.rows=t.rows||!1,this.target=t.target,this.defaultIndex=t.defaultIndex||0,this.toggleValues=t.toggleValues,this.id="ing-"+this.app.nextIngId()}var t,n,p;return t=e,(n=[{key:"toHtml",value:function(){var e,t,n="";switch(this.type){case"string":case"binaryString":case"byteArray":n+='<div class="form-group">\n <label for="'.concat(this.id,'" class="bmd-label-floating">').concat(this.name,'</label>\n <input type="text"\n class="form-control arg"\n id="').concat(this.id,'"\n arg-name="').concat(this.name,'"\n value="').concat(this.value,'"\n ').concat(this.disabled?"disabled":"",">\n ").concat(this.hint?"<span class='bmd-help'>"+this.hint+"</span>":"","\n </div>");break;case"shortString":case"binaryShortString":n+='<div class="form-group inline">\n <label for="'.concat(this.id,'" class="bmd-label-floating inline">').concat(this.name,'</label>\n <input type="text"\n class="form-control arg inline"\n id="').concat(this.id,'"\n arg-name="').concat(this.name,'"\n value="').concat(this.value,'"\n ').concat(this.disabled?"disabled":"",">\n ").concat(this.hint?"<span class='bmd-help'>"+this.hint+"</span>":"","\n </div>");break;case"toggleString":for(n+='<div class="form-group input-group">\n <div class="toggle-string">\n <label for="'.concat(this.id,'" class="bmd-label-floating toggle-string">').concat(this.name,'</label>\n <input type="text"\n class="form-control arg toggle-string"\n id="').concat(this.id,'"\n arg-name="').concat(this.name,'"\n value="').concat(this.value,'"\n ').concat(this.disabled?"disabled":"",">\n ").concat(this.hint?"<span class='bmd-help'>"+this.hint+"</span>":"",'\n </div>\n <div class="input-group-append">\n <button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">').concat(this.toggleValues[0],'</button>\n <div class="dropdown-menu toggle-dropdown">'),e=0;e<this.toggleValues.length;e++)n+='<a class="dropdown-item" href="#">'.concat(this.toggleValues[e],"</a>");n+="</div>\n </div>\n\n </div>";break;case"number":n+='<div class="form-group inline">\n <label for="'.concat(this.id,'" class="bmd-label-floating inline">').concat(this.name,'</label>\n <input type="number"\n class="form-control arg inline"\n id="').concat(this.id,'"\n arg-name="').concat(this.name,'"\n value="').concat(this.value,'"\n ').concat(this.disabled?"disabled":"",">\n ").concat(this.hint?"<span class='bmd-help'>"+this.hint+"</span>":"","\n </div>");break;case"boolean":n+='<div class="form-group inline boolean-arg">\n <div class="checkbox">\n <label>\n <input type="checkbox"\n class="arg"\n id="'.concat(this.id,'"\n arg-name="').concat(this.name,'"\n ').concat(this.value?" checked":"","\n ").concat
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var i=function(){function e(t,n,o,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.app=o,this.manager=r,this.name=t,this.description=n.description,this.infoURL=n.infoURL,this.manualBake=n.manualBake||!1,this.config=n,this.ingList=[];for(var a=0;a<n.args.length;a++){var i=new p(n.args[a],this.app,this.manager);this.ingList.push(i)}}var t,n,o;return t=e,(n=[{key:"toStubHtml",value:function(e){var t="<li class='operation'";if(this.description){var n=this.infoURL?"<hr>".concat(function(e){var t=e.split("/");if(t.indexOf("wikipedia.org")<0&&t.indexOf("forensicswiki.org")<0)return"<a href='".concat(e,"' target='_blank'>More Information<i class='material-icons inline-icon'>open_in_new</i></a>");var n=t.indexOf("forensicswiki.org")<0?"Wikipedia":"Forensics Wiki",o=decodeURIComponent(t[t.length-1]).replace(/_/g," ");return"<a href='".concat(e,"' target='_blank'>").concat(o,"<i class='material-icons inline-icon'>open_in_new</i></a> on ").concat(n)}(this.infoURL)):"";t+=" data-container='body' data-toggle='popover' data-placement='right'\n data-content=\"".concat(this.description).concat(n,"\" data-html='true' data-trigger='hover'\n data-boundary='viewport'")}return t+=">"+this.name,e&&(t+="<i class='material-icons remove-icon op-icon'>delete</i>"),t+="</li>"}},{key:"toFullHtml",value:function(){for(var e='<div class="op-title">'.concat(this.name,'</div>\n <div class="ingredients">'),t=0;t<this.ingList.length;t++)e+=this.ingList[t].toHtml();return e+='</div>\n <div class="recip-icons">\n <i class="material-icons breakpoint" title="Set breakpoint" break="false">pause</i>\n <i class="material-icons disable-icon" title="Disable operation" disabled="false">not_interested</i>\n </div>\n <div class="clearfix">&nbsp;</div>'}},{key:"highlightSearchString",value:function(e,t,n){if(t>=0&&(this.name=this.name.slice(0,t)+"<b><u>"+this.name.slice(t,t+e.length)+"</u></b>"+this.name.slice(t+e.length)),this.description&&n>=0){for(var o,r=/<[^>]+>/g;o=r.exec(this.description);)if(n>=o.index&&n<=o.index+o[0].length)return;this.description=this.description.slice(0,n)+"<b><u>"+this.description.slice(n,n+e.length)+"</u></b>"+this.description.slice(n+e.length)}}}])&&a(t.prototype,n),o&&a(t,o),e}();t.a=i},function(e,t,n){var o=n(56).f,r=n(106),p=n(44)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,p)&&o(e,p,{configurable:!0,value:t})}},function(e,t,n){var o=n(11),r=n(151),p=n(35),a=n(531),i="["+a+"]",b=RegExp("^"+i+i+"*"),M=RegExp(i+i+"*$"),c=function(e,t,n){var r={},i=p(function(){return!!a[e]()||"…"!="…"[e]()}),b=r[e]=i?t(z):a[e];n&&(r[n]=b),o(o.P+o.F*i,"String",r)},z=c.trim=function(e,t){return e=String(r(e)),1&t&&(e=e.replace(b,"")),2&t&&(e=e.replace(M,"")),e};e.exports=c},function(e,t){e.exports={}},function(e,t,n){var o=n(37);e.exports=function(e,t){if(!o(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var o,r;o=[n(480),n(667)],void 0===(r=function(e,t){"use strict";return function(n){return null==n?n+"":"object"==typeof n||"function"==typeof n?e[t.call(n)]||"object":typeof n}}.apply(t,o))||(e.exports=r)},function(e,t,n){var o,r;o=[n(22),n(551),n(1007),n(1008),n(670),n(325),n(118),n(672),n(83)],void 0===(r=function(e,t,n,o,r,p){"use strict";var a=/^(?:parents|prev(?:Until|All))/,i={children:!0,contents:!0,next:!0,prev:!0};function b(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}return e.fn.extend({has:function(t){var n=e(t,this),o=n.length;return this.filter(function(){for(var t=0;t<o;t++)if(e.contains(this,n[t]))return!0})},closest:function(t,n){var o,p=0,a=this.length,i=[],b="string"!=typeof t&&e(t);if(!r.test(t))for(;p<a;p++)for(o=this[p];o&&o!==n;o=o.parentNode)if(o.nodeType<11&&(b?b.index(o)>-1:1===o.nodeType&&e.find.matchesSelector(o,t))){i.push(o);break}return this.pushStack(i.length>1?e.uniqueSort(i):i)},index:function(n){return n?"string"==typeof n?t.call(e(n),this[0]):t.call(this,n.jquery?n[0]:n):this[0]&&this[0].parentNode?
//! version : 0.5.23
//! Copyright (c) JS Foundation and other contributors
//! license : MIT
//! github.com/moment/moment-timezone
//! moment-timezone.js
//! version : 0.5.23
//! Copyright (c) JS Foundation and other contributors
//! license : MIT
//! github.com/moment/moment-timezone
!function(a,i){"use strict";e.exports?e.exports=i(n(2)):(r=[n(2)],void 0===(p="function"==typeof(o=i)?o.apply(t,r):o)||(e.exports=p))}(0,function(e){"use strict";var t,n={},o={},r={},p={};e&&"string"==typeof e.version||v("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");var a=e.version.split("."),i=+a[0],b=+a[1];function M(e){return e>96?e-87:e>64?e-29:e-48}function c(e){var t=0,n=e.split("."),o=n[0],r=n[1]||"",p=1,a=0,i=1;for(45===e.charCodeAt(0)&&(t=1,i=-1);t<o.length;t++)a=60*a+M(o.charCodeAt(t));for(t=0;t<r.length;t++)p/=60,a+=M(r.charCodeAt(t))*p;return a*i}function z(e){for(var t=0;t<e.length;t++)e[t]=c(e[t])}function s(e,t){var n,o=[];for(n=0;n<t.length;n++)o[n]=e[t[n]];return o}function u(e){var t=e.split("|"),n=t[2].split(" "),o=t[3].split(""),r=t[4].split(" ");return z(n),z(o),z(r),function(e,t){for(var n=0;n<t;n++)e[n]=Math.round((e[n-1]||0)+6e4*e[n]);e[t-1]=1/0}(r,o.length),{name:t[0],abbrs:s(t[1].split(" "),o),offsets:s(n,o),untils:r,population:0|t[5]}}function O(e){e&&this._set(u(e))}function d(e){var t=e.toTimeString(),n=t.match(/\([a-z ]+\)/i);"GMT"===(n=n&&n[0]?(n=n[0].match(/[A-Z]/g))?n.join(""):void 0:(n=t.match(/[A-Z]{3,5}/g))?n[0]:void 0)&&(n=void 0),this.at=+e,this.abbr=n,this.offset=e.getTimezoneOffset()}function l(e){this.zone=e,this.offsetScore=0,this.abbrScore=0}function A(e,t){for(var n,o;o=6e4*((t.at-e.at)/12e4|0);)(n=new d(new Date(e.at+o))).offset===e.offset?e=n:t=n;return e}function f(e,t){return e.offsetScore!==t.offsetScore?e.offsetScore-t.offsetScore:e.abbrScore!==t.abbrScore?e.abbrScore-t.abbrScore:t.zone.population-e.zone.population}function q(e,t){var n,o;for(z(t),n=0;n<t.length;n++)o=t[n],p[o]=p[o]||{},p[o][e]=!0}function h(e){var t,n,o,a=e.length,i={},b=[];for(t=0;t<a;t++)for(n in o=p[e[t].offset]||{})o.hasOwnProperty(n)&&(i[n]=!0);for(t in i)i.hasOwnProperty(t)&&b.push(r[t]);return b}function m(){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e&&e.length>3){var t=r[W(e)];if(t)return t;v("Moment Timezone found "+e+" from the Intl api, but did not have that data loaded.")}}catch(e){}var n,o,p,a=function(){var e,t,n,o=(new Date).getFullYear()-2,r=new d(new Date(o,0,1)),p=[r];for(n=1;n<48;n++)(t=new d(new Date(o,n,1))).offset!==r.offset&&(e=A(r,t),p.push(e),p.push(new d(new Date(e.at+6e4)))),r=t;for(n=0;n<4;n++)p.push(new d(new Date(o+n,0,1))),p.push(new d(new Date(o+n,6,1)));return p}(),i=a.length,b=h(a),M=[];for(o=0;o<b.length;o++){for(n=new l(g(b[o]),i),p=0;p<i;p++)n.scoreOffsetAt(a[p]);M.push(n)}return M.sort(f),M.length>0?M[0].zone.name:void 0}function W(e){return(e||"").toLowerCase().replace(/\//g,"_")}function y(e){var t,o,p,a;for("string"==typeof e&&(e=[e]),t=0;t<e.length;t++)a=W(o=(p=e[t].split("|"))[0]),n[a]=e[t],r[a]=o,q(a,p[2].split(" "))}function g(e,t){e=W(e);var p,a=n[e];return a instanceof O?a:"string"==typeof a?(a=new O(a),n[e]=a,a):o[e]&&t!==g&&(p=g(o[e],g))?((a=n[e]=new O)._set(p),a.name=r[e],a):null}function _(e){var t,n,p,a;for("string"==typeof e&&(e=[e]),t=0;t<e.length;t++)p=W((n=e[t].split("|"))[0]),a=W(n[1]),o[p]=a,r[p]=n[0],o[a]=p,r[a]=n[1]}function L(e){var t="X"===e._f||"x"===e._f;return!(!e._a||void 0!==e._tzm||t)}function v(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}function R(t){var n=Array.prototype.slice.call(arguments,0,-1),o=arguments[arguments.length-1],r=g(o),p=e.utc.apply(null,n);return r&&!e.isMoment(t)&&L(p)&&p.add(r.parse(p),"minutes"),p.tz(o),p}(i<2||2===i&&b<6)&&v("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+e.version+". See momentjs.com"),O.prototype={_set:function(e){this.name=e.name,this.abbrs=e.abbrs,this.untils=e.untils,this.offsets=e.offsets,this.population=e.population},_index:function(e){var t,n=+e,o=this.untils;for(t=0;t<o.length;t++)if(n<o[t])return t},parse:function(e){var t,n,o,r,p=+e,a=this.offsets,i=this.untils,b=i.length-1;for(r=0;r<b;r++)if(t=a[r],n=a[r+1],o=a[r?r-1:r],t<n&&R.moveAmbiguousForward?t=n:t>o&&R.moveInvalidForward&&(t=o),p<i[r]-6e4*t)return a[r];return a[b]},abbr:function(e){return this.abb
/*! Split.js - v1.5.10 */
e.exports=function(){"use strict";var e=window,t=e.document,n="addEventListener",o="removeEventListener",r="getBoundingClientRect",p="_a",a="_b",i="_c",b="horizontal",M=function(){return!1},c=e.attachEvent&&!e[n],z=["","-webkit-","-moz-","-o-"].filter(function(e){var n=t.createElement("div");return n.style.cssText="width:"+e+"calc(9px)",!!n.style.length}).shift()+"calc",s=function(e){return"string"==typeof e||e instanceof String},u=function(e){if(s(e)){var n=t.querySelector(e);if(!n)throw new Error("Selector "+e+" did not match a DOM element");return n}return e},O=function(e,t,n){var o=e[t];return void 0!==o?o:n},d=function(e,t,n,o){if(t){if("end"===o)return 0;if("center"===o)return e/2}else if(n){if("start"===o)return 0;if("center"===o)return e/2}return e},l=function(e,n){var o=t.createElement("div");return o.className="gutter gutter-"+n,o},A=function(e,t,n){var o={};return s(t)?o[e]=t:o[e]=c?t+"%":z+"("+t+"% - "+n+"px)",o},f=function(e,t){var n;return(n={})[e]=t+"px",n};return function(z,s){void 0===s&&(s={});var q,h,m,W,y,g,_=z;Array.from&&(_=Array.from(_));var L=u(_[0]),v=L.parentNode,R=getComputedStyle?getComputedStyle(v):null,B=R?R.flexDirection:null,w=O(s,"sizes")||_.map(function(){return 100/_.length}),X=O(s,"minSize",100),T=Array.isArray(X)?X:_.map(function(){return X}),k=O(s,"expandToMin",!1),S=O(s,"gutterSize",10),N=O(s,"gutterAlign","center"),C=O(s,"snapOffset",30),D=O(s,"dragInterval",1),E=O(s,"direction",b),H=O(s,"cursor",E===b?"col-resize":"row-resize"),F=O(s,"gutter",l),x=O(s,"elementStyle",A),P=O(s,"gutterStyle",f);function Y(e,t,n,o){var r=x(q,t,n,o);Object.keys(r).forEach(function(t){e.style[t]=r[t]})}function I(){return g.map(function(e){return e.size})}function j(e){return"touches"in e?e.touches[0][h]:e[h]}function U(e){var t=g[this.a],n=g[this.b],o=t.size+n.size;t.size=e/this.size*o,n.size=o-e/this.size*o,Y(t.element,t.size,this[a],t.i),Y(n.element,n.size,this[i],n.i)}function V(){var e=g[this.a].element,t=g[this.b].element,n=e[r](),o=t[r]();this.size=n[q]+o[q]+this[a]+this[i],this.start=n[m],this.end=n[W]}function G(e){var t=function(e){if(!getComputedStyle)return null;var t=getComputedStyle(e);if(!t)return null;var n=e[y];return 0===n?null:n-=E===b?parseFloat(t.paddingLeft)+parseFloat(t.paddingRight):parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}(v);if(null===t)return e;if(T.reduce(function(e,t){return e+t},0)>t)return e;var n=0,o=[],r=e.map(function(r,p){var a=t*r/100,i=d(S,0===p,p===e.length-1,N),b=T[p]+i;return a<b?(n+=b-a,o.push(0),b):(o.push(a-b),a)});return 0===n?e:r.map(function(e,r){var p=e;if(n>0&&o[r]-n>0){var a=Math.min(n,o[r]-n);n-=a,p=e-a}return p/t*100})}function K(r){if(!("button"in r&&0!==r.button)){var p=g[this.a].element,b=g[this.b].element;this.dragging||O(s,"onDragStart",M)(I()),r.preventDefault(),this.dragging=!0,this.move=function(e){var t,n=g[this.a],o=g[this.b];this.dragging&&(t=j(e)-this.start+(this[a]-this.dragOffset),D>1&&(t=Math.round(t/D)*D),t<=n.minSize+C+this[a]?t=n.minSize+this[a]:t>=this.size-(o.minSize+C+this[i])&&(t=this.size-(o.minSize+this[i])),U.call(this,t),O(s,"onDrag",M)())}.bind(this),this.stop=function(){var n=g[this.a].element,r=g[this.b].element;this.dragging&&O(s,"onDragEnd",M)(I()),this.dragging=!1,e[o]("mouseup",this.stop),e[o]("touchend",this.stop),e[o]("touchcancel",this.stop),e[o]("mousemove",this.move),e[o]("touchmove",this.move),this.stop=null,this.move=null,n[o]("selectstart",M),n[o]("dragstart",M),r[o]("selectstart",M),r[o]("dragstart",M),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",this.gutter.style.cursor="",this.parent.style.cursor="",t.body.style.cursor=""}.bind(this),e[n]("mouseup",this.stop),e[n]("touchend",this.stop),e[n]("touchcancel",this.stop),e[n]("mousemove",this.move),e[n]("touchmove",this.move),p[n]("selectstart",M),p[n]("dragstart",M),b[n]("selectstart",M),b[n]("dragstart",M),p.style.userSelect="none",p.style.webkitUserSelect="none",p.style.MozUserSelect="none",p.style
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var O=function(){function t(e,n,o,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.categories=e,this.operations=n,this.dfavourites=o,this.doptions=r,this.options=Object.assign({},r),this.manager=new a.a(this),this.baking=!1,this.autoBake_=!1,this.autoBakePause=!1,this.progress=0,this.ingId=0}var n,M,z;return n=t,(M=[{key:"setup",value:function(){document.dispatchEvent(this.manager.appstart),this.initialiseSplitter(),this.loadLocalStorage(),this.populateOperationsList(),this.manager.setup(),this.resetLayout(),this.setCompileMessage(),e.debug("App loaded"),this.appLoaded=!0,this.loadURIParams(),this.loaded()}},{key:"loaded",value:function(){this.workerLoaded&&this.appLoaded&&document.getElementById("loader-wrapper")&&(document.body.classList.add("loaded"),setTimeout(function(){document.getElementById("loader-wrapper").remove(),document.body.classList.remove("loaded")},1e3),clearInterval(window.loadingMsgsInt),window.removeEventListener("error",window.loadingErrorHandler),document.dispatchEvent(this.manager.apploaded))}},{key:"handleError",value:function(t,n){n&&e.error(t);var o=t.displayStr||t.toString();this.alert(o,this.options.errorTimeout,!this.options.showErrors)}},{key:"bake",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.baking||(this.options.attemptHighlight=!0,this.manager.worker.bake(this.getInput(),this.getRecipeConfig(),this.options,this.progress,e))}},{key:"autoBake",value:function(){if(this.autoBakePause)return!1;this.autoBake_&&!this.baking?(e.debug("Auto-baking"),this.bake()):this.manager.controls.showStaleIndicator()}},{key:"silentBake",value:function(){var e=[];this.autoBake_&&(e=this.getRecipeConfig()),this.manager.worker.silentBake(e)}},{key:"getInput",value:function(){return this.manager.input.get()}},{key:"setInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.manager.input.set(e,t)}},{key:"populateOperationsList",value:function(){document.body.appendChild(document.getElementById("edit-favourites"));var t,n="";for(t=0;t<this.categories.length;t++){for(var o=this.categories[t],r=0===t,p=new i.a(o.name,r),a=0;a<o.ops.length;a++){var M=o.ops[a];if(this.operations.hasOwnProperty(M)){var c=new b.a(M,this.operations[M],this,this.manager);p.addOperation(c)}else e.warn("".concat(M," could not be found."))}n+=p.toHtml()}document.getElementById("categories").innerHTML=n;var z=document.querySelectorAll("#categories .op-list");for(t=0;t<z.length;t++)z[t].dispatchEvent(this.manager.oplistcreate);document.querySelector("#categories a").appendChild(document.getElementById("edit-favourites"))}},{key:"initialiseSplitter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.columnSplitter&&this.columnSplitter.destroy(),this.ioSplitter&&this.ioSplitter.destroy(),this.columnSplitter=c()(["#operations","#recipe","#IO"],{sizes:[20,30,50],minSize:e?[0,0,0]:[240,370,450],gutterSize:4,expandToMin:!1,onDrag:function(){this.manager.recipe.adjustWidth()}.bind(this)}),this.ioSplitter=c()(["#input","#output"],{direction:"vertical",gutterSize:4,minSize:e?[0,0]:[100,100]}),this.resetLayout()}},{key:"loadLocalStorage",value:function(){var e;this.isLocalStorageAvailable()&&void 0!==localStorage.options&&(e=JSON.parse(localStorage.options)),this.manager.options.load(e),this.loadFavourites()}},{key:"loadFavourites",value:function(){var e;this.isLocalStorageAvailable()?(e=localStorage.favourites&&localStorage.favourites.length>2?JSON.parse(localStorage.favourites):this.dfavourites,e=this.validFavourites(e),this.saveFavourites(e)):e=this.dfavourites;var t=this.categories.filter(function(e){return"Favourites"===e.name})[0];t?t.ops=e:this.categories.unshift({name:"Favourites",ops:e})}},{key:"validFavourites",value:function(e){for(var t=[],n=0;n<e.length;n++)this.operations.hasOwnProperty(e[n])?t.push(e[n]):this.alert('The operation "'.concat(r.a.escapeHtml(e[n]),'" is no longer available. ')+"It has been removed from your favourites.");return t}},{key:"saveFavourites",value
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
var a=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n,this.callbacks={},this.callbackID=0}var n,o,a;return n=t,(o=[{key:"registerChefWorker",value:function(){e.debug("Registering new ChefWorker"),this.chefWorker=new r.a,this.chefWorker.addEventListener("message",this.handleChefMessage.bind(this)),this.setLogLevel();var t=document.location.href.split(/[#?]/)[0],n=t.lastIndexOf("/");n>0&&(t=t.substring(0,n)),this.chefWorker.postMessage({action:"docURL",data:t})}},{key:"handleChefMessage",value:function(t){var n=t.data;switch(e.debug("Receiving '"+n.action+"' from ChefWorker"),n.action){case"bakeComplete":this.bakingComplete(n.data);break;case"bakeError":this.app.handleError(n.data),this.setBakingStatus(!1);break;case"dishReturned":this.callbacks[n.data.id](n.data);break;case"silentBakeComplete":break;case"workerLoaded":this.app.workerLoaded=!0,e.debug("ChefWorker loaded"),this.app.loaded();break;case"statusMessage":this.manager.output.setStatusMsg(n.data);break;case"optionUpdate":e.debug("Setting ".concat(n.data.option," to ").concat(n.data.value)),this.app.options[n.data.option]=n.data.value;break;case"setRegisters":this.manager.recipe.setRegisters(n.data.opIndex,n.data.numPrevRegisters,n.data.registers);break;case"highlightsCalculated":this.manager.highlighter.displayHighlights(n.data.pos,n.data.direction);break;default:e.error("Unrecognised message from ChefWorker",t)}}},{key:"setBakingStatus",value:function(e){this.app.baking=e,this.manager.output.toggleLoader(e)}},{key:"cancelBake",value:function(){this.chefWorker.terminate(),this.registerChefWorker(),this.setBakingStatus(!1),this.manager.controls.showStaleIndicator()}},{key:"bakingComplete",value:function(t){this.setBakingStatus(!1),t&&(t.error&&this.app.handleError(t.error),this.app.progress=t.progress,this.app.dish=t.dish,this.manager.recipe.updateBreakpointIndicator(t.progress),this.manager.output.set(t.result,t.type,t.duration),e.debug("--- Bake complete ---"))}},{key:"bake",value:function(e,t,n,o,r){this.setBakingStatus(!0),this.chefWorker.postMessage({action:"bake",data:{input:e,recipeConfig:t,options:n,progress:o,step:r}})}},{key:"silentBake",value:function(e){this.chefWorker.postMessage({action:"silentBake",data:{recipeConfig:e}})}},{key:"highlight",value:function(e,t,n){this.chefWorker.postMessage({action:"highlight",data:{recipeConfig:e,direction:t,pos:n}})}},{key:"getDishAs",value:function(e,t,n){var o=this.callbackID++;this.callbacks[o]=n,this.chefWorker.postMessage({action:"getDishAs",data:{dish:e,type:t,id:o}})}},{key:"setLogLevel",value:function(t){this.chefWorker&&this.chefWorker.postMessage({action:"setLogLevel",data:e.getLevel()})}}])&&p(n.prototype,o),a&&p(n,a),t}();t.a=a}).call(this,n(14))},function(e,t,n){"use strict";(function(e){var o=n(0),r=n(10);function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,p=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,p=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw p}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var i=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n}var n,i,b;return n=t,(i=[{key:"initComponents",value:function(){e("body").bootstrapMaterialDesign(),e("[data-toggle=tooltip]").tooltip({animation:!1,container:"body",boundary:"viewport",trigger:"hover"})}},{key:"setAutoBake",value:function(e){var t=document.getElementById("auto-bake");t.checked!==e&&t.click()}},{key:"bakeClick",value:function(){document.getElementById("bake").textContent.indexOf("Bake")>0?this.app.bake():this.manager.worker.cancelBake()}},{key:"stepClick",value:function(){this.app.bake(!0)}},{key:"autoBakeChange",value:function(){this.app.autoBake_=document.getElementById("auto-bake").checked}},{key:"clearRecipeClick",value:function(){this.manager.recipe.clearRecipe()}},{key:"initialiseSaveLink",value:function(e){e=e||this.app.getRecipeConfig();var t=document.getElementById("save-link-recipe-checkbox").checked,n=document.getElementById("save-link-input-checkbox").checked,r=document.getElementById("save-link"),p=this.generateStateUrl(t,n,e);r.innerHTML=o.a.truncate(p,120),r.setAttribute("href",p)}},{key:"generateStateUrl",value:function(e,t,n,a){n=n||this.app.getRecipeConfig();var i=a||window.location.protocol+"//"+window.location.host+window.location.pathname,b=o.a.generatePrettyRecipe(n),M=Object(r.c)(this.app.getInput(),"A-Za-z0-9+/"),c=[(e=e&&n.length>0)?["recipe",b]:void 0,(t=t&&M.length>0&&M.length<=68267)?["input",M]:void 0].filter(function(e){return e}).map(function(e){var t=p(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(o.a.encodeURIFragment(r))}).join("&");return c?"".concat(i,"#").concat(c):i}},{key:"saveTextChange",value:function(e){try{var t=o.a.parseRecipeConfig(e.target.value);this.initialiseSaveLink(t)}catch(e){}}},{key:"saveClick",value:function(){var t=this.app.getRecipeConfig(),n=JSON.stringify(t);document.getElementById("save-text-chef").value=o.a.generatePrettyRecipe(t,!0),document.getElementById("save-text-clean").value=JSON.stringify(t,null,2).replace(/{\n\s+"/g,'{ "').replace(/\[\n\s{3,}/g,"[").replace(/\n\s{3,}]/g,"]").replace(/\s*\n\s*}/g," }").replace(/\n\s{6,}/g," "),document.getElementById("save-text-compact").value=n,this.initialiseSaveLink(t),e("#save-modal").modal()}},{key:"slrCheckChange",value:function(){this.initialiseSaveLink()}},{key:"sliCheckChange",value:function(){this.initialiseSaveLink()}},{key:"loadClick",value:function(){this.populateLoadRecipesList(),e("#load-modal").modal()}},{key:"saveButtonClick",value:function(){if(!this.app.isLocalStorageAvailable())return this.app.alert("Your security settings do not allow access to local storage so your recipe cannot be saved.",5e3),!1;var e=o.a.escapeHtml(document.getElementById("save-name").value),t=document.querySelector("#save-texts .tab-pane.active textarea").value;if(e){var n=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[],r=localStorage.recipeId||0;n.push({id:++r,name:e,recipe:t}),localStorage.savedRecipes=JSON.stringify(n),localStorage.recipeId=r,this.app.alert('Recipe saved as "'.concat(e,'".'),3e3)}else this.app.alert("Please enter a recipe name",3e3)}},{key:"populateLoadRecipesList",value:function(){if(!this.app.isLocalStorageAvailable())return!1;for(var e=document.getElementById("load-name"),t=e.options.length;t--;)e.remove(t);var n=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[];for(t=0;t<n.length;t++){var r=document.createElement("option");r.value=n[t].id,r.innerHTML=o.a.escapeHtml(o.a.unescapeHtml(n[t].name)),e.appendChild(r)}var p=document.getElementById("load-text"),a=new Event("change");p.value=n.length?n[0].recipe:"",p.dispatchEvent(a)}},{key:"loadDeleteClick",value:function(){if(!this.app.isLocalStorageAvailable())return!1;var e=parseInt(document.getElementById("load-name").value,10),t=(localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[]).filter(function(t){return t.id!==e});localStorage.savedRecipes=JSON.stringify(t),this.populateLoadRecipesList()}},{key:"loadNameChange",value:function
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var M=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n,this.removeIntent=!1}var n,p,M;return n=t,(p=[{key:"initialiseOperationDragNDrop",value:function(){var e=document.getElementById("rec-list");a.a.create(e,{group:"recipe",sort:!0,animation:0,delay:0,filter:".arg",preventOnFilter:!1,setData:function(e,t){e.setData("Text",t.querySelector(".op-title").textContent)},onEnd:function(e){this.removeIntent&&(e.item.remove(),e.target.dispatchEvent(this.manager.operationremove))}.bind(this),onSort:function(e){"rec-list"===e.from.id&&document.dispatchEvent(this.manager.statechange)}.bind(this)}),a.a.utils.on(e,"dragover",function(){this.removeIntent=!1}.bind(this)),a.a.utils.on(e,"dragleave",function(){this.removeIntent=!0,this.app.progress=0}.bind(this)),a.a.utils.on(e,"touchend",function(t){var n=t.changedTouches[0],o=document.elementFromPoint(n.clientX,n.clientY);this.removeIntent=!e.contains(o)}.bind(this)),document.querySelector("#categories a").addEventListener("dragover",this.favDragover.bind(this)),document.querySelector("#categories a").addEventListener("dragleave",this.favDragleave.bind(this)),document.querySelector("#categories a").addEventListener("drop",this.favDrop.bind(this))}},{key:"createSortableSeedList",value:function(t){a.a.create(t,{group:{name:"recipe",pull:"clone",put:!1},sort:!1,setData:function(e,t){e.setData("Text",t.textContent)},onStart:function(t){e(t.item).popover("dispose").removeData("bs.popover").off("mouseenter").off("mouseleave").attr("data-toggle","popover-disabled"),e(t.clone).off(".popover").removeData("bs.popover")},onEnd:this.opSortEnd.bind(this)})}},{key:"opSortEnd",value:function(e){this.removeIntent?"rec-list"===e.item.parentNode.id&&e.item.remove():(this.manager.ops.enableOpsListPopovers(e.clone),"rec-list"===e.item.parentNode.id&&(this.buildRecipeOperation(e.item),e.item.dispatchEvent(this.manager.operationadd)))}},{key:"favDragover",value:function(e){if("move"!==e.dataTransfer.effectAllowed)return!1;e.stopPropagation(),e.preventDefault(),e.target.className&&e.target.className.indexOf("category-title")>-1?e.target.classList.add("favourites-hover"):e.target.parentNode.className&&e.target.parentNode.className.indexOf("category-title")>-1?e.target.parentNode.classList.add("favourites-hover"):e.target.parentNode.parentNode.className&&e.target.parentNode.parentNode.className.indexOf("category-title")>-1&&e.target.parentNode.parentNode.classList.add("favourites-hover")}},{key:"favDragleave",value:function(e){e.stopPropagation(),e.preventDefault(),document.querySelector("#categories a").classList.remove("favourites-hover")}},{key:"favDrop",value:function(e){e.stopPropagation(),e.preventDefault(),e.target.classList.remove("favourites-hover");var t=e.dataTransfer.getData("Text");this.app.addFavourite(t)}},{key:"ingChange",value:function(e){window.dispatchEvent(this.manager.statechange)}},{key:"disableClick",value:function(e){var t=e.target;"false"===t.getAttribute("disabled")?(t.setAttribute("disabled","true"),t.classList.add("disable-icon-selected"),t.parentNode.parentNode.classList.add("disabled")):(t.setAttribute("disabled","false"),t.classList.remove("disable-icon-selected"),t.parentNode.parentNode.classList.remove("disabled")),this.app.progress=0,window.dispatchEvent(this.manager.statechange)}},{key:"breakpointClick",value:function(e){var t=e.target;"false"===t.getAttribute("break")?(t.setAttribute("break","true"),t.classList.add("breakpoint-selected")):(t.setAttribute("break","false"),t.classList.remove("breakpoint-selected")),window.dispatchEvent(this.manager.statechange)}},{key:"operationDblclick",value:function(e){e.target.remove(),this.opRemove(e)}},{key:"operationChildDblclick",value:function(e){e.target.parentNode.remove(),this.opRemove(e)}},{key:"getConfig",value:function(){for(var e,t,n,o,r,p=[],a=document.querySelectorAll("#rec-list li.operation"),i=0;i<a.length;i++){e=[],n=a[i].querySelector(".disable-icon"),o=a[i].querySelector(".breakpoint"),t=a[i].querySelectorAll(".arg"
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var i=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n,this.options={},this.removeIntent=!1}var n,r,i;return n=t,(r=[{key:"searchOperations",value:function(t){var n,o;if("search"!==t.type&&13!==t.keyCode||(t.preventDefault(),(n=document.querySelectorAll("#search-results li")).length&&(o=this.getSelectedOp(n))>-1&&this.manager.recipe.addOperation(n[o].innerHTML)),40===t.keyCode)t.preventDefault(),(n=document.querySelectorAll("#search-results li")).length&&((o=this.getSelectedOp(n))>-1&&n[o].classList.remove("selected-op"),o===n.length-1&&(o=-1),n[o+1].classList.add("selected-op"));else if(38===t.keyCode)t.preventDefault(),(n=document.querySelectorAll("#search-results li")).length&&((o=this.getSelectedOp(n))>-1&&n[o].classList.remove("selected-op"),0===o&&(o=n.length),n[o-1].classList.add("selected-op"));else{for(var r=document.getElementById("search-results"),p=t.target.value;r.firstChild;){try{e(r.firstChild).popover("dispose")}catch(e){}r.removeChild(r.firstChild)}if(e("#categories .show").collapse("hide"),p){var a=this.filterOperations(p,!0).map(function(e){return e.toStubHtml()}).join("");r.innerHTML=a,r.dispatchEvent(this.manager.oplistcreate)}}}},{key:"filterOperations",value:function(e,t){var n=[],r=[],p=e.toLowerCase();for(var a in this.app.operations){var i=this.app.operations[a],b=a.toLowerCase().indexOf(p),M=i.description.toLowerCase().indexOf(p);if(b>=0||M>=0){var c=new o.a(a,this.app.operations[a],this.app,this.manager);t&&c.highlightSearchString(p,b,M),b<0?n.push(c):r.push(c)}}return r.concat(n)}},{key:"getSelectedOp",value:function(e){for(var t=0;t<e.length;t++)if(e[t].classList.contains("selected-op"))return t;return-1}},{key:"opListCreate",value:function(e){this.manager.recipe.createSortableSeedList(e.target),this.enableOpsListPopovers(e.target)}},{key:"enableOpsListPopovers",value:function(t){e(t).find("[data-toggle=popover]").addBack("[data-toggle=popover]").popover({trigger:"manual"}).on("mouseenter",function(t){if(!(t.buttons>0)){var n=this;e(this).popover("show"),e(".popover").on("mouseleave",function(){e(n).popover("hide")})}}).on("mouseleave",function(){var t=this;setTimeout(function(){e(t).data("bs.popover")&&e(t).data("bs.popover").tip&&!e(e(t).data("bs.popover").tip).is(":hover")&&e(t).popover("hide")},50)})}},{key:"operationDblclick",value:function(e){var t=e.target;this.manager.recipe.addOperation(t.textContent)}},{key:"editFavouritesClick",value:function(t){t.preventDefault(),t.stopPropagation();for(var n=this.app.categories.filter(function(e){return"Favourites"===e.name})[0],r="",a=0;a<n.ops.length;a++){var i=n.ops[a];r+=new o.a(i,this.app.operations[i],this.app,this.manager).toStubHtml(!0)}var b=document.getElementById("edit-favourites-list");b.innerHTML=r,this.removeIntent=!1;var M=p.a.create(b,{filter:".remove-icon",onFilter:function(t){var n=M.closest(t.item);n&&n.parentNode&&(e(n).popover("dispose"),n.parentNode.removeChild(n))},onEnd:function(t){this.removeIntent&&(e(t.item).popover("dispose"),t.item.remove())}.bind(this)});p.a.utils.on(b,"dragleave",function(){this.removeIntent=!0}.bind(this)),p.a.utils.on(b,"dragover",function(){this.removeIntent=!1}.bind(this)),e("#edit-favourites-list [data-toggle=popover]").popover(),e("#favourites-modal").modal()}},{key:"saveFavouritesClick",value:function(){var e=document.querySelectorAll("#edit-favourites-list li"),t=Array.from(e,function(e){return e.childNodes[0].textContent});this.app.saveFavourites(t),this.app.loadFavourites(),this.app.populateOperationsList(),this.manager.recipe.initialiseOperationDragNDrop()}},{key:"resetFavouritesClick",value:function(){this.app.resetFavourites()}}])&&a(n.prototype,r),i&&a(n,i),t}();t.a=i}).call(this,n(102))},function(e,t,n){"use strict";(function(e){var o=n(624),r=n.n(o),p=n(0);function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var i=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n,this.badKeys=[16,17,18,19,20,27,33,34,35,36,37,38,39,40,44,91,92,93,112,113,114,115,116,117,118,119,120,121,122,123,144,145],this.loaderWorker=null,this.fileBuffer=null}var n,o,i;return n=t,(o=[{key:"get",value:function(){return this.fileBuffer||document.getElementById("input-text").value}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementById("input-text");if(e instanceof File)this.setFile(e),n.value="",this.setInputInfo(e.size,null);else{n.value=e,this.closeFile(),t||window.dispatchEvent(this.manager.statechange);var o=e.length<1024*this.app.options.ioDisplayThreshold?e.count("\n")+1:null;this.setInputInfo(e.length,o)}}},{key:"setFile",value:function(e){var t=document.getElementById("input-file"),n=document.getElementById("input-file-name"),o=document.getElementById("input-file-size"),r=document.getElementById("input-file-type"),p=document.getElementById("input-file-loaded");this.fileBuffer=new ArrayBuffer,t.style.display="block",n.textContent=e.name,o.textContent=e.size.toLocaleString()+" bytes",r.textContent=e.type||"unknown",p.textContent="0%"}},{key:"setInputInfo",value:function(e,t){var n=e.toString().length;n=n<2?2:n;var o="length: "+e.toString().padStart(n," ").replace(/ /g,"&nbsp;");"number"==typeof t&&(o+="<br>lines: "+t.toString().padStart(n," ").replace(/ /g,"&nbsp;"));document.getElementById("input-info").innerHTML=o}},{key:"inputChange",value:function(e){if(!this.fileBuffer){this.manager.highlighter.removeHighlights(),this.app.progress=0;var t=this.get(),n=t.length<1024*this.app.options.ioDisplayThreshold?t.count("\n")+1:null;this.setInputInfo(t.length,n),e&&this.badKeys.indexOf(e.keyCode)<0&&window.dispatchEvent(this.manager.statechange)}}},{key:"inputPaste",value:function(e){var t=e.clipboardData.getData("Text");if(!(t.length<1024*this.app.options.ioDisplayThreshold)){e.preventDefault(),e.stopPropagation();var n=new File([t],"PastedData",{type:"text/plain",lastModified:Date.now()});return this.loaderWorker=new r.a,this.loaderWorker.addEventListener("message",this.handleLoaderMessage.bind(this)),this.loaderWorker.postMessage({file:n}),this.set(n),!1}this.inputChange(e)}},{key:"inputDragover",value:function(e){if("move"===e.dataTransfer.effectAllowed)return!1;e.stopPropagation(),e.preventDefault(),e.target.closest("#input-text,#input-file").classList.add("dropping-file")}},{key:"inputDragleave",value:function(e){e.stopPropagation(),e.preventDefault(),document.getElementById("input-text").classList.remove("dropping-file"),document.getElementById("input-file").classList.remove("dropping-file")}},{key:"inputDrop",value:function(e){if("move"===e.dataTransfer.effectAllowed)return!1;e.stopPropagation(),e.preventDefault();var t=e.dataTransfer.files[0],n=e.dataTransfer.getData("Text");if(document.getElementById("input-text").classList.remove("dropping-file"),document.getElementById("input-file").classList.remove("dropping-file"),n)return this.closeFile(),void this.set(n);t&&this.loadFile(t)}},{key:"inputOpen",value:function(e){e.preventDefault();var t=e.srcElement.files[0];this.loadFile(t)}},{key:"handleLoaderMessage",value:function(t){var n=t.data;n.hasOwnProperty("progress")&&(document.getElementById("input-file-loaded").textContent=n.progress+"%");n.hasOwnProperty("error")&&this.app.alert(n.error,1e4),n.hasOwnProperty("fileBuffer")&&(e.debug("Input file loaded"),this.fileBuffer=n.fileBuffer,this.displayFilePreview(),window.dispatchEvent(this.manager.statechange))}},{key:"displayFilePreview",value:function(){var e=document.getElementById("input-text"),t=this.fileBuffer.slice(0,4096);e.style.overflow="hidden",e.classList.add("blur"),e.value=p.a.printable(p.a.arrayBufferToStr(t)),this.fileBuffer.byteLength>4096&&(e.value+="[truncated]...")}},{key:"closeFile",value:function(){this.loaderWorker&&this.loaderWorker.terminate(),this.fileBuffer=null,document.getElementById("input-file").style.displa
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/var OutputWaiter=function(){function OutputWaiter(e,t){_classCallCheck(this,OutputWaiter),this.app=e,this.manager=t,this.dishBuffer=null,this.dishStr=null}return _createClass(OutputWaiter,[{key:"get",value:function(){return document.getElementById("output-text").value}},{key:"set",value:function(){var _set=_asyncToGenerator(regeneratorRuntime.mark(function _callee(data,type,duration,preserveBuffer){var outputText,outputHtml,outputFile,outputHighlighter,inputHighlighter,scriptElements,lines,length,i;return regeneratorRuntime.wrap(function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:log.debug("Output type: "+type),outputText=document.getElementById("output-text"),outputHtml=document.getElementById("output-html"),outputFile=document.getElementById("output-file"),outputHighlighter=document.getElementById("output-highlighter"),inputHighlighter=document.getElementById("input-highlighter"),preserveBuffer||(this.closeFile(),this.dishStr=null,document.getElementById("show-file-overlay").style.display="none"),_context.t0=type,_context.next="html"===_context.t0?10:"ArrayBuffer"===_context.t0?24:(_context.t0,33);break;case 10:for(outputText.style.display="none",outputHtml.style.display="block",outputFile.style.display="none",outputHighlighter.display="none",inputHighlighter.display="none",outputText.value="",outputHtml.innerHTML=data,scriptElements=outputHtml.querySelectorAll("script"),i=0;i<scriptElements.length;i++)try{eval(scriptElements[i].innerHTML)}catch(e){log.error(e)}return _context.next=21,this.getDishStr();case 21:return length=this.dishStr.length,lines=this.dishStr.count("\n")+1,_context.abrupt("break",44);case 24:return outputText.style.display="block",outputHtml.style.display="none",outputHighlighter.display="none",inputHighlighter.display="none",outputText.value="",outputHtml.innerHTML="",length=data.byteLength,this.setFile(data),_context.abrupt("break",44);case 33:return outputText.style.display="block",outputHtml.style.display="none",outputFile.style.display="none",outputHighlighter.display="block",inputHighlighter.display="block",outputText.value=_core_Utils__WEBPACK_IMPORTED_MODULE_0__.a.printable(data,!0),outputHtml.innerHTML="",lines=data.count("\n")+1,length=data.length,this.dishStr=data,_context.abrupt("break",44);case 44:this.manager.highlighter.removeHighlights(),this.setOutputInfo(length,lines,duration),this.backgroundMagic();case 47:case"end":return _context.stop()}},_callee,this)}));function set(e,t,n,o){return _set.apply(this,arguments)}return set}()},{key:"setFile",value:function(e){this.dishBuffer=e;var t=new File([e],"output.dat"),n=document.getElementById("output-file"),o=document.getElementById("output-file-size");n.style.display="block",o.textContent=t.size.toLocaleString()+" bytes";var r=document.getElementById("output-text"),p=this.dishBuffer.slice(0,4096);r.classList.add("blur"),r.value=_core_Utils__WEBPACK_IMPORTED_MODULE_0__.a.printable(_core_Utils__WEBPACK_IMPORTED_MODULE_0__.a.arrayBufferToStr(p))}},{key:"closeFile",value:function(){this.dishBuffer=null,document.getElementById("output-file").style.display="none",document.getElementById("output-text").classList.remove("blur")}},{key:"downloadFile",value:function(){var e=_asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.filename=window.prompt("Please enter a filename:",this.filename||"download.dat"),e.next=3,this.getDishBuffer();case 3:t=new File([this.dishBuffer],this.filename),this.filename&&file_saver__WEBPACK_IMPORTED_MODULE_1___default.a.saveAs(t,this.filename,!1);case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"displayFileSlice",value:function(){var e=(new Date).getTime(),t=document.getElementById("show-file-overlay"),n=document.getElementById("output-file-slice-from"),o=document.getElementById("output-file-slice-to"),r=parseInt(n.value,10),p=parseInt(o.value,10),a=_core_Utils__WEBPACK_IMPORTED_MODULE_0__.a.arrayBufferToStr(this.dishBuffer.slice(r,p));d
/**
* Waiter to handle events related to the CyberChef options.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @constructor
* @param {App} app - The main view object for CyberChef.
*/
var o=function(e,t){this.app=e,this.manager=t};o.prototype.load=function(e){for(var t in e)this.app.options[t]=e[t];var n,o=document.querySelectorAll("#options-body input[type=checkbox]");for(n=0;n<o.length;n++)o[n].checked=this.app.options[o[n].getAttribute("option")];var r=document.querySelectorAll("#options-body input[type=number]");for(n=0;n<r.length;n++)r[n].value=this.app.options[r[n].getAttribute("option")],r[n].dispatchEvent(new CustomEvent("change",{bubbles:!0}));var p=document.querySelectorAll("#options-body select");for(n=0;n<p.length;n++){var a=this.app.options[p[n].getAttribute("option")];a?(p[n].value=a,p[n].dispatchEvent(new CustomEvent("change",{bubbles:!0}))):p[n].selectedIndex=0}},o.prototype.optionsClick=function(t){t.preventDefault(),e("#options-modal").modal()},o.prototype.resetOptionsClick=function(){this.load(this.app.doptions)},o.prototype.switchChange=function(e){var t=e.target,o=t.getAttribute("option"),r=t.checked;n.debug("Setting ".concat(o," to ").concat(r)),this.app.options[o]=r,this.app.isLocalStorageAvailable()&&localStorage.setItem("options",JSON.stringify(this.app.options))},o.prototype.numberChange=function(e){var t=e.target,o=t.getAttribute("option"),r=parseInt(t.value,10);n.debug("Setting ".concat(o," to ").concat(r)),this.app.options[o]=r,this.app.isLocalStorageAvailable()&&localStorage.setItem("options",JSON.stringify(this.app.options))},o.prototype.selectChange=function(e){var t=e.target,o=t.getAttribute("option");n.debug("Setting ".concat(o," to ").concat(t.value)),this.app.options[o]=t.value,this.app.isLocalStorageAvailable()&&localStorage.setItem("options",JSON.stringify(this.app.options))},o.prototype.setWordWrap=function(){document.getElementById("input-text").classList.remove("word-wrap"),document.getElementById("output-text").classList.remove("word-wrap"),document.getElementById("output-html").classList.remove("word-wrap"),document.getElementById("input-highlighter").classList.remove("word-wrap"),document.getElementById("output-highlighter").classList.remove("word-wrap"),this.app.options.wordWrap||(document.getElementById("input-text").classList.add("word-wrap"),document.getElementById("output-text").classList.add("word-wrap"),document.getElementById("output-html").classList.add("word-wrap"),document.getElementById("input-highlighter").classList.add("word-wrap"),document.getElementById("output-highlighter").classList.add("word-wrap"))},o.prototype.themeChange=function(e){var t=e.target.value;document.querySelector(":root").className=t},o.prototype.logLevelChange=function(e){var t=e.target.value;n.setLevel(t,!1),this.manager.worker.setLogLevel()},t.a=o}).call(this,n(102),n(14))},function(e,t,n){"use strict";(function(e){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var o=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n}var o,r,p;return o=t,(r=[{key:"load",value:function(){this.kkeys=[],window.addEventListener("keydown",this.konamiCodeListener.bind(this))}},{key:"konamiCodeListener",value:function(t){this.kkeys.push(t.keyCode);for(var n=[38,38,40,40,37,39,37,39,66,65],o=0;o<this.kkeys.length;o++){if(this.kkeys[o]!==n[o]){this.kkeys=[];break}o===n.length-1&&(e("body").children().toggleClass("konami"),this.kkeys=[])}}}])&&n(o.prototype,r),p&&n(o,p),t}();t.a=o}).call(this,n(102))},function(e,t,n){"use strict";(function(e){var o=n(517),r=n.n(o);function p(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
var a=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.app=e,this.manager=n,this.callbacks={},this.callbackID=0,this.completedCallback=-1,this.timeout=null}var n,o,a;return n=t,(o=[{key:"registerChefWorker",value:function(){e.debug("Registering new background ChefWorker"),this.chefWorker=new r.a,this.chefWorker.addEventListener("message",this.handleChefMessage.bind(this));var t=document.location.href.split(/[#?]/)[0],n=t.lastIndexOf("/");n>0&&(t=t.substring(0,n)),this.chefWorker.postMessage({action:"docURL",data:t})}},{key:"handleChefMessage",value:function(t){var n=t.data;switch(e.debug("Receiving '"+n.action+"' from ChefWorker in the background"),n.action){case"bakeComplete":case"bakeError":void 0!==n.data.id&&(clearTimeout(this.timeout),this.callbacks[n.data.id].bind(this)(n.data),this.completedCallback=n.data.id);break;case"workerLoaded":e.debug("Background ChefWorker loaded");break;case"optionUpdate":case"statusMessage":break;default:e.error("Unrecognised message from background ChefWorker",t)}}},{key:"cancelBake",value:function(){this.chefWorker&&this.chefWorker.terminate(),this.registerChefWorker()}},{key:"bake",value:function(e,t,n,o,r,p){var a=this.callbackID++;this.callbacks[a]=p,this.chefWorker.postMessage({action:"bake",data:{input:e,recipeConfig:t,options:n,progress:o,step:r,id:a}})}},{key:"magic",value:function(e){this.completedCallback+1<this.callbackID&&(clearTimeout(this.timeout),this.cancelBake()),this.bake(e,[{op:"Magic",args:[3,!1,!1]}],{},0,!1,this.magicComplete),this.timeout=setTimeout(this.cancelBake.bind(this),3e3)}},{key:"magicComplete",value:function(t){e.debug("--- Background Magic Bake complete ---"),t&&!t.error&&this.manager.output.backgroundMagicResult(t.dish.value)}}])&&p(n.prototype,o),a&&p(n,a),t}();t.a=a}).call(this,n(14))},function(e,t,n){"use strict";function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.selected=n,this.opList=[]}var t,n,r;return t=e,(n=[{key:"addOperation",value:function(e){this.opList.push(e)}},{key:"toHtml",value:function(){for(var e="cat"+this.name.replace(/[\s\/-:_]/g,""),t='<div class="panel category">\n <a class="category-title" data-toggle="collapse" data-target="#'.concat(e,'">\n ').concat(this.name,'\n </a>\n <div id="').concat(e,'" class="panel-collapse collapse ').concat(this.selected?" show":"",'" data-parent="#categories">\n <ul class="op-list">'),n=0;n<this.opList.length;n++)t+=this.opList[n].toStubHtml();return t+="</ul></div></div>"}}])&&o(t.prototype,n),r&&o(t,r),e}();t.a=r},function(e){e.exports=[{name:"Favourites",ops:[]},{name:"Data format",ops:["To Hexdump","From Hexdump","To Hex","From Hex","To Charcode","From Charcode","To Decimal","From Decimal","To Binary","From Binary","To Octal","From Octal","To Base64","From Base64","Show Base64 offsets","To Base32","From Base32","To Base58","From Base58","To Base62","From Base62","To Base85","From Base85","To Base","From Base","To BCD","From BCD","To HTML Entity","From HTML Entity","URL Encode","URL Decode","Escape Unicode Characters","Unescape Unicode Characters","To Quoted Printable","From Quoted Printable","To Punycode","From Punycode","To Hex Content","From Hex Content","PEM to Hex","Hex to PEM","Parse ASN.1 hex string","Change IP format","Encode text","Decode text","Text Encoding Brute Force","Swap endianness","To MessagePack","From MessagePack","To Braille","From Braille","Parse TLV","CSV to JSON","JSON to CSV"]},{name:"Encryption / Encoding",ops:["AES Encrypt","AES Decrypt","Blowfish Encrypt","Blowfish Decrypt","DES Encrypt","DES Decrypt","Triple DES Encrypt","Triple DES Decrypt","RC2 Encrypt","RC2 Decrypt","RC4","RC4 Drop","ROT13","ROT47","XOR","XOR Brute Force","Vigenère Encode","Vigenère Decode","To Morse Code","From Morse Code","Bifid Cipher Encode","Bifid Cipher Decode","Affine Cipher Encode","Affine Cipher Decode","A1Z26 Cipher Encode","A1Z26 Cipher Decode","Atbash Cipher","Substitute","Derive PBKDF2 key","Derive EVP key","Bcrypt","Scrypt","JWT Sign","JWT Verify","JWT Decode","Citrix CTX1 Encode","Citrix CTX1 Decode","Pseudo-Random Number Generator"]},{name:"Public Key",ops:["Parse X.509 certificate","Parse ASN.1 hex string","PEM to Hex","Hex to PEM","Hex to Object Identifier","Object Identifier to Hex","Generate PGP Key Pair","PGP Encrypt","PGP Decrypt","PGP Encrypt and Sign","PGP Decrypt and Verify"]},{name:"Arithmetic / Logic",ops:["Set Union","Set Intersection","Set Difference","Symmetric Difference","Cartesian Product","Power Set","XOR","XOR Brute Force","OR","NOT","AND","ADD","SUB","Sum","Subtract","Multiply","Divide","Mean","Median","Standard Deviation","Bit shift left","Bit shift right","Rotate left","Rotate right","ROT13"]},{name:"Networking",ops:["HTTP request","DNS over HTTPS","Strip HTTP headers","Dechunk HTTP response","Parse User Agent","Parse IP range","Parse IPv6 address","Parse IPv4 header","Parse URI","URL Encode","URL Decode","Format MAC addresses","Change IP format","Group IP addresses","Encode NetBIOS Name","Decode NetBIOS Name","Defang URL"]},{name:"Language",ops:["Encode text","Decode text","Remove Diacritics","Unescape Unicode Characters"]},{name:"Utils",ops:["Diff","Remove whitespace","Remove null bytes","To Upper case","To Lower case","To Case Insensitive Regex","From Case Insensitive Regex","Add line numbers","Remove line numbers","To Table","Reverse","Sort","Unique","Split","Filter","Head","Tail","Count occurrences","Expand alphabet range","Drop bytes","Take bytes","Pad lines","Find / Replace","Regular expression","Offset checker","Hamming Distance","Convert distance","Convert area","Convert mass","Convert speed","Convert data units","Convert co-ordinate format","Parse UNIX file permissions","Swap endianness","Parse colour code","Escape string","Unescape string","Pseudo-Random Number Generator","Sleep"]},{n
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.app=t}var t,n,o;return t=e,(n=[{key:"windowResize",value:function(){clearTimeout(this.resetLayoutTimeout),this.resetLayoutTimeout=setTimeout(this.app.resetLayout.bind(this.app),200)}},{key:"windowBlur",value:function(){this.windowBlurTime=(new Date).getTime()}},{key:"windowFocus",value:function(){(new Date).getTime()-this.windowBlurTime>6e4&&this.app.silentBake()}}])&&r(t.prototype,n),o&&r(t,o),e}(),a=n(763),i=n(764),b=n(765),M=n(766),c=n(767),z=n(769);function s(e,t,n,o,r,p,a){try{var i=e[p](a),b=i.value}catch(e){return void n(e)}i.done?t(b):Promise.resolve(b).then(o,r)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var O=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.app=t,this.manager=n,this.mouseButtonDown=!1,this.mouseTarget=null}var t,n,o;return t=e,(n=[{key:"_isSelectionBackwards",value:function(){var e=!1,t=window.getSelection();if(!t.isCollapsed){var n=document.createRange();n.setStart(t.anchorNode,t.anchorOffset),n.setEnd(t.focusNode,t.focusOffset),e=n.collapsed,n.detach()}return e}},{key:"_getOutputHtmlOffset",value:function(e,t){var n=window.getSelection(),o=document.createRange();return o.selectNodeContents(document.getElementById("output-html")),o.setEnd(e,t),n.removeAllRanges(),n.addRange(o),n.toString().length}},{key:"_getOutputHtmlSelectionOffsets",value:function(){var e,t=window.getSelection(),n=0,o=0,r=!1;return t.rangeCount&&(e=t.getRangeAt(t.rangeCount-1),r=this._isSelectionBackwards(),n=this._getOutputHtmlOffset(e.startContainer,e.startOffset),o=this._getOutputHtmlOffset(e.endContainer,e.endOffset),t.removeAllRanges(),t.addRange(e),r&&(t.collapseToEnd(),t.extend(t.anchorNode,e.startOffset))),{start:n,end:o}}},{key:"inputScroll",value:function(e){var t=e.target;document.getElementById("input-highlighter").scrollTop=t.scrollTop,document.getElementById("input-highlighter").scrollLeft=t.scrollLeft}},{key:"outputScroll",value:function(e){var t=e.target;document.getElementById("output-highlighter").scrollTop=t.scrollTop,document.getElementById("output-highlighter").scrollLeft=t.scrollLeft}},{key:"inputMousedown",value:function(e){this.mouseButtonDown=!0,this.mouseTarget=0,this.removeHighlights();var t=e.target,n=t.selectionStart,o=t.selectionEnd;0===n&&0===o||(document.getElementById("input-selection-info").innerHTML=this.selectionInfo(n,o),this.highlightOutput([{start:n,end:o}]))}},{key:"outputMousedown",value:function(e){this.mouseButtonDown=!0,this.mouseTarget=1,this.removeHighlights();var t=e.target,n=t.selectionStart,o=t.selectionEnd;0===n&&0===o||(document.getElementById("output-selection-info").innerHTML=this.selectionInfo(n,o),this.highlightInput([{start:n,end:o}]))}},{key:"outputHtmlMousedown",value:function(e){this.mouseButtonDown=!0,this.mouseTarget=1;var t=this._getOutputHtmlSelectionOffsets();0===t.start&&0===t.end||(document.getElementById("output-selection-info").innerHTML=this.selectionInfo(t.start,t.end))}},{key:"inputMouseup",value:function(e){this.mouseButtonDown=!1}},{key:"outputMouseup",value:function(e){this.mouseButtonDown=!1}},{key:"outputHtmlMouseup",value:function(e){this.mouseButtonDown=!1}},{key:"inputMousemove",value:function(e){if(this.mouseButtonDown&&1===e.which&&0===this.mouseTarget){var t=e.target,n=t.selectionStart,o=t.selectionEnd;0===n&&0===o||(document.getElementById("input-selection-info").innerHTML=this.selectionInfo(n,o),this.highlightOutput([{start:n,end:o}]))}}},{key:"outputMousemove",value:function(e){if(this.mouseButtonDown&&1===e.which&&1===this.mouseTarget){var t=e.target,n=t.selectionStart,o=t.selectionEnd;0===n&&0===o||(document.getElementById("output-selection-info").innerHTML=this.selectionInfo(n,o),this.highlightInput([{start:n,end:o}]))}}},{key:"outputHtmlMousemove",value:function(e){if(this.mouseButtonDown&&1===e.which&&1===this.mouseTarget){var t=this._getOutputHtmlSelectionOffsets();0===t.start&&0===t.end||(document.getElementById("output-selection-info").innerHTML=this.selectionInfo(t.start,t.end))}}},{key:"selectionInfo",value:function(e,t){var n=t.toString().length,o=n<2?2:n;return"start: "+e.toString().padStart(o," ").replace(/ /g,"&nbsp;")+"<br>end: "+t.toString().padStart(o," ").replace(/ /g,"&nbsp;")+"<br>length: "+(t-e).toString().padStart(o," ").replace(/ /g,"&nbsp;")}},{key:"removeHighlights",value:function(){document.getElementById("input-highlighter").innerHTML="",document.getElementById("output-highlighter").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""}},{key:"highlightOutput",value:function(e){if(!this.app.autoBake_||this.app.baking)return!1;this.manager.worker.highlight(th
/**
* @author Matt C [matt@artemisbot.uk]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var A=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.app=t,this.manager=n}var t,n,o;return t=e,(n=[{key:"parseInput",value:function(e){var t,n=this.app.options.useMetaKey?e.metaKey:e.altKey;if(e.ctrlKey&&n)switch(e.code){case"KeyF":e.preventDefault(),document.getElementById("search").focus();break;case"KeyI":e.preventDefault(),document.getElementById("input-text").focus();break;case"KeyO":e.preventDefault(),document.getElementById("output-text").focus();break;case"Period":e.preventDefault();try{(t=document.activeElement.closest(".operation")||document.querySelector("#rec-list .operation")).parentNode.lastChild===t?t.parentNode.firstChild.querySelectorAll(".arg")[0].focus():t.nextSibling.querySelectorAll(".arg")[0].focus()}catch(e){}break;case"KeyB":e.preventDefault();try{"false"===(t=document.activeElement.closest(".operation").querySelectorAll(".breakpoint")[0]).getAttribute("break")?(t.setAttribute("break","true"),t.classList.add("breakpoint-selected")):(t.setAttribute("break","false"),t.classList.remove("breakpoint-selected")),window.dispatchEvent(this.manager.statechange)}catch(e){}break;case"KeyD":e.preventDefault();try{"false"===(t=document.activeElement.closest(".operation").querySelectorAll(".disable-icon")[0]).getAttribute("disabled")?(t.setAttribute("disabled","true"),t.classList.add("disable-elem-selected"),t.parentNode.parentNode.classList.add("disabled")):(t.setAttribute("disabled","false"),t.classList.remove("disable-elem-selected"),t.parentNode.parentNode.classList.remove("disabled")),this.app.progress=0,window.dispatchEvent(this.manager.statechange)}catch(e){}break;case"Space":e.preventDefault(),this.app.bake();break;case"Quote":e.preventDefault(),this.app.bake(!0);break;case"KeyC":e.preventDefault(),this.manager.recipe.clearRecipe();break;case"KeyS":e.preventDefault(),this.manager.output.saveClick();break;case"KeyL":e.preventDefault(),this.manager.controls.loadClick();break;case"KeyM":e.preventDefault(),this.manager.output.switchClick();break;default:if(e.code.match(/Digit[0-9]/g)){e.preventDefault();try{document.querySelector("li:nth-child(".concat(e.code.substr(-1),") .arg")).focus()}catch(e){}}}}},{key:"updateKeybList",value:function(){var e="Alt",t="Opt";this.app.options.useMetaKey&&(e="Win",t="Cmd"),document.getElementById("keybList").innerHTML="\n <tr>\n <td><b>Command</b></td>\n <td><b>Shortcut (Win/Linux)</b></td>\n <td><b>Shortcut (Mac)</b></td>\n </tr>\n <tr>\n <td>Place cursor in search field</td>\n <td>Ctrl+".concat(e,"+f</td>\n <td>Ctrl+").concat(t,"+f</td>\n <tr>\n <td>Place cursor in input box</td>\n <td>Ctrl+").concat(e,"+i</td>\n <td>Ctrl+").concat(t,"+i</td>\n </tr>\n <tr>\n <td>Place cursor in output box</td>\n <td>Ctrl+").concat(e,"+o</td>\n <td>Ctrl+").concat(t,"+o</td>\n </tr>\n <tr>\n <td>Place cursor in first argument field of the next operation in the recipe</td>\n <td>Ctrl+").concat(e,"+.</td>\n <td>Ctrl+").concat(t,"+.</td>\n </tr>\n <tr>\n <td>Place cursor in first argument field of the nth operation in the recipe</td>\n <td>Ctrl+").concat(e,"+[1-9]</td>\n <td>Ctrl+").concat(t,"+[1-9]</td>\n </tr>\n <tr>\n <td>Disable current operation</td>\n <td>Ctrl+").concat(e,"+d</td>\n <td>Ctrl+").concat(t,"+d</td>\n </tr>\n <tr>\n <td>Set/clear breakpoint</td>\n <td>Ctrl+").concat(e,"+b</td>\n <td>Ctrl+").concat(t,"+b</td>\n </tr>\n <tr>\n <td>Bake</td>\n <td>Ctrl+").concat(e,"+Space</td>\n <td>Ctrl+").concat(t,"+Space</td>\n </tr>\n <tr>\n <td>Step</td>\n <td>Ctrl+").concat(e,"+'</td>\n <td>Ctrl+").concat(t,"+'</td>\n </tr>\n <tr>\n
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var h=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.app=t,this.appstart=new CustomEvent("appstart",{bubbles:!0}),this.apploaded=new CustomEvent("apploaded",{bubbles:!0}),this.operationadd=new CustomEvent("operationadd",{bubbles:!0}),this.operationremove=new CustomEvent("operationremove",{bubbles:!0}),this.oplistcreate=new CustomEvent("oplistcreate",{bubbles:!0}),this.statechange=new CustomEvent("statechange",{bubbles:!0}),this.worker=new o.a(this.app,this),this.window=new p(this.app),this.controls=new a.a(this.app,this),this.recipe=new i.a(this.app,this),this.ops=new b.a(this.app,this),this.input=new M.a(this.app,this),this.output=new c.a(this.app,this),this.options=new z.a(this.app,this),this.highlighter=new O(this.app,this),this.seasonal=new d.a(this.app,this),this.bindings=new A(this.app,this),this.background=new f.a(this.app,this),this.dynamicHandlers={},this.initialiseEventListeners()}var t,n,r;return t=e,(n=[{key:"setup",value:function(){this.worker.registerChefWorker(),this.recipe.initialiseOperationDragNDrop(),this.controls.initComponents(),this.controls.autoBakeChange(),this.bindings.updateKeybList(),this.background.registerChefWorker(),this.seasonal.load()}},{key:"initialiseEventListeners",value:function(){window.addEventListener("resize",this.window.windowResize.bind(this.window)),window.addEventListener("blur",this.window.windowBlur.bind(this.window)),window.addEventListener("focus",this.window.windowFocus.bind(this.window)),window.addEventListener("statechange",this.app.stateChange.bind(this.app)),window.addEventListener("popstate",this.app.popState.bind(this.app)),document.getElementById("bake").addEventListener("click",this.controls.bakeClick.bind(this.controls)),document.getElementById("auto-bake").addEventListener("change",this.controls.autoBakeChange.bind(this.controls)),document.getElementById("step").addEventListener("click",this.controls.stepClick.bind(this.controls)),document.getElementById("clr-recipe").addEventListener("click",this.controls.clearRecipeClick.bind(this.controls)),document.getElementById("save").addEventListener("click",this.controls.saveClick.bind(this.controls)),document.getElementById("save-button").addEventListener("click",this.controls.saveButtonClick.bind(this.controls)),document.getElementById("save-link-recipe-checkbox").addEventListener("change",this.controls.slrCheckChange.bind(this.controls)),document.getElementById("save-link-input-checkbox").addEventListener("change",this.controls.sliCheckChange.bind(this.controls)),document.getElementById("load").addEventListener("click",this.controls.loadClick.bind(this.controls)),document.getElementById("load-delete-button").addEventListener("click",this.controls.loadDeleteClick.bind(this.controls)),document.getElementById("load-name").addEventListener("change",this.controls.loadNameChange.bind(this.controls)),document.getElementById("load-button").addEventListener("click",this.controls.loadButtonClick.bind(this.controls)),document.getElementById("support").addEventListener("click",this.controls.supportButtonClick.bind(this.controls)),this.addMultiEventListeners("#save-texts textarea","keyup paste",this.controls.saveTextChange,this.controls),this.addMultiEventListener("#search","keyup paste search",this.ops.searchOperations,this.ops),this.addDynamicListener(".op-list li.operation","dblclick",this.ops.operationDblclick,this.ops),document.getElementById("edit-favourites").addEventListener("click",this.ops.editFavouritesClick.bind(this.ops)),document.getElementById("save-favourites").addEventListener("click",this.ops.saveFavouritesClick.bind(this.ops)),document.getElementById("reset-favourites").addEventListener("click",this.ops.resetFavouritesClick.bind(this.ops)),this.addDynamicListener(".op-list","oplistcreate",this.ops.opListCreate,this.ops),this.addDynamicListener("li.operation","operationadd",this.recipe.opAdd,this.recipe),this.addDynamicListener(".arg:not(select)","input",this.recipe.ingChange,this.recipe),this.addDynamicListener(".arg[type=chec
/*!
* Sizzle CSS Selector Engine v2.3.3
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-08-08
*/
/*!
* Sizzle CSS Selector Engine v2.3.3
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-08-08
*/
!function(r){var p,a,i,b,M,c,z,s,u,O,d,l,A,f,q,h,m,W,y,g="sizzle"+1*new Date,_=r.document,L=0,v=0,R=ce(),B=ce(),w=ce(),X=function(e,t){return e===t&&(d=!0),0},T={}.hasOwnProperty,k=[],S=k.pop,N=k.push,C=k.push,D=k.slice,E=function(e,t){for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",x="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",P="\\["+F+"*("+x+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+x+"))|)"+F+"*\\]",Y=":("+x+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",I=new RegExp(F+"+","g"),j=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),U=new RegExp("^"+F+"*,"+F+"*"),V=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),G=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),K=new RegExp(Y),J=new RegExp("^"+x+"$"),Z={ID:new RegExp("^#("+x+")"),CLASS:new RegExp("^\\.("+x+")"),TAG:new RegExp("^("+x+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Y),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,ee=/^[^{]+\{\s*\[native \w/,te=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ne=/[+~]/,oe=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),re=function(e,t,n){var o="0x"+t-65536;return o!=o||n?t:o<0?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,1023&o|56320)},pe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ae=function(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){l()},be=We(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{C.apply(k=D.call(_.childNodes),_.childNodes),k[_.childNodes.length].nodeType}catch(e){C={apply:k.length?function(e,t){N.apply(e,D.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}function Me(e,t,n,o){var r,p,i,b,M,z,u,O=t&&t.ownerDocument,d=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==d&&9!==d&&11!==d)return n;if(!o&&((t?t.ownerDocument||t:_)!==A&&l(t),t=t||A,q)){if(11!==d&&(M=te.exec(e)))if(r=M[1]){if(9===d){if(!(i=t.getElementById(r)))return n;if(i.id===r)return n.push(i),n}else if(O&&(i=O.getElementById(r))&&y(t,i)&&i.id===r)return n.push(i),n}else{if(M[2])return C.apply(n,t.getElementsByTagName(e)),n;if((r=M[3])&&a.getElementsByClassName&&t.getElementsByClassName)return C.apply(n,t.getElementsByClassName(r)),n}if(a.qsa&&!w[e+" "]&&(!h||!h.test(e))){if(1!==d)O=t,u=e;else if("object"!==t.nodeName.toLowerCase()){for((b=t.getAttribute("id"))?b=b.replace(pe,ae):t.setAttribute("id",b=g),p=(z=c(e)).length;p--;)z[p]="#"+b+" "+me(z[p]);u=z.join(","),O=ne.test(e)&&qe(t.parentNode)||t}if(u)try{return C.apply(n,O.querySelectorAll(u)),n}catch(e){}finally{b===g&&t.removeAttribute("id")}}}return s(e.replace(j,"$1"),t,n,o)}function ce(){var e=[];return function t(n,o){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function ze(e){return e[g]=!0,e}function se(e){var t=A.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=t}function Oe(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function le(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function Ae(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.14.6
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/var n;n=function(){"use strict";for(var e="undefined"!=typeof window&&"undefined"!=typeof document,n=["Edge","Trident","Firefox"],o=0,r=0;r<n.length;r+=1)if(e&&navigator.userAgent.indexOf(n[r])>=0){o=1;break}var p=e&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},o))}};function a(e){return e&&"[object Function]"==={}.toString.call(e)}function i(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function b(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function M(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=i(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/(auto|scroll|overlay)/.test(n+r+o)?e:M(b(e))}var c=e&&!(!window.MSInputMethodContext||!document.documentMode),z=e&&/MSIE 10/.test(navigator.userAgent);function s(e){return 11===e?c:10===e?z:c||z}function u(e){if(!e)return document.documentElement;for(var t=s(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var o=n&&n.nodeName;return o&&"BODY"!==o&&"HTML"!==o?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===i(n,"position")?u(n):n:e?e.ownerDocument.documentElement:document.documentElement}function O(e){return null!==e.parentNode?O(e.parentNode):e}function d(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,r=n?t:e,p=document.createRange();p.setStart(o,0),p.setEnd(r,0);var a,i,b=p.commonAncestorContainer;if(e!==b&&t!==b||o.contains(r))return"BODY"===(i=(a=b).nodeName)||"HTML"!==i&&u(a.firstElementChild)!==a?u(b):b;var M=O(e);return M.host?d(M.host,t):d(e,O(t).host)}function l(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var o=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||o)[t]}return e[t]}function A(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+o+"Width"],10)}function f(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],s(10)?parseInt(n["offset"+e])+parseInt(o["margin"+("Height"===e?"Top":"Left")])+parseInt(o["margin"+("Height"===e?"Bottom":"Right")]):0)}function q(e){var t=e.body,n=e.documentElement,o=s(10)&&getComputedStyle(n);return{height:f("Height",t,n,o),width:f("Width",t,n,o)}}var h=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),W=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function g(e){return y({},e,{right:e.left+e.width,bottom:e.top+e.height})}function _(e){var t={};try{if(s(10)){t=e.getBoundingClientRect();var n=l(e,"top"),o=l(e,"left");t.top+=n,t.left+=o,t.bottom+=n,t.right+=o}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},p="HTML"===e.nodeName?q(e.ownerDocument):{},a=p.width||e.clientWidth||r.right-r.left,b=p.height||e.clientHeight||r.bottom-r.top,M=e.offsetWidth-a,c=e.offsetHeight-b;if(M||c){var z=i(e);M-=A(z,"x"),c-=A(z,"y"),r.width-=M,r.height-=c}return g(r)}function L(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=s(10),r="HTML"===t.nodeName,p=_(e),a=_(t),b=M(e),c=i(t),z=parseFloat(c.borderTopWidth,10),u=parseFloat(c.borderLeft
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.14.6
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var n="undefined"!=typeof window&&"undefined"!=typeof document,o=["Edge","Trident","Firefox"],r=0,p=0;p<o.length;p+=1)if(n&&navigator.userAgent.indexOf(o[p])>=0){r=1;break}var a=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},r))}};function i(e){return e&&"[object Function]"==={}.toString.call(e)}function b(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function M(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function c(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=b(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/(auto|scroll|overlay)/.test(n+r+o)?e:c(M(e))}var z=n&&!(!window.MSInputMethodContext||!document.documentMode),s=n&&/MSIE 10/.test(navigator.userAgent);function u(e){return 11===e?z:10===e?s:z||s}function O(e){if(!e)return document.documentElement;for(var t=u(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var o=n&&n.nodeName;return o&&"BODY"!==o&&"HTML"!==o?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===b(n,"position")?O(n):n:e?e.ownerDocument.documentElement:document.documentElement}function d(e){return null!==e.parentNode?d(e.parentNode):e}function l(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,r=n?t:e,p=document.createRange();p.setStart(o,0),p.setEnd(r,0);var a,i,b=p.commonAncestorContainer;if(e!==b&&t!==b||o.contains(r))return"BODY"===(i=(a=b).nodeName)||"HTML"!==i&&O(a.firstElementChild)!==a?O(b):b;var M=d(e);return M.host?l(M.host,t):l(e,d(t).host)}function A(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var o=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||o)[t]}return e[t]}function f(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+o+"Width"],10)}function q(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],u(10)?parseInt(n["offset"+e])+parseInt(o["margin"+("Height"===e?"Top":"Left")])+parseInt(o["margin"+("Height"===e?"Bottom":"Right")]):0)}function h(e){var t=e.body,n=e.documentElement,o=u(10)&&getComputedStyle(n);return{height:q("Height",t,n,o),width:q("Width",t,n,o)}}var m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},W=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),y=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function _(e){return g({},e,{right:e.left+e.width,bottom:e.top+e.height})}function L(e){var t={};try{if(u(10)){t=e.getBoundingClientRect();var n=A(e,"top"),o=A(e,"left");t.top+=n,t.left+=o,t.bottom+=n,t.right+=o}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},p="HTML"===e.nodeName?h(e.ownerDocument):{},a=p.width||e.clientWidth||r.right-r.left,i=p.height||e.clientHeight||r.bottom-r.top,M=e.offsetWidth-a,c=e.offsetHeight-i;if(M||c){var z=b(e);M-=f(z,"x"),c-=f(z,"y"),r.width-=M,r.height-=c}return _(r)}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=u(10),r="HTML"===t.nodeName,p=L(e),a=L(t),i=c(e),M=b(t),z=parseFloat(M.borderTopWidth,10),s=parseFloat(M.borderLeftWidth,10);n&&r&&(a.top=Math.max(a.top,0
/*!
* Bootstrap Colorpicker v2.5.2
* https://itsjavi.com/bootstrap-colorpicker/
*
* Originally written by (c) 2012 Stefan Petre
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
*/o=[n(102)],void 0===(r=function(e){return function(e){"use strict";var t=function(n,o,r,p,a){this.fallbackValue=r?"string"==typeof r?this.parse(r):r:null,this.fallbackFormat=p||"rgba",this.hexNumberSignPrefix=!0===a,this.value=this.fallbackValue,this.origFormat=null,this.predefinedColors=o||{},this.colors=e.extend({},t.webColors,this.predefinedColors),n&&(void 0!==n.h?this.value=n:this.setColor(String(n))),this.value||(this.value={h:0,s:0,b:0,a:1})};t.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"},t.prototype={constructor:t,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(e){this.value=e},_sanitizeNumber:function(e){return"number"==typeof e?e:isNaN(e)||null===e||""===e||void 0===e?1:""===e?0:void 0!==e.toLowerCase?(e.match(/^\./)&&(e="0"+e),Math.ceil(100*parseFloat(e))/100):1},isTransparent:function(e){return!(!e||!("string"==typeof e||e instanceof String))&&("transparent"===(e=e.toLowerCase().trim())||e.match(/#?00000000/)||e.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/))},rgbaIsTransparent:function(e){return 0===e.r&&0===e.g&&0===e.b&&0===e.a},setColor:function(e){if(e=e.toLowerCase().trim()){if(this.isTransparent(e))return this.value={h:0,s:0,b:0,a:0},!0;var t=this.parse(e);t?(this.value=this.value={h:t.h,s:t.s,b:t.b,a:t.a},this.origFormat||(this.origFormat=t.format)):this.fallbackValue&&(this.value=this.fallbackValue)}return!1},setHue:function(e){this.value.h=1-e},setSaturation:function(e){this.value
/**
* Various components for drawing diagrams on an HTML5 canvas.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
function a(e,t,n,o,r){e.beginPath(),e.moveTo(t,n),e.lineTo(o,r),e.closePath(),e.stroke()}function i(e,t,n,o,r,p,i){i=i||15,(!r||r>Math.round(e.width/50))&&(r=Math.round(e.width/50)),(!p||p>Math.round(e.width/50))&&(p=Math.round(e.height/50));var b=e.getContext("2d"),M=.08*e.width,c=.03*e.width,z=.08*e.height,s=.2*e.height,u=e.height-z-s,O=e.width-M-c,d=z+u,l=z;b.font=i+"px Arial",b.lineWidth="1.0",b.strokeStyle="#444",a(b,M,d,O+M,d),a(b,M,d,M,l);var A,f=.003*O,q=(O-f*t.length)/t.length,h=Math.max.apply(Math,t),m=M+f;b.fillStyle="green";for(var W=0;W<t.length;W++){var y=t[W]/h*u;b.fillRect(m,d-y,q,y),m+=q+f}if(b.fillStyle="black",b.textAlign="center",m=M+f,r>=t.length)for(var g=0;g<=t.length;g++)b.fillText(g,m,d+.3*s),m+=q+f;else for(var _=0;_<=r;_++){var L=Math.ceil(t.length/r*_);m=O/r*_+M,b.fillText(L,m,d+.3*s)}if(b.textAlign="right",p>=h)for(var v=0;v<=h;v++)A=d-v/h*u+i/3,b.fillText(v,.8*M,A);else for(var R=0;R<=p;R++){var B=Math.ceil(h/p*R);A=d-B/h*u+i/3,b.fillText(B,.8*M,A)}if(n&&(b.textAlign="center",b.fillText(n,O/2+M,d+.8*s)),o){b.save();var w=.3*M,X=u/2+z;b.translate(w,X),b.rotate(-Math.PI/2),b.textAlign="center",b.fillText(o,0,0),b.restore()}}function b(e,t,n,o){var r=e.getContext("2d"),p=.01*e.width,i=.01*e.width,b=.1*e.height,M=.35*e.height,c=e.height-b-M,z=e.width-p-i,s=t/n;r.strokeRect(p,b,z,c);var u,O,d,l,A=r.createLinearGradient(p,0,z+p,0);A.addColorStop(0,"green"),A.addColorStop(.5,"gold"),A.addColorStop(1,"red"),r.fillStyle=A,r.fillRect(p,b,z*s,c),r.fillStyle="black",r.textAlign="center",r.font="13px Arial";for(var f=0;f<o.length;f++)a(r,u=z/n*o[f].min+p,O=b+c+.1*M,d=u,l=b+c+.3*M),a(r,u=z/n*o[f].max+p,O,d=u,l),a(r,u=z/n*o[f].min+p,O=b+c+.3*M,d=z/n*o[f].max+p,l=O),o[f].max>=.9*n?(r.textAlign="right",u=d):o[f].max<=.1*n?r.textAlign="left":u+=(d-u)/2,O=b+c+.8*M,r.fillText(o[f].label,u,O)}var M=n(761),c=n(773),z=n(61);window.compileTime=p.a.tz("09/03/2019 01:28:06 UTC","DD/MM/YYYY HH:mm:ss z","UTC").valueOf(),window.compileMessage="New in v8: <a href='https://github.com/gchq/CyberChef/wiki/Automatic-detection-of-encoded-data-using-CyberChef-Magic'>Automated encoding detection</a> and <a href='https://github.com/gchq/CyberChef/wiki/Adding-a-new-operation'>simplified operation building</a>",window.CanvasComponents=o,document.addEventListener("DOMContentLoaded",
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
function e(){document.removeEventListener("DOMContentLoaded",e,!1),window.app=new M.a(c,z,["To Base64","From Base64","To Hex","From Hex","To Hexdump","From Hexdump","URL Decode","Regular expression","Entropy","Fork","Magic"],{updateUrl:!0,showHighlighter:!0,treatAsUtf8:!0,wordWrap:!0,showErrors:!0,errorTimeout:4e3,attemptHighlight:!0,theme:"classic",useMetaKey:!1,ioDisplayThreshold:512,logLevel:"info",autoMagic:!0}),window.app.setup()},!1)}]);