@openremote/or-rive-renderer 1.14.0-snapshot
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/README.md +21 -0
- package/custom-elements-jsx.d.ts +229 -0
- package/custom-elements.json +179 -0
- package/dist/umd/04862882bda5db2f.wasm +0 -0
- package/dist/umd/index.bundle.js +22 -0
- package/dist/umd/index.bundle.js.map +1 -0
- package/dist/umd/index.js +22 -0
- package/dist/umd/index.js.map +1 -0
- package/dist/umd/index.orbundle.js +22 -0
- package/dist/umd/index.orbundle.js.map +1 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.d.ts.map +1 -0
- package/package.json +34 -0
- package/stories/or-rive-renderer.stories.ts +68 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ORRiveRenderer=t():e.ORRiveRenderer=t()}(self,()=>(()=>{var e={933(e){e.exports=(()=>{"use strict";var e,t,n,r,i,a,o,s,l,u,c,h,d,f,p,m,v,g,b,y,w,_,A,E,C,M,P,S,x,I,T,L,R,$,F,O,j,k,B,W,D,U,V,N,z,H,G,Y,X,q,K,J,Q,Z,ee,et,en,er,ei,ea,eo,es,el,eu,ec,eh,ed=[,(e,t,n)=>{var r;n.r(t),n.d(t,{default:()=>i});let i=(r="u">typeof document?document.currentScript?.src:void 0,function(e={}){var t,n,i,a=new Promise((e,t)=>{n=e,i=t}),o="object"==typeof window,s="function"==typeof importScripts;function l(){function e(e){let a=r;n=t=0,r=new Map,a.forEach(t=>{try{t(e)}catch(e){console.error(e)}}),this.mb(),i&&i.Mb()}let t=0,n=0,r=new Map,i=null,a=null;this.requestAnimationFrame=function(i){t||=requestAnimationFrame(e.bind(this));let a=++n;return r.set(a,i),a},this.cancelAnimationFrame=function(e){r.delete(e),t&&0==r.size&&(cancelAnimationFrame(t),t=0)},this.Kb=function(e){a&&(document.body.remove(a),a=null),e||((a=document.createElement("div")).style.backgroundColor="black",a.style.position="fixed",a.style.right=0,a.style.top=0,a.style.color="white",a.style.padding="4px",a.innerHTML="RIVE FPS",e=function(e){a.innerHTML="RIVE FPS "+e.toFixed(1)},document.body.appendChild(a)),i=new function(){let t=0,n=0;this.Mb=function(){var r=performance.now();n?(++t,1e3<(r-=n)&&(e(1e3*t/r),t=n=0)):(n=r,t=0)}}},this.mb=function(){}}function u(){console.assert(!0);let e=new Map,t=-1/0;this.push=function(n){return n=n+255>>8,e.has(n)&&clearTimeout(e.get(n)),e.set(n,setTimeout(function(){e.delete(n),0==e.length?t=-1/0:n==t&&console.assert((t=Math.max(...e.keys()))<n)},1e3)),(t=Math.max(n,t))<<8}}let c=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){c&&c();let t=e.decodeAudio;e.decodeAudio=function(e,n){n(e=t(e))};let n=e.decodeFont;e.decodeFont=function(e,t){t(e=n(e))};let r=e.FileAssetLoader;e.ptrToAsset=t=>{let n=e.ptrToFileAsset(t);return n.isImage?e.ptrToImageAsset(t):n.isFont?e.ptrToFontAsset(t):n.isAudio?e.ptrToAudioAsset(t):n},e.CustomFileAssetLoader=r.extend("CustomFileAssetLoader",{__construct:function({loadContents:e}){this.__parent.__construct.call(this),this.Bb=e},loadContents:function(t,n){return t=e.ptrToAsset(t),this.Bb(t,n)}}),e.CDNFileAssetLoader=r.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){var n,r,i;let a=e.ptrToAsset(t);return""!==(t=a.cdnUuid)&&(n=a.cdnBaseUrl+"/"+t,r=e=>{a.decode(new Uint8Array(e.response))},(i=new XMLHttpRequest).responseType="arraybuffer",i.onreadystatechange=function(){4==i.readyState&&200==i.status&&r(i)},i.open("GET",n,!0),i.send(null),!0)}}),e.FallbackFileAssetLoader=r.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.ib=[]},addLoader:function(e){this.ib.push(e)},loadContents:function(e,t){for(let n of this.ib)if(n.loadContents(e,t))return!0;return!1}});let i=e.computeAlignment;e.computeAlignment=function(e,t,n,r,a=1){return i.call(this,e,t,n,r,a)}};let h=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){function t(e){this.G=e,this.Ab=e.getContext("2d"),this.Db=i,this.S=[],this.ka=0,this.clear=function(){console.assert(0==this.ka),this.S=[],a.delete(this)},this.save=function(){++this.ka,this.S.push(i.save.bind(i))},this.restore=function(){0<this.ka&&(this.S.push(i.restore.bind(i)),--this.ka)},this.transform=function(e){this.S.push(i.transform.bind(i,e))},this.align=function(e,t,n,r,a=1){this.S.push(i.align.bind(i,e,t,n,r,a))},this.flush=function(){console.assert(0==this.ka),a.add(this),i.Ya||r()},this.delete=function(){}}function n(e,t=!1){var r={alpha:!0,depth:t,stencil:t,antialias:t,premultipliedAlpha:!0,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:!1,explicitSwapControl:0,renderViaOffscreenBackBuffer:0};if(!(t=e.getContext("webgl2",r)))return null;nu(r=nl(t,r));let i=o(e.width,e.height);i.La=r,i.G=e,i.Ma=e.width,i.Za=e.height,i.T=t;var a=i.delete;return i.delete=function(){a.call(this);var e=this.La;tL===nn[e]&&(tL=null),"object"==typeof JSEvents&&JSEvents.Kc(nn[e].C.canvas),nn[e]&&nn[e].C.canvas&&(nn[e].C.canvas.zb=void 0),this.La=this.G=this.Ma=this.T=nn[e]=null},i}function r(){if(i){var t=i.Cb,n=0,r=0,o=0,s=Array(a.size),l=0;for(var u of a)u.fa=Math.min(u.G.width,t),u.ea=Math.min(u.G.height,t),u.Ja=u.ea*u.fa,n=Math.max(n,u.fa),r=Math.max(r,u.ea),o+=u.Ja,s[l++]=u;if(a.clear(),!(0>=o)){for(n=1<<(0>=n?0:32-Math.clz32(n-1)),r=1<<(0>=r?0:32-Math.clz32(r-1));r*n<o;)n<=r?n*=2:r*=2;for(n=Math.min(n,t),n=Math.min(r,t),s.sort((e,t)=>t.Ja-e.Ja),o=new e.DynamicRectanizer(t),u=0;u<s.length;){for(o.reset(n,r),l=u;l<s.length;++l){var c=s[l],h=o.addRect(c.fa,c.ea);if(0>h){console.assert(l>u);break}c.qa=65535&h,c.ra=h>>16}for(c=d.push(o.drawWidth()),h=f.push(o.drawHeight()),console.assert(c>=o.drawWidth()),console.assert(h>=o.drawHeight()),console.assert(c<=t),console.assert(h<=t),i.G.width!=c&&(i.G.width=c),i.G.height!=h&&(i.G.height=h),i.clear(),c=u;c<l;++c){h=s[c],i.saveClipRect(h.qa,h.ra,h.qa+h.fa,h.ra+h.ea);let t=new e.Mat2D;for(let e of(t.xx=h.fa/h.G.width,t.yy=h.ea/h.G.height,t.xy=t.yx=0,t.tx=h.qa,t.ty=h.ra,i.transform(t),h.S))e();i.restoreClipRect(),h.S=[]}for(i.flush();u<l;++u)(h=(c=s[u]).Ab).globalCompositeOperation="copy",h.drawImage(i.G,c.qa,c.ra,c.fa,c.ea,0,0,c.G.width,c.G.height);u=l}}}}h&&h();let i=null,a=new Set,o=e.makeRenderer;e.makeRenderer=function(e,r){if(!i){function a(e){var t=document.createElement("canvas");return t.width=1,t.height=1,(i=n(t,e)).Ya=!!i.T.getExtension("WEBGL_shader_pixel_local_storage"),i.Cb=Math.min(i.T.getParameter(i.T.MAX_RENDERBUFFER_SIZE),i.T.getParameter(i.T.MAX_TEXTURE_SIZE)),i.Ka=!i.Ya,(e=i.T.getExtension("WEBGL_debug_renderer_info"))&&(t=i.T.getParameter(e.UNMASKED_RENDERER_WEBGL),i.T.getParameter(e.UNMASKED_VENDOR_WEBGL).includes("Google")&&t.includes("ANGLE Metal Renderer")&&(i.Ka=!1)),i}(i=a(!0)).Ka||(i=a(!1))}return r?new t(e):n(e,i.Ka)};let s=e.Artboard.prototype.delete;e.Artboard.prototype.delete=function(){this.Eb=!0,s.call(this)};let c=e.Artboard.prototype.draw;e.Artboard.prototype.draw=function(e){e.S?e.S.push(()=>{this.Eb||c.call(this,e.Db)}):c.call(this,e)};let d=new u,f=new u,p=new l;e.requestAnimationFrame=p.requestAnimationFrame.bind(p),e.cancelAnimationFrame=p.cancelAnimationFrame.bind(p),e.enableFPSCounter=p.Kb.bind(p),p.mb=r,e.resolveAnimationFrame=r;let m=e.load;e.load=function(t,n,r=!0){let i=new e.FallbackFileAssetLoader;return void 0!==n&&i.addLoader(n),r&&(n=new e.CDNFileAssetLoader,i.addLoader(n)),Promise.resolve(m(t,i))};let v=e.WebGL2Renderer.prototype.clear;e.WebGL2Renderer.prototype.clear=function(){nu(this.La);let e=this.G;(this.Ma!=e.width||this.Za!=e.height)&&(this.resize(e.width,e.height),this.Ma=e.width,this.Za=e.height),v.call(this)},e.decodeImage=function(t,n){n(t=e.decodeWebGL2Image(t))};let g=e.Renderer.prototype.align;e.Renderer.prototype.align=function(e,t,n,r,i=1){g.call(this,e,t,n,r,i)}};var d,f,p=Object.assign({},e),m="./this.program",v="";(o||s)&&(s?v=self.location.href:"u">typeof document&&document.currentScript&&(v=document.currentScript.src),r&&(v=r),v=v.startsWith("blob:")?"":v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(f=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),d=(e,t,n)=>{if(W(e)){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}else fetch(e,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(Error(e.status+" : "+e.url))).then(t,n)});var g=e.print||console.log.bind(console),b=e.printErr||console.error.bind(console);Object.assign(e,p),p=null,e.thisProgram&&(m=e.thisProgram),e.wasmBinary&&(y=e.wasmBinary);var y,w,_,A,E,C,M,P,S,x,I=!1;function T(){var t=w.buffer;e.HEAP8=_=new Int8Array(t),e.HEAP16=E=new Int16Array(t),e.HEAPU8=A=new Uint8Array(t),e.HEAPU16=C=new Uint16Array(t),e.HEAP32=M=new Int32Array(t),e.HEAPU32=P=new Uint32Array(t),e.HEAPF32=S=new Float32Array(t),e.HEAPF64=x=new Float64Array(t)}var L=[],R=[],$=[],F=0,O=null,j=null;function k(t){throw e.onAbort?.(t),b(t="Aborted("+t+")"),I=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),i(t),t}var B,W=e=>e.startsWith("file://");function D(e){if(e==B&&y)return new Uint8Array(y);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}function U(e,t,n){return(y?Promise.resolve().then(()=>D(e)):new Promise((t,n)=>{d(e,e=>t(new Uint8Array(e)),()=>{try{t(D(e))}catch(e){n(e)}})})).then(e=>WebAssembly.instantiate(e,t)).then(n,e=>{b(`failed to asynchronously prepare wasm: ${e}`),k(e)})}var V,N,z={562865:(e,t,n,r,i)=>{if("u"<typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={Ea:0},window.h.I={},window.h.I.Ca=e,window.h.I.capture=t,window.h.I.Pa=n,window.h.ia={},window.h.ia.stopped=r,window.h.ia.ub=i;let a=window.h;a.D=[],a.lc=function(e){for(var t=0;t<a.D.length;++t)if(null==a.D[t])return a.D[t]=e,t;return a.D.push(e),a.D.length-1},a.yb=function(e){for(a.D[e]=null;0<a.D.length;)if(null==a.D[a.D.length-1])a.D.pop();else break},a.Mc=function(e){for(var t=0;t<a.D.length;++t)if(a.D[t]==e)return a.yb(t)},a.ta=function(e){return a.D[e]},a.Xa=["touchend","click"],a.unlock=function(){for(var e=0;e<a.D.length;++e){var t=a.D[e];null!=t&&null!=t.K&&t.state===a.ia.ub&&t.K.resume().then(()=>{nF(t.nb)},e=>{console.error("Failed to resume audiocontext",e)})}a.Xa.map(function(e){document.removeEventListener(e,a.unlock,!0)})},a.Xa.map(function(e){document.addEventListener(e,a.unlock,!0)})}return window.h.Ea+=1,1},565043:()=>{void 0!==window.h&&(window.h.Xa.map(function(e){document.removeEventListener(e,window.h.unlock,!0)}),--window.h.Ea,0===window.h.Ea&&delete window.h)},565347:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,565451:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},565622:(e,t,n,r,i,a)=>{if(void 0===window.h)return -1;var o={},s={};return e==window.h.I.Ca&&0!=n&&(s.sampleRate=n),o.K=new(window.AudioContext||window.webkitAudioContext)(s),o.K.suspend(),o.state=window.h.ia.stopped,n=0,e!=window.h.I.Ca&&(n=t),o.Y=o.K.createScriptProcessor(r,n,t),o.Y.onaudioprocess=function(n){if((null==o.ua||0==o.ua.length)&&(o.ua=new Float32Array(S.buffer,i,r*t)),e==window.h.I.capture||e==window.h.I.Pa){for(var s=0;s<t;s+=1)for(var l=n.inputBuffer.getChannelData(s),u=o.ua,c=0;c<r;c+=1)u[c*t+s]=l[c];nO(a,r,i)}if(e==window.h.I.Ca||e==window.h.I.Pa)for(nj(a,r,i),s=0;s<n.outputBuffer.numberOfChannels;++s)for(l=n.outputBuffer.getChannelData(s),u=o.ua,c=0;c<r;c+=1)l[c]=u[c*t+s];else for(s=0;s<n.outputBuffer.numberOfChannels;++s)n.outputBuffer.getChannelData(s).fill(0)},e!=window.h.I.capture&&e!=window.h.I.Pa||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(e){o.Fa=o.K.createMediaStreamSource(e),o.Fa.connect(o.Y),o.Y.connect(o.K.destination)}).catch(function(e){console.log("Failed to get user media: "+e)}),e==window.h.I.Ca&&o.Y.connect(o.K.destination),o.nb=a,window.h.lc(o)},568499:e=>window.h.ta(e).K.sampleRate,568572:e=>{void 0!==(e=window.h.ta(e)).Y&&(e.Y.onaudioprocess=function(){},e.Y.disconnect(),e.Y=void 0),void 0!==e.Fa&&(e.Fa.disconnect(),e.Fa=void 0),e.K.close(),e.K=void 0,e.nb=void 0},568972:e=>{window.h.yb(e)},569022:e=>{(e=window.h.ta(e)).K.resume(),e.state=window.h.ia.ub},569161:e=>{(e=window.h.ta(e)).K.suspend(),e.state=window.h.ia.stopped}},H=t=>{for(;0<t.length;)t.shift()(e)};function G(){var e=M[eX>>2];return eX+=4,e}var Y=(e,t)=>{for(var n=0,r=e.length-1;0<=r;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},X=e=>{var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=Y(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},q=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return(e=t[0],t=t[1],e||t)?e+(t&&=t.substr(0,t.length-1)):"."},K=e=>{if("/"===e)return"/";var t=(e=(e=X(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===t?e:e.substr(t+1)},J=e=>(J=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);k("initRandomDevice")})())(e),Q=(...e)=>{for(var t="",n=!1,r=e.length-1;-1<=r&&!n;r--){if("string"!=typeof(n=0<=r?e[r]:"/"))throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,n="/"===n.charAt(0)}return t=Y(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."},Z="u">typeof TextDecoder?new TextDecoder("utf8"):void 0,ee=(e,t,n)=>{var r=t+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&Z)return Z.decode(e.subarray(t,n));for(r="";t<n;){var i=e[t++];if(128&i){var a=63&e[t++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|a);else{var o=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},et=[],en=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},er=(e,t,n,r)=>{if(!(0<r))return 0;var i=n;r=n+r-1;for(var a=0;a<e.length;++a){var o=e.charCodeAt(a);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(n>=r)break;t[n++]=o}else{if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}return t[n]=0,n-i};function ei(e,t){var n=Array(en(e)+1);return e=er(e,n,0,n.length),t&&(n.length=e),n}var ea=[];function eo(e,t){var n,r;ea[e]={input:[],H:[],V:t},n=e,r=es,eh[n]={m:r}}var es={open(e){var t=ea[e.node.Da];if(!t)throw new ev(43);e.s=t,e.seekable=!1},close(e){e.s.V.sa(e.s)},sa(e){e.s.V.sa(e.s)},read(e,t,n,r){if(!e.s||!e.s.V.hb)throw new ev(60);for(var i=0,a=0;a<r;a++){try{var o=e.s.V.hb(e.s)}catch(e){throw new ev(29)}if(void 0===o&&0===i)throw new ev(6);if(null==o)break;i++,t[n+a]=o}return i&&(e.node.timestamp=Date.now()),i},write(e,t,n,r){if(!e.s||!e.s.V.Sa)throw new ev(60);try{for(var i=0;i<r;i++)e.s.V.Sa(e.s,t[n+i])}catch(e){throw new ev(29)}return r&&(e.node.timestamp=Date.now()),i}};function el(e,t){var n=e.l?e.l.length:0;n>=t||(t=Math.max(t,n*(1048576>n?2:1.125)>>>0),0!=n&&(t=Math.max(t,256)),n=e.l,e.l=new Uint8Array(t),0<e.v&&e.l.set(n.subarray(0,e.v),0))}var eu={N:null,U:()=>eu.createNode(null,"/",16895,0),createNode(e,t,n,r){if(24576==(61440&n)||4096==(61440&n))throw new ev(63);return eu.N||(eu.N={dir:{node:{X:eu.j.X,P:eu.j.P,la:eu.j.la,Aa:eu.j.Aa,sb:eu.j.sb,xb:eu.j.xb,tb:eu.j.tb,rb:eu.j.rb,Ga:eu.j.Ga},stream:{aa:eu.m.aa}},file:{node:{X:eu.j.X,P:eu.j.P},stream:{aa:eu.m.aa,read:eu.m.read,write:eu.m.write,$a:eu.m.$a,jb:eu.m.jb,lb:eu.m.lb}},link:{node:{X:eu.j.X,P:eu.j.P,ma:eu.j.ma},stream:{}},ab:{node:{X:eu.j.X,P:eu.j.P},stream:eT}}),16384==(61440&(n=eC(e,t,n,r)).mode)?(n.j=eu.N.dir.node,n.m=eu.N.dir.stream,n.l={}):32768==(61440&n.mode)?(n.j=eu.N.file.node,n.m=eu.N.file.stream,n.v=0,n.l=null):40960==(61440&n.mode)?(n.j=eu.N.link.node,n.m=eu.N.link.stream):8192==(61440&n.mode)&&(n.j=eu.N.ab.node,n.m=eu.N.ab.stream),n.timestamp=Date.now(),e&&(e.l[t]=n,e.timestamp=n.timestamp),n},Ac:e=>e.l?e.l.subarray?e.l.subarray(0,e.v):new Uint8Array(e.l):new Uint8Array(0),j:{X(e){var t={};return t.xc=8192==(61440&e.mode)?e.id:1,t.Cc=e.id,t.mode=e.mode,t.Hc=1,t.uid=0,t.Bc=0,t.Da=e.Da,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.v:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.oc=new Date(e.timestamp),t.Gc=new Date(e.timestamp),t.vc=new Date(e.timestamp),t.Fb=4096,t.pc=Math.ceil(t.size/t.Fb),t},P(e,t){if(void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&(t=t.size,e.v!=t))if(0==t)e.l=null,e.v=0;else{var n=e.l;e.l=new Uint8Array(t),n&&e.l.set(n.subarray(0,Math.min(t,e.v))),e.v=t}},la(){throw eg[44]},Aa:(e,t,n,r)=>eu.createNode(e,t,n,r),sb(e,t,n){if(16384==(61440&e.mode)){try{var r=eE(t,n)}catch(e){}if(r)for(var i in r.l)throw new ev(55)}delete e.parent.l[e.name],e.parent.timestamp=Date.now(),e.name=n,t.l[n]=e,t.timestamp=e.parent.timestamp},xb(e,t){delete e.l[t],e.timestamp=Date.now()},tb(e,t){var n,r=eE(e,t);for(n in r.l)throw new ev(55);delete e.l[t],e.timestamp=Date.now()},rb(e){var t,n=[".",".."];for(t of Object.keys(e.l))n.push(t);return n},Ga:(e,t,n)=>((e=eu.createNode(e,t,41471,0)).link=n,e),ma(e){if(40960!=(61440&e.mode))throw new ev(28);return e.link}},m:{read(e,t,n,r,i){var a=e.node.l;if(i>=e.node.v)return 0;if(8<(e=Math.min(e.node.v-i,r))&&a.subarray)t.set(a.subarray(i,i+e),n);else for(r=0;r<e;r++)t[n+r]=a[i+r];return e},write(e,t,n,r,i,a){if(t.buffer===_.buffer&&(a=!1),!r)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.l||e.l.subarray)){if(a)return e.l=t.subarray(n,n+r),e.v=r;if(0===e.v&&0===i)return e.l=t.slice(n,n+r),e.v=r;if(i+r<=e.v)return e.l.set(t.subarray(n,n+r),i),r}if(el(e,i+r),e.l.subarray&&t.subarray)e.l.set(t.subarray(n,n+r),i);else for(a=0;a<r;a++)e.l[i+a]=t[n+a];return e.v=Math.max(e.v,i+r),r},aa(e,t,n){if(1===n?t+=e.position:2===n&&32768==(61440&e.node.mode)&&(t+=e.node.v),0>t)throw new ev(28);return t},$a(e,t,n){el(e.node,t+n),e.node.v=Math.max(e.node.v,t+n)},jb(e,t,n,r,i){if(32768!=(61440&e.node.mode))throw new ev(43);if(e=e.node.l,2&i||e.buffer!==_.buffer)throw(0<n||n+t<e.length)&&(e=e.subarray?e.subarray(n,n+t):Array.prototype.slice.call(e,n,n+t)),n=!0,k(),t=void 0,new ev(48);return n=!1,t=e.byteOffset,{o:t,nc:n}},lb:(e,t,n,r)=>(eu.m.write(e,t,0,r,n,!1),0)}},ec=null,eh={},ed=[],ef=1,ep=null,em=!0,ev=class{constructor(e){this.name="ErrnoError",this.$=e}},eg={},eb=class{constructor(){this.h={},this.node=null}get flags(){return this.h.flags}set flags(e){this.h.flags=e}get position(){return this.h.position}set position(e){this.h.position=e}},ey=class{constructor(e,t,n,r){e||=this,this.parent=e,this.U=e.U,this.Ba=null,this.id=ef++,this.name=t,this.mode=n,this.j={},this.m={},this.Da=r}get read(){return 365==(365&this.mode)}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return 146==(146&this.mode)}set write(e){e?this.mode|=146:this.mode&=-147}};function ew(e,t={}){if(!(e=Q(e)))return{path:"",node:null};if(8<(t=Object.assign({gb:!0,Ua:0},t)).Ua)throw new ev(32);e=e.split("/").filter(e=>!!e);for(var n=ec,r="/",i=0;i<e.length;i++){var a=i===e.length-1;if(a&&t.parent)break;if(n=eE(n,e[i]),r=X(r+"/"+e[i]),n.Ba&&(!a||a&&t.gb)&&(n=n.Ba.root),!a||t.fb){for(a=0;40960==(61440&n.mode);)if(n=function(e){if(!(e=ew(e).node))throw new ev(44);if(!e.j.ma)throw new ev(28);return Q(e_(e.parent),e.j.ma(e))}(r),n=ew(r=Q(q(r),n),{Ua:t.Ua+1}).node,40<a++)throw new ev(32)}}return{path:r,node:n}}function e_(e){for(var t;;){if(e===e.parent)return e=e.U.kb,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function eA(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%ep.length}function eE(e,t){var n=16384==(61440&e.mode)?(n=eP(e,"x"))?n:2*!e.j.la:54;if(n)throw new ev(n);for(n=ep[eA(e.id,t)];n;n=n.$b){var r=n.name;if(n.parent.id===e.id&&r===t)return n}return e.j.la(e,t)}function eC(e,t,n,r){return t=eA((e=new ey(e,t,n,r)).parent.id,e.name),e.$b=ep[t],ep[t]=e}function eM(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function eP(e,t){return em?0:t.includes("r")&&!(292&e.mode)||t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0}function eS(e,t){try{return eE(e,t),20}catch(e){}return eP(e,"wx")}function ex(e){if(!(e=ed[e]))throw new ev(8);return e}function eI(e,t=-1){if(e=Object.assign(new eb,e),-1==t)e:{for(t=0;4096>=t;t++)if(!ed[t])break e;throw new ev(33)}return e.W=t,ed[t]=e}var eT={open(e){e.m=eh[e.node.Da].m,e.m.open?.(e)},aa(){throw new ev(70)}};function eL(e,t){var n="/"===t;if(n&&ec)throw new ev(10);if(!n&&t){var r=ew(t,{gb:!1});if(t=r.path,(r=r.node).Ba)throw new ev(10);if(16384!=(61440&r.mode))throw new ev(54)}t={type:e,Jc:{},kb:t,Yb:[]},(e=e.U(t)).U=t,t.root=e,n?ec=e:r&&(r.Ba=t,r.U&&r.U.Yb.push(t))}function eR(e,t,n){var r=ew(e,{parent:!0}).node;if(!(e=K(e))||"."===e||".."===e)throw new ev(28);var i=eS(r,e);if(i)throw new ev(i);if(!r.j.Aa)throw new ev(63);return r.j.Aa(r,e,t,n)}function e$(e){return eR(e,16895,0)}function eF(e,t,n){void 0===n&&(n=t,t=438),eR(e,8192|t,n)}function eO(e,t){if(!Q(e))throw new ev(44);var n=ew(t,{parent:!0}).node;if(!n)throw new ev(44);var r=eS(n,t=K(t));if(r)throw new ev(r);if(!n.j.Ga)throw new ev(63);n.j.Ga(n,t,e)}function ej(t,n,r){if(""===t)throw new ev(44);if("string"==typeof n){var i={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[n];if(void 0===i)throw Error(`Unknown file open mode: ${n}`);n=i}if(r=64&n?(void 0===r?438:r)&4095|32768:0,"object"==typeof t)var a=t;else{t=X(t);try{a=ew(t,{fb:!(131072&n)}).node}catch(e){}}if(i=!1,64&n)if(a){if(128&n)throw new ev(20)}else a=eR(t,r,0),i=!0;if(!a)throw new ev(44);if(8192==(61440&a.mode)&&(n&=-513),65536&n&&16384!=(61440&a.mode))throw new ev(54);if(!i&&(r=a?40960==(61440&a.mode)?32:16384==(61440&a.mode)&&("r"!==eM(n)||512&n)?31:eP(a,eM(n)):44))throw new ev(r);if(512&n&&!i){if(!(r="string"==typeof(r=a)?ew(r,{fb:!0}).node:r).j.P)throw new ev(63);if(16384==(61440&r.mode))throw new ev(31);if(32768!=(61440&r.mode))throw new ev(28);if(i=eP(r,"w"))throw new ev(i);r.j.P(r,{size:0,timestamp:Date.now()})}return n&=-131713,(a=eI({node:a,path:e_(a),flags:n,seekable:!0,position:0,m:a.m,mc:[],error:!1})).m.open&&a.m.open(a),!e.logReadFiles||1&n||t in(eU||={})||(eU[t]=1),a}function ek(e,t,n){if(null===e.W)throw new ev(8);if(!e.seekable||!e.m.aa)throw new ev(70);if(0!=n&&1!=n&&2!=n)throw new ev(28);e.position=e.m.aa(e,t,n),e.mc=[]}function eB(e,t,n){e=X("/dev/"+e);var r,i=(r=0,t&&(r|=365),n&&(r|=146),r);eD||=64;var a=eD++<<8;eh[a]={m:{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,n,r,i){for(var a=0,o=0;o<i;o++){try{var s=t()}catch(e){throw new ev(29)}if(void 0===s&&0===a)throw new ev(6);if(null==s)break;a++,n[r+o]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,i){for(var a=0;a<i;a++)try{n(t[r+a])}catch(e){throw new ev(29)}return i&&(e.node.timestamp=Date.now()),a}}},eF(e,i,a)}var eW,eD,eU,eV,eN,ez,eH,eG,eY={},eX=void 0,eq=(e,t)=>Object.defineProperty(t,"name",{value:e}),eK=[],eJ=[],eQ=e=>{if(!e)throw new eV("Cannot use deleted val. handle = "+e);return eJ[e]},eZ=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=eK.pop()||eJ.length;return eJ[t]=e,eJ[t+1]=1,t}},e0=e=>{var t=Error,n=eq(e,function(t){this.name=e,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},n},e1=e=>{for(var t="";A[e];)t+=ez[A[e++]];return t},e2=[],e3=()=>{for(;e2.length;){var e=e2.pop();e.g.ha=!1,e.delete()}},e4={},e6=(e,t)=>{if(void 0===t)throw new eV("ptr should not be undefined");for(;e.B;)t=e.oa(t),e=e.B;return t},e5={},e8=e=>{var t=e1(e=n$(e));return nL(e),t},e9=(e,t)=>{var n=e5[e];if(void 0===n)throw e=`${t} has unknown type ${e8(e)}`,new eV(e);return n},e7=()=>{},te=!1,tt=(e,t,n)=>t===n?e:void 0===n.B||null===(e=tt(e,t,n.B))?null:n.Ib(e),tn={},tr=(e,t)=>{if(!t.u||!t.o)throw new eG("makeClassHandle requires ptr and ptrType");if(!!t.J!=!!t.F)throw new eG("Both smartPtrType and smartPtr must be specified");return t.count={value:1},ti(Object.create(e,{g:{value:t,writable:!0}}))},ti=e=>"u"<typeof FinalizationRegistry?(ti=e=>e,e):(te=new FinalizationRegistry(e=>{e=e.g,--e.count.value,0===e.count.value&&(e.F?e.J.O(e.F):e.u.i.O(e.o))}),ti=e=>{var t=e.g;return t.F&&te.register(e,{g:t},e),e},e7=e=>{te.unregister(e)},ti(e)),ta={},to=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function ts(e){return this.fromWireType(P[e>>2])}var tl={},tu={},tc=(e,t,n)=>{function r(t){if((t=n(t)).length!==e.length)throw new eG("Mismatched type converter count");for(var r=0;r<e.length;++r)th(e[r],t[r])}e.forEach(function(e){tu[e]=t});var i=Array(t.length),a=[],o=0;t.forEach((e,t)=>{e5.hasOwnProperty(e)?i[t]=e5[e]:(a.push(e),tl.hasOwnProperty(e)||(tl[e]=[]),tl[e].push(()=>{i[t]=e5[e],++o===a.length&&r(i)}))}),0===a.length&&r(i)};function th(e,t,n={}){if(!("argPackAdvance"in t))throw TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,n={}){var r=t.name;if(!e)throw new eV(`type "${r}" must have a positive integer typeid pointer`);if(e5.hasOwnProperty(e)){if(n.Sb)return;throw new eV(`Cannot register type '${r}' twice`)}e5[e]=t,delete tu[e],tl.hasOwnProperty(e)&&(t=tl[e],delete tl[e],t.forEach(e=>e()))}(e,t,n)}var td=e=>{throw new eV(e.g.u.i.name+" instance already deleted")};function tf(){}var tp=(e,t,n)=>{if(void 0===e[t].A){var r=e[t];e[t]=function(...r){if(!e[t].A.hasOwnProperty(r.length))throw new eV(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].A})!`);return e[t].A[r.length].apply(this,r)},e[t].A=[],e[t].A[r.ga]=r}},tm=(t,n,r)=>{if(e.hasOwnProperty(t)){if(void 0===r||void 0!==e[t].A&&void 0!==e[t].A[r])throw new eV(`Cannot register public name '${t}' twice`);if(tp(e,t,t),e.hasOwnProperty(r))throw new eV(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);e[t].A[r]=n}else e[t]=n,void 0!==r&&(e[t].Ic=r)};function tv(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.M=n,this.O=r,this.B=i,this.Nb=a,this.oa=o,this.Ib=s,this.ob=[]}var tg=(e,t,n)=>{for(;t!==n;){if(!t.oa)throw new eV(`Expected null or instance of ${n.name}, got an instance of ${t.name}`);e=t.oa(e),t=t.B}return e};function tb(e,t){if(null===t){if(this.Ra)throw new eV(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new eV(`Cannot pass "${tB(t)}" as a ${this.name}`);if(!t.g.o)throw new eV(`Cannot pass deleted object as a pointer of type ${this.name}`);return tg(t.g.o,t.g.u.i,this.i)}function ty(e,t){if(null===t){if(this.Ra)throw new eV(`null is not a valid ${this.name}`);if(this.wa){var n=this.Ta();return null!==e&&e.push(this.O,n),n}return 0}if(!t||!t.g)throw new eV(`Cannot pass "${tB(t)}" as a ${this.name}`);if(!t.g.o)throw new eV(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.va&&t.g.u.va)throw new eV(`Cannot convert argument of type ${t.g.J?t.g.J.name:t.g.u.name} to parameter type ${this.name}`);if(n=tg(t.g.o,t.g.u.i,this.i),this.wa){if(void 0===t.g.F)throw new eV("Passing raw pointer to smart pointer is illegal");switch(this.fc){case 0:if(t.g.J===this)n=t.g.F;else throw new eV(`Cannot convert argument of type ${t.g.J?t.g.J.name:t.g.u.name} to parameter type ${this.name}`);break;case 1:n=t.g.F;break;case 2:if(t.g.J===this)n=t.g.F;else{var r=t.clone();n=this.bc(n,eZ(()=>r.delete())),null!==e&&e.push(this.O,n)}break;default:throw new eV("Unsupporting sharing policy")}}return n}function tw(e,t){if(null===t){if(this.Ra)throw new eV(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new eV(`Cannot pass "${tB(t)}" as a ${this.name}`);if(!t.g.o)throw new eV(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.g.u.va)throw new eV(`Cannot convert argument of type ${t.g.u.name} to parameter type ${this.name}`);return tg(t.g.o,t.g.u.i,this.i)}function t_(e,t,n,r,i,a,o,s,l,u,c){this.name=e,this.i=t,this.Ra=n,this.va=r,this.wa=i,this.ac=a,this.fc=o,this.qb=s,this.Ta=l,this.bc=u,this.O=c,i||void 0!==t.B?this.toWireType=ty:(this.toWireType=r?tb:tw,this.L=null)}var tA,tE,tC=(t,n,r)=>{if(!e.hasOwnProperty(t))throw new eG("Replacing nonexistent public symbol");void 0!==e[t].A&&void 0!==r?e[t].A[r]=n:(e[t]=n,e[t].ga=r)},tM=[],tP=e=>{var t=tM[e];return t||(e>=tM.length&&(tM.length=e+1),tM[e]=t=tA.get(e)),t},tS=(t,n)=>{let r;var i=(t=e1(t)).includes("j")?(r=t,(...t)=>((t,n,r=[])=>t.includes("j")?(0,e["dynCall_"+(t=t.replace(/p/g,"i"))])(n,...r):tP(n)(...r))(r,n,t)):tP(n);if("function"!=typeof i)throw new eV(`unknown function pointer with signature ${t}: ${n}`);return i},tx=(e,t)=>{var n=[],r={};throw t.forEach(function e(t){r[t]||e5[t]||(tu[t]?tu[t].forEach(e):(n.push(t),r[t]=!0))}),new tE(`${e}: `+n.map(e8).join([", "]))};function tI(e,t,n,r,i){var a=t.length;if(2>a)throw new eV("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==t[1]&&null!==n,s=function(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].L)return!0;return!1}(t),l="void"!==t[0].name,u=a-2,c=Array(u),h=[],d=[];return eq(e,function(...n){if(n.length!==u)throw new eV(`function ${e} called with ${n.length} arguments, expected ${u}`);if(d.length=0,h.length=o?2:1,h[0]=i,o){var a=t[1].toWireType(d,this);h[1]=a}for(var f=0;f<u;++f)c[f]=t[f+2].toWireType(d,n[f]),h.push(c[f]);if(n=r(...h),s)to(d);else for(f=o?1:2;f<t.length;f++){var p=1===f?a:c[f-2];null!==t[f].L&&t[f].L(p)}return l?t[0].fromWireType(n):void 0})}var tT,tL,tR,t$=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(P[t+4*r>>2]);return n},tF=e=>{let t=(e=e.trim()).indexOf("(");return -1!==t?e.substr(0,t):e},tO=(e,t,n)=>{if(!(e instanceof Object))throw new eV(`${n} with invalid "this": ${e}`);if(!(e instanceof t.i.constructor))throw new eV(`${n} incompatible with "this" of type ${e.constructor.name}`);if(!e.g.o)throw new eV(`cannot call emscripten binding method ${n} on deleted object`);return tg(e.g.o,e.g.u.i,t.i)},tj=e=>{9<e&&0==--eJ[e+1]&&(eJ[e]=void 0,eK.push(e))},tk={name:"emscripten::val",fromWireType:e=>{var t=eQ(e);return tj(e),t},toWireType:(e,t)=>eZ(t),argPackAdvance:8,readValueFromPointer:ts,L:null},tB=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},tW="u">typeof TextDecoder?new TextDecoder("utf-16le"):void 0,tD=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&C[n];)++n;if(32<(n<<=1)-e&&tW)return tW.decode(A.subarray(e,n));for(r=0,n="";!(r>=t/2);++r){var i=E[e+2*r>>1];if(0==i)break;n+=String.fromCharCode(i)}return n},tU=(e,t,n)=>{if(2>(n??=0x7fffffff))return 0;n-=2;var r=t;n=n<2*e.length?n/2:e.length;for(var i=0;i<n;++i)E[t>>1]=e.charCodeAt(i),t+=2;return E[t>>1]=0,t-r},tV=e=>2*e.length,tN=(e,t)=>{for(var n=0,r="";!(n>=t/4);){var i=M[e+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},tz=(e,t,n)=>{if(4>(n??=0x7fffffff))return 0;var r=t;n=r+n-4;for(var i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),M[t>>2]=a,(t+=4)+4>n)break}return M[t>>2]=0,t-r},tH=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);55296<=r&&57343>=r&&++n,t+=4}return t},tG=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(P[t>>2]=eZ(r)),e},tY={},tX=e=>{var t=tY[e];return void 0===t?e1(e):t},tq=[],tK=Reflect.construct,tJ=e=>0==e%4&&(0!=e%100||0==e%400),tQ=[0,31,60,91,121,152,182,213,244,274,305,335],tZ=[0,31,59,90,120,151,181,212,243,273,304,334],t0=[],t1=e=>{e.yc=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")},t2=e=>{e.Fc=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")},t3=e=>{var t="EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend 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".split(" ");return(e.getSupportedExtensions()||[]).filter(e=>t.includes(e))},t4=1,t6=[],t5=[],t8=[],t9=[],t7=[],ne=[],nt=[],nn=[],nr={},ni=4,na=0,no=e=>{for(var t=t4++,n=e.length;n<t;n++)e[n]=null;return t},ns=(e,t,n,r)=>{for(var i=0;i<e;i++){var a=nS[n](),o=a&&no(r);a?(a.name=o,r[o]=a):tT||=1282,M[t+4*i>>2]=o}},nl=(e,t)=>{var n=no(nn),r={handle:n,attributes:t,version:t.Ec,C:e};return e.canvas&&(e.canvas.zb=r),nn[n]=r,(void 0===t.Jb||t.Jb)&&nc(r),n},nu=t=>(tL=nn[t],e.wc=nS=tL?.C,!(t&&!nS)),nc=e=>{if(!(e||=tL).Tb){e.Tb=!0;var t=e.C;t1(t),t2(t),2<=e.version&&(t.cb=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.cb)&&(t.cb=t.getExtension("EXT_disjoint_timer_query")),t.Zb=t.getExtension("WEBGL_multi_draw"),t3(t).forEach(e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)})}},nh={},nd=()=>{if(!tR){var e,t={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(e in nh)void 0===nh[e]?delete t[e]:t[e]=nh[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);tR=n}return tR},nf=[];function np(){var e=t3(nS);return e.concat(e.map(e=>"GL_"+e))}var nm=e=>{var t=en(e)+1,n=nR(t);return n&&er(e,A,n,t),n},nv=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),ng=e=>0==(e-=5120)?_:1==e?A:2==e?E:4==e?M:6==e?S:5==e||28922==e||28520==e||30779==e||30782==e?P:C,nb=[31,29,31,30,31,30,31,31,30,31,30,31],ny=[31,28,31,30,31,30,31,31,30,31,30,31],nw=(e,t,n,r)=>{function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function a(e,t){return i(e,t,"0")}function o(e,t){var n;function r(e){return 0>e?-1:+(0<e)}return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function l(e){var t=e.ca;for(e=new Date(new Date(e.da+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(tJ(e.getFullYear())?nb:ny)[n];if(t>r-e.getDate())t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else{e.setDate(e.getDate()+t);break}}return n=new Date(e.getFullYear()+1,0,4),t=s(new Date(e.getFullYear(),0,4)),n=s(n),0>=o(t,e)?0>=o(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var u=P[r+40>>2];for(var c in r={jc:M[r>>2],ic:M[r+4>>2],Ha:M[r+8>>2],Va:M[r+12>>2],Ia:M[r+16>>2],da:M[r+20>>2],R:M[r+24>>2],ca:M[r+28>>2],Lc:M[r+32>>2],hc:M[r+36>>2],kc:u&&u?ee(A,u):""},n=n?ee(A,n):"",u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(RegExp(c,"g"),u[c]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(c in u={"%a":e=>h[e.R].substring(0,3),"%A":e=>h[e.R],"%b":e=>d[e.Ia].substring(0,3),"%B":e=>d[e.Ia],"%C":e=>a((e.da+1900)/100|0,2),"%d":e=>a(e.Va,2),"%e":e=>i(e.Va,2," "),"%g":e=>l(e).toString().substring(2),"%G":l,"%H":e=>a(e.Ha,2),"%I":e=>(0==(e=e.Ha)?e=12:12<e&&(e-=12),a(e,2)),"%j":e=>{for(var t=0,n=0;n<=e.Ia-1;t+=(tJ(e.da+1900)?nb:ny)[n++]);return a(e.Va+t,3)},"%m":e=>a(e.Ia+1,2),"%M":e=>a(e.ic,2),"%n":()=>"\n","%p":e=>0<=e.Ha&&12>e.Ha?"AM":"PM","%S":e=>a(e.jc,2),"%t":()=>" ","%u":e=>e.R||7,"%U":e=>a(Math.floor((e.ca+7-e.R)/7),2),"%V":e=>{var t=Math.floor((e.ca+7-(e.R+6)%7)/7);if(2>=(e.R+371-e.ca-2)%7&&t++,t)53==t&&(4==(n=(e.R+371-e.ca)%7)||3==n&&tJ(e.da)||(t=1));else{t=52;var n=(e.R+7-e.ca-1)%7;(4==n||5==n&&tJ(e.da%400-1))&&t++}return a(t,2)},"%w":e=>e.R,"%W":e=>a(Math.floor((e.ca+7-(e.R+6)%7)/7),2),"%y":e=>(e.da+1900).toString().substring(2),"%Y":e=>e.da+1900,"%z":e=>{var t=0<=(e=e.hc);return(t?"+":"-")+String("0000"+((e=Math.abs(e)/60)/60*100+e%60)).slice(-4)},"%Z":e=>e.kc,"%%":()=>"%"},n=n.replace(/%%/g,"\0\0"),u)n.includes(c)&&(n=n.replace(RegExp(c,"g"),u[c](r)));return(c=ei(n=n.replace(/\0\0/g,"%"),!1)).length>t?0:(_.set(c,e),c.length-1)};[44].forEach(e=>{eg[e]=new ev(e),eg[e].stack="<generic error, no stack>"}),ep=Array(4096),eL(eu,"/"),e$("/tmp"),e$("/home"),e$("/home/web_user"),e$("/dev"),eh[259]={m:{read:()=>0,write:(e,t,n,r)=>r}},eF("/dev/null",259),eo(1280,{hb(){e:{if(!et.length){var e=null;if("u">typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n"),!e){e=null;break e}et=ei(e,!0)}e=et.shift()}return e},Sa(e,t){null===t||10===t?(g(ee(e.H,0)),e.H=[]):0!=t&&e.H.push(t)},sa(e){e.H&&0<e.H.length&&(g(ee(e.H,0)),e.H=[])},Vb:()=>({sc:25856,uc:5,rc:191,tc:35387,qc:[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]}),Wb:()=>0,Xb:()=>[24,80]}),eo(1536,{Sa(e,t){null===t||10===t?(b(ee(e.H,0)),e.H=[]):0!=t&&e.H.push(t)},sa(e){e.H&&0<e.H.length&&(b(ee(e.H,0)),e.H=[])}}),eF("/dev/tty",1280),eF("/dev/tty1",1536),nE=new Uint8Array(1024),nC=0,eB("random",nM=()=>(0===nC&&(nC=J(nE).byteLength),nE[--nC])),eB("urandom",nM),e$("/dev/shm"),e$("/dev/shm/tmp"),e$("/proc"),nP=e$("/proc/self"),e$("/proc/self/fd"),eL({U(){var e=eC(nP,"fd",16895,73);return e.j={la(e,t){var n=ex(+t);return(e={parent:null,U:{kb:"fake"},j:{ma:()=>n.path}}).parent=e}},e}},"/proc/self/fd"),eV=e.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},eJ.push(0,1,void 0,1,null,1,!0,1,!1,1),e.count_emval_handles=()=>eJ.length/2-5-eK.length,eN=e.PureVirtualError=e0("PureVirtualError");for(var n_=Array(256),nA=0;256>nA;++nA)n_[nA]=String.fromCharCode(nA);ez=n_,e.getInheritedInstanceCount=()=>Object.keys(e4).length,e.getLiveInheritedInstances=()=>{var e,t=[];for(e in e4)e4.hasOwnProperty(e)&&t.push(e4[e]);return t},e.flushPendingDeletes=e3,e.setDelayFunction=e=>{eH=e,e2.length&&eH&&eH(e3)},eG=e.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(tf.prototype,{isAliasOf:function(e){if(!(this instanceof tf&&e instanceof tf))return!1;var t=this.g.u.i,n=this.g.o;e.g=e.g;var r=e.g.u.i;for(e=e.g.o;t.B;)n=t.oa(n),t=t.B;for(;r.B;)e=r.oa(e),r=r.B;return t===r&&n===e},clone:function(){if(this.g.o||td(this),this.g.ja)return this.g.count.value+=1,this;var e=ti,t=Object,n=t.create,r=Object.getPrototypeOf(this),i=this.g;return e=e(n.call(t,r,{g:{value:{count:i.count,ha:i.ha,ja:i.ja,o:i.o,u:i.u,F:i.F,J:i.J}}})),e.g.count.value+=1,e.g.ha=!1,e},delete(){if(this.g.o||td(this),this.g.ha&&!this.g.ja)throw new eV("Object already scheduled for deletion");e7(this);var e=this.g;--e.count.value,0===e.count.value&&(e.F?e.J.O(e.F):e.u.i.O(e.o)),this.g.ja||(this.g.F=void 0,this.g.o=void 0)},isDeleted:function(){return!this.g.o},deleteLater:function(){if(this.g.o||td(this),this.g.ha&&!this.g.ja)throw new eV("Object already scheduled for deletion");return e2.push(this),1===e2.length&&eH&&eH(e3),this.g.ha=!0,this}}),Object.assign(t_.prototype,{Ob(e){return this.qb&&(e=this.qb(e)),e},bb(e){this.O?.(e)},argPackAdvance:8,readValueFromPointer:ts,fromWireType:function(e){function t(){return this.wa?tr(this.i.M,{u:this.ac,o:n,J:this,F:e}):tr(this.i.M,{u:this,o:e})}var n=this.Ob(e);if(!n)return this.bb(e),null;var r=e4[e6(this.i,n)];if(void 0!==r)return 0===r.g.count.value?(r.g.o=n,r.g.F=e,r.clone()):(r=r.clone(),this.bb(e),r);if(!(r=tn[r=this.i.Nb(n)]))return t.call(this);r=this.va?r.Gb:r.pointerType;var i=tt(n,this.i,r.i);return null===i?t.call(this):this.wa?tr(r.i.M,{u:r,o:i,J:this,F:e}):tr(r.i.M,{u:r,o:i})}}),tE=e.UnboundTypeError=e0("UnboundTypeError");for(var nE,nC,nM,nP,nS,nx=0;32>nx;++nx)nf.push(Array(nx));var nI={__syscall_fcntl64:function(e,t,n){eX=n;try{var r=ex(e);switch(t){case 0:var i=G();if(0>i)break;for(;ed[i];)i++;return function(e,t=-1){return e=eI(e,t),e.m?.zc?.(e),e}(r,i).W;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:return i=G(),r.flags|=i,0;case 12:return E[(i=G())+0>>1]=2,0}return -28}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return-e.$}},__syscall_ioctl:function(e,t,n){eX=n;try{var r=ex(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.s?0:-59;case 21505:if(!r.s)return -59;if(r.s.V.Vb){e=[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];var i=G();M[i>>2]=25856,M[i+4>>2]=5,M[i+8>>2]=191,M[i+12>>2]=35387;for(var a=0;32>a;a++)_[i+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!r.s)return -59;if(r.s.V.Wb)for(i=G(),e=[],a=0;32>a;a++)e.push(_[i+a+17]);return 0;case 21519:if(!r.s)return -59;return M[(i=G())>>2]=0;case 21520:return r.s?-28:-59;case 21531:if(i=G(),!r.m.Ub)throw new ev(59);return r.m.Ub(r,t,i);case 21523:if(!r.s)return -59;return r.s.V.Xb&&(a=[24,80],E[(i=G())>>1]=a[0],E[i+2>>1]=a[1]),0;default:return -28}}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return-e.$}},__syscall_openat:function(e,t,n,r){eX=r;try{var i=t=t?ee(A,t):"";if("/"===i.charAt(0))t=i;else{var a=-100===e?"/":ex(e).path;if(0==i.length)throw new ev(44);t=X(a+"/"+i)}var o=r?G():0;return ej(t,n,o).W}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return-e.$}},_abort_js:()=>{k("")},_embind_create_inheriting_constructor:(e,t,n)=>{e=e1(e),t=e9(t,"wrapper"),n=eQ(n);var r=t.i,i=r.M,a=r.B.M,o=r.B.constructor;return e=eq(e,function(...e){r.B.ob.forEach((function(e){if(this[e]===a[e])throw new eN(`Pure virtual function ${e} must be implemented in JavaScript`)}).bind(this)),Object.defineProperty(this,"__parent",{value:i}),this.__construct(...e)}),i.__construct=function(...e){if(this===i)throw new eV("Pass correct 'this' to __construct");e=o.implement(this,...e),e7(e);var t=e.g;if(e.notifyOnDestruction(),t.ja=!0,Object.defineProperties(this,{g:{value:t}}),ti(this),e=e6(r,e=t.o),e4.hasOwnProperty(e))throw new eV(`Tried to register registered instance: ${e}`);e4[e]=this},i.__destruct=function(){if(this===i)throw new eV("Pass correct 'this' to __destruct");e7(this);var e=this.g.o;if(e=e6(r,e),e4.hasOwnProperty(e))delete e4[e];else throw new eV(`Tried to unregister unregistered instance: ${e}`)},e.prototype=Object.create(i),Object.assign(e.prototype,n),eZ(e)},_embind_finalize_value_object:e=>{var t=ta[e];delete ta[e];var n=t.Ta,r=t.O,i=t.eb;tc([e],i.map(e=>e.Rb).concat(i.map(e=>e.dc)),e=>{var a={};return i.forEach((t,n)=>{var r=e[n],o=t.Pb,s=t.Qb,l=e[n+i.length],u=t.cc,c=t.ec;a[t.Lb]={read:e=>r.fromWireType(o(s,e)),write:(e,t)=>{var n=[];u(c,e,l.toWireType(n,t)),to(n)}}}),[{name:t.name,fromWireType:e=>{var t,n={};for(t in a)n[t]=a[t].read(e);return r(e),n},toWireType:(e,t)=>{for(var i in a)if(!(i in t))throw TypeError(`Missing field: "${i}"`);var o=n();for(i in a)a[i].write(o,t[i]);return null!==e&&e.push(r,o),o},argPackAdvance:8,readValueFromPointer:ts,L:r}]})},_embind_register_bigint:()=>{},_embind_register_bool:(e,t,n,r)=>{th(e,{name:t=e1(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(A[e])},L:null})},_embind_register_class:(e,t,n,r,i,a,o,s,l,u,c,h,d)=>{c=e1(c),a=tS(i,a),s&&=tS(o,s),u&&=tS(l,u),d=tS(h,d);var f=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(c);tm(f,function(){tx(`Cannot construct ${c} due to unbound types`,[r])}),tc([e,t,n],r?[r]:[],t=>{if(t=t[0],r)var n,i=t.i,o=i.M;else o=tf.prototype;var l=Object.create(o,{constructor:{value:t=eq(c,function(...e){if(Object.getPrototypeOf(this)!==l)throw new eV("Use 'new' to construct "+c);if(void 0===h.Z)throw new eV(c+" has no accessible constructor");var t=h.Z[e.length];if(void 0===t)throw new eV(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(h.Z).toString()}) parameters instead!`);return t.apply(this,e)})}});t.prototype=l;var h=new tv(c,t,l,d,i,a,s,u);return h.B&&((n=h.B).pa??(n.pa=[]),h.B.pa.push(h)),i=new t_(c,h,!0,!1,!1),n=new t_(c+"*",h,!1,!1,!1),o=new t_(c+" const*",h,!1,!0,!1),tn[e]={pointerType:n,Gb:o},tC(f,t),[i,n,o]})},_embind_register_class_class_function:(e,t,n,r,i,a,o)=>{var s=t$(n,r);t=tF(t=e1(t)),a=tS(i,a),tc([],[e],e=>{function r(){tx(`Cannot call ${i} due to unbound types`,s)}e=e[0];var i=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var l=e.i.constructor;return void 0===l[t]?(r.ga=n-1,l[t]=r):(tp(l,t,i),l[t].A[n-1]=r),tc([],s,r=>{if(r=tI(i,[r[0],null].concat(r.slice(1)),null,a,o),void 0===l[t].A?(r.ga=n-1,l[t]=r):l[t].A[n-1]=r,e.i.pa)for(let n of e.i.pa)n.constructor.hasOwnProperty(t)||(n.constructor[t]=r);return[]}),[]})},_embind_register_class_class_property:(e,t,n,r,i,a,o,s)=>{t=e1(t),a=tS(i,a),tc([],[e],e=>{e=e[0];var i=`${e.name}.${t}`,l={get(){tx(`Cannot access ${i} due to unbound types`,[n])},enumerable:!0,configurable:!0};return l.set=s?()=>{tx(`Cannot access ${i} due to unbound types`,[n])}:()=>{throw new eV(`${i} is a read-only property`)},Object.defineProperty(e.i.constructor,t,l),tc([],[n],n=>{n=n[0];var i={get:()=>n.fromWireType(a(r)),enumerable:!0};return s&&(s=tS(o,s),i.set=e=>{var t=[];s(r,n.toWireType(t,e)),to(t)}),Object.defineProperty(e.i.constructor,t,i),[]}),[]})},_embind_register_class_constructor:(e,t,n,r,i,a)=>{var o=t$(t,n);i=tS(r,i),tc([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(void 0===e.i.Z&&(e.i.Z=[]),void 0!==e.i.Z[t-1])throw new eV(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.i.Z[t-1]=()=>{tx(`Cannot construct ${e.name} due to unbound types`,o)},tc([],o,r=>(r.splice(1,0,null),e.i.Z[t-1]=tI(n,r,null,i,a),[])),[]})},_embind_register_class_function:(e,t,n,r,i,a,o,s)=>{var l=t$(n,r);t=tF(t=e1(t)),a=tS(i,a),tc([],[e],e=>{function r(){tx(`Cannot call ${i} due to unbound types`,l)}e=e[0];var i=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.i.ob.push(t);var u=e.i.M,c=u[t];return void 0===c||void 0===c.A&&c.className!==e.name&&c.ga===n-2?(r.ga=n-2,r.className=e.name,u[t]=r):(tp(u,t,i),u[t].A[n-2]=r),tc([],l,r=>(r=tI(i,r,e,a,o),void 0===u[t].A?(r.ga=n-2,u[t]=r):u[t].A[n-2]=r,[])),[]})},_embind_register_class_property:(e,t,n,r,i,a,o,s,l,u)=>{t=e1(t),i=tS(r,i),tc([],[e],e=>{e=e[0];var r=`${e.name}.${t}`,c={get(){tx(`Cannot access ${r} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return c.set=l?()=>tx(`Cannot access ${r} due to unbound types`,[n,o]):()=>{throw new eV(r+" is a read-only property")},Object.defineProperty(e.i.M,t,c),tc([],l?[n,o]:[n],n=>{var o=n[0],c={get(){var t=tO(this,e,r+" getter");return o.fromWireType(i(a,t))},enumerable:!0};if(l){l=tS(s,l);var h=n[1];c.set=function(t){var n=tO(this,e,r+" setter"),i=[];l(u,n,h.toWireType(i,t)),to(i)}}return Object.defineProperty(e.i.M,t,c),[]}),[]})},_embind_register_emval:e=>th(e,tk),_embind_register_enum:(e,t,n,r)=>{function i(){}t=e1(t),i.values={},th(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:8,readValueFromPointer:((e,t,n)=>{switch(t){case 1:return n?function(e){return this.fromWireType(_[e])}:function(e){return this.fromWireType(A[e])};case 2:return n?function(e){return this.fromWireType(E[e>>1])}:function(e){return this.fromWireType(C[e>>1])};case 4:return n?function(e){return this.fromWireType(M[e>>2])}:function(e){return this.fromWireType(P[e>>2])};default:throw TypeError(`invalid integer width (${t}): ${e}`)}})(t,n,r),L:null}),tm(t,i)},_embind_register_enum_value:(e,t,n)=>{var r=e9(e,"enum");t=e1(t),e=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:eq(`${r.name}_${t}`,function(){})}}),e.values[n]=r,e[t]=r},_embind_register_float:(e,t,n)=>{th(e,{name:t=e1(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:((e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(S[e>>2])};case 8:return function(e){return this.fromWireType(x[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}})(t,n),L:null})},_embind_register_function:(e,t,n,r,i,a)=>{var o=t$(t,n);e=tF(e=e1(e)),i=tS(r,i),tm(e,function(){tx(`Cannot call ${e} due to unbound types`,o)},t-1),tc([],o,n=>(tC(e,tI(e,[n[0],null].concat(n.slice(1)),null,i,a),t-1),[]))},_embind_register_integer:(e,t,n,r,i)=>{if(t=e1(t),-1===i&&(i=0xffffffff),i=e=>e,0===r){var a=32-8*n;i=e=>e<<a>>>a}var o=t.includes("unsigned")?function(e,t){return t>>>0}:function(e,t){return t};th(e,{name:t,fromWireType:i,toWireType:o,argPackAdvance:8,readValueFromPointer:((e,t,n)=>{switch(t){case 1:return n?e=>_[e]:e=>A[e];case 2:return n?e=>E[e>>1]:e=>C[e>>1];case 4:return n?e=>M[e>>2]:e=>P[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}})(t,n,0!==r),L:null})},_embind_register_memory_view:(e,t,n)=>{function r(e){return new i(_.buffer,P[e+4>>2],P[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];th(e,{name:n=e1(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Sb:!0})},_embind_register_std_string:(e,t)=>{var n="std::string"===(t=e1(t));th(e,{name:t,fromWireType:function(e){var t=P[e>>2],r=e+4;if(n)for(var i=r,a=0;a<=t;++a){var o=r+a;if(a==t||0==A[o]){if(i=i?ee(A,i,o-i):"",void 0===s)var s=i;else s+="\0",s+=i;i=o+1}}else{for(a=0,s=Array(t);a<t;++a)s[a]=String.fromCharCode(A[r+a]);s=s.join("")}return nL(e),s},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;if(!(r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new eV("Cannot pass non-string to std::string");var i=n&&r?en(t):t.length,a=nR(4+i+1),o=a+4;if(P[a>>2]=i,n&&r)er(t,A,o,i+1);else if(r)for(r=0;r<i;++r){var s=t.charCodeAt(r);if(255<s)throw nL(o),new eV("String has UTF-16 code units that do not fit in 8 bits");A[o+r]=s}else for(r=0;r<i;++r)A[o+r]=t[r];return null!==e&&e.push(nL,a),a},argPackAdvance:8,readValueFromPointer:ts,L(e){nL(e)}})},_embind_register_std_wstring:(e,t,n)=>{if(n=e1(n),2===t)var r=tD,i=tU,a=tV,o=e=>C[e>>1];else 4===t&&(r=tN,i=tz,a=tH,o=e=>P[e>>2]);th(e,{name:n,fromWireType:e=>{for(var n,i=P[e>>2],a=e+4,s=0;s<=i;++s){var l=e+4+s*t;(s==i||0==o(l))&&(a=r(a,l-a),void 0===n?n=a:(n+="\0",n+=a),a=l+t)}return nL(e),n},toWireType:(e,r)=>{if("string"!=typeof r)throw new eV(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=nR(4+o+t);return P[s>>2]=o/t,i(r,s+4,o+t),null!==e&&e.push(nL,s),s},argPackAdvance:8,readValueFromPointer:ts,L(e){nL(e)}})},_embind_register_value_object:(e,t,n,r,i,a)=>{ta[e]={name:e1(t),Ta:tS(n,r),O:tS(i,a),eb:[]}},_embind_register_value_object_field:(e,t,n,r,i,a,o,s,l,u)=>{ta[e].eb.push({Lb:e1(t),Rb:n,Pb:tS(r,i),Qb:a,dc:o,cc:tS(s,l),ec:u})},_embind_register_void:(e,t)=>{th(e,{Dc:!0,name:t=e1(t),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(e,t,n)=>A.copyWithin(e,t,t+n),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(e,t,n)=>(e=eQ(e),tG(t=e9(t,"emval::as"),n,e)),_emval_call_method:(e,t,n,r,i)=>(e=tq[e])(t=eQ(t),t[n=tX(n)],r,i),_emval_decref:tj,_emval_get_method_caller:(e,t,n)=>{var r,i,a=((e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=e9(P[t+4*r>>2],"parameter "+r);return n})(e,t),o=a.shift(),s=Array(--e);return r=eq(t=`methodCaller<(${a.map(e=>e.name).join(", ")}) => ${o.name}>`,(t,r,i,l)=>{for(var u=0,c=0;c<e;++c)s[c]=a[c].readValueFromPointer(l+u),u+=a[c].argPackAdvance;return tG(o,i,t=1===n?tK(r,s):r.apply(t,s))}),i=tq.length,tq.push(r),i},_emval_get_property:(e,t)=>eZ((e=eQ(e))[t=eQ(t)]),_emval_incref:e=>{9<e&&(eJ[e+1]+=1)},_emval_new_array:()=>eZ([]),_emval_new_cstring:e=>eZ(tX(e)),_emval_new_object:()=>eZ({}),_emval_run_destructors:e=>{to(eQ(e)),tj(e)},_emval_set_property:(e,t,n)=>{e=eQ(e),t=eQ(t),n=eQ(n),e[t]=n},_emval_take_value:(e,t)=>eZ(e=(e=e9(e,"_emval_take_value")).readValueFromPointer(t)),_gmtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+0x100000000*t:NaN)),M[n>>2]=e.getUTCSeconds(),M[n+4>>2]=e.getUTCMinutes(),M[n+8>>2]=e.getUTCHours(),M[n+12>>2]=e.getUTCDate(),M[n+16>>2]=e.getUTCMonth(),M[n+20>>2]=e.getUTCFullYear()-1900,M[n+24>>2]=e.getUTCDay(),M[n+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},_localtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+0x100000000*t:NaN)),M[n>>2]=e.getSeconds(),M[n+4>>2]=e.getMinutes(),M[n+8>>2]=e.getHours(),M[n+12>>2]=e.getDate(),M[n+16>>2]=e.getMonth(),M[n+20>>2]=e.getFullYear()-1900,M[n+24>>2]=e.getDay(),M[n+28>>2]=(tJ(e.getFullYear())?tQ:tZ)[e.getMonth()]+e.getDate()-1|0,M[n+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();M[n+32>>2]=0|(t!=r&&e.getTimezoneOffset()==Math.min(r,t))},_tzset_js:(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1);i=a.getTimezoneOffset();var s=o.getTimezoneOffset();P[e>>2]=60*Math.max(i,s),M[t>>2]=Number(i!=s),a=(e=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(a),o=e(o),s<i?(er(a,A,n,17),er(o,A,r,17)):(er(a,A,r,17),er(o,A,n,17))},beginPixelLocalStorageWEBGL:function(t,n,r){(t=nn[t].C.ba)&&t.beginPixelLocalStorageWEBGL(e.HEAPU32.subarray(r,r+n))},decode_image:function(t,n,r){var i=e.images;i||(e.images=i=new Map);var a=new Image;i.set(t,a),n=e.HEAP8.subarray(n,n+r),(r=new Uint8Array(r)).set(n),a.src=URL.createObjectURL(new Blob([r],{type:"image/png"})),a.onload=function(){e._setWebImage(t,a.width,a.height)}},delete_image:function(t){var n=e.images;n&&n.get(t)&&n.delete(t)},emscripten_asm_const_int:(e,t,n)=>{t0.length=0;for(var r;r=A[t++];){var i=105!=r;i&=112!=r,n+=i&&n%8?4:0,t0.push(112==r?P[n>>2]:105==r?M[n>>2]:x[n>>3]),n+=i?8:4}return z[e](...t0)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:e=>{var t=A.length;if(0x80000000<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+0x6000000);var i=Math;r=Math.max(e,r);e:{i=(i.min.call(i,0x80000000,r+(65536-r%65536)%65536)-w.buffer.byteLength+65535)/65536;try{w.grow(i),T();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},emscripten_webgl_enable_extension:(e,t)=>(e=nn[e],(t=t?ee(A,t):"").startsWith("GL_")&&(t=t.substr(3)),"WEBGL_draw_instanced_base_vertex_base_instance"==t&&t1(nS),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==t&&t2(nS),"WEBGL_multi_draw"==t&&(nS.Zb=nS.getExtension("WEBGL_multi_draw")),!!e.C.getExtension(t)),emscripten_webgl_get_current_context:()=>tL?tL.handle:0,emscripten_webgl_make_context_current:e=>nu(e)?0:-5,enable_WEBGL_provoking_vertex:function(e){return(e=nn[e].C).pb=e.getExtension("WEBGL_provoking_vertex"),!!e.pb},enable_WEBGL_shader_pixel_local_storage_coherent:function(e){return(e=nn[e].C).ba=e.getExtension("WEBGL_shader_pixel_local_storage"),!(!e.ba||!e.ba.isCoherent())},endPixelLocalStorageWEBGL:function(t,n,r){(t=nn[t].C.ba)&&t.endPixelLocalStorageWEBGL(e.HEAPU32.subarray(r,r+n))},environ_get:(e,t)=>{var n=0;return nd().forEach((r,i)=>{var a=t+n;for(i=P[e+4*i>>2]=a,a=0;a<r.length;++a)_[i++]=r.charCodeAt(a);_[i]=0,n+=r.length+1}),0},environ_sizes_get:(e,t)=>{var n=nd();P[e>>2]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),P[t>>2]=r,0},fd_close:function(e){try{var t=ex(e);if(null===t.W)throw new ev(8);t.Qa&&(t.Qa=null);try{t.m.close&&t.m.close(t)}catch(e){throw e}finally{ed[t.W]=null}return t.W=null,0}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return e.$}},fd_read:function(e,t,n,r){try{e:{var i=ex(e);e=t;for(var a,o=t=0;o<n;o++){var s=P[e>>2],l=P[e+4>>2];e+=8;var u=a,c=_;if(0>l||0>u)throw new ev(28);if(null===i.W||1==(2097155&i.flags))throw new ev(8);if(16384==(61440&i.node.mode))throw new ev(31);if(!i.m.read)throw new ev(28);var h=void 0!==u;if(h){if(!i.seekable)throw new ev(70)}else u=i.position;var d=i.m.read(i,c,s,l,u);if(h||(i.position+=d),0>d){var f=-1;break e}if(t+=d,d<l)break;void 0!==a&&(a+=d)}f=t}return P[r>>2]=f,0}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return e.$}},fd_seek:function(e,t,n,r,i){t=n+2097152>>>0<4194305-!!t?(t>>>0)+0x100000000*n:NaN;try{if(isNaN(t))return 61;var a=ex(e);return ek(a,t,r),N=[a.position>>>0,(V=a.position,1<=+Math.abs(V)?0<V?Math.floor(V/0x100000000)>>>0:~~Math.ceil((V-(~~V>>>0))/0x100000000)>>>0:0)],M[i>>2]=N[0],M[i+4>>2]=N[1],a.Qa&&0===t&&0===r&&(a.Qa=null),0}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return e.$}},fd_write:function(e,t,n,r){try{e:{var i=ex(e);e=t;for(var a,o=t=0;o<n;o++){var s=P[e>>2],l=P[e+4>>2];e+=8;var u=a,c=_;if(0>l||0>u)throw new ev(28);if(null===i.W||0==(2097155&i.flags))throw new ev(8);if(16384==(61440&i.node.mode))throw new ev(31);if(!i.m.write)throw new ev(28);i.seekable&&1024&i.flags&&ek(i,0,2);var h=void 0!==u;if(h){if(!i.seekable)throw new ev(70)}else u=i.position;var d=i.m.write(i,c,s,l,u,void 0);if(h||(i.position+=d),0>d){var f=-1;break e}t+=d,void 0!==a&&(a+=d)}f=t}return P[r>>2]=f,0}catch(e){if(void 0===eY||"ErrnoError"!==e.name)throw e;return e.$}},framebufferPixelLocalClearValuefvWEBGL:function(e,t,n,r,i,a){(e=nn[e].C.ba)&&e.framebufferPixelLocalClearValuefvWEBGL(t,[n,r,i,a])},framebufferTexturePixelLocalStorageWEBGL:function(e,t,n,r,i){(e=nn[e].C.ba)&&e.framebufferTexturePixelLocalStorageWEBGL(t,t7[n],r,i)},getFramebufferPixelLocalStorageParameterivWEBGL:function(e,t,n){return(e=nn[e].C.ba)?e.getFramebufferPixelLocalStorageParameterWEBGL(t,n):0},glActiveTexture:e=>nS.activeTexture(e),glAttachShader:(e,t)=>{nS.attachShader(t5[e],ne[t])},glBindBuffer:(e,t)=>{35051==e?nS.Na=t:35052==e&&(nS.Oa=t),nS.bindBuffer(e,t6[t])},glBindBufferRange:(e,t,n,r,i)=>{nS.bindBufferRange(e,t,t6[n],r,i)},glBindFramebuffer:(e,t)=>{nS.bindFramebuffer(e,t8[t])},glBindRenderbuffer:(e,t)=>{nS.bindRenderbuffer(e,t9[t])},glBindTexture:(e,t)=>{nS.bindTexture(e,t7[t])},glBindVertexArray:e=>{nS.bindVertexArray(nt[e])},glBlendEquation:e=>nS.blendEquation(e),glBlendFunc:(e,t)=>nS.blendFunc(e,t),glBlitFramebuffer:(e,t,n,r,i,a,o,s,l,u)=>nS.blitFramebuffer(e,t,n,r,i,a,o,s,l,u),glBufferData:(e,t,n,r)=>{n&&t?nS.bufferData(e,A,r,n,t):nS.bufferData(e,t,r)},glBufferSubData:(e,t,n,r)=>{n&&nS.bufferSubData(e,t,A,r,n)},glClear:e=>nS.clear(e),glClearBufferfv:(e,t,n)=>{nS.clearBufferfv(e,t,S,n>>2)},glClearBufferuiv:(e,t,n)=>{nS.clearBufferuiv(e,t,P,n>>2)},glClearColor:(e,t,n,r)=>nS.clearColor(e,t,n,r),glClearDepthf:e=>nS.clearDepth(e),glClearStencil:e=>nS.clearStencil(e),glColorMask:(e,t,n,r)=>{nS.colorMask(!!e,!!t,!!n,!!r)},glCompileShader:e=>{nS.compileShader(ne[e])},glCreateProgram:()=>{var e=no(t5),t=nS.createProgram();return t.name=e,t.za=t.xa=t.ya=0,t.Wa=1,t5[e]=t,e},glCreateShader:e=>{var t=no(ne);return ne[t]=nS.createShader(e),t},glCullFace:e=>nS.cullFace(e),glDeleteBuffers:(e,t)=>{for(var n=0;n<e;n++){var r=M[t+4*n>>2],i=t6[r];i&&(nS.deleteBuffer(i),i.name=0,t6[r]=null,r==nS.Na&&(nS.Na=0),r==nS.Oa&&(nS.Oa=0))}},glDeleteFramebuffers:(e,t)=>{for(var n=0;n<e;++n){var r=M[t+4*n>>2],i=t8[r];i&&(nS.deleteFramebuffer(i),i.name=0,t8[r]=null)}},glDeleteProgram:e=>{if(e){var t=t5[e];t?(nS.deleteProgram(t),t.name=0,t5[e]=null):tT||=1281}},glDeleteRenderbuffers:(e,t)=>{for(var n=0;n<e;n++){var r=M[t+4*n>>2],i=t9[r];i&&(nS.deleteRenderbuffer(i),i.name=0,t9[r]=null)}},glDeleteShader:e=>{if(e){var t=ne[e];t?(nS.deleteShader(t),ne[e]=null):tT||=1281}},glDeleteTextures:(e,t)=>{for(var n=0;n<e;n++){var r=M[t+4*n>>2],i=t7[r];i&&(nS.deleteTexture(i),i.name=0,t7[r]=null)}},glDeleteVertexArrays:(e,t)=>{for(var n=0;n<e;n++){var r=M[t+4*n>>2];nS.deleteVertexArray(nt[r]),nt[r]=null}},glDepthFunc:e=>nS.depthFunc(e),glDepthMask:e=>{nS.depthMask(!!e)},glDepthRangef:(e,t)=>nS.depthRange(e,t),glDisable:e=>nS.disable(e),glDrawArrays:(e,t,n)=>{nS.drawArrays(e,t,n)},glDrawArraysInstanced:(e,t,n,r)=>{nS.drawArraysInstanced(e,t,n,r)},glDrawBuffers:(e,t)=>{for(var n=nf[e],r=0;r<e;r++)n[r]=M[t+4*r>>2];nS.drawBuffers(n)},glDrawElements:(e,t,n,r)=>{nS.drawElements(e,t,n,r)},glDrawElementsInstanced:(e,t,n,r,i)=>{nS.drawElementsInstanced(e,t,n,r,i)},glEnable:e=>nS.enable(e),glEnableVertexAttribArray:e=>{nS.enableVertexAttribArray(e)},glFlush:()=>nS.flush(),glFramebufferRenderbuffer:(e,t,n,r)=>{nS.framebufferRenderbuffer(e,t,n,t9[r])},glFramebufferTexture2D:(e,t,n,r,i)=>{nS.framebufferTexture2D(e,t,n,t7[r],i)},glFrontFace:e=>nS.frontFace(e),glGenBuffers:(e,t)=>{ns(e,t,"createBuffer",t6)},glGenFramebuffers:(e,t)=>{ns(e,t,"createFramebuffer",t8)},glGenRenderbuffers:(e,t)=>{ns(e,t,"createRenderbuffer",t9)},glGenTextures:(e,t)=>{ns(e,t,"createTexture",t7)},glGenVertexArrays:(e,t)=>{ns(e,t,"createVertexArray",nt)},glGenerateMipmap:e=>nS.generateMipmap(e),glGetError:()=>{var e=nS.getError()||tT;return tT=0,e},glGetIntegerv:(e,t)=>((e,t)=>{if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var r=nS.getParameter(34467);n=r?r.length:0;break;case 33309:if(2>tL.version){tT||=1282;return}n=np().length;break;case 33307:case 33308:if(2>tL.version){tT||=1280;return}n=3*(33307==e)}if(void 0===n)switch(typeof(r=nS.getParameter(e))){case"number":n=r;break;case"boolean":n=+!!r;break;case"string":tT||=1280;return;case"object":if(null===r)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:tT||=1280;return}else{if(r instanceof Float32Array||r instanceof Uint32Array||r instanceof Int32Array||r instanceof Array){for(e=0;e<r.length;++e)M[t+4*e>>2]=r[e];return}try{n=0|r.name}catch(t){tT||=1280,b(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`);return}}break;default:tT||=1280,b(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${r} of type ${typeof r}!`);return}M[t>>2]=n}else tT||=1281})(e,t),glGetProgramiv:(e,t,n)=>{if(n)if(e>=t4)tT||=1281;else if(e=t5[e],35716==t)null===(e=nS.getProgramInfoLog(e))&&(e="(unknown error)"),M[n>>2]=e.length+1;else if(35719==t){if(!e.za)for(t=0;t<nS.getProgramParameter(e,35718);++t)e.za=Math.max(e.za,nS.getActiveUniform(e,t).name.length+1);M[n>>2]=e.za}else if(35722==t){if(!e.xa)for(t=0;t<nS.getProgramParameter(e,35721);++t)e.xa=Math.max(e.xa,nS.getActiveAttrib(e,t).name.length+1);M[n>>2]=e.xa}else if(35381==t){if(!e.ya)for(t=0;t<nS.getProgramParameter(e,35382);++t)e.ya=Math.max(e.ya,nS.getActiveUniformBlockName(e,t).length+1);M[n>>2]=e.ya}else M[n>>2]=nS.getProgramParameter(e,t);else tT||=1281},glGetString:e=>{var t=nr[e];if(!t){switch(e){case 7939:t=nm(np().join(" "));break;case 7936:case 7937:case 37445:case 37446:(t=nS.getParameter(e))||(tT||=1280),t=t?nm(t):0;break;case 7938:t=nm(`OpenGL ES 3.0 (${nS.getParameter(7938)})`);break;case 35724:var n=(t=nS.getParameter(35724)).match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==n&&(3==n[1].length&&(n[1]+="0"),t=`OpenGL ES GLSL ES ${n[1]} (${t})`),t=nm(t);break;default:tT||=1280}nr[e]=t}return t},glGetUniformBlockIndex:(e,t)=>nS.getUniformBlockIndex(t5[e],t?ee(A,t):""),glGetUniformLocation:(e,t)=>{if(t=t?ee(A,t):"",e=t5[e]){var n,r=e,i=r.na,a=r.wb;if(!i)for(r.na=i={},r.vb={},n=0;n<nS.getProgramParameter(r,35718);++n){var o=nS.getActiveUniform(r,n),s=o.name;o=o.size;var l=nv(s);l=0<l?s.slice(0,l):s;var u=r.Wa;for(r.Wa+=o,a[l]=[o,u],s=0;s<o;++s)i[u]=s,r.vb[u++]=l}if(r=e.na,i=0,a=t,0<(n=nv(t))&&(i=parseInt(t.slice(n+1))>>>0,a=t.slice(0,n)),(a=e.wb[a])&&i<a[0]&&(r[i+=a[1]]=r[i]||nS.getUniformLocation(e,t)))return i}else tT||=1281;return -1},glInvalidateFramebuffer:(e,t,n)=>{for(var r=nf[t],i=0;i<t;i++)r[i]=M[n+4*i>>2];nS.invalidateFramebuffer(e,r)},glLinkProgram:e=>{e=t5[e],nS.linkProgram(e),e.na=0,e.wb={}},glPixelStorei:(e,t)=>{3317==e?ni=t:3314==e&&(na=t),nS.pixelStorei(e,t)},glReadPixels:(e,t,n,r,i,a,o)=>{if(nS.Na)nS.readPixels(e,t,n,r,i,a,o);else{var s=ng(a);o>>>=31-Math.clz32(s.BYTES_PER_ELEMENT),nS.readPixels(e,t,n,r,i,a,s,o)}},glRenderbufferStorageMultisample:(e,t,n,r,i)=>nS.renderbufferStorageMultisample(e,t,n,r,i),glScissor:(e,t,n,r)=>nS.scissor(e,t,n,r),glShaderSource:(e,t,n,r)=>{for(var i="",a=0;a<t;++a){var o=(o=P[n+4*a>>2])?ee(A,o,r?P[r+4*a>>2]:void 0):"";i+=o}nS.shaderSource(ne[e],i)},glStencilFunc:(e,t,n)=>nS.stencilFunc(e,t,n),glStencilFuncSeparate:(e,t,n,r)=>nS.stencilFuncSeparate(e,t,n,r),glStencilMask:e=>nS.stencilMask(e),glStencilOp:(e,t,n)=>nS.stencilOp(e,t,n),glStencilOpSeparate:(e,t,n,r)=>nS.stencilOpSeparate(e,t,n,r),glTexParameteri:(e,t,n)=>nS.texParameteri(e,t,n),glTexStorage2D:(e,t,n,r,i)=>nS.texStorage2D(e,t,n,r,i),glTexStorage3D:(e,t,n,r,i,a)=>nS.texStorage3D(e,t,n,r,i,a),glTexSubImage2D:(e,t,n,r,i,a,o,s,l)=>{if(nS.Oa)nS.texSubImage2D(e,t,n,r,i,a,o,s,l);else if(l){var u=ng(s);nS.texSubImage2D(e,t,n,r,i,a,o,s,u,l>>>31-Math.clz32(u.BYTES_PER_ELEMENT))}else{if(l){u=ng(s);var c=a*((na||i)*(({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4})[o-6402]||1)*u.BYTES_PER_ELEMENT+ni-1&-ni);l=u.subarray(l>>>31-Math.clz32(u.BYTES_PER_ELEMENT),l+c>>>31-Math.clz32(u.BYTES_PER_ELEMENT))}else l=null;nS.texSubImage2D(e,t,n,r,i,a,o,s,l)}},glUniform1i:(e,t)=>{var n=nS,r=n.uniform1i,i=nS.Hb;if(i){var a=i.na[e];"number"==typeof a&&(i.na[e]=a=nS.getUniformLocation(i,i.vb[e]+(0<a?`[${a}]`:""))),e=a}else tT||=1282,e=void 0;r.call(n,e,t)},glUniformBlockBinding:(e,t,n)=>{e=t5[e],nS.uniformBlockBinding(e,t,n)},glUseProgram:e=>{e=t5[e],nS.useProgram(e),nS.Hb=e},glVertexAttribDivisor:(e,t)=>{nS.vertexAttribDivisor(e,t)},glVertexAttribIPointer:(e,t,n,r,i)=>{nS.vertexAttribIPointer(e,t,n,r,i)},glVertexAttribPointer:(e,t,n,r,i,a)=>{nS.vertexAttribPointer(e,t,n,!!r,i,a)},glViewport:(e,t,n,r)=>nS.viewport(e,t,n,r),invoke_vii:function(e,t,n){var r=nW();try{tP(e)(t,n)}catch(e){if(nB(r),e!==e+0)throw e;nk(1,0)}},isWindowsBrowser:function(){return -1<navigator.platform.indexOf("Win")},provokingVertexWEBGL:function(e,t){(e=nn[e].C.pb)&&e.provokingVertexWEBGL(t)},strftime:nw,strftime_l:(e,t,n,r)=>nw(e,t,n,r),upload_image:function(t,n){var r=e.images;r&&(n=r.get(n))&&((t=nn[t].C).pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1))}},nT=function(){function t(t){return w=(nT=t.exports).memory,T(),tA=nT.__indirect_function_table,R.unshift(nT.__wasm_call_ctors),F--,e.monitorRunDependencies?.(F),0==F&&(null!==O&&(clearInterval(O),O=null),j&&(t=j,j=null,t())),nT}var n,r,a={env:nI,wasi_snapshot_preview1:nI};if(F++,e.monitorRunDependencies?.(F),e.instantiateWasm)try{return e.instantiateWasm(a,t)}catch(e){b(`Module.instantiateWasm callback failed with error: ${e}`),i(e)}return B||="webgl2_advanced.wasm".startsWith("data:application/octet-stream;base64,")?"webgl2_advanced.wasm":e.locateFile?e.locateFile("webgl2_advanced.wasm",v):v+"webgl2_advanced.wasm",(n=a,r=function(e){t(e.instance)},y||"function"!=typeof WebAssembly.instantiateStreaming||B.startsWith("data:application/octet-stream;base64,")||W(B)||"function"!=typeof fetch?U(B,n,r):fetch(B,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,n).then(r,function(e){return b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation"),U(B,n,r)}))).catch(i),{}}(),nL=e=>(nL=nT.free)(e),nR=e=>(nR=nT.malloc)(e);e._setWebImage=(t,n,r)=>(e._setWebImage=nT.setWebImage)(t,n,r);var n$=e=>(n$=nT.__getTypeName)(e),nF=e._ma_device__on_notification_unlocked=t=>(nF=e._ma_device__on_notification_unlocked=nT.ma_device__on_notification_unlocked)(t);e._ma_malloc_emscripten=(t,n)=>(e._ma_malloc_emscripten=nT.ma_malloc_emscripten)(t,n),e._ma_free_emscripten=(t,n)=>(e._ma_free_emscripten=nT.ma_free_emscripten)(t,n);var nO=e._ma_device_process_pcm_frames_capture__webaudio=(t,n,r)=>(nO=e._ma_device_process_pcm_frames_capture__webaudio=nT.ma_device_process_pcm_frames_capture__webaudio)(t,n,r),nj=e._ma_device_process_pcm_frames_playback__webaudio=(t,n,r)=>(nj=e._ma_device_process_pcm_frames_playback__webaudio=nT.ma_device_process_pcm_frames_playback__webaudio)(t,n,r),nk=(e,t)=>(nk=nT.setThrew)(e,t),nB=e=>(nB=nT._emscripten_stack_restore)(e),nW=()=>(nW=nT.emscripten_stack_get_current)();function nD(){function r(){if(!t&&(t=!0,e.calledRun=!0,!I)){if(e.noFSInit||eW||(eW=!0,e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?eB("stdin",e.stdin):eO("/dev/tty","/dev/stdin"),e.stdout?eB("stdout",null,e.stdout):eO("/dev/tty","/dev/stdout"),e.stderr?eB("stderr",null,e.stderr):eO("/dev/tty1","/dev/stderr"),ej("/dev/stdin",0),ej("/dev/stdout",1),ej("/dev/stderr",1)),em=!1,H(R),n(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var r=e.postRun.shift();$.unshift(r)}H($)}}if(!(0<F)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)!function(){var t=e.preRun.shift();L.unshift(t)}();H(L),0<F||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),r()},1)):r())}}if(e.dynCall_iiiji=(t,n,r,i,a,o)=>(e.dynCall_iiiji=nT.dynCall_iiiji)(t,n,r,i,a,o),e.dynCall_iij=(t,n,r,i)=>(e.dynCall_iij=nT.dynCall_iij)(t,n,r,i),e.dynCall_iiji=(t,n,r,i,a)=>(e.dynCall_iiji=nT.dynCall_iiji)(t,n,r,i,a),e.dynCall_jii=(t,n,r)=>(e.dynCall_jii=nT.dynCall_jii)(t,n,r),e.dynCall_vijj=(t,n,r,i,a,o)=>(e.dynCall_vijj=nT.dynCall_vijj)(t,n,r,i,a,o),e.dynCall_jiji=(t,n,r,i,a)=>(e.dynCall_jiji=nT.dynCall_jiji)(t,n,r,i,a),e.dynCall_viijii=(t,n,r,i,a,o,s)=>(e.dynCall_viijii=nT.dynCall_viijii)(t,n,r,i,a,o,s),e.dynCall_iiiiij=(t,n,r,i,a,o,s)=>(e.dynCall_iiiiij=nT.dynCall_iiiiij)(t,n,r,i,a,o,s),e.dynCall_iiiiijj=(t,n,r,i,a,o,s,l,u)=>(e.dynCall_iiiiijj=nT.dynCall_iiiiijj)(t,n,r,i,a,o,s,l,u),e.dynCall_iiiiiijj=(t,n,r,i,a,o,s,l,u,c)=>(e.dynCall_iiiiiijj=nT.dynCall_iiiiiijj)(t,n,r,i,a,o,s,l,u,c),j=function e(){t||nD(),t||(j=e)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return nD(),a})},e=>{e.exports=JSON.parse('{"name":"@rive-app/webgl2","version":"2.35.4","description":"Rive\'s webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>r.Animation});var r=n(4)},(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>r});var r=function(){function e(e,t,n,r){this.animation=e,this.artboard=t,this.playing=r,this.loopCount=0,this.scrubTo=null,this.instance=new n.LinearAnimationInstance(e,t)}return Object.defineProperty(e.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){return this.instance.time},set:function(e){this.instance.time=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),e.prototype.advance=function(e){null===this.scrubTo?this.instance.advance(e):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},e.prototype.apply=function(e){this.instance.apply(e)},e.prototype.cleanup=function(){this.instance.delete()},e}()},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>a.AudioAssetWrapper,AudioWrapper:()=>a.AudioWrapper,BLANK_URL:()=>i.BLANK_URL,CustomFileAssetLoaderWrapper:()=>a.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>a.FileAssetWrapper,FileFinalizer:()=>a.FileFinalizer,FontAssetWrapper:()=>a.FontAssetWrapper,FontWrapper:()=>a.FontWrapper,ImageAssetWrapper:()=>a.ImageAssetWrapper,ImageWrapper:()=>a.ImageWrapper,createFinalization:()=>a.createFinalization,finalizationRegistry:()=>a.finalizationRegistry,registerTouchInteractions:()=>r.registerTouchInteractions,sanitizeUrl:()=>i.sanitizeUrl});var r=n(6),i=n(7),a=n(8)},(e,t,n)=>{n.r(t),n.d(t,{registerTouchInteractions:()=>a});var r=void 0,i=function(e,t,n){var r,i,a=[];if(["touchstart","touchmove"].indexOf(e.type)>-1&&(null==(r=e.changedTouches)?void 0:r.length)){t||e.preventDefault();for(var o=0,s=n?e.changedTouches.length:1;o<s;){var l=e.changedTouches[o];a.push({clientX:l.clientX,clientY:l.clientY,identifier:l.identifier}),o++}}else if("touchend"===e.type&&(null==(i=e.changedTouches)?void 0:i.length))for(var o=0,s=n?e.changedTouches.length:1;o<s;){var l=e.changedTouches[o];a.push({clientX:l.clientX,clientY:l.clientY,identifier:l.identifier}),o++}else a.push({clientX:e.clientX,clientY:e.clientY,identifier:0});return a},a=function(e){var t=e.canvas,n=e.artboard,a=e.stateMachines,o=void 0===a?[]:a,s=e.renderer,l=e.rive,u=e.fit,c=e.alignment,h=e.isTouchScrollEnabled,d=void 0!==h&&h,f=e.dispatchPointerExit,p=void 0===f||f,m=e.enableMultiTouch,v=void 0!==m&&m,g=e.layoutScaleFactor,b=void 0===g?1:g;if(!t||!o.length||!s||!l||!n||"u"<typeof window)return null;var y=null,w=!1,_=(function(e){if(w&&e instanceof MouseEvent){"mouseup"==e.type&&(w=!1);return}w=d&&"touchend"===e.type&&"touchstart"===y,y=e.type;var t=e.currentTarget.getBoundingClientRect(),r=i(e,d,v),a=l.computeAlignment(u,c,{minX:0,minY:0,maxX:t.width,maxY:t.height},n.bounds,b),s=new l.Mat2D;switch(a.invert(s),r.forEach(function(e){var n=e.clientX,r=e.clientY;if(n||r){var i=n-t.left,a=r-t.top,o=new l.Vec2D(i,a),u=l.mapXY(s,o),c=u.x(),h=u.y();e.transformedX=c,e.transformedY=h,u.delete(),o.delete()}}),s.delete(),a.delete(),e.type){case"mouseout":for(var h=function(e){p?r.forEach(function(t){e.pointerExit(t.transformedX,t.transformedY,t.identifier)}):r.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},f=0;f<o.length;f++){var m=o[f];h(m)}break;case"touchmove":case"mouseover":case"mousemove":for(var g=function(e){r.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},_=0;_<o.length;_++){var m=o[_];g(m)}break;case"touchstart":case"mousedown":for(var A=function(e){r.forEach(function(t){e.pointerDown(t.transformedX,t.transformedY,t.identifier)})},E=0;E<o.length;E++){var m=o[E];A(m)}break;case"touchend":for(var C=function(e){r.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier),e.pointerExit(t.transformedX,t.transformedY,t.identifier)})},M=0;M<o.length;M++){var m=o[M];C(m)}break;case"mouseup":for(var P=function(e){r.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier)})},S=0;S<o.length;S++){var m=o[S];P(m)}}}).bind(r);return t.addEventListener("mouseover",_),t.addEventListener("mouseout",_),t.addEventListener("mousemove",_),t.addEventListener("mousedown",_),t.addEventListener("mouseup",_),t.addEventListener("touchmove",_,{passive:d}),t.addEventListener("touchstart",_,{passive:d}),t.addEventListener("touchend",_),function(){t.removeEventListener("mouseover",_),t.removeEventListener("mouseout",_),t.removeEventListener("mousemove",_),t.removeEventListener("mousedown",_),t.removeEventListener("mouseup",_),t.removeEventListener("touchmove",_),t.removeEventListener("touchstart",_),t.removeEventListener("touchend",_)}}},(e,t,n)=>{n.r(t),n.d(t,{BLANK_URL:()=>u,sanitizeUrl:()=>c});var r=/^([^\w]*)(javascript|data|vbscript)/im,i=/&#(\w+)(^\w|;)?/g,a=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,s=/^.+(:|:)/gim,l=[".","/"],u="about:blank";function c(e){if(!e)return u;var t=e.replace(o,"").replace(i,function(e,t){return String.fromCharCode(t)}).replace(a,"").replace(o,"").trim();if(!t)return u;if(l.indexOf(t[0])>-1)return t;var n=t.match(s);if(!n)return t;var c=n[0];return r.test(c)?u:t}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>p,AudioWrapper:()=>u,CustomFileAssetLoaderWrapper:()=>h,FileAssetWrapper:()=>d,FileFinalizer:()=>a,FontAssetWrapper:()=>m,FontWrapper:()=>c,ImageAssetWrapper:()=>f,ImageWrapper:()=>l,createFinalization:()=>b,finalizationRegistry:()=>g});var r,i=(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(){function e(e){this.selfUnref=!1,this._file=e}return e.prototype.unref=function(){this._file&&this._file.unref()},e}(),o=function(){function e(e){this._finalizableObject=e}return e.prototype.unref=function(){this._finalizableObject.unref()},e}(),s=function(){function e(){this.selfUnref=!1}return e.prototype.unref=function(){},e}(),l=function(e){function t(t){var n=e.call(this)||this;return n._nativeImage=t,n}return i(t,e),Object.defineProperty(t.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},t}(s),u=function(e){function t(t){var n=e.call(this)||this;return n._nativeAudio=t,n}return i(t,e),Object.defineProperty(t.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},t}(s),c=function(e){function t(t){var n=e.call(this)||this;return n._nativeFont=t,n}return i(t,e),Object.defineProperty(t.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},t}(s),h=function(){function e(e,t){this._assetLoaderCallback=t,this.assetLoader=new e.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return e.prototype.loadContents=function(e,t){var n;return e.isImage?n=new f(e):e.isAudio?n=new p(e):e.isFont&&(n=new m(e)),this._assetLoaderCallback(n,t)},e}(),d=function(){function e(e){this._nativeFileAsset=e}return e.prototype.decode=function(e){this._nativeFileAsset.decode(e)},Object.defineProperty(e.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),e}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setRenderImage=function(e){this._nativeFileAsset.setRenderImage(e.nativeImage)},t}(d),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setAudioSource=function(e){this._nativeFileAsset.setAudioSource(e.nativeAudio)},t}(d),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setFont=function(e){this._nativeFileAsset.setFont(e.nativeFont)},t}(d),v=function(){function e(e){}return e.prototype.register=function(e){e.selfUnref=!0},e.prototype.unregister=function(e){},e}(),g=new("u">typeof FinalizationRegistry?FinalizationRegistry:v)(function(e){null==e||e.unref()}),b=function(e,t){var n=new o(t);g.register(e,n)}}],ef={};function ep(e){var t=ef[e];if(void 0!==t)return t.exports;var n=ef[e]={exports:{}};return ed[e](n,n.exports,ep),n.exports}ep.d=(e,t)=>{for(var n in t)ep.o(t,n)&&!ep.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},ep.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ep.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var em={};return ep.r(em),ep.d(em,{Alignment:()=>t,DataEnum:()=>Y,DataType:()=>l,DrawOptimizationOptions:()=>n,EventType:()=>a,Fit:()=>e,Layout:()=>C,LoopType:()=>o,Rive:()=>z,RiveEventType:()=>i,RiveFile:()=>N,RuntimeLoader:()=>M,StateMachineInput:()=>S,StateMachineInputType:()=>r,Testing:()=>el,ViewModel:()=>G,ViewModelInstance:()=>q,ViewModelInstanceArtboard:()=>ea,ViewModelInstanceAssetImage:()=>ei,ViewModelInstanceBoolean:()=>Z,ViewModelInstanceColor:()=>er,ViewModelInstanceEnum:()=>et,ViewModelInstanceList:()=>en,ViewModelInstanceNumber:()=>Q,ViewModelInstanceString:()=>J,ViewModelInstanceTrigger:()=>ee,ViewModelInstanceValue:()=>K,decodeAudio:()=>eu,decodeFont:()=>eh,decodeImage:()=>ec}),c=ep(1),h=ep(2),d=ep(3),f=ep(5),p=function(e,t){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},m=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},v=function(){return(v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},g=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})},b=function(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){var u=[s,l];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},y=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isHandledError=!0,t}return m(t,e),t}(Error),(_=e||(e={})).Cover="cover",_.Contain="contain",_.Fill="fill",_.FitWidth="fitWidth",_.FitHeight="fitHeight",_.None="none",_.ScaleDown="scaleDown",_.Layout="layout",(A=t||(t={})).Center="center",A.TopLeft="topLeft",A.TopCenter="topCenter",A.TopRight="topRight",A.CenterLeft="centerLeft",A.CenterRight="centerRight",A.BottomLeft="bottomLeft",A.BottomCenter="bottomCenter",A.BottomRight="bottomRight",(E=n||(n={})).AlwaysDraw="alwaysDraw",E.DrawOnChanged="drawOnChanged",C=function(){function n(n){var r,i,a,o,s,l,u;this.fit=null!=(r=null==n?void 0:n.fit)?r:e.Contain,this.alignment=null!=(i=null==n?void 0:n.alignment)?i:t.Center,this.layoutScaleFactor=null!=(a=null==n?void 0:n.layoutScaleFactor)?a:1,this.minX=null!=(o=null==n?void 0:n.minX)?o:0,this.minY=null!=(s=null==n?void 0:n.minY)?s:0,this.maxX=null!=(l=null==n?void 0:n.maxX)?l:0,this.maxY=null!=(u=null==n?void 0:n.maxY)?u:0}return n.new=function(e){var t=e.fit,r=e.alignment,i=e.minX,a=e.minY,o=e.maxX,s=e.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new n({fit:t,alignment:r,minX:i,minY:a,maxX:o,maxY:s})},n.prototype.copyWith=function(e){var t=e.fit,r=e.alignment,i=e.layoutScaleFactor,a=e.minX,o=e.minY,s=e.maxX,l=e.maxY;return new n({fit:null!=t?t:this.fit,alignment:null!=r?r:this.alignment,layoutScaleFactor:null!=i?i:this.layoutScaleFactor,minX:null!=a?a:this.minX,minY:null!=o?o:this.minY,maxX:null!=s?s:this.maxX,maxY:null!=l?l:this.maxY})},n.prototype.runtimeFit=function(t){var n;return this.cachedRuntimeFit?this.cachedRuntimeFit:(n=this.fit===e.Cover?t.Fit.cover:this.fit===e.Contain?t.Fit.contain:this.fit===e.Fill?t.Fit.fill:this.fit===e.FitWidth?t.Fit.fitWidth:this.fit===e.FitHeight?t.Fit.fitHeight:this.fit===e.ScaleDown?t.Fit.scaleDown:this.fit===e.Layout?t.Fit.layout:t.Fit.none,this.cachedRuntimeFit=n,n)},n.prototype.runtimeAlignment=function(e){var n;return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(n=this.alignment===t.TopLeft?e.Alignment.topLeft:this.alignment===t.TopCenter?e.Alignment.topCenter:this.alignment===t.TopRight?e.Alignment.topRight:this.alignment===t.CenterLeft?e.Alignment.centerLeft:this.alignment===t.CenterRight?e.Alignment.centerRight:this.alignment===t.BottomLeft?e.Alignment.bottomLeft:this.alignment===t.BottomCenter?e.Alignment.bottomCenter:this.alignment===t.BottomRight?e.Alignment.bottomRight:e.Alignment.center,this.cachedRuntimeAlignment=n,n)},n}(),M=function(){function e(){}return e.loadRuntime=function(){c.default({locateFile:function(){return e.wasmURL}}).then(function(t){var n;for(e.runtime=t;e.callBackQueue.length>0;)null==(n=e.callBackQueue.shift())||n(e.runtime)}).catch(function(t){var n={message:(null==t?void 0:t.message)||"Unknown error",type:(null==t?void 0:t.name)||"Error",wasmError:t instanceof WebAssembly.CompileError||t instanceof WebAssembly.RuntimeError,originalError:t};console.debug("Rive WASM load error details:",n);var r="https://cdn.jsdelivr.net/npm/".concat(h.name,"@").concat(h.version,"/rive_fallback.wasm");e.wasmURL.toLowerCase()!==r?(console.warn("Failed to load WASM from ".concat(e.wasmURL," (").concat(n.message,"), trying jsdelivr as a backup")),e.setWasmUrl(r),e.loadRuntime()):console.error(["Could not load Rive WASM file from ".concat(e.wasmURL," or ").concat(r,"."),"Possible reasons:\n- Network connection is down\n- WebAssembly is not supported in this environment\n- The WASM file is corrupted or incompatible\n\nError details:","- Type: ".concat(n.type),"- Message: ".concat(n.message),"- WebAssembly-specific error: ".concat(n.wasmError),"\nTo resolve, you may need to:\n1. Check your network connection\n2. Set a new WASM source via RuntimeLoader.setWasmUrl()\n3. Call RuntimeLoader.loadRuntime() again"].join("\n"))})},e.getInstance=function(t){e.isLoading||(e.isLoading=!0,e.loadRuntime()),e.runtime?t(e.runtime):e.callBackQueue.push(t)},e.awaitInstance=function(){return new Promise(function(t){return e.getInstance(function(e){return t(e)})})},e.setWasmUrl=function(t){e.wasmURL=t},e.getWasmUrl=function(){return e.wasmURL},e.isLoading=!1,e.callBackQueue=[],e.wasmURL="https://unpkg.com/".concat(h.name,"@").concat(h.version,"/rive.wasm"),e}(),(P=r||(r={}))[P.Number=56]="Number",P[P.Trigger=58]="Trigger",P[P.Boolean=59]="Boolean",S=function(){function e(e,t){this.type=e,this.runtimeInput=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(e){this.runtimeInput.value=e},enumerable:!1,configurable:!0}),e.prototype.fire=function(){this.type===r.Trigger&&this.runtimeInput.fire()},e.prototype.delete=function(){this.runtimeInput=null},e}(),(x=i||(i={}))[x.General=128]="General",x[x.OpenUrl=131]="OpenUrl",T=function(e){function t(t,n){var r=e.call(this,!1)||this;return r.nativeArtboard=t,r.file=n,r}return m(t,e),t}(I=function(e){this.isBindableArtboard=!1,this.isBindableArtboard=e}),L=function(e){function t(t){var n=e.call(this,!0)||this;return n.selfUnref=!1,n.nativeArtboard=t,n}return m(t,e),Object.defineProperty(t.prototype,"viewModel",{set:function(e){this.nativeViewModel=e.nativeInstance},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){var e;this.selfUnref&&(this.nativeArtboard.unref(),null==(e=this.nativeViewModel)||e.unref())},t}(I),R=function(){function e(e,t,n,r){this.stateMachine=e,this.playing=n,this.artboard=r,this.inputs=[],this.instance=new t.StateMachineInstance(e,r),this.initInputs(t)}return Object.defineProperty(e.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statesChanged",{get:function(){for(var e=[],t=0;t<this.instance.stateChangedCount();t++)e.push(this.instance.stateChangedNameByIndex(t));return e},enumerable:!1,configurable:!0}),e.prototype.advance=function(e){this.instance.advance(e)},e.prototype.advanceAndApply=function(e){this.instance.advanceAndApply(e)},e.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},e.prototype.reportedEventAt=function(e){return this.instance.reportedEventAt(e)},e.prototype.initInputs=function(e){for(var t=0;t<this.instance.inputCount();t++){var n=this.instance.input(t);this.inputs.push(this.mapRuntimeInput(n,e))}},e.prototype.mapRuntimeInput=function(e,t){return e.type===t.SMIInput.bool?new S(r.Boolean,e.asBool()):e.type===t.SMIInput.number?new S(r.Number,e.asNumber()):e.type===t.SMIInput.trigger?new S(r.Trigger,e.asTrigger()):void 0},e.prototype.cleanup=function(){this.inputs.forEach(function(e){e.delete()}),this.inputs.length=0,this.instance.delete()},e.prototype.bindViewModelInstance=function(e){null!=e.runtimeInstance&&this.instance.bindViewModelInstance(e.runtimeInstance)},e}(),$=function(){function e(e,t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i=[]),this.runtime=e,this.artboard=t,this.eventManager=n,this.animations=r,this.stateMachines=i}return e.prototype.add=function(e,t,n){if(void 0===n&&(n=!0),0===(e=es(e)).length)this.animations.forEach(function(e){return e.playing=t}),this.stateMachines.forEach(function(e){return e.playing=t});else for(var r=this.animations.map(function(e){return e.name}),i=this.stateMachines.map(function(e){return e.name}),o=0;o<e.length;o++){var s=r.indexOf(e[o]),l=i.indexOf(e[o]);if(s>=0||l>=0)s>=0?this.animations[s].playing=t:this.stateMachines[l].playing=t;else{var u=this.artboard.animationByName(e[o]);if(u){var c=new d.Animation(u,this.artboard,this.runtime,t);c.advance(0),c.apply(1),this.animations.push(c)}else{var h=this.artboard.stateMachineByName(e[o]);if(h){var f=new R(h,this.runtime,t,this.artboard);this.stateMachines.push(f)}}}}return n&&(t?this.eventManager.fire({type:a.Play,data:this.playing}):this.eventManager.fire({type:a.Pause,data:this.paused})),t?this.playing:this.paused},e.prototype.initLinearAnimations=function(e,t){for(var n=this.animations.map(function(e){return e.name}),r=0;r<e.length;r++){var i=n.indexOf(e[r]);if(i>=0)this.animations[i].playing=t;else{var a=this.artboard.animationByName(e[r]);if(a){var o=new d.Animation(a,this.artboard,this.runtime,t);o.advance(0),o.apply(1),this.animations.push(o)}else console.error("Animation with name ".concat(e[r]," not found."))}}},e.prototype.initStateMachines=function(e,t){for(var n=this.stateMachines.map(function(e){return e.name}),r=0;r<e.length;r++){var i=n.indexOf(e[r]);if(i>=0)this.stateMachines[i].playing=t;else{var a=this.artboard.stateMachineByName(e[r]);if(a){var o=new R(a,this.runtime,t,this.artboard);this.stateMachines.push(o)}else console.warn("State Machine with name ".concat(e[r]," not found.")),this.initLinearAnimations([e[r]],t)}}},e.prototype.play=function(e){return this.add(e,!0)},e.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(e){e.playing||e.advanceAndApply(0)})},e.prototype.pause=function(e){return this.add(e,!1)},e.prototype.scrub=function(e,t){var n=this.animations.filter(function(t){return e.includes(t.name)});return n.forEach(function(e){return e.scrubTo=t}),n.map(function(e){return e.name})},Object.defineProperty(e.prototype,"playing",{get:function(){return this.animations.filter(function(e){return e.playing}).map(function(e){return e.name}).concat(this.stateMachines.filter(function(e){return e.playing}).map(function(e){return e.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this.animations.filter(function(e){return!e.playing}).map(function(e){return e.name}).concat(this.stateMachines.filter(function(e){return!e.playing}).map(function(e){return e.name}))},enumerable:!1,configurable:!0}),e.prototype.stop=function(e){var t=this;e=es(e);var n=[];if(0===e.length)n=this.animations.map(function(e){return e.name}).concat(this.stateMachines.map(function(e){return e.name})),this.animations.forEach(function(e){return e.cleanup()}),this.stateMachines.forEach(function(e){return e.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var r=this.animations.filter(function(t){return e.includes(t.name)});r.forEach(function(e){e.cleanup(),t.animations.splice(t.animations.indexOf(e),1)});var i=this.stateMachines.filter(function(t){return e.includes(t.name)});i.forEach(function(e){e.cleanup(),t.stateMachines.splice(t.stateMachines.indexOf(e),1)}),n=r.map(function(e){return e.name}).concat(i.map(function(e){return e.name}))}return this.eventManager.fire({type:a.Stop,data:n}),n},Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(e,t){return e||t.playing},!1)||this.stateMachines.reduce(function(e,t){return e||t.playing},!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),e.prototype.atLeastOne=function(e,t){var n;return void 0===t&&(t=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([n=this.artboard.animationByIndex(0).name],e,t):this.artboard.stateMachineCount()>0&&this.add([n=this.artboard.stateMachineByIndex(0).name],e,t)),n},e.prototype.handleLooping=function(){for(var e=0,t=this.animations.filter(function(e){return e.playing});e<t.length;e++){var n=t[e];0===n.loopValue&&n.loopCount?(n.loopCount=0,this.stop(n.name)):1===n.loopValue&&n.loopCount?(this.eventManager.fire({type:a.Loop,data:{animation:n.name,type:o.Loop}}),n.loopCount=0):2===n.loopValue&&n.loopCount>1&&(this.eventManager.fire({type:a.Loop,data:{animation:n.name,type:o.PingPong}}),n.loopCount=0)}},e.prototype.handleStateChanges=function(){for(var e=[],t=0,n=this.stateMachines.filter(function(e){return e.playing});t<n.length;t++){var r=n[t];e.push.apply(e,r.statesChanged)}e.length>0&&this.eventManager.fire({type:a.StateChange,data:e})},e.prototype.handleAdvancing=function(e){this.eventManager.fire({type:a.Advance,data:e})},e}(),(F=a||(a={})).Load="load",F.LoadError="loaderror",F.Play="play",F.Pause="pause",F.Stop="stop",F.Loop="loop",F.Draw="draw",F.Advance="advance",F.StateChange="statechange",F.RiveEvent="riveevent",F.AudioStatusChange="audiostatuschange",(O=o||(o={})).OneShot="oneshot",O.Loop="loop",O.PingPong="pingpong",j=function(){function e(e){void 0===e&&(e=[]),this.listeners=e}return e.prototype.getListeners=function(e){return this.listeners.filter(function(t){return t.type===e})},e.prototype.add=function(e){this.listeners.includes(e)||this.listeners.push(e)},e.prototype.remove=function(e){for(var t=0;t<this.listeners.length;t++){var n=this.listeners[t];if(n.type===e.type&&n.callback===e.callback){this.listeners.splice(t,1);break}}},e.prototype.removeAll=function(e){var t=this;e?this.listeners.filter(function(t){return t.type===e}).forEach(function(e){return t.remove(e)}):this.listeners.splice(0,this.listeners.length)},e.prototype.fire=function(e){this.getListeners(e.type).forEach(function(t){return t.callback(e)})},e}(),k=function(){function e(e){this.eventManager=e,this.queue=[]}return e.prototype.add=function(e){this.queue.push(e)},e.prototype.process=function(){for(;this.queue.length>0;){var e=this.queue.shift();(null==e?void 0:e.action)&&e.action(),(null==e?void 0:e.event)&&this.eventManager.fire(e.event)}},e}(),(B=s||(s={}))[B.AVAILABLE=0]="AVAILABLE",B[B.UNAVAILABLE=1]="UNAVAILABLE",W=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._started=!1,t._enabled=!1,t._status=s.UNAVAILABLE,t}return m(t,e),t.prototype.delay=function(e){return g(this,void 0,void 0,function(){return b(this,function(t){return[2,new Promise(function(t){return setTimeout(t,e)})]})})},t.prototype.timeout=function(){return g(this,void 0,void 0,function(){return b(this,function(e){return[2,new Promise(function(e,t){return setTimeout(t,50)})]})})},t.prototype.reportToListeners=function(){this.fire({type:a.AudioStatusChange}),this.removeAll()},t.prototype.enableAudio=function(){return g(this,void 0,void 0,function(){return b(this,function(e){return this._enabled||(this._enabled=!0,this._status=s.AVAILABLE,this.reportToListeners()),[2]})})},t.prototype.testAudio=function(){return g(this,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:if(this._status!==s.UNAVAILABLE||null===this._audioContext)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return e.sent(),this.enableAudio(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})},t.prototype._establishAudio=function(){return g(this,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:if(this._started)return[3,5];if(this._started=!0,"u">typeof window)return[3,1];return this.enableAudio(),[3,5];case 1:this._audioContext=new AudioContext,this.listenForUserAction(),e.label=2;case 2:if(this._status!==s.UNAVAILABLE)return[3,5];return[4,this.testAudio()];case 3:return e.sent(),[4,this.delay(1e3)];case 4:return e.sent(),[3,2];case 5:return[2]}})})},t.prototype.listenForUserAction=function(){var e=this;document.addEventListener("pointerdown",function(){return g(e,void 0,void 0,function(){return b(this,function(e){return this.enableAudio(),[2]})})},{once:!0})},t.prototype.establishAudio=function(){return g(this,void 0,void 0,function(){return b(this,function(e){return this._establishAudio(),[2]})})},Object.defineProperty(t.prototype,"systemVolume",{get:function(){return this._status===s.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),t}(j)),D=function(){function e(){}return e.prototype.observe=function(){},e.prototype.unobserve=function(){},e.prototype.disconnect=function(){},e}(),U=globalThis.ResizeObserver||D,V=new(function(){function e(){var e=this;this._elementsMap=new Map,this._onObservedEntry=function(t){var n=e._elementsMap.get(t.target);null!==n?n.onResize(0==t.target.clientWidth||0==t.target.clientHeight):e._resizeObserver.unobserve(t.target)},this._onObserved=function(t){t.forEach(e._onObservedEntry)},this._resizeObserver=new U(this._onObserved)}return e.prototype.add=function(e,t){var n={onResize:t,element:e};return this._elementsMap.set(e,n),this._resizeObserver.observe(e),n},e.prototype.remove=function(e){this._resizeObserver.unobserve(e.element),this._elementsMap.delete(e.element)},e}()),N=function(){function e(e){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=e.src,this.buffer=e.buffer,e.assetLoader&&(this.assetLoader=e.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.eventManager=new j,e.onLoad&&this.on(a.Load,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError)}return e.prototype.releaseFile=function(){var e;this.selfUnref&&(null==(e=this.file)||e.unref()),this.file=null},e.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(e){return e.destroy()})},e.prototype.initData=function(){return g(this,void 0,void 0,function(){var t,n,r,i;return b(this,function(o){switch(o.label){case 0:if(!this.src)return[3,2];return t=this,[4,eo(this.src)];case 1:t.buffer=o.sent(),o.label=2;case 2:if(this.destroyed)return[2];return this.assetLoader&&(n=new f.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader).assetLoader),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),n,this.enableRiveAssetCDN)];case 3:if(r.file=o.sent(),i=new f.FileFinalizer(this.file),f.finalizationRegistry.register(this,i),this.destroyed)return this.releaseFile(),[2];return null!==this.file?this.eventManager.fire({type:a.Load,data:this}):this.fireLoadError(e.fileLoadErrorMessage),[2]}})})},e.prototype.init=function(){return g(this,void 0,void 0,function(){var t,n;return b(this,function(r){switch(r.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(e.missingErrorMessage),[2];r.label=1;case 1:return r.trys.push([1,4,,5]),t=this,[4,M.awaitInstance()];case 2:if(t.runtime=r.sent(),this.destroyed)return[2];return[4,this.initData()];case 3:return r.sent(),[3,5];case 4:return n=r.sent(),this.fireLoadError(n instanceof Error?n.message:e.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},e.prototype.fireLoadError=function(e){throw this.eventManager.fire({type:a.LoadError,data:e}),Error(e)},e.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},e.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},e.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},e.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},e.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},e.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},e.prototype.createBindableArtboard=function(e){if(null!=e){var t=new L(e);return(0,f.createFinalization)(t,t.nativeArtboard),this.bindableArtboards.push(t),t}return null},e.prototype.getArtboard=function(e){var t=this.file.artboardByName(e);if(null!=t)return new T(t,this)},e.prototype.getBindableArtboard=function(e){var t=this.file.bindableArtboardByName(e);return this.createBindableArtboard(t)},e.prototype.getDefaultBindableArtboard=function(){var e=this.file.bindableArtboardDefault();return this.createBindableArtboard(e)},e.prototype.internalBindableArtboardFromArtboard=function(e){var t=this.file.internalBindableArtboardFromArtboard(e);return this.createBindableArtboard(t)},e.prototype.viewModelByName=function(e){var t=this.file.viewModelByName(e);return null!==t?new G(t):null},e.missingErrorMessage="Rive source file or data buffer required",e.fileLoadErrorMessage="The file failed to load",e}(),z=function(){function t(e){var t,r,i=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._needsRedraw=!1,this._currentCanvasWidth=0,this._currentCanvasHeight=0,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.drawOptimization=n.DrawOnChanged,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(e){var t=i._hasZeroSize!==e;i._hasZeroSize=e,e?i._layout.maxX&&i._layout.maxY||i.resizeToCanvas():t&&i.resizeDrawingSurfaceToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=e.canvas,e.canvas.constructor===HTMLCanvasElement&&(this._observed=V.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=e.src,this.buffer=e.buffer,this.riveFile=e.riveFile,this.layout=null!=(t=e.layout)?t:new C,this.shouldDisableRiveListeners=!!e.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!e.isTouchScrollEnabled,this.automaticallyHandleEvents=!!e.automaticallyHandleEvents,this.dispatchPointerExit=!1===e.dispatchPointerExit?e.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!e.enableMultiTouch,this.drawOptimization=null!=(r=e.drawingOptions)?r:this.drawOptimization,this.enableRiveAssetCDN=void 0===e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.eventManager=new j,e.onLoad&&this.on(a.Load,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError),e.onPlay&&this.on(a.Play,e.onPlay),e.onPause&&this.on(a.Pause,e.onPause),e.onStop&&this.on(a.Stop,e.onStop),e.onLoop&&this.on(a.Loop,e.onLoop),e.onStateChange&&this.on(a.StateChange,e.onStateChange),e.onAdvance&&this.on(a.Advance,e.onAdvance),e.onload&&!e.onLoad&&this.on(a.Load,e.onload),e.onloaderror&&!e.onLoadError&&this.on(a.LoadError,e.onloaderror),e.onplay&&!e.onPlay&&this.on(a.Play,e.onplay),e.onpause&&!e.onPause&&this.on(a.Pause,e.onpause),e.onstop&&!e.onStop&&this.on(a.Stop,e.onstop),e.onloop&&!e.onLoop&&this.on(a.Loop,e.onloop),e.onstatechange&&!e.onStateChange&&this.on(a.StateChange,e.onstatechange),e.assetLoader&&(this.assetLoader=e.assetLoader),this.taskQueue=new k(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:e.autoplay,autoBind:e.autoBind,animations:e.animations,stateMachines:e.stateMachines,artboard:e.artboard,useOffscreenRenderer:e.useOffscreenRenderer})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(e){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(e)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(e){var n=this,r=e.src,i=e.buffer,a=e.riveFile,o=e.animations,s=e.stateMachines,l=e.artboard,u=e.autoplay,c=void 0!==u&&u,h=e.useOffscreenRenderer,d=void 0!==h&&h,f=e.autoBind,p=void 0!==f&&f;if(!this.destroyed){if(this.src=r,this.buffer=i,this.riveFile=a,!this.src&&!this.buffer&&!this.riveFile)throw new w(t.missingErrorMessage);var m=es(o),v=es(s);this.loaded=!1,this.readyForPlaying=!1,M.awaitInstance().then(function(e){n.destroyed||(n.runtime=e,n.removeRiveListeners(),n.deleteRiveRenderer(),n.renderer=n.runtime.makeRenderer(n.canvas,d),n.canvas.width||n.canvas.height||n.resizeDrawingSurfaceToCanvas(),n.initData(l,m,v,c,p).then(function(e){if(e)return n.setupRiveListeners()}).catch(function(e){console.error(e)}))}).catch(function(e){console.error(e)})}},t.prototype.setupRiveListeners=function(e){var t=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var n=(this.animator.stateMachines||[]).filter(function(e){return e.playing&&t.runtime.hasListeners(e.instance)}).map(function(e){return e.instance}),r=this.isTouchScrollEnabled,i=this.dispatchPointerExit,a=this.enableMultiTouch;e&&"isTouchScrollEnabled"in e&&(r=e.isTouchScrollEnabled),this.eventCleanup=(0,f.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:n,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:r,dispatchPointerExit:i,enableMultiTouch:a,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var e,t=this;W.status==s.UNAVAILABLE&&(this.file.hasAudio||(null==(e=this.artboard)?void 0:e.hasAudio)&&null===this._audioEventListener)&&(this._audioEventListener={type:a.AudioStatusChange,callback:function(){return t.onSystemAudioChanged()}},W.add(this._audioEventListener),W.establishAudio())},t.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},t.prototype.initData=function(e,t,n,r,i){return g(this,void 0,void 0,function(){var o,s,l;return b(this,function(u){switch(u.label){case 0:if(u.trys.push([0,3,,4]),null!=this.riveFile)return[3,2];return o=new N({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=o,[4,o.init()];case 1:if(u.sent(),this.destroyed)return o.destroyIfUnused(),[2,!1];u.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(e,t,n,r,i),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:a.Load,data:null!=(l=this.src)?l:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:var c;return console.warn(s=(c=u.sent())&&c.isHandledError?c.message:"Problem loading file; may be corrupt!"),this.eventManager.fire({type:a.LoadError,data:s}),[2,Promise.reject(s)];case 4:return[2]}})})},t.prototype.initArtboard=function(e,t,n,r,i){if(this.file){var o,s=e?this.file.artboardByName(e):this.file.defaultArtboard();if(!s){var l="Invalid artboard name or no default artboard";console.warn(l),this.eventManager.fire({type:a.LoadError,data:l});return}if(this.artboard=s,s.volume=this._volume*W.systemVolume,this.animator=new $(this.runtime,this.artboard,this.eventManager),t.length>0||n.length>0?(o=t.concat(n),this.animator.initLinearAnimations(t,r),this.animator.initStateMachines(n,r)):o=[this.animator.atLeastOne(r,!1)],this.taskQueue.add({event:{type:r?a.Play:a.Pause,data:o}}),i){var u=this.file.defaultArtboardViewModel(s);if(null!==u){var c=u.defaultInstance();if(null!==c){var h=new q(c,null);(0,f.createFinalization)(h,h.runtimeInstance),this.bindViewModelInstance(h)}}}}},t.prototype.drawFrame=function(){var e,t;(null==(e=null==document?void 0:document.timeline)?void 0:e.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null==(t=this.runtime)||t.resolveAnimationFrame()):this.scheduleRendering()},t.prototype._canvasSizeChanged=function(){var e=!1;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,e=!0),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,e=!0)),e},t.prototype.draw=function(e,t){this.frameRequestId=null;var r,o=performance.now();this.lastRenderTime||(this.lastRenderTime=e),this.renderSecondTimer+=e-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==t||t());var s=(e-this.lastRenderTime)/1e3;this.lastRenderTime=e;for(var l=this.animator.animations.filter(function(e){return e.playing||e.needsScrub}).sort(function(e){return e.needsScrub?-1:1}),u=0;u<l.length;u++){var c=l[u];c.advance(s),c.instance.didLoop&&(c.loopCount+=1),c.apply(1)}for(var h=this.animator.stateMachines.filter(function(e){return e.playing}),d=0;d<h.length;d++){var p=h[d],m=p.reportedEventCount();if(m)for(var v=0;v<m;v++){var g=p.reportedEventAt(v);if(g)if(g.type===i.OpenUrl){if(this.eventManager.fire({type:a.RiveEvent,data:g}),this.automaticallyHandleEvents){var b=document.createElement("a"),y=g.url,w=g.target,_=(0,f.sanitizeUrl)(y);y&&b.setAttribute("href",_),w&&b.setAttribute("target",w),_&&_!==f.BLANK_URL&&b.click()}}else this.eventManager.fire({type:a.RiveEvent,data:g})}p.advanceAndApply(s)}0==this.animator.stateMachines.length&&this.artboard.advance(s);var A=this.renderer;!this._hasZeroSize&&(this.drawOptimization==n.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(A.clear(),A.save(),this.alignRenderer(),this.artboard.draw(A),A.restore(),A.flush(),this._needsRedraw=!1),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(s),this.frameCount++;var E=performance.now();for(this.frameTimes.push(E),this.durations.push(E-o);this.frameTimes[0]<=E-1e3;)this.frameTimes.shift(),this.durations.shift();null==(r=this._viewModelInstance)||r.handleCallbacks(),this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var e=this.renderer,t=this.runtime,n=this._layout,r=this.artboard;e.align(n.runtimeFit(t),n.runtimeAlignment(t),{minX:n.minX,minY:n.minY,maxX:n.maxX,maxY:n.maxY},r.bounds,this._devicePixelRatioUsed*n.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce(function(e,t){return e+t},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var e,t;this.destroyed=!0,this.stopRendering(),this.cleanupInstances(),null!==this._observed&&V.remove(this._observed),this.removeRiveListeners(),this.file&&(null==(e=this.riveFile)||e.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(W.remove(this._audioEventListener),this._audioEventListener=null),null==(t=this._viewModelInstance)||t.cleanup(),this._viewModelInstance=null,this._dataEnums=null},t.prototype.deleteRiveRenderer=function(){var e;null==(e=this.renderer)||e.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(e){if(!e)return void console.warn("No text run name provided");if(!this.artboard)return void console.warn("Tried to access text run, but the Artboard is null");var t,n=this.artboard.textRun(e);return n||void console.warn("Could not access a text run with name '".concat(e,"' in the '").concat(null==(t=this.artboard)?void 0:t.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))},t.prototype.getTextRunValue=function(e){var t=this.retrieveTextRun(e);return t?t.text:void 0},t.prototype.setTextRunValue=function(e,t){var n=this.retrieveTextRun(e);n&&(n.text=t)},t.prototype.play=function(e,t){var n=this;(e=es(e),this.readyForPlaying)?(this.animator.play(e),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return n.play(e,t)}})},t.prototype.pause=function(e){var t=this;(e=es(e),this.readyForPlaying)?(this.eventCleanup&&this.eventCleanup(),this.animator.pause(e)):this.taskQueue.add({action:function(){return t.pause(e)}})},t.prototype.scrub=function(e,t){var n=this;(e=es(e),this.readyForPlaying)?(this.animator.scrub(e,t||0),this.drawFrame()):this.taskQueue.add({action:function(){return n.scrub(e,t)}})},t.prototype.stop=function(e){var t=this;(e=es(e),this.readyForPlaying)?(this.animator&&this.animator.stop(e),this.eventCleanup&&this.eventCleanup()):this.taskQueue.add({action:function(){return t.stop(e)}})},t.prototype.reset=function(e){var t,n,r=null==e?void 0:e.artboard,i=es(null==e?void 0:e.animations),a=es(null==e?void 0:e.stateMachines),o=null!=(t=null==e?void 0:e.autoplay)&&t,s=null!=(n=null==e?void 0:e.autoBind)&&n;this.cleanupInstances(),this.initArtboard(r,i,a,o,s),this.taskQueue.process()},t.prototype.load=function(e){this.file=null,this.stop(),this.init(e)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){this._layout=e,e.maxX&&e.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var n=this.canvas.getBoundingClientRect(),r=n.width,i=n.height,a=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=a,this.canvas.width=a*r,this.canvas.height=a*i,this._needsRedraw=!0,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===e.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=r/o,this.artboard.height=i/o}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var e=[],t=0;t<this.artboard.animationCount();t++)e.push(this.artboard.animationByIndex(t).name);return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var e=[],t=0;t<this.artboard.stateMachineCount();t++)e.push(this.artboard.stateMachineByIndex(t).name);return e},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(e){if(this.loaded){var t=this.animator.stateMachines.find(function(t){return t.name===e});return null==t?void 0:t.inputs}},t.prototype.retrieveInputAtPath=function(e,t){if(!e)return void console.warn("No input name provided for path '".concat(t,"'"));if(!this.artboard)return void console.warn("Tried to access input: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));var n=this.artboard.inputByPath(e,t);return n||void console.warn("Could not access an input with name: '".concat(e,"', at path:'").concat(t,"'"))},t.prototype.setBooleanStateAtPath=function(e,t,n){var i=this.retrieveInputAtPath(e,n);i&&(i.type===r.Boolean?i.asBool().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(n,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(e,t,n){var i=this.retrieveInputAtPath(e,n);i&&(i.type===r.Number?i.asNumber().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(n,"' is not a number")))},t.prototype.fireStateAtPath=function(e,t){var n=this.retrieveInputAtPath(e,t);n&&(n.type===r.Trigger?n.asTrigger().fire():console.warn("Input with name: '".concat(e,"', at path:'").concat(t,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(e,t){if(!e)return void console.warn("No text name provided for path '".concat(t,"'"));if(!t)return void console.warn("No path provided for text '".concat(e,"'"));if(!this.artboard)return void console.warn("Tried to access text: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));var n=this.artboard.textByPath(e,t);return n||void console.warn("Could not access text with name: '".concat(e,"', at path:'").concat(t,"'"))},t.prototype.getTextRunValueAtPath=function(e,t){var n=this.retrieveTextAtPath(e,t);return n?n.text:void console.warn("Could not get text with name: '".concat(e,"', at path:'").concat(t,"'"))},t.prototype.setTextRunValueAtPath=function(e,t,n){var r=this.retrieveTextAtPath(e,n);r?r.text=t:console.warn("Could not set text with name: '".concat(e,"', at path:'").concat(n,"'"))},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(e){return e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return!e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(e){return!e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){var e,t;return null==(t=null==(e=this.animator)?void 0:e.isStopped)||t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},t.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},t.prototype.unsubscribe=function(e,t){console.warn("This function is deprecated: please use `off()` instead."),this.off(e,t)},t.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},t.prototype.unsubscribeAll=function(e){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(e)},t.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this.drawFrame()},t.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},t.prototype.enableFPSCounter=function(e){this.runtime.enableFPSCounter(e)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var e={artboards:[]},t=0;t<this.file.artboardCount();t++){for(var n=this.file.artboardByIndex(t),r={name:n.name,animations:[],stateMachines:[]},i=0;i<n.animationCount();i++){var a=n.animationByIndex(i);r.animations.push(a.name)}for(var o=0;o<n.stateMachineCount();o++){for(var s=n.stateMachineByIndex(o),l=s.name,u=new this.runtime.StateMachineInstance(s,n),c=[],h=0;h<u.inputCount();h++){var d=u.input(h);c.push({name:d.name,type:d.type})}r.stateMachines.push({name:l,inputs:c})}e.artboards.push(r)}return e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(e){this._volume=e,this.artboard&&(this.artboard.volume=e*W.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var e;return this.artboard?this.artboard.width:null!=(e=this._artboardWidth)?e:0},set:function(e){this._artboardWidth=e,this.artboard&&(this.artboard.width=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var e;return this.artboard?this.artboard.height:null!=(e=this._artboardHeight)?e:0},set:function(e){this._artboardHeight=e,this.artboard&&(this.artboard.height=e)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(e){this._devicePixelRatioUsed=e},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(e){var t;this.artboard&&!this.destroyed&&e&&e.runtimeInstance&&(e.internalIncrementReferenceCount(),null==(t=this._viewModelInstance)||t.cleanup(),this._viewModelInstance=e,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(t){return t.bindViewModelInstance(e)}):this.artboard.bindViewModelInstance(e.runtimeInstance))},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.viewModelByIndex=function(e){var t=this.file.viewModelByIndex(e);return null!==t?new G(t):null},t.prototype.viewModelByName=function(e){var t;return null==(t=this.riveFile)?void 0:t.viewModelByName(e)},t.prototype.enums=function(){if(null===this._dataEnums){var e=this.file.enums();this._dataEnums=e.map(function(e){return new Y(e)})}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var e=this.file.defaultArtboardViewModel(this.artboard);if(e)return new G(e)}return null},t.prototype.getArtboard=function(e){var t,n;return null!=(n=null==(t=this.riveFile)?void 0:t.getArtboard(e))?n:null},t.prototype.getBindableArtboard=function(e){var t,n;return null!=(n=null==(t=this.riveFile)?void 0:t.getBindableArtboard(e))?n:null},t.prototype.getDefaultBindableArtboard=function(){var e,t;return null!=(t=null==(e=this.riveFile)?void 0:e.getDefaultBindableArtboard())?t:null},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),(H=l||(l={})).none="none",H.string="string",H.number="number",H.boolean="boolean",H.color="color",H.list="list",H.enumType="enumType",H.trigger="trigger",H.viewModel="viewModel",H.integer="integer",H.listIndex="listIndex",H.image="image",H.artboard="artboard",G=function(){function e(e){this._viewModel=e}return Object.defineProperty(e.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),e.prototype.instanceByIndex=function(e){var t=this._viewModel.instanceByIndex(e);if(null!==t){var n=new q(t,null);return(0,f.createFinalization)(n,t),n}return null},e.prototype.instanceByName=function(e){var t=this._viewModel.instanceByName(e);if(null!==t){var n=new q(t,null);return(0,f.createFinalization)(n,t),n}return null},e.prototype.defaultInstance=function(){var e=this._viewModel.defaultInstance();if(null!==e){var t=new q(e,null);return(0,f.createFinalization)(t,e),t}return null},e.prototype.instance=function(){var e=this._viewModel.instance();if(null!==e){var t=new q(e,null);return(0,f.createFinalization)(t,e),t}return null},Object.defineProperty(e.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),e}(),Y=function(){function e(e){this._dataEnum=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),e}(),(X=u||(u={})).Number="number",X.String="string",X.Boolean="boolean",X.Color="color",X.Trigger="trigger",X.Enum="enum",X.List="list",X.Image="image",X.Artboard="artboard",q=function(){function e(e,t){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=e,null!==t&&this._parents.push(t)}return Object.defineProperty(e.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),e.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach(function(e){e.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(e){e.clearChanges()})),this._children.forEach(function(e){return e.handleCallbacks()})},e.prototype.addParent=function(e){!this._parents.includes(e)&&(this._parents.push(e),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&e.addToViewModelCallbacks(this))},e.prototype.removeParent=function(e){var t=this._parents.indexOf(e);-1!==t&&(this._parents[t].removeFromViewModelCallbacks(this),this._parents.splice(t,1))},e.prototype.addToPropertyCallbacks=function(e){var t=this;!this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks.push(e),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(e){e.addToViewModelCallbacks(t)}))},e.prototype.removeFromPropertyCallbacks=function(e){var t=this;this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(t){return t!==e}),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach(function(e){e.removeFromViewModelCallbacks(t)}))},e.prototype.addToViewModelCallbacks=function(e){var t=this;this._children.includes(e)||(this._children.push(e),this._parents.forEach(function(e){e.addToViewModelCallbacks(t)}))},e.prototype.removeFromViewModelCallbacks=function(e){var t=this;this._children.includes(e)&&(this._children=this._children.filter(function(t){return t!==e}),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach(function(e){e.removeFromViewModelCallbacks(t)}))},e.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(e){e.clearCallbacks()})},e.prototype.propertyFromPath=function(e,t){var n=e.split("/");return this.propertyFromPathSegments(n,0,t)},e.prototype.viewModelFromPathSegments=function(e,t){var n=this.internalViewModelInstance(e[t]);if(null!==n)if(t==e.length-1)return n;else return n.viewModelFromPathSegments(e,t++);return null},e.prototype.propertyFromPathSegments=function(e,t,n){if(t<e.length-1){var r,i,a,o,s,l,c,h,d,f,p,m,v,g,b,y,w,_,A=this.internalViewModelInstance(e[t]);return null!==A?A.propertyFromPathSegments(e,t+1,n):null}var E=null;switch(n){case u.Number:if(null!==(E=null!=(i=null==(r=this._runtimeInstance)?void 0:r.number(e[t]))?i:null))return new Q(E,this);break;case u.String:if(null!==(E=null!=(o=null==(a=this._runtimeInstance)?void 0:a.string(e[t]))?o:null))return new J(E,this);break;case u.Boolean:if(null!==(E=null!=(l=null==(s=this._runtimeInstance)?void 0:s.boolean(e[t]))?l:null))return new Z(E,this);break;case u.Color:if(null!==(E=null!=(h=null==(c=this._runtimeInstance)?void 0:c.color(e[t]))?h:null))return new er(E,this);break;case u.Trigger:if(null!==(E=null!=(f=null==(d=this._runtimeInstance)?void 0:d.trigger(e[t]))?f:null))return new ee(E,this);break;case u.Enum:if(null!==(E=null!=(m=null==(p=this._runtimeInstance)?void 0:p.enum(e[t]))?m:null))return new et(E,this);break;case u.List:if(null!==(E=null!=(g=null==(v=this._runtimeInstance)?void 0:v.list(e[t]))?g:null))return new en(E,this);break;case u.Image:if(null!==(E=null!=(y=null==(b=this._runtimeInstance)?void 0:b.image(e[t]))?y:null))return new ei(E,this);break;case u.Artboard:if(null!==(E=null!=(_=null==(w=this._runtimeInstance)?void 0:w.artboard(e[t]))?_:null))return new ea(E,this)}return null},e.prototype.internalViewModelInstance=function(t){if(this._viewModelInstances.has(t))return this._viewModelInstances.get(t);var n,r=null==(n=this._runtimeInstance)?void 0:n.viewModel(t);if(null!==r){var i=new e(r,this);return(0,f.createFinalization)(i,r),i.internalIncrementReferenceCount(),this._viewModelInstances.set(t,i),i}return null},e.prototype.number=function(e){return this.propertyFromPath(e,u.Number)},e.prototype.string=function(e){return this.propertyFromPath(e,u.String)},e.prototype.boolean=function(e){return this.propertyFromPath(e,u.Boolean)},e.prototype.color=function(e){return this.propertyFromPath(e,u.Color)},e.prototype.trigger=function(e){return this.propertyFromPath(e,u.Trigger)},e.prototype.enum=function(e){return this.propertyFromPath(e,u.Enum)},e.prototype.list=function(e){return this.propertyFromPath(e,u.List)},e.prototype.image=function(e){return this.propertyFromPath(e,u.Image)},e.prototype.artboard=function(e){return this.propertyFromPath(e,u.Artboard)},e.prototype.viewModel=function(e){var t=e.split("/"),n=t.length>1?this.viewModelFromPathSegments(t.slice(0,t.length-1),0):this;return null!=n?n.internalViewModelInstance(t[t.length-1]):null},e.prototype.internalReplaceViewModel=function(e,t){var n;if(null!==t.runtimeInstance){var r=(null==(n=this._runtimeInstance)?void 0:n.replaceViewModel(e,t.runtimeInstance))||!1;if(r){t.internalIncrementReferenceCount();var i=this.internalViewModelInstance(e);null!==i&&(i.removeParent(this),this._children.includes(i)&&(this._children=this._children.filter(function(e){return e!==i})),i.cleanup()),this._viewModelInstances.set(e,t),t.addParent(this)}return r}return!1},e.prototype.replaceViewModel=function(e,t){var n,r=e.split("/"),i=r.length>1?this.viewModelFromPathSegments(r.slice(0,r.length-1),0):this;return null!=(n=null==i?void 0:i.internalReplaceViewModel(r[r.length-1],t))&&n},e.prototype.incrementReferenceCount=function(){var e;this._referenceCount++,null==(e=this._runtimeInstance)||e.incrementReferenceCount()},e.prototype.decrementReferenceCount=function(){var e;this._referenceCount--,null==(e=this._runtimeInstance)||e.decrementReferenceCount()},Object.defineProperty(e.prototype,"properties",{get:function(){var e;return(null==(e=this._runtimeInstance)?void 0:e.getProperties().map(function(e){return v({},e)}))||[]},enumerable:!1,configurable:!0}),e.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},e.prototype.cleanup=function(){var e,t=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null==(e=this._runtimeInstance)||e.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(e){e.cleanup()}),this._viewModelInstances.clear();var n=y([],this._children,!0);this._children.length=0;var r=y([],this._parents,!0);this._parents.length=0,n.forEach(function(e){e.removeParent(t)}),r.forEach(function(e){e.removeFromViewModelCallbacks(t)})}},e}(),J=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K=function(){function e(e,t){this.callbacks=[],this._viewModelInstanceValue=e,this._parentViewModel=t}return e.prototype.on=function(e){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(e)||(this.callbacks.push(e),this._parentViewModel.addToPropertyCallbacks(this))},e.prototype.off=function(e){e?this.callbacks=this.callbacks.filter(function(t){return t!==e}):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},e.prototype.internalHandleCallback=function(e){},e.prototype.handleCallbacks=function(){var e=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(t){e.internalHandleCallback(t)})},e.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},e.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(e.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),e}()),Q=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),Z=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),ee=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),t.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},t.prototype.internalHandleCallback=function(e){e()},t}(K),et=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(e){this._viewModelInstanceValue.valueIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),en=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),t.prototype.addInstance=function(e){null!=e.runtimeInstance&&(this._viewModelInstanceValue.addInstance(e.runtimeInstance),e.addParent(this._parentViewModel))},t.prototype.addInstanceAt=function(e,t){return!!(null!=e.runtimeInstance&&this._viewModelInstanceValue.addInstanceAt(e.runtimeInstance,t))&&(e.addParent(this._parentViewModel),!0)},t.prototype.removeInstance=function(e){null!=e.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(e.runtimeInstance),e.removeParent(this._parentViewModel))},t.prototype.removeInstanceAt=function(e){this._viewModelInstanceValue.removeInstanceAt(e)},t.prototype.instanceAt=function(e){var t=this._viewModelInstanceValue.instanceAt(e);if(null!=t){var n=new q(t,this._parentViewModel);return(0,f.createFinalization)(n,t),n}return null},t.prototype.swap=function(e,t){this._viewModelInstanceValue.swap(e,t)},t.prototype.internalHandleCallback=function(e){e()},t}(K),er=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.rgb=function(e,t,n){this._viewModelInstanceValue.rgb(e,t,n)},t.prototype.rgba=function(e,t,n,r){this._viewModelInstanceValue.argb(r,e,t,n)},t.prototype.argb=function(e,t,n,r){this._viewModelInstanceValue.argb(e,t,n,r)},t.prototype.alpha=function(e){this._viewModelInstanceValue.alpha(e)},t.prototype.opacity=function(e){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,e))))},t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),ei=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t;this._viewModelInstanceValue.value(null!=(t=null==e?void 0:e.nativeImage)?t:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(K),ea=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t,n,r;r=e.isBindableArtboard?e:e.file.internalBindableArtboardFromArtboard(e.nativeArtboard),this._viewModelInstanceValue.value(null!=(t=null==r?void 0:r.nativeArtboard)?t:null),(null==r?void 0:r.nativeViewModel)&&this._viewModelInstanceValue.viewModelInstance(null!=(n=null==r?void 0:r.nativeViewModel)?n:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(K),eo=function(e){return g(void 0,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:return[4,fetch(new Request(e))];case 1:return[4,t.sent().arrayBuffer()];case 2:return[2,t.sent()]}})})},es=function(e){return"string"==typeof e?[e]:e instanceof Array?e:[]},el={EventManager:j,TaskQueueManager:k},eu=function(e){return g(void 0,void 0,void 0,function(){var t,n;return b(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return M.getInstance(function(n){n.decodeAudio(e,t)})})];case 1:return t=r.sent(),n=new f.AudioWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},ec=function(e){return g(void 0,void 0,void 0,function(){var t,n;return b(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return M.getInstance(function(n){n.decodeImage(e,t)})})];case 1:return t=r.sent(),n=new f.ImageWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},eh=function(e){return g(void 0,void 0,void 0,function(){var t,n;return b(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return M.getInstance(function(n){n.decodeFont(e,t)})})];case 1:return t=r.sent(),n=new f.FontWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},em})()},51(e,t,n){var r=0/0,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,h=u||c||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return h.Date.now()};function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==d.call(t))return r;if(v(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=v(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var u=o.test(e);return u||s.test(e)?l(e.slice(2),u?2:8):a.test(e)?r:+e}e.exports=function(e,t,n){var r,i,a,o,s,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function y(e){var n=e-l,r=e-u;return void 0===l||n>=t||n<0||h&&r>=a}function w(){var e,n,r,i=m();if(y(i))return _(i);s=setTimeout(w,(e=i-l,n=i-u,r=t-e,h?p(r,a-n):r))}function _(e){return(s=void 0,d&&r)?b(e):(r=i=void 0,o)}function A(){var e,n=m(),a=y(n);if(r=arguments,i=this,l=n,a){if(void 0===s)return u=e=l,s=setTimeout(w,t),c?b(e):o;if(h)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),o}return t=g(t)||0,v(n)&&(c=!!n.leading,a=(h="maxWait"in n)?f(g(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),A.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},A.flush=function(){return void 0===s?o:_(m())},A}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.g.importScripts&&(r=n.g.location+"");var r,i=n.g.document;if(!r&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(r=i.currentScript.src),!r)){var a=i.getElementsByTagName("script");if(a.length)for(var o=a.length-1;o>-1&&(!r||!/^http(s?):/.test(r));)r=a[o--].src}if(!r)throw Error("Automatic publicPath is not supported in this browser");n.p=r=r.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var s={};return(()=>{"use strict";let e;n.r(s),n.d(s,{OrRiveRenderer:()=>ev});let t=globalThis,r=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),a=new WeakMap;class o{constructor(e,t,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(r&&void 0===e){let n=void 0!==t&&1===t.length;n&&(e=a.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&a.set(t,e))}return e}toString(){return this.cssText}}let l=(e,...t)=>new o(1===e.length?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1],e[0]),e,i),u=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,n="";for(let t of e.cssRules)n+=t.cssText;return new o("string"==typeof(t=n)?t:t+"",void 0,i)})(e):e,{is:c,defineProperty:h,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,v=globalThis,g=v.trustedTypes,b=g?g.emptyScript:"",y=v.reactiveElementPolyfillSupport,w={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},_=(e,t)=>!c(e,t),A={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;class E 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,t=A){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&h(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??A}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...f(e),...p(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,n]of t)this.elementProperties.set(e,n)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let n of new Set(e.flat(1/0).reverse()))t.unshift(u(n));else void 0!==e&&t.push(u(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"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_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,n)=>{if(r)e.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let r of n){let n=document.createElement("style"),i=t.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}})(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,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){let i=(void 0!==n.converter?.toAttribute?n.converter:w).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){let e=n.getPropertyOptions(r),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){let r=this.constructor,i=this[e];if(!(((n??=r.getPropertyOptions(e)).hasChanged??_)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||void 0!==a)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let 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(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E.elementProperties=new Map,E.finalized=new Map,y?.({ReactiveElement:E}),(v.reactiveElementVersions??=[]).push("2.1.1");let C={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:_};function M(e){return(t,n)=>{let r;return"object"==typeof n?((e=C,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),"accessor"===r){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)})(e,t,n):(r=t.hasOwnProperty(n),t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0)}}let P=globalThis,S=P.trustedTypes,x=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,I="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+T,R=`<${L}>`,$=document,F=()=>$.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,j=Array.isArray,k="[ \n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,D=/>/g,U=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^
|
|
2
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,N=/"/g,z=/^(?:script|style|textarea|title)$/i,H=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),G=H(1),Y=(H(2),H(3),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),q=new WeakMap,K=$.createTreeWalker($,129);function J(e,t){if(!j(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(t):t}class Q{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let i=0,a=0;const o=e.length-1,s=this.parts,[l,u]=((e,t)=>{let n=e.length-1,r=[],i,a=2===t?"<svg>":3===t?"<math>":"",o=B;for(let t=0;t<n;t++){let n=e[t],s,l,u=-1,c=0;for(;c<n.length&&(o.lastIndex=c,null!==(l=o.exec(n)));)c=o.lastIndex,o===B?"!--"===l[1]?o=W:void 0!==l[1]?o=D:void 0!==l[2]?(z.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=U):void 0!==l[3]&&(o=U):o===U?">"===l[0]?(o=i??B,u=-1):void 0===l[1]?u=-2:(u=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?U:'"'===l[3]?N:V):o===N||o===V?o=U:o===W||o===D?o=B:(o=U,i=void 0);let h=o===U&&e[t+1].startsWith("/>")?" ":"";a+=o===B?n+R:u>=0?(r.push(s),n.slice(0,u)+I+n.slice(u)+T+h):n+T+(-2===u?t:h)}return[J(e,a+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(e,t);if(this.el=Q.createElement(l,n),K.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=K.nextNode())&&s.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(I)){const t=u[a++],n=r.getAttribute(e).split(T),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:i,name:o[2],strings:n,ctor:"."===o[1]?er:"?"===o[1]?ei:"@"===o[1]?ea:en}),r.removeAttribute(e)}else e.startsWith(T)&&(s.push({type:6,index:i}),r.removeAttribute(e));if(z.test(r.tagName)){const e=r.textContent.split(T),t=e.length-1;if(t>0){r.textContent=S?S.emptyScript:"";for(let n=0;n<t;n++)r.append(e[n],F()),K.nextNode(),s.push({type:2,index:++i});r.append(e[t],F())}}}else if(8===r.nodeType)if(r.data===L)s.push({type:2,index:i});else{let e=-1;for(;-1!==(e=r.data.indexOf(T,e+1));)s.push({type:7,index:i}),e+=T.length-1}i++}}static createElement(e,t){let n=$.createElement("template");return n.innerHTML=e,n}}function Z(e,t,n=e,r){if(t===Y)return t;let i=void 0!==r?n._$Co?.[r]:n._$Cl,a=O(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(e))._$AT(e,n,r),void 0!==r?(n._$Co??=[])[r]=i:n._$Cl=i),void 0!==i&&(t=Z(e,i._$AS(e,t.values),i,r)),t}class ee{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??$).importNode(t,!0);K.currentNode=r;let i=K.nextNode(),a=0,o=0,s=n[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new et(i,i.nextSibling,this,e):1===s.type?t=new s.ctor(i,s.name,s.strings,this,e):6===s.type&&(t=new eo(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=K.nextNode(),a++)}return K.currentNode=$,r}p(e){let t=0;for(let n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class et{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){let n;O(e=Z(this,e,t))?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Y&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):j(n=e)||"function"==typeof n?.[Symbol.iterator]?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!==X&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T($.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=Q.createElement(J(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new ee(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=q.get(e.strings);return void 0===t&&q.set(e.strings,t=new Q(e)),t}k(e){j(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,r=0;for(let i of e)r===t.length?t.push(n=new et(this.O(F()),this.O(F()),this,this.options)):n=t[r],n._$AI(i),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class en{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(void 0===i)(a=!O(e=Z(this,e,t,0))||e!==this._$AH&&e!==Y)&&(this._$AH=e);else{let r,o,s=e;for(e=i[0],r=0;r<i.length-1;r++)(o=Z(this,s[n+r],t,r))===Y&&(o=this._$AH[r]),a||=!O(o)||o!==this._$AH[r],o===X?e=X:e!==X&&(e+=(o??"")+i[r+1]),this._$AH[r]=o}a&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class er extends en{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ei extends en{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ea extends en{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??X)===Y)return;let n=this._$AH,r=e===X&&n!==X||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==X&&(n===X||r);r&&this.element.removeEventListener(this.name,this,n),i&&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 eo{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Z(this,e)}}let es=P.litHtmlPolyfillSupport;es?.(Q,et),(P.litHtmlVersions??=[]).push("3.3.1");let el=globalThis;class eu extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(void 0===i){let e=n?.renderBefore??null;r._$litPart$=i=new et(t.insertBefore(F(),e),e,void 0,n??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}}eu._$litElement$=!0,eu.finalized=!0,el.litElementHydrateSupport?.({LitElement:eu});let ec=el.litElementPolyfillSupport;ec?.({LitElement:eu}),(el.litElementVersions??=[]).push("4.2.1");var eh=n(933),ed=n(51),ef=n.n(ed);let ep=n.p+"04862882bda5db2f.wasm";var em=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};eh.RuntimeLoader.setWasmUrl(ep);let ev=class extends eu{constructor(){super(...arguments),this._valueQueue=[],this._onResize=ef()(e=>{var t;this._canvas&&(null==e?void 0:e.length)>0&&(this._canvas.width=e[0].contentRect.width,this._canvas.height=e[0].contentRect.height),null==(t=this._rive)||t.resizeDrawingSurfaceToCanvas()},150)}static get styles(){return[l`
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
min-height: 2rem; /* Prevent 0-height collapses */
|
|
10
|
+
}
|
|
11
|
+
canvas {
|
|
12
|
+
display: block;
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
`]}setValue(e,t){var n,r,i,a;return n=this,r=arguments,i=void 0,a=function*(e,t,n=typeof t){var r;yield this.updateComplete;let i=()=>{let r=this._rive.viewModelInstance;console.debug(`Setting ${e} ${n} value of Rive animation ${this.artboard} to`,t),"string"===n?r.string(e).value=t:"boolean"===n?r.boolean(e).value=t:"number"===n?r.number(e).value=t:"color"===n?r.color(e).value=t:"enum"===n?r.enum(e).value=t:r.trigger(e)};(null==(r=this._rive)?void 0:r.viewModelInstance)?i():this._valueQueue.push(i)},new(i||(i=Promise))(function(e,t){function o(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(o,s)}l((a=a.apply(n,r||[])).next())})}connectedCallback(){super.connectedCallback(),this._resizeObserver=new ResizeObserver(e=>this._onResize(e)),this._resizeObserver.observe(this)}disconnectedCallback(){var e,t;null==(e=this._resizeObserver)||e.disconnect(),this._onResize.cancel(),null==(t=this._rive)||t.deleteRiveRenderer(),super.disconnectedCallback()}updated(e){var t;return this.url&&this._canvas?(null==(t=this._rive)||t.deleteRiveRenderer(),console.debug("Loading Rive animation of artboard",this.artboard),this._rive=new eh.Rive({artboard:this.artboard,src:this.url,canvas:this._canvas,autoplay:!0,autoBind:!0,stateMachines:this.stateMachines,onLoad:()=>{var e;null==(e=this._rive)||e.resizeDrawingSurfaceToCanvas(),this._valueQueue&&(this._valueQueue.forEach(e=>e()),this._valueQueue=[])}})):console.warn("Could not render Rive animation; some details were missing"),super.updated(e)}render(){return G`
|
|
20
|
+
<canvas></canvas>
|
|
21
|
+
`}};em([M({type:String})],ev.prototype,"url",void 0),em([M({type:String})],ev.prototype,"artboard",void 0),em([M({type:Array})],ev.prototype,"stateMachines",void 0),em([(e,t,n)=>{let r,i,a;return r=e,i=t,(a={get(){let e;return e=this,e.renderRoot?.querySelector("canvas")??null}}).configurable=!0,a.enumerable=!0,Reflect.decorate&&"object"!=typeof i&&Object.defineProperty(r,i,a),a}],ev.prototype,"_canvas",void 0),ev=em([(e="or-rive-renderer",(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})],ev)})(),s})());
|
|
22
|
+
//# sourceMappingURL=index.bundle.js.map
|