@zappar/zappar-cv 0.4.0-beta.4 → 0.4.0-beta.7
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/CHANGELOG.md +79 -34
- package/README.md +2 -2
- package/lib/camera-source-map.d.ts +10 -0
- package/lib/camera-source-map.js +40 -0
- package/lib/camera-source.d.ts +2 -5
- package/lib/camera-source.js +3 -13
- package/lib/compatibility.js +1 -1
- package/lib/drawcamera.js +2 -1
- package/lib/gen/zappar-client.js +6 -1
- package/lib/gen/zappar-cwrap.js +37 -21
- package/lib/gen/zappar-native.d.ts +11 -0
- package/lib/gen/zappar-native.js +13 -1
- package/lib/gen/zappar-server.js +1 -1
- package/lib/gen/zappar.d.ts +5 -0
- package/lib/gen/zappar.js +5 -3
- package/lib/gfx.d.ts +1 -0
- package/lib/gfx.js +4 -0
- package/lib/html-element-source.d.ts +3 -20
- package/lib/html-element-source.js +19 -263
- package/lib/image-process-gl.d.ts +37 -0
- package/lib/image-process-gl.js +265 -0
- package/lib/imagebitmap-camera-source.d.ts +36 -0
- package/lib/imagebitmap-camera-source.js +277 -0
- package/lib/mstp-camera-source.d.ts +29 -0
- package/lib/mstp-camera-source.js +230 -0
- package/lib/native.js +45 -8
- package/lib/pipeline.d.ts +13 -3
- package/lib/pipeline.js +95 -26
- package/lib/profile.d.ts +2 -0
- package/lib/profile.js +55 -44
- package/lib/sequencerecorder.d.ts +1 -0
- package/lib/sequencerecorder.js +11 -0
- package/lib/sequencesource.d.ts +7 -1
- package/lib/sequencesource.js +89 -47
- package/lib/source.d.ts +6 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/worker-client.js +0 -5
- package/lib/worker-imagebitmap.d.ts +5 -0
- package/lib/worker-imagebitmap.js +63 -0
- package/lib/worker-server.d.ts +0 -5
- package/lib/worker-server.js +120 -24
- package/lib/workerinterface.d.ts +47 -1
- package/lib/zcv.js +26 -26
- package/lib/zcv.wasm +0 -0
- package/package.json +34 -31
- package/umd/{d115e485cffe500afc4f7c1272ea8f62.wasm → 9d9c4b542b40c41e3ef7587fb91e5d38.wasm} +0 -0
- package/umd/zappar-cv.js +1 -9
- package/umd/zappar-cv.worker.js +1 -1
- package/lib/bundleworker-mainthread.d.ts +0 -2
- package/lib/bundleworker-mainthread.js +0 -36
- package/lib/bundleworker-worker.d.ts +0 -6
- package/lib/bundleworker-worker.js +0 -34
- package/lib/zcv-slam.js +0 -16
- package/lib/zcv-slam.wasm +0 -0
- package/umd/1ec038c18c27f4adf35917a8175401f0.wasm +0 -0
- package/umd/9c0b0dcf514b48c05541.bundleworker.js +0 -1
package/umd/zappar-cv.worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(2),n=self;a.messageManager.onOutgoingMessage.bind(()=>{let e=a.messageManager.getOutgoingMessages();for(let t of e)n.postMessage(t.msg,t.transferables)});let i=e=>{if(e&&e.data&&"wasm"===e.data.t){let t=location.href.startsWith("blob")?e.data.url:r(13);t.default&&(t=t.default),a.launchWorkerServer(t),n.removeEventListener("message",i)}};n.addEventListener("message",i),n.addEventListener("message",e=>{a.messageManager.postIncomingMessage(e.data)})},function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))((function(n,i){function s(e){try{o(a.next(e))}catch(e){i(e)}}function _(e){try{o(a.throw(e))}catch(e){i(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,_)}o((a=a.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.launchWorkerServer=t.messageManager=void 0;const n=r(3),i=r(7),s=r(8),_=r(11);let o;t.messageManager=new _.MsgManager,self.addEventListener("message",e=>{e&&e.data&&"port"===e.data.t&&(o=e.data.port)}),self.bundle_adjust_message=function(e){var t=new ArrayBuffer(e.byteLength);new Uint8Array(t).set(new Uint8Array(e)),null==o||o.postMessage({t:"bundle_adjust_message",buf:t},[t])},t.launchWorkerServer=function(e){return a(this,void 0,void 0,(function*(){let r=n.default({locateFile:(t,r)=>t.endsWith("zcv.wasm")?e:r+t,onRuntimeInitialized:()=>{let e=i.getRuntimeObject(r),a=new s.zappar_server(e,(e,r)=>{t.messageManager.postOutgoingMessage({p:e,t:"zappar",d:r},[r])});t.messageManager.postOutgoingMessage("loaded",[]),o.onmessage=function(e){var t=e.data.buf,a=r._malloc(t.byteLength);r.HEAPU8.set(new Uint8Array(t),a),r._bundle_adjust_message_callback(a,e.data.buf.byteLength,0),r._free(a)},t.messageManager.onIncomingMessage.bind(r=>{var n;switch(r.t){case"zappar":a.processBuffer(r.d),t.messageManager.postOutgoingMessage({t:"buf",d:r.d},[r.d]);break;case"buf":null===(n=a.serializersByPipelineId.get(r.p))||void 0===n||n.bufferReturn(r.d);break;case"cameraFrameC2S":let i,s=r,_=a._pipeline_by_instance.get(s.p);_&&(e.pipeline_camera_frame_submit(_,s.d,s.width,s.height,s.token,s.c2d,s.cm,s.userFacing),e.pipeline_frame_update(_),i=e.pipeline_camera_frame_device_attitude(_),a.exploreState());let o={token:s.token,d:s.d,p:s.p,t:"cameraFrameRecycleS2C",att:i};t.messageManager.postOutgoingMessage(o,[s.d])}})}})}))}},function(e,t,r){"use strict";r.r(t),function(e){var r,a=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var a,n,i;t=t||{},a||(a=void 0!==t?t:{}),a.ready=new Promise((function(e,t){n=e,i=t}));var s,_={};for(s in a)a.hasOwnProperty(s)&&(_[s]=a[s]);var o="./this.program";function c(e,t){throw t}var u,f="";f=self.location.href,r&&(f=r),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",u=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)};var p,l,d,m=a.print||console.log.bind(console),h=a.printErr||console.warn.bind(console);for(s in _)_.hasOwnProperty(s)&&(a[s]=_[s]);_=null,a.thisProgram&&(o=a.thisProgram),a.quit&&(c=a.quit),a.wasmBinary&&(l=a.wasmBinary),a.noExitRuntime&&(d=a.noExitRuntime),"object"!=typeof WebAssembly&&J("no native wasm support detected");var b,g=!1;function y(e,t){e||J("Assertion failed: "+t)}function w(e){var t=a["_"+e];return y(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function v(e,t,r,a){var n,i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=wr(r),D(e,M,t,r)}return t},array:function(e){var t=wr(e.length);return k.set(e,t),t}},s=w(e),_=[];if(e=0,a)for(var o=0;o<a.length;o++){var c=i[r[o]];c?(0===e&&(e=gr()),_[o]=c(a[o])):_[o]=a[o]}return r=s.apply(null,_),n=r,r="string"===t?T(n):"boolean"===t?!!n:n,0!==e&&yr(e),r}var z,k,M,A,x,O,E,P,L,F="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function S(e,t,r){var a=t+r;for(r=t;e[r]&&!(r>=a);)++r;if(16<r-t&&e.subarray&&F)return F.decode(e.subarray(t,r));for(a="";t<r;){var n=e[t++];if(128&n){var i=63&e[t++];if(192==(224&n))a+=String.fromCharCode((31&n)<<6|i);else{var s=63&e[t++];65536>(n=224==(240&n)?(15&n)<<12|i<<6|s:(7&n)<<18|i<<12|s<<6|63&e[t++])?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296|n>>10,56320|1023&n))}}else a+=String.fromCharCode(n)}return a}function T(e,t){return e?S(M,e,t):""}function D(e,t,r,a){if(!(0<a))return 0;var n=r;a=r+a-1;for(var i=0;i<e.length;++i){var s=e.charCodeAt(i);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),127>=s){if(r>=a)break;t[r++]=s}else{if(2047>=s){if(r+1>=a)break;t[r++]=192|s>>6}else{if(65535>=s){if(r+2>=a)break;t[r++]=224|s>>12}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63}t[r++]=128|s>>6&63}t[r++]=128|63&s}}return t[r]=0,r-n}function I(e){for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++r)),127>=a?++t:t=2047>=a?t+2:65535>=a?t+3:t+4}return t}function j(e){var t=I(e)+1,r=pr(t);return r&&D(e,k,r,t),r}function V(e,t){for(var r=0;r<e.length;++r)k[t++>>0]=e.charCodeAt(r);k[t>>0]=0}function B(){var e=b.buffer;z=e,a.HEAP8=k=new Int8Array(e),a.HEAP16=A=new Int16Array(e),a.HEAP32=O=new Int32Array(e),a.HEAPU8=M=new Uint8Array(e),a.HEAPU16=x=new Uint16Array(e),a.HEAPU32=E=new Uint32Array(e),a.HEAPF32=P=new Float32Array(e),a.HEAPF64=L=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var R,C=[],U=[],q=[],Z=[];function H(){var e=a.preRun.shift();C.unshift(e)}var W=0,N=null,Y=null;function K(){W++,a.monitorRunDependencies&&a.monitorRunDependencies(W)}function G(){if(W--,a.monitorRunDependencies&&a.monitorRunDependencies(W),0==W&&(null!==N&&(clearInterval(N),N=null),Y)){var e=Y;Y=null,e()}}function J(e){throw a.onAbort&&a.onAbort(e),h(e),g=!0,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),i(e),e}a.preloadedImages={},a.preloadedAudios={};var X="zcv.wasm";if(String.prototype.startsWith?!X.startsWith("data:application/octet-stream;base64,"):0!==X.indexOf("data:application/octet-stream;base64,")){var $=X;X=a.locateFile?a.locateFile($,f):f+$}var Q,ee,te,re={26527:function(){if(self.crypto&&self.crypto.getRandomValues){var e=new Uint32Array(1);return self.crypto.getRandomValues(e),e[0]}return 9007199254740991*Math.random()},301617:function(e,t){self.bundle_adjust_message_callback(M.subarray(e,e+t,0))},301697:function(e,t){self.bundle_adjust_message(M.subarray(e,e+t,0))}};function ae(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t(a);else{var r=t.da;"number"==typeof r?void 0===t.L?R.get(r)():R.get(r)(t.L):r(void 0===t.L?null:t.L)}}}function ne(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return O[lr()>>2]=28,-1;e=te()}return O[t>>2]=e/1e3|0,O[t+4>>2]=e%1e3*1e6|0,0}function ie(e){this.D=e-16,this.Ia=function(e){O[this.D+8>>2]=e},this.Fa=function(e){O[this.D+0>>2]=e},this.Ga=function(){O[this.D+4>>2]=0},this.Ea=function(){k[this.D+12>>0]=0},this.Ha=function(){k[this.D+13>>0]=0},this.ua=function(e,t){this.Ia(e),this.Fa(t),this.Ga(),this.Ea(),this.Ha()}}function se(e,t){for(var r=0,a=e.length-1;0<=a;a--){var n=e[a];"."===n?e.splice(a,1):".."===n?(e.splice(a,1),r++):r&&(e.splice(a,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function _e(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=se(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function oe(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function ce(e){if("/"===e)return"/";var t=(e=(e=_e(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function ue(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=se(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}te=function(){return performance.now()};var fe=[];function pe(e,t){fe[e]={input:[],j:[],C:t},Be(e,le)}var le={open:function(e){var t=fe[e.node.I];if(!t)throw new Me(43);e.h=t,e.seekable=!1},close:function(e){e.h.C.flush(e.h)},flush:function(e){e.h.C.flush(e.h)},read:function(e,t,r,a){if(!e.h||!e.h.C.ea)throw new Me(60);for(var n=0,i=0;i<a;i++){try{var s=e.h.C.ea(e.h)}catch(e){throw new Me(29)}if(void 0===s&&0===n)throw new Me(6);if(null==s)break;n++,t[r+i]=s}return n&&(e.node.timestamp=Date.now()),n},write:function(e,t,r,a){if(!e.h||!e.h.C.Y)throw new Me(60);try{for(var n=0;n<a;n++)e.h.C.Y(e.h,t[r+n])}catch(e){throw new Me(29)}return a&&(e.node.timestamp=Date.now()),n}},de={ea:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=_r(t,!0)}return e.input.shift()},Y:function(e,t){null===t||10===t?(m(S(e.j,0)),e.j=[]):0!=t&&e.j.push(t)},flush:function(e){e.j&&0<e.j.length&&(m(S(e.j,0)),e.j=[])}},me={Y:function(e,t){null===t||10===t?(h(S(e.j,0)),e.j=[]):0!=t&&e.j.push(t)},flush:function(e){e.j&&0<e.j.length&&(h(S(e.j,0)),e.j=[])}},he={o:null,u:function(){return he.createNode(null,"/",16895,0)},createNode:function(e,t,r,a){if(24576==(61440&r)||4096==(61440&r))throw new Me(63);return he.o||(he.o={dir:{node:{m:he.c.m,s:he.c.s,G:he.c.G,M:he.c.M,ka:he.c.ka,S:he.c.S,la:he.c.la,ja:he.c.ja,N:he.c.N},stream:{A:he.f.A}},file:{node:{m:he.c.m,s:he.c.s},stream:{A:he.f.A,read:he.f.read,write:he.f.write,$:he.f.$,fa:he.f.fa,ha:he.f.ha}},link:{node:{m:he.c.m,s:he.c.s,J:he.c.J},stream:{}},aa:{node:{m:he.c.m,s:he.c.s},stream:Ve}}),16384==(61440&(r=Le(e,t,r,a)).mode)?(r.c=he.o.dir.node,r.f=he.o.dir.stream,r.b={}):32768==(61440&r.mode)?(r.c=he.o.file.node,r.f=he.o.file.stream,r.g=0,r.b=null):40960==(61440&r.mode)?(r.c=he.o.link.node,r.f=he.o.link.stream):8192==(61440&r.mode)&&(r.c=he.o.aa.node,r.f=he.o.aa.stream),r.timestamp=Date.now(),e&&(e.b[t]=r),r},Va:function(e){if(e.b&&e.b.subarray){for(var t=[],r=0;r<e.g;++r)t.push(e.b[r]);return t}return e.b},Wa:function(e){return e.b?e.b.subarray?e.b.subarray(0,e.g):new Uint8Array(e.b):new Uint8Array(0)},ba:function(e,t){var r=e.b?e.b.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.b,e.b=new Uint8Array(t),0<e.g&&e.b.set(r.subarray(0,e.g),0))},Ca:function(e,t){if(e.g!=t)if(0==t)e.b=null,e.g=0;else{if(!e.b||e.b.subarray){var r=e.b;e.b=new Uint8Array(t),r&&e.b.set(r.subarray(0,Math.min(t,e.g)))}else if(e.b||(e.b=[]),e.b.length>t)e.b.length=t;else for(;e.b.length<t;)e.b.push(0);e.g=t}},c:{m:function(e){var t={};return t.qa=8192==(61440&e.mode)?e.id:1,t.X=e.id,t.mode=e.mode,t.Aa=1,t.uid=0,t.sa=0,t.I=e.I,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.g:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.ma=new Date(e.timestamp),t.za=new Date(e.timestamp),t.pa=new Date(e.timestamp),t.na=4096,t.oa=Math.ceil(t.size/t.na),t},s:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&he.Ca(e,t.size)},G:function(){throw Ae[44]},M:function(e,t,r,a){return he.createNode(e,t,r,a)},ka:function(e,t,r){if(16384==(61440&e.mode)){try{var a=Pe(t,r)}catch(e){}if(a)for(var n in a.b)throw new Me(55)}delete e.parent.b[e.name],e.name=r,t.b[r]=e,e.parent=t},S:function(e,t){delete e.b[t]},la:function(e,t){var r,a=Pe(e,t);for(r in a.b)throw new Me(55);delete e.b[t]},ja:function(e){var t,r=[".",".."];for(t in e.b)e.b.hasOwnProperty(t)&&r.push(t);return r},N:function(e,t,r){return(e=he.createNode(e,t,41471,0)).link=r,e},J:function(e){if(40960!=(61440&e.mode))throw new Me(28);return e.link}},f:{read:function(e,t,r,a,n){var i=e.node.b;if(n>=e.node.g)return 0;if(8<(e=Math.min(e.node.g-n,a))&&i.subarray)t.set(i.subarray(n,n+e),r);else for(a=0;a<e;a++)t[r+a]=i[n+a];return e},write:function(e,t,r,a,n,i){if(t.buffer===k.buffer&&(i=!1),!a)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.b||e.b.subarray)){if(i)return e.b=t.subarray(r,r+a),e.g=a;if(0===e.g&&0===n)return e.b=t.slice(r,r+a),e.g=a;if(n+a<=e.g)return e.b.set(t.subarray(r,r+a),n),a}if(he.ba(e,n+a),e.b.subarray&&t.subarray)e.b.set(t.subarray(r,r+a),n);else for(i=0;i<a;i++)e.b[n+i]=t[r+i];return e.g=Math.max(e.g,n+a),a},A:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.g),0>t)throw new Me(28);return t},$:function(e,t,r){he.ba(e.node,t+r),e.node.g=Math.max(e.node.g,t+r)},fa:function(e,t,r,a,n,i){if(y(0===t),32768!=(61440&e.node.mode))throw new Me(43);if(e=e.node.b,2&i||e.buffer!==z){for((0<a||a+r<e.length)&&(e=e.subarray?e.subarray(a,a+r):Array.prototype.slice.call(e,a,a+r)),a=!0,i=16384*Math.ceil(r/16384),t=pr(i);r<i;)k[t+r++]=0;if(!(r=t))throw new Me(48);k.set(e,r)}else a=!1,r=e.byteOffset;return{D:r,Qa:a}},ha:function(e,t,r,a,n){if(32768!=(61440&e.node.mode))throw new Me(43);return 2&n||he.f.write(e,t,0,a,r,!1),0}}},be=null,ge={},ye=[],we=1,ve=null,ze=!0,ke={},Me=null,Ae={};function xe(e,t){if(t=t||{},!(e=ue("/",e)))return{path:"",node:null};var r,a={ca:!0,Z:0};for(r in a)void 0===t[r]&&(t[r]=a[r]);if(8<t.Z)throw new Me(32);e=se(e.split("/").filter((function(e){return!!e})),!1);var n=be;for(a="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(n=Pe(n,e[r]),a=_e(a+"/"+e[r]),n.H&&(!i||i&&t.ca)&&(n=n.H.root),!i||t.V)for(i=0;40960==(61440&n.mode);)if(n=He(a),n=xe(a=ue(oe(a),n),{Z:t.Z}).node,40<i++)throw new Me(32)}return{path:a,node:n}}function Oe(e){for(var t;;){if(e===e.parent)return e=e.u.ga,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Ee(e,t){for(var r=0,a=0;a<t.length;a++)r=(r<<5)-r+t.charCodeAt(a)|0;return(e+r>>>0)%ve.length}function Pe(e,t){var r;if(r=(r=Te(e,"x"))?r:e.c.G?0:2)throw new Me(r,e);for(r=ve[Ee(e.id,t)];r;r=r.B){var a=r.name;if(r.parent.id===e.id&&a===t)return r}return e.c.G(e,t)}function Le(e,t,r,a){return t=Ee((e=new sr(e,t,r,a)).parent.id,e.name),e.B=ve[t],ve[t]=e}var Fe={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Se(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Te(e,t){return ze||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2}function De(e,t){try{return Pe(e,t),20}catch(e){}return Te(e,"wx")}function Ie(e,t){$e||(($e=function(){}).prototype={});var r,a=new $e;for(r in e)a[r]=e[r];return e=a,t=function(e){for(e=e||0;e<=4096;e++)if(!ye[e])return e;throw new Me(33)}(t),e.v=t,ye[t]=e}var je,Ve={open:function(e){e.f=ge[e.node.I].f,e.f.open&&e.f.open(e)},A:function(){throw new Me(70)}};function Be(e,t){ge[e]={f:t}}function Re(e,t){var r="/"===t,a=!t;if(r&&be)throw new Me(10);if(!r&&!a){var n=xe(t,{ca:!1});if(t=n.path,(n=n.node).H)throw new Me(10);if(16384!=(61440&n.mode))throw new Me(54)}t={type:e,$a:{},ga:t,ya:[]},(e=e.u(t)).u=t,t.root=e,r?be=e:n&&(n.H=t,n.u&&n.u.ya.push(t))}function Ce(e,t,r){var a=xe(e,{parent:!0}).node;if(!(e=ce(e))||"."===e||".."===e)throw new Me(28);var n=De(a,e);if(n)throw new Me(n);if(!a.c.M)throw new Me(63);return a.c.M(a,e,t,r)}function Ue(e){Ce(e,16895,0)}function qe(e,t,r){void 0===r&&(r=t,t=438),Ce(e,8192|t,r)}function Ze(e,t){if(!ue(e))throw new Me(44);var r=xe(t,{parent:!0}).node;if(!r)throw new Me(44);var a=De(r,t=ce(t));if(a)throw new Me(a);if(!r.c.N)throw new Me(63);r.c.N(r,t,e)}function He(e){if(!(e=xe(e).node))throw new Me(44);if(!e.c.J)throw new Me(28);return ue(Oe(e.parent),e.c.J(e))}function We(e,t){if(!(e=xe(e,{V:!t}).node))throw new Me(44);if(!e.c.m)throw new Me(63);return e.c.m(e)}function Ne(e){return We(e,!0)}function Ye(e,t,r,n){if(""===e)throw new Me(44);if("string"==typeof t){var i=Fe[t];if(void 0===i)throw Error("Unknown file open mode: "+t);t=i}if(r=64&t?4095&(void 0===r?438:r)|32768:0,"object"==typeof e)var s=e;else{e=_e(e);try{s=xe(e,{V:!(131072&t)}).node}catch(e){}}if(i=!1,64&t)if(s){if(128&t)throw new Me(20)}else s=Ce(e,r,0),i=!0;if(!s)throw new Me(44);if(8192==(61440&s.mode)&&(t&=-513),65536&t&&16384!=(61440&s.mode))throw new Me(54);if(!i&&(r=s?40960==(61440&s.mode)?32:16384==(61440&s.mode)&&("r"!==Se(t)||512&t)?31:Te(s,Se(t)):44))throw new Me(r);if(512&t){var _;if(!(_="string"==typeof(r=s)?xe(r,{V:!0}).node:r).c.s)throw new Me(63);if(16384==(61440&_.mode))throw new Me(31);if(32768!=(61440&_.mode))throw new Me(28);if(r=Te(_,"w"))throw new Me(r);_.c.s(_,{size:0,timestamp:Date.now()})}t&=-131713,(n=Ie({node:s,path:Oe(s),flags:t,seekable:!0,position:0,f:s.f,Na:[],error:!1},n)).f.open&&n.f.open(n),!a.logReadFiles||1&t||(Qe||(Qe={}),e in Qe||(Qe[e]=1,h("FS.trackingDelegate error on read file: "+e)));try{ke.onOpenFile&&(s=0,1!=(2097155&t)&&(s|=1),0!=(2097155&t)&&(s|=2),ke.onOpenFile(e,s))}catch(t){h("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return n}function Ke(e,t,r){if(null===e.v)throw new Me(8);if(!e.seekable||!e.f.A)throw new Me(70);if(0!=r&&1!=r&&2!=r)throw new Me(28);e.position=e.f.A(e,t,r),e.Na=[]}function Ge(){Me||((Me=function(e,t){this.node=t,this.Da=function(e){this.i=e},this.Da(e),this.message="FS error"}).prototype=Error(),Me.prototype.constructor=Me,[44].forEach((function(e){Ae[e]=new Me(e),Ae[e].stack="<generic error, no stack>"})))}function Je(e,t,r){e=_e("/dev/"+e);var a=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);Xe||(Xe=64);var n=Xe++<<8|0;Be(n,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,r,a,n){for(var i=0,s=0;s<n;s++){try{var _=t()}catch(e){throw new Me(29)}if(void 0===_&&0===i)throw new Me(6);if(null==_)break;i++,r[a+s]=_}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,a,n){for(var i=0;i<n;i++)try{r(t[a+i])}catch(e){throw new Me(29)}return n&&(e.node.timestamp=Date.now()),i}}),qe(e,a,n)}var Xe,$e,Qe,et={};function tt(e,t,r){try{var a=e(t)}catch(e){if(e&&e.node&&_e(t)!==_e(Oe(e.node)))return-54;throw e}return O[r>>2]=a.qa,O[r+4>>2]=0,O[r+8>>2]=a.X,O[r+12>>2]=a.mode,O[r+16>>2]=a.Aa,O[r+20>>2]=a.uid,O[r+24>>2]=a.sa,O[r+28>>2]=a.I,O[r+32>>2]=0,ee=[a.size>>>0,(Q=a.size,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],O[r+40>>2]=ee[0],O[r+44>>2]=ee[1],O[r+48>>2]=4096,O[r+52>>2]=a.oa,O[r+56>>2]=a.ma.getTime()/1e3|0,O[r+60>>2]=0,O[r+64>>2]=a.za.getTime()/1e3|0,O[r+68>>2]=0,O[r+72>>2]=a.pa.getTime()/1e3|0,O[r+76>>2]=0,ee=[a.X>>>0,(Q=a.X,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],O[r+80>>2]=ee[0],O[r+84>>2]=ee[1],0}var rt=void 0;function at(){return O[(rt+=4)-4>>2]}function nt(e){if(!(e=ye[e]))throw new Me(8);return e}var it,st,_t,ot=null,ct=0,ut=null,ft=0,pt=0,lt=0,dt=[],mt={},ht=!1,bt=!1,gt=[];function yt(){function e(){bt=document.pointerLockElement===a.canvas||document.mozPointerLockElement===a.canvas||document.webkitPointerLockElement===a.canvas||document.msPointerLockElement===a.canvas}if(a.preloadPlugins||(a.preloadPlugins=[]),!Pt){Pt=!0;try{Lt=!0}catch(e){Lt=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Ft="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Lt?null:console.log("warning: no BlobBuilder"),St="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,a.ia||void 0!==St||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),a.ia=!0),a.preloadPlugins.push({canHandle:function(e){return!a.ia&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var i=null;if(Lt)try{(i=new Blob([e],{type:Et(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Et(t)}))}catch(e){!function(e){p||(p={}),p[e]||(p[e]=1,h(e))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}i||((i=new Ft).append(new Uint8Array(e).buffer),i=i.getBlob());var s=St.createObjectURL(i),_=new Image;_.onload=function(){y(_.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=_.width,n.height=_.height,n.getContext("2d").drawImage(_,0,0),a.preloadedImages[t]=n,St.revokeObjectURL(s),r&&r(e)},_.onerror=function(){console.log("Image "+s+" could not be decoded"),n&&n()},_.src=s}}),a.preloadPlugins.push({canHandle:function(e){return!a.Za&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){function i(n){_||(_=!0,a.preloadedAudios[t]=n,r&&r(e))}function s(){_||(_=!0,a.preloadedAudios[t]=new Audio,n&&n())}var _=!1;if(!Lt)return s();try{var o=new Blob([e],{type:Et(t)})}catch(e){return s()}o=St.createObjectURL(o);var c=new Audio;c.addEventListener("canplaythrough",(function(){i(c)}),!1),c.onerror=function(){if(!_){console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach");for(var r="",a=0,n=0,s=0;s<e.length;s++)for(a=a<<8|e[s],n+=8;6<=n;){var o=a>>n-6&63;n-=6,r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[o]}2==n?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&a)<<4],r+="=="):4==n&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&a)<<2],r+="="),c.src="data:audio/x-"+t.substr(-3)+";base64,"+r,i(c)}},c.src=o,Ot((function(){i(c)}),1e4)}});var t=a.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||function(){},t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),a.elementPointerLock&&t.addEventListener("click",(function(e){!bt&&a.canvas.requestPointerLock&&(a.canvas.requestPointerLock(),e.preventDefault())}),!1))}}function wt(e,t,r,n){if(t&&a.U&&e==a.canvas)return a.U;var i;if(t){var s={antialias:!1,alpha:!1,xa:1};if(n)for(var _ in n)s[_]=n[_];if(void 0!==$t&&(i=function(e,t){if(e=e.getContext("webgl",t)){var r=Kt(Yt),a={Xa:r,attributes:t,version:t.xa,T:e};e.canvas&&(e.canvas.Pa=a),Yt[r]=a,(void 0===t.ra||t.ra)&&function(e){if(e||(e=Jt),!e.va){e.va=!0;var t=e.T;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,a,n){t.drawArraysInstancedANGLE(e,r,a,n)},e.drawElementsInstanced=function(e,r,a,n,i){t.drawElementsInstancedANGLE(e,r,a,n,i)})}(t),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(t),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})}(t),t.Ta=t.getExtension("EXT_disjoint_timer_query"),t.Ya=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){0>e.indexOf("lose_context")&&0>e.indexOf("debug")&&t.getExtension(e)}))}}(a),t=r}else t=0;return t}(e,s)))var o=Yt[i].T}else o=e.getContext("2d");return o?(r&&(t||y(void 0===nr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),a.U=o,t&&(Jt=Yt[i],a.U=nr=Jt&&Jt.T),a.bb=t,gt.forEach((function(e){e()})),yt()),o):null}var vt=!1,zt=void 0,kt=void 0;function Mt(){return!!ht&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var At=0;function xt(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===At)At=t+1e3/60;else for(;t+2>=At;)At+=1e3/60;setTimeout(e,Math.max(At-t,0))}}function Ot(e,t){d=!0,setTimeout((function(){g||e()}),t)}function Et(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}var Pt,Lt,Ft,St,Tt=[];function Dt(){var e=a.canvas;Tt.forEach((function(t){t(e.width,e.height)}))}function It(e,t,r){t&&r?(e.Oa=t,e.ta=r):(t=e.Oa,r=e.ta);var n=t,i=r;if(a.forcedAspectRatio&&0<a.forcedAspectRatio&&(n/i<a.forcedAspectRatio?n=Math.round(i*a.forcedAspectRatio):i=Math.round(n/a.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var s=Math.min(screen.width/n,screen.height/i);n=Math.round(n*s),i=Math.round(i*s)}kt?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||i!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}function jt(){return!1}a._emscripten_is_main_browser_thread=jt;var Vt,Bt=[];function Rt(e,t){E[e>>2]=t,E[e+4>>2]=t/4294967296|0}function Ct(e,t,r,a,n){function i(t){var r=0,a=0;t&&(a=w.response?w.response.byteLength:0,r=pr(a),M.set(new Uint8Array(w.response),r)),E[e+12>>2]=r,Rt(e+16,a)}var s=E[e+8>>2];if(s){var _=T(s),o=e+112,c=T(o);c||(c="GET");var u=E[o+52>>2],f=E[o+56>>2],p=!!E[o+60>>2],l=E[o+68>>2],d=E[o+72>>2];s=E[o+76>>2];var m=E[o+80>>2],h=E[o+84>>2];o=E[o+88>>2];var b=!!(1&u),g=!!(2&u);u=!!(64&u),l=l?T(l):void 0,d=d?T(d):void 0;var y=m?T(m):void 0,w=new XMLHttpRequest;if(w.withCredentials=p,w.open(c,_,!u,l,d),u||(w.timeout=f),w.Ra=_,w.responseType="arraybuffer",m&&w.overrideMimeType(y),s)for(;(c=E[s>>2])&&(_=E[s+4>>2]);)s+=8,c=T(c),_=T(_),w.setRequestHeader(c,_);Bt.push(w),E[e+0>>2]=Bt.length,s=h&&o?M.slice(h,h+o):null,w.onload=function(a){i(b&&!g);var n=w.response?w.response.byteLength:0;Rt(e+24,0),n&&Rt(e+32,n),x[e+40>>1]=w.readyState,x[e+42>>1]=w.status,w.statusText&&D(w.statusText,M,e+44,64),200<=w.status&&300>w.status?t&&t(e,w,a):r&&r(e,w,a)},w.onerror=function(t){i(b);var a=w.status;Rt(e+24,0),Rt(e+32,w.response?w.response.byteLength:0),x[e+40>>1]=w.readyState,x[e+42>>1]=a,r&&r(e,w,t)},w.ontimeout=function(t){r&&r(e,w,t)},w.onprogress=function(t){var r=b&&g&&w.response?w.response.byteLength:0,n=0;b&&g&&(n=pr(r),M.set(new Uint8Array(w.response),n)),E[e+12>>2]=n,Rt(e+16,r),Rt(e+24,t.loaded-r),Rt(e+32,t.total),x[e+40>>1]=w.readyState,3<=w.readyState&&0===w.status&&0<t.loaded&&(w.status=200),x[e+42>>1]=w.status,w.statusText&&D(w.statusText,M,e+44,64),a&&a(e,w,t),n&&fr(n)},w.onreadystatechange=function(t){x[e+40>>1]=w.readyState,2<=w.readyState&&(x[e+42>>1]=w.status),n&&n(e,w,t)};try{w.send(s)}catch(t){r&&r(e,w,t)}}else r(e,0,"no url specified!")}function Ut(e,t,r,a){var n=Vt;if(n){var i=E[e+112+64>>2];i||(i=E[e+8>>2]);var s=T(i);try{var _=n.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,s);_.onsuccess=function(){x[e+40>>1]=4,x[e+42>>1]=200,D("OK",M,e+44,64),r(e,0,s)},_.onerror=function(t){x[e+40>>1]=4,x[e+42>>1]=413,D("Payload Too Large",M,e+44,64),a(e,0,t)}}catch(t){a(e,0,t)}}else a(e,0,"IndexedDB not available!")}var qt,Zt={};function Ht(){if(!qt){var e,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",_:o||"./this.program"};for(e in Zt)t[e]=Zt[e];var r=[];for(e in t)r.push(e+"="+t[e]);qt=r}return qt}var Wt=1,Nt=[],Yt=[];function Kt(e){for(var t=Wt++,r=e.length;r<t;r++)e[r]=null;return t}var Gt,Jt,Xt,$t={};function Qt(e){return 0==e%4&&(0!=e%100||0==e%400)}function er(e,t){for(var r=0,a=0;a<=t;r+=e[a++]);return r}var tr=[31,29,31,30,31,30,31,31,30,31,30,31],rr=[31,28,31,30,31,30,31,31,30,31,30,31];function ar(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),a=(Qt(e.getFullYear())?tr:rr)[r];if(!(t>a-e.getDate())){e.setDate(e.getDate()+t);break}t-=a-e.getDate()+1,e.setDate(1),11>r?e.setMonth(r+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}var nr,ir=[];function sr(e,t,r,a){e||(e=this),this.parent=e,this.u=e.u,this.H=null,this.id=we++,this.name=t,this.mode=r,this.c={},this.f={},this.I=a}function _r(e,t){var r=Array(I(e)+1);return e=D(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(sr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),Ge(),ve=Array(4096),Re(he,"/"),Ue("/tmp"),Ue("/home"),Ue("/home/web_user"),function(){Ue("/dev"),Be(259,{read:function(){return 0},write:function(e,t,r,a){return a}}),qe("/dev/null",259),pe(1280,de),pe(1536,me),qe("/dev/tty",1280),qe("/dev/tty1",1536);var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){J("randomDevice")}}();Je("random",e),Je("urandom",e),Ue("/dev/shm"),Ue("/dev/shm/tmp")}(),Ue("/proc"),Ue("/proc/self"),Ue("/proc/self/fd"),Re({u:function(){var e=Le("/proc/self","fd",16895,73);return e.c={G:function(e,t){var r=ye[+t];if(!r)throw new Me(8);return(e={parent:null,u:{ga:"fake"},c:{J:function(){return r.path}}}).parent=e}},e}},"/proc/self/fd"),a.requestFullscreen=function(e,t){!function(e,t){function r(){ht=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=Mt,zt&&n.requestPointerLock(),ht=!0,kt?("undefined"!=typeof SDL&&(O[SDL.screen>>2]=8388608|E[SDL.screen>>2]),It(a.canvas),Dt()):It(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),kt?("undefined"!=typeof SDL&&(O[SDL.screen>>2]=-8388609&E[SDL.screen>>2]),It(a.canvas),Dt()):It(n)),a.onFullScreen&&a.onFullScreen(ht),a.onFullscreen&&a.onFullscreen(ht)}void 0===(zt=e)&&(zt=!0),void 0===(kt=t)&&(kt=!1);var n=a.canvas;vt||(vt=!0,document.addEventListener("fullscreenchange",r,!1),document.addEventListener("mozfullscreenchange",r,!1),document.addEventListener("webkitfullscreenchange",r,!1),document.addEventListener("MSFullscreenChange",r,!1));var i=document.createElement("div");n.parentNode.insertBefore(i,n),i.appendChild(n),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()}(e,t)},a.requestAnimationFrame=function(e){xt(e)},a.setCanvasSize=function(e,t,r){It(a.canvas,e,t),r||Dt()},a.pauseMainLoop=function(){ot=null,ct++},a.resumeMainLoop=function(){ct++;var t=ft,r=pt,n=ut;ut=null,function(e){d=!0,y(!ut,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ut=e;var t=ct;st=function(){if(!g)if(0<dt.length){var r=Date.now(),n=dt.shift();if(n.da(n.L),_t){var i=_t,s=0==i%1?i-1:Math.floor(i);_t=n.Sa?s:(8*i+(s+.5))/9}console.log('main loop blocker "'+n.name+'" took '+(Date.now()-r)+" ms"),a.setStatus&&(r=a.statusMessage||"Please wait...",n=_t,i=mt.Ua,n?n<i?a.setStatus(r+" ("+(i-n)+"/"+i+")"):a.setStatus(r):a.setStatus("")),t<ct||setTimeout(st,0)}else if(!(t<ct))if(lt=lt+1|0,1==ft&&1<pt&&0!=lt%pt)ot();else{0==ft&&(it=te());e:if(!(g||a.preMainLoop&&!1===a.preMainLoop())){try{e()}catch(e){if(e instanceof vr||"unwind"==e)break e;throw e&&"object"==typeof e&&e.stack&&h("exception thrown: "+[e,e.stack]),e}a.postMainLoop&&a.postMainLoop()}t<ct||("object"==typeof SDL&&SDL.audio&&SDL.audio.Ba&&SDL.audio.Ba(),ot())}}}(n),function(t,r){if(ft=t,pt=r,ut)if(0==t)ot=function(){var e=0|Math.max(0,it+r-te());setTimeout(st,e)};else if(1==t)ot=function(){xt(st)};else if(2==t){if(void 0===e){var n=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),n.shift()())}),!0),e=function(e){n.push(e),void 0===a.setImmediates&&(a.setImmediates=[]),a.setImmediates.push(e),postMessage({target:"setimmediate"})}}ot=function(){e(st)}}}(t,r),ot()},a.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},a.createContext=function(e,t,r,a){return wt(e,t,r,a)},function(e,t){try{var r=indexedDB.open("emscripten_filesystem",1)}catch(e){return void t()}r.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},r.onsuccess=function(e){!function(e){Vt=e,G()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){Vt=!1,G()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||K(),U.push({da:function(){ur()}});var or={__clock_gettime:function(e,t){return ne(e,t)},__cxa_allocate_exception:function(e){return pr(e+16)+16},__cxa_atexit:function(){},__cxa_throw:function(e,t,r){throw new ie(e).ua(t,r),e},__sys_fcntl64:function(e,t,r){rt=r;try{var a=nt(e);switch(t){case 0:var n=at();return 0>n?-28:Ye(a.path,a.flags,0,n).v;case 1:case 2:return 0;case 3:return a.flags;case 4:return n=at(),a.flags|=n,0;case 12:return n=at(),A[n+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return O[lr()>>2]=28,-1;default:return-28}}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_getpid:function(){return 42},__sys_ioctl:function(e,t,r){rt=r;try{var a=nt(e);switch(t){case 21509:case 21505:return a.h?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return a.h?0:-59;case 21519:if(!a.h)return-59;var n=at();return O[n>>2]=0;case 21520:return a.h?-28:-59;case 21531:if(e=n=at(),!a.f.wa)throw new Me(59);return a.f.wa(a,t,e);case 21523:case 21524:return a.h?0:-59;default:J("bad ioctl syscall "+t)}}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_lstat64:function(e,t){try{return tt(Ne,e=T(e),t)}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_open:function(e,t,r){rt=r;try{return Ye(T(e),t,r?at():0).v}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_stat64:function(e,t){try{return tt(We,e=T(e),t)}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_symlink:function(e,t){try{return Ze(e=T(e),t=T(t)),0}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_uname:function(e){try{if(!e)return-21;var t={__size__:390,domainname:325,machine:260,nodename:65,release:130,sysname:0,version:195};return V("Emscripten",e+t.sysname),V("emscripten",e+t.nodename),V("1.0",e+t.release),V("#1",e+t.version),V("x86-JS",e+t.machine),0}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},__sys_unlink:function(e){try{var t=xe(e=T(e),{parent:!0}).node,r=ce(e),a=Pe(t,r);e:{try{var n=Pe(t,r)}catch(e){var i=e.i;break e}var s=Te(t,"wx");i=s||(16384==(61440&n.mode)?31:0)}if(i)throw new Me(i);if(!t.c.S)throw new Me(63);if(a.H)throw new Me(10);try{ke.willDeletePath&&ke.willDeletePath(e)}catch(t){h("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.c.S(t,r);var _=Ee(a.parent.id,a.name);if(ve[_]===a)ve[_]=a.B;else for(var o=ve[_];o;){if(o.B===a){o.B=a.B;break}o=o.B}try{ke.onDeletePath&&ke.onDeletePath(e)}catch(t){h("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}return 0}catch(e){return void 0!==et&&e instanceof Me||J(e),-e.i}},_emscripten_fetch_free:function(e){delete Bt[e-1]},abort:function(){J()},clock_gettime:ne,emidentity:function(){var e=new URL(location.origin).hostname;if(0===e.length&&(e=new URL(location.href.replace("blob:","")).hostname),/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))0===e.indexOf("10.")&&(e="10.*"),0===e.indexOf("192.168.")&&(e="192.168.*"),0===e.indexOf("172.")&&(e="172.*"),0===e.indexOf("127.")&&(e="127.*");else{var t=new RegExp("("+String.fromCharCode(92)+".ngrok"+String.fromCharCode(92)+".io)$","i");t.test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.arweb.app")}t=I(e)+1;var r=pr(t);return D(e,M,r,t+1),r},emlicerr:function(){self.postMessage({t:"licerr"})},emscripten_asm_const_int:function(e,t,r){var a;for(ir.length=0,r>>=2;a=M[t++];)(a=105>a)&&1&r&&r++,ir.push(a?L[r++>>1]:O[r]),++r;return re[e].apply(null,ir)},emscripten_async_call:function(e,t,r){function a(){R.get(e)(t)}d=!0,0<=r?Ot(a,r):function(e){xt((function(){g||e()}))}(a)},emscripten_is_main_browser_thread:jt,emscripten_memcpy_big:function(e,t,r){M.copyWithin(e,t,t+r)},emscripten_resize_heap:function(e){e>>>=0;var t=M.length;if(2147483648<e)return!1;for(var r=1;4>=r;r*=2){var a=t*(1+.2/r);a=Math.min(a,e+100663296),0<(a=Math.max(16777216,e,a))%65536&&(a+=65536-a%65536);e:{try{b.grow(Math.min(2147483648,a)-z.byteLength+65535>>>16),B();var n=1;break e}catch(e){}n=void 0}if(n)return!0}return!1},emscripten_start_fetch:function(e,t,r,a,n){function i(e,r){Ut(e,r.response,(function(e){p?R.get(p)(e):t&&t(e)}),(function(e){p?R.get(p)(e):t&&t(e)}))}function s(e){h?R.get(h)(e):n&&n(e)}function _(e){l?R.get(l)(e):r&&r(e)}function o(e){m?R.get(m)(e):a&&a(e)}function c(e){p?R.get(p)(e):t&&t(e)}void 0!==d&&(d=!0);var u=e+112,f=T(u),p=E[u+36>>2],l=E[u+40>>2],m=E[u+44>>2],h=E[u+48>>2],b=E[u+52>>2],g=!!(4&b),y=!!(32&b);if(b=!!(16&b),"EM_IDB_STORE"===f)f=E[u+84>>2],Ut(e,M.slice(f,f+E[u+88>>2]),c,_);else if("EM_IDB_DELETE"===f)!function(e,t,r){var a=Vt;if(a){var n=E[e+112+64>>2];n||(n=E[e+8>>2]),n=T(n);try{var i=a.transaction(["FILES"],"readwrite").objectStore("FILES").delete(n);i.onsuccess=function(r){r=r.target.result,E[e+12>>2]=0,Rt(e+16,0),Rt(e+24,0),Rt(e+32,0),x[e+40>>1]=4,x[e+42>>1]=200,D("OK",M,e+44,64),t(e,0,r)},i.onerror=function(t){x[e+40>>1]=4,x[e+42>>1]=404,D("Not Found",M,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,_);else if(b){if(y)return 0;Ct(e,g?i:c,_,o,s)}else!function(e,t,r){var a=Vt;if(a){var n=E[e+112+64>>2];n||(n=E[e+8>>2]),n=T(n);try{var i=a.transaction(["FILES"],"readonly").objectStore("FILES").get(n);i.onsuccess=function(a){if(a.target.result){var n=(a=a.target.result).byteLength||a.length,i=pr(n);M.set(new Uint8Array(a),i),E[e+12>>2]=i,Rt(e+16,n),Rt(e+24,0),Rt(e+32,n),x[e+40>>1]=4,x[e+42>>1]=200,D("OK",M,e+44,64),t(e,0,a)}else x[e+40>>1]=4,x[e+42>>1]=404,D("Not Found",M,e+44,64),r(e,0,"no data")},i.onerror=function(t){x[e+40>>1]=4,x[e+42>>1]=404,D("Not Found",M,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,y?_:g?function(e){Ct(e,i,_,o,s)}:function(e){Ct(e,c,_,o,s)});return e},emscripten_thread_sleep:function(e){for(var t=te();te()-t<e;);},environ_get:function(e,t){try{var r=0;return Ht().forEach((function(a,n){var i=t+r;O[e+4*n>>2]=i,V(a,i),r+=a.length+1})),0}catch(e){return void 0!==et&&e instanceof Me||J(e),e.i}},environ_sizes_get:function(e,t){try{var r=Ht();O[e>>2]=r.length;var a=0;return r.forEach((function(e){a+=e.length+1})),O[t>>2]=a,0}catch(e){return void 0!==et&&e instanceof Me||J(e),e.i}},exit:function(e){d||(a.onExit&&a.onExit(e),g=!0),c(e,new vr(e))},fd_close:function(e){try{var t=nt(e);if(null===t.v)throw new Me(8);t.W&&(t.W=null);try{t.f.close&&t.f.close(t)}catch(e){throw e}finally{ye[t.v]=null}return t.v=null,0}catch(e){return void 0!==et&&e instanceof Me||J(e),e.i}},fd_read:function(e,t,r,a){try{e:{for(var n=nt(e),i=e=0;i<r;i++){var s=O[t+(8*i+4)>>2],_=n,o=O[t+8*i>>2],c=s,u=void 0,f=k;if(0>c||0>u)throw new Me(28);if(null===_.v)throw new Me(8);if(1==(2097155&_.flags))throw new Me(8);if(16384==(61440&_.node.mode))throw new Me(31);if(!_.f.read)throw new Me(28);var p=void 0!==u;if(p){if(!_.seekable)throw new Me(70)}else u=_.position;var l=_.f.read(_,f,o,c,u);p||(_.position+=l);var d=l;if(0>d){var m=-1;break e}if(e+=d,d<s)break}m=e}return O[a>>2]=m,0}catch(e){return void 0!==et&&e instanceof Me||J(e),e.i}},fd_seek:function(e,t,r,a,n){try{var i=nt(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(Ke(i,e,a),ee=[i.position>>>0,(Q=i.position,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],O[n>>2]=ee[0],O[n+4>>2]=ee[1],i.W&&0===e&&0===a&&(i.W=null),0)}catch(e){return void 0!==et&&e instanceof Me||J(e),e.i}},fd_write:function(e,t,r,a){try{e:{for(var n=nt(e),i=e=0;i<r;i++){var s=n,_=O[t+8*i>>2],o=O[t+(8*i+4)>>2],c=void 0,u=k;if(0>o||0>c)throw new Me(28);if(null===s.v)throw new Me(8);if(0==(2097155&s.flags))throw new Me(8);if(16384==(61440&s.node.mode))throw new Me(31);if(!s.f.write)throw new Me(28);s.seekable&&1024&s.flags&&Ke(s,0,2);var f=void 0!==c;if(f){if(!s.seekable)throw new Me(70)}else c=s.position;var p=s.f.write(s,u,_,o,c,void 0);f||(s.position+=p);try{s.path&&ke.onWriteToFile&&ke.onWriteToFile(s.path)}catch(e){h("FS.trackingDelegate['onWriteToFile']('"+s.path+"') threw an exception: "+e.message)}var l=p;if(0>l){var d=-1;break e}e+=l}d=e}return O[a>>2]=d,0}catch(e){return void 0!==et&&e instanceof Me||J(e),e.i}},gettimeofday:function(e){var t=Date.now();return O[e>>2]=t/1e3|0,O[e+4>>2]=t%1e3*1e3|0,0},glBindTexture:function(e,t){nr.bindTexture(e,Nt[t])},glGenTextures:function(e,t){for(var r=0;r<e;r++){var a=nr.createTexture(),n=a&&Kt(Nt);a?(a.name=n,Nt[n]=a):Gt||(Gt=1282),O[t+4*r>>2]=n}},glTexImage2D:function(e,t,r,a,n,i,s,_,o){nr.texImage2D(e,t,r,a,n,i,s,_,o?function(e,t,r,a,n){e=1==(e-=5120)?M:4==e?O:6==e?P:5==e||28922==e?E:x;var i=31-Math.clz32(e.BYTES_PER_ELEMENT);return e.subarray(n>>i,n+a*(r*({5:3,6:4,8:2,29502:3,29504:4}[t-6402]||1)*(1<<i)+4-1&-4)>>i)}(_,s,a,n,o):null)},glTexParameteri:function(e,t,r){nr.texParameteri(e,t,r)},localtime_r:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!Xt){Xt=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),a=new Date(t,6,1);t=r.getTimezoneOffset();var n=a.getTimezoneOffset(),i=Math.max(t,n);O[hr()>>2]=60*i,O[mr()>>2]=Number(t!=n),r=e(r),a=e(a),r=j(r),a=j(a),n<t?(O[dr()>>2]=r,O[dr()+4>>2]=a):(O[dr()>>2]=a,O[dr()+4>>2]=r)}}(),e=new Date(1e3*O[e>>2]),O[t>>2]=e.getSeconds(),O[t+4>>2]=e.getMinutes(),O[t+8>>2]=e.getHours(),O[t+12>>2]=e.getDate(),O[t+16>>2]=e.getMonth(),O[t+20>>2]=e.getFullYear()-1900,O[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);O[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,O[t+36>>2]=-60*e.getTimezoneOffset();var a=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(a!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,a)),O[t+32>>2]=e,e=O[dr()+(e?4:0)>>2],O[t+40>>2]=e,t},pthread_create:function(){return 6},pthread_join:function(){return 28},setTempRet0:function(){},strftime_l:function(e,t,r,a){return function(e,t,r,a){function n(e,t,r){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=r[0]+e;return e}function i(e,t){return n(e,t,"0")}function s(e,t){function r(e){return 0>e?-1:0<e?1:0}var a;return 0===(a=r(e.getFullYear()-t.getFullYear()))&&0===(a=r(e.getMonth()-t.getMonth()))&&(a=r(e.getDate()-t.getDate())),a}function _(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function o(e){e=ar(new Date(e.l+1900,0,1),e.R);var t=new Date(e.getFullYear()+1,0,4),r=_(new Date(e.getFullYear(),0,4));return t=_(t),0>=s(r,e)?0>=s(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=O[a+40>>2];for(var u in a={La:O[a>>2],Ka:O[a+4>>2],O:O[a+8>>2],K:O[a+12>>2],F:O[a+16>>2],l:O[a+20>>2],P:O[a+24>>2],R:O[a+28>>2],ab:O[a+32>>2],Ja:O[a+36>>2],Ma:c?T(c):""},r=T(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(u,"g"),c[u]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(u in c={"%a":function(e){return f[e.P].substring(0,3)},"%A":function(e){return f[e.P]},"%b":function(e){return p[e.F].substring(0,3)},"%B":function(e){return p[e.F]},"%C":function(e){return i((e.l+1900)/100|0,2)},"%d":function(e){return i(e.K,2)},"%e":function(e){return n(e.K,2," ")},"%g":function(e){return o(e).toString().substring(2)},"%G":function(e){return o(e)},"%H":function(e){return i(e.O,2)},"%I":function(e){return 0==(e=e.O)?e=12:12<e&&(e-=12),i(e,2)},"%j":function(e){return i(e.K+er(Qt(e.l+1900)?tr:rr,e.F-1),3)},"%m":function(e){return i(e.F+1,2)},"%M":function(e){return i(e.Ka,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.O&&12>e.O?"AM":"PM"},"%S":function(e){return i(e.La,2)},"%t":function(){return"\t"},"%u":function(e){return e.P||7},"%U":function(e){var t=new Date(e.l+1900,0,1),r=0===t.getDay()?t:ar(t,7-t.getDay());return 0>s(r,e=new Date(e.l+1900,e.F,e.K))?i(Math.ceil((31-r.getDate()+(er(Qt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===s(r,t)?"01":"00"},"%V":function(e){var t=new Date(e.l+1901,0,4),r=_(new Date(e.l+1900,0,4));t=_(t);var a=ar(new Date(e.l+1900,0,1),e.R);return 0>s(a,r)?"53":0>=s(t,a)?"01":i(Math.ceil((r.getFullYear()<e.l+1900?e.R+32-r.getDate():e.R+1-r.getDate())/7),2)},"%w":function(e){return e.P},"%W":function(e){var t=new Date(e.l,0,1),r=1===t.getDay()?t:ar(t,0===t.getDay()?1:7-t.getDay()+1);return 0>s(r,e=new Date(e.l+1900,e.F,e.K))?i(Math.ceil((31-r.getDate()+(er(Qt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===s(r,t)?"01":"00"},"%y":function(e){return(e.l+1900).toString().substring(2)},"%Y":function(e){return e.l+1900},"%z":function(e){var t=0<=(e=e.Ja);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Ma},"%%":function(){return"%"}})0<=r.indexOf(u)&&(r=r.replace(new RegExp(u,"g"),c[u](a)));return(u=_r(r,!1)).length>t?0:(k.set(u,e),u.length-1)}(e,t,r,a)},sysconf:function(e){switch(e){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return O[lr()>>2]=28,-1},time:function(e){var t=Date.now()/1e3|0;return e&&(O[e>>2]=t),t}},cr=function(){function e(e){a.asm=e.exports,b=a.asm.memory,B(),R=a.asm.__indirect_function_table,G()}var t={env:or,wasi_snapshot_preview1:or};if(K(),a.instantiateWasm)try{return a.instantiateWasm(t,e)}catch(e){return h("Module.instantiateWasm callback failed with error: "+e),!1}return t=function(e){var t=X;try{e:{try{if(t==X&&l){var r=new Uint8Array(l);break e}if(u){r=u(t);break e}throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(e){J(e)}r=void 0}var a=new WebAssembly.Module(r),n=new WebAssembly.Instance(a,e)}catch(t){throw e=t.toString(),h("failed to compile wasm module: "+e),(0<=e.indexOf("imported Memory")||0<=e.indexOf("memory import"))&&h("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),t}return[n,a]}(t),e(t[0],t[1]),a.asm}(),ur=a.___wasm_call_ctors=cr.__wasm_call_ctors;a._zappar_has_initialized=cr.zappar_has_initialized,a._zappar_invert=cr.zappar_invert,a._zappar_pipeline_create=cr.zappar_pipeline_create,a._zappar_pipeline_destroy=cr.zappar_pipeline_destroy,a._zappar_pipeline_camera_frame_submit=cr.zappar_pipeline_camera_frame_submit,a._zappar_pipeline_frame_update=cr.zappar_pipeline_frame_update,a._zappar_pipeline_camera_frame_user_data=cr.zappar_pipeline_camera_frame_user_data,a._zappar_pipeline_camera_model=cr.zappar_pipeline_camera_model,a._zappar_pipeline_frame_number=cr.zappar_pipeline_frame_number,a._zappar_pipeline_motion_accelerometer_submit=cr.zappar_pipeline_motion_accelerometer_submit,a._zappar_pipeline_motion_rotation_rate_submit=cr.zappar_pipeline_motion_rotation_rate_submit,a._zappar_pipeline_motion_attitude_submit=cr.zappar_pipeline_motion_attitude_submit,a._zappar_pipeline_motion_attitude_matrix_submit=cr.zappar_pipeline_motion_attitude_matrix_submit,a._zappar_pipeline_camera_frame_user_facing=cr.zappar_pipeline_camera_frame_user_facing,a._zappar_pipeline_camera_frame_texture_matrix=cr.zappar_pipeline_camera_frame_texture_matrix,a._zappar_pipeline_camera_pose_with_attitude=cr.zappar_pipeline_camera_pose_with_attitude,a._zappar_pipeline_camera_pose_with_origin=cr.zappar_pipeline_camera_pose_with_origin,a._zappar_pipeline_camera_frame_camera_attitude=cr.zappar_pipeline_camera_frame_camera_attitude,a._zappar_pipeline_camera_frame_device_attitude=cr.zappar_pipeline_camera_frame_device_attitude,a._zappar_pipeline_camera_frame_texture_gl=cr.zappar_pipeline_camera_frame_texture_gl,a._zappar_pipeline_camera_frame_upload_gl=cr.zappar_pipeline_camera_frame_upload_gl,a._zappar_pipeline_sequence_record_start=cr.zappar_pipeline_sequence_record_start,a._zappar_pipeline_sequence_record_stop=cr.zappar_pipeline_sequence_record_stop,a._zappar_pipeline_sequence_record_clear=cr.zappar_pipeline_sequence_record_clear,a._zappar_pipeline_sequence_record_device_attitude_matrices_set=cr.zappar_pipeline_sequence_record_device_attitude_matrices_set,a._zappar_pipeline_sequence_record_data_size=cr.zappar_pipeline_sequence_record_data_size,a._zappar_pipeline_sequence_record_data=cr.zappar_pipeline_sequence_record_data,a._zappar_pipeline_process_gl=cr.zappar_pipeline_process_gl,a._zappar_pipeline_camera_pose_default=cr.zappar_pipeline_camera_pose_default,a._zappar_instant_world_tracker_create=cr.zappar_instant_world_tracker_create,a._zappar_instant_world_tracker_destroy=cr.zappar_instant_world_tracker_destroy,a._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=cr.zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw,a._zappar_instant_world_tracker_anchor_pose_raw=cr.zappar_instant_world_tracker_anchor_pose_raw,a._zappar_instant_world_tracker_enabled_set=cr.zappar_instant_world_tracker_enabled_set,a._zappar_instant_world_tracker_enabled=cr.zappar_instant_world_tracker_enabled,a._zappar_image_tracker_create=cr.zappar_image_tracker_create,a._zappar_image_tracker_destroy=cr.zappar_image_tracker_destroy,a._zappar_image_tracker_target_load_from_memory=cr.zappar_image_tracker_target_load_from_memory,a.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=cr._Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc;var fr=a._free=cr.free;a._zappar_image_tracker_anchor_count=cr.zappar_image_tracker_anchor_count,a._zappar_image_tracker_anchor_id=cr.zappar_image_tracker_anchor_id,a._zappar_image_tracker_anchor_pose_raw=cr.zappar_image_tracker_anchor_pose_raw,a._zappar_image_tracker_enabled_set=cr.zappar_image_tracker_enabled_set,a._zappar_image_tracker_enabled=cr.zappar_image_tracker_enabled,a._zappar_image_tracker_target_loaded_version=cr.zappar_image_tracker_target_loaded_version,a._zappar_image_tracker_target_count=cr.zappar_image_tracker_target_count,a.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=cr._Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii,a.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=cr._Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii,a.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=cr._Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii,a.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=cr._Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii,a.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=cr._Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii,a.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=cr._Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii,a.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=cr._Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii,a._zappar_face_tracker_create=cr.zappar_face_tracker_create,a._zappar_face_tracker_destroy=cr.zappar_face_tracker_destroy,a._zappar_face_tracker_model_load_from_memory=cr.zappar_face_tracker_model_load_from_memory,a._zappar_face_tracker_anchor_count=cr.zappar_face_tracker_anchor_count,a._zappar_face_tracker_anchor_id=cr.zappar_face_tracker_anchor_id,a._zappar_face_tracker_anchor_pose_raw=cr.zappar_face_tracker_anchor_pose_raw,a._zappar_face_tracker_anchor_identity_coefficients=cr.zappar_face_tracker_anchor_identity_coefficients,a._zappar_face_tracker_anchor_expression_coefficients=cr.zappar_face_tracker_anchor_expression_coefficients,a._zappar_face_tracker_enabled_set=cr.zappar_face_tracker_enabled_set,a._zappar_face_tracker_enabled=cr.zappar_face_tracker_enabled,a._zappar_face_tracker_max_faces_set=cr.zappar_face_tracker_max_faces_set,a._zappar_face_tracker_max_faces=cr.zappar_face_tracker_max_faces,a._zappar_face_tracker_model_loaded_version=cr.zappar_face_tracker_model_loaded_version,a._zappar_face_landmark_create=cr.zappar_face_landmark_create,a._zappar_face_landmark_destroy=cr.zappar_face_landmark_destroy,a.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=cr._Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i,a._zappar_face_landmark_anchor_pose=cr.zappar_face_landmark_anchor_pose,a._zappar_barcode_finder_create=cr.zappar_barcode_finder_create,a._zappar_barcode_finder_destroy=cr.zappar_barcode_finder_destroy,a._zappar_barcode_finder_found_number=cr.zappar_barcode_finder_found_number,a._zappar_barcode_finder_found_text=cr.zappar_barcode_finder_found_text,a._zappar_barcode_finder_enabled_set=cr.zappar_barcode_finder_enabled_set,a._zappar_barcode_finder_enabled=cr.zappar_barcode_finder_enabled,a._zappar_barcode_finder_found_format=cr.zappar_barcode_finder_found_format,a._zappar_barcode_finder_formats=cr.zappar_barcode_finder_formats,a._zappar_barcode_finder_formats_set=cr.zappar_barcode_finder_formats_set;var pr=a._malloc=cr.malloc;a._zappar_face_mesh_create=cr.zappar_face_mesh_create,a._zappar_face_mesh_destroy=cr.zappar_face_mesh_destroy,a.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=cr._Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii,a.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=cr._Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti,a.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=cr._Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti,a.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=cr._Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti,a.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=cr._Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti,a.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=cr._Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti,a.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=cr._Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti,a.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=cr._Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti,a.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=cr._Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i,a.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=cr._Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti,a.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=cr._Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti,a._zappar_camera_source_create=cr.zappar_camera_source_create,a._zappar_camera_source_destroy=cr.zappar_camera_source_destroy,a._zappar_camera_source_start=cr.zappar_camera_source_start,a._zappar_camera_source_pause=cr.zappar_camera_source_pause,a._zappar_camera_default_device_id=cr.zappar_camera_default_device_id,a._zappar_sequence_source_create=cr.zappar_sequence_source_create,a.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=cr._Z28zappar_sequence_source_startP25zappar_sequence_source_ti,a.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=cr._Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci,a.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=cr._Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti,a._zappar_sequence_source_destroy=cr.zappar_sequence_source_destroy,a._zappar_log_level_set=cr.zappar_log_level_set,a._zappar_log_level=cr.zappar_log_level,a.___em_js__emidentity=cr.__em_js__emidentity,a._zappar_analytics_project_id_set=cr.zappar_analytics_project_id_set,a.___em_js__emlicerr=cr.__em_js__emlicerr,a._bundle_adjust_message_callback=cr.bundle_adjust_message_callback,a._bundle_adjust_message=cr.bundle_adjust_message;var lr=a.___errno_location=cr.__errno_location;a._ntohs=cr.ntohs,a._htons=cr.htons,a._htonl=cr.htonl,a._usleep=cr.usleep;var dr=a.__get_tzname=cr._get_tzname,mr=a.__get_daylight=cr._get_daylight,hr=a.__get_timezone=cr._get_timezone;a._emscripten_main_thread_process_queued_calls=cr.emscripten_main_thread_process_queued_calls;var br,gr=a.stackSave=cr.stackSave,yr=a.stackRestore=cr.stackRestore,wr=a.stackAlloc=cr.stackAlloc;function vr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function zr(){function e(){if(!br&&(br=!0,a.calledRun=!0,!g)){if(a.noFSInit||je||(je=!0,Ge(),a.stdin=a.stdin,a.stdout=a.stdout,a.stderr=a.stderr,a.stdin?Je("stdin",a.stdin):Ze("/dev/tty","/dev/stdin"),a.stdout?Je("stdout",null,a.stdout):Ze("/dev/tty","/dev/stdout"),a.stderr?Je("stderr",null,a.stderr):Ze("/dev/tty1","/dev/stderr"),Ye("/dev/stdin",0),Ye("/dev/stdout",1),Ye("/dev/stderr",1)),ae(U),ze=!1,ae(q),n(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var e=a.postRun.shift();Z.unshift(e)}ae(Z)}}if(!(0<W)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)H();ae(C),0<W||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),e()}),1)):e())}}if(a._setThrew=cr.setThrew,a.dynCall_viijii=cr.dynCall_viijii,a.dynCall_vij=cr.dynCall_vij,a.dynCall_iiji=cr.dynCall_iiji,a.dynCall_viji=cr.dynCall_viji,a.dynCall_vijii=cr.dynCall_vijii,a.dynCall_ji=cr.dynCall_ji,a.dynCall_jiji=cr.dynCall_jiji,a.dynCall_iiiiij=cr.dynCall_iiiiij,a.dynCall_iiiiijj=cr.dynCall_iiiiijj,a.dynCall_iiiiiijj=cr.dynCall_iiiiiijj,a.cwrap=function(e,t,r,a){var n=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&n&&!a?w(e):function(){return v(e,t,r,arguments)}},a.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":k[e>>0]=t;break;case"i16":A[e>>1]=t;break;case"i32":O[e>>2]=t;break;case"i64":ee=[t>>>0,(Q=t,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],O[e>>2]=ee[0],O[e+4>>2]=ee[1];break;case"float":P[e>>2]=t;break;case"double":L[e>>3]=t;break;default:J("invalid type for setValue: "+r)}},a.getValue=function(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return k[e>>0];case"i16":return A[e>>1];case"i32":case"i64":return O[e>>2];case"float":return P[e>>2];case"double":return L[e>>3];default:J("invalid type for getValue: "+t)}return null},a.UTF8ToString=T,Y=function e(){br||zr(),br||(Y=e)},a.run=zr,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return d=!0,zr(),t});t.default=a}.call(this,r(4).setImmediate)},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(5),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(0))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,s,_,o=1,c={},u=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){d(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(d,0,e)}:(s="setImmediate$"+Math.random()+"$",_=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&d(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",_,!1):e.attachEvent("onmessage",_),a=function(t){e.postMessage(s+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var n={callback:e,args:t};return c[o]=n,a(o),o++},p.clearImmediate=l}function l(e){delete c[e]}function d(e){if(u)setTimeout(d,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{l(e),u=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(0),r(6))},function(e,t){var r,a,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function _(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var o,c=[],u=!1,f=-1;function p(){u&&o&&(u=!1,o.length?c=o.concat(c):f=-1,c.length&&l())}function l(){if(!u){var e=_(p);u=!0;for(var t=c.length;t;){for(o=c,c=[];++f<t;)o&&o[f].run();f=-1,t=c.length}o=null,u=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||u||_(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRuntimeObject=void 0,t.getRuntimeObject=function(e){let t=e.cwrap("zappar_log_level","number",[]),r=e.cwrap("zappar_log_level_set",null,["number"]),a=e.cwrap("zappar_analytics_project_id_set",null,["string"]),n=e.cwrap("zappar_pipeline_create","number",[]),i=e.cwrap("zappar_pipeline_destroy",null,["number"]),s=e.cwrap("zappar_pipeline_frame_update",null,["number"]),_=e.cwrap("zappar_pipeline_frame_number","number",["number"]),o=e.cwrap("zappar_pipeline_camera_model","number",["number"]),c=e.cwrap("zappar_pipeline_camera_frame_user_data","number",["number"]),u=e.cwrap("zappar_pipeline_camera_frame_submit",null,["number","number","number","number","number","number","number","number","number"]),f=e.cwrap("zappar_pipeline_camera_frame_camera_attitude","number",["number"]),p=e.cwrap("zappar_pipeline_camera_frame_device_attitude","number",["number"]),l=e.cwrap("zappar_pipeline_motion_accelerometer_submit",null,["number","number","number","number","number"]),d=e.cwrap("zappar_pipeline_motion_rotation_rate_submit",null,["number","number","number","number","number"]),m=e.cwrap("zappar_pipeline_motion_attitude_submit",null,["number","number","number","number","number"]),h=e.cwrap("zappar_pipeline_motion_attitude_matrix_submit",null,["number","number"]),b=e.cwrap("zappar_camera_source_create","number",["number","string"]),g=e.cwrap("zappar_camera_source_destroy",null,["number"]),y=e.cwrap("zappar_sequence_source_create","number",["number"]),w=e.cwrap("zappar_sequence_source_destroy",null,["number"]),v=e.cwrap("zappar_image_tracker_create","number",["number"]),z=e.cwrap("zappar_image_tracker_destroy",null,["number"]),k=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),M=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),A=e.cwrap("zappar_image_tracker_target_count","number",["number"]),x=e.cwrap("zappar_image_tracker_enabled","number",["number"]),O=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),E=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),P=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),L=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),F=e.cwrap("zappar_face_tracker_create","number",["number"]),S=e.cwrap("zappar_face_tracker_destroy",null,["number"]),T=e.cwrap("zappar_face_tracker_model_load_from_memory",null,["number","number","number"]),D=e.cwrap("zappar_face_tracker_model_loaded_version","number",["number"]),I=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),j=e.cwrap("zappar_face_tracker_enabled","number",["number"]),V=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),B=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),R=e.cwrap("zappar_face_tracker_anchor_count","number",["number"]),C=e.cwrap("zappar_face_tracker_anchor_id","string",["number","number"]),U=e.cwrap("zappar_face_tracker_anchor_pose_raw","number",["number","number"]),q=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),Z=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),H=e.cwrap("zappar_face_mesh_create","number",[]),W=e.cwrap("zappar_face_mesh_destroy",null,["number"]),N=e.cwrap("zappar_face_landmark_create","number",["number"]),Y=e.cwrap("zappar_face_landmark_destroy",null,["number"]),K=e.cwrap("zappar_barcode_finder_create","number",["number"]),G=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),J=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),X=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),$=e.cwrap("zappar_barcode_finder_found_number","number",["number"]),Q=e.cwrap("zappar_barcode_finder_found_text","string",["number","number"]),ee=e.cwrap("zappar_barcode_finder_found_format","number",["number","number"]),te=e.cwrap("zappar_barcode_finder_formats","number",["number"]),re=e.cwrap("zappar_barcode_finder_formats_set",null,["number","number"]),ae=e.cwrap("zappar_instant_world_tracker_create","number",["number"]),ne=e.cwrap("zappar_instant_world_tracker_destroy",null,["number"]),ie=e.cwrap("zappar_instant_world_tracker_enabled_set",null,["number","number"]),se=e.cwrap("zappar_instant_world_tracker_enabled","number",["number"]),_e=e.cwrap("zappar_instant_world_tracker_anchor_pose_raw","number",["number"]),oe=e.cwrap("zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw",null,["number","number","number","number","number"]),ce=32,ue=e._malloc(ce),fe=64,pe=e._malloc(fe);return{log_level:()=>t(),log_level_set:e=>r(e),analytics_project_id_set:e=>a(e),pipeline_create:()=>n(),pipeline_destroy:()=>{i()},pipeline_frame_update:e=>s(e),pipeline_frame_number:e=>_(e),pipeline_camera_model:t=>{let r=o(t),a=new Float32Array(6);return a.set(e.HEAPF32.subarray(r/4,6+r/4)),r=a,r},pipeline_camera_frame_user_data:e=>c(e),pipeline_camera_frame_submit:(t,r,a,n,i,s,_,o)=>{ce<r.byteLength&&(e._free(ue),ce=r.byteLength,ue=e._malloc(ce));let c=ue,f=r.byteLength;e.HEAPU8.set(new Uint8Array(r),ue);let p=a,l=n,d=i;fe<s.byteLength&&(e._free(fe),fe=s.byteLength,pe=e._malloc(fe));let m=pe;e.HEAPF32.set(s,pe/4),fe<_.byteLength&&(e._free(fe),fe=_.byteLength,pe=e._malloc(fe));let h=pe;return e.HEAPF32.set(_,pe/4),u(t,c,f,p,l,d,m,h,o?1:0)},pipeline_camera_frame_camera_attitude:t=>{let r=f(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_camera_frame_device_attitude:t=>{let r=p(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_motion_accelerometer_submit:(e,t,r,a,n)=>l(e,t,r,a,n),pipeline_motion_rotation_rate_submit:(e,t,r,a,n)=>d(e,t,r,a,n),pipeline_motion_attitude_submit:(e,t,r,a,n)=>m(e,t,r,a,n),pipeline_motion_attitude_matrix_submit:(t,r)=>{fe<r.byteLength&&(e._free(fe),fe=r.byteLength,pe=e._malloc(fe));let a=pe;return e.HEAPF32.set(r,pe/4),h(t,a)},camera_source_create:(e,t)=>b(e,t),camera_source_destroy:()=>{g()},sequence_source_create:e=>y(e),sequence_source_destroy:()=>{w()},image_tracker_create:e=>v(e),image_tracker_destroy:()=>{z()},image_tracker_target_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(ue),ce=r.byteLength,ue=e._malloc(ce));let a=ue,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),ue),k(t,a,n)},image_tracker_target_loaded_version:e=>M(e),image_tracker_target_count:e=>A(e),image_tracker_enabled:e=>{let t=x(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>O(e,t?1:0),image_tracker_anchor_count:e=>E(e),image_tracker_anchor_id:(e,t)=>P(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let a=L(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_create:e=>F(e),face_tracker_destroy:()=>{S()},face_tracker_model_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(ue),ce=r.byteLength,ue=e._malloc(ce));let a=ue,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),ue),T(t,a,n)},face_tracker_model_loaded_version:e=>D(e),face_tracker_enabled_set:(e,t)=>I(e,t?1:0),face_tracker_enabled:e=>{let t=j(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>V(e,t),face_tracker_max_faces:e=>B(e),face_tracker_anchor_count:e=>R(e),face_tracker_anchor_id:(e,t)=>C(e,t),face_tracker_anchor_pose_raw:(t,r)=>{let a=U(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_anchor_identity_coefficients:(t,r)=>{let a=q(t,r),n=new Float32Array(50);return n.set(e.HEAPF32.subarray(a/4,50+a/4)),a=n,a},face_tracker_anchor_expression_coefficients:(t,r)=>{let a=Z(t,r),n=new Float32Array(29);return n.set(e.HEAPF32.subarray(a/4,29+a/4)),a=n,a},face_mesh_create:()=>H(),face_mesh_destroy:()=>{W()},face_landmark_create:e=>N(e),face_landmark_destroy:()=>{Y()},barcode_finder_create:e=>K(e),barcode_finder_destroy:()=>{G()},barcode_finder_enabled_set:(e,t)=>J(e,t?1:0),barcode_finder_enabled:e=>{let t=X(e);return t=1===t,t},barcode_finder_found_number:e=>$(e),barcode_finder_found_text:(e,t)=>Q(e,t),barcode_finder_found_format:(e,t)=>ee(e,t),barcode_finder_formats:e=>te(e),barcode_finder_formats_set:(e,t)=>re(e,t),instant_world_tracker_create:e=>ae(e),instant_world_tracker_destroy:()=>{ne()},instant_world_tracker_enabled_set:(e,t)=>ie(e,t?1:0),instant_world_tracker_enabled:e=>{let t=se(e);return t=1===t,t},instant_world_tracker_anchor_pose_raw:t=>{let r=_e(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,a,n)=>oe(e,t,r,a,n)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zappar_server=void 0;const a=r(9),n=r(10);t.zappar_server=class{constructor(e,t){this._impl=e,this._sender=t,this._deserializer=new n.MessageDeserializer,this.serializersByPipelineId=new Map,this._pipeline_id_by_pipeline_id=new Map,this._pipeline_by_instance=new Map,this._pipeline_id_by_camera_source_id=new Map,this._camera_source_by_instance=new Map,this._pipeline_id_by_sequence_source_id=new Map,this._sequence_source_by_instance=new Map,this._pipeline_id_by_image_tracker_id=new Map,this._image_tracker_by_instance=new Map,this._pipeline_id_by_face_tracker_id=new Map,this._face_tracker_by_instance=new Map,this._pipeline_id_by_face_mesh_id=new Map,this._face_mesh_by_instance=new Map,this._pipeline_id_by_face_landmark_id=new Map,this._face_landmark_by_instance=new Map,this._pipeline_id_by_barcode_finder_id=new Map,this._barcode_finder_by_instance=new Map,this._pipeline_id_by_instant_world_tracker_id=new Map,this._instant_world_tracker_by_instance=new Map}processBuffer(e){this._deserializer.setData(e),this._deserializer.forMessages((e,t)=>{switch(e){case 34:this._impl.log_level_set(t.logLevel());break;case 31:this._impl.analytics_project_id_set(t.string());break;case 27:{let e=t.type(),r=this._impl.pipeline_create();this._pipeline_by_instance.set(e,r),this._pipeline_id_by_pipeline_id.set(e,e),this.serializersByPipelineId.set(e,new a.MessageSerializer(t=>{this._sender(e,t)}));break}case 28:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_destroy(r),this._pipeline_by_instance.delete(e);break}case 9:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_frame_update(r);break}case 8:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_camera_frame_submit(r,t.dataWithLength(),t.int(),t.int(),t.int(),t.matrix4x4(),t.matrix4x4(),t.bool());break}case 10:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_accelerometer_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 11:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_rotation_rate_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 12:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 13:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_matrix_submit(r,t.matrix4x4());break}case 29:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=t.string(),i=this._impl.camera_source_create(a,n);this._camera_source_by_instance.set(e,i),this._pipeline_id_by_camera_source_id.set(e,r);break}case 30:{let e=t.type(),r=this._camera_source_by_instance.get(e);if(void 0===r)return;this._impl.camera_source_destroy(r),this._camera_source_by_instance.delete(e);break}case 35:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.sequence_source_create(a);this._sequence_source_by_instance.set(e,n),this._pipeline_id_by_sequence_source_id.set(e,r);break}case 36:{let e=t.type(),r=this._sequence_source_by_instance.get(e);if(void 0===r)return;this._impl.sequence_source_destroy(r),this._sequence_source_by_instance.delete(e);break}case 2:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.image_tracker_create(a);this._image_tracker_by_instance.set(e,n),this._pipeline_id_by_image_tracker_id.set(e,r);break}case 14:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_destroy(r),this._image_tracker_by_instance.delete(e);break}case 4:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_target_load_from_memory(r,t.dataWithLength());break}case 3:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_enabled_set(r,t.bool());break}case 20:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.face_tracker_create(a);this._face_tracker_by_instance.set(e,n),this._pipeline_id_by_face_tracker_id.set(e,r);break}case 21:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_destroy(r),this._face_tracker_by_instance.delete(e);break}case 22:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_model_load_from_memory(r,t.dataWithLength());break}case 23:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_enabled_set(r,t.bool());break}case 24:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_max_faces_set(r,t.int());break}case 25:{let e=t.type(),r=this._impl.face_mesh_create();this._face_mesh_by_instance.set(e,r);break}case 26:{let e=t.type(),r=this._face_mesh_by_instance.get(e);if(void 0===r)return;this._impl.face_mesh_destroy(r),this._face_mesh_by_instance.delete(e);break}case 32:{let e=t.type(),r=t.faceLandmarkName(),a=this._impl.face_landmark_create(r);this._face_landmark_by_instance.set(e,a);break}case 33:{let e=t.type(),r=this._face_landmark_by_instance.get(e);if(void 0===r)return;this._impl.face_landmark_destroy(r),this._face_landmark_by_instance.delete(e);break}case 16:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.barcode_finder_create(a);this._barcode_finder_by_instance.set(e,n),this._pipeline_id_by_barcode_finder_id.set(e,r);break}case 17:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_destroy(r),this._barcode_finder_by_instance.delete(e);break}case 18:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_enabled_set(r,t.bool());break}case 19:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_formats_set(r,t.barcodeFormat());break}case 5:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.instant_world_tracker_create(a);this._instant_world_tracker_by_instance.set(e,n),this._pipeline_id_by_instant_world_tracker_id.set(e,r);break}case 15:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_destroy(r),this._instant_world_tracker_by_instance.delete(e);break}case 6:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_enabled_set(r,t.bool());break}case 7:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(r,t.float(),t.float(),t.float(),t.instantTrackerTransformOrientation());break}}})}exploreState(){for(let[e,t]of this._pipeline_by_instance){let r=this._pipeline_id_by_pipeline_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&(a.sendMessage(7,r=>{r.type(e),r.int(this._impl.pipeline_frame_number(t))}),a.sendMessage(6,r=>{r.type(e),r.cameraModel(this._impl.pipeline_camera_model(t))}),a.sendMessage(5,r=>{r.type(e),r.int(this._impl.pipeline_camera_frame_user_data(t))}),a.sendMessage(11,r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_camera_attitude(t))}),a.sendMessage(12,r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_device_attitude(t))}))}for(let[e,t]of this._camera_source_by_instance){let t=this._pipeline_id_by_camera_source_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._sequence_source_by_instance){let t=this._pipeline_id_by_sequence_source_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._image_tracker_by_instance){let r=this._pipeline_id_by_image_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(19,r=>{r.type(e),r.int(this._impl.image_tracker_target_loaded_version(t))}),a.sendMessage(21,r=>{r.type(e),r.int(this._impl.image_tracker_target_count(t))}),a.sendMessage(1,r=>{r.type(e),r.int(this._impl.image_tracker_anchor_count(t))});for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(2,a=>{a.type(e),a.int(r),a.string(this._impl.image_tracker_anchor_id(t,r))});for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(3,a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.image_tracker_anchor_pose_raw(t,r))})}}for(let[e,t]of this._face_tracker_by_instance){let r=this._pipeline_id_by_face_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(18,r=>{r.type(e),r.int(this._impl.face_tracker_model_loaded_version(t))}),a.sendMessage(13,r=>{r.type(e),r.int(this._impl.face_tracker_anchor_count(t))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(14,a=>{a.type(e),a.int(r),a.string(this._impl.face_tracker_anchor_id(t,r))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(15,a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.face_tracker_anchor_pose_raw(t,r))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(16,a=>{a.type(e),a.int(r),a.identityCoefficients(this._impl.face_tracker_anchor_identity_coefficients(t,r))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(17,a=>{a.type(e),a.int(r),a.expressionCoefficients(this._impl.face_tracker_anchor_expression_coefficients(t,r))})}}for(let[e,t]of this._face_mesh_by_instance){let t=this._pipeline_id_by_face_mesh_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._face_landmark_by_instance){let t=this._pipeline_id_by_face_landmark_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._barcode_finder_by_instance){let r=this._pipeline_id_by_barcode_finder_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(8,r=>{r.type(e),r.int(this._impl.barcode_finder_found_number(t))});for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(9,a=>{a.type(e),a.int(r),a.string(this._impl.barcode_finder_found_text(t,r))});for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(10,a=>{a.type(e),a.int(r),a.barcodeFormat(this._impl.barcode_finder_found_format(t,r))})}}for(let[e,t]of this._instant_world_tracker_by_instance){let r=this._pipeline_id_by_instant_world_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&a.sendMessage(4,r=>{r.type(e),r.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(t))})}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSerializer=void 0;t.MessageSerializer=class{constructor(e){this._messageSender=e,this._freeBufferPool=[],this._buffer=new ArrayBuffer(16),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1,this._timeoutSet=!1,this._appender={int:e=>this.int(e),bool:e=>this.int(e?1:0),float:e=>this.float(e),string:e=>this.string(e),dataWithLength:e=>this.arrayBuffer(e),type:e=>this.int(e),matrix4x4:e=>this.float32ArrayBuffer(e),matrix3x3:e=>this.float32ArrayBuffer(e),identityCoefficients:e=>this.float32ArrayBuffer(e),expressionCoefficients:e=>this.float32ArrayBuffer(e),cameraModel:e=>this.float32ArrayBuffer(e),timestamp:e=>this.double(e),barcodeFormat:e=>this.int(e),faceLandmarkName:e=>this.int(e),instantTrackerTransformOrientation:e=>this.int(e),logLevel:e=>this.int(e)},this._freeBufferPool.push(new ArrayBuffer(16)),this._freeBufferPool.push(new ArrayBuffer(16))}bufferReturn(e){this._freeBufferPool.push(e)}_ensureArrayBuffer(e){let t=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=t)return;let r=void 0;if(!r){let e=t;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,r=new ArrayBuffer(e)}let a=this._buffer?this._i32View:void 0;this._buffer=r,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),a&&this._i32View.set(a.subarray(0,this._offset))}sendMessage(e,t){this._ensureArrayBuffer(4),this._startOffset=this._offset,this._i32View[this._offset+1]=e,this._offset+=2,t(this._appender),this._i32View[this._startOffset]=this._offset-this._startOffset,this._startOffset=-1,this._sendOneTime()}_sendOneTime(){!1===this._timeoutSet&&(this._timeoutSet=!0,setTimeout(()=>{this._timeoutSet=!1,this._send()},0))}_send(){0!==this._freeBufferPool.length?(this._i32View[0]=this._offset,this._messageSender(this._buffer),this._buffer=void 0,this._buffer=this._freeBufferPool.pop(),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1):this._sendOneTime()}int(e){this._ensureArrayBuffer(1),this._i32View[this._offset]=e,this._offset++}double(e){this._ensureArrayBuffer(2),this._offset%2==1&&this._offset++,this._f64View[this._offset/2]=e,this._offset+=2}float(e){this._ensureArrayBuffer(1),this._f32View[this._offset]=e,this._offset++}int32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t];this._offset+=e.length}float32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._f32View[this._offset+t]=e[t];this._offset+=e.length}booleanArray(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t]?1:0;this._offset+=e.length}uint8ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8View.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}arrayBuffer(e){let t=new Uint8Array(e);this.uint8ArrayBuffer(t)}uint8ClampedArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8cView.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}float32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._f32View.set(e,this._offset),this._offset+=e.length}uint16ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++;let t=2*this._offset;this._u16View.set(e,t),this._offset+=e.length>>1,0!=(1&e.length)&&this._offset++}int32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._i32View.set(e,this._offset),this._offset+=e.length}uint32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._u32View.set(e,this._offset),this._offset+=e.length}string(e){let t=(new TextEncoder).encode(e);this._ensureArrayBuffer(t.byteLength/4),this._i32View[this._offset]=t.byteLength,this._offset++,this._u8View.set(t,4*this._offset),this._offset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._offset++}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDeserializer=void 0;t.MessageDeserializer=class{constructor(){this._buffer=new ArrayBuffer(0),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,this._startOffset=-1,this._processor={int:()=>this._i32View[this._startOffset++],bool:()=>1===this._i32View[this._startOffset++],type:()=>this._i32View[this._startOffset++],float:()=>this._f32View[this._startOffset++],timestamp:()=>{this._startOffset%2==1&&this._startOffset++;let e=this._f64View[this._startOffset/2];return this._startOffset+=2,e},string:()=>{let e=this._i32View[this._startOffset++],t=(new TextDecoder).decode(new Uint8Array(this._buffer,4*this._startOffset,e));return this._startOffset+=e>>2,0!=(3&e)&&this._startOffset++,t},dataWithLength:()=>{let e=this._i32View[this._startOffset++],t=new Uint8Array(e);return t.set(this._u8View.subarray(4*this._startOffset,4*this._startOffset+e)),this._startOffset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._startOffset++,t.buffer},matrix4x4:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+16)),this._startOffset+=e,t},matrix3x3:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+9)),this._startOffset+=e,t},identityCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+50)),this._startOffset+=e,t},expressionCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+29)),this._startOffset+=e,t},cameraModel:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+6)),this._startOffset+=e,t},barcodeFormat:()=>this._i32View[this._startOffset++],faceLandmarkName:()=>this._i32View[this._startOffset++],instantTrackerTransformOrientation:()=>this._i32View[this._startOffset++],logLevel:()=>this._i32View[this._startOffset++]}}setData(e){this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,e.byteLength>=4&&(this._offset=1,this._length=this._i32View[0]),this._startOffset=-1}hasMessage(){return this._offset+1<this._length}forMessages(e){for(;this.hasMessage();){let t=this._i32View[this._offset],r=this._i32View[this._offset+1];this._startOffset=this._offset+2,this._offset+=t,e(r,this._processor)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MsgManager=void 0;const a=r(12);t.MsgManager=class{constructor(){this.onOutgoingMessage=new a.Event,this.onIncomingMessage=new a.Event1,this._outgoingMessages=[]}postIncomingMessage(e){this.onIncomingMessage.emit(e)}postOutgoingMessage(e,t){this._outgoingMessages.push({msg:e,transferables:t}),this.onOutgoingMessage.emit()}getOutgoingMessages(){let e=this._outgoingMessages;return this._outgoingMessages=[],e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event5=t.Event3=t.Event2=t.Event1=t.Event=void 0;t.Event=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(){for(var e=0,t=this._funcs.length;e<t;e++)this._funcs[e]()}};t.Event1=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e){for(var t=0,r=this._funcs.length;t<r;t++)this._funcs[t](e)}};t.Event2=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e,t){for(var r=0,a=this._funcs.length;r<a;r++)this._funcs[r](e,t)}};t.Event3=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e,t,r){for(var a=0,n=this._funcs.length;a<n;a++)this._funcs[a](e,t,r)}};t.Event5=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e,t,r,a,n){for(var i=0,s=this._funcs.length;i<s;i++)this._funcs[i](e,t,r,a,n)}}},function(e,t,r){"use strict";r.r(t),t.default=r.p+"d115e485cffe500afc4f7c1272ea8f62.wasm"}]);
|
|
1
|
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.profile=t.EmbeddedVideoImplementation=void 0;const n=r(18);!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(t.EmbeddedVideoImplementation||(t.EmbeddedVideoImplementation={})),t.profile={deviceMotionMutliplier:-1,blacklisted:!1,showGyroPermissionsWarningIfNecessary:!1,showSafariPermissionsResetIfNecessary:!1,requestHighFrameRate:!1,videoWidth:640,videoHeight:480,dataWidth:320,dataHeight:240,videoElementInDOM:!1,preferMediaStreamTrackProcessorCamera:!1,preferImageBitmapCamera:!1},"undefined"!=typeof window&&(window.zeeProfile=t.profile,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),t.profile.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),t.profile.preferImageBitmapCamera=!0));let a=new n.UAParser,i=(a.getOS().name||"unknown").toLowerCase(),o=(a.getEngine().name||"unknown").toLowerCase();function s(){let e=a.getOS().version;if(e){let r=e.split(".");if(r.length>=2){const e=parseInt(r[0]),n=parseInt(r[1]);(e<11||11===e&&n<3)&&(t.profile.blacklisted=!0),(e<12||12===e&&n<2)&&(t.profile.videoElementInDOM=!0),(12===e&&n>=2||e>=13)&&(t.profile.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(t.profile.showSafariPermissionsResetIfNecessary=!0),(e>=12&&n>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(t.profile.requestHighFrameRate=!0,e<14&&(t.profile.videoHeight=360,t.profile.dataHeight=180))}}}"webkit"===o&&"ios"!==i&&(t.profile.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&s()),"webkit"===o&&"ios"===i&&(t.profile.deviceMotionMutliplier=1,s())},function(e,t,r){"use strict";r.r(t),r.d(t,"glMatrix",(function(){return n})),r.d(t,"mat2",(function(){return a})),r.d(t,"mat2d",(function(){return i})),r.d(t,"mat3",(function(){return o})),r.d(t,"mat4",(function(){return s})),r.d(t,"quat",(function(){return _})),r.d(t,"quat2",(function(){return f})),r.d(t,"vec2",(function(){return l})),r.d(t,"vec3",(function(){return u})),r.d(t,"vec4",(function(){return c}));var n={};r.r(n),r.d(n,"EPSILON",(function(){return d})),r.d(n,"ARRAY_TYPE",(function(){return p})),r.d(n,"RANDOM",(function(){return h})),r.d(n,"setMatrixArrayType",(function(){return m})),r.d(n,"toRadian",(function(){return g})),r.d(n,"equals",(function(){return w}));var a={};r.r(a),r.d(a,"create",(function(){return v})),r.d(a,"clone",(function(){return y})),r.d(a,"copy",(function(){return M})),r.d(a,"identity",(function(){return k})),r.d(a,"fromValues",(function(){return x})),r.d(a,"set",(function(){return E})),r.d(a,"transpose",(function(){return A})),r.d(a,"invert",(function(){return z})),r.d(a,"adjoint",(function(){return T})),r.d(a,"determinant",(function(){return R})),r.d(a,"multiply",(function(){return F})),r.d(a,"rotate",(function(){return O})),r.d(a,"scale",(function(){return P})),r.d(a,"fromRotation",(function(){return L})),r.d(a,"fromScaling",(function(){return S})),r.d(a,"str",(function(){return I})),r.d(a,"frob",(function(){return D})),r.d(a,"LDU",(function(){return B})),r.d(a,"add",(function(){return C})),r.d(a,"subtract",(function(){return U})),r.d(a,"exactEquals",(function(){return V})),r.d(a,"equals",(function(){return q})),r.d(a,"multiplyScalar",(function(){return N})),r.d(a,"multiplyScalarAndAdd",(function(){return j})),r.d(a,"mul",(function(){return W})),r.d(a,"sub",(function(){return H}));var i={};r.r(i),r.d(i,"create",(function(){return G})),r.d(i,"clone",(function(){return X})),r.d(i,"copy",(function(){return Y})),r.d(i,"identity",(function(){return Z})),r.d(i,"fromValues",(function(){return K})),r.d(i,"set",(function(){return J})),r.d(i,"invert",(function(){return $})),r.d(i,"determinant",(function(){return Q})),r.d(i,"multiply",(function(){return ee})),r.d(i,"rotate",(function(){return te})),r.d(i,"scale",(function(){return re})),r.d(i,"translate",(function(){return ne})),r.d(i,"fromRotation",(function(){return ae})),r.d(i,"fromScaling",(function(){return ie})),r.d(i,"fromTranslation",(function(){return oe})),r.d(i,"str",(function(){return se})),r.d(i,"frob",(function(){return ue})),r.d(i,"add",(function(){return ce})),r.d(i,"subtract",(function(){return _e})),r.d(i,"multiplyScalar",(function(){return fe})),r.d(i,"multiplyScalarAndAdd",(function(){return le})),r.d(i,"exactEquals",(function(){return de})),r.d(i,"equals",(function(){return pe})),r.d(i,"mul",(function(){return he})),r.d(i,"sub",(function(){return me}));var o={};r.r(o),r.d(o,"create",(function(){return be})),r.d(o,"fromMat4",(function(){return ge})),r.d(o,"clone",(function(){return we})),r.d(o,"copy",(function(){return ve})),r.d(o,"fromValues",(function(){return ye})),r.d(o,"set",(function(){return Me})),r.d(o,"identity",(function(){return ke})),r.d(o,"transpose",(function(){return xe})),r.d(o,"invert",(function(){return Ee})),r.d(o,"adjoint",(function(){return Ae})),r.d(o,"determinant",(function(){return ze})),r.d(o,"multiply",(function(){return Te})),r.d(o,"translate",(function(){return Re})),r.d(o,"rotate",(function(){return Fe})),r.d(o,"scale",(function(){return Oe})),r.d(o,"fromTranslation",(function(){return Pe})),r.d(o,"fromRotation",(function(){return Le})),r.d(o,"fromScaling",(function(){return Se})),r.d(o,"fromMat2d",(function(){return Ie})),r.d(o,"fromQuat",(function(){return De})),r.d(o,"normalFromMat4",(function(){return Be})),r.d(o,"projection",(function(){return Ce})),r.d(o,"str",(function(){return Ue})),r.d(o,"frob",(function(){return Ve})),r.d(o,"add",(function(){return qe})),r.d(o,"subtract",(function(){return Ne})),r.d(o,"multiplyScalar",(function(){return je})),r.d(o,"multiplyScalarAndAdd",(function(){return We})),r.d(o,"exactEquals",(function(){return He})),r.d(o,"equals",(function(){return Ge})),r.d(o,"mul",(function(){return Xe})),r.d(o,"sub",(function(){return Ye}));var s={};r.r(s),r.d(s,"create",(function(){return Ze})),r.d(s,"clone",(function(){return Ke})),r.d(s,"copy",(function(){return Je})),r.d(s,"fromValues",(function(){return $e})),r.d(s,"set",(function(){return Qe})),r.d(s,"identity",(function(){return et})),r.d(s,"transpose",(function(){return tt})),r.d(s,"invert",(function(){return rt})),r.d(s,"adjoint",(function(){return nt})),r.d(s,"determinant",(function(){return at})),r.d(s,"multiply",(function(){return it})),r.d(s,"translate",(function(){return ot})),r.d(s,"scale",(function(){return st})),r.d(s,"rotate",(function(){return ut})),r.d(s,"rotateX",(function(){return ct})),r.d(s,"rotateY",(function(){return _t})),r.d(s,"rotateZ",(function(){return ft})),r.d(s,"fromTranslation",(function(){return lt})),r.d(s,"fromScaling",(function(){return dt})),r.d(s,"fromRotation",(function(){return pt})),r.d(s,"fromXRotation",(function(){return ht})),r.d(s,"fromYRotation",(function(){return mt})),r.d(s,"fromZRotation",(function(){return bt})),r.d(s,"fromRotationTranslation",(function(){return gt})),r.d(s,"fromQuat2",(function(){return wt})),r.d(s,"getTranslation",(function(){return vt})),r.d(s,"getScaling",(function(){return yt})),r.d(s,"getRotation",(function(){return Mt})),r.d(s,"fromRotationTranslationScale",(function(){return kt})),r.d(s,"fromRotationTranslationScaleOrigin",(function(){return xt})),r.d(s,"fromQuat",(function(){return Et})),r.d(s,"frustum",(function(){return At})),r.d(s,"perspective",(function(){return zt})),r.d(s,"perspectiveFromFieldOfView",(function(){return Tt})),r.d(s,"ortho",(function(){return Rt})),r.d(s,"lookAt",(function(){return Ft})),r.d(s,"targetTo",(function(){return Ot})),r.d(s,"str",(function(){return Pt})),r.d(s,"frob",(function(){return Lt})),r.d(s,"add",(function(){return St})),r.d(s,"subtract",(function(){return It})),r.d(s,"multiplyScalar",(function(){return Dt})),r.d(s,"multiplyScalarAndAdd",(function(){return Bt})),r.d(s,"exactEquals",(function(){return Ct})),r.d(s,"equals",(function(){return Ut})),r.d(s,"mul",(function(){return Vt})),r.d(s,"sub",(function(){return qt}));var u={};r.r(u),r.d(u,"create",(function(){return Nt})),r.d(u,"clone",(function(){return jt})),r.d(u,"length",(function(){return Wt})),r.d(u,"fromValues",(function(){return Ht})),r.d(u,"copy",(function(){return Gt})),r.d(u,"set",(function(){return Xt})),r.d(u,"add",(function(){return Yt})),r.d(u,"subtract",(function(){return Zt})),r.d(u,"multiply",(function(){return Kt})),r.d(u,"divide",(function(){return Jt})),r.d(u,"ceil",(function(){return $t})),r.d(u,"floor",(function(){return Qt})),r.d(u,"min",(function(){return er})),r.d(u,"max",(function(){return tr})),r.d(u,"round",(function(){return rr})),r.d(u,"scale",(function(){return nr})),r.d(u,"scaleAndAdd",(function(){return ar})),r.d(u,"distance",(function(){return ir})),r.d(u,"squaredDistance",(function(){return or})),r.d(u,"squaredLength",(function(){return sr})),r.d(u,"negate",(function(){return ur})),r.d(u,"inverse",(function(){return cr})),r.d(u,"normalize",(function(){return _r})),r.d(u,"dot",(function(){return fr})),r.d(u,"cross",(function(){return lr})),r.d(u,"lerp",(function(){return dr})),r.d(u,"hermite",(function(){return pr})),r.d(u,"bezier",(function(){return hr})),r.d(u,"random",(function(){return mr})),r.d(u,"transformMat4",(function(){return br})),r.d(u,"transformMat3",(function(){return gr})),r.d(u,"transformQuat",(function(){return wr})),r.d(u,"rotateX",(function(){return vr})),r.d(u,"rotateY",(function(){return yr})),r.d(u,"rotateZ",(function(){return Mr})),r.d(u,"angle",(function(){return kr})),r.d(u,"zero",(function(){return xr})),r.d(u,"str",(function(){return Er})),r.d(u,"exactEquals",(function(){return Ar})),r.d(u,"equals",(function(){return zr})),r.d(u,"sub",(function(){return Rr})),r.d(u,"mul",(function(){return Fr})),r.d(u,"div",(function(){return Or})),r.d(u,"dist",(function(){return Pr})),r.d(u,"sqrDist",(function(){return Lr})),r.d(u,"len",(function(){return Sr})),r.d(u,"sqrLen",(function(){return Ir})),r.d(u,"forEach",(function(){return Dr}));var c={};r.r(c),r.d(c,"create",(function(){return Br})),r.d(c,"clone",(function(){return Cr})),r.d(c,"fromValues",(function(){return Ur})),r.d(c,"copy",(function(){return Vr})),r.d(c,"set",(function(){return qr})),r.d(c,"add",(function(){return Nr})),r.d(c,"subtract",(function(){return jr})),r.d(c,"multiply",(function(){return Wr})),r.d(c,"divide",(function(){return Hr})),r.d(c,"ceil",(function(){return Gr})),r.d(c,"floor",(function(){return Xr})),r.d(c,"min",(function(){return Yr})),r.d(c,"max",(function(){return Zr})),r.d(c,"round",(function(){return Kr})),r.d(c,"scale",(function(){return Jr})),r.d(c,"scaleAndAdd",(function(){return $r})),r.d(c,"distance",(function(){return Qr})),r.d(c,"squaredDistance",(function(){return en})),r.d(c,"length",(function(){return tn})),r.d(c,"squaredLength",(function(){return rn})),r.d(c,"negate",(function(){return nn})),r.d(c,"inverse",(function(){return an})),r.d(c,"normalize",(function(){return on})),r.d(c,"dot",(function(){return sn})),r.d(c,"cross",(function(){return un})),r.d(c,"lerp",(function(){return cn})),r.d(c,"random",(function(){return _n})),r.d(c,"transformMat4",(function(){return fn})),r.d(c,"transformQuat",(function(){return ln})),r.d(c,"zero",(function(){return dn})),r.d(c,"str",(function(){return pn})),r.d(c,"exactEquals",(function(){return hn})),r.d(c,"equals",(function(){return mn})),r.d(c,"sub",(function(){return bn})),r.d(c,"mul",(function(){return gn})),r.d(c,"div",(function(){return wn})),r.d(c,"dist",(function(){return vn})),r.d(c,"sqrDist",(function(){return yn})),r.d(c,"len",(function(){return Mn})),r.d(c,"sqrLen",(function(){return kn})),r.d(c,"forEach",(function(){return xn}));var _={};r.r(_),r.d(_,"create",(function(){return En})),r.d(_,"identity",(function(){return An})),r.d(_,"setAxisAngle",(function(){return zn})),r.d(_,"getAxisAngle",(function(){return Tn})),r.d(_,"getAngle",(function(){return Rn})),r.d(_,"multiply",(function(){return Fn})),r.d(_,"rotateX",(function(){return On})),r.d(_,"rotateY",(function(){return Pn})),r.d(_,"rotateZ",(function(){return Ln})),r.d(_,"calculateW",(function(){return Sn})),r.d(_,"exp",(function(){return In})),r.d(_,"ln",(function(){return Dn})),r.d(_,"pow",(function(){return Bn})),r.d(_,"slerp",(function(){return Cn})),r.d(_,"random",(function(){return Un})),r.d(_,"invert",(function(){return Vn})),r.d(_,"conjugate",(function(){return qn})),r.d(_,"fromMat3",(function(){return Nn})),r.d(_,"fromEuler",(function(){return jn})),r.d(_,"str",(function(){return Wn})),r.d(_,"clone",(function(){return Jn})),r.d(_,"fromValues",(function(){return $n})),r.d(_,"copy",(function(){return Qn})),r.d(_,"set",(function(){return ea})),r.d(_,"add",(function(){return ta})),r.d(_,"mul",(function(){return ra})),r.d(_,"scale",(function(){return na})),r.d(_,"dot",(function(){return aa})),r.d(_,"lerp",(function(){return ia})),r.d(_,"length",(function(){return oa})),r.d(_,"len",(function(){return sa})),r.d(_,"squaredLength",(function(){return ua})),r.d(_,"sqrLen",(function(){return ca})),r.d(_,"normalize",(function(){return _a})),r.d(_,"exactEquals",(function(){return fa})),r.d(_,"equals",(function(){return la})),r.d(_,"rotationTo",(function(){return da})),r.d(_,"sqlerp",(function(){return pa})),r.d(_,"setAxes",(function(){return ha}));var f={};r.r(f),r.d(f,"create",(function(){return ma})),r.d(f,"clone",(function(){return ba})),r.d(f,"fromValues",(function(){return ga})),r.d(f,"fromRotationTranslationValues",(function(){return wa})),r.d(f,"fromRotationTranslation",(function(){return va})),r.d(f,"fromTranslation",(function(){return ya})),r.d(f,"fromRotation",(function(){return Ma})),r.d(f,"fromMat4",(function(){return ka})),r.d(f,"copy",(function(){return xa})),r.d(f,"identity",(function(){return Ea})),r.d(f,"set",(function(){return Aa})),r.d(f,"getReal",(function(){return za})),r.d(f,"getDual",(function(){return Ta})),r.d(f,"setReal",(function(){return Ra})),r.d(f,"setDual",(function(){return Fa})),r.d(f,"getTranslation",(function(){return Oa})),r.d(f,"translate",(function(){return Pa})),r.d(f,"rotateX",(function(){return La})),r.d(f,"rotateY",(function(){return Sa})),r.d(f,"rotateZ",(function(){return Ia})),r.d(f,"rotateByQuatAppend",(function(){return Da})),r.d(f,"rotateByQuatPrepend",(function(){return Ba})),r.d(f,"rotateAroundAxis",(function(){return Ca})),r.d(f,"add",(function(){return Ua})),r.d(f,"multiply",(function(){return Va})),r.d(f,"mul",(function(){return qa})),r.d(f,"scale",(function(){return Na})),r.d(f,"dot",(function(){return ja})),r.d(f,"lerp",(function(){return Wa})),r.d(f,"invert",(function(){return Ha})),r.d(f,"conjugate",(function(){return Ga})),r.d(f,"length",(function(){return Xa})),r.d(f,"len",(function(){return Ya})),r.d(f,"squaredLength",(function(){return Za})),r.d(f,"sqrLen",(function(){return Ka})),r.d(f,"normalize",(function(){return Ja})),r.d(f,"str",(function(){return $a})),r.d(f,"exactEquals",(function(){return Qa})),r.d(f,"equals",(function(){return ei}));var l={};r.r(l),r.d(l,"create",(function(){return ti})),r.d(l,"clone",(function(){return ri})),r.d(l,"fromValues",(function(){return ni})),r.d(l,"copy",(function(){return ai})),r.d(l,"set",(function(){return ii})),r.d(l,"add",(function(){return oi})),r.d(l,"subtract",(function(){return si})),r.d(l,"multiply",(function(){return ui})),r.d(l,"divide",(function(){return ci})),r.d(l,"ceil",(function(){return _i})),r.d(l,"floor",(function(){return fi})),r.d(l,"min",(function(){return li})),r.d(l,"max",(function(){return di})),r.d(l,"round",(function(){return pi})),r.d(l,"scale",(function(){return hi})),r.d(l,"scaleAndAdd",(function(){return mi})),r.d(l,"distance",(function(){return bi})),r.d(l,"squaredDistance",(function(){return gi})),r.d(l,"length",(function(){return wi})),r.d(l,"squaredLength",(function(){return vi})),r.d(l,"negate",(function(){return yi})),r.d(l,"inverse",(function(){return Mi})),r.d(l,"normalize",(function(){return ki})),r.d(l,"dot",(function(){return xi})),r.d(l,"cross",(function(){return Ei})),r.d(l,"lerp",(function(){return Ai})),r.d(l,"random",(function(){return zi})),r.d(l,"transformMat2",(function(){return Ti})),r.d(l,"transformMat2d",(function(){return Ri})),r.d(l,"transformMat3",(function(){return Fi})),r.d(l,"transformMat4",(function(){return Oi})),r.d(l,"rotate",(function(){return Pi})),r.d(l,"angle",(function(){return Li})),r.d(l,"zero",(function(){return Si})),r.d(l,"str",(function(){return Ii})),r.d(l,"exactEquals",(function(){return Di})),r.d(l,"equals",(function(){return Bi})),r.d(l,"len",(function(){return Ci})),r.d(l,"sub",(function(){return Ui})),r.d(l,"mul",(function(){return Vi})),r.d(l,"div",(function(){return qi})),r.d(l,"dist",(function(){return Ni})),r.d(l,"sqrDist",(function(){return ji})),r.d(l,"sqrLen",(function(){return Wi})),r.d(l,"forEach",(function(){return Hi}));var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,h=Math.random;function m(e){p=e}var b=Math.PI/180;function g(e){return e*b}function w(e,t){return Math.abs(e-t)<=d*Math.max(1,Math.abs(e),Math.abs(t))}function v(){var e=new p(4);return p!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function y(e){var t=new p(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function M(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function k(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function x(e,t,r,n){var a=new p(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a}function E(e,t,r,n,a){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e}function A(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function z(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r*i-a*n;return o?(o=1/o,e[0]=i*o,e[1]=-n*o,e[2]=-a*o,e[3]=r*o,e):null}function T(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e}function R(e){return e[0]*e[3]-e[2]*e[1]}function F(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],u=r[1],c=r[2],_=r[3];return e[0]=n*s+i*u,e[1]=a*s+o*u,e[2]=n*c+i*_,e[3]=a*c+o*_,e}function O(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=a*u+o*s,e[2]=n*-s+i*u,e[3]=a*-s+o*u,e}function P(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],u=r[1];return e[0]=n*s,e[1]=a*s,e[2]=i*u,e[3]=o*u,e}function L(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e}function S(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function I(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function D(e){return Math.hypot(e[0],e[1],e[2],e[3])}function B(e,t,r,n){return e[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-e[2]*r[1],[e,t,r]}function C(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function U(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function V(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function q(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=t[0],s=t[1],u=t[2],c=t[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(a-u)<=d*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))}function N(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function j(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var W=F,H=U;function G(){var e=new p(6);return p!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e}function X(e){var t=new p(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Z(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function K(e,t,r,n,a,i){var o=new p(6);return o[0]=e,o[1]=t,o[2]=r,o[3]=n,o[4]=a,o[5]=i,o}function J(e,t,r,n,a,i,o){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=i,e[5]=o,e}function $(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=r*i-n*a;return u?(u=1/u,e[0]=i*u,e[1]=-n*u,e[2]=-a*u,e[3]=r*u,e[4]=(a*s-i*o)*u,e[5]=(n*o-r*s)*u,e):null}function Q(e){return e[0]*e[3]-e[1]*e[2]}function ee(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=r[0],_=r[1],f=r[2],l=r[3],d=r[4],p=r[5];return e[0]=n*c+i*_,e[1]=a*c+o*_,e[2]=n*f+i*l,e[3]=a*f+o*l,e[4]=n*d+i*p+s,e[5]=a*d+o*p+u,e}function te(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=Math.sin(r),_=Math.cos(r);return e[0]=n*_+i*c,e[1]=a*_+o*c,e[2]=n*-c+i*_,e[3]=a*-c+o*_,e[4]=s,e[5]=u,e}function re(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=r[0],_=r[1];return e[0]=n*c,e[1]=a*c,e[2]=i*_,e[3]=o*_,e[4]=s,e[5]=u,e}function ne(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=r[0],_=r[1];return e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=n*c+i*_+s,e[5]=a*c+o*_+u,e}function ae(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e[4]=0,e[5]=0,e}function ie(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function oe(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function se(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function ue(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)}function ce(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e}function _e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e}function fe(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e}function le(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e}function de(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function pe(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],u=t[0],c=t[1],_=t[2],f=t[3],l=t[4],p=t[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=d*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(a-_)<=d*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-l)<=d*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var he=ee,me=_e;function be(){var e=new p(9);return p!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function we(e){var t=new p(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ve(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ye(e,t,r,n,a,i,o,s,u){var c=new p(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=a,c[5]=i,c[6]=o,c[7]=s,c[8]=u,c}function Me(e,t,r,n,a,i,o,s,u,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=i,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e}function ke(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function xe(e,t){if(e===t){var r=t[1],n=t[2],a=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=a}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Ee(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],_=t[8],f=_*o-s*c,l=-_*i+s*u,d=c*i-o*u,p=r*f+n*l+a*d;return p?(p=1/p,e[0]=f*p,e[1]=(-_*n+a*c)*p,e[2]=(s*n-a*o)*p,e[3]=l*p,e[4]=(_*r-a*u)*p,e[5]=(-s*r+a*i)*p,e[6]=d*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*i)*p,e):null}function Ae(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],_=t[8];return e[0]=o*_-s*c,e[1]=a*c-n*_,e[2]=n*s-a*o,e[3]=s*u-i*_,e[4]=r*_-a*u,e[5]=a*i-r*s,e[6]=i*c-o*u,e[7]=n*u-r*c,e[8]=r*o-n*i,e}function ze(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*i-o*u)+r*(-c*a+o*s)+n*(u*a-i*s)}function Te(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=t[8],l=r[0],d=r[1],p=r[2],h=r[3],m=r[4],b=r[5],g=r[6],w=r[7],v=r[8];return e[0]=l*n+d*o+p*c,e[1]=l*a+d*s+p*_,e[2]=l*i+d*u+p*f,e[3]=h*n+m*o+b*c,e[4]=h*a+m*s+b*_,e[5]=h*i+m*u+b*f,e[6]=g*n+w*o+v*c,e[7]=g*a+w*s+v*_,e[8]=g*i+w*u+v*f,e}function Re(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=s,e[5]=u,e[6]=l*n+d*o+c,e[7]=l*a+d*s+_,e[8]=l*i+d*u+f,e}function Fe(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*o,e[1]=d*a+l*s,e[2]=d*i+l*u,e[3]=d*o-l*n,e[4]=d*s-l*a,e[5]=d*u-l*i,e[6]=c,e[7]=_,e[8]=f,e}function Oe(e,t,r){var n=r[0],a=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Pe(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Le(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Se(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Ie(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function De(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,s=n+n,u=a+a,c=r*o,_=n*o,f=n*s,l=a*o,d=a*s,p=a*u,h=i*o,m=i*s,b=i*u;return e[0]=1-f-p,e[3]=_-b,e[6]=l+m,e[1]=_+b,e[4]=1-c-p,e[7]=d-h,e[2]=l-m,e[5]=d+h,e[8]=1-c-f,e}function Be(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],_=t[8],f=t[9],l=t[10],d=t[11],p=t[12],h=t[13],m=t[14],b=t[15],g=r*s-n*o,w=r*u-a*o,v=r*c-i*o,y=n*u-a*s,M=n*c-i*s,k=a*c-i*u,x=_*h-f*p,E=_*m-l*p,A=_*b-d*p,z=f*m-l*h,T=f*b-d*h,R=l*b-d*m,F=g*R-w*T+v*z+y*A-M*E+k*x;return F?(F=1/F,e[0]=(s*R-u*T+c*z)*F,e[1]=(u*A-o*R-c*E)*F,e[2]=(o*T-s*A+c*x)*F,e[3]=(a*T-n*R-i*z)*F,e[4]=(r*R-a*A+i*E)*F,e[5]=(n*A-r*T-i*x)*F,e[6]=(h*k-m*M+b*y)*F,e[7]=(m*v-p*k-b*w)*F,e[8]=(p*M-h*v+b*g)*F,e):null}function Ce(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Ue(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Ve(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function qe(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e}function Ne(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function je(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}function We(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e}function He(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function Ge(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],_=e[8],f=t[0],l=t[1],p=t[2],h=t[3],m=t[4],b=t[5],g=t[6],w=t[7],v=t[8];return Math.abs(r-f)<=d*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-b)<=d*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(u-g)<=d*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(_-v)<=d*Math.max(1,Math.abs(_),Math.abs(v))}var Xe=Te,Ye=Ne;function Ze(){var e=new p(16);return p!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Ke(e){var t=new p(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Je(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function $e(e,t,r,n,a,i,o,s,u,c,_,f,l,d,h,m){var b=new p(16);return b[0]=e,b[1]=t,b[2]=r,b[3]=n,b[4]=a,b[5]=i,b[6]=o,b[7]=s,b[8]=u,b[9]=c,b[10]=_,b[11]=f,b[12]=l,b[13]=d,b[14]=h,b[15]=m,b}function Qe(e,t,r,n,a,i,o,s,u,c,_,f,l,d,p,h,m){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=i,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=_,e[10]=f,e[11]=l,e[12]=d,e[13]=p,e[14]=h,e[15]=m,e}function et(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function tt(e,t){if(e===t){var r=t[1],n=t[2],a=t[3],i=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function rt(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],_=t[8],f=t[9],l=t[10],d=t[11],p=t[12],h=t[13],m=t[14],b=t[15],g=r*s-n*o,w=r*u-a*o,v=r*c-i*o,y=n*u-a*s,M=n*c-i*s,k=a*c-i*u,x=_*h-f*p,E=_*m-l*p,A=_*b-d*p,z=f*m-l*h,T=f*b-d*h,R=l*b-d*m,F=g*R-w*T+v*z+y*A-M*E+k*x;return F?(F=1/F,e[0]=(s*R-u*T+c*z)*F,e[1]=(a*T-n*R-i*z)*F,e[2]=(h*k-m*M+b*y)*F,e[3]=(l*M-f*k-d*y)*F,e[4]=(u*A-o*R-c*E)*F,e[5]=(r*R-a*A+i*E)*F,e[6]=(m*v-p*k-b*w)*F,e[7]=(_*k-l*v+d*w)*F,e[8]=(o*T-s*A+c*x)*F,e[9]=(n*A-r*T-i*x)*F,e[10]=(p*M-h*v+b*g)*F,e[11]=(f*v-_*M-d*g)*F,e[12]=(s*E-o*z-u*x)*F,e[13]=(r*z-n*E+a*x)*F,e[14]=(h*w-p*y-m*g)*F,e[15]=(_*y-f*w+l*g)*F,e):null}function nt(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],_=t[8],f=t[9],l=t[10],d=t[11],p=t[12],h=t[13],m=t[14],b=t[15];return e[0]=s*(l*b-d*m)-f*(u*b-c*m)+h*(u*d-c*l),e[1]=-(n*(l*b-d*m)-f*(a*b-i*m)+h*(a*d-i*l)),e[2]=n*(u*b-c*m)-s*(a*b-i*m)+h*(a*c-i*u),e[3]=-(n*(u*d-c*l)-s*(a*d-i*l)+f*(a*c-i*u)),e[4]=-(o*(l*b-d*m)-_*(u*b-c*m)+p*(u*d-c*l)),e[5]=r*(l*b-d*m)-_*(a*b-i*m)+p*(a*d-i*l),e[6]=-(r*(u*b-c*m)-o*(a*b-i*m)+p*(a*c-i*u)),e[7]=r*(u*d-c*l)-o*(a*d-i*l)+_*(a*c-i*u),e[8]=o*(f*b-d*h)-_*(s*b-c*h)+p*(s*d-c*f),e[9]=-(r*(f*b-d*h)-_*(n*b-i*h)+p*(n*d-i*f)),e[10]=r*(s*b-c*h)-o*(n*b-i*h)+p*(n*c-i*s),e[11]=-(r*(s*d-c*f)-o*(n*d-i*f)+_*(n*c-i*s)),e[12]=-(o*(f*m-l*h)-_*(s*m-u*h)+p*(s*l-u*f)),e[13]=r*(f*m-l*h)-_*(n*m-a*h)+p*(n*l-a*f),e[14]=-(r*(s*m-u*h)-o*(n*m-a*h)+p*(n*u-a*s)),e[15]=r*(s*l-u*f)-o*(n*l-a*f)+_*(n*u-a*s),e}function at(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],s=e[6],u=e[7],c=e[8],_=e[9],f=e[10],l=e[11],d=e[12],p=e[13],h=e[14],m=e[15];return(t*o-r*i)*(f*m-l*h)-(t*s-n*i)*(_*m-l*p)+(t*u-a*i)*(_*h-f*p)+(r*s-n*o)*(c*m-l*d)-(r*u-a*o)*(c*h-f*d)+(n*u-a*s)*(c*p-_*d)}function it(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=t[8],l=t[9],d=t[10],p=t[11],h=t[12],m=t[13],b=t[14],g=t[15],w=r[0],v=r[1],y=r[2],M=r[3];return e[0]=w*n+v*s+y*f+M*h,e[1]=w*a+v*u+y*l+M*m,e[2]=w*i+v*c+y*d+M*b,e[3]=w*o+v*_+y*p+M*g,w=r[4],v=r[5],y=r[6],M=r[7],e[4]=w*n+v*s+y*f+M*h,e[5]=w*a+v*u+y*l+M*m,e[6]=w*i+v*c+y*d+M*b,e[7]=w*o+v*_+y*p+M*g,w=r[8],v=r[9],y=r[10],M=r[11],e[8]=w*n+v*s+y*f+M*h,e[9]=w*a+v*u+y*l+M*m,e[10]=w*i+v*c+y*d+M*b,e[11]=w*o+v*_+y*p+M*g,w=r[12],v=r[13],y=r[14],M=r[15],e[12]=w*n+v*s+y*f+M*h,e[13]=w*a+v*u+y*l+M*m,e[14]=w*i+v*c+y*d+M*b,e[15]=w*o+v*_+y*p+M*g,e}function ot(e,t,r){var n,a,i,o,s,u,c,_,f,l,d,p,h=r[0],m=r[1],b=r[2];return t===e?(e[12]=t[0]*h+t[4]*m+t[8]*b+t[12],e[13]=t[1]*h+t[5]*m+t[9]*b+t[13],e[14]=t[2]*h+t[6]*m+t[10]*b+t[14],e[15]=t[3]*h+t[7]*m+t[11]*b+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=t[8],l=t[9],d=t[10],p=t[11],e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=_,e[8]=f,e[9]=l,e[10]=d,e[11]=p,e[12]=n*h+s*m+f*b+t[12],e[13]=a*h+u*m+l*b+t[13],e[14]=i*h+c*m+d*b+t[14],e[15]=o*h+_*m+p*b+t[15]),e}function st(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ut(e,t,r,n){var a,i,o,s,u,c,_,f,l,p,h,m,b,g,w,v,y,M,k,x,E,A,z,T,R=n[0],F=n[1],O=n[2],P=Math.hypot(R,F,O);return P<d?null:(R*=P=1/P,F*=P,O*=P,a=Math.sin(r),o=1-(i=Math.cos(r)),s=t[0],u=t[1],c=t[2],_=t[3],f=t[4],l=t[5],p=t[6],h=t[7],m=t[8],b=t[9],g=t[10],w=t[11],v=R*R*o+i,y=F*R*o+O*a,M=O*R*o-F*a,k=R*F*o-O*a,x=F*F*o+i,E=O*F*o+R*a,A=R*O*o+F*a,z=F*O*o-R*a,T=O*O*o+i,e[0]=s*v+f*y+m*M,e[1]=u*v+l*y+b*M,e[2]=c*v+p*y+g*M,e[3]=_*v+h*y+w*M,e[4]=s*k+f*x+m*E,e[5]=u*k+l*x+b*E,e[6]=c*k+p*x+g*E,e[7]=_*k+h*x+w*E,e[8]=s*A+f*z+m*T,e[9]=u*A+l*z+b*T,e[10]=c*A+p*z+g*T,e[11]=_*A+h*z+w*T,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ct(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],s=t[6],u=t[7],c=t[8],_=t[9],f=t[10],l=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*a+c*n,e[5]=o*a+_*n,e[6]=s*a+f*n,e[7]=u*a+l*n,e[8]=c*a-i*n,e[9]=_*a-o*n,e[10]=f*a-s*n,e[11]=l*a-u*n,e}function _t(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],u=t[3],c=t[8],_=t[9],f=t[10],l=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a-c*n,e[1]=o*a-_*n,e[2]=s*a-f*n,e[3]=u*a-l*n,e[8]=i*n+c*a,e[9]=o*n+_*a,e[10]=s*n+f*a,e[11]=u*n+l*a,e}function ft(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],u=t[3],c=t[4],_=t[5],f=t[6],l=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a+c*n,e[1]=o*a+_*n,e[2]=s*a+f*n,e[3]=u*a+l*n,e[4]=c*a-i*n,e[5]=_*a-o*n,e[6]=f*a-s*n,e[7]=l*a-u*n,e}function lt(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function dt(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function pt(e,t,r){var n,a,i,o=r[0],s=r[1],u=r[2],c=Math.hypot(o,s,u);return c<d?null:(o*=c=1/c,s*=c,u*=c,n=Math.sin(t),i=1-(a=Math.cos(t)),e[0]=o*o*i+a,e[1]=s*o*i+u*n,e[2]=u*o*i-s*n,e[3]=0,e[4]=o*s*i-u*n,e[5]=s*s*i+a,e[6]=u*s*i+o*n,e[7]=0,e[8]=o*u*i+s*n,e[9]=s*u*i-o*n,e[10]=u*u*i+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function ht(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function mt(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function bt(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function gt(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=n+n,u=a+a,c=i+i,_=n*s,f=n*u,l=n*c,d=a*u,p=a*c,h=i*c,m=o*s,b=o*u,g=o*c;return e[0]=1-(d+h),e[1]=f+g,e[2]=l-b,e[3]=0,e[4]=f-g,e[5]=1-(_+h),e[6]=p+m,e[7]=0,e[8]=l+b,e[9]=p-m,e[10]=1-(_+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function wt(e,t){var r=new p(3),n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=n*n+a*a+i*i+o*o;return f>0?(r[0]=2*(s*o+_*n+u*i-c*a)/f,r[1]=2*(u*o+_*a+c*n-s*i)/f,r[2]=2*(c*o+_*i+s*a-u*n)/f):(r[0]=2*(s*o+_*n+u*i-c*a),r[1]=2*(u*o+_*a+c*n-s*i),r[2]=2*(c*o+_*i+s*a-u*n)),gt(e,t,r),e}function vt(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function yt(e,t){var r=t[0],n=t[1],a=t[2],i=t[4],o=t[5],s=t[6],u=t[8],c=t[9],_=t[10];return e[0]=Math.hypot(r,n,a),e[1]=Math.hypot(i,o,s),e[2]=Math.hypot(u,c,_),e}function Mt(e,t){var r=new p(3);yt(r,t);var n=1/r[0],a=1/r[1],i=1/r[2],o=t[0]*n,s=t[1]*a,u=t[2]*i,c=t[4]*n,_=t[5]*a,f=t[6]*i,l=t[8]*n,d=t[9]*a,h=t[10]*i,m=o+_+h,b=0;return m>0?(b=2*Math.sqrt(m+1),e[3]=.25*b,e[0]=(f-d)/b,e[1]=(l-u)/b,e[2]=(s-c)/b):o>_&&o>h?(b=2*Math.sqrt(1+o-_-h),e[3]=(f-d)/b,e[0]=.25*b,e[1]=(s+c)/b,e[2]=(l+u)/b):_>h?(b=2*Math.sqrt(1+_-o-h),e[3]=(l-u)/b,e[0]=(s+c)/b,e[1]=.25*b,e[2]=(f+d)/b):(b=2*Math.sqrt(1+h-o-_),e[3]=(s-c)/b,e[0]=(l+u)/b,e[1]=(f+d)/b,e[2]=.25*b),e}function kt(e,t,r,n){var a=t[0],i=t[1],o=t[2],s=t[3],u=a+a,c=i+i,_=o+o,f=a*u,l=a*c,d=a*_,p=i*c,h=i*_,m=o*_,b=s*u,g=s*c,w=s*_,v=n[0],y=n[1],M=n[2];return e[0]=(1-(p+m))*v,e[1]=(l+w)*v,e[2]=(d-g)*v,e[3]=0,e[4]=(l-w)*y,e[5]=(1-(f+m))*y,e[6]=(h+b)*y,e[7]=0,e[8]=(d+g)*M,e[9]=(h-b)*M,e[10]=(1-(f+p))*M,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function xt(e,t,r,n,a){var i=t[0],o=t[1],s=t[2],u=t[3],c=i+i,_=o+o,f=s+s,l=i*c,d=i*_,p=i*f,h=o*_,m=o*f,b=s*f,g=u*c,w=u*_,v=u*f,y=n[0],M=n[1],k=n[2],x=a[0],E=a[1],A=a[2],z=(1-(h+b))*y,T=(d+v)*y,R=(p-w)*y,F=(d-v)*M,O=(1-(l+b))*M,P=(m+g)*M,L=(p+w)*k,S=(m-g)*k,I=(1-(l+h))*k;return e[0]=z,e[1]=T,e[2]=R,e[3]=0,e[4]=F,e[5]=O,e[6]=P,e[7]=0,e[8]=L,e[9]=S,e[10]=I,e[11]=0,e[12]=r[0]+x-(z*x+F*E+L*A),e[13]=r[1]+E-(T*x+O*E+S*A),e[14]=r[2]+A-(R*x+P*E+I*A),e[15]=1,e}function Et(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,s=n+n,u=a+a,c=r*o,_=n*o,f=n*s,l=a*o,d=a*s,p=a*u,h=i*o,m=i*s,b=i*u;return e[0]=1-f-p,e[1]=_+b,e[2]=l-m,e[3]=0,e[4]=_-b,e[5]=1-c-p,e[6]=d+h,e[7]=0,e[8]=l+m,e[9]=d-h,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function At(e,t,r,n,a,i,o){var s=1/(r-t),u=1/(a-n),c=1/(i-o);return e[0]=2*i*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*u,e[10]=(o+i)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*c,e[15]=0,e}function zt(e,t,r,n,a){var i,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(i=1/(n-a),e[10]=(a+n)*i,e[14]=2*a*n*i):(e[10]=-1,e[14]=-2*n),e}function Tt(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(a+i);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-s)*u*.5,e[9]=(a-i)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function Rt(e,t,r,n,a,i,o){var s=1/(t-r),u=1/(n-a),c=1/(i-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*u,e[14]=(o+i)*c,e[15]=1,e}function Ft(e,t,r,n){var a,i,o,s,u,c,_,f,l,p,h=t[0],m=t[1],b=t[2],g=n[0],w=n[1],v=n[2],y=r[0],M=r[1],k=r[2];return Math.abs(h-y)<d&&Math.abs(m-M)<d&&Math.abs(b-k)<d?et(e):(_=h-y,f=m-M,l=b-k,a=w*(l*=p=1/Math.hypot(_,f,l))-v*(f*=p),i=v*(_*=p)-g*l,o=g*f-w*_,(p=Math.hypot(a,i,o))?(a*=p=1/p,i*=p,o*=p):(a=0,i=0,o=0),s=f*o-l*i,u=l*a-_*o,c=_*i-f*a,(p=Math.hypot(s,u,c))?(s*=p=1/p,u*=p,c*=p):(s=0,u=0,c=0),e[0]=a,e[1]=s,e[2]=_,e[3]=0,e[4]=i,e[5]=u,e[6]=f,e[7]=0,e[8]=o,e[9]=c,e[10]=l,e[11]=0,e[12]=-(a*h+i*m+o*b),e[13]=-(s*h+u*m+c*b),e[14]=-(_*h+f*m+l*b),e[15]=1,e)}function Ot(e,t,r,n){var a=t[0],i=t[1],o=t[2],s=n[0],u=n[1],c=n[2],_=a-r[0],f=i-r[1],l=o-r[2],d=_*_+f*f+l*l;d>0&&(_*=d=1/Math.sqrt(d),f*=d,l*=d);var p=u*l-c*f,h=c*_-s*l,m=s*f-u*_;return(d=p*p+h*h+m*m)>0&&(p*=d=1/Math.sqrt(d),h*=d,m*=d),e[0]=p,e[1]=h,e[2]=m,e[3]=0,e[4]=f*m-l*h,e[5]=l*p-_*m,e[6]=_*h-f*p,e[7]=0,e[8]=_,e[9]=f,e[10]=l,e[11]=0,e[12]=a,e[13]=i,e[14]=o,e[15]=1,e}function Pt(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Lt(e){return Math.hypot(e[0],e[1],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function St(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function It(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function Dt(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function Bt(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function Ct(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Ut(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],_=e[8],f=e[9],l=e[10],p=e[11],h=e[12],m=e[13],b=e[14],g=e[15],w=t[0],v=t[1],y=t[2],M=t[3],k=t[4],x=t[5],E=t[6],A=t[7],z=t[8],T=t[9],R=t[10],F=t[11],O=t[12],P=t[13],L=t[14],S=t[15];return Math.abs(r-w)<=d*Math.max(1,Math.abs(r),Math.abs(w))&&Math.abs(n-v)<=d*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(a-y)<=d*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(o-k)<=d*Math.max(1,Math.abs(o),Math.abs(k))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(u-E)<=d*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-A)<=d*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(_-z)<=d*Math.max(1,Math.abs(_),Math.abs(z))&&Math.abs(f-T)<=d*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(l-R)<=d*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(p-F)<=d*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(h-O)<=d*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(m-P)<=d*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(b-L)<=d*Math.max(1,Math.abs(b),Math.abs(L))&&Math.abs(g-S)<=d*Math.max(1,Math.abs(g),Math.abs(S))}var Vt=it,qt=It;function Nt(){var e=new p(3);return p!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function jt(e){var t=new p(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Wt(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function Ht(e,t,r){var n=new p(3);return n[0]=e,n[1]=t,n[2]=r,n}function Gt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Xt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function Yt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Zt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Kt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Jt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function $t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Qt(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function er(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function tr(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function rr(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function nr(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function ar(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function ir(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2];return Math.hypot(r,n,a)}function or(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2];return r*r+n*n+a*a}function sr(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function ur(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function cr(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function _r(e,t){var r=t[0],n=t[1],a=t[2],i=r*r+n*n+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function fr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function lr(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[0],s=r[1],u=r[2];return e[0]=a*u-i*s,e[1]=i*o-n*u,e[2]=n*s-a*o,e}function dr(e,t,r,n){var a=t[0],i=t[1],o=t[2];return e[0]=a+n*(r[0]-a),e[1]=i+n*(r[1]-i),e[2]=o+n*(r[2]-o),e}function pr(e,t,r,n,a,i){var o=i*i,s=o*(2*i-3)+1,u=o*(i-2)+i,c=o*(i-1),_=o*(3-2*i);return e[0]=t[0]*s+r[0]*u+n[0]*c+a[0]*_,e[1]=t[1]*s+r[1]*u+n[1]*c+a[1]*_,e[2]=t[2]*s+r[2]*u+n[2]*c+a[2]*_,e}function hr(e,t,r,n,a,i){var o=1-i,s=o*o,u=i*i,c=s*o,_=3*i*s,f=3*u*o,l=u*i;return e[0]=t[0]*c+r[0]*_+n[0]*f+a[0]*l,e[1]=t[1]*c+r[1]*_+n[1]*f+a[1]*l,e[2]=t[2]*c+r[2]*_+n[2]*f+a[2]*l,e}function mr(e,t){t=t||1;var r=2*h()*Math.PI,n=2*h()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*a,e[1]=Math.sin(r)*a,e[2]=n*t,e}function br(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[3]*n+r[7]*a+r[11]*i+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/o,e[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/o,e[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/o,e}function gr(e,t,r){var n=t[0],a=t[1],i=t[2];return e[0]=n*r[0]+a*r[3]+i*r[6],e[1]=n*r[1]+a*r[4]+i*r[7],e[2]=n*r[2]+a*r[5]+i*r[8],e}function wr(e,t,r){var n=r[0],a=r[1],i=r[2],o=r[3],s=t[0],u=t[1],c=t[2],_=a*c-i*u,f=i*s-n*c,l=n*u-a*s,d=a*l-i*f,p=i*_-n*l,h=n*f-a*_,m=2*o;return _*=m,f*=m,l*=m,d*=2,p*=2,h*=2,e[0]=s+_+d,e[1]=u+f+p,e[2]=c+l+h,e}function vr(e,t,r,n){var a=[],i=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],i[0]=a[0],i[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),i[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),e[0]=i[0]+r[0],e[1]=i[1]+r[1],e[2]=i[2]+r[2],e}function yr(e,t,r,n){var a=[],i=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],i[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),i[1]=a[1],i[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),e[0]=i[0]+r[0],e[1]=i[1]+r[1],e[2]=i[2]+r[2],e}function Mr(e,t,r,n){var a=[],i=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],i[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),i[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),i[2]=a[2],e[0]=i[0]+r[0],e[1]=i[1]+r[1],e[2]=i[2]+r[2],e}function kr(e,t){var r=Ht(e[0],e[1],e[2]),n=Ht(t[0],t[1],t[2]);_r(r,r),_r(n,n);var a=fr(r,n);return a>1?0:a<-1?Math.PI:Math.acos(a)}function xr(e){return e[0]=0,e[1]=0,e[2]=0,e}function Er(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Ar(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function zr(e,t){var r=e[0],n=e[1],a=e[2],i=t[0],o=t[1],s=t[2];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(a-s)<=d*Math.max(1,Math.abs(a),Math.abs(s))}var Tr,Rr=Zt,Fr=Kt,Or=Jt,Pr=ir,Lr=or,Sr=Wt,Ir=sr,Dr=(Tr=Nt(),function(e,t,r,n,a,i){var o,s;for(t||(t=3),r||(r=0),s=n?Math.min(n*t+r,e.length):e.length,o=r;o<s;o+=t)Tr[0]=e[o],Tr[1]=e[o+1],Tr[2]=e[o+2],a(Tr,Tr,i),e[o]=Tr[0],e[o+1]=Tr[1],e[o+2]=Tr[2];return e});function Br(){var e=new p(4);return p!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Cr(e){var t=new p(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Ur(e,t,r,n){var a=new p(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a}function Vr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function qr(e,t,r,n,a){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e}function Nr(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function jr(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function Wr(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function Hr(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Gr(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function Xr(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function Yr(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function Zr(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function Kr(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function Jr(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function $r(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}function Qr(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2],i=t[3]-e[3];return Math.hypot(r,n,a,i)}function en(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2],i=t[3]-e[3];return r*r+n*n+a*a+i*i}function tn(e){var t=e[0],r=e[1],n=e[2],a=e[3];return Math.hypot(t,r,n,a)}function rn(e){var t=e[0],r=e[1],n=e[2],a=e[3];return t*t+r*r+n*n+a*a}function nn(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function an(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function on(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r*r+n*n+a*a+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=a*o,e[3]=i*o,e}function sn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function un(e,t,r,n){var a=r[0]*n[1]-r[1]*n[0],i=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],_=t[0],f=t[1],l=t[2],d=t[3];return e[0]=f*c-l*u+d*s,e[1]=-_*c+l*o-d*i,e[2]=_*u-f*o+d*a,e[3]=-_*s+f*i-l*a,e}function cn(e,t,r,n){var a=t[0],i=t[1],o=t[2],s=t[3];return e[0]=a+n*(r[0]-a),e[1]=i+n*(r[1]-i),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function _n(e,t){var r,n,a,i,o,s;t=t||1;do{o=(r=2*h()-1)*r+(n=2*h()-1)*n}while(o>=1);do{s=(a=2*h()-1)*a+(i=2*h()-1)*i}while(s>=1);var u=Math.sqrt((1-o)/s);return e[0]=t*r,e[1]=t*n,e[2]=t*a*u,e[3]=t*i*u,e}function fn(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,e[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,e[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,e[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,e}function ln(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[0],s=r[1],u=r[2],c=r[3],_=c*n+s*i-u*a,f=c*a+u*n-o*i,l=c*i+o*a-s*n,d=-o*n-s*a-u*i;return e[0]=_*c+d*-o+f*-u-l*-s,e[1]=f*c+d*-s+l*-o-_*-u,e[2]=l*c+d*-u+_*-s-f*-o,e[3]=t[3],e}function dn(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function pn(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function hn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function mn(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=t[0],s=t[1],u=t[2],c=t[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(a-u)<=d*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))}var bn=jr,gn=Wr,wn=Hr,vn=Qr,yn=en,Mn=tn,kn=rn,xn=function(){var e=Br();return function(t,r,n,a,i,o){var s,u;for(r||(r=4),n||(n=0),u=a?Math.min(a*r+n,t.length):t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],i(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();function En(){var e=new p(4);return p!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function An(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function zn(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Tn(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>d?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r}function Rn(e,t){var r=aa(e,t);return Math.acos(2*r*r-1)}function Fn(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],u=r[1],c=r[2],_=r[3];return e[0]=n*_+o*s+a*c-i*u,e[1]=a*_+o*u+i*s-n*c,e[2]=i*_+o*c+n*u-a*s,e[3]=o*_-n*s-a*u-i*c,e}function On(e,t,r){r*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=a*u+i*s,e[2]=i*u-a*s,e[3]=o*u-n*s,e}function Pn(e,t,r){r*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-i*s,e[1]=a*u+o*s,e[2]=i*u+n*s,e[3]=o*u-a*s,e}function Ln(e,t,r){r*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+a*s,e[1]=a*u-n*s,e[2]=i*u+o*s,e[3]=o*u-i*s,e}function Sn(e,t){var r=t[0],n=t[1],a=t[2];return e[0]=r,e[1]=n,e[2]=a,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-a*a)),e}function In(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=Math.sqrt(r*r+n*n+a*a),s=Math.exp(i),u=o>0?s*Math.sin(o)/o:0;return e[0]=r*u,e[1]=n*u,e[2]=a*u,e[3]=s*Math.cos(o),e}function Dn(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=Math.sqrt(r*r+n*n+a*a),s=o>0?Math.atan2(o,i)/o:0;return e[0]=r*s,e[1]=n*s,e[2]=a*s,e[3]=.5*Math.log(r*r+n*n+a*a+i*i),e}function Bn(e,t,r){return Dn(e,t),na(e,e,r),In(e,e),e}function Cn(e,t,r,n){var a,i,o,s,u,c=t[0],_=t[1],f=t[2],l=t[3],p=r[0],h=r[1],m=r[2],b=r[3];return(i=c*p+_*h+f*m+l*b)<0&&(i=-i,p=-p,h=-h,m=-m,b=-b),1-i>d?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,u=Math.sin(n*a)/o):(s=1-n,u=n),e[0]=s*c+u*p,e[1]=s*_+u*h,e[2]=s*f+u*m,e[3]=s*l+u*b,e}function Un(e){var t=h(),r=h(),n=h(),a=Math.sqrt(1-t),i=Math.sqrt(t);return e[0]=a*Math.sin(2*Math.PI*r),e[1]=a*Math.cos(2*Math.PI*r),e[2]=i*Math.sin(2*Math.PI*n),e[3]=i*Math.cos(2*Math.PI*n),e}function Vn(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r*r+n*n+a*a+i*i,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-a*s,e[3]=i*s,e}function qn(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Nn(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var a=0;t[4]>t[0]&&(a=1),t[8]>t[3*a+a]&&(a=2);var i=(a+1)%3,o=(a+2)%3;r=Math.sqrt(t[3*a+a]-t[3*i+i]-t[3*o+o]+1),e[a]=.5*r,r=.5/r,e[3]=(t[3*i+o]-t[3*o+i])*r,e[i]=(t[3*i+a]+t[3*a+i])*r,e[o]=(t[3*o+a]+t[3*a+o])*r}return e}function jn(e,t,r,n){var a=.5*Math.PI/180;t*=a,r*=a,n*=a;var i=Math.sin(t),o=Math.cos(t),s=Math.sin(r),u=Math.cos(r),c=Math.sin(n),_=Math.cos(n);return e[0]=i*u*_-o*s*c,e[1]=o*s*_+i*u*c,e[2]=o*u*c-i*s*_,e[3]=o*u*_+i*s*c,e}function Wn(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var Hn,Gn,Xn,Yn,Zn,Kn,Jn=Cr,$n=Ur,Qn=Vr,ea=qr,ta=Nr,ra=Fn,na=Jr,aa=sn,ia=cn,oa=tn,sa=oa,ua=rn,ca=ua,_a=on,fa=hn,la=mn,da=(Hn=Nt(),Gn=Ht(1,0,0),Xn=Ht(0,1,0),function(e,t,r){var n=fr(t,r);return n<-.999999?(lr(Hn,Gn,t),Sr(Hn)<1e-6&&lr(Hn,Xn,t),_r(Hn,Hn),zn(e,Hn,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(lr(Hn,t,r),e[0]=Hn[0],e[1]=Hn[1],e[2]=Hn[2],e[3]=1+n,_a(e,e))}),pa=(Yn=En(),Zn=En(),function(e,t,r,n,a,i){return Cn(Yn,t,a,i),Cn(Zn,r,n,i),Cn(e,Yn,Zn,2*i*(1-i)),e}),ha=(Kn=be(),function(e,t,r,n){return Kn[0]=r[0],Kn[3]=r[1],Kn[6]=r[2],Kn[1]=n[0],Kn[4]=n[1],Kn[7]=n[2],Kn[2]=-t[0],Kn[5]=-t[1],Kn[8]=-t[2],_a(e,Nn(e,Kn))});function ma(){var e=new p(8);return p!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e}function ba(e){var t=new p(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function ga(e,t,r,n,a,i,o,s){var u=new p(8);return u[0]=e,u[1]=t,u[2]=r,u[3]=n,u[4]=a,u[5]=i,u[6]=o,u[7]=s,u}function wa(e,t,r,n,a,i,o){var s=new p(8);s[0]=e,s[1]=t,s[2]=r,s[3]=n;var u=.5*a,c=.5*i,_=.5*o;return s[4]=u*n+c*r-_*t,s[5]=c*n+_*e-u*r,s[6]=_*n+u*t-c*e,s[7]=-u*e-c*t-_*r,s}function va(e,t,r){var n=.5*r[0],a=.5*r[1],i=.5*r[2],o=t[0],s=t[1],u=t[2],c=t[3];return e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=n*c+a*u-i*s,e[5]=a*c+i*o-n*u,e[6]=i*c+n*s-a*o,e[7]=-n*o-a*s-i*u,e}function ya(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e}function Ma(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function ka(e,t){var r=En();Mt(r,t);var n=new p(3);return vt(n,t),va(e,r,n),e}function xa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Ea(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function Aa(e,t,r,n,a,i,o,s,u){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=i,e[5]=o,e[6]=s,e[7]=u,e}var za=Qn;function Ta(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}var Ra=Qn;function Fa(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function Oa(e,t){var r=t[4],n=t[5],a=t[6],i=t[7],o=-t[0],s=-t[1],u=-t[2],c=t[3];return e[0]=2*(r*c+i*o+n*u-a*s),e[1]=2*(n*c+i*s+a*o-r*u),e[2]=2*(a*c+i*u+r*s-n*o),e}function Pa(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=.5*r[0],u=.5*r[1],c=.5*r[2],_=t[4],f=t[5],l=t[6],d=t[7];return e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=o*s+a*c-i*u+_,e[5]=o*u+i*s-n*c+f,e[6]=o*c+n*u-a*s+l,e[7]=-n*s-a*u-i*c+d,e}function La(e,t,r){var n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=s*o+_*n+u*i-c*a,l=u*o+_*a+c*n-s*i,d=c*o+_*i+s*a-u*n,p=_*o-s*n-u*a-c*i;return On(e,t,r),n=e[0],a=e[1],i=e[2],o=e[3],e[4]=f*o+p*n+l*i-d*a,e[5]=l*o+p*a+d*n-f*i,e[6]=d*o+p*i+f*a-l*n,e[7]=p*o-f*n-l*a-d*i,e}function Sa(e,t,r){var n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=s*o+_*n+u*i-c*a,l=u*o+_*a+c*n-s*i,d=c*o+_*i+s*a-u*n,p=_*o-s*n-u*a-c*i;return Pn(e,t,r),n=e[0],a=e[1],i=e[2],o=e[3],e[4]=f*o+p*n+l*i-d*a,e[5]=l*o+p*a+d*n-f*i,e[6]=d*o+p*i+f*a-l*n,e[7]=p*o-f*n-l*a-d*i,e}function Ia(e,t,r){var n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],_=t[7],f=s*o+_*n+u*i-c*a,l=u*o+_*a+c*n-s*i,d=c*o+_*i+s*a-u*n,p=_*o-s*n-u*a-c*i;return Ln(e,t,r),n=e[0],a=e[1],i=e[2],o=e[3],e[4]=f*o+p*n+l*i-d*a,e[5]=l*o+p*a+d*n-f*i,e[6]=d*o+p*i+f*a-l*n,e[7]=p*o-f*n-l*a-d*i,e}function Da(e,t,r){var n=r[0],a=r[1],i=r[2],o=r[3],s=t[0],u=t[1],c=t[2],_=t[3];return e[0]=s*o+_*n+u*i-c*a,e[1]=u*o+_*a+c*n-s*i,e[2]=c*o+_*i+s*a-u*n,e[3]=_*o-s*n-u*a-c*i,s=t[4],u=t[5],c=t[6],_=t[7],e[4]=s*o+_*n+u*i-c*a,e[5]=u*o+_*a+c*n-s*i,e[6]=c*o+_*i+s*a-u*n,e[7]=_*o-s*n-u*a-c*i,e}function Ba(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],u=r[1],c=r[2],_=r[3];return e[0]=n*_+o*s+a*c-i*u,e[1]=a*_+o*u+i*s-n*c,e[2]=i*_+o*c+n*u-a*s,e[3]=o*_-n*s-a*u-i*c,s=r[4],u=r[5],c=r[6],_=r[7],e[4]=n*_+o*s+a*c-i*u,e[5]=a*_+o*u+i*s-n*c,e[6]=i*_+o*c+n*u-a*s,e[7]=o*_-n*s-a*u-i*c,e}function Ca(e,t,r,n){if(Math.abs(n)<d)return xa(e,t);var a=Math.hypot(r[0],r[1],r[2]);n*=.5;var i=Math.sin(n),o=i*r[0]/a,s=i*r[1]/a,u=i*r[2]/a,c=Math.cos(n),_=t[0],f=t[1],l=t[2],p=t[3];e[0]=_*c+p*o+f*u-l*s,e[1]=f*c+p*s+l*o-_*u,e[2]=l*c+p*u+_*s-f*o,e[3]=p*c-_*o-f*s-l*u;var h=t[4],m=t[5],b=t[6],g=t[7];return e[4]=h*c+g*o+m*u-b*s,e[5]=m*c+g*s+b*o-h*u,e[6]=b*c+g*u+h*s-m*o,e[7]=g*c-h*o-m*s-b*u,e}function Ua(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e}function Va(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[4],u=r[5],c=r[6],_=r[7],f=t[4],l=t[5],d=t[6],p=t[7],h=r[0],m=r[1],b=r[2],g=r[3];return e[0]=n*g+o*h+a*b-i*m,e[1]=a*g+o*m+i*h-n*b,e[2]=i*g+o*b+n*m-a*h,e[3]=o*g-n*h-a*m-i*b,e[4]=n*_+o*s+a*c-i*u+f*g+p*h+l*b-d*m,e[5]=a*_+o*u+i*s-n*c+l*g+p*m+d*h-f*b,e[6]=i*_+o*c+n*u-a*s+d*g+p*b+f*m-l*h,e[7]=o*_-n*s-a*u-i*c+p*g-f*h-l*m-d*b,e}var qa=Va;function Na(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e}var ja=aa;function Wa(e,t,r,n){var a=1-n;return ja(t,r)<0&&(n=-n),e[0]=t[0]*a+r[0]*n,e[1]=t[1]*a+r[1]*n,e[2]=t[2]*a+r[2]*n,e[3]=t[3]*a+r[3]*n,e[4]=t[4]*a+r[4]*n,e[5]=t[5]*a+r[5]*n,e[6]=t[6]*a+r[6]*n,e[7]=t[7]*a+r[7]*n,e}function Ha(e,t){var r=Za(t);return e[0]=-t[0]/r,e[1]=-t[1]/r,e[2]=-t[2]/r,e[3]=t[3]/r,e[4]=-t[4]/r,e[5]=-t[5]/r,e[6]=-t[6]/r,e[7]=t[7]/r,e}function Ga(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}var Xa=oa,Ya=Xa,Za=ua,Ka=Za;function Ja(e,t){var r=Za(t);if(r>0){r=Math.sqrt(r);var n=t[0]/r,a=t[1]/r,i=t[2]/r,o=t[3]/r,s=t[4],u=t[5],c=t[6],_=t[7],f=n*s+a*u+i*c+o*_;e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=(s-n*f)/r,e[5]=(u-a*f)/r,e[6]=(c-i*f)/r,e[7]=(_-o*f)/r}return e}function $a(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function Qa(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}function ei(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],_=t[0],f=t[1],l=t[2],p=t[3],h=t[4],m=t[5],b=t[6],g=t[7];return Math.abs(r-_)<=d*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(c-g)<=d*Math.max(1,Math.abs(c),Math.abs(g))}function ti(){var e=new p(2);return p!=Float32Array&&(e[0]=0,e[1]=0),e}function ri(e){var t=new p(2);return t[0]=e[0],t[1]=e[1],t}function ni(e,t){var r=new p(2);return r[0]=e,r[1]=t,r}function ai(e,t){return e[0]=t[0],e[1]=t[1],e}function ii(e,t,r){return e[0]=t,e[1]=r,e}function oi(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function si(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function ui(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function ci(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function _i(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function fi(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function li(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}function di(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}function pi(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function hi(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function mi(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e}function bi(e,t){var r=t[0]-e[0],n=t[1]-e[1];return Math.hypot(r,n)}function gi(e,t){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function wi(e){var t=e[0],r=e[1];return Math.hypot(t,r)}function vi(e){var t=e[0],r=e[1];return t*t+r*r}function yi(e,t){return e[0]=-t[0],e[1]=-t[1],e}function Mi(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function ki(e,t){var r=t[0],n=t[1],a=r*r+n*n;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e}function xi(e,t){return e[0]*t[0]+e[1]*t[1]}function Ei(e,t,r){var n=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=n,e}function Ai(e,t,r,n){var a=t[0],i=t[1];return e[0]=a+n*(r[0]-a),e[1]=i+n*(r[1]-i),e}function zi(e,t){t=t||1;var r=2*h()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e}function Ti(e,t,r){var n=t[0],a=t[1];return e[0]=r[0]*n+r[2]*a,e[1]=r[1]*n+r[3]*a,e}function Ri(e,t,r){var n=t[0],a=t[1];return e[0]=r[0]*n+r[2]*a+r[4],e[1]=r[1]*n+r[3]*a+r[5],e}function Fi(e,t,r){var n=t[0],a=t[1];return e[0]=r[0]*n+r[3]*a+r[6],e[1]=r[1]*n+r[4]*a+r[7],e}function Oi(e,t,r){var n=t[0],a=t[1];return e[0]=r[0]*n+r[4]*a+r[12],e[1]=r[1]*n+r[5]*a+r[13],e}function Pi(e,t,r,n){var a=t[0]-r[0],i=t[1]-r[1],o=Math.sin(n),s=Math.cos(n);return e[0]=a*s-i*o+r[0],e[1]=a*o+i*s+r[1],e}function Li(e,t){var r=e[0],n=e[1],a=t[0],i=t[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o));var s=a*a+i*i;s>0&&(s=1/Math.sqrt(s));var u=(r*a+n*i)*o*s;return u>1?0:u<-1?Math.PI:Math.acos(u)}function Si(e){return e[0]=0,e[1]=0,e}function Ii(e){return"vec2("+e[0]+", "+e[1]+")"}function Di(e,t){return e[0]===t[0]&&e[1]===t[1]}function Bi(e,t){var r=e[0],n=e[1],a=t[0],i=t[1];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-i)<=d*Math.max(1,Math.abs(n),Math.abs(i))}var Ci=wi,Ui=si,Vi=ui,qi=ci,Ni=bi,ji=gi,Wi=vi,Hi=function(){var e=ti();return function(t,r,n,a,i,o){var s,u;for(r||(r=2),n||(n=0),u=a?Math.min(a*r+n,t.length):t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],i(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}()},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4),a=self;n.messageManager.onOutgoingMessage.bind(()=>{let e=n.messageManager.getOutgoingMessages();for(let t of e)a.postMessage(t.msg,t.transferables)});let i=e=>{if(e&&e.data&&"wasm"===e.data.t){let t=location.href.startsWith("blob")?e.data.url:r(21);t.default&&(t=t.default),n.launchWorkerServer(t),a.removeEventListener("message",i)}};a.addEventListener("message",i),a.addEventListener("message",e=>{n.messageManager.postIncomingMessage(e.data)})},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.launchWorkerServer=t.messageManager=void 0;const a=r(5),i=r(9),o=r(10),s=r(13),u=r(1),c=r(15),_=r(16),f=r(0);t.messageManager=new s.MsgManager;let l=0;t.launchWorkerServer=function(e){return n(this,void 0,void 0,(function*(){let r=a.default({locateFile:(t,r)=>t.endsWith("zcv.wasm")?e:r+t,onRuntimeInitialized:()=>{let e=i.getRuntimeObject(r),a=new o.zappar_server(e,(e,r)=>{t.messageManager.postOutgoingMessage({p:e,t:"zappar",d:r},[r])});t.messageManager.postOutgoingMessage("loaded",[]),t.messageManager.onIncomingMessage.bind(i=>{var o;switch(i.t){case"zappar":a.processBuffer(i.d),t.messageManager.postOutgoingMessage({t:"buf",d:i.d},[i.d]);break;case"buf":null===(o=a.serializersByPipelineId.get(i.p))||void 0===o||o.bufferReturn(i.d);break;case"cameraFrameC2S":{let r,n=i,o=a._pipeline_by_instance.get(n.p);o&&(e.pipeline_camera_frame_submit(o,n.d,n.width,n.height,n.token,n.c2d,n.cm,n.userFacing),e.pipeline_frame_update(o),r=e.pipeline_camera_frame_device_attitude(o),a.exploreState());let s={token:n.token,d:n.d,p:n.p,t:"cameraFrameRecycleS2C",att:r};t.messageManager.postOutgoingMessage(s,[n.d]);break}case"streamC2S":{let o=i;!function(e,r,a,i,o,s,c){n(this,void 0,void 0,(function*(){const n=yield a.getReader();for(;;){let a=yield n.read();if(a.done)return void console.log("Stream done");let _=a.value,w=_.allocationSize();w>p&&(d>0&&e._free(d),d=e._malloc(w),p=w),yield _.copyTo(e.HEAPU8.subarray(d,d+p));let v=h;h++;const y=_.visibleRect.width,M=_.visibleRect.height;let k,x=y,E=M;switch(l){case 270:k=new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]),x=M,E=y;break;case 180:k=new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);break;case 90:k=new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1]),x=M,E=y;break;default:k=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}let A=_.clone();o?u.mat4.fromScaling(m,[-1,1,-1]):u.mat4.identity(m);let z=300*f.profile.dataWidth/320;b[0]=z,b[1]=z,b[2]=.5*f.profile.dataWidth,b[3]=.5*f.profile.dataHeight;const T={token:v,d:A,p:i,t:"videoFrameS2C",userFacing:o,uvTransform:k,w:x,h:E,cameraToDevice:m,cameraModel:b,source:c};t.messageManager.postOutgoingMessage(T,[T.d,T.uvTransform.buffer]);const R=s._pipeline_by_instance.get(i);R&&(r.pipeline_camera_frame_submit_raw_pointer(R,d,w,g(_.format),y,M,v,m,l,b,o),r.pipeline_frame_update(R),s.exploreState()),_.close()}}))}(r,e,o.s,o.p,o.userFacing,a,o.source);break}case"cameraToScreenC2S":l=i.r;break;case"imageBitmapC2S":{let r=i;_.handleImageBitmap(r,e,a,t.messageManager);break}}})}})}))};let d=0,p=0,h=1;const m=u.mat4.create(),b=new Float32Array([300,300,160,120,0,0]);function g(e){switch(e){case"I420":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_I420;case"I420A":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_I420A;case"I422":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_I422;case"I444":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_I444;case"NV12":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_NV12;case"RGBA":case"RGBX":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_RGBA;case"BGRA":case"BGRX":return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_BGRA}return c.frame_pixel_format_t.FRAME_PIXEL_FORMAT_Y}},function(e,t,r){"use strict";r.r(t),function(e){var r,n=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var n,a,i;t=t||{},n||(n=void 0!==t?t:{}),n.ready=new Promise((function(e,t){a=e,i=t}));var o,s={};for(o in n)n.hasOwnProperty(o)&&(s[o]=n[o]);var u="./this.program";function c(e,t){throw t}var _,f="";f=self.location.href,r&&(f=r),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",_=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)};var l,d,p,h=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(n[o]=s[o]);s=null,n.thisProgram&&(u=n.thisProgram),n.quit&&(c=n.quit),n.wasmBinary&&(d=n.wasmBinary),n.noExitRuntime&&(p=n.noExitRuntime),"object"!=typeof WebAssembly&&K("no native wasm support detected");var b,g=!1;function w(e,t){e||K("Assertion failed: "+t)}function v(e){var t=n["_"+e];return w(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function y(e,t,r,n){var a,i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=vr(r),S(e,x,t,r)}return t},array:function(e){var t=vr(e.length);return k.set(e,t),t}},o=v(e),s=[];if(e=0,n)for(var u=0;u<n.length;u++){var c=i[r[u]];c?(0===e&&(e=gr()),s[u]=c(n[u])):s[u]=n[u]}return r=o.apply(null,s),a=r,r="string"===t?L(a):"boolean"===t?!!a:a,0!==e&&wr(e),r}var M,k,x,E,A,z,T,R,F,O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(e,t,r){var n=t+r;for(r=t;e[r]&&!(r>=n);)++r;if(16<r-t&&e.subarray&&O)return O.decode(e.subarray(t,r));for(n="";t<r;){var a=e[t++];if(128&a){var i=63&e[t++];if(192==(224&a))n+=String.fromCharCode((31&a)<<6|i);else{var o=63&e[t++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&e[t++])?n+=String.fromCharCode(a):(a-=65536,n+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else n+=String.fromCharCode(a)}return n}function L(e,t){return e?P(x,e,t):""}function S(e,t,r,n){if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(r>=n)break;t[r++]=o}else{if(2047>=o){if(r+1>=n)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=n)break;t[r++]=224|o>>12}else{if(r+3>=n)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63}t[r++]=128|o>>6&63}t[r++]=128|63&o}}return t[r]=0,r-a}function I(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);55296<=n&&57343>=n&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),127>=n?++t:t=2047>=n?t+2:65535>=n?t+3:t+4}return t}function D(e){var t=I(e)+1,r=lr(t);return r&&S(e,k,r,t),r}function B(e,t){for(var r=0;r<e.length;++r)k[t++>>0]=e.charCodeAt(r);k[t>>0]=0}function C(){var e=b.buffer;M=e,n.HEAP8=k=new Int8Array(e),n.HEAP16=E=new Int16Array(e),n.HEAP32=z=new Int32Array(e),n.HEAPU8=x=new Uint8Array(e),n.HEAPU16=A=new Uint16Array(e),n.HEAPU32=T=new Uint32Array(e),n.HEAPF32=R=new Float32Array(e),n.HEAPF64=F=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var U,V=[],q=[],N=[],j=[];function W(){var e=n.preRun.shift();V.unshift(e)}var H=0,G=null,X=null;function Y(){H++,n.monitorRunDependencies&&n.monitorRunDependencies(H)}function Z(){if(H--,n.monitorRunDependencies&&n.monitorRunDependencies(H),0==H&&(null!==G&&(clearInterval(G),G=null),X)){var e=X;X=null,e()}}function K(e){throw n.onAbort&&n.onAbort(e),m(e),g=!0,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),i(e),e}n.preloadedImages={},n.preloadedAudios={};var J="zcv.wasm";if(String.prototype.startsWith?!J.startsWith("data:application/octet-stream;base64,"):0!==J.indexOf("data:application/octet-stream;base64,")){var $=J;J=n.locateFile?n.locateFile($,f):f+$}var Q,ee,te,re={26547:function(){if(self.crypto&&self.crypto.getRandomValues){var e=new Uint32Array(1);return self.crypto.getRandomValues(e),e[0]}return 9007199254740991*Math.random()},301725:function(e,t){self.send_ba_request(x.subarray(e,e+t))}};function ne(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t(n);else{var r=t.da;"number"==typeof r?void 0===t.L?U.get(r)():U.get(r)(t.L):r(void 0===t.L?null:t.L)}}}function ae(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return z[dr()>>2]=28,-1;e=te()}return z[t>>2]=e/1e3|0,z[t+4>>2]=e%1e3*1e6|0,0}function ie(e){this.D=e-16,this.Ia=function(e){z[this.D+8>>2]=e},this.Fa=function(e){z[this.D+0>>2]=e},this.Ga=function(){z[this.D+4>>2]=0},this.Ea=function(){k[this.D+12>>0]=0},this.Ha=function(){k[this.D+13>>0]=0},this.ua=function(e,t){this.Ia(e),this.Fa(t),this.Ga(),this.Ea(),this.Ha()}}function oe(e,t){for(var r=0,n=e.length-1;0<=n;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function se(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function ue(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function ce(e){if("/"===e)return"/";var t=(e=(e=se(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function _e(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}te=function(){return performance.now()};var fe=[];function le(e,t){fe[e]={input:[],j:[],C:t},Ce(e,de)}var de={open:function(e){var t=fe[e.node.I];if(!t)throw new xe(43);e.h=t,e.seekable=!1},close:function(e){e.h.C.flush(e.h)},flush:function(e){e.h.C.flush(e.h)},read:function(e,t,r,n){if(!e.h||!e.h.C.ea)throw new xe(60);for(var a=0,i=0;i<n;i++){try{var o=e.h.C.ea(e.h)}catch(e){throw new xe(29)}if(void 0===o&&0===a)throw new xe(6);if(null==o)break;a++,t[r+i]=o}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,n){if(!e.h||!e.h.C.Y)throw new xe(60);try{for(var a=0;a<n;a++)e.h.C.Y(e.h,t[r+a])}catch(e){throw new xe(29)}return n&&(e.node.timestamp=Date.now()),a}},pe={ea:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=sr(t,!0)}return e.input.shift()},Y:function(e,t){null===t||10===t?(h(P(e.j,0)),e.j=[]):0!=t&&e.j.push(t)},flush:function(e){e.j&&0<e.j.length&&(h(P(e.j,0)),e.j=[])}},he={Y:function(e,t){null===t||10===t?(m(P(e.j,0)),e.j=[]):0!=t&&e.j.push(t)},flush:function(e){e.j&&0<e.j.length&&(m(P(e.j,0)),e.j=[])}},me={o:null,u:function(){return me.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(24576==(61440&r)||4096==(61440&r))throw new xe(63);return me.o||(me.o={dir:{node:{m:me.c.m,s:me.c.s,G:me.c.G,M:me.c.M,ka:me.c.ka,S:me.c.S,la:me.c.la,ja:me.c.ja,N:me.c.N},stream:{A:me.f.A}},file:{node:{m:me.c.m,s:me.c.s},stream:{A:me.f.A,read:me.f.read,write:me.f.write,$:me.f.$,fa:me.f.fa,ha:me.f.ha}},link:{node:{m:me.c.m,s:me.c.s,J:me.c.J},stream:{}},aa:{node:{m:me.c.m,s:me.c.s},stream:Be}}),16384==(61440&(r=Fe(e,t,r,n)).mode)?(r.c=me.o.dir.node,r.f=me.o.dir.stream,r.b={}):32768==(61440&r.mode)?(r.c=me.o.file.node,r.f=me.o.file.stream,r.g=0,r.b=null):40960==(61440&r.mode)?(r.c=me.o.link.node,r.f=me.o.link.stream):8192==(61440&r.mode)&&(r.c=me.o.aa.node,r.f=me.o.aa.stream),r.timestamp=Date.now(),e&&(e.b[t]=r),r},Va:function(e){if(e.b&&e.b.subarray){for(var t=[],r=0;r<e.g;++r)t.push(e.b[r]);return t}return e.b},Wa:function(e){return e.b?e.b.subarray?e.b.subarray(0,e.g):new Uint8Array(e.b):new Uint8Array(0)},ba:function(e,t){var r=e.b?e.b.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.b,e.b=new Uint8Array(t),0<e.g&&e.b.set(r.subarray(0,e.g),0))},Ca:function(e,t){if(e.g!=t)if(0==t)e.b=null,e.g=0;else{if(!e.b||e.b.subarray){var r=e.b;e.b=new Uint8Array(t),r&&e.b.set(r.subarray(0,Math.min(t,e.g)))}else if(e.b||(e.b=[]),e.b.length>t)e.b.length=t;else for(;e.b.length<t;)e.b.push(0);e.g=t}},c:{m:function(e){var t={};return t.qa=8192==(61440&e.mode)?e.id:1,t.X=e.id,t.mode=e.mode,t.Aa=1,t.uid=0,t.sa=0,t.I=e.I,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.g:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.ma=new Date(e.timestamp),t.za=new Date(e.timestamp),t.pa=new Date(e.timestamp),t.na=4096,t.oa=Math.ceil(t.size/t.na),t},s:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&me.Ca(e,t.size)},G:function(){throw Ee[44]},M:function(e,t,r,n){return me.createNode(e,t,r,n)},ka:function(e,t,r){if(16384==(61440&e.mode)){try{var n=Re(t,r)}catch(e){}if(n)for(var a in n.b)throw new xe(55)}delete e.parent.b[e.name],e.name=r,t.b[r]=e,e.parent=t},S:function(e,t){delete e.b[t]},la:function(e,t){var r,n=Re(e,t);for(r in n.b)throw new xe(55);delete e.b[t]},ja:function(e){var t,r=[".",".."];for(t in e.b)e.b.hasOwnProperty(t)&&r.push(t);return r},N:function(e,t,r){return(e=me.createNode(e,t,41471,0)).link=r,e},J:function(e){if(40960!=(61440&e.mode))throw new xe(28);return e.link}},f:{read:function(e,t,r,n,a){var i=e.node.b;if(a>=e.node.g)return 0;if(8<(e=Math.min(e.node.g-a,n))&&i.subarray)t.set(i.subarray(a,a+e),r);else for(n=0;n<e;n++)t[r+n]=i[a+n];return e},write:function(e,t,r,n,a,i){if(t.buffer===k.buffer&&(i=!1),!n)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.b||e.b.subarray)){if(i)return e.b=t.subarray(r,r+n),e.g=n;if(0===e.g&&0===a)return e.b=t.slice(r,r+n),e.g=n;if(a+n<=e.g)return e.b.set(t.subarray(r,r+n),a),n}if(me.ba(e,a+n),e.b.subarray&&t.subarray)e.b.set(t.subarray(r,r+n),a);else for(i=0;i<n;i++)e.b[a+i]=t[r+i];return e.g=Math.max(e.g,a+n),n},A:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.g),0>t)throw new xe(28);return t},$:function(e,t,r){me.ba(e.node,t+r),e.node.g=Math.max(e.node.g,t+r)},fa:function(e,t,r,n,a,i){if(w(0===t),32768!=(61440&e.node.mode))throw new xe(43);if(e=e.node.b,2&i||e.buffer!==M){for((0<n||n+r<e.length)&&(e=e.subarray?e.subarray(n,n+r):Array.prototype.slice.call(e,n,n+r)),n=!0,i=16384*Math.ceil(r/16384),t=lr(i);r<i;)k[t+r++]=0;if(!(r=t))throw new xe(48);k.set(e,r)}else n=!1,r=e.byteOffset;return{D:r,Qa:n}},ha:function(e,t,r,n,a){if(32768!=(61440&e.node.mode))throw new xe(43);return 2&a||me.f.write(e,t,0,n,r,!1),0}}},be=null,ge={},we=[],ve=1,ye=null,Me=!0,ke={},xe=null,Ee={};function Ae(e,t){if(t=t||{},!(e=_e("/",e)))return{path:"",node:null};var r,n={ca:!0,Z:0};for(r in n)void 0===t[r]&&(t[r]=n[r]);if(8<t.Z)throw new xe(32);e=oe(e.split("/").filter((function(e){return!!e})),!1);var a=be;for(n="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(a=Re(a,e[r]),n=se(n+"/"+e[r]),a.H&&(!i||i&&t.ca)&&(a=a.H.root),!i||t.V)for(i=0;40960==(61440&a.mode);)if(a=We(n),a=Ae(n=_e(ue(n),a),{Z:t.Z}).node,40<i++)throw new xe(32)}return{path:n,node:a}}function ze(e){for(var t;;){if(e===e.parent)return e=e.u.ga,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Te(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%ye.length}function Re(e,t){var r;if(r=(r=Le(e,"x"))?r:e.c.G?0:2)throw new xe(r,e);for(r=ye[Te(e.id,t)];r;r=r.B){var n=r.name;if(r.parent.id===e.id&&n===t)return r}return e.c.G(e,t)}function Fe(e,t,r,n){return t=Te((e=new or(e,t,r,n)).parent.id,e.name),e.B=ye[t],ye[t]=e}var Oe={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Pe(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Le(e,t){return Me||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2}function Se(e,t){try{return Re(e,t),20}catch(e){}return Le(e,"wx")}function Ie(e,t){$e||(($e=function(){}).prototype={});var r,n=new $e;for(r in e)n[r]=e[r];return e=n,t=function(e){for(e=e||0;e<=4096;e++)if(!we[e])return e;throw new xe(33)}(t),e.v=t,we[t]=e}var De,Be={open:function(e){e.f=ge[e.node.I].f,e.f.open&&e.f.open(e)},A:function(){throw new xe(70)}};function Ce(e,t){ge[e]={f:t}}function Ue(e,t){var r="/"===t,n=!t;if(r&&be)throw new xe(10);if(!r&&!n){var a=Ae(t,{ca:!1});if(t=a.path,(a=a.node).H)throw new xe(10);if(16384!=(61440&a.mode))throw new xe(54)}t={type:e,$a:{},ga:t,ya:[]},(e=e.u(t)).u=t,t.root=e,r?be=e:a&&(a.H=t,a.u&&a.u.ya.push(t))}function Ve(e,t,r){var n=Ae(e,{parent:!0}).node;if(!(e=ce(e))||"."===e||".."===e)throw new xe(28);var a=Se(n,e);if(a)throw new xe(a);if(!n.c.M)throw new xe(63);return n.c.M(n,e,t,r)}function qe(e){Ve(e,16895,0)}function Ne(e,t,r){void 0===r&&(r=t,t=438),Ve(e,8192|t,r)}function je(e,t){if(!_e(e))throw new xe(44);var r=Ae(t,{parent:!0}).node;if(!r)throw new xe(44);var n=Se(r,t=ce(t));if(n)throw new xe(n);if(!r.c.N)throw new xe(63);r.c.N(r,t,e)}function We(e){if(!(e=Ae(e).node))throw new xe(44);if(!e.c.J)throw new xe(28);return _e(ze(e.parent),e.c.J(e))}function He(e,t){if(!(e=Ae(e,{V:!t}).node))throw new xe(44);if(!e.c.m)throw new xe(63);return e.c.m(e)}function Ge(e){return He(e,!0)}function Xe(e,t,r,a){if(""===e)throw new xe(44);if("string"==typeof t){var i=Oe[t];if(void 0===i)throw Error("Unknown file open mode: "+t);t=i}if(r=64&t?4095&(void 0===r?438:r)|32768:0,"object"==typeof e)var o=e;else{e=se(e);try{o=Ae(e,{V:!(131072&t)}).node}catch(e){}}if(i=!1,64&t)if(o){if(128&t)throw new xe(20)}else o=Ve(e,r,0),i=!0;if(!o)throw new xe(44);if(8192==(61440&o.mode)&&(t&=-513),65536&t&&16384!=(61440&o.mode))throw new xe(54);if(!i&&(r=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Pe(t)||512&t)?31:Le(o,Pe(t)):44))throw new xe(r);if(512&t){var s;if(!(s="string"==typeof(r=o)?Ae(r,{V:!0}).node:r).c.s)throw new xe(63);if(16384==(61440&s.mode))throw new xe(31);if(32768!=(61440&s.mode))throw new xe(28);if(r=Le(s,"w"))throw new xe(r);s.c.s(s,{size:0,timestamp:Date.now()})}t&=-131713,(a=Ie({node:o,path:ze(o),flags:t,seekable:!0,position:0,f:o.f,Na:[],error:!1},a)).f.open&&a.f.open(a),!n.logReadFiles||1&t||(Qe||(Qe={}),e in Qe||(Qe[e]=1,m("FS.trackingDelegate error on read file: "+e)));try{ke.onOpenFile&&(o=0,1!=(2097155&t)&&(o|=1),0!=(2097155&t)&&(o|=2),ke.onOpenFile(e,o))}catch(t){m("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return a}function Ye(e,t,r){if(null===e.v)throw new xe(8);if(!e.seekable||!e.f.A)throw new xe(70);if(0!=r&&1!=r&&2!=r)throw new xe(28);e.position=e.f.A(e,t,r),e.Na=[]}function Ze(){xe||((xe=function(e,t){this.node=t,this.Da=function(e){this.i=e},this.Da(e),this.message="FS error"}).prototype=Error(),xe.prototype.constructor=xe,[44].forEach((function(e){Ee[e]=new xe(e),Ee[e].stack="<generic error, no stack>"})))}function Ke(e,t,r){e=se("/dev/"+e);var n=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);Je||(Je=64);var a=Je++<<8|0;Ce(a,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,r,n,a){for(var i=0,o=0;o<a;o++){try{var s=t()}catch(e){throw new xe(29)}if(void 0===s&&0===i)throw new xe(6);if(null==s)break;i++,r[n+o]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,n,a){for(var i=0;i<a;i++)try{r(t[n+i])}catch(e){throw new xe(29)}return a&&(e.node.timestamp=Date.now()),i}}),Ne(e,n,a)}var Je,$e,Qe,et={};function tt(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&se(t)!==se(ze(e.node)))return-54;throw e}return z[r>>2]=n.qa,z[r+4>>2]=0,z[r+8>>2]=n.X,z[r+12>>2]=n.mode,z[r+16>>2]=n.Aa,z[r+20>>2]=n.uid,z[r+24>>2]=n.sa,z[r+28>>2]=n.I,z[r+32>>2]=0,ee=[n.size>>>0,(Q=n.size,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],z[r+40>>2]=ee[0],z[r+44>>2]=ee[1],z[r+48>>2]=4096,z[r+52>>2]=n.oa,z[r+56>>2]=n.ma.getTime()/1e3|0,z[r+60>>2]=0,z[r+64>>2]=n.za.getTime()/1e3|0,z[r+68>>2]=0,z[r+72>>2]=n.pa.getTime()/1e3|0,z[r+76>>2]=0,ee=[n.X>>>0,(Q=n.X,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],z[r+80>>2]=ee[0],z[r+84>>2]=ee[1],0}var rt=void 0;function nt(){return z[(rt+=4)-4>>2]}function at(e){if(!(e=we[e]))throw new xe(8);return e}var it,ot,st,ut=null,ct=0,_t=null,ft=0,lt=0,dt=0,pt=[],ht={},mt=!1,bt=!1,gt=[];function wt(){function e(){bt=document.pointerLockElement===n.canvas||document.mozPointerLockElement===n.canvas||document.webkitPointerLockElement===n.canvas||document.msPointerLockElement===n.canvas}if(n.preloadPlugins||(n.preloadPlugins=[]),!Rt){Rt=!0;try{Ft=!0}catch(e){Ft=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Ot="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Ft?null:console.log("warning: no BlobBuilder"),Pt="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,n.ia||void 0!==Pt||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),n.ia=!0),n.preloadPlugins.push({canHandle:function(e){return!n.ia&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,a){var i=null;if(Ft)try{(i=new Blob([e],{type:Tt(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Tt(t)}))}catch(e){!function(e){l||(l={}),l[e]||(l[e]=1,m(e))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}i||((i=new Ot).append(new Uint8Array(e).buffer),i=i.getBlob());var o=Pt.createObjectURL(i),s=new Image;s.onload=function(){w(s.complete,"Image "+t+" could not be decoded");var a=document.createElement("canvas");a.width=s.width,a.height=s.height,a.getContext("2d").drawImage(s,0,0),n.preloadedImages[t]=a,Pt.revokeObjectURL(o),r&&r(e)},s.onerror=function(){console.log("Image "+o+" could not be decoded"),a&&a()},s.src=o}}),n.preloadPlugins.push({canHandle:function(e){return!n.Za&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,a){function i(a){s||(s=!0,n.preloadedAudios[t]=a,r&&r(e))}function o(){s||(s=!0,n.preloadedAudios[t]=new Audio,a&&a())}var s=!1;if(!Ft)return o();try{var u=new Blob([e],{type:Tt(t)})}catch(e){return o()}u=Pt.createObjectURL(u);var c=new Audio;c.addEventListener("canplaythrough",(function(){i(c)}),!1),c.onerror=function(){if(!s){console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach");for(var r="",n=0,a=0,o=0;o<e.length;o++)for(n=n<<8|e[o],a+=8;6<=a;){var u=n>>a-6&63;a-=6,r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[u]}2==a?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&n)<<4],r+="=="):4==a&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&n)<<2],r+="="),c.src="data:audio/x-"+t.substr(-3)+";base64,"+r,i(c)}},c.src=u,zt((function(){i(c)}),1e4)}});var t=n.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||function(){},t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),n.elementPointerLock&&t.addEventListener("click",(function(e){!bt&&n.canvas.requestPointerLock&&(n.canvas.requestPointerLock(),e.preventDefault())}),!1))}}function vt(e,t,r,a){if(t&&n.U&&e==n.canvas)return n.U;var i;if(t){var o={antialias:!1,alpha:!1,xa:1};if(a)for(var s in a)o[s]=a[s];if(void 0!==$t&&(i=function(e,t){if(e=e.getContext("webgl",t)){var r=Yt(Xt),n={Xa:r,attributes:t,version:t.xa,T:e};e.canvas&&(e.canvas.Pa=n),Xt[r]=n,(void 0===t.ra||t.ra)&&function(e){if(e||(e=Kt),!e.va){e.va=!0;var t=e.T;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,a){t.drawArraysInstancedANGLE(e,r,n,a)},e.drawElementsInstanced=function(e,r,n,a,i){t.drawElementsInstancedANGLE(e,r,n,a,i)})}(t),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(t),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})}(t),t.Ta=t.getExtension("EXT_disjoint_timer_query"),t.Ya=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){0>e.indexOf("lose_context")&&0>e.indexOf("debug")&&t.getExtension(e)}))}}(n),t=r}else t=0;return t}(e,o)))var u=Xt[i].T}else u=e.getContext("2d");return u?(r&&(t||w(void 0===ar,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),n.U=u,t&&(Kt=Xt[i],n.U=ar=Kt&&Kt.T),n.bb=t,gt.forEach((function(e){e()})),wt()),u):null}var yt=!1,Mt=void 0,kt=void 0;function xt(){return!!mt&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var Et=0;function At(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===Et)Et=t+1e3/60;else for(;t+2>=Et;)Et+=1e3/60;setTimeout(e,Math.max(Et-t,0))}}function zt(e,t){p=!0,setTimeout((function(){g||e()}),t)}function Tt(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}var Rt,Ft,Ot,Pt,Lt=[];function St(){var e=n.canvas;Lt.forEach((function(t){t(e.width,e.height)}))}function It(e,t,r){t&&r?(e.Oa=t,e.ta=r):(t=e.Oa,r=e.ta);var a=t,i=r;if(n.forcedAspectRatio&&0<n.forcedAspectRatio&&(a/i<n.forcedAspectRatio?a=Math.round(i*n.forcedAspectRatio):i=Math.round(a/n.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/a,screen.height/i);a=Math.round(a*o),i=Math.round(i*o)}kt?(e.width!=a&&(e.width=a),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(a!=t||i!=r?(e.style.setProperty("width",a+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}function Dt(){return!1}n._emscripten_is_main_browser_thread=Dt;var Bt,Ct=[];function Ut(e,t){T[e>>2]=t,T[e+4>>2]=t/4294967296|0}function Vt(e,t,r,n,a){function i(t){var r=0,n=0;t&&(n=v.response?v.response.byteLength:0,r=lr(n),x.set(new Uint8Array(v.response),r)),T[e+12>>2]=r,Ut(e+16,n)}var o=T[e+8>>2];if(o){var s=L(o),u=e+112,c=L(u);c||(c="GET");var _=T[u+52>>2],f=T[u+56>>2],l=!!T[u+60>>2],d=T[u+68>>2],p=T[u+72>>2];o=T[u+76>>2];var h=T[u+80>>2],m=T[u+84>>2];u=T[u+88>>2];var b=!!(1&_),g=!!(2&_);_=!!(64&_),d=d?L(d):void 0,p=p?L(p):void 0;var w=h?L(h):void 0,v=new XMLHttpRequest;if(v.withCredentials=l,v.open(c,s,!_,d,p),_||(v.timeout=f),v.Ra=s,v.responseType="arraybuffer",h&&v.overrideMimeType(w),o)for(;(c=T[o>>2])&&(s=T[o+4>>2]);)o+=8,c=L(c),s=L(s),v.setRequestHeader(c,s);Ct.push(v),T[e+0>>2]=Ct.length,o=m&&u?x.slice(m,m+u):null,v.onload=function(n){i(b&&!g);var a=v.response?v.response.byteLength:0;Ut(e+24,0),a&&Ut(e+32,a),A[e+40>>1]=v.readyState,A[e+42>>1]=v.status,v.statusText&&S(v.statusText,x,e+44,64),200<=v.status&&300>v.status?t&&t(e,v,n):r&&r(e,v,n)},v.onerror=function(t){i(b);var n=v.status;Ut(e+24,0),Ut(e+32,v.response?v.response.byteLength:0),A[e+40>>1]=v.readyState,A[e+42>>1]=n,r&&r(e,v,t)},v.ontimeout=function(t){r&&r(e,v,t)},v.onprogress=function(t){var r=b&&g&&v.response?v.response.byteLength:0,a=0;b&&g&&(a=lr(r),x.set(new Uint8Array(v.response),a)),T[e+12>>2]=a,Ut(e+16,r),Ut(e+24,t.loaded-r),Ut(e+32,t.total),A[e+40>>1]=v.readyState,3<=v.readyState&&0===v.status&&0<t.loaded&&(v.status=200),A[e+42>>1]=v.status,v.statusText&&S(v.statusText,x,e+44,64),n&&n(e,v,t),a&&fr(a)},v.onreadystatechange=function(t){A[e+40>>1]=v.readyState,2<=v.readyState&&(A[e+42>>1]=v.status),a&&a(e,v,t)};try{v.send(o)}catch(t){r&&r(e,v,t)}}else r(e,0,"no url specified!")}function qt(e,t,r,n){var a=Bt;if(a){var i=T[e+112+64>>2];i||(i=T[e+8>>2]);var o=L(i);try{var s=a.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);s.onsuccess=function(){A[e+40>>1]=4,A[e+42>>1]=200,S("OK",x,e+44,64),r(e,0,o)},s.onerror=function(t){A[e+40>>1]=4,A[e+42>>1]=413,S("Payload Too Large",x,e+44,64),n(e,0,t)}}catch(t){n(e,0,t)}}else n(e,0,"IndexedDB not available!")}var Nt,jt={};function Wt(){if(!Nt){var e,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",_:u||"./this.program"};for(e in jt)t[e]=jt[e];var r=[];for(e in t)r.push(e+"="+t[e]);Nt=r}return Nt}var Ht=1,Gt=[],Xt=[];function Yt(e){for(var t=Ht++,r=e.length;r<t;r++)e[r]=null;return t}var Zt,Kt,Jt,$t={};function Qt(e){return 0==e%4&&(0!=e%100||0==e%400)}function er(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}var tr=[31,29,31,30,31,30,31,31,30,31,30,31],rr=[31,28,31,30,31,30,31,31,30,31,30,31];function nr(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),n=(Qt(e.getFullYear())?tr:rr)[r];if(!(t>n-e.getDate())){e.setDate(e.getDate()+t);break}t-=n-e.getDate()+1,e.setDate(1),11>r?e.setMonth(r+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}var ar,ir=[];function or(e,t,r,n){e||(e=this),this.parent=e,this.u=e.u,this.H=null,this.id=ve++,this.name=t,this.mode=r,this.c={},this.f={},this.I=n}function sr(e,t){var r=Array(I(e)+1);return e=S(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(or.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),Ze(),ye=Array(4096),Ue(me,"/"),qe("/tmp"),qe("/home"),qe("/home/web_user"),function(){qe("/dev"),Ce(259,{read:function(){return 0},write:function(e,t,r,n){return n}}),Ne("/dev/null",259),le(1280,pe),le(1536,he),Ne("/dev/tty",1280),Ne("/dev/tty1",1536);var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){K("randomDevice")}}();Ke("random",e),Ke("urandom",e),qe("/dev/shm"),qe("/dev/shm/tmp")}(),qe("/proc"),qe("/proc/self"),qe("/proc/self/fd"),Ue({u:function(){var e=Fe("/proc/self","fd",16895,73);return e.c={G:function(e,t){var r=we[+t];if(!r)throw new xe(8);return(e={parent:null,u:{ga:"fake"},c:{J:function(){return r.path}}}).parent=e}},e}},"/proc/self/fd"),n.requestFullscreen=function(e,t){!function(e,t){function r(){mt=!1;var e=a.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(a.exitFullscreen=xt,Mt&&a.requestPointerLock(),mt=!0,kt?("undefined"!=typeof SDL&&(z[SDL.screen>>2]=8388608|T[SDL.screen>>2]),It(n.canvas),St()):It(a)):(e.parentNode.insertBefore(a,e),e.parentNode.removeChild(e),kt?("undefined"!=typeof SDL&&(z[SDL.screen>>2]=-8388609&T[SDL.screen>>2]),It(n.canvas),St()):It(a)),n.onFullScreen&&n.onFullScreen(mt),n.onFullscreen&&n.onFullscreen(mt)}void 0===(Mt=e)&&(Mt=!0),void 0===(kt=t)&&(kt=!1);var a=n.canvas;yt||(yt=!0,document.addEventListener("fullscreenchange",r,!1),document.addEventListener("mozfullscreenchange",r,!1),document.addEventListener("webkitfullscreenchange",r,!1),document.addEventListener("MSFullscreenChange",r,!1));var i=document.createElement("div");a.parentNode.insertBefore(i,a),i.appendChild(a),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()}(e,t)},n.requestAnimationFrame=function(e){At(e)},n.setCanvasSize=function(e,t,r){It(n.canvas,e,t),r||St()},n.pauseMainLoop=function(){ut=null,ct++},n.resumeMainLoop=function(){ct++;var t=ft,r=lt,a=_t;_t=null,function(e){p=!0,w(!_t,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),_t=e;var t=ct;ot=function(){if(!g)if(0<pt.length){var r=Date.now(),a=pt.shift();if(a.da(a.L),st){var i=st,o=0==i%1?i-1:Math.floor(i);st=a.Sa?o:(8*i+(o+.5))/9}console.log('main loop blocker "'+a.name+'" took '+(Date.now()-r)+" ms"),n.setStatus&&(r=n.statusMessage||"Please wait...",a=st,i=ht.Ua,a?a<i?n.setStatus(r+" ("+(i-a)+"/"+i+")"):n.setStatus(r):n.setStatus("")),t<ct||setTimeout(ot,0)}else if(!(t<ct))if(dt=dt+1|0,1==ft&&1<lt&&0!=dt%lt)ut();else{0==ft&&(it=te());e:if(!(g||n.preMainLoop&&!1===n.preMainLoop())){try{e()}catch(e){if(e instanceof yr||"unwind"==e)break e;throw e&&"object"==typeof e&&e.stack&&m("exception thrown: "+[e,e.stack]),e}n.postMainLoop&&n.postMainLoop()}t<ct||("object"==typeof SDL&&SDL.audio&&SDL.audio.Ba&&SDL.audio.Ba(),ut())}}}(a),function(t,r){if(ft=t,lt=r,_t)if(0==t)ut=function(){var e=0|Math.max(0,it+r-te());setTimeout(ot,e)};else if(1==t)ut=function(){At(ot)};else if(2==t){if(void 0===e){var a=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),a.shift()())}),!0),e=function(e){a.push(e),void 0===n.setImmediates&&(n.setImmediates=[]),n.setImmediates.push(e),postMessage({target:"setimmediate"})}}ut=function(){e(ot)}}}(t,r),ut()},n.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},n.createContext=function(e,t,r,n){return vt(e,t,r,n)},function(e,t){try{var r=indexedDB.open("emscripten_filesystem",1)}catch(e){return void t()}r.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},r.onsuccess=function(e){!function(e){Bt=e,Z()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){Bt=!1,Z()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||Y(),q.push({da:function(){_r()}});var ur={__clock_gettime:function(e,t){return ae(e,t)},__cxa_allocate_exception:function(e){return lr(e+16)+16},__cxa_atexit:function(){},__cxa_throw:function(e,t,r){throw new ie(e).ua(t,r),e},__sys_fcntl64:function(e,t,r){rt=r;try{var n=at(e);switch(t){case 0:var a=nt();return 0>a?-28:Xe(n.path,n.flags,0,a).v;case 1:case 2:return 0;case 3:return n.flags;case 4:return a=nt(),n.flags|=a,0;case 12:return a=nt(),E[a+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return z[dr()>>2]=28,-1;default:return-28}}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_getpid:function(){return 42},__sys_ioctl:function(e,t,r){rt=r;try{var n=at(e);switch(t){case 21509:case 21505:return n.h?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.h?0:-59;case 21519:if(!n.h)return-59;var a=nt();return z[a>>2]=0;case 21520:return n.h?-28:-59;case 21531:if(e=a=nt(),!n.f.wa)throw new xe(59);return n.f.wa(n,t,e);case 21523:case 21524:return n.h?0:-59;default:K("bad ioctl syscall "+t)}}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_lstat64:function(e,t){try{return tt(Ge,e=L(e),t)}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_open:function(e,t,r){rt=r;try{return Xe(L(e),t,r?nt():0).v}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_stat64:function(e,t){try{return tt(He,e=L(e),t)}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_symlink:function(e,t){try{return je(e=L(e),t=L(t)),0}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_uname:function(e){try{if(!e)return-21;var t={__size__:390,domainname:325,machine:260,nodename:65,release:130,sysname:0,version:195};return B("Emscripten",e+t.sysname),B("emscripten",e+t.nodename),B("1.0",e+t.release),B("#1",e+t.version),B("x86-JS",e+t.machine),0}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},__sys_unlink:function(e){try{var t=Ae(e=L(e),{parent:!0}).node,r=ce(e),n=Re(t,r);e:{try{var a=Re(t,r)}catch(e){var i=e.i;break e}var o=Le(t,"wx");i=o||(16384==(61440&a.mode)?31:0)}if(i)throw new xe(i);if(!t.c.S)throw new xe(63);if(n.H)throw new xe(10);try{ke.willDeletePath&&ke.willDeletePath(e)}catch(t){m("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.c.S(t,r);var s=Te(n.parent.id,n.name);if(ye[s]===n)ye[s]=n.B;else for(var u=ye[s];u;){if(u.B===n){u.B=n.B;break}u=u.B}try{ke.onDeletePath&&ke.onDeletePath(e)}catch(t){m("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}return 0}catch(e){return void 0!==et&&e instanceof xe||K(e),-e.i}},_emscripten_fetch_free:function(e){delete Ct[e-1]},abort:function(){K()},clock_gettime:ae,emgfx:function(){self.postMessage({t:"gfx"})},emidentity:function(){var e=new URL(location.origin).hostname;if(0===e.length&&(e=new URL(location.href.replace("blob:","")).hostname),/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))0===e.indexOf("10.")&&(e="10.*"),0===e.indexOf("192.168.")&&(e="192.168.*"),0===e.indexOf("172.")&&(e="172.*"),0===e.indexOf("127.")&&(e="127.*");else{var t=new RegExp("("+String.fromCharCode(92)+".ngrok"+String.fromCharCode(92)+".io)$","i");t.test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.arweb.app")}t=I(e)+1;var r=lr(t);return S(e,x,r,t+1),r},emlicerr:function(){self.postMessage({t:"licerr"})},emscripten_asm_const_int:function(e,t,r){var n;for(ir.length=0,r>>=2;n=x[t++];)(n=105>n)&&1&r&&r++,ir.push(n?F[r++>>1]:z[r]),++r;return re[e].apply(null,ir)},emscripten_async_call:function(e,t,r){function n(){U.get(e)(t)}p=!0,0<=r?zt(n,r):function(e){At((function(){g||e()}))}(n)},emscripten_is_main_browser_thread:Dt,emscripten_memcpy_big:function(e,t,r){x.copyWithin(e,t,t+r)},emscripten_resize_heap:function(e){e>>>=0;var t=x.length;if(2147483648<e)return!1;for(var r=1;4>=r;r*=2){var n=t*(1+.2/r);n=Math.min(n,e+100663296),0<(n=Math.max(16777216,e,n))%65536&&(n+=65536-n%65536);e:{try{b.grow(Math.min(2147483648,n)-M.byteLength+65535>>>16),C();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},emscripten_start_fetch:function(e,t,r,n,a){function i(e,r){qt(e,r.response,(function(e){l?U.get(l)(e):t&&t(e)}),(function(e){l?U.get(l)(e):t&&t(e)}))}function o(e){m?U.get(m)(e):a&&a(e)}function s(e){d?U.get(d)(e):r&&r(e)}function u(e){h?U.get(h)(e):n&&n(e)}function c(e){l?U.get(l)(e):t&&t(e)}void 0!==p&&(p=!0);var _=e+112,f=L(_),l=T[_+36>>2],d=T[_+40>>2],h=T[_+44>>2],m=T[_+48>>2],b=T[_+52>>2],g=!!(4&b),w=!!(32&b);if(b=!!(16&b),"EM_IDB_STORE"===f)f=T[_+84>>2],qt(e,x.slice(f,f+T[_+88>>2]),c,s);else if("EM_IDB_DELETE"===f)!function(e,t,r){var n=Bt;if(n){var a=T[e+112+64>>2];a||(a=T[e+8>>2]),a=L(a);try{var i=n.transaction(["FILES"],"readwrite").objectStore("FILES").delete(a);i.onsuccess=function(r){r=r.target.result,T[e+12>>2]=0,Ut(e+16,0),Ut(e+24,0),Ut(e+32,0),A[e+40>>1]=4,A[e+42>>1]=200,S("OK",x,e+44,64),t(e,0,r)},i.onerror=function(t){A[e+40>>1]=4,A[e+42>>1]=404,S("Not Found",x,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,s);else if(b){if(w)return 0;Vt(e,g?i:c,s,u,o)}else!function(e,t,r){var n=Bt;if(n){var a=T[e+112+64>>2];a||(a=T[e+8>>2]),a=L(a);try{var i=n.transaction(["FILES"],"readonly").objectStore("FILES").get(a);i.onsuccess=function(n){if(n.target.result){var a=(n=n.target.result).byteLength||n.length,i=lr(a);x.set(new Uint8Array(n),i),T[e+12>>2]=i,Ut(e+16,a),Ut(e+24,0),Ut(e+32,a),A[e+40>>1]=4,A[e+42>>1]=200,S("OK",x,e+44,64),t(e,0,n)}else A[e+40>>1]=4,A[e+42>>1]=404,S("Not Found",x,e+44,64),r(e,0,"no data")},i.onerror=function(t){A[e+40>>1]=4,A[e+42>>1]=404,S("Not Found",x,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,w?s:g?function(e){Vt(e,i,s,u,o)}:function(e){Vt(e,c,s,u,o)});return e},emscripten_thread_sleep:function(e){for(var t=te();te()-t<e;);},environ_get:function(e,t){try{var r=0;return Wt().forEach((function(n,a){var i=t+r;z[e+4*a>>2]=i,B(n,i),r+=n.length+1})),0}catch(e){return void 0!==et&&e instanceof xe||K(e),e.i}},environ_sizes_get:function(e,t){try{var r=Wt();z[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),z[t>>2]=n,0}catch(e){return void 0!==et&&e instanceof xe||K(e),e.i}},exit:function(e){p||(n.onExit&&n.onExit(e),g=!0),c(e,new yr(e))},fd_close:function(e){try{var t=at(e);if(null===t.v)throw new xe(8);t.W&&(t.W=null);try{t.f.close&&t.f.close(t)}catch(e){throw e}finally{we[t.v]=null}return t.v=null,0}catch(e){return void 0!==et&&e instanceof xe||K(e),e.i}},fd_read:function(e,t,r,n){try{e:{for(var a=at(e),i=e=0;i<r;i++){var o=z[t+(8*i+4)>>2],s=a,u=z[t+8*i>>2],c=o,_=void 0,f=k;if(0>c||0>_)throw new xe(28);if(null===s.v)throw new xe(8);if(1==(2097155&s.flags))throw new xe(8);if(16384==(61440&s.node.mode))throw new xe(31);if(!s.f.read)throw new xe(28);var l=void 0!==_;if(l){if(!s.seekable)throw new xe(70)}else _=s.position;var d=s.f.read(s,f,u,c,_);l||(s.position+=d);var p=d;if(0>p){var h=-1;break e}if(e+=p,p<o)break}h=e}return z[n>>2]=h,0}catch(e){return void 0!==et&&e instanceof xe||K(e),e.i}},fd_seek:function(e,t,r,n,a){try{var i=at(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(Ye(i,e,n),ee=[i.position>>>0,(Q=i.position,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],z[a>>2]=ee[0],z[a+4>>2]=ee[1],i.W&&0===e&&0===n&&(i.W=null),0)}catch(e){return void 0!==et&&e instanceof xe||K(e),e.i}},fd_write:function(e,t,r,n){try{e:{for(var a=at(e),i=e=0;i<r;i++){var o=a,s=z[t+8*i>>2],u=z[t+(8*i+4)>>2],c=void 0,_=k;if(0>u||0>c)throw new xe(28);if(null===o.v)throw new xe(8);if(0==(2097155&o.flags))throw new xe(8);if(16384==(61440&o.node.mode))throw new xe(31);if(!o.f.write)throw new xe(28);o.seekable&&1024&o.flags&&Ye(o,0,2);var f=void 0!==c;if(f){if(!o.seekable)throw new xe(70)}else c=o.position;var l=o.f.write(o,_,s,u,c,void 0);f||(o.position+=l);try{o.path&&ke.onWriteToFile&&ke.onWriteToFile(o.path)}catch(e){m("FS.trackingDelegate['onWriteToFile']('"+o.path+"') threw an exception: "+e.message)}var d=l;if(0>d){var p=-1;break e}e+=d}p=e}return z[n>>2]=p,0}catch(e){return void 0!==et&&e instanceof xe||K(e),e.i}},gettimeofday:function(e){var t=Date.now();return z[e>>2]=t/1e3|0,z[e+4>>2]=t%1e3*1e3|0,0},glBindTexture:function(e,t){ar.bindTexture(e,Gt[t])},glGenTextures:function(e,t){for(var r=0;r<e;r++){var n=ar.createTexture(),a=n&&Yt(Gt);n?(n.name=a,Gt[a]=n):Zt||(Zt=1282),z[t+4*r>>2]=a}},glTexImage2D:function(e,t,r,n,a,i,o,s,u){ar.texImage2D(e,t,r,n,a,i,o,s,u?function(e,t,r,n,a){e=1==(e-=5120)?x:4==e?z:6==e?R:5==e||28922==e?T:A;var i=31-Math.clz32(e.BYTES_PER_ELEMENT);return e.subarray(a>>i,a+n*(r*({5:3,6:4,8:2,29502:3,29504:4}[t-6402]||1)*(1<<i)+4-1&-4)>>i)}(s,o,n,a,u):null)},glTexParameteri:function(e,t,r){ar.texParameteri(e,t,r)},localtime_r:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!Jt){Jt=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),n=new Date(t,6,1);t=r.getTimezoneOffset();var a=n.getTimezoneOffset(),i=Math.max(t,a);z[mr()>>2]=60*i,z[hr()>>2]=Number(t!=a),r=e(r),n=e(n),r=D(r),n=D(n),a<t?(z[pr()>>2]=r,z[pr()+4>>2]=n):(z[pr()>>2]=n,z[pr()+4>>2]=r)}}(),e=new Date(1e3*z[e>>2]),z[t>>2]=e.getSeconds(),z[t+4>>2]=e.getMinutes(),z[t+8>>2]=e.getHours(),z[t+12>>2]=e.getDate(),z[t+16>>2]=e.getMonth(),z[t+20>>2]=e.getFullYear()-1900,z[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);z[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,z[t+36>>2]=-60*e.getTimezoneOffset();var n=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(n!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,n)),z[t+32>>2]=e,e=z[pr()+(e?4:0)>>2],z[t+40>>2]=e,t},pthread_create:function(){return 6},pthread_join:function(){return 28},setTempRet0:function(){},strftime_l:function(e,t,r,n){return function(e,t,r,n){function a(e,t,r){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=r[0]+e;return e}function i(e,t){return a(e,t,"0")}function o(e,t){function r(e){return 0>e?-1:0<e?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function u(e){e=nr(new Date(e.l+1900,0,1),e.R);var t=new Date(e.getFullYear()+1,0,4),r=s(new Date(e.getFullYear(),0,4));return t=s(t),0>=o(r,e)?0>=o(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=z[n+40>>2];for(var _ in n={La:z[n>>2],Ka:z[n+4>>2],O:z[n+8>>2],K:z[n+12>>2],F:z[n+16>>2],l:z[n+20>>2],P:z[n+24>>2],R:z[n+28>>2],ab:z[n+32>>2],Ja:z[n+36>>2],Ma:c?L(c):""},r=L(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(_,"g"),c[_]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),l="January February March April May June July August September October November December".split(" ");for(_ in c={"%a":function(e){return f[e.P].substring(0,3)},"%A":function(e){return f[e.P]},"%b":function(e){return l[e.F].substring(0,3)},"%B":function(e){return l[e.F]},"%C":function(e){return i((e.l+1900)/100|0,2)},"%d":function(e){return i(e.K,2)},"%e":function(e){return a(e.K,2," ")},"%g":function(e){return u(e).toString().substring(2)},"%G":function(e){return u(e)},"%H":function(e){return i(e.O,2)},"%I":function(e){return 0==(e=e.O)?e=12:12<e&&(e-=12),i(e,2)},"%j":function(e){return i(e.K+er(Qt(e.l+1900)?tr:rr,e.F-1),3)},"%m":function(e){return i(e.F+1,2)},"%M":function(e){return i(e.Ka,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.O&&12>e.O?"AM":"PM"},"%S":function(e){return i(e.La,2)},"%t":function(){return"\t"},"%u":function(e){return e.P||7},"%U":function(e){var t=new Date(e.l+1900,0,1),r=0===t.getDay()?t:nr(t,7-t.getDay());return 0>o(r,e=new Date(e.l+1900,e.F,e.K))?i(Math.ceil((31-r.getDate()+(er(Qt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%V":function(e){var t=new Date(e.l+1901,0,4),r=s(new Date(e.l+1900,0,4));t=s(t);var n=nr(new Date(e.l+1900,0,1),e.R);return 0>o(n,r)?"53":0>=o(t,n)?"01":i(Math.ceil((r.getFullYear()<e.l+1900?e.R+32-r.getDate():e.R+1-r.getDate())/7),2)},"%w":function(e){return e.P},"%W":function(e){var t=new Date(e.l,0,1),r=1===t.getDay()?t:nr(t,0===t.getDay()?1:7-t.getDay()+1);return 0>o(r,e=new Date(e.l+1900,e.F,e.K))?i(Math.ceil((31-r.getDate()+(er(Qt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%y":function(e){return(e.l+1900).toString().substring(2)},"%Y":function(e){return e.l+1900},"%z":function(e){var t=0<=(e=e.Ja);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Ma},"%%":function(){return"%"}})0<=r.indexOf(_)&&(r=r.replace(new RegExp(_,"g"),c[_](n)));return(_=sr(r,!1)).length>t?0:(k.set(_,e),_.length-1)}(e,t,r,n)},sysconf:function(e){switch(e){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return z[dr()>>2]=28,-1},time:function(e){var t=Date.now()/1e3|0;return e&&(z[e>>2]=t),t}},cr=function(){function e(e){n.asm=e.exports,b=n.asm.memory,C(),U=n.asm.__indirect_function_table,Z()}var t={env:ur,wasi_snapshot_preview1:ur};if(Y(),n.instantiateWasm)try{return n.instantiateWasm(t,e)}catch(e){return m("Module.instantiateWasm callback failed with error: "+e),!1}return t=function(e){var t=J;try{e:{try{if(t==J&&d){var r=new Uint8Array(d);break e}if(_){r=_(t);break e}throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(e){K(e)}r=void 0}var n=new WebAssembly.Module(r),a=new WebAssembly.Instance(n,e)}catch(t){throw e=t.toString(),m("failed to compile wasm module: "+e),(0<=e.indexOf("imported Memory")||0<=e.indexOf("memory import"))&&m("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),t}return[a,n]}(t),e(t[0],t[1]),n.asm}(),_r=n.___wasm_call_ctors=cr.__wasm_call_ctors;n._zappar_has_initialized=cr.zappar_has_initialized,n._zappar_invert=cr.zappar_invert,n._zappar_loaded=cr.zappar_loaded,n._zappar_pipeline_create=cr.zappar_pipeline_create,n._zappar_pipeline_destroy=cr.zappar_pipeline_destroy,n._zappar_pipeline_camera_frame_submit=cr.zappar_pipeline_camera_frame_submit,n._zappar_pipeline_camera_frame_submit_raw_pointer=cr.zappar_pipeline_camera_frame_submit_raw_pointer,n._zappar_pipeline_frame_update=cr.zappar_pipeline_frame_update,n._zappar_pipeline_camera_frame_user_data=cr.zappar_pipeline_camera_frame_user_data,n._zappar_pipeline_camera_model=cr.zappar_pipeline_camera_model,n._zappar_pipeline_frame_number=cr.zappar_pipeline_frame_number,n._zappar_pipeline_motion_accelerometer_submit=cr.zappar_pipeline_motion_accelerometer_submit,n._zappar_pipeline_motion_rotation_rate_submit=cr.zappar_pipeline_motion_rotation_rate_submit,n._zappar_pipeline_motion_attitude_submit=cr.zappar_pipeline_motion_attitude_submit,n._zappar_pipeline_motion_attitude_matrix_submit=cr.zappar_pipeline_motion_attitude_matrix_submit,n._zappar_pipeline_camera_frame_user_facing=cr.zappar_pipeline_camera_frame_user_facing,n._zappar_pipeline_camera_frame_texture_matrix=cr.zappar_pipeline_camera_frame_texture_matrix,n._zappar_pipeline_camera_pose_with_attitude=cr.zappar_pipeline_camera_pose_with_attitude,n._zappar_pipeline_camera_pose_with_origin=cr.zappar_pipeline_camera_pose_with_origin,n._zappar_pipeline_camera_frame_camera_attitude=cr.zappar_pipeline_camera_frame_camera_attitude,n._zappar_pipeline_camera_frame_device_attitude=cr.zappar_pipeline_camera_frame_device_attitude,n._zappar_pipeline_camera_frame_texture_gl=cr.zappar_pipeline_camera_frame_texture_gl,n._zappar_pipeline_camera_frame_upload_gl=cr.zappar_pipeline_camera_frame_upload_gl,n._zappar_pipeline_sequence_record_start=cr.zappar_pipeline_sequence_record_start,n._zappar_pipeline_sequence_record_stop=cr.zappar_pipeline_sequence_record_stop,n._zappar_pipeline_sequence_record_clear=cr.zappar_pipeline_sequence_record_clear,n._zappar_pipeline_sequence_record_device_attitude_matrices_set=cr.zappar_pipeline_sequence_record_device_attitude_matrices_set,n._zappar_pipeline_sequence_record_data_size=cr.zappar_pipeline_sequence_record_data_size,n._zappar_pipeline_sequence_record_data=cr.zappar_pipeline_sequence_record_data,n._zappar_pipeline_process_gl=cr.zappar_pipeline_process_gl,n._zappar_pipeline_camera_pose_default=cr.zappar_pipeline_camera_pose_default,n._zappar_instant_world_tracker_create=cr.zappar_instant_world_tracker_create,n._zappar_instant_world_tracker_destroy=cr.zappar_instant_world_tracker_destroy,n._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=cr.zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw,n._zappar_instant_world_tracker_anchor_pose_raw=cr.zappar_instant_world_tracker_anchor_pose_raw,n._zappar_instant_world_tracker_enabled_set=cr.zappar_instant_world_tracker_enabled_set,n._zappar_instant_world_tracker_enabled=cr.zappar_instant_world_tracker_enabled,n._zappar_image_tracker_create=cr.zappar_image_tracker_create,n._zappar_image_tracker_destroy=cr.zappar_image_tracker_destroy,n._zappar_image_tracker_target_load_from_memory=cr.zappar_image_tracker_target_load_from_memory,n.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=cr._Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc;var fr=n._free=cr.free;n._zappar_image_tracker_anchor_count=cr.zappar_image_tracker_anchor_count,n._zappar_image_tracker_anchor_id=cr.zappar_image_tracker_anchor_id,n._zappar_image_tracker_anchor_pose_raw=cr.zappar_image_tracker_anchor_pose_raw,n._zappar_image_tracker_enabled_set=cr.zappar_image_tracker_enabled_set,n._zappar_image_tracker_enabled=cr.zappar_image_tracker_enabled,n._zappar_image_tracker_target_loaded_version=cr.zappar_image_tracker_target_loaded_version,n._zappar_image_tracker_target_count=cr.zappar_image_tracker_target_count,n.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=cr._Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii,n.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=cr._Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii,n.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=cr._Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii,n.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=cr._Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii,n.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=cr._Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii,n.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=cr._Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii,n.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=cr._Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii,n._zappar_face_tracker_create=cr.zappar_face_tracker_create,n._zappar_face_tracker_destroy=cr.zappar_face_tracker_destroy,n._zappar_face_tracker_model_load_from_memory=cr.zappar_face_tracker_model_load_from_memory,n._zappar_face_tracker_anchor_count=cr.zappar_face_tracker_anchor_count,n._zappar_face_tracker_anchor_id=cr.zappar_face_tracker_anchor_id,n._zappar_face_tracker_anchor_pose_raw=cr.zappar_face_tracker_anchor_pose_raw,n._zappar_face_tracker_anchor_identity_coefficients=cr.zappar_face_tracker_anchor_identity_coefficients,n._zappar_face_tracker_anchor_expression_coefficients=cr.zappar_face_tracker_anchor_expression_coefficients,n._zappar_face_tracker_enabled_set=cr.zappar_face_tracker_enabled_set,n._zappar_face_tracker_enabled=cr.zappar_face_tracker_enabled,n._zappar_face_tracker_max_faces_set=cr.zappar_face_tracker_max_faces_set,n._zappar_face_tracker_max_faces=cr.zappar_face_tracker_max_faces,n._zappar_face_tracker_model_loaded_version=cr.zappar_face_tracker_model_loaded_version,n._zappar_face_landmark_create=cr.zappar_face_landmark_create,n._zappar_face_landmark_destroy=cr.zappar_face_landmark_destroy,n.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=cr._Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i,n._zappar_face_landmark_anchor_pose=cr.zappar_face_landmark_anchor_pose,n._zappar_barcode_finder_create=cr.zappar_barcode_finder_create,n._zappar_barcode_finder_destroy=cr.zappar_barcode_finder_destroy,n._zappar_barcode_finder_found_number=cr.zappar_barcode_finder_found_number,n._zappar_barcode_finder_found_text=cr.zappar_barcode_finder_found_text,n._zappar_barcode_finder_enabled_set=cr.zappar_barcode_finder_enabled_set,n._zappar_barcode_finder_enabled=cr.zappar_barcode_finder_enabled,n._zappar_barcode_finder_found_format=cr.zappar_barcode_finder_found_format,n._zappar_barcode_finder_formats=cr.zappar_barcode_finder_formats,n._zappar_barcode_finder_formats_set=cr.zappar_barcode_finder_formats_set;var lr=n._malloc=cr.malloc;n._zappar_face_mesh_create=cr.zappar_face_mesh_create,n._zappar_face_mesh_destroy=cr.zappar_face_mesh_destroy,n.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=cr._Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii,n.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=cr._Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti,n.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=cr._Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti,n.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=cr._Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti,n.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=cr._Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti,n.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=cr._Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti,n.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=cr._Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti,n.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=cr._Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti,n.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=cr._Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i,n.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=cr._Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti,n.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=cr._Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti,n._zappar_camera_source_create=cr.zappar_camera_source_create,n._zappar_camera_source_destroy=cr.zappar_camera_source_destroy,n._zappar_camera_source_start=cr.zappar_camera_source_start,n._zappar_camera_source_pause=cr.zappar_camera_source_pause,n._zappar_camera_default_device_id=cr.zappar_camera_default_device_id,n._zappar_sequence_source_create=cr.zappar_sequence_source_create,n.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=cr._Z28zappar_sequence_source_startP25zappar_sequence_source_ti,n.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=cr._Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci,n.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=cr._Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti,n._zappar_sequence_source_destroy=cr.zappar_sequence_source_destroy,n._zappar_log_level_set=cr.zappar_log_level_set,n._zappar_log_level=cr.zappar_log_level,n.___em_js__emidentity=cr.__em_js__emidentity,n._zappar_analytics_project_id_set=cr.zappar_analytics_project_id_set,n.___em_js__emlicerr=cr.__em_js__emlicerr,n.___em_js__emgfx=cr.__em_js__emgfx;var dr=n.___errno_location=cr.__errno_location;n._ntohs=cr.ntohs,n._htons=cr.htons,n._htonl=cr.htonl,n._usleep=cr.usleep;var pr=n.__get_tzname=cr._get_tzname,hr=n.__get_daylight=cr._get_daylight,mr=n.__get_timezone=cr._get_timezone;n._emscripten_main_thread_process_queued_calls=cr.emscripten_main_thread_process_queued_calls;var br,gr=n.stackSave=cr.stackSave,wr=n.stackRestore=cr.stackRestore,vr=n.stackAlloc=cr.stackAlloc;function yr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Mr(){function e(){if(!br&&(br=!0,n.calledRun=!0,!g)){if(n.noFSInit||De||(De=!0,Ze(),n.stdin=n.stdin,n.stdout=n.stdout,n.stderr=n.stderr,n.stdin?Ke("stdin",n.stdin):je("/dev/tty","/dev/stdin"),n.stdout?Ke("stdout",null,n.stdout):je("/dev/tty","/dev/stdout"),n.stderr?Ke("stderr",null,n.stderr):je("/dev/tty1","/dev/stderr"),Xe("/dev/stdin",0),Xe("/dev/stdout",1),Xe("/dev/stderr",1)),ne(q),Me=!1,ne(N),a(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();j.unshift(e)}ne(j)}}if(!(0<H)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)W();ne(V),0<H||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e())}}if(n._setThrew=cr.setThrew,n.dynCall_viijii=cr.dynCall_viijii,n.dynCall_vij=cr.dynCall_vij,n.dynCall_iiji=cr.dynCall_iiji,n.dynCall_viji=cr.dynCall_viji,n.dynCall_vijii=cr.dynCall_vijii,n.dynCall_ji=cr.dynCall_ji,n.dynCall_jiji=cr.dynCall_jiji,n.dynCall_iiiiij=cr.dynCall_iiiiij,n.dynCall_iiiiijj=cr.dynCall_iiiiijj,n.dynCall_iiiiiijj=cr.dynCall_iiiiiijj,n.cwrap=function(e,t,r,n){var a=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&a&&!n?v(e):function(){return y(e,t,r,arguments)}},n.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":k[e>>0]=t;break;case"i16":E[e>>1]=t;break;case"i32":z[e>>2]=t;break;case"i64":ee=[t>>>0,(Q=t,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],z[e>>2]=ee[0],z[e+4>>2]=ee[1];break;case"float":R[e>>2]=t;break;case"double":F[e>>3]=t;break;default:K("invalid type for setValue: "+r)}},n.getValue=function(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return k[e>>0];case"i16":return E[e>>1];case"i32":case"i64":return z[e>>2];case"float":return R[e>>2];case"double":return F[e>>3];default:K("invalid type for getValue: "+t)}return null},n.UTF8ToString=L,X=function e(){br||Mr(),br||(X=e)},n.run=Mr,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();return p=!0,Mr(),t});t.default=n}.call(this,r(6).setImmediate)},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(7),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(2))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,a,i,o,s,u=1,c={},_=!1,f=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(a=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(o+t,"*")}),l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var a={callback:e,args:t};return c[u]=a,n(u),u++},l.clearImmediate=d}function d(e){delete c[e]}function p(e){if(_)setTimeout(p,0,e);else{var t=c[e];if(t){_=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),_=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(2),r(8))},function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var u,c=[],_=!1,f=-1;function l(){_&&u&&(_=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!_){var e=s(l);_=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,_=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||_||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=h,a.addListener=h,a.once=h,a.off=h,a.removeListener=h,a.removeAllListeners=h,a.emit=h,a.prependListener=h,a.prependOnceListener=h,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRuntimeObject=void 0,t.getRuntimeObject=function(e){let t=e.cwrap("zappar_log_level","number",[]),r=e.cwrap("zappar_log_level_set",null,["number"]),n=e.cwrap("zappar_analytics_project_id_set",null,["string"]),a=e.cwrap("zappar_pipeline_create","number",[]),i=e.cwrap("zappar_pipeline_destroy",null,["number"]),o=e.cwrap("zappar_pipeline_frame_update",null,["number"]),s=e.cwrap("zappar_pipeline_frame_number","number",["number"]),u=e.cwrap("zappar_pipeline_camera_model","number",["number"]),c=e.cwrap("zappar_pipeline_camera_frame_user_data","number",["number"]),_=e.cwrap("zappar_pipeline_camera_frame_submit",null,["number","number","number","number","number","number","number","number","number"]),f=e.cwrap("zappar_pipeline_camera_frame_submit_raw_pointer",null,["number","number","number","number","number","number","number","number","number","number","number"]),l=e.cwrap("zappar_pipeline_camera_frame_camera_attitude","number",["number"]),d=e.cwrap("zappar_pipeline_camera_frame_device_attitude","number",["number"]),p=e.cwrap("zappar_pipeline_motion_accelerometer_submit",null,["number","number","number","number","number"]),h=e.cwrap("zappar_pipeline_motion_rotation_rate_submit",null,["number","number","number","number","number"]),m=e.cwrap("zappar_pipeline_motion_attitude_submit",null,["number","number","number","number","number"]),b=e.cwrap("zappar_pipeline_motion_attitude_matrix_submit",null,["number","number"]),g=e.cwrap("zappar_camera_source_create","number",["number","string"]),w=e.cwrap("zappar_camera_source_destroy",null,["number"]),v=e.cwrap("zappar_sequence_source_create","number",["number"]),y=e.cwrap("zappar_sequence_source_destroy",null,["number"]),M=e.cwrap("zappar_image_tracker_create","number",["number"]),k=e.cwrap("zappar_image_tracker_destroy",null,["number"]),x=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),E=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),A=e.cwrap("zappar_image_tracker_target_count","number",["number"]),z=e.cwrap("zappar_image_tracker_enabled","number",["number"]),T=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),R=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),F=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),O=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),P=e.cwrap("zappar_face_tracker_create","number",["number"]),L=e.cwrap("zappar_face_tracker_destroy",null,["number"]),S=e.cwrap("zappar_face_tracker_model_load_from_memory",null,["number","number","number"]),I=e.cwrap("zappar_face_tracker_model_loaded_version","number",["number"]),D=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),B=e.cwrap("zappar_face_tracker_enabled","number",["number"]),C=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),U=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),V=e.cwrap("zappar_face_tracker_anchor_count","number",["number"]),q=e.cwrap("zappar_face_tracker_anchor_id","string",["number","number"]),N=e.cwrap("zappar_face_tracker_anchor_pose_raw","number",["number","number"]),j=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),W=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),H=e.cwrap("zappar_face_mesh_create","number",[]),G=e.cwrap("zappar_face_mesh_destroy",null,["number"]),X=e.cwrap("zappar_face_landmark_create","number",["number"]),Y=e.cwrap("zappar_face_landmark_destroy",null,["number"]),Z=e.cwrap("zappar_barcode_finder_create","number",["number"]),K=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),J=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),$=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),Q=e.cwrap("zappar_barcode_finder_found_number","number",["number"]),ee=e.cwrap("zappar_barcode_finder_found_text","string",["number","number"]),te=e.cwrap("zappar_barcode_finder_found_format","number",["number","number"]),re=e.cwrap("zappar_barcode_finder_formats","number",["number"]),ne=e.cwrap("zappar_barcode_finder_formats_set",null,["number","number"]),ae=e.cwrap("zappar_instant_world_tracker_create","number",["number"]),ie=e.cwrap("zappar_instant_world_tracker_destroy",null,["number"]),oe=e.cwrap("zappar_instant_world_tracker_enabled_set",null,["number","number"]),se=e.cwrap("zappar_instant_world_tracker_enabled","number",["number"]),ue=e.cwrap("zappar_instant_world_tracker_anchor_pose_raw","number",["number"]),ce=e.cwrap("zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw",null,["number","number","number","number","number"]),_e=32,fe=e._malloc(_e),le=(e._malloc(64),new Map),de=(t,r)=>{let n=le.get(t);return(!n||n[0]<r)&&(n&&e._free(n[1]),n=[r,e._malloc(r)],le.set(t,n)),n[1]};return{log_level:()=>t(),log_level_set:e=>r(e),analytics_project_id_set:e=>n(e),pipeline_create:()=>a(),pipeline_destroy:()=>{i()},pipeline_frame_update:e=>o(e),pipeline_frame_number:e=>s(e),pipeline_camera_model:t=>{let r=u(t),n=new Float32Array(6);return n.set(e.HEAPF32.subarray(r/4,6+r/4)),r=n,r},pipeline_camera_frame_user_data:e=>c(e),pipeline_camera_frame_submit:(t,r,n,a,i,o,s,u)=>{_e<r.byteLength&&(e._free(fe),_e=r.byteLength,fe=e._malloc(_e));let c=fe,f=r.byteLength;e.HEAPU8.set(new Uint8Array(r),fe);let l=n,d=a,p=i,h=de(4,o.byteLength);e.HEAPF32.set(o,h/4);let m=de(5,s.byteLength);return e.HEAPF32.set(s,m/4),_(t,c,f,l,d,p,h,m,u?1:0)},pipeline_camera_frame_submit_raw_pointer:(t,r,n,a,i,o,s,u,c,_,l)=>{let d=r,p=n,h=a,m=i,b=o,g=s,w=de(6,u.byteLength);e.HEAPF32.set(u,w/4);let v=c,y=de(8,_.byteLength);return e.HEAPF32.set(_,y/4),f(t,d,p,h,m,b,g,w,v,y,l?1:0)},pipeline_camera_frame_camera_attitude:t=>{let r=l(t),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(r/4,16+r/4)),r=n,r},pipeline_camera_frame_device_attitude:t=>{let r=d(t),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(r/4,16+r/4)),r=n,r},pipeline_motion_accelerometer_submit:(e,t,r,n,a)=>p(e,t,r,n,a),pipeline_motion_rotation_rate_submit:(e,t,r,n,a)=>h(e,t,r,n,a),pipeline_motion_attitude_submit:(e,t,r,n,a)=>m(e,t,r,n,a),pipeline_motion_attitude_matrix_submit:(t,r)=>{let n=de(0,r.byteLength);return e.HEAPF32.set(r,n/4),b(t,n)},camera_source_create:(e,t)=>g(e,t),camera_source_destroy:()=>{w()},sequence_source_create:e=>v(e),sequence_source_destroy:()=>{y()},image_tracker_create:e=>M(e),image_tracker_destroy:()=>{k()},image_tracker_target_load_from_memory:(t,r)=>{_e<r.byteLength&&(e._free(fe),_e=r.byteLength,fe=e._malloc(_e));let n=fe,a=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),x(t,n,a)},image_tracker_target_loaded_version:e=>E(e),image_tracker_target_count:e=>A(e),image_tracker_enabled:e=>{let t=z(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>T(e,t?1:0),image_tracker_anchor_count:e=>R(e),image_tracker_anchor_id:(e,t)=>F(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let n=O(t,r),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(n/4,16+n/4)),n=a,n},face_tracker_create:e=>P(e),face_tracker_destroy:()=>{L()},face_tracker_model_load_from_memory:(t,r)=>{_e<r.byteLength&&(e._free(fe),_e=r.byteLength,fe=e._malloc(_e));let n=fe,a=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),S(t,n,a)},face_tracker_model_loaded_version:e=>I(e),face_tracker_enabled_set:(e,t)=>D(e,t?1:0),face_tracker_enabled:e=>{let t=B(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>C(e,t),face_tracker_max_faces:e=>U(e),face_tracker_anchor_count:e=>V(e),face_tracker_anchor_id:(e,t)=>q(e,t),face_tracker_anchor_pose_raw:(t,r)=>{let n=N(t,r),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(n/4,16+n/4)),n=a,n},face_tracker_anchor_identity_coefficients:(t,r)=>{let n=j(t,r),a=new Float32Array(50);return a.set(e.HEAPF32.subarray(n/4,50+n/4)),n=a,n},face_tracker_anchor_expression_coefficients:(t,r)=>{let n=W(t,r),a=new Float32Array(29);return a.set(e.HEAPF32.subarray(n/4,29+n/4)),n=a,n},face_mesh_create:()=>H(),face_mesh_destroy:()=>{G()},face_landmark_create:e=>X(e),face_landmark_destroy:()=>{Y()},barcode_finder_create:e=>Z(e),barcode_finder_destroy:()=>{K()},barcode_finder_enabled_set:(e,t)=>J(e,t?1:0),barcode_finder_enabled:e=>{let t=$(e);return t=1===t,t},barcode_finder_found_number:e=>Q(e),barcode_finder_found_text:(e,t)=>ee(e,t),barcode_finder_found_format:(e,t)=>te(e,t),barcode_finder_formats:e=>re(e),barcode_finder_formats_set:(e,t)=>ne(e,t),instant_world_tracker_create:e=>ae(e),instant_world_tracker_destroy:()=>{ie()},instant_world_tracker_enabled_set:(e,t)=>oe(e,t?1:0),instant_world_tracker_enabled:e=>{let t=se(e);return t=1===t,t},instant_world_tracker_anchor_pose_raw:t=>{let r=ue(t),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(r/4,16+r/4)),r=n,r},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,n,a)=>ce(e,t,r,n,a)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zappar_server=void 0;const n=r(11),a=r(12);t.zappar_server=class{constructor(e,t){this._impl=e,this._sender=t,this._deserializer=new a.MessageDeserializer,this.serializersByPipelineId=new Map,this._pipeline_id_by_pipeline_id=new Map,this._pipeline_by_instance=new Map,this._pipeline_id_by_camera_source_id=new Map,this._camera_source_by_instance=new Map,this._pipeline_id_by_sequence_source_id=new Map,this._sequence_source_by_instance=new Map,this._pipeline_id_by_image_tracker_id=new Map,this._image_tracker_by_instance=new Map,this._pipeline_id_by_face_tracker_id=new Map,this._face_tracker_by_instance=new Map,this._pipeline_id_by_face_mesh_id=new Map,this._face_mesh_by_instance=new Map,this._pipeline_id_by_face_landmark_id=new Map,this._face_landmark_by_instance=new Map,this._pipeline_id_by_barcode_finder_id=new Map,this._barcode_finder_by_instance=new Map,this._pipeline_id_by_instant_world_tracker_id=new Map,this._instant_world_tracker_by_instance=new Map}processBuffer(e){this._deserializer.setData(e),this._deserializer.forMessages((e,t)=>{switch(e){case 34:this._impl.log_level_set(t.logLevel());break;case 31:this._impl.analytics_project_id_set(t.string());break;case 27:{let e=t.type(),r=this._impl.pipeline_create();this._pipeline_by_instance.set(e,r),this._pipeline_id_by_pipeline_id.set(e,e),this.serializersByPipelineId.set(e,new n.MessageSerializer(t=>{this._sender(e,t)}));break}case 28:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_destroy(r),this._pipeline_by_instance.delete(e);break}case 9:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_frame_update(r);break}case 8:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_camera_frame_submit(r,t.dataWithLength(),t.int(),t.int(),t.int(),t.matrix4x4(),t.cameraModel(),t.bool());break}case 10:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_accelerometer_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 11:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_rotation_rate_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 12:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 13:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_matrix_submit(r,t.matrix4x4());break}case 29:{let e=t.type(),r=t.type(),n=this._pipeline_by_instance.get(r),a=t.string(),i=this._impl.camera_source_create(n,a);this._camera_source_by_instance.set(e,i),this._pipeline_id_by_camera_source_id.set(e,r);break}case 30:{let e=t.type(),r=this._camera_source_by_instance.get(e);if(void 0===r)return;this._impl.camera_source_destroy(r),this._camera_source_by_instance.delete(e);break}case 35:{let e=t.type(),r=t.type(),n=this._pipeline_by_instance.get(r),a=this._impl.sequence_source_create(n);this._sequence_source_by_instance.set(e,a),this._pipeline_id_by_sequence_source_id.set(e,r);break}case 36:{let e=t.type(),r=this._sequence_source_by_instance.get(e);if(void 0===r)return;this._impl.sequence_source_destroy(r),this._sequence_source_by_instance.delete(e);break}case 2:{let e=t.type(),r=t.type(),n=this._pipeline_by_instance.get(r),a=this._impl.image_tracker_create(n);this._image_tracker_by_instance.set(e,a),this._pipeline_id_by_image_tracker_id.set(e,r);break}case 14:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_destroy(r),this._image_tracker_by_instance.delete(e);break}case 4:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_target_load_from_memory(r,t.dataWithLength());break}case 3:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_enabled_set(r,t.bool());break}case 20:{let e=t.type(),r=t.type(),n=this._pipeline_by_instance.get(r),a=this._impl.face_tracker_create(n);this._face_tracker_by_instance.set(e,a),this._pipeline_id_by_face_tracker_id.set(e,r);break}case 21:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_destroy(r),this._face_tracker_by_instance.delete(e);break}case 22:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_model_load_from_memory(r,t.dataWithLength());break}case 23:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_enabled_set(r,t.bool());break}case 24:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_max_faces_set(r,t.int());break}case 25:{let e=t.type(),r=this._impl.face_mesh_create();this._face_mesh_by_instance.set(e,r);break}case 26:{let e=t.type(),r=this._face_mesh_by_instance.get(e);if(void 0===r)return;this._impl.face_mesh_destroy(r),this._face_mesh_by_instance.delete(e);break}case 32:{let e=t.type(),r=t.faceLandmarkName(),n=this._impl.face_landmark_create(r);this._face_landmark_by_instance.set(e,n);break}case 33:{let e=t.type(),r=this._face_landmark_by_instance.get(e);if(void 0===r)return;this._impl.face_landmark_destroy(r),this._face_landmark_by_instance.delete(e);break}case 16:{let e=t.type(),r=t.type(),n=this._pipeline_by_instance.get(r),a=this._impl.barcode_finder_create(n);this._barcode_finder_by_instance.set(e,a),this._pipeline_id_by_barcode_finder_id.set(e,r);break}case 17:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_destroy(r),this._barcode_finder_by_instance.delete(e);break}case 18:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_enabled_set(r,t.bool());break}case 19:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_formats_set(r,t.barcodeFormat());break}case 5:{let e=t.type(),r=t.type(),n=this._pipeline_by_instance.get(r),a=this._impl.instant_world_tracker_create(n);this._instant_world_tracker_by_instance.set(e,a),this._pipeline_id_by_instant_world_tracker_id.set(e,r);break}case 15:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_destroy(r),this._instant_world_tracker_by_instance.delete(e);break}case 6:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_enabled_set(r,t.bool());break}case 7:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(r,t.float(),t.float(),t.float(),t.instantTrackerTransformOrientation());break}}})}exploreState(){for(let[e,t]of this._pipeline_by_instance){let r=this._pipeline_id_by_pipeline_id.get(e);if(!r)continue;let n=this.serializersByPipelineId.get(r);n&&(n.sendMessage(7,r=>{r.type(e),r.int(this._impl.pipeline_frame_number(t))}),n.sendMessage(6,r=>{r.type(e),r.cameraModel(this._impl.pipeline_camera_model(t))}),n.sendMessage(5,r=>{r.type(e),r.int(this._impl.pipeline_camera_frame_user_data(t))}),n.sendMessage(11,r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_camera_attitude(t))}),n.sendMessage(12,r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_device_attitude(t))}))}for(let[e,t]of this._camera_source_by_instance){let t=this._pipeline_id_by_camera_source_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._sequence_source_by_instance){let t=this._pipeline_id_by_sequence_source_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._image_tracker_by_instance){let r=this._pipeline_id_by_image_tracker_id.get(e);if(!r)continue;let n=this.serializersByPipelineId.get(r);if(n){n.sendMessage(19,r=>{r.type(e),r.int(this._impl.image_tracker_target_loaded_version(t))}),n.sendMessage(21,r=>{r.type(e),r.int(this._impl.image_tracker_target_count(t))}),n.sendMessage(1,r=>{r.type(e),r.int(this._impl.image_tracker_anchor_count(t))});for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)n.sendMessage(2,n=>{n.type(e),n.int(r),n.string(this._impl.image_tracker_anchor_id(t,r))});for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)n.sendMessage(3,n=>{n.type(e),n.int(r),n.matrix4x4(this._impl.image_tracker_anchor_pose_raw(t,r))})}}for(let[e,t]of this._face_tracker_by_instance){let r=this._pipeline_id_by_face_tracker_id.get(e);if(!r)continue;let n=this.serializersByPipelineId.get(r);if(n){n.sendMessage(18,r=>{r.type(e),r.int(this._impl.face_tracker_model_loaded_version(t))}),n.sendMessage(13,r=>{r.type(e),r.int(this._impl.face_tracker_anchor_count(t))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)n.sendMessage(14,n=>{n.type(e),n.int(r),n.string(this._impl.face_tracker_anchor_id(t,r))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)n.sendMessage(15,n=>{n.type(e),n.int(r),n.matrix4x4(this._impl.face_tracker_anchor_pose_raw(t,r))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)n.sendMessage(16,n=>{n.type(e),n.int(r),n.identityCoefficients(this._impl.face_tracker_anchor_identity_coefficients(t,r))});for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)n.sendMessage(17,n=>{n.type(e),n.int(r),n.expressionCoefficients(this._impl.face_tracker_anchor_expression_coefficients(t,r))})}}for(let[e,t]of this._face_mesh_by_instance){let t=this._pipeline_id_by_face_mesh_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._face_landmark_by_instance){let t=this._pipeline_id_by_face_landmark_id.get(e);if(!t)continue;this.serializersByPipelineId.get(t)}for(let[e,t]of this._barcode_finder_by_instance){let r=this._pipeline_id_by_barcode_finder_id.get(e);if(!r)continue;let n=this.serializersByPipelineId.get(r);if(n){n.sendMessage(8,r=>{r.type(e),r.int(this._impl.barcode_finder_found_number(t))});for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)n.sendMessage(9,n=>{n.type(e),n.int(r),n.string(this._impl.barcode_finder_found_text(t,r))});for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)n.sendMessage(10,n=>{n.type(e),n.int(r),n.barcodeFormat(this._impl.barcode_finder_found_format(t,r))})}}for(let[e,t]of this._instant_world_tracker_by_instance){let r=this._pipeline_id_by_instant_world_tracker_id.get(e);if(!r)continue;let n=this.serializersByPipelineId.get(r);n&&n.sendMessage(4,r=>{r.type(e),r.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(t))})}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSerializer=void 0;t.MessageSerializer=class{constructor(e){this._messageSender=e,this._freeBufferPool=[],this._buffer=new ArrayBuffer(16),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1,this._timeoutSet=!1,this._appender={int:e=>this.int(e),bool:e=>this.int(e?1:0),float:e=>this.float(e),string:e=>this.string(e),dataWithLength:e=>this.arrayBuffer(e),type:e=>this.int(e),matrix4x4:e=>this.float32ArrayBuffer(e),matrix3x3:e=>this.float32ArrayBuffer(e),identityCoefficients:e=>this.float32ArrayBuffer(e),expressionCoefficients:e=>this.float32ArrayBuffer(e),cameraModel:e=>this.float32ArrayBuffer(e),timestamp:e=>this.double(e),barcodeFormat:e=>this.int(e),faceLandmarkName:e=>this.int(e),instantTrackerTransformOrientation:e=>this.int(e),logLevel:e=>this.int(e)},this._freeBufferPool.push(new ArrayBuffer(16)),this._freeBufferPool.push(new ArrayBuffer(16))}bufferReturn(e){this._freeBufferPool.push(e)}_ensureArrayBuffer(e){let t=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=t)return;let r=void 0;if(!r){let e=t;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,r=new ArrayBuffer(e)}let n=this._buffer?this._i32View:void 0;this._buffer=r,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),n&&this._i32View.set(n.subarray(0,this._offset))}sendMessage(e,t){this._ensureArrayBuffer(4),this._startOffset=this._offset,this._i32View[this._offset+1]=e,this._offset+=2,t(this._appender),this._i32View[this._startOffset]=this._offset-this._startOffset,this._startOffset=-1,this._sendOneTime()}_sendOneTime(){!1===this._timeoutSet&&(this._timeoutSet=!0,setTimeout(()=>{this._timeoutSet=!1,this._send()},0))}_send(){0!==this._freeBufferPool.length?(this._i32View[0]=this._offset,this._messageSender(this._buffer),this._buffer=void 0,this._buffer=this._freeBufferPool.pop(),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1):this._sendOneTime()}int(e){this._ensureArrayBuffer(1),this._i32View[this._offset]=e,this._offset++}double(e){this._ensureArrayBuffer(2),this._offset%2==1&&this._offset++,this._f64View[this._offset/2]=e,this._offset+=2}float(e){this._ensureArrayBuffer(1),this._f32View[this._offset]=e,this._offset++}int32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t];this._offset+=e.length}float32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._f32View[this._offset+t]=e[t];this._offset+=e.length}booleanArray(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t]?1:0;this._offset+=e.length}uint8ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8View.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}arrayBuffer(e){let t=new Uint8Array(e);this.uint8ArrayBuffer(t)}uint8ClampedArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8cView.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}float32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._f32View.set(e,this._offset),this._offset+=e.length}uint16ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++;let t=2*this._offset;this._u16View.set(e,t),this._offset+=e.length>>1,0!=(1&e.length)&&this._offset++}int32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._i32View.set(e,this._offset),this._offset+=e.length}uint32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._u32View.set(e,this._offset),this._offset+=e.length}string(e){let t=(new TextEncoder).encode(e);this._ensureArrayBuffer(t.byteLength/4),this._i32View[this._offset]=t.byteLength,this._offset++,this._u8View.set(t,4*this._offset),this._offset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._offset++}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDeserializer=void 0;t.MessageDeserializer=class{constructor(){this._buffer=new ArrayBuffer(0),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,this._startOffset=-1,this._processor={int:()=>this._i32View[this._startOffset++],bool:()=>1===this._i32View[this._startOffset++],type:()=>this._i32View[this._startOffset++],float:()=>this._f32View[this._startOffset++],timestamp:()=>{this._startOffset%2==1&&this._startOffset++;let e=this._f64View[this._startOffset/2];return this._startOffset+=2,e},string:()=>{let e=this._i32View[this._startOffset++],t=(new TextDecoder).decode(new Uint8Array(this._buffer,4*this._startOffset,e));return this._startOffset+=e>>2,0!=(3&e)&&this._startOffset++,t},dataWithLength:()=>{let e=this._i32View[this._startOffset++],t=new Uint8Array(e);return t.set(this._u8View.subarray(4*this._startOffset,4*this._startOffset+e)),this._startOffset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._startOffset++,t.buffer},matrix4x4:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+16)),this._startOffset+=e,t},matrix3x3:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+9)),this._startOffset+=e,t},identityCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+50)),this._startOffset+=e,t},expressionCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+29)),this._startOffset+=e,t},cameraModel:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+6)),this._startOffset+=e,t},barcodeFormat:()=>this._i32View[this._startOffset++],faceLandmarkName:()=>this._i32View[this._startOffset++],instantTrackerTransformOrientation:()=>this._i32View[this._startOffset++],logLevel:()=>this._i32View[this._startOffset++]}}setData(e){this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,e.byteLength>=4&&(this._offset=1,this._length=this._i32View[0]),this._startOffset=-1}hasMessage(){return this._offset+1<this._length}forMessages(e){for(;this.hasMessage();){let t=this._i32View[this._offset],r=this._i32View[this._offset+1];this._startOffset=this._offset+2,this._offset+=t,e(r,this._processor)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MsgManager=void 0;const n=r(14);t.MsgManager=class{constructor(){this.onOutgoingMessage=new n.Event,this.onIncomingMessage=new n.Event1,this._outgoingMessages=[]}postIncomingMessage(e){this.onIncomingMessage.emit(e)}postOutgoingMessage(e,t){this._outgoingMessages.push({msg:e,transferables:t}),this.onOutgoingMessage.emit()}getOutgoingMessages(){let e=this._outgoingMessages;return this._outgoingMessages=[],e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event5=t.Event3=t.Event2=t.Event1=t.Event=void 0;t.Event=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(){for(var e=0,t=this._funcs.length;e<t;e++)this._funcs[e]()}};t.Event1=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e){for(var t=0,r=this._funcs.length;t<r;t++)this._funcs[t](e)}};t.Event2=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e,t){for(var r=0,n=this._funcs.length;r<n;r++)this._funcs[r](e,t)}};t.Event3=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e,t,r){for(var n=0,a=this._funcs.length;n<a;n++)this._funcs[n](e,t,r)}};t.Event5=class{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e,t,r,n,a){for(var i=0,o=this._funcs.length;i<o;i++)this._funcs[i](e,t,r,n,a)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.frame_pixel_format_t=t.log_level_t=t.instant_world_tracker_transform_orientation_t=t.face_landmark_name_t=t.barcode_format_t=void 0,function(e){e[e.UNKNOWN=131072]="UNKNOWN",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=4]="CODE_39",e[e.CODE_93=8]="CODE_93",e[e.CODE_128=16]="CODE_128",e[e.DATA_MATRIX=32]="DATA_MATRIX",e[e.EAN_8=64]="EAN_8",e[e.EAN_13=128]="EAN_13",e[e.ITF=256]="ITF",e[e.MAXICODE=512]="MAXICODE",e[e.PDF_417=1024]="PDF_417",e[e.QR_CODE=2048]="QR_CODE",e[e.RSS_14=4096]="RSS_14",e[e.RSS_EXPANDED=8192]="RSS_EXPANDED",e[e.UPC_A=16384]="UPC_A",e[e.UPC_E=32768]="UPC_E",e[e.UPC_EAN_EXTENSION=65536]="UPC_EAN_EXTENSION",e[e.ALL=131071]="ALL"}(t.barcode_format_t||(t.barcode_format_t={})),function(e){e[e.EYE_LEFT=0]="EYE_LEFT",e[e.EYE_RIGHT=1]="EYE_RIGHT",e[e.EAR_LEFT=2]="EAR_LEFT",e[e.EAR_RIGHT=3]="EAR_RIGHT",e[e.NOSE_BRIDGE=4]="NOSE_BRIDGE",e[e.NOSE_TIP=5]="NOSE_TIP",e[e.NOSE_BASE=6]="NOSE_BASE",e[e.LIP_TOP=7]="LIP_TOP",e[e.LIP_BOTTOM=8]="LIP_BOTTOM",e[e.MOUTH_CENTER=9]="MOUTH_CENTER",e[e.CHIN=10]="CHIN",e[e.EYEBROW_LEFT=11]="EYEBROW_LEFT",e[e.EYEBROW_RIGHT=12]="EYEBROW_RIGHT"}(t.face_landmark_name_t||(t.face_landmark_name_t={})),function(e){e[e.WORLD=3]="WORLD",e[e.MINUS_Z_AWAY_FROM_USER=4]="MINUS_Z_AWAY_FROM_USER",e[e.MINUS_Z_HEADING=5]="MINUS_Z_HEADING",e[e.UNCHANGED=6]="UNCHANGED"}(t.instant_world_tracker_transform_orientation_t||(t.instant_world_tracker_transform_orientation_t={})),function(e){e[e.LOG_LEVEL_NONE=0]="LOG_LEVEL_NONE",e[e.LOG_LEVEL_ERROR=1]="LOG_LEVEL_ERROR",e[e.LOG_LEVEL_WARNING=2]="LOG_LEVEL_WARNING",e[e.LOG_LEVEL_VERBOSE=3]="LOG_LEVEL_VERBOSE"}(t.log_level_t||(t.log_level_t={})),function(e){e[e.FRAME_PIXEL_FORMAT_I420=0]="FRAME_PIXEL_FORMAT_I420",e[e.FRAME_PIXEL_FORMAT_I420A=1]="FRAME_PIXEL_FORMAT_I420A",e[e.FRAME_PIXEL_FORMAT_I422=2]="FRAME_PIXEL_FORMAT_I422",e[e.FRAME_PIXEL_FORMAT_I444=3]="FRAME_PIXEL_FORMAT_I444",e[e.FRAME_PIXEL_FORMAT_NV12=4]="FRAME_PIXEL_FORMAT_NV12",e[e.FRAME_PIXEL_FORMAT_RGBA=5]="FRAME_PIXEL_FORMAT_RGBA",e[e.FRAME_PIXEL_FORMAT_BGRA=6]="FRAME_PIXEL_FORMAT_BGRA",e[e.FRAME_PIXEL_FORMAT_Y=7]="FRAME_PIXEL_FORMAT_Y"}(t.frame_pixel_format_t||(t.frame_pixel_format_t={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleImageBitmap=void 0;const n=r(17),a=r(0),i=r(1);let o,s,u,c;t.handleImageBitmap=function(e,t,r,_){const[f,l]=function(){if(!u||!c){const e=new OffscreenCanvas(1,1);if(c=e.getContext("webgl"),!c)throw new Error("Unable to get offscreen GL context");u=new n.ImageProcessGL(c)}return[u,c]}();if(s||(s=l.createTexture(),l.bindTexture(l.TEXTURE_2D,s),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.LINEAR)),!s)return;(!o||o.byteLength<a.profile.dataWidth*a.profile.dataHeight)&&(console.log("Generating pixel buffer",a.profile.dataWidth*a.profile.dataHeight),o=new ArrayBuffer(a.profile.dataWidth*a.profile.dataHeight)),f.uploadFrame(s,e.i,e.r,e.userFacing);let d=f.readFrame(s,o),p={t:"imageBitmapS2C",dataWidth:d.dataWidth,dataHeight:d.dataHeight,frame:e.i,userFacing:d.userFacing,uvTransform:d.uvTransform||i.mat4.create(),tokenId:e.tokenId,p:e.p};_.postOutgoingMessage(p,[e.i]);let h=r._pipeline_by_instance.get(e.p);h&&(t.pipeline_camera_frame_submit(h,o,d.dataWidth,d.dataHeight,e.tokenId,e.cameraToDevice,e.cameraModel,d.userFacing),t.pipeline_frame_update(h),r.exploreState())}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageProcessGL=void 0;const n=r(1),a=r(0),i=r(20);t.ImageProcessGL=class{constructor(e){this._gl=e,this._isPaused=!0,this._hadFrames=!1,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._isUploadFrame=!0,this._computedTransformRotation=-1,this._computedFrontCameraRotation=!1,this._cameraUvTransform=n.mat4.create(),this._framebufferWidth=0,this._framebufferHeight=0,this._framebufferId=null,this._renderTexture=null}resetGLContext(){this._framebufferId=null,this._renderTexture=null,this._vertexBuffer=void 0,this._indexBuffer=void 0,this._greyscaleShader=void 0}destroy(){this.resetGLContext()}uploadFrame(e,t,r,n){let i=this._gl;i.disable(i.SCISSOR_TEST),i.disable(i.DEPTH_TEST),i.disable(i.BLEND),i.disable(i.CULL_FACE),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e);const o=i.RGBA,s=i.RGBA,u=i.UNSIGNED_BYTE;i.texImage2D(i.TEXTURE_2D,0,o,s,u,t);let c=0,_=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(c=t.videoWidth,_=t.videoHeight):(c=t.width,_=t.height),_>c&&(_=[c,c=_][0]),this._updateTransforms(r,n);let f=this._getFramebuffer(i,a.profile.dataWidth/4,a.profile.dataHeight),l=this._getVertexBuffer(i),d=this._getIndexBuffer(i),p=this._getGreyscaleShader(i);i.bindFramebuffer(i.FRAMEBUFFER,f),i.viewport(0,0,this._framebufferWidth,this._framebufferHeight),i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT),i.bindBuffer(i.ARRAY_BUFFER,l),i.vertexAttribPointer(p.aVertexPositionLoc,2,i.FLOAT,!1,16,0),i.enableVertexAttribArray(p.aVertexPositionLoc),i.vertexAttribPointer(p.aTextureCoordLoc,2,i.FLOAT,!1,16,8),i.enableVertexAttribArray(p.aTextureCoordLoc),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,d),i.useProgram(p.program),i.uniform1f(p.uTexWidthLoc,a.profile.dataWidth),i.uniformMatrix4fv(p.uUvTransformLoc,!1,this._cameraUvTransform),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.uniform1i(p.uSamplerLoc,0),i.drawElements(i.TRIANGLES,6,i.UNSIGNED_SHORT,0),i.disableVertexAttribArray(p.aVertexPositionLoc),i.disableVertexAttribArray(p.aTextureCoordLoc),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null),i.useProgram(null),i.bindTexture(i.TEXTURE_2D,null)}readFrame(e,t){let r=this._gl,n=new Uint8Array(t),i=this._getFramebuffer(r,a.profile.dataWidth/4,a.profile.dataHeight);return r.bindFramebuffer(r.FRAMEBUFFER,i),r.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),{uvTransform:this._cameraUvTransform,data:t,texture:e,dataWidth:a.profile.dataWidth,dataHeight:a.profile.dataHeight,userFacing:this._computedFrontCameraRotation}}_updateTransforms(e,t){e==this._computedTransformRotation&&t==this._computedFrontCameraRotation||(this._computedTransformRotation=e,this._computedFrontCameraRotation=t,this._cameraUvTransform=this._getCameraUvTransform())}_getCameraUvTransform(){switch(this._computedTransformRotation){case 270:return new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]);case 180:return new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);case 90:return new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1])}return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}_getFramebuffer(e,t,r){if(this._framebufferWidth===t&&this._framebufferHeight===r&&this._framebufferId)return this._framebufferId;if(this._framebufferId&&(e.deleteFramebuffer(this._framebufferId),this._framebufferId=null),this._renderTexture&&(e.deleteTexture(this._renderTexture),this._renderTexture=null),this._framebufferId=e.createFramebuffer(),!this._framebufferId)throw new Error("Unable to create framebuffer");if(e.bindFramebuffer(e.FRAMEBUFFER,this._framebufferId),this._renderTexture=e.createTexture(),!this._renderTexture)throw new Error("Unable to create render texture");e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._renderTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameterf(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._renderTexture,0);let n=e.checkFramebufferStatus(e.FRAMEBUFFER);if(n!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete: "+n.toString());return this._framebufferWidth=t,this._framebufferHeight=r,e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this._framebufferId}_getVertexBuffer(e){if(this._vertexBuffer)return this._vertexBuffer;if(this._vertexBuffer=e.createBuffer(),!this._vertexBuffer)throw new Error("Unable to create vertex buffer");e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer);let t=new Float32Array([-1,-1,0,0,-1,1,0,1,1,1,1,1,1,-1,1,0]);return e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),this._vertexBuffer}_getIndexBuffer(e){if(this._indexBuffer)return this._indexBuffer;if(this._indexBuffer=e.createBuffer(),!this._indexBuffer)throw new Error("Unable to create index buffer");e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer);let t=new Uint16Array([0,1,2,0,2,3]);return e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW),this._indexBuffer}_getGreyscaleShader(e){if(this._greyscaleShader)return this._greyscaleShader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=i.compileShader(e,e.VERTEX_SHADER,o),n=i.compileShader(e,e.FRAGMENT_SHADER,s);e.attachShader(t,r),e.attachShader(t,n),i.linkProgram(e,t);let a=e.getUniformLocation(t,"uTexWidth");if(!a)throw new Error("Unable to get uniform location uTexWidth");let u=e.getUniformLocation(t,"uUvTransform");if(!u)throw new Error("Unable to get uniform location uUvTransform");let c=e.getUniformLocation(t,"uSampler");if(!c)throw new Error("Unable to get uniform location uSampler");return this._greyscaleShader={program:t,aVertexPositionLoc:e.getAttribLocation(t,"aVertexPosition"),aTextureCoordLoc:e.getAttribLocation(t,"aTextureCoord"),uTexWidthLoc:a,uUvTransformLoc:u,uSamplerLoc:c},this._greyscaleShader}};let o="\n attribute vec4 aVertexPosition;\n attribute vec2 aTextureCoord;\n\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform float uTexWidth;\n\tuniform mat4 uUvTransform;\n\n void main(void) {\n highp vec2 offset1 = vec2(1.5 / uTexWidth, 0);\n highp vec2 offset2 = vec2(0.5 / uTexWidth, 0);\n\n gl_Position = aVertexPosition;\n vTextureCoord1 = (uUvTransform * vec4(aTextureCoord - offset1, 0, 1)).xy;\n vTextureCoord2 = (uUvTransform * vec4(aTextureCoord - offset2, 0, 1)).xy;\n vTextureCoord3 = (uUvTransform * vec4(aTextureCoord + offset2, 0, 1)).xy;\n vTextureCoord4 = (uUvTransform * vec4(aTextureCoord + offset1, 0, 1)).xy;\n }\n",s="\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform sampler2D uSampler;\n\n const lowp vec3 colorWeights = vec3(77.0 / 256.0, 150.0 / 256.0, 29.0 / 256.0);\n\n void main(void) {\n lowp vec4 outpx;\n\n outpx.r = dot(colorWeights, texture2D(uSampler, vTextureCoord1).xyz);\n outpx.g = dot(colorWeights, texture2D(uSampler, vTextureCoord2).xyz);\n outpx.b = dot(colorWeights, texture2D(uSampler, vTextureCoord3).xyz);\n outpx.a = dot(colorWeights, texture2D(uSampler, vTextureCoord4).xyz);\n\n gl_FragColor = outpx;\n }\n"},function(e,t,r){var n;!function(a,i){"use strict";var o="model",s="name",u="type",c="vendor",_="version",f="mobile",l="tablet",d="smarttv",p=function(e){var t={};for(var r in e)t[e[r].toUpperCase()]=e[r];return t},h=function(e,t){return"string"==typeof e&&-1!==m(t).indexOf(m(e))},m=function(e){return e.toLowerCase()},b=function(e,t){if("string"==typeof e)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),void 0===t?e:e.substring(0,255)},g=function(e,t){for(var r,n,a,i,o,s,u=0;u<t.length&&!o;){var c=t[u],_=t[u+1];for(r=n=0;r<c.length&&!o;)if(o=c[r++].exec(e))for(a=0;a<_.length;a++)s=o[++n],"object"==typeof(i=_[a])&&i.length>0?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;u+=2}},w=function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(h(t[r][n],e))return"?"===r?void 0:r}else if(h(t[r],e))return"?"===r?void 0:r;return e},v={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_,[s,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[s,_],[/opios[\/ ]+([\w\.]+)/i],[_,[s,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[_,[s,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[s,_],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[_,[s,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[_,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[_,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[_,[s,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[_,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[_,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],_],[/\bfocus\/([\w\.]+)/i],[_,[s,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[_,[s,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[_,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[_,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[_,[s,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[_,[s,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[_,[s,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],_],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],_],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[s,_],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[s],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[s,"Facebook"],_],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[s,_],[/\bgsa\/([\w\.]+) .*safari\//i],[_,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[_,[s,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],_],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[_,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[s,_],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[_,[s,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[_,s],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[s,[_,w,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[s,_],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[s,"Netscape"],_],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[_,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[s,_]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",m]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",m]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",m]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[o,[c,"Samsung"],[u,l]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[o,[c,"Samsung"],[u,f]],[/\((ip(?:hone|od)[\w ]*);/i],[o,[c,"Apple"],[u,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[c,"Apple"],[u,l]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[o,[c,"Huawei"],[u,l]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[o,[c,"Huawei"],[u,f]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[o,/_/g," "],[c,"Xiaomi"],[u,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[o,/_/g," "],[c,"Xiaomi"],[u,l]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[o,[c,"OPPO"],[u,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[c,"Vivo"],[u,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[o,[c,"Realme"],[u,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[o,[c,"Motorola"],[u,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[c,"Motorola"],[u,l]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[c,"LG"],[u,l]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[c,"LG"],[u,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[o,[c,"Lenovo"],[u,l]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[o,/_/g," "],[c,"Nokia"],[u,f]],[/(pixel c)\b/i],[o,[c,"Google"],[u,l]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[c,"Google"],[u,f]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[c,"Sony"],[u,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[c,"Sony"],[u,l]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[c,"OnePlus"],[u,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[c,"Amazon"],[u,l]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[c,"Amazon"],[u,f]],[/(playbook);[-\w\),; ]+(rim)/i],[o,c,[u,l]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[c,"BlackBerry"],[u,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[c,"ASUS"],[u,l]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[c,"ASUS"],[u,f]],[/(nexus 9)/i],[o,[c,"HTC"],[u,l]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[c,[o,/_/g," "],[u,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[c,"Acer"],[u,l]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[c,"Meizu"],[u,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[c,"Sharp"],[u,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,o,[u,f]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,o,[u,l]],[/(surface duo)/i],[o,[c,"Microsoft"],[u,l]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[c,"Fairphone"],[u,f]],[/(u304aa)/i],[o,[c,"AT&T"],[u,f]],[/\bsie-(\w*)/i],[o,[c,"Siemens"],[u,f]],[/\b(rct\w+) b/i],[o,[c,"RCA"],[u,l]],[/\b(venue[\d ]{2,7}) b/i],[o,[c,"Dell"],[u,l]],[/\b(q(?:mv|ta)\w+) b/i],[o,[c,"Verizon"],[u,l]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[o,[c,"Barnes & Noble"],[u,l]],[/\b(tm\d{3}\w+) b/i],[o,[c,"NuVision"],[u,l]],[/\b(k88) b/i],[o,[c,"ZTE"],[u,l]],[/\b(nx\d{3}j) b/i],[o,[c,"ZTE"],[u,f]],[/\b(gen\d{3}) b.+49h/i],[o,[c,"Swiss"],[u,f]],[/\b(zur\d{3}) b/i],[o,[c,"Swiss"],[u,l]],[/\b((zeki)?tb.*\b) b/i],[o,[c,"Zeki"],[u,l]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],o,[u,l]],[/\b(ns-?\w{0,9}) b/i],[o,[c,"Insignia"],[u,l]],[/\b((nxa|next)-?\w{0,9}) b/i],[o,[c,"NextBook"],[u,l]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],o,[u,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],o,[u,f]],[/\b(ph-1) /i],[o,[c,"Essential"],[u,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[o,[c,"Envizen"],[u,l]],[/\b(trio[-\w\. ]+) b/i],[o,[c,"MachSpeed"],[u,l]],[/\btu_(1491) b/i],[o,[c,"Rotor"],[u,l]],[/(shield[\w ]+) b/i],[o,[c,"Nvidia"],[u,l]],[/(sprint) (\w+)/i],[c,o,[u,f]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[c,"Microsoft"],[u,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[c,"Zebra"],[u,l]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[c,"Zebra"],[u,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,o,[u,"console"]],[/droid.+; (shield) bui/i],[o,[c,"Nvidia"],[u,"console"]],[/(playstation [345portablevi]+)/i],[o,[c,"Sony"],[u,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[c,"Microsoft"],[u,"console"]],[/smart-tv.+(samsung)/i],[c,[u,d]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[c,"Samsung"],[u,d]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,"LG"],[u,d]],[/(apple) ?tv/i],[c,[o,"Apple TV"],[u,d]],[/crkey/i],[[o,"Chromecast"],[c,"Google"],[u,d]],[/droid.+aft(\w)( bui|\))/i],[o,[c,"Amazon"],[u,d]],[/\(dtv[\);].+(aquos)/i],[o,[c,"Sharp"],[u,d]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,b],[o,b],[u,d]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,d]],[/((pebble))app/i],[c,o,[u,"wearable"]],[/droid.+; (glass) \d/i],[o,[c,"Google"],[u,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[o,[c,"Zebra"],[u,"wearable"]],[/(quest( 2)?)/i],[o,[c,"Facebook"],[u,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[u,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[o,[u,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[o,[u,l]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,l]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,f]],[/(android[-\w\. ]{0,9});.+buil/i],[o,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[_,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[s,_],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_,s]],os:[[/microsoft (windows) (vista|xp)/i],[s,_],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[s,[_,w,v]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[s,"Windows"],[_,w,v]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[_,/_/g,"."],[s,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[s,"Mac OS"],[_,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[_,s],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[s,_],[/\(bb(10);/i],[_,[s,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[_,[s,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[_,[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[_,[s,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[s,"Chromium OS"],_],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[s,_],[/(sunos) ?([\w\.\d]*)/i],[[s,"Solaris"],_],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[s,_]]},M=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof M))return new M(e,t).getResult();var r=e||(void 0!==a&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),n=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(y,t):y;return this.getBrowser=function(){var e,t={};return t[s]=void 0,t[_]=void 0,g.call(t,r,n.browser),t.major="string"==typeof(e=t.version)?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,t},this.getCPU=function(){var e={architecture:void 0};return g.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return g.call(e,r,n.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return g.call(e,r,n.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return g.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r="string"==typeof e&&e.length>255?b(e,255):e,this},this.setUA(r),this};M.VERSION="0.7.30",M.BROWSER=p([s,_,"major"]),M.CPU=p(["architecture"]),M.DEVICE=p([o,c,u,"console",f,d,l,"wearable","embedded"]),M.ENGINE=M.OS=p([s,_]),void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=M),t.UAParser=M):r(19)?void 0===(n=function(){return M}.call(t,r,t,e))||(e.exports=n):void 0!==a&&(a.UAParser=M);var k=void 0!==a&&(a.jQuery||a.Zepto);if(k&&!k.ua){var x=new M;k.ua=x.getResult(),k.ua.get=function(){return x.getUA()},k.ua.set=function(e){x.setUA(e);var t=x.getResult();for(var r in t)k.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkProgram=t.compileShader=void 0,t.compileShader=function(e,t,r){let n=e.createShader(t);if(!n)throw new Error("Unable to create shader");e.shaderSource(n,r),e.compileShader(n);let a=e.getShaderInfoLog(n);if(a&&a.trim().length>0)throw new Error("Shader compile error: "+a);return n},t.linkProgram=function(e,t){e.linkProgram(t);let r=e.getProgramInfoLog(t);if(r&&r.trim().length>0)throw new Error("Unable to link: "+r)}},function(e,t,r){"use strict";r.r(t),t.default=r.p+"9d9c4b542b40c41e3ef7587fb91e5d38.wasm"}]);
|