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