@zappar/zappar-cv 0.4.0-beta.4 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +91 -34
- package/README.md +2 -2
- package/lib/additional.d.ts +2 -1
- package/lib/additional.js +1 -2
- package/lib/camera-source-map.d.ts +10 -0
- package/lib/camera-source-map.js +32 -0
- package/lib/camera-source.d.ts +2 -5
- package/lib/camera-source.js +18 -32
- package/lib/cameramodel.js +18 -23
- package/lib/compatibility.js +2 -4
- package/lib/deserializer.js +1 -5
- package/lib/direct.js +12 -16
- package/lib/drawcamera.js +27 -31
- package/lib/drawface.js +5 -9
- package/lib/drawfaceproject.js +5 -9
- package/lib/drawplane.js +6 -11
- package/lib/event.js +5 -13
- package/lib/facelandmark.d.ts +1 -2
- package/lib/facelandmark.js +11 -18
- package/lib/facelandmarkdata.js +1 -4
- package/lib/facelandmarkinterface.js +1 -2
- package/lib/facemesh.js +10 -17
- package/lib/gen/zappar-client.js +11 -25
- package/lib/gen/zappar-cwrap.js +38 -33
- package/lib/gen/zappar-native.d.ts +11 -1
- package/lib/gen/zappar-native.js +20 -11
- package/lib/gen/zappar-server.js +6 -14
- package/lib/gen/zappar.d.ts +12 -0
- package/lib/gen/zappar.js +5 -11
- package/lib/gfx.d.ts +1 -0
- package/lib/gfx.js +1 -0
- package/lib/gl-state-manager.d.ts +9 -0
- package/lib/gl-state-manager.js +31 -0
- package/lib/html-element-source.d.ts +3 -20
- package/lib/html-element-source.js +39 -287
- package/lib/image-process-gl.d.ts +37 -0
- package/lib/image-process-gl.js +306 -0
- package/lib/imagebitmap-camera-source.d.ts +36 -0
- package/lib/imagebitmap-camera-source.js +273 -0
- package/lib/imagetracker.d.ts +28 -0
- package/lib/imagetracker.js +115 -0
- package/lib/index-standalone.d.ts +3 -0
- package/lib/index-standalone.js +5 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -27
- package/lib/landmarkdatagenerate.js +25 -30
- package/lib/loglevel.js +9 -16
- package/lib/messages.js +4 -8
- package/lib/mstp-camera-source.d.ts +29 -0
- package/lib/mstp-camera-source.js +226 -0
- package/lib/native.d.ts +2 -1
- package/lib/native.js +229 -130
- package/lib/options.d.ts +3 -0
- package/lib/options.js +1 -0
- package/lib/permission.js +13 -27
- package/lib/pipeline.d.ts +14 -5
- package/lib/pipeline.js +125 -61
- package/lib/profile.d.ts +2 -0
- package/lib/profile.js +59 -53
- package/lib/riff-reader.d.ts +18 -0
- package/lib/riff-reader.js +52 -0
- package/lib/sequencerecorder.d.ts +1 -0
- package/lib/sequencerecorder.js +17 -11
- package/lib/sequencesource.d.ts +7 -1
- package/lib/sequencesource.js +102 -64
- package/lib/serializer.js +1 -5
- package/lib/shader.js +2 -7
- package/lib/source.d.ts +6 -4
- package/lib/source.js +1 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -4
- package/lib/worker-client.d.ts +1 -1
- package/lib/worker-client.js +9 -26
- package/lib/worker-imagebitmap.d.ts +5 -0
- package/lib/worker-imagebitmap.js +59 -0
- package/lib/worker-server.d.ts +0 -5
- package/lib/worker-server.js +133 -41
- package/lib/worker.js +6 -10
- package/lib/workerinterface.d.ts +47 -1
- package/lib/workerinterface.js +1 -2
- package/lib/zcv.js +117 -135
- package/lib/zcv.wasm +0 -0
- package/package.json +33 -32
- package/umd/169.zappar-cv.js +1 -0
- package/umd/{482727c0e7dd40d73f5aae47f238ad61.zbin → 482727c0e7dd40d73f5a.zbin} +0 -0
- package/umd/6a8309f88f836a752c68.wasm +0 -0
- package/umd/752.zappar-cv.js +1 -0
- package/umd/{b4f46e148a3b3b5aef90717d8d60e3fc.zbin → b4f46e148a3b3b5aef90.zbin} +0 -0
- package/umd/{f7b62a3a53b5c9b3222ba8dc53cb8b11.zbin → f7b62a3a53b5c9b3222b.zbin} +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/d115e485cffe500afc4f7c1272ea8f62.wasm +0 -0
package/umd/zappar-cv.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ZCV=t():e.ZCV=t()}(window,(function(){return 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}return 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=17)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zcwarn=t.zcerr=t.zcout=t.setLogLevel=void 0;const n=r(11);let a=n.log_level_t.LOG_LEVEL_ERROR;t.setLogLevel=function(e){a=e},t.zcout=function(...e){a>=n.log_level_t.LOG_LEVEL_VERBOSE&&console.log("[Zappar] INFO",...e)},t.zcerr=function(...e){a>=n.log_level_t.LOG_LEVEL_ERROR&&console.error("[Zappar] ERROR",...e)},t.zcwarn=function(...e){a>=n.log_level_t.LOG_LEVEL_VERBOSE&&console.log("[Zappar] WARN",...e)}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"EPSILON",(function(){return d})),r.d(n,"ARRAY_TYPE",(function(){return h})),r.d(n,"RANDOM",(function(){return m})),r.d(n,"setMatrixArrayType",(function(){return p})),r.d(n,"toRadian",(function(){return g})),r.d(n,"equals",(function(){return b}));var a={};r.r(a),r.d(a,"create",(function(){return w})),r.d(a,"clone",(function(){return y})),r.d(a,"copy",(function(){return M})),r.d(a,"identity",(function(){return E})),r.d(a,"fromValues",(function(){return k})),r.d(a,"set",(function(){return x})),r.d(a,"transpose",(function(){return A})),r.d(a,"invert",(function(){return T})),r.d(a,"adjoint",(function(){return F})),r.d(a,"determinant",(function(){return R})),r.d(a,"multiply",(function(){return z})),r.d(a,"rotate",(function(){return S})),r.d(a,"scale",(function(){return L})),r.d(a,"fromRotation",(function(){return D})),r.d(a,"fromScaling",(function(){return P})),r.d(a,"str",(function(){return O})),r.d(a,"frob",(function(){return C})),r.d(a,"LDU",(function(){return B})),r.d(a,"add",(function(){return U})),r.d(a,"subtract",(function(){return I})),r.d(a,"exactEquals",(function(){return V})),r.d(a,"equals",(function(){return j})),r.d(a,"multiplyScalar",(function(){return q})),r.d(a,"multiplyScalarAndAdd",(function(){return N})),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 Y})),r.d(i,"clone",(function(){return G})),r.d(i,"copy",(function(){return X})),r.d(i,"identity",(function(){return Z})),r.d(i,"fromValues",(function(){return J})),r.d(i,"set",(function(){return K})),r.d(i,"invert",(function(){return Q})),r.d(i,"determinant",(function(){return $})),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 ce})),r.d(i,"add",(function(){return ue})),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 he})),r.d(i,"mul",(function(){return me})),r.d(i,"sub",(function(){return pe}));var o={};r.r(o),r.d(o,"create",(function(){return ve})),r.d(o,"fromMat4",(function(){return ge})),r.d(o,"clone",(function(){return be})),r.d(o,"copy",(function(){return we})),r.d(o,"fromValues",(function(){return ye})),r.d(o,"set",(function(){return Me})),r.d(o,"identity",(function(){return Ee})),r.d(o,"transpose",(function(){return ke})),r.d(o,"invert",(function(){return xe})),r.d(o,"adjoint",(function(){return Ae})),r.d(o,"determinant",(function(){return Te})),r.d(o,"multiply",(function(){return Fe})),r.d(o,"translate",(function(){return Re})),r.d(o,"rotate",(function(){return ze})),r.d(o,"scale",(function(){return Se})),r.d(o,"fromTranslation",(function(){return Le})),r.d(o,"fromRotation",(function(){return De})),r.d(o,"fromScaling",(function(){return Pe})),r.d(o,"fromMat2d",(function(){return Oe})),r.d(o,"fromQuat",(function(){return Ce})),r.d(o,"normalFromMat4",(function(){return Be})),r.d(o,"projection",(function(){return Ue})),r.d(o,"str",(function(){return Ie})),r.d(o,"frob",(function(){return Ve})),r.d(o,"add",(function(){return je})),r.d(o,"subtract",(function(){return qe})),r.d(o,"multiplyScalar",(function(){return Ne})),r.d(o,"multiplyScalarAndAdd",(function(){return We})),r.d(o,"exactEquals",(function(){return He})),r.d(o,"equals",(function(){return Ye})),r.d(o,"mul",(function(){return Ge})),r.d(o,"sub",(function(){return Xe}));var s={};r.r(s),r.d(s,"create",(function(){return Ze})),r.d(s,"clone",(function(){return Je})),r.d(s,"copy",(function(){return Ke})),r.d(s,"fromValues",(function(){return Qe})),r.d(s,"set",(function(){return $e})),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 ct})),r.d(s,"rotateX",(function(){return ut})),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 ht})),r.d(s,"fromXRotation",(function(){return mt})),r.d(s,"fromYRotation",(function(){return pt})),r.d(s,"fromZRotation",(function(){return vt})),r.d(s,"fromRotationTranslation",(function(){return gt})),r.d(s,"fromQuat2",(function(){return bt})),r.d(s,"getTranslation",(function(){return wt})),r.d(s,"getScaling",(function(){return yt})),r.d(s,"getRotation",(function(){return Mt})),r.d(s,"fromRotationTranslationScale",(function(){return Et})),r.d(s,"fromRotationTranslationScaleOrigin",(function(){return kt})),r.d(s,"fromQuat",(function(){return xt})),r.d(s,"frustum",(function(){return At})),r.d(s,"perspective",(function(){return Tt})),r.d(s,"perspectiveFromFieldOfView",(function(){return Ft})),r.d(s,"ortho",(function(){return Rt})),r.d(s,"lookAt",(function(){return zt})),r.d(s,"targetTo",(function(){return St})),r.d(s,"str",(function(){return Lt})),r.d(s,"frob",(function(){return Dt})),r.d(s,"add",(function(){return Pt})),r.d(s,"subtract",(function(){return Ot})),r.d(s,"multiplyScalar",(function(){return Ct})),r.d(s,"multiplyScalarAndAdd",(function(){return Bt})),r.d(s,"exactEquals",(function(){return Ut})),r.d(s,"equals",(function(){return It})),r.d(s,"mul",(function(){return Vt})),r.d(s,"sub",(function(){return jt}));var c={};r.r(c),r.d(c,"create",(function(){return qt})),r.d(c,"clone",(function(){return Nt})),r.d(c,"length",(function(){return Wt})),r.d(c,"fromValues",(function(){return Ht})),r.d(c,"copy",(function(){return Yt})),r.d(c,"set",(function(){return Gt})),r.d(c,"add",(function(){return Xt})),r.d(c,"subtract",(function(){return Zt})),r.d(c,"multiply",(function(){return Jt})),r.d(c,"divide",(function(){return Kt})),r.d(c,"ceil",(function(){return Qt})),r.d(c,"floor",(function(){return $t})),r.d(c,"min",(function(){return er})),r.d(c,"max",(function(){return tr})),r.d(c,"round",(function(){return rr})),r.d(c,"scale",(function(){return nr})),r.d(c,"scaleAndAdd",(function(){return ar})),r.d(c,"distance",(function(){return ir})),r.d(c,"squaredDistance",(function(){return or})),r.d(c,"squaredLength",(function(){return sr})),r.d(c,"negate",(function(){return cr})),r.d(c,"inverse",(function(){return ur})),r.d(c,"normalize",(function(){return _r})),r.d(c,"dot",(function(){return fr})),r.d(c,"cross",(function(){return lr})),r.d(c,"lerp",(function(){return dr})),r.d(c,"hermite",(function(){return hr})),r.d(c,"bezier",(function(){return mr})),r.d(c,"random",(function(){return pr})),r.d(c,"transformMat4",(function(){return vr})),r.d(c,"transformMat3",(function(){return gr})),r.d(c,"transformQuat",(function(){return br})),r.d(c,"rotateX",(function(){return wr})),r.d(c,"rotateY",(function(){return yr})),r.d(c,"rotateZ",(function(){return Mr})),r.d(c,"angle",(function(){return Er})),r.d(c,"zero",(function(){return kr})),r.d(c,"str",(function(){return xr})),r.d(c,"exactEquals",(function(){return Ar})),r.d(c,"equals",(function(){return Tr})),r.d(c,"sub",(function(){return Rr})),r.d(c,"mul",(function(){return zr})),r.d(c,"div",(function(){return Sr})),r.d(c,"dist",(function(){return Lr})),r.d(c,"sqrDist",(function(){return Dr})),r.d(c,"len",(function(){return Pr})),r.d(c,"sqrLen",(function(){return Or})),r.d(c,"forEach",(function(){return Cr}));var u={};r.r(u),r.d(u,"create",(function(){return Br})),r.d(u,"clone",(function(){return Ur})),r.d(u,"fromValues",(function(){return Ir})),r.d(u,"copy",(function(){return Vr})),r.d(u,"set",(function(){return jr})),r.d(u,"add",(function(){return qr})),r.d(u,"subtract",(function(){return Nr})),r.d(u,"multiply",(function(){return Wr})),r.d(u,"divide",(function(){return Hr})),r.d(u,"ceil",(function(){return Yr})),r.d(u,"floor",(function(){return Gr})),r.d(u,"min",(function(){return Xr})),r.d(u,"max",(function(){return Zr})),r.d(u,"round",(function(){return Jr})),r.d(u,"scale",(function(){return Kr})),r.d(u,"scaleAndAdd",(function(){return Qr})),r.d(u,"distance",(function(){return $r})),r.d(u,"squaredDistance",(function(){return en})),r.d(u,"length",(function(){return tn})),r.d(u,"squaredLength",(function(){return rn})),r.d(u,"negate",(function(){return nn})),r.d(u,"inverse",(function(){return an})),r.d(u,"normalize",(function(){return on})),r.d(u,"dot",(function(){return sn})),r.d(u,"cross",(function(){return cn})),r.d(u,"lerp",(function(){return un})),r.d(u,"random",(function(){return _n})),r.d(u,"transformMat4",(function(){return fn})),r.d(u,"transformQuat",(function(){return ln})),r.d(u,"zero",(function(){return dn})),r.d(u,"str",(function(){return hn})),r.d(u,"exactEquals",(function(){return mn})),r.d(u,"equals",(function(){return pn})),r.d(u,"sub",(function(){return vn})),r.d(u,"mul",(function(){return gn})),r.d(u,"div",(function(){return bn})),r.d(u,"dist",(function(){return wn})),r.d(u,"sqrDist",(function(){return yn})),r.d(u,"len",(function(){return Mn})),r.d(u,"sqrLen",(function(){return En})),r.d(u,"forEach",(function(){return kn}));var _={};r.r(_),r.d(_,"create",(function(){return xn})),r.d(_,"identity",(function(){return An})),r.d(_,"setAxisAngle",(function(){return Tn})),r.d(_,"getAxisAngle",(function(){return Fn})),r.d(_,"getAngle",(function(){return Rn})),r.d(_,"multiply",(function(){return zn})),r.d(_,"rotateX",(function(){return Sn})),r.d(_,"rotateY",(function(){return Ln})),r.d(_,"rotateZ",(function(){return Dn})),r.d(_,"calculateW",(function(){return Pn})),r.d(_,"exp",(function(){return On})),r.d(_,"ln",(function(){return Cn})),r.d(_,"pow",(function(){return Bn})),r.d(_,"slerp",(function(){return Un})),r.d(_,"random",(function(){return In})),r.d(_,"invert",(function(){return Vn})),r.d(_,"conjugate",(function(){return jn})),r.d(_,"fromMat3",(function(){return qn})),r.d(_,"fromEuler",(function(){return Nn})),r.d(_,"str",(function(){return Wn})),r.d(_,"clone",(function(){return Kn})),r.d(_,"fromValues",(function(){return Qn})),r.d(_,"copy",(function(){return $n})),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 ca})),r.d(_,"sqrLen",(function(){return ua})),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 ha})),r.d(_,"setAxes",(function(){return ma}));var f={};r.r(f),r.d(f,"create",(function(){return pa})),r.d(f,"clone",(function(){return va})),r.d(f,"fromValues",(function(){return ga})),r.d(f,"fromRotationTranslationValues",(function(){return ba})),r.d(f,"fromRotationTranslation",(function(){return wa})),r.d(f,"fromTranslation",(function(){return ya})),r.d(f,"fromRotation",(function(){return Ma})),r.d(f,"fromMat4",(function(){return Ea})),r.d(f,"copy",(function(){return ka})),r.d(f,"identity",(function(){return xa})),r.d(f,"set",(function(){return Aa})),r.d(f,"getReal",(function(){return Ta})),r.d(f,"getDual",(function(){return Fa})),r.d(f,"setReal",(function(){return Ra})),r.d(f,"setDual",(function(){return za})),r.d(f,"getTranslation",(function(){return Sa})),r.d(f,"translate",(function(){return La})),r.d(f,"rotateX",(function(){return Da})),r.d(f,"rotateY",(function(){return Pa})),r.d(f,"rotateZ",(function(){return Oa})),r.d(f,"rotateByQuatAppend",(function(){return Ca})),r.d(f,"rotateByQuatPrepend",(function(){return Ba})),r.d(f,"rotateAroundAxis",(function(){return Ua})),r.d(f,"add",(function(){return Ia})),r.d(f,"multiply",(function(){return Va})),r.d(f,"mul",(function(){return ja})),r.d(f,"scale",(function(){return qa})),r.d(f,"dot",(function(){return Na})),r.d(f,"lerp",(function(){return Wa})),r.d(f,"invert",(function(){return Ha})),r.d(f,"conjugate",(function(){return Ya})),r.d(f,"length",(function(){return Ga})),r.d(f,"len",(function(){return Xa})),r.d(f,"squaredLength",(function(){return Za})),r.d(f,"sqrLen",(function(){return Ja})),r.d(f,"normalize",(function(){return Ka})),r.d(f,"str",(function(){return Qa})),r.d(f,"exactEquals",(function(){return $a})),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 ci})),r.d(l,"divide",(function(){return ui})),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 hi})),r.d(l,"scale",(function(){return mi})),r.d(l,"scaleAndAdd",(function(){return pi})),r.d(l,"distance",(function(){return vi})),r.d(l,"squaredDistance",(function(){return gi})),r.d(l,"length",(function(){return bi})),r.d(l,"squaredLength",(function(){return wi})),r.d(l,"negate",(function(){return yi})),r.d(l,"inverse",(function(){return Mi})),r.d(l,"normalize",(function(){return Ei})),r.d(l,"dot",(function(){return ki})),r.d(l,"cross",(function(){return xi})),r.d(l,"lerp",(function(){return Ai})),r.d(l,"random",(function(){return Ti})),r.d(l,"transformMat2",(function(){return Fi})),r.d(l,"transformMat2d",(function(){return Ri})),r.d(l,"transformMat3",(function(){return zi})),r.d(l,"transformMat4",(function(){return Si})),r.d(l,"rotate",(function(){return Li})),r.d(l,"angle",(function(){return Di})),r.d(l,"zero",(function(){return Pi})),r.d(l,"str",(function(){return Oi})),r.d(l,"exactEquals",(function(){return Ci})),r.d(l,"equals",(function(){return Bi})),r.d(l,"len",(function(){return Ui})),r.d(l,"sub",(function(){return Ii})),r.d(l,"mul",(function(){return Vi})),r.d(l,"div",(function(){return ji})),r.d(l,"dist",(function(){return qi})),r.d(l,"sqrDist",(function(){return Ni})),r.d(l,"sqrLen",(function(){return Wi})),r.d(l,"forEach",(function(){return Hi}));var d=1e-6,h="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function p(e){h=e}var v=Math.PI/180;function g(e){return e*v}function b(e,t){return Math.abs(e-t)<=d*Math.max(1,Math.abs(e),Math.abs(t))}function w(){var e=new h(4);return h!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function y(e){var t=new h(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 E(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function k(e,t,r,n){var a=new h(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a}function x(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 T(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 F(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 z(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],c=r[1],u=r[2],_=r[3];return e[0]=n*s+i*c,e[1]=a*s+o*c,e[2]=n*u+i*_,e[3]=a*u+o*_,e}function S(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*s,e[1]=a*c+o*s,e[2]=n*-s+i*c,e[3]=a*-s+o*c,e}function L(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],c=r[1];return e[0]=n*s,e[1]=a*s,e[2]=i*c,e[3]=o*c,e}function D(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 P(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function O(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function C(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 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 I(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 j(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=t[0],s=t[1],c=t[2],u=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-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))}function q(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 N(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=z,H=I;function Y(){var e=new h(6);return h!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e}function G(e){var t=new h(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 X(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 J(e,t,r,n,a,i){var o=new h(6);return o[0]=e,o[1]=t,o[2]=r,o[3]=n,o[4]=a,o[5]=i,o}function K(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 Q(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],c=r*i-n*a;return c?(c=1/c,e[0]=i*c,e[1]=-n*c,e[2]=-a*c,e[3]=r*c,e[4]=(a*s-i*o)*c,e[5]=(n*o-r*s)*c,e):null}function $(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],c=t[5],u=r[0],_=r[1],f=r[2],l=r[3],d=r[4],h=r[5];return e[0]=n*u+i*_,e[1]=a*u+o*_,e[2]=n*f+i*l,e[3]=a*f+o*l,e[4]=n*d+i*h+s,e[5]=a*d+o*h+c,e}function te(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=Math.sin(r),_=Math.cos(r);return e[0]=n*_+i*u,e[1]=a*_+o*u,e[2]=n*-u+i*_,e[3]=a*-u+o*_,e[4]=s,e[5]=c,e}function re(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=r[0],_=r[1];return e[0]=n*u,e[1]=a*u,e[2]=i*_,e[3]=o*_,e[4]=s,e[5]=c,e}function ne(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=r[0],_=r[1];return e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=n*u+i*_+s,e[5]=a*u+o*_+c,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 ce(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)}function ue(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 he(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=t[0],u=t[1],_=t[2],f=t[3],l=t[4],h=t[5];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&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-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}var me=ee,pe=_e;function ve(){var e=new h(9);return h!=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 be(e){var t=new h(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 we(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,c){var u=new h(9);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[8]=c,u}function Me(e,t,r,n,a,i,o,s,c,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]=c,e[8]=u,e}function Ee(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 ke(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 xe(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],c=t[6],u=t[7],_=t[8],f=_*o-s*u,l=-_*i+s*c,d=u*i-o*c,h=r*f+n*l+a*d;return h?(h=1/h,e[0]=f*h,e[1]=(-_*n+a*u)*h,e[2]=(s*n-a*o)*h,e[3]=l*h,e[4]=(_*r-a*c)*h,e[5]=(-s*r+a*i)*h,e[6]=d*h,e[7]=(-u*r+n*c)*h,e[8]=(o*r-n*i)*h,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],c=t[6],u=t[7],_=t[8];return e[0]=o*_-s*u,e[1]=a*u-n*_,e[2]=n*s-a*o,e[3]=s*c-i*_,e[4]=r*_-a*c,e[5]=a*i-r*s,e[6]=i*u-o*c,e[7]=n*c-r*u,e[8]=r*o-n*i,e}function Te(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],s=e[6],c=e[7],u=e[8];return t*(u*i-o*c)+r*(-u*a+o*s)+n*(c*a-i*s)}function Fe(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=t[8],l=r[0],d=r[1],h=r[2],m=r[3],p=r[4],v=r[5],g=r[6],b=r[7],w=r[8];return e[0]=l*n+d*o+h*u,e[1]=l*a+d*s+h*_,e[2]=l*i+d*c+h*f,e[3]=m*n+p*o+v*u,e[4]=m*a+p*s+v*_,e[5]=m*i+p*c+v*f,e[6]=g*n+b*o+w*u,e[7]=g*a+b*s+w*_,e[8]=g*i+b*c+w*f,e}function Re(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=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]=c,e[6]=l*n+d*o+u,e[7]=l*a+d*s+_,e[8]=l*i+d*c+f,e}function ze(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=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*c,e[3]=d*o-l*n,e[4]=d*s-l*a,e[5]=d*c-l*i,e[6]=u,e[7]=_,e[8]=f,e}function Se(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 Le(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 De(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 Pe(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 Oe(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 Ce(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,s=n+n,c=a+a,u=r*o,_=n*o,f=n*s,l=a*o,d=a*s,h=a*c,m=i*o,p=i*s,v=i*c;return e[0]=1-f-h,e[3]=_-v,e[6]=l+p,e[1]=_+v,e[4]=1-u-h,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-u-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],c=t[6],u=t[7],_=t[8],f=t[9],l=t[10],d=t[11],h=t[12],m=t[13],p=t[14],v=t[15],g=r*s-n*o,b=r*c-a*o,w=r*u-i*o,y=n*c-a*s,M=n*u-i*s,E=a*u-i*c,k=_*m-f*h,x=_*p-l*h,A=_*v-d*h,T=f*p-l*m,F=f*v-d*m,R=l*v-d*p,z=g*R-b*F+w*T+y*A-M*x+E*k;return z?(z=1/z,e[0]=(s*R-c*F+u*T)*z,e[1]=(c*A-o*R-u*x)*z,e[2]=(o*F-s*A+u*k)*z,e[3]=(a*F-n*R-i*T)*z,e[4]=(r*R-a*A+i*x)*z,e[5]=(n*A-r*F-i*k)*z,e[6]=(m*E-p*M+v*y)*z,e[7]=(p*w-h*E-v*b)*z,e[8]=(h*M-m*w+v*g)*z,e):null}function Ue(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 Ie(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 je(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 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,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 Ye(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],u=e[7],_=e[8],f=t[0],l=t[1],h=t[2],m=t[3],p=t[4],v=t[5],g=t[6],b=t[7],w=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-h)<=d*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-m)<=d*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-g)<=d*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(_-w)<=d*Math.max(1,Math.abs(_),Math.abs(w))}var Ge=Fe,Xe=qe;function Ze(){var e=new h(16);return h!=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 Je(e){var t=new h(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 Ke(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 Qe(e,t,r,n,a,i,o,s,c,u,_,f,l,d,m,p){var v=new h(16);return v[0]=e,v[1]=t,v[2]=r,v[3]=n,v[4]=a,v[5]=i,v[6]=o,v[7]=s,v[8]=c,v[9]=u,v[10]=_,v[11]=f,v[12]=l,v[13]=d,v[14]=m,v[15]=p,v}function $e(e,t,r,n,a,i,o,s,c,u,_,f,l,d,h,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=i,e[5]=o,e[6]=s,e[7]=c,e[8]=u,e[9]=_,e[10]=f,e[11]=l,e[12]=d,e[13]=h,e[14]=m,e[15]=p,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],c=t[6],u=t[7],_=t[8],f=t[9],l=t[10],d=t[11],h=t[12],m=t[13],p=t[14],v=t[15],g=r*s-n*o,b=r*c-a*o,w=r*u-i*o,y=n*c-a*s,M=n*u-i*s,E=a*u-i*c,k=_*m-f*h,x=_*p-l*h,A=_*v-d*h,T=f*p-l*m,F=f*v-d*m,R=l*v-d*p,z=g*R-b*F+w*T+y*A-M*x+E*k;return z?(z=1/z,e[0]=(s*R-c*F+u*T)*z,e[1]=(a*F-n*R-i*T)*z,e[2]=(m*E-p*M+v*y)*z,e[3]=(l*M-f*E-d*y)*z,e[4]=(c*A-o*R-u*x)*z,e[5]=(r*R-a*A+i*x)*z,e[6]=(p*w-h*E-v*b)*z,e[7]=(_*E-l*w+d*b)*z,e[8]=(o*F-s*A+u*k)*z,e[9]=(n*A-r*F-i*k)*z,e[10]=(h*M-m*w+v*g)*z,e[11]=(f*w-_*M-d*g)*z,e[12]=(s*x-o*T-c*k)*z,e[13]=(r*T-n*x+a*k)*z,e[14]=(m*b-h*y-p*g)*z,e[15]=(_*y-f*b+l*g)*z,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],c=t[6],u=t[7],_=t[8],f=t[9],l=t[10],d=t[11],h=t[12],m=t[13],p=t[14],v=t[15];return e[0]=s*(l*v-d*p)-f*(c*v-u*p)+m*(c*d-u*l),e[1]=-(n*(l*v-d*p)-f*(a*v-i*p)+m*(a*d-i*l)),e[2]=n*(c*v-u*p)-s*(a*v-i*p)+m*(a*u-i*c),e[3]=-(n*(c*d-u*l)-s*(a*d-i*l)+f*(a*u-i*c)),e[4]=-(o*(l*v-d*p)-_*(c*v-u*p)+h*(c*d-u*l)),e[5]=r*(l*v-d*p)-_*(a*v-i*p)+h*(a*d-i*l),e[6]=-(r*(c*v-u*p)-o*(a*v-i*p)+h*(a*u-i*c)),e[7]=r*(c*d-u*l)-o*(a*d-i*l)+_*(a*u-i*c),e[8]=o*(f*v-d*m)-_*(s*v-u*m)+h*(s*d-u*f),e[9]=-(r*(f*v-d*m)-_*(n*v-i*m)+h*(n*d-i*f)),e[10]=r*(s*v-u*m)-o*(n*v-i*m)+h*(n*u-i*s),e[11]=-(r*(s*d-u*f)-o*(n*d-i*f)+_*(n*u-i*s)),e[12]=-(o*(f*p-l*m)-_*(s*p-c*m)+h*(s*l-c*f)),e[13]=r*(f*p-l*m)-_*(n*p-a*m)+h*(n*l-a*f),e[14]=-(r*(s*p-c*m)-o*(n*p-a*m)+h*(n*c-a*s)),e[15]=r*(s*l-c*f)-o*(n*l-a*f)+_*(n*c-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],c=e[7],u=e[8],_=e[9],f=e[10],l=e[11],d=e[12],h=e[13],m=e[14],p=e[15];return(t*o-r*i)*(f*p-l*m)-(t*s-n*i)*(_*p-l*h)+(t*c-a*i)*(_*m-f*h)+(r*s-n*o)*(u*p-l*d)-(r*c-a*o)*(u*m-f*d)+(n*c-a*s)*(u*h-_*d)}function it(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=t[8],l=t[9],d=t[10],h=t[11],m=t[12],p=t[13],v=t[14],g=t[15],b=r[0],w=r[1],y=r[2],M=r[3];return e[0]=b*n+w*s+y*f+M*m,e[1]=b*a+w*c+y*l+M*p,e[2]=b*i+w*u+y*d+M*v,e[3]=b*o+w*_+y*h+M*g,b=r[4],w=r[5],y=r[6],M=r[7],e[4]=b*n+w*s+y*f+M*m,e[5]=b*a+w*c+y*l+M*p,e[6]=b*i+w*u+y*d+M*v,e[7]=b*o+w*_+y*h+M*g,b=r[8],w=r[9],y=r[10],M=r[11],e[8]=b*n+w*s+y*f+M*m,e[9]=b*a+w*c+y*l+M*p,e[10]=b*i+w*u+y*d+M*v,e[11]=b*o+w*_+y*h+M*g,b=r[12],w=r[13],y=r[14],M=r[15],e[12]=b*n+w*s+y*f+M*m,e[13]=b*a+w*c+y*l+M*p,e[14]=b*i+w*u+y*d+M*v,e[15]=b*o+w*_+y*h+M*g,e}function ot(e,t,r){var n,a,i,o,s,c,u,_,f,l,d,h,m=r[0],p=r[1],v=r[2];return t===e?(e[12]=t[0]*m+t[4]*p+t[8]*v+t[12],e[13]=t[1]*m+t[5]*p+t[9]*v+t[13],e[14]=t[2]*m+t[6]*p+t[10]*v+t[14],e[15]=t[3]*m+t[7]*p+t[11]*v+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=t[8],l=t[9],d=t[10],h=t[11],e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=s,e[5]=c,e[6]=u,e[7]=_,e[8]=f,e[9]=l,e[10]=d,e[11]=h,e[12]=n*m+s*p+f*v+t[12],e[13]=a*m+c*p+l*v+t[13],e[14]=i*m+u*p+d*v+t[14],e[15]=o*m+_*p+h*v+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 ct(e,t,r,n){var a,i,o,s,c,u,_,f,l,h,m,p,v,g,b,w,y,M,E,k,x,A,T,F,R=n[0],z=n[1],S=n[2],L=Math.hypot(R,z,S);return L<d?null:(R*=L=1/L,z*=L,S*=L,a=Math.sin(r),o=1-(i=Math.cos(r)),s=t[0],c=t[1],u=t[2],_=t[3],f=t[4],l=t[5],h=t[6],m=t[7],p=t[8],v=t[9],g=t[10],b=t[11],w=R*R*o+i,y=z*R*o+S*a,M=S*R*o-z*a,E=R*z*o-S*a,k=z*z*o+i,x=S*z*o+R*a,A=R*S*o+z*a,T=z*S*o-R*a,F=S*S*o+i,e[0]=s*w+f*y+p*M,e[1]=c*w+l*y+v*M,e[2]=u*w+h*y+g*M,e[3]=_*w+m*y+b*M,e[4]=s*E+f*k+p*x,e[5]=c*E+l*k+v*x,e[6]=u*E+h*k+g*x,e[7]=_*E+m*k+b*x,e[8]=s*A+f*T+p*F,e[9]=c*A+l*T+v*F,e[10]=u*A+h*T+g*F,e[11]=_*A+m*T+b*F,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ut(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],s=t[6],c=t[7],u=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+u*n,e[5]=o*a+_*n,e[6]=s*a+f*n,e[7]=c*a+l*n,e[8]=u*a-i*n,e[9]=_*a-o*n,e[10]=f*a-s*n,e[11]=l*a-c*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],c=t[3],u=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-u*n,e[1]=o*a-_*n,e[2]=s*a-f*n,e[3]=c*a-l*n,e[8]=i*n+u*a,e[9]=o*n+_*a,e[10]=s*n+f*a,e[11]=c*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],c=t[3],u=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+u*n,e[1]=o*a+_*n,e[2]=s*a+f*n,e[3]=c*a+l*n,e[4]=u*a-i*n,e[5]=_*a-o*n,e[6]=f*a-s*n,e[7]=l*a-c*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 ht(e,t,r){var n,a,i,o=r[0],s=r[1],c=r[2],u=Math.hypot(o,s,c);return u<d?null:(o*=u=1/u,s*=u,c*=u,n=Math.sin(t),i=1-(a=Math.cos(t)),e[0]=o*o*i+a,e[1]=s*o*i+c*n,e[2]=c*o*i-s*n,e[3]=0,e[4]=o*s*i-c*n,e[5]=s*s*i+a,e[6]=c*s*i+o*n,e[7]=0,e[8]=o*c*i+s*n,e[9]=s*c*i-o*n,e[10]=c*c*i+a,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]=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 pt(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 vt(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,c=a+a,u=i+i,_=n*s,f=n*c,l=n*u,d=a*c,h=a*u,m=i*u,p=o*s,v=o*c,g=o*u;return e[0]=1-(d+m),e[1]=f+g,e[2]=l-v,e[3]=0,e[4]=f-g,e[5]=1-(_+m),e[6]=h+p,e[7]=0,e[8]=l+v,e[9]=h-p,e[10]=1-(_+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function bt(e,t){var r=new h(3),n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=n*n+a*a+i*i+o*o;return f>0?(r[0]=2*(s*o+_*n+c*i-u*a)/f,r[1]=2*(c*o+_*a+u*n-s*i)/f,r[2]=2*(u*o+_*i+s*a-c*n)/f):(r[0]=2*(s*o+_*n+c*i-u*a),r[1]=2*(c*o+_*a+u*n-s*i),r[2]=2*(u*o+_*i+s*a-c*n)),gt(e,t,r),e}function wt(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],c=t[8],u=t[9],_=t[10];return e[0]=Math.hypot(r,n,a),e[1]=Math.hypot(i,o,s),e[2]=Math.hypot(c,u,_),e}function Mt(e,t){var r=new h(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,c=t[2]*i,u=t[4]*n,_=t[5]*a,f=t[6]*i,l=t[8]*n,d=t[9]*a,m=t[10]*i,p=o+_+m,v=0;return p>0?(v=2*Math.sqrt(p+1),e[3]=.25*v,e[0]=(f-d)/v,e[1]=(l-c)/v,e[2]=(s-u)/v):o>_&&o>m?(v=2*Math.sqrt(1+o-_-m),e[3]=(f-d)/v,e[0]=.25*v,e[1]=(s+u)/v,e[2]=(l+c)/v):_>m?(v=2*Math.sqrt(1+_-o-m),e[3]=(l-c)/v,e[0]=(s+u)/v,e[1]=.25*v,e[2]=(f+d)/v):(v=2*Math.sqrt(1+m-o-_),e[3]=(s-u)/v,e[0]=(l+c)/v,e[1]=(f+d)/v,e[2]=.25*v),e}function Et(e,t,r,n){var a=t[0],i=t[1],o=t[2],s=t[3],c=a+a,u=i+i,_=o+o,f=a*c,l=a*u,d=a*_,h=i*u,m=i*_,p=o*_,v=s*c,g=s*u,b=s*_,w=n[0],y=n[1],M=n[2];return e[0]=(1-(h+p))*w,e[1]=(l+b)*w,e[2]=(d-g)*w,e[3]=0,e[4]=(l-b)*y,e[5]=(1-(f+p))*y,e[6]=(m+v)*y,e[7]=0,e[8]=(d+g)*M,e[9]=(m-v)*M,e[10]=(1-(f+h))*M,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function kt(e,t,r,n,a){var i=t[0],o=t[1],s=t[2],c=t[3],u=i+i,_=o+o,f=s+s,l=i*u,d=i*_,h=i*f,m=o*_,p=o*f,v=s*f,g=c*u,b=c*_,w=c*f,y=n[0],M=n[1],E=n[2],k=a[0],x=a[1],A=a[2],T=(1-(m+v))*y,F=(d+w)*y,R=(h-b)*y,z=(d-w)*M,S=(1-(l+v))*M,L=(p+g)*M,D=(h+b)*E,P=(p-g)*E,O=(1-(l+m))*E;return e[0]=T,e[1]=F,e[2]=R,e[3]=0,e[4]=z,e[5]=S,e[6]=L,e[7]=0,e[8]=D,e[9]=P,e[10]=O,e[11]=0,e[12]=r[0]+k-(T*k+z*x+D*A),e[13]=r[1]+x-(F*k+S*x+P*A),e[14]=r[2]+A-(R*k+L*x+O*A),e[15]=1,e}function xt(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,s=n+n,c=a+a,u=r*o,_=n*o,f=n*s,l=a*o,d=a*s,h=a*c,m=i*o,p=i*s,v=i*c;return e[0]=1-f-h,e[1]=_+v,e[2]=l-p,e[3]=0,e[4]=_-v,e[5]=1-u-h,e[6]=d+m,e[7]=0,e[8]=l+p,e[9]=d-m,e[10]=1-u-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),c=1/(a-n),u=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*c,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*c,e[10]=(o+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*u,e[15]=0,e}function Tt(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 Ft(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),c=2/(o+s),u=2/(a+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(o-s)*c*.5,e[9]=(a-i)*u*.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),c=1/(n-a),u=1/(i-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*c,e[14]=(o+i)*u,e[15]=1,e}function zt(e,t,r,n){var a,i,o,s,c,u,_,f,l,h,m=t[0],p=t[1],v=t[2],g=n[0],b=n[1],w=n[2],y=r[0],M=r[1],E=r[2];return Math.abs(m-y)<d&&Math.abs(p-M)<d&&Math.abs(v-E)<d?et(e):(_=m-y,f=p-M,l=v-E,a=b*(l*=h=1/Math.hypot(_,f,l))-w*(f*=h),i=w*(_*=h)-g*l,o=g*f-b*_,(h=Math.hypot(a,i,o))?(a*=h=1/h,i*=h,o*=h):(a=0,i=0,o=0),s=f*o-l*i,c=l*a-_*o,u=_*i-f*a,(h=Math.hypot(s,c,u))?(s*=h=1/h,c*=h,u*=h):(s=0,c=0,u=0),e[0]=a,e[1]=s,e[2]=_,e[3]=0,e[4]=i,e[5]=c,e[6]=f,e[7]=0,e[8]=o,e[9]=u,e[10]=l,e[11]=0,e[12]=-(a*m+i*p+o*v),e[13]=-(s*m+c*p+u*v),e[14]=-(_*m+f*p+l*v),e[15]=1,e)}function St(e,t,r,n){var a=t[0],i=t[1],o=t[2],s=n[0],c=n[1],u=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 h=c*l-u*f,m=u*_-s*l,p=s*f-c*_;return(d=h*h+m*m+p*p)>0&&(h*=d=1/Math.sqrt(d),m*=d,p*=d),e[0]=h,e[1]=m,e[2]=p,e[3]=0,e[4]=f*p-l*m,e[5]=l*h-_*p,e[6]=_*m-f*h,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 Lt(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 Dt(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 Pt(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 Ot(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 Ct(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 Ut(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 It(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],u=e[7],_=e[8],f=e[9],l=e[10],h=e[11],m=e[12],p=e[13],v=e[14],g=e[15],b=t[0],w=t[1],y=t[2],M=t[3],E=t[4],k=t[5],x=t[6],A=t[7],T=t[8],F=t[9],R=t[10],z=t[11],S=t[12],L=t[13],D=t[14],P=t[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&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-E)<=d*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-k)<=d*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(c-x)<=d*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(u-A)<=d*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(_-T)<=d*Math.max(1,Math.abs(_),Math.abs(T))&&Math.abs(f-F)<=d*Math.max(1,Math.abs(f),Math.abs(F))&&Math.abs(l-R)<=d*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(h-z)<=d*Math.max(1,Math.abs(h),Math.abs(z))&&Math.abs(m-S)<=d*Math.max(1,Math.abs(m),Math.abs(S))&&Math.abs(p-L)<=d*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(v-D)<=d*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(g-P)<=d*Math.max(1,Math.abs(g),Math.abs(P))}var Vt=it,jt=Ot;function qt(){var e=new h(3);return h!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Nt(e){var t=new h(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 h(3);return n[0]=e,n[1]=t,n[2]=r,n}function Yt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Gt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function Xt(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 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 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 Qt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function $t(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 cr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function ur(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],c=r[2];return e[0]=a*c-i*s,e[1]=i*o-n*c,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 hr(e,t,r,n,a,i){var o=i*i,s=o*(2*i-3)+1,c=o*(i-2)+i,u=o*(i-1),_=o*(3-2*i);return e[0]=t[0]*s+r[0]*c+n[0]*u+a[0]*_,e[1]=t[1]*s+r[1]*c+n[1]*u+a[1]*_,e[2]=t[2]*s+r[2]*c+n[2]*u+a[2]*_,e}function mr(e,t,r,n,a,i){var o=1-i,s=o*o,c=i*i,u=s*o,_=3*i*s,f=3*c*o,l=c*i;return e[0]=t[0]*u+r[0]*_+n[0]*f+a[0]*l,e[1]=t[1]*u+r[1]*_+n[1]*f+a[1]*l,e[2]=t[2]*u+r[2]*_+n[2]*f+a[2]*l,e}function pr(e,t){t=t||1;var r=2*m()*Math.PI,n=2*m()-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 vr(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 br(e,t,r){var n=r[0],a=r[1],i=r[2],o=r[3],s=t[0],c=t[1],u=t[2],_=a*u-i*c,f=i*s-n*u,l=n*c-a*s,d=a*l-i*f,h=i*_-n*l,m=n*f-a*_,p=2*o;return _*=p,f*=p,l*=p,d*=2,h*=2,m*=2,e[0]=s+_+d,e[1]=c+f+h,e[2]=u+l+m,e}function wr(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 Er(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 kr(e){return e[0]=0,e[1]=0,e[2]=0,e}function xr(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 Tr(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 Fr,Rr=Zt,zr=Jt,Sr=Kt,Lr=ir,Dr=or,Pr=Wt,Or=sr,Cr=(Fr=qt(),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)Fr[0]=e[o],Fr[1]=e[o+1],Fr[2]=e[o+2],a(Fr,Fr,i),e[o]=Fr[0],e[o+1]=Fr[1],e[o+2]=Fr[2];return e});function Br(){var e=new h(4);return h!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Ur(e){var t=new h(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Ir(e,t,r,n){var a=new h(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 jr(e,t,r,n,a){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e}function qr(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 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 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 Yr(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 Gr(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 Xr(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 Jr(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 Kr(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 Qr(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 $r(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 cn(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],c=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],_=t[0],f=t[1],l=t[2],d=t[3];return e[0]=f*u-l*c+d*s,e[1]=-_*u+l*o-d*i,e[2]=_*c-f*o+d*a,e[3]=-_*s+f*i-l*a,e}function un(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*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{s=(a=2*m()-1)*a+(i=2*m()-1)*i}while(s>=1);var c=Math.sqrt((1-o)/s);return e[0]=t*r,e[1]=t*n,e[2]=t*a*c,e[3]=t*i*c,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],c=r[2],u=r[3],_=u*n+s*i-c*a,f=u*a+c*n-o*i,l=u*i+o*a-s*n,d=-o*n-s*a-c*i;return e[0]=_*u+d*-o+f*-c-l*-s,e[1]=f*u+d*-s+l*-o-_*-c,e[2]=l*u+d*-c+_*-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 hn(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function mn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function pn(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=t[0],s=t[1],c=t[2],u=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-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))}var vn=Nr,gn=Wr,bn=Hr,wn=$r,yn=en,Mn=tn,En=rn,kn=function(){var e=Br();return function(t,r,n,a,i,o){var s,c;for(r||(r=4),n||(n=0),c=a?Math.min(a*r+n,t.length):t.length,s=n;s<c;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 xn(){var e=new h(4);return h!=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 Tn(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 Fn(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 zn(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],c=r[1],u=r[2],_=r[3];return e[0]=n*_+o*s+a*u-i*c,e[1]=a*_+o*c+i*s-n*u,e[2]=i*_+o*u+n*c-a*s,e[3]=o*_-n*s-a*c-i*u,e}function Sn(e,t,r){r*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);return e[0]=n*c+o*s,e[1]=a*c+i*s,e[2]=i*c-a*s,e[3]=o*c-n*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),c=Math.cos(r);return e[0]=n*c-i*s,e[1]=a*c+o*s,e[2]=i*c+n*s,e[3]=o*c-a*s,e}function Dn(e,t,r){r*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);return e[0]=n*c+a*s,e[1]=a*c-n*s,e[2]=i*c+o*s,e[3]=o*c-i*s,e}function Pn(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 On(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),c=o>0?s*Math.sin(o)/o:0;return e[0]=r*c,e[1]=n*c,e[2]=a*c,e[3]=s*Math.cos(o),e}function Cn(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 Cn(e,t),na(e,e,r),On(e,e),e}function Un(e,t,r,n){var a,i,o,s,c,u=t[0],_=t[1],f=t[2],l=t[3],h=r[0],m=r[1],p=r[2],v=r[3];return(i=u*h+_*m+f*p+l*v)<0&&(i=-i,h=-h,m=-m,p=-p,v=-v),1-i>d?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o):(s=1-n,c=n),e[0]=s*u+c*h,e[1]=s*_+c*m,e[2]=s*f+c*p,e[3]=s*l+c*v,e}function In(e){var t=m(),r=m(),n=m(),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 jn(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function qn(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 Nn(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),c=Math.cos(r),u=Math.sin(n),_=Math.cos(n);return e[0]=i*c*_-o*s*u,e[1]=o*s*_+i*c*u,e[2]=o*c*u-i*s*_,e[3]=o*c*_+i*s*u,e}function Wn(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var Hn,Yn,Gn,Xn,Zn,Jn,Kn=Ur,Qn=Ir,$n=Vr,ea=jr,ta=qr,ra=zn,na=Kr,aa=sn,ia=un,oa=tn,sa=oa,ca=rn,ua=ca,_a=on,fa=mn,la=pn,da=(Hn=qt(),Yn=Ht(1,0,0),Gn=Ht(0,1,0),function(e,t,r){var n=fr(t,r);return n<-.999999?(lr(Hn,Yn,t),Pr(Hn)<1e-6&&lr(Hn,Gn,t),_r(Hn,Hn),Tn(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))}),ha=(Xn=xn(),Zn=xn(),function(e,t,r,n,a,i){return Un(Xn,t,a,i),Un(Zn,r,n,i),Un(e,Xn,Zn,2*i*(1-i)),e}),ma=(Jn=ve(),function(e,t,r,n){return Jn[0]=r[0],Jn[3]=r[1],Jn[6]=r[2],Jn[1]=n[0],Jn[4]=n[1],Jn[7]=n[2],Jn[2]=-t[0],Jn[5]=-t[1],Jn[8]=-t[2],_a(e,qn(e,Jn))});function pa(){var e=new h(8);return h!=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 va(e){var t=new h(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 c=new h(8);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}function ba(e,t,r,n,a,i,o){var s=new h(8);s[0]=e,s[1]=t,s[2]=r,s[3]=n;var c=.5*a,u=.5*i,_=.5*o;return s[4]=c*n+u*r-_*t,s[5]=u*n+_*e-c*r,s[6]=_*n+c*t-u*e,s[7]=-c*e-u*t-_*r,s}function wa(e,t,r){var n=.5*r[0],a=.5*r[1],i=.5*r[2],o=t[0],s=t[1],c=t[2],u=t[3];return e[0]=o,e[1]=s,e[2]=c,e[3]=u,e[4]=n*u+a*c-i*s,e[5]=a*u+i*o-n*c,e[6]=i*u+n*s-a*o,e[7]=-n*o-a*s-i*c,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 Ea(e,t){var r=xn();Mt(r,t);var n=new h(3);return wt(n,t),wa(e,r,n),e}function ka(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 xa(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,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]=c,e}var Ta=$n;function Fa(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}var Ra=$n;function za(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function Sa(e,t){var r=t[4],n=t[5],a=t[6],i=t[7],o=-t[0],s=-t[1],c=-t[2],u=t[3];return e[0]=2*(r*u+i*o+n*c-a*s),e[1]=2*(n*u+i*s+a*o-r*c),e[2]=2*(a*u+i*c+r*s-n*o),e}function La(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=.5*r[0],c=.5*r[1],u=.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*u-i*c+_,e[5]=o*c+i*s-n*u+f,e[6]=o*u+n*c-a*s+l,e[7]=-n*s-a*c-i*u+d,e}function Da(e,t,r){var n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=s*o+_*n+c*i-u*a,l=c*o+_*a+u*n-s*i,d=u*o+_*i+s*a-c*n,h=_*o-s*n-c*a-u*i;return Sn(e,t,r),n=e[0],a=e[1],i=e[2],o=e[3],e[4]=f*o+h*n+l*i-d*a,e[5]=l*o+h*a+d*n-f*i,e[6]=d*o+h*i+f*a-l*n,e[7]=h*o-f*n-l*a-d*i,e}function Pa(e,t,r){var n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=s*o+_*n+c*i-u*a,l=c*o+_*a+u*n-s*i,d=u*o+_*i+s*a-c*n,h=_*o-s*n-c*a-u*i;return Ln(e,t,r),n=e[0],a=e[1],i=e[2],o=e[3],e[4]=f*o+h*n+l*i-d*a,e[5]=l*o+h*a+d*n-f*i,e[6]=d*o+h*i+f*a-l*n,e[7]=h*o-f*n-l*a-d*i,e}function Oa(e,t,r){var n=-t[0],a=-t[1],i=-t[2],o=t[3],s=t[4],c=t[5],u=t[6],_=t[7],f=s*o+_*n+c*i-u*a,l=c*o+_*a+u*n-s*i,d=u*o+_*i+s*a-c*n,h=_*o-s*n-c*a-u*i;return Dn(e,t,r),n=e[0],a=e[1],i=e[2],o=e[3],e[4]=f*o+h*n+l*i-d*a,e[5]=l*o+h*a+d*n-f*i,e[6]=d*o+h*i+f*a-l*n,e[7]=h*o-f*n-l*a-d*i,e}function Ca(e,t,r){var n=r[0],a=r[1],i=r[2],o=r[3],s=t[0],c=t[1],u=t[2],_=t[3];return e[0]=s*o+_*n+c*i-u*a,e[1]=c*o+_*a+u*n-s*i,e[2]=u*o+_*i+s*a-c*n,e[3]=_*o-s*n-c*a-u*i,s=t[4],c=t[5],u=t[6],_=t[7],e[4]=s*o+_*n+c*i-u*a,e[5]=c*o+_*a+u*n-s*i,e[6]=u*o+_*i+s*a-c*n,e[7]=_*o-s*n-c*a-u*i,e}function Ba(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=r[0],c=r[1],u=r[2],_=r[3];return e[0]=n*_+o*s+a*u-i*c,e[1]=a*_+o*c+i*s-n*u,e[2]=i*_+o*u+n*c-a*s,e[3]=o*_-n*s-a*c-i*u,s=r[4],c=r[5],u=r[6],_=r[7],e[4]=n*_+o*s+a*u-i*c,e[5]=a*_+o*c+i*s-n*u,e[6]=i*_+o*u+n*c-a*s,e[7]=o*_-n*s-a*c-i*u,e}function Ua(e,t,r,n){if(Math.abs(n)<d)return ka(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,c=i*r[2]/a,u=Math.cos(n),_=t[0],f=t[1],l=t[2],h=t[3];e[0]=_*u+h*o+f*c-l*s,e[1]=f*u+h*s+l*o-_*c,e[2]=l*u+h*c+_*s-f*o,e[3]=h*u-_*o-f*s-l*c;var m=t[4],p=t[5],v=t[6],g=t[7];return e[4]=m*u+g*o+p*c-v*s,e[5]=p*u+g*s+v*o-m*c,e[6]=v*u+g*c+m*s-p*o,e[7]=g*u-m*o-p*s-v*c,e}function Ia(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],c=r[5],u=r[6],_=r[7],f=t[4],l=t[5],d=t[6],h=t[7],m=r[0],p=r[1],v=r[2],g=r[3];return e[0]=n*g+o*m+a*v-i*p,e[1]=a*g+o*p+i*m-n*v,e[2]=i*g+o*v+n*p-a*m,e[3]=o*g-n*m-a*p-i*v,e[4]=n*_+o*s+a*u-i*c+f*g+h*m+l*v-d*p,e[5]=a*_+o*c+i*s-n*u+l*g+h*p+d*m-f*v,e[6]=i*_+o*u+n*c-a*s+d*g+h*v+f*p-l*m,e[7]=o*_-n*s-a*c-i*u+h*g-f*m-l*p-d*v,e}var ja=Va;function qa(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 Na=aa;function Wa(e,t,r,n){var a=1-n;return Na(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 Ya(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 Ga=oa,Xa=Ga,Za=ca,Ja=Za;function Ka(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],c=t[5],u=t[6],_=t[7],f=n*s+a*c+i*u+o*_;e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=(s-n*f)/r,e[5]=(c-a*f)/r,e[6]=(u-i*f)/r,e[7]=(_-o*f)/r}return e}function Qa(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function $a(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],c=e[6],u=e[7],_=t[0],f=t[1],l=t[2],h=t[3],m=t[4],p=t[5],v=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-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-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(c-v)<=d*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(u-g)<=d*Math.max(1,Math.abs(u),Math.abs(g))}function ti(){var e=new h(2);return h!=Float32Array&&(e[0]=0,e[1]=0),e}function ri(e){var t=new h(2);return t[0]=e[0],t[1]=e[1],t}function ni(e,t){var r=new h(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 ci(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 _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 hi(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function mi(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function pi(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e}function vi(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 bi(e){var t=e[0],r=e[1];return Math.hypot(t,r)}function wi(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 Ei(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 ki(e,t){return e[0]*t[0]+e[1]*t[1]}function xi(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 Ti(e,t){t=t||1;var r=2*m()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e}function Fi(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 zi(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 Si(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 Li(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 Di(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 c=(r*a+n*i)*o*s;return c>1?0:c<-1?Math.PI:Math.acos(c)}function Pi(e){return e[0]=0,e[1]=0,e}function Oi(e){return"vec2("+e[0]+", "+e[1]+")"}function Ci(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 Ui=bi,Ii=si,Vi=ci,ji=ui,qi=vi,Ni=gi,Wi=wi,Hi=function(){var e=ti();return function(t,r,n,a,i,o){var s,c;for(r||(r=2),n||(n=0),c=a?Math.min(a*r+n,t.length):t.length,s=n;s<c;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}}();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 c})),r.d(t,"vec4",(function(){return u}))},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";Object.defineProperty(t,"__esModule",{value:!0}),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,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyScreenCounterRotation=t.Pipeline=void 0;const n=r(30),a=r(1),i=r(6),o=r(31),s=r(32),c=r(7),u=r(9),_=r(0),f=r(12);let l=new Map;class d{constructor(e,t,r){this._client=e,this._impl=t,this._mgr=r,this.pendingMessages=[],this.cameraTokens=new Map,this.nextCameraToken=1,this.tokensInFlight=0,this.videoTextures=[],this.cameraPixelArrays=[],this._sequenceRecordDeviceAttitudeMatrices=!0,this.onGLContextReset=new u.Event}static create(e,t){let r=e.pipeline_create();return l.set(r,new d(e,r,t)),r}static get(e){return l.get(e)}frameUpdate(e){for(let t of this.pendingMessages)e.processMessages(t),this._mgr.postOutgoingMessage({t:"buf",p:this._impl,d:t},[t]);this.pendingMessages=[];let t=this._client.pipeline_camera_frame_user_data(this._impl);if(t)for(let e of this.cameraTokens)e[0]<t&&(e[1].texture&&this.videoTextures.push(e[1].texture),this.cameraTokens.delete(e[0]))}cameraTokenReturn(e){if(this._sequenceRecorder&&this._sequenceRecordDeviceAttitudeMatrices){let t=this.cameraTokens.get(e.token);t&&(e.att&&this._sequenceRecorder.appendAttitudeMatrix(e.att),t.data=e.d,this._sequenceRecorder.appendCameraFrame(t))}this.cameraPixelArrays.push(e.d),this.tokensInFlight--}sequenceRecordStart(e){this._sequenceRecorder||(this._sequenceRecorder=new f.SequenceRecorder(e)),this._sequenceRecorder.start()}sequenceRecordStop(){var e;null===(e=this._sequenceRecorder)||void 0===e||e.stop()}sequenceRecordData(){var e;return(null===(e=this._sequenceRecorder)||void 0===e?void 0:e.data())||new Uint8Array(0)}sequenceRecordClear(){delete this._sequenceRecorder}sequenceRecordDeviceAttitudeMatrices(e){this._sequenceRecordDeviceAttitudeMatrices=e}getVideoTexture(){return this.videoTextures.pop()}destroy(){this._client.pipeline_destroy(this._impl),l.delete(this._impl)}getCurrentCameraInfo(){let e=this._client.pipeline_camera_frame_user_data(this._impl);if(e)return this.cameraTokens.get(e)}cameraFrameDrawGL(e,t,r){if(!this.glContext)return;let a=this.getCurrentCameraInfo();a&&(this._cameraDraw||(this._cameraDraw=new n.CameraDraw(this.glContext)),this._cameraDraw.drawCameraFrame(e,t,a,!0===r))}glContextLost(){this._cameraDraw&&this._cameraDraw.dispose(),this._faceDraw&&this._faceDraw.dispose(),this._faceProjectDraw&&this._faceProjectDraw.dispose(),delete this._cameraDraw,delete this._faceDraw,delete this._faceProjectDraw,c.disposeDrawPlane(),this.onGLContextReset.emit();for(let e of this.videoTextures)this.glContext&&this.glContext.deleteTexture(e);this.videoTextures=[];for(let e of this.cameraTokens)this.glContext&&e[1].texture&&this.glContext.deleteTexture(e[1].texture),e[1].texture=void 0;this.glContext=void 0}glContextSet(e,t){this.glContextLost(),this.glContext=e,t=t||[];for(let r=0;r<4;r++){let n=t[r]||e.createTexture();n&&(e.bindTexture(e.TEXTURE_2D,n),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.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),this.videoTextures.push(n))}e.bindTexture(e.TEXTURE_2D,null)}drawFace(e,t,r,n){if(!this.glContext)return;this._faceDraw||(this._faceDraw=new o.FaceDraw(this.glContext));let i=a.mat4.create();a.mat4.multiply(i,e,t),a.mat4.multiply(i,i,r),this._faceDraw.drawFace(i,n)}drawFaceProject(e,t,r,n,a,i){this.glContext&&(this._faceProjectDraw||(this._faceProjectDraw=new s.FaceDrawProject(this.glContext)),this._faceProjectDraw.drawFace(e,t,r,n,a,i))}cameraFrameTexture(){var e;return null===(e=this.getCurrentCameraInfo())||void 0===e?void 0:e.texture}cameraFrameTextureMatrix(e,t,r){let i=this.getCurrentCameraInfo();return i?n.cameraFrameTextureMatrix(i.dataWidth,i.dataHeight,e,t,i.uvTransform,r):a.mat4.create()}cameraFrameUserFacing(){var e;return(null===(e=this.getCurrentCameraInfo())||void 0===e?void 0:e.userFacing)||!1}cameraPoseWithAttitude(e){let t=h(this.getCurrentCameraInfo(),this._client.pipeline_camera_frame_camera_attitude(this._impl));if(e){let e=a.mat4.create();a.mat4.fromScaling(e,[-1,1,1]),a.mat4.multiply(t,e,t),a.mat4.multiply(t,t,e)}return a.mat4.invert(t,t),t}processGL(){var e;if(!this.glContext)return void _.zcerr("no GL context for camera frames - please call pipeline_gl_context_set");if(!this.currentCameraSource)return;if(this.tokensInFlight>0)return void this.currentCameraSource.getFrame(!0);let t=this.currentCameraSource.getFrame(!1);if(!t)return;let r=this.nextCameraToken++;this.cameraTokens.set(r,t);let n={d:t.data,p:this._impl,width:t.dataWidth,height:t.dataHeight,token:r,userFacing:t.userFacing,c2d:t.cameraToDevice,cm:t.cameraModel,t:"cameraFrameC2S"};this._sequenceRecordDeviceAttitudeMatrices||null===(e=this._sequenceRecorder)||void 0===e||e.appendCameraFrame(t),this.tokensInFlight++,this._mgr.postOutgoingMessage(n,[t.data])}motionAccelerometerSubmit(e,t,r,n){var a;this._sequenceRecordDeviceAttitudeMatrices||null===(a=this._sequenceRecorder)||void 0===a||a.appendAccelerometer(e,t,r,n),this._client.pipeline_motion_accelerometer_submit(this._impl,e,t,r,n)}motionRotationRateSubmit(e,t,r,n){var a;this._sequenceRecordDeviceAttitudeMatrices||null===(a=this._sequenceRecorder)||void 0===a||a.appendRotationRate(e,t,r,n),this._client.pipeline_motion_rotation_rate_submit(this._impl,e,t,r,n)}motionAttitudeSubmit(e,t,r,n){var a;this._sequenceRecordDeviceAttitudeMatrices||null===(a=this._sequenceRecorder)||void 0===a||a.appendAttitude(e,t,r,n),this._client.pipeline_motion_attitude_submit(this._impl,e,t,r,n)}motionAttitudeMatrix(e){this._client.pipeline_motion_attitude_matrix_submit(this._impl,e)}uploadGL(){let e=this.getCurrentCameraInfo();null==e||e.cameraSource.uploadGL(e)}}function h(e,t){let r=!1;r=!!e&&e.userFacing;let n=a.mat4.create();return a.mat4.fromRotation(n,i.cameraRotationForScreenOrientation(r)*Math.PI/180,[0,0,1]),a.mat4.multiply(n,n,t),n}t.Pipeline=d,t.applyScreenCounterRotation=h},function(e,t,r){"use strict";e.exports=function(e,t,r,n){try{try{var a;try{a=new window.Blob([e])}catch(t){(a=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),a=a.getBlob()}var i=window.URL||window.webkitURL,o=i.createObjectURL(a),s=new window[t](o,r);return i.revokeObjectURL(o),s}catch(n){return new window[t]("data:application/javascript,".concat(encodeURIComponent(e)),r)}}catch(e){if(!n)throw Error("Inline worker is not supported");return new window[t](n,r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cameraRotationForScreenOrientation=t.projectionMatrix=void 0;const n=r(1);function a(e){if(window.screen.orientation)switch(window.screen.orientation.type){case"portrait-primary":return e?90:270;case"landscape-secondary":return 180;case"portrait-secondary":return e?270:90;default:return 0}else if(void 0!==window.orientation)switch(window.orientation){case 0:return e?90:270;case 90:return 0;case 180:return e?270:90;case-90:return 180}return 0}t.projectionMatrix=function(e,t,r,i=.01,o=100){let s=2*e[2],c=2*e[3],u=n.mat4.create();n.mat4.frustum(u,i*(-.5-e[2])/e[0],i*(s-.5-e[2])/e[0],i*(c-.5-e[3])/e[1],i*(-.5-e[3])/e[1],i,o),u[4]*=-1,u[5]*=-1,u[6]*=-1,u[7]*=-1;let _=n.mat4.create();n.mat4.fromScaling(_,[.5*s,.5*c,1]),n.mat4.multiply(u,_,u),n.mat4.fromRotation(_,a(!1)*Math.PI/180,[0,0,1]),n.mat4.multiply(u,_,u);let f=n.vec3.create();f[0]=s,f[1]=c,f[2]=0,n.vec3.transformMat4(f,f,_);let l=Math.abs(f[0]),d=Math.abs(f[1]),h=1;return h=l/t>d/r?r/d:t/l,n.mat4.fromScaling(_,[h,h,1]),n.mat4.multiply(u,_,u),n.mat4.fromScaling(_,[2/t,2/r,1]),n.mat4.multiply(u,_,u),n.mat4.fromRotation(_,a(!1)*Math.PI/-180,[0,0,1]),n.mat4.multiply(u,u,_),u},t.cameraRotationForScreenOrientation=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.drawPlane=t.disposeDrawPlane=void 0;const n=r(2);let a,i,o,s={};function c(e){if(o)return o;if(o=e.createBuffer(),!o)throw new Error("Unable to create buffer object");return e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,1,1,0]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),o}t.disposeDrawPlane=function(){a=void 0,i=void 0,o=void 0,s={}},t.drawPlane=function(e,t,r,n,a){let o=u(e),_=function(e){if(i)return i;if(i=e.createBuffer(),!i)throw new Error("Unable to create buffer object");return e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-.5,.125,0,-.5,-.125,0,.5,.125,0,.5,-.125,0]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),i}(e),f=c(e);e.disable(e.DEPTH_TEST),e.useProgram(o.prog),e.uniformMatrix4fv(o.unif_proj,!1,t),e.uniformMatrix4fv(o.unif_camera,!1,r),e.uniformMatrix4fv(o.unif_matrix,!1,n),e.bindBuffer(e.ARRAY_BUFFER,_),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,function(e,t){if(s[t])return s[t];let r=e.createTexture();if(!r)throw new Error("Unable to create texture");s[t]=r,e.bindTexture(e.TEXTURE_2D,r);const n=e.RGBA,a=e.RGBA,i=e.UNSIGNED_BYTE,o=new Uint8Array([0,0,255,255]);e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,n,1,1,0,a,i,o);const c=new Image;return c.onload=function(){e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,n,a,i,c),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.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},c.src=t,r}(e,a)),e.uniform1i(o.unif_skinSampler,0),e.vertexAttribPointer(o.attr_position,3,e.FLOAT,!1,12,0),e.enableVertexAttribArray(o.attr_position),e.bindBuffer(e.ARRAY_BUFFER,f),e.vertexAttribPointer(o.attr_textureCoord,2,e.FLOAT,!1,8,0),e.enableVertexAttribArray(o.attr_textureCoord),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.disableVertexAttribArray(o.attr_position),e.bindBuffer(e.ARRAY_BUFFER,null)};function u(e){if(a)return a;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n.compileShader(e,e.VERTEX_SHADER,"\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nuniform mat4 projMatrix;\nuniform mat4 cameraMatrix;\nuniform mat4 modelViewMatrix;\nattribute vec4 position;\nattribute vec2 textureCoord;\n\nvarying highp vec2 vTextureCoord;\n\nvoid main()\n{\n gl_Position = projMatrix * cameraMatrix * modelViewMatrix * position;\n vTextureCoord = textureCoord;\n}"),i=n.compileShader(e,e.FRAGMENT_SHADER,"\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying highp vec2 vTextureCoord;\nuniform sampler2D skinSampler;\n\nvoid main()\n{\n gl_FragColor = texture2D(skinSampler, vTextureCoord);\n}");e.attachShader(t,r),e.attachShader(t,i),n.linkProgram(e,t);let o=e.getUniformLocation(t,"projMatrix");if(!o)throw new Error("Unable to get uniform location projMatrix");let s=e.getUniformLocation(t,"modelViewMatrix");if(!s)throw new Error("Unable to get uniform location modelViewMatrix");let c=e.getUniformLocation(t,"cameraMatrix");if(!c)throw new Error("Unable to get uniform location cameraMatrix");let u=e.getUniformLocation(t,"skinSampler");if(!u)throw new Error("Unable to get uniform location skinSampler");return a={prog:t,unif_matrix:s,unif_proj:o,unif_camera:c,unif_skinSampler:u,attr_position:e.getAttribLocation(t,"position"),attr_textureCoord:e.getAttribLocation(t,"textureCoord")},a}},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{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};let a;Object.defineProperty(t,"__esModule",{value:!0}),t.launchBundleWorker=t.bundleWorkerMessageChannel=void 0,t.bundleWorkerMessageChannel=new MessageChannel,a=r(23),a.default&&(a=a.default),t.launchBundleWorker=function(){return n(this,void 0,void 0,(function*(){let e=new a;e.postMessage({t:"wasm",url:r(24).default}),e.postMessage({t:"port",port:t.bundleWorkerMessageChannel.port2},[t.bundleWorkerMessageChannel.port2])}))}},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){var n;
|
|
2
|
-
/*!@license
|
|
3
|
-
* UAParser.js v0.7.28
|
|
4
|
-
* Lightweight JavaScript-based User-Agent string parser
|
|
5
|
-
* https://github.com/faisalman/ua-parser-js
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
|
|
8
|
-
* Licensed under MIT License
|
|
9
|
-
*/!function(a,i){"use strict";var o="model",s="name",c="type",u="vendor",_="version",f="mobile",l="tablet",d="smarttv",h={extend: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},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e,t){return e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),void 0===t?e:e.substring(0,255)}},m={rgx:function(e,t){for(var r,n,a,i,o,s,c=0;c<t.length&&!o;){var u=t[c],_=t[c+1];for(r=n=0;r<u.length&&!o;)if(o=u[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;c+=2}},str: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.has(t[r][n],e))return"?"===r?void 0:r}else if(h.has(t[r],e))return"?"===r?void 0:r;return e}},p={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{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"}}}},v={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_,[s,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[s,_],[/opios[\/\s]+([\w\.]+)/i],[_,[s,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[_,[s,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[s,_],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[_,[s,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[_,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[_,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[_,[s,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[_,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[_,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],_],[/focus\/([\w\.]+)/i],[_,[s,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[_,[s,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[_,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[_,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[_,[s,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[_,[s,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[_,[s,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],_],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],_],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[s,_],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[s],[/;fbav\/([\w\.]+);/i],[_,[s,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[s,_],[/\bgsa\/([\w\.]+)\s.*safari\//i],[_,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[_,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],_],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[_,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,_],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[_,[s,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[_,s],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[_,m.str,p.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,_],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],_],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[_,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,_]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",h.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",h.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",h.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[o,[u,"Samsung"],[c,l]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[o,[u,"Samsung"],[c,f]],[/\((ip(?:hone|od)[\s\w]*);/i],[o,[u,"Apple"],[c,f]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[u,"Apple"],[c,l]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[o,[u,"Huawei"],[c,l]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[o,[u,"Huawei"],[c,f]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[o,/_/g," "],[u,"Xiaomi"],[c,f]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[o,/_/g," "],[u,"Xiaomi"],[c,l]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[o,[u,"OPPO"],[c,f]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[o,[u,"Vivo"],[c,f]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[o,[u,"Realme"],[c,f]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[o,[u,"Motorola"],[c,f]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[o,[u,"Motorola"],[c,l]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[o,[u,"LG"],[c,l]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[o,[u,"LG"],[c,f]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[o,[u,"Lenovo"],[c,l]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[o,/_/g," "],[u,"Nokia"],[c,f]],[/droid.+;\s(pixel\sc)[\s)]/i],[o,[u,"Google"],[c,l]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[o,[u,"Google"],[c,f]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[u,"Sony"],[c,f]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[o,"Xperia Tablet"],[u,"Sony"],[c,l]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[o,[u,"OnePlus"],[c,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[o,[u,"Amazon"],[c,l]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[o,"Fire Phone"],[u,"Amazon"],[c,f]],[/\((playbook);[\w\s\),;-]+(rim)/i],[o,u,[c,l]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[o,[u,"BlackBerry"],[c,f]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[o,[u,"ASUS"],[c,l]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[o,[u,"ASUS"],[c,f]],[/(nexus\s9)/i],[o,[u,"HTC"],[c,l]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[u,[o,/_/g," "],[c,f]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[o,[u,"Acer"],[c,l]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[o,[u,"Meizu"],[c,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[u,o,[c,f]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[u,o,[c,l]],[/\s(surface\sduo)\s/i],[o,[u,"Microsoft"],[c,l]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[o,[u,"Fairphone"],[c,f]],[/\s(u304aa)\sbuild/i],[o,[u,"AT&T"],[c,f]],[/sie-(\w*)/i],[o,[u,"Siemens"],[c,f]],[/[;\/]\s?(rct\w+)\sbuild/i],[o,[u,"RCA"],[c,l]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[o,[u,"Dell"],[c,l]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[o,[u,"Verizon"],[c,l]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[o,[u,"Barnes & Noble"],[c,l]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[o,[u,"NuVision"],[c,l]],[/;\s(k88)\sbuild/i],[o,[u,"ZTE"],[c,l]],[/;\s(nx\d{3}j)\sbuild/i],[o,[u,"ZTE"],[c,f]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[o,[u,"Swiss"],[c,f]],[/[;\/]\s?(zur\d{3})\sbuild/i],[o,[u,"Swiss"],[c,l]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[o,[u,"Zeki"],[c,l]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[u,"Dragon Touch"],o,[c,l]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[o,[u,"Insignia"],[c,l]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[o,[u,"NextBook"],[c,l]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[u,"Voice"],o,[c,f]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[u,"LvTel"],o,[c,f]],[/;\s(ph-1)\s/i],[o,[u,"Essential"],[c,f]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[o,[u,"Envizen"],[c,l]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[o,[u,"MachSpeed"],[c,l]],[/[;\/]\s?tu_(1491)\sbuild/i],[o,[u,"Rotor"],[c,l]],[/(shield[\w\s]+)\sbuild/i],[o,[u,"Nvidia"],[c,l]],[/(sprint)\s(\w+)/i],[u,o,[c,f]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[u,"Microsoft"],[c,f]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[u,"Zebra"],[c,l]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[u,"Zebra"],[c,f]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[u,o,[c,"console"]],[/droid.+;\s(shield)\sbuild/i],[o,[u,"Nvidia"],[c,"console"]],[/(playstation\s[345portablevi]+)/i],[o,[u,"Sony"],[c,"console"]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[o,[u,"Microsoft"],[c,"console"]],[/smart-tv.+(samsung)/i],[u,[c,d]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[u,"Samsung"],[c,d]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[u,"LG"],[c,d]],[/(apple)\s?tv/i],[u,[o,"Apple TV"],[c,d]],[/crkey/i],[[o,"Chromecast"],[u,"Google"],[c,d]],[/droid.+aft([\w])(\sbuild\/|\))/i],[o,[u,"Amazon"],[c,d]],[/\(dtv[\);].+(aquos)/i],[o,[u,"Sharp"],[c,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[u,h.trim],[o,h.trim],[c,d]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[c,d]],[/((pebble))app\/[\d\.]+\s/i],[u,o,[c,"wearable"]],[/droid.+;\s(glass)\s\d/i],[o,[u,"Google"],[c,"wearable"]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[o,[u,"Zebra"],[c,"wearable"]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[u,[c,"embedded"]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[o,[c,f]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[o,[c,l]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[c,h.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[o,[u,"Generic"]],[/(phone)/i],[[c,f]]],engine:[[/windows.+\sedge\/([\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)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,_],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,_],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[s,[_,m.str,p.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[_,m.str,p.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[_,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[s,"Mac OS"],[_,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[s,_],[/\(bb(10);/i],[_,[s,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[_,[s,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[_,[s,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],_],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[s,_],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],_],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[s,_]]},g=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof g))return new g(e,t).getResult();var r=e||(void 0!==a&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),n=t?h.extend(v,t):v;return this.getBrowser=function(){var e={name:void 0,version:void 0};return m.rgx.call(e,r,n.browser),e.major=h.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return m.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return m.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return m.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return m.rgx.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?h.trim(e,255):e,this},this.setUA(r),this};g.VERSION="0.7.28",g.BROWSER={NAME:s,MAJOR:"major",VERSION:_},g.CPU={ARCHITECTURE:"architecture"},g.DEVICE={MODEL:o,VENDOR:u,TYPE:c,CONSOLE:"console",MOBILE:f,SMARTTV:d,TABLET:l,WEARABLE:"wearable",EMBEDDED:"embedded"},g.ENGINE={NAME:s,VERSION:_},g.OS={NAME:s,VERSION:_},void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=g),t.UAParser=g):void 0===(n=function(){return g}.call(t,r,t,e))||(e.exports=n);var b=void 0!==a&&(a.jQuery||a.Zepto);if(b&&!b.ua){var w=new g;b.ua=w.getResult(),b.ua.get=function(){return w.getUA()},b.ua.set=function(e){w.setUA(e);var t=w.getResult();for(var r in t)b.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log_level_t=t.instant_world_tracker_transform_orientation_t=t.face_landmark_name_t=t.barcode_format_t=void 0;var n=r(3);Object.defineProperty(t,"barcode_format_t",{enumerable:!0,get:function(){return n.barcode_format_t}});var a=r(3);Object.defineProperty(t,"face_landmark_name_t",{enumerable:!0,get:function(){return a.face_landmark_name_t}});var i=r(3);Object.defineProperty(t,"instant_world_tracker_transform_orientation_t",{enumerable:!0,get:function(){return i.instant_world_tracker_transform_orientation_t}});var o=r(3);Object.defineProperty(t,"log_level_t",{enumerable:!0,get:function(){return o.log_level_t}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceDecoder=t.SequenceRecorder=t.SequenceRecorderPacketType=void 0;const n=r(0);var a;!function(e){e[e.CAMERA_FRAME=0]="CAMERA_FRAME",e[e.ACCELEROMETER=1]="ACCELEROMETER",e[e.ROTATION_RATE=2]="ROTATION_RATE",e[e.ATTITUDE=3]="ATTITUDE",e[e.ATTITUDE_MATRIX=4]="ATTITUDE_MATRIX"}(a=t.SequenceRecorderPacketType||(t.SequenceRecorderPacketType={}));class i{constructor(e){this._insertionByte=0,this._numberPackets=0,this._started=!1,this._data=new ArrayBuffer(this._estimatedSize(e,320,240)),this._dataView=new DataView(this._data),this._dataUint8=new Uint8Array(this._data),this._dataFloat32=new Float32Array(this._data)}_estimatedSize(e,t,r){return i.headerSizeBytes+(i.psbPacketType+i.cameraPacketSizeBytes+t*r)*e}start(){this._started=!0,this._insertionByte=0,this._numberPackets=0,this._growArrayBuffer(i.headerSizeBytes);let e=(new TextEncoder).encode("UAR1");this._dataUint8.set(e),this._dataView.setUint32(4,0,!0),this._insertionByte+=8}stop(){this._started=!1;let e=this._data.slice(0,this._insertionByte);this._data=e}data(){return this._dataUint8}appendCameraFrame(e){if(!this._started)return;if(e.data.byteLength!==e.dataWidth*e.dataHeight)return void n.zcerr("Unable to record frame to sequence: greyscale array doesn't match dimensions");let t=i.psbPacketType+i.cameraPacketSizeBytes+e.dataWidth*e.dataHeight;this._growArrayBuffer(t),this._dataView.setUint32(this._insertionByte,a.CAMERA_FRAME,!0),this._insertionByte+=i.psbPacketType,this._dataView.setUint32(this._insertionByte,e.dataWidth,!0),this._insertionByte+=i.psbCameraFrameWidth,this._dataView.setUint32(this._insertionByte,e.dataHeight,!0),this._insertionByte+=i.psbCameraFrameHeight,this._dataFloat32.set(e.cameraToDevice,this._insertionByte/4),this._insertionByte+=i.psbCameraToDeviceTransform,this._dataFloat32.set(e.cameraModel,this._insertionByte/4),this._insertionByte+=i.psbCameraModel,this._dataView.setUint32(this._insertionByte,e.userFacing?1:0,!0),this._insertionByte+=i.psbFlags,this._dataUint8.set(new Uint8Array(e.data),this._insertionByte),this._insertionByte+=e.data.byteLength,this._numberPackets++,this._dataView.setUint32(4,this._numberPackets,!0)}appendAccelerometer(e,t,r,n){this._appendTimestampedVec3(a.ACCELEROMETER,e,t,r,n)}appendRotationRate(e,t,r,n){this._appendTimestampedVec3(a.ROTATION_RATE,e,t,r,n)}appendAttitude(e,t,r,n){this._appendTimestampedVec3(a.ATTITUDE,e,t,r,n)}_appendTimestampedVec3(e,t,r,n,a){if(!this._started)return;let o=i.psbPacketType+i.accelerometerPacketSizeBytes;this._growArrayBuffer(o),this._dataView.setUint32(this._insertionByte,e,!0),this._insertionByte+=i.psbPacketType,this._dataView.setUint32(this._insertionByte,t,!0),this._insertionByte+=4,this._dataView.setFloat32(this._insertionByte,r,!0),this._insertionByte+=4,this._dataView.setFloat32(this._insertionByte,n,!0),this._insertionByte+=4,this._dataView.setFloat32(this._insertionByte,a,!0),this._insertionByte+=4,this._numberPackets++,this._dataView.setUint32(4,this._numberPackets,!0)}appendAttitudeMatrix(e){if(!this._started)return;let t=i.psbPacketType+i.attitudeMatrixPacketSizeBytes;this._growArrayBuffer(t),this._dataView.setUint32(this._insertionByte,a.ATTITUDE_MATRIX,!0),this._insertionByte+=i.psbPacketType,this._dataFloat32.set(e,this._insertionByte/4),this._insertionByte+=i.attitudeMatrixPacketSizeBytes,this._numberPackets++,this._dataView.setUint32(4,this._numberPackets,!0)}_growArrayBuffer(e){for(;this._insertionByte+e>this._data.byteLength;){let e=Math.max(2*this._data.byteLength,this._estimatedSize(50,320,240)),t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this._dataUint8),this._data=t,this._dataUint8=r,this._dataFloat32=new Float32Array(this._data),this._dataView=new DataView(this._data)}}}t.SequenceRecorder=i,i.headerSizeBytes=8,i.psbPacketType=4,i.psbCameraFrameWidth=4,i.psbCameraFrameHeight=4,i.psbFlags=4,i.psbCameraToDeviceTransform=64,i.psbCameraModel=24,i.cameraPacketSizeBytes=i.psbCameraFrameWidth+i.psbCameraFrameHeight+i.psbCameraToDeviceTransform+i.psbCameraModel+i.psbFlags,i.accelerometerPacketSizeBytes=16,i.rotationRatePacketSizeBytes=16,i.attitudePacketSizeBytes=16,i.attitudeMatrixPacketSizeBytes=64;t.SequenceDecoder=class{constructor(e){this._data=e,this.dataByPacket=new Map,this.dataByCameraFrame=new Map,this.numberPackets=0,this.numberCameraFrames=0,this.numberAccelerometerPackets=0,this.numberRotationRatePackets=0,this.numberAttitudePackets=0,this.numberAttitudeMatrixPackets=0;let t=new TextDecoder,r="";try{r=t.decode(this._data.slice(0,4))}catch(e){throw new Error("Unable to decode header - perhaps this isn't a sequence file?")}if("UAR1"!==r)throw new Error("Invalid - perhaps this isn't a sequence file: "+r);let n=0,o=new DataView(this._data);this.numberPackets=o.getUint32(4,!0),n+=i.headerSizeBytes;for(let e=0;e<this.numberPackets;e++){let t=o.getUint32(n,!0);switch(n+=i.psbPacketType,t){case a.CAMERA_FRAME:{let t=o.getUint32(n,!0);n+=i.psbCameraFrameWidth;let r=o.getUint32(n,!0);n+=i.psbCameraFrameHeight;let s=new Float32Array(this._data,n,i.psbCameraToDeviceTransform/4);n+=i.psbCameraToDeviceTransform;let c=new Float32Array(this._data,n,i.psbCameraModel/4);n+=i.psbCameraModel;let u=o.getUint32(n,!0);n+=i.psbFlags;let _=1===u,f=new Uint8Array(this._data,n,t*r);n+=t*r;let l={type:a.CAMERA_FRAME,width:t,height:r,cameraToDevice:s,cameraModel:c,userFacing:_,greyscale:f};this.dataByPacket.set(e,l),this.dataByCameraFrame.set(this.numberCameraFrames,l),this.numberCameraFrames++;break}case a.ACCELEROMETER:{let t=o.getUint32(n,!0);n+=4;let r=o.getFloat32(n,!0);n+=4;let i=o.getFloat32(n,!0);n+=4;let s=o.getFloat32(n,!0);n+=4,this.dataByPacket.set(e,{type:a.ACCELEROMETER,t:t,x:r,y:i,z:s}),this.numberAccelerometerPackets++;break}case a.ROTATION_RATE:{let t=o.getUint32(n,!0);n+=4;let r=o.getFloat32(n,!0);n+=4;let i=o.getFloat32(n,!0);n+=4;let s=o.getFloat32(n,!0);n+=4,this.dataByPacket.set(e,{type:a.ROTATION_RATE,t:t,x:r,y:i,z:s}),this.numberRotationRatePackets++;break}case a.ATTITUDE:{let t=o.getUint32(n,!0);n+=4;let r=o.getFloat32(n,!0);n+=4;let i=o.getFloat32(n,!0);n+=4;let s=o.getFloat32(n,!0);n+=4,this.dataByPacket.set(e,{type:a.ATTITUDE,t:t,x:r,y:i,z:s}),this.numberAttitudePackets++;break}case a.ATTITUDE_MATRIX:{let t=new Float32Array(this._data,n,i.attitudeMatrixPacketSizeBytes/4);n+=i.attitudeMatrixPacketSizeBytes,this.dataByPacket.set(e,{type:a.ATTITUDE_MATRIX,attitude:t}),this.numberAttitudeMatrixPackets++;break}}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLElementSource=void 0;const n=r(4),a=r(14),i=r(15),o=r(2),s=r(1),c=r(0);let u=1,_=new Map;class f extends a.Source{constructor(e,t){super(),this._video=e,this._pipeline=t,this._isPaused=!0,this._hadFrames=!1,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._isUploadFrame=!0,this._computedTransformRotation=-1,this._computedFrontCameraRotation=!1,this._cameraUvTransform=s.mat4.create(),this._cameraToDeviceTransform=s.mat4.create(),this._cameraToDeviceTransformUserFacing=s.mat4.create(),this._cameraModel=new Float32Array([300,300,160,120,0,0]),this._framebufferWidth=0,this._framebufferHeight=0,this._framebufferId=null,this._renderTexture=null,s.mat4.fromScaling(this._cameraToDeviceTransformUserFacing,[-1,1,-1]);let r=this._video;this._video instanceof HTMLVideoElement?r.addEventListener("loadedmetadata",()=>{this._hadFrames=!0}):this._hadFrames=!0,this._resetGLContext=this._resetGLContext.bind(this);let a=n.Pipeline.get(this._pipeline);a&&a.onGLContextReset.bind(this._resetGLContext)}static createVideoElementSource(e,t){let r=u++;return _.set(r,new f(t,e)),c.zcout("html_element_source_t initialized"),r}static getVideoElementSource(e){return _.get(e)}_resetGLContext(){this._currentVideoTexture=void 0,this._framebufferId=null,this._renderTexture=null,this._vertexBuffer=void 0,this._indexBuffer=void 0,this._greyscaleShader=void 0}destroy(){let e=n.Pipeline.get(this._pipeline);e&&e.onGLContextReset.unbind(this._resetGLContext),this.pause(),this._resetGLContext()}pause(){this._isPaused=!0;let e=n.Pipeline.get(this._pipeline);e&&e.currentCameraSource===this&&(e.currentCameraSource=void 0)}start(){var e;this._isPaused&&(this._isUploadFrame=!0,this._video instanceof HTMLVideoElement&&(this._hadFrames=!1)),this._isPaused=!1;let t=n.Pipeline.get(this._pipeline);t&&t.currentCameraSource!==this&&(null===(e=t.currentCameraSource)||void 0===e||e.pause(),t.currentCameraSource=this)}getFrame(e){let t=n.Pipeline.get(this._pipeline);if(!t)return;let r=t.glContext;if(r&&!this._isPaused&&this._hadFrames)try{return this._processFrame(r,this._cameraToScreenRotation,e)}catch(e){console.log("Unable to process frame")}}_processFrame(e,t,r){let a=n.Pipeline.get(this._pipeline);if(a){if(this._isUploadFrame)return this._currentVideoTexture||(this._currentVideoTexture=a.getVideoTexture()),this._uploadFrame(t,this._isUserFacing),void(this._isUploadFrame=!this._isUploadFrame);if(!r)return this._isUploadFrame=!this._isUploadFrame,this._readFrame(a,e)}}_uploadFrame(e,t){if(!this._currentVideoTexture)return;let r=n.Pipeline.get(this._pipeline);if(!r)return;let a=r.glContext;if(!a)return;a.disable(a.SCISSOR_TEST),a.disable(a.DEPTH_TEST),a.disable(a.BLEND),a.disable(a.CULL_FACE),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,this._currentVideoTexture);const o=a.RGBA,s=a.RGBA,c=a.UNSIGNED_BYTE;a.texImage2D(a.TEXTURE_2D,0,o,s,c,this._video);let u=0,_=0;this._video instanceof HTMLVideoElement?(u=this._video.videoWidth,_=this._video.videoHeight):(u=this._video.width,_=this._video.height),_>u&&(_=[u,u=_][0]),this._updateTransforms(e,t);let f=this._getFramebuffer(a,i.profile.dataWidth/4,i.profile.dataHeight),l=this._getVertexBuffer(a),d=this._getIndexBuffer(a),h=this._getGreyscaleShader(a);a.bindFramebuffer(a.FRAMEBUFFER,f),a.viewport(0,0,this._framebufferWidth,this._framebufferHeight),a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT),a.bindBuffer(a.ARRAY_BUFFER,l),a.vertexAttribPointer(h.aVertexPositionLoc,2,a.FLOAT,!1,16,0),a.enableVertexAttribArray(h.aVertexPositionLoc),a.vertexAttribPointer(h.aTextureCoordLoc,2,a.FLOAT,!1,16,8),a.enableVertexAttribArray(h.aTextureCoordLoc),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,d),a.useProgram(h.program),a.uniform1f(h.uTexWidthLoc,i.profile.dataWidth),a.uniformMatrix4fv(h.uUvTransformLoc,!1,this._cameraUvTransform),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,this._currentVideoTexture),a.uniform1i(h.uSamplerLoc,0),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0),a.disableVertexAttribArray(h.aVertexPositionLoc),a.disableVertexAttribArray(h.aTextureCoordLoc),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindBuffer(a.ARRAY_BUFFER,null),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null),a.useProgram(null),a.bindTexture(a.TEXTURE_2D,null)}_readFrame(e,t){if(!this._currentVideoTexture)throw new Error("No video texture");let r=this._currentVideoTexture;this._currentVideoTexture=void 0;let n=i.profile.dataWidth*i.profile.dataHeight,a=e.cameraPixelArrays.pop();for(;a&&a.byteLength!==n;)a=e.cameraPixelArrays.pop();a||(a=new ArrayBuffer(n));let o=new Uint8Array(a),s=this._getFramebuffer(t,i.profile.dataWidth/4,i.profile.dataHeight);t.bindFramebuffer(t.FRAMEBUFFER,s),t.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,t.RGBA,t.UNSIGNED_BYTE,o),t.bindFramebuffer(t.FRAMEBUFFER,null);let c=300*i.profile.dataWidth/320;return this._cameraModel[0]=c,this._cameraModel[1]=c,this._cameraModel[2]=.5*i.profile.dataWidth,this._cameraModel[3]=.5*i.profile.dataHeight,{uvTransform:this._cameraUvTransform,data:a,texture:r,cameraModel:this._cameraModel,dataWidth:i.profile.dataWidth,dataHeight:i.profile.dataHeight,userFacing:this._computedFrontCameraRotation,cameraToDevice:this._computedFrontCameraRotation?this._cameraToDeviceTransformUserFacing:this._cameraToDeviceTransform,cameraSource:this}}_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=o.compileShader(e,e.VERTEX_SHADER,l),n=o.compileShader(e,e.FRAGMENT_SHADER,d);e.attachShader(t,r),e.attachShader(t,n),o.linkProgram(e,t);let a=e.getUniformLocation(t,"uTexWidth");if(!a)throw new Error("Unable to get uniform location uTexWidth");let i=e.getUniformLocation(t,"uUvTransform");if(!i)throw new Error("Unable to get uniform location uUvTransform");let s=e.getUniformLocation(t,"uSampler");if(!s)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:i,uSamplerLoc:s},this._greyscaleShader}uploadGL(){}}t.HTMLElementSource=f;let l="\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",d="\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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0;t.Source=class{}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.profile=t.EmbeddedVideoImplementation=void 0;const n=r(10);!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},window.zeeProfile=t.profile;let a=new n.UAParser;switch(a.getBrowser().name){case"Safari":if(t.profile.deviceMotionMutliplier=1,void 0===window.orientation)break;t.profile.videoElementInDOM=!0,t.profile.showSafariPermissionsResetIfNecessary=!0;break;case"Chrome":let e=a.getEngine();if(!e||"WebKit"!==e.name)break;case"Mobile Safari":t.profile.deviceMotionMutliplier=1;let r=a.getOS().version;if(r){let e=r.split(".");if(e.length>=2){const r=parseInt(e[0]),n=parseInt(e[1]);(r<11||11===r&&n<3)&&(t.profile.blacklisted=!0),(r<12||12===r&&n<2)&&(t.profile.videoElementInDOM=!0),(12===r&&n>=2||r>=13)&&(t.profile.showGyroPermissionsWarningIfNecessary=!0),r>=13&&(t.profile.showSafariPermissionsResetIfNecessary=!0),(r>=12&&n>1||r>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(t.profile.requestHighFrameRate=!0,t.profile.videoHeight=360,t.profile.dataHeight=180)}}}},function(e,t,r){"use strict";r.r(t),t.default=r.p+"b4f46e148a3b3b5aef90717d8d60e3fc.zbin"},function(e,t,r){"use strict";if(Object.defineProperty(t,"__esModule",{value:!0}),t.log_level_t=t.instant_world_tracker_transform_orientation_t=t.face_landmark_name_t=t.barcode_format_t=t.initialize=void 0,document.currentScript){const e=new URL(document.currentScript.src);let t=e.toString();if(e.pathname){let e=t.split("/");e.pop(),t=e.join("/")+"/"}r.p=t}const n=r(18),a=r(40);t.initialize=function(){return console.log("Zappar CV v"+a.VERSION),n.initialize()};var i=r(11);Object.defineProperty(t,"barcode_format_t",{enumerable:!0,get:function(){return i.barcode_format_t}}),Object.defineProperty(t,"face_landmark_name_t",{enumerable:!0,get:function(){return i.face_landmark_name_t}}),Object.defineProperty(t,"instant_world_tracker_transform_orientation_t",{enumerable:!0,get:function(){return i.instant_world_tracker_transform_orientation_t}}),Object.defineProperty(t,"log_level_t",{enumerable:!0,get:function(){return i.log_level_t}})},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{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=void 0;const a=r(19),i=r(7),o=r(6),s=r(1),c=r(22),u=r(28),_=r(29),f=r(4),l=r(33),d=r(13),h=r(34),m=r(36),p=r(0),v=r(8),g=r(37);let b;t.initialize=function(){if(b)return b;c.launchWorker(),v.launchBundleWorker();let e=new a.zappar_client(e=>{c.messageManager.postOutgoingMessage({t:"zappar",d:e},[e])});if(window.location.hostname.toLowerCase().indexOf(".zappar.io")>0){let t=window.location.pathname.split("/");t.length>1&&t[1].length>0&&e.impl.analytics_project_id_set(".wiz"+t[1])}return c.messageManager.onIncomingMessage.bind(t=>{var r,n;switch(t.t){case"zappar":null===(r=f.Pipeline.get(t.p))||void 0===r||r.pendingMessages.push(t.d);break;case"buf":e.serializer.bufferReturn(t.d);break;case"cameraFrameRecycleS2C":let a=t;null===(n=f.Pipeline.get(a.p))||void 0===n||n.cameraTokenReturn(a);break;case"licerr":{let e=document.createElement("div");e.innerHTML="Visit <a href='https://docs.zap.works/universal-ar/licensing/' style='color: white;'>our licensing page</a> to find out about hosting on your own domain.",e.style.position="absolute",e.style.bottom="20px",e.style.width="80%",e.style.backgroundColor="black",e.style.color="white",e.style.borderRadius="10px",e.style.padding="10px",e.style.fontFamily="sans-serif",e.style.textAlign="center",e.style.left="10%",e.style.zIndex=Number.MAX_SAFE_INTEGER.toString();let t=document.createElement("span");t.innerText=" (30)",e.append(t);let r=30;setInterval((function(){r--,r>=0&&(t.innerText=" ("+r.toString()+")")}),1e3),document.body.append(e)}}}),b=Object.assign(Object.assign({},e.impl),{camera_default_device_id:e=>e?l.CameraSource.USER_DEFAULT_DEVICE_ID:l.CameraSource.DEFAULT_DEVICE_ID,camera_source_create:(e,t)=>l.CameraSource.create(e,t),camera_source_destroy:e=>{var t;return null===(t=l.CameraSource.get(e))||void 0===t?void 0:t.destroy()},camera_source_pause:e=>{var t;return null===(t=l.CameraSource.get(e))||void 0===t?void 0:t.pause()},camera_source_start:e=>{var t;return null===(t=l.CameraSource.get(e))||void 0===t?void 0:t.start()},pipeline_create:()=>f.Pipeline.create(e.impl,c.messageManager),pipeline_frame_update:t=>{var r;return null===(r=f.Pipeline.get(t))||void 0===r?void 0:r.frameUpdate(e)},pipeline_camera_frame_draw_gl:(e,t,r,n)=>{var a;null===(a=f.Pipeline.get(e))||void 0===a||a.cameraFrameDrawGL(t,r,n)},draw_plane:(e,t,r,n,a)=>{i.drawPlane(e,t,r,n,a)},pipeline_draw_face:(e,t,r,n,a)=>{var i;let o=_.getFaceMesh(a);if(!o)return p.zcwarn("attempting to call draw_face on a destroyed zappar_face_mesh_t"),new Uint16Array;null===(i=f.Pipeline.get(e))||void 0===i||i.drawFace(t,r,n,o)},pipeline_draw_face_project:(e,t,r,n,a,i,o)=>{var s;null===(s=f.Pipeline.get(e))||void 0===s||s.drawFaceProject(t,r,n,a,i,o)},projection_matrix_from_camera_model:o.projectionMatrix,projection_matrix_from_camera_model_ext:o.projectionMatrix,pipeline_process_gl:e=>{var t;return null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.processGL()},pipeline_gl_context_set:(e,t,r)=>{var n;return null===(n=f.Pipeline.get(e))||void 0===n?void 0:n.glContextSet(t,r)},pipeline_gl_context_lost:e=>{var t;return null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.glContextLost()},pipeline_camera_frame_upload_gl:e=>{var t;return null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.uploadGL()},pipeline_camera_frame_texture_gl:e=>{var t;return null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.cameraFrameTexture()},pipeline_camera_frame_texture_matrix:(e,t,r,n)=>{var a;return(null===(a=f.Pipeline.get(e))||void 0===a?void 0:a.cameraFrameTextureMatrix(t,r,n))||s.mat4.create()},pipeline_camera_frame_user_facing:e=>{var t;return(null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.cameraFrameUserFacing())||!1},pipeline_camera_pose_default:()=>s.mat4.create(),pipeline_camera_pose_with_attitude:(e,t)=>{var r;return(null===(r=f.Pipeline.get(e))||void 0===r?void 0:r.cameraPoseWithAttitude(t))||s.mat4.create()},pipeline_camera_pose_with_origin:(e,t)=>{let r=s.mat4.create();return s.mat4.invert(r,t),r},pipeline_sequence_record_clear:e=>{var t;return null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.sequenceRecordClear()},pipeline_sequence_record_start:(e,t)=>{var r;return null===(r=f.Pipeline.get(e))||void 0===r?void 0:r.sequenceRecordStart(t)},pipeline_sequence_record_stop:e=>{var t;return null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.sequenceRecordStop()},pipeline_sequence_record_device_attitude_matrices_set:(e,t)=>{var r;return null===(r=f.Pipeline.get(e))||void 0===r?void 0:r.sequenceRecordDeviceAttitudeMatrices(t)},pipeline_sequence_record_data:e=>{var t;return(null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.sequenceRecordData())||new Uint8Array(0)},pipeline_sequence_record_data_size:e=>{var t;return(null===(t=f.Pipeline.get(e))||void 0===t?void 0:t.sequenceRecordData().byteLength)||0},instant_world_tracker_anchor_pose_camera_relative:(t,r)=>{let n=f.applyScreenCounterRotation(void 0,e.impl.instant_world_tracker_anchor_pose_raw(t));if(r){let e=s.mat4.create();s.mat4.fromScaling(e,[-1,1,1]),s.mat4.multiply(n,e,n),s.mat4.multiply(n,n,e)}return n},instant_world_tracker_anchor_pose:(t,r,n)=>{let a=f.applyScreenCounterRotation(void 0,e.impl.instant_world_tracker_anchor_pose_raw(t));if(n){let e=s.mat4.create();s.mat4.fromScaling(e,[-1,1,1]),s.mat4.multiply(a,e,a),s.mat4.multiply(a,a,e)}return s.mat4.multiply(a,r,a),a},instant_world_tracker_anchor_pose_set_from_camera_offset:(t,r,n,a,i)=>{let c=o.cameraRotationForScreenOrientation(!1)*Math.PI/180,u=s.mat4.create();s.mat4.fromRotation(u,-c,[0,0,1]);let _=s.vec3.create();s.vec3.transformMat4(_,[r,n,a],u),e.impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(t,_[0],_[1],_[2],i)},image_tracker_anchor_pose_camera_relative:(t,r,n)=>{let a=f.applyScreenCounterRotation(void 0,e.impl.image_tracker_anchor_pose_raw(t,r));if(n){let e=s.mat4.create();s.mat4.fromScaling(e,[-1,1,1]),s.mat4.multiply(a,e,a),s.mat4.multiply(a,a,e)}return a},image_tracker_anchor_pose:(t,r,n,a)=>{let i=f.applyScreenCounterRotation(void 0,e.impl.image_tracker_anchor_pose_raw(t,r));if(a){let e=s.mat4.create();s.mat4.fromScaling(e,[-1,1,1]),s.mat4.multiply(i,e,i),s.mat4.multiply(i,i,e)}return s.mat4.multiply(i,n,i),i},face_tracker_anchor_pose_camera_relative:(t,r,n)=>{let a=f.applyScreenCounterRotation(void 0,e.impl.face_tracker_anchor_pose_raw(t,r));if(n){let e=s.mat4.create();s.mat4.fromScaling(e,[-1,1,1]),s.mat4.multiply(a,e,a),s.mat4.multiply(a,a,e)}return a},face_tracker_anchor_pose:(t,r,n,a)=>{let i=f.applyScreenCounterRotation(void 0,e.impl.face_tracker_anchor_pose_raw(t,r));if(a){let e=s.mat4.create();s.mat4.fromScaling(e,[-1,1,1]),s.mat4.multiply(i,e,i),s.mat4.multiply(i,i,e)}return s.mat4.multiply(i,n,i),i},face_tracker_model_load_default:e=>n(this,void 0,void 0,(function*(){yield function(e){return n(this,void 0,void 0,(function*(){let t=r(39);void 0!==t.default&&(t=t.default);let n=yield fetch(t),a=yield n.arrayBuffer();null==b||b.face_tracker_model_load_from_memory(e,a)}))}(e)})),face_mesh_create:()=>_.createFaceMesh(),face_mesh_destroy:e=>{_.destroyFaceMesh(e)},face_mesh_indices:e=>{let t=_.getFaceMesh(e);return t?t.getIndices():(p.zcwarn("attempting to call face_mesh_indices on a destroyed zappar_face_mesh_t"),new Uint16Array)},face_mesh_indices_size:e=>{let t=_.getFaceMesh(e);return t?t.getIndices().length:(p.zcwarn("attempting to call face_mesh_indices_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_uvs:e=>{let t=_.getFaceMesh(e);return t?t.getUVs():(p.zcwarn("attempting to call face_mesh_uvs on a destroyed zappar_face_mesh_t"),new Float32Array)},face_mesh_uvs_size:e=>{let t=_.getFaceMesh(e);return t?t.getUVs().length:(p.zcwarn("attempting to call face_mesh_uvs_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_vertices:e=>{let t=_.getFaceMesh(e);return t?t.getVertices():(p.zcwarn("attempting to call face_mesh_vertices on a destroyed zappar_face_mesh_t"),new Float32Array)},face_mesh_vertices_size:e=>{let t=_.getFaceMesh(e);return t?t.getVertices().length:(p.zcwarn("attempting to call face_mesh_vertices_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_normals:e=>{let t=_.getFaceMesh(e);return t?t.getNormals():(p.zcwarn("attempting to call face_mesh_normals on a destroyed zappar_face_mesh_t"),new Float32Array)},face_mesh_normals_size:e=>{let t=_.getFaceMesh(e);return t?t.getNormals().length:(p.zcwarn("attempting to call face_mesh_normals_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_load_from_memory:(e,t,r,n,a,i)=>{let o=_.getFaceMesh(e);o?o.loadFromMemory(t,r,n,a,i):p.zcwarn("attempting to call face_mesh_load_from_memory on a destroyed zappar_face_mesh_t")},face_mesh_update:(e,t,r,n)=>{let a=_.getFaceMesh(e);a?a.update(t,r,n):p.zcwarn("attempting to call face_mesh_update on a destroyed zappar_face_mesh_t")},face_mesh_load_default:e=>n(this,void 0,void 0,(function*(){let t=_.getFaceMesh(e);if(!t)return void p.zcwarn("attempting to call face_mesh_load_default on a destroyed zappar_face_mesh_t");let n=r(16);void 0!==n.default&&(n=n.default);let a=yield fetch(n);t.loadFromMemory(yield a.arrayBuffer(),!1,!1,!1,!1)})),face_mesh_load_default_face:(e,t,a,i)=>n(this,void 0,void 0,(function*(){let n=_.getFaceMesh(e);if(!n)return void p.zcwarn("attempting to call face_mesh_load_default_face on a destroyed zappar_face_mesh_t");let o=r(16);void 0!==o.default&&(o=o.default);let s=yield fetch(o);n.loadFromMemory(yield s.arrayBuffer(),t,a,i,!1)})),face_mesh_load_default_full_head_simplified:(e,t,a,i,o)=>n(this,void 0,void 0,(function*(){let n=_.getFaceMesh(e);if(!n)return void p.zcwarn("attempting to call face_mesh_load_default_full_head_simplified on a destroyed zappar_face_mesh_t");let s=r(38);void 0!==s.default&&(s=s.default);let c=yield fetch(s);n.loadFromMemory(yield c.arrayBuffer(),t,a,i,o)})),face_mesh_loaded_version:e=>{let t=_.getFaceMesh(e);return t?t.getModelVersion():(p.zcwarn("attempting to call face_mesh_load_default on a destroyed zappar_face_mesh_t"),-1)},face_landmark_create:e=>h.createFaceLandmark(e),face_landmark_destroy:e=>{h.destroyFaceLandmark(e)},face_landmark_update:(e,t,r,n)=>{let a=h.getFaceLandmark(e);a?a.update(t,r,n):p.zcwarn("attempting to call face_landmark_update on a destroyed zappar_face_landmark_t")},face_landmark_anchor_pose:e=>{let t=h.getFaceLandmark(e);return t?t.anchor_pose:(p.zcwarn("attempting to call face_landmark_anchor_pose on a destroyed zappar_face_landmark_t"),s.mat4.create())},html_element_source_create:(e,t)=>d.HTMLElementSource.createVideoElementSource(e,t),html_element_source_start:e=>{var t;return null===(t=d.HTMLElementSource.getVideoElementSource(e))||void 0===t?void 0:t.start()},html_element_source_pause:e=>{var t;return null===(t=d.HTMLElementSource.getVideoElementSource(e))||void 0===t?void 0:t.pause()},html_element_source_destroy:e=>{var t;return null===(t=d.HTMLElementSource.getVideoElementSource(e))||void 0===t?void 0:t.destroy()},sequence_source_create:e=>g.SequenceSource.create(e),sequence_source_load_from_memory:(e,t)=>{var r;return null===(r=g.SequenceSource.get(e))||void 0===r?void 0:r.loadFromMemory(t)},sequence_source_pause:e=>{var t;return null===(t=g.SequenceSource.get(e))||void 0===t?void 0:t.pause()},sequence_source_start:e=>{var t;return null===(t=g.SequenceSource.get(e))||void 0===t?void 0:t.start()},sequence_source_destroy:e=>{var t;return null===(t=g.SequenceSource.get(e))||void 0===t?void 0:t.destroy()},permission_granted_all:u.permissionGrantedAll,permission_granted_camera:u.permissionGrantedCamera,permission_granted_motion:u.permissionGrantedMotion,permission_denied_any:u.permissionDeniedAny,permission_denied_camera:u.permissionDeniedCamera,permission_denied_motion:u.permissionDeniedMotion,permission_request_motion:u.permissionRequestMotion,permission_request_camera:u.permissionRequestCamera,permission_request_all:u.permissionRequestAll,permission_request_ui:u.permissionRequestUI,permission_request_ui_promise:u.permissionRequestUI,permission_denied_ui:u.permissionDeniedUI,browser_incompatible:m.default.incompatible,browser_incompatible_ui:m.default.incompatible_ui,log_level_set:t=>{p.setLogLevel(t),e.impl.log_level_set(t)}}),b}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zappar_client=void 0;const n=r(20),a=r(21);t.zappar_client=class{constructor(e){this._messageSender=e,this._globalState={log_level:1},this.serializer=new n.MessageSerializer(e=>{this._messageSender(e)}),this.deserializer=new a.MessageDeserializer,this._latestId=1,this._pipeline_state_by_instance=new Map,this._camera_source_state_by_instance=new Map,this._sequence_source_state_by_instance=new Map,this._image_tracker_state_by_instance=new Map,this._face_tracker_state_by_instance=new Map,this._face_mesh_state_by_instance=new Map,this._face_landmark_state_by_instance=new Map,this._barcode_finder_state_by_instance=new Map,this._instant_world_tracker_state_by_instance=new Map,this.impl={log_level:()=>this._globalState.log_level,log_level_set:e=>{this.serializer.sendMessage(34,t=>{t.logLevel(e)})},analytics_project_id_set:e=>{this.serializer.sendMessage(31,t=>{t.string(e)})},pipeline_create:()=>{let e=this._latestId++,t={current_frame_user_data:0,camera_model:new Float32Array([300,300,160,120,0,0]),camera_pose:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),camera_frame_camera_attitude:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),camera_frame_device_attitude:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),frame_number:0};return this._pipeline_state_by_instance.set(e,t),this.serializer.sendMessage(27,t=>{t.type(e)}),e},pipeline_destroy:e=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this._pipeline_state_by_instance.delete(e),this.serializer.sendMessage(28,t=>{t.type(e)})},pipeline_frame_update:e=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(9,t=>{t.type(e)})},pipeline_frame_number:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.frame_number},pipeline_camera_model:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.camera_model},pipeline_camera_frame_user_data:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.current_frame_user_data},pipeline_camera_frame_submit:(e,t,r,n,a,i,o,s)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(8,c=>{c.type(e),c.dataWithLength(t),c.int(r),c.int(n),c.int(a),c.matrix4x4(i),c.matrix4x4(o),c.bool(s)})},pipeline_camera_frame_camera_attitude:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.camera_frame_camera_attitude},pipeline_camera_frame_device_attitude:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.camera_frame_device_attitude},pipeline_motion_accelerometer_submit:(e,t,r,n,a)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(10,i=>{i.type(e),i.timestamp(t),i.float(r),i.float(n),i.float(a)})},pipeline_motion_rotation_rate_submit:(e,t,r,n,a)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(11,i=>{i.type(e),i.timestamp(t),i.float(r),i.float(n),i.float(a)})},pipeline_motion_attitude_submit:(e,t,r,n,a)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(12,i=>{i.type(e),i.timestamp(t),i.float(r),i.float(n),i.float(a)})},pipeline_motion_attitude_matrix_submit:(e,t)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(13,r=>{r.type(e),r.matrix4x4(t)})},camera_source_create:(e,t)=>{let r=this._latestId++;return this._camera_source_state_by_instance.set(r,{}),this.serializer.sendMessage(29,n=>{n.type(r),n.type(e),n.string(t)}),r},camera_source_destroy:e=>{if(!this._camera_source_state_by_instance.get(e))throw new Error("This object has been destroyed");this._camera_source_state_by_instance.delete(e),this.serializer.sendMessage(30,t=>{t.type(e)})},sequence_source_create:e=>{let t=this._latestId++;return this._sequence_source_state_by_instance.set(t,{}),this.serializer.sendMessage(35,r=>{r.type(t),r.type(e)}),t},sequence_source_destroy:e=>{if(!this._sequence_source_state_by_instance.get(e))throw new Error("This object has been destroyed");this._sequence_source_state_by_instance.delete(e),this.serializer.sendMessage(36,t=>{t.type(e)})},image_tracker_create:e=>{let t=this._latestId++;return this._image_tracker_state_by_instance.set(t,{enabled:!0,target_loaded_version:-1,target_count:0,anchor_count:0,anchor_id:[],anchor_pose:[]}),this.serializer.sendMessage(2,r=>{r.type(t),r.type(e)}),t},image_tracker_destroy:e=>{if(!this._image_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this._image_tracker_state_by_instance.delete(e),this.serializer.sendMessage(14,t=>{t.type(e)})},image_tracker_target_load_from_memory:(e,t)=>{if(!this._image_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(4,r=>{r.type(e),r.dataWithLength(t)})},image_tracker_target_loaded_version:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.target_loaded_version},image_tracker_target_count:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.target_count},image_tracker_enabled:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},image_tracker_enabled_set:(e,t)=>{if(!this._image_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(3,r=>{r.type(e),r.bool(t)})},image_tracker_anchor_count:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.anchor_count},image_tracker_anchor_id:(e,t)=>{let r=this._image_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_id[t]},image_tracker_anchor_pose_raw:(e,t)=>{let r=this._image_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_pose[t]},face_tracker_create:e=>{let t=this._latestId++;return this._face_tracker_state_by_instance.set(t,{enabled:!0,model_loaded:-1,max_faces:1,anchor_count:0,anchor_id:[],anchor_pose:[],anchor_identity_coefficients:[],anchor_expression_coefficients:[]}),this.serializer.sendMessage(20,r=>{r.type(t),r.type(e)}),t},face_tracker_destroy:e=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this._face_tracker_state_by_instance.delete(e),this.serializer.sendMessage(21,t=>{t.type(e)})},face_tracker_model_load_from_memory:(e,t)=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(22,r=>{r.type(e),r.dataWithLength(t)})},face_tracker_model_loaded_version:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.model_loaded},face_tracker_enabled_set:(e,t)=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(23,r=>{r.type(e),r.bool(t)})},face_tracker_enabled:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},face_tracker_max_faces_set:(e,t)=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(24,r=>{r.type(e),r.int(t)})},face_tracker_max_faces:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.max_faces},face_tracker_anchor_count:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.anchor_count},face_tracker_anchor_id:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_id[t]},face_tracker_anchor_pose_raw:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_pose[t]},face_tracker_anchor_identity_coefficients:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_identity_coefficients[t]},face_tracker_anchor_expression_coefficients:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_expression_coefficients[t]},face_mesh_create:()=>{let e=this._latestId++;return this._face_mesh_state_by_instance.set(e,{}),this.serializer.sendMessage(25,t=>{t.type(e)}),e},face_mesh_destroy:e=>{if(!this._face_mesh_state_by_instance.get(e))throw new Error("This object has been destroyed");this._face_mesh_state_by_instance.delete(e),this.serializer.sendMessage(26,t=>{t.type(e)})},face_landmark_create:e=>{let t=this._latestId++;return this._face_landmark_state_by_instance.set(t,{}),this.serializer.sendMessage(32,r=>{r.type(t),r.faceLandmarkName(e)}),t},face_landmark_destroy:e=>{if(!this._face_landmark_state_by_instance.get(e))throw new Error("This object has been destroyed");this._face_landmark_state_by_instance.delete(e),this.serializer.sendMessage(33,t=>{t.type(e)})},barcode_finder_create:e=>{let t=this._latestId++;return this._barcode_finder_state_by_instance.set(t,{enabled:!0,number_found:0,found_text:[],found_format:[],formats:131071}),this.serializer.sendMessage(16,r=>{r.type(t),r.type(e)}),t},barcode_finder_destroy:e=>{if(!this._barcode_finder_state_by_instance.get(e))throw new Error("This object has been destroyed");this._barcode_finder_state_by_instance.delete(e),this.serializer.sendMessage(17,t=>{t.type(e)})},barcode_finder_enabled_set:(e,t)=>{if(!this._barcode_finder_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(18,r=>{r.type(e),r.bool(t)})},barcode_finder_enabled:e=>{let t=this._barcode_finder_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},barcode_finder_found_number:e=>{let t=this._barcode_finder_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.number_found},barcode_finder_found_text:(e,t)=>{let r=this._barcode_finder_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.found_text[t]},barcode_finder_found_format:(e,t)=>{let r=this._barcode_finder_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.found_format[t]},barcode_finder_formats:e=>{let t=this._barcode_finder_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.formats},barcode_finder_formats_set:(e,t)=>{if(!this._barcode_finder_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(19,r=>{r.type(e),r.barcodeFormat(t)})},instant_world_tracker_create:e=>{let t=this._latestId++,r={enabled:!0,pose:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};return this._instant_world_tracker_state_by_instance.set(t,r),this.serializer.sendMessage(5,r=>{r.type(t),r.type(e)}),t},instant_world_tracker_destroy:e=>{if(!this._instant_world_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this._instant_world_tracker_state_by_instance.delete(e),this.serializer.sendMessage(15,t=>{t.type(e)})},instant_world_tracker_enabled_set:(e,t)=>{if(!this._instant_world_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(6,r=>{r.type(e),r.bool(t)})},instant_world_tracker_enabled:e=>{let t=this._instant_world_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},instant_world_tracker_anchor_pose_raw:e=>{let t=this._instant_world_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.pose},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,n,a)=>{if(!this._instant_world_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(7,i=>{i.type(e),i.float(t),i.float(r),i.float(n),i.instantTrackerTransformOrientation(a)})}}}processMessages(e){this.deserializer.setData(e),this.deserializer.forMessages((e,t)=>{switch(e){case 7:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.frame_number=t.int();break}case 6:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.camera_model=t.cameraModel();break}case 5:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.current_frame_user_data=t.int();break}case 11:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.camera_frame_camera_attitude=t.matrix4x4();break}case 12:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.camera_frame_device_attitude=t.matrix4x4();break}case 19:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;r.target_loaded_version=t.int();break}case 21:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;r.target_count=t.int();break}case 1:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;r.anchor_count=t.int();break}case 2:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;let n=t.int();r.anchor_id[n]=t.string();break}case 3:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;let n=t.int();r.anchor_pose[n]=t.matrix4x4();break}case 18:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;r.model_loaded=t.int();break}case 13:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;r.anchor_count=t.int();break}case 14:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let n=t.int();r.anchor_id[n]=t.string();break}case 15:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let n=t.int();r.anchor_pose[n]=t.matrix4x4();break}case 16:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let n=t.int();r.anchor_identity_coefficients[n]=t.identityCoefficients();break}case 17:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let n=t.int();r.anchor_expression_coefficients[n]=t.expressionCoefficients();break}case 8:{let e=t.type(),r=this._barcode_finder_state_by_instance.get(e);if(!r)return;r.number_found=t.int();break}case 9:{let e=t.type(),r=this._barcode_finder_state_by_instance.get(e);if(!r)return;let n=t.int();r.found_text[n]=t.string();break}case 10:{let e=t.type(),r=this._barcode_finder_state_by_instance.get(e);if(!r)return;let n=t.int();r.found_format[n]=t.barcodeFormat();break}case 4:{let e=t.type(),r=this._instant_world_tracker_state_by_instance.get(e);if(!r)return;r.pose=t.matrix4x4();break}}})}}},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";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.launchWorker=t.messageManager=void 0;const a=r(8),i=r(25);let o;t.messageManager=new i.MsgManager,o=r(26),o.default&&(o=o.default),t.launchWorker=function(){return n(this,void 0,void 0,(function*(){let e=new o;var n;function i(){let r=t.messageManager.getOutgoingMessages();for(let t of r)e.postMessage(t.msg,t.transferables)}e.postMessage({t:"wasm",url:r(27).default}),e.postMessage({t:"port",port:a.bundleWorkerMessageChannel.port1},[a.bundleWorkerMessageChannel.port1]),yield(n=e,new Promise(e=>{let t=r=>{"loaded"===r.data&&(n.removeEventListener("message",t),e())};n.addEventListener("message",t)})),t.messageManager.onOutgoingMessage.bind(i),i(),e.addEventListener("message",e=>{t.messageManager.postIncomingMessage(e.data)})}))}},function(e,t,r){"use strict";r.r(t);var n=r(5),a=r.n(n);t.default=function(){return a()('!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),o=self;let i,a;self.bundle_adjust_message_callback=function(e){var t=new ArrayBuffer(e.byteLength);new Uint8Array(t).set(new Uint8Array(e)),null==i||i.postMessage({t:"bundle_adjust_message_callback",buf:t},[t])},o.addEventListener("message",e=>{e&&e.data&&"port"===e.data.t&&(i=e.data.port,i.onmessage=function(e){var t=e.data.buf,n=a._malloc(t.byteLength);a.HEAPU8.set(new Uint8Array(t),n),a._bundle_adjust_message(n,e.data.buf.byteLength,0),a._free(n)}),e&&e.data&&"wasm"===e.data.t&&(a=r.default({locateFile:(t,n)=>e.data.url,onRuntimeInitialized:()=>{}}))})},function(e,t,n){"use strict";n.r(t),function(e){var n,r=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var r,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(e,t){r=e,o=t}));var a,s={};for(a in i)i.hasOwnProperty(a)&&(s[a]=i[a]);var u,c,l,f=[],d="./this.program",m=function(e,t){throw t},p="";p=self.location.href,n&&(p=n),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},l=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},c=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)};var h,g,v,w=i.print||console.log.bind(console),y=i.printErr||console.warn.bind(console);for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);s=null,i.arguments&&(f=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(h=i.wasmBinary),i.noExitRuntime&&(g=i.noExitRuntime),"object"!=typeof WebAssembly&&V("no native wasm support detected");var _=!1;function E(e,t){e||V("Assertion failed: "+t)}var b,k,D,M,F,L,S,A="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&A)return A.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function x(e,t){return e?P(D,e,t):""}function R(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-o}function T(e,t,n){return R(e,D,t,n)}function C(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function z(e){var t=C(e)+1,n=ze(t);return n&&R(e,k,n,t),n}function O(e,t){k.set(e,t)}function j(e,t,n){for(var r=0;r<e.length;++r)k[t++>>0]=e.charCodeAt(r);n||(k[t>>0]=0)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),i.INITIAL_MEMORY;var B,I=[],N=[],q=[],Y=[],U=0,H=null,W=null;function X(e){U++,i.monitorRunDependencies&&i.monitorRunDependencies(U)}function G(e){if(U--,i.monitorRunDependencies&&i.monitorRunDependencies(U),0==U&&(null!==H&&(clearInterval(H),H=null),W)){var t=W;W=null,t()}}function V(e){i.onAbort&&i.onAbort(e),y(e+=""),_=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}i.preloadedImages={},i.preloadedAudios={};var K,J,$,Z,Q,ee="zcv-slam.wasm";function te(e){try{if(e==ee&&h)return new Uint8Array(h);if(l)return l(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){V(e)}}J=ee,$="data:application/octet-stream;base64,",(String.prototype.startsWith?J.startsWith($):0===J.indexOf($))||(K=ee,ee=i.locateFile?i.locateFile(K,p):p+K);var ne={1024:function(e,t){self.bundle_adjust_message_callback(D.subarray(e,e+t,0))}};function re(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?B.get(n)():B.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}var oe=0,ie=4,ae=8,se=12,ue=13,ce=16;function le(e){this.excPtr=e,this.ptr=e-ce,this.set_type=function(e){F[this.ptr+ae>>2]=e},this.get_type=function(){return F[this.ptr+ae>>2]},this.set_destructor=function(e){F[this.ptr+oe>>2]=e},this.get_destructor=function(){return F[this.ptr+oe>>2]},this.set_refcount=function(e){F[this.ptr+ie>>2]=e},this.set_caught=function(e){e=e?1:0,k[this.ptr+se>>0]=e},this.get_caught=function(){return 0!=k[this.ptr+se>>0]},this.set_rethrown=function(e){e=e?1:0,k[this.ptr+ue>>0]=e},this.get_rethrown=function(){return 0!=k[this.ptr+ue>>0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=F[this.ptr+ie>>2];F[this.ptr+ie>>2]=e+1},this.release_ref=function(){var e=F[this.ptr+ie>>2];return F[this.ptr+ie>>2]=e-1,1===e}}var fe={splitPath:function(e){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=fe.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=fe.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=fe.normalize(e)).replace(/\\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return fe.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return fe.normalize(e.join("/"))},join2:function(e,t){return fe.normalize(e+"/"+t)}},de={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:ve.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t="/"===r.charAt(0)}return(t?"/":"")+(e=fe.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=de.resolve(e).substr(1),t=de.resolve(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,s=0;s<i;s++)if(r[s]!==o[s]){a=s;break}var u=[];for(s=a;s<r.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},me={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){me.ttys[e]={input:[],output:[],ops:t},ve.registerDevice(e,me.stream_ops)},stream_ops:{open:function(e){var t=me.ttys[e.node.rdev];if(!t)throw new ve.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,n,r,o){if(!e.tty||!e.tty.ops.get_char)throw new ve.ErrnoError(60);for(var i=0,a=0;a<r;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ve.ErrnoError(29)}if(void 0===s&&0===i)throw new ve.ErrnoError(6);if(null==s)break;i++,t[n+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,n,r,o){if(!e.tty||!e.tty.ops.put_char)throw new ve.ErrnoError(60);try{for(var i=0;i<r;i++)e.tty.ops.put_char(e.tty,t[n+i])}catch(e){throw new ve.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char: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=Pe(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(P(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(P(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(y(P(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(y(P(e.output,0)),e.output=[])}}};function pe(e){for(var t=function(e,t){return t||(t=16),Math.ceil(e/t)*t}(e,16384),n=ze(t);e<t;)k[n+e++]=0;return n}var he,ge={ops_table:null,mount:function(e){return ge.createNode(null,"/",16895,0)},createNode:function(e,t,n,r){if(ve.isBlkdev(n)||ve.isFIFO(n))throw new ve.ErrnoError(63);ge.ops_table||(ge.ops_table={dir:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr,lookup:ge.node_ops.lookup,mknod:ge.node_ops.mknod,rename:ge.node_ops.rename,unlink:ge.node_ops.unlink,rmdir:ge.node_ops.rmdir,readdir:ge.node_ops.readdir,symlink:ge.node_ops.symlink},stream:{llseek:ge.stream_ops.llseek}},file:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr},stream:{llseek:ge.stream_ops.llseek,read:ge.stream_ops.read,write:ge.stream_ops.write,allocate:ge.stream_ops.allocate,mmap:ge.stream_ops.mmap,msync:ge.stream_ops.msync}},link:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr,readlink:ge.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr},stream:ve.chrdev_stream_ops}});var o=ve.createNode(e,t,n,r);return ve.isDir(o.mode)?(o.node_ops=ge.ops_table.dir.node,o.stream_ops=ge.ops_table.dir.stream,o.contents={}):ve.isFile(o.mode)?(o.node_ops=ge.ops_table.file.node,o.stream_ops=ge.ops_table.file.stream,o.usedBytes=0,o.contents=null):ve.isLink(o.mode)?(o.node_ops=ge.ops_table.link.node,o.stream_ops=ge.ops_table.link.stream):ve.isChrdev(o.mode)&&(o.node_ops=ge.ops_table.chrdev.node,o.stream_ops=ge.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o),o},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],n=0;n<e.usedBytes;++n)t.push(e.contents[n]);return t}return e.contents},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var n=e.contents;return e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length<t;)e.contents.push(0);e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=ve.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,ve.isDir(e.mode)?t.size=4096:ve.isFile(e.mode)?t.size=e.usedBytes:ve.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ge.resizeFileStorage(e,t.size)},lookup:function(e,t){throw ve.genericErrors[44]},mknod:function(e,t,n,r){return ge.createNode(e,t,n,r)},rename:function(e,t,n){if(ve.isDir(e.mode)){var r;try{r=ve.lookupNode(t,n)}catch(e){}if(r)for(var o in r.contents)throw new ve.ErrnoError(55)}delete e.parent.contents[e.name],e.name=n,t.contents[n]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var n=ve.lookupNode(e,t);for(var r in n.contents)throw new ve.ErrnoError(55);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink:function(e,t,n){var r=ge.createNode(e,t,41471,0);return r.link=n,r},readlink:function(e){if(!ve.isLink(e.mode))throw new ve.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,n,r,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,r);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),n);else for(var s=0;s<a;s++)t[n+s]=i[o+s];return a},write:function(e,t,n,r,o,i){if(!r)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(n,n+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===o)return a.contents=t.slice(n,n+r),a.usedBytes=r,r;if(o+r<=a.usedBytes)return a.contents.set(t.subarray(n,n+r),o),r}if(ge.expandFileStorage(a,o+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(n,n+r),o);else for(var s=0;s<r;s++)a.contents[o+s]=t[n+s];return a.usedBytes=Math.max(a.usedBytes,o+r),r},llseek:function(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&ve.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new ve.ErrnoError(28);return r},allocate:function(e,t,n){ge.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap:function(e,t,n,r,o,i){if(E(0===t),!ve.isFile(e.node.mode))throw new ve.ErrnoError(43);var a,s,u=e.node.contents;if(2&i||u.buffer!==b){if((r>0||r+n<u.length)&&(u=u.subarray?u.subarray(r,r+n):Array.prototype.slice.call(u,r,r+n)),s=!0,!(a=pe(n)))throw new ve.ErrnoError(48);k.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,n,r,o){if(!ve.isFile(e.node.mode))throw new ve.ErrnoError(43);return 2&o||ge.stream_ops.write(e,t,0,r,n,!1),0}}},ve={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){if(t=t||{},!(e=de.resolve(ve.cwd(),e)))return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};for(var r in n)void 0===t[r]&&(t[r]=n[r]);if(t.recurse_count>8)throw new ve.ErrnoError(32);for(var o=fe.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),i=ve.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&t.parent)break;if(i=ve.lookupNode(i,o[s]),a=fe.join2(a,o[s]),ve.isMountpoint(i)&&(!u||u&&t.follow_mount)&&(i=i.mounted.root),!u||t.follow)for(var c=0;ve.isLink(i.mode);){var l=ve.readlink(a);if(a=de.resolve(fe.dirname(a),l),i=ve.lookupPath(a,{recurse_count:t.recurse_count}).node,c++>40)throw new ve.ErrnoError(32)}}return{path:a,node:i}},getPath:function(e){for(var t;;){if(ve.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?n+"/"+t:n+t:n}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%ve.nameTable.length},hashAddNode:function(e){var t=ve.hashName(e.parent.id,e.name);e.name_next=ve.nameTable[t],ve.nameTable[t]=e},hashRemoveNode:function(e){var t=ve.hashName(e.parent.id,e.name);if(ve.nameTable[t]===e)ve.nameTable[t]=e.name_next;else for(var n=ve.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:function(e,t){var n=ve.mayLookup(e);if(n)throw new ve.ErrnoError(n,e);for(var r=ve.hashName(e.id,t),o=ve.nameTable[r];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return ve.lookup(e,t)},createNode:function(e,t,n,r){var o=new ve.FSNode(e,t,n,r);return ve.hashAddNode(o),o},destroyNode:function(e){ve.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=ve.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return ve.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var t=ve.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return ve.lookupNode(e,t),20}catch(e){}return ve.nodePermissions(e,"wx")},mayDelete:function(e,t,n){var r;try{r=ve.lookupNode(e,t)}catch(e){return e.errno}var o=ve.nodePermissions(e,"wx");if(o)return o;if(n){if(!ve.isDir(r.mode))return 54;if(ve.isRoot(r)||ve.getPath(r)===ve.cwd())return 10}else if(ve.isDir(r.mode))return 31;return 0},mayOpen:function(e,t){return e?ve.isLink(e.mode)?32:ve.isDir(e.mode)&&("r"!==ve.flagsToPermissionString(t)||512&t)?31:ve.nodePermissions(e,ve.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||ve.MAX_OPEN_FDS;for(var n=e;n<=t;n++)if(!ve.streams[n])return n;throw new ve.ErrnoError(33)},getStream:function(e){return ve.streams[e]},createStream:function(e,t,n){ve.FSStream||(ve.FSStream=function(){},ve.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var r=new ve.FSStream;for(var o in e)r[o]=e[o];e=r;var i=ve.nextfd(t,n);return e.fd=i,ve.streams[i]=e,e},closeStream:function(e){ve.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=ve.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new ve.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){ve.devices[e]={stream_ops:t}},getDevice:function(e){return ve.devices[e]},getMounts:function(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),ve.syncFSRequests++,ve.syncFSRequests>1&&y("warning: "+ve.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=ve.getMounts(ve.root.mount),r=0;function o(e){return ve.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++r>=n.length&&o(null)}n.forEach((function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:function(e,t,n){var r,o="/"===n,i=!n;if(o&&ve.root)throw new ve.ErrnoError(10);if(!o&&!i){var a=ve.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,ve.isMountpoint(r))throw new ve.ErrnoError(10);if(!ve.isDir(r.mode))throw new ve.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?ve.root=u:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),u},unmount:function(e){var t=ve.lookupPath(e,{follow_mount:!1});if(!ve.isMountpoint(t.node))throw new ve.ErrnoError(28);var n=t.node,r=n.mounted,o=ve.getMounts(r);Object.keys(ve.nameTable).forEach((function(e){for(var t=ve.nameTable[e];t;){var n=t.name_next;-1!==o.indexOf(t.mount)&&ve.destroyNode(t),t=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(r);n.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,n){var r=ve.lookupPath(e,{parent:!0}).node,o=fe.basename(e);if(!o||"."===o||".."===o)throw new ve.ErrnoError(28);var i=ve.mayCreate(r,o);if(i)throw new ve.ErrnoError(i);if(!r.node_ops.mknod)throw new ve.ErrnoError(63);return r.node_ops.mknod(r,o,t,n)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,ve.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,ve.mknod(e,t,0)},mkdirTree:function(e,t){for(var n=e.split("/"),r="",o=0;o<n.length;++o)if(n[o]){r+="/"+n[o];try{ve.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,n){return void 0===n&&(n=t,t=438),t|=8192,ve.mknod(e,t,n)},symlink:function(e,t){if(!de.resolve(e))throw new ve.ErrnoError(44);var n=ve.lookupPath(t,{parent:!0}).node;if(!n)throw new ve.ErrnoError(44);var r=fe.basename(t),o=ve.mayCreate(n,r);if(o)throw new ve.ErrnoError(o);if(!n.node_ops.symlink)throw new ve.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename:function(e,t){var n,r,o=fe.dirname(e),i=fe.dirname(t),a=fe.basename(e),s=fe.basename(t);if(n=ve.lookupPath(e,{parent:!0}).node,r=ve.lookupPath(t,{parent:!0}).node,!n||!r)throw new ve.ErrnoError(44);if(n.mount!==r.mount)throw new ve.ErrnoError(75);var u,c=ve.lookupNode(n,a),l=de.relative(e,i);if("."!==l.charAt(0))throw new ve.ErrnoError(28);if("."!==(l=de.relative(t,o)).charAt(0))throw new ve.ErrnoError(55);try{u=ve.lookupNode(r,s)}catch(e){}if(c!==u){var f=ve.isDir(c.mode),d=ve.mayDelete(n,a,f);if(d)throw new ve.ErrnoError(d);if(d=u?ve.mayDelete(r,s,f):ve.mayCreate(r,s))throw new ve.ErrnoError(d);if(!n.node_ops.rename)throw new ve.ErrnoError(63);if(ve.isMountpoint(c)||u&&ve.isMountpoint(u))throw new ve.ErrnoError(10);if(r!==n&&(d=ve.nodePermissions(n,"w")))throw new ve.ErrnoError(d);try{ve.trackingDelegate.willMovePath&&ve.trackingDelegate.willMovePath(e,t)}catch(n){y("FS.trackingDelegate[\'willMovePath\'](\'"+e+"\', \'"+t+"\') threw an exception: "+n.message)}ve.hashRemoveNode(c);try{n.node_ops.rename(c,r,s)}catch(e){throw e}finally{ve.hashAddNode(c)}try{ve.trackingDelegate.onMovePath&&ve.trackingDelegate.onMovePath(e,t)}catch(n){y("FS.trackingDelegate[\'onMovePath\'](\'"+e+"\', \'"+t+"\') threw an exception: "+n.message)}}},rmdir:function(e){var t=ve.lookupPath(e,{parent:!0}).node,n=fe.basename(e),r=ve.lookupNode(t,n),o=ve.mayDelete(t,n,!0);if(o)throw new ve.ErrnoError(o);if(!t.node_ops.rmdir)throw new ve.ErrnoError(63);if(ve.isMountpoint(r))throw new ve.ErrnoError(10);try{ve.trackingDelegate.willDeletePath&&ve.trackingDelegate.willDeletePath(e)}catch(t){y("FS.trackingDelegate[\'willDeletePath\'](\'"+e+"\') threw an exception: "+t.message)}t.node_ops.rmdir(t,n),ve.destroyNode(r);try{ve.trackingDelegate.onDeletePath&&ve.trackingDelegate.onDeletePath(e)}catch(t){y("FS.trackingDelegate[\'onDeletePath\'](\'"+e+"\') threw an exception: "+t.message)}},readdir:function(e){var t=ve.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new ve.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=ve.lookupPath(e,{parent:!0}).node,n=fe.basename(e),r=ve.lookupNode(t,n),o=ve.mayDelete(t,n,!1);if(o)throw new ve.ErrnoError(o);if(!t.node_ops.unlink)throw new ve.ErrnoError(63);if(ve.isMountpoint(r))throw new ve.ErrnoError(10);try{ve.trackingDelegate.willDeletePath&&ve.trackingDelegate.willDeletePath(e)}catch(t){y("FS.trackingDelegate[\'willDeletePath\'](\'"+e+"\') threw an exception: "+t.message)}t.node_ops.unlink(t,n),ve.destroyNode(r);try{ve.trackingDelegate.onDeletePath&&ve.trackingDelegate.onDeletePath(e)}catch(t){y("FS.trackingDelegate[\'onDeletePath\'](\'"+e+"\') threw an exception: "+t.message)}},readlink:function(e){var t=ve.lookupPath(e).node;if(!t)throw new ve.ErrnoError(44);if(!t.node_ops.readlink)throw new ve.ErrnoError(28);return de.resolve(ve.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var n=ve.lookupPath(e,{follow:!t}).node;if(!n)throw new ve.ErrnoError(44);if(!n.node_ops.getattr)throw new ve.ErrnoError(63);return n.node_ops.getattr(n)},lstat:function(e){return ve.stat(e,!0)},chmod:function(e,t,n){var r;if(!(r="string"==typeof e?ve.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod:function(e,t){ve.chmod(e,t,!0)},fchmod:function(e,t){var n=ve.getStream(e);if(!n)throw new ve.ErrnoError(8);ve.chmod(n.node,t)},chown:function(e,t,n,r){var o;if(!(o="string"==typeof e?ve.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,n){ve.chown(e,t,n,!0)},fchown:function(e,t,n){var r=ve.getStream(e);if(!r)throw new ve.ErrnoError(8);ve.chown(r.node,t,n)},truncate:function(e,t){if(t<0)throw new ve.ErrnoError(28);var n;if(!(n="string"==typeof e?ve.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);if(ve.isDir(n.mode))throw new ve.ErrnoError(31);if(!ve.isFile(n.mode))throw new ve.ErrnoError(28);var r=ve.nodePermissions(n,"w");if(r)throw new ve.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var n=ve.getStream(e);if(!n)throw new ve.ErrnoError(8);if(0==(2097155&n.flags))throw new ve.ErrnoError(28);ve.truncate(n.node,t)},utime:function(e,t,n){var r=ve.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open:function(e,t,n,r,o){if(""===e)throw new ve.ErrnoError(44);var a;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?ve.modeStringToFlags(t):t)?4095&n|32768:0,"object"==typeof e)a=e;else{e=fe.normalize(e);try{a=ve.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new ve.ErrnoError(20)}else a=ve.mknod(e,n,0),s=!0;if(!a)throw new ve.ErrnoError(44);if(ve.isChrdev(a.mode)&&(t&=-513),65536&t&&!ve.isDir(a.mode))throw new ve.ErrnoError(54);if(!s){var u=ve.mayOpen(a,t);if(u)throw new ve.ErrnoError(u)}512&t&&ve.truncate(a,0),t&=-131713;var c=ve.createStream({node:a,path:ve.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},r,o);c.stream_ops.open&&c.stream_ops.open(c),!i.logReadFiles||1&t||(ve.readFiles||(ve.readFiles={}),e in ve.readFiles||(ve.readFiles[e]=1,y("FS.trackingDelegate error on read file: "+e)));try{if(ve.trackingDelegate.onOpenFile){var l=0;1!=(2097155&t)&&(l|=ve.tracking.openFlags.READ),0!=(2097155&t)&&(l|=ve.tracking.openFlags.WRITE),ve.trackingDelegate.onOpenFile(e,l)}}catch(t){y("FS.trackingDelegate[\'onOpenFile\'](\'"+e+"\', flags) threw an exception: "+t.message)}return c},close:function(e){if(ve.isClosed(e))throw new ve.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ve.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,n){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ve.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new ve.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read:function(e,t,n,r,o){if(r<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(1==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.read)throw new ve.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,n,r,o);return i||(e.position+=a),a},write:function(e,t,n,r,o,i){if(r<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(0==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.write)throw new ve.ErrnoError(28);e.seekable&&1024&e.flags&&ve.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,n,r,o,i);a||(e.position+=s);try{e.path&&ve.trackingDelegate.onWriteToFile&&ve.trackingDelegate.onWriteToFile(e.path)}catch(t){y("FS.trackingDelegate[\'onWriteToFile\'](\'"+e.path+"\') threw an exception: "+t.message)}return s},allocate:function(e,t,n){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(t<0||n<=0)throw new ve.ErrnoError(28);if(0==(2097155&e.flags))throw new ve.ErrnoError(8);if(!ve.isFile(e.node.mode)&&!ve.isDir(e.node.mode))throw new ve.ErrnoError(43);if(!e.stream_ops.allocate)throw new ve.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap:function(e,t,n,r,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new ve.ErrnoError(2);if(1==(2097155&e.flags))throw new ve.ErrnoError(2);if(!e.stream_ops.mmap)throw new ve.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,o,i)},msync:function(e,t,n,r,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,o):0},munmap:function(e){return 0},ioctl:function(e,t,n){if(!e.stream_ops.ioctl)throw new ve.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(\'Invalid encoding type "\'+t.encoding+\'"\');var n,r=ve.open(e,t.flags),o=ve.stat(e).size,i=new Uint8Array(o);return ve.read(r,i,0,o,0),"utf8"===t.encoding?n=P(i,0):"binary"===t.encoding&&(n=i),ve.close(r),n},writeFile:function(e,t,n){(n=n||{}).flags=n.flags||577;var r=ve.open(e,n.flags,n.mode);if("string"==typeof t){var o=new Uint8Array(C(t)+1),i=R(t,o,0,o.length);ve.write(r,o,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");ve.write(r,t,0,t.byteLength,void 0,n.canOwn)}ve.close(r)},cwd:function(){return ve.currentPath},chdir:function(e){var t=ve.lookupPath(e,{follow:!0});if(null===t.node)throw new ve.ErrnoError(44);if(!ve.isDir(t.node.mode))throw new ve.ErrnoError(54);var n=ve.nodePermissions(t.node,"x");if(n)throw new ve.ErrnoError(n);ve.currentPath=t.path},createDefaultDirectories:function(){ve.mkdir("/tmp"),ve.mkdir("/home"),ve.mkdir("/home/web_user")},createDefaultDevices:function(){ve.mkdir("/dev"),ve.registerDevice(ve.makedev(1,3),{read:function(){return 0},write:function(e,t,n,r,o){return r}}),ve.mkdev("/dev/null",ve.makedev(1,3)),me.register(ve.makedev(5,0),me.default_tty_ops),me.register(ve.makedev(6,0),me.default_tty1_ops),ve.mkdev("/dev/tty",ve.makedev(5,0)),ve.mkdev("/dev/tty1",ve.makedev(6,0));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(){V("randomDevice")}}();ve.createDevice("/dev","random",e),ve.createDevice("/dev","urandom",e),ve.mkdir("/dev/shm"),ve.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){ve.mkdir("/proc"),ve.mkdir("/proc/self"),ve.mkdir("/proc/self/fd"),ve.mount({mount:function(){var e=ve.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(e,t){var n=+t,r=ve.getStream(n);if(!r)throw new ve.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return r.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){i.stdin?ve.createDevice("/dev","stdin",i.stdin):ve.symlink("/dev/tty","/dev/stdin"),i.stdout?ve.createDevice("/dev","stdout",null,i.stdout):ve.symlink("/dev/tty","/dev/stdout"),i.stderr?ve.createDevice("/dev","stderr",null,i.stderr):ve.symlink("/dev/tty1","/dev/stderr"),ve.open("/dev/stdin",0),ve.open("/dev/stdout",1),ve.open("/dev/stderr",1)},ensureErrnoError:function(){ve.ErrnoError||(ve.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ve.ErrnoError.prototype=new Error,ve.ErrnoError.prototype.constructor=ve.ErrnoError,[44].forEach((function(e){ve.genericErrors[e]=new ve.ErrnoError(e),ve.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){ve.ensureErrnoError(),ve.nameTable=new Array(4096),ve.mount(ge,{},"/"),ve.createDefaultDirectories(),ve.createDefaultDevices(),ve.createSpecialDirectories(),ve.filesystems={MEMFS:ge}},init:function(e,t,n){ve.init.initialized=!0,ve.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=n||i.stderr,ve.createStandardStreams()},quit:function(){ve.init.initialized=!1;var e=i._fflush;e&&e(0);for(var t=0;t<ve.streams.length;t++){var n=ve.streams[t];n&&ve.close(n)}},getMode:function(e,t){var n=0;return e&&(n|=365),t&&(n|=146),n},findObject:function(e,t){var n=ve.analyzePath(e,t);return n.exists?n.object:null},analyzePath:function(e,t){try{e=(r=ve.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=ve.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=fe.basename(e),r=ve.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(e){n.error=e.errno}return n},createPath:function(e,t,n,r){e="string"==typeof e?e:ve.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=fe.join2(e,i);try{ve.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,n,r,o){var i=fe.join2("string"==typeof e?e:ve.getPath(e),t),a=ve.getMode(r,o);return ve.create(i,a)},createDataFile:function(e,t,n,r,o,i){var a=t?fe.join2("string"==typeof e?e:ve.getPath(e),t):e,s=ve.getMode(r,o),u=ve.create(a,s);if(n){if("string"==typeof n){for(var c=new Array(n.length),l=0,f=n.length;l<f;++l)c[l]=n.charCodeAt(l);n=c}ve.chmod(u,146|s);var d=ve.open(u,577);ve.write(d,n,0,n.length,0,i),ve.close(d),ve.chmod(u,s)}return u},createDevice:function(e,t,n,r){var o=fe.join2("string"==typeof e?e:ve.getPath(e),t),i=ve.getMode(!!n,!!r);ve.createDevice.major||(ve.createDevice.major=64);var a=ve.makedev(ve.createDevice.major++,0);return ve.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,t,r,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=n()}catch(e){throw new ve.ErrnoError(29)}if(void 0===u&&0===a)throw new ve.ErrnoError(6);if(null==u)break;a++,t[r+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,n,o,i){for(var a=0;a<o;a++)try{r(t[n+a])}catch(e){throw new ve.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),ve.mkdev(o,i,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!u)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Pe(u(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ve.ErrnoError(29)}},createLazyFile:function(e,t,n,r,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn\'t load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=r);var s=this;s.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,r-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),r!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Pe(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&r||(a=r=1,r=this.getter(0).length,a=r,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:n};var u=ve.createFile(e,t,s,r,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(u.stream_ops).forEach((function(e){var t=u.stream_ops[e];c[e]=function(){return ve.forceLoadFile(u),t.apply(null,arguments)}})),c.read=function(e,t,n,r,o){ve.forceLoadFile(u);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,r);if(i.slice)for(var s=0;s<a;s++)t[n+s]=i[o+s];else for(s=0;s<a;s++)t[n+s]=i.get(o+s);return a},u.stream_ops=c,u},createPreloadedFile:function(e,t,n,r,o,a,s,u,c,l){_e.init();var f=t?de.resolve(fe.join2(e,t)):e;function d(n){function d(n){l&&l(),u||ve.createDataFile(e,t,n,r,o,c),a&&a(),G()}var m=!1;i.preloadPlugins.forEach((function(e){m||e.canHandle(f)&&(e.handle(n,f,d,(function(){s&&s(),G()})),m=!0)})),m||d(n)}X(),"string"==typeof n?_e.asyncLoad(n,(function(e){d(e)}),s):d(n)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,n){t=t||function(){},n=n||function(){};var r=ve.indexedDB();try{var o=r.open(ve.DB_NAME(),ve.DB_VERSION)}catch(e){return n(e)}o.onupgradeneeded=function(){w("creating db"),o.result.createObjectStore(ve.DB_STORE_NAME)},o.onsuccess=function(){var r=o.result.transaction([ve.DB_STORE_NAME],"readwrite"),i=r.objectStore(ve.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():n()}e.forEach((function(e){var t=i.put(ve.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==u&&c()},t.onerror=function(){s++,a+s==u&&c()}})),r.onerror=n},o.onerror=n},loadFilesFromDB:function(e,t,n){t=t||function(){},n=n||function(){};var r=ve.indexedDB();try{var o=r.open(ve.DB_NAME(),ve.DB_VERSION)}catch(e){return n(e)}o.onupgradeneeded=n,o.onsuccess=function(){var r=o.result;try{var i=r.transaction([ve.DB_STORE_NAME],"readonly")}catch(e){return void n(e)}var a=i.objectStore(ve.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():n()}e.forEach((function(e){var t=a.get(e);t.onsuccess=function(){ve.analyzePath(e).exists&&ve.unlink(e),ve.createDataFile(fe.dirname(e),fe.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=function(){u++,s+u==c&&l()}})),i.onerror=n},o.onerror=n}},we={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,t){if("/"!==t[0]){var n;if(-100===e)n=ve.cwd();else{var r=ve.getStream(e);if(!r)throw new ve.ErrnoError(8);n=r.path}t=fe.join2(n,t)}return t},doStat:function(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&fe.normalize(t)!==fe.normalize(ve.getPath(e.node)))return-54;throw e}return F[n>>2]=r.dev,F[n+4>>2]=0,F[n+8>>2]=r.ino,F[n+12>>2]=r.mode,F[n+16>>2]=r.nlink,F[n+20>>2]=r.uid,F[n+24>>2]=r.gid,F[n+28>>2]=r.rdev,F[n+32>>2]=0,Q=[r.size>>>0,(Z=r.size,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],F[n+40>>2]=Q[0],F[n+44>>2]=Q[1],F[n+48>>2]=4096,F[n+52>>2]=r.blocks,F[n+56>>2]=r.atime.getTime()/1e3|0,F[n+60>>2]=0,F[n+64>>2]=r.mtime.getTime()/1e3|0,F[n+68>>2]=0,F[n+72>>2]=r.ctime.getTime()/1e3|0,F[n+76>>2]=0,Q=[r.ino>>>0,(Z=r.ino,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],F[n+80>>2]=Q[0],F[n+84>>2]=Q[1],0},doMsync:function(e,t,n,r,o){var i=D.slice(e,e+n);ve.msync(t,i,o,n,r)},doMkdir:function(e,t){return"/"===(e=fe.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),ve.mkdir(e,t,0),0},doMknod:function(e,t,n){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return ve.mknod(e,t,n),0},doReadlink:function(e,t,n){if(n<=0)return-28;var r=ve.readlink(e),o=Math.min(n,C(r)),i=k[t+o];return T(r,t,n+1),k[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var n;if(!(n=ve.lookupPath(e,{follow:!0}).node))return-44;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&ve.nodePermissions(n,r)?-2:0},doDup:function(e,t,n){var r=ve.getStream(n);return r&&ve.close(r),ve.open(e,t,0,n,n).fd},doReadv:function(e,t,n,r){for(var o=0,i=0;i<n;i++){var a=F[t+8*i>>2],s=F[t+(8*i+4)>>2],u=ve.read(e,k,a,s,r);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(e,t,n,r){for(var o=0,i=0;i<n;i++){var a=F[t+8*i>>2],s=F[t+(8*i+4)>>2],u=ve.write(e,k,a,s,r);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return we.varargs+=4,F[we.varargs-4>>2]},getStr:function(e){return x(e)},getStreamFromFD:function(e){var t=ve.getStream(e);if(!t)throw new ve.ErrnoError(8);return t},get64:function(e,t){return e}};function ye(t,n){if(_e.mainLoop.timingMode=t,_e.mainLoop.timingValue=n,!_e.mainLoop.func)return 1;if(0==t)_e.mainLoop.scheduler=function(){var e=0|Math.max(0,_e.mainLoop.tickStartTime+n-he());setTimeout(_e.mainLoop.runner,e)},_e.mainLoop.method="timeout";else if(1==t)_e.mainLoop.scheduler=function(){_e.requestAnimationFrame(_e.mainLoop.runner)},_e.mainLoop.method="rAF";else if(2==t){if(void 0===e){var r=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),r.shift()())}),!0),e=function(e){r.push(e),void 0===i.setImmediates&&(i.setImmediates=[]),i.setImmediates.push(e),postMessage({target:"setimmediate"})}}_e.mainLoop.scheduler=function(){e(_e.mainLoop.runner)},_e.mainLoop.method="immediate"}return 0}he=function(){return performance.now()};var _e={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){_e.mainLoop.scheduler=null,_e.mainLoop.currentlyRunningMainloop++},resume:function(){_e.mainLoop.currentlyRunningMainloop++;var e=_e.mainLoop.timingMode,t=_e.mainLoop.timingValue,n=_e.mainLoop.func;_e.mainLoop.func=null,function(e,t,n,r,o){g=!0,E(!_e.mainLoop.func,"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."),_e.mainLoop.func=e,_e.mainLoop.arg=r;var i=_e.mainLoop.currentlyRunningMainloop;if(_e.mainLoop.runner=function(){if(!_)if(_e.mainLoop.queue.length>0){var t=Date.now(),n=_e.mainLoop.queue.shift();if(n.func(n.arg),_e.mainLoop.remainingBlockers){var r=_e.mainLoop.remainingBlockers,o=r%1==0?r-1:Math.floor(r);n.counted?_e.mainLoop.remainingBlockers=o:(o+=.5,_e.mainLoop.remainingBlockers=(8*r+o)/9)}if(console.log(\'main loop blocker "\'+n.name+\'" took \'+(Date.now()-t)+" ms"),_e.mainLoop.updateStatus(),i<_e.mainLoop.currentlyRunningMainloop)return;setTimeout(_e.mainLoop.runner,0)}else i<_e.mainLoop.currentlyRunningMainloop||(_e.mainLoop.currentFrameNumber=_e.mainLoop.currentFrameNumber+1|0,1==_e.mainLoop.timingMode&&_e.mainLoop.timingValue>1&&_e.mainLoop.currentFrameNumber%_e.mainLoop.timingValue!=0?_e.mainLoop.scheduler():(0==_e.mainLoop.timingMode&&(_e.mainLoop.tickStartTime=he()),_e.mainLoop.runIter(e),i<_e.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),_e.mainLoop.scheduler())))},o||(t&&t>0?ye(0,1e3/t):ye(1,1),_e.mainLoop.scheduler()),n)throw"unwind"}(n,0,!1,_e.mainLoop.arg,!0),ye(e,t),_e.mainLoop.scheduler()},updateStatus:function(){if(i.setStatus){var e=i.statusMessage||"Please wait...",t=_e.mainLoop.remainingBlockers,n=_e.mainLoop.expectedBlockers;t?t<n?i.setStatus(e+" ("+(n-t)+"/"+n+")"):i.setStatus(e):i.setStatus("")}},runIter:function(e){if(!_){if(i.preMainLoop&&!1===i.preMainLoop())return;try{e()}catch(e){if(e instanceof Ne)return;if("unwind"==e)return;throw e&&"object"==typeof e&&e.stack&&y("exception thrown: "+[e,e.stack]),e}i.postMainLoop&&i.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(i.preloadPlugins||(i.preloadPlugins=[]),!_e.initted){_e.initted=!0;try{new Blob,_e.hasBlobConstructor=!0}catch(e){_e.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}_e.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:_e.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),_e.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,i.noImageDecoding||void 0!==_e.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),i.noImageDecoding=!0);var e={canHandle:function(e){return!i.noImageDecoding&&/\\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,n,r){var o=null;if(_e.hasBlobConstructor)try{(o=new Blob([e],{type:_e.getMimetype(t)})).size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:_e.getMimetype(t)}))}catch(e){!function e(t){e.shown||(e.shown={}),e.shown[t]||(e.shown[t]=1,y(t))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!o){var a=new _e.BlobBuilder;a.append(new Uint8Array(e).buffer),o=a.getBlob()}var s=_e.URLObject.createObjectURL(o),u=new Image;u.onload=function(){E(u.complete,"Image "+t+" could not be decoded");var r=document.createElement("canvas");r.width=u.width,r.height=u.height,r.getContext("2d").drawImage(u,0,0),i.preloadedImages[t]=r,_e.URLObject.revokeObjectURL(s),n&&n(e)},u.onerror=function(e){console.log("Image "+s+" could not be decoded"),r&&r()},u.src=s}};i.preloadPlugins.push(e);var t={canHandle:function(e){return!i.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,n,r){var o=!1;function a(r){o||(o=!0,i.preloadedAudios[t]=r,n&&n(e))}function s(){o||(o=!0,i.preloadedAudios[t]=new Audio,r&&r())}if(!_e.hasBlobConstructor)return s();try{var u=new Blob([e],{type:_e.getMimetype(t)})}catch(e){return s()}var c=_e.URLObject.createObjectURL(u),l=new Audio;l.addEventListener("canplaythrough",(function(){a(l)}),!1),l.onerror=function(n){o||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),l.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="",r=0,o=0,i=0;i<e.length;i++)for(r=r<<8|e[i],o+=8;o>=6;){var a=r>>o-6&63;o-=6,n+=t[a]}return 2==o?(n+=t[(3&r)<<4],n+="=="):4==o&&(n+=t[(15&r)<<2],n+="="),n}(e),a(l))},l.src=c,_e.safeSetTimeout((function(){a(l)}),1e4)}};i.preloadPlugins.push(t);var n=i.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||function(){},n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),i.elementPointerLock&&n.addEventListener("click",(function(e){!_e.pointerLock&&i.canvas.requestPointerLock&&(i.canvas.requestPointerLock(),e.preventDefault())}),!1))}function r(){_e.pointerLock=document.pointerLockElement===i.canvas||document.mozPointerLockElement===i.canvas||document.webkitPointerLockElement===i.canvas||document.msPointerLockElement===i.canvas}},createContext:function(e,t,n,r){if(t&&i.ctx&&e==i.canvas)return i.ctx;var o,a;if(t){var s={antialias:!1,alpha:!1,majorVersion:1};if(r)for(var u in r)s[u]=r[u];"undefined"!=typeof GL&&(a=GL.createContext(e,s))&&(o=GL.getContext(a).GLctx)}else o=e.getContext("2d");return o?(n&&(t||E("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),i.ctx=o,t&&GL.makeContextCurrent(a),i.useWebGL=t,_e.moduleContextCreatedCallbacks.forEach((function(e){e()})),_e.init()),o):null},destroyContext:function(e,t,n){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){_e.lockPointer=e,_e.resizeCanvas=t,void 0===_e.lockPointer&&(_e.lockPointer=!0),void 0===_e.resizeCanvas&&(_e.resizeCanvas=!1);var n=i.canvas;function r(){_e.isFullscreen=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=_e.exitFullscreen,_e.lockPointer&&n.requestPointerLock(),_e.isFullscreen=!0,_e.resizeCanvas?_e.setFullscreenCanvasSize():_e.updateCanvasDimensions(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),_e.resizeCanvas?_e.setWindowedCanvasSize():_e.updateCanvasDimensions(n)),i.onFullScreen&&i.onFullScreen(_e.isFullscreen),i.onFullscreen&&i.onFullscreen(_e.isFullscreen)}_e.fullscreenHandlersInstalled||(_e.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",r,!1),document.addEventListener("mozfullscreenchange",r,!1),document.addEventListener("webkitfullscreenchange",r,!1),document.addEventListener("MSFullscreenChange",r,!1));var o=document.createElement("div");n.parentNode.insertBefore(o,n),o.appendChild(n),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?function(){o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),o.requestFullscreen()},exitFullscreen:function(){return!!_e.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===_e.nextRAF)_e.nextRAF=t+1e3/60;else for(;t+2>=_e.nextRAF;)_e.nextRAF+=1e3/60;var n=Math.max(_e.nextRAF-t,0);setTimeout(e,n)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,_e.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeCallback:function(e){return function(){if(!_)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){_e.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(_e.allowAsyncCallbacks=!0,_e.queuedAsyncCallbacks.length>0){var e=_e.queuedAsyncCallbacks;_e.queuedAsyncCallbacks=[],e.forEach((function(e){e()}))}},safeRequestAnimationFrame:function(e){return _e.requestAnimationFrame((function(){_||(_e.allowAsyncCallbacks?e():_e.queuedAsyncCallbacks.push(e))}))},safeSetTimeout:function(e,t){return g=!0,setTimeout((function(){_||(_e.allowAsyncCallbacks?e():_e.queuedAsyncCallbacks.push(e))}),t)},safeSetInterval:function(e,t){return g=!0,setInterval((function(){_||_e.allowAsyncCallbacks&&e()}),t)},getMimetype:function(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)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(_e.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?_e.mouseMovementX=_e.mouseMovementY=0:(_e.mouseMovementX=_e.getMovementX(e),_e.mouseMovementY=_e.getMovementY(e)),"undefined"!=typeof SDL?(_e.mouseX=SDL.mouseX+_e.mouseMovementX,_e.mouseY=SDL.mouseY+_e.mouseMovementY):(_e.mouseX+=_e.mouseMovementX,_e.mouseY+=_e.mouseMovementY);else{var t=i.canvas.getBoundingClientRect(),n=i.canvas.width,r=i.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(o+t.left),c=s.pageY-(a+t.top),l={x:u*=n/t.width,y:c*=r/t.height};if("touchstart"===e.type)_e.lastTouches[s.identifier]=l,_e.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var f=_e.touches[s.identifier];f||(f=l),_e.lastTouches[s.identifier]=f,_e.touches[s.identifier]=l}return}var d=e.pageX-(o+t.left),m=e.pageY-(a+t.top);d*=n/t.width,m*=r/t.height,_e.mouseMovementX=d-_e.mouseX,_e.mouseMovementY=m-_e.mouseY,_e.mouseX=d,_e.mouseY=m}},asyncLoad:function(e,t,n,r){var o=r?"":"al "+e;c(e,(function(n){E(n,\'Loading data file "\'+e+\'" failed (no arrayBuffer).\'),t(new Uint8Array(n)),o&&G()}),(function(t){if(!n)throw\'Loading data file "\'+e+\'" failed.\';n()})),o&&X()},resizeListeners:[],updateResizeListeners:function(){var e=i.canvas;_e.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,n){var r=i.canvas;_e.updateCanvasDimensions(r,e,t),n||_e.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e|=8388608,F[SDL.screen>>2]=e}_e.updateCanvasDimensions(i.canvas),_e.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e&=-8388609,F[SDL.screen>>2]=e}_e.updateCanvasDimensions(i.canvas),_e.updateResizeListeners()},updateCanvasDimensions:function(e,t,n){t&&n?(e.widthNative=t,e.heightNative=n):(t=e.widthNative,n=e.heightNative);var r=t,o=n;if(i.forcedAspectRatio&&i.forcedAspectRatio>0&&(r/o<i.forcedAspectRatio?r=Math.round(o*i.forcedAspectRatio):o=Math.round(r/i.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/r,screen.height/o);r=Math.round(r*a),o=Math.round(o*a)}_e.resizeCanvas?(e.width!=r&&(e.width=r),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=n&&(e.height=n),void 0!==e.style&&(r!=t||o!=n?(e.style.setProperty("width",r+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=_e.nextWgetRequestHandle;return _e.nextWgetRequestHandle++,e}},Ee={};function be(){if(!be.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var t in Ee)e[t]=Ee[t];var n=[];for(var t in e)n.push(t+"="+e[t]);be.strings=n}return be.strings}function ke(e){return e%4==0&&(e%100!=0||e%400==0)}function De(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var Me=[31,29,31,30,31,30,31,31,30,31,30,31],Fe=[31,28,31,30,31,30,31,31,30,31,30,31];function Le(e,t){for(var n=new Date(e.getTime());t>0;){var r=ke(n.getFullYear()),o=n.getMonth(),i=(r?Me:Fe)[o];if(!(t>i-n.getDate()))return n.setDate(n.getDate()+t),n;t-=i-n.getDate()+1,n.setDate(1),o<11?n.setMonth(o+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}var Se=[],Ae=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ve.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};function Pe(e,t,n){var r=n>0?n:C(e)+1,o=new Array(r),i=R(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(Ae.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}},isFolder:{get:function(){return ve.isDir(this.mode)}},isDevice:{get:function(){return ve.isChrdev(this.mode)}}}),ve.FSNode=Ae,ve.staticInit(),i.requestFullscreen=function(e,t){_e.requestFullscreen(e,t)},i.requestAnimationFrame=function(e){_e.requestAnimationFrame(e)},i.setCanvasSize=function(e,t,n){_e.setCanvasSize(e,t,n)},i.pauseMainLoop=function(){_e.mainLoop.pause()},i.resumeMainLoop=function(){_e.mainLoop.resume()},i.getUserMedia=function(){_e.getUserMedia()},i.createContext=function(e,t,n,r){return _e.createContext(e,t,n,r)},N.push({func:function(){Ce()}});var xe,Re={__cxa_allocate_exception:function(e){return ze(e+ce)+ce},__cxa_atexit:function(e,t){},__cxa_throw:function(e,t,n){throw new le(e).init(t,n),e},__sys_fcntl64:function(e,t,n){we.varargs=n;try{var r=we.getStreamFromFD(e);switch(t){case 0:return(o=we.get())<0?-28:ve.open(r.path,r.flags,0,o).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:var o=we.get();return r.flags|=o,0;case 12:return o=we.get(),M[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return i=28,F[Oe()>>2]=i,-1;default:return-28}}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}var i},__sys_getpid:function(){return 42},__sys_ioctl:function(e,t,n){we.varargs=n;try{var r=we.getStreamFromFD(e);switch(t){case 21509:case 21505:return r.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return r.tty?0:-59;case 21519:if(!r.tty)return-59;var o=we.get();return F[o>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:return o=we.get(),ve.ioctl(r,t,o);case 21523:case 21524:return r.tty?0:-59;default:V("bad ioctl syscall "+t)}}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}},__sys_open:function(e,t,n){we.varargs=n;try{var r=we.getStr(e),o=n?we.get():0;return ve.open(r,t,o).fd}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}},__sys_stat64:function(e,t){try{return e=we.getStr(e),we.doStat(ve.stat,e,t)}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}},__sys_symlink:function(e,t){try{return e=we.getStr(e),t=we.getStr(t),ve.symlink(e,t),0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}},__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},n=function(n,r){j(r,e+t[n])};return n("sysname","Emscripten"),n("nodename","emscripten"),n("release","1.0"),n("version","#1"),n("machine","x86-JS"),0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}},__sys_unlink:function(e){try{return e=we.getStr(e),ve.unlink(e),0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),-e.errno}},abort:function(){V()},emscripten_asm_const_int:function(e,t,n){var r=function(e,t){var n;for(Se.length=0,t>>=2;n=D[e++];){var r=n<105;r&&1&t&&t++,Se.push(r?S[t++>>1]:F[t]),++t}return Se}(t,n);return ne[e].apply(null,r)},emscripten_async_call:function(e,t,n){function r(){B.get(e)(t)}g=!0,n>=0?_e.safeSetTimeout(r,n):_e.safeRequestAnimationFrame(r)},emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){V("OOM")},emscripten_thread_sleep:function(e){for(var t=he();he()-t<e;);},environ_get:function(e,t){try{var n=0;return be().forEach((function(r,o){var i=t+n;F[e+4*o>>2]=i,j(r,i),n+=r.length+1})),0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),e.errno}},environ_sizes_get:function(e,t){try{var n=be();F[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),F[t>>2]=r,0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),e.errno}},exit:function(e){!function(e,t){t&&g&&0===e||(g||(i.onExit&&i.onExit(e),_=!0),m(e,new Ne(e)))}(e)},fd_close:function(e){try{var t=we.getStreamFromFD(e);return ve.close(t),0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),e.errno}},fd_read:function(e,t,n,r){try{var o=we.getStreamFromFD(e),i=we.doReadv(o,t,n);return F[r>>2]=i,0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),e.errno}},fd_seek:function(e,t,n,r,o){try{var i=we.getStreamFromFD(e),a=4294967296*n+(t>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(ve.llseek(i,a,r),Q=[i.position>>>0,(Z=i.position,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],F[o>>2]=Q[0],F[o+4>>2]=Q[1],i.getdents&&0===a&&0===r&&(i.getdents=null),0)}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),e.errno}},fd_write:function(e,t,n,r){try{var o=we.getStreamFromFD(e),i=we.doWritev(o,t,n);return F[r>>2]=i,0}catch(e){return void 0!==ve&&e instanceof ve.ErrnoError||V(e),e.errno}},gettimeofday:function(e){var t=Date.now();return F[e>>2]=t/1e3|0,F[e+4>>2]=t%1e3*1e3|0,0},localtime_r:function(e,t){!function e(){if(!e.called){e.called=!0;var t=(new Date).getFullYear(),n=new Date(t,0,1),r=new Date(t,6,1),o=n.getTimezoneOffset(),i=r.getTimezoneOffset(),a=Math.max(o,i);F[Ie()>>2]=60*a,F[Be()>>2]=Number(o!=i);var s=f(n),u=f(r),c=z(s),l=z(u);i<o?(F[je()>>2]=c,F[je()+4>>2]=l):(F[je()>>2]=l,F[je()+4>>2]=c)}function f(e){var t=e.toTimeString().match(/\\(([A-Za-z ]+)\\)$/);return t?t[1]:"GMT"}}();var n=new Date(1e3*F[e>>2]);F[t>>2]=n.getSeconds(),F[t+4>>2]=n.getMinutes(),F[t+8>>2]=n.getHours(),F[t+12>>2]=n.getDate(),F[t+16>>2]=n.getMonth(),F[t+20>>2]=n.getFullYear()-1900,F[t+24>>2]=n.getDay();var r=new Date(n.getFullYear(),0,1),o=(n.getTime()-r.getTime())/864e5|0;F[t+28>>2]=o,F[t+36>>2]=-60*n.getTimezoneOffset();var i=new Date(n.getFullYear(),6,1).getTimezoneOffset(),a=r.getTimezoneOffset(),s=0|(i!=a&&n.getTimezoneOffset()==Math.min(a,i));F[t+32>>2]=s;var u=F[je()+(s?4:0)>>2];return F[t+40>>2]=u,t},setTempRet0:function(e){},strftime_l:function(e,t,n,r){return function(e,t,n,r){var o=F[r+40>>2],i={tm_sec:F[r>>2],tm_min:F[r+4>>2],tm_hour:F[r+8>>2],tm_mday:F[r+12>>2],tm_mon:F[r+16>>2],tm_year:F[r+20>>2],tm_wday:F[r+24>>2],tm_yday:F[r+28>>2],tm_isdst:F[r+32>>2],tm_gmtoff:F[r+36>>2],tm_zone:o?x(o):""},a=x(n),s={"%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"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=n[0]+r;return r}function d(e,t){return f(e,t,"0")}function m(e,t){function n(e){return e<0?-1:e>0?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function p(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 h(e){var t=Le(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),o=p(n),i=p(r);return m(o,t)<=0?m(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return h(e).toString().substring(2)},"%G":function(e){return h(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+De(ke(e.tm_year+1900)?Me:Fe,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),n=0===t.getDay()?t:Le(t,7-t.getDay()),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(n,r)<0){var o=De(ke(r.getFullYear())?Me:Fe,r.getMonth()-1)-31,i=31-n.getDate()+o+r.getDate();return d(Math.ceil(i/7),2)}return 0===m(n,t)?"01":"00"},"%V":function(e){var t,n=new Date(e.tm_year+1900,0,4),r=new Date(e.tm_year+1901,0,4),o=p(n),i=p(r),a=Le(new Date(e.tm_year+1900,0,1),e.tm_yday);return m(a,o)<0?"53":m(i,a)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),d(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),n=1===t.getDay()?t:Le(t,0===t.getDay()?1:7-t.getDay()+1),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(n,r)<0){var o=De(ke(r.getFullYear())?Me:Fe,r.getMonth()-1)-31,i=31-n.getDate()+o+r.getDate();return d(Math.ceil(i/7),2)}return 0===m(n,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,n=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in g)a.indexOf(u)>=0&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var v=Pe(a,!1);return v.length>t?0:(O(v,e),v.length-1)}(e,t,n,r)},time:function(e){var t=Date.now()/1e3|0;return e&&(F[e>>2]=t),t}},Te=function(){var e={env:Re,wasi_snapshot_preview1:Re};function t(e,t){var n,r=e.exports;i.asm=r,v=i.asm.memory,n=v.buffer,b=n,i.HEAP8=k=new Int8Array(n),i.HEAP16=M=new Int16Array(n),i.HEAP32=F=new Int32Array(n),i.HEAPU8=D=new Uint8Array(n),i.HEAPU16=new Uint16Array(n),i.HEAPU32=L=new Uint32Array(n),i.HEAPF32=new Float32Array(n),i.HEAPF64=S=new Float64Array(n),B=i.asm.__indirect_function_table,G()}if(X(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}var n=function(e,t){var n,r,o;try{o=te(e),r=new WebAssembly.Module(o),n=new WebAssembly.Instance(r,t)}catch(e){var i=e.toString();throw y("failed to compile wasm module: "+i),(i.indexOf("imported Memory")>=0||i.indexOf("memory import")>=0)&&y("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)."),e}return[n,r]}(ee,e);return t(n[0],n[1]),i.asm}(),Ce=i.___wasm_call_ctors=Te.__wasm_call_ctors,ze=(i._bundle_adjust_message_callback=Te.bundle_adjust_message_callback,i._bundle_adjust_message=Te.bundle_adjust_message,i._malloc=Te.malloc),Oe=(i._free=Te.free,i.___errno_location=Te.__errno_location),je=(i._ntohs=Te.ntohs,i._htons=Te.htons,i._htonl=Te.htonl,i._usleep=Te.usleep,i.__get_tzname=Te._get_tzname),Be=i.__get_daylight=Te._get_daylight,Ie=i.__get_timezone=Te._get_timezone;function Ne(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function qe(e){function t(){xe||(xe=!0,i.calledRun=!0,_||(i.noFSInit||ve.init.initialized||ve.init(),me.init(),re(N),ve.ignorePermissions=!1,re(q),r(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),Y.unshift(e);var e;re(Y)}()))}e=e||f,U>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),I.unshift(e);var e;re(I)}(),U>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}if(i._emscripten_main_thread_process_queued_calls=Te.emscripten_main_thread_process_queued_calls,i.stackSave=Te.stackSave,i.stackRestore=Te.stackRestore,i.stackAlloc=Te.stackAlloc,i._setThrew=Te.setThrew,i.dynCall_viijii=Te.dynCall_viijii,i.dynCall_ji=Te.dynCall_ji,i.dynCall_jiji=Te.dynCall_jiji,i.dynCall_iiiiij=Te.dynCall_iiiiij,i.dynCall_iiiiijj=Te.dynCall_iiiiijj,i.dynCall_iiiiiijj=Te.dynCall_iiiiiijj,W=function e(){xe||qe(),xe||(W=e)},i.run=qe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return g=!0,qe(),t});t.default=r}.call(this,n(3).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,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(r,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))},n(4),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,n(0))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},d.clearImmediate=m}function m(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{m(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(0),n(5))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&m())}function m(){if(!l){var e=s(d);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,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(m)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}]);',"Worker",void 0,r.p+"9c0b0dcf514b48c05541.bundleworker.js")}},function(e,t,r){"use strict";r.r(t),t.default=r.p+"1ec038c18c27f4adf35917a8175401f0.wasm"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MsgManager=void 0;const n=r(9);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";r.r(t);var n=r(5),a=r.n(n);t.default=function(){return a()('!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"}]);',"Worker",void 0,r.p+"zappar-cv.worker.js")}},function(e,t,r){"use strict";r.r(t),t.default=r.p+"d115e485cffe500afc4f7c1272ea8f62.wasm"},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{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.permissionDeniedUI=t.permissionRequestUI=t.permissionRequestMotion=t.permissionRequestCamera=t.permissionRequestAll=t.permissionGrantedAll=t.permissionDeniedAny=t.permissionDeniedMotion=t.permissionDeniedCamera=t.permissionGrantedMotion=t.permissionGrantedCamera=void 0;let a=new(r(10).UAParser),i=!1,o=!1,s=!1,c=!1;function u(){return n(this,void 0,void 0,(function*(){if(navigator.permissions&&navigator.permissions.query)try{let e=yield navigator.permissions.query({name:"camera"});s="denied"===e.state,i="granted"===e.state}catch(e){}}))}function _(){return s||c}function f(){return i&&o}function l(){return n(this,void 0,void 0,(function*(){yield h(),yield d()}))}function d(){return n(this,void 0,void 0,(function*(){try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(e=>e.stop()),i=!0,s=!1}catch(e){i=!1,s=!0}}))}function h(){return n(this,void 0,void 0,(function*(){if(window.DeviceOrientationEvent&&window.DeviceOrientationEvent.requestPermission){if("granted"!==(yield window.DeviceOrientationEvent.requestPermission()))return o=!1,c=!0,!1}o=!0,c=!1}))}window.DeviceOrientationEvent&&window.DeviceOrientationEvent.requestPermission||(o=!0),u(),t.permissionGrantedCamera=function(){return i},t.permissionGrantedMotion=function(){return o},t.permissionDeniedCamera=function(){return s},t.permissionDeniedMotion=function(){return c},t.permissionDeniedAny=_,t.permissionGrantedAll=f,t.permissionRequestAll=l,t.permissionRequestCamera=d,t.permissionRequestMotion=h,t.permissionRequestUI=function(){return n(this,void 0,void 0,(function*(){if(yield u(),f())return!0;let e=document.createElement("div");e.classList.add("zappar-permission-request"),e.innerHTML='\n <style>\n .zappar-permission-request {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.9);\n font-family: sans-serif;\n color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .zappar-inner {\n max-width: 400px;\n text-align: center;\n }\n .zappar-title {\n font-size: 20px;\n }\n .zappar-text {\n font-size: 14px;\n padding: 15px;\n }\n .zappar-inner > button {\n background: none;\n outline: none;\n border: 2px solid white;\n border-radius: 10px;\n color: white;\n padding: 10px 40px;\n text-transform: uppercase;\n }\n </style>\n <div class="zappar-inner">\n <div class="zappar-title">Almost there...</div>\n <div class="zappar-text">In order to provide this augmented reality experience, we need access to your device\'s camera and motion sensors.</div>\n <button id="zappar-permission-request-button">Grant Access</button>\n </div>\n',document.body.append(e);let t=e.querySelector("#zappar-permission-request-button");return yield new Promise(r=>{null==t||t.addEventListener("click",()=>n(this,void 0,void 0,(function*(){for(yield l(),e.remove();;){if(yield new Promise(e=>requestAnimationFrame(()=>e())),_())return void r(!1);if(f())return void r(!0)}})))})}))},t.permissionDeniedUI=function(){switch(a.getBrowser().name){case"Chrome":!function(){let e=document.createElement("div");e.classList.add("zappar-permission-request"),e.innerHTML='\n <style>\n .zappar-permission-request {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.9);\n font-family: sans-serif;\n color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .zappar-inner {\n width: 400px;\n text-align: center;\n }\n .zappar-title {\n font-size: 20px;\n }\n .zappar-text {\n font-size: 14px;\n padding: 15px;\n }\n .zappar-inner > button {\n background: none;\n outline: none;\n border: 2px solid white;\n border-radius: 10px;\n color: white;\n padding: 10px 40px;\n text-transform: uppercase;\n }\n </style>\n <div class="zappar-inner">\n <div class="zappar-title">Permission is Needed</div>\n <div class="zappar-text">Permission to access your device\'s camera and motion sensors is necessary for this experience.<br/><br/>To grant access, please tap the ! button in the address bar of your browser, then "Site settings", and finally "Clear and reset". You can then reload the page to try again.</div>\n <button id="zappar-permission-reload-button">Reload</button>\n </div>\n',document.body.append(e);let t=e.querySelector("#zappar-permission-reload-button");null==t||t.addEventListener("click",()=>window.location.reload())}();break;default:!function(){let e=document.createElement("div");e.classList.add("zappar-permission-request"),e.innerHTML='\n <style>\n .zappar-permission-request {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.9);\n font-family: sans-serif;\n color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .zappar-inner {\n max-width: 400px;\n text-align: center;\n }\n .zappar-title {\n font-size: 20px;\n }\n .zappar-text {\n font-size: 14px;\n padding: 15px;\n }\n .zappar-inner > button {\n background: none;\n outline: none;\n border: 2px solid white;\n border-radius: 10px;\n color: white;\n padding: 10px 40px;\n text-transform: uppercase;\n }\n </style>\n <div class="zappar-inner">\n <div class="zappar-title">Permission is Needed</div>\n <div class="zappar-text">Permission to access your device\'s camera and motion sensors is necessary for this experience. Please reload the page to try again.</div>\n <button id="zappar-permission-reload-button">Reload</button>\n </div>\n',document.body.append(e);let t=e.querySelector("#zappar-permission-reload-button");null==t||t.addEventListener("click",()=>window.location.reload())}()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FaceMesh=t.getFaceMesh=t.destroyFaceMesh=t.createFaceMesh=void 0;const n=r(1),a=r(0);let i=1,o=new Map;t.createFaceMesh=function(){let e=i++;return o.set(e,new s),a.zcout("face_mesh_t initialized"),e},t.destroyFaceMesh=function(e){o.delete(e)},t.getFaceMesh=function(e){return o.get(e)};class s{constructor(){this.render_mean_=new Float32Array,this.render_identity_=new Float32Array(50),this.render_expression_=new Float32Array(29),this.render_uvs_=new Float32Array,this.render_indices_=new Uint16Array,this.vertices_=new Float32Array,this.normals_=new Float32Array,this.normalsCalculated_=!1,this.modelVersion_=-1,this.mirrored_=!1}loadFromMemory(e,t,r,n,a){let i=0,o=new Uint16Array(e),s=new Int32Array(e),c=new Float32Array(e),u=()=>{let e=s[i++]*s[i++],t=c.subarray(i,i+e);return i+=e,t},_=()=>{let e=s[i++],t=o.subarray(2*i,2*i+e);return i+=e/2,t};this.render_mean_=u(),this.render_identity_=u(),this.render_expression_=u(),this.render_uvs_=u();let f=_(),l=i<s.length?_():new Uint16Array,d=i<s.length?_():new Uint16Array,h=i<s.length?_():new Uint16Array,m=i<s.length?_():new Uint16Array;if(t||r||n||a){let e=f.length;t&&(e+=l.length),r&&(e+=d.length),n&&(e+=h.length),a&&(e+=m.length),this.render_indices_=new Uint16Array(e),this.render_indices_.set(f,0);let i=f.length;t&&(this.render_indices_.set(l,i),i+=l.length),r&&(this.render_indices_.set(d,i),i+=d.length),n&&(this.render_indices_.set(h,i),i+=h.length),a&&(this.render_indices_.set(m,i),i+=m.length)}else this.render_indices_=f;this.vertices_=new Float32Array(this.render_mean_),this.normals_=new Float32Array(this.vertices_.length),this.modelVersion_++}getVertices(){return this.vertices_}getUVs(){return this.render_uvs_}getIndices(){if(this.mirrored_){if(!this.render_indices_reversed){this.render_indices_reversed=new Uint16Array(this.render_indices_.length);for(let e=0;e<this.render_indices_.length;e+=3)this.render_indices_reversed[e]=this.render_indices_[e+2],this.render_indices_reversed[e+1]=this.render_indices_[e+1],this.render_indices_reversed[e+2]=this.render_indices_[e]}return this.render_indices_reversed}return this.render_indices_}getNormals(){return this.normalsCalculated_||this.calculateNormals(),this.normals_}getModelVersion(){return this.modelVersion_}getLandmarkDataForVertex(e){let t=[this.render_mean_[3*e],this.render_mean_[3*e+1],this.render_mean_[3*e+2]],r=[];for(let t=0;t<50;t++)r.push(this.render_identity_[3*e*50+t]),r.push(this.render_identity_[50*(3*e+1)+t]),r.push(this.render_identity_[50*(3*e+2)+t]);let n=[];for(let t=0;t<29;t++)n.push(this.render_expression_[3*e*29+t]),n.push(this.render_expression_[29*(3*e+1)+t]),n.push(this.render_expression_[29*(3*e+2)+t]);return{mean:t,identity:r,expression:n}}update(e,t,r){if(0!==this.render_mean_.length&&0!==this.render_identity_.length&&0!==this.render_expression_.length){this.mirrored_=r,this.vertices_.set(this.render_mean_);for(let t=0;t<e.length;t++)for(let r=0;r<this.vertices_.length;r++)this.vertices_[r]+=e[t]*this.render_identity_[r*e.length+t];for(let e=0;e<t.length;e++)for(let r=0;r<this.vertices_.length;r++)this.vertices_[r]+=t[e]*this.render_expression_[r*t.length+e];if(r)for(let e=0;e<this.vertices_.length;e+=3)this.vertices_[e]*=-1;this.normalsCalculated_=!1}}calculateNormals(){let e=this.getIndices(),t=this.vertices_,r=new Float32Array(e.length);if(!t)return;let a=e.length,i=this.normals_,o=new Float32Array([0,0,0]),s=new Float32Array([0,0,0]),c=new Float32Array([0,0,0]);for(let i=0;i<a;i+=3){let a=3*e[i],u=3*e[i+1],_=3*e[i+2];o[0]=t[u]-t[a],o[1]=t[u+1]-t[a+1],o[2]=t[u+2]-t[a+2],s[0]=t[_]-t[a],s[1]=t[_+1]-t[a+1],s[2]=t[_+2]-t[a+2],n.vec3.cross(c,o,s);let f=n.vec3.length(c);r[i]=c[0]/f,r[i+1]=c[1]/f,r[i+2]=c[2]/f}i.fill(0);for(let t=0;t<a;t+=3){let n=3*e[t],a=3*e[t+1],o=3*e[t+2];i[n]+=r[t],i[n+1]+=r[t+1],i[n+2]+=r[t+2],i[a]+=r[t],i[a+1]+=r[t+1],i[a+2]+=r[t+2],i[o]+=r[t],i[o+1]+=r[t+1],i[o+2]+=r[t+2]}let u=i.length/3;for(let e=0;e<u;e++){let t=3*e;o[0]=i[t],o[1]=i[t+1],o[2]=i[t+2],n.vec3.normalize(s,o),i[t]=s[0],i[t+1]=s[1],i[t+2]=s[2]}this.normalsCalculated_=!0}}t.FaceMesh=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cameraFrameTextureMatrix=t.CameraDraw=void 0;const n=r(2),a=r(1);t.CameraDraw=class{constructor(e){this._gl=e}dispose(){this._vbo&&this._gl.deleteBuffer(this._vbo),this._vbo=void 0,this._shader&&this._gl.deleteProgram(this._shader.prog),this._shader=void 0}_generate(e,t){if(this._vbo)return this._vbo;if(this._vbo||(this._vbo=e.createBuffer()),!this._vbo)throw new Error("Unable to create buffer object");let r=new Float32Array([-1,-1,0,0,0,-1,1,0,0,1,1,-1,0,1,0,1,-1,0,1,0,-1,1,0,0,1,1,1,0,1,1]);return e.bindBuffer(e.ARRAY_BUFFER,this._vbo),e.bufferData(e.ARRAY_BUFFER,new Float32Array(r),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),this._vbo}drawCameraFrame(e,t,r,n){if(!r.texture)return;let a=this._gl;a.disable(a.DEPTH_TEST),a.disable(a.SCISSOR_TEST),a.disable(a.CULL_FACE),a.disable(a.BLEND);let i=this._getCameraShader(a),o=this._generate(a,r);a.activeTexture(a.TEXTURE0),a.useProgram(i.prog),a.uniformMatrix4fv(i.unif_skinTexTransform,!1,s(r.dataWidth,r.dataHeight,e,t,r.uvTransform,n)),a.uniform1i(i.unif_skinSampler,0),a.bindTexture(a.TEXTURE_2D,r.texture),a.bindBuffer(a.ARRAY_BUFFER,o),a.vertexAttribPointer(i.attr_position,3,a.FLOAT,!1,20,0),a.enableVertexAttribArray(i.attr_position),a.vertexAttribPointer(i.attr_texCoord,2,a.FLOAT,!1,20,12),a.enableVertexAttribArray(i.attr_texCoord),a.drawArrays(a.TRIANGLES,0,6),a.disableVertexAttribArray(i.attr_position),a.disableVertexAttribArray(i.attr_texCoord),a.bindTexture(a.TEXTURE_2D,null),a.bindBuffer(a.ARRAY_BUFFER,null),a.useProgram(null)}_getCameraShader(e){if(this._shader)return this._shader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n.compileShader(e,e.VERTEX_SHADER,i),a=n.compileShader(e,e.FRAGMENT_SHADER,o);e.attachShader(t,r),e.attachShader(t,a),n.linkProgram(e,t);let s=e.getUniformLocation(t,"skinTexTransform");if(!s)throw new Error("Unable to get uniform location skinTexTransform");let c=e.getUniformLocation(t,"skinSampler");if(!c)throw new Error("Unable to get uniform location skinSampler");return this._shader={prog:t,unif_skinTexTransform:s,unif_skinSampler:c,attr_position:e.getAttribLocation(t,"position"),attr_texCoord:e.getAttribLocation(t,"texCoord")},this._shader}};let i="\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nattribute vec4 position;\nattribute vec4 texCoord;\nvarying vec4 skinTexVarying;\nuniform mat4 skinTexTransform;\n\nvoid main()\n{\n gl_Position = position;\n skinTexVarying = skinTexTransform * texCoord;\n}",o="\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying vec4 skinTexVarying;\nuniform lowp sampler2D skinSampler;\n\nvoid main()\n{\n gl_FragColor = texture2DProj(skinSampler, skinTexVarying);\n}";function s(e,t,r,n,i,o){let s=a.mat4.create(),c=a.mat4.create();a.mat4.fromTranslation(c,[-.5,-.5,0]),a.mat4.multiply(s,c,s),o&&(a.mat4.fromScaling(c,[-1,1,1]),a.mat4.multiply(s,c,s)),a.mat4.fromRotation(c,-1*function(){if(window.screen.orientation)switch(window.screen.orientation.type){case"portrait-primary":return 270;case"landscape-secondary":return 180;case"portrait-secondary":return 90;default:return 0}else if(void 0!==window.orientation)switch(window.orientation){case 0:return 270;case 90:return 0;case 180:return 90;case-90:return 180}return 0}()*Math.PI/180,[0,0,1]),a.mat4.multiply(s,c,s);let u=a.vec3.create();u[0]=r,u[1]=n,u[2]=0,a.vec3.transformMat4(u,u,c);let _=Math.abs(u[0]),f=Math.abs(u[1]);a.mat4.fromScaling(c,[1,-1,1]),a.mat4.multiply(s,c,s);let l=_/f,d=e/t;return l>d?a.mat4.fromScaling(c,[1,d/l,1]):a.mat4.fromScaling(c,[l/d,1,1]),a.mat4.multiply(s,c,s),a.mat4.fromTranslation(c,[.5,.5,0]),a.mat4.multiply(s,c,s),a.mat4.multiply(s,i,s),s}t.cameraFrameTextureMatrix=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FaceDraw=void 0;const n=r(2);t.FaceDraw=class{constructor(e){this._gl=e}dispose(){this._vbo&&this._gl.deleteBuffer(this._vbo),this._normalbo&&this._gl.deleteBuffer(this._normalbo),this._ibo&&this._gl.deleteBuffer(this._ibo),this._shader&&this._gl.deleteProgram(this._shader.prog),this._vbo=void 0,this._normalbo=void 0,this._ibo=void 0,this._shader=void 0}_generateIBO(e,t){if(this._ibo&&this._lastIndices===e)return this._ibo;if(this._lastIndices=e,this._ibo||(this._ibo=t.createBuffer()),!this._ibo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._ibo),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),this._ibo}_generateVBO(e,t){if(this._vbo||(this._vbo=t.createBuffer()),!this._vbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._vbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._vbo}_generateNormalBO(e,t){if(this._normalbo||(this._normalbo=t.createBuffer()),!this._normalbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._normalbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._normalbo}drawFace(e,t){let r=this._gl,n=this._getShader(r),a=this._generateVBO(t.getVertices(),r),i=this._generateNormalBO(t.getNormals(),r),o=this._generateIBO(t.getIndices(),r);r.enable(r.DEPTH_TEST),r.enable(r.CULL_FACE),r.useProgram(n.prog),r.uniformMatrix4fv(n.unif_matrix,!1,e),r.bindBuffer(r.ARRAY_BUFFER,a),r.vertexAttribPointer(n.attr_position,3,r.FLOAT,!1,12,0),r.enableVertexAttribArray(n.attr_position),r.bindBuffer(r.ARRAY_BUFFER,i),r.vertexAttribPointer(n.attr_normal,3,r.FLOAT,!1,12,0),r.enableVertexAttribArray(n.attr_normal),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o),r.drawElements(r.TRIANGLES,t.getIndices().length,r.UNSIGNED_SHORT,0),r.disableVertexAttribArray(n.attr_position),r.disableVertexAttribArray(n.attr_normal),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null)}_getShader(e){if(this._shader)return this._shader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n.compileShader(e,e.VERTEX_SHADER,a),o=n.compileShader(e,e.FRAGMENT_SHADER,i);e.attachShader(t,r),e.attachShader(t,o),n.linkProgram(e,t);let s=e.getUniformLocation(t,"matrix");if(!s)throw new Error("Unable to get uniform location mattrix");return this._shader={prog:t,unif_matrix:s,attr_position:e.getAttribLocation(t,"position"),attr_normal:e.getAttribLocation(t,"normal")},this._shader}};let a="\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nuniform mat4 matrix;\nattribute vec4 position;\nattribute vec3 normal;\nvarying highp vec3 vnormal;\n\nvoid main()\n{\n gl_Position = matrix * position;\n vnormal = normal;\n}",i="\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying vec4 skinTexVarying;\nvarying highp vec3 vnormal;\nuniform lowp sampler2D skinSampler;\n\nvoid main()\n{\n vec3 normal2 = 0.5 * vnormal + 0.5;\n gl_FragColor = vec4(normal2.x , normal2.y, normal2.z, 1.0);\n}"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FaceDrawProject=void 0;const n=r(2);t.FaceDrawProject=class{constructor(e){this._gl=e}dispose(){this._vbo&&this._gl.deleteBuffer(this._vbo),this._uvbo&&this._gl.deleteBuffer(this._uvbo),this._ibo&&this._gl.deleteBuffer(this._ibo),this._shader&&this._gl.deleteProgram(this._shader.prog),this._vbo=void 0,this._uvbo=void 0,this._ibo=void 0,this._shader=void 0}_generateIBO(e,t){if(this._ibo&&this._lastIndices===e)return this._ibo;if(this._lastIndices=e,this._ibo||(this._ibo=t.createBuffer()),!this._ibo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._ibo),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),this._ibo}_generateVBO(e,t){if(this._vbo||(this._vbo=t.createBuffer()),!this._vbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._vbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._vbo}_generateUVBO(e,t){if(this._uvbo||(this._uvbo=t.createBuffer()),!this._uvbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._uvbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._uvbo}drawFace(e,t,r,n,a,i){let o=this._gl,s=this._getShader(o),c=this._generateVBO(t,o),u=this._generateUVBO(n,o),_=this._generateIBO(a,o);o.enable(o.DEPTH_TEST),o.enable(o.CULL_FACE),o.useProgram(s.prog),o.uniformMatrix4fv(s.unif_matrix,!1,e),o.uniformMatrix4fv(s.unif_uvmatrix,!1,r),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,i),o.uniform1i(s.unif_sampler,0),o.bindBuffer(o.ARRAY_BUFFER,c),o.vertexAttribPointer(s.attr_position,3,o.FLOAT,!1,12,0),o.enableVertexAttribArray(s.attr_position),o.bindBuffer(o.ARRAY_BUFFER,u),o.vertexAttribPointer(s.attr_uv,3,o.FLOAT,!1,12,0),o.enableVertexAttribArray(s.attr_uv),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,_),o.drawElements(o.TRIANGLES,6912,o.UNSIGNED_SHORT,0),o.disableVertexAttribArray(s.attr_position),o.disableVertexAttribArray(s.attr_uv),o.bindBuffer(o.ARRAY_BUFFER,null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,null)}_getShader(e){if(this._shader)return this._shader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n.compileShader(e,e.VERTEX_SHADER,a),o=n.compileShader(e,e.FRAGMENT_SHADER,i);e.attachShader(t,r),e.attachShader(t,o),n.linkProgram(e,t);let s=e.getUniformLocation(t,"matrix");if(!s)throw new Error("Unable to get uniform location matrix");let c=e.getUniformLocation(t,"uvmatrix");if(!c)throw new Error("Unable to get uniform location matrix");let u=e.getUniformLocation(t,"uSampler");if(!u)throw new Error("Unable to get uniform location sampler");return this._shader={prog:t,unif_matrix:s,unif_sampler:u,unif_uvmatrix:c,attr_position:e.getAttribLocation(t,"position"),attr_uv:e.getAttribLocation(t,"uv"),attr_texturecoord:e.getAttribLocation(t,"aTextureCoord")},this._shader}};let a="\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nuniform mat4 matrix;\nuniform mat4 uvmatrix;\nattribute vec4 position;\nattribute vec3 normal;\nattribute vec3 uv;\n\n// varying highp vec3 vnormal;\n\nvarying highp vec2 vTextureCoord;\nvarying highp float vAlpha;\n\nvoid main()\n{\n gl_Position = matrix * position;\n vec4 ret = uvmatrix * vec4(uv.x, uv.y, uv.z, 1.0);\n ret.x /= ret.w * 2.0;\n ret.y /= ret.w * 2.0;\n ret.x += 0.5;\n ret.y += 0.0;\n vAlpha = 1.0;\n vTextureCoord = ret.xy;\n}",i="\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying highp vec2 vTextureCoord;\nvarying highp vec3 vnormal;\nvarying highp float vAlpha;\nuniform lowp sampler2D uSampler;\n\nvoid main()\n{\n // vec3 normal2 = 0.5 * vnormal + 0.5;\n vec4 p = texture2D(uSampler, vTextureCoord);\n p.a = vAlpha;\n gl_FragColor = p; // vec4(normal2.x , normal2.y, normal2.z, 1.0);\n}"},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{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CameraSource=void 0;const a=r(13),i=r(15),o=r(4),s=r(6),c=r(0);let u=1,_=new Map,f=document.createElement("video");f.setAttribute("playsinline",""),f.setAttribute("webkit-playsinline",""),i.profile.videoElementInDOM&&(f.style.width="0px",f.style.height="0px",document.body.appendChild(f));class l extends a.HTMLElementSource{constructor(e,t,r){super(f,t),this._impl=e,this._deviceId=r,this._currentStream=null,this._activeDeviceId=null,this._hasStartedOrientation=!1,this._deviceMotionListener=e=>{let t=o.Pipeline.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.accelerationIncludingGravity&&null!==e.accelerationIncludingGravity.x&&null!==e.accelerationIncludingGravity.y&&null!==e.accelerationIncludingGravity.z&&t.motionAccelerometerSubmit(r,e.accelerationIncludingGravity.x*i.profile.deviceMotionMutliplier,e.accelerationIncludingGravity.y*i.profile.deviceMotionMutliplier,e.accelerationIncludingGravity.z*i.profile.deviceMotionMutliplier),null===e.rotationRate||null===e.rotationRate.alpha||null===e.rotationRate.beta||null===e.rotationRate.gamma||this._hasStartedOrientation?this._hasStartedOrientation||this._startDeviceOrientation():(e.timeStamp,t.motionRotationRateSubmit(r,e.rotationRate.alpha*Math.PI/-180,e.rotationRate.beta*Math.PI/-180,e.rotationRate.gamma*Math.PI/-180))}}static create(e,t){let r=u++;return _.set(r,new l(r,e,t)),c.zcout("camera_source_t initialized"),r}static get(e){return _.get(e)}destroy(){_.delete(this._impl),super.destroy()}_stop(){if(!this._currentStream)return;this._currentStream.getTracks().forEach(e=>e.stop()),this._currentStream=null}pause(){super.pause(),this._stopDeviceMotion(),this._syncCamera()}start(){super.start(),this._startDeviceMotion(),this._syncCamera()}_getConstraints(){return n(this,void 0,void 0,(function*(){let e,t;this._deviceId!==l.DEFAULT_DEVICE_ID&&this._deviceId!==l.USER_DEFAULT_DEVICE_ID?e=this._deviceId:t=this._deviceId===l.DEFAULT_DEVICE_ID?"environment":"user";let r={audio:!1,video:{facingMode:t,width:i.profile.videoWidth,height:i.profile.videoHeight,frameRate:i.profile.requestHighFrameRate?60:void 0,deviceId:e}};if(e)return r;if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return r;let n=yield navigator.mediaDevices.enumerateDevices(),a=!1;return n=n.filter(e=>{if("videoinput"!==e.kind)return!1;if(e.getCapabilities){a=!0;let r=e.getCapabilities();if(r&&r.facingMode&&r.facingMode.indexOf("user"===t?"user":"environment")<0)return!1}return!0}),a&&0!==n.length?("object"==typeof r.video&&(c.zcout("choosing device ID",n[n.length-1].deviceId),r.video.deviceId=n[n.length-1].deviceId),r):r}))}getFrame(e){return this._cameraToScreenRotation=s.cameraRotationForScreenOrientation(!1),super.getFrame(e)}_getUserMedia(){return n(this,void 0,void 0,(function*(){let e=yield this._getConstraints();return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?yield navigator.mediaDevices.getUserMedia(e):yield new Promise((t,r)=>{navigator.getUserMedia(e,t,r)})}))}_syncCamera(){return n(this,void 0,void 0,(function*(){if(this._currentStream&&this._isPaused)this._stop();else if(this._currentStream&&this._activeDeviceId!==this._deviceId&&this._stop(),!this._isPaused){if(this._activeDeviceId=this._deviceId,this._currentStream=yield this._getUserMedia(),this._isPaused)return void(yield this._syncCamera());if(this._isUserFacing=!1,this._currentStream){let e=this._currentStream.getVideoTracks();e.length>0&&(this._isUserFacing="user"===e[0].getSettings().facingMode)}if(!(this._video instanceof HTMLVideoElement))return;this._video.src="",this._video.loop=!1,this._video.muted=!0,this._video.srcObject=this._currentStream,this._video.play()}}))}_startDeviceOrientation(){this._hasStartedOrientation||(this._hasStartedOrientation=!0,this._deviceOrientationListener=e=>{let t=o.Pipeline.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.alpha&&null!==e.beta&&null!==e.gamma&&t.motionAttitudeSubmit(r,e.alpha,e.beta,e.gamma)},window.addEventListener("deviceorientation",this._deviceOrientationListener))}_startDeviceMotion(){window.addEventListener("devicemotion",this._deviceMotionListener,!1)}_stopDeviceMotion(){window.removeEventListener("devicemotion",this._deviceMotionListener),this._deviceOrientationListener&&window.removeEventListener("deviceorientation",this._deviceOrientationListener)}}t.CameraSource=l,l.USER_DEFAULT_DEVICE_ID="Simulated User Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b",l.DEFAULT_DEVICE_ID="Simulated Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FaceLandmark=t.getFaceLandmark=t.destroyFaceLandmark=t.createFaceLandmark=void 0;const n=r(1),a=r(35),i=r(0);let o=1,s=new Map;t.createFaceLandmark=function(e){let t=o++;return s.set(t,new c(e)),i.zcout("face_landmark_t initialized"),t},t.destroyFaceLandmark=function(e){s.delete(e)},t.getFaceLandmark=function(e){return s.get(e)};class c{constructor(e){this._name=e,this.anchor_pose=n.mat4.create()}_getVertex(e,t,r){let n=r.mean.slice();for(let t=0;t<50;t++)n[0]+=e[t]*r.identity[3*t+0],n[1]+=e[t]*r.identity[3*t+1],n[2]+=e[t]*r.identity[3*t+2];for(let e=0;e<29;e++)n[0]+=t[e]*r.expression[3*e+0],n[1]+=t[e]*r.expression[3*e+1],n[2]+=t[e]*r.expression[3*e+2];return n}update(e,t,r){let i,o=a.landmarkData[this._name.toString()];if(o){if(Array.isArray(o)){i=this._getVertex(e,t,o[0]);let r=this._getVertex(e,t,o[1]);i[0]=.5*(i[0]+r[0]),i[1]=.5*(i[1]+r[1]),i[2]=.5*(i[2]+r[2])}else i=this._getVertex(e,t,o);r&&(i[0]*=-1),n.mat4.fromTranslation(this.anchor_pose,i)}}}t.FaceLandmark=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.landmarkData=void 0,t.landmarkData={0:[{mean:[.235,.2344,.7305],identity:[.008,.0087,.0024,-.0026,6e-4,-.0022,5e-4,.0033,.0026,.0017,-.0055,-8e-4,.0011,.0059,0,2e-4,.001,-.001,-.0044,-.0011,-1e-4,.0024,.0019,-9e-4,4e-4,-.0015,0,.0038,.0013,3e-4,.002,-.0021,.0018,.0023,.0011,.0012,-.0011,-.0017,9e-4,-.0012,-8e-4,7e-4,-.0017,.0029,-.0029,8e-4,-.0027,8e-4,-.0017,4e-4,9e-4,-.001,-3e-4,8e-4,-.0016,-3e-4,-7e-4,.0016,-9e-4,.0021,-5e-4,.0011,-.0024,-1e-4,6e-4,1e-4,-.0026,-4e-4,-3e-4,-9e-4,5e-4,3e-4,-8e-4,-.001,-4e-4,-8e-4,.0022,-.0014,-1e-4,-.0023,0,-.0018,7e-4,-.0036,.0017,.0017,-.0018,-2e-4,-4e-4,-9e-4,-8e-4,3e-4,.0012,9e-4,-4e-4,-.0016,5e-4,-.0013,.0011,.0023,.0029,.0024,.0017,-.0027,-4e-4,-.001,-.0018,-.0015,-.001,.001,-.0013,-1e-4,-2e-4,7e-4,3e-4,3e-4,-.0016,9e-4,-.0021,4e-4,.0014,.002,-7e-4,-4e-4,2e-4,-4e-4,-6e-4,-9e-4,.0015,4e-4,-4e-4,5e-4,-.0015,9e-4,3e-4,3e-4,-2e-4,-8e-4,-9e-4,.0023,4e-4,1e-4,-4e-4,-1e-4,7e-4,2e-4,.001,1e-4,-.0029,-5e-4],expression:[0,3e-4,.0052,-7e-4,-.0051,-.0103,0,.0019,.0027,-.0054,.0135,.035,-5e-4,-6e-4,.0025,-.0045,-.0557,-.003,-.0191,-.1199,.0548,-.0036,-.0682,-.0167,2e-4,-.0085,-.0085,.0044,.0041,-.0568,.0044,.179,.0065,-.0017,-.1006,.0036,-.0267,-.3279,.0301,-.0011,-.0173,-.001,.0046,.2808,.0207,.0162,.238,-.0225,.0017,.1041,.0203,5e-4,.0161,.0031,-.0436,.6504,.0873,-.0099,.1039,.0048,-.0254,.2534,-.0042,.003,-.0106,-.0153,-.0118,.0252,9e-4,-.0071,.0099,.007,-.0724,.0461,-.0235,.0833,.004,.0141,-.0219,.0132,-.0042,-.0179,.0045,-.0215,.3638,.0054,-.0445]},{mean:[.2358,.1466,.7183],identity:[.0077,.0093,1e-4,-.0022,0,-.0041,5e-4,.0022,.0028,.0018,-.0038,-.0013,.001,.0044,-2e-4,0,.0017,-.0016,-.0043,-2e-4,-1e-4,.0023,9e-4,5e-4,-7e-4,-4e-4,-.0017,.003,7e-4,6e-4,.0011,-.0018,5e-4,.0018,-8e-4,4e-4,-.0023,-6e-4,-3e-4,-.0015,-.0014,-1e-4,-.0018,.0027,-.0026,3e-4,-.0031,.0011,-.0026,-.0011,.0012,-.0013,-2e-4,7e-4,-.0021,.0021,4e-4,.0012,-.001,.002,-3e-4,2e-4,-.0026,-3e-4,.001,1e-4,-.0018,-.001,9e-4,-.0011,.001,4e-4,-8e-4,-7e-4,-.001,-3e-4,7e-4,-5e-4,-6e-4,-.0019,-5e-4,-.002,7e-4,-.0027,.0014,.0013,6e-4,-5e-4,-3e-4,-3e-4,-.001,0,.0019,1e-4,6e-4,-.0012,4e-4,-9e-4,4e-4,.0025,3e-4,.0024,.0017,-9e-4,-.0015,-.0015,-.001,-.0023,-.001,-5e-4,-4e-4,8e-4,9e-4,7e-4,2e-4,7e-4,-9e-4,9e-4,-.0013,1e-4,9e-4,2e-4,6e-4,-6e-4,-8e-4,-4e-4,-7e-4,8e-4,.0019,3e-4,.0015,2e-4,-.0015,-3e-4,0,6e-4,3e-4,6e-4,-6e-4,2e-4,5e-4,-4e-4,.0012,-4e-4,2e-4,-8e-4,6e-4,-4e-4,2e-4,-.0021],expression:[-.0034,.0054,.0069,.004,6e-4,-.0104,-3e-4,.0036,.0025,.0065,.0296,.0208,-9e-4,.0154,.0029,-.0167,.0124,.004,-.0102,.0351,.028,-.019,.0146,-.0035,-.0023,-.0069,-.0051,-.01,.0262,-.028,.0112,.082,.023,-.0019,-.066,-.0104,-.0408,.0164,.0075,-.0074,.0367,.0041,.0517,-.0207,.0045,.0291,-.0672,-.0129,.0345,-.1558,-.0106,.0037,-.0437,-.0021,.0854,-.1121,.0187,.0041,.0072,.0011,.0193,-.0143,-.0119,.005,-.02,-.0122,-.008,.0527,.0036,-.006,.0222,.007,-.0429,.046,-.0046,.0226,-.0059,.0202,-.0173,.0087,0,-.0067,-.0095,-.0153,.1506,-.0017,.0021]}],1:[{mean:[-.2271,.2323,.7319],identity:[-.0084,.0097,.0018,.0041,2e-4,-.002,-.0012,.0036,.0019,-9e-4,-.0063,-.001,-3e-4,.0053,6e-4,1e-4,5e-4,-.0015,.0044,-.0025,-.0015,-.002,.0016,-6e-4,2e-4,-.0013,0,-.0022,2e-4,2e-4,-.0025,-.0014,.0015,8e-4,2e-4,.0012,6e-4,-6e-4,.0017,0,3e-4,-1e-4,.0024,.0025,-.0029,-.0015,-.0015,1e-4,.0031,-.0016,7e-4,.0019,6e-4,.002,9e-4,.001,-.0014,-.002,-.0015,.0029,1e-4,5e-4,-.0023,8e-4,-.0011,.0019,.0017,-3e-4,-.0011,-3e-4,.0011,-8e-4,.0019,-.0022,1e-4,.0015,.0017,-8e-4,-.0011,-.0022,3e-4,.0022,6e-4,-.003,-2e-4,0,-.0017,-2e-4,0,1e-4,4e-4,.0012,.0019,-.0014,4e-4,-.0017,-.0012,-.0011,.0021,-.0029,.0026,.0018,-.0023,-.0029,1e-4,.0014,-.0019,-4e-4,-4e-4,.0023,-.0016,0,-9e-4,.0014,-.0015,.0015,-.0016,-.0011,-.0022,1e-4,-.0018,.0027,-.0013,4e-4,-1e-4,-5e-4,.0011,-2e-4,.0015,5e-4,-9e-4,-1e-4,.0029,6e-4,0,-3e-4,7e-4,-8e-4,-5e-4,.0025,3e-4,2e-4,-8e-4,-1e-4,3e-4,0,.0014,2e-4,-.0024,1e-4],expression:[-.0025,-9e-4,.006,.004,-.0027,-.0113,-8e-4,.001,.0031,-.0016,.0144,.0382,-3e-4,-5e-4,.0035,-.0044,-.0511,-.0014,-7e-4,-.1007,.0582,-6e-4,-.0606,-.0165,5e-4,-.0087,-.0093,.0036,.0057,-.0576,-.0039,.1488,.0127,.0016,-.0666,-9e-4,-.0153,.3162,-.0445,-.0021,.0023,.0043,-.0033,.2382,.0063,-.0217,.167,-.039,.0097,-.1144,-.0189,-.0145,.6831,.0632,-.0012,-.1959,-.0133,4e-4,.1108,-3e-4,.0062,.2593,-.0161,-.0018,-.0051,-.012,.0162,.016,-.0022,-.0052,-.0201,.0101,.0115,.0365,-.024,-.0059,.0188,-.0336,.0352,.0224,-.0229,.0146,.0086,-.0273,-.0032,.0103,-.0112]},{mean:[-.2288,.1541,.7202],identity:[-.0082,.0101,2e-4,.0036,-7e-4,-.0037,-8e-4,.0024,.0022,-.0013,-.0045,-.0013,-6e-4,.0045,-4e-4,4e-4,.0012,-.0014,.0042,-.001,-7e-4,-.0019,3e-4,-2e-4,.0012,-4e-4,-.0012,-.0018,-4e-4,-1e-4,-.0014,-.0012,1e-4,1e-4,-.0017,.001,.0015,-1e-4,6e-4,1e-4,0,-6e-4,.0028,.0021,-.0025,-.002,-.0015,7e-4,.0028,-.0023,9e-4,.0013,1e-4,.0016,.0012,.0032,-6e-4,-.0013,-.0011,.0021,3e-4,-5e-4,-.0024,4e-4,-4e-4,.0014,.0015,-8e-4,-3e-4,3e-4,.0017,-6e-4,.002,-.0018,-3e-4,9e-4,1e-4,2e-4,-6e-4,-.0015,-4e-4,.0022,7e-4,-.0023,0,-2e-4,-2e-4,-3e-4,-1e-4,6e-4,-2e-4,6e-4,.0022,-3e-4,.0013,-.0014,-5e-4,-3e-4,.0013,-.0027,6e-4,.0025,-.0023,-8e-4,-.0013,.0017,-9e-4,-.0019,1e-4,8e-4,-7e-4,-4e-4,0,.001,-.001,.0019,-8e-4,-.0015,-6e-4,-2e-4,-.0011,8e-4,1e-4,9e-4,-8e-4,-4e-4,6e-4,7e-4,.0021,-4e-4,7e-4,-5e-4,.0021,-7e-4,-4e-4,-9e-4,8e-4,3e-4,1e-4,3e-4,1e-4,9e-4,.001,-5e-4,5e-4,-.001,.001,4e-4,-5e-4,-.0012],expression:[8e-4,.0037,.0078,-4e-4,5e-4,-.012,-2e-4,-.0046,.0033,-.0089,.0295,.0221,-.0024,-.0084,.0013,.0057,.0125,.0049,-.0036,.0373,.0285,.0115,.0135,-.0035,.0048,.0108,-.0033,.0106,.0281,-.0301,-.0082,.0803,.0244,-7e-4,-.0725,-.0105,-.0247,-.0036,-.0143,-.0045,-.029,2e-4,-.0303,.0093,-.0021,-.0196,-.0754,-.0211,.0326,.1246,.006,-.0804,-.1499,.0109,.0182,-.0029,-.0014,-.0035,.0072,-8e-4,-.0152,-.0108,-.0166,-.0073,-.0144,-.0095,.0101,.047,-.0018,-.004,-.0189,.0027,.0104,.0298,-.0042,-.0096,.0191,-.0217,.0228,.0226,-.0105,.0047,-.0048,-.0172,.0061,-.0043,-.0016]}],2:{mean:[.5396,.2028,.2496],identity:[.0204,.0146,-.0182,-.0052,.0158,-.0038,-.0025,-.0108,-.006,.0085,-.0044,.0029,.0042,.001,.0095,.0015,-.0034,-.0064,-.0057,7e-4,.0026,7e-4,.0037,-6e-4,.0037,.0026,.0024,5e-4,-.0019,-.0013,.003,-.0028,.0018,-9e-4,.002,-.0047,.004,-.003,.0031,-.0027,-.0026,-.0017,.0016,.0014,-4e-4,.0021,-.002,0,.0017,7e-4,-4e-4,-7e-4,-.0018,-9e-4,2e-4,-.0012,1e-4,-5e-4,-.0011,4e-4,2e-4,.0011,1e-4,8e-4,.0017,-.0013,.0025,.0017,.001,2e-4,3e-4,5e-4,-4e-4,-1e-4,-5e-4,7e-4,-.0022,-.0029,6e-4,-8e-4,-6e-4,6e-4,-5e-4,5e-4,.0013,3e-4,-5e-4,-.003,7e-4,2e-4,.0016,-4e-4,0,0,4e-4,1e-4,.0014,.0012,1e-4,4e-4,-1e-4,8e-4,9e-4,4e-4,-4e-4,9e-4,-2e-4,.001,9e-4,4e-4,1e-4,7e-4,7e-4,.001,-.0017,-8e-4,2e-4,.0017,-3e-4,-1e-4,4e-4,5e-4,7e-4,5e-4,-1e-4,-6e-4,-1e-4,1e-4,-3e-4,-7e-4,-2e-4,-5e-4,0,-3e-4,3e-4,8e-4,-2e-4,-3e-4,5e-4,1e-4,-7e-4,-.001,-2e-4,3e-4,4e-4,-1e-4,7e-4,0,4e-4,4e-4],expression:[1e-4,-4e-4,1e-4,0,5e-4,2e-4,0,0,3e-4,-2e-4,3e-4,5e-4,-1e-4,2e-4,8e-4,1e-4,-2e-4,-5e-4,-3e-4,6e-4,5e-4,0,1e-4,2e-4,1e-4,-1e-4,-6e-4,-2e-4,5e-4,0,-4e-4,4e-4,.0016,4e-4,-4e-4,-.0015,0,1e-4,1e-4,-3e-4,3e-4,.0019,-2e-4,7e-4,4e-4,4e-4,-8e-4,-.0015,.0013,-.0016,-.0069,4e-4,-6e-4,-.0019,0,-1e-4,5e-4,-3e-4,2e-4,.0014,-3e-4,6e-4,.0011,4e-4,-3e-4,-.0032,-6e-4,8e-4,.0025,-3e-4,3e-4,.0015,-1e-4,1e-4,3e-4,-1e-4,0,0,-3e-4,4e-4,.0019,1e-4,0,-8e-4,-1e-4,1e-4,5e-4]},3:{mean:[-.5464,.2141,.26],identity:[-.0207,.0172,-.0176,.0068,.0148,-.0051,.0042,-.0101,-.0058,-.0087,-.0059,.0045,-.0056,.0017,.0097,-.0048,-.004,-.0044,.0019,2e-4,.0041,-.0052,.0041,2e-4,-.0027,6e-4,.002,-.0027,-.0033,-6e-4,-.004,9e-4,-.0012,-1e-4,-.0026,.0021,-.003,-.0025,.0052,.0025,.0022,-1e-4,-8e-4,.0013,.001,4e-4,.0018,.0014,6e-4,-5e-4,-.0015,-.0039,.0014,-1e-4,8e-4,-2e-4,6e-4,-5e-4,-.0038,-.0012,-.0018,-3e-4,.001,9e-4,.0012,.0024,-.0024,-7e-4,-.0016,-.0016,3e-4,-.001,-.0014,-.0014,.001,-3e-4,-7e-4,-.0012,3e-4,6e-4,3e-4,-5e-4,3e-4,.0012,6e-4,-8e-4,4e-4,4e-4,8e-4,-2e-4,-.0014,3e-4,0,.0023,-3e-4,-.0012,-.0013,.0011,-2e-4,-.0014,-1e-4,.0014,0,3e-4,3e-4,-8e-4,-5e-4,-7e-4,-7e-4,-2e-4,3e-4,5e-4,2e-4,-1e-4,.0011,-.0014,1e-4,-.0015,-1e-4,-3e-4,0,-.001,-1e-4,-8e-4,8e-4,-8e-4,-2e-4,-.0011,-3e-4,-4e-4,1e-4,-2e-4,3e-4,-7e-4,0,3e-4,1e-4,-8e-4,5e-4,1e-4,4e-4,.0014,-6e-4,-.001,-3e-4,-2e-4,1e-4,-1e-4,-1e-4,7e-4],expression:[-3e-4,-1e-4,6e-4,4e-4,0,-7e-4,0,-3e-4,-2e-4,-4e-4,.0012,8e-4,1e-4,-5e-4,-7e-4,-4e-4,0,1e-4,-4e-4,.0017,7e-4,0,1e-4,3e-4,0,4e-4,4e-4,5e-4,1e-4,-.001,-7e-4,.0022,.0026,5e-4,-.0024,-.0023,0,1e-4,3e-4,0,-.0013,-.0015,6e-4,.0014,8e-4,-2e-4,-.0025,-.0023,-3e-4,.0049,.006,-2e-4,-7e-4,-2e-4,0,-.0019,-.0018,-2e-4,.0017,.0017,3e-4,.0015,7e-4,1e-4,-.0023,-.0036,2e-4,.0023,.0017,0,-5e-4,-3e-4,-3e-4,4e-4,2e-4,-1e-4,-3e-4,-5e-4,1e-4,.0018,.0025,1e-4,-6e-4,-.0011,0,1e-4,1e-4]},4:{mean:[.0018,.1864,.853],identity:[-.0011,.0134,.0085,9e-4,-.0025,-7e-4,-3e-4,.0033,4e-4,-5e-4,-.0047,-.002,7e-4,.0026,-.0069,-1e-4,.0036,.0072,5e-4,-8e-4,-.0047,4e-4,-8e-4,-.001,0,2e-4,-.0036,-2e-4,-.001,-.0048,-1e-4,.0018,.0044,-7e-4,-2e-4,.0043,3e-4,.002,-.0031,0,-7e-4,.0013,0,.0037,.0033,-.0016,-.0012,.002,-1e-4,-.0027,.0051,5e-4,8e-4,7e-4,-.0017,.0054,.0023,-3e-4,.0032,1e-4,0,7e-4,-5e-4,-.0011,2e-4,8e-4,0,-.0033,-8e-4,-7e-4,7e-4,.0033,5e-4,-3e-4,.0029,-1e-4,-.0024,-.0011,-.002,-.0015,-.0019,2e-4,7e-4,.0031,6e-4,.0012,0,0,-.0021,0,-9e-4,-.0011,-.0011,-2e-4,.0015,.001,.0013,8e-4,.001,-3e-4,9e-4,.0027,-2e-4,-.0011,-.0011,6e-4,7e-4,2e-4,1e-4,-5e-4,-.0022,.0011,-.0014,9e-4,3e-4,2e-4,0,-6e-4,-4e-4,-.0011,-7e-4,.001,-.0012,6e-4,-.0012,-.0015,3e-4,-9e-4,-.0013,-.0013,7e-4,.001,-.0011,-.0013,.0015,4e-4,1e-4,4e-4,-1e-4,-.0016,-.0016,9e-4,-7e-4,-.0024,5e-4,-1e-4,-.0017,-2e-4,3e-4,-9e-4],expression:[-.0017,.0019,.0097,.003,-.0103,-.0093,9e-4,6e-4,.0023,-.0017,-.0204,.0376,.0033,-.0034,.0033,-.0026,-.0322,.0396,-.0032,-.0947,.0942,-7e-4,-.0175,.0266,-.001,-6e-4,.0016,.0025,.0157,-.0142,-.0022,.037,.015,.0021,-.0102,-.0107,.0036,.0055,-.0051,.0021,3e-4,-3e-4,4e-4,-.0177,.0074,-6e-4,-.0357,.0149,-.0066,9e-4,.0013,-.0031,.0016,.0095,.002,.0052,.0035,-3e-4,.0053,-.0082,.002,.0022,-.0071,-.0011,5e-4,.0055,.0011,3e-4,-.0126,-4e-4,3e-4,-.0023,-.0015,.0059,.0063,-.0042,-.0023,.0055,.0019,.0017,-.0075,6e-4,-8e-4,.0018,.0012,.0012,-5e-4]},5:{mean:[-.002,-.0469,1.0039],identity:[-.0017,.0018,.0156,6e-4,-.0038,5e-4,4e-4,.0013,.002,-4e-4,-.0015,-.0051,5e-4,-7e-4,-.0055,-1e-4,-9e-4,.008,-2e-4,.0036,-.0053,4e-4,-.0026,-.0016,7e-4,9e-4,-.009,-3e-4,7e-4,-.0084,.0015,.0021,.0032,-.0015,.0018,.0046,-3e-4,-4e-4,-1e-4,8e-4,-.0044,-7e-4,-8e-4,7e-4,.0048,-.0024,-3e-4,.0024,2e-4,-.0051,.0058,-6e-4,.0028,.0018,-.0021,.0035,.0057,.0011,.0065,0,-2e-4,.0011,.003,-.0027,8e-4,7e-4,3e-4,-.0039,-.002,-2e-4,-.0015,.0034,.0012,-.0025,.0024,-2e-4,4e-4,-.0042,-.0024,-.001,-.0023,.0016,-7e-4,.0039,1e-4,-5e-4,.0018,3e-4,-2e-4,-9e-4,-.0015,3e-4,-7e-4,-1e-4,-2e-4,.0023,.0032,.002,-.0013,.0013,-.0038,.0045,1e-4,-.0031,1e-4,.0019,-1e-4,.0016,.0013,0,-.002,.0023,2e-4,.0011,.0018,-.0024,6e-4,-.0017,.002,-8e-4,-.0021,7e-4,.0011,8e-4,4e-4,-.001,.0012,2e-4,-6e-4,-.0027,-5e-4,.001,-9e-4,1e-4,-1e-4,8e-4,-.0011,.0022,-.001,-5e-4,-.0011,.0016,-.0015,8e-4,-3e-4,9e-4,.0013,-7e-4,-7e-4,-2e-4],expression:[-.0018,-.0168,.0088,.0389,.1026,.0414,.2201,-.0262,-.0016,-.0017,.0612,-.0298,-.0323,.0093,.0013,-.005,.2207,.1315,-4e-4,.0858,-.0303,-.0133,.015,-.008,.1454,.0114,.0177,-.0077,.1022,.0356,-.0023,.1088,.0232,.003,-.0706,.0347,-1e-4,.004,-.0011,.0397,-.0096,-.0033,.0029,-.01,-.0083,-6e-4,-.0135,.0016,-.0087,-.0019,.0022,-.004,-.0087,.0105,8e-4,-.005,.0069,.0028,.0409,-.0391,.003,.0103,.0051,.0026,.0776,-.0083,-.0062,-.0567,.0268,.0175,.0017,.0156,-.0043,.0299,-.0395,-.0015,.0051,-.0148,.0125,.0035,.0603,.0109,-.0645,-.0257,.002,6e-4,-8e-4]},6:{mean:[-6e-4,-.1542,.8789],identity:[-7e-4,-.0032,.01,0,-.0027,.0031,6e-4,5e-4,-6e-4,-3e-4,.0013,-.0049,-2e-4,-.002,-.0046,8e-4,-.0011,.0054,2e-4,.0043,-.0027,3e-4,-.0022,-.0019,8e-4,.0032,-.0069,0,4e-4,-.0071,.0016,.0027,.0039,-.0017,9e-4,.0031,-1e-4,-5e-4,-4e-4,7e-4,-.0026,-.0012,-5e-4,6e-4,2e-4,-.0014,-.0013,.0019,-2e-4,-.0053,.0031,-6e-4,.0016,.0023,-.0013,.0021,.0029,8e-4,.0052,0,4e-4,0,.0037,-.0026,3e-4,.002,-2e-4,-.0024,4e-4,-4e-4,-.0012,8e-4,7e-4,-.0023,5e-4,0,.0014,-.0022,-.0016,0,-.0012,8e-4,-7e-4,.0014,-6e-4,-.0012,-3e-4,2e-4,.0012,-3e-4,-.002,-1e-4,1e-4,-2e-4,-.0016,9e-4,.002,.0019,0,6e-4,-.0022,.0016,1e-4,-.0017,-.0013,.001,9e-4,-1e-4,.0011,3e-4,-7e-4,.0014,8e-4,.0013,.0011,-.002,0,-.0015,.0014,.001,-.0015,7e-4,3e-4,.001,-1e-4,.0012,7e-4,6e-4,-4e-4,-.0013,-.0012,-9e-4,-.0011,2e-4,-5e-4,5e-4,4e-4,2e-4,1e-4,0,5e-4,5e-4,-.0014,.0015,-9e-4,5e-4,.0014,-8e-4,-8e-4,.0012],expression:[8e-4,.0481,.1653,.0784,.1008,-.3992,.5088,-.02,.0542,.001,.3723,-.0151,-.0986,.0283,-.0033,-.0121,.2634,.1202,.0036,-.0529,-.0245,-.0297,-.1085,.0495,.3264,.0083,4e-4,-.0314,.1459,-.1142,-.003,1e-4,.1154,-.0035,-.0285,-.0184,-1e-4,.0012,.0035,.079,-.0103,.0043,.011,-.004,-.0774,-.0047,-.023,.0284,-.0048,-.001,.0149,-.0039,.0046,.0528,-6e-4,.0063,.0376,.0096,.0558,-.0295,0,-.0311,-.0634,.0062,.0176,-.0154,-.0109,-.1149,.0192,.0326,.0121,.0237,.0034,.0262,-.0778,.0014,-.0045,-.0203,.0077,.0588,.0575,.008,-.0557,-.0095,.0032,.0054,-.0042]},7:{mean:[.0038,-.2927,.833],identity:[6e-4,-.0109,.0073,-6e-4,-.0044,.0017,-1e-4,-.0022,-6e-4,-3e-4,.0065,-.0014,-6e-4,-.0051,-.0046,3e-4,-.0029,.003,2e-4,.0038,-6e-4,0,-.0012,6e-4,-4e-4,.0053,-.0075,-2e-4,-7e-4,-.0063,.0014,.0026,.0019,-.0022,.0018,.0028,-1e-4,-.0012,.0011,9e-4,.0019,-.0019,-1e-4,.0012,-.0022,-3e-4,-.0012,4e-4,-8e-4,3e-4,-3e-4,0,.0017,.0021,-4e-4,.0012,.0022,-3e-4,.0026,-3e-4,4e-4,-.0026,.0032,-.0019,3e-4,.0015,1e-4,-.0015,.0013,-1e-4,1e-4,-.0029,0,-2e-4,-.0028,-7e-4,.0019,-3e-4,-2e-4,.0012,9e-4,4e-4,-.001,-.002,-.0016,.0011,-1e-4,3e-4,.0021,2e-4,-.0014,-9e-4,-1e-4,0,-2e-4,-.001,.0015,.0018,1e-4,7e-4,8e-4,.0017,.001,-9e-4,1e-4,4e-4,.0023,-1e-4,.0012,1e-4,-8e-4,2e-4,.0018,6e-4,3e-4,1e-4,.0012,-3e-4,.002,-6e-4,0,-1e-4,-.0022,4e-4,5e-4,.0011,2e-4,-.0013,-.0023,6e-4,6e-4,-5e-4,-5e-4,9e-4,2e-4,2e-4,.0011,-3e-4,.0011,.0015,.0011,3e-4,2e-4,8e-4,-4e-4,-8e-4,3e-4,0,.0012,-1e-4],expression:[.026,.1107,.3257,.1917,.3206,-1.1348,1.0791,-.035,.1549,-.0103,.6953,1e-4,-.3262,.068,.0219,-.0044,.3643,.2178,.0168,-.2478,-.1321,-.0414,-.3782,-.0617,.5088,-.0031,-.0311,-.0497,.0948,-.385,.0148,-.2224,-.1415,-.0074,.0863,-.203,3e-4,-.0081,.0057,.1164,-.0039,.0015,-.0024,.0505,.1532,.0039,-.0148,-.0753,.0163,.0058,-.0339,.0036,.0252,-.0569,-.0041,.0163,-.0361,.0035,-.018,.1266,0,-.0163,-.0046,.0133,-.1656,.2134,.0191,.0057,.0734,.0681,.0039,-.0144,.029,-.074,-.046,.0122,.0072,-.0162,-.0349,-.1234,.0212,-.0355,.0535,.1218,.0043,-.024,.0016]},8:{mean:[-.0018,-.3037,.8491],identity:[2e-4,-.0112,.0077,-4e-4,-.0044,.0024,1e-4,-.0021,-4e-4,-4e-4,.0066,-.002,-4e-4,-.0052,-.0044,3e-4,-.0032,.0039,4e-4,.0042,-3e-4,2e-4,-.0012,-2e-4,-2e-4,.0052,-.0083,-1e-4,-8e-4,-.0056,.0017,.0024,.0019,-.0023,.002,.0027,-2e-4,-.0013,.002,9e-4,.0017,-.0028,-2e-4,.0012,-.0026,0,-.0016,2e-4,-5e-4,3e-4,-.001,-1e-4,.0016,.0016,-3e-4,.0012,.0012,-3e-4,.0027,-3e-4,3e-4,-.0026,.0037,-.0017,1e-4,.0016,1e-4,-.0015,.0024,1e-4,2e-4,-.0039,0,-3e-4,-.0033,-6e-4,.0017,-4e-4,-4e-4,.0012,.0018,2e-4,-.0012,-.002,-.0017,.0013,-.001,3e-4,.0021,4e-4,-.0012,-6e-4,-2e-4,0,-4e-4,-9e-4,.0016,.0017,4e-4,7e-4,7e-4,.001,9e-4,-8e-4,5e-4,5e-4,.0023,.001,.0013,2e-4,-4e-4,2e-4,.0017,8e-4,3e-4,-1e-4,9e-4,-4e-4,.0019,-5e-4,3e-4,0,-.0025,3e-4,3e-4,.0011,1e-4,-.0015,-.001,7e-4,7e-4,-7e-4,-7e-4,8e-4,0,1e-4,.0013,-4e-4,.0012,.0014,.0017,4e-4,2e-4,3e-4,-3e-4,-9e-4,1e-4,0,.001,-4e-4],expression:[-.0092,2.8809,1.416,.2018,1.1982,-.9351,1.4492,-.1902,.1749,.0305,-.167,-.1572,-.7354,-.0492,.0115,.0608,.2971,.1179,.0046,-.0997,-.0041,-.0104,.3379,-.1854,.009,.0366,-.0583,.0269,-.0029,-.4175,-8e-4,.1794,.0752,-.0135,.1158,.1234,5e-4,.003,-.0032,.1034,-.0504,-.0055,-.0076,-.0772,.224,.0047,.0229,-.1044,.0162,-.0161,-.0241,-.0083,-.1388,-.0434,-.0125,-.0997,-.0327,-.0111,.1576,-.3911,.0199,.2522,.142,.0059,-.0721,-.0045,.031,-.1136,-.1685,.0641,.0142,.0312,.0426,-.1366,.1011,.0101,-.0157,.0018,-.0103,-.0344,.0907,.0016,.1168,-.0806,.0104,-.0057,.0111]},9:[{mean:[.0038,-.2927,.833],identity:[6e-4,-.0109,.0073,-6e-4,-.0044,.0017,-1e-4,-.0022,-6e-4,-3e-4,.0065,-.0014,-6e-4,-.0051,-.0046,3e-4,-.0029,.003,2e-4,.0038,-6e-4,0,-.0012,6e-4,-4e-4,.0053,-.0075,-2e-4,-7e-4,-.0063,.0014,.0026,.0019,-.0022,.0018,.0028,-1e-4,-.0012,.0011,9e-4,.0019,-.0019,-1e-4,.0012,-.0022,-3e-4,-.0012,4e-4,-8e-4,3e-4,-3e-4,0,.0017,.0021,-4e-4,.0012,.0022,-3e-4,.0026,-3e-4,4e-4,-.0026,.0032,-.0019,3e-4,.0015,1e-4,-.0015,.0013,-1e-4,1e-4,-.0029,0,-2e-4,-.0028,-7e-4,.0019,-3e-4,-2e-4,.0012,9e-4,4e-4,-.001,-.002,-.0016,.0011,-1e-4,3e-4,.0021,2e-4,-.0014,-9e-4,-1e-4,0,-2e-4,-.001,.0015,.0018,1e-4,7e-4,8e-4,.0017,.001,-9e-4,1e-4,4e-4,.0023,-1e-4,.0012,1e-4,-8e-4,2e-4,.0018,6e-4,3e-4,1e-4,.0012,-3e-4,.002,-6e-4,0,-1e-4,-.0022,4e-4,5e-4,.0011,2e-4,-.0013,-.0023,6e-4,6e-4,-5e-4,-5e-4,9e-4,2e-4,2e-4,.0011,-3e-4,.0011,.0015,.0011,3e-4,2e-4,8e-4,-4e-4,-8e-4,3e-4,0,.0012,-1e-4],expression:[.026,.1107,.3257,.1917,.3206,-1.1348,1.0791,-.035,.1549,-.0103,.6953,1e-4,-.3262,.068,.0219,-.0044,.3643,.2178,.0168,-.2478,-.1321,-.0414,-.3782,-.0617,.5088,-.0031,-.0311,-.0497,.0948,-.385,.0148,-.2224,-.1415,-.0074,.0863,-.203,3e-4,-.0081,.0057,.1164,-.0039,.0015,-.0024,.0505,.1532,.0039,-.0148,-.0753,.0163,.0058,-.0339,.0036,.0252,-.0569,-.0041,.0163,-.0361,.0035,-.018,.1266,0,-.0163,-.0046,.0133,-.1656,.2134,.0191,.0057,.0734,.0681,.0039,-.0144,.029,-.074,-.046,.0122,.0072,-.0162,-.0349,-.1234,.0212,-.0355,.0535,.1218,.0043,-.024,.0016]},{mean:[-.0018,-.3037,.8491],identity:[2e-4,-.0112,.0077,-4e-4,-.0044,.0024,1e-4,-.0021,-4e-4,-4e-4,.0066,-.002,-4e-4,-.0052,-.0044,3e-4,-.0032,.0039,4e-4,.0042,-3e-4,2e-4,-.0012,-2e-4,-2e-4,.0052,-.0083,-1e-4,-8e-4,-.0056,.0017,.0024,.0019,-.0023,.002,.0027,-2e-4,-.0013,.002,9e-4,.0017,-.0028,-2e-4,.0012,-.0026,0,-.0016,2e-4,-5e-4,3e-4,-.001,-1e-4,.0016,.0016,-3e-4,.0012,.0012,-3e-4,.0027,-3e-4,3e-4,-.0026,.0037,-.0017,1e-4,.0016,1e-4,-.0015,.0024,1e-4,2e-4,-.0039,0,-3e-4,-.0033,-6e-4,.0017,-4e-4,-4e-4,.0012,.0018,2e-4,-.0012,-.002,-.0017,.0013,-.001,3e-4,.0021,4e-4,-.0012,-6e-4,-2e-4,0,-4e-4,-9e-4,.0016,.0017,4e-4,7e-4,7e-4,.001,9e-4,-8e-4,5e-4,5e-4,.0023,.001,.0013,2e-4,-4e-4,2e-4,.0017,8e-4,3e-4,-1e-4,9e-4,-4e-4,.0019,-5e-4,3e-4,0,-.0025,3e-4,3e-4,.0011,1e-4,-.0015,-.001,7e-4,7e-4,-7e-4,-7e-4,8e-4,0,1e-4,.0013,-4e-4,.0012,.0014,.0017,4e-4,2e-4,3e-4,-3e-4,-9e-4,1e-4,0,.001,-4e-4],expression:[-.0092,2.8809,1.416,.2018,1.1982,-.9351,1.4492,-.1902,.1749,.0305,-.167,-.1572,-.7354,-.0492,.0115,.0608,.2971,.1179,.0046,-.0997,-.0041,-.0104,.3379,-.1854,.009,.0366,-.0583,.0269,-.0029,-.4175,-8e-4,.1794,.0752,-.0135,.1158,.1234,5e-4,.003,-.0032,.1034,-.0504,-.0055,-.0076,-.0772,.224,.0047,.0229,-.1044,.0162,-.0161,-.0241,-.0083,-.1388,-.0434,-.0125,-.0997,-.0327,-.0111,.1576,-.3911,.0199,.2522,.142,.0059,-.0721,-.0045,.031,-.1136,-.1685,.0641,.0142,.0312,.0426,-.1366,.1011,.0101,-.0157,.0018,-.0103,-.0344,.0907,.0016,.1168,-.0806,.0104,-.0057,.0111]}],10:{mean:[-.007,-.6338,.7695],identity:[1e-4,-.0296,.0089,-6e-4,-.0073,-.0065,-1e-4,-.0029,-.0031,-2e-4,.0128,.0065,0,-.0116,-.014,-1e-4,-.0037,-.0052,-5e-4,.0028,.003,-4e-4,.0041,.0015,6e-4,.0088,-.0076,-.0011,-.0015,-.0073,7e-4,-.0011,.0019,-.0011,-5e-4,.0031,-1e-4,-.0018,9e-4,.0018,.0038,.0068,-4e-4,-1e-4,.0061,.0024,.0024,-.0066,-6e-4,.0051,.0014,.002,.005,-.0035,1e-4,-.0034,-.004,-7e-4,.001,-8e-4,1e-4,-5e-4,-.0021,2e-4,.0045,-.0043,-.0012,-.0024,-.0014,6e-4,.0034,.0027,-8e-4,-.0053,.0014,1e-4,.0013,-.0018,6e-4,-.0015,.0029,-2e-4,-.0035,1e-4,-.002,.0012,.0048,.0011,1e-4,-2e-4,-3e-4,-.0012,.0033,6e-4,.002,-.0033,4e-4,.0028,2e-4,8e-4,-1e-4,-.0018,8e-4,.0017,1e-4,9e-4,8e-4,3e-4,.0019,-.001,.001,-7e-4,-.0013,0,1e-4,.0032,-1e-4,1e-4,.0011,-4e-4,5e-4,-7e-4,.0018,-3e-4,2e-4,7e-4,8e-4,-.0014,7e-4,.0015,-6e-4,-1e-4,-4e-4,.0019,-9e-4,-6e-4,-6e-4,-.0012,2e-4,-.0012,-8e-4,4e-4,6e-4,-.0011,3e-4,9e-4,-4e-4,6e-4,-7e-4,-4e-4],expression:[-.0603,2.0527,1.9014,.1025,.6143,.3804,.7881,-.1023,-.0764,.0454,-.2487,-.5073,-.6704,-.031,-.0181,.0466,.0651,-.0726,-.0033,-.0022,.2944,.0101,.1669,-.5225,-.4685,.0236,.0079,.011,.2173,.4529,.0121,-.2104,-.0673,.0225,-.4023,.0317,-9e-4,.0076,-.0032,.0333,.0523,.0129,-.001,-.0319,-.0139,.0015,-.0044,.0247,-5e-4,.0161,.0061,.0074,.0776,-.0176,.007,.055,-.017,.0052,-.1819,.0294,-.0161,-.0337,.0226,-.008,-.0297,.1967,-.0095,.0383,.2039,.0434,.0271,-.0064,-.0037,-.0294,-.024,.0024,-.0137,-.0209,-.0031,.0628,.1003,-.0126,-.056,-.0097,-.0012,-.0041,.0162]},11:{mean:[.2505,.3833,.7793],identity:[.0098,.012,.0077,-6e-4,-3e-4,0,1e-4,.0082,-7e-4,.0019,-.0036,-.0012,2e-4,.0119,-.0039,.001,1e-4,.0031,-.0036,-.0059,-7e-4,.0026,.0028,-.0011,9e-4,-.0032,8e-4,.0029,.0043,3e-4,.0025,-9e-4,.0047,.0016,.0022,.0018,-.001,.0025,-.003,-.001,.0033,.0034,4e-4,-.0052,.0024,-2e-4,.001,-.0014,-6e-4,.0038,-.0015,-6e-4,-.001,-.0011,-4e-4,-.001,4e-4,-7e-4,.0036,-8e-4,-2e-4,-.0019,5e-4,3e-4,-6e-4,-.0024,-.0017,-.0014,6e-4,-4e-4,-.0031,-.0013,-6e-4,.0042,2e-4,-2e-4,-.002,-3e-4,8e-4,.0018,-5e-4,-6e-4,-2e-4,-6e-4,.0025,.0019,.001,8e-4,-.0015,-.0012,-1e-4,-6e-4,-4e-4,.0023,-.001,6e-4,-2e-4,-.001,0,-9e-4,-.002,-.0011,1e-4,0,-1e-4,5e-4,6e-4,9e-4,-6e-4,5e-4,8e-4,-1e-4,-2e-4,-.0017,-6e-4,-4e-4,4e-4,-6e-4,.0012,4e-4,3e-4,-7e-4,3e-4,-2e-4,6e-4,1e-4,5e-4,-.0019,-6e-4,4e-4,7e-4,-1e-4,1e-4,5e-4,.001,-6e-4,-.002,-7e-4,-5e-4,5e-4,3e-4,7e-4,.0014,0,5e-4,-5e-4,-2e-4,3e-4,-6e-4,-1e-4],expression:[-9e-4,-3e-4,.0032,-.003,-.0034,-.0031,.0014,0,4e-4,-.0139,-.0764,.0275,-.002,-.0089,.0031,-.0503,-.0771,.038,-.1323,-.3523,.1368,-.0474,-.0564,.0296,-.0045,.007,-.0013,.0153,.1259,-.0464,.0866,.2175,-.0786,-.0413,-.1248,.0448,-.1777,-.4607,.1782,-5e-4,-.005,.0016,.0629,.1506,-.0624,.0545,.2576,-.0864,-.0231,-.0552,.0244,-.0136,-.0359,.0169,-.1158,-.2996,.1214,-.0235,-.0354,.0165,-.0745,-.1079,.0475,-.0116,-.0039,.0012,.0013,-.0108,-8e-4,.0044,-.0027,-1e-4,-.0694,.0363,.0071,.1462,-.136,.0047,.009,-.0177,.0038,-.0271,.0118,.0011,-.0399,-.0111,.0123]},12:{mean:[-.2981,.3828,.7563],identity:[-.0116,.014,.0054,.0018,5e-4,0,-4e-4,.0068,-.0013,-.0019,-.0048,-5e-4,5e-4,.0108,-.0036,-.0029,-.0018,.0029,.0043,-.0077,6e-4,-.0017,.002,-.0011,-.0014,-.0035,.0015,-.0024,.0011,4e-4,-.0048,2e-4,.0029,-1e-4,-1e-4,.003,.0019,.0035,-.0016,-4e-4,.0039,.0019,1e-4,-.0064,.004,3e-4,.002,-.0021,.0017,.0011,-.001,.0026,.0025,-5e-4,2e-4,-3e-4,-5e-4,-7e-4,9e-4,-4e-4,-.001,-.0022,.001,9e-4,-.0014,7e-4,.0011,-.001,-5e-4,-8e-4,-.0017,-.0021,9e-4,.0036,5e-4,4e-4,-.0031,6e-4,-.0015,.0027,2e-4,1e-4,-.0011,2e-4,-.0011,-.0018,4e-4,-.0013,-2e-4,7e-4,9e-4,-3e-4,.001,-.0021,8e-4,6e-4,-9e-4,4e-4,-7e-4,8e-4,-.002,-.0013,0,7e-4,-.0012,-1e-4,.0014,.0014,-1e-4,.0013,6e-4,6e-4,-.0014,-.0015,-9e-4,1e-4,1e-4,9e-4,7e-4,0,1e-4,-.001,-4e-4,0,-5e-4,1e-4,-3e-4,4e-4,-5e-4,-1e-4,-.0011,2e-4,0,1e-4,8e-4,8e-4,0,-7e-4,-8e-4,0,2e-4,-1e-4,.001,3e-4,4e-4,-2e-4,0,5e-4,.0018,-1e-4],expression:[0,-4e-4,.0028,.0036,-8e-4,-.0026,-.0015,-8e-4,3e-4,.0075,-.0608,.025,.0019,-.0076,.0033,.0379,-.0437,.0335,.0964,-.2452,.1233,.0368,-.0251,.0253,.0033,.0097,-.0021,-.0095,.1171,-.0475,-.064,.1548,-.0718,.0228,-.0831,.0343,-.1924,.6206,-.2771,.0021,-.0143,.0056,-.0705,.2522,-.1116,-.0692,.4229,-.1592,-.0093,.05,-.0185,.0948,-.3196,.1437,-.0184,.0194,-.0131,.0205,-.0353,.0201,.0676,-.135,.0672,.0137,-.0311,.0118,3e-4,-.0077,-2e-4,-.0151,4e-4,-.0058,.029,-.0139,.0163,.1324,.1819,-.0039,.0406,.0501,.0017,.0331,.0161,.0062,-.0235,-.0446,.0047]}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={incompatible:()=>!("function"==typeof Promise&&"object"==typeof WebAssembly&&!!(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices&&navigator.mediaDevices.getUserMedia)),incompatible_ui:()=>{const e=document.createElement("div");e.append(function(){let e=document.createElement("div"),t="a recent web browser";navigator.userAgent.match(/Android/i)?(t="Chrome for Android",window.location.href="googlechrome://navigate?url="+encodeURI(window.location.href),setTimeout(()=>{window.location.href="samsunginternet://open?url="+encodeURI(window.location.href)},2e3)):navigator.userAgent.match(/iPhone|iPod|iPad/i)&&(t="Safari",e.classList.add("zee-launcher-browser-safari")),e.classList.add("zee-launcher-unsupported"),e.innerHTML=`\n <style>.zee-launcher-unsupported {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n align-items: center;\n }\n .zee-launcher-browser-logo {\n background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 210 211' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(-82 -146)' fill-rule='nonzero' stroke='%23ffffff' stroke-width='2'%3E%3Cg transform='translate(83 146.5)'%3E%3Cpath d='m55.146 88.785l-32.039-49.472c19.962-24.947 49.904-38.684 80.517-38.81 17.739-0.12642 35.855 4.4246 52.336 13.99 18.2 10.619 32.039 25.874 40.846 43.404l-86.095-4.5511c-24.365-1.4327-47.556 12.347-55.565 35.439zm13.797 16.224c0 19.468 15.684 35.229 35.059 35.229 19.374 0 35.059-15.76 35.059-35.229 0-19.468-15.684-35.229-35.059-35.229-19.374 0-35.059 15.718-35.059 35.229zm132.06-37.588l-58.585 3.034c15.894 18.668 16.145 45.595 2.7678 66.243l-47.01 72.648c19.5 1.0535 39.588-3.2447 57.788-13.864 45.039-26.126 63.282-80.908 45.039-128.06zm-144.93 57.647l-39.126-77.326c-10.694 16.434-16.942 36.156-16.942 57.267 0 52.253 38.078 95.53 87.856 103.2l26.713-52.59c-24.155 4.5511-47.472-8.765-58.501-30.551z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A");\n width: 211px;\n height: 211px;\n margin-bottom: 25%;\n margin-top: -60px;\n background-repeat: no-repeat;\n }\n .zee-launcher-browser-safari .zee-launcher-browser-logo {\n background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 211 211' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(-82 -146)' fill-rule='nonzero' stroke='%23fffffft' stroke-width='2'%3E%3Cpath d='m180 251.86c0-4.0385 2.9377-7.855 7.2552-7.855 3.9614 0 7.7448 2.8402 7.7448 7.145 0 4.0385-2.8487 7.855-7.1662 7.855-4.0059 0-7.8338-2.9734-7.8338-7.145zm112-0.35503c0 57.728-46.772 104.5-104.5 104.5s-104.5-46.772-104.5-104.5 46.772-104.5 104.5-104.5 104.5 46.772 104.5 104.5zm-12-1c0-51.649-41.851-93.5-93.5-93.5s-93.5 41.851-93.5 93.5 41.851 93.5 93.5 93.5 93.5-41.851 93.5-93.5zm-30.624 40.983c0 1.5095 5.4495 4.2768 6.8328 5.1154-11.486 17.401-29.26 29.938-49.423 34.928l-1.8444-7.757c-0.12576-1.0482-0.79646-1.174-1.7606-1.174-0.79646 0-1.2576 1.174-1.1737 1.7611l1.8444 7.8828c-5.5753 1.174-11.234 1.7611-16.935 1.7611-15.217 0-30.182-4.2768-43.177-12.202 0.71263-1.174 5.1141-7.5474 5.1141-8.4698 0-0.79666-0.71263-1.5095-1.5091-1.5095-1.6348 0-5.1141 6.9603-6.1621 8.344-17.522-11.615-30.182-29.602-35.044-50.148l8.0066-1.761c0.92222-0.25158 1.1737-0.92246 1.1737-1.7611 0-0.79667-1.1737-1.2579-1.8444-1.174l-7.8389 1.803c-1.048-5.3251-1.6348-10.692-1.6348-16.143 0-15.556 4.4015-30.86 12.66-43.984 1.1737 0.71281 6.749 4.5284 7.6712 4.5284 0.79646 0 1.5091-0.58702 1.5091-1.3837 0-1.6353-6.1621-4.7381-7.5455-5.7024 11.821-17.275 29.805-29.728 50.219-34.34l1.7606 7.757c0.25152 0.92246 0.92222 1.174 1.7606 1.174 0.83838 0 1.2576-1.174 1.1737-1.8449l-1.7606-7.6732c5.1141-0.92246 10.312-1.5095 15.552-1.5095 15.552 0 30.727 4.4026 43.973 12.663-0.79646 1.174-4.5273 6.6249-4.5273 7.5474 0 0.79667 0.58687 1.5095 1.3833 1.5095 1.6348 0 4.7369-6.0379 5.5753-7.4216 17.187 11.615 29.469 29.351 34.248 49.561l-6.4975 1.3837c-1.048 0.25158-1.1737 0.92246-1.1737 1.8449 0 0.79667 1.1737 1.2579 1.7606 1.174l6.6232-1.5095c1.048 5.3251 1.6348 10.776 1.6348 16.227 0 15.221-4.1919 30.189-12.073 43.062-1.1737-0.58702-6.0364-4.0672-6.9586-4.0672-0.8803 0-1.5929 0.71281-1.5929 1.5095zm-14.876-98.483c-5.2178 4.88-53.863 49.48-55.228 51.8l-38.772 64.2c5.0974-4.76 53.863-49.6 55.108-51.72l38.892-64.28z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");\n }\n .zee-launcher-unsupported-message {\n text-align: center;\n width: 250px;\n font-family: sans-serif;\n color: #ffffff;\n }\n .zee-launcher-unsupported-message-copy {\n border: 1px solid #ffffff;\n border-radius: 5px;\n margin-top: 10px;\n }\n #zee-launcher-unsupported-message-input {\n border: none;\n padding: 10px;\n border-radius: 0px;\n border-right: 1px solid #344B60;\n height: 40px;\n color: #ffffff;\n background-color: black;\n box-sizing: border-box;\n width: calc(100% - 65px);\n margin-left: 5px;\n }\n #zee-launcher-unsupported-message-button {\n background: none;\n border: none;\n outline: none;\n text-transform: uppercase;\n color: #ffffff;\n height: 40px;\n display: inline-block;\n width: 59px;\n }\n .zee-launcher-unsupported-message-before-copy {\n height: 100px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n }\n .zee-launcher-unsupported-message-copied .zee-launcher-unsupported-message-before-copy {\n display: none;\n }\n .zee-launcher-unsupported-message-after-copy {\n display: none;\n }\n .zee-launcher-unsupported-message-copied .zee-launcher-unsupported-message-after-copy {\n height: 100px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n }\n </style>\n <div class="zee-launcher-browser-logo"></div>\n <div class="zee-launcher-unsupported-message">Open with ${t} to access this content.</div>\n <div class="zee-launcher-unsupported-message-before-copy">\n <div class="zee-launcher-unsupported-message ">Tap below to copy the address for easy pasting into ${t}.</div>\n <div class="zee-launcher-unsupported-message-copy"><input id="zee-launcher-unsupported-message-input" type="text/"><button id="zee-launcher-unsupported-message-button">Copy</button></div>\n </div>\n <div class="zee-launcher-unsupported-message zee-launcher-unsupported-message-after-copy">COPIED! Now paste into ${t}'s address bar to experience the content.</div>\n `;let r=e.querySelector("#zee-launcher-unsupported-message-input")||document.createElement("input");r.value=window.location.href;let n=()=>{if(navigator.userAgent.match(/iPhone|iPod|iPad/i)){let e=document.createRange();e.selectNodeContents(r);let t=window.getSelection();if(!t)return;t.removeAllRanges(),t.addRange(e),r.setSelectionRange(0,999999999)}else r.select();document.execCommand("copy"),r.blur(),e.classList.toggle("zee-launcher-unsupported-message-copied",!0)};return(e.querySelector("#zee-launcher-unsupported-message-button")||document.createElement("button")).addEventListener("click",n),r.addEventListener("click",n),e}()),Object.assign(e.style,{position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",zIndex:1001,backgroundColor:"rgba(0, 0, 0, 0.9)",fontFamily:"sans-serif",color:"white",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.classList.add("zee_launcher_compatibility"),document.body.append(e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceSource=void 0;const n=r(0),a=r(12),i=r(14),o=r(4),s=r(1);let c=1,u=new Map;class _ extends i.Source{constructor(e,t){super(),this._impl=e,this._pipeline=t,this._packetNumber=0}static create(e){let t=c++;return u.set(t,new _(t,e)),n.zcout("sequence_source_source_t initialized"),t}static get(e){return u.get(e)}loadFromMemory(e){try{this._decoder=new a.SequenceDecoder(e),this._packetNumber=0}catch(e){n.zcerr("Unable to decode sequence:",e)}}getFrame(e){let t=o.Pipeline.get(this._pipeline);if(t&&!e&&this._decoder)for(;this._packetNumber<this._decoder.numberPackets;){let e=this._decoder.dataByPacket.get(this._packetNumber);if(this._packetNumber++,!e)return;switch(e.type){case a.SequenceRecorderPacketType.ACCELEROMETER:t.motionAccelerometerSubmit(e.t,e.x,e.y,e.z);break;case a.SequenceRecorderPacketType.ROTATION_RATE:t.motionRotationRateSubmit(e.t,e.x,e.y,e.z);break;case a.SequenceRecorderPacketType.ATTITUDE:t.motionAttitudeSubmit(e.t,e.x,e.y,e.z);break;case a.SequenceRecorderPacketType.ATTITUDE_MATRIX:t.motionAttitudeMatrix(e.attitude);break;case a.SequenceRecorderPacketType.CAMERA_FRAME:{let r=t.cameraPixelArrays.pop();for(;r&&r.byteLength!==e.greyscale.byteLength;)r=t.cameraPixelArrays.pop();return r||(r=new ArrayBuffer(e.greyscale.byteLength)),new Uint8Array(r).set(e.greyscale),{data:r,cameraSourceData:e.greyscale,cameraModel:e.cameraModel,cameraToDevice:e.cameraToDevice,dataWidth:e.width,dataHeight:e.height,texture:void 0,userFacing:e.userFacing,uvTransform:s.mat4.create(),cameraSource:this}}}}}destroy(){u.delete(this._impl),this.pause()}start(){var e;let t=o.Pipeline.get(this._pipeline);t&&t.currentCameraSource!==this&&(null===(e=t.currentCameraSource)||void 0===e||e.pause(),t.currentCameraSource=this)}pause(){let e=o.Pipeline.get(this._pipeline);e&&e.currentCameraSource===this&&(e.currentCameraSource=void 0)}uploadGL(e){let t=o.Pipeline.get(this._pipeline);if(!t)return;let r=null==t?void 0:t.glContext;r&&(e.texture||(e.texture=t.getVideoTexture()),e.texture&&e.cameraSourceData&&(r.bindTexture(r.TEXTURE_2D,e.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,e.dataWidth,e.dataHeight,0,r.LUMINANCE,r.UNSIGNED_BYTE,new Uint8Array(e.cameraSourceData)),r.bindTexture(r.TEXTURE_2D,null)))}}t.SequenceSource=_},function(e,t,r){"use strict";r.r(t),t.default=r.p+"f7b62a3a53b5c9b3222ba8dc53cb8b11.zbin"},function(e,t,r){"use strict";r.r(t),t.default=r.p+"482727c0e7dd40d73f5aae47f238ad61.zbin"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="0.4.0-beta.4"}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ZCV=t():e.ZCV=t()}(self,(function(){return(()=>{var e={238:function(e,t,r){var i;!function(a,n){"use strict";var s="function",o="undefined",_="object",c="string",l="model",u="name",d="type",f="vendor",h="version",m="architecture",p="console",b="mobile",g="tablet",w="smarttv",v="wearable",y="embedded",E="Amazon",A="Apple",T="ASUS",x="BlackBerry",R="Google",k="Huawei",F="LG",M="Microsoft",L="Motorola",S="Samsung",I="Sony",U="Xiaomi",B="Zebra",C="Facebook",D=function(e){var t={};for(var r in e)t[e[r].toUpperCase()]=e[r];return t},O=function(e,t){return typeof e===c&&-1!==P(t).indexOf(P(e))},P=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===c)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,255)},V=function(e,t){for(var r,i,a,o,c,l,u=0;u<t.length&&!c;){var d=t[u],f=t[u+1];for(r=i=0;r<d.length&&!c;)if(c=d[r++].exec(e))for(a=0;a<f.length;a++)l=c[++i],typeof(o=f[a])===_&&o.length>0?2==o.length?typeof o[1]==s?this[o[0]]=o[1].call(this,l):this[o[0]]=o[1]:3==o.length?typeof o[1]!==s||o[1].exec&&o[1].test?this[o[0]]=l?l.replace(o[1],o[2]):n:this[o[0]]=l?o[1].call(this,l,o[2]):n:4==o.length&&(this[o[0]]=l?o[3].call(this,l.replace(o[1],o[2])):n):this[o]=l||n;u+=2}},N=function(e,t){for(var r in t)if(typeof t[r]===_&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(O(t[r][i],e))return"?"===r?n:r}else if(O(t[r],e))return"?"===r?n:r;return e},G={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"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,"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],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[h,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],h],[/\bfocus\/([\w\.]+)/i],[h,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[h,[u,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],h],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,C],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,N,{"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],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,"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],[u,h]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,P]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",P]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,P]]],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],[l,[f,S],[d,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[f,S],[d,b]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[f,A],[d,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,A],[d,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[f,k],[d,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[l,[f,k],[d,b]],[/\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],[[l,/_/g," "],[f,U],[d,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[f,U],[d,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[f,"OPPO"],[d,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[f,"Vivo"],[d,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[f,"Realme"],[d,b]],[/\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],[l,[f,L],[d,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[f,L],[d,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[f,F],[d,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[f,F],[d,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[f,"Lenovo"],[d,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[f,"Nokia"],[d,b]],[/(pixel c)\b/i],[l,[f,R],[d,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[f,R],[d,b]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,I],[d,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[f,I],[d,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[f,"OnePlus"],[d,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[f,E],[d,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[f,E],[d,b]],[/(playbook);[-\w\),; ]+(rim)/i],[l,f,[d,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[f,x],[d,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[f,T],[d,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[f,T],[d,b]],[/(nexus 9)/i],[l,[f,"HTC"],[d,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[f,[l,/_/g," "],[d,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[f,"Acer"],[d,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[f,"Meizu"],[d,b]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[f,"Sharp"],[d,b]],[/(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],[f,l,[d,b]],[/(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],[f,l,[d,g]],[/(surface duo)/i],[l,[f,M],[d,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[f,"Fairphone"],[d,b]],[/(u304aa)/i],[l,[f,"AT&T"],[d,b]],[/\bsie-(\w*)/i],[l,[f,"Siemens"],[d,b]],[/\b(rct\w+) b/i],[l,[f,"RCA"],[d,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[f,"Dell"],[d,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[f,"Verizon"],[d,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[f,"Barnes & Noble"],[d,g]],[/\b(tm\d{3}\w+) b/i],[l,[f,"NuVision"],[d,g]],[/\b(k88) b/i],[l,[f,"ZTE"],[d,g]],[/\b(nx\d{3}j) b/i],[l,[f,"ZTE"],[d,b]],[/\b(gen\d{3}) b.+49h/i],[l,[f,"Swiss"],[d,b]],[/\b(zur\d{3}) b/i],[l,[f,"Swiss"],[d,g]],[/\b((zeki)?tb.*\b) b/i],[l,[f,"Zeki"],[d,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],l,[d,g]],[/\b(ns-?\w{0,9}) b/i],[l,[f,"Insignia"],[d,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[f,"NextBook"],[d,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],l,[d,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],l,[d,b]],[/\b(ph-1) /i],[l,[f,"Essential"],[d,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[f,"Envizen"],[d,g]],[/\b(trio[-\w\. ]+) b/i],[l,[f,"MachSpeed"],[d,g]],[/\btu_(1491) b/i],[l,[f,"Rotor"],[d,g]],[/(shield[\w ]+) b/i],[l,[f,"Nvidia"],[d,g]],[/(sprint) (\w+)/i],[f,l,[d,b]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,M],[d,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,B],[d,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,B],[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,l,[d,p]],[/droid.+; (shield) bui/i],[l,[f,"Nvidia"],[d,p]],[/(playstation [345portablevi]+)/i],[l,[f,I],[d,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[f,M],[d,p]],[/smart-tv.+(samsung)/i],[f,[d,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,S],[d,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,F],[d,w]],[/(apple) ?tv/i],[f,[l,"Apple TV"],[d,w]],[/crkey/i],[[l,"Chromecast"],[f,R],[d,w]],[/droid.+aft(\w)( bui|\))/i],[l,[f,E],[d,w]],[/\(dtv[\);].+(aquos)/i],[l,[f,"Sharp"],[d,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[f,z],[l,z],[d,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,w]],[/((pebble))app/i],[f,l,[d,v]],[/droid.+; (glass) \d/i],[l,[f,R],[d,v]],[/droid.+; (wt63?0{2,3})\)/i],[l,[f,B],[d,v]],[/(quest( 2)?)/i],[l,[f,C],[d,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[d,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,g]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[d,b]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"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],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[h,N,G]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[h,N,G]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[u,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],h],[/(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],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,h]]},W=function(e,t){if(typeof e===_&&(t=e,e=n),!(this instanceof W))return new W(e,t).getResult();var r=e||(typeof a!==o&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),i=t?function(e,t){var r={};for(var i in e)t[i]&&t[i].length%2==0?r[i]=t[i].concat(e[i]):r[i]=e[i];return r}(H,t):H;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,V.call(t,r,i.browser),t.major=typeof(e=t.version)===c?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,V.call(e,r,i.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,V.call(e,r,i.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,V.call(e,r,i.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,V.call(e,r,i.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=typeof e===c&&e.length>255?z(e,255):e,this},this.setUA(r),this};W.VERSION="0.7.30",W.BROWSER=D([u,h,"major"]),W.CPU=D([m]),W.DEVICE=D([l,f,d,p,b,w,g,v,y]),W.ENGINE=W.OS=D([u,h]),typeof t!==o?(e.exports&&(t=e.exports=W),t.UAParser=W):r.amdO?(i=function(){return W}.call(t,r,t,e))===n||(e.exports=i):typeof a!==o&&(a.UAParser=W);var q=typeof a!==o&&(a.jQuery||a.Zepto);if(q&&!q.ua){var j=new W;q.ua=j.getResult(),q.ua.get=function(){return j.getUA()},q.ua.set=function(e){j.setUA(e);var t=j.getResult();for(var r in t)q.ua[r]=t[r]}}}("object"==typeof window?window:this)},276:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(477),a=r.n(i);function n(){return a()('(()=>{var e={238:function(e,t,r){var i;!function(a,n){"use strict";var o="function",s="undefined",_="object",c="string",u="model",f="name",l="type",d="vendor",p="version",h="architecture",m="console",b="mobile",w="tablet",g="smarttv",y="wearable",v="embedded",E="Amazon",A="Apple",k="ASUS",T="BlackBerry",x="Google",R="Huawei",F="LG",z="Microsoft",L="Motorola",M="Samsung",O="Sony",I="Xiaomi",P="Zebra",S="Facebook",B=function(e){var t={};for(var r in e)t[e[r].toUpperCase()]=e[r];return t},U=function(e,t){return typeof e===c&&-1!==D(t).indexOf(D(e))},D=function(e){return e.toLowerCase()},C=function(e,t){if(typeof e===c)return e=e.replace(/^\\s\\s*/,"").replace(/\\s\\s*$/,""),typeof t===s?e:e.substring(0,255)},V=function(e,t){for(var r,i,a,s,c,u,f=0;f<t.length&&!c;){var l=t[f],d=t[f+1];for(r=i=0;r<l.length&&!c;)if(c=l[r++].exec(e))for(a=0;a<d.length;a++)u=c[++i],typeof(s=d[a])===_&&s.length>0?2==s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3==s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):n:this[s[0]]=u?s[1].call(this,u,s[2]):n:4==s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):n):this[s]=u||n;f+=2}},N=function(e,t){for(var r in t)if(typeof t[r]===_&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(U(t[r][i],e))return"?"===r?n:r}else if(U(t[r],e))return"?"===r?n:r;return e},H={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"},W={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[p,[f,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[p,[f,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[f,p],[/opios[\\/ ]+([\\w\\.]+)/i],[p,[f,"Opera Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[p,[f,"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],[f,p],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[p,[f,"UCBrowser"]],[/\\bqbcore\\/([\\w\\.]+)/i],[p,[f,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[p,[f,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[p,[f,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[p,[f,"IE"]],[/yabrowser\\/([\\w\\.]+)/i],[p,[f,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[f,/(.+)/,"$1 Secure Browser"],p],[/\\bfocus\\/([\\w\\.]+)/i],[p,[f,"Firefox Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[p,[f,"Opera Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[p,[f,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[p,[f,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[p,[f,"Opera Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[p,[f,"MIUI Browser"]],[/fxios\\/([-\\w\\.]+)/i],[p,[f,"Firefox"]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 Browser"]],[/(oculus|samsung|sailfish)browser\\/([\\w\\.]+)/i],[[f,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[f,/_/g," "],p],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[f,p],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i],[f],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[f,S],p],[/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[f,p],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[p,[f,"GSA"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[p,[f,"Chrome Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[f,"Chrome WebView"],p],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[p,[f,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[f,p],[/version\\/([\\w\\.]+) .*mobile\\/\\w+ (safari)/i],[p,[f,"Mobile Safari"]],[/version\\/([\\w\\.]+) .*(mobile ?safari|safari)/i],[p,f],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[f,[p,N,{"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],[f,p],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[f,"Netscape"],p],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[p,[f,"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],[f,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,D]],[/((?:i[346]|x)86)[;\\)]/i],[[h,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[h,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[h,/ower/,"",D]],[/(sun4\\w)[;\\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[h,D]]],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],[u,[d,M],[l,w]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[u,[d,M],[l,b]],[/\\((ip(?:hone|od)[\\w ]*);/i],[u,[d,A],[l,b]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[u,[d,A],[l,w]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[u,[d,R],[l,w]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}-[atu]?[ln][01259x][012359][an]?)\\b(?!.+d\\/s)/i],[u,[d,R],[l,b]],[/\\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],[[u,/_/g," "],[d,I],[l,b]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[u,/_/g," "],[d,I],[l,w]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007)\\b/i],[u,[d,"OPPO"],[l,b]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[l,b]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[u,[d,"Realme"],[l,b]],[/\\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],[u,[d,L],[l,b]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[u,[d,L],[l,w]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,F],[l,w]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[u,[d,F],[l,b]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[u,[d,"Lenovo"],[l,w]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[l,b]],[/(pixel c)\\b/i],[u,[d,x],[l,w]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[u,[d,x],[l,b]],[/droid.+ ([c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[u,[d,O],[l,b]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[u,"Xperia Tablet"],[d,O],[l,w]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[u,[d,"OnePlus"],[l,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[u,[d,E],[l,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,E],[l,b]],[/(playbook);[-\\w\\),; ]+(rim)/i],[u,d,[l,w]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[u,[d,T],[l,b]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[l,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[u,[d,k],[l,b]],[/(nexus 9)/i],[u,[d,"HTC"],[l,w]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\\w]*)/i],[d,[u,/_/g," "],[l,b]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[u,[d,"Acer"],[l,w]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[u,[d,"Meizu"],[l,b]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[u,[d,"Sharp"],[l,b]],[/(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],[d,u,[l,b]],[/(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],[d,u,[l,w]],[/(surface duo)/i],[u,[d,z],[l,w]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[u,[d,"Fairphone"],[l,b]],[/(u304aa)/i],[u,[d,"AT&T"],[l,b]],[/\\bsie-(\\w*)/i],[u,[d,"Siemens"],[l,b]],[/\\b(rct\\w+) b/i],[u,[d,"RCA"],[l,w]],[/\\b(venue[\\d ]{2,7}) b/i],[u,[d,"Dell"],[l,w]],[/\\b(q(?:mv|ta)\\w+) b/i],[u,[d,"Verizon"],[l,w]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[u,[d,"Barnes & Noble"],[l,w]],[/\\b(tm\\d{3}\\w+) b/i],[u,[d,"NuVision"],[l,w]],[/\\b(k88) b/i],[u,[d,"ZTE"],[l,w]],[/\\b(nx\\d{3}j) b/i],[u,[d,"ZTE"],[l,b]],[/\\b(gen\\d{3}) b.+49h/i],[u,[d,"Swiss"],[l,b]],[/\\b(zur\\d{3}) b/i],[u,[d,"Swiss"],[l,w]],[/\\b((zeki)?tb.*\\b) b/i],[u,[d,"Zeki"],[l,w]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[d,"Dragon Touch"],u,[l,w]],[/\\b(ns-?\\w{0,9}) b/i],[u,[d,"Insignia"],[l,w]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[u,[d,"NextBook"],[l,w]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[l,b]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[d,"LvTel"],u,[l,b]],[/\\b(ph-1) /i],[u,[d,"Essential"],[l,b]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[u,[d,"Envizen"],[l,w]],[/\\b(trio[-\\w\\. ]+) b/i],[u,[d,"MachSpeed"],[l,w]],[/\\btu_(1491) b/i],[u,[d,"Rotor"],[l,w]],[/(shield[\\w ]+) b/i],[u,[d,"Nvidia"],[l,w]],[/(sprint) (\\w+)/i],[d,u,[l,b]],[/(kin\\.[onetw]{3})/i],[[u,/\\./g," "],[d,z],[l,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[u,[d,P],[l,w]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[u,[d,P],[l,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[l,m]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[l,m]],[/(playstation [345portablevi]+)/i],[u,[d,O],[l,m]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[u,[d,z],[l,m]],[/smart-tv.+(samsung)/i],[d,[l,g]],[/hbbtv.+maple;(\\d+)/i],[[u,/^/,"SmartTV"],[d,M],[l,g]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[d,F],[l,g]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[l,g]],[/crkey/i],[[u,"Chromecast"],[d,x],[l,g]],[/droid.+aft(\\w)( bui|\\))/i],[u,[d,E],[l,g]],[/\\(dtv[\\);].+(aquos)/i],[u,[d,"Sharp"],[l,g]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i],[[d,C],[u,C],[l,g]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[l,g]],[/((pebble))app/i],[d,u,[l,y]],[/droid.+; (glass) \\d/i],[u,[d,x],[l,y]],[/droid.+; (wt63?0{2,3})\\)/i],[u,[d,P],[l,y]],[/(quest( 2)?)/i],[u,[d,S],[l,y]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[d,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[u,[l,b]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[u,[l,w]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[l,w]],[/(phone|mobile(?:[;\\/]| safari)|pda(?=.+windows ce))/i],[[l,b]],[/(android[-\\w\\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[p,[f,"EdgeHTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[p,[f,"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],[f,p],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[p,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,p],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[f,[p,N,H]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[f,"Windows"],[p,N,H]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/cfnetwork\\/.+darwin/i],[[p,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[f,"Mac OS"],[p,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86)/i],[p,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[f,p],[/\\(bb(10);/i],[p,[f,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[p,[f,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[p,[f,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[p,[f,"webOS"]],[/crkey\\/([\\d\\.]+)/i],[p,[f,"Chromecast"]],[/(cros) [\\w]+ ([\\w\\.]+\\w)/i],[[f,"Chromium OS"],p],[/(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],[f,p],[/(sunos) ?([\\w\\.\\d]*)/i],[[f,"Solaris"],p],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\\w\\.]*)/i],[f,p]]},G=function(e,t){if(typeof e===_&&(t=e,e=n),!(this instanceof G))return new G(e,t).getResult();var r=e||(typeof a!==s&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),i=t?function(e,t){var r={};for(var i in e)t[i]&&t[i].length%2==0?r[i]=t[i].concat(e[i]):r[i]=e[i];return r}(W,t):W;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,V.call(t,r,i.browser),t.major=typeof(e=t.version)===c?e.replace(/[^\\d\\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,V.call(e,r,i.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,V.call(e,r,i.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,V.call(e,r,i.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,V.call(e,r,i.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=typeof e===c&&e.length>255?C(e,255):e,this},this.setUA(r),this};G.VERSION="0.7.30",G.BROWSER=B([f,p,"major"]),G.CPU=B([h]),G.DEVICE=B([u,d,l,m,b,g,w,y,v]),G.ENGINE=G.OS=B([f,p]),typeof t!==s?(e.exports&&(t=e.exports=G),t.UAParser=G):r.amdO?(i=function(){return G}.call(t,r,t,e))===n||(e.exports=i):typeof a!==s&&(a.UAParser=G);var q=typeof a!==s&&(a.jQuery||a.Zepto);if(q&&!q.ua){var X=new G;q.ua=X.getResult(),q.ua.get=function(){return X.getUA()},q.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var r in t)q.ua[r]=t[r]}}}("object"==typeof window?window:this)},394:(e,t,r)=>{"use strict";e.exports=r.p+"6a8309f88f836a752c68.wasm"}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}r.m=e,r.amdO={},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\\?.*$/,"").replace(/\\/[^\\/]+$/,"/"),r.p=e})(),r.b=self.location+"",(()=>{"use strict";var e;const t=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var r;t=t||{},r||(r=void 0!==t?t:{});var i,a,n=Object.assign;r.ready=new Promise((function(e,t){i=e,a=t}));var o,s=n({},r),_="./this.program",c=(e,t)=>{throw t},u="";u=self.location.href,e&&(u=e),u=0!==u.indexOf("blob:")?u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)};var f,l,d=r.print||console.log.bind(console),p=r.printErr||console.warn.bind(console);n(r,s),s=null,r.thisProgram&&(_=r.thisProgram),r.quit&&(c=r.quit),r.wasmBinary&&(l=r.wasmBinary);var h=r.noExitRuntime||!0;"object"!=typeof WebAssembly&&j("no native wasm support detected");var m,b,w=!1;function g(e,t,i,a){var n={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=br(r),O(e,E,t,r)}return t},array:function(e){var t=br(e.length);return v.set(e,t),t}};e=r["_"+e];var o,s=[],_=0;if(a)for(var c=0;c<a.length;c++){var u=n[i[c]];u?(0===_&&(_=hr()),s[c]=u(a[c])):s[c]=a[c]}return o=i=e.apply(null,s),0!==_&&mr(_),"string"===t?M(o):"boolean"===t?!!o:o}var y,v,E,A,k,T,x,R,F,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(e,t,r){var i=t+r;for(r=t;e[r]&&!(r>=i);)++r;if(16<r-t&&e.subarray&&z)return z.decode(e.subarray(t,r));for(i="";t<r;){var a=e[t++];if(128&a){var n=63&e[t++];if(192==(224&a))i+=String.fromCharCode((31&a)<<6|n);else{var o=63&e[t++];65536>(a=224==(240&a)?(15&a)<<12|n<<6|o:(7&a)<<18|n<<12|o<<6|63&e[t++])?i+=String.fromCharCode(a):(a-=65536,i+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else i+=String.fromCharCode(a)}return i}function M(e,t){return e?L(E,e,t):""}function O(e,t,r,i){if(!(0<i))return 0;var a=r;i=r+i-1;for(var n=0;n<e.length;++n){var o=e.charCodeAt(n);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n)),127>=o){if(r>=i)break;t[r++]=o}else{if(2047>=o){if(r+1>=i)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=i)break;t[r++]=224|o>>12}else{if(r+3>=i)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 i=e.charCodeAt(r);55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),127>=i?++t:t=2047>=i?t+2:65535>=i?t+3:t+4}return t}function P(e){var t=I(e)+1,r=cr(t);return r&&O(e,v,r,t),r}function S(){var e=m.buffer;y=e,r.HEAP8=v=new Int8Array(e),r.HEAP16=A=new Int16Array(e),r.HEAP32=T=new Int32Array(e),r.HEAPU8=E=new Uint8Array(e),r.HEAPU16=k=new Uint16Array(e),r.HEAPU32=x=new Uint32Array(e),r.HEAPF32=R=new Float32Array(e),r.HEAPF64=F=new Float64Array(e)}var B,U=[],D=[],C=[],V=!1;function N(){var e=r.preRun.shift();U.unshift(e)}var H,W=0,G=null,q=null;function X(){W++,r.monitorRunDependencies&&r.monitorRunDependencies(W)}function Y(){if(W--,r.monitorRunDependencies&&r.monitorRunDependencies(W),0==W&&(null!==G&&(clearInterval(G),G=null),q)){var e=q;q=null,e()}}function j(e){throw r.onAbort&&r.onAbort(e),p(e="Aborted("+e+")"),w=!0,b=1,e=new WebAssembly.RuntimeError(e+". Build with -s ASSERTIONS=1 for more info."),a(e),e}if(r.preloadedImages={},r.preloadedAudios={},!(H="zcv.wasm").startsWith("data:application/octet-stream;base64,")){var $=H;H=r.locateFile?r.locateFile($,u):u+$}var Z,K,J={506024:function(){if(self.crypto&&self.crypto.getRandomValues){var e=new Uint32Array(1);return self.crypto.getRandomValues(e),e[0]}return 9007199254740991*Math.random()},506200:function(e,t){self.respond_ba_request(E.subarray(e,e+t))},506262:function(e,t){self.send_ba_request(E.subarray(e,e+t))}};function Q(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t(r);else{var i=t.dd;"number"==typeof i?void 0===t.xc?re(i)():re(i)(t.xc):i(void 0===t.xc?null:t.xc)}}}var ee,te=[];function re(e){var t=te[e];return t||(e>=te.length&&(te.length=e+1),te[e]=t=B.get(e)),t}function ie(e){e instanceof wr||"unwind"==e||c(1,e)}function ae(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return T[fr()>>2]=28,-1;e=ee()}return T[t>>2]=e/1e3|0,T[t+4>>2]=e%1e3*1e6|0,0}function ne(e){this.qc=e-16,this.vd=function(e){T[this.qc+4>>2]=e},this.sd=function(e){T[this.qc+8>>2]=e},this.td=function(){T[this.qc>>2]=0},this.rd=function(){v[this.qc+12>>0]=0},this.ud=function(){v[this.qc+13>>0]=0},this.gd=function(e,t){this.vd(e),this.sd(t),this.td(),this.rd(),this.ud()}}function oe(e,t){for(var r=0,i=e.length-1;0<=i;i--){var a=e[i];"."===a?e.splice(i,1):".."===a?(e.splice(i,1),r++):r&&(e.splice(i,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 _e(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 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=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}ee=()=>performance.now();var fe=[];function le(e,t){fe[e]={input:[],ec:[],pc:t},Be(e,de)}var de={open:function(e){var t=fe[e.node.uc];if(!t)throw new Ae(43);e.dc=t,e.seekable=!1},close:function(e){e.dc.pc.flush(e.dc)},flush:function(e){e.dc.pc.flush(e.dc)},read:function(e,t,r,i){if(!e.dc||!e.dc.pc.Qc)throw new Ae(60);for(var a=0,n=0;n<i;n++){try{var o=e.dc.pc.Qc(e.dc)}catch(e){throw new Ae(29)}if(void 0===o&&0===a)throw new Ae(6);if(null==o)break;a++,t[r+n]=o}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,i){if(!e.dc||!e.dc.pc.Jc)throw new Ae(60);try{for(var a=0;a<i;a++)e.dc.pc.Jc(e.dc,t[r+a])}catch(e){throw new Ae(29)}return i&&(e.node.timestamp=Date.now()),a}},pe={Qc: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=nr(t,!0)}return e.input.shift()},Jc:function(e,t){null===t||10===t?(d(L(e.ec,0)),e.ec=[]):0!=t&&e.ec.push(t)},flush:function(e){e.ec&&0<e.ec.length&&(d(L(e.ec,0)),e.ec=[])}},he={Jc:function(e,t){null===t||10===t?(p(L(e.ec,0)),e.ec=[]):0!=t&&e.ec.push(t)},flush:function(e){e.ec&&0<e.ec.length&&(p(L(e.ec,0)),e.ec=[])}},me={jc:null,lc:function(){return me.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(24576==(61440&r)||4096==(61440&r))throw new Ae(63);return me.jc||(me.jc={dir:{node:{ic:me.$b.ic,kc:me.$b.kc,sc:me.$b.sc,yc:me.$b.yc,Wc:me.$b.Wc,Dc:me.$b.Dc,Xc:me.$b.Xc,Vc:me.$b.Vc,zc:me.$b.zc},stream:{nc:me.bc.nc}},file:{node:{ic:me.$b.ic,kc:me.$b.kc},stream:{nc:me.bc.nc,read:me.bc.read,write:me.bc.write,Lc:me.bc.Lc,Rc:me.bc.Rc,Tc:me.bc.Tc}},link:{node:{ic:me.$b.ic,kc:me.$b.kc,vc:me.$b.vc},stream:{}},Mc:{node:{ic:me.$b.ic,kc:me.$b.kc},stream:Se}}),16384==(61440&(r=ze(e,t,r,i)).mode)?(r.$b=me.jc.dir.node,r.bc=me.jc.dir.stream,r.ac={}):32768==(61440&r.mode)?(r.$b=me.jc.file.node,r.bc=me.jc.file.stream,r.cc=0,r.ac=null):40960==(61440&r.mode)?(r.$b=me.jc.link.node,r.bc=me.jc.link.stream):8192==(61440&r.mode)&&(r.$b=me.jc.Mc.node,r.bc=me.jc.Mc.stream),r.timestamp=Date.now(),e&&(e.ac[t]=r,e.timestamp=r.timestamp),r},Id:function(e){return e.ac?e.ac.subarray?e.ac.subarray(0,e.cc):new Uint8Array(e.ac):new Uint8Array(0)},Nc:function(e,t){var r=e.ac?e.ac.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.ac,e.ac=new Uint8Array(t),0<e.cc&&e.ac.set(r.subarray(0,e.cc),0))},pd:function(e,t){if(e.cc!=t)if(0==t)e.ac=null,e.cc=0;else{var r=e.ac;e.ac=new Uint8Array(t),r&&e.ac.set(r.subarray(0,Math.min(t,e.cc))),e.cc=t}},$b:{ic:function(e){var t={};return t.bd=8192==(61440&e.mode)?e.id:1,t.Ic=e.id,t.mode=e.mode,t.nd=1,t.uid=0,t.ed=0,t.uc=e.uc,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.cc:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.Yc=new Date(e.timestamp),t.md=new Date(e.timestamp),t.ad=new Date(e.timestamp),t.Zc=4096,t.$c=Math.ceil(t.size/t.Zc),t},kc:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&me.pd(e,t.size)},sc:function(){throw ke[44]},yc:function(e,t,r,i){return me.createNode(e,t,r,i)},Wc:function(e,t,r){if(16384==(61440&e.mode)){try{var i=Fe(t,r)}catch(e){}if(i)for(var a in i.ac)throw new Ae(55)}delete e.parent.ac[e.name],e.parent.timestamp=Date.now(),e.name=r,t.ac[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},Dc:function(e,t){delete e.ac[t],e.timestamp=Date.now()},Xc:function(e,t){var r,i=Fe(e,t);for(r in i.ac)throw new Ae(55);delete e.ac[t],e.timestamp=Date.now()},Vc:function(e){var t,r=[".",".."];for(t in e.ac)e.ac.hasOwnProperty(t)&&r.push(t);return r},zc:function(e,t,r){return(e=me.createNode(e,t,41471,0)).link=r,e},vc:function(e){if(40960!=(61440&e.mode))throw new Ae(28);return e.link}},bc:{read:function(e,t,r,i,a){var n=e.node.ac;if(a>=e.node.cc)return 0;if(8<(e=Math.min(e.node.cc-a,i))&&n.subarray)t.set(n.subarray(a,a+e),r);else for(i=0;i<e;i++)t[r+i]=n[a+i];return e},write:function(e,t,r,i,a,n){if(t.buffer===v.buffer&&(n=!1),!i)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.ac||e.ac.subarray)){if(n)return e.ac=t.subarray(r,r+i),e.cc=i;if(0===e.cc&&0===a)return e.ac=t.slice(r,r+i),e.cc=i;if(a+i<=e.cc)return e.ac.set(t.subarray(r,r+i),a),i}if(me.Nc(e,a+i),e.ac.subarray&&t.subarray)e.ac.set(t.subarray(r,r+i),a);else for(n=0;n<i;n++)e.ac[a+n]=t[r+n];return e.cc=Math.max(e.cc,a+i),i},nc:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.cc),0>t)throw new Ae(28);return t},Lc:function(e,t,r){me.Nc(e.node,t+r),e.node.cc=Math.max(e.node.cc,t+r)},Rc:function(e,t,r,i,a,n){if(0!==t)throw new Ae(28);if(32768!=(61440&e.node.mode))throw new Ae(43);if(e=e.node.ac,2&n||e.buffer!==y){if((0<i||i+r<e.length)&&(e=e.subarray?e.subarray(i,i+r):Array.prototype.slice.call(e,i,i+r)),i=!0,j(),!(r=void 0))throw new Ae(48);v.set(e,r)}else i=!1,r=e.byteOffset;return{qc:r,Ed:i}},Tc:function(e,t,r,i,a){if(32768!=(61440&e.node.mode))throw new Ae(43);return 2&a||me.bc.write(e,t,0,i,r,!1),0}}},be=null,we={},ge=[],ye=1,ve=null,Ee=!0,Ae=null,ke={};function Te(e,t){if(t=t||{},!(e=ue("/",e)))return{path:"",node:null};var r,i={Oc:!0,Kc:0};for(r in i)void 0===t[r]&&(t[r]=i[r]);if(8<t.Kc)throw new Ae(32);e=oe(e.split("/").filter((function(e){return!!e})),!1);var a=be;for(i="/",r=0;r<e.length;r++){var n=r===e.length-1;if(n&&t.parent)break;if(a=Fe(a,e[r]),i=se(i+"/"+e[r]),a.tc&&(!n||n&&t.Oc)&&(a=a.tc.root),!n||t.Gc)for(n=0;40960==(61440&a.mode);)if(a=He(i),a=Te(i=ue(_e(i),a),{Kc:t.Kc}).node,40<n++)throw new Ae(32)}return{path:i,node:a}}function xe(e){for(var t;;){if(e===e.parent)return e=e.lc.Sc,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Re(e,t){for(var r=0,i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i)|0;return(e+r>>>0)%ve.length}function Fe(e,t){var r;if(r=(r=Oe(e,"x"))?r:e.$b.sc?0:2)throw new Ae(r,e);for(r=ve[Re(e.id,t)];r;r=r.oc){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.$b.sc(e,t)}function ze(e,t,r,i){return t=Re((e=new ar(e,t,r,i)).parent.id,e.name),e.oc=ve[t],ve[t]=e}var Le={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Me(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Oe(e,t){return Ee?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function Ie(e,t){try{return Fe(e,t),20}catch(e){}return Oe(e,"wx")}var Pe,Se={open:function(e){e.bc=we[e.node.uc].bc,e.bc.open&&e.bc.open(e)},nc:function(){throw new Ae(70)}};function Be(e,t){we[e]={bc:t}}function Ue(e,t){var r="/"===t,i=!t;if(r&&be)throw new Ae(10);if(!r&&!i){var a=Te(t,{Oc:!1});if(t=a.path,(a=a.node).tc)throw new Ae(10);if(16384!=(61440&a.mode))throw new Ae(54)}t={type:e,Md:{},Sc:t,ld:[]},(e=e.lc(t)).lc=t,t.root=e,r?be=e:a&&(a.tc=t,a.lc&&a.lc.ld.push(t))}function De(e,t,r){var i=Te(e,{parent:!0}).node;if(!(e=ce(e))||"."===e||".."===e)throw new Ae(28);var a=Ie(i,e);if(a)throw new Ae(a);if(!i.$b.yc)throw new Ae(63);return i.$b.yc(i,e,t,r)}function Ce(e){return De(e,16895,0)}function Ve(e,t,r){void 0===r&&(r=t,t=438),De(e,8192|t,r)}function Ne(e,t){if(!ue(e))throw new Ae(44);var r=Te(t,{parent:!0}).node;if(!r)throw new Ae(44);var i=Ie(r,t=ce(t));if(i)throw new Ae(i);if(!r.$b.zc)throw new Ae(63);r.$b.zc(r,t,e)}function He(e){if(!(e=Te(e).node))throw new Ae(44);if(!e.$b.vc)throw new Ae(28);return ue(xe(e.parent),e.$b.vc(e))}function We(e,t){if(!(e=Te(e,{Gc:!t}).node))throw new Ae(44);if(!e.$b.ic)throw new Ae(63);return e.$b.ic(e)}function Ge(e){return We(e,!0)}function qe(e,t,i,a){if(""===e)throw new Ae(44);if("string"==typeof t){var n=Le[t];if(void 0===n)throw Error("Unknown file open mode: "+t);t=n}if(i=64&t?4095&(void 0===i?438:i)|32768:0,"object"==typeof e)var o=e;else{e=se(e);try{o=Te(e,{Gc:!(131072&t)}).node}catch(e){}}if(n=!1,64&t)if(o){if(128&t)throw new Ae(20)}else o=De(e,i,0),n=!0;if(!o)throw new Ae(44);if(8192==(61440&o.mode)&&(t&=-513),65536&t&&16384!=(61440&o.mode))throw new Ae(54);if(!n&&(i=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Me(t)||512&t)?31:Oe(o,Me(t)):44))throw new Ae(i);if(512&t){if(!(i="string"==typeof(i=o)?Te(i,{Gc:!0}).node:i).$b.kc)throw new Ae(63);if(16384==(61440&i.mode))throw new Ae(31);if(32768!=(61440&i.mode))throw new Ae(28);if(n=Oe(i,"w"))throw new Ae(n);i.$b.kc(i,{size:0,timestamp:Date.now()})}return t&=-131713,(a=function(e,t){Ze||((Ze=function(){}).prototype={});var r,i=new Ze;for(r in e)i[r]=e[r];return e=i,t=function(e){for(e=e||0;e<=4096;e++)if(!ge[e])return e;throw new Ae(33)}(t),e.mc=t,ge[t]=e}({node:o,path:xe(o),id:o.id,flags:t,mode:o.mode,seekable:!0,position:0,bc:o.bc,$b:o.$b,Ad:[],error:!1},a)).bc.open&&a.bc.open(a),!r.logReadFiles||1&t||(Ke||(Ke={}),e in Ke||(Ke[e]=1)),a}function Xe(e,t,r){if(null===e.mc)throw new Ae(8);if(!e.seekable||!e.bc.nc)throw new Ae(70);if(0!=r&&1!=r&&2!=r)throw new Ae(28);e.position=e.bc.nc(e,t,r),e.Ad=[]}function Ye(){Ae||((Ae=function(e,t){this.node=t,this.qd=function(e){this.hc=e},this.qd(e),this.message="FS error"}).prototype=Error(),Ae.prototype.constructor=Ae,[44].forEach((function(e){ke[e]=new Ae(e),ke[e].stack="<generic error, no stack>"})))}function je(e,t,r){e=se("/dev/"+e);var i=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);$e||($e=64);var a=$e++<<8|0;Be(a,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,r,i,a){for(var n=0,o=0;o<a;o++){try{var s=t()}catch(e){throw new Ae(29)}if(void 0===s&&0===n)throw new Ae(6);if(null==s)break;n++,r[i+o]=s}return n&&(e.node.timestamp=Date.now()),n},write:function(e,t,i,a){for(var n=0;n<a;n++)try{r(t[i+n])}catch(e){throw new Ae(29)}return a&&(e.node.timestamp=Date.now()),n}}),Ve(e,i,a)}var $e,Ze,Ke,Je={};function Qe(e,t,r){try{var i=e(t)}catch(e){if(e&&e.node&&se(t)!==se(xe(e.node)))return-54;throw e}return T[r>>2]=i.bd,T[r+4>>2]=0,T[r+8>>2]=i.Ic,T[r+12>>2]=i.mode,T[r+16>>2]=i.nd,T[r+20>>2]=i.uid,T[r+24>>2]=i.ed,T[r+28>>2]=i.uc,T[r+32>>2]=0,K=[i.size>>>0,(Z=i.size,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[r+40>>2]=K[0],T[r+44>>2]=K[1],T[r+48>>2]=4096,T[r+52>>2]=i.$c,T[r+56>>2]=i.Yc.getTime()/1e3|0,T[r+60>>2]=0,T[r+64>>2]=i.md.getTime()/1e3|0,T[r+68>>2]=0,T[r+72>>2]=i.ad.getTime()/1e3|0,T[r+76>>2]=0,K=[i.Ic>>>0,(Z=i.Ic,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[r+80>>2]=K[0],T[r+84>>2]=K[1],0}var et=void 0;function tt(){return T[(et+=4)-4>>2]}function rt(e){if(!(e=ge[e]))throw new Ae(8);return e}var it=[];function at(e,t){if(!V&&!w)if(t)e();else try{e()}catch(e){ie(e)}}function nt(e,t){setTimeout((function(){at(e)}),t)}var ot,st,_t,ct=!1,ut=null,ft=0,lt=null,dt=0,pt=0,ht=0,mt=[],bt={},wt=!1,gt=!1,yt=[];function vt(e,t,i,a){if(t&&r.Fc&&e==r.canvas)return r.Fc;var n;if(t){var o={antialias:!1,alpha:!1,kd:1};if(a)for(var s in a)o[s]=a[s];if(void 0!==Kt&&(n=function(e,t){e.Pc||(e.Pc=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.Pc(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext("webgl",t);return r?function(e,t){var r=Yt(Xt),i={Jd:r,attributes:t,version:t.kd,Ec:e};return e.canvas&&(e.canvas.Dd=i),Xt[r]=i,(void 0===t.cd||t.cd)&&function(e){if(e||(e=$t),!e.hd){e.hd=!0;var t=e.Ec;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,i,a){t.drawArraysInstancedANGLE(e,r,i,a)},e.drawElementsInstanced=function(e,r,i,a,n){t.drawElementsInstancedANGLE(e,r,i,a,n)})}(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.Gd=t.getExtension("EXT_disjoint_timer_query"),t.Kd=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}(i),r}(r,t):0}(e,o)))var _=Xt[n].Ec}else _=e.getContext("2d");return _?(i&&(t||void 0===er||j("cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),r.Fc=_,t&&($t=Xt[n],r.Fc=er=$t&&$t.Ec),r.Od=t,yt.forEach((function(e){e()})),function(){function e(){gt=document.pointerLockElement===r.canvas||document.mozPointerLockElement===r.canvas||document.webkitPointerLockElement===r.canvas||document.msPointerLockElement===r.canvas}if(r.preloadPlugins||(r.preloadPlugins=[]),!Ot){Ot=!0;try{It=!0}catch(e){It=!1,d("warning: no blob constructor, cannot create blobs with mimetypes")}Pt="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:It?null:d("warning: no BlobBuilder"),St="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,r.Uc||void 0!==St||(d("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),r.Uc=!0),r.preloadPlugins.push({canHandle:function(e){return!r.Uc&&/\\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,i,a){var n=null;if(It)try{(n=new Blob([e],{type:Ft(t)})).size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:Ft(t)}))}catch(e){!function(e){f||(f={}),f[e]||(f[e]=1,p(e))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}n||((n=new Pt).append(new Uint8Array(e).buffer),n=n.getBlob());var o=St.createObjectURL(n),s=new Image;s.onload=()=>{s.complete||j("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),r.preloadedImages[t]=a,St.revokeObjectURL(o),i&&i(e)},s.onerror=()=>{d("Image "+o+" could not be decoded"),a&&a()},s.src=o}}),r.preloadPlugins.push({canHandle:function(e){return!r.Ld&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,i,a){function n(a){s||(s=!0,r.preloadedAudios[t]=a,i&&i(e))}function o(){s||(s=!0,r.preloadedAudios[t]=new Audio,a&&a())}var s=!1;if(!It)return o();try{var _=new Blob([e],{type:Ft(t)})}catch(e){return o()}_=St.createObjectURL(_);var c=new Audio;c.addEventListener("canplaythrough",(function(){n(c)}),!1),c.onerror=function(){if(!s){d("warning: browser could not fully decode audio "+t+", trying slower base64 approach");for(var r="",i=0,a=0,o=0;o<e.length;o++)for(i=i<<8|e[o],a+=8;6<=a;){var _=i>>a-6&63;a-=6,r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_]}2==a?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&i)<<4],r+="=="):4==a&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&i)<<2],r+="="),c.src="data:audio/x-"+t.substr(-3)+";base64,"+r,n(c)}},c.src=_,nt((function(){n(c)}),1e4)}});var t=r.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),r.elementPointerLock&&t.addEventListener("click",(function(e){!gt&&r.canvas.requestPointerLock&&(r.canvas.requestPointerLock(),e.preventDefault())}),!1))}}()),_):null}var Et=!1,At=void 0,kt=void 0;function Tt(){return!!wt&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var xt=0;function Rt(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===xt)xt=t+1e3/60;else for(;t+2>=xt;)xt+=1e3/60;setTimeout(e,Math.max(xt-t,0))}}function Ft(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 zt=[];function Lt(){var e=r.canvas;zt.forEach((function(t){t(e.width,e.height)}))}function Mt(e,t,i){t&&i?(e.Bd=t,e.fd=i):(t=e.Bd,i=e.fd);var a=t,n=i;if(r.forcedAspectRatio&&0<r.forcedAspectRatio&&(a/n<r.forcedAspectRatio?a=Math.round(n*r.forcedAspectRatio):n=Math.round(a/r.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/n);a=Math.round(a*o),n=Math.round(n*o)}kt?(e.width!=a&&(e.width=a),e.height!=n&&(e.height=n),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=i&&(e.height=i),void 0!==e.style&&(a!=t||n!=i?(e.style.setProperty("width",a+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}var Ot,It,Pt,St,Bt,Ut=[];function Dt(e,t){x[e>>2]=t,x[e+4>>2]=t/4294967296|0}function Ct(e,t,r,i,a){function n(t){var r=0,i=0;t&&(i=y.response?y.response.byteLength:0,r=cr(i),E.set(new Uint8Array(y.response),r)),x[e+12>>2]=r,Dt(e+16,i)}var o=x[e+8>>2];if(o){var s=M(o),_=e+112,c=M(_);c||(c="GET");var u=x[_+52>>2],f=x[_+56>>2],l=!!x[_+60>>2],d=x[_+68>>2],p=x[_+72>>2];o=x[_+76>>2];var h=x[_+80>>2],m=x[_+84>>2];_=x[_+88>>2];var b=!!(1&u),w=!!(2&u);u=!!(64&u),d=d?M(d):void 0,p=p?M(p):void 0;var g=h?M(h):void 0,y=new XMLHttpRequest;if(y.withCredentials=l,y.open(c,s,!u,d,p),u||(y.timeout=f),y.Cd=s,y.responseType="arraybuffer",h&&y.overrideMimeType(g),o)for(;(c=x[o>>2])&&(s=x[o+4>>2]);)o+=8,c=M(c),s=M(s),y.setRequestHeader(c,s);Ut.push(y),x[e+0>>2]=Ut.length,o=m&&_?E.slice(m,m+_):null,y.onload=function(i){n(b&&!w);var a=y.response?y.response.byteLength:0;Dt(e+24,0),a&&Dt(e+32,a),k[e+40>>1]=y.readyState,k[e+42>>1]=y.status,y.statusText&&O(y.statusText,E,e+44,64),200<=y.status&&300>y.status?t&&t(e,y,i):r&&r(e,y,i)},y.onerror=function(t){n(b);var i=y.status;Dt(e+24,0),Dt(e+32,y.response?y.response.byteLength:0),k[e+40>>1]=y.readyState,k[e+42>>1]=i,r&&r(e,y,t)},y.ontimeout=function(t){r&&r(e,y,t)},y.onprogress=function(t){var r=b&&w&&y.response?y.response.byteLength:0,a=0;b&&w&&(a=cr(r),E.set(new Uint8Array(y.response),a)),x[e+12>>2]=a,Dt(e+16,r),Dt(e+24,t.loaded-r),Dt(e+32,t.total),k[e+40>>1]=y.readyState,3<=y.readyState&&0===y.status&&0<t.loaded&&(y.status=200),k[e+42>>1]=y.status,y.statusText&&O(y.statusText,E,e+44,64),i&&i(e,y,t),a&&_r(a)},y.onreadystatechange=function(t){k[e+40>>1]=y.readyState,2<=y.readyState&&(k[e+42>>1]=y.status),a&&a(e,y,t)};try{y.send(o)}catch(t){r&&r(e,y,t)}}else r(e,0,"no url specified!")}function Vt(e,t,r,i){var a=Bt;if(a){var n=x[e+112+64>>2];n||(n=x[e+8>>2]);var o=M(n);try{var s=a.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);s.onsuccess=function(){k[e+40>>1]=4,k[e+42>>1]=200,O("OK",E,e+44,64),r(e,0,o)},s.onerror=function(t){k[e+40>>1]=4,k[e+42>>1]=413,O("Payload Too Large",E,e+44,64),i(e,0,t)}}catch(t){i(e,0,t)}}else i(e,0,"IndexedDB not available!")}var Nt,Ht={};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",_:_||"./this.program"};for(e in Ht)void 0===Ht[e]?delete t[e]:t[e]=Ht[e];var r=[];for(e in t)r.push(e+"="+t[e]);Nt=r}return Nt}var Gt=1,qt=[],Xt=[];function Yt(e){for(var t=Gt++,r=e.length;r<t;r++)e[r]=null;return t}var jt,$t,Zt,Kt={};function Jt(e){return 0==e%4&&(0!=e%100||0==e%400)}function Qt(e,t){for(var r=0,i=0;i<=t;r+=e[i++]);return r}var er,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 ir(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),i=(Jt(e.getFullYear())?tr:rr)[r];if(!(t>i-e.getDate())){e.setDate(e.getDate()+t);break}t-=i-e.getDate()+1,e.setDate(1),11>r?e.setMonth(r+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ar(e,t,r,i){e||(e=this),this.parent=e,this.lc=e.lc,this.tc=null,this.id=ye++,this.name=t,this.mode=r,this.$b={},this.bc={},this.uc=i}function nr(e,t){var r=Array(I(e)+1);return e=O(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(ar.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}}}),Ye(),ve=Array(4096),Ue(me,"/"),Ce("/tmp"),Ce("/home"),Ce("/home/web_user"),function(){Ce("/dev"),Be(259,{read:function(){return 0},write:function(e,t,r,i){return i}}),Ve("/dev/null",259),le(1280,pe),le(1536,he),Ve("/dev/tty",1280),Ve("/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),Ce("/dev/shm"),Ce("/dev/shm/tmp")}(),function(){Ce("/proc");var e=Ce("/proc/self");Ce("/proc/self/fd"),Ue({lc:function(){var t=ze(e,"fd",16895,73);return t.$b={sc:function(e,t){var r=ge[+t];if(!r)throw new Ae(8);return(e={parent:null,lc:{Sc:"fake"},$b:{vc:function(){return r.path}}}).parent=e}},t}},"/proc/self/fd")}(),r.requestFullscreen=function(e,t){!function(e,t){function i(){wt=!1;var e=a.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(a.exitFullscreen=Tt,At&&a.requestPointerLock(),wt=!0,kt?("undefined"!=typeof SDL&&(T[SDL.screen>>2]=8388608|x[SDL.screen>>2]),Mt(r.canvas),Lt()):Mt(a)):(e.parentNode.insertBefore(a,e),e.parentNode.removeChild(e),kt?("undefined"!=typeof SDL&&(T[SDL.screen>>2]=-8388609&x[SDL.screen>>2]),Mt(r.canvas),Lt()):Mt(a)),r.onFullScreen&&r.onFullScreen(wt),r.onFullscreen&&r.onFullscreen(wt)}void 0===(At=e)&&(At=!0),void 0===(kt=t)&&(kt=!1);var a=r.canvas;Et||(Et=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var n=document.createElement("div");a.parentNode.insertBefore(n,a),n.appendChild(a),n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||(n.webkitRequestFullscreen?function(){n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(n.webkitRequestFullScreen?function(){n.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),n.requestFullscreen()}(e,t)},r.requestAnimationFrame=function(e){Rt(e)},r.setCanvasSize=function(e,t,i){Mt(r.canvas,e,t),i||Lt()},r.pauseMainLoop=function(){ut=null,ft++},r.resumeMainLoop=function(){ft++;var e=dt,t=pt,i=lt;lt=null,function(e){function t(){if(i<ft){if(!h)try{yr(b)}catch(e){ie(e)}return!1}return!0}!lt||j("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."),lt=e;var i=ft;ct=!1,st=function(){if(!w)if(0<mt.length){var i=Date.now(),a=mt.shift();if(a.dd(a.xc),_t){var n=_t,o=0==n%1?n-1:Math.floor(n);_t=a.Fd?o:(8*n+(o+.5))/9}d(\'main loop blocker "\'+a.name+\'" took \'+(Date.now()-i)+" ms"),r.setStatus&&(i=r.statusMessage||"Please wait...",n=bt.Hd,(a=_t)?a<n?r.setStatus(i+" ("+(n-a)+"/"+n+")"):r.setStatus(i):r.setStatus("")),t()&&setTimeout(st,0)}else t()&&(ht=ht+1|0,1==dt&&1<pt&&0!=ht%pt?ut():(0==dt&&(ot=ee()),w||r.preMainLoop&&!1===r.preMainLoop()||(at(e),r.postMainLoop&&r.postMainLoop()),t()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.od&&SDL.audio.od(),ut())))}}(i),function(e,t){if(dt=e,pt=t,lt)if(ct||(ct=!0),0==e)ut=function(){var e=0|Math.max(0,ot+t-ee());setTimeout(st,e)};else if(1==e)ut=function(){Rt(st)};else if(2==e){if("undefined"==typeof setImmediate){var i=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),i.shift()())}),!0),setImmediate=function(e){i.push(e),void 0===r.setImmediates&&(r.setImmediates=[]),r.setImmediates.push(e),postMessage({target:"setimmediate"})}}ut=function(){setImmediate(st)}}}(e,t),ut()},r.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},r.createContext=function(e,t,r,i){return vt(e,t,r,i)},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,Y()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){Bt=!1,Y()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||X();var or={y:function(e,t){return ae(e,t)},a:function(e){return cr(e+16)+16},b:function(e,t,r){throw new ne(e).gd(t,r),e},k:function(e,t,r){et=r;try{var i=rt(e);switch(t){case 0:var a=tt();return 0>a?-28:qe(i.path,i.flags,0,a).mc;case 1:case 2:case 6:case 7:return 0;case 3:return i.flags;case 4:return a=tt(),i.flags|=a,0;case 5:return a=tt(),A[a+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[fr()>>2]=28,-1}}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},E:function(e,t,r){et=r;try{var i=rt(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return i.dc?0:-59;case 21519:if(!i.dc)return-59;var a=tt();return T[a>>2]=0;case 21520:return i.dc?-28:-59;case 21531:if(e=a=tt(),!i.bc.jd)throw new Ae(59);return i.bc.jd(i,t,e);default:j("bad ioctl syscall "+t)}}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},B:function(e,t){try{return Qe(Ge,e=M(e),t)}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},o:function(e,t,r){et=r;try{return qe(M(e),t,r?tt():0).mc}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},C:function(e,t){try{return Qe(We,e=M(e),t)}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},w:function(e,t){try{return Ne(e=M(e),t=M(t)),0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},x:function(e){try{var t=Te(e=M(e),{parent:!0}).node;if(!t)throw new Ae(44);var r=ce(e),i=Fe(t,r);e:{try{var a=Fe(t,r)}catch(e){var n=e.hc;break e}n=Oe(t,"wx")||(16384==(61440&a.mode)?31:0)}if(n)throw new Ae(n);if(!t.$b.Dc)throw new Ae(63);if(i.tc)throw new Ae(10);t.$b.Dc(t,r);var o=Re(i.parent.id,i.name);if(ve[o]===i)ve[o]=i.oc;else for(var s=ve[o];s;){if(s.oc===i){s.oc=i.oc;break}s=s.oc}return 0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},F:function(e){delete Ut[e-1]},c:function(){j("")},J:ae,K:function(){self.postMessage({t:"gfx"})},q: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=cr(t);return O(e,E,r,t+1),r},L:function(){self.postMessage({t:"licerr"})},f:function(e,t,r){var i;for(it.length=0,r>>=2;i=E[t++];)(i=105>i)&&1&r&&r++,it.push(i?F[r++>>1]:T[r]),++r;return J[e].apply(null,it)},l:function(e,t,r){function i(){re(e)(t)}0<=r?nt(i,r):function(e){Rt((function(){at(e)}))}(i)},v:function(){return 2147483648},H:function(){return!1},s:function(e,t,r){E.copyWithin(e,t,t+r)},t:function(e){var t=E.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var i=t*(1+.2/r);i=Math.min(i,e+100663296),0<(i=Math.max(e,i))%65536&&(i+=65536-i%65536);e:{try{m.grow(Math.min(2147483648,i)-y.byteLength+65535>>>16),S();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},G:function(e,t,r,i,a){function n(e,r){Vt(e,r.response,(function(e){at((function(){l?re(l)(e):t&&t(e)}),y)}),(function(e){at((function(){l?re(l)(e):t&&t(e)}),y)}))}function o(e){at((function(){h?re(h)(e):a&&a(e)}),y)}function s(e){at((function(){d?re(d)(e):r&&r(e)}),y)}function _(e){at((function(){p?re(p)(e):i&&i(e)}),y)}function c(e){at((function(){l?re(l)(e):t&&t(e)}),y)}var u=e+112,f=M(u),l=x[u+36>>2],d=x[u+40>>2],p=x[u+44>>2],h=x[u+48>>2],m=x[u+52>>2],b=!!(4&m),w=!!(32&m),g=!!(16&m),y=!!(64&m);if("EM_IDB_STORE"===f)f=x[u+84>>2],Vt(e,E.slice(f,f+x[u+88>>2]),c,s);else if("EM_IDB_DELETE"===f)!function(e,t,r){var i=Bt;if(i){var a=x[e+112+64>>2];a||(a=x[e+8>>2]),a=M(a);try{var n=i.transaction(["FILES"],"readwrite").objectStore("FILES").delete(a);n.onsuccess=function(r){r=r.target.result,x[e+12>>2]=0,Dt(e+16,0),Dt(e+24,0),Dt(e+32,0),k[e+40>>1]=4,k[e+42>>1]=200,O("OK",E,e+44,64),t(e,0,r)},n.onerror=function(t){k[e+40>>1]=4,k[e+42>>1]=404,O("Not Found",E,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(g){if(w)return 0;Ct(e,b?n:c,s,_,o)}else!function(e,t,r){var i=Bt;if(i){var a=x[e+112+64>>2];a||(a=x[e+8>>2]),a=M(a);try{var n=i.transaction(["FILES"],"readonly").objectStore("FILES").get(a);n.onsuccess=function(i){if(i.target.result){var a=(i=i.target.result).byteLength||i.length,n=cr(a);E.set(new Uint8Array(i),n),x[e+12>>2]=n,Dt(e+16,a),Dt(e+24,0),Dt(e+32,a),k[e+40>>1]=4,k[e+42>>1]=200,O("OK",E,e+44,64),t(e,0,i)}else k[e+40>>1]=4,k[e+42>>1]=404,O("Not Found",E,e+44,64),r(e,0,"no data")},n.onerror=function(t){k[e+40>>1]=4,k[e+42>>1]=404,O("Not Found",E,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,w?s:b?function(e){Ct(e,n,s,_,o)}:function(e){Ct(e,c,s,_,o)});return e},z:function(e,t){var r=0;return Wt().forEach((function(i,a){var n=t+r;for(a=T[e+4*a>>2]=n,n=0;n<i.length;++n)v[a++>>0]=i.charCodeAt(n);v[a>>0]=0,r+=i.length+1})),0},A:function(e,t){var r=Wt();T[e>>2]=r.length;var i=0;return r.forEach((function(e){i+=e.length+1})),T[t>>2]=i,0},I:function(e){yr(e)},j:function(e){try{var t=rt(e);if(null===t.mc)throw new Ae(8);t.Hc&&(t.Hc=null);try{t.bc.close&&t.bc.close(t)}catch(e){throw e}finally{ge[t.mc]=null}return t.mc=null,0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},D:function(e,t,r,i){try{e:{for(var a=rt(e),n=e=0;n<r;n++){var o=T[t+(8*n+4)>>2],s=a,_=T[t+8*n>>2],c=o,u=void 0,f=v;if(0>c||0>u)throw new Ae(28);if(null===s.mc)throw new Ae(8);if(1==(2097155&s.flags))throw new Ae(8);if(16384==(61440&s.node.mode))throw new Ae(31);if(!s.bc.read)throw new Ae(28);var l=void 0!==u;if(l){if(!s.seekable)throw new Ae(70)}else u=s.position;var d=s.bc.read(s,f,_,c,u);l||(s.position+=d);var p=d;if(0>p){var h=-1;break e}if(e+=p,p<o)break}h=e}return T[i>>2]=h,0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},r:function(e,t,r,i,a){try{var n=rt(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(Xe(n,e,i),K=[n.position>>>0,(Z=n.position,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[a>>2]=K[0],T[a+4>>2]=K[1],n.Hc&&0===e&&0===i&&(n.Hc=null),0)}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},i:function(e,t,r,i){try{e:{for(var a=rt(e),n=e=0;n<r;n++){var o=a,s=T[t+8*n>>2],_=T[t+(8*n+4)>>2],c=void 0,u=v;if(0>_||0>c)throw new Ae(28);if(null===o.mc)throw new Ae(8);if(0==(2097155&o.flags))throw new Ae(8);if(16384==(61440&o.node.mode))throw new Ae(31);if(!o.bc.write)throw new Ae(28);o.seekable&&1024&o.flags&&Xe(o,0,2);var f=void 0!==c;if(f){if(!o.seekable)throw new Ae(70)}else c=o.position;var l=o.bc.write(o,u,s,_,c,void 0);f||(o.position+=l);var d=l;if(0>d){var p=-1;break e}e+=d}p=e}return T[i>>2]=p,0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},e:function(e){var t=Date.now();return T[e>>2]=t/1e3|0,T[e+4>>2]=t%1e3*1e3|0,0},m:function(e,t){er.bindTexture(e,qt[t])},n:function(e,t){for(var r=0;r<e;r++){var i=er.createTexture(),a=i&&Yt(qt);i?(i.name=a,qt[a]=i):jt||(jt=1282),T[t+4*r>>2]=a}},g:function(e,t,r,i,a,n,o,s,_){var c=er,u=c.texImage2D;if(_){var f=s-5120;f=1==f?E:4==f?T:6==f?R:5==f||28922==f?x:k;var l=31-Math.clz32(f.BYTES_PER_ELEMENT);_=f.subarray(_>>l,_+a*(i*({5:3,6:4,8:2,29502:3,29504:4}[o-6402]||1)*(1<<l)+4-1&-4)>>l)}else _=null;u.call(c,e,t,r,i,a,n,o,s,_)},h:function(e,t,r){er.texParameteri(e,t,r)},p:function(e,t){Zt||(Zt=!0,function(){function e(e){return(e=e.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?e[1]:"GMT"}var t=(new Date).getFullYear(),r=new Date(t,0,1),i=new Date(t,6,1);t=r.getTimezoneOffset();var a=i.getTimezoneOffset(),n=Math.max(t,a);T[pr()>>2]=60*n,T[dr()>>2]=Number(t!=a),r=e(r),i=e(i),r=P(r),i=P(i),a<t?(T[lr()>>2]=r,T[lr()+4>>2]=i):(T[lr()>>2]=i,T[lr()+4>>2]=r)}()),e=new Date(1e3*T[e>>2]),T[t>>2]=e.getSeconds(),T[t+4>>2]=e.getMinutes(),T[t+8>>2]=e.getHours(),T[t+12>>2]=e.getDate(),T[t+16>>2]=e.getMonth(),T[t+20>>2]=e.getFullYear()-1900,T[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);T[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,T[t+36>>2]=-60*e.getTimezoneOffset();var i=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(i!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,i)),T[t+32>>2]=e,e=T[lr()+(e?4:0)>>2],T[t+40>>2]=e,t},u:function(e,t,r,i){return function(e,t,r,i){function a(e,t,r){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=r[0]+e;return e}function n(e,t){return a(e,t,"0")}function o(e,t){function r(e){return 0>e?-1:0<e?1:0}var i;return 0===(i=r(e.getFullYear()-t.getFullYear()))&&0===(i=r(e.getMonth()-t.getMonth()))&&(i=r(e.getDate()-t.getDate())),i}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 _(e){e=ir(new Date(e.fc+1900,0,1),e.Cc);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=T[i+40>>2];for(var u in i={yd:T[i>>2],xd:T[i+4>>2],Ac:T[i+8>>2],wc:T[i+12>>2],rc:T[i+16>>2],fc:T[i+20>>2],Bc:T[i+24>>2],Cc:T[i+28>>2],Nd:T[i+32>>2],wd:T[i+36>>2],zd:c?M(c):""},r=M(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(" "),l="January February March April May June July August September October November December".split(" ");for(u in c={"%a":function(e){return f[e.Bc].substring(0,3)},"%A":function(e){return f[e.Bc]},"%b":function(e){return l[e.rc].substring(0,3)},"%B":function(e){return l[e.rc]},"%C":function(e){return n((e.fc+1900)/100|0,2)},"%d":function(e){return n(e.wc,2)},"%e":function(e){return a(e.wc,2," ")},"%g":function(e){return _(e).toString().substring(2)},"%G":function(e){return _(e)},"%H":function(e){return n(e.Ac,2)},"%I":function(e){return 0==(e=e.Ac)?e=12:12<e&&(e-=12),n(e,2)},"%j":function(e){return n(e.wc+Qt(Jt(e.fc+1900)?tr:rr,e.rc-1),3)},"%m":function(e){return n(e.rc+1,2)},"%M":function(e){return n(e.xd,2)},"%n":function(){return"\\n"},"%p":function(e){return 0<=e.Ac&&12>e.Ac?"AM":"PM"},"%S":function(e){return n(e.yd,2)},"%t":function(){return"\\t"},"%u":function(e){return e.Bc||7},"%U":function(e){var t=new Date(e.fc+1900,0,1),r=0===t.getDay()?t:ir(t,7-t.getDay());return 0>o(r,e=new Date(e.fc+1900,e.rc,e.wc))?n(Math.ceil((31-r.getDate()+(Qt(Jt(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.fc+1901,0,4),r=s(new Date(e.fc+1900,0,4));t=s(t);var i=ir(new Date(e.fc+1900,0,1),e.Cc);return 0>o(i,r)?"53":0>=o(t,i)?"01":n(Math.ceil((r.getFullYear()<e.fc+1900?e.Cc+32-r.getDate():e.Cc+1-r.getDate())/7),2)},"%w":function(e){return e.Bc},"%W":function(e){var t=new Date(e.fc,0,1),r=1===t.getDay()?t:ir(t,0===t.getDay()?1:7-t.getDay()+1);return 0>o(r,e=new Date(e.fc+1900,e.rc,e.wc))?n(Math.ceil((31-r.getDate()+(Qt(Jt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%y":function(e){return(e.fc+1900).toString().substring(2)},"%Y":function(e){return e.fc+1900},"%z":function(e){var t=0<=(e=e.wd);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.zd},"%%":function(){return"%"}})r.includes(u)&&(r=r.replace(new RegExp(u,"g"),c[u](i)));return(u=nr(r,!1)).length>t?0:(v.set(u,e),u.length-1)}(e,t,r,i)},d:function(e){var t=Date.now()/1e3|0;return e&&(T[e>>2]=t),t}},sr=function(){function e(e){r.asm=e.exports,m=r.asm.M,S(),B=r.asm.R,D.unshift(r.asm.N),Y()}var t={a:or};if(X(),r.instantiateWasm)try{return r.instantiateWasm(t,e)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}return t=function(e){var t=H;try{e:{try{if(t==H&&l){var r=new Uint8Array(l);break e}if(o){r=o(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 i=new WebAssembly.Module(r),a=new WebAssembly.Instance(i,e)}catch(t){throw e=t.toString(),p("failed to compile wasm module: "+e),(e.includes("imported Memory")||e.includes("memory import"))&&p("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,i]}(t),e(t[0]),r.asm}();r.___wasm_call_ctors=sr.N,r._zappar_has_initialized=sr.O,r._zappar_invert=sr.P,r._zappar_loaded=sr.Q,r._zappar_pipeline_create=sr.S,r._zappar_pipeline_destroy=sr.T,r._zappar_pipeline_camera_frame_submit=sr.U,r._zappar_pipeline_camera_frame_submit_raw_pointer=sr.V,r._zappar_pipeline_frame_update=sr.W,r._zappar_pipeline_camera_frame_user_data=sr.X,r._zappar_pipeline_camera_model=sr.Y,r._zappar_pipeline_frame_number=sr.Z,r._zappar_pipeline_motion_accelerometer_submit=sr._,r._zappar_pipeline_motion_rotation_rate_submit=sr.$,r._zappar_pipeline_motion_attitude_submit=sr.aa,r._zappar_pipeline_motion_attitude_matrix_submit=sr.ba,r._zappar_pipeline_camera_frame_user_facing=sr.ca,r._zappar_pipeline_camera_frame_texture_matrix=sr.da,r._zappar_pipeline_camera_pose_with_attitude=sr.ea,r._zappar_pipeline_camera_pose_with_origin=sr.fa,r._zappar_pipeline_camera_frame_camera_attitude=sr.ga,r._zappar_pipeline_camera_frame_device_attitude=sr.ha,r._zappar_pipeline_camera_frame_texture_gl=sr.ia,r._zappar_pipeline_camera_frame_upload_gl=sr.ja,r._zappar_pipeline_sequence_record_start=sr.ka,r._zappar_pipeline_sequence_record_stop=sr.la,r._zappar_pipeline_sequence_record_clear=sr.ma,r._zappar_pipeline_sequence_record_device_attitude_matrices_set=sr.na,r._zappar_pipeline_sequence_record_data_size=sr.oa,r._zappar_pipeline_sequence_record_data=sr.pa,r._zappar_pipeline_process_gl=sr.qa,r._zappar_pipeline_camera_pose_default=sr.ra,r._zappar_instant_world_tracker_create=sr.sa,r._zappar_instant_world_tracker_destroy=sr.ta,r._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=sr.ua,r._zappar_instant_world_tracker_anchor_pose_raw=sr.va,r._zappar_instant_world_tracker_enabled_set=sr.wa,r._zappar_instant_world_tracker_enabled=sr.xa,r._zappar_image_tracker_create=sr.ya,r._zappar_image_tracker_destroy=sr.za,r._zappar_image_tracker_target_load_from_memory=sr.Aa,r.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=sr.Ba;var _r=r._free=sr.Ca;r._zappar_image_tracker_anchor_count=sr.Da,r._zappar_image_tracker_anchor_id=sr.Ea,r._zappar_image_tracker_anchor_pose_raw=sr.Fa,r._zappar_image_tracker_enabled_set=sr.Ga,r._zappar_image_tracker_enabled=sr.Ha,r._zappar_image_tracker_target_loaded_version=sr.Ia,r.__Z33zappar_image_tracker_target_countP23zappar_image_tracker_ti=sr.Ja,r.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=sr.Ka,r.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=sr.La,r.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=sr.Ma,r.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=sr.Na,r.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=sr.Oa,r.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=sr.Pa,r.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=sr.Qa,r.__Z38zappar_image_tracker_target_radius_topP23zappar_image_tracker_tii=sr.Ra,r.__Z41zappar_image_tracker_target_radius_bottomP23zappar_image_tracker_tii=sr.Sa,r.__Z39zappar_image_tracker_target_side_lengthP23zappar_image_tracker_tii=sr.Ta,r.__Z49zappar_image_tracker_target_physical_scale_factorP23zappar_image_tracker_tii=sr.Ua,r._zappar_face_tracker_create=sr.Va,r._zappar_face_tracker_destroy=sr.Wa,r._zappar_face_tracker_model_load_from_memory=sr.Xa,r._zappar_face_tracker_anchor_count=sr.Ya,r._zappar_face_tracker_anchor_id=sr.Za,r._zappar_face_tracker_anchor_pose_raw=sr._a,r._zappar_face_tracker_anchor_identity_coefficients=sr.$a,r._zappar_face_tracker_anchor_expression_coefficients=sr.ab,r._zappar_face_tracker_enabled_set=sr.bb,r._zappar_face_tracker_enabled=sr.cb,r._zappar_face_tracker_max_faces_set=sr.db,r._zappar_face_tracker_max_faces=sr.eb,r._zappar_face_tracker_model_loaded_version=sr.fb,r._zappar_face_landmark_create=sr.gb,r._zappar_face_landmark_destroy=sr.hb,r.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=sr.ib,r._zappar_face_landmark_anchor_pose=sr.jb,r._zappar_barcode_finder_create=sr.kb,r._zappar_barcode_finder_destroy=sr.lb,r._zappar_barcode_finder_found_number=sr.mb,r._zappar_barcode_finder_found_text=sr.nb,r._zappar_barcode_finder_enabled_set=sr.ob,r._zappar_barcode_finder_enabled=sr.pb,r._zappar_barcode_finder_found_format=sr.qb,r._zappar_barcode_finder_formats=sr.rb,r._zappar_barcode_finder_formats_set=sr.sb;var cr=r._malloc=sr.tb;r._zappar_face_mesh_create=sr.ub,r._zappar_face_mesh_destroy=sr.vb,r.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=sr.wb,r.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=sr.xb,r.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=sr.yb,r.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=sr.zb,r.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=sr.Ab,r.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=sr.Bb,r.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=sr.Cb,r.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=sr.Db,r.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=sr.Eb,r.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=sr.Fb,r.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=sr.Gb,r._zappar_camera_source_create=sr.Hb,r._zappar_camera_source_destroy=sr.Ib,r._zappar_camera_source_start=sr.Jb,r._zappar_camera_source_pause=sr.Kb,r._zappar_camera_default_device_id=sr.Lb,r._zappar_sequence_source_create=sr.Mb,r.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=sr.Nb,r.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=sr.Ob,r.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=sr.Pb,r._zappar_sequence_source_destroy=sr.Qb,r._zappar_log_level_set=sr.Rb,r._zappar_log_level=sr.Sb,r._zappar_analytics_project_id_set=sr.Tb;var ur,fr=r.___errno_location=sr.Ub,lr=r.__get_tzname=sr.Vb,dr=r.__get_daylight=sr.Wb,pr=r.__get_timezone=sr.Xb,hr=r.stackSave=sr.Yb,mr=r.stackRestore=sr.Zb,br=r.stackAlloc=sr._b;function wr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function gr(){function e(){if(!ur&&(ur=!0,r.calledRun=!0,!w)){if(r.noFSInit||Pe||(Pe=!0,Ye(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?je("stdin",r.stdin):Ne("/dev/tty","/dev/stdin"),r.stdout?je("stdout",null,r.stdout):Ne("/dev/tty","/dev/stdout"),r.stderr?je("stderr",null,r.stderr):Ne("/dev/tty1","/dev/stderr"),qe("/dev/stdin",0),qe("/dev/stdout",1),qe("/dev/stderr",1)),Ee=!1,Q(D),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e=r.postRun.shift();C.unshift(e)}Q(C)}}if(!(0<W)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)N();Q(U),0<W||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e())}}function yr(e){b=e,h||(V=!0),b=e,h||(r.onExit&&r.onExit(e),w=!0),c(e,new wr(e))}if(r.cwrap=function(e,t,i,a){var n=(i=i||[]).every((function(e){return"number"===e}));return"string"!==t&&n&&!a?r["_"+e]:function(){return g(e,t,i,arguments)}},r.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":v[e>>0]=t;break;case"i16":A[e>>1]=t;break;case"i32":T[e>>2]=t;break;case"i64":K=[t>>>0,(Z=t,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[e>>2]=K[0],T[e+4>>2]=K[1];break;case"float":R[e>>2]=t;break;case"double":F[e>>3]=t;break;default:j("invalid type for setValue: "+r)}},r.getValue=function(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return v[e>>0];case"i16":return A[e>>1];case"i32":case"i64":return T[e>>2];case"float":return R[e>>2];case"double":return Number(F[e>>3]);default:j("invalid type for getValue: "+t)}return null},r.UTF8ToString=M,q=function e(){ur||gr(),ur||(q=e)},r.run=gr,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return gr(),t});class i{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,r=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=r)return;if(!t){let e=r;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,t=new ArrayBuffer(e)}let i=this._buffer?this._i32View:void 0;this._buffer=t,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),i&&this._i32View.set(i.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++}}class a{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)}}}class n{constructor(e,t){this._impl=e,this._sender=t,this._deserializer=new a,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 i((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(),i=this._pipeline_by_instance.get(r),a=t.string(),n=this._impl.camera_source_create(i,a);this._camera_source_by_instance.set(e,n),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(),i=this._pipeline_by_instance.get(r),a=this._impl.sequence_source_create(i);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(),i=this._pipeline_by_instance.get(r),a=this._impl.image_tracker_create(i);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(),i=this._pipeline_by_instance.get(r),a=this._impl.face_tracker_create(i);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(),i=this._impl.face_landmark_create(r);this._face_landmark_by_instance.set(e,i);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(),i=this._pipeline_by_instance.get(r),a=this._impl.barcode_finder_create(i);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(),i=this._pipeline_by_instance.get(r),a=this._impl.instant_world_tracker_create(i);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 i=this.serializersByPipelineId.get(r);i&&(i.sendMessage(7,(r=>{r.type(e),r.int(this._impl.pipeline_frame_number(t))})),i.sendMessage(6,(r=>{r.type(e),r.cameraModel(this._impl.pipeline_camera_model(t))})),i.sendMessage(5,(r=>{r.type(e),r.int(this._impl.pipeline_camera_frame_user_data(t))})),i.sendMessage(11,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_camera_attitude(t))})),i.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);t&&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);t&&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 i=this.serializersByPipelineId.get(r);if(i){i.sendMessage(19,(r=>{r.type(e),r.int(this._impl.image_tracker_target_loaded_version(t))})),i.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++)i.sendMessage(2,(i=>{i.type(e),i.int(r),i.string(this._impl.image_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)i.sendMessage(3,(i=>{i.type(e),i.int(r),i.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 i=this.serializersByPipelineId.get(r);if(i){i.sendMessage(18,(r=>{r.type(e),r.int(this._impl.face_tracker_model_loaded_version(t))})),i.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++)i.sendMessage(14,(i=>{i.type(e),i.int(r),i.string(this._impl.face_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)i.sendMessage(15,(i=>{i.type(e),i.int(r),i.matrix4x4(this._impl.face_tracker_anchor_pose_raw(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)i.sendMessage(16,(i=>{i.type(e),i.int(r),i.identityCoefficients(this._impl.face_tracker_anchor_identity_coefficients(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)i.sendMessage(17,(i=>{i.type(e),i.int(r),i.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);t&&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);t&&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 i=this.serializersByPipelineId.get(r);if(i){i.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++)i.sendMessage(9,(i=>{i.type(e),i.int(r),i.string(this._impl.barcode_finder_found_text(t,r))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)i.sendMessage(10,(i=>{i.type(e),i.int(r),i.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 i=this.serializersByPipelineId.get(r);i&&i.sendMessage(4,(r=>{r.type(e),r.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(t))}))}}}class o{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]()}}class s{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)}}var _,c,u,f,l,d="undefined"!=typeof Float32Array?Float32Array:Array;function p(){var e=new d(16);return d!=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 h(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}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),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"}(_||(_={})),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"}(c||(c={})),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"}(u||(u={})),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"}(f||(f={})),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"}(l||(l={}));const m=new Map;class b{constructor(e){this._gl=e,this._viewports=[],this._underlyingViewport=this._gl.viewport,this._viewports.push(this._gl.getParameter(this._gl.VIEWPORT)),this._gl.viewport=(e,t,r,i)=>{this._viewports[this._viewports.length-1]=[e,t,r,i],this._underlyingViewport.call(this._gl,e,t,r,i)}}static get(e){let t=m.get(e);return t||(t=new b(e),m.set(e,t)),t}push(){this._viewports.push(this._viewports[this._viewports.length-1])}pop(){const e=this._viewports.pop(),t=this._viewports[this._viewports.length-1];e&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||this._underlyingViewport.call(this._gl,t[0],t[1],t[2],t[3])}}var w,g=r(238);!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(w||(w={}));let y={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=y,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),y.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),y.preferImageBitmapCamera=!0));let v=new g.UAParser,E=(v.getOS().name||"unknown").toLowerCase(),A=(v.getEngine().name||"unknown").toLowerCase();function k(e){let t=e.split(".");if(t.length>=2){const e=parseInt(t[0]),r=parseInt(t[1]);(e<11||11===e&&r<3)&&(y.blacklisted=!0),(e<12||12===e&&r<2)&&(y.videoElementInDOM=!0),(12===e&&r>=2||e>=13)&&(y.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(y.showSafariPermissionsResetIfNecessary=!0),(e>=12&&r>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(y.requestHighFrameRate=!0,e<14&&(y.videoHeight=360,y.dataHeight=180))}}function T(e,t,r){let i=e.createShader(t);if(!i)throw new Error("Unable to create shader");e.shaderSource(i,r),e.compileShader(i);let a=e.getShaderInfoLog(i);if(a&&a.trim().length>0)throw new Error("Shader compile error: "+a);return i}"webkit"===A&&"ios"!==E&&(y.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&k("15.0")),"webkit"===A&&"ios"===E&&(y.deviceMotionMutliplier=1,k(v.getOS().version||"15.0"));class x{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=p(),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,i){let a=this._gl;const n=b.get(a);n.push();const o=a.isEnabled(a.SCISSOR_TEST),s=a.isEnabled(a.DEPTH_TEST),_=a.isEnabled(a.BLEND),c=a.isEnabled(a.CULL_FACE),u=a.getParameter(a.ACTIVE_TEXTURE),f=a.getParameter(a.UNPACK_FLIP_Y_WEBGL),l=a.getParameter(a.CURRENT_PROGRAM);a.activeTexture(a.TEXTURE0);const d=a.getParameter(a.TEXTURE_BINDING_2D),p=a.getParameter(a.FRAMEBUFFER_BINDING),h=a.getParameter(a.ARRAY_BUFFER_BINDING),m=a.getParameter(a.ELEMENT_ARRAY_BUFFER_BINDING);a.disable(a.SCISSOR_TEST),a.disable(a.DEPTH_TEST),a.disable(a.BLEND),a.disable(a.CULL_FACE),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),a.bindTexture(a.TEXTURE_2D,e);const w=a.RGBA,g=a.RGBA,v=a.UNSIGNED_BYTE;a.texImage2D(a.TEXTURE_2D,0,w,g,v,t);let E=0,A=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(E=t.videoWidth,A=t.videoHeight):(E=t.width,A=t.height),A>E&&(A=[E,E=A][0]),this._updateTransforms(r,i);let k=this._getFramebuffer(a,y.dataWidth/4,y.dataHeight),T=this._getVertexBuffer(a),x=this._getIndexBuffer(a),R=this._getGreyscaleShader(a);const F=a.getVertexAttrib(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_SIZE),z=a.getVertexAttrib(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_TYPE),L=a.getVertexAttrib(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_NORMALIZED),M=a.getVertexAttrib(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_STRIDE),O=a.getVertexAttribOffset(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_POINTER),I=a.getVertexAttrib(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_ENABLED),P=a.getVertexAttrib(R.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),S=a.getVertexAttrib(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_SIZE),B=a.getVertexAttrib(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_TYPE),U=a.getVertexAttrib(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_NORMALIZED),D=a.getVertexAttrib(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_STRIDE),C=a.getVertexAttribOffset(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_POINTER),V=a.getVertexAttrib(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_ENABLED),N=a.getVertexAttrib(R.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);a.bindFramebuffer(a.FRAMEBUFFER,k),a.viewport(0,0,this._framebufferWidth,this._framebufferHeight),a.clear(a.COLOR_BUFFER_BIT),a.bindBuffer(a.ARRAY_BUFFER,T),a.vertexAttribPointer(R.aVertexPositionLoc,2,a.FLOAT,!1,16,0),a.enableVertexAttribArray(R.aVertexPositionLoc),a.vertexAttribPointer(R.aTextureCoordLoc,2,a.FLOAT,!1,16,8),a.enableVertexAttribArray(R.aTextureCoordLoc),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,x),a.useProgram(R.program),a.uniform1f(R.uTexWidthLoc,y.dataWidth),a.uniformMatrix4fv(R.uUvTransformLoc,!1,this._cameraUvTransform),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,e),a.uniform1i(R.uSamplerLoc,0),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0),a.bindBuffer(a.ARRAY_BUFFER,P),a.vertexAttribPointer(R.aVertexPositionLoc,F,z,L,M,O),a.bindBuffer(a.ARRAY_BUFFER,N),a.vertexAttribPointer(R.aTextureCoordLoc,S,B,U,D,C),a.bindBuffer(a.ARRAY_BUFFER,h),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,m),I||a.disableVertexAttribArray(R.aVertexPositionLoc),V||a.disableVertexAttribArray(R.aTextureCoordLoc),a.bindFramebuffer(a.FRAMEBUFFER,p),a.useProgram(l),a.bindTexture(a.TEXTURE_2D,d),a.activeTexture(u),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,f),n.pop(),_&&a.enable(a.BLEND),c&&a.enable(a.CULL_FACE),s&&a.enable(a.DEPTH_TEST),o&&a.enable(a.SCISSOR_TEST)}readFrame(e,t){let r=this._gl,i=new Uint8Array(t);const a=r.getParameter(r.FRAMEBUFFER_BINDING);let n=this._getFramebuffer(r,y.dataWidth/4,y.dataHeight);return r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,a),{uvTransform:this._cameraUvTransform,data:t,texture:e,dataWidth:y.dataWidth,dataHeight:y.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);const i=e.getParameter(e.TEXTURE_BINDING_2D);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 a=e.checkFramebufferStatus(e.FRAMEBUFFER);if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete: "+a.toString());return this._framebufferWidth=t,this._framebufferHeight=r,e.bindTexture(e.TEXTURE_2D,i),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=T(e,e.VERTEX_SHADER,M),i=T(e,e.FRAGMENT_SHADER,O);e.attachShader(t,r),e.attachShader(t,i),function(e,t){e.linkProgram(t);let r=e.getProgramInfoLog(t);if(r&&r.trim().length>0)throw new Error("Unable to link: "+r)}(e,t);let a=e.getUniformLocation(t,"uTexWidth");if(!a)throw new Error("Unable to get uniform location uTexWidth");let n=e.getUniformLocation(t,"uUvTransform");if(!n)throw new Error("Unable to get uniform location uUvTransform");let o=e.getUniformLocation(t,"uSampler");if(!o)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:n,uSamplerLoc:o},this._greyscaleShader}}let R,F,z,L,M="\\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",O="\\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";var I=function(e,t,r,i){return new(r||(r=Promise))((function(a,n){function o(e){try{_(i.next(e))}catch(e){n(e)}}function s(e){try{_(i.throw(e))}catch(e){n(e)}}function _(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}_((i=i.apply(e,t||[])).next())}))};let P=new class{constructor(){this.onOutgoingMessage=new o,this.onIncomingMessage=new s,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}},S=0;function B(e){return I(this,void 0,void 0,(function*(){let r=t({locateFile:(t,r)=>t.endsWith("zcv.wasm")?e:r+t,onRuntimeInitialized:()=>{let e=function(e){let t=e.cwrap("zappar_log_level","number",[]),r=e.cwrap("zappar_log_level_set",null,["number"]),i=e.cwrap("zappar_analytics_project_id_set",null,["string"]),a=e.cwrap("zappar_pipeline_create","number",[]),n=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"]),_=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_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"]),w=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"]),v=e.cwrap("zappar_sequence_source_destroy",null,["number"]),E=e.cwrap("zappar_image_tracker_create","number",["number"]),A=e.cwrap("zappar_image_tracker_destroy",null,["number"]),k=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),T=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),x=e.cwrap("zappar_image_tracker_enabled","number",["number"]),R=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),F=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),z=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),L=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),M=e.cwrap("zappar_face_tracker_create","number",["number"]),O=e.cwrap("zappar_face_tracker_destroy",null,["number"]),I=e.cwrap("zappar_face_tracker_model_load_from_memory",null,["number","number","number"]),P=e.cwrap("zappar_face_tracker_model_loaded_version","number",["number"]),S=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),B=e.cwrap("zappar_face_tracker_enabled","number",["number"]),U=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),D=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),C=e.cwrap("zappar_face_tracker_anchor_count","number",["number"]),V=e.cwrap("zappar_face_tracker_anchor_id","string",["number","number"]),N=e.cwrap("zappar_face_tracker_anchor_pose_raw","number",["number","number"]),H=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),W=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),G=e.cwrap("zappar_face_mesh_create","number",[]),q=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"]),j=e.cwrap("zappar_barcode_finder_create","number",["number"]),$=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),Z=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),K=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),J=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"]),ie=e.cwrap("zappar_instant_world_tracker_create","number",["number"]),ae=e.cwrap("zappar_instant_world_tracker_destroy",null,["number"]),ne=e.cwrap("zappar_instant_world_tracker_enabled_set",null,["number","number"]),oe=e.cwrap("zappar_instant_world_tracker_enabled","number",["number"]),se=e.cwrap("zappar_instant_world_tracker_anchor_pose_raw","number",["number"]),_e=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=(e._malloc(64),new Map),le=(t,r)=>{let i=fe.get(t);return(!i||i[0]<r)&&(i&&e._free(i[1]),i=[r,e._malloc(r)],fe.set(t,i)),i[1]};return{log_level:()=>t(),log_level_set:e=>r(e),analytics_project_id_set:e=>i(e),pipeline_create:()=>a(),pipeline_destroy:()=>{n()},pipeline_frame_update:e=>o(e),pipeline_frame_number:e=>s(e),pipeline_camera_model:t=>{let r=_(t),i=new Float32Array(6);return i.set(e.HEAPF32.subarray(r/4,6+r/4)),r=i,r},pipeline_camera_frame_user_data:e=>c(e),pipeline_camera_frame_submit:(t,r,i,a,n,o,s,_)=>{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 l=i,d=a,p=n,h=le(4,o.byteLength);e.HEAPF32.set(o,h/4);let m=le(5,s.byteLength);return e.HEAPF32.set(s,m/4),u(t,c,f,l,d,p,h,m,_?1:0)},pipeline_camera_frame_submit_raw_pointer:(t,r,i,a,n,o,s,_,c,u,l)=>{let d=r,p=i,h=a,m=n,b=o,w=s,g=le(6,_.byteLength);e.HEAPF32.set(_,g/4);let y=c,v=le(8,u.byteLength);return e.HEAPF32.set(u,v/4),f(t,d,p,h,m,b,w,g,y,v,l?1:0)},pipeline_camera_frame_camera_attitude:t=>{let r=l(t),i=new Float32Array(16);return i.set(e.HEAPF32.subarray(r/4,16+r/4)),r=i,r},pipeline_camera_frame_device_attitude:t=>{let r=d(t),i=new Float32Array(16);return i.set(e.HEAPF32.subarray(r/4,16+r/4)),r=i,r},pipeline_motion_accelerometer_submit:(e,t,r,i,a)=>p(e,t,r,i,a),pipeline_motion_rotation_rate_submit:(e,t,r,i,a)=>h(e,t,r,i,a),pipeline_motion_attitude_submit:(e,t,r,i,a)=>m(e,t,r,i,a),pipeline_motion_attitude_matrix_submit:(t,r)=>{let i=le(0,r.byteLength);return e.HEAPF32.set(r,i/4),b(t,i)},camera_source_create:(e,t)=>w(e,t),camera_source_destroy:()=>{g()},sequence_source_create:e=>y(e),sequence_source_destroy:()=>{v()},image_tracker_create:e=>E(e),image_tracker_destroy:()=>{A()},image_tracker_target_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(ue),ce=r.byteLength,ue=e._malloc(ce));let i=ue,a=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),ue),k(t,i,a)},image_tracker_target_loaded_version:e=>T(e),image_tracker_enabled:e=>{let t=x(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>R(e,t?1:0),image_tracker_anchor_count:e=>F(e),image_tracker_anchor_id:(e,t)=>z(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let i=L(t,r),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(i/4,16+i/4)),i=a,i},face_tracker_create:e=>M(e),face_tracker_destroy:()=>{O()},face_tracker_model_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(ue),ce=r.byteLength,ue=e._malloc(ce));let i=ue,a=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),ue),I(t,i,a)},face_tracker_model_loaded_version:e=>P(e),face_tracker_enabled_set:(e,t)=>S(e,t?1:0),face_tracker_enabled:e=>{let t=B(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>U(e,t),face_tracker_max_faces:e=>D(e),face_tracker_anchor_count:e=>C(e),face_tracker_anchor_id:(e,t)=>V(e,t),face_tracker_anchor_pose_raw:(t,r)=>{let i=N(t,r),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(i/4,16+i/4)),i=a,i},face_tracker_anchor_identity_coefficients:(t,r)=>{let i=H(t,r),a=new Float32Array(50);return a.set(e.HEAPF32.subarray(i/4,50+i/4)),i=a,i},face_tracker_anchor_expression_coefficients:(t,r)=>{let i=W(t,r),a=new Float32Array(29);return a.set(e.HEAPF32.subarray(i/4,29+i/4)),i=a,i},face_mesh_create:()=>G(),face_mesh_destroy:()=>{q()},face_landmark_create:e=>X(e),face_landmark_destroy:()=>{Y()},barcode_finder_create:e=>j(e),barcode_finder_destroy:()=>{$()},barcode_finder_enabled_set:(e,t)=>Z(e,t?1:0),barcode_finder_enabled:e=>{let t=K(e);return t=1===t,t},barcode_finder_found_number:e=>J(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=>ie(e),instant_world_tracker_destroy:()=>{ae()},instant_world_tracker_enabled_set:(e,t)=>ne(e,t?1:0),instant_world_tracker_enabled:e=>{let t=oe(e);return t=1===t,t},instant_world_tracker_anchor_pose_raw:t=>{let r=se(t),i=new Float32Array(16);return i.set(e.HEAPF32.subarray(r/4,16+r/4)),r=i,r},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,i,a)=>_e(e,t,r,i,a)}}(r),t=new n(e,((e,t)=>{P.postOutgoingMessage({p:e,t:"zappar",d:t},[t])}));P.postOutgoingMessage("loaded",[]),P.onIncomingMessage.bind((i=>{var a;switch(i.t){case"zappar":t.processBuffer(i.d),P.postOutgoingMessage({t:"buf",d:i.d},[i.d]);break;case"buf":null===(a=t.serializersByPipelineId.get(i.p))||void 0===a||a.bufferReturn(i.d);break;case"cameraFrameC2S":{let r,a=i,n=t._pipeline_by_instance.get(a.p);n&&(e.pipeline_camera_frame_submit(n,a.d,a.width,a.height,a.token,a.c2d,a.cm,a.userFacing),e.pipeline_frame_update(n),r=e.pipeline_camera_frame_device_attitude(n),t.exploreState());let o={token:a.token,d:a.d,p:a.p,t:"cameraFrameRecycleS2C",att:r};P.postOutgoingMessage(o,[a.d]);break}case"streamC2S":{let a=i;!function(e,t,r,i,a,n,o){I(this,void 0,void 0,(function*(){const s=yield r.getReader();for(;;){let r=yield s.read();if(r.done)return void console.log("Stream done");let u=r.value,f=u.allocationSize();f>D&&(U>0&&e._free(U),U=e._malloc(f),D=f),yield u.copyTo(e.HEAPU8.subarray(U,U+D));let l=C;C++;const d=u.visibleRect.width,p=u.visibleRect.height;let m,b=d,w=p;switch(S){case 270:m=new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]),b=p,w=d;break;case 180:m=new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);break;case 90:m=new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1]),b=p,w=d;break;default:m=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}let g=u.clone();a?(c=[-1,1,-1],(_=V)[0]=c[0],_[1]=0,_[2]=0,_[3]=0,_[4]=0,_[5]=c[1],_[6]=0,_[7]=0,_[8]=0,_[9]=0,_[10]=c[2],_[11]=0,_[12]=0,_[13]=0,_[14]=0,_[15]=1):h(V);let v=300*y.dataWidth/320;N[0]=v,N[1]=v,N[2]=.5*y.dataWidth,N[3]=.5*y.dataHeight;const E={token:l,d:g,p:i,t:"videoFrameS2C",userFacing:a,uvTransform:m,w:b,h:w,cameraToDevice:V,cameraModel:N,source:o};P.postOutgoingMessage(E,[E.d,E.uvTransform.buffer]);const A=n._pipeline_by_instance.get(i);A&&(t.pipeline_camera_frame_submit_raw_pointer(A,U,f,H(u.format),d,p,l,V,S,N,a),t.pipeline_frame_update(A),n.exploreState()),u.close()}var _,c}))}(r,e,a.s,a.p,a.userFacing,t,a.source);break}case"cameraToScreenC2S":S=i.r;break;case"imageBitmapC2S":!function(e,t,r,i){const[a,n]=function(){if(!z||!L){const e=new OffscreenCanvas(1,1);if(L=e.getContext("webgl"),!L)throw new Error("Unable to get offscreen GL context");z=new x(L)}return[z,L]}();if(F||(F=n.createTexture(),n.bindTexture(n.TEXTURE_2D,F),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR)),!F)return;(!R||R.byteLength<y.dataWidth*y.dataHeight)&&(console.log("Generating pixel buffer",y.dataWidth*y.dataHeight),R=new ArrayBuffer(y.dataWidth*y.dataHeight)),a.uploadFrame(F,e.i,e.r,e.userFacing);let o=a.readFrame(F,R),s={t:"imageBitmapS2C",dataWidth:o.dataWidth,dataHeight:o.dataHeight,frame:e.i,userFacing:o.userFacing,uvTransform:o.uvTransform||p(),tokenId:e.tokenId,p:e.p};i.postOutgoingMessage(s,[e.i]);let _=r._pipeline_by_instance.get(e.p);_&&(t.pipeline_camera_frame_submit(_,R,o.dataWidth,o.dataHeight,e.tokenId,e.cameraToDevice,e.cameraModel,o.userFacing),t.pipeline_frame_update(_),r.exploreState())}(i,e,t,P)}}))}})}))}let U=0,D=0,C=1;const V=p(),N=new Float32Array([300,300,160,120,0,0]);function H(e){switch(e){case"I420":return l.FRAME_PIXEL_FORMAT_I420;case"I420A":return l.FRAME_PIXEL_FORMAT_I420A;case"I422":return l.FRAME_PIXEL_FORMAT_I422;case"I444":return l.FRAME_PIXEL_FORMAT_I444;case"NV12":return l.FRAME_PIXEL_FORMAT_NV12;case"RGBA":case"RGBX":return l.FRAME_PIXEL_FORMAT_RGBA;case"BGRA":case"BGRX":return l.FRAME_PIXEL_FORMAT_BGRA}return l.FRAME_PIXEL_FORMAT_Y}const W=self;P.onOutgoingMessage.bind((()=>{let e=P.getOutgoingMessages();for(let t of e)W.postMessage(t.msg,t.transferables)}));let G=e=>{e&&e.data&&"wasm"===e.data.t&&(B(location.href.startsWith("blob")?e.data.url:new URL(r(394),r.b).toString()),W.removeEventListener("message",G))};W.addEventListener("message",G),W.addEventListener("message",(e=>{P.postIncomingMessage(e.data)}))})()})();',"Worker",void 0,r.p+"zappar-cv.worker.js")}},477:e=>{"use strict";e.exports=function(e,t,r,i){var a=self||window;try{try{var n;try{n=new a.Blob([e])}catch(t){(n=new(a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder)).append(e),n=n.getBlob()}var s=a.URL||a.webkitURL,o=s.createObjectURL(n),_=new a[t](o,r);return s.revokeObjectURL(o),_}catch(i){return new a[t]("data:application/javascript,".concat(encodeURIComponent(e)),r)}}catch(e){if(!i)throw Error("Inline worker is not supported");return new a[t](i,r)}}},698:(e,t,r)=>{"use strict";e.exports=r.p+"b4f46e148a3b3b5aef90.zbin"},825:(e,t,r)=>{"use strict";e.exports=r.p+"f7b62a3a53b5c9b3222b.zbin"},367:(e,t,r)=>{"use strict";e.exports=r.p+"482727c0e7dd40d73f5a.zbin"},394:(e,t,r)=>{"use strict";e.exports=r.p+"6a8309f88f836a752c68.wasm"}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}r.m=e,r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.u=e=>e+".zappar-cv.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.b=document.baseURI||self.location.href;var i={};return(()=>{"use strict";r.r(i),r.d(i,{barcode_format_t:()=>Z,face_landmark_name_t:()=>$,initialize:()=>bt,instant_world_tracker_transform_orientation_t:()=>K,log_level_t:()=>J});class e{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,r=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=r)return;if(!t){let e=r;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,t=new ArrayBuffer(e)}let i=this._buffer?this._i32View:void 0;this._buffer=t,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),i&&this._i32View.set(i.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++}}class t{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)}}}class a{constructor(r){this._messageSender=r,this._globalState={log_level:1},this.serializer=new e((e=>{this._messageSender(e)})),this.deserializer=new t,this._latestId=1,this._pipeline_state_by_instance=new Map,this._camera_source_state_by_instance=new Map,this._sequence_source_state_by_instance=new Map,this._image_tracker_state_by_instance=new Map,this._face_tracker_state_by_instance=new Map,this._face_mesh_state_by_instance=new Map,this._face_landmark_state_by_instance=new Map,this._barcode_finder_state_by_instance=new Map,this._instant_world_tracker_state_by_instance=new Map,this.impl={log_level:()=>this._globalState.log_level,log_level_set:e=>{this.serializer.sendMessage(34,(t=>{t.logLevel(e)}))},analytics_project_id_set:e=>{this.serializer.sendMessage(31,(t=>{t.string(e)}))},pipeline_create:()=>{let e=this._latestId++,t={current_frame_user_data:0,camera_model:new Float32Array([300,300,160,120,0,0]),camera_pose:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),camera_frame_camera_attitude:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),camera_frame_device_attitude:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),frame_number:0};return this._pipeline_state_by_instance.set(e,t),this.serializer.sendMessage(27,(t=>{t.type(e)})),e},pipeline_destroy:e=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this._pipeline_state_by_instance.delete(e),this.serializer.sendMessage(28,(t=>{t.type(e)}))},pipeline_frame_update:e=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(9,(t=>{t.type(e)}))},pipeline_frame_number:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.frame_number},pipeline_camera_model:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.camera_model},pipeline_camera_frame_user_data:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.current_frame_user_data},pipeline_camera_frame_submit:(e,t,r,i,a,n,s,o)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(8,(_=>{_.type(e),_.dataWithLength(t),_.int(r),_.int(i),_.int(a),_.matrix4x4(n),_.cameraModel(s),_.bool(o)}))},pipeline_camera_frame_submit_raw_pointer:(e,t,r,i,a,n,s,o,_,c,l)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed")},pipeline_camera_frame_camera_attitude:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.camera_frame_camera_attitude},pipeline_camera_frame_device_attitude:e=>{let t=this._pipeline_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.camera_frame_device_attitude},pipeline_motion_accelerometer_submit:(e,t,r,i,a)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(10,(n=>{n.type(e),n.timestamp(t),n.float(r),n.float(i),n.float(a)}))},pipeline_motion_rotation_rate_submit:(e,t,r,i,a)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(11,(n=>{n.type(e),n.timestamp(t),n.float(r),n.float(i),n.float(a)}))},pipeline_motion_attitude_submit:(e,t,r,i,a)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(12,(n=>{n.type(e),n.timestamp(t),n.float(r),n.float(i),n.float(a)}))},pipeline_motion_attitude_matrix_submit:(e,t)=>{if(!this._pipeline_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(13,(r=>{r.type(e),r.matrix4x4(t)}))},camera_source_create:(e,t)=>{let r=this._latestId++;return this._camera_source_state_by_instance.set(r,{}),this.serializer.sendMessage(29,(i=>{i.type(r),i.type(e),i.string(t)})),r},camera_source_destroy:e=>{if(!this._camera_source_state_by_instance.get(e))throw new Error("This object has been destroyed");this._camera_source_state_by_instance.delete(e),this.serializer.sendMessage(30,(t=>{t.type(e)}))},sequence_source_create:e=>{let t=this._latestId++;return this._sequence_source_state_by_instance.set(t,{}),this.serializer.sendMessage(35,(r=>{r.type(t),r.type(e)})),t},sequence_source_destroy:e=>{if(!this._sequence_source_state_by_instance.get(e))throw new Error("This object has been destroyed");this._sequence_source_state_by_instance.delete(e),this.serializer.sendMessage(36,(t=>{t.type(e)}))},image_tracker_create:e=>{let t=this._latestId++;return this._image_tracker_state_by_instance.set(t,{enabled:!0,target_loaded_version:-1,anchor_count:0,anchor_id:[],anchor_pose:[]}),this.serializer.sendMessage(2,(r=>{r.type(t),r.type(e)})),t},image_tracker_destroy:e=>{if(!this._image_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this._image_tracker_state_by_instance.delete(e),this.serializer.sendMessage(14,(t=>{t.type(e)}))},image_tracker_target_load_from_memory:(e,t)=>{if(!this._image_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(4,(r=>{r.type(e),r.dataWithLength(t)}))},image_tracker_target_loaded_version:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.target_loaded_version},image_tracker_enabled:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},image_tracker_enabled_set:(e,t)=>{if(!this._image_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(3,(r=>{r.type(e),r.bool(t)}))},image_tracker_anchor_count:e=>{let t=this._image_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.anchor_count},image_tracker_anchor_id:(e,t)=>{let r=this._image_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_id[t]},image_tracker_anchor_pose_raw:(e,t)=>{let r=this._image_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_pose[t]},face_tracker_create:e=>{let t=this._latestId++;return this._face_tracker_state_by_instance.set(t,{enabled:!0,model_loaded:-1,max_faces:1,anchor_count:0,anchor_id:[],anchor_pose:[],anchor_identity_coefficients:[],anchor_expression_coefficients:[]}),this.serializer.sendMessage(20,(r=>{r.type(t),r.type(e)})),t},face_tracker_destroy:e=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this._face_tracker_state_by_instance.delete(e),this.serializer.sendMessage(21,(t=>{t.type(e)}))},face_tracker_model_load_from_memory:(e,t)=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(22,(r=>{r.type(e),r.dataWithLength(t)}))},face_tracker_model_loaded_version:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.model_loaded},face_tracker_enabled_set:(e,t)=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(23,(r=>{r.type(e),r.bool(t)}))},face_tracker_enabled:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},face_tracker_max_faces_set:(e,t)=>{if(!this._face_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(24,(r=>{r.type(e),r.int(t)}))},face_tracker_max_faces:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.max_faces},face_tracker_anchor_count:e=>{let t=this._face_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.anchor_count},face_tracker_anchor_id:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_id[t]},face_tracker_anchor_pose_raw:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_pose[t]},face_tracker_anchor_identity_coefficients:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_identity_coefficients[t]},face_tracker_anchor_expression_coefficients:(e,t)=>{let r=this._face_tracker_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.anchor_expression_coefficients[t]},face_mesh_create:()=>{let e=this._latestId++;return this._face_mesh_state_by_instance.set(e,{}),this.serializer.sendMessage(25,(t=>{t.type(e)})),e},face_mesh_destroy:e=>{if(!this._face_mesh_state_by_instance.get(e))throw new Error("This object has been destroyed");this._face_mesh_state_by_instance.delete(e),this.serializer.sendMessage(26,(t=>{t.type(e)}))},face_landmark_create:e=>{let t=this._latestId++;return this._face_landmark_state_by_instance.set(t,{}),this.serializer.sendMessage(32,(r=>{r.type(t),r.faceLandmarkName(e)})),t},face_landmark_destroy:e=>{if(!this._face_landmark_state_by_instance.get(e))throw new Error("This object has been destroyed");this._face_landmark_state_by_instance.delete(e),this.serializer.sendMessage(33,(t=>{t.type(e)}))},barcode_finder_create:e=>{let t=this._latestId++;return this._barcode_finder_state_by_instance.set(t,{enabled:!0,number_found:0,found_text:[],found_format:[],formats:131071}),this.serializer.sendMessage(16,(r=>{r.type(t),r.type(e)})),t},barcode_finder_destroy:e=>{if(!this._barcode_finder_state_by_instance.get(e))throw new Error("This object has been destroyed");this._barcode_finder_state_by_instance.delete(e),this.serializer.sendMessage(17,(t=>{t.type(e)}))},barcode_finder_enabled_set:(e,t)=>{if(!this._barcode_finder_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(18,(r=>{r.type(e),r.bool(t)}))},barcode_finder_enabled:e=>{let t=this._barcode_finder_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},barcode_finder_found_number:e=>{let t=this._barcode_finder_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.number_found},barcode_finder_found_text:(e,t)=>{let r=this._barcode_finder_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.found_text[t]},barcode_finder_found_format:(e,t)=>{let r=this._barcode_finder_state_by_instance.get(e);if(!r)throw new Error("This object has been destroyed");return r.found_format[t]},barcode_finder_formats:e=>{let t=this._barcode_finder_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.formats},barcode_finder_formats_set:(e,t)=>{if(!this._barcode_finder_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(19,(r=>{r.type(e),r.barcodeFormat(t)}))},instant_world_tracker_create:e=>{let t=this._latestId++,r={enabled:!0,pose:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};return this._instant_world_tracker_state_by_instance.set(t,r),this.serializer.sendMessage(5,(r=>{r.type(t),r.type(e)})),t},instant_world_tracker_destroy:e=>{if(!this._instant_world_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this._instant_world_tracker_state_by_instance.delete(e),this.serializer.sendMessage(15,(t=>{t.type(e)}))},instant_world_tracker_enabled_set:(e,t)=>{if(!this._instant_world_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(6,(r=>{r.type(e),r.bool(t)}))},instant_world_tracker_enabled:e=>{let t=this._instant_world_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.enabled},instant_world_tracker_anchor_pose_raw:e=>{let t=this._instant_world_tracker_state_by_instance.get(e);if(!t)throw new Error("This object has been destroyed");return t.pose},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,i,a)=>{if(!this._instant_world_tracker_state_by_instance.get(e))throw new Error("This object has been destroyed");this.serializer.sendMessage(7,(n=>{n.type(e),n.float(t),n.float(r),n.float(i),n.instantTrackerTransformOrientation(a)}))}}}processMessages(e){this.deserializer.setData(e),this.deserializer.forMessages(((e,t)=>{switch(e){case 7:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.frame_number=t.int();break}case 6:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.camera_model=t.cameraModel();break}case 5:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.current_frame_user_data=t.int();break}case 11:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.camera_frame_camera_attitude=t.matrix4x4();break}case 12:{let e=t.type(),r=this._pipeline_state_by_instance.get(e);if(!r)return;r.camera_frame_device_attitude=t.matrix4x4();break}case 19:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;r.target_loaded_version=t.int();break}case 1:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;r.anchor_count=t.int();break}case 2:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;let i=t.int();r.anchor_id[i]=t.string();break}case 3:{let e=t.type(),r=this._image_tracker_state_by_instance.get(e);if(!r)return;let i=t.int();r.anchor_pose[i]=t.matrix4x4();break}case 18:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;r.model_loaded=t.int();break}case 13:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;r.anchor_count=t.int();break}case 14:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let i=t.int();r.anchor_id[i]=t.string();break}case 15:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let i=t.int();r.anchor_pose[i]=t.matrix4x4();break}case 16:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let i=t.int();r.anchor_identity_coefficients[i]=t.identityCoefficients();break}case 17:{let e=t.type(),r=this._face_tracker_state_by_instance.get(e);if(!r)return;let i=t.int();r.anchor_expression_coefficients[i]=t.expressionCoefficients();break}case 8:{let e=t.type(),r=this._barcode_finder_state_by_instance.get(e);if(!r)return;r.number_found=t.int();break}case 9:{let e=t.type(),r=this._barcode_finder_state_by_instance.get(e);if(!r)return;let i=t.int();r.found_text[i]=t.string();break}case 10:{let e=t.type(),r=this._barcode_finder_state_by_instance.get(e);if(!r)return;let i=t.int();r.found_format[i]=t.barcodeFormat();break}case 4:{let e=t.type(),r=this._instant_world_tracker_state_by_instance.get(e);if(!r)return;r.pose=t.matrix4x4();break}}}))}}function n(e,t,r){let i=e.createShader(t);if(!i)throw new Error("Unable to create shader");e.shaderSource(i,r),e.compileShader(i);let a=e.getShaderInfoLog(i);if(a&&a.trim().length>0)throw new Error("Shader compile error: "+a);return i}function s(e,t){e.linkProgram(t);let r=e.getProgramInfoLog(t);if(r&&r.trim().length>0)throw new Error("Unable to link: "+r)}let o,_,c,l={};function u(e){if(c)return c;if(c=e.createBuffer(),!c)throw new Error("Unable to create buffer object");return e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,1,1,0]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),c}function d(e){if(o)return o;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n(e,e.VERTEX_SHADER,"\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nuniform mat4 projMatrix;\nuniform mat4 cameraMatrix;\nuniform mat4 modelViewMatrix;\nattribute vec4 position;\nattribute vec2 textureCoord;\n\nvarying highp vec2 vTextureCoord;\n\nvoid main()\n{\n gl_Position = projMatrix * cameraMatrix * modelViewMatrix * position;\n vTextureCoord = textureCoord;\n}"),i=n(e,e.FRAGMENT_SHADER,"\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying highp vec2 vTextureCoord;\nuniform sampler2D skinSampler;\n\nvoid main()\n{\n gl_FragColor = texture2D(skinSampler, vTextureCoord);\n}");e.attachShader(t,r),e.attachShader(t,i),s(e,t);let a=e.getUniformLocation(t,"projMatrix");if(!a)throw new Error("Unable to get uniform location projMatrix");let _=e.getUniformLocation(t,"modelViewMatrix");if(!_)throw new Error("Unable to get uniform location modelViewMatrix");let c=e.getUniformLocation(t,"cameraMatrix");if(!c)throw new Error("Unable to get uniform location cameraMatrix");let l=e.getUniformLocation(t,"skinSampler");if(!l)throw new Error("Unable to get uniform location skinSampler");return o={prog:t,unif_matrix:_,unif_proj:a,unif_camera:c,unif_skinSampler:l,attr_position:e.getAttribLocation(t,"position"),attr_textureCoord:e.getAttribLocation(t,"textureCoord")},o}var f="undefined"!=typeof Float32Array?Float32Array:Array;function h(){var e=new f(16);return f!=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 m(e,t){var r=t[0],i=t[1],a=t[2],n=t[3],s=t[4],o=t[5],_=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],h=t[12],m=t[13],p=t[14],b=t[15],g=r*o-i*s,w=r*_-a*s,v=r*c-n*s,y=i*_-a*o,E=i*c-n*o,A=a*c-n*_,T=l*m-u*h,x=l*p-d*h,R=l*b-f*h,k=u*p-d*m,F=u*b-f*m,M=d*b-f*p,L=g*M-w*F+v*k+y*R-E*x+A*T;return L?(L=1/L,e[0]=(o*M-_*F+c*k)*L,e[1]=(a*F-i*M-n*k)*L,e[2]=(m*A-p*E+b*y)*L,e[3]=(d*E-u*A-f*y)*L,e[4]=(_*R-s*M-c*x)*L,e[5]=(r*M-a*R+n*x)*L,e[6]=(p*v-h*A-b*w)*L,e[7]=(l*A-d*v+f*w)*L,e[8]=(s*F-o*R+c*T)*L,e[9]=(i*R-r*F-n*T)*L,e[10]=(h*E-m*v+b*g)*L,e[11]=(u*v-l*E-f*g)*L,e[12]=(o*x-s*k-_*T)*L,e[13]=(r*k-i*x+a*T)*L,e[14]=(m*w-h*y-p*g)*L,e[15]=(l*y-u*w+d*g)*L,e):null}function p(e,t,r){var i=t[0],a=t[1],n=t[2],s=t[3],o=t[4],_=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],h=t[11],m=t[12],p=t[13],b=t[14],g=t[15],w=r[0],v=r[1],y=r[2],E=r[3];return e[0]=w*i+v*o+y*u+E*m,e[1]=w*a+v*_+y*d+E*p,e[2]=w*n+v*c+y*f+E*b,e[3]=w*s+v*l+y*h+E*g,w=r[4],v=r[5],y=r[6],E=r[7],e[4]=w*i+v*o+y*u+E*m,e[5]=w*a+v*_+y*d+E*p,e[6]=w*n+v*c+y*f+E*b,e[7]=w*s+v*l+y*h+E*g,w=r[8],v=r[9],y=r[10],E=r[11],e[8]=w*i+v*o+y*u+E*m,e[9]=w*a+v*_+y*d+E*p,e[10]=w*n+v*c+y*f+E*b,e[11]=w*s+v*l+y*h+E*g,w=r[12],v=r[13],y=r[14],E=r[15],e[12]=w*i+v*o+y*u+E*m,e[13]=w*a+v*_+y*d+E*p,e[14]=w*n+v*c+y*f+E*b,e[15]=w*s+v*l+y*h+E*g,e}function b(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 g(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 w(e,t,r){var i,a,n,s=r[0],o=r[1],_=r[2],c=Math.hypot(s,o,_);return c<1e-6?null:(s*=c=1/c,o*=c,_*=c,i=Math.sin(t),n=1-(a=Math.cos(t)),e[0]=s*s*n+a,e[1]=o*s*n+_*i,e[2]=_*s*n-o*i,e[3]=0,e[4]=s*o*n-_*i,e[5]=o*o*n+a,e[6]=_*o*n+s*i,e[7]=0,e[8]=s*_*n+o*i,e[9]=o*_*n-s*i,e[10]=_*_*n+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function v(){var e=new f(3);return f!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function y(e,t){var r=t[0],i=t[1],a=t[2],n=r*r+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function E(e,t,r){var i=t[0],a=t[1],n=t[2],s=r[0],o=r[1],_=r[2];return e[0]=a*_-n*o,e[1]=n*s-i*_,e[2]=i*o-a*s,e}function A(e,t,r){var i=t[0],a=t[1],n=t[2],s=r[3]*i+r[7]*a+r[11]*n+r[15];return s=s||1,e[0]=(r[0]*i+r[4]*a+r[8]*n+r[12])/s,e[1]=(r[1]*i+r[5]*a+r[9]*n+r[13])/s,e[2]=(r[2]*i+r[6]*a+r[10]*n+r[14])/s,e}function T(e,t,r,i=.01,a=100){let n=2*e[2],s=2*e[3],o=h();!function(e,t,r,i,a,n,s){var o=1/(r-t),_=1/(a-i),c=1/(n-s);e[0]=2*n*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*n*_,e[6]=0,e[7]=0,e[8]=(r+t)*o,e[9]=(a+i)*_,e[10]=(s+n)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n*2*c,e[15]=0}(o,i*(-.5-e[2])/e[0],i*(n-.5-e[2])/e[0],i*(s-.5-e[3])/e[1],i*(-.5-e[3])/e[1],i,a),o[4]*=-1,o[5]*=-1,o[6]*=-1,o[7]*=-1;let _=h();g(_,[.5*n,.5*s,1]),p(o,_,o),w(_,x(!1)*Math.PI/180,[0,0,1]),p(o,_,o);let c=v();c[0]=n,c[1]=s,c[2]=0,A(c,c,_);let l=Math.abs(c[0]),u=Math.abs(c[1]),d=1;return d=l/t>u/r?r/u:t/l,g(_,[d,d,1]),p(o,_,o),g(_,[2/t,2/r,1]),p(o,_,o),w(_,x(!1)*Math.PI/-180,[0,0,1]),p(o,o,_),o}function x(e){if(window.screen.orientation)switch(window.screen.orientation.type){case"portrait-primary":return e?90:270;case"landscape-secondary":return 180;case"portrait-secondary":return e?270:90;default:return 0}else if(void 0!==window.orientation)switch(window.orientation){case 0:return e?90:270;case 90:return 0;case 180:return e?270:90;case-90:return 180}return 0}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),v();class R{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]()}}class k{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)}}let F=new class{constructor(){this.onOutgoingMessage=new R,this.onIncomingMessage=new k,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 M(e){return t=this,i=void 0,n=function*(){var t;function i(){let t=F.getOutgoingMessages();for(let r of t)e.postMessage(r.msg,r.transferables)}e||(e=new Worker(new URL(r.p+r.u(752),r.b),{type:void 0})),e.postMessage({t:"wasm",url:new URL(r(394),r.b).toString()}),yield(t=e,new Promise((e=>{let r=i=>{"loaded"===i.data&&(t.removeEventListener("message",r),e())};t.addEventListener("message",r)}))),F.onOutgoingMessage.bind(i),i(),e.addEventListener("message",(e=>{F.postIncomingMessage(e.data)}))},new((a=void 0)||(a=Promise))((function(e,r){function s(e){try{_(n.next(e))}catch(e){r(e)}}function o(e){try{_(n.throw(e))}catch(e){r(e)}}function _(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a((function(e){e(r)}))).then(s,o)}_((n=n.apply(t,i||[])).next())}));var t,i,a,n}var L=r(238),S=function(e,t,r,i){return new(r||(r=Promise))((function(a,n){function s(e){try{_(i.next(e))}catch(e){n(e)}}function o(e){try{_(i.throw(e))}catch(e){n(e)}}function _(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}_((i=i.apply(e,t||[])).next())}))};let I=new L.UAParser,U=!1,B=!1,C=!1,D=!1;function O(){return S(this,void 0,void 0,(function*(){if(navigator.permissions&&navigator.permissions.query)try{let e=yield navigator.permissions.query({name:"camera"});C="denied"===e.state,U="granted"===e.state}catch(e){}}))}function P(){return U}function z(){return B}function V(){return C}function N(){return D}function G(){return C||D}function H(){return U&&B}function W(){return S(this,void 0,void 0,(function*(){yield j(),yield q()}))}function q(){return S(this,void 0,void 0,(function*(){try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>e.stop())),U=!0,C=!1}catch(e){U=!1,C=!0}}))}function j(){return S(this,void 0,void 0,(function*(){if(window.DeviceOrientationEvent&&window.DeviceOrientationEvent.requestPermission&&"granted"!==(yield window.DeviceOrientationEvent.requestPermission()))return B=!1,D=!0,!1;B=!0,D=!1}))}function X(){return S(this,void 0,void 0,(function*(){if(yield O(),H())return!0;let e=document.createElement("div");e.classList.add("zappar-permission-request"),e.innerHTML='\n <style>\n .zappar-permission-request {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.9);\n font-family: sans-serif;\n color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .zappar-inner {\n max-width: 400px;\n text-align: center;\n }\n .zappar-title {\n font-size: 20px;\n }\n .zappar-text {\n font-size: 14px;\n padding: 15px;\n }\n .zappar-inner > button {\n background: none;\n outline: none;\n border: 2px solid white;\n border-radius: 10px;\n color: white;\n padding: 10px 40px;\n text-transform: uppercase;\n }\n </style>\n <div class="zappar-inner">\n <div class="zappar-title">Almost there...</div>\n <div class="zappar-text">In order to provide this augmented reality experience, we need access to your device\'s camera and motion sensors.</div>\n <button id="zappar-permission-request-button">Grant Access</button>\n </div>\n',document.body.append(e);let t=e.querySelector("#zappar-permission-request-button");return yield new Promise((r=>{null==t||t.addEventListener("click",(()=>S(this,void 0,void 0,(function*(){for(yield W(),e.remove();;){if(yield new Promise((e=>requestAnimationFrame((()=>e())))),G())return void r(!1);if(H())return void r(!0)}}))))}))}))}function Y(){"Chrome"===I.getBrowser().name?function(){let e=document.createElement("div");e.classList.add("zappar-permission-request"),e.innerHTML='\n <style>\n .zappar-permission-request {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.9);\n font-family: sans-serif;\n color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .zappar-inner {\n width: 400px;\n text-align: center;\n }\n .zappar-title {\n font-size: 20px;\n }\n .zappar-text {\n font-size: 14px;\n padding: 15px;\n }\n .zappar-inner > button {\n background: none;\n outline: none;\n border: 2px solid white;\n border-radius: 10px;\n color: white;\n padding: 10px 40px;\n text-transform: uppercase;\n }\n </style>\n <div class="zappar-inner">\n <div class="zappar-title">Permission is Needed</div>\n <div class="zappar-text">Permission to access your device\'s camera and motion sensors is necessary for this experience.<br/><br/>To grant access, please tap the ! button in the address bar of your browser, then "Site settings", and finally "Clear and reset". You can then reload the page to try again.</div>\n <button id="zappar-permission-reload-button">Reload</button>\n </div>\n',document.body.append(e);let t=e.querySelector("#zappar-permission-reload-button");null==t||t.addEventListener("click",(()=>window.location.reload()))}():function(){let e=document.createElement("div");e.classList.add("zappar-permission-request"),e.innerHTML='\n <style>\n .zappar-permission-request {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.9);\n font-family: sans-serif;\n color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .zappar-inner {\n max-width: 400px;\n text-align: center;\n }\n .zappar-title {\n font-size: 20px;\n }\n .zappar-text {\n font-size: 14px;\n padding: 15px;\n }\n .zappar-inner > button {\n background: none;\n outline: none;\n border: 2px solid white;\n border-radius: 10px;\n color: white;\n padding: 10px 40px;\n text-transform: uppercase;\n }\n </style>\n <div class="zappar-inner">\n <div class="zappar-title">Permission is Needed</div>\n <div class="zappar-text">Permission to access your device\'s camera and motion sensors is necessary for this experience. Please reload the page to try again.</div>\n <button id="zappar-permission-reload-button">Reload</button>\n </div>\n',document.body.append(e);let t=e.querySelector("#zappar-permission-reload-button");null==t||t.addEventListener("click",(()=>window.location.reload()))}()}var Z,$,K,J,Q;window.DeviceOrientationEvent&&window.DeviceOrientationEvent.requestPermission||(B=!0),O(),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"}(Z||(Z={})),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"}($||($={})),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"}(K||(K={})),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"}(J||(J={})),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"}(Q||(Q={}));let ee=J.LOG_LEVEL_ERROR;function te(...e){ee>=J.LOG_LEVEL_VERBOSE&&console.log("[Zappar] INFO",...e)}function re(...e){ee>=J.LOG_LEVEL_ERROR&&console.error("[Zappar] ERROR",...e)}function ie(...e){ee>=J.LOG_LEVEL_VERBOSE&&console.log("[Zappar] WARN",...e)}let ae=1,ne=new Map;function se(e){return ne.get(e)}class oe{constructor(){this.render_mean_=new Float32Array,this.render_identity_=new Float32Array(50),this.render_expression_=new Float32Array(29),this.render_uvs_=new Float32Array,this.render_indices_=new Uint16Array,this.vertices_=new Float32Array,this.normals_=new Float32Array,this.normalsCalculated_=!1,this.modelVersion_=-1,this.mirrored_=!1}loadFromMemory(e,t,r,i,a){let n=0,s=new Uint16Array(e),o=new Int32Array(e),_=new Float32Array(e),c=()=>{let e=o[n++]*o[n++],t=_.subarray(n,n+e);return n+=e,t},l=()=>{let e=o[n++],t=s.subarray(2*n,2*n+e);return n+=e/2,t};this.render_mean_=c(),this.render_identity_=c(),this.render_expression_=c(),this.render_uvs_=c();let u=l(),d=n<o.length?l():new Uint16Array,f=n<o.length?l():new Uint16Array,h=n<o.length?l():new Uint16Array,m=n<o.length?l():new Uint16Array;if(t||r||i||a){let e=u.length;t&&(e+=d.length),r&&(e+=f.length),i&&(e+=h.length),a&&(e+=m.length),this.render_indices_=new Uint16Array(e),this.render_indices_.set(u,0);let n=u.length;t&&(this.render_indices_.set(d,n),n+=d.length),r&&(this.render_indices_.set(f,n),n+=f.length),i&&(this.render_indices_.set(h,n),n+=h.length),a&&(this.render_indices_.set(m,n),n+=m.length)}else this.render_indices_=u;this.vertices_=new Float32Array(this.render_mean_),this.normals_=new Float32Array(this.vertices_.length),this.modelVersion_++}getVertices(){return this.vertices_}getUVs(){return this.render_uvs_}getIndices(){if(this.mirrored_){if(!this.render_indices_reversed){this.render_indices_reversed=new Uint16Array(this.render_indices_.length);for(let e=0;e<this.render_indices_.length;e+=3)this.render_indices_reversed[e]=this.render_indices_[e+2],this.render_indices_reversed[e+1]=this.render_indices_[e+1],this.render_indices_reversed[e+2]=this.render_indices_[e]}return this.render_indices_reversed}return this.render_indices_}getNormals(){return this.normalsCalculated_||this.calculateNormals(),this.normals_}getModelVersion(){return this.modelVersion_}getLandmarkDataForVertex(e){let t=[this.render_mean_[3*e],this.render_mean_[3*e+1],this.render_mean_[3*e+2]],r=[];for(let t=0;t<50;t++)r.push(this.render_identity_[3*e*50+t]),r.push(this.render_identity_[50*(3*e+1)+t]),r.push(this.render_identity_[50*(3*e+2)+t]);let i=[];for(let t=0;t<29;t++)i.push(this.render_expression_[3*e*29+t]),i.push(this.render_expression_[29*(3*e+1)+t]),i.push(this.render_expression_[29*(3*e+2)+t]);return{mean:t,identity:r,expression:i}}update(e,t,r){if(0!==this.render_mean_.length&&0!==this.render_identity_.length&&0!==this.render_expression_.length){this.mirrored_=r,this.vertices_.set(this.render_mean_);for(let t=0;t<e.length;t++)for(let r=0;r<this.vertices_.length;r++)this.vertices_[r]+=e[t]*this.render_identity_[r*e.length+t];for(let e=0;e<t.length;e++)for(let r=0;r<this.vertices_.length;r++)this.vertices_[r]+=t[e]*this.render_expression_[r*t.length+e];if(r)for(let e=0;e<this.vertices_.length;e+=3)this.vertices_[e]*=-1;this.normalsCalculated_=!1}}calculateNormals(){let e=this.getIndices(),t=this.vertices_,r=new Float32Array(e.length);if(!t)return;let i=e.length,a=this.normals_,n=new Float32Array([0,0,0]),s=new Float32Array([0,0,0]),o=new Float32Array([0,0,0]);for(let a=0;a<i;a+=3){let i=3*e[a],d=3*e[a+1],f=3*e[a+2];n[0]=t[d]-t[i],n[1]=t[d+1]-t[i+1],n[2]=t[d+2]-t[i+2],s[0]=t[f]-t[i],s[1]=t[f+1]-t[i+1],s[2]=t[f+2]-t[i+2],E(o,n,s);let h=(c=void 0,l=void 0,u=void 0,c=(_=o)[0],l=_[1],u=_[2],Math.hypot(c,l,u));r[a]=o[0]/h,r[a+1]=o[1]/h,r[a+2]=o[2]/h}var _,c,l,u;a.fill(0);for(let t=0;t<i;t+=3){let i=3*e[t],n=3*e[t+1],s=3*e[t+2];a[i]+=r[t],a[i+1]+=r[t+1],a[i+2]+=r[t+2],a[n]+=r[t],a[n+1]+=r[t+1],a[n+2]+=r[t+2],a[s]+=r[t],a[s+1]+=r[t+1],a[s+2]+=r[t+2]}let d=a.length/3;for(let e=0;e<d;e++){let t=3*e;n[0]=a[t],n[1]=a[t+1],n[2]=a[t+2],y(s,n),a[t]=s[0],a[t+1]=s[1],a[t+2]=s[2]}this.normalsCalculated_=!0}}let _e=h();class ce{constructor(e){this._gl=e}dispose(){this._vbo&&this._gl.deleteBuffer(this._vbo),this._vbo=void 0,this._shader&&this._gl.deleteProgram(this._shader.prog),this._shader=void 0}_generate(e,t){if(this._vbo)return this._vbo;if(this._vbo||(this._vbo=e.createBuffer()),!this._vbo)throw new Error("Unable to create buffer object");let r=new Float32Array([-1,-1,0,0,0,-1,1,0,0,1,1,-1,0,1,0,1,-1,0,1,0,-1,1,0,0,1,1,1,0,1,1]);return e.bindBuffer(e.ARRAY_BUFFER,this._vbo),e.bufferData(e.ARRAY_BUFFER,new Float32Array(r),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),this._vbo}drawCameraFrame(e,t,r,i){if(!r.texture)return;let a=this._gl;a.disable(a.DEPTH_TEST),a.disable(a.SCISSOR_TEST),a.disable(a.CULL_FACE),a.disable(a.BLEND);let n=this._getCameraShader(a),s=this._generate(a,r);a.activeTexture(a.TEXTURE0),a.useProgram(n.prog),a.uniformMatrix4fv(n.unif_skinTexTransform,!1,de(r.dataWidth,r.dataHeight,e,t,r.uvTransform||_e,i)),a.uniform1i(n.unif_skinSampler,0),a.bindTexture(a.TEXTURE_2D,r.texture),a.bindBuffer(a.ARRAY_BUFFER,s),a.vertexAttribPointer(n.attr_position,3,a.FLOAT,!1,20,0),a.enableVertexAttribArray(n.attr_position),a.vertexAttribPointer(n.attr_texCoord,2,a.FLOAT,!1,20,12),a.enableVertexAttribArray(n.attr_texCoord),a.drawArrays(a.TRIANGLES,0,6),a.disableVertexAttribArray(n.attr_position),a.disableVertexAttribArray(n.attr_texCoord),a.bindTexture(a.TEXTURE_2D,null),a.bindBuffer(a.ARRAY_BUFFER,null),a.useProgram(null)}_getCameraShader(e){if(this._shader)return this._shader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n(e,e.VERTEX_SHADER,le),i=n(e,e.FRAGMENT_SHADER,ue);e.attachShader(t,r),e.attachShader(t,i),s(e,t);let a=e.getUniformLocation(t,"skinTexTransform");if(!a)throw new Error("Unable to get uniform location skinTexTransform");let o=e.getUniformLocation(t,"skinSampler");if(!o)throw new Error("Unable to get uniform location skinSampler");return this._shader={prog:t,unif_skinTexTransform:a,unif_skinSampler:o,attr_position:e.getAttribLocation(t,"position"),attr_texCoord:e.getAttribLocation(t,"texCoord")},this._shader}}let le="\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nattribute vec4 position;\nattribute vec4 texCoord;\nvarying vec4 skinTexVarying;\nuniform mat4 skinTexTransform;\n\nvoid main()\n{\n gl_Position = position;\n skinTexVarying = skinTexTransform * texCoord;\n}",ue="\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying vec4 skinTexVarying;\nuniform lowp sampler2D skinSampler;\n\nvoid main()\n{\n gl_FragColor = texture2DProj(skinSampler, skinTexVarying);\n}";function de(e,t,r,i,a,n){let s=h(),o=h();b(o,[-.5,-.5,0]),p(s,o,s),n&&(g(o,[-1,1,1]),p(s,o,s)),w(o,-1*function(){if(window.screen.orientation)switch(window.screen.orientation.type){case"portrait-primary":return 270;case"landscape-secondary":return 180;case"portrait-secondary":return 90;default:return 0}else if(void 0!==window.orientation)switch(window.orientation){case 0:return 270;case 90:return 0;case 180:return 90;case-90:return 180}return 0}()*Math.PI/180,[0,0,1]),p(s,o,s);let _=v();_[0]=r,_[1]=i,_[2]=0,A(_,_,o);let c=Math.abs(_[0]),l=Math.abs(_[1]);g(o,[1,-1,1]),p(s,o,s);let u=c/l,d=e/t;return g(o,u>d?[1,d/u,1]:[u/d,1,1]),p(s,o,s),b(o,[.5,.5,0]),p(s,o,s),p(s,a,s),s}class fe{constructor(e){this._gl=e}dispose(){this._vbo&&this._gl.deleteBuffer(this._vbo),this._normalbo&&this._gl.deleteBuffer(this._normalbo),this._ibo&&this._gl.deleteBuffer(this._ibo),this._shader&&this._gl.deleteProgram(this._shader.prog),this._vbo=void 0,this._normalbo=void 0,this._ibo=void 0,this._shader=void 0}_generateIBO(e,t){if(this._ibo&&this._lastIndices===e)return this._ibo;if(this._lastIndices=e,this._ibo||(this._ibo=t.createBuffer()),!this._ibo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._ibo),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),this._ibo}_generateVBO(e,t){if(this._vbo||(this._vbo=t.createBuffer()),!this._vbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._vbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._vbo}_generateNormalBO(e,t){if(this._normalbo||(this._normalbo=t.createBuffer()),!this._normalbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._normalbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._normalbo}drawFace(e,t){let r=this._gl,i=this._getShader(r),a=this._generateVBO(t.getVertices(),r),n=this._generateNormalBO(t.getNormals(),r),s=this._generateIBO(t.getIndices(),r);r.enable(r.DEPTH_TEST),r.enable(r.CULL_FACE),r.useProgram(i.prog),r.uniformMatrix4fv(i.unif_matrix,!1,e),r.bindBuffer(r.ARRAY_BUFFER,a),r.vertexAttribPointer(i.attr_position,3,r.FLOAT,!1,12,0),r.enableVertexAttribArray(i.attr_position),r.bindBuffer(r.ARRAY_BUFFER,n),r.vertexAttribPointer(i.attr_normal,3,r.FLOAT,!1,12,0),r.enableVertexAttribArray(i.attr_normal),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,s),r.drawElements(r.TRIANGLES,t.getIndices().length,r.UNSIGNED_SHORT,0),r.disableVertexAttribArray(i.attr_position),r.disableVertexAttribArray(i.attr_normal),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null)}_getShader(e){if(this._shader)return this._shader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n(e,e.VERTEX_SHADER,he),i=n(e,e.FRAGMENT_SHADER,me);e.attachShader(t,r),e.attachShader(t,i),s(e,t);let a=e.getUniformLocation(t,"matrix");if(!a)throw new Error("Unable to get uniform location mattrix");return this._shader={prog:t,unif_matrix:a,attr_position:e.getAttribLocation(t,"position"),attr_normal:e.getAttribLocation(t,"normal")},this._shader}}let he="\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nuniform mat4 matrix;\nattribute vec4 position;\nattribute vec3 normal;\nvarying highp vec3 vnormal;\n\nvoid main()\n{\n gl_Position = matrix * position;\n vnormal = normal;\n}",me="\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying vec4 skinTexVarying;\nvarying highp vec3 vnormal;\nuniform lowp sampler2D skinSampler;\n\nvoid main()\n{\n vec3 normal2 = 0.5 * vnormal + 0.5;\n gl_FragColor = vec4(normal2.x , normal2.y, normal2.z, 1.0);\n}";class pe{constructor(e){this._gl=e}dispose(){this._vbo&&this._gl.deleteBuffer(this._vbo),this._uvbo&&this._gl.deleteBuffer(this._uvbo),this._ibo&&this._gl.deleteBuffer(this._ibo),this._shader&&this._gl.deleteProgram(this._shader.prog),this._vbo=void 0,this._uvbo=void 0,this._ibo=void 0,this._shader=void 0}_generateIBO(e,t){if(this._ibo&&this._lastIndices===e)return this._ibo;if(this._lastIndices=e,this._ibo||(this._ibo=t.createBuffer()),!this._ibo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._ibo),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),this._ibo}_generateVBO(e,t){if(this._vbo||(this._vbo=t.createBuffer()),!this._vbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._vbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._vbo}_generateUVBO(e,t){if(this._uvbo||(this._uvbo=t.createBuffer()),!this._uvbo)throw new Error("Unable to create buffer object");return t.bindBuffer(t.ARRAY_BUFFER,this._uvbo),t.bufferData(t.ARRAY_BUFFER,e,t.STREAM_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this._uvbo}drawFace(e,t,r,i,a,n){let s=this._gl,o=this._getShader(s),_=this._generateVBO(t,s),c=this._generateUVBO(i,s),l=this._generateIBO(a,s);s.enable(s.DEPTH_TEST),s.enable(s.CULL_FACE),s.useProgram(o.prog),s.uniformMatrix4fv(o.unif_matrix,!1,e),s.uniformMatrix4fv(o.unif_uvmatrix,!1,r),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,n),s.uniform1i(o.unif_sampler,0),s.bindBuffer(s.ARRAY_BUFFER,_),s.vertexAttribPointer(o.attr_position,3,s.FLOAT,!1,12,0),s.enableVertexAttribArray(o.attr_position),s.bindBuffer(s.ARRAY_BUFFER,c),s.vertexAttribPointer(o.attr_uv,3,s.FLOAT,!1,12,0),s.enableVertexAttribArray(o.attr_uv),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,l),s.drawElements(s.TRIANGLES,6912,s.UNSIGNED_SHORT,0),s.disableVertexAttribArray(o.attr_position),s.disableVertexAttribArray(o.attr_uv),s.bindBuffer(s.ARRAY_BUFFER,null),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,null)}_getShader(e){if(this._shader)return this._shader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=n(e,e.VERTEX_SHADER,be),i=n(e,e.FRAGMENT_SHADER,ge);e.attachShader(t,r),e.attachShader(t,i),s(e,t);let a=e.getUniformLocation(t,"matrix");if(!a)throw new Error("Unable to get uniform location matrix");let o=e.getUniformLocation(t,"uvmatrix");if(!o)throw new Error("Unable to get uniform location matrix");let _=e.getUniformLocation(t,"uSampler");if(!_)throw new Error("Unable to get uniform location sampler");return this._shader={prog:t,unif_matrix:a,unif_sampler:_,unif_uvmatrix:o,attr_position:e.getAttribLocation(t,"position"),attr_uv:e.getAttribLocation(t,"uv"),attr_texturecoord:e.getAttribLocation(t,"aTextureCoord")},this._shader}}let be="\n#ifndef GL_ES\n#define highp\n#define mediump\n#define lowp\n#endif\n\nuniform mat4 matrix;\nuniform mat4 uvmatrix;\nattribute vec4 position;\nattribute vec3 normal;\nattribute vec3 uv;\n\n// varying highp vec3 vnormal;\n\nvarying highp vec2 vTextureCoord;\nvarying highp float vAlpha;\n\nvoid main()\n{\n gl_Position = matrix * position;\n vec4 ret = uvmatrix * vec4(uv.x, uv.y, uv.z, 1.0);\n ret.x /= ret.w * 2.0;\n ret.y /= ret.w * 2.0;\n ret.x += 0.5;\n ret.y += 0.0;\n vAlpha = 1.0;\n vTextureCoord = ret.xy;\n}",ge="\n#define highp mediump\n#ifdef GL_ES\n // define default precision for float, vec, mat.\n precision highp float;\n#else\n#define highp\n#define mediump\n#define lowp\n#endif\n\nvarying highp vec2 vTextureCoord;\nvarying highp vec3 vnormal;\nvarying highp float vAlpha;\nuniform lowp sampler2D uSampler;\n\nvoid main()\n{\n // vec3 normal2 = 0.5 * vnormal + 0.5;\n vec4 p = texture2D(uSampler, vTextureCoord);\n p.a = vAlpha;\n gl_FragColor = p; // vec4(normal2.x , normal2.y, normal2.z, 1.0);\n}";var we,ve;!function(e){e[e.CAMERA_FRAME=0]="CAMERA_FRAME",e[e.ACCELEROMETER=1]="ACCELEROMETER",e[e.ROTATION_RATE=2]="ROTATION_RATE",e[e.ATTITUDE=3]="ATTITUDE",e[e.ATTITUDE_MATRIX=4]="ATTITUDE_MATRIX"}(we||(we={}));class ye{constructor(e){this._insertionByte=0,this._numberPackets=0,this._started=!1,this._hasLoggedUnsuppored=!1,this._data=new ArrayBuffer(this._estimatedSize(e,320,240)),this._dataView=new DataView(this._data),this._dataUint8=new Uint8Array(this._data),this._dataFloat32=new Float32Array(this._data)}_estimatedSize(e,t,r){return ye.headerSizeBytes+(ye.psbPacketType+ye.cameraPacketSizeBytes+t*r)*e}start(){this._started=!0,this._insertionByte=0,this._numberPackets=0,this._growArrayBuffer(ye.headerSizeBytes);let e=(new TextEncoder).encode("UAR1");this._dataUint8.set(e),this._dataView.setUint32(4,0,!0),this._insertionByte+=8}stop(){this._started=!1;let e=this._data.slice(0,this._insertionByte);this._data=e,this._dataUint8=new Uint8Array(this._data),this._dataFloat32=new Float32Array(this._data),this._dataView=new DataView(this._data)}data(){return this._dataUint8}appendCameraFrame(e){if(!this._started)return;if(!e.data){if(this._hasLoggedUnsuppored)return;return this._hasLoggedUnsuppored=!0,void re("Unable to record frames from this camera source")}if(e.data.byteLength!==e.dataWidth*e.dataHeight)return void re("Unable to record frame to sequence: greyscale array doesn't match dimensions");let t=ye.psbPacketType+ye.cameraPacketSizeBytes+e.dataWidth*e.dataHeight;this._growArrayBuffer(t),this._dataView.setUint32(this._insertionByte,we.CAMERA_FRAME,!0),this._insertionByte+=ye.psbPacketType,this._dataView.setUint32(this._insertionByte,e.dataWidth,!0),this._insertionByte+=ye.psbCameraFrameWidth,this._dataView.setUint32(this._insertionByte,e.dataHeight,!0),this._insertionByte+=ye.psbCameraFrameHeight,this._dataFloat32.set(e.cameraToDevice,this._insertionByte/4),this._insertionByte+=ye.psbCameraToDeviceTransform,this._dataFloat32.set(e.cameraModel,this._insertionByte/4),this._insertionByte+=ye.psbCameraModel,this._dataView.setUint32(this._insertionByte,e.userFacing?1:0,!0),this._insertionByte+=ye.psbFlags,this._dataUint8.set(new Uint8Array(e.data),this._insertionByte),this._insertionByte+=e.data.byteLength,this._numberPackets++,this._dataView.setUint32(4,this._numberPackets,!0)}appendAccelerometer(e,t,r,i){this._appendTimestampedVec3(we.ACCELEROMETER,e,t,r,i)}appendRotationRate(e,t,r,i){this._appendTimestampedVec3(we.ROTATION_RATE,e,t,r,i)}appendAttitude(e,t,r,i){this._appendTimestampedVec3(we.ATTITUDE,e,t,r,i)}_appendTimestampedVec3(e,t,r,i,a){if(!this._started)return;let n=ye.psbPacketType+ye.accelerometerPacketSizeBytes;this._growArrayBuffer(n),this._dataView.setUint32(this._insertionByte,e,!0),this._insertionByte+=ye.psbPacketType,this._dataView.setUint32(this._insertionByte,t,!0),this._insertionByte+=4,this._dataView.setFloat32(this._insertionByte,r,!0),this._insertionByte+=4,this._dataView.setFloat32(this._insertionByte,i,!0),this._insertionByte+=4,this._dataView.setFloat32(this._insertionByte,a,!0),this._insertionByte+=4,this._numberPackets++,this._dataView.setUint32(4,this._numberPackets,!0)}appendAttitudeMatrix(e){if(!this._started)return;let t=ye.psbPacketType+ye.attitudeMatrixPacketSizeBytes;this._growArrayBuffer(t),this._dataView.setUint32(this._insertionByte,we.ATTITUDE_MATRIX,!0),this._insertionByte+=ye.psbPacketType,this._dataFloat32.set(e,this._insertionByte/4),this._insertionByte+=ye.attitudeMatrixPacketSizeBytes,this._numberPackets++,this._dataView.setUint32(4,this._numberPackets,!0)}_growArrayBuffer(e){for(;this._insertionByte+e>this._data.byteLength;){let e=Math.max(2*this._data.byteLength,this._estimatedSize(50,320,240)),t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this._dataUint8),this._data=t,this._dataUint8=r,this._dataFloat32=new Float32Array(this._data),this._dataView=new DataView(this._data)}}}ye.headerSizeBytes=8,ye.psbPacketType=4,ye.psbCameraFrameWidth=4,ye.psbCameraFrameHeight=4,ye.psbFlags=4,ye.psbCameraToDeviceTransform=64,ye.psbCameraModel=24,ye.cameraPacketSizeBytes=ye.psbCameraFrameWidth+ye.psbCameraFrameHeight+ye.psbCameraToDeviceTransform+ye.psbCameraModel+ye.psbFlags,ye.accelerometerPacketSizeBytes=16,ye.rotationRatePacketSizeBytes=16,ye.attitudePacketSizeBytes=16,ye.attitudeMatrixPacketSizeBytes=64;class Ee{constructor(e){this._data=e,this.dataByPacket=new Map,this.dataByCameraFrame=new Map,this.numberPackets=0,this.numberCameraFrames=0,this.numberAccelerometerPackets=0,this.numberRotationRatePackets=0,this.numberAttitudePackets=0,this.numberAttitudeMatrixPackets=0;let t=new TextDecoder,r="";try{r=t.decode(this._data.slice(0,4))}catch(e){throw new Error("Unable to decode header - perhaps this isn't a sequence file?")}if("UAR1"!==r)throw new Error(`Invalid - perhaps this isn't a sequence file: ${r}`);let i=0,a=new DataView(this._data);this.numberPackets=a.getUint32(4,!0),i+=ye.headerSizeBytes;for(let e=0;e<this.numberPackets;e++){let t=a.getUint32(i,!0);switch(i+=ye.psbPacketType,t){case we.CAMERA_FRAME:{let t=a.getUint32(i,!0);i+=ye.psbCameraFrameWidth;let r=a.getUint32(i,!0);i+=ye.psbCameraFrameHeight;let n=new Float32Array(this._data,i,ye.psbCameraToDeviceTransform/4);i+=ye.psbCameraToDeviceTransform;let s=new Float32Array(this._data,i,ye.psbCameraModel/4);i+=ye.psbCameraModel;let o=a.getUint32(i,!0);i+=ye.psbFlags;let _=1===o,c=new Uint8Array(this._data,i,t*r);i+=t*r;let l={type:we.CAMERA_FRAME,width:t,height:r,cameraToDevice:n,cameraModel:s,userFacing:_,greyscale:c};this.dataByPacket.set(e,l),this.dataByCameraFrame.set(this.numberCameraFrames,l),this.numberCameraFrames++;break}case we.ACCELEROMETER:{let t=a.getUint32(i,!0);i+=4;let r=a.getFloat32(i,!0);i+=4;let n=a.getFloat32(i,!0);i+=4;let s=a.getFloat32(i,!0);i+=4,this.dataByPacket.set(e,{type:we.ACCELEROMETER,t,x:r,y:n,z:s}),this.numberAccelerometerPackets++;break}case we.ROTATION_RATE:{let t=a.getUint32(i,!0);i+=4;let r=a.getFloat32(i,!0);i+=4;let n=a.getFloat32(i,!0);i+=4;let s=a.getFloat32(i,!0);i+=4,this.dataByPacket.set(e,{type:we.ROTATION_RATE,t,x:r,y:n,z:s}),this.numberRotationRatePackets++;break}case we.ATTITUDE:{let t=a.getUint32(i,!0);i+=4;let r=a.getFloat32(i,!0);i+=4;let n=a.getFloat32(i,!0);i+=4;let s=a.getFloat32(i,!0);i+=4,this.dataByPacket.set(e,{type:we.ATTITUDE,t,x:r,y:n,z:s}),this.numberAttitudePackets++;break}case we.ATTITUDE_MATRIX:{let t=new Float32Array(this._data,i,ye.attitudeMatrixPacketSizeBytes/4);i+=ye.attitudeMatrixPacketSizeBytes,this.dataByPacket.set(e,{type:we.ATTITUDE_MATRIX,attitude:t}),this.numberAttitudeMatrixPackets++;break}}}}}class Ae{}!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(ve||(ve={}));let Te={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=Te,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),Te.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),Te.preferImageBitmapCamera=!0));let xe=new L.UAParser,Re=(xe.getOS().name||"unknown").toLowerCase(),ke=(xe.getEngine().name||"unknown").toLowerCase();function Fe(e){let t=e.split(".");if(t.length>=2){const e=parseInt(t[0]),r=parseInt(t[1]);(e<11||11===e&&r<3)&&(Te.blacklisted=!0),(e<12||12===e&&r<2)&&(Te.videoElementInDOM=!0),(12===e&&r>=2||e>=13)&&(Te.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(Te.showSafariPermissionsResetIfNecessary=!0),(e>=12&&r>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(Te.requestHighFrameRate=!0,e<14&&(Te.videoHeight=360,Te.dataHeight=180))}}"webkit"===ke&&"ios"!==Re&&(Te.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&Fe("15.0")),"webkit"===ke&&"ios"===Re&&(Te.deviceMotionMutliplier=1,Fe(xe.getOS().version||"15.0"));const Me=new Map;class Le{constructor(e){this._gl=e,this._viewports=[],this._underlyingViewport=this._gl.viewport,this._viewports.push(this._gl.getParameter(this._gl.VIEWPORT)),this._gl.viewport=(e,t,r,i)=>{this._viewports[this._viewports.length-1]=[e,t,r,i],this._underlyingViewport.call(this._gl,e,t,r,i)}}static get(e){let t=Me.get(e);return t||(t=new Le(e),Me.set(e,t)),t}push(){this._viewports.push(this._viewports[this._viewports.length-1])}pop(){const e=this._viewports.pop(),t=this._viewports[this._viewports.length-1];e&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||this._underlyingViewport.call(this._gl,t[0],t[1],t[2],t[3])}}class Se{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=h(),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,i){let a=this._gl;const n=Le.get(a);n.push();const s=a.isEnabled(a.SCISSOR_TEST),o=a.isEnabled(a.DEPTH_TEST),_=a.isEnabled(a.BLEND),c=a.isEnabled(a.CULL_FACE),l=a.getParameter(a.ACTIVE_TEXTURE),u=a.getParameter(a.UNPACK_FLIP_Y_WEBGL),d=a.getParameter(a.CURRENT_PROGRAM);a.activeTexture(a.TEXTURE0);const f=a.getParameter(a.TEXTURE_BINDING_2D),h=a.getParameter(a.FRAMEBUFFER_BINDING),m=a.getParameter(a.ARRAY_BUFFER_BINDING),p=a.getParameter(a.ELEMENT_ARRAY_BUFFER_BINDING);a.disable(a.SCISSOR_TEST),a.disable(a.DEPTH_TEST),a.disable(a.BLEND),a.disable(a.CULL_FACE),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),a.bindTexture(a.TEXTURE_2D,e);const b=a.RGBA,g=a.RGBA,w=a.UNSIGNED_BYTE;a.texImage2D(a.TEXTURE_2D,0,b,g,w,t);let v=0,y=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(v=t.videoWidth,y=t.videoHeight):(v=t.width,y=t.height),y>v&&(y=[v,v=y][0]),this._updateTransforms(r,i);let E=this._getFramebuffer(a,Te.dataWidth/4,Te.dataHeight),A=this._getVertexBuffer(a),T=this._getIndexBuffer(a),x=this._getGreyscaleShader(a);const R=a.getVertexAttrib(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_SIZE),k=a.getVertexAttrib(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_TYPE),F=a.getVertexAttrib(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_NORMALIZED),M=a.getVertexAttrib(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_STRIDE),L=a.getVertexAttribOffset(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_POINTER),S=a.getVertexAttrib(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_ENABLED),I=a.getVertexAttrib(x.aVertexPositionLoc,a.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),U=a.getVertexAttrib(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_SIZE),B=a.getVertexAttrib(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_TYPE),C=a.getVertexAttrib(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_NORMALIZED),D=a.getVertexAttrib(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_STRIDE),O=a.getVertexAttribOffset(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_POINTER),P=a.getVertexAttrib(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_ENABLED),z=a.getVertexAttrib(x.aTextureCoordLoc,a.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);a.bindFramebuffer(a.FRAMEBUFFER,E),a.viewport(0,0,this._framebufferWidth,this._framebufferHeight),a.clear(a.COLOR_BUFFER_BIT),a.bindBuffer(a.ARRAY_BUFFER,A),a.vertexAttribPointer(x.aVertexPositionLoc,2,a.FLOAT,!1,16,0),a.enableVertexAttribArray(x.aVertexPositionLoc),a.vertexAttribPointer(x.aTextureCoordLoc,2,a.FLOAT,!1,16,8),a.enableVertexAttribArray(x.aTextureCoordLoc),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,T),a.useProgram(x.program),a.uniform1f(x.uTexWidthLoc,Te.dataWidth),a.uniformMatrix4fv(x.uUvTransformLoc,!1,this._cameraUvTransform),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,e),a.uniform1i(x.uSamplerLoc,0),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0),a.bindBuffer(a.ARRAY_BUFFER,I),a.vertexAttribPointer(x.aVertexPositionLoc,R,k,F,M,L),a.bindBuffer(a.ARRAY_BUFFER,z),a.vertexAttribPointer(x.aTextureCoordLoc,U,B,C,D,O),a.bindBuffer(a.ARRAY_BUFFER,m),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,p),S||a.disableVertexAttribArray(x.aVertexPositionLoc),P||a.disableVertexAttribArray(x.aTextureCoordLoc),a.bindFramebuffer(a.FRAMEBUFFER,h),a.useProgram(d),a.bindTexture(a.TEXTURE_2D,f),a.activeTexture(l),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,u),n.pop(),_&&a.enable(a.BLEND),c&&a.enable(a.CULL_FACE),o&&a.enable(a.DEPTH_TEST),s&&a.enable(a.SCISSOR_TEST)}readFrame(e,t){let r=this._gl,i=new Uint8Array(t);const a=r.getParameter(r.FRAMEBUFFER_BINDING);let n=this._getFramebuffer(r,Te.dataWidth/4,Te.dataHeight);return r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,a),{uvTransform:this._cameraUvTransform,data:t,texture:e,dataWidth:Te.dataWidth,dataHeight:Te.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);const i=e.getParameter(e.TEXTURE_BINDING_2D);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 a=e.checkFramebufferStatus(e.FRAMEBUFFER);if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete: "+a.toString());return this._framebufferWidth=t,this._framebufferHeight=r,e.bindTexture(e.TEXTURE_2D,i),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=n(e,e.VERTEX_SHADER,Ie),i=n(e,e.FRAGMENT_SHADER,Ue);e.attachShader(t,r),e.attachShader(t,i),s(e,t);let a=e.getUniformLocation(t,"uTexWidth");if(!a)throw new Error("Unable to get uniform location uTexWidth");let o=e.getUniformLocation(t,"uUvTransform");if(!o)throw new Error("Unable to get uniform location uUvTransform");let _=e.getUniformLocation(t,"uSampler");if(!_)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:o,uSamplerLoc:_},this._greyscaleShader}}let Ie="\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",Ue="\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",Be=1,Ce=new Map;class De extends Ae{constructor(e,t){super(),this._video=e,this._pipeline=t,this._isPaused=!0,this._hadFrames=!1,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._isUploadFrame=!0,this._cameraToDeviceTransform=h(),this._cameraToDeviceTransformUserFacing=h(),this._cameraModel=new Float32Array([300,300,160,120,0,0]),g(this._cameraToDeviceTransformUserFacing,[-1,1,-1]);let r=this._video;this._video instanceof HTMLVideoElement?r.addEventListener("loadedmetadata",(()=>{this._hadFrames=!0})):this._hadFrames=!0,this._resetGLContext=this._resetGLContext.bind(this);let i=Ke.get(this._pipeline);i&&i.onGLContextReset.bind(this._resetGLContext)}static createVideoElementSource(e,t){let r=Be++;return Ce.set(r,new De(t,e)),te("html_element_source_t initialized"),r}static getVideoElementSource(e){return Ce.get(e)}_resetGLContext(){var e,t;this._currentVideoTexture=void 0,null===(t=null===(e=this._imageProcessor)||void 0===e?void 0:e.resetGLContext)||void 0===t||t.call(e)}destroy(){let e=Ke.get(this._pipeline);e&&e.onGLContextReset.unbind(this._resetGLContext),this.pause(),this._resetGLContext()}pause(){this._isPaused=!0;let e=Ke.get(this._pipeline);e&&e.currentCameraSource===this&&(e.currentCameraSource=void 0)}start(){var e;this._isPaused&&(this._isUploadFrame=!0,this._video instanceof HTMLVideoElement&&(this._hadFrames=!1)),this._isPaused=!1;let t=Ke.get(this._pipeline);t&&t.currentCameraSource!==this&&(null===(e=t.currentCameraSource)||void 0===e||e.pause(),t.currentCameraSource=this)}getFrame(e){let t=Ke.get(this._pipeline);if(!t)return;let r=t.glContext;if(r&&!this._isPaused&&this._hadFrames)try{let i=this._processFrame(r,this._cameraToScreenRotation,e);if(i){let e=t.registerToken(i);t.sendDataToWorker(i.data||new ArrayBuffer(0),e,i.dataWidth,i.dataHeight,i.userFacing,i.cameraToDevice,i.cameraModel)}}catch(e){console.log("Unable to process frame")}}_processFrame(e,t,r){let i=Ke.get(this._pipeline);if(!i)return;if(this._imageProcessor||(this._imageProcessor=new Se(e)),this._isUploadFrame){if(this._currentVideoTexture||(this._currentVideoTexture=i.getVideoTexture()),!this._currentVideoTexture)return;return this._imageProcessor.uploadFrame(this._currentVideoTexture,this._video,t,this._isUserFacing),void(this._isUploadFrame=!this._isUploadFrame)}if(r||!this._currentVideoTexture)return;this._isUploadFrame=!this._isUploadFrame;let a=Te.dataWidth*Te.dataHeight,n=i.cameraPixelArrays.pop();for(;n&&n.byteLength!==a;)n=i.cameraPixelArrays.pop();n||(n=new ArrayBuffer(a));let s=this._currentVideoTexture;this._currentVideoTexture=void 0;let o=300*Te.dataWidth/320;return this._cameraModel[0]=o,this._cameraModel[1]=o,this._cameraModel[2]=.5*Te.dataWidth,this._cameraModel[3]=.5*Te.dataHeight,Object.assign(Object.assign({},this._imageProcessor.readFrame(s,n)),{cameraModel:this._cameraModel,cameraSource:this,cameraToDevice:this._isUserFacing?this._cameraToDeviceTransformUserFacing:this._cameraToDeviceTransform})}uploadGL(){}}var Oe=function(e,t,r,i){return new(r||(r=Promise))((function(a,n){function s(e){try{_(i.next(e))}catch(e){n(e)}}function o(e){try{_(i.throw(e))}catch(e){n(e)}}function _(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}_((i=i.apply(e,t||[])).next())}))};let Pe=document.createElement("video");Pe.setAttribute("playsinline",""),Pe.setAttribute("webkit-playsinline",""),Te.videoElementInDOM&&(Pe.style.width="0px",Pe.style.height="0px",document.body.appendChild(Pe));class ze extends De{constructor(e,t,r){super(Pe,t),this._impl=e,this._deviceId=r,this._currentStream=null,this._activeDeviceId=null,this._hasStartedOrientation=!1,this._deviceMotionListener=e=>{let t=Ke.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.accelerationIncludingGravity&&null!==e.accelerationIncludingGravity.x&&null!==e.accelerationIncludingGravity.y&&null!==e.accelerationIncludingGravity.z&&t.motionAccelerometerSubmit(r,e.accelerationIncludingGravity.x*Te.deviceMotionMutliplier,e.accelerationIncludingGravity.y*Te.deviceMotionMutliplier,e.accelerationIncludingGravity.z*Te.deviceMotionMutliplier),null===e.rotationRate||null===e.rotationRate.alpha||null===e.rotationRate.beta||null===e.rotationRate.gamma||this._hasStartedOrientation?this._hasStartedOrientation||this._startDeviceOrientation():(e.timeStamp,t.motionRotationRateSubmit(r,e.rotationRate.alpha*Math.PI/-180,e.rotationRate.beta*Math.PI/-180,e.rotationRate.gamma*Math.PI/-180))}}destroy(){Ye(this._impl),super.destroy()}_stop(){this._currentStream&&(this._currentStream.getTracks().forEach((e=>e.stop())),this._currentStream=null)}pause(){super.pause(),this._stopDeviceMotion(),this._syncCamera()}start(){super.start(),this._startDeviceMotion(),this._syncCamera()}_getConstraints(){return Oe(this,void 0,void 0,(function*(){let e,t;this._deviceId!==ze.DEFAULT_DEVICE_ID&&this._deviceId!==ze.USER_DEFAULT_DEVICE_ID?e=this._deviceId:t=this._deviceId===ze.DEFAULT_DEVICE_ID?"environment":"user";let r={audio:!1,video:{facingMode:t,width:Te.videoWidth,height:Te.videoHeight,frameRate:Te.requestHighFrameRate?60:void 0,deviceId:e}};if(e)return r;if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return r;let i=yield navigator.mediaDevices.enumerateDevices(),a=!1;return i=i.filter((e=>{if("videoinput"!==e.kind)return!1;if(e.getCapabilities){a=!0;let r=e.getCapabilities();if(r&&r.facingMode&&r.facingMode.indexOf("user"===t?"user":"environment")<0)return!1}return!0})),a&&0!==i.length?("object"==typeof r.video&&(te("choosing device ID",i[i.length-1].deviceId),r.video.deviceId=i[i.length-1].deviceId),r):r}))}getFrame(e){this._cameraToScreenRotation=x(!1),super.getFrame(e)}_getUserMedia(){return Oe(this,void 0,void 0,(function*(){let e=yield this._getConstraints();return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?yield navigator.mediaDevices.getUserMedia(e):yield new Promise(((t,r)=>{navigator.getUserMedia(e,t,r)}))}))}_syncCamera(){return Oe(this,void 0,void 0,(function*(){if(this._currentStream&&this._isPaused)this._stop();else if(this._currentStream&&this._activeDeviceId!==this._deviceId&&this._stop(),!this._isPaused){if(this._activeDeviceId=this._deviceId,this._currentStream=yield this._getUserMedia(),this._isPaused)return void(yield this._syncCamera());if(this._isUserFacing=!1,this._currentStream){let e=this._currentStream.getVideoTracks();e.length>0&&(this._isUserFacing="user"===e[0].getSettings().facingMode)}if(!(this._video instanceof HTMLVideoElement))return;this._video.src="",this._video.loop=!1,this._video.muted=!0,this._video.srcObject=this._currentStream,this._video.play()}}))}_startDeviceOrientation(){this._hasStartedOrientation||(this._hasStartedOrientation=!0,this._deviceOrientationListener=e=>{let t=Ke.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.alpha&&null!==e.beta&&null!==e.gamma&&t.motionAttitudeSubmit(r,e.alpha,e.beta,e.gamma)},window.addEventListener("deviceorientation",this._deviceOrientationListener))}_startDeviceMotion(){window.addEventListener("devicemotion",this._deviceMotionListener,!1)}_stopDeviceMotion(){window.removeEventListener("devicemotion",this._deviceMotionListener),this._deviceOrientationListener&&window.removeEventListener("deviceorientation",this._deviceOrientationListener)}}ze.USER_DEFAULT_DEVICE_ID="Simulated User Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b",ze.DEFAULT_DEVICE_ID="Simulated Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b";var Ve=function(e,t,r,i){return new(r||(r=Promise))((function(a,n){function s(e){try{_(i.next(e))}catch(e){n(e)}}function o(e){try{_(i.throw(e))}catch(e){n(e)}}function _(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}_((i=i.apply(e,t||[])).next())}))};class Ne extends Ae{constructor(e,t,r){super(),this._impl=e,this._pipeline=t,this._deviceId=r,this._currentStream=null,this._activeDeviceId=null,this._isPaused=!0,this._isUserFacing=!1,this._hadFrames=!1,this._canvas=new OffscreenCanvas(640,480),this._context=this._canvas.getContext("2d"),this._lastFrameTime=-1,this._video=document.createElement("video"),this._cameraToDeviceTransform=h(),this._cameraToDeviceTransformUserFacing=h(),this._cameraModel=new Float32Array([300,300,160,120,0,0]),this._hasStartedOrientation=!1,this._deviceMotionListener=e=>{let t=Ke.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.accelerationIncludingGravity&&null!==e.accelerationIncludingGravity.x&&null!==e.accelerationIncludingGravity.y&&null!==e.accelerationIncludingGravity.z&&t.motionAccelerometerSubmit(r,e.accelerationIncludingGravity.x*Te.deviceMotionMutliplier,e.accelerationIncludingGravity.y*Te.deviceMotionMutliplier,e.accelerationIncludingGravity.z*Te.deviceMotionMutliplier),null===e.rotationRate||null===e.rotationRate.alpha||null===e.rotationRate.beta||null===e.rotationRate.gamma||this._hasStartedOrientation?this._hasStartedOrientation||this._startDeviceOrientation():(e.timeStamp,t.motionRotationRateSubmit(r,e.rotationRate.alpha*Math.PI/-180,e.rotationRate.beta*Math.PI/-180,e.rotationRate.gamma*Math.PI/-180))},te("Using ImageBitmap camera source"),g(this._cameraToDeviceTransformUserFacing,[-1,1,-1]),this._video.muted=!0,this._video.setAttribute("playsinline",""),this._video.setAttribute("webkit-playsinline",""),Te.videoElementInDOM&&(this._video.style.width="0px",this._video.style.height="0px",document.body.appendChild(this._video)),this._video.addEventListener("loadedmetadata",(()=>{this._hadFrames=!0}))}destroy(){this.pause(),Ye(this._impl)}_stop(){this._currentStream&&(this._currentStream.getTracks().forEach((e=>e.stop())),this._currentStream=null)}pause(){this._isPaused=!0;let e=Ke.get(this._pipeline);e&&e.currentCameraSource===this&&(e.currentCameraSource=void 0),this._stopDeviceMotion(),this._syncCamera()}start(){var e;let t=Ke.get(this._pipeline);t&&t.currentCameraSource!==this&&(null===(e=t.currentCameraSource)||void 0===e||e.pause(),t.currentCameraSource=this),this._isPaused=!1,this._startDeviceMotion(),this._syncCamera()}_getConstraints(){return Ve(this,void 0,void 0,(function*(){let e,t;this._deviceId!==Ne.DEFAULT_DEVICE_ID&&this._deviceId!==Ne.USER_DEFAULT_DEVICE_ID?e=this._deviceId:t=this._deviceId===Ne.DEFAULT_DEVICE_ID?"environment":"user";let r={audio:!1,video:{facingMode:t,width:Te.videoWidth,height:Te.videoHeight,frameRate:Te.requestHighFrameRate?60:void 0,deviceId:e}};if(e)return r;if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return r;let i=yield navigator.mediaDevices.enumerateDevices(),a=!1;return i=i.filter((e=>{if("videoinput"!==e.kind)return!1;if(e.getCapabilities){a=!0;let r=e.getCapabilities();if(r&&r.facingMode&&r.facingMode.indexOf("user"===t?"user":"environment")<0)return!1}return!0})),a&&0!==i.length?("object"==typeof r.video&&(te("choosing device ID",i[i.length-1].deviceId),r.video.deviceId=i[i.length-1].deviceId),r):r}))}getFrame(e){var t,r;if(!this._context)return;if(!this._hadFrames)return;if(e)return;let i=performance.now();if(i<this._lastFrameTime+25)return;this._lastFrameTime=i,this._canvas.width!==this._video.videoWidth&&(this._canvas.width=this._video.videoWidth),this._canvas.height!==this._video.videoHeight&&(this._canvas.height=this._video.videoHeight),this._context.drawImage(this._video,0,0);const a=this._canvas.transferToImageBitmap();let n=x(!1),s=Ke.get(this._pipeline);if(!s)return;let o=300*Te.dataWidth/320;this._cameraModel[0]=o,this._cameraModel[1]=o,this._cameraModel[2]=.5*Te.dataWidth,this._cameraModel[3]=.5*Te.dataHeight;let _=s.registerToken({dataWidth:this._canvas.width,dataHeight:this._canvas.height,texture:void 0,userFacing:this._isUserFacing,cameraSource:this,cameraModel:this._cameraModel.slice(),cameraToDevice:this._isUserFacing?this._cameraToDeviceTransformUserFacing:this._cameraToDeviceTransform});null===(r=null===(t=Ke.get(this._pipeline))||void 0===t?void 0:t.sendImageBitmapToWorker)||void 0===r||r.call(t,a,n,this._isUserFacing,_,this._cameraModel,this._isUserFacing?this._cameraToDeviceTransformUserFacing:this._cameraToDeviceTransform)}_getUserMedia(){return Ve(this,void 0,void 0,(function*(){let e=yield this._getConstraints();return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?yield navigator.mediaDevices.getUserMedia(e):yield new Promise(((t,r)=>{navigator.getUserMedia(e,t,r)}))}))}_syncCamera(){return Ve(this,void 0,void 0,(function*(){if(this._currentStream&&this._isPaused)this._stop();else if(this._currentStream&&this._activeDeviceId!==this._deviceId&&this._stop(),!this._isPaused){if(this._activeDeviceId=this._deviceId,this._currentStream=yield this._getUserMedia(),this._isPaused)return void(yield this._syncCamera());if(this._isUserFacing=!1,this._currentStream){let e=this._currentStream.getVideoTracks();e.length>0&&(this._isUserFacing="user"===e[0].getSettings().facingMode)}this._video.src="",this._video.loop=!1,this._video.muted=!0,this._video.srcObject=this._currentStream,this._video.play()}}))}_startDeviceOrientation(){this._hasStartedOrientation||(this._hasStartedOrientation=!0,window.addEventListener("deviceorientation",(e=>{let t=Ke.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.alpha&&null!==e.beta&&null!==e.gamma&&t.motionAttitudeSubmit(r,e.alpha,e.beta,e.gamma)})))}_startDeviceMotion(){window.addEventListener("devicemotion",this._deviceMotionListener,!1)}_stopDeviceMotion(){window.removeEventListener("devicemotion",this._deviceMotionListener)}uploadGL(e){const t=Ke.get(this._pipeline),r=null==t?void 0:t.glContext;if(!e||e.texture||!e.frame||!t||!r)return;let i=t.getVideoTexture();i&&(r.bindTexture(r.TEXTURE_2D,i),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e.frame),r.bindTexture(r.TEXTURE_2D,null),e.texture=i,e.frame.close(),delete e.frame)}}Ne.USER_DEFAULT_DEVICE_ID="Simulated User Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b",Ne.DEFAULT_DEVICE_ID="Simulated Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b";var Ge=function(e,t,r,i){return new(r||(r=Promise))((function(a,n){function s(e){try{_(i.next(e))}catch(e){n(e)}}function o(e){try{_(i.throw(e))}catch(e){n(e)}}function _(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}_((i=i.apply(e,t||[])).next())}))};class He extends Ae{constructor(e,t,r){super(),this._impl=e,this._pipeline=t,this._deviceId=r,this._currentStream=null,this._activeDeviceId=null,this._isPaused=!0,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._hasStartedOrientation=!1,this._deviceMotionListener=e=>{let t=Ke.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.accelerationIncludingGravity&&null!==e.accelerationIncludingGravity.x&&null!==e.accelerationIncludingGravity.y&&null!==e.accelerationIncludingGravity.z&&t.motionAccelerometerSubmit(r,e.accelerationIncludingGravity.x*Te.deviceMotionMutliplier,e.accelerationIncludingGravity.y*Te.deviceMotionMutliplier,e.accelerationIncludingGravity.z*Te.deviceMotionMutliplier),null===e.rotationRate||null===e.rotationRate.alpha||null===e.rotationRate.beta||null===e.rotationRate.gamma||this._hasStartedOrientation?this._hasStartedOrientation||this._startDeviceOrientation():(e.timeStamp,t.motionRotationRateSubmit(r,e.rotationRate.alpha*Math.PI/-180,e.rotationRate.beta*Math.PI/-180,e.rotationRate.gamma*Math.PI/-180))},te("Using MSTP camera source")}destroy(){this.pause(),Ye(this._impl)}_stop(){this._currentStream&&(this._currentStream.getTracks().forEach((e=>e.stop())),this._currentStream=null)}pause(){this._isPaused=!0;let e=Ke.get(this._pipeline);e&&e.currentCameraSource===this&&(e.currentCameraSource=void 0),this._stopDeviceMotion(),this._syncCamera()}start(){var e;let t=Ke.get(this._pipeline);t&&t.currentCameraSource!==this&&(null===(e=t.currentCameraSource)||void 0===e||e.pause(),t.currentCameraSource=this),this._isPaused=!1,this._startDeviceMotion(),this._syncCamera()}_getConstraints(){return Ge(this,void 0,void 0,(function*(){let e,t;this._deviceId!==He.DEFAULT_DEVICE_ID&&this._deviceId!==He.USER_DEFAULT_DEVICE_ID?e=this._deviceId:t=this._deviceId===He.DEFAULT_DEVICE_ID?"environment":"user";let r={audio:!1,video:{facingMode:t,width:Te.videoWidth,height:Te.videoHeight,frameRate:Te.requestHighFrameRate?60:30,deviceId:e}};if(e)return r;if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return r;let i=yield navigator.mediaDevices.enumerateDevices(),a=!1;return i=i.filter((e=>{if("videoinput"!==e.kind)return!1;if(e.getCapabilities){a=!0;let r=e.getCapabilities();if(r&&r.facingMode&&r.facingMode.indexOf("user"===t?"user":"environment")<0)return!1}return!0})),a&&0!==i.length?("object"==typeof r.video&&(te("choosing device ID",i[i.length-1].deviceId),r.video.deviceId=i[i.length-1].deviceId),r):r}))}getFrame(e){var t,r;let i=x(!1);i!=this._cameraToScreenRotation&&(null===(r=null===(t=Ke.get(this._pipeline))||void 0===t?void 0:t.sendCameraToScreenRotationToWorker)||void 0===r||r.call(t,i),this._cameraToScreenRotation=i)}_getUserMedia(){return Ge(this,void 0,void 0,(function*(){let e=yield this._getConstraints();return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?yield navigator.mediaDevices.getUserMedia(e):yield new Promise(((t,r)=>{navigator.getUserMedia(e,t,r)}))}))}_syncCamera(){return Ge(this,void 0,void 0,(function*(){if(this._currentStream&&this._isPaused)this._stop();else if(this._currentStream&&this._activeDeviceId!==this._deviceId&&this._stop(),!this._isPaused){if(this._activeDeviceId=this._deviceId,this._currentStream=yield this._getUserMedia(),this._isPaused)return void(yield this._syncCamera());if(this._isUserFacing=!1,this._currentStream){let e=this._currentStream.getVideoTracks();if(e.length>0){this._isUserFacing="user"===e[0].getSettings().facingMode;let t=new MediaStreamTrackProcessor({track:e[0]}),r=Ke.get(this._pipeline);r&&r.sendCameraStreamToWorker(this._impl,t.readable,this._isUserFacing)}}}}))}_startDeviceOrientation(){this._hasStartedOrientation||(this._hasStartedOrientation=!0,window.addEventListener("deviceorientation",(e=>{let t=Ke.get(this._pipeline);if(!t)return;let r=void 0!==e.timeStamp&&null!==e.timeStamp?e.timeStamp:performance.now();null!==e.alpha&&null!==e.beta&&null!==e.gamma&&t.motionAttitudeSubmit(r,e.alpha,e.beta,e.gamma)})))}_startDeviceMotion(){window.addEventListener("devicemotion",this._deviceMotionListener,!1)}_stopDeviceMotion(){window.removeEventListener("devicemotion",this._deviceMotionListener)}uploadGL(e){const t=Ke.get(this._pipeline),r=null==t?void 0:t.glContext;if(!e||e.texture||!e.frame||!t||!r)return;let i=t.getVideoTexture();i&&(r.bindTexture(r.TEXTURE_2D,i),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e.frame),r.bindTexture(r.TEXTURE_2D,null),e.texture=i,e.frame.close(),delete e.frame)}}He.USER_DEFAULT_DEVICE_ID="Simulated User Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b",He.DEFAULT_DEVICE_ID="Simulated Default Device ID: a908df7f-5661-4d20-b227-a1c15d2fdb4b";let We=1,qe=new Map;function je(e,t){qe.set(e,t)}function Xe(e){return qe.get(e)}function Ye(e){qe.delete(e)}let Ze=new Map,$e=h();class Ke{constructor(e,t,r){this._client=e,this._impl=t,this._mgr=r,this.pendingMessages=[],this.cameraTokens=new Map,this.nextCameraToken=1,this.tokensInFlight=0,this.videoTextures=[],this.cameraPixelArrays=[],this._sequenceRecordDeviceAttitudeMatrices=!0,this._sequenceRecorderFirstCameraToken=0,this.onGLContextReset=new R}static create(e,t){let r=e.pipeline_create();return Ze.set(r,new Ke(e,r,t)),r}static get(e){return Ze.get(e)}frameUpdate(e){for(let t of this.pendingMessages)e.processMessages(t),this._mgr.postOutgoingMessage({t:"buf",p:this._impl,d:t},[t]);this.pendingMessages=[],this.cleanOldFrames()}cleanOldFrames(){var e,t;let r=this._client.pipeline_camera_frame_user_data(this._impl);if(r)for(let i of this.cameraTokens)i[0]<r&&(i[1].texture&&this.videoTextures.push(i[1].texture),null===(t=null===(e=i[1].frame)||void 0===e?void 0:e.close)||void 0===t||t.call(e),this.cameraTokens.delete(i[0]))}cameraTokenReturn(e){if(this._sequenceRecorder&&this._sequenceRecordDeviceAttitudeMatrices&&e.token>=this._sequenceRecorderFirstCameraToken){let t=this.cameraTokens.get(e.token);t&&(e.att&&this._sequenceRecorder.appendAttitudeMatrix(e.att),t.data=e.d,this._sequenceRecorder.appendCameraFrame(t))}this.cameraPixelArrays.push(e.d),this.tokensInFlight--}sequenceRecordStart(e){this._sequenceRecorder||(this._sequenceRecorder=new ye(e)),this._sequenceRecorder.start(),this._sequenceRecorderFirstCameraToken=this.nextCameraToken}sequenceRecordStop(){var e;null===(e=this._sequenceRecorder)||void 0===e||e.stop()}sequenceRecordData(){var e;return(null===(e=this._sequenceRecorder)||void 0===e?void 0:e.data())||new Uint8Array(0)}sequenceRecordClear(){delete this._sequenceRecorder}sequenceRecordDeviceAttitudeMatrices(e){this._sequenceRecordDeviceAttitudeMatrices=e}getVideoTexture(){return this.videoTextures.pop()}destroy(){this._client.pipeline_destroy(this._impl),Ze.delete(this._impl)}getCurrentCameraInfo(){let e=this._client.pipeline_camera_frame_user_data(this._impl);if(e)return this.cameraTokens.get(e)}cameraFrameDrawGL(e,t,r){if(!this.glContext)return;let i=this.getCurrentCameraInfo();i&&(this._cameraDraw||(this._cameraDraw=new ce(this.glContext)),this._cameraDraw.drawCameraFrame(e,t,i,!0===r))}glContextLost(){this._cameraDraw&&this._cameraDraw.dispose(),this._faceDraw&&this._faceDraw.dispose(),this._faceProjectDraw&&this._faceProjectDraw.dispose(),delete this._cameraDraw,delete this._faceDraw,delete this._faceProjectDraw,o=void 0,_=void 0,c=void 0,l={},this.onGLContextReset.emit();for(let e of this.videoTextures)this.glContext&&this.glContext.deleteTexture(e);this.videoTextures=[];for(let e of this.cameraTokens)this.glContext&&e[1].texture&&this.glContext.deleteTexture(e[1].texture),e[1].texture=void 0;this.glContext=void 0}glContextSet(e,t){this.glContextLost(),this.glContext=e,t=t||[];for(let r=0;r<4;r++){let i=t[r]||e.createTexture();i&&(e.bindTexture(e.TEXTURE_2D,i),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.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),this.videoTextures.push(i))}e.bindTexture(e.TEXTURE_2D,null)}drawFace(e,t,r,i){if(!this.glContext)return;this._faceDraw||(this._faceDraw=new fe(this.glContext));let a=h();p(a,e,t),p(a,a,r),this._faceDraw.drawFace(a,i)}drawFaceProject(e,t,r,i,a,n){this.glContext&&(this._faceProjectDraw||(this._faceProjectDraw=new pe(this.glContext)),this._faceProjectDraw.drawFace(e,t,r,i,a,n))}cameraFrameTexture(){var e;return null===(e=this.getCurrentCameraInfo())||void 0===e?void 0:e.texture}cameraFrameTextureMatrix(e,t,r){let i=this.getCurrentCameraInfo();return i?de(i.dataWidth,i.dataHeight,e,t,i.uvTransform||$e,r):h()}cameraFrameUserFacing(){var e;return(null===(e=this.getCurrentCameraInfo())||void 0===e?void 0:e.userFacing)||!1}cameraPoseWithAttitude(e){let t=Je(this.getCurrentCameraInfo(),this._client.pipeline_camera_frame_camera_attitude(this._impl));if(e){let e=h();g(e,[-1,1,1]),p(t,e,t),p(t,t,e)}return m(t,t),t}videoFrameFromWorker(e){let t=this.nextCameraToken++;const r=Xe(e.source);r&&(this.cameraTokens.set(t,{dataWidth:e.w,dataHeight:e.h,texture:void 0,frame:e.d,userFacing:e.userFacing,uvTransform:e.uvTransform,cameraModel:e.cameraModel,cameraToDevice:e.cameraToDevice,cameraSource:r}),this.cleanOldFrames())}imageBitmapFromWorker(e){let t=this.cameraTokens.get(e.tokenId);t&&(t.dataWidth=e.dataWidth,t.dataHeight=e.dataHeight,t.frame=e.frame,t.userFacing=e.userFacing,t.uvTransform=e.uvTransform,this.tokensInFlight--,this.cleanOldFrames())}uploadGL(){var e,t;let r=this.getCurrentCameraInfo();null===(t=null===(e=null==r?void 0:r.cameraSource)||void 0===e?void 0:e.uploadGL)||void 0===t||t.call(e,r)}registerToken(e){let t=this.nextCameraToken++;return this.cameraTokens.set(t,e),this.tokensInFlight++,t}processGL(){this.glContext?this.currentCameraSource&&(this.tokensInFlight>0?this.currentCameraSource.getFrame(!0):this.currentCameraSource.getFrame(!1)):re("no GL context for camera frames - please call pipeline_gl_context_set")}motionAccelerometerSubmit(e,t,r,i){var a;this._sequenceRecordDeviceAttitudeMatrices||null===(a=this._sequenceRecorder)||void 0===a||a.appendAccelerometer(e,t,r,i),this._client.pipeline_motion_accelerometer_submit(this._impl,e,t,r,i)}motionRotationRateSubmit(e,t,r,i){var a;this._sequenceRecordDeviceAttitudeMatrices||null===(a=this._sequenceRecorder)||void 0===a||a.appendRotationRate(e,t,r,i),this._client.pipeline_motion_rotation_rate_submit(this._impl,e,t,r,i)}motionAttitudeSubmit(e,t,r,i){var a;this._sequenceRecordDeviceAttitudeMatrices||null===(a=this._sequenceRecorder)||void 0===a||a.appendAttitude(e,t,r,i),this._client.pipeline_motion_attitude_submit(this._impl,e,t,r,i)}motionAttitudeMatrix(e){this._client.pipeline_motion_attitude_matrix_submit(this._impl,e)}sendCameraStreamToWorker(e,t,r){let i={t:"streamC2S",p:this._impl,s:t,userFacing:r,source:e};this._mgr.postOutgoingMessage(i,[i.s])}sendCameraToScreenRotationToWorker(e){let t={p:this._impl,t:"cameraToScreenC2S",r:e};this._mgr.postOutgoingMessage(t,[])}sendImageBitmapToWorker(e,t,r,i,a,n){let s={p:this._impl,t:"imageBitmapC2S",i:e,r:t,tokenId:i,userFacing:r,cameraModel:a,cameraToDevice:n};this._mgr.postOutgoingMessage(s,[e])}sendDataToWorker(e,t,r,i,a,n,s){let o={d:e,p:this._impl,width:r,height:i,token:t,userFacing:a,c2d:n,cm:s,t:"cameraFrameC2S"};this._mgr.postOutgoingMessage(o,[e])}}function Je(e,t){let r=!1;r=!!e&&e.userFacing;let i=h();return w(i,x(r)*Math.PI/180,[0,0,1]),p(i,i,t),i}const Qe={0:[{mean:[.235,.2344,.7305],identity:[.008,.0087,.0024,-.0026,6e-4,-.0022,5e-4,.0033,.0026,.0017,-.0055,-8e-4,.0011,.0059,0,2e-4,.001,-.001,-.0044,-.0011,-1e-4,.0024,.0019,-9e-4,4e-4,-.0015,0,.0038,.0013,3e-4,.002,-.0021,.0018,.0023,.0011,.0012,-.0011,-.0017,9e-4,-.0012,-8e-4,7e-4,-.0017,.0029,-.0029,8e-4,-.0027,8e-4,-.0017,4e-4,9e-4,-.001,-3e-4,8e-4,-.0016,-3e-4,-7e-4,.0016,-9e-4,.0021,-5e-4,.0011,-.0024,-1e-4,6e-4,1e-4,-.0026,-4e-4,-3e-4,-9e-4,5e-4,3e-4,-8e-4,-.001,-4e-4,-8e-4,.0022,-.0014,-1e-4,-.0023,0,-.0018,7e-4,-.0036,.0017,.0017,-.0018,-2e-4,-4e-4,-9e-4,-8e-4,3e-4,.0012,9e-4,-4e-4,-.0016,5e-4,-.0013,.0011,.0023,.0029,.0024,.0017,-.0027,-4e-4,-.001,-.0018,-.0015,-.001,.001,-.0013,-1e-4,-2e-4,7e-4,3e-4,3e-4,-.0016,9e-4,-.0021,4e-4,.0014,.002,-7e-4,-4e-4,2e-4,-4e-4,-6e-4,-9e-4,.0015,4e-4,-4e-4,5e-4,-.0015,9e-4,3e-4,3e-4,-2e-4,-8e-4,-9e-4,.0023,4e-4,1e-4,-4e-4,-1e-4,7e-4,2e-4,.001,1e-4,-.0029,-5e-4],expression:[0,3e-4,.0052,-7e-4,-.0051,-.0103,0,.0019,.0027,-.0054,.0135,.035,-5e-4,-6e-4,.0025,-.0045,-.0557,-.003,-.0191,-.1199,.0548,-.0036,-.0682,-.0167,2e-4,-.0085,-.0085,.0044,.0041,-.0568,.0044,.179,.0065,-.0017,-.1006,.0036,-.0267,-.3279,.0301,-.0011,-.0173,-.001,.0046,.2808,.0207,.0162,.238,-.0225,.0017,.1041,.0203,5e-4,.0161,.0031,-.0436,.6504,.0873,-.0099,.1039,.0048,-.0254,.2534,-.0042,.003,-.0106,-.0153,-.0118,.0252,9e-4,-.0071,.0099,.007,-.0724,.0461,-.0235,.0833,.004,.0141,-.0219,.0132,-.0042,-.0179,.0045,-.0215,.3638,.0054,-.0445]},{mean:[.2358,.1466,.7183],identity:[.0077,.0093,1e-4,-.0022,0,-.0041,5e-4,.0022,.0028,.0018,-.0038,-.0013,.001,.0044,-2e-4,0,.0017,-.0016,-.0043,-2e-4,-1e-4,.0023,9e-4,5e-4,-7e-4,-4e-4,-.0017,.003,7e-4,6e-4,.0011,-.0018,5e-4,.0018,-8e-4,4e-4,-.0023,-6e-4,-3e-4,-.0015,-.0014,-1e-4,-.0018,.0027,-.0026,3e-4,-.0031,.0011,-.0026,-.0011,.0012,-.0013,-2e-4,7e-4,-.0021,.0021,4e-4,.0012,-.001,.002,-3e-4,2e-4,-.0026,-3e-4,.001,1e-4,-.0018,-.001,9e-4,-.0011,.001,4e-4,-8e-4,-7e-4,-.001,-3e-4,7e-4,-5e-4,-6e-4,-.0019,-5e-4,-.002,7e-4,-.0027,.0014,.0013,6e-4,-5e-4,-3e-4,-3e-4,-.001,0,.0019,1e-4,6e-4,-.0012,4e-4,-9e-4,4e-4,.0025,3e-4,.0024,.0017,-9e-4,-.0015,-.0015,-.001,-.0023,-.001,-5e-4,-4e-4,8e-4,9e-4,7e-4,2e-4,7e-4,-9e-4,9e-4,-.0013,1e-4,9e-4,2e-4,6e-4,-6e-4,-8e-4,-4e-4,-7e-4,8e-4,.0019,3e-4,.0015,2e-4,-.0015,-3e-4,0,6e-4,3e-4,6e-4,-6e-4,2e-4,5e-4,-4e-4,.0012,-4e-4,2e-4,-8e-4,6e-4,-4e-4,2e-4,-.0021],expression:[-.0034,.0054,.0069,.004,6e-4,-.0104,-3e-4,.0036,.0025,.0065,.0296,.0208,-9e-4,.0154,.0029,-.0167,.0124,.004,-.0102,.0351,.028,-.019,.0146,-.0035,-.0023,-.0069,-.0051,-.01,.0262,-.028,.0112,.082,.023,-.0019,-.066,-.0104,-.0408,.0164,.0075,-.0074,.0367,.0041,.0517,-.0207,.0045,.0291,-.0672,-.0129,.0345,-.1558,-.0106,.0037,-.0437,-.0021,.0854,-.1121,.0187,.0041,.0072,.0011,.0193,-.0143,-.0119,.005,-.02,-.0122,-.008,.0527,.0036,-.006,.0222,.007,-.0429,.046,-.0046,.0226,-.0059,.0202,-.0173,.0087,0,-.0067,-.0095,-.0153,.1506,-.0017,.0021]}],1:[{mean:[-.2271,.2323,.7319],identity:[-.0084,.0097,.0018,.0041,2e-4,-.002,-.0012,.0036,.0019,-9e-4,-.0063,-.001,-3e-4,.0053,6e-4,1e-4,5e-4,-.0015,.0044,-.0025,-.0015,-.002,.0016,-6e-4,2e-4,-.0013,0,-.0022,2e-4,2e-4,-.0025,-.0014,.0015,8e-4,2e-4,.0012,6e-4,-6e-4,.0017,0,3e-4,-1e-4,.0024,.0025,-.0029,-.0015,-.0015,1e-4,.0031,-.0016,7e-4,.0019,6e-4,.002,9e-4,.001,-.0014,-.002,-.0015,.0029,1e-4,5e-4,-.0023,8e-4,-.0011,.0019,.0017,-3e-4,-.0011,-3e-4,.0011,-8e-4,.0019,-.0022,1e-4,.0015,.0017,-8e-4,-.0011,-.0022,3e-4,.0022,6e-4,-.003,-2e-4,0,-.0017,-2e-4,0,1e-4,4e-4,.0012,.0019,-.0014,4e-4,-.0017,-.0012,-.0011,.0021,-.0029,.0026,.0018,-.0023,-.0029,1e-4,.0014,-.0019,-4e-4,-4e-4,.0023,-.0016,0,-9e-4,.0014,-.0015,.0015,-.0016,-.0011,-.0022,1e-4,-.0018,.0027,-.0013,4e-4,-1e-4,-5e-4,.0011,-2e-4,.0015,5e-4,-9e-4,-1e-4,.0029,6e-4,0,-3e-4,7e-4,-8e-4,-5e-4,.0025,3e-4,2e-4,-8e-4,-1e-4,3e-4,0,.0014,2e-4,-.0024,1e-4],expression:[-.0025,-9e-4,.006,.004,-.0027,-.0113,-8e-4,.001,.0031,-.0016,.0144,.0382,-3e-4,-5e-4,.0035,-.0044,-.0511,-.0014,-7e-4,-.1007,.0582,-6e-4,-.0606,-.0165,5e-4,-.0087,-.0093,.0036,.0057,-.0576,-.0039,.1488,.0127,.0016,-.0666,-9e-4,-.0153,.3162,-.0445,-.0021,.0023,.0043,-.0033,.2382,.0063,-.0217,.167,-.039,.0097,-.1144,-.0189,-.0145,.6831,.0632,-.0012,-.1959,-.0133,4e-4,.1108,-3e-4,.0062,.2593,-.0161,-.0018,-.0051,-.012,.0162,.016,-.0022,-.0052,-.0201,.0101,.0115,.0365,-.024,-.0059,.0188,-.0336,.0352,.0224,-.0229,.0146,.0086,-.0273,-.0032,.0103,-.0112]},{mean:[-.2288,.1541,.7202],identity:[-.0082,.0101,2e-4,.0036,-7e-4,-.0037,-8e-4,.0024,.0022,-.0013,-.0045,-.0013,-6e-4,.0045,-4e-4,4e-4,.0012,-.0014,.0042,-.001,-7e-4,-.0019,3e-4,-2e-4,.0012,-4e-4,-.0012,-.0018,-4e-4,-1e-4,-.0014,-.0012,1e-4,1e-4,-.0017,.001,.0015,-1e-4,6e-4,1e-4,0,-6e-4,.0028,.0021,-.0025,-.002,-.0015,7e-4,.0028,-.0023,9e-4,.0013,1e-4,.0016,.0012,.0032,-6e-4,-.0013,-.0011,.0021,3e-4,-5e-4,-.0024,4e-4,-4e-4,.0014,.0015,-8e-4,-3e-4,3e-4,.0017,-6e-4,.002,-.0018,-3e-4,9e-4,1e-4,2e-4,-6e-4,-.0015,-4e-4,.0022,7e-4,-.0023,0,-2e-4,-2e-4,-3e-4,-1e-4,6e-4,-2e-4,6e-4,.0022,-3e-4,.0013,-.0014,-5e-4,-3e-4,.0013,-.0027,6e-4,.0025,-.0023,-8e-4,-.0013,.0017,-9e-4,-.0019,1e-4,8e-4,-7e-4,-4e-4,0,.001,-.001,.0019,-8e-4,-.0015,-6e-4,-2e-4,-.0011,8e-4,1e-4,9e-4,-8e-4,-4e-4,6e-4,7e-4,.0021,-4e-4,7e-4,-5e-4,.0021,-7e-4,-4e-4,-9e-4,8e-4,3e-4,1e-4,3e-4,1e-4,9e-4,.001,-5e-4,5e-4,-.001,.001,4e-4,-5e-4,-.0012],expression:[8e-4,.0037,.0078,-4e-4,5e-4,-.012,-2e-4,-.0046,.0033,-.0089,.0295,.0221,-.0024,-.0084,.0013,.0057,.0125,.0049,-.0036,.0373,.0285,.0115,.0135,-.0035,.0048,.0108,-.0033,.0106,.0281,-.0301,-.0082,.0803,.0244,-7e-4,-.0725,-.0105,-.0247,-.0036,-.0143,-.0045,-.029,2e-4,-.0303,.0093,-.0021,-.0196,-.0754,-.0211,.0326,.1246,.006,-.0804,-.1499,.0109,.0182,-.0029,-.0014,-.0035,.0072,-8e-4,-.0152,-.0108,-.0166,-.0073,-.0144,-.0095,.0101,.047,-.0018,-.004,-.0189,.0027,.0104,.0298,-.0042,-.0096,.0191,-.0217,.0228,.0226,-.0105,.0047,-.0048,-.0172,.0061,-.0043,-.0016]}],2:{mean:[.5396,.2028,.2496],identity:[.0204,.0146,-.0182,-.0052,.0158,-.0038,-.0025,-.0108,-.006,.0085,-.0044,.0029,.0042,.001,.0095,.0015,-.0034,-.0064,-.0057,7e-4,.0026,7e-4,.0037,-6e-4,.0037,.0026,.0024,5e-4,-.0019,-.0013,.003,-.0028,.0018,-9e-4,.002,-.0047,.004,-.003,.0031,-.0027,-.0026,-.0017,.0016,.0014,-4e-4,.0021,-.002,0,.0017,7e-4,-4e-4,-7e-4,-.0018,-9e-4,2e-4,-.0012,1e-4,-5e-4,-.0011,4e-4,2e-4,.0011,1e-4,8e-4,.0017,-.0013,.0025,.0017,.001,2e-4,3e-4,5e-4,-4e-4,-1e-4,-5e-4,7e-4,-.0022,-.0029,6e-4,-8e-4,-6e-4,6e-4,-5e-4,5e-4,.0013,3e-4,-5e-4,-.003,7e-4,2e-4,.0016,-4e-4,0,0,4e-4,1e-4,.0014,.0012,1e-4,4e-4,-1e-4,8e-4,9e-4,4e-4,-4e-4,9e-4,-2e-4,.001,9e-4,4e-4,1e-4,7e-4,7e-4,.001,-.0017,-8e-4,2e-4,.0017,-3e-4,-1e-4,4e-4,5e-4,7e-4,5e-4,-1e-4,-6e-4,-1e-4,1e-4,-3e-4,-7e-4,-2e-4,-5e-4,0,-3e-4,3e-4,8e-4,-2e-4,-3e-4,5e-4,1e-4,-7e-4,-.001,-2e-4,3e-4,4e-4,-1e-4,7e-4,0,4e-4,4e-4],expression:[1e-4,-4e-4,1e-4,0,5e-4,2e-4,0,0,3e-4,-2e-4,3e-4,5e-4,-1e-4,2e-4,8e-4,1e-4,-2e-4,-5e-4,-3e-4,6e-4,5e-4,0,1e-4,2e-4,1e-4,-1e-4,-6e-4,-2e-4,5e-4,0,-4e-4,4e-4,.0016,4e-4,-4e-4,-.0015,0,1e-4,1e-4,-3e-4,3e-4,.0019,-2e-4,7e-4,4e-4,4e-4,-8e-4,-.0015,.0013,-.0016,-.0069,4e-4,-6e-4,-.0019,0,-1e-4,5e-4,-3e-4,2e-4,.0014,-3e-4,6e-4,.0011,4e-4,-3e-4,-.0032,-6e-4,8e-4,.0025,-3e-4,3e-4,.0015,-1e-4,1e-4,3e-4,-1e-4,0,0,-3e-4,4e-4,.0019,1e-4,0,-8e-4,-1e-4,1e-4,5e-4]},3:{mean:[-.5464,.2141,.26],identity:[-.0207,.0172,-.0176,.0068,.0148,-.0051,.0042,-.0101,-.0058,-.0087,-.0059,.0045,-.0056,.0017,.0097,-.0048,-.004,-.0044,.0019,2e-4,.0041,-.0052,.0041,2e-4,-.0027,6e-4,.002,-.0027,-.0033,-6e-4,-.004,9e-4,-.0012,-1e-4,-.0026,.0021,-.003,-.0025,.0052,.0025,.0022,-1e-4,-8e-4,.0013,.001,4e-4,.0018,.0014,6e-4,-5e-4,-.0015,-.0039,.0014,-1e-4,8e-4,-2e-4,6e-4,-5e-4,-.0038,-.0012,-.0018,-3e-4,.001,9e-4,.0012,.0024,-.0024,-7e-4,-.0016,-.0016,3e-4,-.001,-.0014,-.0014,.001,-3e-4,-7e-4,-.0012,3e-4,6e-4,3e-4,-5e-4,3e-4,.0012,6e-4,-8e-4,4e-4,4e-4,8e-4,-2e-4,-.0014,3e-4,0,.0023,-3e-4,-.0012,-.0013,.0011,-2e-4,-.0014,-1e-4,.0014,0,3e-4,3e-4,-8e-4,-5e-4,-7e-4,-7e-4,-2e-4,3e-4,5e-4,2e-4,-1e-4,.0011,-.0014,1e-4,-.0015,-1e-4,-3e-4,0,-.001,-1e-4,-8e-4,8e-4,-8e-4,-2e-4,-.0011,-3e-4,-4e-4,1e-4,-2e-4,3e-4,-7e-4,0,3e-4,1e-4,-8e-4,5e-4,1e-4,4e-4,.0014,-6e-4,-.001,-3e-4,-2e-4,1e-4,-1e-4,-1e-4,7e-4],expression:[-3e-4,-1e-4,6e-4,4e-4,0,-7e-4,0,-3e-4,-2e-4,-4e-4,.0012,8e-4,1e-4,-5e-4,-7e-4,-4e-4,0,1e-4,-4e-4,.0017,7e-4,0,1e-4,3e-4,0,4e-4,4e-4,5e-4,1e-4,-.001,-7e-4,.0022,.0026,5e-4,-.0024,-.0023,0,1e-4,3e-4,0,-.0013,-.0015,6e-4,.0014,8e-4,-2e-4,-.0025,-.0023,-3e-4,.0049,.006,-2e-4,-7e-4,-2e-4,0,-.0019,-.0018,-2e-4,.0017,.0017,3e-4,.0015,7e-4,1e-4,-.0023,-.0036,2e-4,.0023,.0017,0,-5e-4,-3e-4,-3e-4,4e-4,2e-4,-1e-4,-3e-4,-5e-4,1e-4,.0018,.0025,1e-4,-6e-4,-.0011,0,1e-4,1e-4]},4:{mean:[.0018,.1864,.853],identity:[-.0011,.0134,.0085,9e-4,-.0025,-7e-4,-3e-4,.0033,4e-4,-5e-4,-.0047,-.002,7e-4,.0026,-.0069,-1e-4,.0036,.0072,5e-4,-8e-4,-.0047,4e-4,-8e-4,-.001,0,2e-4,-.0036,-2e-4,-.001,-.0048,-1e-4,.0018,.0044,-7e-4,-2e-4,.0043,3e-4,.002,-.0031,0,-7e-4,.0013,0,.0037,.0033,-.0016,-.0012,.002,-1e-4,-.0027,.0051,5e-4,8e-4,7e-4,-.0017,.0054,.0023,-3e-4,.0032,1e-4,0,7e-4,-5e-4,-.0011,2e-4,8e-4,0,-.0033,-8e-4,-7e-4,7e-4,.0033,5e-4,-3e-4,.0029,-1e-4,-.0024,-.0011,-.002,-.0015,-.0019,2e-4,7e-4,.0031,6e-4,.0012,0,0,-.0021,0,-9e-4,-.0011,-.0011,-2e-4,.0015,.001,.0013,8e-4,.001,-3e-4,9e-4,.0027,-2e-4,-.0011,-.0011,6e-4,7e-4,2e-4,1e-4,-5e-4,-.0022,.0011,-.0014,9e-4,3e-4,2e-4,0,-6e-4,-4e-4,-.0011,-7e-4,.001,-.0012,6e-4,-.0012,-.0015,3e-4,-9e-4,-.0013,-.0013,7e-4,.001,-.0011,-.0013,.0015,4e-4,1e-4,4e-4,-1e-4,-.0016,-.0016,9e-4,-7e-4,-.0024,5e-4,-1e-4,-.0017,-2e-4,3e-4,-9e-4],expression:[-.0017,.0019,.0097,.003,-.0103,-.0093,9e-4,6e-4,.0023,-.0017,-.0204,.0376,.0033,-.0034,.0033,-.0026,-.0322,.0396,-.0032,-.0947,.0942,-7e-4,-.0175,.0266,-.001,-6e-4,.0016,.0025,.0157,-.0142,-.0022,.037,.015,.0021,-.0102,-.0107,.0036,.0055,-.0051,.0021,3e-4,-3e-4,4e-4,-.0177,.0074,-6e-4,-.0357,.0149,-.0066,9e-4,.0013,-.0031,.0016,.0095,.002,.0052,.0035,-3e-4,.0053,-.0082,.002,.0022,-.0071,-.0011,5e-4,.0055,.0011,3e-4,-.0126,-4e-4,3e-4,-.0023,-.0015,.0059,.0063,-.0042,-.0023,.0055,.0019,.0017,-.0075,6e-4,-8e-4,.0018,.0012,.0012,-5e-4]},5:{mean:[-.002,-.0469,1.0039],identity:[-.0017,.0018,.0156,6e-4,-.0038,5e-4,4e-4,.0013,.002,-4e-4,-.0015,-.0051,5e-4,-7e-4,-.0055,-1e-4,-9e-4,.008,-2e-4,.0036,-.0053,4e-4,-.0026,-.0016,7e-4,9e-4,-.009,-3e-4,7e-4,-.0084,.0015,.0021,.0032,-.0015,.0018,.0046,-3e-4,-4e-4,-1e-4,8e-4,-.0044,-7e-4,-8e-4,7e-4,.0048,-.0024,-3e-4,.0024,2e-4,-.0051,.0058,-6e-4,.0028,.0018,-.0021,.0035,.0057,.0011,.0065,0,-2e-4,.0011,.003,-.0027,8e-4,7e-4,3e-4,-.0039,-.002,-2e-4,-.0015,.0034,.0012,-.0025,.0024,-2e-4,4e-4,-.0042,-.0024,-.001,-.0023,.0016,-7e-4,.0039,1e-4,-5e-4,.0018,3e-4,-2e-4,-9e-4,-.0015,3e-4,-7e-4,-1e-4,-2e-4,.0023,.0032,.002,-.0013,.0013,-.0038,.0045,1e-4,-.0031,1e-4,.0019,-1e-4,.0016,.0013,0,-.002,.0023,2e-4,.0011,.0018,-.0024,6e-4,-.0017,.002,-8e-4,-.0021,7e-4,.0011,8e-4,4e-4,-.001,.0012,2e-4,-6e-4,-.0027,-5e-4,.001,-9e-4,1e-4,-1e-4,8e-4,-.0011,.0022,-.001,-5e-4,-.0011,.0016,-.0015,8e-4,-3e-4,9e-4,.0013,-7e-4,-7e-4,-2e-4],expression:[-.0018,-.0168,.0088,.0389,.1026,.0414,.2201,-.0262,-.0016,-.0017,.0612,-.0298,-.0323,.0093,.0013,-.005,.2207,.1315,-4e-4,.0858,-.0303,-.0133,.015,-.008,.1454,.0114,.0177,-.0077,.1022,.0356,-.0023,.1088,.0232,.003,-.0706,.0347,-1e-4,.004,-.0011,.0397,-.0096,-.0033,.0029,-.01,-.0083,-6e-4,-.0135,.0016,-.0087,-.0019,.0022,-.004,-.0087,.0105,8e-4,-.005,.0069,.0028,.0409,-.0391,.003,.0103,.0051,.0026,.0776,-.0083,-.0062,-.0567,.0268,.0175,.0017,.0156,-.0043,.0299,-.0395,-.0015,.0051,-.0148,.0125,.0035,.0603,.0109,-.0645,-.0257,.002,6e-4,-8e-4]},6:{mean:[-6e-4,-.1542,.8789],identity:[-7e-4,-.0032,.01,0,-.0027,.0031,6e-4,5e-4,-6e-4,-3e-4,.0013,-.0049,-2e-4,-.002,-.0046,8e-4,-.0011,.0054,2e-4,.0043,-.0027,3e-4,-.0022,-.0019,8e-4,.0032,-.0069,0,4e-4,-.0071,.0016,.0027,.0039,-.0017,9e-4,.0031,-1e-4,-5e-4,-4e-4,7e-4,-.0026,-.0012,-5e-4,6e-4,2e-4,-.0014,-.0013,.0019,-2e-4,-.0053,.0031,-6e-4,.0016,.0023,-.0013,.0021,.0029,8e-4,.0052,0,4e-4,0,.0037,-.0026,3e-4,.002,-2e-4,-.0024,4e-4,-4e-4,-.0012,8e-4,7e-4,-.0023,5e-4,0,.0014,-.0022,-.0016,0,-.0012,8e-4,-7e-4,.0014,-6e-4,-.0012,-3e-4,2e-4,.0012,-3e-4,-.002,-1e-4,1e-4,-2e-4,-.0016,9e-4,.002,.0019,0,6e-4,-.0022,.0016,1e-4,-.0017,-.0013,.001,9e-4,-1e-4,.0011,3e-4,-7e-4,.0014,8e-4,.0013,.0011,-.002,0,-.0015,.0014,.001,-.0015,7e-4,3e-4,.001,-1e-4,.0012,7e-4,6e-4,-4e-4,-.0013,-.0012,-9e-4,-.0011,2e-4,-5e-4,5e-4,4e-4,2e-4,1e-4,0,5e-4,5e-4,-.0014,.0015,-9e-4,5e-4,.0014,-8e-4,-8e-4,.0012],expression:[8e-4,.0481,.1653,.0784,.1008,-.3992,.5088,-.02,.0542,.001,.3723,-.0151,-.0986,.0283,-.0033,-.0121,.2634,.1202,.0036,-.0529,-.0245,-.0297,-.1085,.0495,.3264,.0083,4e-4,-.0314,.1459,-.1142,-.003,1e-4,.1154,-.0035,-.0285,-.0184,-1e-4,.0012,.0035,.079,-.0103,.0043,.011,-.004,-.0774,-.0047,-.023,.0284,-.0048,-.001,.0149,-.0039,.0046,.0528,-6e-4,.0063,.0376,.0096,.0558,-.0295,0,-.0311,-.0634,.0062,.0176,-.0154,-.0109,-.1149,.0192,.0326,.0121,.0237,.0034,.0262,-.0778,.0014,-.0045,-.0203,.0077,.0588,.0575,.008,-.0557,-.0095,.0032,.0054,-.0042]},7:{mean:[.0038,-.2927,.833],identity:[6e-4,-.0109,.0073,-6e-4,-.0044,.0017,-1e-4,-.0022,-6e-4,-3e-4,.0065,-.0014,-6e-4,-.0051,-.0046,3e-4,-.0029,.003,2e-4,.0038,-6e-4,0,-.0012,6e-4,-4e-4,.0053,-.0075,-2e-4,-7e-4,-.0063,.0014,.0026,.0019,-.0022,.0018,.0028,-1e-4,-.0012,.0011,9e-4,.0019,-.0019,-1e-4,.0012,-.0022,-3e-4,-.0012,4e-4,-8e-4,3e-4,-3e-4,0,.0017,.0021,-4e-4,.0012,.0022,-3e-4,.0026,-3e-4,4e-4,-.0026,.0032,-.0019,3e-4,.0015,1e-4,-.0015,.0013,-1e-4,1e-4,-.0029,0,-2e-4,-.0028,-7e-4,.0019,-3e-4,-2e-4,.0012,9e-4,4e-4,-.001,-.002,-.0016,.0011,-1e-4,3e-4,.0021,2e-4,-.0014,-9e-4,-1e-4,0,-2e-4,-.001,.0015,.0018,1e-4,7e-4,8e-4,.0017,.001,-9e-4,1e-4,4e-4,.0023,-1e-4,.0012,1e-4,-8e-4,2e-4,.0018,6e-4,3e-4,1e-4,.0012,-3e-4,.002,-6e-4,0,-1e-4,-.0022,4e-4,5e-4,.0011,2e-4,-.0013,-.0023,6e-4,6e-4,-5e-4,-5e-4,9e-4,2e-4,2e-4,.0011,-3e-4,.0011,.0015,.0011,3e-4,2e-4,8e-4,-4e-4,-8e-4,3e-4,0,.0012,-1e-4],expression:[.026,.1107,.3257,.1917,.3206,-1.1348,1.0791,-.035,.1549,-.0103,.6953,1e-4,-.3262,.068,.0219,-.0044,.3643,.2178,.0168,-.2478,-.1321,-.0414,-.3782,-.0617,.5088,-.0031,-.0311,-.0497,.0948,-.385,.0148,-.2224,-.1415,-.0074,.0863,-.203,3e-4,-.0081,.0057,.1164,-.0039,.0015,-.0024,.0505,.1532,.0039,-.0148,-.0753,.0163,.0058,-.0339,.0036,.0252,-.0569,-.0041,.0163,-.0361,.0035,-.018,.1266,0,-.0163,-.0046,.0133,-.1656,.2134,.0191,.0057,.0734,.0681,.0039,-.0144,.029,-.074,-.046,.0122,.0072,-.0162,-.0349,-.1234,.0212,-.0355,.0535,.1218,.0043,-.024,.0016]},8:{mean:[-.0018,-.3037,.8491],identity:[2e-4,-.0112,.0077,-4e-4,-.0044,.0024,1e-4,-.0021,-4e-4,-4e-4,.0066,-.002,-4e-4,-.0052,-.0044,3e-4,-.0032,.0039,4e-4,.0042,-3e-4,2e-4,-.0012,-2e-4,-2e-4,.0052,-.0083,-1e-4,-8e-4,-.0056,.0017,.0024,.0019,-.0023,.002,.0027,-2e-4,-.0013,.002,9e-4,.0017,-.0028,-2e-4,.0012,-.0026,0,-.0016,2e-4,-5e-4,3e-4,-.001,-1e-4,.0016,.0016,-3e-4,.0012,.0012,-3e-4,.0027,-3e-4,3e-4,-.0026,.0037,-.0017,1e-4,.0016,1e-4,-.0015,.0024,1e-4,2e-4,-.0039,0,-3e-4,-.0033,-6e-4,.0017,-4e-4,-4e-4,.0012,.0018,2e-4,-.0012,-.002,-.0017,.0013,-.001,3e-4,.0021,4e-4,-.0012,-6e-4,-2e-4,0,-4e-4,-9e-4,.0016,.0017,4e-4,7e-4,7e-4,.001,9e-4,-8e-4,5e-4,5e-4,.0023,.001,.0013,2e-4,-4e-4,2e-4,.0017,8e-4,3e-4,-1e-4,9e-4,-4e-4,.0019,-5e-4,3e-4,0,-.0025,3e-4,3e-4,.0011,1e-4,-.0015,-.001,7e-4,7e-4,-7e-4,-7e-4,8e-4,0,1e-4,.0013,-4e-4,.0012,.0014,.0017,4e-4,2e-4,3e-4,-3e-4,-9e-4,1e-4,0,.001,-4e-4],expression:[-.0092,2.8809,1.416,.2018,1.1982,-.9351,1.4492,-.1902,.1749,.0305,-.167,-.1572,-.7354,-.0492,.0115,.0608,.2971,.1179,.0046,-.0997,-.0041,-.0104,.3379,-.1854,.009,.0366,-.0583,.0269,-.0029,-.4175,-8e-4,.1794,.0752,-.0135,.1158,.1234,5e-4,.003,-.0032,.1034,-.0504,-.0055,-.0076,-.0772,.224,.0047,.0229,-.1044,.0162,-.0161,-.0241,-.0083,-.1388,-.0434,-.0125,-.0997,-.0327,-.0111,.1576,-.3911,.0199,.2522,.142,.0059,-.0721,-.0045,.031,-.1136,-.1685,.0641,.0142,.0312,.0426,-.1366,.1011,.0101,-.0157,.0018,-.0103,-.0344,.0907,.0016,.1168,-.0806,.0104,-.0057,.0111]},9:[{mean:[.0038,-.2927,.833],identity:[6e-4,-.0109,.0073,-6e-4,-.0044,.0017,-1e-4,-.0022,-6e-4,-3e-4,.0065,-.0014,-6e-4,-.0051,-.0046,3e-4,-.0029,.003,2e-4,.0038,-6e-4,0,-.0012,6e-4,-4e-4,.0053,-.0075,-2e-4,-7e-4,-.0063,.0014,.0026,.0019,-.0022,.0018,.0028,-1e-4,-.0012,.0011,9e-4,.0019,-.0019,-1e-4,.0012,-.0022,-3e-4,-.0012,4e-4,-8e-4,3e-4,-3e-4,0,.0017,.0021,-4e-4,.0012,.0022,-3e-4,.0026,-3e-4,4e-4,-.0026,.0032,-.0019,3e-4,.0015,1e-4,-.0015,.0013,-1e-4,1e-4,-.0029,0,-2e-4,-.0028,-7e-4,.0019,-3e-4,-2e-4,.0012,9e-4,4e-4,-.001,-.002,-.0016,.0011,-1e-4,3e-4,.0021,2e-4,-.0014,-9e-4,-1e-4,0,-2e-4,-.001,.0015,.0018,1e-4,7e-4,8e-4,.0017,.001,-9e-4,1e-4,4e-4,.0023,-1e-4,.0012,1e-4,-8e-4,2e-4,.0018,6e-4,3e-4,1e-4,.0012,-3e-4,.002,-6e-4,0,-1e-4,-.0022,4e-4,5e-4,.0011,2e-4,-.0013,-.0023,6e-4,6e-4,-5e-4,-5e-4,9e-4,2e-4,2e-4,.0011,-3e-4,.0011,.0015,.0011,3e-4,2e-4,8e-4,-4e-4,-8e-4,3e-4,0,.0012,-1e-4],expression:[.026,.1107,.3257,.1917,.3206,-1.1348,1.0791,-.035,.1549,-.0103,.6953,1e-4,-.3262,.068,.0219,-.0044,.3643,.2178,.0168,-.2478,-.1321,-.0414,-.3782,-.0617,.5088,-.0031,-.0311,-.0497,.0948,-.385,.0148,-.2224,-.1415,-.0074,.0863,-.203,3e-4,-.0081,.0057,.1164,-.0039,.0015,-.0024,.0505,.1532,.0039,-.0148,-.0753,.0163,.0058,-.0339,.0036,.0252,-.0569,-.0041,.0163,-.0361,.0035,-.018,.1266,0,-.0163,-.0046,.0133,-.1656,.2134,.0191,.0057,.0734,.0681,.0039,-.0144,.029,-.074,-.046,.0122,.0072,-.0162,-.0349,-.1234,.0212,-.0355,.0535,.1218,.0043,-.024,.0016]},{mean:[-.0018,-.3037,.8491],identity:[2e-4,-.0112,.0077,-4e-4,-.0044,.0024,1e-4,-.0021,-4e-4,-4e-4,.0066,-.002,-4e-4,-.0052,-.0044,3e-4,-.0032,.0039,4e-4,.0042,-3e-4,2e-4,-.0012,-2e-4,-2e-4,.0052,-.0083,-1e-4,-8e-4,-.0056,.0017,.0024,.0019,-.0023,.002,.0027,-2e-4,-.0013,.002,9e-4,.0017,-.0028,-2e-4,.0012,-.0026,0,-.0016,2e-4,-5e-4,3e-4,-.001,-1e-4,.0016,.0016,-3e-4,.0012,.0012,-3e-4,.0027,-3e-4,3e-4,-.0026,.0037,-.0017,1e-4,.0016,1e-4,-.0015,.0024,1e-4,2e-4,-.0039,0,-3e-4,-.0033,-6e-4,.0017,-4e-4,-4e-4,.0012,.0018,2e-4,-.0012,-.002,-.0017,.0013,-.001,3e-4,.0021,4e-4,-.0012,-6e-4,-2e-4,0,-4e-4,-9e-4,.0016,.0017,4e-4,7e-4,7e-4,.001,9e-4,-8e-4,5e-4,5e-4,.0023,.001,.0013,2e-4,-4e-4,2e-4,.0017,8e-4,3e-4,-1e-4,9e-4,-4e-4,.0019,-5e-4,3e-4,0,-.0025,3e-4,3e-4,.0011,1e-4,-.0015,-.001,7e-4,7e-4,-7e-4,-7e-4,8e-4,0,1e-4,.0013,-4e-4,.0012,.0014,.0017,4e-4,2e-4,3e-4,-3e-4,-9e-4,1e-4,0,.001,-4e-4],expression:[-.0092,2.8809,1.416,.2018,1.1982,-.9351,1.4492,-.1902,.1749,.0305,-.167,-.1572,-.7354,-.0492,.0115,.0608,.2971,.1179,.0046,-.0997,-.0041,-.0104,.3379,-.1854,.009,.0366,-.0583,.0269,-.0029,-.4175,-8e-4,.1794,.0752,-.0135,.1158,.1234,5e-4,.003,-.0032,.1034,-.0504,-.0055,-.0076,-.0772,.224,.0047,.0229,-.1044,.0162,-.0161,-.0241,-.0083,-.1388,-.0434,-.0125,-.0997,-.0327,-.0111,.1576,-.3911,.0199,.2522,.142,.0059,-.0721,-.0045,.031,-.1136,-.1685,.0641,.0142,.0312,.0426,-.1366,.1011,.0101,-.0157,.0018,-.0103,-.0344,.0907,.0016,.1168,-.0806,.0104,-.0057,.0111]}],10:{mean:[-.007,-.6338,.7695],identity:[1e-4,-.0296,.0089,-6e-4,-.0073,-.0065,-1e-4,-.0029,-.0031,-2e-4,.0128,.0065,0,-.0116,-.014,-1e-4,-.0037,-.0052,-5e-4,.0028,.003,-4e-4,.0041,.0015,6e-4,.0088,-.0076,-.0011,-.0015,-.0073,7e-4,-.0011,.0019,-.0011,-5e-4,.0031,-1e-4,-.0018,9e-4,.0018,.0038,.0068,-4e-4,-1e-4,.0061,.0024,.0024,-.0066,-6e-4,.0051,.0014,.002,.005,-.0035,1e-4,-.0034,-.004,-7e-4,.001,-8e-4,1e-4,-5e-4,-.0021,2e-4,.0045,-.0043,-.0012,-.0024,-.0014,6e-4,.0034,.0027,-8e-4,-.0053,.0014,1e-4,.0013,-.0018,6e-4,-.0015,.0029,-2e-4,-.0035,1e-4,-.002,.0012,.0048,.0011,1e-4,-2e-4,-3e-4,-.0012,.0033,6e-4,.002,-.0033,4e-4,.0028,2e-4,8e-4,-1e-4,-.0018,8e-4,.0017,1e-4,9e-4,8e-4,3e-4,.0019,-.001,.001,-7e-4,-.0013,0,1e-4,.0032,-1e-4,1e-4,.0011,-4e-4,5e-4,-7e-4,.0018,-3e-4,2e-4,7e-4,8e-4,-.0014,7e-4,.0015,-6e-4,-1e-4,-4e-4,.0019,-9e-4,-6e-4,-6e-4,-.0012,2e-4,-.0012,-8e-4,4e-4,6e-4,-.0011,3e-4,9e-4,-4e-4,6e-4,-7e-4,-4e-4],expression:[-.0603,2.0527,1.9014,.1025,.6143,.3804,.7881,-.1023,-.0764,.0454,-.2487,-.5073,-.6704,-.031,-.0181,.0466,.0651,-.0726,-.0033,-.0022,.2944,.0101,.1669,-.5225,-.4685,.0236,.0079,.011,.2173,.4529,.0121,-.2104,-.0673,.0225,-.4023,.0317,-9e-4,.0076,-.0032,.0333,.0523,.0129,-.001,-.0319,-.0139,.0015,-.0044,.0247,-5e-4,.0161,.0061,.0074,.0776,-.0176,.007,.055,-.017,.0052,-.1819,.0294,-.0161,-.0337,.0226,-.008,-.0297,.1967,-.0095,.0383,.2039,.0434,.0271,-.0064,-.0037,-.0294,-.024,.0024,-.0137,-.0209,-.0031,.0628,.1003,-.0126,-.056,-.0097,-.0012,-.0041,.0162]},11:{mean:[.2505,.3833,.7793],identity:[.0098,.012,.0077,-6e-4,-3e-4,0,1e-4,.0082,-7e-4,.0019,-.0036,-.0012,2e-4,.0119,-.0039,.001,1e-4,.0031,-.0036,-.0059,-7e-4,.0026,.0028,-.0011,9e-4,-.0032,8e-4,.0029,.0043,3e-4,.0025,-9e-4,.0047,.0016,.0022,.0018,-.001,.0025,-.003,-.001,.0033,.0034,4e-4,-.0052,.0024,-2e-4,.001,-.0014,-6e-4,.0038,-.0015,-6e-4,-.001,-.0011,-4e-4,-.001,4e-4,-7e-4,.0036,-8e-4,-2e-4,-.0019,5e-4,3e-4,-6e-4,-.0024,-.0017,-.0014,6e-4,-4e-4,-.0031,-.0013,-6e-4,.0042,2e-4,-2e-4,-.002,-3e-4,8e-4,.0018,-5e-4,-6e-4,-2e-4,-6e-4,.0025,.0019,.001,8e-4,-.0015,-.0012,-1e-4,-6e-4,-4e-4,.0023,-.001,6e-4,-2e-4,-.001,0,-9e-4,-.002,-.0011,1e-4,0,-1e-4,5e-4,6e-4,9e-4,-6e-4,5e-4,8e-4,-1e-4,-2e-4,-.0017,-6e-4,-4e-4,4e-4,-6e-4,.0012,4e-4,3e-4,-7e-4,3e-4,-2e-4,6e-4,1e-4,5e-4,-.0019,-6e-4,4e-4,7e-4,-1e-4,1e-4,5e-4,.001,-6e-4,-.002,-7e-4,-5e-4,5e-4,3e-4,7e-4,.0014,0,5e-4,-5e-4,-2e-4,3e-4,-6e-4,-1e-4],expression:[-9e-4,-3e-4,.0032,-.003,-.0034,-.0031,.0014,0,4e-4,-.0139,-.0764,.0275,-.002,-.0089,.0031,-.0503,-.0771,.038,-.1323,-.3523,.1368,-.0474,-.0564,.0296,-.0045,.007,-.0013,.0153,.1259,-.0464,.0866,.2175,-.0786,-.0413,-.1248,.0448,-.1777,-.4607,.1782,-5e-4,-.005,.0016,.0629,.1506,-.0624,.0545,.2576,-.0864,-.0231,-.0552,.0244,-.0136,-.0359,.0169,-.1158,-.2996,.1214,-.0235,-.0354,.0165,-.0745,-.1079,.0475,-.0116,-.0039,.0012,.0013,-.0108,-8e-4,.0044,-.0027,-1e-4,-.0694,.0363,.0071,.1462,-.136,.0047,.009,-.0177,.0038,-.0271,.0118,.0011,-.0399,-.0111,.0123]},12:{mean:[-.2981,.3828,.7563],identity:[-.0116,.014,.0054,.0018,5e-4,0,-4e-4,.0068,-.0013,-.0019,-.0048,-5e-4,5e-4,.0108,-.0036,-.0029,-.0018,.0029,.0043,-.0077,6e-4,-.0017,.002,-.0011,-.0014,-.0035,.0015,-.0024,.0011,4e-4,-.0048,2e-4,.0029,-1e-4,-1e-4,.003,.0019,.0035,-.0016,-4e-4,.0039,.0019,1e-4,-.0064,.004,3e-4,.002,-.0021,.0017,.0011,-.001,.0026,.0025,-5e-4,2e-4,-3e-4,-5e-4,-7e-4,9e-4,-4e-4,-.001,-.0022,.001,9e-4,-.0014,7e-4,.0011,-.001,-5e-4,-8e-4,-.0017,-.0021,9e-4,.0036,5e-4,4e-4,-.0031,6e-4,-.0015,.0027,2e-4,1e-4,-.0011,2e-4,-.0011,-.0018,4e-4,-.0013,-2e-4,7e-4,9e-4,-3e-4,.001,-.0021,8e-4,6e-4,-9e-4,4e-4,-7e-4,8e-4,-.002,-.0013,0,7e-4,-.0012,-1e-4,.0014,.0014,-1e-4,.0013,6e-4,6e-4,-.0014,-.0015,-9e-4,1e-4,1e-4,9e-4,7e-4,0,1e-4,-.001,-4e-4,0,-5e-4,1e-4,-3e-4,4e-4,-5e-4,-1e-4,-.0011,2e-4,0,1e-4,8e-4,8e-4,0,-7e-4,-8e-4,0,2e-4,-1e-4,.001,3e-4,4e-4,-2e-4,0,5e-4,.0018,-1e-4],expression:[0,-4e-4,.0028,.0036,-8e-4,-.0026,-.0015,-8e-4,3e-4,.0075,-.0608,.025,.0019,-.0076,.0033,.0379,-.0437,.0335,.0964,-.2452,.1233,.0368,-.0251,.0253,.0033,.0097,-.0021,-.0095,.1171,-.0475,-.064,.1548,-.0718,.0228,-.0831,.0343,-.1924,.6206,-.2771,.0021,-.0143,.0056,-.0705,.2522,-.1116,-.0692,.4229,-.1592,-.0093,.05,-.0185,.0948,-.3196,.1437,-.0184,.0194,-.0131,.0205,-.0353,.0201,.0676,-.135,.0672,.0137,-.0311,.0118,3e-4,-.0077,-2e-4,-.0151,4e-4,-.0058,.029,-.0139,.0163,.1324,.1819,-.0039,.0406,.0501,.0017,.0331,.0161,.0062,-.0235,-.0446,.0047]}};let et=1,tt=new Map;function rt(e){return tt.get(e)}class it{constructor(e){this._name=e,this.anchor_pose=h()}_getVertex(e,t,r){let i=r.mean.slice();for(let t=0;t<50;t++)i[0]+=e[t]*r.identity[3*t+0],i[1]+=e[t]*r.identity[3*t+1],i[2]+=e[t]*r.identity[3*t+2];for(let e=0;e<29;e++)i[0]+=t[e]*r.expression[3*e+0],i[1]+=t[e]*r.expression[3*e+1],i[2]+=t[e]*r.expression[3*e+2];return i}update(e,t,r){let i,a=Qe[this._name.toString()];if(a){if(Array.isArray(a)){i=this._getVertex(e,t,a[0]);let r=this._getVertex(e,t,a[1]);i[0]=.5*(i[0]+r[0]),i[1]=.5*(i[1]+r[1]),i[2]=.5*(i[2]+r[2])}else i=this._getVertex(e,t,a);r&&(i[0]*=-1),b(this.anchor_pose,i)}}}const at={incompatible:()=>!("function"==typeof Promise&&"object"==typeof WebAssembly&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices&&navigator.mediaDevices.getUserMedia),incompatible_ui:()=>{const e=document.createElement("div");e.append(function(){let e=document.createElement("div"),t="a recent web browser";navigator.userAgent.match(/Android/i)?(t="Chrome for Android",window.location.href="googlechrome://navigate?url="+encodeURI(window.location.href),setTimeout((()=>{window.location.href="samsunginternet://open?url="+encodeURI(window.location.href)}),2e3)):navigator.userAgent.match(/iPhone|iPod|iPad/i)&&(t="Safari",e.classList.add("zee-launcher-browser-safari")),e.classList.add("zee-launcher-unsupported"),e.innerHTML=`\n <style>.zee-launcher-unsupported {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n align-items: center;\n }\n .zee-launcher-browser-logo {\n background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 210 211' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(-82 -146)' fill-rule='nonzero' stroke='%23ffffff' stroke-width='2'%3E%3Cg transform='translate(83 146.5)'%3E%3Cpath d='m55.146 88.785l-32.039-49.472c19.962-24.947 49.904-38.684 80.517-38.81 17.739-0.12642 35.855 4.4246 52.336 13.99 18.2 10.619 32.039 25.874 40.846 43.404l-86.095-4.5511c-24.365-1.4327-47.556 12.347-55.565 35.439zm13.797 16.224c0 19.468 15.684 35.229 35.059 35.229 19.374 0 35.059-15.76 35.059-35.229 0-19.468-15.684-35.229-35.059-35.229-19.374 0-35.059 15.718-35.059 35.229zm132.06-37.588l-58.585 3.034c15.894 18.668 16.145 45.595 2.7678 66.243l-47.01 72.648c19.5 1.0535 39.588-3.2447 57.788-13.864 45.039-26.126 63.282-80.908 45.039-128.06zm-144.93 57.647l-39.126-77.326c-10.694 16.434-16.942 36.156-16.942 57.267 0 52.253 38.078 95.53 87.856 103.2l26.713-52.59c-24.155 4.5511-47.472-8.765-58.501-30.551z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A");\n width: 211px;\n height: 211px;\n margin-bottom: 25%;\n margin-top: -60px;\n background-repeat: no-repeat;\n }\n .zee-launcher-browser-safari .zee-launcher-browser-logo {\n background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 211 211' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(-82 -146)' fill-rule='nonzero' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='m180 251.86c0-4.0385 2.9377-7.855 7.2552-7.855 3.9614 0 7.7448 2.8402 7.7448 7.145 0 4.0385-2.8487 7.855-7.1662 7.855-4.0059 0-7.8338-2.9734-7.8338-7.145zm112-0.35503c0 57.728-46.772 104.5-104.5 104.5s-104.5-46.772-104.5-104.5 46.772-104.5 104.5-104.5 104.5 46.772 104.5 104.5zm-12-1c0-51.649-41.851-93.5-93.5-93.5s-93.5 41.851-93.5 93.5 41.851 93.5 93.5 93.5 93.5-41.851 93.5-93.5zm-30.624 40.983c0 1.5095 5.4495 4.2768 6.8328 5.1154-11.486 17.401-29.26 29.938-49.423 34.928l-1.8444-7.757c-0.12576-1.0482-0.79646-1.174-1.7606-1.174-0.79646 0-1.2576 1.174-1.1737 1.7611l1.8444 7.8828c-5.5753 1.174-11.234 1.7611-16.935 1.7611-15.217 0-30.182-4.2768-43.177-12.202 0.71263-1.174 5.1141-7.5474 5.1141-8.4698 0-0.79666-0.71263-1.5095-1.5091-1.5095-1.6348 0-5.1141 6.9603-6.1621 8.344-17.522-11.615-30.182-29.602-35.044-50.148l8.0066-1.761c0.92222-0.25158 1.1737-0.92246 1.1737-1.7611 0-0.79667-1.1737-1.2579-1.8444-1.174l-7.8389 1.803c-1.048-5.3251-1.6348-10.692-1.6348-16.143 0-15.556 4.4015-30.86 12.66-43.984 1.1737 0.71281 6.749 4.5284 7.6712 4.5284 0.79646 0 1.5091-0.58702 1.5091-1.3837 0-1.6353-6.1621-4.7381-7.5455-5.7024 11.821-17.275 29.805-29.728 50.219-34.34l1.7606 7.757c0.25152 0.92246 0.92222 1.174 1.7606 1.174 0.83838 0 1.2576-1.174 1.1737-1.8449l-1.7606-7.6732c5.1141-0.92246 10.312-1.5095 15.552-1.5095 15.552 0 30.727 4.4026 43.973 12.663-0.79646 1.174-4.5273 6.6249-4.5273 7.5474 0 0.79667 0.58687 1.5095 1.3833 1.5095 1.6348 0 4.7369-6.0379 5.5753-7.4216 17.187 11.615 29.469 29.351 34.248 49.561l-6.4975 1.3837c-1.048 0.25158-1.1737 0.92246-1.1737 1.8449 0 0.79667 1.1737 1.2579 1.7606 1.174l6.6232-1.5095c1.048 5.3251 1.6348 10.776 1.6348 16.227 0 15.221-4.1919 30.189-12.073 43.062-1.1737-0.58702-6.0364-4.0672-6.9586-4.0672-0.8803 0-1.5929 0.71281-1.5929 1.5095zm-14.876-98.483c-5.2178 4.88-53.863 49.48-55.228 51.8l-38.772 64.2c5.0974-4.76 53.863-49.6 55.108-51.72l38.892-64.28z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");\n }\n .zee-launcher-unsupported-message {\n text-align: center;\n width: 250px;\n font-family: sans-serif;\n color: #ffffff;\n }\n .zee-launcher-unsupported-message-copy {\n border: 1px solid #ffffff;\n border-radius: 5px;\n margin-top: 10px;\n }\n #zee-launcher-unsupported-message-input {\n border: none;\n padding: 10px;\n border-radius: 0px;\n border-right: 1px solid #344B60;\n height: 40px;\n color: #ffffff;\n background-color: black;\n box-sizing: border-box;\n width: calc(100% - 65px);\n margin-left: 5px;\n }\n #zee-launcher-unsupported-message-button {\n background: none;\n border: none;\n outline: none;\n text-transform: uppercase;\n color: #ffffff;\n height: 40px;\n display: inline-block;\n width: 59px;\n }\n .zee-launcher-unsupported-message-before-copy {\n height: 100px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n }\n .zee-launcher-unsupported-message-copied .zee-launcher-unsupported-message-before-copy {\n display: none;\n }\n .zee-launcher-unsupported-message-after-copy {\n display: none;\n }\n .zee-launcher-unsupported-message-copied .zee-launcher-unsupported-message-after-copy {\n height: 100px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n }\n </style>\n <div class="zee-launcher-browser-logo"></div>\n <div class="zee-launcher-unsupported-message">Open with ${t} to access this content.</div>\n <div class="zee-launcher-unsupported-message-before-copy">\n <div class="zee-launcher-unsupported-message ">Tap below to copy the address for easy pasting into ${t}.</div>\n <div class="zee-launcher-unsupported-message-copy"><input id="zee-launcher-unsupported-message-input" type="text/"><button id="zee-launcher-unsupported-message-button">Copy</button></div>\n </div>\n <div class="zee-launcher-unsupported-message zee-launcher-unsupported-message-after-copy">COPIED! Now paste into ${t}'s address bar to experience the content.</div>\n `;let r=e.querySelector("#zee-launcher-unsupported-message-input")||document.createElement("input");r.value=window.location.href;let i=()=>{if(navigator.userAgent.match(/iPhone|iPod|iPad/i)){let e=document.createRange();e.selectNodeContents(r);let t=window.getSelection();if(!t)return;t.removeAllRanges(),t.addRange(e),r.setSelectionRange(0,999999999)}else r.select();document.execCommand("copy"),r.blur(),e.classList.toggle("zee-launcher-unsupported-message-copied",!0)};return(e.querySelector("#zee-launcher-unsupported-message-button")||document.createElement("button")).addEventListener("click",i),r.addEventListener("click",i),e}()),Object.assign(e.style,{position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",zIndex:1001,backgroundColor:"rgba(0, 0, 0, 0.9)",fontFamily:"sans-serif",color:"white",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.classList.add("zee_launcher_compatibility"),document.body.append(e)}};let nt=1,st=new Map;class ot extends Ae{constructor(e,t){super(),this._impl=e,this._pipeline=t,this._packetNumber=0,this._motionUpdatesQueued=0,this._motionUpdatesSent=0,this._minFrameGapMs=0,this._lastUpdateTime=0}static create(e){let t=nt++;return st.set(t,new ot(t,e)),te("sequence_source_source_t initialized"),t}static get(e){return st.get(e)}loadFromMemory(e){try{this._decoder=new Ee(e),this._packetNumber=0,this._lastUpdateTime=0}catch(e){re("Unable to decode sequence:",e)}}maxPlaybackFpsSet(e){this._minFrameGapMs=e<=0?0:1e3/e}getFrame(e){let t=Ke.get(this._pipeline);if(!t)return;if(!this._decoder)return;if(this._submitMotionUpdates(t),this._motionUpdatesQueued>this._motionUpdatesSent)return;if(e)return;let r=performance.now();if(r<this._lastUpdateTime+this._minFrameGapMs)return;if(this._packetNumber>=this._decoder.numberPackets)return;let i=this._decoder.dataByPacket.get(this._packetNumber);if(i.type!=we.CAMERA_FRAME)return;this._packetNumber++;let a=t.cameraPixelArrays.pop();for(;a&&a.byteLength!==i.greyscale.byteLength;)a=t.cameraPixelArrays.pop();a||(a=new ArrayBuffer(i.greyscale.byteLength)),new Uint8Array(a).set(i.greyscale),this._lastUpdateTime=r;let n={data:a,cameraSourceData:i.greyscale,cameraModel:i.cameraModel,cameraToDevice:i.cameraToDevice,dataWidth:i.width,dataHeight:i.height,texture:void 0,userFacing:i.userFacing,uvTransform:h(),cameraSource:this};this._submitMotionUpdates(t);const s=t.registerToken(n);t.sendDataToWorker(n.data||new ArrayBuffer(0),s,n.dataWidth,n.dataHeight,n.userFacing,n.cameraToDevice,n.cameraModel)}destroy(){st.delete(this._impl),this.pause()}start(){var e;let t=Ke.get(this._pipeline);t&&t.currentCameraSource!==this&&(null===(e=t.currentCameraSource)||void 0===e||e.pause(),t.currentCameraSource=this)}pause(){let e=Ke.get(this._pipeline);e&&e.currentCameraSource===this&&(e.currentCameraSource=void 0)}uploadGL(e){let t=Ke.get(this._pipeline);if(!t)return;let r=null==t?void 0:t.glContext;r&&(e.texture||(e.texture=t.getVideoTexture()),e.texture&&e.cameraSourceData&&(r.bindTexture(r.TEXTURE_2D,e.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,e.dataWidth,e.dataHeight,0,r.LUMINANCE,r.UNSIGNED_BYTE,new Uint8Array(e.cameraSourceData)),r.bindTexture(r.TEXTURE_2D,null)))}_submitMotionUpdates(e){let t=!1;for(;this._packetNumber<this._decoder.numberPackets;){let r=this._decoder.dataByPacket.get(this._packetNumber);if(r.type==we.CAMERA_FRAME)break;switch(r.type){case we.ACCELEROMETER:e.motionAccelerometerSubmit(r.t,r.x,r.y,r.z),t=!0;break;case we.ROTATION_RATE:e.motionRotationRateSubmit(r.t,r.x,r.y,r.z),t=!0;break;case we.ATTITUDE:e.motionAttitudeSubmit(r.t,r.x,r.y,r.z),t=!0;break;case we.ATTITUDE_MATRIX:e.motionAttitudeMatrix(r.attitude),t=!0}this._packetNumber++}t&&(this._motionUpdatesQueued++,setTimeout((()=>{this._motionUpdatesSent++}),0))}}const _t=new TextDecoder;class ct{constructor(e,t=!1){this._data=e,this._paddingBytes=t,this.truncatedChunks=!1,this._view=new DataView(this._data),this.root=this._parse()}_parse(){if("RIFF"!==_t.decode(this._data.slice(0,4)))throw new Error("Not a valid ZPT file");return this._parseChunk(0)}_parseChunk(e){const t=_t.decode(this._data.slice(e,e+4)),r=this._view.getUint32(e+4,!0),i=new Uint8Array(this._data,e+8,r);let a,n;if(i.byteLength!==r&&(this.truncatedChunks=!0),"RIFF"===t||"LIST"===t){n=_t.decode(this._data.slice(e+8,e+12)),a=[];let t=4;for(;t<i.byteLength-1;){const r=this._parseChunk(e+8+t);a.push(r),t+=r.data.byteLength+8,this._paddingBytes&&1&r.data.byteLength&&t++}}return{ident:t,data:i,subident:n,subchunks:a}}find(e,t=this.root){if(t.ident===e)return t;if(t.subchunks)for(let r of t.subchunks){const t=this.find(e,r);if(t)return t}}has(e){return void 0!==this.find(e)}}let lt=new Map;const ut=new TextDecoder;class dt{constructor(e,t){this._client=e,this._impl=t,this._targets=[]}static create(e,t){let r=t.image_tracker_create(e);return lt.set(r,new dt(t,r)),r}static get(e){return lt.get(e)}destroy(){this._client.image_tracker_destroy(this._impl),lt.delete(this._impl)}loadFromMemory(e){this._targets.push({data:e}),this._client.image_tracker_target_load_from_memory(this._impl,e)}targetCount(){return this._targets.length}getTargetInfo(e){let t=this._targets[e];if(t&&t.info)return t.info;t.info={topRadius:-1,bottomRadius:-1,sideLength:-1,physicalScaleFactor:-1};try{const e=new ct(t.data,!1),r=e.find("IMG ");if(r){let i="image/png";const a=e.find("IMGM");a&&(i=ut.decode(a.data)),t.info.preview={mimeType:i,compressed:r.data}}const i=e.find("ODLE");if(i){const e=ut.decode(i.data);this._parseOdle(e,t.info)}}catch(e){}return t.info}_parseOdle(e,t){let r=0,i="0";if([i,r]=ft(r,e),"3"===i){let i="0";if([i,r]=ft(r,e),"0"!==i&&"1"!==i)return;let a="0";[a,r]=ft(r,e);const n=parseInt(a);if(isNaN(n)||n<1)return;let s="";if([s,r]=ft(r,e),0!==s.length)return;let o="";[o,r]=ft(r,e);const _=o.split(" ");if(_.length<7)return;t.physicalScaleFactor=parseFloat(_[6]),isNaN(t.physicalScaleFactor)&&(t.physicalScaleFactor=-1),_.length>=8&&(t.topRadius=parseFloat(_[7]),isNaN(t.topRadius)&&(t.topRadius=-1),t.bottomRadius=t.topRadius),_.length>=9&&(t.bottomRadius=parseFloat(_[8]),isNaN(t.bottomRadius)&&(t.bottomRadius=-1)),_.length>=10&&(t.sideLength=parseFloat(_[9]),isNaN(t.sideLength)&&(t.sideLength=-1))}}getDecodedPreview(e){const t=this.getTargetInfo(e);if(!t.preview)return;const r=new Blob([t.preview.compressed],{type:t.preview.mimeType}),i=new Image;return i.src=URL.createObjectURL(r),i}}function ft(e,t){let r=t.indexOf("\n",e);return[t.substring(e,r>=0?r:void 0).replace("\r",""),r+1]}var ht=function(e,t,r,i){return new(r||(r=Promise))((function(a,n){function s(e){try{_(i.next(e))}catch(e){n(e)}}function o(e){try{_(i.throw(e))}catch(e){n(e)}}function _(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}_((i=i.apply(e,t||[])).next())}))};let mt;function pt(e){if(mt)return mt;let t=!1;M(null==e?void 0:e.worker).then((()=>{te("Fully loaded"),t=!0}));let i=new a((e=>{F.postOutgoingMessage({t:"zappar",d:e},[e])}));if(window.location.hostname.toLowerCase().indexOf(".zappar.io")>0){let e=window.location.pathname.split("/");e.length>1&&e[1].length>0&&i.impl.analytics_project_id_set(".wiz"+e[1])}return F.onIncomingMessage.bind((e=>{var t,r,a,n,s,o,_;switch(e.t){case"zappar":null===(t=Ke.get(e.p))||void 0===t||t.pendingMessages.push(e.d);break;case"buf":i.serializer.bufferReturn(e.d);break;case"cameraFrameRecycleS2C":{let t=e;null===(a=null===(r=Ke.get(t.p))||void 0===r?void 0:r.cameraTokenReturn)||void 0===a||a.call(r,e);break}case"videoFrameS2C":{let t=e;null===(s=null===(n=Ke.get(t.p))||void 0===n?void 0:n.videoFrameFromWorker)||void 0===s||s.call(n,t);break}case"imageBitmapS2C":{let t=e;null===(_=null===(o=Ke.get(t.p))||void 0===o?void 0:o.imageBitmapFromWorker)||void 0===_||_.call(o,t);break}case"licerr":{let e=document.createElement("div");e.innerHTML="Visit <a href='https://docs.zap.works/universal-ar/licensing/' style='color: white;'>our licensing page</a> to find out about hosting on your own domain.",e.style.position="absolute",e.style.bottom="20px",e.style.width="80%",e.style.backgroundColor="black",e.style.color="white",e.style.borderRadius="10px",e.style.padding="10px",e.style.fontFamily="sans-serif",e.style.textAlign="center",e.style.left="10%",e.style.zIndex=Number.MAX_SAFE_INTEGER.toString();let t=document.createElement("span");t.innerText=" (30)",e.append(t);let r=30;setInterval((function(){r--,r>=0&&(t.innerText=" ("+r.toString()+")")}),1e3),document.body.append(e)}case"gfx":{let e=document.createElement("div");e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="250" height="80.408" viewBox="0 0 250 80.408"><defs><filter id="a" x="0" y="1.182" width="250" height="79.226" filterUnits="userSpaceOnUse"><feOffset dy="3" input="SourceAlpha"/><feGaussianBlur stdDeviation="3" result="b"/><feFlood flood-opacity="0.161"/><feComposite operator="in" in2="b"/><feComposite in="SourceGraphic"/></filter><filter id="c" x="6.929" y="0" width="111.975" height="40.988" filterUnits="userSpaceOnUse"><feOffset dy="3" input="SourceAlpha"/><feGaussianBlur stdDeviation="3" result="d"/><feFlood flood-opacity="0.161"/><feComposite operator="in" in2="d"/><feComposite in="SourceGraphic"/></filter></defs><g transform="translate(-26.873 -414.029)"><g transform="translate(44 423.332)"><g transform="translate(0 0.635)" style="isolation:isolate"><g transform="translate(0 0)"><g transform="matrix(1, 0, 0, 1, -17.13, -9.94)" filter="url(#a)"><path d="M55.766,44.97V11.8h8.272v2.6h.089a8.258,8.258,0,0,1,7.046-3.357,11.4,11.4,0,0,1,8.5,3.686,12.667,12.667,0,0,1,3.278,8.622,12.509,12.509,0,0,1-3.25,8.57,11.353,11.353,0,0,1-8.429,3.6,9.533,9.533,0,0,1-7.229-2.95V43.378l-8.269,1.594h0Zm8-21.671a4.958,4.958,0,0,0,5.319,5.15A4.957,4.957,0,0,0,74.4,23.3a5.321,5.321,0,0,0-10.638,0ZM16.105,18.412H2.752V11.038H30.9L14.887,37.16H38.22L0,44.534ZM131.469,38.45a.761.761,0,0,1-.484-.166.582.582,0,0,1-.228-.419l-.553-3.586a12.243,12.243,0,0,1-1.782-.721l-2.789,2.084a.718.718,0,0,1-.5.176.688.688,0,0,1-.495-.214,25.864,25.864,0,0,1-3.264-3.274.754.754,0,0,1,.018-.9c.2-.277.543-.713,1.01-1.3.483-.6.832-1.05,1.068-1.374a9.614,9.614,0,0,1-.811-1.929l-3.62-.527a.631.631,0,0,1-.416-.243.728.728,0,0,1-.159-.458V21.283a.743.743,0,0,1,.159-.448.6.6,0,0,1,.376-.253l3.68-.546a9.511,9.511,0,0,1,.772-1.792c-.523-.733-1.235-1.638-2.117-2.69a.731.731,0,0,1-.2-.467.82.82,0,0,1,.178-.449,19.577,19.577,0,0,1,1.949-2.095c.953-.924,1.582-1.393,1.87-1.393a.861.861,0,0,1,.515.195l2.729,2.084a11.551,11.551,0,0,1,1.8-.741,31.446,31.446,0,0,1,.573-3.623.666.666,0,0,1,.712-.546h4.392a.757.757,0,0,1,.485.166.58.58,0,0,1,.228.419l.553,3.584a12.576,12.576,0,0,1,1.782.722l2.809-2.085a.641.641,0,0,1,.475-.176.776.776,0,0,1,.5.195,27.035,27.035,0,0,1,3.264,3.313.625.625,0,0,1,.139.429.742.742,0,0,1-.159.447c-.2.271-.525.7-1.008,1.3-.467.581-.827,1.043-1.069,1.373a11.8,11.8,0,0,1,.812,1.91l3.62.545a.626.626,0,0,1,.416.244.736.736,0,0,1,.158.457v4.325a.755.755,0,0,1-.158.449.6.6,0,0,1-.4.253l-3.66.545a12.692,12.692,0,0,1-.772,1.774c.465.653,1.177,1.559,2.117,2.688a.751.751,0,0,1,.2.488.648.648,0,0,1-.178.448,19.638,19.638,0,0,1-1.958,2.1c-.947.918-1.573,1.384-1.861,1.384a.976.976,0,0,1-.515-.176l-2.731-2.1a11.361,11.361,0,0,1-1.8.741,31.849,31.849,0,0,1-.573,3.625.668.668,0,0,1-.713.546Zm-1.385-18.491a4.935,4.935,0,0,0,0,7.053,5.12,5.12,0,0,0,7.163,0,4.931,4.931,0,0,0,0-7.053,5.117,5.117,0,0,0-7.163,0Zm69.969,14.868a18.523,18.523,0,0,1-4.932-2.073l1.705-6.1A13.441,13.441,0,0,0,200.779,29a12.14,12.14,0,0,0,4.344.818,4.644,4.644,0,0,0,2.351-.482,1.538,1.538,0,0,0,.806-1.4q0-1.5-3.25-2.242-1.061-.246-1.705-.425a12.335,12.335,0,0,1-5.358-2.589,5.5,5.5,0,0,1-1.671-4.157,6.323,6.323,0,0,1,2.547-5.267,10.993,10.993,0,0,1,6.9-1.972,21.351,21.351,0,0,1,4.552.5,25.439,25.439,0,0,1,4.736,1.557l-1.705,5.491a14.244,14.244,0,0,0-3.319-1.636,10.6,10.6,0,0,0-3.364-.561,4.227,4.227,0,0,0-2.121.426,1.357,1.357,0,0,0-.714,1.232q0,1.211,3.227,2.04.737.2,1.106.291,4.264,1.187,5.935,2.79a5.728,5.728,0,0,1,1.67,4.337A6.781,6.781,0,0,1,213,33.37a11.48,11.48,0,0,1-7.259,2.14A22.577,22.577,0,0,1,200.053,34.827ZM30.568,31.834a12.566,12.566,0,0,1-3.292-8.59,12.567,12.567,0,0,1,3.247-8.568,11.3,11.3,0,0,1,8.423-3.638,9.519,9.519,0,0,1,7.217,3V11.8h8.264V34.735H46.163V32.186h-.09c-1.32,2.071-3.951,3.308-7.038,3.308A11.412,11.412,0,0,1,30.568,31.834Zm5.245-8.545a4.95,4.95,0,0,0,5.312,5.141,4.95,4.95,0,0,0,5.312-5.141A5.023,5.023,0,0,0,41.125,18.1,5.023,5.023,0,0,0,35.813,23.289Zm69.2,11.554-3.527-10.452q-.282-.892-.505-1.8t-.412-1.8a30.821,30.821,0,0,1-.917,3.454l-.047.16L96.1,34.842H90.176l-9.925-23.1h8.632l3.552,10.223q.4,1.12.634,1.955t.377,1.635a23.558,23.558,0,0,1,.917-3.179q.093-.274.141-.411l3.528-10.223h5.056l3.5,10.2.07.183a20.724,20.724,0,0,1,.988,3.43q.141-.732.364-1.532t.647-2.058l3.574-10.223h8.678l-9.971,23.1Zm80.154-.092-8.587-9.841v9.841h-7.888V1.5L176.583,0V22.28l8.272-9.665h9.96L184.584,23.266l11.156,11.485Zm-35.09,0V11.782h8.272v3.761h.091a8.131,8.131,0,0,1,7.546-4.074h1.593V19.3a6.8,6.8,0,0,0-3.5-.761c-4.593,0-5.728,3-5.728,6.941v9.268Z" transform="translate(17.13 15.31)"/></g><g transform="matrix(1, 0, 0, 1, -17.13, -9.94)" filter="url(#c)"><path d="M3.576-12.852v-4.3H6.628a2.867,2.867,0,0,1,1.945.55A2.034,2.034,0,0,1,9.188-15a2.06,2.06,0,0,1-.615,1.608,2.784,2.784,0,0,1-1.945.542ZM2.017-18.464V-6.748H3.576v-4.792H7.153a3.569,3.569,0,0,0,2.683-.9A3.478,3.478,0,0,0,10.747-15a3.45,3.45,0,0,0-.911-2.552,3.638,3.638,0,0,0-2.683-.911Zm11.421,7.483a4.221,4.221,0,0,1,.205-1.37,2.957,2.957,0,0,1,.566-1.009,2.411,2.411,0,0,1,.845-.624A2.515,2.515,0,0,1,16.08-14.2a2.515,2.515,0,0,1,1.026.213,2.411,2.411,0,0,1,.845.624,2.957,2.957,0,0,1,.566,1.009,4.221,4.221,0,0,1,.205,1.37,4.221,4.221,0,0,1-.205,1.37,2.867,2.867,0,0,1-.566,1,2.457,2.457,0,0,1-.845.615,2.515,2.515,0,0,1-1.026.213,2.515,2.515,0,0,1-1.026-.213,2.457,2.457,0,0,1-.845-.615,2.867,2.867,0,0,1-.566-1A4.221,4.221,0,0,1,13.438-10.981Zm-1.477,0a5.573,5.573,0,0,0,.263,1.739,3.97,3.97,0,0,0,.788,1.4,3.623,3.623,0,0,0,1.3.935,4.4,4.4,0,0,0,1.772.336A4.381,4.381,0,0,0,17.86-6.9a3.641,3.641,0,0,0,1.288-.935,3.97,3.97,0,0,0,.788-1.4,5.573,5.573,0,0,0,.263-1.739,5.65,5.65,0,0,0-.263-1.748,3.96,3.96,0,0,0-.788-1.411,3.729,3.729,0,0,0-1.288-.944,4.29,4.29,0,0,0-1.78-.345,4.3,4.3,0,0,0-1.772.345,3.71,3.71,0,0,0-1.3.944,3.96,3.96,0,0,0-.788,1.411A5.65,5.65,0,0,0,11.961-10.981Zm18.28,4.234,2.708-8.484H31.5L29.6-8.29h-.033L27.8-15.231H26.27L24.564-8.29h-.033l-1.92-6.941H21.068l2.724,8.484H25.3l1.707-6.744h.033l1.723,6.744ZM40.169-11.8H35.3a2.905,2.905,0,0,1,.213-.927A2.473,2.473,0,0,1,36-13.492a2.255,2.255,0,0,1,.747-.517,2.429,2.429,0,0,1,.976-.189,2.386,2.386,0,0,1,.96.189,2.415,2.415,0,0,1,.755.509,2.391,2.391,0,0,1,.509.763A2.854,2.854,0,0,1,40.169-11.8Zm1.346,2.363H40.136a1.983,1.983,0,0,1-.747,1.247,2.414,2.414,0,0,1-1.452.41,2.889,2.889,0,0,1-1.2-.23,2.348,2.348,0,0,1-.837-.615,2.4,2.4,0,0,1-.476-.886,3.367,3.367,0,0,1-.131-1.058h6.35a6.754,6.754,0,0,0-.139-1.625,4.7,4.7,0,0,0-.624-1.575,3.716,3.716,0,0,0-1.2-1.19,3.48,3.48,0,0,0-1.879-.468,3.858,3.858,0,0,0-1.6.328,3.76,3.76,0,0,0-1.264.919,4.236,4.236,0,0,0-.829,1.395,5.105,5.105,0,0,0-.3,1.772,6.8,6.8,0,0,0,.287,1.789,3.9,3.9,0,0,0,.763,1.411,3.478,3.478,0,0,0,1.255.919,4.358,4.358,0,0,0,1.764.328,3.851,3.851,0,0,0,2.4-.722A3.39,3.39,0,0,0,41.515-9.439Zm1.526-5.793v8.484h1.395v-3.774a5.8,5.8,0,0,1,.164-1.452,2.784,2.784,0,0,1,.525-1.075,2.251,2.251,0,0,1,.952-.673,3.945,3.945,0,0,1,1.428-.23v-1.477a3.135,3.135,0,0,0-1.871.459,3.779,3.779,0,0,0-1.247,1.526h-.033v-1.789ZM54.15-11.8H49.276a2.905,2.905,0,0,1,.213-.927,2.473,2.473,0,0,1,.492-.763,2.255,2.255,0,0,1,.747-.517A2.429,2.429,0,0,1,51.7-14.2a2.386,2.386,0,0,1,.96.189,2.415,2.415,0,0,1,.755.509,2.391,2.391,0,0,1,.509.763A2.854,2.854,0,0,1,54.15-11.8ZM55.5-9.439H54.117a1.983,1.983,0,0,1-.747,1.247,2.414,2.414,0,0,1-1.452.41,2.889,2.889,0,0,1-1.2-.23,2.348,2.348,0,0,1-.837-.615,2.4,2.4,0,0,1-.476-.886,3.367,3.367,0,0,1-.131-1.058h6.35a6.754,6.754,0,0,0-.139-1.625,4.7,4.7,0,0,0-.624-1.575,3.716,3.716,0,0,0-1.2-1.19,3.48,3.48,0,0,0-1.879-.468,3.858,3.858,0,0,0-1.6.328,3.76,3.76,0,0,0-1.264.919,4.236,4.236,0,0,0-.829,1.395,5.1,5.1,0,0,0-.3,1.772,6.8,6.8,0,0,0,.287,1.789,3.9,3.9,0,0,0,.763,1.411,3.478,3.478,0,0,0,1.255.919,4.358,4.358,0,0,0,1.764.328,3.851,3.851,0,0,0,2.4-.722A3.39,3.39,0,0,0,55.5-9.439Zm2.593-1.477a5.581,5.581,0,0,1,.131-1.214,3.212,3.212,0,0,1,.427-1.05,2.221,2.221,0,0,1,.788-.738,2.4,2.4,0,0,1,1.2-.279,2.589,2.589,0,0,1,1.231.271,2.389,2.389,0,0,1,.829.714,2.985,2.985,0,0,1,.468,1.026,4.889,4.889,0,0,1,.148,1.206,4.919,4.919,0,0,1-.139,1.165,3.053,3.053,0,0,1-.451,1.026,2.4,2.4,0,0,1-.8.73,2.4,2.4,0,0,1-1.2.279,2.491,2.491,0,0,1-1.173-.263,2.332,2.332,0,0,1-.82-.706,3.122,3.122,0,0,1-.476-1.009A4.338,4.338,0,0,1,58.088-10.916Zm6.564,4.168V-18.464H63.257V-14.1h-.033a2.247,2.247,0,0,0-.566-.632,3.216,3.216,0,0,0-.714-.41,3.583,3.583,0,0,0-.755-.222,4.132,4.132,0,0,0-.706-.066,3.861,3.861,0,0,0-1.7.353,3.487,3.487,0,0,0-1.214.952,4.018,4.018,0,0,0-.722,1.4,5.985,5.985,0,0,0-.238,1.707,5.8,5.8,0,0,0,.246,1.707,4.218,4.218,0,0,0,.73,1.411,3.529,3.529,0,0,0,1.214.968,3.827,3.827,0,0,0,1.715.361,4.135,4.135,0,0,0,1.625-.312A2.053,2.053,0,0,0,63.224-7.9h.033v1.149Zm6.761-11.716V-6.748h1.395V-7.88h.033a2.247,2.247,0,0,0,.566.632,2.982,2.982,0,0,0,.714.4,3.874,3.874,0,0,0,.763.213,4.193,4.193,0,0,0,.7.066,3.94,3.94,0,0,0,1.7-.345,3.4,3.4,0,0,0,1.214-.944,4.018,4.018,0,0,0,.722-1.4,5.985,5.985,0,0,0,.238-1.707,5.8,5.8,0,0,0-.246-1.707,4.312,4.312,0,0,0-.73-1.419,3.488,3.488,0,0,0-1.214-.976,3.827,3.827,0,0,0-1.715-.361,4.043,4.043,0,0,0-1.625.32,2.088,2.088,0,0,0-1.083,1.026h-.033v-4.381Zm6.564,7.4a5.581,5.581,0,0,1-.131,1.214,3.212,3.212,0,0,1-.427,1.05,2.243,2.243,0,0,1-.779.738,2.385,2.385,0,0,1-1.206.279A2.589,2.589,0,0,1,74.2-8.052a2.389,2.389,0,0,1-.829-.714,2.985,2.985,0,0,1-.468-1.026A4.889,4.889,0,0,1,72.758-11a4.919,4.919,0,0,1,.139-1.165,3.053,3.053,0,0,1,.451-1.026,2.4,2.4,0,0,1,.8-.73,2.4,2.4,0,0,1,1.2-.279,2.491,2.491,0,0,1,1.173.263,2.332,2.332,0,0,1,.82.706,3.122,3.122,0,0,1,.476,1.009A4.338,4.338,0,0,1,77.976-11.063Zm6.449,5.448a8.871,8.871,0,0,1-.484,1.05,2.871,2.871,0,0,1-.525.7,1.782,1.782,0,0,1-.64.394,2.462,2.462,0,0,1-.812.123,3.721,3.721,0,0,1-.492-.033A2.324,2.324,0,0,1,81-3.5v-1.28a2.342,2.342,0,0,0,.418.139,1.765,1.765,0,0,0,.4.057,1.2,1.2,0,0,0,.714-.205,1.255,1.255,0,0,0,.435-.583L83.539-6.8l-3.364-8.434h1.575L84.228-8.29h.033l2.379-6.941h1.477Z" transform="translate(17.85 28.4)"/></g></g></g><g transform="translate(0 0)"><g transform="translate(0 5.371)"><path d="M11.76,24.456A11.41,11.41,0,0,1,3.292,20.8,12.564,12.564,0,0,1,0,12.206,12.569,12.569,0,0,1,3.246,3.638,11.307,11.307,0,0,1,11.67,0a9.519,9.519,0,0,1,7.217,3V.759h8.264V23.7H18.887V21.148H18.8C17.478,23.219,14.846,24.456,11.76,24.456ZM13.849,7.064A5.023,5.023,0,0,0,8.537,12.25a4.95,4.95,0,0,0,5.312,5.141A4.95,4.95,0,0,0,19.16,12.25,5.023,5.023,0,0,0,13.849,7.064Z" transform="translate(27.277 11.038)" fill="#fff"/><path d="M0,33.931V.758H8.271v2.6H8.36A8.258,8.258,0,0,1,15.406,0,11.4,11.4,0,0,1,23.9,3.686a12.665,12.665,0,0,1,3.278,8.622,12.508,12.508,0,0,1-3.25,8.57,11.351,11.351,0,0,1-8.429,3.6,9.535,9.535,0,0,1-7.229-2.95V32.337L0,33.931ZM13.317,7.07A5.028,5.028,0,0,0,8,12.259a4.957,4.957,0,0,0,5.319,5.15,4.957,4.957,0,0,0,5.319-5.15A5.028,5.028,0,0,0,13.317,7.07Z" transform="translate(55.766 11.041)" fill="#fff"/><path d="M22.836,0l3.5,10.2.07.183a20.748,20.748,0,0,1,.988,3.43q.141-.731.364-1.532t.647-2.058L31.985,0h8.678L30.691,23.1H24.764L21.237,12.647q-.282-.891-.505-1.8t-.412-1.8A30.927,30.927,0,0,1,19.4,12.51l-.047.16L15.851,23.1H9.925L0,0H8.631l3.552,10.223q.4,1.121.635,1.955t.377,1.635a23.522,23.522,0,0,1,.917-3.179q.093-.274.141-.411L17.78,0h5.056" transform="translate(80.251 11.743)" fill="#fff"/><path d="M0,34.75V1.5L7.888,0V22.28l8.272-9.665H26.12L15.889,23.266,27.045,34.75H16.475L7.888,24.91v9.84H0" transform="translate(168.695 0)" fill="#fff"/><path d="M0,21.47l1.705-6.1a13.453,13.453,0,0,0,3.952,2.342A12.145,12.145,0,0,0,10,18.534a4.643,4.643,0,0,0,2.351-.482,1.539,1.539,0,0,0,.807-1.4q0-1.5-3.25-2.241-1.06-.246-1.705-.426A12.325,12.325,0,0,1,2.846,11.4,5.5,5.5,0,0,1,1.176,7.239,6.324,6.324,0,0,1,3.722,1.972,11,11,0,0,1,10.624,0a21.365,21.365,0,0,1,4.551.5,25.45,25.45,0,0,1,4.736,1.558l-1.706,5.49a14.24,14.24,0,0,0-3.319-1.636,10.6,10.6,0,0,0-3.364-.56A4.22,4.22,0,0,0,9.4,5.782a1.356,1.356,0,0,0-.714,1.233q0,1.211,3.227,2.04.737.2,1.106.291,4.264,1.188,5.935,2.79a5.728,5.728,0,0,1,1.671,4.337,6.782,6.782,0,0,1-2.743,5.614,11.478,11.478,0,0,1-7.259,2.14,22.565,22.565,0,0,1-5.693-.683A18.517,18.517,0,0,1,0,21.47" transform="translate(195.121 11.284)" fill="#fff"/><path d="M8.273,4.075h.091A8.13,8.13,0,0,1,15.909,0H17.5V7.834A6.8,6.8,0,0,0,14,7.074c-4.593,0-5.728,3-5.728,6.941v9.268H0V.313H8.273V4.075" transform="translate(150.08 11.469)" fill="#fff"/><path d="M17.392,29.929H13a.76.76,0,0,1-.485-.166.579.579,0,0,1-.227-.419l-.553-3.586a12.3,12.3,0,0,1-1.781-.721L7.163,27.123a.719.719,0,0,1-.495.176.687.687,0,0,1-.495-.214A25.873,25.873,0,0,1,2.91,23.81a.753.753,0,0,1,.019-.9c.2-.277.542-.713,1.009-1.3.483-.6.832-1.05,1.068-1.374a9.591,9.591,0,0,1-.811-1.929l-3.62-.526a.63.63,0,0,1-.416-.243A.729.729,0,0,1,0,17.089V12.762a.746.746,0,0,1,.159-.448.6.6,0,0,1,.376-.253l3.68-.546a9.5,9.5,0,0,1,.772-1.792C4.464,8.991,3.752,8.085,2.87,7.034a.732.732,0,0,1-.2-.468.82.82,0,0,1,.179-.449A19.622,19.622,0,0,1,4.8,4.023C5.751,3.1,6.38,2.631,6.668,2.631a.859.859,0,0,1,.515.194L9.913,4.91a11.536,11.536,0,0,1,1.8-.741A31.372,31.372,0,0,1,12.287.546.665.665,0,0,1,13,0h4.392a.755.755,0,0,1,.485.166.581.581,0,0,1,.229.419l.553,3.584a12.543,12.543,0,0,1,1.781.722L23.25,2.807a.641.641,0,0,1,.475-.176.775.775,0,0,1,.495.194,27.092,27.092,0,0,1,3.264,3.313.625.625,0,0,1,.139.429.745.745,0,0,1-.159.448c-.2.271-.525.695-1.008,1.3-.467.581-.827,1.043-1.069,1.373a11.784,11.784,0,0,1,.812,1.91l3.62.545a.625.625,0,0,1,.416.244.736.736,0,0,1,.157.458v4.325a.754.754,0,0,1-.157.449.606.606,0,0,1-.4.253l-3.66.545a12.628,12.628,0,0,1-.772,1.774c.465.654,1.177,1.559,2.117,2.688a.752.752,0,0,1,.2.488.648.648,0,0,1-.177.448,19.641,19.641,0,0,1-1.959,2.1c-.947.918-1.573,1.384-1.86,1.384a.978.978,0,0,1-.515-.176l-2.731-2.1a11.429,11.429,0,0,1-1.8.741,32.016,32.016,0,0,1-.573,3.624A.668.668,0,0,1,17.392,29.929ZM15.2,9.976a4.938,4.938,0,0,0-3.582,1.463,4.935,4.935,0,0,0,0,7.053,5.12,5.12,0,0,0,7.163,0,4.932,4.932,0,0,0,0-7.053A4.938,4.938,0,0,0,15.2,9.976Z" transform="translate(118.47 8.521)" fill="#fff"/><path d="M0,33.5,16.106,7.374H2.752V0H30.9L14.887,26.122H38.22L0,33.5" transform="translate(0 11.038)" fill="#fff"/></g><path d="M3.576-12.852v-4.3H6.628a2.867,2.867,0,0,1,1.945.55A2.034,2.034,0,0,1,9.188-15a2.06,2.06,0,0,1-.615,1.608,2.784,2.784,0,0,1-1.945.542ZM2.017-18.464V-6.748H3.576v-4.792H7.153a3.569,3.569,0,0,0,2.683-.9A3.478,3.478,0,0,0,10.747-15a3.45,3.45,0,0,0-.911-2.552,3.638,3.638,0,0,0-2.683-.911Zm11.421,7.483a4.221,4.221,0,0,1,.205-1.37,2.957,2.957,0,0,1,.566-1.009,2.411,2.411,0,0,1,.845-.624A2.515,2.515,0,0,1,16.08-14.2a2.515,2.515,0,0,1,1.026.213,2.411,2.411,0,0,1,.845.624,2.957,2.957,0,0,1,.566,1.009,4.221,4.221,0,0,1,.205,1.37,4.221,4.221,0,0,1-.205,1.37,2.867,2.867,0,0,1-.566,1,2.457,2.457,0,0,1-.845.615,2.515,2.515,0,0,1-1.026.213,2.515,2.515,0,0,1-1.026-.213,2.457,2.457,0,0,1-.845-.615,2.867,2.867,0,0,1-.566-1A4.221,4.221,0,0,1,13.438-10.981Zm-1.477,0a5.573,5.573,0,0,0,.263,1.739,3.97,3.97,0,0,0,.788,1.4,3.623,3.623,0,0,0,1.3.935,4.4,4.4,0,0,0,1.772.336A4.381,4.381,0,0,0,17.86-6.9a3.641,3.641,0,0,0,1.288-.935,3.97,3.97,0,0,0,.788-1.4,5.573,5.573,0,0,0,.263-1.739,5.65,5.65,0,0,0-.263-1.748,3.96,3.96,0,0,0-.788-1.411,3.729,3.729,0,0,0-1.288-.944,4.29,4.29,0,0,0-1.78-.345,4.3,4.3,0,0,0-1.772.345,3.71,3.71,0,0,0-1.3.944,3.96,3.96,0,0,0-.788,1.411A5.65,5.65,0,0,0,11.961-10.981Zm18.28,4.234,2.708-8.484H31.5L29.6-8.29h-.033L27.8-15.231H26.27L24.564-8.29h-.033l-1.92-6.941H21.068l2.724,8.484H25.3l1.707-6.744h.033l1.723,6.744ZM40.169-11.8H35.3a2.905,2.905,0,0,1,.213-.927A2.473,2.473,0,0,1,36-13.492a2.255,2.255,0,0,1,.747-.517,2.429,2.429,0,0,1,.976-.189,2.386,2.386,0,0,1,.96.189,2.415,2.415,0,0,1,.755.509,2.391,2.391,0,0,1,.509.763A2.854,2.854,0,0,1,40.169-11.8Zm1.346,2.363H40.136a1.983,1.983,0,0,1-.747,1.247,2.414,2.414,0,0,1-1.452.41,2.889,2.889,0,0,1-1.2-.23,2.348,2.348,0,0,1-.837-.615,2.4,2.4,0,0,1-.476-.886,3.367,3.367,0,0,1-.131-1.058h6.35a6.754,6.754,0,0,0-.139-1.625,4.7,4.7,0,0,0-.624-1.575,3.716,3.716,0,0,0-1.2-1.19,3.48,3.48,0,0,0-1.879-.468,3.858,3.858,0,0,0-1.6.328,3.76,3.76,0,0,0-1.264.919,4.236,4.236,0,0,0-.829,1.395,5.105,5.105,0,0,0-.3,1.772,6.8,6.8,0,0,0,.287,1.789,3.9,3.9,0,0,0,.763,1.411,3.478,3.478,0,0,0,1.255.919,4.358,4.358,0,0,0,1.764.328,3.851,3.851,0,0,0,2.4-.722A3.39,3.39,0,0,0,41.515-9.439Zm1.526-5.793v8.484h1.395v-3.774a5.8,5.8,0,0,1,.164-1.452,2.784,2.784,0,0,1,.525-1.075,2.251,2.251,0,0,1,.952-.673,3.945,3.945,0,0,1,1.428-.23v-1.477a3.135,3.135,0,0,0-1.871.459,3.779,3.779,0,0,0-1.247,1.526h-.033v-1.789ZM54.15-11.8H49.276a2.905,2.905,0,0,1,.213-.927,2.473,2.473,0,0,1,.492-.763,2.255,2.255,0,0,1,.747-.517A2.429,2.429,0,0,1,51.7-14.2a2.386,2.386,0,0,1,.96.189,2.415,2.415,0,0,1,.755.509,2.391,2.391,0,0,1,.509.763A2.854,2.854,0,0,1,54.15-11.8ZM55.5-9.439H54.117a1.983,1.983,0,0,1-.747,1.247,2.414,2.414,0,0,1-1.452.41,2.889,2.889,0,0,1-1.2-.23,2.348,2.348,0,0,1-.837-.615,2.4,2.4,0,0,1-.476-.886,3.367,3.367,0,0,1-.131-1.058h6.35a6.754,6.754,0,0,0-.139-1.625,4.7,4.7,0,0,0-.624-1.575,3.716,3.716,0,0,0-1.2-1.19,3.48,3.48,0,0,0-1.879-.468,3.858,3.858,0,0,0-1.6.328,3.76,3.76,0,0,0-1.264.919,4.236,4.236,0,0,0-.829,1.395,5.1,5.1,0,0,0-.3,1.772,6.8,6.8,0,0,0,.287,1.789,3.9,3.9,0,0,0,.763,1.411,3.478,3.478,0,0,0,1.255.919,4.358,4.358,0,0,0,1.764.328,3.851,3.851,0,0,0,2.4-.722A3.39,3.39,0,0,0,55.5-9.439Zm2.593-1.477a5.581,5.581,0,0,1,.131-1.214,3.212,3.212,0,0,1,.427-1.05,2.221,2.221,0,0,1,.788-.738,2.4,2.4,0,0,1,1.2-.279,2.589,2.589,0,0,1,1.231.271,2.389,2.389,0,0,1,.829.714,2.985,2.985,0,0,1,.468,1.026,4.889,4.889,0,0,1,.148,1.206,4.919,4.919,0,0,1-.139,1.165,3.053,3.053,0,0,1-.451,1.026,2.4,2.4,0,0,1-.8.73,2.4,2.4,0,0,1-1.2.279,2.491,2.491,0,0,1-1.173-.263,2.332,2.332,0,0,1-.82-.706,3.122,3.122,0,0,1-.476-1.009A4.338,4.338,0,0,1,58.088-10.916Zm6.564,4.168V-18.464H63.257V-14.1h-.033a2.247,2.247,0,0,0-.566-.632,3.216,3.216,0,0,0-.714-.41,3.583,3.583,0,0,0-.755-.222,4.132,4.132,0,0,0-.706-.066,3.861,3.861,0,0,0-1.7.353,3.487,3.487,0,0,0-1.214.952,4.018,4.018,0,0,0-.722,1.4,5.985,5.985,0,0,0-.238,1.707,5.8,5.8,0,0,0,.246,1.707,4.218,4.218,0,0,0,.73,1.411,3.529,3.529,0,0,0,1.214.968,3.827,3.827,0,0,0,1.715.361,4.135,4.135,0,0,0,1.625-.312A2.053,2.053,0,0,0,63.224-7.9h.033v1.149Zm6.761-11.716V-6.748h1.395V-7.88h.033a2.247,2.247,0,0,0,.566.632,2.982,2.982,0,0,0,.714.4,3.874,3.874,0,0,0,.763.213,4.193,4.193,0,0,0,.7.066,3.94,3.94,0,0,0,1.7-.345,3.4,3.4,0,0,0,1.214-.944,4.018,4.018,0,0,0,.722-1.4,5.985,5.985,0,0,0,.238-1.707,5.8,5.8,0,0,0-.246-1.707,4.312,4.312,0,0,0-.73-1.419,3.488,3.488,0,0,0-1.214-.976,3.827,3.827,0,0,0-1.715-.361,4.043,4.043,0,0,0-1.625.32,2.088,2.088,0,0,0-1.083,1.026h-.033v-4.381Zm6.564,7.4a5.581,5.581,0,0,1-.131,1.214,3.212,3.212,0,0,1-.427,1.05,2.243,2.243,0,0,1-.779.738,2.385,2.385,0,0,1-1.206.279A2.589,2.589,0,0,1,74.2-8.052a2.389,2.389,0,0,1-.829-.714,2.985,2.985,0,0,1-.468-1.026A4.889,4.889,0,0,1,72.758-11a4.919,4.919,0,0,1,.139-1.165,3.053,3.053,0,0,1,.451-1.026,2.4,2.4,0,0,1,.8-.73,2.4,2.4,0,0,1,1.2-.279,2.491,2.491,0,0,1,1.173.263,2.332,2.332,0,0,1,.82.706,3.122,3.122,0,0,1,.476,1.009A4.338,4.338,0,0,1,77.976-11.063Zm6.449,5.448a8.871,8.871,0,0,1-.484,1.05,2.871,2.871,0,0,1-.525.7,1.782,1.782,0,0,1-.64.394,2.462,2.462,0,0,1-.812.123,3.721,3.721,0,0,1-.492-.033A2.324,2.324,0,0,1,81-3.5v-1.28a2.342,2.342,0,0,0,.418.139,1.765,1.765,0,0,0,.4.057,1.2,1.2,0,0,0,.714-.205,1.255,1.255,0,0,0,.435-.583L83.539-6.8l-3.364-8.434h1.575L84.228-8.29h.033l2.379-6.941h1.477Z" transform="translate(0.722 18.464)" fill="#fff"/></g></g></g></svg>',e.style.position="absolute",e.style.bottom="20px",e.style.width="250px",e.style.left="50%",e.style.marginLeft="-125px",e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.style.opacity="0",e.style.transition="opacity 0.5s",document.body.append(e),setTimeout((function(){e.style.opacity="1"}),500),setTimeout((function(){e.style.opacity="0"}),3e3),setTimeout((function(){e.remove()}),4e3)}}})),mt=Object.assign(Object.assign({},i.impl),{loaded:()=>t,camera_default_device_id:e=>e?ze.USER_DEFAULT_DEVICE_ID:ze.DEFAULT_DEVICE_ID,camera_source_create:(e,t)=>function(e,t){let r=We++;return Te.preferMediaStreamTrackProcessorCamera&&"MediaStreamTrackProcessor"in window&&"MediaStreamTrackGenerator"in window?je(r,new He(r,e,t)):Te.preferImageBitmapCamera&&"undefined"!=typeof OffscreenCanvas?je(r,new Ne(r,e,t)):je(r,new ze(r,e,t)),te("camera_source_t initialized"),r}(e,t),camera_source_destroy:e=>{var t;return null===(t=Xe(e))||void 0===t?void 0:t.destroy()},camera_source_pause:e=>{var t;return null===(t=Xe(e))||void 0===t?void 0:t.pause()},camera_source_start:e=>{var t;return null===(t=Xe(e))||void 0===t?void 0:t.start()},pipeline_create:()=>Ke.create(i.impl,F),pipeline_frame_update:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.frameUpdate(i)},pipeline_camera_frame_draw_gl:(e,t,r,i)=>{var a;null===(a=Ke.get(e))||void 0===a||a.cameraFrameDrawGL(t,r,i)},draw_plane:(e,t,r,i,a)=>{!function(e,t,r,i,a){let n=d(e),s=function(e){if(_)return _;if(_=e.createBuffer(),!_)throw new Error("Unable to create buffer object");return e.bindBuffer(e.ARRAY_BUFFER,_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-.5,.125,0,-.5,-.125,0,.5,.125,0,.5,-.125,0]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),_}(e),o=u(e);e.disable(e.DEPTH_TEST),e.useProgram(n.prog),e.uniformMatrix4fv(n.unif_proj,!1,t),e.uniformMatrix4fv(n.unif_camera,!1,r),e.uniformMatrix4fv(n.unif_matrix,!1,i),e.bindBuffer(e.ARRAY_BUFFER,s),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,function(e,t){if(l[t])return l[t];let r=e.createTexture();if(!r)throw new Error("Unable to create texture");l[t]=r,e.bindTexture(e.TEXTURE_2D,r);const i=e.RGBA,a=e.RGBA,n=e.UNSIGNED_BYTE,s=new Uint8Array([0,0,255,255]);e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,i,1,1,0,a,n,s);const o=new Image;return o.onload=function(){e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,i,a,n,o),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.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},o.src=t,r}(e,a)),e.uniform1i(n.unif_skinSampler,0),e.vertexAttribPointer(n.attr_position,3,e.FLOAT,!1,12,0),e.enableVertexAttribArray(n.attr_position),e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.attr_textureCoord,2,e.FLOAT,!1,8,0),e.enableVertexAttribArray(n.attr_textureCoord),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.disableVertexAttribArray(n.attr_position),e.bindBuffer(e.ARRAY_BUFFER,null)}(e,t,r,i,a)},pipeline_draw_face:(e,t,r,i,a)=>{var n;let s=se(a);if(!s)return ie("attempting to call draw_face on a destroyed zappar_face_mesh_t"),new Uint16Array;null===(n=Ke.get(e))||void 0===n||n.drawFace(t,r,i,s)},pipeline_draw_face_project:(e,t,r,i,a,n,s)=>{var o;null===(o=Ke.get(e))||void 0===o||o.drawFaceProject(t,r,i,a,n,s)},projection_matrix_from_camera_model:T,projection_matrix_from_camera_model_ext:T,pipeline_process_gl:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.processGL()},pipeline_gl_context_set:(e,t,r)=>{var i;return null===(i=Ke.get(e))||void 0===i?void 0:i.glContextSet(t,r)},pipeline_gl_context_lost:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.glContextLost()},pipeline_camera_frame_upload_gl:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.uploadGL()},pipeline_camera_frame_texture_gl:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.cameraFrameTexture()},pipeline_camera_frame_texture_matrix:(e,t,r,i)=>{var a;return(null===(a=Ke.get(e))||void 0===a?void 0:a.cameraFrameTextureMatrix(t,r,i))||h()},pipeline_camera_frame_user_facing:e=>{var t;return(null===(t=Ke.get(e))||void 0===t?void 0:t.cameraFrameUserFacing())||!1},pipeline_camera_pose_default:()=>h(),pipeline_camera_pose_with_attitude:(e,t)=>{var r;return(null===(r=Ke.get(e))||void 0===r?void 0:r.cameraPoseWithAttitude(t))||h()},pipeline_camera_pose_with_origin:(e,t)=>{let r=h();return m(r,t),r},pipeline_sequence_record_clear:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.sequenceRecordClear()},pipeline_sequence_record_start:(e,t)=>{var r;return null===(r=Ke.get(e))||void 0===r?void 0:r.sequenceRecordStart(t)},pipeline_sequence_record_stop:e=>{var t;return null===(t=Ke.get(e))||void 0===t?void 0:t.sequenceRecordStop()},pipeline_sequence_record_device_attitude_matrices_set:(e,t)=>{var r;return null===(r=Ke.get(e))||void 0===r?void 0:r.sequenceRecordDeviceAttitudeMatrices(t)},pipeline_sequence_record_data:e=>{var t;return(null===(t=Ke.get(e))||void 0===t?void 0:t.sequenceRecordData())||new Uint8Array(0)},pipeline_sequence_record_data_size:e=>{var t;return(null===(t=Ke.get(e))||void 0===t?void 0:t.sequenceRecordData().byteLength)||0},instant_world_tracker_anchor_pose_camera_relative:(e,t)=>{let r=Je(void 0,i.impl.instant_world_tracker_anchor_pose_raw(e));if(t){let e=h();g(e,[-1,1,1]),p(r,e,r),p(r,r,e)}return r},instant_world_tracker_anchor_pose:(e,t,r)=>{let a=Je(void 0,i.impl.instant_world_tracker_anchor_pose_raw(e));if(r){let e=h();g(e,[-1,1,1]),p(a,e,a),p(a,a,e)}return p(a,t,a),a},instant_world_tracker_anchor_pose_set_from_camera_offset:(e,t,r,a,n)=>{let s=x(!1)*Math.PI/180,o=h();w(o,-s,[0,0,1]);let _=v();A(_,[t,r,a],o),i.impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(e,_[0],_[1],_[2],n)},image_tracker_create:e=>dt.create(e,i.impl),image_tracker_destroy:e=>{var t;return null===(t=dt.get(e))||void 0===t?void 0:t.destroy()},image_tracker_target_count:e=>{let t=dt.get(e);return t?t.targetCount():(ie("attempting to call image_tracker_target_count on a destroyed zappar_image_tracker_t"),0)},image_tracker_target_load_from_memory:(e,t)=>{let r=dt.get(e);if(!r)return ie("attempting to call image_tracker_target_load_from_memory on a destroyed zappar_image_tracker_t"),0;r.loadFromMemory(t)},image_tracker_target_preview_compressed:(e,t)=>{var r;let i=dt.get(e);return i?(null===(r=i.getTargetInfo(t).preview)||void 0===r?void 0:r.compressed)||new Uint8Array(0):(ie("attempting to call image_tracker_target_preview_compressed on a destroyed zappar_image_tracker_t"),new Uint8Array(0))},image_tracker_target_preview_compressed_mimetype:(e,t)=>{var r;let i=dt.get(e);return i?(null===(r=i.getTargetInfo(t).preview)||void 0===r?void 0:r.mimeType)||"":(ie("attempting to call image_tracker_target_preview_compressed_mimetype on a destroyed zappar_image_tracker_t"),"")},image_tracker_target_preview_compressed_size:(e,t)=>{var r,i;let a=dt.get(e);return a?(null===(i=null===(r=a.getTargetInfo(t).preview)||void 0===r?void 0:r.compressed)||void 0===i?void 0:i.byteLength)||0:(ie("attempting to call image_tracker_target_preview_compressed_size on a destroyed zappar_image_tracker_t"),0)},image_tracker_target_physical_scale_factor:(e,t)=>{let r=dt.get(e);return r?r.getTargetInfo(t).physicalScaleFactor:(ie("attempting to call image_tracker_target_physical_scale_factor on a destroyed zappar_image_tracker_t"),0)},image_tracker_target_radius_top:(e,t)=>{let r=dt.get(e);return r?r.getTargetInfo(t).topRadius:(ie("attempting to call image_tracker_target_radius_top on a destroyed zappar_image_tracker_t"),0)},image_tracker_target_radius_bottom:(e,t)=>{let r=dt.get(e);return r?r.getTargetInfo(t).bottomRadius:(ie("attempting to call image_tracker_target_radius_bottom on a destroyed zappar_image_tracker_t"),0)},image_tracker_target_side_length:(e,t)=>{let r=dt.get(e);return r?r.getTargetInfo(t).sideLength:(ie("attempting to call image_tracker_target_side_length on a destroyed zappar_image_tracker_t"),0)},image_tracker_target_image:(e,t)=>{let r=dt.get(e);return r?r.getDecodedPreview(t):(ie("attempting to call image_tracker_target_image on a destroyed zappar_image_tracker_t"),new Image)},image_tracker_anchor_pose_camera_relative:(e,t,r)=>{let a=Je(void 0,i.impl.image_tracker_anchor_pose_raw(e,t));if(r){let e=h();g(e,[-1,1,1]),p(a,e,a),p(a,a,e)}return a},image_tracker_anchor_pose:(e,t,r,a)=>{let n=Je(void 0,i.impl.image_tracker_anchor_pose_raw(e,t));if(a){let e=h();g(e,[-1,1,1]),p(n,e,n),p(n,n,e)}return p(n,r,n),n},face_tracker_anchor_pose_camera_relative:(e,t,r)=>{let a=Je(void 0,i.impl.face_tracker_anchor_pose_raw(e,t));if(r){let e=h();g(e,[-1,1,1]),p(a,e,a),p(a,a,e)}return a},face_tracker_anchor_pose:(e,t,r,a)=>{let n=Je(void 0,i.impl.face_tracker_anchor_pose_raw(e,t));if(a){let e=h();g(e,[-1,1,1]),p(n,e,n),p(n,n,e)}return p(n,r,n),n},face_tracker_model_load_default:e=>ht(this,void 0,void 0,(function*(){yield function(e){return ht(this,void 0,void 0,(function*(){let t=new URL(r(367),r.b),i=yield fetch(t.toString()),a=yield i.arrayBuffer();null==mt||mt.face_tracker_model_load_from_memory(e,a)}))}(e)})),face_mesh_create:()=>function(){let e=ae++;return ne.set(e,new oe),te("face_mesh_t initialized"),e}(),face_mesh_destroy:e=>{!function(e){ne.delete(e)}(e)},face_mesh_indices:e=>{let t=se(e);return t?t.getIndices():(ie("attempting to call face_mesh_indices on a destroyed zappar_face_mesh_t"),new Uint16Array)},face_mesh_indices_size:e=>{let t=se(e);return t?t.getIndices().length:(ie("attempting to call face_mesh_indices_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_uvs:e=>{let t=se(e);return t?t.getUVs():(ie("attempting to call face_mesh_uvs on a destroyed zappar_face_mesh_t"),new Float32Array)},face_mesh_uvs_size:e=>{let t=se(e);return t?t.getUVs().length:(ie("attempting to call face_mesh_uvs_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_vertices:e=>{let t=se(e);return t?t.getVertices():(ie("attempting to call face_mesh_vertices on a destroyed zappar_face_mesh_t"),new Float32Array)},face_mesh_vertices_size:e=>{let t=se(e);return t?t.getVertices().length:(ie("attempting to call face_mesh_vertices_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_normals:e=>{let t=se(e);return t?t.getNormals():(ie("attempting to call face_mesh_normals on a destroyed zappar_face_mesh_t"),new Float32Array)},face_mesh_normals_size:e=>{let t=se(e);return t?t.getNormals().length:(ie("attempting to call face_mesh_normals_size on a destroyed zappar_face_mesh_t"),0)},face_mesh_load_from_memory:(e,t,r,i,a,n)=>{let s=se(e);s?s.loadFromMemory(t,r,i,a,n):ie("attempting to call face_mesh_load_from_memory on a destroyed zappar_face_mesh_t")},face_mesh_update:(e,t,r,i)=>{let a=se(e);a?a.update(t,r,i):ie("attempting to call face_mesh_update on a destroyed zappar_face_mesh_t")},face_mesh_load_default:e=>ht(this,void 0,void 0,(function*(){let t=se(e);if(!t)return void ie("attempting to call face_mesh_load_default on a destroyed zappar_face_mesh_t");let i=new URL(r(698),r.b),a=yield fetch(i.toString());t.loadFromMemory(yield a.arrayBuffer(),!1,!1,!1,!1)})),face_mesh_load_default_face:(e,t,i,a)=>ht(this,void 0,void 0,(function*(){let n=se(e);if(!n)return void ie("attempting to call face_mesh_load_default_face on a destroyed zappar_face_mesh_t");let s=new URL(r(698),r.b),o=yield fetch(s.toString());n.loadFromMemory(yield o.arrayBuffer(),t,i,a,!1)})),face_mesh_load_default_full_head_simplified:(e,t,i,a,n)=>ht(this,void 0,void 0,(function*(){let s=se(e);if(!s)return void ie("attempting to call face_mesh_load_default_full_head_simplified on a destroyed zappar_face_mesh_t");let o=new URL(r(825),r.b),_=yield fetch(o.toString());s.loadFromMemory(yield _.arrayBuffer(),t,i,a,n)})),face_mesh_loaded_version:e=>{let t=se(e);return t?t.getModelVersion():(ie("attempting to call face_mesh_load_default on a destroyed zappar_face_mesh_t"),-1)},face_landmark_create:e=>function(e){let t=et++;return tt.set(t,new it(e)),te("face_landmark_t initialized"),t}(e),face_landmark_destroy:e=>{!function(e){tt.delete(e)}(e)},face_landmark_update:(e,t,r,i)=>{let a=rt(e);a?a.update(t,r,i):ie("attempting to call face_landmark_update on a destroyed zappar_face_landmark_t")},face_landmark_anchor_pose:e=>{let t=rt(e);return t?t.anchor_pose:(ie("attempting to call face_landmark_anchor_pose on a destroyed zappar_face_landmark_t"),h())},html_element_source_create:(e,t)=>De.createVideoElementSource(e,t),html_element_source_start:e=>{var t;return null===(t=De.getVideoElementSource(e))||void 0===t?void 0:t.start()},html_element_source_pause:e=>{var t;return null===(t=De.getVideoElementSource(e))||void 0===t?void 0:t.pause()},html_element_source_destroy:e=>{var t;return null===(t=De.getVideoElementSource(e))||void 0===t?void 0:t.destroy()},sequence_source_create:e=>ot.create(e),sequence_source_load_from_memory:(e,t)=>{var r;return null===(r=ot.get(e))||void 0===r?void 0:r.loadFromMemory(t)},sequence_source_pause:e=>{var t;return null===(t=ot.get(e))||void 0===t?void 0:t.pause()},sequence_source_start:e=>{var t;return null===(t=ot.get(e))||void 0===t?void 0:t.start()},sequence_source_max_playback_fps_set:(e,t)=>{var r;return null===(r=ot.get(e))||void 0===r?void 0:r.maxPlaybackFpsSet(t)},sequence_source_destroy:e=>{var t;return null===(t=ot.get(e))||void 0===t?void 0:t.destroy()},permission_granted_all:H,permission_granted_camera:P,permission_granted_motion:z,permission_denied_any:G,permission_denied_camera:V,permission_denied_motion:N,permission_request_motion:j,permission_request_camera:q,permission_request_all:W,permission_request_ui:X,permission_request_ui_promise:X,permission_denied_ui:Y,browser_incompatible:at.incompatible,browser_incompatible_ui:at.incompatible_ui,log_level_set:e=>{!function(e){ee=e}(e),i.impl.log_level_set(e)}}),mt}function bt(e){return function(e){return console.log("Zappar CV v2.0.0-beta.0"),pt(e)}(Object.assign(Object.assign({},e),{worker:(null==e?void 0:e.worker)||new(r(276).Z)}))}})(),i})()}));
|