@lottiefiles/dotlottie-web 0.29.1 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6,11 +6,15 @@
6
6
  * As it's generated by the build process.
7
7
  */
8
8
 
9
- var kn=Object.defineProperty;var $n=(g,n,a)=>n in g?kn(g,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):g[n]=a;var C=(g,n,a)=>$n(g,typeof n!="symbol"?n+"":n,a);var Ke=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},Xe=class{constructor(){C(this,"_lastHandleId",0);C(this,"_lastImmediate",null);}requestAnimationFrame(n){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{n(Date.now());}),this._lastHandleId}cancelAnimationFrame(n){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Pe=class{constructor(){C(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Ke:new Xe;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var V=typeof window<"u"&&typeof window.document<"u";var ve={name:"@lottiefiles/dotlottie-web",version:"0.29.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.14.11","@vitest/browser":"^2.0.3","@vitest/coverage-istanbul":"^2.0.3","cross-env":"7.0.3",playwright:"^1.45.2",tsup:"8.1.0",typescript:"5.0.4",vitest:"^2.0.3"},publishConfig:{access:"public"}};var Rn=(()=>{var g=typeof document<"u"?document.currentScript?.src:void 0;return function(n={}){var a=n,c,w,x=new Promise((e,t)=>{c=e,w=t;}),j=Object.assign({},a),U="./this.program",$="";typeof document<"u"&&document.currentScript&&($=document.currentScript.src),g&&($=g),$.startsWith("blob:")?$="":$=$.substr(0,$.replace(/[?#].*/,"").lastIndexOf("/")+1);var Q=a.print||console.log.bind(console),Z=a.printErr||console.error.bind(console);Object.assign(a,j),j=null,a.thisProgram&&(U=a.thisProgram);var ae;a.wasmBinary&&(ae=a.wasmBinary);var ge,nt=!1,G,E,ee,ie,S,M,rt,at;function it(){var e=ge.buffer;a.HEAP8=G=new Int8Array(e),a.HEAP16=ee=new Int16Array(e),a.HEAPU8=E=new Uint8Array(e),a.HEAPU16=ie=new Uint16Array(e),a.HEAP32=S=new Int32Array(e),a.HEAPU32=M=new Uint32Array(e),a.HEAPF32=rt=new Float32Array(e),a.HEAPF64=at=new Float64Array(e);}var ot=[],st=[],lt=[];function Vt(){var e=a.preRun.shift();ot.unshift(e);}var J=0,oe=null;function _e(e){throw a.onAbort?.(e),e="Aborted("+e+")",Z(e),nt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),w(e),e}var dt=e=>e.startsWith("data:application/octet-stream;base64,"),te;if(te="DotLottiePlayer.wasm",!dt(te)){var ut=te;te=a.locateFile?a.locateFile(ut,$):$+ut;}function ct(e){if(e==te&&ae)return new Uint8Array(ae);throw "both async and sync fetching of the wasm failed"}function Yt(e){return ae||typeof fetch!="function"?Promise.resolve().then(()=>ct(e)):fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>ct(e))}function ht(e,t,r){return Yt(e).then(i=>WebAssembly.instantiate(i,t)).then(r,i=>{Z(`failed to asynchronously prepare wasm: ${i}`),_e(i);})}function Nt(e,t){var r=te;return ae||typeof WebAssembly.instantiateStreaming!="function"||dt(r)||typeof fetch!="function"?ht(r,e,t):fetch(r,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,e).then(t,function(o){return Z(`wasm streaming compile failed: ${o}`),Z("falling back to ArrayBuffer instantiation"),ht(r,e,t)}))}var xe=e=>{for(;0<e.length;)e.shift()(a);},pt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q=(e,t,r)=>{var i=t+r;for(r=t;e[r]&&!(r>=i);)++r;if(16<r-t&&e.buffer&&pt)return pt.decode(e.subarray(t,r));for(i="";t<r;){var o=e[t++];if(o&128){var s=e[t++]&63;if((o&224)==192)i+=String.fromCharCode((o&31)<<6|s);else {var u=e[t++]&63;o=(o&240)==224?(o&15)<<12|s<<6|u:(o&7)<<18|s<<12|u<<6|e[t++]&63,65536>o?i+=String.fromCharCode(o):(o-=65536,i+=String.fromCharCode(55296|o>>10,56320|o&1023));}}else i+=String.fromCharCode(o);}return i};class Gt{constructor(t){this.ya=t-24;}}var mt=0,ft=e=>{for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);127>=i?t++:2047>=i?t+=2:55296<=i&&57343>=i?(t+=4,++r):t+=3;}return t},vt=(e,t,r,i)=>{if(0<i){i=r+i-1;for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);if(55296<=s&&57343>=s){var u=e.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023;}if(127>=s){if(r>=i)break;t[r++]=s;}else {if(2047>=s){if(r+1>=i)break;t[r++]=192|s>>6;}else {if(65535>=s){if(r+2>=i)break;t[r++]=224|s>>12;}else {if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63;}t[r++]=128|s>>6&63;}t[r++]=128|s&63;}}t[r]=0;}},ye={},Te=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function se(e){return this.fromWireType(M[e>>2])}var ne={},K={},we={},le,Y=(e,t,r)=>{function i(d){if(d=r(d),d.length!==e.length)throw new le("Mismatched type converter count");for(var p=0;p<e.length;++p)D(e[p],d[p]);}e.forEach(function(d){we[d]=t;});var o=Array(t.length),s=[],u=0;t.forEach((d,p)=>{K.hasOwnProperty(d)?o[p]=K[d]:(s.push(d),ne.hasOwnProperty(d)||(ne[d]=[]),ne[d].push(()=>{o[p]=K[d],++u,u===s.length&&i(o);}));}),s.length===0&&i(o);},gt,P=e=>{for(var t="";E[e];)t+=gt[E[e++]];return t},_;function qt(e,t,r={}){var i=t.name;if(!e)throw new _(`type "${i}" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(r.ib)return;throw new _(`Cannot register type '${i}' twice`)}K[e]=t,delete we[e],ne.hasOwnProperty(e)&&(t=ne[e],delete ne[e],t.forEach(o=>o()));}function D(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return qt(e,t,r)}var ke=e=>{throw new _(e.ma.za.xa.name+" instance already deleted")},$e=!1,_t=()=>{},yt=(e,t,r)=>t===r?e:r.Ca===void 0?null:(e=yt(e,t,r.Ca),e===null?null:r.ab(e)),wt={},de=[],De=()=>{for(;de.length;){var e=de.pop();e.ma.Ka=!1,e.delete();}},ue,ce={},Kt=(e,t)=>{if(t===void 0)throw new _("ptr should not be undefined");for(;e.Ca;)t=e.Na(t),e=e.Ca;return ce[t]},Ce=(e,t)=>{if(!t.za||!t.ya)throw new le("makeClassHandle requires ptr and ptrType");if(!!t.Da!=!!t.Aa)throw new le("Both smartPtrType and smartPtr must be specified");return t.count={value:1},he(Object.create(e,{ma:{value:t,writable:!0}}))},he=e=>typeof FinalizationRegistry>"u"?(he=t=>t,e):($e=new FinalizationRegistry(t=>{t=t.ma,--t.count.value,t.count.value===0&&(t.Aa?t.Da.Fa(t.Aa):t.za.xa.Fa(t.ya));}),he=t=>{var r=t.ma;return r.Aa&&$e.register(t,{ma:r},t),t},_t=t=>{$e.unregister(t);},he(e));function be(){}var pe=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ct=(e,t,r)=>{if(e[t].Ba===void 0){var i=e[t];e[t]=function(...o){if(!e[t].Ba.hasOwnProperty(o.length))throw new _(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].Ba})!`);return e[t].Ba[o.length].apply(this,o)},e[t].Ba=[],e[t].Ba[i.Oa]=i;}},Re=(e,t,r)=>{if(a.hasOwnProperty(e)){if(r===void 0||a[e].Ba!==void 0&&a[e].Ba[r]!==void 0)throw new _(`Cannot register public name '${e}' twice`);if(Ct(a,e,e),a.hasOwnProperty(r))throw new _(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);a[e].Ba[r]=t;}else a[e]=t,r!==void 0&&(a[e].vb=r);},Xt=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function Qt(e,t,r,i,o,s,u,d){this.name=e,this.constructor=t,this.La=r,this.Fa=i,this.Ca=o,this.cb=s,this.Na=u,this.ab=d,this.kb=[];}var We=(e,t,r)=>{for(;t!==r;){if(!t.Na)throw new _(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Na(e),t=t.Ca;}return e};function Zt(e,t){if(t===null){if(this.Ta)throw new _(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new _(`Cannot pass "${Ve(t)}" as a ${this.name}`);if(!t.ma.ya)throw new _(`Cannot pass deleted object as a pointer of type ${this.name}`);return We(t.ma.ya,t.ma.za.xa,this.xa)}function en(e,t){if(t===null){if(this.Ta)throw new _(`null is not a valid ${this.name}`);if(this.Qa){var r=this.Ua();return e!==null&&e.push(this.Fa,r),r}return 0}if(!t||!t.ma)throw new _(`Cannot pass "${Ve(t)}" as a ${this.name}`);if(!t.ma.ya)throw new _(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Pa&&t.ma.za.Pa)throw new _(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);if(r=We(t.ma.ya,t.ma.za.xa,this.xa),this.Qa){if(t.ma.Aa===void 0)throw new _("Passing raw pointer to smart pointer is illegal");switch(this.pb){case 0:if(t.ma.Da===this)r=t.ma.Aa;else throw new _(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);break;case 1:r=t.ma.Aa;break;case 2:if(t.ma.Da===this)r=t.ma.Aa;else {var i=t.clone();r=this.lb(r,Me(()=>i.delete())),e!==null&&e.push(this.Fa,r);}break;default:throw new _("Unsupporting sharing policy")}}return r}function tn(e,t){if(t===null){if(this.Ta)throw new _(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new _(`Cannot pass "${Ve(t)}" as a ${this.name}`);if(!t.ma.ya)throw new _(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.ma.za.Pa)throw new _(`Cannot convert argument of type ${t.ma.za.name} to parameter type ${this.name}`);return We(t.ma.ya,t.ma.za.xa,this.xa)}function me(e,t,r,i,o,s,u,d,p,h,m){this.name=e,this.xa=t,this.Ta=r,this.Pa=i,this.Qa=o,this.jb=s,this.pb=u,this.Za=d,this.Ua=p,this.lb=h,this.Fa=m,o||t.Ca!==void 0?this.toWireType=en:(this.toWireType=i?Zt:tn,this.Ea=null);}var bt=(e,t,r)=>{if(!a.hasOwnProperty(e))throw new le("Replacing nonexistent public symbol");a[e].Ba!==void 0&&r!==void 0?a[e].Ba[r]=t:(a[e]=t,a[e].Oa=r);},k,nn=(e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0, a["dynCall_"+e])(t,...r)):t=k.get(t)(...r),t),rn=(e,t)=>(...r)=>nn(e,t,r),A=(e,t)=>{e=P(e);var r=e.includes("j")?rn(e,t):k.get(t);if(typeof r!="function")throw new _(`unknown function pointer with signature ${e}: ${t}`);return r},Lt,Mt=e=>{e=kt(e);var t=P(e);return H(e),t},Le=(e,t)=>{function r(s){o[s]||K[s]||(we[s]?we[s].forEach(r):(i.push(s),o[s]=!0));}var i=[],o={};throw t.forEach(r),new Lt(`${e}: `+i.map(Mt).join([", "]))},Oe=(e,t)=>{for(var r=[],i=0;i<e;i++)r.push(M[t+4*i>>2]);return r};function an(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Ea===void 0)return !0;return !1}function je(e,t,r,i,o){var s=t.length;if(2>s)throw new _("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=t[1]!==null&&r!==null,d=an(t),p=t[0].name!=="void",h=s-2,m=Array(h),y=[],b=[];return pe(e,function(...l){if(l.length!==h)throw new _(`function ${e} called with ${l.length} arguments, expected ${h}`);if(b.length=0,y.length=u?2:1,y[0]=o,u){var f=t[1].toWireType(b,this);y[1]=f;}for(var v=0;v<h;++v)m[v]=t[v+2].toWireType(b,l[v]),y.push(m[v]);if(l=i(...y),d)Te(b);else for(v=u?1:2;v<t.length;v++){var I=v===1?f:m[v-2];t[v].Ea!==null&&t[v].Ea(I);}return f=p?t[0].fromWireType(l):void 0,f})}var Et=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},ze=[],B=[],Ue=e=>{9<e&&--B[e+1]===0&&(B[e]=void 0,ze.push(e));},Be=e=>{if(!e)throw new _("Cannot use deleted val. handle = "+e);return B[e]},Me=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=ze.pop()||B.length;return B[t]=e,B[t+1]=1,t}},Ft={name:"emscripten::val",fromWireType:e=>{var t=Be(e);return Ue(e),t},toWireType:(e,t)=>Me(t),argPackAdvance:8,readValueFromPointer:se,Ea:null},on=(e,t,r)=>{switch(t){case 1:return r?function(i){return this.fromWireType(G[i])}:function(i){return this.fromWireType(E[i])};case 2:return r?function(i){return this.fromWireType(ee[i>>1])}:function(i){return this.fromWireType(ie[i>>1])};case 4:return r?function(i){return this.fromWireType(S[i>>2])}:function(i){return this.fromWireType(M[i>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},He=(e,t)=>{var r=K[e];if(r===void 0)throw e=`${t} has unknown type ${Mt(e)}`,new _(e);return r},Ve=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},sn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(rt[r>>2])};case 8:return function(r){return this.fromWireType(at[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},ln=(e,t,r)=>{switch(t){case 1:return r?i=>G[i]:i=>E[i];case 2:return r?i=>ee[i>>1]:i=>ie[i>>1];case 4:return r?i=>S[i>>2]:i=>M[i>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},It=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,dn=(e,t)=>{for(var r=e>>1,i=r+t/2;!(r>=i)&&ie[r];)++r;if(r<<=1,32<r-e&&It)return It.decode(E.subarray(e,r));for(r="",i=0;!(i>=t/2);++i){var o=ee[e+2*i>>1];if(o==0)break;r+=String.fromCharCode(o);}return r},un=(e,t,r)=>{if(r??(r=2147483647),2>r)return 0;r-=2;var i=t;r=r<2*e.length?r/2:e.length;for(var o=0;o<r;++o)ee[t>>1]=e.charCodeAt(o),t+=2;return ee[t>>1]=0,t-i},cn=e=>2*e.length,hn=(e,t)=>{for(var r=0,i="";!(r>=t/4);){var o=S[e+4*r>>2];if(o==0)break;++r,65536<=o?(o-=65536,i+=String.fromCharCode(55296|o>>10,56320|o&1023)):i+=String.fromCharCode(o);}return i},pn=(e,t,r)=>{if(r??(r=2147483647),4>r)return 0;var i=t;r=i+r-4;for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);if(55296<=s&&57343>=s){var u=e.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023;}if(S[t>>2]=s,t+=4,t+4>r)break}return S[t>>2]=0,t-i},mn=e=>{for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);55296<=i&&57343>=i&&++r,t+=4;}return t},Ye=[],fn=e=>{var t=Ye.length;return Ye.push(e),t},vn=(e,t)=>{for(var r=Array(e),i=0;i<e;++i)r[i]=He(M[t+4*i>>2],"parameter "+i);return r},gn=Reflect.construct,Ne={},Pt=()=>{if(!Ge){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:U||"./this.program"},t;for(t in Ne)Ne[t]===void 0?delete e[t]:e[t]=Ne[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);Ge=r;}return Ge},Ge,_n=[null,[],[]],yn=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);_e("initRandomDevice");},St=e=>(St=yn())(e),Ee=e=>e%4===0&&(e%100!==0||e%400===0),At=[31,29,31,30,31,30,31,31,30,31,30,31],xt=[31,28,31,30,31,30,31,31,30,31,30,31];function wn(e){var t=Array(ft(e)+1);return vt(e,t,0,t.length),t}var Cn=(e,t,r,i)=>{function o(l,f,v){for(l=typeof l=="number"?l.toString():l||"";l.length<f;)l=v[0]+l;return l}function s(l,f){return o(l,f,"0")}function u(l,f){function v(N){return 0>N?-1:0<N?1:0}var I;return (I=v(l.getFullYear()-f.getFullYear()))===0&&(I=v(l.getMonth()-f.getMonth()))===0&&(I=v(l.getDate()-f.getDate())),I}function d(l){switch(l.getDay()){case 0:return new Date(l.getFullYear()-1,11,29);case 1:return l;case 2:return new Date(l.getFullYear(),0,3);case 3:return new Date(l.getFullYear(),0,2);case 4:return new Date(l.getFullYear(),0,1);case 5:return new Date(l.getFullYear()-1,11,31);case 6:return new Date(l.getFullYear()-1,11,30)}}function p(l){var f=l.Ia;for(l=new Date(new Date(l.Ja+1900,0,1).getTime());0<f;){var v=l.getMonth(),I=(Ee(l.getFullYear())?At:xt)[v];if(f>I-l.getDate())f-=I-l.getDate()+1,l.setDate(1),11>v?l.setMonth(v+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else {l.setDate(l.getDate()+f);break}}return v=new Date(l.getFullYear()+1,0,4),f=d(new Date(l.getFullYear(),0,4)),v=d(v),0>=u(f,l)?0>=u(v,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var h=M[i+40>>2];i={sb:S[i>>2],rb:S[i+4>>2],Ra:S[i+8>>2],Va:S[i+12>>2],Sa:S[i+16>>2],Ja:S[i+20>>2],Ga:S[i+24>>2],Ia:S[i+28>>2],wb:S[i+32>>2],qb:S[i+36>>2],tb:h&&h?q(E,h):""},r=r?q(E,r):"",h={"%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 m in h)r=r.replace(new RegExp(m,"g"),h[m]);var y="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),b="January February March April May June July August September October November December".split(" ");h={"%a":l=>y[l.Ga].substring(0,3),"%A":l=>y[l.Ga],"%b":l=>b[l.Sa].substring(0,3),"%B":l=>b[l.Sa],"%C":l=>s((l.Ja+1900)/100|0,2),"%d":l=>s(l.Va,2),"%e":l=>o(l.Va,2," "),"%g":l=>p(l).toString().substring(2),"%G":p,"%H":l=>s(l.Ra,2),"%I":l=>(l=l.Ra,l==0?l=12:12<l&&(l-=12),s(l,2)),"%j":l=>{for(var f=0,v=0;v<=l.Sa-1;f+=(Ee(l.Ja+1900)?At:xt)[v++]);return s(l.Va+f,3)},"%m":l=>s(l.Sa+1,2),"%M":l=>s(l.rb,2),"%n":()=>`
10
- `,"%p":l=>0<=l.Ra&&12>l.Ra?"AM":"PM","%S":l=>s(l.sb,2),"%t":()=>" ","%u":l=>l.Ga||7,"%U":l=>s(Math.floor((l.Ia+7-l.Ga)/7),2),"%V":l=>{var f=Math.floor((l.Ia+7-(l.Ga+6)%7)/7);if(2>=(l.Ga+371-l.Ia-2)%7&&f++,f)f==53&&(v=(l.Ga+371-l.Ia)%7,v==4||v==3&&Ee(l.Ja)||(f=1));else {f=52;var v=(l.Ga+7-l.Ia-1)%7;(v==4||v==5&&Ee(l.Ja%400-1))&&f++;}return s(f,2)},"%w":l=>l.Ga,"%W":l=>s(Math.floor((l.Ia+7-(l.Ga+6)%7)/7),2),"%y":l=>(l.Ja+1900).toString().substring(2),"%Y":l=>l.Ja+1900,"%z":l=>{l=l.qb;var f=0<=l;return l=Math.abs(l)/60,(f?"+":"-")+("0000"+(l/60*100+l%60)).slice(-4)},"%Z":l=>l.tb,"%%":()=>"%"},r=r.replace(/%%/g,"\0\0");for(m in h)r.includes(m)&&(r=r.replace(new RegExp(m,"g"),h[m](i)));return r=r.replace(/\0\0/g,"%"),m=wn(r),m.length>t?0:(G.set(m,e),m.length-1)};le=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError";}};for(var Tt=Array(256),Fe=0;256>Fe;++Fe)Tt[Fe]=String.fromCharCode(Fe);gt=Tt,_=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError";}},Object.assign(be.prototype,{isAliasOf:function(e){if(!(this instanceof be&&e instanceof be))return !1;var t=this.ma.za.xa,r=this.ma.ya;e.ma=e.ma;var i=e.ma.za.xa;for(e=e.ma.ya;t.Ca;)r=t.Na(r),t=t.Ca;for(;i.Ca;)e=i.Na(e),i=i.Ca;return t===i&&r===e},clone:function(){if(this.ma.ya||ke(this),this.ma.Ma)return this.ma.count.value+=1,this;var e=he,t=Object,r=t.create,i=Object.getPrototypeOf(this),o=this.ma;return e=e(r.call(t,i,{ma:{value:{count:o.count,Ka:o.Ka,Ma:o.Ma,ya:o.ya,za:o.za,Aa:o.Aa,Da:o.Da}}})),e.ma.count.value+=1,e.ma.Ka=!1,e},delete(){if(this.ma.ya||ke(this),this.ma.Ka&&!this.ma.Ma)throw new _("Object already scheduled for deletion");_t(this);var e=this.ma;--e.count.value,e.count.value===0&&(e.Aa?e.Da.Fa(e.Aa):e.za.xa.Fa(e.ya)),this.ma.Ma||(this.ma.Aa=void 0,this.ma.ya=void 0);},isDeleted:function(){return !this.ma.ya},deleteLater:function(){if(this.ma.ya||ke(this),this.ma.Ka&&!this.ma.Ma)throw new _("Object already scheduled for deletion");return de.push(this),de.length===1&&ue&&ue(De),this.ma.Ka=!0,this}}),a.getInheritedInstanceCount=()=>Object.keys(ce).length,a.getLiveInheritedInstances=()=>{var e=[],t;for(t in ce)ce.hasOwnProperty(t)&&e.push(ce[t]);return e},a.flushPendingDeletes=De,a.setDelayFunction=e=>{ue=e,de.length&&ue&&ue(De);},Object.assign(me.prototype,{eb(e){return this.Za&&(e=this.Za(e)),e},Xa(e){this.Fa?.(e);},argPackAdvance:8,readValueFromPointer:se,fromWireType:function(e){function t(){return this.Qa?Ce(this.xa.La,{za:this.jb,ya:r,Da:this,Aa:e}):Ce(this.xa.La,{za:this,ya:e})}var r=this.eb(e);if(!r)return this.Xa(e),null;var i=Kt(this.xa,r);if(i!==void 0)return i.ma.count.value===0?(i.ma.ya=r,i.ma.Aa=e,i.clone()):(i=i.clone(),this.Xa(e),i);if(i=this.xa.cb(r),i=wt[i],!i)return t.call(this);i=this.Pa?i.$a:i.pointerType;var o=yt(r,this.xa,i.xa);return o===null?t.call(this):this.Qa?Ce(i.xa.La,{za:i,ya:o,Da:this,Aa:e}):Ce(i.xa.La,{za:i,ya:o})}}),Lt=a.UnboundTypeError=((e,t)=>{var r=pe(t,function(i){this.name=t,this.message=i,i=Error(i).stack,i!==void 0&&(this.stack=this.toString()+`
11
- `+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})(Error,"UnboundTypeError"),B.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=()=>B.length/2-5-ze.length;var bn={c:(e,t,r,i)=>{_e(`Assertion failed: ${e?q(E,e):""}, at: `+[t?t?q(E,t):"":"unknown filename",r,i?i?q(E,i):"":"unknown function"]);},m:(e,t,r)=>{var i=new Gt(e);throw M[i.ya+16>>2]=0,M[i.ya+4>>2]=t,M[i.ya+8>>2]=r,mt=e,mt},B:function(){return 0},P:()=>{},M:()=>{},R:function(){return 0},N:()=>{},A:function(){},O:()=>{},v:e=>{var t=ye[e];delete ye[e];var r=t.Ua,i=t.Fa,o=t.Ya,s=o.map(u=>u.hb).concat(o.map(u=>u.nb));Y([e],s,u=>{var d={};return o.forEach((p,h)=>{var m=u[h],y=p.fb,b=p.gb,l=u[h+o.length],f=p.mb,v=p.ob;d[p.bb]={read:I=>m.fromWireType(y(b,I)),write:(I,N)=>{var T=[];f(v,I,l.toWireType(T,N)),Te(T);}};}),[{name:t.name,fromWireType:p=>{var h={},m;for(m in d)h[m]=d[m].read(p);return i(p),h},toWireType:(p,h)=>{for(var m in d)if(!(m in h))throw new TypeError(`Missing field: "${m}"`);var y=r();for(m in d)d[m].write(y,h[m]);return p!==null&&p.push(i,y),y},argPackAdvance:8,readValueFromPointer:se,Ea:i}]});},I:()=>{},Y:(e,t,r,i)=>{t=P(t),D(e,{name:t,fromWireType:function(o){return !!o},toWireType:function(o,s){return s?r:i},argPackAdvance:8,readValueFromPointer:function(o){return this.fromWireType(E[o])},Ea:null});},r:(e,t,r,i,o,s,u,d,p,h,m,y,b)=>{m=P(m),s=A(o,s),d&&(d=A(u,d)),h&&(h=A(p,h)),b=A(y,b);var l=Xt(m);Re(l,function(){Le(`Cannot construct ${m} due to unbound types`,[i]);}),Y([e,t,r],i?[i]:[],f=>{if(f=f[0],i)var v=f.xa,I=v.La;else I=be.prototype;f=pe(m,function(...qe){if(Object.getPrototypeOf(this)!==N)throw new _("Use 'new' to construct "+m);if(T.Ha===void 0)throw new _(m+" has no accessible constructor");var Rt=T.Ha[qe.length];if(Rt===void 0)throw new _(`Tried to invoke ctor of ${m} with invalid number of parameters (${qe.length}) - expected (${Object.keys(T.Ha).toString()}) parameters instead!`);return Rt.apply(this,qe)});var N=Object.create(I,{constructor:{value:f}});f.prototype=N;var T=new Qt(m,f,N,b,v,s,d,h);if(T.Ca){var fe;(fe=T.Ca).Wa??(fe.Wa=[]),T.Ca.Wa.push(T);}return v=new me(m,T,!0,!1,!1),fe=new me(m+"*",T,!1,!1,!1),I=new me(m+" const*",T,!1,!0,!1),wt[e]={pointerType:fe,$a:I},bt(l,f),[v,fe,I]});},q:(e,t,r,i,o,s)=>{var u=Oe(t,r);o=A(i,o),Y([],[e],d=>{d=d[0];var p=`constructor ${d.name}`;if(d.xa.Ha===void 0&&(d.xa.Ha=[]),d.xa.Ha[t-1]!==void 0)throw new _(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${d.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return d.xa.Ha[t-1]=()=>{Le(`Cannot construct ${d.name} due to unbound types`,u);},Y([],u,h=>(h.splice(1,0,null),d.xa.Ha[t-1]=je(p,h,null,o,s),[])),[]});},f:(e,t,r,i,o,s,u,d)=>{var p=Oe(r,i);t=P(t),t=Et(t),s=A(o,s),Y([],[e],h=>{function m(){Le(`Cannot call ${y} due to unbound types`,p);}h=h[0];var y=`${h.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),d&&h.xa.kb.push(t);var b=h.xa.La,l=b[t];return l===void 0||l.Ba===void 0&&l.className!==h.name&&l.Oa===r-2?(m.Oa=r-2,m.className=h.name,b[t]=m):(Ct(b,t,y),b[t].Ba[r-2]=m),Y([],p,f=>(f=je(y,f,h,s,u),b[t].Ba===void 0?(f.Oa=r-2,b[t]=f):b[t].Ba[r-2]=f,[])),[]});},X:e=>D(e,Ft),x:(e,t,r,i)=>{function o(){}t=P(t),o.values={},D(e,{name:t,constructor:o,fromWireType:function(s){return this.constructor.values[s]},toWireType:(s,u)=>u.value,argPackAdvance:8,readValueFromPointer:on(t,r,i),Ea:null}),Re(t,o);},k:(e,t,r)=>{var i=He(e,"enum");t=P(t),e=i.constructor,i=Object.create(i.constructor.prototype,{value:{value:r},constructor:{value:pe(`${i.name}_${t}`,function(){})}}),e.values[r]=i,e[t]=i;},C:(e,t,r)=>{t=P(t),D(e,{name:t,fromWireType:i=>i,toWireType:(i,o)=>o,argPackAdvance:8,readValueFromPointer:sn(t,r),Ea:null});},E:(e,t,r,i,o,s)=>{var u=Oe(t,r);e=P(e),e=Et(e),o=A(i,o),Re(e,function(){Le(`Cannot call ${e} due to unbound types`,u);},t-1),Y([],u,d=>(bt(e,je(e,[d[0],null].concat(d.slice(1)),null,o,s),t-1),[]));},l:(e,t,r,i,o)=>{if(t=P(t),o===-1&&(o=4294967295),o=d=>d,i===0){var s=32-8*r;o=d=>d<<s>>>s;}var u=t.includes("unsigned")?function(d,p){return p>>>0}:function(d,p){return p};D(e,{name:t,fromWireType:o,toWireType:u,argPackAdvance:8,readValueFromPointer:ln(t,r,i!==0),Ea:null});},g:(e,t,r)=>{function i(s){return new o(G.buffer,M[s+4>>2],M[s>>2])}var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];r=P(r),D(e,{name:r,fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ib:!0});},w:e=>{D(e,Ft);},ca:(e,t,r,i,o,s,u,d,p,h,m,y)=>{r=P(r),s=A(o,s),d=A(u,d),h=A(p,h),y=A(m,y),Y([e],[t],b=>(b=b[0],[new me(r,b.xa,!1,!1,!0,b,i,s,d,h,y)]));},D:(e,t)=>{t=P(t);var r=t==="std::string";D(e,{name:t,fromWireType:function(i){var o=M[i>>2],s=i+4;if(r)for(var u=s,d=0;d<=o;++d){var p=s+d;if(d==o||E[p]==0){if(u=u?q(E,u,p-u):"",h===void 0)var h=u;else h+="\0",h+=u;u=p+1;}}else {for(h=Array(o),d=0;d<o;++d)h[d]=String.fromCharCode(E[s+d]);h=h.join("");}return H(i),h},toWireType:function(i,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var s=typeof o=="string";if(!(s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array))throw new _("Cannot pass non-string to std::string");var u=r&&s?ft(o):o.length,d=Je(4+u+1),p=d+4;if(M[d>>2]=u,r&&s)vt(o,E,p,u+1);else if(s)for(s=0;s<u;++s){var h=o.charCodeAt(s);if(255<h)throw H(p),new _("String has UTF-16 code units that do not fit in 8 bits");E[p+s]=h;}else for(s=0;s<u;++s)E[p+s]=o[s];return i!==null&&i.push(H,d),d},argPackAdvance:8,readValueFromPointer:se,Ea(i){H(i);}});},u:(e,t,r)=>{if(r=P(r),t===2)var i=dn,o=un,s=cn,u=d=>ie[d>>1];else t===4&&(i=hn,o=pn,s=mn,u=d=>M[d>>2]);D(e,{name:r,fromWireType:d=>{for(var p=M[d>>2],h,m=d+4,y=0;y<=p;++y){var b=d+4+y*t;(y==p||u(b)==0)&&(m=i(m,b-m),h===void 0?h=m:(h+="\0",h+=m),m=b+t);}return H(d),h},toWireType:(d,p)=>{if(typeof p!="string")throw new _(`Cannot pass non-string to C++ string type ${r}`);var h=s(p),m=Je(4+h+t);return M[m>>2]=h/t,o(p,m+4,h+t),d!==null&&d.push(H,m),m},argPackAdvance:8,readValueFromPointer:se,Ea(d){H(d);}});},s:(e,t,r,i,o,s)=>{ye[e]={name:P(t),Ua:A(r,i),Fa:A(o,s),Ya:[]};},j:(e,t,r,i,o,s,u,d,p,h)=>{ye[e].Ya.push({bb:P(t),hb:r,fb:A(i,o),gb:s,nb:u,mb:A(d,p),ob:h});},Z:(e,t)=>{t=P(t),D(e,{ub:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},J:()=>{throw 1/0},aa:(e,t,r,i)=>(e=Ye[e],t=Be(t),e(null,t,r,i)),F:Ue,$:(e,t,r)=>{var i=vn(e,t),o=i.shift();e--;var s=Array(e);return t=`methodCaller<(${i.map(u=>u.name).join(", ")}) => ${o.name}>`,fn(pe(t,(u,d,p,h)=>{for(var m=0,y=0;y<e;++y)s[y]=i[y].readValueFromPointer(h+m),m+=i[y].argPackAdvance;return d=r===1?gn(d,s):d.apply(u,s),u=[],d=o.toWireType(u,d),u.length&&(M[p>>2]=Me(u)),d}))},ba:e=>{9<e&&(B[e+1]+=1);},_:e=>{var t=Be(e);Te(t),Ue(e);},o:(e,t)=>(e=He(e,"_emval_take_value"),e=e.readValueFromPointer(t),Me(e)),W:()=>{_e("");},V:()=>performance.now(),L:e=>{var t=E.length;if(e>>>=0,2147483648<e)return !1;for(var r=1;4>=r;r*=2){var i=t*(1+.2/r);i=Math.min(i,e+100663296);var o=Math;i=Math.max(e,i);e:{o=(o.min.call(o,2147483648,i+(65536-i%65536)%65536)-ge.buffer.byteLength+65535)/65536;try{ge.grow(o),it();var s=1;break e}catch{}s=void 0;}if(s)return !0}return !1},S:(e,t)=>{var r=0;return Pt().forEach((i,o)=>{var s=t+r;for(o=M[e+4*o>>2]=s,s=0;s<i.length;++s)G[o++]=i.charCodeAt(s);G[o]=0,r+=i.length+1;}),0},T:(e,t)=>{var r=Pt();M[e>>2]=r.length;var i=0;return r.forEach(o=>i+=o.length+1),M[t>>2]=i,0},t:()=>52,z:()=>52,H:function(){return 70},Q:(e,t,r,i)=>{for(var o=0,s=0;s<r;s++){var u=M[t>>2],d=M[t+4>>2];t+=8;for(var p=0;p<d;p++){var h=E[u+p],m=_n[e];h===0||h===10?((e===1?Q:Z)(q(m,0)),m.length=0):m.push(h);}o+=d;}return M[i>>2]=o,0},U:(e,t)=>(St(E.subarray(e,e+t)),0),i:In,d:Fn,e:En,p:Pn,y:xn,b:Ln,a:Mn,h:An,n:Sn,G:Tn,K:(e,t,r,i)=>Cn(e,t,r,i)},F=function(){function e(r){return F=r.exports,ge=F.da,it(),k=F.ha,st.unshift(F.ea),J--,a.monitorRunDependencies?.(J),J==0&&(oe&&(r=oe,oe=null,r())),F}var t={a:bn};if(J++,a.monitorRunDependencies?.(J),a.instantiateWasm)try{return a.instantiateWasm(t,e)}catch(r){Z(`Module.instantiateWasm callback failed with error: ${r}`),w(r);}return Nt(t,function(r){e(r.instance);}).catch(w),{}}(),Je=e=>(Je=F.fa)(e),kt=e=>(kt=F.ga)(e),H=e=>(H=F.ia)(e),R=(e,t)=>(R=F.ja)(e,t),W=e=>(W=F.ka)(e),O=()=>(O=F.la)();a.dynCall_iijj=(e,t,r,i,o,s)=>(a.dynCall_iijj=F.na)(e,t,r,i,o,s),a.dynCall_vijj=(e,t,r,i,o,s)=>(a.dynCall_vijj=F.oa)(e,t,r,i,o,s),a.dynCall_jiii=(e,t,r,i)=>(a.dynCall_jiii=F.pa)(e,t,r,i),a.dynCall_jii=(e,t,r)=>(a.dynCall_jii=F.qa)(e,t,r);var $t=a.dynCall_viiij=(e,t,r,i,o,s)=>($t=a.dynCall_viiij=F.ra)(e,t,r,i,o,s);a.dynCall_jiji=(e,t,r,i,o)=>(a.dynCall_jiji=F.sa)(e,t,r,i,o),a.dynCall_viijii=(e,t,r,i,o,s,u)=>(a.dynCall_viijii=F.ta)(e,t,r,i,o,s,u),a.dynCall_iiiiij=(e,t,r,i,o,s,u)=>(a.dynCall_iiiiij=F.ua)(e,t,r,i,o,s,u),a.dynCall_iiiiijj=(e,t,r,i,o,s,u,d,p)=>(a.dynCall_iiiiijj=F.va)(e,t,r,i,o,s,u,d,p),a.dynCall_iiiiiijj=(e,t,r,i,o,s,u,d,p,h)=>(a.dynCall_iiiiiijj=F.wa)(e,t,r,i,o,s,u,d,p,h);function Ln(e,t){var r=O();try{k.get(e)(t);}catch(i){if(W(r),i!==i+0)throw i;R(1,0);}}function Mn(e,t,r){var i=O();try{k.get(e)(t,r);}catch(o){if(W(i),o!==o+0)throw o;R(1,0);}}function En(e,t,r,i){var o=O();try{return k.get(e)(t,r,i)}catch(s){if(W(o),s!==s+0)throw s;R(1,0);}}function Fn(e,t,r){var i=O();try{return k.get(e)(t,r)}catch(o){if(W(i),o!==o+0)throw o;R(1,0);}}function In(e,t){var r=O();try{return k.get(e)(t)}catch(i){if(W(r),i!==i+0)throw i;R(1,0);}}function Pn(e,t,r,i,o,s){var u=O();try{return k.get(e)(t,r,i,o,s)}catch(d){if(W(u),d!==d+0)throw d;R(1,0);}}function Sn(e,t,r,i,o){var s=O();try{k.get(e)(t,r,i,o);}catch(u){if(W(s),u!==u+0)throw u;R(1,0);}}function An(e,t,r,i){var o=O();try{k.get(e)(t,r,i);}catch(s){if(W(o),s!==s+0)throw s;R(1,0);}}function xn(e){var t=O();try{k.get(e)();}catch(r){if(W(t),r!==r+0)throw r;R(1,0);}}function Tn(e,t,r,i,o,s){var u=O();try{$t(e,t,r,i,o,s);}catch(d){if(W(u),d!==d+0)throw d;R(1,0);}}var Ie;oe=function e(){Ie||Dt(),Ie||(oe=e);};function Dt(){function e(){if(!Ie&&(Ie=!0,a.calledRun=!0,!nt)){if(xe(st),c(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var t=a.postRun.shift();lt.unshift(t);}xe(lt);}}if(!(0<J)){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)Vt();xe(ot),0<J||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("");},1),e();},1)):e());}}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return Dt(),x}})(),Wt=Rn;var X=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(n){return await Wt({locateFile:()=>n})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async n=>{let a=`https://unpkg.com/${ve.name}@${ve.version}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${n.message}`),console.warn(`Attempting to load WASM from backup URL: ${a}`);try{return await this._tryLoad(a)}catch(c){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${c.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};C(X,"_ModulePromise",null),C(X,"_wasmURL",`https://cdn.jsdelivr.net/npm/${ve.name}@${ve.version}/dist/dotlottie-player.wasm`);var re=class{constructor(){C(this,"_eventListeners",new Map);}addEventListener(n,a){let c=this._eventListeners.get(n);c||(c=new Set,this._eventListeners.set(n,c)),c.add(a);}removeEventListener(n,a){let c=this._eventListeners.get(n);c&&(a?(c.delete(a),c.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){this._eventListeners.get(n.type)?.forEach(c=>c(n));}removeAllEventListeners(){this._eventListeners.clear();}};function Wn(g){return /^#([\da-f]{6}|[\da-f]{8})$/iu.test(g)}function Ot(g){if(!Wn(g))return 0;let n=g.replace("#","");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}var Qe=(g,n)=>g==="reverse"?n.Mode.Reverse:g==="bounce"?n.Mode.Bounce:g==="reverse-bounce"?n.Mode.ReverseBounce:n.Mode.Forward,Ze=(g,n)=>g==="contain"?n.Fit.Contain:g==="cover"?n.Fit.Cover:g==="fill"?n.Fit.Fill:g==="fit-height"?n.Fit.FitHeight:g==="fit-width"?n.Fit.FitWidth:n.Fit.None,et=(g,n)=>{let a=new n.VectorFloat;return a.push_back(g[0]),a.push_back(g[1]),a},tt=(g,n)=>{let a=new n.VectorFloat;return g.length!==2||(a.push_back(g[0]),a.push_back(g[1])),a},L=class L{constructor(n){C(this,"_canvas");C(this,"_context",null);C(this,"_eventManager");C(this,"_animationFrameId",null);C(this,"_frameManager");C(this,"_dotLottieCore",null);C(this,"_renderConfig",{});C(this,"_isFrozen",!1);C(this,"_backgroundColor",null);this._canvas=n.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new re,this._frameManager=new Pe,this._renderConfig=n.renderConfig??{},X.load().then(a=>{L._wasmModule=a,this._dotLottieCore=new a.DotLottiePlayer({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:Qe(n.mode??"forward",a),segment:tt(n.segment??[],a),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:et(n.layout.align,a),fit:Ze(n.layout.fit,a)}:a.createDefaultLayout()}),this._eventManager.dispatch({type:"ready"}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),n.backgroundColor&&this.setBackgroundColor(n.backgroundColor);}).catch(a=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${a}`)});});}_loadFromSrc(n){async function a(){let c=await fetch(n);if(!c.ok)throw new Error(`Failed to fetch the animation data from URL: ${n}. ${c.status}: ${c.statusText}`);let w=(c.headers.get("content-type")??"").trim(),x;return ["application/json","text/plain"].some(j=>w.startsWith(j))?x=await c.text():x=await c.arrayBuffer(),x}a().then(c=>{this._loadFromData(c);}).catch(c=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load animation data from URL: ${n}. ${c}`)});});}_loadFromData(n){if(this._dotLottieCore===null)return;let a=this._canvas.width,c=this._canvas.height,w=!1;if(typeof n=="string")w=this._dotLottieCore.loadAnimationData(n,a,c);else if(n instanceof ArrayBuffer)w=this._dotLottieCore.loadDotLottieData(n,a,c);else if(typeof n=="object")w=this._dotLottieCore.loadAnimationData(JSON.stringify(n),a,c);else {this._eventManager.dispatch({type:"loadError",error:new Error("Unsupported data type for animation data. Expected a string or ArrayBuffer.")});return}w?(this._eventManager.dispatch({type:"load"}),V&&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 n=this._dotLottieCore?.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{switch(n.fit){case L._wasmModule?.Fit.Contain:return "contain";case L._wasmModule?.Fit.Cover:return "cover";case L._wasmModule?.Fit.Fill:return "fill";case L._wasmModule?.Fit.FitHeight:return "fit-height";case L._wasmModule?.Fit.FitWidth:return "fit-width";case L._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let n=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!n)return null;let a=JSON.parse(n);return Object.keys(a).length===0?null:a}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let n=this._dotLottieCore?.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let n=this._dotLottieCore?.config().mode;return n===L._wasmModule?.Mode.Reverse?"reverse":n===L._wasmModule?.Mode.Bounce?"bounce":n===L._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 isReady(){return this._dotLottieCore!==null}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}get canvas(){return this._canvas}load(n){this._dotLottieCore===null||L._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:Qe(n.mode??"forward",L._wasmModule),segment:tt(n.segment??[],L._wasmModule),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:et(n.layout.align,L._wasmModule),fit:Ze(n.layout.fit,L._wasmModule)}:L._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor(n.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let a=this._dotLottieCore.buffer(),c=new Uint8ClampedArray(a,0,this._canvas.width*this._canvas.height*4),w=null;return typeof ImageData>"u"?(w=this._context.createImageData(this._canvas.width,this._canvas.height),w.data.set(c)):w=new ImageData(c,this._canvas.width,this._canvas.height),this._context.putImageData(w,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 n=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(n)&&(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 n=this._dotLottieCore.play();this._isFrozen=!1,n&&(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(n){if(this._dotLottieCore===null||n<0||n>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(n)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:n});}setBackgroundColor(n){this._dotLottieCore!==null&&(V&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:Ot(n)}),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:n});}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:n});}addEventListener(n,a){this._eventManager.addEventListener(n,a);}removeEventListener(n,a){this._eventManager.removeEventListener(n,a);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}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(V&&this._canvas instanceof HTMLCanvasElement){let a=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:c,width:w}=this._canvas.getBoundingClientRect();this._canvas.width=w*a,this._canvas.height=c*a;}this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,a){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:tt([n,a],L._wasmModule)});}setMode(n){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:Qe(n,L._wasmModule)});}setRenderConfig(n){this._renderConfig=n;}loadAnimation(n){if(this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===n)return;this._dotLottieCore.loadAnimation(n,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${n}`)});}setMarker(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:n});}markers(){let n=this._dotLottieCore?.markers();if(n){let a=[];for(let c=0;c<n.size();c+=1){let w=n.get(c);a.push({name:w.name,time:w.time,duration:w.duration});}return a}return []}loadTheme(n){if(this._dotLottieCore===null)return !1;let a=this._dotLottieCore.loadTheme(n);return this._render(),a}loadThemeData(n){if(this._dotLottieCore===null)return !1;let a=this._dotLottieCore.loadThemeData(n);return this._render(),a}setLayout(n){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:et(n.align,L._wasmModule),fit:Ze(n.fit,L._wasmModule)}});}setViewport(n,a,c,w){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(n,a,c,w)}static setWasmUrl(n){X.setWasmUrl(n);}loadStateMachine(n){return this._dotLottieCore?.loadStateMachine(n)??!1}startStateMachine(){let n=this._dotLottieCore?.startStateMachine()??!1;return n&&this._setupStateMachineListeners(),n}stopStateMachine(){let n=this._dotLottieCore?.stopStateMachine()??!1;return n&&this._cleanupStateMachineListeners(),n}_getPointerPosition(n){let a=this._canvas.getBoundingClientRect(),c=this._canvas.width/a.width,w=this._canvas.height/a.height,x=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,j=(n.clientX-a.left)*c/x,U=(n.clientY-a.top)*w/x;return {x:j,y:U}}_onPointerUp(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${a} ${c}`);}_onPointerDown(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${a} ${c}`);}_onPointerMove(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${a} ${c}`);}_onPointerEnter(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${a} ${c}`);}_onPointerLeave(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${a} ${c}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}postStateMachineEvent(n){return this._dotLottieCore?.postEventPayload(n)??!1}getStateMachineListeners(){if(!this._dotLottieCore)return [];let n=this._dotLottieCore.stateMachineFrameworkSetup(),a=[];for(let c=0;c<n.size();c+=1)a.push(n.get(c));return a}_setupStateMachineListeners(){if(V&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let n=this.getStateMachineListeners();n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){V&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}loadStateMachineData(n){return this._dotLottieCore?.loadStateMachineData(n)??!1}animationSize(){let n=this._dotLottieCore?.animationSize().get(0)??0,a=this._dotLottieCore?.animationSize().get(1)??0;return {width:n,height:a}}setStateMachineBooleanContext(n,a){return this._dotLottieCore?.setStateMachineBooleanContext(n,a)??!1}setStateMachineNumericContext(n,a){return this._dotLottieCore?.setStateMachineNumericContext(n,a)??!1}setStateMachineStringContext(n,a){return this._dotLottieCore?.setStateMachineStringContext(n,a)??!1}};C(L,"_wasmModule",null);var jt=L;var zt='/**\n * This is a worker script for dotlottie.\n * Do not modify this file directly.\n * As it\'s generated by the build process.\n */\n \nvar Pn=Object.defineProperty;var An=(s,n,a)=>n in s?Pn(s,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[n]=a;var I=(s,n,a)=>An(s,typeof n!="symbol"?n+"":n,a);var Ke=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},Xe=class{constructor(){I(this,"_lastHandleId",0);I(this,"_lastImmediate",null);}requestAnimationFrame(n){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{n(Date.now());}),this._lastHandleId}cancelAnimationFrame(n){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Ie=class{constructor(){I(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Ke:new Xe;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var te=typeof window<"u"&&typeof window.document<"u";var me={name:"@lottiefiles/dotlottie-web",version:"0.29.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.14.11","@vitest/browser":"^2.0.3","@vitest/coverage-istanbul":"^2.0.3","cross-env":"7.0.3",playwright:"^1.45.2",tsup:"8.1.0",typescript:"5.0.4",vitest:"^2.0.3"},publishConfig:{access:"public"}};var Sn=(()=>{var s=typeof document<"u"?document.currentScript?.src:void 0;return function(n={}){var a=n,d,w,T=new Promise((e,t)=>{d=e,w=t;}),W=Object.assign({},a),Y="./this.program",j="";typeof document<"u"&&document.currentScript&&(j=document.currentScript.src),s&&(j=s),j.startsWith("blob:")?j="":j=j.substr(0,j.replace(/[?#].*/,"").lastIndexOf("/")+1);var Wt=a.print||console.log.bind(console),Q=a.printErr||console.error.bind(console);Object.assign(a,W),W=null,a.thisProgram&&(Y=a.thisProgram);var ne;a.wasmBinary&&(ne=a.wasmBinary);var ve,tt=!1,G,b,Z,re,A,L,nt,rt;function at(){var e=ve.buffer;a.HEAP8=G=new Int8Array(e),a.HEAP16=Z=new Int16Array(e),a.HEAPU8=b=new Uint8Array(e),a.HEAPU16=re=new Uint16Array(e),a.HEAP32=A=new Int32Array(e),a.HEAPU32=L=new Uint32Array(e),a.HEAPF32=nt=new Float32Array(e),a.HEAPF64=rt=new Float64Array(e);}var ot=[],it=[],st=[];function jt(){var e=a.preRun.shift();ot.unshift(e);}var N=0,ae=null;function ye(e){throw a.onAbort?.(e),e="Aborted("+e+")",Q(e),tt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),w(e),e}var lt=e=>e.startsWith("data:application/octet-stream;base64,"),q;if(q="DotLottiePlayer.wasm",!lt(q)){var dt=q;q=a.locateFile?a.locateFile(dt,j):j+dt;}function ct(e){if(e==q&&ne)return new Uint8Array(ne);throw "both async and sync fetching of the wasm failed"}function Bt(e){return ne||typeof fetch!="function"?Promise.resolve().then(()=>ct(e)):fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at \'${e}\'`;return t.arrayBuffer()}).catch(()=>ct(e))}function ut(e,t,r){return Bt(e).then(o=>WebAssembly.instantiate(o,t)).then(r,o=>{Q(`failed to asynchronously prepare wasm: ${o}`),ye(o);})}function Ut(e,t){var r=q;return ne||typeof WebAssembly.instantiateStreaming!="function"||lt(r)||typeof fetch!="function"?ut(r,e,t):fetch(r,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(t,function(i){return Q(`wasm streaming compile failed: ${i}`),Q("falling back to ArrayBuffer instantiation"),ut(r,e,t)}))}var Ae=e=>{for(;0<e.length;)e.shift()(a);},ht=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,J=(e,t,r)=>{var o=t+r;for(r=t;e[r]&&!(r>=o);)++r;if(16<r-t&&e.buffer&&ht)return ht.decode(e.subarray(t,r));for(o="";t<r;){var i=e[t++];if(i&128){var l=e[t++]&63;if((i&224)==192)o+=String.fromCharCode((i&31)<<6|l);else {var h=e[t++]&63;i=(i&240)==224?(i&15)<<12|l<<6|h:(i&7)<<18|l<<12|h<<6|e[t++]&63,65536>i?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023));}}else o+=String.fromCharCode(i);}return o};class Ht{constructor(t){this.ya=t-24;}}var pt=0,mt=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);127>=o?t++:2047>=o?t+=2:55296<=o&&57343>=o?(t+=4,++r):t+=3;}return t},ft=(e,t,r,o)=>{if(0<o){o=r+o-1;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(127>=l){if(r>=o)break;t[r++]=l;}else {if(2047>=l){if(r+1>=o)break;t[r++]=192|l>>6;}else {if(65535>=l){if(r+2>=o)break;t[r++]=224|l>>12;}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;}}t[r]=0;}},ge={},Te=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function oe(e){return this.fromWireType(L[e>>2])}var ee={},K={},we={},ie,H=(e,t,r)=>{function o(u){if(u=r(u),u.length!==e.length)throw new ie("Mismatched type converter count");for(var m=0;m<e.length;++m)k(e[m],u[m]);}e.forEach(function(u){we[u]=t;});var i=Array(t.length),l=[],h=0;t.forEach((u,m)=>{K.hasOwnProperty(u)?i[m]=K[u]:(l.push(u),ee.hasOwnProperty(u)||(ee[u]=[]),ee[u].push(()=>{i[m]=K[u],++h,h===l.length&&o(i);}));}),l.length===0&&o(i);},vt,P=e=>{for(var t="";b[e];)t+=vt[b[e++]];return t},g;function Yt(e,t,r={}){var o=t.name;if(!e)throw new g(`type "${o}" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(r.ib)return;throw new g(`Cannot register type \'${o}\' twice`)}K[e]=t,delete we[e],ee.hasOwnProperty(e)&&(t=ee[e],delete ee[e],t.forEach(i=>i()));}function k(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Yt(e,t,r)}var Se=e=>{throw new g(e.ma.za.xa.name+" instance already deleted")},Re=!1,yt=()=>{},gt=(e,t,r)=>t===r?e:r.Ca===void 0?null:(e=gt(e,t,r.Ca),e===null?null:r.ab(e)),wt={},se=[],$e=()=>{for(;se.length;){var e=se.pop();e.ma.Ka=!1,e.delete();}},le,de={},Gt=(e,t)=>{if(t===void 0)throw new g("ptr should not be undefined");for(;e.Ca;)t=e.Na(t),e=e.Ca;return de[t]},_e=(e,t)=>{if(!t.za||!t.ya)throw new ie("makeClassHandle requires ptr and ptrType");if(!!t.Da!=!!t.Aa)throw new ie("Both smartPtrType and smartPtr must be specified");return t.count={value:1},ce(Object.create(e,{ma:{value:t,writable:!0}}))},ce=e=>typeof FinalizationRegistry>"u"?(ce=t=>t,e):(Re=new FinalizationRegistry(t=>{t=t.ma,--t.count.value,t.count.value===0&&(t.Aa?t.Da.Fa(t.Aa):t.za.xa.Fa(t.ya));}),ce=t=>{var r=t.ma;return r.Aa&&Re.register(t,{ma:r},t),t},yt=t=>{Re.unregister(t);},ce(e));function Ee(){}var ue=(e,t)=>Object.defineProperty(t,"name",{value:e}),_t=(e,t,r)=>{if(e[t].Ba===void 0){var o=e[t];e[t]=function(...i){if(!e[t].Ba.hasOwnProperty(i.length))throw new g(`Function \'${r}\' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].Ba})!`);return e[t].Ba[i.length].apply(this,i)},e[t].Ba=[],e[t].Ba[o.Oa]=o;}},ke=(e,t,r)=>{if(a.hasOwnProperty(e)){if(r===void 0||a[e].Ba!==void 0&&a[e].Ba[r]!==void 0)throw new g(`Cannot register public name \'${e}\' twice`);if(_t(a,e,e),a.hasOwnProperty(r))throw new g(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);a[e].Ba[r]=t;}else a[e]=t,r!==void 0&&(a[e].vb=r);},Nt=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function Jt(e,t,r,o,i,l,h,u){this.name=e,this.constructor=t,this.La=r,this.Fa=o,this.Ca=i,this.cb=l,this.Na=h,this.ab=u,this.kb=[];}var De=(e,t,r)=>{for(;t!==r;){if(!t.Na)throw new g(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Na(e),t=t.Ca;}return e};function Kt(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass "${He(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);return De(t.ma.ya,t.ma.za.xa,this.xa)}function Xt(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);if(this.Qa){var r=this.Ua();return e!==null&&e.push(this.Fa,r),r}return 0}if(!t||!t.ma)throw new g(`Cannot pass "${He(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Pa&&t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);if(r=De(t.ma.ya,t.ma.za.xa,this.xa),this.Qa){if(t.ma.Aa===void 0)throw new g("Passing raw pointer to smart pointer is illegal");switch(this.pb){case 0:if(t.ma.Da===this)r=t.ma.Aa;else throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);break;case 1:r=t.ma.Aa;break;case 2:if(t.ma.Da===this)r=t.ma.Aa;else {var o=t.clone();r=this.lb(r,Me(()=>o.delete())),e!==null&&e.push(this.Fa,r);}break;default:throw new g("Unsupporting sharing policy")}}return r}function Qt(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass "${He(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.za.name} to parameter type ${this.name}`);return De(t.ma.ya,t.ma.za.xa,this.xa)}function he(e,t,r,o,i,l,h,u,m,p,f){this.name=e,this.xa=t,this.Ta=r,this.Pa=o,this.Qa=i,this.jb=l,this.pb=h,this.Za=u,this.Ua=m,this.lb=p,this.Fa=f,i||t.Ca!==void 0?this.toWireType=Xt:(this.toWireType=o?Kt:Qt,this.Ea=null);}var Et=(e,t,r)=>{if(!a.hasOwnProperty(e))throw new ie("Replacing nonexistent public symbol");a[e].Ba!==void 0&&r!==void 0?a[e].Ba[r]=t:(a[e]=t,a[e].Oa=r);},$,Zt=(e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0, a["dynCall_"+e])(t,...r)):t=$.get(t)(...r),t),qt=(e,t)=>(...r)=>Zt(e,t,r),S=(e,t)=>{e=P(e);var r=e.includes("j")?qt(e,t):$.get(t);if(typeof r!="function")throw new g(`unknown function pointer with signature ${e}: ${t}`);return r},Ct,Mt=e=>{e=St(e);var t=P(e);return U(e),t},Ce=(e,t)=>{function r(l){i[l]||K[l]||(we[l]?we[l].forEach(r):(o.push(l),i[l]=!0));}var o=[],i={};throw t.forEach(r),new Ct(`${e}: `+o.map(Mt).join([", "]))},ze=(e,t)=>{for(var r=[],o=0;o<e;o++)r.push(L[t+4*o>>2]);return r};function en(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Ea===void 0)return !0;return !1}function Oe(e,t,r,o,i){var l=t.length;if(2>l)throw new g("argTypes array size mismatch! Must at least get return value and \'this\' types!");var h=t[1]!==null&&r!==null,u=en(t),m=t[0].name!=="void",p=l-2,f=Array(p),_=[],C=[];return ue(e,function(...c){if(c.length!==p)throw new g(`function ${e} called with ${c.length} arguments, expected ${p}`);if(C.length=0,_.length=h?2:1,_[0]=i,h){var v=t[1].toWireType(C,this);_[1]=v;}for(var y=0;y<p;++y)f[y]=t[y+2].toWireType(C,c[y]),_.push(f[y]);if(c=o(..._),u)Te(C);else for(y=h?1:2;y<t.length;y++){var x=y===1?v:f[y-2];t[y].Ea!==null&&t[y].Ea(x);}return v=m?t[0].fromWireType(c):void 0,v})}var Lt=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},We=[],B=[],je=e=>{9<e&&--B[e+1]===0&&(B[e]=void 0,We.push(e));},Be=e=>{if(!e)throw new g("Cannot use deleted val. handle = "+e);return B[e]},Me=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=We.pop()||B.length;return B[t]=e,B[t+1]=1,t}},bt={name:"emscripten::val",fromWireType:e=>{var t=Be(e);return je(e),t},toWireType:(e,t)=>Me(t),argPackAdvance:8,readValueFromPointer:oe,Ea:null},tn=(e,t,r)=>{switch(t){case 1:return r?function(o){return this.fromWireType(G[o])}:function(o){return this.fromWireType(b[o])};case 2:return r?function(o){return this.fromWireType(Z[o>>1])}:function(o){return this.fromWireType(re[o>>1])};case 4:return r?function(o){return this.fromWireType(A[o>>2])}:function(o){return this.fromWireType(L[o>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ue=(e,t)=>{var r=K[e];if(r===void 0)throw e=`${t} has unknown type ${Mt(e)}`,new g(e);return r},He=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},nn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(nt[r>>2])};case 8:return function(r){return this.fromWireType(rt[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},rn=(e,t,r)=>{switch(t){case 1:return r?o=>G[o]:o=>b[o];case 2:return r?o=>Z[o>>1]:o=>re[o>>1];case 4:return r?o=>A[o>>2]:o=>L[o>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ft=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,an=(e,t)=>{for(var r=e>>1,o=r+t/2;!(r>=o)&&re[r];)++r;if(r<<=1,32<r-e&&Ft)return Ft.decode(b.subarray(e,r));for(r="",o=0;!(o>=t/2);++o){var i=Z[e+2*o>>1];if(i==0)break;r+=String.fromCharCode(i);}return r},on=(e,t,r)=>{if(r??(r=2147483647),2>r)return 0;r-=2;var o=t;r=r<2*e.length?r/2:e.length;for(var i=0;i<r;++i)Z[t>>1]=e.charCodeAt(i),t+=2;return Z[t>>1]=0,t-o},sn=e=>2*e.length,ln=(e,t)=>{for(var r=0,o="";!(r>=t/4);){var i=A[e+4*r>>2];if(i==0)break;++r,65536<=i?(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023)):o+=String.fromCharCode(i);}return o},dn=(e,t,r)=>{if(r??(r=2147483647),4>r)return 0;var o=t;r=o+r-4;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(A[t>>2]=l,t+=4,t+4>r)break}return A[t>>2]=0,t-o},cn=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);55296<=o&&57343>=o&&++r,t+=4;}return t},Ve=[],un=e=>{var t=Ve.length;return Ve.push(e),t},hn=(e,t)=>{for(var r=Array(e),o=0;o<e;++o)r[o]=Ue(L[t+4*o>>2],"parameter "+o);return r},pn=Reflect.construct,Ye={},It=()=>{if(!Ge){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Y||"./this.program"},t;for(t in Ye)Ye[t]===void 0?delete e[t]:e[t]=Ye[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);Ge=r;}return Ge},Ge,mn=[null,[],[]],fn=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ye("initRandomDevice");},xt=e=>(xt=fn())(e),Le=e=>e%4===0&&(e%100!==0||e%400===0),Pt=[31,29,31,30,31,30,31,31,30,31,30,31],At=[31,28,31,30,31,30,31,31,30,31,30,31];function vn(e){var t=Array(mt(e)+1);return ft(e,t,0,t.length),t}var yn=(e,t,r,o)=>{function i(c,v,y){for(c=typeof c=="number"?c.toString():c||"";c.length<v;)c=y[0]+c;return c}function l(c,v){return i(c,v,"0")}function h(c,v){function y(V){return 0>V?-1:0<V?1:0}var x;return (x=y(c.getFullYear()-v.getFullYear()))===0&&(x=y(c.getMonth()-v.getMonth()))===0&&(x=y(c.getDate()-v.getDate())),x}function u(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 m(c){var v=c.Ia;for(c=new Date(new Date(c.Ja+1900,0,1).getTime());0<v;){var y=c.getMonth(),x=(Le(c.getFullYear())?Pt:At)[y];if(v>x-c.getDate())v-=x-c.getDate()+1,c.setDate(1),11>y?c.setMonth(y+1):(c.setMonth(0),c.setFullYear(c.getFullYear()+1));else {c.setDate(c.getDate()+v);break}}return y=new Date(c.getFullYear()+1,0,4),v=u(new Date(c.getFullYear(),0,4)),y=u(y),0>=h(v,c)?0>=h(y,c)?c.getFullYear()+1:c.getFullYear():c.getFullYear()-1}var p=L[o+40>>2];o={sb:A[o>>2],rb:A[o+4>>2],Ra:A[o+8>>2],Va:A[o+12>>2],Sa:A[o+16>>2],Ja:A[o+20>>2],Ga:A[o+24>>2],Ia:A[o+28>>2],wb:A[o+32>>2],qb:A[o+36>>2],tb:p&&p?J(b,p):""},r=r?J(b,r):"",p={"%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 f in p)r=r.replace(new RegExp(f,"g"),p[f]);var _="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),C="January February March April May June July August September October November December".split(" ");p={"%a":c=>_[c.Ga].substring(0,3),"%A":c=>_[c.Ga],"%b":c=>C[c.Sa].substring(0,3),"%B":c=>C[c.Sa],"%C":c=>l((c.Ja+1900)/100|0,2),"%d":c=>l(c.Va,2),"%e":c=>i(c.Va,2," "),"%g":c=>m(c).toString().substring(2),"%G":m,"%H":c=>l(c.Ra,2),"%I":c=>(c=c.Ra,c==0?c=12:12<c&&(c-=12),l(c,2)),"%j":c=>{for(var v=0,y=0;y<=c.Sa-1;v+=(Le(c.Ja+1900)?Pt:At)[y++]);return l(c.Va+v,3)},"%m":c=>l(c.Sa+1,2),"%M":c=>l(c.rb,2),"%n":()=>`\n`,"%p":c=>0<=c.Ra&&12>c.Ra?"AM":"PM","%S":c=>l(c.sb,2),"%t":()=>" ","%u":c=>c.Ga||7,"%U":c=>l(Math.floor((c.Ia+7-c.Ga)/7),2),"%V":c=>{var v=Math.floor((c.Ia+7-(c.Ga+6)%7)/7);if(2>=(c.Ga+371-c.Ia-2)%7&&v++,v)v==53&&(y=(c.Ga+371-c.Ia)%7,y==4||y==3&&Le(c.Ja)||(v=1));else {v=52;var y=(c.Ga+7-c.Ia-1)%7;(y==4||y==5&&Le(c.Ja%400-1))&&v++;}return l(v,2)},"%w":c=>c.Ga,"%W":c=>l(Math.floor((c.Ia+7-(c.Ga+6)%7)/7),2),"%y":c=>(c.Ja+1900).toString().substring(2),"%Y":c=>c.Ja+1900,"%z":c=>{c=c.qb;var v=0<=c;return c=Math.abs(c)/60,(v?"+":"-")+("0000"+(c/60*100+c%60)).slice(-4)},"%Z":c=>c.tb,"%%":()=>"%"},r=r.replace(/%%/g,"\\0\\0");for(f in p)r.includes(f)&&(r=r.replace(new RegExp(f,"g"),p[f](o)));return r=r.replace(/\\0\\0/g,"%"),f=vn(r),f.length>t?0:(G.set(f,e),f.length-1)};ie=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError";}};for(var Tt=Array(256),be=0;256>be;++be)Tt[be]=String.fromCharCode(be);vt=Tt,g=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError";}},Object.assign(Ee.prototype,{isAliasOf:function(e){if(!(this instanceof Ee&&e instanceof Ee))return !1;var t=this.ma.za.xa,r=this.ma.ya;e.ma=e.ma;var o=e.ma.za.xa;for(e=e.ma.ya;t.Ca;)r=t.Na(r),t=t.Ca;for(;o.Ca;)e=o.Na(e),o=o.Ca;return t===o&&r===e},clone:function(){if(this.ma.ya||Se(this),this.ma.Ma)return this.ma.count.value+=1,this;var e=ce,t=Object,r=t.create,o=Object.getPrototypeOf(this),i=this.ma;return e=e(r.call(t,o,{ma:{value:{count:i.count,Ka:i.Ka,Ma:i.Ma,ya:i.ya,za:i.za,Aa:i.Aa,Da:i.Da}}})),e.ma.count.value+=1,e.ma.Ka=!1,e},delete(){if(this.ma.ya||Se(this),this.ma.Ka&&!this.ma.Ma)throw new g("Object already scheduled for deletion");yt(this);var e=this.ma;--e.count.value,e.count.value===0&&(e.Aa?e.Da.Fa(e.Aa):e.za.xa.Fa(e.ya)),this.ma.Ma||(this.ma.Aa=void 0,this.ma.ya=void 0);},isDeleted:function(){return !this.ma.ya},deleteLater:function(){if(this.ma.ya||Se(this),this.ma.Ka&&!this.ma.Ma)throw new g("Object already scheduled for deletion");return se.push(this),se.length===1&&le&&le($e),this.ma.Ka=!0,this}}),a.getInheritedInstanceCount=()=>Object.keys(de).length,a.getLiveInheritedInstances=()=>{var e=[],t;for(t in de)de.hasOwnProperty(t)&&e.push(de[t]);return e},a.flushPendingDeletes=$e,a.setDelayFunction=e=>{le=e,se.length&&le&&le($e);},Object.assign(he.prototype,{eb(e){return this.Za&&(e=this.Za(e)),e},Xa(e){this.Fa?.(e);},argPackAdvance:8,readValueFromPointer:oe,fromWireType:function(e){function t(){return this.Qa?_e(this.xa.La,{za:this.jb,ya:r,Da:this,Aa:e}):_e(this.xa.La,{za:this,ya:e})}var r=this.eb(e);if(!r)return this.Xa(e),null;var o=Gt(this.xa,r);if(o!==void 0)return o.ma.count.value===0?(o.ma.ya=r,o.ma.Aa=e,o.clone()):(o=o.clone(),this.Xa(e),o);if(o=this.xa.cb(r),o=wt[o],!o)return t.call(this);o=this.Pa?o.$a:o.pointerType;var i=gt(r,this.xa,o.xa);return i===null?t.call(this):this.Qa?_e(o.xa.La,{za:o,ya:i,Da:this,Aa:e}):_e(o.xa.La,{za:o,ya:i})}}),Ct=a.UnboundTypeError=((e,t)=>{var r=ue(t,function(o){this.name=t,this.message=o,o=Error(o).stack,o!==void 0&&(this.stack=this.toString()+`\n`+o.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})(Error,"UnboundTypeError"),B.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=()=>B.length/2-5-We.length;var gn={c:(e,t,r,o)=>{ye(`Assertion failed: ${e?J(b,e):""}, at: `+[t?t?J(b,t):"":"unknown filename",r,o?o?J(b,o):"":"unknown function"]);},m:(e,t,r)=>{var o=new Ht(e);throw L[o.ya+16>>2]=0,L[o.ya+4>>2]=t,L[o.ya+8>>2]=r,pt=e,pt},B:function(){return 0},P:()=>{},M:()=>{},R:function(){return 0},N:()=>{},A:function(){},O:()=>{},v:e=>{var t=ge[e];delete ge[e];var r=t.Ua,o=t.Fa,i=t.Ya,l=i.map(h=>h.hb).concat(i.map(h=>h.nb));H([e],l,h=>{var u={};return i.forEach((m,p)=>{var f=h[p],_=m.fb,C=m.gb,c=h[p+i.length],v=m.mb,y=m.ob;u[m.bb]={read:x=>f.fromWireType(_(C,x)),write:(x,V)=>{var R=[];v(y,x,c.toWireType(R,V)),Te(R);}};}),[{name:t.name,fromWireType:m=>{var p={},f;for(f in u)p[f]=u[f].read(m);return o(m),p},toWireType:(m,p)=>{for(var f in u)if(!(f in p))throw new TypeError(`Missing field: "${f}"`);var _=r();for(f in u)u[f].write(_,p[f]);return m!==null&&m.push(o,_),_},argPackAdvance:8,readValueFromPointer:oe,Ea:o}]});},I:()=>{},Y:(e,t,r,o)=>{t=P(t),k(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,l){return l?r:o},argPackAdvance:8,readValueFromPointer:function(i){return this.fromWireType(b[i])},Ea:null});},r:(e,t,r,o,i,l,h,u,m,p,f,_,C)=>{f=P(f),l=S(i,l),u&&(u=S(h,u)),p&&(p=S(m,p)),C=S(_,C);var c=Nt(f);ke(c,function(){Ce(`Cannot construct ${f} due to unbound types`,[o]);}),H([e,t,r],o?[o]:[],v=>{if(v=v[0],o)var y=v.xa,x=y.La;else x=Ee.prototype;v=ue(f,function(...Je){if(Object.getPrototypeOf(this)!==V)throw new g("Use \'new\' to construct "+f);if(R.Ha===void 0)throw new g(f+" has no accessible constructor");var kt=R.Ha[Je.length];if(kt===void 0)throw new g(`Tried to invoke ctor of ${f} with invalid number of parameters (${Je.length}) - expected (${Object.keys(R.Ha).toString()}) parameters instead!`);return kt.apply(this,Je)});var V=Object.create(x,{constructor:{value:v}});v.prototype=V;var R=new Jt(f,v,V,C,y,l,u,p);if(R.Ca){var pe;(pe=R.Ca).Wa??(pe.Wa=[]),R.Ca.Wa.push(R);}return y=new he(f,R,!0,!1,!1),pe=new he(f+"*",R,!1,!1,!1),x=new he(f+" const*",R,!1,!0,!1),wt[e]={pointerType:pe,$a:x},Et(c,v),[y,pe,x]});},q:(e,t,r,o,i,l)=>{var h=ze(t,r);i=S(o,i),H([],[e],u=>{u=u[0];var m=`constructor ${u.name}`;if(u.xa.Ha===void 0&&(u.xa.Ha=[]),u.xa.Ha[t-1]!==void 0)throw new g(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class \'${u.name}\'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.xa.Ha[t-1]=()=>{Ce(`Cannot construct ${u.name} due to unbound types`,h);},H([],h,p=>(p.splice(1,0,null),u.xa.Ha[t-1]=Oe(m,p,null,i,l),[])),[]});},f:(e,t,r,o,i,l,h,u)=>{var m=ze(r,o);t=P(t),t=Lt(t),l=S(i,l),H([],[e],p=>{function f(){Ce(`Cannot call ${_} due to unbound types`,m);}p=p[0];var _=`${p.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&p.xa.kb.push(t);var C=p.xa.La,c=C[t];return c===void 0||c.Ba===void 0&&c.className!==p.name&&c.Oa===r-2?(f.Oa=r-2,f.className=p.name,C[t]=f):(_t(C,t,_),C[t].Ba[r-2]=f),H([],m,v=>(v=Oe(_,v,p,l,h),C[t].Ba===void 0?(v.Oa=r-2,C[t]=v):C[t].Ba[r-2]=v,[])),[]});},X:e=>k(e,bt),x:(e,t,r,o)=>{function i(){}t=P(t),i.values={},k(e,{name:t,constructor:i,fromWireType:function(l){return this.constructor.values[l]},toWireType:(l,h)=>h.value,argPackAdvance:8,readValueFromPointer:tn(t,r,o),Ea:null}),ke(t,i);},k:(e,t,r)=>{var o=Ue(e,"enum");t=P(t),e=o.constructor,o=Object.create(o.constructor.prototype,{value:{value:r},constructor:{value:ue(`${o.name}_${t}`,function(){})}}),e.values[r]=o,e[t]=o;},C:(e,t,r)=>{t=P(t),k(e,{name:t,fromWireType:o=>o,toWireType:(o,i)=>i,argPackAdvance:8,readValueFromPointer:nn(t,r),Ea:null});},E:(e,t,r,o,i,l)=>{var h=ze(t,r);e=P(e),e=Lt(e),i=S(o,i),ke(e,function(){Ce(`Cannot call ${e} due to unbound types`,h);},t-1),H([],h,u=>(Et(e,Oe(e,[u[0],null].concat(u.slice(1)),null,i,l),t-1),[]));},l:(e,t,r,o,i)=>{if(t=P(t),i===-1&&(i=4294967295),i=u=>u,o===0){var l=32-8*r;i=u=>u<<l>>>l;}var h=t.includes("unsigned")?function(u,m){return m>>>0}:function(u,m){return m};k(e,{name:t,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:rn(t,r,o!==0),Ea:null});},g:(e,t,r)=>{function o(l){return new i(G.buffer,L[l+4>>2],L[l>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];r=P(r),k(e,{name:r,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ib:!0});},w:e=>{k(e,bt);},ca:(e,t,r,o,i,l,h,u,m,p,f,_)=>{r=P(r),l=S(i,l),u=S(h,u),p=S(m,p),_=S(f,_),H([e],[t],C=>(C=C[0],[new he(r,C.xa,!1,!1,!0,C,o,l,u,p,_)]));},D:(e,t)=>{t=P(t);var r=t==="std::string";k(e,{name:t,fromWireType:function(o){var i=L[o>>2],l=o+4;if(r)for(var h=l,u=0;u<=i;++u){var m=l+u;if(u==i||b[m]==0){if(h=h?J(b,h,m-h):"",p===void 0)var p=h;else p+="\\0",p+=h;h=m+1;}}else {for(p=Array(i),u=0;u<i;++u)p[u]=String.fromCharCode(b[l+u]);p=p.join("");}return U(o),p},toWireType:function(o,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var l=typeof i=="string";if(!(l||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array))throw new g("Cannot pass non-string to std::string");var h=r&&l?mt(i):i.length,u=Ne(4+h+1),m=u+4;if(L[u>>2]=h,r&&l)ft(i,b,m,h+1);else if(l)for(l=0;l<h;++l){var p=i.charCodeAt(l);if(255<p)throw U(m),new g("String has UTF-16 code units that do not fit in 8 bits");b[m+l]=p;}else for(l=0;l<h;++l)b[m+l]=i[l];return o!==null&&o.push(U,u),u},argPackAdvance:8,readValueFromPointer:oe,Ea(o){U(o);}});},u:(e,t,r)=>{if(r=P(r),t===2)var o=an,i=on,l=sn,h=u=>re[u>>1];else t===4&&(o=ln,i=dn,l=cn,h=u=>L[u>>2]);k(e,{name:r,fromWireType:u=>{for(var m=L[u>>2],p,f=u+4,_=0;_<=m;++_){var C=u+4+_*t;(_==m||h(C)==0)&&(f=o(f,C-f),p===void 0?p=f:(p+="\\0",p+=f),f=C+t);}return U(u),p},toWireType:(u,m)=>{if(typeof m!="string")throw new g(`Cannot pass non-string to C++ string type ${r}`);var p=l(m),f=Ne(4+p+t);return L[f>>2]=p/t,i(m,f+4,p+t),u!==null&&u.push(U,f),f},argPackAdvance:8,readValueFromPointer:oe,Ea(u){U(u);}});},s:(e,t,r,o,i,l)=>{ge[e]={name:P(t),Ua:S(r,o),Fa:S(i,l),Ya:[]};},j:(e,t,r,o,i,l,h,u,m,p)=>{ge[e].Ya.push({bb:P(t),hb:r,fb:S(o,i),gb:l,nb:h,mb:S(u,m),ob:p});},Z:(e,t)=>{t=P(t),k(e,{ub:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},J:()=>{throw 1/0},aa:(e,t,r,o)=>(e=Ve[e],t=Be(t),e(null,t,r,o)),F:je,$:(e,t,r)=>{var o=hn(e,t),i=o.shift();e--;var l=Array(e);return t=`methodCaller<(${o.map(h=>h.name).join(", ")}) => ${i.name}>`,un(ue(t,(h,u,m,p)=>{for(var f=0,_=0;_<e;++_)l[_]=o[_].readValueFromPointer(p+f),f+=o[_].argPackAdvance;return u=r===1?pn(u,l):u.apply(h,l),h=[],u=i.toWireType(h,u),h.length&&(L[m>>2]=Me(h)),u}))},ba:e=>{9<e&&(B[e+1]+=1);},_:e=>{var t=Be(e);Te(t),je(e);},o:(e,t)=>(e=Ue(e,"_emval_take_value"),e=e.readValueFromPointer(t),Me(e)),W:()=>{ye("");},V:()=>performance.now(),L:e=>{var t=b.length;if(e>>>=0,2147483648<e)return !1;for(var r=1;4>=r;r*=2){var o=t*(1+.2/r);o=Math.min(o,e+100663296);var i=Math;o=Math.max(e,o);e:{i=(i.min.call(i,2147483648,o+(65536-o%65536)%65536)-ve.buffer.byteLength+65535)/65536;try{ve.grow(i),at();var l=1;break e}catch{}l=void 0;}if(l)return !0}return !1},S:(e,t)=>{var r=0;return It().forEach((o,i)=>{var l=t+r;for(i=L[e+4*i>>2]=l,l=0;l<o.length;++l)G[i++]=o.charCodeAt(l);G[i]=0,r+=o.length+1;}),0},T:(e,t)=>{var r=It();L[e>>2]=r.length;var o=0;return r.forEach(i=>o+=i.length+1),L[t>>2]=o,0},t:()=>52,z:()=>52,H:function(){return 70},Q:(e,t,r,o)=>{for(var i=0,l=0;l<r;l++){var h=L[t>>2],u=L[t+4>>2];t+=8;for(var m=0;m<u;m++){var p=b[h+m],f=mn[e];p===0||p===10?((e===1?Wt:Q)(J(f,0)),f.length=0):f.push(p);}i+=u;}return L[o>>2]=i,0},U:(e,t)=>(xt(b.subarray(e,e+t)),0),i:Mn,d:Cn,e:En,p:Ln,y:In,b:wn,a:_n,h:Fn,n:bn,G:xn,K:(e,t,r,o)=>yn(e,t,r,o)},F=function(){function e(r){return F=r.exports,ve=F.da,at(),$=F.ha,it.unshift(F.ea),N--,a.monitorRunDependencies?.(N),N==0&&(ae&&(r=ae,ae=null,r())),F}var t={a:gn};if(N++,a.monitorRunDependencies?.(N),a.instantiateWasm)try{return a.instantiateWasm(t,e)}catch(r){Q(`Module.instantiateWasm callback failed with error: ${r}`),w(r);}return Ut(t,function(r){e(r.instance);}).catch(w),{}}(),Ne=e=>(Ne=F.fa)(e),St=e=>(St=F.ga)(e),U=e=>(U=F.ia)(e),D=(e,t)=>(D=F.ja)(e,t),z=e=>(z=F.ka)(e),O=()=>(O=F.la)();a.dynCall_iijj=(e,t,r,o,i,l)=>(a.dynCall_iijj=F.na)(e,t,r,o,i,l),a.dynCall_vijj=(e,t,r,o,i,l)=>(a.dynCall_vijj=F.oa)(e,t,r,o,i,l),a.dynCall_jiii=(e,t,r,o)=>(a.dynCall_jiii=F.pa)(e,t,r,o),a.dynCall_jii=(e,t,r)=>(a.dynCall_jii=F.qa)(e,t,r);var Rt=a.dynCall_viiij=(e,t,r,o,i,l)=>(Rt=a.dynCall_viiij=F.ra)(e,t,r,o,i,l);a.dynCall_jiji=(e,t,r,o,i)=>(a.dynCall_jiji=F.sa)(e,t,r,o,i),a.dynCall_viijii=(e,t,r,o,i,l,h)=>(a.dynCall_viijii=F.ta)(e,t,r,o,i,l,h),a.dynCall_iiiiij=(e,t,r,o,i,l,h)=>(a.dynCall_iiiiij=F.ua)(e,t,r,o,i,l,h),a.dynCall_iiiiijj=(e,t,r,o,i,l,h,u,m)=>(a.dynCall_iiiiijj=F.va)(e,t,r,o,i,l,h,u,m),a.dynCall_iiiiiijj=(e,t,r,o,i,l,h,u,m,p)=>(a.dynCall_iiiiiijj=F.wa)(e,t,r,o,i,l,h,u,m,p);function wn(e,t){var r=O();try{$.get(e)(t);}catch(o){if(z(r),o!==o+0)throw o;D(1,0);}}function _n(e,t,r){var o=O();try{$.get(e)(t,r);}catch(i){if(z(o),i!==i+0)throw i;D(1,0);}}function En(e,t,r,o){var i=O();try{return $.get(e)(t,r,o)}catch(l){if(z(i),l!==l+0)throw l;D(1,0);}}function Cn(e,t,r){var o=O();try{return $.get(e)(t,r)}catch(i){if(z(o),i!==i+0)throw i;D(1,0);}}function Mn(e,t){var r=O();try{return $.get(e)(t)}catch(o){if(z(r),o!==o+0)throw o;D(1,0);}}function Ln(e,t,r,o,i,l){var h=O();try{return $.get(e)(t,r,o,i,l)}catch(u){if(z(h),u!==u+0)throw u;D(1,0);}}function bn(e,t,r,o,i){var l=O();try{$.get(e)(t,r,o,i);}catch(h){if(z(l),h!==h+0)throw h;D(1,0);}}function Fn(e,t,r,o){var i=O();try{$.get(e)(t,r,o);}catch(l){if(z(i),l!==l+0)throw l;D(1,0);}}function In(e){var t=O();try{$.get(e)();}catch(r){if(z(t),r!==r+0)throw r;D(1,0);}}function xn(e,t,r,o,i,l){var h=O();try{Rt(e,t,r,o,i,l);}catch(u){if(z(h),u!==u+0)throw u;D(1,0);}}var Fe;ae=function e(){Fe||$t(),Fe||(ae=e);};function $t(){function e(){if(!Fe&&(Fe=!0,a.calledRun=!0,!tt)){if(Ae(it),d(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var t=a.postRun.shift();st.unshift(t);}Ae(st);}}if(!(0<N)){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)jt();Ae(ot),0<N||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("");},1),e();},1)):e());}}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return $t(),T}})(),Dt=Sn;var X=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(n){return await Dt({locateFile:()=>n})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async n=>{let a=`https://unpkg.com/${me.name}@${me.version}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${n.message}`),console.warn(`Attempting to load WASM from backup URL: ${a}`);try{return await this._tryLoad(a)}catch(d){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${d.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};I(X,"_ModulePromise",null),I(X,"_wasmURL",`https://cdn.jsdelivr.net/npm/${me.name}@${me.version}/dist/dotlottie-player.wasm`);var xe=class{constructor(){I(this,"_eventListeners",new Map);}addEventListener(n,a){let d=this._eventListeners.get(n);d||(d=new Set,this._eventListeners.set(n,d)),d.add(a);}removeEventListener(n,a){let d=this._eventListeners.get(n);d&&(a?(d.delete(a),d.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){this._eventListeners.get(n.type)?.forEach(d=>d(n));}removeAllEventListeners(){this._eventListeners.clear();}};function Rn(s){return /^#([\\da-f]{6}|[\\da-f]{8})$/iu.test(s)}function zt(s){if(!Rn(s))return 0;let n=s.replace("#","");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}var Qe=(s,n)=>s==="reverse"?n.Mode.Reverse:s==="bounce"?n.Mode.Bounce:s==="reverse-bounce"?n.Mode.ReverseBounce:n.Mode.Forward,Ze=(s,n)=>s==="contain"?n.Fit.Contain:s==="cover"?n.Fit.Cover:s==="fill"?n.Fit.Fill:s==="fit-height"?n.Fit.FitHeight:s==="fit-width"?n.Fit.FitWidth:n.Fit.None,qe=(s,n)=>{let a=new n.VectorFloat;return a.push_back(s[0]),a.push_back(s[1]),a},et=(s,n)=>{let a=new n.VectorFloat;return s.length!==2||(a.push_back(s[0]),a.push_back(s[1])),a},M=class M{constructor(n){I(this,"_canvas");I(this,"_context",null);I(this,"_eventManager");I(this,"_animationFrameId",null);I(this,"_frameManager");I(this,"_dotLottieCore",null);I(this,"_renderConfig",{});I(this,"_isFrozen",!1);I(this,"_backgroundColor",null);this._canvas=n.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new xe,this._frameManager=new Ie,this._renderConfig=n.renderConfig??{},X.load().then(a=>{M._wasmModule=a,this._dotLottieCore=new a.DotLottiePlayer({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:Qe(n.mode??"forward",a),segment:et(n.segment??[],a),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:qe(n.layout.align,a),fit:Ze(n.layout.fit,a)}:a.createDefaultLayout()}),this._eventManager.dispatch({type:"ready"}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),n.backgroundColor&&this.setBackgroundColor(n.backgroundColor);}).catch(a=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${a}`)});});}_loadFromSrc(n){async function a(){let d=await fetch(n);if(!d.ok)throw new Error(`Failed to fetch the animation data from URL: ${n}. ${d.status}: ${d.statusText}`);let w=(d.headers.get("content-type")??"").trim(),T;return ["application/json","text/plain"].some(W=>w.startsWith(W))?T=await d.text():T=await d.arrayBuffer(),T}a().then(d=>{this._loadFromData(d);}).catch(d=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load animation data from URL: ${n}. ${d}`)});});}_loadFromData(n){if(this._dotLottieCore===null)return;let a=this._canvas.width,d=this._canvas.height,w=!1;if(typeof n=="string")w=this._dotLottieCore.loadAnimationData(n,a,d);else if(n instanceof ArrayBuffer)w=this._dotLottieCore.loadDotLottieData(n,a,d);else if(typeof n=="object")w=this._dotLottieCore.loadAnimationData(JSON.stringify(n),a,d);else {this._eventManager.dispatch({type:"loadError",error:new Error("Unsupported data type for animation data. Expected a string or ArrayBuffer.")});return}w?(this._eventManager.dispatch({type:"load"}),te&&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 n=this._dotLottieCore?.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{switch(n.fit){case M._wasmModule?.Fit.Contain:return "contain";case M._wasmModule?.Fit.Cover:return "cover";case M._wasmModule?.Fit.Fill:return "fill";case M._wasmModule?.Fit.FitHeight:return "fit-height";case M._wasmModule?.Fit.FitWidth:return "fit-width";case M._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let n=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!n)return null;let a=JSON.parse(n);return Object.keys(a).length===0?null:a}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let n=this._dotLottieCore?.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let n=this._dotLottieCore?.config().mode;return n===M._wasmModule?.Mode.Reverse?"reverse":n===M._wasmModule?.Mode.Bounce?"bounce":n===M._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 isReady(){return this._dotLottieCore!==null}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}get canvas(){return this._canvas}load(n){this._dotLottieCore===null||M._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:Qe(n.mode??"forward",M._wasmModule),segment:et(n.segment??[],M._wasmModule),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:qe(n.layout.align,M._wasmModule),fit:Ze(n.layout.fit,M._wasmModule)}:M._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor(n.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let a=this._dotLottieCore.buffer(),d=new Uint8ClampedArray(a,0,this._canvas.width*this._canvas.height*4),w=null;return typeof ImageData>"u"?(w=this._context.createImageData(this._canvas.width,this._canvas.height),w.data.set(d)):w=new ImageData(d,this._canvas.width,this._canvas.height),this._context.putImageData(w,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 n=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(n)&&(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 n=this._dotLottieCore.play();this._isFrozen=!1,n&&(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(n){if(this._dotLottieCore===null||n<0||n>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(n)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:n});}setBackgroundColor(n){this._dotLottieCore!==null&&(te&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:zt(n)}),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:n});}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:n});}addEventListener(n,a){this._eventManager.addEventListener(n,a);}removeEventListener(n,a){this._eventManager.removeEventListener(n,a);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}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(te&&this._canvas instanceof HTMLCanvasElement){let a=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:d,width:w}=this._canvas.getBoundingClientRect();this._canvas.width=w*a,this._canvas.height=d*a;}this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,a){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:et([n,a],M._wasmModule)});}setMode(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:Qe(n,M._wasmModule)});}setRenderConfig(n){this._renderConfig=n;}loadAnimation(n){if(this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===n)return;this._dotLottieCore.loadAnimation(n,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${n}`)});}setMarker(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:n});}markers(){let n=this._dotLottieCore?.markers();if(n){let a=[];for(let d=0;d<n.size();d+=1){let w=n.get(d);a.push({name:w.name,time:w.time,duration:w.duration});}return a}return []}loadTheme(n){if(this._dotLottieCore===null)return !1;let a=this._dotLottieCore.loadTheme(n);return this._render(),a}loadThemeData(n){if(this._dotLottieCore===null)return !1;let a=this._dotLottieCore.loadThemeData(n);return this._render(),a}setLayout(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:qe(n.align,M._wasmModule),fit:Ze(n.fit,M._wasmModule)}});}setViewport(n,a,d,w){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(n,a,d,w)}static setWasmUrl(n){X.setWasmUrl(n);}loadStateMachine(n){return this._dotLottieCore?.loadStateMachine(n)??!1}startStateMachine(){let n=this._dotLottieCore?.startStateMachine()??!1;return n&&this._setupStateMachineListeners(),n}stopStateMachine(){let n=this._dotLottieCore?.stopStateMachine()??!1;return n&&this._cleanupStateMachineListeners(),n}_getPointerPosition(n){let a=this._canvas.getBoundingClientRect(),d=this._canvas.width/a.width,w=this._canvas.height/a.height,T=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,W=(n.clientX-a.left)*d/T,Y=(n.clientY-a.top)*w/T;return {x:W,y:Y}}_onPointerUp(n){let{x:a,y:d}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${a} ${d}`);}_onPointerDown(n){let{x:a,y:d}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${a} ${d}`);}_onPointerMove(n){let{x:a,y:d}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${a} ${d}`);}_onPointerEnter(n){let{x:a,y:d}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${a} ${d}`);}_onPointerLeave(n){let{x:a,y:d}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${a} ${d}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}postStateMachineEvent(n){return this._dotLottieCore?.postEventPayload(n)??!1}getStateMachineListeners(){if(!this._dotLottieCore)return [];let n=this._dotLottieCore.stateMachineFrameworkSetup(),a=[];for(let d=0;d<n.size();d+=1)a.push(n.get(d));return a}_setupStateMachineListeners(){if(te&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let n=this.getStateMachineListeners();n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){te&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}loadStateMachineData(n){return this._dotLottieCore?.loadStateMachineData(n)??!1}animationSize(){let n=this._dotLottieCore?.animationSize().get(0)??0,a=this._dotLottieCore?.animationSize().get(1)??0;return {width:n,height:a}}setStateMachineBooleanContext(n,a){return this._dotLottieCore?.setStateMachineBooleanContext(n,a)??!1}setStateMachineNumericContext(n,a){return this._dotLottieCore?.setStateMachineNumericContext(n,a)??!1}setStateMachineStringContext(n,a){return this._dotLottieCore?.setStateMachineStringContext(n,a)??!1}};I(M,"_wasmModule",null);var fe=M;var E=new Map,$n={ready:s=>n=>{let a={id:"",method:"onReady",result:{instanceId:s,event:n}};self.postMessage(a);},complete:s=>n=>{let a={id:"",method:"onComplete",result:{instanceId:s,event:n}};self.postMessage(a);},load:s=>n=>{let d={id:"",method:"onLoad",result:{instanceId:s,event:n}};self.postMessage(d);},loadError:s=>n=>{let d={id:"",method:"onLoadError",result:{instanceId:s,event:n}};self.postMessage(d);},loop:s=>n=>{let d={id:"",method:"onLoop",result:{instanceId:s,event:n}};self.postMessage(d);},play:s=>n=>{let d={id:"",method:"onPlay",result:{instanceId:s,event:n}};self.postMessage(d);},pause:s=>n=>{let d={id:"",method:"onPause",result:{instanceId:s,event:n}};self.postMessage(d);},stop:s=>n=>{let d={id:"",method:"onStop",result:{instanceId:s,event:n}};self.postMessage(d);},frame:s=>n=>{let d={id:"",method:"onFrame",result:{instanceId:s,event:n}};self.postMessage(d);},render:s=>n=>{let d={id:"",method:"onRender",result:{instanceId:s,event:n}};self.postMessage(d);},freeze:s=>n=>{let d={id:"",method:"onFreeze",result:{instanceId:s,event:n}};self.postMessage(d);},unfreeze:s=>n=>{let d={id:"",method:"onUnfreeze",result:{instanceId:s,event:n}};self.postMessage(d);},destroy:s=>n=>{let d={id:"",method:"onDestroy",result:{instanceId:s,event:n}};self.postMessage(d);}},Ot={getDotLottieInstanceState(s){let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);return {state:{isLoaded:a.isLoaded,isPaused:a.isPaused,isPlaying:a.isPlaying,isStopped:a.isStopped,isFrozen:a.isFrozen,loop:a.loop,mode:a.mode,speed:a.speed,currentFrame:a.currentFrame,totalFrames:a.totalFrames,duration:a.duration,useFrameInterpolation:a.useFrameInterpolation,renderConfig:a.renderConfig,marker:a.marker,backgroundColor:a.backgroundColor,markers:a.markers(),activeAnimationId:a.activeAnimationId,activeThemeId:a.activeThemeId,autoplay:a.autoplay,segment:a.segment,layout:a.layout,segmentDuration:a.segmentDuration,isReady:a.isReady,manifest:a.manifest}}},setLayout(s){let n=s.params.instanceId,a=s.params.layout,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.setLayout(a),{success:!0}},getStateMachineListeners(s){let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);return a.getStateMachineListeners()},postStateMachineEvent(s){let n=s.params.instanceId,a=s.params.event,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.postStateMachineEvent(a)},startStateMachine(s){let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);return a.startStateMachine()},stopStateMachine(s){let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);return a.stopStateMachine()},loadStateMachine(s){let n=s.params.instanceId,a=s.params.stateMachineId,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.loadStateMachine(a)},loadStateMachineData(s){let n=s.params.instanceId,a=s.params.stateMachineData,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.loadStateMachineData(a)},create:s=>{let n=s.params.instanceId,a=s.params.config,d=s.params.width,w=s.params.height;if(E.has(n))throw new Error(`Instance with id ${n} already exists.`);let T=new fe(a);return T.canvas.height=w,T.canvas.width=d,E.set(n,T),["complete","frame","load","loadError","loop","pause","play","stop","destroy","freeze","unfreeze","render","ready"].forEach(Y=>{T.addEventListener(Y,$n[Y](n));}),{instanceId:n}},destroy:s=>{let n=s.params.instanceId,a=E.get(n);a&&(a.destroy(),E.delete(n));},freeze:s=>{let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);a.freeze();},load:s=>{let n=s.params.instanceId,a=s.params.config,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.load(a);},loadAnimation:s=>{let n=s.params.instanceId,a=s.params.animationId,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.loadAnimation(a);},loadTheme:s=>{let n=s.params.instanceId,a=s.params.themeId,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.loadTheme(a)},loadThemeData:s=>{let n=s.params.instanceId,a=s.params.themeData,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.loadThemeData(a)},pause:s=>{let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);return a.pause()},play:s=>{let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);return a.play()},resize:s=>{let n=s.params.instanceId,a=s.params.width,d=s.params.height,w=E.get(n);if(!w)throw new Error(`Instance with id ${n} does not exist.`);return w.canvas.height=d,w.canvas.width=a,w.resize(),{success:!0}},setBackgroundColor:s=>{let n=s.params.instanceId,a=s.params.backgroundColor,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setBackgroundColor(a);},setFrame:s=>{let n=s.params.instanceId,a=s.params.frame,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setFrame(a);},setMode:s=>{let n=s.params.instanceId,a=s.params.mode,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setMode(a);},setRenderConfig:s=>{let n=s.params.instanceId,a=s.params.renderConfig,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setRenderConfig(a);},setSegment:s=>{let n=s.params.instanceId,a=s.params.segment,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setSegment(a[0],a[1]);},setSpeed:s=>{let n=s.params.instanceId,a=s.params.speed,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setSpeed(a);},setUseFrameInterpolation:s=>{let n=s.params.instanceId,a=s.params.useFrameInterpolation,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);d.setUseFrameInterpolation(a);},setWasmUrl:s=>{fe.setWasmUrl(s.params.url);},stop:s=>{let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);a.stop();},unfreeze:s=>{let n=s.params.instanceId,a=E.get(n);if(!a)throw new Error(`Instance with id ${n} does not exist.`);a.unfreeze();},setViewport(s){let n=s.params.instanceId,a=s.params.x,d=s.params.y,w=s.params.width,T=s.params.height,W=E.get(n);if(!W)throw new Error(`Instance with id ${n} does not exist.`);return W.setViewport(a,d,w,T)},setMarker(s){let n=s.params.instanceId,a=s.params.marker,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.setMarker(a),{success:!0}},setLoop(s){let n=s.params.instanceId,a=s.params.loop,d=E.get(n);if(!d)throw new Error(`Instance with id ${n} does not exist.`);return d.setLoop(a),{success:!0}}};function kn(s){let n=s.method;if(typeof Ot[n]=="function")return Ot[n](s);throw new Error(`Method ${n} is not implemented in commands.`)}self.onmessage=s=>{try{let n=kn(s.data),a={id:s.data.id,method:s.data.method,result:n};self.postMessage(a);}catch(n){let a={id:s.data.id,method:s.data.method,error:n.message};self.postMessage(a);}};var Dn="",lr=Dn;\n\nexport { lr as default };\n';var Se=class{constructor(){C(this,"_workers",new Map);C(this,"_animationWorkerMap",new Map);}_createWorker(n){let a=new Blob([zt],{type:"application/javascript"});return new Worker(URL.createObjectURL(a),{type:"module",name:n})}getWorker(n){return this._workers.has(n)||this._workers.set(n,this._createWorker(n)),this._workers.get(n)}assignAnimationToWorker(n,a){this._animationWorkerMap.set(n,a);}unassignAnimationFromWorker(n){this._animationWorkerMap.delete(n);}sendMessage(n,a,c){this.getWorker(n).postMessage(a,c||[]);}terminateWorker(n){let a=this._workers.get(n);a&&(a.terminate(),this._workers.delete(n));}};function Ut(g){if(g instanceof OffscreenCanvas)return {width:g.width,height:g.height};let{height:n,width:a}=g.getBoundingClientRect();return {width:a*window.devicePixelRatio,height:n*window.devicePixelRatio}}function Bt(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}var z=class z{constructor(n){C(this,"_eventManager",new re);C(this,"_id");C(this,"_worker");C(this,"_canvas");C(this,"_dotLottieInstanceState",{markers:[],autoplay:!1,backgroundColor:"",currentFrame:0,duration:0,loop:!1,mode:"forward",segment:[0,0],segmentDuration:0,speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:window.devicePixelRatio},activeAnimationId:"",activeThemeId:"",layout:void 0,marker:void 0,isReady:!1,manifest:null});C(this,"_created",!1);this._canvas=n.canvas,this._id=`dotlottie-${Bt()}`;let a=n.workerId||"defaultWorker";this._worker=z._workerManager.getWorker(a),z._workerManager.assignAnimationToWorker(this._id,a),z._wasmUrl&&this._sendMessage("setWasmUrl",{url:z._wasmUrl}),this._create(n),this._worker.addEventListener("message",this._handleWorkerEvent.bind(this));}async _handleWorkerEvent(n){let a=n.data;a.id||(a.method==="onLoad"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onComplete"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onDestroy"&&a.result.instanceId===this._id&&this._eventManager.dispatch(a.result.event),a.method==="onUnfreeze"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(a.result.event)),a.method==="onFrame"&&a.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=a.result.event.currentFrame,this._eventManager.dispatch(a.result.event)),a.method==="onRender"&&a.result.instanceId===this._id&&this._eventManager.dispatch(a.result.event),a.method==="onFreeze"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onPause"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onPlay"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onStop"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onLoadError"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onReady"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)));}async _create(n){let a;this._canvas instanceof HTMLCanvasElement?a=this._canvas.transferControlToOffscreen():a=this._canvas;let{instanceId:c}=await this._sendMessage("create",{instanceId:this._id,config:{...n,canvas:a},...Ut(this._canvas)},[a]);if(c!==this._id)throw new Error("Instance ID mismatch");this._created=!0,await this._updateDotLottieInstanceState();}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get segmentDuration(){return this._dotLottieInstanceState.segmentDuration}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage("play",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async pause(){this._created&&(await this._sendMessage("pause",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async stop(){this._created&&(await this._sendMessage("stop",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async setSpeed(n){this._created&&(await this._sendMessage("setSpeed",{instanceId:this._id,speed:n}),await this._updateDotLottieInstanceState());}async setMode(n){this._created&&(await this._sendMessage("setMode",{instanceId:this._id,mode:n}),await this._updateDotLottieInstanceState());}async setFrame(n){this._created&&(await this._sendMessage("setFrame",{frame:n,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setSegment(n,a){this._created&&(await this._sendMessage("setSegment",{instanceId:this._id,segment:[n,a]}),await this._updateDotLottieInstanceState());}async setRenderConfig(n){this._created&&(await this._sendMessage("setRenderConfig",{instanceId:this._id,renderConfig:n}),await this._updateDotLottieInstanceState());}async setUseFrameInterpolation(n){this._created&&(await this._sendMessage("setUseFrameInterpolation",{instanceId:this._id,useFrameInterpolation:n}),await this._updateDotLottieInstanceState());}async loadTheme(n){if(!this._created)return !1;let a=this._sendMessage("loadTheme",{instanceId:this._id,themeId:n});return await this._updateDotLottieInstanceState(),a}async load(n){this._created&&(await this._sendMessage("load",{config:n,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setLoop(n){this._created&&(await this._sendMessage("setLoop",{instanceId:this._id,loop:n}),await this._updateDotLottieInstanceState());}async resize(){if(!this._created)return;let{height:n,width:a}=Ut(this._canvas);this._canvas.width=a,this._canvas.height=n,await this._sendMessage("resize",{height:n,instanceId:this._id,width:a}),await this._updateDotLottieInstanceState();}async destroy(){this._created&&(this._created=!1,await this._sendMessage("destroy",{instanceId:this._id}),this._cleanupStateMachineListeners(),z._workerManager.unassignAnimationFromWorker(this._id),this._eventManager.removeAllEventListeners());}async freeze(){this._created&&(await this._sendMessage("freeze",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async unfreeze(){this._created&&(await this._sendMessage("unfreeze",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async setBackgroundColor(n){this._created&&(await this._sendMessage("setBackgroundColor",{instanceId:this._id,backgroundColor:n}),await this._updateDotLottieInstanceState());}async loadAnimation(n){this._created&&(await this._sendMessage("loadAnimation",{animationId:n,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setLayout(n){this._created&&(await this._sendMessage("setLayout",{instanceId:this._id,layout:n}),await this._updateDotLottieInstanceState());}async _updateDotLottieInstanceState(){if(!this._created)return;let n=await this._sendMessage("getDotLottieInstanceState",{instanceId:this._id});this._dotLottieInstanceState=n.state;}markers(){return this._dotLottieInstanceState.markers}async setMarker(n){this._created&&(await this._sendMessage("setMarker",{instanceId:this._id,marker:n}),await this._updateDotLottieInstanceState());}async loadThemeData(n){if(!this._created)return !1;let a=await this._sendMessage("loadThemeData",{instanceId:this._id,themeData:n});return await this._updateDotLottieInstanceState(),a}async setViewport(n,a,c,w){return this._created?this._sendMessage("setViewport",{x:n,y:a,width:c,height:w,instanceId:this._id}):!1}async _sendMessage(n,a,c){let w={id:`dotlottie-request-${Bt()}`,method:n,params:a};return this._worker.postMessage(w,c||[]),new Promise((x,j)=>{let U=$=>{let Q=$.data;Q.id===w.id&&(this._worker.removeEventListener("message",U),Q.error?j(new Error(`Failed to execute method ${n}: ${Q.error}`)):x(Q.result));};this._worker.addEventListener("message",U);})}addEventListener(n,a){this._eventManager.addEventListener(n,a);}removeEventListener(n,a){this._eventManager.removeEventListener(n,a);}static setWasmUrl(n){z._wasmUrl=n;}async loadStateMachine(n){if(!this._created)return !1;let a=await this._sendMessage("loadStateMachine",{instanceId:this._id,stateMachineId:n});return await this._updateDotLottieInstanceState(),a}async loadStateMachineData(n){if(!this._created)return !1;let a=await this._sendMessage("loadStateMachineData",{instanceId:this._id,stateMachineData:n});return await this._updateDotLottieInstanceState(),a}async startStateMachine(){if(!this._created)return !1;this._setupStateMachineListeners();let n=await this._sendMessage("startStateMachine",{instanceId:this._id});return await this._updateDotLottieInstanceState(),n}async stopStateMachine(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage("stopStateMachine",{instanceId:this._id})):!1}async postStateMachineEvent(n){return this._created?this._sendMessage("postStateMachineEvent",{event:n,instanceId:this._id}):!1}async getStateMachineListeners(){return this._created?this._sendMessage("getStateMachineListeners",{instanceId:this._id}):[]}_getPointerPosition(n){let a=this._canvas.getBoundingClientRect(),c=this._canvas.width/a.width,w=this._canvas.height/a.height,x=this._dotLottieInstanceState.renderConfig.devicePixelRatio||window.devicePixelRatio||1,j=(n.clientX-a.left)*c/x,U=(n.clientY-a.top)*w/x;return {x:j,y:U}}_onPointerUp(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${a} ${c}`);}_onPointerDown(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${a} ${c}`);}_onPointerMove(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${a} ${c}`);}_onPointerEnter(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${a} ${c}`);}_onPointerLeave(n){let{x:a,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${a} ${c}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}async _setupStateMachineListeners(){if(V&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let n=await this._sendMessage("getStateMachineListeners",{instanceId:this._id});n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){V&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}};C(z,"_workerManager",new Se),C(z,"_wasmUrl","");var Ht=z;
9
+ var Wn=Object.defineProperty;var jn=(f,n,a)=>n in f?Wn(f,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):f[n]=a;var w=(f,n,a)=>jn(f,typeof n!="symbol"?n+"":n,a);var Xe=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},Ze=class{constructor(){w(this,"_lastHandleId",0);w(this,"_lastImmediate",null);}requestAnimationFrame(n){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{n(Date.now());}),this._lastHandleId}cancelAnimationFrame(n){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Pe=class{constructor(){w(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Xe:new Ze;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var H=typeof window<"u"&&typeof window.document<"u";var Se=new Uint8Array([80,75,3,4]),zt=["v","ip","op","layers","fr","w","h"];var ve={name:"@lottiefiles/dotlottie-web",version:"0.29.2",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.14.11","@vitest/browser":"^2.0.3","@vitest/coverage-istanbul":"^2.0.3","cross-env":"7.0.3",playwright:"^1.45.2",tsup:"8.1.0",typescript:"5.0.4",vitest:"^2.0.3"},publishConfig:{access:"public"}};var Un=(()=>{var f=typeof document<"u"?document.currentScript?.src:void 0;return function(n={}){var a=n,h,C,j=new Promise((e,t)=>{h=e,C=t;}),N=Object.assign({},a),z="./this.program",k="";typeof document<"u"&&document.currentScript&&(k=document.currentScript.src),f&&(k=f),k.startsWith("blob:")?k="":k=k.substr(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1);var Z=a.print||console.log.bind(console),Q=a.printErr||console.error.bind(console);Object.assign(a,N),N=null,a.thisProgram&&(z=a.thisProgram);var ae;a.wasmBinary&&(ae=a.wasmBinary);var ge,it=!1,J,E,ee,ie,S,M,ot,st;function lt(){var e=ge.buffer;a.HEAP8=J=new Int8Array(e),a.HEAP16=ee=new Int16Array(e),a.HEAPU8=E=new Uint8Array(e),a.HEAPU16=ie=new Uint16Array(e),a.HEAP32=S=new Int32Array(e),a.HEAPU32=M=new Uint32Array(e),a.HEAPF32=ot=new Float32Array(e),a.HEAPF64=st=new Float64Array(e);}var dt=[],ut=[],ct=[];function qt(){var e=a.preRun.shift();dt.unshift(e);}var G=0,oe=null;function _e(e){throw a.onAbort?.(e),e="Aborted("+e+")",Q(e),it=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),C(e),e}var ht=e=>e.startsWith("data:application/octet-stream;base64,"),te;if(te="DotLottiePlayer.wasm",!ht(te)){var pt=te;te=a.locateFile?a.locateFile(pt,k):k+pt;}function mt(e){if(e==te&&ae)return new Uint8Array(ae);throw "both async and sync fetching of the wasm failed"}function Kt(e){return ae||typeof fetch!="function"?Promise.resolve().then(()=>mt(e)):fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>mt(e))}function ft(e,t,r){return Kt(e).then(i=>WebAssembly.instantiate(i,t)).then(r,i=>{Q(`failed to asynchronously prepare wasm: ${i}`),_e(i);})}function Xt(e,t){var r=te;return ae||typeof WebAssembly.instantiateStreaming!="function"||ht(r)||typeof fetch!="function"?ft(r,e,t):fetch(r,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,e).then(t,function(o){return Q(`wasm streaming compile failed: ${o}`),Q("falling back to ArrayBuffer instantiation"),ft(r,e,t)}))}var Te=e=>{for(;0<e.length;)e.shift()(a);},vt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q=(e,t,r)=>{var i=t+r;for(r=t;e[r]&&!(r>=i);)++r;if(16<r-t&&e.buffer&&vt)return vt.decode(e.subarray(t,r));for(i="";t<r;){var o=e[t++];if(o&128){var s=e[t++]&63;if((o&224)==192)i+=String.fromCharCode((o&31)<<6|s);else {var u=e[t++]&63;o=(o&240)==224?(o&15)<<12|s<<6|u:(o&7)<<18|s<<12|u<<6|e[t++]&63,65536>o?i+=String.fromCharCode(o):(o-=65536,i+=String.fromCharCode(55296|o>>10,56320|o&1023));}}else i+=String.fromCharCode(o);}return i};class Zt{constructor(t){this.ya=t-24;}}var gt=0,_t=e=>{for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);127>=i?t++:2047>=i?t+=2:55296<=i&&57343>=i?(t+=4,++r):t+=3;}return t},yt=(e,t,r,i)=>{if(0<i){i=r+i-1;for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);if(55296<=s&&57343>=s){var u=e.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023;}if(127>=s){if(r>=i)break;t[r++]=s;}else {if(2047>=s){if(r+1>=i)break;t[r++]=192|s>>6;}else {if(65535>=s){if(r+2>=i)break;t[r++]=224|s>>12;}else {if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63;}t[r++]=128|s>>6&63;}t[r++]=128|s&63;}}t[r]=0;}},ye={},ke=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function se(e){return this.fromWireType(M[e>>2])}var ne={},K={},we={},le,V=(e,t,r)=>{function i(d){if(d=r(d),d.length!==e.length)throw new le("Mismatched type converter count");for(var p=0;p<e.length;++p)$(e[p],d[p]);}e.forEach(function(d){we[d]=t;});var o=Array(t.length),s=[],u=0;t.forEach((d,p)=>{K.hasOwnProperty(d)?o[p]=K[d]:(s.push(d),ne.hasOwnProperty(d)||(ne[d]=[]),ne[d].push(()=>{o[p]=K[d],++u,u===s.length&&i(o);}));}),s.length===0&&i(o);},wt,P=e=>{for(var t="";E[e];)t+=wt[E[e++]];return t},_;function en(e,t,r={}){var i=t.name;if(!e)throw new _(`type "${i}" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(r.ib)return;throw new _(`Cannot register type '${i}' twice`)}K[e]=t,delete we[e],ne.hasOwnProperty(e)&&(t=ne[e],delete ne[e],t.forEach(o=>o()));}function $(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return en(e,t,r)}var $e=e=>{throw new _(e.ma.za.xa.name+" instance already deleted")},De=!1,Ct=()=>{},bt=(e,t,r)=>t===r?e:r.Ca===void 0?null:(e=bt(e,t,r.Ca),e===null?null:r.ab(e)),Lt={},de=[],Re=()=>{for(;de.length;){var e=de.pop();e.ma.Ka=!1,e.delete();}},ue,ce={},tn=(e,t)=>{if(t===void 0)throw new _("ptr should not be undefined");for(;e.Ca;)t=e.Na(t),e=e.Ca;return ce[t]},Ce=(e,t)=>{if(!t.za||!t.ya)throw new le("makeClassHandle requires ptr and ptrType");if(!!t.Da!=!!t.Aa)throw new le("Both smartPtrType and smartPtr must be specified");return t.count={value:1},he(Object.create(e,{ma:{value:t,writable:!0}}))},he=e=>typeof FinalizationRegistry>"u"?(he=t=>t,e):(De=new FinalizationRegistry(t=>{t=t.ma,--t.count.value,t.count.value===0&&(t.Aa?t.Da.Fa(t.Aa):t.za.xa.Fa(t.ya));}),he=t=>{var r=t.ma;return r.Aa&&De.register(t,{ma:r},t),t},Ct=t=>{De.unregister(t);},he(e));function be(){}var pe=(e,t)=>Object.defineProperty(t,"name",{value:e}),Mt=(e,t,r)=>{if(e[t].Ba===void 0){var i=e[t];e[t]=function(...o){if(!e[t].Ba.hasOwnProperty(o.length))throw new _(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].Ba})!`);return e[t].Ba[o.length].apply(this,o)},e[t].Ba=[],e[t].Ba[i.Oa]=i;}},Oe=(e,t,r)=>{if(a.hasOwnProperty(e)){if(r===void 0||a[e].Ba!==void 0&&a[e].Ba[r]!==void 0)throw new _(`Cannot register public name '${e}' twice`);if(Mt(a,e,e),a.hasOwnProperty(r))throw new _(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);a[e].Ba[r]=t;}else a[e]=t,r!==void 0&&(a[e].vb=r);},nn=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function rn(e,t,r,i,o,s,u,d){this.name=e,this.constructor=t,this.La=r,this.Fa=i,this.Ca=o,this.cb=s,this.Na=u,this.ab=d,this.kb=[];}var We=(e,t,r)=>{for(;t!==r;){if(!t.Na)throw new _(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Na(e),t=t.Ca;}return e};function an(e,t){if(t===null){if(this.Ta)throw new _(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new _(`Cannot pass "${Ve(t)}" as a ${this.name}`);if(!t.ma.ya)throw new _(`Cannot pass deleted object as a pointer of type ${this.name}`);return We(t.ma.ya,t.ma.za.xa,this.xa)}function on(e,t){if(t===null){if(this.Ta)throw new _(`null is not a valid ${this.name}`);if(this.Qa){var r=this.Ua();return e!==null&&e.push(this.Fa,r),r}return 0}if(!t||!t.ma)throw new _(`Cannot pass "${Ve(t)}" as a ${this.name}`);if(!t.ma.ya)throw new _(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Pa&&t.ma.za.Pa)throw new _(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);if(r=We(t.ma.ya,t.ma.za.xa,this.xa),this.Qa){if(t.ma.Aa===void 0)throw new _("Passing raw pointer to smart pointer is illegal");switch(this.pb){case 0:if(t.ma.Da===this)r=t.ma.Aa;else throw new _(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);break;case 1:r=t.ma.Aa;break;case 2:if(t.ma.Da===this)r=t.ma.Aa;else {var i=t.clone();r=this.lb(r,Me(()=>i.delete())),e!==null&&e.push(this.Fa,r);}break;default:throw new _("Unsupporting sharing policy")}}return r}function sn(e,t){if(t===null){if(this.Ta)throw new _(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new _(`Cannot pass "${Ve(t)}" as a ${this.name}`);if(!t.ma.ya)throw new _(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.ma.za.Pa)throw new _(`Cannot convert argument of type ${t.ma.za.name} to parameter type ${this.name}`);return We(t.ma.ya,t.ma.za.xa,this.xa)}function me(e,t,r,i,o,s,u,d,p,c,m){this.name=e,this.xa=t,this.Ta=r,this.Pa=i,this.Qa=o,this.jb=s,this.pb=u,this.Za=d,this.Ua=p,this.lb=c,this.Fa=m,o||t.Ca!==void 0?this.toWireType=on:(this.toWireType=i?an:sn,this.Ea=null);}var Et=(e,t,r)=>{if(!a.hasOwnProperty(e))throw new le("Replacing nonexistent public symbol");a[e].Ba!==void 0&&r!==void 0?a[e].Ba[r]=t:(a[e]=t,a[e].Oa=r);},T,ln=(e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0, a["dynCall_"+e])(t,...r)):t=T.get(t)(...r),t),dn=(e,t)=>(...r)=>ln(e,t,r),A=(e,t)=>{e=P(e);var r=e.includes("j")?dn(e,t):T.get(t);if(typeof r!="function")throw new _(`unknown function pointer with signature ${e}: ${t}`);return r},Ft,It=e=>{e=Rt(e);var t=P(e);return B(e),t},Le=(e,t)=>{function r(s){o[s]||K[s]||(we[s]?we[s].forEach(r):(i.push(s),o[s]=!0));}var i=[],o={};throw t.forEach(r),new Ft(`${e}: `+i.map(It).join([", "]))},je=(e,t)=>{for(var r=[],i=0;i<e;i++)r.push(M[t+4*i>>2]);return r};function un(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Ea===void 0)return !0;return !1}function ze(e,t,r,i,o){var s=t.length;if(2>s)throw new _("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=t[1]!==null&&r!==null,d=un(t),p=t[0].name!=="void",c=s-2,m=Array(c),y=[],b=[];return pe(e,function(...l){if(l.length!==c)throw new _(`function ${e} called with ${l.length} arguments, expected ${c}`);if(b.length=0,y.length=u?2:1,y[0]=o,u){var v=t[1].toWireType(b,this);y[1]=v;}for(var g=0;g<c;++g)m[g]=t[g+2].toWireType(b,l[g]),y.push(m[g]);if(l=i(...y),d)ke(b);else for(g=u?1:2;g<t.length;g++){var I=g===1?v:m[g-2];t[g].Ea!==null&&t[g].Ea(I);}return v=p?t[0].fromWireType(l):void 0,v})}var Pt=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},Ue=[],U=[],Be=e=>{9<e&&--U[e+1]===0&&(U[e]=void 0,Ue.push(e));},He=e=>{if(!e)throw new _("Cannot use deleted val. handle = "+e);return U[e]},Me=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=Ue.pop()||U.length;return U[t]=e,U[t+1]=1,t}},St={name:"emscripten::val",fromWireType:e=>{var t=He(e);return Be(e),t},toWireType:(e,t)=>Me(t),argPackAdvance:8,readValueFromPointer:se,Ea:null},cn=(e,t,r)=>{switch(t){case 1:return r?function(i){return this.fromWireType(J[i])}:function(i){return this.fromWireType(E[i])};case 2:return r?function(i){return this.fromWireType(ee[i>>1])}:function(i){return this.fromWireType(ie[i>>1])};case 4:return r?function(i){return this.fromWireType(S[i>>2])}:function(i){return this.fromWireType(M[i>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ne=(e,t)=>{var r=K[e];if(r===void 0)throw e=`${t} has unknown type ${It(e)}`,new _(e);return r},Ve=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},hn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(ot[r>>2])};case 8:return function(r){return this.fromWireType(st[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},pn=(e,t,r)=>{switch(t){case 1:return r?i=>J[i]:i=>E[i];case 2:return r?i=>ee[i>>1]:i=>ie[i>>1];case 4:return r?i=>S[i>>2]:i=>M[i>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},At=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,mn=(e,t)=>{for(var r=e>>1,i=r+t/2;!(r>=i)&&ie[r];)++r;if(r<<=1,32<r-e&&At)return At.decode(E.subarray(e,r));for(r="",i=0;!(i>=t/2);++i){var o=ee[e+2*i>>1];if(o==0)break;r+=String.fromCharCode(o);}return r},fn=(e,t,r)=>{if(r??(r=2147483647),2>r)return 0;r-=2;var i=t;r=r<2*e.length?r/2:e.length;for(var o=0;o<r;++o)ee[t>>1]=e.charCodeAt(o),t+=2;return ee[t>>1]=0,t-i},vn=e=>2*e.length,gn=(e,t)=>{for(var r=0,i="";!(r>=t/4);){var o=S[e+4*r>>2];if(o==0)break;++r,65536<=o?(o-=65536,i+=String.fromCharCode(55296|o>>10,56320|o&1023)):i+=String.fromCharCode(o);}return i},_n=(e,t,r)=>{if(r??(r=2147483647),4>r)return 0;var i=t;r=i+r-4;for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);if(55296<=s&&57343>=s){var u=e.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023;}if(S[t>>2]=s,t+=4,t+4>r)break}return S[t>>2]=0,t-i},yn=e=>{for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);55296<=i&&57343>=i&&++r,t+=4;}return t},Ye=[],wn=e=>{var t=Ye.length;return Ye.push(e),t},Cn=(e,t)=>{for(var r=Array(e),i=0;i<e;++i)r[i]=Ne(M[t+4*i>>2],"parameter "+i);return r},bn=Reflect.construct,Je={},xt=()=>{if(!Ge){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:z||"./this.program"},t;for(t in Je)Je[t]===void 0?delete e[t]:e[t]=Je[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);Ge=r;}return Ge},Ge,Ln=[null,[],[]],Mn=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);_e("initRandomDevice");},Tt=e=>(Tt=Mn())(e),Ee=e=>e%4===0&&(e%100!==0||e%400===0),kt=[31,29,31,30,31,30,31,31,30,31,30,31],$t=[31,28,31,30,31,30,31,31,30,31,30,31];function En(e){var t=Array(_t(e)+1);return yt(e,t,0,t.length),t}var Fn=(e,t,r,i)=>{function o(l,v,g){for(l=typeof l=="number"?l.toString():l||"";l.length<v;)l=g[0]+l;return l}function s(l,v){return o(l,v,"0")}function u(l,v){function g(Y){return 0>Y?-1:0<Y?1:0}var I;return (I=g(l.getFullYear()-v.getFullYear()))===0&&(I=g(l.getMonth()-v.getMonth()))===0&&(I=g(l.getDate()-v.getDate())),I}function d(l){switch(l.getDay()){case 0:return new Date(l.getFullYear()-1,11,29);case 1:return l;case 2:return new Date(l.getFullYear(),0,3);case 3:return new Date(l.getFullYear(),0,2);case 4:return new Date(l.getFullYear(),0,1);case 5:return new Date(l.getFullYear()-1,11,31);case 6:return new Date(l.getFullYear()-1,11,30)}}function p(l){var v=l.Ia;for(l=new Date(new Date(l.Ja+1900,0,1).getTime());0<v;){var g=l.getMonth(),I=(Ee(l.getFullYear())?kt:$t)[g];if(v>I-l.getDate())v-=I-l.getDate()+1,l.setDate(1),11>g?l.setMonth(g+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else {l.setDate(l.getDate()+v);break}}return g=new Date(l.getFullYear()+1,0,4),v=d(new Date(l.getFullYear(),0,4)),g=d(g),0>=u(v,l)?0>=u(g,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var c=M[i+40>>2];i={sb:S[i>>2],rb:S[i+4>>2],Ra:S[i+8>>2],Va:S[i+12>>2],Sa:S[i+16>>2],Ja:S[i+20>>2],Ga:S[i+24>>2],Ia:S[i+28>>2],wb:S[i+32>>2],qb:S[i+36>>2],tb:c&&c?q(E,c):""},r=r?q(E,r):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var m in c)r=r.replace(new RegExp(m,"g"),c[m]);var y="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),b="January February March April May June July August September October November December".split(" ");c={"%a":l=>y[l.Ga].substring(0,3),"%A":l=>y[l.Ga],"%b":l=>b[l.Sa].substring(0,3),"%B":l=>b[l.Sa],"%C":l=>s((l.Ja+1900)/100|0,2),"%d":l=>s(l.Va,2),"%e":l=>o(l.Va,2," "),"%g":l=>p(l).toString().substring(2),"%G":p,"%H":l=>s(l.Ra,2),"%I":l=>(l=l.Ra,l==0?l=12:12<l&&(l-=12),s(l,2)),"%j":l=>{for(var v=0,g=0;g<=l.Sa-1;v+=(Ee(l.Ja+1900)?kt:$t)[g++]);return s(l.Va+v,3)},"%m":l=>s(l.Sa+1,2),"%M":l=>s(l.rb,2),"%n":()=>`
10
+ `,"%p":l=>0<=l.Ra&&12>l.Ra?"AM":"PM","%S":l=>s(l.sb,2),"%t":()=>" ","%u":l=>l.Ga||7,"%U":l=>s(Math.floor((l.Ia+7-l.Ga)/7),2),"%V":l=>{var v=Math.floor((l.Ia+7-(l.Ga+6)%7)/7);if(2>=(l.Ga+371-l.Ia-2)%7&&v++,v)v==53&&(g=(l.Ga+371-l.Ia)%7,g==4||g==3&&Ee(l.Ja)||(v=1));else {v=52;var g=(l.Ga+7-l.Ia-1)%7;(g==4||g==5&&Ee(l.Ja%400-1))&&v++;}return s(v,2)},"%w":l=>l.Ga,"%W":l=>s(Math.floor((l.Ia+7-(l.Ga+6)%7)/7),2),"%y":l=>(l.Ja+1900).toString().substring(2),"%Y":l=>l.Ja+1900,"%z":l=>{l=l.qb;var v=0<=l;return l=Math.abs(l)/60,(v?"+":"-")+("0000"+(l/60*100+l%60)).slice(-4)},"%Z":l=>l.tb,"%%":()=>"%"},r=r.replace(/%%/g,"\0\0");for(m in c)r.includes(m)&&(r=r.replace(new RegExp(m,"g"),c[m](i)));return r=r.replace(/\0\0/g,"%"),m=En(r),m.length>t?0:(J.set(m,e),m.length-1)};le=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError";}};for(var Dt=Array(256),Fe=0;256>Fe;++Fe)Dt[Fe]=String.fromCharCode(Fe);wt=Dt,_=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError";}},Object.assign(be.prototype,{isAliasOf:function(e){if(!(this instanceof be&&e instanceof be))return !1;var t=this.ma.za.xa,r=this.ma.ya;e.ma=e.ma;var i=e.ma.za.xa;for(e=e.ma.ya;t.Ca;)r=t.Na(r),t=t.Ca;for(;i.Ca;)e=i.Na(e),i=i.Ca;return t===i&&r===e},clone:function(){if(this.ma.ya||$e(this),this.ma.Ma)return this.ma.count.value+=1,this;var e=he,t=Object,r=t.create,i=Object.getPrototypeOf(this),o=this.ma;return e=e(r.call(t,i,{ma:{value:{count:o.count,Ka:o.Ka,Ma:o.Ma,ya:o.ya,za:o.za,Aa:o.Aa,Da:o.Da}}})),e.ma.count.value+=1,e.ma.Ka=!1,e},delete(){if(this.ma.ya||$e(this),this.ma.Ka&&!this.ma.Ma)throw new _("Object already scheduled for deletion");Ct(this);var e=this.ma;--e.count.value,e.count.value===0&&(e.Aa?e.Da.Fa(e.Aa):e.za.xa.Fa(e.ya)),this.ma.Ma||(this.ma.Aa=void 0,this.ma.ya=void 0);},isDeleted:function(){return !this.ma.ya},deleteLater:function(){if(this.ma.ya||$e(this),this.ma.Ka&&!this.ma.Ma)throw new _("Object already scheduled for deletion");return de.push(this),de.length===1&&ue&&ue(Re),this.ma.Ka=!0,this}}),a.getInheritedInstanceCount=()=>Object.keys(ce).length,a.getLiveInheritedInstances=()=>{var e=[],t;for(t in ce)ce.hasOwnProperty(t)&&e.push(ce[t]);return e},a.flushPendingDeletes=Re,a.setDelayFunction=e=>{ue=e,de.length&&ue&&ue(Re);},Object.assign(me.prototype,{eb(e){return this.Za&&(e=this.Za(e)),e},Xa(e){this.Fa?.(e);},argPackAdvance:8,readValueFromPointer:se,fromWireType:function(e){function t(){return this.Qa?Ce(this.xa.La,{za:this.jb,ya:r,Da:this,Aa:e}):Ce(this.xa.La,{za:this,ya:e})}var r=this.eb(e);if(!r)return this.Xa(e),null;var i=tn(this.xa,r);if(i!==void 0)return i.ma.count.value===0?(i.ma.ya=r,i.ma.Aa=e,i.clone()):(i=i.clone(),this.Xa(e),i);if(i=this.xa.cb(r),i=Lt[i],!i)return t.call(this);i=this.Pa?i.$a:i.pointerType;var o=bt(r,this.xa,i.xa);return o===null?t.call(this):this.Qa?Ce(i.xa.La,{za:i,ya:o,Da:this,Aa:e}):Ce(i.xa.La,{za:i,ya:o})}}),Ft=a.UnboundTypeError=((e,t)=>{var r=pe(t,function(i){this.name=t,this.message=i,i=Error(i).stack,i!==void 0&&(this.stack=this.toString()+`
11
+ `+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})(Error,"UnboundTypeError"),U.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=()=>U.length/2-5-Ue.length;var In={c:(e,t,r,i)=>{_e(`Assertion failed: ${e?q(E,e):""}, at: `+[t?t?q(E,t):"":"unknown filename",r,i?i?q(E,i):"":"unknown function"]);},m:(e,t,r)=>{var i=new Zt(e);throw M[i.ya+16>>2]=0,M[i.ya+4>>2]=t,M[i.ya+8>>2]=r,gt=e,gt},B:function(){return 0},P:()=>{},M:()=>{},R:function(){return 0},N:()=>{},A:function(){},O:()=>{},v:e=>{var t=ye[e];delete ye[e];var r=t.Ua,i=t.Fa,o=t.Ya,s=o.map(u=>u.hb).concat(o.map(u=>u.nb));V([e],s,u=>{var d={};return o.forEach((p,c)=>{var m=u[c],y=p.fb,b=p.gb,l=u[c+o.length],v=p.mb,g=p.ob;d[p.bb]={read:I=>m.fromWireType(y(b,I)),write:(I,Y)=>{var x=[];v(g,I,l.toWireType(x,Y)),ke(x);}};}),[{name:t.name,fromWireType:p=>{var c={},m;for(m in d)c[m]=d[m].read(p);return i(p),c},toWireType:(p,c)=>{for(var m in d)if(!(m in c))throw new TypeError(`Missing field: "${m}"`);var y=r();for(m in d)d[m].write(y,c[m]);return p!==null&&p.push(i,y),y},argPackAdvance:8,readValueFromPointer:se,Ea:i}]});},I:()=>{},Y:(e,t,r,i)=>{t=P(t),$(e,{name:t,fromWireType:function(o){return !!o},toWireType:function(o,s){return s?r:i},argPackAdvance:8,readValueFromPointer:function(o){return this.fromWireType(E[o])},Ea:null});},r:(e,t,r,i,o,s,u,d,p,c,m,y,b)=>{m=P(m),s=A(o,s),d&&(d=A(u,d)),c&&(c=A(p,c)),b=A(y,b);var l=nn(m);Oe(l,function(){Le(`Cannot construct ${m} due to unbound types`,[i]);}),V([e,t,r],i?[i]:[],v=>{if(v=v[0],i)var g=v.xa,I=g.La;else I=be.prototype;v=pe(m,function(...Ke){if(Object.getPrototypeOf(this)!==Y)throw new _("Use 'new' to construct "+m);if(x.Ha===void 0)throw new _(m+" has no accessible constructor");var jt=x.Ha[Ke.length];if(jt===void 0)throw new _(`Tried to invoke ctor of ${m} with invalid number of parameters (${Ke.length}) - expected (${Object.keys(x.Ha).toString()}) parameters instead!`);return jt.apply(this,Ke)});var Y=Object.create(I,{constructor:{value:v}});v.prototype=Y;var x=new rn(m,v,Y,b,g,s,d,c);if(x.Ca){var fe;(fe=x.Ca).Wa??(fe.Wa=[]),x.Ca.Wa.push(x);}return g=new me(m,x,!0,!1,!1),fe=new me(m+"*",x,!1,!1,!1),I=new me(m+" const*",x,!1,!0,!1),Lt[e]={pointerType:fe,$a:I},Et(l,v),[g,fe,I]});},q:(e,t,r,i,o,s)=>{var u=je(t,r);o=A(i,o),V([],[e],d=>{d=d[0];var p=`constructor ${d.name}`;if(d.xa.Ha===void 0&&(d.xa.Ha=[]),d.xa.Ha[t-1]!==void 0)throw new _(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${d.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return d.xa.Ha[t-1]=()=>{Le(`Cannot construct ${d.name} due to unbound types`,u);},V([],u,c=>(c.splice(1,0,null),d.xa.Ha[t-1]=ze(p,c,null,o,s),[])),[]});},f:(e,t,r,i,o,s,u,d)=>{var p=je(r,i);t=P(t),t=Pt(t),s=A(o,s),V([],[e],c=>{function m(){Le(`Cannot call ${y} due to unbound types`,p);}c=c[0];var y=`${c.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),d&&c.xa.kb.push(t);var b=c.xa.La,l=b[t];return l===void 0||l.Ba===void 0&&l.className!==c.name&&l.Oa===r-2?(m.Oa=r-2,m.className=c.name,b[t]=m):(Mt(b,t,y),b[t].Ba[r-2]=m),V([],p,v=>(v=ze(y,v,c,s,u),b[t].Ba===void 0?(v.Oa=r-2,b[t]=v):b[t].Ba[r-2]=v,[])),[]});},X:e=>$(e,St),x:(e,t,r,i)=>{function o(){}t=P(t),o.values={},$(e,{name:t,constructor:o,fromWireType:function(s){return this.constructor.values[s]},toWireType:(s,u)=>u.value,argPackAdvance:8,readValueFromPointer:cn(t,r,i),Ea:null}),Oe(t,o);},k:(e,t,r)=>{var i=Ne(e,"enum");t=P(t),e=i.constructor,i=Object.create(i.constructor.prototype,{value:{value:r},constructor:{value:pe(`${i.name}_${t}`,function(){})}}),e.values[r]=i,e[t]=i;},C:(e,t,r)=>{t=P(t),$(e,{name:t,fromWireType:i=>i,toWireType:(i,o)=>o,argPackAdvance:8,readValueFromPointer:hn(t,r),Ea:null});},E:(e,t,r,i,o,s)=>{var u=je(t,r);e=P(e),e=Pt(e),o=A(i,o),Oe(e,function(){Le(`Cannot call ${e} due to unbound types`,u);},t-1),V([],u,d=>(Et(e,ze(e,[d[0],null].concat(d.slice(1)),null,o,s),t-1),[]));},l:(e,t,r,i,o)=>{if(t=P(t),o===-1&&(o=4294967295),o=d=>d,i===0){var s=32-8*r;o=d=>d<<s>>>s;}var u=t.includes("unsigned")?function(d,p){return p>>>0}:function(d,p){return p};$(e,{name:t,fromWireType:o,toWireType:u,argPackAdvance:8,readValueFromPointer:pn(t,r,i!==0),Ea:null});},g:(e,t,r)=>{function i(s){return new o(J.buffer,M[s+4>>2],M[s>>2])}var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];r=P(r),$(e,{name:r,fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ib:!0});},w:e=>{$(e,St);},ca:(e,t,r,i,o,s,u,d,p,c,m,y)=>{r=P(r),s=A(o,s),d=A(u,d),c=A(p,c),y=A(m,y),V([e],[t],b=>(b=b[0],[new me(r,b.xa,!1,!1,!0,b,i,s,d,c,y)]));},D:(e,t)=>{t=P(t);var r=t==="std::string";$(e,{name:t,fromWireType:function(i){var o=M[i>>2],s=i+4;if(r)for(var u=s,d=0;d<=o;++d){var p=s+d;if(d==o||E[p]==0){if(u=u?q(E,u,p-u):"",c===void 0)var c=u;else c+="\0",c+=u;u=p+1;}}else {for(c=Array(o),d=0;d<o;++d)c[d]=String.fromCharCode(E[s+d]);c=c.join("");}return B(i),c},toWireType:function(i,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var s=typeof o=="string";if(!(s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array))throw new _("Cannot pass non-string to std::string");var u=r&&s?_t(o):o.length,d=qe(4+u+1),p=d+4;if(M[d>>2]=u,r&&s)yt(o,E,p,u+1);else if(s)for(s=0;s<u;++s){var c=o.charCodeAt(s);if(255<c)throw B(p),new _("String has UTF-16 code units that do not fit in 8 bits");E[p+s]=c;}else for(s=0;s<u;++s)E[p+s]=o[s];return i!==null&&i.push(B,d),d},argPackAdvance:8,readValueFromPointer:se,Ea(i){B(i);}});},u:(e,t,r)=>{if(r=P(r),t===2)var i=mn,o=fn,s=vn,u=d=>ie[d>>1];else t===4&&(i=gn,o=_n,s=yn,u=d=>M[d>>2]);$(e,{name:r,fromWireType:d=>{for(var p=M[d>>2],c,m=d+4,y=0;y<=p;++y){var b=d+4+y*t;(y==p||u(b)==0)&&(m=i(m,b-m),c===void 0?c=m:(c+="\0",c+=m),m=b+t);}return B(d),c},toWireType:(d,p)=>{if(typeof p!="string")throw new _(`Cannot pass non-string to C++ string type ${r}`);var c=s(p),m=qe(4+c+t);return M[m>>2]=c/t,o(p,m+4,c+t),d!==null&&d.push(B,m),m},argPackAdvance:8,readValueFromPointer:se,Ea(d){B(d);}});},s:(e,t,r,i,o,s)=>{ye[e]={name:P(t),Ua:A(r,i),Fa:A(o,s),Ya:[]};},j:(e,t,r,i,o,s,u,d,p,c)=>{ye[e].Ya.push({bb:P(t),hb:r,fb:A(i,o),gb:s,nb:u,mb:A(d,p),ob:c});},Z:(e,t)=>{t=P(t),$(e,{ub:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},J:()=>{throw 1/0},aa:(e,t,r,i)=>(e=Ye[e],t=He(t),e(null,t,r,i)),F:Be,$:(e,t,r)=>{var i=Cn(e,t),o=i.shift();e--;var s=Array(e);return t=`methodCaller<(${i.map(u=>u.name).join(", ")}) => ${o.name}>`,wn(pe(t,(u,d,p,c)=>{for(var m=0,y=0;y<e;++y)s[y]=i[y].readValueFromPointer(c+m),m+=i[y].argPackAdvance;return d=r===1?bn(d,s):d.apply(u,s),u=[],d=o.toWireType(u,d),u.length&&(M[p>>2]=Me(u)),d}))},ba:e=>{9<e&&(U[e+1]+=1);},_:e=>{var t=He(e);ke(t),Be(e);},o:(e,t)=>(e=Ne(e,"_emval_take_value"),e=e.readValueFromPointer(t),Me(e)),W:()=>{_e("");},V:()=>performance.now(),L:e=>{var t=E.length;if(e>>>=0,2147483648<e)return !1;for(var r=1;4>=r;r*=2){var i=t*(1+.2/r);i=Math.min(i,e+100663296);var o=Math;i=Math.max(e,i);e:{o=(o.min.call(o,2147483648,i+(65536-i%65536)%65536)-ge.buffer.byteLength+65535)/65536;try{ge.grow(o),lt();var s=1;break e}catch{}s=void 0;}if(s)return !0}return !1},S:(e,t)=>{var r=0;return xt().forEach((i,o)=>{var s=t+r;for(o=M[e+4*o>>2]=s,s=0;s<i.length;++s)J[o++]=i.charCodeAt(s);J[o]=0,r+=i.length+1;}),0},T:(e,t)=>{var r=xt();M[e>>2]=r.length;var i=0;return r.forEach(o=>i+=o.length+1),M[t>>2]=i,0},t:()=>52,z:()=>52,H:function(){return 70},Q:(e,t,r,i)=>{for(var o=0,s=0;s<r;s++){var u=M[t>>2],d=M[t+4>>2];t+=8;for(var p=0;p<d;p++){var c=E[u+p],m=Ln[e];c===0||c===10?((e===1?Z:Q)(q(m,0)),m.length=0):m.push(c);}o+=d;}return M[i>>2]=o,0},U:(e,t)=>(Tt(E.subarray(e,e+t)),0),i:Tn,d:xn,e:An,p:kn,y:Rn,b:Pn,a:Sn,h:Dn,n:$n,G:On,K:(e,t,r,i)=>Fn(e,t,r,i)},F=function(){function e(r){return F=r.exports,ge=F.da,lt(),T=F.ha,ut.unshift(F.ea),G--,a.monitorRunDependencies?.(G),G==0&&(oe&&(r=oe,oe=null,r())),F}var t={a:In};if(G++,a.monitorRunDependencies?.(G),a.instantiateWasm)try{return a.instantiateWasm(t,e)}catch(r){Q(`Module.instantiateWasm callback failed with error: ${r}`),C(r);}return Xt(t,function(r){e(r.instance);}).catch(C),{}}(),qe=e=>(qe=F.fa)(e),Rt=e=>(Rt=F.ga)(e),B=e=>(B=F.ia)(e),D=(e,t)=>(D=F.ja)(e,t),R=e=>(R=F.ka)(e),O=()=>(O=F.la)();a.dynCall_iijj=(e,t,r,i,o,s)=>(a.dynCall_iijj=F.na)(e,t,r,i,o,s),a.dynCall_vijj=(e,t,r,i,o,s)=>(a.dynCall_vijj=F.oa)(e,t,r,i,o,s),a.dynCall_jiii=(e,t,r,i)=>(a.dynCall_jiii=F.pa)(e,t,r,i),a.dynCall_jii=(e,t,r)=>(a.dynCall_jii=F.qa)(e,t,r);var Ot=a.dynCall_viiij=(e,t,r,i,o,s)=>(Ot=a.dynCall_viiij=F.ra)(e,t,r,i,o,s);a.dynCall_jiji=(e,t,r,i,o)=>(a.dynCall_jiji=F.sa)(e,t,r,i,o),a.dynCall_viijii=(e,t,r,i,o,s,u)=>(a.dynCall_viijii=F.ta)(e,t,r,i,o,s,u),a.dynCall_iiiiij=(e,t,r,i,o,s,u)=>(a.dynCall_iiiiij=F.ua)(e,t,r,i,o,s,u),a.dynCall_iiiiijj=(e,t,r,i,o,s,u,d,p)=>(a.dynCall_iiiiijj=F.va)(e,t,r,i,o,s,u,d,p),a.dynCall_iiiiiijj=(e,t,r,i,o,s,u,d,p,c)=>(a.dynCall_iiiiiijj=F.wa)(e,t,r,i,o,s,u,d,p,c);function Pn(e,t){var r=O();try{T.get(e)(t);}catch(i){if(R(r),i!==i+0)throw i;D(1,0);}}function Sn(e,t,r){var i=O();try{T.get(e)(t,r);}catch(o){if(R(i),o!==o+0)throw o;D(1,0);}}function An(e,t,r,i){var o=O();try{return T.get(e)(t,r,i)}catch(s){if(R(o),s!==s+0)throw s;D(1,0);}}function xn(e,t,r){var i=O();try{return T.get(e)(t,r)}catch(o){if(R(i),o!==o+0)throw o;D(1,0);}}function Tn(e,t){var r=O();try{return T.get(e)(t)}catch(i){if(R(r),i!==i+0)throw i;D(1,0);}}function kn(e,t,r,i,o,s){var u=O();try{return T.get(e)(t,r,i,o,s)}catch(d){if(R(u),d!==d+0)throw d;D(1,0);}}function $n(e,t,r,i,o){var s=O();try{T.get(e)(t,r,i,o);}catch(u){if(R(s),u!==u+0)throw u;D(1,0);}}function Dn(e,t,r,i){var o=O();try{T.get(e)(t,r,i);}catch(s){if(R(o),s!==s+0)throw s;D(1,0);}}function Rn(e){var t=O();try{T.get(e)();}catch(r){if(R(t),r!==r+0)throw r;D(1,0);}}function On(e,t,r,i,o,s){var u=O();try{Ot(e,t,r,i,o,s);}catch(d){if(R(u),d!==d+0)throw d;D(1,0);}}var Ie;oe=function e(){Ie||Wt(),Ie||(oe=e);};function Wt(){function e(){if(!Ie&&(Ie=!0,a.calledRun=!0,!it)){if(Te(ut),h(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var t=a.postRun.shift();ct.unshift(t);}Te(ct);}}if(!(0<G)){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)qt();Te(dt),0<G||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("");},1),e();},1)):e());}}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return Wt(),j}})(),Ut=Un;var X=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(n){return await Ut({locateFile:()=>n})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async n=>{let a=`https://unpkg.com/${ve.name}@${ve.version}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${n.message}`),console.warn(`Attempting to load WASM from backup URL: ${a}`);try{return await this._tryLoad(a)}catch(h){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${h.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};w(X,"_ModulePromise",null),w(X,"_wasmURL",`https://cdn.jsdelivr.net/npm/${ve.name}@${ve.version}/dist/dotlottie-player.wasm`);var re=class{constructor(){w(this,"_eventListeners",new Map);}addEventListener(n,a){let h=this._eventListeners.get(n);h||(h=new Set,this._eventListeners.set(n,h)),h.add(a);}removeEventListener(n,a){let h=this._eventListeners.get(n);h&&(a?(h.delete(a),h.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){this._eventListeners.get(n.type)?.forEach(h=>h(n));}removeAllEventListeners(){this._eventListeners.clear();}};function Bn(f){return /^#([\da-f]{6}|[\da-f]{8})$/iu.test(f)}function Ht(f){if(!Bn(f))return 0;let n=f.replace("#","");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}function Qe(f){if(f.byteLength<4)return !1;let n=new Uint8Array(f.slice(0,Se.byteLength));for(let a=0;a<Se.length;a+=1)if(Se[a]!==n[a])return !1;return !0}function Bt(f){return zt.every(n=>Object.prototype.hasOwnProperty.call(f,n))}function et(f){if(typeof f=="string")try{return Bt(JSON.parse(f))}catch{return !1}else return Bt(f)}var tt=(f,n)=>f==="reverse"?n.Mode.Reverse:f==="bounce"?n.Mode.Bounce:f==="reverse-bounce"?n.Mode.ReverseBounce:n.Mode.Forward,nt=(f,n)=>f==="contain"?n.Fit.Contain:f==="cover"?n.Fit.Cover:f==="fill"?n.Fit.Fill:f==="fit-height"?n.Fit.FitHeight:f==="fit-width"?n.Fit.FitWidth:n.Fit.None,rt=(f,n)=>{let a=new n.VectorFloat;return a.push_back(f[0]),a.push_back(f[1]),a},at=(f,n)=>{let a=new n.VectorFloat;return f.length!==2||(a.push_back(f[0]),a.push_back(f[1])),a},L=class L{constructor(n){w(this,"_canvas");w(this,"_context",null);w(this,"_eventManager");w(this,"_animationFrameId",null);w(this,"_frameManager");w(this,"_dotLottieCore",null);w(this,"_renderConfig",{});w(this,"_isFrozen",!1);w(this,"_backgroundColor",null);this._canvas=n.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new re,this._frameManager=new Pe,this._renderConfig=n.renderConfig??{},X.load().then(a=>{L._wasmModule=a,this._dotLottieCore=new a.DotLottiePlayer({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:tt(n.mode??"forward",a),segment:at(n.segment??[],a),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:rt(n.layout.align,a),fit:nt(n.layout.fit,a)}:a.createDefaultLayout()}),this._eventManager.dispatch({type:"ready"}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),n.backgroundColor&&this.setBackgroundColor(n.backgroundColor);}).catch(a=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${a}`)});});}_dispatchError(n){console.error(n),this._eventManager.dispatch({type:"loadError",error:new Error(n)});}async _fetchData(n){let a=await fetch(n);if(!a.ok)throw new Error(`Failed to fetch animation data from URL: ${n}. ${a.status}: ${a.statusText}`);let h=await a.arrayBuffer();return Qe(h)?h:new TextDecoder().decode(h)}_loadFromData(n){if(this._dotLottieCore===null)return;let a=this._canvas.width,h=this._canvas.height,C=!1;if(typeof n=="string"){if(!et(n)){this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}C=this._dotLottieCore.loadAnimationData(n,a,h);}else if(n instanceof ArrayBuffer){if(!Qe(n)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}C=this._dotLottieCore.loadDotLottieData(n,a,h);}else if(typeof n=="object"){if(!et(n)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}C=this._dotLottieCore.loadAnimationData(JSON.stringify(n),a,h);}else {this._dispatchError(`Unsupported data type for animation data. Expected:
12
+ - string (Lottie JSON),
13
+ - ArrayBuffer (dotLottie),
14
+ - object (Lottie JSON).
15
+ Received: ${typeof n}`);return}C?(this._eventManager.dispatch({type:"load"}),H&&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._dispatchError("Failed to load animation data");}_loadFromSrc(n){this._fetchData(n).then(a=>this._loadFromData(a)).catch(a=>this._dispatchError(`Failed to load animation data from URL: ${n}. ${a}`));}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let n=this._dotLottieCore?.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{switch(n.fit){case L._wasmModule?.Fit.Contain:return "contain";case L._wasmModule?.Fit.Cover:return "cover";case L._wasmModule?.Fit.Fill:return "fill";case L._wasmModule?.Fit.FitHeight:return "fit-height";case L._wasmModule?.Fit.FitWidth:return "fit-width";case L._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let n=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!n)return null;let a=JSON.parse(n);return Object.keys(a).length===0?null:a}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let n=this._dotLottieCore?.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let n=this._dotLottieCore?.config().mode;return n===L._wasmModule?.Mode.Reverse?"reverse":n===L._wasmModule?.Mode.Bounce?"bounce":n===L._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 isReady(){return this._dotLottieCore!==null}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}get canvas(){return this._canvas}load(n){this._dotLottieCore===null||L._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:tt(n.mode??"forward",L._wasmModule),segment:at(n.segment??[],L._wasmModule),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:rt(n.layout.align,L._wasmModule),fit:nt(n.layout.fit,L._wasmModule)}:L._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor(n.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let a=this._dotLottieCore.buffer(),h=new Uint8ClampedArray(a,0,this._canvas.width*this._canvas.height*4),C=null;return typeof ImageData>"u"?(C=this._context.createImageData(this._canvas.width,this._canvas.height),C.data.set(h)):C=new ImageData(h,this._canvas.width,this._canvas.height),this._context.putImageData(C,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 n=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(n)&&(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 n=this._dotLottieCore.play();this._isFrozen=!1,n&&(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(n){if(this._dotLottieCore===null||n<0||n>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(n)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:n});}setBackgroundColor(n){this._dotLottieCore!==null&&(H&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:Ht(n)}),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:n});}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:n});}addEventListener(n,a){this._eventManager.addEventListener(n,a);}removeEventListener(n,a){this._eventManager.removeEventListener(n,a);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}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(H&&this._canvas instanceof HTMLCanvasElement){let a=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:h,width:C}=this._canvas.getBoundingClientRect();this._canvas.width=C*a,this._canvas.height=h*a;}this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,a){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:at([n,a],L._wasmModule)});}setMode(n){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:tt(n,L._wasmModule)});}setRenderConfig(n){this._renderConfig=n;}loadAnimation(n){if(this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===n)return;this._dotLottieCore.loadAnimation(n,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${n}`)});}setMarker(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:n});}markers(){let n=this._dotLottieCore?.markers();if(n){let a=[];for(let h=0;h<n.size();h+=1){let C=n.get(h);a.push({name:C.name,time:C.time,duration:C.duration});}return a}return []}loadTheme(n){if(this._dotLottieCore===null)return !1;let a=this._dotLottieCore.loadTheme(n);return this._render(),a}loadThemeData(n){if(this._dotLottieCore===null)return !1;let a=this._dotLottieCore.loadThemeData(n);return this._render(),a}setLayout(n){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:rt(n.align,L._wasmModule),fit:nt(n.fit,L._wasmModule)}});}setViewport(n,a,h,C){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(n,a,h,C)}static setWasmUrl(n){X.setWasmUrl(n);}loadStateMachine(n){return this._dotLottieCore?.loadStateMachine(n)??!1}startStateMachine(){let n=this._dotLottieCore?.startStateMachine()??!1;return n&&this._setupStateMachineListeners(),n}stopStateMachine(){let n=this._dotLottieCore?.stopStateMachine()??!1;return n&&this._cleanupStateMachineListeners(),n}_getPointerPosition(n){let a=this._canvas.getBoundingClientRect(),h=this._canvas.width/a.width,C=this._canvas.height/a.height,j=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,N=(n.clientX-a.left)*h/j,z=(n.clientY-a.top)*C/j;return {x:N,y:z}}_onPointerUp(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${a} ${h}`);}_onPointerDown(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${a} ${h}`);}_onPointerMove(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${a} ${h}`);}_onPointerEnter(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${a} ${h}`);}_onPointerLeave(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${a} ${h}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}postStateMachineEvent(n){return this._dotLottieCore?.postEventPayload(n)??!1}getStateMachineListeners(){if(!this._dotLottieCore)return [];let n=this._dotLottieCore.stateMachineFrameworkSetup(),a=[];for(let h=0;h<n.size();h+=1)a.push(n.get(h));return a}_setupStateMachineListeners(){if(H&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let n=this.getStateMachineListeners();n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){H&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}loadStateMachineData(n){return this._dotLottieCore?.loadStateMachineData(n)??!1}animationSize(){let n=this._dotLottieCore?.animationSize().get(0)??0,a=this._dotLottieCore?.animationSize().get(1)??0;return {width:n,height:a}}setStateMachineBooleanContext(n,a){return this._dotLottieCore?.setStateMachineBooleanContext(n,a)??!1}setStateMachineNumericContext(n,a){return this._dotLottieCore?.setStateMachineNumericContext(n,a)??!1}setStateMachineStringContext(n,a){return this._dotLottieCore?.setStateMachineStringContext(n,a)??!1}};w(L,"_wasmModule",null);var Nt=L;var Vt='/**\n * This is a worker script for dotlottie.\n * Do not modify this file directly.\n * As it\'s generated by the build process.\n */\n \nvar $n=Object.defineProperty;var kn=(s,n,r)=>n in s?$n(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r;var I=(s,n,r)=>kn(s,typeof n!="symbol"?n+"":n,r);var Xe=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},Ze=class{constructor(){I(this,"_lastHandleId",0);I(this,"_lastImmediate",null);}requestAnimationFrame(n){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{n(Date.now());}),this._lastHandleId}cancelAnimationFrame(n){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Ie=class{constructor(){I(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Xe:new Ze;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var te=typeof window<"u"&&typeof window.document<"u";var xe=new Uint8Array([80,75,3,4]),jt=["v","ip","op","layers","fr","w","h"];var fe={name:"@lottiefiles/dotlottie-web",version:"0.29.2",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.14.11","@vitest/browser":"^2.0.3","@vitest/coverage-istanbul":"^2.0.3","cross-env":"7.0.3",playwright:"^1.45.2",tsup:"8.1.0",typescript:"5.0.4",vitest:"^2.0.3"},publishConfig:{access:"public"}};var On=(()=>{var s=typeof document<"u"?document.currentScript?.src:void 0;return function(n={}){var r=n,c,_,$=new Promise((e,t)=>{c=e,_=t;}),U=Object.assign({},r),V="./this.program",j="";typeof document<"u"&&document.currentScript&&(j=document.currentScript.src),s&&(j=s),j.startsWith("blob:")?j="":j=j.substr(0,j.replace(/[?#].*/,"").lastIndexOf("/")+1);var Nt=r.print||console.log.bind(console),Z=r.printErr||console.error.bind(console);Object.assign(r,U),U=null,r.thisProgram&&(V=r.thisProgram);var ne;r.wasmBinary&&(ne=r.wasmBinary);var ve,at=!1,Y,b,Q,re,P,L,ot,it;function st(){var e=ve.buffer;r.HEAP8=Y=new Int8Array(e),r.HEAP16=Q=new Int16Array(e),r.HEAPU8=b=new Uint8Array(e),r.HEAPU16=re=new Uint16Array(e),r.HEAP32=P=new Int32Array(e),r.HEAPU32=L=new Uint32Array(e),r.HEAPF32=ot=new Float32Array(e),r.HEAPF64=it=new Float64Array(e);}var lt=[],dt=[],ct=[];function Vt(){var e=r.preRun.shift();lt.unshift(e);}var J=0,ae=null;function ye(e){throw r.onAbort?.(e),e="Aborted("+e+")",Z(e),at=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),_(e),e}var ut=e=>e.startsWith("data:application/octet-stream;base64,"),q;if(q="DotLottiePlayer.wasm",!ut(q)){var ht=q;q=r.locateFile?r.locateFile(ht,j):j+ht;}function pt(e){if(e==q&&ne)return new Uint8Array(ne);throw "both async and sync fetching of the wasm failed"}function Yt(e){return ne||typeof fetch!="function"?Promise.resolve().then(()=>pt(e)):fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at \'${e}\'`;return t.arrayBuffer()}).catch(()=>pt(e))}function ft(e,t,a){return Yt(e).then(o=>WebAssembly.instantiate(o,t)).then(a,o=>{Z(`failed to asynchronously prepare wasm: ${o}`),ye(o);})}function Jt(e,t){var a=q;return ne||typeof WebAssembly.instantiateStreaming!="function"||ut(a)||typeof fetch!="function"?ft(a,e,t):fetch(a,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(t,function(i){return Z(`wasm streaming compile failed: ${i}`),Z("falling back to ArrayBuffer instantiation"),ft(a,e,t)}))}var Te=e=>{for(;0<e.length;)e.shift()(r);},mt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,G=(e,t,a)=>{var o=t+a;for(a=t;e[a]&&!(a>=o);)++a;if(16<a-t&&e.buffer&&mt)return mt.decode(e.subarray(t,a));for(o="";t<a;){var i=e[t++];if(i&128){var l=e[t++]&63;if((i&224)==192)o+=String.fromCharCode((i&31)<<6|l);else {var h=e[t++]&63;i=(i&240)==224?(i&15)<<12|l<<6|h:(i&7)<<18|l<<12|h<<6|e[t++]&63,65536>i?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023));}}else o+=String.fromCharCode(i);}return o};class Gt{constructor(t){this.ya=t-24;}}var vt=0,yt=e=>{for(var t=0,a=0;a<e.length;++a){var o=e.charCodeAt(a);127>=o?t++:2047>=o?t+=2:55296<=o&&57343>=o?(t+=4,++a):t+=3;}return t},gt=(e,t,a,o)=>{if(0<o){o=a+o-1;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(127>=l){if(a>=o)break;t[a++]=l;}else {if(2047>=l){if(a+1>=o)break;t[a++]=192|l>>6;}else {if(65535>=l){if(a+2>=o)break;t[a++]=224|l>>12;}else {if(a+3>=o)break;t[a++]=240|l>>18,t[a++]=128|l>>12&63;}t[a++]=128|l>>6&63;}t[a++]=128|l&63;}}t[a]=0;}},ge={},Se=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function oe(e){return this.fromWireType(L[e>>2])}var ee={},K={},we={},ie,H=(e,t,a)=>{function o(u){if(u=a(u),u.length!==e.length)throw new ie("Mismatched type converter count");for(var f=0;f<e.length;++f)k(e[f],u[f]);}e.forEach(function(u){we[u]=t;});var i=Array(t.length),l=[],h=0;t.forEach((u,f)=>{K.hasOwnProperty(u)?i[f]=K[u]:(l.push(u),ee.hasOwnProperty(u)||(ee[u]=[]),ee[u].push(()=>{i[f]=K[u],++h,h===l.length&&o(i);}));}),l.length===0&&o(i);},wt,A=e=>{for(var t="";b[e];)t+=wt[b[e++]];return t},g;function Xt(e,t,a={}){var o=t.name;if(!e)throw new g(`type "${o}" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(a.ib)return;throw new g(`Cannot register type \'${o}\' twice`)}K[e]=t,delete we[e],ee.hasOwnProperty(e)&&(t=ee[e],delete ee[e],t.forEach(i=>i()));}function k(e,t,a={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Xt(e,t,a)}var Re=e=>{throw new g(e.ma.za.xa.name+" instance already deleted")},$e=!1,_t=()=>{},Et=(e,t,a)=>t===a?e:a.Ca===void 0?null:(e=Et(e,t,a.Ca),e===null?null:a.ab(e)),Ct={},se=[],ke=()=>{for(;se.length;){var e=se.pop();e.ma.Ka=!1,e.delete();}},le,de={},Zt=(e,t)=>{if(t===void 0)throw new g("ptr should not be undefined");for(;e.Ca;)t=e.Na(t),e=e.Ca;return de[t]},_e=(e,t)=>{if(!t.za||!t.ya)throw new ie("makeClassHandle requires ptr and ptrType");if(!!t.Da!=!!t.Aa)throw new ie("Both smartPtrType and smartPtr must be specified");return t.count={value:1},ce(Object.create(e,{ma:{value:t,writable:!0}}))},ce=e=>typeof FinalizationRegistry>"u"?(ce=t=>t,e):($e=new FinalizationRegistry(t=>{t=t.ma,--t.count.value,t.count.value===0&&(t.Aa?t.Da.Fa(t.Aa):t.za.xa.Fa(t.ya));}),ce=t=>{var a=t.ma;return a.Aa&&$e.register(t,{ma:a},t),t},_t=t=>{$e.unregister(t);},ce(e));function Ee(){}var ue=(e,t)=>Object.defineProperty(t,"name",{value:e}),Mt=(e,t,a)=>{if(e[t].Ba===void 0){var o=e[t];e[t]=function(...i){if(!e[t].Ba.hasOwnProperty(i.length))throw new g(`Function \'${a}\' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].Ba})!`);return e[t].Ba[i.length].apply(this,i)},e[t].Ba=[],e[t].Ba[o.Oa]=o;}},De=(e,t,a)=>{if(r.hasOwnProperty(e)){if(a===void 0||r[e].Ba!==void 0&&r[e].Ba[a]!==void 0)throw new g(`Cannot register public name \'${e}\' twice`);if(Mt(r,e,e),r.hasOwnProperty(a))throw new g(`Cannot register multiple overloads of a function with the same number of arguments (${a})!`);r[e].Ba[a]=t;}else r[e]=t,a!==void 0&&(r[e].vb=a);},Qt=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function qt(e,t,a,o,i,l,h,u){this.name=e,this.constructor=t,this.La=a,this.Fa=o,this.Ca=i,this.cb=l,this.Na=h,this.ab=u,this.kb=[];}var Oe=(e,t,a)=>{for(;t!==a;){if(!t.Na)throw new g(`Expected null or instance of ${a.name}, got an instance of ${t.name}`);e=t.Na(e),t=t.Ca;}return e};function en(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass "${Ne(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);return Oe(t.ma.ya,t.ma.za.xa,this.xa)}function tn(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);if(this.Qa){var a=this.Ua();return e!==null&&e.push(this.Fa,a),a}return 0}if(!t||!t.ma)throw new g(`Cannot pass "${Ne(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Pa&&t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);if(a=Oe(t.ma.ya,t.ma.za.xa,this.xa),this.Qa){if(t.ma.Aa===void 0)throw new g("Passing raw pointer to smart pointer is illegal");switch(this.pb){case 0:if(t.ma.Da===this)a=t.ma.Aa;else throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);break;case 1:a=t.ma.Aa;break;case 2:if(t.ma.Da===this)a=t.ma.Aa;else {var o=t.clone();a=this.lb(a,Me(()=>o.delete())),e!==null&&e.push(this.Fa,a);}break;default:throw new g("Unsupporting sharing policy")}}return a}function nn(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass "${Ne(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.za.name} to parameter type ${this.name}`);return Oe(t.ma.ya,t.ma.za.xa,this.xa)}function he(e,t,a,o,i,l,h,u,f,p,m){this.name=e,this.xa=t,this.Ta=a,this.Pa=o,this.Qa=i,this.jb=l,this.pb=h,this.Za=u,this.Ua=f,this.lb=p,this.Fa=m,i||t.Ca!==void 0?this.toWireType=tn:(this.toWireType=o?en:nn,this.Ea=null);}var Lt=(e,t,a)=>{if(!r.hasOwnProperty(e))throw new ie("Replacing nonexistent public symbol");r[e].Ba!==void 0&&a!==void 0?r[e].Ba[a]=t:(r[e]=t,r[e].Oa=a);},R,rn=(e,t,a=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0, r["dynCall_"+e])(t,...a)):t=R.get(t)(...a),t),an=(e,t)=>(...a)=>rn(e,t,a),T=(e,t)=>{e=A(e);var a=e.includes("j")?an(e,t):R.get(t);if(typeof a!="function")throw new g(`unknown function pointer with signature ${e}: ${t}`);return a},bt,Ft=e=>{e=kt(e);var t=A(e);return W(e),t},Ce=(e,t)=>{function a(l){i[l]||K[l]||(we[l]?we[l].forEach(a):(o.push(l),i[l]=!0));}var o=[],i={};throw t.forEach(a),new bt(`${e}: `+o.map(Ft).join([", "]))},ze=(e,t)=>{for(var a=[],o=0;o<e;o++)a.push(L[t+4*o>>2]);return a};function on(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Ea===void 0)return !0;return !1}function je(e,t,a,o,i){var l=t.length;if(2>l)throw new g("argTypes array size mismatch! Must at least get return value and \'this\' types!");var h=t[1]!==null&&a!==null,u=on(t),f=t[0].name!=="void",p=l-2,m=Array(p),w=[],C=[];return ue(e,function(...d){if(d.length!==p)throw new g(`function ${e} called with ${d.length} arguments, expected ${p}`);if(C.length=0,w.length=h?2:1,w[0]=i,h){var v=t[1].toWireType(C,this);w[1]=v;}for(var y=0;y<p;++y)m[y]=t[y+2].toWireType(C,d[y]),w.push(m[y]);if(d=o(...w),u)Se(C);else for(y=h?1:2;y<t.length;y++){var x=y===1?v:m[y-2];t[y].Ea!==null&&t[y].Ea(x);}return v=f?t[0].fromWireType(d):void 0,v})}var It=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},Be=[],B=[],We=e=>{9<e&&--B[e+1]===0&&(B[e]=void 0,Be.push(e));},Ue=e=>{if(!e)throw new g("Cannot use deleted val. handle = "+e);return B[e]},Me=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=Be.pop()||B.length;return B[t]=e,B[t+1]=1,t}},xt={name:"emscripten::val",fromWireType:e=>{var t=Ue(e);return We(e),t},toWireType:(e,t)=>Me(t),argPackAdvance:8,readValueFromPointer:oe,Ea:null},sn=(e,t,a)=>{switch(t){case 1:return a?function(o){return this.fromWireType(Y[o])}:function(o){return this.fromWireType(b[o])};case 2:return a?function(o){return this.fromWireType(Q[o>>1])}:function(o){return this.fromWireType(re[o>>1])};case 4:return a?function(o){return this.fromWireType(P[o>>2])}:function(o){return this.fromWireType(L[o>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},He=(e,t)=>{var a=K[e];if(a===void 0)throw e=`${t} has unknown type ${Ft(e)}`,new g(e);return a},Ne=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},ln=(e,t)=>{switch(t){case 4:return function(a){return this.fromWireType(ot[a>>2])};case 8:return function(a){return this.fromWireType(it[a>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},dn=(e,t,a)=>{switch(t){case 1:return a?o=>Y[o]:o=>b[o];case 2:return a?o=>Q[o>>1]:o=>re[o>>1];case 4:return a?o=>P[o>>2]:o=>L[o>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},At=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,cn=(e,t)=>{for(var a=e>>1,o=a+t/2;!(a>=o)&&re[a];)++a;if(a<<=1,32<a-e&&At)return At.decode(b.subarray(e,a));for(a="",o=0;!(o>=t/2);++o){var i=Q[e+2*o>>1];if(i==0)break;a+=String.fromCharCode(i);}return a},un=(e,t,a)=>{if(a??(a=2147483647),2>a)return 0;a-=2;var o=t;a=a<2*e.length?a/2:e.length;for(var i=0;i<a;++i)Q[t>>1]=e.charCodeAt(i),t+=2;return Q[t>>1]=0,t-o},hn=e=>2*e.length,pn=(e,t)=>{for(var a=0,o="";!(a>=t/4);){var i=P[e+4*a>>2];if(i==0)break;++a,65536<=i?(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023)):o+=String.fromCharCode(i);}return o},fn=(e,t,a)=>{if(a??(a=2147483647),4>a)return 0;var o=t;a=o+a-4;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(P[t>>2]=l,t+=4,t+4>a)break}return P[t>>2]=0,t-o},mn=e=>{for(var t=0,a=0;a<e.length;++a){var o=e.charCodeAt(a);55296<=o&&57343>=o&&++a,t+=4;}return t},Ve=[],vn=e=>{var t=Ve.length;return Ve.push(e),t},yn=(e,t)=>{for(var a=Array(e),o=0;o<e;++o)a[o]=He(L[t+4*o>>2],"parameter "+o);return a},gn=Reflect.construct,Ye={},Pt=()=>{if(!Je){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:V||"./this.program"},t;for(t in Ye)Ye[t]===void 0?delete e[t]:e[t]=Ye[t];var a=[];for(t in e)a.push(`${t}=${e[t]}`);Je=a;}return Je},Je,wn=[null,[],[]],_n=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ye("initRandomDevice");},Tt=e=>(Tt=_n())(e),Le=e=>e%4===0&&(e%100!==0||e%400===0),St=[31,29,31,30,31,30,31,31,30,31,30,31],Rt=[31,28,31,30,31,30,31,31,30,31,30,31];function En(e){var t=Array(yt(e)+1);return gt(e,t,0,t.length),t}var Cn=(e,t,a,o)=>{function i(d,v,y){for(d=typeof d=="number"?d.toString():d||"";d.length<v;)d=y[0]+d;return d}function l(d,v){return i(d,v,"0")}function h(d,v){function y(N){return 0>N?-1:0<N?1:0}var x;return (x=y(d.getFullYear()-v.getFullYear()))===0&&(x=y(d.getMonth()-v.getMonth()))===0&&(x=y(d.getDate()-v.getDate())),x}function u(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function f(d){var v=d.Ia;for(d=new Date(new Date(d.Ja+1900,0,1).getTime());0<v;){var y=d.getMonth(),x=(Le(d.getFullYear())?St:Rt)[y];if(v>x-d.getDate())v-=x-d.getDate()+1,d.setDate(1),11>y?d.setMonth(y+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else {d.setDate(d.getDate()+v);break}}return y=new Date(d.getFullYear()+1,0,4),v=u(new Date(d.getFullYear(),0,4)),y=u(y),0>=h(v,d)?0>=h(y,d)?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}var p=L[o+40>>2];o={sb:P[o>>2],rb:P[o+4>>2],Ra:P[o+8>>2],Va:P[o+12>>2],Sa:P[o+16>>2],Ja:P[o+20>>2],Ga:P[o+24>>2],Ia:P[o+28>>2],wb:P[o+32>>2],qb:P[o+36>>2],tb:p&&p?G(b,p):""},a=a?G(b,a):"",p={"%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 m in p)a=a.replace(new RegExp(m,"g"),p[m]);var w="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),C="January February March April May June July August September October November December".split(" ");p={"%a":d=>w[d.Ga].substring(0,3),"%A":d=>w[d.Ga],"%b":d=>C[d.Sa].substring(0,3),"%B":d=>C[d.Sa],"%C":d=>l((d.Ja+1900)/100|0,2),"%d":d=>l(d.Va,2),"%e":d=>i(d.Va,2," "),"%g":d=>f(d).toString().substring(2),"%G":f,"%H":d=>l(d.Ra,2),"%I":d=>(d=d.Ra,d==0?d=12:12<d&&(d-=12),l(d,2)),"%j":d=>{for(var v=0,y=0;y<=d.Sa-1;v+=(Le(d.Ja+1900)?St:Rt)[y++]);return l(d.Va+v,3)},"%m":d=>l(d.Sa+1,2),"%M":d=>l(d.rb,2),"%n":()=>`\n`,"%p":d=>0<=d.Ra&&12>d.Ra?"AM":"PM","%S":d=>l(d.sb,2),"%t":()=>" ","%u":d=>d.Ga||7,"%U":d=>l(Math.floor((d.Ia+7-d.Ga)/7),2),"%V":d=>{var v=Math.floor((d.Ia+7-(d.Ga+6)%7)/7);if(2>=(d.Ga+371-d.Ia-2)%7&&v++,v)v==53&&(y=(d.Ga+371-d.Ia)%7,y==4||y==3&&Le(d.Ja)||(v=1));else {v=52;var y=(d.Ga+7-d.Ia-1)%7;(y==4||y==5&&Le(d.Ja%400-1))&&v++;}return l(v,2)},"%w":d=>d.Ga,"%W":d=>l(Math.floor((d.Ia+7-(d.Ga+6)%7)/7),2),"%y":d=>(d.Ja+1900).toString().substring(2),"%Y":d=>d.Ja+1900,"%z":d=>{d=d.qb;var v=0<=d;return d=Math.abs(d)/60,(v?"+":"-")+("0000"+(d/60*100+d%60)).slice(-4)},"%Z":d=>d.tb,"%%":()=>"%"},a=a.replace(/%%/g,"\\0\\0");for(m in p)a.includes(m)&&(a=a.replace(new RegExp(m,"g"),p[m](o)));return a=a.replace(/\\0\\0/g,"%"),m=En(a),m.length>t?0:(Y.set(m,e),m.length-1)};ie=r.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError";}};for(var $t=Array(256),be=0;256>be;++be)$t[be]=String.fromCharCode(be);wt=$t,g=r.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError";}},Object.assign(Ee.prototype,{isAliasOf:function(e){if(!(this instanceof Ee&&e instanceof Ee))return !1;var t=this.ma.za.xa,a=this.ma.ya;e.ma=e.ma;var o=e.ma.za.xa;for(e=e.ma.ya;t.Ca;)a=t.Na(a),t=t.Ca;for(;o.Ca;)e=o.Na(e),o=o.Ca;return t===o&&a===e},clone:function(){if(this.ma.ya||Re(this),this.ma.Ma)return this.ma.count.value+=1,this;var e=ce,t=Object,a=t.create,o=Object.getPrototypeOf(this),i=this.ma;return e=e(a.call(t,o,{ma:{value:{count:i.count,Ka:i.Ka,Ma:i.Ma,ya:i.ya,za:i.za,Aa:i.Aa,Da:i.Da}}})),e.ma.count.value+=1,e.ma.Ka=!1,e},delete(){if(this.ma.ya||Re(this),this.ma.Ka&&!this.ma.Ma)throw new g("Object already scheduled for deletion");_t(this);var e=this.ma;--e.count.value,e.count.value===0&&(e.Aa?e.Da.Fa(e.Aa):e.za.xa.Fa(e.ya)),this.ma.Ma||(this.ma.Aa=void 0,this.ma.ya=void 0);},isDeleted:function(){return !this.ma.ya},deleteLater:function(){if(this.ma.ya||Re(this),this.ma.Ka&&!this.ma.Ma)throw new g("Object already scheduled for deletion");return se.push(this),se.length===1&&le&&le(ke),this.ma.Ka=!0,this}}),r.getInheritedInstanceCount=()=>Object.keys(de).length,r.getLiveInheritedInstances=()=>{var e=[],t;for(t in de)de.hasOwnProperty(t)&&e.push(de[t]);return e},r.flushPendingDeletes=ke,r.setDelayFunction=e=>{le=e,se.length&&le&&le(ke);},Object.assign(he.prototype,{eb(e){return this.Za&&(e=this.Za(e)),e},Xa(e){this.Fa?.(e);},argPackAdvance:8,readValueFromPointer:oe,fromWireType:function(e){function t(){return this.Qa?_e(this.xa.La,{za:this.jb,ya:a,Da:this,Aa:e}):_e(this.xa.La,{za:this,ya:e})}var a=this.eb(e);if(!a)return this.Xa(e),null;var o=Zt(this.xa,a);if(o!==void 0)return o.ma.count.value===0?(o.ma.ya=a,o.ma.Aa=e,o.clone()):(o=o.clone(),this.Xa(e),o);if(o=this.xa.cb(a),o=Ct[o],!o)return t.call(this);o=this.Pa?o.$a:o.pointerType;var i=Et(a,this.xa,o.xa);return i===null?t.call(this):this.Qa?_e(o.xa.La,{za:o,ya:i,Da:this,Aa:e}):_e(o.xa.La,{za:o,ya:i})}}),bt=r.UnboundTypeError=((e,t)=>{var a=ue(t,function(o){this.name=t,this.message=o,o=Error(o).stack,o!==void 0&&(this.stack=this.toString()+`\n`+o.replace(/^Error(:[^\\n]*)?\\n/,""));});return a.prototype=Object.create(e.prototype),a.prototype.constructor=a,a.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},a})(Error,"UnboundTypeError"),B.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>B.length/2-5-Be.length;var Mn={c:(e,t,a,o)=>{ye(`Assertion failed: ${e?G(b,e):""}, at: `+[t?t?G(b,t):"":"unknown filename",a,o?o?G(b,o):"":"unknown function"]);},m:(e,t,a)=>{var o=new Gt(e);throw L[o.ya+16>>2]=0,L[o.ya+4>>2]=t,L[o.ya+8>>2]=a,vt=e,vt},B:function(){return 0},P:()=>{},M:()=>{},R:function(){return 0},N:()=>{},A:function(){},O:()=>{},v:e=>{var t=ge[e];delete ge[e];var a=t.Ua,o=t.Fa,i=t.Ya,l=i.map(h=>h.hb).concat(i.map(h=>h.nb));H([e],l,h=>{var u={};return i.forEach((f,p)=>{var m=h[p],w=f.fb,C=f.gb,d=h[p+i.length],v=f.mb,y=f.ob;u[f.bb]={read:x=>m.fromWireType(w(C,x)),write:(x,N)=>{var S=[];v(y,x,d.toWireType(S,N)),Se(S);}};}),[{name:t.name,fromWireType:f=>{var p={},m;for(m in u)p[m]=u[m].read(f);return o(f),p},toWireType:(f,p)=>{for(var m in u)if(!(m in p))throw new TypeError(`Missing field: "${m}"`);var w=a();for(m in u)u[m].write(w,p[m]);return f!==null&&f.push(o,w),w},argPackAdvance:8,readValueFromPointer:oe,Ea:o}]});},I:()=>{},Y:(e,t,a,o)=>{t=A(t),k(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,l){return l?a:o},argPackAdvance:8,readValueFromPointer:function(i){return this.fromWireType(b[i])},Ea:null});},r:(e,t,a,o,i,l,h,u,f,p,m,w,C)=>{m=A(m),l=T(i,l),u&&(u=T(h,u)),p&&(p=T(f,p)),C=T(w,C);var d=Qt(m);De(d,function(){Ce(`Cannot construct ${m} due to unbound types`,[o]);}),H([e,t,a],o?[o]:[],v=>{if(v=v[0],o)var y=v.xa,x=y.La;else x=Ee.prototype;v=ue(m,function(...Ke){if(Object.getPrototypeOf(this)!==N)throw new g("Use \'new\' to construct "+m);if(S.Ha===void 0)throw new g(m+" has no accessible constructor");var zt=S.Ha[Ke.length];if(zt===void 0)throw new g(`Tried to invoke ctor of ${m} with invalid number of parameters (${Ke.length}) - expected (${Object.keys(S.Ha).toString()}) parameters instead!`);return zt.apply(this,Ke)});var N=Object.create(x,{constructor:{value:v}});v.prototype=N;var S=new qt(m,v,N,C,y,l,u,p);if(S.Ca){var pe;(pe=S.Ca).Wa??(pe.Wa=[]),S.Ca.Wa.push(S);}return y=new he(m,S,!0,!1,!1),pe=new he(m+"*",S,!1,!1,!1),x=new he(m+" const*",S,!1,!0,!1),Ct[e]={pointerType:pe,$a:x},Lt(d,v),[y,pe,x]});},q:(e,t,a,o,i,l)=>{var h=ze(t,a);i=T(o,i),H([],[e],u=>{u=u[0];var f=`constructor ${u.name}`;if(u.xa.Ha===void 0&&(u.xa.Ha=[]),u.xa.Ha[t-1]!==void 0)throw new g(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class \'${u.name}\'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.xa.Ha[t-1]=()=>{Ce(`Cannot construct ${u.name} due to unbound types`,h);},H([],h,p=>(p.splice(1,0,null),u.xa.Ha[t-1]=je(f,p,null,i,l),[])),[]});},f:(e,t,a,o,i,l,h,u)=>{var f=ze(a,o);t=A(t),t=It(t),l=T(i,l),H([],[e],p=>{function m(){Ce(`Cannot call ${w} due to unbound types`,f);}p=p[0];var w=`${p.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&p.xa.kb.push(t);var C=p.xa.La,d=C[t];return d===void 0||d.Ba===void 0&&d.className!==p.name&&d.Oa===a-2?(m.Oa=a-2,m.className=p.name,C[t]=m):(Mt(C,t,w),C[t].Ba[a-2]=m),H([],f,v=>(v=je(w,v,p,l,h),C[t].Ba===void 0?(v.Oa=a-2,C[t]=v):C[t].Ba[a-2]=v,[])),[]});},X:e=>k(e,xt),x:(e,t,a,o)=>{function i(){}t=A(t),i.values={},k(e,{name:t,constructor:i,fromWireType:function(l){return this.constructor.values[l]},toWireType:(l,h)=>h.value,argPackAdvance:8,readValueFromPointer:sn(t,a,o),Ea:null}),De(t,i);},k:(e,t,a)=>{var o=He(e,"enum");t=A(t),e=o.constructor,o=Object.create(o.constructor.prototype,{value:{value:a},constructor:{value:ue(`${o.name}_${t}`,function(){})}}),e.values[a]=o,e[t]=o;},C:(e,t,a)=>{t=A(t),k(e,{name:t,fromWireType:o=>o,toWireType:(o,i)=>i,argPackAdvance:8,readValueFromPointer:ln(t,a),Ea:null});},E:(e,t,a,o,i,l)=>{var h=ze(t,a);e=A(e),e=It(e),i=T(o,i),De(e,function(){Ce(`Cannot call ${e} due to unbound types`,h);},t-1),H([],h,u=>(Lt(e,je(e,[u[0],null].concat(u.slice(1)),null,i,l),t-1),[]));},l:(e,t,a,o,i)=>{if(t=A(t),i===-1&&(i=4294967295),i=u=>u,o===0){var l=32-8*a;i=u=>u<<l>>>l;}var h=t.includes("unsigned")?function(u,f){return f>>>0}:function(u,f){return f};k(e,{name:t,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:dn(t,a,o!==0),Ea:null});},g:(e,t,a)=>{function o(l){return new i(Y.buffer,L[l+4>>2],L[l>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];a=A(a),k(e,{name:a,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ib:!0});},w:e=>{k(e,xt);},ca:(e,t,a,o,i,l,h,u,f,p,m,w)=>{a=A(a),l=T(i,l),u=T(h,u),p=T(f,p),w=T(m,w),H([e],[t],C=>(C=C[0],[new he(a,C.xa,!1,!1,!0,C,o,l,u,p,w)]));},D:(e,t)=>{t=A(t);var a=t==="std::string";k(e,{name:t,fromWireType:function(o){var i=L[o>>2],l=o+4;if(a)for(var h=l,u=0;u<=i;++u){var f=l+u;if(u==i||b[f]==0){if(h=h?G(b,h,f-h):"",p===void 0)var p=h;else p+="\\0",p+=h;h=f+1;}}else {for(p=Array(i),u=0;u<i;++u)p[u]=String.fromCharCode(b[l+u]);p=p.join("");}return W(o),p},toWireType:function(o,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var l=typeof i=="string";if(!(l||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array))throw new g("Cannot pass non-string to std::string");var h=a&&l?yt(i):i.length,u=Ge(4+h+1),f=u+4;if(L[u>>2]=h,a&&l)gt(i,b,f,h+1);else if(l)for(l=0;l<h;++l){var p=i.charCodeAt(l);if(255<p)throw W(f),new g("String has UTF-16 code units that do not fit in 8 bits");b[f+l]=p;}else for(l=0;l<h;++l)b[f+l]=i[l];return o!==null&&o.push(W,u),u},argPackAdvance:8,readValueFromPointer:oe,Ea(o){W(o);}});},u:(e,t,a)=>{if(a=A(a),t===2)var o=cn,i=un,l=hn,h=u=>re[u>>1];else t===4&&(o=pn,i=fn,l=mn,h=u=>L[u>>2]);k(e,{name:a,fromWireType:u=>{for(var f=L[u>>2],p,m=u+4,w=0;w<=f;++w){var C=u+4+w*t;(w==f||h(C)==0)&&(m=o(m,C-m),p===void 0?p=m:(p+="\\0",p+=m),m=C+t);}return W(u),p},toWireType:(u,f)=>{if(typeof f!="string")throw new g(`Cannot pass non-string to C++ string type ${a}`);var p=l(f),m=Ge(4+p+t);return L[m>>2]=p/t,i(f,m+4,p+t),u!==null&&u.push(W,m),m},argPackAdvance:8,readValueFromPointer:oe,Ea(u){W(u);}});},s:(e,t,a,o,i,l)=>{ge[e]={name:A(t),Ua:T(a,o),Fa:T(i,l),Ya:[]};},j:(e,t,a,o,i,l,h,u,f,p)=>{ge[e].Ya.push({bb:A(t),hb:a,fb:T(o,i),gb:l,nb:h,mb:T(u,f),ob:p});},Z:(e,t)=>{t=A(t),k(e,{ub:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},J:()=>{throw 1/0},aa:(e,t,a,o)=>(e=Ve[e],t=Ue(t),e(null,t,a,o)),F:We,$:(e,t,a)=>{var o=yn(e,t),i=o.shift();e--;var l=Array(e);return t=`methodCaller<(${o.map(h=>h.name).join(", ")}) => ${i.name}>`,vn(ue(t,(h,u,f,p)=>{for(var m=0,w=0;w<e;++w)l[w]=o[w].readValueFromPointer(p+m),m+=o[w].argPackAdvance;return u=a===1?gn(u,l):u.apply(h,l),h=[],u=i.toWireType(h,u),h.length&&(L[f>>2]=Me(h)),u}))},ba:e=>{9<e&&(B[e+1]+=1);},_:e=>{var t=Ue(e);Se(t),We(e);},o:(e,t)=>(e=He(e,"_emval_take_value"),e=e.readValueFromPointer(t),Me(e)),W:()=>{ye("");},V:()=>performance.now(),L:e=>{var t=b.length;if(e>>>=0,2147483648<e)return !1;for(var a=1;4>=a;a*=2){var o=t*(1+.2/a);o=Math.min(o,e+100663296);var i=Math;o=Math.max(e,o);e:{i=(i.min.call(i,2147483648,o+(65536-o%65536)%65536)-ve.buffer.byteLength+65535)/65536;try{ve.grow(i),st();var l=1;break e}catch{}l=void 0;}if(l)return !0}return !1},S:(e,t)=>{var a=0;return Pt().forEach((o,i)=>{var l=t+a;for(i=L[e+4*i>>2]=l,l=0;l<o.length;++l)Y[i++]=o.charCodeAt(l);Y[i]=0,a+=o.length+1;}),0},T:(e,t)=>{var a=Pt();L[e>>2]=a.length;var o=0;return a.forEach(i=>o+=i.length+1),L[t>>2]=o,0},t:()=>52,z:()=>52,H:function(){return 70},Q:(e,t,a,o)=>{for(var i=0,l=0;l<a;l++){var h=L[t>>2],u=L[t+4>>2];t+=8;for(var f=0;f<u;f++){var p=b[h+f],m=wn[e];p===0||p===10?((e===1?Nt:Z)(G(m,0)),m.length=0):m.push(p);}i+=u;}return L[o>>2]=i,0},U:(e,t)=>(Tt(b.subarray(e,e+t)),0),i:xn,d:In,e:Fn,p:An,y:Sn,b:Ln,a:bn,h:Tn,n:Pn,G:Rn,K:(e,t,a,o)=>Cn(e,t,a,o)},F=function(){function e(a){return F=a.exports,ve=F.da,st(),R=F.ha,dt.unshift(F.ea),J--,r.monitorRunDependencies?.(J),J==0&&(ae&&(a=ae,ae=null,a())),F}var t={a:Mn};if(J++,r.monitorRunDependencies?.(J),r.instantiateWasm)try{return r.instantiateWasm(t,e)}catch(a){Z(`Module.instantiateWasm callback failed with error: ${a}`),_(a);}return Jt(t,function(a){e(a.instance);}).catch(_),{}}(),Ge=e=>(Ge=F.fa)(e),kt=e=>(kt=F.ga)(e),W=e=>(W=F.ia)(e),D=(e,t)=>(D=F.ja)(e,t),O=e=>(O=F.ka)(e),z=()=>(z=F.la)();r.dynCall_iijj=(e,t,a,o,i,l)=>(r.dynCall_iijj=F.na)(e,t,a,o,i,l),r.dynCall_vijj=(e,t,a,o,i,l)=>(r.dynCall_vijj=F.oa)(e,t,a,o,i,l),r.dynCall_jiii=(e,t,a,o)=>(r.dynCall_jiii=F.pa)(e,t,a,o),r.dynCall_jii=(e,t,a)=>(r.dynCall_jii=F.qa)(e,t,a);var Dt=r.dynCall_viiij=(e,t,a,o,i,l)=>(Dt=r.dynCall_viiij=F.ra)(e,t,a,o,i,l);r.dynCall_jiji=(e,t,a,o,i)=>(r.dynCall_jiji=F.sa)(e,t,a,o,i),r.dynCall_viijii=(e,t,a,o,i,l,h)=>(r.dynCall_viijii=F.ta)(e,t,a,o,i,l,h),r.dynCall_iiiiij=(e,t,a,o,i,l,h)=>(r.dynCall_iiiiij=F.ua)(e,t,a,o,i,l,h),r.dynCall_iiiiijj=(e,t,a,o,i,l,h,u,f)=>(r.dynCall_iiiiijj=F.va)(e,t,a,o,i,l,h,u,f),r.dynCall_iiiiiijj=(e,t,a,o,i,l,h,u,f,p)=>(r.dynCall_iiiiiijj=F.wa)(e,t,a,o,i,l,h,u,f,p);function Ln(e,t){var a=z();try{R.get(e)(t);}catch(o){if(O(a),o!==o+0)throw o;D(1,0);}}function bn(e,t,a){var o=z();try{R.get(e)(t,a);}catch(i){if(O(o),i!==i+0)throw i;D(1,0);}}function Fn(e,t,a,o){var i=z();try{return R.get(e)(t,a,o)}catch(l){if(O(i),l!==l+0)throw l;D(1,0);}}function In(e,t,a){var o=z();try{return R.get(e)(t,a)}catch(i){if(O(o),i!==i+0)throw i;D(1,0);}}function xn(e,t){var a=z();try{return R.get(e)(t)}catch(o){if(O(a),o!==o+0)throw o;D(1,0);}}function An(e,t,a,o,i,l){var h=z();try{return R.get(e)(t,a,o,i,l)}catch(u){if(O(h),u!==u+0)throw u;D(1,0);}}function Pn(e,t,a,o,i){var l=z();try{R.get(e)(t,a,o,i);}catch(h){if(O(l),h!==h+0)throw h;D(1,0);}}function Tn(e,t,a,o){var i=z();try{R.get(e)(t,a,o);}catch(l){if(O(i),l!==l+0)throw l;D(1,0);}}function Sn(e){var t=z();try{R.get(e)();}catch(a){if(O(t),a!==a+0)throw a;D(1,0);}}function Rn(e,t,a,o,i,l){var h=z();try{Dt(e,t,a,o,i,l);}catch(u){if(O(h),u!==u+0)throw u;D(1,0);}}var Fe;ae=function e(){Fe||Ot(),Fe||(ae=e);};function Ot(){function e(){if(!Fe&&(Fe=!0,r.calledRun=!0,!at)){if(Te(dt),c(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();ct.unshift(t);}Te(ct);}}if(!(0<J)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Vt();Te(lt),0<J||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("");},1),e();},1)):e());}}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ot(),$}})(),Bt=On;var X=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(n){return await Bt({locateFile:()=>n})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async n=>{let r=`https://unpkg.com/${fe.name}@${fe.version}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${n.message}`),console.warn(`Attempting to load WASM from backup URL: ${r}`);try{return await this._tryLoad(r)}catch(c){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${c.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};I(X,"_ModulePromise",null),I(X,"_wasmURL",`https://cdn.jsdelivr.net/npm/${fe.name}@${fe.version}/dist/dotlottie-player.wasm`);var Ae=class{constructor(){I(this,"_eventListeners",new Map);}addEventListener(n,r){let c=this._eventListeners.get(n);c||(c=new Set,this._eventListeners.set(n,c)),c.add(r);}removeEventListener(n,r){let c=this._eventListeners.get(n);c&&(r?(c.delete(r),c.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){this._eventListeners.get(n.type)?.forEach(c=>c(n));}removeAllEventListeners(){this._eventListeners.clear();}};function zn(s){return /^#([\\da-f]{6}|[\\da-f]{8})$/iu.test(s)}function Ut(s){if(!zn(s))return 0;let n=s.replace("#","");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}function Qe(s){if(s.byteLength<4)return !1;let n=new Uint8Array(s.slice(0,xe.byteLength));for(let r=0;r<xe.length;r+=1)if(xe[r]!==n[r])return !1;return !0}function Wt(s){return jt.every(n=>Object.prototype.hasOwnProperty.call(s,n))}function qe(s){if(typeof s=="string")try{return Wt(JSON.parse(s))}catch{return !1}else return Wt(s)}var et=(s,n)=>s==="reverse"?n.Mode.Reverse:s==="bounce"?n.Mode.Bounce:s==="reverse-bounce"?n.Mode.ReverseBounce:n.Mode.Forward,tt=(s,n)=>s==="contain"?n.Fit.Contain:s==="cover"?n.Fit.Cover:s==="fill"?n.Fit.Fill:s==="fit-height"?n.Fit.FitHeight:s==="fit-width"?n.Fit.FitWidth:n.Fit.None,nt=(s,n)=>{let r=new n.VectorFloat;return r.push_back(s[0]),r.push_back(s[1]),r},rt=(s,n)=>{let r=new n.VectorFloat;return s.length!==2||(r.push_back(s[0]),r.push_back(s[1])),r},M=class M{constructor(n){I(this,"_canvas");I(this,"_context",null);I(this,"_eventManager");I(this,"_animationFrameId",null);I(this,"_frameManager");I(this,"_dotLottieCore",null);I(this,"_renderConfig",{});I(this,"_isFrozen",!1);I(this,"_backgroundColor",null);this._canvas=n.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new Ae,this._frameManager=new Ie,this._renderConfig=n.renderConfig??{},X.load().then(r=>{M._wasmModule=r,this._dotLottieCore=new r.DotLottiePlayer({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:et(n.mode??"forward",r),segment:rt(n.segment??[],r),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:nt(n.layout.align,r),fit:tt(n.layout.fit,r)}:r.createDefaultLayout()}),this._eventManager.dispatch({type:"ready"}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),n.backgroundColor&&this.setBackgroundColor(n.backgroundColor);}).catch(r=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${r}`)});});}_dispatchError(n){console.error(n),this._eventManager.dispatch({type:"loadError",error:new Error(n)});}async _fetchData(n){let r=await fetch(n);if(!r.ok)throw new Error(`Failed to fetch animation data from URL: ${n}. ${r.status}: ${r.statusText}`);let c=await r.arrayBuffer();return Qe(c)?c:new TextDecoder().decode(c)}_loadFromData(n){if(this._dotLottieCore===null)return;let r=this._canvas.width,c=this._canvas.height,_=!1;if(typeof n=="string"){if(!qe(n)){this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}_=this._dotLottieCore.loadAnimationData(n,r,c);}else if(n instanceof ArrayBuffer){if(!Qe(n)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}_=this._dotLottieCore.loadDotLottieData(n,r,c);}else if(typeof n=="object"){if(!qe(n)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}_=this._dotLottieCore.loadAnimationData(JSON.stringify(n),r,c);}else {this._dispatchError(`Unsupported data type for animation data. Expected: \n - string (Lottie JSON),\n - ArrayBuffer (dotLottie),\n - object (Lottie JSON). \n Received: ${typeof n}`);return}_?(this._eventManager.dispatch({type:"load"}),te&&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._dispatchError("Failed to load animation data");}_loadFromSrc(n){this._fetchData(n).then(r=>this._loadFromData(r)).catch(r=>this._dispatchError(`Failed to load animation data from URL: ${n}. ${r}`));}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let n=this._dotLottieCore?.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{switch(n.fit){case M._wasmModule?.Fit.Contain:return "contain";case M._wasmModule?.Fit.Cover:return "cover";case M._wasmModule?.Fit.Fill:return "fill";case M._wasmModule?.Fit.FitHeight:return "fit-height";case M._wasmModule?.Fit.FitWidth:return "fit-width";case M._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let n=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!n)return null;let r=JSON.parse(n);return Object.keys(r).length===0?null:r}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let n=this._dotLottieCore?.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let n=this._dotLottieCore?.config().mode;return n===M._wasmModule?.Mode.Reverse?"reverse":n===M._wasmModule?.Mode.Bounce?"bounce":n===M._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 isReady(){return this._dotLottieCore!==null}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}get canvas(){return this._canvas}load(n){this._dotLottieCore===null||M._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:et(n.mode??"forward",M._wasmModule),segment:rt(n.segment??[],M._wasmModule),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:nt(n.layout.align,M._wasmModule),fit:tt(n.layout.fit,M._wasmModule)}:M._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor(n.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let r=this._dotLottieCore.buffer(),c=new Uint8ClampedArray(r,0,this._canvas.width*this._canvas.height*4),_=null;return typeof ImageData>"u"?(_=this._context.createImageData(this._canvas.width,this._canvas.height),_.data.set(c)):_=new ImageData(c,this._canvas.width,this._canvas.height),this._context.putImageData(_,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 n=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(n)&&(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 n=this._dotLottieCore.play();this._isFrozen=!1,n&&(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(n){if(this._dotLottieCore===null||n<0||n>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(n)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:n});}setBackgroundColor(n){this._dotLottieCore!==null&&(te&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:Ut(n)}),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:n});}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:n});}addEventListener(n,r){this._eventManager.addEventListener(n,r);}removeEventListener(n,r){this._eventManager.removeEventListener(n,r);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}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(te&&this._canvas instanceof HTMLCanvasElement){let r=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:c,width:_}=this._canvas.getBoundingClientRect();this._canvas.width=_*r,this._canvas.height=c*r;}this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,r){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:rt([n,r],M._wasmModule)});}setMode(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:et(n,M._wasmModule)});}setRenderConfig(n){this._renderConfig=n;}loadAnimation(n){if(this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===n)return;this._dotLottieCore.loadAnimation(n,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${n}`)});}setMarker(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:n});}markers(){let n=this._dotLottieCore?.markers();if(n){let r=[];for(let c=0;c<n.size();c+=1){let _=n.get(c);r.push({name:_.name,time:_.time,duration:_.duration});}return r}return []}loadTheme(n){if(this._dotLottieCore===null)return !1;let r=this._dotLottieCore.loadTheme(n);return this._render(),r}loadThemeData(n){if(this._dotLottieCore===null)return !1;let r=this._dotLottieCore.loadThemeData(n);return this._render(),r}setLayout(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:nt(n.align,M._wasmModule),fit:tt(n.fit,M._wasmModule)}});}setViewport(n,r,c,_){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(n,r,c,_)}static setWasmUrl(n){X.setWasmUrl(n);}loadStateMachine(n){return this._dotLottieCore?.loadStateMachine(n)??!1}startStateMachine(){let n=this._dotLottieCore?.startStateMachine()??!1;return n&&this._setupStateMachineListeners(),n}stopStateMachine(){let n=this._dotLottieCore?.stopStateMachine()??!1;return n&&this._cleanupStateMachineListeners(),n}_getPointerPosition(n){let r=this._canvas.getBoundingClientRect(),c=this._canvas.width/r.width,_=this._canvas.height/r.height,$=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,U=(n.clientX-r.left)*c/$,V=(n.clientY-r.top)*_/$;return {x:U,y:V}}_onPointerUp(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${r} ${c}`);}_onPointerDown(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${r} ${c}`);}_onPointerMove(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${r} ${c}`);}_onPointerEnter(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${r} ${c}`);}_onPointerLeave(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${r} ${c}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}postStateMachineEvent(n){return this._dotLottieCore?.postEventPayload(n)??!1}getStateMachineListeners(){if(!this._dotLottieCore)return [];let n=this._dotLottieCore.stateMachineFrameworkSetup(),r=[];for(let c=0;c<n.size();c+=1)r.push(n.get(c));return r}_setupStateMachineListeners(){if(te&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let n=this.getStateMachineListeners();n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){te&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}loadStateMachineData(n){return this._dotLottieCore?.loadStateMachineData(n)??!1}animationSize(){let n=this._dotLottieCore?.animationSize().get(0)??0,r=this._dotLottieCore?.animationSize().get(1)??0;return {width:n,height:r}}setStateMachineBooleanContext(n,r){return this._dotLottieCore?.setStateMachineBooleanContext(n,r)??!1}setStateMachineNumericContext(n,r){return this._dotLottieCore?.setStateMachineNumericContext(n,r)??!1}setStateMachineStringContext(n,r){return this._dotLottieCore?.setStateMachineStringContext(n,r)??!1}};I(M,"_wasmModule",null);var me=M;var E=new Map,jn={ready:s=>n=>{let r={id:"",method:"onReady",result:{instanceId:s,event:n}};self.postMessage(r);},complete:s=>n=>{let r={id:"",method:"onComplete",result:{instanceId:s,event:n}};self.postMessage(r);},load:s=>n=>{let c={id:"",method:"onLoad",result:{instanceId:s,event:n}};self.postMessage(c);},loadError:s=>n=>{let c={id:"",method:"onLoadError",result:{instanceId:s,event:n}};self.postMessage(c);},loop:s=>n=>{let c={id:"",method:"onLoop",result:{instanceId:s,event:n}};self.postMessage(c);},play:s=>n=>{let c={id:"",method:"onPlay",result:{instanceId:s,event:n}};self.postMessage(c);},pause:s=>n=>{let c={id:"",method:"onPause",result:{instanceId:s,event:n}};self.postMessage(c);},stop:s=>n=>{let c={id:"",method:"onStop",result:{instanceId:s,event:n}};self.postMessage(c);},frame:s=>n=>{let c={id:"",method:"onFrame",result:{instanceId:s,event:n}};self.postMessage(c);},render:s=>n=>{let c={id:"",method:"onRender",result:{instanceId:s,event:n}};self.postMessage(c);},freeze:s=>n=>{let c={id:"",method:"onFreeze",result:{instanceId:s,event:n}};self.postMessage(c);},unfreeze:s=>n=>{let c={id:"",method:"onUnfreeze",result:{instanceId:s,event:n}};self.postMessage(c);},destroy:s=>n=>{let c={id:"",method:"onDestroy",result:{instanceId:s,event:n}};self.postMessage(c);}},Ht={getDotLottieInstanceState(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return {state:{isLoaded:r.isLoaded,isPaused:r.isPaused,isPlaying:r.isPlaying,isStopped:r.isStopped,isFrozen:r.isFrozen,loop:r.loop,mode:r.mode,speed:r.speed,currentFrame:r.currentFrame,totalFrames:r.totalFrames,duration:r.duration,useFrameInterpolation:r.useFrameInterpolation,renderConfig:r.renderConfig,marker:r.marker,backgroundColor:r.backgroundColor,markers:r.markers(),activeAnimationId:r.activeAnimationId,activeThemeId:r.activeThemeId,autoplay:r.autoplay,segment:r.segment,layout:r.layout,segmentDuration:r.segmentDuration,isReady:r.isReady,manifest:r.manifest}}},setLayout(s){let n=s.params.instanceId,r=s.params.layout,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setLayout(r),{success:!0}},getStateMachineListeners(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.getStateMachineListeners()},postStateMachineEvent(s){let n=s.params.instanceId,r=s.params.event,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.postStateMachineEvent(r)},startStateMachine(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.startStateMachine()},stopStateMachine(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.stopStateMachine()},loadStateMachine(s){let n=s.params.instanceId,r=s.params.stateMachineId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadStateMachine(r)},loadStateMachineData(s){let n=s.params.instanceId,r=s.params.stateMachineData,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadStateMachineData(r)},create:s=>{let n=s.params.instanceId,r=s.params.config,c=s.params.width,_=s.params.height;if(E.has(n))throw new Error(`Instance with id ${n} already exists.`);let $=new me(r);return $.canvas.height=_,$.canvas.width=c,E.set(n,$),["complete","frame","load","loadError","loop","pause","play","stop","destroy","freeze","unfreeze","render","ready"].forEach(V=>{$.addEventListener(V,jn[V](n));}),{instanceId:n}},destroy:s=>{let n=s.params.instanceId,r=E.get(n);r&&(r.destroy(),E.delete(n));},freeze:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.freeze();},load:s=>{let n=s.params.instanceId,r=s.params.config,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.load(r);},loadAnimation:s=>{let n=s.params.instanceId,r=s.params.animationId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.loadAnimation(r);},loadTheme:s=>{let n=s.params.instanceId,r=s.params.themeId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadTheme(r)},loadThemeData:s=>{let n=s.params.instanceId,r=s.params.themeData,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadThemeData(r)},pause:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.pause()},play:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.play()},resize:s=>{let n=s.params.instanceId,r=s.params.width,c=s.params.height,_=E.get(n);if(!_)throw new Error(`Instance with id ${n} does not exist.`);return _.canvas.height=c,_.canvas.width=r,_.resize(),{success:!0}},setBackgroundColor:s=>{let n=s.params.instanceId,r=s.params.backgroundColor,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setBackgroundColor(r);},setFrame:s=>{let n=s.params.instanceId,r=s.params.frame,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setFrame(r);},setMode:s=>{let n=s.params.instanceId,r=s.params.mode,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setMode(r);},setRenderConfig:s=>{let n=s.params.instanceId,r=s.params.renderConfig,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setRenderConfig(r);},setSegment:s=>{let n=s.params.instanceId,r=s.params.segment,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setSegment(r[0],r[1]);},setSpeed:s=>{let n=s.params.instanceId,r=s.params.speed,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setSpeed(r);},setUseFrameInterpolation:s=>{let n=s.params.instanceId,r=s.params.useFrameInterpolation,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setUseFrameInterpolation(r);},setWasmUrl:s=>{me.setWasmUrl(s.params.url);},stop:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.stop();},unfreeze:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.unfreeze();},setViewport(s){let n=s.params.instanceId,r=s.params.x,c=s.params.y,_=s.params.width,$=s.params.height,U=E.get(n);if(!U)throw new Error(`Instance with id ${n} does not exist.`);return U.setViewport(r,c,_,$)},setMarker(s){let n=s.params.instanceId,r=s.params.marker,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setMarker(r),{success:!0}},setLoop(s){let n=s.params.instanceId,r=s.params.loop,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setLoop(r),{success:!0}}};function Bn(s){let n=s.method;if(typeof Ht[n]=="function")return Ht[n](s);throw new Error(`Method ${n} is not implemented in commands.`)}self.onmessage=s=>{try{let n=Bn(s.data),r={id:s.data.id,method:s.data.method,result:n};self.postMessage(r);}catch(n){let r={id:s.data.id,method:s.data.method,error:n.message};self.postMessage(r);}};var Wn="",fr=Wn;\n\nexport { fr as default };\n';var Ae=class{constructor(){w(this,"_workers",new Map);w(this,"_animationWorkerMap",new Map);}_createWorker(n){let a=new Blob([Vt],{type:"application/javascript"});return new Worker(URL.createObjectURL(a),{type:"module",name:n})}getWorker(n){return this._workers.has(n)||this._workers.set(n,this._createWorker(n)),this._workers.get(n)}assignAnimationToWorker(n,a){this._animationWorkerMap.set(n,a);}unassignAnimationFromWorker(n){this._animationWorkerMap.delete(n);}sendMessage(n,a,h){this.getWorker(n).postMessage(a,h||[]);}terminateWorker(n){let a=this._workers.get(n);a&&(a.terminate(),this._workers.delete(n));}};function Yt(f){if(f instanceof OffscreenCanvas)return {width:f.width,height:f.height};let{height:n,width:a}=f.getBoundingClientRect();return {width:a*window.devicePixelRatio,height:n*window.devicePixelRatio}}function Jt(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}var W=class W{constructor(n){w(this,"_eventManager",new re);w(this,"_id");w(this,"_worker");w(this,"_canvas");w(this,"_dotLottieInstanceState",{markers:[],autoplay:!1,backgroundColor:"",currentFrame:0,duration:0,loop:!1,mode:"forward",segment:[0,0],segmentDuration:0,speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:window.devicePixelRatio},activeAnimationId:"",activeThemeId:"",layout:void 0,marker:void 0,isReady:!1,manifest:null});w(this,"_created",!1);this._canvas=n.canvas,this._id=`dotlottie-${Jt()}`;let a=n.workerId||"defaultWorker";this._worker=W._workerManager.getWorker(a),W._workerManager.assignAnimationToWorker(this._id,a),W._wasmUrl&&this._sendMessage("setWasmUrl",{url:W._wasmUrl}),this._create(n),this._worker.addEventListener("message",this._handleWorkerEvent.bind(this));}async _handleWorkerEvent(n){let a=n.data;a.id||(a.method==="onLoad"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onComplete"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onDestroy"&&a.result.instanceId===this._id&&this._eventManager.dispatch(a.result.event),a.method==="onUnfreeze"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(a.result.event)),a.method==="onFrame"&&a.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=a.result.event.currentFrame,this._eventManager.dispatch(a.result.event)),a.method==="onRender"&&a.result.instanceId===this._id&&this._eventManager.dispatch(a.result.event),a.method==="onFreeze"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onPause"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onPlay"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onStop"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onLoadError"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)),a.method==="onReady"&&a.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(a.result.event)));}async _create(n){let a;this._canvas instanceof HTMLCanvasElement?a=this._canvas.transferControlToOffscreen():a=this._canvas;let{instanceId:h}=await this._sendMessage("create",{instanceId:this._id,config:{...n,canvas:a},...Yt(this._canvas)},[a]);if(h!==this._id)throw new Error("Instance ID mismatch");this._created=!0,await this._updateDotLottieInstanceState();}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get segmentDuration(){return this._dotLottieInstanceState.segmentDuration}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage("play",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async pause(){this._created&&(await this._sendMessage("pause",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async stop(){this._created&&(await this._sendMessage("stop",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async setSpeed(n){this._created&&(await this._sendMessage("setSpeed",{instanceId:this._id,speed:n}),await this._updateDotLottieInstanceState());}async setMode(n){this._created&&(await this._sendMessage("setMode",{instanceId:this._id,mode:n}),await this._updateDotLottieInstanceState());}async setFrame(n){this._created&&(await this._sendMessage("setFrame",{frame:n,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setSegment(n,a){this._created&&(await this._sendMessage("setSegment",{instanceId:this._id,segment:[n,a]}),await this._updateDotLottieInstanceState());}async setRenderConfig(n){this._created&&(await this._sendMessage("setRenderConfig",{instanceId:this._id,renderConfig:n}),await this._updateDotLottieInstanceState());}async setUseFrameInterpolation(n){this._created&&(await this._sendMessage("setUseFrameInterpolation",{instanceId:this._id,useFrameInterpolation:n}),await this._updateDotLottieInstanceState());}async loadTheme(n){if(!this._created)return !1;let a=this._sendMessage("loadTheme",{instanceId:this._id,themeId:n});return await this._updateDotLottieInstanceState(),a}async load(n){this._created&&(await this._sendMessage("load",{config:n,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setLoop(n){this._created&&(await this._sendMessage("setLoop",{instanceId:this._id,loop:n}),await this._updateDotLottieInstanceState());}async resize(){if(!this._created)return;let{height:n,width:a}=Yt(this._canvas);this._canvas.width=a,this._canvas.height=n,await this._sendMessage("resize",{height:n,instanceId:this._id,width:a}),await this._updateDotLottieInstanceState();}async destroy(){this._created&&(this._created=!1,await this._sendMessage("destroy",{instanceId:this._id}),this._cleanupStateMachineListeners(),W._workerManager.unassignAnimationFromWorker(this._id),this._eventManager.removeAllEventListeners());}async freeze(){this._created&&(await this._sendMessage("freeze",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async unfreeze(){this._created&&(await this._sendMessage("unfreeze",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async setBackgroundColor(n){this._created&&(await this._sendMessage("setBackgroundColor",{instanceId:this._id,backgroundColor:n}),await this._updateDotLottieInstanceState());}async loadAnimation(n){this._created&&(await this._sendMessage("loadAnimation",{animationId:n,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setLayout(n){this._created&&(await this._sendMessage("setLayout",{instanceId:this._id,layout:n}),await this._updateDotLottieInstanceState());}async _updateDotLottieInstanceState(){if(!this._created)return;let n=await this._sendMessage("getDotLottieInstanceState",{instanceId:this._id});this._dotLottieInstanceState=n.state;}markers(){return this._dotLottieInstanceState.markers}async setMarker(n){this._created&&(await this._sendMessage("setMarker",{instanceId:this._id,marker:n}),await this._updateDotLottieInstanceState());}async loadThemeData(n){if(!this._created)return !1;let a=await this._sendMessage("loadThemeData",{instanceId:this._id,themeData:n});return await this._updateDotLottieInstanceState(),a}async setViewport(n,a,h,C){return this._created?this._sendMessage("setViewport",{x:n,y:a,width:h,height:C,instanceId:this._id}):!1}async _sendMessage(n,a,h){let C={id:`dotlottie-request-${Jt()}`,method:n,params:a};return this._worker.postMessage(C,h||[]),new Promise((j,N)=>{let z=k=>{let Z=k.data;Z.id===C.id&&(this._worker.removeEventListener("message",z),Z.error?N(new Error(`Failed to execute method ${n}: ${Z.error}`)):j(Z.result));};this._worker.addEventListener("message",z);})}addEventListener(n,a){this._eventManager.addEventListener(n,a);}removeEventListener(n,a){this._eventManager.removeEventListener(n,a);}static setWasmUrl(n){W._wasmUrl=n;}async loadStateMachine(n){if(!this._created)return !1;let a=await this._sendMessage("loadStateMachine",{instanceId:this._id,stateMachineId:n});return await this._updateDotLottieInstanceState(),a}async loadStateMachineData(n){if(!this._created)return !1;let a=await this._sendMessage("loadStateMachineData",{instanceId:this._id,stateMachineData:n});return await this._updateDotLottieInstanceState(),a}async startStateMachine(){if(!this._created)return !1;this._setupStateMachineListeners();let n=await this._sendMessage("startStateMachine",{instanceId:this._id});return await this._updateDotLottieInstanceState(),n}async stopStateMachine(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage("stopStateMachine",{instanceId:this._id})):!1}async postStateMachineEvent(n){return this._created?this._sendMessage("postStateMachineEvent",{event:n,instanceId:this._id}):!1}async getStateMachineListeners(){return this._created?this._sendMessage("getStateMachineListeners",{instanceId:this._id}):[]}_getPointerPosition(n){let a=this._canvas.getBoundingClientRect(),h=this._canvas.width/a.width,C=this._canvas.height/a.height,j=this._dotLottieInstanceState.renderConfig.devicePixelRatio||window.devicePixelRatio||1,N=(n.clientX-a.left)*h/j,z=(n.clientY-a.top)*C/j;return {x:N,y:z}}_onPointerUp(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${a} ${h}`);}_onPointerDown(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${a} ${h}`);}_onPointerMove(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${a} ${h}`);}_onPointerEnter(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${a} ${h}`);}_onPointerLeave(n){let{x:a,y:h}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${a} ${h}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}async _setupStateMachineListeners(){if(H&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let n=await this._sendMessage("getStateMachineListeners",{instanceId:this._id});n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){H&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}};w(W,"_workerManager",new Ae),w(W,"_wasmUrl","");var Gt=W;
12
16
 
13
- exports.DotLottie = jt;
14
- exports.DotLottieWorker = Ht;
17
+ exports.DotLottie = Nt;
18
+ exports.DotLottieWorker = Gt;
15
19
  //# sourceMappingURL=out.js.map
16
20
  //# sourceMappingURL=index.cjs.map