1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7608],{59574:function(e){e.exports=(()=>{"use strict";var e,t,n,r,i,a,o,s,c,l,u,d,h,f,p,m,v,b,y,g,w,_,S,F,A,I,M,E,C,x,R,P,k,L,T,O,B,N,D,V,U,j,W,G,H,z,$,X,Y,K,q,J,Q,Z,ee,et,en,er,ei,ea,eo,es,ec,el,eu,ed,eh,ef,ep,em,ev,eb,ey,eg,ew,e_=[,(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>r.Animation});var r=n(2)},(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,{RuntimeLoader:()=>o});var r=n(4),i=n(5),a=function(){return(a=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)},o=function(){function e(){}return e.notifyError=function(t){var n;for(e.isLoading=!1;e.errorCallbackQueue.length>0;)null==(n=e.errorCallbackQueue.shift())||n(t);e.callBackQueue=[]},e.loadRuntime=function(){var t=e.wasmURL,n=e.wasmBinary;e.enablePerfMarks&&performance.mark("rive:wasm-init:start"),r.default(a({locateFile:function(){return t}},n?{wasmBinary:n}:{})).then(function(t){var n;for(e.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),e.runtime=t,e.errorCallbackQueue=[];e.callBackQueue.length>0;)null==(n=e.callBackQueue.shift())||n(e.runtime)}).catch(function(n){var r={message:(null==n?void 0:n.message)||"Unknown error",type:(null==n?void 0:n.name)||"Error",wasmError:n instanceof WebAssembly.CompileError||n instanceof WebAssembly.RuntimeError,originalError:n};
1console.debug("Rive WASM load error details:",r);var i=e.wasmFallbackURL,a=null!==i&&t.toLowerCase()===i.toLowerCase();if(null===i||a){var o=a?"the configured WASM URL or its fallback (".concat(i,")"):t,s=["Could not load Rive WASM file from ".concat(o,"."),"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(r.type),"- Message: ".concat(r.message),"- WebAssembly-specific error: ".concat(r.wasmError),"\nTo resolve, you may need to:\n1. Check your network connection\n2. Set a new WASM source via RuntimeLoader.setWasmUrl()\n3. Call RuntimeLoader.awaitInstance() again"].join("\n");console.error(s),e.notifyError(Error(s))}else console.warn("Failed to load WASM from ".concat(t," (").concat(r.message,"), trying fallback URL: ").concat(i)),e.wasmBinary=null,e.setWasmUrl(i),e.loadRuntime()})},e.getInstance=function(t,n){e.isLoading||(e.isLoading=!0,e.loadRuntime()),e.runtime?t(e.runtime):(e.callBackQueue.push(t),n&&e.errorCallbackQueue.push(n))},e.awaitInstance=function(){return new Promise(function(t,n){return e.getInstance(t,n)})},e.setWasmUrl=function(t){e.wasmURL=t},e.getWasmUrl=function(){return e.wasmURL},e.setWasmFallbackUrl=function(t){e.wasmFallbackURL=t},e.getWasmFallbackUrl=function(){return e.wasmFallbackURL},e.setWasmBinary=function(t){if(t instanceof ArrayBuffer||null===t){e.wasmBinary=t;return}console.error("setWasmBinary expects an ArrayBuffer or null")},e.getWasmBinary=function(){return e.wasmBinary},e.isLoading=!1,e.callBackQueue=[],e.wasmURL="https://unpkg.com/".concat(i.name,"@").concat(i.version,"/rive.wasm"),e.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(i.name,"@").concat(i.version,"/rive_fallback.wasm"),e.wasmBinary=null,e.errorCallbackQueue=[],e.enablePerfMarks=!1,e}()},(e,t,n)=>{var r;n.r(t),n.d(t,{default:()=>i});let i=(r=globalThis.document?.currentScript?.src,async function(e={}){let t,n;var i,a=!!globalThis.window,o=!!globalThis.WorkerGlobalScope;function s(){function e(e){let a=r;n=t=0,r=new Map,a.forEach(t=>{try{t(e)}catch(e){console.error(e)}}),this.ue(),i&&i.Xe()}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.Te=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.Xe=function(){var r=performance.now();n?(++t,1e3<(r-=n)&&(e(1e3*t/r),t=n=0)):(n=r,t=0)}}},this.ue=function(){}}function c(){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 l=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){l&&l();let t=e.decodeAudio;e.decodeAudio=function(e,n,r=null){n(e=t(e,r??null))};let n=e.decodeFont;e.decodeFont=function(e,t,r=null){t(e=n(e,r??null))};let r=e.FileAsset.prototype.decode;e.FileAsset.prototype.decode=function(e,t){return r.call(this,e,t??null)};let i=e.setFallbackFontCb;e.setFallbackFontCallback="function"==typeof i?function(e){i(e)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};let a=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=a.extend("CustomFileAssetLoader",{__construct:function({loadContents:e}){this.__parent.__construct.call(this),this.Ie=e},loadContents:function(t,n){return t=e.ptrToAsset(t),this.Ie(t,n)}}),e.CDNFileAssetLoader=a.extend("CDNFileAssetLoader",{__construct:function(e){this.__parent.__construct.call(this),this.Le=e??null},loadContents:function(t){var n,r,i;let a=e.ptrToAsset(t);if(""===(t=a.cdnUuid))return!1;let o=this.Le??null;return n=a.cdnBaseUrl+"/"+t,r=e=>{a.decode(new Uint8Array(e.response),o)},(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=a.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.pe=[]},addLoader:function(e){this.pe.push(e)},loadContents:function(e,t){for(let n of this.pe)if(n.loadContents(e,t))return!0;return!1}});let o=e.computeAlignment;e.computeAlignment=function(e,t,n,r,i=1){return o.call(this,e,t,n,r,i)}};let u=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){function t(e){this.Uc=e,this.He=e.getContext("2d"),this.je=i,this.fd=[],this.xd=0,this.clear=function(){console.assert(0==this.xd),this.fd=[],a.delete(this)},this.save=function(){++this.xd,this.fd.push(i.save.bind(i))},this.restore=function(){0<this.xd&&(this.fd.push(i.restore.bind(i)),--this.xd)},this.transform=function(e){this.fd.push(i.transform.bind(i,e))},this.align=function(e,t,n,r,a=1){this.fd.push(i.align.bind(i,e,t,n,r,a))},this.flush=function(){console.assert(0==this.xd),a.add(this),i.ie||r()},this.bindContext=function(){let e=this.je;e&&e.pd&&t8(e.pd)},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;t8(r=t5(t,r));let i=o(e.width,e.height);i.pd=r,i.Uc=e,i.Xd=e.width,i.Wd=e.height,i.gd=t,i.Ne=function(){this.pd&&t8(this.pd)};var a=i.delete;return i.delete=function(){this.Ne(),a.call(this);var e=this.pd;tw===tQ[e]&&(tw=null),"object"==typeof JSEvents&&JSEvents.Tf(tQ[e].Tc.canvas),tQ[e]?.Tc.canvas&&(tQ[e].Tc.canvas.Ge=void 0),this.pd=this.Uc=this.Xd=this.Wd=this.gd=tQ[e]=null},i}function r(){if(i){var t=i.Ke,n=0,r=0,o=0,s=Array(a.size),c=0;for(var l of a)l.td=Math.min(l.Uc.width,t),l.sd=Math.min(l.Uc.height,t),l.Ud=l.sd*l.td,n=Math.max(n,l.td),r=Math.max(r,l.sd),o+=l.Ud,s[c++]=l;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)=>
1t.Ud-e.Ud),o=new e.DynamicRectanizer(t),l=0;l<s.length;){for(o.reset(n,r),c=l;c<s.length;++c){var u=s[c],d=o.addRect(u.td,u.sd);if(0>d){console.assert(c>l);break}u.Fd=65535&d,u.Gd=d>>16}for(u=h.push(o.drawWidth()),d=f.push(o.drawHeight()),console.assert(u>=o.drawWidth()),console.assert(d>=o.drawHeight()),console.assert(u<=t),console.assert(d<=t),i.Uc.width!=u&&(i.Uc.width=u),i.Uc.height!=d&&(i.Uc.height=d),i.clear(),u=l;u<c;++u){d=s[u],i.saveClipRect(d.Fd,d.Gd,d.Fd+d.td,d.Gd+d.sd);let t=new e.Mat2D;for(let e of(t.xx=d.td/d.Uc.width,t.yy=d.sd/d.Uc.height,t.xy=t.yx=0,t.tx=d.Fd,t.ty=d.Gd,i.transform(t),d.fd))e();i.restoreClipRect(),d.fd=[]}for(i.flush();l<c;++l)(d=(u=s[l]).He).globalCompositeOperation="copy",d.drawImage(i.Uc,u.Fd,u.Gd,u.td,u.sd,0,0,u.Uc.width,u.Uc.height);l=c}}}}u&&u();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))?(i.ie=!!i.gd.getExtension("WEBGL_shader_pixel_local_storage"),i.Ke=Math.min(i.gd.getParameter(i.gd.MAX_RENDERBUFFER_SIZE),i.gd.getParameter(i.gd.MAX_TEXTURE_SIZE)),i.Vd=!i.ie,(e=i.gd.getExtension("WEBGL_debug_renderer_info"))&&(t=i.gd.getParameter(e.UNMASKED_RENDERER_WEBGL),i.gd.getParameter(e.UNMASKED_VENDOR_WEBGL).includes("Google")&&t.includes("ANGLE Metal Renderer")&&(i.Vd=!1)),i):null}if(!(i=a(!0)))throw"Unable to create WebGL context, your environment may not support WebGL. Try out @rive-app/canvas as an alternative.";i.Vd||(i=a(!1))}return r?new t(e):n(e,i.Vd)};let l=e.Artboard.prototype.delete;e.Artboard.prototype.delete=function(){this.Me=!0,l.call(this)};let d=e.Artboard.prototype.draw;e.Artboard.prototype.draw=function(e){e.fd?e.fd.push(()=>{this.Me||d.call(this,e.je)}):d.call(this,e)};let h=new c,f=new c,p=new s;e.requestAnimationFrame=p.requestAnimationFrame.bind(p),e.cancelAnimationFrame=p.cancelAnimationFrame.bind(p),e.enableFPSCounter=p.Te.bind(p),p.ue=r,e.resolveAnimationFrame=r;let m=e.load;e.load=function(t,n,r=!0,i=null){let a=new e.FallbackFileAssetLoader;return void 0!==n&&a.addLoader(n),r&&(n=new e.CDNFileAssetLoader(i),a.addLoader(n)),Promise.resolve(m(t,a,i??null))};let v=e.WebGL2Renderer.prototype.clear;e.WebGL2Renderer.prototype.clear=function(){t8(this.pd);let e=this.Uc;(this.Xd!=e.width||this.Wd!=e.height)&&(this.resize(e.width,e.height),this.Xd=e.width,this.Wd=e.height),v.call(this)},e.decodeImage=function(t,n,r=null){n(t=e.decodeWebGL2Image(t,r??null))};let b=e.Renderer.prototype.align;e.Renderer.prototype.align=function(e,t,n,r,i=1){b.call(this,e,t,n,r,i)}};var d="./this.program";o&&(r=self.location.href);var h,f,p="";if(a||o){try{p=new URL(".",r).href}catch{}o&&(f=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=async e=>{if(P(e))return new Promise((t,n)=>{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.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)}}var m,v,b,y,g,w,_,S,F,A,I,M,E,C=console.log.bind(console),x=console.error.bind(console),R=!1,P=e=>e.startsWith("file://"),k=!1;function L(){var t=ng.buffer;e.HEAP8=y=new Int8Array(t),w=new Int16Array(t),e.HEAPU8=g=new Uint8Array(t),e.HEAPU16=_=new
1Uint16Array(t),e.HEAP32=S=new Int32Array(t),e.HEAPU32=F=new Uint32Array(t),e.HEAPF32=A=new Float32Array(t),I=new Float64Array(t),M=new BigInt64Array(t),E=new BigUint64Array(t)}function T(t){throw e.onAbort?.(t),x(t="Aborted("+t+")"),R=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),b?.(t),t}async function O(e){if(!m)try{var t=await h(e);return new Uint8Array(t)}catch{}if(e==tb&&m)e=new Uint8Array(m);else if(f)e=f(e);else throw"both async and sync fetching of the wasm failed";return e}async function B(e,t){try{var n=await O(e);return await WebAssembly.instantiate(n,t)}catch(e){x(`failed to asynchronously prepare wasm: ${e}`),T(e)}}async function N(e){if(!m&&!P(tb))try{var t=fetch(tb,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(e){x(`wasm streaming compile failed: ${e}`),x("falling back to ArrayBuffer instantiation")}return B(tb,e)}var D=t=>{for(;0<t.length;)t.shift()(e)},V=[],U=[],j=()=>{var t=e.preRun.shift();U.push(t)},W=()=>{var e=S[eO>>2];return eO+=4,e},G=(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},H=e=>{var t="/"===e.charAt(0),n="/"===e.slice(-1);return(e=G(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},z=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return(e=t[0],t=t[1],e||t)?e+(t&&=t.slice(0,-1)):"."},$=e=>{($=e=>crypto.getRandomValues(e))(e)},X=globalThis.TextDecoder&&new TextDecoder,Y=(e,t,n,r)=>{if(n=t+n,r)return n;for(;e[t]&&!(t>=n);)++t;return t},K=(e,t=0,n,r)=>{if(16<(n=Y(e,t,n,r))-t&&e.buffer&&X)return X.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},q=[],J=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},Q=(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.codePointAt(a);if(127>=o){if(n>=r)break;t[n++]=o}else if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6,t[n++]=128|63&o}else if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|63&o}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,a++}}return t[n]=0,n-i},Z=[];function ee(e,t){Z[e]={input:[],output:[],kd:t},eI(e,et)}var et={open(e){var t=Z[e.node.Rd];if(!t)throw new ed(43);e.Mc=t,e.seekable=!1},close(e){e.Mc.kd.Hd(e.Mc)},Hd(e){e.Mc.kd.Hd(e.Mc)},read(e,t,n,r){if(!e.Mc||!e.Mc.kd.oe)throw new ed(60);for(var i=0,a=0;a<r;a++){try{var o=e.Mc.kd.oe(e.Mc)}catch(e){throw new ed(29)}if(void 0===o&&0===i)throw new ed(6);if(null==o)break;i++,t[n+a]=o}return i&&(e.node.qd=Date.now()),i},write(e,t,n,r){if(!e.Mc||!e.Mc.kd.ee)throw new ed(60);try{for(var i=0;i<r;i++)e.Mc.kd.ee(e.Mc,t[n+i])}catch(e){throw new ed(29)}return r&&(e.node.$c=e.node.Xc=Date.now()),i}},en={cd:null,jd:()=>en.createNode(null,"/",16895,0),createNode(e,t,n,r){if(24576==(61440&n)||4096==(61440&n))throw new ed(63);return en.cd||(en.cd={dir:{node:{nd:en.Jc.nd,ed:en.Jc.ed,zd:en.Jc.zd,Od:en.Jc.Od,ze:en.Jc.ze,Ee:en.Jc.Ee,Be:en.Jc.Be,ge:en.Jc.ge,Td:en.Jc.Td},stream:{bd:en.Hc.bd}},file:{node:{nd:en.Jc.nd,ed:en.Jc.ed},stream:{bd:en.Hc.bd,read:en.Hc.read,write:en.Hc.write,re:en.Hc.re,te:en.Hc.te}},link:{node:{nd:en.Jc.nd,ed:en.Jc.ed,Ad:en.Jc.Ad},stream:{}},ke:{node:{nd:en.Jc.nd,ed:en.Jc.ed},stream:eA}}),16384==(61440&(n=eb(e,t,n,r)).mode)?(n.Jc=en.cd.dir.node,n.Hc=en.cd.dir.stream,n.Ic={}):32768==(61440&n.mode)?(n.Jc=en.cd.file.node,n.Hc=en.cd.file.stream,n.Qc=0,n.Ic=null):40960==(61440&n.mode)?(n.Jc=en.cd.link.node,n.Hc=en.cd.link.stream):8192==(61440&n.mode)&&(n.Jc=en.cd.ke.node,n.Hc=en.cd.ke.stream),n.qd=n.$c=n.Xc=Date.now(),e&&(e.Ic[t]=n,e.qd=e.$c=e.Xc=n.qd),n},Lf:e=>e.Ic?e.Ic.subarray?e.Ic.subarray(0,e.Qc):new Uint8Array(e.Ic):new Uint8Array(0),Jc:{nd(e){var t={};
1return t.Hf=8192==(61440&e.mode)?e.id:1,t.Nf=e.id,t.mode=e.mode,t.Rf=1,t.uid=0,t.Mf=0,t.Rd=e.Rd,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.Qc:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.qd=new Date(e.qd),t.$c=new Date(e.$c),t.Xc=new Date(e.Xc),t.Oe=4096,t.Bf=Math.ceil(t.size/t.Oe),t},ed(e,t){for(var n of["mode","atime","mtime","ctime"])null!=t[n]&&(e[n]=t[n]);void 0!==t.size&&(t=t.size,e.Qc!=t&&(0==t?(e.Ic=null,e.Qc=0):(n=e.Ic,e.Ic=new Uint8Array(t),n&&e.Ic.set(n.subarray(0,Math.min(t,e.Qc))),e.Qc=t)))},zd(){throw en.Zd||(en.Zd=new ed(44),en.Zd.stack="<generic error, no stack>"),en.Zd},Od:(e,t,n,r)=>en.createNode(e,t,n,r),ze(e,t,n){try{var r=ev(t,n)}catch(e){}if(r){if(16384==(61440&e.mode))for(var i in r.Ic)throw new ed(55);if(es[i=em(r.parent.id,r.name)]===r)es[i]=r.vd;else for(i=es[i];i;){if(i.vd===r){i.vd=r.vd;break}i=i.vd}}delete e.parent.Ic[e.name],t.Ic[n]=e,e.name=n,t.Xc=t.$c=e.parent.Xc=e.parent.$c=Date.now()},Ee(e,t){delete e.Ic[t],e.Xc=e.$c=Date.now()},Be(e,t){var n,r=ev(e,t);for(n in r.Ic)throw new ed(55);delete e.Ic[t],e.Xc=e.$c=Date.now()},ge:e=>[".","..",...Object.keys(e.Ic)],Td:(e,t,n)=>((e=en.createNode(e,t,41471,0)).link=n,e),Ad(e){if(40960!=(61440&e.mode))throw new ed(28);return e.link}},Hc:{read(e,t,n,r,i){var a=e.node.Ic;if(i>=e.node.Qc)return 0;if(8<(e=Math.min(e.node.Qc-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===y.buffer&&(a=!1),!r)return 0;if((e=e.node).$c=e.Xc=Date.now(),t.subarray&&(!e.Ic||e.Ic.subarray)){if(a)return e.Ic=t.subarray(n,n+r),e.Qc=r;if(0===e.Qc&&0===i)return e.Ic=t.slice(n,n+r),e.Qc=r;if(i+r<=e.Qc)return e.Ic.set(t.subarray(n,n+r),i),r}a=i+r;var o=e.Ic?e.Ic.length:0;if(o>=a||(a=Math.max(a,o*(1048576>o?2:1.125)>>>0),0!=o&&(a=Math.max(a,256)),o=e.Ic,e.Ic=new Uint8Array(a),0<e.Qc&&e.Ic.set(o.subarray(0,e.Qc),0)),e.Ic.subarray&&t.subarray)e.Ic.set(t.subarray(n,n+r),i);else for(a=0;a<r;a++)e.Ic[i+a]=t[n+a];return e.Qc=Math.max(e.Qc,i+r),r},bd(e,t,n){if(1===n?t+=e.position:2===n&&32768==(61440&e.node.mode)&&(t+=e.node.Qc),0>t)throw new ed(28);return t},re(e,t,n,r,i){if(32768!=(61440&e.node.mode))throw new ed(43);if(e=e.node.Ic,2&i||!e||e.buffer!==y.buffer)throw r=!0,T(),i=void 0,new ed(48);return r=!1,i=e.byteOffset,{Lc:i,Af:r}},te:(e,t,n,r)=>(en.Hc.write(e,t,0,r,n,!1),0)}},er=null,ei={},ea=[],eo=1,es=null,ec=!1,el=!0,eu={},ed=class{name="ErrnoError";constructor(e){this.ld=e}},eh=class{Dd={};node=null;get flags(){return this.Dd.flags}set flags(e){this.Dd.flags=e}get position(){return this.Dd.position}set position(e){this.Dd.position=e}},ef=class{Jc={};Hc={};Pd=null;constructor(e,t,n,r){e||=this,this.parent=e,this.jd=e.jd,this.id=eo++,this.name=t,this.mode=n,this.Rd=r,this.qd=this.$c=this.Xc=Date.now()}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 ep(e,t={}){if(!e)throw new ed(44);t.ae??(t.ae=!0),"/"===e.charAt(0)||(e="//"+e);var n=0;e:for(;40>n;n++){e=e.split("/").filter(e=>!!e);for(var r=er,i="/",a=0;a<e.length;a++){var o=a===e.length-1;if(o&&t.parent)break;if("."!==e[a])if(".."===e[a])if(i=z(i),r===r.parent){e=i+"/"+e.slice(a+1).join("/"),n--;continue e}else r=r.parent;else{i=H(i+"/"+e[a]);try{r=ev(r,e[a])}catch(e){if(44===e?.ld&&o&&t.mf)return{path:i};throw e}if(r.Pd&&(!o||t.ae)&&(r=r.Pd.root),40960==(61440&r.mode)&&(!o||t.$d)){if(!r.Jc.Ad)throw new ed(52);"/"===(r=r.Jc.Ad(r)).charAt(0)||(r=z(i)+"/"+r),e=r+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:r}}throw new ed(32)}function em(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%es.length}function ev(e,t){var n=16384==(61440&e.mode)?(n=eg(e,"x"))?n:2*!e.Jc.zd:54;if(n)throw new ed(n);for(n=es[em(e.id,t)];n;n=n.vd){var r=n.name;if(n.parent.id===e.id&&r===t)return n}return e.Jc.zd(e,t)}function eb(e,t,n,r){return t=em((e=new ef(e,t,n,r)).parent.id,e.name),e.vd=es[t],es[t]=e}function ey(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function eg(e,t){return el?0:t.includes("r")&&!(292&e.mode)||t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0}function ew(e,t){if(16384!=(61440&e.mode))return 54;try{return ev(e,t),20}catch(e){}
1return eg(e,"wx")}function e_(e){if(!(e=ea[e]))throw new ed(8);return e}function eS(e,t=-1){if(e=Object.assign(new eh,e),-1==t)e:{for(t=0;4096>=t;t++)if(!ea[t])break e;throw new ed(33)}return e.md=t,ea[t]=e}function eF(e,t){var n=void 0,r=n?null:e;if(!(n??=e.Jc.ed))throw new ed(63);n(r,t)}var eA={open(e){e.Hc=ei[e.node.Rd].Hc,e.Hc.open?.(e)},bd(){throw new ed(70)}};function eI(e,t){ei[e]={Hc:t}}function eM(e,t){var n="/"===t;if(n&&er)throw new ed(10);if(!n&&t){var r=ep(t,{ae:!1});if(t=r.path,(r=r.node).Pd)throw new ed(10);if(16384!=(61440&r.mode))throw new ed(54)}t={type:e,Sf:{},se:t,kf:[]},(e=e.jd(t)).jd=t,t.root=e,n?er=e:r&&(r.Pd=t,r.jd&&r.jd.kf.push(t))}function eE(e,t,n){var r=ep(e,{parent:!0}).node;if(!(e=e&&e.match(/([^\/]+|\/)\/*$/)[1]))throw new ed(28);if("."===e||".."===e)throw new ed(20);var i=ew(r,e);if(i)throw new ed(i);if(!r.Jc.Od)throw new ed(63);return r.Jc.Od(r,e,t,n)}function eC(e){return eE(e,16895,0)}function ex(e,t,n){void 0===n&&(n=t,t=438),eE(e,8192|t,n)}function eR(e,t){if(!((...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=G(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."})(e))throw new ed(44);var n=ep(t,{parent:!0}).node;if(!n)throw new ed(44);var r=ew(n,t=t&&t.match(/([^\/]+|\/)\/*$/)[1]);if(r)throw new ed(r);if(!n.Jc.Td)throw new ed(63);n.Jc.Td(n,t,e)}function eP(t,n,r=438){if(""===t)throw new ed(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?4095&r|32768:0,"object"==typeof t)i=t;else{var a=t.endsWith("/");i=(t=ep(t,{$d:!(131072&n),mf:!0})).node,t=t.path}var o=!1;if(64&n)if(i){if(128&n)throw new ed(20)}else{if(a)throw new ed(31);i=eE(t,511|r,0),o=!0}if(!i)throw new ed(44);if(8192==(61440&i.mode)&&(n&=-513),65536&n&&16384!=(61440&i.mode))throw new ed(54);if(!o&&(a=i?40960==(61440&i.mode)?32:16384==(61440&i.mode)&&("r"!==ey(n)||576&n)?31:eg(i,ey(n)):44))throw new ed(a);if(512&n&&!o){if(16384==(61440&(a="string"==typeof(a=i)?ep(a,{$d:!0}).node:a).mode))throw new ed(31);if(32768!=(61440&a.mode))throw new ed(28);var s=eg(a,"w");if(s)throw new ed(s);eF(a,{size:0,timestamp:Date.now()})}for(n&=-131713,a=i;;){if(a===a.parent){a=a.jd.se;var c=c?"/"!==a[a.length-1]?`${a}/${c}`:a+c:a;break}c=c?`${a.name}/${c}`:a.name,a=a.parent}return(c=eS({node:i,path:c,flags:n,seekable:!0,position:0,Hc:i.Hc,uf:[],error:!1})).Hc.open&&c.Hc.open(c),o&&(r&=511,eF(i="string"==typeof i?ep(i,{$d:!0}).node:i,{mode:4095&r|-4096&i.mode,Xc:Date.now(),Jf:void 0})),!e.logReadFiles||1&n||t in eu||(eu[t]=1),c}function ek(e,t,n){if(null===e.md)throw new ed(8);if(!e.seekable||!e.Hc.bd)throw new ed(70);if(0!=n&&1!=n&&2!=n)throw new ed(28);e.position=e.Hc.bd(e,t,n),e.uf=[]}
1function eL(e,t,n){e=H("/dev/"+e);var r,i=(r=0,t&&(r|=365),n&&(r|=146),r);eL.qe??(eL.qe=64);var a=eL.qe++<<8;eI(a,{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 ed(29)}if(void 0===s&&0===a)throw new ed(6);if(null==s)break;a++,n[r+o]=s}return a&&(e.node.qd=Date.now()),a},write(e,t,r,i){for(var a=0;a<i;a++)try{n(t[r+a])}catch(e){throw new ed(29)}return i&&(e.node.$c=e.node.Xc=Date.now()),a}}),ex(e,i,a)}var eT={},eO=void 0,eB=(e,t)=>Object.defineProperty(t,"name",{value:e}),eN=[],eD=[0,1,,1,null,1,!0,1,!1,1],eV=class extends Error{constructor(e){super(e),this.name="BindingError"}},eU=e=>{if(!e)throw new eV(`Cannot use deleted val. handle = ${e}`);return eD[e]},ej=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=eN.pop()||eD.length;return eD[t]=e,eD[t+1]=1,t}};class eW extends Error{}var eG=e=>{for(var t="";;){var n=g[e++];if(!n)return t;t+=String.fromCharCode(n)}},eH={},ez=(e,t)=>{if(void 0===t)throw new eV("ptr should not be undefined");for(;e.Rc;)t=e.Cd(t),e=e.Rc;return t},e$={},eX=e=>{var t=eG(e=nh(e));return nu(e),t},eY=(e,t)=>{var n=e$[e];if(void 0===n)throw new eV(e=`${t} has unknown type ${eX(e)}`);return n},eK=()=>{},eq=!1,eJ=e=>globalThis.FinalizationRegistry?(eq=new FinalizationRegistry(e=>{e=e.Fc,--e.count.value,0===e.count.value&&(e.Sc?e.Yc.dd(e.Sc):e.Nc.Gc.dd(e.Lc))}),eJ=e=>{var t=e.Fc;return t.Sc&&eq.register(e,{Fc:t},e),e},eK=e=>{eq.unregister(e)},eJ(e)):(eJ=e=>e,e),eQ={},eZ=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function e0(e){return this.Kc(F[e>>2])}var e1={},e2={},e4=class extends Error{constructor(e){super(e),this.name="InternalError"}},e3=(e,t,n)=>{function r(t){if((t=n(t)).length!==e.length)throw new e4("Mismatched type converter count");for(var r=0;r<e.length;++r)e6(e[r],t[r])}e.forEach(e=>e2[e]=t);var i=Array(t.length),a=[],o=0;for(let[e,n]of t.entries())e$.hasOwnProperty(n)?i[e]=e$[n]:(a.push(n),e1.hasOwnProperty(n)||(e1[n]=[]),e1[n].push(()=>
1{i[e]=e$[n],++o===a.length&&r(i)}));0===a.length&&r(i)};function e6(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new eV(`type "${r}" must have a positive integer typeid pointer`);if(e$.hasOwnProperty(e)){if(n.cf)return;throw new eV(`Cannot register type '${r}' twice`)}e$[e]=t,delete e2[e],e1.hasOwnProperty(e)&&(t=e1[e],delete e1[e],t.forEach(e=>e()))}(e,t,n)}var e5=(e,t,n)=>{switch(t){case 1:return n?e=>y[e]:e=>g[e];case 2:return n?e=>w[e>>1]:e=>_[e>>1];case 4:return n?e=>S[e>>2]:e=>F[e>>2];case 8:return n?e=>M[e>>3]:e=>E[e>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},e8=e=>{throw new eV(e.Fc.Nc.Gc.name+" instance already deleted")},e9=[];function e7(){}var te={},tt=(e,t,n)=>{if(void 0===e[t].Pc){var r=e[t];e[t]=function(...r){if(!e[t].Pc.hasOwnProperty(r.length))throw new eV(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].Pc})!`);return e[t].Pc[r.length].apply(this,r)},e[t].Pc=[],e[t].Pc[r.hd]=r}},tn=(t,n,r)=>{if(e.hasOwnProperty(t)){if(void 0===r||void 0!==e[t].Pc&&void 0!==e[t].Pc[r])throw new eV(`Cannot register public name '${t}' twice`);if(tt(e,t,t),e[t].Pc.hasOwnProperty(r))throw new eV(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);e[t].Pc[r]=n}else e[t]=n,e[t].hd=r};function tr(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.ad=n,this.dd=r,this.Rc=i,this.Ye=a,this.Cd=o,this.Re=s,this.we=[]}var ti=(e,t,n)=>{for(;t!==n;){if(!t.Cd)throw new eV(`Expected null or instance of ${n.name}, got an instance of ${t.name}`);e=t.Cd(e),t=t.Rc}return e},ta=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function to(e,t){if(null===t){if(this.ce)throw new eV(`null is not a valid ${this.name}`);return 0}if(!t.Fc)throw new eV(`Cannot pass "${ta(t)}" as a ${this.name}`);if(!t.Fc.Lc)throw new eV(`Cannot pass deleted object as a pointer of type ${this.name}`);return ti(t.Fc.Lc,t.Fc.Nc.Gc,this.Gc)}function ts(e,t){if(null===t){if(this.ce)throw new eV(`null is not a valid ${this.name}`);if(this.Kd){var n=this.fe();return null!==e&&e.push(this.dd,n),n}return 0}if(!t||!t.Fc)throw new eV(`Cannot pass "${ta(t)}" as a ${this.name}`);if(!t.Fc.Lc)throw new eV(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Jd&&t.Fc.Nc.Jd)throw new eV(`Cannot convert argument of type ${t.Fc.Yc?t.Fc.Yc.name:t.Fc.Nc.name} to parameter type ${this.name}`);if(n=ti(t.Fc.Lc,t.Fc.Nc.Gc,this.Gc),this.Kd){if(void 0===t.Fc.Sc)throw new eV("Passing raw pointer to smart pointer is illegal");switch(this.tf){case 0:if(t.Fc.Yc===this)n=t.Fc.Sc;else throw new eV(`Cannot convert argument of type ${t.Fc.Yc?t.Fc.Yc.name:t.Fc.Nc.name} to parameter type ${this.name}`);break;case 1:n=t.Fc.Sc;break;case 2:if(t.Fc.Yc===this)n=t.Fc.Sc;else{var r=t.clone();n=this.pf(n,ej(()=>r.delete())),null!==e&&e.push(this.dd,n)}break;default:throw new eV("Unsupported sharing policy")}}return n}function tc(e,t){if(null===t){if(this.ce)throw new eV(`null is not a valid ${this.name}`);return 0}if(!t.Fc)throw new eV(`Cannot pass "${ta(t)}" as a ${this.name}`);if(!t.Fc.Lc)throw new eV(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.Fc.Nc.Jd)throw new eV(`Cannot convert argument of type ${t.Fc.Nc.name} to parameter type ${this.name}`);return ti(t.Fc.Lc,t.Fc.Nc.Gc,this.Gc)}var tl=(e,t,n)=>t===n?e:void 0===n.Rc||null===(e=tl(e,t,n.Rc))?null:n.Re(e),tu=(e,t)=>{if(!t.Nc||!t.Lc)throw new e4("makeClassHandle requires ptr and ptrType");if(!!t.Yc!=!!t.Sc)throw new e4("Both smartPtrType and smartPtr must be specified");return t.count={value:1},eJ(Object.create(e,{Fc:{value:t,writable:!0}}))};function td(e,t,n,r,i,a,o,s,c,l,u){this.name=e,this.Gc=t,this.ce=n,this.Jd=r,this.Kd=i,this.nf=a,this.tf=o,this.ye=s,this.fe=c,this.pf=l,this.dd=u,i||void 0!==t.Rc?this.Oc=ts:(this.Oc=r?to:tc,this.Vc=null)}var th=(t,n,r)=>{if(!e.hasOwnProperty(t))throw new e4("Replacing nonexistent public symbol");void 0!==e[t].Pc&&void 0!==r?e[t].Pc[r]=n:(e[t]=n,e[t].hd=r)},tf=(e,t)=>{e=eG(e);var n=nw.get(t);if("function"!=typeof n)throw new eV(`unknown function pointer with signature ${e}: ${t}`);return n};
1class tp extends Error{}var tm=(e,t)=>{var n=[],r={};throw t.forEach(function e(t){r[t]||e$[t]||(e2[t]?e2[t].forEach(e):(n.push(t),r[t]=!0))}),new tp(`${e}: `+n.map(eX).join([", "]))};function tv(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].Vc)return!0;return!1}(t),c=!t[0].jf,l=a-2,u=Array(l),d=[],h=[];return eB(e,function(...e){if(h.length=0,d.length=o?2:1,d[0]=i,o){var n=t[1].Oc(h,this);d[1]=n}for(var a=0;a<l;++a)u[a]=t[a+2].Oc(h,e[a]),d.push(u[a]);if(e=r(...d),s)eZ(h);else for(a=o?1:2;a<t.length;a++){var f=1===a?n:u[a-2];null!==t[a].Vc&&t[a].Vc(f)}return c?t[0].Kc(e):void 0})}var tb,ty,tg,tw,t_,tS=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(F[t+4*r>>2]);return n},tF=e=>{let t=(e=e.trim()).indexOf("(");return -1===t?e:e.slice(0,t)},tA=(e,t,n)=>{if(!(e instanceof Object))throw new eV(`${n} with invalid "this": ${e}`);if(!(e instanceof t.Gc.constructor))throw new eV(`${n} incompatible with "this" of type ${e.constructor.name}`);if(!e.Fc.Lc)throw new eV(`cannot call emscripten binding method ${n} on deleted object`);return ti(e.Fc.Lc,e.Fc.Nc.Gc,t.Gc)},tI=e=>{9<e&&0==--eD[e+1]&&(eD[e]=void 0,eN.push(e))},tM={name:"emscripten::val",Kc:e=>{var t=eU(e);return tI(e),t},Oc:(e,t)=>ej(t),Wc:e0,Vc:null},tE=(e,t,n)=>{switch(t){case 1:return n?function(e){return this.Kc(y[e])}:function(e){return this.Kc(g[e])};case 2:return n?function(e){return this.Kc(w[e>>1])}:function(e){return this.Kc(_[e>>1])};case 4:return n?function(e){return this.Kc(S[e>>2])}:function(e){return this.Kc(F[e>>2])};default:throw TypeError(`invalid integer width (${t}): ${e}`)}},tC=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,tx=(e,t,n)=>{if(e>>=1,16<(t=Y(_,e,t/2,n))-e&&tC)return tC.decode(_.subarray(e,t));for(n="";e<t;++e)n+=String.fromCharCode(_[e]);return n},tR=(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)w[t>>1]=e.charCodeAt(i),t+=2;return w[t>>1]=0,t-r},tP=e=>2*e.length,tk=(e,t,n)=>{var r="";e>>=2;for(var i=0;!(i>=t/4);i++){var a=F[e+i];if(!a&&!n)break;r+=String.fromCodePoint(a)}return r},tL=(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.codePointAt(i);if(65535<a&&i++,S[t>>2]=a,(t+=4)+4>n)break}return S[t>>2]=0,t-r},tT=e=>{for(var t=0,n=0;n<e.length;++n)65535<e.codePointAt(n)&&n++,t+=4;return t},tO=[],tB={},tN=e=>{var t=tB[e];return void 0===t?eG(e):t},tD=[0,31,60,91,121,152,182,213,244,274,305,335],tV=[0,31,59,90,120,151,181,212,243,273,304,334],tU=[],tj=e=>{e.If=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")},tW=e=>{e.Qf=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")},tG=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_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" ");return(e.getSupportedExtensions()||[]).filter(e=>t.includes(e))},tH=1,tz=[],t$=[],tX=[],tY=[],tK=[],tq=[],tJ=[],tQ=[],tZ=[],t0={},t1={},t2=4,t4=0,t3=e=>{for(var t=tH++,n=e.length;n<t;n++)e[n]=null;return t},t6=(e,t,n,r)=>{for(var i=0;i<e;i++){var a=ty[n](),o=a&&t3(r);a?(a.name=o,r[o]=a):tg||=1282,S[t+4*i>>2]=o}},t5=(e,t)=>{var n=t3(tQ),r={handle:n,attributes:t,version:t.Pf,Tc:e};if(e.canvas&&(e.canvas.Ge=r),tQ[n]=r,(void 0===t.Se||t.Se)&&((e=r)||(e=tw),!e.df))for(var i of(e.df=!0,(t=e.Tc).lf=t.getExtension("WEBGL_multi_draw"),t.Ve=t.getExtension("EXT_polygon_offset_clamp"),t.Ue=t.getExtension("EXT_clip_control"),t.vf=t.getExtension("WEBGL_polygon_mode"),tj(t),tW(t),2<=e.version&&(t.me=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.me)&&(t.me=t.getExtension("EXT_disjoint_timer_query")),tG(t)))i.includes("lose_context")||i.includes("debug")||t.getExtension(i);return n},t8=t=>(tw=tQ[t],e.ctx=ty=tw?.Tc,!(t&&!ty)),t9={},t7=()=>
1{if(!t_){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(e in t9)void 0===t9[e]?delete t[e]:t[e]=t9[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);t_=n}return t_},ne=[],nt=()=>{var e=tG(ty);return e.concat(e.map(e=>"GL_"+e))},nn=(e,t,n)=>{if(t){var r=void 0;switch(e){case 36346:r=1;break;case 36344:0!=n&&1!=n&&(tg||=1280);return;case 34814:case 36345:r=0;break;case 34466:var i=ty.getParameter(34467);r=i?i.length:0;break;case 33309:if(2>tw.version){tg||=1282;return}r=nt().length;break;case 33307:case 33308:if(2>tw.version){tg||=1280;return}r=3*(33307==e)}if(void 0===r)switch(typeof(i=ty.getParameter(e))){case"number":r=i;break;case"boolean":r=+!!i;break;case"string":tg||=1280;return;case"object":if(null===i)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:r=0;break;default:tg||=1280;return}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(e=0;e<i.length;++e)switch(n){case 0:S[t+4*e>>2]=i[e];break;case 2:A[t+4*e>>2]=i[e];break;case 4:y[t+e]=+!!i[e]}return}try{r=0|i.name}catch(t){tg||=1280,x(`GL_INVALID_ENUM in glGet${n}v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`);return}}break;default:tg||=1280,x(`GL_INVALID_ENUM in glGet${n}v: Native code calling glGet${n}v(${e}) and it returns ${i} of type ${typeof i}!`);return}switch(n){case 1:n=r,F[t>>2]=n,F[t+4>>2]=(n-F[t>>2])/0x100000000;break;case 0:S[t>>2]=r;break;case 2:A[t>>2]=r;break;case 4:y[t]=+!!r}}else tg||=1281},nr=e=>{var t=J(e)+1,n=nd(t);return n&&Q(e,g,n,t),n},ni=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),na=e=>0==(e-=5120)?y:1==e?g:2==e?w:4==e?S:6==e?A:5==e||28922==e||28520==e||30779==e||30782==e?F:_;es=Array(4096),eM(en,"/"),eC("/tmp"),eC("/home"),eC("/home/web_user"),eC("/dev"),eI(259,{read:()=>0,write:(e,t,n,r)=>r,bd:()=>0}),ex("/dev/null",259),ee(1280,{oe(){e:{if(!q.length){var e=null;if(globalThis.window?.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n"),!e){var t=null;break e}t=Array(J(e)+1),e=Q(e,t,0,t.length),t.length=e,q=t}t=q.shift()}return t},ee(e,t){null===t||10===t?(C(K(e.output)),e.output=[]):0!=t&&e.output.push(t)},Hd(e){0<e.output?.length&&(C(K(e.output)),e.output=[])},ff:()=>({Ef:25856,Gf:5,Df:191,Ff:35387,Cf:[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]}),gf:()=>0,hf:()=>[24,80]}),ee(1536,{ee(e,t){null===t||10===t?(x(K(e.output)),e.output=[]):0!=t&&e.output.push(t)},Hd(e){0<e.output?.length&&(x(K(e.output)),e.output=[])}}),ex("/dev/tty",1280),ex("/dev/tty1",1536),no=new Uint8Array(1024),ns=0,eL("random",nc=()=>(0===ns&&($(no),ns=no.byteLength),no[--ns])),eL("urandom",nc),eC("/dev/shm"),eC("/dev/shm/tmp"),eC("/proc"),nl=eC("/proc/self"),eC("/proc/self/fd"),eM({jd(){var e=eb(nl,"fd",16895,73);return e.Hc={bd:en.Hc.bd},e.Jc={zd(e,t){var n=e_(e=+t);return(e={parent:null,jd:{se:"fake"},Jc:{Ad:()=>n.path},id:e+1}).parent=e},ge:()=>Array.from(ea.entries()).filter(([,e])=>e).map(([e])=>e.toString())},e}},"/proc/self/fd"),Object.assign(t=e7.prototype,{isAliasOf:function(e){if(!(this instanceof e7&&e instanceof e7))return!1;var t=this.Fc.Nc.Gc,n=this.Fc.Lc;e.Fc=e.Fc;var r=e.Fc.Nc.Gc;for(e=e.Fc.Lc;t.Rc;)n=t.Cd(n),t=t.Rc;for(;r.Rc;)e=r.Cd(e),r=r.Rc;return t===r&&n===e},clone:function(){if(this.Fc.Lc||e8(this),this.Fc.wd)return this.Fc.count.value+=1,this;var e=eJ,t=Object,n=t.create,r=Object.getPrototypeOf(this),i=this.Fc;return e=e(n.call(t,r,{Fc:{value:{count:i.count,yd:i.yd,wd:i.wd,Lc:i.Lc,Nc:i.Nc,Sc:i.Sc,Yc:i.Yc}}})),e.Fc.count.value+=1,e.Fc.yd=!1,e},delete(){if(this.Fc.Lc||e8(this),this.Fc.yd&&!this.Fc.wd)throw new eV("Object already scheduled for deletion");eK(this);var e=this.Fc;--e.count.value,0===e.count.value&&(e.Sc?e.Yc.dd(e.Sc):e.Nc.Gc.dd(e.Lc)),this.Fc.wd||(this.Fc.Sc=void 0,this.Fc.Lc=void 0)},isDeleted:function(){return!this.Fc.Lc},deleteLater:function(){if(this.Fc.Lc||e8(this),this.Fc.yd&&!this.Fc.wd)throw new eV("Object already scheduled for deleti
1on");return e9.push(this),this.Fc.yd=!0,this}}),(n=Symbol.dispose)&&(t[n]=t.delete),Object.assign(td.prototype,{Ze(e){return this.ye&&(e=this.ye(e)),e},le(e){this.dd?.(e)},Wc:e0,Kc:function(e){function t(){return this.Kd?tu(this.Gc.ad,{Nc:this.nf,Lc:n,Yc:this,Sc:e}):tu(this.Gc.ad,{Nc:this,Lc:e})}var n=this.Ze(e);if(!n)return this.le(e),null;var r=eH[ez(this.Gc,n)];if(void 0!==r)return 0===r.Fc.count.value?(r.Fc.Lc=n,r.Fc.Sc=e,r.clone()):(r=r.clone(),this.le(e),r);if(!(r=te[r=this.Gc.Ye(n)]))return t.call(this);r=this.Jd?r.Pe:r.pointerType;var i=tl(n,this.Gc,r.Gc);return null===i?t.call(this):this.Kd?tu(r.Gc.ad,{Nc:r,Lc:i,Yc:this,Sc:e}):tu(r.Gc.ad,{Nc:r,Lc:i})}});for(let e=0;32>e;++e)ne.push(Array(e));if(e.print&&(C=e.print),e.printErr&&(x=e.printErr),e.wasmBinary&&(m=e.wasmBinary),e.thisProgram&&(d=e.thisProgram),e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.shift()();var no,ns,nc,nl,nu,nd,nh,nf,np,nm,nv,nb,ny,ng,nw,n_={342006:(e,t,n,r,i)=>{if("u"<typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.miniaudio){window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=n,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=r,window.miniaudio.device_state.started=i;let a=window.miniaudio;a.devices=[],a.track_device=function(e){for(var t=0;t<a.devices.length;++t)if(null==a.devices[t])return a.devices[t]=e,t;return a.devices.push(e),a.devices.length-1},a.untrack_device_by_index=function(e){for(a.devices[e]=null;0<a.devices.length;)if(null==a.devices[a.devices.length-1])a.devices.pop();else break},a.untrack_device=function(e){for(var t=0;t<a.devices.length;++t)if(a.devices[t]==e)return a.untrack_device_by_index(t)},a.get_device_by_index=function(e){return a.devices[e]},a.unlock_event_types=["touchend","click"],a.unlock=function(){for(var e=0;e<a.devices.length;++e){var t=a.devices[e];null!=t&&null!=t.Zc&&t.state===a.device_state.started&&t.Zc.resume().then(()=>{nf(t.ve)},e=>{console.error("Failed to resume audiocontext",e)})}a.unlock_event_types.map(function(e){document.removeEventListener(e,a.unlock,!0)})},a.unlock_event_types.map(function(e){document.addEventListener(e,a.unlock,!0)})}return window.miniaudio.referenceCount+=1,1},344184:()=>{void 0!==window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(e){document.removeEventListener(e,window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},344488:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,344592:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},344763:(e,t,n,r,i,a)=>{if(void 0===window.miniaudio)return -1;var o={},s={};return e==window.miniaudio.device_type.playback&&0!=n&&(s.sampleRate=n),o.Zc=new(window.AudioContext||window.webkitAudioContext)(s),o.Zc.suspend(),o.state=window.miniaudio.device_state.stopped,n=0,e!=window.miniaudio.device_type.playback&&(n=t),o.od=o.Zc.createScriptProcessor(r,n,t),o.od.onaudioprocess=function(n){if((null==o.Id||0==o.Id.length)&&(o.Id=new Float32Array(A.buffer,i,r*t)),e==window.miniaudio.device_type.capture||e==window.miniaudio.device_type.duplex){for(var s=0;s<t;s+=1)for(var c=n.inputBuffer.getChannelData(s),l=o.Id,u=0;u<r;u+=1)l[u*t+s]=c[u];np(a,r,i)}if(e==window.miniaudio.device_type.playback||e==window.miniaudio.device_type.duplex)for(nm(a,r,i),s=0;s<n.outputBuffer.numberOfChannels;++s)for(c=n.outputBuffer.getChannelData(s),l=o.Id,u=0;u<r;u+=1)c[u]=l[u*t+s];else for(s=0;s<n.outputBuffer.numberOfChannels;++s)n.outputBuffer.getChannelData(s).fill(0)},e!=window.miniaudio.device_type.capture&&e!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(e){o.Sd=o.Zc.createMediaStreamSource(e),o.Sd.connect(o.od),o.od.connect(o.Zc.destination)}).catch(function(e){console.log("Failed to get user media: "+e)}),e==window.miniaudio.device_type.playback&&o.od.connect(o.Zc.destination),o.ve=a,window.miniaudio.track_device(o)},347640:e=>window.miniaudio.get_device_by_index(e).Zc.sampleRate,347713:e=>{void 0!==(e=window.miniaudio.get_device_by_index(e)).od&&(e.od.onaudioprocess=function(){},e.od.disconnect(),e.od=void 0),void 0!==e.Sd&&(e.Sd.disconnect(),e.Sd=void 0),e.Zc.close(),e.Zc=void 0,e.ve=void 0},348113:e=>{window.miniaudio.untrack_device_by_index(e)}
1,348163:e=>{(e=window.miniaudio.get_device_by_index(e)).Zc.resume(),e.state=window.miniaudio.device_state.started},348302:e=>{(e=window.miniaudio.get_device_by_index(e)).Zc.suspend(),e.state=window.miniaudio.device_state.stopped}},nS={Pa:function(e,t,n){eO=n;try{var r=e_(e);switch(t){case 0:var i=W();if(0>i)break;for(;ea[i];)i++;return function(e,t=-1){return e=eS(e,t),e.Hc?.Kf?.(e),e}(r,i).md;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:return i=W(),r.flags|=i,0;case 12:return w[(i=W())+0>>1]=2,0}return -28}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return-e.ld}},Jb:function(e,t,n){eO=n;try{var r=e_(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.Mc?0:-59;case 21505:if(!r.Mc)return -59;if(r.Mc.kd.ff){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=W();S[i>>2]=25856,S[i+4>>2]=5,S[i+8>>2]=191,S[i+12>>2]=35387;for(var a=0;32>a;a++)y[i+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!r.Mc)return -59;if(r.Mc.kd.gf)for(i=W(),e=[],a=0;32>a;a++)e.push(y[i+a+17]);return 0;case 21519:if(!r.Mc)return -59;return S[(i=W())>>2]=0;case 21520:return r.Mc?-28:-59;case 21537:case 21531:if(i=W(),!r.Hc.ef)throw new ed(59);return r.Hc.ef(r,t,i);case 21523:if(!r.Mc)return -59;return r.Mc.kd.hf&&(a=[24,80],w[(i=W())>>1]=a[0],w[i+2>>1]=a[1]),0;default:return -28}}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return-e.ld}},Kb:function(e,t,n,r){eO=r;try{var i=t=t?K(g,t):"";if("/"===i.charAt(0))t=i;else{var a=-100===e?"/":e_(e).path;if(0==i.length)throw new ed(44);t=a+"/"+i}var o=r?W():0;return eP(t,n,o).md}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return-e.ld}},Nb:()=>T(""),Ma:(e,t,n)=>{e=eG(e),t=eY(t,"wrapper"),n=eU(n);var r=t.Gc,i=r.ad,a=r.Rc.ad,o=r.Rc.constructor;return e=eB(e,function(...e){for(var t of r.Rc.we)if(this[t]===a[t])throw new eW(`Pure virtual function ${t} must be implemented in JavaScript`);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),eK(e);var t=e.Fc;if(e.notifyOnDestruction(),t.wd=!0,Object.defineProperties(this,{Fc:{value:t}}),eJ(this),e=ez(r,e=t.Lc),eH.hasOwnProperty(e))throw new eV(`Tried to register registered instance: ${e}`);eH[e]=this},i.__destruct=function(){if(this===i)throw new eV("Pass correct 'this' to __destruct");eK(this);var e=this.Fc.Lc;if(e=ez(r,e),eH.hasOwnProperty(e))delete eH[e];else throw new eV(`Tried to unregister unregistered instance: ${e}`)},e.prototype=Object.create(i),Object.assign(e.prototype,n),ej(e)},bc:e=>{var t=eQ[e];delete eQ[e];var n=t.fe,r=t.dd,i=t.ne;e3([e],i.map(e=>e.bf).concat(i.map(e=>e.rf)),e=>{var a,o,s={};for([a,o]of i.entries()){let t=e[a],n=o.$e,r=o.af,c=e[a+i.length],l=o.qf,u=o.sf;s[o.We]={read:e=>t.Kc(n(r,e)),write:(e,t)=>{var n=[];l(u,e,c.Oc(n,t)),eZ(n)},optional:t.optional}}return[{name:t.name,Kc:e=>{var t,n={};for(t in s)n[t]=s[t].read(e);return r(e),n},Oc:(e,t)=>{for(var i in s)if(!(i in t||s[i].optional))throw TypeError(`Missing field: "${i}"`);var a=n();for(i in s)s[i].write(a,t[i]);return null!==e&&e.push(r,a),a},Wc:e0,Vc:r}]})},Ja:(e,t,n,r,i)=>{t=eG(t);let a=e=>e;if(r=0n===r){let e=8*n;i=(a=t=>BigInt.asUintN(e,t))(i)}e6(e,{name:t,Kc:a,Oc:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),Wc:e5(t,n,!r),Vc:null})},qb:(e,t,n,r)=>{e6(e,{name:t=eG(t),Kc:function(e){return!!e},Oc:function(e,t){return t?n:r},Wc:function(e){return this.Kc(g[e])},Vc:null})},c:(e,t,n,r,i,a,o,s,c,l,u,d,h)=>{u=eG(u),a=tf(i,a),s&&=tf(o,s),l&&=tf(c,l),h=tf(d,h);var f,p,m=48<=(p=(f=(f=u).replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0))&&57>=p?`_${f}`:f;tn(m,function(){tm(`Cannot construct ${u} due to unbound types`,[r])}),e3([e,t,n],r?[r]:[],t=>{if(t=t[0],r)var n,i=t.Gc,o=i.ad;else o=e7.prototype;var c=Object.create(o,{constructor:{value:t=eB(u,function(...e){if(Object.getPrototypeOf(this)!==c)throw new eV(`Use 'new' to construct ${u}`);if(void 0===d.rd)throw new eV(`${u} has no accessible constructor`);var t=d.rd[e.length];if(void 0===t)throw new eV(`Tried to invoke ctor of ${u}
1 with invalid number of parameters (${e.length}) - expected (${Object.keys(d.rd).toString()}) parameters instead!`);return t.apply(this,e)})}});t.prototype=c;var d=new tr(u,t,c,h,i,a,s,l);return d.Rc&&((n=d.Rc).Ed??(n.Ed=[]),d.Rc.Ed.push(d)),i=new td(u,d,!0,!1,!1),n=new td(u+"*",d,!1,!1,!1),o=new td(u+" const*",d,!1,!0,!1),te[e]={pointerType:n,Pe:o},th(m,t),[i,n,o]})},da:(e,t,n,r,i,a,o)=>{var s=tS(n,r);t=tF(t=eG(t)),a=tf(i,a),e3([],[e],e=>{function r(){tm(`Cannot call ${i} due to unbound types`,s)}e=e[0];var i=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var c=e.Gc.constructor;return void 0===c[t]?(r.hd=n-1,c[t]=r):(tt(c,t,i),c[t].Pc[n-1]=r),e3([],s,r=>{if(r=tv(i,[r[0],null].concat(r.slice(1)),null,a,o),void 0===c[t].Pc?(r.hd=n-1,c[t]=r):c[t].Pc[n-1]=r,e.Gc.Ed)for(let n of e.Gc.Ed)n.constructor.hasOwnProperty(t)||(n.constructor[t]=r);return[]}),[]})},ya:(e,t,n,r,i,a,o,s)=>{t=eG(t),a=tf(i,a),e3([],[e],e=>{e=e[0];var i=`${e.name}.${t}`,c={get(){tm(`Cannot access ${i} due to unbound types`,[n])},enumerable:!0,configurable:!0};return c.set=s?()=>{tm(`Cannot access ${i} due to unbound types`,[n])}:()=>{throw new eV(`${i} is a read-only property`)},Object.defineProperty(e.Gc.constructor,t,c),e3([],[n],n=>{n=n[0];var i={get:()=>n.Kc(a(r)),enumerable:!0};return s&&(s=tf(o,s),i.set=e=>{var t=[];s(r,n.Oc(t,e)),eZ(t)}),Object.defineProperty(e.Gc.constructor,t,i),[]}),[]})},U:(e,t,n,r,i,a)=>{var o=tS(t,n);i=tf(r,i),e3([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(void 0===e.Gc.rd&&(e.Gc.rd=[]),void 0!==e.Gc.rd[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.Gc.rd[t-1]=()=>{tm(`Cannot construct ${e.name} due to unbound types`,o)},e3([],o,r=>(r.splice(1,0,null),e.Gc.rd[t-1]=tv(n,r,null,i,a),[])),[]})},a:(e,t,n,r,i,a,o,s)=>{var c=tS(n,r);t=tF(t=eG(t)),a=tf(i,a),e3([],[e],e=>{function r(){tm(`Cannot call ${i} due to unbound types`,c)}e=e[0];var i=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.Gc.we.push(t);var l=e.Gc.ad,u=l[t];return void 0===u||void 0===u.Pc&&u.className!==e.name&&u.hd===n-2?(r.hd=n-2,r.className=e.name,l[t]=r):(tt(l,t,i),l[t].Pc[n-2]=r),e3([],c,r=>(r=tv(i,r,e,a,o),void 0===l[t].Pc?(r.hd=n-2,l[t]=r):l[t].Pc[n-2]=r,[])),[]})},b:(e,t,n,r,i,a,o,s,c,l)=>{t=eG(t),i=tf(r,i),e3([],[e],e=>{e=e[0];var r=`${e.name}.${t}`,u={get(){tm(`Cannot access ${r} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return u.set=c?()=>tm(`Cannot access ${r} due to unbound types`,[n,o]):()=>{throw new eV(r+" is a read-only property")},Object.defineProperty(e.Gc.ad,t,u),e3([],c?[n,o]:[n],n=>{var o=n[0],u={get(){var t=tA(this,e,r+" getter");return o.Kc(i(a,t))},enumerable:!0};if(c){c=tf(s,c);var d=n[1];u.set=function(t){var n=tA(this,e,r+" setter"),i=[];c(l,n,d.Oc(i,t)),eZ(i)}}return Object.defineProperty(e.Gc.ad,t,u),[]}),[]})},nb:e=>e6(e,tM),Qa:(t,n,r,i,a)=>{switch(n=eG(n),a=0===a?"object":1===a?"number":"string"){case"object":function o(){}o.values={},e6(t,{name:n,constructor:o,valueType:a,Kc:function(e){return this.constructor.values[e]},Oc:(e,t)=>t.value,Wc:tE(n,r,i),Vc:null}),tn(n,o);break;case"number":var s={};e6(t,{name:n,de:s,valueType:a,Kc:e=>e,Oc:(e,t)=>t,Wc:tE(n,r,i),Vc:null}),tn(n,s),delete e[n].hd;break;case"string":e6(t,{name:n,Fe:{},Ae:{},de:s={},valueType:a,Kc:function(e){return this.Ae[e]},Oc:function(e,t){return this.Fe[t]},Wc:tE(n,r,i),Vc:null}),tn(n,s),delete e[n].hd}},r:(e,t,n)=>{var r=eY(e,"enum");switch(t=eG(t),r.valueType){case"object":e=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:eB(`${r.name}_${t}`,function(){})}}),e.values[n]=r,e[t]=r;break;case"number":r.de[t]=n;break;case"string":r.Fe[t]=n,r.Ae[n]=t,r.de[t]=t}},Ia:(e,t,n)=>{e6(e,{name:t=eG(t),Kc:e=>e,Oc:(e,t)=>t,Wc:((e,t)=>{switch(t){case 4:return function(e){return this.Kc(A[e>>2])};case 8:return function(e){return this.Kc(I[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}})(t,n),Vc:null})},l:(e,t,n,r,i,a)=>{var o=tS(t,n);e=tF(e=eG(e)),i=tf(r,i),tn(e,function(){tm(`Cannot call ${e} due to unbound types`,o)},t-1),e3([],o,n=>(th(e,tv(e,[n[0],null].concat(n.slice(1)),null,i,a),t-1),[]))},C:(e,t,n,r,i)=>{t=eG(t);let a=e=>e;if(0===r){var o=32-8*n;i=(a=e=>e<<o>>>o)(i)}e6(e,{name:t,Kc:a,Oc:(e,t)=>t,Wc:e5(t,n,0!==r),Vc:null})},k:(e,t,n)=>{function r(e){return new i(y.buffer,F[e+4>>2],F[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array
1][t];e6(e,{name:n=eG(n),Kc:r,Wc:r},{cf:!0})},ob:(e,t)=>{e6(e,{name:t=eG(t),Kc(e){var t=(t=e+4)?K(g,t,F[e>>2],!0):"";return nu(e),t},Oc(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;if(!(n||ArrayBuffer.isView(t)&&1==t.BYTES_PER_ELEMENT))throw new eV("Cannot pass non-string to std::string");var r=n?J(t):t.length,i=nd(4+r+1),a=i+4;return F[i>>2]=r,n?Q(t,g,a,r+1):g.set(t,a),null!==e&&e.push(nu,i),i},Wc:e0,Vc(e){nu(e)}})},sa:(e,t,n)=>{if(n=eG(n),2===t)var r=tx,i=tR,a=tP;else r=tk,i=tL,a=tT;e6(e,{name:n,Kc:e=>{var n=r(e+4,F[e>>2]*t,!0);return nu(e),n},Oc:(e,r)=>{if("string"!=typeof r)throw new eV(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=nd(4+o+t);return F[s>>2]=o/t,i(r,s+4,o+t),null!==e&&e.push(nu,s),s},Wc:e0,Vc(e){nu(e)}})},Fb:(e,t,n,r,i,a)=>{eQ[e]={name:eG(t),fe:tf(n,r),dd:tf(i,a),ne:[]}},yb:(e,t,n,r,i,a,o,s,c,l)=>{eQ[e].ne.push({We:eG(t),bf:n,$e:tf(r,i),af:a,rf:o,qf:tf(s,c),sf:l})},rb:(e,t)=>{e6(e,{jf:!0,name:t=eG(t),Kc:()=>{},Oc:()=>{}})},zb:()=>{throw 1/0},q:(e,t,n)=>{var r,i,[a,...o]=((e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=eY(F[t+4*r>>2],`parameter ${r}`);return n})(e,t),s=a.Oc.bind(a),c=o.map(e=>e.Wc.bind(e)),l=Array(--e);return r=eB(t=`methodCaller<(${o.map(e=>e.name)}) => ${a.name}>`,(t,r,i,a)=>{for(var o=0,u=0;u<e;++u)l[u]=c[u](a+o),o+=8;switch(n){case 0:var d=eU(t).apply(null,l);break;case 2:d=Reflect.construct(eU(t),l);break;case 3:d=l[0];break;case 1:d=eU(t)[tN(r)](...l)}return d=s(t=[],d),t.length&&(F[i>>2]=ej(t)),d}),i=tO.length,tO.push(r),i},xb:tI,pb:(e,t)=>
1ej((e=eU(e))[t=eU(t)]),Ha:e=>{9<e&&(eD[e+1]+=1)},p:(e,t,n,r,i)=>tO[e](t,n,r,i),ub:()=>ej([]),wb:e=>ej(tN(e)),nc:()=>ej({}),_a:e=>{eZ(eU(e)),tI(e)},w:(e,t,n)=>{e=eU(e),t=eU(t),n=eU(n),e[t]=n},Bb:function(e,t){e=new Date(1e3*(e=-0x20000000000000>e||0x20000000000000<e?NaN:Number(e))),S[t>>2]=e.getUTCSeconds(),S[t+4>>2]=e.getUTCMinutes(),S[t+8>>2]=e.getUTCHours(),S[t+12>>2]=e.getUTCDate(),S[t+16>>2]=e.getUTCMonth(),S[t+20>>2]=e.getUTCFullYear()-1900,S[t+24>>2]=e.getUTCDay(),S[t+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Cb:function(e,t){e=new Date(1e3*(e=-0x20000000000000>e||0x20000000000000<e?NaN:Number(e))),S[t>>2]=e.getSeconds(),S[t+4>>2]=e.getMinutes(),S[t+8>>2]=e.getHours(),S[t+12>>2]=e.getDate(),S[t+16>>2]=e.getMonth(),S[t+20>>2]=e.getFullYear()-1900,S[t+24>>2]=e.getDay();var n=e.getFullYear();S[t+28>>2]=(0!=n%4||0==n%100&&0!=n%400?tV:tD)[e.getMonth()]+e.getDate()-1|0,S[t+36>>2]=-(60*e.getTimezoneOffset()),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();S[t+32>>2]=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n))},Db:(e,t,n,r)=>{var i=(new Date).getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset(),F[e>>2]=60*Math.max(a,i),S[t>>2]=Number(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?"-":"+"}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`})(a),t=t(i),i<a?(Q(e,g,n,17),Q(t,g,r,17)):(Q(e,g,r,17),Q(t,g,n,17))},bb:function(e,t,n){(e=tQ[e].Tc.Qd)&&e.beginPixelLocalStorageWEBGL(new Uint32Array(ng.buffer,4*n,t))},Mb:function(e,t,n){return 0<=e&&3>=e?(M[n>>3]=BigInt(Math.round(1e6*(0===e?Date.now():performance.now()))),0):28},tb: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)}},sb:function(t){var n=e.images;n&&n.get(t)&&n.delete(t)},y:(e,t,n)=>{tU.length=0;for(var r;r=g[t++];){var i=105!=r;i&=112!=r,n+=i&&n%8?4:0,tU.push(112==r?F[n>>2]:106==r?M[n>>3]:105==r?S[n>>2]:I[n>>3]),n+=i?8:4}return n_[e](...tU)},Lb:()=>Date.now(),jb:()=>performance.now(),Ab:e=>{var t=g.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);e:{r=(Math.min(0x80000000,65536*Math.ceil(Math.max(e,r)/65536))-ng.buffer.byteLength+65535)/65536|0;try{ng.grow(r),L();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},t:(e,t)=>(e=tQ[e],(t=t?K(g,t):"").startsWith("GL_")&&(t=t.slice(3)),"WEBGL_draw_instanced_base_vertex_base_instance"==t&&tj(ty),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==t&&tW(ty),"WEBGL_multi_draw"==t&&(ty.lf=ty.getExtension("WEBGL_multi_draw")),"EXT_polygon_offset_clamp"==t&&(ty.Ve=ty.getExtension("EXT_polygon_offset_clamp")),"EXT_clip_control"==t&&(ty.Ue=ty.getExtension("EXT_clip_control")),"WEBGL_polygon_mode"==t&&(ty.vf=ty.getExtension("WEBGL_polygon_mode")),!!e.Tc.getExtension(t)),i:()=>tw?tw.handle:0,Ka:e=>t8(e)?0:-5,$a:function(e){return(e=tQ[e].Tc).xe=e.getExtension("WEBGL_provoking_vertex"),!!e.xe},eb:function(e){let t=(e=tQ[e].Tc).getExtension("WEBGL_shader_pixel_local_storage");if(t&&t.isCoherent()){if(5==t.framebufferTexturePixelLocalStorageWEBGL.length)return e.Qd=t,!0;console.warn("WEBGL_shader_pixel_local_storage is advertised, but a deprecated version has been detected. Disabling.")}return!1},ab:function(e,t,n){(e=tQ[e].Tc.Qd)&&e.endPixelLocalStorageWEBGL(new Uint32Array(ng.buffer,4*n,t))},Gb:(e,t)=>{var n,r=0,i=0;for(n of t7()){var a=t+r;F[e+i>>2]=a,r+=Q(n,g,a,1/0)+1,i+=4}return 0},Hb:(e,t)=>{var n=t7();for(var r of(F[e>>2]=n.length,e=0,n))e+=J(r)+1;return F[t>>2]=e,0},Na:function(e){try{var t=e_(e);if(null===t.md)throw new ed(8);t.be&&(t.be=null);try{t.Hc.close&&t.Hc.close(t)}catch(e){throw e}finally{ea[t.md]=null}return t.md=null,0}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return e.ld}},Ib:function(e,t,n,r){try{e:{var i=e_(e);e=t;for(var a,o=t=0;o<n;o++){var s=F[e>>2],c=F[e+4>>2];e+=8;var l=a,u=y;if(0>c||0>l)throw new ed(28);if(null===i.md||1==(2097155&i.flags))throw new ed(8);if(16384==(61440&i.node.mode))throw new ed(31);if(!i.Hc.read)throw new ed(28);var d=void 0!==l;if(d){if(!i.seekable)throw new ed(70)}else l=i.position;var h=i.Hc.read(i,u,s,c,l);if(d||(i.position+=h),0>h){var f=-1;break e}if(t+=h,h<c)break;void 0!==a&&(a+=h)}f=t}return F[r>>2]=f,0}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return e.ld}},Eb:function(e,t,n,r){t=-0x20000000000000>t||0x20000000000000<t?NaN:Number(t);try{if(isNaN(t))return 61;var i=e_(e);return ek(i,t,n),M[r>>3]=BigInt(i.position),i.be&&0===t&&0===n&&(i.be=null),0}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return e.ld}},Oa:function(e,t,n,r){try{e:{var i=e_(e);e=t;for(var a,o=t=0;o<n;o++){var s=F[e>>2],c=F[e+4>>2];e+=8;var l=a,u=y;if(0>c||0>l)throw new ed(28);if(null===i.md||0==(2097155&i.flags))throw new ed(8);if(16384==(61440&i.node.mode))throw new ed(31);if(!i.Hc.write)throw new ed(28);i.seekable&&1024&i.flags&&ek(i,0,2);var d=void 0!==l;if(d){if(!i.seekable)throw new ed(70)}else l=i.position;var h=i.Hc.write(i,u,s,c,l,void 0);if(d||(i.position+=h),0>h){var f=-1;break e}if(t+=h,h<c)break;void 0!==a&&(a+=h)}f=t}return F[r>>2]=f,0}catch(e){if(void 0===eT||"ErrnoError"!==e.name)throw e;return e.ld}},cb:function(e,t,n,r,i,a){(e=tQ[e].Tc.Qd)&&e.framebufferPixelLocalClearValuefvWEBGL(t,[n,r,i,a])},db:function(e,t,n,r,i,a){(e=tQ[e].Tc.Qd)&&e.framebufferTexturePixelLocalStorageWEBGL(t,tK[n],r,i,a)},f:e=>ty.activeTexture(e),E:(e,t)=>{ty.attachShader(t$[e],tq[t])},$b:(e,t,n)=>{ty.bindAttribLocation(t$[e],t,n?K(g,n):"")},m:(e,t)=>
1{35051==e?ty.Yd=t:35052==e&&(ty.ud=t),ty.bindBuffer(e,tz[t])},ta:(e,t,n,r,i)=>{ty.bindBufferRange(e,t,tz[n],r,i)},e:(e,t)=>{ty.bindFramebuffer(e,tX[t])},ha:(e,t)=>{ty.bindRenderbuffer(e,tY[t])},Aa:(e,t)=>{ty.bindSampler(e,tZ[t])},d:(e,t)=>{ty.bindTexture(e,tK[t])},Z:e=>{ty.bindVertexArray(tJ[e])},Ub:(e,t,n,r)=>ty.blendColor(e,t,n,r),j:e=>ty.blendEquation(e),Vb:(e,t)=>ty.blendEquationSeparate(e,t),ba:(e,t)=>ty.blendFunc(e,t),Wb:(e,t,n,r)=>ty.blendFuncSeparate(e,t,n,r),Y:(e,t,n,r,i,a,o,s,c,l)=>ty.blitFramebuffer(e,t,n,r,i,a,o,s,c,l),A:(e,t,n,r)=>{n&&t?ty.bufferData(e,g,r,n,t):ty.bufferData(e,t,r)},ia:(e,t,n,r)=>{n&&ty.bufferSubData(e,t,g,r,n)},Ob:e=>ty.clear(e),Zb:(e,t,n,r)=>ty.clearBufferfi(e,t,n,r),ua:(e,t,n)=>{ty.clearBufferfv(e,t,A,n>>2)},Yb:(e,t,n)=>{ty.clearBufferiv(e,t,S,n>>2)},Qb:(e,t,n)=>{ty.clearBufferuiv(e,t,F,n>>2)},Pb:(e,t,n,r)=>ty.clearColor(e,t,n,r),ib:e=>ty.clearDepth(e),hb:e=>ty.clearStencil(e),aa:(e,t,n,r)=>{ty.colorMask(!!e,!!t,!!n,!!r)},ma:e=>{ty.compileShader(tq[e])},za:(e,t,n,r,i,a,o,s,c)=>{ty.ud||!s?ty.compressedTexSubImage2D(e,t,n,r,i,a,o,s,c):ty.compressedTexSubImage2D(e,t,n,r,i,a,o,g,c,s)},hc:(e,t,n,r,i,a,o,s,c,l,u)=>{ty.ud?ty.compressedTexSubImage3D(e,t,n,r,i,a,o,s,c,l,u):ty.compressedTexSubImage3D(e,t,n,r,i,a,o,s,c,g,u,l)},O:()=>{var e=t3(t$),t=ty.createProgram();return t.name=e,t.Nd=t.Ld=t.Md=0,t.he=1,t$[e]=t,e},oa:e=>{var t=t3(tq);return tq[t]=ty.createShader(e),t},Da:e=>ty.cullFace(e),pa:(e,t)=>{for(var n=0;n<e;n++){var r=S[t+4*n>>2],i=tz[r];i&&(ty.deleteBuffer(i),i.name=0,tz[r]=null,r==ty.Yd&&(ty.Yd=0),r==ty.ud&&(ty.ud=0))}},G:(e,t)=>{for(var n=0;n<e;++n){var r=S[t+4*n>>2],i=tX[r];i&&(ty.deleteFramebuffer(i),i.name=0,tX[r]=null)}},ra:e=>{if(e){var t=t$[e];t?(ty.deleteProgram(t),t.name=0,t$[e]=null):tg||=1281}},Ca:(e,t)=>{for(var n=0;n<e;n++){var r=S[t+4*n>>2],i=tY[r];i&&(ty.deleteRenderbuffer(i),i.name=0,tY[r]=null)}},dc:(e,t)=>{for(var n=0;n<e;n++){var r=S[t+4*n>>2],i=tZ[r];i&&(ty.deleteSampler(i),i.name=0,tZ[r]=null)}},S:e=>{if(e){var t=tq[e];t?(ty.deleteShader(t),tq[e]=null):tg||=1281}},B:(e,t)=>{for(var n=0;n<e;n++){var r=S[t+4*n>>2],i=tK[r];i&&(ty.deleteTexture(i),i.name=0,tK[r]=null)}},qa:(e,t)=>{for(var n=0;n<e;n++){var r=S[t+4*n>>2];ty.deleteVertexArray(tJ[r]),tJ[r]=null}},Fa:e=>ty.depthFunc(e),K:e=>{ty.depthMask(!!e)},Ga:(e,t)=>ty.depthRange(e,t),g:e=>ty.disable(e),Sb:e=>{ty.disableVertexAttribArray(e)},M:(e,t,n)=>{ty.drawArrays(e,t,n)},Ta:(e,t,n,r)=>{ty.drawArraysInstanced(e,t,n,r)},fa:(e,t)=>{for(var n=ne[e],r=0;r<e;r++)n[r]=S[t+4*r>>2];ty.drawBuffers(n)},Tb:(e,t,n,r)=>{ty.drawElements(e,t,n,r)},V:(e,t,n,r,i)=>{ty.drawElementsInstanced(e,t,n,r,i)},u:e=>ty.enable(e),x:e=>{ty.enableVertexAttribArray(e)},mc:()=>ty.finish(),Sa:()=>ty.flush(),ea:(e,t,n,r)=>{ty.framebufferRenderbuffer(e,t,n,tY[r])},n:(e,t,n,r,i)=>{ty.framebufferTexture2D(e,t,n,tK[r],i)},_b:(e,t,n,r,i)=>{ty.framebufferTextureLayer(e,t,tK[n],r,i)},ca:e=>ty.frontFace(e),ja:(e,t)=>{t6(e,t,"createBuffer",tz)},I:(e,t)=>{t6(e,t,"createFramebuffer",tX)},Wa:(e,t)=>{t6(e,t,"createRenderbuffer",tY)},fc:(e,t)=>{t6(e,t,"createSampler",tZ)},D:(e,t)=>{t6(e,t,"createTexture",tK)},Ba:(e,t)=>{t6(e,t,"createVertexArray",tJ)},La:e=>ty.generateMipmap(e),ec:(e,t)=>nn(e,t,2),h:(e,t)=>nn(e,t,0),ac:(e,t,n,r)=>{null===(e=ty.getProgramInfoLog(t$[e]))&&(e="(unknown error)"),t=0<t&&r?Q(e,g,r,t):0,n&&(S[n>>2]=t)},ga:(e,t,n)=>{if(n)if(e>=tH)tg||=1281;else if(e=t$[e],35716==t)null===(e=ty.getProgramInfoLog(e))&&(e="(unknown error)"),S[n>>2]=e.length+1;else if(35719==t){if(!e.Nd){var r=ty.getProgramParameter(e,35718);for(t=0;t<r;++t)e.Nd=Math.max(e.Nd,ty.getActiveUniform(e,t).name.length+1)}S[n>>2]=e.Nd}else if(35722==t){if(!e.Ld)for(r=ty.getProgramParameter(e,35721),t=0;t<r;++t)e.Ld=Math.max(e.Ld,ty.getActiveAttrib(e,t).name.length+1);S[n>>2]=e.Ld}else if(35381==t){if(!e.Md)for(r=ty.getProgramParameter(e,35382),t=0;t<r;++t)e.Md=Math.max(e.Md,ty.getActiveUniformBlockName(e,t).length+1);S[n>>2]=e.Md}else S[n>>2]=ty.getProgramParameter(e,t);else tg||=1281},cc:(e,t,n,r)=>{null===(e=ty.getShaderInfoLog(tq[e]))&&(e="(unknown error)"),t=0<t&&r?Q(e,g,r,t):0,n&&(S[n>>2]=t)},Va:(e,t,n)=>{n?35716==t?(null===(e=ty.getShaderInfoLog(tq[e]))&&(e="(unknown error)"),S[n>>2]=e?e.length+1:0):35720==t?(e=ty.getShaderSource(tq[e]),S[n>>2]=e?e.length+1:0):S[n>>2]=ty.getShaderParameter(tq[e],t):tg||=1281},Ra:e=>
1{var t=t0[e];if(!t){switch(e){case 7939:t=nr(nt().join(" "));break;case 7936:case 7937:case 37445:case 37446:(t=ty.getParameter(e))||(tg||=1280),t=t?nr(t):0;break;case 7938:t=nr(`OpenGL ES 3.0 (${ty.getParameter(7938)})`);break;case 35724:var n=(t=ty.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=nr(t);break;default:tg||=1280}t0[e]=t}return t},lc:(e,t)=>{if(2>tw.version)return tg||=1282,0;var n=t1[e];return n?0>t||t>=n.length?(tg||=1281,0):n[t]:7939===e?(n=nt().map(nr),n=t1[e]=n,0>t||t>=n.length?(tg||=1281,0):n[t]):(tg||=1280,0)},R:(e,t)=>ty.getUniformBlockIndex(t$[e],t?K(g,t):""),X:(e,t)=>{if(t=t?K(g,t):"",e=t$[e]){var n,r=e,i=r.Bd,a=r.De;if(!i){r.Bd=i={},r.Ce={};var o=ty.getProgramParameter(r,35718);for(n=0;n<o;++n){var s=ty.getActiveUniform(r,n),c=s.name;s=s.size;var l=ni(c);l=0<l?c.slice(0,l):c;var u=r.he;for(r.he+=s,a[l]=[s,u],c=0;c<s;++c)i[u]=c,r.Ce[u++]=l}}if(r=e.Bd,i=0,a=t,0<(n=ni(t))&&(i=parseInt(t.slice(n+1))>>>0,a=t.slice(0,n)),(a=e.De[a])&&i<a[0]&&(r[i+=a[1]]=r[i]||ty.getUniformLocation(e,t)))return i}else tg||=1281;return -1},L:(e,t,n)=>{for(var r=ne[t],i=0;i<t;i++)r[i]=S[n+4*i>>2];ty.invalidateFramebuffer(e,r)},Xa:e=>(e=tz[e])?ty.isBuffer(e):0,ic:e=>(e=tX[e])?ty.isFramebuffer(e):0,kc:e=>(e=t$[e])?ty.isProgram(e):0,jc:e=>(e=tJ[e])?ty.isVertexArray(e):0,la:e=>{e=t$[e],ty.linkProgram(e),e.Bd=0,e.De={}},v:(e,t)=>
1{3317==e?t2=t:3314==e&&(t4=t),ty.pixelStorei(e,t)},Xb:(e,t)=>ty.polygonOffset(e,t),Ya:e=>ty.readBuffer(e),Rb:(e,t,n,r,i,a,o)=>{if(ty.Yd)ty.readPixels(e,t,n,r,i,a,o);else{var s=na(a);o>>>=31-Math.clz32(s.BYTES_PER_ELEMENT),ty.readPixels(e,t,n,r,i,a,s,o)}},xa:(e,t,n,r,i)=>ty.renderbufferStorageMultisample(e,t,n,r,i),va:(e,t,n)=>{ty.samplerParameterf(tZ[e],t,n)},H:(e,t,n)=>{ty.samplerParameteri(tZ[e],t,n)},Ea:(e,t,n,r)=>ty.scissor(e,t,n,r),na:(e,t,n,r)=>{for(var i="",a=0;a<t;++a){var o=(o=F[n+4*a>>2])?K(g,o,r?F[r+4*a>>2]:void 0):"";i+=o}ty.shaderSource(tq[e],i)},gb:(e,t,n)=>ty.stencilFunc(e,t,n),J:(e,t,n,r)=>ty.stencilFuncSeparate(e,t,n,r),$:e=>ty.stencilMask(e),Ua:(e,t)=>ty.stencilMaskSeparate(e,t),fb:(e,t,n)=>ty.stencilOp(e,t,n),_:(e,t,n,r)=>ty.stencilOpSeparate(e,t,n,r),s:(e,t,n)=>ty.texParameteri(e,t,n),o:(e,t,n,r,i)=>ty.texStorage2D(e,t,n,r,i),wa:(e,t,n,r,i,a)=>ty.texStorage3D(e,t,n,r,i,a),F:(e,t,n,r,i,a,o,s,c)=>{if(ty.ud)ty.texSubImage2D(e,t,n,r,i,a,o,s,c);else if(c){var l=na(s);ty.texSubImage2D(e,t,n,r,i,a,o,s,l,c>>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else{if(c){l=na(s);var u=a*((t4||i)*(({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4})[o-6402]||1)*l.BYTES_PER_ELEMENT+t2-1&-t2);c=l.subarray(c>>>31-Math.clz32(l.BYTES_PER_ELEMENT),c+u>>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else c=null;ty.texSubImage2D(e,t,n,r,i,a,o,s,c)}},gc:(e,t,n,r,i,a,o,s,c,l,u)=>{if(ty.ud)ty.texSubImage3D(e,t,n,r,i,a,o,s,c,l,u);else if(u){var d=na(l);ty.texSubImage3D(e,t,n,r,i,a,o,s,c,l,d,u>>>31-Math.clz32(d.BYTES_PER_ELEMENT))}else ty.texSubImage3D(e,t,n,r,i,a,o,s,c,l,null)},ka:(e,t)=>{var n=ty,r=n.uniform1i,i=ty.Qe;if(i){var a=i.Bd[e];"number"==typeof a&&(i.Bd[e]=a=ty.getUniformLocation(i,i.Ce[e]+(0<a?`[${a}]`:""))),e=a}else tg||=1282,e=void 0;r.call(n,e,t)},Q:(e,t,n)=>{e=t$[e],ty.uniformBlockBinding(e,t,n)},T:e=>{e=t$[e],ty.useProgram(e),ty.Qe=e},P:(e,t)=>{ty.vertexAttribDivisor(e,t)},W:(e,t,n,r,i)=>{ty.vertexAttribIPointer(e,t,n,r,i)},z:(e,t,n,r,i,a)=>{ty.vertexAttribPointer(e,t,n,!!r,i,a)},N:(e,t,n,r)=>ty.viewport(e,t,n,r),kb:function(e,t,n){var r=ny();try{nw.get(e)(t,n)}catch(e){if(nb(r),e!==e+0)throw e;nv(1,0)}},lb:function(){return -1<navigator.platform.indexOf("Win")},Za:function(e,t){(e=tQ[e].Tc.xe)&&e.provokingVertexWEBGL(t)},vb:function(t,n){var r=e.images;r&&(n=r.get(n))&&((t=tQ[t].Tc).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))},mb:function(t,n,r){n=new Uint8Array(ng.buffer,n,r),(r=new Uint8Array(r)).set(n),createImageBitmap(new Blob([r])).then(function(n){var r=new OffscreenCanvas(n.width,n.height).getContext("2d");r.drawImage(n,0,0);var i=(r=r.getImageData(0,0,n.width,n.height)).data.length,a=e.Je(i);e.wf.set(r.data,a),e.yf(t,n.width,n.height,a,i)}).catch(function(n){n=n.message||"decode failed";var r=e.Of(n)+1,i=e.Je(r);e.Uf(n,i,r),e.zf(t,i),e.xf(i)})}};function nF(){if(e.calledRun=!0,!R){if(k=!0,!e.noFSInit&&!ec){var t,n;ec=!0,t??=e.stdin,n??=e.stdout,r??=e.stderr,t?eL("stdin",t):eR("/dev/tty","/dev/stdin"),n?eL("stdout",null,n):eR("/dev/tty","/dev/stdout"),r?eL("stderr",null,r):eR("/dev/tty1","/dev/stderr"),eP("/dev/stdin",0),eP("/dev/stdout",1),eP("/dev/stderr",1)}if(i.pc(),el=!1,v?.(e),e.onRuntimeInitialized?.(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var r=e.postRun.shift();V.push(r)}D(V)}}if(i=await async function(){function t(t){return nu=(t=i=t.exports).rc,nd=t.sc,e._setWebImage=t.tc,nh=t.uc,e._wasm_image_decode_complete=t.vc,e._wasm_image_decode_error=t.wc,nf=e._ma_device__on_notification_unlocked=t.xc,e._ma_malloc_emscripten=t.yc,e._ma_free_emscripten=t.zc,np=e._ma_device_process_pcm_frames_capture__webaudio=t.Ac,nm=e._ma_device_process_pcm_frames_playback__webaudio=t.Bc,nv=t.Cc,nb=t.Dc,ny=t.Ec,ng=t.oc,nw=t.qc,L(),i}var n={a:nS};return e.instantiateWasm?new Promise(r=>{e.instantiateWasm(n,(e,n)=>{r(t(e))})}):(tb??=e.locateFile?e.locateFile("webgl2_advanced.wasm",p):p+"webgl2_advanced.wasm",t((await N(n)).instance))}(),e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)j();return D(U),e.setStatus?(e.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>e.setStatus(""),1),nF()},1)):nF(),k?e:new Promise((e,t)=>
1{v=e,b=t})})},e=>{e.exports=JSON.parse('{"name":"@rive-app/webgl2","version":"2.42.0","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 <[email protected]> (https://rive.app)","Maxwell Talbot <[email protected]> (https://rive.app)","Arthur Vivian <[email protected]> (https://rive.app)","Umberto Sonnino <[email protected]> (https://rive.app)","Matthew Sullivan <[email protected]> (mailto:[email protected])","Chris Dalton <[email protected]> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(e,t,n)=>{n.r(t),n.d(t,{AccessibilityOverlay:()=>i.AccessibilityOverlay,CHECK_STATE_MASK:()=>a.CHECK_STATE_MASK,CHECK_STATE_OFFSET:()=>a.CHECK_STATE_OFFSET,SemanticActionType:()=>a.SemanticActionType,SemanticCheckState:()=>a.SemanticCheckState,SemanticMode:()=>a.SemanticMode,SemanticRole:()=>a.SemanticRole,SemanticState:()=>a.SemanticState,SemanticTrait:()=>a.SemanticTrait,SemanticTreeModel:()=>r.SemanticTreeModel,checkStateOf:()=>a.checkStateOf,hasState:()=>a.hasState,hasTrait:()=>a.hasTrait,roleName:()=>a.roleName,stateNames:()=>a.stateNames,traitNames:()=>a.traitNames});var r=n(7),i=n(9),a=n(8)},(e,t,n)=>{n.r(t),n.d(t,{SemanticTreeModel:()=>a});var r=n(8),i=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))},a=function(){function e(){this._nodesById=new Map,this._roots=[],this._semanticVersion=0,this._geometryVersion=0,this._geometryChangedIds=new Set,this._semanticChangedIds=new Set,this._debug=!1}return Object.defineProperty(e.prototype,"nodeCount",{get:function(){return this._nodesById.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"semanticVersion",{get:function(){return this._semanticVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryVersion",{get:function(){return this._geometryVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryChangedIds",{get:function(){return this._geometryChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"semanticChangedIds",{get:function(){return this._semanticChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roots",{get:function(){return this._roots},enumerable:!1,configurable:!0}),e.prototype.nodeById=function(e){return this._nodesById.get(e)},e.prototype.siblingIndexOf=function(e){var t=this._nodesById.get(e);if(!t)return -1;if(t.parentId<0)return this._roots.indexOf(e);var n=this._nodesById.get(t.parentId);return n?n.children.indexOf(e):-1},e.prototype.detach=function(e){var t=this._nodesById.get(e);if(t)if(t.parentId<0){var n=this._roots.indexOf(e);-1!==n&&this._roots.splice(n,1)}else{var r=this._nodesById.get(t.parentId);if(r){var n=r.children.indexOf(e);-1!==n&&r.children.splice(n,1)}}},e.prototype.attach=function(e,t,n){var r=this._nodesById.get(e);if(r)if(t<0){r.parentId=-1;var i,a,o=(i=n,a=this._roots.length,i<0?0:i>a?a:i);this._roots.splice(o,0,e)}else{var s=this._nodesById.get(t);if(s){r.parentId=t;var c,l,o=(c=n,l=s.children.length,c<0?0:c>l?l:c);s.children.splice(o,0,e)}else r.parentId=-1,this._roots.push(e)}},e.prototype.removeSubtree=function(e){var t=this._nodesById.get(e);if(t){for(var n=i([],t.children,!0),r=0;r<n.length;r++){var a=n[r];this.removeSubtree(a)}this.detach(e),this._nodesById.delete(e)}},e.prototype.applyDiff=function(e){var t,n,r=this;this._geometryChangedIds.clear(),this._semanticChangedIds.clear();for(var i=!1,a=!1,d=function(){i=!0},h=function(e){i=!0,r._semanticChangedIds.add(e)},f=function(e){a=!0,r._geometryChangedIds.add(e)},p=0,m=e.removed;p<m.length;p++){var v=m[p];this._nodesById.has(v)&&(this.removeSubtree(v),d())}for(var b=0,y=e.added;b<y.length;b++){var g,w=y[b],_=this._nodesById.get(w.id);
1_?(s(_,w)&&(l(_,w),h(w.id)),c(_,w)&&(u(_,w),f(w.id))):(this._nodesById.set(w.id,{id:(g=w).id,parentId:-1,role:g.role,label:g.label,value:g.value,hint:g.hint,stateFlags:g.stateFlags,traitFlags:g.traitFlags,headingLevel:g.headingLevel,minX:g.minX,minY:g.minY,maxX:g.maxX,maxY:g.maxY,children:[]}),h(w.id),f(w.id)),this.detach(w.id),this.attach(w.id,w.parentId,w.siblingIndex)}for(var S=0,F=e.moved;S<F.length;S++){var w=F[S],_=this._nodesById.get(w.id);if(_){var A=_.parentId!==w.parentId,I=this.siblingIndexOf(w.id);c(_,w)&&(u(_,w),f(w.id)),this.detach(w.id),this.attach(w.id,w.parentId,w.siblingIndex),(A||this.siblingIndexOf(w.id)!==I)&&d()}}for(var M=0,E=e.childrenUpdated;M<E.length;M++){var C=E[M];if(C.parentId<0){var x=C.childIds.filter(function(e){return r._nodesById.has(e)});if(!o(this._roots,x)){this._roots.length=0,(t=this._roots).push.apply(t,x);for(var R=0,P=this._roots;R<P.length;R++){var v=P[R],k=this._nodesById.get(v);k&&(k.parentId=-1)}d()}}else{var L=this._nodesById.get(C.parentId);if(!L)continue;var x=C.childIds.filter(function(e){return r._nodesById.has(e)});if(!o(L.children,x)){L.children.length=0,(n=L.children).push.apply(n,x);for(var T=0,O=L.children;T<O.length;T++){var v=O[T],k=this._nodesById.get(v);k&&(k.parentId=C.parentId)}d()}}}for(var B=0,N=e.updatedSemantic;B<N.length;B++){var w=N[B],_=this._nodesById.get(w.id);_&&s(_,w)&&(l(_,w),h(w.id))}for(var D=0,V=e.updatedGeometry;D<V.length;D++){var w=V[D],_=this._nodesById.get(w.id);_&&c(_,w)&&(u(_,w),f(w.id))}(i||a)&&(i&&this._semanticVersion++,a&&this._geometryVersion++,this._debug&&this.logDiff(e,i,a))},Object.defineProperty(e.prototype,"debug",{set:function(e){this._debug=e},enumerable:!1,configurable:!0}),e.prototype.logDiff=function(e,t,n){for(var i=["[rive:semantics] semantic v".concat(this._semanticVersion)+(n?" geometry v".concat(this._geometryVersion):"")+(t?"":" (geometry-only)")],a=0,o=e.removed;a<o.length;a++){var s=o[a];i.push(" - removed #".concat(s))}for(var c=0,l=e.added;c<l.length;c++){var u=l[c];i.push(" + added #".concat(u.id," ").concat((0,r.roleName)(u.role))+(u.label?' "'.concat(u.label,'"'):"")+" bounds:(".concat(u.minX.toFixed(1),",").concat(u.minY.toFixed(1),")-(").concat(u.maxX.toFixed(1),",").concat(u.maxY.toFixed(1),")")+" states=[".concat((0,r.stateNames)(u.stateFlags),"]")+" traits=[".concat((0,r.traitNames)(u.traitFlags),"]"))}for(var d=0,h=e.moved;d<h.length;d++){var u=h[d];i.push(" ~ moved #".concat(u.id," → parent=").concat(u.parentId," idx=").concat(u.siblingIndex)+" bounds:(".concat(u.minX.toFixed(1),",").concat(u.minY.toFixed(1),")-(").concat(u.maxX.toFixed(1),",").concat(u.maxY.toFixed(1),")"))}for(var f=0,p=e.childrenUpdated;f<p.length;f++){var m=p[f];i.push(" ↕ children of ".concat(m.parentId<0?"root":"#"+m.parentId,": [").concat(m.childIds.join(", "),"]"))}for(var v=0,b=e.updatedSemantic;v<b.length;v++){var u=b[v];i.push(" ✎ semantic #".concat(u.id," ").concat((0,r.roleName)(u.role))+(u.label?' "'.concat(u.label,'"'):"")+" states=[".concat((0,r.stateNames)(u.stateFlags),"]")+" traits=[".concat((0,r.traitNames)(u.traitFlags),"]"))}for(var y=0,g=e.updatedGeometry;y<g.length;y++){var u=g[y];i.push(" ⊞ geometry #".concat(u.id," (").concat(u.minX.toFixed(1),",").concat(u.minY.toFixed(1),")-(").concat(u.maxX.toFixed(1),",").concat(u.maxY.toFixed(1),")"))}console.log(i.join("\n"))},e.prototype.flattened=function(){for(var e=this,t=[],n=function(r,i){var a=e._nodesById.get(r);if(a){t.push({depth:i,node:a});for(var o=0,s=a.children;o<s.length;o++)n(s[o],i+1)}},r=0,i=this._roots;r<i.length;r++)n(i[r],0);return t},e}();function o(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function s(e,t){return e.role!==t.role||e.label!==t.label||e.value!==t.value||e.hint!==t.hint||e.stateFlags!==t.stateFlags||e.traitFlags!==t.traitFlags||e.headingLevel!==t.headingLevel}function c(e,t){return e.minX!==t.minX||e.minY!==t.minY||e.maxX!==t.maxX||e.maxY!==t.maxY}function l(e,t){e.role=t.role,e.label=t.label,e.value=t.value,e.hint=t.hint,e.stateFlags=t.stateFlags,e.traitFlags=t.traitFlags,e.headingLevel=t.headingLevel}function u(e,t){e.minX=t.minX,e.minY=t.minY,e.maxX=t.maxX,e.maxY=t.maxY}},(e,t,n)=>{n.r(t),n.d(t,{CHECK_STATE_MASK:()=>c,CHECK_STATE_OFFSET:()=>s,SemanticActionType:()=>f,SemanticCheckState:()=>o,SemanticMode:()=>u,SemanticRole:()=>r,SemanticState:()=>i,SemanticTrait:()=>d,checkStateOf:()=>l,hasState:()=>a,hasTrait:()=>h,roleName:()=>_,stateNames:()=>S,traitNames:()=>F});
1var r={none:0,button:1,link:2,checkbox:3,switchControl:4,slider:5,textField:6,text:7,image:8,group:9,list:10,listItem:11,tab:12,tabList:13,dialog:14,alertDialog:15,radioGroup:16,radioButton:17},i={None:0,Expanded:1,Selected:2,Toggled:16,Required:32,Disabled:64,Focused:128,Hidden:256,LiveRegion:512,ReadOnly:1024,Modal:2048,Obscured:4096,Multiline:8192};function a(e,t){return(e&t)!=0}var o={Unchecked:0,Checked:1,Mixed:2},s=2,c=12;function l(e){var t=(e&c)>>s;return t>=o.Mixed?o.Mixed:t}var u={Disabled:"disabled",Enabled:"enabled"},d={None:0,Expandable:1,Selectable:2,Checkable:4,Toggleable:8,Requirable:16,Enablable:32,Focusable:64};function h(e,t){return(e&t)!=0}for(var f={tap:0,increase:1,decrease:2},p={},m=0,v=Object.entries(r);m<v.length;m++){var b=v[m],y=b[0];p[b[1]]=y}var g=Object.entries(i).filter(function(e){return 0!==e[1]}),w=Object.entries(d).filter(function(e){return 0!==e[1]});function _(e){var t;return null!=(t=p[e])?t:"unknown(".concat(e,")")}function S(e){if(0===e)return"none";for(var t=[],n=0;n<g.length;n++){var r=g[n],i=r[0];e&r[1]&&t.push(i)}switch(l(e)){case o.Checked:t.push("Checked");break;case o.Mixed:t.push("Mixed")}return t.join(", ")||"none"}function F(e){if(0===e)return"none";for(var t=[],n=0;n<w.length;n++){var r=w[n],i=r[0];e&r[1]&&t.push(i)}return t.join(", ")||"none"}},(e,t,n)=>{n.r(t),n.d(t,{AccessibilityOverlay:()=>i});var r=n(8),i=function(){function e(e){var t,n=this;this.elements=new Map,this.descElements=new Map,this.lastSemanticVersion=-1,this.lastGeometryVersion=-1,this.pendingTextGeometry=[],this.textGeometryKeys=new WeakMap,this.lastCanvasPositioning={width:-1,height:-1,offsetTop:-1,offsetLeft:-1},this._geometryDirty=!0,this.isUpdating=!1,this.transformContainer=null,this._artboardBounds={minX:0,minY:0,maxX:0,maxY:0},this.repositionTimer=null,this.canvasResizeObserver=null,this.parentResizeObserver=null,this.positionObserver=null,this._onWindowResize=function(){return n.scheduleReposition()},this.instanceId=e.instanceId,this.fireAction=e.fireAction,this.requestFocus=e.requestFocus,this.clearFocus=e.clearFocus,this.canvas=e.canvas,this.semanticsOptions=e.semanticsOptions,this.allowFocusInterrupt=null!=(t=e.allowFocusInterrupt)&&t,this.container=this.createContainer(e.canvas),this.attachPositionObservers()}return e.prototype.getSemanticOverlayContainer=function(){return this.container},e.prototype.attachPositionObservers=function(){var e=this;this.canvasResizeObserver=new ResizeObserver(function(){return e.scheduleReposition()}),this.canvasResizeObserver.observe(this.canvas);var t=this.canvas.parentElement;t&&(this.parentResizeObserver=new ResizeObserver(function(){return e.scheduleReposition()}),this.parentResizeObserver.observe(t)),window.addEventListener("resize",this._onWindowResize),this.observePosition()},e.prototype.observePosition=function(){var e,t=this;if(!("u"<typeof IntersectionObserver)){null==(e=this.positionObserver)||e.disconnect(),this.positionObserver=null;var n=this.canvas.getBoundingClientRect();if(n.width&&n.height){var r=[n.top,window.innerWidth-n.right,window.innerHeight-n.bottom,n.left].map(function(e){return"".concat(-Math.round(e),"px")}).join(" "),i=!1;this.positionObserver=new IntersectionObserver(function(){if(!i){i=!0;return}t.scheduleReposition()},{threshold:1,rootMargin:r}),this.positionObserver.observe(this.canvas)}}},e.prototype.scheduleReposition=function(){var e=this;this._geometryDirty=!0,null===this.repositionTimer&&(this.repositionTimer=setTimeout(function(){e.repositionTimer=null,e.syncContainerGeometry(),e.observePosition()},500))},e.prototype.syncContainerGeometry=function(){var e=this.canvas.getBoundingClientRect(),t=this.canvas.offsetTop,n=this.canvas.offsetLeft;(e.width!==this.lastCanvasPositioning.width||e.height!==this.lastCanvasPositioning.height||t!==this.lastCanvasPositioning.offsetTop||n!==this.lastCanvasPositioning.offsetLeft)&&(this.container.style.top=t+"px",this.container.style.left=n+"px",this.container.style.width=e.width+"px",this.container.style.height=e.height+"px",this.container.tabIndex=-1,this.lastCanvasPositioning.width=e.width,this.lastCanvasPositioning.height=e.height,this.lastCanvasPositioning.offsetTop=t,this.lastCanvasPositioning.offsetLeft=n)},e.prototype.createContainer=function(e){var t,n,r=document.createElement("div");r.id="rive-a11y-".concat(this.instanceId),r.setAttribute("role","regi
1on"),r.setAttribute("aria-label",null!=(n=null==(t=this.semanticsOptions)?void 0:t.riveCanvasLabel)?n:"Rive animation");var i=e.getBoundingClientRect();return r.style.cssText=["position:absolute","top:".concat(e.offsetTop,"px"),"left:".concat(e.offsetLeft,"px"),"width:".concat(i.width,"px"),"height:".concat(i.height,"px"),"overflow:hidden;pointer-events:none;opacity:0"].join(";"),e.insertAdjacentElement("afterend",r),r},e.prototype.needsUpdate=function(e){var t=e.semanticVersion!==this.lastSemanticVersion,n=e.geometryVersion!==this.lastGeometryVersion,r=this._geometryDirty||!this.transformContainer;return t||n||r?{semanticChanged:t,nodeGeometryChanged:n,layoutChanged:r}:null},e.prototype.update=function(e,t,n,r,i){var a=null!=i?i:this.needsUpdate(e);!a&&t&&(a={semanticChanged:!1,nodeGeometryChanged:!1,layoutChanged:!0}),a&&this.performUpdate(e,t,n,r,a)},e.prototype.performUpdate=function(e,t,n,r,i){var a,o=i.semanticChanged,s=i.nodeGeometryChanged,c=e.semanticVersion-this.lastSemanticVersion>1;if(this.lastSemanticVersion=e.semanticVersion,this.lastGeometryVersion=e.geometryVersion,this.isUpdating=!0,this._artboardBounds=r,t&&(this.syncContainerGeometry(),this.syncTransformContainer(t,n,r),this._geometryDirty=!1),o){var l=null!=(a=this.transformContainer)?a:this.container,u=new Set;this.rebuildChildren(l,e.roots,e,0,0,u,c);var d=[];this.elements.forEach(function(e,t){u.has(t)||d.push(t)});for(var h=0;h<d.length;h++){var f=d[h],p=this.elements.get(f);p&&p.parentNode&&p.parentNode.removeChild(p),this.elements.delete(f);var m=this.descElements.get(f);m&&m.parentNode&&m.parentNode.removeChild(m),this.descElements.delete(f)}}else s&&this.updateGeometryForChangedNodes(e);this.flushTextGeometry(),this.isUpdating=!1},e.prototype.destroy=function(){var e,t,n;null!==this.repositionTimer&&(clearTimeout(this.repositionTimer),this.repositionTimer=null),window.removeEventListener("resize",this._onWindowResize),null==(e=this.canvasResizeObserver)||e.disconnect(),null==(t=this.parentResizeObserver)||t.disconnect(),null==(n=this.positionObserver)||n.disconnect(),this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.elements.clear(),this.descElements.clear(),this.pendingTextGeometry.length=0},e.prototype.rebuildChildren=function(e,t,n,i,a,o,s){for(var c=0;c<t.length;c++){var l=t[c],u=n.nodeById(l);if(u){o.add(l);var d=this.elements.get(l),h=!d;d||(d=this.createElement(u),this.elements.set(l,d)),(h||s||n.semanticChangedIds.has(l))&&this.applyAttributes(d,u),this.applyPosition(d,u,i,a);var f=e.children[c];if(f!==d&&(f?e.insertBefore(d,f):e.appendChild(d)),(0,r.hasTrait)(u.traitFlags,r.SemanticTrait.Focusable)&&(0,r.hasState)(u.stateFlags,r.SemanticState.Focused)){var p=document.activeElement,m=null==p?void 0:p.closest('[aria-modal="true"]'),v=!!m&&this.container.contains(m)&&!m.contains(d);p!==d&&!v&&this.canMoveFocus()&&d.focus()}u.children.length>0&&this.rebuildChildren(d,u.children,n,u.minX,u.minY,o,s),h&&this.autoFocusDialogOnAppear(d,u,n)}}},e.prototype.updateGeometryForChangedNodes=function(e){for(var t,n,r=0,i=Array.from(e.geometryChangedIds);r<i.length;r++){var a=i[r],o=e.nodeById(a);if(o){var s=0,c=0,l=null!=(t=this.transformContainer)?t:this.container;if(o.parentId>=0){var u=e.nodeById(o.parentId);u&&(s=u.minX,c=u.minY,l=null!=(n=this.elements.get(o.parentId))?n:l)}this.updateNodeGeometrySubtree(e,a,s,c,l)}}},e.prototype.updateNodeGeometrySubtree=function(e,t,n,r,i){var a=e.nodeById(t);if(a){var o=this.elements.get(t);if(o){this.applyPosition(o,a,n,r);for(var s=0,c=a.children;s<c.length;s++){var l=c[s];this.updateNodeGeometrySubtree(e,l,a.minX,a.minY,o)}}}},e.prototype.canMoveFocus=function(){var e=document.activeElement;return e===this.canvas||this.container.contains(e)||this.allowFocusInterrupt},e.prototype.autoFocusDialogOnAppear=function(e,t,n){if(y(t.role,t.stateFlags)&&this.canMoveFocus()){var r,i=document.activeElement;if(!(i&&i!==e&&e.contains(i))){var a=null!=(r=this.routeDefaultFocusTarget(t,n))?r:e;a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),document.activeElement!==a&&a.focus({preventScroll:!0})}}},e.prototype.routeDefaultFocusTarget=function(e,t){for(var n,i=0,a=e.children;i<a.length;i++){var o=a[i],s=t.nodeById(o);if(s){var c,l=this.elements.get(o);if(l&&(b((c=s).role)||(0,r.hasTrait)(c.traitFlags,r.SemanticTrait.Focusable)))return l;if(s.children.length>0||!s.label){var u=this.routeDefaultFocusTarget(s,t);if(u)return u;continue}if(l)return null!=(n=l.querySelector(":scope > span"))?n:l}}return null},Object.defineProperty(e.prototype,"nodeIdPrefix",{get:function(){return"rive-".concat(this.instanceId,"-sem-")}
1,enumerable:!1,configurable:!0}),e.prototype.nodeIdFromElement=function(e){if(!e.id.startsWith(this.nodeIdPrefix))return null;var t=e.id.slice(this.nodeIdPrefix.length);if(!t)return null;var n=Number(t);return Number.isNaN(n)?null:n},e.prototype.createElement=function(e){var t=function(e){switch(e){case r.SemanticRole.link:return"a";case r.SemanticRole.text:default:return"div"}}(e.role),n=document.createElement(t);if(n.id="".concat(this.nodeIdPrefix).concat(e.id),n.style.cssText=h,e.role===r.SemanticRole.text){var i=document.createElement("span");i.style.cssText=f,n.appendChild(i)}return this.attachActionHandlers(n,e),n},e.prototype.attachRovingNav=function(e,t){var n=this;e.addEventListener("keydown",function(i){var a=null;if("ArrowRight"===i.key||"ArrowDown"===i.key?a="next":"ArrowLeft"===i.key||"ArrowUp"===i.key?a="prev":t.includeHomeEnd&&"Home"===i.key?a="first":t.includeHomeEnd&&"End"===i.key&&(a="last"),a){i.preventDefault();var o=t.members(),s=o.indexOf(e);if(!(s<0)){var c=o.length,l="next"===a?o[(s+1)%c]:"prev"===a?o[(s-1+c)%c]:"first"===a?o[0]:o[c-1];if(l&&l!==e){l.focus();var u=n.nodeIdFromElement(l);null!==u&&n.fireAction(u,r.SemanticActionType.tap)}}}})},e.prototype.attachActionHandlers=function(e,t){var n=this,i=t.role,a=t.id;if(function(e){switch(e){case r.SemanticRole.button:case r.SemanticRole.link:case r.SemanticRole.checkbox:case r.SemanticRole.switchControl:case r.SemanticRole.tab:case r.SemanticRole.radioButton:return!0;default:return!1}}(i)){e.addEventListener("click",function(){n.fireAction(a,r.SemanticActionType.tap)});var o=i===r.SemanticRole.link?["Enter"]:["Enter"," "];e.addEventListener("keydown",function(e){o.includes(e.key)&&(e.preventDefault(),n.fireAction(a,r.SemanticActionType.tap))})}i===r.SemanticRole.slider&&e.addEventListener("keydown",function(e){"ArrowRight"===e.key||"ArrowUp"===e.key?(e.preventDefault(),n.fireAction(a,r.SemanticActionType.increase)):("ArrowLeft"===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),n.fireAction(a,r.SemanticActionType.decrease))}),i===r.SemanticRole.tab&&this.attachRovingNav(e,{includeHomeEnd:!0,members:function(){var t=e.parentElement;return t?Array.from(t.children).filter(function(e){return e instanceof HTMLElement&&"tab"===e.getAttribute("role")}):[]}}),i===r.SemanticRole.radioButton&&this.attachRovingNav(e,{includeHomeEnd:!1,members:function(){var t,n=null!=(t=e.closest('[role="radiogroup"]'))?t:e.parentElement;return n?Array.from(n.querySelectorAll('[role="radio"]')):[]}}),(0,r.hasTrait)(t.traitFlags,r.SemanticTrait.Focusable)&&e.addEventListener("focus",function(){n.requestFocus(a)})},e.prototype.applyAttributes=function(e,t){var n,i,h,f=t.role,g=t.stateFlags,w=t.traitFlags,_=function(e){switch(e){case r.SemanticRole.none:return"group";case r.SemanticRole.button:return"button";case r.SemanticRole.link:return null;case r.SemanticRole.checkbox:return"checkbox";case r.SemanticRole.switchControl:return"switch";case r.SemanticRole.slider:return"slider";case r.SemanticRole.textField:return"textbox";case r.SemanticRole.image:return"img";case r.SemanticRole.group:return"group";case r.SemanticRole.list:return"list";case r.SemanticRole.listItem:return"listitem";case r.SemanticRole.tab:return"tab";case r.SemanticRole.tabList:return"tablist";case r.SemanticRole.dialog:return"dialog";case r.SemanticRole.alertDialog:return"alertdialog";case r.SemanticRole.radioGroup:return"radiogroup";case r.SemanticRole.radioButton:return"radio";case r.SemanticRole.text:default:return null}}(f);if(_?p(e,"role",_):m(e,"role"),f===r.SemanticRole.link&&p(e,"role","link"),b(f)||(0,r.hasTrait)(w,r.SemanticTrait.Focusable)||f===r.SemanticRole.listItem?p(e,"tabindex","-1"):m(e,"tabindex"),t.label?p(e,"aria-label",t.label):m(e,"aria-label"),f===r.SemanticRole.slider){if(t.value){var S=parseFloat(t.value);Number.isFinite(S)?p(e,"aria-valuenow",String(S)):m(e,"aria-valuenow"),p(e,"aria-valuetext",t.value)}else m(e,"aria-valuenow"),m(e,"aria-valuetext");p(e,"aria-orientation","horizontal"),v(e,"aria-readonly",(0,r.hasState)(g,r.SemanticState.ReadOnly))}else m(e,"aria-valuenow"),m(e,"aria-valuetext"),m(e,"aria-orientation"),m(e,"aria-readonly");if(t.hint){var F="rive-".concat(this.instanceId,"-desc-").concat(t.id),A=this.descElements.get(t.id);A||((A=document.createElement("span")).id=F,A.style.cssText=d,this.container.appendChild(A),this.descElements.set(t.id,A)),A.textContent!==t.hint&&(A.textContent=t.hint),p(e,"aria-describedby",F)}else{m(e,"aria-describedby");var I=this.descElements.get(t.id);I&&(I.parentNode&&I.parentNode.removeChild(I),this.descElements.delete(t.id))}if(f===r.SemanticRole.text){var M=null!=(n=e.querySelector(":scope > span"))?n:e,E=null!=(i=t.label)?i:"";M.textContent!==E&&(M.textContent=E),m(e,"aria-label"),t.headingLevel>0?(p(e,"role","heading"),p(e,"aria-level",String(t.headingLevel))):m(e,"aria-level")}if((0,r.hasTrait)(w,r.SemanticTrait.Expandable)&&a.has(f)?v(e,"aria-expanded",(0,r.hasState)(g,r.SemanticState.Expanded)):m(e,"aria-expanded"),f===r.SemanticRole.tab||(0,r.hasTrait)(w,r.SemanticTrait.Selectable)&&o.has(f)?v(e,"aria-selected",(0,r.hasState)(g,r.SemanticState.Selected)):m(e,"aria-selected"),(0,r.hasTrait)(w,r.SemanticTrait.Checkable)&&s.has(f)){var C=(0,r.checkStateOf)(g);C===r.SemanticCheckState.Mixed&&c.has(f)?p(e,"aria-checked","mixed"):v(e,"aria-checked",C===r.SemanticCheckState.Checked)}else m(e,"aria-checked");(0,r.hasTrait)(w,r.SemanticTrait.Toggleable)?(l.has(f)?v(e,"aria-pressed",(0,r.hasState)(g,r.SemanticState.Toggled)):m(e,"aria-pressed"),f===r.SemanticRole.switchControl&&v(e,"aria-checked",(0,r.hasState)(g,r.SemanticState.Toggled))):m(e,"aria-pressed"),(0,r.hasTrait)(w,r.SemanticTrait.Requirable)&&u.has(f)?v(e,"aria-required",(0,r.hasState)(g,r.SemanticState.Required)):m(e,"aria-required"),(0,r.hasTrait)(w,r.SemanticTrait.Enablable)?v(e,"aria-disabled",(0,r.hasState)(g,r.SemanticState.Disabled)):m(e,"aria-disabled");var x=f===r.SemanticRole.image&&!t.label;if((0,r.hasState)(g,r.SemanticState.Hidden)||(0,r.hasState)(g,r.SemanticState.Obscured)||x?p(e,"aria-hidden","true"):m(e,"aria-hidden"),(0,r.hasState)(g,r.SemanticState.LiveRegion)?p(e,"aria-live","polite"):m(e,"aria-live"),f===r.SemanticRole.textField){if(v(e,"aria-readonly",(0,r.hasState)(g,r.SemanticState.ReadOnly)),v(e,"aria-multiline",(0,r.hasState)(g,r.SemanticState.Multiline)),0===t.children.length){var R=null!=(h=t.value)?h:"";
1e.textContent!==R&&(e.textContent=R)}}else m(e,"aria-multiline");y(f,g)?p(e,"aria-modal","true"):m(e,"aria-modal")},e.prototype.applyPosition=function(e,t,n,i){var a=this._artboardBounds,o=Math.max(t.minX,a.minX),s=Math.max(t.minY,a.minY),c=Math.min(t.maxX,a.maxX),l=Math.min(t.maxY,a.maxY),u=Math.round(Math.max(0,c-o))+"px",d=Math.round(Math.max(0,l-s))+"px",h=Math.round(o-n)+"px",f=Math.round(s-i)+"px";e.style.left!==h&&(e.style.left=h),e.style.top!==f&&(e.style.top=f),e.style.width!==u&&(e.style.width=u),e.style.height!==d&&(e.style.height=d),e.style.transform&&(e.style.transform=""),t.role===r.SemanticRole.text&&this.pendingTextGeometry.push(e)},e.prototype.flushTextGeometry=function(){if(0!==this.pendingTextGeometry.length){for(var e,t=[],n=0,r=this.pendingTextGeometry;n<r.length;n++){var i=r[n],a=null!=(e=i.querySelector(":scope > span"))?e:i,o="".concat(i.style.width,"|").concat(i.style.height,"|").concat(a.textContent);this.textGeometryKeys.get(i)!==o&&(a.style.width="auto",a.style.height="auto",a.style.transformOrigin="0 0",a.style.transform="",t.push({host:i,span:a,key:o}))}this.pendingTextGeometry.length=0;for(var s=t.map(function(e){var t=e.host,n=e.span,r=t.getBoundingClientRect(),i=n.getBoundingClientRect();if(i.width>0&&i.height>0){var a=r.width/i.width,o=r.height/i.height;return"scale(".concat(a,", ").concat(o,")")}return"none"}),c=0;c<t.length;c++){var l=t[c],i=l.host,a=l.span,o=l.key;a.style.transform=s[c],this.textGeometryKeys.set(i,o)}}},e.prototype.syncTransformContainer=function(e,t,n){if(!this.transformContainer){var r=document.createElement("div");r.style.cssText="position:absolute;top:0;left:0;overflow:visible;pointer-events:none;transform-origin:0 0",this.container.appendChild(r),this.transformContainer=r}var i=n.maxX-n.minX,a=n.maxY-n.minY;this.transformContainer.style.width=Math.round(i)+"px",this.transformContainer.style.height=Math.round(a)+"px";var o=1/(t||1),s=e.xx*o,c=e.xy*o,l=e.yx*o,u=e.yy*o,d=e.tx*o,h=e.ty*o;this.transformContainer.style.transform="matrix(".concat(s,",").concat(c,",").concat(l,",").concat(u,",").concat(d,",").concat(h,")")},e}(),a=new Set([r.SemanticRole.button,r.SemanticRole.link,r.SemanticRole.checkbox,r.SemanticRole.switchControl,r.SemanticRole.tab]),o=new Set([r.SemanticRole.tab]),s=new Set([r.SemanticRole.checkbox,r.SemanticRole.radioButton,r.SemanticRole.switchControl]),c=new Set([r.SemanticRole.checkbox]),l=new Set([r.SemanticRole.button]),u=new Set([r.SemanticRole.checkbox,r.SemanticRole.textField,r.SemanticRole.radioGroup]),d="position:absolute;width:1px;height:1px;overflow:hidden;pointer-events:none;left:-9999px",h="position:absolute;pointer-events:none;box-sizing:border-box;overflow:visible;margin:0;padding:0;transform-origin: 0px 0px 0px;border:none;background:transparent;color:transparent",f="display:inline-block;white-space:nowrap;pointer-events:none";function p(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function m(e,t){e.hasAttribute(t)&&e.removeAttribute(t)}function v(e,t,n){p(e,t,n?"true":"false")}function b(e){switch(e){case r.SemanticRole.button:case r.SemanticRole.link:case r.SemanticRole.checkbox:case r.SemanticRole.switchControl:case r.SemanticRole.slider:case r.SemanticRole.tab:case r.SemanticRole.radioButton:case r.SemanticRole.textField:return!0;default:return!1}}function y(e,t){return e===r.SemanticRole.alertDialog||e===r.SemanticRole.dialog&&(0,r.hasState)(t,r.SemanticState.Modal)}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>o.AudioAssetWrapper,AudioWrapper:()=>o.AudioWrapper,BLANK_URL:()=>a.BLANK_URL,CustomFileAssetLoaderWrapper:()=>o.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>o.FileAssetWrapper,FileFinalizer:()=>o.FileFinalizer,FocusSessionState:()=>i.FocusSessionState,FontAssetWrapper:()=>o.FontAssetWrapper,FontWrapper:()=>o.FontWrapper,ImageAssetWrapper:()=>o.ImageAssetWrapper,ImageWrapper:()=>o.ImageWrapper,KeyboardInteractions:()=>i.KeyboardInteractions,RiveFont:()=>s.RiveFont,createFinalization:()=>o.createFinalization,finalizationRegistry:()=>o.finalizationRegistry,registerTouchInteractions:()=>r.registerTouchInteractions,sanitizeUrl:()=>a.sanitizeUrl});var r=n(11),i=n(12),a=n(13),o=n(14),s=n(15)},(e,t,n)=>{n.r(t),n.d(t,{registerTouchInteractions:()=>o});var r=void 0,i=function(e,t,n){var r,i=[];if(t)for(var a=0;a<e.length;a++){var o=e[a];i.push({clientX:o.clientX,clientY:o.clientY,identifier:o.identifier})}else{var s=null!==n?null!=(r=Array.from(e).find(function(e){return e.identifier===n}))?r:null:e[0];
1s&&i.push({clientX:s.clientX,clientY:s.clientY,identifier:s.identifier})}return i},a=function(e,t,n,r){var a;return(null==(a=e.changedTouches)?void 0:a.length)?(!t&&["touchstart","touchmove"].includes(e.type)&&e.preventDefault(),i(e.changedTouches,n,r)):[{clientX:e.clientX,clientY:e.clientY,identifier:0}]},o=function(e){var t=e.canvas,n=e.artboard,i=e.stateMachines,o=void 0===i?[]:i,s=e.renderer,c=e.rive,l=e.fit,u=e.alignment,d=e.isTouchScrollEnabled,h=void 0!==d&&d,f=e.dispatchPointerExit,p=void 0===f||f,m=e.enableMultiTouch,v=void 0!==m&&m,b=e.layoutScaleFactor,y=void 0===b?1:b,g=e.advanceAndDrain;if(!t||!o.length||!s||!c||!n||"u"<typeof window)return null;var w=null,_=!1,S=null,F=function(){S=null},A=(function(e){if(_&&e instanceof MouseEvent){"mouseup"==e.type&&(_=!1);return}_=h&&"touchend"===e.type&&"touchstart"===w,w=e.type;var t,r=e.currentTarget.getBoundingClientRect();if(!v&&"touchstart"===e.type&&null===S){var i=null==(t=e.changedTouches)?void 0:t[0];i&&(S=i.identifier)}var s=a(e,h,v,v?null:S),d=c.computeAlignment(l,u,{minX:0,minY:0,maxX:r.width,maxY:r.height},n.bounds,y),f=new c.Mat2D;switch(d.invert(f),s.forEach(function(e){var t=e.clientX,n=e.clientY;if(t||n){var i=t-r.left,a=n-r.top,o=new c.Vec2D(i,a),s=c.mapXY(f,o),l=s.x(),u=s.y();e.transformedX=l,e.transformedY=u,s.delete(),o.delete()}}),f.delete(),d.delete(),e.type){case"mouseout":for(var m=function(e){p?s.forEach(function(t){e.pointerExit(t.transformedX,t.transformedY,t.identifier)}):s.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},b=0;b<o.length;b++){var F=o[b];m(F)}break;case"touchmove":case"mouseover":case"mousemove":for(var A=function(e){s.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},I=0;I<o.length;I++){var F=o[I];A(F)}break;case"touchstart":case"mousedown":for(var M=function(e){s.forEach(function(t){e.pointerDown(t.transformedX,t.transformedY,t.identifier)})},E=0;E<o.length;E++){var F=o[E];M(F)}g(0);break;case"touchend":for(var C=function(e){s.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier),e.pointerExit(t.transformedX,t.transformedY,t.identifier)})},x=0;x<o.length;x++){var F=o[x];C(F)}g(0),!v&&s.some(function(e){return e.identifier===S})&&(S=null);break;case"mouseup":for(var R=function(e){s.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier)})},P=0;P<o.length;P++){var F=o[P];R(F)}g(0)}}).bind(r);return t.addEventListener("mouseover",A),t.addEventListener("mouseout",A),t.addEventListener("mousemove",A),t.addEventListener("mousedown",A),t.addEventListener("mouseup",A),t.addEventListener("touchmove",A,{passive:h}),t.addEventListener("touchstart",A,{passive:h}),t.addEventListener("touchend",A),t.addEventListener("touchcancel",F),function(){t.removeEventListener("mouseover",A),t.removeEventListener("mouseout",A),t.removeEventListener("mousemove",A),t.removeEventListener("mousedown",A),t.removeEventListener("mouseup",A),t.removeEventListener("touchmove",A),t.removeEventListener("touchstart",A),t.removeEventListener("touchend",A),t.removeEventListener("touchcancel",F)}}},(e,t,n)=>{n.r(t),n.d(t,{FocusSessionState:()=>i,KeyboardInteractions:()=>a}),(r=i||(i={})).NotFocused="notFocused",r.EntryPending="entryPending",r.RiveFocused="riveFocused";var r,i,a=function(){function e(e){var t,n=e.canvas,r=e.stateMachine,a=e.hasFocusNodes,o=e.getOverlayElement,s=this;this.focusSessionState=i.NotFocused,this.canvasHasFocus=!1,this.focusDomainReleased=!1,this.currentOverlayElement=null,this.onCanvasFocus=function(e){s.syncOverlayListener(),s.canvasHasFocus=!0,s.focusDomainReleased=!1,!s.hasFocusNodes||s.mainSm.focusState().hasFocus||(s.focusSessionState=i.EntryPending,s.isKeyboardDrivenFocus()&&(s.cameFromBeforeCanvas(e.relatedTarget)?s.mainSm.focusNext():s.mainSm.focusPrevious())&&(s.focusSessionState=i.RiveFocused))},this.onCanvasBlur=function(e){s.focusSessionState=i.NotFocused,s.canvasHasFocus=!1;var t=s.isInFocusDomain(e.relatedTarget),n=null===e.relatedTarget&&!document.hasFocus();t||n||s.mainSm.clearFocus()},this.onOverlayFocusIn=function(e){!s.isInOverlay(e.target)||(s.focusDomainReleased=!1,s.hasFocusNodes&&s.focusSessionState===i.NotFocused&&(s.focusSessionState=s.mainSm.focusState().hasFocus?i.RiveFocused:i.EntryPending))},this.onFocusDomainHostFocusIn=function(e){s.syncOverlayListener(),s.onOverlayFocusIn(e)},this.onKeyDown=function(e){s.syncOverlayListener(),s.focusDomainReleased||s.shouldRiveHandleKeyEvent(e)&&"Tab"===e.code&&s.hasFocusNodes&&((e.shiftKey?s.mainSm.focusPrevious():s.mainSm.focusNext())?(s.focusSessionState=i.RiveFocused,e.preventDefault()):(s.focusSessionState=i.NotFocused,s.focusDomainReleased=!0,s.canvasHasFocus=!1),s.syncOverlayListener())},this.canvas=n,this.mainSm=r,this.hasFocusNodes=a,this.getOverlayElement=o,this.focusDomainHost=null!=(t=n.parentElement)?t:document,n.addEventListener("focus",this.onCanvasF
1ocus),n.addEventListener("blur",this.onCanvasBlur),n.addEventListener("keydown",this.onKeyDown),this.focusDomainHost.addEventListener("focusin",this.onFocusDomainHostFocusIn),this.syncOverlayListener()}return e.prototype.setFocusSessionState=function(e){this.focusSessionState=e},e.prototype.notifyRiveFocused=function(){this.focusSessionState=i.RiveFocused},e.prototype.shouldRiveHandleKeyEvent=function(e){if(this.focusSessionState===i.NotFocused)return!1;var t=this.isInFocusDomain(document.activeElement)||this.isInOverlay(e.target),n=e.target===this.canvas;return t||this.canvasHasFocus||n},e.prototype.isInFocusDomain=function(e){return e===this.canvas||this.isInOverlay(e)},e.prototype.isInOverlay=function(e){var t,n,r;return e instanceof Node&&null!=(r=null==(n=null==(t=this.getOverlayElement)?void 0:t.call(this))?void 0:n.contains(e))&&r},e.prototype.syncOverlayListener=function(){var e,t,n,r,i,a,o=null!=(t=null==(e=this.getOverlayElement)?void 0:e.call(this))?t:null;o!==this.currentOverlayElement&&(null==(n=this.currentOverlayElement)||n.removeEventListener("focusin",this.onOverlayFocusIn),null==(r=this.currentOverlayElement)||r.removeEventListener("keydown",this.onKeyDown,!0),this.currentOverlayElement=o,null==(i=this.currentOverlayElement)||i.addEventListener("focusin",this.onOverlayFocusIn),null==(a=this.currentOverlayElement)||a.addEventListener("keydown",this.onKeyDown,!0))},e.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch(e){return!1}},e.prototype.cameFromBeforeCanvas=function(e){if(!e)return!0;var t=this.canvas.compareDocumentPosition(e);return!!(t&Node.DOCUMENT_POSITION_PRECEDING)||!(t&Node.DOCUMENT_POSITION_FOLLOWING)},e.prototype.cleanup=function(){var e,t;this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown),this.focusDomainHost.removeEventListener("focusin",this.onFocusDomainHostFocusIn),null==(e=this.currentOverlayElement)||e.removeEventListener("focusin",this.onOverlayFocusIn),null==(t=this.currentOverlayElement)||t.removeEventListener("keydown",this.onKeyDown,!0)},e}()},(e,t,n)=>{n.r(t),n.d(t,{BLANK_URL:()=>l,sanitizeUrl:()=>u});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,c=[".","/"],l="about:blank";function u(e){if(!e)return l;var t=e.replace(o,"").replace(i,function(e,t){return String.fromCharCode(t)}).replace(a,"").replace(o,"").trim();if(!t)return l;if(c.indexOf(t[0])>-1)return t;var n=t.match(s);if(!n)return t;var u=n[0];return r.test(u)?l:t}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>p,AudioWrapper:()=>l,CustomFileAssetLoaderWrapper:()=>d,FileAssetWrapper:()=>h,FileFinalizer:()=>a,FontAssetWrapper:()=>m,FontWrapper:()=>u,ImageAssetWrapper:()=>f,ImageWrapper:()=>c,createFinalization:()=>y,finalizationRegistry:()=>b});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,t){void 0===t&&(t=null),this.selfUnref=!1,this._file=e,this._session=t}return e.prototype.unref=function(){this._file&&this._file.unref(),this._session&&(this._session.delete(),this._session=null)},e.prototype.release=function(){this._file=null,this._session=null},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}(),c=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}
1,enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},t}(s),l=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),u=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),d=function(){function e(e,t,n){void 0===n&&(n=null),this._assetLoaderCallback=t,this._session=n,this.assetLoader=new e.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return e.prototype.loadContents=function(e,t){var n;if(e.isImage)n=new f(e,this._session);else if(e.isAudio)n=new p(e,this._session);else{if(!e.isFont)return!1;n=new m(e,this._session)}return this._assetLoaderCallback(n,t)},e}(),h=function(){function e(e,t){void 0===t&&(t=null),this._nativeFileAsset=e,this._session=t}return e.prototype.decode=function(e){this._nativeFileAsset.decode(e,this._session)},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}(h),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}(h),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}(h),v=function(){function e(e){}return e.prototype.register=function(e){e.selfUnref=!0},e.prototype.unregister=function(e){},e}(),b=new("u">typeof FinalizationRegistry?FinalizationRegistry:v)(function(e){null==e||e.unref()}),y=function(e,t){var n=new o(t);b.register(e,n)}},(e,t,n)=>{n.r(t),n.d(t,{RiveFont:()=>i});var r=n(3),i=function(){function e(){}return e.setFallbackFontCallback=function(t){e._fallbackFontCallback=null!=t?t:null,e._wireFallbackProc()},e._fontToPtr=function(e){if(null==e)return null;var t,n=e.nativeFont,r=null==(t=null==n?void 0:n.ptr)?void 0:t.call(n);return null!=r?r:null},e._getFallbackPtr=function(t,n){return n<0||n>=t.length?null:e._fontToPtr(t[n])},e._wireFallbackProc=function(){r.RuntimeLoader.getInstance(function(t){var n=e._fallbackFontCallback;n?t.setFallbackFontCallback(function(t,r,i){var a=n(t,i);return a?Array.isArray(a)?e._getFallbackPtr(a,r):0===r?e._fontToPtr(a):null:null}):t.setFallbackFontCallback(null)})},e._fallbackFontCallback=null,e}()}],eS={};function eF(e){var t=eS[e];if(void 0!==t)return t.exports;var n=eS[e]={exports:{}};return e_[e](n,n.exports,eF),n.exports}eF.d=(e,t)=>{for(var n in t)eF.o(t,n)&&!eF.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},eF.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),eF.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(e,"__esModule",{value:!0})};var eA={};return eF.r(eA),eF.d(eA,{Alignment:()=>t,DataEnum:()=>et,DataType:()=>c,DrawOptimizationOptions:()=>n,EventType:()=>a,Fit:()=>e,Layout:()=>A,LoopType:()=>o,Rive:()=>Q,RiveEventType:()=>i,RiveFile:()=>J,RiveFont:()=>f.RiveFont,RuntimeLoader:()=>d.RuntimeLoader,SemanticMode:()=>h.SemanticMode,StateMachineInput:()=>M,StateMachineInputType:()=>r,Testing:()=>eb,ViewModel:()=>ee,ViewModelInstance:()=>er,ViewModelInstanceArtboard:()=>ep,ViewModelInstanceAssetFont:()=>ef,ViewModelInstanceAssetImage:()=>eh,ViewModelInstanceBoolean:()=>es,ViewModelInstanceColor:()=>ed,ViewModelInstanceEnum:()=>el,ViewModelInstanceList:()=>eu,ViewModelInstanceNumber:()=>eo,ViewModelInstanceString:()=>ea,ViewModelInstanceTrigger:()=>ec,ViewModelInstanceValue:()=>ei,decodeAudio:()=>ey,decodeFont:()=>ew,decodeImage:()=>eg}),u=eF(1),d=eF(3),h=eF(6),f=eF(10),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)},b=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},y=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(c){var l=[s,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){a.label=l[1];break}if(6===l[0]&&a.label<i[1]){a.label=i[1],i=l;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(l);break}i[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},g=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",(S=t||(t={})).Center="center",S.TopLeft="topLeft",S.TopCenter="topCenter",S.TopRight="topRight",S.CenterLeft="centerLeft",S.CenterRight="centerRight",S.BottomLeft="bottomLeft",S.BottomCenter="bottomCenter",S.BottomRight="bottomRight",(F=n||(n={})).AlwaysDraw="alwaysDraw",F.DrawOnChanged="drawOnChanged",A=function(){function n(n){var r,i,a,o,s,c,l;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!=(c=null==n?void 0:n.maxX)?c:0,this.maxY=null!=(l=null==n?void 0:n.maxY)?l: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,c=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!=c?c: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}(),(I=r||(r={}))[I.Number=56]="Number",I[I.Trigger=58]="Trigger",I[I.Boolean=59]="Boolean",M=function(){function e(e,t){this.type=e,this.runtimeInput=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.runtimeInput.name}
1,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}(),(E=i||(i={}))[E.General=128]="General",E[E.OpenUrl=131]="OpenUrl",x=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}(C=function(e){this.isBindableArtboard=!1,this.isBindableArtboard=e}),R=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}(C),P=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,"hasFocusNodes",{get:function(){return this.instance.hasFocusNodes()},enumerable:!1,configurable:!0}),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.enableSemantics=function(){this.instance.enableSemantics()},e.prototype.drainSemanticsDiff=function(){return this.instance.drainSemanticsDiff()},e.prototype.fireSemanticAction=function(e,t){this.instance.fireSemanticAction(e,t)},e.prototype.focusSemanticNode=function(e){return this.instance.focusSemanticNode(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 M(r.Boolean,e.asBool()):e.type===t.SMIInput.number?new M(r.Number,e.asNumber()):e.type===t.SMIInput.trigger?new M(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.prototype.focusState=function(){return this.instance.focusState()},e.prototype.clearFocus=function(){this.instance.clearFocus()},e}(),k=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,r){if(void 0===n&&(n=!0),void 0===r&&(r=!1),0===(e=ev(e)).length)this.animations.forEach(function(e){return e.playing=t}),this.stateMachines.forEach(function(e){return e.playing=t});else for(var i=this.animations.map(function(e){return e.name}),o=this.stateMachines.map(function(e){return e.name}),s=0;s<e.length;s++){var c=i.indexOf(e[s]),l=o.indexOf(e[s]);if(c>=0||l>=0)c>=0?this.animations[c].playing=t:this.stateMachines[l].playing=t;else{var d=this.artboard.animationByName(e[s]);if(d){var h=new u.Animation(d,this.artboard,this.runtime,t);h.advance(0),h.apply(1),this.animations.push(h)}else{var f=this.artboard.stateMachineByName(e[s]);if(f){var p=new P(f,this.runtime,t,this.artboard);r&&p.enableSemantics(),this.stateMachines.push(p)}}}}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,n){void 0===n&&(n=!1);for(var r=this.animations.map(function(e){return e.name}),i=0;i<e.length;i++){var a=r.indexOf(e[i]);if(a>=0)this.animations[a].playing=t;else{var o=this.artboard.animationByName(e[i]);if(o){var s=new u.Animation(o,this.artboard,this.runtime,t);s.advance(0),s.apply(1),this.animations.push(s)}else if(n)throw new w("State Machine with name ".concat(e[i]," not found"));else console.error("Animation with name ".concat(e[i]," not found."))}}},e.prototype.initStateMachines=function(e,t,n){for(var r=this.stateMachines.map(function(e){return e.name}),i=0;i<e.length;i++){var a=r.indexOf(e[i]);if(a>=0)this.stateMachines[a].playing=t;else{var o=this.artboard.stateMachineByName(e[i]);if(o){var s=new P(o,this.runtime,t,this.artboard);n&&s.enableSemantics(),this.stateMachines.push(s)}else console.warn("State Machine with name ".concat(e[i]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([e[i]],t,!0)}}},e.prototype.play=function(e){return this.add(e,!0)},e.prototype.advanceIfPaused=function(){this.stateMachines.forEac
1h(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=ev(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,n){var r;return void 0===t&&(t=!0),void 0===n&&(n=!1),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?(this.artboard.stateMachineCount()>0&&D("No `stateMachine` was specified, so the artboard's first linear animation is playing by default. In the next major version, the artboard's state machine will be played by default instead when one exists. Pass the `stateMachine` parameter to adopt that behavior now."),this.add([r=this.artboard.animationByIndex(0).name],e,t)):this.artboard.stateMachineCount()>0&&this.add([r=this.artboard.stateMachineByIndex(0).name],e,t,n)),r},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}(),(L=a||(a={})).Load="load",L.LoadError="loaderror",L.Play="play",L.Pause="pause",L.Stop="stop",L.Loop="loop",L.Draw="draw",L.Advance="advance",L.StateChange="statechange",L.RiveEvent="riveevent",L.AudioStatusChange="audiostatuschange",T="Rive Events are deprecated and will be removed in a future major version: please use data binding instead. See https://rive.app/docs/runtimes/web/rive-events for how to migrate.",O="State machine inputs are deprecated and will be removed in a future major version: please use data binding properties instead. See https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.",B="Text run APIs are deprecated and will be removed in a future major version: please use data binding instead. See https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.",N=new Set,D=function(e){N.has(e)||(N.add(e),console.warn("[Rive] ".concat(e)))},V=function(e,t){Array.isArray(e)&&D("Passing an array of names to `".concat(t,"()` is deprecated: in the next major version this parameter will be a single str
1ing, and playing multiple animations or state machines at once will not be supported."))},U=function(e){D("Passing linear animation names to `".concat(e,"()` is deprecated and will be removed in a future major version: ")+"Pass a single state machine name to control playback instead.")},(j=o||(o={})).OneShot="oneshot",j.Loop="loop",j.PingPong="pingpong",W=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}(),G=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}(),(H=s||(s={}))[H.AVAILABLE=0]="AVAILABLE",H[H.UNAVAILABLE=1]="UNAVAILABLE",z=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 b(this,void 0,void 0,function(){return y(this,function(t){return[2,new Promise(function(t){return setTimeout(t,e)})]})})},t.prototype.timeout=function(){return b(this,void 0,void 0,function(){return y(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 b(this,void 0,void 0,function(){return y(this,function(e){return this._enabled||(this._enabled=!0,this._status=s.AVAILABLE,this.reportToListeners()),[2]})})},t.prototype.testAudio=function(){return b(this,void 0,void 0,function(){return y(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 b(this,void 0,void 0,function(){return y(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 b(e,void 0,void 0,function(){return y(this,function(e){return this.enableAudio(),[2]})})},{once:!0})},t.prototype.establishAudio=function(){return b(this,void 0,void 0,function(){return y(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}(W)),$=function(){function e(){}return e.prototype.observe=function(){},e.prototype.unobserve=function(){},e.prototype.disconnect=function(){},e}(),X=globalThis.ResizeObserver||$,Y=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 X(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}()),K=0,q=function(e){var t=e.stateMachine,n=e.animations,r=e.stateMachines;return(void 0!==n&&D("The `animations` parameter is deprecated and will be removed in a future major version: please use the `stateMachine` parameter to play a state machine instead."),void 0!==r&&D("The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead."),t)?{startingAnimationNames:[],startingStateMachineNames:[t]}:{startingAnimationNames:ev(n),startingStateMachineNames:ev(r)}},J=function(){function e(e){this.enableRiveAssetCDN=!0,this.enablePerfMarks=!1,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.deferred=!1,this.session=null,this._sessionClaimed=!1,this.fileFinalizer=null,this.boundElsewhereWarned=!1,this.src=e.src,this.buffer=e.buffer,this.deferred=!!e.enableGPUCanvas,e.assetLoader&&(this.assetLoader=e.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(d.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new W,e.onLoad&&this.on(a.Lo
1ad,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError)}return e.prototype.releaseFile=function(){var e,t;null==(e=this.fileFinalizer)||e.release(),null==(t=this.file)||t.unref(),this.fileFinalizer=null,this.file=null},e.prototype.releaseSession=function(){var e;null==(e=this.session)||e.delete(),this.session=null},e.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(e){return e.destroy()})},e.prototype.initData=function(){return b(this,void 0,void 0,function(){var t,n,r,i,o,s;return y(this,function(c){switch(c.label){case 0:if(!(this.src&&!this.buffer))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),t=this,[4,em(this.src)];case 2:return t.buffer=c.sent(),[3,4];case 3:if((n=c.sent())instanceof Error)throw n;throw new w(e.fileLoadErrorMessage);case 4:if(this.destroyed)return[2];this.deferred&&null===this.session&&(this.session=e.makeDeferredSession(this.runtime)),this.assetLoader&&(r=new f.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader,this.session).assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),c.label=5;case 5:return c.trys.push([5,7,,8]),i=this,[4,this.runtime.load(new Uint8Array(this.buffer),r,this.enableRiveAssetCDN,this.session)];case 6:return i.file=c.sent(),[3,8];case 7:throw o=c.sent(),this.releaseSession(),o;case 8:if(this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),this.destroyed)return this.releaseFile(),this.releaseSession(),[2];if(null===this.file)return this.releaseSession(),this.fireLoadError(e.fileLoadErrorMessage),[2];return s=new f.FileFinalizer(this.file,this.session),this.fileFinalizer=s,f.finalizationRegistry.register(this,s),this.eventManager.fire({type:a.Load,data:this}),[2]}})})},e.prototype.loadRiveFileBytes=function(){return b(this,void 0,void 0,function(){var e;return y(this,function(t){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),e=this.src?em(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&e.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end")}),[2,e]})})},e.prototype.loadRuntime=function(){return b(this,void 0,void 0,function(){var e;return y(this,function(t){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),e=d.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&e.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end")}),[2,e]})})},e.prototype.init=function(){return b(this,void 0,void 0,function(){var t,n,r,i;return y(this,function(a){switch(a.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(e.missingErrorMessage),[2];a.label=1;case 1:return a.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:if(n=(t=a.sent())[0],r=t[1],this.destroyed)return[2];return this.buffer=n,this.runtime=r,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()];case 3:return a.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return i=a.sent(),this.fireLoadError(i instanceof Error?i.message:e.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},e.prototype.fireLoadError=function(e){throw this.eventManager.fire({type:a.LoadError,data:e}),new w(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.releaseSession(),this.destroyed=!0)},e.makeDeferredSession=function(t){var n,r,i=null!=(r=null==(n=t.makeDeferredSession)?void 0:n.call(t))?r:null;return null!==i||e.deferredUnsupportedWarned||(e.deferredUnsupportedWarned=!0,console.warn("Rive: `enableGPUCanvas: true` was ignored because this runtime build has no GPU Canvas support; importing in immediate mode. Use a @rive-app/webgl2 or @rive-app/canvas build with deferred rendering compiled in.")),i},Object.defineProperty(e.prototype,"deferredSession",{get:function(){return this.session}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deferredRequested",{get:function(){return this.deferred},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionClaimed",{get:function(){return this._sessionClaimed},enumerable:!1,configurable:!0}),e.prototype.claimSession=function(){this._sessionClaimed=!0},e.prototype.warnBoundElsewhereOnce=function(){this.boundElsewhereWarned||(this.boundElsewhereWarned=!0,console.warn("Rive: this deferred RiveFile is already bound to another Rive instance's canvas, and a deferred session cannot span canvases. Re-importing the file for this instance (an extra parse of the retained buffer, no extra network request)."))},e.prototype.reimport=function(t){return b(this,void 0,void 0,function(){var n;return y(this,function(r){switch(r.label){case 0:return[4,(n=new e({buffer:this.buffer,assetLoader:this.assetLoader,enableRiveAssetCDN:this.enableRiveAssetCDN,enablePerfMarks:this.enablePerfMarks,enableGPUCanvas:t})).init()];case 1:return r.sent(),[2,n]}})})},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 R(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 x(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 ee(t):null},e.prototype.globalViewModelNames=function(){return this.file.globalViewModelNames()},e.missingErrorMessage="Rive source file or data buffer required",e.fileLoadErrorMessage="The file failed to load",e.deferredUnsupportedWarned=!1,e}(),Q=function(){function t(e){var t,r,i,o,s=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.deferredRenderer=!1,this.ownsRiveFile=!1,this.artboard=null,this.eventCleanup=null,this._keyboardInteractions=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this.semanticsMode=h.SemanticMode.Disabled,this.semanticsOptions={riveCanvasLabel:"Rive animation"},this._semanticsActive=!1,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._pageVisibilityHandler=null,this._explicitlyStoppedRendering=!1,this._viewModelInstance=null,this._globalViewModelInstances=new Map,this._dataEnums=null,this._tabIndex=null,this._prevHasFocus=!1,this._focusOptions={allowFocusInterrupt:!1},this._semanticTree=null,this._accessibilityOverlay=null,this._overlayTransformDirty=!0,this._instanceId="".concat(K++),this.drawOptimization=n.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(e){var t=s._hasZeroSize!==e;s._hasZeroSize=e,e?s._layout.maxX&&s._layout.maxY||s.resizeToCanvas():t&&s.resizeDrawingSurfaceToCanvas()},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),"u">typeof document&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=e.canvas,e.canvas.constructor===HTMLCanvasElement&&(this._observed=Y.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 A,this.shouldDisableRiveListeners=!!e.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!e.isTouchScrollEnabled,e.automaticallyHandleEvents&&D("The `automaticallyHandleEvents` parameter is deprecated. "+T),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.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(d.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=null!=(i=e.focusOptions)?i:this._focusOptions,this._tabIndex=null!=(o=e.tabIndex)?o:null,this.deferredRenderer=!!e.enableGPUCanvas,this.eventManager=new W,e.onLoad&&this.on(a.Lo
1ad,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 G(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:e.autoplay,autoBind:e.autoBind,stateMachine:e.stateMachine,animations:e.animations,stateMachines:e.stateMachines,artboard:e.artboard,useOffscreenRenderer:e.useOffscreenRenderer,tabIndex:e.tabIndex,semanticsMode:e.semanticsMode,semanticsOptions:e.semanticsOptions,enableGPUCanvas:this.deferredRenderer})}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.enableSemantics=function(){this.semanticsMode=h.SemanticMode.Enabled,this.activateSemantics()},t.prototype.activateSemantics=function(){this._semanticsActive||this.semanticsMode===h.SemanticMode.Disabled||(this._semanticsActive=!0,this.syncSemanticsOnStateMachines())},t.prototype.syncSemanticsOnStateMachines=function(){if(this._semanticsActive&&this.animator)for(var e=0,t=this.animator.stateMachines;e<t.length;e++)t[e].enableSemantics()},t.prototype.cleanupSemantics=function(){this._semanticTree=null,this._accessibilityOverlay&&(this._accessibilityOverlay.destroy(),this._accessibilityOverlay=null)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(e){var n,r,i,o,s,c=this,l=e.src,u=e.buffer,f=e.riveFile,p=e.stateMachine,m=e.animations,v=e.stateMachines,b=e.artboard,y=e.autoplay,g=void 0!==y&&y,_=e.useOffscreenRenderer,S=void 0!==_&&_,F=e.autoBind,A=void 0!==F&&F,I=e.tabIndex,M=e.semanticsMode,E=e.semanticsOptions,C=e.enableGPUCanvas;if(!this.destroyed){if(!l&&!u&&!f)throw new w(t.missingErrorMessage);this.artboard&&(null==(r=null==(n=this.renderer)?void 0:n.bindContext)||r.call(n),null==(i=this.animator)||i.stop(),this.artboard.delete(),this.artboard=null),this.renderer&&(null==(s=(o=this.renderer).detachSession)||s.call(o)),this.releaseCurrentRiveFile(!1),this.src=l,this.buffer=u,this.riveFile=f,this.ownsRiveFile=!1,this.deferredRenderer=null!=C?C:this.deferredRenderer,this._tabIndex=null!=I?I:null,this.semanticsMode=null!=M?M:h.SemanticMode.Disabled,this.semanticsOptions=null!=E?E:this.semanticsOptions;var x=q({stateMachine:p,animations:m,stateMachines:v}),R=x.startingAnimationNames,P=x.startingStateMachineNames;this.loaded=!1,this.readyForPlaying=!1,d.RuntimeLoader.awaitInstance().then(function(e){if(!c.destroyed){c.runtime=e,c.removeRiveListeners(),c.cleanupSemantics(),c.deleteRiveRenderer(),c.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(c.renderer=c.runtime.makeRenderer(c.canvas,S),!c.renderer)throw Error("Renderer is null, cannot render Rive on the canvas.")}catch(e){throw console.error(e),new w("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}c.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),c.canvas.width||c.canvas.height||c.resizeDrawingSurfaceToCanvas(),c.initData(b,R,P,g,A).then(function(e){if(e)return c.setupRiveListeners()}).catch(function(e){console.error(e)})}}).catch(function(e){c.eventManager.fire({type:a.LoadError,data:e.message})})}},t.prototype.setupRiveListeners=function(e){var t=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var n=this.animator.stateMachines.filter(function(e){return e.playing}).filter(function(e){return 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,advanceAndDrain:this.advanceAndReportChanges.bind(this)}),this.ensureKeyboardInteractions()}},t.prototype.ensureKeyboardInteractions=function(){var e=this;if(!(this._keyboardInteractions||this.shouldDisableRiveListeners||"u"<typeof window)&&this.canvas instanceof HTMLCanvasElement){var t=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(t){var n=this.canvas.tabIndex;(-1===n||isNaN(n))&&(this.canvas.tabIndex=null!==this._tabIndex?this._tabIndex:0),this._keyboardInteractions=new f.KeyboardInteractions({canvas:this.canvas,stateMachine:t.instance,hasFocusNodes:!0,getOverlayElement:function(){var t,n;return null!=(n=null==(t=e._accessibilityOverlay)?void 0:t.getSemanticOverlayContainer())?n:null}})}}},t.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},t.prototype.initializeAudio=function(){var e,t=this;z.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()}},z.add(this._audioEventListener),z.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 b(this,void 0,void 0,function(){var o,s,c,l;return y(this,function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),this.ownsRiveFile=null==this.riveFile,!this.ownsRiveFile)return[3,2];return o=new J({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks,enableGPUCanvas:this.deferredRenderer}),this.riveFile=o,[4,o.init()];case 1:if(u.sent(),this.destroyed)return o.destroyIfUnused(),[2,!1];u.label=2;case 2:if(!(null!==this.riveFile.deferredSession||this.deferredRenderer))return[3,4];return[4,this.resolveDeferredRendering()];case 3:if(u.sent(),this.destroyed)return this.ownsRiveFile&&(null==(c=this.riveFile)||c.destroyIfUnused()),[2,!1];u.label=4;case 4:this.file=this.riveFile.getInstance(),this.initArtboard(e,t,n,r,i),this.initArtboardSize(),this.initializeAudio(),this.semanticsMode===h.SemanticMode.Enabled?this.activateSemantics():this._semanticsActive&&this.syncSemanticsOnStateMachines();try{this.loaded=!0,this.eventManager.fire({type:a.Load,data:null!=(l=this.src)?l:"buffer"})}catch(e){console.error(e)}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 5:var d;return s=(d=u.sent())&&d.isHandledError?d.message:"Problem loading file; may be corrupt!",this.eventManager.fire({type:a.LoadError,data:s}),[2,Promise.reject(s)];case 6:return[2]}})})},t.prototype.resolveDeferredRendering=function(){return b(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l;return y(this,function(u){switch(u.label){case 0:if(e=this.riveFile,t=this.ownsRiveFile,n=this.renderer,null===(r=e.deferredSession))return this.deferredRenderer&&!e.deferredRequested&&console.warn("Rive: `enableGPUCanvas: true` was ignored because this RiveFile was imported without it. The mode is fixed at import: construct the RiveFile with `enableGPUCanvas: true` to opt in."),[2];if(this.deferredRenderer||console.warn("Rive: this RiveFile was imported with `enableGPUCanvas: true`, so this instance renders deferred even though `enableGPUCanvas` is false on the instance. An immediate renderer would drop the file's deferred resources and draw nothing."),"function"==typeof(i=null==n?void 0:n.attachSession))return[3,2];return console.warn("Rive: this renderer cannot replay a deferred session (`useOffscreenRenderer` is not supported with deferred rendering). Re-importing the file in immediate mode for this instance."),[4,e.reimport(!1)];case 1:if(a=u.sent(),this.destroyed)return a.destroyIfUnused(),[2];return this.riveFile=a,this.ownsRiveFile=!0,t&&e.destroyIfUnused(),[2];case 2:if(!e.sessionClaimed&&i.call(n,r))return e.claimSession(),[2];return e.warnBoundElsewhereOnce(),[4,e.reimport(!0)];case 3:if(o=u.sent(),this.destroyed)return o.destroyIfUnused(),[2];if(this.riveFile=o,this.ownsRiveFile=!0,null!==(s=o.deferredSession)&&i.call(n,s))return o.claimSession(),[2];return console.warn("Rive: could not attach the re-imported file's deferred session to this canvas; falling back to immediate rendering for this instance."),null==(l=n.detachSession)||l.call(n),[4,e.reimport(!1)];case 4:if(c=u.sent(),o.destroyIfUnused(),this.destroyed)return c.destroyIfUnused(),[2];return this.riveFile=c,this.ownsRiveFile=!0,t&&e.destroyIfUnused(),[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)throw new w("Invalid artboard name or no default artboard");if(this.artboard=s,s.volume=this._volume*z.systemVolume,this.animator=new k(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,this._semanticsActive)):o=[this.animator.atLeastOne(r,!1,this._semanticsActive)],this.taskQueue.add({event:{type:r?a.Play:a.Pause,data:o}}),i){var c=this.file.defaultArtboardViewModel(s);if(null!==c){var l=c.defaultInstance();if(null!==l){var u=new er(l,null);(0,f.createFinalization)(u,u.runtimeInstance),this.setViewModelInstance(u)}}for(var d=0,h=this.file.globalViewModelNames();d<h.length;d++){var p=h[d],m=this.file.viewModelByName(p);if(null!==m){var v=new ee(m).defaultInstance();null!==v&&this.setGlobalViewModelInstance(p,v)}}this.bind()}}},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._deferredWorkPending=function(){var e,t,n;return null!=(n=null==(t=null==(e=this.riveFile)?void 0:e.deferredSession)?void 0:t.recordedThisFrame())&&n},t.prototype.pollFocusState=function(){if(this.ensureKeyboardInteractions(),!this._keyboardInteractions){this._prevHasFocus=!1;return}var e,t,n=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(!n){this._prevHasFocus=!1;return}if(this.canvas instanceof HTMLCanvasElement){if(n.focusState().hasFocus){if(this._keyboardInteractions.notifyRiveFocused(),!this._prevHasFocus){var r=null==(e=this._accessibilityOverlay)?void 0:e.getSemanticOverlayContainer();!(document.activeElement===this.canvas||null!=(t=null==r?void 0:r.contains(document.activeElement))&&t)&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=!0}return}this._prevHasFocus=!1,this._keyboardInteractions.focusSessionState===f.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(f.FocusSessionState.NotFocused)}},t.prototype.advanceAndReportChanges=function(e){for(var t,n,r=this.animator.animations.filter(function(e){return e.playing||e.needsScrub}).sort(function(e){return e.needsScrub?-1:1}),o=0;o<r.length;o++){var s=r[o];s.advance(e),s.instance.didLoop&&(s.loopCount+=1),s.apply(1)}for(var c=this.animator.stateMachines.filter(function(e){return e.playing}),l=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,u=0;u<c.length;u++){var d=c[u],p=d.reportedEventCount();if(p)for(var m=0;m<p;m++){var v=d.reportedEventAt(m);
1if(v)if(v.type===i.OpenUrl){if(this.eventManager.fire({type:a.RiveEvent,data:v}),this.automaticallyHandleEvents){var b=document.createElement("a"),y=v.url,g=v.target,w=(0,f.sanitizeUrl)(y);y&&b.setAttribute("href",w),g&&b.setAttribute("target",g),w&&w!==f.BLANK_URL&&b.click()}}else this.eventManager.fire({type:a.RiveEvent,data:v})}if(l>=0&&performance.mark("rive:sm-advance:start:f".concat(l)),d.advanceAndApply(e),l>=0&&(performance.mark("rive:sm-advance:end:f".concat(l)),performance.measure("rive:sm-advance:f".concat(l),"rive:sm-advance:start:f".concat(l),"rive:sm-advance:end:f".concat(l))),this._semanticsActive){var _=d.drainSemanticsDiff();_&&(this._semanticTree||(this._semanticTree=new h.SemanticTreeModel),this._semanticTree.applyDiff(_))}}if(this._semanticsActive&&this._semanticTree&&c.length>0&&this.canvas instanceof HTMLCanvasElement){if(!this._accessibilityOverlay){var S=c[0];this._accessibilityOverlay=new h.AccessibilityOverlay({canvas:this.canvas,instanceId:this._instanceId,semanticsOptions:this.semanticsOptions,allowFocusInterrupt:this._focusOptions.allowFocusInterrupt,fireAction:function(e,t){S.fireSemanticAction(e,t)},requestFocus:function(e){return S.focusSemanticNode(e)},clearFocus:function(){return S.instance.clearFocus()}})}var F=null==(t=this._accessibilityOverlay)?void 0:t.needsUpdate(this._semanticTree);if(F||this._overlayTransformDirty){var A=null;if((null==F?void 0:F.layoutChanged)||this._overlayTransformDirty){var I=this._layout.runtimeFit(this.runtime),M=this._layout.runtimeAlignment(this.runtime);A=this.runtime.computeAlignment(I,M,{minX:this._layout.minX,minY:this._layout.minY,maxX:this._layout.maxX,maxY:this._layout.maxY},this.artboard.bounds,this._devicePixelRatioUsed*this._layout.layoutScaleFactor),this._overlayTransformDirty=!1}this._accessibilityOverlay.update(this._semanticTree,A,this._devicePixelRatioUsed,this.artboard.bounds,F),null==A||A.delete()}}0==this.animator.stateMachines.length&&this.artboard.advance(e),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(e),this.pollFocusState(),null==(n=this._viewModelInstance)||n.handleCallbacks(),this._globalViewModelInstances.forEach(function(e){e&&e.handleCallbacks()})},t.prototype.draw=function(e,t){if(this.frameRequestId=null,this.artboard){var r=performance.now(),i=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=e),this.renderSecondTimer+=e-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==t||t());var a=(e-this.lastRenderTime)/1e3;this.lastRenderTime=e,this.advanceAndReportChanges(a);var o=this.renderer;!this._hasZeroSize&&(this.drawOptimization==n.AlwaysDraw||this.artboard.didChange()||this._deferredWorkPending()||this._needsRedraw||this._canvasSizeChanged())&&(o.clear(),o.save(),i>=0&&performance.mark("rive:align-renderer:start:f".concat(i)),this.alignRenderer(),i>=0&&(performance.mark("rive:align-renderer:end:f".concat(i)),performance.measure("rive:align-renderer:f".concat(i),"rive:align-renderer:start:f".concat(i),"rive:align-renderer:end:f".concat(i))),i>=0&&performance.mark("rive:artboard-draw:start:f".concat(i)),this.artboard.draw(o),i>=0&&(performance.mark("rive:artboard-draw:end:f".concat(i)),performance.measure("rive:artboard-draw:f".concat(i),"rive:artboard-draw:start:f".concat(i),"rive:artboard-draw:end:f".concat(i))),o.restore(),i>=0&&performance.mark("rive:renderer-flush:start:f".concat(i)),o.flush(),i>=0&&(performance.mark("rive:renderer-flush:end:f".concat(i)),performance.measure("rive:renderer-flush:f".concat(i),"rive:renderer-flush:start:f".concat(i),"rive:renderer-flush:end:f".concat(i))),this._needsRedraw=!1),this.frameCount++;var s=performance.now();for(this.frameTimes.push(s),this.durations.push(s-r);this.frameTimes[0]<=s-1e3;)this.frameTimes.shift(),this.durations.shift();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}
1,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,n,r,i;this.destroyed=!0,this.stopRendering(),null==(t=null==(e=this.renderer)?void 0:e.bindContext)||t.call(e),this.cleanupInstances(),null!==this._observed&&Y.remove(this._observed),this.removeRiveListeners(),this.renderer&&(null==(r=(n=this.renderer).detachSession)||r.call(n)),this.releaseCurrentRiveFile(!0),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(z.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),null==(i=this._viewModelInstance)||i.cleanup(),this._viewModelInstance=null,this._globalViewModelInstances.forEach(function(e){return e.cleanup()}),this._globalViewModelInstances.clear(),this._dataEnums=null},t.prototype.releaseCurrentRiveFile=function(e){var t,n;this.file?((e||this.ownsRiveFile)&&(null==(t=this.riveFile)||t.cleanup()),this.file=null):this.ownsRiveFile&&(null==(n=this.riveFile)||n.destroyIfUnused())},t.prototype.deleteRiveRenderer=function(){var e,t;this.renderer&&(null==(t=(e=this.renderer).detachSession)||t.call(e),this.renderer.delete()),this.renderer=null},Object.defineProperty(t.prototype,"deferredRendererActive",{get:function(){var e,t,n;return null!=(n=null==(t=null==(e=this.renderer)?void 0:e.deferredActive)?void 0:t.call(e))&&n},enumerable:!1,configurable:!0}),t.prototype.cleanupInstances=function(){var e;null!==this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics(),null==(e=this.animator)||e.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){D(B);var t=this.retrieveTextRun(e);return t?t.text:void 0},t.prototype.setTextRunValue=function(e,t){D(B);var n=this.retrieveTextRun(e);n&&(n.text=t)},t.prototype.warnIfLinearAnimationNames=function(e,t){this.animator&&this.animator.animations.some(function(t){return e.includes(t.name)})&&U(t)},t.prototype.play=function(e,t){var n=this;V(e,"play");var r=ev(e);this.readyForPlaying?(this.animator.play(r),this.warnIfLinearAnimationNames(r,"play"),this.syncSemanticsOnStateMachines(),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return n.play(e,t)}})},t.prototype.pause=function(e){var t=this;V(e,"pause");var n=ev(e);this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(n),this.warnIfLinearAnimationNames(n,"pause")):this.taskQueue.add({action:function(){return t.pause(e)}})},t.prototype.scrub=function(e,t){var n=this;D("`scrub()` is deprecated and will be removed in a future major version: use a state machine to control playback instead.");var r=ev(e);this.readyForPlaying?(this.animator.scrub(r,t||0),this.drawFrame()):this.taskQueue.add({action:function(){return n.scrub(e,t)}})},t.prototype.stop=function(e){var t=this;V(e,"stop");var n=ev(e);this.readyForPlaying?(this.warnIfLinearAnimationNames(n,"stop"),this.animator&&this.animator.stop(n),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics()):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=q({stateMachine:null==e?void 0:e.stateMachine,animations:null==e?void 0:e.animations,stateMachines:null==e?void 0:e.stateMachines}),a=i.startingAnimationNames,o=i.startingStateMachineNames,s=null!=(t=null==e?void 0:e.autoplay)&&t,c=null!=(n=null==e?void 0:e.autoBind)&&n;this.cleanupInstances(),this.initArtboard(r,a,o,s,c),this.readyForPlaying&&this.taskQueue.process()},t.prototype.load=function(e){if(!e.src&&!e.buffer&&!e.riveFile)throw new w(t.missingErrorMessage);this.stop(),this.init(e)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){this._layout=e,this._overlayTransformDirty=!0,e.maxX&&e.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()}
1,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}),this._overlayTransformDirty=!0},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.layout.fit===e.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=r/o,this.artboard.height=i/o}this.drawFrame()}},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,"semanticTree",{get:function(){return this._semanticTree},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessibilityOverlay",{get:function(){return this._accessibilityOverlay},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(D(O),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){D(O);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){D(O);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){D(O);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){D(B);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){D(B);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}):[]}
1,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){e===a.RiveEvent?D(T):e===a.StateChange?D("State change events are deprecated and will be removed in a future major version: use data binding (view model property observers) or state machine actions to react to changes from your graphic instead. See https://rive.app/docs/editor/state-machine/states#actions for how to migrate."):e===a.Loop&&D("Loop events are deprecated and will be removed in a future major version: they are only reported for linear animation playback, which is deprecated. Use a state machine to control playback and data binding to react to changes instead. See https://rive.app/docs/editor/data-binding/migration-guide for how to migrate."),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._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,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._onPageVisibilityChange=function(){var e,t;document.hidden?(null!==this.frameRequestId&&((null==(e=this.runtime)?void 0:e.cancelAnimationFrame)?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):(null==(t=this.animator)?void 0:t.isPlaying)&&!this._explicitlyStoppedRendering&&this.scheduleRendering()},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),c=s.name,l=new this.runtime.StateMachineInstance(s,n),u=[],d=0;d<l.inputCount();d++){var h=l.input(d);u.push({name:h.name,type:h.type})}r.stateMachines.push({name:c,inputs:u})}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*z.systemVolume)}
1,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){e!==this._devicePixelRatioUsed&&(this._overlayTransformDirty=!0),this._devicePixelRatioUsed=e},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(e){e&&(this.setViewModelInstance(e),this.bind())},t.prototype.setViewModelInstance=function(e){var t,n=null==e?void 0:e.runtimeInstance;this.artboard&&!this.destroyed&&e&&n&&(e.internalIncrementReferenceCount(),null==(t=this._viewModelInstance)||t.cleanup(),this._viewModelInstance=e,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(e){return e.instance.setViewModelInstance(n)}):this.artboard.setViewModelInstance(n))},t.prototype.bind=function(){this.artboard&&!this.destroyed&&(this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(e){return e.instance.bind()}):this.artboard.bind())},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.setGlobalViewModelInstance=function(e,t){var n,r=null==t?void 0:t.runtimeInstance;if(!this.artboard||this.destroyed||!r)return!1;var i=!1;return this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(t){t.instance.setGlobalViewModelInstance(e,r)&&(i=!0)}):i=this.artboard.setGlobalViewModelInstance(e,r),i&&(t.internalIncrementReferenceCount(),null==(n=this._globalViewModelInstances.get(e))||n.cleanup(),this._globalViewModelInstances.set(e,t)),i},t.prototype.globalViewModelInstance=function(e){var t=this._globalViewModelInstances.get(e);if(t)return t;if(!this.artboard||this.destroyed)return null;var n=this.animator.stateMachines.length>0?this.animator.stateMachines[0].instance.globalViewModelInstance(e):this.artboard.globalViewModelInstance(e);if(null===n)return null;var r=new er(n,null);return(0,f.createFinalization)(r,n),r.internalIncrementReferenceCount(),this._globalViewModelInstances.set(e,r),r},t.prototype.globalViewModelNames=function(){var e,t;return null!=(t=null==(e=this.file)?void 0:e.globalViewModelNames())?t:[]},t.prototype.viewModelByIndex=function(e){var t=this.file.viewModelByIndex(e);return null!==t?new ee(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 et(e)})}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var e=this.file.defaultArtboardViewModel(this.artboard);if(e)return new ee(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.prototype.clearFocus=function(){this.animator.stateMachines.filter(function(e){return e.playing&&e.hasFocusNodes}).forEach(function(e){return e.clearFocus()})},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),(Z=c||(c={})).none="none",Z.string="string",Z.number="number",Z.boolean="boolean",Z.color="color",Z.list="list",Z.enumType="enumType",Z.trigger="trigger",Z.viewModel="viewModel",Z.integer="integer",Z.listIndex="listIndex",Z.image="image",Z.artboard="artboard",ee=function(){function e(e){this._viewModel=e}return Object.defineProperty(e.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount}
1,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 er(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 er(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 er(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 er(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}(),et=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}(),(en=l||(l={})).Number="number",en.String="string",en.Boolean="boolean",en.Color="color",en.Trigger="trigger",en.Enum="enum",en.List="list",en.Image="image",en.Font="font",en.Artboard="artboard",er=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,c,u,d,h,f,p,m,v,b,y,g,w,_,S,F,A=this.internalViewModelInstance(e[t]);return null!==A?A.propertyFromPathSegments(e,t+1,n):null}var I=null;switch(n){case l.Number:if(null!==(I=null!=(i=null==(r=this._runtimeInstance)?void 0:r.number(e[t]))?i:null))return new eo(I,this);break;case l.String:if(null!==(I=null!=(o=null==(a=this._runtimeInstance)?void 0:a.string(e[t]))?o:null))return new ea(I,this);break;case l.Boolean:if(null!==(I=null!=(c=null==(s=this._runtimeInstance)?void 0:s.boolean(e[t]))?c:null))return new es(I,this);break;case l.Color:if(null!==(I=null!=(d=null==(u=this._runtimeInstance)?void 0:u.color(e[t]))?d:null))return new ed(I,this);break;case l.Trigger:if(null!==(I=null!=(f=null==(h=this._runtimeInstance)?void 0:h.trigger(e[t]))?f:null))return new ec(I,this);break;case l.Enum:if(null!==(I=null!=(m=null==(p=this._runtimeInstance)?void 0:p.enum(e[t]))?m:null))return new el(I,this);break;case l.List:if(null!==(I=null!=(b=null==(v=this._runtimeInstance)?void 0:v.list(e[t]))?b:null))return new eu(I,this);break;case l.Image:if(null!==(I=null!=(g=null==(y=this._runtimeInstance)?void 0:y.image(e[t]))?g:null))return new eh(I,this);break;case l.Font:if(null!==(I=null!=(_=null==(w=this._runtimeInstance)?void 0:w.font(e[t]))?_:null))return new ef(I,this);break;case l.Artboard:if(null!==(I=null!=(F=null==(S=this._runtimeInstance)?void 0:S.artboard(e[t]))?F:null))return new ep(I,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,l.Number)},e.prototype.string=function(e){return this.propertyFromPath(e,l.String)},e.prototype.boolean=function(e){return this.propertyFromPath(e,l.Boolean)},e.prototype.color=function(e){return this.propertyFromPath(e,l.Color)},e.prototype.trigger=function(e){return this.propertyFromPath(e,l.Trigger)},e.prototype.enum=function(e){return this.propertyFromPath(e,l.Enum)},e.prototype.list=function(e){return this.propertyFromPath(e,l.List)},e.prototype.image=function(e){return this.propertyFromPath(e,l.Image)},e.prototype.font=function(e){return this.propertyFromPath(e,l.Font)},e.prototype.artboard=function(e){return this.propertyFromPath(e,l.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)}))||[]}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewModelName",{get:function(){var e,t;return null!=(t=null==(e=this._runtimeInstance)?void 0:e.getViewModelName())?t:""},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=g([],this._children,!0);this._children.length=0;var r=g([],this._parents,!0);this._parents.length=0,n.forEach(function(e){e.removeParent(t)}),r.forEach(function(e){e.removeFromViewModelCallbacks(t)})}},e}(),ea=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}(ei=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}()),eo=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}(ei),es=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}(ei),ec=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}(ei),el=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}(ei),eu=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 er(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}(ei),ed=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}
1,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}(ei),eh=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}(ei),ef=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.nativeFont)?t:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(ei),ep=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}(ei),em=function(e){return b(void 0,void 0,void 0,function(){var t;return y(this,function(n){switch(n.label){case 0:return[4,fetch(new Request(e))];case 1:if(!(t=n.sent()).ok)throw Error("Failed to fetch the Rive file: HTTP ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,n.sent()]}})})},ev=function(e){return"string"==typeof e?[e]:e instanceof Array?e:[]},eb={EventManager:W,TaskQueueManager:G},ey=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return d.RuntimeLoader.getInstance(function(n){n.decodeAudio(e,t,null)})})];case 1:return t=r.sent(),n=new f.AudioWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},eg=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return d.RuntimeLoader.getInstance(function(n){n.decodeImage(e,t,null)})})];case 1:return t=r.sent(),n=new f.ImageWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},ew=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return d.RuntimeLoader.getInstance(function(n){n.decodeFont(e,t,null)})})];case 1:return t=r.sent(),n=new f.FontWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},eA})()}}]); 2//# sourceMappingURL=a7b7e0cd.f9dea1aeec206cba.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.