nwlink 0.0.17 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/eadk/eadk.h +51 -17
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var t={7481:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",m=(t,e)=>{throw e},v="object"==typeof window,_="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g="";y?(g=_?r(1017).dirname(g)+"/":__dirname+"/",f=()=>{l||(u=r(7147),l=r(1017))},a=function(t,e){return f(),t=l.normalize(t),u.readFileSync(t,e?void 0:"utf8")},c=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{f(),t=l.normalize(t),u.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Ft))throw t})),process.on("unhandledRejection",(function(t){throw t})),m=(t,e)=>{if(q())throw process.exitCode=t,e;var r;(r=e)instanceof Ft||E("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}):(v||_)&&(_?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),n&&(g=n),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(c=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var w,b=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(w=i.wasmBinary);var k,S=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&et("no native wasm support detected");var x,A=!1;function C(t,e){t||et(e)}var F,P,T,O,R,D,j="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&j)return j.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var c=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function L(t,e){return t?I(T,t,e):""}function N(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}function M(t,e,r){return N(t,T,e,r)}function B(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function U(t){F=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=O=new Int16Array(t),i.HEAP32=R=new Int32Array(t),i.HEAPU8=T=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=D=new Uint32Array(t),i.HEAPF32=new Float32Array(t),i.HEAPF64=new Float64Array(t)}i.INITIAL_MEMORY;var z=[],H=[],G=[],V=[];function q(){return S}var W,Y,K,$,X=0,Z=null,Q=null;function J(t){X++,i.monitorRunDependencies&&i.monitorRunDependencies(X)}function tt(t){if(X--,i.monitorRunDependencies&&i.monitorRunDependencies(X),0==X&&(null!==Z&&(clearInterval(Z),Z=null),Q)){var e=Q;Q=null,e()}}function et(t){i.onAbort&&i.onAbort(t),E(t="Aborted("+t+")"),A=!0,x=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function rt(t){return t.startsWith("data:application/octet-stream;base64,")}function nt(t){try{if(t==W&&w)return new Uint8Array(w);if(c)return c(t);throw"both async and sync fetching of the wasm failed"}catch(t){et(t)}}function ot(t){for(;t.length>0;)t.shift()(i)}rt(W="ld.wasm")||(Y=W,W=i.locateFile?i.locateFile(Y,g):g+Y);var it={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=it.isAbs(t),r="/"===t.substr(-1);return(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=it.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=it.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments,0);return it.normalize(t.join("/"))},join2:(t,e)=>it.normalize(t+"/"+e)},at={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:ft.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=it.isAbs(n)}return(e?"/":"")+(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=at.resolve(t).substr(1),e=at.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},st={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){st.ttys[t]={input:[],output:[],ops:e},ft.registerDevice(t,st.stream_ops)},stream_ops:{open:function(t){var e=st.ttys[t.node.rdev];if(!e)throw new ft.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new ft.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new ft.ErrnoError(29)}if(void 0===s&&0===i)throw new ft.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new ft.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new ft.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(y){var r=Buffer.alloc(256),n=0;try{n=u.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=kt(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(b(I(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(b(I(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(E(I(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(E(I(t.output,0)),t.output=[])}}};function ct(t){et()}var ut,lt={ops_table:null,mount:function(t){return lt.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(ft.isBlkdev(r)||ft.isFIFO(r))throw new ft.ErrnoError(63);lt.ops_table||(lt.ops_table={dir:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr,lookup:lt.node_ops.lookup,mknod:lt.node_ops.mknod,rename:lt.node_ops.rename,unlink:lt.node_ops.unlink,rmdir:lt.node_ops.rmdir,readdir:lt.node_ops.readdir,symlink:lt.node_ops.symlink},stream:{llseek:lt.stream_ops.llseek}},file:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr},stream:{llseek:lt.stream_ops.llseek,read:lt.stream_ops.read,write:lt.stream_ops.write,allocate:lt.stream_ops.allocate,mmap:lt.stream_ops.mmap,msync:lt.stream_ops.msync}},link:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr,readlink:lt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr},stream:ft.chrdev_stream_ops}});var o=ft.createNode(t,e,r,n);return ft.isDir(o.mode)?(o.node_ops=lt.ops_table.dir.node,o.stream_ops=lt.ops_table.dir.stream,o.contents={}):ft.isFile(o.mode)?(o.node_ops=lt.ops_table.file.node,o.stream_ops=lt.ops_table.file.stream,o.usedBytes=0,o.contents=null):ft.isLink(o.mode)?(o.node_ops=lt.ops_table.link.node,o.stream_ops=lt.ops_table.link.stream):ft.isChrdev(o.mode)&&(o.node_ops=lt.ops_table.chrdev.node,o.stream_ops=lt.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=ft.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,ft.isDir(t.mode)?e.size=4096:ft.isFile(t.mode)?e.size=t.usedBytes:ft.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&<.resizeFileStorage(t,e.size)},lookup:function(t,e){throw ft.genericErrors[44]},mknod:function(t,e,r,n){return lt.createNode(t,e,r,n)},rename:function(t,e,r){if(ft.isDir(t.mode)){var n;try{n=ft.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new ft.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=ft.lookupNode(t,e);for(var n in r.contents)throw new ft.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=lt.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!ft.isLink(t.mode))throw new ft.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write:function(t,e,r,n,o,i){if(e.buffer===P.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(lt.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&ft.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new ft.ErrnoError(28);return n},allocate:function(t,e,r){lt.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,o){if(!ft.isFile(t.node.mode))throw new ft.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==F){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=ct()))throw new ft.ErrnoError(48);P.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(t,e,r,n,o){if(!ft.isFile(t.node.mode))throw new ft.ErrnoError(43);return 2&o||lt.stream_ops.write(t,e,0,n,r,!1),0}}},ft={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=at.resolve(ft.cwd(),t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new ft.ErrnoError(32);for(var r=it.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=ft.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=ft.lookupNode(n,r[i]),o=it.join2(o,r[i]),ft.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;ft.isLink(n.mode);){var c=ft.readlink(o);if(o=at.resolve(it.dirname(o),c),n=ft.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new ft.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var e;;){if(ft.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:(t,e)=>{for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%ft.nameTable.length},hashAddNode:t=>{var e=ft.hashName(t.parent.id,t.name);t.name_next=ft.nameTable[e],ft.nameTable[e]=t},hashRemoveNode:t=>{var e=ft.hashName(t.parent.id,t.name);if(ft.nameTable[e]===t)ft.nameTable[e]=t.name_next;else for(var r=ft.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:(t,e)=>{var r=ft.mayLookup(t);if(r)throw new ft.ErrnoError(r,t);for(var n=ft.hashName(t.id,e),o=ft.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return ft.lookup(t,e)},createNode:(t,e,r,n)=>{var o=new ft.FSNode(t,e,r,n);return ft.hashAddNode(o),o},destroyNode:t=>{ft.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var e=ft.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>ft.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=ft.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{return ft.lookupNode(t,e),20}catch(t){}return ft.nodePermissions(t,"wx")},mayDelete:(t,e,r)=>{var n;try{n=ft.lookupNode(t,e)}catch(t){return t.errno}var o=ft.nodePermissions(t,"wx");if(o)return o;if(r){if(!ft.isDir(n.mode))return 54;if(ft.isRoot(n)||ft.getPath(n)===ft.cwd())return 10}else if(ft.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?ft.isLink(t.mode)?32:ft.isDir(t.mode)&&("r"!==ft.flagsToPermissionString(e)||512&e)?31:ft.nodePermissions(t,ft.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,e=ft.MAX_OPEN_FDS)=>{for(var r=t;r<=e;r++)if(!ft.streams[r])return r;throw new ft.ErrnoError(33)},getStream:t=>ft.streams[t],createStream:(t,e,r)=>{ft.FSStream||(ft.FSStream=function(){this.shared={}},ft.FSStream.prototype={},Object.defineProperties(ft.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new ft.FSStream,t);var n=ft.nextfd(e,r);return t.fd=n,ft.streams[n]=t,t},closeStream:t=>{ft.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=ft.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new ft.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{ft.devices[t]={stream_ops:e}},getDevice:t=>ft.devices[t],getMounts:t=>{for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),ft.syncFSRequests++,ft.syncFSRequests>1&&E("warning: "+ft.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=ft.getMounts(ft.root.mount),n=0;function o(t){return ft.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount:(t,e,r)=>{var n,o="/"===r,i=!r;if(o&&ft.root)throw new ft.ErrnoError(10);if(!o&&!i){var a=ft.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,ft.isMountpoint(n))throw new ft.ErrnoError(10);if(!ft.isDir(n.mode))throw new ft.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},c=t.mount(s);return c.mount=s,s.root=c,o?ft.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:t=>{var e=ft.lookupPath(t,{follow_mount:!1});if(!ft.isMountpoint(e.node))throw new ft.ErrnoError(28);var r=e.node,n=r.mounted,o=ft.getMounts(n);Object.keys(ft.nameTable).forEach((t=>{for(var e=ft.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&ft.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,r)=>{var n=ft.lookupPath(t,{parent:!0}).node,o=it.basename(t);if(!o||"."===o||".."===o)throw new ft.ErrnoError(28);var i=ft.mayCreate(n,o);if(i)throw new ft.ErrnoError(i);if(!n.node_ops.mknod)throw new ft.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,ft.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,ft.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{ft.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>(void 0===r&&(r=e,e=438),e|=8192,ft.mknod(t,e,r)),symlink:(t,e)=>{if(!at.resolve(t))throw new ft.ErrnoError(44);var r=ft.lookupPath(e,{parent:!0}).node;if(!r)throw new ft.ErrnoError(44);var n=it.basename(e),o=ft.mayCreate(r,n);if(o)throw new ft.ErrnoError(o);if(!r.node_ops.symlink)throw new ft.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:(t,e)=>{var r,n,o=it.dirname(t),i=it.dirname(e),a=it.basename(t),s=it.basename(e);if(r=ft.lookupPath(t,{parent:!0}).node,n=ft.lookupPath(e,{parent:!0}).node,!r||!n)throw new ft.ErrnoError(44);if(r.mount!==n.mount)throw new ft.ErrnoError(75);var c,u=ft.lookupNode(r,a),l=at.relative(t,i);if("."!==l.charAt(0))throw new ft.ErrnoError(28);if("."!==(l=at.relative(e,o)).charAt(0))throw new ft.ErrnoError(55);try{c=ft.lookupNode(n,s)}catch(t){}if(u!==c){var f=ft.isDir(u.mode),h=ft.mayDelete(r,a,f);if(h)throw new ft.ErrnoError(h);if(h=c?ft.mayDelete(n,s,f):ft.mayCreate(n,s))throw new ft.ErrnoError(h);if(!r.node_ops.rename)throw new ft.ErrnoError(63);if(ft.isMountpoint(u)||c&&ft.isMountpoint(c))throw new ft.ErrnoError(10);if(n!==r&&(h=ft.nodePermissions(r,"w")))throw new ft.ErrnoError(h);ft.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(t){throw t}finally{ft.hashAddNode(u)}}},rmdir:t=>{var e=ft.lookupPath(t,{parent:!0}).node,r=it.basename(t),n=ft.lookupNode(e,r),o=ft.mayDelete(e,r,!0);if(o)throw new ft.ErrnoError(o);if(!e.node_ops.rmdir)throw new ft.ErrnoError(63);if(ft.isMountpoint(n))throw new ft.ErrnoError(10);e.node_ops.rmdir(e,r),ft.destroyNode(n)},readdir:t=>{var e=ft.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new ft.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=ft.lookupPath(t,{parent:!0}).node;if(!e)throw new ft.ErrnoError(44);var r=it.basename(t),n=ft.lookupNode(e,r),o=ft.mayDelete(e,r,!1);if(o)throw new ft.ErrnoError(o);if(!e.node_ops.unlink)throw new ft.ErrnoError(63);if(ft.isMountpoint(n))throw new ft.ErrnoError(10);e.node_ops.unlink(e,r),ft.destroyNode(n)},readlink:t=>{var e=ft.lookupPath(t).node;if(!e)throw new ft.ErrnoError(44);if(!e.node_ops.readlink)throw new ft.ErrnoError(28);return at.resolve(ft.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var r=ft.lookupPath(t,{follow:!e}).node;if(!r)throw new ft.ErrnoError(44);if(!r.node_ops.getattr)throw new ft.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>ft.stat(t,!0),chmod:(t,e,r)=>{var n;if(!(n="string"==typeof t?ft.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new ft.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,e)=>{ft.chmod(t,e,!0)},fchmod:(t,e)=>{var r=ft.getStream(t);if(!r)throw new ft.ErrnoError(8);ft.chmod(r.node,e)},chown:(t,e,r,n)=>{var o;if(!(o="string"==typeof t?ft.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new ft.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,e,r)=>{ft.chown(t,e,r,!0)},fchown:(t,e,r)=>{var n=ft.getStream(t);if(!n)throw new ft.ErrnoError(8);ft.chown(n.node,e,r)},truncate:(t,e)=>{if(e<0)throw new ft.ErrnoError(28);var r;if(!(r="string"==typeof t?ft.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new ft.ErrnoError(63);if(ft.isDir(r.mode))throw new ft.ErrnoError(31);if(!ft.isFile(r.mode))throw new ft.ErrnoError(28);var n=ft.nodePermissions(r,"w");if(n)throw new ft.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var r=ft.getStream(t);if(!r)throw new ft.ErrnoError(8);if(0==(2097155&r.flags))throw new ft.ErrnoError(28);ft.truncate(r.node,e)},utime:(t,e,r)=>{var n=ft.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:(t,e,r)=>{if(""===t)throw new ft.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(e="string"==typeof e?ft.modeStringToFlags(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=it.normalize(t);try{n=ft.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new ft.ErrnoError(20)}else n=ft.mknod(t,r,0),o=!0;if(!n)throw new ft.ErrnoError(44);if(ft.isChrdev(n.mode)&&(e&=-513),65536&e&&!ft.isDir(n.mode))throw new ft.ErrnoError(54);if(!o){var a=ft.mayOpen(n,e);if(a)throw new ft.ErrnoError(a)}512&e&&!o&&ft.truncate(n,0),e&=-131713;var s=ft.createStream({node:n,path:ft.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(ft.readFiles||(ft.readFiles={}),t in ft.readFiles||(ft.readFiles[t]=1)),s},close:t=>{if(ft.isClosed(t))throw new ft.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{ft.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,r)=>{if(ft.isClosed(t))throw new ft.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new ft.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new ft.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:(t,e,r,n,o)=>{if(n<0||o<0)throw new ft.ErrnoError(28);if(ft.isClosed(t))throw new ft.ErrnoError(8);if(1==(2097155&t.flags))throw new ft.ErrnoError(8);if(ft.isDir(t.node.mode))throw new ft.ErrnoError(31);if(!t.stream_ops.read)throw new ft.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new ft.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write:(t,e,r,n,o,i)=>{if(n<0||o<0)throw new ft.ErrnoError(28);if(ft.isClosed(t))throw new ft.ErrnoError(8);if(0==(2097155&t.flags))throw new ft.ErrnoError(8);if(ft.isDir(t.node.mode))throw new ft.ErrnoError(31);if(!t.stream_ops.write)throw new ft.ErrnoError(28);t.seekable&&1024&t.flags&&ft.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new ft.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate:(t,e,r)=>{if(ft.isClosed(t))throw new ft.ErrnoError(8);if(e<0||r<=0)throw new ft.ErrnoError(28);if(0==(2097155&t.flags))throw new ft.ErrnoError(8);if(!ft.isFile(t.node.mode)&&!ft.isDir(t.node.mode))throw new ft.ErrnoError(43);if(!t.stream_ops.allocate)throw new ft.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:(t,e,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new ft.ErrnoError(2);if(1==(2097155&t.flags))throw new ft.ErrnoError(2);if(!t.stream_ops.mmap)throw new ft.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl:(t,e,r)=>{if(!t.stream_ops.ioctl)throw new ft.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=ft.open(t,e.flags),o=ft.stat(t).size,i=new Uint8Array(o);return ft.read(n,i,0,o,0),"utf8"===e.encoding?r=I(i,0):"binary"===e.encoding&&(r=i),ft.close(n),r},writeFile:(t,e,r={})=>{r.flags=r.flags||577;var n=ft.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(B(e)+1),i=N(e,o,0,o.length);ft.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");ft.write(n,e,0,e.byteLength,void 0,r.canOwn)}ft.close(n)},cwd:()=>ft.currentPath,chdir:t=>{var e=ft.lookupPath(t,{follow:!0});if(null===e.node)throw new ft.ErrnoError(44);if(!ft.isDir(e.node.mode))throw new ft.ErrnoError(54);var r=ft.nodePermissions(e.node,"x");if(r)throw new ft.ErrnoError(r);ft.currentPath=e.path},createDefaultDirectories:()=>{ft.mkdir("/tmp"),ft.mkdir("/home"),ft.mkdir("/home/web_user")},createDefaultDevices:()=>{ft.mkdir("/dev"),ft.registerDevice(ft.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),ft.mkdev("/dev/null",ft.makedev(1,3)),st.register(ft.makedev(5,0),st.default_tty_ops),st.register(ft.makedev(6,0),st.default_tty1_ops),ft.mkdev("/dev/tty",ft.makedev(5,0)),ft.mkdev("/dev/tty1",ft.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(y)try{var e=r(6113);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){et("randomDevice")}}();ft.createDevice("/dev","random",t),ft.createDevice("/dev","urandom",t),ft.mkdir("/dev/shm"),ft.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{ft.mkdir("/proc");var t=ft.mkdir("/proc/self");ft.mkdir("/proc/self/fd"),ft.mount({mount:()=>{var e=ft.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var r=+e,n=ft.getStream(r);if(!n)throw new ft.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?ft.createDevice("/dev","stdin",i.stdin):ft.symlink("/dev/tty","/dev/stdin"),i.stdout?ft.createDevice("/dev","stdout",null,i.stdout):ft.symlink("/dev/tty","/dev/stdout"),i.stderr?ft.createDevice("/dev","stderr",null,i.stderr):ft.symlink("/dev/tty1","/dev/stderr"),ft.open("/dev/stdin",0),ft.open("/dev/stdout",1),ft.open("/dev/stderr",1)},ensureErrnoError:()=>{ft.ErrnoError||(ft.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},ft.ErrnoError.prototype=new Error,ft.ErrnoError.prototype.constructor=ft.ErrnoError,[44].forEach((t=>{ft.genericErrors[t]=new ft.ErrnoError(t),ft.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{ft.ensureErrnoError(),ft.nameTable=new Array(4096),ft.mount(lt,{},"/"),ft.createDefaultDirectories(),ft.createDefaultDevices(),ft.createSpecialDirectories(),ft.filesystems={MEMFS:lt}},init:(t,e,r)=>{ft.init.initialized=!0,ft.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,ft.createStandardStreams()},quit:()=>{ft.init.initialized=!1;for(var t=0;t<ft.streams.length;t++){var e=ft.streams[t];e&&ft.close(e)}},getMode:(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},findObject:(t,e)=>{var r=ft.analyzePath(t,e);return r.exists?r.object:null},analyzePath:(t,e)=>{try{t=(n=ft.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ft.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=it.basename(t),n=ft.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath:(t,e,r,n)=>{t="string"==typeof t?t:ft.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=it.join2(t,i);try{ft.mkdir(a)}catch(t){}t=a}}return a},createFile:(t,e,r,n,o)=>{var i=it.join2("string"==typeof t?t:ft.getPath(t),e),a=ft.getMode(n,o);return ft.create(i,a)},createDataFile:(t,e,r,n,o,i)=>{var a=e;t&&(t="string"==typeof t?t:ft.getPath(t),a=e?it.join2(t,e):t);var s=ft.getMode(n,o),c=ft.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}ft.chmod(c,146|s);var h=ft.open(c,577);ft.write(h,r,0,r.length,0,i),ft.close(h),ft.chmod(c,s)}return c},createDevice:(t,e,r,n)=>{var o=it.join2("string"==typeof t?t:ft.getPath(t),e),i=ft.getMode(!!r,!!n);ft.createDevice.major||(ft.createDevice.major=64);var a=ft.makedev(ft.createDevice.major++,0);return ft.registerDevice(a,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(t){throw new ft.ErrnoError(29)}if(void 0===c&&0===a)throw new ft.ErrnoError(6);if(null==c)break;a++,e[n+s]=c}return a&&(t.node.timestamp=Date.now()),a},write:(t,e,r,o,i)=>{for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new ft.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),ft.mkdev(o,i,a)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=kt(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new ft.ErrnoError(29)}},createLazyFile:(t,e,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):kt(o.responseText||"",!0)})(e,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!_)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=ft.createFile(t,e,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(c.stream_ops).forEach((t=>{var e=c.stream_ops[t];u[t]=function(){return ft.forceLoadFile(c),e.apply(null,arguments)}})),u.read=(t,e,r,n,o)=>(ft.forceLoadFile(c),l(t,e,r,n,o)),u.mmap=(t,e,r,n,o)=>{ft.forceLoadFile(c);var i=ct();if(!i)throw new ft.ErrnoError(48);return l(t,P,i,e,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(t,e,r,n,o,i,a,c,u,l)=>{var f=e?at.resolve(it.join2(t,e)):t;function h(r){function s(r){l&&l(),c||ft.createDataFile(t,e,r,n,o,u),i&&i(),tt()}Browser.handledByPreloadPlugin(r,f,s,(()=>{a&&a(),tt()}))||s(r)}J(),"string"==typeof r?function(t,e,r,n){var o=n?"":"al "+t;s(t,(function(r){C(r,'Loading data file "'+t+'" failed (no arrayBuffer).'),e(new Uint8Array(r)),o&&tt()}),(function(e){if(!r)throw'Loading data file "'+t+'" failed.';r()})),o&&J()}(r,(t=>h(t)),a):h(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=ft.indexedDB();try{var o=n.open(ft.DB_NAME(),ft.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=()=>{b("creating db"),o.result.createObjectStore(ft.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([ft.DB_STORE_NAME],"readwrite"),i=n.objectStore(ft.DB_STORE_NAME),a=0,s=0,c=t.length;function u(){0==s?e():r()}t.forEach((t=>{var e=i.put(ft.analyzePath(t).object.contents,t);e.onsuccess=()=>{++a+s==c&&u()},e.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=ft.indexedDB();try{var o=n.open(ft.DB_NAME(),ft.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([ft.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var a=i.objectStore(ft.DB_STORE_NAME),s=0,c=0,u=t.length;function l(){0==c?e():r()}t.forEach((t=>{var e=a.get(t);e.onsuccess=()=>{ft.analyzePath(t).exists&&ft.unlink(t),ft.createDataFile(it.dirname(t),it.basename(t),e.result,!0,!0,!0),++s+c==u&&l()},e.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r}},ht={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(it.isAbs(e))return e;var n;if(-100===t)n=ft.cwd();else{var o=ft.getStream(t);if(!o)throw new ft.ErrnoError(8);n=o.path}if(0==e.length){if(!r)throw new ft.ErrnoError(44);return n}return it.join2(n,e)},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&it.normalize(e)!==it.normalize(ft.getPath(t.node)))return-54;throw t}return R[r>>2]=n.dev,R[r+4>>2]=0,R[r+8>>2]=n.ino,R[r+12>>2]=n.mode,R[r+16>>2]=n.nlink,R[r+20>>2]=n.uid,R[r+24>>2]=n.gid,R[r+28>>2]=n.rdev,R[r+32>>2]=0,$=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],R[r+40>>2]=$[0],R[r+44>>2]=$[1],R[r+48>>2]=4096,R[r+52>>2]=n.blocks,R[r+56>>2]=n.atime.getTime()/1e3|0,R[r+60>>2]=0,R[r+64>>2]=n.mtime.getTime()/1e3|0,R[r+68>>2]=0,R[r+72>>2]=n.ctime.getTime()/1e3|0,R[r+76>>2]=0,$=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],R[r+80>>2]=$[0],R[r+84>>2]=$[1],0},doMsync:function(t,e,r,n,o){var i=T.slice(t,t+r);ft.msync(e,i,o,r,n)},varargs:void 0,get:function(){return ht.varargs+=4,R[ht.varargs-4>>2]},getStr:function(t){return L(t)},getStreamFromFD:function(t){var e=ft.getStream(t);if(!e)throw new ft.ErrnoError(8);return e}},pt={BUCKET_BUFFER_SIZE:8192,mount:function(t){return ft.createNode(null,"/",16895,0)},createPipe:function(){var t={buckets:[],refcnt:2};t.buckets.push({buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var e=pt.nextname(),r=pt.nextname(),n=ft.createNode(pt.root,e,4096,0),o=ft.createNode(pt.root,r,4096,0);n.pipe=t,o.pipe=t;var i=ft.createStream({path:e,node:n,flags:0,seekable:!1,stream_ops:pt.stream_ops});n.stream=i;var a=ft.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:pt.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(t){var e=t.node.pipe;if(1==(2097155&t.flags))return 260;if(e.buckets.length>0)for(var r=0;r<e.buckets.length;r++){var n=e.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(t,e,r){return 28},fsync:function(t){return 28},read:function(t,e,r,n,o){for(var i=t.node.pipe,a=0,s=0;s<i.buckets.length;s++){var c=i.buckets[s];a+=c.offset-c.roffset}C(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var u=e.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new ft.ErrnoError(6);var l=Math.min(a,n),f=l,h=0;for(s=0;s<i.buckets.length;s++){var p=i.buckets[s],d=p.offset-p.roffset;if(l<=d){var m=p.buffer.subarray(p.roffset,p.offset);l<d?(m=m.subarray(0,l),p.roffset+=l):h++,u.set(m);break}m=p.buffer.subarray(p.roffset,p.offset),u.set(m),u=u.subarray(m.byteLength),l-=m.byteLength,h++}return h&&h==i.buckets.length&&(h--,i.buckets[h].offset=0,i.buckets[h].roffset=0),i.buckets.splice(0,h),f},write:function(t,e,r,n,o){var i=t.node.pipe;C(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var a=e.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var c=null;0==i.buckets.length?(c={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(c)):c=i.buckets[i.buckets.length-1],C(c.offset<=pt.BUCKET_BUFFER_SIZE);var u=pt.BUCKET_BUFFER_SIZE-c.offset;if(u>=s)return c.buffer.set(a,c.offset),c.offset+=s,s;u>0&&(c.buffer.set(a.subarray(0,u),c.offset),c.offset+=u,a=a.subarray(u,a.byteLength));for(var l=a.byteLength/pt.BUCKET_BUFFER_SIZE|0,f=a.byteLength%pt.BUCKET_BUFFER_SIZE,h=0;h<l;h++){var p={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:pt.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(p),p.buffer.set(a.subarray(0,pt.BUCKET_BUFFER_SIZE)),a=a.subarray(pt.BUCKET_BUFFER_SIZE,a.byteLength)}return f>0&&(p={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(p),p.buffer.set(a)),s},close:function(t){var e=t.node.pipe;e.refcnt--,0===e.refcnt&&(e.buckets=null)}},nextname:function(){return pt.nextname.current||(pt.nextname.current=0),"pipe["+pt.nextname.current+++"]"}},dt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function mt(t){try{return k.grow(t-F.byteLength+65535>>>16),U(k.buffer),1}catch(t){}}ut=y?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var vt={};function _t(){if(!_t.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var e in vt)void 0===vt[e]?delete t[e]:t[e]=vt[e];var r=[];for(var e in t)r.push(e+"="+t[e]);_t.strings=r}return _t.strings}function yt(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=D[e>>2],s=D[e+4>>2];e+=8;var c=ft.read(t,P,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}function gt(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}var wt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=ft.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},bt=365,Et=146;function kt(t,e,r){var n=r>0?r:B(t)+1,o=new Array(n),i=N(t,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(wt.prototype,{read:{get:function(){return(this.mode&bt)===bt},set:function(t){t?this.mode|=bt:this.mode&=-366}},write:{get:function(){return(this.mode&Et)===Et},set:function(t){t?this.mode|=Et:this.mode&=-147}},isFolder:{get:function(){return ft.isDir(this.mode)}},isDevice:{get:function(){return ft.isChrdev(this.mode)}}}),ft.FSNode=wt,ft.staticInit();var St,xt={a:function(t,e,r,n){et("Assertion failed: "+L(t)+", at: "+[e?L(e):"unknown filename",r,n?L(n):"unknown function"])},G:function(t,e){try{return t=ht.getStr(t),ft.chmod(t,e),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},F:function(t){try{var e=ht.getStreamFromFD(t);return ft.createStream(e,0).fd}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},H:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e),-8&r)return-28;var o=ft.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&ft.nodePermissions(o,i)?-2:0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},e:function(t,e,r){ht.varargs=r;try{var n=ht.getStreamFromFD(t);switch(e){case 0:return(o=ht.get())<0?-28:ft.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ht.get();return n.flags|=o,0;case 5:return o=ht.get(),O[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,R[At()>>2]=i,-1}}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}var i},z:function(t,e){try{var r=ht.getStreamFromFD(t);return ht.doStat(ft.stat,r.path,e)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},v:function(t,e){try{if(0===e)return-28;var r=ft.cwd(),n=B(r)+1;return e<n?-68:(M(r,t,e),n)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},m:function(t,e,r){ht.varargs=r;try{var n=ht.getStreamFromFD(t);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=ht.get();return R[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=ht.get(),ft.ioctl(n,e,o);default:et("bad ioctl syscall "+e)}}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},x:function(t,e){try{return t=ht.getStr(t),ht.doStat(ft.lstat,t,e)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},w:function(t,e,r,n){try{e=ht.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=ht.calculateAt(t,e,i),ht.doStat(o?ft.lstat:ft.stat,e,r)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},h:function(t,e,r,n){ht.varargs=n;try{e=ht.getStr(e),e=ht.calculateAt(t,e);var o=n?ht.get():0;return ft.open(e,r,o).fd}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},t:function(t){try{if(0==t)throw new ft.ErrnoError(21);var e=pt.createPipe();return R[t>>2]=e.readable_fd,R[t+4>>2]=e.writable_fd,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},s:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e),n<=0)return-28;var o=ft.readlink(e),i=Math.min(n,B(o)),a=P[r+i];return M(o,r,n+1),P[r+i]=a,i}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},q:function(t){try{return t=ht.getStr(t),ft.rmdir(t),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},y:function(t,e){try{return t=ht.getStr(t),ht.doStat(ft.stat,t,e)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},g:function(t,e,r){try{return e=ht.getStr(e),e=ht.calculateAt(t,e),0===r?ft.unlink(e):512===r?ft.rmdir(e):et("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},C:function(t){},E:function(t,e){et(dt)},D:function(t,e){et(dt)},l:function(){return Date.now()},B:function(){return!0},b:function(){et("")},k:ut,A:function(t,e,r){T.copyWithin(t,e,e+r)},f:function(t){var e,r,n=T.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),mt(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},n:function(t,e){var r=0;return _t().forEach((function(n,o){var i=e+r;D[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)P[e++>>0]=t.charCodeAt(n);r||(P[e>>0]=0)}(n,i),r+=n.length+1})),0},r:function(t,e){var r=_t();D[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),D[e>>2]=n,0},d:function(t){Ot(t)},c:function(t){try{var e=ht.getStreamFromFD(t);return ft.close(e),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},u:function(t,e){try{var r=ht.getStreamFromFD(t),n=r.tty?2:ft.isDir(r.mode)?3:ft.isLink(r.mode)?7:4;return P[e>>0]=n,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},o:function(t,e,r,n,o,i){try{var a=gt(n,o);if(isNaN(a))return 61;var s=yt(ht.getStreamFromFD(t),e,r,a);return R[i>>2]=s,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},j:function(t,e,r,n){try{var o=yt(ht.getStreamFromFD(t),e,r);return R[n>>2]=o,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},p:function(t,e,r,n,o){try{var i=gt(e,r);if(isNaN(i))return 61;var a=ht.getStreamFromFD(t);return ft.llseek(a,i,n),$=[a.position>>>0,(K=a.position,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],R[o>>2]=$[0],R[o+4>>2]=$[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},i:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=D[e>>2],s=D[e+4>>2];e+=8;var c=ft.write(t,P,a,s,n);if(c<0)return-1;o+=c}return o}(ht.getStreamFromFD(t),e,r);return D[n>>2]=o,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},I:function(t){Rt(t)}},At=(function(){var t={a:xt};function e(t,e){var r,n=t.exports;i.asm=n,U((k=i.asm.J).buffer),i.asm.N,r=i.asm.K,H.unshift(r),tt()}function r(t){e(t.instance)}function n(e){return(w||!v&&!_||"function"!=typeof fetch?Promise.resolve().then((function(){return nt(W)})):fetch(W,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+W+"'";return t.arrayBuffer()})).catch((function(){return nt(W)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){E("failed to asynchronously prepare wasm: "+t),et(t)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){return E("Module.instantiateWasm callback failed with error: "+t),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||rt(W)||y||"function"!=typeof fetch?n(r):fetch(W,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return E("wasm streaming compile failed: "+t),E("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i.___errno_location=function(){return(At=i.___errno_location=i.asm.L).apply(null,arguments)}),Ct=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Ct=i.stackAlloc=i.asm.O).apply(null,arguments)});function Ft(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Pt(t){var e=i._main;(t=t||[]).unshift(d);var r=t.length,n=Ct(4*(r+1)),o=n>>2;t.forEach((t=>{R[o++]=function(t){var e=B(t)+1,r=Ct(e);return N(t,P,r,e),r}(t)})),R[o]=0;try{var a=e(r,n);return Ot(a),a}catch(t){return function(t){if(t instanceof Ft||"unwind"==t)return x;m(1,t)}(t)}}function Tt(t){function r(){St||(St=!0,i.calledRun=!0,A||(i.noFSInit||ft.init.initialized||ft.init(),ft.ignorePermissions=!1,st.init(),pt.root=ft.mount(pt,{},null),ot(H),ot(G),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Dt&&Pt(t),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),V.unshift(t);var t;ot(V)}()))}t=t||p,X>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),z.unshift(t);var t;ot(z)}(),X>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Ot(t,e){x=t,Rt(t)}function Rt(t){x=t,q()||(i.onExit&&i.onExit(t),A=!0),m(t,new Ft(t))}if(i.FS=ft,Q=function t(){St||Tt(),St||(Q=t)},i.run=Tt,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Dt=!0;return i.noInitialRun&&(Dt=!1),Tt(),t.ready});t.exports=o},3825:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",m=(t,e)=>{throw e},v="object"==typeof window,_="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g="";y?(g=_?r(1017).dirname(g)+"/":__dirname+"/",f=()=>{l||(u=r(7147),l=r(1017))},a=function(t,e){return f(),t=l.normalize(t),u.readFileSync(t,e?void 0:"utf8")},c=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{f(),t=l.normalize(t),u.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof kt))throw t})),process.on("unhandledRejection",(function(t){throw t})),m=(t,e)=>{if(V())throw process.exitCode=t,e;var r;(r=e)instanceof kt||E("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}):(v||_)&&(_?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),n&&(g=n),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(c=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var w,b=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(w=i.wasmBinary);var k,S=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&tt("no native wasm support detected");var x,A,C,F,P,T,O,R=!1,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function j(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&D)return D.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var c=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function I(t,e){return t?j(F,t,e):""}function L(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}function N(t,e,r){return L(t,F,e,r)}function M(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function B(t){A=t,i.HEAP8=C=new Int8Array(t),i.HEAP16=P=new Int16Array(t),i.HEAP32=T=new Int32Array(t),i.HEAPU8=F=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=O=new Uint32Array(t),i.HEAPF32=new Float32Array(t),i.HEAPF64=new Float64Array(t)}i.INITIAL_MEMORY;var U=[],z=[],H=[],G=[];function V(){return S}var q,W,Y,K,$=0,X=null,Z=null;function Q(t){$++,i.monitorRunDependencies&&i.monitorRunDependencies($)}function J(t){if($--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==X&&(clearInterval(X),X=null),Z)){var e=Z;Z=null,e()}}function tt(t){i.onAbort&&i.onAbort(t),E(t="Aborted("+t+")"),R=!0,x=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function et(t){return t.startsWith("data:application/octet-stream;base64,")}function rt(t){try{if(t==q&&w)return new Uint8Array(w);if(c)return c(t);throw"both async and sync fetching of the wasm failed"}catch(t){tt(t)}}function nt(t){for(;t.length>0;)t.shift()(i)}et(q="objcopy.wasm")||(W=q,q=i.locateFile?i.locateFile(W,g):g+W);var ot={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=ot.isAbs(t),r="/"===t.substr(-1);return(t=ot.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=ot.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=ot.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments,0);return ot.normalize(t.join("/"))},join2:(t,e)=>ot.normalize(t+"/"+e)},it={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:lt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=ot.isAbs(n)}return(e?"/":"")+(t=ot.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=it.resolve(t).substr(1),e=it.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},at={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){at.ttys[t]={input:[],output:[],ops:e},lt.registerDevice(t,at.stream_ops)},stream_ops:{open:function(t){var e=at.ttys[t.node.rdev];if(!e)throw new lt.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new lt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new lt.ErrnoError(29)}if(void 0===s&&0===i)throw new lt.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new lt.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new lt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(y){var r=Buffer.alloc(256),n=0;try{n=u.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=yt(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(b(j(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(b(j(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(E(j(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(E(j(t.output,0)),t.output=[])}}};function st(t){tt()}var ct={ops_table:null,mount:function(t){return ct.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(lt.isBlkdev(r)||lt.isFIFO(r))throw new lt.ErrnoError(63);ct.ops_table||(ct.ops_table={dir:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr,lookup:ct.node_ops.lookup,mknod:ct.node_ops.mknod,rename:ct.node_ops.rename,unlink:ct.node_ops.unlink,rmdir:ct.node_ops.rmdir,readdir:ct.node_ops.readdir,symlink:ct.node_ops.symlink},stream:{llseek:ct.stream_ops.llseek}},file:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr},stream:{llseek:ct.stream_ops.llseek,read:ct.stream_ops.read,write:ct.stream_ops.write,allocate:ct.stream_ops.allocate,mmap:ct.stream_ops.mmap,msync:ct.stream_ops.msync}},link:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr,readlink:ct.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr},stream:lt.chrdev_stream_ops}});var o=lt.createNode(t,e,r,n);return lt.isDir(o.mode)?(o.node_ops=ct.ops_table.dir.node,o.stream_ops=ct.ops_table.dir.stream,o.contents={}):lt.isFile(o.mode)?(o.node_ops=ct.ops_table.file.node,o.stream_ops=ct.ops_table.file.stream,o.usedBytes=0,o.contents=null):lt.isLink(o.mode)?(o.node_ops=ct.ops_table.link.node,o.stream_ops=ct.ops_table.link.stream):lt.isChrdev(o.mode)&&(o.node_ops=ct.ops_table.chrdev.node,o.stream_ops=ct.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=lt.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,lt.isDir(t.mode)?e.size=4096:lt.isFile(t.mode)?e.size=t.usedBytes:lt.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&ct.resizeFileStorage(t,e.size)},lookup:function(t,e){throw lt.genericErrors[44]},mknod:function(t,e,r,n){return ct.createNode(t,e,r,n)},rename:function(t,e,r){if(lt.isDir(t.mode)){var n;try{n=lt.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new lt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=lt.lookupNode(t,e);for(var n in r.contents)throw new lt.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=ct.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!lt.isLink(t.mode))throw new lt.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write:function(t,e,r,n,o,i){if(e.buffer===C.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(ct.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&<.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new lt.ErrnoError(28);return n},allocate:function(t,e,r){ct.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,o){if(!lt.isFile(t.node.mode))throw new lt.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==A){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=st()))throw new lt.ErrnoError(48);C.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(t,e,r,n,o){if(!lt.isFile(t.node.mode))throw new lt.ErrnoError(43);return 2&o||ct.stream_ops.write(t,e,0,n,r,!1),0}}};function ut(t,e,r,n){var o=n?"":"al "+t;s(t,(function(r){var n;n='Loading data file "'+t+'" failed (no arrayBuffer).',r||tt(n),e(new Uint8Array(r)),o&&J()}),(function(e){if(!r)throw'Loading data file "'+t+'" failed.';r()})),o&&Q()}var lt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=it.resolve(lt.cwd(),t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new lt.ErrnoError(32);for(var r=ot.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=lt.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=lt.lookupNode(n,r[i]),o=ot.join2(o,r[i]),lt.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;lt.isLink(n.mode);){var c=lt.readlink(o);if(o=it.resolve(ot.dirname(o),c),n=lt.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new lt.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var e;;){if(lt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:(t,e)=>{for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%lt.nameTable.length},hashAddNode:t=>{var e=lt.hashName(t.parent.id,t.name);t.name_next=lt.nameTable[e],lt.nameTable[e]=t},hashRemoveNode:t=>{var e=lt.hashName(t.parent.id,t.name);if(lt.nameTable[e]===t)lt.nameTable[e]=t.name_next;else for(var r=lt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:(t,e)=>{var r=lt.mayLookup(t);if(r)throw new lt.ErrnoError(r,t);for(var n=lt.hashName(t.id,e),o=lt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return lt.lookup(t,e)},createNode:(t,e,r,n)=>{var o=new lt.FSNode(t,e,r,n);return lt.hashAddNode(o),o},destroyNode:t=>{lt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var e=lt.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>lt.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=lt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{return lt.lookupNode(t,e),20}catch(t){}return lt.nodePermissions(t,"wx")},mayDelete:(t,e,r)=>{var n;try{n=lt.lookupNode(t,e)}catch(t){return t.errno}var o=lt.nodePermissions(t,"wx");if(o)return o;if(r){if(!lt.isDir(n.mode))return 54;if(lt.isRoot(n)||lt.getPath(n)===lt.cwd())return 10}else if(lt.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?lt.isLink(t.mode)?32:lt.isDir(t.mode)&&("r"!==lt.flagsToPermissionString(e)||512&e)?31:lt.nodePermissions(t,lt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,e=lt.MAX_OPEN_FDS)=>{for(var r=t;r<=e;r++)if(!lt.streams[r])return r;throw new lt.ErrnoError(33)},getStream:t=>lt.streams[t],createStream:(t,e,r)=>{lt.FSStream||(lt.FSStream=function(){this.shared={}},lt.FSStream.prototype={},Object.defineProperties(lt.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new lt.FSStream,t);var n=lt.nextfd(e,r);return t.fd=n,lt.streams[n]=t,t},closeStream:t=>{lt.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=lt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new lt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{lt.devices[t]={stream_ops:e}},getDevice:t=>lt.devices[t],getMounts:t=>{for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),lt.syncFSRequests++,lt.syncFSRequests>1&&E("warning: "+lt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=lt.getMounts(lt.root.mount),n=0;function o(t){return lt.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount:(t,e,r)=>{var n,o="/"===r,i=!r;if(o&<.root)throw new lt.ErrnoError(10);if(!o&&!i){var a=lt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,lt.isMountpoint(n))throw new lt.ErrnoError(10);if(!lt.isDir(n.mode))throw new lt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},c=t.mount(s);return c.mount=s,s.root=c,o?lt.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:t=>{var e=lt.lookupPath(t,{follow_mount:!1});if(!lt.isMountpoint(e.node))throw new lt.ErrnoError(28);var r=e.node,n=r.mounted,o=lt.getMounts(n);Object.keys(lt.nameTable).forEach((t=>{for(var e=lt.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&<.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,r)=>{var n=lt.lookupPath(t,{parent:!0}).node,o=ot.basename(t);if(!o||"."===o||".."===o)throw new lt.ErrnoError(28);var i=lt.mayCreate(n,o);if(i)throw new lt.ErrnoError(i);if(!n.node_ops.mknod)throw new lt.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,lt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,lt.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{lt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>(void 0===r&&(r=e,e=438),e|=8192,lt.mknod(t,e,r)),symlink:(t,e)=>{if(!it.resolve(t))throw new lt.ErrnoError(44);var r=lt.lookupPath(e,{parent:!0}).node;if(!r)throw new lt.ErrnoError(44);var n=ot.basename(e),o=lt.mayCreate(r,n);if(o)throw new lt.ErrnoError(o);if(!r.node_ops.symlink)throw new lt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:(t,e)=>{var r,n,o=ot.dirname(t),i=ot.dirname(e),a=ot.basename(t),s=ot.basename(e);if(r=lt.lookupPath(t,{parent:!0}).node,n=lt.lookupPath(e,{parent:!0}).node,!r||!n)throw new lt.ErrnoError(44);if(r.mount!==n.mount)throw new lt.ErrnoError(75);var c,u=lt.lookupNode(r,a),l=it.relative(t,i);if("."!==l.charAt(0))throw new lt.ErrnoError(28);if("."!==(l=it.relative(e,o)).charAt(0))throw new lt.ErrnoError(55);try{c=lt.lookupNode(n,s)}catch(t){}if(u!==c){var f=lt.isDir(u.mode),h=lt.mayDelete(r,a,f);if(h)throw new lt.ErrnoError(h);if(h=c?lt.mayDelete(n,s,f):lt.mayCreate(n,s))throw new lt.ErrnoError(h);if(!r.node_ops.rename)throw new lt.ErrnoError(63);if(lt.isMountpoint(u)||c&<.isMountpoint(c))throw new lt.ErrnoError(10);if(n!==r&&(h=lt.nodePermissions(r,"w")))throw new lt.ErrnoError(h);lt.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(t){throw t}finally{lt.hashAddNode(u)}}},rmdir:t=>{var e=lt.lookupPath(t,{parent:!0}).node,r=ot.basename(t),n=lt.lookupNode(e,r),o=lt.mayDelete(e,r,!0);if(o)throw new lt.ErrnoError(o);if(!e.node_ops.rmdir)throw new lt.ErrnoError(63);if(lt.isMountpoint(n))throw new lt.ErrnoError(10);e.node_ops.rmdir(e,r),lt.destroyNode(n)},readdir:t=>{var e=lt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new lt.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=lt.lookupPath(t,{parent:!0}).node;if(!e)throw new lt.ErrnoError(44);var r=ot.basename(t),n=lt.lookupNode(e,r),o=lt.mayDelete(e,r,!1);if(o)throw new lt.ErrnoError(o);if(!e.node_ops.unlink)throw new lt.ErrnoError(63);if(lt.isMountpoint(n))throw new lt.ErrnoError(10);e.node_ops.unlink(e,r),lt.destroyNode(n)},readlink:t=>{var e=lt.lookupPath(t).node;if(!e)throw new lt.ErrnoError(44);if(!e.node_ops.readlink)throw new lt.ErrnoError(28);return it.resolve(lt.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var r=lt.lookupPath(t,{follow:!e}).node;if(!r)throw new lt.ErrnoError(44);if(!r.node_ops.getattr)throw new lt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>lt.stat(t,!0),chmod:(t,e,r)=>{var n;if(!(n="string"==typeof t?lt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,e)=>{lt.chmod(t,e,!0)},fchmod:(t,e)=>{var r=lt.getStream(t);if(!r)throw new lt.ErrnoError(8);lt.chmod(r.node,e)},chown:(t,e,r,n)=>{var o;if(!(o="string"==typeof t?lt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,e,r)=>{lt.chown(t,e,r,!0)},fchown:(t,e,r)=>{var n=lt.getStream(t);if(!n)throw new lt.ErrnoError(8);lt.chown(n.node,e,r)},truncate:(t,e)=>{if(e<0)throw new lt.ErrnoError(28);var r;if(!(r="string"==typeof t?lt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);if(lt.isDir(r.mode))throw new lt.ErrnoError(31);if(!lt.isFile(r.mode))throw new lt.ErrnoError(28);var n=lt.nodePermissions(r,"w");if(n)throw new lt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var r=lt.getStream(t);if(!r)throw new lt.ErrnoError(8);if(0==(2097155&r.flags))throw new lt.ErrnoError(28);lt.truncate(r.node,e)},utime:(t,e,r)=>{var n=lt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:(t,e,r)=>{if(""===t)throw new lt.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(e="string"==typeof e?lt.modeStringToFlags(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=ot.normalize(t);try{n=lt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new lt.ErrnoError(20)}else n=lt.mknod(t,r,0),o=!0;if(!n)throw new lt.ErrnoError(44);if(lt.isChrdev(n.mode)&&(e&=-513),65536&e&&!lt.isDir(n.mode))throw new lt.ErrnoError(54);if(!o){var a=lt.mayOpen(n,e);if(a)throw new lt.ErrnoError(a)}512&e&&!o&<.truncate(n,0),e&=-131713;var s=lt.createStream({node:n,path:lt.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(lt.readFiles||(lt.readFiles={}),t in lt.readFiles||(lt.readFiles[t]=1)),s},close:t=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{lt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,r)=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new lt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new lt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:(t,e,r,n,o)=>{if(n<0||o<0)throw new lt.ErrnoError(28);if(lt.isClosed(t))throw new lt.ErrnoError(8);if(1==(2097155&t.flags))throw new lt.ErrnoError(8);if(lt.isDir(t.node.mode))throw new lt.ErrnoError(31);if(!t.stream_ops.read)throw new lt.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new lt.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write:(t,e,r,n,o,i)=>{if(n<0||o<0)throw new lt.ErrnoError(28);if(lt.isClosed(t))throw new lt.ErrnoError(8);if(0==(2097155&t.flags))throw new lt.ErrnoError(8);if(lt.isDir(t.node.mode))throw new lt.ErrnoError(31);if(!t.stream_ops.write)throw new lt.ErrnoError(28);t.seekable&&1024&t.flags&<.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new lt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate:(t,e,r)=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);if(e<0||r<=0)throw new lt.ErrnoError(28);if(0==(2097155&t.flags))throw new lt.ErrnoError(8);if(!lt.isFile(t.node.mode)&&!lt.isDir(t.node.mode))throw new lt.ErrnoError(43);if(!t.stream_ops.allocate)throw new lt.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:(t,e,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new lt.ErrnoError(2);if(1==(2097155&t.flags))throw new lt.ErrnoError(2);if(!t.stream_ops.mmap)throw new lt.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl:(t,e,r)=>{if(!t.stream_ops.ioctl)throw new lt.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=lt.open(t,e.flags),o=lt.stat(t).size,i=new Uint8Array(o);return lt.read(n,i,0,o,0),"utf8"===e.encoding?r=j(i,0):"binary"===e.encoding&&(r=i),lt.close(n),r},writeFile:(t,e,r={})=>{r.flags=r.flags||577;var n=lt.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(M(e)+1),i=L(e,o,0,o.length);lt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lt.write(n,e,0,e.byteLength,void 0,r.canOwn)}lt.close(n)},cwd:()=>lt.currentPath,chdir:t=>{var e=lt.lookupPath(t,{follow:!0});if(null===e.node)throw new lt.ErrnoError(44);if(!lt.isDir(e.node.mode))throw new lt.ErrnoError(54);var r=lt.nodePermissions(e.node,"x");if(r)throw new lt.ErrnoError(r);lt.currentPath=e.path},createDefaultDirectories:()=>{lt.mkdir("/tmp"),lt.mkdir("/home"),lt.mkdir("/home/web_user")},createDefaultDevices:()=>{lt.mkdir("/dev"),lt.registerDevice(lt.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),lt.mkdev("/dev/null",lt.makedev(1,3)),at.register(lt.makedev(5,0),at.default_tty_ops),at.register(lt.makedev(6,0),at.default_tty1_ops),lt.mkdev("/dev/tty",lt.makedev(5,0)),lt.mkdev("/dev/tty1",lt.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(y)try{var e=r(6113);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){tt("randomDevice")}}();lt.createDevice("/dev","random",t),lt.createDevice("/dev","urandom",t),lt.mkdir("/dev/shm"),lt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{lt.mkdir("/proc");var t=lt.mkdir("/proc/self");lt.mkdir("/proc/self/fd"),lt.mount({mount:()=>{var e=lt.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var r=+e,n=lt.getStream(r);if(!n)throw new lt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?lt.createDevice("/dev","stdin",i.stdin):lt.symlink("/dev/tty","/dev/stdin"),i.stdout?lt.createDevice("/dev","stdout",null,i.stdout):lt.symlink("/dev/tty","/dev/stdout"),i.stderr?lt.createDevice("/dev","stderr",null,i.stderr):lt.symlink("/dev/tty1","/dev/stderr"),lt.open("/dev/stdin",0),lt.open("/dev/stdout",1),lt.open("/dev/stderr",1)},ensureErrnoError:()=>{lt.ErrnoError||(lt.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},lt.ErrnoError.prototype=new Error,lt.ErrnoError.prototype.constructor=lt.ErrnoError,[44].forEach((t=>{lt.genericErrors[t]=new lt.ErrnoError(t),lt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{lt.ensureErrnoError(),lt.nameTable=new Array(4096),lt.mount(ct,{},"/"),lt.createDefaultDirectories(),lt.createDefaultDevices(),lt.createSpecialDirectories(),lt.filesystems={MEMFS:ct}},init:(t,e,r)=>{lt.init.initialized=!0,lt.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,lt.createStandardStreams()},quit:()=>{lt.init.initialized=!1;for(var t=0;t<lt.streams.length;t++){var e=lt.streams[t];e&<.close(e)}},getMode:(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},findObject:(t,e)=>{var r=lt.analyzePath(t,e);return r.exists?r.object:null},analyzePath:(t,e)=>{try{t=(n=lt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ot.basename(t),n=lt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath:(t,e,r,n)=>{t="string"==typeof t?t:lt.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ot.join2(t,i);try{lt.mkdir(a)}catch(t){}t=a}}return a},createFile:(t,e,r,n,o)=>{var i=ot.join2("string"==typeof t?t:lt.getPath(t),e),a=lt.getMode(n,o);return lt.create(i,a)},createDataFile:(t,e,r,n,o,i)=>{var a=e;t&&(t="string"==typeof t?t:lt.getPath(t),a=e?ot.join2(t,e):t);var s=lt.getMode(n,o),c=lt.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}lt.chmod(c,146|s);var h=lt.open(c,577);lt.write(h,r,0,r.length,0,i),lt.close(h),lt.chmod(c,s)}return c},createDevice:(t,e,r,n)=>{var o=ot.join2("string"==typeof t?t:lt.getPath(t),e),i=lt.getMode(!!r,!!n);lt.createDevice.major||(lt.createDevice.major=64);var a=lt.makedev(lt.createDevice.major++,0);return lt.registerDevice(a,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(t){throw new lt.ErrnoError(29)}if(void 0===c&&0===a)throw new lt.ErrnoError(6);if(null==c)break;a++,e[n+s]=c}return a&&(t.node.timestamp=Date.now()),a},write:(t,e,r,o,i)=>{for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new lt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),lt.mkdev(o,i,a)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=yt(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new lt.ErrnoError(29)}},createLazyFile:(t,e,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):yt(o.responseText||"",!0)})(e,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!_)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=lt.createFile(t,e,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(c.stream_ops).forEach((t=>{var e=c.stream_ops[t];u[t]=function(){return lt.forceLoadFile(c),e.apply(null,arguments)}})),u.read=(t,e,r,n,o)=>(lt.forceLoadFile(c),l(t,e,r,n,o)),u.mmap=(t,e,r,n,o)=>{lt.forceLoadFile(c);var i=st();if(!i)throw new lt.ErrnoError(48);return l(t,C,i,e,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(t,e,r,n,o,i,a,s,c,u)=>{var l=e?it.resolve(ot.join2(t,e)):t;function f(r){function f(r){u&&u(),s||lt.createDataFile(t,e,r,n,o,c),i&&i(),J()}Browser.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),J()}))||f(r)}Q(),"string"==typeof r?ut(r,(t=>f(t)),a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=lt.indexedDB();try{var o=n.open(lt.DB_NAME(),lt.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=()=>{b("creating db"),o.result.createObjectStore(lt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([lt.DB_STORE_NAME],"readwrite"),i=n.objectStore(lt.DB_STORE_NAME),a=0,s=0,c=t.length;function u(){0==s?e():r()}t.forEach((t=>{var e=i.put(lt.analyzePath(t).object.contents,t);e.onsuccess=()=>{++a+s==c&&u()},e.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=lt.indexedDB();try{var o=n.open(lt.DB_NAME(),lt.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([lt.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var a=i.objectStore(lt.DB_STORE_NAME),s=0,c=0,u=t.length;function l(){0==c?e():r()}t.forEach((t=>{var e=a.get(t);e.onsuccess=()=>{lt.analyzePath(t).exists&<.unlink(t),lt.createDataFile(ot.dirname(t),ot.basename(t),e.result,!0,!0,!0),++s+c==u&&l()},e.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r}},ft={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(ot.isAbs(e))return e;var n;if(-100===t)n=lt.cwd();else{var o=lt.getStream(t);if(!o)throw new lt.ErrnoError(8);n=o.path}if(0==e.length){if(!r)throw new lt.ErrnoError(44);return n}return ot.join2(n,e)},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&ot.normalize(e)!==ot.normalize(lt.getPath(t.node)))return-54;throw t}return T[r>>2]=n.dev,T[r+4>>2]=0,T[r+8>>2]=n.ino,T[r+12>>2]=n.mode,T[r+16>>2]=n.nlink,T[r+20>>2]=n.uid,T[r+24>>2]=n.gid,T[r+28>>2]=n.rdev,T[r+32>>2]=0,K=[n.size>>>0,(Y=n.size,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],T[r+40>>2]=K[0],T[r+44>>2]=K[1],T[r+48>>2]=4096,T[r+52>>2]=n.blocks,T[r+56>>2]=n.atime.getTime()/1e3|0,T[r+60>>2]=0,T[r+64>>2]=n.mtime.getTime()/1e3|0,T[r+68>>2]=0,T[r+72>>2]=n.ctime.getTime()/1e3|0,T[r+76>>2]=0,K=[n.ino>>>0,(Y=n.ino,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],T[r+80>>2]=K[0],T[r+84>>2]=K[1],0},doMsync:function(t,e,r,n,o){var i=F.slice(t,t+r);lt.msync(e,i,o,r,n)},varargs:void 0,get:function(){return ft.varargs+=4,T[ft.varargs-4>>2]},getStr:function(t){return I(t)},getStreamFromFD:function(t){var e=lt.getStream(t);if(!e)throw new lt.ErrnoError(8);return e}};function ht(t){try{return k.grow(t-A.byteLength+65535>>>16),B(k.buffer),1}catch(t){}}var pt={};function dt(){if(!dt.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var e in pt)void 0===pt[e]?delete t[e]:t[e]=pt[e];var r=[];for(var e in t)r.push(e+"="+t[e]);dt.strings=r}return dt.strings}var mt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=lt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},vt=365,_t=146;function yt(t,e,r){var n=r>0?r:M(t)+1,o=new Array(n),i=L(t,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(mt.prototype,{read:{get:function(){return(this.mode&vt)===vt},set:function(t){t?this.mode|=vt:this.mode&=-366}},write:{get:function(){return(this.mode&_t)===_t},set:function(t){t?this.mode|=_t:this.mode&=-147}},isFolder:{get:function(){return lt.isDir(this.mode)}},isDevice:{get:function(){return lt.isChrdev(this.mode)}}}),lt.FSNode=mt,lt.staticInit();var gt,wt={b:function(t,e,r,n){tt("Assertion failed: "+I(t)+", at: "+[e?I(e):"unknown filename",r,n?I(n):"unknown function"])},k:function(t,e){try{return t=ft.getStr(t),lt.chmod(t,e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},D:function(t){try{var e=ft.getStreamFromFD(t);return lt.createStream(e,0).fd}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},E:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e),-8&r)return-28;var o=lt.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&<.nodePermissions(o,i)?-2:0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},B:function(t,e){try{return lt.fchmod(t,e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},d:function(t,e,r){ft.varargs=r;try{var n=ft.getStreamFromFD(t);switch(e){case 0:return(o=ft.get())<0?-28:lt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ft.get();return n.flags|=o,0;case 5:return o=ft.get(),P[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,T[bt()>>2]=i,-1}}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}var i},z:function(t,e){try{var r=ft.getStreamFromFD(t);return ft.doStat(lt.stat,r.path,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},v:function(t,e){try{if(0===e)return-28;var r=lt.cwd(),n=M(r)+1;return e<n?-68:(N(r,t,e),n)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},l:function(t,e,r){ft.varargs=r;try{var n=ft.getStreamFromFD(t);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=ft.get();return T[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=ft.get(),lt.ioctl(n,e,o);default:tt("bad ioctl syscall "+e)}}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},x:function(t,e){try{return t=ft.getStr(t),ft.doStat(lt.lstat,t,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},u:function(t,e,r){try{return e=ft.getStr(e),e=ft.calculateAt(t,e),"/"===(e=ot.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),lt.mkdir(e,r,0),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},w:function(t,e,r,n){try{e=ft.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=ft.calculateAt(t,e,i),ft.doStat(o?lt.lstat:lt.stat,e,r)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},i:function(t,e,r,n){ft.varargs=n;try{e=ft.getStr(e),e=ft.calculateAt(t,e);var o=n?ft.get():0;return lt.open(e,r,o).fd}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},t:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e),n<=0)return-28;var o=lt.readlink(e),i=Math.min(n,M(o)),a=C[r+i];return N(o,r,n+1),C[r+i]=a,i}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},s:function(t){try{return t=ft.getStr(t),lt.rmdir(t),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},y:function(t,e){try{return t=ft.getStr(t),ft.doStat(lt.stat,t,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},r:function(t,e,r){try{return e=ft.getStr(e),e=ft.calculateAt(t,e),0===r?lt.unlink(e):512===r?lt.rmdir(e):tt("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},q:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e,!0),r){var o=T[r>>2],i=T[r+4>>2];a=1e3*o+i/1e6,s=1e3*(o=T[(r+=8)>>2])+(i=T[r+4>>2])/1e6}else var a=Date.now(),s=a;return lt.utime(e,a,s),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){tt("")},A:function(t,e,r){F.copyWithin(t,e,e+r)},e:function(t){var e,r,n=F.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),ht(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},m:function(t,e){var r=0;return dt().forEach((function(n,o){var i=e+r;O[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)C[e++>>0]=t.charCodeAt(n);r||(C[e>>0]=0)}(n,i),r+=n.length+1})),0},o:function(t,e){var r=dt();O[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),O[e>>2]=n,0},f:function(t){At(t)},c:function(t){try{var e=ft.getStreamFromFD(t);return lt.close(e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},p:function(t,e){try{var r=ft.getStreamFromFD(t),n=r.tty?2:lt.isDir(r.mode)?3:lt.isLink(r.mode)?7:4;return C[e>>0]=n,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},h:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=O[e>>2],s=O[e+4>>2];e+=8;var c=lt.read(t,C,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}(ft.getStreamFromFD(t),e,r);return T[n>>2]=o,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},n:function(t,e,r,n,o){try{var i=(c=r)+2097152>>>0<4194305-!!(s=e)?(s>>>0)+4294967296*c:NaN;if(isNaN(i))return 61;var a=ft.getStreamFromFD(t);return lt.llseek(a,i,n),K=[a.position>>>0,(Y=a.position,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],T[o>>2]=K[0],T[o+4>>2]=K[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}var s,c},g:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=O[e>>2],s=O[e+4>>2];e+=8;var c=lt.write(t,C,a,s,n);if(c<0)return-1;o+=c}return o}(ft.getStreamFromFD(t),e,r);return O[n>>2]=o,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},F:function(t){Ct(t)}},bt=(function(){var t={a:wt};function e(t,e){var r,n=t.exports;i.asm=n,B((k=i.asm.G).buffer),i.asm.K,r=i.asm.H,z.unshift(r),J()}function r(t){e(t.instance)}function n(e){return(w||!v&&!_||"function"!=typeof fetch?Promise.resolve().then((function(){return rt(q)})):fetch(q,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+q+"'";return t.arrayBuffer()})).catch((function(){return rt(q)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){E("failed to asynchronously prepare wasm: "+t),tt(t)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){return E("Module.instantiateWasm callback failed with error: "+t),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||et(q)||y||"function"!=typeof fetch?n(r):fetch(q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return E("wasm streaming compile failed: "+t),E("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.H).apply(null,arguments)},i._main=function(){return(i._main=i.asm.I).apply(null,arguments)},i.___errno_location=function(){return(bt=i.___errno_location=i.asm.J).apply(null,arguments)}),Et=i.stackAlloc=function(){return(Et=i.stackAlloc=i.asm.L).apply(null,arguments)};function kt(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function St(t){var e=i._main;(t=t||[]).unshift(d);var r=t.length,n=Et(4*(r+1)),o=n>>2;t.forEach((t=>{T[o++]=function(t){var e=M(t)+1,r=Et(e);return L(t,C,r,e),r}(t)})),T[o]=0;try{var a=e(r,n);return At(a),a}catch(t){return function(t){if(t instanceof kt||"unwind"==t)return x;m(1,t)}(t)}}function xt(t){function r(){gt||(gt=!0,i.calledRun=!0,R||(i.noFSInit||lt.init.initialized||lt.init(),lt.ignorePermissions=!1,at.init(),nt(z),nt(H),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ft&&St(t),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),G.unshift(t);var t;nt(G)}()))}t=t||p,$>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),U.unshift(t);var t;nt(U)}(),$>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function At(t,e){x=t,Ct(t)}function Ct(t){x=t,V()||(i.onExit&&i.onExit(t),R=!0),m(t,new kt(t))}if(i.FS=lt,Z=function t(){gt||xt(),gt||(Z=t)},i.run=xt,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ft=!0;return i.noInitialRun&&(Ft=!1),xt(),t.ready});t.exports=o},7757:(t,e,r)=>{t.exports=r(5666)},382:(t,e,r)=>{if("undefined"!=typeof SHARED_CONFIG)r.p=SHARED_CONFIG.url_base.cdn+"/";else{var n=r(1017).resolve;r.p=n(__dirname)+"/"}},9846:t=>{"use strict";t.exports=function(t){var e=t._SomePromiseArray;function r(t){var r=new e(t),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}t.any=function(t){return r(t)},t.prototype.any=function(){return r(this)}}},4601:(t,e,r)=>{"use strict";var n;try{throw new Error}catch(t){n=t}var o=r(679),i=r(7824);function a(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=o}function s(t){for(;t.length()>0;)c(t)}function c(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}a.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},a.prototype.hasCustomScheduler=function(){return this._customScheduler},a.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},a.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},a.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout((function(){t(e)}),0);else try{this._schedule((function(){t(e)}))}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.prototype.invokeLater=function(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()},a.prototype.invoke=function(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()},a.prototype.settlePromises=function(t){this._normalQueue._pushOne(t),this._queueTick()},a.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},a.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},a.prototype._reset=function(){this._isTickUsed=!1},t.exports=a,t.exports.firstLineError=n},3635:t=>{"use strict";t.exports=function(t,e,r,n){var o=!1,i=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var u=r(i),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(u),u instanceof t){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:u};f._then(e,a,void 0,l,h),u._then(s,c,void 0,l,h),l._setOnCancel(u)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},3786:(t,e,r)=>{"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var o=r(7502)();o.noConflict=function(){try{Promise===o&&(Promise=n)}catch(t){}return o},t.exports=o},2293:(t,e,r)=>{"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}t.exports=function(t){var e,n,a=r(5942),s=a.canEvaluate,c=a.isIdentifier,u=function(t){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,t))(h)},l=function(t){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",t))},f=function(t,e,r){var n=r[t];if("function"!=typeof n){if(!c(t))return null;if(n=e(t),r[t]=n,r[" size"]++,r[" size"]>512){for(var o=Object.keys(r),i=0;i<256;++i)delete r[o[i]];r[" size"]=o.length-256}}return n};function h(e,r){var n;if(null!=e&&(n=e[r]),"function"!=typeof n){var o="Object "+a.classString(e)+" has no method '"+a.toString(r)+"'";throw new t.TypeError(o)}return n}function p(t){return h(t,this.pop()).apply(t,this)}function d(t){return t[this]}function m(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e=function(t){return f(t,u,o)},n=function(t){return f(t,l,i)},t.prototype.call=function(t){for(var r=arguments.length,n=new Array(Math.max(r-1,0)),o=1;o<r;++o)n[o-1]=arguments[o];if(s){var i=e(t);if(null!==i)return this._then(i,void 0,void 0,n,void 0)}return n.push(t),this._then(p,void 0,void 0,n,void 0)},t.prototype.get=function(t){var e;if("number"==typeof t)e=m;else if(s){var r=n(t);e=null!==r?r:d}else e=d;return this._then(e,void 0,void 0,t,void 0)}}},1735:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i=r(5942),a=i.tryCatch,s=i.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var r=0;r<t.length;++r)this._doInvokeOnCancel(t[r],e);else if(void 0!==t)if("function"==typeof t){if(!e){var n=a(t).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),c.throwLater(n.e))}}else t._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},9976:(t,e,r)=>{"use strict";t.exports=function(t){var e=r(5942),n=r(9571).keys,o=e.tryCatch,i=e.errorObj;return function(r,a,s){return function(c){var u=s._boundValue();t:for(var l=0;l<r.length;++l){var f=r[l];if(f===Error||null!=f&&f.prototype instanceof Error){if(c instanceof f)return o(a).call(u,c)}else if("function"==typeof f){var h=o(f).call(u,c);if(h===i)return h;if(h)return o(a).call(u,c)}else if(e.isObject(c)){for(var p=n(f),d=0;d<p.length;++d){var m=p[d];if(f[m]!=c[m])continue t}return o(a).call(u,c)}}return t}}}},5910:t=>{"use strict";t.exports=function(t){var e=!1,r=[];function n(){this._trace=new n.CapturedTrace(o())}function o(){var t=r.length-1;if(t>=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=o,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},461:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i,a,s,c,u=t._async,l=r(7621).Warning,f=r(5942),h=r(9571),p=f.canAttachTrace,d=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,m=/\((?:timers\.js):\d+:\d+\)/,v=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,_=null,y=null,g=!1,w=!(0==f.env("BLUEBIRD_DEBUG")||!f.env("BLUEBIRD_DEBUG")&&"development"!==f.env("NODE_ENV")),b=!(0==f.env("BLUEBIRD_WARNINGS")||!w&&!f.env("BLUEBIRD_WARNINGS")),E=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!w&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),k=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function r(){for(var t=0;t<e.length;++t)e[t]._notifyUnhandledRejection();n()}function n(){e.length=0}c=function(t){e.push(t),setTimeout(r,1)},h.defineProperty(t,"_unhandledRejectionCheck",{value:r}),h.defineProperty(t,"_unhandledRejectionClear",{value:n})}(),t.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),c(this))},t.prototype._notifyUnhandledRejectionIsHandled=function(){Y("rejectionHandled",i,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),Y("unhandledRejection",a,t,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(t,e,r){return G(t,e,r||this)},t.onPossiblyUnhandledRejection=function(e){var r=t._getContext();a=f.contextBind(r,e)},t.onUnhandledRejectionHandled=function(e){var r=t._getContext();i=f.contextBind(r,e)};var S=function(){};t.longStackTraces=function(){if(u.haveItemsQueued()&&!et.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!et.longStackTraces&&$()){var r=t.prototype._captureStackTrace,n=t.prototype._attachExtraTrace,o=t.prototype._dereferenceTrace;et.longStackTraces=!0,S=function(){if(u.haveItemsQueued()&&!et.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=r,t.prototype._attachExtraTrace=n,t.prototype._dereferenceTrace=o,e.deactivateLongStackTraces(),et.longStackTraces=!1},t.prototype._captureStackTrace=U,t.prototype._attachExtraTrace=z,t.prototype._dereferenceTrace=H,e.activateLongStackTraces()}},t.hasLongStackTraces=function(){return et.longStackTraces&&$()};var x={unhandledrejection:{before:function(){var t=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,t},after:function(t){f.global.onunhandledrejection=t}},rejectionhandled:{before:function(){var t=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,t},after:function(t){f.global.onrejectionhandled=t}}},A=function(){var t=function(t,e){if(!t)return!f.global.dispatchEvent(e);var r;try{return r=t.before(),!f.global.dispatchEvent(e)}finally{t.after(r)}};try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return f.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=new CustomEvent(e,{detail:r,cancelable:!0});return h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),t(x[e],n)}}if("function"==typeof Event){e=new Event("CustomEvent");return f.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=new Event(e,{cancelable:!0});return n.detail=r,h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),t(x[e],n)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!0,r),t(x[e],n)}}catch(t){}return function(){return!1}}(),C=f.isNode?function(){return process.emit.apply(process,arguments)}:f.global?function(t){var e="on"+t.toLowerCase(),r=f.global[e];return!!r&&(r.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function F(t,e){return{promise:e}}var P={promiseCreated:F,promiseFulfilled:F,promiseRejected:F,promiseResolved:F,promiseCancelled:F,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:F},T=function(t){var e=!1;try{e=C.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var r=!1;try{r=A(t,P[t].apply(null,arguments))}catch(t){u.throwLater(t),r=!0}return r||e};function O(){return!1}function R(t,e,r){var n=this;try{t(e,r,(function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+f.toString(t));n._attachCancellationCallback(t)}))}catch(t){return t}}function D(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?f.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function j(){return this._onCancelField}function I(t){this._onCancelField=t}function L(){this._cancellationParent=void 0,this._onCancelField=void 0}function N(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&S()),"warnings"in e){var r=e.warnings;et.warnings=!!r,k=et.warnings,f.isObject(r)&&"wForgottenReturn"in r&&(k=!!r.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!et.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=L,t.prototype._propagateFrom=N,t.prototype._onCancel=j,t.prototype._setOnCancel=I,t.prototype._attachCancellationCallback=D,t.prototype._execute=R,M=N,et.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!et.monitoring?(et.monitoring=!0,t.prototype._fireEvent=T):!e.monitoring&&et.monitoring&&(et.monitoring=!1,t.prototype._fireEvent=O)),"asyncHooks"in e&&f.nodeSupportsAsyncResource){var i=et.asyncHooks,a=!!e.asyncHooks;i!==a&&(et.asyncHooks=a,a?n():o())}return t},t.prototype._fireEvent=O,t.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(t){},t.prototype._attachCancellationCallback=function(t){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(t,e){};var M=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function B(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function U(){this._trace=new J(this._peekContext())}function z(t,e){if(p(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=q(t);f.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),f.notEnumerableProp(t,"__stackCleaned__",!0)}}}function H(){this._trace=void 0}function G(e,r,n){if(et.warnings){var o,i=new l(e);if(r)n._attachExtraTrace(i);else if(et.longStackTraces&&(o=t._peekContext()))o.attachExtraTrace(i);else{var a=q(i);i.stack=a.message+"\n"+a.stack.join("\n")}T("warning",i)||W(i,"",!0)}}function V(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],o=" (No stack trace)"===n||_.test(n),i=o&&X(n);o&&!i&&(g&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function q(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:V(e)}}function W(t,e,r){if("undefined"!=typeof console){var n;if(f.isObject(t)){var o=t.stack;n=e+y(o,t)}else n=e+String(t);"function"==typeof s?s(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function Y(t,e,r,n){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){u.throwLater(t)}"unhandledRejection"===t?T(t,r,n)||o||W(r,"Unhandled rejection "):T(t,n)}function K(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():f.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){var e=41;if(t.length<e)return t;return t.substr(0,e-3)+"..."}(e)+">, no stack trace)"}function $(){return"function"==typeof tt}var X=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Q(t){var e=t.match(Z);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function J(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);tt(this,J),e>32&&this.uncycle()}f.inherits(J,Error),e.CapturedTrace=J,J.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,o=this;void 0!==o;++n)e.push(o),o=o._parent;for(n=(t=this._length=n)-1;n>=0;--n){var i=e[n].stack;void 0===r[i]&&(r[i]=n)}for(n=0;n<t;++n){var a=r[e[n].stack];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a<t-1?(s._parent=e[a+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var c=s._length+1,u=n-2;u>=0;--u)e[u]._length=c,c++;return}}}},J.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=q(t),r=e.message,n=[e.stack],o=this;void 0!==o;)n.push(V(o.stack.split("\n"))),o=o._parent;!function(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],o=e.length-1,i=e[o],a=-1,s=n.length-1;s>=0;--s)if(n[s]===i){a=s;break}for(s=a;s>=0;--s){var c=n[s];if(e[o]!==c)break;e.pop(),o--}e=n}}(n),function(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}(n),f.notEnumerableProp(t,"stack",function(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}(r,n)),f.notEnumerableProp(t,"__stackCleaned__",!0)}};var tt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():K(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,_=t,y=e;var r=Error.captureStackTrace;return X=function(t){return d.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n,o=new Error;if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,y=e,g=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return!("stack"in o)&&n&&"number"==typeof Error.stackTraceLimit?(_=t,y=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6}):(y=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?K(e):e.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(s=function(t){console.warn(t)},f.isNode&&process.stderr.isTTY?s=function(t,e){var r=e?"[33m":"[31m";console.warn(r+t+"[0m\n")}:f.isNode||"string"!=typeof(new Error).stack||(s=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var et={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&t.longStackTraces(),{asyncHooks:function(){return et.asyncHooks},longStackTraces:function(){return et.longStackTraces},warnings:function(){return et.warnings},cancellation:function(){return et.cancellation},monitoring:function(){return et.monitoring},propagateFromFunction:function(){return M},boundValueFunction:function(){return B},checkForgottenReturns:function(t,e,r,n,o){if(void 0===t&&null!==e&&k){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),c=V(s),u=c.length-1;u>=0;--u){var l=c[u];if(!m.test(l)){var f=l.match(v);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(c.length>0){var h=c[0];for(u=0;u<s.length;++u)if(s[u]===h){u>0&&(a="\n"+s[u-1]);break}}}var p="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,e)}},setBounds:function(t,e){if($()){for(var r,n,o=(t.stack||"").split("\n"),i=(e.stack||"").split("\n"),a=-1,s=-1,c=0;c<o.length;++c){if(u=Q(o[c])){r=u.fileName,a=u.line;break}}for(c=0;c<i.length;++c){var u;if(u=Q(i[c])){n=u.fileName,s=u.line;break}}a<0||s<0||!r||!n||r!==n||a>=s||(X=function(t){if(d.test(t))return!0;var e=Q(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:G,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),G(r)},CapturedTrace:J,fireDomEvent:A,fireGlobalEvent:C}}},5632:t=>{"use strict";t.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(r,o)}}},6574:t=>{"use strict";t.exports=function(t,e){var r=t.reduce,n=t.all;function o(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(o,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(o,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},7621:(t,e,r)=>{"use strict";var n,o,i=r(9571),a=i.freeze,s=r(5942),c=s.inherits,u=s.notEnumerableProp;function l(t,e){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:e),u(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var f=l("Warning","warning"),h=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{n=TypeError,o=RangeError}catch(t){n=l("TypeError","type error"),o=l("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v<m.length;++v)"function"==typeof Array.prototype[m[v]]&&(d.prototype[m[v]]=Array.prototype[m[v]]);i.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var _=0;function y(t){if(!(this instanceof y))return new y(t);u(this,"name","OperationalError"),u(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(u(this,"message",t.message),u(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var t=Array(4*_+1).join(" "),e="\n"+t+"AggregateError of:\n";_++,t=Array(4*_+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",o=n.split("\n"),i=0;i<o.length;++i)o[i]=t+o[i];e+=(n=o.join("\n"))+"\n"}return _--,e},c(y,Error);var g=Error.__BluebirdErrorTypes__;g||(g=a({CancellationError:h,TimeoutError:p,OperationalError:y,RejectionError:y,AggregateError:d}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:g,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error,TypeError:n,RangeError:o,CancellationError:g.CancellationError,OperationalError:g.OperationalError,TimeoutError:g.TimeoutError,AggregateError:g.AggregateError,Warning:f}},9571:t=>{var e=function(){"use strict";return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var r={}.hasOwnProperty,n={}.toString,o={}.constructor.prototype,i=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e};t.exports={isArray:function(t){try{return"[object Array]"===n.call(t)}catch(t){return!1}},keys:i,names:i,defineProperty:function(t,e,r){return t[e]=r.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return o}},isES5:e,propertyIsWritable:function(){return!0}}}},6777:t=>{"use strict";t.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,o){return r(t,n,o,e)}}},7707:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(5942),i=t.CancellationError,a=o.errorObj,s=r(9976)(n);function c(t,e,r){this.promise=t,this.type=e,this.handler=r,this.called=!1,this.cancelPromise=null}function u(t){this.finallyHandler=t}function l(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(t){if(!l(this,t))return a.e=t,a}function p(r){var o=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(o._boundValue()):s.call(o._boundValue(),r);if(c===n)return c;if(void 0!==c){o._setReturnedNonUndefined();var p=e(c,o);if(p instanceof t){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new i("late cancellation observer");return o._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new u(this))}return p._then(f,h,void 0,this,void 0)}}}return o.isRejected()?(l(this),a.e=r,a):(l(this),r)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new c(this,e,t),void 0)},t.prototype.lastly=t.prototype.finally=function(t){return this._passThrough(t,0,p,p)},t.prototype.tap=function(t){return this._passThrough(t,1,p)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,p);var n,i=new Array(r-1),a=0;for(n=0;n<r-1;++n){var c=arguments[n];if(!o.isObject(c))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+o.classString(c)));i[a++]=c}i.length=a;var u=arguments[n];return this._passThrough(s(i,u,this),1,void 0,p)},c}},687:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(7621).TypeError,c=r(5942),u=c.errorObj,l=c.tryCatch,f=[];function h(e,r,o,i){if(a.cancellation()){var s=new t(n),c=this._finallyPromise=new t(n);this._promise=s.lastly((function(){return c})),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new t(n))._captureStackTrace()}this._stack=i,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(h,i),h.prototype._isResolved=function(){return null===this._promise},h.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},h.prototype._promiseCancelled=function(){if(!this._isResolved()){var e;if(void 0!==this._generator.return)this._promise._pushContext(),e=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},h.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=l(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},h.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=l(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},h.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},h.prototype.promise=function(){return this._promise},h.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},h.prototype._continue=function(e){var r=this._promise;if(e===u)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(e.e,!1);var n=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var i=o(n,this._promise);if(i instanceof t||(i=function(e,r,n){for(var i=0;i<r.length;++i){n._pushContext();var a=l(r[i])(e);if(n._popContext(),a===u){n._pushContext();var s=t.reject(u.e);return n._popContext(),s}var c=o(a,n);if(c instanceof t)return c}return null}(i,this._yieldHandlers,this._promise),null!==i)){var a=(i=i._target())._bitField;0==(50397184&a)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&a)?t._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?t._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},t.coroutine=function(t,e){if("function"!=typeof t)throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(e).yieldHandler,n=h,o=(new Error).stack;return function(){var e=t.apply(this,arguments),i=new n(void 0,void 0,r,o),a=i.promise();return i._generator=e,i._promiseFulfilled(void 0),a}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new s("expecting a function but got "+c.classString(t));f.push(t)},t.spawn=function(r){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof r)return e("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new h(r,this),o=n.promise();return n._run(t.spawn),o}}},7717:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a,s=r(5942),c=s.canEvaluate,u=s.tryCatch,l=s.errorObj;if(c){for(var f=function(t){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,t))},h=function(t){return new Function("promise","holder"," \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g,t))},p=function(e){for(var r=new Array(e),n=0;n<r.length;++n)r[n]="this.p"+(n+1);var o=r.join(" = ")+" = null;",a="var promise;\n"+r.map((function(t){return" \n promise = "+t+"; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "})).join("\n"),s=r.join(", "),c="Holder$"+e,f="return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n ";return f=f.replace(/\[TheName\]/g,c).replace(/\[TheTotal\]/g,e).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,o).replace(/\[CancellationCode\]/g,a),new Function("tryCatch","errorObj","Promise","async",f)(u,l,t,i)},d=[],m=[],v=[],_=0;_<8;++_)d.push(p(_+1)),m.push(f(_+1)),v.push(h(_+1));a=function(t){this._reject(t)}}t.join=function(){var r,i=arguments.length-1;if(i>0&&"function"==typeof arguments[i]&&(r=arguments[i],i<=8&&c)){(E=new t(o))._captureStackTrace();for(var u=d[i-1],l=new u(r),f=m,h=0;h<i;++h){var p=n(arguments[h],E);if(p instanceof t){var _=(p=p._target())._bitField;0==(50397184&_)?(p._then(f[h],a,void 0,E,l),v[h](p,l),l.asyncNeeded=!1):0!=(33554432&_)?f[h].call(E,p._value(),l):0!=(16777216&_)?E._reject(p._reason()):E._cancel()}else f[h].call(E,p,l)}if(!E._isFateSealed()){if(l.asyncNeeded){var y=t._getContext();l.fn=s.contextBind(y,l.fn)}E._setAsyncGuaranteed(),E._setOnCancel(l)}return E}for(var g=arguments.length,w=new Array(g),b=0;b<g;++b)w[b]=arguments[b];r&&w.pop();var E=new e(w).promise();return void 0!==r?E.spread(r):E}}},6343:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(5942),c=s.tryCatch,u=s.errorObj,l=t._async;function f(e,r,n,o){this.constructor$(e),this._promise._captureStackTrace();var a=t._getContext();if(this._callback=s.contextBind(a,r),this._preservedValues=o===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],l.invoke(this._asyncInit,this,void 0),s.isArray(e))for(var c=0;c<e.length;++c){var u=e[c];u instanceof t&&u.suppressUnhandledRejections()}}function h(e,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+s.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return t.reject(new TypeError("options argument must be an object but it is "+s.classString(o)));if("number"!=typeof o.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+s.classString(o.concurrency)));a=o.concurrency}return new f(e,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,i).promise()}s.inherits(f,e),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(e,r){var n=this._values,i=this.length(),s=this._preservedValues,l=this._limit;if(r<0){if(n[r=-1*r-1]=e,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=c(h).call(p,e,r,i),m=f._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",f),d===u)return this._reject(d.e),!0;var v=o(d,this._promise);if(v instanceof t){var _=(v=v._target())._bitField;if(0==(50397184&_))return l>=1&&this._inFlight++,n[r]=v,v._proxy(this,-1*(r+1)),!1;if(0==(33554432&_))return 0!=(16777216&_)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}n[r]=d}return++this._totalResolved>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},f.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},f.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),o=0,i=0;i<r;++i)t[i]&&(n[o++]=e[i]);n.length=o,this._resolve(n)},f.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return h(this,t,e,null)},t.map=function(t,e,r,n){return h(t,e,r,n)}}},6926:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a=r(5942),s=a.tryCatch;t.method=function(r){if("function"!=typeof r)throw new t.TypeError("expecting a function but got "+a.classString(r));return function(){var n=new t(e);n._captureStackTrace(),n._pushContext();var o=s(r).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(o,a,"Promise.method",n),n._resolveFromSyncValue(o),n}},t.attempt=t.try=function(r){if("function"!=typeof r)return o("expecting a function but got "+a.classString(r));var n,c=new t(e);if(c._captureStackTrace(),c._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];n=a.isArray(u)?s(r).apply(l,u):s(r).call(l,u)}else n=s(r)();var f=c._popContext();return i.checkForgottenReturns(n,f,"Promise.try",c),c._resolveFromSyncValue(n),c},t.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},1776:(t,e,r)=>{"use strict";var n=r(5942),o=n.maybeWrapAsError,i=r(7621).OperationalError,a=r(9571);var s=/^(?:name|message|stack|cause)$/;function c(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new i(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),o=0;o<r.length;++o){var c=r[o];s.test(c)||(e[c]=t[c])}return e}return n.markAsOriginatingFromRejection(t),t}t.exports=function(t,e){return function(r,n){if(null!==t){if(r){var i=c(o(r));t._attachExtraTrace(i),t._reject(i)}else if(e){for(var a=arguments.length,s=new Array(Math.max(a-1,0)),u=1;u<a;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(n);t=null}}}},1941:(t,e,r)=>{"use strict";t.exports=function(t){var e=r(5942),n=t._async,o=e.tryCatch,i=e.errorObj;function a(t,r){if(!e.isArray(t))return s.call(this,t,r);var a=o(r).apply(this._boundValue(),[null].concat(t));a===i&&n.throwLater(a.e)}function s(t,e){var r=this._boundValue(),a=void 0===t?o(e).call(r,null):o(e).call(r,null,t);a===i&&n.throwLater(a.e)}function c(t,e){if(!t){var r=new Error(t+"");r.cause=t,t=r}var a=o(e).call(this._boundValue(),t);a===i&&n.throwLater(a.e)}t.prototype.asCallback=t.prototype.nodeify=function(t,e){if("function"==typeof t){var r=s;void 0!==e&&Object(e).spread&&(r=a),this._then(r,c,void 0,this,t)}return this}}},7502:(t,e,r)=>{"use strict";t.exports=function(){var e=function(){return new _("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new R.PromiseInspection(this._target())},o=function(t){return R.reject(new _(t))};function i(){}var a={},s=r(5942);s.setReflectHandler(n);var c=function(){var t=process.domain;return void 0===t?null:t},u=function(){return{domain:c(),async:null}},l=s.isNode&&s.nodeSupportsAsyncResource?r(852).AsyncResource:null,f=function(){return{domain:c(),async:new l("Bluebird::Promise")}},h=s.isNode?u:function(){return null};s.notEnumerableProp(R,"_getContext",h);var p=r(9571),d=r(4601),m=new d;p.defineProperty(R,"_async",{value:m});var v=r(7621),_=R.TypeError=v.TypeError;R.RangeError=v.RangeError;var y=R.CancellationError=v.CancellationError;R.TimeoutError=v.TimeoutError,R.OperationalError=v.OperationalError,R.RejectionError=v.OperationalError,R.AggregateError=v.AggregateError;var g=function(){},w={},b={},E=r(1778)(R,g),k=r(1640)(R,g,E,o,i),S=r(5910)(R),x=S.create,A=r(461)(R,S,(function(){h=f,s.notEnumerableProp(R,"_getContext",f)}),(function(){h=u,s.notEnumerableProp(R,"_getContext",u)})),C=(A.CapturedTrace,r(7707)(R,E,b)),F=r(9976)(b),P=r(1776),T=s.errorObj,O=s.tryCatch;function R(t){t!==g&&function(t,e){if(null==t||t.constructor!==R)throw new _("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new _("expecting a function but got "+s.classString(e))}(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function D(t){this.promise._resolveCallback(t)}function j(t){this.promise._rejectCallback(t,!1)}function I(t){var e=new R(g);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}return R.prototype.toString=function(){return"[object Promise]"},R.prototype.caught=R.prototype.catch=function(t){var e=arguments.length;if(e>1){var r,n=new Array(e-1),i=0;for(r=0;r<e-1;++r){var a=arguments[r];if(!s.isObject(a))return o("Catch statement predicate: expecting an object but got "+s.classString(a));n[i++]=a}if(n.length=i,"function"!=typeof(t=arguments[r]))throw new _("The last argument to .catch() must be a function, got "+s.toString(t));return this.then(void 0,F(n,t,this))}return this.then(void 0,t)},R.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},R.prototype.then=function(t,e){if(A.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(r+=", "+s.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},R.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},R.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+s.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},R.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},R.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new k(this).promise()},R.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},R.getNewLibraryCopy=t.exports,R.is=function(t){return t instanceof R},R.fromNode=R.fromCallback=function(t){var e=new R(g);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=O(t)(P(e,r));return n===T&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},R.all=function(t){return new k(t).promise()},R.cast=function(t){var e=E(t);return e instanceof R||((e=new R(g))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},R.resolve=R.fulfilled=R.cast,R.reject=R.rejected=function(t){var e=new R(g);return e._captureStackTrace(),e._rejectCallback(t,!0),e},R.setScheduler=function(t){if("function"!=typeof t)throw new _("expecting a function but got "+s.classString(t));return m.setScheduler(t)},R.prototype._then=function(t,e,r,n,o){var i=void 0!==o,a=i?o:new R(g),c=this._target(),u=c._bitField;i||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&u)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var l=h();if(0!=(50397184&u)){var f,p,d=c._settlePromiseCtx;0!=(33554432&u)?(p=c._rejectionHandler0,f=t):0!=(16777216&u)?(p=c._fulfillmentHandler0,f=e,c._unsetRejectionIsUnhandled()):(d=c._settlePromiseLateCancellationObserver,p=new y("late cancellation observer"),c._attachExtraTrace(p),f=e),m.invoke(d,c,{handler:s.contextBind(l,f),promise:a,receiver:n,value:p})}else c._addCallbacks(t,e,a,n,l);return a},R.prototype._length=function(){return 65535&this._bitField},R.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},R.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},R.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},R.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},R.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},R.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},R.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},R.prototype._isFinal=function(){return(4194304&this._bitField)>0},R.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},R.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},R.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},R.prototype._setAsyncGuaranteed=function(){if(!m.hasCustomScheduler()){var t=this._bitField;this._bitField=t|(536870912&t)>>2^134217728}},R.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},R.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==a)return void 0===e&&this._isBound()?this._boundValue():e},R.prototype._promiseAt=function(t){return this[4*t-4+2]},R.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},R.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},R.prototype._boundValue=function(){},R.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,o=t._receiverAt(0);void 0===o&&(o=a),this._addCallbacks(e,r,n,o,null)},R.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=a),this._addCallbacks(r,n,o,i,null)},R.prototype._addCallbacks=function(t,e,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=s.contextBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=s.contextBind(o,e));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=s.contextBind(o,t)),"function"==typeof e&&(this[a+1]=s.contextBind(o,e))}return this._setLength(i+1),i},R.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},R.prototype._resolveCallback=function(t,r){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(e(),!1);var n=E(t,this);if(!(n instanceof R))return this._fulfill(t);r&&this._propagateFrom(n,2);var o=n._target();if(o!==this){var i=o._bitField;if(0==(50397184&i)){var a=this._length();a>0&&o._migrateCallback0(this);for(var s=1;s<a;++s)o._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!=(33554432&i))this._fulfill(o._value());else if(0!=(16777216&i))this._reject(o._reason());else{var c=new y("late cancellation observer");o._attachExtraTrace(c),this._reject(c)}}else this._reject(e())}},R.prototype._rejectCallback=function(t,e,r){var n=s.ensureErrorObject(t),o=n===t;if(!o&&!r&&A.warnings()){var i="a promise was rejected with a non-error: "+s.classString(t);this._warn(i,!0)}this._attachExtraTrace(n,!!e&&o),this._reject(t)},R.prototype._resolveFromExecutor=function(t){if(t!==g){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(t,(function(t){e._resolveCallback(t)}),(function(t){e._rejectCallback(t,r)}));r=!1,this._popContext(),void 0!==n&&e._rejectCallback(n,!0)}},R.prototype._settlePromiseFromHandler=function(t,e,r,n){var o=n._bitField;if(0==(65536&o)){var i;n._pushContext(),e===w?r&&"number"==typeof r.length?i=O(t).apply(this._boundValue(),r):(i=T).e=new _("cannot .spread() a non-array: "+s.classString(r)):i=O(t).call(e,r);var a=n._popContext();0==(65536&(o=n._bitField))&&(i===b?n._reject(r):i===T?n._rejectCallback(i.e,!1):(A.checkForgottenReturns(i,a,"",n,this),n._resolveCallback(i)))}},R.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},R.prototype._followee=function(){return this._rejectionHandler0},R.prototype._setFollowee=function(t){this._rejectionHandler0=t},R.prototype._settlePromise=function(t,e,r,o){var a=t instanceof R,s=this._bitField,c=0!=(134217728&s);0!=(65536&s)?(a&&t._invokeInternalOnCancel(),r instanceof C&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===T&&t._reject(T.e)):e===n?t._fulfill(n.call(r)):r instanceof i?r._promiseCancelled(t):a||t instanceof k?t._cancel():r.cancel()):"function"==typeof e?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof i?r._isResolved()||(0!=(33554432&s)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),0!=(33554432&s)?t._fulfill(o):t._reject(o))},R.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,r=t.promise,n=t.receiver,o=t.value;"function"==typeof e?r instanceof R?this._settlePromiseFromHandler(e,n,o,r):e.call(n,o,r):r instanceof R&&r._reject(o)},R.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},R.prototype._settlePromise0=function(t,e,r){var n=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,t,o,e)},R.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},R.prototype._fulfill=function(t){var r=this._bitField;if(!((117506048&r)>>>16)){if(t===this){var n=e();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&r)>0&&(0!=(134217728&r)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},R.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return m.fatalError(t,s.isNode);(65535&e)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},R.prototype._fulfillPromises=function(t,e){for(var r=1;r<t;r++){var n=this._fulfillmentHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,e)}},R.prototype._rejectPromises=function(t,e){for(var r=1;r<t;r++){var n=this._rejectionHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,e)}},R.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},R.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&p.defineProperty(R.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),R.defer=R.pending=function(){return A.deprecated("Promise.defer","new Promise"),{promise:new R(g),resolve:D,reject:j}},s.notEnumerableProp(R,"_makeSelfResolutionError",e),r(6926)(R,g,E,o,A),r(3635)(R,g,E,A),r(1735)(R,k,o,A),r(5632)(R),r(1958)(R),r(7717)(R,k,E,g,m),R.Promise=R,R.version="3.7.2",r(2293)(R),r(687)(R,o,g,E,i,A),r(6343)(R,k,o,E,g,A),r(1941)(R),r(9346)(R,g),r(5733)(R,k,E,o),r(4648)(R,g,E,o),r(3609)(R,k,o,E,g,A),r(8615)(R,k,A),r(4488)(R,k,o),r(8418)(R,g,A),r(4525)(R,o,E,x,g,A),r(9846)(R),r(6574)(R,g),r(6777)(R,g),s.toFastProperties(R),s.toFastProperties(R.prototype),I({a:1}),I({b:2}),I({c:3}),I(1),I((function(){})),I(void 0),I(!1),I(new R(g)),A.setBounds(d.firstLineError,s.lastLineError),R}},1640:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a=r(5942);a.isArray;function s(r){var n=this._promise=new t(e);r instanceof t&&(n._propagateFrom(r,3),r.suppressUnhandledRejections()),n._setOnCancel(this),this._values=r,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,i){var s=n(this._values,this._promise);if(s instanceof t){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,i);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===i?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(i));else{var u=o("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<r;++s){var c=n(e[s],o);a=c instanceof t?(c=c._target())._bitField:null,i?null!==a&&c.suppressUnhandledRejections():null!==a?0==(50397184&a)?(c._proxy(this,s),this._values[s]=c):i=0!=(33554432&a)?this._promiseFulfilled(c._value(),s):0!=(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(c,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r<e.length;++r)e[r]instanceof t&&e[r].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},9346:(t,e,r)=>{"use strict";t.exports=function(t,e){var n={},o=r(5942),i=r(1776),a=o.withAppended,s=o.maybeWrapAsError,c=o.canEvaluate,u=r(7621).TypeError,l={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),h=function(t){return o.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t};function p(t){return!f.test(t)}function d(t){try{return!0===t.__isPromisified__}catch(t){return!1}}function m(t,e,r){var n=o.getDataPropertyOrDefault(t,e+r,l);return!!n&&d(n)}function v(t,e,r,n){for(var i=o.inheritedDataKeys(t),a=[],s=0;s<i.length;++s){var c=i[s],l=t[c],f=n===h||h(c);"function"!=typeof l||d(l)||m(t,c,e)||!n(c,l,t,f)||a.push(c,l)}return function(t,e,r){for(var n=0;n<t.length;n+=2){var o=t[n];if(r.test(o))for(var i=o.replace(r,""),a=0;a<t.length;a+=2)if(t[a]===i)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}(a,e,r),a}var _;_=function(r,c,u,l,f,h){var p=Math.max(0,function(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0}(l)-1),d=function(t){for(var e=[t],r=Math.max(0,t-1-3),n=t-1;n>=r;--n)e.push(n);for(n=t+1;n<=3;++n)e.push(n);return e}(p),m="string"==typeof r||c===n;function v(t){var e,r=(e=t,o.filledRange(e,"_arg","")).join(", "),n=t>0?", ":"";return(m?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===c?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",r).replace(", ",n)}var _="string"==typeof r?"this != null ? this['"+r+"'] : fn":"fn",y="'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, "+h+"); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]",function(){for(var t="",e=0;e<d.length;++e)t+="case "+d[e]+":"+v(d[e]);return t+=" \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]",m?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",_);return y=y.replace("Parameters",function(t){return o.filledRange(Math.max(t,3),"_arg","")}(p)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",y)(t,l,c,a,s,i,o.tryCatch,o.errorObj,o.notEnumerableProp,e)};var y=c?_:function(r,c,u,l,f,h){var p=function(){return this}(),d=r;function m(){var o=c;c===n&&(o=this);var u=new t(e);u._captureStackTrace();var l="string"==typeof d&&this!==p?this[d]:r,f=i(u,h);try{l.apply(o,a(arguments,f))}catch(t){u._rejectCallback(s(t),!0,!0)}return u._isFateSealed()||u._setAsyncGuaranteed(),u}return"string"==typeof d&&(r=l),o.notEnumerableProp(m,"__isPromisified__",!0),m};function g(t,e,r,i,a){for(var s=new RegExp(e.replace(/([$])/,"\\$")+"$"),c=v(t,e,s,r),u=0,l=c.length;u<l;u+=2){var f=c[u],h=c[u+1],p=f+e;if(i===y)t[p]=y(f,n,f,h,e,a);else{var d=i(h,(function(){return y(f,n,f,h,e,a)}));o.notEnumerableProp(d,"__isPromisified__",!0),t[p]=d}}return o.toFastProperties(t),t}t.promisify=function(t,e){if("function"!=typeof t)throw new u("expecting a function but got "+o.classString(t));if(d(t))return t;var r=function(t,e,r){return y(t,e,void 0,t,null,r)}(t,void 0===(e=Object(e)).context?n:e.context,!!e.multiArgs);return o.copyDescriptors(t,r,p),r},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(e=Object(e)).multiArgs,n=e.suffix;"string"!=typeof n&&(n="Async");var i=e.filter;"function"!=typeof i&&(i=h);var a=e.promisifier;if("function"!=typeof a&&(a=y),!o.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=o.inheritedDataKeys(t),c=0;c<s.length;++c){var l=t[s[c]];"constructor"!==s[c]&&o.isClass(l)&&(g(l.prototype,n,i,a,r),g(l,n,i,a,r))}return g(t,n,i,a,r)}}},5733:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i,a=r(5942),s=a.isObject,c=r(9571);"function"==typeof Map&&(i=Map);var u=function(){var t=0,e=0;function r(r,n){this[t]=r,this[t+e]=n,t++}return function(n){e=n.size,t=0;var o=new Array(2*n.size);return n.forEach(r,o),o}}();function l(t){var e,r=!1;if(void 0!==i&&t instanceof i)e=u(t),r=!0;else{var n=c.keys(t),o=n.length;e=new Array(2*o);for(var a=0;a<o;++a){var s=n[a];e[a]=t[s],e[a+o]=s}}this.constructor$(e),this._isMap=r,this._init$(void 0,r?-6:-3)}function f(e){var r,i=n(e);return s(i)?(r=i instanceof t?i._then(t.props,void 0,void 0,void 0,void 0):new l(i).promise(),i instanceof t&&r._propagateFrom(i,2),r):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,e),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(t){for(var e=new i,r=t.length/2|0,n=0;n<r;++n){var o=t[r+n],a=t[n];e.set(o,a)}return e}(this._values);else{r={};for(var n=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+n]]=this._values[o]}return this._resolve(r),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return f(this)},t.props=function(t){return f(t)}}},7824:t=>{"use strict";function e(t){this._capacity=t,this._length=0,this._front=0}e.prototype._willBeOverCapacity=function(t){return this._capacity<t},e.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1},e.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var o=this._front+n-3;this._checkCapacity(n);var i=this._capacity-1;this[o+0&i]=t,this[o+1&i]=e,this[o+2&i]=r,this._length=n},e.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},e.prototype.length=function(){return this._length},e.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},e.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,function(t,e,r,n,o){for(var i=0;i<o;++i)r[i+n]=t[i+e],t[i+e]=void 0}(this,0,this,e,this._front+this._length&e-1)},t.exports=e},4648:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i=r(5942);function a(r,s){var c,u=n(r);if(u instanceof t)return(c=u).then((function(t){return a(t,c)}));if(null===(r=i.asArray(r)))return o("expecting an array or an iterable object but got "+i.classString(r));var l=new t(e);void 0!==s&&l._propagateFrom(s,3);for(var f=l._fulfill,h=l._reject,p=0,d=r.length;p<d;++p){var m=r[p];(void 0!==m||p in r)&&t.cast(m)._then(f,h,void 0,l,null)}return l}t.race=function(t){return a(t,void 0)},t.prototype.race=function(){return a(this,void 0)}}},3609:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(5942),c=s.tryCatch;function u(e,r,n,o){this.constructor$(e);var a=t._getContext();this._fn=s.contextBind(a,r),void 0!==n&&(n=t.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function f(t,e,r,o){return"function"!=typeof e?n("expecting a function but got "+s.classString(e)):new u(t,e,r,o).promise()}function h(e){this.accum=e,this.array._gotAccum(e);var r=o(this.value,this.array._promise);return r instanceof t?(this.array._currentCancellable=r,r._then(p,void 0,void 0,this,void 0)):p.call(this,r)}function p(e){var r,n=this.array,o=n._promise,i=c(n._fn);o._pushContext(),(r=void 0!==n._eachValues?i.call(o._boundValue(),e,this.index,this.length):i.call(o._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=r);var s=o._popContext();return a.checkForgottenReturns(r,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",o),r}s.inherits(u,e),u.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==i&&this._eachValues.push(t)},u.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},u.prototype._init=function(){},u.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},u.prototype.shouldCopyValues=function(){return!1},u.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},u.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},u.prototype._iterate=function(e){var r,n;this._values=e;var o=e.length;void 0!==this._initialValue?(r=this._initialValue,n=0):(r=t.resolve(e[0]),n=1),this._currentCancellable=r;for(var i=n;i<o;++i){var a=e[i];a instanceof t&&a.suppressUnhandledRejections()}if(!r.isRejected())for(;n<o;++n){var s={accum:null,value:e[n],index:n,length:o,array:this};r=r._then(h,void 0,void 0,s,void 0),0==(127&n)&&r._setNoAsyncGuarantee()}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(l,l,void 0,r,this)},t.prototype.reduce=function(t,e){return f(this,t,e,null)},t.reduce=function(t,e,r,n){return f(t,e,r,n)}}},679:(t,e,r)=>{"use strict";var n,o=r(5942),i=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,s=process.nextTick;n=o.isRecentNode?function(t){a.call(global,t)}:function(t){s.call(process,t)}}else if("function"==typeof i&&"function"==typeof i.resolve){var c=i.resolve();n=function(t){c.then(t)}}else n="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)||!("classList"in document.documentElement)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var t=document.createElement("div"),e={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver((function(){t.classList.toggle("foo"),r=!1})).observe(n,e);return function(o){var i=new MutationObserver((function(){i.disconnect(),o()}));i.observe(t,e),r||(r=!0,n.classList.toggle("foo"))}}();t.exports=n},8615:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=t.PromiseInspection;function i(t){this.constructor$(t)}r(5942).inherits(i,e),i.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var r=new o;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},i.prototype._promiseRejected=function(t,e){var r=new o;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},t.settle=function(t){return n.deprecated(".settle()",".reflect()"),new i(t).promise()},t.allSettled=function(t){return new i(t).promise()},t.prototype.settle=function(){return t.settle(this)}}},4488:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(5942),i=r(7621).RangeError,a=r(7621).AggregateError,s=o.isArray,c={};function u(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(t),o=r.promise();return r.setHowMany(e),r.init(),o}o.inherits(u,e),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(t){this._howMany=t},u.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e<this._values.length;++e)this._values[e]!==c&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(t){this._values.push(t)},u.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new i(e)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(t,e){return l(t,e)},t.prototype.some=function(t){return l(this,t)},t._SomePromiseArray=u}},1958:t=>{"use strict";t.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return i.call(this._target())},t.prototype.isFulfilled=function(){return o.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},1778:(t,e,r)=>{"use strict";t.exports=function(t,e){var n=r(5942),o=n.errorObj,i=n.isObject;var a={}.hasOwnProperty;return function(r,s){if(i(r)){if(r instanceof t)return r;var c=function(t){try{return function(t){return t.then}(t)}catch(t){return o.e=t,o}}(r);if(c===o){s&&s._pushContext();var u=t.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c){if(function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(r)){u=new t(e);return r._then(u._fulfill,u._reject,void 0,u,null),u}return function(r,i,a){var s=new t(e),c=s;a&&a._pushContext();s._captureStackTrace(),a&&a._popContext();var u=!0,l=n.tryCatch(i).call(r,f,h);u=!1,s&&l===o&&(s._rejectCallback(l.e,!0,!0),s=null);function f(t){s&&(s._resolveCallback(t),s=null)}function h(t){s&&(s._rejectCallback(t,u,!0),s=null)}return c}(r,c,s)}}return r}}},8418:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(5942),i=t.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return c(+this).thenReturn(t)},c=t.delay=function(r,o){var i,c;return void 0!==o?(i=t.resolve(o)._then(s,null,null,r,void 0),n.cancellation()&&o instanceof t&&i._setOnCancel(o)):(i=new t(e),c=setTimeout((function(){i._fulfill()}),+r),n.cancellation()&&i._setOnCancel(new a(c)),i._captureStackTrace()),i._setAsyncGuaranteed(),i};t.prototype.delay=function(t){return c(t,this)};function u(t){return clearTimeout(this.handle),t}function l(t){throw clearTimeout(this.handle),t}t.prototype.timeout=function(t,e){var r,s;t=+t;var c=new a(setTimeout((function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new i("operation timed out"):new i(e),o.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)}),t));return n.cancellation()?(s=this.then(),(r=s._then(u,l,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,l,void 0,c,void 0),r}}},4525:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(5942),c=r(7621).TypeError,u=r(5942).inherits,l=s.errorObj,f=s.tryCatch,h={};function p(t){setTimeout((function(){throw t}),0)}function d(e,r){var o=0,a=e.length,s=new t(i);return function i(){if(o>=a)return s._fulfill();var c=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(e[o++]);if(c instanceof t&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),e.promise)}catch(t){return p(t)}if(c instanceof t)return c._then(i,p,null,null,null)}i()}(),s}function m(t,e,r){this._data=t,this._promise=e,this._context=r}function v(t,e,r){this.constructor$(t,e,r)}function _(t){return m.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function y(t){this.length=t,this.promise=null,this[t-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},m.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==h?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},u(v,m),v.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},y.prototype._resultCancelled=function(){for(var e=this.length,r=0;r<e;++r){var n=this[r];n instanceof t&&n.cancel()}},t.using=function(){var r=arguments.length;if(r<2)return e("you must pass at least 2 arguments to Promise.using");var o,i=arguments[r-1];if("function"!=typeof i)return e("expecting a function but got "+s.classString(i));var c=!0;2===r&&Array.isArray(arguments[0])?(r=(o=arguments[0]).length,c=!1):(o=arguments,r--);for(var u=new y(r),h=0;h<r;++h){var p=o[h];if(m.isDisposer(p)){var v=p;(p=p.promise())._setDisposable(v)}else{var g=n(p);g instanceof t&&(p=g._then(_,null,null,{resources:u,index:h},void 0))}u[h]=p}var w=new Array(u.length);for(h=0;h<w.length;++h)w[h]=t.resolve(u[h]).reflect();var b=t.all(w).then((function(t){for(var e=0;e<t.length;++e){var r=t[e];if(r.isRejected())return l.e=r.error(),l;if(!r.isFulfilled())return void b.cancel();t[e]=r.value()}E._pushContext(),i=f(i);var n=c?i.apply(void 0,t):i(t),o=E._popContext();return a.checkForgottenReturns(n,o,"Promise.using",E),n})),E=b.lastly((function(){var e=new t.PromiseInspection(b);return d(u,e)}));return u.promise=E,E._setOnCancel(u),E},t.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new v(t,this,o());throw new c}}},5942:function(t,e,r){"use strict";var n=r(9571),o="undefined"==typeof navigator,i={e:{}},a,s="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null;function c(){try{var t=a;return a=null,t.apply(this,arguments)}catch(t){return i.e=t,i}}function u(t){return a=t,c}var l=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function f(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function h(t){return"function"==typeof t||"object"==typeof t&&null!==t}function p(t){return f(t)?new Error(x(t)):t}function d(t,e){var r,n=t.length,o=new Array(n+1);for(r=0;r<n;++r)o[r]=t[r];return o[r]=e,o}function m(t,e,r){if(!n.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var o=Object.getOwnPropertyDescriptor(t,e);return null!=o?null==o.get&&null==o.set?o.value:r:void 0}function v(t,e,r){if(f(t))return t;var o={value:r,configurable:!0,enumerable:!1,writable:!0};return n.defineProperty(t,e,o),t}function _(t){throw t}var y=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1};if(n.isES5){var r=Object.getOwnPropertyNames;return function(t){for(var o=[],i=Object.create(null);null!=t&&!e(t);){var a;try{a=r(t)}catch(t){return o}for(var s=0;s<a.length;++s){var c=a[s];if(!i[c]){i[c]=!0;var u=Object.getOwnPropertyDescriptor(t,c);null!=u&&null==u.get&&null==u.set&&o.push(c)}}t=n.getPrototypeOf(t)}return o}}var o={}.hasOwnProperty;return function(r){if(e(r))return[];var n=[];t:for(var i in r)if(o.call(r,i))n.push(i);else{for(var a=0;a<t.length;++a)if(o.call(t[a],i))continue t;n.push(i)}return n}}(),g=/this\s*\.\s*\S+\s*=/;function w(t){try{if("function"==typeof t){var e=n.names(t.prototype),r=n.isES5&&e.length>1,o=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=g.test(t+"")&&n.names(t).length>0;if(r||o||i)return!0}return!1}catch(t){return!1}}function b(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var E=/^[a-z$_][a-z$_0-9]*$/i;function k(t){return E.test(t)}function S(t,e,r){for(var n=new Array(t),o=0;o<t;++o)n[o]=e+o+r;return n}function x(t){try{return t+""}catch(t){return"[no string representation]"}}function A(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function C(t){try{v(t,"isOperational",!0)}catch(t){}}function F(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)}function P(t){return A(t)&&n.propertyIsWritable(t,"stack")}var T="stack"in new Error?function(t){return P(t)?t:new Error(x(t))}:function(t){if(P(t))return t;try{throw new Error(x(t))}catch(t){return t}};function O(t){return{}.toString.call(t)}function R(t,e,r){for(var o=n.names(t),i=0;i<o.length;++i){var a=o[i];if(r(a))try{n.defineProperty(e,a,n.getDescriptor(t,a))}catch(t){}}}var D=function(t){return n.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var j="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,r=[],n=t[Symbol.iterator]();!(e=n.next()).done;)r.push(e.value);return r};D=function(t){return n.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?j(t):null}}var I="undefined"!=typeof process&&"[object process]"===O(process).toLowerCase(),L="undefined"!=typeof process&&void 0!==process.env,N;function M(t){return L?process.env[t]:void 0}function B(){if("function"==typeof Promise)try{if("[object Promise]"===O(new Promise((function(){}))))return Promise}catch(t){}}function U(t,e){if(null===t||"function"!=typeof e||e===N)return e;null!==t.domain&&(e=t.domain.bind(e));var r=t.async;if(null!==r){var n=e;e=function(){for(var t=arguments.length+2,e=new Array(t),o=2;o<t;++o)e[o]=arguments[o-2];return e[0]=n,e[1]=this,r.runInAsyncScope.apply(r,e)}}return e}var z={setReflectHandler:function(t){N=t},isClass:w,isIdentifier:k,inheritedDataKeys:y,getDataPropertyOrDefault:m,thrower:_,isArray:n.isArray,asArray:D,notEnumerableProp:v,isPrimitive:f,isObject:h,isError:A,canEvaluate:o,errorObj:i,tryCatch:u,inherits:l,withAppended:d,maybeWrapAsError:p,toFastProperties:b,filledRange:S,toString:x,canAttachTrace:P,ensureErrorObject:T,originatesFromRejection:F,markAsOriginatingFromRejection:C,classString:O,copyDescriptors:R,isNode:I,hasEnvVariables:L,env:M,global:s,getNativePromise:B,contextBind:U},H;z.isRecentNode=z.isNode&&(process.versions&&process.versions.node?H=process.versions.node.split(".").map(Number):process.version&&(H=process.version.split(".").map(Number)),0===H[0]&&H[1]>10||H[0]>0),z.nodeSupportsAsyncResource=z.isNode&&function(){var t=!1;try{t="function"==typeof r(852).AsyncResource.prototype.runInAsyncScope}catch(e){t=!1}return t}(),z.isNode&&z.toFastProperties(process);try{throw new Error}catch(t){z.lastLineError=t}t.exports=z},9397:(t,e)=>{!function(t){var e=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,a=/\u2028/,s=/\u2029/;function c(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function u(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function l(t,e,r){if(e.charAt(r)!=t.charAt(0))return!1;for(var n=1,o=t.length;n<o;n++)if(e.charAt(r+n)!=t.charAt(n))return!1;return!0}t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(r,n){var o=r.length,i=0,a=null,s=null,f="",h=[],p=!1,d=0,m=0,v="{{",_="}}";function y(){f.length>0&&(h.push({tag:"_t",text:new String(f)}),f="")}function g(r,n){if(y(),r&&function(){for(var r=!0,n=m;n<h.length;n++)if(!(r=t.tags[h[n].tag]<t.tags._v||"_t"==h[n].tag&&null===h[n].text.match(e)))return!1;return r}())for(var o,i=m;i<h.length;i++)h[i].text&&((o=h[i+1])&&">"==o.tag&&(o.indent=h[i].text.toString()),h.splice(i,1));else n||h.push({tag:"\n"});p=!1,m=h.length}function w(t,e){var r="="+_,n=t.indexOf(r,e),o=u(t.substring(t.indexOf("=",e)+1,n)).split(" ");return v=o[0],_=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),v=n[0],_=n[1]),d=0;d<o;d++)0==i?l(v,r,d)?(--d,y(),i=1):"\n"==r.charAt(d)?g(p):f+=r.charAt(d):1==i?(d+=v.length-1,"="==(a=(s=t.tags[r.charAt(d+1)])?r.charAt(d+1):"_v")?(d=w(r,d),i=0):(s&&d++,i=2),p=d):l(_,r,d)?(h.push({tag:a,n:u(f),otag:v,ctag:_,i:"/"==a?p-v.length:d+_.length}),f="",d+=_.length-1,i=0,"{"==a&&("}}"==_?d++:c(h[h.length-1]))):f+=r.charAt(d);return g(p,!0),h};var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(e,r,n,o){var i,a=[],s=null,c=null;for(i=n[n.length-1];e.length>0;){if(c=e.shift(),i&&"<"==i.tag&&!(c.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[c.tag]<=t.tags.$||p(c,o))n.push(c),c.nodes=h(e,c.tag,n,o);else{if("/"==c.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+c.n);if(s=n.pop(),c.n!=s.n&&!d(c.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+c.n);return s.end=c.i,a}"\n"==c.tag&&(c.last=0==e.length||"\n"==e[0].tag)}a.push(c)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function p(t,e){for(var r=0,n=e.length;r<n;r++)if(e[r].o==t.n)return t.tag="#",!0}function d(t,e,r){for(var n=0,o=r.length;n<o;n++)if(r[n].c==t&&r[n].o==e)return!0}function m(t){var e=[];for(var r in t.partials)e.push('"'+_(r)+'":{name:"'+_(t.partials[r].name)+'", '+m(t.partials[r])+"}");return"partials: {"+e.join(",")+"}, subs: "+function(t){var e=[];for(var r in t)e.push('"'+_(r)+'": function(c,p,t,i) {'+t[r]+"}");return"{ "+e.join(",")+" }"}(t.subs)}t.stringify=function(e,r,n){return"{code: function (c,p,i) { "+t.wrapMain(e.code)+" },"+m(e)+"}"};var v=0;function _(t){return t.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function y(t){return~t.indexOf(".")?"d":"f"}function g(t,e){var r="<"+(e.prefix||"")+t.n+v++;return e.partials[r]={name:t.n,partials:{}},e.code+='t.b(t.rp("'+_(r)+'",c,p,"'+(t.indent||"")+'"));',r}function w(t,e){e.code+="t.b(t.t(t."+y(t.n)+'("'+_(t.n)+'",c,p,0)));'}function b(t){return"t.b("+t+");"}t.generate=function(e,r,n){v=0;var o={code:"",subs:{},partials:{}};return t.walk(e,o),n.asString?this.stringify(o,r,n):this.makeTemplate(o,r,n)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,e,r){var n=this.makePartials(t);return n.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(n,e,this,r)},t.makePartials=function(t){var e,r={subs:{},partials:t.partials,name:t.name};for(e in r.partials)r.partials[e]=this.makePartials(r.partials[e]);for(e in t.subs)r.subs[e]=new Function("c","p","t","i",t.subs[e]);return r},t.codegen={"#":function(e,r){r.code+="if(t.s(t."+y(e.n)+'("'+_(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(e.nodes,r),r.code+="});c.pop();}"},"^":function(e,r){r.code+="if(!t.s(t."+y(e.n)+'("'+_(e.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(e.nodes,r),r.code+="};"},">":g,"<":function(e,r){var n={partials:{},code:"",subs:{},inPartial:!0};t.walk(e.nodes,n);var o=r.partials[g(e,r)];o.subs=n.subs,o.partials=n.partials},$:function(e,r){var n={subs:{},code:"",partials:r.partials,prefix:e.n};t.walk(e.nodes,n),r.subs[e.n]=n.code,r.inPartial||(r.code+='t.sub("'+_(e.n)+'",c,p,i);')},"\n":function(t,e){e.code+=b('"\\n"'+(t.last?"":" + i"))},_v:function(t,e){e.code+="t.b(t.v(t."+y(t.n)+'("'+_(t.n)+'",c,p,0)));'},_t:function(t,e){e.code+=b('"'+_(t.text)+'"')},"{":w,"&":w},t.walk=function(e,r){for(var n,o=0,i=e.length;o<i;o++)(n=t.codegen[e[o].tag])&&n(e[o],r);return r},t.parse=function(t,e,r){return h(t,0,[],(r=r||{}).sectionTags||[])},t.cache={},t.cacheKey=function(t,e){return[t,!!e.asString,!!e.disableLambda,e.delimiters,!!e.modelGet].join("||")},t.compile=function(e,r){r=r||{};var n=t.cacheKey(e,r),o=this.cache[n];if(o){var i=o.partials;for(var a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(e,r.delimiters),e,r),e,r),this.cache[n]=o}}(e)},5485:(t,e,r)=>{var n=r(9397);n.Template=r(2882).Template,n.template=n.Template,t.exports=n},2882:(t,e)=>{!function(t){function e(t,e,r){var n;return e&&"object"==typeof e&&(void 0!==e[t]?n=e[t]:r&&e.get&&"function"==typeof e.get&&(n=e.get(t))),n}t.Template=function(t,e,r,n){t=t||{},this.r=t.code||this.r,this.c=r,this.options=n||{},this.text=e||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(t,e,r){return""},v:function(t){return t=c(t),s.test(t)?t.replace(r,"&").replace(n,"<").replace(o,">").replace(i,"'").replace(a,"""):t},t:c,render:function(t,e,r){return this.ri([t],e||{},r)},ri:function(t,e,r){return this.r(t,e,r)},ep:function(t,e){var r=this.partials[t],n=e[r.name];if(r.instance&&r.base==n)return r.instance;if("string"==typeof n){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[t].base=n,r.subs){for(key in e.stackText||(e.stackText={}),r.subs)e.stackText[key]||(e.stackText[key]=void 0!==this.activeSub&&e.stackText[this.activeSub]?e.stackText[this.activeSub]:this.text);n=function(t,e,r,n,o,i){function a(){}function s(){}var c;a.prototype=t,s.prototype=t.subs;var u=new a;for(c in u.subs=new s,u.subsText={},u.buf="",n=n||{},u.stackSubs=n,u.subsText=i,e)n[c]||(n[c]=e[c]);for(c in n)u.subs[c]=n[c];for(c in o=o||{},u.stackPartials=o,r)o[c]||(o[c]=r[c]);for(c in o)u.partials[c]=o[c];return u}(n,r.subs,r.partials,this.stackSubs,this.stackPartials,e.stackText)}return this.partials[t].instance=n,n},rp:function(t,e,r,n){var o=this.ep(t,r);return o?o.ri(e,r,n):""},rs:function(t,e,r){var n=t[t.length-1];if(u(n))for(var o=0;o<n.length;o++)t.push(n[o]),r(t,e,this),t.pop();else r(t,e,this)},s:function(t,e,r,n,o,i,a){var s;return(!u(t)||0!==t.length)&&("function"==typeof t&&(t=this.ms(t,e,r,n,o,i,a)),s=!!t,!n&&s&&e&&e.push("object"==typeof t?t:e[e.length-1]),s)},d:function(t,r,n,o){var i,a=t.split("."),s=this.f(a[0],r,n,o),c=this.options.modelGet,l=null;if("."===t&&u(r[r.length-2]))s=r[r.length-1];else for(var f=1;f<a.length;f++)void 0!==(i=e(a[f],s,c))?(l=s,s=i):s="";return!(o&&!s)&&(o||"function"!=typeof s||(r.push(l),s=this.mv(s,r,n),r.pop()),s)},f:function(t,r,n,o){for(var i=!1,a=!1,s=this.options.modelGet,c=r.length-1;c>=0;c--)if(void 0!==(i=e(t,r[c],s))){a=!0;break}return a?(o||"function"!=typeof i||(i=this.mv(i,r,n)),i):!o&&""},ls:function(t,e,r,n,o){var i=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(c(t.call(e,n)),e,r)),this.options.delimiters=i,!1},ct:function(t,e,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(e,r)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,e,r,n,o,i,a){var s,c=e[e.length-1],u=t.call(c);return"function"==typeof u?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,r,s.substring(o,i),a)):u},mv:function(t,e,r){var n=e[e.length-1],o=t.call(n);return"function"==typeof o?this.ct(c(o.call(n)),n,r):o},sub:function(t,e,r,n){var o=this.subs[t];o&&(this.activeSub=t,o(e,r,this,n),this.activeSub=!1)}};var r=/&/g,n=/</g,o=/>/g,i=/\'/g,a=/\"/g,s=/[&<>\"\']/;function c(t){return String(null==t?"":t)}var u=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}(e)},5405:(t,e,r)=>{var n=r(8887),o=r(6325),i=65536,a=15,s=h(5<<20),c=function(){try{return new Uint32Array(i)}catch(r){for(var t=new Array(i),e=0;e<i;e++)t[e]=0;return t}}(),u=407708164,l=2147483648,f={4:65536,5:262144,6:1048576,7:4194304};function h(t){try{return new Uint8Array(t)}catch(n){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e}}function p(t,e,r){if(void 0!==typeof t.buffer){if(Uint8Array.prototype.slice)return t.slice(e,r);var n=t.length;e=(e|=0)<0?Math.max(n+e,0):Math.min(e,n),r=(r=void 0===r?n:0|r)<0?Math.max(n+r,0):Math.min(r,n);for(var o=new Uint8Array(r-e),i=e,a=0;i<r;)o[a++]=t[i++];return o}return t.slice(e,r)}e.compressBound=function(t){return t+t/255+16|0},e.decompressBound=function(t){var e=0;if(o.readU32(t,e)!==u)throw new Error("invalid magic number");e+=4;var r=t[e++];if(64!=(192&r))throw new Error("incompatible descriptor version "+(192&r));var n=0!=(16&r),i=0!=(8&r),a=t[e++]>>4&7;if(void 0===f[a])throw new Error("invalid block size "+a);var s=f[a];if(i)return o.readU64(t,e);e++;for(var c=0;;){var h=o.readU32(t,e);if(e+=4,c+=h&l?h&=2147483647:s,0===h)return c;n&&(e+=4),e+=h}},e.makeBuffer=h,e.decompressBlock=function(t,e,r,n,o){var i,a,s,c,u;for(s=r+n;r<s;){var l=t[r++],f=l>>4;if(f>0){if(15===f)for(;f+=t[r],255===t[r++];);for(c=r+f;r<c;)e[o++]=t[r++]}if(r>=s)break;if(i=15&l,a=t[r++]|t[r++]<<8,15===i)for(;i+=t[r],255===t[r++];);for(c=(u=o-a)+(i+=4);u<c;)e[o++]=0|e[u++]}return o},e.compressBlock=function(t,e,r,n,i){var s,c,u,l,f,h,p,d;if(h=0,p=n+r,c=r,n>=13)for(var m=67;r+4<p-5;){var v=o.readU32(t,r),_=o.hashU32(v)>>>0;if(s=i[_=(_>>16^_)>>>0&65535]-1,i[_]=r+1,s<0||r-s>>>16>0||o.readU32(t,s)!==v)r+=m++>>6;else{for(m=67,f=r-c,l=r-s,s+=4,u=r+=4;r<p-5&&t[r]===t[s];)r++,s++;var y=(u=r-u)<15?u:15;if(f>=a){for(e[h++]=240+y,d=f-a;d>=255;d-=255)e[h++]=255;e[h++]=d}else e[h++]=(f<<4)+y;for(var g=0;g<f;g++)e[h++]=t[c+g];if(e[h++]=l,e[h++]=l>>8,u>=15){for(d=u-15;d>=255;d-=255)e[h++]=255;e[h++]=d}c=r}}if(0===c)return 0;if((f=p-c)>=a){for(e[h++]=240,d=f-a;d>=255;d-=255)e[h++]=255;e[h++]=d}else e[h++]=f<<4;for(r=c;r<p;)e[h++]=t[r++];return h},e.decompressFrame=function(t,r){var n,i,a,s,c=0,h=0;if(o.readU32(t,c)!==u)throw new Error("invalid magic number");if(c+=4,64!=(192&(s=t[c++])))throw new Error("incompatible descriptor version");n=0!=(16&s),i=0!=(4&s),a=0!=(8&s);var p=t[c++]>>4&7;if(void 0===f[p])throw new Error("invalid block size");for(a&&(c+=8),c++;;){var d;if(d=o.readU32(t,c),c+=4,0===d)break;if(n&&(c+=4),0!=(d&l)){d&=2147483647;for(var m=0;m<d;m++)r[h++]=t[c++]}else h=e.decompressBlock(t,r,c,d,h),c+=d}return i&&(c+=4),h},e.compressFrame=function(t,r){var a=0;o.writeU32(r,a,u),a+=4,r[a++]=64,r[a++]=112,r[a]=n.hash(0,r,4,a-4)>>8,a++;var l=f[7],h=t.length,p=0;for(!function(t){for(var e=0;e<i;e++)c[e]=0}();h>0;){var d,m=h>l?l:h;if((d=e.compressBlock(t,s,p,m,c))>m||0===d){o.writeU32(r,a,2147483648|m),a+=4;for(var v=p+m;p<v;)r[a++]=t[p++];h-=m}else{o.writeU32(r,a,d),a+=4;for(var _=0;_<d;)r[a++]=s[_++];p+=m,h-=m}}return o.writeU32(r,a,0),a+=4},e.decompress=function(t,r){var n,o;return void 0===r&&(r=e.decompressBound(t)),n=e.makeBuffer(r),(o=e.decompressFrame(t,n))!==r&&(n=p(n,0,o)),n},e.compress=function(t,r){var n,o;return void 0===r&&(r=e.compressBound(t.length)),n=e.makeBuffer(r),(o=e.compressFrame(t,n))!==r&&(n=p(n,0,o)),n}},6325:(t,e)=>{e.hashU32=function(t){return-1252372727^(t=(t=(t=(t=-949894596^(t=(t|=0)+2127912214+(t<<12)|0)^t>>>19)+374761393+(t<<5)|0)+-744332180^t<<9)+-42973499+(t<<3)|0)^t>>>16|0},e.readU64=function(t,e){var r=0;return r|=t[e++]<<0,r|=t[e++]<<8,r|=t[e++]<<16,r|=t[e++]<<24,r|=t[e++]<<32,r|=t[e++]<<40,r|=t[e++]<<48,r|=t[e++]<<56},e.readU32=function(t,e){var r=0;return r|=t[e++]<<0,r|=t[e++]<<8,r|=t[e++]<<16,r|=t[e++]<<24},e.writeU32=function(t,e,r){t[e++]=r>>0&255,t[e++]=r>>8&255,t[e++]=r>>16&255,t[e++]=r>>24&255},e.imul=function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16)|0}},8887:(t,e,r)=>{var n=r(6325),o=2654435761,i=2246822519,a=3266489917,s=374761393;function c(t,e){return(t|=0)>>>(32-(e|=0)|0)|t<<e|0}function u(t,e,r){return t|=0,e|=0,r|=0,0|n.imul(t>>>(32-e|0)|t<<e,r)}function l(t,e){return(t|=0)>>>(e|=0)^t|0}function f(t,e,r,o,i){return u(n.imul(e,r)+t,o,i)}function h(t,e,r){return u(t+n.imul(e[r],s),11,o)}function p(t,e,r){return f(t,n.readU32(e,r),a,17,668265263)}function d(t,e,r){return[f(t[0],n.readU32(e,r+0),i,13,o),f(t[1],n.readU32(e,r+4),i,13,o),f(t[2],n.readU32(e,r+8),i,13,o),f(t[3],n.readU32(e,r+12),i,13,o)]}e.hash=function(t,e,r,u){var f,m;if(m=u,u>=16){for(f=[t+o+i,t+i,t,t-o];u>=16;)f=d(f,e,r),r+=16,u-=16;f=c(f[0],1)+c(f[1],7)+c(f[2],12)+c(f[3],18)+m}else f=t+s+u>>>0;for(;u>=4;)f=p(f,e,r),r+=4,u-=4;for(;u>0;)f=h(f,e,r),r++,u--;return(f=l(n.imul(l(n.imul(l(f,15),i),13),a),16))>>>0}},7475:(t,e,r)=>{var n=r(5485);t.exports=function(){var t=new n.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b("MEMORY {"),n.b("\n"+r),n.b(" FLASH (rx) : ORIGIN = "),n.b(n.v(n.f("flashStart",t,e,0))),n.b(", LENGTH = "),n.b(n.v(n.f("flashLength",t,e,0))),n.b("\n"+r),n.b(" RAM (rwx) : ORIGIN = "),n.b(n.v(n.f("ramStart",t,e,0))),n.b(", LENGTH = "),n.b(n.v(n.f("ramLength",t,e,0))),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b("ENTRY(_start);"),n.b("\n"),n.b("\n"+r),n.b("_userland_trampoline_address = "),n.b(n.v(n.f("trampolineStart",t,e,0))),n.b(";"),n.b("\n"),n.b("\n"+r),n.b("SECTIONS {"),n.b("\n"+r),n.b(" .eadk_app_info ORIGIN(FLASH) : {"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_api_level))"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(SIZEOF(.rodata.eadk_app_icon));"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_start - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_app_end - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_name : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_name))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_icon : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_icon))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .text : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" *(.text)"),n.b("\n"+r),n.b(" *(.text.*)"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" *(.rodata)"),n.b("\n"+r),n.b(" *(.rodata.*)"),n.b("\n"+r),n.b(" _eadk_app_end = .;"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .data : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _data_section_start_flash = LOADADDR(.data);"),n.b("\n"+r),n.b(" _data_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.data)"),n.b("\n"+r),n.b(" *(.data.*)"),n.b("\n"+r),n.b(" _data_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM AT >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .bss : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _bss_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.bss)"),n.b("\n"+r),n.b(" *(.bss.*)"),n.b("\n"+r),n.b(" _bss_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"),n.b("\n"+r),n.b(" .heap : {"),n.b("\n"+r),n.b(" _heap_start = .;"),n.b("\n"+r),n.b(" . = (ORIGIN(RAM) + LENGTH(RAM));"),n.b("\n"+r),n.b(" _heap_end = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b('ASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");'),n.b("\n"),n.fl()},partials:{},subs:{}},'MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nENTRY(_start);\n\n_userland_trampoline_address = {{ trampolineStart }};\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n KEEP(*(.rodata.eadk_api_level))\n LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .rodata.eadk_app_name : {\n KEEP(*(.rodata.eadk_app_name))\n } >FLASH\n\n .rodata.eadk_app_icon : {\n KEEP(*(.rodata.eadk_app_icon))\n } >FLASH\n\n .text : {\n . = ALIGN(4);\n *(.text)\n *(.text.*)\n } >FLASH\n\n .rodata : {\n *(.rodata)\n *(.rodata.*)\n _eadk_app_end = .;\n } >FLASH\n\n .data : {\n . = ALIGN(4);\n _data_section_start_flash = LOADADDR(.data);\n _data_section_start_ram = .;\n *(.data)\n *(.data.*)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\n *(.bss.*)\n _bss_section_end_ram = .;\n } >RAM\n\n .heap : {\n _heap_start = .;\n . = (ORIGIN(RAM) + LENGTH(RAM));\n _heap_end = .;\n } >RAM\n}\n\nASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");\nASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");\nASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");\n',n);return t.render.apply(t,arguments)}},9983:(t,e,r)=>{"use strict";let n=r(7084),o=[function(){},function(t,e,r,n){if(n===e.length)throw new Error("Ran out of data");let o=e[n];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=255},function(t,e,r,n){if(n+1>=e.length)throw new Error("Ran out of data");let o=e[n];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=e[n+1]},function(t,e,r,n){if(n+2>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=255},function(t,e,r,n){if(n+3>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=e[n+3]}],i=[function(){},function(t,e,r,n){let o=e[0];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=n},function(t,e,r){let n=e[0];t[r]=n,t[r+1]=n,t[r+2]=n,t[r+3]=e[1]},function(t,e,r,n){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=n},function(t,e,r){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=e[3]}];function a(t,e,r,n,i,a){let s=t.width,c=t.height,u=t.index;for(let t=0;t<c;t++)for(let c=0;c<s;c++){let s=r(c,t,u);o[n](e,i,s,a),a+=n}return a}function s(t,e,r,n,o,a){let s=t.width,c=t.height,u=t.index;for(let t=0;t<c;t++){for(let c=0;c<s;c++){let s=o.get(n),l=r(c,t,u);i[n](e,s,l,a)}o.resetAfterLine()}}e.dataToBitMap=function(t,e){let r,o,i=e.width,c=e.height,u=e.depth,l=e.bpp,f=e.interlace;8!==u&&(r=function(t,e){let r=[],n=0;function o(){if(n===t.length)throw new Error("Ran out of data");let o,i,a,s,c,u,l,f,h=t[n];switch(n++,e){default:throw new Error("unrecognised depth");case 16:l=t[n],n++,r.push((h<<8)+l);break;case 4:l=15&h,f=h>>4,r.push(f,l);break;case 2:c=3&h,u=h>>2&3,l=h>>4&3,f=h>>6&3,r.push(f,l,u,c);break;case 1:o=1&h,i=h>>1&1,a=h>>2&1,s=h>>3&1,c=h>>4&1,u=h>>5&1,l=h>>6&1,f=h>>7&1,r.push(f,l,u,c,s,a,i,o)}}return{get:function(t){for(;r.length<t;)o();let e=r.slice(0,t);return r=r.slice(t),e},resetAfterLine:function(){r.length=0},end:function(){if(n!==t.length)throw new Error("extra data found")}}}(t,u)),o=u<=8?Buffer.alloc(i*c*4):new Uint16Array(i*c*4);let h,p,d=Math.pow(2,u)-1,m=0;if(f)h=n.getImagePasses(i,c),p=n.getInterlaceIterator(i,c);else{let t=0;p=function(){let e=t;return t+=4,e},h=[{width:i,height:c}]}for(let e=0;e<h.length;e++)8===u?m=a(h[e],o,p,l,t,m):s(h[e],o,p,l,r,d);if(8===u){if(m!==t.length)throw new Error("extra data found")}else r.end();return o}},9027:(t,e,r)=>{"use strict";let n=r(3482);t.exports=function(t,e,r,o){let i=-1!==[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(o.colorType);if(o.colorType===o.inputColorType){let e=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===o.bitDepth||16===o.bitDepth&&e)return t}let a=16!==o.bitDepth?t:new Uint16Array(t.buffer),s=255,c=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==c||o.inputHasAlpha||(c=3);let u=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,u*=2);let l=Buffer.alloc(e*r*u),f=0,h=0,p=o.bgColor||{};function d(){let t,e,r,c=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:c=a[f+3],t=a[f],e=a[f+1],r=a[f+2];break;case n.COLORTYPE_COLOR:t=a[f],e=a[f+1],r=a[f+2];break;case n.COLORTYPE_ALPHA:c=a[f+1],t=a[f],e=t,r=t;break;case n.COLORTYPE_GRAYSCALE:t=a[f],e=t,r=t;break;default:throw new Error("input color type:"+o.inputColorType+" is not supported at present")}return o.inputHasAlpha&&(i||(c/=s,t=Math.min(Math.max(Math.round((1-c)*p.red+c*t),0),s),e=Math.min(Math.max(Math.round((1-c)*p.green+c*e),0),s),r=Math.min(Math.max(Math.round((1-c)*p.blue+c*r),0),s))),{red:t,green:e,blue:r,alpha:c}}void 0===p.red&&(p.red=s),void 0===p.green&&(p.green=s),void 0===p.blue&&(p.blue=s);for(let t=0;t<r;t++)for(let t=0;t<e;t++){let t=d();switch(o.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:8===o.bitDepth?(l[h]=t.red,l[h+1]=t.green,l[h+2]=t.blue,i&&(l[h+3]=t.alpha)):(l.writeUInt16BE(t.red,h),l.writeUInt16BE(t.green,h+2),l.writeUInt16BE(t.blue,h+4),i&&l.writeUInt16BE(t.alpha,h+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let e=(t.red+t.green+t.blue)/3;8===o.bitDepth?(l[h]=e,i&&(l[h+1]=t.alpha)):(l.writeUInt16BE(e,h),i&&l.writeUInt16BE(t.alpha,h+2));break}default:throw new Error("unrecognised color Type "+o.colorType)}f+=c,h+=u}return l}},8442:(t,e,r)=>{"use strict";let n=r(3837),o=r(2781),i=t.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(i,o),i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=Buffer.isBuffer(t)?t:Buffer.from(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},i.prototype._processRead=function(t){this._reads.shift();let e=0,r=0,n=Buffer.alloc(t.length);for(;e<t.length;){let o=this._buffers[r++],i=Math.min(o.length,t.length-e);o.copy(n,e,0,i),e+=i,i!==o.length&&(this._buffers[--r]=o.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,n)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}},3482:t=>{"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},3500:t=>{"use strict";let e=[];!function(){for(let t=0;t<256;t++){let r=t;for(let t=0;t<8;t++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}}();let r=t.exports=function(){this._crc=-1};r.prototype.write=function(t){for(let r=0;r<t.length;r++)this._crc=e[255&(this._crc^t[r])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return-1^this._crc},r.crc32=function(t){let r=-1;for(let n=0;n<t.length;n++)r=e[255&(r^t[n])]^r>>>8;return-1^r}},8876:(t,e,r)=>{"use strict";let n=r(6744);let o={0:function(t,e,r,n,o){for(let i=0;i<r;i++)n[o+i]=t[e+i]},1:function(t,e,r,n,o,i){for(let a=0;a<r;a++){let r=a>=i?t[e+a-i]:0,s=t[e+a]-r;n[o+a]=s}},2:function(t,e,r,n,o){for(let i=0;i<r;i++){let a=e>0?t[e+i-r]:0,s=t[e+i]-a;n[o+i]=s}},3:function(t,e,r,n,o,i){for(let a=0;a<r;a++){let s=a>=i?t[e+a-i]:0,c=e>0?t[e+a-r]:0,u=t[e+a]-(s+c>>1);n[o+a]=u}},4:function(t,e,r,o,i,a){for(let s=0;s<r;s++){let c=s>=a?t[e+s-a]:0,u=e>0?t[e+s-r]:0,l=e>0&&s>=a?t[e+s-(r+a)]:0,f=t[e+s]-n(c,u,l);o[i+s]=f}}},i={0:function(t,e,r){let n=0,o=e+r;for(let r=e;r<o;r++)n+=Math.abs(t[r]);return n},1:function(t,e,r,n){let o=0;for(let i=0;i<r;i++){let r=i>=n?t[e+i-n]:0,a=t[e+i]-r;o+=Math.abs(a)}return o},2:function(t,e,r){let n=0,o=e+r;for(let i=e;i<o;i++){let o=e>0?t[i-r]:0,a=t[i]-o;n+=Math.abs(a)}return n},3:function(t,e,r,n){let o=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,s=e>0?t[e+i-r]:0,c=t[e+i]-(a+s>>1);o+=Math.abs(c)}return o},4:function(t,e,r,o){let i=0;for(let a=0;a<r;a++){let s=a>=o?t[e+a-o]:0,c=e>0?t[e+a-r]:0,u=e>0&&a>=o?t[e+a-(r+o)]:0,l=t[e+a]-n(s,c,u);i+=Math.abs(l)}return i}};t.exports=function(t,e,r,n,a){let s;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");s=[n.filterType]}else s=[0,1,2,3,4];16===n.bitDepth&&(a*=2);let c=e*a,u=0,l=0,f=Buffer.alloc((c+1)*r),h=s[0];for(let e=0;e<r;e++){if(s.length>1){let e=1/0;for(let r=0;r<s.length;r++){let n=i[s[r]](t,l,c,a);n<e&&(h=s[r],e=n)}}f[u]=h,u++,o[h](t,l,c,f,u,a),u+=c,l+=c}return f}},4603:(t,e,r)=>{"use strict";let n=r(3837),o=r(8442),i=r(2769),a=t.exports=function(t){o.call(this);let e=[],r=this;this._filter=new i(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){r.emit("complete",Buffer.concat(e))}}),this._filter.start()};n.inherits(a,o)},8692:(t,e,r)=>{"use strict";let n=r(33),o=r(2769);e.process=function(t,e){let r=[],i=new n(t);return new o(e,{read:i.read.bind(i),write:function(t){r.push(t)},complete:function(){}}).start(),i.process(),Buffer.concat(r)}},2769:(t,e,r)=>{"use strict";let n=r(7084),o=r(6744);function i(t,e,r){let n=t*e;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let a=t.exports=function(t,e){let r=t.width,o=t.height,a=t.interlace,s=t.bpp,c=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],a){let t=n.getImagePasses(r,o);for(let e=0;e<t.length;e++)this._images.push({byteWidth:i(t[e].width,s,c),height:t[e].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,c),height:o,lineIndex:0});this._xComparison=8===c?s:16===c?2*s:1};a.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},a.prototype._unFilterType1=function(t,e,r){let n=this._xComparison,o=n-1;for(let i=0;i<r;i++){let r=t[1+i],a=i>o?e[i-n]:0;e[i]=r+a}},a.prototype._unFilterType2=function(t,e,r){let n=this._lastLine;for(let o=0;o<r;o++){let r=t[1+o],i=n?n[o]:0;e[o]=r+i}},a.prototype._unFilterType3=function(t,e,r){let n=this._xComparison,o=n-1,i=this._lastLine;for(let a=0;a<r;a++){let r=t[1+a],s=i?i[a]:0,c=a>o?e[a-n]:0,u=Math.floor((c+s)/2);e[a]=r+u}},a.prototype._unFilterType4=function(t,e,r){let n=this._xComparison,i=n-1,a=this._lastLine;for(let s=0;s<r;s++){let r=t[1+s],c=a?a[s]:0,u=s>i?e[s-n]:0,l=s>i&&a?a[s-n]:0,f=o(u,c,l);e[s]=r+f}},a.prototype._reverseFilterLine=function(t){let e,r=t[0],n=this._images[this._imageIndex],o=n.byteWidth;if(0===r)e=t.slice(1,o+1);else switch(e=Buffer.alloc(o),r){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+r)}this.write(e),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=e,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},8417:t=>{"use strict";t.exports=function(t,e,r=!1){let n=e.depth,o=e.width,i=e.height,a=e.colorType,s=e.transColor,c=e.palette,u=t;return 3===a?function(t,e,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=o[t[i]];if(!r)throw new Error("index "+t[i]+" not in palette");for(let t=0;t<4;t++)e[i+t]=r[t];i+=4}}(t,u,o,i,c):(s&&function(t,e,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=!1;if(1===o.length?o[0]===t[i]&&(r=!0):o[0]===t[i]&&o[1]===t[i+1]&&o[2]===t[i+2]&&(r=!0),r)for(let t=0;t<4;t++)e[i+t]=0;i+=4}}(t,u,o,i,s),8===n||r||(16===n&&(u=Buffer.alloc(o*i*4)),function(t,e,r,n,o){let i=Math.pow(2,o)-1,a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){for(let r=0;r<4;r++)e[a+r]=Math.floor(255*t[a+r]/i+.5);a+=4}}(t,u,o,i,n))),u}},7084:(t,e)=>{"use strict";let r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(t,e){let n=[],o=t%8,i=e%8,a=(t-o)/8,s=(e-i)/8;for(let t=0;t<r.length;t++){let e=r[t],c=a*e.x.length,u=s*e.y.length;for(let t=0;t<e.x.length&&e.x[t]<o;t++)c++;for(let t=0;t<e.y.length&&e.y[t]<i;t++)u++;c>0&&u>0&&n.push({width:c,height:u,index:t})}return n},e.getInterlaceIterator=function(t){return function(e,n,o){let i=e%r[o].x.length,a=(e-i)/r[o].x.length*8+r[o].x[i],s=n%r[o].y.length;return 4*a+((n-s)/r[o].y.length*8+r[o].y[s])*t*4}}},6838:(t,e,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(3482),a=r(9432),s=t.exports=function(t){o.call(this);let e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,o),s.prototype.pack=function(t,e,r,n){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,r)),n&&this.emit("data",this._packer.packGAMA(n));let o=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}},8360:(t,e,r)=>{"use strict";let n=!0,o=r(9796);o.deflateSync||(n=!1);let i=r(3482),a=r(9432);t.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=new a(e||{}),s=[];s.push(Buffer.from(i.PNG_SIGNATURE)),s.push(r.packIHDR(t.width,t.height)),t.gamma&&s.push(r.packGAMA(t.gamma));let c=r.filterData(t.data,t.width,t.height),u=o.deflateSync(c,r.getDeflateOptions());if(c=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(u)),s.push(r.packIEND()),Buffer.concat(s)}},9432:(t,e,r)=>{"use strict";let n=r(3482),o=r(3500),i=r(9027),a=r(8876),s=r(9796),c=t.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};c.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},c.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},c.prototype.filterData=function(t,e,r){let o=i(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(o,e,r,this._options,s)},c.prototype._packChunk=function(t,e){let r=e?e.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(t,4),e&&e.copy(n,8),n.writeInt32BE(o.crc32(n.slice(4,n.length-4)),n.length-4),n},c.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},c.prototype.packIHDR=function(t,e){let r=Buffer.alloc(13);return r.writeUInt32BE(t,0),r.writeUInt32BE(e,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(n.TYPE_IHDR,r)},c.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},c.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}},6744:t=>{"use strict";t.exports=function(t,e,r){let n=t+e-r,o=Math.abs(n-t),i=Math.abs(n-e),a=Math.abs(n-r);return o<=i&&o<=a?t:i<=a?e:r}},7900:(t,e,r)=>{"use strict";let n=r(3837),o=r(9796),i=r(8442),a=r(4603),s=r(8550),c=r(9983),u=r(8417),l=t.exports=function(t){i.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(l,i),l.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=o.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,e=Math.max(t,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:e});let r=t,n=this.emit.bind(this,"error");this._inflate.on("error",(function(t){r&&n(t)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){r&&(t.length>r&&(t=t.slice(0,r)),r-=t.length,i(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},l.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},l.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},l.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},l.prototype._complete=function(t){if(this.errord)return;let e;try{let r=c.dataToBitMap(t,this._bitmapInfo);e=u(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(t){return void this._handleError(t)}this.emit("parsed",e)}},2416:(t,e,r)=>{"use strict";let n=!0,o=r(9796),i=r(9653);o.deflateSync||(n=!1);let a=r(33),s=r(8692),c=r(8550),u=r(9983),l=r(8417);t.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r,f,h;let p=[];let d=new a(t),m=new c(e,{read:d.read.bind(d),error:function(t){r=t},metadata:function(t){f=t},gamma:function(t){h=t},palette:function(t){f.palette=t},transColor:function(t){f.transColor=t},inflateData:function(t){p.push(t)},simpleTransparency:function(){f.alpha=!0}});if(m.start(),d.process(),r)throw r;let v,_=Buffer.concat(p);if(p.length=0,f.interlace)v=o.inflateSync(_);else{let t=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;v=i(_,{chunkSize:t,maxLength:t})}if(_=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let y=s.process(v,f);_=null;let g=u.dataToBitMap(y,f);y=null;let w=l(g,f,e.skipRescale);return f.data=w,f.gamma=h||0,f}},8550:(t,e,r)=>{"use strict";let n=r(3482),o=r(3500),i=t.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(t){let e=n.PNG_SIGNATURE;for(let r=0;r<e.length;r++)if(t[r]!==e[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),r=t.readUInt32BE(4),i="";for(let e=4;e<8;e++)i+=String.fromCharCode(t[e]);let a=Boolean(32&t[4]);if(this._hasIHDR||r===n.TYPE_IHDR){if(this._crc=new o,this._crc.write(Buffer.from(i)),this._chunks[r])return this._chunks[r](e);a?this.read(e+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+i))}else this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==e?this.error(new Error("Crc error - "+e+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),r=t.readUInt32BE(4),o=t[8],i=t[9],a=t[10],s=t[11],c=t[12];if(8!==o&&4!==o&&2!==o&&1!==o&&16!==o)return void this.error(new Error("Unsupported bit depth "+o));if(!(i in n.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==a)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==c&&1!==c)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let u=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:r,depth:o,interlace:Boolean(c),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:u,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let r=0;r<e;r++)this._palette.push([t[3*r],t[3*r+1],t[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(t.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},i.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(e);let r=t-e.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},i.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},6117:(t,e,r)=>{"use strict";let n=r(2416),o=r(8360);e.read=function(t,e){return n(t,e||{})},e.write=function(t,e){return o(t,e)}},5477:(t,e,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(7900),a=r(6838),s=r(6117),c=e.y=function(t){o.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new a(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(c,o),c.sync=s,c.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},c.prototype.parse=function(t,e){if(e){let t,r;t=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(r){this.removeListener("parsed",t),e(r,null)}.bind(this),this.once("parsed",t),this.once("error",r)}return this.end(t),this},c.prototype.write=function(t){return this._parser.write(t),!0},c.prototype.end=function(t){this._parser.end(t)},c.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},c.prototype._gamma=function(t){this.gamma=t},c.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},c.bitblt=function(t,e,r,n,o,i,a,s){if(n|=0,o|=0,i|=0,a|=0,s|=0,(r|=0)>t.width||n>t.height||r+o>t.width||n+i>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+o>e.width||s+i>e.height)throw new Error("bitblt writing outside image");for(let c=0;c<i;c++)t.data.copy(e.data,(s+c)*e.width+a<<2,(n+c)*t.width+r<<2,(n+c)*t.width+r+o<<2)},c.prototype.bitblt=function(t,e,r,n,o,i,a){return c.bitblt(this,t,e,r,n,o,i,a),this},c.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let r=0;r<t.width;r++){let n=t.width*e+r<<2;for(let e=0;e<3;e++){let r=t.data[n+e]/255;r=Math.pow(r,1/2.2/t.gamma),t.data[n+e]=Math.round(255*r)}}t.gamma=0}},c.prototype.adjustGamma=function(){c.adjustGamma(this)}},9653:(t,e,r)=>{"use strict";let n=r(9491).ok,o=r(9796),i=r(3837),a=r(4300).kMaxLength;function s(t){if(!(this instanceof s))return new s(t);t&&t.chunkSize<o.Z_MIN_CHUNK&&(t.chunkSize=o.Z_MIN_CHUNK),o.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function c(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}function u(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let r=t._finishFlushFlag;return null==r&&(r=o.Z_FINISH),t._processChunk(e,r)}(new s(e),t)}s.prototype._processChunk=function(t,e,r){if("function"==typeof r)return o.Inflate._processChunk.call(this,t,e,r);let i,s,u=this,l=t&&t.length,f=this._chunkSize-this._offset,h=this._maxLength,p=0,d=[],m=0;function v(t,e){if(u._hadError)return;let r=f-e;if(n(r>=0,"have should not go down"),r>0){let t=u._buffer.slice(u._offset,u._offset+r);if(u._offset+=r,t.length>h&&(t=t.slice(0,h)),d.push(t),m+=t.length,h-=t.length,0===h)return!1}return(0===e||u._offset>=u._chunkSize)&&(f=u._chunkSize,u._offset=0,u._buffer=Buffer.allocUnsafe(u._chunkSize)),0===e&&(p+=l-t,l=t,!0)}this.on("error",(function(t){i=t})),n(this._handle,"zlib binding closed");do{s=this._handle.writeSync(e,t,p,l,this._buffer,this._offset,f),s=s||this._writeState}while(!this._hadError&&v(s[0],s[1]));if(this._hadError)throw i;if(m>=a)throw c(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let _=Buffer.concat(d,m);return c(this),_},i.inherits(s,o.Inflate),t.exports=e=u,e.Inflate=s,e.createInflate=function(t){return new s(t)},e.inflateSync=u},33:t=>{"use strict";let e=t.exports=function(t){this._buffer=t,this._reads=[]};e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},5666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new F(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?d:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",m={};function v(){}function _(){}function y(){}var g={};c(g,i,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(P([])));b&&b!==r&&n.call(b,i)&&(g=b);var E=y.prototype=v.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=l(t[o],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function P(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:T}}function T(){return{value:e,done:!0}}return _.prototype=y,c(E,"constructor",y),c(y,"constructor",_),_.displayName=c(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},k(S.prototype),c(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(E),c(E,s,"Generator"),c(E,i,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},8006:t=>{"use strict";t.exports={type:"Buffer",data:[127,69,76,70,1,1,1,0,0,0,0,0,0,0,0,0,1,0,40,0,1,0,0,0,0,0,0,0,0,0,0,0,80,15,0,0,0,0,0,5,52,0,0,0,0,0,40,0,46,0,45,0,6,73,10,104,16,68,8,96,5,73,136,66,33,191,12,34,4,75,26,96,79,240,255,50,16,70,112,71,0,0,0,0,0,0,0,0,0,0,0,0,0,32,112,71,1,32,112,71,79,240,255,48,112,71,0,32,112,71,0,32,112,71,79,240,255,48,112,71,79,246,255,115,19,181,8,70,0,147,5,73,0,35,20,70,9,104,26,70,255,247,254,255,32,70,2,176,16,189,0,191,0,0,0,0,11,74,12,75,12,73,155,26,1,59,9,210,11,74,0,33,11,75,155,26,1,59,8,210,0,33,8,70,255,247,254,191,17,248,1,11,2,248,1,11,238,231,2,248,1,27,241,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,223,112,71,16,181,1,223,4,70,224,178,16,189,16,181,45,223,4,70,32,70,16,189,130,176,2,171,3,233,3,0,19,223,2,176,112,71,130,176,2,171,3,233,3,0,20,223,2,176,112,71,130,176,2,171,3,233,3,0,18,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,0,34,0,35,19,181,108,70,205,233,0,35,34,223,32,96,97,96,212,233,0,1,2,176,16,189,0,34,0,35,19,181,108,70,205,233,0,35,33,223,32,96,97,96,212,233,0,1,2,176,16,189,16,181,23,223,4,70,160,178,16,189,50,223,112,71,49,223,112,71,0,34,0,35,19,181,108,70,205,233,0,35,48,223,32,96,97,96,212,233,0,1,2,176,16,189,51,180,5,76,189,248,16,80,36,104,4,149,36,104,1,145,164,70,2,176,48,188,96,71,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,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,45,50,48,50,48,45,113,52,45,109,97,106,111,114,41,32,49,48,46,50,46,49,32,50,48,50,48,49,49,48,51,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,45,50,48,50,48,45,113,52,45,109,97,106,111,114,41,32,49,48,46,50,46,49,32,50,48,50,48,49,49,48,51,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,45,50,48,50,48,45,113,52,45,109,97,106,111,114,41,32,49,48,46,50,46,49,32,50,48,50,48,49,49,48,51,32,40,114,101,108,101,97,115,101,41,0,65,51,0,0,0,97,101,97,98,105,0,1,41,0,0,0,5,55,69,45,77,0,6,13,7,77,9,2,10,8,18,4,20,1,21,1,23,3,24,1,25,1,26,1,27,1,28,1,30,4,34,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,3,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,37,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,0,0,0,28,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,32,0,0,0,0,0,0,0,0,0,10,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,48,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,4,0,0,0,24,0,0,0,0,0,0,0,0,0,27,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,42,0,7,0,0,0,1,0,0,0,10,0,0,0,18,0,23,0,22,0,0,0,1,0,0,0,14,0,0,0,18,0,17,0,45,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,51,0,0,0,1,0,0,0,14,0,0,0,18,0,18,0,250,0,0,0,0,0,0,0,4,0,0,0,17,0,35,0,82,0,0,0,1,0,0,0,4,0,0,0,18,0,4,0,89,0,0,0,1,0,0,0,26,0,0,0,18,0,22,0,118,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,152,0,0,0,1,0,0,0,4,0,0,0,18,0,5,0,160,0,0,0,1,0,0,0,6,0,0,0,18,0,6,0,166,0,0,0,1,0,0,0,28,0,0,0,18,0,27,0,191,0,0,0,1,0,0,0,40,0,0,0,18,0,2,0,197,0,0,0,1,0,0,0,4,0,0,0,18,0,25,0,216,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,228,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,249,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,18,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,37,1,0,0,1,0,0,0,68,0,0,0,18,0,12,0,44,1,0,0,1,0,0,0,4,0,0,0,18,0,8,0,51,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,80,1,0,0,1,0,0,0,10,0,0,0,18,0,16,0,92,1,0,0,1,0,0,0,14,0,0,0,18,0,19,0,115,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,137,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,142,1,0,0,1,0,0,0,4,0,0,0,18,0,24,0,161,1,0,0,0,0,0,0,4,0,0,0,17,0,33,0,180,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,203,1,0,0,1,0,0,0,26,0,0,0,18,0,21,0,222,1,0,0,1,0,0,0,36,0,0,0,18,0,10,0,229,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,255,1,0,0,1,0,0,0,26,0,0,0,18,0,26,0,18,2,0,0,1,0,0,0,4,0,0,0,18,0,7,0,24,2,0,0,1,0,0,0,10,0,0,0,18,0,20,0,53,2,0,0,1,0,0,0,4,0,0,0,18,0,14,0,83,2,0,0,1,0,0,0,10,0,0,0,18,0,15,0,109,2,0,0,1,0,0,0,6,0,0,0,18,0,9,0,0,36,116,0,36,100,0,101,97,100,107,95,101,118,101,110,116,95,103,101,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,101,114,114,110,111,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,95,102,115,116,97,116,0,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,104,101,97,112,95,101,110,100,0,95,105,115,97,116,116,121,0,95,111,112,101,110,0,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,95,115,98,114,107,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,95,104,101,97,112,95,115,116,97,114,116,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,105,122,101,0,95,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,116,97,114,116,0,95,108,115,101,101,107,0,95,117,115,101,114,108,97,110,100,95,116,114,97,109,112,111,108,105,110,101,95,97,100,100,114,101,115,115,0,101,97,100,107,95,114,97,110,100,111,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,109,97,105,110,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,95,119,114,105,116,101,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,102,108,97,115,104,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,95,114,101,97,100,0,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,95,99,108,111,115,101,0,28,0,0,0,2,3,0,0,32,0,0,0,2,75,0,0,36,0,0,0,2,69,0,0,20,0,0,0,10,78,0,0,32,0,0,0,2,1,0,0,28,0,0,0,30,91,0,0,48,0,0,0,2,74,0,0,52,0,0,0,2,90,0,0,56,0,0,0,2,97,0,0,60,0,0,0,2,94,0,0,64,0,0,0,2,82,0,0,24,0,0,0,2,2,0,0,0,0,0,0,2,87,0,0,0,0,0,0,2,84,0,0,0,0,0,0,2,83,0,0,0,0,0,0,2,81,0,0,0,46,115,121,109,116,97,98,0,46,115,116,114,116,97,98,0,46,115,104,115,116,114,116,97,98,0,46,116,101,120,116,0,46,114,101,108,46,116,101,120,116,46,95,115,98,114,107,0,46,116,101,120,116,46,95,102,115,116,97,116,0,46,116,101,120,116,46,95,105,115,97,116,116,121,0,46,116,101,120,116,46,95,111,112,101,110,0,46,116,101,120,116,46,95,114,101,97,100,0,46,116,101,120,116,46,95,108,115,101,101,107,0,46,116,101,120,116,46,95,99,108,111,115,101,0,46,114,101,108,46,116,101,120,116,46,95,119,114,105,116,101,0,46,114,101,108,46,116,101,120,116,46,95,115,116,97,114,116,0,46,116,101,120,116,46,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,46,116,101,120,116,46,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,46,116,101,120,116,46,101,97,100,107,95,114,97,110,100,111,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,46,116,101,120,116,46,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,46,116,101,120,116,46,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,46,116,101,120,116,46,101,97,100,107,95,101,118,101,110,116,95,103,101,116,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,46,114,101,108,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,46,114,111,100,97,116,97,46,108,111,99,97,116,105,111,110,46,48,0,46,114,101,108,46,114,111,100,97,116,97,46,95,90,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,105,122,101,0,46,114,101,108,46,100,97,116,97,46,104,101,97,112,95,101,110,100,46,49,0,46,98,115,115,0,46,99,111,109,109,101,110,116,0,46,65,82,77,46,97,116,116,114,105,98,117,116,101,115,0,46,110,111,105,110,105,116,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,27,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,37,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,33,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,208,11,0,0,24,0,0,0,43,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,49,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,92,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,62,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,76,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,100,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,113,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,130,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,120,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,126,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,232,11,0,0,16,0,0,0,43,0,0,0,10,0,0,0,4,0,0,0,8,0,0,0,147,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,156,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,143,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,248,11,0,0,48,0,0,0,43,0,0,0,12,0,0,0,4,0,0,0,8,0,0,0,160,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,224,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,196,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,228,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,228,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,238,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,246,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,248,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,19,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,6,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,56,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,20,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,85,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,34,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,120,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,44,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,145,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,70,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,180,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,201,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,226,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,251,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,24,2,0,0,1,0,0,0,6,0,0,0,0,0,0,0,140,1,0,0,28,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,20,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,40,12,0,0,8,0,0,0,43,0,0,0,27,0,0,0,4,0,0,0,8,0,0,0,55,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,168,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,78,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,172,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,74,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,48,12,0,0,8,0,0,0,43,0,0,0,30,0,0,0,4,0,0,0,8,0,0,0,127,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,176,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,137,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,176,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,133,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,56,12,0,0,8,0,0,0,43,0,0,0,33,0,0,0,4,0,0,0,8,0,0,0,166,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,180,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,162,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,64,12,0,0,8,0,0,0,43,0,0,0,35,0,0,0,4,0,0,0,8,0,0,0,200,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,184,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,196,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,72,12,0,0,8,0,0,0,43,0,0,0,37,0,0,0,4,0,0,0,8,0,0,0,217,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,188,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,222,2,0,0,1,0,0,0,48,0,0,0,0,0,0,0,188,1,0,0,234,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,231,2,0,0,3,0,0,112,0,0,0,0,0,0,0,0,166,2,0,0,52,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,247,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,218,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,220,2,0,0,128,6,0,0,44,0,0,0,67,0,0,0,4,0,0,0,16,0,0,0,9,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,92,9,0,0,116,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,80,12,0,0,255,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},7573:(t,e,r)=>{"use strict";t.exports=r.p+"toolchain/ld.wasm"},3835:(t,e,r)=>{"use strict";t.exports=r.p+"toolchain/objcopy.wasm"},295:t=>{"use strict";t.exports=require("cli-progress")},7304:t=>{"use strict";t.exports=require("commander")},9491:t=>{"use strict";t.exports=require("assert")},852:t=>{"use strict";t.exports=require("async_hooks")},4300:t=>{"use strict";t.exports=require("buffer")},6113:t=>{"use strict";t.exports=require("crypto")},7147:t=>{"use strict";t.exports=require("fs")},1017:t=>{"use strict";t.exports=require("path")},2781:t=>{"use strict";t.exports=require("stream")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.p="";var n={};(()=>{"use strict";r.d(n,{default:()=>Sr});var t=r(7757),e=r.n(t);const o=require("usb");function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function c(t){var e="function"==typeof Map?new Map:void 0;return c=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,t)},c(t)}function u(t,e,r){return u=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&f(o,r.prototype),o},u.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}const p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(p,t);var e,r,n,o,c,u=(e=p,r=l(),function(){var t,n=h(e);if(r){var o=h(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return s(this,t)});function p(t){var e;a(this,p);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=u.call.apply(u,[this].concat(n))).name=t,e}return n=p,o&&i(n.prototype,o),c&&i(n,c),Object.defineProperty(n,"prototype",{writable:!1}),n}(c(Error));function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"append",value:function(e){for(var r="",n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];o.forEach((function(t){r+=t+","})),t.Content+=+new Date+","+e+","+r+"\n"}},{key:"info",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["info"].concat(r))}},{key:"warn",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["warn"].concat(r))}},{key:"error",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["error"].concat(r))}}],(r=null)&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();m.Content="";const v=m;function _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){g(i,n,o,a,s,"next",t)}function s(t){g(i,n,o,a,s,"throw",t)}a(void 0)}))}}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function E(t,e,r){return e&&b(t.prototype,e),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&x(t,e)}function x(t,e){return x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},x(t,e)}function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=F(t);if(e){var o=F(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return C(this,r)}}function C(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function F(t){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},F(t)}var P=6,T=8,O=10,R=2,D=3,j=4,I=1033;function L(t){return{bLength:t.getUint8(0),bDescriptorType:t.getUint8(1),bInterfaceNumber:t.getUint8(2),bAlternateSetting:t.getUint8(3),bNumEndpoints:t.getUint8(4),bInterfaceClass:t.getUint8(5),bInterfaceSubClass:t.getUint8(6),bInterfaceProtocol:t.getUint8(7),iInterface:t.getUint8(8),endpoints:[]}}function N(t){var e=function(t){for(var e,r=t,n=[];r.byteLength>2;){var o=r.getUint8(0),i=r.getUint8(1),a=new DataView(r.buffer.slice(0,o));if(i==j)e=L(a),n.push(e);else{var s={bLength:o,bDescriptorType:i,data:a};e?e.endpoints.push(s):n.push(s)}r=new DataView(r.buffer.slice(o))}return n}(new DataView(t.buffer.slice(9)));return{bLength:t.getUint8(0),bDescriptorType:t.getUint8(1),wTotalLength:t.getUint16(2,!0),bNumInterfaces:t.getUint8(4),bConfigurationValue:t.getUint8(5),iConfiguration:t.getUint8(6),bmAttributes:t.getUint8(7),bMaxPower:t.getUint8(8),interfaces:e}}function M(t){return v.info("DFU","getConfiguration"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:T,value:0,index:0},1).then((function(t){"ok"==t.status?e(t.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+t.status))})).catch((function(t){r(new Error("Get configuration failed --\x3e "+t))}))}))}function B(t){return v.info("DFU","getInterface"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"interface",request:O,value:0,index:t.settings.interface.interfaceNumber},1).then((function(t){"ok"==t.status?e(t.data.getInt8(0)):r(new Error("Wrong getInterface status: "+t.status))})).catch((function(t){r(new Error("Get interface failed --\x3e "+t))}))}))}function U(t,e){return v.info("DFU","getConfigurationDescriptor","index "+e),new Promise((function(r,n){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:P,value:e|R<<8,index:0},4).then((function(o){if("ok"==o.status){var i=o.data.getUint16(2,!0);t.device.controlTransferIn({requestType:"standard",recipient:"device",request:P,value:e|R<<8,index:0},i).then((function(t){"ok"==t.status?r(N(t.data)):n(new Error("Wrong getConfigurationDescriptor status: "+t.status))})).catch((function(t){n(t)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((function(t){n(new Error("Get configuration descriptor failed --\x3e "+t))}))}))}function z(t,e){return v.info("DFU","getStringDescriptor","index "+e),new Promise((function(r,n){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:P,value:e|D<<8,index:I},255).then((function(t){"ok"==t.status?(t.data.getInt8(1)!=D&&n(new Error("Wrong descriptor type: "+t.data.getInt8(1))),r(new TextDecoder("utf-16").decode(new Uint16Array(t.data.buffer,2)))):n(new Error("Wrong getStringDescriptor status: "+t.status))})).catch((function(t){n(new Error("Get string descriptor failed --\x3e "+t))}))}))}var H={Offset:0,Size:11,Signature:{Offset:0,Size:5}},G={Offset:11,TargetPrefix:{Offset:0,Size:274,Signature:{Offset:0,Size:6},NbElements:{Offset:270,Size:4}},Element:{Offset:274,Address:{Offset:0,Size:4},Size:{Offset:4,Size:4},Data:{Offset:8}}},V=1,q=2,W=3,Y=4,K=5,$=6,X=0,Z=2,Q=4,J=5,tt=7,et=10,rt=33,nt=65,ot=function(t){S(r,t);var e=A(r);function r(){k(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"DFUError"].concat(n))}return E(r)}(p),it=function(t){S(r,t);var e=A(r);function r(){k(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"DFUInterfaceError"].concat(n))}return E(r)}(p);function at(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return v.info("DFU","requestIn","bRequest: "+e,"data: "+r,"wValue: "+n),new Promise((function(o,i){t.device.controlTransferIn({requestType:"class",recipient:"interface",request:e,value:n,index:t.settings.interface.interfaceNumber},r).then((function(t){"ok"==t.status?o(t.data):i(new Error("Wrong requestIn status: "+t.status))})).catch((function(t){i(new Error("ControlTransferIn failed --\x3e "+t))}))}))}function st(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return v.info("DFU","requestOut","bRequest: "+e,"data: "+r,"wValue: "+n),new Promise((function(o,i){t.device.controlTransferOut({requestType:"class",recipient:"interface",request:e,value:n,index:t.settings.interface.interfaceNumber},r).then((function(t){"ok"==t.status?o(t.bytesWritten):i(new Error("Wrong requestOut status: "+t.status))})).catch((function(t){i(new Error("ControlTransferOut failed --\x3e "+t))}))}))}function ct(t){return v.info("DFU","getState"),new Promise((function(e,r){at(t,K,1).then((function(t){e(t.getUint8(0))})).catch((function(t){r(new Error("Get state failed --\x3e "+t))}))}))}function ut(t){return v.info("DFU","getStatus"),new Promise((function(e,r){at(t,W,6).then((function(t){e({status:t.getUint8(0),pollTimeout:16777215&t.getUint32(1,!0),state:t.getUint8(4)})})).catch((function(t){r(new Error("Get status failed --\x3e "+t))}))}))}function lt(t){return ft.apply(this,arguments)}function ft(){return ft=w(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","abortToIdle"),t.prev=1,t.next=4,st(r,$);case 4:return t.next=6,ct(r);case 6:if((n=t.sent)!=et){t.next=13;break}return t.next=10,st(r,Y);case 10:return t.next=12,ct(r);case 12:n=t.sent;case 13:if(n==Z){t.next=15;break}throw new Error("State is "+n.state+"instead of DFU IDLE (2).");case 15:t.next=20;break;case 17:throw t.prev=17,t.t0=t.catch(1),new Error("Abort to idle failed --\x3e "+t.t0);case 20:case"end":return t.stop()}}),t,null,[[1,17]])}))),ft.apply(this,arguments)}function ht(t,e){return pt.apply(this,arguments)}function pt(){return pt=w(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=function(t){return new Promise((function(e,r){setTimeout(e,t)}))},v.info("DFU","pollUntil",n),t.prev=2,t.next=5,ut(r);case 5:i=t.sent;case 6:if(n(i.state)||i.state==et){t.next=14;break}return t.next=9,o(i.pollTimeout);case 9:return t.next=11,ut(r);case 11:i=t.sent,t.next=6;break;case 14:return t.abrupt("return",i);case 17:throw t.prev=17,t.t0=t.catch(2),new Error("Poll until failed --\x3e "+t.t0);case 20:case"end":return t.stop()}}),t,null,[[2,17]])}))),pt.apply(this,arguments)}function dt(t,e){return mt.apply(this,arguments)}function mt(){return mt=w(e().mark((function t(r,n){var o,i,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","setAddress",Number(n).toString(16)),o=new ArrayBuffer(5),(i=new DataView(o)).setUint8(0,rt),i.setUint32(1,n,!0),t.prev=5,t.next=8,st(r,V,o,0);case 8:return t.next=10,ht(r,(function(t){return t!=Q}));case 10:if((a=t.sent).status==X){t.next=13;break}throw"Status is "+a.status+" instead of Status OK (0).";case 13:t.next=18;break;case 15:throw t.prev=15,t.t0=t.catch(5),"Set address to "+n+" failed --\x3e "+t.t0;case 18:case"end":return t.stop()}}),t,null,[[5,15]])}))),mt.apply(this,arguments)}const vt=function(){function t(r,n){k(this,t),this.open=w(e().mark((function t(){var r,n,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","open"),t.prev=1,t.next=4,this.device.open();case 4:t.next=9;break;case 6:throw t.prev=6,t.t0=t.catch(1),new ot("OPEN failed --\x3e "+t.t0);case 9:if(r=this.settings.configuration.configurationValue,null!=this.device.configuration&&this.device.configuration.configurationValue==r){t.next=19;break}return t.prev=11,t.next=14,this.device.selectConfiguration(r);case 14:t.next=19;break;case 16:throw t.prev=16,t.t1=t.catch(11),new ot("OPEN failed: could not select configuration --\x3e "+t.t1);case 19:if(n=this.settings.interface.interfaceNumber,this.device.configuration.interfaces[n].claimed){t.next=29;break}return t.prev=21,t.next=24,this.device.claimInterface(n);case 24:t.next=29;break;case 26:throw t.prev=26,t.t2=t.catch(21),new it("OPEN failed: could not claim interface --\x3e "+t.t2);case 29:if(o=this.settings.alternate.alternateSetting,null!=this.device.configuration.interfaces[n].alternate&&this.device.configuration.interfaces[n].alternate==o){t.next=39;break}return t.prev=31,t.next=34,this.device.selectAlternateInterface(n,o);case 34:t.next=39;break;case 36:throw t.prev=36,t.t3=t.catch(31),new ot("OPEN failed: could not select alternate interface --\x3e "+t.t3);case 39:case"end":return t.stop()}}),t,this,[[1,6],[11,16],[21,26],[31,36]])}))),this.close=w(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","close"),t.prev=1,t.next=4,this.device.close();case 4:t.next=9;break;case 6:throw t.prev=6,t.t0=t.catch(1),new ot("CLOSE failed --\x3e "+t.t0);case 9:case"end":return t.stop()}}),t,this,[[1,6]])}))),this.getMemoryLayout=w(e().mark((function t(){var r,n=this;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","getMemoryLayout"),t.prev=1,t.delegateYield(e().mark((function t(){var r,o,i,a,s,c,u,l,f;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M(n);case 2:return r=t.sent,t.next=5,U(n,r-1);case 5:return o=t.sent,t.next=8,B(n);case 8:return i=t.sent,a=o.interfaces[i].iInterface,t.next=12,z(n,a);case 12:for(s=t.sent,c=s.split("/"),u=[],l=function(t){var e=parseInt(c[t]),r=c[t+1].split(","),n=/(\d+)\*(\d+)([K|M])g/;r.forEach((function(t){var r=t.match(n),o=parseInt(r[1]),i=parseInt(r[2]),a=r[3];"K"==a?i*=1024:"M"==a&&(i*=1048576);var s=o*i,c={address:e,lastAddress:e+s-1,size:s,nbPage:o,pageSize:i};u.push(c),e+=s}))},f=1;f<c.length;f+=2)l(f);return t.abrupt("return",{v:u});case 18:case"end":return t.stop()}}),t)}))(),"t0",3);case 3:if("object"!=typeof(r=t.t0)){t.next=6;break}return t.abrupt("return",r.v);case 6:t.next=11;break;case 8:throw t.prev=8,t.t1=t.catch(1),new ot("GET MEMORY LAYOUT failed --\x3e "+t.t1);case 11:case"end":return t.stop()}}),t,null,[[1,8]])}))),this.upload=function(){var t=w(e().mark((function t(r,n,o){var i,a,s,c,u,l;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","upload","address "+Number(r).toString(16),"Length "+Number(n).toString(16)),t.prev=1,t.next=4,ct(this);case 4:if(t.sent==Z){t.next=8;break}return t.next=8,lt(this);case 8:return t.next=10,dt(this,r);case 10:return t.next=12,lt(this);case 12:i=2,a=new Uint8Array(n),s=0,o&&o(0);case 16:return u=Math.min(this.TransferSize,n-s),v.info("DFU","upload","block number "+i,"bytes to read "+u),t.next=20,at(this,q,u,i++);case 20:(c=t.sent).byteLength>0&&(l=new Uint8Array(c.buffer),a.set(l,s),s+=c.byteLength),o&&o(s/n);case 23:if(s<n){t.next=16;break}case 24:return t.next=26,lt(this);case 26:return t.abrupt("return",a);case 29:return t.prev=29,t.t0=t.catch(1),t.next=33,lt(this);case 33:throw new ot("UPLOAD failed at address "+r+" of length "+n+" --\x3e "+t.t0);case 34:case"end":return t.stop()}}),t,this,[[1,29]])})));return function(e,r,n){return t.apply(this,arguments)}}(),this.download=function(){var t=w(e().mark((function t(r,n,o){var i,a,s,c,u,l,f;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:v.info("DFU","download","address "+Number(r).toString(16)),t.prev=1,i=0,a=n.byteLength,s=r,o&&o(0);case 6:if(!(i<a)){t.next=27;break}return c=a-i,u=Math.min(c,this.TransferSize),v.info("DFU","download step, at address "+Number(r).toString(16)),l=0,f=void 0,t.next=14,dt(this,s);case 14:return t.next=16,st(this,V,n.slice(i,i+u),2);case 16:return l=t.sent,t.next=19,ht(this,(function(t){return t==J||t==Z}));case 19:if(f=t.sent,s+=u,f.status==X){t.next=23;break}throw"state=".concat(f.state,", status=").concat(f.status);case 23:i+=l,o&&o(i/a),t.next=6;break;case 27:t.next=32;break;case 29:throw t.prev=29,t.t0=t.catch(1),new ot("DOWNLOAD failed at address "+Number(r).toString(16)+" --\x3e "+t.t0);case 32:case"end":return t.stop()}}),t,this,[[1,29]])})));return function(e,r,n){return t.apply(this,arguments)}}(),this.leave=function(){var t=w(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","leave","address "+Number(r).toString(16)),t.prev=1,t.next=4,dt(this,r);case 4:return t.next=6,st(this,V,new ArrayBuffer,2);case 6:return t.next=8,ht(this,(function(t){return t==tt}));case 8:t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(1),new ot("LEAVE failed at address "+Number(r).toString(16)+" --\x3e "+t.t0);case 13:case"end":return t.stop()}}),t,this,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),this.eraseSegment=function(){var t=w(e().mark((function t(r){var n,o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","eraseSegment","address "+Number(r).toString(16)),t.prev=1,t.next=4,ct(this);case 4:if(t.sent==Z){t.next=8;break}return t.next=8,lt(this);case 8:return n=new ArrayBuffer(5),(o=new DataView(n)).setUint8(0,nt),o.setUint32(1,r,!0),t.next=14,st(this,V,n,0);case 14:return t.next=16,ut(this);case 16:if((i=t.sent).state==Q){t.next=19;break}throw"wrong DFU state: "+i.state;case 19:return t.next=21,ht(this,(function(t){return t!=Q}));case 21:if((i=t.sent).status==X){t.next=24;break}throw"wrong DFU status: "+i.status;case 24:t.next=29;break;case 26:throw t.prev=26,t.t0=t.catch(1),new ot("ERASE SEGMENT failed at address "+r+" --\x3e "+t.t0);case 29:case"end":return t.stop()}}),t,this,[[1,26]])})));return function(e){return t.apply(this,arguments)}}(),this.TransferSize=n,this.device=r;var o,i=_(r.configurations);try{for(i.s();!(o=i.n()).done;){var a,s=o.value,c=_(s.interfaces);try{for(c.s();!(a=c.n()).done;){var u,l=a.value,f=_(l.alternates);try{for(f.s();!(u=f.n()).done;){var h=u.value;if(254==h.interfaceClass&&1==h.interfaceSubclass&&(1==h.interfaceProtocol||2==h.interfaceProtocol))return this.settings={configuration:s,interface:l,alternate:h},this}}catch(t){f.e(t)}finally{f.f()}}}catch(t){c.e(t)}finally{c.f()}}}catch(t){i.e(t)}finally{i.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}return E(t,null,[{key:"Parse",value:function(t){new DataView(t);var e=new TextDecoder("utf-8").decode(new Uint8Array(t.slice(H.Signature.Offset,H.Signature.Offset+H.Signature.Size)));if("DfuSe"!=e)throw new ot("Parsed file is not a DFU file (invalid signature)");var r=t.slice(G.Offset);if("Target"!=(e=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(G.TargetPrefix.Signature.Offset,G.TargetPrefix.Signature.Size)))))throw new ot("Corrupted DFU file (invalid target signature)");for(var n=[],o=new DataView(r,G.TargetPrefix.NbElements.Offset,G.TargetPrefix.NbElements.Offset+G.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(G.Element.Offset),a=0;a<o;a++){var s=new DataView(i,G.Element.Address.Offset,G.Element.Address.Offset+G.Element.Address.Size).getUint32(0,!0),c=new DataView(i,G.Element.Size.Offset,G.Element.Address.Offset+G.Element.Size.Size).getUint32(0,!0),u=i.slice(G.Element.Data.Offset,G.Element.Data.Offset+c);i=i.slice(G.Element.Data.Offset+c),n.push({address:s,size:c,data:u})}return n}}]),t}();function _t(t){return new TextDecoder("utf-8").decode(t.subarray(0,t.indexOf(0)))}function yt(t){var e=new TextEncoder("utf-8").encode(t),r=new Uint8Array(e.length+1);return r.set(e,0),r.set([0],e.length),r}function gt(t){for(var e=new Uint8Array(t.length/2),r=0;r<e.length;r++)e[r]=parseInt(t.substr(2*r,2),16);return e}function wt(t){for(var e=atob(t),r="",n=0;n<e.length;n++){var o=e.charCodeAt(n).toString(16);r+=2===o.length?o:"0"+o}return r.toUpperCase()}function bt(t){return btoa(t.match(/\w{2}/g).map((function(t){return String.fromCharCode(parseInt(t,16))})).join(""))}function Et(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function St(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function xt(t,e,r){return e&&St(t.prototype,e),r&&St(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function At(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ct(t,e){return Ct=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ct(t,e)}function Ft(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Tt(t);if(e){var o=Tt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pt(this,r)}}function Pt(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Tt(t){return Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Tt(t)}var Ot=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ct(t,e)}(r,t);var e=Ft(r);function r(){At(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"StorageError"].concat(n))}return xt(r)}(p);function Rt(t){return new DataView(t.buffer,t.byteOffset).getUint16(0,!0)}function Dt(t){var e={size:0,name:"unknown",content:"unknown"};return e.size=Rt(t),e.name=_t(t.subarray(2)),e.content=t.subarray(2+e.name.length+1,e.size),e}var jt=function(t){function e(t){At(this,e),this.records=t}return xt(e,[{key:Symbol.iterator,value:function(){var t=this.records;return{next:function(){var e=Rt(t);if(0===e)return{done:!0};var r=Dt(t);return t=t.subarray(e),{value:r,done:!1}}}}}]),e}();const It=xt((function t(e){At(this,t),this.availableSize=function(){var t,e=0,r=Et(new jt(this.data));try{for(r.s();!(t=r.n()).done;){e+=t.value.size}}catch(t){r.e(t)}finally{r.f()}return this.totalSize()-e},this.totalSize=function(){return this.data.byteLength-2},this.recordsWithExtension=function(t){var e,r=[],n=Et(new jt(this.data));try{for(n.s();!(e=n.n()).done;){var o=e.value;o.name.endsWith(t)&&r.push(o.name)}}catch(t){n.e(t)}finally{n.f()}return r},this.size=function(t){var e,r=Et(new jt(this.data));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.name===t)return n.size}}catch(t){r.e(t)}finally{r.f()}},this.content=function(t){var e,r=Et(new jt(this.data));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.name===t)return n.content}}catch(t){r.e(t)}finally{r.f()}},this.setContent=function(t,e){var r,n=0,o=0,i=Et(new jt(this.data));try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.name===t){o=a.size;break}n+=a.size}}catch(t){i.e(t)}finally{i.f()}var s=this.data.slice(n+o),c=n,u=function(t,e){if(void 0!==e){var r=t.length+1+e.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(yt(t),2),n.set(e,2+t.length+1),n}}(t,e);if(void 0!==u){if(Dt(u).size>this.availableSize()+o)throw new Ot("The storage on calculator is full");this.data.set(u,n),c+=u.length,s=s.slice(0,this.data.length-(n+u.length))}this.data.set(s,c),this.data.fill(0,c+s.length)},this.data=e}));function Lt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Nt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Bt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Mt(i,n,o,a,s,"next",t)}function s(t){Mt(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ut(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zt(t,e,r){return e&&Ut(t.prototype,e),r&&Ut(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vt(t,e)}function Vt(t,e){return Vt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Vt(t,e)}function qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yt(t);if(e){var o=Yt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wt(this,r)}}function Wt(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}var Kt=r(3786),$t=2048,Xt=gt("F00DC0DE"),Zt=gt("FEEDC0DE"),Qt=gt("BADBEEEF"),Jt=function(t){Gt(r,t);var e=qt(r);function r(){Ht(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"CalculatorMemoryCorruption"].concat(n))}return zt(r)}(p),te=function(t){Gt(r,t);var e=qt(r);function r(){Ht(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"BusyCalculatorError"].concat(n))}return zt(r)}(p),ee=function(t){Gt(r,t);var e=qt(r);function r(){Ht(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"WebUSBError"].concat(n))}return zt(r)}(p),re=function(t){Gt(r,t);var e=qt(r);function r(){Ht(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"USBConnectionError"].concat(n))}return zt(r)}(p),ne=function(t){Gt(r,t);var e=qt(r);function r(){Ht(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"ForbiddenMemoryAccessError"].concat(n))}return zt(r)}(p),oe=function(t){Gt(r,t);var e=qt(r);function r(){Ht(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"DeviceDetectionError"].concat(n))}return zt(r)}(p),ie=function(t){Gt(r,t);var e=qt(r);function r(t){var n;Ht(this,r);for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return(n=e.call.apply(e,[this,"BulkError"].concat(i))).errors=t,n}return zt(r)}(p),ae={N0100:{name:"N0100",ElectronicSignatureAddress:536836624,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",ElectronicSignatureAddress:535853584,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",ElectronicSignatureAddress:535947264,RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",ElectronicSignatureAddress:535947264,name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},se=gt("BADD0BEE");function ce(t){for(var e="",r=0;r<t.byteLength;r++)e+=t[r].toString(16).padStart(2,"0").toUpperCase();return e}function ue(t,e){if(t.length<e.length)return!1;for(var r=0;r<e.length;r++)if(t[r]!==e[r])return!1;return!0}function le(t,e){return!(t.length<e.length)&&ue(t.subarray(t.length-e.length),e)}function fe(t,e){if(!(t>=134217728&&t+e<=135266304||t>=2415919104&&t+e<=2424307712))throw new ne("Access to address: "+t+" (length "+e+") is out of flash range")}function he(t,e,r){if(e<t.RAMAddressStart||e+r>=t.RAMAddressEnd)throw new ne("Access to address: "+e+" (length "+r+") is out of RAM range")}function pe(t){if(v.info("Calculator","parseSlotInfo","header info "+t),!ue(t,Qt)||!le(t,Qt))return null;var e=new DataView(t.buffer,t.byteOffset);return{kernelHeaderAddress:e.getUint32(4,!0),userlandHeaderAddress:e.getUint32(8,!0)}}function de(t,e){if(v.info("Calculator","parseFirmwareHeader","header "+t),!ue(t,Xt))return e;e.version=_t(t.subarray(4)),e.patch=_t(t.subarray(12));var r=t.subarray(20);if(ue(r,Xt))return e;var n=new DataView(t.buffer,t.byteOffset);return e.storageAddress=n.getUint32(20,!0),ue(r=t.subarray(24),Xt)||(e.storageSize=n.getUint32(24,!0)),e}function me(t,e){if(v.info("Calculator","parseUserlandHeader","header "+t),!ue(t,Zt))return e;e.userlandVersion=_t(t.subarray(4));var r=new DataView(t.buffer,t.byteOffset),n=12;return e.storageAddress=r.getUint32(n,!0),n+=4,e.storageSize=r.getUint32(n,!0),n+=4,e.externalAppsFlashStart=r.getUint32(n,!0),n+=4,e.externalAppsFlashEnd=r.getUint32(n,!0),n+=4,e.externalAppsRamStart=r.getUint32(n,!0),n+=4,e.externalAppsRamEnd=r.getUint32(n,!0),e}function ve(){return(ve=Bt(e().mark((function t(r,n,o){var i,a,s,c,u,l,f,h;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("Calculator","uploadHeader","address "+Number(n[0].address).toString(16)),i={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",trampolineAddress:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",storageAddress:"unknown",storageSize:4096},t.prev=2,a=n[0].address+ke.Header0.Offset,s=ke.Header0.Size,fe(a,s),t.next=8,r.upload(a,s);case 8:if(!ue(c=t.sent,Xt)||!le(c,Xt)){t.next=13;break}return t.abrupt("return",de(c,i));case 13:return a=n[0].address+ke.Header1.Offset,s=ke.Header1.Size,fe(a,s),t.next=18,r.upload(a,s);case 18:if(!ue(c=t.sent,Xt)||!le(c,Xt)){t.next=23;break}return t.abrupt("return",de(c,i));case 23:return a=o.RAMAddressStart,s=ke.Header2.SlotInfoSize,he(o,a,s),t.prev=26,t.next=29,r.upload(a,s);case 29:if(u=t.sent,null!=(l=pe(u))){t.next=33;break}throw new Jt("The slot info was corrupted");case 33:return a=l.kernelHeaderAddress,s=ke.Header2.KernelHeaderSize,fe(a,s),t.next=38,r.upload(a,s);case 38:return f=t.sent,i=de(f,i),a=l.userlandHeaderAddress,s=ke.Header2.UserlandHeaderSize,fe(a,s),t.next=45,r.upload(a,s);case 45:return h=t.sent,i.trampolineAddress=l.userlandHeaderAddress+ke.Header2.UserlandHeaderSize+ke.Header2.UserlandISRSize,i=me(h,i),t.abrupt("return",i);case 51:return t.prev=51,t.t0=t.catch(26),t.abrupt("return",de(c,i));case 54:t.next=60;break;case 56:throw t.prev=56,t.t1=t.catch(2),t.t1.message="Upload header failed --\x3e "+t.t1.message,t.t1;case 60:case"end":return t.stop()}}),t,null,[[2,56],[26,51]])})))).apply(this,arguments)}function _e(){return _e=Bt(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(16!=(o=r.device.serialNumber).length){t.next=3;break}return t.abrupt("return",o);case 3:return t.next=5,r.upload(n.ElectronicSignatureAddress-1,13);case 5:return i=t.sent,t.abrupt("return",bt(ce(i.subarray(1,13))));case 7:case"end":return t.stop()}}),t)}))),_e.apply(this,arguments)}function ye(t,e){return ge.apply(this,arguments)}function ge(){return ge=Bt(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v.info("Calculator","calculatorGetStorage","address "+Number(n.firmware.storageAddress).toString(16)),"unknown"!==n.firmware.storageAddress){t.next=3;break}throw new Jt("The Storage address could not be found in header");case 3:t.prev=3,he(n.model,n.firmware.storageAddress,n.firmware.storageSize+2*se.length),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(3),new Jt("Calculator Get Storage failed --\x3e "+t.t0);case 10:if(!1===r.storage){t.next=12;break}return t.abrupt("return",r.storage);case 12:return t.prev=12,t.next=15,r.dfu.upload(n.firmware.storageAddress,n.firmware.storageSize+2*se.length);case 15:if(!ue(o=t.sent,se)||!le(o,se)){t.next=22;break}return i=o.subarray(se.length,n.firmware.storageSize+se.length),r.storage=new It(i),t.abrupt("return",r.storage);case 22:throw new Jt("Memory is corrupted: could not find storage tags");case 23:t.next=29;break;case 25:throw t.prev=25,t.t1=t.catch(12),t.t1.message="CalculationGetStorage failed --\x3e "+t.t1.message,t.t1;case 29:case"end":return t.stop()}}),t,null,[[3,7],[12,25]])}))),ge.apply(this,arguments)}function we(t,e,r){return be.apply(this,arguments)}function be(){return be=Bt(e().mark((function t(r,n,o){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:v.info("Calculator","calculatorSetStorage","address "+Number(n.firmware.storageAddress).toString(16)),t.prev=1,he(n.model,n.firmware.storageAddress+se.length,o.data),t.next=8;break;case 5:throw t.prev=5,t.t0=t.catch(1),new Jt("Calculator Set Storage failed --\x3e "+t.t0);case 8:return t.prev=8,t.next=11,r.dfu.download(n.firmware.storageAddress+se.length,o.data);case 11:t.next=17;break;case 13:throw t.prev=13,t.t1=t.catch(8),t.t1.message="CalculationSetStorage failed --\x3e "+t.t1.message,t.t1;case 17:case"end":return t.stop()}}),t,null,[[1,5],[8,13]])}))),be.apply(this,arguments)}function Ee(t){var e=yt(t),r=new Uint8Array(e.length+1);return r[0]=1,r.set(e,1),r}var ke=function(){function t(e,r){Ht(this,t),this.dfu=new vt(e,r),this.running=!1,this.storage=!1,this.infos=!1}return zt(t,[{key:"process",value:function(t){var e,r=this;return v.info("Calculator","process"),new Kt((function(n,o){if(r.running)return o(new te("Calculator is already processing another request"));r.running=!0,r.dfu.open().then((function(){return t(r)})).then((function(t){if(e=t,r.dfu.device.opened)return r.dfu.close()})).then((function(){return r.running=!1,n(e)})).catch((function(t){return r.running=!1,o(t)}))}))}},{key:"reconnectAndProcess",value:function(e,r){var n=this;return new Kt((function(o,i){return v.info("Calculator","reconnect"),null==navigator.usb?i(new ee("Web usb unvailable")):t.StallUntilConnect(n.dfu.device.serialNumber,e).then((function(t){return t.process(r)})).then((function(t){o(t)})).catch((function(t){i(t)}))}))}},{key:"extractInfos",value:function(){var t=this;return v.info("Calculator","extractInfos"),new Kt((function(e,r){var n,o,i;return!1!==t.infos?e(t):t.dfu.getMemoryLayout().then((function(e){return n=e,o=function(t,e){if("NumWorks Calculator"==t.productName&&2==t.deviceVersionMinor)return"EAAbABVROTUxNDM4"==t.serialNumber?ae.N0120Prototype:ae.N0120;var r=e[e.length-1].lastAddress;return r>135135232&&r<2415919104?ae.N0100:ae.N0110}(t.dfu.device,n),function(t,e,r){return ve.apply(this,arguments)}(t.dfu,n,o)})).then((function(e){return i=e,function(t,e){return _e.apply(this,arguments)}(t.dfu,o)})).then((function(r){return t.infos={serialNumber:wt(r),displayedSerialNumber:r,model:o,memoryLayout:n,firmware:i},e(t)})).catch((function(t){t.message="extractInfos failed --\x3e "+t.message,r(t)}))}))}},{key:"uploadFlash",value:function(t,e,r){var n=this;return v.info("Calculator","uploadFlash","address "+Number(t).toString(16),"length "+Number(e).toString(16)),new Kt((function(o,i){try{fe(t,e)}catch(t){t.message="uploadFlash failed --\x3e "+t.message,i(t)}n.dfu.upload(t,e,r).then((function(t){o(t)})).catch((function(t){t.message="uploadFlash failed --\x3e "+t.message,i(t)}))}))}},{key:"downloadFlash",value:function(t,r,n,o,i){var a=this;return v.info("Calculator","downloadFlash","address "+Number(t).toString(16)),new Kt((function(s,c){var u=function(){var t=Bt(e().mark((function t(r,n,o,i,a){var s,c,u,l,f,h,p,d,m,v,_,y,g;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=0,c=0,u=-1,l=-1,f=-1,h=-1,p=0;case 7:if(!(p<n.length)){t.next=33;break}if(!(u<0)){t.next=14;break}if(!(o>n[p].lastAddress)){t.next=13;break}return t.abrupt("continue",30);case 13:u=p;case 14:d=0;case 15:if(!(d<n[p].nbPage)){t.next=30;break}if(!(l<0)){t.next=22;break}if(o!=n[p].address+d*n[p].pageSize){t.next=21;break}l=d,t.next=22;break;case 21:return t.abrupt("continue",27);case 22:if(!((s+=n[p].pageSize)>=i.byteLength)){t.next=27;break}return f=p,h=d,t.abrupt("break",33);case 27:d++,t.next=15;break;case 30:p++,t.next=7;break;case 33:m=u;case 34:if(!(m<=f)){t.next=51;break}v=m==u?l:0,_=m==f?h+1:n[m].nbPage,y=v;case 38:if(!(y<_)){t.next=48;break}return g=n[m].address+y*n[m].pageSize,t.next=42,r.eraseSegment(g);case 42:c+=n[m].pageSize,a(c/s),g+=n[m].pageSize;case 45:y++,t.next=38;break;case 48:m++,t.next=34;break;case 51:case"end":return t.stop()}}),t)})));return function(e,r,n,o,i){return t.apply(this,arguments)}}();try{fe(t,r.byteLength)}catch(t){t.message="downloadFlash failed --\x3e "+t.message,c(t)}u(a.dfu,n.memoryLayout,t,r,(function(t){return o(t)})).then((function(){s(a.dfu.download(t,r,(function(t){return i(t)})))})).catch((function(t){t.message="downloadFlash failed --\x3e "+t.message,c(t)}))}))}},{key:"reset",value:function(t){var e=this;return v.info("Calculator","reset"),new Kt((function(r,n){try{fe(t.memoryLayout[0].address,0)}catch(t){t.message="reset failed --\x3e "+t.message,n(t)}return e.dfu.leave(134217728).then((function(){r(!0)})).catch((function(t){t.message="reset failed --\x3e "+t.message,n(t)}))}))}},{key:"getAvailableSpaceInfo",value:function(){var t=this;return v.info("Calculator","getAvailableSpaceInfo"),new Kt((function(e,r){var n={availableSize:!1,totalSize:!1};t.extractInfos().then((function(e){return ye(t,e.infos)})).then((function(t){n.availableSize=t.availableSize(),n.totalSize=t.totalSize(),e(n)})).catch((function(t){t.message="getAvailableSpaceInfo failed --\x3e "+t.message,r(t)}))}))}},{key:"getScripts",value:function(){var t=this;return v.info("Calculator","getScripts"),new Kt((function(e,r){t.extractInfos().then((function(e){return ye(t,e.infos)})).then((function(t){return t.recordsWithExtension(".py").map((function(e,r){return{name:e,size:t.size(e),content:_t(t.content(e).subarray(1))}}))})).then((function(t){e(t)})).catch((function(t){t.message="getScripts failed --\x3e "+t.message,r(t)}))}))}},{key:"removeScripts",value:function(){var t=this;return v.info("Calculator","removeScripts"),new Kt((function(e,r){t.extractInfos().then((function(e){return ye(t,e.infos)})).then((function(e){e.recordsWithExtension(".py").map((function(t,r){e.setContent(t)}));return we(t,t.infos,e)})).then((function(){e(!0)})).catch((function(t){t.message="removeScripts failed --\x3e "+t.message,r(t)}))}))}},{key:"getSizeForRecord",value:function(t){var e=this;return v.info("Calculator","getSizeForRecord","name "+t),new Kt((function(r,n){var o;e.extractInfos().then((function(t){return ye(e,t.infos)})).then((function(e){o=e.size(t),r(o)})).catch((function(t){t.message="getSizeForRecord failed --\x3e "+t.message,n(t)}))}))}},{key:"setContentForRecord",value:function(t,e){var r=this;return v.info("Calculator","setContentForRecord","name "+t),new Kt((function(n,o){r.extractInfos().then((function(t){return ye(r,t.infos)})).then((function(n){try{n.setContent(t,e)}catch(t){o(t)}return we(r,r.infos,n)})).then((function(){n(!0)})).catch((function(t){t.message="setContentForRecord failed --\x3e "+t.message,o(t)}))}))}},{key:"setContentForScript",value:function(t,e){var r=this;return v.info("Calculator","setContentForScript","name "+t),new Kt((function(n,o){r.setContentForRecord(t,Ee(e)).then((function(){n(!0)})).catch((function(t){t.message="setContentForScript failed --\x3e "+t.message,o(t)}))}))}},{key:"setRecords",value:function(t){var e=this;return v.info("Calculator","setRecords",t),new Kt((function(r,n){e.extractInfos().then((function(t){return ye(e,t.infos)})).then((function(e){try{t.forEach((function(t,r){e.setContent(t.name,t.content)}))}catch(t){n(t)}return e})).then((function(t){return we(e,e.infos,t)})).then((function(){r(!0)})).catch((function(t){t.message="setRecords failed --\x3e "+t.message,n(t)}))}))}},{key:"setScripts",value:function(t){var e=this;return v.info("Calculator","setScripts",t),new Kt((function(r,n){var o=[];t.forEach((function(t,e){o[e]={name:t.name,content:Ee(t.content)}})),e.setRecords(o).then((function(){r(!0)})).catch((function(t){t.message="setScripts failed --\x3e "+t.message,n(t)}))}))}},{key:"removeRecord",value:function(t){var e=this;return v.info("Calculator","removeRecord","name "+t),new Kt((function(r,n){e.extractInfos().then((function(t){return ye(e,t.infos)})).then((function(r){return r.setContent(t),we(e,e.infos,r)})).then((function(){r(!0)})).catch((function(t){t.memory="removeRecord failed --\x3e "+t.message,n(t)}))}))}}],[{key:"DisplayableFirmwarePatch",value:function(t){return"badbabe"==t?"unofficial":t}},{key:"CheckFirmware",value:function(t,e){for(var r=0;r<e.byteLength;r++)if(t[r]!=e[r])throw new Jt("The uploaded firmware differs from the reference at byte "+r);return!0}},{key:"StallUntilConnect",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return v.info("Calculator","StallUntilConnect"),new Kt((function(o,i){return n>60?i(new oe("Device detection timed out")):navigator.usb.getDevices().then((function(a){var s,c=Lt(a);try{for(c.s();!(s=c.n()).done;){var u=s.value;if(u.serialNumber===e)return r(1),o(new t(u,$t))}}catch(t){c.e(t)}finally{c.f()}return r((n-1)/n),setTimeout((function(){return t.StallUntilConnect(e,r,n+1).then((function(t){o(t)})).catch((function(t){i(t)}))}),1e3)})).catch((function(t){i(t)}))}))}}]),t}();ke.Header0={Offset:428,Size:24},ke.Header1={Offset:452,Size:32},ke.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40,UserlandISRSize:8},ke.Product={Numworks:"numworks",ST:"ST"};var Se=function(){function t(){Ht(this,t),this.calculators=[]}return zt(t,[{key:"singleConnectAndExtractInfos",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1==this.calculators.length&&null!=this.calculators[0].info?this.calculators[0]:this.connectAndProcess((function(t){return t.extractInfos()}),!1,[ke.Product.Numworks],t).then((function(t){return t[0]}))}},{key:"connectAndProcess",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[ke.Product.Numworks],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v.info("CalculatorBulk","connectAndProcess");var i=[];return new Kt((function(a,s){r.connect(n,e,o).then((function(e){return r.connected()?Kt.map(e,(function(e){return e.process(t).catch((function(t){i.push({serialNumber:e.infos.serialNumber,error:t})}))})).then((function(t){if(i.length>0){if(1==e.length)throw i[0].error;throw new ie(i)}return a(t)})):s(new re("No usb connection found"))})).catch((function(t){s(t)}))}))}},{key:"connected",value:function(){return this.calculators.length>0}},{key:"connect",value:function(e,r,n){var o=this;return new Kt((function(i,a){t.Connect(e,n).then((function(t){o.calculators=r||0==t.length?t:[t[0]],i(o.calculators)})).catch((function(t){t.memory="connect failed --\x3e "+t.message,a(t)}))}))}}],[{key:"Connect",value:function(t,e){v.info("CalculatorBulk","connect",t);var r=[],n=t.map((function(t){return t==ke.Product.Numworks?41617:57105})),o=[];return n.forEach((function(t){return o.push({vendorId:1155,productId:t})})),new Kt((function(t,i){if(null==navigator.usb)return i(new ee("Web usb unvailable"));e?(v.info("CalculatorBulk","connect","request device"),navigator.usb.requestDevice({filters:o}).then((function(e){return r.push(new ke(e,$t)),t(r)})).catch((function(t){i(new re("Usb device selection failure: "+t))}))):(v.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(e){var o,i=Lt(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;1155===a.vendorId&&n.includes(a.productId)&&r.push(new ke(a,$t))}}catch(t){i.e(t)}finally{i.f()}return t(r)})).catch((function(t){i(new re("Usb device failed: "+t))})))}))}}]),t}();r(382);var xe=r(5405),Ae=r(5477),Ce=r(3825),Fe=r.n(Ce);function Pe(t){return new Promise(((e,n)=>{let o={locateFile:function(t,e){return r(3835)},preRun:function(){o.FS.writeFile("input.dat",t.input)},onAbort:n,arguments:t.arguments.concat(["input.dat","output.dat"]),postRun:function(){e(o.FS.readFile(t.output||"output.dat"))}};Fe()(o)}))}function Te(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Oe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Re(t,e){return Math.round(255/((1<<e)-1)*t)}var De=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rgba8888Data=e}var r,n,o,i,a;return r=t,n=[{key:"toPNG",value:function(){if("function"==typeof ImageData){var e=new ImageData(new Uint8ClampedArray(this.rgba8888Data.buffer),t.Width,t.Height),r=document.createElement("canvas");return r.width=t.Width,r.height=t.Height,r.getContext("2d").putImageData(e,0,0),r.toDataURL()}console.error("ImageData is unavailable")}},{key:"toNWI",value:function(){var t=function(t){for(var e=t.length/4,r=new Uint8Array(2*e),n=0;n<e;n++){var o=t[4*n]>>3<<11|t[4*n+1]>>2<<5|t[4*n+2]>>3;r[2*n]=255&o,r[2*n+1]=o>>8&255}return r}(this.rgba8888Data),e=xe.compressBlock(t,new Uint8Array(0),0,t.length,xe.makeBuffer(65536)),r=new Uint8Array(e);return xe.compressBlock(t,r,0,t.length,xe.makeBuffer(65536)),r}},{key:"toIconO",value:(i=e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Pe({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_app_icon","--redefine-sym","_binary_input_dat_start=eadk_app_icon","--strip-symbol","_binary_input_dat_end","--strip-symbol","_binary_input_dat_size"],input:this.toNWI()});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),a=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){Te(o,r,n,a,s,"next",t)}function s(t){Te(o,r,n,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})}],o=[{key:"fromPNG",value:function(e){var r=Ae.y.sync.read(e);if(r.width!=t.Width)throw"Icon has an invalid width";if(r.height!=t.Height)throw"Icon has an invalid height";return new t(r.data)}},{key:"fromNWI",value:function(e){var r=new Uint8Array(t.Width*t.Height*2);xe.decompressBlock(e,r,0,e.length,0);var n=function(t){for(var e=t.length/2,r=new Uint8Array(4*e),n=0;n<e;n++){var o=t[2*n+1]<<8|t[2*n],i=o>>11&31,a=o>>5&63,s=31&o;r[4*n]=Re(i,5),r[4*n+1]=Re(a,6),r[4*n+2]=Re(s,5),r[4*n+3]=255}return r}(r);return new t(n)}}],n&&Oe(r.prototype,n),o&&Oe(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();De.Width=55,De.Height=56;const je=De;var Ie=r(7481),Le=r.n(Ie);function Ne(t){return new Promise(((e,n)=>{let o={locateFile:function(t,e){return r(7573)},preRun:function(){for(const[e,r]of Object.entries(t.inputs))o.FS.writeFile(e,r)},printErr:function(t){o.errorLog||="",o.errorLog=o.errorLog.concat(t).concat("\n")},onAbort:n,arguments:t.arguments.concat(["--output","output.elf"]),postRun:function(){o.errorLog?n(o.errorLog):e(o.FS.readFile("output.elf"))}};Le()(o)}))}function Me(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Be(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Me(i,n,o,a,s,"next",t)}function s(t){Me(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ue(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ze(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var He=0;function Ge(t){return"__private_"+He+++"_"+t}var Ve=r(7475),qe=r(8006),We=Ge("getSectionNamed"),Ye=Ge("refreshSizeAndNeedOfExternalData"),Ke=Ge("externalObject"),$e=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,Ke,{value:Je}),Object.defineProperty(this,Ye,{value:Qe}),Object.defineProperty(this,We,{value:Xe}),this.nwaData=e,this.size=void 0,this.name=void 0,this.icon=void 0,this.needsExternalData=void 0}var r,n,o,i,a;return r=t,n=[{key:"loadIcon",value:function(){var t=this;return ze(this,We)[We](".rodata.eadk_app_icon").then((function(e){return t.icon=je.fromNWI(e).toPNG()}))}},{key:"loadName",value:function(){var t=this;return ze(this,We)[We](".rodata.eadk_app_name").then((function(e){return t.name=_t(e)}))}},{key:"load",value:function(){this.loadIcon(),this.loadName(),ze(this,Ye)[Ye]()}},{key:"setExternalData",value:function(t){this.externalData=t,ze(this,Ye)[Ye]()}},{key:"flatElf",value:(a=Be(e().mark((function t(r){var n,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n={arguments:["--script","linker.ld","--gc-sections","--allow-multiple-definition","eadk.o","app.nwa"],inputs:{"linker.ld":Ve(r),"app.nwa":this.nwaData,"eadk.o":new Uint8Array(qe.data)}},!this.externalData){t.next=7;break}return o="extra-data.o",n.arguments.push(o),t.next=6,ze(this,Ke)[Ke]();case 6:n.inputs[o]=t.sent;case 7:return t.next=9,Ne(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"flatBin",value:(i=Be(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Pe,t.t1=["--output-target","binary"],t.next=4,this.flatElf(r);case 4:return t.t2=t.sent,t.t3={arguments:t.t1,input:t.t2},t.next=8,(0,t.t0)(t.t3);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}],n&&Ue(r.prototype,n),o&&Ue(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function Xe(t){return Ze.apply(this,arguments)}function Ze(){return(Ze=Be(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Pe({arguments:["--output-target","binary","--only-section",r],input:this.nwaData});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Qe(){var t=this;this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144,trampolineStart:2415984688}).then((function(e){var r=e.byteLength+($e.AppSectorSize-e.byteLength%$e.AppSectorSize);t.size=r,t.needsExternalData=!1})).catch((function(e){if(!e.includes("_eadk_external_data"))throw e;t.size=void 0,t.needsExternalData=!0}))}function Je(){return Pe({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_external_data,alloc,load,readonly,data,contents","--redefine-sym","_binary_input_dat_start=_eadk_external_data_start","--redefine-sym","_binary_input_dat_size=_eadk_external_data_size","--strip-symbol","_binary_input_dat_end"],input:this.externalData})}$e.AppSectorSize=65536;const tr=$e;function er(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function rr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){er(i,n,o,a,s,"next",t)}function s(t){er(i,n,o,a,s,"throw",t)}a(void 0)}))}}function nr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return or(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return or(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ar(t,e,r){return e&&ir(t.prototype,e),r&&ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function sr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cr(t,e){return cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},cr(t,e)}function ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=fr(t);if(e){var o=fr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return lr(this,r)}}function lr(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fr(t){return fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},fr(t)}var hr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cr(t,e)}(r,t);var e=ur(r);function r(){sr(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"CalculatorMemoryOverflow"].concat(n))}return ar(r)}(p),pr=function(){function t(){sr(this,t),this.apps=[]}var r,n;return ar(t,[{key:"push",value:function(t){this.apps.push(t)}},{key:"isReadyToUpload",value:function(){var t,e=nr(this.apps);try{for(e.s();!(t=e.n()).done;){if(t.value.needsExternalData)return!1}}catch(t){e.e(t)}finally{e.f()}return this.apps.length>0}},{key:"upload",value:(n=rr(e().mark((function t(r,n){var o,i,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.infos.firmware,i={flashStart:o.externalAppsFlashStart,flashLength:o.externalAppsFlashEnd-o.externalAppsFlashStart,ramStart:o.externalAppsRamStart,ramLength:o.externalAppsRamEnd-o.externalAppsRamStart,trampolineStart:o.trampolineAddress},t.next=4,this.flatBin(i);case 4:a=t.sent,r.process((function(t){return t.downloadFlash(i.flashStart,a,r.infos,(function(t){n(.2*t)}),(function(t){n(.2+.8*t)})).then((function(){return r.dfu.leave(i.flashStart)}))}));case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"concatenateU8A",value:function(t,e){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(t,0),r.set(e,t.byteLength),r}},{key:"flatBin",value:(r=rr(e().mark((function t(r){var n,o,i,a,s,c,u,l,f,h,p;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Uint8Array(0),o=r.flashStart+r.flashLength,i=r.flashStart,a=nr(this.apps),t.prev=4,a.s();case 6:if((s=a.n()).done){t.next=19;break}if(c=s.value,!(i>=o)){t.next=10;break}throw new hr("External app sector would be overflown");case 10:return t.next=12,c.flatBin({flashStart:i,flashLength:o-i,ramStart:r.ramStart,ramLength:r.ramLength,trampolineStart:r.trampolineStart});case 12:u=t.sent,n=this.concatenateU8A(n,u),i+=u.byteLength,(l=u.byteLength%tr.AppSectorSize)>0&&(f=tr.AppSectorSize-l,(h=new Uint8Array(f)).fill(255),n=this.concatenateU8A(n,h),i+=f);case 17:t.next=6;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(4),a.e(t.t0);case 24:return t.prev=24,a.f(),t.finish(24);case 27:return i<o&&((p=new Uint8Array(tr.AppSectorSize)).fill(255),n=this.concatenateU8A(n,p)),t.abrupt("return",n);case 29:case"end":return t.stop()}}),t,this,[[4,21,24,27]])}))),function(t){return r.apply(this,arguments)})},{key:"totalSize",value:function(){var t,e=0,r=nr(this.apps);try{for(r.s();!(t=r.n()).done;){e+=t.value.size||0}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"removeAppAtIndex",value:function(t){this.apps.splice(t,1)}}]),t}();const dr=pr,mr=r.p+"eadk/eadk.h",vr=require("child_process");function _r(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function yr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){_r(i,n,o,a,s,"next",t)}function s(t){_r(i,n,o,a,s,"throw",t)}a(void 0)}))}}var gr=r(1017),wr=gr.dirname,br=(gr.resolve,r(7147)),Er=r(7304).Command,kr=r(295);function Sr(t){var r=new Er;function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=br.readFileSync(t),n=new tr(r);if(e.externalData){var o=br.readFileSync(e.externalData);n.setExternalData(o)}return n}function o(){return o=yr(e().mark((function t(r,o){var i,a,s,c,u;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n(r,o),(a=new dr).push(i),s=new Se,t.next=6,s.singleConnectAndExtractInfos(!0);case 6:return c=t.sent,(u=new kr.SingleBar({stopOnComplete:!0,format:"Upload [{bar}] {percentage}% | ETA: {eta}s"})).start(1,0),t.next=11,a.upload(c,(function(t){u.update(t)}));case 11:case"end":return t.stop()}}),t)}))),o.apply(this,arguments)}function i(){return(i=yr(e().mark((function t(r,o,i){var a,s;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n(r,i),t.next=3,a.flatElf(i);case 3:s=t.sent,br.writeFileSync(o,s);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function a(){return(a=yr(e().mark((function t(r,o,i){var a,s;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n(r,i),t.next=3,a.flatBin(i);case 3:s=t.sent,br.writeFileSync(o,s);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function s(){return(s=yr(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=br.readFileSync(r),i=je.fromPNG(o),t.t0=br,t.t1=n,t.next=6,i.toIconO();case 6:t.t2=t.sent,t.t0.writeFileSync.call(t.t0,t.t1,t.t2);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version(require("../package.json").version),r.command("install-nwa").description("Install a NWA app").argument("<input.nwa>","Input NWA file").option("-d, --external-data <file>","External data file").action((function(t,e){return o.apply(this,arguments)})),r.command("nwa-elf").description("Link a NWA app").argument("<input.nwa>","Input NWA file").argument("<output.elf>","Output ELF file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").option("-ts, --trampoline-start <trampolineStart>","Trampoline start address","0x90010030").action((function(t,e,r){return i.apply(this,arguments)})),r.command("nwa-bin").description("Link a NWA app and convert to binary format").argument("<input.nwa>","Input NWA file").argument("<output.bin>","Output BIN file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").option("-ts, --trampoline-start <trampolineStart>","Trampoline start address","0x90010030").action((function(t,e,r){return a.apply(this,arguments)})),r.command("nwa-name").description("Print the name of a NWA app").argument("<input.nwa>","Input NWA file").action((function(t){n(t).loadName().then((function(t){return console.log(t)}))})),r.command("png-nwi").description("Convert a PNG file to a NWI image (LZ4-compressed RGB565)").argument("<file.png>","Input PNG file").argument("<file.nwi>","Output NWI file").action((function(t,e){var r=br.readFileSync(t),n=je.fromPNG(r);br.writeFileSync(e,n.toNWI())})),r.command("png-icon-o").description("Convert a PNG file to an ELF icon object (NWI data in a .rodata.eadk_app_icon ELF section)").argument("<file.png>","Input PNG file").argument("<file.o>","Output ELF object file").action((function(t,e){return s.apply(this,arguments)})),r.command("eadk-cflags").description("Print EADK CFLAGS").action((function(){var t=["-mthumb","-mfloat-abi=hard","-mcpu=cortex-m7","-mfpu=fpv5-sp-d16","-I"+wr(mr)];console.log(t.join(" "))})),r.command("view-eadk-h").description("Open eadk.h in $VISUAL or $EDITOR").action((function(){var t=process.env.VISUAL||process.env.EDITOR;t?(0,vr.execSync)("".concat(t," ").concat(mr),{stdio:"inherit"}):console.error("Please define $VISUAL or $EDITOR")})),r.parseAsync(t).catch((function(t){console.error(t.message||t),process.exit(1)}))}global.navigator={usb:o.webusb}})(),module.exports=n.default})();
|
|
1
|
+
(()=>{var t={8:(t,e,r)=>{"use strict";let n=r(9023),o=r(2203),i=r(6402),a=r(3769),s=t.exports=function(t){o.call(this);let e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,o),s.prototype.pack=function(t,e,r,n){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,r)),n&&this.emit("data",this._packer.packGAMA(n));let o=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}},83:(t,e,r)=>{if("undefined"!=typeof SHARED_CONFIG)r.p=SHARED_CONFIG.url_base.cdn+"/";else{var n=r(6928).resolve;r.p=n(__dirname)+"/"}},181:t=>{"use strict";t.exports=require("buffer")},255:(t,e,r)=>{var n=r(1144),o=2654435761,i=2246822519,a=3266489917,s=374761393;function c(t,e){return(t|=0)>>>(32-(e|=0)|0)|t<<e}function u(t,e,r){return t|=0,e|=0,r|=0,0|n.imul(t>>>(32-e|0)|t<<e,r)}function l(t,e){return(t|=0)>>>(e|=0)^t}function f(t,e,r,o,i){return u(n.imul(e,r)+t,o,i)}function h(t,e,r){return u(t+n.imul(e[r],s),11,o)}function p(t,e,r){return f(t,n.readU32(e,r),a,17,668265263)}function d(t,e,r){return[f(t[0],n.readU32(e,r+0),i,13,o),f(t[1],n.readU32(e,r+4),i,13,o),f(t[2],n.readU32(e,r+8),i,13,o),f(t[3],n.readU32(e,r+12),i,13,o)]}e.hash=function(t,e,r,u){var f,v;if(v=u,u>=16){for(f=[t+o+i,t+i,t,t-o];u>=16;)f=d(f,e,r),r+=16,u-=16;f=c(f[0],1)+c(f[1],7)+c(f[2],12)+c(f[3],18)+v}else f=t+s+u>>>0;for(;u>=4;)f=p(f,e,r),r+=4,u-=4;for(;u>0;)f=h(f,e,r),r++,u--;return(f=l(n.imul(l(n.imul(l(f,15),i),13),a),16))>>>0}},276:t=>{"use strict";t.exports=function(t,e,r){let n=t+e-r,o=Math.abs(n-t),i=Math.abs(n-e),a=Math.abs(n-r);return o<=i&&o<=a?t:i<=a?e:r}},290:t=>{"use strict";t.exports=require("async_hooks")},297:t=>{"use strict";t.exports=function(t){var e=!1,r=[];function n(){this._trace=new n.CapturedTrace(o())}function o(){var t=r.length-1;if(t>=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=o,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},336:(t,e,r)=>{"use strict";let n=r(6402),o=r(7613),i=t.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(t){let e=n.PNG_SIGNATURE;for(let r=0;r<e.length;r++)if(t[r]!==e[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),r=t.readUInt32BE(4),i="";for(let e=4;e<8;e++)i+=String.fromCharCode(t[e]);let a=Boolean(32&t[4]);if(this._hasIHDR||r===n.TYPE_IHDR){if(this._crc=new o,this._crc.write(Buffer.from(i)),this._chunks[r])return this._chunks[r](e);a?this.read(e+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+i))}else this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==e?this.error(new Error("Crc error - "+e+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),r=t.readUInt32BE(4),o=t[8],i=t[9],a=t[10],s=t[11],c=t[12];if(8!==o&&4!==o&&2!==o&&1!==o&&16!==o)return void this.error(new Error("Unsupported bit depth "+o));if(!(i in n.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==a)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==c&&1!==c)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let u=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:r,depth:o,interlace:Boolean(c),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:u,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let r=0;r<e;r++)this._palette.push([t[3*r],t[3*r+1],t[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(t.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},i.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(e);let r=t-e.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},i.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},401:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(2208),i=t.CancellationError,a=o.errorObj,s=r(1674)(n);function c(t,e,r){this.promise=t,this.type=e,this.handler=r,this.called=!1,this.cancelPromise=null}function u(t){this.finallyHandler=t}function l(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(t){if(!l(this,t))return a.e=t,a}function p(r){var o=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(o._boundValue()):s.call(o._boundValue(),r);if(c===n)return c;if(void 0!==c){o._setReturnedNonUndefined();var p=e(c,o);if(p instanceof t){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new i("late cancellation observer");return o._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new u(this))}return p._then(f,h,void 0,this,void 0)}}}return o.isRejected()?(l(this),a.e=r,a):(l(this),r)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new c(this,e,t),void 0)},t.prototype.lastly=t.prototype.finally=function(t){return this._passThrough(t,0,p,p)},t.prototype.tap=function(t){return this._passThrough(t,1,p)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,p);var n,i=new Array(r-1),a=0;for(n=0;n<r-1;++n){var c=arguments[n];if(!o.isObject(c))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+o.classString(c)));i[a++]=c}i.length=a;var u=arguments[n];return this._passThrough(s(i,u,this),1,void 0,p)},c}},403:(t,e,r)=>{"use strict";var n,o,i=r(7585),a=i.freeze,s=r(2208),c=s.inherits,u=s.notEnumerableProp;function l(t,e){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:e),u(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var f=l("Warning","warning"),h=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{n=TypeError,o=RangeError}catch(t){n=l("TypeError","type error"),o=l("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(d.prototype[v[y]]=Array.prototype[v[y]]);i.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var m=0;function g(t){if(!(this instanceof g))return new g(t);u(this,"name","OperationalError"),u(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(u(this,"message",t.message),u(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var t=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",o=n.split("\n"),i=0;i<o.length;++i)o[i]=t+o[i];e+=(n=o.join("\n"))+"\n"}return m--,e},c(g,Error);var _=Error.__BluebirdErrorTypes__;_||(_=a({CancellationError:h,TimeoutError:p,OperationalError:g,RejectionError:g,AggregateError:d}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:_,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error,TypeError:n,RangeError:o,CancellationError:_.CancellationError,OperationalError:_.OperationalError,TimeoutError:_.TimeoutError,AggregateError:_.AggregateError,Warning:f}},695:(t,e,r)=>{"use strict";let n=r(2582),o=r(276);function i(t,e,r){let n=t*e;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let a=t.exports=function(t,e){let r=t.width,o=t.height,a=t.interlace,s=t.bpp,c=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],a){let t=n.getImagePasses(r,o);for(let e=0;e<t.length;e++)this._images.push({byteWidth:i(t[e].width,s,c),height:t[e].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,c),height:o,lineIndex:0});this._xComparison=8===c?s:16===c?2*s:1};a.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},a.prototype._unFilterType1=function(t,e,r){let n=this._xComparison,o=n-1;for(let i=0;i<r;i++){let r=t[1+i],a=i>o?e[i-n]:0;e[i]=r+a}},a.prototype._unFilterType2=function(t,e,r){let n=this._lastLine;for(let o=0;o<r;o++){let r=t[1+o],i=n?n[o]:0;e[o]=r+i}},a.prototype._unFilterType3=function(t,e,r){let n=this._xComparison,o=n-1,i=this._lastLine;for(let a=0;a<r;a++){let r=t[1+a],s=i?i[a]:0,c=a>o?e[a-n]:0,u=Math.floor((c+s)/2);e[a]=r+u}},a.prototype._unFilterType4=function(t,e,r){let n=this._xComparison,i=n-1,a=this._lastLine;for(let s=0;s<r;s++){let r=t[1+s],c=a?a[s]:0,u=s>i?e[s-n]:0,l=s>i&&a?a[s-n]:0,f=o(u,c,l);e[s]=r+f}},a.prototype._reverseFilterLine=function(t){let e,r=t[0],n=this._images[this._imageIndex],o=n.byteWidth;if(0===r)e=t.slice(1,o+1);else switch(e=Buffer.alloc(o),r){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+r)}this.write(e),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=e,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},786:t=>{"use strict";t.exports={type:"Buffer",data:[127,69,76,70,1,1,1,0,0,0,0,0,0,0,0,0,1,0,40,0,1,0,0,0,0,0,0,0,0,0,0,0,80,15,0,0,0,0,0,5,52,0,0,0,0,0,40,0,46,0,45,0,6,73,10,104,16,68,8,96,5,73,136,66,33,191,12,34,4,75,26,96,79,240,255,50,16,70,112,71,0,0,0,0,0,0,0,0,0,0,0,0,0,32,112,71,1,32,112,71,79,240,255,48,112,71,0,32,112,71,0,32,112,71,79,240,255,48,112,71,79,246,255,115,19,181,8,70,0,147,5,73,0,35,20,70,9,104,26,70,255,247,254,255,32,70,2,176,16,189,0,191,0,0,0,0,11,74,12,75,12,73,155,26,1,59,9,210,11,74,0,33,11,75,155,26,1,59,8,210,0,33,8,70,255,247,254,191,17,248,1,11,2,248,1,11,238,231,2,248,1,27,241,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,223,112,71,16,181,1,223,4,70,224,178,16,189,16,181,45,223,4,70,32,70,16,189,130,176,2,171,3,233,3,0,19,223,2,176,112,71,130,176,2,171,3,233,3,0,20,223,2,176,112,71,130,176,2,171,3,233,3,0,18,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,0,34,0,35,19,181,108,70,205,233,0,35,34,223,32,96,97,96,212,233,0,1,2,176,16,189,0,34,0,35,19,181,108,70,205,233,0,35,33,223,32,96,97,96,212,233,0,1,2,176,16,189,16,181,23,223,4,70,160,178,16,189,50,223,112,71,49,223,112,71,0,34,0,35,19,181,108,70,205,233,0,35,48,223,32,96,97,96,212,233,0,1,2,176,16,189,51,180,5,76,189,248,16,80,36,104,4,149,36,104,1,145,164,70,2,176,48,188,96,71,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,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,45,50,48,50,48,45,113,52,45,109,97,106,111,114,41,32,49,48,46,50,46,49,32,50,48,50,48,49,49,48,51,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,45,50,48,50,48,45,113,52,45,109,97,106,111,114,41,32,49,48,46,50,46,49,32,50,48,50,48,49,49,48,51,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,45,50,48,50,48,45,113,52,45,109,97,106,111,114,41,32,49,48,46,50,46,49,32,50,48,50,48,49,49,48,51,32,40,114,101,108,101,97,115,101,41,0,65,51,0,0,0,97,101,97,98,105,0,1,41,0,0,0,5,55,69,45,77,0,6,13,7,77,9,2,10,8,18,4,20,1,21,1,23,3,24,1,25,1,26,1,27,1,28,1,30,4,34,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,3,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,37,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,0,0,0,28,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,32,0,0,0,0,0,0,0,0,0,10,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,48,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,4,0,0,0,24,0,0,0,0,0,0,0,0,0,27,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,42,0,7,0,0,0,1,0,0,0,10,0,0,0,18,0,23,0,22,0,0,0,1,0,0,0,14,0,0,0,18,0,17,0,45,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,51,0,0,0,1,0,0,0,14,0,0,0,18,0,18,0,250,0,0,0,0,0,0,0,4,0,0,0,17,0,35,0,82,0,0,0,1,0,0,0,4,0,0,0,18,0,4,0,89,0,0,0,1,0,0,0,26,0,0,0,18,0,22,0,118,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,152,0,0,0,1,0,0,0,4,0,0,0,18,0,5,0,160,0,0,0,1,0,0,0,6,0,0,0,18,0,6,0,166,0,0,0,1,0,0,0,28,0,0,0,18,0,27,0,191,0,0,0,1,0,0,0,40,0,0,0,18,0,2,0,197,0,0,0,1,0,0,0,4,0,0,0,18,0,25,0,216,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,228,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,249,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,18,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,37,1,0,0,1,0,0,0,68,0,0,0,18,0,12,0,44,1,0,0,1,0,0,0,4,0,0,0,18,0,8,0,51,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,80,1,0,0,1,0,0,0,10,0,0,0,18,0,16,0,92,1,0,0,1,0,0,0,14,0,0,0,18,0,19,0,115,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,137,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,142,1,0,0,1,0,0,0,4,0,0,0,18,0,24,0,161,1,0,0,0,0,0,0,4,0,0,0,17,0,33,0,180,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,203,1,0,0,1,0,0,0,26,0,0,0,18,0,21,0,222,1,0,0,1,0,0,0,36,0,0,0,18,0,10,0,229,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,255,1,0,0,1,0,0,0,26,0,0,0,18,0,26,0,18,2,0,0,1,0,0,0,4,0,0,0,18,0,7,0,24,2,0,0,1,0,0,0,10,0,0,0,18,0,20,0,53,2,0,0,1,0,0,0,4,0,0,0,18,0,14,0,83,2,0,0,1,0,0,0,10,0,0,0,18,0,15,0,109,2,0,0,1,0,0,0,6,0,0,0,18,0,9,0,0,36,116,0,36,100,0,101,97,100,107,95,101,118,101,110,116,95,103,101,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,101,114,114,110,111,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,95,102,115,116,97,116,0,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,104,101,97,112,95,101,110,100,0,95,105,115,97,116,116,121,0,95,111,112,101,110,0,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,95,115,98,114,107,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,95,104,101,97,112,95,115,116,97,114,116,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,105,122,101,0,95,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,116,97,114,116,0,95,108,115,101,101,107,0,95,117,115,101,114,108,97,110,100,95,116,114,97,109,112,111,108,105,110,101,95,97,100,100,114,101,115,115,0,101,97,100,107,95,114,97,110,100,111,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,109,97,105,110,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,95,119,114,105,116,101,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,102,108,97,115,104,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,95,114,101,97,100,0,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,95,99,108,111,115,101,0,28,0,0,0,2,3,0,0,32,0,0,0,2,75,0,0,36,0,0,0,2,69,0,0,20,0,0,0,10,78,0,0,32,0,0,0,2,1,0,0,28,0,0,0,30,91,0,0,48,0,0,0,2,74,0,0,52,0,0,0,2,90,0,0,56,0,0,0,2,97,0,0,60,0,0,0,2,94,0,0,64,0,0,0,2,82,0,0,24,0,0,0,2,2,0,0,0,0,0,0,2,87,0,0,0,0,0,0,2,84,0,0,0,0,0,0,2,83,0,0,0,0,0,0,2,81,0,0,0,46,115,121,109,116,97,98,0,46,115,116,114,116,97,98,0,46,115,104,115,116,114,116,97,98,0,46,116,101,120,116,0,46,114,101,108,46,116,101,120,116,46,95,115,98,114,107,0,46,116,101,120,116,46,95,102,115,116,97,116,0,46,116,101,120,116,46,95,105,115,97,116,116,121,0,46,116,101,120,116,46,95,111,112,101,110,0,46,116,101,120,116,46,95,114,101,97,100,0,46,116,101,120,116,46,95,108,115,101,101,107,0,46,116,101,120,116,46,95,99,108,111,115,101,0,46,114,101,108,46,116,101,120,116,46,95,119,114,105,116,101,0,46,114,101,108,46,116,101,120,116,46,95,115,116,97,114,116,0,46,116,101,120,116,46,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,46,116,101,120,116,46,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,46,116,101,120,116,46,101,97,100,107,95,114,97,110,100,111,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,46,116,101,120,116,46,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,46,116,101,120,116,46,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,46,116,101,120,116,46,101,97,100,107,95,101,118,101,110,116,95,103,101,116,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,46,114,101,108,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,46,114,111,100,97,116,97,46,108,111,99,97,116,105,111,110,46,48,0,46,114,101,108,46,114,111,100,97,116,97,46,95,90,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,105,122,101,0,46,114,101,108,46,100,97,116,97,46,104,101,97,112,95,101,110,100,46,49,0,46,98,115,115,0,46,99,111,109,109,101,110,116,0,46,65,82,77,46,97,116,116,114,105,98,117,116,101,115,0,46,110,111,105,110,105,116,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,27,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,37,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,33,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,208,11,0,0,24,0,0,0,43,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,49,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,92,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,62,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,76,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,100,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,113,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,130,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,120,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,126,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,232,11,0,0,16,0,0,0,43,0,0,0,10,0,0,0,4,0,0,0,8,0,0,0,147,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,156,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,143,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,248,11,0,0,48,0,0,0,43,0,0,0,12,0,0,0,4,0,0,0,8,0,0,0,160,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,224,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,196,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,228,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,228,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,238,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,246,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,248,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,19,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,6,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,56,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,20,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,85,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,34,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,120,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,44,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,145,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,70,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,180,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,201,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,226,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,251,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,24,2,0,0,1,0,0,0,6,0,0,0,0,0,0,0,140,1,0,0,28,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,20,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,40,12,0,0,8,0,0,0,43,0,0,0,27,0,0,0,4,0,0,0,8,0,0,0,55,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,168,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,78,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,172,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,74,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,48,12,0,0,8,0,0,0,43,0,0,0,30,0,0,0,4,0,0,0,8,0,0,0,127,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,176,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,137,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,176,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,133,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,56,12,0,0,8,0,0,0,43,0,0,0,33,0,0,0,4,0,0,0,8,0,0,0,166,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,180,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,162,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,64,12,0,0,8,0,0,0,43,0,0,0,35,0,0,0,4,0,0,0,8,0,0,0,200,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,184,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,196,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,72,12,0,0,8,0,0,0,43,0,0,0,37,0,0,0,4,0,0,0,8,0,0,0,217,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,188,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,222,2,0,0,1,0,0,0,48,0,0,0,0,0,0,0,188,1,0,0,234,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,231,2,0,0,3,0,0,112,0,0,0,0,0,0,0,0,166,2,0,0,52,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,247,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,218,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,220,2,0,0,128,6,0,0,44,0,0,0,67,0,0,0,4,0,0,0,16,0,0,0,9,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,92,9,0,0,116,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,80,12,0,0,255,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},917:(t,e,r)=>{"use strict";t.exports=r.p+"toolchain/ld.wasm"},947:(t,e,r)=>{"use strict";let n=r(276);let o={0:function(t,e,r,n,o){for(let i=0;i<r;i++)n[o+i]=t[e+i]},1:function(t,e,r,n,o,i){for(let a=0;a<r;a++){let r=a>=i?t[e+a-i]:0,s=t[e+a]-r;n[o+a]=s}},2:function(t,e,r,n,o){for(let i=0;i<r;i++){let a=e>0?t[e+i-r]:0,s=t[e+i]-a;n[o+i]=s}},3:function(t,e,r,n,o,i){for(let a=0;a<r;a++){let s=a>=i?t[e+a-i]:0,c=e>0?t[e+a-r]:0,u=t[e+a]-(s+c>>1);n[o+a]=u}},4:function(t,e,r,o,i,a){for(let s=0;s<r;s++){let c=s>=a?t[e+s-a]:0,u=e>0?t[e+s-r]:0,l=e>0&&s>=a?t[e+s-(r+a)]:0,f=t[e+s]-n(c,u,l);o[i+s]=f}}},i={0:function(t,e,r){let n=0,o=e+r;for(let r=e;r<o;r++)n+=Math.abs(t[r]);return n},1:function(t,e,r,n){let o=0;for(let i=0;i<r;i++){let r=i>=n?t[e+i-n]:0,a=t[e+i]-r;o+=Math.abs(a)}return o},2:function(t,e,r){let n=0,o=e+r;for(let i=e;i<o;i++){let o=e>0?t[i-r]:0,a=t[i]-o;n+=Math.abs(a)}return n},3:function(t,e,r,n){let o=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,s=e>0?t[e+i-r]:0,c=t[e+i]-(a+s>>1);o+=Math.abs(c)}return o},4:function(t,e,r,o){let i=0;for(let a=0;a<r;a++){let s=a>=o?t[e+a-o]:0,c=e>0?t[e+a-r]:0,u=e>0&&a>=o?t[e+a-(r+o)]:0,l=t[e+a]-n(s,c,u);i+=Math.abs(l)}return i}};t.exports=function(t,e,r,n,a){let s;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");s=[n.filterType]}else s=[0,1,2,3,4];16===n.bitDepth&&(a*=2);let c=e*a,u=0,l=0,f=Buffer.alloc((c+1)*r),h=s[0];for(let e=0;e<r;e++){if(s.length>1){let e=1/0;for(let r=0;r<s.length;r++){let n=i[s[r]](t,l,c,a);n<e&&(h=s[r],e=n)}}f[u]=h,u++,o[h](t,l,c,f,u,a),u+=c,l+=c}return f}},1007:(t,e,r)=>{"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var o=r(9979)();o.noConflict=function(){try{Promise===o&&(Promise=n)}catch(t){}return o},t.exports=o},1065:(t,e,r)=>{"use strict";var n,o=r(2208),i=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,s=process.nextTick;n=o.isRecentNode?function(t){a.call(global,t)}:function(t){s.call(process,t)}}else if("function"==typeof i&&"function"==typeof i.resolve){var c=i.resolve();n=function(t){c.then(t)}}else n="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)||!("classList"in document.documentElement)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var t=document.createElement("div"),e={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver((function(){t.classList.toggle("foo"),r=!1})).observe(n,e);return function(o){var i=new MutationObserver((function(){i.disconnect(),o()}));i.observe(t,e),r||(r=!0,n.classList.toggle("foo"))}}();t.exports=n},1144:(t,e)=>{e.hashU32=function(t){return-1252372727^(t=(t=(t=(t=-949894596^(t=(t|=0)+2127912214+(t<<12)|0)^t>>>19)+374761393+(t<<5)|0)+-744332180^t<<9)+-42973499+(t<<3)|0)^t>>>16},e.readU64=function(t,e){var r=0;return r|=t[e++]|0,r|=t[e++]<<8,r|=t[e++]<<16,r|=t[e++]<<24,r|=t[e++]<<32,r|=t[e++]<<40,r|=t[e++]<<48,r|=t[e++]<<56},e.readU32=function(t,e){var r=0;return r|=t[e++]|0,r|=t[e++]<<8,r|=t[e++]<<16,r|=t[e++]<<24},e.writeU32=function(t,e,r){t[e++]=255&r,t[e++]=r>>8&255,t[e++]=r>>16&255,t[e++]=r>>24&255},e.imul=function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16)|0}},1231:(t,e,r)=>{"use strict";var n=r(2208),o=n.maybeWrapAsError,i=r(403).OperationalError,a=r(7585);var s=/^(?:name|message|stack|cause)$/;function c(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new i(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),o=0;o<r.length;++o){var c=r[o];s.test(c)||(e[c]=t[c])}return e}return n.markAsOriginatingFromRejection(t),t}t.exports=function(t,e){return function(r,n){if(null!==t){if(r){var i=c(o(r));t._attachExtraTrace(i),t._reject(i)}else if(e){for(var a=arguments.length,s=new Array(Math.max(a-1,0)),u=1;u<a;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(n);t=null}}}},1402:t=>{"use strict";let e=t.exports=function(t){this._buffer=t,this._reads=[]};e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},1497:(t,e,r)=>{"use strict";let n=!0,o=r(3106);o.deflateSync||(n=!1);let i=r(6402),a=r(3769);t.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=new a(e||{}),s=[];s.push(Buffer.from(i.PNG_SIGNATURE)),s.push(r.packIHDR(t.width,t.height)),t.gamma&&s.push(r.packGAMA(t.gamma));let c=r.filterData(t.data,t.width,t.height),u=o.deflateSync(c,r.getDeflateOptions());if(c=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(u)),s.push(r.packIEND()),Buffer.concat(s)}},1638:(t,e,r)=>{"use strict";let n=r(6402);t.exports=function(t,e,r,o){let i=-1!==[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(o.colorType);if(o.colorType===o.inputColorType){let e=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===o.bitDepth||16===o.bitDepth&&e)return t}let a=16!==o.bitDepth?t:new Uint16Array(t.buffer),s=255,c=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==c||o.inputHasAlpha||(c=3);let u=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,u*=2);let l=Buffer.alloc(e*r*u),f=0,h=0,p=o.bgColor||{};function d(){let t,e,r,c=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:c=a[f+3],t=a[f],e=a[f+1],r=a[f+2];break;case n.COLORTYPE_COLOR:t=a[f],e=a[f+1],r=a[f+2];break;case n.COLORTYPE_ALPHA:c=a[f+1],t=a[f],e=t,r=t;break;case n.COLORTYPE_GRAYSCALE:t=a[f],e=t,r=t;break;default:throw new Error("input color type:"+o.inputColorType+" is not supported at present")}return o.inputHasAlpha&&(i||(c/=s,t=Math.min(Math.max(Math.round((1-c)*p.red+c*t),0),s),e=Math.min(Math.max(Math.round((1-c)*p.green+c*e),0),s),r=Math.min(Math.max(Math.round((1-c)*p.blue+c*r),0),s))),{red:t,green:e,blue:r,alpha:c}}void 0===p.red&&(p.red=s),void 0===p.green&&(p.green=s),void 0===p.blue&&(p.blue=s);for(let t=0;t<r;t++)for(let t=0;t<e;t++){let t=d();switch(o.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:8===o.bitDepth?(l[h]=t.red,l[h+1]=t.green,l[h+2]=t.blue,i&&(l[h+3]=t.alpha)):(l.writeUInt16BE(t.red,h),l.writeUInt16BE(t.green,h+2),l.writeUInt16BE(t.blue,h+4),i&&l.writeUInt16BE(t.alpha,h+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let e=(t.red+t.green+t.blue)/3;8===o.bitDepth?(l[h]=e,i&&(l[h+1]=t.alpha)):(l.writeUInt16BE(e,h),i&&l.writeUInt16BE(t.alpha,h+2));break}default:throw new Error("unrecognised color Type "+o.colorType)}f+=c,h+=u}return l}},1674:(t,e,r)=>{"use strict";t.exports=function(t){var e=r(2208),n=r(7585).keys,o=e.tryCatch,i=e.errorObj;return function(r,a,s){return function(c){var u=s._boundValue();t:for(var l=0;l<r.length;++l){var f=r[l];if(f===Error||null!=f&&f.prototype instanceof Error){if(c instanceof f)return o(a).call(u,c)}else if("function"==typeof f){var h=o(f).call(u,c);if(h===i)return h;if(h)return o(a).call(u,c)}else if(e.isObject(c)){for(var p=n(f),d=0;d<p.length;++d){var v=p[d];if(f[v]!=c[v])continue t}return o(a).call(u,c)}}return t}}}},1675:(t,e,r)=>{"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}t.exports=function(t){var e,n,a=r(2208),s=a.canEvaluate,c=a.isIdentifier,u=function(t){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,t))(h)},l=function(t){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",t))},f=function(t,e,r){var n=r[t];if("function"!=typeof n){if(!c(t))return null;if(n=e(t),r[t]=n,r[" size"]++,r[" size"]>512){for(var o=Object.keys(r),i=0;i<256;++i)delete r[o[i]];r[" size"]=o.length-256}}return n};function h(e,r){var n;if(null!=e&&(n=e[r]),"function"!=typeof n){var o="Object "+a.classString(e)+" has no method '"+a.toString(r)+"'";throw new t.TypeError(o)}return n}function p(t){return h(t,this.pop()).apply(t,this)}function d(t){return t[this]}function v(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e=function(t){return f(t,u,o)},n=function(t){return f(t,l,i)},t.prototype.call=function(t){for(var r=arguments.length,n=new Array(Math.max(r-1,0)),o=1;o<r;++o)n[o-1]=arguments[o];if(s){var i=e(t);if(null!==i)return this._then(i,void 0,void 0,n,void 0)}return n.push(t),this._then(p,void 0,void 0,n,void 0)},t.prototype.get=function(t){var e;if("number"==typeof t)e=v;else if(s){var r=n(t);e=null!==r?r:d}else e=d;return this._then(e,void 0,void 0,t,void 0)}}},2122:(t,e,r)=>{"use strict";let n=r(4346),o=r(1497);e.read=function(t,e){return n(t,e||{})},e.write=function(t,e){return o(t,e)}},2170:(t,e,r)=>{"use strict";let n=r(9023),o=r(9402),i=r(695),a=t.exports=function(t){o.call(this);let e=[],r=this;this._filter=new i(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){r.emit("complete",Buffer.concat(e))}}),this._filter.start()};n.inherits(a,o)},2203:t=>{"use strict";t.exports=require("stream")},2208:function(t,e,r){"use strict";var n=r(7585),o="undefined"==typeof navigator,i={e:{}},a,s="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null;function c(){try{var t=a;return a=null,t.apply(this,arguments)}catch(t){return i.e=t,i}}function u(t){return a=t,c}var l=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function f(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function h(t){return"function"==typeof t||"object"==typeof t&&null!==t}function p(t){return f(t)?new Error(S(t)):t}function d(t,e){var r,n=t.length,o=new Array(n+1);for(r=0;r<n;++r)o[r]=t[r];return o[r]=e,o}function v(t,e,r){if(!n.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var o=Object.getOwnPropertyDescriptor(t,e);return null!=o?null==o.get&&null==o.set?o.value:r:void 0}function y(t,e,r){if(f(t))return t;var o={value:r,configurable:!0,enumerable:!1,writable:!0};return n.defineProperty(t,e,o),t}function m(t){throw t}var g=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1};if(n.isES5){var r=Object.getOwnPropertyNames;return function(t){for(var o=[],i=Object.create(null);null!=t&&!e(t);){var a;try{a=r(t)}catch(t){return o}for(var s=0;s<a.length;++s){var c=a[s];if(!i[c]){i[c]=!0;var u=Object.getOwnPropertyDescriptor(t,c);null!=u&&null==u.get&&null==u.set&&o.push(c)}}t=n.getPrototypeOf(t)}return o}}var o={}.hasOwnProperty;return function(r){if(e(r))return[];var n=[];t:for(var i in r)if(o.call(r,i))n.push(i);else{for(var a=0;a<t.length;++a)if(o.call(t[a],i))continue t;n.push(i)}return n}}(),_=/this\s*\.\s*\S+\s*=/;function w(t){try{if("function"==typeof t){var e=n.names(t.prototype),r=n.isES5&&e.length>1,o=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=_.test(t+"")&&n.names(t).length>0;if(r||o||i)return!0}return!1}catch(t){return!1}}function b(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var E=/^[a-z$_][a-z$_0-9]*$/i;function k(t){return E.test(t)}function x(t,e,r){for(var n=new Array(t),o=0;o<t;++o)n[o]=e+o+r;return n}function S(t){try{return t+""}catch(t){return"[no string representation]"}}function A(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function P(t){try{y(t,"isOperational",!0)}catch(t){}}function O(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)}function F(t){return A(t)&&n.propertyIsWritable(t,"stack")}var C="stack"in new Error?function(t){return F(t)?t:new Error(S(t))}:function(t){if(F(t))return t;try{throw new Error(S(t))}catch(t){return t}};function T(t){return{}.toString.call(t)}function j(t,e,r){for(var o=n.names(t),i=0;i<o.length;++i){var a=o[i];if(r(a))try{n.defineProperty(e,a,n.getDescriptor(t,a))}catch(t){}}}var L=function(t){return n.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var R="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,r=[],n=t[Symbol.iterator]();!(e=n.next()).done;)r.push(e.value);return r};L=function(t){return n.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?R(t):null}}var D="undefined"!=typeof process&&"[object process]"===T(process).toLowerCase(),I="undefined"!=typeof process&&void 0!==process.env,N;function M(t){return I?process.env[t]:void 0}function B(){if("function"==typeof Promise)try{if("[object Promise]"===T(new Promise((function(){}))))return Promise}catch(t){}}function U(t,e){if(null===t||"function"!=typeof e||e===N)return e;null!==t.domain&&(e=t.domain.bind(e));var r=t.async;if(null!==r){var n=e;e=function(){for(var t=arguments.length+2,e=new Array(t),o=2;o<t;++o)e[o]=arguments[o-2];return e[0]=n,e[1]=this,r.runInAsyncScope.apply(r,e)}}return e}var G={setReflectHandler:function(t){N=t},isClass:w,isIdentifier:k,inheritedDataKeys:g,getDataPropertyOrDefault:v,thrower:m,isArray:n.isArray,asArray:L,notEnumerableProp:y,isPrimitive:f,isObject:h,isError:A,canEvaluate:o,errorObj:i,tryCatch:u,inherits:l,withAppended:d,maybeWrapAsError:p,toFastProperties:b,filledRange:x,toString:S,canAttachTrace:F,ensureErrorObject:C,originatesFromRejection:O,markAsOriginatingFromRejection:P,classString:T,copyDescriptors:j,isNode:D,hasEnvVariables:I,env:M,global:s,getNativePromise:B,contextBind:U},z;G.isRecentNode=G.isNode&&(process.versions&&process.versions.node?z=process.versions.node.split(".").map(Number):process.version&&(z=process.version.split(".").map(Number)),0===z[0]&&z[1]>10||z[0]>0),G.nodeSupportsAsyncResource=G.isNode&&function(){var t=!1;try{t="function"==typeof r(290).AsyncResource.prototype.runInAsyncScope}catch(e){t=!1}return t}(),G.isNode&&G.toFastProperties(process);try{throw new Error}catch(t){G.lastLineError=t}t.exports=G},2582:(t,e)=>{"use strict";let r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(t,e){let n=[],o=t%8,i=e%8,a=(t-o)/8,s=(e-i)/8;for(let t=0;t<r.length;t++){let e=r[t],c=a*e.x.length,u=s*e.y.length;for(let t=0;t<e.x.length&&e.x[t]<o;t++)c++;for(let t=0;t<e.y.length&&e.y[t]<i;t++)u++;c>0&&u>0&&n.push({width:c,height:u,index:t})}return n},e.getInterlaceIterator=function(t){return function(e,n,o){let i=e%r[o].x.length,a=(e-i)/r[o].x.length*8+r[o].x[i],s=n%r[o].y.length;return 4*a+((n-s)/r[o].y.length*8+r[o].y[s])*t*4}}},2613:t=>{"use strict";t.exports=require("assert")},2661:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a=r(2208);a.isArray;function s(r){var n=this._promise=new t(e);r instanceof t&&(n._propagateFrom(r,3),r.suppressUnhandledRejections()),n._setOnCancel(this),this._values=r,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,i){var s=n(this._values,this._promise);if(s instanceof t){var c=(s=s._target())._bitField;if(this._values=s,!(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,i);if(!(33554432&c))return 16777216&c?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===i?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(i));else{var u=o("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<r;++s){var c=n(e[s],o);a=c instanceof t?(c=c._target())._bitField:null,i?null!==a&&c.suppressUnhandledRejections():null!==a?50397184&a?i=33554432&a?this._promiseFulfilled(c._value(),s):16777216&a?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):(c._proxy(this,s),this._values[s]=c):i=this._promiseFulfilled(c,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r<e.length;++r)e[r]instanceof t&&e[r].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},2730:t=>{"use strict";t.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,o){return r(t,n,o,e)}}},2994:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i=r(2208),a=i.tryCatch,s=i.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var r=0;r<t.length;++r)this._doInvokeOnCancel(t[r],e);else if(void 0!==t)if("function"==typeof t){if(!e){var n=a(t).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),c.throwLater(n.e))}}else t._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},3106:t=>{"use strict";t.exports=require("zlib")},3381:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i=r(2208);function a(r,s){var c,u=n(r);if(u instanceof t)return(c=u).then((function(t){return a(t,c)}));if(null===(r=i.asArray(r)))return o("expecting an array or an iterable object but got "+i.classString(r));var l=new t(e);void 0!==s&&l._propagateFrom(s,3);for(var f=l._fulfill,h=l._reject,p=0,d=r.length;p<d;++p){var v=r[p];(void 0!==v||p in r)&&t.cast(v)._then(f,h,void 0,l,null)}return l}t.race=function(t){return a(t,void 0)},t.prototype.race=function(){return a(this,void 0)}}},3425:t=>{"use strict";t.exports=function(t,e){var r=t.reduce,n=t.all;function o(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(o,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(o,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},3769:(t,e,r)=>{"use strict";let n=r(6402),o=r(7613),i=r(1638),a=r(947),s=r(3106),c=t.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};c.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},c.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},c.prototype.filterData=function(t,e,r){let o=i(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(o,e,r,this._options,s)},c.prototype._packChunk=function(t,e){let r=e?e.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(t,4),e&&e.copy(n,8),n.writeInt32BE(o.crc32(n.slice(4,n.length-4)),n.length-4),n},c.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},c.prototype.packIHDR=function(t,e){let r=Buffer.alloc(13);return r.writeUInt32BE(t,0),r.writeUInt32BE(e,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(n.TYPE_IHDR,r)},c.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},c.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}},4271:t=>{"use strict";t.exports=function(t,e,r,n){var o=!1,i=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t)},s=function(t,e){50397184&this._bitField||this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var u=r(i),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(u),u instanceof t){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:u};f._then(e,a,void 0,l,h),u._then(s,c,void 0,l,h),l._setOnCancel(u)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return!(2097152&~this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},4346:(t,e,r)=>{"use strict";let n=!0,o=r(3106),i=r(9874);o.deflateSync||(n=!1);let a=r(1402),s=r(6479),c=r(336),u=r(5913),l=r(4721);t.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r,f,h;let p=[];let d=new a(t),v=new c(e,{read:d.read.bind(d),error:function(t){r=t},metadata:function(t){f=t},gamma:function(t){h=t},palette:function(t){f.palette=t},transColor:function(t){f.transColor=t},inflateData:function(t){p.push(t)},simpleTransparency:function(){f.alpha=!0}});if(v.start(),d.process(),r)throw r;let y,m=Buffer.concat(p);if(p.length=0,f.interlace)y=o.inflateSync(m);else{let t=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;y=i(m,{chunkSize:t,maxLength:t})}if(m=null,!y||!y.length)throw new Error("bad png - invalid inflate data response");let g=s.process(y,f);m=null;let _=u.dataToBitMap(g,f);g=null;let w=l(_,f,e.skipRescale);return f.data=w,f.gamma=h||0,f}},4416:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i,a=r(2208),s=a.isObject,c=r(7585);"function"==typeof Map&&(i=Map);var u=function(){var t=0,e=0;function r(r,n){this[t]=r,this[t+e]=n,t++}return function(n){e=n.size,t=0;var o=new Array(2*n.size);return n.forEach(r,o),o}}();function l(t){var e,r=!1;if(void 0!==i&&t instanceof i)e=u(t),r=!0;else{var n=c.keys(t),o=n.length;e=new Array(2*o);for(var a=0;a<o;++a){var s=n[a];e[a]=t[s],e[a+o]=s}}this.constructor$(e),this._isMap=r,this._init$(void 0,r?-6:-3)}function f(e){var r,i=n(e);return s(i)?(r=i instanceof t?i._then(t.props,void 0,void 0,void 0,void 0):new l(i).promise(),i instanceof t&&r._propagateFrom(i,2),r):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,e),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(t){for(var e=new i,r=t.length/2|0,n=0;n<r;++n){var o=t[r+n],a=t[n];e.set(o,a)}return e}(this._values);else{r={};for(var n=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+n]]=this._values[o]}return this._resolve(r),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return f(this)},t.props=function(t){return f(t)}}},4714:(t,e,r)=>{var n=r(9110);n.Template=r(9549).Template,n.template=n.Template,t.exports=n},4721:t=>{"use strict";t.exports=function(t,e,r=!1){let n=e.depth,o=e.width,i=e.height,a=e.colorType,s=e.transColor,c=e.palette,u=t;return 3===a?function(t,e,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=o[t[i]];if(!r)throw new Error("index "+t[i]+" not in palette");for(let t=0;t<4;t++)e[i+t]=r[t];i+=4}}(t,u,o,i,c):(s&&function(t,e,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=!1;if(1===o.length?o[0]===t[i]&&(r=!0):o[0]===t[i]&&o[1]===t[i+1]&&o[2]===t[i+2]&&(r=!0),r)for(let t=0;t<4;t++)e[i+t]=0;i+=4}}(t,u,o,i,s),8===n||r||(16===n&&(u=Buffer.alloc(o*i*4)),function(t,e,r,n,o){let i=Math.pow(2,o)-1,a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){for(let r=0;r<4;r++)e[a+r]=Math.floor(255*t[a+r]/i+.5);a+=4}}(t,u,o,i,n))),u}},4900:t=>{"use strict";t.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=e.prototype.isFulfilled=function(){return!!(33554432&this._bitField)},i=e.prototype.isRejected=function(){return!!(16777216&this._bitField)},a=e.prototype.isPending=function(){return!(50397184&this._bitField)},s=e.prototype.isResolved=function(){return!!(50331648&this._bitField)};e.prototype.isCancelled=function(){return!!(8454144&this._bitField)},t.prototype.__isCancelled=function(){return!(65536&~this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return!!(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return i.call(this._target())},t.prototype.isFulfilled=function(){return o.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},5404:(t,e,r)=>{var n=r(255),o=r(1144),i=65536,a=15,s=h(5<<20),c=function(){try{return new Uint32Array(i)}catch(r){for(var t=new Array(i),e=0;e<i;e++)t[e]=0;return t}}(),u=407708164,l=2147483648,f={4:65536,5:262144,6:1048576,7:4194304};function h(t){try{return new Uint8Array(t)}catch(n){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e}}function p(t,e,r){if(void 0!==typeof t.buffer){if(Uint8Array.prototype.slice)return t.slice(e,r);var n=t.length;e=(e|=0)<0?Math.max(n+e,0):Math.min(e,n),r=(r=void 0===r?n:0|r)<0?Math.max(n+r,0):Math.min(r,n);for(var o=new Uint8Array(r-e),i=e,a=0;i<r;)o[a++]=t[i++];return o}return t.slice(e,r)}e.compressBound=function(t){return t+t/255+16|0},e.decompressBound=function(t){var e=0;if(o.readU32(t,e)!==u)throw new Error("invalid magic number");e+=4;var r=t[e++];if(64!=(192&r))throw new Error("incompatible descriptor version "+(192&r));var n=!!(16&r),i=!!(8&r),a=t[e++]>>4&7;if(void 0===f[a])throw new Error("invalid block size "+a);var s=f[a];if(i)return o.readU64(t,e);e++;for(var c=0;;){var h=o.readU32(t,e);if(e+=4,c+=h&l?h&=2147483647:s,0===h)return c;n&&(e+=4),e+=h}},e.makeBuffer=h,e.decompressBlock=function(t,e,r,n,o){var i,a,s,c,u;for(s=r+n;r<s;){var l=t[r++],f=l>>4;if(f>0){if(15===f)for(;f+=t[r],255===t[r++];);for(c=r+f;r<c;)e[o++]=t[r++]}if(r>=s)break;if(i=15&l,a=t[r++]|t[r++]<<8,15===i)for(;i+=t[r],255===t[r++];);for(c=(u=o-a)+(i+=4);u<c;)e[o++]=0|e[u++]}return o},e.compressBlock=function(t,e,r,n,i){var s,c,u,l,f,h,p,d;if(h=0,p=n+r,c=r,n>=13)for(var v=67;r+4<p-5;){var y=o.readU32(t,r),m=o.hashU32(y)>>>0;if(s=i[m=(m>>16^m)>>>0&65535]-1,i[m]=r+1,s<0||r-s>>>16>0||o.readU32(t,s)!==y)r+=v++>>6;else{for(v=67,f=r-c,l=r-s,s+=4,u=r+=4;r<p-5&&t[r]===t[s];)r++,s++;var g=(u=r-u)<15?u:15;if(f>=a){for(e[h++]=240+g,d=f-a;d>=255;d-=255)e[h++]=255;e[h++]=d}else e[h++]=(f<<4)+g;for(var _=0;_<f;_++)e[h++]=t[c+_];if(e[h++]=l,e[h++]=l>>8,u>=15){for(d=u-15;d>=255;d-=255)e[h++]=255;e[h++]=d}c=r}}if(0===c)return 0;if((f=p-c)>=a){for(e[h++]=240,d=f-a;d>=255;d-=255)e[h++]=255;e[h++]=d}else e[h++]=f<<4;for(r=c;r<p;)e[h++]=t[r++];return h},e.decompressFrame=function(t,r){var n,i,a,s,c=0,h=0;if(o.readU32(t,c)!==u)throw new Error("invalid magic number");if(c+=4,64!=(192&(s=t[c++])))throw new Error("incompatible descriptor version");n=!!(16&s),i=!!(4&s),a=!!(8&s);var p=t[c++]>>4&7;if(void 0===f[p])throw new Error("invalid block size");for(a&&(c+=8),c++;;){var d;if(d=o.readU32(t,c),c+=4,0===d)break;if(n&&(c+=4),d&l){d&=2147483647;for(var v=0;v<d;v++)r[h++]=t[c++]}else h=e.decompressBlock(t,r,c,d,h),c+=d}return i&&(c+=4),h},e.compressFrame=function(t,r){var a=0;o.writeU32(r,a,u),a+=4,r[a++]=64,r[a++]=112,r[a]=n.hash(0,r,4,a-4)>>8,a++;var l=f[7],h=t.length,p=0;for(!function(){for(var t=0;t<i;t++)c[t]=0}();h>0;){var d,v=h>l?l:h;if((d=e.compressBlock(t,s,p,v,c))>v||0===d){o.writeU32(r,a,2147483648|v),a+=4;for(var y=p+v;p<y;)r[a++]=t[p++];h-=v}else{o.writeU32(r,a,d),a+=4;for(var m=0;m<d;)r[a++]=s[m++];p+=v,h-=v}}return o.writeU32(r,a,0),a+=4},e.decompress=function(t,r){var n,o;return void 0===r&&(r=e.decompressBound(t)),n=e.makeBuffer(r),(o=e.decompressFrame(t,n))!==r&&(n=p(n,0,o)),n},e.compress=function(t,r){var n,o;return void 0===r&&(r=e.compressBound(t.length)),n=e.makeBuffer(r),(o=e.compressFrame(t,n))!==r&&(n=p(n,0,o)),n}},5552:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",v=(t,e)=>{throw e},y="object"==typeof window,m="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";g?(_=m?r(6928).dirname(_)+"/":__dirname+"/",f=()=>{l||(u=r(9896),l=r(6928))},a=function(t,e){return f(),t=l.normalize(t),u.readFileSync(t,e?void 0:"utf8")},c=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{f(),t=l.normalize(t),u.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),v=(t,e)=>{if(V())throw process.exitCode=t,e;var r;(r=e)instanceof kt||E("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}):(y||m)&&(m?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},m&&(c=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var w,b=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(v=i.quit),i.wasmBinary&&(w=i.wasmBinary);var k,x=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&tt("no native wasm support detected");var S,A,P,O,F,C,T,j=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&L)return L.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var c=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function D(t,e){return t?R(O,t,e):""}function I(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}function N(t,e,r){return I(t,O,e,r)}function M(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function B(t){A=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=F=new Int16Array(t),i.HEAP32=C=new Int32Array(t),i.HEAPU8=O=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=T=new Uint32Array(t),i.HEAPF32=new Float32Array(t),i.HEAPF64=new Float64Array(t)}i.INITIAL_MEMORY;var U=[],G=[],z=[],H=[];function V(){return x}var q,Y,W,K,$=0,X=null,Z=null;function Q(t){$++,i.monitorRunDependencies&&i.monitorRunDependencies($)}function J(t){if($--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==X&&(clearInterval(X),X=null),Z)){var e=Z;Z=null,e()}}function tt(t){i.onAbort&&i.onAbort(t),E(t="Aborted("+t+")"),j=!0,S=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function et(t){return t.startsWith("data:application/octet-stream;base64,")}function rt(t){try{if(t==q&&w)return new Uint8Array(w);if(c)return c(t);throw"both async and sync fetching of the wasm failed"}catch(t){tt(t)}}function nt(t){for(;t.length>0;)t.shift()(i)}et(q="objcopy.wasm")||(Y=q,q=i.locateFile?i.locateFile(Y,_):_+Y);var ot={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=ot.isAbs(t),r="/"===t.substr(-1);return(t=ot.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=ot.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=ot.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments,0);return ot.normalize(t.join("/"))},join2:(t,e)=>ot.normalize(t+"/"+e)},it={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:lt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=ot.isAbs(n)}return(e?"/":"")+(t=ot.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=it.resolve(t).substr(1),e=it.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},at={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){at.ttys[t]={input:[],output:[],ops:e},lt.registerDevice(t,at.stream_ops)},stream_ops:{open:function(t){var e=at.ttys[t.node.rdev];if(!e)throw new lt.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new lt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new lt.ErrnoError(29)}if(void 0===s&&0===i)throw new lt.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new lt.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new lt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(g){var r=Buffer.alloc(256),n=0;try{n=u.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=gt(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(b(R(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(b(R(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(E(R(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(E(R(t.output,0)),t.output=[])}}};function st(t){tt()}var ct={ops_table:null,mount:function(t){return ct.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(lt.isBlkdev(r)||lt.isFIFO(r))throw new lt.ErrnoError(63);ct.ops_table||(ct.ops_table={dir:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr,lookup:ct.node_ops.lookup,mknod:ct.node_ops.mknod,rename:ct.node_ops.rename,unlink:ct.node_ops.unlink,rmdir:ct.node_ops.rmdir,readdir:ct.node_ops.readdir,symlink:ct.node_ops.symlink},stream:{llseek:ct.stream_ops.llseek}},file:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr},stream:{llseek:ct.stream_ops.llseek,read:ct.stream_ops.read,write:ct.stream_ops.write,allocate:ct.stream_ops.allocate,mmap:ct.stream_ops.mmap,msync:ct.stream_ops.msync}},link:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr,readlink:ct.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr},stream:lt.chrdev_stream_ops}});var o=lt.createNode(t,e,r,n);return lt.isDir(o.mode)?(o.node_ops=ct.ops_table.dir.node,o.stream_ops=ct.ops_table.dir.stream,o.contents={}):lt.isFile(o.mode)?(o.node_ops=ct.ops_table.file.node,o.stream_ops=ct.ops_table.file.stream,o.usedBytes=0,o.contents=null):lt.isLink(o.mode)?(o.node_ops=ct.ops_table.link.node,o.stream_ops=ct.ops_table.link.stream):lt.isChrdev(o.mode)&&(o.node_ops=ct.ops_table.chrdev.node,o.stream_ops=ct.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=lt.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,lt.isDir(t.mode)?e.size=4096:lt.isFile(t.mode)?e.size=t.usedBytes:lt.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&ct.resizeFileStorage(t,e.size)},lookup:function(t,e){throw lt.genericErrors[44]},mknod:function(t,e,r,n){return ct.createNode(t,e,r,n)},rename:function(t,e,r){if(lt.isDir(t.mode)){var n;try{n=lt.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new lt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=lt.lookupNode(t,e);for(var n in r.contents)throw new lt.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=ct.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!lt.isLink(t.mode))throw new lt.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write:function(t,e,r,n,o,i){if(e.buffer===P.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(ct.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&<.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new lt.ErrnoError(28);return n},allocate:function(t,e,r){ct.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,o){if(!lt.isFile(t.node.mode))throw new lt.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==A){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=st()))throw new lt.ErrnoError(48);P.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(t,e,r,n,o){if(!lt.isFile(t.node.mode))throw new lt.ErrnoError(43);return 2&o||ct.stream_ops.write(t,e,0,n,r,!1),0}}};function ut(t,e,r,n){var o=n?"":"al "+t;s(t,(function(r){var n;n='Loading data file "'+t+'" failed (no arrayBuffer).',r||tt(n),e(new Uint8Array(r)),o&&J()}),(function(e){if(!r)throw'Loading data file "'+t+'" failed.';r()})),o&&Q()}var lt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=it.resolve(lt.cwd(),t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new lt.ErrnoError(32);for(var r=ot.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=lt.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=lt.lookupNode(n,r[i]),o=ot.join2(o,r[i]),lt.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;lt.isLink(n.mode);){var c=lt.readlink(o);if(o=it.resolve(ot.dirname(o),c),n=lt.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new lt.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var e;;){if(lt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:(t,e)=>{for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%lt.nameTable.length},hashAddNode:t=>{var e=lt.hashName(t.parent.id,t.name);t.name_next=lt.nameTable[e],lt.nameTable[e]=t},hashRemoveNode:t=>{var e=lt.hashName(t.parent.id,t.name);if(lt.nameTable[e]===t)lt.nameTable[e]=t.name_next;else for(var r=lt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:(t,e)=>{var r=lt.mayLookup(t);if(r)throw new lt.ErrnoError(r,t);for(var n=lt.hashName(t.id,e),o=lt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return lt.lookup(t,e)},createNode:(t,e,r,n)=>{var o=new lt.FSNode(t,e,r,n);return lt.hashAddNode(o),o},destroyNode:t=>{lt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var e=lt.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>lt.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=lt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{return lt.lookupNode(t,e),20}catch(t){}return lt.nodePermissions(t,"wx")},mayDelete:(t,e,r)=>{var n;try{n=lt.lookupNode(t,e)}catch(t){return t.errno}var o=lt.nodePermissions(t,"wx");if(o)return o;if(r){if(!lt.isDir(n.mode))return 54;if(lt.isRoot(n)||lt.getPath(n)===lt.cwd())return 10}else if(lt.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?lt.isLink(t.mode)?32:lt.isDir(t.mode)&&("r"!==lt.flagsToPermissionString(e)||512&e)?31:lt.nodePermissions(t,lt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,e=lt.MAX_OPEN_FDS)=>{for(var r=t;r<=e;r++)if(!lt.streams[r])return r;throw new lt.ErrnoError(33)},getStream:t=>lt.streams[t],createStream:(t,e,r)=>{lt.FSStream||(lt.FSStream=function(){this.shared={}},lt.FSStream.prototype={},Object.defineProperties(lt.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new lt.FSStream,t);var n=lt.nextfd(e,r);return t.fd=n,lt.streams[n]=t,t},closeStream:t=>{lt.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=lt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new lt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{lt.devices[t]={stream_ops:e}},getDevice:t=>lt.devices[t],getMounts:t=>{for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),lt.syncFSRequests++,lt.syncFSRequests>1&&E("warning: "+lt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=lt.getMounts(lt.root.mount),n=0;function o(t){return lt.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount:(t,e,r)=>{var n,o="/"===r,i=!r;if(o&<.root)throw new lt.ErrnoError(10);if(!o&&!i){var a=lt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,lt.isMountpoint(n))throw new lt.ErrnoError(10);if(!lt.isDir(n.mode))throw new lt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},c=t.mount(s);return c.mount=s,s.root=c,o?lt.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:t=>{var e=lt.lookupPath(t,{follow_mount:!1});if(!lt.isMountpoint(e.node))throw new lt.ErrnoError(28);var r=e.node,n=r.mounted,o=lt.getMounts(n);Object.keys(lt.nameTable).forEach((t=>{for(var e=lt.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&<.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,r)=>{var n=lt.lookupPath(t,{parent:!0}).node,o=ot.basename(t);if(!o||"."===o||".."===o)throw new lt.ErrnoError(28);var i=lt.mayCreate(n,o);if(i)throw new lt.ErrnoError(i);if(!n.node_ops.mknod)throw new lt.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,lt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,lt.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{lt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>(void 0===r&&(r=e,e=438),e|=8192,lt.mknod(t,e,r)),symlink:(t,e)=>{if(!it.resolve(t))throw new lt.ErrnoError(44);var r=lt.lookupPath(e,{parent:!0}).node;if(!r)throw new lt.ErrnoError(44);var n=ot.basename(e),o=lt.mayCreate(r,n);if(o)throw new lt.ErrnoError(o);if(!r.node_ops.symlink)throw new lt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:(t,e)=>{var r,n,o=ot.dirname(t),i=ot.dirname(e),a=ot.basename(t),s=ot.basename(e);if(r=lt.lookupPath(t,{parent:!0}).node,n=lt.lookupPath(e,{parent:!0}).node,!r||!n)throw new lt.ErrnoError(44);if(r.mount!==n.mount)throw new lt.ErrnoError(75);var c,u=lt.lookupNode(r,a),l=it.relative(t,i);if("."!==l.charAt(0))throw new lt.ErrnoError(28);if("."!==(l=it.relative(e,o)).charAt(0))throw new lt.ErrnoError(55);try{c=lt.lookupNode(n,s)}catch(t){}if(u!==c){var f=lt.isDir(u.mode),h=lt.mayDelete(r,a,f);if(h)throw new lt.ErrnoError(h);if(h=c?lt.mayDelete(n,s,f):lt.mayCreate(n,s))throw new lt.ErrnoError(h);if(!r.node_ops.rename)throw new lt.ErrnoError(63);if(lt.isMountpoint(u)||c&<.isMountpoint(c))throw new lt.ErrnoError(10);if(n!==r&&(h=lt.nodePermissions(r,"w")))throw new lt.ErrnoError(h);lt.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(t){throw t}finally{lt.hashAddNode(u)}}},rmdir:t=>{var e=lt.lookupPath(t,{parent:!0}).node,r=ot.basename(t),n=lt.lookupNode(e,r),o=lt.mayDelete(e,r,!0);if(o)throw new lt.ErrnoError(o);if(!e.node_ops.rmdir)throw new lt.ErrnoError(63);if(lt.isMountpoint(n))throw new lt.ErrnoError(10);e.node_ops.rmdir(e,r),lt.destroyNode(n)},readdir:t=>{var e=lt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new lt.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=lt.lookupPath(t,{parent:!0}).node;if(!e)throw new lt.ErrnoError(44);var r=ot.basename(t),n=lt.lookupNode(e,r),o=lt.mayDelete(e,r,!1);if(o)throw new lt.ErrnoError(o);if(!e.node_ops.unlink)throw new lt.ErrnoError(63);if(lt.isMountpoint(n))throw new lt.ErrnoError(10);e.node_ops.unlink(e,r),lt.destroyNode(n)},readlink:t=>{var e=lt.lookupPath(t).node;if(!e)throw new lt.ErrnoError(44);if(!e.node_ops.readlink)throw new lt.ErrnoError(28);return it.resolve(lt.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var r=lt.lookupPath(t,{follow:!e}).node;if(!r)throw new lt.ErrnoError(44);if(!r.node_ops.getattr)throw new lt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>lt.stat(t,!0),chmod:(t,e,r)=>{var n;if(!(n="string"==typeof t?lt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,e)=>{lt.chmod(t,e,!0)},fchmod:(t,e)=>{var r=lt.getStream(t);if(!r)throw new lt.ErrnoError(8);lt.chmod(r.node,e)},chown:(t,e,r,n)=>{var o;if(!(o="string"==typeof t?lt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,e,r)=>{lt.chown(t,e,r,!0)},fchown:(t,e,r)=>{var n=lt.getStream(t);if(!n)throw new lt.ErrnoError(8);lt.chown(n.node,e,r)},truncate:(t,e)=>{if(e<0)throw new lt.ErrnoError(28);var r;if(!(r="string"==typeof t?lt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);if(lt.isDir(r.mode))throw new lt.ErrnoError(31);if(!lt.isFile(r.mode))throw new lt.ErrnoError(28);var n=lt.nodePermissions(r,"w");if(n)throw new lt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var r=lt.getStream(t);if(!r)throw new lt.ErrnoError(8);if(!(2097155&r.flags))throw new lt.ErrnoError(28);lt.truncate(r.node,e)},utime:(t,e,r)=>{var n=lt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:(t,e,r)=>{if(""===t)throw new lt.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(e="string"==typeof e?lt.modeStringToFlags(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=ot.normalize(t);try{n=lt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new lt.ErrnoError(20)}else n=lt.mknod(t,r,0),o=!0;if(!n)throw new lt.ErrnoError(44);if(lt.isChrdev(n.mode)&&(e&=-513),65536&e&&!lt.isDir(n.mode))throw new lt.ErrnoError(54);if(!o){var a=lt.mayOpen(n,e);if(a)throw new lt.ErrnoError(a)}512&e&&!o&<.truncate(n,0),e&=-131713;var s=lt.createStream({node:n,path:lt.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(lt.readFiles||(lt.readFiles={}),t in lt.readFiles||(lt.readFiles[t]=1)),s},close:t=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{lt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,r)=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new lt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new lt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:(t,e,r,n,o)=>{if(n<0||o<0)throw new lt.ErrnoError(28);if(lt.isClosed(t))throw new lt.ErrnoError(8);if(1==(2097155&t.flags))throw new lt.ErrnoError(8);if(lt.isDir(t.node.mode))throw new lt.ErrnoError(31);if(!t.stream_ops.read)throw new lt.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new lt.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write:(t,e,r,n,o,i)=>{if(n<0||o<0)throw new lt.ErrnoError(28);if(lt.isClosed(t))throw new lt.ErrnoError(8);if(!(2097155&t.flags))throw new lt.ErrnoError(8);if(lt.isDir(t.node.mode))throw new lt.ErrnoError(31);if(!t.stream_ops.write)throw new lt.ErrnoError(28);t.seekable&&1024&t.flags&<.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new lt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate:(t,e,r)=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);if(e<0||r<=0)throw new lt.ErrnoError(28);if(!(2097155&t.flags))throw new lt.ErrnoError(8);if(!lt.isFile(t.node.mode)&&!lt.isDir(t.node.mode))throw new lt.ErrnoError(43);if(!t.stream_ops.allocate)throw new lt.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:(t,e,r,n,o)=>{if(2&n&&!(2&o)&&2!=(2097155&t.flags))throw new lt.ErrnoError(2);if(1==(2097155&t.flags))throw new lt.ErrnoError(2);if(!t.stream_ops.mmap)throw new lt.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl:(t,e,r)=>{if(!t.stream_ops.ioctl)throw new lt.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=lt.open(t,e.flags),o=lt.stat(t).size,i=new Uint8Array(o);return lt.read(n,i,0,o,0),"utf8"===e.encoding?r=R(i,0):"binary"===e.encoding&&(r=i),lt.close(n),r},writeFile:(t,e,r={})=>{r.flags=r.flags||577;var n=lt.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(M(e)+1),i=I(e,o,0,o.length);lt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lt.write(n,e,0,e.byteLength,void 0,r.canOwn)}lt.close(n)},cwd:()=>lt.currentPath,chdir:t=>{var e=lt.lookupPath(t,{follow:!0});if(null===e.node)throw new lt.ErrnoError(44);if(!lt.isDir(e.node.mode))throw new lt.ErrnoError(54);var r=lt.nodePermissions(e.node,"x");if(r)throw new lt.ErrnoError(r);lt.currentPath=e.path},createDefaultDirectories:()=>{lt.mkdir("/tmp"),lt.mkdir("/home"),lt.mkdir("/home/web_user")},createDefaultDevices:()=>{lt.mkdir("/dev"),lt.registerDevice(lt.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),lt.mkdev("/dev/null",lt.makedev(1,3)),at.register(lt.makedev(5,0),at.default_tty_ops),at.register(lt.makedev(6,0),at.default_tty1_ops),lt.mkdev("/dev/tty",lt.makedev(5,0)),lt.mkdev("/dev/tty1",lt.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(g)try{var e=r(6982);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){tt("randomDevice")}}();lt.createDevice("/dev","random",t),lt.createDevice("/dev","urandom",t),lt.mkdir("/dev/shm"),lt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{lt.mkdir("/proc");var t=lt.mkdir("/proc/self");lt.mkdir("/proc/self/fd"),lt.mount({mount:()=>{var e=lt.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var r=+e,n=lt.getStream(r);if(!n)throw new lt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?lt.createDevice("/dev","stdin",i.stdin):lt.symlink("/dev/tty","/dev/stdin"),i.stdout?lt.createDevice("/dev","stdout",null,i.stdout):lt.symlink("/dev/tty","/dev/stdout"),i.stderr?lt.createDevice("/dev","stderr",null,i.stderr):lt.symlink("/dev/tty1","/dev/stderr"),lt.open("/dev/stdin",0),lt.open("/dev/stdout",1),lt.open("/dev/stderr",1)},ensureErrnoError:()=>{lt.ErrnoError||(lt.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},lt.ErrnoError.prototype=new Error,lt.ErrnoError.prototype.constructor=lt.ErrnoError,[44].forEach((t=>{lt.genericErrors[t]=new lt.ErrnoError(t),lt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{lt.ensureErrnoError(),lt.nameTable=new Array(4096),lt.mount(ct,{},"/"),lt.createDefaultDirectories(),lt.createDefaultDevices(),lt.createSpecialDirectories(),lt.filesystems={MEMFS:ct}},init:(t,e,r)=>{lt.init.initialized=!0,lt.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,lt.createStandardStreams()},quit:()=>{lt.init.initialized=!1;for(var t=0;t<lt.streams.length;t++){var e=lt.streams[t];e&<.close(e)}},getMode:(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},findObject:(t,e)=>{var r=lt.analyzePath(t,e);return r.exists?r.object:null},analyzePath:(t,e)=>{try{t=(n=lt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ot.basename(t),n=lt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath:(t,e,r,n)=>{t="string"==typeof t?t:lt.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ot.join2(t,i);try{lt.mkdir(a)}catch(t){}t=a}}return a},createFile:(t,e,r,n,o)=>{var i=ot.join2("string"==typeof t?t:lt.getPath(t),e),a=lt.getMode(n,o);return lt.create(i,a)},createDataFile:(t,e,r,n,o,i)=>{var a=e;t&&(t="string"==typeof t?t:lt.getPath(t),a=e?ot.join2(t,e):t);var s=lt.getMode(n,o),c=lt.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}lt.chmod(c,146|s);var h=lt.open(c,577);lt.write(h,r,0,r.length,0,i),lt.close(h),lt.chmod(c,s)}return c},createDevice:(t,e,r,n)=>{var o=ot.join2("string"==typeof t?t:lt.getPath(t),e),i=lt.getMode(!!r,!!n);lt.createDevice.major||(lt.createDevice.major=64);var a=lt.makedev(lt.createDevice.major++,0);return lt.registerDevice(a,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(t){throw new lt.ErrnoError(29)}if(void 0===c&&0===a)throw new lt.ErrnoError(6);if(null==c)break;a++,e[n+s]=c}return a&&(t.node.timestamp=Date.now()),a},write:(t,e,r,o,i)=>{for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new lt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),lt.mkdev(o,i,a)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=gt(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new lt.ErrnoError(29)}},createLazyFile:(t,e,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):gt(o.responseText||"",!0)})(e,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=lt.createFile(t,e,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(c.stream_ops).forEach((t=>{var e=c.stream_ops[t];u[t]=function(){return lt.forceLoadFile(c),e.apply(null,arguments)}})),u.read=(t,e,r,n,o)=>(lt.forceLoadFile(c),l(t,e,r,n,o)),u.mmap=(t,e,r,n,o)=>{lt.forceLoadFile(c);var i=st();if(!i)throw new lt.ErrnoError(48);return l(t,P,i,e,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(t,e,r,n,o,i,a,s,c,u)=>{var l=e?it.resolve(ot.join2(t,e)):t;function f(r){function f(r){u&&u(),s||lt.createDataFile(t,e,r,n,o,c),i&&i(),J()}Browser.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),J()}))||f(r)}Q(),"string"==typeof r?ut(r,(t=>f(t)),a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=lt.indexedDB();try{var o=n.open(lt.DB_NAME(),lt.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=()=>{b("creating db"),o.result.createObjectStore(lt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([lt.DB_STORE_NAME],"readwrite"),i=n.objectStore(lt.DB_STORE_NAME),a=0,s=0,c=t.length;function u(){0==s?e():r()}t.forEach((t=>{var e=i.put(lt.analyzePath(t).object.contents,t);e.onsuccess=()=>{++a+s==c&&u()},e.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=lt.indexedDB();try{var o=n.open(lt.DB_NAME(),lt.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([lt.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var a=i.objectStore(lt.DB_STORE_NAME),s=0,c=0,u=t.length;function l(){0==c?e():r()}t.forEach((t=>{var e=a.get(t);e.onsuccess=()=>{lt.analyzePath(t).exists&<.unlink(t),lt.createDataFile(ot.dirname(t),ot.basename(t),e.result,!0,!0,!0),++s+c==u&&l()},e.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r}},ft={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(ot.isAbs(e))return e;var n;if(-100===t)n=lt.cwd();else{var o=lt.getStream(t);if(!o)throw new lt.ErrnoError(8);n=o.path}if(0==e.length){if(!r)throw new lt.ErrnoError(44);return n}return ot.join2(n,e)},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&ot.normalize(e)!==ot.normalize(lt.getPath(t.node)))return-54;throw t}return C[r>>2]=n.dev,C[r+4>>2]=0,C[r+8>>2]=n.ino,C[r+12>>2]=n.mode,C[r+16>>2]=n.nlink,C[r+20>>2]=n.uid,C[r+24>>2]=n.gid,C[r+28>>2]=n.rdev,C[r+32>>2]=0,K=[n.size>>>0,(W=n.size,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],C[r+40>>2]=K[0],C[r+44>>2]=K[1],C[r+48>>2]=4096,C[r+52>>2]=n.blocks,C[r+56>>2]=n.atime.getTime()/1e3|0,C[r+60>>2]=0,C[r+64>>2]=n.mtime.getTime()/1e3|0,C[r+68>>2]=0,C[r+72>>2]=n.ctime.getTime()/1e3|0,C[r+76>>2]=0,K=[n.ino>>>0,(W=n.ino,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],C[r+80>>2]=K[0],C[r+84>>2]=K[1],0},doMsync:function(t,e,r,n,o){var i=O.slice(t,t+r);lt.msync(e,i,o,r,n)},varargs:void 0,get:function(){return ft.varargs+=4,C[ft.varargs-4>>2]},getStr:function(t){return D(t)},getStreamFromFD:function(t){var e=lt.getStream(t);if(!e)throw new lt.ErrnoError(8);return e}};function ht(t){try{return k.grow(t-A.byteLength+65535>>>16),B(k.buffer),1}catch(t){}}var pt={};function dt(){if(!dt.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var e in pt)void 0===pt[e]?delete t[e]:t[e]=pt[e];var r=[];for(var e in t)r.push(e+"="+t[e]);dt.strings=r}return dt.strings}var vt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=lt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},yt=365,mt=146;function gt(t,e,r){var n=r>0?r:M(t)+1,o=new Array(n),i=I(t,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(vt.prototype,{read:{get:function(){return(this.mode&yt)===yt},set:function(t){t?this.mode|=yt:this.mode&=-366}},write:{get:function(){return(this.mode&mt)===mt},set:function(t){t?this.mode|=mt:this.mode&=-147}},isFolder:{get:function(){return lt.isDir(this.mode)}},isDevice:{get:function(){return lt.isChrdev(this.mode)}}}),lt.FSNode=vt,lt.staticInit();var _t,wt={b:function(t,e,r,n){tt("Assertion failed: "+D(t)+", at: "+[e?D(e):"unknown filename",r,n?D(n):"unknown function"])},k:function(t,e){try{return t=ft.getStr(t),lt.chmod(t,e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},D:function(t){try{var e=ft.getStreamFromFD(t);return lt.createStream(e,0).fd}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},E:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e),-8&r)return-28;var o=lt.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&<.nodePermissions(o,i)?-2:0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},B:function(t,e){try{return lt.fchmod(t,e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},d:function(t,e,r){ft.varargs=r;try{var n=ft.getStreamFromFD(t);switch(e){case 0:return(o=ft.get())<0?-28:lt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ft.get();return n.flags|=o,0;case 5:return o=ft.get(),F[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,C[bt()>>2]=i,-1}}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}var i},z:function(t,e){try{var r=ft.getStreamFromFD(t);return ft.doStat(lt.stat,r.path,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},v:function(t,e){try{if(0===e)return-28;var r=lt.cwd(),n=M(r)+1;return e<n?-68:(N(r,t,e),n)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},l:function(t,e,r){ft.varargs=r;try{var n=ft.getStreamFromFD(t);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=ft.get();return C[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=ft.get(),lt.ioctl(n,e,o);default:tt("bad ioctl syscall "+e)}}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},x:function(t,e){try{return t=ft.getStr(t),ft.doStat(lt.lstat,t,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},u:function(t,e,r){try{return e=ft.getStr(e),e=ft.calculateAt(t,e),"/"===(e=ot.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),lt.mkdir(e,r,0),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},w:function(t,e,r,n){try{e=ft.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=ft.calculateAt(t,e,i),ft.doStat(o?lt.lstat:lt.stat,e,r)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},i:function(t,e,r,n){ft.varargs=n;try{e=ft.getStr(e),e=ft.calculateAt(t,e);var o=n?ft.get():0;return lt.open(e,r,o).fd}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},t:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e),n<=0)return-28;var o=lt.readlink(e),i=Math.min(n,M(o)),a=P[r+i];return N(o,r,n+1),P[r+i]=a,i}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},s:function(t){try{return t=ft.getStr(t),lt.rmdir(t),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},y:function(t,e){try{return t=ft.getStr(t),ft.doStat(lt.stat,t,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},r:function(t,e,r){try{return e=ft.getStr(e),e=ft.calculateAt(t,e),0===r?lt.unlink(e):512===r?lt.rmdir(e):tt("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},q:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e,!0),r){var o=C[r>>2],i=C[r+4>>2];a=1e3*o+i/1e6,s=1e3*(o=C[(r+=8)>>2])+(i=C[r+4>>2])/1e6}else var a=Date.now(),s=a;return lt.utime(e,a,s),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){tt("")},A:function(t,e,r){O.copyWithin(t,e,e+r)},e:function(t){var e,r,n=O.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),ht(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},m:function(t,e){var r=0;return dt().forEach((function(n,o){var i=e+r;T[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)P[0|e++]=t.charCodeAt(n);r||(P[0|e]=0)}(n,i),r+=n.length+1})),0},o:function(t,e){var r=dt();T[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),T[e>>2]=n,0},f:function(t){At(t)},c:function(t){try{var e=ft.getStreamFromFD(t);return lt.close(e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},p:function(t,e){try{var r=ft.getStreamFromFD(t),n=r.tty?2:lt.isDir(r.mode)?3:lt.isLink(r.mode)?7:4;return P[0|e]=n,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},h:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=T[e>>2],s=T[e+4>>2];e+=8;var c=lt.read(t,P,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}(ft.getStreamFromFD(t),e,r);return C[n>>2]=o,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},n:function(t,e,r,n,o){try{var i=(c=r)+2097152>>>0<4194305-!!(s=e)?(s>>>0)+4294967296*c:NaN;if(isNaN(i))return 61;var a=ft.getStreamFromFD(t);return lt.llseek(a,i,n),K=[a.position>>>0,(W=a.position,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],C[o>>2]=K[0],C[o+4>>2]=K[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}var s,c},g:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=T[e>>2],s=T[e+4>>2];e+=8;var c=lt.write(t,P,a,s,n);if(c<0)return-1;o+=c}return o}(ft.getStreamFromFD(t),e,r);return T[n>>2]=o,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},F:function(t){Pt(t)}},bt=(function(){var t={a:wt};function e(t,e){var r,n=t.exports;i.asm=n,B((k=i.asm.G).buffer),i.asm.K,r=i.asm.H,G.unshift(r),J()}function r(t){e(t.instance)}function n(e){return(w||!y&&!m||"function"!=typeof fetch?Promise.resolve().then((function(){return rt(q)})):fetch(q,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+q+"'";return t.arrayBuffer()})).catch((function(){return rt(q)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){E("failed to asynchronously prepare wasm: "+t),tt(t)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){return E("Module.instantiateWasm callback failed with error: "+t),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||et(q)||g||"function"!=typeof fetch?n(r):fetch(q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return E("wasm streaming compile failed: "+t),E("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.H).apply(null,arguments)},i._main=function(){return(i._main=i.asm.I).apply(null,arguments)},i.___errno_location=function(){return(bt=i.___errno_location=i.asm.J).apply(null,arguments)}),Et=i.stackAlloc=function(){return(Et=i.stackAlloc=i.asm.L).apply(null,arguments)};function kt(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function xt(t){var e=i._main;(t=t||[]).unshift(d);var r=t.length,n=Et(4*(r+1)),o=n>>2;t.forEach((t=>{C[o++]=function(t){var e=M(t)+1,r=Et(e);return I(t,P,r,e),r}(t)})),C[o]=0;try{var a=e(r,n);return At(a),a}catch(t){return function(t){if(t instanceof kt||"unwind"==t)return S;v(1,t)}(t)}}function St(t){function r(){_t||(_t=!0,i.calledRun=!0,j||(i.noFSInit||lt.init.initialized||lt.init(),lt.ignorePermissions=!1,at.init(),nt(G),nt(z),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ot&&xt(t),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||p,$>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),U.unshift(t);var t;nt(U)}(),$>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function At(t,e){S=t,Pt(t)}function Pt(t){S=t,V()||(i.onExit&&i.onExit(t),j=!0),v(t,new kt(t))}if(i.FS=lt,Z=function t(){_t||St(),_t||(Z=t)},i.run=St,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ot=!0;return i.noInitialRun&&(Ot=!1),St(),t.ready});t.exports=o},5734:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(403).TypeError,c=r(2208),u=c.errorObj,l=c.tryCatch,f=[];function h(e,r,o,i){if(a.cancellation()){var s=new t(n),c=this._finallyPromise=new t(n);this._promise=s.lastly((function(){return c})),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new t(n))._captureStackTrace()}this._stack=i,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(h,i),h.prototype._isResolved=function(){return null===this._promise},h.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},h.prototype._promiseCancelled=function(){if(!this._isResolved()){var e;if(void 0!==this._generator.return)this._promise._pushContext(),e=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},h.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=l(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},h.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=l(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},h.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},h.prototype.promise=function(){return this._promise},h.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},h.prototype._continue=function(e){var r=this._promise;if(e===u)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(e.e,!1);var n=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var i=o(n,this._promise);if(i instanceof t||(i=function(e,r,n){for(var i=0;i<r.length;++i){n._pushContext();var a=l(r[i])(e);if(n._popContext(),a===u){n._pushContext();var s=t.reject(u.e);return n._popContext(),s}var c=o(a,n);if(c instanceof t)return c}return null}(i,this._yieldHandlers,this._promise),null!==i)){var a=(i=i._target())._bitField;50397184&a?33554432&a?t._async.invoke(this._promiseFulfilled,this,i._value()):16777216&a?t._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled():(this._yieldedPromise=i,i._proxy(this,null))}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},t.coroutine=function(t,e){if("function"!=typeof t)throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(e).yieldHandler,n=h,o=(new Error).stack;return function(){var e=t.apply(this,arguments),i=new n(void 0,void 0,r,o),a=i.promise();return i._generator=e,i._promiseFulfilled(void 0),a}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new s("expecting a function but got "+c.classString(t));f.push(t)},t.spawn=function(r){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof r)return e("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new h(r,this),o=n.promise();return n._run(t.spawn),o}}},5818:(t,e,r)=>{"use strict";t.exports=function(t,e){var n={},o=r(2208),i=r(1231),a=o.withAppended,s=o.maybeWrapAsError,c=o.canEvaluate,u=r(403).TypeError,l={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),h=function(t){return o.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t};function p(t){return!f.test(t)}function d(t){try{return!0===t.__isPromisified__}catch(t){return!1}}function v(t,e,r){var n=o.getDataPropertyOrDefault(t,e+r,l);return!!n&&d(n)}function y(t,e,r,n){for(var i=o.inheritedDataKeys(t),a=[],s=0;s<i.length;++s){var c=i[s],l=t[c],f=n===h||h(c);"function"!=typeof l||d(l)||v(t,c,e)||!n(c,l,t,f)||a.push(c,l)}return function(t,e,r){for(var n=0;n<t.length;n+=2){var o=t[n];if(r.test(o))for(var i=o.replace(r,""),a=0;a<t.length;a+=2)if(t[a]===i)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}(a,e,r),a}var m;m=function(r,c,u,l,f,h){var p=Math.max(0,function(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0}(l)-1),d=function(t){for(var e=[t],r=Math.max(0,t-1-3),n=t-1;n>=r;--n)e.push(n);for(n=t+1;n<=3;++n)e.push(n);return e}(p),v="string"==typeof r||c===n;function y(t){var e,r=(e=t,o.filledRange(e,"_arg","")).join(", "),n=t>0?", ":"";return(v?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===c?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",r).replace(", ",n)}var m="string"==typeof r?"this != null ? this['"+r+"'] : fn":"fn",g="'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, "+h+"); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]",function(){for(var t="",e=0;e<d.length;++e)t+="case "+d[e]+":"+y(d[e]);return t+=" \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]",v?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",m);return g=g.replace("Parameters",function(t){return o.filledRange(Math.max(t,3),"_arg","")}(p)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",g)(t,l,c,a,s,i,o.tryCatch,o.errorObj,o.notEnumerableProp,e)};var g=c?m:function(r,c,u,l,f,h){var p=function(){return this}(),d=r;function v(){var o=c;c===n&&(o=this);var u=new t(e);u._captureStackTrace();var l="string"==typeof d&&this!==p?this[d]:r,f=i(u,h);try{l.apply(o,a(arguments,f))}catch(t){u._rejectCallback(s(t),!0,!0)}return u._isFateSealed()||u._setAsyncGuaranteed(),u}return"string"==typeof d&&(r=l),o.notEnumerableProp(v,"__isPromisified__",!0),v};function _(t,e,r,i,a){for(var s=new RegExp(e.replace(/([$])/,"\\$")+"$"),c=y(t,e,s,r),u=0,l=c.length;u<l;u+=2){var f=c[u],h=c[u+1],p=f+e;if(i===g)t[p]=g(f,n,f,h,e,a);else{var d=i(h,(function(){return g(f,n,f,h,e,a)}));o.notEnumerableProp(d,"__isPromisified__",!0),t[p]=d}}return o.toFastProperties(t),t}t.promisify=function(t,e){if("function"!=typeof t)throw new u("expecting a function but got "+o.classString(t));if(d(t))return t;var r=function(t,e,r){return g(t,e,void 0,t,null,r)}(t,void 0===(e=Object(e)).context?n:e.context,!!e.multiArgs);return o.copyDescriptors(t,r,p),r},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(e=Object(e)).multiArgs,n=e.suffix;"string"!=typeof n&&(n="Async");var i=e.filter;"function"!=typeof i&&(i=h);var a=e.promisifier;if("function"!=typeof a&&(a=g),!o.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=o.inheritedDataKeys(t),c=0;c<s.length;++c){var l=t[s[c]];"constructor"!==s[c]&&o.isClass(l)&&(_(l.prototype,n,i,a,r),_(l,n,i,a,r))}return _(t,n,i,a,r)}}},5913:(t,e,r)=>{"use strict";let n=r(2582),o=[function(){},function(t,e,r,n){if(n===e.length)throw new Error("Ran out of data");let o=e[n];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=255},function(t,e,r,n){if(n+1>=e.length)throw new Error("Ran out of data");let o=e[n];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=e[n+1]},function(t,e,r,n){if(n+2>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=255},function(t,e,r,n){if(n+3>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=e[n+3]}],i=[function(){},function(t,e,r,n){let o=e[0];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=n},function(t,e,r){let n=e[0];t[r]=n,t[r+1]=n,t[r+2]=n,t[r+3]=e[1]},function(t,e,r,n){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=n},function(t,e,r){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=e[3]}];function a(t,e,r,n,i,a){let s=t.width,c=t.height,u=t.index;for(let t=0;t<c;t++)for(let c=0;c<s;c++){let s=r(c,t,u);o[n](e,i,s,a),a+=n}return a}function s(t,e,r,n,o,a){let s=t.width,c=t.height,u=t.index;for(let t=0;t<c;t++){for(let c=0;c<s;c++){let s=o.get(n),l=r(c,t,u);i[n](e,s,l,a)}o.resetAfterLine()}}e.dataToBitMap=function(t,e){let r,o,i=e.width,c=e.height,u=e.depth,l=e.bpp,f=e.interlace;8!==u&&(r=function(t,e){let r=[],n=0;function o(){if(n===t.length)throw new Error("Ran out of data");let o,i,a,s,c,u,l,f,h=t[n];switch(n++,e){default:throw new Error("unrecognised depth");case 16:l=t[n],n++,r.push((h<<8)+l);break;case 4:l=15&h,f=h>>4,r.push(f,l);break;case 2:c=3&h,u=h>>2&3,l=h>>4&3,f=h>>6&3,r.push(f,l,u,c);break;case 1:o=1&h,i=h>>1&1,a=h>>2&1,s=h>>3&1,c=h>>4&1,u=h>>5&1,l=h>>6&1,f=h>>7&1,r.push(f,l,u,c,s,a,i,o)}}return{get:function(t){for(;r.length<t;)o();let e=r.slice(0,t);return r=r.slice(t),e},resetAfterLine:function(){r.length=0},end:function(){if(n!==t.length)throw new Error("extra data found")}}}(t,u)),o=u<=8?Buffer.alloc(i*c*4):new Uint16Array(i*c*4);let h,p,d=Math.pow(2,u)-1,v=0;if(f)h=n.getImagePasses(i,c),p=n.getInterlaceIterator(i,c);else{let t=0;p=function(){let e=t;return t+=4,e},h=[{width:i,height:c}]}for(let e=0;e<h.length;e++)8===u?v=a(h[e],o,p,l,t,v):s(h[e],o,p,l,r,d);if(8===u){if(v!==t.length)throw new Error("extra data found")}else r.end();return o}},5956:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(2208),c=s.tryCatch,u=s.errorObj,l=t._async;function f(e,r,n,o){this.constructor$(e),this._promise._captureStackTrace();var a=t._getContext();if(this._callback=s.contextBind(a,r),this._preservedValues=o===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],l.invoke(this._asyncInit,this,void 0),s.isArray(e))for(var c=0;c<e.length;++c){var u=e[c];u instanceof t&&u.suppressUnhandledRejections()}}function h(e,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+s.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return t.reject(new TypeError("options argument must be an object but it is "+s.classString(o)));if("number"!=typeof o.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+s.classString(o.concurrency)));a=o.concurrency}return new f(e,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,i).promise()}s.inherits(f,e),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(e,r){var n=this._values,i=this.length(),s=this._preservedValues,l=this._limit;if(r<0){if(n[r=-1*r-1]=e,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=c(h).call(p,e,r,i),v=f._popContext();if(a.checkForgottenReturns(d,v,null!==s?"Promise.filter":"Promise.map",f),d===u)return this._reject(d.e),!0;var y=o(d,this._promise);if(y instanceof t){var m=(y=y._target())._bitField;if(!(50397184&m))return l>=1&&this._inFlight++,n[r]=y,y._proxy(this,-1*(r+1)),!1;if(!(33554432&m))return 16777216&m?(this._reject(y._reason()),!0):(this._cancel(),!0);d=y._value()}n[r]=d}return++this._totalResolved>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},f.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},f.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),o=0,i=0;i<r;++i)t[i]&&(n[o++]=e[i]);n.length=o,this._resolve(n)},f.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return h(this,t,e,null)},t.map=function(t,e,r,n){return h(t,e,r,n)}}},6178:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(2208),c=r(403).TypeError,u=r(2208).inherits,l=s.errorObj,f=s.tryCatch,h={};function p(t){setTimeout((function(){throw t}),0)}function d(e,r){var o=0,a=e.length,s=new t(i);return function i(){if(o>=a)return s._fulfill();var c=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(e[o++]);if(c instanceof t&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),e.promise)}catch(t){return p(t)}if(c instanceof t)return c._then(i,p,null,null,null)}i()}(),s}function v(t,e,r){this._data=t,this._promise=e,this._context=r}function y(t,e,r){this.constructor$(t,e,r)}function m(t){return v.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function g(t){this.length=t,this.promise=null,this[t-1]=null}v.prototype.data=function(){return this._data},v.prototype.promise=function(){return this._promise},v.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},v.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==h?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},v.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},u(y,v),y.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},g.prototype._resultCancelled=function(){for(var e=this.length,r=0;r<e;++r){var n=this[r];n instanceof t&&n.cancel()}},t.using=function(){var r=arguments.length;if(r<2)return e("you must pass at least 2 arguments to Promise.using");var o,i=arguments[r-1];if("function"!=typeof i)return e("expecting a function but got "+s.classString(i));var c=!0;2===r&&Array.isArray(arguments[0])?(r=(o=arguments[0]).length,c=!1):(o=arguments,r--);for(var u=new g(r),h=0;h<r;++h){var p=o[h];if(v.isDisposer(p)){var y=p;(p=p.promise())._setDisposable(y)}else{var _=n(p);_ instanceof t&&(p=_._then(m,null,null,{resources:u,index:h},void 0))}u[h]=p}var w=new Array(u.length);for(h=0;h<w.length;++h)w[h]=t.resolve(u[h]).reflect();var b=t.all(w).then((function(t){for(var e=0;e<t.length;++e){var r=t[e];if(r.isRejected())return l.e=r.error(),l;if(!r.isFulfilled())return void b.cancel();t[e]=r.value()}E._pushContext(),i=f(i);var n=c?i.apply(void 0,t):i(t),o=E._popContext();return a.checkForgottenReturns(n,o,"Promise.using",E),n})),E=b.lastly((function(){var e=new t.PromiseInspection(b);return d(u,e)}));return u.promise=E,E._setOnCancel(u),E},t.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new y(t,this,o());throw new c}}},6241:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a=r(2208),s=a.tryCatch;t.method=function(r){if("function"!=typeof r)throw new t.TypeError("expecting a function but got "+a.classString(r));return function(){var n=new t(e);n._captureStackTrace(),n._pushContext();var o=s(r).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(o,a,"Promise.method",n),n._resolveFromSyncValue(o),n}},t.attempt=t.try=function(r){if("function"!=typeof r)return o("expecting a function but got "+a.classString(r));var n,c=new t(e);if(c._captureStackTrace(),c._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];n=a.isArray(u)?s(r).apply(l,u):s(r).call(l,u)}else n=s(r)();var f=c._popContext();return i.checkForgottenReturns(n,f,"Promise.try",c),c._resolveFromSyncValue(n),c},t.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},6340:(t,e,r)=>{"use strict";t.exports=function(t){var e=r(2208),n=t._async,o=e.tryCatch,i=e.errorObj;function a(t,r){if(!e.isArray(t))return s.call(this,t,r);var a=o(r).apply(this._boundValue(),[null].concat(t));a===i&&n.throwLater(a.e)}function s(t,e){var r=this._boundValue(),a=void 0===t?o(e).call(r,null):o(e).call(r,null,t);a===i&&n.throwLater(a.e)}function c(t,e){if(!t){var r=new Error(t+"");r.cause=t,t=r}var a=o(e).call(this._boundValue(),t);a===i&&n.throwLater(a.e)}t.prototype.asCallback=t.prototype.nodeify=function(t,e){if("function"==typeof t){var r=s;void 0!==e&&Object(e).spread&&(r=a),this._then(r,c,void 0,this,t)}return this}}},6402:t=>{"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},6406:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(2208),i=t.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return c(+this).thenReturn(t)},c=t.delay=function(r,o){var i,c;return void 0!==o?(i=t.resolve(o)._then(s,null,null,r,void 0),n.cancellation()&&o instanceof t&&i._setOnCancel(o)):(i=new t(e),c=setTimeout((function(){i._fulfill()}),+r),n.cancellation()&&i._setOnCancel(new a(c)),i._captureStackTrace()),i._setAsyncGuaranteed(),i};t.prototype.delay=function(t){return c(t,this)};function u(t){return clearTimeout(this.handle),t}function l(t){throw clearTimeout(this.handle),t}t.prototype.timeout=function(t,e){var r,s;t=+t;var c=new a(setTimeout((function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new i("operation timed out"):new i(e),o.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)}),t));return n.cancellation()?(s=this.then(),(r=s._then(u,l,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,l,void 0,c,void 0),r}}},6479:(t,e,r)=>{"use strict";let n=r(1402),o=r(695);e.process=function(t,e){let r=[],i=new n(t);return new o(e,{read:i.read.bind(i),write:function(t){r.push(t)},complete:function(){}}).start(),i.process(),Buffer.concat(r)}},6564:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a,s=r(2208),c=s.canEvaluate,u=s.tryCatch,l=s.errorObj;if(c){for(var f=function(t){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,t))},h=function(t){return new Function("promise","holder"," \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g,t))},p=function(e){for(var r=new Array(e),n=0;n<r.length;++n)r[n]="this.p"+(n+1);var o=r.join(" = ")+" = null;",a="var promise;\n"+r.map((function(t){return" \n promise = "+t+"; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "})).join("\n"),s=r.join(", "),c="Holder$"+e,f="return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n ";return f=f.replace(/\[TheName\]/g,c).replace(/\[TheTotal\]/g,e).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,o).replace(/\[CancellationCode\]/g,a),new Function("tryCatch","errorObj","Promise","async",f)(u,l,t,i)},d=[],v=[],y=[],m=0;m<8;++m)d.push(p(m+1)),v.push(f(m+1)),y.push(h(m+1));a=function(t){this._reject(t)}}t.join=function(){var r,i=arguments.length-1;if(i>0&&"function"==typeof arguments[i]&&(r=arguments[i],i<=8&&c)){(b=new t(o))._captureStackTrace();for(var u=new(0,d[i-1])(r),l=v,f=0;f<i;++f){var h=n(arguments[f],b);if(h instanceof t){var p=(h=h._target())._bitField;50397184&p?33554432&p?l[f].call(b,h._value(),u):16777216&p?b._reject(h._reason()):b._cancel():(h._then(l[f],a,void 0,b,u),y[f](h,u),u.asyncNeeded=!1)}else l[f].call(b,h,u)}if(!b._isFateSealed()){if(u.asyncNeeded){var m=t._getContext();u.fn=s.contextBind(m,u.fn)}b._setAsyncGuaranteed(),b._setOnCancel(u)}return b}for(var g=arguments.length,_=new Array(g),w=0;w<g;++w)_[w]=arguments[w];r&&_.pop();var b=new e(_).promise();return void 0!==r?b.spread(r):b}}},6636:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i,a,s,c,u=t._async,l=r(403).Warning,f=r(2208),h=r(7585),p=f.canAttachTrace,d=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,v=/\((?:timers\.js):\d+:\d+\)/,y=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,m=null,g=null,_=!1,w=!(0==f.env("BLUEBIRD_DEBUG")||!f.env("BLUEBIRD_DEBUG")&&"development"!==f.env("NODE_ENV")),b=!(0==f.env("BLUEBIRD_WARNINGS")||!w&&!f.env("BLUEBIRD_WARNINGS")),E=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!w&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),k=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function r(){for(var t=0;t<e.length;++t)e[t]._notifyUnhandledRejection();n()}function n(){e.length=0}c=function(t){e.push(t),setTimeout(r,1)},h.defineProperty(t,"_unhandledRejectionCheck",{value:r}),h.defineProperty(t,"_unhandledRejectionClear",{value:n})}(),t.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){524288&this._bitField||(this._setRejectionIsUnhandled(),c(this))},t.prototype._notifyUnhandledRejectionIsHandled=function(){W("rejectionHandled",i,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return!!(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),W("unhandledRejection",a,t,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(t,e,r){return H(t,e,r||this)},t.onPossiblyUnhandledRejection=function(e){var r=t._getContext();a=f.contextBind(r,e)},t.onUnhandledRejectionHandled=function(e){var r=t._getContext();i=f.contextBind(r,e)};var x=function(){};t.longStackTraces=function(){if(u.haveItemsQueued()&&!et.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!et.longStackTraces&&$()){var r=t.prototype._captureStackTrace,n=t.prototype._attachExtraTrace,o=t.prototype._dereferenceTrace;et.longStackTraces=!0,x=function(){if(u.haveItemsQueued()&&!et.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=r,t.prototype._attachExtraTrace=n,t.prototype._dereferenceTrace=o,e.deactivateLongStackTraces(),et.longStackTraces=!1},t.prototype._captureStackTrace=U,t.prototype._attachExtraTrace=G,t.prototype._dereferenceTrace=z,e.activateLongStackTraces()}},t.hasLongStackTraces=function(){return et.longStackTraces&&$()};var S={unhandledrejection:{before:function(){var t=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,t},after:function(t){f.global.onunhandledrejection=t}},rejectionhandled:{before:function(){var t=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,t},after:function(t){f.global.onrejectionhandled=t}}},A=function(){var t=function(t,e){if(!t)return!f.global.dispatchEvent(e);var r;try{return r=t.before(),!f.global.dispatchEvent(e)}finally{t.after(r)}};try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return f.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=new CustomEvent(e,{detail:r,cancelable:!0});return h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),t(S[e],n)}}if("function"==typeof Event){e=new Event("CustomEvent");return f.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=new Event(e,{cancelable:!0});return n.detail=r,h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),t(S[e],n)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!0,r),t(S[e],n)}}catch(t){}return function(){return!1}}(),P=f.isNode?function(){return process.emit.apply(process,arguments)}:f.global?function(t){var e="on"+t.toLowerCase(),r=f.global[e];return!!r&&(r.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function O(t,e){return{promise:e}}var F={promiseCreated:O,promiseFulfilled:O,promiseRejected:O,promiseResolved:O,promiseCancelled:O,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:O},C=function(t){var e=!1;try{e=P.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var r=!1;try{r=A(t,F[t].apply(null,arguments))}catch(t){u.throwLater(t),r=!0}return r||e};function T(){return!1}function j(t,e,r){var n=this;try{t(e,r,(function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+f.toString(t));n._attachCancellationCallback(t)}))}catch(t){return t}}function L(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?f.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function R(){return this._onCancelField}function D(t){this._onCancelField=t}function I(){this._cancellationParent=void 0,this._onCancelField=void 0}function N(t,e){if(1&e){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}2&e&&t._isBound()&&this._setBoundTo(t._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&x()),"warnings"in e){var r=e.warnings;et.warnings=!!r,k=et.warnings,f.isObject(r)&&"wForgottenReturn"in r&&(k=!!r.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!et.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=I,t.prototype._propagateFrom=N,t.prototype._onCancel=R,t.prototype._setOnCancel=D,t.prototype._attachCancellationCallback=L,t.prototype._execute=j,M=N,et.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!et.monitoring?(et.monitoring=!0,t.prototype._fireEvent=C):!e.monitoring&&et.monitoring&&(et.monitoring=!1,t.prototype._fireEvent=T)),"asyncHooks"in e&&f.nodeSupportsAsyncResource){var i=et.asyncHooks,a=!!e.asyncHooks;i!==a&&(et.asyncHooks=a,a?n():o())}return t},t.prototype._fireEvent=T,t.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(t){},t.prototype._attachCancellationCallback=function(t){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(t,e){};var M=function(t,e){2&e&&t._isBound()&&this._setBoundTo(t._boundTo)};function B(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function U(){this._trace=new J(this._peekContext())}function G(t,e){if(p(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=q(t);f.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),f.notEnumerableProp(t,"__stackCleaned__",!0)}}}function z(){this._trace=void 0}function H(e,r,n){if(et.warnings){var o,i=new l(e);if(r)n._attachExtraTrace(i);else if(et.longStackTraces&&(o=t._peekContext()))o.attachExtraTrace(i);else{var a=q(i);i.stack=a.message+"\n"+a.stack.join("\n")}C("warning",i)||Y(i,"",!0)}}function V(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],o=" (No stack trace)"===n||m.test(n),i=o&&X(n);o&&!i&&(_&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function q(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||m.test(n))break}return r>0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:V(e)}}function Y(t,e,r){if("undefined"!=typeof console){var n;if(f.isObject(t)){var o=t.stack;n=e+g(o,t)}else n=e+String(t);"function"==typeof s?s(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function W(t,e,r,n){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){u.throwLater(t)}"unhandledRejection"===t?C(t,r,n)||o||Y(r,"Unhandled rejection "):C(t,n)}function K(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():f.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){var e=41;if(t.length<e)return t;return t.substr(0,e-3)+"..."}(e)+">, no stack trace)"}function $(){return"function"==typeof tt}var X=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Q(t){var e=t.match(Z);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function J(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);tt(this,J),e>32&&this.uncycle()}f.inherits(J,Error),e.CapturedTrace=J,J.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,o=this;void 0!==o;++n)e.push(o),o=o._parent;for(n=(t=this._length=n)-1;n>=0;--n){var i=e[n].stack;void 0===r[i]&&(r[i]=n)}for(n=0;n<t;++n){var a=r[e[n].stack];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a<t-1?(s._parent=e[a+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var c=s._length+1,u=n-2;u>=0;--u)e[u]._length=c,c++;return}}}},J.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=q(t),r=e.message,n=[e.stack],o=this;void 0!==o;)n.push(V(o.stack.split("\n"))),o=o._parent;!function(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],o=e.length-1,i=e[o],a=-1,s=n.length-1;s>=0;--s)if(n[s]===i){a=s;break}for(s=a;s>=0;--s){var c=n[s];if(e[o]!==c)break;e.pop(),o--}e=n}}(n),function(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}(n),f.notEnumerableProp(t,"stack",function(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}(r,n)),f.notEnumerableProp(t,"__stackCleaned__",!0)}};var tt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():K(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,m=t,g=e;var r=Error.captureStackTrace;return X=function(t){return d.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n,o=new Error;if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return m=/@/,g=e,_=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return!("stack"in o)&&n&&"number"==typeof Error.stackTraceLimit?(m=t,g=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6}):(g=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?K(e):e.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(s=function(t){console.warn(t)},f.isNode&&process.stderr.isTTY?s=function(t,e){var r=e?"[33m":"[31m";console.warn(r+t+"[0m\n")}:f.isNode||"string"!=typeof(new Error).stack||(s=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var et={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&t.longStackTraces(),{asyncHooks:function(){return et.asyncHooks},longStackTraces:function(){return et.longStackTraces},warnings:function(){return et.warnings},cancellation:function(){return et.cancellation},monitoring:function(){return et.monitoring},propagateFromFunction:function(){return M},boundValueFunction:function(){return B},checkForgottenReturns:function(t,e,r,n,o){if(void 0===t&&null!==e&&k){if(void 0!==o&&o._returnedNonUndefined())return;if(!(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),c=V(s),u=c.length-1;u>=0;--u){var l=c[u];if(!v.test(l)){var f=l.match(y);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(c.length>0){var h=c[0];for(u=0;u<s.length;++u)if(s[u]===h){u>0&&(a="\n"+s[u-1]);break}}}var p="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,e)}},setBounds:function(t,e){if($()){for(var r,n,o=(t.stack||"").split("\n"),i=(e.stack||"").split("\n"),a=-1,s=-1,c=0;c<o.length;++c){if(u=Q(o[c])){r=u.fileName,a=u.line;break}}for(c=0;c<i.length;++c){var u;if(u=Q(i[c])){n=u.fileName,s=u.line;break}}a<0||s<0||!r||!n||r!==n||a>=s||(X=function(t){if(d.test(t))return!0;var e=Q(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:H,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),H(r)},CapturedTrace:J,fireDomEvent:A,fireGlobalEvent:P}}},6774:t=>{"use strict";t.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,(function(){throw e}))},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();return this.caught(r,(function(){return n}))}}},6858:t=>{"use strict";t.exports=require("commander")},6928:t=>{"use strict";t.exports=require("path")},6982:t=>{"use strict";t.exports=require("crypto")},7089:(t,e,r)=>{"use strict";let n=r(9023),o=r(3106),i=r(9402),a=r(2170),s=r(336),c=r(5913),u=r(4721),l=t.exports=function(t){i.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(l,i),l.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=o.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,e=Math.max(t,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:e});let r=t,n=this.emit.bind(this,"error");this._inflate.on("error",(function(t){r&&n(t)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){r&&(t.length>r&&(t=t.slice(0,r)),r-=t.length,i(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},l.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},l.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},l.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},l.prototype._complete=function(t){if(this.errord)return;let e;try{let r=c.dataToBitMap(t,this._bitmapInfo);e=u(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(t){return void this._handleError(t)}this.emit("parsed",e)}},7523:(t,e,r)=>{"use strict";t.exports=r.p+"toolchain/objcopy.wasm"},7585:t=>{var e=function(){"use strict";return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var r={}.hasOwnProperty,n={}.toString,o={}.constructor.prototype,i=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e};t.exports={isArray:function(t){try{return"[object Array]"===n.call(t)}catch(t){return!1}},keys:i,names:i,defineProperty:function(t,e,r){return t[e]=r.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return o}},isES5:e,propertyIsWritable:function(){return!0}}}},7613:t=>{"use strict";let e=[];!function(){for(let t=0;t<256;t++){let r=t;for(let t=0;t<8;t++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}}();let r=t.exports=function(){this._crc=-1};r.prototype.write=function(t){for(let r=0;r<t.length;r++)this._crc=e[255&(this._crc^t[r])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return~this._crc},r.crc32=function(t){let r=-1;for(let n=0;n<t.length;n++)r=e[255&(r^t[n])]^r>>>8;return~r}},7784:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(2208),i=r(403).RangeError,a=r(403).AggregateError,s=o.isArray,c={};function u(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(t),o=r.promise();return r.setHowMany(e),r.init(),o}o.inherits(u,e),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(t){this._howMany=t},u.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e<this._values.length;++e)this._values[e]!==c&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(t){this._values.push(t)},u.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new i(e)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(t,e){return l(t,e)},t.prototype.some=function(t){return l(this,t)},t._SomePromiseArray=u}},7974:t=>{"use strict";t.exports=require("cli-progress")},7988:t=>{"use strict";t.exports=function(t){var e=t._SomePromiseArray;function r(t){var r=new e(t),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}t.any=function(t){return r(t)},t.prototype.any=function(){return r(this)}}},8148:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",v=(t,e)=>{throw e},y="object"==typeof window,m="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";g?(_=m?r(6928).dirname(_)+"/":__dirname+"/",f=()=>{l||(u=r(9896),l=r(6928))},a=function(t,e){return f(),t=l.normalize(t),u.readFileSync(t,e?void 0:"utf8")},c=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{f(),t=l.normalize(t),u.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),v=(t,e)=>{if(q())throw process.exitCode=t,e;var r;(r=e)instanceof Ot||E("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}):(y||m)&&(m?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},m&&(c=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var w,b=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(v=i.quit),i.wasmBinary&&(w=i.wasmBinary);var k,x=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&et("no native wasm support detected");var S,A=!1;function P(t,e){t||et(e)}var O,F,C,T,j,L,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&R)return R.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var c=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function I(t,e){return t?D(C,t,e):""}function N(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}function M(t,e,r){return N(t,C,e,r)}function B(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function U(t){O=t,i.HEAP8=F=new Int8Array(t),i.HEAP16=T=new Int16Array(t),i.HEAP32=j=new Int32Array(t),i.HEAPU8=C=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=L=new Uint32Array(t),i.HEAPF32=new Float32Array(t),i.HEAPF64=new Float64Array(t)}i.INITIAL_MEMORY;var G=[],z=[],H=[],V=[];function q(){return x}var Y,W,K,$,X=0,Z=null,Q=null;function J(t){X++,i.monitorRunDependencies&&i.monitorRunDependencies(X)}function tt(t){if(X--,i.monitorRunDependencies&&i.monitorRunDependencies(X),0==X&&(null!==Z&&(clearInterval(Z),Z=null),Q)){var e=Q;Q=null,e()}}function et(t){i.onAbort&&i.onAbort(t),E(t="Aborted("+t+")"),A=!0,S=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function rt(t){return t.startsWith("data:application/octet-stream;base64,")}function nt(t){try{if(t==Y&&w)return new Uint8Array(w);if(c)return c(t);throw"both async and sync fetching of the wasm failed"}catch(t){et(t)}}function ot(t){for(;t.length>0;)t.shift()(i)}rt(Y="ld.wasm")||(W=Y,Y=i.locateFile?i.locateFile(W,_):_+W);var it={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=it.isAbs(t),r="/"===t.substr(-1);return(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=it.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=it.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments,0);return it.normalize(t.join("/"))},join2:(t,e)=>it.normalize(t+"/"+e)},at={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:ft.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=it.isAbs(n)}return(e?"/":"")+(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=at.resolve(t).substr(1),e=at.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},st={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){st.ttys[t]={input:[],output:[],ops:e},ft.registerDevice(t,st.stream_ops)},stream_ops:{open:function(t){var e=st.ttys[t.node.rdev];if(!e)throw new ft.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new ft.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new ft.ErrnoError(29)}if(void 0===s&&0===i)throw new ft.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new ft.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new ft.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(g){var r=Buffer.alloc(256),n=0;try{n=u.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=kt(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(b(D(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(b(D(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(E(D(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(E(D(t.output,0)),t.output=[])}}};function ct(t){et()}var ut,lt={ops_table:null,mount:function(t){return lt.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(ft.isBlkdev(r)||ft.isFIFO(r))throw new ft.ErrnoError(63);lt.ops_table||(lt.ops_table={dir:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr,lookup:lt.node_ops.lookup,mknod:lt.node_ops.mknod,rename:lt.node_ops.rename,unlink:lt.node_ops.unlink,rmdir:lt.node_ops.rmdir,readdir:lt.node_ops.readdir,symlink:lt.node_ops.symlink},stream:{llseek:lt.stream_ops.llseek}},file:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr},stream:{llseek:lt.stream_ops.llseek,read:lt.stream_ops.read,write:lt.stream_ops.write,allocate:lt.stream_ops.allocate,mmap:lt.stream_ops.mmap,msync:lt.stream_ops.msync}},link:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr,readlink:lt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr},stream:ft.chrdev_stream_ops}});var o=ft.createNode(t,e,r,n);return ft.isDir(o.mode)?(o.node_ops=lt.ops_table.dir.node,o.stream_ops=lt.ops_table.dir.stream,o.contents={}):ft.isFile(o.mode)?(o.node_ops=lt.ops_table.file.node,o.stream_ops=lt.ops_table.file.stream,o.usedBytes=0,o.contents=null):ft.isLink(o.mode)?(o.node_ops=lt.ops_table.link.node,o.stream_ops=lt.ops_table.link.stream):ft.isChrdev(o.mode)&&(o.node_ops=lt.ops_table.chrdev.node,o.stream_ops=lt.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=ft.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,ft.isDir(t.mode)?e.size=4096:ft.isFile(t.mode)?e.size=t.usedBytes:ft.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&<.resizeFileStorage(t,e.size)},lookup:function(t,e){throw ft.genericErrors[44]},mknod:function(t,e,r,n){return lt.createNode(t,e,r,n)},rename:function(t,e,r){if(ft.isDir(t.mode)){var n;try{n=ft.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new ft.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=ft.lookupNode(t,e);for(var n in r.contents)throw new ft.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=lt.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!ft.isLink(t.mode))throw new ft.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write:function(t,e,r,n,o,i){if(e.buffer===F.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(lt.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&ft.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new ft.ErrnoError(28);return n},allocate:function(t,e,r){lt.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,o){if(!ft.isFile(t.node.mode))throw new ft.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==O){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=ct()))throw new ft.ErrnoError(48);F.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(t,e,r,n,o){if(!ft.isFile(t.node.mode))throw new ft.ErrnoError(43);return 2&o||lt.stream_ops.write(t,e,0,n,r,!1),0}}},ft={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=at.resolve(ft.cwd(),t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new ft.ErrnoError(32);for(var r=it.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=ft.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=ft.lookupNode(n,r[i]),o=it.join2(o,r[i]),ft.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;ft.isLink(n.mode);){var c=ft.readlink(o);if(o=at.resolve(it.dirname(o),c),n=ft.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new ft.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var e;;){if(ft.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:(t,e)=>{for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%ft.nameTable.length},hashAddNode:t=>{var e=ft.hashName(t.parent.id,t.name);t.name_next=ft.nameTable[e],ft.nameTable[e]=t},hashRemoveNode:t=>{var e=ft.hashName(t.parent.id,t.name);if(ft.nameTable[e]===t)ft.nameTable[e]=t.name_next;else for(var r=ft.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:(t,e)=>{var r=ft.mayLookup(t);if(r)throw new ft.ErrnoError(r,t);for(var n=ft.hashName(t.id,e),o=ft.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return ft.lookup(t,e)},createNode:(t,e,r,n)=>{var o=new ft.FSNode(t,e,r,n);return ft.hashAddNode(o),o},destroyNode:t=>{ft.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var e=ft.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>ft.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=ft.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{return ft.lookupNode(t,e),20}catch(t){}return ft.nodePermissions(t,"wx")},mayDelete:(t,e,r)=>{var n;try{n=ft.lookupNode(t,e)}catch(t){return t.errno}var o=ft.nodePermissions(t,"wx");if(o)return o;if(r){if(!ft.isDir(n.mode))return 54;if(ft.isRoot(n)||ft.getPath(n)===ft.cwd())return 10}else if(ft.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?ft.isLink(t.mode)?32:ft.isDir(t.mode)&&("r"!==ft.flagsToPermissionString(e)||512&e)?31:ft.nodePermissions(t,ft.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,e=ft.MAX_OPEN_FDS)=>{for(var r=t;r<=e;r++)if(!ft.streams[r])return r;throw new ft.ErrnoError(33)},getStream:t=>ft.streams[t],createStream:(t,e,r)=>{ft.FSStream||(ft.FSStream=function(){this.shared={}},ft.FSStream.prototype={},Object.defineProperties(ft.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new ft.FSStream,t);var n=ft.nextfd(e,r);return t.fd=n,ft.streams[n]=t,t},closeStream:t=>{ft.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=ft.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new ft.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{ft.devices[t]={stream_ops:e}},getDevice:t=>ft.devices[t],getMounts:t=>{for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),ft.syncFSRequests++,ft.syncFSRequests>1&&E("warning: "+ft.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=ft.getMounts(ft.root.mount),n=0;function o(t){return ft.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount:(t,e,r)=>{var n,o="/"===r,i=!r;if(o&&ft.root)throw new ft.ErrnoError(10);if(!o&&!i){var a=ft.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,ft.isMountpoint(n))throw new ft.ErrnoError(10);if(!ft.isDir(n.mode))throw new ft.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},c=t.mount(s);return c.mount=s,s.root=c,o?ft.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:t=>{var e=ft.lookupPath(t,{follow_mount:!1});if(!ft.isMountpoint(e.node))throw new ft.ErrnoError(28);var r=e.node,n=r.mounted,o=ft.getMounts(n);Object.keys(ft.nameTable).forEach((t=>{for(var e=ft.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&ft.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,r)=>{var n=ft.lookupPath(t,{parent:!0}).node,o=it.basename(t);if(!o||"."===o||".."===o)throw new ft.ErrnoError(28);var i=ft.mayCreate(n,o);if(i)throw new ft.ErrnoError(i);if(!n.node_ops.mknod)throw new ft.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,ft.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,ft.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{ft.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>(void 0===r&&(r=e,e=438),e|=8192,ft.mknod(t,e,r)),symlink:(t,e)=>{if(!at.resolve(t))throw new ft.ErrnoError(44);var r=ft.lookupPath(e,{parent:!0}).node;if(!r)throw new ft.ErrnoError(44);var n=it.basename(e),o=ft.mayCreate(r,n);if(o)throw new ft.ErrnoError(o);if(!r.node_ops.symlink)throw new ft.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:(t,e)=>{var r,n,o=it.dirname(t),i=it.dirname(e),a=it.basename(t),s=it.basename(e);if(r=ft.lookupPath(t,{parent:!0}).node,n=ft.lookupPath(e,{parent:!0}).node,!r||!n)throw new ft.ErrnoError(44);if(r.mount!==n.mount)throw new ft.ErrnoError(75);var c,u=ft.lookupNode(r,a),l=at.relative(t,i);if("."!==l.charAt(0))throw new ft.ErrnoError(28);if("."!==(l=at.relative(e,o)).charAt(0))throw new ft.ErrnoError(55);try{c=ft.lookupNode(n,s)}catch(t){}if(u!==c){var f=ft.isDir(u.mode),h=ft.mayDelete(r,a,f);if(h)throw new ft.ErrnoError(h);if(h=c?ft.mayDelete(n,s,f):ft.mayCreate(n,s))throw new ft.ErrnoError(h);if(!r.node_ops.rename)throw new ft.ErrnoError(63);if(ft.isMountpoint(u)||c&&ft.isMountpoint(c))throw new ft.ErrnoError(10);if(n!==r&&(h=ft.nodePermissions(r,"w")))throw new ft.ErrnoError(h);ft.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(t){throw t}finally{ft.hashAddNode(u)}}},rmdir:t=>{var e=ft.lookupPath(t,{parent:!0}).node,r=it.basename(t),n=ft.lookupNode(e,r),o=ft.mayDelete(e,r,!0);if(o)throw new ft.ErrnoError(o);if(!e.node_ops.rmdir)throw new ft.ErrnoError(63);if(ft.isMountpoint(n))throw new ft.ErrnoError(10);e.node_ops.rmdir(e,r),ft.destroyNode(n)},readdir:t=>{var e=ft.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new ft.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=ft.lookupPath(t,{parent:!0}).node;if(!e)throw new ft.ErrnoError(44);var r=it.basename(t),n=ft.lookupNode(e,r),o=ft.mayDelete(e,r,!1);if(o)throw new ft.ErrnoError(o);if(!e.node_ops.unlink)throw new ft.ErrnoError(63);if(ft.isMountpoint(n))throw new ft.ErrnoError(10);e.node_ops.unlink(e,r),ft.destroyNode(n)},readlink:t=>{var e=ft.lookupPath(t).node;if(!e)throw new ft.ErrnoError(44);if(!e.node_ops.readlink)throw new ft.ErrnoError(28);return at.resolve(ft.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var r=ft.lookupPath(t,{follow:!e}).node;if(!r)throw new ft.ErrnoError(44);if(!r.node_ops.getattr)throw new ft.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>ft.stat(t,!0),chmod:(t,e,r)=>{var n;if(!(n="string"==typeof t?ft.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new ft.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,e)=>{ft.chmod(t,e,!0)},fchmod:(t,e)=>{var r=ft.getStream(t);if(!r)throw new ft.ErrnoError(8);ft.chmod(r.node,e)},chown:(t,e,r,n)=>{var o;if(!(o="string"==typeof t?ft.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new ft.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,e,r)=>{ft.chown(t,e,r,!0)},fchown:(t,e,r)=>{var n=ft.getStream(t);if(!n)throw new ft.ErrnoError(8);ft.chown(n.node,e,r)},truncate:(t,e)=>{if(e<0)throw new ft.ErrnoError(28);var r;if(!(r="string"==typeof t?ft.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new ft.ErrnoError(63);if(ft.isDir(r.mode))throw new ft.ErrnoError(31);if(!ft.isFile(r.mode))throw new ft.ErrnoError(28);var n=ft.nodePermissions(r,"w");if(n)throw new ft.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var r=ft.getStream(t);if(!r)throw new ft.ErrnoError(8);if(!(2097155&r.flags))throw new ft.ErrnoError(28);ft.truncate(r.node,e)},utime:(t,e,r)=>{var n=ft.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:(t,e,r)=>{if(""===t)throw new ft.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(e="string"==typeof e?ft.modeStringToFlags(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=it.normalize(t);try{n=ft.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new ft.ErrnoError(20)}else n=ft.mknod(t,r,0),o=!0;if(!n)throw new ft.ErrnoError(44);if(ft.isChrdev(n.mode)&&(e&=-513),65536&e&&!ft.isDir(n.mode))throw new ft.ErrnoError(54);if(!o){var a=ft.mayOpen(n,e);if(a)throw new ft.ErrnoError(a)}512&e&&!o&&ft.truncate(n,0),e&=-131713;var s=ft.createStream({node:n,path:ft.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(ft.readFiles||(ft.readFiles={}),t in ft.readFiles||(ft.readFiles[t]=1)),s},close:t=>{if(ft.isClosed(t))throw new ft.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{ft.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,r)=>{if(ft.isClosed(t))throw new ft.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new ft.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new ft.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:(t,e,r,n,o)=>{if(n<0||o<0)throw new ft.ErrnoError(28);if(ft.isClosed(t))throw new ft.ErrnoError(8);if(1==(2097155&t.flags))throw new ft.ErrnoError(8);if(ft.isDir(t.node.mode))throw new ft.ErrnoError(31);if(!t.stream_ops.read)throw new ft.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new ft.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write:(t,e,r,n,o,i)=>{if(n<0||o<0)throw new ft.ErrnoError(28);if(ft.isClosed(t))throw new ft.ErrnoError(8);if(!(2097155&t.flags))throw new ft.ErrnoError(8);if(ft.isDir(t.node.mode))throw new ft.ErrnoError(31);if(!t.stream_ops.write)throw new ft.ErrnoError(28);t.seekable&&1024&t.flags&&ft.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new ft.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate:(t,e,r)=>{if(ft.isClosed(t))throw new ft.ErrnoError(8);if(e<0||r<=0)throw new ft.ErrnoError(28);if(!(2097155&t.flags))throw new ft.ErrnoError(8);if(!ft.isFile(t.node.mode)&&!ft.isDir(t.node.mode))throw new ft.ErrnoError(43);if(!t.stream_ops.allocate)throw new ft.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:(t,e,r,n,o)=>{if(2&n&&!(2&o)&&2!=(2097155&t.flags))throw new ft.ErrnoError(2);if(1==(2097155&t.flags))throw new ft.ErrnoError(2);if(!t.stream_ops.mmap)throw new ft.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl:(t,e,r)=>{if(!t.stream_ops.ioctl)throw new ft.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=ft.open(t,e.flags),o=ft.stat(t).size,i=new Uint8Array(o);return ft.read(n,i,0,o,0),"utf8"===e.encoding?r=D(i,0):"binary"===e.encoding&&(r=i),ft.close(n),r},writeFile:(t,e,r={})=>{r.flags=r.flags||577;var n=ft.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(B(e)+1),i=N(e,o,0,o.length);ft.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");ft.write(n,e,0,e.byteLength,void 0,r.canOwn)}ft.close(n)},cwd:()=>ft.currentPath,chdir:t=>{var e=ft.lookupPath(t,{follow:!0});if(null===e.node)throw new ft.ErrnoError(44);if(!ft.isDir(e.node.mode))throw new ft.ErrnoError(54);var r=ft.nodePermissions(e.node,"x");if(r)throw new ft.ErrnoError(r);ft.currentPath=e.path},createDefaultDirectories:()=>{ft.mkdir("/tmp"),ft.mkdir("/home"),ft.mkdir("/home/web_user")},createDefaultDevices:()=>{ft.mkdir("/dev"),ft.registerDevice(ft.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),ft.mkdev("/dev/null",ft.makedev(1,3)),st.register(ft.makedev(5,0),st.default_tty_ops),st.register(ft.makedev(6,0),st.default_tty1_ops),ft.mkdev("/dev/tty",ft.makedev(5,0)),ft.mkdev("/dev/tty1",ft.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(g)try{var e=r(6982);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){et("randomDevice")}}();ft.createDevice("/dev","random",t),ft.createDevice("/dev","urandom",t),ft.mkdir("/dev/shm"),ft.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{ft.mkdir("/proc");var t=ft.mkdir("/proc/self");ft.mkdir("/proc/self/fd"),ft.mount({mount:()=>{var e=ft.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var r=+e,n=ft.getStream(r);if(!n)throw new ft.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?ft.createDevice("/dev","stdin",i.stdin):ft.symlink("/dev/tty","/dev/stdin"),i.stdout?ft.createDevice("/dev","stdout",null,i.stdout):ft.symlink("/dev/tty","/dev/stdout"),i.stderr?ft.createDevice("/dev","stderr",null,i.stderr):ft.symlink("/dev/tty1","/dev/stderr"),ft.open("/dev/stdin",0),ft.open("/dev/stdout",1),ft.open("/dev/stderr",1)},ensureErrnoError:()=>{ft.ErrnoError||(ft.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},ft.ErrnoError.prototype=new Error,ft.ErrnoError.prototype.constructor=ft.ErrnoError,[44].forEach((t=>{ft.genericErrors[t]=new ft.ErrnoError(t),ft.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{ft.ensureErrnoError(),ft.nameTable=new Array(4096),ft.mount(lt,{},"/"),ft.createDefaultDirectories(),ft.createDefaultDevices(),ft.createSpecialDirectories(),ft.filesystems={MEMFS:lt}},init:(t,e,r)=>{ft.init.initialized=!0,ft.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,ft.createStandardStreams()},quit:()=>{ft.init.initialized=!1;for(var t=0;t<ft.streams.length;t++){var e=ft.streams[t];e&&ft.close(e)}},getMode:(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},findObject:(t,e)=>{var r=ft.analyzePath(t,e);return r.exists?r.object:null},analyzePath:(t,e)=>{try{t=(n=ft.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ft.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=it.basename(t),n=ft.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath:(t,e,r,n)=>{t="string"==typeof t?t:ft.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=it.join2(t,i);try{ft.mkdir(a)}catch(t){}t=a}}return a},createFile:(t,e,r,n,o)=>{var i=it.join2("string"==typeof t?t:ft.getPath(t),e),a=ft.getMode(n,o);return ft.create(i,a)},createDataFile:(t,e,r,n,o,i)=>{var a=e;t&&(t="string"==typeof t?t:ft.getPath(t),a=e?it.join2(t,e):t);var s=ft.getMode(n,o),c=ft.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}ft.chmod(c,146|s);var h=ft.open(c,577);ft.write(h,r,0,r.length,0,i),ft.close(h),ft.chmod(c,s)}return c},createDevice:(t,e,r,n)=>{var o=it.join2("string"==typeof t?t:ft.getPath(t),e),i=ft.getMode(!!r,!!n);ft.createDevice.major||(ft.createDevice.major=64);var a=ft.makedev(ft.createDevice.major++,0);return ft.registerDevice(a,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(t){throw new ft.ErrnoError(29)}if(void 0===c&&0===a)throw new ft.ErrnoError(6);if(null==c)break;a++,e[n+s]=c}return a&&(t.node.timestamp=Date.now()),a},write:(t,e,r,o,i)=>{for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new ft.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),ft.mkdev(o,i,a)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=kt(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new ft.ErrnoError(29)}},createLazyFile:(t,e,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):kt(o.responseText||"",!0)})(e,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=ft.createFile(t,e,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(c.stream_ops).forEach((t=>{var e=c.stream_ops[t];u[t]=function(){return ft.forceLoadFile(c),e.apply(null,arguments)}})),u.read=(t,e,r,n,o)=>(ft.forceLoadFile(c),l(t,e,r,n,o)),u.mmap=(t,e,r,n,o)=>{ft.forceLoadFile(c);var i=ct();if(!i)throw new ft.ErrnoError(48);return l(t,F,i,e,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(t,e,r,n,o,i,a,c,u,l)=>{var f=e?at.resolve(it.join2(t,e)):t;function h(r){function s(r){l&&l(),c||ft.createDataFile(t,e,r,n,o,u),i&&i(),tt()}Browser.handledByPreloadPlugin(r,f,s,(()=>{a&&a(),tt()}))||s(r)}J(),"string"==typeof r?function(t,e,r,n){var o=n?"":"al "+t;s(t,(function(r){P(r,'Loading data file "'+t+'" failed (no arrayBuffer).'),e(new Uint8Array(r)),o&&tt()}),(function(e){if(!r)throw'Loading data file "'+t+'" failed.';r()})),o&&J()}(r,(t=>h(t)),a):h(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=ft.indexedDB();try{var o=n.open(ft.DB_NAME(),ft.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=()=>{b("creating db"),o.result.createObjectStore(ft.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([ft.DB_STORE_NAME],"readwrite"),i=n.objectStore(ft.DB_STORE_NAME),a=0,s=0,c=t.length;function u(){0==s?e():r()}t.forEach((t=>{var e=i.put(ft.analyzePath(t).object.contents,t);e.onsuccess=()=>{++a+s==c&&u()},e.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=ft.indexedDB();try{var o=n.open(ft.DB_NAME(),ft.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([ft.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var a=i.objectStore(ft.DB_STORE_NAME),s=0,c=0,u=t.length;function l(){0==c?e():r()}t.forEach((t=>{var e=a.get(t);e.onsuccess=()=>{ft.analyzePath(t).exists&&ft.unlink(t),ft.createDataFile(it.dirname(t),it.basename(t),e.result,!0,!0,!0),++s+c==u&&l()},e.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r}},ht={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(it.isAbs(e))return e;var n;if(-100===t)n=ft.cwd();else{var o=ft.getStream(t);if(!o)throw new ft.ErrnoError(8);n=o.path}if(0==e.length){if(!r)throw new ft.ErrnoError(44);return n}return it.join2(n,e)},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&it.normalize(e)!==it.normalize(ft.getPath(t.node)))return-54;throw t}return j[r>>2]=n.dev,j[r+4>>2]=0,j[r+8>>2]=n.ino,j[r+12>>2]=n.mode,j[r+16>>2]=n.nlink,j[r+20>>2]=n.uid,j[r+24>>2]=n.gid,j[r+28>>2]=n.rdev,j[r+32>>2]=0,$=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],j[r+40>>2]=$[0],j[r+44>>2]=$[1],j[r+48>>2]=4096,j[r+52>>2]=n.blocks,j[r+56>>2]=n.atime.getTime()/1e3|0,j[r+60>>2]=0,j[r+64>>2]=n.mtime.getTime()/1e3|0,j[r+68>>2]=0,j[r+72>>2]=n.ctime.getTime()/1e3|0,j[r+76>>2]=0,$=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],j[r+80>>2]=$[0],j[r+84>>2]=$[1],0},doMsync:function(t,e,r,n,o){var i=C.slice(t,t+r);ft.msync(e,i,o,r,n)},varargs:void 0,get:function(){return ht.varargs+=4,j[ht.varargs-4>>2]},getStr:function(t){return I(t)},getStreamFromFD:function(t){var e=ft.getStream(t);if(!e)throw new ft.ErrnoError(8);return e}},pt={BUCKET_BUFFER_SIZE:8192,mount:function(t){return ft.createNode(null,"/",16895,0)},createPipe:function(){var t={buckets:[],refcnt:2};t.buckets.push({buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var e=pt.nextname(),r=pt.nextname(),n=ft.createNode(pt.root,e,4096,0),o=ft.createNode(pt.root,r,4096,0);n.pipe=t,o.pipe=t;var i=ft.createStream({path:e,node:n,flags:0,seekable:!1,stream_ops:pt.stream_ops});n.stream=i;var a=ft.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:pt.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(t){var e=t.node.pipe;if(1==(2097155&t.flags))return 260;if(e.buckets.length>0)for(var r=0;r<e.buckets.length;r++){var n=e.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(t,e,r){return 28},fsync:function(t){return 28},read:function(t,e,r,n,o){for(var i=t.node.pipe,a=0,s=0;s<i.buckets.length;s++){var c=i.buckets[s];a+=c.offset-c.roffset}P(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var u=e.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new ft.ErrnoError(6);var l=Math.min(a,n),f=l,h=0;for(s=0;s<i.buckets.length;s++){var p=i.buckets[s],d=p.offset-p.roffset;if(l<=d){var v=p.buffer.subarray(p.roffset,p.offset);l<d?(v=v.subarray(0,l),p.roffset+=l):h++,u.set(v);break}v=p.buffer.subarray(p.roffset,p.offset),u.set(v),u=u.subarray(v.byteLength),l-=v.byteLength,h++}return h&&h==i.buckets.length&&(h--,i.buckets[h].offset=0,i.buckets[h].roffset=0),i.buckets.splice(0,h),f},write:function(t,e,r,n,o){var i=t.node.pipe;P(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var a=e.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var c=null;0==i.buckets.length?(c={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(c)):c=i.buckets[i.buckets.length-1],P(c.offset<=pt.BUCKET_BUFFER_SIZE);var u=pt.BUCKET_BUFFER_SIZE-c.offset;if(u>=s)return c.buffer.set(a,c.offset),c.offset+=s,s;u>0&&(c.buffer.set(a.subarray(0,u),c.offset),c.offset+=u,a=a.subarray(u,a.byteLength));for(var l=a.byteLength/pt.BUCKET_BUFFER_SIZE|0,f=a.byteLength%pt.BUCKET_BUFFER_SIZE,h=0;h<l;h++){var p={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:pt.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(p),p.buffer.set(a.subarray(0,pt.BUCKET_BUFFER_SIZE)),a=a.subarray(pt.BUCKET_BUFFER_SIZE,a.byteLength)}return f>0&&(p={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(p),p.buffer.set(a)),s},close:function(t){var e=t.node.pipe;e.refcnt--,0===e.refcnt&&(e.buckets=null)}},nextname:function(){return pt.nextname.current||(pt.nextname.current=0),"pipe["+pt.nextname.current+++"]"}},dt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function vt(t){try{return k.grow(t-O.byteLength+65535>>>16),U(k.buffer),1}catch(t){}}ut=g?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var yt={};function mt(){if(!mt.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var e in yt)void 0===yt[e]?delete t[e]:t[e]=yt[e];var r=[];for(var e in t)r.push(e+"="+t[e]);mt.strings=r}return mt.strings}function gt(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=L[e>>2],s=L[e+4>>2];e+=8;var c=ft.read(t,F,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}function _t(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}var wt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=ft.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},bt=365,Et=146;function kt(t,e,r){var n=r>0?r:B(t)+1,o=new Array(n),i=N(t,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(wt.prototype,{read:{get:function(){return(this.mode&bt)===bt},set:function(t){t?this.mode|=bt:this.mode&=-366}},write:{get:function(){return(this.mode&Et)===Et},set:function(t){t?this.mode|=Et:this.mode&=-147}},isFolder:{get:function(){return ft.isDir(this.mode)}},isDevice:{get:function(){return ft.isChrdev(this.mode)}}}),ft.FSNode=wt,ft.staticInit();var xt,St={a:function(t,e,r,n){et("Assertion failed: "+I(t)+", at: "+[e?I(e):"unknown filename",r,n?I(n):"unknown function"])},G:function(t,e){try{return t=ht.getStr(t),ft.chmod(t,e),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},F:function(t){try{var e=ht.getStreamFromFD(t);return ft.createStream(e,0).fd}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},H:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e),-8&r)return-28;var o=ft.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&ft.nodePermissions(o,i)?-2:0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},e:function(t,e,r){ht.varargs=r;try{var n=ht.getStreamFromFD(t);switch(e){case 0:return(o=ht.get())<0?-28:ft.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ht.get();return n.flags|=o,0;case 5:return o=ht.get(),T[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,j[At()>>2]=i,-1}}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}var i},z:function(t,e){try{var r=ht.getStreamFromFD(t);return ht.doStat(ft.stat,r.path,e)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},v:function(t,e){try{if(0===e)return-28;var r=ft.cwd(),n=B(r)+1;return e<n?-68:(M(r,t,e),n)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},m:function(t,e,r){ht.varargs=r;try{var n=ht.getStreamFromFD(t);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=ht.get();return j[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=ht.get(),ft.ioctl(n,e,o);default:et("bad ioctl syscall "+e)}}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},x:function(t,e){try{return t=ht.getStr(t),ht.doStat(ft.lstat,t,e)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},w:function(t,e,r,n){try{e=ht.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=ht.calculateAt(t,e,i),ht.doStat(o?ft.lstat:ft.stat,e,r)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},h:function(t,e,r,n){ht.varargs=n;try{e=ht.getStr(e),e=ht.calculateAt(t,e);var o=n?ht.get():0;return ft.open(e,r,o).fd}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},t:function(t){try{if(0==t)throw new ft.ErrnoError(21);var e=pt.createPipe();return j[t>>2]=e.readable_fd,j[t+4>>2]=e.writable_fd,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},s:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e),n<=0)return-28;var o=ft.readlink(e),i=Math.min(n,B(o)),a=F[r+i];return M(o,r,n+1),F[r+i]=a,i}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},q:function(t){try{return t=ht.getStr(t),ft.rmdir(t),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},y:function(t,e){try{return t=ht.getStr(t),ht.doStat(ft.stat,t,e)}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},g:function(t,e,r){try{return e=ht.getStr(e),e=ht.calculateAt(t,e),0===r?ft.unlink(e):512===r?ft.rmdir(e):et("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return-t.errno}},C:function(t){},E:function(t,e){et(dt)},D:function(t,e){et(dt)},l:function(){return Date.now()},B:function(){return!0},b:function(){et("")},k:ut,A:function(t,e,r){C.copyWithin(t,e,e+r)},f:function(t){var e,r,n=C.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),vt(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},n:function(t,e){var r=0;return mt().forEach((function(n,o){var i=e+r;L[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)F[0|e++]=t.charCodeAt(n);r||(F[0|e]=0)}(n,i),r+=n.length+1})),0},r:function(t,e){var r=mt();L[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),L[e>>2]=n,0},d:function(t){Tt(t)},c:function(t){try{var e=ht.getStreamFromFD(t);return ft.close(e),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},u:function(t,e){try{var r=ht.getStreamFromFD(t),n=r.tty?2:ft.isDir(r.mode)?3:ft.isLink(r.mode)?7:4;return F[0|e]=n,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},o:function(t,e,r,n,o,i){try{var a=_t(n,o);if(isNaN(a))return 61;var s=gt(ht.getStreamFromFD(t),e,r,a);return j[i>>2]=s,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},j:function(t,e,r,n){try{var o=gt(ht.getStreamFromFD(t),e,r);return j[n>>2]=o,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},p:function(t,e,r,n,o){try{var i=_t(e,r);if(isNaN(i))return 61;var a=ht.getStreamFromFD(t);return ft.llseek(a,i,n),$=[a.position>>>0,(K=a.position,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],j[o>>2]=$[0],j[o+4>>2]=$[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},i:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=L[e>>2],s=L[e+4>>2];e+=8;var c=ft.write(t,F,a,s,n);if(c<0)return-1;o+=c}return o}(ht.getStreamFromFD(t),e,r);return L[n>>2]=o,0}catch(t){if(void 0===ft||!(t instanceof ft.ErrnoError))throw t;return t.errno}},I:function(t){jt(t)}},At=(function(){var t={a:St};function e(t,e){var r,n=t.exports;i.asm=n,U((k=i.asm.J).buffer),i.asm.N,r=i.asm.K,z.unshift(r),tt()}function r(t){e(t.instance)}function n(e){return(w||!y&&!m||"function"!=typeof fetch?Promise.resolve().then((function(){return nt(Y)})):fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Y+"'";return t.arrayBuffer()})).catch((function(){return nt(Y)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){E("failed to asynchronously prepare wasm: "+t),et(t)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){return E("Module.instantiateWasm callback failed with error: "+t),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||rt(Y)||g||"function"!=typeof fetch?n(r):fetch(Y,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return E("wasm streaming compile failed: "+t),E("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i.___errno_location=function(){return(At=i.___errno_location=i.asm.L).apply(null,arguments)}),Pt=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Pt=i.stackAlloc=i.asm.O).apply(null,arguments)});function Ot(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Ft(t){var e=i._main;(t=t||[]).unshift(d);var r=t.length,n=Pt(4*(r+1)),o=n>>2;t.forEach((t=>{j[o++]=function(t){var e=B(t)+1,r=Pt(e);return N(t,F,r,e),r}(t)})),j[o]=0;try{var a=e(r,n);return Tt(a),a}catch(t){return function(t){if(t instanceof Ot||"unwind"==t)return S;v(1,t)}(t)}}function Ct(t){function r(){xt||(xt=!0,i.calledRun=!0,A||(i.noFSInit||ft.init.initialized||ft.init(),ft.ignorePermissions=!1,st.init(),pt.root=ft.mount(pt,{},null),ot(z),ot(H),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Lt&&Ft(t),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),V.unshift(t);var t;ot(V)}()))}t=t||p,X>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),G.unshift(t);var t;ot(G)}(),X>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Tt(t,e){S=t,jt(t)}function jt(t){S=t,q()||(i.onExit&&i.onExit(t),A=!0),v(t,new Ot(t))}if(i.FS=ft,Q=function t(){xt||Ct(),xt||(Q=t)},i.run=Ct,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Lt=!0;return i.noInitialRun&&(Lt=!1),Ct(),t.ready});t.exports=o},8210:(t,e,r)=>{"use strict";var n;try{throw new Error}catch(t){n=t}var o=r(1065),i=r(9937);function a(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=o}function s(t){for(;t.length()>0;)c(t)}function c(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}a.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},a.prototype.hasCustomScheduler=function(){return this._customScheduler},a.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},a.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},a.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout((function(){t(e)}),0);else try{this._schedule((function(){t(e)}))}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.prototype.invokeLater=function(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()},a.prototype.invoke=function(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()},a.prototype.settlePromises=function(t){this._normalQueue._pushOne(t),this._queueTick()},a.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},a.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},a.prototype._reset=function(){this._isTickUsed=!1},t.exports=a,t.exports.firstLineError=n},8722:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(2208),c=s.tryCatch;function u(e,r,n,o){this.constructor$(e);var a=t._getContext();this._fn=s.contextBind(a,r),void 0!==n&&(n=t.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function f(t,e,r,o){return"function"!=typeof e?n("expecting a function but got "+s.classString(e)):new u(t,e,r,o).promise()}function h(e){this.accum=e,this.array._gotAccum(e);var r=o(this.value,this.array._promise);return r instanceof t?(this.array._currentCancellable=r,r._then(p,void 0,void 0,this,void 0)):p.call(this,r)}function p(e){var r,n=this.array,o=n._promise,i=c(n._fn);o._pushContext(),(r=void 0!==n._eachValues?i.call(o._boundValue(),e,this.index,this.length):i.call(o._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=r);var s=o._popContext();return a.checkForgottenReturns(r,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",o),r}s.inherits(u,e),u.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==i&&this._eachValues.push(t)},u.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},u.prototype._init=function(){},u.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},u.prototype.shouldCopyValues=function(){return!1},u.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},u.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},u.prototype._iterate=function(e){var r,n;this._values=e;var o=e.length;void 0!==this._initialValue?(r=this._initialValue,n=0):(r=t.resolve(e[0]),n=1),this._currentCancellable=r;for(var i=n;i<o;++i){var a=e[i];a instanceof t&&a.suppressUnhandledRejections()}if(!r.isRejected())for(;n<o;++n){var s={accum:null,value:e[n],index:n,length:o,array:this};r=r._then(h,void 0,void 0,s,void 0),127&n||r._setNoAsyncGuarantee()}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(l,l,void 0,r,this)},t.prototype.reduce=function(t,e){return f(this,t,e,null)},t.reduce=function(t,e,r,n){return f(t,e,r,n)}}},8974:(t,e,r)=>{"use strict";t.exports=function(t,e){var n=r(2208),o=n.errorObj,i=n.isObject;var a={}.hasOwnProperty;return function(r,s){if(i(r)){if(r instanceof t)return r;var c=function(t){try{return function(t){return t.then}(t)}catch(t){return o.e=t,o}}(r);if(c===o){s&&s._pushContext();var u=t.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c){if(function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(r)){u=new t(e);return r._then(u._fulfill,u._reject,void 0,u,null),u}return function(r,i,a){var s=new t(e),c=s;a&&a._pushContext();s._captureStackTrace(),a&&a._popContext();var u=!0,l=n.tryCatch(i).call(r,f,h);u=!1,s&&l===o&&(s._rejectCallback(l.e,!0,!0),s=null);function f(t){s&&(s._resolveCallback(t),s=null)}function h(t){s&&(s._rejectCallback(t,u,!0),s=null)}return c}(r,c,s)}}return r}}},9023:t=>{"use strict";t.exports=require("util")},9047:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=t.PromiseInspection;function i(t){this.constructor$(t)}r(2208).inherits(i,e),i.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var r=new o;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},i.prototype._promiseRejected=function(t,e){var r=new o;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},t.settle=function(t){return n.deprecated(".settle()",".reflect()"),new i(t).promise()},t.allSettled=function(t){return new i(t).promise()},t.prototype.settle=function(){return t.settle(this)}}},9110:(t,e)=>{!function(t){var e=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,a=/\u2028/,s=/\u2029/;function c(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function u(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function l(t,e,r){if(e.charAt(r)!=t.charAt(0))return!1;for(var n=1,o=t.length;n<o;n++)if(e.charAt(r+n)!=t.charAt(n))return!1;return!0}t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(r,n){var o=r.length,i=0,a=null,s=null,f="",h=[],p=!1,d=0,v=0,y="{{",m="}}";function g(){f.length>0&&(h.push({tag:"_t",text:new String(f)}),f="")}function _(r,n){if(g(),r&&function(){for(var r=!0,n=v;n<h.length;n++)if(!(r=t.tags[h[n].tag]<t.tags._v||"_t"==h[n].tag&&null===h[n].text.match(e)))return!1;return r}())for(var o,i=v;i<h.length;i++)h[i].text&&((o=h[i+1])&&">"==o.tag&&(o.indent=h[i].text.toString()),h.splice(i,1));else n||h.push({tag:"\n"});p=!1,v=h.length}function w(t,e){var r="="+m,n=t.indexOf(r,e),o=u(t.substring(t.indexOf("=",e)+1,n)).split(" ");return y=o[0],m=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),y=n[0],m=n[1]),d=0;d<o;d++)0==i?l(y,r,d)?(--d,g(),i=1):"\n"==r.charAt(d)?_(p):f+=r.charAt(d):1==i?(d+=y.length-1,"="==(a=(s=t.tags[r.charAt(d+1)])?r.charAt(d+1):"_v")?(d=w(r,d),i=0):(s&&d++,i=2),p=d):l(m,r,d)?(h.push({tag:a,n:u(f),otag:y,ctag:m,i:"/"==a?p-y.length:d+m.length}),f="",d+=m.length-1,i=0,"{"==a&&("}}"==m?d++:c(h[h.length-1]))):f+=r.charAt(d);return _(p,!0),h};var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(e,r,n,o){var i,a=[],s=null,c=null;for(i=n[n.length-1];e.length>0;){if(c=e.shift(),i&&"<"==i.tag&&!(c.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[c.tag]<=t.tags.$||p(c,o))n.push(c),c.nodes=h(e,c.tag,n,o);else{if("/"==c.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+c.n);if(s=n.pop(),c.n!=s.n&&!d(c.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+c.n);return s.end=c.i,a}"\n"==c.tag&&(c.last=0==e.length||"\n"==e[0].tag)}a.push(c)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function p(t,e){for(var r=0,n=e.length;r<n;r++)if(e[r].o==t.n)return t.tag="#",!0}function d(t,e,r){for(var n=0,o=r.length;n<o;n++)if(r[n].c==t&&r[n].o==e)return!0}function v(t){var e=[];for(var r in t.partials)e.push('"'+m(r)+'":{name:"'+m(t.partials[r].name)+'", '+v(t.partials[r])+"}");return"partials: {"+e.join(",")+"}, subs: "+function(t){var e=[];for(var r in t)e.push('"'+m(r)+'": function(c,p,t,i) {'+t[r]+"}");return"{ "+e.join(",")+" }"}(t.subs)}t.stringify=function(e,r,n){return"{code: function (c,p,i) { "+t.wrapMain(e.code)+" },"+v(e)+"}"};var y=0;function m(t){return t.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function g(t){return~t.indexOf(".")?"d":"f"}function _(t,e){var r="<"+(e.prefix||"")+t.n+y++;return e.partials[r]={name:t.n,partials:{}},e.code+='t.b(t.rp("'+m(r)+'",c,p,"'+(t.indent||"")+'"));',r}function w(t,e){e.code+="t.b(t.t(t."+g(t.n)+'("'+m(t.n)+'",c,p,0)));'}function b(t){return"t.b("+t+");"}t.generate=function(e,r,n){y=0;var o={code:"",subs:{},partials:{}};return t.walk(e,o),n.asString?this.stringify(o,r,n):this.makeTemplate(o,r,n)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,e,r){var n=this.makePartials(t);return n.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(n,e,this,r)},t.makePartials=function(t){var e,r={subs:{},partials:t.partials,name:t.name};for(e in r.partials)r.partials[e]=this.makePartials(r.partials[e]);for(e in t.subs)r.subs[e]=new Function("c","p","t","i",t.subs[e]);return r},t.codegen={"#":function(e,r){r.code+="if(t.s(t."+g(e.n)+'("'+m(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(e.nodes,r),r.code+="});c.pop();}"},"^":function(e,r){r.code+="if(!t.s(t."+g(e.n)+'("'+m(e.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(e.nodes,r),r.code+="};"},">":_,"<":function(e,r){var n={partials:{},code:"",subs:{},inPartial:!0};t.walk(e.nodes,n);var o=r.partials[_(e,r)];o.subs=n.subs,o.partials=n.partials},$:function(e,r){var n={subs:{},code:"",partials:r.partials,prefix:e.n};t.walk(e.nodes,n),r.subs[e.n]=n.code,r.inPartial||(r.code+='t.sub("'+m(e.n)+'",c,p,i);')},"\n":function(t,e){e.code+=b('"\\n"'+(t.last?"":" + i"))},_v:function(t,e){e.code+="t.b(t.v(t."+g(t.n)+'("'+m(t.n)+'",c,p,0)));'},_t:function(t,e){e.code+=b('"'+m(t.text)+'"')},"{":w,"&":w},t.walk=function(e,r){for(var n,o=0,i=e.length;o<i;o++)(n=t.codegen[e[o].tag])&&n(e[o],r);return r},t.parse=function(t,e,r){return h(t,0,[],(r=r||{}).sectionTags||[])},t.cache={},t.cacheKey=function(t,e){return[t,!!e.asString,!!e.disableLambda,e.delimiters,!!e.modelGet].join("||")},t.compile=function(e,r){r=r||{};var n=t.cacheKey(e,r),o=this.cache[n];if(o){var i=o.partials;for(var a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(e,r.delimiters),e,r),e,r),this.cache[n]=o}}(e)},9402:(t,e,r)=>{"use strict";let n=r(9023),o=r(2203),i=t.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(i,o),i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=Buffer.isBuffer(t)?t:Buffer.from(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},i.prototype._processRead=function(t){this._reads.shift();let e=0,r=0,n=Buffer.alloc(t.length);for(;e<t.length;){let o=this._buffers[r++],i=Math.min(o.length,t.length-e);o.copy(n,e,0,i),e+=i,i!==o.length&&(this._buffers[--r]=o.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,n)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}},9549:(t,e)=>{!function(t){function e(t,e,r){var n;return e&&"object"==typeof e&&(void 0!==e[t]?n=e[t]:r&&e.get&&"function"==typeof e.get&&(n=e.get(t))),n}t.Template=function(t,e,r,n){t=t||{},this.r=t.code||this.r,this.c=r,this.options=n||{},this.text=e||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(t,e,r){return""},v:function(t){return t=c(t),s.test(t)?t.replace(r,"&").replace(n,"<").replace(o,">").replace(i,"'").replace(a,"""):t},t:c,render:function(t,e,r){return this.ri([t],e||{},r)},ri:function(t,e,r){return this.r(t,e,r)},ep:function(t,e){var r=this.partials[t],n=e[r.name];if(r.instance&&r.base==n)return r.instance;if("string"==typeof n){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[t].base=n,r.subs){for(key in e.stackText||(e.stackText={}),r.subs)e.stackText[key]||(e.stackText[key]=void 0!==this.activeSub&&e.stackText[this.activeSub]?e.stackText[this.activeSub]:this.text);n=function(t,e,r,n,o,i){function a(){}function s(){}var c;a.prototype=t,s.prototype=t.subs;var u=new a;for(c in u.subs=new s,u.subsText={},u.buf="",n=n||{},u.stackSubs=n,u.subsText=i,e)n[c]||(n[c]=e[c]);for(c in n)u.subs[c]=n[c];for(c in o=o||{},u.stackPartials=o,r)o[c]||(o[c]=r[c]);for(c in o)u.partials[c]=o[c];return u}(n,r.subs,r.partials,this.stackSubs,this.stackPartials,e.stackText)}return this.partials[t].instance=n,n},rp:function(t,e,r,n){var o=this.ep(t,r);return o?o.ri(e,r,n):""},rs:function(t,e,r){var n=t[t.length-1];if(u(n))for(var o=0;o<n.length;o++)t.push(n[o]),r(t,e,this),t.pop();else r(t,e,this)},s:function(t,e,r,n,o,i,a){var s;return(!u(t)||0!==t.length)&&("function"==typeof t&&(t=this.ms(t,e,r,n,o,i,a)),s=!!t,!n&&s&&e&&e.push("object"==typeof t?t:e[e.length-1]),s)},d:function(t,r,n,o){var i,a=t.split("."),s=this.f(a[0],r,n,o),c=this.options.modelGet,l=null;if("."===t&&u(r[r.length-2]))s=r[r.length-1];else for(var f=1;f<a.length;f++)void 0!==(i=e(a[f],s,c))?(l=s,s=i):s="";return!(o&&!s)&&(o||"function"!=typeof s||(r.push(l),s=this.mv(s,r,n),r.pop()),s)},f:function(t,r,n,o){for(var i=!1,a=!1,s=this.options.modelGet,c=r.length-1;c>=0;c--)if(void 0!==(i=e(t,r[c],s))){a=!0;break}return a?(o||"function"!=typeof i||(i=this.mv(i,r,n)),i):!o&&""},ls:function(t,e,r,n,o){var i=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(c(t.call(e,n)),e,r)),this.options.delimiters=i,!1},ct:function(t,e,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(e,r)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,e,r,n,o,i,a){var s,c=e[e.length-1],u=t.call(c);return"function"==typeof u?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,r,s.substring(o,i),a)):u},mv:function(t,e,r){var n=e[e.length-1],o=t.call(n);return"function"==typeof o?this.ct(c(o.call(n)),n,r):o},sub:function(t,e,r,n){var o=this.subs[t];o&&(this.activeSub=t,o(e,r,this,n),this.activeSub=!1)}};var r=/&/g,n=/</g,o=/>/g,i=/\'/g,a=/\"/g,s=/[&<>\"\']/;function c(t){return String(null==t?"":t)}var u=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}(e)},9698:(t,e,r)=>{var n=r(4714);t.exports=function(){var t=new n.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b("MEMORY {"),n.b("\n"+r),n.b(" FLASH (rx) : ORIGIN = "),n.b(n.v(n.f("flashStart",t,e,0))),n.b(", LENGTH = "),n.b(n.v(n.f("flashLength",t,e,0))),n.b("\n"+r),n.b(" RAM (rwx) : ORIGIN = "),n.b(n.v(n.f("ramStart",t,e,0))),n.b(", LENGTH = "),n.b(n.v(n.f("ramLength",t,e,0))),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b("ENTRY(_start);"),n.b("\n"),n.b("\n"+r),n.b("_userland_trampoline_address = "),n.b(n.v(n.f("trampolineStart",t,e,0))),n.b(";"),n.b("\n"),n.b("\n"+r),n.b("SECTIONS {"),n.b("\n"+r),n.b(" .eadk_app_info ORIGIN(FLASH) : {"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_api_level))"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(SIZEOF(.rodata.eadk_app_icon));"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_start - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_app_end - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_name : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_name))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_icon : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_icon))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .text : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" *(.text)"),n.b("\n"+r),n.b(" *(.text.*)"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" *(.rodata)"),n.b("\n"+r),n.b(" *(.rodata.*)"),n.b("\n"+r),n.b(" _eadk_app_end = .;"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .data : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _data_section_start_flash = LOADADDR(.data);"),n.b("\n"+r),n.b(" _data_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.data)"),n.b("\n"+r),n.b(" *(.data.*)"),n.b("\n"+r),n.b(" _data_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM AT >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .bss : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _bss_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.bss)"),n.b("\n"+r),n.b(" *(.bss.*)"),n.b("\n"+r),n.b(" _bss_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"),n.b("\n"+r),n.b(" .heap : {"),n.b("\n"+r),n.b(" _heap_start = .;"),n.b("\n"+r),n.b(" . = (ORIGIN(RAM) + LENGTH(RAM));"),n.b("\n"+r),n.b(" _heap_end = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b('ASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");'),n.b("\n"),n.fl()},partials:{},subs:{}},'MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nENTRY(_start);\n\n_userland_trampoline_address = {{ trampolineStart }};\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n KEEP(*(.rodata.eadk_api_level))\n LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .rodata.eadk_app_name : {\n KEEP(*(.rodata.eadk_app_name))\n } >FLASH\n\n .rodata.eadk_app_icon : {\n KEEP(*(.rodata.eadk_app_icon))\n } >FLASH\n\n .text : {\n . = ALIGN(4);\n *(.text)\n *(.text.*)\n } >FLASH\n\n .rodata : {\n *(.rodata)\n *(.rodata.*)\n _eadk_app_end = .;\n } >FLASH\n\n .data : {\n . = ALIGN(4);\n _data_section_start_flash = LOADADDR(.data);\n _data_section_start_ram = .;\n *(.data)\n *(.data.*)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\n *(.bss.*)\n _bss_section_end_ram = .;\n } >RAM\n\n .heap : {\n _heap_start = .;\n . = (ORIGIN(RAM) + LENGTH(RAM));\n _heap_end = .;\n } >RAM\n}\n\nASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");\nASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");\nASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");\n',n);return t.render.apply(t,arguments)}},9874:(t,e,r)=>{"use strict";let n=r(2613).ok,o=r(3106),i=r(9023),a=r(181).kMaxLength;function s(t){if(!(this instanceof s))return new s(t);t&&t.chunkSize<o.Z_MIN_CHUNK&&(t.chunkSize=o.Z_MIN_CHUNK),o.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function c(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}function u(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let r=t._finishFlushFlag;return null==r&&(r=o.Z_FINISH),t._processChunk(e,r)}(new s(e),t)}s.prototype._processChunk=function(t,e,r){if("function"==typeof r)return o.Inflate._processChunk.call(this,t,e,r);let i,s,u=this,l=t&&t.length,f=this._chunkSize-this._offset,h=this._maxLength,p=0,d=[],v=0;function y(t,e){if(u._hadError)return;let r=f-e;if(n(r>=0,"have should not go down"),r>0){let t=u._buffer.slice(u._offset,u._offset+r);if(u._offset+=r,t.length>h&&(t=t.slice(0,h)),d.push(t),v+=t.length,h-=t.length,0===h)return!1}return(0===e||u._offset>=u._chunkSize)&&(f=u._chunkSize,u._offset=0,u._buffer=Buffer.allocUnsafe(u._chunkSize)),0===e&&(p+=l-t,l=t,!0)}this.on("error",(function(t){i=t})),n(this._handle,"zlib binding closed");do{s=this._handle.writeSync(e,t,p,l,this._buffer,this._offset,f),s=s||this._writeState}while(!this._hadError&&y(s[0],s[1]));if(this._hadError)throw i;if(v>=a)throw c(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let m=Buffer.concat(d,v);return c(this),m},i.inherits(s,o.Inflate),t.exports=e=u,e.Inflate=s,e.createInflate=function(t){return new s(t)},e.inflateSync=u},9896:t=>{"use strict";t.exports=require("fs")},9904:(t,e,r)=>{"use strict";let n=r(9023),o=r(2203),i=r(7089),a=r(8),s=r(2122),c=e.O=function(t){o.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new a(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(c,o),c.sync=s,c.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},c.prototype.parse=function(t,e){if(e){let t,r;t=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(r){this.removeListener("parsed",t),e(r,null)}.bind(this),this.once("parsed",t),this.once("error",r)}return this.end(t),this},c.prototype.write=function(t){return this._parser.write(t),!0},c.prototype.end=function(t){this._parser.end(t)},c.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},c.prototype._gamma=function(t){this.gamma=t},c.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},c.bitblt=function(t,e,r,n,o,i,a,s){if(n|=0,o|=0,i|=0,a|=0,s|=0,(r|=0)>t.width||n>t.height||r+o>t.width||n+i>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+o>e.width||s+i>e.height)throw new Error("bitblt writing outside image");for(let c=0;c<i;c++)t.data.copy(e.data,(s+c)*e.width+a<<2,(n+c)*t.width+r<<2,(n+c)*t.width+r+o<<2)},c.prototype.bitblt=function(t,e,r,n,o,i,a){return c.bitblt(this,t,e,r,n,o,i,a),this},c.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let r=0;r<t.width;r++){let n=t.width*e+r<<2;for(let e=0;e<3;e++){let r=t.data[n+e]/255;r=Math.pow(r,1/2.2/t.gamma),t.data[n+e]=Math.round(255*r)}}t.gamma=0}},c.prototype.adjustGamma=function(){c.adjustGamma(this)}},9937:t=>{"use strict";function e(t){this._capacity=t,this._length=0,this._front=0}e.prototype._willBeOverCapacity=function(t){return this._capacity<t},e.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1},e.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var o=this._front+n-3;this._checkCapacity(n);var i=this._capacity-1;this[o+0&i]=t,this[o+1&i]=e,this[o+2&i]=r,this._length=n},e.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},e.prototype.length=function(){return this._length},e.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},e.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,function(t,e,r,n,o){for(var i=0;i<o;++i)r[i+n]=t[i+e],t[i+e]=void 0}(this,0,this,e,this._front+this._length&e-1)},t.exports=e},9979:(t,e,r)=>{"use strict";t.exports=function(){var e=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new j.PromiseInspection(this._target())},o=function(t){return j.reject(new m(t))};function i(){}var a={},s=r(2208);s.setReflectHandler(n);var c=function(){var t=process.domain;return void 0===t?null:t},u=function(){return{domain:c(),async:null}},l=s.isNode&&s.nodeSupportsAsyncResource?r(290).AsyncResource:null,f=function(){return{domain:c(),async:new l("Bluebird::Promise")}},h=s.isNode?u:function(){return null};s.notEnumerableProp(j,"_getContext",h);var p=r(7585),d=r(8210),v=new d;p.defineProperty(j,"_async",{value:v});var y=r(403),m=j.TypeError=y.TypeError;j.RangeError=y.RangeError;var g=j.CancellationError=y.CancellationError;j.TimeoutError=y.TimeoutError,j.OperationalError=y.OperationalError,j.RejectionError=y.OperationalError,j.AggregateError=y.AggregateError;var _=function(){},w={},b={},E=r(8974)(j,_),k=r(2661)(j,_,E,o,i),x=r(297)(j),S=x.create,A=r(6636)(j,x,(function(){h=f,s.notEnumerableProp(j,"_getContext",f)}),(function(){h=u,s.notEnumerableProp(j,"_getContext",u)})),P=(A.CapturedTrace,r(401)(j,E,b)),O=r(1674)(b),F=r(1231),C=s.errorObj,T=s.tryCatch;function j(t){t!==_&&function(t,e){if(null==t||t.constructor!==j)throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new m("expecting a function but got "+s.classString(e))}(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function L(t){this.promise._resolveCallback(t)}function R(t){this.promise._rejectCallback(t,!1)}function D(t){var e=new j(_);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}return j.prototype.toString=function(){return"[object Promise]"},j.prototype.caught=j.prototype.catch=function(t){var e=arguments.length;if(e>1){var r,n=new Array(e-1),i=0;for(r=0;r<e-1;++r){var a=arguments[r];if(!s.isObject(a))return o("Catch statement predicate: expecting an object but got "+s.classString(a));n[i++]=a}if(n.length=i,"function"!=typeof(t=arguments[r]))throw new m("The last argument to .catch() must be a function, got "+s.toString(t));return this.then(void 0,O(n,t,this))}return this.then(void 0,t)},j.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},j.prototype.then=function(t,e){if(A.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(r+=", "+s.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},j.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},j.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+s.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},j.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},j.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new k(this).promise()},j.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},j.getNewLibraryCopy=t.exports,j.is=function(t){return t instanceof j},j.fromNode=j.fromCallback=function(t){var e=new j(_);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=T(t)(F(e,r));return n===C&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},j.all=function(t){return new k(t).promise()},j.cast=function(t){var e=E(t);return e instanceof j||((e=new j(_))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},j.resolve=j.fulfilled=j.cast,j.reject=j.rejected=function(t){var e=new j(_);return e._captureStackTrace(),e._rejectCallback(t,!0),e},j.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+s.classString(t));return v.setScheduler(t)},j.prototype._then=function(t,e,r,n,o){var i=void 0!==o,a=i?o:new j(_),c=this._target(),u=c._bitField;i||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&2097152&this._bitField&&(n=50397184&u?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var l=h();if(50397184&u){var f,p,d=c._settlePromiseCtx;33554432&u?(p=c._rejectionHandler0,f=t):16777216&u?(p=c._fulfillmentHandler0,f=e,c._unsetRejectionIsUnhandled()):(d=c._settlePromiseLateCancellationObserver,p=new g("late cancellation observer"),c._attachExtraTrace(p),f=e),v.invoke(d,c,{handler:s.contextBind(l,f),promise:a,receiver:n,value:p})}else c._addCallbacks(t,e,a,n,l);return a},j.prototype._length=function(){return 65535&this._bitField},j.prototype._isFateSealed=function(){return!!(117506048&this._bitField)},j.prototype._isFollowing=function(){return!(67108864&~this._bitField)},j.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},j.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},j.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},j.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},j.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},j.prototype._isFinal=function(){return(4194304&this._bitField)>0},j.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},j.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},j.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},j.prototype._setAsyncGuaranteed=function(){if(!v.hasCustomScheduler()){var t=this._bitField;this._bitField=t|(536870912&t)>>2^134217728}},j.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&this._bitField|536870912},j.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==a)return void 0===e&&this._isBound()?this._boundValue():e},j.prototype._promiseAt=function(t){return this[4*t-4+2]},j.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},j.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},j.prototype._boundValue=function(){},j.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,o=t._receiverAt(0);void 0===o&&(o=a),this._addCallbacks(e,r,n,o,null)},j.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=a),this._addCallbacks(r,n,o,i,null)},j.prototype._addCallbacks=function(t,e,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=s.contextBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=s.contextBind(o,e));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=s.contextBind(o,t)),"function"==typeof e&&(this[a+1]=s.contextBind(o,e))}return this._setLength(i+1),i},j.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},j.prototype._resolveCallback=function(t,r){if(!(117506048&this._bitField)){if(t===this)return this._rejectCallback(e(),!1);var n=E(t,this);if(!(n instanceof j))return this._fulfill(t);r&&this._propagateFrom(n,2);var o=n._target();if(o!==this){var i=o._bitField;if(50397184&i)if(33554432&i)this._fulfill(o._value());else if(16777216&i)this._reject(o._reason());else{var a=new g("late cancellation observer");o._attachExtraTrace(a),this._reject(a)}else{var s=this._length();s>0&&o._migrateCallback0(this);for(var c=1;c<s;++c)o._migrateCallbackAt(this,c);this._setFollowing(),this._setLength(0),this._setFollowee(n)}}else this._reject(e())}},j.prototype._rejectCallback=function(t,e,r){var n=s.ensureErrorObject(t),o=n===t;if(!o&&!r&&A.warnings()){var i="a promise was rejected with a non-error: "+s.classString(t);this._warn(i,!0)}this._attachExtraTrace(n,!!e&&o),this._reject(t)},j.prototype._resolveFromExecutor=function(t){if(t!==_){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(t,(function(t){e._resolveCallback(t)}),(function(t){e._rejectCallback(t,r)}));r=!1,this._popContext(),void 0!==n&&e._rejectCallback(n,!0)}},j.prototype._settlePromiseFromHandler=function(t,e,r,n){var o=n._bitField;if(!(65536&o)){var i;n._pushContext(),e===w?r&&"number"==typeof r.length?i=T(t).apply(this._boundValue(),r):(i=C).e=new m("cannot .spread() a non-array: "+s.classString(r)):i=T(t).call(e,r);var a=n._popContext();65536&(o=n._bitField)||(i===b?n._reject(r):i===C?n._rejectCallback(i.e,!1):(A.checkForgottenReturns(i,a,"",n,this),n._resolveCallback(i)))}},j.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},j.prototype._followee=function(){return this._rejectionHandler0},j.prototype._setFollowee=function(t){this._rejectionHandler0=t},j.prototype._settlePromise=function(t,e,r,o){var a=t instanceof j,s=this._bitField,c=!!(134217728&s);65536&s?(a&&t._invokeInternalOnCancel(),r instanceof P&&r.isFinallyHandler()?(r.cancelPromise=t,T(e).call(r,o)===C&&t._reject(C.e)):e===n?t._fulfill(n.call(r)):r instanceof i?r._promiseCancelled(t):a||t instanceof k?t._cancel():r.cancel()):"function"==typeof e?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof i?r._isResolved()||(33554432&s?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),33554432&s?t._fulfill(o):t._reject(o))},j.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,r=t.promise,n=t.receiver,o=t.value;"function"==typeof e?r instanceof j?this._settlePromiseFromHandler(e,n,o,r):e.call(n,o,r):r instanceof j&&r._reject(o)},j.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},j.prototype._settlePromise0=function(t,e,r){var n=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,t,o,e)},j.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},j.prototype._fulfill=function(t){var r=this._bitField;if(!((117506048&r)>>>16)){if(t===this){var n=e();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&r)>0&&(134217728&r?this._settlePromises():v.settlePromises(this),this._dereferenceTrace())}},j.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return v.fatalError(t,s.isNode);(65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled()}},j.prototype._fulfillPromises=function(t,e){for(var r=1;r<t;r++){var n=this._fulfillmentHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,e)}},j.prototype._rejectPromises=function(t,e){for(var r=1;r<t;r++){var n=this._rejectionHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,e)}},j.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(16842752&t){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},j.prototype._settledValue=function(){var t=this._bitField;return 33554432&t?this._rejectionHandler0:16777216&t?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&p.defineProperty(j.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),j.defer=j.pending=function(){return A.deprecated("Promise.defer","new Promise"),{promise:new j(_),resolve:L,reject:R}},s.notEnumerableProp(j,"_makeSelfResolutionError",e),r(6241)(j,_,E,o,A),r(4271)(j,_,E,A),r(2994)(j,k,o,A),r(6774)(j),r(4900)(j),r(6564)(j,k,E,_,v),j.Promise=j,j.version="3.7.2",r(1675)(j),r(5734)(j,o,_,E,i,A),r(5956)(j,k,o,E,_,A),r(6340)(j),r(5818)(j,_),r(4416)(j,k,E,o),r(3381)(j,_,E,o),r(8722)(j,k,o,E,_,A),r(9047)(j,k,A),r(7784)(j,k,o),r(6406)(j,_,A),r(6178)(j,o,E,S,_,A),r(7988)(j),r(3425)(j,_),r(2730)(j,_),s.toFastProperties(j),s.toFastProperties(j.prototype),D({a:1}),D({b:2}),D({c:3}),D(1),D((function(){})),D(void 0),D(!1),D(new j(_)),A.setBounds(d.firstLineError,s.lastLineError),j}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.p="";var n={};(()=>{"use strict";r.d(n,{default:()=>Nn});const t=require("usb");function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function i(t,e,r){return e=u(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,r||[],u(t).constructor):e.apply(t,r))}function a(t){var e="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(s())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&c(o,r.prototype),o}(t,arguments,u(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,t)},a(t)}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s=function(){return!!t})()}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}const l=function(t){function r(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return(e=i(this,r,[].concat(o))).name=t,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(r,t),n=r,o&&e(n.prototype,o),a&&e(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,a}(a(Error));function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p(n.key),n)}}function h(t,e,r){return e&&f(t.prototype,e),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function p(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e,r){return e=m(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,y()?Reflect.construct(e,r||[],m(t).constructor):e.apply(t,r))}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_(t,e)}function _(t,e){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_(t,e)}var w=function(t){function e(){d(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v(this,e,["CalculatorMemoryCorruption"].concat(r))}return g(e,t),h(e)}(l),b=function(t){function e(){d(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v(this,e,["BusyCalculatorError"].concat(r))}return g(e,t),h(e)}(l),E=function(t){function e(){d(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v(this,e,["WebUSBError"].concat(r))}return g(e,t),h(e)}(l),k=function(t){function e(){d(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v(this,e,["ForbiddenMemoryAccessError"].concat(r))}return g(e,t),h(e)}(l),x=function(t){function e(){d(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v(this,e,["DeviceDetectionError"].concat(r))}return g(e,t),h(e)}(l),S=function(t){function e(t){var r;d(this,e);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return(r=v(this,e,["DowngradeError"].concat(o))).sameVersion=t,r}return g(e,t),h(e)}(l),A=function(t){function e(t){var r;d(this,e);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return(r=v(this,e,["BulkError"].concat(o))).errors=t,r}return g(e,t),h(e)}(l),P=function(t){function e(){d(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v(this,e,["USBConnectionError"].concat(r))}return g(e,t),h(e)}(l);function O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,F(n.key),n)}}function F(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var C=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,n=[{key:"append",value:function(e){for(var r="",n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];o.forEach((function(t){r+=t+","})),t.Content+=+new Date+","+e+","+r+"\n"}},{key:"info",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["info"].concat(r))}},{key:"warn",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["warn"].concat(r))}},{key:"error",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["error"].concat(r))}}],(r=null)&&O(e.prototype,r),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();C.Content="";const T=C;function j(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return L(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(){R=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function D(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function I(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){D(i,n,o,a,s,"next",t)}function s(t){D(i,n,o,a,s,"throw",t)}a(void 0)}))}}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,B(n.key),n)}}function M(t,e,r){return e&&N(t.prototype,e),r&&N(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function B(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G(t,e,r){return e=H(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,z()?Reflect.construct(e,r||[],H(t).constructor):e.apply(t,r))}function z(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(z=function(){return!!t})()}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function V(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&q(t,e)}function q(t,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},q(t,e)}var Y=6,W=8,K=10,$=1,X=2,Z=3,Q=4,J=1033;function tt(t){return{bLength:t.getUint8(0),bDescriptorType:t.getUint8(1),bInterfaceNumber:t.getUint8(2),bAlternateSetting:t.getUint8(3),bNumEndpoints:t.getUint8(4),bInterfaceClass:t.getUint8(5),bInterfaceSubClass:t.getUint8(6),bInterfaceProtocol:t.getUint8(7),iInterface:t.getUint8(8),endpoints:[]}}function et(t){var e=function(t){for(var e,r=t,n=[];r.byteLength>2;){var o=r.getUint8(0),i=r.getUint8(1),a=new DataView(r.buffer.slice(0,o));if(i==Q)e=tt(a),n.push(e);else{var s={bLength:o,bDescriptorType:i,data:a};e?e.endpoints.push(s):n.push(s)}r=new DataView(r.buffer.slice(o))}return n}(new DataView(t.buffer.slice(9)));return{bLength:t.getUint8(0),bDescriptorType:t.getUint8(1),wTotalLength:t.getUint16(2,!0),bNumInterfaces:t.getUint8(4),bConfigurationValue:t.getUint8(5),iConfiguration:t.getUint8(6),bmAttributes:t.getUint8(7),bMaxPower:t.getUint8(8),interfaces:e}}function rt(t){return T.info("DFU",t.device.serialNumber,"getConfiguration"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:W,value:0,index:0},1).then((function(t){"ok"==t.status?e(t.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+t.status))})).catch((function(t){r(new Error("Get configuration failed --\x3e "+t))}))}))}function nt(t){return T.info("DFU",t.device.serialNumber,"getInterface"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"interface",request:K,value:0,index:t.settings.interface.interfaceNumber},1).then((function(t){"ok"==t.status?e(t.data.getInt8(0)):r(new Error("Wrong getInterface status: "+t.status))})).catch((function(t){r(new Error("Get interface failed --\x3e "+t))}))}))}function ot(t,e){return T.info("DFU",t.device.serialNumber,"getConfigurationDescriptor","index "+e),new Promise((function(r,n){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:Y,value:e|X<<8,index:0},4).then((function(o){if("ok"==o.status){var i=o.data.getUint16(2,!0);t.device.controlTransferIn({requestType:"standard",recipient:"device",request:Y,value:e|X<<8,index:0},i).then((function(t){"ok"==t.status?r(et(t.data)):n(new Error("Wrong getConfigurationDescriptor status: "+t.status))})).catch((function(t){n(t)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((function(t){n(new Error("Get configuration descriptor failed --\x3e "+t))}))}))}function it(t,e){return T.info("DFU",t.device.serialNumber,"getStringDescriptor","index "+e),new Promise((function(r,n){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:Y,value:e|Z<<8,index:J},255).then((function(t){"ok"==t.status?(t.data.getInt8(1)!=Z&&n(new Error("Wrong descriptor type: "+t.data.getInt8(1))),r(new TextDecoder("utf-16").decode(new Uint16Array(t.data.buffer,2)))):n(new Error("Wrong getStringDescriptor status: "+t.status))})).catch((function(t){n(new Error("Get string descriptor failed --\x3e "+t))}))}))}function at(t){return T.info("DFU",t.device.serialNumber,"privateGetDeviceDescriptor"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:Y,value:$<<8,index:0},255).then((function(t){"ok"==t.status?e(t.data.buffer):r(new Error("Wrong privateGetDeviceDescriptor status: "+t.status))})).catch((function(t){r(new Error("privateGetDeviceDescriptor failed --\x3e "+t))}))}))}var st={Offset:0,Size:11,Signature:{Offset:0,Size:5}},ct={Offset:11,TargetPrefix:{Offset:0,Size:274,Signature:{Offset:0,Size:6},NbElements:{Offset:270,Size:4}},Element:{Offset:274,Address:{Offset:0,Size:4},Size:{Offset:4,Size:4},Data:{Offset:8}}},ut=1,lt=2,ft=3,ht=4,pt=5,dt=6,vt=0,yt=2,mt=4,gt=5,_t=7,wt=10,bt=33,Et=65,kt=function(t){function e(){U(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return G(this,e,["DFUError"].concat(r))}return V(e,t),M(e)}(l),xt=function(t){function e(){U(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return G(this,e,["DFUInterfaceError"].concat(r))}return V(e,t),M(e)}(l);function St(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return T.info("DFU","requestIn","bRequest: "+e,"data: "+r,"wValue: "+n),new Promise((function(o,i){t.device.controlTransferIn({requestType:"class",recipient:"interface",request:e,value:n,index:t.settings.interface.interfaceNumber},r).then((function(t){"ok"==t.status?o(t.data):i(new Error("Wrong requestIn status: "+t.status))})).catch((function(t){i(new Error("ControlTransferIn failed --\x3e "+t))}))}))}function At(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return T.info("DFU","requestOut","bRequest: "+e,"data: "+r,"wValue: "+n),new Promise((function(o,i){t.device.controlTransferOut({requestType:"class",recipient:"interface",request:e,value:n,index:t.settings.interface.interfaceNumber},r).then((function(t){"ok"==t.status?o(t.bytesWritten):i(new Error("Wrong requestOut status: "+t.status))})).catch((function(t){i(new Error("ControlTransferOut failed --\x3e "+t))}))}))}function Pt(t){return T.info("DFU",t.device.serialNumber,"getState"),new Promise((function(e,r){St(t,pt,1).then((function(t){e(t.getUint8(0))})).catch((function(t){r(new Error("Get state failed --\x3e "+t))}))}))}function Ot(t){return T.info("DFU",t.device.serialNumber,"getStatus"),new Promise((function(e,r){St(t,ft,6).then((function(t){e({status:t.getUint8(0),pollTimeout:16777215&t.getUint32(1,!0),state:t.getUint8(4)})})).catch((function(t){r(new Error("Get status failed --\x3e "+t))}))}))}function Ft(t){return Ct.apply(this,arguments)}function Ct(){return Ct=I(R().mark((function t(e){var r;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",e.device.serialNumber,"abortToIdle"),t.prev=1,t.next=4,At(e,dt);case 4:return t.next=6,Pt(e);case 6:if((r=t.sent)!=wt){t.next=13;break}return t.next=10,At(e,ht);case 10:return t.next=12,Pt(e);case 12:r=t.sent;case 13:if(r==yt){t.next=15;break}throw new Error("State is "+r.state+"instead of DFU IDLE (2).");case 15:t.next=20;break;case 17:throw t.prev=17,t.t0=t.catch(1),new Error("Abort to idle failed --\x3e "+t.t0);case 20:case"end":return t.stop()}}),t,null,[[1,17]])}))),Ct.apply(this,arguments)}function Tt(t,e){return jt.apply(this,arguments)}function jt(){return jt=I(R().mark((function t(e,r){var n,o,i,a,s=arguments;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=function(t){return new Promise((function(e,r){setTimeout(e,t)}))},n=s.length>2&&void 0!==s[2]?s[2]:null,T.info("DFU",e.device.serialNumber,"pollUntil",r),t.prev=3,t.next=6,Ot(e);case 6:if((i=t.sent).status==vt){t.next=9;break}throw"Status is "+status.status+" instead of Status OK (0).";case 9:a=null!=n?n:i.pollTimeout;case 10:if(r(i.state)||i.state==wt){t.next=20;break}return t.next=13,o(a);case 13:return t.next=15,Ot(e);case 15:if((i=t.sent).status==vt){t.next=18;break}throw"Status is "+status.status+" instead of Status OK (0).";case 18:t.next=10;break;case 20:return t.abrupt("return",i);case 23:throw t.prev=23,t.t0=t.catch(3),new Error("Poll until failed --\x3e "+t.t0);case 26:case"end":return t.stop()}}),t,null,[[3,23]])}))),jt.apply(this,arguments)}function Lt(t,e){return Rt.apply(this,arguments)}function Rt(){return Rt=I(R().mark((function t(e,r){var n,o,i;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:T.info("DFU",e.device.serialNumber,"setAddress",Number(r).toString(16)),n=new ArrayBuffer(5),(o=new DataView(n)).setUint8(0,bt),o.setUint32(1,r,!0),t.prev=5,T.info("DFU",e.device.serialNumber,"setAddress",Number(r).toString(16));case 7:return t.next=9,At(e,ut,n,0);case 9:return t.next=11,Tt(e,(function(t){return t!=mt}),0);case 11:i=t.sent;case 12:if(i.state!=gt){t.next=7;break}case 13:t.next=18;break;case 15:throw t.prev=15,t.t0=t.catch(5),"Set address to "+r+" failed --\x3e "+t.t0;case 18:case"end":return t.stop()}}),t,null,[[5,15]])}))),Rt.apply(this,arguments)}const Dt=function(){return M((function t(e,r){U(this,t),this.open=I(R().mark((function t(){var e,r,n;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",this.device.serialNumber,"open"),t.prev=1,t.next=4,this.device.open();case 4:t.next=9;break;case 6:throw t.prev=6,t.t0=t.catch(1),new kt("OPEN failed --\x3e "+t.t0);case 9:if(e=this.settings.configuration.configurationValue,null!=this.device.configuration&&this.device.configuration.configurationValue==e){t.next=19;break}return t.prev=11,t.next=14,this.device.selectConfiguration(e);case 14:t.next=19;break;case 16:throw t.prev=16,t.t1=t.catch(11),new kt("OPEN failed: could not select configuration --\x3e "+t.t1);case 19:if(r=this.settings.interface.interfaceNumber,this.device.configuration.interfaces[r].claimed){t.next=29;break}return t.prev=21,t.next=24,this.device.claimInterface(r);case 24:t.next=29;break;case 26:throw t.prev=26,t.t2=t.catch(21),new xt("OPEN failed: could not claim interface --\x3e "+t.t2);case 29:if(n=this.settings.alternate.alternateSetting,null!=this.device.configuration.interfaces[r].alternate&&this.device.configuration.interfaces[r].alternate==n){t.next=39;break}return t.prev=31,t.next=34,this.device.selectAlternateInterface(r,n);case 34:t.next=39;break;case 36:throw t.prev=36,t.t3=t.catch(31),new kt("OPEN failed: could not select alternate interface --\x3e "+t.t3);case 39:case"end":return t.stop()}}),t,this,[[1,6],[11,16],[21,26],[31,36]])}))),this.close=I(R().mark((function t(){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",this.device.serialNumber,"close"),t.prev=1,t.next=4,this.device.close();case 4:t.next=9;break;case 6:throw t.prev=6,t.t0=t.catch(1),new kt("CLOSE failed --\x3e "+t.t0);case 9:case"end":return t.stop()}}),t,this,[[1,6]])}))),this.getMemoryLayout=I(R().mark((function t(){var e,r,n,o,i,a,s,c,u,l;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",this.device.serialNumber,"getMemoryLayout"),t.prev=1,t.next=4,rt(this);case 4:return e=t.sent,t.next=7,ot(this,e-1);case 7:return r=t.sent,t.next=10,nt(this);case 10:return n=t.sent,o=r.interfaces[n].iInterface,t.next=14,it(this,o);case 14:i=t.sent,a=i.split("/"),s=a[0],c=[],u=R().mark((function t(){var e,r,n;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=parseInt(a[l]),r=a[l+1].split(","),n=/(\d+)\*(\d+)([B|K|M])(\w)/,r.forEach((function(t){var r=t.match(n),o=parseInt(r[1]),i=parseInt(r[2]),a=r[3],u=r[4];"K"==a?i*=1024:"M"==a&&(i*=1048576);var l=o*i,f={name:s,address:e,lastAddress:e+l-1,size:l,nbPage:o,pageSize:i,type:u};c.push(f),e+=l}));case 4:case"end":return t.stop()}}),t)})),l=1;case 20:if(!(l<a.length)){t.next=25;break}return t.delegateYield(u(),"t0",22);case 22:l+=2,t.next=20;break;case 25:return t.abrupt("return",c);case 28:throw t.prev=28,t.t1=t.catch(1),new kt("GET MEMORY LAYOUT failed --\x3e "+t.t1);case 31:case"end":return t.stop()}}),t,this,[[1,28]])}))),this.getDeviceDescriptor=I(R().mark((function t(){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",this.device.serialNumber,"getDeviceDescriptor"),t.prev=1,t.next=4,at(this);case 4:return t.abrupt("return",t.sent);case 7:throw t.prev=7,t.t0=t.catch(1),new kt("getDeviceDescriptor failed --\x3e "+t.t0);case 10:case"end":return t.stop()}}),t,this,[[1,7]])}))),this.upload=function(){var t=I(R().mark((function t(e,r,n){var o,i,a,s,c,u,l,f=arguments;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=f.length>3&&void 0!==f[3]?f[3]:0,T.info("DFU",this.device.serialNumber,"upload","address "+Number(e).toString(16),"Length "+Number(r).toString(16),"Alt "+Number(o)),t.prev=2,t.next=5,this.device.selectAlternateInterface(0,o);case 5:return t.next=7,Pt(this);case 7:if(t.sent==yt){t.next=11;break}return t.next=11,Ft(this);case 11:return t.next=13,Lt(this,e);case 13:return t.next=15,Ft(this);case 15:i=2,a=new Uint8Array(r),s=0,n&&n(0);case 19:return u=Math.min(this.TransferSize,r-s),T.info("DFU",this.device.serialNumber,"upload","block number "+i,"bytes to read "+u),t.next=23,St(this,lt,u,i++);case 23:(c=t.sent).byteLength>0&&(l=new Uint8Array(c.buffer),a.set(l,s),s+=c.byteLength),n&&n(s/r);case 26:if(s<r){t.next=19;break}case 27:return t.next=29,Ft(this);case 29:return t.abrupt("return",a);case 32:return t.prev=32,t.t0=t.catch(2),t.next=36,Ft(this);case 36:throw new kt("UPLOAD failed at address "+e+" of length "+r+" --\x3e "+t.t0);case 37:if(t.prev=37,0==o){t.next=41;break}return t.next=41,this.device.selectAlternateInterface(0,0);case 41:return t.finish(37);case 42:case"end":return t.stop()}}),t,this,[[2,32,37,42]])})));return function(e,r,n){return t.apply(this,arguments)}}(),this.download=function(){var t=I(R().mark((function t(e,r,n){var o,i,a,s,c,u,l,f=arguments;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=f.length>3&&void 0!==f[3]?f[3]:0,T.info("DFU",this.device.serialNumber,"download","address "+Number(e).toString(16)),t.prev=2,t.next=5,this.device.selectAlternateInterface(0,o);case 5:i=0,a=r.byteLength,s=e,n&&n(0);case 9:if(!(i<a)){t.next=28;break}return c=a-i,u=Math.min(c,this.TransferSize),T.info("DFU",this.device.serialNumber,"download step, at address "+Number(e).toString(16)),l=0,t.next=17,Lt(this,s);case 17:return t.next=19,At(this,ut,r.slice(i,i+u),2);case 19:return l=t.sent,t.next=22,Tt(this,(function(t){return t==gt}));case 22:t.sent,s+=u,i+=l,n&&n(i/a),t.next=9;break;case 28:t.next=33;break;case 30:throw t.prev=30,t.t0=t.catch(2),new kt("DOWNLOAD failed at address "+Number(e).toString(16)+" --\x3e "+t.t0);case 33:if(t.prev=33,0==o){t.next=37;break}return t.next=37,this.device.selectAlternateInterface(0,0);case 37:return t.finish(33);case 38:case"end":return t.stop()}}),t,this,[[2,30,33,38]])})));return function(e,r,n){return t.apply(this,arguments)}}(),this.leave=function(){var t=I(R().mark((function t(e){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",this.device.serialNumber,"leave","address "+Number(e).toString(16)),t.prev=1,t.next=4,Lt(this,e);case 4:return t.next=6,At(this,ut,new ArrayBuffer,2);case 6:return t.next=8,Tt(this,(function(t){return t==_t}));case 8:t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(1),new kt("LEAVE failed at address "+Number(e).toString(16)+" --\x3e "+t.t0);case 13:case"end":return t.stop()}}),t,this,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),this.eraseSegment=function(){var t=I(R().mark((function t(e){var r,n,o;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("DFU",this.device.serialNumber,"eraseSegment","address "+Number(e).toString(16)),t.prev=1,t.next=4,Pt(this);case 4:if(t.sent==yt){t.next=8;break}return t.next=8,Ft(this);case 8:r=new ArrayBuffer(5),(n=new DataView(r)).setUint8(0,Et),n.setUint32(1,e,!0);case 12:return t.next=14,At(this,ut,r,0);case 14:return t.next=16,Ot(this);case 16:if((o=t.sent).status==vt){t.next=19;break}throw"wrong DFU status: "+o.status;case 19:if(o.state!=mt){t.next=12;break}case 20:return t.next=22,Tt(this,(function(t){return t!=mt}));case 22:if((o=t.sent).status==vt){t.next=25;break}throw"wrong DFU status: "+o.status;case 25:t.next=30;break;case 27:throw t.prev=27,t.t0=t.catch(1),new kt("ERASE SEGMENT failed at address "+e+" --\x3e "+t.t0);case 30:case"end":return t.stop()}}),t,this,[[1,27]])})));return function(e){return t.apply(this,arguments)}}(),this.TransferSize=r,this.device=e;var n,o=j(e.configurations);try{for(o.s();!(n=o.n()).done;){var i,a=n.value,s=j(a.interfaces);try{for(s.s();!(i=s.n()).done;){var c,u=i.value,l=j(u.alternates);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(254==f.interfaceClass&&1==f.interfaceSubclass&&(1==f.interfaceProtocol||2==f.interfaceProtocol))return this.settings={configuration:a,interface:u,alternate:f},this}}catch(t){l.e(t)}finally{l.f()}}}catch(t){s.e(t)}finally{s.f()}}}catch(t){o.e(t)}finally{o.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}),null,[{key:"Parse",value:function(t){new DataView(t);var e=new TextDecoder("utf-8").decode(new Uint8Array(t.slice(st.Signature.Offset,st.Signature.Offset+st.Signature.Size)));if("DfuSe"!=e)throw new kt("Parsed file is not a DFU file (invalid signature)");var r=t.slice(ct.Offset);if("Target"!=(e=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(ct.TargetPrefix.Signature.Offset,ct.TargetPrefix.Signature.Size)))))throw new kt("Corrupted DFU file (invalid target signature)");for(var n=[],o=new DataView(r,ct.TargetPrefix.NbElements.Offset,ct.TargetPrefix.NbElements.Offset+ct.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(ct.Element.Offset),a=0;a<o;a++){var s=new DataView(i,ct.Element.Address.Offset,ct.Element.Address.Offset+ct.Element.Address.Size).getUint32(0,!0),c=new DataView(i,ct.Element.Size.Offset,ct.Element.Address.Offset+ct.Element.Size.Size).getUint32(0,!0),u=i.slice(ct.Element.Data.Offset,ct.Element.Data.Offset+c);i=i.slice(ct.Element.Data.Offset+c),n.push({address:s,size:c,data:u})}return n}}])}();function It(t){return new TextDecoder("utf-8").decode(t.subarray(0,t.indexOf(0)))}function Nt(t){var e=new TextEncoder("utf-8").encode(t),r=new Uint8Array(e.length+1);return r.set(e,0),r.set([0],e.length),r}function Mt(t,e){for(var r=new Uint8Array(e),n=0;n<e;n++)r[n]=t%256,t/=256;return r}function Bt(t){for(var e=new Uint8Array(t.length/2),r=0;r<e.length;r++)e[r]=parseInt(t.substr(2*r,2),16);return e}function Ut(t){for(var e=atob(t),r="",n=0;n<e.length;n++){var o=e.charCodeAt(n).toString(16);r+=2===o.length?o:"0"+o}return r.toUpperCase()}function Gt(t,e){if(t.length<e.length)return!1;for(var r=0;r<e.length;r++)if(t[r]!==e[r])return!1;return!0}function zt(t,e){return!(t.length<e.length)&&Gt(t.subarray(t.length-e.length),e)}function Ht(t){for(var e="",r=0;r<t.byteLength;r++)e+=t[r].toString(16).padStart(2,"0").toUpperCase();return e}var Vt="graphing",qt="scientific";function Yt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Wt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Kt(){Kt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function $t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ee(n.key),n)}}function Xt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Zt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Xt(i,n,o,a,s,"next",t)}function s(t){Xt(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Jt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qt(Object(r),!0).forEach((function(e){te(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function te(t,e,r){return(e=ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ee(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var re=r(1007),ne={ElectronicSignatureAddress:535853584,RAMAddressStart:536870912,RAMAddressEnd:537133056,InternalFlashStart:134217728,InternalFlashEnd:134283264,ExternalFlashStart:2415919104,ExternalFlashEnd:2424307712},oe={ElectronicSignatureAddress:535947264,RAMAddressStart:603979776,RAMAddressEnd:604307456,InternalFlashStart:134217728,InternalFlashEnd:134742016,ExternalFlashStart:2415919104,ExternalFlashEnd:2424307712},ie={N0100:Jt({name:"N0100",PotentialFlasher:!0,DeviceType:Vt},{ElectronicSignatureAddress:536836624,RAMAddressStart:536870912,RAMAddressEnd:537133056,InternalFlashStart:134217728,InternalFlashEnd:135266304,ExternalFlashStart:-1,ExternalFlashEnd:-1}),N0110:Jt({name:"N0110",PotentialFlasher:!0,DeviceType:Vt},ne),N0115:Jt({name:"N0115",PotentialFlasher:!1,DeviceType:Vt},ne),N0120:Jt({name:"N0120",PotentialFlasher:!1,DeviceType:Vt},oe),N0120Prototype:Jt({displayed_name:"N0120",name:"N0120_PORTUGAL_PROTOTYPE_20210930",PotentialFlasher:!1,DeviceType:Vt},oe),N0200:Jt({name:"N0200",PotentialFlasher:!1,DeviceType:qt},{InternalFlashStart:2550136832,InternalFlashEnd:2550398976,ExternalFlashStart:-1,ExternalFlashEnd:-1,RAMAddressStart:-1,RAMAddressEnd:-1,ResetLeaveAddress:134217728})};function ae(t,e){return se.apply(this,arguments)}function se(){return se=Zt(Kt().mark((function t(e,r){var n,o;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(16!=(n=e.device.serialNumber).length){t.next=3;break}return t.abrupt("return",n);case 3:return t.next=5,e.upload(r.ElectronicSignatureAddress-1,13);case 5:return o=t.sent,t.abrupt("return",(i=Ht(o.subarray(1,13)),btoa(i.match(/\w{2}/g).map((function(t){return String.fromCharCode(parseInt(t,16))})).join(""))));case 7:case"end":return t.stop()}var i}),t)}))),se.apply(this,arguments)}function ce(t,e){return ue.apply(this,arguments)}function ue(){return(ue=Zt(Kt().mark((function t(e,r){var n,o,i,a,s,c,u,l;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.device,o="NumWorks Calculator"===n.productName,i="NumWorks Scientific Calculator"===n.productName,a="STM32 BOOTLOADER"===n.productName,o||a||i){t.next=6;break}throw new Error("Device model cannot be retrieved.");case 6:if(!o&&!i){t.next=22;break}return t.next=9,e.getDeviceDescriptor();case 9:s=t.sent,c=new Uint8Array(s),u=(c[13]<<8)+c[12],t.t0=u,t.next=512===t.t0?15:288===t.t0?16:277===t.t0?18:272===t.t0?19:256===t.t0?20:21;break;case 15:return t.abrupt("return",ie.N0200);case 16:return t.abrupt("return","EAAbABVROTUxNDM4"==n.serialNumber?ie.N0120Prototype:ie.N0120);case 18:return t.abrupt("return",ie.N0115);case 19:return t.abrupt("return",ie.N0110);case 20:return t.abrupt("break",22);case 21:throw new Error("Device model cannot be retrieved.");case 22:return l=r[r.length-1].lastAddress,t.abrupt("return",l>135135232&&l<2415919104?ie.N0100:ie.N0110);case 24:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var le=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dfu=new Dt(e,r),this.running=!1,this.status=!1,this.infos=!1}return e=t,r=[{key:"process",value:(l=Zt(Kt().mark((function t(e){var r;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T.info("BaseCalculator","process"),this.status="waiting",!this.running){t.next=4;break}throw new b("Calculator is already processing another request");case 4:return t.prev=4,this.running=!0,t.next=8,this.dfu.open();case 8:return t.next=10,e(this);case 10:if(r=t.sent,!this.dfu.device.opened){t.next=14;break}return t.next=14,this.dfu.close();case 14:return this.running=!1,this.status="success",t.abrupt("return",r);case 19:throw t.prev=19,t.t0=t.catch(4),this.running=!1,this.status="error",t.t0;case 24:case"end":return t.stop()}}),t,this,[[4,19]])}))),function(t){return l.apply(this,arguments)})},{key:"reconnectAndProcess",value:(u=Zt(Kt().mark((function e(r){var n,o=arguments;return Kt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:void 0,T.info("BaseCalculator","reconnectAndProcess"),null!=navigator.usb){e.next=4;break}throw new E("Web usb unvailable");case 4:return e.next=6,t.StallUntilConnect(this.dfu.device.serialNumber,n);case 6:return this.dfu=e.sent,e.next=9,this.process(r);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)}))),function(t){return u.apply(this,arguments)})},{key:"extractInfos",value:(c=Zt(Kt().mark((function t(){var e,r,n,o;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T.info("BaseCalculator","extractInfos"),!1===this.infos){t.next=3;break}return t.abrupt("return",this);case 3:return t.prev=3,t.next=6,this.dfu.getMemoryLayout();case 6:return e=t.sent,t.next=9,ce(this.dfu,e);case 9:return r=t.sent,t.next=12,this.uploadHeader(this.dfu,e,r);case 12:return n=t.sent,t.next=15,ae(this.dfu,r);case 15:return o=t.sent,this.infos={displayedSerialNumber:o,serialNumber:Ut(o),model:r,memoryLayout:e,firmware:n},t.abrupt("return",this);case 20:throw t.prev=20,t.t0=t.catch(3),t.t0.message="extractInfos failed --\x3e "+t.t0.message,t.t0;case 24:case"end":return t.stop()}}),t,this,[[3,20]])}))),function(){return c.apply(this,arguments)})},{key:"isAddressValidFlash",value:function(t,e,r){var n=e+r;if(!(t.InternalFlashStart<=e&&n<=t.InternalFlashEnd||t.ExternalFlashStart<=e&&n<=t.ExternalFlashEnd))throw new k("Access to address: "+e+" (length "+r+") is out of flash range")}},{key:"isAddressValidRAM",value:function(t,e,r){var n=e+r;if(!(t.RAMAddressStart<=e&&n<=t.RAMAddressEnd))throw new k("Access to address: "+e+" (length "+r+") is out of RAM range")}},{key:"uploadFlash",value:(s=Zt(Kt().mark((function t(e,r,n){return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("BaseCalculator","uploadFlash","address "+Number(e).toString(16),"length "+Number(r).toString(16)),t.prev=1,t.next=4,this.extractInfos();case 4:return this.isAddressValidFlash(this.infos.model,e,r),t.next=7,this.dfu.upload(e,r,n);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(1),t.t0.message="uploadFlash failed --\x3e "+t.t0.message,t.t0;case 14:case"end":return t.stop()}}),t,this,[[1,10]])}))),function(t,e,r){return s.apply(this,arguments)})},{key:"downloadFlash",value:(a=Zt(Kt().mark((function t(e,r,n,o){var i;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("BaseCalculator","downloadFlash","address "+Number(e).toString(16)),i=function(){var t=Zt(Kt().mark((function t(e,r,n,o,i){var a,s,c,u,l,f,h,p,d,v,y,m,g;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0,s=0,c=-1,u=-1,l=-1,f=-1,h=0;case 7:if(!(h<r.length)){t.next=33;break}if(!(c<0)){t.next=14;break}if(!(n>r[h].lastAddress)){t.next=13;break}return t.abrupt("continue",30);case 13:c=h;case 14:p=0;case 15:if(!(p<r[h].nbPage)){t.next=30;break}if(!(u<0)){t.next=22;break}if(n!=r[h].address+p*r[h].pageSize){t.next=21;break}u=p,t.next=22;break;case 21:return t.abrupt("continue",27);case 22:if(!((a+=r[h].pageSize)>=o.byteLength)){t.next=27;break}return l=h,f=p,t.abrupt("break",33);case 27:p++,t.next=15;break;case 30:h++,t.next=7;break;case 33:d=c;case 34:if(!(d<=l)){t.next=51;break}v=d==c?u:0,y=d==l?f+1:r[d].nbPage,m=v;case 38:if(!(m<y)){t.next=48;break}return g=r[d].address+m*r[d].pageSize,t.next=42,e.eraseSegment(g);case 42:s+=r[d].pageSize,i(s/a),g+=r[d].pageSize;case 45:m++,t.next=38;break;case 48:d++,t.next=34;break;case 51:case"end":return t.stop()}}),t)})));return function(e,r,n,o,i){return t.apply(this,arguments)}}(),t.prev=2,t.next=5,this.extractInfos();case 5:return this.isAddressValidFlash(this.infos.model,e,r.byteLength),t.next=8,i(this.dfu,this.infos.memoryLayout,e,r,n);case 8:return t.next=10,this.dfu.download(e,r,o);case 10:return t.abrupt("return",t.sent);case 13:throw t.prev=13,t.t0=t.catch(2),t.t0.message="downloadFlash failed --\x3e "+t.t0.message,t.t0;case 17:case"end":return t.stop()}}),t,this,[[2,13]])}))),function(t,e,r,n){return a.apply(this,arguments)})},{key:"reset",value:(i=Zt(Kt().mark((function t(){var e;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("BaseCalculator","reset"),t.prev=1,t.next=4,this.extractInfos();case 4:return e=this.infos.model.ResetLeaveAddress||this.infos.model.InternalFlashStart,T.info("BaseCalculator","reset by leaving at address="+Number(e).toString(16)),t.next=8,this.dfu.leave(e);case 8:return this.running=!1,this.infos=!1,t.abrupt("return",!0);case 13:throw t.prev=13,t.t0=t.catch(1),t.t0.message="reset failed --\x3e "+t.t0.message,t.t0;case 17:case"end":return t.stop()}}),t,this,[[1,13]])}))),function(){return i.apply(this,arguments)})},{key:"checkCanUpdateToVersion",value:function(t){var e=this.infos.firmware.version;if(e){var r=e.split(".").map(Number),n=t.split(".").map(Number);if(r.length==n.length){for(var o=!0,i=!0,a=0;a<r.length;a++){var s=r[a],c=n[a];if(s!=c){i=!1,o=c<s;break}}if(i&&(i=!1,o=!1),o)throw new S(i,"Cannot downgrade from "+e+" to "+t)}}}}],n=[{key:"CheckFirmware",value:function(t,e){for(var r=0;r<e.byteLength;r++)if(t[r]!=e[r])throw new w("The uploaded firmware differs from the reference at byte "+Number(r).toString(16)+" ("+Number(t[r]).toString(16)+" vs "+Number(e[r]).toString(16));return!0}},{key:"StallUntilConnect",value:(o=Zt(Kt().mark((function t(e){var r,n,o,i,a,s,c,u=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=u.length>1&&void 0!==u[1]?u[1]:void 0,T.info("BaseCalculator","StallUntilConnect"),n=60,o=1;case 4:if(!(o<n)){t.next=32;break}return t.next=7,navigator.usb.getDevices();case 7:i=t.sent,a=Yt(i),t.prev=9,a.s();case 11:if((s=a.n()).done){t.next=18;break}if((c=s.value).serialNumber!==e){t.next=16;break}return r&&r(1),t.abrupt("return",new Dt(c,2048));case 16:t.next=11;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(9),a.e(t.t0);case 23:return t.prev=23,a.f(),t.finish(23);case 26:return r&&r((o-1)/o),t.next=29,new re((function(t){return setTimeout(t,1e3)}));case 29:o++,t.next=4;break;case 32:throw new x("Device detection timed out");case 33:case"end":return t.stop()}}),t,null,[[9,20,23,26]])}))),function(t){return o.apply(this,arguments)})},{key:"DisplayableFirmwarePatch",value:function(t){return"badbabe"==t?"unofficial":t}}],r&&$t(e.prototype,r),n&&$t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,o,i,a,s,c,u,l}();le.Product={ST:"ST",Epsilon:"epsilon",Scandium:"scandium"};const fe=le;function he(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return pe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pe(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function de(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ye(n.key),n)}}function ve(t,e,r){return e&&de(t.prototype,e),r&&de(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ye(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ge(t,e,r){return e=we(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_e()?Reflect.construct(e,r||[],we(t).constructor):e.apply(t,r))}function _e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_e=function(){return!!t})()}function we(t){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},we(t)}function be(t,e){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},be(t,e)}var Ee=function(t){function e(){me(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ge(this,e,["StorageError"].concat(r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&be(t,e)}(e,t),ve(e)}(l);function ke(t){return new DataView(t.buffer,t.byteOffset).getUint16(0,!0)}function xe(t){var e={size:0,name:"unknown",content:"unknown"};return e.size=ke(t),e.name=It(t.subarray(2)),e.content=t.subarray(2+e.name.length+1,e.size),e}var Se=function(){return ve((function t(e){me(this,t),this.records=e}),[{key:Symbol.iterator,value:function(){var t=this.records;return{next:function(){var e=ke(t);if(0===e)return{done:!0};var r=xe(t);return t=t.subarray(e),{value:r,done:!1}}}}}])}(),Ae=ve((function t(e){me(this,t),this.availableSize=function(){var t,e=0,r=he(new Se(this.data));try{for(r.s();!(t=r.n()).done;){e+=t.value.size}}catch(t){r.e(t)}finally{r.f()}return this.totalSize()-e},this.totalSize=function(){return this.data.byteLength-2},this.recordsWithExtension=function(t){var e,r=[],n=he(new Se(this.data));try{for(n.s();!(e=n.n()).done;){var o=e.value;o.name.endsWith(t)&&r.push(o.name)}}catch(t){n.e(t)}finally{n.f()}return r},this.size=function(t){var e,r=he(new Se(this.data));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.name===t)return n.size}}catch(t){r.e(t)}finally{r.f()}},this.content=function(t){var e,r=he(new Se(this.data));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.name===t)return n.content}}catch(t){r.e(t)}finally{r.f()}throw new Ee('record "'+t+'" does not exist')},this.setContent=function(t,e){var r,n=0,o=0,i=he(new Se(this.data));try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.name===t){o=a.size;break}n+=a.size}}catch(t){i.e(t)}finally{i.f()}var s=this.data.slice(n+o),c=n,u=function(t,e){if(void 0!==e){var r=t.length+1+e.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(Nt(t),2),n.set(e,2+t.length+1),n}}(t,e);if(void 0!==u){if(xe(u).size>this.availableSize()+o)throw new Ee("The storage on calculator is full");this.data.set(u,n),c+=u.length,s=s.slice(0,this.data.length-(n+u.length))}this.data.set(s,c),this.data.fill(0,c+s.length)},this.data=e}));Ae.PreferenceRecord="pr.sys",Ae.GlobalePreferenceRecord="gp.sys";const Pe=Ae;var Oe={Countries:["ww","ca","de","es","fr","gb","it","nl","pt","us"],Languages:["en","fr","nl","pt","it","de","es"]},Fe={PressToTestFlags:["forbidExactResults","forbidEquationSolver","forbidInequalityGraphing","forbidImplicitPlots","forbidGraphDetails","forbidElementsApp","forbidStatsDiagnostics","forbidVectors","forbidBasedLogarithm","forbidSum"],ExamModePresets:{Off:{flags:[],country:"ww",code:0},Standard:{flags:[],country:"ww",code:1},Dutch:{flags:["forbidElementsApp","forbidCodeApp","forbidUnits","forbidAdditionalResults","forbidExactResults"],country:"nl",code:2},IBTest:{flags:["forbidElementsApp","forbidGraphDetails","forbidImplicitPlots","forbidVectorProduct","forbidUnits","forbidAdditionalResults"],country:"us",code:3},"Press-to-test":{flags:[],country:"us",code:4},Portuguese:{flags:["forbidElementsApp"],country:"pt",code:5},English:{flags:["forbidElementsApp"],country:"en",code:6},STAAR:{flags:["forbidGraphDetails","forbidInequalityGraphing","forbidImplicitPlots","forbidSimultaneousEquationSolver"],country:"us",code:7},Pennsylvania:{flags:["forbidEquationSolver","forbidGraphDetails","forbidImplicitPlots","forbidExactResults"],country:"us",code:8},SouthCarolina:{flags:["forbidEquationSolver","forbidGraphDetails","forbidExactResults"],country:"us",code:9},NorthCarolina:{flags:["forbidEquationSolver","forbidGraphDetails","forbidExactResults"],country:"us",code:10},SAT:{flags:["forbidExactResultsInSolverApp"],country:"us",code:11}}};function Ce(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=je(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||je(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(t,e){if(t){if("string"==typeof t)return Le(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Le(t,e):void 0}}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Re(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ie(n.key),n)}}function De(t,e,r){return e&&Re(t.prototype,e),r&&Re(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ie(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function Ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Me(t,e,r){return e=Ue(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Be()?Reflect.construct(e,r||[],Ue(t).constructor):e.apply(t,r))}function Be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Be=function(){return!!t})()}function Ue(t){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ue(t)}function Ge(t,e){return Ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ge(t,e)}var ze=function(t){function e(){Ne(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Me(this,e,["PreferencesVersionError"].concat(r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ge(t,e)}(e,t),De(e)}(l);var He=function(){function t(e,r){Ne(this,t);var n=e[t.IndexOfVersion];if(!Object.hasOwn(t.PreferencesVersions,n))throw new ze("pr.sys version is "+n+", which is not supported.");var o=r[t.IndexOfVersion];if(!Object.hasOwn(t.GlobalPreferencesVersions,o))throw new ze("gp.sys version is "+o+", which is not supported.");this.preferences=e,this.preferencesVersion=t.PreferencesVersions[n],this.globalPreferences=r,this.globalPreferencesVersion=t.GlobalPreferencesVersions[o]}return De(t,[{key:"getCountry",value:function(){return Oe.Countries[this.globalPreferences[this.getIndexOfCountry()]]}},{key:"setCountry",value:function(t){this.globalPreferences[this.getIndexOfCountry()]=Oe.Countries.indexOf(t)}},{key:"getExamMode",value:function(){var t,e=this.getExamCode();return 1&e?this.getConfigurablePresetName():(t=e>>1&16383,Object.keys(Fe.ExamModePresets).find((function(e){return Fe.ExamModePresets[e].code===t})))}},{key:"setExamMode",value:function(t,e){if(this.preferences[this.getIndexOfForceReload()]=1,t==this.getConfigurablePresetName()){var r,n=1,o=Ce(Fe.PressToTestFlags.entries());try{for(o.s();!(r=o.n()).done;){var i=Te(r.value,2),a=i[0];n|=(1&e[i[1]])<<a+1}}catch(t){o.e(t)}finally{o.f()}var s=Mt(n,2);this.preferences[this.getIndexOfExamMode0()]=s[0],this.preferences[this.getIndexOfExamMode1()]=s[1]}else if(Fe.ExamModePresets[t]){var c=Mt(Fe.ExamModePresets[t].code<<1&16383,2);this.preferences[this.getIndexOfExamMode0()]=c[0],this.preferences[this.getIndexOfExamMode1()]=c[1]}}},{key:"getPressToTestFlags",value:function(){var t={},e=this.getExamMode();if(e!=this.getConfigurablePresetName())return this.getPressToTestFlags(e);var r,n=Ce(Fe.PressToTestFlags.entries());try{for(n.s();!(r=n.n()).done;){var o=Te(r.value,2),i=o[0];t[o[1]]=examCode>>i+1&1}}catch(t){n.e(t)}finally{n.f()}return t}},{key:"getExamCode",value:function(){var t=this.preferences.subarray(this.getIndexOfExamMode0(),this.getIndexOfExamMode1()+1);return 256*t[1]+t[0]}},{key:"getConfigurablePresetName",value:function(){return t.ConfigurablePresetName}},{key:"getIndexOfExamMode0",value:function(){return this.preferencesVersion.IndexOfExamMode0}},{key:"getIndexOfExamMode1",value:function(){return this.preferencesVersion.IndexOfExamMode1}},{key:"getIndexOfForceReload",value:function(){return this.preferencesVersion.IndexOfForceReload}},{key:"getIndexOfCountry",value:function(){return this.globalPreferencesVersion.IndexOfCountry}}],[{key:"getAdditionalFeatures",value:function(t){var e,r=[],n=Ce(Fe.ExamModePresets[t].flags);try{for(n.s();!(e=n.n()).done;){var o=e.value;-1==Fe.PressToTestFlags.indexOf(o)&&r.push(o)}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"getPressToTestFlags",value:function(t){var e,r={},n=Ce(Fe.PressToTestFlags);try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=-1!=Fe.ExamModePresets[t].flags.indexOf(o)}}catch(t){n.e(t)}finally{n.f()}return r}}])}();He.IndexOfVersion=0,He.ConfigurablePresetName="Press-to-test",He.PreferencesVersions={0:{IndexOfExamMode0:3,IndexOfExamMode1:4,IndexOfForceReload:5},1:{IndexOfExamMode0:1,IndexOfExamMode1:2,IndexOfForceReload:3}},He.GlobalPreferencesVersions={0:{IndexOfCountry:6},1:{IndexOfCountry:6},2:{IndexOfCountry:6},3:{IndexOfCountry:6}};function Ve(t){return function(t){if(Array.isArray(t))return qe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return qe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qe(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ye(){Ye=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function We(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ke(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){We(i,n,o,a,s,"next",t)}function s(t){We(i,n,o,a,s,"throw",t)}a(void 0)}))}}function $e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xe(n.key),n)}}function Xe(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function Ze(t,e,r){return e=er(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qe()?Reflect.construct(e,r||[],er(t).constructor):e.apply(t,r))}function Qe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qe=function(){return!!t})()}function Je(t,e,r,n){var o=tr(er(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}function tr(){return tr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=er(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},tr.apply(null,arguments)}function er(t){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(t)}function rr(t,e){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rr(t,e)}var nr=Bt("F00DC0DE"),or=Bt("FEEDC0DE"),ir=Bt("BADBEEEF"),ar=Bt("BADD0BEE");function sr(t){var e=Nt(t),r=new Uint8Array(e.length+1);return r[0]=1,r.set(e,1),r}function cr(t){if(T.info("Calculator","parseSlotInfo","header info "+t),!Gt(t,ir)||!zt(t,ir))return null;var e=new DataView(t.buffer,t.byteOffset);return{kernelHeaderAddress:e.getUint32(4,!0),userlandHeaderAddress:e.getUint32(8,!0)}}function ur(t,e){if(T.info("Calculator","parseFirmwareHeader","header "+t),Gt(t,nr)){e.version=It(t.subarray(4)),e.patch=It(t.subarray(12));var r=t.subarray(20);if(!Gt(r,nr)){var n=new DataView(t.buffer,t.byteOffset);e.storageAddress=n.getUint32(20,!0),Gt(r=t.subarray(24),nr)||(e.storageSize=n.getUint32(24,!0))}}}function lr(t,e){if(T.info("Calculator","parseUserlandHeader","header "+t),!Gt(t,or))return-1;e.userlandVersion=It(t.subarray(4));var r=new DataView(t.buffer,t.byteOffset),n=12;return e.storageAddress=r.getUint32(n,!0),n+=4,e.storageSize=r.getUint32(n,!0),n+=4,e.externalAppsFlashStart=r.getUint32(n,!0),n+=4,e.externalAppsFlashEnd=r.getUint32(n,!0),n+=4,Gt(t.subarray(n),or)?n:(e.externalAppsRamStart=r.getUint32(n,!0),n+=4,e.externalAppsRamEnd=r.getUint32(n,!0),n+=4,Gt(t.subarray(n),or)?n:(e.deviceNameFlashStart=r.getUint32(n,!0),n+=4,e.deviceNameFlashEnd=r.getUint32(n,!0),n+=4))}var fr=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Ze(this,e,[t])).storage=!1,r.calculatorPreferences=!1,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rr(t,e)}(e,t),r=e,n=[{key:"reset",value:(c=Ke(Ye().mark((function t(){return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Je(e,"reset",this,3)([]),this.storage=!1;case 2:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"uploadHeader",value:(s=Ke(Ye().mark((function t(r,n,o){var i,a,s,c,u,l,f,h,p,d=this;return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.info("Calculator","uploadHeader","address "+Number(n[0].address).toString(16)),i={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",trampolineAddress:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",deviceNameFlashStart:"unknown",deviceNameFlashEnd:"unknown",storageAddress:"unknown",storageSize:4096},t.prev=2,u=function(){var t=Ke(Ye().mark((function t(e,u){return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n[0].address+e,s=u,d.isAddressValidFlash(o,a,s),t.next=5,r.upload(a,s);case 5:if(!Gt(c=t.sent,nr)||!zt(c,nr)){t.next=9;break}return ur(c,i),t.abrupt("return",!0);case 9:return t.abrupt("return",!1);case 10:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),t.next=6,u(e.Header0.Offset,e.Header0.Size);case 6:if(!t.sent){t.next=8;break}return t.abrupt("return",i);case 8:return t.next=10,u(e.Header1.Offset,e.Header1.Size);case 10:if(!t.sent){t.next=12;break}return t.abrupt("return",i);case 12:return a=o.RAMAddressStart,s=e.Header2.SlotInfoSize,this.isAddressValidRAM(o,a,s),t.prev=15,t.next=18,r.upload(a,s,void 0,1);case 18:if(l=t.sent,null!=(f=cr(l))){t.next=22;break}throw new w("The slot info was corrupted");case 22:return a=f.kernelHeaderAddress,s=e.Header2.KernelHeaderSize,this.isAddressValidFlash(o,a,s),t.next=27,r.upload(a,s);case 27:return ur(t.sent,i),a=f.userlandHeaderAddress,s=e.Header2.UserlandMaxHeaderSize,this.isAddressValidFlash(o,a,s),t.next=34,r.upload(a,s);case 34:if(Gt(h=t.sent,or)){t.next=37;break}throw new w("The userland header was corrupted");case 37:if(!((p=lr(h,i))<0)&&Gt(h.subarray(p),or)){t.next=40;break}throw new w("The userland header was corrupted");case 40:i.trampolineAddress=a+p+or.byteLength+e.Header2.UserlandISRSize,t.next=46;break;case 43:t.prev=43,t.t0=t.catch(15),ur(c,i);case 46:return t.abrupt("return",i);case 49:throw t.prev=49,t.t1=t.catch(2),t.t1.message="Upload header failed --\x3e "+t.t1.message,t.t1;case 53:case"end":return t.stop()}}),t,this,[[2,49],[15,43]])}))),function(t,e,r){return s.apply(this,arguments)})},{key:"exitDFU",value:function(){var t=this;return T.info("Calculator","exitDFU"),new Promise((function(e,r){t.extractInfos().then((function(e){return t.dfu.leave(e.infos.firmware.externalAppsFlashStart)})).then((function(){e(!0)})).catch((function(t){t.message="exit DFU failed --\x3e "+t.message,r(t)}))}))}},{key:"getAvailableSpaceInfo",value:function(){var t=this;return T.info("Calculator","getAvailableSpaceInfo"),new Promise((function(e,r){var n={availableSize:!1,totalSize:!1};t.extractInfos().then((function(e){return t.calculatorGetStorage(e.infos)})).then((function(t){n.availableSize=t.availableSize(),n.totalSize=t.totalSize(),e(n)})).catch((function(t){t.message="getAvailableSpaceInfo failed --\x3e "+t.message,r(t)}))}))}},{key:"getScripts",value:function(){var t=this;return T.info("Calculator","getScripts"),new Promise((function(e,r){t.extractInfos().then((function(e){return t.calculatorGetStorage(e.infos)})).then((function(t){return t.recordsWithExtension(".py").map((function(e,r){return{name:e,size:t.size(e),content:It(t.content(e).subarray(1))}}))})).then((function(t){e(t)})).catch((function(t){t.message="getScripts failed --\x3e "+t.message,r(t)}))}))}},{key:"getPreferences",value:function(){var t,e=this;T.info("Calculator","getPreferences");var r,n=this;return new Promise((function(o,i){e.extractInfos().then((function(t){return e.calculatorGetStorage(t.infos)})).then((function(e){return t=e.content(Pe.PreferenceRecord)})).then((function(){return r=e.storage.content(Pe.GlobalePreferenceRecord)})).then((function(){n.calculatorPreferences=new He(t,r),o(n.calculatorPreferences)})).catch((function(t){t.message="getPreferences failed --\x3e "+t.message,i(t)}))}))}},{key:"removeScripts",value:function(){var t=this;return T.info("Calculator","removeScripts"),new Promise((function(e,r){t.extractInfos().then((function(e){return t.calculatorGetStorage(e.infos)})).then((function(e){return e.recordsWithExtension(".py").map((function(t,r){e.setContent(t)})),t.calculatorSetStorage(t.infos,e)})).then((function(){e(!0)})).catch((function(t){t.message="removeScripts failed --\x3e "+t.message,r(t)}))}))}},{key:"getSizeForRecord",value:function(t){var e=this;return T.info("Calculator","getSizeForRecord","name "+t),new Promise((function(r,n){var o;e.extractInfos().then((function(t){return e.calculatorGetStorage(t.infos)})).then((function(e){o=e.size(t),r(o)})).catch((function(t){t.message="getSizeForRecord failed --\x3e "+t.message,n(t)}))}))}},{key:"updateCountry",value:function(t){this.calculatorPreferences.setCountry(t)}},{key:"getCountry",value:function(){return this.calculatorPreferences.getCountry()}},{key:"updateExamMode",value:function(t,e){this.calculatorPreferences.setExamMode(t,e)}},{key:"setPreferences",value:function(){var t=this;return T.info("Calculator","updatePreferences"),new Promise((function(e,r){t.setContentForRecord(Pe.GlobalePreferenceRecord,t.calculatorPreferences.globalPreferences).then((function(){return t.setContentForRecord(Pe.PreferenceRecord,t.calculatorPreferences.preferences)})).then((function(){e(!0)})).catch((function(t){t.message="setContentForRecord failed --\x3e "+t.message,r(t)}))}))}},{key:"setContentForRecord",value:function(t,e){var r=this;return T.info("Calculator","setContentForRecord","name "+t),new Promise((function(n,o){r.extractInfos().then((function(t){return r.calculatorGetStorage(t.infos)})).then((function(n){try{n.setContent(t,e)}catch(t){o(t)}return r.calculatorSetStorage(r.infos,n)})).then((function(){n(!0)})).catch((function(t){t.message="setContentForRecord failed --\x3e "+t.message,o(t)}))}))}},{key:"setContentForScript",value:function(t,e){var r=this;return T.info("Calculator","setContentForScript","name "+t),new Promise((function(n,o){r.setContentForRecord(t,sr(e)).then((function(){n(!0)})).catch((function(t){t.message="setContentForScript failed --\x3e "+t.message,o(t)}))}))}},{key:"setRecords",value:function(t){var e=this;return T.info("Calculator","setRecords",t),new Promise((function(r,n){e.extractInfos().then((function(t){return e.calculatorGetStorage(t.infos)})).then((function(e){try{t.forEach((function(t,r){e.setContent(t.name,t.content)}))}catch(t){n(t)}return e})).then((function(t){return e.calculatorSetStorage(e.infos,t)})).then((function(){r(!0)})).catch((function(t){t.message="setRecords failed --\x3e "+t.message,n(t)}))}))}},{key:"setScripts",value:function(t){var e=this;return T.info("Calculator","setScripts",t),new Promise((function(r,n){var o=[];t.forEach((function(t,e){o[e]={name:t.name,content:sr(t.content)}})),e.setRecords(o).then((function(){r(!0)})).catch((function(t){t.message="setScripts failed --\x3e "+t.message,n(t)}))}))}},{key:"removeRecord",value:function(t){var e=this;return T.info("Calculator","removeRecord","name "+t),new Promise((function(r,n){e.extractInfos().then((function(t){return e.calculatorGetStorage(t.infos)})).then((function(r){return r.setContent(t),e.calculatorSetStorage(e.infos,r)})).then((function(){r(!0)})).catch((function(t){t.memory="removeRecord failed --\x3e "+t.message,n(t)}))}))}},{key:"setDeviceName",value:function(t){var e=this;return new Promise((function(r,n){e.extractInfos().then((function(n){var o=n.infos.firmware.deviceNameFlashStart;if("unknown"==o)return r(!0);var i=n.infos.firmware.deviceNameFlashEnd-o,a=t.normalize("NFKD"),s=(new TextEncoder).encode(a),c=Math.min(s.length,i-1),u=new Uint8Array([].concat(Ve(s.subarray(0,c)),[0]));r(e.dfu.download(o,u,(function(t){})))}))}))}},{key:"calculatorGetStorage",value:(a=Ke(Ye().mark((function t(e){var r,n;return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T.info("Calculator","calculatorGetStorage","address "+Number(e.firmware.storageAddress).toString(16)),"unknown"!==e.firmware.storageAddress){t.next=3;break}throw new w("The Storage address could not be found in header");case 3:t.prev=3,this.isAddressValidRAM(e.model,e.firmware.storageAddress,e.firmware.storageSize+2*ar.length),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(3),new w("Calculator Get Storage failed --\x3e "+t.t0);case 10:if(!1===this.storage){t.next=12;break}return t.abrupt("return",this.storage);case 12:return t.prev=12,t.next=15,this.dfu.upload(e.firmware.storageAddress,e.firmware.storageSize+2*ar.length,void 0,1);case 15:if(!Gt(r=t.sent,ar)||!zt(r,ar)){t.next=22;break}return n=r.subarray(ar.length,e.firmware.storageSize+ar.length),this.storage=new Pe(n),t.abrupt("return",this.storage);case 22:throw new w("Memory is corrupted: could not find storage tags");case 23:t.next=29;break;case 25:throw t.prev=25,t.t1=t.catch(12),t.t1.message="CalculationGetStorage failed --\x3e "+t.t1.message,t.t1;case 29:case"end":return t.stop()}}),t,this,[[3,7],[12,25]])}))),function(t){return a.apply(this,arguments)})},{key:"calculatorSetStorage",value:(i=Ke(Ye().mark((function t(e,r){return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:T.info("Calculator","calculatorSetStorage","address "+Number(e.firmware.storageAddress).toString(16)),t.prev=1,this.isAddressValidRAM(e.model,e.firmware.storageAddress+ar.length,r.data.length),t.next=8;break;case 5:throw t.prev=5,t.t0=t.catch(1),new w("Calculator Set Storage failed --\x3e "+t.t0);case 8:return t.prev=8,t.next=11,this.dfu.download(e.firmware.storageAddress+ar.length,r.data,void 0,1);case 11:t.next=17;break;case 13:throw t.prev=13,t.t1=t.catch(8),t.t1.message="CalculationSetStorage failed --\x3e "+t.t1.message,t.t1;case 17:case"end":return t.stop()}}),t,this,[[1,5],[8,13]])}))),function(t,e){return i.apply(this,arguments)})}],n&&$e(r.prototype,n),o&&$e(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a,s,c}(fe);function hr(){hr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function pr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function dr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){pr(i,n,o,a,s,"next",t)}function s(t){pr(i,n,o,a,s,"throw",t)}a(void 0)}))}}function vr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yr(n.key),n)}}function yr(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function mr(t,e,r){return e=_r(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gr()?Reflect.construct(e,r||[],_r(t).constructor):e.apply(t,r))}function gr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gr=function(){return!!t})()}function _r(t){return _r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_r(t)}function wr(t,e){return wr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wr(t,e)}fr.Header0={Offset:428,Size:24},fr.Header1={Offset:452,Size:32},fr.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandMaxHeaderSize:48,UserlandISRSize:8};var br=Bt("FECACEFA"),Er=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),mr(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wr(t,e)}(e,t),r=e,n=[{key:"resetToLayout",value:(c=dr(hr().mark((function t(e){return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.extractInfos();case 2:if(this.infos.memoryLayout[0].name!==e){t.next=4;break}return t.abrupt("return",!1);case 4:return t.next=6,this.reset();case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"resetInScandium",value:(s=dr(hr().mark((function t(){return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.resetToLayout(e.ScandiumLayoutName);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"resetInRescue",value:(a=dr(hr().mark((function t(){return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.resetToLayout(e.RescueLayoutName);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"uploadHeader",value:(i=dr(hr().mark((function t(e,r,n){var o,i,a;return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T.info("Scandium","uploadHeader"),"@FirmwareHeader"==r[0].name){t.next=3;break}return t.abrupt("return",{version:"0.0.0",patch:"0000000"});case 3:return o=r[0].address,t.next=7,e.upload(o,32);case 7:if(Gt(i=t.sent,br)&&zt(i,br)){t.next=10;break}throw new w("The header info was corrupted");case 10:return(a={}).version=It(i.subarray(12)),a.patch=It(i.subarray(20)),t.abrupt("return",a);case 16:case"end":return t.stop()}}),t)}))),function(t,e,r){return i.apply(this,arguments)})}],n&&vr(r.prototype,n),o&&vr(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a,s,c}(fe);function kr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return xr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ar(n.key),n)}}function Ar(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}Er.RescueLayoutName="@EncryptedFlash",Er.ScandiumLayoutName="@FirmwareHeader";var Pr=r(1007);function Or(t){return"NumWorks Scientific Calculator"===t.productName?new Er(t):new fr(t)}var Fr=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.calculators=[],this.errors={}}return e=t,r=[{key:"singleConnectAndExtractInfos",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1==this.calculators.length&&null!=this.calculators[0].info?this.calculators[0]:this.connectAndProcess((function(t){return t.extractInfos()}),!1,[fe.Product.Epsilon,fe.Product.Scandium],t).then((function(t){return t[0]}))}},{key:"process",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return T.info("CalculatorBulk","reconnectAndProcess"),Pr.map(this.calculators,(function(e){return(r?e.reconnectAndProcess(t):e.process(t)).catch((function(t){n.push({serialNumber:e.infos.displayedSerialNumber,error:t})}))})).then((function(t){if(1==n.length)throw n[0].error;if(n.length>0){for(var r=0,o=n;r<o.length;r++){var i,a=o[r],s=a.serialNumber,c=a.error;(i=e.errors)[s]||(i[s]=[]),e.errors[s].push(c)}if(e.calculators.every((function(t){return e.errors[t.infos.displayedSerialNumber]})))throw new A(n)}return t}))}},{key:"reconnectAndProcess",value:function(t){return this.process(t,!0)}},{key:"connectAndProcess",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[fe.Product.Epsilon],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return this.errors={},T.info("CalculatorBulk","connectAndProcess"),new Pr((function(a,s){r.connect(n,e,o,i).then((function(){return r.connected()?r.process(t):s(new P("No usb connection found"))})).then((function(t){a(t)})).catch((function(t){s(t)}))}))}},{key:"connected",value:function(){return this.calculators.length>0}},{key:"connect",value:function(e,r,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new Pr((function(a,s){var c=t.Connect(e,!1).then((function(n){if(r||0==n.length)o.calculators=n;else if(i){var a=t.BestFitProduct(e[0],n);o.calculators=a?[a]:[]}else o.calculators=[n[0]]})).catch((function(t){t.memory="connect failed --\x3e "+t.message,s(t)}));return n?c.then((function(){return t.Connect(e,!0)})).then((function(t){var e=t[0];r?o.calculators.some((function(t){return t.dfu.device==e.dfu.device}))||o.calculators.push(e):o.calculators=[e],a(o.calculators)})).catch((function(t){t.memory="connect failed --\x3e "+t.message,s(t)})):c.then((function(){a(o.calculators)}))}))}}],n=[{key:"ProductId",value:function(t){switch(t){case fe.Product.Epsilon:return 41617;case fe.Product.Scandium:return 42266;case fe.Product.ST:return 57105}}},{key:"BestFitProduct",value:function(e,r){var n=t.ProductId(e);return r.find((function(t){return t.dfu.device.productId===n}))}},{key:"Connect",value:function(e,r){T.info("CalculatorBulk","connect",e);var n=[],o=e.map(t.ProductId),i=[];return o.forEach((function(t){return i.push({vendorId:1155,productId:t})})),new Pr((function(t,e){if(null==navigator.usb)return e(new E("Web usb unvailable"));r?(T.info("CalculatorBulk","connect","request device"),navigator.usb.requestDevice({filters:i}).then((function(e){return n.push(Or(e)),t(n)})).catch((function(t){e(new P("Usb device selection failure: "+t))}))):(T.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(e){var r,i=kr(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;1155===a.vendorId&&o.includes(a.productId)&&n.push(Or(a))}}catch(t){i.e(t)}finally{i.f()}return t(n)})).catch((function(t){e(new P("Usb device failed: "+t))})))}))}}],r&&Sr(e.prototype,r),n&&Sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();const Cr=Fr;r(83);var Tr=r(5404),jr=r(9904),Lr=r(5552),Rr=r.n(Lr);function Dr(t){return new Promise(((e,n)=>{let o={locateFile:function(t,e){return r(7523)},preRun:function(){o.FS.writeFile("input.dat",t.input)},onAbort:n,arguments:t.arguments.concat(["input.dat","output.dat"]),postRun:function(){e(o.FS.readFile(t.output||"output.dat"))}};Rr()(o)}))}function Ir(){Ir=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Nr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Br(n.key),n)}}function Br(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function Ur(t,e){return Math.round(255/((1<<e)-1)*t)}var Gr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rgba8888Data=e}return e=t,r=[{key:"toPNG",value:function(){if("function"==typeof ImageData){var e=new ImageData(new Uint8ClampedArray(this.rgba8888Data.buffer),t.Width,t.Height),r=document.createElement("canvas");return r.width=t.Width,r.height=t.Height,r.getContext("2d").putImageData(e,0,0),r.toDataURL()}console.error("ImageData is unavailable")}},{key:"toNWI",value:function(){var t=function(t){for(var e=t.length/4,r=new Uint8Array(2*e),n=0;n<e;n++){var o=t[4*n]>>3<<11|t[4*n+1]>>2<<5|t[4*n+2]>>3;r[2*n]=255&o,r[2*n+1]=o>>8&255}return r}(this.rgba8888Data),e=Tr.compressBlock(t,new Uint8Array(0),0,t.length,Tr.makeBuffer(65536)),r=new Uint8Array(e);return Tr.compressBlock(t,r,0,t.length,Tr.makeBuffer(65536)),r}},{key:"toIconO",value:(o=Ir().mark((function t(){return Ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Dr({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_app_icon","--redefine-sym","_binary_input_dat_start=eadk_app_icon","--strip-symbol","_binary_input_dat_end","--strip-symbol","_binary_input_dat_size"],input:this.toNWI()});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Nr(i,r,n,a,s,"next",t)}function s(t){Nr(i,r,n,a,s,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})}],n=[{key:"fromPNG",value:function(e){var r=jr.O.sync.read(e);if(r.width!=t.Width)throw"Icon has an invalid width";if(r.height!=t.Height)throw"Icon has an invalid height";return new t(r.data)}},{key:"fromNWI",value:function(e){var r=new Uint8Array(t.Width*t.Height*2);Tr.decompressBlock(e,r,0,e.length,0);var n=function(t){for(var e=t.length/2,r=new Uint8Array(4*e),n=0;n<e;n++){var o=t[2*n+1]<<8|t[2*n],i=o>>11&31,a=o>>5&63,s=31&o;r[4*n]=Ur(i,5),r[4*n+1]=Ur(a,6),r[4*n+2]=Ur(s,5),r[4*n+3]=255}return r}(r);return new t(n)}}],r&&Mr(e.prototype,r),n&&Mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,o,i}();Gr.Width=55,Gr.Height=56;const zr=Gr;var Hr=r(8148),Vr=r.n(Hr);function qr(t){return new Promise(((e,n)=>{let o={locateFile:function(t,e){return r(917)},preRun:function(){for(const[e,r]of Object.entries(t.inputs))o.FS.writeFile(e,r)},printErr:function(t){o.errorLog||="",o.errorLog=o.errorLog.concat(t).concat("\n")},onAbort:n,arguments:t.arguments.concat(["--output","output.elf"]),postRun:function(){o.errorLog?n(o.errorLog):e(o.FS.readFile("output.elf"))}};Vr()(o)}))}function Yr(){Yr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Wr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Kr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Wr(i,n,o,a,s,"next",t)}function s(t){Wr(i,n,o,a,s,"throw",t)}a(void 0)}))}}function $r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xr(n.key),n)}}function Xr(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function Zr(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Qr=0;function Jr(t){return"__private_"+Qr+++"_"+t}var tn=r(9698),en=r(786),rn=Jr("getSectionNamed"),nn=Jr("externalObject"),on=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,nn,{value:cn}),Object.defineProperty(this,rn,{value:an}),this.nwaData=e,this.size=void 0,this.name=void 0,this.icon=void 0,this.needsExternalData=void 0}return e=t,r=[{key:"loadIcon",value:function(){var t=this;return Zr(this,rn)[rn](".rodata.eadk_app_icon").then((function(e){return t.icon=zr.fromNWI(e).toPNG()}))}},{key:"loadName",value:function(){var t=this;return Zr(this,rn)[rn](".rodata.eadk_app_name").then((function(e){return t.name=It(e)}))}},{key:"load",value:function(){this.loadIcon(),this.loadName(),this.refreshSizeAndNeedOfExternalData()}},{key:"setExternalData",value:function(t){this.externalData=t,this.refreshSizeAndNeedOfExternalData()}},{key:"flatElf",value:(i=Kr(Yr().mark((function t(e){var r,n;return Yr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r={arguments:["--script","linker.ld","--gc-sections","--allow-multiple-definition","eadk.o","app.nwa"],inputs:{"linker.ld":tn(e),"app.nwa":this.nwaData,"eadk.o":new Uint8Array(en.data)}},!this.externalData){t.next=7;break}return n="extra-data.o",r.arguments.push(n),t.next=6,Zr(this,nn)[nn]();case 6:r.inputs[n]=t.sent;case 7:return t.next=9,qr(r);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"flatBin",value:(o=Kr(Yr().mark((function t(e){return Yr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Dr,t.t1=["--output-target","binary"],t.next=4,this.flatElf(e);case 4:return t.t2=t.sent,t.t3={arguments:t.t1,input:t.t2},t.next=8,(0,t.t0)(t.t3);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"refreshSizeAndNeedOfExternalData",value:function(){var e=this;return this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144,trampolineStart:2415984688}).then((function(r){var n=r.byteLength+(t.AppSectorSize-r.byteLength%t.AppSectorSize);e.size=n,e.needsExternalData=!1})).catch((function(t){if(!t.includes("_eadk_external_data"))throw t;e.size=void 0,e.needsExternalData=!0}))}}],r&&$r(e.prototype,r),n&&$r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,o,i}();function an(t){return sn.apply(this,arguments)}function sn(){return(sn=Kr(Yr().mark((function t(e){return Yr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Dr({arguments:["--output-target","binary","--only-section",e],input:this.nwaData});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function cn(){return Dr({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_external_data,alloc,load,readonly,data,contents","--redefine-sym","_binary_input_dat_start=_eadk_external_data_start","--redefine-sym","_binary_input_dat_size=_eadk_external_data_size","--strip-symbol","_binary_input_dat_end"],input:this.externalData})}on.AppSectorSize=65536;const un=on;function ln(){ln=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function fn(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function hn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){fn(i,n,o,a,s,"next",t)}function s(t){fn(i,n,o,a,s,"throw",t)}a(void 0)}))}}function pn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return dn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function vn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mn(n.key),n)}}function yn(t,e,r){return e&&vn(t.prototype,e),r&&vn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mn(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function gn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _n(t,e,r){return e=bn(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wn()?Reflect.construct(e,r||[],bn(t).constructor):e.apply(t,r))}function wn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wn=function(){return!!t})()}function bn(t){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bn(t)}function En(t,e){return En=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},En(t,e)}var kn=function(t){function e(){gn(this,e);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _n(this,e,["CalculatorMemoryOverflow"].concat(r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&En(t,e)}(e,t),yn(e)}(l);const xn=function(){return yn((function t(){gn(this,t),this.apps=[]}),[{key:"push",value:function(t){this.apps.push(t)}},{key:"isReadyToUpload",value:function(){var t,e=pn(this.apps);try{for(e.s();!(t=e.n()).done;){if(t.value.needsExternalData)return!1}}catch(t){e.e(t)}finally{e.f()}return this.apps.length>0}},{key:"upload",value:(e=hn(ln().mark((function t(e,r){var n,o,i;return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.infos.firmware,o={flashStart:n.externalAppsFlashStart,flashLength:n.externalAppsFlashEnd-n.externalAppsFlashStart,ramStart:n.externalAppsRamStart,ramLength:n.externalAppsRamEnd-n.externalAppsRamStart,trampolineStart:n.trampolineAddress},t.next=4,this.flatBin(o);case 4:i=t.sent,e.process((function(t){return t.downloadFlash(o.flashStart,i,(function(t){r(.2*t)}),(function(t){r(.2+.8*t)})).then((function(){return e.dfu.leave(o.flashStart)}))}));case 7:case"end":return t.stop()}}),t,this)}))),function(t,r){return e.apply(this,arguments)})},{key:"concatenateU8A",value:function(t,e){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(t,0),r.set(e,t.byteLength),r}},{key:"flatBin",value:(t=hn(ln().mark((function t(e){var r,n,o,i,a,s,c,u,l,f,h;return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Uint8Array(0),n=e.flashStart+e.flashLength,o=e.flashStart,i=pn(this.apps),t.prev=4,i.s();case 6:if((a=i.n()).done){t.next=19;break}if(s=a.value,!(o>=n)){t.next=10;break}throw new kn("External app sector would be overflown");case 10:return t.next=12,s.flatBin({flashStart:o,flashLength:n-o,ramStart:e.ramStart,ramLength:e.ramLength,trampolineStart:e.trampolineStart});case 12:c=t.sent,r=this.concatenateU8A(r,c),o+=c.byteLength,(u=c.byteLength%un.AppSectorSize)>0&&(l=un.AppSectorSize-u,(f=new Uint8Array(l)).fill(255),r=this.concatenateU8A(r,f),o+=l);case 17:t.next=6;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(4),i.e(t.t0);case 24:return t.prev=24,i.f(),t.finish(24);case 27:return o<n&&((h=new Uint8Array(un.AppSectorSize)).fill(255),r=this.concatenateU8A(r,h)),t.abrupt("return",r);case 29:case"end":return t.stop()}}),t,this,[[4,21,24,27]])}))),function(e){return t.apply(this,arguments)})},{key:"totalSize",value:function(){var t,e=0,r=pn(this.apps);try{for(r.s();!(t=r.n()).done;){e+=t.value.size||0}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"removeAppAtIndex",value:function(t){this.apps.splice(t,1)}}]);var t,e}(),Sn=r.p+"eadk/eadk.h",An=require("child_process");function Pn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return On(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?On(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function On(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Fn(){Fn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:A(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};u(w,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(T([])));E&&E!==r&&n.call(E,a)&&(w=E);var k=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,o(k,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=u(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,C.prototype={constructor:C,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(F),!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 t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Cn(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Tn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Cn(i,n,o,a,s,"next",t)}function s(t){Cn(i,n,o,a,s,"throw",t)}a(void 0)}))}}var jn=r(6928),Ln=jn.dirname,Rn=(jn.resolve,r(9896)),Dn=r(6858).Command,In=r(7974);function Nn(t){var e=new Dn;function r(t){return n.apply(this,arguments)}function n(){return n=Tn(Fn().mark((function t(e){var r,n,o,i,a=arguments;return Fn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:{},n=Rn.readFileSync(e),o=new un(n),!r.externalData){t.next=8;break}i=Rn.readFileSync(r.externalData),o.setExternalData(i),t.next=12;break;case 8:return t.next=10,o.refreshSizeAndNeedOfExternalData();case 10:if(!o.needsExternalData){t.next=12;break}throw new Error("Missing external data for ".concat(e));case 12:return t.abrupt("return",o);case 13:case"end":return t.stop()}}),t)}))),n.apply(this,arguments)}function o(t){return i.apply(this,arguments)}function i(){return i=Tn(Fn().mark((function t(e){var n,o,i=arguments;return Fn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0==(o=void 0===(n=i.length>1&&void 0!==i[1]?i[1]:{}).externalData?[]:n.externalData.split(",")).length||o.length==e.length){t.next=4;break}throw new Error("".concat(o.length," external data entries were given for ").concat(e.length," app(s), ")+"use one comma-separated entry per app (e.g. a.bin,,c.bin)");case 4:return t.abrupt("return",Promise.all(e.map((function(t,e){return r(t,{externalData:o[e]})}))));case 5:case"end":return t.stop()}}),t)}))),i.apply(this,arguments)}function a(){return(a=Tn(Fn().mark((function t(e,r){var n,i,a,s,c,u,l,f;return Fn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o(e,r);case 2:n=t.sent,i=new xn,a=Pn(n);try{for(a.s();!(s=a.n()).done;)c=s.value,i.push(c)}catch(t){a.e(t)}finally{a.f()}return u=new Cr,t.next=9,u.singleConnectAndExtractInfos(!0);case 9:return l=t.sent,(f=new In.SingleBar({stopOnComplete:!0,format:"Upload [{bar}] {percentage}% | ETA: {eta}s"})).start(1,0),t.next=14,i.upload(l,(function(t){f.update(t)}));case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function s(){return(s=Tn(Fn().mark((function t(e,n,o){var i,a;return Fn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(e,o);case 2:return i=t.sent,t.next=5,i.flatElf(o);case 5:a=t.sent,Rn.writeFileSync(n,a);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function c(){return(c=Tn(Fn().mark((function t(e,n,o){var i,a;return Fn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(e,o);case 2:return i=t.sent,t.next=5,i.flatBin(o);case 5:a=t.sent,Rn.writeFileSync(n,a);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function u(){return(u=Tn(Fn().mark((function t(e,r){var n,o;return Fn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Rn.readFileSync(e),o=zr.fromPNG(n),t.t0=Rn,t.t1=r,t.next=6,o.toIconO();case 6:t.t2=t.sent,t.t0.writeFileSync.call(t.t0,t.t1,t.t2);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version(require("../package.json").version),e.command("install-nwa").description("Install one or more NWA apps, replacing the apps currently installed").argument("<input.nwa...>","Input NWA files").option("-d, --external-data <files>","Comma-separated external data files, exactly one entry per app in order (leave an entry empty for an app without data, e.g. a.bin,,c.bin or ,b.bin,)").action((function(t,e){return a.apply(this,arguments)})),e.command("nwa-elf").description("Link a NWA app").argument("<input.nwa>","Input NWA file").argument("<output.elf>","Output ELF file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").option("-ts, --trampoline-start <trampolineStart>","Trampoline start address","0x90010030").action((function(t,e,r){return s.apply(this,arguments)})),e.command("nwa-bin").description("Link a NWA app and convert to binary format").argument("<input.nwa>","Input NWA file").argument("<output.bin>","Output BIN file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").option("-ts, --trampoline-start <trampolineStart>","Trampoline start address","0x90010030").action((function(t,e,r){return c.apply(this,arguments)})),e.command("nwa-name").description("Print the name of a NWA app").argument("<input.nwa>","Input NWA file").action((function(t){new un(Rn.readFileSync(t)).loadName().then((function(t){return console.log(t)}))})),e.command("png-nwi").description("Convert a PNG file to a NWI image (LZ4-compressed RGB565)").argument("<file.png>","Input PNG file").argument("<file.nwi>","Output NWI file").action((function(t,e){var r=Rn.readFileSync(t),n=zr.fromPNG(r);Rn.writeFileSync(e,n.toNWI())})),e.command("png-icon-o").description("Convert a PNG file to an ELF icon object (NWI data in a .rodata.eadk_app_icon ELF section)").argument("<file.png>","Input PNG file").argument("<file.o>","Output ELF object file").action((function(t,e){return u.apply(this,arguments)})),e.command("eadk-cflags-device").description("Print EADK CFLAGS for the device").action((function(){var t=["-mthumb","-mfloat-abi=hard","-mcpu=cortex-m7","-mfpu=fpv5-sp-d16","-DPLATFORM_DEVICE=1",'"-I'+Ln(Sn)+'"'];console.log(t.join(" "))})),e.command("eadk-ldflags-device").description("Print EADK LDFLAGS for the device").action((function(){console.log(["-Wl,--relocatable","-nostartfiles"].join(" "))})),e.command("eadk-cflags-simulator").description("Print EADK CFLAGS for the native simulator").action((function(){var t=["-fPIC",'"-I'+Ln(Sn)+'"'];console.log(t.join(" "))})),e.command("eadk-ldflags-simulator").description("Print EADK LDFLAGS for the native simulator").action((function(){console.log(["-shared"].join(" "))})),e.command("eadk-cflags-web").description("Print EADK CFLAGS for the web simulator").action((function(){var t=["-sSIDE_MODULE=2",'"-I'+Ln(Sn)+'"'];console.log(t.join(" "))})),e.command("eadk-ldflags-web").description("Print EADK LDFLAGS for the web simulator").action((function(){console.log(["-sSIDE_MODULE=2","-sEXPORTED_FUNCTIONS=_main","-sASYNCIFY=1","-sASYNCIFY_IMPORTS=eadk_event_get,eadk_keyboard_scan_do_scan,eadk_timing_msleep,eadk_display_wait_for_vblank"].join(" "))})),e.command("view-eadk-h").description("Open eadk.h in $VISUAL or $EDITOR").action((function(){var t=process.env.VISUAL||process.env.EDITOR;t?(0,An.execSync)("".concat(t," ").concat(Sn),{stdio:"inherit"}):console.error("Please define $VISUAL or $EDITOR")})),e.parseAsync(t).catch((function(t){console.error(t.message||t),process.exit(1)}))}Object.defineProperty(global,"navigator",{get:function(){return{usb:t.webusb}}})})(),module.exports=n.default})();
|