Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lottiefiles/dotlottie-web

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lottiefiles/dotlottie-web - npm Package Compare versions

Comparing version 0.23.0 to 0.23.1

6

dist/index.js

@@ -1,4 +0,4 @@

var Ni=Object.defineProperty;var qi=(g,a,s)=>a in g?Ni(g,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):g[a]=s;var $=(g,a,s)=>(qi(g,typeof a!="symbol"?a+"":a,s),s);var Qe=class{requestAnimationFrame(a){return requestAnimationFrame(a)}cancelAnimationFrame(a){cancelAnimationFrame(a);}},et=class{constructor(){$(this,"_lastHandleId",0);$(this,"_lastImmediate",null);}requestAnimationFrame(a){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{a(Date.now());}),this._lastHandleId}cancelAnimationFrame(a){this._lastImmediate&&clearImmediate(this._lastImmediate);}},ke=class{constructor(){$(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Qe:new et;}requestAnimationFrame(a){return this._strategy.requestAnimationFrame(a)}cancelAnimationFrame(a){this._strategy.cancelAnimationFrame(a);}};var tt=typeof window<"u"&&typeof window.document<"u";var _e={name:"@lottiefiles/dotlottie-web",version:"0.23.0",type:"module",description:"Lottie and DotLottie player for the web",repository:{type:"git",url:"git+https://github.com/LottieFiles/dotlottie-web.git",directory:"packages/web"},homepage:"https://github.com/LottieFiles/dotlottie-web#readme",bugs:"https://github.com/LottieFiles/dotlottie-web/issues",author:"LottieFiles",contributors:["Abdelrahman Ashraf <a.theashraf@gmail.com>"],license:"MIT",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:["dotlottie","lottie","player","animation","web","canvas","javascript","thorvg"],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint --fix .","stats:eslint":"cross-env TIMING=1 eslint .","stats:ts":"tsc -p tsconfig.build.json --extendedDiagnostics",test:"vitest run --browser.headless","test:coverage":"vitest run --browser.headless --coverage","test:watch":"vitest","type-check":"tsc --noEmit"},devDependencies:{"@types/node":"^20.10.5","@vitest/browser":"^1.2.2 ","@vitest/coverage-istanbul":"^1.2.2","cross-env":"7.0.3",tsup:"8.0.1",typescript:"5.0.4",vitest:"^1.2.2",webdriverio:"^8.32.0"},publishConfig:{access:"public"}};var Xi=(()=>{var g=typeof document<"u"?document.currentScript?.src:void 0;return function(a={}){var s=a,_,E,ie=new Promise((e,t)=>{_=e,E=t;}),me=Object.assign({},s),ot="./this.program",st=!0,U="";function er(e){return s.locateFile?s.locateFile(e,U):U+e}(typeof document<"u"&&document.currentScript&&(U=document.currentScript.src),g&&(U=g),U.startsWith("blob:")?U="":U=U.substr(0,U.replace(/[?#].*/,"").lastIndexOf("/")+1),(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(n.status==200||n.status==0&&n.response){t(n.response);return}r();},n.onerror=r,n.send(null);});var nr=s.print||console.log.bind(console),Z=s.printErr||console.error.bind(console);Object.assign(s,me),me=null,s.arguments&&(s.arguments),s.thisProgram&&(ot=s.thisProgram),s.quit&&(s.quit);var ae;s.wasmBinary&&(ae=s.wasmBinary);var ge,lt=!1,O,L,Q,oe,A,w,ut,dt;function ct(){var e=ge.buffer;s.HEAP8=O=new Int8Array(e),s.HEAP16=Q=new Int16Array(e),s.HEAPU8=L=new Uint8Array(e),s.HEAPU16=oe=new Uint16Array(e),s.HEAP32=A=new Int32Array(e),s.HEAPU32=w=new Uint32Array(e),s.HEAPF32=ut=new Float32Array(e),s.HEAPF64=dt=new Float64Array(e);}var ft=[],vt=[],pt=[];function or(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)ur(s.preRun.shift());De(ft);}function sr(){De(vt);}function lr(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)cr(s.postRun.shift());De(pt);}function ur(e){ft.unshift(e);}function dr(e){vt.unshift(e);}function cr(e){pt.unshift(e);}var q=0,se=null;function fr(e){q++,s.monitorRunDependencies?.(q);}function vr(e){if(q--,s.monitorRunDependencies?.(q),q==0&&(se)){var t=se;se=null,t();}}function be(e){s.onAbort?.(e),e="Aborted("+e+")",Z(e),lt=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw E(t),t}var pr="data:application/octet-stream;base64,",ht=e=>e.startsWith(pr),ee;ee="DotLottiePlayer.wasm",ht(ee)||(ee=er(ee));function _t(e){if(e==ee&&ae)return new Uint8Array(ae);throw "both async and sync fetching of the wasm failed"}function hr(e){return !ae&&(st)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>_t(e)):Promise.resolve().then(()=>_t(e))}function mt(e,t,r){return hr(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{Z(`failed to asynchronously prepare wasm: ${n}`),be(n);})}function _r(e,t,r,n){return !e&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(i=>{var o=WebAssembly.instantiateStreaming(i,r);return o.then(n,function(u){return Z(`wasm streaming compile failed: ${u}`),Z("falling back to ArrayBuffer instantiation"),mt(t,r,n)})}):mt(t,r,n)}function mr(){var e={a:hi};function t(n,i){return b=n.exports,ge=b.la,ct(),kt=b.pa,dr(b.ma),vr(),b}fr();function r(n){t(n.instance);}if(s.instantiateWasm)try{return s.instantiateWasm(e,t)}catch(n){Z(`Module.instantiateWasm callback failed with error: ${n}`),E(n);}return _r(ae,ee,e,r).catch(E),{}}var De=e=>{for(;e.length>0;)e.shift()(s);};s.noExitRuntime||!0;var D=e=>Vt(e),I=()=>zt(),yt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,gt=(e,t,r)=>{for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&yt)return yt.decode(e.subarray(t,i));for(var o="";t<i;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var l=e[t++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|l);continue}var d=e[t++]&63;if((u&240)==224?u=(u&15)<<12|l<<6|d:u=(u&7)<<18|l<<12|d<<6|e[t++]&63,u<65536)o+=String.fromCharCode(u);else {var f=u-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023);}}return o},G=(e,t)=>e?gt(L,e,t):"",yr=(e,t,r,n)=>{be(`Assertion failed: ${G(e)}, at: `+[t?G(t):"unknown filename",r,n?G(n):"unknown function"]);},te=0;class bt{constructor(t){this.excPtr=t,this.ptr=t-24;}set_type(t){w[this.ptr+4>>2]=t;}get_type(){return w[this.ptr+4>>2]}set_destructor(t){w[this.ptr+8>>2]=t;}get_destructor(){return w[this.ptr+8>>2]}set_caught(t){t=t?1:0,O[this.ptr+12]=t;}get_caught(){return O[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,O[this.ptr+13]=t;}get_rethrown(){return O[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r);}set_adjusted_ptr(t){w[this.ptr+16>>2]=t;}get_adjusted_ptr(){return w[this.ptr+16>>2]}get_exception_ptr(){var t=Nt(this.get_type());if(t)return w[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var gr=e=>{throw te||(te=e),te},Ce=e=>Ht(e),br=e=>{var t=te;if(!t)return Ce(0),0;var r=new bt(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ce(0),t;for(var i in e){var o=e[i];if(o===0||o===n)break;var u=r.ptr+16;if(Yt(o,n,u))return Ce(o),t}return Ce(n),t},Cr=()=>br([]),Tr=(e,t,r)=>{var n=new bt(e);throw n.init(t,r),te=e,te};function Er(e,t,r){return 0}var Fr=(e,t)=>{},Ct=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},wt=(e,t,r,n)=>{if(!(n>0))return 0;for(var i=r,o=r+n-1,u=0;u<e.length;++u){var l=e.charCodeAt(u);if(l>=55296&&l<=57343){var d=e.charCodeAt(++u);l=65536+((l&1023)<<10)|d&1023;}if(l<=127){if(r>=o)break;t[r++]=l;}else if(l<=2047){if(r+1>=o)break;t[r++]=192|l>>6,t[r++]=128|l&63;}else if(l<=65535){if(r+2>=o)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63;}else {if(r+3>=o)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63;}}return t[r]=0,r-i},$r=(e,t,r)=>wt(e,L,t,r),Pr=(e,t)=>{};function Lr(e,t,r){return 0}var Mr=(e,t,r,n)=>{};function Ar(e,t,r,n){}var kr=(e,t)=>{},we={},je=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t);}};function le(e){return this.fromWireType(w[e>>2])}var re={},X={},Te={},Tt,Ee=e=>{throw new Tt(e)},N=(e,t,r)=>{e.forEach(function(l){Te[l]=t;});function n(l){var d=r(l);d.length!==e.length&&Ee("Mismatched type converter count");for(var f=0;f<e.length;++f)B(e[f],d[f]);}var i=new Array(t.length),o=[],u=0;t.forEach((l,d)=>{X.hasOwnProperty(l)?i[d]=X[l]:(o.push(l),re.hasOwnProperty(l)||(re[l]=[]),re[l].push(()=>{i[d]=X[l],++u,u===o.length&&n(i);}));}),o.length===0&&n(i);},Rr=e=>{var t=we[e];delete we[e];var r=t.rawConstructor,n=t.rawDestructor,i=t.fields,o=i.map(u=>u.getterReturnType).concat(i.map(u=>u.setterArgumentType));N([e],o,u=>{var l={};return i.forEach((d,f)=>{var v=d.fieldName,m=u[f],h=d.getter,C=d.getterContext,F=u[f+i.length],W=d.setter,S=d.setterContext;l[v]={read:P=>m.fromWireType(h(C,P)),write:(P,c)=>{var p=[];W(S,P,F.toWireType(p,c)),je(p);}};}),[{name:t.name,fromWireType:d=>{var f={};for(var v in l)f[v]=l[v].read(d);return n(d),f},toWireType:(d,f)=>{for(var v in l)if(!(v in f))throw new TypeError(`Missing field: "${v}"`);var m=r();for(v in l)l[v].write(m,f[v]);return d!==null&&d.push(n,m),m},argPackAdvance:H,readValueFromPointer:le,destructorFunction:n}]});},Sr=(e,t,r,n,i)=>{},xr=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Et=e;},Et,M=e=>{for(var t="",r=e;L[r];)t+=Et[L[r++]];return t},ne,y=e=>{throw new ne(e)};function Dr(e,t,r={}){var n=t.name;if(e||y(`type "${n}" must have a positive integer typeid pointer`),X.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;y(`Cannot register type '${n}' twice`);}if(X[e]=t,delete Te[e],re.hasOwnProperty(e)){var i=re[e];delete re[e],i.forEach(o=>o());}}function B(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Dr(e,t,r)}var H=8,Ir=(e,t,r,n)=>{t=M(t),B(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,o){return o?r:n},argPackAdvance:H,readValueFromPointer:function(i){return this.fromWireType(L[i])},destructorFunction:null});},jr=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),We=e=>{function t(r){return r.$$.ptrType.registeredClass.name}y(t(e)+" instance already deleted");},Oe=!1,Ft=e=>{},Wr=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr);},$t=e=>{e.count.value-=1;var t=e.count.value===0;t&&Wr(e);},Pt=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Pt(e,t,r.baseClass);return n===null?null:r.downcast(n)},Lt={},Or=()=>Object.keys(ce).length,Ur=()=>{var e=[];for(var t in ce)ce.hasOwnProperty(t)&&e.push(ce[t]);return e},ue=[],Ue=()=>{for(;ue.length;){var e=ue.pop();e.$$.deleteScheduled=!1,e.delete();}},de,Br=e=>{de=e,ue.length&&de&&de(Ue);},Hr=()=>{s.getInheritedInstanceCount=Or,s.getLiveInheritedInstances=Ur,s.flushPendingDeletes=Ue,s.setDelayFunction=Br;},ce={},Vr=(e,t)=>{for(t===void 0&&y("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},zr=(e,t)=>(t=Vr(e,t),ce[t]),Fe=(e,t)=>{(!t.ptrType||!t.ptr)&&Ee("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Ee("Both smartPtrType and smartPtr must be specified"),t.count={value:1},fe(Object.create(e,{$$:{value:t,writable:!0}}))};function Yr(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=zr(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Fe(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Fe(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Lt[o];if(!u)return i.call(this);var l;this.isConst?l=u.constPointerType:l=u.pointerType;var d=Pt(t,this.registeredClass,l.registeredClass);return d===null?i.call(this):this.isSmartPointer?Fe(l.registeredClass.instancePrototype,{ptrType:l,ptr:d,smartPtrType:this,smartPtr:e}):Fe(l.registeredClass.instancePrototype,{ptrType:l,ptr:d})}var fe=e=>typeof FinalizationRegistry>"u"?(fe=t=>t,e):(Oe=new FinalizationRegistry(t=>{$t(t.$$);}),fe=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var i={$$:r};Oe.register(t,i,t);}return t},Ft=t=>Oe.unregister(t),fe(e)),Nr=()=>{Object.assign($e.prototype,{isAliasOf(e){if(!(this instanceof $e)||!(e instanceof $e))return !1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},clone(){if(this.$$.ptr||We(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=fe(Object.create(Object.getPrototypeOf(this),{$$:{value:jr(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||We(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&y("Object already scheduled for deletion"),Ft(this),$t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0);},isDeleted(){return !this.$$.ptr},deleteLater(){return this.$$.ptr||We(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&y("Object already scheduled for deletion"),ue.push(this),ue.length===1&&de&&de(Ue),this.$$.deleteScheduled=!0,this}});};function $e(){}var ve=(e,t)=>Object.defineProperty(t,"name",{value:e}),Mt=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(...i){return e[t].overloadTable.hasOwnProperty(i.length)||y(`Function '${r}' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[i.length].apply(this,i)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n;}},Be=(e,t,r)=>{s.hasOwnProperty(e)?((r===void 0||s[e].overloadTable!==void 0&&s[e].overloadTable[r]!==void 0)&&y(`Cannot register public name '${e}' twice`),Mt(s,e,e),s.hasOwnProperty(r)&&y(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[e].overloadTable[r]=t):(s[e]=t,r!==void 0&&(s[e].numArguments=r));},qr=48,Gr=57,Xr=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=qr&&t<=Gr?`_${e}`:e};function Jr(e,t,r,n,i,o,u,l){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=o,this.upcast=u,this.downcast=l,this.pureVirtualFunctions=[];}var He=(e,t,r)=>{for(;t!==r;)t.upcast||y(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Kr(e,t){if(t===null)return this.isReference&&y(`null is not a valid ${this.name}`),0;t.$$||y(`Cannot pass "${Ge(t)}" as a ${this.name}`),t.$$.ptr||y(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=He(t.$$.ptr,r,this.registeredClass);return n}function Zr(e,t){var r;if(t===null)return this.isReference&&y(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&y(`Cannot pass "${Ge(t)}" as a ${this.name}`),t.$$.ptr||y(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&y(`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(t.$$.smartPtr===void 0&&y("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:y(`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 i=t.clone();r=this.rawShare(r,J.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,r);}break;default:y("Unsupporting sharing policy");}return r}function Qr(e,t){if(t===null)return this.isReference&&y(`null is not a valid ${this.name}`),0;t.$$||y(`Cannot pass "${Ge(t)}" as a ${this.name}`),t.$$.ptr||y(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&y(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=He(t.$$.ptr,r,this.registeredClass);return n}var en=()=>{Object.assign(pe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e);},argPackAdvance:H,readValueFromPointer:le,fromWireType:Yr});};function pe(e,t,r,n,i,o,u,l,d,f,v){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=l,this.rawConstructor=d,this.rawShare=f,this.rawDestructor=v,!i&&t.baseClass===void 0?n?(this.toWireType=Kr,this.destructorFunction=null):(this.toWireType=Qr,this.destructorFunction=null):this.toWireType=Zr;}var At=(e,t,r)=>{s.hasOwnProperty(e)||Ee("Replacing nonexistent public symbol"),s[e].overloadTable!==void 0&&r!==void 0?s[e].overloadTable[r]=t:(s[e]=t,s[e].argCount=r);},tn=(e,t,r)=>{e=e.replace(/p/g,"i");var n=s["dynCall_"+e];return n(t,...r)},kt,k=e=>kt.get(e),rn=(e,t,r=[])=>{if(e.includes("j"))return tn(e,t,r);var n=k(t)(...r);return n},nn=(e,t)=>(...r)=>rn(e,t,r),j=(e,t)=>{e=M(e);function r(){return e.includes("j")?nn(e,t):k(t)}var n=r();return typeof n!="function"&&y(`unknown function pointer with signature ${e}: ${t}`),n},an=(e,t)=>{var r=ve(t,function(n){this.name=t,this.message=n;var i=new Error(n).stack;i!==void 0&&(this.stack=this.toString()+`
`+i.replace(/^Error(:[^\n]*)?\n/,""));});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Rt,St=e=>{var t=Bt(e),r=M(t);return z(t),r},Pe=(e,t)=>{var r=[],n={};function i(o){if(!n[o]&&!X[o]){if(Te[o]){Te[o].forEach(i);return}r.push(o),n[o]=!0;}}throw t.forEach(i),new Rt(`${e}: `+r.map(St).join([", "]))},on=(e,t,r,n,i,o,u,l,d,f,v,m,h)=>{v=M(v),o=j(i,o),l&&(l=j(u,l)),f&&(f=j(d,f)),h=j(m,h);var C=Xr(v);Be(C,function(){Pe(`Cannot construct ${v} due to unbound types`,[n]);}),N([e,t,r],n?[n]:[],F=>{var Ae;F=F[0];var W,S;n?(W=F.registeredClass,S=W.instancePrototype):S=$e.prototype;var P=ve(v,function(...Ze){if(Object.getPrototypeOf(this)!==c)throw new ne("Use 'new' to construct "+v);if(p.constructor_body===void 0)throw new ne(v+" has no accessible constructor");var Xt=p.constructor_body[Ze.length];if(Xt===void 0)throw new ne(`Tried to invoke ctor of ${v} with invalid number of parameters (${Ze.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return Xt.apply(this,Ze)}),c=Object.create(S,{constructor:{value:P}});P.prototype=c;var p=new Jr(v,P,c,h,W,o,l,f);p.baseClass&&((Ae=p.baseClass).__derivedClasses??(Ae.__derivedClasses=[]),p.baseClass.__derivedClasses.push(p));var x=new pe(v,p,!0,!1,!1),T=new pe(v+"*",p,!1,!1,!1),Y=new pe(v+" const*",p,!1,!0,!1);return Lt[e]={pointerType:T,constPointerType:Y},At(C,P),[x,T,Y]});},Ve=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(w[t+n*4>>2]);return r};function sn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return !0;return !1}function ze(e,t,r,n,i,o){var u=t.length;u<2&&y("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=t[1]!==null&&r!==null,d=sn(t),f=t[0].name!=="void",v=u-2,m=new Array(v),h=[],C=[],F=function(...W){W.length!==v&&y(`function ${e} called with ${W.length} arguments, expected ${v}`),C.length=0;var S;h.length=l?2:1,h[0]=i,l&&(S=t[1].toWireType(C,this),h[1]=S);for(var P=0;P<v;++P)m[P]=t[P+2].toWireType(C,W[P]),h.push(m[P]);var c=n(...h);function p(x){if(d)je(C);else for(var T=l?1:2;T<t.length;T++){var Y=T===1?S:m[T-2];t[T].destructorFunction!==null&&t[T].destructorFunction(Y);}if(f)return t[0].fromWireType(x)}return p(c)};return ve(e,F)}var ln=(e,t,r,n,i,o)=>{var u=Ve(t,r);i=j(n,i),N([],[e],l=>{l=l[0];var d=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[t-1]!==void 0)throw new ne(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[t-1]=()=>{Pe(`Cannot construct ${l.name} due to unbound types`,u);},N([],u,f=>(f.splice(1,0,null),l.registeredClass.constructor_body[t-1]=ze(d,f,null,i,o),[])),[]});},xt=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},un=(e,t,r,n,i,o,u,l,d)=>{var f=Ve(r,n);t=M(t),t=xt(t),o=j(i,o),N([],[e],v=>{v=v[0];var m=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),l&&v.registeredClass.pureVirtualFunctions.push(t);function h(){Pe(`Cannot call ${m} due to unbound types`,f);}var C=v.registeredClass.instancePrototype,F=C[t];return F===void 0||F.overloadTable===void 0&&F.className!==v.name&&F.argCount===r-2?(h.argCount=r-2,h.className=v.name,C[t]=h):(Mt(C,t,m),C[t].overloadTable[r-2]=h),N([],f,W=>{var S=ze(m,W,v,o,u);return C[t].overloadTable===void 0?(S.argCount=r-2,C[t]=S):C[t].overloadTable[r-2]=S,[]}),[]});},Ye=[],V=[],Ne=e=>{e>9&&--V[e+1]===0&&(V[e]=void 0,Ye.push(e));},dn=()=>V.length/2-5-Ye.length,cn=()=>{V.push(0,1,void 0,1,null,1,!0,1,!1,1),s.count_emval_handles=dn;},J={toValue:e=>(e||y("Cannot use deleted val. handle = "+e),V[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Ye.pop()||V.length;return V[t]=e,V[t+1]=1,t}}}},fn={name:"emscripten::val",fromWireType:e=>{var t=J.toValue(e);return Ne(e),t},toWireType:(e,t)=>J.toHandle(t),argPackAdvance:H,readValueFromPointer:le,destructorFunction:null},Dt=e=>B(e,fn),vn=(e,t,r)=>{switch(t){case 1:return r?function(n){return this.fromWireType(O[n])}:function(n){return this.fromWireType(L[n])};case 2:return r?function(n){return this.fromWireType(Q[n>>1])}:function(n){return this.fromWireType(oe[n>>1])};case 4:return r?function(n){return this.fromWireType(A[n>>2])}:function(n){return this.fromWireType(w[n>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},pn=(e,t,r,n)=>{t=M(t);function i(){}i.values={},B(e,{name:t,constructor:i,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,u)=>u.value,argPackAdvance:H,readValueFromPointer:vn(t,r,n),destructorFunction:null}),Be(t,i);},qe=(e,t)=>{var r=X[e];return r===void 0&&y(`${t} has unknown type ${St(e)}`),r},hn=(e,t,r)=>{var n=qe(e,"enum");t=M(t);var i=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ve(`${n.name}_${t}`,function(){})}});i.values[r]=o,i[t]=o;},Ge=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},_n=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(ut[r>>2])};case 8:return function(r){return this.fromWireType(dt[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},mn=(e,t,r)=>{t=M(t),B(e,{name:t,fromWireType:n=>n,toWireType:(n,i)=>i,argPackAdvance:H,readValueFromPointer:_n(t,r),destructorFunction:null});},yn=(e,t,r,n,i,o,u)=>{var l=Ve(t,r);e=M(e),e=xt(e),i=j(n,i),Be(e,function(){Pe(`Cannot call ${e} due to unbound types`,l);},t-1),N([],l,d=>{var f=[d[0],null].concat(d.slice(1));return At(e,ze(e,f,null,i,o),t-1),[]});},gn=(e,t,r)=>{switch(t){case 1:return r?n=>O[n]:n=>L[n];case 2:return r?n=>Q[n>>1]:n=>oe[n>>1];case 4:return r?n=>A[n>>2]:n=>w[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},bn=(e,t,r,n,i)=>{t=M(t);var o=v=>v;if(n===0){var u=32-8*r;o=v=>v<<u>>>u;}var l=t.includes("unsigned"),d=(v,m)=>{},f;l?f=function(v,m){return d(m,this.name),m>>>0}:f=function(v,m){return d(m,this.name),m},B(e,{name:t,fromWireType:o,toWireType:f,argPackAdvance:H,readValueFromPointer:gn(t,r,n!==0),destructorFunction:null});},Cn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=n[t];function o(u){var l=w[u>>2],d=w[u+4>>2];return new i(O.buffer,d,l)}r=M(r),B(e,{name:r,fromWireType:o,argPackAdvance:H,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0});},wn=(e,t)=>{Dt(e);},Tn=(e,t,r,n,i,o,u,l,d,f,v,m)=>{r=M(r),o=j(i,o),l=j(u,l),f=j(d,f),m=j(v,m),N([e],[t],h=>{h=h[0];var C=new pe(r,h.registeredClass,!1,!1,!0,h,n,o,l,f,m);return [C]});},En=(e,t)=>{t=M(t);var r=t==="std::string";B(e,{name:t,fromWireType(n){var i=w[n>>2],o=n+4,u;if(r)for(var l=o,d=0;d<=i;++d){var f=o+d;if(d==i||L[f]==0){var v=f-l,m=G(l,v);u===void 0?u=m:(u+="\0",u+=m),l=f+1;}}else {for(var h=new Array(i),d=0;d<i;++d)h[d]=String.fromCharCode(L[o+d]);u=h.join("");}return z(n),u},toWireType(n,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var o,u=typeof i=="string";u||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||y("Cannot pass non-string to std::string"),r&&u?o=Ct(i):o=i.length;var l=Ke(4+o+1),d=l+4;if(w[l>>2]=o,r&&u)$r(i,d,o+1);else if(u)for(var f=0;f<o;++f){var v=i.charCodeAt(f);v>255&&(z(d),y("String has UTF-16 code units that do not fit in 8 bits")),L[d+f]=v;}else for(var f=0;f<o;++f)L[d+f]=i[f];return n!==null&&n.push(z,l),l},argPackAdvance:H,readValueFromPointer:le,destructorFunction(n){z(n);}});},It=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Fn=(e,t)=>{for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&oe[n];)++n;if(r=n<<1,r-e>32&&It)return It.decode(L.subarray(e,r));for(var o="",u=0;!(u>=t/2);++u){var l=Q[e+u*2>>1];if(l==0)break;o+=String.fromCharCode(l);}return o},$n=(e,t,r)=>{if(r??(r=2147483647),r<2)return 0;r-=2;for(var n=t,i=r<e.length*2?r/2:e.length,o=0;o<i;++o){var u=e.charCodeAt(o);Q[t>>1]=u,t+=2;}return Q[t>>1]=0,t-n},Pn=e=>e.length*2,Ln=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=A[e+r*4>>2];if(i==0)break;if(++r,i>=65536){var o=i-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023);}else n+=String.fromCharCode(i);}return n},Mn=(e,t,r)=>{if(r??(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var l=e.charCodeAt(++o);u=65536+((u&1023)<<10)|l&1023;}if(A[t>>2]=u,t+=4,t+4>i)break}return A[t>>2]=0,t-n},An=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4;}return t},kn=(e,t,r)=>{r=M(r);var n,i,o,u;t===2?(n=Fn,i=$n,u=Pn,o=l=>oe[l>>1]):t===4&&(n=Ln,i=Mn,u=An,o=l=>w[l>>2]),B(e,{name:r,fromWireType:l=>{for(var d=w[l>>2],f,v=l+4,m=0;m<=d;++m){var h=l+4+m*t;if(m==d||o(h)==0){var C=h-v,F=n(v,C);f===void 0?f=F:(f+="\0",f+=F),v=h+t;}}return z(l),f},toWireType:(l,d)=>{typeof d!="string"&&y(`Cannot pass non-string to C++ string type ${r}`);var f=u(d),v=Ke(4+f+t);return w[v>>2]=f/t,i(d,v+4,f+t),l!==null&&l.push(z,v),v},argPackAdvance:H,readValueFromPointer:le,destructorFunction(l){z(l);}});},Rn=(e,t,r,n,i,o)=>{we[e]={name:M(t),rawConstructor:j(r,n),rawDestructor:j(i,o),fields:[]};},Sn=(e,t,r,n,i,o,u,l,d,f)=>{we[e].fields.push({fieldName:M(t),getterReturnType:r,getter:j(n,i),getterContext:o,setterArgumentType:u,setter:j(l,d),setterContext:f});},xn=(e,t)=>{t=M(t),B(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}});},Dn=(e,t,r)=>L.copyWithin(e,t,t+r),In=()=>{throw 1/0},Xe=[],jn=(e,t,r,n)=>(e=Xe[e],t=J.toValue(t),e(null,t,r,n)),Wn=e=>{var t=Xe.length;return Xe.push(e),t},On=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=qe(w[t+n*4>>2],"parameter "+n);return r},Un=Reflect.construct,Bn=(e,t,r)=>{var n=[],i=e.toWireType(n,r);return n.length&&(w[t>>2]=J.toHandle(n)),i},Hn=(e,t,r)=>{var n=On(e,t),i=n.shift();e--;var o=new Array(e),u=(d,f,v,m)=>{for(var h=0,C=0;C<e;++C)o[C]=n[C].readValueFromPointer(m+h),h+=n[C].argPackAdvance;var F=r===1?Un(f,o):f.apply(d,o);return Bn(i,v,F)},l=`methodCaller<(${n.map(d=>d.name).join(", ")}) => ${i.name}>`;return Wn(ve(l,u))},Vn=e=>{e>9&&(V[e+1]+=1);},zn=e=>{var t=J.toValue(e);je(t),Ne(e);},Yn=(e,t)=>{e=qe(e,"_emval_take_value");var r=e.readValueFromPointer(t);return J.toHandle(r)},Nn=()=>{be("");},jt;jt=()=>performance.now();var qn=()=>2147483648,Gn=e=>{var t=ge.buffer,r=(e-t.byteLength+65535)/65536;try{return ge.grow(r),ct(),1}catch{}},Xn=e=>{var t=L.length;e>>>=0;var r=qn();if(e>r)return !1;for(var n=(d,f)=>d+(f-d%f)%f,i=1;i<=4;i*=2){var o=t*(1+.2/i);o=Math.min(o,e+100663296);var u=Math.min(r,n(Math.max(e,o),65536)),l=Gn(u);if(l)return !0}return !1},Je={},Jn=()=>ot||"./this.program",he=()=>{if(!he.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Jn()};for(var r in Je)Je[r]===void 0?delete t[r]:t[r]=Je[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);he.strings=n;}return he.strings},Kn=(e,t)=>{for(var r=0;r<e.length;++r)O[t++]=e.charCodeAt(r);O[t]=0;},Zn=(e,t)=>{var r=0;return he().forEach((n,i)=>{var o=t+r;w[e+i*4>>2]=o,Kn(n,o),r+=n.length+1;}),0},Qn=(e,t)=>{var r=he();w[e>>2]=r.length;var n=0;return r.forEach(i=>n+=i.length+1),w[t>>2]=n,0},ei=e=>52,ti=(e,t,r,n)=>52;function ni(e,t,r,n,i){return 70}var ii=[null,[],[]],ai=(e,t)=>{var r=ii[e];t===0||t===10?((e===1?nr:Z)(gt(r,0)),r.length=0):r.push(t);},oi=(e,t,r,n)=>{for(var i=0,o=0;o<r;o++){var u=w[t>>2],l=w[t+4>>2];t+=8;for(var d=0;d<l;d++)ai(e,L[u+d]);i+=l;}return w[n>>2]=i,0},si=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);be("initRandomDevice");},Wt=e=>(Wt=si())(e),li=(e,t)=>(Wt(L.subarray(e,e+t)),0),Le=e=>e%4===0&&(e%100!==0||e%400===0),ui=(e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r},Ot=[31,29,31,30,31,30,31,31,30,31,30,31],Ut=[31,28,31,30,31,30,31,31,30,31,30,31],di=(e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Le(r.getFullYear()),i=r.getMonth(),o=(n?Ot:Ut)[i];if(t>o-r.getDate())t-=o-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+t),r}return r};function ci(e,t,r){var n=r>0?r:Ct(e)+1,i=new Array(n),o=wt(e,i,0,i.length);return t&&(i.length=o),i}var fi=(e,t)=>{O.set(e,t);},vi=(e,t,r,n)=>{var i=w[n+40>>2],o={tm_sec:A[n>>2],tm_min:A[n+4>>2],tm_hour:A[n+8>>2],tm_mday:A[n+12>>2],tm_mon:A[n+16>>2],tm_year:A[n+20>>2],tm_wday:A[n+24>>2],tm_yday:A[n+28>>2],tm_isdst:A[n+32>>2],tm_gmtoff:A[n+36>>2],tm_zone:i?G(i):""},u=G(r),l={"%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 d in l)u=u.replace(new RegExp(d,"g"),l[d]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(c,p,x){for(var T=typeof c=="number"?c.toString():c||"";T.length<p;)T=x[0]+T;return T}function h(c,p){return m(c,p,"0")}function C(c,p){function x(Y){return Y<0?-1:Y>0?1:0}var T;return (T=x(c.getFullYear()-p.getFullYear()))===0&&(T=x(c.getMonth()-p.getMonth()))===0&&(T=x(c.getDate()-p.getDate())),T}function F(c){switch(c.getDay()){case 0:return new Date(c.getFullYear()-1,11,29);case 1:return c;case 2:return new Date(c.getFullYear(),0,3);case 3:return new Date(c.getFullYear(),0,2);case 4:return new Date(c.getFullYear(),0,1);case 5:return new Date(c.getFullYear()-1,11,31);case 6:return new Date(c.getFullYear()-1,11,30)}}function W(c){var p=di(new Date(c.tm_year+1900,0,1),c.tm_yday),x=new Date(p.getFullYear(),0,4),T=new Date(p.getFullYear()+1,0,4),Y=F(x),Ae=F(T);return C(Y,p)<=0?C(Ae,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var S={"%a":c=>f[c.tm_wday].substring(0,3),"%A":c=>f[c.tm_wday],"%b":c=>v[c.tm_mon].substring(0,3),"%B":c=>v[c.tm_mon],"%C":c=>{var p=c.tm_year+1900;return h(p/100|0,2)},"%d":c=>h(c.tm_mday,2),"%e":c=>m(c.tm_mday,2," "),"%g":c=>W(c).toString().substring(2),"%G":W,"%H":c=>h(c.tm_hour,2),"%I":c=>{var p=c.tm_hour;return p==0?p=12:p>12&&(p-=12),h(p,2)},"%j":c=>h(c.tm_mday+ui(Le(c.tm_year+1900)?Ot:Ut,c.tm_mon-1),3),"%m":c=>h(c.tm_mon+1,2),"%M":c=>h(c.tm_min,2),"%n":()=>`
`,"%p":c=>c.tm_hour>=0&&c.tm_hour<12?"AM":"PM","%S":c=>h(c.tm_sec,2),"%t":()=>" ","%u":c=>c.tm_wday||7,"%U":c=>{var p=c.tm_yday+7-c.tm_wday;return h(Math.floor(p/7),2)},"%V":c=>{var p=Math.floor((c.tm_yday+7-(c.tm_wday+6)%7)/7);if((c.tm_wday+371-c.tm_yday-2)%7<=2&&p++,p){if(p==53){var T=(c.tm_wday+371-c.tm_yday)%7;T!=4&&(T!=3||!Le(c.tm_year))&&(p=1);}}else {p=52;var x=(c.tm_wday+7-c.tm_yday-1)%7;(x==4||x==5&&Le(c.tm_year%400-1))&&p++;}return h(p,2)},"%w":c=>c.tm_wday,"%W":c=>{var p=c.tm_yday+7-(c.tm_wday+6)%7;return h(Math.floor(p/7),2)},"%y":c=>(c.tm_year+1900).toString().substring(2),"%Y":c=>c.tm_year+1900,"%z":c=>{var p=c.tm_gmtoff,x=p>=0;return p=Math.abs(p)/60,p=p/60*100+p%60,(x?"+":"-")+("0000"+p).slice(-4)},"%Z":c=>c.tm_zone,"%%":()=>"%"};u=u.replace(/%%/g,"\0\0");for(var d in S)u.includes(d)&&(u=u.replace(new RegExp(d,"g"),S[d](o)));u=u.replace(/\0\0/g,"%");var P=ci(u,!1);return P.length>t?0:(fi(P,e),P.length-1)},pi=(e,t,r,n,i)=>vi(e,t,r,n);Tt=s.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError";}},xr(),ne=s.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError";}},Nr(),Hr(),en(),Rt=s.UnboundTypeError=an(Error,"UnboundTypeError"),cn();var hi={c:yr,d:Cr,q:Tr,h:gr,E:Er,W:Fr,T:Pr,X:Lr,U:Mr,D:Ar,V:kr,A:Rr,O:Sr,ea:Ir,z:on,x:ln,i:un,da:Dt,B:pn,n:hn,I:mn,K:yn,p:bn,k:Cn,L:wn,ka:Tn,J:En,y:kn,u:Rn,m:Sn,fa:xn,Y:Dn,P:In,ia:jn,R:Ne,ha:Hn,ja:Vn,ga:zn,t:Yn,ca:Nn,l:jt,S:Xn,Z:Zn,_:Qn,w:ei,C:ti,N:ni,v:oi,$:li,F:Vi,j:Ii,g:Di,e:Hi,ba:Ri,s:Bi,G:Oi,r:Wi,b:ki,a:Si,f:xi,o:Ui,H:ji,aa:zi,M:Yi,Q:pi},b=mr(),Ke=e=>(Ke=b.na)(e),Bt=e=>(Bt=b.oa)(e),z=e=>(z=b.qa)(e),R=(e,t)=>(R=b.ra)(e,t),Ht=e=>(Ht=b.sa)(e),Vt=e=>(Vt=b.ta)(e),zt=()=>(zt=b.ua)(),Yt=(e,t,r)=>(Yt=b.va)(e,t,r),Nt=e=>(Nt=b.wa)(e);s.dynCall_iijj=(e,t,r,n,i,o)=>(s.dynCall_iijj=b.xa)(e,t,r,n,i,o);s.dynCall_vijj=(e,t,r,n,i,o)=>(s.dynCall_vijj=b.ya)(e,t,r,n,i,o);s.dynCall_jiii=(e,t,r,n)=>(s.dynCall_jiii=b.za)(e,t,r,n);s.dynCall_jii=(e,t,r)=>(s.dynCall_jii=b.Aa)(e,t,r);var qt=s.dynCall_viiij=(e,t,r,n,i,o)=>(qt=s.dynCall_viiij=b.Ba)(e,t,r,n,i,o);s.dynCall_jiji=(e,t,r,n,i)=>(s.dynCall_jiji=b.Ca)(e,t,r,n,i);s.dynCall_viijii=(e,t,r,n,i,o,u)=>(s.dynCall_viijii=b.Da)(e,t,r,n,i,o,u);s.dynCall_iiiiij=(e,t,r,n,i,o,u)=>(s.dynCall_iiiiij=b.Ea)(e,t,r,n,i,o,u);s.dynCall_iiiiijj=(e,t,r,n,i,o,u,l,d)=>(s.dynCall_iiiiijj=b.Fa)(e,t,r,n,i,o,u,l,d);s.dynCall_iiiiiijj=(e,t,r,n,i,o,u,l,d,f)=>(s.dynCall_iiiiiijj=b.Ga)(e,t,r,n,i,o,u,l,d,f);function ki(e,t){var r=I();try{k(e)(t);}catch(n){if(D(r),n!==n+0)throw n;R(1,0);}}function Ri(e,t,r,n,i){var o=I();try{return k(e)(t,r,n,i)}catch(u){if(D(o),u!==u+0)throw u;R(1,0);}}function Si(e,t,r){var n=I();try{k(e)(t,r);}catch(i){if(D(n),i!==i+0)throw i;R(1,0);}}function xi(e,t,r,n){var i=I();try{k(e)(t,r,n);}catch(o){if(D(i),o!==o+0)throw o;R(1,0);}}function Di(e,t,r){var n=I();try{return k(e)(t,r)}catch(i){if(D(n),i!==i+0)throw i;R(1,0);}}function Ii(e,t){var r=I();try{return k(e)(t)}catch(n){if(D(r),n!==n+0)throw n;R(1,0);}}function ji(e,t,r,n,i,o){var u=I();try{k(e)(t,r,n,i,o);}catch(l){if(D(u),l!==l+0)throw l;R(1,0);}}function Wi(e){var t=I();try{k(e)();}catch(r){if(D(t),r!==r+0)throw r;R(1,0);}}function Oi(e,t,r,n,i,o,u,l){var d=I();try{return k(e)(t,r,n,i,o,u,l)}catch(f){if(D(d),f!==f+0)throw f;R(1,0);}}function Ui(e,t,r,n,i){var o=I();try{k(e)(t,r,n,i);}catch(u){if(D(o),u!==u+0)throw u;R(1,0);}}function Bi(e,t,r,n,i,o){var u=I();try{return k(e)(t,r,n,i,o)}catch(l){if(D(u),l!==l+0)throw l;R(1,0);}}function Hi(e,t,r,n){var i=I();try{return k(e)(t,r,n)}catch(o){if(D(i),o!==o+0)throw o;R(1,0);}}function Vi(e){var t=I();try{return k(e)()}catch(r){if(D(t),r!==r+0)throw r;R(1,0);}}function zi(e,t,r,n,i,o,u){var l=I();try{k(e)(t,r,n,i,o,u);}catch(d){if(D(l),d!==d+0)throw d;R(1,0);}}function Yi(e,t,r,n,i,o){var u=I();try{qt(e,t,r,n,i,o);}catch(l){if(D(u),l!==l+0)throw l;R(1,0);}}var Me;se=function e(){Me||Gt(),Me||(se=e);};function Gt(){if(q>0||(or(),q>0))return;function e(){Me||(Me=!0,s.calledRun=!0,!lt&&(sr(),_(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),lr()));}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("");},1),e();},1)):e();}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Gt(),ie}})(),Jt=Xi;var K=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(a){return await Jt({locateFile:()=>a})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async a=>{let s=`https://unpkg.com/${_e.name}@${_e.version}/dist/dotlottie-player.wasm`;console.warn(`Trying backup URL for WASM loading: ${s}`);try{return await this._tryLoad(s)}catch(_){throw console.error(`Both primary and backup WASM URLs failed. Primary error: ${a.message}, Backup error: ${_.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(a){this._wasmURL=a,this._ModulePromise=null;}};$(K,"_ModulePromise",null),$(K,"_wasmURL",`https://cdn.jsdelivr.net/npm/${_e.name}@${_e.version}/dist/dotlottie-player.wasm`);var Re=class{constructor(){$(this,"_eventListeners",new Map);}addEventListener(a,s){let _=this._eventListeners.get(a);_||(_=new Set,this._eventListeners.set(a,_)),_.add(s);}removeEventListener(a,s){let _=this._eventListeners.get(a);_&&(s?(_.delete(s),_.size===0&&this._eventListeners.delete(a)):this._eventListeners.delete(a));}dispatch(a){this._eventListeners.get(a.type)?.forEach(_=>_(a));}removeAllEventListeners(){this._eventListeners.clear();}};var rt=(g,a)=>g==="reverse"?a.Mode.Reverse:g==="bounce"?a.Mode.Bounce:g==="reverse-bounce"?a.Mode.ReverseBounce:a.Mode.Forward,nt=(g,a)=>g==="contain"?a.Fit.Contain:g==="cover"?a.Fit.Cover:g==="fill"?a.Fit.Fill:g==="fit-height"?a.Fit.FitHeight:g==="fit-width"?a.Fit.FitWidth:a.Fit.None,it=(g,a)=>{let s=new a.VectorFloat;return s.push_back(g[0]),s.push_back(g[1]),s},at=(g,a)=>{let s=new a.VectorFloat;return g.length!==2||(s.push_back(g[0]),s.push_back(g[1])),s},Kt=class{constructor(a){$(this,"_canvas");$(this,"_context");$(this,"_eventManager");$(this,"_animationFrameId",null);$(this,"_frameManager");$(this,"_dotLottieCore",null);$(this,"_wasmModule",null);$(this,"_renderConfig",{});$(this,"_isFrozen",!1);$(this,"_backgroundColor",null);this._canvas=a.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new Re,this._frameManager=new ke,this._renderConfig=a.renderConfig??{},K.load().then(s=>{this._wasmModule=s,this._dotLottieCore=new s.DotLottiePlayer({autoplay:a.autoplay??!1,backgroundColor:0,loopAnimation:a.loop??!1,mode:rt(a.mode??"forward",s),segment:at(a.segment??[],s),speed:a.speed??1,useFrameInterpolation:a.useFrameInterpolation??!0,marker:a.marker??"",layout:a.layout?{align:it(a.layout.align,s),fit:nt(a.layout.fit,s)}:s.createDefaultLayout()}),a.data?this._loadFromData(a.data):a.src&&this._loadFromSrc(a.src),a.backgroundColor&&this.setBackgroundColor(a.backgroundColor);}).catch(s=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${s}`)});});}_loadFromSrc(a){async function s(){let _=await fetch(a);if(!_.ok)throw new Error(`Failed to fetch the animation data from URL: ${a}. ${_.status}: ${_.statusText}`);let E=(_.headers.get("content-type")??"").trim(),ie;return ["application/json","text/plain"].some(me=>E.startsWith(me))?ie=await _.text():ie=await _.arrayBuffer(),ie}s().then(_=>{this._loadFromData(_);}).catch(_=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load animation data from URL: ${a}. ${_}`)});});}_loadFromData(a){if(this._dotLottieCore===null)return;let s=this._canvas.width,_=this._canvas.height,E=!1;if(typeof a=="string")E=this._dotLottieCore.loadAnimationData(a,s,_);else if(a instanceof ArrayBuffer)E=this._dotLottieCore.loadDotLottieData(a,s,_);else if(typeof a=="object")E=this._dotLottieCore.loadAnimationData(JSON.stringify(a),s,_);else {this._eventManager.dispatch({type:"loadError",error:new Error("Unsupported data type for animation data. Expected a string or ArrayBuffer.")});return}E?(this._eventManager.dispatch({type:"load"}),tt&&this.resize(),this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._dotLottieCore.config().autoplay&&(this._dotLottieCore.play(),this._dotLottieCore.isPlaying()?(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this))):console.error("something went wrong, the animation was suppose to autoplay"))):this._eventManager.dispatch({type:"loadError",error:new Error("Failed to load animation data")});}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let a=this._dotLottieCore?.config().layout;if(a)return {align:[a.align.get(0),a.align.get(1)],fit:(()=>{switch(a.fit){case this._wasmModule?.Fit.Contain:return "contain";case this._wasmModule?.Fit.Cover:return "cover";case this._wasmModule?.Fit.Fill:return "fill";case this._wasmModule?.Fit.FitHeight:return "fit-height";case this._wasmModule?.Fit.FitWidth:return "fit-width";case this._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let a=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!a)return null;let s=JSON.parse(a);return Object.keys(s).length===0?null:s}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let a=this._dotLottieCore?.config().segment;if(a&&a.size()===2)return [a.get(0),a.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let a=this._dotLottieCore?.config().mode;return a===this._wasmModule?.Mode.Reverse?"reverse":a===this._wasmModule?.Mode.Bounce?"bounce":a===this._wasmModule?.Mode.ReverseBounce?"reverse-bounce":"forward"}get isFrozen(){return this._isFrozen}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.config().autoplay??!1}get useFrameInterpolation(){return this._dotLottieCore?.config().useFrameInterpolation??!1}get speed(){return this._dotLottieCore?.config().speed??0}get isLoaded(){return this._dotLottieCore?.isLoaded()??!1}get isPlaying(){return this._dotLottieCore?.isPlaying()??!1}get isPaused(){return this._dotLottieCore?.isPaused()??!1}get isStopped(){return this._dotLottieCore?.isStopped()??!1}get currentFrame(){return this._dotLottieCore?.currentFrame()??0}get loopCount(){return this._dotLottieCore?.loopCount()??0}get totalFrames(){return this._dotLottieCore?.totalFrames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segmentDuration()??0}load(a){this._dotLottieCore===null||this._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:a.autoplay??!1,backgroundColor:0,loopAnimation:a.loop??!1,mode:rt(a.mode??"forward",this._wasmModule),segment:at(a.segment??[],this._wasmModule),speed:a.speed??1,useFrameInterpolation:a.useFrameInterpolation??!0,marker:a.marker??"",layout:a.layout?{align:it(a.layout.align,this._wasmModule),fit:nt(a.layout.fit,this._wasmModule)}:this._wasmModule.createDefaultLayout()}),a.data?this._loadFromData(a.data):a.src&&this._loadFromSrc(a.src),this.setBackgroundColor(a.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let s=this._dotLottieCore.buffer(),_=new Uint8ClampedArray(s,0,this._canvas.width*this._canvas.height*4),E=null;return typeof ImageData>"u"?(E=this._context.createImageData(this._canvas.width,this._canvas.height),E.data.set(_)):E=new ImageData(_,this._canvas.width,this._canvas.height),this._context.putImageData(E,0,0),this._eventManager.dispatch({type:"render",currentFrame:this._dotLottieCore.currentFrame()}),!0}return !1}_draw(){if(this._dotLottieCore===null||this._context===null||!this._dotLottieCore.isPlaying())return;let a=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(a)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render()&&this._dotLottieCore.isComplete()&&(this._dotLottieCore.config().loopAnimation?this._eventManager.dispatch({type:"loop",loopCount:this._dotLottieCore.loopCount()}):this._eventManager.dispatch({type:"complete"}))),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this));}play(){if(this._dotLottieCore===null)return;let a=this._dotLottieCore.play();this._isFrozen=!1,a&&(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)));}pause(){if(this._dotLottieCore===null)return;this._dotLottieCore.pause()&&this._eventManager.dispatch({type:"pause"});}stop(){if(this._dotLottieCore===null)return;this._dotLottieCore.stop()&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._eventManager.dispatch({type:"stop"}));}setFrame(a){if(this._dotLottieCore===null||a<0||a>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(a)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:a});}setBackgroundColor(a){this._dotLottieCore!==null&&(this._canvas instanceof HTMLCanvasElement&&(this._canvas.style.backgroundColor=a),this._backgroundColor=a);}setLoop(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:a});}setUseFrameInterpolation(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:a});}addEventListener(a,s){this._eventManager.addEventListener(a,s);}removeEventListener(a,s){this._eventManager.removeEventListener(a,s);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners();}freeze(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null,this._isFrozen=!0,this._eventManager.dispatch({type:"freeze"}));}unfreeze(){this._animationFrameId===null&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)),this._isFrozen=!1,this._eventManager.dispatch({type:"unfreeze"}));}resize(){if(!tt||!(this._canvas instanceof HTMLCanvasElement))return;let a=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:s,width:_}=this._canvas.getBoundingClientRect();this._canvas.width=_*a,this._canvas.height=s*a,this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(a,s){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:at([a,s],this._wasmModule)});}setMode(a){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:rt(a,this._wasmModule)});}setRenderConfig(a){this._renderConfig=a;}loadAnimation(a){if(this._dotLottieCore===null)return;this._dotLottieCore.loadAnimation(a,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${a}`)});}setMarker(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:a});}markers(){let a=this._dotLottieCore?.markers();if(a){let s=[];for(let _=0;_<a.size();_+=1){let E=a.get(_);s.push({name:E.name,time:E.time,duration:E.duration});}return s}return []}loadTheme(a){return this._dotLottieCore===null?!1:this._dotLottieCore.loadTheme(a)}loadThemeData(a){return this._dotLottieCore===null?!1:this._dotLottieCore.loadThemeData(a)}setLayout(a){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:it(a.align,this._wasmModule),fit:nt(a.fit,this._wasmModule)}});}setViewport(a,s,_,E){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(a,s,_,E)}static setWasmUrl(a){K.setWasmUrl(a);}};
var Ni=Object.defineProperty;var qi=(g,a,o)=>a in g?Ni(g,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):g[a]=o;var $=(g,a,o)=>(qi(g,typeof a!="symbol"?a+"":a,o),o);var Qe=class{requestAnimationFrame(a){return requestAnimationFrame(a)}cancelAnimationFrame(a){cancelAnimationFrame(a);}},et=class{constructor(){$(this,"_lastHandleId",0);$(this,"_lastImmediate",null);}requestAnimationFrame(a){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{a(Date.now());}),this._lastHandleId}cancelAnimationFrame(a){this._lastImmediate&&clearImmediate(this._lastImmediate);}},ke=class{constructor(){$(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Qe:new et;}requestAnimationFrame(a){return this._strategy.requestAnimationFrame(a)}cancelAnimationFrame(a){this._strategy.cancelAnimationFrame(a);}};var tt=typeof window<"u"&&typeof window.document<"u";var _e={name:"@lottiefiles/dotlottie-web",version:"0.23.1",type:"module",description:"Lottie and DotLottie player for the web",repository:{type:"git",url:"git+https://github.com/LottieFiles/dotlottie-web.git",directory:"packages/web"},homepage:"https://github.com/LottieFiles/dotlottie-web#readme",bugs:"https://github.com/LottieFiles/dotlottie-web/issues",author:"LottieFiles",contributors:["Abdelrahman Ashraf <a.theashraf@gmail.com>"],license:"MIT",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:["dotlottie","lottie","player","animation","web","canvas","javascript","thorvg"],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint --fix .","stats:eslint":"cross-env TIMING=1 eslint .","stats:ts":"tsc -p tsconfig.build.json --extendedDiagnostics",test:"vitest run --browser.headless","test:coverage":"vitest run --browser.headless --coverage","test:watch":"vitest","type-check":"tsc --noEmit"},devDependencies:{"@types/node":"^20.10.5","@vitest/browser":"^1.2.2 ","@vitest/coverage-istanbul":"^1.2.2","cross-env":"7.0.3",tsup:"8.0.1",typescript:"5.0.4",vitest:"^1.2.2",webdriverio:"^8.32.0"},publishConfig:{access:"public"}};var Xi=(()=>{var g=typeof document<"u"?document.currentScript?.src:void 0;return function(a={}){var o=a,_,E,ie=new Promise((e,t)=>{_=e,E=t;}),me=Object.assign({},o),ot="./this.program",st=!0,U="";function er(e){return o.locateFile?o.locateFile(e,U):U+e}(typeof document<"u"&&document.currentScript&&(U=document.currentScript.src),g&&(U=g),U.startsWith("blob:")?U="":U=U.substr(0,U.replace(/[?#].*/,"").lastIndexOf("/")+1),(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(n.status==200||n.status==0&&n.response){t(n.response);return}r();},n.onerror=r,n.send(null);});var nr=o.print||console.log.bind(console),Z=o.printErr||console.error.bind(console);Object.assign(o,me),me=null,o.arguments&&(o.arguments),o.thisProgram&&(ot=o.thisProgram),o.quit&&(o.quit);var ae;o.wasmBinary&&(ae=o.wasmBinary);var ge,lt=!1,O,L,Q,oe,A,w,ut,dt;function ct(){var e=ge.buffer;o.HEAP8=O=new Int8Array(e),o.HEAP16=Q=new Int16Array(e),o.HEAPU8=L=new Uint8Array(e),o.HEAPU16=oe=new Uint16Array(e),o.HEAP32=A=new Int32Array(e),o.HEAPU32=w=new Uint32Array(e),o.HEAPF32=ut=new Float32Array(e),o.HEAPF64=dt=new Float64Array(e);}var ft=[],vt=[],pt=[];function or(){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)ur(o.preRun.shift());De(ft);}function sr(){De(vt);}function lr(){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)cr(o.postRun.shift());De(pt);}function ur(e){ft.unshift(e);}function dr(e){vt.unshift(e);}function cr(e){pt.unshift(e);}var q=0,se=null;function fr(e){q++,o.monitorRunDependencies?.(q);}function vr(e){if(q--,o.monitorRunDependencies?.(q),q==0&&(se)){var t=se;se=null,t();}}function be(e){o.onAbort?.(e),e="Aborted("+e+")",Z(e),lt=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw E(t),t}var pr="data:application/octet-stream;base64,",ht=e=>e.startsWith(pr),ee;ee="DotLottiePlayer.wasm",ht(ee)||(ee=er(ee));function _t(e){if(e==ee&&ae)return new Uint8Array(ae);throw "both async and sync fetching of the wasm failed"}function hr(e){return !ae&&(st)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>_t(e)):Promise.resolve().then(()=>_t(e))}function mt(e,t,r){return hr(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{Z(`failed to asynchronously prepare wasm: ${n}`),be(n);})}function _r(e,t,r,n){return !e&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(i=>{var s=WebAssembly.instantiateStreaming(i,r);return s.then(n,function(u){return Z(`wasm streaming compile failed: ${u}`),Z("falling back to ArrayBuffer instantiation"),mt(t,r,n)})}):mt(t,r,n)}function mr(){var e={a:hi};function t(n,i){return b=n.exports,ge=b.la,ct(),kt=b.pa,dr(b.ma),vr(),b}fr();function r(n){t(n.instance);}if(o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(n){Z(`Module.instantiateWasm callback failed with error: ${n}`),E(n);}return _r(ae,ee,e,r).catch(E),{}}var De=e=>{for(;e.length>0;)e.shift()(o);};o.noExitRuntime||!0;var D=e=>Vt(e),I=()=>zt(),yt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,gt=(e,t,r)=>{for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&yt)return yt.decode(e.subarray(t,i));for(var s="";t<i;){var u=e[t++];if(!(u&128)){s+=String.fromCharCode(u);continue}var l=e[t++]&63;if((u&224)==192){s+=String.fromCharCode((u&31)<<6|l);continue}var d=e[t++]&63;if((u&240)==224?u=(u&15)<<12|l<<6|d:u=(u&7)<<18|l<<12|d<<6|e[t++]&63,u<65536)s+=String.fromCharCode(u);else {var f=u-65536;s+=String.fromCharCode(55296|f>>10,56320|f&1023);}}return s},G=(e,t)=>e?gt(L,e,t):"",yr=(e,t,r,n)=>{be(`Assertion failed: ${G(e)}, at: `+[t?G(t):"unknown filename",r,n?G(n):"unknown function"]);},te=0;class bt{constructor(t){this.excPtr=t,this.ptr=t-24;}set_type(t){w[this.ptr+4>>2]=t;}get_type(){return w[this.ptr+4>>2]}set_destructor(t){w[this.ptr+8>>2]=t;}get_destructor(){return w[this.ptr+8>>2]}set_caught(t){t=t?1:0,O[this.ptr+12]=t;}get_caught(){return O[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,O[this.ptr+13]=t;}get_rethrown(){return O[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r);}set_adjusted_ptr(t){w[this.ptr+16>>2]=t;}get_adjusted_ptr(){return w[this.ptr+16>>2]}get_exception_ptr(){var t=Nt(this.get_type());if(t)return w[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var gr=e=>{throw te||(te=e),te},Ce=e=>Ht(e),br=e=>{var t=te;if(!t)return Ce(0),0;var r=new bt(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ce(0),t;for(var i in e){var s=e[i];if(s===0||s===n)break;var u=r.ptr+16;if(Yt(s,n,u))return Ce(s),t}return Ce(n),t},Cr=()=>br([]),Tr=(e,t,r)=>{var n=new bt(e);throw n.init(t,r),te=e,te};function Er(e,t,r){return 0}var Fr=(e,t)=>{},Ct=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},wt=(e,t,r,n)=>{if(!(n>0))return 0;for(var i=r,s=r+n-1,u=0;u<e.length;++u){var l=e.charCodeAt(u);if(l>=55296&&l<=57343){var d=e.charCodeAt(++u);l=65536+((l&1023)<<10)|d&1023;}if(l<=127){if(r>=s)break;t[r++]=l;}else if(l<=2047){if(r+1>=s)break;t[r++]=192|l>>6,t[r++]=128|l&63;}else if(l<=65535){if(r+2>=s)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63;}else {if(r+3>=s)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63;}}return t[r]=0,r-i},$r=(e,t,r)=>wt(e,L,t,r),Pr=(e,t)=>{};function Lr(e,t,r){return 0}var Mr=(e,t,r,n)=>{};function Ar(e,t,r,n){}var kr=(e,t)=>{},we={},je=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t);}};function le(e){return this.fromWireType(w[e>>2])}var re={},X={},Te={},Tt,Ee=e=>{throw new Tt(e)},N=(e,t,r)=>{e.forEach(function(l){Te[l]=t;});function n(l){var d=r(l);d.length!==e.length&&Ee("Mismatched type converter count");for(var f=0;f<e.length;++f)B(e[f],d[f]);}var i=new Array(t.length),s=[],u=0;t.forEach((l,d)=>{X.hasOwnProperty(l)?i[d]=X[l]:(s.push(l),re.hasOwnProperty(l)||(re[l]=[]),re[l].push(()=>{i[d]=X[l],++u,u===s.length&&n(i);}));}),s.length===0&&n(i);},Rr=e=>{var t=we[e];delete we[e];var r=t.rawConstructor,n=t.rawDestructor,i=t.fields,s=i.map(u=>u.getterReturnType).concat(i.map(u=>u.setterArgumentType));N([e],s,u=>{var l={};return i.forEach((d,f)=>{var v=d.fieldName,m=u[f],h=d.getter,C=d.getterContext,F=u[f+i.length],W=d.setter,S=d.setterContext;l[v]={read:P=>m.fromWireType(h(C,P)),write:(P,c)=>{var p=[];W(S,P,F.toWireType(p,c)),je(p);}};}),[{name:t.name,fromWireType:d=>{var f={};for(var v in l)f[v]=l[v].read(d);return n(d),f},toWireType:(d,f)=>{for(var v in l)if(!(v in f))throw new TypeError(`Missing field: "${v}"`);var m=r();for(v in l)l[v].write(m,f[v]);return d!==null&&d.push(n,m),m},argPackAdvance:H,readValueFromPointer:le,destructorFunction:n}]});},Sr=(e,t,r,n,i)=>{},xr=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Et=e;},Et,M=e=>{for(var t="",r=e;L[r];)t+=Et[L[r++]];return t},ne,y=e=>{throw new ne(e)};function Dr(e,t,r={}){var n=t.name;if(e||y(`type "${n}" must have a positive integer typeid pointer`),X.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;y(`Cannot register type '${n}' twice`);}if(X[e]=t,delete Te[e],re.hasOwnProperty(e)){var i=re[e];delete re[e],i.forEach(s=>s());}}function B(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Dr(e,t,r)}var H=8,Ir=(e,t,r,n)=>{t=M(t),B(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,s){return s?r:n},argPackAdvance:H,readValueFromPointer:function(i){return this.fromWireType(L[i])},destructorFunction:null});},jr=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),We=e=>{function t(r){return r.$$.ptrType.registeredClass.name}y(t(e)+" instance already deleted");},Oe=!1,Ft=e=>{},Wr=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr);},$t=e=>{e.count.value-=1;var t=e.count.value===0;t&&Wr(e);},Pt=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Pt(e,t,r.baseClass);return n===null?null:r.downcast(n)},Lt={},Or=()=>Object.keys(ce).length,Ur=()=>{var e=[];for(var t in ce)ce.hasOwnProperty(t)&&e.push(ce[t]);return e},ue=[],Ue=()=>{for(;ue.length;){var e=ue.pop();e.$$.deleteScheduled=!1,e.delete();}},de,Br=e=>{de=e,ue.length&&de&&de(Ue);},Hr=()=>{o.getInheritedInstanceCount=Or,o.getLiveInheritedInstances=Ur,o.flushPendingDeletes=Ue,o.setDelayFunction=Br;},ce={},Vr=(e,t)=>{for(t===void 0&&y("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},zr=(e,t)=>(t=Vr(e,t),ce[t]),Fe=(e,t)=>{(!t.ptrType||!t.ptr)&&Ee("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Ee("Both smartPtrType and smartPtr must be specified"),t.count={value:1},fe(Object.create(e,{$$:{value:t,writable:!0}}))};function Yr(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=zr(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Fe(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Fe(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s=this.registeredClass.getActualType(t),u=Lt[s];if(!u)return i.call(this);var l;this.isConst?l=u.constPointerType:l=u.pointerType;var d=Pt(t,this.registeredClass,l.registeredClass);return d===null?i.call(this):this.isSmartPointer?Fe(l.registeredClass.instancePrototype,{ptrType:l,ptr:d,smartPtrType:this,smartPtr:e}):Fe(l.registeredClass.instancePrototype,{ptrType:l,ptr:d})}var fe=e=>typeof FinalizationRegistry>"u"?(fe=t=>t,e):(Oe=new FinalizationRegistry(t=>{$t(t.$$);}),fe=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var i={$$:r};Oe.register(t,i,t);}return t},Ft=t=>Oe.unregister(t),fe(e)),Nr=()=>{Object.assign($e.prototype,{isAliasOf(e){if(!(this instanceof $e)||!(e instanceof $e))return !1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},clone(){if(this.$$.ptr||We(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=fe(Object.create(Object.getPrototypeOf(this),{$$:{value:jr(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||We(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&y("Object already scheduled for deletion"),Ft(this),$t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0);},isDeleted(){return !this.$$.ptr},deleteLater(){return this.$$.ptr||We(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&y("Object already scheduled for deletion"),ue.push(this),ue.length===1&&de&&de(Ue),this.$$.deleteScheduled=!0,this}});};function $e(){}var ve=(e,t)=>Object.defineProperty(t,"name",{value:e}),Mt=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(...i){return e[t].overloadTable.hasOwnProperty(i.length)||y(`Function '${r}' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[i.length].apply(this,i)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n;}},Be=(e,t,r)=>{o.hasOwnProperty(e)?((r===void 0||o[e].overloadTable!==void 0&&o[e].overloadTable[r]!==void 0)&&y(`Cannot register public name '${e}' twice`),Mt(o,e,e),o.hasOwnProperty(r)&&y(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),o[e].overloadTable[r]=t):(o[e]=t,r!==void 0&&(o[e].numArguments=r));},qr=48,Gr=57,Xr=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=qr&&t<=Gr?`_${e}`:e};function Jr(e,t,r,n,i,s,u,l){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=s,this.upcast=u,this.downcast=l,this.pureVirtualFunctions=[];}var He=(e,t,r)=>{for(;t!==r;)t.upcast||y(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Kr(e,t){if(t===null)return this.isReference&&y(`null is not a valid ${this.name}`),0;t.$$||y(`Cannot pass "${Ge(t)}" as a ${this.name}`),t.$$.ptr||y(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=He(t.$$.ptr,r,this.registeredClass);return n}function Zr(e,t){var r;if(t===null)return this.isReference&&y(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&y(`Cannot pass "${Ge(t)}" as a ${this.name}`),t.$$.ptr||y(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&y(`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(t.$$.smartPtr===void 0&&y("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:y(`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 i=t.clone();r=this.rawShare(r,J.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,r);}break;default:y("Unsupporting sharing policy");}return r}function Qr(e,t){if(t===null)return this.isReference&&y(`null is not a valid ${this.name}`),0;t.$$||y(`Cannot pass "${Ge(t)}" as a ${this.name}`),t.$$.ptr||y(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&y(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=He(t.$$.ptr,r,this.registeredClass);return n}var en=()=>{Object.assign(pe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e);},argPackAdvance:H,readValueFromPointer:le,fromWireType:Yr});};function pe(e,t,r,n,i,s,u,l,d,f,v){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=s,this.sharingPolicy=u,this.rawGetPointee=l,this.rawConstructor=d,this.rawShare=f,this.rawDestructor=v,!i&&t.baseClass===void 0?n?(this.toWireType=Kr,this.destructorFunction=null):(this.toWireType=Qr,this.destructorFunction=null):this.toWireType=Zr;}var At=(e,t,r)=>{o.hasOwnProperty(e)||Ee("Replacing nonexistent public symbol"),o[e].overloadTable!==void 0&&r!==void 0?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r);},tn=(e,t,r)=>{e=e.replace(/p/g,"i");var n=o["dynCall_"+e];return n(t,...r)},kt,k=e=>kt.get(e),rn=(e,t,r=[])=>{if(e.includes("j"))return tn(e,t,r);var n=k(t)(...r);return n},nn=(e,t)=>(...r)=>rn(e,t,r),j=(e,t)=>{e=M(e);function r(){return e.includes("j")?nn(e,t):k(t)}var n=r();return typeof n!="function"&&y(`unknown function pointer with signature ${e}: ${t}`),n},an=(e,t)=>{var r=ve(t,function(n){this.name=t,this.message=n;var i=new Error(n).stack;i!==void 0&&(this.stack=this.toString()+`
`+i.replace(/^Error(:[^\n]*)?\n/,""));});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Rt,St=e=>{var t=Bt(e),r=M(t);return z(t),r},Pe=(e,t)=>{var r=[],n={};function i(s){if(!n[s]&&!X[s]){if(Te[s]){Te[s].forEach(i);return}r.push(s),n[s]=!0;}}throw t.forEach(i),new Rt(`${e}: `+r.map(St).join([", "]))},on=(e,t,r,n,i,s,u,l,d,f,v,m,h)=>{v=M(v),s=j(i,s),l&&(l=j(u,l)),f&&(f=j(d,f)),h=j(m,h);var C=Xr(v);Be(C,function(){Pe(`Cannot construct ${v} due to unbound types`,[n]);}),N([e,t,r],n?[n]:[],F=>{var Ae;F=F[0];var W,S;n?(W=F.registeredClass,S=W.instancePrototype):S=$e.prototype;var P=ve(v,function(...Ze){if(Object.getPrototypeOf(this)!==c)throw new ne("Use 'new' to construct "+v);if(p.constructor_body===void 0)throw new ne(v+" has no accessible constructor");var Xt=p.constructor_body[Ze.length];if(Xt===void 0)throw new ne(`Tried to invoke ctor of ${v} with invalid number of parameters (${Ze.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return Xt.apply(this,Ze)}),c=Object.create(S,{constructor:{value:P}});P.prototype=c;var p=new Jr(v,P,c,h,W,s,l,f);p.baseClass&&((Ae=p.baseClass).__derivedClasses??(Ae.__derivedClasses=[]),p.baseClass.__derivedClasses.push(p));var x=new pe(v,p,!0,!1,!1),T=new pe(v+"*",p,!1,!1,!1),Y=new pe(v+" const*",p,!1,!0,!1);return Lt[e]={pointerType:T,constPointerType:Y},At(C,P),[x,T,Y]});},Ve=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(w[t+n*4>>2]);return r};function sn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return !0;return !1}function ze(e,t,r,n,i,s){var u=t.length;u<2&&y("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=t[1]!==null&&r!==null,d=sn(t),f=t[0].name!=="void",v=u-2,m=new Array(v),h=[],C=[],F=function(...W){W.length!==v&&y(`function ${e} called with ${W.length} arguments, expected ${v}`),C.length=0;var S;h.length=l?2:1,h[0]=i,l&&(S=t[1].toWireType(C,this),h[1]=S);for(var P=0;P<v;++P)m[P]=t[P+2].toWireType(C,W[P]),h.push(m[P]);var c=n(...h);function p(x){if(d)je(C);else for(var T=l?1:2;T<t.length;T++){var Y=T===1?S:m[T-2];t[T].destructorFunction!==null&&t[T].destructorFunction(Y);}if(f)return t[0].fromWireType(x)}return p(c)};return ve(e,F)}var ln=(e,t,r,n,i,s)=>{var u=Ve(t,r);i=j(n,i),N([],[e],l=>{l=l[0];var d=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[t-1]!==void 0)throw new ne(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[t-1]=()=>{Pe(`Cannot construct ${l.name} due to unbound types`,u);},N([],u,f=>(f.splice(1,0,null),l.registeredClass.constructor_body[t-1]=ze(d,f,null,i,s),[])),[]});},xt=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},un=(e,t,r,n,i,s,u,l,d)=>{var f=Ve(r,n);t=M(t),t=xt(t),s=j(i,s),N([],[e],v=>{v=v[0];var m=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),l&&v.registeredClass.pureVirtualFunctions.push(t);function h(){Pe(`Cannot call ${m} due to unbound types`,f);}var C=v.registeredClass.instancePrototype,F=C[t];return F===void 0||F.overloadTable===void 0&&F.className!==v.name&&F.argCount===r-2?(h.argCount=r-2,h.className=v.name,C[t]=h):(Mt(C,t,m),C[t].overloadTable[r-2]=h),N([],f,W=>{var S=ze(m,W,v,s,u);return C[t].overloadTable===void 0?(S.argCount=r-2,C[t]=S):C[t].overloadTable[r-2]=S,[]}),[]});},Ye=[],V=[],Ne=e=>{e>9&&--V[e+1]===0&&(V[e]=void 0,Ye.push(e));},dn=()=>V.length/2-5-Ye.length,cn=()=>{V.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=dn;},J={toValue:e=>(e||y("Cannot use deleted val. handle = "+e),V[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Ye.pop()||V.length;return V[t]=e,V[t+1]=1,t}}}},fn={name:"emscripten::val",fromWireType:e=>{var t=J.toValue(e);return Ne(e),t},toWireType:(e,t)=>J.toHandle(t),argPackAdvance:H,readValueFromPointer:le,destructorFunction:null},Dt=e=>B(e,fn),vn=(e,t,r)=>{switch(t){case 1:return r?function(n){return this.fromWireType(O[n])}:function(n){return this.fromWireType(L[n])};case 2:return r?function(n){return this.fromWireType(Q[n>>1])}:function(n){return this.fromWireType(oe[n>>1])};case 4:return r?function(n){return this.fromWireType(A[n>>2])}:function(n){return this.fromWireType(w[n>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},pn=(e,t,r,n)=>{t=M(t);function i(){}i.values={},B(e,{name:t,constructor:i,fromWireType:function(s){return this.constructor.values[s]},toWireType:(s,u)=>u.value,argPackAdvance:H,readValueFromPointer:vn(t,r,n),destructorFunction:null}),Be(t,i);},qe=(e,t)=>{var r=X[e];return r===void 0&&y(`${t} has unknown type ${St(e)}`),r},hn=(e,t,r)=>{var n=qe(e,"enum");t=M(t);var i=n.constructor,s=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ve(`${n.name}_${t}`,function(){})}});i.values[r]=s,i[t]=s;},Ge=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},_n=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(ut[r>>2])};case 8:return function(r){return this.fromWireType(dt[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},mn=(e,t,r)=>{t=M(t),B(e,{name:t,fromWireType:n=>n,toWireType:(n,i)=>i,argPackAdvance:H,readValueFromPointer:_n(t,r),destructorFunction:null});},yn=(e,t,r,n,i,s,u)=>{var l=Ve(t,r);e=M(e),e=xt(e),i=j(n,i),Be(e,function(){Pe(`Cannot call ${e} due to unbound types`,l);},t-1),N([],l,d=>{var f=[d[0],null].concat(d.slice(1));return At(e,ze(e,f,null,i,s),t-1),[]});},gn=(e,t,r)=>{switch(t){case 1:return r?n=>O[n]:n=>L[n];case 2:return r?n=>Q[n>>1]:n=>oe[n>>1];case 4:return r?n=>A[n>>2]:n=>w[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},bn=(e,t,r,n,i)=>{t=M(t);var s=v=>v;if(n===0){var u=32-8*r;s=v=>v<<u>>>u;}var l=t.includes("unsigned"),d=(v,m)=>{},f;l?f=function(v,m){return d(m,this.name),m>>>0}:f=function(v,m){return d(m,this.name),m},B(e,{name:t,fromWireType:s,toWireType:f,argPackAdvance:H,readValueFromPointer:gn(t,r,n!==0),destructorFunction:null});},Cn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=n[t];function s(u){var l=w[u>>2],d=w[u+4>>2];return new i(O.buffer,d,l)}r=M(r),B(e,{name:r,fromWireType:s,argPackAdvance:H,readValueFromPointer:s},{ignoreDuplicateRegistrations:!0});},wn=(e,t)=>{Dt(e);},Tn=(e,t,r,n,i,s,u,l,d,f,v,m)=>{r=M(r),s=j(i,s),l=j(u,l),f=j(d,f),m=j(v,m),N([e],[t],h=>{h=h[0];var C=new pe(r,h.registeredClass,!1,!1,!0,h,n,s,l,f,m);return [C]});},En=(e,t)=>{t=M(t);var r=t==="std::string";B(e,{name:t,fromWireType(n){var i=w[n>>2],s=n+4,u;if(r)for(var l=s,d=0;d<=i;++d){var f=s+d;if(d==i||L[f]==0){var v=f-l,m=G(l,v);u===void 0?u=m:(u+="\0",u+=m),l=f+1;}}else {for(var h=new Array(i),d=0;d<i;++d)h[d]=String.fromCharCode(L[s+d]);u=h.join("");}return z(n),u},toWireType(n,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var s,u=typeof i=="string";u||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||y("Cannot pass non-string to std::string"),r&&u?s=Ct(i):s=i.length;var l=Ke(4+s+1),d=l+4;if(w[l>>2]=s,r&&u)$r(i,d,s+1);else if(u)for(var f=0;f<s;++f){var v=i.charCodeAt(f);v>255&&(z(d),y("String has UTF-16 code units that do not fit in 8 bits")),L[d+f]=v;}else for(var f=0;f<s;++f)L[d+f]=i[f];return n!==null&&n.push(z,l),l},argPackAdvance:H,readValueFromPointer:le,destructorFunction(n){z(n);}});},It=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Fn=(e,t)=>{for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&oe[n];)++n;if(r=n<<1,r-e>32&&It)return It.decode(L.subarray(e,r));for(var s="",u=0;!(u>=t/2);++u){var l=Q[e+u*2>>1];if(l==0)break;s+=String.fromCharCode(l);}return s},$n=(e,t,r)=>{if(r??(r=2147483647),r<2)return 0;r-=2;for(var n=t,i=r<e.length*2?r/2:e.length,s=0;s<i;++s){var u=e.charCodeAt(s);Q[t>>1]=u,t+=2;}return Q[t>>1]=0,t-n},Pn=e=>e.length*2,Ln=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=A[e+r*4>>2];if(i==0)break;if(++r,i>=65536){var s=i-65536;n+=String.fromCharCode(55296|s>>10,56320|s&1023);}else n+=String.fromCharCode(i);}return n},Mn=(e,t,r)=>{if(r??(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,s=0;s<e.length;++s){var u=e.charCodeAt(s);if(u>=55296&&u<=57343){var l=e.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023;}if(A[t>>2]=u,t+=4,t+4>i)break}return A[t>>2]=0,t-n},An=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4;}return t},kn=(e,t,r)=>{r=M(r);var n,i,s,u;t===2?(n=Fn,i=$n,u=Pn,s=l=>oe[l>>1]):t===4&&(n=Ln,i=Mn,u=An,s=l=>w[l>>2]),B(e,{name:r,fromWireType:l=>{for(var d=w[l>>2],f,v=l+4,m=0;m<=d;++m){var h=l+4+m*t;if(m==d||s(h)==0){var C=h-v,F=n(v,C);f===void 0?f=F:(f+="\0",f+=F),v=h+t;}}return z(l),f},toWireType:(l,d)=>{typeof d!="string"&&y(`Cannot pass non-string to C++ string type ${r}`);var f=u(d),v=Ke(4+f+t);return w[v>>2]=f/t,i(d,v+4,f+t),l!==null&&l.push(z,v),v},argPackAdvance:H,readValueFromPointer:le,destructorFunction(l){z(l);}});},Rn=(e,t,r,n,i,s)=>{we[e]={name:M(t),rawConstructor:j(r,n),rawDestructor:j(i,s),fields:[]};},Sn=(e,t,r,n,i,s,u,l,d,f)=>{we[e].fields.push({fieldName:M(t),getterReturnType:r,getter:j(n,i),getterContext:s,setterArgumentType:u,setter:j(l,d),setterContext:f});},xn=(e,t)=>{t=M(t),B(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}});},Dn=(e,t,r)=>L.copyWithin(e,t,t+r),In=()=>{throw 1/0},Xe=[],jn=(e,t,r,n)=>(e=Xe[e],t=J.toValue(t),e(null,t,r,n)),Wn=e=>{var t=Xe.length;return Xe.push(e),t},On=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=qe(w[t+n*4>>2],"parameter "+n);return r},Un=Reflect.construct,Bn=(e,t,r)=>{var n=[],i=e.toWireType(n,r);return n.length&&(w[t>>2]=J.toHandle(n)),i},Hn=(e,t,r)=>{var n=On(e,t),i=n.shift();e--;var s=new Array(e),u=(d,f,v,m)=>{for(var h=0,C=0;C<e;++C)s[C]=n[C].readValueFromPointer(m+h),h+=n[C].argPackAdvance;var F=r===1?Un(f,s):f.apply(d,s);return Bn(i,v,F)},l=`methodCaller<(${n.map(d=>d.name).join(", ")}) => ${i.name}>`;return Wn(ve(l,u))},Vn=e=>{e>9&&(V[e+1]+=1);},zn=e=>{var t=J.toValue(e);je(t),Ne(e);},Yn=(e,t)=>{e=qe(e,"_emval_take_value");var r=e.readValueFromPointer(t);return J.toHandle(r)},Nn=()=>{be("");},jt;jt=()=>performance.now();var qn=()=>2147483648,Gn=e=>{var t=ge.buffer,r=(e-t.byteLength+65535)/65536;try{return ge.grow(r),ct(),1}catch{}},Xn=e=>{var t=L.length;e>>>=0;var r=qn();if(e>r)return !1;for(var n=(d,f)=>d+(f-d%f)%f,i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var u=Math.min(r,n(Math.max(e,s),65536)),l=Gn(u);if(l)return !0}return !1},Je={},Jn=()=>ot||"./this.program",he=()=>{if(!he.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Jn()};for(var r in Je)Je[r]===void 0?delete t[r]:t[r]=Je[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);he.strings=n;}return he.strings},Kn=(e,t)=>{for(var r=0;r<e.length;++r)O[t++]=e.charCodeAt(r);O[t]=0;},Zn=(e,t)=>{var r=0;return he().forEach((n,i)=>{var s=t+r;w[e+i*4>>2]=s,Kn(n,s),r+=n.length+1;}),0},Qn=(e,t)=>{var r=he();w[e>>2]=r.length;var n=0;return r.forEach(i=>n+=i.length+1),w[t>>2]=n,0},ei=e=>52,ti=(e,t,r,n)=>52;function ni(e,t,r,n,i){return 70}var ii=[null,[],[]],ai=(e,t)=>{var r=ii[e];t===0||t===10?((e===1?nr:Z)(gt(r,0)),r.length=0):r.push(t);},oi=(e,t,r,n)=>{for(var i=0,s=0;s<r;s++){var u=w[t>>2],l=w[t+4>>2];t+=8;for(var d=0;d<l;d++)ai(e,L[u+d]);i+=l;}return w[n>>2]=i,0},si=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);be("initRandomDevice");},Wt=e=>(Wt=si())(e),li=(e,t)=>(Wt(L.subarray(e,e+t)),0),Le=e=>e%4===0&&(e%100!==0||e%400===0),ui=(e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r},Ot=[31,29,31,30,31,30,31,31,30,31,30,31],Ut=[31,28,31,30,31,30,31,31,30,31,30,31],di=(e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Le(r.getFullYear()),i=r.getMonth(),s=(n?Ot:Ut)[i];if(t>s-r.getDate())t-=s-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+t),r}return r};function ci(e,t,r){var n=r>0?r:Ct(e)+1,i=new Array(n),s=wt(e,i,0,i.length);return t&&(i.length=s),i}var fi=(e,t)=>{O.set(e,t);},vi=(e,t,r,n)=>{var i=w[n+40>>2],s={tm_sec:A[n>>2],tm_min:A[n+4>>2],tm_hour:A[n+8>>2],tm_mday:A[n+12>>2],tm_mon:A[n+16>>2],tm_year:A[n+20>>2],tm_wday:A[n+24>>2],tm_yday:A[n+28>>2],tm_isdst:A[n+32>>2],tm_gmtoff:A[n+36>>2],tm_zone:i?G(i):""},u=G(r),l={"%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 d in l)u=u.replace(new RegExp(d,"g"),l[d]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(c,p,x){for(var T=typeof c=="number"?c.toString():c||"";T.length<p;)T=x[0]+T;return T}function h(c,p){return m(c,p,"0")}function C(c,p){function x(Y){return Y<0?-1:Y>0?1:0}var T;return (T=x(c.getFullYear()-p.getFullYear()))===0&&(T=x(c.getMonth()-p.getMonth()))===0&&(T=x(c.getDate()-p.getDate())),T}function F(c){switch(c.getDay()){case 0:return new Date(c.getFullYear()-1,11,29);case 1:return c;case 2:return new Date(c.getFullYear(),0,3);case 3:return new Date(c.getFullYear(),0,2);case 4:return new Date(c.getFullYear(),0,1);case 5:return new Date(c.getFullYear()-1,11,31);case 6:return new Date(c.getFullYear()-1,11,30)}}function W(c){var p=di(new Date(c.tm_year+1900,0,1),c.tm_yday),x=new Date(p.getFullYear(),0,4),T=new Date(p.getFullYear()+1,0,4),Y=F(x),Ae=F(T);return C(Y,p)<=0?C(Ae,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var S={"%a":c=>f[c.tm_wday].substring(0,3),"%A":c=>f[c.tm_wday],"%b":c=>v[c.tm_mon].substring(0,3),"%B":c=>v[c.tm_mon],"%C":c=>{var p=c.tm_year+1900;return h(p/100|0,2)},"%d":c=>h(c.tm_mday,2),"%e":c=>m(c.tm_mday,2," "),"%g":c=>W(c).toString().substring(2),"%G":W,"%H":c=>h(c.tm_hour,2),"%I":c=>{var p=c.tm_hour;return p==0?p=12:p>12&&(p-=12),h(p,2)},"%j":c=>h(c.tm_mday+ui(Le(c.tm_year+1900)?Ot:Ut,c.tm_mon-1),3),"%m":c=>h(c.tm_mon+1,2),"%M":c=>h(c.tm_min,2),"%n":()=>`
`,"%p":c=>c.tm_hour>=0&&c.tm_hour<12?"AM":"PM","%S":c=>h(c.tm_sec,2),"%t":()=>" ","%u":c=>c.tm_wday||7,"%U":c=>{var p=c.tm_yday+7-c.tm_wday;return h(Math.floor(p/7),2)},"%V":c=>{var p=Math.floor((c.tm_yday+7-(c.tm_wday+6)%7)/7);if((c.tm_wday+371-c.tm_yday-2)%7<=2&&p++,p){if(p==53){var T=(c.tm_wday+371-c.tm_yday)%7;T!=4&&(T!=3||!Le(c.tm_year))&&(p=1);}}else {p=52;var x=(c.tm_wday+7-c.tm_yday-1)%7;(x==4||x==5&&Le(c.tm_year%400-1))&&p++;}return h(p,2)},"%w":c=>c.tm_wday,"%W":c=>{var p=c.tm_yday+7-(c.tm_wday+6)%7;return h(Math.floor(p/7),2)},"%y":c=>(c.tm_year+1900).toString().substring(2),"%Y":c=>c.tm_year+1900,"%z":c=>{var p=c.tm_gmtoff,x=p>=0;return p=Math.abs(p)/60,p=p/60*100+p%60,(x?"+":"-")+("0000"+p).slice(-4)},"%Z":c=>c.tm_zone,"%%":()=>"%"};u=u.replace(/%%/g,"\0\0");for(var d in S)u.includes(d)&&(u=u.replace(new RegExp(d,"g"),S[d](s)));u=u.replace(/\0\0/g,"%");var P=ci(u,!1);return P.length>t?0:(fi(P,e),P.length-1)},pi=(e,t,r,n,i)=>vi(e,t,r,n);Tt=o.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError";}},xr(),ne=o.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError";}},Nr(),Hr(),en(),Rt=o.UnboundTypeError=an(Error,"UnboundTypeError"),cn();var hi={c:yr,d:Cr,q:Tr,h:gr,E:Er,W:Fr,T:Pr,X:Lr,U:Mr,D:Ar,V:kr,A:Rr,O:Sr,ea:Ir,z:on,x:ln,i:un,da:Dt,B:pn,n:hn,I:mn,K:yn,p:bn,k:Cn,L:wn,ka:Tn,J:En,y:kn,u:Rn,m:Sn,fa:xn,Y:Dn,P:In,ia:jn,R:Ne,ha:Hn,ja:Vn,ga:zn,t:Yn,ca:Nn,l:jt,S:Xn,Z:Zn,_:Qn,w:ei,C:ti,N:ni,v:oi,$:li,F:Vi,j:Ii,g:Di,e:Hi,ba:Ri,s:Bi,G:Oi,r:Wi,b:ki,a:Si,f:xi,o:Ui,H:ji,aa:zi,M:Yi,Q:pi},b=mr(),Ke=e=>(Ke=b.na)(e),Bt=e=>(Bt=b.oa)(e),z=e=>(z=b.qa)(e),R=(e,t)=>(R=b.ra)(e,t),Ht=e=>(Ht=b.sa)(e),Vt=e=>(Vt=b.ta)(e),zt=()=>(zt=b.ua)(),Yt=(e,t,r)=>(Yt=b.va)(e,t,r),Nt=e=>(Nt=b.wa)(e);o.dynCall_iijj=(e,t,r,n,i,s)=>(o.dynCall_iijj=b.xa)(e,t,r,n,i,s);o.dynCall_vijj=(e,t,r,n,i,s)=>(o.dynCall_vijj=b.ya)(e,t,r,n,i,s);o.dynCall_jiii=(e,t,r,n)=>(o.dynCall_jiii=b.za)(e,t,r,n);o.dynCall_jii=(e,t,r)=>(o.dynCall_jii=b.Aa)(e,t,r);var qt=o.dynCall_viiij=(e,t,r,n,i,s)=>(qt=o.dynCall_viiij=b.Ba)(e,t,r,n,i,s);o.dynCall_jiji=(e,t,r,n,i)=>(o.dynCall_jiji=b.Ca)(e,t,r,n,i);o.dynCall_viijii=(e,t,r,n,i,s,u)=>(o.dynCall_viijii=b.Da)(e,t,r,n,i,s,u);o.dynCall_iiiiij=(e,t,r,n,i,s,u)=>(o.dynCall_iiiiij=b.Ea)(e,t,r,n,i,s,u);o.dynCall_iiiiijj=(e,t,r,n,i,s,u,l,d)=>(o.dynCall_iiiiijj=b.Fa)(e,t,r,n,i,s,u,l,d);o.dynCall_iiiiiijj=(e,t,r,n,i,s,u,l,d,f)=>(o.dynCall_iiiiiijj=b.Ga)(e,t,r,n,i,s,u,l,d,f);function ki(e,t){var r=I();try{k(e)(t);}catch(n){if(D(r),n!==n+0)throw n;R(1,0);}}function Ri(e,t,r,n,i){var s=I();try{return k(e)(t,r,n,i)}catch(u){if(D(s),u!==u+0)throw u;R(1,0);}}function Si(e,t,r){var n=I();try{k(e)(t,r);}catch(i){if(D(n),i!==i+0)throw i;R(1,0);}}function xi(e,t,r,n){var i=I();try{k(e)(t,r,n);}catch(s){if(D(i),s!==s+0)throw s;R(1,0);}}function Di(e,t,r){var n=I();try{return k(e)(t,r)}catch(i){if(D(n),i!==i+0)throw i;R(1,0);}}function Ii(e,t){var r=I();try{return k(e)(t)}catch(n){if(D(r),n!==n+0)throw n;R(1,0);}}function ji(e,t,r,n,i,s){var u=I();try{k(e)(t,r,n,i,s);}catch(l){if(D(u),l!==l+0)throw l;R(1,0);}}function Wi(e){var t=I();try{k(e)();}catch(r){if(D(t),r!==r+0)throw r;R(1,0);}}function Oi(e,t,r,n,i,s,u,l){var d=I();try{return k(e)(t,r,n,i,s,u,l)}catch(f){if(D(d),f!==f+0)throw f;R(1,0);}}function Ui(e,t,r,n,i){var s=I();try{k(e)(t,r,n,i);}catch(u){if(D(s),u!==u+0)throw u;R(1,0);}}function Bi(e,t,r,n,i,s){var u=I();try{return k(e)(t,r,n,i,s)}catch(l){if(D(u),l!==l+0)throw l;R(1,0);}}function Hi(e,t,r,n){var i=I();try{return k(e)(t,r,n)}catch(s){if(D(i),s!==s+0)throw s;R(1,0);}}function Vi(e){var t=I();try{return k(e)()}catch(r){if(D(t),r!==r+0)throw r;R(1,0);}}function zi(e,t,r,n,i,s,u){var l=I();try{k(e)(t,r,n,i,s,u);}catch(d){if(D(l),d!==d+0)throw d;R(1,0);}}function Yi(e,t,r,n,i,s){var u=I();try{qt(e,t,r,n,i,s);}catch(l){if(D(u),l!==l+0)throw l;R(1,0);}}var Me;se=function e(){Me||Gt(),Me||(se=e);};function Gt(){if(q>0||(or(),q>0))return;function e(){Me||(Me=!0,o.calledRun=!0,!lt&&(sr(),_(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),lr()));}o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("");},1),e();},1)):e();}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Gt(),ie}})(),Jt=Xi;var K=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(a){return await Jt({locateFile:()=>a})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async a=>{let o=`https://unpkg.com/${_e.name}@${_e.version}/dist/dotlottie-player.wasm`;console.warn(`Trying backup URL for WASM loading: ${o}`);try{return await this._tryLoad(o)}catch(_){throw console.error(`Both primary and backup WASM URLs failed. Primary error: ${a.message}, Backup error: ${_.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(a){this._wasmURL=a,this._ModulePromise=null;}};$(K,"_ModulePromise",null),$(K,"_wasmURL",`https://cdn.jsdelivr.net/npm/${_e.name}@${_e.version}/dist/dotlottie-player.wasm`);var Re=class{constructor(){$(this,"_eventListeners",new Map);}addEventListener(a,o){let _=this._eventListeners.get(a);_||(_=new Set,this._eventListeners.set(a,_)),_.add(o);}removeEventListener(a,o){let _=this._eventListeners.get(a);_&&(o?(_.delete(o),_.size===0&&this._eventListeners.delete(a)):this._eventListeners.delete(a));}dispatch(a){this._eventListeners.get(a.type)?.forEach(_=>_(a));}removeAllEventListeners(){this._eventListeners.clear();}};var rt=(g,a)=>g==="reverse"?a.Mode.Reverse:g==="bounce"?a.Mode.Bounce:g==="reverse-bounce"?a.Mode.ReverseBounce:a.Mode.Forward,nt=(g,a)=>g==="contain"?a.Fit.Contain:g==="cover"?a.Fit.Cover:g==="fill"?a.Fit.Fill:g==="fit-height"?a.Fit.FitHeight:g==="fit-width"?a.Fit.FitWidth:a.Fit.None,it=(g,a)=>{let o=new a.VectorFloat;return o.push_back(g[0]),o.push_back(g[1]),o},at=(g,a)=>{let o=new a.VectorFloat;return g.length!==2||(o.push_back(g[0]),o.push_back(g[1])),o},Kt=class{constructor(a){$(this,"_canvas");$(this,"_context");$(this,"_eventManager");$(this,"_animationFrameId",null);$(this,"_frameManager");$(this,"_dotLottieCore",null);$(this,"_wasmModule",null);$(this,"_renderConfig",{});$(this,"_isFrozen",!1);$(this,"_backgroundColor",null);this._canvas=a.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new Re,this._frameManager=new ke,this._renderConfig=a.renderConfig??{},K.load().then(o=>{this._wasmModule=o,this._dotLottieCore=new o.DotLottiePlayer({autoplay:a.autoplay??!1,backgroundColor:0,loopAnimation:a.loop??!1,mode:rt(a.mode??"forward",o),segment:at(a.segment??[],o),speed:a.speed??1,useFrameInterpolation:a.useFrameInterpolation??!0,marker:a.marker??"",layout:a.layout?{align:it(a.layout.align,o),fit:nt(a.layout.fit,o)}:o.createDefaultLayout()}),a.data?this._loadFromData(a.data):a.src&&this._loadFromSrc(a.src),a.backgroundColor&&this.setBackgroundColor(a.backgroundColor);}).catch(o=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${o}`)});});}_loadFromSrc(a){async function o(){let _=await fetch(a);if(!_.ok)throw new Error(`Failed to fetch the animation data from URL: ${a}. ${_.status}: ${_.statusText}`);let E=(_.headers.get("content-type")??"").trim(),ie;return ["application/json","text/plain"].some(me=>E.startsWith(me))?ie=await _.text():ie=await _.arrayBuffer(),ie}o().then(_=>{this._loadFromData(_);}).catch(_=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load animation data from URL: ${a}. ${_}`)});});}_loadFromData(a){if(this._dotLottieCore===null)return;let o=this._canvas.width,_=this._canvas.height,E=!1;if(typeof a=="string")E=this._dotLottieCore.loadAnimationData(a,o,_);else if(a instanceof ArrayBuffer)E=this._dotLottieCore.loadDotLottieData(a,o,_);else if(typeof a=="object")E=this._dotLottieCore.loadAnimationData(JSON.stringify(a),o,_);else {this._eventManager.dispatch({type:"loadError",error:new Error("Unsupported data type for animation data. Expected a string or ArrayBuffer.")});return}E?(this._eventManager.dispatch({type:"load"}),tt&&this.resize(),this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._dotLottieCore.config().autoplay&&(this._dotLottieCore.play(),this._dotLottieCore.isPlaying()?(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this))):console.error("something went wrong, the animation was suppose to autoplay"))):this._eventManager.dispatch({type:"loadError",error:new Error("Failed to load animation data")});}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let a=this._dotLottieCore?.config().layout;if(a)return {align:[a.align.get(0),a.align.get(1)],fit:(()=>{switch(a.fit){case this._wasmModule?.Fit.Contain:return "contain";case this._wasmModule?.Fit.Cover:return "cover";case this._wasmModule?.Fit.Fill:return "fill";case this._wasmModule?.Fit.FitHeight:return "fit-height";case this._wasmModule?.Fit.FitWidth:return "fit-width";case this._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let a=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!a)return null;let o=JSON.parse(a);return Object.keys(o).length===0?null:o}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let a=this._dotLottieCore?.config().segment;if(a&&a.size()===2)return [a.get(0),a.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let a=this._dotLottieCore?.config().mode;return a===this._wasmModule?.Mode.Reverse?"reverse":a===this._wasmModule?.Mode.Bounce?"bounce":a===this._wasmModule?.Mode.ReverseBounce?"reverse-bounce":"forward"}get isFrozen(){return this._isFrozen}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.config().autoplay??!1}get useFrameInterpolation(){return this._dotLottieCore?.config().useFrameInterpolation??!1}get speed(){return this._dotLottieCore?.config().speed??0}get isLoaded(){return this._dotLottieCore?.isLoaded()??!1}get isPlaying(){return this._dotLottieCore?.isPlaying()??!1}get isPaused(){return this._dotLottieCore?.isPaused()??!1}get isStopped(){return this._dotLottieCore?.isStopped()??!1}get currentFrame(){return this._dotLottieCore?.currentFrame()??0}get loopCount(){return this._dotLottieCore?.loopCount()??0}get totalFrames(){return this._dotLottieCore?.totalFrames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segmentDuration()??0}load(a){this._dotLottieCore===null||this._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:a.autoplay??!1,backgroundColor:0,loopAnimation:a.loop??!1,mode:rt(a.mode??"forward",this._wasmModule),segment:at(a.segment??[],this._wasmModule),speed:a.speed??1,useFrameInterpolation:a.useFrameInterpolation??!0,marker:a.marker??"",layout:a.layout?{align:it(a.layout.align,this._wasmModule),fit:nt(a.layout.fit,this._wasmModule)}:this._wasmModule.createDefaultLayout()}),a.data?this._loadFromData(a.data):a.src&&this._loadFromSrc(a.src),this.setBackgroundColor(a.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let o=this._dotLottieCore.buffer(),_=new Uint8ClampedArray(o,0,this._canvas.width*this._canvas.height*4),E=null;return typeof ImageData>"u"?(E=this._context.createImageData(this._canvas.width,this._canvas.height),E.data.set(_)):E=new ImageData(_,this._canvas.width,this._canvas.height),this._context.putImageData(E,0,0),this._eventManager.dispatch({type:"render",currentFrame:this._dotLottieCore.currentFrame()}),!0}return !1}_draw(){if(this._dotLottieCore===null||this._context===null||!this._dotLottieCore.isPlaying())return;let a=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(a)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render()&&this._dotLottieCore.isComplete()&&(this._dotLottieCore.config().loopAnimation?this._eventManager.dispatch({type:"loop",loopCount:this._dotLottieCore.loopCount()}):this._eventManager.dispatch({type:"complete"}))),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this));}play(){if(this._dotLottieCore===null)return;let a=this._dotLottieCore.play();this._isFrozen=!1,a&&(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)));}pause(){if(this._dotLottieCore===null)return;this._dotLottieCore.pause()&&this._eventManager.dispatch({type:"pause"});}stop(){if(this._dotLottieCore===null)return;this._dotLottieCore.stop()&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._eventManager.dispatch({type:"stop"}));}setFrame(a){if(this._dotLottieCore===null||a<0||a>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(a)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:a});}setBackgroundColor(a){this._dotLottieCore!==null&&(this._canvas instanceof HTMLCanvasElement&&(this._canvas.style.backgroundColor=a),this._backgroundColor=a);}setLoop(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:a});}setUseFrameInterpolation(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:a});}addEventListener(a,o){this._eventManager.addEventListener(a,o);}removeEventListener(a,o){this._eventManager.removeEventListener(a,o);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners();}freeze(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null,this._isFrozen=!0,this._eventManager.dispatch({type:"freeze"}));}unfreeze(){this._animationFrameId===null&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)),this._isFrozen=!1,this._eventManager.dispatch({type:"unfreeze"}));}resize(){if(!tt||!(this._canvas instanceof HTMLCanvasElement))return;let a=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:o,width:_}=this._canvas.getBoundingClientRect();this._canvas.width=_*a,this._canvas.height=o*a,this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(a,o){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:at([a,o],this._wasmModule)});}setMode(a){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:rt(a,this._wasmModule)});}setRenderConfig(a){this._renderConfig=a;}loadAnimation(a){if(this._dotLottieCore===null)return;this._dotLottieCore.loadAnimation(a,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${a}`)});}setMarker(a){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:a});}markers(){let a=this._dotLottieCore?.markers();if(a){let o=[];for(let _=0;_<a.size();_+=1){let E=a.get(_);o.push({name:E.name,time:E.time,duration:E.duration});}return o}return []}loadTheme(a){if(this._dotLottieCore===null)return !1;let o=this._dotLottieCore.loadTheme(a);return this._render(),o}loadThemeData(a){if(this._dotLottieCore===null)return !1;let o=this._dotLottieCore.loadThemeData(a);return this._render(),o}setLayout(a){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:it(a.align,this._wasmModule),fit:nt(a.fit,this._wasmModule)}});}setViewport(a,o,_,E){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(a,o,_,E)}static setWasmUrl(a){K.setWasmUrl(a);}};

@@ -5,0 +5,0 @@ export { Kt as DotLottie };

{
"name": "@lottiefiles/dotlottie-web",
"version": "0.23.0",
"version": "0.23.1",
"type": "module",

@@ -5,0 +5,0 @@ "description": "Lottie and DotLottie player for the web",

@@ -185,2 +185,3 @@ # @lottiefiles/dotlottie-web

| `activeAnimationId` | string | The loaded animation id from the .lottie file. |
| `segmentDuration` | number | The duration of the current segment, if no segment is set, it will return the duration of the whole animation. |

@@ -195,27 +196,28 @@ #### Manifest

| Method | Description |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `play()` | Begins playback from the current animation position. |
| `pause()` | Pauses the animation without resetting its position. |
| `stop()` | Halts playback and returns the animation to its initial frame. |
| `setSpeed(speed: number)` | Sets the playback speed with the given multiplier. |
| `setLoop(loop: boolean)` | Configures whether the animation should loop continuously. |
| `setFrame(frame: number)` | Directly navigates the animation to a specified frame. |
| `addEventListener(event: string, listener: Function)` | Registers a function to respond to a specific animation event. |
| `removeEventListener(event: string, listener?: Function)` | Removes a previously registered function from responding to a specific animation event. |
| `destroy()` | Destroys the renderer instance and unregisters all event listeners. This method should be called when the canvas is removed from the DOM to prevent memory leaks. |
| `load(config: Config)` | Loads a new configuration or a new animation. |
| `setMode(mode: string)` | Sets the animation play mode. |
| `setSegment(startFrame: number, endFrame: number)` | Sets the start and end frame of the animation. |
| `freeze()` | Freezes the animation by stopping the animation loop. |
| `unfreeze()` | Unfreezes the animation by resuming the animation loop. |
| `setBackgroundColor(color: string)` | Sets the background color of the canvas. |
| `resize()` | This method adjusts the canvas size to match its bounding box dimensions, considering the device's pixel ratio. This prevents the canvas from appearing blurry on high-resolution screens. Call this method when the window or the canvas element is resized. |
| `setUseFrameInterpolation(useFrameInterpolation: boolean)` | Sets whether the animation should update on subframes. |
| `setRenderConfig(renderConfig: RenderConfig)` | Sets the render configuration. check [RenderConfig](#renderconfig) for more details. |
| `loadAnimation(animationId: string)` | Loads a new animation from the .lottie file, using its ID as specified in the `manifest.json` file of the .lottie file. |
| `setMarker(marker: string)` | Sets the lottie named marker to play. |
| `setLayout(layout: Layout)` | Sets the animation layout configuration. |
| `loadTheme(themeId: string)` | Loads a new theme from the .lottie file, using its ID as specified in the `manifest.json` file of the .lottie file. |
| `loadThemeData(themeData: string)` | Loads a new theme from the provided theme data. |
| Method | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `play()` | Begins playback from the current animation position. |
| `pause()` | Pauses the animation without resetting its position. |
| `stop()` | Halts playback and returns the animation to its initial frame. |
| `setSpeed(speed: number)` | Sets the playback speed with the given multiplier. |
| `setLoop(loop: boolean)` | Configures whether the animation should loop continuously. |
| `setFrame(frame: number)` | Directly navigates the animation to a specified frame. |
| `addEventListener(event: string, listener: Function)` | Registers a function to respond to a specific animation event. |
| `removeEventListener(event: string, listener?: Function)` | Removes a previously registered function from responding to a specific animation event. |
| `destroy()` | Destroys the renderer instance and unregisters all event listeners. This method should be called when the canvas is removed from the DOM to prevent memory leaks. |
| `load(config: Config)` | Loads a new configuration or a new animation. |
| `setMode(mode: string)` | Sets the animation play mode. |
| `setSegment(startFrame: number, endFrame: number)` | Sets the start and end frame of the animation. |
| `freeze()` | Freezes the animation by stopping the animation loop. |
| `unfreeze()` | Unfreezes the animation by resuming the animation loop. |
| `setBackgroundColor(color: string)` | Sets the background color of the canvas. |
| `resize()` | This method adjusts the canvas size to match its bounding box dimensions, considering the device's pixel ratio. This prevents the canvas from appearing blurry on high-resolution screens. Call this method when the window or the canvas element is resized. |
| `setUseFrameInterpolation(useFrameInterpolation: boolean)` | Sets whether the animation should update on subframes. |
| `setRenderConfig(renderConfig: RenderConfig)` | Sets the render configuration. check [RenderConfig](#renderconfig) for more details. |
| `loadAnimation(animationId: string)` | Loads a new animation from the .lottie file, using its ID as specified in the `manifest.json` file of the .lottie file. |
| `setMarker(marker: string)` | Sets the lottie named marker to play. |
| `setLayout(layout: Layout)` | Sets the animation layout configuration. |
| `loadTheme(themeId: string)` | Loads a new theme from the .lottie file, using its ID as specified in the `manifest.json` file of the .lottie file. |
| `loadThemeData(themeData: string)` | Loads a new theme from the provided theme data. |
| `setViewport(x: number, y: number, width: number, height: number)` | Sets the viewport of the animation, where x and y are the top-left corner of the viewport, and width and height are the dimensions of the viewport, this will crop the animation to the specified viewport. |

@@ -222,0 +224,0 @@ ### Static Methods

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc