/**
 * 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 r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1410)}({0:function(e,t,r){"use strict";(function(e,n){r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return b})),r.d(t,"e",(function(){return w})),r.d(t,"a",(function(){return A}));var i=r(6),o=r.n(i),a=r(1),u=r.n(a),s=r(2),l=r.n(s),c=r(23),f=r.n(c),h=r(15),p=r(16),d=r(28),m=r(27),v=function(){function t(){u()(this,t)}return l()(t,null,[{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),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),[...e].forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];y()&&window.app&&!window.app.options.treatAsUtf8&&(e=t.byteArrayToChars(t.strToByteArray(e)));var n=/[\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-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,i=/[\x09-\x10\x0D\u2028\u2029]/g;return e=e.replace(n,"."),r||(e=e.replace(i,".")),e}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([bfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n<e.length;n++)if(n<e.length-2&&"-"===e[n+1]&&"\\"!==e[n]){for(var i=t.ord(e[n]),o=t.ord(e[n+2]),a=i;a<=o;a++)r.push(t.chr(a));n+=2}else n<e.length-2&&"\\"===e[n]&&"-"===e[n+1]?(r.push("-"),n++):r.push(e[n]);return r}},{key:"convertToByteArray",value:function(e,r){switch(r.toLowerCase()){case"binary":return Object(m.a)(e);case"hex":return Object(p.a)(e);case"decimal":return Object(d.a)(e);case"base64":return Object(h.a)(e,null,"byteArray");case"utf8":return t.strToUtf8ByteArray(e);case"latin1":default:return t.strToByteArray(e)}}},{key:"convertToByteString",value:function(e,r){switch(r.toLowerCase()){case"binary":return t.byteArrayToChars(Object(m.a)(e));case"hex":return t.byteArrayToChars(Object(p.a)(e));case"decimal":return t.byteArrayToChars(Object(d.a)(e));case"base64":return t.byteArrayToChars(Object(h.a)(e,null,"byteArray"));case"utf8":return f.a.encode(e);case"latin1":default:return e}}},{key:"strToArrayBuffer",value:function(e){for(var r,n=new Uint8Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ArrayBuffer(e);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){var r=f.a.encode(e);return e.length!==r.length&&(b()?self.setOption("attemptHighlight",!1):y()&&(window.app.options.attemptHighlight=!1)),t.strToArrayBuffer(r)}},{key:"strToByteArray",value:function(e){for(var r,n=new Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){var r=f.a.encode(e);return e.length!==r.length&&(b()?self.setOption("attemptHighlight",!1):y()&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(n<e.length-1&&i>=55296&&i<56320){var o=e[n+1].charCodeAt(0);o>=56320&&o<57344&&(i=t.ord(e[n]+e[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(e){var r=t.byteArrayToChars(e);try{var n=f.a.decode(r);return r.length!==n.length&&(b()?self.setOption("attemptHighlight",!1):y()&&(window.app.options.attemptHighlight=!1)),n}catch(e){return r}}},{key:"byteArrayToChars",value:function(e){if(!e)return"";for(var t="",r=0;r<e.length;)t+=String.fromCharCode(e[r++]);return t}},{key:"arrayBufferToStr",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new Uint8Array(e);return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t<e.length;t++)n[e[t]]++;for(t=0;t<n.length;t++)n[t]>0&&r.push(n[t]/e.length);var i,o=0;for(t=0;t<r.length;t++)o+=(i=r[t])*Math.log(i)/Math.log(2);return-o}},{key:"parseCSV",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],o=!1,a=!1,u="",s=[],l=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var c=0;c<e.length;c++)t=e[c],r=e[c+1]||"",o?(u+=t,o=!1):'"'!==t||a?'"'===t&&a?'"'===r?o=!0:a=!1:!a&&n.indexOf(t)>=0?(s.push(u),u=""):!a&&i.indexOf(t)>=0?(s.push(u),u="",l.push(s),s=[],i.indexOf(r)>=0&&r!==t&&c++):u+=t:a=!0;return s.length&&(s.push(u),l.push(s)),l}},{key:"stripHtmlTags",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t&&(e=e.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gim,"")),e.replace(/<[^>]+>/g,"")}},{key:"escapeHtml",value:function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"};return e.replace(/[&<>"'/`]/g,(function(e){return t[e]}))}},{key:"unescapeHtml",value:function(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x2F;":"/","&#x60;":"`"};return e.replace(/&#?x?[a-z0-9]{2,4};/gi,(function(e){return t[e]||e}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",o="",a="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),o=e.disabled?"/disabled":"",a=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${o}${a})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var o={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(o.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(o.breakpoint=!0),i.push(o)}return i}},{key:"displayFilesAsHTML",value:function(e){var r,n,i,a,u;return o.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:r=function(e){return`<div class='card' style='white-space: normal;'>\n                    <div class='card-header'>\n                        <h6 class="mb-0">\n                            ${t.escapeHtml(e.name)}\n                        </h6>\n                    </div>\n                </div>`},n=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";","<img style='max-width: 100%;' src='"+(n+="base64,"+Object(h.b)(e))+"'>"}return`<pre>${t.escapeHtml(t.arrayBufferToStr(e.buffer))}</pre>`},i=function(e,r){var i,a,u,s;return o.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.a.awrap(t.readFile(e));case 2:return i=l.sent,a=new Blob([i],{type:e.type||"octet/stream"}),u=URL.createObjectURL(a),s=`<div class='card' style='white-space: normal;'>\n                    <div class='card-header' id='heading${r}'>\n                        <h6 class='mb-0'>\n                            <a class='collapsed'\n                                data-toggle='collapse'\n                                href='#collapse${r}'\n                                aria-expanded='false'\n                                aria-controls='collapse${r}'\n                                title="Show/hide contents of '${t.escapeHtml(e.name)}'">\n                                ${t.escapeHtml(e.name)}</a>\n                            <span class='float-right' style="margin-top: -3px">\n                                ${e.size.toLocaleString()} bytes\n                                <a title="Download ${t.escapeHtml(e.name)}"\n                                    href="${u}"\n                                    download="${t.escapeHtml(e.name)}"\n                                    data-toggle="tooltip">\n                                    <i class="material-icons" style="vertical-align: bottom">save</i>\n                                </a>\n                                <a title="Move to input"\n                                    href="#"\n                                    blob-url="${u}"\n                                    file-name="${t.escapeHtml(e.name)}"\n                                    class="extract-file"\n                                    data-toggle="tooltip">\n                                    <i class="material-icons" style="vertical-align: bottom">open_in_browser</i>\n                                </a>\n                            </span>\n                        </h6>\n                    </div>\n                    <div id='collapse${r}' class='collapse' aria-labelledby='heading${r}' data-parent="#files">\n                        <div class='card-body'>\n                            ${n(i,e.type)}\n                        </div>\n                    </div>\n                </div>`,l.abrupt("return",s);case 7:case"end":return l.stop()}}))},a=`<div style='padding: 5px; white-space: normal;'>\n                ${e.length} file(s) found\n            </div><div id="files" style="padding: 20px">`,u=0;case 5:if(!(u<e.length)){s.next=17;break}if(!e[u].name.endsWith("/")){s.next=10;break}a+=r(e[u]),s.next=14;break;case 10:return s.t0=a,s.next=13,o.a.awrap(i(e[u],u));case 13:a=s.t0+=s.sent;case 14:u++,s.next=5;break;case 17:return s.abrupt("return",a+="</div>");case 18:case"end":return s.stop()}}))}},{key:"parseURIParams",value:function(e){if(""===e)return{};"?"!==e[0]&&"#"!==e[0]||(e=e.substr(1));for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");2!==i.length?r[t[n]]=!0:r[i[0]]=decodeURIComponent(i[1].replace(/\+/g," "))}return r}},{key:"readFile",value:function(t){return g()?e.from(t).buffer:new Promise((function(e,r){var n=new FileReader,i=new Uint8Array(t.size),o=0,a=function(){if(o>=t.size)e(i);else{var r=t.slice(o,o+10485760);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),o),o+=10485760,a()},n.onerror=function(e){r(n.error.message)},a()}))}},{key:"readFileSync",value:function(e){if(!g())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;r<t;r++)if(e*r%26==1)return r}},{key:"charRep",value:function(e){return{Space:" ",Percent:"%",Comma:",","Semi-colon":";",Colon:":",Tab:"\t","Line feed":"\n",CRLF:"\r\n","Forward slash":"/",Backslash:"\\","0x":"0x","\\x":"\\x","Nothing (separate chars)":"",None:""}[e]}},{key:"regexRep",value:function(e){return{Space:/\s+/g,Percent:/%/g,Comma:/,/g,"Semi-colon":/;/g,Colon:/:/g,"Line feed":/\n/g,CRLF:/\r\n/g,"Forward slash":/\//g,Backslash:/\\/g,"0x":/0x/g,"\\x":/\\x/g,None:/\s+/g}[e]}}]),t}();function g(){return void 0!==n&&null!=n.versions&&null!=n.versions.node}function y(){return"object"==typeof window}function b(){return"function"==typeof importScripts}function w(e){b()?self.sendStatusMessage(e):y()?app.alert(e,1e4):g()&&console.debug(e)}t.b=v,Array.prototype.unique=function(){for(var e={},t=[],r=0,n=this.length;r<n;r++)Object.prototype.hasOwnProperty.call(e,this[r])||(t.push(this[r]),e[this[r]]=1);return t},Array.prototype.max=function(){return Math.max.apply(null,this)},Array.prototype.min=function(){return Math.min.apply(null,this)},Array.prototype.sum=function(){return this.reduce((function(e,t){return e+t}),0)},Array.prototype.equals=function(e){if(!e)return!1;var t=this.length;if(t!==e.length)return!1;for(;t--;)if(this[t]!==e[t])return!1;return!0},String.prototype.count=function(e){return this.split(e).length-1};var x={};function A(e,t,r,n,i){return function(){clearTimeout(x[r]),x[r]=setTimeout((function(){e.apply(n,i)}),t)}}String.prototype.padStart||(String.prototype.padStart=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))})}).call(this,r(11).Buffer,r(25))},1:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},11:function(e,t,r){"use strict";(function(e){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <http://feross.org>
 * @license  MIT
 */
var n=r(40),i=r(41),o=r(42);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,r)}function l(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=u(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(s.isBuffer(t)){var r=0|p(t.length);return 0===(e=u(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?u(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=u(e,t<0?0:0|p(t)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|p(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<u;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===s)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+s>u&&(r=u-s),o=r;o>=0;o--){for(var f=!0,h=0;h<s;h++)if(l(e,o+h)!==l(t,h)){f=!1;break}if(f)return o}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(t.substr(2*a,2),16);if(isNaN(u))return a;e[r+a]=u}return a}function w(e,t,r,n){return $(G(t,e.length-r),e,r,n)}function x(e,t,r,n){return $(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return x(e,t,r,n)}function B(e,t,r,n){return $(Y(t),e,r,n)}function F(e,t,r,n){return $(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,u,s,l=e[i],c=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(s=(31&l)<<6|63&o)>127&&(c=s);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(s=(15&l)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:o=e[i+1],a=e[i+2],u=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(s=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}t.Buffer=s,t.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,r){return l(null,e,t,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?u(e,t):void 0!==r?"string"==typeof n?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}(null,e,t,r)},s.allocUnsafe=function(e){return f(null,e)},s.allocUnsafeSlow=function(e){return f(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=s.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):m.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,r,n,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),u=Math.min(o,a),l=this.slice(n,i),c=e.slice(t,r),f=0;f<u;++f)if(l[f]!==c[f]){o=l[f],a=c[f];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return A(this,e,t,r);case"base64":return B(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function S(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=j(e[o]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function L(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function _(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||_(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return o||_(e,0,r,8),i.write(e,t,r,n,52,8),r+8}s.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=s.prototype;else{var i=t-e;r=new s(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},s.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},s.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var o=0,a=1,u=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===u&&0!==this[t+o-1]&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=s.isBuffer(e)?e:G(new s(e,n).toString()),u=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%u]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(26))},12:function(e,t,r){var n=r(44),i=r(45),o=r(46);e.exports=function(e,t){return n(e)||i(e,t)||o()}},13:function(e,t,r){"use strict";var n=r(6),i=r.n(n),o=r(1),a=r.n(o),u=r(2),s=r.n(u),l=r(0),c=r(4),f=r.n(c),h=r(3),p=r.n(h),d=r(22),m=r.n(d),v=r(5),g=r.n(v);
/**
 * Custom error type for handling Dish type errors.
 * i.e. where the Dish cannot be successfully translated between types
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */
var y=function(e){function t(){var e;a()(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=f()(this,p()(t).call(this,...n))).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(m()(e),t),e}return g()(t,e),t}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)),b=r(14),w=r.n(b),x=r(18),A=r(24),B=r.n(A),F=function(){function e(){a()(this,e)}return s()(e,null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];throw new Error("fromArrayBuffer has not been implemented")}}]),e}(),E=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}]),t}(F),k=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=w.a.isBigNumber(this.value)?l.b.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value);try{this.value=new w.a(l.b.arrayBufferToStr(this.value,!e))}catch(e){this.value=new w.a(NaN)}}}]),t}(F),T=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){var e=this;if(t.checkForValue(this.value),!Object(l.c)())return new Promise((function(t,r){l.b.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=l.b.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new File(this.value,"unknown")}}]),t}(F),R=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?l.b.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value),this.value=this.value?l.b.arrayBufferToStr(this.value,!e):""}}]),t}(F),C=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?l.b.strToArrayBuffer(l.b.unescapeHtml(l.b.stripHtmlTags(this.value,!0))):new ArrayBuffer}}]),t}(R),S=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?l.b.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value),this.value=JSON.parse(l.b.arrayBufferToStr(this.value,!e))}}]),t}(F),I=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.checkForValue(this.value),!Object(l.c)()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,i.a.awrap(t.concatenateTypedArraysWithTypedElements(...this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),null,this)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:function(){var e,t,r,n,o,a,u,s,c,f,h,p,d,m=arguments;return i.a.async((function(v){for(;;)switch(v.prev=v.next){case 0:for(e=0,t=m.length,r=new Array(t),n=0;n<t;n++)r[n]=m[n];for(o=0,a=r;o<a.length;o++)u=a[o],e+=u.size;s=new Uint8Array(e),c=0,f=0,h=r;case 6:if(!(f<h.length)){v.next=16;break}return p=h[f],v.next=10,i.a.awrap(l.b.readFile(p));case 10:d=v.sent,s.set(d,c),c+=d.length;case 13:f++,v.next=6;break;case 16:return v.abrupt("return",s);case 17:case"end":return v.stop()}}))}},{key:"concatenateTypedArrays",value:function(){for(var e=0,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0,o=r;i<o.length;i++){var a=o[i];e+=a.length}for(var u=new Uint8Array(e),s=0,l=0,c=r;l<c.length;l++){var f=c[l];u.set(f,s),s+=f.length}return u}}]),t}(F),O=function(e){function t(){return a()(this,t),f()(this,p()(t).apply(this,arguments))}return g()(t,e),s()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value="number"==typeof this.value?l.b.strToArrayBuffer(this.value.toString()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value),this.value=this.value?parseFloat(l.b.arrayBufferToStr(this.value,!e)):0}}]),t}(F),D=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(a()(this,e),this.value=new ArrayBuffer(0),this.type=e.ARRAY_BUFFER,t&&Object.prototype.hasOwnProperty.call(t,"value")&&Object.prototype.hasOwnProperty.call(t,"type"))this.set(t.value,t.type);else if(t&&null!==r)this.set(t,r);else if(t){var n=e.typeEnum(t.constructor.name);this.set(t,n)}}return s()(e,[{key:"get",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"==typeof t&&(t=e.typeEnum(t)),this.type!==t?Object(l.c)()?(this._translate(t,n),this.value):new Promise((function(e,i){r._translate(t,n).then((function(){e(r.value)})).catch(i)})):this.value}},{key:"set",value:function(t,r){if("string"==typeof r&&(r=e.typeEnum(r)),B.a.debug("Dish type: "+e.enumLookup(r)),this.value=t,this.type=r,!this.valid()){var n=l.b.truncate(JSON.stringify(this.value),25);throw new y(`Data is not a valid ${e.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.clone();return r.get(e,t)}},{key:"detectDishType",value:function(){var e=new Uint8Array(this.value.slice(0,2048)),t=Object(x.a)(e);return t.length&&t[0].mime&&"text/plain"!==!t[0].mime?t[0].mime:null}},{key:"getTitle",value:function(t){var r,n;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:r="",o.t0=this.type,o.next=o.t0===e.FILE?4:o.t0===e.LIST_FILE?6:o.t0===e.JSON?8:o.t0===e.NUMBER?10:o.t0===e.BIG_NUMBER?10:o.t0===e.ARRAY_BUFFER?12:o.t0===e.BYTE_ARRAY?12:15;break;case 4:return r=this.value.name,o.abrupt("break",26);case 6:return r=`${this.value.length} file(s)`,o.abrupt("break",26);case 8:return r="application/json",o.abrupt("break",26);case 10:return r=this.value.toString(),o.abrupt("break",26);case 12:if(null===(r=this.detectDishType())){o.next=15;break}return o.abrupt("break",26);case 15:return o.prev=15,(n=this.clone()).value=n.value.slice(0,256),o.next=20,i.a.awrap(n.get(e.STRING));case 20:r=o.sent,o.next=26;break;case 23:o.prev=23,o.t1=o.catch(15),B.a.error(`${e.enumLookup(this.type)} cannot be sliced. ${o.t1}`);case 26:return o.abrupt("return",r.slice(0,t));case 27:case"end":return o.stop()}}),null,this,[[15,23]])}},{key:"valid",value:function(){switch(this.type){case e.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var t=0;t<this.value.length;t++)if("number"!=typeof this.value[t]||this.value[t]<0||this.value[t]>255)return!1;return!0;case e.STRING:case e.HTML:return"string"==typeof this.value;case e.NUMBER:return"number"==typeof this.value;case e.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case e.BIG_NUMBER:if(w.a.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new w.a;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case e.JSON:return!0;case e.FILE:return this.value instanceof File;case e.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"clone",value:function(){var t=new e;switch(this.type){case e.STRING:case e.HTML:case e.NUMBER:case e.BIG_NUMBER:t.set(this.value,this.type);break;case e.BYTE_ARRAY:case e.JSON:t.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case e.ARRAY_BUFFER:t.set(this.value.slice(0),this.type);break;case e.FILE:t.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case e.LIST_FILE:t.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new y("Cannot clone Dish, unknown type")}return t}},{key:"_translate",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(B.a.debug(`Translating Dish from ${e.enumLookup(this.type)} to ${e.enumLookup(t)}`),!Object(l.c)())return new Promise((function(n,i){r._toArrayBuffer().then((function(){return r.type=e.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(t),n()})).catch(i)}));this._toArrayBuffer(),this.type=e.ARRAY_BUFFER,this._fromArrayBuffer(t,n)}},{key:"_toArrayBuffer",value:function(){var t=this,r={browser:{[e.STRING]:function(){return Promise.resolve(R.toArrayBuffer.bind(t)())},[e.NUMBER]:function(){return Promise.resolve(O.toArrayBuffer.bind(t)())},[e.HTML]:function(){return Promise.resolve(C.toArrayBuffer.bind(t)())},[e.ARRAY_BUFFER]:function(){return Promise.resolve()},[e.BIG_NUMBER]:function(){return Promise.resolve(k.toArrayBuffer.bind(t)())},[e.JSON]:function(){return Promise.resolve(S.toArrayBuffer.bind(t)())},[e.FILE]:function(){return T.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Promise.resolve(I.toArrayBuffer.bind(t)())},[e.BYTE_ARRAY]:function(){return Promise.resolve(E.toArrayBuffer.bind(t)())}},node:{[e.STRING]:function(){return R.toArrayBuffer.bind(t)()},[e.NUMBER]:function(){return O.toArrayBuffer.bind(t)()},[e.HTML]:function(){return C.toArrayBuffer.bind(t)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return k.toArrayBuffer.bind(t)()},[e.JSON]:function(){return S.toArrayBuffer.bind(t)()},[e.FILE]:function(){return T.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return I.toArrayBuffer.bind(t)()},[e.BYTE_ARRAY]:function(){return E.toArrayBuffer.bind(t)()}}};try{return r[Object(l.c)()?"node":"browser"][this.type]()}catch(t){throw new y(`Error translating from ${e.enumLookup(this.type)} to ArrayBuffer: ${t}`)}}},{key:"_fromArrayBuffer",value:function(t,r){var n=this,i={[e.STRING]:function(){return R.fromArrayBuffer.bind(n)(r)},[e.NUMBER]:function(){return O.fromArrayBuffer.bind(n)(r)},[e.HTML]:function(){return C.fromArrayBuffer.bind(n)(r)},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return k.fromArrayBuffer.bind(n)(r)},[e.JSON]:function(){return S.fromArrayBuffer.bind(n)(r)},[e.FILE]:function(){return T.fromArrayBuffer.bind(n)()},[e.LIST_FILE]:function(){return I.fromArrayBuffer.bind(n)()},[e.BYTE_ARRAY]:function(){return E.fromArrayBuffer.bind(n)()}};try{i[t](),this.type=t}catch(r){throw new y(`Error translating from ArrayBuffer to ${e.enumLookup(t)}: ${r}`)}}},{key:"size",get:function(){switch(this.type){case e.BYTE_ARRAY:case e.STRING:case e.HTML:return this.value.length;case e.NUMBER:case e.BIG_NUMBER:return this.value.toString().length;case e.ARRAY_BUFFER:return this.value.byteLength;case e.JSON:return JSON.stringify(this.value).length;case e.FILE:return this.value.size;case e.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}}],[{key:"typeEnum",value:function(t){switch(t.toLowerCase()){case"bytearray":case"byte array":return e.BYTE_ARRAY;case"string":return e.STRING;case"number":return e.NUMBER;case"html":return e.HTML;case"arraybuffer":case"array buffer":return e.ARRAY_BUFFER;case"bignumber":case"big number":return e.BIG_NUMBER;case"json":case"object":return e.JSON;case"file":return e.FILE;case"list<file>":return e.LIST_FILE;default:throw new y("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(t){switch(t){case e.BYTE_ARRAY:return"byteArray";case e.STRING:return"string";case e.NUMBER:return"number";case e.HTML:return"html";case e.ARRAY_BUFFER:return"ArrayBuffer";case e.BIG_NUMBER:return"BigNumber";case e.JSON:return"JSON";case e.FILE:return"File";case e.LIST_FILE:return"List<File>";default:throw new y("Invalid data type enum. No matching type.")}}}]),e}();D.BYTE_ARRAY=0,D.STRING=1,D.NUMBER=2,D.HTML=3,D.ARRAY_BUFFER=4,D.BIG_NUMBER=5,D.JSON=6,D.FILE=7,D.LIST_FILE=8;t.a=D},14:function(e,t,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,s=Math.floor,l="[BigNumber Error] ",c=l+"Number primitive has more than 15 significant digits: ",f=1e14,h=14,p=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,v=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=h-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(e,t){var r,n,i=e.c,o=t.c,a=e.s,u=t.s,s=e.e,l=t.e;if(!a||!u)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==l,!i||!o)return n?0:!i^r?1:-1;if(!n)return s>l^r?1:-1;for(u=(s=i.length)<(l=o.length)?s:l,a=0;a<u;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return s==l?0:s>l^r?1:-1}function w(e,t,r,n){if(e<t||e>r||e!==s(e))throw Error(l+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return g(e.e/h)==t&&e.c[t]%2!=0}function A(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function B(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,F,E,k,T,R,C=Y.prototype={constructor:Y,toString:null,valueOf:null},S=new Y(1),I=20,O=4,D=-7,P=21,L=-1e7,_=1e7,U=!1,M=1,N=0,j={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},G="0123456789abcdefghijklmnopqrstuvwxyz";function Y(e,t){var r,o,u,l,f,d,m,v,g=this;if(!(g instanceof Y))return new Y(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>_?g.c=g.e=null:e.e<L?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,f=e;f>=10;f/=10,l++);return void(l>_?g.c=g.e=null:(g.e=l,g.c=[e]))}v=String(e)}else{if(!a.test(v=String(e)))return i(g,v,d);g.s=45==v.charCodeAt(0)?(v=v.slice(1),-1):1}(l=v.indexOf("."))>-1&&(v=v.replace(".","")),(f=v.search(/e/i))>0?(l<0&&(l=f),l+=+v.slice(f+1),v=v.substring(0,f)):l<0&&(l=v.length)}else{if(w(t,2,G.length,"Base"),10==t)return W(g=new Y(e),I+g.e+1,O);if(v=String(e),d="number"==typeof e){if(0*e!=0)return i(g,v,d,t);if(g.s=1/e<0?(v=v.slice(1),-1):1,Y.DEBUG&&v.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else g.s=45===v.charCodeAt(0)?(v=v.slice(1),-1):1;for(r=G.slice(0,t),l=f=0,m=v.length;f<m;f++)if(r.indexOf(o=v.charAt(f))<0){if("."==o){if(f>l){l=m;continue}}else if(!u&&(v==v.toUpperCase()&&(v=v.toLowerCase())||v==v.toLowerCase()&&(v=v.toUpperCase()))){u=!0,f=-1,l=0;continue}return i(g,String(e),d,t)}d=!1,(l=(v=n(v,t,10,g.s)).indexOf("."))>-1?v=v.replace(".",""):l=v.length}for(f=0;48===v.charCodeAt(f);f++);for(m=v.length;48===v.charCodeAt(--m););if(v=v.slice(f,++m)){if(m-=f,d&&Y.DEBUG&&m>15&&(e>p||e!==s(e)))throw Error(c+g.s*e);if((l=l-f-1)>_)g.c=g.e=null;else if(l<L)g.c=[g.e=0];else{if(g.e=l,g.c=[],f=(l+1)%h,l<0&&(f+=h),f<m){for(f&&g.c.push(+v.slice(0,f)),m-=h;f<m;)g.c.push(+v.slice(f,f+=h));f=h-(v=v.slice(f)).length}else f-=m;for(;f--;v+="0");g.c.push(+v)}}else g.c=[g.e=0]}function $(e,t,r,n){var i,o,a,u,s;if(null==r?r=O:w(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)s=y(e.c),s=1==n||2==n&&(a<=D||a>=P)?A(s,a):B(s,a,"0");else if(o=(e=W(new Y(e),t,r)).e,u=(s=y(e.c)).length,1==n||2==n&&(t<=o||o<=D)){for(;u<t;s+="0",u++);s=A(s,o)}else if(t-=a,s=B(s,o,"0"),o+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=o-u)>0)for(o+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function V(e,t){for(var r,n=1,i=new Y(e[0]);n<e.length;n++){if(!(r=new Y(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function H(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*h-1)>_?e.c=e.e=null:r<L?e.c=[e.e=0]:(e.e=r,e.c=t),e}function W(e,t,r,n){var i,o,a,l,c,p,m,v=e.c,g=d;if(v){e:{for(i=1,l=v[0];l>=10;l/=10,i++);if((o=t-i)<0)o+=h,a=t,m=(c=v[p=0])/g[i-a-1]%10|0;else if((p=u((o+1)/h))>=v.length){if(!n)break e;for(;v.length<=p;v.push(0));c=m=0,i=1,a=(o%=h)-h+1}else{for(c=l=v[p],i=1;l>=10;l/=10,i++);m=(a=(o%=h)-h+i)<0?0:c/g[i-a-1]%10|0}if(n=n||t<0||null!=v[p+1]||(a<0?c:c%g[i-a-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(o>0?a>0?c/g[i-a]:0:v[p-1])%10&1||r==(e.s<0?8:7)),t<1||!v[0])return v.length=0,n?(t-=e.e+1,v[0]=g[(h-t%h)%h],e.e=-t||0):v[0]=e.e=0,e;if(0==o?(v.length=p,l=1,p--):(v.length=p+1,l=g[h-o],v[p]=a>0?s(c/g[i-a]%g[a])*l:0),n)for(;;){if(0==p){for(o=1,a=v[0];a>=10;a/=10,o++);for(a=v[0]+=l,l=1;a>=10;a/=10,l++);o!=l&&(e.e++,v[0]==f&&(v[0]=1));break}if(v[p]+=l,v[p]!=f)break;v[p--]=0,l=1}for(o=v.length;0===v[--o];v.pop());}e.e>_?e.c=e.e=null:e.e<L&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=y(e.c),t=r<=D||r>=P?A(t,r):B(t,r,"0"),e.s<0?"-"+t:t)}return Y.clone=e,Y.ROUND_UP=0,Y.ROUND_DOWN=1,Y.ROUND_CEIL=2,Y.ROUND_FLOOR=3,Y.ROUND_HALF_UP=4,Y.ROUND_HALF_DOWN=5,Y.ROUND_HALF_EVEN=6,Y.ROUND_HALF_CEIL=7,Y.ROUND_HALF_FLOOR=8,Y.EUCLID=9,Y.config=Y.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(l+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,v,t),I=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),O=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-v,0,t),w(r[1],0,v,t),D=r[0],P=r[1]):(w(r,-v,v,t),D=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-v,-1,t),w(r[1],1,v,t),L=r[0],_=r[1];else{if(w(r,-v,v,t),!r)throw Error(l+t+" cannot be zero: "+r);L=-(_=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(l+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(l+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),M=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,v,t),N=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(l+t+" not an object: "+r);j=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(l+t+" invalid: "+r);G=r}}return{DECIMAL_PLACES:I,ROUNDING_MODE:O,EXPONENTIAL_AT:[D,P],RANGE:[L,_],CRYPTO:U,MODULO_MODE:M,POW_PRECISION:N,FORMAT:j,ALPHABET:G}},Y.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!Y.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-v&&i<=v&&i===s(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%h)<1&&(t+=h),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==s(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(l+"Invalid BigNumber: "+e)},Y.maximum=Y.max=function(){return V(arguments,C.lt)},Y.minimum=Y.min=function(){return V(arguments,C.gt)},Y.random=(o=9007199254740992*Math.random()&2097151?function(){return s(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,c=0,f=[],p=new Y(S);if(null==e?e=I:w(e,0,v),i=u(e/h),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));c<i;)(a=131072*t[c]+(t[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(f.push(a%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(l+"crypto unavailable");for(t=crypto.randomBytes(i*=7);c<i;)(a=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(f.push(a%1e14),c+=7);c=i/7}if(!U)for(;c<i;)(a=o())<9e15&&(f[c++]=a%1e14);for(i=f[--c],e%=h,i&&e&&(a=d[h-e],f[c]=s(i/a)*a);0===f[c];f.pop(),c--);if(c<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=h);for(c=1,a=f[0];a>=10;a/=10,c++);c<h&&(n-=h-c)}return p.e=n,p.c=f,p}),Y.sum=function(){for(var e=1,t=arguments,r=new Y(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,a=[0],u=0,s=e.length;u<s;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(u++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(t,n,i,o,a){var u,s,l,c,f,h,p,d,m=t.indexOf("."),v=I,g=O;for(m>=0&&(c=N,N=0,t=t.replace(".",""),h=(d=new Y(n)).pow(t.length-m),N=c,d.c=e(B(y(h.c),h.e,"0"),10,i,"0123456789"),d.e=d.c.length),l=c=(p=e(t,n,i,a?(u=G,"0123456789"):(u="0123456789",G))).length;0==p[--c];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=o,p=(h=r(h,d,v,g,i)).c,f=h.r,l=h.e),m=p[s=l+v+1],c=i/2,f=f||s<0||null!=p[s+1],f=g<4?(null!=m||f)&&(0==g||g==(h.s<0?3:2)):m>c||m==c&&(4==g||f||6==g&&1&p[s-1]||g==(h.s<0?8:7)),s<1||!p[0])t=f?B(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(p.length=s,f)for(--i;++p[--s]>i;)p[s]=0,s||(++l,p=[1].concat(p));for(c=p.length;!p[--c];);for(m=0,t="";m<=c;t+=u.charAt(p[m++]));t=B(t,l,u.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,u=0,s=e.length,l=t%m,c=t/m|0;for(e=e.slice();s--;)u=((i=l*(o=e[s]%m)+(n=c*o+(a=e[s]/m|0)*l)%m*m+u)/r|0)+(n/m|0)+c*a,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,u){var l,c,p,d,m,v,y,b,w,x,A,B,F,E,k,T,R,C=n.s==i.s?1:-1,S=n.c,I=i.c;if(!(S&&S[0]&&I&&I[0]))return new Y(n.s&&i.s&&(S?!I||S[0]!=I[0]:I)?S&&0==S[0]||!I?0*C:C/0:NaN);for(w=(b=new Y(C)).c=[],C=o+(c=n.e-i.e)+1,u||(u=f,c=g(n.e/h)-g(i.e/h),C=C/h|0),p=0;I[p]==(S[p]||0);p++);if(I[p]>(S[p]||0)&&c--,C<0)w.push(1),d=!0;else{for(E=S.length,T=I.length,p=0,C+=2,(m=s(u/(I[0]+1)))>1&&(I=e(I,m,u),S=e(S,m,u),T=I.length,E=S.length),F=T,A=(x=S.slice(0,T)).length;A<T;x[A++]=0);R=I.slice(),R=[0].concat(R),k=I[0],I[1]>=u/2&&k++;do{if(m=0,(l=t(I,x,T,A))<0){if(B=x[0],T!=A&&(B=B*u+(x[1]||0)),(m=s(B/k))>1)for(m>=u&&(m=u-1),y=(v=e(I,m,u)).length,A=x.length;1==t(v,x,y,A);)m--,r(v,T<y?R:I,y,u),y=v.length,l=1;else 0==m&&(l=m=1),y=(v=I.slice()).length;if(y<A&&(v=[0].concat(v)),r(x,v,A,u),A=x.length,-1==l)for(;t(I,x,T,A)<1;)m++,r(x,T<A?R:I,A,u),A=x.length}else 0===l&&(m++,x=[0]);w[p++]=m,x[0]?x[A++]=S[F]||0:(x=[S[F]],A=1)}while((F++<E||null!=x[0])&&C--);d=null!=x[0],w[0]||w.splice(0,1)}if(u==f){for(p=1,C=w[0];C>=10;C/=10,p++);W(b,o+(b.e=p+c*h-1)+1,a,d)}else b.e=c,b.r=+d;return b}}(),F=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,k=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(R,"");if(T.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(F,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(E,"$1").replace(k,"0.$1")),t!=o))return new Y(o,i);if(Y.DEBUG)throw Error(l+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},C.absoluteValue=C.abs=function(){var e=new Y(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return b(this,new Y(e,t))},C.decimalPlaces=C.dp=function(e,t){var r,n,i,o=this;if(null!=e)return w(e,0,v),null==t?t=O:w(t,0,8),W(new Y(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-g(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},C.dividedBy=C.div=function(e,t){return r(this,new Y(e,t),I,O)},C.dividedToIntegerBy=C.idiv=function(e,t){return r(this,new Y(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var r,n,i,o,a,c,f,p,d=this;if((e=new Y(e)).c&&!e.isInteger())throw Error(l+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new Y(t)),a=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return p=new Y(Math.pow(+Z(d),a?2-x(e):+Z(e))),t?p.mod(t):p;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new Y(NaN);(n=!c&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||a&&d.c[1]>=24e7:d.c[0]<8e13||a&&d.c[0]<=9999975e7)))return o=d.s<0&&x(e)?-0:0,d.e>-1&&(o=1/o),new Y(c?1/o:o);N&&(o=u(N/h+2))}for(a?(r=new Y(.5),c&&(e.s=1),f=x(e)):f=(i=Math.abs(+Z(e)))%2,p=new Y(S);;){if(f){if(!(p=p.times(d)).c)break;o?p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}if(i){if(0===(i=s(i/2)))break;f=i%2}else if(W(e=e.times(r),e.e+1,1),e.e>14)f=x(e);else{if(0===(i=+Z(e)))break;f=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}return n?p:(c&&(p=S.div(p)),t?p.mod(t):o?W(p,N,O,void 0):p)},C.integerValue=function(e){var t=new Y(this);return null==e?e=O:w(e,0,8),W(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===b(this,new Y(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return b(this,new Y(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=b(this,new Y(e,t)))||0===t},C.isInteger=function(){return!!this.c&&g(this.e/h)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return b(this,new Y(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return-1===(t=b(this,new Y(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var r,n,i,o,a=this,u=a.s;if(t=(e=new Y(e,t)).s,!u||!t)return new Y(NaN);if(u!=t)return e.s=-t,a.plus(e);var s=a.e/h,l=e.e/h,c=a.c,p=e.c;if(!s||!l){if(!c||!p)return c?(e.s=-t,e):new Y(p?a:NaN);if(!c[0]||!p[0])return p[0]?(e.s=-t,e):new Y(c[0]?a:3==O?-0:0)}if(s=g(s),l=g(l),c=c.slice(),u=s-l){for((o=u<0)?(u=-u,i=c):(l=s,i=p),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(o=(u=c.length)<(t=p.length))?u:t,u=t=0;t<n;t++)if(c[t]!=p[t]){o=c[t]<p[t];break}if(o&&(i=c,c=p,p=i,e.s=-e.s),(t=(n=p.length)-(r=c.length))>0)for(;t--;c[r++]=0);for(t=f-1;n>u;){if(c[--n]<p[n]){for(r=n;r&&!c[--r];c[r]=t);--c[r],c[n]+=f}c[n]-=p[n]}for(;0==c[0];c.splice(0,1),--l);return c[0]?H(e,c,l):(e.s=3==O?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var n,i,o=this;return e=new Y(e,t),!o.c||!e.s||e.c&&!e.c[0]?new Y(NaN):!e.c||o.c&&!o.c[0]?new Y(o):(9==M?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,M),(e=o.minus(n.times(e))).c[0]||1!=M||(e.s=o.s),e)},C.multipliedBy=C.times=function(e,t){var r,n,i,o,a,u,s,l,c,p,d,v,y,b,w,x=this,A=x.c,B=(e=new Y(e,t)).c;if(!(A&&B&&A[0]&&B[0]))return!x.s||!e.s||A&&!A[0]&&!B||B&&!B[0]&&!A?e.c=e.e=e.s=null:(e.s*=x.s,A&&B?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=g(x.e/h)+g(e.e/h),e.s*=x.s,(s=A.length)<(p=B.length)&&(y=A,A=B,B=y,i=s,s=p,p=i),i=s+p,y=[];i--;y.push(0));for(b=f,w=m,i=p;--i>=0;){for(r=0,d=B[i]%w,v=B[i]/w|0,o=i+(a=s);o>i;)r=((l=d*(l=A[--a]%w)+(u=v*l+(c=A[a]/w|0)*d)%w*w+y[o]+r)/b|0)+(u/w|0)+v*c,y[o--]=l%b;y[o]=r}return r?++n:y.splice(0,1),H(e,y,n)},C.negated=function(){var e=new Y(this);return e.s=-e.s||null,e},C.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new Y(e,t)).s,!i||!t)return new Y(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/h,a=e.e/h,u=n.c,s=e.c;if(!o||!a){if(!u||!s)return new Y(i/0);if(!u[0]||!s[0])return s[0]?e:new Y(u[0]?n:0*i)}if(o=g(o),a=g(a),u=u.slice(),i=o-a){for(i>0?(a=o,r=s):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+s[t]+i)/f|0,u[t]=f===u[t]?0:u[t]%f;return i&&(u=[i].concat(u),++a),H(e,u,a)},C.precision=C.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return w(e,1,v),null==t?t=O:w(t,0,8),W(new Y(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},C.shiftedBy=function(e){return w(e,-p,p),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,n,i,o,a=this,u=a.c,s=a.s,l=a.e,c=I+4,f=new Y("0.5");if(1!==s||!u||!u[0])return new Y(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+Z(a)))||s==1/0?(((t=y(u)).length+l)%2==0&&(t+="0"),s=Math.sqrt(+t),l=g((l+1)/2)-(l<0||l%2),n=new Y(t=s==1/0?"1e"+l:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new Y(s+""),n.c[0])for((s=(l=n.e)+c)<3&&(s=0);;)if(o=n,n=f.times(o.plus(r(a,o,c,1))),y(o.c).slice(0,s)===(t=y(n.c)).slice(0,s)){if(n.e<l&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(W(n,n.e+I+2,1),e=!n.times(n).eq(a));break}if(!i&&(W(o,o.e+I+2,0),o.times(o).eq(a))){n=o;break}c+=4,s+=4,i=1}return W(n,n.e+I+1,O,e)},C.toExponential=function(e,t){return null!=e&&(w(e,0,v),e++),$(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&(w(e,0,v),e=e+this.e+1),$(this,e,t)},C.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=j;else if("object"!=typeof r)throw Error(l+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",f=a[0],h=a[1],p=i.s<0,d=p?f.slice(1):f,m=d.length;if(s&&(o=u,u=s,s=o,m-=o),u>0&&m>0){for(o=m%u||u,f=d.substr(0,o);o<m;o+=u)f+=c+d.substr(o,u);s>0&&(f+=c+d.slice(o)),p&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},C.toFraction=function(e){var t,n,i,o,a,u,s,c,f,p,m,v,g=this,b=g.c;if(null!=e&&(!(s=new Y(e)).isInteger()&&(s.c||1!==s.s)||s.lt(S)))throw Error(l+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+Z(s));if(!b)return new Y(g);for(t=new Y(S),f=n=new Y(S),i=c=new Y(S),v=y(b),a=t.e=v.length-g.e-1,t.c[0]=d[(u=a%h)<0?h+u:u],e=!e||s.comparedTo(t)>0?a>0?t:f:s,u=_,_=1/0,s=new Y(v),c.c[0]=0;p=r(s,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,f=c.plus(p.times(o=f)),c=o,t=s.minus(p.times(o=t)),s=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(f)),n=n.plus(o.times(i)),c.s=f.s=g.s,m=r(f,i,a*=2,O).minus(g).abs().comparedTo(r(c,n,a,O).minus(g).abs())<1?[f,i]:[c,n],_=u,m},C.toNumber=function(){return+Z(this)},C.toPrecision=function(e,t){return null!=e&&w(e,1,v),$(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=D||o>=P?A(y(r.c),o):B(y(r.c),o,"0"):10===e?t=B(y((r=W(new Y(r),I+o+1,O)).c),r.e,"0"):(w(e,2,G.length,"Base"),t=n(B(y(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return Z(this)},C._isBigNumber=!0,null!=t&&Y.set(t),Y}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},1410:function(e,t,r){"use strict";r.r(t);var n=r(12),i=r.n(n),o=r(1),a=r.n(o),u=r(2),s=r.n(u),l=r(4),c=r.n(l),f=r(3),h=r.n(f),p=r(5),d=r.n(p),m=r(9),v=r(8),g=r(0),y=[{name:"I",value:"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R"},{name:"II",value:"AJDKSIRUXBLHWTMCQGZNPYFVOE<F"},{name:"III",value:"BDFHJLCPRTXVZNYEIWGAKMUSQO<W"},{name:"IV",value:"ESOVPZJAYQUIRHXLNFTGKDCMWB<K"},{name:"V",value:"VZBRGITYUPSDNHLXAWMJQOFECK<A"},{name:"VI",value:"JPGVOUMFYQBENHZRDKASXLICTW<AN"},{name:"VII",value:"NZJHGRCXMYSWBOUFAIVLPEKQDT<AN"},{name:"VIII",value:"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN"}],b=[{name:"Beta",value:"LEYJVCNIXWPBQMDRTAKZGFUHOS"},{name:"Gamma",value:"FSOKANUERHMBTIYCWLQPZXVGJD"}],w=[{name:"B",value:"AY BR CU DH EQ FS GL IP JX KN MO TZ VW"},{name:"C",value:"AF BV CP DJ EI GO HY KR LZ MX NW TQ SU"},{name:"B Thin",value:"AE BN CK DQ FU GY HW IJ LO MP RX SZ TV"},{name:"C Thin",value:"AR BD CO EJ FN GT HK IV LM PW QZ SX UY"}],x="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");function A(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=g.b.ord(e);if(r>=65&&r<=90)return r-65;if(t)return r>=97&&r<=122?r-97:-1;throw new v.a("a2i called on non-uppercase ASCII character")}function B(e){if(e>=0&&e<26)return g.b.chr(e+65);throw new v.a("i2a called on value outside 0..25")}var F=function(){function e(t,r,n,i){if(a()(this,e),!/^[A-Z]{26}$/.test(t))throw new v.a("Rotor wiring must be 26 unique uppercase letters");if(!/^[A-Z]{0,26}$/.test(r))throw new v.a("Rotor steps must be 0-26 unique uppercase letters");if(!/^[A-Z]$/.test(n))throw new v.a("Rotor ring setting must be exactly one uppercase letter");if(!/^[A-Z]$/.test(i))throw new v.a("Rotor initial position must be exactly one uppercase letter");this.map=new Array(26),this.revMap=new Array(26);for(var o={},u=0;u<x.length;u++){var s=A(x[u]),l=A(t[u]);this.map[s]=l,this.revMap[l]=s,o[l]=!0}if(Object.keys(o).length!==x.length)throw new v.a("Rotor wiring must have each letter exactly once");var c=A(n);this.steps=new Set;var f=!0,h=!1,p=void 0;try{for(var d,m=r[Symbol.iterator]();!(f=(d=m.next()).done);f=!0){var y=d.value;this.steps.add(g.b.mod(A(y)-c,26))}}catch(e){h=!0,p=e}finally{try{f||null==m.return||m.return()}finally{if(h)throw p}}if(this.steps.size!==r.length)throw new v.a("Rotor steps must be unique");this.pos=g.b.mod(A(i)-c,26)}return s()(e,[{key:"step",value:function(){return this.pos=g.b.mod(this.pos+1,26),this.pos}},{key:"transform",value:function(e){return g.b.mod(this.map[g.b.mod(e+this.pos,26)]-this.pos,26)}},{key:"revTransform",value:function(e){return g.b.mod(this.revMap[g.b.mod(e+this.pos,26)]-this.pos,26)}}]),e}(),E=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"PairMapBase";a()(this,e),this.pairs=t,this.map={},""!==t&&t.split(/\s+/).forEach((function(e){if(!/^[A-Z]{2}$/.test(e))throw new v.a(n+" must be a whitespace-separated list of uppercase letter pairs");var t=A(e[0]),i=A(e[1]);if(t!==i){if(Object.prototype.hasOwnProperty.call(r.map,t))throw new v.a(`${n} connects ${e[0]} more than once`);if(Object.prototype.hasOwnProperty.call(r.map,i))throw new v.a(`${n} connects ${e[1]} more than once`);r.map[t]=i,r.map[i]=t}}))}return s()(e,[{key:"transform",value:function(e){return Object.prototype.hasOwnProperty.call(this.map,e)?this.map[e]:e}},{key:"revTransform",value:function(e){return this.transform(e)}}]),e}(),k=function(e){function t(e){var r;if(a()(this,t),r=c()(this,h()(t).call(this,e,"Reflector")),26!==Object.keys(r.map).length)throw new v.a("Reflector must have exactly 13 pairs covering every letter");for(var n=new Array(26),i=0,o=Object.keys(r.map);i<o.length;i++){var u=o[i];n[u]=r.map[u]}return r.map=n,r}return d()(t,e),s()(t,[{key:"transform",value:function(e){return this.map[e]}}]),t}(E),T=function(e){function t(e){return a()(this,t),c()(this,h()(t).call(this,e,"Plugboard"))}return d()(t,e),t}(E),R=function(){function e(t,r,n){a()(this,e),this.rotors=t,this.rotorsRev=[].concat(t).reverse(),this.reflector=r,this.plugboard=n}return s()(e,[{key:"step",value:function(){var e=this.rotors[0],t=this.rotors[1];(e.step(),e.steps.has(e.pos)||t.steps.has(g.b.mod(t.pos+1,26)))&&(t.step(),t.steps.has(t.pos)&&this.rotors[2].step())}},{key:"crypt",value:function(e){var t="",r=!0,n=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var u=o.value,s=A(u,!0);if(-1!==s){this.step(),s=this.plugboard.transform(s);var l=!0,c=!1,f=void 0;try{for(var h,p=this.rotors[Symbol.iterator]();!(l=(h=p.next()).done);l=!0){s=h.value.transform(s)}}catch(e){c=!0,f=e}finally{try{l||null==p.return||p.return()}finally{if(c)throw f}}s=this.reflector.transform(s);var d=!0,m=!1,v=void 0;try{for(var g,y=this.rotorsRev[Symbol.iterator]();!(d=(g=y.next()).done);d=!0){s=g.value.revTransform(s)}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}t+=B(s=this.plugboard.revTransform(s))}else t+=u}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}return t}}]),e}(),C=function(e){function t(e,r,n){var i;if(a()(this,t),i=c()(this,h()(t).call(this,e,r,n)),3!==e.length&&4!==e.length)throw new v.a("Enigma must have 3 or 4 rotors");return i}return d()(t,e),t}(R),S=function(e){function t(){return a()(this,t),c()(this,h()(t).apply(this,arguments))}return d()(t,e),s()(t,[{key:"copy",value:function(){return{map:this.map,revMap:this.revMap,pos:this.pos,step:this.step,transform:this.transform,revTransform:this.revTransform}}}]),t}(F),I=function e(t){a()(this,e),this.letter=t,this.edges=new Set,this.visited=!1},O=function(){function e(t,r,n){a()(this,e),this.pos=t,this.node1=r,this.node2=n,r.edges.add(this),n.edges.add(this),this.visited=!1}return s()(e,[{key:"getOther",value:function(e){return this.node1===e?this.node2:this.node1}}]),e}(),D=function(){function e(t,r){a()(this,e),this.lowerCache=new Array(26),this.higherCache=new Array(26);for(var n=0;n<26;n++)this.higherCache[n]=new Array(26);this.changeRotors(t,r)}return s()(e,[{key:"changeRotors",value:function(e,t){this.reflector=t,this.rotors=e,this.rotorsRev=[].concat(e).reverse(),this.cacheGen()}},{key:"step",value:function(e){for(var t=0;t<e-1;t++)this.rotors[t].step();this.cacheGen()}},{key:"cacheGen",value:function(){for(var e=0;e<26;e++){this.lowerCache[e]=void 0;for(var t=0;t<26;t++)this.higherCache[e][t]=void 0}for(var r=0;r<26;r++)if(void 0===this.lowerCache[r]){var n=r,i=!0,o=!1,a=void 0;try{for(var u,s=this.rotors[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){n=u.value.transform(n)}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}n=this.reflector.transform(n);var l=!0,c=!1,f=void 0;try{for(var h,p=this.rotorsRev[Symbol.iterator]();!(l=(h=p.next()).done);l=!0){n=h.value.revTransform(n)}}catch(e){c=!0,f=e}finally{try{l||null==p.return||p.return()}finally{if(c)throw f}}this.lowerCache[r]=n,this.lowerCache[n]=r}}},{key:"transform",value:function(e){return this.lowerCache[e]}}]),e}(),P=function(){function e(t,r,n,i,o){a()(this,e),this.baseScrambler=t,this.initialPos=n,this.changeRotor(r),this.end1=i,this.end2=o,this.cache=this.baseScrambler.higherCache[n]}return s()(e,[{key:"changeRotor",value:function(e){this.rotor=e,this.rotor.pos+=this.initialPos}},{key:"step",value:function(){this.rotor.step(),this.cache=this.baseScrambler.higherCache[this.rotor.pos]}},{key:"transform",value:function(e){var t=e,r=this.cache[e];return void 0!==r?r:(t=this.rotor.transform(t),t=this.baseScrambler.transform(t),t=this.rotor.revTransform(t),this.cache[e]=t,this.cache[t]=e,t)}},{key:"getOtherEnd",value:function(e){return this.end1===e?this.end2:this.end1}},{key:"getPos",value:function(){var e="",t=g.b.mod(this.rotor.pos-1,26);e+=B(t);for(var r=0;r<this.baseScrambler.rotors.length;r++)e+=B(t=this.baseScrambler.rotors[r].pos);return e.split("").reverse().join("")}}]),e}(),L=function(){function e(t,r,n,o,u){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;if(a()(this,e),n.length<o.length)throw new v.a("Crib overruns supplied ciphertext");if(o.length<2)throw new v.a("Crib is too short");if(o.length>25)throw new v.a("Crib is too long");for(var l=0;l<o.length;l++)if(n[l]===o[l])throw new v.a(`Invalid crib: character ${n[l]} at pos ${l} in both ciphertext and crib`);this.ciphertext=n,this.crib=o,this.initRotors(t),this.check=u,this.updateFn=s;var c=this.makeMenu(),f=i()(c,2),h=f[0],p=f[1];this.wires=new Array(676),this.scramblers=new Array;for(var d=0;d<26;d++)this.scramblers.push(new Array);this.sharedScrambler=new D(this.baseRotors.slice(1),r),this.allScramblers=new Array,this.indicator=void 0;var m=!0,g=!1,y=void 0;try{for(var b,w=p[Symbol.iterator]();!(m=(b=w.next()).done);m=!0){var x=b.value,B=this.baseRotors[0].copy(),F=A(x.node1.letter),E=A(x.node2.letter),k=new P(this.sharedScrambler,B,x.pos,F,E);0===x.pos&&(this.indicator=k),this.scramblers[F].push(k),this.scramblers[E].push(k),this.allScramblers.push(k)}}catch(e){g=!0,y=e}finally{try{m||null==w.return||w.return()}finally{if(g)throw y}}void 0===this.indicator&&(this.indicator=new P(this.sharedScrambler,this.baseRotors[0].copy(),0,void 0,void 0),this.allScramblers.push(this.indicator)),this.testRegister=A(h.letter);var T=!0,R=!1,C=void 0;try{for(var S,I=h.edges[Symbol.iterator]();!(T=(S=I.next()).done);T=!0){var O=S.value;this.testInput=[this.testRegister,A(O.getOther(h).letter)];break}}catch(e){R=!0,C=e}finally{try{T||null==I.return||I.return()}finally{if(R)throw C}}}return s()(e,[{key:"initRotors",value:function(e){this.baseRotors=[];var t=!0,r=!1,n=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,u=new S(a,"","A","A");this.baseRotors.push(u)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"changeRotors",value:function(e,t){this.initRotors(e),this.sharedScrambler.changeRotors(this.baseRotors.slice(1),t);var r=!0,n=!1,i=void 0;try{for(var o,a=this.allScramblers[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){o.value.changeRotor(this.baseRotors[0].copy())}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"update",value:function(){void 0!==this.updateFn&&this.updateFn(...arguments)}},{key:"dfs",value:function(e){var t=0,r=1,n=e,o=n.edges.size,a=new Set;e.visited=!0;var u=!0,s=!1,l=void 0;try{for(var c,f=e.edges[Symbol.iterator]();!(u=(c=f.next()).done);u=!0){var h=c.value;if(!h.visited){h.visited=!0,a.add(h);var p=h.getOther(e);if(p.visited)t+=1;else{var d=this.dfs(p),m=i()(d,5),v=m[0],g=m[1],y=m[2],b=m[3],w=m[4];t+=v,r+=g,a=new Set([...a,...w]),b>o&&(n=y,o=b)}}}}catch(e){s=!0,l=e}finally{try{u||null==f.return||f.return()}finally{if(s)throw l}}return[t,r,n,o,a]}},{key:"makeMenu",value:function(){var e=new Map,t=!0,r=!1,n=void 0;try{for(var i,o=(this.ciphertext+this.crib)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(!e.has(a)){var u=new I(a);e.set(a,u)}}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}for(var s=0;s<this.crib.length;s++){var l=this.crib[s],c=this.ciphertext[s];new O(s,e.get(l),e.get(c))}var f=[],h=!0,p=!1,d=void 0;try{for(var m,v=e.keys()[Symbol.iterator]();!(h=(m=v.next()).done);h=!0){var g=m.value;if(!e.get(g).visited){var y=this.dfs(e.get(g));f.push(y)}}}catch(e){p=!0,d=e}finally{try{h||null==v.return||v.return()}finally{if(p)throw d}}return f.sort((function(e,t){var r=t[0]-e[0];return 0===r&&(r=t[1]-e[1]),r})),this.nLoops=f[0][0],[f[0][2],f[0][4]]}},{key:"energise",value:function(e,t){var r=26*e+t;if(!this.wires[r]){this.wires[r]=!0;var n=26*t+e;if(this.wires[n]=!0,e!==this.testRegister&&t!==this.testRegister||(this.energiseCount++,26!==this.energiseCount)){for(var i=0;i<this.scramblers[e].length;i++){var o=this.scramblers[e][i],a=o.transform(t),u=o.getOtherEnd(e),s=26*u+a;if(!this.wires[s]&&(this.energise(u,a),26===this.energiseCount))return}if(e!==t)for(var l=0;l<this.scramblers[t].length;l++){var c=this.scramblers[t][l],f=c.transform(e),h=c.getOtherEnd(t),p=26*h+f;if(!this.wires[p]&&(this.energise(h,f),26===this.energiseCount))return}}}}},{key:"tryDecrypt",value:function(e){for(var t=this.indicator.rotor,r=t.pos,n=[],i=new T(e),o=0;o<Math.min(26,this.ciphertext.length);o++){var a=this.indicator.transform(i.transform(A(this.ciphertext[o])));n.push(B(i.transform(a))),this.indicator.step(1)}return t.pos=r,n.join("")}},{key:"formatPair",value:function(e,t){return e<t?`${B(e)}${B(t)}`:`${B(t)}${B(e)}`}},{key:"checkingMachine",value:function(e){if(e!==this.testInput[1]){for(var t=0;t<this.wires.length;t++)this.wires[t]=!1;this.energiseCount=0,this.energise(this.testRegister,e)}var r=new Set;r.add(this.formatPair(this.testRegister,e));for(var n=0;n<26;n++){for(var i=0,o=void 0,a=0;a<26;a++)this.wires[26*n+a]&&(i++,o=a);if(i>1)return"";0!==i&&r.add(this.formatPair(n,o))}return[...r].join(" ")}},{key:"checkStop",value:function(){var e=this.energiseCount;if(26!==e){var t,r;if(25===e){for(var n=0;n<26;n++)if(!this.wires[26*this.testRegister+n]){t=n;break}}else{if(1!==e){if(!this.check)return[this.indicator.getPos(),"??",this.tryDecrypt("")];for(var i=void 0,o=0;o<26;o++){var a=this.checkingMachine(o);if(""!==a){if(void 0!==i)return[this.indicator.getPos(),"??",this.tryDecrypt("")];i=a}}if(void 0===i)return;return[this.indicator.getPos(),i,this.tryDecrypt(i)]}t=this.testInput[1]}if(this.check){if(""===(r=this.checkingMachine(t)))return}else r=`${B(this.testRegister)}${B(t)}`;var u=this.tryDecrypt(r);return[this.indicator.getPos(),r,u]}}},{key:"run",value:function(){for(var e=0,t=[],r=Math.pow(26,this.baseRotors.length),n=1;n<=r;n++){for(var i=0;i<this.wires.length;i++)this.wires[i]=!1;this.energiseCount=0,this.energise(...this.testInput);var o=this.checkStop();void 0!==o&&(e++,t.push(o));for(var a=1,u=1;u<this.baseRotors.length&&n%Math.pow(26,u)==0;u++)a++;a>1&&this.sharedScrambler.step(a);var s=!0,l=!1,c=void 0;try{for(var f,h=this.allScramblers[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){f.value.step()}}catch(e){l=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw c}}a>3&&this.update(this.nLoops,e,n/r)}return t}}]),e}(),_=function(e){function t(){var e;return a()(this,t),(e=c()(this,h()(t).call(this))).name="Bombe",e.module="Bletchley",e.description="Emulation of the Bombe machine used at Bletchley Park to attack Enigma, based on work by Polish and British cryptanalysts.<br><br>To run this you need to have a 'crib', which is some known plaintext for a chunk of the target ciphertext, and know the rotors used. (See the 'Bombe (multiple runs)' operation if you don't know the rotors.) The machine will suggest possible configurations of the Enigma. Each suggestion has the rotor start positions (left to right) and known plugboard pairs.<br><br>Choosing a crib: First, note that Enigma cannot encrypt a letter to itself, which allows you to rule out some positions for possible cribs. Secondly, the Bombe does not simulate the Enigma's middle rotor stepping. The longer your crib, the more likely a step happened within it, which will prevent the attack working. However, other than that, longer cribs are generally better. The attack produces a 'menu' which maps ciphertext letters to plaintext, and the goal is to produce 'loops': for example, with ciphertext ABC and crib CAB, we have the mappings A&lt;-&gt;C, B&lt;-&gt;A, and C&lt;-&gt;B, which produces a loop A-B-C-A. The more loops, the better the crib. The operation will output this: if your menu has too few loops or is too short, a large number of incorrect outputs will usually be produced. Try a different crib. If the menu seems good but the right answer isn't produced, your crib may be wrong, or you may have overlapped the middle rotor stepping - try a different crib.<br><br>Output is not sufficient to fully decrypt the data. You will have to recover the rest of the plugboard settings by inspection. And the ring position is not taken into account: this affects when the middle rotor steps. If your output is correct for a bit, and then goes wrong, adjust the ring and start position on the right-hand rotor together until the output improves. If necessary, repeat for the middle rotor.<br><br>By default this operation runs the checking machine, a manual process to verify the quality of Bombe stops, on each stop, discarding stops which fail. If you want to see how many times the hardware actually stops for a given input, disable the checking machine.<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.",e.infoURL="https://wikipedia.org/wiki/Bombe",e.inputType="string",e.outputType="JSON",e.presentType="html",e.args=[{name:"Model",type:"argSelector",value:[{name:"3-rotor",off:[1]},{name:"4-rotor",on:[1]}]},{name:"Left-most (4th) rotor",type:"editableOption",value:b,defaultIndex:0},{name:"Left-hand rotor",type:"editableOption",value:y,defaultIndex:0},{name:"Middle rotor",type:"editableOption",value:y,defaultIndex:1},{name:"Right-hand rotor",type:"editableOption",value:y,defaultIndex:2},{name:"Reflector",type:"editableOption",value:w},{name:"Crib",type:"string",value:""},{name:"Crib offset",type:"number",value:0},{name:"Use checking machine",type:"boolean",value:!0}],e}return d()(t,e),s()(t,[{key:"updateStatus",value:function(e,t,r){var n=`Bombe run with ${e} loop${1===e?"":"s"} in menu (2+ desirable): ${t} stops, ${Math.floor(100*r)}% done`;self.sendStatusMessage(n)}},{key:"run",value:function(e,t){for(var r=t[0],n=t[5],i=t[6],o=t[7],a=t[8],u=[],s=0;s<4;s++)if(0!==s||"3-rotor"!==r){var l=t[s+1];l.includes("<")&&(l=l.split("<",2)[0]),u.push(l)}if(u.reverse(),0===i.length)throw new v.a("Crib cannot be empty");if(o<0)throw new v.a("Offset cannot be negative");e=e.replace(/[^A-Za-z]/g,"").toUpperCase(),i=i.replace(/[^A-Za-z]/g,"").toUpperCase();var c,f=e.slice(o),h=new k(n);c=Object(g.d)()?this.updateStatus:void 0;var p=new L(u,h,f,i,a,c),d=p.run();return{nLoops:p.nLoops,result:d}}},{key:"present",value:function(e){var t=`Bombe run on menu with ${e.nLoops} loop${1===e.nLoops?"":"s"} (2+ desirable). Note: Rotor positions are listed left to right and start at the beginning of the crib, and ignore stepping and the ring setting. Some plugboard settings are determined. A decryption preview starting at the beginning of the crib and ignoring stepping is also provided.\n\n`;t+="<table class='table table-hover table-sm table-bordered table-nonfluid'><tr><th>Rotor stops</th>  <th>Partial plugboard</th>  <th>Decryption preview</th></tr>\n";var r=!0,n=!1,o=void 0;try{for(var a,u=e.result[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=i()(a.value,3);t+=`<tr><td>${s[0]}</td>  <td>${s[1]}</td>  <td>${s[2]}</td></tr>\n`}}catch(e){n=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(n)throw o}}return t+="</table>"}}]),t}(m.a),U=function(e){function t(){var e;return a()(this,t),(e=c()(this,h()(t).call(this))).name="Enigma",e.module="Bletchley",e.description="Encipher/decipher with the WW2 Enigma machine.<br><br>Enigma was used by the German military, among others, around the WW2 era as a portable cipher machine to protect sensitive military, diplomatic and commercial communications.<br><br>The standard set of German military rotors and reflectors are provided. To configure the plugboard, enter a string of connected pairs of letters, e.g. <code>AB CD EF</code> connects A to B, C to D, and E to F. This is also used to create your own reflectors. To create your own rotor, enter the letters that the rotor maps A to Z to, in order, optionally followed by <code>&lt;</code> then a list of stepping points.<br>This is deliberately fairly permissive with rotor placements etc compared to a real Enigma (on which, for example, a four-rotor Enigma uses only the thin reflectors and the beta or gamma rotor in the 4th slot).<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.",e.infoURL="https://wikipedia.org/wiki/Enigma_machine",e.inputType="string",e.outputType="string",e.args=[{name:"Model",type:"argSelector",value:[{name:"3-rotor",off:[1,2,3]},{name:"4-rotor",on:[1,2,3]}]},{name:"Left-most (4th) rotor",type:"editableOption",value:b,defaultIndex:0},{name:"Left-most rotor ring setting",type:"option",value:x},{name:"Left-most rotor initial value",type:"option",value:x},{name:"Left-hand rotor",type:"editableOption",value:y,defaultIndex:0},{name:"Left-hand rotor ring setting",type:"option",value:x},{name:"Left-hand rotor initial value",type:"option",value:x},{name:"Middle rotor",type:"editableOption",value:y,defaultIndex:1},{name:"Middle rotor ring setting",type:"option",value:x},{name:"Middle rotor initial value",type:"option",value:x},{name:"Right-hand rotor",type:"editableOption",value:y,defaultIndex:2},{name:"Right-hand rotor ring setting",type:"option",value:x},{name:"Right-hand rotor initial value",type:"option",value:x},{name:"Reflector",type:"editableOption",value:w},{name:"Plugboard",type:"string",value:""},{name:"Strict output",hint:"Remove non-alphabet letters and group output",type:"boolean",value:!0}],e}return d()(t,e),s()(t,[{key:"parseRotorStr",value:function(e,t){if(""===e)throw new v.a(`Rotor ${t} must be provided.`);return e.includes("<")?e.split("<",2):[e,""]}},{key:"run",value:function(e,t){for(var r=t[0],n=t[13],o=t[14],a=t[15],u=[],s=0;s<4;s++)if(0!==s||"3-rotor"!==r){var l=this.parseRotorStr(t[3*s+1],1),c=i()(l,2),f=c[0],h=c[1];u.push(new F(f,h,t[3*s+2],t[3*s+3]))}u.reverse();var p=new k(n),d=new T(o);a&&(e=e.replace(/[^A-Za-z]/g,""));var m=new C(u,p,d).crypt(e);return a&&(m=m.replace(/([A-Z]{5})(?!$)/g,"$1 ")),m}},{key:"highlight",value:function(e,t){if(!1===t[13])return e}},{key:"highlightReverse",value:function(e,t){if(!1===t[13])return e}}]),t}(m.a),M=function(e){function t(){var e;return a()(this,t),(e=c()(this,h()(t).call(this))).name="Lorenz",e.module="Bletchley",e.description="The Lorenz SZ40/42 cipher attachment was a WW2 German rotor cipher machine with twelve rotors which attached in-line between remote teleprinters.<br><br>It used the Vernam cipher with two groups of five rotors (named the psi(ψ) wheels and chi(χ) wheels at Bletchley Park) to create two pseudorandom streams of five bits, encoded in ITA2, which were XOR added to the plaintext. Two other rotors, dubbed the mu(μ) or motor wheels, could hold up the stepping of the psi wheels meaning they stepped intermittently.<br><br>Each rotor has a different number of cams/lugs around their circumference which could be set active or inactive changing the key stream.<br><br>Three models of the Lorenz are emulated, SZ40, SZ42a and SZ42b and three example wheel patterns (the lug settings) are included (KH, ZMUG & BREAM) with the option to set a custom set using the letter 'x' for active or '.' for an inactive lug.<br><br>The input can either be plaintext or ITA2 when sending and ITA2 when receiving.<br><br>To learn more, Virtual Lorenz, an online, browser based simulation of the Lorenz SZ40/42 is available at <a href='https://lorenz.virtualcolossus.co.uk' target='_blank'>https://lorenz.virtualcolossus.co.uk</a>.<br><br>A more detailed description of this operation can be found <a href='https://github.com/gchq/CyberChef/wiki/Lorenz-SZ' target='_blank'>here</a>.",e.infoURL="https://wikipedia.org/wiki/Lorenz_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Model",type:"option",value:["SZ40","SZ42a","SZ42b"]},{name:"Wheel Pattern",type:"argSelector",value:[{name:"KH Pattern",off:[19,20,21,22,23,24,25,26,27,28,29,30]},{name:"ZMUG Pattern",off:[19,20,21,22,23,24,25,26,27,28,29,30]},{name:"BREAM Pattern",off:[19,20,21,22,23,24,25,26,27,28,29,30]},{name:"No Pattern",off:[19,20,21,22,23,24,25,26,27,28,29,30]},{name:"Custom",on:[19,20,21,22,23,24,25,26,27,28,29,30]}]},{name:"KT-Schalter",type:"boolean"},{name:"Mode",type:"argSelector",value:[{name:"Send",on:[4],off:[5]},{name:"Receive",off:[4],on:[5]}]},{name:"Input Type",type:"option",value:["Plaintext","ITA2"]},{name:"Output Type",type:"option",value:["Plaintext","ITA2"]},{name:"ITA2 Format",type:"option",value:["5/8/9","+/-/."]},{name:"Ψ1 start (1-43)",type:"number",value:1},{name:"Ψ2 start (1-47)",type:"number",value:1},{name:"Ψ3 start (1-51)",type:"number",value:1},{name:"Ψ4 start (1-53)",type:"number",value:1},{name:"Ψ5 start (1-59)",type:"number",value:1},{name:"Μ37 start (1-37)",type:"number",value:1},{name:"Μ61 start (1-61)",type:"number",value:1},{name:"Χ1 start (1-41)",type:"number",value:1},{name:"Χ2 start (1-31)",type:"number",value:1},{name:"Χ3 start (1-29)",type:"number",value:1},{name:"Χ4 start (1-26)",type:"number",value:1},{name:"Χ5 start (1-23)",type:"number",value:1},{name:"Ψ1 lugs (43)",type:"string",value:".x...xx.x.x..xxx.x.x.xxxx.x.x.x.x.x..x.xx.x"},{name:"Ψ2 lugs (47)",type:"string",value:".xx.x.xxx..x.x.x..x.xx.x.xxx.x....x.xx.x.x.x..x"},{name:"Ψ3 lugs (51)",type:"string",value:".x.x.x..xxx....x.x.xx.x.x.x..xxx.x.x..x.x.xx..x.x.x"},{name:"Ψ4 lugs (53)",type:"string",value:".xx...xxxxx.x.x.xx...x.xx.x.x..x.x.xx.x..x.x.x.x.x.x."},{name:"Ψ5 lugs (59)",type:"string",value:"xx...xx.x..x.xx.x...x.x.x.x.x.x.x.x.xx..xxxx.x.x...xx.x..x."},{name:"Μ37 lugs (37)",type:"string",value:"x.x.x.x.x.x...x.x.x...x.x.x...x.x...."},{name:"Μ61 lugs (61)",type:"string",value:".xxxx.xxxx.xxx.xxxx.xx....xxx.xxxx.xxxx.xxxx.xxxx.xxx.xxxx..."},{name:"Χ1 lugs (41)",type:"string",value:".x...xxx.x.xxxx.x...x.x..xxx....xx.xxxx.."},{name:"Χ2 lugs (31)",type:"string",value:"x..xxx...x.xxxx..xx..x..xx.xx.."},{name:"Χ3 lugs (29)",type:"string",value:"..xx..x.xxx...xx...xx..xx.xx."},{name:"Χ4 lugs (26)",type:"string",value:"xx..x..xxxx..xx.xxx....x.."},{name:"Χ5 lugs (23)",type:"string",value:"xx..xx....xxxx.x..x.x.."}],e}return d()(t,e),s()(t,[{key:"run",value:function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=t[6],l=t[19],c=t[20],f=t[21],h=t[22],p=t[23],d=t[24],m=t[25],g=t[26],y=t[27],b=t[28],w=t[29],x=t[30],A=t[7],B=t[8],F=t[9],E=t[10],k=t[11],T=t[12],R=t[13],C=t[14],S=t[15],I=t[16],O=t[17],D=t[18];if(this.reverseTable(),A<1||A>43)throw new v.a("Ψ1 start must be between 1 and 43");if(B<1||B>47)throw new v.a("Ψ2 start must be between 1 and 47");if(F<1||F>51)throw new v.a("Ψ3 start must be between 1 and 51");if(E<1||E>53)throw new v.a("Ψ4 start must be between 1 and 53");if(k<1||k>59)throw new v.a("Ψ5 start must be between 1 and 59");if(T<1||T>37)throw new v.a("Μ37 start must be between 1 and 37");if(R<1||R>61)throw new v.a("Μ61 start must be between 1 and 61");if(C<1||C>41)throw new v.a("Χ1 start must be between 1 and 41");if(S<1||S>31)throw new v.a("Χ2 start must be between 1 and 31");if(I<1||I>29)throw new v.a("Χ3 start must be between 1 and 29");if(O<1||O>26)throw new v.a("Χ4 start must be between 1 and 26");if(D<1||D>23)throw new v.a("Χ5 start must be between 1 and 23");var P="";if("Custom"===n){var L=new RegExp("^[.xX]*$");if(43!==l.length||!L.test(l))throw new v.a("Ψ1 custom lugs must be 43 long and can only include . or x ");if(47!==c.length||!L.test(c))throw new v.a("Ψ2 custom lugs must be 47 long and can only include . or x");if(51!==f.length||!L.test(f))throw new v.a("Ψ3 custom lugs must be 51 long and can only include . or x");if(53!==h.length||!L.test(h))throw new v.a("Ψ4 custom lugs must be 53 long and can only include . or x");if(59!==p.length||!L.test(p))throw new v.a("Ψ5 custom lugs must be 59 long and can only include . or x");if(37!==d.length||!L.test(d))throw new v.a("M37 custom lugs must be 37 long and can only include . or x");if(61!==m.length||!L.test(m))throw new v.a("M61 custom lugs must be 61 long and can only include . or x");if(41!==g.length||!L.test(g))throw new v.a("Χ1 custom lugs must be 41 long and can only include . or x");if(31!==y.length||!L.test(y))throw new v.a("Χ2 custom lugs must be 31 long and can only include . or x");if(29!==b.length||!L.test(b))throw new v.a("Χ3 custom lugs must be 29 long and can only include . or x");if(26!==w.length||!L.test(w))throw new v.a("Χ4 custom lugs must be 26 long and can only include . or x");if(23!==x.length||!L.test(x))throw new v.a("Χ5 custom lugs must be 23 long and can only include . or x");(P=V["No Pattern"]).S[1]=this.readLugs(l),P.S[2]=this.readLugs(c),P.S[3]=this.readLugs(f),P.S[4]=this.readLugs(h),P.S[5]=this.readLugs(p),P.M[1]=this.readLugs(d),P.M[2]=this.readLugs(m),P.X[1]=this.readLugs(g),P.X[2]=this.readLugs(y),P.X[3]=this.readLugs(b),P.X[4]=this.readLugs(w),P.X[5]=this.readLugs(x)}else P=V[n];var _=P.X,U=P.S,M=P.M,j=this.convertToITA2(e,a,o),G=[],Y=[],$=M[1][R-1],H=M[2][T-1],W=[0,0,0],Z=this,z=Array.prototype.map.call(j,(function(e){var t=e.toUpperCase(),n=S+1;32===n&&(n=1);var a=A+1;if(44===a&&(a=1),Y=[_[1][C-1],_[2][S-1],_[3][I-1],_[4][O-1],_[5][D-1]],G=[U[1][A-1],U[2][B-1],U[3][F-1],U[4][E-1],U[5][k-1]],void 0===N[t])return"";for(var u=[],l=0;l<=4;l++)u[l]=N[t][l]^G[l]^Y[l];var c=u.join("");--C<1&&(C=41),--S<1&&(S=31),--I<1&&(I=29),--O<1&&(O=26),--D<1&&(D=23),--R<1&&(R=61),1===$&&--T<1&&(T=37);var f=H,h=f,p=0;if(W[2]=W[1],W[1]=W[0],W[0]="Send"===o?parseInt(N[t][4],10):parseInt(u[4],10),"SZ42a"===r)p=parseInt(_[2][n-1],10),i&&(p=p===W[2]?0:1),h=0===f&&1===p?0:1;else if("SZ42b"===r){p=1,parseInt(_[2][n-1],10)===parseInt(U[1][a-1],10)&&(p=0),i&&(p=p===W[2]?0:1),h=0===f&&1===p?0:1}else{if("SZ40"!==r)throw new v.a("Lorenz model type not recognised");h=f}1===h&&(--A<1&&(A=43),--B<1&&(B=47),--F<1&&(F=51),--E<1&&(E=53),--k<1&&(k=59)),$=M[1][R-1],H=M[2][T-1];var d=Z.REVERSE_ITA2_TABLE[c];return"5/8/9"===s&&("+"===d&&(d="5"),"-"===d&&(d="8"),"."===d&&(d="9")),d})).join("");return this.convertFromITA2(z,u,o)}},{key:"reverseTable",value:function(){for(var e in this.REVERSE_ITA2_TABLE={},this.REVERSE_FIGSHIFT_TABLE={},N){var t=N[e];this.REVERSE_ITA2_TABLE[t]=e}for(var r in $){var n=$[r];this.REVERSE_FIGSHIFT_TABLE[n]=r}}},{key:"readLugs",value:function(e){return Array.prototype.map.call(e,(function(e){return"."===e?0:1}))}},{key:"convertToITA2",value:function(e,t,r){var n="",i=!1,o=!0,a=!1,u=void 0;try{for(var s,l=e[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var c=s.value.toUpperCase();if("ITA2"===t||"Receive"===r){if(-1===G.indexOf(c)){var f=c;throw"\n"===f&&(f="Carriage Return")," "===f&&(f="Space"),new v.a("Invalid ITA2 character : "+f)}n+=c}else{if(-1===j.indexOf(c))throw new v.a("Invalid Plaintext character : "+c);i||-1===Y.indexOf(c)?i?"\n"===c?n+="34":"\r"===c?n+="4":-1===Y.indexOf(c)?(i=!1,n+="88"+c):n+=$[c]:n+="\n"===c?"34":"\r"===c?"4":c:(i=!0,n+="55"+$[c])}}}catch(e){a=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw u}}return n}},{key:"convertFromITA2",value:function(e,t,r){var n="",i=!1,o=!0,a=!1,u=void 0;try{for(var s,l=e[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var c=s.value;"Receive"===r&&"Plaintext"===t?"5"===c||"+"===c?i=!0:"8"===c||"-"===c?i=!1:n+="9"===c?" ":"3"===c?"\n":"4"===c?"":"/"===c?"/":i?this.REVERSE_FIGSHIFT_TABLE[c]:c:n+=c}}catch(e){a=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw u}}return n}}]),t}(m.a),N={A:"11000",B:"10011",C:"01110",D:"10010",E:"10000",F:"10110",G:"01011",H:"00101",I:"01100",J:"11010",K:"11110",L:"01001",M:"00111",N:"00110",O:"00011",P:"01101",Q:"11101",R:"01010",S:"10100",T:"00001",U:"11100",V:"01111",W:"11001",X:"10111",Y:"10101",Z:"10001",3:"00010",4:"01000",9:"00100","/":"00000"," ":"00100",".":"00100",8:"11111",5:"11011","-":"11111","+":"11011"},j="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+-'()/:=?,. \n\r",G="ABCDEFGHIJKLMNOPQRSTUVWXYZ34589+-./",Y="1234567890+-'()/:=?,.",$={1:"Q",2:"W",3:"E",4:"R",5:"T",6:"Y",7:"U",8:"I",9:"O",0:"P"," ":"9","-":"A","?":"B",":":"C","#":"D","%":"F","@":"G","£":"H","":"J","(":"K",")":"L",".":"M",",":"N","'":"S","=":"V","/":"X","+":"Z","\n":"3","\r":"4"},V={"No Pattern":{X:{1:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],2:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],3:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],4:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],5:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},S:{1:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],2:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],3:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],4:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],5:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},M:{1:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],2:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},"KH Pattern":{X:{1:[0,1,0,0,0,1,1,1,0,1,0,1,1,1,1,0,1,0,0,0,1,0,1,0,0,1,1,1,0,0,0,0,1,1,0,1,1,1,1,0,0],2:[1,0,0,1,1,1,0,0,0,1,0,1,1,1,1,0,0,1,1,0,0,1,0,0,1,1,0,1,1,0,0],3:[0,0,1,1,0,0,1,0,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0],4:[1,1,0,0,1,0,0,1,1,1,1,0,0,1,1,0,1,1,1,0,0,0,0,1,0,0],5:[1,1,0,0,1,1,0,0,0,0,1,1,1,1,0,1,0,0,1,0,1,0,0]},S:{1:[0,1,0,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,1,0,1],2:[0,1,1,0,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,0,1,1,0,1,0,1,1,1,0,1,0,0,0,0,1,0,1,1,0,1,0,1,0,1,0,0,1],3:[0,1,0,1,0,1,0,0,1,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,1,1,0,1,0,1,0,0,1,0,1,0,1,1,0,0,1,0,1,0,1],4:[0,1,1,0,0,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,1,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0],5:[1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,0,1,1,0,1,0,0,1,0]},M:{1:[0,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0],2:[1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,0,0,0]}},"ZMUG Pattern":{X:{1:[0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,0],2:[1,1,0,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,0,0,0,1,1,0,0,1,1,0,0,0],3:[0,0,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,0,1,1,0,1,1,1,1,0],4:[1,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,1,0,0,1,0,1],5:[0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,0,0,0,1,0,1]},S:{1:[1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,0],2:[0,0,0,1,0,0,0,1,1,1,0,0,1,1,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,0,1,1],3:[0,1,0,0,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1],4:[0,0,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0,1],5:[1,0,0,1,1,1,0,0,0,1,0,0,0,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,1,1,0,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,0,0,0,1,1,0]},M:{1:[1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,0,1,0,1],2:[0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1]}},"BREAM Pattern":{X:{1:[0,1,1,1,1,0,1,0,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0],2:[0,1,1,1,0,0,0,0,1,0,0,0,1,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,0,1,1],3:[1,1,0,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,1,1,1,0,0],4:[1,1,1,1,0,0,1,0,0,1,1,0,0,1,0,0,1,1,0,1,0,0,1,1,0,0],5:[0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,1,0,1,0,0,0,1,0]},S:{1:[0,0,0,1,1,1,0,0,1,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,1,0,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,0],2:[1,1,0,1,0,0,1,1,1,0,0,0,0,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0],3:[1,0,0,1,0,0,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,1,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1],4:[0,1,0,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,1,0,1],5:[1,0,1,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,0,0,0,1,1,0,1,0,1,0,1,0,1,0]},M:{1:[1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,1,1,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,1,0,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0,1,1,1],2:[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,1,0,1]}}},H=M;
/**
 * Emulation of the Bombe machine.
 * This version carries out multiple Bombe runs to handle unknown rotor configurations.
 *
 * @author s2224834
 * @copyright Crown Copyright 2019
 * @license Apache-2.0
 */
function W(e,t,r){var n=[],i=!0,o=!1,a=void 0;try{for(var u,s=e.slice(t,r)[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){var l=u.value;n.push(l.value)}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return n.join("\n")}for(var Z=function(e){function t(){var e;return a()(this,t),(e=c()(this,h()(t).call(this))).name="Multiple Bombe",e.module="Bletchley",e.description="Emulation of the Bombe machine used to attack Enigma. This version carries out multiple Bombe runs to handle unknown rotor configurations.<br><br>You should test your menu on the single Bombe operation before running it here. See the description of the Bombe operation for instructions on choosing a crib.<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.",e.infoURL="https://wikipedia.org/wiki/Bombe",e.inputType="string",e.outputType="JSON",e.presentType="html",e.args=[{name:"Standard Enigmas",type:"populateMultiOption",value:[{name:"German Service Enigma (First - 3 rotor)",value:[W(y,0,5),"",W(w,0,1)]},{name:"German Service Enigma (Second - 3 rotor)",value:[W(y,0,8),"",W(w,0,2)]},{name:"German Service Enigma (Third - 4 rotor)",value:[W(y,0,8),W(b,1,2),W(w,2,3)]},{name:"German Service Enigma (Fourth - 4 rotor)",value:[W(y,0,8),W(b,1,3),W(w,2,4)]},{name:"User defined",value:["","",""]}],target:[1,2,3]},{name:"Main rotors",type:"text",value:""},{name:"4th rotor",type:"text",value:""},{name:"Reflectors",type:"text",value:""},{name:"Crib",type:"string",value:""},{name:"Crib offset",type:"number",value:0},{name:"Use checking machine",type:"boolean",value:!0}],e}return d()(t,e),s()(t,[{key:"updateStatus",value:function(e,t,r,n){var i=((new Date).getTime()-n)/r*(1-r)/1e3,o=Math.floor(i/3600),a=`0${Math.floor(i%3600/60)}`.slice(-2),u=`0${Math.floor(i%60)}`.slice(-2),s=`Bombe run with ${e} loop${1===e?"":"s"} in menu (2+ desirable): ${t} stops, ${Math.floor(100*r)}% done, ${o}:${a}:${u} remaining`;self.sendStatusMessage(s)}},{key:"validateRotor",value:function(e){if(e.includes("<")&&(e=e.split("<",2)[0]),!/^[A-Z]{26}$/.test(e))throw new v.a("Rotor wiring must be 26 unique uppercase letters");if(26!==new Set(e).size)throw new v.a("Rotor wiring must be 26 unique uppercase letters");return e}},{key:"run",value:function(e,t){var r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=[],l=[],c=[],f=!0,h=!1,p=void 0;try{for(var d,m=r.split("\n")[Symbol.iterator]();!(f=(d=m.next()).done);f=!0){var y=d.value;y=this.validateRotor(y),s.push(y)}}catch(e){h=!0,p=e}finally{try{f||null==m.return||m.return()}finally{if(h)throw p}}if(s.length<3)throw new v.a("A minimum of three rotors must be supplied");if(""!==n){var b=!0,w=!1,x=void 0;try{for(var A,B=n.split("\n")[Symbol.iterator]();!(b=(A=B.next()).done);b=!0){var F=A.value;F=this.validateRotor(F),l.push(F)}}catch(e){w=!0,x=e}finally{try{b||null==B.return||B.return()}finally{if(w)throw x}}}0===l.length&&l.push("");var E=!0,T=!1,R=void 0;try{for(var C,S=i.split("\n")[Symbol.iterator]();!(E=(C=S.next()).done);E=!0){var I=C.value,O=new k(I);c.push(O)}}catch(e){T=!0,R=e}finally{try{E||null==S.return||S.return()}finally{if(T)throw R}}if(0===c.length)throw new v.a("A minimum of one reflector must be supplied");if(0===o.length)throw new v.a("Crib cannot be empty");if(a<0)throw new v.a("Offset cannot be negative");e=e.replace(/[^A-Za-z]/g,"").toUpperCase(),o=o.replace(/[^A-Za-z]/g,"").toUpperCase();var D,P=e.slice(a);D=Object(g.d)()?this.updateStatus:void 0;for(var _=void 0,U={bombeRuns:[]},M=6*function(e,t){for(var r=1,n=1;n<=t;n++)r*=(e+1-n)/n;return r}(s.length,3)*l.length*c.length,N=0,j=0,G=(new Date).getTime(),Y=0,$=s;Y<$.length;Y++){var V=$[Y],H=!0,W=!1,Z=void 0;try{for(var z,J=s[Symbol.iterator]();!(H=(z=J.next()).done);H=!0){var X=z.value;if(X!==V){var Q=!0,K=!1,q=void 0;try{for(var ee,te=s[Symbol.iterator]();!(Q=(ee=te.next()).done);Q=!0){var re=ee.value;if(re!==X&&re!==V){var ne=!0,ie=!1,oe=void 0;try{for(var ae,ue=l[Symbol.iterator]();!(ne=(ae=ue.next()).done);ne=!0){var se=ae.value,le=!0,ce=!1,fe=void 0;try{for(var he,pe=c[Symbol.iterator]();!(le=(he=pe.next()).done);le=!0){var de=he.value;N++;var me=[V,X,re];""!==se&&me.push(se),void 0===_?(_=new L(me,de,P,o,u),U.nLoops=_.nLoops):_.changeRotors(me,de);var ve=_.run();j+=ve.length,void 0!==D&&D(_.nLoops,j,N/M,G),ve.length>0&&U.bombeRuns.push({rotors:me,reflector:de.pairs,result:ve})}}catch(e){ce=!0,fe=e}finally{try{le||null==pe.return||pe.return()}finally{if(ce)throw fe}}}}catch(e){ie=!0,oe=e}finally{try{ne||null==ue.return||ue.return()}finally{if(ie)throw oe}}}}}catch(e){K=!0,q=e}finally{try{Q||null==te.return||te.return()}finally{if(K)throw q}}}}}catch(e){W=!0,Z=e}finally{try{H||null==J.return||J.return()}finally{if(W)throw Z}}}return U}},{key:"present",value:function(e){var t=`Bombe run on menu with ${e.nLoops} loop${1===e.nLoops?"":"s"} (2+ desirable). Note: Rotors and rotor positions are listed left to right, ignore stepping and the ring setting, and positions start at the beginning of the crib. Some plugboard settings are determined. A decryption preview starting at the beginning of the crib and ignoring stepping is also provided.\n`,r=!0,n=!1,o=void 0;try{for(var a,u=e.bombeRuns[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value;t+=`\nRotors: ${s.rotors.slice().reverse().join(", ")}\nReflector: ${s.reflector}\n`,t+="<table class='table table-hover table-sm table-bordered table-nonfluid'><tr><th>Rotor stops</th>  <th>Partial plugboard</th>  <th>Decryption preview</th></tr>\n";var l=!0,c=!1,f=void 0;try{for(var h,p=s.result[Symbol.iterator]();!(l=(h=p.next()).done);l=!0){var d=i()(h.value,3);t+=`<tr><td>${d[0]}</td>  <td>${d[1]}</td>  <td>${d[2]}</td></tr>\n`}}catch(e){c=!0,f=e}finally{try{l||null==p.return||p.return()}finally{if(c)throw f}}t+="</table>\n"}}catch(e){n=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(n)throw o}}return t}}]),t}(m.a),z=r(29),J=r.n(z),X=[{name:"Example 1",value:"MCYLPQUVRXGSAOWNBJEZDTFKHI<BFHNQUW"},{name:"Example 2",value:"KHWENRCBISXJQGOFMAPVYZDLTU<BFHNQUW"},{name:"Example 3",value:"BYPDZMGIKQCUSATREHOJNLFWXV<BFHNQUW"},{name:"Example 4",value:"ZANJCGDLVHIXOBRPMSWQUKFYET<BFHNQUW"},{name:"Example 5",value:"QXBGUTOVFCZPJIHSWERYNDAMLK<BFHNQUW"},{name:"Example 6",value:"BDCNWUEIQVFTSXALOGZJYMHKPR<BFHNQUW"},{name:"Example 7",value:"WJUKEIABMSGFTQZVCNPHORDXYL<BFHNQUW"},{name:"Example 8",value:"TNVCZXDIPFWQKHSJMAOYLEURGB<BFHNQUW"}],Q=[{name:"Example",value:"AN BC FG IE KD LU MH OR TS VZ WQ XJ YP"}],K={Q:"1",W:"2",E:"3",R:"4",T:"5",Y:"6",U:"7",I:"8",O:"9",P:"0",A:"-",S:"/",D:"Z",F:"%",G:"X",H:"£",K:"(",L:")",C:"V",B:"'",N:",",M:"."},q={},ee=0,te=Object.keys(K);ee<te.length;ee++){var re=te[ee];q[K[re]]=re}var ne=function(e){function t(e,r,n,i){var o;if(a()(this,t),o=c()(this,h()(t).call(this,e,r,n)),5!==e.length)throw new v.a("Typex must have 5 rotors");return o.keyboard=i,o}return d()(t,e),s()(t,[{key:"step",value:function(){var e=this.rotors[2],t=this.rotors[3];(e.step(),e.steps.has(e.pos)||t.steps.has(g.b.mod(t.pos+1,26)))&&(t.step(),t.steps.has(t.pos)&&this.rotors[4].step())}},{key:"crypt",value:function(e){var r=e;if("Encrypt"===this.keyboard){r="";var n=!1,i=!0,o=!1,a=void 0;try{for(var u,s=e[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){var l=u.value;" "===l?r+="X":n?Object.prototype.hasOwnProperty.call(q,l)?r+=q[l]:(n=!1,r+="V"+l):Object.prototype.hasOwnProperty.call(q,l)?(n=!0,r+="Z"+q[l]):r+=l}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}}var c=J()(h()(t.prototype),"crypt",this).call(this,r),f=c;if("Decrypt"===this.keyboard){f="";var p=!1,d=!0,m=!1,v=void 0;try{for(var g,y=c[Symbol.iterator]();!(d=(g=y.next()).done);d=!0){var b=g.value;"X"===b?f+=" ":"V"===b?p=!1:"Z"===b?p=!0:f+=p?K[b]:b}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}}return f}}]),t}(R),ie=function(e){function t(e,r,n,i,o){a()(this,t);var u=e;if(n){for(var s=new Array(26),l=0;l<26;l++){var f=g.b.mod(26-A(e[l]),26),p=B(g.b.mod(26-A(x[l]),26));s[f]=p}u=s.join("")}return c()(this,h()(t).call(this,u,r,i,o))}return d()(t,e),t}(F),oe=function(e){function t(e){var r;if(a()(this,t),!/^[A-Z]{26}$/.test(e))throw new v.a("Plugboard wiring must be 26 unique uppercase letters");e=e.replace(/./g,(function(e){return"AZYXWVUTSRQPONMLKJIHGFEDCB"[A(e)]}));try{r=c()(this,h()(t).call(this,e,"","A","A"))}catch(e){throw new v.a(e.message.replace("Rotor","Plugboard"))}return r}return d()(t,e),s()(t,[{key:"transform",value:function(e){return g.b.mod(this.map[g.b.mod(e+this.pos,26)]-this.pos,26)}},{key:"revTransform",value:function(e){return g.b.mod(this.revMap[g.b.mod(e+this.pos,26)]-this.pos,26)}}]),t}(F),ae=function(e){function t(){var e;return a()(this,t),(e=c()(this,h()(t).call(this))).name="Typex",e.module="Bletchley",e.description="Encipher/decipher with the WW2 Typex machine.<br><br>Typex was originally built by the British Royal Air Force prior to WW2, and is based on the Enigma machine with some improvements made, including using five rotors with more stepping points and interchangeable wiring cores. It was used across the British and Commonwealth militaries. A number of later variants were produced; here we simulate a WW2 era Mark 22 Typex with plugboards for the reflector and input. Typex rotors were changed regularly and none are public: a random example set are provided.<br><br>To configure the reflector plugboard, enter a string of connected pairs of letters in the reflector box, e.g. <code>AB CD EF</code> connects A to B, C to D, and E to F (you'll need to connect every letter). There is also an input plugboard: unlike Enigma's plugboard, it's not restricted to pairs, so it's entered like a rotor (without stepping). To create your own rotor, enter the letters that the rotor maps A to Z to, in order, optionally followed by <code>&lt;</code> then a list of stepping points.<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.",e.infoURL="https://wikipedia.org/wiki/Typex",e.inputType="string",e.outputType="string",e.args=[{name:"1st (left-hand) rotor",type:"editableOption",value:X,defaultIndex:0},{name:"1st rotor reversed",type:"boolean",value:!1},{name:"1st rotor ring setting",type:"option",value:x},{name:"1st rotor initial value",type:"option",value:x},{name:"2nd rotor",type:"editableOption",value:X,defaultIndex:1},{name:"2nd rotor reversed",type:"boolean",value:!1},{name:"2nd rotor ring setting",type:"option",value:x},{name:"2nd rotor initial value",type:"option",value:x},{name:"3rd (middle) rotor",type:"editableOption",value:X,defaultIndex:2},{name:"3rd rotor reversed",type:"boolean",value:!1},{name:"3rd rotor ring setting",type:"option",value:x},{name:"3rd rotor initial value",type:"option",value:x},{name:"4th (static) rotor",type:"editableOption",value:X,defaultIndex:3},{name:"4th rotor reversed",type:"boolean",value:!1},{name:"4th rotor ring setting",type:"option",value:x},{name:"4th rotor initial value",type:"option",value:x},{name:"5th (right-hand, static) rotor",type:"editableOption",value:X,defaultIndex:4},{name:"5th rotor reversed",type:"boolean",value:!1},{name:"5th rotor ring setting",type:"option",value:x},{name:"5th rotor initial value",type:"option",value:x},{name:"Reflector",type:"editableOption",value:Q},{name:"Plugboard",type:"string",value:""},{name:"Typex keyboard emulation",type:"option",value:["None","Encrypt","Decrypt"]},{name:"Strict output",hint:"Remove non-alphabet letters and group output",type:"boolean",value:!0}],e}return d()(t,e),s()(t,[{key:"parseRotorStr",value:function(e,t){if(""===e)throw new v.a(`Rotor ${t} must be provided.`);return e.includes("<")?e.split("<",2):[e,""]}},{key:"run",value:function(e,t){for(var r=t[20],n=t[21],o=t[22],a=t[23],u=[],s=0;s<5;s++){var l=this.parseRotorStr(t[4*s]),c=i()(l,2),f=c[0],h=c[1];u.push(new ie(f,h,t[4*s+1],t[4*s+2],t[4*s+3]))}u.reverse();var p=new k(r),d=n;""===d&&(d="ABCDEFGHIJKLMNOPQRSTUVWXYZ");var m=new oe(d);a&&(e="Encrypt"===o?e.replace(/[^A-Za-z0-9 /%£()',.-]/g,""):e.replace(/[^A-Za-z]/g,""));var v=new ne(u,p,m,o).crypt(e);return a&&"Decrypt"!==o&&(v=v.replace(/([A-Z]{5})(?!$)/g,"$1 ")),v}},{key:"highlight",value:function(e,t){if(!1===t[18])return e}},{key:"highlightReverse",value:function(e,t){if(!1===t[18])return e}}]),t}(m.a),ue="undefined"==typeof self?{}:self.OpModules||{};ue.Bletchley={Bombe:_,Enigma:U,Lorenz:H,"Multiple Bombe":Z,Typex:ae};t.default=ue},15:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(0),i=r(8);
/**
 * Base64 functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 */
function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),"string"==typeof e&&(e=n.b.strToByteArray(e)),64!==(t=n.b.expandAlphRange(t).join("")).length&&65!==t.length)throw new i.a(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,o,a,u,s,l,c,f="",h=0;h<e.length;)u=(r=e[h++])>>2,s=(3&r)<<4|(o=e[h++])>>4,l=(15&o)<<2|(a=e[h++])>>6,c=63&a,isNaN(o)?l=c=64:isNaN(a)&&(c=64),f+=t.charAt(u)+t.charAt(s)+t.charAt(l)+t.charAt(c);return f}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=n.b.expandAlphRange(t).join("")).length&&65!==t.length)throw new i.a(`Invalid Base64 alphabet length (${t.length}): ${t}`);var a,u,s,l,c,f,h=[],p=0;if(o){var d=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(d,"")}for(;p<e.length;)a=t.indexOf(e.charAt(p++))<<2|(l=-1===(l=t.indexOf(e.charAt(p++)||"="))?64:l)>>4,u=(15&l)<<4|(c=-1===(c=t.indexOf(e.charAt(p++)||"="))?64:c)>>2,s=(3&c)<<6|(f=-1===(f=t.indexOf(e.charAt(p++)||"="))?64:f),h.push(a),64!==c&&h.push(u),64!==f&&h.push(s);return"string"===r?n.b.byteArrayToUtf8(h):h}},16:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(0);
/**
 * Hexadecimal functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 */function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var o="",a="0x"===t||"\\x"===t,u=0;u<e.length;u++){var s=e[u].toString(16).padStart(r,"0");o+=a?t+s:s+t,n&&(o+=n),u!==e.length-1&&(u+1)%i==0&&(o+="\n")}var l=n.length+(a?0:t.length);return l?o.slice(0,-l):o}function o(e){if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==t){var i="Auto"===t?/[^a-f\d]|(0x)/gi:n.b.regexRep(t);e=e.replace(i,"")}for(var o=[],a=0;a<e.length;a+=r)o.push(parseInt(e.substr(a,r),16));return o}["Auto"].concat(["Space","Percent","Comma","Semi-colon","Colon","Line feed","CRLF","0x","0x with comma","\\x","None"])},18:function(e,t,r){"use strict";var n=r(12),i=r.n(n),o=r(7),a={Images:[{name:"Joint Photographic Experts Group image",extension:"jpg,jpeg,jpe,thm,mpo",mime:"image/jpeg",description:"",signature:{0:255,1:216,2:255,3:[192,196,219,221,224,225,226,227,228,229,231,232,234,235,236,237,238,254]},extractor:function(e,t){var r=new o.a(e.slice(t));for(;r.hasMore();){var n=r.getBytes(2);if(255!==n[0])throw new Error(`Invalid marker while parsing JPEG at pos ${r.position}: ${n}`);var i=0;switch(n[1]){case 216:case 1:break;case 217:return r.carve();case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:case 219:case 222:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:i=r.readInt(2,"be"),r.position+=i-2;break;case 223:r.position++;break;case 220:case 221:r.position+=2;break;case 218:i=r.readInt(2,"be"),r.position+=i-2,r.continueUntil(255);break;case 0:case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:default:r.continueUntil(255)}}throw new Error("Unable to parse JPEG successfully")}},{name:"Graphics Interchange Format image",extension:"gif",mime:"image/gif",description:"",signature:{0:71,1:73,2:70,3:56,4:[55,57],5:97},extractor:function(e,t){var r=new o.a(e.slice(t));r.continueUntil([33,255]),r.continueUntil([33,249]),r.moveForwardsBy(2);for(;r.hasMore();){for(r.moveForwardsBy(r.readInt(1)+1),r.moveForwardsBy(11);r.getBytes(2)!==[33,249]&&(r.moveBackwardsBy(2),r.moveForwardsBy(r.readInt(1)),r.readInt(1));)r.moveBackwardsBy(1);if(59===r.readInt(1))break;r.moveForwardsBy(1)}return r.carve()}},{name:"Portable Network Graphics image",extension:"png",mime:"image/png",description:"",signature:{0:137,1:80,2:78,3:71,4:13,5:10,6:26,7:10},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveForwardsBy(8);var n=0,i="";for(;"IEND"!==i;)n=r.readInt(4,"be"),i=r.readString(4),r.moveForwardsBy(n+4);return r.carve()}},{name:"WEBP Image",extension:"webp",mime:"image/webp",description:"",signature:{8:87,9:69,10:66,11:80},extractor:null},{name:"Camera Image File Format",extension:"crw",mime:"image/x-canon-crw",description:"",signature:{6:72,7:69,8:65,9:80,10:67,11:67,12:68,13:82},extractor:null},{name:"Canon CR2 raw image",extension:"cr2",mime:"image/x-canon-cr2",description:"",signature:[{0:73,1:73,2:42,3:0,8:67,9:82},{0:77,1:77,2:0,3:42,8:67,9:82}],extractor:null},{name:"Tagged Image File Format image",extension:"tif",mime:"image/tiff",description:"",signature:[{0:73,1:73,2:42,3:0},{0:77,1:77,2:0,3:42}],extractor:null},{name:"Bitmap image",extension:"bmp",mime:"image/bmp",description:"",signature:{0:66,1:77,7:0,9:0,14:[12,40,56,64,108,124],15:0,16:0,17:0},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveForwardsBy(2);var n=r.readInt(4,"le");return r.moveForwardsBy(n-6),r.carve()}},{name:"JPEG Extended Range image",extension:"jxr",mime:"image/vnd.ms-photo",description:"",signature:{0:73,1:73,2:188},extractor:null},{name:"Photoshop image",extension:"psd",mime:"image/vnd.adobe.photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:1,6:0,7:0,8:0,9:0,10:0,11:0},extractor:null},{name:"Photoshop Large Document",extension:"psb",mime:"application/x-photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:2,6:0,7:0,8:0,9:0,10:0,11:0,12:0},extractor:null},{name:"Paint Shop Pro image",extension:"psp",mime:"image/psp",description:"",signature:[{0:80,1:97,2:105,3:110,4:116,5:32,6:83,7:104,8:111,9:112,10:32,11:80,12:114,13:111,14:32,15:73,16:109},{0:126,1:66,2:75,3:0}],extractor:null},{name:"The GIMP image",extension:"xcf",mime:"image/x-xcf",description:"",signature:{0:103,1:105,2:109,3:112,4:32,5:120,6:99,7:102,8:32,9:[102,118],10:[105,48],11:[108,48],12:[101,49,50,51]},extractor:null},{name:"Icon image",extension:"ico",mime:"image/x-icon",description:"",signature:{0:0,1:0,2:1,3:0,4:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],5:0,6:[16,32,48,64,128],7:[16,32,48,64,128],9:0,10:[0,1]},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveTo(4);var n=r.readInt(2,"le");r.moveForwardsBy(8+16*(n-1));var i=r.readInt(4,"le"),a=r.readInt(4,"le");return r.moveTo(a+i),r.carve()}},{name:"Radiance High Dynamic Range image",extension:"hdr",mime:"image/vnd.radiance",description:"",signature:{0:35,1:63,2:82,3:65,4:68,5:73,6:65,7:78,8:67,9:69,10:10},extractor:null},{name:"Sony ARW image",extension:"arw",mime:"image/x-raw",description:"",signature:{0:5,1:0,2:0,3:0,4:65,5:87,6:49,7:46},extractor:null},{name:"Fujifilm Raw Image",extension:"raf",mime:"image/x-raw",description:"",signature:{0:70,1:85,2:74,3:73,4:70,5:73,6:76,7:77,8:67,9:67,10:68,11:45,12:82,13:65,14:87},extractor:null},{name:"Minolta RAW image",extension:"mrw",mime:"image/x-raw",description:"",signature:{0:0,1:77,2:82,3:77},extractor:null},{name:"Adobe Bridge Thumbnail Cache",extension:"bct",mime:"application/octet-stream",description:"",signature:{0:108,1:110,2:98,3:116,4:2,5:0,6:0,7:0},extractor:null},{name:"Microsoft Document Imaging",extension:"mdi",mime:"image/vnd.ms-modi",description:"",signature:{0:69,1:80,2:42,3:0},extractor:null},{name:"Joint Photographic Experts Group image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:47,1:57,2:106,3:47,4:52},extractor:null},{name:"Portable Network Graphics image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:105,1:86,2:66,3:79,4:82,5:119,6:48},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,123d",mime:"application/acad",description:"",signature:{0:65,1:67,2:49,3:48,4:[48,49],5:[48,49,50,51,52,53],6:0},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,dwt",mime:"application/acad",description:"",signature:[{0:65,1:67,2:49,3:48,4:49,5:56,6:0},{0:65,1:67,2:49,3:48,4:50,5:52,6:0},{0:65,1:67,2:49,3:48,4:50,5:55,6:0}],extractor:null}],Video:[{name:"Matroska Multimedia Container",extension:"mkv",mime:"video/x-matroska",description:"",signature:{31:109,32:97,33:116,34:114,35:111,36:115,37:107,38:97},extractor:null},{name:"WEBM video",extension:"webm",mime:"video/webm",description:"",signature:{0:26,1:69,2:223,3:163},extractor:null},{name:"Flash MP4 video",extension:"f4v",mime:"video/mp4",description:"",signature:{4:102,5:116,6:121,7:112,8:[102,70],9:52,10:[118,86],11:32},extractor:null},{name:"MPEG-4 video",extension:"mp4",mime:"video/mp4",description:"",signature:[{0:0,1:0,2:0,3:[24,32],4:102,5:116,6:121,7:112},{0:51,1:103,2:112,3:53},{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:109,9:112,10:52,11:50,16:109,17:112,18:52,19:49,20:109,21:112,22:52,23:50,24:105,25:115,26:111,27:109}],extractor:null},{name:"M4V video",extension:"m4v",mime:"video/x-m4v",description:"",signature:{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:77,9:52,10:86},extractor:null},{name:"Quicktime video",extension:"mov",mime:"video/quicktime",description:"",signature:{0:0,1:0,2:0,3:20,4:102,5:116,6:121,7:112},extractor:null},{name:"Audio Video Interleave",extension:"avi",mime:"video/x-msvideo",description:"",signature:{0:82,1:73,2:70,3:70,8:65,9:86,10:73},extractor:null},{name:"Windows Media Video",extension:"wmv",mime:"video/x-ms-wmv",description:"",signature:{0:48,1:38,2:178,3:117,4:142,5:102,6:207,7:17,8:166,9:217},extractor:null},{name:"MPEG video",extension:"mpg",mime:"video/mpeg",description:"",signature:{0:0,1:0,2:1,3:186},extractor:null},{name:"Flash Video",extension:"flv",mime:"video/x-flv",description:"",signature:{0:70,1:76,2:86,3:1},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveForwardsBy(5);var n=r.readInt(4,"be");r.moveForwardsBy(n-9);var i=-11;for(;r.hasMore();){var a=r.readInt(4,"be"),u=r.readInt(1);if([8,9,18].indexOf(u)<0){r.moveBackwardsBy(1);break}if(a!==i+11){r.moveBackwardsBy(i+11+5);break}i=r.readInt(3,"be"),r.moveForwardsBy(7+i)}return r.carve()}},{name:"OGG Video",extension:"ogv,ogm,opus,ogx",mime:"video/ogg",description:"",signature:[{0:79,1:103,2:103,3:83,4:0,5:2,28:1,29:118,30:105,31:100,32:101,33:111},{0:79,1:103,2:103,3:83,4:0,5:2,28:128,29:116,30:104,31:101,32:111,33:114,34:97},{0:79,1:103,2:103,3:83,4:0,5:2,28:102,29:105,30:115,31:104,32:101,33:97,34:100}],extractor:null}],Audio:[{name:"Waveform Audio",extension:"wav",mime:"audio/x-wav",description:"",signature:{0:82,1:73,2:70,3:70,8:87,9:65,10:86,11:69},extractor:function(e,t){var r=new o.a(e.slice(t));return r.moveTo(4),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"OGG audio",extension:"ogg",mime:"audio/ogg",description:"",signature:{0:79,1:103,2:103,3:83},extractor:null},{name:"Musical Instrument Digital Interface audio",extension:"midi",mime:"audio/midi",description:"",signature:{0:77,1:84,2:104,3:100},extractor:null},{name:"MPEG-3 audio",extension:"mp3",mime:"audio/mpeg",description:"",signature:[{0:73,1:68,2:51},{0:255,1:251}],extractor:null},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new o.a(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new o.a(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");n++;for(;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:u},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:u}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var a=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(a-2),r.moveForwardsBy(32);var u=r.readInt(4,"le"),s=r.readInt(4,"le");if(u>0)return r.moveTo(u+s),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var l=r.readInt(4,"le"),c=r.readInt(4,"le");return r.moveTo(c+l),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var a=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var u=r.readInt(2,i),s=r.readInt(2,i);return r.moveTo(a),r.moveForwardsBy(u*s),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:s},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:s},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:u},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){var r=new o.a(e.slice(t));for(;r.hasMore();){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join("")){r.moveBackwardsBy(262);break}r.moveBackwardsBy(138);var n=0;r.getBytes(11).forEach((function(e,t){n+=(e-48).toString()})),n=512*Math.ceil(parseInt(n,8)/512),r.moveForwardsBy(n+377)}return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}8&n&&(r.continueUntil(0),r.moveForwardsBy(1));16&n&&(r.continueUntil(0),r.moveForwardsBy(1));2&n&&r.moveForwardsBy(2);return d(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new o.a(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i<n.length&&(r.continueUntil(n[i]),r.getBytes(5).join("")!==n[i].join(""));i++)r.moveTo(0);return r.moveForwardsBy(4),r.carve()}},{name:"7zip",extension:"7z",mime:"application/x-7z-compressed",description:"",signature:{0:55,1:122,2:188,3:175,4:39,5:28},extractor:null},{name:"Zlib Deflate",extension:"zlib",mime:"application/x-deflate",description:"",signature:{0:120,1:[1,156,218,94]},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveForwardsBy(1),32&r.readInt(1)&&r.moveForwardsBy(4);return d(r),r.moveForwardsBy(4),r.carve()}},{name:"xz compression",extension:"xz",mime:"application/x-xz",description:"",signature:{0:253,1:55,2:122,3:88,4:90,5:0},extractor:function(e,t){var r=new o.a(e.slice(t));return r.continueUntil([0,0,0,0,4,89,90]),r.moveForwardsBy(7),r.carve()}},{name:"Tarball",extension:"tar.z",mime:"application/x-gtar",description:"",signature:{0:31,1:[157,160]},extractor:null},{name:"ISO disk image",extension:"iso",mime:"application/octet-stream",description:"ISO 9660 CD/DVD image file",signature:[{32769:67,32770:68,32771:48,32772:48,32773:49},{34817:67,34818:68,34819:48,34820:48,34821:49},{36865:67,36866:68,36867:48,36868:48,36869:49}],extractor:null},{name:"Virtual Machine Disk",extension:"vmdk",mime:"application/vmdk,application/x-virtualbox-vmdk",description:"",signature:{0:75,1:68,2:77,3:86,5:0,6:0,7:0},extractor:null},{name:"Virtual Hard Drive",extension:"vhd",mime:"application/x-vhd",description:"",signature:{0:99,1:111,2:110,3:101,4:99,5:116,6:105,7:120},extractor:null},{name:"Macintosh disk image",extension:"dmf,dmg",mime:"application/octet-stream",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96,7:96},extractor:null},{name:"ARJ Archive",extension:"arj",mime:"application/x-arj-compressed",description:"",signature:{0:96,1:234,8:[0,16,20],9:0,10:2},extractor:null},{name:"WinAce Archive",extension:"ace",mime:"application/x-ace-compressed",description:"",signature:{7:42,8:42,9:65,10:67,11:69,12:42,13:42},extractor:null},{name:"Macintosh BinHex Encoded File",extension:"hqx",mime:"application/mac-binhex",description:"",signature:{11:109,12:117,13:115,14:116,15:32,16:98,17:101,18:32,19:99,20:111,21:110,22:118,23:101,24:114,25:116,26:101,27:100,28:32,29:119,30:105,31:116,32:104,33:32,34:66,35:105,36:110,37:72,38:101,39:120},extractor:null},{name:"ALZip Archive",extension:"alz",mime:"application/octet-stream",description:"",signature:{0:65,1:76,2:90,3:1,4:10,5:0,6:0,7:0},extractor:null},{name:"KGB Compressed Archive",extension:"kgb",mime:"application/x-kgb-compressed",description:"",signature:{0:75,1:71,2:66,3:95,4:97,5:114,6:99,7:104,8:32,9:45},extractor:null},{name:"Microsoft Cabinet",extension:"cab",mime:"vnd.ms-cab-compressed",description:"",signature:{0:77,1:83,2:67,3:70,4:0,5:0,6:0,7:0},extractor:null},{name:"Jar Archive",extension:"jar",mime:"application/java-archive",description:"",signature:{0:95,1:39,2:168,3:137},extractor:null},{name:"lzop compressed",extension:"lzop,lzo",mime:"application/x-lzop",description:"",signature:{0:137,1:76,2:90,3:79,4:0,5:13,6:10,7:26},extractor:null},{name:"Linux deb",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:null},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new o.a(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;r.moveForwardsBy(n);for(;r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:null},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:null},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:null},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new o.a(e.slice(t)),n=0;r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;for(;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:null},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:null},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function u(e,t){var r=new o.a(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function s(e,t){var r="207250237254",n="254237250207",i="206250237254";var a=new o.a(e.slice(t)),u=a.getBytes(4).join("");return a.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,o=0;o<n;o++){e.moveTo(t);var a=e.readInt(4,r);25===a?(e.moveTo(t+48),i+=e.readInt(8,r),e.moveTo(t+4),t+=e.readInt(4,r)):1===a&&(e.moveTo(t+36),i+=e.readInt(4,r),e.moveTo(t+4),t+=e.readInt(4,r))}return i}(e,n,r,i)}(a,function(e){return e===r||e===n}(u),function(e){return e===i||e===r}(u)?"le":"be")),a.carve()}for(var l=new Array(288),c=0;c<l.length;c++)l[c]=c<=143?8:c<=255?9:c<=279?7:8;var f=y(l),h=y(new Array(30).fill(5)),p=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function d(e){for(var t=0;!t;){t=e.readBits(1);var r=e.readBits(2);if(0===r){e.moveForwardsBy(1);var n=e.readInt(2,"le");e.moveForwardsBy(2+n)}else if(1===r)g(e,f,h);else{if(2!==r)throw new Error(`Invalid block type while parsing DEFLATE stream at pos ${e.position}`);for(var i=e.readBits(5)+257,o=e.readBits(5)+1,a=e.readBits(4)+4,u=new Uint8Array(p.length),s=0;s<a;s++)u[p[s]]=e.readBits(3);for(var l=y(u),c=new Uint8Array(i+o),d=void 0,m=void 0,v=void 0,w=0;w<i+o;)switch(d=b(e,l)){case 16:for(m=3+e.readBits(2);m--;)c[w++]=v;break;case 17:for(m=3+e.readBits(3);m--;)c[w++]=0;v=0;break;case 18:for(m=11+e.readBits(7);m--;)c[w++]=0;v=0;break;default:c[w++]=d,v=d}g(e,y(c.subarray(0,i)),y(c.subarray(i)))}}e.bitPos>0&&e.moveForwardsBy(1)}var m=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],v=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function g(e,t,r){for(var n,i=0;(n=b(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(m[n-257]),n=b(e,r),e.readBits(v[n]))}}function y(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<<t,i=new Uint32Array(n),o=1,a=0,u=2;o<=t;){for(var s=0;s<e.length;s++)if(e[s]===o){var l=void 0,c=void 0,f=void 0;for(l=0,c=a,f=0;f<o;f++)l=l<<1|1&c,c>>=1;for(var h=o<<16|s,p=l;p<n;p+=u)i[p]=h;a++}o++,a<<=1,u<<=1}return[i,t,r]}function b(e,t){var r=i()(t,2),n=r[0],o=r[1],a=n[e.readBits(o)&(1<<o)-1],u=a>>>16;if(u>o)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${u}`);return e.moveBackwardsByBits(o-u),65535&a}r(0);
/**
 * File type functions
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 *
 */
function w(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n<e.length;n++)if(x(e[n],t,r))return!0;return!1}return x(e,t,r)}function x(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(a);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in a)t.includes(i)&&(n[i]=a[i]);for(var o in n){n[o].forEach((function(t){w(t.signature,e)&&r.push(t)}))}return r}function B(e){return function(e,t){var r=A(t);if(!r||!r.length)return!1;if("string"==typeof e)return r.reduce((function(t,r){var n=!!r.mime.startsWith(e)&&r.mime;return t||n}),!1);if(e instanceof RegExp)return r.reduce((function(t,r){var n=!!e.test(r.mime)&&r.mime;return t||n}),!1);throw new Error("Invalid type input.")}("image",e)}r.d(t,"a",(function(){return A})),r.d(t,"b",(function(){return B}))},2:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},214:function(e,t,r){var n=r(3);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},22:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},23:function(e,t,r){!function(e){var t,r,n,i=String.fromCharCode;function o(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function a(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function u(e,t){return i(e>>t&63|128)}function s(e){if(0==(4294967168&e))return i(e);var t="";return 0==(4294965248&e)?t=i(e>>6&31|192):0==(4294901760&e)?(a(e),t=i(e>>12&15|224),t+=u(e,6)):0==(4292870144&e)&&(t=i(e>>18&7|240),t+=u(e,12),t+=u(e,6)),t+=i(63&e|128)}function l(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,0==(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|l())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|l()<<6|l())>=2048)return a(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|l()<<12|l()<<6|l())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n<r;)i+=s(t[n]);return i},e.decode=function(e){t=o(e),r=t.length,n=0;for(var a,u=[];!1!==(a=c());)u.push(a);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(u)}}(t)},24:function(e,t,r){var n,i;!function(o,a){"use strict";void 0===(i="function"==typeof(n=function(){var e=function(){},t="undefined",r=typeof window!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(t,r){for(var i=0;i<n.length;i++){var o=n[i];this[o]=i<t?e:this.methodFactory(o,t,r)}this.log=this.debug}function u(e,r,n){return function(){typeof console!==t&&(a.call(this,r,n),this[e].apply(this,arguments))}}function s(n,a,s){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?o:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}(n)||u.apply(this,arguments)}function l(e,r,i){var o,u=this,l="loglevel";function c(){var e;if(typeof window!==t){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(l)+"=");-1!==n&&(e=/^([^;]+)/.exec(r.slice(n))[1])}catch(e){}return void 0===u.levels[e]&&(e=void 0),e}}e&&(l+=":"+e),u.name=e,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=i||s,u.getLevel=function(){return o},u.setLevel=function(r,i){if("string"==typeof r&&void 0!==u.levels[r.toUpperCase()]&&(r=u.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=u.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(o=r,!1!==i&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t){try{return void(window.localStorage[l]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+r+";"}catch(e){}}}(r),a.call(u,r,e),typeof console===t&&r<u.levels.SILENT)return"No console available for logging"},u.setDefaultLevel=function(e){c()||u.setLevel(e,!1)},u.enableAll=function(e){u.setLevel(u.levels.TRACE,e)},u.disableAll=function(e){u.setLevel(u.levels.SILENT,e)};var f=c();null==f&&(f=null==r?"WARN":r),u.setLevel(f,!1)}var c=new l,f={};c.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=f[e];return t||(t=f[e]=new l(e,c.getLevel(),c.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return c.noConflict=function(){return typeof window!==t&&window.log===c&&(window.log=h),c},c.getLoggers=function(){return f},c})?n.call(t,r,t,e):n)||(e.exports=i)}()},25:function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,l=[],c=!1,f=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):f=-1,l.length&&p())}function p(){if(!c){var e=u(h);c=!0;for(var t=l.length;t;){for(s=l,l=[];++f<t;)s&&s[f].run();f=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new d(e,t)),1!==l.length||c||u(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},26:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);
/**
 * Binary functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=n.b.regexRep(t);e=e.replace(i,"");for(var o=[],a=0;a<e.length;a+=r)o.push(parseInt(e.substr(a,r),2));return o}},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);
/**
 * Decimal functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=n.b.charRep(t);var r=[],i=e.split(t);""===i[i.length-1]&&(i=i.slice(0,i.length-1));for(var o=0;o<i.length;o++)r[o]=parseInt(i[o],10);return r}},29:function(e,t,r){var n=r(214);function i(t,r,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,r){var i=n(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(r):o.value}},i(t,r,o||t)}e.exports=i},3:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},38:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},39:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},4:function(e,t,r){var n=r(38),i=r(22);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?i(e):t}},40:function(e,t,r){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=l(e),n=r[0],a=r[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,a)),s=0,c=a>0?n-4:n,f=0;f<c;f+=4)t=i[e.charCodeAt(f)]<<18|i[e.charCodeAt(f+1)]<<12|i[e.charCodeAt(f+2)]<<6|i[e.charCodeAt(f+3)],u[s++]=t>>16&255,u[s++]=t>>8&255,u[s++]=255&t;2===a&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,u[s++]=255&t);1===a&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,u[s++]=t>>8&255,u[s++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,u=r-i;a<u;a+=16383)o.push(c(e,a,a+16383>u?u:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],i[a.charCodeAt(u)]=u;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,a=[],u=t;u<r;u+=3)i=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},41:function(e,t){t.read=function(e,t,r,n,i){var o,a,u=8*i-n-1,s=(1<<u)-1,l=s>>1,c=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=u;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=l}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,u,s,l=8*o-i-1,c=(1<<l)-1,f=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?h/s:h*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=c?(u=0,a=c):a+f>=1?(u=(t*s-1)*Math.pow(2,i),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&u,p+=d,u/=256,i-=8);for(a=a<<i|u,l+=i;l>0;e[r+p]=255&a,p+=d,a/=256,l-=8);e[r+p-d]|=128*m}},42:function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},43:function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new T(n||[]);return o._invoke=function(e,t,r){var n=c;return function(i,o){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return C()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=F(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=l(e,t,r);if("normal"===s.type){if(n=r.done?p:f,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c="suspendedStart",f="suspendedYield",h="executing",p="completed",d={};function m(){}function v(){}function g(){}var y={};y[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(R([])));w&&w!==r&&n.call(w,o)&&(y=w);var x=g.prototype=m.prototype=Object.create(y);function A(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function B(e){var t;this._invoke=function(r,i){function o(){return new Promise((function(t,o){!function t(r,i,o,a){var u=l(e[r],e,i);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,o,a)}),(function(e){t("throw",e,o,a)})):Promise.resolve(c).then((function(e){s.value=e,o(s)}),(function(e){return t("throw",e,o,a)}))}a(u.arg)}(r,i,t,o)}))}return t=t?t.then(o,o):o()}}function F(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,F(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=l(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function R(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:C}}function C(){return{value:t,done:!0}}return v.prototype=x.constructor=g,g.constructor=v,g[u]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},A(B.prototype),B.prototype[a]=function(){return this},e.AsyncIterator=B,e.async=function(t,r,n,i){var o=new B(s(t,r,n,i));return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(x),x[u]="Generator",x[o]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},44:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},45:function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}}},46:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},5:function(e,t,r){var n=r(39);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},6:function(e,t,r){e.exports=r(43)},7:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(1),i=r.n(n),o=r(2),a=r.n(o),u=function(){function e(t){i()(this,e),this.bytes=t,this.length=this.bytes.length,this.position=0,this.bitPos=0}return a()(e,[{key:"getBytes",value:function(e){if(!(this.position>this.length)){var t=this.position+e,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(e){if(!(this.position>this.length)){for(var t="",r=this.position;r<this.position+e;r++){var n=this.bytes[r];if(0===n)break;t+=String.fromCharCode(n)}return this.position+=e,this.bitPos=0,t}}},{key:"readInt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n<this.position+e;n++)r<<=8,r|=this.bytes[n];else for(var i=this.position+e-1;i>=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){if(!(this.position>this.length)){var t=0,r=0;for(t=(this.bytes[this.position++]&256-(1<<this.bitPos))>>>this.bitPos,r=8-this.bitPos,this.bitPos=0;r<e;)t|=this.bytes[this.position++]<<r,r+=8;if(r>e){var n=r-e;t&=(1<<e)-1,r-=n,this.position--,this.bitPos=8-n}return t}}},{key:"continueUntil",value:function(e){if(!(this.position>this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t),i=!0;this.position<this.length;){for(;this.position<this.length&&this.bytes[this.position++]!==r;);i=!0;for(var o=t-1;o>=0;o--)if(this.bytes[this.position-t+o]!==e[o]){i=!1,this.position+=n[e[o]];break}if(i){this.position-=t;break}}}else for(;++this.position<this.length&&this.bytes[this.position]!==e;);}},{key:"consumeWhile",value:function(e){for(;this.position<this.length&&this.bytes[this.position]===e;)this.position++;this.bitPos=0}},{key:"consumeIf",value:function(e){this.bytes[this.position]===e&&(this.position++,this.bitPos=0)}},{key:"moveForwardsBy",value:function(e){var t=this.position+e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position<this.length}},{key:"carve",value:function(){return this.bitPos>0&&this.position++,this.bytes.slice(0,this.position)}}]),e}()},8:function(e,t,r){"use strict";var n=r(1),i=r.n(n),o=r(4),a=r.n(o),u=r(3),s=r.n(u),l=r(22),c=r.n(l),f=r(5),h=r.n(f);
/**
 * Custom error type for handling operation input errors.
 * i.e. where the operation can handle the error and print a message to the screen.
 *
 * @author d98762625 [d98762625@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */
var p=function(e){function t(){var e;i()(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=a()(this,s()(t).call(this,...n))).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(c()(e),t),e}return h()(t,e),t}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));t.a=p},9:function(e,t,r){"use strict";var n=r(1),i=r.n(n),o=r(2),a=r.n(o),u=r(13),s=r(0),l=r(16),c=function(){function e(t){i()(this,e),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.min=null,this.max=null,this.step=1,t&&this._parseConfig(t)}return a()(e,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",set:function(t){this._value=e.prepare(t,this.type)},get:function(){return this._value}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return s.b.parseEscapedChars(e);case"byteArray":return"string"==typeof e?(e=e.replace(/\s+/g,""),Object(l.a)(e)):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+s.b.truncate(e.toString(),10);return r;default:return e}}}]),e}(),f=function(){function e(){i()(this,e),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}return a()(e,[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"inputType",set:function(e){this._inputType=u.a.typeEnum(e)},get:function(){return u.a.enumLookup(this._inputType)}},{key:"outputType",set:function(e){this._outputType=u.a.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)},get:function(){return u.a.enumLookup(this._outputType)}},{key:"presentType",set:function(e){this._presentType=u.a.typeEnum(e)},get:function(){return u.a.enumLookup(this._presentType)}},{key:"args",set:function(e){var t=this;e.forEach((function(e){var r=new c(e);t.addIngredient(r)}))},get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"ingValues",set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))},get:function(){return this._ingList.map((function(e){return e.value}))}},{key:"breakpoint",set:function(e){this._breakpoint=!!e},get:function(){return this._breakpoint}},{key:"disabled",set:function(e){this._disabled=!!e},get:function(){return this._disabled}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}]),e}();t.a=f}});