@miris-inc/core 0.0.8-655ef21 → 0.0.8-6ba4cfb
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/LICENSE +201 -0
- package/README.md +82 -0
- package/banner.svg +34 -0
- package/dist/AquaApi.js +15 -0
- package/dist/AquaApi.wasm +0 -0
- package/dist/aqua-parser.js +14 -0
- package/dist/aqua-parser.wasm +0 -0
- package/dist/core.d.ts +597 -0
- package/dist/core.js +2180 -0
- package/dist/core.prod.js +1 -0
- package/dist/core.standalone.js +5116 -0
- package/{core.js → dist/core.standalone.prod.js} +1 -6318
- package/package.json +50 -7
- package/icon-black.svg +0 -10
- package/icon-white.svg +0 -11
- package/social-card.png +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class e{#e=/* @__PURE__ */new Map;#t=/* @__PURE__ */new Map;forKey(e){return this.#e.get(e)}forId(e){return this.#t.get(e)}setKey(e,t){this.#e.set(e,t)}setId(e,t){return this.#t.set(e,t)}delete(e){this.#e.delete(e.key),this.#t.delete(e.id)}deleteKey(e){this.#e.delete(e)}deleteId(e){this.#t.delete(e)}}class t{#r;useExtSplats=!1;#n=null;splatsExtendedData=null;#i=null;#a=new Float32Array(6);#s=null;#o=null;#c=0;sh1Data=null;sh1Max=1;sh2Data=null;sh2Max=1;sh3Data=null;sh3Max=1;sh3ExtendedData=null;get key(){return this.#r??null}set key(e){this.store.deleteKey(this.key),(e||0===e)&&this.store.setKey(e,this),this.#r=e}set splats(e){this.#n=e}get splats(){return this.#n}set bounds(e){this.#i=e}get bounds(){return this.#i}set _boundsStreamSpace(e){this.#a=e}get _boundsStreamSpace(){return this.#a}set lodIndex(e){this.#o=e}get lodIndex(){return this.#o}set paddingCount(e){this.#c=e}get paddingCount(){return this.#c}set transform(e){this.#s=e}get transform(){return this.#s}setSh1(e,t){this.sh1Data=e,this.sh1Max=t}setSh2(e,t){this.sh2Data=e,this.sh2Max=t}setSh3(e,t){this.sh3Data=e,this.sh3Max=t}dispose(){const e=this.#r;this.store.delete(this),this.#r=null,e?.dispose?.(),this.#n=null,this.splatsExtendedData=null,this.#i=null,this.#s=null,this.sh1Data=null,this.sh2Data=null,this.sh3Data=null,this.sh3ExtendedData=null,this.modelRoot?.lods?.delete(this)}constructor({id:e,modelRoot:t,lodStore:r}){Object.defineProperties(this,{id:{value:e},modelRoot:{value:t},store:{value:r}}),r.setId(e,this),t.add(this)}}class r{constructor({type:e,lod:t}){Object.defineProperties(this,{type:{value:e},lod:{value:t}})}}class n{static#e=/* @__PURE__ */new Map;static#t=/* @__PURE__ */new Map;static forKey(e){return this.#e.get(e)}static forId(e){return this.#t.get(e)}#r;get key(){return this.#r??null}set key(e){n.#e.delete(this.key),(e||0===e)&&n.#e.set(e,this),this.#r=e}#u=/* @__PURE__ */new Set;get lods(){return this.#u}#s;set transform(e){this.#s=e}get transform(){return this.#s}constructor({id:e,stream:t}){Object.defineProperties(this,{id:{value:e},stream:{value:t}}),n.#t.set(e,this),t.add(this)}add(e){this.#u.add(e)}dispose(){const e=[...this.#u];this.#u.clear();for(const t of e)t.dispose();n.#e.delete(this.key),n.#t.delete(this.id),this.#r=null}}class i{static#l=/* @__PURE__ */new Map;static#d=1;static#h=0;static#p=2**32;static#m=0;static#f(e){this.#h=(this.#h+e)%this.#p}static#g(e){this.#h=(this.#h-e)%this.#p,this.#h<0&&(this.#h+=this.#p)}static getCheckSum(){return this.#h}static getConsecutiveIds(e){const t=this.#d;return this.#d+=e,t}static addWithId(e,t){this.#f(t),this.#l.set(t,e)}static add(e){const t=this.#d++;return this.addWithId(e,t),t}static get(e){const t=this.#l.get(e);if(void 0===t)throw new Error(`Attribute with id ${e} not found in cache`);return t}static remove(e){if(Array.isArray(e))for(const t of e)this.#l.delete(t),this.#g(t);else this.#l.delete(e),this.#g(e)}static validateCheckSum(e){if(e!=this.getCheckSum()){let t=e-this.getCheckSum();t<0&&(t+=this.#p),t!=this.#m&&(console.error(`ID checksum mismatch between WASM and TypeScript sides! ${e} ${this.getCheckSum()}`),this.#m=t)}}}class a extends EventTarget{static _idMap=/* @__PURE__ */new Map;static _keyMap=/* @__PURE__ */new Map;static forId(e){if(e)return this._idMap.get(e)}static forKey(e){return this._keyMap.get(e)}#r;#y=!1;#v={};_addVariantCollection(e){this.#v[e]||(this.#v[e]={id:e,children:[]})}_findAndAddToVariantSet(e,t){const r=n=>{if(!n)return!1;if(n.id===e)return n.children?n.children.push(t):"option"===t.type?(n.options||(n.options=[]),n.options.push(t)):(n.nestedSets||(n.nestedSets=[]),n.nestedSets.push(t)),!0;if(Array.isArray(n.children))for(const e of n.children)if(r(e))return!0;if(Array.isArray(n.nestedSets))for(const e of n.nestedSets)if(r(e))return!0;if(Array.isArray(n.options))for(const e of n.options)if(r(e))return!0;return!1};for(const n of Object.values(this.#v))if(r(n))return}_addVariant(e,t){this._findAndAddToVariantSet(e,t)}_exportVariantHierarchies(){return Object.entries(this.#v).map(([e,t])=>({hierarchyId:Number(e),hierarchy:t}))}_setVariantSelection(e){this.client.setVariantSelection(e)}get key(){return this.#r??null}set key(e){a._keyMap.delete(this.key),(e||0===e)&&a._keyMap.set(e,this),this.#r=e}#b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];get matrix(){return this.#b}set matrix(e){this.#b=e;const{engine:t,client:r}=this,n=t.malloc(4*this.#b.length);t.heapF32.set(Float32Array.from(this.#b),n/4),r.setSceneObjectTransform(this.id,n),t.free(n)}get boundingBox(){const{engine:e,client:t}=this,r=e.malloc(24);t.getWorldBoundingBox(this.id,r);const[n,i,a,s,o,c]=Float32Array.from(e.heapF32.subarray(r/4,r/4+6));if(void 0===n||void 0===i||void 0===a||void 0===s||void 0===o||void 0===c)return;const u={min:{x:n-s/2,y:i-o/2,z:a-c/2},max:{x:n+s/2,y:i+o/2,z:a+c/2},size:{x:s,y:o,z:c},center:{x:n,y:i,z:a}};return Object.freeze(u),u}#S=/* @__PURE__ */new Set;get modelRoots(){return new Set(this.#S)}get chunks(){return this.modelRoots}constructor(e){super();const{scene:t,uuid:r}=e;Object.defineProperties(this,{uuid:{value:r,enumerable:!0},scene:{value:t,enumerable:!0},client:{value:t.client,enumerable:!0},miris:{value:t.miris,enumerable:!0},engine:{value:t.miris.engine,enumerable:!0}}),this._initStream(e),a._idMap.set(this.id,this),t.add(this)}_initStream({uuid:e}){const t=this.client.addStreamById(e,e,!1);Object.defineProperty(this,"id",{value:t})}async _onStreamLoaded(){this.#y||(this.dispatchEvent(new Event("streamloaded")),this.scene._onSceneLoaded(),this.#y=!0)}_onRootLoaded(){this.dispatchEvent(new Event("rootloaded"))}add(e){this.#S.add(e)}end(){this.client.removeStream(this.id);for(const e of this.#S)e.dispose();this.#S.clear(),a._idMap.delete(this.id),a._keyMap.delete(this.key),this.scene.streams.has(this)&&this.scene.delete(this)}}let s,o;const c=(u=new URL("AquaApi.wasm",import.meta.url).href).includes("/.vite/")?u.replace(/\.vite\/[^?#]*/,()=>"node_modules/@miris-inc/core/dist/AquaApi.wasm"):u;var u;function l(e){return e.default||e}function d(...e){var t;return s||(o=fetch(c).then(e=>!e.ok||(e.headers.get("content-type")||"").includes("text/html")?null:e.arrayBuffer()).catch(()=>null),s=(t=(e=>e.includes("/.vite/")?new URL("/node_modules/@miris-inc/core/dist/AquaApi.js",e).href:e)(new URL("./AquaApi.js",import.meta.url).href),import(/* webpackIgnore: true */ /* turbopackIgnore: true */ t).then(e=>{const t=l(e);if("function"==typeof t)return t;throw new Error("bad module")}).catch(()=>fetch(t).then(e=>{if(!e.ok)throw new Error(e.status+" "+t);return e.text()}).then(e=>{const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));return import(/* webpackIgnore: true */ /* turbopackIgnore: true */ t).then(e=>(URL.revokeObjectURL(t),l(e)))}))).catch(e=>{throw s=o=void 0,e})),Promise.all([s,o]).then(([t,r])=>{if(r){const[n={},...i]=e;return t({...n,wasmBinary:r},...i)}return t(...e)})}class h{static name="thread";static get Worker(){throw new Error("Thread could not be initialized because no Worker was supplied. Do you forget to set `static Worker = Worker` on the child class?")}constructor({engine:e}){Object.defineProperty(this,"engine",{value:e,enumerable:!0}),Object.defineProperty(this,"ready",{enumerable:!0,value:new Promise(e=>{this.#w.set(0,async()=>{this.#_=!1,this.#w.delete(0),e(this)})})}),this.#k=new this.constructor.Worker({name:`decoder-${h.#C()}`}),this.#k.addEventListener("message",this.#T.bind(this))}static#$=0;static#C(){return this.#$+=1}#_=!0;get pending(){return this.#_}#k;#w=/* @__PURE__ */new Map;get pendingRequests(){return this.#w.size}get terminated(){return!this.#k}#A=0;#P(){return this.#A+=1}async _execute(e,...t){if(this.pending)throw new Error(`Unable to execute ${e} because decoder has not yet been initialized`);if(!this.#k)throw new Error(`Unable to execute ${e} because decoder has already been terminated`);return new Promise(r=>{if(!this.#k)throw new Error(`Unable to execute ${e} because decoder has already been terminated`);const n=this.#P();this.#w.set(n,async e=>{this.#w.delete(n),r(e)});const i=t.filter(e=>e instanceof ArrayBuffer);this.#k.postMessage({id:n,action:e,args:t},i)})}#T({data:e}){"ready"===e&&(e={id:0,result:void 0});const{id:t,result:r}=e;this.#w.get(t)?.(r)}_postToWorker(e,t){this.#k?.postMessage(e,t??[])}terminate(){this.#k&&(this.#k.terminate(),this.#k.removeEventListener("message",this.#T),this.#k=null)}}const p='const e={sparkPackedSplat:{elementsPerSplat:4,discard:!1},extendedPackedSplatLow:{elementsPerSplat:4,discard:!1},extendedPackedSplatHigh:{elementsPerSplat:4,discard:!1},packedSh1:{elementsPerSplat:2,discard:!1},packedSh2:{elementsPerSplat:4,discard:!1},packedSh3:{elementsPerSplat:4,discard:!1},sh1Extended:{elementsPerSplat:4,discard:!1},sh2Extended:{elementsPerSplat:4,discard:!1},sh3Extended_0:{elementsPerSplat:4,discard:!1},sh3Extended_1:{elementsPerSplat:4,discard:!1}};function t(t,r,n){const a=e[t];if(void 0===a)throw new Error("attribute name"+t+" is unknown");const i=n.length,o=(s=i,u=2048*a.elementsPerSplat,Math.ceil(s/u)*u);var s,u;const c=new Uint32Array(o);return c.set(n),{paddedData:c,originalSize:i,id:r}}const{wasmBinary:r}=await new Promise(e=>{self.addEventListener("message",function t(r){"wasm-init"===r.data?.type&&(self.removeEventListener("message",t),e(r.data))})});if(!r)throw new Error("Decoder worker did not receive WASM binary. The main thread failed to fetch aqua-parser.wasm.");const n=await async function(e={}){var t,r,n=e,a="./this.program",i=(e,t)=>{throw t},o=import.meta.url,s="";try{s=new URL(".",o).href}catch{}r=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},t=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)};var u,c,l,p,f,d,h,v,m,y,g,_,w,$,b,T,P=console.log.bind(console),C=console.error.bind(console),k=!1,F=!1;function S(){var e=f.buffer;n.HEAP8=d=new Int8Array(e),v=new Int16Array(e),n.HEAPU8=h=new Uint8Array(e),m=new Uint16Array(e),n.HEAP32=y=new Int32Array(e),n.HEAPU32=g=new Uint32Array(e),n.HEAPF32=_=new Float32Array(e),n.HEAPF64=w=new Float64Array(e),$=new BigInt64Array(e),b=new BigUint64Array(e)}function A(e){n.onAbort?.(e),C(e="Aborted("+e+")"),k=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw p?.(t),t}function D(){return n.locateFile?(e="aqua-parser.wasm",n.locateFile?n.locateFile(e,s):s+e):"";var e}async function W(e){if(!u)try{var n=await t(e);return new Uint8Array(n)}catch{}return function(e){if(e==T&&u)return new Uint8Array(u);if(r)return r(e);throw"both async and sync fetching of the wasm failed"}(e)}async function E(e,t,r){if(!e)try{var n=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,r)}catch(a){C(`wasm streaming compile failed: ${a}`),C("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await W(e);return await WebAssembly.instantiate(r,t)}catch(n){C(`failed to asynchronously prepare wasm: ${n}`),A(n)}}(t,r)}class x{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var O=e=>{for(;e.length>0;)e.shift()(n)},R=[],j=e=>R.push(e),U=[],H=e=>U.push(e),I=!0,V=e=>Ne(e),B=()=>Ye(),M=[],q=0,L=0;class z{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){g[this.ptr+4>>2]=e}get_type(){return g[this.ptr+4>>2]}set_destructor(e){g[this.ptr+8>>2]=e}get_destructor(){return g[this.ptr+8>>2]}set_caught(e){e=e?1:0,d[this.ptr+12]=e}get_caught(){return 0!=d[this.ptr+12]}set_rethrown(e){e=e?1:0,d[this.ptr+13]=e}get_rethrown(){return 0!=d[this.ptr+13]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){g[this.ptr+16>>2]=e}get_adjusted_ptr(){return g[this.ptr+16>>2]}}var N=e=>ze(e),J=e=>{var t=L;if(!t)return N(0),0;var r=new z(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return N(0),t;for(var a of e){if(0===a||a===n)break;var i=r.ptr+16;if(Ze(a,n,i))return N(a),t}return N(n),t},Y=e=>{for(var t="";;){var r=h[e++];if(!r)return t;t+=String.fromCharCode(r)}},G={},X={},Z={},K=class extends Error{constructor(e){super(e),this.name="BindingError"}},Q=e=>{throw new K(e)};function ee(e,t,r={}){return function(e,t,r={}){var n=t.name;if(e||Q(`type "${n}" must have a positive integer typeid pointer`),X.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Q(`Cannot register type \'${n}\' twice`)}if(X[e]=t,delete Z[e],G.hasOwnProperty(e)){var a=G[e];delete G[e],a.forEach(e=>e())}}(e,t,r)}var te=(e,t,r)=>{switch(t){case 1:return r?e=>d[e]:e=>h[e];case 2:return r?e=>v[e>>1]:e=>m[e>>1];case 4:return r?e=>y[e>>2]:e=>g[e>>2];case 8:return r?e=>$[e>>3]:e=>b[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},re=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),ne=e=>{Q(e.$$.ptrType.registeredClass.name+" instance already deleted")},ae=!1,ie=e=>{},oe=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},se=e=>typeof FinalizationRegistry>"u"?(se=e=>e,e):(ae=new FinalizationRegistry(e=>{oe(e.$$)}),ie=e=>ae.unregister(e),(se=e=>{var t=e.$$;if(!!t.smartPtr){var r={$$:t};ae.register(e,r,e)}return e})(e));function ue(){}var ce=(e,t)=>Object.defineProperty(t,"name",{value:e}),le={},pe=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||Q(`Function \'${r}\' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},fe=(e,t,r)=>{n.hasOwnProperty(e)?((void 0===r||void 0!==n[e].overloadTable&&void 0!==n[e].overloadTable[r])&&Q(`Cannot register public name \'${e}\' twice`),pe(n,e,e),n[e].overloadTable.hasOwnProperty(r)&&Q(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),n[e].overloadTable[r]=t):(n[e]=t,n[e].argCount=r)};function de(e,t,r,n,a,i,o,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var he=(e,t,r)=>{for(;t!==r;)t.upcast||Q(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},ve=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function me(e,t){if(null===t)return this.isReference&&Q(`null is not a valid ${this.name}`),0;t.$$||Q(`Cannot pass "${ve(t)}" as a ${this.name}`),t.$$.ptr||Q(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return he(t.$$.ptr,r,this.registeredClass)}function ye(e,t){var r;if(null===t)return this.isReference&&Q(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&Q(`Cannot pass "${ve(t)}" as a ${this.name}`),t.$$.ptr||Q(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Q(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=he(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Q("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Q(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,it.toHandle(()=>a.delete())),null!==e&&e.push(this.rawDestructor,r)}break;default:Q("Unsupporting sharing policy")}return r}function ge(e,t){if(null===t)return this.isReference&&Q(`null is not a valid ${this.name}`),0;t.$$||Q(`Cannot pass "${ve(t)}" as a ${this.name}`),t.$$.ptr||Q(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Q(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return he(t.$$.ptr,r,this.registeredClass)}function _e(e){return this.fromWireType(g[e>>2])}var we=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=we(e,t,r.baseClass);return null===n?null:r.downcast(n)},$e={},be=(e,t)=>(t=((e,t)=>{for(void 0===t&&Q("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),$e[t]),Te=class extends Error{constructor(e){super(e),this.name="InternalError"}},Pe=e=>{throw new Te(e)},Ce=(e,t)=>((!t.ptrType||!t.ptr)&&Pe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!==!!t.smartPtr&&Pe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},se(Object.create(e,{$$:{value:t,writable:!0}})));function ke(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=be(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?Ce(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ce(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(t),s=le[o];if(!s)return a.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=we(t,this.registeredClass,i.registeredClass);return null===u?a.call(this):this.isSmartPointer?Ce(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):Ce(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function Fe(e,t,r,n,a,i,o,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,a||void 0!==t.baseClass?this.toWireType=ye:n?(this.toWireType=me,this.destructorFunction=null):(this.toWireType=ge,this.destructorFunction=null)}var Se,Ae=(e,t,r)=>{n.hasOwnProperty(e)||Pe("Replacing nonexistent public symbol"),void 0!==n[e].overloadTable&&void 0!==r?n[e].overloadTable[r]=t:(n[e]=t,n[e].argCount=r)},De=[],We=e=>{var t=De[e];return t||(De[e]=t=Se.get(e)),t},Ee=(e,t,r=!1)=>{e=Y(e);var n=We(t);return"function"!=typeof n&&Q(`unknown function pointer with signature ${e}: ${t}`),n};class xe extends Error{}var Oe=e=>{var t=Ve(e),r=Y(t);return Me(t),r},Re=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){if(!n[t]&&!X[t]){if(Z[t])return void Z[t].forEach(e);r.push(t),n[t]=!0}}),new xe(`${e}: `+r.map(Oe).join([", "]))},je=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&Pe("Mismatched type converter count");for(var a=0;a<e.length;++a)ee(e[a],n[a])}e.forEach(e=>Z[e]=t);var a=new Array(t.length),i=[],o=0;t.forEach((e,t)=>{X.hasOwnProperty(e)?a[t]=X[e]:(i.push(e),G.hasOwnProperty(e)||(G[e]=[]),G[e].push(()=>{a[t]=X[e],++o===i.length&&n(a)}))}),0===i.length&&n(a)},Ue=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function He(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}function Ie(e,t,r,n,a,i){var o=t.length;o<2&&Q("argTypes array size mismatch! Must at least get return value and \'this\' types!");for(var s=null!==t[1]&&null!==r,u=He(t),c=!t[0].isVoid,l=t[0],p=t[1],f=[e,Q,n,a,Ue,l.fromWireType.bind(l),p?.toWireType.bind(p)],d=2;d<o;++d){var h=t[d];f.push(h.toWireType.bind(h))}if(!u)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&f.push(t[d].destructorFunction);var v=function(e,t,r,n){var a=He(e),i=e.length-2,o=[],s=["fn"];t&&s.push("thisWired");for(var u=0;u<i;++u)o.push(`arg${u}`),s.push(`arg${u}Wired`);o=o.join(","),s=s.join(",");var c=`return function (${o}) {\\n`;a&&(c+="var destructors = [];\\n");var l=a?"destructors":"null",p=["humanName","throwBindingError","invoker","fn","runDestructors","fromRetWire","toClassParamWire"];for(t&&(c+=`var thisWired = toClassParamWire(${l}, this);\\n`),u=0;u<i;++u){var f=`toArg${u}Wire`;c+=`var arg${u}Wired = ${f}(${l}, arg${u});\\n`,p.push(f)}if(c+=(r||n?"var rv = ":"")+`invoker(${s});\\n`,a)c+="runDestructors(destructors);\\n";else for(u=t?1:2;u<e.length;++u){var d=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(c+=`${d}_dtor(${d});\\n`,p.push(`${d}_dtor`))}return r&&(c+="var ret = fromRetWire(rv);\\nreturn ret;\\n"),c+="}\\n",new Function(p,c)}(t,s,c,i)(...f);return ce(e,v)}var Ve,Be,Me,qe,Le,ze,Ne,Je,Ye,Ge,Xe,Ze,Ke,Qe=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(g[t+4*n>>2]);return r},et=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},tt=(e,t,r)=>(e instanceof Object||Q(`${r} with invalid "this": ${e}`),e instanceof t.registeredClass.constructor||Q(`${r} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Q(`cannot call emscripten binding method ${r} on deleted object`),he(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass)),rt=[],nt=[0,1,,1,null,1,!0,1,!1,1],at=e=>{e>9&&0===--nt[e+1]&&(nt[e]=void 0,rt.push(e))},it={toValue:e=>(e||Q(`Cannot use deleted val. handle = ${e}`),nt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=rt.pop()||nt.length;return nt[t]=e,nt[t+1]=1,t}}}},ot={name:"emscripten::val",fromWireType:e=>{var t=it.toValue(e);return at(e),t},toWireType:(e,t)=>it.toHandle(t),readValueFromPointer:_e,destructorFunction:null},st=(e,t,r)=>{switch(t){case 1:return r?function(e){return this.fromWireType(d[e])}:function(e){return this.fromWireType(h[e])};case 2:return r?function(e){return this.fromWireType(v[e>>1])}:function(e){return this.fromWireType(m[e>>1])};case 4:return r?function(e){return this.fromWireType(y[e>>2])}:function(e){return this.fromWireType(g[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},ut=(e,t)=>{var r=X[e];return void 0===r&&Q(`${t} has unknown type ${Oe(e)}`),r},ct=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(_[e>>2])};case 8:return function(e){return this.fromWireType(w[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},lt=(e,t,r)=>((e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s,o++}}return t[r]=0,r-a})(e,h,t,r),pt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},ft=typeof TextDecoder<"u"?new TextDecoder:void 0,dt=(e,t,r,n)=>{var a=t+r;if(n)return a;for(;e[t]&&!(t>=a);)++t;return t},ht=(e,t=0,r,n)=>{var a=dt(e,t,r,n);if(a-t>16&&e.buffer&&ft)return ft.decode(e.subarray(t,a));for(var i="";t<a;){var o=e[t++];if(128&o){var s=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|s<<6|u:(7&o)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i},vt=(e,t,r)=>e?ht(h,e,t,r):"",mt=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,yt=(e,t,r)=>{var n=e>>1,a=dt(m,n,t/2,r);if(a-n>16&&mt)return mt.decode(m.subarray(n,a));for(var i="",o=n;o<a;++o){var s=m[o];i+=String.fromCharCode(s)}return i},gt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,a=(r-=2)<2*e.length?r/2:e.length,i=0;i<a;++i){var o=e.charCodeAt(i);v[t>>1]=o,t+=2}return v[t>>1]=0,t-n},_t=e=>2*e.length,wt=(e,t,r)=>{for(var n="",a=e>>2,i=0;!(i>=t/4);i++){var o=g[a+i];if(!o&&!r)break;n+=String.fromCodePoint(o)}return n},$t=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,a=n+r-4,i=0;i<e.length;++i){var o=e.codePointAt(i);if(o>65535&&i++,y[t>>2]=o,(t+=4)+4>a)break}return y[t>>2]=0,t-n},bt=e=>{for(var t=0,r=0;r<e.length;++r){e.codePointAt(r)>65535&&r++,t+=4}return t},Tt=0,Pt=[],Ct=(e,t,r)=>{var n=[],a=e(n,r);return n.length&&(g[t>>2]=it.toHandle(n)),a},kt={},Ft=e=>{var t=kt[e];return void 0===t?Y(e):t},St=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),At=[0,31,60,91,121,152,182,213,244,274,305,335],Dt=[0,31,59,90,120,151,181,212,243,273,304,334],Wt={},Et=e=>{if(e instanceof x||"unwind"==e)return c;i(0,e)},xt=()=>I||Tt>0,Ot=e=>{c=e,xt()||(n.onExit?.(e),k=!0),i(0,new x(e))},Rt=(e,t)=>{c=e,Ot(e)},jt=e=>{if(!k)try{e(),(()=>{if(!xt())try{Rt(c)}catch(e){Et(e)}})()}catch(t){Et(t)}},Ut=()=>performance.now(),Ht=(e,t)=>Math.ceil(e/t)*t,It=e=>{var t=(e-f.buffer.byteLength+65535)/65536|0;try{return f.grow(t),S(),1}catch{}},Vt={},Bt=()=>{if(!Bt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.language||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var t in Vt)void 0===Vt[t]?delete e[t]:e[t]=Vt[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Bt.strings=r}return Bt.strings},Mt=[null,[],[]],qt=(e,t)=>{var r=Mt[e];0===t||10===t?((1===e?P:C)(ht(r)),r.length=0):r.push(t)},Lt=e=>n["_"+e],zt=e=>Je(e),Nt=(e,t,r,n,a)=>{var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=pt(e)+1,r=zt(t);return lt(e,r,t),r})(e)),t},array:e=>{var t=zt(e.length);return((e,t)=>{d.set(e,t)})(e,t),t}};var o=Lt(e),s=[],u=0;if(n)for(var c=0;c<n.length;c++){var l=i[r[c]];l?(0===u&&(u=B()),s[c]=l(n[c])):s[c]=n[c]}var p,f=o(...s);return p=f,0!==u&&V(u),f=function(e){return"string"===t?vt(e):"boolean"===t?!!e:e}(p),f};if((()=>{let e=ue.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof ue&&e instanceof ue))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||ne(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=se(Object.create(Object.getPrototypeOf(this),{$$:{value:re(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||ne(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Q("Object already scheduled for deletion"),ie(this),oe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||ne(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Q("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(Fe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},readValueFromPointer:_e,fromWireType:ke}),n.noExitRuntime&&(I=n.noExitRuntime),n.print&&(P=n.print),n.printErr&&(C=n.printErr),n.wasmBinary&&(u=n.wasmBinary),n.arguments&&n.arguments,n.thisProgram&&(a=n.thisProgram),n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()();n.ENV=Vt,n.ccall=Nt,n.cwrap=(e,t,r,n)=>{var a=!r||r.every(e=>"number"===e||"boolean"===e);return"string"!==t&&a&&!n?Lt(e):(...n)=>Nt(e,t,r,n)};var Jt,Yt={__cxa_begin_catch:e=>{var t=new z(e);return t.get_caught()||(t.set_caught(!0),q--),t.set_rethrown(!1),M.push(t),Xe(e),Ke(e)},__cxa_end_catch:()=>{Le(0,0);var e=M.pop();Ge(e.excPtr),L=0},__cxa_find_matching_catch_2:()=>J([]),__cxa_find_matching_catch_3:e=>J([e]),__cxa_find_matching_catch_4:(e,t)=>J([e,t]),__cxa_rethrow:()=>{var e=M.pop();e||A("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(M.push(e),e.set_rethrown(!0),e.set_caught(!1),q++),L=t},__cxa_throw:(e,t,r)=>{throw new z(e).init(t,r),q++,L=e},__cxa_uncaught_exceptions:()=>q,__resumeException:e=>{throw L||(L=e),L},_abort_js:()=>A(""),_embind_register_bigint:(e,t,r,n,a)=>{t=Y(t);const i=0n===n;let o=e=>e;if(i){const e=8*r;o=t=>BigInt.asUintN(e,t),a=o(a)}ee(e,{name:t,fromWireType:o,toWireType:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),readValueFromPointer:te(t,r,!i),destructorFunction:null})},_embind_register_bool:(e,t,r,n)=>{ee(e,{name:t=Y(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},readValueFromPointer:function(e){return this.fromWireType(h[e])},destructorFunction:null})},_embind_register_class:(e,t,r,n,a,i,o,s,u,c,l,p,f)=>{l=Y(l),i=Ee(a,i),s&&=Ee(o,s),c&&=Ee(u,c),f=Ee(p,f);var d=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(l);fe(d,function(){Re(`Cannot construct ${l} due to unbound types`,[n])}),je([e,t,r],n?[n]:[],t=>{var r,a;t=t[0],n?a=(r=t.registeredClass).instancePrototype:a=ue.prototype;var o=ce(l,function(...e){if(Object.getPrototypeOf(this)!==u)throw new K(`Use \'new\' to construct ${l}`);if(void 0===p.constructor_body)throw new K(`${l} has no accessible constructor`);var t=p.constructor_body[e.length];if(void 0===t)throw new K(`Tried to invoke ctor of ${l} with invalid number of parameters (${e.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),u=Object.create(a,{constructor:{value:o}});o.prototype=u;var p=new de(l,o,u,f,r,i,s,c);p.baseClass&&(p.baseClass.__derivedClasses??=[],p.baseClass.__derivedClasses.push(p));var h=new Fe(l,p,!0,!1,!1),v=new Fe(l+"*",p,!1,!1,!1),m=new Fe(l+" const*",p,!1,!0,!1);return le[e]={pointerType:v,constPointerType:m},Ae(d,o),[h,v,m]})},_embind_register_class_class_function:(e,t,r,n,a,i,o,s,u)=>{var c=Qe(r,n);t=Y(t),t=et(t),i=Ee(a,i,s),je([],[e],e=>{var n=`${(e=e[0]).name}.${t}`;function a(){Re(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var u=e.registeredClass.constructor;return void 0===u[t]?(a.argCount=r-1,u[t]=a):(pe(u,t,n),u[t].overloadTable[r-1]=a),je([],c,a=>{var c=[a[0],null].concat(a.slice(1)),l=Ie(n,c,null,i,o,s);if(void 0===u[t].overloadTable?(l.argCount=r-1,u[t]=l):u[t].overloadTable[r-1]=l,e.registeredClass.__derivedClasses)for(const r of e.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(t)||(r.constructor[t]=l);return[]}),[]})},_embind_register_class_constructor:(e,t,r,n,a,i)=>{var o=Qe(t,r);a=Ee(n,a),je([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new K(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class \'${e.name}\'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{Re(`Cannot construct ${e.name} due to unbound types`,o)},je([],o,n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ie(r,n,null,a,i),[])),[]})},_embind_register_class_function:(e,t,r,n,a,i,o,s,u,c)=>{var l=Qe(r,n);t=Y(t),t=et(t),i=Ee(a,i,u),je([],[e],e=>{var n=`${(e=e[0]).name}.${t}`;function a(){Re(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,p=c[t];return void 0===p||void 0===p.overloadTable&&p.className!==e.name&&p.argCount===r-2?(a.argCount=r-2,a.className=e.name,c[t]=a):(pe(c,t,n),c[t].overloadTable[r-2]=a),je([],l,a=>{var s=Ie(n,a,e,i,o,u);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]}),[]})},_embind_register_class_property:(e,t,r,n,a,i,o,s,u,c)=>{t=Y(t),a=Ee(n,a),je([],[e],e=>{var n=`${(e=e[0]).name}.${t}`,l={get(){Re(`Cannot access ${n} due to unbound types`,[r,o])},enumerable:!0,configurable:!0};return l.set=u?()=>Re(`Cannot access ${n} due to unbound types`,[r,o]):e=>Q(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,t,l),je([],u?[r,o]:[r],r=>{var o=r[0],l={get(){var t=tt(this,e,n+" getter");return o.fromWireType(a(i,t))},enumerable:!0};if(u){u=Ee(s,u);var p=r[1];l.set=function(t){var r=tt(this,e,n+" setter"),a=[];u(c,r,p.toWireType(a,t)),Ue(a)}}return Object.defineProperty(e.registeredClass.instancePrototype,t,l),[]}),[]})},_embind_register_emval:e=>ee(e,ot),_embind_register_enum:(e,t,r,n)=>{function a(){}t=Y(t),a.values={},ee(e,{name:t,constructor:a,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,readValueFromPointer:st(t,r,n),destructorFunction:null}),fe(t,a)},_embind_register_enum_value:(e,t,r)=>{var n=ut(e,"enum");t=Y(t);var a=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ce(`${n.name}_${t}`,function(){})}});a.values[r]=i,a[t]=i},_embind_register_float:(e,t,r)=>{ee(e,{name:t=Y(t),fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:ct(t,r),destructorFunction:null})},_embind_register_function:(e,t,r,n,a,i,o,s)=>{var u=Qe(t,r);e=Y(e),e=et(e),a=Ee(n,a,o),fe(e,function(){Re(`Cannot call ${e} due to unbound types`,u)},t-1),je([],u,r=>{var n=[r[0],null].concat(r.slice(1));return Ae(e,Ie(e,n,null,a,i,o),t-1),[]})},_embind_register_integer:(e,t,r,n,a)=>{t=Y(t);let i=e=>e;if(0===n){var o=32-8*r;i=e=>e<<o>>>o,a=i(a)}ee(e,{name:t,fromWireType:i,toWireType:(e,t)=>t,readValueFromPointer:te(t,r,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function a(e){var t=g[e>>2],r=g[e+4>>2];return new n(d.buffer,r,t)}ee(e,{name:r=Y(r),fromWireType:a,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,t)=>{ee(e,{name:t=Y(t),fromWireType(e){var t,r=g[e>>2];return t=vt(e+4,r,!0),Me(e),t},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,n="string"==typeof t;n||ArrayBuffer.isView(t)&&1==t.BYTES_PER_ELEMENT||Q("Cannot pass non-string to std::string"),r=n?pt(t):t.length;var a=Be(4+r+1),i=a+4;return g[a>>2]=r,n?lt(t,i,r+1):h.set(t,i),null!==e&&e.push(Me,a),a},readValueFromPointer:_e,destructorFunction(e){Me(e)}})},_embind_register_std_wstring:(e,t,r)=>{var n,a,i;r=Y(r),2===t?(n=yt,a=gt,i=_t):(n=wt,a=$t,i=bt),ee(e,{name:r,fromWireType:e=>{var r=g[e>>2],a=n(e+4,r*t,!0);return Me(e),a},toWireType:(e,n)=>{"string"!=typeof n&&Q(`Cannot pass non-string to C++ string type ${r}`);var o=i(n),s=Be(4+o+t);return g[s>>2]=o/t,a(n,s+4,o+t),null!==e&&e.push(Me,s),s},readValueFromPointer:_e,destructorFunction(e){Me(e)}})},_embind_register_void:(e,t)=>{ee(e,{isVoid:!0,name:t=Y(t),fromWireType:()=>{},toWireType:(e,t)=>{}})},_emscripten_runtime_keepalive_clear:()=>{I=!1,Tt=0},_emval_create_invoker:(e,t,r)=>{var[n,...a]=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=ut(g[t+4*n>>2],`parameter ${n}`);return r})(e,t),i=n.toWireType.bind(n),o=a.map(e=>e.readValueFromPointer.bind(e));e--;var s,u={toValue:it.toValue},c=o.map((e,t)=>{var r=`argFromPtr${t}`;return u[r]=e,`${r}(args${t?"+"+8*t:""})`});switch(r){case 0:s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:u.getStringOrSymbol=Ft,s="toValue(handle)[getStringOrSymbol(methodName)]"}s+=`(${c})`,n.isVoid||(u.toReturnWire=i,u.emval_returnValue=Ct,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\\n ${s}\\n }`;var l=new Function(Object.keys(u),s)(...Object.values(u)),p=`methodCaller<(${a.map(e=>e.name)}) => ${n.name}>`;return(e=>{var t=Pt.length;return Pt.push(e),t})(ce(p,l))},_emval_decref:at,_emval_invoke:(e,t,r,n,a)=>Pt[e](t,r,n,a),_emval_new_object:()=>it.toHandle({}),_emval_run_destructors:e=>{var t=it.toValue(e);Ue(t),at(e)},_emval_set_property:(e,t,r)=>{e=it.toValue(e),t=it.toValue(t),r=it.toValue(r),e[t]=r},_gmtime_js:function(e,t){e=St(e);var r=new Date(1e3*e);y[t>>2]=r.getUTCSeconds(),y[t+4>>2]=r.getUTCMinutes(),y[t+8>>2]=r.getUTCHours(),y[t+12>>2]=r.getUTCDate(),y[t+16>>2]=r.getUTCMonth(),y[t+20>>2]=r.getUTCFullYear()-1900,y[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),a=(r.getTime()-n)/864e5|0;y[t+28>>2]=a},_localtime_js:function(e,t){e=St(e);var r=new Date(1e3*e);y[t>>2]=r.getSeconds(),y[t+4>>2]=r.getMinutes(),y[t+8>>2]=r.getHours(),y[t+12>>2]=r.getDate(),y[t+16>>2]=r.getMonth(),y[t+20>>2]=r.getFullYear()-1900,y[t+24>>2]=r.getDay();var n=0|(e=>((e=>e%4==0&&(e%100!=0||e%400==0))(e.getFullYear())?At:Dt)[e.getMonth()]+e.getDate()-1)(r);y[t+28>>2]=n,y[t+36>>2]=-60*r.getTimezoneOffset();var a=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),s=0|(i!=o&&r.getTimezoneOffset()==Math.min(o,i));y[t+32>>2]=s},_setitimer_js:(e,t)=>{if(Wt[e]&&(clearTimeout(Wt[e].id),delete Wt[e]),!t)return 0;var r=setTimeout(()=>{delete Wt[e],jt(()=>qe(e,Ut()))},t);return Wt[e]={id:r,timeout_ms:t},0},_tzset_js:(e,t,r,n)=>{var a=/* @__PURE__ */(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1),s=i.getTimezoneOffset(),u=o.getTimezoneOffset(),c=Math.max(s,u);g[e>>2]=60*c,y[t>>2]=+(s!=u);var l=e=>{var t=e>=0?"-":"+",r=Math.abs(e);return`UTC${t}${String(Math.floor(r/60)).padStart(2,"0")}${String(r%60).padStart(2,"0")}`},p=l(s),f=l(u);u<s?(lt(p,r,17),lt(f,n,17)):(lt(p,n,17),lt(f,r,17))},clock_time_get:function(e,t,r){if(!(e=>e>=0&&e<=3)(e))return 28;var n;n=0===e?Date.now():Ut();var a=Math.round(1e3*n*1e3);return $[r>>3]=BigInt(a),0},emscripten_get_heap_max:()=>2147483648,emscripten_resize_heap:e=>{var t=h.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var i=Math.min(r,Ht(Math.max(e,a),65536));if(It(i))return!0}return!1},environ_get:(e,t)=>{var r=0,n=0;for(var a of Bt()){var i=t+r;g[e+n>>2]=i,r+=lt(a,i,1/0)+1,n+=4}return 0},environ_sizes_get:(e,t)=>{var r=Bt();g[e>>2]=r.length;var n=0;for(var a of r)n+=pt(a)+1;return g[t>>2]=n,0},fd_close:e=>52,fd_fdstat_get:(e,t)=>{var r=0;return 0==e?r=2:(1==e||2==e)&&(r=64),d[t]=2,v[t+2>>1]=1,$[t+8>>3]=BigInt(r),$[t+16>>3]=BigInt(0),0},fd_seek:function(e,t,r,n){return 70},fd_write:(e,t,r,n)=>{for(var a=0,i=0;i<r;i++){var o=g[t>>2],s=g[t+4>>2];t+=8;for(var u=0;u<s;u++)qt(e,h[o+u]);a+=s}return g[n>>2]=a,0},invoke_diii:function(e,t,r,n){var a=B();try{return We(e)(t,r,n)}catch(i){if(V(a),i!==i+0)throw i;Le(1,0)}},invoke_fi:function(e,t){var r=B();try{return We(e)(t)}catch(n){if(V(r),n!==n+0)throw n;Le(1,0)}},invoke_fiii:function(e,t,r,n){var a=B();try{return We(e)(t,r,n)}catch(i){if(V(a),i!==i+0)throw i;Le(1,0)}},invoke_i:function(e){var t=B();try{return We(e)()}catch(r){if(V(t),r!==r+0)throw r;Le(1,0)}},invoke_ii:function(e,t){var r=B();try{return We(e)(t)}catch(n){if(V(r),n!==n+0)throw n;Le(1,0)}},invoke_iii:function(e,t,r){var n=B();try{return We(e)(t,r)}catch(a){if(V(n),a!==a+0)throw a;Le(1,0)}},invoke_iiii:function(e,t,r,n){var a=B();try{return We(e)(t,r,n)}catch(i){if(V(a),i!==i+0)throw i;Le(1,0)}},invoke_iiiid:function(e,t,r,n,a){var i=B();try{return We(e)(t,r,n,a)}catch(o){if(V(i),o!==o+0)throw o;Le(1,0)}},invoke_iiiii:function(e,t,r,n,a){var i=B();try{return We(e)(t,r,n,a)}catch(o){if(V(i),o!==o+0)throw o;Le(1,0)}},invoke_iiiiid:function(e,t,r,n,a,i){var o=B();try{return We(e)(t,r,n,a,i)}catch(s){if(V(o),s!==s+0)throw s;Le(1,0)}},invoke_iiiiii:function(e,t,r,n,a,i){var o=B();try{return We(e)(t,r,n,a,i)}catch(s){if(V(o),s!==s+0)throw s;Le(1,0)}},invoke_iiiiiii:function(e,t,r,n,a,i,o){var s=B();try{return We(e)(t,r,n,a,i,o)}catch(u){if(V(s),u!==u+0)throw u;Le(1,0)}},invoke_iiiiiiii:function(e,t,r,n,a,i,o,s){var u=B();try{return We(e)(t,r,n,a,i,o,s)}catch(c){if(V(u),c!==c+0)throw c;Le(1,0)}},invoke_iiiiiiiiii:function(e,t,r,n,a,i,o,s,u,c){var l=B();try{return We(e)(t,r,n,a,i,o,s,u,c)}catch(p){if(V(l),p!==p+0)throw p;Le(1,0)}},invoke_iiiiiiiiiii:function(e,t,r,n,a,i,o,s,u,c,l){var p=B();try{return We(e)(t,r,n,a,i,o,s,u,c,l)}catch(f){if(V(p),f!==f+0)throw f;Le(1,0)}},invoke_iiiiiiiiiiii:function(e,t,r,n,a,i,o,s,u,c,l,p){var f=B();try{return We(e)(t,r,n,a,i,o,s,u,c,l,p)}catch(d){if(V(f),d!==d+0)throw d;Le(1,0)}},invoke_iiiiijj:function(e,t,r,n,a,i,o){var s=B();try{return We(e)(t,r,n,a,i,o)}catch(u){if(V(s),u!==u+0)throw u;Le(1,0)}},invoke_iiiijj:function(e,t,r,n,a,i){var o=B();try{return We(e)(t,r,n,a,i)}catch(s){if(V(o),s!==s+0)throw s;Le(1,0)}},invoke_iiij:function(e,t,r,n){var a=B();try{return We(e)(t,r,n)}catch(i){if(V(a),i!==i+0)throw i;Le(1,0)}},invoke_j:function(e){var t=B();try{return We(e)()}catch(r){if(V(t),r!==r+0)throw r;return Le(1,0),0n}},invoke_jiiii:function(e,t,r,n,a){var i=B();try{return We(e)(t,r,n,a)}catch(o){if(V(i),o!==o+0)throw o;return Le(1,0),0n}},invoke_v:function(e){var t=B();try{We(e)()}catch(r){if(V(t),r!==r+0)throw r;Le(1,0)}},invoke_vi:function(e,t){var r=B();try{We(e)(t)}catch(n){if(V(r),n!==n+0)throw n;Le(1,0)}},invoke_vii:function(e,t,r){var n=B();try{We(e)(t,r)}catch(a){if(V(n),a!==a+0)throw a;Le(1,0)}},invoke_viii:function(e,t,r,n){var a=B();try{We(e)(t,r,n)}catch(i){if(V(a),i!==i+0)throw i;Le(1,0)}},invoke_viiii:function(e,t,r,n,a){var i=B();try{We(e)(t,r,n,a)}catch(o){if(V(i),o!==o+0)throw o;Le(1,0)}},invoke_viiiii:function(e,t,r,n,a,i){var o=B();try{We(e)(t,r,n,a,i)}catch(s){if(V(o),s!==s+0)throw s;Le(1,0)}},invoke_viiiiii:function(e,t,r,n,a,i,o){var s=B();try{We(e)(t,r,n,a,i,o)}catch(u){if(V(s),u!==u+0)throw u;Le(1,0)}},invoke_viiiiiii:function(e,t,r,n,a,i,o,s){var u=B();try{We(e)(t,r,n,a,i,o,s)}catch(c){if(V(u),c!==c+0)throw c;Le(1,0)}},invoke_viiiiiiii:function(e,t,r,n,a,i,o,s,u){var c=B();try{We(e)(t,r,n,a,i,o,s,u)}catch(l){if(V(c),l!==l+0)throw l;Le(1,0)}},invoke_viiiiiiiiii:function(e,t,r,n,a,i,o,s,u,c,l){var p=B();try{We(e)(t,r,n,a,i,o,s,u,c,l)}catch(f){if(V(p),f!==f+0)throw f;Le(1,0)}},invoke_viiiiiiiiiiiiiii:function(e,t,r,n,a,i,o,s,u,c,l,p,f,d,h,v){var m=B();try{We(e)(t,r,n,a,i,o,s,u,c,l,p,f,d,h,v)}catch(y){if(V(m),y!==y+0)throw y;Le(1,0)}},invoke_viiji:function(e,t,r,n,a){var i=B();try{We(e)(t,r,n,a)}catch(o){if(V(i),o!==o+0)throw o;Le(1,0)}},invoke_viijii:function(e,t,r,n,a,i){var o=B();try{We(e)(t,r,n,a,i)}catch(s){if(V(o),s!==s+0)throw s;Le(1,0)}},llvm_eh_typeid_for:e=>e,proc_exit:Ot};return Jt=await async function(){function e(e,t){return Jt=e.exports,f=Jt.memory,S(),Se=Jt.__indirect_function_table,function(e){Ve=e.__getTypeName,n._malloc=Be=e.malloc,n._parseDropFile=e.parseDropFile,n._getAttributeFromDropFile=e.getAttributeFromDropFile,n._takeAttributeFromDropFile=e.takeAttributeFromDropFile,n._flattenDropFile=e.flattenDropFile,n._destroyDropFileHandle=e.destroyDropFileHandle,e.__cxa_free_exception,n._free=Me=e.free,qe=e._emscripten_timeout,Le=e.setThrew,ze=e._emscripten_tempret_set,Ne=e._emscripten_stack_restore,Je=e._emscripten_stack_alloc,Ye=e.emscripten_stack_get_current,Ge=e.__cxa_decrement_exception_refcount,Xe=e.__cxa_increment_exception_refcount,Ze=e.__cxa_can_catch,Ke=e.__cxa_get_exception_ptr}(Jt),Jt}var t={env:Yt,wasi_snapshot_preview1:Yt};return n.instantiateWasm?new Promise((r,a)=>{n.instantiateWasm(t,(t,n)=>{r(e(t))})}):(T??=D(),e((await E(u,T,t)).instance))}(),function(){function e(){n.calledRun=!0,!k&&(F=!0,Jt.__wasm_call_ctors(),l?.(n),n.onRuntimeInitialized?.(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)j(n.postRun.shift());O(R)}())}!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)H(n.preRun.shift());O(U)}(),n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),e()},1)):e()}(),F?n:new Promise((e,t)=>{l=e,p=t})}({wasmBinary:r}),a=/* @__PURE__ */new Map,i={get AttributeInfo(){return n.AttributeInfo},get AquaStatus(){return n.AquaStatus},get heapU8(){return n.HEAPU8},get heapU32(){return n.HEAPU32},get SceneRequestDescriptor(){return n.SceneRequestDescriptor},get WorkerDataType(){return n.WorkerDataType},dataPtrView:e=>n.dataPtrView(e),free:(...e)=>n.ccall("free","number",["number"],e),malloc:(...e)=>n.ccall("malloc","number",["number"],e),parseDropFile:(e,t)=>n.parseDropFile(e,t),getAttributeFromDropFile:(e,t,r)=>n.getAttributeFromDropFile(e,t,r),takeAttributeFromDropFile:(e,t,r)=>n.takeAttributeFromDropFile(e,t,r),flattenDropFile:(e,t,r)=>n.flattenDropFile(e,t,r),destroyDropFileHandle:e=>n.destroyDropFileHandle(e)};var o;o={async cancel(e,t){const r=`${t}-${e}`,n=a.get(r);return n&&(n.abort(),a.delete(r)),[{cancelled:!!n}]},heapSnapshot:async e=>"function"!=typeof n.TakeHeapSnapshot?[{snapshotJson:null}]:[{snapshotJson:n.TakeHeapSnapshot(e)}],heapTrackingControl:async e=>"function"!=typeof n.SetHeapTrackingEnabled?[{success:!1}]:(n.SetHeapTrackingEnabled(e),[{success:!0}]),heapTrackingReset:async()=>"function"!=typeof n.ResetHeapTracking?[{success:!1}]:(n.ResetHeapTracking(),[{success:!0}]),async decode(r,o,s,u,c){const l=`${o}-${r}`,p=new AbortController;a.set(l,p);try{const{free:a,malloc:l,parseDropFile:d,getAttributeFromDropFile:h,takeAttributeFromDropFile:v,flattenDropFile:m,destroyDropFileHandle:y}=i,g=s.byteLength,_=l(g);i.heapU8.set(new Uint8Array(s),_);const w=n.SceneRequestDescriptor.deserializeFromBinary(_,g);a(_);const $=w.getUrl(),b=w.getBody()||null,T=b?"POST":"GET",P=w.getHeaders();w.delete();const C=performance.now(),k=await fetch($,{method:T,headers:P,body:b,signal:p.signal}),F=JSON.stringify({"x-cache":k.headers.get("x-cache")??""});if(!k.ok){const e=performance.now()-C;return[{requestIdLow:r,requestIdHigh:o,resultBuffer:new ArrayBuffer(0),success:!1,parsed:!1,error:`HTTP error! status: ${k.status}`,dataType:n.WorkerDataType.Raw.value,contextPtr:u,attributes:[],duration:e,ttfb:e,httpStatus:k.status,responseHeadersJson:F},{transfer:[]}]}const S=performance.now()-C,A=await k.arrayBuffer(),D=performance.now()-C,W=[];if(!$.split(/[?#]/,1)[0].endsWith(".drop"))return[{requestIdLow:r,requestIdHigh:o,resultBuffer:A,success:!0,parsed:!1,error:void 0,dataType:n.WorkerDataType.Raw.value,contextPtr:u,attributes:W,duration:D,ttfb:S,httpStatus:k.status,responseHeadersJson:F},{transfer:[A]}];const E=A.byteLength,x=l(E);i.heapU8.set(new Uint8Array(A),x);const O=l(4),R=l(4);i.heapU32[O/4]=0,i.heapU32[R/4]=0;let j=0,U=0;const H=new i.AttributeInfo;try{if(j=d(x,E),0===j)throw new Error("parseDropFile failed");let a=c;for(const[r,n]of Object.entries(e)){if(n.discard)v(j,r,a);else if(h(j,r,H)===i.AquaStatus.Success){const e=t(r,a,i.dataPtrView(H));v(j,r,a)===i.AquaStatus.Success&&W.push(e)}a++}if(m(j,O,R)!==i.AquaStatus.Success)throw new Error("flattenDropFile failed");U=i.heapU32[O/4];const s=i.heapU32[R/4];if(0===U)throw new Error("flattenDropFile gave nullptr");const l=i.heapU8.buffer.slice(U,U+s),p=W.map(e=>e.paddedData.buffer);return[{requestIdLow:r,requestIdHigh:o,resultBuffer:l,success:!0,parsed:!0,error:void 0,dataType:n.WorkerDataType.Drop.value,contextPtr:u,attributes:W,duration:D,ttfb:S,httpStatus:k.status,responseHeadersJson:F},{transfer:[l,...p]}]}catch(f){console.error("Exception when parsing dropfile",f);const e=f instanceof Error?f.stack??f.message:String(f),t=(new Uint8Array).buffer;return[{requestIdLow:r,requestIdHigh:o,resultBuffer:t,success:!1,parsed:!1,error:e,dataType:n.WorkerDataType.Drop.value,contextPtr:u,attributes:void 0,duration:D,ttfb:S,httpStatus:k.status,responseHeadersJson:F},{transfer:[t]}]}finally{y(j),a(x),a(O),a(R),0!==U&&a(U),H.delete()}}catch(f){const e=f instanceof Error?f.message:String(f),t=f instanceof Error&&"AbortError"===f.name;return[{requestIdLow:r,requestIdHigh:o,resultBuffer:new ArrayBuffer(0),success:!1,parsed:!1,error:t?"Cancelled":e,dataType:n.WorkerDataType.Raw.value,contextPtr:u,attributes:[],duration:0,ttfb:0,httpStatus:0,responseHeadersJson:"{}"},{transfer:[]}]}finally{a.delete(l)}}},self.postMessage("ready"),self.addEventListener("message",async({data:e})=>{if("ready"===e)return;const{id:t,action:r,args:n}=e,[a,...i]=await Reflect.apply(o[r],void 0,[...n,t]);self.postMessage({id:t,result:a},...i)});\n',m="undefined"!=typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",p],{type:"text/javascript;charset=utf-8"});function f(e){let t;try{if(t=m&&(self.URL||self.webkitURL).createObjectURL(m),!t)throw"";const r=new Worker(t,{type:"module",name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(p),{type:"module",name:e?.name})}}const g=(e=>e.includes("/.vite/")?e.replace(/\.vite\/[^?#]*/,()=>"@miris-inc/core/dist/aqua-parser.wasm"):e)(new URL("aqua-parser.wasm",import.meta.url).href);class y extends h{static name="decoder";static Worker=f;constructor(e){super(e),this.#x()}async#x(){try{const e=await fetch(g);if(!e.ok)throw new Error(`HTTP ${e.status} fetching aqua-parser.wasm`);const t=await e.arrayBuffer();this._postToWorker({type:"wasm-init",wasmBinary:t},[t])}catch(e){console.error("Failed to load aqua-parser.wasm for decoder worker",e),this._postToWorker({type:"wasm-init"})}}get AttributeInfo(){return this.module.AttributeInfo}async heapSnapshot(e){return this._execute("heapSnapshot",e)}async heapTrackingControl(e){return this._execute("heapTrackingControl",e)}async heapTrackingReset(){return this._execute("heapTrackingReset")}async cancel(e,t){await this.ready,this._execute("cancel",e,t).catch(()=>{})}async decode(...e){const{requestIdLow:t,requestIdHigh:r,resultBuffer:n,success:a,dataType:s,contextPtr:o,attributes:c,duration:u,ttfb:l,httpStatus:d,responseHeadersJson:h}=await this._execute("decode",...e);if(void 0!==c)for(const{paddedData:g,originalSize:y,id:v}of c)i.addWithId({paddedData:g,originalSize:y},v);const{engine:p}=this,m=n.byteLength,f=p.malloc(m);p.heapU8.set(new Uint8Array(n),f),p.onWorkerResult(t,r,f,m,d,u,l,a,s,"",h,o)}}const v={sparkPackedSplat:{elementsPerSplat:4,discard:!1},extendedPackedSplatLow:{elementsPerSplat:4,discard:!1},extendedPackedSplatHigh:{elementsPerSplat:4,discard:!1},packedSh1:{elementsPerSplat:2,discard:!1},packedSh2:{elementsPerSplat:4,discard:!1},packedSh3:{elementsPerSplat:4,discard:!1},sh1Extended:{elementsPerSplat:4,discard:!1},sh2Extended:{elementsPerSplat:4,discard:!1},sh3Extended_0:{elementsPerSplat:4,discard:!1},sh3Extended_1:{elementsPerSplat:4,discard:!1}};function b(e,t,r){const n=v[e];if(void 0===n)throw new Error("attribute name"+e+" is unknown");const i=r.length,a=(s=i,o=2048*n.elementsPerSplat,Math.ceil(s/o)*o);var s,o;const c=new Uint32Array(a);return c.set(r),{paddedData:c,originalSize:i,id:t}}class S{static SPARK_PACKED_SPLAT="sparkPackedSplat";static SPARK_EXTENDED_SPLAT_LOW="extendedPackedSplatLow";static SPARK_EXTENDED_SPLAT_HIGH="extendedPackedSplatHigh";static SPARK_PACKED_SH1="packedSh1";static SPARK_PACKED_SH2="packedSh2";static SPARK_PACKED_SH3="packedSh3";static SPARK_EXTENDED_SH1="sh1Extended";static SPARK_EXTENDED_SH2="sh2Extended";static SPARK_EXTENDED_SH3_A="sh3Extended_0";static SPARK_EXTENDED_SH3_B="sh3Extended_1";static UNUSED="unused"}class w{static AquaStatus={Success:0,Failure:1};static SceneObjectType={ModelRoot:0,SceneObject:1,StreamObject:2,GaussianSplats:3,PointsObject:4,Camera:5,LodOctree:6,VariantSetCollection:7,VariantSet:8,VariantSetOption:9};static Feature={DrMap:0};static FeatureState={NotLoaded:0,Pending:1,Loaded:2,Failed:3};#D;get module(){if(!this.#D)throw new Error("Engine has not yet been initialized. Did you forget to `await engine.ready()?`");return this.#D}#E=/* @__PURE__ */new Set;#I=/* @__PURE__ */new Map;constructor(e={}){Object.defineProperty(this,"pending",{value:!0,configurable:!0,enumerable:!0}),Object.defineProperty(this,"ready",{enumerable:!0,value:this.#F(e)})}async#F(e){return this.#D=await d({createDeserializeWorker:this.createDeserializeWorker.bind(this),submitToWorker:this.submitToWorker.bind(this),cancelRequest:this.cancelRequest.bind(this),terminateWorker:this.terminateWorker.bind(this),workerUrl:"aqua-parser",...e,preRun:[e=>Object.assign(e.ENV,w.#O())]}),Object.defineProperty(this,"pending",{value:!1,configurable:!1}),this}get AttributeInfo(){return this.module.AttributeInfo}get Handedness(){return this.module.Handedness}get heapF32(){return this.module.HEAPF32}get heapU8(){return this.module.HEAPU8}get MatrixOrder(){return this.module.MatrixOrder}get SceneChangeIds(){return this.module.SceneChangeIds}get SceneMetadata(){return this.module.SceneMetadata}get RuntimeSettings(){return this.module.RuntimeSettings}get SpatialFormat(){return this.module.SpatialFormat}get StringVector(){return this.module.StringVector}get UpAxis(){return this.module.UpAxis}activatedObjectIdsView(...e){return this.module.activatedObjectIdsView(...e)}addStreamById(...e){return this.module.ccall("AddStreamById","number",["number","string","string","number"],e)}allocateSceneChangesArrays(...e){return this.module.AllocateSceneChangesArrays(...e)}createContext(...e){return this.module.ccall("CreateAquaContext","number",[],e)}destroyContext(...e){return this.module.ccall("DestroyAquaContext","number",["number"],e)}createClient(e,...t){return e?this.module.ccall("CreateClientForContext","number",["number"],[e,...t]):this.module.ccall("CreateClient","number",[],t)}createdObjectIdsView(...e){return this.module.createdObjectIdsView(...e)}deletedObjectIdsView(...e){return this.module.deletedObjectIdsView(...e)}dataPtrView(...e){return this.module.dataPtrView(...e)}deactivatedObjectIdsView(...e){return this.module.deactivatedObjectIdsView(...e)}destroyClient(...e){return this.module.ccall("DestroyClient","number",["number"],e)}free(...e){return this.module.ccall("free","number",["number"],e)}getAssetsAsync(...e){return this.module.GetAssetsAsync(...e)}getAttribute(...e){return this.module.ccall("GetAttribute","number",["number","number","string","number"],e)}getDefaultCameraId(...e){return this.module.ccall("GetDefaultCameraId","number",["number"],e)}getLocalBoundingBox(...e){return this.module.ccall("GetLocalBoundingBox","number",["number","number","number"],e)}getWorldBoundingBox(...e){return this.module.ccall("GetWorldBoundingBox","number",["number","number","number"],e)}getLodIndex(...e){return this.module.ccall("GetLodIndex","number",["number","number"],e)}getSceneChanges(...e){return this.module.GetSceneChanges(...e)}getSceneChangesCounts(...e){return this.module.GetSceneChangesCounts(...e)}getSceneMetadata(...e){return this.module.GetSceneMetadata(...e).value}getSceneObjectParent(...e){return this.module.ccall("GetSceneObjectParent","number",["number","number"],e)}getSceneObjectType(...e){return this.module.ccall("GetSceneObjectType","number",["number","number"],e)}getLocalTransform(...e){return this.module.ccall("MirisGetLocalTransform","number",["number","number","number"],e)}getWorldTransform(...e){return this.module.ccall("MirisGetWorldTransform","number",["number","number","number"],e)}hasAttribute(...e){return this.module.ccall("HasAttribute","boolean",["number","number","string"],e)}isSceneObjectAncestorOf(...e){return this.module.ccall("IsSceneObjectAncestorOf","boolean",["number","number","number"],e)}lockScene(...e){return this.module.ccall("LockScene","number",["number"],e)}malloc(...e){return this.module.ccall("malloc","number",["number"],e)}modifiedObjectIdsView(...e){return this.module.modifiedObjectIdsView(...e)}onWorkerResult(...e){const t=`${e[1]}-${e[0]}`;return this.#I.delete(t),this.module.ccall("onWorkerResult",null,["number","number","number","number","number","number","number","number","number","string","string","number"],e)}removeStream(...e){return this.module.ccall("RemoveStream","boolean",["pointer","number"],e)}setAssetViewerKey(...e){return this.module.ccall("SetAssetViewerKey","number",["number","string"],e)}setClientSpatialFormat(...e){return this.module.SetClientSpatialFormat(...e).value}setRuntimeSettings(...e){return this.module.SetRuntimeSettings(...e).value}setMainCameraTransform(...e){return this.module.ccall("SetMainCameraTransform","number",["number","number"],e)}setMainCameraViewFrustum(...e){return this.module.ccall("SetMainCameraViewFrustum","number",["number","number","number","number","number"],e)}setMaxCacheSize(...e){return this.module.setMaxCacheSize(...e)}setSceneObjectTransform(...e){return this.module.ccall("SetSceneObjectTransform","number",["number","number","number"],e)}hasFeature(...e){return this.module.HasFeature(...e)}getFeatureVersion(...e){return this.module.GetFeatureVersion(...e)}getFeatureState(...e){return this.module.GetFeatureState(...e)}getName(...e){return this.module.GetName(...e)}setVariantSelection(...e){return this.module.ccall("SetVariantSelection","number",["number","number"],e)}takeAttribute(...e){return this.module.ccall("TakeAttribute","number",["number","number","string","bigint"],e)}takeEvictedClientSideAttributeIds(...e){return this.module.TakeEvictedClientSideAttributeIds(...e)}getActiveClientSideIdsCheckSum(){return this.module.GetActiveClientSideIdsCheckSum()}unlockScene(...e){return this.module.ccall("UnlockScene","number",["number"],e)}updateSceneExecution(...e){return this.module.ccall("UpdateSceneExecution","number",["number","boolean"],e)}takeRenderRequired(...e){return this.module.TakeRenderRequired(...e)}createDeserializeWorker(e,t,r){for(let n=1;n<r;n+=1)this.#E.add(new y({engine:this}));return!0}cancelRequest(e,t){const r=`${t}-${e}`,n=this.#I.get(r);return n&&(n.cancel(e,t),this.#I.delete(r)),!0}submitToWorker(e,t,r,n){const a=[...this.#E.values()].reduce((e,t)=>e?t.pendingRequests<e.pendingRequests?t:e:t),s=`${t}-${e}`;this.#I.set(s,a);const o=i.getConsecutiveIds(Object.keys(v).length);return a.ready.then(()=>a.decode(e,t,r,n,o)),!0}terminateWorker(){for(const e of this.#E)e.terminate();this.#E.clear()}async requestWorkerHeapSnapshots(e){const t=[...this.#E];return(await Promise.allSettled(t.map(t=>t.ready.then(()=>{let r;const n=new Promise(e=>{r=setTimeout(()=>e(null),5e3)});return Promise.race([t.heapSnapshot(e).then(e=>e.snapshotJson),n]).finally(()=>clearTimeout(r))})))).map(e=>"fulfilled"===e.status?e.value:null)}async setWorkerHeapTrackingEnabled(e){await Promise.allSettled([...this.#E].map(t=>t.ready.then(()=>t.heapTrackingControl(e))))}async resetWorkerHeapTracking(){await Promise.allSettled([...this.#E].map(e=>e.ready.then(()=>e.heapTrackingReset())))}static#O(){return{AQUA_USE_SINGLETON_NETWORK_TRANSPORT:"true",AQUA_SERVER_BASE_URL:"https://app.miris.com/viewer/v1"}}}const _=[30,60,72,90,120,144,165,240];class k{static _instance;static async instance(){const e=this._instance??=new this;return await e.ready,e}#j;get sharedContext(){return this.#j}#R;get viewerKey(){return this.#R}set viewerKey(e){this.#R=e}#W=/* @__PURE__ */new Set;get scenes(){return new Set(this.#W)}#M=[];#V=null;#L=/* @__PURE__ */new Set;#B=/* @__PURE__ */new Map;constructor(){this.constructor.prototype._instance||(this.constructor.prototype._instance=this),Object.defineProperties(this,{pending:{value:!0,configurable:!0,enumerable:!0},engine:{value:new w,enumerable:!0}}),Object.defineProperty(this,"ready",{enumerable:!0,value:this.#U()})}async#U(){const{engine:e}=this;await e.ready,this.#j=this.engine.createContext();const t=1048576,r=new URLSearchParams(window.location.search).get("aquaMaxCacheSize");let n=0;if(r){const e=parseInt(r,10);!isNaN(e)&&e>0&&(n=e)}return n>0?this.engine.setMaxCacheSize(n*t):navigator.userAgent.includes("iPhone")?this.engine.setMaxCacheSize(128*t):navigator.userAgent.includes("Android")&&this.engine.setMaxCacheSize(256*t),this.#H(),Object.defineProperty(this,"pending",{value:!1,configurable:!1}),this}dispose(){this.#j&&(this.engine.destroyContext(this.#j)!==w.AquaStatus.Success&&console.error(`Failed to destroy aqua context with handle '${this.#j}'`),this.#j=0)}updateParentedTransform(e,t){}#q=function(){let e=[],t=null,r=0;return screen.addEventListener?.("change",()=>{e=[],r=0,t=null}),{update(n){if(!r){if(null!==t&&(e.push(n-t),e.length>60&&e.shift(),!r&&60===e.length)){const t=1e3/(e.reduce((e,t)=>e+t,0)/e.length);r=_.reduce((e,r)=>Math.abs(r-t)<Math.abs(e-t)?r:e)}t=n}},get nativeHz(){return r}}}();#K=this.#H.bind(this);#z=!1;#N=72;#G=!1;#Q(){const e=new this.engine.RuntimeSettings;e.targetFramesPerSecond=this.#N,e.xrModeActive=this.#G;for(const t of this.#W)t.client.setRuntimeSettings(e);e.delete()}_setXRModeActive(e,t){this.#G=e,void 0!==t&&(this.#N=t),this.#Q()}#H(){this._update(),requestAnimationFrame(this.#K)}_update(){this.#q&&(this.#q.update(performance.now()),this.#q.nativeHz>0&&(this.#N=this.#q.nativeHz,this.#Q(),this.#q=null));for(const e of this.#W){const{client:t}=e;t.updateSceneExecution(this.#z),this.#z=!1;const r=t.takeEvictedClientSideAttributeIds();try{const e=r.size();if(e>0){const t=[];for(let n=0;n<e;n++)t.push(Number(r.get(n)));i.remove(t)}}finally{r.delete()}const n=this.engine.getActiveClientSideIdsCheckSum();i.validateCheckSum(n);if(!t.lockScene())return;try{this.#Y(e)}finally{t.unlockScene()}}this.#M.length&&(this.applyChanges(this.#M),this.#M.length=0)}#J(e,t,r){const n=this.engine.malloc(4*t);r(e,n);const i=this.engine.heapF32.subarray(n>>2,(n>>2)+t).slice();return this.engine.free(n),i}getLocalTransform(e,t){if(Number.isInteger(t)&&t>=0)return this.#J(t,16,e.getLocalTransform.bind(e))}getWorldTransform(e,t){if(Number.isInteger(t)&&t>=0)return this.#J(t,16,e.getWorldTransform.bind(e))}#X(){return!!this.#V&&(this.#V.createdObjectsCount>0||(this.#V.activatedObjectsCount>0||(this.#V.deactivatedObjectsCount>0||(this.#V.modifiedObjectsCount>0||this.#V.deletedObjectsCount>0))))}#Z(e,t,r,n){const{engine:a}=this;if(!e.hasAttribute(t,r))return null;const{ptr:s}=n.$$,o=e.getAttribute(t,r,s);if(o!==w.AquaStatus.Success)return console.warn(`GetAttribute failed for object id ${t} and attribute name ${r}: status ${o}`),null;let c,u;if(0n!=n.clientSideId)({paddedData:c,originalSize:u}=i.get(Number(n.clientSideId)));else{const s=b(r,0,a.dataPtrView(n));c=s.paddedData,u=s.originalSize;const o=i.add({paddedData:s.paddedData,originalSize:s.originalSize}),l=e.takeAttribute(t,r,BigInt(o));if(l!==w.AquaStatus.Success)return i.remove(o),console.warn(`Failed to take attribute ${r} for scene object ${t}: status ${l}`),null}return{paddedData:c,originalSize:u}}#Y(e){const{engine:i}=this,{client:s,camera:o,lods:c}=e;if(o&&o.update(),null===this.#V&&(this.#V=new i.SceneChangeIds),s.getSceneChangesCounts(this.#V),!this.#X())return;i.allocateSceneChangesArrays(this.#V),s.getSceneChanges(this.#V);const u=/* @__PURE__ */new Set;for(const h of i.createdObjectIdsView(this.#V)){const i=s.getSceneObjectType(h);if(i!==w.SceneObjectType.StreamObject){if(i===w.SceneObjectType.ModelRoot){const t=e.getStreamForDescendentId(h);if(!t)continue;const r=new n({id:h,stream:t}),i=this.getLocalTransform(s,h);if(!i)continue;const a=s.getSceneObjectParent(h),o=this.getLocalTransform(s,a);if(!o)continue;const c=this.updateParentedTransform(i,o);if(!c)continue;r.transform=c}else if(i==w.SceneObjectType.GaussianSplats){const n=e.getModelRootForDescendentId(h);if(!n)continue;const i=new t({id:h,modelRoot:n,lodStore:c});i.transform=this.getLocalTransform(s,h),u.add(h);const a=new r({type:"created",lod:i});this.#M.push(a)}else if(i==w.SceneObjectType.VariantSetCollection){const t=e.getStreamForDescendentId(h);t?._addVariantCollection(h)}else if(i==w.SceneObjectType.VariantSet){const t=e.getStreamForDescendentId(h),r=s.getName(h),n=s.getSceneObjectParent(h);t?._addVariant(n,{id:h,name:r,options:[],nestedSets:[]})}else if(i==w.SceneObjectType.VariantSetOption){const t=e.getStreamForDescendentId(h),r=s.getName(h),n=s.getSceneObjectParent(h);t?._addVariant(n,{id:h,name:r,type:"option"})}}else a.forId(h)}for(const t of i.deletedObjectIdsView(this.#V)){const e=c.forId(t);if(!e)continue;const n=new r({type:"deleted",lod:e});this.#M.push(n)}for(const t of i.modifiedObjectIdsView(this.#V)){const n=s.getSceneObjectType(t);if(n===w.SceneObjectType.LodOctree)e._onFeatureData(t);else if(n===w.SceneObjectType.GaussianSplats){const n=this.#J(t,6,s.getWorldBoundingBox.bind(s)),a=s.getLodIndex(t),o=new i.AttributeInfo,u=new i.AttributeInfo;try{let i=this.#Z(s,t,S.SPARK_EXTENDED_SPLAT_LOW,o),l=null,d=!0;if(null===i?(i=this.#Z(s,t,S.SPARK_PACKED_SPLAT,o),d=!1):l=this.#Z(s,t,S.SPARK_EXTENDED_SPLAT_HIGH,u),null===i){console.error(`Could not retrieve primary splats attribute for scene object ${t}! skipping scene object`);continue}const h=c.forId(t);if(!h){console.warn(`Received modified event for LOD ${t} which does not exist.`);continue}h.splats=i?.paddedData,h.splatsExtendedData=l?.paddedData??null,h.useExtSplats=d,h.bounds=n,h.lodIndex=a,h.paddingCount=(i?.paddedData.length-i.originalSize)/4,this.#ee(e,t,h);const p=new r({type:"modified",lod:h});if(this.#M.push(p),this.#L.delete(t)){this.#M.push(new r({type:"activated",lod:h}));for(const[,e]of this.#B)this.#M.push(new r({type:"deactivated",lod:e}));this.#B.clear()}}finally{o.delete(),u.delete()}}}if(this.#M.some(e=>"created"===e.type))try{const e=new i.SceneMetadata;s.getSceneMetadata(e),this.onColorSpaceDetected("linear"===e.inputColorSpace),e.delete()}catch(d){console.warn("Failed to read scene metadata:",d)}let l=!1;for(const t of i.activatedObjectIdsView(this.#V)){if(s.getSceneObjectType(t)==w.SceneObjectType.GaussianSplats){const e=c.forId(t);if(e&&e.splats){const t=new r({type:"activated",lod:e});this.#M.push(t)}else e&&(this.#L.add(t),l=!0)}}for(const t of i.deactivatedObjectIdsView(this.#V)){if(s.getSceneObjectType(t)==w.SceneObjectType.GaussianSplats&&(this.#L.delete(t),!u.has(t))){const e=c.forId(t);if(e&&e.splats)if(l)this.#B.set(t,e);else{const t=new r({type:"deactivated",lod:e});this.#M.push(t)}}}}#ee(e,t,r){const{engine:n}=this,{client:i}=e,a=(e,a,s)=>{const o=r.useExtSplats?a:e;if(i.hasAttribute(t,o)){const e=new n.AttributeInfo;try{const r=this.#Z(i,t,o,e);null!==r&&s(r.paddedData,e.maxValue.x)}finally{e.delete()}}};a(S.SPARK_PACKED_SH1,S.SPARK_EXTENDED_SH1,(e,t)=>r.setSh1(e,t)),a(S.SPARK_PACKED_SH2,S.SPARK_EXTENDED_SH2,(e,t)=>r.setSh2(e,t)),a(S.SPARK_PACKED_SH3,S.SPARK_EXTENDED_SH3_A,(e,t)=>r.setSh3(e,t)),a(S.UNUSED,S.SPARK_EXTENDED_SH3_B,(e,t)=>r.sh3ExtendedData=e)}update(){this._update();let e=!1;for(const t of this.#W)t.client.takeRenderRequired()&&(e=!0);return e||this._computeAdditionalRenderNeeded()}applyChanges(e){}_computeAdditionalRenderNeeded(){return!1}onColorSpaceDetected(e){}add(e){this.#W.add(e)}delete(e){this.#W.delete(e),e.miris&&e.close(),0===this.#W.size&&null!==this.#V&&(this.#V.delete(),this.#V=null)}}class C{update(){const{engine:e}=this,{client:t}=this.scene,r=e.malloc(4*this.#b.length);e.heapF32.set(Float32Array.from(this.#b),r/4),t.setMainCameraTransform(r),e.free(r),t.setMainCameraViewFrustum(this.#te,this.#re,this.#ne,this.#ie)}#te;get aspect(){return this.#te}set aspect(e){this.#te=e}#re;get fov(){return this.#re}set fov(e){this.#re=e}#ne;get near(){return this.#ne}set near(e){this.#ne=e}#ie;get far(){return this.#ie}set far(e){this.#ie=e}#b;get matrix(){return this.#b}set matrix(e){this.#b=e}constructor({aspect:e,fov:t,near:r,far:n,matrix:i,scene:a}){this.#te=e,this.#re=t,this.#ne=r,this.#ie=n,this.#b=i,Object.defineProperties(this,{scene:{value:a},miris:{value:a.miris},engine:{value:a.miris.engine}})}}class T{#R=null;get viewerKey(){return this.#R}set viewerKey(e){e&&this.setAssetViewerKey(e),this.#R=e}constructor({engine:e,context:t}){Object.defineProperties(this,{engine:{value:e,enumerable:!0},handle:{value:e.createClient(t),enumerable:!0}})}dispose(){this.engine.destroyClient(this.handle)!==w.AquaStatus.Success&&console.error(`Failed to destroy client with handle '${this.handle}'`)}addStreamById(...e){return this.engine.addStreamById(this.handle,...e)}destroyClient(...e){return this.engine.destroyClient(this.handle,...e)}getAssetsAsync(...e){return this.engine.getAssetsAsync(this.handle,...e)}getAttribute(...e){return this.engine.getAttribute(this.handle,...e)}getDefaultCameraId(...e){return this.engine.getDefaultCameraId(this.handle,...e)}getLocalBoundingBox(...e){return this.engine.getLocalBoundingBox(this.handle,...e)}getWorldBoundingBox(...e){return this.engine.getWorldBoundingBox(this.handle,...e)}getLodIndex(...e){return this.engine.getLodIndex(this.handle,...e)}getSceneChanges(...e){return this.engine.getSceneChanges(this.handle,...e)}getSceneChangesCounts(...e){return this.engine.getSceneChangesCounts(this.handle,...e)}getSceneMetadata(...e){return this.engine.getSceneMetadata(this.handle,...e)}getSceneObjectParent(...e){return this.engine.getSceneObjectParent(this.handle,...e)}getSceneObjectType(...e){return this.engine.getSceneObjectType(this.handle,...e)}getLocalTransform(...e){return this.engine.getLocalTransform(this.handle,...e)}getWorldTransform(...e){return this.engine.getWorldTransform(this.handle,...e)}hasAttribute(...e){return this.engine.hasAttribute(this.handle,...e)}isSceneObjectAncestorOf(...e){return this.engine.isSceneObjectAncestorOf(this.handle,...e)}lockScene(...e){return this.engine.lockScene(this.handle,...e)}removeStream(...e){return this.engine.removeStream(this.handle,...e)}setAssetViewerKey(...e){return this.engine.setAssetViewerKey(this.handle,...e)}setClientSpatialFormat(...e){return this.engine.setClientSpatialFormat(this.handle,...e)}setRuntimeSettings(...e){return this.engine.setRuntimeSettings(this.handle,...e)}setMainCameraTransform(...e){return this.engine.setMainCameraTransform(this.handle,...e)}setMainCameraViewFrustum(...e){return this.engine.setMainCameraViewFrustum(this.handle,...e)}setSceneObjectTransform(...e){return this.engine.setSceneObjectTransform(this.handle,...e)}hasFeature(...e){return this.engine.hasFeature(this.handle,...e)}getFeatureVersion(...e){return this.engine.getFeatureVersion(this.handle,...e)}getFeatureState(...e){return this.engine.getFeatureState(this.handle,...e)}getName(...e){return this.engine.getName(this.handle,...e)}setVariantSelection(...e){return this.engine.setVariantSelection(this.handle,...e)}takeAttribute(...e){return this.engine.takeAttribute(this.handle,...e)}takeEvictedClientSideAttributeIds(...e){return this.engine.takeEvictedClientSideAttributeIds(this.handle,...e)}takeRenderRequired(...e){return this.engine.takeRenderRequired(this.handle,...e)}unlockScene(...e){return this.engine.unlockScene(this.handle,...e)}updateSceneExecution(...e){return this.engine.updateSceneExecution(this.handle,...e)}}class $ extends EventTarget{static#t=/* @__PURE__ */new Map;static#e=/* @__PURE__ */new Map;#ae=null;get camera(){return this.#ae}set camera(e){this.#ae=e}#se=null;static forId(e){return $.#t.get(e)}static forKey(e){return $.#e.get(e)}#r;get key(){return this.#r??null}set key(e){$.#e.delete(this.key),(e||0===e)&&$.#e.set(e,this),this.#r=e}#oe=/* @__PURE__ */new Set;#ce=/* @__PURE__ */new Map;get viewerKey(){return this.client.viewerKey}set viewerKey(e){e&&(this.client.viewerKey=e)}get streams(){return new Set(this.#oe)}#u=new e;get lods(){return this.#u}constructor({miris:e,viewerKey:t}){super(),Object.defineProperties(this,{miris:{value:e,enumerable:!0},engine:{value:e.engine,enumerable:!0},client:{value:new T({engine:e.engine,context:e.sharedContext})}}),t&&(this.viewerKey=t);const r=new this.engine.SpatialFormat;r.metersPerUnit=1,r.upAxis=this.engine.UpAxis.Y,r.matrixOrder=this.engine.MatrixOrder.ColumnMajor,r.handedness=this.engine.Handedness.Right,this.client.setClientSpatialFormat(r),r.delete(),$.#t.set(this.id,this),e.add(this)}dispose(){this.close(),this.client.dispose()}#ue(){const e=this.client.getDefaultCameraId();this.#se=e>=0?e:null}async fetchAssets(e){if(!this.viewerKey)throw new Error("Could not fetch assets because there is no viewer key");const t=new this.engine.StringVector;let r=[];"string"==typeof e?r=e.split(","):e?.[Symbol.iterator]&&(r=[...e]);for(const s of r)t.push_back(s);const n=await this.client.getAssetsAsync(t),i=[],a=new TextDecoder;for(const{name:s,tags:o,thumbnailUrl:c,uuid:u}of n){const e={name:s,thumbnailUrl:c,uuid:u,tags:[]},t=o.size();for(let r=0;r<t;r+=1){let t=o.get(r);t&&("string"!=typeof t&&(t=a.decode(t)),e.tags.push(t))}i.push(e)}return t.delete(),i}getDefaultCameraTransform(){return null===this.#se?null:this.miris.getWorldTransform(this.client,this.#se)}add(e){this.#oe.add(e),this.#ce.set(e.id,e)}getStreamForId(e){return this.#ce.get(e)}getStreamForDescendentId(e){for(const[t,r]of this.#ce)if(this.client.isSceneObjectAncestorOf(t,e))return r;return null}getModelRootForDescendentId(e){for(const[,t]of this.#ce)for(const r of t.modelRoots)if(this.client.isSceneObjectAncestorOf(r.id,e))return r;return null}async _getDrMap(e){if(!this.client.hasFeature(e,w.Feature.DrMap))return null;if(this.client.getFeatureState(e,w.Feature.DrMap)!==w.FeatureState.Loaded)return null;const t=this.client.getFeatureVersion(e,w.Feature.DrMap);if(1===t){const r=`drMap_v${t}`,n=new this.engine.AttributeInfo;try{if(this.client.getAttribute(e,r,n.$$.ptr)!==w.AquaStatus.Success)return null;const t=this.engine.dataPtrView(n),i=new Uint8Array(t.buffer).subarray(t.byteOffset,t.byteOffset+t.byteLength).slice(),a=new Blob([i],{type:"image/png"});return await createImageBitmap(a)}finally{n.delete()}}return console.warn(`getDrMap: unsupported DR map version ${t}`),null}async _onFeatureData(e){const t=await this._getDrMap(e);this.dispatchEvent(new CustomEvent("drmaploaded",{detail:{bitmap:t,sceneObjectId:e}}))}_onSceneLoaded(){this.#ue(),this.dispatchEvent(new Event("sceneloaded"))}delete(e){this.#oe.delete(e),this.#ce.delete(e.id),a.forId(e.id)&&e.end()}close(){for(const e of this.streams)e.end();$.#t.delete(this.id),$.#e.delete(this.key),this.miris.scenes.has(this)&&this.miris.delete(this)}}export{C as Camera,t as Lod,e as LodStore,k as Miris,n as ModelRoot,$ as Scene,a as Stream};
|