@thorvg/lottie-player 1.0.0-pre.21 → 1.0.0-pre.23
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/lottie-player.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["lottie-player"]={})}(this,(function(e){"use strict";var r="undefined"!=typeof document?document.currentScript:null;const t=globalThis,n=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new WeakMap;let i=class{constructor(e,r,t){if(this._$cssResult$=!0,t!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(n&&void 0===e){const t=void 0!==r&&1===r.length;t&&(e=a.get(r)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&a.set(r,e))}return e}toString(){return this.cssText}};const s=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let r="";for(const t of e.cssRules)r+=t.cssText;return(e=>new i("string"==typeof e?e:e+"",void 0,o))(r)})(e):e,{is:u,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:f,getPrototypeOf:m}=Object,p=globalThis,h=p.trustedTypes,g=h?h.emptyScript:"",v=p.reactiveElementPolyfillSupport,y=(e,r)=>e,b={toAttribute(e,r){switch(r){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,r){let t=e;switch(r){case Boolean:t=null!==e;break;case Number:t=null===e?null:Number(e);break;case Object:case Array:try{t=JSON.parse(e)}catch(e){t=null}}return t}},w=(e,r)=>!u(e,r),_={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=_){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const t=Symbol(),n=this.getPropertyDescriptor(e,t,r);void 0!==n&&l(this.prototype,e,n)}}static getPropertyDescriptor(e,r,t){const{get:n,set:o}=c(this.prototype,e)??{get(){return this[r]},set(e){this[r]=e}};return{get(){return n?.call(this)},set(r){const a=n?.call(this);o.call(this,r),this.requestUpdate(e,a,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,r=[...d(e),...f(e)];for(const t of r)this.createProperty(t,e[t])}const e=this[Symbol.metadata];if(null!==e){const r=litPropertyMetadata.get(e);if(void 0!==r)for(const[e,t]of r)this.elementProperties.set(e,t)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const t=new Set(e.flat(1/0).reverse());for(const e of t)r.unshift(s(e))}else void 0!==e&&r.push(s(e));return r}static _$Eu(e,r){const t=r.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const t of r.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,r)=>{if(n)e.adoptedStyleSheets=r.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of r){const r=document.createElement("style"),o=t.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=n.cssText,e.appendChild(r)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,t){this._$AK(e,t)}_$EC(e,r){const t=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,t);if(void 0!==n&&!0===t.reflect){const o=(void 0!==t.converter?.toAttribute?t.converter:b).toAttribute(r,t.type);this._$Em=e,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,r){const t=this.constructor,n=t._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=t.getPropertyOptions(n),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:b;this._$Em=n,this[n]=o.fromAttribute(r,e.type),this._$Em=null}}requestUpdate(e,r,t){if(void 0!==e){if(t??=this.constructor.getPropertyOptions(e),!(t.hasChanged??w)(this[e],r))return;this.P(e,r,t)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,r,t){this._$AL.has(e)||this._$AL.set(e,r),!0===t.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,r]of this._$Ep)this[e]=r;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[r,t]of e)!0!==t.wrapped||this._$AL.has(r)||void 0===this[r]||this.P(r,this[r],t)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(r)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[y("elementProperties")]=new Map,x[y("finalized")]=new Map,v?.({ReactiveElement:x}),(p.reactiveElementVersions??=[]).push("2.0.4");const E=globalThis,S=E.trustedTypes,P=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,A="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+$,T=`<${C}>`,k=document,B=()=>k.createComment(""),F=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,L="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,U=/>/g,I=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,V=/"/g,N=/^(?:script|style|textarea|title)$/i,z=(e,...r)=>({_$litType$:1,strings:e,values:r}),j=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),W=new WeakMap,H=k.createTreeWalker(k,129);function q(e,r){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(r):r}class X{constructor({strings:e,_$litType$:r},t){let n;this.parts=[];let o=0,a=0;const i=e.length-1,s=this.parts,[u,l]=((e,r)=>{const t=e.length-1,n=[];let o,a=2===r?"<svg>":3===r?"<math>":"",i=O;for(let r=0;r<t;r++){const t=e[r];let s,u,l=-1,c=0;for(;c<t.length&&(i.lastIndex=c,u=i.exec(t),null!==u);)c=i.lastIndex,i===O?"!--"===u[1]?i=R:void 0!==u[1]?i=U:void 0!==u[2]?(N.test(u[2])&&(o=RegExp("</"+u[2],"g")),i=I):void 0!==u[3]&&(i=I):i===I?">"===u[0]?(i=o??O,l=-1):void 0===u[1]?l=-2:(l=i.lastIndex-u[2].length,s=u[1],i=void 0===u[3]?I:'"'===u[3]?V:M):i===V||i===M?i=I:i===R||i===U?i=O:(i=I,o=void 0);const d=i===I&&e[r+1].startsWith("/>")?" ":"";a+=i===O?t+T:l>=0?(n.push(s),t.slice(0,l)+A+t.slice(l)+$+d):t+$+(-2===l?r:d)}return[q(e,a+(e[t]||"<?>")+(2===r?"</svg>":3===r?"</math>":"")),n]})(e,r);if(this.el=X.createElement(u,t),H.currentNode=this.el.content,2===r||3===r){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=H.nextNode())&&s.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(A)){const r=l[a++],t=n.getAttribute(e).split($),i=/([.?@])?(.*)/.exec(r);s.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?Y:"?"===i[1]?ee:"@"===i[1]?re:K}),n.removeAttribute(e)}else e.startsWith($)&&(s.push({type:6,index:o}),n.removeAttribute(e));if(N.test(n.tagName)){const e=n.textContent.split($),r=e.length-1;if(r>0){n.textContent=S?S.emptyScript:"";for(let t=0;t<r;t++)n.append(e[t],B()),H.nextNode(),s.push({type:2,index:++o});n.append(e[r],B())}}}else if(8===n.nodeType)if(n.data===C)s.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf($,e+1));)s.push({type:7,index:o}),e+=$.length-1}o++}}static createElement(e,r){const t=k.createElement("template");return t.innerHTML=e,t}}function Q(e,r,t=e,n){if(r===j)return r;let o=void 0!==n?t.o?.[n]:t.l;const a=F(r)?void 0:r._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(e),o._$AT(e,t,n)),void 0!==n?(t.o??=[])[n]=o:t.l=o),void 0!==o&&(r=Q(e,o._$AS(e,r.values),o,n)),r}class Z{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:t}=this._$AD,n=(e?.creationScope??k).importNode(r,!0);H.currentNode=n;let o=H.nextNode(),a=0,i=0,s=t[0];for(;void 0!==s;){if(a===s.index){let r;2===s.type?r=new J(o,o.nextSibling,this,e):1===s.type?r=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(r=new te(o,this,e)),this._$AV.push(r),s=t[++i]}a!==s?.index&&(o=H.nextNode(),a++)}return H.currentNode=k,n}p(e){let r=0;for(const t of this._$AV)void 0!==t&&(void 0!==t.strings?(t._$AI(e,t,r),r+=t.strings.length-2):t._$AI(e[r])),r++}}class J{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,r,t,n){this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=t,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return void 0!==r&&11===e?.nodeType&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Q(this,e,r),F(e)?e===G||null==e||""===e?(this._$AH!==G&&this._$AR(),this._$AH=G):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==G&&F(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){const{values:r,_$litType$:t}=e,n="number"==typeof t?this._$AC(e):(void 0===t.el&&(t.el=X.createElement(q(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===n)this._$AH.p(r);else{const e=new Z(n,this),t=e.u(this.options);e.p(r),this.T(t),this._$AH=e}}_$AC(e){let r=W.get(e.strings);return void 0===r&&W.set(e.strings,r=new X(e)),r}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let t,n=0;for(const o of e)n===r.length?r.push(t=new J(this.O(B()),this.O(B()),this,this.options)):t=r[n],t._$AI(o),n++;n<r.length&&(this._$AR(t&&t._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class K{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,t,n,o){this.type=1,this._$AH=G,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=o,t.length>2||""!==t[0]||""!==t[1]?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=G}_$AI(e,r=this,t,n){const o=this.strings;let a=!1;if(void 0===o)e=Q(this,e,r,0),a=!F(e)||e!==this._$AH&&e!==j,a&&(this._$AH=e);else{const n=e;let i,s;for(e=o[0],i=0;i<o.length-1;i++)s=Q(this,n[t+i],r,i),s===j&&(s=this._$AH[i]),a||=!F(s)||s!==this._$AH[i],s===G?e=G:e!==G&&(e+=(s??"")+o[i+1]),this._$AH[i]=s}a&&!n&&this.j(e)}j(e){e===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Y extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===G?void 0:e}}class ee extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==G)}}class re extends K{constructor(e,r,t,n,o){super(e,r,t,n,o),this.type=5}_$AI(e,r=this){if((e=Q(this,e,r,0)??G)===j)return;const t=this._$AH,n=e===G&&t!==G||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,o=e!==G&&(t===G||n);n&&this.element.removeEventListener(this.name,this,t),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class te{constructor(e,r,t){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}}const ne=E.litHtmlPolyfillSupport;ne?.(X,J),(E.litHtmlVersions??=[]).push("3.2.0");class oe extends x{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,r,t)=>{const n=t?.renderBefore??r;let o=n._$litPart$;if(void 0===o){const e=t?.renderBefore??null;n._$litPart$=o=new J(r.insertBefore(B(),e),e,void 0,t??{})}return o._$AI(e),o})(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return j}}oe._$litElement$=!0,oe.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:oe});const ae=globalThis.litElementPolyfillSupport;ae?.({LitElement:oe}),(globalThis.litElementVersions??=[]).push("4.1.0");const ie={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w},se=(e=ie,r,t)=>{const{kind:n,metadata:o}=t;let a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(t.name,e),"accessor"===n){const{name:n}=t;return{set(t){const o=r.get.call(this);r.set.call(this,t),this.requestUpdate(n,o,e)},init(r){return void 0!==r&&this.P(n,void 0,e),r}}}if("setter"===n){const{name:n}=t;return function(t){const o=this[n];r.call(this,t),this.requestUpdate(n,o,e)}}throw Error("Unsupported decorator location: "+n)};function ue(e){return(r,t)=>"object"==typeof t?se(e,r,t):((e,r,t)=>{const n=r.hasOwnProperty(t);return r.constructor.createProperty(t,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(r,t):void 0})(e,r,t)}for(var le,ce=[],de=0;de<256;++de)ce.push((de+256).toString(16).slice(1));var fe=new Uint8Array(16);function me(){if(!le&&!(le="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(fe)}var pe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function he(e,r,t){if(pe.randomUUID&&!r&&!e)return pe.randomUUID();var n=(e=e||{}).random||(e.rng||me)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,r=0){return(ce[e[r+0]]+ce[e[r+1]]+ce[e[r+2]]+ce[e[r+3]]+"-"+ce[e[r+4]]+ce[e[r+5]]+"-"+ce[e[r+6]]+ce[e[r+7]]+"-"+ce[e[r+8]]+ce[e[r+9]]+"-"+ce[e[r+10]]+ce[e[r+11]]+ce[e[r+12]]+ce[e[r+13]]+ce[e[r+14]]+ce[e[r+15]]).toLowerCase()}(n)}var ge,ve=(ge="undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href,async function(e={}){var t,n,o=e,a=new Promise(((e,r)=>{t=e,n=r})),i="object"==typeof window,s="undefined"!=typeof WorkerGlobalScope,u="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type;if(u){const{createRequire:e}=await Promise.resolve().then((function(){return De}));var l=e("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href)}var c,d,f={...o},m="./this.program",p=(e,r)=>{throw r},h="";if(u){var g=l("fs"),v=l("path");("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href).startsWith("data:")||(h=v.dirname(l("url").fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href))+"/"),d=e=>(e=L(e)?new URL(e):e,g.readFileSync(e)),c=async(e,r=!0)=>(e=L(e)?new URL(e):e,g.readFileSync(e,r?void 0:"utf8")),!o.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r}}else(i||s)&&(s?h=self.location.href:"undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),ge&&(h=ge),h=h.startsWith("blob:")?"":h.slice(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(d=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),c=async e=>{if(L(e))return new Promise(((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)}));var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)});var y=o.print||void 0,b=o.printErr||void 0;Object.assign(o,f),f=null,o.thisProgram&&(m=o.thisProgram);var w,_,x,E,S,P,A,$,C,T,k,B,F=o.wasmBinary,D=!1,L=e=>e.startsWith("file://");function O(){var e=w.buffer;o.HEAP8=x=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=E=new Uint8Array(e),o.HEAPU16=P=new Uint16Array(e),o.HEAP32=A=new Int32Array(e),o.HEAPU32=$=new Uint32Array(e),o.HEAPF32=C=new Float32Array(e),o.HEAPF64=B=new Float64Array(e),o.HEAP64=T=new BigInt64Array(e),o.HEAPU64=k=new BigUint64Array(e)}var R,U=0,I=null;function M(e){U++,o.monitorRunDependencies?.(U)}function V(e){if(U--,o.monitorRunDependencies?.(U),0==U&&I){var r=I;I=null,r()}}function N(e){o.onAbort?.(e),b(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}class z{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var j,G=e=>{for(;e.length>0;)e.shift()(o)},W=[],H=[],q=o.noExitRuntime||!0,X=e=>it(e),Q=()=>ut(),Z="undefined"!=typeof TextDecoder?new TextDecoder:void 0,J=(e,r=0,t=NaN)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Z)return Z.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var u=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var l=i-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},K=(e,r)=>e?J(E,e,r):"",Y=()=>{var e=A[+ve.varargs>>2];return ve.varargs+=4,e},ee=Y,re={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=re.isAbs(e),t="/"===e.slice(-1);return e=re.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"),e||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=re.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.slice(0,-1)),t+n):"."},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>re.normalize(e.join("/")),join2:(e,r)=>re.normalize(e+"/"+r)},te=e=>{(te=(()=>{if(u){var e=l("crypto");return r=>e.randomFillSync(r)}return e=>crypto.getRandomValues(e)})())(e)},ne={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:he.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=re.isAbs(o)}return r=re.normalizeArray(r.split("/").filter((e=>!!e)),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ne.resolve(e).slice(1),r=ne.resolve(r).slice(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},oe=[],ae=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},ie=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o},se=(e,r,t)=>{var n=ae(e)+1,o=new Array(n),a=ie(e,o,0,o.length);return o.length=a,o},ue={ttys:[],init(){},shutdown(){},register(e,r){ue.ttys[e]={input:[],output:[],ops:r},he.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var r=ue.ttys[e.node.rdev];if(!r)throw new he.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new he.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new he.ErrnoError(29)}if(void 0===s&&0===a)throw new he.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new he.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new he.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!oe.length){var e=null;if(u){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}t>0&&(e=r.slice(0,t).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;oe=se(e)}return oe.shift()})(),put_char(e,r){null===r||10===r?(y(J(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(y(J(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(b(J(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(b(J(e.output)),e.output=[])}}},le=e=>{N()},ce={ops_table:null,mount:e=>ce.createNode(null,"/",16895,0),createNode(e,r,t,n){if(he.isBlkdev(t)||he.isFIFO(t))throw new he.ErrnoError(63);ce.ops_table||={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:he.chrdev_stream_ops}};var o=he.createNode(e,r,t,n);return he.isDir(o.mode)?(o.node_ops=ce.ops_table.dir.node,o.stream_ops=ce.ops_table.dir.stream,o.contents={}):he.isFile(o.mode)?(o.node_ops=ce.ops_table.file.node,o.stream_ops=ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):he.isLink(o.mode)?(o.node_ops=ce.ops_table.link.node,o.stream_ops=ce.ops_table.link.stream):he.isChrdev(o.mode)&&(o.node_ops=ce.ops_table.chrdev.node,o.stream_ops=ce.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=he.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,r.size=he.isDir(e.mode)?4096:he.isFile(e.mode)?e.usedBytes:he.isLink(e.mode)?e.link.length:0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])null!=r[t]&&(e[t]=r[t]);void 0!==r.size&&ce.resizeFileStorage(e,r.size)},lookup(e,r){throw ce.doesNotExistError},mknod:(e,r,t,n)=>ce.createNode(e,r,t,n),rename(e,r,t){var n;try{n=he.lookupNode(r,t)}catch(e){}if(n){if(he.isDir(e.mode))for(var o in n.contents)throw new he.ErrnoError(55);he.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=he.lookupNode(e,r);for(var n in t.contents)throw new he.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.contents)],symlink(e,r,t){var n=ce.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!he.isLink(e.mode))throw new he.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===x.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.mtime=i.ctime=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(ce.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&he.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new he.ErrnoError(28);return n},mmap(e,r,t,n,o){if(!he.isFile(e.node.mode))throw new he.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==x.buffer){if(i=!0,!(a=le()))throw new he.ErrnoError(48);s&&((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),x.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(ce.stream_ops.write(e,r,0,n,t,!1),0)}},de=(e,r,t,n,o,a)=>{he.createDataFile(e,r,t,n,o,a)},fe=o.preloadPlugins||[],me=(e,r,t,n,o,a,i,s,u,l)=>{var d=r?ne.resolve(re.join2(e,r)):e;function f(t){function c(t){l?.(),s||de(e,r,t,n,o,u),a?.(),V()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return fe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,c,(()=>{i?.(),V()}))||c(t)}M(),"string"==typeof t?(async e=>{var r=await c(e);return new Uint8Array(r)})(t).then(f,i):f(t)},pe=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},he={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=he.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return he.isDir(this.mode)}get isDevice(){return he.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new he.ErrnoError(44);r.follow_mount??=!0,re.isAbs(e)||(e=he.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter((e=>!!e)),o=he.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&r.parent)break;if("."!==n[i])if(".."!==n[i]){a=re.join2(a,n[i]);try{o=he.lookupNode(o,n[i])}catch(e){if(44===e?.errno&&s&&r.noent_okay)return{path:a};throw e}if(!he.isMountpoint(o)||s&&!r.follow_mount||(o=o.mounted.root),he.isLink(o.mode)&&(!s||r.follow)){if(!o.node_ops.readlink)throw new he.ErrnoError(52);var u=o.node_ops.readlink(o);re.isAbs(u)||(u=re.dirname(a)+"/"+u),e=u+"/"+n.slice(i+1).join("/");continue e}}else a=re.dirname(a),o=o.parent}return{path:a,node:o}}throw new he.ErrnoError(32)},getPath(e){for(var r;;){if(he.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%he.nameTable.length},hashAddNode(e){var r=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[r],he.nameTable[r]=e},hashRemoveNode(e){var r=he.hashName(e.parent.id,e.name);if(he.nameTable[r]===e)he.nameTable[r]=e.name_next;else for(var t=he.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=he.mayLookup(e);if(t)throw new he.ErrnoError(t);for(var n=he.hashName(e.id,r),o=he.nameTable[n];o;o=o.name_next)if(o.parent.id===e.id&&o.name===r)return o;return he.lookup(e,r)},createNode(e,r,t,n){var o=new he.FSNode(e,r,t,n);return he.hashAddNode(o),o},destroyNode(e){he.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>he.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>he.isDir(e.mode)?he.nodePermissions(e,"x")||(e.node_ops.lookup?0:2):54,mayCreate(e,r){if(!he.isDir(e.mode))return 54;try{return he.lookupNode(e,r),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=he.lookupNode(e,r)}catch(e){return e.errno}var o=he.nodePermissions(e,"wx");if(o)return o;if(t){if(!he.isDir(n.mode))return 54;if(he.isRoot(n)||he.getPath(n)===he.cwd())return 10}else if(he.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(r)||576&r)?31:he.nodePermissions(e,he.flagsToPermissionString(r)):44,checkOpExists(e,r){if(!e)throw new he.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=he.MAX_OPEN_FDS;e++)if(!he.streams[e])return e;throw new he.ErrnoError(33)},getStreamChecked(e){var r=he.getStream(e);if(!r)throw new he.ErrnoError(8);return r},getStream:e=>he.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new he.FSStream,e),-1==r&&(r=he.nextfd()),e.fd=r,he.streams[r]=e,e),closeStream(e){he.streams[e]=null},dupStream(e,r=-1){var t=he.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,o=n?e:r;n??=r.node_ops.setattr,he.checkOpExists(n,63),n(o,t)},chrdev_stream_ops:{open(e){var r=he.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){he.devices[e]={stream_ops:r}},getDevice:e=>he.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),he.syncFSRequests++,he.syncFSRequests>1&&b(`warning: ${he.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=he.getMounts(he.root.mount),n=0;function o(e){return he.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&he.root)throw new he.ErrnoError(10);if(!o&&!a){var i=he.lookupPath(t,{follow_mount:!1});if(t=i.path,he.isMountpoint(n=i.node))throw new he.ErrnoError(10);if(!he.isDir(n.mode))throw new he.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?he.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(r.node))throw new he.ErrnoError(28);var t=r.node,n=t.mounted,o=he.getMounts(n);Object.keys(he.nameTable).forEach((e=>{for(var r=he.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&he.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=he.lookupPath(e,{parent:!0}).node,o=re.basename(e);if(!o)throw new he.ErrnoError(28);if("."===o||".."===o)throw new he.ErrnoError(20);var a=he.mayCreate(n,o);if(a)throw new he.ErrnoError(a);if(!n.node_ops.mknod)throw new he.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},statfs:e=>he.statfsNode(he.lookupPath(e,{follow:!0}).node),statfsStream:e=>he.statfsNode(e.node),statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:he.nextInode,ffree:he.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create:(e,r=438)=>(r&=4095,he.mknod(e,r|=32768,0)),mkdir:(e,r=511)=>(r&=1023,he.mknod(e,r|=16384,0)),mkdirTree(e,r){var t=e.split("/"),n="";for(var o of t)if(o){(n||re.isAbs(e))&&(n+="/"),n+=o;try{he.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),he.mknod(e,r|=8192,t)),symlink(e,r){if(!ne.resolve(e))throw new he.ErrnoError(44);var t=he.lookupPath(r,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var n=re.basename(r),o=he.mayCreate(t,n);if(o)throw new he.ErrnoError(o);if(!t.node_ops.symlink)throw new he.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=re.dirname(e),a=re.dirname(r),i=re.basename(e),s=re.basename(r);if(t=he.lookupPath(e,{parent:!0}).node,n=he.lookupPath(r,{parent:!0}).node,!t||!n)throw new he.ErrnoError(44);if(t.mount!==n.mount)throw new he.ErrnoError(75);var u,l=he.lookupNode(t,i),c=ne.relative(e,a);if("."!==c.charAt(0))throw new he.ErrnoError(28);if("."!==(c=ne.relative(r,o)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(n,s)}catch(e){}if(l!==u){var d=he.isDir(l.mode),f=he.mayDelete(t,i,d);if(f)throw new he.ErrnoError(f);if(f=u?he.mayDelete(n,s,d):he.mayCreate(n,s))throw new he.ErrnoError(f);if(!t.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(l)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(n!==t&&(f=he.nodePermissions(t,"w")))throw new he.ErrnoError(f);he.hashRemoveNode(l);try{t.node_ops.rename(l,n,s),l.parent=n}catch(e){throw e}finally{he.hashAddNode(l)}}},rmdir(e){var r=he.lookupPath(e,{parent:!0}).node,t=re.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!0);if(o)throw new he.ErrnoError(o);if(!r.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.rmdir(r,t),he.destroyNode(n)},readdir(e){var r=he.lookupPath(e,{follow:!0}).node;return he.checkOpExists(r.node_ops.readdir,54)(r)},unlink(e){var r=he.lookupPath(e,{parent:!0}).node;if(!r)throw new he.ErrnoError(44);var t=re.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!1);if(o)throw new he.ErrnoError(o);if(!r.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.unlink(r,t),he.destroyNode(n)},readlink(e){var r=he.lookupPath(e).node;if(!r)throw new he.ErrnoError(44);if(!r.node_ops.readlink)throw new he.ErrnoError(28);return r.node_ops.readlink(r)},stat(e,r){var t=he.lookupPath(e,{follow:!r}).node;return he.checkOpExists(t.node_ops.getattr,63)(t)},fstat(e){var r=he.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,o=n?r:t;return n??=t.node_ops.getattr,he.checkOpExists(n,63),n(o)},lstat:e=>he.stat(e,!0),doChmod(e,r,t,n){he.doSetAttr(e,r,{mode:4095&t|-4096&r.mode,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;n="string"==typeof e?he.lookupPath(e,{follow:!t}).node:e,he.doChmod(null,n,r,t)},lchmod(e,r){he.chmod(e,r,!0)},fchmod(e,r){var t=he.getStreamChecked(e);he.doChmod(t,t.node,r,!1)},doChown(e,r,t){he.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var o;o="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e,he.doChown(null,o,n)},lchown(e,r,t){he.chown(e,r,t,!0)},fchown(e,r,t){var n=he.getStreamChecked(e);he.doChown(n,n.node,!1)},doTruncate(e,r,t){if(he.isDir(r.mode))throw new he.ErrnoError(31);if(!he.isFile(r.mode))throw new he.ErrnoError(28);var n=he.nodePermissions(r,"w");if(n)throw new he.ErrnoError(n);he.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new he.ErrnoError(28);var t;t="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e,he.doTruncate(null,t,r)},ftruncate(e,r){var t=he.getStreamChecked(e);if(r<0||!(2097155&t.flags))throw new he.ErrnoError(28);he.doTruncate(t,t.node,r)},utime(e,r,t){var n=he.lookupPath(e,{follow:!0}).node;he.checkOpExists(n.node_ops.setattr,63)(n,{atime:r,mtime:t})},open(e,r,t=438){if(""===e)throw new he.ErrnoError(44);var n,a;if(t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{a=e.endsWith("/");var i=he.lookupPath(e,{follow:!(131072&r),noent_okay:!0});n=i.node,e=i.path}var s=!1;if(64&r)if(n){if(128&r)throw new he.ErrnoError(20)}else{if(a)throw new he.ErrnoError(31);n=he.mknod(e,511|t,0),s=!0}if(!n)throw new he.ErrnoError(44);if(he.isChrdev(n.mode)&&(r&=-513),65536&r&&!he.isDir(n.mode))throw new he.ErrnoError(54);if(!s){var u=he.mayOpen(n,r);if(u)throw new he.ErrnoError(u)}512&r&&!s&&he.truncate(n,0),r&=-131713;var l=he.createStream({node:n,path:he.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),s&&he.chmod(n,511&t),!o.logReadFiles||1&r||e in he.readFiles||(he.readFiles[e]=1),l},close(e){if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new he.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(!(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);if(!r)throw new he.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new he.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=he.open(e,r.flags),o=he.stat(e).size,a=new Uint8Array(o);return he.read(n,a,0,o,0),"utf8"===r.encoding?t=J(a):"binary"===r.encoding&&(t=a),he.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=he.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ae(r)+1),a=ie(r,o,0,o.length);he.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");he.write(n,r,0,r.byteLength,void 0,t.canOwn)}he.close(n)},cwd:()=>he.currentPath,chdir(e){var r=he.lookupPath(e,{follow:!0});if(null===r.node)throw new he.ErrnoError(44);if(!he.isDir(r.node.mode))throw new he.ErrnoError(54);var t=he.nodePermissions(r.node,"x");if(t)throw new he.ErrnoError(t);he.currentPath=r.path},createDefaultDirectories(){he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices(){he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n,llseek:()=>0}),he.mkdev("/dev/null",he.makedev(1,3)),ue.register(he.makedev(5,0),ue.default_tty_ops),ue.register(he.makedev(6,0),ue.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(te(e),r=e.byteLength),e[--r]);he.createDevice("/dev","random",t),he.createDevice("/dev","urandom",t),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories(){he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount(){var r=he.createNode(e,"fd",16895,73);return r.stream_ops={llseek:ce.stream_ops.llseek},r.node_ops={lookup(e,r){var t=+r,n=he.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(he.streams.entries()).filter((([e,r])=>r)).map((([e,r])=>e.toString()))},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?he.createDevice("/dev","stdin",e):he.symlink("/dev/tty","/dev/stdin"),r?he.createDevice("/dev","stdout",null,r):he.symlink("/dev/tty","/dev/stdout"),t?he.createDevice("/dev","stderr",null,t):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},staticInit(){he.nameTable=new Array(4096),he.mount(ce,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:ce}},init(e,r,t){he.initialized=!0,e??=o.stdin,r??=o.stdout,t??=o.stderr,he.createStandardStreams(e,r,t)},quit(){for(var e of(he.initialized=!1,he.streams))e&&he.close(e)},findObject(e,r){var t=he.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=he.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=he.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=re.basename(e),n=he.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:he.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=re.join2(e,a);try{he.mkdir(i)}catch(e){if(20!=e.errno)throw e}e=i}}return i},createFile(e,r,t,n,o){var a=re.join2("string"==typeof e?e:he.getPath(e),r),i=pe(n,o);return he.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:he.getPath(e),i=r?re.join2(e,r):e);var s=pe(n,o),u=he.create(i,s);if(t){if("string"==typeof t){for(var l=new Array(t.length),c=0,d=t.length;c<d;++c)l[c]=t.charCodeAt(c);t=l}he.chmod(u,146|s);var f=he.open(u,577);he.write(f,t,0,t.length,0,a),he.close(f),he.chmod(u,s)}},createDevice(e,r,t,n){var o=re.join2("string"==typeof e?e:he.getPath(e),r),a=pe(!!t,!!n);he.createDevice.major??=64;var i=he.makedev(he.createDevice.major++,0);return he.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new he.ErrnoError(29)}if(void 0===u&&0===i)throw new he.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new he.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}}),he.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("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.");try{e.contents=d(e.url),e.usedBytes=e.contents.length}catch(e){throw new he.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class a{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize;return this.getter(e/this.chunkSize|0)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):se(o.responseText||"")})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,y("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!s)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:t};var u=he.createFile(e,r,i,n,o);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(u.stream_ops).forEach((e=>{var r=u.stream_ops[e];l[e]=(...e)=>(he.forceLoadFile(u),r(...e))})),l.read=(e,r,t,n,o)=>(he.forceLoadFile(u),c(e,r,t,n,o)),l.mmap=(e,r,t,n,o)=>{he.forceLoadFile(u);var a=le();if(!a)throw new he.ErrnoError(48);return c(e,x,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=l,u}},ve={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(re.isAbs(r))return r;var n;if(n=-100===e?he.cwd():ve.getStreamFromFD(e).path,0==r.length){if(!t)throw new he.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){A[e>>2]=r.dev,A[e+4>>2]=r.mode,$[e+8>>2]=r.nlink,A[e+12>>2]=r.uid,A[e+16>>2]=r.gid,A[e+20>>2]=r.rdev,T[e+24>>3]=BigInt(r.size),A[e+32>>2]=4096,A[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),o=r.ctime.getTime();return T[e+40>>3]=BigInt(Math.floor(t/1e3)),$[e+48>>2]=t%1e3*1e3*1e3,T[e+56>>3]=BigInt(Math.floor(n/1e3)),$[e+64>>2]=n%1e3*1e3*1e3,T[e+72>>3]=BigInt(Math.floor(o/1e3)),$[e+80>>2]=o%1e3*1e3*1e3,T[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){A[e+4>>2]=r.bsize,A[e+40>>2]=r.bsize,A[e+8>>2]=r.blocks,A[e+12>>2]=r.bfree,A[e+16>>2]=r.bavail,A[e+20>>2]=r.files,A[e+24>>2]=r.ffree,A[e+28>>2]=r.fsid,A[e+44>>2]=r.flags,A[e+36>>2]=r.namelen},doMsync(e,r,t,n,o){if(!he.isFile(r.node.mode))throw new he.ErrnoError(43);if(2&n)return 0;var a=E.slice(e,e+t);he.msync(r,a,o,t,n)},getStreamFromFD:e=>he.getStreamChecked(e),varargs:void 0,getStr:e=>K(e)},ye=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},be=e=>{for(var r="",t=e;E[t];)r+=j[E[t++]];return r},we={},_e={},xe={},Ee=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Se=e=>{throw new Ee(e)};function Pe(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||Se(`type "${n}" must have a positive integer typeid pointer`),_e.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Se(`Cannot register type '${n}' twice`)}if(_e[e]=r,delete xe[e],we.hasOwnProperty(e)){var o=we[e];delete we[e],o.forEach((e=>e()))}}(e,r,t)}var Ae=(e,r,t)=>{switch(r){case 1:return t?e=>x[e]:e=>E[e];case 2:return t?e=>S[e>>1]:e=>P[e>>1];case 4:return t?e=>A[e>>2]:e=>$[e>>2];case 8:return t?e=>T[e>>3]:e=>k[e>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},$e=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ce=e=>{Se(e.$$.ptrType.registeredClass.name+" instance already deleted")},Te=!1,ke=e=>{},Be=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Fe=e=>"undefined"==typeof FinalizationRegistry?(Fe=e=>e,e):(Te=new FinalizationRegistry((e=>{Be(e.$$)})),Fe=e=>{var r=e.$$;return!r.smartPtr||Te.register(e,{$$:r},e),e},ke=e=>Te.unregister(e),Fe(e)),Le=[];function Oe(){}var Re=(e,r)=>Object.defineProperty(r,"name",{value:e}),Ue={},Ie=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||Se(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},Me=(e,r,t)=>{o.hasOwnProperty(e)?((void 0===t||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[t])&&Se(`Cannot register public name '${e}' twice`),Ie(o,e,e),o[e].overloadTable.hasOwnProperty(t)&&Se(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[e].overloadTable[t]=r):(o[e]=r,o[e].argCount=t)};function Ve(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Ne=(e,r,t)=>{for(;r!==t;)r.upcast||Se(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function ze(e,r){return null===r?(this.isReference&&Se(`null is not a valid ${this.name}`),0):(r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass))}function je(e,r){var t;if(null===r)return this.isReference&&Se(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;if(r&&r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Se(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`),t=Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Se("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Se(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var n=r.clone();t=this.rawShare(t,pr.toHandle((()=>n.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Se("Unsupporting sharing policy")}return t}function Ge(e,r){return null===r?(this.isReference&&Se(`null is not a valid ${this.name}`),0):(r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Se(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`),Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass))}function We(e){return this.fromWireType($[e>>2])}var He=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=He(e,r,t.baseClass);return null===n?null:t.downcast(n)},qe={},Xe=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Qe=e=>{throw new Xe(e)},Ze=(e,r)=>(r.ptrType&&r.ptr||Qe("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Qe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Fe(Object.create(e,{$$:{value:r,writable:!0}})));function Je(e,r,t,n,o,a,i,s,u,l,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,o||void 0!==r.baseClass?this.toWireType=je:n?(this.toWireType=ze,this.destructorFunction=null):(this.toWireType=Ge,this.destructorFunction=null)}var Ke,Ye=(e,r,t)=>{o.hasOwnProperty(e)||Qe("Replacing nonexistent public symbol"),void 0!==o[e].overloadTable&&void 0!==t?o[e].overloadTable[t]=r:(o[e]=r,o[e].argCount=t)},er=e=>Ke.get(e),rr=(e,r,t=!1)=>{e=be(e);var n=er(r);return"function"!=typeof n&&Se(`unknown function pointer with signature ${e}: ${r}`),n};class tr extends Error{}var nr=e=>{var r=nt(e),t=be(r);return rt(r),t},or=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||_e[r]||(xe[r]?xe[r].forEach(e):(t.push(r),n[r]=!0))})),new tr(`${e}: `+t.map(nr).join([", "]))},ar=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Qe("Mismatched type converter count");for(var o=0;o<e.length;++o)Pe(e[o],n[o])}e.forEach((e=>xe[e]=r));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{_e.hasOwnProperty(e)?o[r]=_e[e]:(a.push(e),we.hasOwnProperty(e)||(we[e]=[]),we[e].push((()=>{o[r]=_e[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},ir=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push($[r+4*n>>2]);return t},sr=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function ur(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function lr(e,r,t,n,o,a){var i=r.length;i<2&&Se("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==r[1]&&null!==t,u=ur(r),l="void"!==r[0].name,c=[e,Se,n,o,sr,r[0],r[1]],d=0;d<i-2;++d)c.push(r[d+2]);if(!u)for(d=s?1:2;d<r.length;++d)null!==r[d].destructorFunction&&c.push(r[d].destructorFunction);let[f,m]=function(e,r,t,n){var o=ur(e),a=e.length-2,i=[],s=["fn"];r&&s.push("thisWired");for(var u=0;u<a;++u)i.push(`arg${u}`),s.push(`arg${u}Wired`);i=i.join(","),s=s.join(",");var l=`return function (${i}) {\n`;o&&(l+="var destructors = [];\n");var c=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(l+=`var thisWired = classParam['toWireType'](${c}, this);\n`),u=0;u<a;++u)l+=`var arg${u}Wired = argType${u}['toWireType'](${c}, arg${u});\n`,d.push(`argType${u}`);if(l+=(t||n?"var rv = ":"")+`invoker(${s});\n`,o)l+="runDestructors(destructors);\n";else for(u=r?1:2;u<e.length;++u){var f=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(l+=`${f}_dtor(${f});\n`,d.push(`${f}_dtor`))}return t&&(l+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[d,l+="}\n"]}(r,s,l,a);var p=new Function(...f,m)(...c);return Re(e,p)}var cr,dr=e=>{const r=(e=e.trim()).indexOf("(");return-1===r?e:e.slice(0,r)},fr=[],mr=[],pr={toValue:e=>(e||Se(`Cannot use deleted val. handle = ${e}`),mr[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=fr.pop()||mr.length;return mr[r]=e,mr[r+1]=1,r}}}},hr={name:"emscripten::val",fromWireType:e=>{var r=pr.toValue(e);return(e=>{e>9&&0==--mr[e+1]&&(mr[e]=void 0,fr.push(e))})(e),r},toWireType:(e,r)=>pr.toHandle(r),argPackAdvance:8,readValueFromPointer:We,destructorFunction:null},gr=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(C[e>>2])};case 8:return function(e){return this.fromWireType(B[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},vr=(e,r,t)=>ie(e,E,r,t),yr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,br=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&P[n];)++n;if((t=n<<1)-e>32&&yr)return yr.decode(E.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},wr=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);S[r>>1]=i,r+=2}return S[r>>1]=0,r-n},_r=e=>2*e.length,xr=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=A[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Er=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),A[r>>2]=i,(r+=4)+4>o)break}return A[r>>2]=0,r-n},Sr=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Pr=0,Ar={},$r=e=>{if(e instanceof z||"unwind"==e)return _;p(1,e)},Cr=()=>q||Pr>0,Tr=e=>{_=e,Cr()||(o.onExit?.(e),D=!0),p(e,new z(e))},kr=e=>{if(!D)try{e(),(()=>{if(!Cr())try{_=e=_,Tr(e)}catch(e){$r(e)}var e})()}catch(e){$r(e)}},Br=e=>{var r=(e-w.buffer.byteLength+65535)/65536|0;try{return w.grow(r),O(),1}catch(e){}},Fr=e=>{var r=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_conservative_depth","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","NV_shader_noperspective_interpolation","WEBGL_clip_cull_distance","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter((e=>r.includes(e)))},Dr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{Dr.lastError||(Dr.lastError=e)},getNewId:e=>{for(var r=Dr.counter++,t=e.length;t<r;t++)e[t]=null;for(;e[r];)r=Dr.counter++;return r},genObject:(e,r,t,n)=>{for(var o=0;o<e;o++){var a=cr[t](),i=a&&Dr.getNewId(n);a?(a.name=i,n[i]=a):Dr.recordError(1282),A[r+4*o>>2]=i}},MAX_TEMP_BUFFER_SIZE:2097152,numTempVertexBuffersPerSize:64,log2ceilLookup:e=>32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=Dr.log2ceilLookup(Dr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=Dr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s<o;++s)a[s]=i[s]=null}if(e){r.tempQuadIndexBuffer=cr.createBuffer(),r.GLctx.bindBuffer(34963,r.tempQuadIndexBuffer);for(var u=Dr.MAX_TEMP_BUFFER_SIZE>>1,l=new Uint16Array(u),c=(n=0,0);l[n++]=c,!(n>=u||(l[n++]=c+1,n>=u)||(l[n++]=c+2,n>=u)||(l[n++]=c,n>=u)||(l[n++]=c+2,n>=u)||(l[n++]=c+3,n>=u));)c+=4;r.GLctx.bufferData(34963,l,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:e=>{var r=Dr.log2ceilLookup(e),t=Dr.currentContext.tempVertexBuffers1[r],n=Dr.currentContext.tempVertexBufferCounters1[r];Dr.currentContext.tempVertexBufferCounters1[r]=Dr.currentContext.tempVertexBufferCounters1[r]+1&Dr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=cr.getParameter(34964);return t[n]=cr.createBuffer(),cr.bindBuffer(34962,t[n]),cr.bufferData(34962,1<<r,35048),cr.bindBuffer(34962,a),t[n]},getTempIndexBuffer:e=>{var r=Dr.log2ceilLookup(e),t=Dr.currentContext.tempIndexBuffers[r];if(t)return t;var n=cr.getParameter(34965);return Dr.currentContext.tempIndexBuffers[r]=cr.createBuffer(),cr.bindBuffer(34963,Dr.currentContext.tempIndexBuffers[r]),cr.bufferData(34963,1<<r,35048),cr.bindBuffer(34963,n),Dr.currentContext.tempIndexBuffers[r]},newRenderingFrameStarted:()=>{if(Dr.currentContext){var e=Dr.currentContext.tempVertexBuffers1;Dr.currentContext.tempVertexBuffers1=Dr.currentContext.tempVertexBuffers2,Dr.currentContext.tempVertexBuffers2=e,e=Dr.currentContext.tempVertexBufferCounters1,Dr.currentContext.tempVertexBufferCounters1=Dr.currentContext.tempVertexBufferCounters2,Dr.currentContext.tempVertexBufferCounters2=e;for(var r=Dr.log2ceilLookup(Dr.MAX_TEMP_BUFFER_SIZE),t=0;t<=r;++t)Dr.currentContext.tempVertexBufferCounters1[t]=0}},getSource:(e,r,t,n)=>{for(var o="",a=0;a<r;++a)o+=K($[t+4*a>>2],n?$[n+4*a>>2]:void 0);return o},calcBufLength:(e,r,t,n)=>t>0?n*t:e*Dr.byteSizeByType[r-Dr.byteSizeByTypeRoot]*n,usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:e=>{Dr.resetBufferBinding=!1;for(var r=0;r<Dr.currentContext.maxVertexAttribs;++r){var t=Dr.currentContext.clientBuffers[r];if(t.clientside&&t.enabled){Dr.resetBufferBinding=!0;var n=Dr.calcBufLength(t.size,t.type,t.stride,e),o=Dr.getTempVertexBuffer(n);cr.bindBuffer(34962,o),cr.bufferSubData(34962,0,E.subarray(t.ptr,t.ptr+n)),t.vertexAttribPointerAdaptor.call(cr,r,t.size,t.type,t.normalized,t.stride,0)}}},postDrawHandleClientVertexAttribBindings:()=>{Dr.resetBufferBinding&&cr.bindBuffer(34962,Dr.buffers[cr.currentArrayBufferBinding])},createContext:(e,r)=>{if(!e.getContextSafariWebGL2Fixed){function n(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null}e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=n}var t=e.getContext(r.majorVersion>1?"webgl2":"webgl",r);return t?Dr.registerContext(t,r):0},registerContext:(e,r)=>{var t=Dr.getNewId(Dr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),Dr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&Dr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o<n.maxVertexAttribs;o++)n.clientBuffers[o]={enabled:!1,clientside:!1,size:0,type:0,normalized:0,stride:0,ptr:0,vertexAttribPointerAdaptor:null};return Dr.generateTempBuffers(!1,n),t},makeContextCurrent:e=>(Dr.currentContext=Dr.contexts[e],o.ctx=cr=Dr.currentContext?.GLctx,!(e&&!cr)),getContext:e=>Dr.contexts[e],deleteContext:e=>{Dr.currentContext===Dr.contexts[e]&&(Dr.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(Dr.contexts[e].GLctx.canvas),Dr.contexts[e]?.GLctx.canvas&&(Dr.contexts[e].GLctx.canvas.GLctxObject=void 0),Dr.contexts[e]=null},initExtensions:e=>{if(e||=Dr.currentContext,!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(r=t).multiDrawWebgl=r.getExtension("WEBGL_multi_draw"),(e=>{e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")})(t),(e=>{e.extClipControl=e.getExtension("EXT_clip_control")})(t),(e=>{e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")})(t),(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(e=>{e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")})(t),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),Fr(t).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},Lr=["default","low-power","high-performance"],Or=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],Rr=e=>{var r;return e=(r=e)>2?K(r):r,Or[e]||("undefined"!=typeof document?document.querySelector(e):null)},Ur={},Ir=()=>{if(!Ir.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(var r in Ur)void 0===Ur[r]?delete e[r]:e[r]=Ur[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Ir.strings=t}return Ir.strings},Mr=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),Vr=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Nr=[],zr=e=>0==(e-=5120)?x:1==e?E:2==e?S:4==e?A:6==e?C:5==e||28922==e||28520==e||30779==e||30782==e?$:P,jr=(e,r)=>e>>>31-Math.clz32(r.BYTES_PER_ELEMENT),Gr=e=>{var r=cr.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=cr.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?`[${t}]`:""))),t}Dr.recordError(1282)},Wr=[],Hr=e=>{var r=ae(e)+1,t=st(r);return vr(e,t,r),t},qr={errorCallback:(e,r,t,n)=>{var o=Q(),a=Hr(t);er(e)(r,a,n),X(o)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}qr.mgrSurface=new e,qr.mgrSwapChain=new e,qr.mgrAdapter=new e,qr.mgrDevice=new e,qr.mgrQueue=new e,qr.mgrCommandBuffer=new e,qr.mgrCommandEncoder=new e,qr.mgrRenderPassEncoder=new e,qr.mgrComputePassEncoder=new e,qr.mgrBindGroup=new e,qr.mgrBuffer=new e,qr.mgrSampler=new e,qr.mgrTexture=new e,qr.mgrTextureView=new e,qr.mgrQuerySet=new e,qr.mgrBindGroupLayout=new e,qr.mgrPipelineLayout=new e,qr.mgrRenderPipeline=new e,qr.mgrComputePipeline=new e,qr.mgrShaderModule=new e,qr.mgrRenderBundleEncoder=new e,qr.mgrRenderBundle=new e},makeColor:e=>({r:B[e>>3],g:B[e+8>>3],b:B[e+16>>3],a:B[e+24>>3]}),makeExtent3D:e=>({width:$[e>>2],height:$[e+4>>2],depthOrArrayLayers:$[e+8>>2]}),makeOrigin3D:e=>({x:$[e>>2],y:$[e+4>>2],z:$[e+8>>2]}),makeImageCopyTexture:e=>({texture:qr.mgrTexture.get($[e+4>>2]),mipLevel:$[e+8>>2],origin:qr.makeOrigin3D(e+12),aspect:qr.TextureAspect[$[e+24>>2]]}),makeTextureDataLayout:e=>{var r=$[e+16>>2],t=$[e+20>>2];return{offset:4294967296*$[e+4+8>>2]+$[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=qr.makeTextureDataLayout(e+8);return r.buffer=qr.mgrBuffer.get($[e+32>>2]),r},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n<e;++n){var o=r+16*n;t[K($[o+4>>2])]=B[o+8>>3]}return t}},makePipelineLayout:e=>e?qr.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}},fillLimitStruct:(e,r)=>{var t=r+8;function n(r,n){A[t+n>>2]=e[r]}function o(r,n){T[t+n>>3]=BigInt(e[r])}n("maxTextureDimension1D",0),n("maxTextureDimension2D",4),n("maxTextureDimension3D",8),n("maxTextureArrayLayers",12),n("maxBindGroups",16),n("maxBindGroupsPlusVertexBuffers",20),n("maxBindingsPerBindGroup",24),n("maxDynamicUniformBuffersPerPipelineLayout",28),n("maxDynamicStorageBuffersPerPipelineLayout",32),n("maxSampledTexturesPerShaderStage",36),n("maxSamplersPerShaderStage",40),n("maxStorageBuffersPerShaderStage",44),n("maxStorageTexturesPerShaderStage",48),n("maxUniformBuffersPerShaderStage",52),n("minUniformBufferOffsetAlignment",72),n("minStorageBufferOffsetAlignment",76),o("maxUniformBufferBindingSize",56),o("maxStorageBufferBindingSize",64),n("maxVertexBuffers",80),o("maxBufferSize",88),n("maxVertexAttributes",96),n("maxVertexBufferArrayStride",100),n("maxInterStageShaderComponents",104),n("maxInterStageShaderVariables",108),n("maxColorAttachments",112),n("maxColorAttachmentBytesPerSample",116),n("maxComputeWorkgroupStorageSize",120),n("maxComputeInvocationsPerWorkgroup",124),n("maxComputeWorkgroupSizeX",128),n("maxComputeWorkgroupSizeY",132),n("maxComputeWorkgroupSizeZ",136),n("maxComputeWorkgroupsPerDimension",140)},Int_BufferMapState:{unmapped:1,pending:2,mapped:3},Int_CompilationMessageType:{error:1,warning:2,info:3},Int_DeviceLostReason:{undefined:1,unknown:1,destroyed:2},Int_PreferredFormat:{rgba8unorm:18,bgra8unorm:23},WGSLFeatureName:[,"readonly_and_readwrite_storage_textures","packed_4x8_integer_dot_product","unrestricted_pointer_parameters","pointer_composite_access"],AddressMode:[,"clamp-to-edge","repeat","mirror-repeat"],AlphaMode:[,"opaque","premultiplied"],BlendFactor:[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:[,"add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],BufferMapState:{1:"unmapped",2:"pending",3:"mapped"},CompareFunction:[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:[,"none","front","back"],ErrorFilter:{1:"validation",2:"out-of-memory",3:"internal"},FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32-filterable"],FilterMode:[,"nearest","linear"],FrontFace:[,"ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:[,"nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:{1:"occlusion",2:"timestamp"},SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only","read-only","read-write"],StoreOp:[,"store","discard"],TextureAspect:[,"all","stencil-only","depth-only"],TextureDimension:[,"1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2"],VertexStepMode:[,"vertex-buffer-not-used","vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10","float32-filterable":"11"}},Xr=he.createPath,Qr=he.createLazyFile,Zr=he.createDevice;he.createPreloadedFile=me,he.staticInit(),o.FS_createPath=he.createPath,o.FS_createDataFile=he.createDataFile,o.FS_createPreloadedFile=he.createPreloadedFile,o.FS_unlink=he.unlink,o.FS_createLazyFile=he.createLazyFile,o.FS_createDevice=he.createDevice,ce.doesNotExistError=new he.ErrnoError(44),ce.doesNotExistError.stack="<generic error, no stack>",(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);j=e})(),(()=>{let e=Oe.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof Oe))return!1;if(!(e instanceof Oe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Ce(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Fe(Object.create(Object.getPrototypeOf(this),{$$:{value:$e(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ce(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),ke(this),Be(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ce(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),Le.push(this),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)})(),Object.assign(Je.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:We,fromWireType:function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Se("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(this.registeredClass,r),qe[r]))(0,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return Ze(this.registeredClass.instancePrototype,this.isSmartPointer?{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}:{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Ue[i];if(!s)return o.call(this);var u=He(r,this.registeredClass,(a=this.isConst?s.constPointerType:s.pointerType).registeredClass);return null===u?o.call(this):Ze(a.registeredClass.instancePrototype,this.isSmartPointer?{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}:{ptrType:a,ptr:u})}}),mr.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=()=>mr.length/2-5-fr.length,"undefined"!=typeof MainLoop&&MainLoop.preMainLoop.push((()=>Dr.newRenderingFrameStarted()));for(let e=0;e<32;++e)Nr.push(new Array(e));for(var Jr=new Int32Array(288),Kr=0;Kr<=288;++Kr)Wr[Kr]=Jr.subarray(0,Kr);qr.initManagers();var Yr={a:(e,r,t,n)=>N(`Assertion failed: ${K(e)}, at: `+[r?K(r):"unknown filename",t,n?K(n):"unknown function"]),ua:function(e,r,t){ve.varargs=t;try{var n=ve.getStreamFromFD(e);switch(r){case 0:if((o=Y())<0)return-28;for(;he.streams[o];)o++;return he.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Y();return n.flags|=o,0;case 12:return o=ee(),S[o+0>>1]=2,0}return-28}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Hb:function(e,r,t){ve.varargs=t;try{var n=ve.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=ee();A[a>>2]=o.c_iflag||0,A[a+4>>2]=o.c_oflag||0,A[a+8>>2]=o.c_cflag||0,A[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)x[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=ee();var s=A[a>>2],u=A[a+4>>2],l=A[a+8>>2],c=A[a+12>>2],d=[];for(i=0;i<32;i++)d.push(x[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(a=ee(),A[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=ee(),he.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=ee(),S[a>>1]=f[0],S[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ib:function(e,r,t,n){ve.varargs=n;try{r=ve.getStr(r),r=ve.calculateAt(e,r);var o=n?Y():0;return he.open(r,t,o).fd}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Jb:()=>N(""),xa:(e,r,t,n,o)=>{var a=-1!=(r=be(r)).indexOf("u");Pe(e,{name:r,fromWireType:e=>e,toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${ye(r)}" to ${this.name}`);return"number"==typeof r&&(r=BigInt(r)),r},argPackAdvance:8,readValueFromPointer:Ae(r,t,!a),destructorFunction:null})},Mb:(e,r,t,n)=>{Pe(e,{name:r=be(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e])},destructorFunction:null})},Ub:(e,r,t,n,o,a,i,s,u,l,c,d,f)=>{c=be(c),a=rr(o,a),s&&=rr(i,s),l&&=rr(u,l),f=rr(d,f);var m=(e=>{var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(c);Me(m,(function(){or(`Cannot construct ${c} due to unbound types`,[n])})),ar([e,r,t],n?[n]:[],(r=>{var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:Oe.prototype;var i=Re(c,(function(...e){if(Object.getPrototypeOf(this)!==u)throw new Ee(`Use 'new' to construct ${c}`);if(void 0===d.constructor_body)throw new Ee(`${c} has no accessible constructor`);var r=d.constructor_body[e.length];if(void 0===r)throw new Ee(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Ve(c,i,u,f,t,a,s,l);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var p=new Je(c,d,!0,!1,!1),h=new Je(c+"*",d,!1,!1,!1),g=new Je(c+" const*",d,!1,!0,!1);return Ue[e]={pointerType:h,constPointerType:g},Ye(m,i),[p,h,g]}))},Tb:(e,r,t,n,o,a)=>{var i=ir(r,t);o=rr(n,o),ar([],[e],(e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{or(`Cannot construct ${e.name} due to unbound types`,i)},ar([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=lr(t,n,null,o,a),[]))),[]}))},x:(e,r,t,n,o,a,i,s,u,l)=>{var c=ir(t,n);r=be(r),r=dr(r),a=rr(o,a,u),ar([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function o(){or(`Cannot call ${n} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var l=e.registeredClass.instancePrototype,d=l[r];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===t-2?(o.argCount=t-2,o.className=e.name,l[r]=o):(Ie(l,r,n),l[r].overloadTable[t-2]=o),ar([],c,(o=>{var s=lr(n,o,e,a,i,u);return void 0===l[r].overloadTable?(s.argCount=t-2,l[r]=s):l[r].overloadTable[t-2]=s,[]})),[]}))},Kb:e=>Pe(e,hr),wa:(e,r,t)=>{Pe(e,{name:r=be(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:gr(r,t),destructorFunction:null})},za:(e,r,t,n,o,a,i,s)=>{var u=ir(r,t);e=be(e),e=dr(e),o=rr(n,o,i),Me(e,(function(){or(`Cannot call ${e} due to unbound types`,u)}),r-1),ar([],u,(t=>{var n=[t[0],null].concat(t.slice(1));return Ye(e,lr(e,n,null,o,a,i),r-1),[]}))},w:(e,r,t,n,o)=>{r=be(r);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned");Pe(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return r>>>0}:function(e,r){return r},argPackAdvance:8,readValueFromPointer:Ae(r,t,0!==n),destructorFunction:null})},n:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][r];function o(e){return new n(x.buffer,$[e+4>>2],$[e>>2])}Pe(e,{name:t=be(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Lb:(e,r)=>{Pe(e,{name:r=be(r),fromWireType(e){for(var r,t=$[e>>2],n=e+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==E[i]){var s=K(o,i-o);void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),o=i+1}}return rt(e),r},toWireType(e,r){var t;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||ArrayBuffer.isView(r)&&1==r.BYTES_PER_ELEMENT||Se("Cannot pass non-string to std::string"),t=n?ae(r):r.length;var o=tt(4+t+1),a=o+4;return $[o>>2]=t,n?vr(r,a,t+1):E.set(r,a),null!==e&&e.push(rt,o),o},argPackAdvance:8,readValueFromPointer:We,destructorFunction(e){rt(e)}})},_:(e,r,t)=>{var n,o,a,i;t=be(t),2===r?(n=br,o=wr,i=_r,a=e=>P[e>>1]):4===r&&(n=xr,o=Er,i=Sr,a=e=>$[e>>2]),Pe(e,{name:t,fromWireType:e=>{for(var t,o=$[e>>2],i=e+4,s=0;s<=o;++s){var u=e+4+s*r;if(s==o||0==a(u)){var l=n(i,u-i);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),i=u+r}}return rt(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Se(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=tt(4+a+r);return $[s>>2]=a/r,o(n,s+4,a+r),null!==e&&e.push(rt,s),s},argPackAdvance:8,readValueFromPointer:We,destructorFunction(e){rt(e)}})},Ob:(e,r)=>{Pe(e,{isVoid:!0,name:r=be(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},xb:()=>{q=!1,Pr=0},vb:()=>{throw 1/0},ya:(e,r)=>{var t,n;void 0===(n=_e[t=e])&&Se(`_emval_take_value has unknown type ${nr(t)}`);var o=(e=n).readValueFromPointer(r);return pr.toHandle(o)},yb:(e,r)=>{if(Ar[e]&&(clearTimeout(Ar[e].id),delete Ar[e]),!r)return 0;var t=setTimeout((()=>{delete Ar[e],kr((()=>ot(e,performance.now())))}),r);return Ar[e]={id:t,timeout_ms:r},0},Ab:(e,r,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),u=i.getTimezoneOffset(),l=Math.max(s,u);$[e>>2]=60*l,A[r>>2]=Number(s!=u);var c=e=>{var r=e>=0?"-":"+",t=Math.abs(e);return`UTC${r}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},d=c(s),f=c(u);u<s?(vr(d,t,17),vr(f,n,17)):(vr(d,n,17),vr(f,t,17))},Db:e=>{var r,t=E.length,n=2147483648;if((e>>>=0)>n)return!1;for(var o=1;o<=4;o*=2){var a=t*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(n,(r=Math.max(e,a),65536*Math.ceil(r/65536)));if(Br(i))return!0}return!1},Rb:(e,r)=>{var t=r>>2,n={alpha:!!x[r+0],depth:!!x[r+1],stencil:!!x[r+2],antialias:!!x[r+3],premultipliedAlpha:!!x[r+4],preserveDrawingBuffer:!!x[r+5],powerPreference:Lr[A[t+2]],failIfMajorPerformanceCaveat:!!x[r+12],majorVersion:A[t+4],minorVersion:A[t+5],enableExtensionsByDefault:x[r+24],explicitSwapControl:x[r+25],proxyContextToMainThread:A[t+7],renderViaOffscreenBackBuffer:x[r+32]},o=Rr(e);return o?n.explicitSwapControl?0:Dr.createContext(o,n):0},Sb:e=>{Dr.currentContext==e&&(Dr.currentContext=0),Dr.deleteContext(e)},tb:()=>Dr.currentContext?Dr.currentContext.handle:0,qa:e=>Dr.makeContextCurrent(e)?0:-5,Bb:(e,r)=>{var t=0;return Ir().forEach(((n,o)=>{var a=r+t;$[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)x[r++]=e.charCodeAt(t);x[r]=0})(n,a),t+=n.length+1})),0},Cb:(e,r)=>{var t=Ir();$[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),$[r>>2]=n,0},ta:function(e){try{var r=ve.getStreamFromFD(e);return he.close(r),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Gb:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=$[r>>2],i=$[r+4>>2];r+=8;var s=he.read(e,x,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(ve.getStreamFromFD(e),r,t);return $[n>>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Eb:function(e,r,t,n){r=Mr(r);try{if(isNaN(r))return 61;var o=ve.getStreamFromFD(e);return he.llseek(o,r,t),T[n>>3]=BigInt(o.position),o.getdents&&0===r&&0===t&&(o.getdents=null),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Fb:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=$[r>>2],i=$[r+4>>2];r+=8;var s=he.write(e,x,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(ve.getStreamFromFD(e),r,t);return $[n>>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},ib:e=>cr.activeTexture(e),Fa:(e,r)=>{cr.attachShader(Dr.programs[e],Dr.shaders[r])},t:(e,r)=>{if(r&&!Dr.buffers[r]){var t=cr.createBuffer();t.name=r,Dr.buffers[r]=t}34962==e?cr.currentArrayBufferBinding=r:34963==e&&(cr.currentElementArrayBufferBinding=r),35051==e?cr.currentPixelPackBufferBinding=r:35052==e&&(cr.currentPixelUnpackBufferBinding=r),cr.bindBuffer(e,Dr.buffers[r])},gb:(e,r,t,n,o)=>{cr.bindBufferRange(e,r,Dr.buffers[t],n,o)},j:(e,r)=>{cr.bindFramebuffer(e,Dr.framebuffers[r])},Z:(e,r)=>{cr.bindRenderbuffer(e,Dr.renderbuffers[r])},O:(e,r)=>{cr.bindTexture(e,Dr.textures[r])},fa:e=>{cr.bindVertexArray(Dr.vaos[e]);var r=cr.getParameter(34965);cr.currentElementArrayBufferBinding=r?0|r.name:0},Y:e=>cr.blendEquation(e),v:(e,r)=>cr.blendFunc(e,r),z:(e,r,t,n,o,a,i,s,u,l)=>cr.blitFramebuffer(e,r,t,n,o,a,i,s,u,l),Ga:(e,r,t,n)=>{Dr.currentContext.version>=2?t&&r?cr.bufferData(e,E,n,t,r):cr.bufferData(e,r,n):cr.bufferData(e,t?E.subarray(t,t+r):r,n)},ia:e=>cr.clear(e),ja:(e,r,t,n)=>cr.clearColor(e,r,t,n),cb:e=>cr.clearDepth(e),db:e=>cr.clearStencil(e),H:(e,r,t,n)=>{cr.colorMask(!!e,!!r,!!t,!!n)},Za:e=>{cr.compileShader(Dr.shaders[e])},jc:()=>{var e=Dr.getNewId(Dr.programs),r=cr.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,Dr.programs[e]=r,e},$a:e=>{var r=Dr.getNewId(Dr.shaders);return Dr.shaders[r]=cr.createShader(e),r},sb:e=>cr.cullFace(e),eb:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.buffers[n];o&&(cr.deleteBuffer(o),o.name=0,Dr.buffers[n]=null,n==cr.currentArrayBufferBinding&&(cr.currentArrayBufferBinding=0),n==cr.currentElementArrayBufferBinding&&(cr.currentElementArrayBufferBinding=0),n==cr.currentPixelPackBufferBinding&&(cr.currentPixelPackBufferBinding=0),n==cr.currentPixelUnpackBufferBinding&&(cr.currentPixelUnpackBufferBinding=0))}},ob:(e,r)=>{for(var t=0;t<e;++t){var n=A[r+4*t>>2],o=Dr.framebuffers[n];o&&(cr.deleteFramebuffer(o),o.name=0,Dr.framebuffers[n]=null)}},va:e=>{if(e){var r=Dr.programs[e];r?(cr.deleteProgram(r),r.name=0,Dr.programs[e]=null):Dr.recordError(1281)}},nb:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.renderbuffers[n];o&&(cr.deleteRenderbuffer(o),o.name=0,Dr.renderbuffers[n]=null)}},X:e=>{if(e){var r=Dr.shaders[e];r?(cr.deleteShader(r),Dr.shaders[e]=null):Dr.recordError(1281)}},ra:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.textures[n];o&&(cr.deleteTexture(o),o.name=0,Dr.textures[n]=null)}},Xa:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2];cr.deleteVertexArray(Dr.vaos[n]),Dr.vaos[n]=null}},qb:e=>cr.depthFunc(e),Q:e=>{cr.depthMask(!!e)},C:e=>cr.disable(e),kc:e=>{Dr.currentContext.clientBuffers[e].enabled=!1,cr.disableVertexAttribArray(e)},fb:(e,r,t,n)=>{var o,a=0;if(!cr.currentElementArrayBufferBinding){var i=Dr.calcBufLength(1,t,0,r);if(o=Dr.getTempIndexBuffer(i),cr.bindBuffer(34963,o),cr.bufferSubData(34963,0,E.subarray(n,n+i)),r>0)for(var s=0;s<Dr.currentContext.maxVertexAttribs;++s){var u=Dr.currentContext.clientBuffers[s];if(u.clientside&&u.enabled){let e;switch(t){case 5121:e=Uint8Array;break;case 5123:e=Uint16Array;break;case 5125:e=Uint32Array;break;default:return void Dr.recordError(1282)}a=new e(E.buffer,n,r).reduce(((e,r)=>Math.max(e,r)))+1;break}}n=0}Dr.preDrawHandleClientVertexAttribBindings(a),cr.drawElements(e,r,t,n),Dr.postDrawHandleClientVertexAttribBindings(r),cr.currentElementArrayBufferBinding||cr.bindBuffer(34963,null)},s:e=>cr.enable(e),kb:e=>{Dr.currentContext.clientBuffers[e].enabled=!0,cr.enableVertexAttribArray(e)},ka:(e,r,t,n)=>{cr.framebufferRenderbuffer(e,r,t,Dr.renderbuffers[n])},mb:(e,r,t,n,o)=>{cr.framebufferTexture2D(e,r,t,Dr.textures[n],o)},rb:e=>cr.frontFace(e),pb:(e,r)=>{Dr.genObject(e,r,"createBuffer",Dr.buffers)},na:(e,r)=>{Dr.genObject(e,r,"createFramebuffer",Dr.framebuffers)},ma:(e,r)=>{Dr.genObject(e,r,"createRenderbuffer",Dr.renderbuffers)},pa:(e,r)=>{Dr.genObject(e,r,"createTexture",Dr.textures)},bb:(e,r)=>{Dr.genObject(e,r,"createVertexArray",Dr.vaos)},La:(e,r)=>((e,r)=>{if(r){var t,n=void 0;switch(e){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var o=cr.getParameter(34467);n=o?o.length:0;break;case 33309:if(Dr.currentContext.version<2)return void Dr.recordError(1282);n=(t=Fr(cr),t=t.concat(t.map((e=>"GL_"+e))),t).length;break;case 33307:case 33308:if(Dr.currentContext.version<2)return void Dr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=cr.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void Dr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Dr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i<a.length;++i)A[r+4*i>>2]=a[i];return}try{n=0|a.name}catch(r){return Dr.recordError(1280),void b(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${r})`)}}break;default:return Dr.recordError(1280),void b(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${a} of type ${typeof a}!`)}}A[r>>2]=n}else Dr.recordError(1281)})(e,r),Nb:(e,r,t,n)=>{var o=cr.getProgramInfoLog(Dr.programs[e]);null===o&&(o="(unknown error)");var a=r>0&&n?vr(o,n,r):0;t&&(A[t>>2]=a)},Aa:(e,r,t)=>{if(t)if(e>=Dr.counter)Dr.recordError(1281);else if(e=Dr.programs[e],35716==r){var n=cr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),A[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=cr.getProgramParameter(e,35718),a=0;a<o;++a)e.maxUniformLength=Math.max(e.maxUniformLength,cr.getActiveUniform(e,a).name.length+1);A[t>>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength){var i=cr.getProgramParameter(e,35721);for(a=0;a<i;++a)e.maxAttributeLength=Math.max(e.maxAttributeLength,cr.getActiveAttrib(e,a).name.length+1)}A[t>>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength){var s=cr.getProgramParameter(e,35382);for(a=0;a<s;++a)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,cr.getActiveUniformBlockName(e,a).length+1)}A[t>>2]=e.maxUniformBlockNameLength}else A[t>>2]=cr.getProgramParameter(e,r);else Dr.recordError(1281)},Ya:(e,r,t,n)=>{var o=cr.getShaderInfoLog(Dr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?vr(o,n,r):0;t&&(A[t>>2]=a)},ha:(e,r,t)=>{if(t)if(35716==r){var n=cr.getShaderInfoLog(Dr.shaders[e]);null===n&&(n="(unknown error)"),A[t>>2]=n?n.length+1:0}else if(35720==r){var o=cr.getShaderSource(Dr.shaders[e]);A[t>>2]=o?o.length+1:0}else A[t>>2]=cr.getShaderParameter(Dr.shaders[e],r);else Dr.recordError(1281)},m:(e,r)=>cr.getUniformBlockIndex(Dr.programs[e],K(r)),o:(e,r)=>{if(r=K(r),e=Dr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n){e.uniformLocsById=n={},e.uniformArrayNamesById={};var a=cr.getProgramParameter(e,35718);for(r=0;r<a;++r){var i=cr.getActiveUniform(e,r),s=i.name,u=i.size,l=Vr(s),c=l>0?s.slice(0,l):s,d=e.uniformIdCounter;for(e.uniformIdCounter+=u,o[c]=[u,d],t=0;t<u;++t)n[d]=t,e.uniformArrayNamesById[d++]=c}}})(e);var t=e.uniformLocsById,n=0,o=r,a=Vr(r);a>0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n<i[0]&&(t[n+=i[1]]=t[n]||cr.getUniformLocation(e,r)))return n}else Dr.recordError(1281);var s;return-1},ab:(e,r,t)=>{for(var n=Nr[r],o=0;o<r;o++)n[o]=A[t+4*o>>2];cr.invalidateFramebuffer(e,n)},$b:e=>{cr.linkProgram(e=Dr.programs[e]),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},la:(e,r,t,n,o)=>cr.renderbufferStorageMultisample(e,r,t,n,o),u:(e,r,t,n)=>cr.scissor(e,r,t,n),_a:(e,r,t,n)=>{var o=Dr.getSource(e,r,t,n);cr.shaderSource(Dr.shaders[e],o)},S:(e,r,t)=>cr.stencilFunc(e,r,t),J:(e,r,t,n)=>cr.stencilFuncSeparate(e,r,t,n),R:(e,r,t)=>cr.stencilOp(e,r,t),I:(e,r,t,n)=>cr.stencilOpSeparate(e,r,t,n),oa:(e,r,t,n,o,a,i,s,u)=>{if(Dr.currentContext.version>=2){if(cr.currentPixelUnpackBufferBinding)return void cr.texImage2D(e,r,t,n,o,a,i,s,u);if(u){var l=zr(s),c=jr(u,l);return void cr.texImage2D(e,r,t,n,o,a,i,s,l,c)}}var d=u?((e,r,t,n,o)=>{var a=zr(e),i=(e=>({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*a.BYTES_PER_ELEMENT,s=((e,r,t)=>{var n=function(e,r){return e+r-1&-r}(e*t,Dr.unpackAlignment);return r*n})(t,n,i);return a.subarray(jr(o,a),jr(o+s,a))})(s,i,n,o,u):null;cr.texImage2D(e,r,t,n,o,a,i,s,d)},B:(e,r,t)=>cr.texParameteri(e,r,t),lb:(e,r)=>{cr.uniform1f(Gr(e),r)},ub:(e,r,t)=>{if(Dr.currentContext.version>=2)r&&cr.uniform1iv(Gr(e),A,t>>2,r);else{if(r<=288)for(var n=Wr[r],o=0;o<r;++o)n[o]=A[t+4*o>>2];else n=A.subarray(t>>2,t+4*r>>2);cr.uniform1iv(Gr(e),n)}},hb:(e,r,t)=>{cr.uniformBlockBinding(e=Dr.programs[e],r,t)},zb:e=>{cr.useProgram(e=Dr.programs[e]),cr.currentProgram=e},jb:(e,r,t,n,o,a)=>{var i=Dr.currentContext.clientBuffers[e];if(!cr.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,cr.vertexAttribPointer(e,r,t,!!n,o,a)},A:(e,r,t,n)=>cr.viewport(e,r,t,n),p:function(e,r){var t=Q();try{return er(e)(r)}catch(e){if(X(t),e!==e+0)throw e;at(1,0)}},e:function(e,r,t){var n=Q();try{return er(e)(r,t)}catch(e){if(X(n),e!==e+0)throw e;at(1,0)}},f:function(e,r,t,n){var o=Q();try{return er(e)(r,t,n)}catch(e){if(X(o),e!==e+0)throw e;at(1,0)}},T:function(e,r,t,n,o,a){var i=Q();try{return er(e)(r,t,n,o,a)}catch(e){if(X(i),e!==e+0)throw e;at(1,0)}},sa:function(e){var r=Q();try{er(e)()}catch(e){if(X(r),e!==e+0)throw e;at(1,0)}},c:function(e,r){var t=Q();try{er(e)(r)}catch(e){if(X(t),e!==e+0)throw e;at(1,0)}},b:function(e,r,t){var n=Q();try{er(e)(r,t)}catch(e){if(X(n),e!==e+0)throw e;at(1,0)}},k:function(e,r,t,n){var o=Q();try{er(e)(r,t,n)}catch(e){if(X(o),e!==e+0)throw e;at(1,0)}},G:function(e,r,t,n,o){var a=Q();try{er(e)(r,t,n,o)}catch(e){if(X(a),e!==e+0)throw e;at(1,0)}},wb:Tr,Yb:(e,r)=>{var t=0,n=0;return qr.mgrAdapter.get(e).features.forEach((e=>{var o=qr.FeatureNameString2Enum[e];void 0!==o&&(0!==r&&(A[r+t>>2]=o,t+=4),n++)})),n},Vb:e=>qr.mgrAdapter.release(e),Xb:(e,r,t,n)=>{var o=qr.mgrAdapter.get(e),a={};if(r){var i=$[r+8>>2];if(i){var s=$[r+12>>2];a.requiredFeatures=Array.from($.subarray(s>>2,s+4*i>>2),(e=>qr.FeatureName[e]))}var u=$[r+16>>2];if(u){var l=u+8,c={};function g(e,r){var t=$[l+r>>2];4294967295!=t&&(c[e]=t)}function v(e,r){var t=l+r;4294967295==$[t>>2]&&4294967295==$[t+4>>2]||(c[e]=4294967296*$[t+4>>2]+$[t>>2])}g("maxTextureDimension1D",0),g("maxTextureDimension2D",4),g("maxTextureDimension3D",8),g("maxTextureArrayLayers",12),g("maxBindGroups",16),g("maxBindGroupsPlusVertexBuffers",20),g("maxDynamicUniformBuffersPerPipelineLayout",28),g("maxDynamicStorageBuffersPerPipelineLayout",32),g("maxSampledTexturesPerShaderStage",36),g("maxSamplersPerShaderStage",40),g("maxStorageBuffersPerShaderStage",44),g("maxStorageTexturesPerShaderStage",48),g("maxUniformBuffersPerShaderStage",52),g("minUniformBufferOffsetAlignment",72),g("minStorageBufferOffsetAlignment",76),v("maxUniformBufferBindingSize",56),v("maxStorageBufferBindingSize",64),g("maxVertexBuffers",80),v("maxBufferSize",88),g("maxVertexAttributes",96),g("maxVertexBufferArrayStride",100),g("maxInterStageShaderComponents",104),g("maxInterStageShaderVariables",108),g("maxColorAttachments",112),g("maxColorAttachmentBytesPerSample",116),g("maxComputeWorkgroupStorageSize",120),g("maxComputeInvocationsPerWorkgroup",124),g("maxComputeWorkgroupSizeX",128),g("maxComputeWorkgroupSizeY",132),g("maxComputeWorkgroupSizeZ",136),g("maxComputeWorkgroupsPerDimension",140),a.requiredLimits=c}var d=$[r+20>>2];if(d){var f={};(m=$[d+4>>2])&&(f.label=K(m)),a.defaultQueue=f}var m,p=$[r+28>>2],h=$[r+32>>2];(m=$[r+4>>2])&&(a.label=K(m))}o.requestDevice(a).then((e=>{kr((()=>{var r={queueId:qr.mgrQueue.create(e.queue)},o=qr.mgrDevice.create(e,r);p&&e.lost.then((e=>{kr((()=>qr.errorCallback(p,qr.Int_DeviceLostReason[e.reason],e.message,h)))})),er(t)(0,o,0,n)}))}),(function(e){kr((()=>{var r=Q(),o=Hr(e.message);er(t)(1,0,o,n),X(r)}))}))},Va:e=>qr.mgrBindGroupLayout.release(e),Wa:e=>qr.mgrBindGroup.release(e),Ka:e=>{var r=qr.mgrBuffer.objects[e];if(r.onUnmap){for(var t of r.onUnmap)t();r.onUnmap=void 0}qr.mgrBuffer.get(e).destroy()},y:function(e){var r=qr.mgrBuffer.get(e).size;return BigInt(r)},Ja:e=>qr.mgrBuffer.release(e),Ca:e=>qr.mgrCommandBuffer.release(e),M:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:qr.mgrQuerySet.get($[e>>2]),beginningOfPassWriteIndex:$[e+4>>2],endOfPassWriteIndex:$[e+8>>2]}}($[r+8>>2])};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrCommandEncoder.get(e);return qr.mgrComputePassEncoder.create(o.beginComputePass(t))},da:(e,r)=>{function t(e){var r=$[e+4>>2];if(0!==r){var t=A[e+8>>2];-1==t&&(t=void 0);var n=$[e+16>>2],o=$[e+20>>2],a=qr.makeColor(e+24);return{view:qr.mgrTextureView.get(r),depthSlice:t,resolveTarget:qr.mgrTextureView.get($[e+12>>2]),clearValue:a,loadOp:qr.LoadOp[n],storeOp:qr.StoreOp[o]}}}function n(e,r){for(var n=[],o=0;o<e;++o)n.push(t(r+56*o));return n}function o(e){if(0!==e)return{view:qr.mgrTextureView.get($[e>>2]),depthClearValue:C[e+12>>2],depthLoadOp:qr.LoadOp[$[e+4>>2]],depthStoreOp:qr.StoreOp[$[e+8>>2]],depthReadOnly:!!$[e+16>>2],stencilClearValue:$[e+28>>2],stencilLoadOp:qr.LoadOp[$[e+20>>2]],stencilStoreOp:qr.StoreOp[$[e+24>>2]],stencilReadOnly:!!$[e+32>>2]}}function a(e){if(0!==e)return{querySet:qr.mgrQuerySet.get($[e>>2]),beginningOfPassWriteIndex:$[e+4>>2],endOfPassWriteIndex:$[e+8>>2]}}var i=function(e){var r=$[e>>2],t=void 0;0!==r&&(t=4294967296*$[r+4+8>>2]+$[r+8>>2]);var i={label:void 0,colorAttachments:n($[e+8>>2],$[e+12>>2]),depthStencilAttachment:o($[e+16>>2]),occlusionQuerySet:qr.mgrQuerySet.get($[e+20>>2]),timestampWrites:a($[e+24>>2]),maxDrawCount:t},s=$[e+4>>2];return s&&(i.label=K(s)),i}(r),s=qr.mgrCommandEncoder.get(e);return qr.mgrRenderPassEncoder.create(s.beginRenderPass(i))},Ha:(e,r,t,n)=>{var o=qr.mgrCommandEncoder.get(e),a=qr.makeExtent3D(n);o.copyTextureToTexture(qr.makeImageCopyTexture(r),qr.makeImageCopyTexture(t),a)},Da:(e,r)=>{var t=qr.mgrCommandEncoder.get(e);return qr.mgrCommandBuffer.create(t.finish())},Ba:e=>qr.mgrCommandEncoder.release(e),D:(e,r,t,n)=>{qr.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},L:e=>{qr.mgrComputePassEncoder.get(e).end()},K:e=>qr.mgrComputePassEncoder.release(e),i:(e,r,t,n,o)=>{var a=qr.mgrComputePassEncoder.get(e),i=qr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u<n;u++,o+=4)s.push($[o>>2]);a.setBindGroup(r,i,s)}},E:(e,r)=>{var t=qr.mgrComputePassEncoder.get(e),n=qr.mgrComputePipeline.get(r);t.setPipeline(n)},fc:e=>qr.mgrComputePipeline.release(e),F:(e,r)=>{function t(e){var r,t=$[e+8>>2],n=$[e+32>>2],o=$[e+36>>2],a=$[e+4>>2];if(t){var i=$[(r=e+24)>>2]+4294967296*A[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:qr.mgrBuffer.get(t),offset:4294967296*$[e+4+16>>2]+$[e+16>>2],size:i}}}return n?{binding:a,resource:qr.mgrSampler.get(n)}:{binding:a,resource:qr.mgrTextureView.get(o)}}var n={label:void 0,layout:qr.mgrBindGroupLayout.get($[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o<e;++o)n.push(t(r+40*o));return n}($[r+12>>2],$[r+16>>2])},o=$[r+4>>2];o&&(n.label=K(o));var a=qr.mgrDevice.get(e);return qr.mgrBindGroup.create(a.createBindGroup(n))},r:(e,r)=>{function t(e){var r=$[e+4>>2];if(r)return{type:qr.BufferBindingType[r],hasDynamicOffset:!!$[e+8>>2],minBindingSize:4294967296*$[e+4+16>>2]+$[e+16>>2]}}function n(e){var r=$[e+4>>2];if(r)return{type:qr.SamplerBindingType[r]}}function o(e){var r=$[e+4>>2];if(r)return{sampleType:qr.TextureSampleType[r],viewDimension:qr.TextureViewDimension[$[e+8>>2]],multisampled:!!$[e+12>>2]}}function a(e){var r=$[e+4>>2];if(r)return{access:qr.StorageTextureAccess[r],format:qr.TextureFormat[$[e+8>>2]],viewDimension:qr.TextureViewDimension[$[e+12>>2]]}}var i={entries:function(e,r){for(var i,s=[],u=0;u<e;++u)s.push({binding:$[(i=r+80*u)+4>>2],visibility:$[i+8>>2],buffer:t(i+16),sampler:n(i+40),texture:o(i+48),storageTexture:a(i+64)});return s}($[r+8>>2],$[r+12>>2])},s=$[r+4>>2];s&&(i.label=K(s));var u=qr.mgrDevice.get(e);return qr.mgrBindGroupLayout.create(u.createBindGroupLayout(i))},V:(e,r)=>{var t=!!$[r+24>>2],n={label:void 0,usage:$[r+8>>2],size:4294967296*$[r+4+16>>2]+$[r+16>>2],mappedAtCreation:t},o=$[r+4>>2];o&&(n.label=K(o));var a=qr.mgrDevice.get(e),i={},s=qr.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},Ea:(e,r)=>{var t;if(r){t={label:void 0};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrDevice.get(e);return qr.mgrCommandEncoder.create(o.createCommandEncoder(t))},gc:(e,r)=>{var t=(e=>{var r={label:void 0,layout:qr.makePipelineLayout($[e+8>>2]),compute:qr.makeProgrammableStageDescriptor(e+12)},t=$[e+4>>2];return t&&(r.label=K(t)),r})(r),n=qr.mgrDevice.get(e);return qr.mgrComputePipeline.create(n.createComputePipeline(t))},hc:(e,r)=>{for(var t=$[r+8>>2],n=$[r+12>>2],o=[],a=0;a<t;++a)o.push(qr.mgrBindGroupLayout.get($[n+4*a>>2]));var i={label:void 0,bindGroupLayouts:o},s=$[r+4>>2];s&&(i.label=K(s));var u=qr.mgrDevice.get(e);return qr.mgrPipelineLayout.create(u.createPipelineLayout(i))},l:(e,r)=>{var t=(e=>{function r(e){if(e)return{operation:qr.BlendOperation[$[e>>2]],srcFactor:qr.BlendFactor[$[e+4>>2]],dstFactor:qr.BlendFactor[$[e+8>>2]]}}function t(e){if(e)return{alpha:r(e+12),color:r(e+0)}}function n(e,r){for(var n,o,a=[],i=0;i<e;++i)a.push(0===(o=$[(n=r+16*i)+4>>2])?void 0:{format:qr.TextureFormat[o],blend:t($[n+8>>2]),writeMask:$[n+12>>2]});return a}function o(e){return{compare:qr.CompareFunction[$[e>>2]],failOp:qr.StencilOperation[$[e+4>>2]],depthFailOp:qr.StencilOperation[$[e+8>>2]],passOp:qr.StencilOperation[$[e+12>>2]]}}function a(e,r){for(var t,n=[],o=0;o<e;++o)n.push({format:qr.VertexFormat[$[(t=r+24*o)>>2]],offset:4294967296*$[t+4+8>>2]+$[t+8>>2],shaderLocation:$[t+16>>2]});return n}function i(e){if(e){var r=$[e+8>>2];return 1===r?null:{arrayStride:4294967296*$[e+4>>2]+$[e>>2],stepMode:qr.VertexStepMode[r],attributes:a($[e+12>>2],$[e+16>>2])}}}function s(e,r){if(e){for(var t=[],n=0;n<e;++n)t.push(i(r+24*n));return t}}var u={label:void 0,layout:qr.makePipelineLayout($[e+8>>2]),vertex:function(e){if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2]),buffers:s($[e+20>>2],$[e+24>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}}(e+12),primitive:function(e){if(e){var r=$[e>>2];return{topology:qr.PrimitiveTopology[$[e+4>>2]],stripIndexFormat:qr.IndexFormat[$[e+8>>2]],frontFace:qr.FrontFace[$[e+12>>2]],cullMode:qr.CullMode[$[e+16>>2]],unclippedDepth:7===(r?$[r+4>>2]:0)&&!!$[r+8>>2]}}}(e+40),depthStencil:function(e){if(e)return{format:qr.TextureFormat[$[e+4>>2]],depthWriteEnabled:!!$[e+8>>2],depthCompare:qr.CompareFunction[$[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:$[e+48>>2],stencilWriteMask:$[e+52>>2],depthBias:A[e+56>>2],depthBiasSlopeScale:C[e+60>>2],depthBiasClamp:C[e+64>>2]}}($[e+60>>2]),multisample:function(e){if(e)return{count:$[e+4>>2],mask:$[e+8>>2],alphaToCoverageEnabled:!!$[e+12>>2]}}(e+64),fragment:function(e){if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2]),targets:n($[e+20>>2],$[e+24>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}}($[e+80>>2])},l=$[e+4>>2];return l&&(u.label=K(l)),u})(r),n=qr.mgrDevice.get(e);return qr.mgrRenderPipeline.create(n.createRenderPipeline(t))},Ta:(e,r)=>{var t;if(r){t={label:void 0,addressModeU:qr.AddressMode[$[r+8>>2]],addressModeV:qr.AddressMode[$[r+12>>2]],addressModeW:qr.AddressMode[$[r+16>>2]],magFilter:qr.FilterMode[$[r+20>>2]],minFilter:qr.FilterMode[$[r+24>>2]],mipmapFilter:qr.MipmapFilterMode[$[r+28>>2]],lodMinClamp:C[r+32>>2],lodMaxClamp:C[r+36>>2],compare:qr.CompareFunction[$[r+40>>2]]};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrDevice.get(e);return qr.mgrSampler.create(o.createSampler(t))},ic:(e,r)=>{var t=$[r>>2],n=$[t+4>>2],o={label:void 0,code:""},a=$[r+4>>2];switch(a&&(o.label=K(a)),n){case 5:var i=$[t+12>>2]>>2;o.code=$.subarray(i,i+$[t+8>>2]);break;case 6:var s=$[t+8>>2];s&&(o.code=K(s))}var u=qr.mgrDevice.get(e);return qr.mgrShaderModule.create(u.createShaderModule(o))},W:(e,r)=>{var t={label:void 0,size:qr.makeExtent3D(r+16),mipLevelCount:$[r+32>>2],sampleCount:$[r+36>>2],dimension:qr.TextureDimension[$[r+12>>2]],format:qr.TextureFormat[$[r+28>>2]],usage:$[r+8>>2]},n=$[r+4>>2];n&&(t.label=K(n));var o=$[r+40>>2];if(o){var a=$[r+44>>2];t.viewFormats=Array.from(A.subarray(a>>2,a+4*o>>2),(e=>qr.TextureFormat[e]))}var i=qr.mgrDevice.get(e);return qr.mgrTexture.create(i.createTexture(t))},Ua:e=>{var r=qr.mgrDevice.objects[e].queueId;return qr.mgrQueue.reference(r),r},Wb:e=>qr.mgrDevice.release(e),Pb:(e,r)=>{var t=Rr($[$[r>>2]+8>>2]).getContext("webgpu");if(!t)return 0;var n=$[r+4>>2];return n&&(t.surfaceLabelWebGPU=K(n)),qr.mgrSurface.create(t)},Zb:(e,r,t,n)=>{var o;if(r&&(o={powerPreference:qr.PowerPreference[$[r+8>>2]],forceFallbackAdapter:!!$[r+16>>2]}),!("gpu"in navigator)){var a=Q(),i=Hr("WebGPU not available on this browser (navigator.gpu is not available)");return er(t)(1,0,i,n),void X(a)}navigator.gpu.requestAdapter(o).then((e=>{kr((()=>{if(e){var r=qr.mgrAdapter.create(e);er(t)(0,r,0,n)}else{var o=Q(),a=Hr("WebGPU not available on this system (requestAdapter returned null)");er(t)(1,0,a,n),X(o)}}))}),(e=>{kr((()=>{var r=Q(),o=Hr(e.message);er(t)(2,0,o,n),X(r)}))}))},dc:e=>qr.mgrPipelineLayout.release(e),Ia:e=>qr.mgrQueue.release(e),P:(e,r,t)=>{var n=qr.mgrQueue.get(e),o=Array.from(A.subarray(t>>2,t+4*r>>2),(e=>qr.mgrCommandBuffer.get(e)));n.submit(o)},N:function(e,r,t,n,o){t=Mr(t);var a=qr.mgrQueue.get(e),i=qr.mgrBuffer.get(r),s=E.subarray(n,n+o);a.writeBuffer(i,t,s,0,o)},ga:(e,r,t,n,o,a)=>{var i=qr.mgrQueue.get(e),s=qr.makeImageCopyTexture(r),u=qr.makeTextureDataLayout(o),l=qr.makeExtent3D(a),c=E.subarray(t,t+n);i.writeTexture(s,c,u,l)},$:(e,r,t,n,o,a)=>{qr.mgrRenderPassEncoder.get(e).drawIndexed(r,t,n,o,a)},ca:e=>{qr.mgrRenderPassEncoder.get(e).end()},ba:e=>qr.mgrRenderPassEncoder.release(e),d:(e,r,t,n,o)=>{var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u<n;u++,o+=4)s.push($[o>>2]);a.setBindGroup(r,i,s)}},aa:function(e,r,t,n,o){n=Mr(n),o=Mr(o);var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBuffer.get(r);-1==o&&(o=void 0),a.setIndexBuffer(i,qr.IndexFormat[t],n,o)},g:(e,r)=>{var t=qr.mgrRenderPassEncoder.get(e),n=qr.mgrRenderPipeline.get(r);t.setPipeline(n)},q:(e,r,t,n,o)=>{qr.mgrRenderPassEncoder.get(e).setScissorRect(r,t,n,o)},h:(e,r)=>{qr.mgrRenderPassEncoder.get(e).setStencilReference(r)},U:function(e,r,t,n,o){n=Mr(n),o=Mr(o);var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBuffer.get(t);-1==o&&(o=void 0),a.setVertexBuffer(r,i,n,o)},ec:e=>qr.mgrRenderPipeline.release(e),Ma:e=>qr.mgrSampler.release(e),cc:e=>qr.mgrShaderModule.release(e),ac:(e,r)=>{var t=$[r+4>>2],n=qr.mgrSurface.get(e),o=[$[r+28>>2],$[r+32>>2]];0!==o[0]&&(n.canvas.width=o[0]),0!==o[1]&&(n.canvas.height=o[1]);var a={device:qr.mgrDevice.get(t),format:qr.TextureFormat[$[r+8>>2]],usage:$[r+12>>2],alphaMode:qr.AlphaMode[$[r+24>>2]]},i=$[r+16>>2];if(i){var s=$[r+20>>2];a.viewFormats=Array.from(A.subarray(s>>2,s+4*i>>2),(e=>qr.TextureFormat[e]))}n.configure(a)},_b:(e,r)=>{var t=qr.mgrSurface.get(e);try{var n=qr.mgrTexture.create(t.getCurrentTexture());$[r>>2]=n,A[r+4>>2]=0,A[r+8>>2]=0}catch(e){$[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=5}},Qb:e=>qr.mgrSurface.release(e),bc:e=>{qr.mgrSurface.get(e).unconfigure()},Pa:(e,r)=>{var t;if(r){var n=$[r+20>>2],o=$[r+28>>2];t={format:qr.TextureFormat[$[r+8>>2]],dimension:qr.TextureViewDimension[$[r+12>>2]],baseMipLevel:$[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:$[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:qr.TextureAspect[$[r+32>>2]]};var a=$[r+4>>2];a&&(t.label=K(a))}var i=qr.mgrTexture.get(e);return qr.mgrTextureView.create(i.createView(t))},Na:e=>qr.mgrTexture.get(e).destroy(),Qa:e=>{var r=qr.mgrTexture.get(e);return qr.TextureFormat.indexOf(r.format)},Ra:e=>qr.mgrTexture.get(e).height,Sa:e=>qr.mgrTexture.get(e).width,ea:e=>qr.mgrTexture.release(e),Oa:e=>qr.mgrTextureView.release(e)},et=await async function(){function e(e,r){return w=(et=e.exports).lc,O(),Ke=et.qc,V(),et}M();var t,a={a:Yr};if(o.instantiateWasm)return new Promise(((r,t)=>{o.instantiateWasm(a,((t,n)=>{e(t),r(t.exports)}))}));R??=o.locateFile?(t="thorvg-wasm.wasm",o.locateFile?o.locateFile(t,h):h+t):new URL("thorvg-wasm.wasm","undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href).href;try{return e((await async function(e,r,t){if(!e&&"function"==typeof WebAssembly.instantiateStreaming&&!L(r)&&!u)try{var n=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(e){b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation")}return async function(e,r){try{var t=await async function(e){if(!F)try{var r=await c(e);return new Uint8Array(r)}catch{}return function(e){if(e==R&&F)return new Uint8Array(F);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}(e)}(e);return await WebAssembly.instantiate(t,r)}catch(e){b(`failed to asynchronously prepare wasm: ${e}`),N(e)}}(r,t)}(F,R,a)).instance)}catch(e){return n(e),Promise.reject(e)}}(),rt=et.nc,tt=et.oc,nt=et.pc,ot=et.rc,at=et.sc,it=et.tc,st=et.uc,ut=et.vc;if(o.addRunDependency=M,o.removeRunDependency=V,o.FS_createPreloadedFile=me,o.FS_unlink=e=>he.unlink(e),o.FS_createPath=Xr,o.FS_createDevice=Zr,o.FS=he,o.FS_createDataFile=de,o.FS_createLazyFile=Qr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return function e(){function r(){o.calledRun=!0,D||(o.noFSInit||he.initialized||he.init(),et.mc(),he.ignorePermissions=!1,t(o),o.onRuntimeInitialized?.(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),W.unshift(e);var e;G(W)}())}U>0?I=e:(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),H.unshift(e);var e;G(H)}(),U>0?I=e:o.setStatus?(o.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>o.setStatus("")),1),r()}),1)):r())}(),a});function ye(e,r,t,n){var o,a=arguments.length,i=a<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(r,t,i):o(r,t))||i);return a>3&&i&&Object.defineProperty(r,t,i),i}let be,we=!1;var _e,xe,Ee,Se,Pe,Ae;e.Renderer=void 0,(_e=e.Renderer||(e.Renderer={})).SW="sw",_e.WG="wg",_e.GL="gl",e.InitStatus=void 0,(xe=e.InitStatus||(e.InitStatus={})).IDLE="idle",xe.FAILED="failed",xe.REQUESTED="requested",xe.INITIALIZED="initialized",e.FileType=void 0,(Ee=e.FileType||(e.FileType={})).JSON="json",Ee.LOT="lot",Ee.JPG="jpg",Ee.PNG="png",Ee.SVG="svg",e.PlayerState=void 0,(Se=e.PlayerState||(e.PlayerState={})).Destroyed="destroyed",Se.Error="error",Se.Loading="loading",Se.Paused="paused",Se.Playing="playing",Se.Stopped="stopped",Se.Frozen="frozen",e.PlayMode=void 0,(Pe=e.PlayMode||(e.PlayMode={})).Bounce="bounce",Pe.Normal="normal",e.PlayerEvent=void 0,(Ae=e.PlayerEvent||(e.PlayerEvent={})).Complete="complete",Ae.Destroyed="destroyed",Ae.Error="error",Ae.Frame="frame",Ae.Freeze="freeze",Ae.Load="load",Ae.Loop="loop",Ae.Pause="pause",Ae.Play="play",Ae.Ready="ready",Ae.Stop="stop";const $e=async(e,r)=>{const t=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),t.encode(n));case"string":if("json"===r||"lot"===r)return n=await(async e=>{try{e=JSON.parse(e)}catch(r){const t=await(async e=>{if("string"!=typeof e)throw new Error("The url value must be a string");try{const r=new URL(e),t=await fetch(r.toString());return await t.json()}catch(e){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(e);e=JSON.stringify(t)}return e})(n),t.encode(n);const e=await(async e=>(await fetch(e)).arrayBuffer())(n);return new Uint8Array(e);default:throw new Error("Invalid src type")}},Ce=e=>new Promise((r=>setTimeout(r,e))),Te=(e,r)=>{const t=document.createElement("a");t.setAttribute("href",URL.createObjectURL(r)),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)};let ke="idle";class Be extends oe{src;wasmUrl;fileType="json";renderConfig;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;_canvas;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(we)for(;!be;)await Ce(100);if(be||(we=!0,be=await ve({locateFile:(e,r)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg-wasm.wasm":r+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.renderConfig?.renderer||"sw";if(await(async e=>{if("wg"===e){for(;"requested"===ke;)await Ce(100);if("initialized"!==ke)for(ke="requested";;)switch(be.init()){case 0:return void(ke="initialized");case 1:return void(ke="failed");case 2:await Ce(100)}}})(e),"failed"===ke)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this._TVG=new be.TvgLottieAnimation(e,`#${this._canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:e,right:r,top:t,bottom:n}=this.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let i=0,s=0,u=this._canvas.width,l=this._canvas.height;e<0&&(i=Math.abs(e),u-=i),t<0&&(s=Math.abs(t),l-=s),r>o&&(u-=r-o),n>a&&(l-=n-a),this._TVG.viewport(i,s,u,l)}_observerCallback(e){const r=e[0],t=r.target;t._observable=r.isIntersecting,r.isIntersecting?"frozen"===t.currentState&&t.play():"playing"===t.currentState&&(t.freeze(),t.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this._canvas=this.querySelector(".thorvg"),this._canvas.id=`thorvg-${he().replaceAll("-","").substring(0,6)}`,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(e,r=""){if(!this._TVG.load(e,this.fileType,this._canvas.width,this._canvas.height,r))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.renderConfig?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:r,height:t}=this._canvas.getBoundingClientRect();this._canvas.width=r*e,this._canvas.height=t*e}if(this._TVG.resize(this._canvas.width,this._canvas.height),this._viewport(),!this._TVG.update())return;if("wg"===this.renderConfig?.renderer||"gl"===this.renderConfig?.renderer)return void this._TVG.render();const e=this._TVG.render(),r=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);r.length<1||(this._imageData=new ImageData(r,this._canvas.width,this._canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this._TVG.duration(),r=Date.now()/1e3;if(this.currentFrame=(r-this._beginTime)/e*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 e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)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 Ce(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(e){this.pause(),this.currentFrame=e,this._TVG.frame(e)}async load(e,r="json"){try{await this._init();const t=await $e(e,r);this.dispatchEvent(new CustomEvent("ready")),this.fileType=r,await this._loadBytes(t)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(!("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(e){this._frame(e),await this._update(),this._render()}resize(e,r){this._canvas.width=e,this._canvas.height=r,"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(){be.term(),be=null}setLooping(e){this._TVG&&(this.loop=e)}setDirection(e){this._TVG&&(this.direction=e)}setSpeed(e){this._TVG&&(this.speed=e)}setBgColor(e){this._TVG&&(this._canvas.style.backgroundColor=e)}save2png(){this._TVG&&this._canvas.toBlob((e=>{e&&Te("output.png",e)}),"image/png")}async save2gif(e){const r=new be.TvgLottieAnimation("sw",`#${this._canvas.id}`),t=await $e(e,"json");if(!r.save(t,"gif")){const e=r.error();throw r.delete(),new Error("Unable to save. Error: ",e)}const n=be.FS.readFile("output.gif");if(n.length<6)throw r.delete(),new Error("Unable to save the GIF data. The generated file size is invalid.");const o=new Blob([n],{type:"application/octet-stream"});Te("output.gif",o),r.delete()}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return z`
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["lottie-player"]={})}(this,(function(e){"use strict";var r="undefined"!=typeof document?document.currentScript:null;const t=globalThis,n=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new WeakMap;let i=class{constructor(e,r,t){if(this._$cssResult$=!0,t!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(n&&void 0===e){const t=void 0!==r&&1===r.length;t&&(e=a.get(r)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&a.set(r,e))}return e}toString(){return this.cssText}};const s=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let r="";for(const t of e.cssRules)r+=t.cssText;return(e=>new i("string"==typeof e?e:e+"",void 0,o))(r)})(e):e,{is:u,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:f,getPrototypeOf:m}=Object,p=globalThis,h=p.trustedTypes,g=h?h.emptyScript:"",v=p.reactiveElementPolyfillSupport,y=(e,r)=>e,b={toAttribute(e,r){switch(r){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,r){let t=e;switch(r){case Boolean:t=null!==e;break;case Number:t=null===e?null:Number(e);break;case Object:case Array:try{t=JSON.parse(e)}catch(e){t=null}}return t}},w=(e,r)=>!u(e,r),_={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=_){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const t=Symbol(),n=this.getPropertyDescriptor(e,t,r);void 0!==n&&l(this.prototype,e,n)}}static getPropertyDescriptor(e,r,t){const{get:n,set:o}=c(this.prototype,e)??{get(){return this[r]},set(e){this[r]=e}};return{get(){return n?.call(this)},set(r){const a=n?.call(this);o.call(this,r),this.requestUpdate(e,a,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,r=[...d(e),...f(e)];for(const t of r)this.createProperty(t,e[t])}const e=this[Symbol.metadata];if(null!==e){const r=litPropertyMetadata.get(e);if(void 0!==r)for(const[e,t]of r)this.elementProperties.set(e,t)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const t=new Set(e.flat(1/0).reverse());for(const e of t)r.unshift(s(e))}else void 0!==e&&r.push(s(e));return r}static _$Eu(e,r){const t=r.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const t of r.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,r)=>{if(n)e.adoptedStyleSheets=r.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of r){const r=document.createElement("style"),o=t.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=n.cssText,e.appendChild(r)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,t){this._$AK(e,t)}_$EC(e,r){const t=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,t);if(void 0!==n&&!0===t.reflect){const o=(void 0!==t.converter?.toAttribute?t.converter:b).toAttribute(r,t.type);this._$Em=e,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,r){const t=this.constructor,n=t._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=t.getPropertyOptions(n),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:b;this._$Em=n,this[n]=o.fromAttribute(r,e.type),this._$Em=null}}requestUpdate(e,r,t){if(void 0!==e){if(t??=this.constructor.getPropertyOptions(e),!(t.hasChanged??w)(this[e],r))return;this.P(e,r,t)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,r,t){this._$AL.has(e)||this._$AL.set(e,r),!0===t.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,r]of this._$Ep)this[e]=r;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[r,t]of e)!0!==t.wrapped||this._$AL.has(r)||void 0===this[r]||this.P(r,this[r],t)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(r)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[y("elementProperties")]=new Map,x[y("finalized")]=new Map,v?.({ReactiveElement:x}),(p.reactiveElementVersions??=[]).push("2.0.4");const E=globalThis,S=E.trustedTypes,P=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,A="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+$,T=`<${C}>`,k=document,B=()=>k.createComment(""),F=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,L="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,U=/>/g,I=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,V=/"/g,N=/^(?:script|style|textarea|title)$/i,z=(e,...r)=>({_$litType$:1,strings:e,values:r}),j=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),W=new WeakMap,H=k.createTreeWalker(k,129);function q(e,r){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(r):r}class X{constructor({strings:e,_$litType$:r},t){let n;this.parts=[];let o=0,a=0;const i=e.length-1,s=this.parts,[u,l]=((e,r)=>{const t=e.length-1,n=[];let o,a=2===r?"<svg>":3===r?"<math>":"",i=O;for(let r=0;r<t;r++){const t=e[r];let s,u,l=-1,c=0;for(;c<t.length&&(i.lastIndex=c,u=i.exec(t),null!==u);)c=i.lastIndex,i===O?"!--"===u[1]?i=R:void 0!==u[1]?i=U:void 0!==u[2]?(N.test(u[2])&&(o=RegExp("</"+u[2],"g")),i=I):void 0!==u[3]&&(i=I):i===I?">"===u[0]?(i=o??O,l=-1):void 0===u[1]?l=-2:(l=i.lastIndex-u[2].length,s=u[1],i=void 0===u[3]?I:'"'===u[3]?V:M):i===V||i===M?i=I:i===R||i===U?i=O:(i=I,o=void 0);const d=i===I&&e[r+1].startsWith("/>")?" ":"";a+=i===O?t+T:l>=0?(n.push(s),t.slice(0,l)+A+t.slice(l)+$+d):t+$+(-2===l?r:d)}return[q(e,a+(e[t]||"<?>")+(2===r?"</svg>":3===r?"</math>":"")),n]})(e,r);if(this.el=X.createElement(u,t),H.currentNode=this.el.content,2===r||3===r){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=H.nextNode())&&s.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(A)){const r=l[a++],t=n.getAttribute(e).split($),i=/([.?@])?(.*)/.exec(r);s.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?Y:"?"===i[1]?ee:"@"===i[1]?re:K}),n.removeAttribute(e)}else e.startsWith($)&&(s.push({type:6,index:o}),n.removeAttribute(e));if(N.test(n.tagName)){const e=n.textContent.split($),r=e.length-1;if(r>0){n.textContent=S?S.emptyScript:"";for(let t=0;t<r;t++)n.append(e[t],B()),H.nextNode(),s.push({type:2,index:++o});n.append(e[r],B())}}}else if(8===n.nodeType)if(n.data===C)s.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf($,e+1));)s.push({type:7,index:o}),e+=$.length-1}o++}}static createElement(e,r){const t=k.createElement("template");return t.innerHTML=e,t}}function Q(e,r,t=e,n){if(r===j)return r;let o=void 0!==n?t.o?.[n]:t.l;const a=F(r)?void 0:r._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(e),o._$AT(e,t,n)),void 0!==n?(t.o??=[])[n]=o:t.l=o),void 0!==o&&(r=Q(e,o._$AS(e,r.values),o,n)),r}class Z{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:t}=this._$AD,n=(e?.creationScope??k).importNode(r,!0);H.currentNode=n;let o=H.nextNode(),a=0,i=0,s=t[0];for(;void 0!==s;){if(a===s.index){let r;2===s.type?r=new J(o,o.nextSibling,this,e):1===s.type?r=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(r=new te(o,this,e)),this._$AV.push(r),s=t[++i]}a!==s?.index&&(o=H.nextNode(),a++)}return H.currentNode=k,n}p(e){let r=0;for(const t of this._$AV)void 0!==t&&(void 0!==t.strings?(t._$AI(e,t,r),r+=t.strings.length-2):t._$AI(e[r])),r++}}class J{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,r,t,n){this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=t,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return void 0!==r&&11===e?.nodeType&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Q(this,e,r),F(e)?e===G||null==e||""===e?(this._$AH!==G&&this._$AR(),this._$AH=G):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==G&&F(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){const{values:r,_$litType$:t}=e,n="number"==typeof t?this._$AC(e):(void 0===t.el&&(t.el=X.createElement(q(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===n)this._$AH.p(r);else{const e=new Z(n,this),t=e.u(this.options);e.p(r),this.T(t),this._$AH=e}}_$AC(e){let r=W.get(e.strings);return void 0===r&&W.set(e.strings,r=new X(e)),r}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let t,n=0;for(const o of e)n===r.length?r.push(t=new J(this.O(B()),this.O(B()),this,this.options)):t=r[n],t._$AI(o),n++;n<r.length&&(this._$AR(t&&t._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class K{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,t,n,o){this.type=1,this._$AH=G,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=o,t.length>2||""!==t[0]||""!==t[1]?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=G}_$AI(e,r=this,t,n){const o=this.strings;let a=!1;if(void 0===o)e=Q(this,e,r,0),a=!F(e)||e!==this._$AH&&e!==j,a&&(this._$AH=e);else{const n=e;let i,s;for(e=o[0],i=0;i<o.length-1;i++)s=Q(this,n[t+i],r,i),s===j&&(s=this._$AH[i]),a||=!F(s)||s!==this._$AH[i],s===G?e=G:e!==G&&(e+=(s??"")+o[i+1]),this._$AH[i]=s}a&&!n&&this.j(e)}j(e){e===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Y extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===G?void 0:e}}class ee extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==G)}}class re extends K{constructor(e,r,t,n,o){super(e,r,t,n,o),this.type=5}_$AI(e,r=this){if((e=Q(this,e,r,0)??G)===j)return;const t=this._$AH,n=e===G&&t!==G||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,o=e!==G&&(t===G||n);n&&this.element.removeEventListener(this.name,this,t),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class te{constructor(e,r,t){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}}const ne=E.litHtmlPolyfillSupport;ne?.(X,J),(E.litHtmlVersions??=[]).push("3.2.0");class oe extends x{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,r,t)=>{const n=t?.renderBefore??r;let o=n._$litPart$;if(void 0===o){const e=t?.renderBefore??null;n._$litPart$=o=new J(r.insertBefore(B(),e),e,void 0,t??{})}return o._$AI(e),o})(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return j}}oe._$litElement$=!0,oe.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:oe});const ae=globalThis.litElementPolyfillSupport;ae?.({LitElement:oe}),(globalThis.litElementVersions??=[]).push("4.1.0");const ie={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w},se=(e=ie,r,t)=>{const{kind:n,metadata:o}=t;let a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(t.name,e),"accessor"===n){const{name:n}=t;return{set(t){const o=r.get.call(this);r.set.call(this,t),this.requestUpdate(n,o,e)},init(r){return void 0!==r&&this.P(n,void 0,e),r}}}if("setter"===n){const{name:n}=t;return function(t){const o=this[n];r.call(this,t),this.requestUpdate(n,o,e)}}throw Error("Unsupported decorator location: "+n)};function ue(e){return(r,t)=>"object"==typeof t?se(e,r,t):((e,r,t)=>{const n=r.hasOwnProperty(t);return r.constructor.createProperty(t,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(r,t):void 0})(e,r,t)}for(var le,ce=[],de=0;de<256;++de)ce.push((de+256).toString(16).slice(1));var fe=new Uint8Array(16);function me(){if(!le&&!(le="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(fe)}var pe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function he(e,r,t){if(pe.randomUUID&&!r&&!e)return pe.randomUUID();var n=(e=e||{}).random||(e.rng||me)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,r=0){return(ce[e[r+0]]+ce[e[r+1]]+ce[e[r+2]]+ce[e[r+3]]+"-"+ce[e[r+4]]+ce[e[r+5]]+"-"+ce[e[r+6]]+ce[e[r+7]]+"-"+ce[e[r+8]]+ce[e[r+9]]+"-"+ce[e[r+10]]+ce[e[r+11]]+ce[e[r+12]]+ce[e[r+13]]+ce[e[r+14]]+ce[e[r+15]]).toLowerCase()}(n)}var ge,ve=(ge="undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href,async function(e={}){var t,n,o=e,a=new Promise(((e,r)=>{t=e,n=r})),i="object"==typeof window,s="undefined"!=typeof WorkerGlobalScope,u="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type;if(u){const{createRequire:e}=await Promise.resolve().then((function(){return De}));var l=e("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href)}var c,d,f={...o},m="./this.program",p=(e,r)=>{throw r},h="";if(u){var g=l("fs"),v=l("path");("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href).startsWith("data:")||(h=v.dirname(l("url").fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href))+"/"),d=e=>(e=L(e)?new URL(e):e,g.readFileSync(e)),c=async(e,r=!0)=>(e=L(e)?new URL(e):e,g.readFileSync(e,r?void 0:"utf8")),!o.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r}}else(i||s)&&(s?h=self.location.href:"undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),ge&&(h=ge),h=h.startsWith("blob:")?"":h.slice(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(d=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),c=async e=>{if(L(e))return new Promise(((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)}));var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)});var y=o.print||void 0,b=o.printErr||void 0;Object.assign(o,f),f=null,o.thisProgram&&(m=o.thisProgram);var w,_,x,E,S,P,A,$,C,T,k,B,F=o.wasmBinary,D=!1,L=e=>e.startsWith("file://");function O(){var e=w.buffer;o.HEAP8=x=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=E=new Uint8Array(e),o.HEAPU16=P=new Uint16Array(e),o.HEAP32=A=new Int32Array(e),o.HEAPU32=$=new Uint32Array(e),o.HEAPF32=C=new Float32Array(e),o.HEAPF64=B=new Float64Array(e),o.HEAP64=T=new BigInt64Array(e),o.HEAPU64=k=new BigUint64Array(e)}var R,U=0,I=null;function M(e){U++,o.monitorRunDependencies?.(U)}function V(e){if(U--,o.monitorRunDependencies?.(U),0==U&&I){var r=I;I=null,r()}}function N(e){o.onAbort?.(e),b(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}class z{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var j,G=e=>{for(;e.length>0;)e.shift()(o)},W=[],H=[],q=o.noExitRuntime||!0,X=e=>it(e),Q=()=>ut(),Z="undefined"!=typeof TextDecoder?new TextDecoder:void 0,J=(e,r=0,t=NaN)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Z)return Z.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var u=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var l=i-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},K=(e,r)=>e?J(E,e,r):"",Y=()=>{var e=A[+ve.varargs>>2];return ve.varargs+=4,e},ee=Y,re={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=re.isAbs(e),t="/"===e.slice(-1);return e=re.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"),e||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=re.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.slice(0,-1)),t+n):"."},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>re.normalize(e.join("/")),join2:(e,r)=>re.normalize(e+"/"+r)},te=e=>{(te=(()=>{if(u){var e=l("crypto");return r=>e.randomFillSync(r)}return e=>crypto.getRandomValues(e)})())(e)},ne={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:he.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=re.isAbs(o)}return r=re.normalizeArray(r.split("/").filter((e=>!!e)),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ne.resolve(e).slice(1),r=ne.resolve(r).slice(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},oe=[],ae=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},ie=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o},se=(e,r,t)=>{var n=ae(e)+1,o=new Array(n),a=ie(e,o,0,o.length);return o.length=a,o},ue={ttys:[],init(){},shutdown(){},register(e,r){ue.ttys[e]={input:[],output:[],ops:r},he.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var r=ue.ttys[e.node.rdev];if(!r)throw new he.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new he.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new he.ErrnoError(29)}if(void 0===s&&0===a)throw new he.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new he.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new he.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!oe.length){var e=null;if(u){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}t>0&&(e=r.slice(0,t).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;oe=se(e)}return oe.shift()})(),put_char(e,r){null===r||10===r?(y(J(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(y(J(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(b(J(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(b(J(e.output)),e.output=[])}}},le=e=>{N()},ce={ops_table:null,mount:e=>ce.createNode(null,"/",16895,0),createNode(e,r,t,n){if(he.isBlkdev(t)||he.isFIFO(t))throw new he.ErrnoError(63);ce.ops_table||={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:he.chrdev_stream_ops}};var o=he.createNode(e,r,t,n);return he.isDir(o.mode)?(o.node_ops=ce.ops_table.dir.node,o.stream_ops=ce.ops_table.dir.stream,o.contents={}):he.isFile(o.mode)?(o.node_ops=ce.ops_table.file.node,o.stream_ops=ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):he.isLink(o.mode)?(o.node_ops=ce.ops_table.link.node,o.stream_ops=ce.ops_table.link.stream):he.isChrdev(o.mode)&&(o.node_ops=ce.ops_table.chrdev.node,o.stream_ops=ce.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=he.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,r.size=he.isDir(e.mode)?4096:he.isFile(e.mode)?e.usedBytes:he.isLink(e.mode)?e.link.length:0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])null!=r[t]&&(e[t]=r[t]);void 0!==r.size&&ce.resizeFileStorage(e,r.size)},lookup(e,r){throw ce.doesNotExistError},mknod:(e,r,t,n)=>ce.createNode(e,r,t,n),rename(e,r,t){var n;try{n=he.lookupNode(r,t)}catch(e){}if(n){if(he.isDir(e.mode))for(var o in n.contents)throw new he.ErrnoError(55);he.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=he.lookupNode(e,r);for(var n in t.contents)throw new he.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.contents)],symlink(e,r,t){var n=ce.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!he.isLink(e.mode))throw new he.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===x.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.mtime=i.ctime=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(ce.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&he.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new he.ErrnoError(28);return n},mmap(e,r,t,n,o){if(!he.isFile(e.node.mode))throw new he.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==x.buffer){if(i=!0,!(a=le()))throw new he.ErrnoError(48);s&&((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),x.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(ce.stream_ops.write(e,r,0,n,t,!1),0)}},de=(e,r,t,n,o,a)=>{he.createDataFile(e,r,t,n,o,a)},fe=o.preloadPlugins||[],me=(e,r,t,n,o,a,i,s,u,l)=>{var d=r?ne.resolve(re.join2(e,r)):e;function f(t){function c(t){l?.(),s||de(e,r,t,n,o,u),a?.(),V()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return fe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,c,(()=>{i?.(),V()}))||c(t)}M(),"string"==typeof t?(async e=>{var r=await c(e);return new Uint8Array(r)})(t).then(f,i):f(t)},pe=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},he={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=he.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return he.isDir(this.mode)}get isDevice(){return he.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new he.ErrnoError(44);r.follow_mount??=!0,re.isAbs(e)||(e=he.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter((e=>!!e)),o=he.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&r.parent)break;if("."!==n[i])if(".."!==n[i]){a=re.join2(a,n[i]);try{o=he.lookupNode(o,n[i])}catch(e){if(44===e?.errno&&s&&r.noent_okay)return{path:a};throw e}if(!he.isMountpoint(o)||s&&!r.follow_mount||(o=o.mounted.root),he.isLink(o.mode)&&(!s||r.follow)){if(!o.node_ops.readlink)throw new he.ErrnoError(52);var u=o.node_ops.readlink(o);re.isAbs(u)||(u=re.dirname(a)+"/"+u),e=u+"/"+n.slice(i+1).join("/");continue e}}else a=re.dirname(a),o=o.parent}return{path:a,node:o}}throw new he.ErrnoError(32)},getPath(e){for(var r;;){if(he.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%he.nameTable.length},hashAddNode(e){var r=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[r],he.nameTable[r]=e},hashRemoveNode(e){var r=he.hashName(e.parent.id,e.name);if(he.nameTable[r]===e)he.nameTable[r]=e.name_next;else for(var t=he.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=he.mayLookup(e);if(t)throw new he.ErrnoError(t);for(var n=he.hashName(e.id,r),o=he.nameTable[n];o;o=o.name_next)if(o.parent.id===e.id&&o.name===r)return o;return he.lookup(e,r)},createNode(e,r,t,n){var o=new he.FSNode(e,r,t,n);return he.hashAddNode(o),o},destroyNode(e){he.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>he.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>he.isDir(e.mode)?he.nodePermissions(e,"x")||(e.node_ops.lookup?0:2):54,mayCreate(e,r){if(!he.isDir(e.mode))return 54;try{return he.lookupNode(e,r),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=he.lookupNode(e,r)}catch(e){return e.errno}var o=he.nodePermissions(e,"wx");if(o)return o;if(t){if(!he.isDir(n.mode))return 54;if(he.isRoot(n)||he.getPath(n)===he.cwd())return 10}else if(he.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(r)||576&r)?31:he.nodePermissions(e,he.flagsToPermissionString(r)):44,checkOpExists(e,r){if(!e)throw new he.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=he.MAX_OPEN_FDS;e++)if(!he.streams[e])return e;throw new he.ErrnoError(33)},getStreamChecked(e){var r=he.getStream(e);if(!r)throw new he.ErrnoError(8);return r},getStream:e=>he.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new he.FSStream,e),-1==r&&(r=he.nextfd()),e.fd=r,he.streams[r]=e,e),closeStream(e){he.streams[e]=null},dupStream(e,r=-1){var t=he.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,o=n?e:r;n??=r.node_ops.setattr,he.checkOpExists(n,63),n(o,t)},chrdev_stream_ops:{open(e){var r=he.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){he.devices[e]={stream_ops:r}},getDevice:e=>he.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),he.syncFSRequests++,he.syncFSRequests>1&&b(`warning: ${he.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=he.getMounts(he.root.mount),n=0;function o(e){return he.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&he.root)throw new he.ErrnoError(10);if(!o&&!a){var i=he.lookupPath(t,{follow_mount:!1});if(t=i.path,he.isMountpoint(n=i.node))throw new he.ErrnoError(10);if(!he.isDir(n.mode))throw new he.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?he.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(r.node))throw new he.ErrnoError(28);var t=r.node,n=t.mounted,o=he.getMounts(n);Object.keys(he.nameTable).forEach((e=>{for(var r=he.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&he.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=he.lookupPath(e,{parent:!0}).node,o=re.basename(e);if(!o)throw new he.ErrnoError(28);if("."===o||".."===o)throw new he.ErrnoError(20);var a=he.mayCreate(n,o);if(a)throw new he.ErrnoError(a);if(!n.node_ops.mknod)throw new he.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},statfs:e=>he.statfsNode(he.lookupPath(e,{follow:!0}).node),statfsStream:e=>he.statfsNode(e.node),statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:he.nextInode,ffree:he.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create:(e,r=438)=>(r&=4095,he.mknod(e,r|=32768,0)),mkdir:(e,r=511)=>(r&=1023,he.mknod(e,r|=16384,0)),mkdirTree(e,r){var t=e.split("/"),n="";for(var o of t)if(o){(n||re.isAbs(e))&&(n+="/"),n+=o;try{he.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),he.mknod(e,r|=8192,t)),symlink(e,r){if(!ne.resolve(e))throw new he.ErrnoError(44);var t=he.lookupPath(r,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var n=re.basename(r),o=he.mayCreate(t,n);if(o)throw new he.ErrnoError(o);if(!t.node_ops.symlink)throw new he.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=re.dirname(e),a=re.dirname(r),i=re.basename(e),s=re.basename(r);if(t=he.lookupPath(e,{parent:!0}).node,n=he.lookupPath(r,{parent:!0}).node,!t||!n)throw new he.ErrnoError(44);if(t.mount!==n.mount)throw new he.ErrnoError(75);var u,l=he.lookupNode(t,i),c=ne.relative(e,a);if("."!==c.charAt(0))throw new he.ErrnoError(28);if("."!==(c=ne.relative(r,o)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(n,s)}catch(e){}if(l!==u){var d=he.isDir(l.mode),f=he.mayDelete(t,i,d);if(f)throw new he.ErrnoError(f);if(f=u?he.mayDelete(n,s,d):he.mayCreate(n,s))throw new he.ErrnoError(f);if(!t.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(l)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(n!==t&&(f=he.nodePermissions(t,"w")))throw new he.ErrnoError(f);he.hashRemoveNode(l);try{t.node_ops.rename(l,n,s),l.parent=n}catch(e){throw e}finally{he.hashAddNode(l)}}},rmdir(e){var r=he.lookupPath(e,{parent:!0}).node,t=re.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!0);if(o)throw new he.ErrnoError(o);if(!r.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.rmdir(r,t),he.destroyNode(n)},readdir(e){var r=he.lookupPath(e,{follow:!0}).node;return he.checkOpExists(r.node_ops.readdir,54)(r)},unlink(e){var r=he.lookupPath(e,{parent:!0}).node;if(!r)throw new he.ErrnoError(44);var t=re.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!1);if(o)throw new he.ErrnoError(o);if(!r.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.unlink(r,t),he.destroyNode(n)},readlink(e){var r=he.lookupPath(e).node;if(!r)throw new he.ErrnoError(44);if(!r.node_ops.readlink)throw new he.ErrnoError(28);return r.node_ops.readlink(r)},stat(e,r){var t=he.lookupPath(e,{follow:!r}).node;return he.checkOpExists(t.node_ops.getattr,63)(t)},fstat(e){var r=he.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,o=n?r:t;return n??=t.node_ops.getattr,he.checkOpExists(n,63),n(o)},lstat:e=>he.stat(e,!0),doChmod(e,r,t,n){he.doSetAttr(e,r,{mode:4095&t|-4096&r.mode,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;n="string"==typeof e?he.lookupPath(e,{follow:!t}).node:e,he.doChmod(null,n,r,t)},lchmod(e,r){he.chmod(e,r,!0)},fchmod(e,r){var t=he.getStreamChecked(e);he.doChmod(t,t.node,r,!1)},doChown(e,r,t){he.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var o;o="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e,he.doChown(null,o,n)},lchown(e,r,t){he.chown(e,r,t,!0)},fchown(e,r,t){var n=he.getStreamChecked(e);he.doChown(n,n.node,!1)},doTruncate(e,r,t){if(he.isDir(r.mode))throw new he.ErrnoError(31);if(!he.isFile(r.mode))throw new he.ErrnoError(28);var n=he.nodePermissions(r,"w");if(n)throw new he.ErrnoError(n);he.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new he.ErrnoError(28);var t;t="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e,he.doTruncate(null,t,r)},ftruncate(e,r){var t=he.getStreamChecked(e);if(r<0||!(2097155&t.flags))throw new he.ErrnoError(28);he.doTruncate(t,t.node,r)},utime(e,r,t){var n=he.lookupPath(e,{follow:!0}).node;he.checkOpExists(n.node_ops.setattr,63)(n,{atime:r,mtime:t})},open(e,r,t=438){if(""===e)throw new he.ErrnoError(44);var n,a;if(t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{a=e.endsWith("/");var i=he.lookupPath(e,{follow:!(131072&r),noent_okay:!0});n=i.node,e=i.path}var s=!1;if(64&r)if(n){if(128&r)throw new he.ErrnoError(20)}else{if(a)throw new he.ErrnoError(31);n=he.mknod(e,511|t,0),s=!0}if(!n)throw new he.ErrnoError(44);if(he.isChrdev(n.mode)&&(r&=-513),65536&r&&!he.isDir(n.mode))throw new he.ErrnoError(54);if(!s){var u=he.mayOpen(n,r);if(u)throw new he.ErrnoError(u)}512&r&&!s&&he.truncate(n,0),r&=-131713;var l=he.createStream({node:n,path:he.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),s&&he.chmod(n,511&t),!o.logReadFiles||1&r||e in he.readFiles||(he.readFiles[e]=1),l},close(e){if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new he.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(!(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);if(!r)throw new he.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new he.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=he.open(e,r.flags),o=he.stat(e).size,a=new Uint8Array(o);return he.read(n,a,0,o,0),"utf8"===r.encoding?t=J(a):"binary"===r.encoding&&(t=a),he.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=he.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ae(r)+1),a=ie(r,o,0,o.length);he.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");he.write(n,r,0,r.byteLength,void 0,t.canOwn)}he.close(n)},cwd:()=>he.currentPath,chdir(e){var r=he.lookupPath(e,{follow:!0});if(null===r.node)throw new he.ErrnoError(44);if(!he.isDir(r.node.mode))throw new he.ErrnoError(54);var t=he.nodePermissions(r.node,"x");if(t)throw new he.ErrnoError(t);he.currentPath=r.path},createDefaultDirectories(){he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices(){he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n,llseek:()=>0}),he.mkdev("/dev/null",he.makedev(1,3)),ue.register(he.makedev(5,0),ue.default_tty_ops),ue.register(he.makedev(6,0),ue.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(te(e),r=e.byteLength),e[--r]);he.createDevice("/dev","random",t),he.createDevice("/dev","urandom",t),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories(){he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount(){var r=he.createNode(e,"fd",16895,73);return r.stream_ops={llseek:ce.stream_ops.llseek},r.node_ops={lookup(e,r){var t=+r,n=he.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(he.streams.entries()).filter((([e,r])=>r)).map((([e,r])=>e.toString()))},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?he.createDevice("/dev","stdin",e):he.symlink("/dev/tty","/dev/stdin"),r?he.createDevice("/dev","stdout",null,r):he.symlink("/dev/tty","/dev/stdout"),t?he.createDevice("/dev","stderr",null,t):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},staticInit(){he.nameTable=new Array(4096),he.mount(ce,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:ce}},init(e,r,t){he.initialized=!0,e??=o.stdin,r??=o.stdout,t??=o.stderr,he.createStandardStreams(e,r,t)},quit(){for(var e of(he.initialized=!1,he.streams))e&&he.close(e)},findObject(e,r){var t=he.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=he.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=he.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=re.basename(e),n=he.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:he.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=re.join2(e,a);try{he.mkdir(i)}catch(e){if(20!=e.errno)throw e}e=i}}return i},createFile(e,r,t,n,o){var a=re.join2("string"==typeof e?e:he.getPath(e),r),i=pe(n,o);return he.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:he.getPath(e),i=r?re.join2(e,r):e);var s=pe(n,o),u=he.create(i,s);if(t){if("string"==typeof t){for(var l=new Array(t.length),c=0,d=t.length;c<d;++c)l[c]=t.charCodeAt(c);t=l}he.chmod(u,146|s);var f=he.open(u,577);he.write(f,t,0,t.length,0,a),he.close(f),he.chmod(u,s)}},createDevice(e,r,t,n){var o=re.join2("string"==typeof e?e:he.getPath(e),r),a=pe(!!t,!!n);he.createDevice.major??=64;var i=he.makedev(he.createDevice.major++,0);return he.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new he.ErrnoError(29)}if(void 0===u&&0===i)throw new he.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new he.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}}),he.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("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.");try{e.contents=d(e.url),e.usedBytes=e.contents.length}catch(e){throw new he.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class a{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize;return this.getter(e/this.chunkSize|0)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):se(o.responseText||"")})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,y("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!s)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:t};var u=he.createFile(e,r,i,n,o);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(u.stream_ops).forEach((e=>{var r=u.stream_ops[e];l[e]=(...e)=>(he.forceLoadFile(u),r(...e))})),l.read=(e,r,t,n,o)=>(he.forceLoadFile(u),c(e,r,t,n,o)),l.mmap=(e,r,t,n,o)=>{he.forceLoadFile(u);var a=le();if(!a)throw new he.ErrnoError(48);return c(e,x,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=l,u}},ve={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(re.isAbs(r))return r;var n;if(n=-100===e?he.cwd():ve.getStreamFromFD(e).path,0==r.length){if(!t)throw new he.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){A[e>>2]=r.dev,A[e+4>>2]=r.mode,$[e+8>>2]=r.nlink,A[e+12>>2]=r.uid,A[e+16>>2]=r.gid,A[e+20>>2]=r.rdev,T[e+24>>3]=BigInt(r.size),A[e+32>>2]=4096,A[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),o=r.ctime.getTime();return T[e+40>>3]=BigInt(Math.floor(t/1e3)),$[e+48>>2]=t%1e3*1e3*1e3,T[e+56>>3]=BigInt(Math.floor(n/1e3)),$[e+64>>2]=n%1e3*1e3*1e3,T[e+72>>3]=BigInt(Math.floor(o/1e3)),$[e+80>>2]=o%1e3*1e3*1e3,T[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){A[e+4>>2]=r.bsize,A[e+40>>2]=r.bsize,A[e+8>>2]=r.blocks,A[e+12>>2]=r.bfree,A[e+16>>2]=r.bavail,A[e+20>>2]=r.files,A[e+24>>2]=r.ffree,A[e+28>>2]=r.fsid,A[e+44>>2]=r.flags,A[e+36>>2]=r.namelen},doMsync(e,r,t,n,o){if(!he.isFile(r.node.mode))throw new he.ErrnoError(43);if(2&n)return 0;var a=E.slice(e,e+t);he.msync(r,a,o,t,n)},getStreamFromFD:e=>he.getStreamChecked(e),varargs:void 0,getStr:e=>K(e)},ye=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},be=e=>{for(var r="",t=e;E[t];)r+=j[E[t++]];return r},we={},_e={},xe={},Ee=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Se=e=>{throw new Ee(e)};function Pe(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||Se(`type "${n}" must have a positive integer typeid pointer`),_e.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Se(`Cannot register type '${n}' twice`)}if(_e[e]=r,delete xe[e],we.hasOwnProperty(e)){var o=we[e];delete we[e],o.forEach((e=>e()))}}(e,r,t)}var Ae=(e,r,t)=>{switch(r){case 1:return t?e=>x[e]:e=>E[e];case 2:return t?e=>S[e>>1]:e=>P[e>>1];case 4:return t?e=>A[e>>2]:e=>$[e>>2];case 8:return t?e=>T[e>>3]:e=>k[e>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},$e=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ce=e=>{Se(e.$$.ptrType.registeredClass.name+" instance already deleted")},Te=!1,ke=e=>{},Be=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Fe=e=>"undefined"==typeof FinalizationRegistry?(Fe=e=>e,e):(Te=new FinalizationRegistry((e=>{Be(e.$$)})),Fe=e=>{var r=e.$$;return!r.smartPtr||Te.register(e,{$$:r},e),e},ke=e=>Te.unregister(e),Fe(e)),Le=[];function Oe(){}var Re=(e,r)=>Object.defineProperty(r,"name",{value:e}),Ue={},Ie=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||Se(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},Me=(e,r,t)=>{o.hasOwnProperty(e)?((void 0===t||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[t])&&Se(`Cannot register public name '${e}' twice`),Ie(o,e,e),o[e].overloadTable.hasOwnProperty(t)&&Se(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[e].overloadTable[t]=r):(o[e]=r,o[e].argCount=t)};function Ve(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Ne=(e,r,t)=>{for(;r!==t;)r.upcast||Se(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function ze(e,r){return null===r?(this.isReference&&Se(`null is not a valid ${this.name}`),0):(r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass))}function je(e,r){var t;if(null===r)return this.isReference&&Se(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;if(r&&r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Se(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`),t=Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Se("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Se(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var n=r.clone();t=this.rawShare(t,pr.toHandle((()=>n.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Se("Unsupporting sharing policy")}return t}function Ge(e,r){return null===r?(this.isReference&&Se(`null is not a valid ${this.name}`),0):(r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Se(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`),Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass))}function We(e){return this.fromWireType($[e>>2])}var He=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=He(e,r,t.baseClass);return null===n?null:t.downcast(n)},qe={},Xe=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Qe=e=>{throw new Xe(e)},Ze=(e,r)=>(r.ptrType&&r.ptr||Qe("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Qe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Fe(Object.create(e,{$$:{value:r,writable:!0}})));function Je(e,r,t,n,o,a,i,s,u,l,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,o||void 0!==r.baseClass?this.toWireType=je:n?(this.toWireType=ze,this.destructorFunction=null):(this.toWireType=Ge,this.destructorFunction=null)}var Ke,Ye=(e,r,t)=>{o.hasOwnProperty(e)||Qe("Replacing nonexistent public symbol"),void 0!==o[e].overloadTable&&void 0!==t?o[e].overloadTable[t]=r:(o[e]=r,o[e].argCount=t)},er=e=>Ke.get(e),rr=(e,r,t=!1)=>{e=be(e);var n=er(r);return"function"!=typeof n&&Se(`unknown function pointer with signature ${e}: ${r}`),n};class tr extends Error{}var nr=e=>{var r=nt(e),t=be(r);return rt(r),t},or=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||_e[r]||(xe[r]?xe[r].forEach(e):(t.push(r),n[r]=!0))})),new tr(`${e}: `+t.map(nr).join([", "]))},ar=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Qe("Mismatched type converter count");for(var o=0;o<e.length;++o)Pe(e[o],n[o])}e.forEach((e=>xe[e]=r));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{_e.hasOwnProperty(e)?o[r]=_e[e]:(a.push(e),we.hasOwnProperty(e)||(we[e]=[]),we[e].push((()=>{o[r]=_e[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},ir=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push($[r+4*n>>2]);return t},sr=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function ur(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function lr(e,r,t,n,o,a){var i=r.length;i<2&&Se("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==r[1]&&null!==t,u=ur(r),l="void"!==r[0].name,c=[e,Se,n,o,sr,r[0],r[1]],d=0;d<i-2;++d)c.push(r[d+2]);if(!u)for(d=s?1:2;d<r.length;++d)null!==r[d].destructorFunction&&c.push(r[d].destructorFunction);let[f,m]=function(e,r,t,n){var o=ur(e),a=e.length-2,i=[],s=["fn"];r&&s.push("thisWired");for(var u=0;u<a;++u)i.push(`arg${u}`),s.push(`arg${u}Wired`);i=i.join(","),s=s.join(",");var l=`return function (${i}) {\n`;o&&(l+="var destructors = [];\n");var c=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(l+=`var thisWired = classParam['toWireType'](${c}, this);\n`),u=0;u<a;++u)l+=`var arg${u}Wired = argType${u}['toWireType'](${c}, arg${u});\n`,d.push(`argType${u}`);if(l+=(t||n?"var rv = ":"")+`invoker(${s});\n`,o)l+="runDestructors(destructors);\n";else for(u=r?1:2;u<e.length;++u){var f=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(l+=`${f}_dtor(${f});\n`,d.push(`${f}_dtor`))}return t&&(l+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[d,l+="}\n"]}(r,s,l,a);var p=new Function(...f,m)(...c);return Re(e,p)}var cr,dr=e=>{const r=(e=e.trim()).indexOf("(");return-1===r?e:e.slice(0,r)},fr=[],mr=[],pr={toValue:e=>(e||Se(`Cannot use deleted val. handle = ${e}`),mr[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=fr.pop()||mr.length;return mr[r]=e,mr[r+1]=1,r}}}},hr={name:"emscripten::val",fromWireType:e=>{var r=pr.toValue(e);return(e=>{e>9&&0==--mr[e+1]&&(mr[e]=void 0,fr.push(e))})(e),r},toWireType:(e,r)=>pr.toHandle(r),argPackAdvance:8,readValueFromPointer:We,destructorFunction:null},gr=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(C[e>>2])};case 8:return function(e){return this.fromWireType(B[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},vr=(e,r,t)=>ie(e,E,r,t),yr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,br=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&P[n];)++n;if((t=n<<1)-e>32&&yr)return yr.decode(E.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},wr=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);S[r>>1]=i,r+=2}return S[r>>1]=0,r-n},_r=e=>2*e.length,xr=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=A[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Er=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),A[r>>2]=i,(r+=4)+4>o)break}return A[r>>2]=0,r-n},Sr=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Pr=0,Ar={},$r=e=>{if(e instanceof z||"unwind"==e)return _;p(1,e)},Cr=()=>q||Pr>0,Tr=e=>{_=e,Cr()||(o.onExit?.(e),D=!0),p(e,new z(e))},kr=e=>{if(!D)try{e(),(()=>{if(!Cr())try{_=e=_,Tr(e)}catch(e){$r(e)}var e})()}catch(e){$r(e)}},Br=e=>{var r=(e-w.buffer.byteLength+65535)/65536|0;try{return w.grow(r),O(),1}catch(e){}},Fr=e=>{var r=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_conservative_depth","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","NV_shader_noperspective_interpolation","WEBGL_clip_cull_distance","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter((e=>r.includes(e)))},Dr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{Dr.lastError||(Dr.lastError=e)},getNewId:e=>{for(var r=Dr.counter++,t=e.length;t<r;t++)e[t]=null;for(;e[r];)r=Dr.counter++;return r},genObject:(e,r,t,n)=>{for(var o=0;o<e;o++){var a=cr[t](),i=a&&Dr.getNewId(n);a?(a.name=i,n[i]=a):Dr.recordError(1282),A[r+4*o>>2]=i}},MAX_TEMP_BUFFER_SIZE:2097152,numTempVertexBuffersPerSize:64,log2ceilLookup:e=>32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=Dr.log2ceilLookup(Dr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=Dr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s<o;++s)a[s]=i[s]=null}if(e){r.tempQuadIndexBuffer=cr.createBuffer(),r.GLctx.bindBuffer(34963,r.tempQuadIndexBuffer);for(var u=Dr.MAX_TEMP_BUFFER_SIZE>>1,l=new Uint16Array(u),c=(n=0,0);l[n++]=c,!(n>=u||(l[n++]=c+1,n>=u)||(l[n++]=c+2,n>=u)||(l[n++]=c,n>=u)||(l[n++]=c+2,n>=u)||(l[n++]=c+3,n>=u));)c+=4;r.GLctx.bufferData(34963,l,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:e=>{var r=Dr.log2ceilLookup(e),t=Dr.currentContext.tempVertexBuffers1[r],n=Dr.currentContext.tempVertexBufferCounters1[r];Dr.currentContext.tempVertexBufferCounters1[r]=Dr.currentContext.tempVertexBufferCounters1[r]+1&Dr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=cr.getParameter(34964);return t[n]=cr.createBuffer(),cr.bindBuffer(34962,t[n]),cr.bufferData(34962,1<<r,35048),cr.bindBuffer(34962,a),t[n]},getTempIndexBuffer:e=>{var r=Dr.log2ceilLookup(e),t=Dr.currentContext.tempIndexBuffers[r];if(t)return t;var n=cr.getParameter(34965);return Dr.currentContext.tempIndexBuffers[r]=cr.createBuffer(),cr.bindBuffer(34963,Dr.currentContext.tempIndexBuffers[r]),cr.bufferData(34963,1<<r,35048),cr.bindBuffer(34963,n),Dr.currentContext.tempIndexBuffers[r]},newRenderingFrameStarted:()=>{if(Dr.currentContext){var e=Dr.currentContext.tempVertexBuffers1;Dr.currentContext.tempVertexBuffers1=Dr.currentContext.tempVertexBuffers2,Dr.currentContext.tempVertexBuffers2=e,e=Dr.currentContext.tempVertexBufferCounters1,Dr.currentContext.tempVertexBufferCounters1=Dr.currentContext.tempVertexBufferCounters2,Dr.currentContext.tempVertexBufferCounters2=e;for(var r=Dr.log2ceilLookup(Dr.MAX_TEMP_BUFFER_SIZE),t=0;t<=r;++t)Dr.currentContext.tempVertexBufferCounters1[t]=0}},getSource:(e,r,t,n)=>{for(var o="",a=0;a<r;++a)o+=K($[t+4*a>>2],n?$[n+4*a>>2]:void 0);return o},calcBufLength:(e,r,t,n)=>t>0?n*t:e*Dr.byteSizeByType[r-Dr.byteSizeByTypeRoot]*n,usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:e=>{Dr.resetBufferBinding=!1;for(var r=0;r<Dr.currentContext.maxVertexAttribs;++r){var t=Dr.currentContext.clientBuffers[r];if(t.clientside&&t.enabled){Dr.resetBufferBinding=!0;var n=Dr.calcBufLength(t.size,t.type,t.stride,e),o=Dr.getTempVertexBuffer(n);cr.bindBuffer(34962,o),cr.bufferSubData(34962,0,E.subarray(t.ptr,t.ptr+n)),t.vertexAttribPointerAdaptor.call(cr,r,t.size,t.type,t.normalized,t.stride,0)}}},postDrawHandleClientVertexAttribBindings:()=>{Dr.resetBufferBinding&&cr.bindBuffer(34962,Dr.buffers[cr.currentArrayBufferBinding])},createContext:(e,r)=>{if(!e.getContextSafariWebGL2Fixed){function n(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null}e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=n}var t=e.getContext(r.majorVersion>1?"webgl2":"webgl",r);return t?Dr.registerContext(t,r):0},registerContext:(e,r)=>{var t=Dr.getNewId(Dr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),Dr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&Dr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o<n.maxVertexAttribs;o++)n.clientBuffers[o]={enabled:!1,clientside:!1,size:0,type:0,normalized:0,stride:0,ptr:0,vertexAttribPointerAdaptor:null};return Dr.generateTempBuffers(!1,n),t},makeContextCurrent:e=>(Dr.currentContext=Dr.contexts[e],o.ctx=cr=Dr.currentContext?.GLctx,!(e&&!cr)),getContext:e=>Dr.contexts[e],deleteContext:e=>{Dr.currentContext===Dr.contexts[e]&&(Dr.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(Dr.contexts[e].GLctx.canvas),Dr.contexts[e]?.GLctx.canvas&&(Dr.contexts[e].GLctx.canvas.GLctxObject=void 0),Dr.contexts[e]=null},initExtensions:e=>{if(e||=Dr.currentContext,!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(r=t).multiDrawWebgl=r.getExtension("WEBGL_multi_draw"),(e=>{e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")})(t),(e=>{e.extClipControl=e.getExtension("EXT_clip_control")})(t),(e=>{e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")})(t),(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(e=>{e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")})(t),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),Fr(t).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},Lr=["default","low-power","high-performance"],Or=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],Rr=e=>{var r;return e=(r=e)>2?K(r):r,Or[e]||("undefined"!=typeof document?document.querySelector(e):null)},Ur={},Ir=()=>{if(!Ir.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(var r in Ur)void 0===Ur[r]?delete e[r]:e[r]=Ur[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Ir.strings=t}return Ir.strings},Mr=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),Vr=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Nr=[],zr=e=>0==(e-=5120)?x:1==e?E:2==e?S:4==e?A:6==e?C:5==e||28922==e||28520==e||30779==e||30782==e?$:P,jr=(e,r)=>e>>>31-Math.clz32(r.BYTES_PER_ELEMENT),Gr=e=>{var r=cr.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=cr.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?`[${t}]`:""))),t}Dr.recordError(1282)},Wr=[],Hr=e=>{var r=ae(e)+1,t=st(r);return vr(e,t,r),t},qr={errorCallback:(e,r,t,n)=>{var o=Q(),a=Hr(t);er(e)(r,a,n),X(o)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}qr.mgrSurface=new e,qr.mgrSwapChain=new e,qr.mgrAdapter=new e,qr.mgrDevice=new e,qr.mgrQueue=new e,qr.mgrCommandBuffer=new e,qr.mgrCommandEncoder=new e,qr.mgrRenderPassEncoder=new e,qr.mgrComputePassEncoder=new e,qr.mgrBindGroup=new e,qr.mgrBuffer=new e,qr.mgrSampler=new e,qr.mgrTexture=new e,qr.mgrTextureView=new e,qr.mgrQuerySet=new e,qr.mgrBindGroupLayout=new e,qr.mgrPipelineLayout=new e,qr.mgrRenderPipeline=new e,qr.mgrComputePipeline=new e,qr.mgrShaderModule=new e,qr.mgrRenderBundleEncoder=new e,qr.mgrRenderBundle=new e},makeColor:e=>({r:B[e>>3],g:B[e+8>>3],b:B[e+16>>3],a:B[e+24>>3]}),makeExtent3D:e=>({width:$[e>>2],height:$[e+4>>2],depthOrArrayLayers:$[e+8>>2]}),makeOrigin3D:e=>({x:$[e>>2],y:$[e+4>>2],z:$[e+8>>2]}),makeImageCopyTexture:e=>({texture:qr.mgrTexture.get($[e+4>>2]),mipLevel:$[e+8>>2],origin:qr.makeOrigin3D(e+12),aspect:qr.TextureAspect[$[e+24>>2]]}),makeTextureDataLayout:e=>{var r=$[e+16>>2],t=$[e+20>>2];return{offset:4294967296*$[e+4+8>>2]+$[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=qr.makeTextureDataLayout(e+8);return r.buffer=qr.mgrBuffer.get($[e+32>>2]),r},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n<e;++n){var o=r+16*n;t[K($[o+4>>2])]=B[o+8>>3]}return t}},makePipelineLayout:e=>e?qr.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}},fillLimitStruct:(e,r)=>{var t=r+8;function n(r,n){A[t+n>>2]=e[r]}function o(r,n){T[t+n>>3]=BigInt(e[r])}n("maxTextureDimension1D",0),n("maxTextureDimension2D",4),n("maxTextureDimension3D",8),n("maxTextureArrayLayers",12),n("maxBindGroups",16),n("maxBindGroupsPlusVertexBuffers",20),n("maxBindingsPerBindGroup",24),n("maxDynamicUniformBuffersPerPipelineLayout",28),n("maxDynamicStorageBuffersPerPipelineLayout",32),n("maxSampledTexturesPerShaderStage",36),n("maxSamplersPerShaderStage",40),n("maxStorageBuffersPerShaderStage",44),n("maxStorageTexturesPerShaderStage",48),n("maxUniformBuffersPerShaderStage",52),n("minUniformBufferOffsetAlignment",72),n("minStorageBufferOffsetAlignment",76),o("maxUniformBufferBindingSize",56),o("maxStorageBufferBindingSize",64),n("maxVertexBuffers",80),o("maxBufferSize",88),n("maxVertexAttributes",96),n("maxVertexBufferArrayStride",100),n("maxInterStageShaderComponents",104),n("maxInterStageShaderVariables",108),n("maxColorAttachments",112),n("maxColorAttachmentBytesPerSample",116),n("maxComputeWorkgroupStorageSize",120),n("maxComputeInvocationsPerWorkgroup",124),n("maxComputeWorkgroupSizeX",128),n("maxComputeWorkgroupSizeY",132),n("maxComputeWorkgroupSizeZ",136),n("maxComputeWorkgroupsPerDimension",140)},Int_BufferMapState:{unmapped:1,pending:2,mapped:3},Int_CompilationMessageType:{error:1,warning:2,info:3},Int_DeviceLostReason:{undefined:1,unknown:1,destroyed:2},Int_PreferredFormat:{rgba8unorm:18,bgra8unorm:23},WGSLFeatureName:[,"readonly_and_readwrite_storage_textures","packed_4x8_integer_dot_product","unrestricted_pointer_parameters","pointer_composite_access"],AddressMode:[,"clamp-to-edge","repeat","mirror-repeat"],AlphaMode:[,"opaque","premultiplied"],BlendFactor:[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:[,"add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],BufferMapState:{1:"unmapped",2:"pending",3:"mapped"},CompareFunction:[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:[,"none","front","back"],ErrorFilter:{1:"validation",2:"out-of-memory",3:"internal"},FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32-filterable"],FilterMode:[,"nearest","linear"],FrontFace:[,"ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:[,"nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:{1:"occlusion",2:"timestamp"},SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only","read-only","read-write"],StoreOp:[,"store","discard"],TextureAspect:[,"all","stencil-only","depth-only"],TextureDimension:[,"1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2"],VertexStepMode:[,"vertex-buffer-not-used","vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10","float32-filterable":"11"}},Xr=he.createPath,Qr=he.createLazyFile,Zr=he.createDevice;he.createPreloadedFile=me,he.staticInit(),o.FS_createPath=he.createPath,o.FS_createDataFile=he.createDataFile,o.FS_createPreloadedFile=he.createPreloadedFile,o.FS_unlink=he.unlink,o.FS_createLazyFile=he.createLazyFile,o.FS_createDevice=he.createDevice,ce.doesNotExistError=new he.ErrnoError(44),ce.doesNotExistError.stack="<generic error, no stack>",(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);j=e})(),(()=>{let e=Oe.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof Oe))return!1;if(!(e instanceof Oe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Ce(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Fe(Object.create(Object.getPrototypeOf(this),{$$:{value:$e(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ce(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),ke(this),Be(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ce(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),Le.push(this),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)})(),Object.assign(Je.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:We,fromWireType:function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Se("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(this.registeredClass,r),qe[r]))(0,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return Ze(this.registeredClass.instancePrototype,this.isSmartPointer?{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}:{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Ue[i];if(!s)return o.call(this);var u=He(r,this.registeredClass,(a=this.isConst?s.constPointerType:s.pointerType).registeredClass);return null===u?o.call(this):Ze(a.registeredClass.instancePrototype,this.isSmartPointer?{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}:{ptrType:a,ptr:u})}}),mr.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=()=>mr.length/2-5-fr.length,"undefined"!=typeof MainLoop&&MainLoop.preMainLoop.push((()=>Dr.newRenderingFrameStarted()));for(let e=0;e<32;++e)Nr.push(new Array(e));for(var Jr=new Int32Array(288),Kr=0;Kr<=288;++Kr)Wr[Kr]=Jr.subarray(0,Kr);qr.initManagers();var Yr={a:(e,r,t,n)=>N(`Assertion failed: ${K(e)}, at: `+[r?K(r):"unknown filename",t,n?K(n):"unknown function"]),xa:function(e,r,t){ve.varargs=t;try{var n=ve.getStreamFromFD(e);switch(r){case 0:if((o=Y())<0)return-28;for(;he.streams[o];)o++;return he.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Y();return n.flags|=o,0;case 12:return o=ee(),S[o+0>>1]=2,0}return-28}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ib:function(e,r,t){ve.varargs=t;try{var n=ve.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=ee();A[a>>2]=o.c_iflag||0,A[a+4>>2]=o.c_oflag||0,A[a+8>>2]=o.c_cflag||0,A[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)x[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=ee();var s=A[a>>2],u=A[a+4>>2],l=A[a+8>>2],c=A[a+12>>2],d=[];for(i=0;i<32;i++)d.push(x[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(a=ee(),A[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=ee(),he.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=ee(),S[a>>1]=f[0],S[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Kb:function(e,r,t,n){ve.varargs=n;try{r=ve.getStr(r),r=ve.calculateAt(e,r);var o=n?Y():0;return he.open(r,t,o).fd}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Lb:()=>N(""),za:(e,r,t,n,o)=>{var a=-1!=(r=be(r)).indexOf("u");Pe(e,{name:r,fromWireType:e=>e,toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${ye(r)}" to ${this.name}`);return"number"==typeof r&&(r=BigInt(r)),r},argPackAdvance:8,readValueFromPointer:Ae(r,t,!a),destructorFunction:null})},Ob:(e,r,t,n)=>{Pe(e,{name:r=be(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e])},destructorFunction:null})},Vb:(e,r,t,n,o,a,i,s,u,l,c,d,f)=>{c=be(c),a=rr(o,a),s&&=rr(i,s),l&&=rr(u,l),f=rr(d,f);var m=(e=>{var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(c);Me(m,(function(){or(`Cannot construct ${c} due to unbound types`,[n])})),ar([e,r,t],n?[n]:[],(r=>{var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:Oe.prototype;var i=Re(c,(function(...e){if(Object.getPrototypeOf(this)!==u)throw new Ee(`Use 'new' to construct ${c}`);if(void 0===d.constructor_body)throw new Ee(`${c} has no accessible constructor`);var r=d.constructor_body[e.length];if(void 0===r)throw new Ee(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Ve(c,i,u,f,t,a,s,l);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var p=new Je(c,d,!0,!1,!1),h=new Je(c+"*",d,!1,!1,!1),g=new Je(c+" const*",d,!1,!0,!1);return Ue[e]={pointerType:h,constPointerType:g},Ye(m,i),[p,h,g]}))},Ub:(e,r,t,n,o,a)=>{var i=ir(r,t);o=rr(n,o),ar([],[e],(e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{or(`Cannot construct ${e.name} due to unbound types`,i)},ar([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=lr(t,n,null,o,a),[]))),[]}))},x:(e,r,t,n,o,a,i,s,u,l)=>{var c=ir(t,n);r=be(r),r=dr(r),a=rr(o,a,u),ar([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function o(){or(`Cannot call ${n} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var l=e.registeredClass.instancePrototype,d=l[r];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===t-2?(o.argCount=t-2,o.className=e.name,l[r]=o):(Ie(l,r,n),l[r].overloadTable[t-2]=o),ar([],c,(o=>{var s=lr(n,o,e,a,i,u);return void 0===l[r].overloadTable?(s.argCount=t-2,l[r]=s):l[r].overloadTable[t-2]=s,[]})),[]}))},Mb:e=>Pe(e,hr),ya:(e,r,t)=>{Pe(e,{name:r=be(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:gr(r,t),destructorFunction:null})},Ca:(e,r,t,n,o,a,i,s)=>{var u=ir(r,t);e=be(e),e=dr(e),o=rr(n,o,i),Me(e,(function(){or(`Cannot call ${e} due to unbound types`,u)}),r-1),ar([],u,(t=>{var n=[t[0],null].concat(t.slice(1));return Ye(e,lr(e,n,null,o,a,i),r-1),[]}))},w:(e,r,t,n,o)=>{r=be(r);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned");Pe(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return r>>>0}:function(e,r){return r},argPackAdvance:8,readValueFromPointer:Ae(r,t,0!==n),destructorFunction:null})},n:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][r];function o(e){return new n(x.buffer,$[e+4>>2],$[e>>2])}Pe(e,{name:t=be(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Nb:(e,r)=>{Pe(e,{name:r=be(r),fromWireType(e){for(var r,t=$[e>>2],n=e+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==E[i]){var s=K(o,i-o);void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),o=i+1}}return rt(e),r},toWireType(e,r){var t;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||ArrayBuffer.isView(r)&&1==r.BYTES_PER_ELEMENT||Se("Cannot pass non-string to std::string"),t=n?ae(r):r.length;var o=tt(4+t+1),a=o+4;return $[o>>2]=t,n?vr(r,a,t+1):E.set(r,a),null!==e&&e.push(rt,o),o},argPackAdvance:8,readValueFromPointer:We,destructorFunction(e){rt(e)}})},Y:(e,r,t)=>{var n,o,a,i;t=be(t),2===r?(n=br,o=wr,i=_r,a=e=>P[e>>1]):4===r&&(n=xr,o=Er,i=Sr,a=e=>$[e>>2]),Pe(e,{name:t,fromWireType:e=>{for(var t,o=$[e>>2],i=e+4,s=0;s<=o;++s){var u=e+4+s*r;if(s==o||0==a(u)){var l=n(i,u-i);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),i=u+r}}return rt(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Se(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=tt(4+a+r);return $[s>>2]=a/r,o(n,s+4,a+r),null!==e&&e.push(rt,s),s},argPackAdvance:8,readValueFromPointer:We,destructorFunction(e){rt(e)}})},Pb:(e,r)=>{Pe(e,{isVoid:!0,name:r=be(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},zb:()=>{q=!1,Pr=0},xb:()=>{throw 1/0},Ba:(e,r)=>{var t,n;void 0===(n=_e[t=e])&&Se(`_emval_take_value has unknown type ${nr(t)}`);var o=(e=n).readValueFromPointer(r);return pr.toHandle(o)},Ab:(e,r)=>{if(Ar[e]&&(clearTimeout(Ar[e].id),delete Ar[e]),!r)return 0;var t=setTimeout((()=>{delete Ar[e],kr((()=>ot(e,performance.now())))}),r);return Ar[e]={id:t,timeout_ms:r},0},Bb:(e,r,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),u=i.getTimezoneOffset(),l=Math.max(s,u);$[e>>2]=60*l,A[r>>2]=Number(s!=u);var c=e=>{var r=e>=0?"-":"+",t=Math.abs(e);return`UTC${r}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},d=c(s),f=c(u);u<s?(vr(d,t,17),vr(f,n,17)):(vr(d,n,17),vr(f,t,17))},Eb:e=>{var r,t=E.length,n=2147483648;if((e>>>=0)>n)return!1;for(var o=1;o<=4;o*=2){var a=t*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(n,(r=Math.max(e,a),65536*Math.ceil(r/65536)));if(Br(i))return!0}return!1},Sb:(e,r)=>{var t=r>>2,n={alpha:!!x[r+0],depth:!!x[r+1],stencil:!!x[r+2],antialias:!!x[r+3],premultipliedAlpha:!!x[r+4],preserveDrawingBuffer:!!x[r+5],powerPreference:Lr[A[t+2]],failIfMajorPerformanceCaveat:!!x[r+12],majorVersion:A[t+4],minorVersion:A[t+5],enableExtensionsByDefault:x[r+24],explicitSwapControl:x[r+25],proxyContextToMainThread:A[t+7],renderViaOffscreenBackBuffer:x[r+32]},o=Rr(e);return o?n.explicitSwapControl?0:Dr.createContext(o,n):0},Tb:e=>{Dr.currentContext==e&&(Dr.currentContext=0),Dr.deleteContext(e)},ub:()=>Dr.currentContext?Dr.currentContext.handle:0,sa:e=>Dr.makeContextCurrent(e)?0:-5,Cb:(e,r)=>{var t=0;return Ir().forEach(((n,o)=>{var a=r+t;$[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)x[r++]=e.charCodeAt(t);x[r]=0})(n,a),t+=n.length+1})),0},Db:(e,r)=>{var t=Ir();$[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),$[r>>2]=n,0},wa:function(e){try{var r=ve.getStreamFromFD(e);return he.close(r),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Hb:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=$[r>>2],i=$[r+4>>2];r+=8;var s=he.read(e,x,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(ve.getStreamFromFD(e),r,t);return $[n>>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Fb:function(e,r,t,n){r=Mr(r);try{if(isNaN(r))return 61;var o=ve.getStreamFromFD(e);return he.llseek(o,r,t),T[n>>3]=BigInt(o.position),o.getdents&&0===r&&0===t&&(o.getdents=null),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Gb:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=$[r>>2],i=$[r+4>>2];r+=8;var s=he.write(e,x,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(ve.getStreamFromFD(e),r,t);return $[n>>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},lb:e=>cr.activeTexture(e),Fa:(e,r)=>{cr.attachShader(Dr.programs[e],Dr.shaders[r])},t:(e,r)=>{if(r&&!Dr.buffers[r]){var t=cr.createBuffer();t.name=r,Dr.buffers[r]=t}34962==e?cr.currentArrayBufferBinding=r:34963==e&&(cr.currentElementArrayBufferBinding=r),35051==e?cr.currentPixelPackBufferBinding=r:35052==e&&(cr.currentPixelUnpackBufferBinding=r),cr.bindBuffer(e,Dr.buffers[r])},jb:(e,r,t,n,o)=>{cr.bindBufferRange(e,r,Dr.buffers[t],n,o)},i:(e,r)=>{cr.bindFramebuffer(e,Dr.framebuffers[r])},X:(e,r)=>{cr.bindRenderbuffer(e,Dr.renderbuffers[r])},O:(e,r)=>{cr.bindTexture(e,Dr.textures[r])},ga:e=>{cr.bindVertexArray(Dr.vaos[e]);var r=cr.getParameter(34965);cr.currentElementArrayBufferBinding=r?0|r.name:0},W:e=>cr.blendEquation(e),v:(e,r)=>cr.blendFunc(e,r),y:(e,r,t,n,o,a,i,s,u,l)=>cr.blitFramebuffer(e,r,t,n,o,a,i,s,u,l),Ga:(e,r,t,n)=>{Dr.currentContext.version>=2?t&&r?cr.bufferData(e,E,n,t,r):cr.bufferData(e,r,n):cr.bufferData(e,t?E.subarray(t,t+r):r,n)},ia:e=>cr.clear(e),ja:(e,r,t,n)=>cr.clearColor(e,r,t,n),eb:e=>cr.clearDepth(e),fb:e=>cr.clearStencil(e),F:(e,r,t,n)=>{cr.colorMask(!!e,!!r,!!t,!!n)},$a:e=>{cr.compileShader(Dr.shaders[e])},Oa:()=>{var e=Dr.getNewId(Dr.programs),r=cr.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,Dr.programs[e]=r,e},bb:e=>{var r=Dr.getNewId(Dr.shaders);return Dr.shaders[r]=cr.createShader(e),r},tb:e=>cr.cullFace(e),pb:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.buffers[n];o&&(cr.deleteBuffer(o),o.name=0,Dr.buffers[n]=null,n==cr.currentArrayBufferBinding&&(cr.currentArrayBufferBinding=0),n==cr.currentElementArrayBufferBinding&&(cr.currentElementArrayBufferBinding=0),n==cr.currentPixelPackBufferBinding&&(cr.currentPixelPackBufferBinding=0),n==cr.currentPixelUnpackBufferBinding&&(cr.currentPixelUnpackBufferBinding=0))}},la:(e,r)=>{for(var t=0;t<e;++t){var n=A[r+4*t>>2],o=Dr.framebuffers[n];o&&(cr.deleteFramebuffer(o),o.name=0,Dr.framebuffers[n]=null)}},Aa:e=>{if(e){var r=Dr.programs[e];r?(cr.deleteProgram(r),r.name=0,Dr.programs[e]=null):Dr.recordError(1281)}},ka:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.renderbuffers[n];o&&(cr.deleteRenderbuffer(o),o.name=0,Dr.renderbuffers[n]=null)}},V:e=>{if(e){var r=Dr.shaders[e];r?(cr.deleteShader(r),Dr.shaders[e]=null):Dr.recordError(1281)}},ta:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.textures[n];o&&(cr.deleteTexture(o),o.name=0,Dr.textures[n]=null)}},db:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2];cr.deleteVertexArray(Dr.vaos[n]),Dr.vaos[n]=null}},rb:e=>cr.depthFunc(e),Q:e=>{cr.depthMask(!!e)},B:e=>cr.disable(e),hb:e=>{Dr.currentContext.clientBuffers[e].enabled=!1,cr.disableVertexAttribArray(e)},ib:(e,r,t,n)=>{var o,a=0;if(!cr.currentElementArrayBufferBinding){var i=Dr.calcBufLength(1,t,0,r);if(o=Dr.getTempIndexBuffer(i),cr.bindBuffer(34963,o),cr.bufferSubData(34963,0,E.subarray(n,n+i)),r>0)for(var s=0;s<Dr.currentContext.maxVertexAttribs;++s){var u=Dr.currentContext.clientBuffers[s];if(u.clientside&&u.enabled){let e;switch(t){case 5121:e=Uint8Array;break;case 5123:e=Uint16Array;break;case 5125:e=Uint32Array;break;default:return void Dr.recordError(1282)}a=new e(E.buffer,n,r).reduce(((e,r)=>Math.max(e,r)))+1;break}}n=0}Dr.preDrawHandleClientVertexAttribBindings(a),cr.drawElements(e,r,t,n),Dr.postDrawHandleClientVertexAttribBindings(r),cr.currentElementArrayBufferBinding||cr.bindBuffer(34963,null)},s:e=>cr.enable(e),nb:e=>{Dr.currentContext.clientBuffers[e].enabled=!0,cr.enableVertexAttribArray(e)},ma:(e,r,t,n)=>{cr.framebufferRenderbuffer(e,r,t,Dr.renderbuffers[n])},qb:(e,r,t,n,o)=>{cr.framebufferTexture2D(e,r,t,Dr.textures[n],o)},sb:e=>cr.frontFace(e),vb:(e,r)=>{Dr.genObject(e,r,"createBuffer",Dr.buffers)},pa:(e,r)=>{Dr.genObject(e,r,"createFramebuffer",Dr.framebuffers)},oa:(e,r)=>{Dr.genObject(e,r,"createRenderbuffer",Dr.renderbuffers)},ra:(e,r)=>{Dr.genObject(e,r,"createTexture",Dr.textures)},gb:(e,r)=>{Dr.genObject(e,r,"createVertexArray",Dr.vaos)},Va:(e,r)=>((e,r)=>{if(r){var t,n=void 0;switch(e){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var o=cr.getParameter(34467);n=o?o.length:0;break;case 33309:if(Dr.currentContext.version<2)return void Dr.recordError(1282);n=(t=Fr(cr),t=t.concat(t.map((e=>"GL_"+e))),t).length;break;case 33307:case 33308:if(Dr.currentContext.version<2)return void Dr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=cr.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void Dr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Dr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i<a.length;++i)A[r+4*i>>2]=a[i];return}try{n=0|a.name}catch(r){return Dr.recordError(1280),void b(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${r})`)}}break;default:return Dr.recordError(1280),void b(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${a} of type ${typeof a}!`)}}A[r>>2]=n}else Dr.recordError(1281)})(e,r),Wb:(e,r,t,n)=>{var o=cr.getProgramInfoLog(Dr.programs[e]);null===o&&(o="(unknown error)");var a=r>0&&n?vr(o,n,r):0;t&&(A[t>>2]=a)},Da:(e,r,t)=>{if(t)if(e>=Dr.counter)Dr.recordError(1281);else if(e=Dr.programs[e],35716==r){var n=cr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),A[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=cr.getProgramParameter(e,35718),a=0;a<o;++a)e.maxUniformLength=Math.max(e.maxUniformLength,cr.getActiveUniform(e,a).name.length+1);A[t>>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength){var i=cr.getProgramParameter(e,35721);for(a=0;a<i;++a)e.maxAttributeLength=Math.max(e.maxAttributeLength,cr.getActiveAttrib(e,a).name.length+1)}A[t>>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength){var s=cr.getProgramParameter(e,35382);for(a=0;a<s;++a)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,cr.getActiveUniformBlockName(e,a).length+1)}A[t>>2]=e.maxUniformBlockNameLength}else A[t>>2]=cr.getProgramParameter(e,r);else Dr.recordError(1281)},_a:(e,r,t,n)=>{var o=cr.getShaderInfoLog(Dr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?vr(o,n,r):0;t&&(A[t>>2]=a)},ha:(e,r,t)=>{if(t)if(35716==r){var n=cr.getShaderInfoLog(Dr.shaders[e]);null===n&&(n="(unknown error)"),A[t>>2]=n?n.length+1:0}else if(35720==r){var o=cr.getShaderSource(Dr.shaders[e]);A[t>>2]=o?o.length+1:0}else A[t>>2]=cr.getShaderParameter(Dr.shaders[e],r);else Dr.recordError(1281)},m:(e,r)=>cr.getUniformBlockIndex(Dr.programs[e],K(r)),o:(e,r)=>{if(r=K(r),e=Dr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n){e.uniformLocsById=n={},e.uniformArrayNamesById={};var a=cr.getProgramParameter(e,35718);for(r=0;r<a;++r){var i=cr.getActiveUniform(e,r),s=i.name,u=i.size,l=Vr(s),c=l>0?s.slice(0,l):s,d=e.uniformIdCounter;for(e.uniformIdCounter+=u,o[c]=[u,d],t=0;t<u;++t)n[d]=t,e.uniformArrayNamesById[d++]=c}}})(e);var t=e.uniformLocsById,n=0,o=r,a=Vr(r);a>0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n<i[0]&&(t[n+=i[1]]=t[n]||cr.getUniformLocation(e,r)))return n}else Dr.recordError(1281);var s;return-1},cb:(e,r,t)=>{for(var n=Nr[r],o=0;o<r;o++)n[o]=A[t+4*o>>2];cr.invalidateFramebuffer(e,n)},kc:e=>{cr.linkProgram(e=Dr.programs[e]),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},na:(e,r,t,n,o)=>cr.renderbufferStorageMultisample(e,r,t,n,o),u:(e,r,t,n)=>cr.scissor(e,r,t,n),ab:(e,r,t,n)=>{var o=Dr.getSource(e,r,t,n);cr.shaderSource(Dr.shaders[e],o)},S:(e,r,t)=>cr.stencilFunc(e,r,t),H:(e,r,t,n)=>cr.stencilFuncSeparate(e,r,t,n),R:(e,r,t)=>cr.stencilOp(e,r,t),G:(e,r,t,n)=>cr.stencilOpSeparate(e,r,t,n),qa:(e,r,t,n,o,a,i,s,u)=>{if(Dr.currentContext.version>=2){if(cr.currentPixelUnpackBufferBinding)return void cr.texImage2D(e,r,t,n,o,a,i,s,u);if(u){var l=zr(s),c=jr(u,l);return void cr.texImage2D(e,r,t,n,o,a,i,s,l,c)}}var d=u?((e,r,t,n,o)=>{var a=zr(e),i=(e=>({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*a.BYTES_PER_ELEMENT,s=((e,r,t)=>{var n=function(e,r){return e+r-1&-r}(e*t,Dr.unpackAlignment);return r*n})(t,n,i);return a.subarray(jr(o,a),jr(o+s,a))})(s,i,n,o,u):null;cr.texImage2D(e,r,t,n,o,a,i,s,d)},A:(e,r,t)=>cr.texParameteri(e,r,t),ob:(e,r)=>{cr.uniform1f(Gr(e),r)},wb:(e,r,t)=>{if(Dr.currentContext.version>=2)r&&cr.uniform1iv(Gr(e),A,t>>2,r);else{if(r<=288)for(var n=Wr[r],o=0;o<r;++o)n[o]=A[t+4*o>>2];else n=A.subarray(t>>2,t+4*r>>2);cr.uniform1iv(Gr(e),n)}},kb:(e,r,t)=>{cr.uniformBlockBinding(e=Dr.programs[e],r,t)},Jb:e=>{cr.useProgram(e=Dr.programs[e]),cr.currentProgram=e},mb:(e,r,t,n,o,a)=>{var i=Dr.currentContext.clientBuffers[e];if(!cr.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,cr.vertexAttribPointer(e,r,t,!!n,o,a)},z:(e,r,t,n)=>cr.viewport(e,r,t,n),q:function(e,r){var t=Q();try{return er(e)(r)}catch(e){if(X(t),e!==e+0)throw e;at(1,0)}},j:function(e,r,t){var n=Q();try{return er(e)(r,t)}catch(e){if(X(n),e!==e+0)throw e;at(1,0)}},f:function(e,r,t,n){var o=Q();try{return er(e)(r,t,n)}catch(e){if(X(o),e!==e+0)throw e;at(1,0)}},va:function(e,r,t,n,o,a){var i=Q();try{return er(e)(r,t,n,o,a)}catch(e){if(X(i),e!==e+0)throw e;at(1,0)}},ua:function(e){var r=Q();try{er(e)()}catch(e){if(X(r),e!==e+0)throw e;at(1,0)}},b:function(e,r){var t=Q();try{er(e)(r)}catch(e){if(X(t),e!==e+0)throw e;at(1,0)}},c:function(e,r,t){var n=Q();try{er(e)(r,t)}catch(e){if(X(n),e!==e+0)throw e;at(1,0)}},k:function(e,r,t,n){var o=Q();try{er(e)(r,t,n)}catch(e){if(X(o),e!==e+0)throw e;at(1,0)}},I:function(e,r,t,n,o){var a=Q();try{er(e)(r,t,n,o)}catch(e){if(X(a),e!==e+0)throw e;at(1,0)}},yb:Tr,_b:(e,r)=>{var t=0,n=0;return qr.mgrAdapter.get(e).features.forEach((e=>{var o=qr.FeatureNameString2Enum[e];void 0!==o&&(0!==r&&(A[r+t>>2]=o,t+=4),n++)})),n},Xb:e=>qr.mgrAdapter.release(e),Zb:(e,r,t,n)=>{var o=qr.mgrAdapter.get(e),a={};if(r){var i=$[r+8>>2];if(i){var s=$[r+12>>2];a.requiredFeatures=Array.from($.subarray(s>>2,s+4*i>>2),(e=>qr.FeatureName[e]))}var u=$[r+16>>2];if(u){var l=u+8,c={};function g(e,r){var t=$[l+r>>2];4294967295!=t&&(c[e]=t)}function v(e,r){var t=l+r;4294967295==$[t>>2]&&4294967295==$[t+4>>2]||(c[e]=4294967296*$[t+4>>2]+$[t>>2])}g("maxTextureDimension1D",0),g("maxTextureDimension2D",4),g("maxTextureDimension3D",8),g("maxTextureArrayLayers",12),g("maxBindGroups",16),g("maxBindGroupsPlusVertexBuffers",20),g("maxDynamicUniformBuffersPerPipelineLayout",28),g("maxDynamicStorageBuffersPerPipelineLayout",32),g("maxSampledTexturesPerShaderStage",36),g("maxSamplersPerShaderStage",40),g("maxStorageBuffersPerShaderStage",44),g("maxStorageTexturesPerShaderStage",48),g("maxUniformBuffersPerShaderStage",52),g("minUniformBufferOffsetAlignment",72),g("minStorageBufferOffsetAlignment",76),v("maxUniformBufferBindingSize",56),v("maxStorageBufferBindingSize",64),g("maxVertexBuffers",80),v("maxBufferSize",88),g("maxVertexAttributes",96),g("maxVertexBufferArrayStride",100),g("maxInterStageShaderComponents",104),g("maxInterStageShaderVariables",108),g("maxColorAttachments",112),g("maxColorAttachmentBytesPerSample",116),g("maxComputeWorkgroupStorageSize",120),g("maxComputeInvocationsPerWorkgroup",124),g("maxComputeWorkgroupSizeX",128),g("maxComputeWorkgroupSizeY",132),g("maxComputeWorkgroupSizeZ",136),g("maxComputeWorkgroupsPerDimension",140),a.requiredLimits=c}var d=$[r+20>>2];if(d){var f={};(m=$[d+4>>2])&&(f.label=K(m)),a.defaultQueue=f}var m,p=$[r+28>>2],h=$[r+32>>2];(m=$[r+4>>2])&&(a.label=K(m))}o.requestDevice(a).then((e=>{kr((()=>{var r={queueId:qr.mgrQueue.create(e.queue)},o=qr.mgrDevice.create(e,r);p&&e.lost.then((e=>{kr((()=>qr.errorCallback(p,qr.Int_DeviceLostReason[e.reason],e.message,h)))})),er(t)(0,o,0,n)}))}),(function(e){kr((()=>{var r=Q(),o=Hr(e.message);er(t)(1,0,o,n),X(r)}))}))},Ya:e=>qr.mgrBindGroupLayout.release(e),Za:e=>qr.mgrBindGroup.release(e),Pa:e=>{var r=qr.mgrBuffer.objects[e];if(r.onUnmap){for(var t of r.onUnmap)t();r.onUnmap=void 0}qr.mgrBuffer.get(e).destroy()},M:function(e){var r=qr.mgrBuffer.get(e).size;return BigInt(r)},Na:e=>qr.mgrBuffer.release(e),Ja:e=>qr.mgrCommandBuffer.release(e),L:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:qr.mgrQuerySet.get($[e>>2]),beginningOfPassWriteIndex:$[e+4>>2],endOfPassWriteIndex:$[e+8>>2]}}($[r+8>>2])};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrCommandEncoder.get(e);return qr.mgrComputePassEncoder.create(o.beginComputePass(t))},aa:(e,r)=>{function t(e){var r=$[e+4>>2];if(0!==r){var t=A[e+8>>2];-1==t&&(t=void 0);var n=$[e+16>>2],o=$[e+20>>2],a=qr.makeColor(e+24);return{view:qr.mgrTextureView.get(r),depthSlice:t,resolveTarget:qr.mgrTextureView.get($[e+12>>2]),clearValue:a,loadOp:qr.LoadOp[n],storeOp:qr.StoreOp[o]}}}function n(e,r){for(var n=[],o=0;o<e;++o)n.push(t(r+56*o));return n}function o(e){if(0!==e)return{view:qr.mgrTextureView.get($[e>>2]),depthClearValue:C[e+12>>2],depthLoadOp:qr.LoadOp[$[e+4>>2]],depthStoreOp:qr.StoreOp[$[e+8>>2]],depthReadOnly:!!$[e+16>>2],stencilClearValue:$[e+28>>2],stencilLoadOp:qr.LoadOp[$[e+20>>2]],stencilStoreOp:qr.StoreOp[$[e+24>>2]],stencilReadOnly:!!$[e+32>>2]}}function a(e){if(0!==e)return{querySet:qr.mgrQuerySet.get($[e>>2]),beginningOfPassWriteIndex:$[e+4>>2],endOfPassWriteIndex:$[e+8>>2]}}var i=function(e){var r=$[e>>2],t=void 0;0!==r&&(t=4294967296*$[r+4+8>>2]+$[r+8>>2]);var i={label:void 0,colorAttachments:n($[e+8>>2],$[e+12>>2]),depthStencilAttachment:o($[e+16>>2]),occlusionQuerySet:qr.mgrQuerySet.get($[e+20>>2]),timestampWrites:a($[e+24>>2]),maxDrawCount:t},s=$[e+4>>2];return s&&(i.label=K(s)),i}(r),s=qr.mgrCommandEncoder.get(e);return qr.mgrRenderPassEncoder.create(s.beginRenderPass(i))},Ha:(e,r,t,n)=>{var o=qr.mgrCommandEncoder.get(e),a=qr.makeExtent3D(n);o.copyTextureToTexture(qr.makeImageCopyTexture(r),qr.makeImageCopyTexture(t),a)},Ka:(e,r)=>{var t=qr.mgrCommandEncoder.get(e);return qr.mgrCommandBuffer.create(t.finish())},Ia:e=>qr.mgrCommandEncoder.release(e),C:(e,r,t,n)=>{qr.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},K:e=>{qr.mgrComputePassEncoder.get(e).end()},J:e=>qr.mgrComputePassEncoder.release(e),h:(e,r,t,n,o)=>{var a=qr.mgrComputePassEncoder.get(e),i=qr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u<n;u++,o+=4)s.push($[o>>2]);a.setBindGroup(r,i,s)}},D:(e,r)=>{var t=qr.mgrComputePassEncoder.get(e),n=qr.mgrComputePipeline.get(r);t.setPipeline(n)},gc:e=>qr.mgrComputePipeline.release(e),N:(e,r)=>{function t(e){var r,t=$[e+8>>2],n=$[e+32>>2],o=$[e+36>>2],a=$[e+4>>2];if(t){var i=$[(r=e+24)>>2]+4294967296*A[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:qr.mgrBuffer.get(t),offset:4294967296*$[e+4+16>>2]+$[e+16>>2],size:i}}}return n?{binding:a,resource:qr.mgrSampler.get(n)}:{binding:a,resource:qr.mgrTextureView.get(o)}}var n={label:void 0,layout:qr.mgrBindGroupLayout.get($[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o<e;++o)n.push(t(r+40*o));return n}($[r+12>>2],$[r+16>>2])},o=$[r+4>>2];o&&(n.label=K(o));var a=qr.mgrDevice.get(e);return qr.mgrBindGroup.create(a.createBindGroup(n))},r:(e,r)=>{function t(e){var r=$[e+4>>2];if(r)return{type:qr.BufferBindingType[r],hasDynamicOffset:!!$[e+8>>2],minBindingSize:4294967296*$[e+4+16>>2]+$[e+16>>2]}}function n(e){var r=$[e+4>>2];if(r)return{type:qr.SamplerBindingType[r]}}function o(e){var r=$[e+4>>2];if(r)return{sampleType:qr.TextureSampleType[r],viewDimension:qr.TextureViewDimension[$[e+8>>2]],multisampled:!!$[e+12>>2]}}function a(e){var r=$[e+4>>2];if(r)return{access:qr.StorageTextureAccess[r],format:qr.TextureFormat[$[e+8>>2]],viewDimension:qr.TextureViewDimension[$[e+12>>2]]}}var i={entries:function(e,r){for(var i,s=[],u=0;u<e;++u)s.push({binding:$[(i=r+80*u)+4>>2],visibility:$[i+8>>2],buffer:t(i+16),sampler:n(i+40),texture:o(i+48),storageTexture:a(i+64)});return s}($[r+8>>2],$[r+12>>2])},s=$[r+4>>2];s&&(i.label=K(s));var u=qr.mgrDevice.get(e);return qr.mgrBindGroupLayout.create(u.createBindGroupLayout(i))},P:(e,r)=>{var t=!!$[r+24>>2],n={label:void 0,usage:$[r+8>>2],size:4294967296*$[r+4+16>>2]+$[r+16>>2],mappedAtCreation:t},o=$[r+4>>2];o&&(n.label=K(o));var a=qr.mgrDevice.get(e),i={},s=qr.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},La:(e,r)=>{var t;if(r){t={label:void 0};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrDevice.get(e);return qr.mgrCommandEncoder.create(o.createCommandEncoder(t))},hc:(e,r)=>{var t=(e=>{var r={label:void 0,layout:qr.makePipelineLayout($[e+8>>2]),compute:qr.makeProgrammableStageDescriptor(e+12)},t=$[e+4>>2];return t&&(r.label=K(t)),r})(r),n=qr.mgrDevice.get(e);return qr.mgrComputePipeline.create(n.createComputePipeline(t))},ic:(e,r)=>{for(var t=$[r+8>>2],n=$[r+12>>2],o=[],a=0;a<t;++a)o.push(qr.mgrBindGroupLayout.get($[n+4*a>>2]));var i={label:void 0,bindGroupLayouts:o},s=$[r+4>>2];s&&(i.label=K(s));var u=qr.mgrDevice.get(e);return qr.mgrPipelineLayout.create(u.createPipelineLayout(i))},l:(e,r)=>{var t=(e=>{function r(e){if(e)return{operation:qr.BlendOperation[$[e>>2]],srcFactor:qr.BlendFactor[$[e+4>>2]],dstFactor:qr.BlendFactor[$[e+8>>2]]}}function t(e){if(e)return{alpha:r(e+12),color:r(e+0)}}function n(e,r){for(var n,o,a=[],i=0;i<e;++i)a.push(0===(o=$[(n=r+16*i)+4>>2])?void 0:{format:qr.TextureFormat[o],blend:t($[n+8>>2]),writeMask:$[n+12>>2]});return a}function o(e){return{compare:qr.CompareFunction[$[e>>2]],failOp:qr.StencilOperation[$[e+4>>2]],depthFailOp:qr.StencilOperation[$[e+8>>2]],passOp:qr.StencilOperation[$[e+12>>2]]}}function a(e,r){for(var t,n=[],o=0;o<e;++o)n.push({format:qr.VertexFormat[$[(t=r+24*o)>>2]],offset:4294967296*$[t+4+8>>2]+$[t+8>>2],shaderLocation:$[t+16>>2]});return n}function i(e){if(e){var r=$[e+8>>2];return 1===r?null:{arrayStride:4294967296*$[e+4>>2]+$[e>>2],stepMode:qr.VertexStepMode[r],attributes:a($[e+12>>2],$[e+16>>2])}}}function s(e,r){if(e){for(var t=[],n=0;n<e;++n)t.push(i(r+24*n));return t}}var u={label:void 0,layout:qr.makePipelineLayout($[e+8>>2]),vertex:function(e){if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2]),buffers:s($[e+20>>2],$[e+24>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}}(e+12),primitive:function(e){if(e){var r=$[e>>2];return{topology:qr.PrimitiveTopology[$[e+4>>2]],stripIndexFormat:qr.IndexFormat[$[e+8>>2]],frontFace:qr.FrontFace[$[e+12>>2]],cullMode:qr.CullMode[$[e+16>>2]],unclippedDepth:7===(r?$[r+4>>2]:0)&&!!$[r+8>>2]}}}(e+40),depthStencil:function(e){if(e)return{format:qr.TextureFormat[$[e+4>>2]],depthWriteEnabled:!!$[e+8>>2],depthCompare:qr.CompareFunction[$[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:$[e+48>>2],stencilWriteMask:$[e+52>>2],depthBias:A[e+56>>2],depthBiasSlopeScale:C[e+60>>2],depthBiasClamp:C[e+64>>2]}}($[e+60>>2]),multisample:function(e){if(e)return{count:$[e+4>>2],mask:$[e+8>>2],alphaToCoverageEnabled:!!$[e+12>>2]}}(e+64),fragment:function(e){if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2]),targets:n($[e+20>>2],$[e+24>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}}($[e+80>>2])},l=$[e+4>>2];return l&&(u.label=K(l)),u})(r),n=qr.mgrDevice.get(e);return qr.mgrRenderPipeline.create(n.createRenderPipeline(t))},Wa:(e,r)=>{var t;if(r){t={label:void 0,addressModeU:qr.AddressMode[$[r+8>>2]],addressModeV:qr.AddressMode[$[r+12>>2]],addressModeW:qr.AddressMode[$[r+16>>2]],magFilter:qr.FilterMode[$[r+20>>2]],minFilter:qr.FilterMode[$[r+24>>2]],mipmapFilter:qr.MipmapFilterMode[$[r+28>>2]],lodMinClamp:C[r+32>>2],lodMaxClamp:C[r+36>>2],compare:qr.CompareFunction[$[r+40>>2]]};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrDevice.get(e);return qr.mgrSampler.create(o.createSampler(t))},jc:(e,r)=>{var t=$[r>>2],n=$[t+4>>2],o={label:void 0,code:""},a=$[r+4>>2];switch(a&&(o.label=K(a)),n){case 5:var i=$[t+12>>2]>>2;o.code=$.subarray(i,i+$[t+8>>2]);break;case 6:var s=$[t+8>>2];s&&(o.code=K(s))}var u=qr.mgrDevice.get(e);return qr.mgrShaderModule.create(u.createShaderModule(o))},U:(e,r)=>{var t={label:void 0,size:qr.makeExtent3D(r+16),mipLevelCount:$[r+32>>2],sampleCount:$[r+36>>2],dimension:qr.TextureDimension[$[r+12>>2]],format:qr.TextureFormat[$[r+28>>2]],usage:$[r+8>>2]},n=$[r+4>>2];n&&(t.label=K(n));var o=$[r+40>>2];if(o){var a=$[r+44>>2];t.viewFormats=Array.from(A.subarray(a>>2,a+4*o>>2),(e=>qr.TextureFormat[e]))}var i=qr.mgrDevice.get(e);return qr.mgrTexture.create(i.createTexture(t))},Xa:e=>{var r=qr.mgrDevice.objects[e].queueId;return qr.mgrQueue.reference(r),r},Yb:e=>qr.mgrDevice.release(e),Qb:(e,r)=>{var t=Rr($[$[r>>2]+8>>2]).getContext("webgpu");if(!t)return 0;var n=$[r+4>>2];return n&&(t.surfaceLabelWebGPU=K(n)),qr.mgrSurface.create(t)},$b:(e,r,t,n)=>{var o;if(r&&(o={powerPreference:qr.PowerPreference[$[r+8>>2]],forceFallbackAdapter:!!$[r+16>>2]}),!("gpu"in navigator)){var a=Q(),i=Hr("WebGPU not available on this browser (navigator.gpu is not available)");return er(t)(1,0,i,n),void X(a)}navigator.gpu.requestAdapter(o).then((e=>{kr((()=>{if(e){var r=qr.mgrAdapter.create(e);er(t)(0,r,0,n)}else{var o=Q(),a=Hr("WebGPU not available on this system (requestAdapter returned null)");er(t)(1,0,a,n),X(o)}}))}),(e=>{kr((()=>{var r=Q(),o=Hr(e.message);er(t)(2,0,o,n),X(r)}))}))},ec:e=>qr.mgrPipelineLayout.release(e),Ma:e=>qr.mgrQueue.release(e),ba:(e,r,t)=>{var n=qr.mgrQueue.get(e),o=Array.from(A.subarray(t>>2,t+4*r>>2),(e=>qr.mgrCommandBuffer.get(e)));n.submit(o)},E:function(e,r,t,n,o){t=Mr(t);var a=qr.mgrQueue.get(e),i=qr.mgrBuffer.get(r),s=E.subarray(n,n+o);a.writeBuffer(i,t,s,0,o)},da:(e,r,t,n,o,a)=>{var i=qr.mgrQueue.get(e),s=qr.makeImageCopyTexture(r),u=qr.makeTextureDataLayout(o),l=qr.makeExtent3D(a),c=E.subarray(t,t+n);i.writeTexture(s,c,u,l)},Z:(e,r,t,n,o,a)=>{qr.mgrRenderPassEncoder.get(e).drawIndexed(r,t,n,o,a)},$:e=>{qr.mgrRenderPassEncoder.get(e).end()},Ea:e=>qr.mgrRenderPassEncoder.release(e),d:(e,r,t,n,o)=>{var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u<n;u++,o+=4)s.push($[o>>2]);a.setBindGroup(r,i,s)}},_:function(e,r,t,n,o){n=Mr(n),o=Mr(o);var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBuffer.get(r);-1==o&&(o=void 0),a.setIndexBuffer(i,qr.IndexFormat[t],n,o)},e:(e,r)=>{var t=qr.mgrRenderPassEncoder.get(e),n=qr.mgrRenderPipeline.get(r);t.setPipeline(n)},p:(e,r,t,n,o)=>{qr.mgrRenderPassEncoder.get(e).setScissorRect(r,t,n,o)},g:(e,r)=>{qr.mgrRenderPassEncoder.get(e).setStencilReference(r)},T:function(e,r,t,n,o){n=Mr(n),o=Mr(o);var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBuffer.get(t);-1==o&&(o=void 0),a.setVertexBuffer(r,i,n,o)},fc:e=>qr.mgrRenderPipeline.release(e),Qa:e=>qr.mgrSampler.release(e),dc:e=>qr.mgrShaderModule.release(e),bc:(e,r)=>{var t=$[r+4>>2],n=qr.mgrSurface.get(e),o=[$[r+28>>2],$[r+32>>2]];0!==o[0]&&(n.canvas.width=o[0]),0!==o[1]&&(n.canvas.height=o[1]);var a={device:qr.mgrDevice.get(t),format:qr.TextureFormat[$[r+8>>2]],usage:$[r+12>>2],alphaMode:qr.AlphaMode[$[r+24>>2]]},i=$[r+16>>2];if(i){var s=$[r+20>>2];a.viewFormats=Array.from(A.subarray(s>>2,s+4*i>>2),(e=>qr.TextureFormat[e]))}n.configure(a)},ac:(e,r)=>{var t=qr.mgrSurface.get(e);try{var n=qr.mgrTexture.create(t.getCurrentTexture());$[r>>2]=n,A[r+4>>2]=0,A[r+8>>2]=0}catch(e){$[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=5}},Rb:e=>qr.mgrSurface.release(e),cc:e=>{qr.mgrSurface.get(e).unconfigure()},Ta:(e,r)=>{var t;if(r){var n=$[r+20>>2],o=$[r+28>>2];t={format:qr.TextureFormat[$[r+8>>2]],dimension:qr.TextureViewDimension[$[r+12>>2]],baseMipLevel:$[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:$[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:qr.TextureAspect[$[r+32>>2]]};var a=$[r+4>>2];a&&(t.label=K(a))}var i=qr.mgrTexture.get(e);return qr.mgrTextureView.create(i.createView(t))},Ra:e=>qr.mgrTexture.get(e).destroy(),Ua:e=>{var r=qr.mgrTexture.get(e);return qr.TextureFormat.indexOf(r.format)},ea:e=>qr.mgrTexture.get(e).height,fa:e=>qr.mgrTexture.get(e).width,ca:e=>qr.mgrTexture.release(e),Sa:e=>qr.mgrTextureView.release(e)},et=await async function(){function e(e,r){return w=(et=e.exports).lc,O(),Ke=et.qc,V(),et}M();var t,a={a:Yr};if(o.instantiateWasm)return new Promise(((r,t)=>{o.instantiateWasm(a,((t,n)=>{e(t),r(t.exports)}))}));R??=o.locateFile?(t="thorvg-wasm.wasm",o.locateFile?o.locateFile(t,h):h+t):new URL("thorvg-wasm.wasm","undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:r&&r.src||new URL("lottie-player.js",document.baseURI).href).href;try{return e((await async function(e,r,t){if(!e&&"function"==typeof WebAssembly.instantiateStreaming&&!L(r)&&!u)try{var n=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(e){b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation")}return async function(e,r){try{var t=await async function(e){if(!F)try{var r=await c(e);return new Uint8Array(r)}catch{}return function(e){if(e==R&&F)return new Uint8Array(F);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}(e)}(e);return await WebAssembly.instantiate(t,r)}catch(e){b(`failed to asynchronously prepare wasm: ${e}`),N(e)}}(r,t)}(F,R,a)).instance)}catch(e){return n(e),Promise.reject(e)}}(),rt=et.nc,tt=et.oc,nt=et.pc,ot=et.rc,at=et.sc,it=et.tc,st=et.uc,ut=et.vc;if(o.addRunDependency=M,o.removeRunDependency=V,o.FS_createPreloadedFile=me,o.FS_unlink=e=>he.unlink(e),o.FS_createPath=Xr,o.FS_createDevice=Zr,o.FS=he,o.FS_createDataFile=de,o.FS_createLazyFile=Qr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return function e(){function r(){o.calledRun=!0,D||(o.noFSInit||he.initialized||he.init(),et.mc(),he.ignorePermissions=!1,t(o),o.onRuntimeInitialized?.(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),W.unshift(e);var e;G(W)}())}U>0?I=e:(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),H.unshift(e);var e;G(H)}(),U>0?I=e:o.setStatus?(o.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>o.setStatus("")),1),r()}),1)):r())}(),a});function ye(e,r,t,n){var o,a=arguments.length,i=a<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(r,t,i):o(r,t))||i);return a>3&&i&&Object.defineProperty(r,t,i),i}let be,we=!1;var _e,xe,Ee,Se,Pe,Ae;e.Renderer=void 0,(_e=e.Renderer||(e.Renderer={})).SW="sw",_e.WG="wg",_e.GL="gl",e.InitStatus=void 0,(xe=e.InitStatus||(e.InitStatus={})).IDLE="idle",xe.FAILED="failed",xe.REQUESTED="requested",xe.INITIALIZED="initialized",e.FileType=void 0,(Ee=e.FileType||(e.FileType={})).JSON="json",Ee.LOT="lot",Ee.JPG="jpg",Ee.PNG="png",Ee.SVG="svg",e.PlayerState=void 0,(Se=e.PlayerState||(e.PlayerState={})).Destroyed="destroyed",Se.Error="error",Se.Loading="loading",Se.Paused="paused",Se.Playing="playing",Se.Stopped="stopped",Se.Frozen="frozen",e.PlayMode=void 0,(Pe=e.PlayMode||(e.PlayMode={})).Bounce="bounce",Pe.Normal="normal",e.PlayerEvent=void 0,(Ae=e.PlayerEvent||(e.PlayerEvent={})).Complete="complete",Ae.Destroyed="destroyed",Ae.Error="error",Ae.Frame="frame",Ae.Freeze="freeze",Ae.Load="load",Ae.Loop="loop",Ae.Pause="pause",Ae.Play="play",Ae.Ready="ready",Ae.Stop="stop";const $e=async(e,r)=>{const t=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),t.encode(n));case"string":if("json"===r||"lot"===r)return n=await(async e=>{try{e=JSON.parse(e)}catch(r){const t=await(async e=>{if("string"!=typeof e)throw new Error("The url value must be a string");try{const r=new URL(e),t=await fetch(r.toString());return await t.json()}catch(e){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(e);e=JSON.stringify(t)}return e})(n),t.encode(n);const e=await(async e=>(await fetch(e)).arrayBuffer())(n);return new Uint8Array(e);default:throw new Error("Invalid src type")}},Ce=e=>new Promise((r=>setTimeout(r,e))),Te=(e,r)=>{const t=document.createElement("a");t.setAttribute("href",URL.createObjectURL(r)),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)};let ke="idle";class Be extends oe{src;wasmUrl;fileType="json";renderConfig;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;_canvas;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(we)for(;!be;)await Ce(100);if(be||(we=!0,be=await ve({locateFile:(e,r)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg-wasm.wasm":r+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.renderConfig?.renderer||"sw";if(await(async e=>{if("wg"===e){for(;"requested"===ke;)await Ce(100);if("initialized"!==ke)for(ke="requested";;)switch(be.init()){case 0:return void(ke="initialized");case 1:return void(ke="failed");case 2:await Ce(100)}}})(e),"failed"===ke)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this._TVG=new be.TvgLottieAnimation(e,`#${this._canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:e,right:r,top:t,bottom:n}=this.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let i=0,s=0,u=this._canvas.width,l=this._canvas.height;e<0&&(i=Math.abs(e),u-=i),t<0&&(s=Math.abs(t),l-=s),r>o&&(u-=r-o),n>a&&(l-=n-a),this._TVG.viewport(i,s,u,l)}_observerCallback(e){const r=e[0],t=r.target;t._observable=r.isIntersecting,r.isIntersecting?"frozen"===t.currentState&&t.play():"playing"===t.currentState&&(t.freeze(),t.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this._canvas=this.querySelector(".thorvg"),this._canvas.id=`thorvg-${he().replaceAll("-","").substring(0,6)}`,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(e,r=""){if(!this._TVG.load(e,this.fileType,this._canvas.width,this._canvas.height,r))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.renderConfig?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:r,height:t}=this._canvas.getBoundingClientRect();this._canvas.width=r*e,this._canvas.height=t*e}if(this._TVG.resize(this._canvas.width,this._canvas.height),this._viewport(),!this._TVG.update())return;if("wg"===this.renderConfig?.renderer||"gl"===this.renderConfig?.renderer)return void this._TVG.render();const e=this._TVG.render(),r=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);r.length<1||(this._imageData=new ImageData(r,this._canvas.width,this._canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this._TVG.duration(),r=Date.now()/1e3;if(this.currentFrame=(r-this._beginTime)/e*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 e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)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 Ce(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(e){this.pause(),this.currentFrame=e,this._TVG.frame(e)}async load(e,r="json"){try{await this._init();const t=await $e(e,r);this.dispatchEvent(new CustomEvent("ready")),this.fileType=r,await this._loadBytes(t)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(!("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(e){this._frame(e),await this._update(),this._render()}resize(e,r){this._canvas.width=e,this._canvas.height=r,"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(){be.term(),be=null}setLooping(e){this._TVG&&(this.loop=e)}setDirection(e){this._TVG&&(this.direction=e)}setSpeed(e){this._TVG&&(this.speed=e)}setBgColor(e){this._TVG&&(this._canvas.style.backgroundColor=e)}save2png(){this._TVG&&this._canvas.toBlob((e=>{e&&Te("output.png",e)}),"image/png")}async save2gif(e){const r=new be.TvgLottieAnimation("sw",`#${this._canvas.id}`),t=await $e(e,"json");if(!r.save(t,"gif")){const e=r.error();throw r.delete(),new Error("Unable to save. Error: ",e)}const n=be.FS.readFile("output.gif");if(n.length<6)throw r.delete(),new Error("Unable to save the GIF data. The generated file size is invalid.");const o=new Blob([n],{type:"application/octet-stream"});Te("output.gif",o),r.delete()}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return z`
|
|
2
2
|
<canvas class="thorvg" style="width: 100%; height: 100%;" />
|
|
3
3
|
`}}var Fe;ye([ue({type:String})],Be.prototype,"src",void 0),ye([ue({type:String})],Be.prototype,"wasmUrl",void 0),ye([ue({type:e.FileType})],Be.prototype,"fileType",void 0),ye([ue({type:Object})],Be.prototype,"renderConfig",void 0),ye([ue({type:Number})],Be.prototype,"speed",void 0),ye([ue({type:Boolean})],Be.prototype,"autoPlay",void 0),ye([ue({type:Number})],Be.prototype,"count",void 0),ye([ue({type:Boolean})],Be.prototype,"loop",void 0),ye([ue({type:Number})],Be.prototype,"direction",void 0),ye([ue()],Be.prototype,"mode",void 0),ye([ue()],Be.prototype,"intermission",void 0),ye([ue({type:Number})],Be.prototype,"totalFrame",void 0),ye([ue({type:Number})],Be.prototype,"currentFrame",void 0),ye([ue({type:Number})],Be.prototype,"currentState",void 0),ye([ue({type:Float32Array})],Be.prototype,"size",null),Be=ye([(Fe="lottie-player",(e,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(Fe,e)})):customElements.define(Fe,e)})],Be);var De=Object.freeze({__proto__:null});e.LottiePlayer=Be}));
|
|
4
4
|
//# sourceMappingURL=lottie-player.js.map
|