@thorvg/lottie-player 1.0.1 → 1.0.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/gl/lottie-player.cjs.js +2 -2
- package/dist/gl/lottie-player.esm.js +2 -2
- package/dist/gl/lottie-player.js +2 -2
- package/dist/gl/thorvg.wasm +0 -0
- package/dist/gl-lite/lottie-player.cjs.js +2 -2
- package/dist/gl-lite/lottie-player.esm.js +2 -2
- package/dist/gl-lite/lottie-player.js +2 -2
- package/dist/gl-lite/thorvg.wasm +0 -0
- package/dist/lottie-player.cjs.js +2 -2
- package/dist/lottie-player.esm.js +2 -2
- package/dist/lottie-player.js +2 -2
- package/dist/sw/lottie-player.cjs.js +1 -1
- package/dist/sw/lottie-player.esm.js +1 -1
- package/dist/sw/lottie-player.js +1 -1
- package/dist/sw/thorvg.wasm +0 -0
- package/dist/sw-lite/lottie-player.cjs.js +1 -1
- package/dist/sw-lite/lottie-player.esm.js +1 -1
- package/dist/sw-lite/lottie-player.js +1 -1
- package/dist/sw-lite/thorvg.wasm +0 -0
- package/dist/thorvg.wasm +0 -0
- package/dist/wg/lottie-player.cjs.js +1 -1
- package/dist/wg/lottie-player.esm.js +1 -1
- package/dist/wg/lottie-player.js +1 -1
- package/dist/wg/thorvg.wasm +0 -0
- package/dist/wg-lite/lottie-player.cjs.js +1 -1
- package/dist/wg-lite/lottie-player.esm.js +1 -1
- package/dist/wg-lite/lottie-player.js +1 -1
- package/dist/wg-lite/thorvg.wasm +0 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let i=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const r=this.t;if(e&&void 0===t){const e=void 0!==r&&1===r.length;e&&(t=n.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(r,t))}return t}toString(){return this.cssText}};const a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new i("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:s,defineProperty:o,getOwnPropertyDescriptor:h,getOwnPropertyNames:l,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,d=globalThis,f=d.trustedTypes,p=f?f.emptyScript:"",w=d.reactiveElementPolyfillSupport,m=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},y=(t,e)=>!s(t,e),g={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&o(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:i}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const a=n?.call(this);i?.call(this,e),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??g}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...l(t),...c(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(e)r.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),i=t.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const i=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(e,r.type);this._$Em=t,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const a=i.fromAttribute(e,t.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,i=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??y)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:i},a){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??e??this[t]),!0!==i||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[m("elementProperties")]=new Map,b[m("finalized")]=new Map,w?.({ReactiveElement:b}),(d.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_=(t=$,e,r)=>{const{kind:n,metadata:i}=r;let a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),a.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const i=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,i,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];e.call(this,r),this.requestUpdate(n,i,t)}}throw Error("Unsupported decorator location: "+n)};function A(t){return(e,r)=>"object"==typeof r?_(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const S=globalThis,E=S.trustedTypes,k=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+L,P=`<${O}>`,R=document,M=()=>R.createComment(""),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,U="[ \t\n\f\r]",x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,F=/>/g,V=RegExp(`>|${U}(?:([^\\s"'>=/]+)(${U}*=${U}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,z=/"/g,H=/^(?:script|style|textarea|title)$/i,W=(t,...e)=>({_$litType$:1,strings:t,values:e}),I=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),G=new WeakMap,q=R.createTreeWalker(R,129);function X(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}const Z=(t,e)=>{const r=t.length-1,n=[];let i,a=2===e?"<svg>":3===e?"<math>":"",s=x;for(let e=0;e<r;e++){const r=t[e];let o,h,l=-1,c=0;for(;c<r.length&&(s.lastIndex=c,h=s.exec(r),null!==h);)c=s.lastIndex,s===x?"!--"===h[1]?s=j:void 0!==h[1]?s=F:void 0!==h[2]?(H.test(h[2])&&(i=RegExp("</"+h[2],"g")),s=V):void 0!==h[3]&&(s=V):s===V?">"===h[0]?(s=i??x,l=-1):void 0===h[1]?l=-2:(l=s.lastIndex-h[2].length,o=h[1],s=void 0===h[3]?V:'"'===h[3]?z:D):s===z||s===D?s=V:s===j||s===F?s=x:(s=V,i=void 0);const u=s===V&&t[e+1].startsWith("/>")?" ":"";a+=s===x?r+P:l>=0?(n.push(o),r.slice(0,l)+T+r.slice(l)+L+u):r+L+(-2===l?e:u)}return[X(t,a+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Y{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let i=0,a=0;const s=t.length-1,o=this.parts,[h,l]=Z(t,e);if(this.el=Y.createElement(h,r),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=q.nextNode())&&o.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(T)){const e=l[a++],r=n.getAttribute(t).split(L),s=/([.?@])?(.*)/.exec(e);o.push({type:1,index:i,name:s[2],strings:r,ctor:"."===s[1]?et:"?"===s[1]?rt:"@"===s[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(L)&&(o.push({type:6,index:i}),n.removeAttribute(t));if(H.test(n.tagName)){const t=n.textContent.split(L),e=t.length-1;if(e>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],M()),q.nextNode(),o.push({type:2,index:++i});n.append(t[e],M())}}}else if(8===n.nodeType)if(n.data===O)o.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(L,t+1));)o.push({type:7,index:i}),t+=L.length-1}i++}}static createElement(t,e){const r=R.createElement("template");return r.innerHTML=t,r}}function J(t,e,r=t,n){if(e===I)return e;let i=void 0!==n?r._$Co?.[n]:r._$Cl;const a=C(e)?void 0:e._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(t),i._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(e=J(t,i._$AS(t,e.values),i,n)),e}class K{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??R).importNode(e,!0);q.currentNode=n;let i=q.nextNode(),a=0,s=0,o=r[0];for(;void 0!==o;){if(a===o.index){let e;2===o.type?e=new Q(i,i.nextSibling,this,t):1===o.type?e=new o.ctor(i,o.name,o.strings,this,t):6===o.type&&(e=new it(i,this,t)),this._$AV.push(e),o=r[++s]}a!==o?.index&&(i=q.nextNode(),a++)}return q.currentNode=R,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),C(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(R.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Y.createElement(X(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new K(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new Y(t)),e}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const i of t)n===e.length?e.push(r=new Q(this.O(M()),this.O(M()),this,this.options)):r=e[n],r._$AI(i),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,i){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=B}_$AI(t,e=this,r,n){const i=this.strings;let a=!1;if(void 0===i)t=J(this,t,e,0),a=!C(t)||t!==this._$AH&&t!==I,a&&(this._$AH=t);else{const n=t;let s,o;for(t=i[0],s=0;s<i.length-1;s++)o=J(this,n[r+s],e,s),o===I&&(o=this._$AH[s]),a||=!C(o)||o!==this._$AH[s],o===B?t=B:t!==B&&(t+=(o??"")+i[s+1]),this._$AH[s]=o}a&&!n&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class nt extends tt{constructor(t,e,r,n,i){super(t,e,r,n,i),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??B)===I)return;const r=this._$AH,n=t===B&&r!==B||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==B&&(r===B||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class it{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const at=S.litHtmlPolyfillSupport;at?.(Y,Q),(S.litHtmlVersions??=[]).push("3.3.1");const st=globalThis;class ot extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=r?.renderBefore??null;n._$litPart$=i=new Q(e.insertBefore(M(),t),t,void 0,r??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}}ot._$litElement$=!0,ot.finalized=!0,st.litElementHydrateSupport?.({LitElement:ot});const ht=st.litElementPolyfillSupport;function lt(t,e,r,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(i=t[o])&&(s=(a<3?i(s):a>3?i(e,r,s):i(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s}ht?.({LitElement:ot}),(st.litElementVersions??=[]).push("4.2.1");let ct=null,ut=!1;var dt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const ft=t=>new Promise(e=>setTimeout(e,t));let pt="idle";class wt extends ot{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ut)for(;!ct;)await ft(100);if(ct||(ut=!0,ct=await async function(t={}){var e,r=t,n=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,a=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(a){const{createRequire:t}=await Promise.resolve().then(function(){return yt});var s=t(import.meta.url)}var o,h,l=(t,e)=>{throw e},c=import.meta.url,u="";if(a){var d=s("fs");c.startsWith("file:")&&(u=s("path").dirname(s("url").fileURLToPath(c))+"/"),h=t=>(t=R(t)?new URL(t):t,d.readFileSync(t)),o=async t=>(t=R(t)?new URL(t):t,d.readFileSync(t,void 0)),process.argv.slice(2),l=(t,e)=>{throw process.exitCode=t,e}}else if(n||i){try{u=new URL(".",c).href}catch{}i&&(h=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=async t=>{if(R(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var f,p,w,m,v,y,g,b,$,_,A,S,E,k,T,L=function(){}.bind(),O=function(){}.bind(),P=!1,R=t=>t.startsWith("file://"),M=!1;function C(){var t=Je.buffer;v=new Int8Array(t),g=new Int16Array(t),y=new Uint8Array(t),b=new Uint16Array(t),$=new Int32Array(t),_=new Uint32Array(t),A=new Float32Array(t),S=new Float64Array(t),E=new BigInt64Array(t),k=new BigUint64Array(t)}function N(t){throw r.onAbort?.(t),O(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),m?.(t),t}class U{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var x=t=>{for(;0<t.length;)t.shift()(r)},j=[],F=[],V=()=>{var t=r.preRun.shift();F.push(t)},D=!0,z=t=>{for(var e="";;){var r=y[t++];if(!r)return e;e+=String.fromCharCode(r)}},H={},W={},I={},B=class extends Error{constructor(t){super(t),this.name="BindingError"}},G=t=>{throw new B(t)};function q(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new B(`type "${n}" must have a positive integer typeid pointer`);if(W.hasOwnProperty(t)){if(r.vb)return;throw new B(`Cannot register type '${n}' twice`)}W[t]=e,delete I[t],H.hasOwnProperty(t)&&(e=H[t],delete H[t],e.forEach(t=>t()))}(t,e,r)}var X=(t,e,r)=>{switch(e){case 1:return r?t=>v[t]:t=>y[t];case 2:return r?t=>g[t>>1]:t=>b[t>>1];case 4:return r?t=>$[t>>2]:t=>_[t>>2];case 8:return r?t=>E[t>>3]:t=>k[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Z=t=>{throw new B(t.M.U.R.name+" instance already deleted")},Y=!1,J=()=>{},K=t=>globalThis.FinalizationRegistry?(Y=new FinalizationRegistry(t=>{--(t=t.M).count.value,0===t.count.value&&(t.X?t.aa.oa(t.X):t.U.R.oa(t.S))}),K=t=>{var e=t.M;return e.X&&Y.register(t,{M:e},t),t},J=t=>{Y.unregister(t)},K(t)):(K=t=>t,t);function Q(){}var tt=(t,e)=>Object.defineProperty(e,"name",{value:t}),et={},rt=(t,e,r)=>{if(void 0===t[e].W){var n=t[e];t[e]=function(...n){if(!t[e].W.hasOwnProperty(n.length))throw new B(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].W})!`);return t[e].W[n.length].apply(this,n)},t[e].W=[],t[e].W[n.wa]=n}},nt=(t,e,n)=>{if(r.hasOwnProperty(t)){if(void 0===n||void 0!==r[t].W&&void 0!==r[t].W[n])throw new B(`Cannot register public name '${t}' twice`);if(rt(r,t,t),r[t].W.hasOwnProperty(n))throw new B(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].W[n]=e}else r[t]=e,r[t].wa=n};function it(t,e,r,n,i,a,s,o){this.name=t,this.constructor=e,this.ta=r,this.oa=n,this.Z=i,this.rb=a,this.Ba=s,this.ob=o,this.Bb=[]}var at=(t,e,r)=>{for(;e!==r;){if(!e.Ba)throw new B(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Ba(t),e=e.Z}return t},st=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ot(t,e){if(null===e){if(this.La)throw new B(`null is not a valid ${this.name}`);return 0}if(!e.M)throw new B(`Cannot pass "${st(e)}" as a ${this.name}`);if(!e.M.S)throw new B(`Cannot pass deleted object as a pointer of type ${this.name}`);return at(e.M.S,e.M.U.R,this.R)}function ht(t,e){if(null===e){if(this.La)throw new B(`null is not a valid ${this.name}`);if(this.Ea){var r=this.Cb();return null!==t&&t.push(this.oa,r),r}return 0}if(!e||!e.M)throw new B(`Cannot pass "${st(e)}" as a ${this.name}`);if(!e.M.S)throw new B(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Da&&e.M.U.Da)throw new B(`Cannot convert argument of type ${e.M.aa?e.M.aa.name:e.M.U.name} to parameter type ${this.name}`);if(r=at(e.M.S,e.M.U.R,this.R),this.Ea){if(void 0===e.M.X)throw new B("Passing raw pointer to smart pointer is illegal");switch(this.Eb){case 0:if(e.M.aa!==this)throw new B(`Cannot convert argument of type ${e.M.aa?e.M.aa.name:e.M.U.name} to parameter type ${this.name}`);r=e.M.X;break;case 1:r=e.M.X;break;case 2:if(e.M.aa===this)r=e.M.X;else{var n=e.clone();r=this.Db(r,Mt(()=>n.delete())),null!==t&&t.push(this.oa,r)}break;default:throw new B("Unsupporting sharing policy")}}return r}function lt(t,e){if(null===e){if(this.La)throw new B(`null is not a valid ${this.name}`);return 0}if(!e.M)throw new B(`Cannot pass "${st(e)}" as a ${this.name}`);if(!e.M.S)throw new B(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.M.U.Da)throw new B(`Cannot convert argument of type ${e.M.U.name} to parameter type ${this.name}`);return at(e.M.S,e.M.U.R,this.R)}function ct(t){return this.Y(_[t>>2])}var ut=(t,e,r)=>e===r?t:void 0===r.Z||null===(t=ut(t,e,r.Z))?null:r.ob(t),dt={},ft=class extends Error{constructor(t){super(t),this.name="InternalError"}},pt=(t,e)=>{if(!e.U||!e.S)throw new ft("makeClassHandle requires ptr and ptrType");if(!!e.aa!=!!e.X)throw new ft("Both smartPtrType and smartPtr must be specified");return e.count={value:1},K(Object.create(t,{M:{value:e,writable:!0}}))};function wt(t,e,r,n,i,a,s,o,h,l,c){this.name=t,this.R=e,this.La=r,this.Da=n,this.Ea=i,this.Ab=a,this.Eb=s,this.eb=o,this.Cb=h,this.Db=l,this.oa=c,i||void 0!==e.Z?this.ba=ht:(this.ba=n?ot:lt,this.da=null)}var mt=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new ft("Replacing nonexistent public symbol");void 0!==r[t].W&&void 0!==n?r[t].W[n]=e:(r[t]=e,r[t].wa=n)},vt=(t,e)=>{t=z(t);var r=Ke.get(e);if("function"!=typeof r)throw new B(`unknown function pointer with signature ${t}: ${e}`);return r};class gt extends Error{}var bt=t=>{t=Ze(t);var e=z(t);return qe(t),e},$t=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||W[e]||(I[e]?I[e].forEach(t):(r.push(e),n[e]=!0))}),new gt(`${t}: `+r.map(bt).join([", "]))},_t=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new ft("Mismatched type converter count");for(var n=0;n<t.length;++n)q(t[n],e[n])}t.forEach(t=>I[t]=e);var i=Array(e.length),a=[],s=0;for(let[t,r]of e.entries())W.hasOwnProperty(r)?i[t]=W[r]:(a.push(r),H.hasOwnProperty(r)||(H[r]=[]),H[r].push(()=>{i[t]=W[r],++s===a.length&&n(i)}));0===a.length&&n(i)},At=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+4*n>>2]);return r},St=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function Et(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].da)return!0;return!1}function kt(t,e,r,n,i,a){var s=e.length;if(2>s)throw new B("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==e[1]&&null!==r,h=Et(e);r=!e[0].bb;var l=e[0],c=e[1];for(n=[t,G,n,i,St,l.Y.bind(l),c?.ba.bind(c)],i=2;i<s;++i)n.push((l=e[i]).ba.bind(l));if(!h)for(i=o?1:2;i<e.length;++i)null!==e[i].da&&n.push(e[i].da);for(h=Et(e),i=e.length-2,c=[],l=["fn"],o&&l.push("thisWired"),s=0;s<i;++s)c.push(`arg${s}`),l.push(`arg${s}Wired`);c=c.join(","),l=l.join(","),c=`return function (${c}) {\n`,h&&(c+="var destructors = [];\n");var u=h?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(o&&(c+=`var thisWired = toClassParamWire(${u}, this);\n`),s=0;s<i;++s){var f=`toArg${s}Wire`;c+=`var arg${s}Wired = ${f}(${u}, arg${s});\n`,d.push(f)}if(c+=(r||a?"var rv = ":"")+`invoker(${l});\n`,h)c+="runDestructors(destructors);\n";else for(s=o?1:2;s<e.length;++s)a=1===s?"thisWired":"arg"+(s-2)+"Wired",null!==e[s].da&&(c+=`${a}_dtor(${a});\n`,d.push(`${a}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,c+"}\n")(...n),tt(t,e)}var Tt=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},Lt=[],Ot=[0,1,,1,null,1,!0,1,!1,1],Pt=t=>{9<t&&0===--Ot[t+1]&&(Ot[t]=void 0,Lt.push(t))},Rt=t=>{if(!t)throw new B(`Cannot use deleted val. handle = ${t}`);return Ot[t]},Mt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=Lt.pop()||Ot.length;return Ot[e]=t,Ot[e+1]=1,e}},Ct={name:"emscripten::val",Y:t=>{var e=Rt(t);return Pt(t),e},ba:(t,e)=>Mt(e),ma:ct,da:null},Nt=(t,e)=>{switch(e){case 4:return function(t){return this.Y(A[t>>2])};case 8:return function(t){return this.Y(S[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Ut=(t,e,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var a=0;a<t.length;++a){var s=t.codePointAt(a);if(127>=s){if(r>=n)break;e[r++]=s}else if(2047>=s){if(r+1>=n)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(65535>=s){if(r+2>=n)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=n)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s,a++}}return e[r]=0,r-i},xt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},jt=new TextDecoder,Ft=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},Vt=new TextDecoder("utf-16le"),Dt=(t,e,r)=>Vt.decode(b.subarray(t>>=1,Ft(b,t,e/2,r))),zt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var i=0;i<r;++i)g[e>>1]=t.charCodeAt(i),e+=2;return g[e>>1]=0,e-n},Ht=t=>2*t.length,Wt=(t,e,r)=>{var n="";t>>=2;for(var i=0;!(i>=e/4);i++){var a=_[t+i];if(!a&&!r)break;n+=String.fromCodePoint(a)}return n},It=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var i=0;i<t.length;++i){var a=t.codePointAt(i);if(65535<a&&i++,$[e>>2]=a,(e+=4)+4>r)break}return $[e>>2]=0,e-n},Bt=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},Gt=0,qt=[],Xt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(_[e>>2]=Mt(n)),t},Zt={},Yt=t=>{var e=Zt[t];return void 0===e?z(t):e},Jt={},Kt=t=>{p=t,D||0<Gt||(r.onExit?.(t),P=!0),l(t,new U(t))},Qt=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},te=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=Qt(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},ee=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},re=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],ne=t=>{(ne=(()=>{if(a){var t=s("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},ie=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:Ge.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=Qt(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},ae=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=ie(t).slice(1),e=ie(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,a=0;a<n;a++)if(t[a]!==e[a]){i=a;break}for(n=[],a=i;a<t.length;a++)n.push("..");return(n=n.concat(e.slice(i))).join("/")},se=t=>{var e=Ft(t,0);return jt.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},oe=[],he=t=>{var e=Array(xt(t)+1);return t=Ut(t,e,0,e.length),e.length=t,e},le=[];function ce(t,e){le[t]={input:[],output:[],va:e},Ae(t,ue)}var ue={open(t){var e=le[t.node.rdev];if(!e)throw new Ge.L(43);t.tty=e,t.seekable=!1},close(t){t.tty.va.fsync(t.tty)},fsync(t){t.tty.va.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.va.Za)throw new Ge.L(60);for(var i=0,a=0;a<n;a++){try{var s=t.tty.va.Za(t.tty)}catch(t){throw new Ge.L(29)}if(void 0===s&&0===i)throw new Ge.L(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.atime=Date.now()),i},write(t,e,r,n){if(!t.tty||!t.tty.va.Pa)throw new Ge.L(60);try{for(var i=0;i<n;i++)t.tty.va.Pa(t.tty,e[r+i])}catch(t){throw new Ge.L(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),i}},de={Za(){t:{if(!oe.length){var t=null;if(a){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=d.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}oe=he(t)}t=oe.shift()}return t},Pa(t,e){null===e||10===e?(L(se(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(L(se(t.output)),t.output=[])},Zb:()=>({Mb:25856,Ob:5,Lb:191,Nb:35387,Kb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),$b:()=>0,ac:()=>[24,80]},fe={Pa(t,e){null===e||10===e?(O(se(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(O(se(t.output)),t.output=[])}},pe={ia:null,T:()=>pe.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||Ge.isFIFO(r))throw new Ge.L(63);return pe.ia||(pe.ia={dir:{node:{fa:pe.N.fa,ha:pe.N.ha,lookup:pe.N.lookup,ka:pe.N.ka,rename:pe.N.rename,unlink:pe.N.unlink,rmdir:pe.N.rmdir,readdir:pe.N.readdir,symlink:pe.N.symlink},stream:{$:pe.O.$}},file:{node:{fa:pe.N.fa,ha:pe.N.ha},stream:{$:pe.O.$,read:pe.O.read,write:pe.O.write,ua:pe.O.ua,za:pe.O.za}},link:{node:{fa:pe.N.fa,ha:pe.N.ha,readlink:pe.N.readlink},stream:{}},Ua:{node:{fa:pe.N.fa,ha:pe.N.ha},stream:Ge.mb}}),Se((r=Ge.createNode(t,e,r,n)).mode)?(r.N=pe.ia.dir.node,r.O=pe.ia.dir.stream,r.P={}):Ge.isFile(r.mode)?(r.N=pe.ia.file.node,r.O=pe.ia.file.stream,r.V=0,r.P=null):40960==(61440&r.mode)?(r.N=pe.ia.link.node,r.O=pe.ia.link.stream):8192==(61440&r.mode)&&(r.N=pe.ia.Ua.node,r.O=pe.ia.Ua.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.P[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},Yb:t=>t.P?t.P.subarray?t.P.subarray(0,t.V):new Uint8Array(t.P):new Uint8Array(0),N:{fa(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=Se(t.mode)?4096:Ge.isFile(t.mode)?t.V:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},ha(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.V!=(e=e.size)&&(0==e?(t.P=null,t.V=0):(r=t.P,t.P=new Uint8Array(e),r&&t.P.set(r.subarray(0,Math.min(e,t.V))),t.V=e))},lookup(){throw pe.Ia||(pe.Ia=new Ge.L(44),pe.Ia.stack="<generic error, no stack>"),pe.Ia},ka:(t,e,r,n)=>pe.createNode(t,e,r,n),rename(t,e,r){try{var n=Ee(e,r)}catch(t){}if(n){if(Se(t.mode))for(var i in n.P)throw new Ge.L(55);ke(n)}delete t.parent.P[t.name],e.P[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.P[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=Ee(t,e);for(r in n.P)throw new Ge.L(55);delete t.P[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.P)],symlink:(t,e,r)=>((t=pe.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new Ge.L(28);return t.link}},O:{read(t,e,r,n,i){var a=t.node.P;if(i>=t.node.V)return 0;if(8<(t=Math.min(t.node.V-i,n))&&a.subarray)e.set(a.subarray(i,i+t),r);else for(n=0;n<t;n++)e[r+n]=a[i+n];return t},write(t,e,r,n,i,a){if(e.buffer===v.buffer&&(a=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.P||t.P.subarray)){if(a)return t.P=e.subarray(r,r+n),t.V=n;if(0===t.V&&0===i)return t.P=e.slice(r,r+n),t.V=n;if(i+n<=t.V)return t.P.set(e.subarray(r,r+n),i),n}var s=t.P?t.P.length:0;if(s>=(a=i+n)||(a=Math.max(a,s*(1048576>s?2:1.125)>>>0),0!=s&&(a=Math.max(a,256)),s=t.P,t.P=new Uint8Array(a),0<t.V&&t.P.set(s.subarray(0,t.V),0)),t.P.subarray&&e.subarray)t.P.set(e.subarray(r,r+n),i);else for(a=0;a<n;a++)t.P[i+a]=e[r+a];return t.V=Math.max(t.V,i+n),n},$(t,e,r){if(1===r?e+=t.position:2===r&&Ge.isFile(t.node.mode)&&(e+=t.node.V),0>e)throw new Ge.L(28);return e},ua(t,e,r,n,i){if(!Ge.isFile(t.node.mode))throw new Ge.L(43);if(t=t.node.P,2&i||!t||t.buffer!==v.buffer){if(n=!0,N(),!(i=void 0))throw new Ge.L(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),v.set(t,i))}else n=!1,i=t.byteOffset;return{S:i,Gb:n}},za:(t,e,r,n)=>(pe.O.write(t,e,0,n,r,!1),0)}},we=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},me=0,ve=null,ye=()=>{if(me--,r.monitorRunDependencies?.(me),0==me&&ve){var t=ve;ve=null,t()}},ge=()=>{me++,r.monitorRunDependencies?.(me)},be=[],$e=async(t,e,r,n,i,a,s,h)=>{var l=e?ie(te(t+"/"+e)):t;ge();try{var c=r;"string"==typeof r&&(c=await(async t=>(t=await o(t),new Uint8Array(t)))(r)),c=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&_e(),be))if(r.canHandle(e))return r.handle(t,e);return t})(c,l),h?.(),a||Te(t,e,c,n,i,s)}finally{ye()}};function _e(){var t,e,n;Ge.Ka=!0,t??=r.stdin,e??=r.stdout,n??=r.stderr,t?Ge.na("/dev","stdin",t):Ge.symlink("/dev/tty","/dev/stdin"),e?Ge.na("/dev","stdout",null,e):Ge.symlink("/dev/tty","/dev/stdout"),n?Ge.na("/dev","stderr",null,n):Ge.symlink("/dev/tty1","/dev/stderr"),Ge.open("/dev/stdin",0),Ge.open("/dev/stdout",1),Ge.open("/dev/stderr",1)}function Ae(t,e){Ge.Xa[t]={O:e}}function Se(t){return 16384==(61440&t)}function Ee(t,e){var r=Se(t.mode)?(r=Ce(t,"x"))?r:t.N.lookup?0:2:54;if(r)throw new Ge.L(r);for(r=Ge.la[Pe(t.id,e)];r;r=r.sa)if(r.parent.id===t.id&&r.name===e)return r;return Ge.lookup(t,e)}function ke(t){var e=Pe(t.parent.id,t.name);if(Ge.la[e]===t)Ge.la[e]=t.sa;else for(e=Ge.la[e];e;){if(e.sa===t){e.sa=t.sa;break}e=e.sa}}function Te(t,e,r,n,i,a){var s=e;if(t&&(t="string"==typeof t?t:Oe(t),s=e?te(t+"/"+e):t),t=we(n,i),s=Ge.create(s,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,i=r.length;n<i;++n)e[n]=r.charCodeAt(n);r=e}Ge.chmod(s,146|t),e=Ge.open(s,577),Ge.write(e,r,0,r.length,0,a),Ge.close(e),Ge.chmod(s,t)}}function Le(t,e={}){if(!t)throw new Ge.L(44);e.Ca??(e.Ca=!0),"/"===t.charAt(0)||(t=Ge.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=Ge.root,i="/",a=0;a<t.length;a++){var s=a===t.length-1;if(s&&e.parent)break;if("."!==t[a])if(".."===t[a]){if(i=ee(i),Ge.Ma(n)){t=i+"/"+t.slice(a+1).join("/"),r--;continue t}n=n.parent}else{i=te(i+"/"+t[a]);try{n=Ee(n,t[a])}catch(t){if(44===t?.qa&&s&&e.yb)return{path:i};throw t}if(!n.ga||s&&!e.Ca||(n=n.ga.root),40960==(61440&n.mode)&&(!s||e.ea)){if(!n.N.readlink)throw new Ge.L(52);"/"===(n=n.N.readlink(n)).charAt(0)||(n=ee(i)+"/"+n),t=n+"/"+t.slice(a+1).join("/");continue t}}}return{path:i,node:n}}throw new Ge.L(32)}function Oe(t){for(var e;;){if(Ge.Ma(t))return t=t.T.cb,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function Pe(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%Ge.la.length}function Re(t){var e=Pe(t.parent.id,t.name);t.sa=Ge.la[e],Ge.la[e]=t}function Me(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function Ce(t,e){return Ge.$a?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function Ne(t,e){if(!Se(t.mode))return 54;try{return Ee(t,e),20}catch(t){}return Ce(t,"wx")}function Ue(t,e,r){try{var n=Ee(t,e)}catch(t){return t.qa}if(t=Ce(t,"wx"))return t;if(r){if(!Se(n.mode))return 54;if(Ge.Ma(n)||Oe(n)===Ge.cwd())return 10}else if(Se(n.mode))return 31;return 0}function xe(t,e){if(!t)throw new Ge.L(e);return t}function je(t){if(!(t=Ge.ub(t)))throw new Ge.L(8);return t}function Fe(t,e=-1){if(t=Object.assign(new Ge.jb,t),-1==e)t:{for(e=0;e<=Ge.kb;e++)if(!Ge.streams[e])break t;throw new Ge.L(33)}return t.fd=e,Ge.streams[e]=t}function Ve(t,e,r){var n=t?.O.ha;t=n?t:e,n??=e.N.ha,xe(n,63),n(t,r)}function De(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.ya)}return e}function ze(t){var e={Jb:4096,Vb:4096,blocks:1e6,Ib:5e5,Hb:5e5,files:Ge.Oa,Tb:Ge.Oa-1,Wb:42,flags:2,dc:255};return t.N.gb&&Object.assign(e,t.N.gb(t.T.zb.root)),e}function He(t,e,r){return void 0===r&&(r=e,e=438),Ge.ka(t,8192|e,r)}function We(t,e,r,n){Ve(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),Ya:n})}function Ie(t,e,r){if(Se(e.mode))throw new Ge.L(31);if(!Ge.isFile(e.mode))throw new Ge.L(28);var n=Ce(e,"w");if(n)throw new Ge.L(n);Ve(t,e,{size:r,timestamp:Date.now()})}function Be(t){if(!(t.wb||t.xb||t.link||t.P))if(globalThis.XMLHttpRequest)N("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{t.P=h(t.url)}catch(t){throw new Ge.L(29)}}var Ge={root:null,ya:[],Xa:{},streams:[],Oa:1,la:null,Va:"/",Ka:!1,$a:!0,qb:null,Fa:0,fb:{},L:class{name="ErrnoError";constructor(t){this.qa=t}},jb:class{ja={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.ja.flags}set flags(t){this.ja.flags=t}get position(){return this.ja.position}set position(t){this.ja.position=t}},ib:class{N={};O={};ga=null;constructor(t,e,r,n){t||=this,this.parent=t,this.T=t.T,this.id=Ge.Oa++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get xb(){return Se(this.mode)}get wb(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>(Re(t=new Ge.ib(t,e,r,n)),t),Ma:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),kb:4096,ub:t=>Ge.streams[t],Sb:(t,e=-1)=>(t=Fe(t,e),t.O?.Rb?.(t),t),mb:{open(t){t.O=Ge.sb(t.node.rdev).O,t.O.open?.(t)},$(){throw new Ge.L(70)}},Na:t=>t>>8,bc:t=>255&t,ra:(t,e)=>t<<8|e,sb:t=>Ge.Xa[t],hb(t,e){function r(t){return Ge.Fa--,e(t)}function n(t){if(t){if(!n.pb)return n.pb=!0,r(t)}else++s>=a.length&&r(null)}"function"==typeof t&&(e=t,t=!1),Ge.Fa++,1<Ge.Fa&&O(`warning: ${Ge.Fa} FS.syncfs operations in flight at once, probably just doing extra work`);var i,a=De(Ge.root.T),s=0;for(i of a)i.type.hb?i.type.hb(i,t,n):n(null)},T(t,e,r){var n="/"===r;if(n&&Ge.root)throw new Ge.L(10);if(!n&&r){var i=Le(r,{Ca:!1});if(r=i.path,(i=i.node).ga)throw new Ge.L(10);if(!Se(i.mode))throw new Ge.L(54)}return(t=t.T(e={type:t,zb:e,cb:r,ya:[]})).T=e,e.root=t,n?Ge.root=t:i&&(i.ga=e,i.T&&i.T.ya.push(e)),t},jc(t){if(!(t=Le(t,{Ca:!1})).node.ga)throw new Ge.L(28);var e=(t=t.node).ga,r=De(e);for([,i]of Object.entries(Ge.la))for(;i;){var n=i.sa;r.includes(i.T)&&ke(i);var i=n}t.ga=null,t.T.ya.splice(t.T.ya.indexOf(e),1)},lookup:(t,e)=>t.N.lookup(t,e),ka(t,e,r){var n=Le(t,{parent:!0}).node;if(!(t=re(t)))throw new Ge.L(28);if("."===t||".."===t)throw new Ge.L(20);var i=Ne(n,t);if(i)throw new Ge.L(i);if(!n.N.ka)throw new Ge.L(63);return n.N.ka(n,t,e,r)},gb:t=>ze(Le(t,{ea:!0}).node),hc:t=>ze(t.node),create:(t,e=438)=>Ge.ka(t,4095&e|32768,0),mkdir:(t,e=511)=>Ge.ka(t,1023&e|16384,0),cc(t,e){var r,n=t.split("/"),i="";for(r of n)if(r){(i||"/"===t.charAt(0))&&(i+="/"),i+=r;try{Ge.mkdir(i,e)}catch(t){if(20!=t.qa)throw t}}},symlink(t,e){if(!ie(t))throw new Ge.L(44);var r=Le(e,{parent:!0}).node;if(!r)throw new Ge.L(44);var n=Ne(r,e=re(e));if(n)throw new Ge.L(n);if(!r.N.symlink)throw new Ge.L(63);return r.N.symlink(r,e,t)},rename(t,e){var r=ee(t),n=ee(e),i=re(t),a=re(e),s=Le(t,{parent:!0}),o=s.node;if(s=(s=Le(e,{parent:!0})).node,!o||!s)throw new Ge.L(44);if(o.T!==s.T)throw new Ge.L(75);var h=Ee(o,i);if("."!==(t=ae(t,n)).charAt(0))throw new Ge.L(28);if("."!==(t=ae(e,r)).charAt(0))throw new Ge.L(55);try{var l=Ee(s,a)}catch(t){}if(h!==l){if(i=Ue(o,i,e=Se(h.mode)))throw new Ge.L(i);if(i=l?Ue(s,a,e):Ne(s,a))throw new Ge.L(i);if(!o.N.rename)throw new Ge.L(63);if(h.ga||l&&l.ga)throw new Ge.L(10);if(s!==o&&(i=Ce(o,"w")))throw new Ge.L(i);ke(h);try{o.N.rename(h,s,a),h.parent=s}catch(t){throw t}finally{Re(h)}}},rmdir(t){var e=Le(t,{parent:!0}).node,r=Ee(e,t=re(t)),n=Ue(e,t,!0);if(n)throw new Ge.L(n);if(!e.N.rmdir)throw new Ge.L(63);if(r.ga)throw new Ge.L(10);e.N.rmdir(e,t),ke(r)},readdir:t=>xe((t=Le(t,{ea:!0}).node).N.readdir,54)(t),unlink(t){var e=Le(t,{parent:!0}).node;if(!e)throw new Ge.L(44);var r=Ee(e,t=re(t)),n=Ue(e,t,!1);if(n)throw new Ge.L(n);if(!e.N.unlink)throw new Ge.L(63);if(r.ga)throw new Ge.L(10);e.N.unlink(e,t),ke(r)},readlink(t){if(!(t=Le(t).node))throw new Ge.L(44);if(!t.N.readlink)throw new Ge.L(28);return t.N.readlink(t)},stat:(t,e)=>xe((t=Le(t,{ea:!e}).node).N.fa,63)(t),fstat(t){var e=je(t);t=e.node;var r=e.O.fa;return e=r?e:t,r??=t.N.fa,xe(r,63),r(e)},lstat:t=>Ge.stat(t,!0),chmod(t,e,r){We(null,t="string"==typeof t?Le(t,{ea:!r}).node:t,e,r)},lchmod(t,e){Ge.chmod(t,e,!0)},fchmod(t,e){We(t=je(t),t.node,e,!1)},chown(t,e,r,n){Ve(null,t="string"==typeof t?Le(t,{ea:!n}).node:t,{timestamp:Date.now(),Ya:n})},lchown(t,e,r){Ge.chown(t,e,r,!0)},fchown(t){Ve(t=je(t),t.node,{timestamp:Date.now(),Ya:!1})},truncate(t,e){if(0>e)throw new Ge.L(28);Ie(null,t="string"==typeof t?Le(t,{ea:!0}).node:t,e)},Xb(t,e){if(t=je(t),0>e||!(2097155&t.flags))throw new Ge.L(28);Ie(t,t.node,e)},kc(t,e,r){xe((t=Le(t,{ea:!0}).node).N.ha,63)(t,{atime:e,mtime:r})},open(t,e,n=438){if(""===t)throw new Ge.L(44);if("string"==typeof e){var i={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===i)throw Error(`Unknown file open mode: ${e}`);e=i}if(n=64&e?4095&n|32768:0,"object"==typeof t)i=t;else{var a=t.endsWith("/");i=(t=Le(t,{ea:!(131072&e),yb:!0})).node,t=t.path}var s=!1;if(64&e)if(i){if(128&e)throw new Ge.L(20)}else{if(a)throw new Ge.L(31);i=Ge.ka(t,511|n,0),s=!0}if(!i)throw new Ge.L(44);if(8192==(61440&i.mode)&&(e&=-513),65536&e&&!Se(i.mode))throw new Ge.L(54);if(!s&&(a=i?40960==(61440&i.mode)?32:Se(i.mode)&&("r"!==Me(e)||576&e)?31:Ce(i,Me(e)):44))throw new Ge.L(a);return 512&e&&!s&&Ge.truncate(i,0),e&=-131713,(a=Fe({node:i,path:Oe(i),flags:e,seekable:!0,position:0,O:i.O,Fb:[],error:!1})).O.open&&a.O.open(a),s&&Ge.chmod(i,511&n),!r.logReadFiles||1&e||t in Ge.fb||(Ge.fb[t]=1),a},close(t){if(null===t.fd)throw new Ge.L(8);t.Ja&&(t.Ja=null);try{t.O.close&&t.O.close(t)}catch(t){throw t}finally{Ge.streams[t.fd]=null}t.fd=null},$(t,e,r){if(null===t.fd)throw new Ge.L(8);if(!t.seekable||!t.O.$)throw new Ge.L(70);if(0!=r&&1!=r&&2!=r)throw new Ge.L(28);return t.position=t.O.$(t,e,r),t.Fb=[],t.position},read(t,e,r,n,i){if(0>n||0>i)throw new Ge.L(28);if(null===t.fd)throw new Ge.L(8);if(1==(2097155&t.flags))throw new Ge.L(8);if(Se(t.node.mode))throw new Ge.L(31);if(!t.O.read)throw new Ge.L(28);var a=void 0!==i;if(a){if(!t.seekable)throw new Ge.L(70)}else i=t.position;return e=t.O.read(t,e,r,n,i),a||(t.position+=e),e},write(t,e,r,n,i,a){if(0>n||0>i)throw new Ge.L(28);if(null===t.fd)throw new Ge.L(8);if(!(2097155&t.flags))throw new Ge.L(8);if(Se(t.node.mode))throw new Ge.L(31);if(!t.O.write)throw new Ge.L(28);t.seekable&&1024&t.flags&&Ge.$(t,0,2);var s=void 0!==i;if(s){if(!t.seekable)throw new Ge.L(70)}else i=t.position;return e=t.O.write(t,e,r,n,i,a),s||(t.position+=e),e},ua(t,e,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&t.flags))throw new Ge.L(2);if(1==(2097155&t.flags))throw new Ge.L(2);if(!t.O.ua)throw new Ge.L(43);if(!e)throw new Ge.L(28);return t.O.ua(t,e,r,n,i)},za:(t,e,r,n,i)=>t.O.za?t.O.za(t,e,r,n,i):0,ab(t,e,r){if(!t.O.ab)throw new Ge.L(59);return t.O.ab(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding&&N(`Invalid encoding type "${e.encoding}"`);var r=Ge.open(t,e.flags);t=Ge.stat(t).size;var n=new Uint8Array(t);return Ge.read(r,n,0,t,0),"utf8"===e.encoding&&(n=se(n)),Ge.close(r),n},writeFile(t,e,r={}){r.flags=r.flags||577,t=Ge.open(t,r.flags,r.mode),"string"==typeof e&&(e=new Uint8Array(he(e))),ArrayBuffer.isView(e)?Ge.write(t,e,0,e.byteLength,void 0,r.Pb):N("Unsupported data type"),Ge.close(t)},cwd:()=>Ge.Va,chdir(t){if(null===(t=Le(t,{ea:!0})).node)throw new Ge.L(44);if(!Se(t.node.mode))throw new Ge.L(54);var e=Ce(t.node,"x");if(e)throw new Ge.L(e);Ge.Va=t.path},fc(){for(var t of(Ge.Ka=!1,Ge.streams))t&&Ge.close(t)},Ub(t,e){try{var r=Le(t,{ea:!e});t=r.path}catch(t){}var n=!1,i=null;try{r=Le(t,{parent:!0}),re(t),r=Le(t,{ea:!e}),n=!0,i=r.node}catch(t){}return n?i:null},na(t,e,r,n){var i;return t=((t,e)=>te(t+"/"+e))("string"==typeof t?t:Oe(t),e),e=we(!!r,!!n),(i=Ge.na).Na??(i.Na=64),Ae(i=Ge.ra(Ge.na.Na++,0),{open(t){t.seekable=!1},close(){n?.buffer?.length&&n(10)},read(t,e,n,i){for(var a=0,s=0;s<i;s++){try{var o=r()}catch(t){throw new Ge.L(29)}if(void 0===o&&0===a)throw new Ge.L(6);if(null==o)break;a++,e[n+s]=o}return a&&(t.node.atime=Date.now()),a},write(t,e,r,i){for(var a=0;a<i;a++)try{n(e[r+a])}catch(t){throw new Ge.L(29)}return i&&(t.node.mtime=t.node.ctime=Date.now()),a}}),He(t,e,i)}};if((()=>{let t=Q.prototype;Object.assign(t,{isAliasOf:function(t){if(!(this instanceof Q&&t instanceof Q))return!1;var e=this.M.U.R,r=this.M.S;t.M=t.M;var n=t.M.U.R;for(t=t.M.S;e.Z;)r=e.Ba(r),e=e.Z;for(;n.Z;)t=n.Ba(t),n=n.Z;return e===n&&r===t},clone:function(){if(this.M.S||Z(this),this.M.Aa)return this.M.count.value+=1,this;var t=K,e=Object,r=e.create,n=Object.getPrototypeOf(this),i=this.M;return(t=t(r.call(e,n,{M:{value:{count:i.count,xa:i.xa,Aa:i.Aa,S:i.S,U:i.U,X:i.X,aa:i.aa}}}))).M.count.value+=1,t.M.xa=!1,t},delete(){if(this.M.S||Z(this),this.M.xa&&!this.M.Aa)throw new B("Object already scheduled for deletion");J(this);var t=this.M;--t.count.value,0===t.count.value&&(t.X?t.aa.oa(t.X):t.U.R.oa(t.S)),this.M.Aa||(this.M.X=void 0,this.M.S=void 0)},isDeleted:function(){return!this.M.S},deleteLater:function(){if(this.M.S||Z(this),this.M.xa&&!this.M.Aa)throw new B("Object already scheduled for deletion");return this.M.xa=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)})(),Object.assign(wt.prototype,{tb(t){return this.eb&&(t=this.eb(t)),t},Wa(t){this.oa?.(t)},ma:ct,Y:function(t){function e(){return pt(this.R.ta,this.Ea?{U:this.Ab,S:r,aa:this,X:t}:{U:this,S:t})}var r=this.tb(t);if(!r)return this.Wa(t),null;var n=((t,e)=>{if(void 0===e)throw new B("ptr should not be undefined");for(;t.Z;)e=t.Ba(e),t=t.Z;return dt[e]})(this.R,r);if(void 0!==n)return 0===n.M.count.value?(n.M.S=r,n.M.X=t,n.clone()):(n=n.clone(),this.Wa(t),n);if(n=this.R.rb(r),!(n=et[n]))return e.call(this);var i=ut(r,this.R,(n=this.Da?n.nb:n.pointerType).R);return null===i?e.call(this):pt(n.R.ta,this.Ea?{U:n,S:i,aa:this,X:t}:{U:n,S:i})}}),Ge.Qb=(t,e,r,n,i,a,s,o,h,l)=>{$e(t,e,r,n,i,o,h,l).then(a).catch(s)},Ge.ec=$e,Ge.la=Array(4096),Ge.T(pe,{},"/"),Ge.mkdir("/tmp"),Ge.mkdir("/home"),Ge.mkdir("/home/web_user"),function(){Ge.mkdir("/dev"),Ae(Ge.ra(1,3),{read:()=>0,write:(t,e,r,n)=>n,$:()=>0}),He("/dev/null",Ge.ra(1,3)),ce(Ge.ra(5,0),de),ce(Ge.ra(6,0),fe),He("/dev/tty",Ge.ra(5,0)),He("/dev/tty1",Ge.ra(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(ne(t),e=t.byteLength),t[--e]);Ge.na("/dev","random",r),Ge.na("/dev","urandom",r),Ge.mkdir("/dev/shm"),Ge.mkdir("/dev/shm/tmp")}(),function(){Ge.mkdir("/proc");var t=Ge.mkdir("/proc/self");Ge.mkdir("/proc/self/fd"),Ge.T({T(){var e=Ge.createNode(t,"fd",16895,73);return e.O={$:pe.O.$},e.N={lookup(t,e){var r=je(t=+e);return(t={parent:null,T:{cb:"fake"},N:{readlink:()=>r.path},id:t+1}).parent=t},readdir:()=>Array.from(Ge.streams.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},{},"/proc/self/fd")}(),Ge.qb={MEMFS:pe},r.noExitRuntime&&(D=r.noExitRuntime),r.preloadPlugins&&(be=r.preloadPlugins),r.print&&(L=r.print),r.printErr&&(O=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=ge,r.removeRunDependency=ye,r.FS_preloadFile=$e,r.FS_unlink=(...t)=>Ge.unlink(...t),r.FS_createPath=(...t)=>function(t,e){for(t="string"==typeof t?t:Oe(t),e=e.split("/").reverse();e.length;){var r=e.pop();if(r){var n=te(t+"/"+r);try{Ge.mkdir(n)}catch(t){if(20!=t.qa)throw t}t=n}}return n}(...t),r.FS_createDevice=(...t)=>Ge.na(...t),r.FS=Ge,r.FS_createDataFile=(...t)=>Te(...t),r.FS_createLazyFile=(...t)=>function(t,e,r,n,a){class s{Ha=!1;ja=[];Ga=void 0;Ra=0;Qa=0;get(t){if(!(t>this.length-1||0>t)){var e=t%this.chunkSize;return this.Ga(t/this.chunkSize|0)[e]}}lb(t){this.Ga=t}Sa(){var t=new XMLHttpRequest;t.open("HEAD",r,!1),t.send(null),200<=t.status&&300>t.status||304===t.status||N("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),i=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e;t=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e;var a=1048576;i||(a=n);var s=this;s.lb(t=>{var e=t*a,i=(t+1)*a-1;if(i=Math.min(i,n-1),void 0===s.ja[t]){var o=s.ja;e>i&&N("invalid range ("+e+", "+i+") or no bytes requested!"),i>n-1&&N("only "+n+" bytes available! programmer error!");var h=new XMLHttpRequest;h.open("GET",r,!1),n!==a&&h.setRequestHeader("Range","bytes="+e+"-"+i),h.responseType="arraybuffer",h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send(null),200<=h.status&&300>h.status||304===h.status||N("Couldn't load "+r+". Status: "+h.status),e=void 0!==h.response?new Uint8Array(h.response||[]):he(h.responseText||""),o[t]=e}return void 0===s.ja[t]&&N("doXHR failed!"),s.ja[t]}),!t&&n||(a=n=1,a=n=this.Ga(0).length,L("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Ra=n,this.Qa=a,this.Ha=!0}get length(){return this.Ha||this.Sa(),this.Ra}get chunkSize(){return this.Ha||this.Sa(),this.Qa}}if(globalThis.XMLHttpRequest){i||N("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var o=new s,h=void 0}else h=r,o=void 0;var l=function(t,e,r,n){return t="string"==typeof t?t:Oe(t),e=te(t+"/"+e),Ge.create(e,we(r,n))}(t,e,n,a);o?l.P=o:h&&(l.P=null,l.url=h),Object.defineProperties(l,{V:{get:function(){return this.P.length}}}),t={};for(const[e,r]of Object.entries(l.O))t[e]=(...t)=>(Be(l),r(...t));return t.read=(t,e,r,n,i)=>{if(Be(l),i>=(t=t.node.P).length)e=0;else{if(n=Math.min(t.length-i,n),t.slice)for(var a=0;a<n;a++)e[r+a]=t[i+a];else for(a=0;a<n;a++)e[r+a]=t.get(i+a);e=n}return e},t.ua=()=>{throw Be(l),N(),new Ge.L(48)},l.O=t,l}(...t);var qe,Xe,Ze,Ye,Je,Ke,Qe,tr={v:()=>N(""),k:(t,e,r,n,i)=>{e=z(e);let a=t=>t;if(n=0n===n){const t=8*r;a=e=>BigInt.asUintN(t,e),i=a(i)}q(t,{name:e,Y:a,ba:(t,e)=>("number"==typeof e&&(e=BigInt(e)),e),ma:X(e,r,!n),da:null})},A:(t,e,r,n)=>{q(t,{name:e=z(e),Y:function(t){return!!t},ba:function(t,e){return e?r:n},ma:function(t){return this.Y(y[t])},da:null})},x:(t,e,r,n,i,a,s,o,h,l,c,u,d)=>{c=z(c),a=vt(i,a),o&&=vt(s,o),l&&=vt(h,l),d=vt(u,d);var f=(t=>{var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(c);nt(f,function(){$t(`Cannot construct ${c} due to unbound types`,[n])}),_t([t,e,r],n?[n]:[],e=>{if(e=e[0],n)var r=e.R,i=r.ta;else i=Q.prototype;e=tt(c,function(...t){if(Object.getPrototypeOf(this)!==s)throw new B(`Use 'new' to construct ${c}`);if(void 0===u.pa)throw new B(`${c} has no accessible constructor`);var e=u.pa[t.length];if(void 0===e)throw new B(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(u.pa).toString()}) parameters instead!`);return e.apply(this,t)});var s=Object.create(i,{constructor:{value:e}});e.prototype=s;var h,u=new it(c,e,s,d,r,a,o,l);return u.Z&&((h=u.Z).Ta??(h.Ta=[]),u.Z.Ta.push(u)),r=new wt(c,u,!0,!1,!1),h=new wt(c+"*",u,!1,!1,!1),i=new wt(c+" const*",u,!1,!0,!1),et[t]={pointerType:h,nb:i},mt(f,e),[r,h,i]})},n:(t,e,r,n,i,a)=>{var s=At(e,r);i=vt(n,i),_t([],[t],t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.R.pa&&(t.R.pa=[]),void 0!==t.R.pa[e-1])throw new B(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.R.pa[e-1]=()=>{$t(`Cannot construct ${t.name} due to unbound types`,s)},_t([],s,n=>(n.splice(1,0,null),t.R.pa[e-1]=kt(r,n,null,i,a),[])),[]})},b:(t,e,r,n,i,a,s,o,h)=>{var l=At(r,n);e=z(e),e=Tt(e),a=vt(i,a),_t([],[t],t=>{function n(){$t(`Cannot call ${i} due to unbound types`,l)}var i=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),o&&t.R.Bb.push(e);var c=t.R.ta,u=c[e];return void 0===u||void 0===u.W&&u.className!==t.name&&u.wa===r-2?(n.wa=r-2,n.className=t.name,c[e]=n):(rt(c,e,i),c[e].W[r-2]=n),_t([],l,n=>(n=kt(i,n,t,a,s,h),void 0===c[e].W?(n.wa=r-2,c[e]=n):c[e].W[r-2]=n,[])),[]})},y:t=>q(t,Ct),j:(t,e,r)=>{q(t,{name:e=z(e),Y:t=>t,ba:(t,e)=>e,ma:Nt(e,r),da:null})},l:(t,e,r,n,i,a,s)=>{var o=At(e,r);t=z(t),t=Tt(t),i=vt(n,i),nt(t,function(){$t(`Cannot call ${t} due to unbound types`,o)},e-1),_t([],o,r=>(r=[r[0],null].concat(r.slice(1)),mt(t,kt(t,r,null,i,a,s),e-1),[]))},c:(t,e,r,n,i)=>{e=z(e);let a=t=>t;if(0===n){var s=32-8*r;a=t=>t<<s>>>s,i=a(i)}q(t,{name:e,Y:a,ba:(t,e)=>e,ma:X(e,r,0!==n),da:null})},a:(t,e,r)=>{function n(t){return new i(v.buffer,_[t+4>>2],_[t>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];q(t,{name:r=z(r),Y:n,ma:n},{vb:!0})},z:(t,e)=>{q(t,{name:e=z(e),Y(t){var e=(e=t+4)?jt.decode(y.subarray(e,Ft(y,e,_[t>>2],!0))):"";return qe(t),e},ba(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;if(!(r||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT))throw new B("Cannot pass non-string to std::string");var n=r?xt(e):e.length,i=Xe(4+n+1),a=i+4;return _[i>>2]=n,r?Ut(e,y,a,n+1):y.set(e,a),null!==t&&t.push(qe,i),i},ma:ct,da(t){qe(t)}})},g:(t,e,r)=>{if(r=z(r),2===e)var n=Dt,i=zt,a=Ht;else n=Wt,i=It,a=Bt;q(t,{name:r,Y:t=>{var r=n(t+4,_[t>>2]*e,!0);return qe(t),r},ba:(t,n)=>{if("string"!=typeof n)throw new B(`Cannot pass non-string to C++ string type ${r}`);var s=a(n),o=Xe(4+s+e);return _[o>>2]=s/e,i(n,o+4,s+e),null!==t&&t.push(qe,o),o},ma:ct,da(t){qe(t)}})},h:t=>{q(t,Ct)},B:(t,e)=>{q(t,{bb:!0,name:e=z(e),Y:()=>{},ba:()=>{}})},q:()=>{D=!1,Gt=0},e:(t,e,r)=>{var[n,...i]=((t,e)=>{for(var r=Array(t),n=0;n<t;++n){var i=n,a=_[e+4*n>>2],s=W[a];if(void 0===s)throw t=`parameter ${n} has unknown type ${bt(a)}`,new B(t);r[i]=s}return r})(t,e);e=n.ba.bind(n);var a=i.map(t=>t.ma.bind(t));t--;var s={toValue:Rt};switch(t=a.map((t,e)=>{var r=`argFromPtr${e}`;return s[r]=t,`${r}(args${e?"+"+8*e:""})`}),r){case 0:var o="toValue(handle)";break;case 2:o="new (toValue(handle))";break;case 3:o="";break;case 1:s.getStringOrSymbol=Yt,o="toValue(handle)[getStringOrSymbol(methodName)]"}return o+=`(${t})`,n.bb||(s.toReturnWire=e,s.emval_returnValue=Xt,o=`return emval_returnValue(toReturnWire, destructorsRef, ${o})`),o=`return function (handle, methodName, destructorsRef, args) {\n ${o}\n }`,r=new Function(Object.keys(s),o)(...Object.values(s)),o=`methodCaller<(${i.map(t=>t.name)}) => ${n.name}>`,(t=>{var e=qt.length;return qt.push(t),e})(tt(o,r))},o:Pt,C:t=>t?(t=Yt(t),Mt(globalThis[t])):Mt(globalThis),f:(t,e)=>(t=Rt(t),e=Rt(e),Mt(t[e])),i:t=>{9<t&&(Ot[t+1]+=1)},d:(t,e,r,n,i)=>qt[t](e,r,n,i),D:t=>Mt(Yt(t)),m:t=>{var e=Rt(t);St(e),Pt(t)},r:(t,e)=>{if(Jt[t]&&(clearTimeout(Jt[t].id),delete Jt[t]),!e)return 0;var r=setTimeout(()=>{delete Jt[t],(t=>{if(!P)try{if(t(),!(D||0<Gt))try{p=t=p,Kt(t)}catch(t){t instanceof U||"unwind"==t||l(1,t)}}catch(t){t instanceof U||"unwind"==t||l(1,t)}})(()=>Ye(t,performance.now()))},e);return Jt[t]={id:r,ic:e},0},w:t=>{var e=y.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=e*(1+.2/r);n=Math.min(n,t+100663296);t:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(t,n)/65536))-Je.buffer.byteLength+65535)/65536|0;try{Je.grow(n),C();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},u:function(t){try{var e=je(t);return Ge.close(e),0}catch(t){if(void 0===Ge||"ErrnoError"!==t.name)throw t;return t.qa}},s:function(t,e,r,n){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{if(isNaN(e))return 61;var i=je(t);return Ge.$(i,e,r),E[n>>3]=BigInt(i.position),i.Ja&&0===e&&0===r&&(i.Ja=null),0}catch(t){if(void 0===Ge||"ErrnoError"!==t.name)throw t;return t.qa}},t:function(t,e,r,n){try{t:{var i=je(t);t=e;for(var a,s=e=0;s<r;s++){var o=_[t>>2],h=_[t+4>>2];t+=8;var l=Ge.write(i,v,o,h,a);if(0>l){var c=-1;break t}if(e+=l,l<h)break;void 0!==a&&(a+=l)}c=e}return _[n>>2]=c,0}catch(t){if(void 0===Ge||"ErrnoError"!==t.name)throw t;return t.qa}},p:Kt};return Qe=await async function(){function t(t){return t=Qe=t.exports,qe=t.G,Xe=t.H,Ze=t.I,Ye=t.J,Je=t.E,Ke=t.K,C(),Qe}var e={a:tr};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(e,(e,r)=>{n(t(e))})}):(T??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",u):u+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,t((await async function(t){var e=T;if(!f&&!R(e)&&!a)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){O(`wasm streaming compile failed: ${t}`),O("falling back to ArrayBuffer instantiation")}return async function(t,e){try{var r=await async function(t){if(!f)try{var e=await o(t);return new Uint8Array(e)}catch{}if(t==T&&f)t=new Uint8Array(f);else{if(!h)throw"both async and sync fetching of the wasm failed";t=h(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){O(`failed to asynchronously prepare wasm: ${t}`),N(t)}}(e,t)}(e)).instance))}(),function t(){function e(){if(r.calledRun=!0,!P){if(M=!0,r.noFSInit||Ge.Ka||_e(),Qe.F(),Ge.$a=!1,w?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();j.push(t)}x(j)}}if(0<me)ve=t;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)V();x(F),0<me?ve=t:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),e()},1)):e()}}(),e=M?r:new Promise((t,e)=>{w=t,m=e}),e}({locateFile:(t,e)=>t.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":e+t})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const t=this.config?.renderer||"sw";if(await(async t=>{if("wg"===t){for(;"requested"===pt;)await ft(100);if("initialized"!==pt&&(pt="requested",ct))for(;;)switch(ct.init()){case 0:return void(pt="initialized");case 1:return void(pt="failed");case 2:await ft(100)}}})(t),"failed"===pt)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ct.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:t,right:e,top:r,bottom:n}=this.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight;let s=0,o=0,h=this.canvas.width,l=this.canvas.height;t<0&&(s=Math.abs(t),h-=s),r<0&&(o=Math.abs(r),l-=o),e>i&&(h-=e-i),n>a&&(l-=n-a),this.TVG.viewport(s,o,h,l)}_observerCallback(t){const e=t[0],r=e.target;r._observable=e.isIntersecting,e.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(t){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(t){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(t,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const t=1+.75*(window.devicePixelRatio-1),{width:e,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=e*t,this.canvas.height=r*t}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const t=this.TVG.render(),e=new Uint8ClampedArray(t,0,t.byteLength);e.length<1||(this._imageData=new ImageData(e,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const t=this.TVG.duration(),e=Date.now()/1e3;if(this.currentFrame=(e-this._beginTime)/t*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const t=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||t&&this._counter<t)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ft(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(t){this.TVG&&(this.pause(),this.currentFrame=t,this.TVG.frame(t))}async load(t,e="json"){try{await this._init();const r=await(async(t,e)=>{const r=new TextEncoder;let n=t;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===e||"lot"===e)return n=await(async t=>{try{t=JSON.parse(t)}catch(e){const r=await(async t=>{if("string"!=typeof t)throw new Error("The url value must be a string");try{const e=new URL(t),r=await fetch(e.toString());return await r.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(t);t=JSON.stringify(r)}return t})(n),r.encode(n);const t=await(async t=>(await fetch(t)).arrayBuffer())(n);return new Uint8Array(t);default:throw new Error("Invalid src type")}})(t,e);this.dispatchEvent(new CustomEvent("ready")),this.fileType=e,await this._loadBytes(r)}catch(t){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(this.totalFrame=this.TVG.totalFrame(),this.totalFrame<1||(this._beginTime=Date.now()/1e3,"playing"===this.currentState))))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(t){this._frame(t),await this._update(),this._render()}resize(t,e){this.canvas.width=t,this.canvas.height=e,"playing"!==this.currentState&&this._render()}destroy(){this.TVG&&(this.TVG.delete(),this.TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ct&&(ct.term(),ct=null)}setLooping(t){this.TVG&&(this.loop=t)}setDirection(t){this.TVG&&(this.direction=t)}setSpeed(t){this.TVG&&(this.speed=t)}setBgColor(t){this.TVG&&(this.canvas.style.backgroundColor=t)}setQuality(t){this.TVG&&this.TVG.quality(t)&&"playing"!==this.currentState&&this._render()}setAssetResolver(t,e){this._assetResolverCallback=t,this._assetResolverData=e,this.TVG&&this.TVG.setAssetResolver(t,e)}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return W`
|
|
1
|
+
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let i=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const r=this.t;if(e&&void 0===t){const e=void 0!==r&&1===r.length;e&&(t=n.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(r,t))}return t}toString(){return this.cssText}};const a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new i("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:s,defineProperty:o,getOwnPropertyDescriptor:h,getOwnPropertyNames:l,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,d=globalThis,f=d.trustedTypes,p=f?f.emptyScript:"",w=d.reactiveElementPolyfillSupport,m=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},y=(t,e)=>!s(t,e),g={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&o(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:i}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const a=n?.call(this);i?.call(this,e),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??g}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...l(t),...c(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(e)r.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),i=t.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const i=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(e,r.type);this._$Em=t,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const a=i.fromAttribute(e,t.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,i=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??y)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:i},a){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??e??this[t]),!0!==i||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[m("elementProperties")]=new Map,b[m("finalized")]=new Map,w?.({ReactiveElement:b}),(d.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_=(t=$,e,r)=>{const{kind:n,metadata:i}=r;let a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),a.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const i=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,i,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];e.call(this,r),this.requestUpdate(n,i,t)}}throw Error("Unsupported decorator location: "+n)};function A(t){return(e,r)=>"object"==typeof r?_(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const S=globalThis,E=S.trustedTypes,k=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+L,P=`<${O}>`,R=document,M=()=>R.createComment(""),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,U="[ \t\n\f\r]",x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,F=/>/g,V=RegExp(`>|${U}(?:([^\\s"'>=/]+)(${U}*=${U}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,z=/"/g,H=/^(?:script|style|textarea|title)$/i,W=(t,...e)=>({_$litType$:1,strings:t,values:e}),I=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),G=new WeakMap,q=R.createTreeWalker(R,129);function X(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}const Z=(t,e)=>{const r=t.length-1,n=[];let i,a=2===e?"<svg>":3===e?"<math>":"",s=x;for(let e=0;e<r;e++){const r=t[e];let o,h,l=-1,c=0;for(;c<r.length&&(s.lastIndex=c,h=s.exec(r),null!==h);)c=s.lastIndex,s===x?"!--"===h[1]?s=j:void 0!==h[1]?s=F:void 0!==h[2]?(H.test(h[2])&&(i=RegExp("</"+h[2],"g")),s=V):void 0!==h[3]&&(s=V):s===V?">"===h[0]?(s=i??x,l=-1):void 0===h[1]?l=-2:(l=s.lastIndex-h[2].length,o=h[1],s=void 0===h[3]?V:'"'===h[3]?z:D):s===z||s===D?s=V:s===j||s===F?s=x:(s=V,i=void 0);const u=s===V&&t[e+1].startsWith("/>")?" ":"";a+=s===x?r+P:l>=0?(n.push(o),r.slice(0,l)+T+r.slice(l)+L+u):r+L+(-2===l?e:u)}return[X(t,a+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Y{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let i=0,a=0;const s=t.length-1,o=this.parts,[h,l]=Z(t,e);if(this.el=Y.createElement(h,r),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=q.nextNode())&&o.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(T)){const e=l[a++],r=n.getAttribute(t).split(L),s=/([.?@])?(.*)/.exec(e);o.push({type:1,index:i,name:s[2],strings:r,ctor:"."===s[1]?et:"?"===s[1]?rt:"@"===s[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(L)&&(o.push({type:6,index:i}),n.removeAttribute(t));if(H.test(n.tagName)){const t=n.textContent.split(L),e=t.length-1;if(e>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],M()),q.nextNode(),o.push({type:2,index:++i});n.append(t[e],M())}}}else if(8===n.nodeType)if(n.data===O)o.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(L,t+1));)o.push({type:7,index:i}),t+=L.length-1}i++}}static createElement(t,e){const r=R.createElement("template");return r.innerHTML=t,r}}function J(t,e,r=t,n){if(e===I)return e;let i=void 0!==n?r._$Co?.[n]:r._$Cl;const a=C(e)?void 0:e._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(t),i._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(e=J(t,i._$AS(t,e.values),i,n)),e}class K{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??R).importNode(e,!0);q.currentNode=n;let i=q.nextNode(),a=0,s=0,o=r[0];for(;void 0!==o;){if(a===o.index){let e;2===o.type?e=new Q(i,i.nextSibling,this,t):1===o.type?e=new o.ctor(i,o.name,o.strings,this,t):6===o.type&&(e=new it(i,this,t)),this._$AV.push(e),o=r[++s]}a!==o?.index&&(i=q.nextNode(),a++)}return q.currentNode=R,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),C(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(R.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Y.createElement(X(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new K(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new Y(t)),e}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const i of t)n===e.length?e.push(r=new Q(this.O(M()),this.O(M()),this,this.options)):r=e[n],r._$AI(i),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,i){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=B}_$AI(t,e=this,r,n){const i=this.strings;let a=!1;if(void 0===i)t=J(this,t,e,0),a=!C(t)||t!==this._$AH&&t!==I,a&&(this._$AH=t);else{const n=t;let s,o;for(t=i[0],s=0;s<i.length-1;s++)o=J(this,n[r+s],e,s),o===I&&(o=this._$AH[s]),a||=!C(o)||o!==this._$AH[s],o===B?t=B:t!==B&&(t+=(o??"")+i[s+1]),this._$AH[s]=o}a&&!n&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class nt extends tt{constructor(t,e,r,n,i){super(t,e,r,n,i),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??B)===I)return;const r=this._$AH,n=t===B&&r!==B||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==B&&(r===B||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class it{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const at=S.litHtmlPolyfillSupport;at?.(Y,Q),(S.litHtmlVersions??=[]).push("3.3.1");const st=globalThis;class ot extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=r?.renderBefore??null;n._$litPart$=i=new Q(e.insertBefore(M(),t),t,void 0,r??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}}ot._$litElement$=!0,ot.finalized=!0,st.litElementHydrateSupport?.({LitElement:ot});const ht=st.litElementPolyfillSupport;function lt(t,e,r,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(i=t[o])&&(s=(a<3?i(s):a>3?i(e,r,s):i(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s}ht?.({LitElement:ot}),(st.litElementVersions??=[]).push("4.2.1");let ct=null,ut=!1;var dt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const ft=t=>new Promise(e=>setTimeout(e,t));let pt="idle";class wt extends ot{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ut)for(;!ct;)await ft(100);if(ct||(ut=!0,ct=await async function(t={}){var e,r=t,n=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,a=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(a){const{createRequire:t}=await Promise.resolve().then(function(){return yt});var s=t(import.meta.url)}var o,h,l=(t,e)=>{throw e},c=import.meta.url,u="";if(a){var d=s("fs");c.startsWith("file:")&&(u=s("path").dirname(s("url").fileURLToPath(c))+"/"),h=t=>(t=R(t)?new URL(t):t,d.readFileSync(t)),o=async t=>(t=R(t)?new URL(t):t,d.readFileSync(t,void 0)),process.argv.slice(2),l=(t,e)=>{throw process.exitCode=t,e}}else if(n||i){try{u=new URL(".",c).href}catch{}i&&(h=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=async t=>{if(R(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var f,p,w,m,v,y,g,b,$,_,A,S,E,k,T,L=function(){}.bind(),O=function(){}.bind(),P=!1,R=t=>t.startsWith("file://"),M=!1;function C(){var t=Je.buffer;v=new Int8Array(t),g=new Int16Array(t),y=new Uint8Array(t),b=new Uint16Array(t),$=new Int32Array(t),_=new Uint32Array(t),A=new Float32Array(t),S=new Float64Array(t),E=new BigInt64Array(t),k=new BigUint64Array(t)}function N(t){throw r.onAbort?.(t),O(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),m?.(t),t}class U{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var x=t=>{for(;0<t.length;)t.shift()(r)},j=[],F=[],V=()=>{var t=r.preRun.shift();F.push(t)},D=!0,z=t=>{for(var e="";;){var r=y[t++];if(!r)return e;e+=String.fromCharCode(r)}},H={},W={},I={},B=class extends Error{constructor(t){super(t),this.name="BindingError"}},G=t=>{throw new B(t)};function q(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new B(`type "${n}" must have a positive integer typeid pointer`);if(W.hasOwnProperty(t)){if(r.vb)return;throw new B(`Cannot register type '${n}' twice`)}W[t]=e,delete I[t],H.hasOwnProperty(t)&&(e=H[t],delete H[t],e.forEach(t=>t()))}(t,e,r)}var X=(t,e,r)=>{switch(e){case 1:return r?t=>v[t]:t=>y[t];case 2:return r?t=>g[t>>1]:t=>b[t>>1];case 4:return r?t=>$[t>>2]:t=>_[t>>2];case 8:return r?t=>E[t>>3]:t=>k[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Z=t=>{throw new B(t.M.U.R.name+" instance already deleted")},Y=!1,J=()=>{},K=t=>globalThis.FinalizationRegistry?(Y=new FinalizationRegistry(t=>{--(t=t.M).count.value,0===t.count.value&&(t.X?t.aa.oa(t.X):t.U.R.oa(t.S))}),K=t=>{var e=t.M;return e.X&&Y.register(t,{M:e},t),t},J=t=>{Y.unregister(t)},K(t)):(K=t=>t,t);function Q(){}var tt=(t,e)=>Object.defineProperty(e,"name",{value:t}),et={},rt=(t,e,r)=>{if(void 0===t[e].W){var n=t[e];t[e]=function(...n){if(!t[e].W.hasOwnProperty(n.length))throw new B(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].W})!`);return t[e].W[n.length].apply(this,n)},t[e].W=[],t[e].W[n.wa]=n}},nt=(t,e,n)=>{if(r.hasOwnProperty(t)){if(void 0===n||void 0!==r[t].W&&void 0!==r[t].W[n])throw new B(`Cannot register public name '${t}' twice`);if(rt(r,t,t),r[t].W.hasOwnProperty(n))throw new B(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].W[n]=e}else r[t]=e,r[t].wa=n};function it(t,e,r,n,i,a,s,o){this.name=t,this.constructor=e,this.ta=r,this.oa=n,this.Z=i,this.rb=a,this.Ba=s,this.ob=o,this.Bb=[]}var at=(t,e,r)=>{for(;e!==r;){if(!e.Ba)throw new B(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Ba(t),e=e.Z}return t},st=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ot(t,e){if(null===e){if(this.La)throw new B(`null is not a valid ${this.name}`);return 0}if(!e.M)throw new B(`Cannot pass "${st(e)}" as a ${this.name}`);if(!e.M.S)throw new B(`Cannot pass deleted object as a pointer of type ${this.name}`);return at(e.M.S,e.M.U.R,this.R)}function ht(t,e){if(null===e){if(this.La)throw new B(`null is not a valid ${this.name}`);if(this.Ea){var r=this.Cb();return null!==t&&t.push(this.oa,r),r}return 0}if(!e||!e.M)throw new B(`Cannot pass "${st(e)}" as a ${this.name}`);if(!e.M.S)throw new B(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Da&&e.M.U.Da)throw new B(`Cannot convert argument of type ${e.M.aa?e.M.aa.name:e.M.U.name} to parameter type ${this.name}`);if(r=at(e.M.S,e.M.U.R,this.R),this.Ea){if(void 0===e.M.X)throw new B("Passing raw pointer to smart pointer is illegal");switch(this.Eb){case 0:if(e.M.aa!==this)throw new B(`Cannot convert argument of type ${e.M.aa?e.M.aa.name:e.M.U.name} to parameter type ${this.name}`);r=e.M.X;break;case 1:r=e.M.X;break;case 2:if(e.M.aa===this)r=e.M.X;else{var n=e.clone();r=this.Db(r,Mt(()=>n.delete())),null!==t&&t.push(this.oa,r)}break;default:throw new B("Unsupporting sharing policy")}}return r}function lt(t,e){if(null===e){if(this.La)throw new B(`null is not a valid ${this.name}`);return 0}if(!e.M)throw new B(`Cannot pass "${st(e)}" as a ${this.name}`);if(!e.M.S)throw new B(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.M.U.Da)throw new B(`Cannot convert argument of type ${e.M.U.name} to parameter type ${this.name}`);return at(e.M.S,e.M.U.R,this.R)}function ct(t){return this.Y(_[t>>2])}var ut=(t,e,r)=>e===r?t:void 0===r.Z||null===(t=ut(t,e,r.Z))?null:r.ob(t),dt={},ft=class extends Error{constructor(t){super(t),this.name="InternalError"}},pt=(t,e)=>{if(!e.U||!e.S)throw new ft("makeClassHandle requires ptr and ptrType");if(!!e.aa!=!!e.X)throw new ft("Both smartPtrType and smartPtr must be specified");return e.count={value:1},K(Object.create(t,{M:{value:e,writable:!0}}))};function wt(t,e,r,n,i,a,s,o,h,l,c){this.name=t,this.R=e,this.La=r,this.Da=n,this.Ea=i,this.Ab=a,this.Eb=s,this.eb=o,this.Cb=h,this.Db=l,this.oa=c,i||void 0!==e.Z?this.ba=ht:(this.ba=n?ot:lt,this.da=null)}var mt=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new ft("Replacing nonexistent public symbol");void 0!==r[t].W&&void 0!==n?r[t].W[n]=e:(r[t]=e,r[t].wa=n)},vt=(t,e)=>{t=z(t);var r=Ke.get(e);if("function"!=typeof r)throw new B(`unknown function pointer with signature ${t}: ${e}`);return r};class gt extends Error{}var bt=t=>{t=Ze(t);var e=z(t);return qe(t),e},$t=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||W[e]||(I[e]?I[e].forEach(t):(r.push(e),n[e]=!0))}),new gt(`${t}: `+r.map(bt).join([", "]))},_t=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new ft("Mismatched type converter count");for(var n=0;n<t.length;++n)q(t[n],e[n])}t.forEach(t=>I[t]=e);var i=Array(e.length),a=[],s=0;for(let[t,r]of e.entries())W.hasOwnProperty(r)?i[t]=W[r]:(a.push(r),H.hasOwnProperty(r)||(H[r]=[]),H[r].push(()=>{i[t]=W[r],++s===a.length&&n(i)}));0===a.length&&n(i)},At=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+4*n>>2]);return r},St=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function Et(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].da)return!0;return!1}function kt(t,e,r,n,i,a){var s=e.length;if(2>s)throw new B("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==e[1]&&null!==r,h=Et(e);r=!e[0].bb;var l=e[0],c=e[1];for(n=[t,G,n,i,St,l.Y.bind(l),c?.ba.bind(c)],i=2;i<s;++i)n.push((l=e[i]).ba.bind(l));if(!h)for(i=o?1:2;i<e.length;++i)null!==e[i].da&&n.push(e[i].da);for(h=Et(e),i=e.length-2,c=[],l=["fn"],o&&l.push("thisWired"),s=0;s<i;++s)c.push(`arg${s}`),l.push(`arg${s}Wired`);c=c.join(","),l=l.join(","),c=`return function (${c}) {\n`,h&&(c+="var destructors = [];\n");var u=h?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(o&&(c+=`var thisWired = toClassParamWire(${u}, this);\n`),s=0;s<i;++s){var f=`toArg${s}Wire`;c+=`var arg${s}Wired = ${f}(${u}, arg${s});\n`,d.push(f)}if(c+=(r||a?"var rv = ":"")+`invoker(${l});\n`,h)c+="runDestructors(destructors);\n";else for(s=o?1:2;s<e.length;++s)a=1===s?"thisWired":"arg"+(s-2)+"Wired",null!==e[s].da&&(c+=`${a}_dtor(${a});\n`,d.push(`${a}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,c+"}\n")(...n),tt(t,e)}var Tt=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},Lt=[],Ot=[0,1,,1,null,1,!0,1,!1,1],Pt=t=>{9<t&&0===--Ot[t+1]&&(Ot[t]=void 0,Lt.push(t))},Rt=t=>{if(!t)throw new B(`Cannot use deleted val. handle = ${t}`);return Ot[t]},Mt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=Lt.pop()||Ot.length;return Ot[e]=t,Ot[e+1]=1,e}},Ct={name:"emscripten::val",Y:t=>{var e=Rt(t);return Pt(t),e},ba:(t,e)=>Mt(e),ma:ct,da:null},Nt=(t,e)=>{switch(e){case 4:return function(t){return this.Y(A[t>>2])};case 8:return function(t){return this.Y(S[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Ut=(t,e,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var a=0;a<t.length;++a){var s=t.codePointAt(a);if(127>=s){if(r>=n)break;e[r++]=s}else if(2047>=s){if(r+1>=n)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(65535>=s){if(r+2>=n)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=n)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s,a++}}return e[r]=0,r-i},xt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},jt=new TextDecoder,Ft=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},Vt=new TextDecoder("utf-16le"),Dt=(t,e,r)=>Vt.decode(b.subarray(t>>=1,Ft(b,t,e/2,r))),zt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var i=0;i<r;++i)g[e>>1]=t.charCodeAt(i),e+=2;return g[e>>1]=0,e-n},Ht=t=>2*t.length,Wt=(t,e,r)=>{var n="";t>>=2;for(var i=0;!(i>=e/4);i++){var a=_[t+i];if(!a&&!r)break;n+=String.fromCodePoint(a)}return n},It=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var i=0;i<t.length;++i){var a=t.codePointAt(i);if(65535<a&&i++,$[e>>2]=a,(e+=4)+4>r)break}return $[e>>2]=0,e-n},Bt=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},Gt=0,qt=[],Xt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(_[e>>2]=Mt(n)),t},Zt={},Yt=t=>{var e=Zt[t];return void 0===e?z(t):e},Jt={},Kt=t=>{p=t,D||0<Gt||(r.onExit?.(t),P=!0),l(t,new U(t))},Qt=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},te=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=Qt(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},ee=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},re=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],ne=t=>{(ne=(()=>{if(a){var t=s("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},ie=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:Ge.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=Qt(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},ae=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=ie(t).slice(1),e=ie(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,a=0;a<n;a++)if(t[a]!==e[a]){i=a;break}for(n=[],a=i;a<t.length;a++)n.push("..");return(n=n.concat(e.slice(i))).join("/")},se=t=>{var e=Ft(t,0);return jt.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},oe=[],he=t=>{var e=Array(xt(t)+1);return t=Ut(t,e,0,e.length),e.length=t,e},le=[];function ce(t,e){le[t]={input:[],output:[],va:e},Ae(t,ue)}var ue={open(t){var e=le[t.node.rdev];if(!e)throw new Ge.L(43);t.tty=e,t.seekable=!1},close(t){t.tty.va.fsync(t.tty)},fsync(t){t.tty.va.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.va.Za)throw new Ge.L(60);for(var i=0,a=0;a<n;a++){try{var s=t.tty.va.Za(t.tty)}catch(t){throw new Ge.L(29)}if(void 0===s&&0===i)throw new Ge.L(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.atime=Date.now()),i},write(t,e,r,n){if(!t.tty||!t.tty.va.Pa)throw new Ge.L(60);try{for(var i=0;i<n;i++)t.tty.va.Pa(t.tty,e[r+i])}catch(t){throw new Ge.L(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),i}},de={Za(){t:{if(!oe.length){var t=null;if(a){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=d.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}oe=he(t)}t=oe.shift()}return t},Pa(t,e){null===e||10===e?(L(se(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(L(se(t.output)),t.output=[])},Zb:()=>({Mb:25856,Ob:5,Lb:191,Nb:35387,Kb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),$b:()=>0,ac:()=>[24,80]},fe={Pa(t,e){null===e||10===e?(O(se(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(O(se(t.output)),t.output=[])}},pe={ia:null,T:()=>pe.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||Ge.isFIFO(r))throw new Ge.L(63);return pe.ia||(pe.ia={dir:{node:{fa:pe.N.fa,ha:pe.N.ha,lookup:pe.N.lookup,ka:pe.N.ka,rename:pe.N.rename,unlink:pe.N.unlink,rmdir:pe.N.rmdir,readdir:pe.N.readdir,symlink:pe.N.symlink},stream:{$:pe.O.$}},file:{node:{fa:pe.N.fa,ha:pe.N.ha},stream:{$:pe.O.$,read:pe.O.read,write:pe.O.write,ua:pe.O.ua,za:pe.O.za}},link:{node:{fa:pe.N.fa,ha:pe.N.ha,readlink:pe.N.readlink},stream:{}},Ua:{node:{fa:pe.N.fa,ha:pe.N.ha},stream:Ge.mb}}),Se((r=Ge.createNode(t,e,r,n)).mode)?(r.N=pe.ia.dir.node,r.O=pe.ia.dir.stream,r.P={}):Ge.isFile(r.mode)?(r.N=pe.ia.file.node,r.O=pe.ia.file.stream,r.V=0,r.P=null):40960==(61440&r.mode)?(r.N=pe.ia.link.node,r.O=pe.ia.link.stream):8192==(61440&r.mode)&&(r.N=pe.ia.Ua.node,r.O=pe.ia.Ua.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.P[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},Yb:t=>t.P?t.P.subarray?t.P.subarray(0,t.V):new Uint8Array(t.P):new Uint8Array(0),N:{fa(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=Se(t.mode)?4096:Ge.isFile(t.mode)?t.V:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},ha(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.V!=(e=e.size)&&(0==e?(t.P=null,t.V=0):(r=t.P,t.P=new Uint8Array(e),r&&t.P.set(r.subarray(0,Math.min(e,t.V))),t.V=e))},lookup(){throw pe.Ia||(pe.Ia=new Ge.L(44),pe.Ia.stack="<generic error, no stack>"),pe.Ia},ka:(t,e,r,n)=>pe.createNode(t,e,r,n),rename(t,e,r){try{var n=Ee(e,r)}catch(t){}if(n){if(Se(t.mode))for(var i in n.P)throw new Ge.L(55);ke(n)}delete t.parent.P[t.name],e.P[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.P[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=Ee(t,e);for(r in n.P)throw new Ge.L(55);delete t.P[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.P)],symlink:(t,e,r)=>((t=pe.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new Ge.L(28);return t.link}},O:{read(t,e,r,n,i){var a=t.node.P;if(i>=t.node.V)return 0;if(8<(t=Math.min(t.node.V-i,n))&&a.subarray)e.set(a.subarray(i,i+t),r);else for(n=0;n<t;n++)e[r+n]=a[i+n];return t},write(t,e,r,n,i,a){if(e.buffer===v.buffer&&(a=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.P||t.P.subarray)){if(a)return t.P=e.subarray(r,r+n),t.V=n;if(0===t.V&&0===i)return t.P=e.slice(r,r+n),t.V=n;if(i+n<=t.V)return t.P.set(e.subarray(r,r+n),i),n}var s=t.P?t.P.length:0;if(s>=(a=i+n)||(a=Math.max(a,s*(1048576>s?2:1.125)>>>0),0!=s&&(a=Math.max(a,256)),s=t.P,t.P=new Uint8Array(a),0<t.V&&t.P.set(s.subarray(0,t.V),0)),t.P.subarray&&e.subarray)t.P.set(e.subarray(r,r+n),i);else for(a=0;a<n;a++)t.P[i+a]=e[r+a];return t.V=Math.max(t.V,i+n),n},$(t,e,r){if(1===r?e+=t.position:2===r&&Ge.isFile(t.node.mode)&&(e+=t.node.V),0>e)throw new Ge.L(28);return e},ua(t,e,r,n,i){if(!Ge.isFile(t.node.mode))throw new Ge.L(43);if(t=t.node.P,2&i||!t||t.buffer!==v.buffer){if(n=!0,N(),!(i=void 0))throw new Ge.L(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),v.set(t,i))}else n=!1,i=t.byteOffset;return{S:i,Gb:n}},za:(t,e,r,n)=>(pe.O.write(t,e,0,n,r,!1),0)}},we=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},me=0,ve=null,ye=()=>{if(me--,r.monitorRunDependencies?.(me),0==me&&ve){var t=ve;ve=null,t()}},ge=()=>{me++,r.monitorRunDependencies?.(me)},be=[],$e=async(t,e,r,n,i,a,s,h)=>{var l=e?ie(te(t+"/"+e)):t;ge();try{var c=r;"string"==typeof r&&(c=await(async t=>(t=await o(t),new Uint8Array(t)))(r)),c=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&_e(),be))if(r.canHandle(e))return r.handle(t,e);return t})(c,l),h?.(),a||Te(t,e,c,n,i,s)}finally{ye()}};function _e(){var t,e,n;Ge.Ka=!0,t??=r.stdin,e??=r.stdout,n??=r.stderr,t?Ge.na("/dev","stdin",t):Ge.symlink("/dev/tty","/dev/stdin"),e?Ge.na("/dev","stdout",null,e):Ge.symlink("/dev/tty","/dev/stdout"),n?Ge.na("/dev","stderr",null,n):Ge.symlink("/dev/tty1","/dev/stderr"),Ge.open("/dev/stdin",0),Ge.open("/dev/stdout",1),Ge.open("/dev/stderr",1)}function Ae(t,e){Ge.Xa[t]={O:e}}function Se(t){return 16384==(61440&t)}function Ee(t,e){var r=Se(t.mode)?(r=Ce(t,"x"))?r:t.N.lookup?0:2:54;if(r)throw new Ge.L(r);for(r=Ge.la[Pe(t.id,e)];r;r=r.sa)if(r.parent.id===t.id&&r.name===e)return r;return Ge.lookup(t,e)}function ke(t){var e=Pe(t.parent.id,t.name);if(Ge.la[e]===t)Ge.la[e]=t.sa;else for(e=Ge.la[e];e;){if(e.sa===t){e.sa=t.sa;break}e=e.sa}}function Te(t,e,r,n,i,a){var s=e;if(t&&(t="string"==typeof t?t:Oe(t),s=e?te(t+"/"+e):t),t=we(n,i),s=Ge.create(s,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,i=r.length;n<i;++n)e[n]=r.charCodeAt(n);r=e}Ge.chmod(s,146|t),e=Ge.open(s,577),Ge.write(e,r,0,r.length,0,a),Ge.close(e),Ge.chmod(s,t)}}function Le(t,e={}){if(!t)throw new Ge.L(44);e.Ca??(e.Ca=!0),"/"===t.charAt(0)||(t=Ge.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=Ge.root,i="/",a=0;a<t.length;a++){var s=a===t.length-1;if(s&&e.parent)break;if("."!==t[a])if(".."===t[a]){if(i=ee(i),Ge.Ma(n)){t=i+"/"+t.slice(a+1).join("/"),r--;continue t}n=n.parent}else{i=te(i+"/"+t[a]);try{n=Ee(n,t[a])}catch(t){if(44===t?.qa&&s&&e.yb)return{path:i};throw t}if(!n.ga||s&&!e.Ca||(n=n.ga.root),40960==(61440&n.mode)&&(!s||e.ea)){if(!n.N.readlink)throw new Ge.L(52);"/"===(n=n.N.readlink(n)).charAt(0)||(n=ee(i)+"/"+n),t=n+"/"+t.slice(a+1).join("/");continue t}}}return{path:i,node:n}}throw new Ge.L(32)}function Oe(t){for(var e;;){if(Ge.Ma(t))return t=t.T.cb,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function Pe(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%Ge.la.length}function Re(t){var e=Pe(t.parent.id,t.name);t.sa=Ge.la[e],Ge.la[e]=t}function Me(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function Ce(t,e){return Ge.$a?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function Ne(t,e){if(!Se(t.mode))return 54;try{return Ee(t,e),20}catch(t){}return Ce(t,"wx")}function Ue(t,e,r){try{var n=Ee(t,e)}catch(t){return t.qa}if(t=Ce(t,"wx"))return t;if(r){if(!Se(n.mode))return 54;if(Ge.Ma(n)||Oe(n)===Ge.cwd())return 10}else if(Se(n.mode))return 31;return 0}function xe(t,e){if(!t)throw new Ge.L(e);return t}function je(t){if(!(t=Ge.ub(t)))throw new Ge.L(8);return t}function Fe(t,e=-1){if(t=Object.assign(new Ge.jb,t),-1==e)t:{for(e=0;e<=Ge.kb;e++)if(!Ge.streams[e])break t;throw new Ge.L(33)}return t.fd=e,Ge.streams[e]=t}function Ve(t,e,r){var n=t?.O.ha;t=n?t:e,n??=e.N.ha,xe(n,63),n(t,r)}function De(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.ya)}return e}function ze(t){var e={Jb:4096,Vb:4096,blocks:1e6,Ib:5e5,Hb:5e5,files:Ge.Oa,Tb:Ge.Oa-1,Wb:42,flags:2,dc:255};return t.N.gb&&Object.assign(e,t.N.gb(t.T.zb.root)),e}function He(t,e,r){return void 0===r&&(r=e,e=438),Ge.ka(t,8192|e,r)}function We(t,e,r,n){Ve(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),Ya:n})}function Ie(t,e,r){if(Se(e.mode))throw new Ge.L(31);if(!Ge.isFile(e.mode))throw new Ge.L(28);var n=Ce(e,"w");if(n)throw new Ge.L(n);Ve(t,e,{size:r,timestamp:Date.now()})}function Be(t){if(!(t.wb||t.xb||t.link||t.P))if(globalThis.XMLHttpRequest)N("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{t.P=h(t.url)}catch(t){throw new Ge.L(29)}}var Ge={root:null,ya:[],Xa:{},streams:[],Oa:1,la:null,Va:"/",Ka:!1,$a:!0,qb:null,Fa:0,fb:{},L:class{name="ErrnoError";constructor(t){this.qa=t}},jb:class{ja={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.ja.flags}set flags(t){this.ja.flags=t}get position(){return this.ja.position}set position(t){this.ja.position=t}},ib:class{N={};O={};ga=null;constructor(t,e,r,n){t||=this,this.parent=t,this.T=t.T,this.id=Ge.Oa++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get xb(){return Se(this.mode)}get wb(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>(Re(t=new Ge.ib(t,e,r,n)),t),Ma:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),kb:4096,ub:t=>Ge.streams[t],Sb:(t,e=-1)=>(t=Fe(t,e),t.O?.Rb?.(t),t),mb:{open(t){t.O=Ge.sb(t.node.rdev).O,t.O.open?.(t)},$(){throw new Ge.L(70)}},Na:t=>t>>8,bc:t=>255&t,ra:(t,e)=>t<<8|e,sb:t=>Ge.Xa[t],hb(t,e){function r(t){return Ge.Fa--,e(t)}function n(t){if(t){if(!n.pb)return n.pb=!0,r(t)}else++s>=a.length&&r(null)}"function"==typeof t&&(e=t,t=!1),Ge.Fa++,1<Ge.Fa&&O(`warning: ${Ge.Fa} FS.syncfs operations in flight at once, probably just doing extra work`);var i,a=De(Ge.root.T),s=0;for(i of a)i.type.hb?i.type.hb(i,t,n):n(null)},T(t,e,r){var n="/"===r;if(n&&Ge.root)throw new Ge.L(10);if(!n&&r){var i=Le(r,{Ca:!1});if(r=i.path,(i=i.node).ga)throw new Ge.L(10);if(!Se(i.mode))throw new Ge.L(54)}return(t=t.T(e={type:t,zb:e,cb:r,ya:[]})).T=e,e.root=t,n?Ge.root=t:i&&(i.ga=e,i.T&&i.T.ya.push(e)),t},jc(t){if(!(t=Le(t,{Ca:!1})).node.ga)throw new Ge.L(28);var e=(t=t.node).ga,r=De(e);for([,i]of Object.entries(Ge.la))for(;i;){var n=i.sa;r.includes(i.T)&&ke(i);var i=n}t.ga=null,t.T.ya.splice(t.T.ya.indexOf(e),1)},lookup:(t,e)=>t.N.lookup(t,e),ka(t,e,r){var n=Le(t,{parent:!0}).node;if(!(t=re(t)))throw new Ge.L(28);if("."===t||".."===t)throw new Ge.L(20);var i=Ne(n,t);if(i)throw new Ge.L(i);if(!n.N.ka)throw new Ge.L(63);return n.N.ka(n,t,e,r)},gb:t=>ze(Le(t,{ea:!0}).node),hc:t=>ze(t.node),create:(t,e=438)=>Ge.ka(t,4095&e|32768,0),mkdir:(t,e=511)=>Ge.ka(t,1023&e|16384,0),cc(t,e){var r,n=t.split("/"),i="";for(r of n)if(r){(i||"/"===t.charAt(0))&&(i+="/"),i+=r;try{Ge.mkdir(i,e)}catch(t){if(20!=t.qa)throw t}}},symlink(t,e){if(!ie(t))throw new Ge.L(44);var r=Le(e,{parent:!0}).node;if(!r)throw new Ge.L(44);var n=Ne(r,e=re(e));if(n)throw new Ge.L(n);if(!r.N.symlink)throw new Ge.L(63);return r.N.symlink(r,e,t)},rename(t,e){var r=ee(t),n=ee(e),i=re(t),a=re(e),s=Le(t,{parent:!0}),o=s.node;if(s=(s=Le(e,{parent:!0})).node,!o||!s)throw new Ge.L(44);if(o.T!==s.T)throw new Ge.L(75);var h=Ee(o,i);if("."!==(t=ae(t,n)).charAt(0))throw new Ge.L(28);if("."!==(t=ae(e,r)).charAt(0))throw new Ge.L(55);try{var l=Ee(s,a)}catch(t){}if(h!==l){if(i=Ue(o,i,e=Se(h.mode)))throw new Ge.L(i);if(i=l?Ue(s,a,e):Ne(s,a))throw new Ge.L(i);if(!o.N.rename)throw new Ge.L(63);if(h.ga||l&&l.ga)throw new Ge.L(10);if(s!==o&&(i=Ce(o,"w")))throw new Ge.L(i);ke(h);try{o.N.rename(h,s,a),h.parent=s}catch(t){throw t}finally{Re(h)}}},rmdir(t){var e=Le(t,{parent:!0}).node,r=Ee(e,t=re(t)),n=Ue(e,t,!0);if(n)throw new Ge.L(n);if(!e.N.rmdir)throw new Ge.L(63);if(r.ga)throw new Ge.L(10);e.N.rmdir(e,t),ke(r)},readdir:t=>xe((t=Le(t,{ea:!0}).node).N.readdir,54)(t),unlink(t){var e=Le(t,{parent:!0}).node;if(!e)throw new Ge.L(44);var r=Ee(e,t=re(t)),n=Ue(e,t,!1);if(n)throw new Ge.L(n);if(!e.N.unlink)throw new Ge.L(63);if(r.ga)throw new Ge.L(10);e.N.unlink(e,t),ke(r)},readlink(t){if(!(t=Le(t).node))throw new Ge.L(44);if(!t.N.readlink)throw new Ge.L(28);return t.N.readlink(t)},stat:(t,e)=>xe((t=Le(t,{ea:!e}).node).N.fa,63)(t),fstat(t){var e=je(t);t=e.node;var r=e.O.fa;return e=r?e:t,r??=t.N.fa,xe(r,63),r(e)},lstat:t=>Ge.stat(t,!0),chmod(t,e,r){We(null,t="string"==typeof t?Le(t,{ea:!r}).node:t,e,r)},lchmod(t,e){Ge.chmod(t,e,!0)},fchmod(t,e){We(t=je(t),t.node,e,!1)},chown(t,e,r,n){Ve(null,t="string"==typeof t?Le(t,{ea:!n}).node:t,{timestamp:Date.now(),Ya:n})},lchown(t,e,r){Ge.chown(t,e,r,!0)},fchown(t){Ve(t=je(t),t.node,{timestamp:Date.now(),Ya:!1})},truncate(t,e){if(0>e)throw new Ge.L(28);Ie(null,t="string"==typeof t?Le(t,{ea:!0}).node:t,e)},Xb(t,e){if(t=je(t),0>e||!(2097155&t.flags))throw new Ge.L(28);Ie(t,t.node,e)},kc(t,e,r){xe((t=Le(t,{ea:!0}).node).N.ha,63)(t,{atime:e,mtime:r})},open(t,e,n=438){if(""===t)throw new Ge.L(44);if("string"==typeof e){var i={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===i)throw Error(`Unknown file open mode: ${e}`);e=i}if(n=64&e?4095&n|32768:0,"object"==typeof t)i=t;else{var a=t.endsWith("/");i=(t=Le(t,{ea:!(131072&e),yb:!0})).node,t=t.path}var s=!1;if(64&e)if(i){if(128&e)throw new Ge.L(20)}else{if(a)throw new Ge.L(31);i=Ge.ka(t,511|n,0),s=!0}if(!i)throw new Ge.L(44);if(8192==(61440&i.mode)&&(e&=-513),65536&e&&!Se(i.mode))throw new Ge.L(54);if(!s&&(a=i?40960==(61440&i.mode)?32:Se(i.mode)&&("r"!==Me(e)||576&e)?31:Ce(i,Me(e)):44))throw new Ge.L(a);return 512&e&&!s&&Ge.truncate(i,0),e&=-131713,(a=Fe({node:i,path:Oe(i),flags:e,seekable:!0,position:0,O:i.O,Fb:[],error:!1})).O.open&&a.O.open(a),s&&Ge.chmod(i,511&n),!r.logReadFiles||1&e||t in Ge.fb||(Ge.fb[t]=1),a},close(t){if(null===t.fd)throw new Ge.L(8);t.Ja&&(t.Ja=null);try{t.O.close&&t.O.close(t)}catch(t){throw t}finally{Ge.streams[t.fd]=null}t.fd=null},$(t,e,r){if(null===t.fd)throw new Ge.L(8);if(!t.seekable||!t.O.$)throw new Ge.L(70);if(0!=r&&1!=r&&2!=r)throw new Ge.L(28);return t.position=t.O.$(t,e,r),t.Fb=[],t.position},read(t,e,r,n,i){if(0>n||0>i)throw new Ge.L(28);if(null===t.fd)throw new Ge.L(8);if(1==(2097155&t.flags))throw new Ge.L(8);if(Se(t.node.mode))throw new Ge.L(31);if(!t.O.read)throw new Ge.L(28);var a=void 0!==i;if(a){if(!t.seekable)throw new Ge.L(70)}else i=t.position;return e=t.O.read(t,e,r,n,i),a||(t.position+=e),e},write(t,e,r,n,i,a){if(0>n||0>i)throw new Ge.L(28);if(null===t.fd)throw new Ge.L(8);if(!(2097155&t.flags))throw new Ge.L(8);if(Se(t.node.mode))throw new Ge.L(31);if(!t.O.write)throw new Ge.L(28);t.seekable&&1024&t.flags&&Ge.$(t,0,2);var s=void 0!==i;if(s){if(!t.seekable)throw new Ge.L(70)}else i=t.position;return e=t.O.write(t,e,r,n,i,a),s||(t.position+=e),e},ua(t,e,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&t.flags))throw new Ge.L(2);if(1==(2097155&t.flags))throw new Ge.L(2);if(!t.O.ua)throw new Ge.L(43);if(!e)throw new Ge.L(28);return t.O.ua(t,e,r,n,i)},za:(t,e,r,n,i)=>t.O.za?t.O.za(t,e,r,n,i):0,ab(t,e,r){if(!t.O.ab)throw new Ge.L(59);return t.O.ab(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding&&N(`Invalid encoding type "${e.encoding}"`);var r=Ge.open(t,e.flags);t=Ge.stat(t).size;var n=new Uint8Array(t);return Ge.read(r,n,0,t,0),"utf8"===e.encoding&&(n=se(n)),Ge.close(r),n},writeFile(t,e,r={}){r.flags=r.flags||577,t=Ge.open(t,r.flags,r.mode),"string"==typeof e&&(e=new Uint8Array(he(e))),ArrayBuffer.isView(e)?Ge.write(t,e,0,e.byteLength,void 0,r.Pb):N("Unsupported data type"),Ge.close(t)},cwd:()=>Ge.Va,chdir(t){if(null===(t=Le(t,{ea:!0})).node)throw new Ge.L(44);if(!Se(t.node.mode))throw new Ge.L(54);var e=Ce(t.node,"x");if(e)throw new Ge.L(e);Ge.Va=t.path},fc(){for(var t of(Ge.Ka=!1,Ge.streams))t&&Ge.close(t)},Ub(t,e){try{var r=Le(t,{ea:!e});t=r.path}catch(t){}var n=!1,i=null;try{r=Le(t,{parent:!0}),re(t),r=Le(t,{ea:!e}),n=!0,i=r.node}catch(t){}return n?i:null},na(t,e,r,n){var i;return t=((t,e)=>te(t+"/"+e))("string"==typeof t?t:Oe(t),e),e=we(!!r,!!n),(i=Ge.na).Na??(i.Na=64),Ae(i=Ge.ra(Ge.na.Na++,0),{open(t){t.seekable=!1},close(){n?.buffer?.length&&n(10)},read(t,e,n,i){for(var a=0,s=0;s<i;s++){try{var o=r()}catch(t){throw new Ge.L(29)}if(void 0===o&&0===a)throw new Ge.L(6);if(null==o)break;a++,e[n+s]=o}return a&&(t.node.atime=Date.now()),a},write(t,e,r,i){for(var a=0;a<i;a++)try{n(e[r+a])}catch(t){throw new Ge.L(29)}return i&&(t.node.mtime=t.node.ctime=Date.now()),a}}),He(t,e,i)}};if((()=>{let t=Q.prototype;Object.assign(t,{isAliasOf:function(t){if(!(this instanceof Q&&t instanceof Q))return!1;var e=this.M.U.R,r=this.M.S;t.M=t.M;var n=t.M.U.R;for(t=t.M.S;e.Z;)r=e.Ba(r),e=e.Z;for(;n.Z;)t=n.Ba(t),n=n.Z;return e===n&&r===t},clone:function(){if(this.M.S||Z(this),this.M.Aa)return this.M.count.value+=1,this;var t=K,e=Object,r=e.create,n=Object.getPrototypeOf(this),i=this.M;return(t=t(r.call(e,n,{M:{value:{count:i.count,xa:i.xa,Aa:i.Aa,S:i.S,U:i.U,X:i.X,aa:i.aa}}}))).M.count.value+=1,t.M.xa=!1,t},delete(){if(this.M.S||Z(this),this.M.xa&&!this.M.Aa)throw new B("Object already scheduled for deletion");J(this);var t=this.M;--t.count.value,0===t.count.value&&(t.X?t.aa.oa(t.X):t.U.R.oa(t.S)),this.M.Aa||(this.M.X=void 0,this.M.S=void 0)},isDeleted:function(){return!this.M.S},deleteLater:function(){if(this.M.S||Z(this),this.M.xa&&!this.M.Aa)throw new B("Object already scheduled for deletion");return this.M.xa=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)})(),Object.assign(wt.prototype,{tb(t){return this.eb&&(t=this.eb(t)),t},Wa(t){this.oa?.(t)},ma:ct,Y:function(t){function e(){return pt(this.R.ta,this.Ea?{U:this.Ab,S:r,aa:this,X:t}:{U:this,S:t})}var r=this.tb(t);if(!r)return this.Wa(t),null;var n=((t,e)=>{if(void 0===e)throw new B("ptr should not be undefined");for(;t.Z;)e=t.Ba(e),t=t.Z;return dt[e]})(this.R,r);if(void 0!==n)return 0===n.M.count.value?(n.M.S=r,n.M.X=t,n.clone()):(n=n.clone(),this.Wa(t),n);if(n=this.R.rb(r),!(n=et[n]))return e.call(this);var i=ut(r,this.R,(n=this.Da?n.nb:n.pointerType).R);return null===i?e.call(this):pt(n.R.ta,this.Ea?{U:n,S:i,aa:this,X:t}:{U:n,S:i})}}),Ge.Qb=(t,e,r,n,i,a,s,o,h,l)=>{$e(t,e,r,n,i,o,h,l).then(a).catch(s)},Ge.ec=$e,Ge.la=Array(4096),Ge.T(pe,{},"/"),Ge.mkdir("/tmp"),Ge.mkdir("/home"),Ge.mkdir("/home/web_user"),function(){Ge.mkdir("/dev"),Ae(Ge.ra(1,3),{read:()=>0,write:(t,e,r,n)=>n,$:()=>0}),He("/dev/null",Ge.ra(1,3)),ce(Ge.ra(5,0),de),ce(Ge.ra(6,0),fe),He("/dev/tty",Ge.ra(5,0)),He("/dev/tty1",Ge.ra(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(ne(t),e=t.byteLength),t[--e]);Ge.na("/dev","random",r),Ge.na("/dev","urandom",r),Ge.mkdir("/dev/shm"),Ge.mkdir("/dev/shm/tmp")}(),function(){Ge.mkdir("/proc");var t=Ge.mkdir("/proc/self");Ge.mkdir("/proc/self/fd"),Ge.T({T(){var e=Ge.createNode(t,"fd",16895,73);return e.O={$:pe.O.$},e.N={lookup(t,e){var r=je(t=+e);return(t={parent:null,T:{cb:"fake"},N:{readlink:()=>r.path},id:t+1}).parent=t},readdir:()=>Array.from(Ge.streams.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},{},"/proc/self/fd")}(),Ge.qb={MEMFS:pe},r.noExitRuntime&&(D=r.noExitRuntime),r.preloadPlugins&&(be=r.preloadPlugins),r.print&&(L=r.print),r.printErr&&(O=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=ge,r.removeRunDependency=ye,r.FS_preloadFile=$e,r.FS_unlink=(...t)=>Ge.unlink(...t),r.FS_createPath=(...t)=>function(t,e){for(t="string"==typeof t?t:Oe(t),e=e.split("/").reverse();e.length;){var r=e.pop();if(r){var n=te(t+"/"+r);try{Ge.mkdir(n)}catch(t){if(20!=t.qa)throw t}t=n}}return n}(...t),r.FS_createDevice=(...t)=>Ge.na(...t),r.FS=Ge,r.FS_createDataFile=(...t)=>Te(...t),r.FS_createLazyFile=(...t)=>function(t,e,r,n,a){class s{Ha=!1;ja=[];Ga=void 0;Ra=0;Qa=0;get(t){if(!(t>this.length-1||0>t)){var e=t%this.chunkSize;return this.Ga(t/this.chunkSize|0)[e]}}lb(t){this.Ga=t}Sa(){var t=new XMLHttpRequest;t.open("HEAD",r,!1),t.send(null),200<=t.status&&300>t.status||304===t.status||N("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),i=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e;t=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e;var a=1048576;i||(a=n);var s=this;s.lb(t=>{var e=t*a,i=(t+1)*a-1;if(i=Math.min(i,n-1),void 0===s.ja[t]){var o=s.ja;e>i&&N("invalid range ("+e+", "+i+") or no bytes requested!"),i>n-1&&N("only "+n+" bytes available! programmer error!");var h=new XMLHttpRequest;h.open("GET",r,!1),n!==a&&h.setRequestHeader("Range","bytes="+e+"-"+i),h.responseType="arraybuffer",h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send(null),200<=h.status&&300>h.status||304===h.status||N("Couldn't load "+r+". Status: "+h.status),e=void 0!==h.response?new Uint8Array(h.response||[]):he(h.responseText||""),o[t]=e}return void 0===s.ja[t]&&N("doXHR failed!"),s.ja[t]}),!t&&n||(a=n=1,a=n=this.Ga(0).length,L("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Ra=n,this.Qa=a,this.Ha=!0}get length(){return this.Ha||this.Sa(),this.Ra}get chunkSize(){return this.Ha||this.Sa(),this.Qa}}if(globalThis.XMLHttpRequest){i||N("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var o=new s,h=void 0}else h=r,o=void 0;var l=function(t,e,r,n){return t="string"==typeof t?t:Oe(t),e=te(t+"/"+e),Ge.create(e,we(r,n))}(t,e,n,a);o?l.P=o:h&&(l.P=null,l.url=h),Object.defineProperties(l,{V:{get:function(){return this.P.length}}}),t={};for(const[e,r]of Object.entries(l.O))t[e]=(...t)=>(Be(l),r(...t));return t.read=(t,e,r,n,i)=>{if(Be(l),i>=(t=t.node.P).length)e=0;else{if(n=Math.min(t.length-i,n),t.slice)for(var a=0;a<n;a++)e[r+a]=t[i+a];else for(a=0;a<n;a++)e[r+a]=t.get(i+a);e=n}return e},t.ua=()=>{throw Be(l),N(),new Ge.L(48)},l.O=t,l}(...t);var qe,Xe,Ze,Ye,Je,Ke,Qe,tr={v:()=>N(""),k:(t,e,r,n,i)=>{e=z(e);let a=t=>t;if(n=0n===n){const t=8*r;a=e=>BigInt.asUintN(t,e),i=a(i)}q(t,{name:e,Y:a,ba:(t,e)=>("number"==typeof e&&(e=BigInt(e)),e),ma:X(e,r,!n),da:null})},A:(t,e,r,n)=>{q(t,{name:e=z(e),Y:function(t){return!!t},ba:function(t,e){return e?r:n},ma:function(t){return this.Y(y[t])},da:null})},x:(t,e,r,n,i,a,s,o,h,l,c,u,d)=>{c=z(c),a=vt(i,a),o&&=vt(s,o),l&&=vt(h,l),d=vt(u,d);var f=(t=>{var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(c);nt(f,function(){$t(`Cannot construct ${c} due to unbound types`,[n])}),_t([t,e,r],n?[n]:[],e=>{if(e=e[0],n)var r=e.R,i=r.ta;else i=Q.prototype;e=tt(c,function(...t){if(Object.getPrototypeOf(this)!==s)throw new B(`Use 'new' to construct ${c}`);if(void 0===u.pa)throw new B(`${c} has no accessible constructor`);var e=u.pa[t.length];if(void 0===e)throw new B(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(u.pa).toString()}) parameters instead!`);return e.apply(this,t)});var s=Object.create(i,{constructor:{value:e}});e.prototype=s;var h,u=new it(c,e,s,d,r,a,o,l);return u.Z&&((h=u.Z).Ta??(h.Ta=[]),u.Z.Ta.push(u)),r=new wt(c,u,!0,!1,!1),h=new wt(c+"*",u,!1,!1,!1),i=new wt(c+" const*",u,!1,!0,!1),et[t]={pointerType:h,nb:i},mt(f,e),[r,h,i]})},n:(t,e,r,n,i,a)=>{var s=At(e,r);i=vt(n,i),_t([],[t],t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.R.pa&&(t.R.pa=[]),void 0!==t.R.pa[e-1])throw new B(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.R.pa[e-1]=()=>{$t(`Cannot construct ${t.name} due to unbound types`,s)},_t([],s,n=>(n.splice(1,0,null),t.R.pa[e-1]=kt(r,n,null,i,a),[])),[]})},b:(t,e,r,n,i,a,s,o,h)=>{var l=At(r,n);e=z(e),e=Tt(e),a=vt(i,a),_t([],[t],t=>{function n(){$t(`Cannot call ${i} due to unbound types`,l)}var i=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),o&&t.R.Bb.push(e);var c=t.R.ta,u=c[e];return void 0===u||void 0===u.W&&u.className!==t.name&&u.wa===r-2?(n.wa=r-2,n.className=t.name,c[e]=n):(rt(c,e,i),c[e].W[r-2]=n),_t([],l,n=>(n=kt(i,n,t,a,s,h),void 0===c[e].W?(n.wa=r-2,c[e]=n):c[e].W[r-2]=n,[])),[]})},y:t=>q(t,Ct),j:(t,e,r)=>{q(t,{name:e=z(e),Y:t=>t,ba:(t,e)=>e,ma:Nt(e,r),da:null})},l:(t,e,r,n,i,a,s)=>{var o=At(e,r);t=z(t),t=Tt(t),i=vt(n,i),nt(t,function(){$t(`Cannot call ${t} due to unbound types`,o)},e-1),_t([],o,r=>(r=[r[0],null].concat(r.slice(1)),mt(t,kt(t,r,null,i,a,s),e-1),[]))},c:(t,e,r,n,i)=>{e=z(e);let a=t=>t;if(0===n){var s=32-8*r;a=t=>t<<s>>>s,i=a(i)}q(t,{name:e,Y:a,ba:(t,e)=>e,ma:X(e,r,0!==n),da:null})},a:(t,e,r)=>{function n(t){return new i(v.buffer,_[t+4>>2],_[t>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];q(t,{name:r=z(r),Y:n,ma:n},{vb:!0})},z:(t,e)=>{q(t,{name:e=z(e),Y(t){var e=(e=t+4)?jt.decode(y.subarray(e,Ft(y,e,_[t>>2],!0))):"";return qe(t),e},ba(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;if(!(r||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT))throw new B("Cannot pass non-string to std::string");var n=r?xt(e):e.length,i=Xe(4+n+1),a=i+4;return _[i>>2]=n,r?Ut(e,y,a,n+1):y.set(e,a),null!==t&&t.push(qe,i),i},ma:ct,da(t){qe(t)}})},g:(t,e,r)=>{if(r=z(r),2===e)var n=Dt,i=zt,a=Ht;else n=Wt,i=It,a=Bt;q(t,{name:r,Y:t=>{var r=n(t+4,_[t>>2]*e,!0);return qe(t),r},ba:(t,n)=>{if("string"!=typeof n)throw new B(`Cannot pass non-string to C++ string type ${r}`);var s=a(n),o=Xe(4+s+e);return _[o>>2]=s/e,i(n,o+4,s+e),null!==t&&t.push(qe,o),o},ma:ct,da(t){qe(t)}})},h:t=>{q(t,Ct)},B:(t,e)=>{q(t,{bb:!0,name:e=z(e),Y:()=>{},ba:()=>{}})},q:()=>{D=!1,Gt=0},e:(t,e,r)=>{var[n,...i]=((t,e)=>{for(var r=Array(t),n=0;n<t;++n){var i=n,a=_[e+4*n>>2],s=W[a];if(void 0===s)throw t=`parameter ${n} has unknown type ${bt(a)}`,new B(t);r[i]=s}return r})(t,e);e=n.ba.bind(n);var a=i.map(t=>t.ma.bind(t));t--;var s={toValue:Rt};switch(t=a.map((t,e)=>{var r=`argFromPtr${e}`;return s[r]=t,`${r}(args${e?"+"+8*e:""})`}),r){case 0:var o="toValue(handle)";break;case 2:o="new (toValue(handle))";break;case 3:o="";break;case 1:s.getStringOrSymbol=Yt,o="toValue(handle)[getStringOrSymbol(methodName)]"}return o+=`(${t})`,n.bb||(s.toReturnWire=e,s.emval_returnValue=Xt,o=`return emval_returnValue(toReturnWire, destructorsRef, ${o})`),o=`return function (handle, methodName, destructorsRef, args) {\n ${o}\n }`,r=new Function(Object.keys(s),o)(...Object.values(s)),o=`methodCaller<(${i.map(t=>t.name)}) => ${n.name}>`,(t=>{var e=qt.length;return qt.push(t),e})(tt(o,r))},o:Pt,C:t=>t?(t=Yt(t),Mt(globalThis[t])):Mt(globalThis),f:(t,e)=>(t=Rt(t),e=Rt(e),Mt(t[e])),i:t=>{9<t&&(Ot[t+1]+=1)},d:(t,e,r,n,i)=>qt[t](e,r,n,i),D:t=>Mt(Yt(t)),m:t=>{var e=Rt(t);St(e),Pt(t)},r:(t,e)=>{if(Jt[t]&&(clearTimeout(Jt[t].id),delete Jt[t]),!e)return 0;var r=setTimeout(()=>{delete Jt[t],(t=>{if(!P)try{if(t(),!(D||0<Gt))try{p=t=p,Kt(t)}catch(t){t instanceof U||"unwind"==t||l(1,t)}}catch(t){t instanceof U||"unwind"==t||l(1,t)}})(()=>Ye(t,performance.now()))},e);return Jt[t]={id:r,ic:e},0},w:t=>{var e=y.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=e*(1+.2/r);n=Math.min(n,t+100663296);t:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(t,n)/65536))-Je.buffer.byteLength+65535)/65536|0;try{Je.grow(n),C();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},u:function(t){try{var e=je(t);return Ge.close(e),0}catch(t){if(void 0===Ge||"ErrnoError"!==t.name)throw t;return t.qa}},s:function(t,e,r,n){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{if(isNaN(e))return 61;var i=je(t);return Ge.$(i,e,r),E[n>>3]=BigInt(i.position),i.Ja&&0===e&&0===r&&(i.Ja=null),0}catch(t){if(void 0===Ge||"ErrnoError"!==t.name)throw t;return t.qa}},t:function(t,e,r,n){try{t:{var i=je(t);t=e;for(var a,s=e=0;s<r;s++){var o=_[t>>2],h=_[t+4>>2];t+=8;var l=Ge.write(i,v,o,h,a);if(0>l){var c=-1;break t}if(e+=l,l<h)break;void 0!==a&&(a+=l)}c=e}return _[n>>2]=c,0}catch(t){if(void 0===Ge||"ErrnoError"!==t.name)throw t;return t.qa}},p:Kt};return Qe=await async function(){function t(t){return t=Qe=t.exports,qe=t.G,Xe=t.H,Ze=t.I,Ye=t.J,Je=t.E,Ke=t.K,C(),Qe}var e={a:tr};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(e,(e,r)=>{n(t(e))})}):(T??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",u):u+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,t((await async function(t){var e=T;if(!f&&!R(e)&&!a)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){O(`wasm streaming compile failed: ${t}`),O("falling back to ArrayBuffer instantiation")}return async function(t,e){try{var r=await async function(t){if(!f)try{var e=await o(t);return new Uint8Array(e)}catch{}if(t==T&&f)t=new Uint8Array(f);else{if(!h)throw"both async and sync fetching of the wasm failed";t=h(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){O(`failed to asynchronously prepare wasm: ${t}`),N(t)}}(e,t)}(e)).instance))}(),function t(){function e(){if(r.calledRun=!0,!P){if(M=!0,r.noFSInit||Ge.Ka||_e(),Qe.F(),Ge.$a=!1,w?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();j.push(t)}x(j)}}if(0<me)ve=t;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)V();x(F),0<me?ve=t:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),e()},1)):e()}}(),e=M?r:new Promise((t,e)=>{w=t,m=e}),e}({locateFile:(t,e)=>t.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":e+t})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const t=this.config?.renderer||"sw";if(await(async t=>{if("wg"===t){for(;"requested"===pt;)await ft(100);if("initialized"!==pt&&(pt="requested",ct))for(;;)switch(ct.init()){case 0:return void(pt="initialized");case 1:return void(pt="failed");case 2:await ft(100)}}})(t),"failed"===pt)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ct.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:t,right:e,top:r,bottom:n}=this.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight;let s=0,o=0,h=this.canvas.width,l=this.canvas.height;t<0&&(s=Math.abs(t),h-=s),r<0&&(o=Math.abs(r),l-=o),e>i&&(h-=e-i),n>a&&(l-=n-a),this.TVG.viewport(s,o,h,l)}_observerCallback(t){const e=t[0],r=e.target;r._observable=e.isIntersecting,e.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(t){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(t){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(t,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const t=1+.75*(window.devicePixelRatio-1),{width:e,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=e*t,this.canvas.height=r*t}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const t=this.TVG.render(),e=new Uint8ClampedArray(t,0,t.byteLength);e.length<1||(this._imageData=new ImageData(e,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const t=this.TVG.duration(),e=Date.now()/1e3;if(this.currentFrame=(e-this._beginTime)/t*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const t=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||t&&this._counter<t)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ft(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(t){this.TVG&&(this.pause(),this.currentFrame=t,this.TVG.frame(t))}async load(t,e="json"){try{await this._init();const r=await(async(t,e)=>{const r=new TextEncoder;let n=t;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===e||"lot"===e)return n=await(async t=>{try{t=JSON.parse(t)}catch(e){const r=await(async t=>{if("string"!=typeof t)throw new Error("The url value must be a string");try{const e=new URL(t),r=await fetch(e.toString());return await r.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(t);t=JSON.stringify(r)}return t})(n),r.encode(n);const t=await(async t=>(await fetch(t)).arrayBuffer())(n);return new Uint8Array(t);default:throw new Error("Invalid src type")}})(t,e);this.dispatchEvent(new CustomEvent("ready")),this.fileType=e,await this._loadBytes(r)}catch(t){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(this.totalFrame=this.TVG.totalFrame(),this.totalFrame<1||(this._beginTime=Date.now()/1e3,"playing"===this.currentState))))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(t){this._frame(t),await this._update(),this._render()}resize(t,e){this.canvas.width=t,this.canvas.height=e,"playing"!==this.currentState&&this._render()}destroy(){this.TVG&&(this.TVG.delete(),this.TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ct&&(ct.term(),ct=null)}setLooping(t){this.TVG&&(this.loop=t)}setDirection(t){this.TVG&&(this.direction=t)}setSpeed(t){this.TVG&&(this.speed=t)}setBgColor(t){this.TVG&&(this.canvas.style.backgroundColor=t)}setQuality(t){this.TVG&&this.TVG.quality(t)&&"playing"!==this.currentState&&this._render()}setAssetResolver(t,e){this._assetResolverCallback=t,this._assetResolverData=e,this.TVG&&this.TVG.setAssetResolver(t,e)}getVersion(){return{THORVG_VERSION:"1.0.2"}}render(){return W`
|
|
2
2
|
<canvas class="thorvg" style="width: 100%; height: 100%;" />
|
|
3
3
|
`}}function mt(t,e,r,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(i=t[o])&&(s=(a<3?i(s):a>3?i(e,r,s):i(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s}lt([A({type:String})],wt.prototype,"src",void 0),lt([A({type:String})],wt.prototype,"wasmUrl",void 0),lt([A({type:dt})],wt.prototype,"fileType",void 0),lt([A({type:Number})],wt.prototype,"speed",void 0),lt([A({type:Boolean})],wt.prototype,"autoPlay",void 0),lt([A({type:Number})],wt.prototype,"count",void 0),lt([A({type:Boolean})],wt.prototype,"loop",void 0),lt([A({type:Number})],wt.prototype,"direction",void 0),lt([A()],wt.prototype,"mode",void 0),lt([A()],wt.prototype,"intermission",void 0),lt([A({type:Number})],wt.prototype,"totalFrame",void 0),lt([A({type:Number})],wt.prototype,"currentFrame",void 0),lt([A({type:Number})],wt.prototype,"currentState",void 0),lt([A({type:Float32Array})],wt.prototype,"size",null);class vt extends wt{set renderConfig(t){this.config={renderer:"sw",enableDevicePixelRatio:t.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}mt([A({type:Object})],vt.prototype,"renderConfig",null),vt=mt([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("lottie-player")],vt);var yt=Object.freeze({__proto__:null});export{vt as LottiePresetPlayer};
|
|
4
4
|
//# sourceMappingURL=lottie-player.esm.js.map
|