{"version":3,"sources":["jsdelivr-header.js","webpack://rive/webpack/universalModuleDefinition","webpack://rive/src/animation/Animation.ts","webpack://rive/src/runtimeLoader.ts","webpack://rive/npm/canvas_advanced/canvas_advanced.mjs","webpack://rive/src/semantics/semanticTreeModel.ts","webpack://rive/src/semantics/types.ts","webpack://rive/src/semantics/accessibilityOverlay.ts","webpack://rive/src/utils/registerTouchInteractions.ts","webpack://rive/src/utils/registerKeyboardInteractions.ts","webpack://rive/src/utils/sanitizeUrl.ts","webpack://rive/src/utils/finalizationRegistry.ts","webpack://rive/src/utils/riveFont.ts","webpack://rive/webpack/bootstrap","/npm/@rive-app/canvas@2.43.0/webpack:/rive/webpack/runtime/define property getters","/npm/@rive-app/canvas@2.43.0/webpack:/rive/webpack/runtime/hasOwnProperty shorthand","/npm/@rive-app/canvas@2.43.0/webpack:/rive/webpack/runtime/make namespace object","webpack://rive/src/rive.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CCNA,SAAA,EAAA,GACA,iBAAA,SAAA,iBAAA,OACA,OAAA,QAAA,IACA,mBAAA,eAAA,IACA,OAAA,GAAA,GACA,iBAAA,QACA,QAAA,KAAA,IAEA,EAAA,KAAA,GACC,CATD,CASC,KAAA,I,qICSD,IAAA,EAAA,WAgBE,SAAA,EACU,EACA,EACR,EACO,GAHC,KAAA,YACA,KAAA,WAED,KAAA,UAnBF,KAAA,UAAY,EAOZ,KAAA,QAAyB,KAc9B,KAAK,SAAW,IAAI,EAAQ,wBAAwB,EAAW,EACjE,CAuEF,OAlEE,OAAA,eAAW,EAAA,UAAA,OAAI,C,IAAf,WACE,OAAO,KAAK,UAAU,IACxB,E,gCAKA,OAAA,eAAW,EAAA,UAAA,OAAI,C,IAAf,WACE,OAAO,KAAK,SAAS,IACvB,E,IAKA,SAAgB,GACd,KAAK,SAAS,KAAO,CACvB,E,gCAKA,OAAA,eAAW,EAAA,UAAA,YAAS,C,IAApB,WACE,OAAO,KAAK,UAAU,SACxB,E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AC,GACzB,EAAK,YAAY,EAAO,EAAS,KACnC,EAFA,I,OAOF,OAHM,EAAkB,EAAA,OAClB,EAAe,IAAI,EAAA,aAAa,GACtC,EAAA,qBAAqB,SAAS,EAAc,GAC5C,GAAO,G,MASI,GAAa,SACxB,GAAiB,OAAA,OAAA,2B,yDAOK,SALC,IAAI,QAAiB,SAAC,GAC3C,OAAA,EAAA,cAAc,YAAY,SAAC,GACzB,EAAK,WAAW,EAAO,EAAS,KAClC,EAFA,I,OAOF,OAHM,EAAgB,EAAA,OAChB,EAAc,IAAI,EAAA,YAAY,GACpC,EAAA,qBAAqB,SAAS,EAAa,GAC3C,GAAO,G","file":"/npm/@rive-app/canvas@2.43.0/rive.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@rive-app/canvas@2.43.0/rive.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rive\"] = factory();\n\telse\n\t\troot[\"rive\"] = factory();\n})(this, () => {\nreturn ","import type {\n  LinearAnimationInstance,\n  LinearAnimation,\n  Artboard,\n  RiveCanvas,\n} from \"./../rive_advanced.mjs\";\n\n/**\n * Represents an animation that can be played on an Artboard. \n * Wraps animations and instances from the runtime and keeps track of playback state.\n *\n * The `Animation` class manages the state and behavior of a single animation instance,\n * including its current time, loop count, and ability to scrub to a specific time.\n *\n * The class provides methods to advance the animation, apply its interpolated keyframe\n * values to the Artboard, and clean up the underlying animation instance when the\n * animation is no longer needed.\n */\nexport class Animation {\n  public loopCount = 0;\n  public readonly instance: LinearAnimationInstance;\n\n  /**\n   * The time to which the animation should move to on the next render.\n   * If not null, the animation will scrub to this time instead of advancing by the given time.\n   */\n  public scrubTo: number | null = null;\n\n  /**\n   * Constructs a new animation\n   * @constructor\n   * @param {any} animation: runtime animation object\n   * @param {any} instance: runtime animation instance object\n   */\n  constructor(\n    private animation: LinearAnimation,\n    private artboard: Artboard,\n    runtime: RiveCanvas,\n    public playing: boolean\n  ) {\n    this.instance = new runtime.LinearAnimationInstance(animation, artboard);\n  }\n\n  /**\n   * Returns the animation's name\n   */\n  public get name(): string {\n    return this.animation.name;\n  }\n\n  /**\n   * Returns the animation's name\n   */\n  public get time(): number {\n    return this.instance.time;\n  }\n\n  /**\n   * Sets the animation's current time\n   */\n  public set time(value: number) {\n    this.instance.time = value;\n  }\n\n  /**\n   * Returns the animation's loop type\n   */\n  public get loopValue(): number {\n    return this.animation.loopValue;\n  }\n\n  /**\n   * Indicates whether the animation needs to be scrubbed.\n   * @returns `true` if the animation needs to be scrubbed, `false` otherwise.\n   */\n  public get needsScrub(): boolean {\n    return this.scrubTo !== null;\n  }\n\n  /**\n   * Advances the animation by the give time. If the animation needs scrubbing,\n   * time is ignored and the stored scrub value is used.\n   * @param time the time to advance the animation by if no scrubbing required\n   */\n  public advance(time: number) {\n    if (this.scrubTo === null) {\n      this.instance.advance(time);\n    } else {\n      this.instance.time = 0;\n      this.instance.advance(this.scrubTo);\n      this.scrubTo = null;\n    }\n  }\n\n  /**\n   * Apply interpolated keyframe values to the artboard. This should be called after calling\n   * .advance() on an animation instance so that new values are applied to properties.\n   *\n   * Note: This does not advance the artboard, which updates all objects on the artboard\n   * @param mix - Mix value for the animation from 0 to 1\n   */\n  public apply(mix: number) {\n    this.instance.apply(mix);\n  }\n\n  /**\n   * Deletes the backing Wasm animation instance; once this is called, this\n   * animation is no more.\n   */\n  public cleanup() {\n    this.instance.delete();\n  }\n}\n","import * as rc from \"./rive_advanced.mjs\";\nimport packageData from \"package.json\";\n\n// Callback type when looking for a runtime instance\nexport type RuntimeCallback = (rive: rc.RiveCanvas) => void;\n\n// Runtime singleton; use getInstance to provide a callback that returns the\n// Rive runtime\nexport class RuntimeLoader {\n  // Singleton helpers\n  private static runtime: rc.RiveCanvas;\n  // Flag to indicate that loading has started/completed\n  private static isLoading = false;\n  // List of callbacks for the runtime that come in while loading\n  private static callBackQueue: RuntimeCallback[] = [];\n  // Instance of the Rive runtime\n  private static rive: rc.RiveCanvas;\n  // Path to the Wasm file; default path works for testing only;\n  // if embedded wasm is used then this is never used.\n  private static wasmURL = `https://unpkg.com/${packageData.name}@${packageData.version}/rive.wasm`;\n\n  // Fallback WASM URL tried when the primary URL fails. Set to null to disable\n  // the fallback entirely. Defaults to pulling from the jsdelivr CDN.\n  private static wasmFallbackURL: string | null = `https://cdn.jsdelivr.net/npm/${packageData.name}@${packageData.version}/rive_fallback.wasm`;\n\n  private static wasmBinary: ArrayBuffer | null = null;\n\n  // Error callbacks enqueued from .getInstance()\n  private static errorCallbackQueue: ((error: Error) => void)[] = [];\n\n  // Class is never instantiated\n  private constructor() {}\n\n  /**\n   * When true, performance.mark / performance.measure entries are emitted for\n   * WASM initialization.\n   */\n  public static enablePerfMarks: boolean = false;\n\n  // Rejects all pending awaitInstance() promises and resets loading state so\n  // the next call to getInstance() / awaitInstance() can retry with a new URL.\n  private static notifyError(error: Error): void {\n    RuntimeLoader.isLoading = false;\n    while (RuntimeLoader.errorCallbackQueue.length > 0) {\n      RuntimeLoader.errorCallbackQueue.shift()?.(error);\n    }\n    RuntimeLoader.callBackQueue = [];\n  }\n\n  // Loads the runtime\n  private static loadRuntime(): void {\n    // Capture the URL at call time so the catch closure always refers to the\n    // URL this particular attempt used, even if wasmURL is mutated for a retry.\n    const attemptedUrl = RuntimeLoader.wasmURL;\n    const wasmBinary = RuntimeLoader.wasmBinary;\n    if (RuntimeLoader.enablePerfMarks) performance.mark('rive:wasm-init:start');\n    rc.default({\n      // Loads Wasm bundle\n      locateFile: () => attemptedUrl,\n      ...(wasmBinary ? { wasmBinary } : {})\n    })\n      .then((rive: rc.RiveCanvas) => {\n        if (RuntimeLoader.enablePerfMarks) {\n          performance.mark('rive:wasm-init:end');\n          performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');\n        }\n        RuntimeLoader.runtime = rive;\n        RuntimeLoader.errorCallbackQueue = [];\n        // Fire all the callbacks\n        while (RuntimeLoader.callBackQueue.length > 0) {\n          RuntimeLoader.callBackQueue.shift()?.(RuntimeLoader.runtime);\n        }\n      })\n      .catch((error) => {\n        // Capture specific error details\n        const errorDetails = {\n          message: error?.message || \"Unknown error\",\n          type: error?.name || \"Error\",\n          // Some browsers may provide additional WebAssembly-specific details\n          wasmError:\n            error instanceof WebAssembly.CompileError ||\n            error instanceof WebAssembly.RuntimeError,\n          originalError: error,\n        };\n\n        // Log detailed error for debugging\n        console.debug(\"Rive WASM load error details:\", errorDetails);\n\n        // In case the primary URL fails, or the wasm was not supported, try the\n        // fallback URL (a rive_fallback.wasm compiled for older architectures).\n        // The fallback can be customised or disabled via setWasmFallbackUrl().\n        // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use the fallback only if the primary fails.\n        const fallbackUrl = RuntimeLoader.wasmFallbackURL;\n        const alreadyOnFallback =\n          fallbackUrl !== null &&\n          attemptedUrl.toLowerCase() === fallbackUrl.toLowerCase();\n\n        if (fallbackUrl !== null && !alreadyOnFallback) {\n          console.warn(\n            `Failed to load WASM from ${attemptedUrl} (${errorDetails.message}), trying fallback URL: ${fallbackUrl}`,\n          );\n          // Clear wasmBinary so the retry actually fetches via locateFile\n          // instead of re-using the same (failing) in-memory binary.\n          RuntimeLoader.wasmBinary = null;\n          RuntimeLoader.setWasmUrl(fallbackUrl);\n          RuntimeLoader.loadRuntime();\n        } else {\n          // When alreadyOnFallback is true, wasmURL has already been overwritten\n          // with the fallback URL, so we can no longer recover the original\n          // primary URL here. The primary URL was logged in the earlier warning.\n          const triedUrls = alreadyOnFallback\n            ? `the configured WASM URL or its fallback (${fallbackUrl})`\n            : attemptedUrl;\n          const errorMessage = [\n            `Could not load Rive WASM file from ${triedUrls}.`,\n            \"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:\",\n            `- Type: ${errorDetails.type}`,\n            `- Message: ${errorDetails.message}`,\n            `- WebAssembly-specific error: ${errorDetails.wasmError}`,\n            \"\\nTo resolve, you may need to:\",\n            \"1. Check your network connection\",\n            \"2. Set a new WASM source via RuntimeLoader.setWasmUrl()\",\n            \"3. Call RuntimeLoader.awaitInstance() again\",\n          ].join(\"\\n\");\n\n          console.error(errorMessage);\n          RuntimeLoader.notifyError(new Error(errorMessage));\n        }\n      });\n  }\n\n  // Provides a runtime instance via a callback\n  public static getInstance(callback: RuntimeCallback, onError?: (error: Error) => void): void {\n    // If it's not loading, start loading runtime\n    if (!RuntimeLoader.isLoading) {\n      RuntimeLoader.isLoading = true;\n      RuntimeLoader.loadRuntime();\n    }\n    if (!RuntimeLoader.runtime) {\n      RuntimeLoader.callBackQueue.push(callback);\n      if (onError) {\n        RuntimeLoader.errorCallbackQueue.push(onError);\n      }\n    } else {\n      callback(RuntimeLoader.runtime);\n    }\n  }\n\n  // Provides a runtime instance via a promise; rejects if WASM fails to load.\n  public static awaitInstance(): Promise<rc.RiveCanvas> {\n    return new Promise<rc.RiveCanvas>((resolve, reject) =>\n      RuntimeLoader.getInstance(resolve, reject),\n    );\n  }\n\n  // Manually sets the wasm url\n  public static setWasmUrl(url: string): void {\n    RuntimeLoader.wasmURL = url;\n  }\n\n  // Gets the current wasm url\n  public static getWasmUrl(): string {\n    return RuntimeLoader.wasmURL;\n  }\n\n  /**\n   * Sets the URL used as a fallback when the primary WASM URL fails to load.\n   * Pass `null` to disable the fallback entirely.\n   *\n   * Defaults to pulling from the jsdelivr CDN.\n   */\n  public static setWasmFallbackUrl(url: string | null): void {\n    RuntimeLoader.wasmFallbackURL = url;\n  }\n\n  // Gets the current fallback wasm url (null means fallback is disabled)\n  public static getWasmFallbackUrl(): string | null {\n    return RuntimeLoader.wasmFallbackURL;\n  }\n\n  // Manually sets the wasm binary or clears it with null\n  public static setWasmBinary(value: ArrayBuffer | null): void {\n    if ((value instanceof ArrayBuffer) || value === null) {\n      RuntimeLoader.wasmBinary = value;\n      return;\n    }\n    console.error(\"setWasmBinary expects an ArrayBuffer or null\");\n  }\n\n  // Gets the current wasm build as ArrayBuffer or null\n  public static getWasmBinary(): ArrayBuffer | null {\n    return RuntimeLoader.wasmBinary;\n  }\n}\n","var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var k=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;\nfunction ca(){function a(g){const h=d;c=b=0;d=new Map;h.forEach(l=>{try{l(g)}catch(n){console.error(n)}});this.xb();e&&e.bc()}let b=0,c=0,d=new Map,e=null,f=null;this.requestAnimationFrame=function(g){b||=requestAnimationFrame(a.bind(this));const h=++c;d.set(h,g);return h};this.cancelAnimationFrame=function(g){d.delete(g);b&&0==d.size&&(cancelAnimationFrame(b),b=0)};this.$b=function(g){f&&(document.body.remove(f),f=null);g||(f=document.createElement(\"div\"),f.style.backgroundColor=\"black\",f.style.position=\n\"fixed\",f.style.right=0,f.style.top=0,f.style.color=\"white\",f.style.padding=\"4px\",f.innerHTML=\"RIVE FPS\",g=function(h){f.innerHTML=\"RIVE FPS \"+h.toFixed(1)},document.body.appendChild(f));e=new function(){let h=0,l=0;this.bc=function(){var n=performance.now();l?(++h,n-=l,1E3<n&&(g(1E3*h/n),h=l=0)):(l=n,h=0)}}};this.Xb=function(){f&&(document.body.remove(f),f=null);e=null};this.xb=function(){}}\nfunction ea(a){console.assert(!0);const b=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<a)-1)>>a;b.has(d)&&clearTimeout(b.get(d));b.set(d,setTimeout(function(){b.delete(d);0==b.length?c=-Infinity:d==c&&(c=Math.max(...b.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<a}}const fa=k.onRuntimeInitialized;\nk.onRuntimeInitialized=function(){fa&&fa();let a=k.decodeAudio;k.decodeAudio=function(g,h,l=null){g=a(g,l??null);h(g)};let b=k.decodeFont;k.decodeFont=function(g,h,l=null){g=b(g,l??null);h(g)};const c=k.FileAsset.prototype.decode;k.FileAsset.prototype.decode=function(g,h){return c.call(this,g,h??null)};let d=k.setFallbackFontCb;k.setFallbackFontCallback=\"function\"===typeof d?function(g){d(g)}:function(){console.warn(\"Module.setFallbackFontCallback called, but text support is not enabled in this build.\")};\nconst e=k.FileAssetLoader;k.ptrToAsset=g=>{let h=k.ptrToFileAsset(g);return h.isImage?k.ptrToImageAsset(g):h.isFont?k.ptrToFontAsset(g):h.isAudio?k.ptrToAudioAsset(g):h};k.CustomFileAssetLoader=e.extend(\"CustomFileAssetLoader\",{__construct:function({loadContents:g}){this.__parent.__construct.call(this);this.Pb=g},loadContents:function(g,h){g=k.ptrToAsset(g);return this.Pb(g,h)}});k.CDNFileAssetLoader=e.extend(\"CDNFileAssetLoader\",{__construct:function(g){this.__parent.__construct.call(this);this.Rb=\ng??null},loadContents:function(g){let h=k.ptrToAsset(g);g=h.cdnUuid;if(\"\"===g)return!1;const l=this.Rb??null;(function(n,t){var u=new XMLHttpRequest;u.responseType=\"arraybuffer\";u.onreadystatechange=function(){4==u.readyState&&200==u.status&&t(u)};u.open(\"GET\",n,!0);u.send(null)})(h.cdnBaseUrl+\"/\"+g,n=>{h.decode(new Uint8Array(n.response),l)});return!0}});k.FallbackFileAssetLoader=e.extend(\"FallbackFileAssetLoader\",{__construct:function(){this.__parent.__construct.call(this);this.sb=[]},addLoader:function(g){this.sb.push(g)},\nloadContents:function(g,h){for(let l of this.sb)if(l.loadContents(g,h))return!0;return!1}});let f=k.computeAlignment;k.computeAlignment=function(g,h,l,n,t=1){return f.call(this,g,h,l,n,t)}};\nconst ha=\"createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText\".split(\" \"),ia=new function(){function a(){if(!b){var x=document.createElement(\"canvas\"),y={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:\"high-performance\",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,\nrenderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=x.getContext(\"webgl\",y),c=1,!p)return console.log(\"No WebGL support. Image mesh will not be drawn.\"),!1}else if(p=x.getContext(\"webgl2\",y))c=2;else if(p=x.getContext(\"webgl\",y))c=1;else return console.log(\"No WebGL support. Image mesh will not be drawn.\"),!1;p=new Proxy(p,{get(K,v){if(K.isContextLost()){if(l||(console.error(\"Cannot render the mesh because the GL Context was lost. Tried to invoke \",v),l=!0),\n\"function\"===typeof K[v])return function(){}}else return\"function\"===typeof K[v]?function(...N){return K[v].apply(K,N)}:K[v]},set(K,v,N){if(K.isContextLost())l||(console.error(\"Cannot render the mesh because the GL Context was lost. Tried to set property \"+v),l=!0);else return K[v]=N,!0}});d=Math.min(p.getParameter(p.MAX_RENDERBUFFER_SIZE),p.getParameter(p.MAX_TEXTURE_SIZE));function I(K,v,N){v=p.createShader(v);p.shaderSource(v,N);p.compileShader(v);N=p.getShaderInfoLog(v);if(0<(N||\"\").length)throw N;\np.attachShader(K,v)}x=p.createProgram();I(x,p.VERTEX_SHADER,\"attribute vec2 vertex;\\n                attribute vec2 uv;\\n                uniform vec4 mat;\\n                uniform vec2 translate;\\n                varying vec2 st;\\n                void main() {\\n                    st = uv;\\n                    gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\\n                }\");I(x,p.FRAGMENT_SHADER,\"precision highp float;\\n                uniform sampler2D image;\\n                varying vec2 st;\\n                void main() {\\n                    gl_FragColor = texture2D(image, st);\\n                }\");\np.bindAttribLocation(x,0,\"vertex\");p.bindAttribLocation(x,1,\"uv\");p.linkProgram(x);y=p.getProgramInfoLog(x);if(0<(y||\"\").trim().length)throw y;e=p.getUniformLocation(x,\"mat\");f=p.getUniformLocation(x,\"translate\");p.useProgram(x);p.bindBuffer(p.ARRAY_BUFFER,p.createBuffer());p.enableVertexAttribArray(0);p.enableVertexAttribArray(1);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,p.createBuffer());p.uniform1i(p.getUniformLocation(x,\"image\"),0);p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);b=p}return!0}let b=\nnull,c=0,d=0,e=null,f=null,g=0,h=0,l=!1;a();this.pc=function(){a();return d};this.Wb=function(x){b&&b.deleteTexture&&b.deleteTexture(x)};this.Vb=function(x){if(!a())return null;const y=b.createTexture();if(!y)return null;b.bindTexture(b.TEXTURE_2D,y);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,x);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);2==\nc?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR_MIPMAP_LINEAR),b.generateMipmap(b.TEXTURE_2D)):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);return y};const n=new ea(8),t=new ea(8),u=new ea(10),r=new ea(10);this.Zb=function(x,y,p,I,K){if(a()){var v=n.push(x),N=t.push(y);if(b.canvas){if(b.canvas.width!=v||b.canvas.height!=N)b.canvas.width=v,b.canvas.height=N;b.viewport(0,N-y,x,y);b.disable(b.SCISSOR_TEST);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);b.enable(b.SCISSOR_TEST);\np.sort((G,ja)=>ja.Eb-G.Eb);v=u.push(I);g!=v&&(b.bufferData(b.ARRAY_BUFFER,8*v,b.DYNAMIC_DRAW),g=v);v=0;for(var O of p)b.bufferSubData(b.ARRAY_BUFFER,v,O.ab),v+=4*O.ab.length;console.assert(v==4*I);for(var V of p)b.bufferSubData(b.ARRAY_BUFFER,v,V.Ib),v+=4*V.Ib.length;console.assert(v==8*I);v=r.push(K);h!=v&&(b.bufferData(b.ELEMENT_ARRAY_BUFFER,2*v,b.DYNAMIC_DRAW),h=v);O=0;for(var da of p)b.bufferSubData(b.ELEMENT_ARRAY_BUFFER,O,da.indices),O+=2*da.indices.length;console.assert(O==2*K);da=0;V=!0;v=\nO=0;for(const G of p){G.image.Pa!=da&&(b.bindTexture(b.TEXTURE_2D,G.image.Na||null),da=G.image.Pa);G.tc?(b.scissor(G.ib,N-G.jb-G.rb,G.Cc,G.rb),V=!0):V&&(b.scissor(0,N-y,x,y),V=!1);p=2/x;const ja=-2/y;b.uniform4f(e,G.ha[0]*p*G.Da,G.ha[1]*ja*G.Ea,G.ha[2]*p*G.Da,G.ha[3]*ja*G.Ea);b.uniform2f(f,G.ha[4]*p*G.Da+p*(G.ib-G.qc*G.Da)-1,G.ha[5]*ja*G.Ea+ja*(G.jb-G.rc*G.Ea)+1);b.vertexAttribPointer(0,2,b.FLOAT,!1,0,v);b.vertexAttribPointer(1,2,b.FLOAT,!1,0,v+4*I);b.drawElements(b.TRIANGLES,G.indices.length,b.UNSIGNED_SHORT,\nO);v+=4*G.ab.length;O+=2*G.indices.length}console.assert(v==4*I);console.assert(O==2*K)}}};this.canvas=function(){return a()&&b.canvas}},ka=k.onRuntimeInitialized;\nk.onRuntimeInitialized=function(){function a(m){switch(m){case n.srcOver:return\"source-over\";case n.screen:return\"screen\";case n.overlay:return\"overlay\";case n.darken:return\"darken\";case n.lighten:return\"lighten\";case n.colorDodge:return\"color-dodge\";case n.colorBurn:return\"color-burn\";case n.hardLight:return\"hard-light\";case n.softLight:return\"soft-light\";case n.difference:return\"difference\";case n.exclusion:return\"exclusion\";case n.multiply:return\"multiply\";case n.hue:return\"hue\";case n.saturation:return\"saturation\";\ncase n.color:return\"color\";case n.luminosity:return\"luminosity\"}}function b(m){return\"rgba(\"+((16711680&m)>>>16)+\",\"+((65280&m)>>>8)+\",\"+((255&m)>>>0)+\",\"+((4278190080&m)>>>24)/255+\")\"}function c(){0<V.length&&(ia.Zb(O.drawWidth(),O.drawHeight(),V,da,G),V=[],G=da=0,O.reset(512,512));for(const m of v){for(const q of m.J)q();m.J=[]}v.clear()}ka&&ka();var d=k.RenderPaintStyle;const e=k.RenderPath,f=k.RenderPaint,g=k.Renderer,h=k.StrokeCap,l=k.StrokeJoin,n=k.BlendMode,t=d.fill,u=d.stroke,r=k.FillRule.evenOdd;\nlet x=1;var y=k.RenderImage.extend(\"CanvasRenderImage\",{__construct:function({oa:m,Ba:q}={}){this.__parent.__construct.call(this);this.Pa=x;x=x+1&2147483647||1;this.oa=m;this.Ba=q},__destruct:function(){this.Na&&(ia.Wb(this.Na),URL.revokeObjectURL(this.gb));this.__parent.__destruct.call(this)},decode:function(m){var q=this;q.Ba&&q.Ba(q);var B=new Image;q.gb=URL.createObjectURL(new Blob([m],{type:\"image/png\"}));B.onload=function(){q.Ob=B;q.Na=ia.Vb(B);q.size(B.width,B.height);q.oa&&q.oa(q)};B.src=\nq.gb}});class p{constructor(){this.Y=this.va=0;this.W=new Path2D}clear(){this.Y=this.va=0;this.W=new Path2D}Sb(m){for(0<this.va&&this.Y<m.length&&this.clear();this.Y<m.length;)m[this.Y++](this.W);this.va++;return this.W}release(m){m===this.W&&this.va--}}var I=e.extend(\"CanvasRenderPath\",{__construct:function(){this.__parent.__construct.call(this);this.La=[];this.W=new p;this.Ka=!1;this.la=null},rewind:function(){this.La.length=0;this.W.clear();this.Ka=!1;this.la=null},addPath:function(m,q,B,z,L,C,\nD){const A=m.Kb();this.ka(J=>{const M=new DOMMatrix;M.a=q;M.b=B;M.c=z;M.d=L;M.e=C;M.f=D;J.addPath(A,M)})},fillRule:function(m){this.fb=m},moveTo:function(m,q){this.Ka=!0;const B={lb:!0};this.la=B;this.ka(z=>{z.moveTo(m,q);B.lb&&z.lineTo(m,q)})},lineTo:function(m,q){this.eb();this.Ia();this.ka(B=>{B.lineTo(m,q)})},cubicTo:function(m,q,B,z,L,C){this.eb();this.Ia();this.ka(D=>{D.bezierCurveTo(m,q,B,z,L,C)})},close:function(){this.Ia();this.ka(m=>{m.closePath()})},eb:function(){this.Ka||this.moveTo(0,\n0)},Ia:function(){null!==this.la&&(this.la.lb=!1,this.la=null)},ka:function(m){this.La.push(m)},Ha:function(){return this.W.Sb(this.La)},hb:function(m){this.W.release(m)},Kb:function(){const m=this.Ha();this.W.clear();return m}}),K=f.extend(\"CanvasRenderPaint\",{__construct:function(){this.__parent.__construct.call(this);this.H=[];this.Ja=0;this.Ma=t;this.Qa=b(4278190080);this.Oa=1;this.ta=\"miter\";this.sa=\"butt\";this.bb=a(n.srcOver);this.ga=null},color:function(m){this.H.push(()=>{this.Qa=b(m)})},\nthickness:function(m){this.H.push(()=>{this.Oa=Math.abs(m)})},join:function(m){this.H.push(()=>{switch(m){case l.miter:this.ta=\"miter\";break;case l.round:this.ta=\"round\";break;case l.bevel:this.ta=\"bevel\"}})},cap:function(m){this.H.push(()=>{switch(m){case h.butt:this.sa=\"butt\";break;case h.round:this.sa=\"round\";break;case h.square:this.sa=\"square\"}})},style:function(m){this.H.push(()=>{this.Ma=m})},blendMode:function(m){this.H.push(()=>{this.bb=a(m)})},clearGradient:function(){this.H.push(()=>{this.ga=\nnull})},linearGradient:function(m,q,B,z){this.H.push(()=>{this.ga={Fb:m,Gb:q,nb:B,ob:z,$a:[]}})},radialGradient:function(m,q,B,z){this.H.push(()=>{this.ga={Fb:m,Gb:q,nb:B,ob:z,$a:[],nc:!0}})},addStop:function(m,q){this.H.push(()=>{this.ga.$a.push({color:m,stop:q})})},completeGradient:function(){},Lb:function(m,q,B,z){if(this.Ma!==u||0<this.Oa){var L=this.Ma,C=this.Qa,D=this.ga,A=m.globalCompositeOperation,J=m.globalAlpha;m.globalCompositeOperation=this.bb;m.globalAlpha=z;if(null!=D){C=D.Fb;const R=\nD.Gb,U=D.nb;var M=D.ob;z=D.$a;D.nc?(D=U-C,M-=R,C=m.createRadialGradient(C,R,0,C,R,Math.sqrt(D*D+M*M))):C=m.createLinearGradient(C,R,U,M);for(let W=0,Ra=z.length;W<Ra;W++)D=z[W],C.addColorStop(D.stop,b(D.color));this.Qa=C;this.ga=null}switch(L){case u:m.strokeStyle=C;m.lineWidth=this.Oa;m.lineCap=this.sa;m.lineJoin=this.ta;m.stroke(q);break;case t:m.fillStyle=C,m.fill(q,B)}m.globalCompositeOperation=A;m.globalAlpha=J}},Nb:function(){return this.Ja+this.H.length},Mb:function(m){const q=m-this.Ja;for(let B=\n0;B<q;B++)this.H[B]();this.H.splice(0,q);this.Ja=m}});const v=new Set,N=Object.prototype.hasOwnProperty;let O=null,V=[],da=0,G=0;var ja=k.CanvasRenderer=g.extend(\"Renderer\",{__construct:function(m){this.__parent.__construct.call(this);this.V=[1,0,0,1,0,0];this.G=[1];this.D=m.getContext(\"2d\");this.cb=m;this.J=[]},save:function(){this.V.push(...this.V.slice(this.V.length-6));this.G.push(this.G[this.G.length-1]);this.J.push(this.D.save.bind(this.D))},restore:function(){const m=this.V.length-6;if(6>m)throw\"restore() called without matching save().\";\nthis.V.splice(m);this.G.pop();this.J.push(this.D.restore.bind(this.D))},transform:function(m,q,B,z,L,C){const D=this.V,A=D.length-6;D.splice(A,6,D[A]*m+D[A+2]*q,D[A+1]*m+D[A+3]*q,D[A]*B+D[A+2]*z,D[A+1]*B+D[A+3]*z,D[A]*L+D[A+2]*C+D[A+4],D[A+1]*L+D[A+3]*C+D[A+5]);this.J.push(this.D.transform.bind(this.D,m,q,B,z,L,C))},rotate:function(m){const q=Math.sin(m);m=Math.cos(m);this.transform(m,q,-q,m,0,0)},modulateOpacity:function(m){this.G[this.G.length-1]*=m},_drawPath:function(m,q){const B=m.fb===r?\"evenodd\":\n\"nonzero\",z=Math.max(0,this.G[this.G.length-1]),L=m.Ha(),C=q.Nb();this.J.push(()=>{q.Mb(C);q.Lb(this.D,L,B,z);m.hb(L)})},_drawRiveImage:function(m,q,B){var z=m.Ob;if(z){var L=this.D,C=a(q),D=Math.max(0,B*this.G[this.G.length-1]);this.J.push(function(){L.globalCompositeOperation=C;L.globalAlpha=D;L.drawImage(z,0,0);L.globalAlpha=1})}},_getMatrix:function(m){const q=this.V,B=q.length-6;for(let z=0;6>z;++z)m[z]=q[B+z]},_drawImageMesh:function(m,q,B,z,L,C,D,A,J,M,R,U,W){let Ra,Tb,Ub;try{Ra=k.HEAPF32.slice(z>>\n2,(z>>2)+L),Tb=k.HEAPF32.slice(C>>2,(C>>2)+D),Ub=k.HEAPU16.slice(A>>1,(A>>1)+J)}catch(kb){console.error(\"[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.\");return}z=this.D.canvas.width;C=this.D.canvas.height;D=U-M;A=W-R;M=Math.max(M,0);R=Math.max(R,0);U=Math.min(U,z);W=Math.min(W,C);const Ga=U-M,Ha=W-R;console.assert(Ga<=Math.min(D,z));console.assert(Ha<=Math.min(A,C));if(!(0>=Ga||0>=Ha)){U=Ga<D||Ha<A;z=W=1;var qa=Math.ceil(Ga*W),ra=Math.ceil(Ha*z);C=ia.pc();\nqa>C&&(W*=C/qa,qa=C);ra>C&&(z*=C/ra,ra=C);O||(O=new k.DynamicRectanizer(C),O.reset(512,512));C=O.addRect(qa,ra);0>C&&(c(),v.add(this),C=O.addRect(qa,ra),console.assert(0<=C));var Vb=C&65535,Wb=C>>16;V.push({ha:this.V.slice(this.V.length-6),image:m,ib:Vb,jb:Wb,qc:M,rc:R,Cc:qa,rb:ra,Da:W,Ea:z,ab:Ra,Ib:Tb,indices:Ub,tc:U,Eb:m.Pa<<1|(U?1:0)});da+=L;G+=J;var wa=this.D,Wc=a(q),Xc=Math.max(0,B*this.G[this.G.length-1]);this.J.push(function(){wa.save();wa.resetTransform();wa.globalCompositeOperation=Wc;wa.globalAlpha=\nXc;const kb=ia.canvas();kb&&wa.drawImage(kb,Vb,Wb,qa,ra,M,R,Ga,Ha);wa.restore()})}},_clipPath:function(m){const q=m.fb===r?\"evenodd\":\"nonzero\",B=m.Ha();this.J.push(()=>{this.D.clip(B,q);m.hb(B)})},beginFrame:function(m=!0){v.add(this);m&&this.J.push(this.D.clearRect.bind(this.D,0,0,this.cb.width,this.cb.height))},clear:function(){this.beginFrame(!0)},flush:function(){},translate:function(m,q){this.transform(1,0,0,1,m,q)}});k.makeRenderer=function(m){const q=new ja(m),B=q.D;let z=null,L=null;const C=\n{attachSession:function(A){if(A&&z===A)return!0;if(!A||z||\"function\"!==typeof k.c2dDeferredClaim||\"function\"!==typeof k.c2dDeferredRenderer||!k.c2dDeferredClaim(A))return!1;const J=k.c2dDeferredRenderer(A);if(!J)return!1;z=A;L=J;return!0},detachSession:function(){z&&k.c2dDeferredDetach(z);L=z=null},deferredActive:function(){return null!==L}},D={save:function(){k.c2dDeferredSave(z)},restore:function(){k.c2dDeferredRestore(z)},transform:function(A,J,M,R,U,W){k.c2dDeferredTransform(z,A,J,M,R,U,W)},translate:function(A,\nJ){k.c2dDeferredTransform(z,1,0,0,1,A,J)},rotate:function(A){const J=Math.sin(A);A=Math.cos(A);k.c2dDeferredTransform(z,A,J,-J,A,0,0)},align:function(A,J,M,R,U){k.c2dDeferredAlign(z,A,J,M.minX,M.minY,M.maxX,M.maxY,R.minX,R.minY,R.maxX,R.maxY,void 0===U?1:U)},beginFrame:function(A=!0){q.beginFrame(A);k.c2dDeferredBeginFrame(z)},clear:function(){q.beginFrame(!0);k.c2dDeferredBeginFrame(z)},flush:function(){k.c2dDeferredReplay(z,q)}};return new Proxy(q,{get(A,J){if(N.call(C,J))return C[J];if(\"_deferredRecorder\"===\nJ)return L;if(null!==L&&N.call(D,J))return D[J];if(\"function\"===typeof A[J])return function(...M){return A[J].apply(A,M)};if(\"function\"===typeof B[J]){if(-1<ha.indexOf(J))throw Error(\"RiveException: Method call to '\"+J+\"()' is not allowed, as the renderer cannot immediately pass through the return                 values of any canvas 2d context methods.\");return function(...M){q.J.push(B[J].bind(B,...M))}}return A[J]},set(A,J,M){if(J in B)return q.J.push(()=>{B[J]=M}),!0}})};k.decodeImage=function(m,\nq){(new y({oa:q})).decode(m)};k.renderFactory={makeRenderPaint:function(){return new K},makeRenderPath:function(){return new I},makeRenderImage:function(){let m=lb;return new y({Ba:()=>{m.total++},oa:()=>{m.loaded++;if(m.loaded===m.total){const q=m.ready;q&&(q(),m.ready=null)}}})}};let Yc=k.load,lb=null;k.load=function(m,q,B=!0,z=null){const L=new k.FallbackFileAssetLoader;void 0!==q&&L.addLoader(q);B&&(q=new k.CDNFileAssetLoader(z),L.addLoader(q));return new Promise(function(C){let D=null;lb={total:0,\nloaded:0,ready:function(){C(D)}};D=Yc(m,L,z??null);0==lb.total&&C(D)})};const Zc=k.Artboard.prototype.draw;k.Artboard.prototype.draw=function(m){Zc.call(this,m._deferredRecorder||m)};let $c=k.RendererWrapper.prototype.align;k.RendererWrapper.prototype.align=function(m,q,B,z,L=1){$c.call(this,m,q,B,z,L)};d=new ca;k.requestAnimationFrame=d.requestAnimationFrame.bind(d);k.cancelAnimationFrame=d.cancelAnimationFrame.bind(d);k.enableFPSCounter=d.$b.bind(d);k.disableFPSCounter=d.Xb;d.xb=c;k.resolveAnimationFrame=\nc;k.cleanup=function(){O&&O.delete()}};var la=\"./this.program\";ba&&(_scriptName=self.location.href);var ma=\"\",na,oa;\nif(aa||ba){try{ma=(new URL(\".\",_scriptName)).href}catch{}ba&&(oa=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)});na=async a=>{if(pa(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open(\"GET\",a,!0);e.responseType=\"arraybuffer\";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:\"same-origin\"});if(b.ok)return b.arrayBuffer();throw Error(b.status+\n\" : \"+b.url);}}var sa=console.log.bind(console),ta=console.error.bind(console),ua,va=!1,xa,pa=a=>a.startsWith(\"file://\"),ya,za,Aa,w,Ba,Ca,E,F,Da,Ea,Fa=!1;function Ia(){var a=Ja.buffer;k.HEAP8=Aa=new Int8Array(a);Ba=new Int16Array(a);k.HEAPU8=w=new Uint8Array(a);k.HEAPU16=Ca=new Uint16Array(a);k.HEAP32=E=new Int32Array(a);k.HEAPU32=F=new Uint32Array(a);k.HEAPF32=Da=new Float32Array(a);Ea=new Float64Array(a)}\nfunction Ka(a){k.onAbort?.(a);a=\"Aborted(\"+a+\")\";ta(a);va=!0;a=new WebAssembly.RuntimeError(a+\". Build with -sASSERTIONS for more info.\");za?.(a);throw a;}var La;async function Ma(a){if(!ua)try{var b=await na(a);return new Uint8Array(b)}catch{}if(a==La&&ua)a=new Uint8Array(ua);else if(oa)a=oa(a);else throw\"both async and sync fetching of the wasm failed\";return a}\nasync function Na(a,b){try{var c=await Ma(a);return await WebAssembly.instantiate(c,b)}catch(d){ta(`failed to asynchronously prepare wasm: ${d}`),Ka(d)}}async function Oa(a){var b=La;if(!ua&&!pa(b))try{var c=fetch(b,{credentials:\"same-origin\"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){ta(`wasm streaming compile failed: ${d}`),ta(\"falling back to ArrayBuffer instantiation\")}return Na(b,a)}var H,Pa;\nclass Qa{name=\"ExitStatus\";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}\nvar Sa=a=>{for(;0<a.length;)a.shift()(k)},Ta=[],Ua=[],Va=()=>{var a=k.preRun.shift();Ua.push(a)},Wa=!0,Ya=()=>{var a=E[+Xa>>2];Xa+=4;return a},Za=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];\".\"===e?a.splice(d,1):\"..\"===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift(\"..\");return a},$a=a=>{var b=\"/\"===a.charAt(0),c=\"/\"===a.slice(-1);(a=Za(a.split(\"/\").filter(d=>!!d),!b).join(\"/\"))||b||(a=\".\");a&&c&&(a+=\"/\");return(b?\"/\":\"\")+a},ab=a=>{var b=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(a).slice(1);\na=b[0];b=b[1];if(!a&&!b)return\".\";b&&=b.slice(0,-1);return a+b},bb=()=>a=>crypto.getRandomValues(a),cb=a=>{(cb=bb())(a)},db=(...a)=>{for(var b=\"\",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:\"/\";if(\"string\"!=typeof c)throw new TypeError(\"Arguments to path.resolve must be strings\");if(!c)return\"\";b=c+\"/\"+b;c=\"/\"===c.charAt(0)}b=Za(b.split(\"/\").filter(e=>!!e),!c).join(\"/\");return(c?\"/\":\"\")+b||\".\"},eb=globalThis.TextDecoder&&new TextDecoder,fb=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;\nreturn b},gb=(a,b=0,c,d)=>{c=fb(a,b,c,d);if(16<c-b&&a.buffer&&eb)return eb.decode(a.subarray(b,c));for(d=\"\";b<c;){var e=a[b++];if(e&128){var f=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var g=a[b++]&63;e=224==(e&240)?(e&15)<<12|f<<6|g:(e&7)<<18|f<<12|g<<6|a[b++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},hb=[],ib=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:\n2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},jb=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var f=0;f<a.length;++f){var g=a.codePointAt(f);if(127>=g){if(c>=d)break;b[c++]=g}else if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6;b[c++]=128|g&63}else if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12;b[c++]=128|g>>6&63;b[c++]=128|g&63}else{if(c+3>=d)break;b[c++]=240|g>>18;b[c++]=128|g>>12&63;b[c++]=128|g>>6&63;b[c++]=128|g&63;f++}}b[c]=0;return c-e},mb=[];\nfunction nb(a,b){mb[a]={input:[],output:[],$:b};ob(a,pb)}\nvar pb={open(a){var b=mb[a.node.Ca];if(!b)throw new P(43);a.s=b;a.seekable=!1},close(a){a.s.$.ua(a.s)},ua(a){a.s.$.ua(a.s)},read(a,b,c,d){if(!a.s||!a.s.$.qb)throw new P(60);for(var e=0,f=0;f<d;f++){try{var g=a.s.$.qb(a.s)}catch(h){throw new P(29);}if(void 0===g&&0===e)throw new P(6);if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.ea=Date.now());return e},write(a,b,c,d){if(!a.s||!a.s.$.Xa)throw new P(60);try{for(var e=0;e<d;e++)a.s.$.Xa(a.s,b[c+e])}catch(f){throw new P(29);}d&&(a.node.O=a.node.K=\nDate.now());return e}},qb={qb(){a:{if(!hb.length){var a=null;globalThis.window?.prompt&&(a=window.prompt(\"Input: \"),null!==a&&(a+=\"\\n\"));if(!a){var b=null;break a}b=Array(ib(a)+1);a=jb(a,b,0,b.length);b.length=a;hb=b}b=hb.shift()}return b},Xa(a,b){null===b||10===b?(sa(gb(a.output)),a.output=[]):0!=b&&a.output.push(b)},ua(a){0<a.output?.length&&(sa(gb(a.output)),a.output=[])},kc(){return{Kc:25856,Mc:5,Jc:191,Lc:35387,Ic:[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]}},\nlc(){return 0},mc(){return[24,80]}},rb={Xa(a,b){null===b||10===b?(ta(gb(a.output)),a.output=[]):0!=b&&a.output.push(b)},ua(a){0<a.output?.length&&(ta(gb(a.output)),a.output=[])}},Q={S:null,Z(){return Q.createNode(null,\"/\",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new P(63);Q.S||(Q.S={dir:{node:{ca:Q.l.ca,U:Q.l.U,na:Q.l.na,za:Q.l.za,Bb:Q.l.Bb,Hb:Q.l.Hb,Db:Q.l.Db,Za:Q.l.Za,Ga:Q.l.Ga},stream:{R:Q.i.R}},file:{node:{ca:Q.l.ca,U:Q.l.U},stream:{R:Q.i.R,read:Q.i.read,write:Q.i.write,\nub:Q.i.ub,wb:Q.i.wb}},link:{node:{ca:Q.l.ca,U:Q.l.U,pa:Q.l.pa},stream:{}},kb:{node:{ca:Q.l.ca,U:Q.l.U},stream:sb}});c=tb(a,b,c,d);16384===(c.mode&61440)?(c.l=Q.S.dir.node,c.i=Q.S.dir.stream,c.j={}):32768===(c.mode&61440)?(c.l=Q.S.file.node,c.i=Q.S.file.stream,c.B=0,c.j=null):40960===(c.mode&61440)?(c.l=Q.S.link.node,c.i=Q.S.link.stream):8192===(c.mode&61440)&&(c.l=Q.S.kb.node,c.i=Q.S.kb.stream);c.ea=c.O=c.K=Date.now();a&&(a.j[b]=c,a.ea=a.O=a.K=c.ea);return c},Qc(a){return a.j?a.j.subarray?a.j.subarray(0,\na.B):new Uint8Array(a.j):new Uint8Array(0)},l:{ca(a){var b={};b.Nc=8192===(a.mode&61440)?a.id:1;b.Sc=a.id;b.mode=a.mode;b.Uc=1;b.uid=0;b.Rc=0;b.Ca=a.Ca;16384===(a.mode&61440)?b.size=4096:32768===(a.mode&61440)?b.size=a.B:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.ea=new Date(a.ea);b.O=new Date(a.O);b.K=new Date(a.K);b.Tb=4096;b.Hc=Math.ceil(b.size/b.Tb);return b},U(a,b){for(var c of[\"mode\",\"atime\",\"mtime\",\"ctime\"])null!=b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.B!=b&&(0==b?(a.j=null,\na.B=0):(c=a.j,a.j=new Uint8Array(b),c&&a.j.set(c.subarray(0,Math.min(b,a.B))),a.B=b)))},na(){Q.Ra||(Q.Ra=new P(44),Q.Ra.stack=\"<generic error, no stack>\");throw Q.Ra;},za(a,b,c,d){return Q.createNode(a,b,c,d)},Bb(a,b,c){try{var d=ub(b,c)}catch(f){}if(d){if(16384===(a.mode&61440))for(var e in d.j)throw new P(55);e=vb(d.parent.id,d.name);if(wb[e]===d)wb[e]=d.ia;else for(e=wb[e];e;){if(e.ia===d){e.ia=d.ia;break}e=e.ia}}delete a.parent.j[a.name];b.j[c]=a;a.name=c;b.K=b.O=a.parent.K=a.parent.O=Date.now()},\nHb(a,b){delete a.j[b];a.K=a.O=Date.now()},Db(a,b){var c=ub(a,b),d;for(d in c.j)throw new P(55);delete a.j[b];a.K=a.O=Date.now()},Za(a){return[\".\",\"..\",...Object.keys(a.j)]},Ga(a,b,c){a=Q.createNode(a,b,41471,0);a.link=c;return a},pa(a){if(40960!==(a.mode&61440))throw new P(28);return a.link}},i:{read(a,b,c,d,e){var f=a.node.j;if(e>=a.node.B)return 0;a=Math.min(a.node.B-e,d);if(8<a&&f.subarray)b.set(f.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=f[e+d];return a},write(a,b,c,d,e,f){b.buffer===Aa.buffer&&\n(f=!1);if(!d)return 0;a=a.node;a.O=a.K=Date.now();if(b.subarray&&(!a.j||a.j.subarray)){if(f)return a.j=b.subarray(c,c+d),a.B=d;if(0===a.B&&0===e)return a.j=b.slice(c,c+d),a.B=d;if(e+d<=a.B)return a.j.set(b.subarray(c,c+d),e),d}f=e+d;var g=a.j?a.j.length:0;g>=f||(f=Math.max(f,g*(1048576>g?2:1.125)>>>0),0!=g&&(f=Math.max(f,256)),g=a.j,a.j=new Uint8Array(f),0<a.B&&a.j.set(g.subarray(0,a.B),0));if(a.j.subarray&&b.subarray)a.j.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.j[e+f]=b[c+f];a.B=Math.max(a.B,\ne+d);return d},R(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.B);if(0>b)throw new P(28);return b},ub(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new P(43);a=a.node.j;if(e&2||!a||a.buffer!==Aa.buffer){d=!0;Ka();e=void 0;if(!e)throw new P(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);Aa.set(a,e)}}else d=!1,e=a.byteOffset;return{m:e,Gc:d}},wb(a,b,c,d){Q.i.write(a,b,0,d,c,!1);return 0}}},xb=(a,b)=>{var c=0;a&&(c|=365);\nb&&(c|=146);return c},yb=null,zb={},Ab=[],Bb=1,wb=null,Cb=!1,Db=!0,Eb={},P=class{name=\"ErrnoError\";constructor(a){this.aa=a}},Fb=class{Y={};node=null;get flags(){return this.Y.flags}set flags(a){this.Y.flags=a}get position(){return this.Y.position}set position(a){this.Y.position=a}},Gb=class{l={};i={};Aa=null;constructor(a,b,c,d){a||=this;this.parent=a;this.Z=a.Z;this.id=Bb++;this.name=b;this.mode=c;this.Ca=d;this.ea=this.O=this.K=Date.now()}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=\n365:this.mode&=-366}get write(){return 146===(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}};\nfunction Hb(a,b={}){if(!a)throw new P(44);b.Ta??(b.Ta=!0);\"/\"===a.charAt(0)||(a=\"//\"+a);var c=0;a:for(;40>c;c++){a=a.split(\"/\").filter(h=>!!h);for(var d=yb,e=\"/\",f=0;f<a.length;f++){var g=f===a.length-1;if(g&&b.parent)break;if(\".\"!==a[f])if(\"..\"===a[f])if(e=ab(e),d===d.parent){a=e+\"/\"+a.slice(f+1).join(\"/\");c--;continue a}else d=d.parent;else{e=$a(e+\"/\"+a[f]);try{d=ub(d,a[f])}catch(h){if(44===h?.aa&&g&&b.uc)return{path:e};throw h;}!d.Aa||g&&!b.Ta||(d=d.Aa.root);if(40960===(d.mode&61440)&&(!g||b.Sa)){if(!d.l.pa)throw new P(52);\nd=d.l.pa(d);\"/\"===d.charAt(0)||(d=ab(e)+\"/\"+d);a=d+\"/\"+a.slice(f+1).join(\"/\");continue a}}}return{path:e,node:d}}throw new P(32);}function vb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%wb.length}function ub(a,b){var c=16384===(a.mode&61440)?(c=Ib(a,\"x\"))?c:a.l.na?0:2:54;if(c)throw new P(c);for(c=wb[vb(a.id,b)];c;c=c.ia){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.l.na(a,b)}\nfunction tb(a,b,c,d){a=new Gb(a,b,c,d);b=vb(a.parent.id,a.name);a.ia=wb[b];return wb[b]=a}function Jb(a){var b=[\"r\",\"w\",\"rw\"][a&3];a&512&&(b+=\"w\");return b}function Ib(a,b){if(Db)return 0;if(!b.includes(\"r\")||a.mode&292){if(b.includes(\"w\")&&!(a.mode&146)||b.includes(\"x\")&&!(a.mode&73))return 2}else return 2;return 0}function Kb(a,b){if(16384!==(a.mode&61440))return 54;try{return ub(a,b),20}catch(c){}return Ib(a,\"wx\")}function Lb(a){a=Ab[a];if(!a)throw new P(8);return a}\nfunction Mb(a,b=-1){a=Object.assign(new Fb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Ab[b])break a;throw new P(33);}a.ba=b;return Ab[b]=a}function Nb(a,b=-1){a=Mb(a,b);a.i?.Pc?.(a);return a}function Ob(a,b){var c=null?.i.U,d=c?null:a;c??=a.l.U;if(!c)throw new P(63);c(d,b)}var sb={open(a){a.i=zb[a.node.Ca].i;a.i.open?.(a)},R(){throw new P(70);}};function ob(a,b){zb[a]={i:b}}\nfunction Pb(a,b){var c=\"/\"===b;if(c&&yb)throw new P(10);if(!c&&b){var d=Hb(b,{Ta:!1});b=d.path;d=d.node;if(d.Aa)throw new P(10);if(16384!==(d.mode&61440))throw new P(54);}b={type:a,Vc:{},vb:b,sc:[]};a=a.Z(b);a.Z=b;b.root=a;c?yb=a:d&&(d.Aa=b,d.Z&&d.Z.sc.push(b))}function Qb(a,b,c){var d=Hb(a,{parent:!0}).node;a=a&&a.match(/([^\\/]+|\\/)\\/*$/)[1];if(!a)throw new P(28);if(\".\"===a||\"..\"===a)throw new P(20);var e=Kb(d,a);if(e)throw new P(e);if(!d.l.za)throw new P(63);return d.l.za(d,a,b,c)}\nfunction Rb(a){return Qb(a,16895,0)}function Sb(a,b,c){\"undefined\"==typeof c&&(c=b,b=438);Qb(a,b|8192,c)}function Xb(a,b){if(!db(a))throw new P(44);var c=Hb(b,{parent:!0}).node;if(!c)throw new P(44);b=b&&b.match(/([^\\/]+|\\/)\\/*$/)[1];var d=Kb(c,b);if(d)throw new P(d);if(!c.l.Ga)throw new P(63);c.l.Ga(c,b,a)}\nfunction Yb(a,b,c=438){if(\"\"===a)throw new P(44);if(\"string\"==typeof b){var d={r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090}[b];if(\"undefined\"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?c&4095|32768:0;if(\"object\"==typeof a)d=a;else{var e=a.endsWith(\"/\");a=Hb(a,{Sa:!(b&131072),uc:!0});d=a.node;a=a.path}var f=!1;if(b&64)if(d){if(b&128)throw new P(20);}else{if(e)throw new P(31);d=Qb(a,c|511,0);f=!0}if(!d)throw new P(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&16384!==(d.mode&\n61440))throw new P(54);if(!f&&(e=d?40960===(d.mode&61440)?32:16384===(d.mode&61440)&&(\"r\"!==Jb(b)||b&576)?31:Ib(d,Jb(b)):44))throw new P(e);if(b&512&&!f){e=d;e=\"string\"==typeof e?Hb(e,{Sa:!0}).node:e;if(16384===(e.mode&61440))throw new P(31);if(32768!==(e.mode&61440))throw new P(28);var g=Ib(e,\"w\");if(g)throw new P(g);Ob(e,{size:0,timestamp:Date.now()})}b&=-131713;a:for(e=d;;){if(e===e.parent){e=e.Z.vb;var h=h?\"/\"!==e[e.length-1]?`${e}/${h}`:e+h:e;break a}h=h?`${e.name}/${h}`:e.name;e=e.parent}h=\nMb({node:d,path:h,flags:b,seekable:!0,position:0,i:d.i,Bc:[],error:!1});h.i.open&&h.i.open(h);f&&(c&=511,d=\"string\"==typeof d?Hb(d,{Sa:!0}).node:d,Ob(d,{mode:c&4095|d.mode&-4096,K:Date.now(),Oc:void 0}));!k.logReadFiles||b&1||a in Eb||(Eb[a]=1);return h}function Zb(a,b,c){if(null===a.ba)throw new P(8);if(!a.seekable||!a.i.R)throw new P(70);if(0!=c&&1!=c&&2!=c)throw new P(28);a.position=a.i.R(a,b,c);a.Bc=[]}\nfunction $b(a,b,c){a=$a(\"/dev/\"+a);var d=xb(!!b,!!c);$b.tb??($b.tb=64);var e=$b.tb++<<8|0;ob(e,{open(f){f.seekable=!1},close(){c?.buffer?.length&&c(10)},read(f,g,h,l){for(var n=0,t=0;t<l;t++){try{var u=b()}catch(r){throw new P(29);}if(void 0===u&&0===n)throw new P(6);if(null===u||void 0===u)break;n++;g[h+t]=u}n&&(f.node.ea=Date.now());return n},write(f,g,h,l){for(var n=0;n<l;n++)try{c(g[h+n])}catch(t){throw new P(29);}l&&(f.node.O=f.node.K=Date.now());return n}});Sb(a,d,e)}\nvar ac={},Xa=void 0,bc=(a,b)=>Object.defineProperty(b,\"name\",{value:a}),cc=[],dc=[0,1,,1,null,1,!0,1,!1,1],S=class extends Error{constructor(a){super(a);this.name=\"BindingError\"}},ec=a=>{if(!a)throw new S(`Cannot use deleted val. handle = ${a}`);return dc[a]},fc=a=>{switch(a){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const b=cc.pop()||dc.length;dc[b]=a;dc[b+1]=1;return b}};class gc extends Error{}\nvar T=a=>{for(var b=\"\";;){var c=w[a++];if(!c)return b;b+=String.fromCharCode(c)}},hc={},ic=(a,b)=>{if(void 0===b)throw new S(\"ptr should not be undefined\");for(;a.C;)b=a.qa(b),a=a.C;return b},jc={},mc=a=>{a=kc(a);var b=T(a);lc(a);return b},nc=(a,b)=>{var c=jc[a];if(void 0===c)throw a=`${b} has unknown type ${mc(a)}`,new S(a);return c},oc=()=>{},pc=!1,qc=a=>{if(!globalThis.FinalizationRegistry)return qc=b=>b,a;pc=new FinalizationRegistry(b=>{b=b.g;--b.count.value;0===b.count.value&&(b.F?b.M.T(b.F):\nb.u.h.T(b.m))});qc=b=>{var c=b.g;c.F&&pc.register(b,{g:c},b);return b};oc=b=>{pc.unregister(b)};return qc(a)},rc={},sc=a=>{for(;a.length;){var b=a.pop();a.pop()(b)}};function tc(a){return this.o(F[a>>2])}\nvar uc={},vc={},wc=class extends Error{constructor(a){super(a);this.name=\"InternalError\"}},Y=(a,b,c)=>{function d(h){h=c(h);if(h.length!==a.length)throw new wc(\"Mismatched type converter count\");for(var l=0;l<a.length;++l)X(a[l],h[l])}a.forEach(h=>vc[h]=b);var e=Array(b.length),f=[],g=0;for(let [h,l]of b.entries())jc.hasOwnProperty(l)?e[h]=jc[l]:(f.push(l),uc.hasOwnProperty(l)||(uc[l]=[]),uc[l].push(()=>{e[h]=jc[l];++g;g===f.length&&d(e)}));0===f.length&&d(e)};\nfunction xc(a,b,c={}){var d=b.name;if(!a)throw new S(`type \"${d}\" must have a positive integer typeid pointer`);if(jc.hasOwnProperty(a)){if(c.ic)return;throw new S(`Cannot register type '${d}' twice`);}jc[a]=b;delete vc[a];uc.hasOwnProperty(a)&&(b=uc[a],delete uc[a],b.forEach(e=>e()))}function X(a,b,c={}){return xc(a,b,c)}var yc=a=>{throw new S(a.g.u.h.name+\" instance already deleted\");},zc=[];function Ac(){}\nvar Bc={},Cc=(a,b,c)=>{if(void 0===a[b].v){var d=a[b];a[b]=function(...e){if(!a[b].v.hasOwnProperty(e.length))throw new S(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${a[b].v})!`);return a[b].v[e.length].apply(this,e)};a[b].v=[];a[b].v[d.X]=d}},Dc=(a,b,c)=>{if(k.hasOwnProperty(a)){if(void 0===c||void 0!==k[a].v&&void 0!==k[a].v[c])throw new S(`Cannot register public name '${a}' twice`);Cc(k,a,a);if(k[a].v.hasOwnProperty(c))throw new S(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);\nk[a].v[c]=b}else k[a]=b,k[a].X=c},Ec=a=>{a=a.replace(/[^a-zA-Z0-9_]/g,\"$\");var b=a.charCodeAt(0);return 48<=b&&57>=b?`_${a}`:a};function Fc(a,b,c,d,e,f,g,h){this.name=a;this.constructor=b;this.P=c;this.T=d;this.C=e;this.cc=f;this.qa=g;this.Yb=h;this.zb=[]}\nvar Gc=(a,b,c)=>{for(;b!==c;){if(!b.qa)throw new S(`Expected null or instance of ${c.name}, got an instance of ${b.name}`);a=b.qa(a);b=b.C}return a},Hc=a=>{if(null===a)return\"null\";var b=typeof a;return\"object\"===b||\"array\"===b||\"function\"===b?a.toString():\"\"+a};\nfunction Ic(a,b){if(null===b){if(this.Va)throw new S(`null is not a valid ${this.name}`);return 0}if(!b.g)throw new S(`Cannot pass \"${Hc(b)}\" as a ${this.name}`);if(!b.g.m)throw new S(`Cannot pass deleted object as a pointer of type ${this.name}`);return Gc(b.g.m,b.g.u.h,this.h)}\nfunction Jc(a,b){if(null===b){if(this.Va)throw new S(`null is not a valid ${this.name}`);if(this.ya){var c=this.Ya();null!==a&&a.push(this.T,c);return c}return 0}if(!b||!b.g)throw new S(`Cannot pass \"${Hc(b)}\" as a ${this.name}`);if(!b.g.m)throw new S(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.xa&&b.g.u.xa)throw new S(`Cannot convert argument of type ${b.g.M?b.g.M.name:b.g.u.name} to parameter type ${this.name}`);c=Gc(b.g.m,b.g.u.h,this.h);if(this.ya){if(void 0===b.g.F)throw new S(\"Passing raw pointer to smart pointer is illegal\");\nswitch(this.Ac){case 0:if(b.g.M===this)c=b.g.F;else throw new S(`Cannot convert argument of type ${b.g.M?b.g.M.name:b.g.u.name} to parameter type ${this.name}`);break;case 1:c=b.g.F;break;case 2:if(b.g.M===this)c=b.g.F;else{var d=b.clone();c=this.wc(c,fc(()=>d[\"delete\"]()));null!==a&&a.push(this.T,c)}break;default:throw new S(\"Unsupported sharing policy\");}}return c}\nfunction Kc(a,b){if(null===b){if(this.Va)throw new S(`null is not a valid ${this.name}`);return 0}if(!b.g)throw new S(`Cannot pass \"${Hc(b)}\" as a ${this.name}`);if(!b.g.m)throw new S(`Cannot pass deleted object as a pointer of type ${this.name}`);if(b.g.u.xa)throw new S(`Cannot convert argument of type ${b.g.u.name} to parameter type ${this.name}`);return Gc(b.g.m,b.g.u.h,this.h)}\nvar Lc=(a,b,c)=>{if(b===c)return a;if(void 0===c.C)return null;a=Lc(a,b,c.C);return null===a?null:c.Yb(a)},Mc=(a,b)=>{b=ic(a,b);return hc[b]},Nc=(a,b)=>{if(!b.u||!b.m)throw new wc(\"makeClassHandle requires ptr and ptrType\");if(!!b.M!==!!b.F)throw new wc(\"Both smartPtrType and smartPtr must be specified\");b.count={value:1};return qc(Object.create(a,{g:{value:b,writable:!0}}))};\nfunction Oc(a,b,c,d,e,f,g,h,l,n,t){this.name=a;this.h=b;this.Va=c;this.xa=d;this.ya=e;this.vc=f;this.Ac=g;this.Ab=h;this.Ya=l;this.wc=n;this.T=t;e||void 0!==b.C?this.A=Jc:(this.A=d?Ic:Kc,this.I=null)}\nvar Pc=(a,b,c)=>{if(!k.hasOwnProperty(a))throw new wc(\"Replacing nonexistent public symbol\");void 0!==k[a].v&&void 0!==c?k[a].v[c]=b:(k[a]=b,k[a].X=c)},Qc={},Sc=(a,b,c=[])=>{a.includes(\"j\")?(a=a.replace(/p/g,\"i\"),b=(0,Qc[a])(b,...c)):b=Rc.get(b)(...c);return b},Tc=(a,b)=>(...c)=>Sc(a,b,c),Z=(a,b)=>{a=T(a);var c=a.includes(\"j\")?Tc(a,b):Rc.get(b);if(\"function\"!=typeof c)throw new S(`unknown function pointer with signature ${a}: ${b}`);return c};class Uc extends Error{}\nvar Vc=(a,b)=>{function c(f){e[f]||jc[f]||(vc[f]?vc[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};b.forEach(c);throw new Uc(`${a}: `+d.map(mc).join([\", \"]));};function ad(a){for(var b=1;b<a.length;++b)if(null!==a[b]&&void 0===a[b].I)return!0;return!1}\nfunction bd(a,b,c,d,e){var f=b.length;if(2>f)throw new S(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");var g=null!==b[1]&&null!==c,h=ad(b),l=!b[0].oc,n=f-2,t=Array(n),u=[],r=[];return bc(a,function(...x){r.length=0;u.length=g?2:1;u[0]=e;if(g){var y=b[1].A(r,this);u[1]=y}for(var p=0;p<n;++p)t[p]=b[p+2].A(r,x[p]),u.push(t[p]);x=d(...u);if(h)sc(r);else for(p=g?1:2;p<b.length;p++){var I=1===p?y:t[p-2];null!==b[p].I&&b[p].I(I)}y=l?b[0].o(x):void 0;return y})}\nvar cd=(a,b)=>{for(var c=[],d=0;d<a;d++)c.push(F[b+4*d>>2]);return c},dd=a=>{a=a.trim();const b=a.indexOf(\"(\");return-1===b?a:a.slice(0,b)},ed=(a,b,c)=>{if(!(a instanceof Object))throw new S(`${c} with invalid \"this\": ${a}`);if(!(a instanceof b.h.constructor))throw new S(`${c} incompatible with \"this\" of type ${a.constructor.name}`);if(!a.g.m)throw new S(`cannot call emscripten binding method ${c} on deleted object`);return Gc(a.g.m,a.g.u.h,b.h)},fd=a=>{9<a&&0===--dc[a+1]&&(dc[a]=void 0,cc.push(a))},\ngd={name:\"emscripten::val\",o:a=>{var b=ec(a);fd(a);return b},A:(a,b)=>fc(b),L:tc,I:null},hd=(a,b,c)=>{switch(b){case 1:return c?function(d){return this.o(Aa[d])}:function(d){return this.o(w[d])};case 2:return c?function(d){return this.o(Ba[d>>1])}:function(d){return this.o(Ca[d>>1])};case 4:return c?function(d){return this.o(E[d>>2])}:function(d){return this.o(F[d>>2])};default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},jd=(a,b)=>{switch(b){case 4:return function(c){return this.o(Da[c>>\n2])};case 8:return function(c){return this.o(Ea[c>>3])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}},kd=(a,b,c)=>{switch(b){case 1:return c?d=>Aa[d]:d=>w[d];case 2:return c?d=>Ba[d>>1]:d=>Ca[d>>1];case 4:return c?d=>E[d>>2]:d=>F[d>>2];default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},ld=globalThis.TextDecoder?new TextDecoder(\"utf-16le\"):void 0,md=(a,b,c)=>{a>>=1;b=fb(Ca,a,b/2,c);if(16<b-a&&ld)return ld.decode(Ca.subarray(a,b));for(c=\"\";a<b;++a)c+=String.fromCharCode(Ca[a]);\nreturn c},nd=(a,b,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var e=0;e<c;++e)Ba[b>>1]=a.charCodeAt(e),b+=2;Ba[b>>1]=0;return b-d},od=a=>2*a.length,pd=(a,b,c)=>{var d=\"\";a>>=2;for(var e=0;!(e>=b/4);e++){var f=F[a+e];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},qd=(a,b,c)=>{c??=2147483647;if(4>c)return 0;var d=b;c=d+c-4;for(var e=0;e<a.length;++e){var f=a.codePointAt(e);65535<f&&e++;E[b>>2]=f;b+=4;if(b+4>c)break}E[b>>2]=0;return b-d},rd=a=>{for(var b=0,\nc=0;c<a.length;++c)65535<a.codePointAt(c)&&c++,b+=4;return b},sd=0,td=[],ud=a=>{var b=td.length;td.push(a);return b},vd=(a,b)=>{for(var c=Array(a),d=0;d<a;++d)c[d]=nc(F[b+4*d>>2],`parameter ${d}`);return c},wd={},xd=a=>{var b=wd[a];return void 0===b?T(a):b},yd=[0,31,60,91,121,152,182,213,244,274,305,335],zd=[0,31,59,90,120,151,181,212,243,273,304,334],Ad={},Bd=a=>{if(!(a instanceof Qa||\"unwind\"==a))throw a;},Cd=a=>{xa=a;Wa||0<sd||(k.onExit?.(a),va=!0);throw new Qa(a);},Dd=a=>{if(!va)try{if(a(),!(Wa||\n0<sd))try{xa=a=xa,Cd(a)}catch(b){Bd(b)}}catch(b){Bd(b)}},Ed=[],Fd={},Hd=()=>{if(!Gd){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(globalThis.navigator?.language??\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:la||\"./this.program\"},b;for(b in Fd)void 0===Fd[b]?delete a[b]:a[b]=Fd[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Gd=c}return Gd},Gd;wb=Array(4096);Pb(Q,\"/\");Rb(\"/tmp\");Rb(\"/home\");Rb(\"/home/web_user\");\n(function(){Rb(\"/dev\");ob(259,{read:()=>0,write:(d,e,f,g)=>g,R:()=>0});Sb(\"/dev/null\",259);nb(1280,qb);nb(1536,rb);Sb(\"/dev/tty\",1280);Sb(\"/dev/tty1\",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(cb(a),b=a.byteLength);return a[--b]};$b(\"random\",c);$b(\"urandom\",c);Rb(\"/dev/shm\");Rb(\"/dev/shm/tmp\")})();\n(function(){Rb(\"/proc\");var a=Rb(\"/proc/self\");Rb(\"/proc/self/fd\");Pb({Z(){var b=tb(a,\"fd\",16895,73);b.i={R:Q.i.R};b.l={na(c,d){c=+d;var e=Lb(c);c={parent:null,Z:{vb:\"fake\"},l:{pa:()=>e.path},id:c+1};return c.parent=c},Za(){return Array.from(Ab.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},\"/proc/self/fd\")})();\n(()=>{let a=Ac.prototype;Object.assign(a,{isAliasOf:function(c){if(!(this instanceof Ac&&c instanceof Ac))return!1;var d=this.g.u.h,e=this.g.m;c.g=c.g;var f=c.g.u.h;for(c=c.g.m;d.C;)e=d.qa(e),d=d.C;for(;f.C;)c=f.qa(c),f=f.C;return d===f&&e===c},clone:function(){this.g.m||yc(this);if(this.g.ja)return this.g.count.value+=1,this;var c=qc,d=Object,e=d.create,f=Object.getPrototypeOf(this),g=this.g;c=c(e.call(d,f,{g:{value:{count:g.count,ma:g.ma,ja:g.ja,m:g.m,u:g.u,F:g.F,M:g.M}}}));c.g.count.value+=1;c.g.ma=\n!1;return c},[\"delete\"](){this.g.m||yc(this);if(this.g.ma&&!this.g.ja)throw new S(\"Object already scheduled for deletion\");oc(this);var c=this.g;--c.count.value;0===c.count.value&&(c.F?c.M.T(c.F):c.u.h.T(c.m));this.g.ja||(this.g.F=void 0,this.g.m=void 0)},isDeleted:function(){return!this.g.m},deleteLater:function(){this.g.m||yc(this);if(this.g.ma&&!this.g.ja)throw new S(\"Object already scheduled for deletion\");zc.push(this);this.g.ma=!0;return this}});const b=Symbol.dispose;b&&(a[b]=a[\"delete\"])})();\nObject.assign(Oc.prototype,{dc(a){this.Ab&&(a=this.Ab(a));return a},mb(a){this.T?.(a)},L:tc,o:function(a){function b(){return this.ya?Nc(this.h.P,{u:this.vc,m:c,M:this,F:a}):Nc(this.h.P,{u:this,m:a})}var c=this.dc(a);if(!c)return this.mb(a),null;var d=Mc(this.h,c);if(void 0!==d){if(0===d.g.count.value)return d.g.m=c,d.g.F=a,d.clone();d=d.clone();this.mb(a);return d}d=this.h.cc(c);d=Bc[d];if(!d)return b.call(this);d=this.xa?d.Ub:d.pointerType;var e=Lc(c,this.h,d.h);return null===e?b.call(this):this.ya?\nNc(d.h.P,{u:d,m:e,M:this,F:a}):Nc(d.h.P,{u:d,m:e})}});k.noExitRuntime&&(Wa=k.noExitRuntime);k.print&&(sa=k.print);k.printErr&&(ta=k.printErr);k.wasmBinary&&(ua=k.wasmBinary);k.thisProgram&&(la=k.thisProgram);if(k.preInit)for(\"function\"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();\nvar Ld={258990:(a,b,c,d,e)=>{if(\"undefined\"===typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(\"undefined\"===typeof window.miniaudio){window.miniaudio={referenceCount:0};window.miniaudio.device_type={};window.miniaudio.device_type.playback=a;window.miniaudio.device_type.capture=b;window.miniaudio.device_type.duplex=c;window.miniaudio.device_state={};window.miniaudio.device_state.stopped=d;window.miniaudio.device_state.started=e;let f=window.miniaudio;f.devices=\n[];f.track_device=function(g){for(var h=0;h<f.devices.length;++h)if(null==f.devices[h])return f.devices[h]=g,h;f.devices.push(g);return f.devices.length-1};f.untrack_device_by_index=function(g){for(f.devices[g]=null;0<f.devices.length;)if(null==f.devices[f.devices.length-1])f.devices.pop();else break};f.untrack_device=function(g){for(var h=0;h<f.devices.length;++h)if(f.devices[h]==g)return f.untrack_device_by_index(h)};f.get_device_by_index=function(g){return f.devices[g]};f.unlock_event_types=[\"touchend\",\n\"click\"];f.unlock=function(){for(var g=0;g<f.devices.length;++g){var h=f.devices[g];null!=h&&null!=h.N&&h.state===f.device_state.started&&h.N.resume().then(()=>{Id(h.yb)},l=>{console.error(\"Failed to resume audiocontext\",l)})}f.unlock_event_types.map(function(l){document.removeEventListener(l,f.unlock,!0)})};f.unlock_event_types.map(function(g){document.addEventListener(g,f.unlock,!0)})}window.miniaudio.referenceCount+=1;return 1},261168:()=>{\"undefined\"!==typeof window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(a){document.removeEventListener(a,\nwindow.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},261472:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,261576:()=>{try{var a=new (window.AudioContext||window.webkitAudioContext),b=a.sampleRate;a.close();return b}catch(c){return 0}},261747:(a,b,c,d,e,f)=>{if(\"undefined\"===typeof window.miniaudio)return-1;var g={},h={};a==window.miniaudio.device_type.playback&&0!=c&&(h.sampleRate=c);g.N=\nnew (window.AudioContext||window.webkitAudioContext)(h);g.N.suspend();g.state=window.miniaudio.device_state.stopped;c=0;a!=window.miniaudio.device_type.playback&&(c=b);g.da=g.N.createScriptProcessor(d,c,b);g.da.onaudioprocess=function(l){if(null==g.wa||0==g.wa.length)g.wa=new Float32Array(Da.buffer,e,d*b);if(a==window.miniaudio.device_type.capture||a==window.miniaudio.device_type.duplex){for(var n=0;n<b;n+=1)for(var t=l.inputBuffer.getChannelData(n),u=g.wa,r=0;r<d;r+=1)u[r*b+n]=t[r];Jd(f,d,e)}if(a==\nwindow.miniaudio.device_type.playback||a==window.miniaudio.device_type.duplex)for(Kd(f,d,e),n=0;n<l.outputBuffer.numberOfChannels;++n)for(t=l.outputBuffer.getChannelData(n),u=g.wa,r=0;r<d;r+=1)t[r]=u[r*b+n];else for(n=0;n<l.outputBuffer.numberOfChannels;++n)l.outputBuffer.getChannelData(n).fill(0)};a!=window.miniaudio.device_type.capture&&a!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(l){g.Fa=g.N.createMediaStreamSource(l);g.Fa.connect(g.da);\ng.da.connect(g.N.destination)}).catch(function(l){console.log(\"Failed to get user media: \"+l)});a==window.miniaudio.device_type.playback&&g.da.connect(g.N.destination);g.yb=f;return window.miniaudio.track_device(g)},264624:a=>window.miniaudio.get_device_by_index(a).N.sampleRate,264697:a=>{a=window.miniaudio.get_device_by_index(a);void 0!==a.da&&(a.da.onaudioprocess=function(){},a.da.disconnect(),a.da=void 0);void 0!==a.Fa&&(a.Fa.disconnect(),a.Fa=void 0);a.N.close();a.N=void 0;a.yb=void 0},265097:a=>\n{window.miniaudio.untrack_device_by_index(a)},265147:a=>{a=window.miniaudio.get_device_by_index(a);a.N.resume();a.state=window.miniaudio.device_state.started},265286:a=>{a=window.miniaudio.get_device_by_index(a);a.N.suspend();a.state=window.miniaudio.device_state.stopped}},lc,Md,kc,Id,Jd,Kd,Nd,Od,Pd,Qd,Ja,Rc,Sd={__syscall_fcntl64:function(a,b,c){Xa=c;try{var d=Lb(a);switch(b){case 0:var e=Ya();if(0>e)break;for(;Ab[e];)e++;return Nb(d,e).ba;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=\nYa(),d.flags|=e,0;case 12:return e=Ya(),Ba[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(f){if(\"undefined\"==typeof ac||\"ErrnoError\"!==f.name)throw f;return-f.aa}},__syscall_ioctl:function(a,b,c){Xa=c;try{var d=Lb(a);switch(b){case 21509:return d.s?0:-59;case 21505:if(!d.s)return-59;if(d.s.$.kc){a=[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 e=Ya();E[e>>2]=25856;E[e+4>>2]=5;E[e+8>>2]=191;E[e+12>>2]=35387;for(var f=0;32>f;f++)Aa[e+f+17]=a[f]||0}return 0;case 21510:case 21511:case 21512:return d.s?\n0:-59;case 21506:case 21507:case 21508:if(!d.s)return-59;if(d.s.$.lc)for(e=Ya(),a=[],f=0;32>f;f++)a.push(Aa[e+f+17]);return 0;case 21519:if(!d.s)return-59;e=Ya();return E[e>>2]=0;case 21520:return d.s?-28:-59;case 21537:case 21531:e=Ya();if(!d.i.jc)throw new P(59);return d.i.jc(d,b,e);case 21523:if(!d.s)return-59;d.s.$.mc&&(f=[24,80],e=Ya(),Ba[e>>1]=f[0],Ba[e+2>>1]=f[1]);return 0;case 21524:return d.s?0:-59;case 21515:return d.s?0:-59;default:return-28}}catch(g){if(\"undefined\"==typeof ac||\"ErrnoError\"!==\ng.name)throw g;return-g.aa}},__syscall_openat:function(a,b,c,d){Xa=d;try{b=b?gb(w,b):\"\";var e=b;if(\"/\"===e.charAt(0))b=e;else{var f=-100===a?\"/\":Lb(a).path;if(0==e.length)throw new P(44);b=f+\"/\"+e}var g=d?Ya():0;return Yb(b,c,g).ba}catch(h){if(\"undefined\"==typeof ac||\"ErrnoError\"!==h.name)throw h;return-h.aa}},_abort_js:()=>Ka(\"\"),_embind_create_inheriting_constructor:(a,b,c)=>{a=T(a);b=nc(b,\"wrapper\");c=ec(c);var d=b.h,e=d.P,f=d.C.P,g=d.C.constructor;a=bc(a,function(...h){for(var l of d.C.zb)if(this[l]===\nf[l])throw new gc(`Pure virtual function ${l} must be implemented in JavaScript`);Object.defineProperty(this,\"__parent\",{value:e});this.__construct(...h)});e.__construct=function(...h){if(this===e)throw new S(\"Pass correct 'this' to __construct\");h=g.implement(this,...h);oc(h);var l=h.g;h.notifyOnDestruction();l.ja=!0;Object.defineProperties(this,{g:{value:l}});qc(this);h=l.m;h=ic(d,h);if(hc.hasOwnProperty(h))throw new S(`Tried to register registered instance: ${h}`);hc[h]=this};e.__destruct=function(){if(this===\ne)throw new S(\"Pass correct 'this' to __destruct\");oc(this);var h=this.g.m;h=ic(d,h);if(hc.hasOwnProperty(h))delete hc[h];else throw new S(`Tried to unregister unregistered instance: ${h}`);};a.prototype=Object.create(e);Object.assign(a.prototype,c);return fc(a)},_embind_finalize_value_object:a=>{var b=rc[a];delete rc[a];var c=b.Ya,d=b.T,e=b.pb,f=e.map(g=>g.hc).concat(e.map(g=>g.yc));Y([a],f,g=>{var h={},l,n;for([l,n]of e.entries()){const t=g[l],u=n.ec,r=n.fc,x=g[l+e.length],y=n.xc,p=n.zc;h[n.ac]=\n{read:I=>t.o(u(r,I)),write:(I,K)=>{var v=[];y(p,I,x.A(v,K));sc(v)},optional:t.optional}}return[{name:b.name,o:t=>{var u={},r;for(r in h)u[r]=h[r].read(t);d(t);return u},A:(t,u)=>{for(var r in h)if(!(r in u||h[r].optional))throw new TypeError(`Missing field: \"${r}\"`);var x=c();for(r in h)h[r].write(x,u[r]);null!==t&&t.push(d,x);return x},L:tc,I:d}]})},_embind_register_bigint:()=>{},_embind_register_bool:(a,b,c,d)=>{b=T(b);X(a,{name:b,o:function(e){return!!e},A:function(e,f){return f?c:d},L:function(e){return this.o(w[e])},\nI:null})},_embind_register_class:(a,b,c,d,e,f,g,h,l,n,t,u,r)=>{t=T(t);f=Z(e,f);h&&=Z(g,h);n&&=Z(l,n);r=Z(u,r);var x=Ec(t);Dc(x,function(){Vc(`Cannot construct ${t} due to unbound types`,[d])});Y([a,b,c],d?[d]:[],y=>{y=y[0];if(d){var p=y.h;var I=p.P}else I=Ac.prototype;y=bc(t,function(...O){if(Object.getPrototypeOf(this)!==K)throw new S(`Use 'new' to construct ${t}`);if(void 0===v.fa)throw new S(`${t} has no accessible constructor`);var V=v.fa[O.length];if(void 0===V)throw new S(`Tried to invoke ctor of ${t} with invalid number of parameters (${O.length}) - expected (${Object.keys(v.fa).toString()}) parameters instead!`);\nreturn V.apply(this,O)});var K=Object.create(I,{constructor:{value:y}});y.prototype=K;var v=new Fc(t,y,K,r,p,f,h,n);if(v.C){var N;(N=v.C).ra??(N.ra=[]);v.C.ra.push(v)}p=new Oc(t,v,!0,!1,!1);N=new Oc(t+\"*\",v,!1,!1,!1);I=new Oc(t+\" const*\",v,!1,!0,!1);Bc[a]={pointerType:N,Ub:I};Pc(x,y);return[p,N,I]})},_embind_register_class_class_function:(a,b,c,d,e,f,g)=>{var h=cd(c,d);b=T(b);b=dd(b);f=Z(e,f);Y([],[a],l=>{function n(){Vc(`Cannot call ${t} due to unbound types`,h)}l=l[0];var t=`${l.name}.${b}`;b.startsWith(\"@@\")&&\n(b=Symbol[b.substring(2)]);var u=l.h.constructor;void 0===u[b]?(n.X=c-1,u[b]=n):(Cc(u,b,t),u[b].v[c-1]=n);Y([],h,r=>{r=bd(t,[r[0],null].concat(r.slice(1)),null,f,g);void 0===u[b].v?(r.X=c-1,u[b]=r):u[b].v[c-1]=r;if(l.h.ra)for(const x of l.h.ra)x.constructor.hasOwnProperty(b)||(x.constructor[b]=r);return[]});return[]})},_embind_register_class_class_property:(a,b,c,d,e,f,g,h)=>{b=T(b);f=Z(e,f);Y([],[a],l=>{l=l[0];var n=`${l.name}.${b}`,t={get(){Vc(`Cannot access ${n} due to unbound types`,[c])},enumerable:!0,\nconfigurable:!0};t.set=h?()=>{Vc(`Cannot access ${n} due to unbound types`,[c])}:()=>{throw new S(`${n} is a read-only property`);};Object.defineProperty(l.h.constructor,b,t);Y([],[c],u=>{u=u[0];var r={get(){return u.o(f(d))},enumerable:!0};h&&(h=Z(g,h),r.set=x=>{var y=[];h(d,u.A(y,x));sc(y)});Object.defineProperty(l.h.constructor,b,r);return[]});return[]})},_embind_register_class_constructor:(a,b,c,d,e,f)=>{var g=cd(b,c);e=Z(d,e);Y([],[a],h=>{h=h[0];var l=`constructor ${h.name}`;void 0===h.h.fa&&\n(h.h.fa=[]);if(void 0!==h.h.fa[b-1])throw new S(`Cannot register multiple constructors with identical number of parameters (${b-1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.h.fa[b-1]=()=>{Vc(`Cannot construct ${h.name} due to unbound types`,g)};Y([],g,n=>{n.splice(1,0,null);h.h.fa[b-1]=bd(l,n,null,e,f);return[]});return[]})},_embind_register_class_function:(a,b,c,d,e,f,g,h)=>{var l=cd(c,d);b=T(b);b=dd(b);f=Z(e,f);Y([],\n[a],n=>{function t(){Vc(`Cannot call ${u} due to unbound types`,l)}n=n[0];var u=`${n.name}.${b}`;b.startsWith(\"@@\")&&(b=Symbol[b.substring(2)]);h&&n.h.zb.push(b);var r=n.h.P,x=r[b];void 0===x||void 0===x.v&&x.className!==n.name&&x.X===c-2?(t.X=c-2,t.className=n.name,r[b]=t):(Cc(r,b,u),r[b].v[c-2]=t);Y([],l,y=>{y=bd(u,y,n,f,g);void 0===r[b].v?(y.X=c-2,r[b]=y):r[b].v[c-2]=y;return[]});return[]})},_embind_register_class_property:(a,b,c,d,e,f,g,h,l,n)=>{b=T(b);e=Z(d,e);Y([],[a],t=>{t=t[0];var u=`${t.name}.${b}`,\nr={get(){Vc(`Cannot access ${u} due to unbound types`,[c,g])},enumerable:!0,configurable:!0};r.set=l?()=>Vc(`Cannot access ${u} due to unbound types`,[c,g]):()=>{throw new S(u+\" is a read-only property\");};Object.defineProperty(t.h.P,b,r);Y([],l?[c,g]:[c],x=>{var y=x[0],p={get(){var K=ed(this,t,u+\" getter\");return y.o(e(f,K))},enumerable:!0};if(l){l=Z(h,l);var I=x[1];p.set=function(K){var v=ed(this,t,u+\" setter\"),N=[];l(n,v,I.A(N,K));sc(N)}}Object.defineProperty(t.h.P,b,p);return[]});return[]})},\n_embind_register_emval:a=>X(a,gd),_embind_register_enum:(a,b,c,d,e)=>{b=T(b);e=0===e?\"object\":1===e?\"number\":\"string\";switch(e){case \"object\":function g(){}g.values={};X(a,{name:b,constructor:g,valueType:e,o:function(h){return this.constructor.values[h]},A:(h,l)=>l.value,L:hd(b,c,d),I:null});Dc(b,g);break;case \"number\":var f={};X(a,{name:b,Wa:f,valueType:e,o:h=>h,A:(h,l)=>l,L:hd(b,c,d),I:null});Dc(b,f);delete k[b].X;break;case \"string\":f={},X(a,{name:b,Jb:{},Cb:{},Wa:f,valueType:e,o:function(h){return this.Cb[h]},\nA:function(h,l){return this.Jb[l]},L:hd(b,c,d),I:null}),Dc(b,f),delete k[b].X}},_embind_register_enum_value:(a,b,c)=>{var d=nc(a,\"enum\");b=T(b);switch(d.valueType){case \"object\":a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:bc(`${d.name}_${b}`,function(){})}});a.values[c]=d;a[b]=d;break;case \"number\":d.Wa[b]=c;break;case \"string\":d.Jb[b]=c,d.Cb[c]=b,d.Wa[b]=b}},_embind_register_float:(a,b,c)=>{b=T(b);X(a,{name:b,o:d=>d,A:(d,e)=>e,L:jd(b,c),I:null})},_embind_register_function:(a,\nb,c,d,e,f)=>{var g=cd(b,c);a=T(a);a=dd(a);e=Z(d,e);Dc(a,function(){Vc(`Cannot call ${a} due to unbound types`,g)},b-1);Y([],g,h=>{Pc(a,bd(a,[h[0],null].concat(h.slice(1)),null,e,f),b-1);return[]})},_embind_register_integer:(a,b,c,d,e)=>{b=T(b);let f=h=>h;if(0===d){var g=32-8*c;f=h=>h<<g>>>g;e=f(e)}X(a,{name:b,o:f,A:(h,l)=>l,L:kd(b,c,0!==d),I:null})},_embind_register_memory_view:(a,b,c)=>{function d(f){return new e(Aa.buffer,F[f+4>>2],F[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,\nUint32Array,Float32Array,Float64Array][b];c=T(c);X(a,{name:c,o:d,L:d},{ic:!0})},_embind_register_std_string:(a,b)=>{b=T(b);X(a,{name:b,o(c){var d=(d=c+4)?gb(w,d,F[c>>2],!0):\"\";lc(c);return d},A(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e=\"string\"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new S(\"Cannot pass non-string to std::string\");var f=e?ib(d):d.length;var g=Md(4+f+1),h=g+4;F[g>>2]=f;e?jb(d,w,h,f+1):w.set(d,h);null!==c&&c.push(lc,g);return g},L:tc,I(c){lc(c)}})},\n_embind_register_std_wstring:(a,b,c)=>{c=T(c);if(2===b){var d=md;var e=nd;var f=od}else d=pd,e=qd,f=rd;X(a,{name:c,o:g=>{var h=d(g+4,F[g>>2]*b,!0);lc(g);return h},A:(g,h)=>{if(\"string\"!=typeof h)throw new S(`Cannot pass non-string to C++ string type ${c}`);var l=f(h),n=Md(4+l+b);F[n>>2]=l/b;e(h,n+4,l+b);null!==g&&g.push(lc,n);return n},L:tc,I(g){lc(g)}})},_embind_register_value_object:(a,b,c,d,e,f)=>{rc[a]={name:T(b),Ya:Z(c,d),T:Z(e,f),pb:[]}},_embind_register_value_object_field:(a,b,c,d,e,f,g,h,\nl,n)=>{rc[a].pb.push({ac:T(b),hc:c,ec:Z(d,e),fc:f,yc:g,xc:Z(h,l),zc:n})},_embind_register_void:(a,b)=>{b=T(b);X(a,{oc:!0,name:b,o:()=>{},A:()=>{}})},_emscripten_runtime_keepalive_clear:()=>{Wa=!1;sd=0},_emscripten_throw_longjmp:()=>{throw Infinity;},_emval_create_invoker:(a,b,c)=>{var [d,...e]=vd(a,b),f=d.A.bind(d),g=e.map(l=>l.L.bind(l));a--;var h=Array(a);b=`methodCaller<(${e.map(l=>l.name)}) => ${d.name}>`;return ud(bc(b,(l,n,t,u)=>{for(var r=0,x=0;x<a;++x)h[x]=g[x](u+r),r+=8;switch(c){case 0:var y=\nec(l).apply(null,h);break;case 2:y=Reflect.construct(ec(l),h);break;case 3:y=h[0];break;case 1:y=ec(l)[xd(n)](...h)}l=[];y=f(l,y);l.length&&(F[t>>2]=fc(l));return y}))},_emval_decref:fd,_emval_get_module_property:a=>{a=xd(a);return fc(k[a])},_emval_get_property:(a,b)=>{a=ec(a);b=ec(b);return fc(a[b])},_emval_incref:a=>{9<a&&(dc[a+1]+=1)},_emval_invoke:(a,b,c,d,e)=>td[a](b,c,d,e),_emval_new_array:()=>fc([]),_emval_new_cstring:a=>fc(xd(a)),_emval_new_object:()=>fc({}),_emval_run_destructors:a=>{var b=\nec(a);sc(b);fd(a)},_emval_set_property:(a,b,c)=>{a=ec(a);b=ec(b);c=ec(c);a[b]=c},_gmtime_js:function(a,b,c){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));E[c>>2]=a.getUTCSeconds();E[c+4>>2]=a.getUTCMinutes();E[c+8>>2]=a.getUTCHours();E[c+12>>2]=a.getUTCDate();E[c+16>>2]=a.getUTCMonth();E[c+20>>2]=a.getUTCFullYear()-1900;E[c+24>>2]=a.getUTCDay();E[c+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},_localtime_js:function(a,b,c){a=new Date(1E3*(b+2097152>>>\n0<4194305-!!a?(a>>>0)+4294967296*b:NaN));E[c>>2]=a.getSeconds();E[c+4>>2]=a.getMinutes();E[c+8>>2]=a.getHours();E[c+12>>2]=a.getDate();E[c+16>>2]=a.getMonth();E[c+20>>2]=a.getFullYear()-1900;E[c+24>>2]=a.getDay();b=a.getFullYear();E[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?zd:yd)[a.getMonth()]+a.getDate()-1|0;E[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();E[c+32>>2]=(b!=d&&a.getTimezoneOffset()==\nMath.min(d,b))|0},_setitimer_js:(a,b)=>{Ad[a]&&(clearTimeout(Ad[a].id),delete Ad[a]);if(!b)return 0;var c=setTimeout(()=>{delete Ad[a];Dd(()=>Nd(a,performance.now()))},b);Ad[a]={id:c,Xc:b};return 0},_tzset_js:(a,b,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(f,e);E[b>>2]=Number(f!=e);b=g=>{var h=Math.abs(g);return`UTC${0<=g?\"-\":\"+\"}${String(Math.floor(h/60)).padStart(2,\"0\")}${String(h%60).padStart(2,\"0\")}`};\na=b(f);b=b(e);e<f?(jb(a,w,c,17),jb(b,w,d,17)):(jb(a,w,d,17),jb(b,w,c,17))},clock_time_get:function(a,b,c,d){if(!(0<=a&&3>=a))return 28;a=Math.round(1E6*(0===a?Date.now():performance.now()));Pa=[a>>>0,(H=a,1<=+Math.abs(H)?0<H?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)];E[d>>2]=Pa[0];E[d+4>>2]=Pa[1];return 0},emscripten_asm_const_int:(a,b,c)=>{Ed.length=0;for(var d;d=w[b++];){var e=105!=d;e&=112!=d;c+=e&&c%8?4:0;Ed.push(112==d?F[c>>2]:105==d?E[c>>2]:Ea[c>>3]);c+=e?\n8:4}return Ld[a](...Ed)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:a=>{var b=w.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-Ja.buffer.byteLength+65535)/65536|0;try{Ja.grow(d);Ia();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},environ_get:(a,b)=>{var c=0,d=0,e;for(e of Hd()){var f=b+c;F[a+d>>2]=f;c+=jb(e,w,\nf,Infinity)+1;d+=4}return 0},environ_sizes_get:(a,b)=>{var c=Hd();F[a>>2]=c.length;a=0;for(var d of c)a+=ib(d)+1;F[b>>2]=a;return 0},fd_close:function(a){try{var b=Lb(a);if(null===b.ba)throw new P(8);b.Ua&&(b.Ua=null);try{b.i.close&&b.i.close(b)}catch(c){throw c;}finally{Ab[b.ba]=null}b.ba=null;return 0}catch(c){if(\"undefined\"==typeof ac||\"ErrnoError\"!==c.name)throw c;return c.aa}},fd_read:function(a,b,c,d){try{a:{var e=Lb(a);a=b;for(var f,g=b=0;g<c;g++){var h=F[a>>2],l=F[a+4>>2];a+=8;var n=e,t=h,\nu=l,r=f,x=Aa;if(0>u||0>r)throw new P(28);if(null===n.ba)throw new P(8);if(1===(n.flags&2097155))throw new P(8);if(16384===(n.node.mode&61440))throw new P(31);if(!n.i.read)throw new P(28);var y=\"undefined\"!=typeof r;if(!y)r=n.position;else if(!n.seekable)throw new P(70);var p=n.i.read(n,x,t,u,r);y||(n.position+=p);var I=p;if(0>I){var K=-1;break a}b+=I;if(I<l)break;\"undefined\"!=typeof f&&(f+=I)}K=b}F[d>>2]=K;return 0}catch(v){if(\"undefined\"==typeof ac||\"ErrnoError\"!==v.name)throw v;return v.aa}},fd_seek:function(a,\nb,c,d,e){b=c+2097152>>>0<4194305-!!b?(b>>>0)+4294967296*c:NaN;try{if(isNaN(b))return 61;var f=Lb(a);Zb(f,b,d);Pa=[f.position>>>0,(H=f.position,1<=+Math.abs(H)?0<H?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)];E[e>>2]=Pa[0];E[e+4>>2]=Pa[1];f.Ua&&0===b&&0===d&&(f.Ua=null);return 0}catch(g){if(\"undefined\"==typeof ac||\"ErrnoError\"!==g.name)throw g;return g.aa}},fd_write:function(a,b,c,d){try{a:{var e=Lb(a);a=b;for(var f,g=b=0;g<c;g++){var h=F[a>>2],l=F[a+4>>2];a+=8;var n=\ne,t=h,u=l,r=f,x=Aa;if(0>u||0>r)throw new P(28);if(null===n.ba)throw new P(8);if(0===(n.flags&2097155))throw new P(8);if(16384===(n.node.mode&61440))throw new P(31);if(!n.i.write)throw new P(28);n.seekable&&n.flags&1024&&Zb(n,0,2);var y=\"undefined\"!=typeof r;if(!y)r=n.position;else if(!n.seekable)throw new P(70);var p=n.i.write(n,x,t,u,r,void 0);y||(n.position+=p);var I=p;if(0>I){var K=-1;break a}b+=I;if(I<l)break;\"undefined\"!=typeof f&&(f+=I)}K=b}F[d>>2]=K;return 0}catch(v){if(\"undefined\"==typeof ac||\n\"ErrnoError\"!==v.name)throw v;return v.aa}},invoke_vii:Rd,isWindowsBrowser:function(){return-1<navigator.platform.indexOf(\"Win\")},proc_exit:Cd,wasm_start_image_decode:function(a,b,c){b=new Uint8Array(Ja.buffer,b,c);c=new Uint8Array(c);c.set(b);createImageBitmap(new Blob([c])).then(function(d){var e=(new OffscreenCanvas(d.width,d.height)).getContext(\"2d\");e.drawImage(d,0,0);e=e.getImageData(0,0,d.width,d.height);var f=e.data.length,g=k.Qb(f);(new Uint8Array(Ja.buffer,g,f)).set(e.data);k.Ec(a,d.width,\nd.height,g,f)}).catch(function(d){d=d.message||\"decode failed\";var e=k.Tc(d)+1,f=k.Qb(e);k.Wc(d,f,e);k.Fc(a,f);k.Dc(f)})}};function Rd(a,b,c){var d=Qd();try{Rc.get(a)(b,c)}catch(e){Pd(d);if(e!==e+0)throw e;Od(1,0)}}var Td;\nTd=await (async function(){function a(c){c=Td=c.exports;lc=c.free;Md=c.malloc;kc=c.__getTypeName;k._wasm_image_decode_complete=c.wasm_image_decode_complete;k._wasm_image_decode_error=c.wasm_image_decode_error;Id=k._ma_device__on_notification_unlocked=c.ma_device__on_notification_unlocked;k._ma_malloc_emscripten=c.ma_malloc_emscripten;k._ma_free_emscripten=c.ma_free_emscripten;Jd=k._ma_device_process_pcm_frames_capture__webaudio=c.ma_device_process_pcm_frames_capture__webaudio;Kd=k._ma_device_process_pcm_frames_playback__webaudio=\nc.ma_device_process_pcm_frames_playback__webaudio;Nd=c._emscripten_timeout;Od=c.setThrew;Pd=c._emscripten_stack_restore;Qd=c.emscripten_stack_get_current;Qc.iiji=c.dynCall_iiji;Qc.jiji=c.dynCall_jiji;Qc.vij=c.dynCall_vij;Qc.iij=c.dynCall_iij;Qc.ji=c.dynCall_ji;Qc.iiiji=c.dynCall_iiiji;Qc.jii=c.dynCall_jii;Qc.viijii=c.dynCall_viijii;Qc.iiiiij=c.dynCall_iiiiij;Qc.iiiiijj=c.dynCall_iiiiijj;Qc.iiiiiijj=c.dynCall_iiiiiijj;Ja=c.memory;Rc=c.__indirect_function_table;Ia();return Td}var b={env:Sd,wasi_snapshot_preview1:Sd};\nif(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,(d,e)=>{c(a(d,e))})});La??=k.locateFile?k.locateFile(\"canvas_advanced.wasm\",ma):ma+\"canvas_advanced.wasm\";return a((await Oa(b)).instance)}());\n(function(){function a(){k.calledRun=!0;if(!va){Fa=!0;if(!k.noFSInit&&!Cb){var b,c;Cb=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?$b(\"stdin\",b):Xb(\"/dev/tty\",\"/dev/stdin\");c?$b(\"stdout\",null,c):Xb(\"/dev/tty\",\"/dev/stdout\");d?$b(\"stderr\",null,d):Xb(\"/dev/tty1\",\"/dev/stderr\");Yb(\"/dev/stdin\",0);Yb(\"/dev/stdout\",1);Yb(\"/dev/stderr\",1)}Td.__wasm_call_ctors();Db=!1;ya?.(k);k.onRuntimeInitialized?.();if(k.postRun)for(\"function\"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();\nTa.push(d)}Sa(Ta)}}if(k.preRun)for(\"function\"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Va();Sa(Ua);k.setStatus?(k.setStatus(\"Running...\"),setTimeout(()=>{setTimeout(()=>k.setStatus(\"\"),1);a()},1)):a()})();Fa?moduleRtn=k:moduleRtn=new Promise((a,b)=>{ya=a;za=b});\n;return moduleRtn}})();\nexport default Rive;\n","import type {\n  SemanticsDiff,\n  SemanticsDiffNode,\n  SemanticNodeData,\n} from \"./types\";\nimport { roleName, stateNames, traitNames } from \"./types\";\n\n/**\n * Maintains an in-memory semantic tree built from incremental\n * {@link SemanticsDiff} updates received each frame from the WASM runtime.\n *\n * Processing order within {@link applyDiff} follows the contract defined in\n * `semantic_snapshot.hpp`: removed → added → moved → childrenUpdated →\n * updatedSemantic → updatedGeometry.\n */\nexport class SemanticTreeModel {\n  private _nodesById: Map<number, SemanticNodeData> = new Map();\n  private _roots: number[] = [];\n  private _semanticVersion = 0;\n  private _geometryVersion = 0;\n  private _geometryChangedIds: Set<number> = new Set();\n  private _semanticChangedIds: Set<number> = new Set();\n\n  get nodeCount(): number {\n    return this._nodesById.size;\n  }\n\n  /** Bumped when semantic content or tree structure changes. */\n  get semanticVersion(): number {\n    return this._semanticVersion;\n  }\n\n  /** Bumped when node bounds change without a semantic/structural change. */\n  get geometryVersion(): number {\n    return this._geometryVersion;\n  }\n\n  /** Node IDs whose bounds changed in the most recent {@link applyDiff}. */\n  get geometryChangedIds(): ReadonlySet<number> {\n    return this._geometryChangedIds;\n  }\n\n  /**\n   * Node IDs whose semantic fields (role/label/value/hint/flags/headingLevel)\n   * changed in the most recent {@link applyDiff}. Structural changes (moves,\n   * child reorders, removals) bump {@link semanticVersion} but don't mark\n   * nodes here — element attributes don't depend on tree position.\n   */\n  get semanticChangedIds(): ReadonlySet<number> {\n    return this._semanticChangedIds;\n  }\n\n  /** Root node IDs in sibling order. */\n  get roots(): readonly number[] {\n    return this._roots;\n  }\n\n  /** Look up a node by its ID, or undefined if not in the tree. */\n  nodeById(id: number): SemanticNodeData | undefined {\n    return this._nodesById.get(id);\n  }\n\n  /** Current index of a node among its siblings (or roots), or -1 if absent. */\n  private siblingIndexOf(id: number): number {\n    const node = this._nodesById.get(id);\n    if (!node) return -1;\n    if (node.parentId < 0) return this._roots.indexOf(id);\n    const parent = this._nodesById.get(node.parentId);\n    return parent ? parent.children.indexOf(id) : -1;\n  }\n\n  /** Detach a node from its current parent (or from roots). */\n  private detach(id: number): void {\n    const node = this._nodesById.get(id);\n    if (!node) return;\n    if (node.parentId < 0) {\n      const idx = this._roots.indexOf(id);\n      if (idx !== -1) this._roots.splice(idx, 1);\n    } else {\n      const parent = this._nodesById.get(node.parentId);\n      if (parent) {\n        const idx = parent.children.indexOf(id);\n        if (idx !== -1) parent.children.splice(idx, 1);\n      }\n    }\n  }\n\n  /** Attach a node under a parent at a given sibling index (or as root). */\n  private attach(id: number, parentId: number, siblingIndex: number): void {\n    const node = this._nodesById.get(id);\n    if (!node) return;\n    if (parentId < 0) {\n      node.parentId = -1;\n      const idx = clamp(siblingIndex, 0, this._roots.length);\n      this._roots.splice(idx, 0, id);\n    } else {\n      const parent = this._nodesById.get(parentId);\n      if (!parent) {\n        node.parentId = -1;\n        this._roots.push(id);\n      } else {\n        node.parentId = parentId;\n        const idx = clamp(siblingIndex, 0, parent.children.length);\n        parent.children.splice(idx, 0, id);\n      }\n    }\n  }\n\n  /** Recursively remove a node and all descendants. */\n  private removeSubtree(id: number): void {\n    const node = this._nodesById.get(id);\n    if (!node) return;\n    // Copy children array — we're mutating during traversal\n    const kids = [...node.children];\n    for (const child of kids) {\n      this.removeSubtree(child);\n    }\n    this.detach(id);\n    this._nodesById.delete(id);\n  }\n\n  /**\n   * Apply an incremental diff to the tree. Bumps version counters and notifies\n   * listeners only when the tree actually changed.\n   *\n   * No-op diffs (field values identical to current model) do not bump\n   * versions — the native side guards against emitting these, but applyDiff\n   * defends its subscribers regardless.\n   */\n  applyDiff(diff: SemanticsDiff): void {\n    this._geometryChangedIds.clear();\n    this._semanticChangedIds.clear();\n    let semanticChanged = false;\n    let geometryChanged = false;\n\n    const markSemantic = (): void => {\n      semanticChanged = true;\n    };\n    const markSemanticNode = (id: number): void => {\n      semanticChanged = true;\n      this._semanticChangedIds.add(id);\n    };\n    const markGeometry = (id: number): void => {\n      geometryChanged = true;\n      this._geometryChangedIds.add(id);\n    };\n\n    // 1. removed\n    for (const id of diff.removed) {\n      if (this._nodesById.has(id)) {\n        this.removeSubtree(id);\n        markSemantic();\n      }\n    }\n\n    // 2. added\n    for (const n of diff.added) {\n      const existing = this._nodesById.get(n.id);\n      if (existing) {\n        if (semanticFieldsDiffer(existing, n)) {\n          applySemantic(existing, n);\n          markSemanticNode(n.id);\n        }\n        if (geometryFieldsDiffer(existing, n)) {\n          applyGeometry(existing, n);\n          markGeometry(n.id);\n        }\n      } else {\n        this._nodesById.set(n.id, nodeFromDiff(n));\n        markSemanticNode(n.id);\n        markGeometry(n.id);\n      }\n      this.detach(n.id);\n      this.attach(n.id, n.parentId, n.siblingIndex);\n    }\n\n    // 3. moved\n    // The runtime emits a node as \"moved\" when its parentId OR siblingIndex\n    // changes, so a reorder-only move (same parent, new index) is still a\n    // structural/semantic change. Compare the actual position before and after\n    // re-attaching so that geometry-only or no-op moves don't bump the semantic\n    // version (which would defeat the semantic/geometry version split).\n    for (const n of diff.moved) {\n      const existing = this._nodesById.get(n.id);\n      if (!existing) continue;\n      const parentChanged = existing.parentId !== n.parentId;\n      const oldIndex = this.siblingIndexOf(n.id);\n      const geomChanged = geometryFieldsDiffer(existing, n);\n      if (geomChanged) {\n        applyGeometry(existing, n);\n        markGeometry(n.id);\n      }\n      this.detach(n.id);\n      this.attach(n.id, n.parentId, n.siblingIndex);\n      if (parentChanged || this.siblingIndexOf(n.id) !== oldIndex) {\n        markSemantic();\n      }\n    }\n\n    // 4. childrenUpdated\n    for (const update of diff.childrenUpdated) {\n      if (update.parentId < 0) {\n        const next = update.childIds.filter((id) => this._nodesById.has(id));\n        if (!arraysEqual(this._roots, next)) {\n          this._roots.length = 0;\n          this._roots.push(...next);\n          for (const id of this._roots) {\n            const node = this._nodesById.get(id);\n            if (node) node.parentId = -1;\n          }\n          markSemantic();\n        }\n      } else {\n        const parent = this._nodesById.get(update.parentId);\n        if (!parent) continue;\n        const next = update.childIds.filter((id) => this._nodesById.has(id));\n        if (!arraysEqual(parent.children, next)) {\n          parent.children.length = 0;\n          parent.children.push(...next);\n          for (const id of parent.children) {\n            const node = this._nodesById.get(id);\n            if (node) node.parentId = update.parentId;\n          }\n          markSemantic();\n        }\n      }\n    }\n\n    // 5. updatedSemantic — semantic fields updated\n    for (const n of diff.updatedSemantic) {\n      const existing = this._nodesById.get(n.id);\n      if (!existing) continue;\n      if (!semanticFieldsDiffer(existing, n)) continue;\n      applySemantic(existing, n);\n      markSemanticNode(n.id);\n    }\n\n    // 6. updatedGeometry — bounds of a semantic node updated\n    for (const n of diff.updatedGeometry) {\n      const existing = this._nodesById.get(n.id);\n      if (!existing) continue;\n      if (!geometryFieldsDiffer(existing, n)) continue;\n      applyGeometry(existing, n);\n      markGeometry(n.id);\n    }\n\n    if (!semanticChanged && !geometryChanged) return;\n    if (semanticChanged) this._semanticVersion++;\n    if (geometryChanged) this._geometryVersion++;\n    if (this._debug) {\n      this.logDiff(diff, semanticChanged, geometryChanged);\n    }\n  }\n\n  private _debug = false;\n\n  /** Enable/disable debug logging of diffs to the console. */\n  set debug(enabled: boolean) {\n    this._debug = enabled;\n  }\n\n  private logDiff(\n    diff: SemanticsDiff,\n    semanticChanged: boolean,\n    geometryChanged: boolean,\n  ): void {\n    const lines: string[] = [\n      `[rive:semantics] semantic v${this._semanticVersion}` +\n        (geometryChanged ? ` geometry v${this._geometryVersion}` : \"\") +\n        (semanticChanged ? \"\" : \" (geometry-only)\"),\n    ];\n    for (const id of diff.removed) {\n      lines.push(`  - removed #${id}`);\n    }\n    for (const n of diff.added) {\n      lines.push(\n        `  + added #${n.id} ${roleName(n.role)}` +\n          (n.label ? ` \"${n.label}\"` : \"\") +\n          ` bounds:(${n.minX.toFixed(1)},${n.minY.toFixed(1)})-(${n.maxX.toFixed(1)},${n.maxY.toFixed(1)})` +\n          ` states=[${stateNames(n.stateFlags)}]` +\n          ` traits=[${traitNames(n.traitFlags)}]`\n      );\n    }\n    for (const n of diff.moved) {\n      lines.push(\n        `  ~ moved #${n.id} → parent=${n.parentId} idx=${n.siblingIndex}` +\n          ` bounds:(${n.minX.toFixed(1)},${n.minY.toFixed(1)})-(${n.maxX.toFixed(1)},${n.maxY.toFixed(1)})`\n      );\n    }\n    for (const u of diff.childrenUpdated) {\n      lines.push(\n        `  ↕ children of ${\n          u.parentId < 0 ? \"root\" : \"#\" + u.parentId\n        }: [${u.childIds.join(\", \")}]`\n      );\n    }\n    for (const n of diff.updatedSemantic) {\n      lines.push(\n        `  ✎ semantic #${n.id} ${roleName(n.role)}` +\n          (n.label ? ` \"${n.label}\"` : \"\") +\n          ` states=[${stateNames(n.stateFlags)}]` +\n          ` traits=[${traitNames(n.traitFlags)}]`\n      );\n    }\n    for (const n of diff.updatedGeometry) {\n      lines.push(\n        `  ⊞ geometry #${n.id} (${n.minX.toFixed(1)},${n.minY.toFixed(1)})-(${n.maxX.toFixed(1)},${n.maxY.toFixed(1)})`\n      );\n    }\n    console.log(lines.join(\"\\n\"));\n  }\n\n  /**\n   * Returns every node in depth-first order, paired with its depth level.\n   * Useful for debug logging / rendering a flat list.\n   */\n  flattened(): Array<{ depth: number; node: SemanticNodeData }> {\n    const out: Array<{ depth: number; node: SemanticNodeData }> = [];\n    const walk = (id: number, depth: number) => {\n      const node = this._nodesById.get(id);\n      if (!node) return;\n      out.push({ depth, node });\n      for (const child of node.children) {\n        walk(child, depth + 1);\n      }\n    };\n    for (const root of this._roots) {\n      walk(root, 0);\n    }\n    return out;\n  }\n}\n\nfunction clamp(v: number, min: number, max: number): number {\n  return v < min ? min : v > max ? max : v;\n}\n\nfunction arraysEqual(a: number[], b: number[]): boolean {\n  if (a.length !== b.length) return false;\n  for (let i = 0; i < a.length; i++) {\n    if (a[i] !== b[i]) return false;\n  }\n  return true;\n}\n\nfunction nodeFromDiff(n: SemanticsDiffNode): SemanticNodeData {\n  return {\n    id: n.id,\n    parentId: -1,\n    role: n.role,\n    label: n.label,\n    value: n.value,\n    hint: n.hint,\n    stateFlags: n.stateFlags,\n    traitFlags: n.traitFlags,\n    headingLevel: n.headingLevel,\n    minX: n.minX,\n    minY: n.minY,\n    maxX: n.maxX,\n    maxY: n.maxY,\n    children: [],\n  };\n}\n\n/** Compare role/label/value/hint/stateFlags/traitFlags/headingLevel. */\nfunction semanticFieldsDiffer(\n  a: SemanticNodeData,\n  b: SemanticsDiffNode\n): boolean {\n  return (\n    a.role !== b.role ||\n    a.label !== b.label ||\n    a.value !== b.value ||\n    a.hint !== b.hint ||\n    a.stateFlags !== b.stateFlags ||\n    a.traitFlags !== b.traitFlags ||\n    a.headingLevel !== b.headingLevel\n  );\n}\n\n/** Compare only bounds (minX/minY/maxX/maxY). */\nfunction geometryFieldsDiffer(\n  a: SemanticNodeData,\n  b: { minX: number; minY: number; maxX: number; maxY: number }\n): boolean {\n  return (\n    a.minX !== b.minX ||\n    a.minY !== b.minY ||\n    a.maxX !== b.maxX ||\n    a.maxY !== b.maxY\n  );\n}\n\nfunction applySemantic(target: SemanticNodeData, src: SemanticsDiffNode): void {\n  target.role = src.role;\n  target.label = src.label;\n  target.value = src.value;\n  target.hint = src.hint;\n  target.stateFlags = src.stateFlags;\n  target.traitFlags = src.traitFlags;\n  target.headingLevel = src.headingLevel;\n}\n\nfunction applyGeometry(\n  target: SemanticNodeData,\n  src: { minX: number; minY: number; maxX: number; maxY: number }\n): void {\n  target.minX = src.minX;\n  target.minY = src.minY;\n  target.maxX = src.maxX;\n  target.maxY = src.maxY;\n}\n","import type {\n  SemanticsDiffNode,\n  SemanticsDiff,\n} from \"../rive_advanced.mjs\";\n\nexport type {\n  SemanticsDiffNode,\n  SemanticsDiff,\n};\n\n// ---------------------------------------------------------------------------\n// SemanticRole — mirrors rive::SemanticRole\n// ---------------------------------------------------------------------------\nexport const SemanticRole = {\n  none: 0,\n  button: 1,\n  link: 2,\n  checkbox: 3,\n  switchControl: 4,\n  slider: 5,\n  textField: 6,\n  text: 7,\n  image: 8,\n  group: 9,\n  list: 10,\n  listItem: 11,\n  tab: 12,\n  tabList: 13,\n  dialog: 14,\n  alertDialog: 15,\n  radioGroup: 16,\n  radioButton: 17,\n} as const;\n\nexport type SemanticRole = (typeof SemanticRole)[keyof typeof SemanticRole];\n\n// ---------------------------------------------------------------------------\n// SemanticState — mirrors rive::SemanticState bitmask\n//\n// Bits 0-7 are trait-gated (only meaningful when the corresponding\n// SemanticTrait is set). Bits 8-13 are non-trait states.\n//\n// Check state is the exception: it is a two-bit *field* at bits 2-3 rather\n// than a flag, because a checkbox is tri-state. It is not a member of this\n// table — read it with checkStateOf().\n// ---------------------------------------------------------------------------\nexport const SemanticState = {\n  None: 0,\n\n  // Trait-gated\n  Expanded: 1 << 0, // requires Expandable\n  Selected: 1 << 1, // requires Selectable\n  // Bits 2-3 are the check state field, not independent flags -- see SemanticCheckState.\n  Toggled: 1 << 4, // requires Toggleable\n  Required: 1 << 5, // requires Requirable\n  Disabled: 1 << 6, // requires Enablable\n  Focused: 1 << 7, // requires Focusable\n\n  // Non-trait\n  Hidden: 1 << 8,\n  LiveRegion: 1 << 9,\n  ReadOnly: 1 << 10,\n  Modal: 1 << 11,\n  Obscured: 1 << 12,\n  Multiline: 1 << 13,\n} as const;\n\nexport function hasState(flags: number, state: number): boolean {\n  return (flags & state) !== 0;\n}\n\n// SemanticCheckState — mirrors rive::SemanticCheckState\n//\n// The tri-state of a checkable node. Occupies two bits of stateFlags at\n// CHECK_STATE_OFFSET, so it is read as a value rather than tested as a flag.\n// Only meaningful when the Checkable trait is set.\nexport const SemanticCheckState = {\n  Unchecked: 0,\n  Checked: 1,\n  Mixed: 2,\n} as const;\n\nexport type SemanticCheckState =\n  (typeof SemanticCheckState)[keyof typeof SemanticCheckState];\n\n/** Bit offset of the check field within stateFlags. */\nexport const CHECK_STATE_OFFSET = 2;\n\n/** Mask of the check field within stateFlags. */\nexport const CHECK_STATE_MASK = 0b11 << CHECK_STATE_OFFSET;\n\n/**\n * Decodes the check field out of `flags`. The field is two bits. Returns 0, 1, or 2\n * per the mapping in SemanticCheckState.\n */\nexport function checkStateOf(flags: number): SemanticCheckState {\n  const value = (flags & CHECK_STATE_MASK) >> CHECK_STATE_OFFSET;\n  return value >= SemanticCheckState.Mixed\n    ? SemanticCheckState.Mixed\n    : (value as SemanticCheckState);\n}\n\n/**\n * Controls when the instance builds semantic trees and accessibility overlays.\n *\n * - `disabled`: no semantics work.\n * - `enabled`: semantics and overlay are active immediately after load.\n */\nexport const SemanticMode = {\n  Disabled: \"disabled\",\n  Enabled: \"enabled\",\n} as const;\n\nexport type SemanticMode = (typeof SemanticMode)[keyof typeof SemanticMode];\n\nexport interface RiveSemanticsOptions {\n  /**\n   * aria-label for the semantic DOM container element\n   */\n  riveCanvasLabel?: string;\n}\n\n// ---------------------------------------------------------------------------\n// SemanticTrait — mirrors rive::SemanticTrait bitmask\n//\n// Traits declare what *capabilities* a node has. A state flag is only\n// meaningful when its corresponding trait is set.\n// ---------------------------------------------------------------------------\nexport const SemanticTrait = {\n  None: 0,\n  Expandable: 1 << 0,\n  Selectable: 1 << 1,\n  Checkable: 1 << 2,\n  Toggleable: 1 << 3,\n  Requirable: 1 << 4,\n  Enablable: 1 << 5,\n  Focusable: 1 << 6,\n} as const;\n\nexport function hasTrait(flags: number, trait: number): boolean {\n  return (flags & trait) !== 0;\n}\n\n// ---------------------------------------------------------------------------\n// SemanticActionType — mirrors rive::SemanticActionType\n// ---------------------------------------------------------------------------\nexport const SemanticActionType = {\n  tap: 0,\n  increase: 1,\n  decrease: 2,\n} as const;\n\nexport type SemanticActionType =\n  (typeof SemanticActionType)[keyof typeof SemanticActionType];\n\n// ---------------------------------------------------------------------------\n// SemanticNodeData — in-memory representation of a single node in the tree\n// ---------------------------------------------------------------------------\nexport interface SemanticNodeData {\n  readonly id: number;\n  parentId: number;\n  role: number;\n  label: string;\n  value: string;\n  hint: string;\n  stateFlags: number;\n  traitFlags: number;\n  headingLevel: number;\n  minX: number;\n  minY: number;\n  maxX: number;\n  maxY: number;\n  children: number[];\n}\n\n// ---------------------------------------------------------------------------\n// Helpers — readable names for bitmask flags\n// ---------------------------------------------------------------------------\n\nconst _roleNames: Record<number, string> = {};\nfor (const [name, val] of Object.entries(SemanticRole)) {\n  _roleNames[val as number] = name;\n}\n\nconst _stateEntries = Object.entries(SemanticState).filter(\n  ([, v]) => v !== 0\n) as [string, number][];\n\nconst _traitEntries = Object.entries(SemanticTrait).filter(\n  ([, v]) => v !== 0\n) as [string, number][];\n\nexport function roleName(role: number): string {\n  return _roleNames[role] ?? `unknown(${role})`;\n}\n\nexport function stateNames(flags: number): string {\n  if (flags === 0) return \"none\";\n  const active: string[] = [];\n  for (const [name, bit] of _stateEntries) {\n    if (flags & bit) active.push(name);\n  }\n  switch (checkStateOf(flags)) {\n    case SemanticCheckState.Checked:\n      active.push(\"Checked\");\n      break;\n    case SemanticCheckState.Mixed:\n      active.push(\"Mixed\");\n      break;\n  }\n  return active.join(\", \") || \"none\";\n}\n\nexport function traitNames(flags: number): string {\n  if (flags === 0) return \"none\";\n  const active: string[] = [];\n  for (const [name, bit] of _traitEntries) {\n    if (flags & bit) active.push(name);\n  }\n  return active.join(\", \") || \"none\";\n}\n","import type * as rc from \"../rive_advanced.mjs\";\nimport type { SemanticTreeModel } from \"./semanticTreeModel\";\nimport type { SemanticNodeData } from \"./types\";\nimport {\n  SemanticRole,\n  SemanticState,\n  SemanticCheckState,\n  SemanticTrait,\n  SemanticActionType,\n  RiveSemanticsOptions,\n  checkStateOf,\n  hasState,\n  hasTrait,\n} from \"./types\";\n\n// ---------------------------------------------------------------------------\n// Public interface\n// ---------------------------------------------------------------------------\n\nexport interface AccessibilityOverlayOptions {\n  canvas: HTMLCanvasElement;\n  /** Unique string per Rive instance (used for prefixed IDs). */\n  instanceId: string;\n  /** Optional options for controlling semantic tree behavior and rendering */\n  semanticsOptions: RiveSemanticsOptions;\n  /** Callback to fire a semantic action back into the state machine. */\n  fireAction: (nodeId: number, actionType: SemanticActionType) => void;\n  /** Callback when AT focuses a semantic node (routes to SemanticManager::requestFocus). */\n  requestFocus: (nodeId: number) => void;\n  /** Callback when AT focus leaves a semantic node. */\n  clearFocus: () => void;\n  /**\n   * When false (default), the overlay only moves focus while focus is already\n   * inside Rive (overlay or canvas); when true it may also pull focus from outside Rive.\n   */\n  allowFocusInterrupt?: boolean;\n}\n\n/**\n * Indication of what changed since the last overlay update.\n *\n * - `semanticChanged` — semantic tree content/structure changed; attributes,\n *   DOM order, and stale removal need reconciling.\n * - `nodeGeometryChanged` — node bounds changed in the tree model.\n * - `layoutChanged` — canvas size/position changed (or the transform container\n *   hasn't been created yet); the artboard→canvas transform must be recomputed.\n */\nexport interface OverlayChange {\n  semanticChanged: boolean;\n  nodeGeometryChanged: boolean;\n  layoutChanged: boolean;\n}\n\n/**\n * Creates and manages an invisible DOM tree overlaying a Rive canvas. This is for\n * screen readers to discover and interact with the Rive content.\n *\n * Each semantic node in the {@link SemanticTreeModel} gets a corresponding\n * DOM element with appropriate ARIA role, states, and action handlers so\n * assistive technologies (i.e. screen readers) can discover\n * and interact with the Rive content.\n *\n * Each node receives a prefixed ID (`id=rive-{instanceId}-sem-{nodeId}`) to avoid host-page ID collisions.\n * The nodeID is Rive's semantic node ID from core runtime.\n * Each node is styled with `pointer-events: none`. Interactive nodes can receive\n * programmatic focus and keydown events without entering the browser Tab order.\n */\nexport class AccessibilityOverlay {\n  private container: HTMLDivElement;\n  private canvas: HTMLCanvasElement;\n  private semanticsOptions: RiveSemanticsOptions;\n  private elements: Map<number, HTMLElement> = new Map();\n  /** Visually-hidden description spans keyed by node ID, referenced by aria-describedby. */\n  private descElements: Map<number, HTMLSpanElement> = new Map();\n  private instanceId: string;\n  private fireAction: (nodeId: number, actionType: SemanticActionType) => void;\n  private requestFocus: (nodeId: number) => void;\n  private clearFocus: () => void;\n  private lastSemanticVersion = -1;\n  private lastGeometryVersion = -1;\n  /** Text elements whose fit-scale needs recomputing, batched per update (see flushTextGeometry). */\n  private pendingTextGeometry: HTMLElement[] = [];\n  /** Last measured box-size|text key per text element, to skip redundant re-measures. */\n  private textGeometryKeys: WeakMap<HTMLElement, string> = new WeakMap();\n  private lastCanvasPositioning: { width: number; height: number; offsetTop: number; offsetLeft: number } = {\n    width: -1, height: -1, offsetTop: -1, offsetLeft: -1,\n  }\n  /**\n   * Set when a ResizeObserver/window-resize signals the canvas geometry may have\n   * changed, cleared once the transform is re-synced. Lets {@link needsUpdate}\n   * report geometry changes without a per-frame `getBoundingClientRect()` reflow.\n   * Starts true so the first update computes the transform.\n   */\n  private _geometryDirty = true;\n  /** True while reconciling the DOM (reserved for future focus-sync guards). */\n  private isUpdating = false;\n  /** See {@link AccessibilityOverlayOptions.allowFocusInterrupt}. */\n  private allowFocusInterrupt: boolean;\n  /**\n   * Single child div of the overlay container that carries the artboard→CSS\n   * transform. All semantic node elements are children of this div and express\n   * their positions in raw artboard-space coordinates. The CSS transform on\n   * this container maps artboard units to CSS pixels in one GPU pass — no\n   * per-node matrix multiplication required.\n   */\n  private transformContainer: HTMLDivElement | null = null;\n  private _artboardBounds: rc.AABB = { minX: 0, minY: 0, maxX: 0, maxY: 0 };\n\n  private repositionTimer: ReturnType<typeof setTimeout> | null = null;\n  private canvasResizeObserver: ResizeObserver | null = null;\n  private parentResizeObserver: ResizeObserver | null = null;\n  /**\n   * Detects canvas *position* drift. See {@link observePosition}.\n   */\n  private positionObserver: IntersectionObserver | null = null;\n  private readonly _onWindowResize = (): void => this.scheduleReposition();\n\n  constructor(options: AccessibilityOverlayOptions) {\n    this.instanceId = options.instanceId;\n    this.fireAction = options.fireAction;\n    this.requestFocus = options.requestFocus;\n    this.clearFocus = options.clearFocus;\n    this.canvas = options.canvas;\n    this.semanticsOptions = options.semanticsOptions;\n    this.allowFocusInterrupt = options.allowFocusInterrupt ?? false;\n    this.container = this.createContainer(options.canvas);\n    this.attachPositionObservers();\n  }\n\n  getSemanticOverlayContainer(): HTMLDivElement {\n    return this.container;\n  }\n\n  // ---- Container lifecycle ----\n\n  // Keep the a11y tree overlay matched to the canvas's position and size:\n  // 1. The canvas resized           — ResizeObserver\n  // 2. The canvas's parent resized   — ResizeObserver\n  // 3. The window resized            — resize event\n  // 4. The canvas moved/drifted      — IntersectionObserver (see observePosition)\n\n  private attachPositionObservers(): void {\n    this.canvasResizeObserver = new ResizeObserver(() => this.scheduleReposition());\n    this.canvasResizeObserver.observe(this.canvas);\n\n    const parent = this.canvas.parentElement;\n    if (parent) {\n      this.parentResizeObserver = new ResizeObserver(() => this.scheduleReposition());\n      this.parentResizeObserver.observe(parent);\n    }\n\n    window.addEventListener(\"resize\", this._onWindowResize);\n\n    this.observePosition();\n  }\n\n  /**\n   * Arms an IntersectionObserver whose root box is bounded to the canvas, so it\n   * fires when the canvas moves relative to the viewport — position drift that\n   * no ResizeObserver reports. Lets us re-sync the overlay container on a move\n   * instead of recalculating the canvas bounding box every frame.\n   */\n  private observePosition(): void {\n    if (typeof IntersectionObserver === \"undefined\") return;\n    this.positionObserver?.disconnect();\n    this.positionObserver = null;\n\n    const rect = this.canvas.getBoundingClientRect();\n    // Can't frame a zero-area element; it will re-arm on the next reposition.\n    if (!rect.width || !rect.height) return;\n\n    // Shrink the viewport root box down to exactly the canvas: a negative inset\n    // from each viewport edge to the matching canvas edge, in CSS shorthand\n    // order (top, right, bottom, left). Rounded so sub-pixel jitter doesn't trip\n    // the 1.0 threshold.\n    const insetToPx = (v: number): string => `${-Math.round(v)}px`;\n    const rootMargin = [\n      rect.top,                          // top:    viewport top → canvas top\n      window.innerWidth - rect.right,    // right:  viewport right → canvas right\n      window.innerHeight - rect.bottom,  // bottom: viewport bottom → canvas bottom\n      rect.left,                         // left:   viewport left → canvas left\n    ]\n      .map(insetToPx)\n      .join(\" \");\n\n    // The observer emits an initial notification for the current (contained)\n    // state; ignore that and only react to a subsequent move.\n    let armed = false;\n    this.positionObserver = new IntersectionObserver(\n      () => {\n        if (!armed) {\n          armed = true;\n          return;\n        }\n        this.scheduleReposition();\n      },\n      { threshold: 1.0, rootMargin }\n    );\n    this.positionObserver.observe(this.canvas);\n  }\n\n  private scheduleReposition(): void {\n    // A resize/move may have changed canvas size/scale/position; force a\n    // transform recompute on the next frame's update.\n    this._geometryDirty = true;\n    if (this.repositionTimer !== null) return;\n    this.repositionTimer = setTimeout(() => {\n      this.repositionTimer = null;\n      this.syncContainerGeometry();\n      // Re-arm the position observer at the canvas's new location.\n      this.observePosition();\n    }, 500); // Throttle to avoid rapid style recalculations\n  }\n\n  private syncContainerGeometry(): void {\n    const rect = this.canvas.getBoundingClientRect();\n    const top = this.canvas.offsetTop;\n    const left = this.canvas.offsetLeft;\n    if (\n      rect.width === this.lastCanvasPositioning.width &&\n      rect.height === this.lastCanvasPositioning.height &&\n      top === this.lastCanvasPositioning.offsetTop &&\n      left === this.lastCanvasPositioning.offsetLeft\n    ) return;\n    this.container.style.top = top + \"px\";\n    this.container.style.left = left + \"px\";\n    this.container.style.width = rect.width + \"px\";\n    this.container.style.height = rect.height + \"px\";\n    this.container.tabIndex = -1;\n    this.lastCanvasPositioning.width = rect.width;\n    this.lastCanvasPositioning.height = rect.height;\n    this.lastCanvasPositioning.offsetTop = top;\n    this.lastCanvasPositioning.offsetLeft = left;\n  }\n\n  private createContainer(canvas: HTMLCanvasElement): HTMLDivElement {\n    const container = document.createElement(\"div\");\n    container.id = `rive-a11y-${this.instanceId}`;\n    container.setAttribute(\"role\", \"region\");\n    container.setAttribute(\"aria-label\", this.semanticsOptions?.riveCanvasLabel ?? \"Rive animation\");\n    // Size to the canvas's CSS layout box, not the parent container.\n    const rect = canvas.getBoundingClientRect();\n    container.style.cssText = [\n      \"position:absolute\",\n      `top:${canvas.offsetTop}px`,\n      `left:${canvas.offsetLeft}px`,\n      `width:${rect.width}px`,\n      `height:${rect.height}px`,\n      \"overflow:hidden\",\n      \"pointer-events:none\",\n      // Visually hidden but still in the accessibility tree.\n      // `display:none` and `visibility:hidden` would hide from AT.\n      \"opacity:0\",\n    ].join(\";\");\n\n    canvas.insertAdjacentElement(\"afterend\", container);\n    return container;\n  }\n\n  /**\n   * Returns what changed since the last update, or null if nothing changed.\n   *\n   * Callers use this to avoid recomputing the (relatively expensive)\n   * artboard→canvas transform on frames where only node bounds changed in the\n   * tree: the transform only needs recomputing when `layoutChanged` is true.\n   */\n  needsUpdate(tree: SemanticTreeModel): OverlayChange | null {\n    const semanticChanged = tree.semanticVersion !== this.lastSemanticVersion;\n    const nodeGeometryChanged =\n      tree.geometryVersion !== this.lastGeometryVersion;\n    const layoutChanged = this._geometryDirty || !this.transformContainer;\n    if (!semanticChanged && !nodeGeometryChanged && !layoutChanged) return null;\n    return { semanticChanged, nodeGeometryChanged, layoutChanged };\n  }\n\n  /**\n   * Update the overlay DOM to reflect the current state of the semantic tree.\n   * Call once per frame after `applyDiff` when {@link needsUpdate} reports a\n   * change, when layout/transform inputs are dirty, or when a fresh\n   * `forwardMat` is supplied (even if the tree versions are unchanged).\n   *\n   * @param tree           The in-memory semantic tree model\n   * @param forwardMat     Artboard→canvas-pixel transform from `computeAlignment`,\n   *                       or null to reuse the existing CSS transform on the\n   *                       transform container\n   * @param dpr            Device pixel ratio used for the canvas backing store\n   * @param artboardBounds The artboard's own bounding rectangle\n   */\n  update(\n    tree: SemanticTreeModel,\n    forwardMat: rc.Mat2D | null,\n    dpr: number,\n    artboardBounds: rc.AABB,\n    change?: OverlayChange | null\n  ): void {\n    let overlayChange = change ?? this.needsUpdate(tree);\n    if (!overlayChange && forwardMat) {\n      overlayChange = {\n        semanticChanged: false,\n        nodeGeometryChanged: false,\n        layoutChanged: true,\n      };\n    }\n    if (!overlayChange) return;\n    this.performUpdate(tree, forwardMat, dpr, artboardBounds, overlayChange);\n  }\n\n  private performUpdate(\n    tree: SemanticTreeModel,\n    forwardMat: rc.Mat2D | null,\n    dpr: number,\n    artboardBounds: rc.AABB,\n    change: OverlayChange\n  ): void {\n    const { semanticChanged, nodeGeometryChanged } = change;\n    // Per-node change sets only describe the most recent applyDiff. If more\n    // than one semantic version elapsed since our last update (first build,\n    // or a diff we never consumed), fall back to re-applying attributes on\n    // every node rather than trusting an incomplete set.\n    const reapplyAllAttributes =\n      tree.semanticVersion - this.lastSemanticVersion > 1;\n    this.lastSemanticVersion = tree.semanticVersion;\n    this.lastGeometryVersion = tree.geometryVersion;\n\n    this.isUpdating = true;\n\n    this._artboardBounds = artboardBounds;\n\n    // Container box + artboard transform only run when a fresh forwardMat was\n    // supplied (layout/transform dirty). Node-only bounds updates reuse the\n    // existing CSS transform and go through updateGeometryForChangedNodes.\n    // Skipping syncContainerGeometry here on semantic-only frames avoids a\n    // getBoundingClientRect() reflow on every animation frame. The throttled\n    // scheduleReposition() path still keeps the container aligned when the page\n    // layout shifts.\n    if (forwardMat) {\n      this.syncContainerGeometry();\n      this.syncTransformContainer(forwardMat, dpr, artboardBounds);\n      // Transform is now in sync with the latest layout.\n      this._geometryDirty = false;\n    }\n\n    if (semanticChanged) {\n      const rootEl = this.transformContainer ?? this.container;\n      const activeIds = new Set<number>();\n\n      this.rebuildChildren(\n        rootEl,\n        tree.roots as number[],\n        tree,\n        0, // parentLeft in artboard space (transform container origin)\n        0, // parentTop  in artboard space\n        activeIds,\n        reapplyAllAttributes\n      );\n\n      const staleIds: number[] = [];\n      this.elements.forEach((_el, id) => {\n        if (!activeIds.has(id)) staleIds.push(id);\n      });\n      for (const id of staleIds) {\n        const el = this.elements.get(id);\n        if (el && el.parentNode) el.parentNode.removeChild(el);\n        this.elements.delete(id);\n        const desc = this.descElements.get(id);\n        if (desc && desc.parentNode) desc.parentNode.removeChild(desc);\n        this.descElements.delete(id);\n      }\n    } else if (nodeGeometryChanged) {\n      this.updateGeometryForChangedNodes(tree);\n    }\n\n    // Text scaling needs layout reads; batch them into one pass after all\n    // position/attribute writes so each frame forces at most one reflow.\n    this.flushTextGeometry();\n\n    this.isUpdating = false;\n  }\n\n  /** Remove the overlay from the DOM entirely. */\n  destroy(): void {\n    if (this.repositionTimer !== null) {\n      clearTimeout(this.repositionTimer);\n      this.repositionTimer = null;\n    }\n    window.removeEventListener(\"resize\", this._onWindowResize);\n    this.canvasResizeObserver?.disconnect();\n    this.parentResizeObserver?.disconnect();\n    this.positionObserver?.disconnect();\n    if (this.container.parentNode) {\n      this.container.parentNode.removeChild(this.container);\n    }\n    this.elements.clear();\n    this.descElements.clear();\n    this.pendingTextGeometry.length = 0;\n  }\n\n  // ---- Tree → DOM reconciliation ----\n\n  /**\n   * Reconcile a parent DOM element's children with an ordered list of\n   * semantic node IDs. Creates, updates, and reorders elements as needed.\n   *\n   * Node positions are expressed in artboard-space coordinates. The CSS\n   * transform on the transform container maps artboard units to CSS pixels,\n   * so no per-node matrix multiplication is required here.\n   *\n   * @param parentArtboardLeft  Absolute artboard minX of the parent node (0 for roots)\n   * @param parentArtboardTop   Absolute artboard minY of the parent node (0 for roots)\n   */\n  private rebuildChildren(\n    parentEl: HTMLElement,\n    childIds: number[],\n    tree: SemanticTreeModel,\n    parentArtboardLeft: number,\n    parentArtboardTop: number,\n    activeIds: Set<number>,\n    applyAllAttributes: boolean\n  ): void {\n    for (let i = 0; i < childIds.length; i++) {\n      const nodeId = childIds[i];\n      const nodeData = tree.nodeById(nodeId);\n      if (!nodeData) continue;\n\n      activeIds.add(nodeId);\n\n      let el = this.elements.get(nodeId);\n      const isNew = !el;\n      if (!el) {\n        el = this.createElement(nodeData);\n        this.elements.set(nodeId, el);\n      }\n\n      // Attributes are only applied to new elements and nodes whose semantic\n      // fields changed in the latest diff. Skipping redundant setAttribute\n      // calls eliminates WebKit AX notifications that knock VoiceOver off its\n      // current element.\n      if (isNew || applyAllAttributes || tree.semanticChangedIds.has(nodeId)) {\n        this.applyAttributes(el, nodeData);\n      }\n      this.applyPosition(el, nodeData, parentArtboardLeft, parentArtboardTop);\n\n      // Only touch the DOM tree if the element isn't already in the correct\n      // position. Moving a focused element can blur it and knock AT off the\n      // current node.\n      const currentChild = parentEl.children[i] as HTMLElement | undefined;\n      if (currentChild !== el) {\n        if (currentChild) {\n          parentEl.insertBefore(el, currentChild);\n        } else {\n          parentEl.appendChild(el);\n        }\n      }\n\n      // Reflect the runtime Focused state into DOM focus. Runs after insertion\n      // so the element is attached, and skips elements that already hold focus.\n      // The cheap trait/state flag checks gate the (per-node) DOM queries below,\n      // so the activeElement/closest/contains walks only run for a node that is\n      // actually focusable + focused — not for every node on every frame.\n      if (\n        hasTrait(nodeData.traitFlags, SemanticTrait.Focusable) &&\n        hasState(nodeData.stateFlags, SemanticState.Focused)\n      ) {\n        const active = document.activeElement as Element | null;\n        // While focus is inside one of our modal dialogs, don't pull it back\n        // out to a background node.\n        const focusedModal = active?.closest('[aria-modal=\"true\"]');\n        const trappedByModal =\n          !!focusedModal &&\n          this.container.contains(focusedModal) &&\n          !focusedModal.contains(el);\n        if (active !== el && !trappedByModal && this.canMoveFocus()) {\n          el.focus();\n        }\n      }\n\n      // Recurse into children with this node's absolute artboard position.\n      if (nodeData.children.length > 0) {\n        this.rebuildChildren(\n          el,\n          nodeData.children,\n          tree,\n          nodeData.minX,\n          nodeData.minY,\n          activeIds,\n          applyAllAttributes\n        );\n      }\n\n      // Focus a modal/alert dialog when it first appears (after children are\n      // built so the focus target can be resolved from the subtree).\n      if (isNew) this.autoFocusDialogOnAppear(el, nodeData, tree);\n    }\n  }\n\n  /**\n   * Reposition only the subtrees whose bounds changed in the latest diff.\n   * Descendants are included because node CSS positions are parent-relative.\n   */\n  private updateGeometryForChangedNodes(tree: SemanticTreeModel): void {\n    for (const nodeId of Array.from(tree.geometryChangedIds)) {\n      const nodeData = tree.nodeById(nodeId);\n      if (!nodeData) continue;\n\n      let parentLeft = 0;\n      let parentTop = 0;\n      let parentEl: HTMLElement = this.transformContainer ?? this.container;\n      if (nodeData.parentId >= 0) {\n        const parent = tree.nodeById(nodeData.parentId);\n        if (parent) {\n          parentLeft = parent.minX;\n          parentTop = parent.minY;\n          parentEl = this.elements.get(nodeData.parentId) ?? parentEl;\n        }\n      }\n\n      this.updateNodeGeometrySubtree(\n        tree,\n        nodeId,\n        parentLeft,\n        parentTop,\n        parentEl\n      );\n    }\n  }\n\n  private updateNodeGeometrySubtree(\n    tree: SemanticTreeModel,\n    nodeId: number,\n    parentArtboardLeft: number,\n    parentArtboardTop: number,\n    _parentEl: HTMLElement\n  ): void {\n    const nodeData = tree.nodeById(nodeId);\n    if (!nodeData) return;\n    const el = this.elements.get(nodeId);\n    if (!el) return;\n\n    this.applyPosition(el, nodeData, parentArtboardLeft, parentArtboardTop);\n\n    for (const childId of nodeData.children) {\n      this.updateNodeGeometrySubtree(\n        tree,\n        childId,\n        nodeData.minX,\n        nodeData.minY,\n        el\n      );\n    }\n  }\n\n  /**\n   * Whether the overlay may move focus now. Following focus already inside this\n   * instance is always allowed; pulling it in from the host page is gated behind\n   * allowFocusInterrupt (from the Rive class).\n   */\n  private canMoveFocus(): boolean {\n    const active = document.activeElement as Element | null;\n    const focusAlreadyInScope =\n      active === this.canvas || this.container.contains(active);\n    return focusAlreadyInScope || this.allowFocusInterrupt;\n  }\n\n  /**\n   * Move focus into a newly appeared modal/alert dialog so screen readers\n   * announce and read its content (web ATs don't auto-enter a freshly mounted\n   * dialog). Skips when focus can't move (see canMoveFocus) or a descendant\n   * already holds it. The dialog's aria-modal keeps focus trapped inside.\n   */\n  private autoFocusDialogOnAppear(\n    el: HTMLElement,\n    node: SemanticNodeData,\n    tree: SemanticTreeModel\n  ): void {\n    if (!isModalDialogRole(node.role, node.stateFlags)) return;\n    if (!this.canMoveFocus()) return;\n\n    // A descendant already holds focus — don't override it.\n    const active = document.activeElement;\n    if (active && active !== el && el.contains(active)) return;\n\n    const target = this.routeDefaultFocusTarget(node, tree) ?? el;\n    if (!target.hasAttribute(\"tabindex\")) target.setAttribute(\"tabindex\", \"-1\");\n    if (document.activeElement !== target) target.focus({ preventScroll: true });\n  }\n\n  /**\n   * Resolve the element assistive technologies (AT) should focus on appearance. Walks the subtree\n   * depth-first and returns the first focusable node's host element, else the\n   * inner <span> of the first labeled leaf. Container and unlabeled nodes are\n   * descended into but never focused. Returns null if nothing qualifies.\n   */\n  private routeDefaultFocusTarget(\n    node: SemanticNodeData,\n    tree: SemanticTreeModel\n  ): HTMLElement | null {\n    for (const childId of node.children) {\n      const child = tree.nodeById(childId);\n      if (!child) continue;\n      const childEl = this.elements.get(childId);\n\n      // Focusable node → its host element (even if it has children).\n      if (childEl && isFocusableNode(child)) return childEl;\n\n      // Container or unlabeled node → descend without focusing it.\n      if (child.children.length > 0 || !child.label) {\n        const nested = this.routeDefaultFocusTarget(child, tree);\n        if (nested) return nested;\n        continue;\n      }\n\n      // Labeled leaf → its inner label span.\n      if (childEl) {\n        return (childEl.querySelector(\":scope > span\") as HTMLElement | null) ?? childEl;\n      }\n    }\n    return null;\n  }\n\n  // ---- Element creation ----\n\n  /** Shared `id` prefix for all semantic node elements of this instance. */\n  private get nodeIdPrefix(): string {\n    return `rive-${this.instanceId}-sem-`;\n  }\n\n  /** Recover the semantic node ID from an overlay element, or null. */\n  private nodeIdFromElement(el: Element): number | null {\n    if (!el.id.startsWith(this.nodeIdPrefix)) return null;\n    const raw = el.id.slice(this.nodeIdPrefix.length);\n    // Guard the empty string explicitly: Number(\"\") is 0, not NaN.\n    if (!raw) return null;\n    const id = Number(raw);\n    return Number.isNaN(id) ? null : id;\n  }\n\n  private createElement(node: SemanticNodeData): HTMLElement {\n    const tag = tagForRole(node.role);\n    const el = document.createElement(tag);\n    el.id = `${this.nodeIdPrefix}${node.id}`;\n    el.style.cssText = BASE_NODE_STYLE;\n\n    if (node.role === SemanticRole.text) {\n      // The positioned outer div is the AX element\n      // VoiceOver uses for its highlight box; an inner <span> carries the text\n      // without position:absolute (which would strip the span from VoiceOver's\n      // bounds calculation).\n      const textSpan = document.createElement(\"span\");\n      textSpan.style.cssText = SPAN_EXP;\n      el.appendChild(textSpan);\n    }\n\n    this.attachActionHandlers(el, node);\n    return el;\n  }\n\n  // ---- Action handlers ----\n\n  /**\n   * Wire arrow-key roving focus for a group member (tab, radio). Arrow keys\n   * move focus to the next/previous member (wrapping), optionally Home/End jump\n   * to first/last, and the newly focused member receives a tap action.\n   */\n  private attachRovingNav(\n    el: HTMLElement,\n    opts: { members: () => HTMLElement[]; includeHomeEnd: boolean }\n  ): void {\n    el.addEventListener(\"keydown\", (e) => {\n      let target: \"next\" | \"prev\" | \"first\" | \"last\" | null = null;\n      if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") target = \"next\";\n      else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") target = \"prev\";\n      else if (opts.includeHomeEnd && e.key === \"Home\") target = \"first\";\n      else if (opts.includeHomeEnd && e.key === \"End\") target = \"last\";\n      if (!target) return;\n\n      e.preventDefault();\n      const members = opts.members();\n      const idx = members.indexOf(el);\n      if (idx < 0) return;\n\n      const n = members.length;\n      const next =\n        target === \"next\" ? members[(idx + 1) % n]\n        : target === \"prev\" ? members[(idx - 1 + n) % n]\n        : target === \"first\" ? members[0]\n        : members[n - 1];\n\n      if (next && next !== el) {\n        next.focus();\n        const nextId = this.nodeIdFromElement(next);\n        if (nextId !== null) this.fireAction(nextId, SemanticActionType.tap);\n      }\n    });\n  }\n\n  private attachActionHandlers(el: HTMLElement, node: SemanticNodeData): void {\n    const role = node.role;\n    const nodeId = node.id;\n\n    if (isClickableRole(role)) {\n      el.addEventListener(\"click\", () => {\n        this.fireAction(nodeId, SemanticActionType.tap);\n      });\n      // Links activate on Enter only (Space scrolls the page per browser\n      // convention). All other clickable roles accept both Enter and Space.\n      const activationKeys =\n        role === SemanticRole.link ? [\"Enter\"] : [\"Enter\", \" \"];\n      el.addEventListener(\"keydown\", (e) => {\n        if (activationKeys.includes(e.key)) {\n          e.preventDefault();\n          this.fireAction(nodeId, SemanticActionType.tap);\n        }\n      });\n    }\n\n    if (role === SemanticRole.slider) {\n      el.addEventListener(\"keydown\", (e) => {\n        if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") {\n          e.preventDefault();\n          this.fireAction(nodeId, SemanticActionType.increase);\n        } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") {\n          e.preventDefault();\n          this.fireAction(nodeId, SemanticActionType.decrease);\n        }\n      });\n    }\n\n    if (role === SemanticRole.tab) {\n      this.attachRovingNav(el, {\n        includeHomeEnd: true,\n        members: () => {\n          const parent = el.parentElement;\n          if (!parent) return [];\n          return Array.from(parent.children).filter(\n            (c): c is HTMLElement =>\n              c instanceof HTMLElement && c.getAttribute(\"role\") === \"tab\"\n          );\n        },\n      });\n    }\n\n    if (role === SemanticRole.radioButton) {\n      this.attachRovingNav(el, {\n        includeHomeEnd: false,\n        members: () => {\n          const group =\n            el.closest<HTMLElement>('[role=\"radiogroup\"]') ?? el.parentElement;\n          if (!group) return [];\n          return Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n        },\n      });\n    }\n\n    // Focus handler for nodes with the Focusable trait. When AT focuses an\n    // element, notify the C++ runtime so it can update internal focus state\n    // (visual focus rings, etc.). Gated on Focusable trait\n    if (hasTrait(node.traitFlags, SemanticTrait.Focusable)) {\n      el.addEventListener(\"focus\", () => {\n        this.requestFocus(nodeId);\n      });\n    }\n  }\n\n  // ---- Attribute application ----\n\n  private applyAttributes(el: HTMLElement, node: SemanticNodeData): void {\n    const role = node.role;\n    const flags = node.stateFlags;\n    const traits = node.traitFlags;\n\n    // Role\n    const ariaRole = ariaRoleForSemantic(role);\n    if (ariaRole) {\n      setAttr(el, \"role\", ariaRole);\n    } else {\n      removeAttr(el, \"role\");\n    }\n\n    // Links: a bare <a> with no href has no link semantics, so set the role\n    // explicitly (ariaRoleForSemantic returns null for link → native <a>).\n    if (role === SemanticRole.link) {\n      setAttr(el, \"role\", \"link\");\n    }\n\n    // Tabindex — keep the screen-reader overlay out of the browser's sequential\n    // Tab order. Interactive/focusable nodes remain programmatically focusable\n    // so AT/runtime focus sync can still target them when needed. List items are\n    // included because Mobile Safari won't iterate them otherwise.\n    if (\n      isInteractiveRole(role) ||\n      hasTrait(traits, SemanticTrait.Focusable) ||\n      role === SemanticRole.listItem\n    ) {\n      setAttr(el, \"tabindex\", \"-1\");\n    } else {\n      removeAttr(el, \"tabindex\");\n    }\n\n    // Label / value / hint\n    if (node.label) {\n      setAttr(el, \"aria-label\", node.label);\n    } else {\n      removeAttr(el, \"aria-label\");\n    }\n\n    if (role === SemanticRole.slider) {\n      if (node.value) {\n        // aria-valuenow must be numeric; keep the display string (e.g. \"75%\")\n        // in aria-valuetext only.\n        const numericValue = parseFloat(node.value);\n        if (Number.isFinite(numericValue)) {\n          setAttr(el, \"aria-valuenow\", String(numericValue));\n        } else {\n          removeAttr(el, \"aria-valuenow\");\n        }\n        setAttr(el, \"aria-valuetext\", node.value);\n      } else {\n        removeAttr(el, \"aria-valuenow\");\n        removeAttr(el, \"aria-valuetext\");\n      }\n      // TODO: aria-valuemin / aria-valuemax are required by ARIA.\n      // Defaulting to horizontal; vertical sliders need orientation data from C++.\n      setAttr(el, \"aria-orientation\", \"horizontal\");\n      setBoolAttr(el, \"aria-readonly\", hasState(flags, SemanticState.ReadOnly));\n    } else {\n      removeAttr(el, \"aria-valuenow\");\n      removeAttr(el, \"aria-valuetext\");\n      removeAttr(el, \"aria-orientation\");\n      removeAttr(el, \"aria-readonly\");\n    }\n\n    if (node.hint) {\n      const descId = `rive-${this.instanceId}-desc-${node.id}`;\n      let descEl = this.descElements.get(node.id);\n      if (!descEl) {\n        descEl = document.createElement(\"span\");\n        descEl.id = descId;\n        descEl.style.cssText = DESC_SPAN_STYLE;\n        this.container.appendChild(descEl);\n        this.descElements.set(node.id, descEl);\n      }\n      if (descEl.textContent !== node.hint) descEl.textContent = node.hint;\n      setAttr(el, \"aria-describedby\", descId);\n    } else {\n      removeAttr(el, \"aria-describedby\");\n      const staleDesc = this.descElements.get(node.id);\n      if (staleDesc) {\n        if (staleDesc.parentNode) staleDesc.parentNode.removeChild(staleDesc);\n        this.descElements.delete(node.id);\n      }\n    }\n\n    // Text nodes: use textContent rather than aria-label so screen readers\n    // announce the text in virtual/browse mode (aria-label on a bare <span>\n    // with no widget role is ignored by some AT in document browse mode).\n    if (role === SemanticRole.text) {\n      const textSpan = el.querySelector(\":scope > span\") ?? el;\n      const text = node.label ?? \"\";\n      if (textSpan.textContent !== text) textSpan.textContent = text;\n      removeAttr(el, \"aria-label\");\n      if (node.headingLevel > 0) {\n        setAttr(el, \"role\", \"heading\");\n        setAttr(el, \"aria-level\", String(node.headingLevel));\n      } else {\n        // The generic role branch above already cleared role=\"heading\";\n        // aria-level must go with it when a heading reverts to plain text.\n        removeAttr(el, \"aria-level\");\n      }\n    }\n\n    // ---- Trait-gated states ----\n    // Only set the ARIA property when the trait is present. When the trait\n    // is absent, remove the attribute so AT sees \"not applicable\" rather\n    // than \"false\".\n\n    if (hasTrait(traits, SemanticTrait.Expandable) && ARIA_EXPANDED_ROLES.has(role)) {\n      setBoolAttr(el, \"aria-expanded\", hasState(flags, SemanticState.Expanded));\n    } else {\n      removeAttr(el, \"aria-expanded\");\n    }\n\n    // aria-selected is required on ALL tabs per ARIA spec regardless of trait;\n    // for other roles it is trait-gated and guarded to ARIA_SELECTED_ROLES.\n    if (role === SemanticRole.tab) {\n      setBoolAttr(el, \"aria-selected\", hasState(flags, SemanticState.Selected));\n    } else if (hasTrait(traits, SemanticTrait.Selectable) && ARIA_SELECTED_ROLES.has(role)) {\n      setBoolAttr(el, \"aria-selected\", hasState(flags, SemanticState.Selected));\n    } else {\n      removeAttr(el, \"aria-selected\");\n    }\n\n    if (hasTrait(traits, SemanticTrait.Checkable) && ARIA_CHECKED_ROLES.has(role)) {\n      // Check state is a tri-state field, but not every checkable role\n      // accepts all three values — see ARIA_MIXED_ROLES.\n      const checkState = checkStateOf(flags);\n      if (\n        checkState === SemanticCheckState.Mixed &&\n        ARIA_MIXED_ROLES.has(role)\n      ) {\n        setAttr(el, \"aria-checked\", \"mixed\");\n      } else {\n        setBoolAttr(\n          el,\n          \"aria-checked\",\n          checkState === SemanticCheckState.Checked\n        );\n      }\n    } else {\n      removeAttr(el, \"aria-checked\");\n    }\n\n    if (hasTrait(traits, SemanticTrait.Toggleable)) {\n      if (ARIA_PRESSED_ROLES.has(role)) {\n        setBoolAttr(el, \"aria-pressed\", hasState(flags, SemanticState.Toggled));\n      } else {\n        removeAttr(el, \"aria-pressed\");\n      }\n      // switch uses aria-checked (not aria-pressed) for its on/off state.\n      if (role === SemanticRole.switchControl) {\n        setBoolAttr(el, \"aria-checked\", hasState(flags, SemanticState.Toggled));\n      }\n    } else {\n      removeAttr(el, \"aria-pressed\");\n    }\n\n    if (hasTrait(traits, SemanticTrait.Requirable) && ARIA_REQUIRED_ROLES.has(role)) {\n      setBoolAttr(el, \"aria-required\", hasState(flags, SemanticState.Required));\n    } else {\n      removeAttr(el, \"aria-required\");\n    }\n\n    if (hasTrait(traits, SemanticTrait.Enablable)) {\n      setBoolAttr(\n        el,\n        \"aria-disabled\",\n        hasState(flags, SemanticState.Disabled)\n      );\n    } else {\n      removeAttr(el, \"aria-disabled\");\n    }\n\n    // ---- Non-trait states ----\n\n    // Hide from AT when explicitly hidden, or when an image has no accessible\n    // name — a nameless role=\"img\" is a WCAG 1.1.1 violation; treat it as\n    // decorative instead.\n    const isDecorativeImage = role === SemanticRole.image && !node.label;\n    if (hasState(flags, SemanticState.Hidden) || hasState(flags, SemanticState.Obscured) || isDecorativeImage) {\n      setAttr(el, \"aria-hidden\", \"true\");\n    } else {\n      removeAttr(el, \"aria-hidden\");\n    }\n\n    if (hasState(flags, SemanticState.LiveRegion)) {\n      setAttr(el, \"aria-live\", \"polite\");\n    } else {\n      removeAttr(el, \"aria-live\");\n    }\n\n    // textField-specific\n    // TODO: Details here may change once we implement text inputs\n    if (role === SemanticRole.textField) {\n      setBoolAttr(el, \"aria-readonly\", hasState(flags, SemanticState.ReadOnly));\n      setBoolAttr(\n        el,\n        \"aria-multiline\",\n        hasState(flags, SemanticState.Multiline)\n      );\n      // Surface the current field value as DOM text so screen readers can\n      // announce it. Only safe when the node has no semantic children —\n      // setting textContent would remove any child elements from the DOM.\n      if (node.children.length === 0) {\n        const value = node.value ?? \"\";\n        if (el.textContent !== value) el.textContent = value;\n      }\n    } else {\n      removeAttr(el, \"aria-multiline\");\n    }\n\n    // alertDialog is always modal per WAI-ARIA; a plain dialog only when the Modal state flag is set.\n    if (isModalDialogRole(role, flags)) {\n      setAttr(el, \"aria-modal\", \"true\");\n    } else {\n      removeAttr(el, \"aria-modal\");\n    }\n  }\n\n  // ---- Positioning ----\n\n  /**\n   * Positions an element in artboard-space coordinates relative to its parent.\n   *\n   * Node bounds stay in raw artboard units — the CSS `transform: matrix(...)`\n   * on the transform container maps artboard units to CSS pixels in one GPU\n   * pass. No per-node forwardMat multiplication or DPR division needed here.\n   *\n   * Round to whole artboard units before comparing to avoid triggering AX\n   * layout notifications from sub-unit floating-point animation jitter.\n   */\n  private applyPosition(\n    el: HTMLElement,\n    node: SemanticNodeData,\n    parentArtboardLeft: number,\n    parentArtboardTop: number\n  ): void {\n    // Clamp each node's rect to the artboard viewport before computing CSS.\n    // Without this, nodes whose artboard bounds exceed the artboard (e.g. a\n    // scroll list container whose height is the full content, not the viewport)\n    // produce CSS heights that overflow the transform container. WebKit then\n    // unions all descendant AX rects and extends the container's AX origin\n    // above the canvas regardless of overflow:hidden on ancestors.\n    const ab = this._artboardBounds;\n    const clampedMinX = Math.max(node.minX, ab.minX);\n    const clampedMinY = Math.max(node.minY, ab.minY);\n    const clampedMaxX = Math.min(node.maxX, ab.maxX);\n    const clampedMaxY = Math.min(node.maxY, ab.maxY);\n\n    const elLeft   = clampedMinX - parentArtboardLeft;\n    const elTop    = clampedMinY - parentArtboardTop;\n    const elWidth  = Math.max(0, clampedMaxX - clampedMinX);\n    const elHeight = Math.max(0, clampedMaxY - clampedMinY);\n\n    const tx = Math.round(elLeft);\n    const ty = Math.round(elTop);\n    const pxWidth  = Math.round(elWidth)  + \"px\";\n    const pxHeight = Math.round(elHeight) + \"px\";\n\n    // Use left/top layout properties for positioning. VoiceOver reliably\n    // handles layout position + a single ancestor CSS transform (the transform\n    // container). Chaining CSS transforms across multiple stacking contexts\n    // (transform container → node identity → item translate) caused VoiceOver\n    // to compute the correct SIZE but wrong POSITION. Artboard clamping above\n    // guarantees tx/ty are always ≥ 0, so the negative-top overflow problem\n    // that originally prompted the switch to CSS transforms no longer applies.\n    const pxLeft = tx + \"px\";\n    const pxTop  = ty + \"px\";\n    if (el.style.left   !== pxLeft)   el.style.left   = pxLeft;\n    if (el.style.top    !== pxTop)    el.style.top    = pxTop;\n    if (el.style.width  !== pxWidth)  el.style.width  = pxWidth;\n    if (el.style.height !== pxHeight) el.style.height = pxHeight;\n    // Clear any CSS transform from a previous render pass.\n    if (el.style.transform) el.style.transform = \"\";\n\n    if (node.role === SemanticRole.text) {\n      this.pendingTextGeometry.push(el);\n    }\n  }\n\n  /**\n   * Scale each queued text span to fit its layout box, batched so a frame\n   * pays at most one synchronous layout: all measurement-reset writes first,\n   * then all rect reads, then all transform writes. Interleaving\n   * write→read→write per node would force a reflow per text node instead.\n   *\n   * Nodes whose box size and text are unchanged since the last pass are\n   * skipped entirely (their existing transform is still correct — the scale\n   * is a ratio of two rects, so ancestor transform changes cancel out).\n   */\n  private flushTextGeometry(): void {\n    if (this.pendingTextGeometry.length === 0) return;\n\n    // Phase 1 — writes: reset spans to their natural size for measurement.\n    // The previous pass's scale must be cleared, or the rect reads below\n    // would measure the scaled span and compound the correction.\n    const toMeasure: Array<{ host: HTMLElement; span: HTMLElement; key: string }> = [];\n    for (const host of this.pendingTextGeometry) {\n      const span = (host.querySelector(\":scope > span\") as HTMLElement | null) ?? host;\n      const key = `${host.style.width}|${host.style.height}|${span.textContent}`;\n      if (this.textGeometryKeys.get(host) === key) continue;\n      span.style.width = \"auto\";\n      span.style.height = \"auto\";\n      span.style.transformOrigin = \"0 0\";\n      span.style.transform = \"\";\n      toMeasure.push({ host, span, key });\n    }\n    this.pendingTextGeometry.length = 0;\n\n    // Phase 2 — reads: one layout pass covers every rect measurement.\n    const transforms = toMeasure.map(({ host, span }) => {\n      const parentRect = host.getBoundingClientRect();\n      const natural = span.getBoundingClientRect();\n      if (natural.width > 0 && natural.height > 0) {\n        const scaleX = parentRect.width / natural.width;\n        const scaleY = parentRect.height / natural.height;\n        return `scale(${scaleX}, ${scaleY})`;\n      }\n      return \"none\";\n    });\n\n    // Phase 3 — writes: apply all transforms.\n    for (let i = 0; i < toMeasure.length; i++) {\n      const { host, span, key } = toMeasure[i];\n      span.style.transform = transforms[i];\n      this.textGeometryKeys.set(host, key);\n    }\n  }\n\n  // ---- Transform container ----\n\n  /**\n   * Creates (on first call) and updates the artboard-space transform container.\n   *\n   * The container is sized to the artboard dimensions and carries a CSS\n   * `transform: matrix(...)` equivalent to `forwardMat / dpr`. All semantic\n   * node elements are children of this container and use raw artboard\n   * coordinates as their CSS `left/top/width/height`, so the CSS compositor\n   * applies the artboard→screen mapping in one pass.\n   */\n  private syncTransformContainer(\n    forwardMat: rc.Mat2D,\n    dpr: number,\n    artboardBounds: rc.AABB\n  ): void {\n    if (!this.transformContainer) {\n      const tc = document.createElement(\"div\");\n      tc.style.cssText = [\n        \"position:absolute\",\n        \"top:0\",\n        \"left:0\",\n        // overflow:visible — artboard viewport clamping is done per-node in\n        // applyPosition\n        \"overflow:visible\",\n        \"pointer-events:none\",\n        \"transform-origin:0 0\",\n      ].join(\";\");\n      this.container.appendChild(tc);\n      this.transformContainer = tc;\n    }\n\n    const w = artboardBounds.maxX - artboardBounds.minX;\n    const h = artboardBounds.maxY - artboardBounds.minY;\n    this.transformContainer.style.width  = Math.round(w) + \"px\";\n    this.transformContainer.style.height = Math.round(h) + \"px\";\n\n    const s = 1 / (dpr || 1);\n    const a  = forwardMat.xx * s;\n    const b  = forwardMat.xy * s;\n    const c  = forwardMat.yx * s;\n    const d  = forwardMat.yy * s;\n    const tx = forwardMat.tx * s;\n    const ty = forwardMat.ty * s;\n    this.transformContainer.style.transform =\n      `matrix(${a},${b},${c},${d},${tx},${ty})`;\n  }\n}\n\n// ---------------------------------------------------------------------------\n// Static helpers (module-private)\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// ARIA attribute eligibility — role sets\n//\n// Each set lists the Rive roles for which a given ARIA attribute is valid per\n// WAI-ARIA 1.2 (\"Used in roles\" + \"Inherits into roles\"). The trait-gated\n// blocks in applyAttributes check these before setting an attribute so that\n// C++ nodes with unexpected trait combinations never produce invalid markup.\n//\n// To add a new role: append it to the relevant set(s) here — no other changes\n// needed in applyAttributes.\n// ---------------------------------------------------------------------------\n\n/** aria-expanded: button, link, checkbox, switch (inherits button), tab. */\nconst ARIA_EXPANDED_ROLES: Set<number> = new Set([\n  SemanticRole.button,\n  SemanticRole.link,\n  SemanticRole.checkbox,\n  SemanticRole.switchControl,\n  SemanticRole.tab,\n]);\n\n/**\n * aria-selected: tab is the only role in our current set that natively\n * supports it. Tab is also handled by an explicit unconditional branch in\n * applyAttributes (ARIA requires it there regardless of Selectable trait), but\n * the set still lists it so the constraint is visible in one place.\n */\nconst ARIA_SELECTED_ROLES: Set<number> = new Set([\n  SemanticRole.tab,\n]);\n\n/** aria-checked: checkbox, radio, switch. */\nconst ARIA_CHECKED_ROLES: Set<number> = new Set([\n  SemanticRole.checkbox,\n  SemanticRole.radioButton,\n  SemanticRole.switchControl,\n]);\n\n/**\n * aria-checked=\"mixed\": checkbox only. ARIA defines checkbox as three-valued\n * (true/false/mixed) but radio and switch as two-valued (true/false), so an\n * indeterminate check state degrades to false for those roles rather than\n * emitting a value they do not support.\n */\nconst ARIA_MIXED_ROLES: Set<number> = new Set([\n  SemanticRole.checkbox,\n]);\n\n/**\n * aria-pressed: button only. switch is a button subclass in ARIA but uses\n * aria-checked (not aria-pressed) for its on/off state — it is intentionally\n * excluded here and handled separately in the Toggleable block.\n */\nconst ARIA_PRESSED_ROLES: Set<number> = new Set([\n  SemanticRole.button,\n]);\n\n/** aria-required: checkbox, textbox, radiogroup. */\nconst ARIA_REQUIRED_ROLES: Set<number> = new Set([\n  SemanticRole.checkbox,\n  SemanticRole.textField,\n  SemanticRole.radioGroup,\n]);\n\n// ---------------------------------------------------------------------------\n\n/** Style for visually-hidden description spans used with aria-describedby. */\nconst DESC_SPAN_STYLE = [\n  \"position:absolute\",\n  \"width:1px\",\n  \"height:1px\",\n  \"overflow:hidden\",\n  \"pointer-events:none\",\n  \"left:-9999px\",\n].join(\";\");\n\nconst BASE_NODE_STYLE = [\n  \"position:absolute\",\n  \"pointer-events:none\",\n  \"box-sizing:border-box\",\n  \"overflow:visible\",\n  \"margin:0\",\n  \"padding:0\",\n  \"transform-origin: 0px 0px 0px\",\n  \"border:none\",\n  \"background:transparent\",\n  \"color:transparent\",\n  // \"list-style:none\",\n].join(\";\");\n\nconst SPAN_EXP = [\n  \"display:inline-block\",\n  \"white-space:nowrap\",\n  \"pointer-events:none\",\n].join(\";\");\n\n/**\n * Attribute writers that skip same-value mutations. Even a no-op setAttribute\n * fires a mutation record, and whether AX layers dedupe those is\n * browser-specific — skipping the write is the only browser-proof guard.\n */\nfunction setAttr(el: Element, attr: string, value: string): void {\n  if (el.getAttribute(attr) !== value) el.setAttribute(attr, value);\n}\n\nfunction removeAttr(el: Element, attr: string): void {\n  if (el.hasAttribute(attr)) el.removeAttribute(attr);\n}\n\nfunction setBoolAttr(el: HTMLElement, attr: string, value: boolean): void {\n  setAttr(el, attr, value ? \"true\" : \"false\");\n}\n\n/** Roles that receive click/Enter/Space action handlers. */\nfunction isClickableRole(role: number): boolean {\n  switch (role) {\n    case SemanticRole.button:\n    case SemanticRole.link:\n    case SemanticRole.checkbox:\n    case SemanticRole.switchControl:\n    case SemanticRole.tab:\n    case SemanticRole.radioButton:\n      return true;\n    default:\n      return false;\n  }\n}\n\n/** Roles that receive tabindex=\"-1\" for programmatic/AT focus (not Tab order). */\nfunction isInteractiveRole(role: number): boolean {\n  switch (role) {\n    case SemanticRole.button:\n    case SemanticRole.link:\n    case SemanticRole.checkbox:\n    case SemanticRole.switchControl:\n    case SemanticRole.slider:\n    case SemanticRole.tab:\n    case SemanticRole.radioButton:\n    case SemanticRole.textField:\n      return true;\n    default:\n      return false;\n  }\n}\n\n/**\n * A modal/alert dialog: alertDialog is always modal per WAI-ARIA, a plain\n * dialog only when the Modal state flag is set.\n */\nfunction isModalDialogRole(role: number, flags: number): boolean {\n  return (\n    role === SemanticRole.alertDialog ||\n    (role === SemanticRole.dialog && hasState(flags, SemanticState.Modal))\n  );\n}\n\n/** Whether a node can receive focus: an interactive role or the Focusable trait. */\nfunction isFocusableNode(node: SemanticNodeData): boolean {\n  return (\n    isInteractiveRole(node.role) ||\n    hasTrait(node.traitFlags, SemanticTrait.Focusable)\n  );\n}\n\n/**\n * Choose an HTML tag for a given role. Prefer native semantic elements\n * where they exist — screen readers treat them more reliably than\n * generic elements with ARIA role overrides.\n */\nfunction tagForRole(role: number): string {\n  switch (role) {\n    case SemanticRole.link:\n      return \"a\";\n    case SemanticRole.text:\n      // The outer div is the positioned AX element VoiceOver measures for its\n      // highlight box. The text itself lives in a child <span> (see createElement).\n      return \"div\";\n    default:\n      return \"div\";\n  }\n}\n\n/**\n * Maps a Rive SemanticRole to an ARIA `role` attribute value.\n * Returns null for roles that don't need an explicit role attribute here\n * (e.g. text nodes use an outer div + inner span with textContent; heading\n * role is applied separately when headingLevel > 0).\n */\nfunction ariaRoleForSemantic(role: number): string | null {\n  switch (role) {\n    case SemanticRole.none:\n      // TODO: Role \"none\" removes the node from the accessibility tree. For now, setting to Group, but maybe we want to switch to \"none\"\n      // or \"presentation\".\n      return \"group\";\n    case SemanticRole.button:\n      return \"button\";\n    case SemanticRole.link:\n      return null; // native <a>\n    case SemanticRole.checkbox:\n      return \"checkbox\";\n    case SemanticRole.switchControl:\n      return \"switch\";\n    case SemanticRole.slider:\n      return \"slider\";\n    case SemanticRole.textField:\n      return \"textbox\";\n    case SemanticRole.image:\n      return \"img\";\n    case SemanticRole.group:\n      return \"group\";\n    case SemanticRole.list:\n      return \"list\";\n    case SemanticRole.listItem:\n      return \"listitem\";\n    case SemanticRole.tab:\n      return \"tab\";\n    case SemanticRole.tabList:\n      return \"tablist\";\n    case SemanticRole.dialog:\n      return \"dialog\";\n    case SemanticRole.alertDialog:\n      return \"alertdialog\";\n    case SemanticRole.radioGroup:\n      return \"radiogroup\";\n    case SemanticRole.radioButton:\n      return \"radio\";\n    case SemanticRole.text:\n      // Text nodes use <span>; heading role is applied separately\n      // when headingLevel > 0.\n      return null;\n    default:\n      return null;\n  }\n}\n","import * as rc from \"../rive_advanced.mjs\";\n\nexport interface TouchInteractionsParams {\n  canvas: HTMLCanvasElement | OffscreenCanvas;\n  artboard: rc.Artboard;\n  stateMachines: rc.StateMachineInstance[];\n  renderer: rc.Renderer;\n  rive: rc.RiveCanvas;\n  fit: rc.Fit;\n  alignment: rc.Alignment;\n  isTouchScrollEnabled?: boolean;\n  dispatchPointerExit?: boolean;\n  enableMultiTouch?: boolean;\n  layoutScaleFactor?: number;\n  // Handles advancing the state machine and draining events/view model property callbacks, applicable to certain pointer interactions\n  advanceAndDrain: (elapsedTime: number) => void;\n}\n\ninterface ClientCoordinates {\n  clientX: number;\n  clientY: number;\n  identifier: number;\n  transformedX?: number | undefined;\n  transformedY?: number | undefined;\n}\n\n/**\n * Extracts ClientCoordinates from a TouchList, respecting multi-touch vs.\n * single-touch mode. In single-touch mode, only the touch matching\n * primaryTouchId is returned (or the first touch when primaryTouchId is null).\n */\nconst getTouchCoordinates = (\n  changedTouches: TouchList,\n  enableMultiTouch: boolean,\n  primaryTouchId: number | null,\n): ClientCoordinates[] => {\n  const coordinates: ClientCoordinates[] = [];\n  if (enableMultiTouch) {\n    for (let i = 0; i < changedTouches.length; i++) {\n      const touch = changedTouches[i];\n      coordinates.push({\n        clientX: touch.clientX,\n        clientY: touch.clientY,\n        identifier: touch.identifier,\n      });\n    }\n  } else {\n    // In \"single-touch mode\", only track the primary finger identified at touchstart.\n    // Search changedTouches for the touch matching the recorded primary touch identifier, or (on initial touchstart)\n    // take the first available touch identifier.\n    let primaryTouch: Touch | null =\n      primaryTouchId !== null\n        ? Array.from(changedTouches).find(\n            (t) => t.identifier === primaryTouchId,\n          ) ?? null\n        : changedTouches[0];\n    if (primaryTouch) {\n      coordinates.push({\n        clientX: primaryTouch.clientX,\n        clientY: primaryTouch.clientY,\n        identifier: primaryTouch.identifier,\n      });\n    }\n  }\n  return coordinates;\n};\n\n/**\n * Returns the clientX and clientY properties from touch or mouse events. Also\n * calls preventDefault() on the event if it is a touchstart or touchmove to prevent\n * scrolling the page on mobile devices\n * @param event - Either a TouchEvent or a MouseEvent\n * @param isTouchScrollEnabled - Whether touch scrolling is enabled\n * @param enableMultiTouch - Whether to process multiple simultaneous touches\n * @param primaryTouchId - When working with single touches, only process the touch\n *   with this identifier. Pass null to accept any touch (used during touchstart to\n *   capture the first finger down).\n * @returns - Coordinates of the clientX and clientY properties from the touch/mouse event\n */\nconst getClientCoordinates = (\n  event: MouseEvent | TouchEvent,\n  isTouchScrollEnabled: boolean,\n  enableMultiTouch: boolean,\n  primaryTouchId: number | null,\n): ClientCoordinates[] => {\n  const touchEvent = event as TouchEvent;\n  if (touchEvent.changedTouches?.length) {\n    // This flag, if false, prevents touch events on the canvas default behavior\n    // which may prevent scrolling if a drag motion on the canvas is performed\n    if (!isTouchScrollEnabled && [\"touchstart\", \"touchmove\"].includes(event.type)) {\n      event.preventDefault();\n    }\n    return getTouchCoordinates(touchEvent.changedTouches, enableMultiTouch, primaryTouchId);\n  }\n  return [\n    {\n      clientX: (event as MouseEvent).clientX,\n      clientY: (event as MouseEvent).clientY,\n      identifier: 0,\n    },\n  ];\n};\n\n/**\n * Registers mouse move/up/down callback handlers on the canvas to send meaningful coordinates to\n * the state machine pointer move/up/down functions based on cursor interaction\n */\nexport const registerTouchInteractions = ({\n  canvas,\n  artboard,\n  stateMachines = [],\n  renderer,\n  rive,\n  fit,\n  alignment,\n  isTouchScrollEnabled = false,\n  dispatchPointerExit = true,\n  enableMultiTouch = false,\n  layoutScaleFactor = 1.0,\n  advanceAndDrain,\n}: TouchInteractionsParams) => {\n  if (\n    !canvas ||\n    !stateMachines.length ||\n    !renderer ||\n    !rive ||\n    !artboard ||\n    typeof window === \"undefined\"\n  ) {\n    return null;\n  }\n  /**\n   * After a touchend event, some browsers may fire synthetic mouse events\n   * (mouseover, mousedown, mousemove, mouseup) if the touch interaction did not cause\n   * any default action (such as scrolling).\n   *\n   * This is done to simulate the behavior of a mouse for applications that do not support\n   * touch events.\n   *\n   * We're keeping track of the previous event to not send the synthetic mouse events if the\n   * touch event was a click (touchstart -> touchend).\n   *\n   * This is only needed when `isTouchScrollEnabled` is false\n   * When true, `preventDefault()` is called which prevents this behaviour.\n   **/\n  let _prevEventType: string | null = null;\n  let _syntheticEventsActive = false;\n\n  /**\n   * When enableMultiTouch is false (\"single-touch mode\"), we track the identifier of the first finger that touched down.\n   * All subsequent touch events are filtered to this identifier so that a second finger\n   * moving cannot displace the tracked pointer position.\n   * Reset to null when the primary finger lifts (or touchcancel is called)\n   */\n  let _primaryTouchId: number | null = null;\n\n  const processEventCallback = (event: MouseEvent | TouchEvent) => {\n    // Exit early out of all synthetic mouse events\n    // https://stackoverflow.com/questions/9656990/how-to-prevent-simulated-mouse-events-in-mobile-browsers\n    // https://stackoverflow.com/questions/25572070/javascript-touchend-versus-click-dilemma\n    if (_syntheticEventsActive && event instanceof MouseEvent) {\n      // Synthetic event finished\n      if (event.type == \"mouseup\") {\n        _syntheticEventsActive = false;\n      }\n\n      return;\n    }\n\n    // Test if it's a \"touch click\". This could cause the browser to send\n    // synthetic mouse events.\n    _syntheticEventsActive =\n      isTouchScrollEnabled &&\n      event.type === \"touchend\" &&\n      _prevEventType === \"touchstart\";\n\n    _prevEventType = event.type;\n\n    const boundingRect = (\n      event.currentTarget as HTMLCanvasElement\n    ).getBoundingClientRect();\n\n    // On touchstart in single-touch mode, record the first new finger as the primary\n    // touch if we aren't already tracking one.\n    if (!enableMultiTouch && event.type === \"touchstart\" && _primaryTouchId === null) {\n      const firstTouch = (event as TouchEvent).changedTouches?.[0];\n      if (firstTouch) {\n        _primaryTouchId = firstTouch.identifier;\n      }\n    }\n\n    const coordinateSets = getClientCoordinates(\n      event,\n      isTouchScrollEnabled,\n      enableMultiTouch,\n      enableMultiTouch ? null : _primaryTouchId,\n    );\n    const forwardMatrix = rive.computeAlignment(\n      fit,\n      alignment,\n      {\n        minX: 0,\n        minY: 0,\n        maxX: boundingRect.width,\n        maxY: boundingRect.height,\n      },\n      artboard.bounds,\n      layoutScaleFactor,\n    );\n    const invertedMatrix = new rive.Mat2D();\n    forwardMatrix.invert(invertedMatrix);\n\n    coordinateSets.forEach((coordinateSet) => {\n      const clientX = coordinateSet.clientX;\n      const clientY = coordinateSet.clientY;\n      if (!clientX && !clientY) {\n        return;\n      }\n      const canvasX = clientX - boundingRect.left;\n      const canvasY = clientY - boundingRect.top;\n      const canvasCoordinatesVector = new rive.Vec2D(canvasX, canvasY);\n      const transformedVector = rive.mapXY(\n        invertedMatrix,\n        canvasCoordinatesVector,\n      );\n      const transformedX = transformedVector.x();\n      const transformedY = transformedVector.y();\n      coordinateSet.transformedX = transformedX;\n      coordinateSet.transformedY = transformedY;\n      transformedVector.delete();\n      canvasCoordinatesVector.delete();\n    });\n\n    invertedMatrix.delete();\n    forwardMatrix.delete();\n\n    switch (event.type) {\n      /**\n       * There's a 2px buffer for a hitRadius when translating the pointer coordinates\n       * down to the state machine. In cases where the hitbox is about that much away\n       * from the Artboard border, we don't have exact precision on determining pointer\n       * exit. We're therefore adding to the translated coordinates on mouseout of a canvas\n       * to ensure that we report the mouse has truly exited the hitarea.\n       * https://github.com/rive-app/rive-cpp/blob/master/src/animation/state_machine_instance.cpp#L336\n       *\n       */\n      case \"mouseout\":\n        for (const stateMachine of stateMachines) {\n          if (dispatchPointerExit) {\n            coordinateSets.forEach((coordinateSet) => {\n              stateMachine.pointerExit(\n                coordinateSet.transformedX,\n                coordinateSet.transformedY,\n                coordinateSet.identifier,\n              );\n            });\n          } else {\n            coordinateSets.forEach((coordinateSet) => {\n              stateMachine.pointerMove(\n                coordinateSet.transformedX,\n                coordinateSet.transformedY,\n                coordinateSet.identifier,\n              );\n            });\n          }\n        }\n        break;\n\n      // Pointer moving/hovering on the canvas\n      case \"touchmove\":\n      case \"mouseover\":\n      case \"mousemove\": {\n        for (const stateMachine of stateMachines) {\n          coordinateSets.forEach((coordinateSet) => {\n            stateMachine.pointerMove(\n              coordinateSet.transformedX,\n              coordinateSet.transformedY,\n              coordinateSet.identifier,\n            );\n          });\n        }\n        break;\n      }\n      // Pointer click initiated but not released yet on the canvas\n      case \"touchstart\":\n      case \"mousedown\": {\n        for (const stateMachine of stateMachines) {\n          coordinateSets.forEach((coordinateSet) => {\n            stateMachine.pointerDown(\n              coordinateSet.transformedX,\n              coordinateSet.transformedY,\n              coordinateSet.identifier,\n            );\n          });\n        }\n        // Advance the state machine immediately so pointer down(s) takes effect synchronously\n        advanceAndDrain(0);\n        break;\n      }\n      // Pointer click released on the canvas\n      case \"touchend\": {\n        for (const stateMachine of stateMachines) {\n          coordinateSets.forEach((coordinateSet) => {\n            stateMachine.pointerUp(\n              coordinateSet.transformedX,\n              coordinateSet.transformedY,\n              coordinateSet.identifier,\n            );\n            stateMachine.pointerExit(\n              coordinateSet.transformedX,\n              coordinateSet.transformedY,\n              coordinateSet.identifier,\n            );\n          });\n        }\n        // Advance the state machine immediately so pointer up(s) takes effect synchronously\n        advanceAndDrain(0);\n        // Release the primary touch lock once that finger lifts so the next\n        // touchstart can claim a new primary finger.\n        if (\n          !enableMultiTouch &&\n          coordinateSets.some((c) => c.identifier === _primaryTouchId)\n        ) {\n          _primaryTouchId = null;\n        }\n        break;\n      }\n      case \"mouseup\": {\n        for (const stateMachine of stateMachines) {\n          coordinateSets.forEach((coordinateSet) => {\n            stateMachine.pointerUp(\n              coordinateSet.transformedX,\n              coordinateSet.transformedY,\n              coordinateSet.identifier,\n            );\n          });\n        }\n        // Advance the state machine immediately so pointer up(s) takes effect synchronously\n        advanceAndDrain(0);\n        break;\n      }\n      default:\n    }\n  };\n\n  const touchCancelCallback = () => {\n    _primaryTouchId = null;\n  };\n\n  const callback = processEventCallback.bind(this);\n  canvas.addEventListener(\"mouseover\", callback);\n  canvas.addEventListener(\"mouseout\", callback);\n  canvas.addEventListener(\"mousemove\", callback);\n  canvas.addEventListener(\"mousedown\", callback);\n  canvas.addEventListener(\"mouseup\", callback);\n  canvas.addEventListener(\"touchmove\", callback, {\n    passive: isTouchScrollEnabled,\n  });\n  canvas.addEventListener(\"touchstart\", callback, {\n    passive: isTouchScrollEnabled,\n  });\n  canvas.addEventListener(\"touchend\", callback);\n  canvas.addEventListener(\"touchcancel\", touchCancelCallback);\n  return () => {\n    canvas.removeEventListener(\"mouseover\", callback);\n    canvas.removeEventListener(\"mouseout\", callback);\n    canvas.removeEventListener(\"mousemove\", callback);\n    canvas.removeEventListener(\"mousedown\", callback);\n    canvas.removeEventListener(\"mouseup\", callback);\n    canvas.removeEventListener(\"touchmove\", callback);\n    canvas.removeEventListener(\"touchstart\", callback);\n    canvas.removeEventListener(\"touchend\", callback);\n    canvas.removeEventListener(\"touchcancel\", touchCancelCallback);\n  };\n};\n","import * as rc from \"../rive_advanced.mjs\";\n\nexport interface KeyboardInteractionsParams {\n  canvas: HTMLCanvasElement;\n  stateMachine: rc.StateMachineInstance;\n  /**\n   * Whether this canvas has focus nodes that should participate in tab traversal.\n   * When true, Tab/Shift+Tab will be intercepted and routed to the Rive focus manager.\n   * Tab is released to the page only when focusNext() returns false and Rive no longer holds\n   * focus; a Stop edge also returns false but keeps focus, so Tab stays trapped.\n   */\n  hasFocusNodes: boolean;\n  /**\n   * Optional accessibility overlay that should be treated as part of this Rive\n   * instance's focus domain. This is lazy because the overlay may be created\n   * after keyboard listeners are registered.\n   */\n  getOverlayElement?: () => HTMLElement | null;\n}\n\n/**\n * Tracks the relationship between DOM focus inside this Rive focus domain (canvas or semantic overlay)\n * and Rive's internal focus for the current focus session.\n *\n * NotFocused   — DOM focus left the domain, Rive released focus internally, or Tab walked\n *                off the end of the tree. Keyboard input isn't ours, so Tab is ignored and\n *                reaches the next page element.\n * EntryPending — DOM focus is inside the domain but Rive holds no node yet, so the next Tab\n *                enters the focus tree. Set by pointer focus on the canvas, by assistive technology (AT) focus landing\n *                in the overlay, and by keyboard focus whose entry attempt found no eligible node.\n * RiveFocused  — a Rive node holds focus. Tab/Shift+Tab route to the Rive focus manager and stay\n *                inside the domain until either Rive reports focus ended (pollFocusState) or\n *                Tab walks off the edge of the tree (focusNext()/focusPrevious() returns false and\n *                Rive no longer holds focus).\n *\n * Keyboard focus on the canvas enters the tree immediately: onCanvasFocus infers direction from\n * where focus came from and goes straight to RiveFocused when a node accepts.\n */\nexport enum FocusSessionState {\n  NotFocused = \"notFocused\",\n  EntryPending = \"entryPending\",\n  RiveFocused = \"riveFocused\",\n}\n\n/**\n * Manages keyboard and DOM focus interactions for Rive's focus domain (<canvas> or semantic overlay).\n * Because keyboard events can apply on either part of the domain, we need to track what events we should\n * handle/intercept, and when to release focus back to the page outside of the domain.\n *\n * Tracks the canvas focus session state (focusSessionState) and routes\n * Tab/Shift+Tab to the Rive state machine's focus manager. Exposes shared\n * state as properties so the Rive render loop can read them directly.\n */\nexport class KeyboardInteractions {\n  public focusSessionState: FocusSessionState = FocusSessionState.NotFocused;\n\n  private canvas: HTMLCanvasElement;\n  private mainSm: rc.StateMachineInstance;\n  private hasFocusNodes: boolean;\n  /** Cached callback that returns the accessibility overlay element once created. */\n  private getOverlayElement?: () => HTMLElement | null;\n\n  /** Whether the canvas currently has browser DOM focus. */\n  private canvasHasFocus = false;\n  /** After Tab exits the last Rive node, ignore keydowns until focus re-enters the focus domain. */\n  private focusDomainReleased = false;\n  /** Overlay element currently wired with focusin/keydown listeners, if any. */\n  private currentOverlayElement: HTMLElement | null = null;\n  /** Canvas parent (or document) watched for focusin to attach overlay listeners lazily. */\n  private focusDomainHost: HTMLElement | Document;\n\n  constructor({\n    canvas,\n    stateMachine,\n    hasFocusNodes,\n    getOverlayElement,\n  }: KeyboardInteractionsParams) {\n    this.canvas = canvas;\n    this.mainSm = stateMachine;\n    this.hasFocusNodes = hasFocusNodes;\n    this.getOverlayElement = getOverlayElement;\n    this.focusDomainHost = canvas.parentElement ?? document;\n\n    canvas.addEventListener(\"focus\", this.onCanvasFocus);\n    canvas.addEventListener(\"blur\", this.onCanvasBlur);\n    canvas.addEventListener(\"keydown\", this.onKeyDown);\n    this.focusDomainHost.addEventListener(\"focusin\", this.onFocusDomainHostFocusIn);\n    this.syncOverlayListener();\n  }\n\n  /**\n   * Set the FocusSessionState. Useful for invoking a Rive \"blur\" without actually blurring from the <canvas>. This\n   * helps put the DOM focus state on the canvas rather than the <body>, so the user doesn't lose the spot in page navigation\n   *\n   * @param state FocusSessionState enum\n   */\n  public setFocusSessionState(state: FocusSessionState): void {\n    this.focusSessionState = state;\n  }\n\n  /**\n   * Called by pollFocusState on the Rive instance when it observes hasFocus=true. Rive acquired\n   * focus internally (e.g. via a listener action or state transition) without a DOM focus event,\n   * so mark the session RiveFocused. This cannot resurrect a session that a DOM blur ended,\n   * because onCanvasBlur clears Rive's focus alongside it.\n   */\n  public notifyRiveFocused(): void {\n    this.focusSessionState = FocusSessionState.RiveFocused;\n  }\n\n  /**\n   * Handles the canvas gaining browser focus. The behavior differs based on how focus was gained -\n   *\n   * Pointer-driven focus: the canvas now has focus but Rive holds nothing yet, so we move to EntryPending — this lets the\n   * next Tab enter the focus tree even when the focus is pointer-driven\n   *\n   * Keyboard-driven focus: we enter the Rive focus tree immediately once canvas gains focus.\n   * The direction is inferred from where focus came from: an element before the canvas in DOM order\n   * means a forward Tab (focusNext), one after means a Shift+Tab (focusPrevious). :focus-visible\n   * gates this so a click doesn't yank Rive focus to the first node on the focus event itself.\n   */\n  public onCanvasFocus = (event: FocusEvent) => {\n    this.syncOverlayListener();\n    this.canvasHasFocus = true;\n    this.focusDomainReleased = false;\n\n    if (!this.hasFocusNodes) return;\n    if (this.mainSm.focusState().hasFocus) return;\n\n    this.focusSessionState = FocusSessionState.EntryPending;\n\n    // Pointer focus waits for the user's next Tab (handled in onKeyDown). Keyboard focus enters now.\n    if (!this.isKeyboardDrivenFocus()) return;\n    const forward = this.cameFromBeforeCanvas(event.relatedTarget as Node | null);\n    if (forward ? this.mainSm.focusNext() : this.mainSm.focusPrevious()) {\n      this.focusSessionState = FocusSessionState.RiveFocused;\n    }\n  };\n\n  /**\n   * Marks internal state that the canvas has lost DOM focus. Do not actually clear\n   * Rive focus though if:\n   * 1. DOM focus is still within Rive domain (i.e., semantic overlay)\n   * 2. Document just lost focus (i.e. tab switching)\n   * \n   * When we're not in either of those buckets, it's safe to call `clearFocus()` on the SMI.\n   */\n  public onCanvasBlur = (event: FocusEvent) => {\n    this.focusSessionState = FocusSessionState.NotFocused;\n    this.canvasHasFocus = false;\n\n    const movedWithinFocusDomain = this.isInFocusDomain(event.relatedTarget);\n    const documentLostFocus =\n      event.relatedTarget === null && !document.hasFocus();\n    if (movedWithinFocusDomain || documentLostFocus) return;\n\n    this.mainSm.clearFocus();\n  };\n\n  /**\n   * Assistive technology (AT) focus landing inside the overlay is DOM focus inside the Rive focus domain, so open a\n   * session even when no Rive node holds focus yet. shouldRiveHandleKeyEvent treats NotFocused\n   * as authoritative, so without this the overlay's Tab keydowns reach onKeyDown and get dropped\n   * at that gate — the browser would move focus out of Rive instead of to the next focus node.\n   */\n  private onOverlayFocusIn = (event: FocusEvent) => {\n    if (!this.isInOverlay(event.target)) return;\n    this.focusDomainReleased = false;\n\n    if (!this.hasFocusNodes) return;\n    if (this.focusSessionState !== FocusSessionState.NotFocused) return;\n    this.focusSessionState = this.mainSm.focusState().hasFocus\n      ? FocusSessionState.RiveFocused\n      : FocusSessionState.EntryPending;\n  };\n\n  /** Overlay listeners attach lazily, so the first focusin only ever lands here. */\n  private onFocusDomainHostFocusIn = (event: FocusEvent) => {\n    this.syncOverlayListener();\n    this.onOverlayFocusIn(event);\n  };\n\n  public onKeyDown = (event: KeyboardEvent) => {\n    this.syncOverlayListener();\n\n    // After Tab exits the last Rive node, ignore keys until focus re-enters the focus domain.\n    if (this.focusDomainReleased) return;\n\n    if (!this.shouldRiveHandleKeyEvent(event)) return;\n\n    if (event.code === \"Tab\" && this.hasFocusNodes) {\n      const forward = !event.shiftKey;\n      const focusMoved = forward ? this.mainSm.focusNext() : this.mainSm.focusPrevious();\n      const focusState = this.mainSm.focusState();\n      // focusMoved is false both at a Stop edge (focus stays put) and after walking off\n      // the tree (focus cleared), so hasFocus discerns Stop edge from Rive releasing focus\n      if (focusMoved || focusState.hasFocus) {\n        // A Rive node holds focus — keep trapping Tab inside Rive.\n        this.focusSessionState = FocusSessionState.RiveFocused;\n        event.preventDefault();\n      } else {\n        // No more traversable nodes — release Tab to the page.\n        this.focusSessionState = FocusSessionState.NotFocused;\n        this.focusDomainReleased = true;\n        this.canvasHasFocus = false;\n      }\n      this.syncOverlayListener();\n    }\n  };\n\n  /**\n   * Determine if Rive should handle keyboard input. If session state is `NotFocused` - no.\n   * DOM focus stays parked on the canvas after Rive releases focus internally, and that Tab\n   * has to reach the page rather than re-enter the tree.\n   *\n   * Otherwise, the event still has to belong to Rive:\n   * 1. If the current DOM focus is in Rive domain (canvas or semantic overlay)\n   * 2. If the target for the key input is for the semantic overlay, or the canvas\n   */\n  private shouldRiveHandleKeyEvent(event: KeyboardEvent): boolean {\n    if (this.focusSessionState === FocusSessionState.NotFocused) return false;\n\n    const inFocusDomain =\n      this.isInFocusDomain(document.activeElement) ||\n      this.isInOverlay(event.target);\n    const eventOnCanvas = event.target === this.canvas;\n    return inFocusDomain || this.canvasHasFocus || eventOnCanvas;\n  }\n\n  /**\n   * The Rive focus domain: the DOM that counts as \"inside\" Rive for focus purposes — today the\n   * canvas itself OR the accessibility overlay subtree. Anything added later belongs here, so\n   * session bookkeeping and keydown routing pick it up for free.\n   */\n  private isInFocusDomain(target: EventTarget | null): boolean {\n    if (target === this.canvas) return true;\n    return this.isInOverlay(target);\n  }\n\n  /** Overlay only (excludes the canvas) — the accessibility overlay subtree. */\n  private isInOverlay(target: EventTarget | null): boolean {\n    if (!(target instanceof Node)) return false;\n    return this.getOverlayElement?.()?.contains(target) ?? false;\n  }\n\n  private syncOverlayListener(): void {\n    const nextOverlayElement = this.getOverlayElement?.() ?? null;\n    if (nextOverlayElement === this.currentOverlayElement) return;\n\n    this.currentOverlayElement?.removeEventListener(\n      \"focusin\",\n      this.onOverlayFocusIn,\n    );\n    this.currentOverlayElement?.removeEventListener(\n      \"keydown\",\n      this.onKeyDown,\n      true,\n    );\n    this.currentOverlayElement = nextOverlayElement;\n    this.currentOverlayElement?.addEventListener(\n      \"focusin\",\n      this.onOverlayFocusIn,\n    );\n    this.currentOverlayElement?.addEventListener(\n      \"keydown\",\n      this.onKeyDown,\n      true,\n    );\n  }\n\n  /**\n   * Whether the canvas currently matches :focus-visible — the browser's heuristic for keyboard-\n   * (vs pointer-) driven focus. For older browser versions that don't support this selector, return false\n   * so that we don't incorrectly assume pointer vs keyboard focus. Next tab would enter the focus tree in those edge cases.\n   */\n  private isKeyboardDrivenFocus(): boolean {\n    try {\n      return this.canvas.matches(\":focus-visible\");\n    } catch {\n      return false;\n    }\n  }\n\n  private cameFromBeforeCanvas(from: Node | null): boolean {\n    if (!from) return true;\n    const position = this.canvas.compareDocumentPosition(from);\n    if (position & Node.DOCUMENT_POSITION_PRECEDING) return true;\n    if (position & Node.DOCUMENT_POSITION_FOLLOWING) return false;\n    return true;\n  }\n\n  public cleanup(): void {\n    this.canvas.removeEventListener(\"focus\", this.onCanvasFocus);\n    this.canvas.removeEventListener(\"blur\", this.onCanvasBlur);\n    this.canvas.removeEventListener(\"keydown\", this.onKeyDown);\n    this.focusDomainHost.removeEventListener(\"focusin\", this.onFocusDomainHostFocusIn);\n    this.currentOverlayElement?.removeEventListener(\n      \"focusin\",\n      this.onOverlayFocusIn,\n    );\n    this.currentOverlayElement?.removeEventListener(\n      \"keydown\",\n      this.onKeyDown,\n      true,\n    );\n  }\n}\n","// Reference: https://github.com/braintree/sanitize-url/tree/main\nconst invalidProtocolRegex = /^([^\\w]*)(javascript|data|vbscript)/im;\nconst htmlEntitiesRegex = /&#(\\w+)(^\\w|;)?/g;\nconst htmlCtrlEntityRegex = /&(newline|tab);/gi;\nconst ctrlCharactersRegex =\n  /[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim;\nconst urlSchemeRegex = /^.+(:|&colon;)/gim;\nconst relativeFirstCharacters = [\".\", \"/\"];\nexport const BLANK_URL = \"about:blank\";\n\nfunction isRelativeUrlWithoutProtocol(url: string): boolean {\n  return relativeFirstCharacters.indexOf(url[0]) > -1;\n}\n\n// adapted from https://stackoverflow.com/a/29824550/2601552\nfunction decodeHtmlCharacters(str: string) {\n  const removedNullByte = str.replace(ctrlCharactersRegex, \"\");\n  return removedNullByte.replace(htmlEntitiesRegex, (match, dec) => {\n    return String.fromCharCode(dec);\n  });\n}\n\nexport function sanitizeUrl(url?: string): string {\n  if (!url) {\n    return BLANK_URL;\n  }\n\n  const sanitizedUrl = decodeHtmlCharacters(url)\n    .replace(htmlCtrlEntityRegex, \"\")\n    .replace(ctrlCharactersRegex, \"\")\n    .trim();\n\n  if (!sanitizedUrl) {\n    return BLANK_URL;\n  }\n\n  if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {\n    return sanitizedUrl;\n  }\n\n  const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);\n\n  if (!urlSchemeParseResults) {\n    return sanitizedUrl;\n  }\n\n  const urlScheme = urlSchemeParseResults[0];\n\n  if (invalidProtocolRegex.test(urlScheme)) {\n    return BLANK_URL;\n  }\n\n  return sanitizedUrl;\n}\n","import * as rc from \"../rive_advanced.mjs\";\n\ninterface Finalizable {\n  unref: () => void;\n}\n\nclass FileFinalizer implements Finalizable {\n  private _file: rc.File;\n  // Nothing else reclaims a session on GC, so a RiveFile dropped without\n  // cleanup() would leak it and everything recorded into it.\n  private _session: rc.DeferredSession | null;\n  public selfUnref: boolean = false;\n  constructor(file: rc.File, session: rc.DeferredSession | null = null) {\n    this._file = file;\n    this._session = session;\n  }\n\n  public unref() {\n    if (this._file) {\n      this._file.unref();\n    }\n    // After the file, never before: the file's resources belong to the session.\n    if (this._session) {\n      this._session.delete();\n      this._session = null;\n    }\n  }\n\n  // Disarms the GC path for a file cleanup() already released.\n  public release() {\n    this._file = null;\n    this._session = null;\n  }\n}\n\nclass ObjectFinalizer<T extends Finalizable> {\n  private _finalizableObject: T;\n  constructor(finalizableObject: T) {\n    this._finalizableObject = finalizableObject;\n  }\n\n  public unref() {\n    this._finalizableObject.unref();\n  }\n}\n\n\nclass AssetWrapper implements rc.FinalizableTarget {\n  public selfUnref: boolean = false;\n  public unref() {}\n}\n\nclass ImageWrapper extends AssetWrapper {\n  private _nativeImage: rc.Image;\n\n  constructor(image: rc.Image) {\n    super();\n    this._nativeImage = image;\n  }\n\n  public get nativeImage(): rc.ImageInternal {\n    return this._nativeImage;\n  }\n\n  public unref() {\n    if (this.selfUnref) {\n      this._nativeImage.unref();\n    }\n  }\n}\n\nclass AudioWrapper extends AssetWrapper {\n  private _nativeAudio: rc.Audio;\n\n  constructor(audio: rc.Audio) {\n    super();\n    this._nativeAudio = audio;\n  }\n\n  public get nativeAudio(): rc.AudioInternal {\n    return this._nativeAudio;\n  }\n\n  public unref() {\n    if (this.selfUnref) {\n      this._nativeAudio.unref();\n    }\n  }\n}\n\nclass FontWrapper extends AssetWrapper {\n  private _nativeFont: rc.Font;\n\n  constructor(font: rc.Font) {\n    super();\n    this._nativeFont = font;\n  }\n\n  public get nativeFont(): rc.FontInternal {\n    return this._nativeFont;\n  }\n\n  public unref() {\n    if (this.selfUnref) {\n      this._nativeFont.unref();\n    }\n  }\n}\n\nexport type AssetLoadCallbackWrapper = (\n  asset: rc.FileAssetInternal,\n  bytes: Uint8Array,\n) => Boolean;\n\nclass CustomFileAssetLoaderWrapper {\n  assetLoader: rc.CustomFileAssetLoader;\n  _assetLoaderCallback: AssetLoadCallbackWrapper;\n  // Session of the file being imported, null for an immediate file. Assets of\n  // a deferred file have to decode through the factory that imported it.\n  _session: rc.DeferredSession | null;\n\n  constructor(\n    runtime: rc.RiveCanvas,\n    loaderCallback: AssetLoadCallbackWrapper,\n    session: rc.DeferredSession | null = null,\n  ) {\n    this._assetLoaderCallback = loaderCallback;\n    this._session = session;\n    this.assetLoader = new runtime.CustomFileAssetLoader({\n      loadContents: this.loadContents.bind(this),\n    });\n  }\n\n  loadContents(asset: rc.FileAsset, bytes: any) {\n    let assetWrapper: FileAssetWrapper;\n    if (asset.isImage) {\n      assetWrapper = new ImageAssetWrapper(asset, this._session);\n    } else if (asset.isAudio) {\n      assetWrapper = new AudioAssetWrapper(asset, this._session);\n    } else if (asset.isFont) {\n      assetWrapper = new FontAssetWrapper(asset, this._session);\n    } else {\n      return false;\n    }\n    return this._assetLoaderCallback(assetWrapper, bytes);\n  }\n}\n\n/**\n * Rive class representing a FileAsset with relevant metadata fields to describe\n * an asset associated wtih the Rive File\n */\nclass FileAssetWrapper {\n  _nativeFileAsset: rc.FileAssetInternal;\n  _session: rc.DeferredSession | null;\n\n  constructor(\n    nativeAsset: rc.FileAssetInternal,\n    session: rc.DeferredSession | null = null,\n  ) {\n    this._nativeFileAsset = nativeAsset;\n    this._session = session;\n  }\n\n  decode(bytes: Uint8Array): void {\n    // The session travels with the asset so a deferred file's assets are\n    // session-typed without the caller needing to know the file's rendering mode.\n    this._nativeFileAsset.decode(bytes, this._session);\n  }\n\n  get name(): string {\n    return this._nativeFileAsset.name;\n  }\n\n  get fileExtension(): string {\n    return this._nativeFileAsset.fileExtension;\n  }\n\n  get uniqueFilename(): string {\n    return this._nativeFileAsset.uniqueFilename;\n  }\n\n  get isAudio(): boolean {\n    return this._nativeFileAsset.isAudio;\n  }\n\n  get isImage(): boolean {\n    return this._nativeFileAsset.isImage;\n  }\n\n  get isFont(): boolean {\n    return this._nativeFileAsset.isFont;\n  }\n\n  get cdnUuid(): string {\n    return this._nativeFileAsset.cdnUuid;\n  }\n\n  get nativeFileAsset() {\n    return this._nativeFileAsset;\n  }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setRenderImage()` API with a\n * decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset\n */\nclass ImageAssetWrapper extends FileAssetWrapper {\n  setRenderImage(image: ImageWrapper): void {\n    (this._nativeFileAsset as rc.ImageAssetInternal).setRenderImage(\n      image.nativeImage,\n    );\n  }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setAudioSource()` API with a\n * decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset\n */\nclass AudioAssetWrapper extends FileAssetWrapper {\n  setAudioSource(audio: AudioWrapper): void {\n    (this._nativeFileAsset as rc.AudioAssetInternal).setAudioSource(\n      audio.nativeAudio,\n    );\n  }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setFont()` API with a\n * decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset\n */\nclass FontAssetWrapper extends FileAssetWrapper {\n  setFont(font: FontWrapper): void {\n    (this._nativeFileAsset as rc.FontAssetInternal).setFont(font.nativeFont);\n  }\n}\n\ndeclare const FinalizationRegistry: {\n  new (fn: Function): typeof FinalizationRegistry;\n\n  register<T extends rc.FinalizableTarget>(\n    object: T,\n    description: Finalizable,\n  ): void;\n\n  unregister<T>(object: T): void;\n};\n\nclass FakeFinalizationRegistry {\n  constructor(_: Function) {}\n  register(object: rc.FinalizableTarget) {\n    object.selfUnref = true;\n  }\n\n  unregister<T>(_: T) {}\n}\nconst MyFinalizationRegistry =\n  typeof FinalizationRegistry !== \"undefined\"\n    ? FinalizationRegistry\n    : FakeFinalizationRegistry;\n\nconst finalizationRegistry = new MyFinalizationRegistry((ob: Finalizable) => {\n  ob?.unref();\n});\n\nconst createFinalization = <T extends Finalizable>(\n  target: rc.FinalizableTarget,\n  finalizable: T,\n) => {\n  const finalizer = new ObjectFinalizer<T>(finalizable);\n  finalizationRegistry.register(target, finalizer);\n};\n\nexport {\n  finalizationRegistry,\n  createFinalization,\n  Finalizable,\n  ImageWrapper,\n  AudioWrapper,\n  FontWrapper,\n  ImageAssetWrapper,\n  AudioAssetWrapper,\n  FontAssetWrapper,\n  CustomFileAssetLoaderWrapper,\n  FileAssetWrapper,\n  FileFinalizer,\n};\n","import * as rc from \"../rive_advanced.mjs\";\nimport { RuntimeLoader } from \"../runtimeLoader\";\nimport type { FontWrapper } from \"./finalizationRegistry\";\n\n// Callback type for the fallback fonts callback\nexport type FallbackFontsCallback = (missingGlyph: number, weight: number) => FontWrapper | FontWrapper[] | null | undefined;\n\ntype CallbackToPointerValue = (missingGlyph: number, fallbackFontIndex: number, weight: number) => number | null;\n\n// Class to manage fallback fonts for Rive.\nexport class RiveFont {\n  private static _fallbackFontCallback: FallbackFontsCallback | null = null;\n\n  // Class is never instantiated\n  private constructor() {}\n\n\n  /**\n   * Set a callback to dynamically set a list of fallback fonts based on the missing glyph and/or style of the default font.\n   * Set null to clear the callback.\n   * @param fontCallback Callback to set a list of fallback fonts.\n   */\n  public static setFallbackFontCallback(fontCallback: FallbackFontsCallback | null): void {\n    RiveFont._fallbackFontCallback = fontCallback ?? null;\n    RiveFont._wireFallbackProc();\n  }\n\n  // Get the pointer value to the Embind Font object from FontWrapper\n  private static _fontToPtr(\n    fontWrapper: FontWrapper | null | undefined\n  ): number | null {\n    if (fontWrapper == null) return null;\n    const embindFont = fontWrapper.nativeFont as rc.Font;\n    const ptr = embindFont?.ptr?.();\n    return ptr ?? null;\n  }\n\n  private static _getFallbackPtr(\n    fonts: FontWrapper[] | null | undefined,\n    index: number\n  ): number | null {\n    if (index < 0 || index >= fonts.length) return null;\n    return RiveFont._fontToPtr(fonts![index]);\n  }\n\n  // Create the callback Rive expects to use for fallback fonts (regardless if set via a user-supplied static list, or callback)\n  // 1. Ensure WASM is ready\n  // 2. Bias for checking user callback over static list of fonts and pass it down to Rive to store as reference\n  //    - When calling the user callback, check if we have any fonts left to check, and if not, return null to indicate there are no more fallbacks to try.\n  //    - If the user callback returns an array of fonts, pass the pointer value to Rive of the font to try\n  // 3. If no callback is provided, or the callback returns null, try the static list of fonts if they set any\n  // 4. If no fallback method is set, return null.\n  private static _wireFallbackProc(): void {\n    RuntimeLoader.getInstance((rive: rc.RiveCanvas) => {\n      const { _fallbackFontCallback: cb } = RiveFont;\n      if (cb) {\n        rive.setFallbackFontCallback(\n          ((missingGlyph: number, fallbackFontIndex: number, weight: number) => {\n            const fontsReturned = cb(missingGlyph, weight);\n            if (fontsReturned) {\n              if (Array.isArray(fontsReturned)) {\n                return RiveFont._getFallbackPtr(\n                  fontsReturned,\n                  fallbackFontIndex\n                );\n              }\n              // If the user callback only returns a single font, provide it to Rive the first time, otherwise if Rive\n              // calls back a second time, return null to indicate there are no more fallbacks to try.\n              return fallbackFontIndex === 0 ? RiveFont._fontToPtr(fontsReturned) : null;\n            }\n            return null;\n          }) as CallbackToPointerValue\n        );\n      } else {\n        rive.setFallbackFontCallback(null);\n      }\n    });\n  }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n",null,null,null,"import * as rc from \"./rive_advanced.mjs\";\nimport { Animation } from \"./animation\";\nimport { RuntimeLoader, type RuntimeCallback } from \"./runtimeLoader\";\nimport {\n  SemanticTreeModel,\n  AccessibilityOverlay,\n  SemanticMode,\n  type RiveSemanticsOptions,\n  type SemanticActionType,\n} from \"./semantics\";\nimport {\n  registerTouchInteractions,\n  KeyboardInteractions,\n  FocusSessionState,\n  sanitizeUrl,\n  BLANK_URL,\n  ImageWrapper,\n  AudioWrapper,\n  FontWrapper,\n  finalizationRegistry,\n  CustomFileAssetLoaderWrapper,\n  FileFinalizer,\n  createFinalization,\n  RiveFont as RiveFontClassUtil,\n} from \"./utils\";\nexport type AssetLoadCallback = (\n  asset: rc.FileAsset,\n  bytes: Uint8Array,\n) => boolean;\n\nclass RiveError extends Error {\n  public isHandledError = true;\n}\n\nexport { RiveFontClassUtil as RiveFont };\nexport { SemanticMode };\nexport type { RiveSemanticsOptions };\n\n// Note: Re-exporting a few types from rive_advanced.mjs to expose for high-level\n// API usage without re-defining their type definition here. May want to revisit\n// and see if we want to expose both types from rive.ts and rive_advanced.mjs in\n// the future\nexport type {\n  FileAsset,\n  AudioAsset,\n  FontAsset,\n  ImageAsset,\n} from \"./rive_advanced.mjs\";\n\n/**\n * Generic type for a parameterless void callback\n */\nexport type VoidCallback = () => void;\n\ninterface SetupRiveListenersOptions {\n  isTouchScrollEnabled?: boolean;\n}\n\n/**\n * Type for artboard bounds\n */\nexport type Bounds = rc.AABB;\n\n// #regions helpers\nconst resolveErrorMessage = (error: any): string =>\n  error && error.isHandledError\n    ? error.message\n    : \"Problem loading file; may be corrupt!\";\n\n// #region layout\n\n// Fit options for the canvas\nexport enum Fit {\n  Cover = \"cover\",\n  Contain = \"contain\",\n  Fill = \"fill\",\n  FitWidth = \"fitWidth\",\n  FitHeight = \"fitHeight\",\n  None = \"none\",\n  ScaleDown = \"scaleDown\",\n  Layout = \"layout\",\n}\n\n// Alignment options for the canvas\nexport enum Alignment {\n  Center = \"center\",\n  TopLeft = \"topLeft\",\n  TopCenter = \"topCenter\",\n  TopRight = \"topRight\",\n  CenterLeft = \"centerLeft\",\n  CenterRight = \"centerRight\",\n  BottomLeft = \"bottomLeft\",\n  BottomCenter = \"bottomCenter\",\n  BottomRight = \"bottomRight\",\n}\n\n// Drawing optimization options\nexport enum DrawOptimizationOptions {\n  AlwaysDraw = \"alwaysDraw\",\n  DrawOnChanged = \"drawOnChanged\",\n}\n\n// Options for Rive focus management\nexport interface RiveFocusOptions {\n  /**\n   * When true, allows Rive to interrupt browser focus and programmatically\n   * set/release focus on the canvas when the state machine reports focus\n   * changes in Rive. This allows apps to direct focus to/from the canvas or\n   * related elements as needed if not currently focused, which can happen at\n   * any point in the Rive render loop.\n   *\n   * Note: Nodes in the Rive graphic may still receive/release focus respecting\n   * any focus rules defined in the state machine.\n   *\n   * @default false to prevent unwanted focus interruptions\n   */\n  allowFocusInterrupt: boolean;\n}\n\n// Interface for the Layout static method constructor\nexport interface LayoutParameters {\n  fit?: Fit;\n  alignment?: Alignment;\n  layoutScaleFactor?: number;\n  minX?: number;\n  minY?: number;\n  maxX?: number;\n  maxY?: number;\n}\n\n// Alignment options for Rive animations in a HTML canvas\nexport class Layout {\n  // Runtime fit and alignment are accessed every frame, so we cache their\n  // values to save cycles\n  private cachedRuntimeFit: rc.Fit;\n  private cachedRuntimeAlignment: rc.Alignment;\n\n  public readonly fit: Fit;\n  public readonly alignment: Alignment;\n  public readonly layoutScaleFactor: number;\n  public readonly minX: number;\n  public readonly minY: number;\n  public readonly maxX: number;\n  public readonly maxY: number;\n\n  constructor(params?: LayoutParameters) {\n    this.fit = params?.fit ?? Fit.Contain;\n    this.alignment = params?.alignment ?? Alignment.Center;\n    this.layoutScaleFactor = params?.layoutScaleFactor ?? 1;\n    this.minX = params?.minX ?? 0;\n    this.minY = params?.minY ?? 0;\n    this.maxX = params?.maxX ?? 0;\n    this.maxY = params?.maxY ?? 0;\n  }\n\n  // Alternative constructor to build a Layout from an interface/object\n  static new({\n    fit,\n    alignment,\n    minX,\n    minY,\n    maxX,\n    maxY,\n  }: LayoutParameters): Layout {\n    warnOnce(\n      DeprecationKeys.legacyConstructors,\n      \"This function is deprecated: please use `new Layout({})` instead\",\n    );\n    return new Layout({ fit, alignment, minX, minY, maxX, maxY });\n  }\n\n  /**\n   * Makes a copy of the layout, replacing any specified parameters\n   */\n  public copyWith({\n    fit,\n    alignment,\n    layoutScaleFactor,\n    minX,\n    minY,\n    maxX,\n    maxY,\n  }: LayoutParameters): Layout {\n    return new Layout({\n      fit: fit ?? this.fit,\n      alignment: alignment ?? this.alignment,\n      layoutScaleFactor: layoutScaleFactor ?? this.layoutScaleFactor,\n      minX: minX ?? this.minX,\n      minY: minY ?? this.minY,\n      maxX: maxX ?? this.maxX,\n      maxY: maxY ?? this.maxY,\n    });\n  }\n\n  // Returns fit for the Wasm runtime format\n  public runtimeFit(rive: rc.RiveCanvas): rc.Fit {\n    if (this.cachedRuntimeFit) return this.cachedRuntimeFit;\n\n    let fit;\n    if (this.fit === Fit.Cover) fit = rive.Fit.cover;\n    else if (this.fit === Fit.Contain) fit = rive.Fit.contain;\n    else if (this.fit === Fit.Fill) fit = rive.Fit.fill;\n    else if (this.fit === Fit.FitWidth) fit = rive.Fit.fitWidth;\n    else if (this.fit === Fit.FitHeight) fit = rive.Fit.fitHeight;\n    else if (this.fit === Fit.ScaleDown) fit = rive.Fit.scaleDown;\n    else if (this.fit === Fit.Layout) fit = rive.Fit.layout;\n    else fit = rive.Fit.none;\n\n    this.cachedRuntimeFit = fit;\n    return fit;\n  }\n\n  // Returns alignment for the Wasm runtime format\n  public runtimeAlignment(rive: rc.RiveCanvas): rc.Alignment {\n    if (this.cachedRuntimeAlignment) return this.cachedRuntimeAlignment;\n\n    let alignment;\n    if (this.alignment === Alignment.TopLeft)\n      alignment = rive.Alignment.topLeft;\n    else if (this.alignment === Alignment.TopCenter)\n      alignment = rive.Alignment.topCenter;\n    else if (this.alignment === Alignment.TopRight)\n      alignment = rive.Alignment.topRight;\n    else if (this.alignment === Alignment.CenterLeft)\n      alignment = rive.Alignment.centerLeft;\n    else if (this.alignment === Alignment.CenterRight)\n      alignment = rive.Alignment.centerRight;\n    else if (this.alignment === Alignment.BottomLeft)\n      alignment = rive.Alignment.bottomLeft;\n    else if (this.alignment === Alignment.BottomCenter)\n      alignment = rive.Alignment.bottomCenter;\n    else if (this.alignment === Alignment.BottomRight)\n      alignment = rive.Alignment.bottomRight;\n    else alignment = rive.Alignment.center;\n\n    this.cachedRuntimeAlignment = alignment;\n    return alignment;\n  }\n}\n\n// #endregion\n\n// #region runtime\n\nexport { RuntimeLoader, type RuntimeCallback };\n\n// #endregion\n\n// #region state machines\n\n/**\n * @deprecated State machine inputs are deprecated and will be removed in a\n * future major version: please use data binding properties instead. See\n * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}\n * for how to migrate.\n */\nexport enum StateMachineInputType {\n  Number = 56,\n  Trigger = 58,\n  Boolean = 59,\n}\n\n/**\n * An input for a state machine\n * @deprecated State machine inputs are deprecated and will be removed in a\n * future major version: please use data binding properties instead. See\n * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}\n * for how to migrate.\n */\nexport class StateMachineInput {\n  constructor(\n    public readonly type: StateMachineInputType,\n    private runtimeInput: rc.SMIInput,\n  ) {}\n\n  /**\n   * Returns the name of the input\n   */\n  public get name(): string {\n    return this.runtimeInput.name;\n  }\n\n  /**\n   * Returns the current value of the input\n   */\n  public get value(): number | boolean {\n    return this.runtimeInput.value;\n  }\n\n  /**\n   * Sets the value of the input\n   */\n  public set value(value: number | boolean) {\n    this.runtimeInput.value = value;\n  }\n\n  /**\n   * Fires a trigger; does nothing on Number or Boolean input types\n   */\n  public fire(): void {\n    if (this.type === StateMachineInputType.Trigger) {\n      this.runtimeInput.fire();\n    }\n  }\n\n  /**\n   * Deletes the input\n   */\n  public delete(): void {\n    this.runtimeInput = null;\n  }\n}\n\n/**\n * @deprecated Subscribing to Rive Events at runtime is deprecated and will be removed in a future major\n * version: please use data binding instead. See\n * {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.\n */\nexport enum RiveEventType {\n  General = 128,\n  OpenUrl = 131,\n}\n\nclass BaseArtboard {\n  public isBindableArtboard: boolean = false;\n  constructor(_isBindableArtboard: boolean) {\n    this.isBindableArtboard = _isBindableArtboard;\n  }\n}\n\nclass Artboard extends BaseArtboard {\n  public nativeArtboard: rc.Artboard;\n  public file: RiveFile;\n  constructor(artboard: rc.Artboard, _file: RiveFile) {\n    super(false);\n    this.nativeArtboard = artboard;\n    this.file = _file;\n  }\n}\n\nclass BindableArtboard extends BaseArtboard implements rc.FinalizableTarget {\n  public selfUnref: boolean = false;\n  public nativeArtboard: rc.BindableArtboard;\n  public nativeViewModel: rc.ViewModelInstance | null;\n  constructor(artboard: rc.BindableArtboard) {\n    super(true);\n    this.nativeArtboard = artboard;\n  }\n  public set viewModel(value: ViewModelInstance) {\n    this.nativeViewModel = value.nativeInstance;\n  }\n  destroy() {\n    if (this.selfUnref) {\n      this.nativeArtboard.unref();\n      this.nativeViewModel?.unref();\n    }\n  }\n}\n\nclass StateMachine {\n  /**\n   * Caches the inputs from the runtime\n   */\n  public readonly inputs: StateMachineInput[] = [];\n\n  /**\n   * Runtime state machine instance\n   */\n  public readonly instance: rc.StateMachineInstance;\n\n  /**\n   * Whether this state machine has focus nodes\n   */\n  public get hasFocusNodes(): boolean {\n    return this.instance.hasFocusNodes();\n  }\n\n  /**\n   * @constructor\n   * @param stateMachine runtime state machine object\n   * @param instance runtime state machine instance object\n   */\n  constructor(\n    private stateMachine: rc.StateMachine,\n    runtime: rc.RiveCanvas,\n    public playing: boolean,\n    private artboard: rc.Artboard,\n  ) {\n    this.instance = new runtime.StateMachineInstance(stateMachine, artboard);\n    this.initInputs(runtime);\n  }\n\n  public get name(): string {\n    return this.stateMachine.name;\n  }\n\n  /**\n   * Returns a list of state names that have changed on this frame\n   */\n  public get statesChanged(): string[] {\n    const names: string[] = [];\n    for (let i = 0; i < this.instance.stateChangedCount(); i++) {\n      names.push(this.instance.stateChangedNameByIndex(i));\n    }\n    return names;\n  }\n\n  /**\n   * Advances the state machine instance by a given time.\n   * @param time - the time to advance the animation by in seconds\n   */\n  public advance(time: number) {\n    this.instance.advance(time);\n  }\n\n  /**\n   * Advances the state machine instance by a given time and apply changes to artboard.\n   * @param time - the time to advance the animation by in seconds\n   */\n  public advanceAndApply(time: number) {\n    this.instance.advanceAndApply(time);\n  }\n\n  /**\n   * Enables semantic tree tracking for this state machine instance.\n   */\n  public enableSemantics() {\n    this.instance.enableSemantics();\n  }\n\n  /**\n   * Returns the incremental semantic diff since the last call, or null\n   * if semantics is not enabled or nothing changed.\n   */\n  public drainSemanticsDiff(): rc.SemanticsDiff | null {\n    return this.instance.drainSemanticsDiff();\n  }\n\n  /**\n   * Fire a semantic action (tap, increase, decrease) on a node.\n   * @param nodeId - The semantic node ID to target\n   * @param actionType - 0 = tap, 1 = increase, 2 = decrease\n   */\n  public fireSemanticAction(nodeId: number, actionType: SemanticActionType) {\n    this.instance.fireSemanticAction(nodeId, actionType);\n  }\n\n  /**\n   * When tools that enable accessible experiences traverse elements with focus,\n   * we should call this method to focus the semantic node. It will also trigger\n   * focus on any Focus listeners for this node\n   * @param nodeId ID of the Semantic Node to focus\n   * @returns boolean - True if focus was set, false otherwise\n   */\n  public focusSemanticNode(nodeId: number): boolean {\n    return this.instance.focusSemanticNode(nodeId);\n  }\n\n  /**\n   * Returns the number of events reported from the last advance call\n   * @returns Number of events reported\n   */\n  public reportedEventCount(): number {\n    return this.instance.reportedEventCount();\n  }\n\n  /**\n   * Returns a RiveEvent object emitted from the last advance call at the given index\n   * of a list of potentially multiple events. If an event at the index is not found,\n   * undefined is returned.\n   * @param i index of the event reported in a list of potentially multiple events\n   * @returns RiveEvent or extended RiveEvent object returned, or undefined\n   */\n  reportedEventAt(i: number): rc.OpenUrlEvent | rc.RiveEvent | undefined {\n    return this.instance.reportedEventAt(i);\n  }\n\n  /**\n   * Fetches references to the state machine's inputs and caches them\n   * @param runtime an instance of the runtime; needed for the SMIInput types\n   */\n  private initInputs(runtime: rc.RiveCanvas): void {\n    // Fetch the inputs from the runtime if we don't have them\n    for (let i = 0; i < this.instance.inputCount(); i++) {\n      const input = this.instance.input(i);\n      this.inputs.push(this.mapRuntimeInput(input, runtime));\n    }\n  }\n\n  /**\n   * Maps a runtime input to it's appropriate type\n   * @param input\n   */\n  private mapRuntimeInput(\n    input: rc.SMIInput,\n    runtime: rc.RiveCanvas,\n  ): StateMachineInput {\n    if (input.type === runtime.SMIInput.bool) {\n      return new StateMachineInput(\n        StateMachineInputType.Boolean,\n        input.asBool(),\n      );\n    } else if (input.type === runtime.SMIInput.number) {\n      return new StateMachineInput(\n        StateMachineInputType.Number,\n        input.asNumber(),\n      );\n    } else if (input.type === runtime.SMIInput.trigger) {\n      return new StateMachineInput(\n        StateMachineInputType.Trigger,\n        input.asTrigger(),\n      );\n    }\n  }\n\n  /**\n   * Deletes the backing Wasm state machine instance; once this is called, this\n   * state machine is no more.\n   */\n  public cleanup() {\n    this.inputs.forEach((input) => {\n      input.delete();\n    });\n    this.inputs.length = 0;\n    this.instance.delete();\n  }\n\n  public bindViewModelInstance(viewModelInstance: ViewModelInstance) {\n    if (viewModelInstance.runtimeInstance != null) {\n      this.instance.bindViewModelInstance(viewModelInstance.runtimeInstance);\n    }\n  }\n\n  /**\n   * Get metadata about the state of focus if applicable for this state machine.\n   * @returns FocusState - { hasFocus: boolean, expectsKeyboardInput: boolean }\n   */\n  public focusState(): rc.FocusState { \n    return this.instance.focusState();\n  }\n\n  /**\n   * Clear focus from the Rive focus node tree.\n   */\n  public clearFocus(): void {\n    this.instance.clearFocus();\n  }\n}\n\n// #endregion\n\n// #region animator\n\n/**\n * Manages animation\n */\nclass Animator {\n  /**\n   * Constructs a new animator\n   * @constructor\n   * @param runtime Rive runtime; needed to instance animations & state machines\n   * @param artboard the artboard that holds all animations and state machines\n   * @param animations optional list of animations\n   * @param stateMachines optional list of state machines\n   */\n  constructor(\n    private runtime: rc.RiveCanvas,\n    private artboard: rc.Artboard,\n    private eventManager: EventManager,\n    public readonly animations: Animation[] = [],\n    public readonly stateMachines: StateMachine[] = [],\n  ) {}\n\n  /**\n   * Adds animations and state machines by their names. If names are shared\n   * between animations & state machines, then the first one found will be\n   * created. Best not to use the same names for these in your Rive file.\n   * @param animatable the name(s) of animations and state machines to add\n   * @returns a list of names of the playing animations and state machines\n   */\n  public add(\n    animatables: string | string[],\n    playing: boolean,\n    fireEvent = true,\n    semanticsActive = false,\n  ): string[] {\n    animatables = mapToStringArray(animatables);\n    // If animatables is empty, play or pause everything\n    if (animatables.length === 0) {\n      this.animations.forEach((a) => (a.playing = playing));\n      this.stateMachines.forEach((m) => (m.playing = playing));\n    } else {\n      // Play/pause already instanced items, or create new instances\n      const instancedAnimationNames = this.animations.map((a) => a.name);\n      const instancedMachineNames = this.stateMachines.map((m) => m.name);\n      for (let i = 0; i < animatables.length; i++) {\n        const aIndex = instancedAnimationNames.indexOf(animatables[i]);\n        const mIndex = instancedMachineNames.indexOf(animatables[i]);\n        if (aIndex >= 0 || mIndex >= 0) {\n          if (aIndex >= 0) {\n            // Animation is instanced, play/pause it\n            this.animations[aIndex].playing = playing;\n          } else {\n            // State machine is instanced, play/pause it\n            this.stateMachines[mIndex].playing = playing;\n          }\n        } else {\n          // Try to create a new animation instance\n          const anim = this.artboard.animationByName(animatables[i]);\n          if (anim) {\n            const newAnimation = new Animation(\n              anim,\n              this.artboard,\n              this.runtime,\n              playing,\n            );\n            // Display the first frame of the specified animation\n            newAnimation.advance(0);\n            newAnimation.apply(1.0);\n            this.animations.push(newAnimation);\n          } else {\n            // Try to create a new state machine instance\n            const sm = this.artboard.stateMachineByName(animatables[i]);\n            if (sm) {\n              const newStateMachine = new StateMachine(\n                sm,\n                this.runtime,\n                playing,\n                this.artboard,\n              );\n              if (semanticsActive) {\n                newStateMachine.enableSemantics();\n              }\n              this.stateMachines.push(newStateMachine);\n            }\n          }\n        }\n      }\n    }\n    // Fire play/paused events for animations\n    if (fireEvent) {\n      if (playing) {\n        this.eventManager.fire({\n          type: EventType.Play,\n          data: this.playing,\n        });\n      } else {\n        this.eventManager.fire({\n          type: EventType.Pause,\n          data: this.paused,\n        });\n      }\n    }\n\n    return playing ? this.playing : this.paused;\n  }\n\n  /**\n   * Adds linear animations by their names.\n   * @param animatables the name(s) of animations to add\n   * @param playing whether animations should play on instantiation\n   */\n  public initLinearAnimations(animatables: string[], playing: boolean, isFallingBackFromStateMachines = false) {\n    // Play/pause already instanced items, or create new instances\n    // This validation is kept to maintain compatibility with current behavior.\n    // But given that it this is called during artboard initialization\n    // it should probably be safe to remove.\n    const instancedAnimationNames = this.animations.map((a) => a.name);\n    for (let i = 0; i < animatables.length; i++) {\n      const aIndex = instancedAnimationNames.indexOf(animatables[i]);\n      if (aIndex >= 0) {\n        this.animations[aIndex].playing = playing;\n      } else {\n        // Try to create a new animation instance\n        const anim = this.artboard.animationByName(animatables[i]);\n        if (anim) {\n          const newAnimation = new Animation(\n            anim,\n            this.artboard,\n            this.runtime,\n            playing,\n          );\n          // Display the first frame of the specified animation\n          newAnimation.advance(0);\n          newAnimation.apply(1.0);\n          this.animations.push(newAnimation);\n        } else if (isFallingBackFromStateMachines) { // Throw LoadError if we cannot load the state machine name at all\n          const smInitializationMessage = `State Machine with name ${animatables[i]} not found`;\n          throw new RiveError(smInitializationMessage);\n        } else {\n          console.error(`Animation with name ${animatables[i]} not found.`);\n        }\n      }\n    }\n  }\n\n  /**\n   * Adds state machines by their names.\n   * @param animatables the name(s) of state machines to add\n   * @param playing whether state machines should play on instantiation\n   */\n  public initStateMachines(animatables: string[], playing: boolean, semanticsActive: boolean) {\n    // Play/pause already instanced items, or create new instances\n    // This validation is kept to maintain compatibility with current behavior.\n    // But given that it this is called during artboard initialization\n    // it should probably be safe to remove.\n    const instancedStateMachineNames = this.stateMachines.map((a) => a.name);\n    for (let i = 0; i < animatables.length; i++) {\n      const aIndex = instancedStateMachineNames.indexOf(animatables[i]);\n      if (aIndex >= 0) {\n        this.stateMachines[aIndex].playing = playing;\n      } else {\n        // Try to create a new state machine instance\n        const sm = this.artboard.stateMachineByName(animatables[i]);\n        if (sm) {\n          const newStateMachine = new StateMachine(\n            sm,\n            this.runtime,\n            playing,\n            this.artboard,\n          );\n          if (semanticsActive) {\n            newStateMachine.enableSemantics();\n          }\n          this.stateMachines.push(newStateMachine);\n        } else {\n          console.warn(`State Machine with name ${animatables[i]} not found. Falling back to find an animation with the same name.`);\n          \n          // TODO: Remove this fallback in next major release as it complicates initialization.\n          // In order to maintain compatibility with current behavior, if a state machine is not found\n          // we look for an animation with the same name\n          this.initLinearAnimations([animatables[i]], playing, true);\n        }\n      }\n    }\n  }\n\n  /**\n   * Play the named animations/state machines\n   * @param animatables the names of the animations/machines to play; plays all if empty\n   * @returns a list of the playing items\n   */\n  public play(animatables: string | string[]): string[] {\n    return this.add(animatables, true);\n  }\n\n  /**\n   * Advance state machines if they are paused after initialization\n   */\n  public advanceIfPaused(): void {\n    this.stateMachines.forEach((sm) => {\n      if (!sm.playing) {\n        sm.advanceAndApply(0);\n      }\n    });\n  }\n\n  /**\n   * Pauses named animations and state machines, or everything if nothing is\n   * specified\n   * @param animatables names of the animations and state machines to pause\n   * @returns a list of names of the animations and state machines paused\n   */\n  public pause(animatables: string[]): string[] {\n    return this.add(animatables, false);\n  }\n\n  /**\n   * Set time of named animations\n   * @param animations names of the animations to scrub\n   * @param value time scrub value, a floating point number to which the playhead is jumped\n   * @returns a list of names of the animations that were scrubbed\n   */\n  public scrub(animatables: string[], value: number): string[] {\n    const forScrubbing = this.animations.filter((a) =>\n      animatables.includes(a.name),\n    );\n    forScrubbing.forEach((a) => (a.scrubTo = value));\n    return forScrubbing.map((a) => a.name);\n  }\n\n  /**\n   * Returns a list of names of all animations and state machines currently\n   * playing\n   */\n  public get playing(): string[] {\n    return this.animations\n      .filter((a) => a.playing)\n      .map((a) => a.name)\n      .concat(this.stateMachines.filter((m) => m.playing).map((m) => m.name));\n  }\n\n  /**\n   * Returns a list of names of all animations and state machines currently\n   * paused\n   */\n  public get paused(): string[] {\n    return this.animations\n      .filter((a) => !a.playing)\n      .map((a) => a.name)\n      .concat(this.stateMachines.filter((m) => !m.playing).map((m) => m.name));\n  }\n\n  /**\n   * Stops and removes all named animations and state machines\n   * @param animatables animations and state machines to remove\n   * @returns a list of names of removed items\n   */\n  public stop(animatables?: string[] | string): string[] {\n    animatables = mapToStringArray(animatables);\n\n    // If nothing's specified, wipe them out, all of them\n    let removedNames: string[] = [];\n    // Stop everything\n    if (animatables.length === 0) {\n      removedNames = this.animations\n        .map((a) => a.name)\n        .concat(this.stateMachines.map((m) => m.name));\n      // Clean up before emptying the arrays\n      this.animations.forEach((a) => a.cleanup());\n      this.stateMachines.forEach((m) => m.cleanup());\n      // Empty out the arrays\n      this.animations.splice(0, this.animations.length);\n      this.stateMachines.splice(0, this.stateMachines.length);\n    } else {\n      // Remove only the named animations/state machines\n      const animationsToRemove = this.animations.filter((a) =>\n        animatables.includes(a.name),\n      );\n\n      animationsToRemove.forEach((a) => {\n        a.cleanup();\n        this.animations.splice(this.animations.indexOf(a), 1);\n      });\n      const machinesToRemove = this.stateMachines.filter((m) =>\n        animatables.includes(m.name),\n      );\n      machinesToRemove.forEach((m) => {\n        m.cleanup();\n        this.stateMachines.splice(this.stateMachines.indexOf(m), 1);\n      });\n      removedNames = animationsToRemove\n        .map((a) => a.name)\n        .concat(machinesToRemove.map((m) => m.name));\n    }\n\n    this.eventManager.fire({\n      type: EventType.Stop,\n      data: removedNames,\n    });\n\n    // Return the list of animations removed\n    return removedNames;\n  }\n\n  /**\n   * Returns true if at least one animation is active\n   */\n  public get isPlaying(): boolean {\n    return (\n      this.animations.reduce((acc, curr) => acc || curr.playing, false) ||\n      this.stateMachines.reduce((acc, curr) => acc || curr.playing, false)\n    );\n  }\n\n  /**\n   * Returns true if all animations are paused and there's at least one animation\n   */\n  public get isPaused(): boolean {\n    return (\n      !this.isPlaying &&\n      (this.animations.length > 0 || this.stateMachines.length > 0)\n    );\n  }\n\n  /**\n   * Returns true if there are no playing or paused animations/state machines\n   */\n  public get isStopped(): boolean {\n    return this.animations.length === 0 && this.stateMachines.length === 0;\n  }\n\n  /**\n   * If there are no animations or state machines, add the first one found\n   * @returns the name of the animation or state machine instanced\n   */\n  public atLeastOne(playing: boolean, fireEvent = true, semanticsActive = false): string {\n    let instancedName: string;\n    if (this.animations.length === 0 && this.stateMachines.length === 0) {\n      if (this.artboard.animationCount() > 0) {\n        // Warn only when the v3 default would actually change what plays\n        if (this.artboard.stateMachineCount() > 0) {\n          warnOnce(\n            DeprecationKeys.defaultStateMachine,\n            \"No `stateMachine` was specified, so the artboard's first linear animation is playing by default. \" +\n              \"In the next major version, the artboard's state machine will be played by default instead when one exists. \" +\n              \"Pass the `stateMachine` parameter to adopt that behavior now.\",\n          );\n        }\n        // Add the first animation\n        this.add(\n          [(instancedName = this.artboard.animationByIndex(0).name)],\n          playing,\n          fireEvent,\n        );\n      } else if (this.artboard.stateMachineCount() > 0) {\n        // Add the first state machine\n        this.add(\n          [(instancedName = this.artboard.stateMachineByIndex(0).name)],\n          playing,\n          fireEvent,\n          semanticsActive,\n        );\n      }\n    }\n    return instancedName;\n  }\n\n  /**\n   * Checks if any animations have looped and if so, fire the appropriate event\n   */\n  public handleLooping() {\n    for (const animation of this.animations.filter((a) => a.playing)) {\n      // Emit if the animation looped\n      if (animation.loopValue === 0 && animation.loopCount) {\n        animation.loopCount = 0;\n        // This is a one-shot; if it has ended, delete the instance\n        this.stop(animation.name);\n      } else if (animation.loopValue === 1 && animation.loopCount) {\n        this.eventManager.fire({\n          type: EventType.Loop,\n          data: { animation: animation.name, type: LoopType.Loop },\n        });\n        animation.loopCount = 0;\n      }\n      // Wasm indicates a loop at each time the animation\n      // changes direction, so a full loop/lap occurs every\n      // two loop counts\n      else if (animation.loopValue === 2 && animation.loopCount > 1) {\n        this.eventManager.fire({\n          type: EventType.Loop,\n          data: { animation: animation.name, type: LoopType.PingPong },\n        });\n        animation.loopCount = 0;\n      }\n    }\n  }\n\n  /**\n   * Checks if states have changed in state machines and fires a statechange\n   * event\n   */\n  public handleStateChanges() {\n    const statesChanged: string[] = [];\n    for (const stateMachine of this.stateMachines.filter((sm) => sm.playing)) {\n      statesChanged.push(...stateMachine.statesChanged);\n    }\n    if (statesChanged.length > 0) {\n      this.eventManager.fire({\n        type: EventType.StateChange,\n        data: statesChanged,\n      });\n    }\n  }\n\n  public handleAdvancing(time: number) {\n    this.eventManager.fire({\n      type: EventType.Advance,\n      data: time,\n    });\n  }\n}\n\n// #endregion\n\n// #region events\n\n/**\n * Supported event types triggered in Rive\n */\nexport enum EventType {\n  Load = \"load\",\n  LoadError = \"loaderror\",\n  Play = \"play\",\n  Pause = \"pause\",\n  Stop = \"stop\",\n  /**\n   * @deprecated Loop events are deprecated and will be removed in a future\n   * major version: they are only reported for linear animation playback, which\n   * is deprecated. Use a state machine to control playback and data binding to\n   * react to changes instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide} for how\n   * to migrate.\n   */\n  Loop = \"loop\",\n  Draw = \"draw\",\n  Advance = \"advance\",\n  /**\n   * @deprecated Subscribing to state change events at runtime is deprecated\n   * and will be removed in a future major version: use data binding (view model\n   * property observers) or state machine actions to react to changes from your\n   * graphic instead. See\n   * {@link https://rive.app/docs/editor/state-machine/states#actions} for more details.\n   */\n  StateChange = \"statechange\",\n  /**\n   * @deprecated Subscribing to Rive Events at runtime is deprecated and will be removed in a future\n   * major version: please use data binding instead. See\n   * {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.\n   */\n  RiveEvent = \"riveevent\",\n  AudioStatusChange = \"audiostatuschange\", // internal event. TODO: split\n}\n\n/**\n * @deprecated Subscribing to Rive Events at runtime is deprecated and will be removed in a future major\n * version: please use data binding instead. See\n * {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.\n */\nexport type RiveEventPayload = rc.RiveEvent | rc.OpenUrlEvent;\n\nconst riveEventsDeprecationWarning =\n  \"Subscribing to Rive Events at runtime is deprecated and will be removed in a future major version: \" +\n  \"please use data binding instead. See \" +\n  \"https://rive.app/docs/runtimes/web/rive-events for how to migrate.\";\n\nconst stateMachineInputsDeprecationWarning =\n  \"State machine inputs are deprecated and will be removed in a future major version: \" +\n  \"please use data binding properties instead. See \" +\n  \"https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.\";\n\nconst textRunsDeprecationWarning =\n  \"Text run APIs are deprecated and will be removed in a future major version: \" +\n  \"please use data binding instead. See \" +\n  \"https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.\";\n\nconst loopEventsDeprecationWarning =\n  \"Loop events are deprecated and will be removed in a future major version: \" +\n  \"they are only reported for linear animation playback, which is deprecated. \" +\n  \"Use a state machine to control playback and data binding to react to changes instead. See \" +\n  \"https://rive.app/docs/editor/data-binding/migration-guide for how to migrate.\";\n\nconst stateChangeEventsDeprecationWarning =\n  \"Subscribing to state change events at runtime is deprecated and will be removed in a future major version: \" +\n  \"use data binding (view model property observers) or state machine actions to react to \" + \n  \"changes from your graphic instead. See \" +\n  \"https://rive.app/docs/editor/state-machine/states#actions for how to migrate.\";\n\n/**\n * The deprecations this runtime warns about. Each warning prints its own id, so\n * the value can be copied straight out of the console into\n * {@link Rive.suppressDeprecationWarnings}.\n */\nexport const DeprecationKeys = {\n  animationNames: \"animation-names\",\n  animationsParam: \"animations-param\",\n  defaultStateMachine: \"default-state-machine\",\n  legacyConstructors: \"legacy-constructors\",\n  legacyUnsubscribe: \"legacy-unsubscribe\",\n  loopEvents: \"loop-events\",\n  namesArray: \"names-array\",\n  riveEvents: \"rive-events\",\n  scrub: \"scrub\",\n  stateChangeEvents: \"state-change-events\",\n  stateMachineInputs: \"state-machine-inputs\",\n  stateMachinesParam: \"state-machines-param\",\n  textRuns: \"text-runs\",\n} as const;\n\n/**\n * An id accepted by {@link Rive.suppressDeprecationWarnings}, as either a\n * {@link DeprecationKeys} entry or the string literal it holds.\n */\nexport type DeprecationId =\n  (typeof DeprecationKeys)[keyof typeof DeprecationKeys];\n\n// Derived from `DeprecationKeys`\nconst deprecationIds = new Set<string>(\n  Object.keys(DeprecationKeys).map(\n    (name) => DeprecationKeys[name as keyof typeof DeprecationKeys],\n  ),\n);\n\n// Deprecations that a consumer has opted out of. Kept at module scope so\n// `warnOnce` can read it without referencing the `Rive` class\nconst suppressedDeprecations = new Set<DeprecationId>();\n\n/** @internal Backing store for `Rive.suppressDeprecationWarnings`. */\nconst setSuppressedDeprecations = (ids: readonly DeprecationId[]): void => {\n  suppressedDeprecations.clear();\n  if (!Array.isArray(ids)) {\n    console.warn(\n      \"[Rive] `suppressDeprecationWarnings` expects an array of deprecation ids, \" +\n        `received ${typeof ids}. Nothing was suppressed.`,\n    );\n    return;\n  }\n  for (const id of ids) {\n    if (deprecationIds.has(id)) {\n      suppressedDeprecations.add(id);\n    }\n  }\n};\n\n// Deprecation warnings already emitted; each is logged at most once per page\n// session to avoid flooding the console when many instances are created.\nconst emittedWarnings = new Set<string>();\n\n/**\n * Logs a deprecation warning at most once per page session, unless its id has\n * been passed to `Rive.suppressDeprecationWarnings`.\n */\nconst warnOnce = (id: DeprecationId, message: string) => {\n  if (suppressedDeprecations.has(id)) {\n    return;\n  }\n  const key = `${id}:${message}`;\n  if (emittedWarnings.has(key)) {\n    return;\n  }\n  emittedWarnings.add(key);\n  console.warn(\n    `[Rive: ${id}] ${message}\\n` +\n      `To suppress this warning, set Rive.suppressDeprecationWarnings = [\"${id}\"]`,\n  );\n};\n\n/**\n * Warns that a playback-control method received an array of names; the next\n * major version restricts these parameters to a single string, since playing\n * multiple animations or state machines at once will not be supported.\n */\nconst warnIfNamesArray = (\n  names: string | string[] | undefined,\n  methodName: string,\n) => {\n  if (Array.isArray(names)) {\n    warnOnce(\n      DeprecationKeys.namesArray,\n      `Passing an array of names to \\`${methodName}()\\` is deprecated: in the next major version this parameter will be a single string, and playing multiple animations or state machines at once will not be supported.`,\n    );\n  }\n};\n\n/**\n * Warns that a playback-control method received linear animation names;\n * name-based control remains supported for state machines only, so\n * user-specified linear animation names are going away in a future major\n * version.\n */\nconst warnDeprecatedAnimationNames = (methodName: string) => {\n  warnOnce(\n    DeprecationKeys.animationNames,\n    `Passing linear animation names to \\`${methodName}()\\` is deprecated and will be removed in a future major version: ` +\n      \"Pass a single state machine name to control playback instead.\",\n  );\n};\n\n// Event reported by Rive for significant events during animation playback (i.e. play, pause, stop, etc.),\n// as well as for custom Rive events reported from the state machine defined at design-time.\nexport interface Event {\n  type: EventType;\n  data?: string | string[] | LoopEvent | number | RiveEventPayload | RiveFile;\n}\n\n/**\n * Looping types: one-shot, loop, and ping-pong\n * @deprecated Loop events are deprecated and will be removed in a future major\n * version: they are only reported for linear animation playback, which is\n * deprecated. Use a state machine to control playback and data binding to\n * react to changes instead.\n */\nexport enum LoopType {\n  OneShot = \"oneshot\", // has value 0 in runtime\n  Loop = \"loop\", // has value 1 in runtime\n  PingPong = \"pingpong\", // has value 2 in runtime\n}\n\n/**\n * Loop events are returned through onloop callbacks\n * @deprecated Loop events are deprecated and will be removed in a future major\n * version: they are only reported for linear animation playback, which is\n * deprecated. Use a state machine to control playback and data binding to\n * react to changes instead.\n */\nexport interface LoopEvent {\n  animation: string;\n  type: LoopType;\n}\n\n/**\n * Loop events are returned through onloop callbacks\n */\nexport type EventCallback = (event: Event) => void;\n\n/**\n * Event listeners registered with the event manager\n */\nexport interface EventListener {\n  type: EventType;\n  callback: EventCallback;\n}\n\n/**\n * FPS Reporting through callbacks sent to the WASM runtime\n */\nexport type FPSCallback = (fps: number) => void;\n\n// Manages Rive events and listeners\nclass EventManager {\n  constructor(private listeners: EventListener[] = []) {}\n\n  // Gets listeners of specified type\n  private getListeners(type: EventType): EventListener[] {\n    return this.listeners.filter((e) => e.type === type);\n  }\n\n  // Adds a listener\n  public add(listener: EventListener): void {\n    if (!this.listeners.includes(listener)) {\n      this.listeners.push(listener);\n    }\n  }\n\n  /**\n   * Removes a listener\n   * @param listener the listener with the callback to be removed\n   */\n  public remove(listener: EventListener): void {\n    // We can't simply look for the listener as it'll be a different instance to\n    // one originally subscribed. Find all the listeners of the right type and\n    // then check their callbacks which should match.\n    for (let i = 0; i < this.listeners.length; i++) {\n      const currentListener = this.listeners[i];\n      if (currentListener.type === listener.type) {\n        if (currentListener.callback === listener.callback) {\n          this.listeners.splice(i, 1);\n          break;\n        }\n      }\n    }\n  }\n\n  /**\n   * Clears all listeners of specified type, or every listener if no type is\n   * specified\n   * @param type the type of listeners to clear, or all listeners if not\n   * specified\n   */\n  public removeAll(type?: EventType) {\n    if (!type) {\n      this.listeners.splice(0, this.listeners.length);\n    } else {\n      this.listeners\n        .filter((l) => l.type === type)\n        .forEach((l) => this.remove(l));\n    }\n  }\n\n  // Fires an event\n  public fire(event: Event): void {\n    const eventListeners = this.getListeners(event.type);\n    eventListeners.forEach((listener) => listener.callback(event));\n  }\n}\n\n// #endregion\n\n// #region Manages a queue of tasks\n\n// A task in the queue; will fire the action when the queue is processed; will\n// also optionally fire an event.\nexport interface Task {\n  action?: VoidCallback;\n  event?: Event;\n}\n\n// Manages a queue of tasks\nclass TaskQueueManager {\n  private queue: Task[] = [];\n\n  constructor(private eventManager: EventManager) {}\n\n  // Adds a task top the queue\n  public add(task: Task): void {\n    this.queue.push(task);\n  }\n\n  // Processes all tasks in the queue\n  public process(): void {\n    while (this.queue.length > 0) {\n      const task = this.queue.shift();\n      if (task?.action) {\n        task.action();\n      }\n      if (task?.event) {\n        this.eventManager.fire(task.event);\n      }\n    }\n  }\n}\n\n// #endregion\n\n// #region Audio\n\nenum SystemAudioStatus {\n  AVAILABLE,\n  UNAVAILABLE,\n}\n\n// Class to handle audio context availability and status changes\nclass AudioManager extends EventManager {\n  private _started: boolean = false;\n  private _enabled: boolean = false;\n\n  private _status: SystemAudioStatus = SystemAudioStatus.UNAVAILABLE;\n  private _audioContext: AudioContext;\n\n  private async delay(time: number) {\n    return new Promise((resolve) => setTimeout(resolve, time));\n  }\n\n  private async timeout() {\n    return new Promise((_, reject) => setTimeout(reject, 50));\n  }\n\n  // Alerts animations on status changes and removes the listeners to avoid alerting twice.\n  private reportToListeners() {\n    this.fire({ type: EventType.AudioStatusChange });\n    this.removeAll();\n  }\n\n  /**\n   * The audio context has been resolved.\n   * Alert any listeners that we can now play audio.\n   * Rive will now play audio at the configured volume.\n   */\n  private async enableAudio() {\n    if (!this._enabled) {\n      this._enabled = true;\n      this._status = SystemAudioStatus.AVAILABLE;\n      this.reportToListeners();\n    }\n  }\n\n  /**\n   * Check if we are able to play audio.\n   *\n   * We currently check the audio context, when resume() returns before a timeout we know that the\n   * audio context is running and we can enable audio.\n   */\n  private async testAudio() {\n    if (\n      this._status === SystemAudioStatus.UNAVAILABLE &&\n      this._audioContext !== null\n    ) {\n      // if the audio context is not available, it will never resume,\n      // so the timeout will throw after 50ms and a new cycle will start\n      try {\n        await Promise.race([this._audioContext.resume(), this.timeout()]);\n        this.enableAudio();\n      } catch {\n        // we expect the promise race to timeout, which we ignore.\n      }\n    }\n  }\n\n  /**\n   * Establish audio for use with rive.\n   * We both test if we can use audio intermittently and listen for user interaction.\n   * The aim is to enable audio playback as soon as the browser allows this.\n   */\n  private async _establishAudio() {\n    if (!this._started) {\n      this._started = true;\n      // If window doesn't exist we assume they are not in a browser context\n      // so audio will not be blocked\n      if (typeof window == \"undefined\") {\n        this.enableAudio();\n      } else {\n        this._audioContext = new AudioContext();\n        this.listenForUserAction();\n        while (this._status === SystemAudioStatus.UNAVAILABLE) {\n          await this.testAudio();\n          await this.delay(1000);\n        }\n      }\n    }\n  }\n\n  private listenForUserAction() {\n    // NOTE: AudioContexts are ready immediately if requested in a ui callback\n    // we *could* re request one in this listener.\n    const _clickListener = async () => {\n      // note this has \"better\" results than calling `await this.testAudio()`\n      // as we force audio to be enabled in the current thread, rather than chancing\n      // the thread to be passed over for some other async context\n\n      this.enableAudio();\n    };\n    // NOTE: we should test this on mobile/pads\n    document.addEventListener(\"pointerdown\", _clickListener, {\n      once: true,\n    });\n  }\n\n  /**\n   * Establish the audio context for rive, this lets rive know that we can play audio.\n   */\n  public async establishAudio() {\n    this._establishAudio();\n  }\n\n  public get systemVolume() {\n    if (this._status === SystemAudioStatus.UNAVAILABLE) {\n      // We do an immediate test to avoid depending on the delay of the running test\n      this.testAudio();\n      return 0;\n    }\n    return 1;\n  }\n\n  public get status(): SystemAudioStatus {\n    return this._status;\n  }\n}\n\nconst audioManager = new AudioManager();\n\n// #endregion\n\n// #region Observers\n\ntype ObservedObject = {\n  onResize: Function;\n  element: HTMLCanvasElement;\n};\n\ntype MyResizeObserverType = {\n  observe: Function;\n  unobserve: Function;\n  disconnect: Function;\n};\n\nclass FakeResizeObserver {\n  observe() {}\n  unobserve() {}\n  disconnect() {}\n}\n\nconst MyResizeObserver = globalThis.ResizeObserver || FakeResizeObserver;\n\n/**\n * This class takes care of any observers that will be attached to an animation.\n * It should be treated as a singleton because observers are much more performant\n * when used for observing multiple elements by a single instance.\n */\n\nclass ObjectObservers {\n  private _elementsMap: Map<HTMLCanvasElement, ObservedObject> = new Map();\n\n  private _resizeObserver: MyResizeObserverType;\n\n  constructor() {\n    this._resizeObserver = new MyResizeObserver(this._onObserved);\n  }\n\n  /**\n   * Resize observers trigger both when the element changes its size and also when the\n   * element is added or removed from the document.\n   */\n  private _onObservedEntry = (entry: ResizeObserverEntry) => {\n    const observed = this._elementsMap.get(entry.target as HTMLCanvasElement);\n    if (observed !== null) {\n      observed.onResize(\n        entry.target.clientWidth == 0 || entry.target.clientHeight == 0,\n      );\n    } else {\n      this._resizeObserver.unobserve(entry.target);\n    }\n  };\n\n  private _onObserved = (entries: ResizeObserverEntry[]) => {\n    entries.forEach(this._onObservedEntry);\n  };\n\n  // Adds an observable element\n  public add(element: HTMLCanvasElement, onResize: Function) {\n    let observed: ObservedObject = {\n      onResize,\n      element,\n    };\n    this._elementsMap.set(element, observed);\n    this._resizeObserver.observe(element);\n    return observed;\n  }\n\n  // Removes an observable element\n  public remove(observed: ObservedObject) {\n    this._resizeObserver.unobserve(observed.element);\n    this._elementsMap.delete(observed.element);\n  }\n}\n\nconst observers = new ObjectObservers();\n\n// #endregion\n\n// #region Rive\n\nlet nextRiveInstanceId = 0;\n\n// Interface for the Rive static method contructor\nexport interface RiveParameters {\n  canvas: HTMLCanvasElement | OffscreenCanvas; // canvas is required\n  /**\n   * URI of the `.riv` file to load. Will be fetched by the runtime. Can be used instead of\n   * `buffer` or `riveFile`.\n   */\n  src?: string;\n  /**\n   * ArrayBuffer of .riv file contents. Can be used instead of `src` or `riveFile` if you\n   * fetch the file contents yourself.\n   */\n  buffer?: ArrayBuffer;\n  /**\n   * RiveFile instance if created separately. Useful if you reuse a Rive file across multiple instances.\n   * Can be used instead of `src` or `buffer`.\n   */\n  riveFile?: RiveFile;\n  /**\n   * Name of the artboard to display.\n   */\n  artboard?: string;\n  /**\n   * Name of the state machine to play.\n   */\n  stateMachine?: string;\n  /**\n   * @deprecated Use the `stateMachine` parameter to play a state machine\n   * instead. Support for starting playback with named animations will be\n   * removed in a future major version.\n   */\n  animations?: string | string[];\n  /**\n   * @deprecated Use `stateMachine` with a single state machine name instead.\n   * Support for playing multiple state machines at once will be removed in a\n   * future major version.\n   */\n  stateMachines?: string | string[];\n  layout?: Layout;\n  autoplay?: boolean;\n  useOffscreenRenderer?: boolean;\n  /**\n   * Optional tab index to set for the canvas element if there are any Focus nodes within the graphic\n   */\n  tabIndex?: number;\n  /**\n   * Optional settings for focus behavior\n   */\n  focusOptions?: RiveFocusOptions;\n  /**\n   * Allow the runtime to automatically load assets hosted in Rive's CDN.\n   * enabled by default.\n   */\n  enableRiveAssetCDN?: boolean;\n  /**\n   * @experimental This API is early and may encounter breaking behavior change without a major version bump\n   *\n   * When to build semantic trees and the accessibility DOM overlay.\n   * Defaults to {@link SemanticMode.Disabled}.\n   */\n  semanticsMode?: SemanticMode;\n  /**\n   * @experimental This API is early and may encounter breaking behavior change without a major version bump\n   *\n   * Optional options for the accessibility overlay container.\n   */\n  semanticsOptions?: RiveSemanticsOptions;\n  /**\n   * Turn off Rive Listeners. This means state machines that have Listeners\n   * will not be invoked, and also, no event listeners pertaining to Listeners\n   * will be attached to the <canvas> element\n   */\n  shouldDisableRiveListeners?: boolean;\n  /**\n   * For Rive Listeners, allows scrolling behavior to still occur on canvas elements\n   * when a touch/drag action is performed on touch-enabled devices. Otherwise,\n   * scroll behavior may be prevented on touch/drag actions on the canvas by default.\n   */\n  isTouchScrollEnabled?: boolean;\n  /**\n   * Enable Rive Events to be handled by the runtime. This means any special Rive Event may have\n   * a side effect that takes place implicitly.\n   *\n   * For example, if during the render loop an OpenUrlEvent is detected, the\n   * browser may try to open the specified URL in the payload.\n   *\n   * This flag is false by default to prevent any unwanted behaviors from taking place.\n   * This means any special Rive Event will have to be handled manually by subscribing to\n   * EventType.RiveEvent\n   *\n   * @deprecated Subscribing to Rive Events at runtime is deprecated and will be removed in a future\n   * major version: please use data binding instead. See\n   * {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.\n   */\n  automaticallyHandleEvents?: boolean;\n  /**\n   * Rive will look for a default view model and view model instance to bind to the artboard\n   */\n  autoBind?: boolean;\n  /**\n   * For Rive Listeners, dispatch a pointer exit when the pointer exits the canvas.\n   */\n  dispatchPointerExit?: boolean;\n  /**\n   * Enables multi touch support\n   */\n  enableMultiTouch?: boolean;\n  /**\n   * Enum with drawing options for optimizations\n   */\n  drawingOptions?: DrawOptimizationOptions;\n  /**\n   * @experimental This API is early and may encounter breaking behavior change without a major version bump\n   *\n   * Render GPU Canvas content, which draws through the deferred renderer.\n   *\n   * Only applies when this instance loads its own file (`src`/`buffer`), where it\n   * is forwarded to that file as {@link RiveFileParameters.enableGPUCanvas}. With a\n   * supplied `riveFile` the file's own flag wins, since a file's mode is fixed at\n   * import. False by default.\n   */\n  enableGPUCanvas?: boolean;\n  /**\n   * Emit performance.mark / performance.measure entries for load lifecycle\n   * events and the first 3 render frames. Useful for profiling Rive's\n   * contribution to load and render time in browser devtools.\n   * False by default.\n   */\n  enablePerfMarks?: boolean;\n  onLoad?: EventCallback;\n  onLoadError?: EventCallback;\n  onPlay?: EventCallback;\n  onPause?: EventCallback;\n  onStop?: EventCallback;\n  /**\n   * @deprecated Loop events are deprecated and will be removed in a future\n   * major version: they are only reported for linear animation playback, which\n   * is deprecated. Use a state machine to control playback and data binding to\n   * react to changes instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide} for how\n   * to migrate.\n   */\n  onLoop?: EventCallback;\n  /**\n   * @deprecated Subscribing to state change events at runtime is deprecated\n   * and will be removed in a future major version: use data binding (view model\n   * property observers) or state machine actions to react to changes from your\n   * graphic instead. See\n   * {@link https://rive.app/docs/editor/state-machine/states#actions} for how\n   * to migrate.\n   */\n  onStateChange?: EventCallback;\n  onAdvance?: EventCallback;\n  assetLoader?: AssetLoadCallback;\n  /**\n   * @deprecated Use `onLoad()` instead\n   */\n  onload?: EventCallback;\n  /**\n   * @deprecated Use `onLoadError()` instead\n   */\n  onloaderror?: EventCallback;\n  /**\n   * @deprecated Use `onPlay()` instead\n   */\n  onplay?: EventCallback;\n  /**\n   * @deprecated Use `onPause()` instead\n   */\n  onpause?: EventCallback;\n  /**\n   * @deprecated Use `onStop()` instead\n   */\n  onstop?: EventCallback;\n  /**\n   * @deprecated Use `onLoop()` instead\n   */\n  onloop?: EventCallback;\n  /**\n   * @deprecated Use `onStateChange()` instead\n   */\n  onstatechange?: EventCallback;\n}\n\n// Interface to Rive.load function\nexport interface RiveLoadParameters {\n  src?: string;\n  buffer?: ArrayBuffer;\n  riveFile?: RiveFile;\n  autoplay?: boolean;\n  autoBind?: boolean;\n  artboard?: string;\n  /**\n   * Name of the state machine to play.\n   */\n  stateMachine?: string;\n  /**\n   * @deprecated Use the `stateMachine` parameter to play a state machine\n   * instead. Support for starting playback with named animations will be\n   * removed in a future major version.\n   */\n  animations?: string | string[];\n  /**\n   * @deprecated Use `stateMachine` with a single state machine name instead.\n   * Support for playing multiple state machines at once will be removed in a\n   * future major version.\n   */\n  stateMachines?: string | string[];\n  useOffscreenRenderer?: boolean;\n  shouldDisableRiveListeners?: boolean;\n  tabIndex?: number;\n  semanticsMode?: SemanticMode;\n  semanticsOptions?: RiveSemanticsOptions;\n  /**\n   * @experimental This API is early and may encounter breaking behavior change without a major version bump\n   *\n   * Render GPU Canvas content, which draws through the deferred renderer. Forwarded\n   * to the file this instance loads; with a supplied `riveFile` the file's flag wins.\n   * False by default.\n   */\n  enableGPUCanvas?: boolean;\n}\n\n// Interface ot Rive.reset function\nexport interface RiveResetParameters {\n  artboard?: string;\n  /**\n   * Name of the state machine to play.\n   */\n  stateMachine?: string;\n  /**\n   * @deprecated Use the `stateMachine` parameter to play a state machine\n   * instead. Support for starting playback with named animations will be\n   * removed in a future major version.\n   */\n  animations?: string | string[];\n  /**\n   * @deprecated Use `stateMachine` with a single state machine name instead.\n   * Support for playing multiple state machines at once will be removed in a\n   * future major version.\n   */\n  stateMachines?: string | string[];\n  autoplay?: boolean;\n  autoBind?: boolean;\n}\n// Interface to RiveFile.load function\nexport interface RiveFileParameters {\n  src?: string;\n  buffer?: ArrayBuffer;\n  assetLoader?: AssetLoadCallback;\n  enableRiveAssetCDN?: boolean;\n  onLoad?: EventCallback;\n  onLoadError?: EventCallback;\n  /**\n   * Emit performance.mark / performance.measure entries for load lifecycle\n   * events. False by default.\n   */\n  enablePerfMarks?: boolean;\n  /**\n   * @experimental This API is early and may encounter breaking behavior change without a major version bump\n   *\n   * Render GPU Canvas content in this file, importing it through a deferred\n   * rendering session.\n   *\n   * Fixed at import and has no setter: a file's resources are typed by the factory\n   * that made them and can never switch. The session records for the one canvas that\n   * displays the file, so a second Rive instance sharing this file re-imports it into\n   * a session of its own.\n   * False by default.\n   */\n  enableGPUCanvas?: boolean;\n}\n\n/**\n * Resolves which animation/state machine names playback should start with.\n * The `stateMachine` parameter takes priority; the deprecated plural\n * `animations`/`stateMachines` parameters apply only when it\n * is not provided.\n */\nconst resolveStartingPlayback = ({\n  stateMachine,\n  animations,\n  stateMachines,\n}: {\n  stateMachine?: string;\n  animations?: string | string[];\n  stateMachines?: string | string[];\n}): {\n  startingAnimationNames: string[];\n  startingStateMachineNames: string[];\n} => {\n  if (animations !== undefined) {\n    warnOnce(\n      DeprecationKeys.animationsParam,\n      \"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.\",\n    );\n  }\n  if (stateMachines !== undefined) {\n    warnOnce(\n      DeprecationKeys.stateMachinesParam,\n      \"The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead.\",\n    );\n  }\n  if (stateMachine) {\n    return {\n      startingAnimationNames: [],\n      startingStateMachineNames: [stateMachine],\n    };\n  }\n  return {\n    startingAnimationNames: mapToStringArray(animations),\n    startingStateMachineNames: mapToStringArray(stateMachines),\n  };\n};\n\nexport class RiveFile implements rc.FinalizableTarget {\n  // Error message for missing source or buffer\n  private static readonly missingErrorMessage: string =\n    \"Rive source file or data buffer required\";\n\n  // Error message for file load error\n  private static readonly fileLoadErrorMessage: string =\n    \"The file failed to load\";\n\n  // A url to a Rive file; may be undefined if a buffer is specified\n  private src: string;\n\n  // Raw Rive file data; may be undefined if a src is specified\n  private buffer: ArrayBuffer;\n\n  // Wasm runtime\n  private runtime: rc.RiveCanvas;\n\n  // Runtime file\n  private file: rc.File;\n\n  // AssetLoadCallback: allows customizing asset loading for images and fonts.\n  private assetLoader: AssetLoadCallback;\n\n  // Allow the runtime to automatically load assets hosted in Rive's runtime.\n  private enableRiveAssetCDN: boolean = true;\n\n  // When true, emits performance.mark/measure entries during RiveFile load.\n  private enablePerfMarks: boolean = false;\n\n  // Holds event listeners\n  private eventManager: EventManager;\n\n  private referenceCount: number = 0;\n\n  private destroyed: boolean = false;\n\n  public selfUnref: boolean = false;\n\n  private bindableArtboards: BindableArtboard[] = [];\n\n  // Deferred rendering was requested; the session may still be null if this\n  // build has no deferred support.\n  private deferred: boolean = false;\n\n  // The session this file imported through, null when immediate. Owned here:\n  // it has to outlive the file, so it is deleted after the file is released.\n  private session: rc.DeferredSession | null = null;\n\n  // Attaching is once per session: a detached session can never replay again,\n  // so a claimed file re-imports for the next instance implicitly. Mirrors the native\n  // latch (WebGL2DeferredSession::everBound, C2DDeferredSession::claim).\n  private _sessionClaimed: boolean = false;\n\n  // Releasing this file has to be deterministic once a session owns its\n  // resources, so the finalizer is disarmed rather than left to GC.\n  private fileFinalizer: FileFinalizer | null = null;\n\n  private boundElsewhereWarned: boolean = false;\n\n  // Deferred support is per build, so the warning is per page, not per file.\n  private static deferredUnsupportedWarned: boolean = false;\n\n  constructor(params: RiveFileParameters) {\n    this.src = params.src;\n    this.buffer = params.buffer;\n    this.deferred = !!params.enableGPUCanvas;\n\n    if (params.assetLoader) this.assetLoader = params.assetLoader;\n    this.enableRiveAssetCDN =\n      typeof params.enableRiveAssetCDN == \"boolean\"\n        ? params.enableRiveAssetCDN\n        : true;\n    this.enablePerfMarks = !!params.enablePerfMarks;\n    if (this.enablePerfMarks) RuntimeLoader.enablePerfMarks = true;\n\n    // New event management system\n    this.eventManager = new EventManager();\n    if (params.onLoad) this.on(EventType.Load, params.onLoad);\n    if (params.onLoadError) this.on(EventType.LoadError, params.onLoadError);\n  }\n\n  private releaseFile() {\n    // Release here rather than leaving it to the finalization registry. The\n    // native file frees GL-backed resources when its last reference goes, and\n    // callers reach this with the renderer's context current; a finalizer runs\n    // with none, so those deletes would silently do nothing.\n    this.fileFinalizer?.release();\n    this.file?.unref();\n    this.fileFinalizer = null;\n    this.file = null;\n  }\n\n  private releaseSession() {\n    // Known limitation: cleanup() on a file an instance is still drawing\n    // deletes the session under it. A RiveFile's creator holds no reference of\n    // its own, so their cleanup() can take the count to zero.\n    this.session?.delete();\n    this.session = null;\n  }\n\n  private releaseBindableArtboards() {\n    this.bindableArtboards.forEach((bindableArtboard) =>\n      bindableArtboard.destroy(),\n    );\n  }\n\n  private async initData() {\n    if (this.src && !this.buffer) {\n      try {\n        this.buffer = await loadRiveFile(this.src);\n      } catch (error) {\n        if (error instanceof Error) {\n          throw error;\n        }\n        throw new RiveError(RiveFile.fileLoadErrorMessage);\n      }\n    }\n    if (this.destroyed) {\n      return;\n    }\n    if (this.deferred && this.session === null) {\n      this.session = RiveFile.makeDeferredSession(this.runtime);\n    }\n    let loader;\n    if (this.assetLoader) {\n      // The session reaches out of band assets through here: a resource made\n      // by any other factory is dropped when this file draws.\n      const loaderWrapper = new CustomFileAssetLoaderWrapper(\n        this.runtime,\n        this.assetLoader,\n        this.session,\n      );\n      loader = loaderWrapper.assetLoader;\n    }\n    // Load the Rive file\n    if (this.enablePerfMarks) performance.mark('rive:file-load:start');\n    try {\n      this.file = await this.runtime.load(\n        new Uint8Array(this.buffer),\n        loader,\n        this.enableRiveAssetCDN,\n        this.session,\n      );\n    } catch (error) {\n      // The finalizer that would reclaim the session is only registered once\n      // the import succeeds, so a failed load has to release it here.\n      this.releaseSession();\n      throw error;\n    }\n    if (this.enablePerfMarks) {\n      performance.mark('rive:file-load:end');\n      performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');\n    }\n    if (this.destroyed) {\n      this.releaseFile();\n      this.releaseSession();\n      return;\n    }\n    if (this.file === null) {\n      // A malformed file resolves to null rather than rejecting. Release the\n      // session now: a finalizer for a file that does not exist would keep it\n      // alive until GC, or for as long as the caller holds the failed RiveFile.\n      this.releaseSession();\n      this.fireLoadError(RiveFile.fileLoadErrorMessage);\n      return;\n    }\n    // The finalizer carries the session too: a RiveFile that becomes\n    // unreachable without cleanup() would otherwise unref its file on GC and\n    // strand the session, which nothing else reclaims.\n    const fileFinalizer = new FileFinalizer(this.file, this.session);\n    this.fileFinalizer = fileFinalizer;\n    finalizationRegistry.register(this, fileFinalizer);\n\n    this.eventManager.fire({\n      type: EventType.Load,\n      data: this,\n    });\n  }\n\n  private async loadRiveFileBytes(): Promise<ArrayBuffer> {\n    if (this.enablePerfMarks) performance.mark('rive:fetch-riv:start');\n    const bufferPromise: Promise<ArrayBuffer> = this.src\n      ? loadRiveFile(this.src)\n      : Promise.resolve(this.buffer);\n    if (this.enablePerfMarks && this.src) {\n      bufferPromise.then(() => {\n        performance.mark('rive:fetch-riv:end');\n        performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');\n      })\n    }\n    return bufferPromise;\n  }\n\n  private async loadRuntime(): Promise<rc.RiveCanvas> {\n    if (this.enablePerfMarks) performance.mark('rive:await-wasm:start');\n    const runtimePromise = RuntimeLoader.awaitInstance();\n    if (this.enablePerfMarks) {\n      runtimePromise.then(() => {\n        performance.mark('rive:await-wasm:end');\n        performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');\n      })\n    }\n    return runtimePromise;\n  }\n\n  public async init() {\n    // If no source file url specified, it's a bust\n    if (!this.src && !this.buffer) {\n      this.fireLoadError(RiveFile.missingErrorMessage);\n      return;\n    }\n\n    try {\n      // Kick off the .riv file fetch and WASM module init simultaneously —\n      // they have no dependency on each other so both can be in-flight at once.\n     const [bufferResolved, runtimeResolved] = await Promise.all([this.loadRiveFileBytes(), this.loadRuntime()]);\n\n      if (this.destroyed) {\n        return;\n      }\n      // .riv file buffer and WASM runtime instance\n      this.buffer = bufferResolved;\n      this.runtime = runtimeResolved;\n\n      if (this.enablePerfMarks) performance.mark('rive:init-data:start');\n      await this.initData();\n      if (this.enablePerfMarks) {\n        performance.mark('rive:init-data:end');\n        performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');\n      }\n    } catch (error) {\n      this.fireLoadError(\n        error instanceof Error ? error.message : RiveFile.fileLoadErrorMessage,\n      );\n    }\n  }\n\n  private fireLoadError(message: string): void {\n    this.eventManager.fire({\n      type: EventType.LoadError,\n      data: message,\n    });\n\n    throw new RiveError(message);\n  }\n\n  /**\n   * Subscribe to Rive-generated events\n   * @param type the type of event to subscribe to\n   * @param callback callback to fire when the event occurs\n   */\n  public on(type: EventType, callback: EventCallback) {\n    this.eventManager.add({\n      type: type,\n      callback: callback,\n    });\n  }\n\n  /**\n   * Unsubscribes from a Rive-generated event\n   * @param type the type of event to unsubscribe from\n   * @param callback the callback to unsubscribe\n   */\n  public off(type: EventType, callback: EventCallback) {\n    this.eventManager.remove({\n      type: type,\n      callback: callback,\n    });\n  }\n\n  public cleanup() {\n    this.referenceCount -= 1;\n    if (this.referenceCount <= 0) {\n      this.removeAllRiveEventListeners();\n      this.releaseFile();\n      this.releaseBindableArtboards();\n      // Everything imported through the session is gone; the session can go.\n      this.releaseSession();\n      this.destroyed = true;\n    }\n  }\n\n  // Deferred is only compiled into some runtime builds, so feature detect it\n  // and degrade to an immediate import rather than failing the load.\n  private static makeDeferredSession(\n    runtime: rc.RiveCanvas,\n  ): rc.DeferredSession | null {\n    const session = runtime.makeDeferredSession?.() ?? null;\n    if (session === null && !RiveFile.deferredUnsupportedWarned) {\n      RiveFile.deferredUnsupportedWarned = true;\n      console.warn(\n        \"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.\",\n      );\n    }\n    return session;\n  }\n\n  /**\n   * @internal The deferred session this file imported through, or null if it\n   * was imported in immediate mode.\n   */\n  public get deferredSession(): rc.DeferredSession | null {\n    return this.session;\n  }\n\n  /**\n   * @internal Whether deferred was asked for, even when this build could not\n   * honor it and imported immediate.\n   */\n  public get deferredRequested(): boolean {\n    return this.deferred;\n  }\n\n  /**\n   * @internal Whether this file's session has ever been attached to a renderer.\n   * Attaching is once per session, so a claimed file re-imports for the next\n   * instance even after the renderer it was bound to is gone.\n   */\n  public get sessionClaimed(): boolean {\n    return this._sessionClaimed;\n  }\n\n  /**\n   * @internal Marks this file's session as spent. There is no matching release:\n   * a session that has been attached can never replay for another renderer.\n   */\n  public claimSession(): void {\n    this._sessionClaimed = true;\n  }\n\n  /**\n   * @internal One warning per file however many instances collide on it.\n   */\n  public warnBoundElsewhereOnce(): void {\n    if (this.boundElsewhereWarned) {\n      return;\n    }\n    this.boundElsewhereWarned = true;\n    console.warn(\n      \"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).\",\n    );\n  }\n\n  /**\n   * @internal Re-imports this file from its retained buffer into a mode of its\n   * own. The copy is owned by whoever asked for it and never joins this file's\n   * reference count.\n   */\n  public async reimport(deferred: boolean): Promise<RiveFile> {\n    const copy = new RiveFile({\n      buffer: this.buffer,\n      assetLoader: this.assetLoader,\n      enableRiveAssetCDN: this.enableRiveAssetCDN,\n      enablePerfMarks: this.enablePerfMarks,\n      enableGPUCanvas: deferred,\n    });\n    await copy.init();\n    return copy;\n  }\n\n  /**\n   * Unsubscribes all Rive listeners from an event type, or everything if no type is\n   * given\n   * @param type the type of event to unsubscribe from, or all types if\n   * undefined\n   */\n  public removeAllRiveEventListeners(type?: EventType) {\n    this.eventManager.removeAll(type);\n  }\n\n  public getInstance(): rc.File {\n    if (this.file !== null) {\n      this.referenceCount += 1;\n      return this.file;\n    }\n  }\n\n  public destroyIfUnused() {\n    if (this.referenceCount <= 0) {\n      this.cleanup();\n    }\n  }\n\n  private createBindableArtboard(\n    nativeBindableArtboard: rc.BindableArtboard,\n  ): BindableArtboard | null {\n    if (nativeBindableArtboard != null) {\n      const bindableArtboard = new BindableArtboard(nativeBindableArtboard);\n      createFinalization(bindableArtboard, bindableArtboard.nativeArtboard);\n      this.bindableArtboards.push(bindableArtboard);\n      return bindableArtboard;\n    }\n    return null;\n  }\n\n  /**\n   * @deprecated This function is deprecated. For better stability and memory management\n   * use `getBindableArtboard()` instead.\n   * @param {string} name - The name of the artboard.\n   * @returns {Artboard} The artboard to bind to.\n   */\n  public getArtboard(name: string): Artboard | null {\n    const nativeArtboard = this.file.artboardByName(name);\n    if (nativeArtboard != null) {\n      return new Artboard(nativeArtboard, this);\n    }\n  }\n\n  public getBindableArtboard(name: string): BindableArtboard | null {\n    const nativeArtboard = this.file.bindableArtboardByName(name);\n    return this.createBindableArtboard(nativeArtboard);\n  }\n\n  public getDefaultBindableArtboard(): BindableArtboard | null {\n    const nativeArtboard = this.file.bindableArtboardDefault();\n    return this.createBindableArtboard(nativeArtboard);\n  }\n\n  public internalBindableArtboardFromArtboard(\n    artboard: rc.Artboard,\n  ): BindableArtboard | null {\n    const nativeBindableArtboard =\n      this.file.internalBindableArtboardFromArtboard(artboard);\n    return this.createBindableArtboard(nativeBindableArtboard);\n  }\n\n  public viewModelByName(name: string): ViewModel | null {\n    const viewModel = this.file.viewModelByName(name);\n    if (viewModel !== null) {\n      return new ViewModel(viewModel);\n    }\n    return null;\n  }\n\n  /**\n   * @returns the names of the file's global view models, in file order.\n   */\n  public globalViewModelNames(): string[] {\n    return this.file.globalViewModelNames();\n  }\n}\n\nexport class Rive {\n  // Canvas in which to render the artboard\n  private readonly canvas: HTMLCanvasElement | OffscreenCanvas;\n\n  // A url to a Rive file; may be undefined if a buffer is specified\n  private src: string;\n\n  // Raw Rive file data; may be undefined if a src is specified\n  private buffer: ArrayBuffer;\n\n  // The layout for rendering in the canvas\n  private _layout: Layout;\n\n  // The runtime renderer\n  private renderer: rc.WrappedRenderer;\n\n  // Tracks if a Rive file is loaded\n  private loaded = false;\n\n  // Tracks if a Rive file is destroyed\n  private destroyed = false;\n\n  // Reference of an object that handles any observers for the animation\n  private _observed: ObservedObject | null = null;\n\n  /**\n   * Tracks if a Rive file is loaded; we need this in addition to loaded as some\n   * commands (e.g. contents) can be called as soon as the file is loaded.\n   * However, playback commands need to be queued and run in order once initial\n   * animations and autoplay has been sorted out. This applies to play, pause,\n   * and start.\n   */\n  private readyForPlaying = false;\n\n  // Wasm runtime\n  private runtime: rc.RiveCanvas;\n\n  // Deferred rendering was requested for this instance. The file it renders\n  // has the final say, since a file's mode is fixed at import.\n  private deferredRenderer: boolean = false;\n\n  // Whether this instance imported the file in `riveFile` (true) or the caller\n  // supplied it (false). Only a file we imported may be released without a\n  // matching getInstance(): a caller's file is theirs however this init ends.\n  private ownsRiveFile: boolean = false;\n\n  // Runtime artboard\n  private artboard: rc.Artboard | null = null;\n\n  // place to clear up pointer/touch event listeners\n  private eventCleanup: VoidCallback | null = null;\n\n  // Manages keyboard and DOM-focus interactions for the canvas.\n  private _keyboardInteractions: KeyboardInteractions | null = null;\n\n  // Runtime file\n  private file: rc.File;\n\n  // Rive file instance\n  private riveFile: RiveFile;\n\n  // Holds event listeners\n  private eventManager: EventManager;\n\n  // Manages the loading task queue\n  private taskQueue: TaskQueueManager;\n\n  // Animator: manages animations and state machines\n  private animator: Animator;\n\n  // AssetLoadCallback: allows customizing asset loading for images and fonts.\n  private assetLoader: AssetLoadCallback;\n\n  // Error message for missing source or buffer\n  private static readonly missingErrorMessage: string =\n    \"Rive source file or data buffer required\";\n\n  // Error message for removed rive file\n  private static readonly cleanupErrorMessage: string =\n    \"Attempt to use file after calling cleanup.\";\n\n  /**\n   * Deprecation warnings to silence, by {@link DeprecationId}. Each warning\n   * prints the id needed to silence it, so you can copy it out of the console.\n   *\n   * ```ts\n   * Rive.suppressDeprecationWarnings = [\"rive-events\", \"text-runs\"];\n   * ```\n   *\n   * Assigning replaces the whole list.\n   * There is no option to silence everything\n   */\n  public static get suppressDeprecationWarnings(): readonly DeprecationId[] {\n    return Object.freeze(Array.from(suppressedDeprecations));\n  }\n\n  public static set suppressDeprecationWarnings(ids: readonly DeprecationId[]) {\n    setSuppressedDeprecations(ids);\n  }\n\n  private shouldDisableRiveListeners = false;\n\n  private automaticallyHandleEvents = false;\n\n  private dispatchPointerExit = true;\n\n  // Allow all pointers to be passed to the runtime\n  private enableMultiTouch = false;\n\n  // Allow the runtime to automatically load assets hosted in Rive's runtime.\n  private enableRiveAssetCDN = true;\n\n  private semanticsMode: SemanticMode = SemanticMode.Disabled;\n\n  private semanticsOptions: RiveSemanticsOptions = {\n    riveCanvasLabel: \"Rive animation\",\n  };\n\n  /** True when this instance may drain semantics and render the overlay. */\n  private _semanticsActive = false;\n\n  // Keep a local value of the set volume to update it asynchronously\n  private _volume = 1;\n\n  // Keep a local value of the set width to update it asynchronously\n  private _artboardWidth: number | undefined = undefined;\n\n  // Keep a local value of the set height to update it asynchronously\n  private _artboardHeight: number | undefined = undefined;\n\n  // Keep a local value of the device pixel ratio used in rendering and canvas/artboard resizing\n  private _devicePixelRatioUsed = 1;\n\n  // Whether the canvas element's size is 0\n  private _hasZeroSize = false;\n\n  // Whether a draw operation needs to be forced\n  private _needsRedraw = false;\n\n  // Canvas width and height. Values are lazily updated so they might\n  // not be in sync with current canvas size.\n  private _currentCanvasWidth = 0;\n  private _currentCanvasHeight = 0;\n\n  // Audio event listener\n  private _audioEventListener: EventListener | null = null;\n\n  // draw method bound to the class\n  private _boundDraw: (t: number) => void | null = null;\n\n  // Page visibility handler — prevents state machine advancing / rAF from being invoked with large time delta\n  // when the browser tab is switched back to after being hidden.\n  private _pageVisibilityHandler: (() => void) | null = null;\n  // True only when the page visibility handler itself cancelled an active frame.\n  // Set by stopRendering(), cleared by startRendering(). Prevents the\n  // visibilitychange handler from restarting a rendering loop the caller intentionally stopped.\n  private _explicitlyStoppedRendering = false;\n\n  private _viewModelInstance: ViewModelInstance | null = null;\n  // User-provided global view model instances, keyed by their global view\n  // model's name. Globals not present here are still driven by the default\n  // instances the runtime seeds; the getter only surfaces instances the user\n  // has explicitly set.\n  private _globalViewModelInstances: Map<string, ViewModelInstance> = new Map();\n  private _dataEnums: DataEnum[] | null = null;\n\n  private _tabIndex: number | null = null;\n  private _prevHasFocus = false;\n  private _focusOptions: RiveFocusOptions = {\n    allowFocusInterrupt: false,\n  };\n\n  // Tracks the semantic tree for the given graphic\n  private _semanticTree: SemanticTreeModel | null = null;\n  private _accessibilityOverlay: AccessibilityOverlay | null = null;\n  /**\n   * True when an input to the accessibility overlay's artboard→canvas transform\n   * (layout fit/alignment/bounds, devicePixelRatio, or layout scale) has changed\n   * and the matrix must be recomputed on the next overlay update. Avoids calling\n   * computeAlignment every frame when only the semantic tree changed.\n   */\n  private _overlayTransformDirty = true;\n  // Module-level counter for unique instance IDs for semantic overlay containers\n  private readonly _instanceId = `${nextRiveInstanceId++}`;\n\n  private drawOptimization: DrawOptimizationOptions =\n    DrawOptimizationOptions.DrawOnChanged;\n\n  // When true, emits performance.mark/measure entries for load and render.\n  private enablePerfMarks: boolean = false;\n\n  // Durations to generate a frame for the last second. Used for performance profiling.\n  public durations: number[] = [];\n  public frameTimes: number[] = [];\n  public frameCount = 0;\n  public isTouchScrollEnabled = false;\n\n  constructor(params: RiveParameters) {\n    this._boundDraw = this.draw.bind(this);\n    if (typeof document !== 'undefined') {\n      this._pageVisibilityHandler = this._onPageVisibilityChange.bind(this);\n      document.addEventListener('visibilitychange', this._pageVisibilityHandler);\n    }\n    this.canvas = params.canvas;\n    if (params.canvas.constructor === HTMLCanvasElement) {\n      this._observed = observers.add(\n        this.canvas as HTMLCanvasElement,\n        this.onCanvasResize,\n      );\n    }\n    this._currentCanvasWidth = this.canvas.width;\n    this._currentCanvasHeight = this.canvas.height;\n    this.src = params.src;\n    this.buffer = params.buffer;\n    this.riveFile = params.riveFile;\n    this.layout = params.layout ?? new Layout();\n    this.shouldDisableRiveListeners = !!params.shouldDisableRiveListeners;\n    this.isTouchScrollEnabled = !!params.isTouchScrollEnabled;\n    if (params.automaticallyHandleEvents) {\n      warnOnce(\n        DeprecationKeys.riveEvents,\n        \"The `automaticallyHandleEvents` parameter is deprecated. \" +\n          riveEventsDeprecationWarning,\n      );\n    }\n    this.automaticallyHandleEvents = !!params.automaticallyHandleEvents;\n    this.dispatchPointerExit =\n      params.dispatchPointerExit === false\n        ? params.dispatchPointerExit\n        : this.dispatchPointerExit;\n    this.enableMultiTouch = !!params.enableMultiTouch;\n    this.drawOptimization = params.drawingOptions ?? this.drawOptimization;\n    this.enableRiveAssetCDN =\n      params.enableRiveAssetCDN === undefined\n        ? true\n        : params.enableRiveAssetCDN;\n    this.enablePerfMarks = !!params.enablePerfMarks;\n    if (this.enablePerfMarks) RuntimeLoader.enablePerfMarks = true;\n    this._focusOptions = params.focusOptions ?? this._focusOptions;\n    this._tabIndex = params.tabIndex ?? null;\n    this.deferredRenderer = !!params.enableGPUCanvas;\n\n    // New event management system\n    this.eventManager = new EventManager();\n    if (params.onLoad) this.on(EventType.Load, params.onLoad);\n    if (params.onLoadError) this.on(EventType.LoadError, params.onLoadError);\n    if (params.onPlay) this.on(EventType.Play, params.onPlay);\n    if (params.onPause) this.on(EventType.Pause, params.onPause);\n    if (params.onStop) this.on(EventType.Stop, params.onStop);\n    if (params.onLoop) this.on(EventType.Loop, params.onLoop);\n    if (params.onStateChange)\n      this.on(EventType.StateChange, params.onStateChange);\n    if (params.onAdvance) this.on(EventType.Advance, params.onAdvance);\n\n    /**\n     * @deprecated Use camelCase'd versions instead.\n     */\n    if (params.onload && !params.onLoad) this.on(EventType.Load, params.onload);\n    if (params.onloaderror && !params.onLoadError)\n      this.on(EventType.LoadError, params.onloaderror);\n    if (params.onplay && !params.onPlay) this.on(EventType.Play, params.onplay);\n    if (params.onpause && !params.onPause)\n      this.on(EventType.Pause, params.onpause);\n    if (params.onstop && !params.onStop) this.on(EventType.Stop, params.onstop);\n    if (params.onloop && !params.onLoop) this.on(EventType.Loop, params.onloop);\n    if (params.onstatechange && !params.onStateChange)\n      this.on(EventType.StateChange, params.onstatechange);\n\n    /**\n     * Asset loading\n     */\n    if (params.assetLoader) this.assetLoader = params.assetLoader;\n\n    // Hook up the task queue\n    this.taskQueue = new TaskQueueManager(this.eventManager);\n\n    this.init({\n      src: this.src,\n      buffer: this.buffer,\n      riveFile: this.riveFile,\n      autoplay: params.autoplay,\n      autoBind: params.autoBind,\n      stateMachine: params.stateMachine,\n      animations: params.animations,\n      stateMachines: params.stateMachines,\n      artboard: params.artboard,\n      useOffscreenRenderer: params.useOffscreenRenderer,\n      tabIndex: params.tabIndex,\n      semanticsMode: params.semanticsMode,\n      semanticsOptions: params.semanticsOptions,\n      enableGPUCanvas: this.deferredRenderer,\n    });\n  }\n\n  public get viewModelCount(): number {\n    return this.file.viewModelCount();\n  }\n\n  // Alternative constructor to build a Rive instance from an interface/object\n  public static new(params: RiveParameters): Rive {\n    warnOnce(\n      DeprecationKeys.legacyConstructors,\n      \"This function is deprecated: please use `new Rive({})` instead\",\n    );\n    return new Rive(params);\n  }\n\n  /**\n   * @experimental Turns on semantics and the accessibility overlay for this\n   * instance. Idempotent; safe to call before or after load. Use this to drive\n   * a consumer-controlled accessibility toggle when constructed with the\n   * default {@link SemanticMode.Disabled}.\n   */\n  public enableSemantics(): void {\n    this.semanticsMode = SemanticMode.Enabled;\n    this.activateSemantics();\n  }\n\n  private activateSemantics(): void {\n    if (this._semanticsActive || this.semanticsMode === SemanticMode.Disabled) {\n      return;\n    }\n    this._semanticsActive = true;\n    this.syncSemanticsOnStateMachines();\n  }\n\n  private syncSemanticsOnStateMachines(): void {\n    if (!this._semanticsActive || !this.animator) {\n      return;\n    }\n    for (const stateMachine of this.animator.stateMachines) {\n      stateMachine.enableSemantics();\n    }\n  }\n\n  /**\n   * Tears down the semantic tree and accessibility overlay. The overlay captures the\n   * active state machine in its action closures, so it must not outlive the\n   * instances it points at (reset/load delete them)\n   */\n  private cleanupSemantics(): void {\n    this._semanticTree = null;\n    if (this._accessibilityOverlay) {\n      this._accessibilityOverlay.destroy();\n      this._accessibilityOverlay = null;\n    }\n  }\n\n  // Event handler for when audio context becomes available\n  private onSystemAudioChanged() {\n    this.volume = this._volume;\n  }\n\n  private onCanvasResize = (hasZeroSize: boolean) => {\n    const toggledDisplay = this._hasZeroSize !== hasZeroSize;\n    this._hasZeroSize = hasZeroSize;\n    if (!hasZeroSize) {\n      if (toggledDisplay) {\n        this.resizeDrawingSurfaceToCanvas();\n      }\n    } else if (!this._layout.maxX || !this._layout.maxY) {\n      this.resizeToCanvas();\n    }\n  };\n\n  // Initializes the Rive object either from constructor or load()\n  private init({\n    src,\n    buffer,\n    riveFile,\n    stateMachine,\n    animations,\n    stateMachines,\n    artboard,\n    autoplay = false,\n    useOffscreenRenderer = false,\n    autoBind = false,\n    tabIndex,\n    semanticsMode,\n    semanticsOptions,\n    enableGPUCanvas,\n  }: RiveLoadParameters): void {\n    if (this.destroyed) {\n      return;\n    }\n    // Validated before any state changes, so a call with no source leaves a\n    // running instance untouched.\n    if (!src && !buffer && !riveFile) {\n      throw new RiveError(Rive.missingErrorMessage);\n    }\n    // Reload releases the outgoing file in the same order cleanup() uses:\n    // artboard, then the renderer's session, then the file. The artboard goes\n    // first because it holds an rcp<File> and its resources came from the\n    // session about to be released. stop() has already deleted the animation\n    // and state machine instances; reload deliberately skips cleanupInstances(),\n    // which would also drop the event listeners load() keeps in place.\n    if (this.artboard) {\n      // Free GPU-backed resources with their own context current. No-op on\n      // the canvas2d build.\n      this.renderer?.bindContext?.();\n      this.animator?.stop();\n      this.artboard.delete();\n      this.artboard = null;\n    }\n    // Detach before the session is deleted: the handle dies with it.\n    if (this.renderer) {\n      this.renderer.detachSession?.();\n    }\n    this.releaseCurrentRiveFile(/* isTeardown */ false);\n    this.src = src;\n    this.buffer = buffer;\n    this.riveFile = riveFile;\n    // initData flips this if it ends up importing the file itself.\n    this.ownsRiveFile = false;\n    // Sticky across reloads so a constructor-set flag survives; an explicit\n    // `false` still turns it off.\n    this.deferredRenderer = enableGPUCanvas ?? this.deferredRenderer;\n    this._tabIndex = tabIndex ?? null;\n    this.semanticsMode = semanticsMode ?? SemanticMode.Disabled;\n    this.semanticsOptions = semanticsOptions ?? this.semanticsOptions;\n\n    // Names of the animations and state machines that should be initialized\n    const { startingAnimationNames, startingStateMachineNames } =\n      resolveStartingPlayback({\n        stateMachine,\n        animations,\n        stateMachines,\n      });\n\n    // Ensure loaded is marked as false if loading new file\n    this.loaded = false;\n    this.readyForPlaying = false;\n\n    // Ensure the runtime is loaded\n    RuntimeLoader.awaitInstance()\n      .then((runtime) => {\n        if (this.destroyed) {\n          return;\n        }\n        this.runtime = runtime;\n\n        this.removeRiveListeners();\n        // load() reinitializes without cleanupInstances(); drop any stale overlay\n        // bound to the previous file's state machines (no-op on first construct).\n        this.cleanupSemantics();\n        this.deleteRiveRenderer();\n\n        // Get the canvas where you want to render the animation and create a renderer\n        if (this.enablePerfMarks) performance.mark('rive:make-renderer:start');\n        try {\n          // Always immediate at creation; a deferred file attaches its session\n          // to this renderer once the file has loaded.\n          this.renderer = this.runtime.makeRenderer(\n            this.canvas,\n            useOffscreenRenderer,\n          );\n          if (!this.renderer) {\n            throw new Error(\"Renderer is null, cannot render Rive on the canvas.\");\n          }\n        } catch (e) {\n          console.error(e);\n          throw new RiveError(\"Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.\");\n        }\n        if (this.enablePerfMarks) {\n          performance.mark('rive:make-renderer:end');\n          performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');\n        }\n\n        // Initial size adjustment based on devicePixelRatio if no width/height are\n        // specified explicitly\n        if (!(this.canvas.width || this.canvas.height)) {\n          this.resizeDrawingSurfaceToCanvas();\n        }\n\n        // Load Rive data from a source uri or a data buffer\n        this.initData(\n          artboard,\n          startingAnimationNames,\n          startingStateMachineNames,\n          autoplay,\n          autoBind,\n        )\n          .then((hasInitialized: boolean) => {\n            if (hasInitialized) {\n              return this.setupRiveListeners();\n            }\n          })\n          .catch((e) => {\n            // initData already catches RiveErrors for load issues like artboard/state machine initialization\n            // failures, so just console error and catch here so we don't double-fire the LoadError event\n            console.error(e);\n          });\n      })\n      .catch((e: Error) => { // Catching errors from loading WASM\n        this.eventManager.fire({ type: EventType.LoadError, data: e.message });\n      });\n  }\n\n  /**\n   * Setup Rive Listeners on the canvas\n   * @param riveListenerOptions - Enables TouchEvent events on the canvas. Set to true to allow\n   * touch scrolling on the canvas element on touch-enabled devices\n   * i.e. { isTouchScrollEnabled: true }\n   */\n  public setupRiveListeners(\n    riveListenerOptions?: SetupRiveListenersOptions,\n  ): void {\n    if (this.eventCleanup) {\n      this.eventCleanup();\n    }\n    this.cleanupKeyboardInteractions();\n    if (!this.shouldDisableRiveListeners) {\n      const playingStateMachines = this.animator.stateMachines.filter((sm) => sm.playing);\n      const activeStateMachines = playingStateMachines\n        .filter((sm) => this.runtime.hasListeners(sm.instance))\n        .map((sm) => sm.instance);\n      let touchScrollEnabledOption = this.isTouchScrollEnabled;\n      let dispatchPointerExit = this.dispatchPointerExit;\n      let enableMultiTouch = this.enableMultiTouch;\n      if (\n        riveListenerOptions &&\n        \"isTouchScrollEnabled\" in riveListenerOptions\n      ) {\n        touchScrollEnabledOption = riveListenerOptions.isTouchScrollEnabled;\n      }\n      this.eventCleanup = registerTouchInteractions({\n        canvas: this.canvas,\n        artboard: this.artboard,\n        stateMachines: activeStateMachines,\n        renderer: this.renderer,\n        rive: this.runtime,\n        fit: this._layout.runtimeFit(this.runtime),\n        alignment: this._layout.runtimeAlignment(this.runtime),\n        isTouchScrollEnabled: touchScrollEnabledOption,\n        dispatchPointerExit: dispatchPointerExit,\n        enableMultiTouch: enableMultiTouch,\n        layoutScaleFactor: this._layout.layoutScaleFactor,\n        advanceAndDrain: this.advanceAndReportChanges.bind(this)\n      });\n\n      this.ensureKeyboardInteractions();\n    }\n  }\n\n  /**\n   * Wire keyboard interactions when a playing state machine has focus nodes.\n   * Called at listener setup and lazily each frame so late-bound bindable artboards work.\n   */\n  private ensureKeyboardInteractions(): void {\n    if (\n      this._keyboardInteractions ||\n      this.shouldDisableRiveListeners ||\n      typeof window === \"undefined\" ||\n      !(this.canvas instanceof HTMLCanvasElement)\n    ) {\n      return;\n    }\n\n    const smWithFocusNodes = this.animator.stateMachines.find(\n      (sm) => sm.playing && sm.hasFocusNodes,\n    );\n    if (!smWithFocusNodes) {\n      return;\n    }\n\n    const currentCanvasTabIndex = this.canvas.tabIndex;\n    if (currentCanvasTabIndex === -1 || isNaN(currentCanvasTabIndex)) {\n      this.canvas.tabIndex = (this._tabIndex !== null ? this._tabIndex : 0);\n    }\n\n    this._keyboardInteractions = new KeyboardInteractions({\n      canvas: this.canvas as HTMLCanvasElement,\n      stateMachine: smWithFocusNodes.instance, // work off assumption of single state machine\n      hasFocusNodes: true,\n      getOverlayElement: () =>\n        this._accessibilityOverlay?.getSemanticOverlayContainer() ?? null,\n    });\n  }\n\n  private cleanupKeyboardInteractions(): void {\n    if (this._keyboardInteractions) {\n      this._keyboardInteractions.cleanup();\n      this._keyboardInteractions = null;\n    }\n  }\n\n  /**\n   * Remove Rive Listeners setup on the canvas\n   */\n  public removeRiveListeners(): void {\n    if (this.eventCleanup) {\n      this.eventCleanup();\n      this.eventCleanup = null;\n    }\n    this.cleanupKeyboardInteractions();\n  }\n\n  /**\n   * If the instance has audio and the system audio is not ready\n   * we hook the instance to the audio manager\n   */\n  private initializeAudio() {\n    // Initialize audio if needed\n    if (audioManager.status == SystemAudioStatus.UNAVAILABLE) {\n      if (\n        this.file.hasAudio ||\n        (this.artboard?.hasAudio && this._audioEventListener === null)\n      ) {\n        this._audioEventListener = {\n          type: EventType.AudioStatusChange,\n          callback: () => this.onSystemAudioChanged(),\n        };\n        audioManager.add(this._audioEventListener);\n        audioManager.establishAudio();\n      }\n    }\n  }\n\n  private initArtboardSize() {\n    if (!this.artboard) return;\n\n    // Use preset values if they are not undefined\n    this._artboardWidth = this.artboard.width =\n      this._artboardWidth || this.artboard.width;\n    this._artboardHeight = this.artboard.height =\n      this._artboardHeight || this.artboard.height;\n  }\n\n  // Initializes runtime with Rive data and preps for playing.\n  // Returns true for successful initialization.\n  private async initData(\n    artboardName: string,\n    animationNames: string[],\n    stateMachineNames: string[],\n    autoplay: boolean,\n    autoBind: boolean,\n  ): Promise<boolean> {\n    try {\n      // A caller-supplied riveFile is theirs to release; one we import here is\n      // ours, which matters if a deferred fallback replaces it below.\n      this.ownsRiveFile = this.riveFile == null;\n      if (this.ownsRiveFile) {\n        const riveFile = new RiveFile({\n          src: this.src,\n          buffer: this.buffer,\n          enableRiveAssetCDN: this.enableRiveAssetCDN,\n          assetLoader: this.assetLoader,\n          enablePerfMarks: this.enablePerfMarks,\n          // The instance owns this file, so its flag is the file's flag.\n          enableGPUCanvas: this.deferredRenderer,\n        });\n        this.riveFile = riveFile;\n        await riveFile.init();\n        if (this.destroyed) {\n          // In the very unlikely scenario where the rive file created by this Rive is shared by\n          // another rive file, we only want to destroy it if this file is the only owner.\n          riveFile.destroyIfUnused();\n          return false;\n        }\n      }\n      // May replace this.riveFile with a re-import, so it runs before the\n      // instance takes its reference. Skipped unless something deferred is in\n      // play, so the default path stays synchronous through to the load event.\n      if (this.riveFile.deferredSession !== null || this.deferredRenderer) {\n        await this.resolveDeferredRendering();\n        if (this.destroyed) {\n          // cleanup() ran during a re-import. Taking a reference now would\n          // resurrect a file this instance is never going to draw. Only ours\n          // to release — a caller-supplied file stays theirs.\n          if (this.ownsRiveFile) {\n            this.riveFile?.destroyIfUnused();\n          }\n          return false;\n        }\n      }\n      this.file = this.riveFile.getInstance();\n      // Initialize and draw frame\n      this.initArtboard(\n        artboardName,\n        animationNames,\n        stateMachineNames,\n        autoplay,\n        autoBind,\n      );\n\n      // Initialize the artboard size\n      this.initArtboardSize();\n\n      // Check for audio\n      this.initializeAudio();\n\n      if (this.semanticsMode === SemanticMode.Enabled) {\n        this.activateSemantics();\n      } else if (this._semanticsActive) {\n        this.syncSemanticsOnStateMachines();\n      }\n\n      // Everything's set up, emit a load event\n      try {\n        this.loaded = true;\n        this.eventManager.fire({\n          type: EventType.Load,\n          data: this.src ?? \"buffer\",\n        });\n      } catch (e) {\n        // If any synchronous errors surface from the user-supplied onLoad callback,\n        // this will console.error the error but will not invoke LoadError (onLoadError).\n        // Notably, this will not interfere with Rive rendering\n        console.error(e);\n      }\n\n      // Only initialize paused state machines after the load event has been fired\n      // to allow users to initialize inputs and view models before the first advance\n      this.animator.advanceIfPaused();\n\n      // Flag ready for playback commands and clear the task queue; this order\n      // is important or it may infinitely recurse\n      this.readyForPlaying = true;\n      this.taskQueue.process();\n\n      this.drawFrame();\n\n      return true;\n    } catch (error) {\n      // Invoke LoadError for errors with loading the configured Artboard + State Machine\n      const msg = resolveErrorMessage(error);\n      this.eventManager.fire({ type: EventType.LoadError, data: msg });\n      return Promise.reject(msg);\n    }\n  }\n\n  /**\n   * Settles which rendering mode this Rive instance runs in. The file dictates: its rendering mode\n   * is fixed at import, and an immediate renderer silently drops a deferred\n   * file's resources. Every mismatch warns and degrades to something that\n   * renders, so users shouldn't have a blank canvas. A fallback self-reimport replaces `this.riveFile`;\n   * only a file this instance imported is released when that happens.\n   */\n  private async resolveDeferredRendering(): Promise<void> {\n    const file = this.riveFile;\n    const ownsFile = this.ownsRiveFile;\n    const renderer = this.renderer;\n    const session = file.deferredSession;\n    if (session === null) {\n      // No second warning when the file asked for deferred and the build\n      // could not honor it; the unsupported-build warning already fired, and\n      // telling the user to set a flag they set would mislead.\n      if (this.deferredRenderer && !file.deferredRequested) {\n        console.warn(\n          \"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.\",\n        );\n      }\n      return;\n    }\n    if (!this.deferredRenderer) {\n      console.warn(\n        \"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.\",\n      );\n    }\n    const attachSession = renderer?.attachSession;\n    if (typeof attachSession !== \"function\") {\n      // Offscreen renderers share one context across canvases, which a session\n      // cannot record for. An immediate copy of the file still renders.\n      console.warn(\n        \"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.\",\n      );\n      const immediate = await file.reimport(false);\n      if (this.destroyed) {\n        // cleanup() ran while we were importing; nothing will use this copy.\n        immediate.destroyIfUnused();\n        return;\n      }\n      this.riveFile = immediate;\n      this.ownsRiveFile = true;\n      if (ownsFile) {\n        // Nothing else can reach the deferred import we just walked away from.\n        file.destroyIfUnused();\n      }\n      return;\n    }\n    // Never re-offered once claimed, even if that renderer is gone: the\n    // resources the session's stream refers to died with it.\n    if (!file.sessionClaimed && attachSession.call(renderer, session)) {\n      file.claimSession();\n      return;\n    }\n    // Bound to another instance. Re-import from the retained buffer into a\n    // session of our own.\n    file.warnBoundElsewhereOnce();\n    const copy = await file.reimport(true);\n    if (this.destroyed) {\n      // The renderer was deleted while we imported; attaching to it would hand\n      // embind a deleted object.\n      copy.destroyIfUnused();\n      return;\n    }\n    this.riveFile = copy;\n    this.ownsRiveFile = true;\n    const copySession = copy.deferredSession;\n    if (copySession !== null && attachSession.call(renderer, copySession)) {\n      copy.claimSession();\n      return;\n    }\n    // The copy's session could not take this canvas either (this renderer\n    // already holds one). An immediate re-import still renders; a deferred file\n    // on an immediate renderer would drop its resources and draw nothing.\n    console.warn(\n      \"Rive: could not attach the re-imported file's deferred session to this canvas; falling back to immediate rendering for this instance.\",\n    );\n    // If a leftover session is why the attach failed, it would keep routing\n    // the immediate file's draws into its recorder, which drops them.\n    renderer.detachSession?.();\n    const fallback = await file.reimport(false);\n    // The deferred copy was only ever ours, so it always goes.\n    copy.destroyIfUnused();\n    if (this.destroyed) {\n      fallback.destroyIfUnused();\n      return;\n    }\n    this.riveFile = fallback;\n    this.ownsRiveFile = true;\n    if (ownsFile) {\n      file.destroyIfUnused();\n    }\n  }\n\n  // Initialize for playback\n  private initArtboard(\n    artboardName: string,\n    animationNames: string[],\n    stateMachineNames: string[],\n    autoplay: boolean,\n    autoBind: boolean,\n  ): void {\n    if (!this.file) {\n      return;\n    }\n    // Fetch the artboard\n    const rootArtboard = artboardName\n      ? this.file.artboardByName(artboardName)\n      : this.file.defaultArtboard();\n\n    // Check we have a working artboard\n    if (!rootArtboard) {\n      throw new RiveError(\"Invalid artboard name or no default artboard\");\n    }\n\n    this.artboard = rootArtboard;\n    rootArtboard.volume = this._volume * audioManager.systemVolume;\n\n    // Initialize the animator\n    this.animator = new Animator(\n      this.runtime,\n      this.artboard,\n      this.eventManager,\n    );\n\n    // Initialize the animations; as loaded hasn't happened yet, we need to\n    // suppress firing the play/pause events until the load event has fired. To\n    // do this we tell the animator to suppress firing events, and add event\n    // firing to the task queue.\n    let instanceNames: string[];\n    if (animationNames.length > 0 || stateMachineNames.length > 0) {\n      instanceNames = animationNames.concat(stateMachineNames);\n      this.animator.initLinearAnimations(animationNames, autoplay);\n      this.animator.initStateMachines(stateMachineNames, autoplay, this._semanticsActive);\n    } else {\n      instanceNames = [this.animator.atLeastOne(autoplay, false, this._semanticsActive)];\n    }\n    // Queue up firing the playback events\n    this.taskQueue.add({\n      event: {\n        type: autoplay ? EventType.Play : EventType.Pause,\n        data: instanceNames,\n      },\n    });\n\n    if (autoBind) {\n      // Set the main view model instance (if the artboard has one)...\n      const viewModel = this.file.defaultArtboardViewModel(rootArtboard);\n      if (viewModel !== null) {\n        const runtimeInstance = viewModel.defaultInstance();\n        if (runtimeInstance !== null) {\n          const viewModelInstance = new ViewModelInstance(\n            runtimeInstance,\n            null,\n          );\n          createFinalization(\n            viewModelInstance,\n            viewModelInstance.runtimeInstance,\n          );\n          this.setViewModelInstance(viewModelInstance);\n        }\n      }\n      // ...and a default instance for each global view model (no longer\n      // auto-created by the runtime), then apply everything in one rebind.\n      for (const name of this.file.globalViewModelNames()) {\n        const globalViewModel = this.file.viewModelByName(name);\n        if (globalViewModel !== null) {\n          const instance = new ViewModel(globalViewModel).defaultInstance();\n          if (instance !== null) {\n            this.setGlobalViewModelInstance(name, instance);\n          }\n        }\n      }\n      this.bind();\n    }\n  }\n\n  // Draws the current artboard frame\n  public drawFrame() {\n    if (document?.timeline?.currentTime) {\n      if (this.loaded && this.artboard && !this.frameRequestId) {\n        this._boundDraw(document!.timeline!.currentTime as number);\n        this.runtime?.resolveAnimationFrame();\n      }\n    } else {\n      this.scheduleRendering();\n    }\n  }\n\n  private _canvasSizeChanged(): boolean {\n    let changed = false;\n    if (this.canvas) {\n      if (this.canvas.width !== this._currentCanvasWidth) {\n        this._currentCanvasWidth = this.canvas.width;\n        changed = true;\n      }\n      if (this.canvas.height !== this._currentCanvasHeight) {\n        this._currentCanvasHeight = this.canvas.height;\n        changed = true;\n      }\n    }\n    return changed;\n  }\n\n  // Content the artboard's change flag cannot see: ore and GPU canvas commands\n  // scripts record straight into the session. Must be read before the renderer\n  // clears — clearing marks the stream, so a later read is true every frame.\n  private _deferredWorkPending(): boolean {\n    return this.riveFile?.deferredSession?.recordedThisFrame() ?? false;\n  }\n\n  /**\n   * Poll focus state each frame to see if we should focus/blur the canvas in case\n   * Rive internally updated focus outside of user interaction (e.g., via listener action)\n   */\n  private pollFocusState() {\n    this.ensureKeyboardInteractions();\n    if (!this._keyboardInteractions) {\n      this._prevHasFocus = false;\n      return;\n    }\n\n    const activeSm = this.animator.stateMachines.find(\n      (sm) => sm.playing && sm.hasFocusNodes,\n    ); // work off assumption of single state machine\n    if (!activeSm) {\n      this._prevHasFocus = false;\n      return;\n    }\n\n    if (this.canvas instanceof HTMLCanvasElement) {\n      const { hasFocus } = activeSm.focusState();\n      if (hasFocus) {\n        // Rive has an active focus node. Mark the session RiveFocused so Tab stays\n        // trapped and a later internal release (hasFocus true → false) is detected.\n        this._keyboardInteractions.notifyRiveFocused();\n        // Only steal DOM focus on the false→true transition. Rive can hold focus across\n        // frames while DOM focus sits elsewhere — a window switch preserves runtime focus\n        // by design — and that must not re-focus the canvas again.\n        if (!this._prevHasFocus) {\n          // Steal DOM focus to the canvas only when focus isn't already held\n          // somewhere inside this instance's focus scope. When the accessibility\n          // overlay has driven focus onto a specific semantic node element (e.g.\n          // an appearing alert dialog), focus is already in-scope. The steal\n          // stays a fallback for runtime focus nodes that have no overlay element\n          // to hold DOM focus.\n          const scope = this._accessibilityOverlay?.getSemanticOverlayContainer();\n          const focusAlreadyInScope =\n            document.activeElement === this.canvas ||\n            (scope?.contains(document.activeElement) ?? false);\n          if (!focusAlreadyInScope && this._focusOptions.allowFocusInterrupt) {\n            this.canvas.focus();\n          }\n          this._prevHasFocus = true;\n        }\n        return;\n      }\n\n      this._prevHasFocus = false;\n\n      // hasFocus is false — only act when Rive previously held focus and released it internally\n      // (state change clears focus). Release the DOM Tab trap so the next Tab moves to the next\n      // page element. A DOM blur reaches here too now that onCanvasBlur clears Rive focus, but it\n      // has already set NotFocused, so this is a no-op. EntryPending and NotFocused are likewise\n      // intentional no-ops — EntryPending must stay put (a click awaiting its first Tab).\n      if (this._keyboardInteractions.focusSessionState === FocusSessionState.RiveFocused) {\n        this._keyboardInteractions.setFocusSessionState(FocusSessionState.NotFocused);\n      }\n    }\n  }\n\n  // Tracks the last timestamp at which the animation was rendered. Used only in\n  // draw().\n  private lastRenderTime: number;\n\n  // Tracks the current animation frame request\n  private frameRequestId: number | null = null;\n\n  /**\n   * Used be draw to track when a second of active rendering time has passed.\n   * Used for debugging purposes\n   */\n  private renderSecondTimer = 0;\n\n  /**\n   * Handles important sequence of reporting Rive events, advancing the state machine or animation, and invoking various callbacks\n   * due to state changes, view model property changes, etc.\n   * \n   * @param elapsedTime time to advance the state machine by\n   */\n  private advanceAndReportChanges(elapsedTime: number): void {\n    // - Advance non-paused animations by the elapsed number of seconds\n    // - Advance any animations that require scrubbing\n    // - Advance to the first frame even when autoplay is false\n    const activeAnimations = this.animator.animations\n      .filter((a) => a.playing || a.needsScrub)\n      // The scrubbed animations must be applied first to prevent weird artifacts\n      // if the playing animations conflict with the scrubbed animating attribuates.\n      .sort((first) => (first.needsScrub ? -1 : 1));\n    for (const animation of activeAnimations) {\n      animation.advance(elapsedTime);\n      if (animation.instance.didLoop) {\n        animation.loopCount += 1;\n      }\n      animation.apply(1.0);\n    }\n\n    // - Advance non-paused state machines by the elapsed number of seconds\n    // - Advance to the first frame even when autoplay is false\n    const activeStateMachines = this.animator.stateMachines.filter(\n      (a) => a.playing,\n    );\n    // Instrument the first 3 frames so the Performance timeline shows precise\n    // per-call latency for advance, draw, and flush without polluting the trace.\n    const _perfFrame =\n      this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;\n    for (const stateMachine of activeStateMachines) {\n      // Check for events before the current frame's state machine advance\n      const numEventsReported = stateMachine.reportedEventCount();\n      if (numEventsReported) {\n        for (let i = 0; i < numEventsReported; i++) {\n          const event = stateMachine.reportedEventAt(i);\n\n          if (event) {\n            if (event.type === RiveEventType.OpenUrl) {\n              this.eventManager.fire({\n                type: EventType.RiveEvent,\n                data: event as rc.OpenUrlEvent,\n              });\n              // Handle the event side effect if explicitly enabled\n              if (this.automaticallyHandleEvents) {\n                const newAnchorTag = document.createElement(\"a\");\n                const { url, target } = event as rc.OpenUrlEvent;\n\n                const sanitizedUrl = sanitizeUrl(url);\n                url && newAnchorTag.setAttribute(\"href\", sanitizedUrl);\n                target && newAnchorTag.setAttribute(\"target\", target);\n                if (sanitizedUrl && sanitizedUrl !== BLANK_URL) {\n                  newAnchorTag.click();\n                }\n              }\n            } else {\n              this.eventManager.fire({\n                type: EventType.RiveEvent,\n                data: event as rc.RiveEvent,\n              });\n            }\n          }\n        }\n      }\n      if (_perfFrame >= 0) performance.mark(`rive:sm-advance:start:f${_perfFrame}`);\n      stateMachine.advanceAndApply(elapsedTime);\n      if (_perfFrame >= 0) {\n        performance.mark(`rive:sm-advance:end:f${_perfFrame}`);\n        performance.measure(`rive:sm-advance:f${_perfFrame}`, `rive:sm-advance:start:f${_perfFrame}`, `rive:sm-advance:end:f${_perfFrame}`);\n      }\n\n      if (this._semanticsActive) {\n        const diff = stateMachine.drainSemanticsDiff();\n        if (diff) {\n          if (!this._semanticTree) {\n            this._semanticTree = new SemanticTreeModel();\n          }\n          this._semanticTree.applyDiff(diff);\n        }\n      }\n    }\n\n    // Update the accessibility overlay after all state machines have\n    // been advanced and their diffs applied to the tree model.\n    if (\n      this._semanticsActive &&\n      this._semanticTree &&\n      activeStateMachines.length > 0 &&\n      this.canvas instanceof HTMLCanvasElement\n    ) {\n      if (!this._accessibilityOverlay) {\n        const mainSm = activeStateMachines[0];\n        this._accessibilityOverlay = new AccessibilityOverlay({\n          canvas: this.canvas,\n          instanceId: this._instanceId,\n          semanticsOptions: this.semanticsOptions,\n          allowFocusInterrupt: this._focusOptions.allowFocusInterrupt,\n          fireAction: (nodeId, actionType) => {\n            mainSm.fireSemanticAction(nodeId, actionType);\n          },\n          requestFocus: (nodeId) =>\n            mainSm.focusSemanticNode(nodeId),\n          clearFocus: () =>\n            mainSm.instance.clearFocus(),\n        });\n      }\n      const overlayChange = this._accessibilityOverlay?.needsUpdate(this._semanticTree);\n      if (overlayChange || this._overlayTransformDirty) {\n        // Only recompute the artboard→canvas transform when something that\n        // affects it changed (canvas geometry or a layout/dpr input). When only\n        // the semantic tree changed we pass null and reuse the existing CSS\n        // transform on the overlay container.\n        let forwardMat: rc.Mat2D | null = null;\n        if (overlayChange?.layoutChanged || this._overlayTransformDirty) {\n          const fit = this._layout.runtimeFit(this.runtime);\n          const alignment = this._layout.runtimeAlignment(this.runtime);\n          forwardMat = this.runtime.computeAlignment(\n            fit,\n            alignment,\n            {\n              minX: this._layout.minX,\n              minY: this._layout.minY,\n              maxX: this._layout.maxX,\n              maxY: this._layout.maxY,\n            },\n            this.artboard.bounds,\n            this._devicePixelRatioUsed * this._layout.layoutScaleFactor,\n          );\n          this._overlayTransformDirty = false;\n        }\n        this._accessibilityOverlay!.update(\n          this._semanticTree,\n          forwardMat,\n          this._devicePixelRatioUsed,\n          this.artboard.bounds,\n          overlayChange,\n        );\n        forwardMat?.delete();\n      }\n    }\n\n    // For linear animations that have been applied to the artboard, advance it\n    // by the elapsed time.\n    if (this.animator.stateMachines.length == 0) {\n      this.artboard.advance(elapsedTime);\n    }\n\n    // Check for any animations that looped\n    this.animator.handleLooping();\n\n    // Check for any state machines that had a state change\n    this.animator.handleStateChanges();\n\n    // Report advanced time\n    this.animator.handleAdvancing(elapsedTime);\n\n    // Poll focus state to see whether or not to blur or pull up a virtual keyboard for any change to a text input node.\n    this.pollFocusState();\n\n    // Handle callbacks for main view model property changes\n    this._viewModelInstance?.handleCallbacks();\n\n    // Handle callbacks for global view model property changes\n    this._globalViewModelInstances.forEach((instance) => {\n      if (instance) {\n        instance.handleCallbacks();\n      }\n    });\n  }\n\n  /**\n   * Draw rendering loop; renders animation frames at the correct time interval.\n   * @param time the time at which to render a frame\n   */\n  private draw(time: number, onSecond?: VoidCallback): void {\n    // Clear the frameRequestId, as we're now rendering a fresh frame\n    this.frameRequestId = null;\n    // load() tears the artboard down and re-inits asynchronously; a frame\n    // queued before that lands here with nothing to draw.\n    if (!this.artboard) {\n      return;\n    }\n    const before = performance.now();\n\n    // Instrument the first 3 frames so the Performance timeline shows precise\n    // per-call latency for advance, draw, and flush without polluting the trace.\n    const _perfFrame =\n      this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;\n\n    // On the first pass, make sure lastTime has a valid value\n    if (!this.lastRenderTime) {\n      this.lastRenderTime = time;\n    }\n\n    // Handle the onSecond callback\n    this.renderSecondTimer += time - this.lastRenderTime;\n    if (this.renderSecondTimer > 5000) {\n      this.renderSecondTimer = 0;\n      onSecond?.();\n    }\n\n    // Calculate the elapsed time between frames in seconds\n    const elapsedTime = (time - this.lastRenderTime) / 1000;\n    this.lastRenderTime = time;\n\n    this.advanceAndReportChanges(elapsedTime);\n\n    const { renderer } = this;\n    // Do not draw on 0 canvas size\n    if (!this._hasZeroSize) {\n      // If there was no dirt on this frame, do not clear and draw. The deferred\n      // term has to be read here, before `clear()` below: clearing opens the\n      // session's recording window and marks its stream, so a read taken after\n      // it reports every frame as dirty and nothing is ever skipped.\n      if (\n        this.drawOptimization == DrawOptimizationOptions.AlwaysDraw ||\n        this.artboard.didChange() ||\n        this._deferredWorkPending() ||\n        this._needsRedraw ||\n        this._canvasSizeChanged()\n      ) {\n        // Canvas must be wiped to prevent artifacts\n        renderer.clear();\n        renderer.save();\n\n        // Update the renderer alignment if necessary\n        if (_perfFrame >= 0) performance.mark(`rive:align-renderer:start:f${_perfFrame}`);\n        this.alignRenderer();\n        if (_perfFrame >= 0) {\n          performance.mark(`rive:align-renderer:end:f${_perfFrame}`);\n          performance.measure(`rive:align-renderer:f${_perfFrame}`, `rive:align-renderer:start:f${_perfFrame}`, `rive:align-renderer:end:f${_perfFrame}`);\n        }\n\n        if (_perfFrame >= 0) performance.mark(`rive:artboard-draw:start:f${_perfFrame}`);\n        this.artboard.draw(renderer);\n        if (_perfFrame >= 0) {\n          performance.mark(`rive:artboard-draw:end:f${_perfFrame}`);\n          performance.measure(`rive:artboard-draw:f${_perfFrame}`, `rive:artboard-draw:start:f${_perfFrame}`, `rive:artboard-draw:end:f${_perfFrame}`);\n        }\n\n        renderer.restore();\n\n        if (_perfFrame >= 0) performance.mark(`rive:renderer-flush:start:f${_perfFrame}`);\n        renderer.flush();\n        if (_perfFrame >= 0) {\n          performance.mark(`rive:renderer-flush:end:f${_perfFrame}`);\n          performance.measure(`rive:renderer-flush:f${_perfFrame}`, `rive:renderer-flush:start:f${_perfFrame}`, `rive:renderer-flush:end:f${_perfFrame}`);\n        }\n\n        this._needsRedraw = false;\n      }\n    }\n\n    // Add duration to create frame to durations array\n    this.frameCount++;\n    const after = performance.now();\n    this.frameTimes.push(after);\n    this.durations.push(after - before);\n    while (this.frameTimes[0] <= after - 1000) {\n      this.frameTimes.shift();\n      this.durations.shift();\n    }\n\n    // Calling requestAnimationFrame will rerun draw() at the correct rate:\n    // https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations\n    if (this.animator.isPlaying) {\n      // Request a new rendering frame\n      this.scheduleRendering();\n    } else if (this.animator.isPaused) {\n      // Reset the end time so on playback it starts at the correct frame\n      this.lastRenderTime = 0;\n    } else if (this.animator.isStopped) {\n      // Reset animation instances, artboard and time\n      // TODO: implement this properly when we have instancing\n      // this.initArtboard();\n      // this.drawFrame();\n      this.lastRenderTime = 0;\n    }\n  }\n\n  /**\n   * Align the renderer\n   */\n  private alignRenderer(): void {\n    const { renderer, runtime, _layout, artboard } = this;\n    // Align things up safe in the knowledge we can restore if changed\n    renderer.align(\n      _layout.runtimeFit(runtime),\n      _layout.runtimeAlignment(runtime),\n      {\n        minX: _layout.minX,\n        minY: _layout.minY,\n        maxX: _layout.maxX,\n        maxY: _layout.maxY,\n      },\n      artboard.bounds,\n      this._devicePixelRatioUsed * _layout.layoutScaleFactor,\n    );\n  }\n\n  public get fps() {\n    return this.durations.length;\n  }\n\n  public get frameTime() {\n    if (this.durations.length === 0) {\n      return 0;\n    }\n    return (\n      this.durations.reduce((a, b) => a + b, 0) / this.durations.length\n    ).toFixed(4);\n  }\n\n  /**\n   * Cleans up all Wasm-generated objects that need to be manually destroyed:\n   * artboard instances, animation instances, state machine instances,\n   * renderer instance, file and runtime.\n   *\n   * Once this is called, you will need to initialise a new instance of the\n   * Rive class\n   */\n  public cleanup() {\n    this.destroyed = true;\n    // Stop the renderer if it hasn't already been stopped.\n    this.stopRendering();\n    // Make the GL context backing this renderer current before any WASM teardown\n    // that frees GPU resources. Binding here covers the artboard/file deletes;\n    // deleteRiveRenderer() re-binds for the renderer's own delete. No-op on the\n    // canvas2d build\n    this.renderer?.bindContext?.();\n    // Clean up any artboard, animation or state machine instances.\n    this.cleanupInstances();\n    // Remove from observer\n    if (this._observed !== null) {\n      observers.remove(this._observed);\n    }\n    this.removeRiveListeners();\n    // The file and its session go before the renderer: the session's replay\n    // state lives in the renderer's context. But the renderer must let go of\n    // the session first — its detach handle dies with session.delete(), and a\n    // later detach would pass embind a deleted object.\n    if (this.renderer) {\n      this.renderer.detachSession?.();\n    }\n    this.releaseCurrentRiveFile(/* isTeardown */ true);\n    this.riveFile = null;\n    this.deleteRiveRenderer();\n    if (this._audioEventListener !== null) {\n      audioManager.remove(this._audioEventListener);\n      this._audioEventListener = null;\n    }\n    if (this._pageVisibilityHandler) {\n      document.removeEventListener('visibilitychange', this._pageVisibilityHandler);\n      this._pageVisibilityHandler = null;\n    }\n    this._viewModelInstance?.cleanup();\n    this._viewModelInstance = null;\n    this._globalViewModelInstances.forEach((instance) => instance.cleanup());\n    this._globalViewModelInstances.clear();\n    this._dataEnums = null;\n  }\n\n  /**\n   * Drops this instance's hold on `this.riveFile`. A reference taken through\n   * getInstance() is given back; a file we imported but never referenced is\n   * released outright so its session goes with it. A caller-supplied file we\n   * never referenced is left alone.\n   *\n   * `isTeardown` distinguishes cleanup() from a reload. Teardown always hands\n   * the reference back, as it always has. A reload must not do that for a\n   * caller-supplied file: a RiveFile carries no reference for its creator, so\n   * releasing here would take the last one and destroy a file the caller still\n   * holds.\n   */\n  private releaseCurrentRiveFile(isTeardown: boolean): void {\n    if (this.file) {\n      if (isTeardown || this.ownsRiveFile) {\n        this.riveFile?.cleanup();\n      }\n      this.file = null;\n    } else if (this.ownsRiveFile) {\n      this.riveFile?.destroyIfUnused();\n    }\n  }\n\n  /**\n   * Cleans up the Renderer object. Only call this API if you no longer\n   * need to render Rive content in your session.\n   */\n  public deleteRiveRenderer() {\n    if (this.renderer) {\n      // A session outliving this renderer has to stop pointing at it, and its\n      // replay state has to drop while this context is still alive. No-op when\n      // nothing was ever attached.\n      this.renderer.detachSession?.();\n      this.renderer.delete();\n    }\n    this.renderer = null;\n  }\n\n  /**\n   * @experimental This API is early and may encounter breaking behavior change without a major version bump\n   *\n   * Whether this instance is rendering through a deferred session. False whenever\n   * a fallback ran, whatever was requested.\n   */\n  public get deferredRendererActive(): boolean {\n    return this.renderer?.deferredActive?.() ?? false;\n  }\n\n  /**\n   * Cleans up any Wasm-generated objects that need to be manually destroyed:\n   * artboard instances, animation instances, state machine instances.\n   *\n   * Once this is called, things will need to be reinitialized or bad things\n   * might happen.\n   */\n  public cleanupInstances() {\n    if (this.eventCleanup !== null) {\n      this.eventCleanup();\n    }\n    this.cleanupKeyboardInteractions();\n    // Tear down semantics before deleting state machines — the overlay's action\n    // closures point at instances that stop() is about to free.\n    this.cleanupSemantics();\n    // Delete all animation and state machine instances synchronously via the\n    // animator\n    this.animator?.stop();\n    if (this.artboard) {\n      this.artboard.delete();\n      this.artboard = null;\n    }\n  }\n\n  /**\n   * Tries to query the setup Artboard for a text run node with the given name.\n   *\n   * @param textRunName - Name of the text run node associated with a text object\n   * @returns - TextValueRun node or undefined if the text run cannot be queried\n   */\n  private retrieveTextRun(textRunName: string): rc.TextValueRun | undefined {\n    if (!textRunName) {\n      console.warn(\"No text run name provided\");\n      return;\n    }\n    if (!this.artboard) {\n      console.warn(\"Tried to access text run, but the Artboard is null\");\n      return;\n    }\n    const textRun: rc.TextValueRun = this.artboard.textRun(textRunName);\n    if (!textRun) {\n      console.warn(\n        `Could not access a text run with name '${textRunName}' in the '${this.artboard?.name}' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime.`,\n      );\n      return;\n    }\n    return textRun;\n  }\n\n  /**\n   * Returns a string from a given text run node name, or undefined if the text run\n   * cannot be queried.\n   *\n   * @deprecated Text run APIs are deprecated: use data binding instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}\n   * for how to migrate.\n   * @param textRunName - Name of the text run node associated with a text object\n   * @returns - String value of the text run node or undefined\n   */\n  public getTextRunValue(textRunName: string): string | undefined {\n    warnOnce(DeprecationKeys.textRuns, textRunsDeprecationWarning);\n    const textRun = this.retrieveTextRun(textRunName);\n    return textRun ? textRun.text : undefined;\n  }\n\n  /**\n   * Sets a text value for a given text run node name if possible\n   *\n   * @deprecated Text run APIs are deprecated: use data binding instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}\n   * for how to migrate.\n   * @param textRunName - Name of the text run node associated with a text object\n   * @param textRunValue - String value to set on the text run node\n   */\n  public setTextRunValue(textRunName: string, textRunValue: string): void {\n    warnOnce(DeprecationKeys.textRuns, textRunsDeprecationWarning);\n    const textRun = this.retrieveTextRun(textRunName);\n    if (textRun) {\n      textRun.text = textRunValue;\n    }\n  }\n\n  /**\n   * Warns when playback-control names match linear animations in the\n   * Animator's instanced context; state machine playback remain supported.\n   *\n   * Remove for v3 release\n   */\n  private warnIfLinearAnimationNames(names: string[], methodName: string): void {\n    if (\n      this.animator &&\n      this.animator.animations.some((a) => names.includes(a.name))\n    ) {\n      warnDeprecatedAnimationNames(methodName);\n    }\n  }\n\n  /**\n   * Plays specified animations or state machines; if none specified, it\n   * unpauses everything.\n   * @param animationNames Animation or state machine name(s) to play.\n   * \n   * Deprecated usage: passing linear animation names (control playback with a\n   * state machine instead) and passing an array of names (this parameter\n   * becomes a single string in the next major version).\n   */\n  public play(animationNames?: string | string[], autoplay?: true): void {\n    warnIfNamesArray(animationNames, \"play\");\n    const names = mapToStringArray(animationNames);\n\n    // If the file's not loaded, queue up the play\n    if (!this.readyForPlaying) {\n      this.taskQueue.add({\n        action: () => this.play(animationNames, autoplay),\n      });\n      return;\n    }\n    this.animator.play(names);\n    this.warnIfLinearAnimationNames(names, \"play\");\n    this.syncSemanticsOnStateMachines();\n    if (this.eventCleanup) {\n      this.eventCleanup();\n    }\n    this.cleanupKeyboardInteractions();\n    this.setupRiveListeners();\n    this.startRendering();\n  }\n\n  /**\n   * Pauses specified animations or state machines; if none specified, pauses\n   * all.\n   * @param animationNames Animation or state machine name(s) to pause.\n   * \n   * Deprecated usage: passing linear animation names (control playback with a\n   * state machine instead) and passing an array of names (this parameter\n   * becomes a single string in the next major version).\n   */\n  public pause(animationNames?: string | string[]): void {\n    warnIfNamesArray(animationNames, \"pause\");\n    const names = mapToStringArray(animationNames);\n\n    // If the file's not loaded, early out, nothing to pause\n    if (!this.readyForPlaying) {\n      this.taskQueue.add({\n        action: () => this.pause(animationNames),\n      });\n      return;\n    }\n    if (this.eventCleanup) {\n      this.eventCleanup();\n    }\n    this.cleanupKeyboardInteractions();\n    this.animator.pause(names);\n    this.warnIfLinearAnimationNames(names, \"pause\");\n  }\n\n  /**\n   * Scrubs specified animations to the given time; if none specified, scrubs\n   * all of them.\n   * @deprecated `scrub()` will be removed in a future major version: use a\n   * state machine to control playback instead\n   */\n  public scrub(animationNames?: string | string[], value?: number): void {\n    warnOnce(\n      DeprecationKeys.scrub,\n      \"`scrub()` is deprecated and will be removed in a future major version: \" +\n        \"use a state machine to control playback instead.\",\n    );\n    const names = mapToStringArray(animationNames);\n\n    // If the file's not loaded, early out, nothing to pause\n    if (!this.readyForPlaying) {\n      this.taskQueue.add({\n        action: () => this.scrub(animationNames, value),\n      });\n      return;\n    }\n    // Scrub the animation time; we draw a single frame here so that if\n    // nothing's currently playing, the scrubbed animation is still rendered/\n    this.animator.scrub(names, value || 0);\n    this.drawFrame();\n  }\n\n  /**\n   * Stops specified animations or state machines; if none specified, stops\n   * them all.\n   * @param animationNames Animation or state machine name(s) to stop.\n   * \n   * Deprecated usage: passing linear animation names (control playback with a\n   * state machine instead) and passing an array of names (this parameter\n   * becomes a single string in the next major version).\n   */\n  public stop(animationNames?: string | string[] | undefined): void {\n    warnIfNamesArray(animationNames, \"stop\");\n    const names = mapToStringArray(animationNames);\n    // If the file's not loaded, early out, nothing to pause\n    if (!this.readyForPlaying) {\n      this.taskQueue.add({\n        action: () => this.stop(animationNames),\n      });\n      return;\n    }\n    this.warnIfLinearAnimationNames(names, \"stop\");\n    // If there is no artboard, this.animator will be undefined\n    if (this.animator) {\n      this.animator.stop(names);\n    }\n    if (this.eventCleanup) {\n      this.eventCleanup();\n    }\n    this.cleanupKeyboardInteractions();\n    this.cleanupSemantics();\n  }\n\n  /**\n   * Resets the animation\n   * @param artboard the name of the artboard, or default if none given\n   * @param stateMachine the name of the state machine for playback\n   * @param autoplay whether to autoplay when reset, defaults to false\n   *\n   */\n  public reset(params?: RiveResetParameters): void {\n    // Get the current artboard, animations, state machines, and playback states\n    const artBoardName = params?.artboard;\n    const {\n      startingAnimationNames: animationNames,\n      startingStateMachineNames: stateMachineNames,\n    } = resolveStartingPlayback({\n      stateMachine: params?.stateMachine,\n      animations: params?.animations,\n      stateMachines: params?.stateMachines,\n    });\n    const autoplay = params?.autoplay ?? false;\n    const autoBind = params?.autoBind ?? false;\n\n    // Stop everything and clean up\n    this.cleanupInstances();\n\n    // Reinitialize an artboard instance with the state\n    this.initArtboard(\n      artBoardName,\n      animationNames,\n      stateMachineNames,\n      autoplay,\n      autoBind,\n    );\n    // Only drain the task queue once playback commands can execute; tasks\n    // queued before then re-add themselves in a loop.\n    if (this.readyForPlaying) {\n      this.taskQueue.process();\n    }\n  }\n\n  // Loads a new Rive file, keeping listeners in place\n  public load(params: RiveLoadParameters): void {\n    // Before stop(), so a call with no source leaves playback running.\n    if (!params.src && !params.buffer && !params.riveFile) {\n      throw new RiveError(Rive.missingErrorMessage);\n    }\n    // Stop all animations\n    this.stop();\n    // Reinitialize\n    this.init(params);\n  }\n\n  // Sets a new layout\n  public set layout(layout: Layout) {\n    this._layout = layout;\n    // Fit/alignment/bounds feed the overlay transform.\n    this._overlayTransformDirty = true;\n    // If the maxX or maxY are 0, then set them to the canvas width and height\n    if (!layout.maxX || !layout.maxY) {\n      this.resizeToCanvas();\n    }\n    if (this.loaded && !this.animator.isPlaying) {\n      this.drawFrame();\n    }\n  }\n\n  /**\n   * Returns the current layout. Note that layout should be treated as\n   * immutable. If you want to change the layout, create a new one use the\n   * layout setter\n   */\n  public get layout() {\n    return this._layout;\n  }\n\n  /**\n   * Sets the layout bounds to the current canvas size; this is typically called\n   * when the canvas is resized\n   */\n  public resizeToCanvas() {\n    this._layout = this.layout.copyWith({\n      minX: 0,\n      minY: 0,\n      maxX: this.canvas.width,\n      maxY: this.canvas.height,\n    });\n    // Layout bounds feed the overlay transform.\n    this._overlayTransformDirty = true;\n  }\n\n  /**\n   * Accounts for devicePixelRatio as a multiplier to render the size of the canvas drawing surface.\n   * Uses the size of the backing canvas to set new width/height attributes. Need to re-render\n   * and resize the layout to match the new drawing surface afterwards.\n   * Useful function for consumers to include in a window resize listener.\n   *\n   * This method will set the {@link devicePixelRatioUsed} property.\n   *\n   * Optionally, you can provide a {@link customDevicePixelRatio} to provide a\n   * custom value.\n   */\n  public resizeDrawingSurfaceToCanvas(customDevicePixelRatio?: number) {\n    if (this.canvas instanceof HTMLCanvasElement && !!window) {\n      const { width, height } = this.canvas.getBoundingClientRect();\n      const dpr = customDevicePixelRatio || window.devicePixelRatio || 1;\n      this.devicePixelRatioUsed = dpr;\n      this.canvas.width = dpr * width;\n      this.canvas.height = dpr * height;\n      this._needsRedraw = true;\n      this.resizeToCanvas();\n\n      if (this.layout.fit === Fit.Layout) {\n        const scaleFactor = this._layout.layoutScaleFactor;\n        this.artboard.width = width / scaleFactor;\n        this.artboard.height = height / scaleFactor;\n      }\n\n      this.drawFrame();\n    }\n  }\n\n  // Returns the animation source, which may be undefined\n  public get source(): string {\n    return this.src;\n  }\n\n  /**\n   * Returns the name of the active artboard\n   */\n  public get activeArtboard(): string {\n    return this.artboard ? this.artboard.name : \"\";\n  }\n\n  /**\n   * Returns the semantic tree model when semantics are enabled, or null.\n   * The overlay and external consumers use this to inspect the\n   * current state of the semantic tree.\n   */\n  public get semanticTree(): SemanticTreeModel | null {\n    return this._semanticTree;\n  }\n\n  /**\n   * Returns the accessibility overlay when semantics are enabled, or null.\n   * External consumers can use this to inspect the\n   * current state of the accessibility overlay for this instance.\n   */\n  public get accessibilityOverlay(): AccessibilityOverlay | null {\n    return this._accessibilityOverlay;\n  }\n\n  // Returns a list of animation names on the chosen artboard\n  public get animationNames(): string[] {\n    // If the file's not loaded, we got nothing to return\n    if (!this.loaded || !this.artboard) {\n      return [];\n    }\n    const animationNames: string[] = [];\n    for (let i = 0; i < this.artboard.animationCount(); i++) {\n      animationNames.push(this.artboard.animationByIndex(i).name);\n    }\n    return animationNames;\n  }\n\n  /**\n   * Returns a list of state machine names from the current artboard\n   */\n  public get stateMachineNames(): string[] {\n    // If the file's not loaded, we got nothing to return\n    if (!this.loaded || !this.artboard) {\n      return [];\n    }\n    const stateMachineNames: string[] = [];\n    for (let i = 0; i < this.artboard.stateMachineCount(); i++) {\n      stateMachineNames.push(this.artboard.stateMachineByIndex(i).name);\n    }\n    return stateMachineNames;\n  }\n\n  /**\n   * Returns the inputs for the specified instanced state machine, or an empty\n   * list if the name is invalid or the state machine is not instanced. Returns\n   * undefined if the file is not loaded yet.\n   * \n   * @deprecated State machine inputs are deprecated: use data binding\n   * properties instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}\n   * for how to migrate.\n   * @param name the state machine name\n   * @returns the inputs for the named state machine or undefined\n   */\n  public stateMachineInputs(name: string): StateMachineInput[] | undefined {\n    warnOnce(\n      DeprecationKeys.stateMachineInputs,\n      stateMachineInputsDeprecationWarning,\n    );\n    // If the file's not loaded, early out, nothing to pause\n    if (!this.loaded) {\n      return;\n    }\n    const stateMachine = this.animator.stateMachines.find(\n      (m) => m.name === name,\n    );\n    return stateMachine?.inputs;\n  }\n\n  // Returns the input with the provided name at the given path\n  private retrieveInputAtPath(\n    name: string,\n    path: string,\n  ): rc.SMIInput | undefined {\n    if (!name) {\n      console.warn(`No input name provided for path '${path}'`);\n      return;\n    }\n    if (!this.artboard) {\n      console.warn(\n        `Tried to access input: '${name}', at path: '${path}', but the Artboard is null`,\n      );\n      return;\n    }\n    const input: rc.SMIInput = this.artboard.inputByPath(name, path);\n\n    if (!input) {\n      console.warn(\n        `Could not access an input with name: '${name}', at path:'${path}'`,\n      );\n      return;\n    }\n    return input;\n  }\n\n  /**\n   * Set the boolean input with the provided name at the given path with value\n   * @deprecated State machine inputs are deprecated: use data binding\n   * properties instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}\n   * for how to migrate.\n   * @param input the state machine input name\n   * @param value the value to set the input to\n   * @param path the path the input is located at an artboard level\n   */\n  public setBooleanStateAtPath(\n    inputName: string,\n    value: boolean,\n    path: string,\n  ) {\n    warnOnce(\n      DeprecationKeys.stateMachineInputs,\n      stateMachineInputsDeprecationWarning,\n    );\n    const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n    if (!input) return;\n\n    if (input.type === StateMachineInputType.Boolean) {\n      input.asBool().value = value;\n    } else {\n      console.warn(\n        `Input with name: '${inputName}', at path:'${path}' is not a boolean`,\n      );\n    }\n  }\n\n  /**\n   * Set the number input with the provided name at the given path with value\n   * @deprecated State machine inputs are deprecated: use data binding\n   * properties instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}\n   * for how to migrate.\n   * @param input the state machine input name\n   * @param value the value to set the input to\n   * @param path the path the input is located at an artboard level\n   */\n  public setNumberStateAtPath(inputName: string, value: number, path: string) {\n    warnOnce(\n      DeprecationKeys.stateMachineInputs,\n      stateMachineInputsDeprecationWarning,\n    );\n    const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n    if (!input) return;\n\n    if (input.type === StateMachineInputType.Number) {\n      input.asNumber().value = value;\n    } else {\n      console.warn(\n        `Input with name: '${inputName}', at path:'${path}' is not a number`,\n      );\n    }\n  }\n\n  /**\n   * Fire the trigger with the provided name at the given path\n   * @deprecated State machine inputs are deprecated: use data binding\n   * properties instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}\n   * for how to migrate.\n   * @param input the state machine input name\n   * @param path the path the input is located at an artboard level\n   */\n  public fireStateAtPath(inputName: string, path: string) {\n    warnOnce(\n      DeprecationKeys.stateMachineInputs,\n      stateMachineInputsDeprecationWarning,\n    );\n    const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n    if (!input) return;\n\n    if (input.type === StateMachineInputType.Trigger) {\n      input.asTrigger().fire();\n    } else {\n      console.warn(\n        `Input with name: '${inputName}', at path:'${path}' is not a trigger`,\n      );\n    }\n  }\n\n  // Returns the TextValueRun object for the provided name at the given path\n  private retrieveTextAtPath(\n    name: string,\n    path: string,\n  ): rc.TextValueRun | undefined {\n    if (!name) {\n      console.warn(`No text name provided for path '${path}'`);\n      return;\n    }\n    if (!path) {\n      console.warn(`No path provided for text '${name}'`);\n      return;\n    }\n    if (!this.artboard) {\n      console.warn(\n        `Tried to access text: '${name}', at path: '${path}', but the Artboard is null`,\n      );\n      return;\n    }\n    const text: rc.TextValueRun = this.artboard.textByPath(name, path);\n    if (!text) {\n      console.warn(\n        `Could not access text with name: '${name}', at path:'${path}'`,\n      );\n      return;\n    }\n    return text;\n  }\n\n  /**\n   * Retrieves the text value for a specified text run at a given path\n   * @param textName The name of the text run\n   * @param path The path to the text run within the artboard\n   * @returns The text value of the text run, or undefined if not found\n   *\n   * @example\n   * // Get the text value for a text run named \"title\" at one nested artboard deep\n   * const titleText = riveInstance.getTextRunValueAtPath(\"title\", \"artboard1\");\n   *\n   * @example\n   * // Get the text value for a text run named \"subtitle\" within a nested group two artboards deep\n   * const subtitleText = riveInstance.getTextRunValueAtPath(\"subtitle\", \"group/nestedGroup\");\n   *\n   * @remarks\n   * If the text run cannot be found at the specified path, a warning will be logged to the console.\n   *\n   * @deprecated Text run APIs are deprecated: use data binding instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}\n   * for how to migrate.\n   */\n  public getTextRunValueAtPath(\n    textName: string,\n    path: string,\n  ): string | undefined {\n    warnOnce(DeprecationKeys.textRuns, textRunsDeprecationWarning);\n    const run: rc.TextValueRun = this.retrieveTextAtPath(textName, path);\n    if (!run) {\n      console.warn(\n        `Could not get text with name: '${textName}', at path:'${path}'`,\n      );\n      return;\n    }\n    return run.text;\n  }\n\n  /**\n   * Sets the text value for a specified text run at a given path\n   * @param textName The name of the text run\n   * @param value The new text value to set\n   * @param path The path to the text run within the artboard\n   * @returns void\n   *\n   * @example\n   * // Set the text value for a text run named \"title\" at one nested artboard deep\n   * riveInstance.setTextRunValueAtPath(\"title\", \"New Title\", \"artboard1\");\n   *\n   * @example\n   * // Set the text value for a text run named \"subtitle\" within a nested group two artboards deep\n   * riveInstance.setTextRunValueAtPath(\"subtitle\", \"New Subtitle\", \"group/nestedGroup\");\n   *\n   * @remarks\n   * If the text run cannot be found at the specified path, a warning will be logged to the console.\n   *\n   * @deprecated Text run APIs are deprecated: use data binding instead. See\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}\n   * for how to migrate.\n   */\n  public setTextRunValueAtPath(textName: string, value: string, path: string) {\n    warnOnce(DeprecationKeys.textRuns, textRunsDeprecationWarning);\n    const run: rc.TextValueRun = this.retrieveTextAtPath(textName, path);\n    if (!run) {\n      console.warn(\n        `Could not set text with name: '${textName}', at path:'${path}'`,\n      );\n      return;\n    }\n    run.text = value;\n  }\n\n  // Returns a list of playing machine names\n  public get playingStateMachineNames(): string[] {\n    // If the file's not loaded, we got nothing to return\n    if (!this.loaded) {\n      return [];\n    }\n    return this.animator.stateMachines\n      .filter((m) => m.playing)\n      .map((m) => m.name);\n  }\n\n  // Returns a list of playing animation names\n  public get playingAnimationNames(): string[] {\n    // If the file's not loaded, we got nothing to return\n    if (!this.loaded) {\n      return [];\n    }\n    return this.animator.animations.filter((a) => a.playing).map((a) => a.name);\n  }\n\n  // Returns a list of paused animation names\n  public get pausedAnimationNames(): string[] {\n    // If the file's not loaded, we got nothing to return\n    if (!this.loaded) {\n      return [];\n    }\n    return this.animator.animations\n      .filter((a) => !a.playing)\n      .map((a) => a.name);\n  }\n\n  /**\n   *  Returns a list of paused machine names\n   * @returns a list of state machine names that are paused\n   */\n  public get pausedStateMachineNames(): string[] {\n    // If the file's not loaded, we got nothing to return\n    if (!this.loaded) {\n      return [];\n    }\n    return this.animator.stateMachines\n      .filter((m) => !m.playing)\n      .map((m) => m.name);\n  }\n\n  /**\n   * @returns true if any animation is playing\n   */\n  public get isPlaying(): boolean {\n    return this.animator.isPlaying;\n  }\n\n  /**\n   * @returns true if all instanced animations are paused\n   */\n  public get isPaused(): boolean {\n    return this.animator.isPaused;\n  }\n\n  /**\n   * @returns true if no animations are playing or paused\n   */\n  public get isStopped(): boolean {\n    return this.animator?.isStopped ?? true;\n  }\n\n  /**\n   * @returns the bounds of the current artboard, or undefined if the artboard\n   * isn't loaded yet.\n   */\n  public get bounds(): Bounds {\n    return this.artboard ? this.artboard.bounds : undefined;\n  }\n\n  /**\n   * Subscribe to Rive-generated events\n   *\n   * Note: subscribing to {@link EventType.RiveEvent},\n   * {@link EventType.StateChange}, or {@link EventType.Loop} is deprecated;\n   * use data binding instead. See\n   * {@link https://rive.app/docs/runtimes/web/rive-events} (Rive Events) and\n   * {@link https://rive.app/docs/editor/data-binding/migration-guide} for how\n   * to migrate Rive graphics to a data binding workflow instead.\n   * @param type the type of event to subscribe to\n   * @param callback callback to fire when the event occurs\n   */\n  public on(type: EventType, callback: EventCallback) {\n    if (type === EventType.RiveEvent) {\n      warnOnce(DeprecationKeys.riveEvents, riveEventsDeprecationWarning);\n    } else if (type === EventType.StateChange) {\n      warnOnce(\n        DeprecationKeys.stateChangeEvents,\n        stateChangeEventsDeprecationWarning,\n      );\n    } else if (type === EventType.Loop) {\n      warnOnce(DeprecationKeys.loopEvents, loopEventsDeprecationWarning);\n    }\n    this.eventManager.add({\n      type: type,\n      callback: callback,\n    });\n  }\n\n  /**\n   * Unsubscribes from a Rive-generated event\n   * @param type the type of event to unsubscribe from\n   * @param callback the callback to unsubscribe\n   */\n  public off(type: EventType, callback: EventCallback) {\n    this.eventManager.remove({\n      type: type,\n      callback: callback,\n    });\n  }\n\n  /**\n   * Unsubscribes from a Rive-generated event\n   * @deprecated\n   * @param callback the callback to unsubscribe from\n   */\n  public unsubscribe(type: EventType, callback: EventCallback) {\n    warnOnce(\n      DeprecationKeys.legacyUnsubscribe,\n      \"This function is deprecated: please use `off()` instead.\",\n    );\n    this.off(type, callback);\n  }\n\n  /**\n   * Unsubscribes all Rive listeners from an event type, or everything if no type is\n   * given\n   * @param type the type of event to unsubscribe from, or all types if\n   * undefined\n   */\n  public removeAllRiveEventListeners(type?: EventType) {\n    this.eventManager.removeAll(type);\n  }\n\n  /**\n   * Unsubscribes all listeners from an event type, or everything if no type is\n   * given\n   * @deprecated\n   * @param type the type of event to unsubscribe from, or all types if\n   * undefined\n   */\n  public unsubscribeAll(type?: EventType) {\n    warnOnce(\n      DeprecationKeys.legacyUnsubscribe,\n      \"This function is deprecated: please use `removeAllRiveEventListeners()` instead.\",\n    );\n    this.removeAllRiveEventListeners(type);\n  }\n\n  /**\n   * Stops the rendering loop; this is different from pausing in that it doesn't\n   * change the state of any animation. It stops rendering from occurring. This\n   * is designed for situations such as when Rive isn't visible.\n   *\n   * The only way to start rendering again is to call `startRendering`.\n   * Animations that are marked as playing will start from the position that\n   * they would have been at if rendering had not been stopped.\n   */\n  public stopRendering() {\n    this._explicitlyStoppedRendering = true;\n    if (this.loaded && this.frameRequestId) {\n      if (this.runtime.cancelAnimationFrame) {\n        this.runtime.cancelAnimationFrame(this.frameRequestId);\n      } else {\n        cancelAnimationFrame(this.frameRequestId);\n      }\n      this.frameRequestId = null;\n    }\n  }\n\n  /**\n   * Starts the rendering loop if it has been previously stopped. If the\n   * renderer is already active, then this will have zero effect.\n   */\n  public startRendering() {\n    this._explicitlyStoppedRendering = false;\n    this.drawFrame();\n  }\n\n  private scheduleRendering() {\n    if (this.loaded && this.artboard && !this.frameRequestId) {\n      if (this.runtime.requestAnimationFrame) {\n        this.frameRequestId = this.runtime.requestAnimationFrame(\n          this._boundDraw,\n        );\n      } else {\n        this.frameRequestId = requestAnimationFrame(this._boundDraw);\n      }\n    }\n  }\n\n  /**\n   * Called when document.visibilitychange fires (tab change, window minimize, etc.). \n   * Cancels the rAF loop on hide and resets the time reference so that no accumulated time is\n   * applied to state machines when the tab becomes visible again. This prevents state machine\n   * advances with large time deltas when rAF starts up again.\n   */\n  private _onPageVisibilityChange(): void {\n    if (document.hidden) {\n      if (this.frameRequestId !== null) {\n        if (this.runtime?.cancelAnimationFrame) {\n          this.runtime.cancelAnimationFrame(this.frameRequestId);\n        } else {\n          cancelAnimationFrame(this.frameRequestId);\n        }\n        this.frameRequestId = null;\n      }\n      // Reset so the first resumed frame starts with elapsedTime === 0.\n      this.lastRenderTime = 0;\n    } else if (this.animator?.isPlaying && !this._explicitlyStoppedRendering) {\n      this.scheduleRendering();\n    }\n  }\n\n  /**\n   * Enables frames-per-second (FPS) reporting for the runtime\n   * If no callback is provided, Rive will append a fixed-position div at the top-right corner of\n   * the page with the FPS reading\n   * @param fpsCallback - Callback from the runtime during the RAF loop that supplies the FPS value\n   */\n  public enableFPSCounter(fpsCallback?: FPSCallback) {\n    this.runtime.enableFPSCounter(fpsCallback);\n  }\n\n  /**\n   * Disables frames-per-second (FPS) reporting for the runtime\n   */\n  public disableFPSCounter() {\n    this.runtime.disableFPSCounter();\n  }\n\n  /**\n   * Returns the contents of a Rive file: the artboards, animations, and state machines\n   */\n  public get contents(): RiveFileContents {\n    if (!this.loaded) {\n      return undefined;\n    }\n    const riveContents: RiveFileContents = {\n      artboards: [],\n    };\n    for (let i = 0; i < this.file.artboardCount(); i++) {\n      const artboard = this.file.artboardByIndex(i);\n      const artboardContents: ArtboardContents = {\n        name: artboard.name,\n        animations: [],\n        stateMachines: [],\n      };\n      for (let j = 0; j < artboard.animationCount(); j++) {\n        const animation = artboard.animationByIndex(j);\n        artboardContents.animations.push(animation.name);\n      }\n      for (let k = 0; k < artboard.stateMachineCount(); k++) {\n        const stateMachine = artboard.stateMachineByIndex(k);\n        const name = stateMachine.name;\n        const instance = new this.runtime.StateMachineInstance(\n          stateMachine,\n          artboard,\n        );\n        const inputContents: StateMachineInputContents[] = [];\n        for (let l = 0; l < instance.inputCount(); l++) {\n          const input = instance.input(l);\n          inputContents.push({ name: input.name, type: input.type });\n        }\n        artboardContents.stateMachines.push({\n          name: name,\n          inputs: inputContents,\n        });\n      }\n      riveContents.artboards.push(artboardContents);\n    }\n    return riveContents;\n  }\n\n  /**\n   * Getter / Setter for the volume of the artboard\n   */\n  public get volume(): number {\n    if (this.artboard && this.artboard.volume !== this._volume) {\n      this._volume = this.artboard.volume;\n    }\n    return this._volume;\n  }\n\n  public set volume(value: number) {\n    this._volume = value;\n    if (this.artboard) {\n      this.artboard.volume = value * audioManager.systemVolume;\n    }\n  }\n\n  /**\n   * The width of the artboard.\n   *\n   * This will return 0 if the artboard is not loaded yet and a custom\n   * width has not been set.\n   *\n   * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}\n   * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard width is\n   * automatically set.\n   */\n  public get artboardWidth(): number {\n    if (this.artboard) {\n      return this.artboard.width;\n    }\n    return this._artboardWidth ?? 0;\n  }\n\n  public set artboardWidth(value: number) {\n    this._artboardWidth = value;\n    if (this.artboard) {\n      this.artboard.width = value;\n    }\n  }\n\n  /**\n   * The height of the artboard.\n   *\n   * This will return 0 if the artboard is not loaded yet and a custom\n   * height has not been set.\n   *\n   * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}\n   * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard height is\n   * automatically set.\n   */\n  public get artboardHeight(): number {\n    if (this.artboard) {\n      return this.artboard.height;\n    }\n    return this._artboardHeight ?? 0;\n  }\n\n  public set artboardHeight(value: number) {\n    this._artboardHeight = value;\n\n    if (this.artboard) {\n      this.artboard.height = value;\n    }\n  }\n\n  /**\n   * Reset the artboard size to its original values.\n   */\n  public resetArtboardSize() {\n    if (this.artboard) {\n      this.artboard.resetArtboardSize();\n      this._artboardWidth = this.artboard.width;\n      this._artboardHeight = this.artboard.height;\n    } else {\n      // If the artboard isn't loaded, we need to reset the custom width and height\n      this._artboardWidth = undefined;\n      this._artboardHeight = undefined;\n    }\n  }\n\n  /**\n   * The device pixel ratio used in rendering and canvas/artboard resizing.\n   *\n   * This value will be overidden by the device pixel ratio used in\n   * {@link resizeDrawingSurfaceToCanvas}. If you use that method, do not set this value.\n   */\n  public get devicePixelRatioUsed(): number {\n    return this._devicePixelRatioUsed;\n  }\n\n  public set devicePixelRatioUsed(value: number) {\n    if (value !== this._devicePixelRatioUsed) {\n      this._overlayTransformDirty = true;\n    }\n    this._devicePixelRatioUsed = value;\n  }\n\n  /**\n   * Sets the main view model instance and applies it (rebinds). Equivalent to\n   * `setViewModelInstance(vmi)` followed by `bind()`.\n   */\n  public bindViewModelInstance(viewModelInstance: ViewModelInstance | null) {\n    if (!viewModelInstance) {\n      return;\n    }\n    this.setViewModelInstance(viewModelInstance);\n    this.bind();\n  }\n\n  /**\n   * Sets the main view model instance in the data context WITHOUT rebinding.\n   * Call {@link bind} to apply. Use this with {@link setGlobalViewModelInstance}\n   * to batch multiple changes into a single rebind.\n   */\n  public setViewModelInstance(viewModelInstance: ViewModelInstance | null) {\n    const runtimeInstance = viewModelInstance?.runtimeInstance;\n    if (\n      !this.artboard ||\n      this.destroyed ||\n      !viewModelInstance ||\n      !runtimeInstance\n    ) {\n      return;\n    }\n    viewModelInstance.internalIncrementReferenceCount();\n    this._viewModelInstance?.cleanup();\n    this._viewModelInstance = viewModelInstance;\n    if (this.animator.stateMachines.length > 0) {\n      this.animator.stateMachines.forEach((stateMachine) =>\n        stateMachine.instance.setViewModelInstance(runtimeInstance),\n      );\n    } else {\n      this.artboard.setViewModelInstance(runtimeInstance);\n    }\n  }\n\n  /**\n   * Applies any pending `set*` view model instance changes by rebinding the\n   * data binds once.\n   * Implicitly creates and binds any view models that have not been set.\n   */\n  public bind() {\n    if (!this.artboard || this.destroyed) {\n      return;\n    }\n    if (this.animator.stateMachines.length > 0) {\n      this.animator.stateMachines.forEach((stateMachine) =>\n        stateMachine.instance.bind(),\n      );\n    } else {\n      this.artboard.bind();\n    }\n  }\n\n  public get viewModelInstance(): ViewModelInstance | null {\n    return this._viewModelInstance;\n  }\n\n  /**\n   * Sets (or replaces) the global view model instance for the given global view\n   * model name in the data context WITHOUT rebinding. The main instance and any\n   * other globals keep their order. Call {@link bind} to apply — batch several\n   * `set*` calls then a single `bind()` to avoid rebinding per set.\n   * @param name - the name of the global view model\n   * @param viewModelInstance - the instance to set for that global\n   * @returns whether the instance was set (false if `name` does not match a\n   * global view model in the file)\n   */\n  public setGlobalViewModelInstance(\n    name: string,\n    viewModelInstance: ViewModelInstance,\n  ): boolean {\n    const runtimeInstance = viewModelInstance?.runtimeInstance;\n    if (!this.artboard || this.destroyed || !runtimeInstance) {\n      return false;\n    }\n    let bound = false;\n    if (this.animator.stateMachines.length > 0) {\n      this.animator.stateMachines.forEach((stateMachine) => {\n        if (\n          stateMachine.instance.setGlobalViewModelInstance(\n            name,\n            runtimeInstance,\n          )\n        ) {\n          bound = true;\n        }\n      });\n    } else {\n      bound = this.artboard.setGlobalViewModelInstance(name, runtimeInstance);\n    }\n    if (bound) {\n      viewModelInstance.internalIncrementReferenceCount();\n      this._globalViewModelInstances.get(name)?.cleanup();\n      this._globalViewModelInstances.set(name, viewModelInstance);\n    }\n    return bound;\n  }\n\n  /**\n   * @param name - the name of the global view model\n   * @returns the global view model instance bound under the given name — the\n   * instance set via {@link setGlobalViewModelInstance} or one created by\n   * auto-bind — or null if none has been set/created for that name (globals are\n   * not auto-created; the getter never creates one).\n   */\n  public globalViewModelInstance(name: string): ViewModelInstance | null {\n    const cached = this._globalViewModelInstances.get(name);\n    if (cached) {\n      return cached;\n    }\n    if (!this.artboard || this.destroyed) {\n      return null;\n    }\n    // State machines share the artboard's data context; query the first one\n    // when present (mirroring how the setter routes), otherwise the artboard.\n    // This is a pure read — it returns null unless an instance was set/bound.\n    const runtimeInstance =\n      this.animator.stateMachines.length > 0\n        ? this.animator.stateMachines[0].instance.globalViewModelInstance(name)\n        : this.artboard.globalViewModelInstance(name);\n    if (runtimeInstance === null) {\n      return null;\n    }\n    const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n    createFinalization(viewModelInstance, runtimeInstance);\n    viewModelInstance.internalIncrementReferenceCount();\n    this._globalViewModelInstances.set(name, viewModelInstance);\n    return viewModelInstance;\n  }\n\n  /**\n   * @returns the names of the file's global view models, in file order. Use\n   * these with {@link setGlobalViewModelInstance} / {@link globalViewModelInstance}.\n   */\n  public globalViewModelNames(): string[] {\n    return this.file?.globalViewModelNames() ?? [];\n  }\n\n  public viewModelByIndex(index: number): ViewModel | null {\n    const viewModel = this.file.viewModelByIndex(index);\n    if (viewModel !== null) {\n      return new ViewModel(viewModel);\n    }\n    return null;\n  }\n\n  public viewModelByName(name: string): ViewModel | null {\n    return this.riveFile?.viewModelByName(name);\n  }\n\n  public enums(): DataEnum[] {\n    if (this._dataEnums === null) {\n      const dataEnums = this.file.enums();\n      this._dataEnums = dataEnums.map((dataEnum) => {\n        return new DataEnum(dataEnum);\n      });\n    }\n    return this._dataEnums;\n  }\n\n  public defaultViewModel(): ViewModel | null {\n    if (this.artboard) {\n      const viewModel = this.file.defaultArtboardViewModel(this.artboard);\n      if (viewModel) {\n        return new ViewModel(viewModel);\n      }\n    }\n    return null;\n  }\n\n  /**\n   * @deprecated This function is deprecated. For better stability and memory management\n   * use `getBindableArtboard()` instead.\n   * @param {string} name - The name of the artboard.\n   * @returns {Artboard} The artboard to bind to.\n   */\n  public getArtboard(name: string): Artboard | null {\n    return this.riveFile?.getArtboard(name) ?? null;\n  }\n\n  public getBindableArtboard(name: string): BindableArtboard | null {\n    return this.riveFile?.getBindableArtboard(name) ?? null;\n  }\n\n  public getDefaultBindableArtboard(): BindableArtboard | null {\n    return this.riveFile?.getDefaultBindableArtboard() ?? null;\n  }\n\n  /**\n   * Clear focus applicable to active state machines with focus nodes. Useful if users want to\n   * reset focus state and behavior within the Rive graphic at any point (i.e. blurring off the canvas)\n   */\n  public clearFocus(): void {\n    const playingStateMachines = this.animator.stateMachines.filter((sm) => sm.playing && sm.hasFocusNodes);\n    playingStateMachines.forEach((sm) => sm.clearFocus());\n  }\n\n}\n\nexport enum DataType {\n  none = 'none',\n  string = 'string',\n  number = 'number',\n  boolean = 'boolean',\n  color = 'color',\n  list = 'list',\n  enumType = 'enumType',\n  trigger = 'trigger',\n  viewModel = 'viewModel',\n  integer = 'integer',\n  listIndex = 'listIndex',\n  image = 'image',\n  artboard = 'artboard',\n}\n\nexport class ViewModel {\n  private _viewModel: rc.ViewModel;\n\n  constructor(viewModel: rc.ViewModel) {\n    this._viewModel = viewModel;\n  }\n\n  public get instanceCount(): number {\n    return this._viewModel.instanceCount;\n  }\n\n  public get name(): string {\n    return this._viewModel.name;\n  }\n\n  public instanceByIndex(index: number): ViewModelInstance | null {\n    const instance = this._viewModel.instanceByIndex(index);\n    if (instance !== null) {\n      const viewModelInstance = new ViewModelInstance(instance, null);\n      createFinalization(viewModelInstance, instance);\n      return viewModelInstance;\n    }\n    return null;\n  }\n\n  public instanceByName(name: string): ViewModelInstance | null {\n    const instance = this._viewModel.instanceByName(name);\n    if (instance !== null) {\n      const viewModelInstance = new ViewModelInstance(instance, null);\n      createFinalization(viewModelInstance, instance);\n      return viewModelInstance;\n    }\n    return null;\n  }\n\n  public defaultInstance(): ViewModelInstance | null {\n    const runtimeInstance = this._viewModel.defaultInstance();\n    if (runtimeInstance !== null) {\n      const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n      createFinalization(viewModelInstance, runtimeInstance);\n      return viewModelInstance;\n    }\n    return null;\n  }\n\n  public instance(): ViewModelInstance {\n    const runtimeInstance = this._viewModel.instance();\n    if (runtimeInstance !== null) {\n      const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n      createFinalization(viewModelInstance, runtimeInstance);\n      return viewModelInstance;\n    }\n    return null;\n  }\n\n  public get properties(): rc.ViewModelProperty[] {\n    return this._viewModel.getProperties();\n  }\n\n  public get instanceNames(): string[] {\n    return this._viewModel.getInstanceNames();\n  }\n}\n\nexport class DataEnum {\n  private _dataEnum: rc.DataEnum;\n\n  constructor(dataEnum: rc.DataEnum) {\n    this._dataEnum = dataEnum;\n  }\n\n  public get name(): string {\n    return this._dataEnum.name;\n  }\n\n  public get values(): string[] {\n    return this._dataEnum.values;\n  }\n}\n\nenum PropertyType {\n  Number = \"number\",\n  String = \"string\",\n  Boolean = \"boolean\",\n  Color = \"color\",\n  Trigger = \"trigger\",\n  Enum = \"enum\",\n  List = \"list\",\n  Image = \"image\",\n  Font = \"font\",\n  Artboard = \"artboard\",\n}\n\nexport class ViewModelInstance {\n  private _runtimeInstance: rc.ViewModelInstance | null;\n\n  private _parents: ViewModelInstance[] = [];\n\n  private _children: ViewModelInstance[] = [];\n\n  private _viewModelInstances: Map<string, ViewModelInstance> = new Map();\n\n  private _propertiesWithCallbacks: ViewModelInstanceValue[] = [];\n\n  private _referenceCount = 0;\n\n  public selfUnref: boolean = false;\n\n  constructor(\n    runtimeInstance: rc.ViewModelInstance,\n    parent: ViewModelInstance | null,\n  ) {\n    this._runtimeInstance = runtimeInstance;\n    if (parent !== null) {\n      this._parents.push(parent);\n    }\n  }\n\n  public get runtimeInstance(): rc.ViewModelInstance | null {\n    return this._runtimeInstance;\n  }\n\n  public get nativeInstance(): rc.ViewModelInstance | null {\n    return this._runtimeInstance;\n  }\n\n  public handleCallbacks() {\n    if (this._propertiesWithCallbacks.length !== 0) {\n      this._propertiesWithCallbacks.forEach((property) => {\n        property.handleCallbacks();\n      });\n      this._propertiesWithCallbacks.forEach((property) => {\n        property.clearChanges();\n      });\n    }\n    this._children.forEach((child) => child.handleCallbacks());\n  }\n\n  public addParent(parent: ViewModelInstance) {\n    if (!this._parents.includes(parent)) {\n      this._parents.push(parent);\n      if (\n        this._propertiesWithCallbacks.length > 0 ||\n        this._children.length > 0\n      ) {\n        parent.addToViewModelCallbacks(this);\n      }\n    }\n  }\n\n  public removeParent(parent: ViewModelInstance) {\n    const index = this._parents.indexOf(parent);\n    if (index !== -1) {\n      const parent = this._parents[index];\n      parent.removeFromViewModelCallbacks(this);\n      this._parents.splice(index, 1);\n    }\n  }\n\n  /*\n   * method for internal use, it shouldn't be called externally\n   */\n  public addToPropertyCallbacks(property: ViewModelInstanceValue) {\n    if (!this._propertiesWithCallbacks.includes(property)) {\n      this._propertiesWithCallbacks.push(property);\n      if (this._propertiesWithCallbacks.length > 0) {\n        this._parents.forEach((parent) => {\n          parent.addToViewModelCallbacks(this);\n        });\n      }\n    }\n  }\n\n  /*\n   * method for internal use, it shouldn't be called externally\n   */\n  public removeFromPropertyCallbacks(property: ViewModelInstanceValue) {\n    if (this._propertiesWithCallbacks.includes(property)) {\n      this._propertiesWithCallbacks = this._propertiesWithCallbacks.filter(\n        (prop) => prop !== property,\n      );\n      if (\n        this._children.length === 0 &&\n        this._propertiesWithCallbacks.length === 0\n      ) {\n        this._parents.forEach((parent) => {\n          parent.removeFromViewModelCallbacks(this);\n        });\n      }\n    }\n  }\n\n  /*\n   * method for internal use, it shouldn't be called externally\n   */\n  public addToViewModelCallbacks(instance: ViewModelInstance) {\n    if (!this._children.includes(instance)) {\n      this._children.push(instance);\n      this._parents.forEach((parent) => {\n        parent.addToViewModelCallbacks(this);\n      });\n    }\n  }\n\n  /*\n   * method for internal use, it shouldn't be called externally\n   */\n  public removeFromViewModelCallbacks(instance: ViewModelInstance) {\n    if (this._children.includes(instance)) {\n      this._children = this._children.filter((child) => child !== instance);\n      if (\n        this._children.length === 0 &&\n        this._propertiesWithCallbacks.length === 0\n      ) {\n        this._parents.forEach((parent) => {\n          parent.removeFromViewModelCallbacks(this);\n        });\n      }\n    }\n  }\n\n  private clearCallbacks() {\n    this._propertiesWithCallbacks.forEach((property) => {\n      property.clearCallbacks();\n    });\n  }\n\n  private propertyFromPath(\n    path: string,\n    type: PropertyType,\n  ): ViewModelInstanceValue | null {\n    const pathSegments = path.split(\"/\");\n    return this.propertyFromPathSegments(pathSegments, 0, type);\n  }\n\n  private viewModelFromPathSegments(\n    pathSegments: string[],\n    index: number,\n  ): ViewModelInstance | null {\n    const viewModelInstance = this.internalViewModelInstance(\n      pathSegments[index],\n    );\n    if (viewModelInstance !== null) {\n      if (index == pathSegments.length - 1) {\n        return viewModelInstance;\n      } else {\n        return viewModelInstance.viewModelFromPathSegments(\n          pathSegments,\n          index++,\n        );\n      }\n    }\n    return null;\n  }\n\n  private propertyFromPathSegments(\n    pathSegments: string[],\n    index: number,\n    type: PropertyType,\n  ): ViewModelInstanceValue | null {\n    if (index < pathSegments.length - 1) {\n      const viewModelInstance = this.internalViewModelInstance(\n        pathSegments[index],\n      );\n      if (viewModelInstance !== null) {\n        return viewModelInstance.propertyFromPathSegments(\n          pathSegments,\n          index + 1,\n          type,\n        );\n      } else {\n        return null;\n      }\n    }\n    let instance: rc.ViewModelInstanceValue | null = null;\n    switch (type) {\n      case PropertyType.Number:\n        instance = this._runtimeInstance?.number(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceNumber(\n            instance as rc.ViewModelInstanceNumber,\n            this,\n          );\n        }\n        break;\n      case PropertyType.String:\n        instance = this._runtimeInstance?.string(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceString(\n            instance as rc.ViewModelInstanceString,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Boolean:\n        instance = this._runtimeInstance?.boolean(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceBoolean(\n            instance as rc.ViewModelInstanceBoolean,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Color:\n        instance = this._runtimeInstance?.color(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceColor(\n            instance as rc.ViewModelInstanceColor,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Trigger:\n        instance = this._runtimeInstance?.trigger(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceTrigger(\n            instance as rc.ViewModelInstanceTrigger,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Enum:\n        instance = this._runtimeInstance?.enum(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceEnum(\n            instance as rc.ViewModelInstanceEnum,\n            this,\n          );\n        }\n        break;\n      case PropertyType.List:\n        instance = this._runtimeInstance?.list(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceList(\n            instance as rc.ViewModelInstanceList,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Image:\n        instance = this._runtimeInstance?.image(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceAssetImage(\n            instance as rc.ViewModelInstanceAssetImage,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Font:\n        instance = this._runtimeInstance?.font(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceAssetFont(\n            instance as rc.ViewModelInstanceAssetFont,\n            this,\n          );\n        }\n        break;\n      case PropertyType.Artboard:\n        instance = this._runtimeInstance?.artboard(pathSegments[index]) ?? null;\n        if (instance !== null) {\n          return new ViewModelInstanceArtboard(\n            instance as rc.ViewModelInstanceArtboard,\n            this,\n          );\n        }\n        break;\n    }\n    return null;\n  }\n\n  private internalViewModelInstance(name: string): ViewModelInstance | null {\n    if (this._viewModelInstances.has(name)) {\n      return this._viewModelInstances.get(name)!;\n    }\n    const viewModelRuntimeInstance = this._runtimeInstance?.viewModel(name);\n    if (viewModelRuntimeInstance !== null) {\n      const viewModelInstance = new ViewModelInstance(\n        viewModelRuntimeInstance!,\n        this,\n      );\n      createFinalization(viewModelInstance, viewModelRuntimeInstance);\n      viewModelInstance.internalIncrementReferenceCount();\n      this._viewModelInstances.set(name, viewModelInstance);\n      return viewModelInstance;\n    }\n    return null;\n  }\n\n  /**\n   * method to access a property instance of type number belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the number property\n   */\n  public number(path: string): ViewModelInstanceNumber | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Number,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceNumber;\n  }\n\n  /**\n   * method to access a property instance of type string belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the string property\n   */\n  public string(path: string): ViewModelInstanceString | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.String,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceString | null;\n  }\n\n  /**\n   * method to access a property instance of type boolean belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the boolean property\n   */\n  public boolean(path: string): ViewModelInstanceBoolean | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Boolean,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceBoolean | null;\n  }\n\n  /**\n   * method to access a property instance of type color belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the ttrigger property\n   */\n  public color(path: string): ViewModelInstanceColor | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Color,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceColor | null;\n  }\n\n  /**\n   * method to access a property instance of type trigger belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the trigger property\n   */\n  public trigger(path: string): ViewModelInstanceTrigger | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Trigger,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceTrigger | null;\n  }\n\n  /**\n   * method to access a property instance of type enum belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the enum property\n   */\n  public enum(path: string): ViewModelInstanceEnum | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Enum,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceEnum | null;\n  }\n\n  /**\n   * method to access a property instance of type list belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the list property\n   */\n  public list(path: string): ViewModelInstanceList | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.List,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceList | null;\n  }\n\n  /**\n   * method to access a view model property instance belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the image property\n   */\n  public image(path: string): ViewModelInstanceAssetImage | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Image,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceAssetImage | null;\n  }\n\n  /**\n   * method to access a view model property instance belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the font property\n   */\n  public font(path: string): ViewModelInstanceAssetFont | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Font,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceAssetFont | null;\n  }\n\n  /**\n   * method to access an artboard property instance belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the image property\n   */\n  public artboard(path: string): ViewModelInstanceArtboard | null {\n    const viewmodelInstanceValue = this.propertyFromPath(\n      path,\n      PropertyType.Artboard,\n    );\n    return viewmodelInstanceValue as ViewModelInstanceArtboard | null;\n  }\n\n  /**\n   * method to access a view model property instance belonging\n   * to the view model instance or to a nested view model instance\n   * @param path - path to the view model property\n   */\n  public viewModel(path: string): ViewModelInstance | null {\n    const pathSegments = path.split(\"/\");\n    const parentViewModelInstance =\n      pathSegments.length > 1\n        ? this.viewModelFromPathSegments(\n            pathSegments.slice(0, pathSegments.length - 1),\n            0,\n          )\n        : this;\n    if (parentViewModelInstance != null) {\n      return parentViewModelInstance.internalViewModelInstance(\n        pathSegments[pathSegments.length - 1],\n      );\n    }\n    return null;\n  }\n\n  public internalReplaceViewModel(\n    name: string,\n    value: ViewModelInstance,\n  ): boolean {\n    if (value.runtimeInstance !== null) {\n      const result =\n        this._runtimeInstance?.replaceViewModel(name, value.runtimeInstance!) ||\n        false;\n      if (result) {\n        value.internalIncrementReferenceCount();\n        const oldInstance = this.internalViewModelInstance(name);\n        if (oldInstance !== null) {\n          oldInstance.removeParent(this);\n          if (this._children.includes(oldInstance)) {\n            this._children = this._children.filter(\n              (child) => child !== oldInstance,\n            );\n          }\n          oldInstance.cleanup();\n        }\n        this._viewModelInstances.set(name, value);\n        value.addParent(this);\n      }\n      return result;\n    }\n    return false;\n  }\n\n  /**\n   * method to replace a view model property with another view model value\n   * @param path - path to the view model property\n   * @param value - view model that will replace the original\n   */\n  public replaceViewModel(path: string, value: ViewModelInstance): boolean {\n    const pathSegments = path.split(\"/\");\n    const viewModelInstance =\n      pathSegments.length > 1\n        ? this.viewModelFromPathSegments(\n            pathSegments.slice(0, pathSegments.length - 1),\n            0,\n          )\n        : this;\n    return (\n      viewModelInstance?.internalReplaceViewModel(\n        pathSegments[pathSegments.length - 1],\n        value,\n      ) ?? false\n    );\n  }\n\n  /*\n   * method to add one to the reference counter of the instance.\n   * Use if the file owning the reference is destroyed but the instance needs to stay around\n   */\n  public incrementReferenceCount() {\n    this._referenceCount++;\n    this._runtimeInstance?.incrementReferenceCount();\n  }\n\n  /*\n   * method to subtract one to the reference counter of the instance.\n   * Use if incrementReferenceCount has been called\n   */\n  public decrementReferenceCount() {\n    this._referenceCount--;\n    this._runtimeInstance?.decrementReferenceCount();\n  }\n\n  public get properties(): rc.ViewModelProperty[] {\n    return (\n      this._runtimeInstance?.getProperties().map((prop) => ({ ...prop })) || []\n    );\n  }\n\n  /**\n   * Get the name of the ViewModel definition this instance was created from.\n   */\n  public get viewModelName(): string {\n    return this._runtimeInstance?.getViewModelName() ?? \"\";\n  }\n\n  public internalIncrementReferenceCount() {\n    this._referenceCount++;\n  }\n\n  public cleanup() {\n    this._referenceCount--;\n    if (this._referenceCount <= 0) {\n      if (this.selfUnref) {\n        this._runtimeInstance?.unref();\n      }\n      this._runtimeInstance = null;\n      this.clearCallbacks();\n      this._propertiesWithCallbacks = [];\n      this._viewModelInstances.forEach((value) => {\n        value.cleanup();\n      });\n      this._viewModelInstances.clear();\n      const children = [...this._children];\n      this._children.length = 0;\n      const parents = [...this._parents];\n      this._parents.length = 0;\n      children.forEach((child) => {\n        child.removeParent(this);\n      });\n      parents.forEach((parent) => {\n        parent.removeFromViewModelCallbacks(this);\n      });\n    }\n  }\n}\n\nexport class ViewModelInstanceValue {\n  protected _parentViewModel: ViewModelInstance;\n  protected callbacks: EventCallback[] = [];\n  protected _viewModelInstanceValue: rc.ViewModelInstanceValue;\n  constructor(instance: rc.ViewModelInstanceValue, parent: ViewModelInstance) {\n    this._viewModelInstanceValue = instance;\n    this._parentViewModel = parent;\n  }\n\n  public on(callback: EventCallback) {\n    // Since we don't clean the changed flag for properties that don't have listeners,\n    // we clean it the first time we add a listener to it\n    if (this.callbacks.length === 0) {\n      this._viewModelInstanceValue.clearChanges();\n    }\n    if (!this.callbacks.includes(callback)) {\n      this.callbacks.push(callback);\n      this._parentViewModel.addToPropertyCallbacks(this);\n    }\n  }\n  public off(callback?: EventCallback) {\n    if (!callback) {\n      this.callbacks.length = 0;\n    } else {\n      this.callbacks = this.callbacks.filter((cb) => cb !== callback);\n    }\n    if (this.callbacks.length === 0) {\n      this._parentViewModel.removeFromPropertyCallbacks(this);\n    }\n  }\n  public internalHandleCallback(callback: Function) {}\n\n  public handleCallbacks() {\n    if (this._viewModelInstanceValue.hasChanged) {\n      this.callbacks.forEach((callback) => {\n        this.internalHandleCallback(callback);\n      });\n    }\n  }\n\n  public clearChanges() {\n    this._viewModelInstanceValue.clearChanges();\n  }\n\n  public clearCallbacks() {\n    this.callbacks.length = 0;\n  }\n\n  public get name() {\n    return this._viewModelInstanceValue.name;\n  }\n}\n\nexport class ViewModelInstanceString extends ViewModelInstanceValue {\n  constructor(instance: rc.ViewModelInstanceString, parent: ViewModelInstance) {\n    super(instance, parent);\n  }\n\n  public get value(): string {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceString).value;\n  }\n\n  public set value(val: string) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceString).value = val;\n  }\n  public internalHandleCallback(callback: Function) {\n    callback(this.value);\n  }\n}\n\nexport class ViewModelInstanceNumber extends ViewModelInstanceValue {\n  constructor(instance: rc.ViewModelInstanceNumber, parent: ViewModelInstance) {\n    super(instance, parent);\n  }\n\n  public get value(): number {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceNumber).value;\n  }\n\n  public set value(val: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceNumber).value = val;\n  }\n  public internalHandleCallback(callback: Function) {\n    callback(this.value);\n  }\n}\n\nexport class ViewModelInstanceBoolean extends ViewModelInstanceValue {\n  constructor(\n    instance: rc.ViewModelInstanceBoolean,\n    parent: ViewModelInstance,\n  ) {\n    super(instance, parent);\n  }\n\n  public get value(): boolean {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceBoolean).value;\n  }\n\n  public set value(val: boolean) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceBoolean).value = val;\n  }\n  public internalHandleCallback(callback: Function) {\n    callback(this.value);\n  }\n}\n\nexport class ViewModelInstanceTrigger extends ViewModelInstanceValue {\n  constructor(\n    instance: rc.ViewModelInstanceTrigger,\n    parent: ViewModelInstance,\n  ) {\n    super(instance, parent);\n  }\n\n  public trigger(): void {\n    return (\n      this._viewModelInstanceValue as rc.ViewModelInstanceTrigger\n    ).trigger();\n  }\n\n  public internalHandleCallback(callback: Function) {\n    callback();\n  }\n}\n\nexport class ViewModelInstanceEnum extends ViewModelInstanceValue {\n  constructor(instance: rc.ViewModelInstanceEnum, parent: ViewModelInstance) {\n    super(instance, parent);\n  }\n\n  public get value(): string {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).value;\n  }\n\n  public set value(val: string) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).value = val;\n  }\n\n  public set valueIndex(val: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).valueIndex = val;\n  }\n\n  public get valueIndex(): number {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum)\n      .valueIndex;\n  }\n\n  public get values(): string[] {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).values;\n  }\n\n  public internalHandleCallback(callback: Function) {\n    callback(this.value);\n  }\n}\n\nexport class ViewModelInstanceList extends ViewModelInstanceValue {\n  constructor(instance: rc.ViewModelInstanceList, parent: ViewModelInstance) {\n    super(instance, parent);\n  }\n\n  public get length(): number {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceList).size;\n  }\n\n  public addInstance(instance: ViewModelInstance) {\n    if (instance.runtimeInstance != null) {\n      (this._viewModelInstanceValue as rc.ViewModelInstanceList).addInstance(\n        instance.runtimeInstance!,\n      );\n      instance.addParent(this._parentViewModel);\n    }\n  }\n\n  public addInstanceAt(instance: ViewModelInstance, index: number): boolean {\n    if (instance.runtimeInstance != null) {\n      if (\n        (\n          this._viewModelInstanceValue as rc.ViewModelInstanceList\n        ).addInstanceAt(instance.runtimeInstance!, index)\n      ) {\n        instance.addParent(this._parentViewModel);\n        return true;\n      }\n    }\n    return false;\n  }\n\n  public removeInstance(instance: ViewModelInstance) {\n    if (instance.runtimeInstance != null) {\n      (this._viewModelInstanceValue as rc.ViewModelInstanceList).removeInstance(\n        instance.runtimeInstance!,\n      );\n      instance.removeParent(this._parentViewModel);\n    }\n  }\n\n  public removeInstanceAt(index: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceList).removeInstanceAt(\n      index,\n    );\n  }\n\n  public instanceAt(index: number): ViewModelInstance | null {\n    const runtimeInstance = (\n      this._viewModelInstanceValue as rc.ViewModelInstanceList\n    ).instanceAt(index);\n    if (runtimeInstance != null) {\n      const viewModelInstance = new ViewModelInstance(\n        runtimeInstance,\n        this._parentViewModel,\n      );\n      createFinalization(viewModelInstance, runtimeInstance);\n      return viewModelInstance;\n    }\n    return null;\n  }\n\n  public swap(a: number, b: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceList).swap(a, b);\n  }\n\n  public internalHandleCallback(callback: Function) {\n    callback();\n  }\n}\n\nexport class ViewModelInstanceColor extends ViewModelInstanceValue {\n  constructor(instance: rc.ViewModelInstanceColor, parent: ViewModelInstance) {\n    super(instance, parent);\n  }\n\n  public get value(): number {\n    return (this._viewModelInstanceValue as rc.ViewModelInstanceColor).value;\n  }\n\n  public set value(val: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceColor).value = val;\n  }\n\n  public rgb(r: number, g: number, b: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceColor).rgb(r, g, b);\n  }\n\n  public rgba(r: number, g: number, b: number, a: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceColor).argb(\n      a,\n      r,\n      g,\n      b,\n    );\n  }\n\n  public argb(a: number, r: number, g: number, b: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceColor).argb(\n      a,\n      r,\n      g,\n      b,\n    );\n  }\n\n  // Value 0 to 255\n  public alpha(a: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceColor).alpha(a);\n  }\n\n  // Value 0 to 1\n  public opacity(o: number) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceColor).alpha(\n      Math.round(Math.max(0, Math.min(1, o)) * 255),\n    );\n  }\n  public internalHandleCallback(callback: Function) {\n    callback(this.value);\n  }\n}\n\nexport class ViewModelInstanceAssetImage extends ViewModelInstanceValue {\n  constructor(\n    instance: rc.ViewModelInstanceAssetImage,\n    root: ViewModelInstance,\n  ) {\n    super(instance, root);\n  }\n\n  public set value(image: rc.Image | null) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceAssetImage).value(\n      image?.nativeImage ?? null,\n    );\n  }\n\n  public internalHandleCallback(callback: Function) {\n    callback();\n  }\n}\n\nexport class ViewModelInstanceAssetFont extends ViewModelInstanceValue {\n  constructor(\n    instance: rc.ViewModelInstanceAssetFont,\n    root: ViewModelInstance,\n  ) {\n    super(instance, root);\n  }\n\n  public set value(font: rc.Font | null) {\n    (this._viewModelInstanceValue as rc.ViewModelInstanceAssetFont).value(\n      font?.nativeFont ?? null,\n    );\n  }\n\n  public internalHandleCallback(callback: Function) {\n    callback();\n  }\n}\n\nexport class ViewModelInstanceArtboard extends ViewModelInstanceValue {\n  constructor(instance: rc.ViewModelInstanceArtboard, root: ViewModelInstance) {\n    super(instance, root);\n  }\n\n  public set value(artboard: BaseArtboard | null) {\n    let bindableArtboard: BindableArtboard;\n    if (artboard.isBindableArtboard) {\n      bindableArtboard = artboard as BindableArtboard;\n    } else {\n      bindableArtboard = (\n        artboard as Artboard\n      ).file.internalBindableArtboardFromArtboard(\n        (artboard as Artboard).nativeArtboard,\n      );\n    }\n    (this._viewModelInstanceValue as rc.ViewModelInstanceArtboard).value(\n      bindableArtboard?.nativeArtboard ?? null,\n    );\n    if (bindableArtboard?.nativeViewModel) {\n      (\n        this._viewModelInstanceValue as rc.ViewModelInstanceArtboard\n      ).viewModelInstance(bindableArtboard?.nativeViewModel ?? null);\n    }\n  }\n\n  public internalHandleCallback(callback: Function) {\n    callback();\n  }\n}\n\n/**\n * Contents of a state machine input\n */\ninterface StateMachineInputContents {\n  name: string;\n  type: StateMachineInputType;\n  initialValue?: boolean | number;\n}\n\n/**\n * Contents of a state machine\n */\ninterface StateMachineContents {\n  name: string;\n  inputs: StateMachineInputContents[];\n}\n\n/**\n * Contents of an artboard\n */\ninterface ArtboardContents {\n  animations: string[];\n  stateMachines: StateMachineContents[];\n  name: string;\n}\n\n/**\n * contents of a Rive file\n */\ninterface RiveFileContents {\n  artboards?: ArtboardContents[];\n}\n\n// Loads Rive data from a URI via fetch.\nconst loadRiveFile = async (src: string): Promise<ArrayBuffer> => {\n  const req = new Request(src);\n  const res = await fetch(req);\n  if (!res.ok) {\n    throw new Error(`Failed to fetch the Rive file: HTTP ${res.status}`);\n  }\n  const buffer = await res.arrayBuffer();\n  return buffer;\n};\n\n// #endregion\n\n// #region utility functions\n\n/*\n * Utility function to ensure an object is a string array\n */\nconst mapToStringArray = (obj?: string[] | string | undefined): string[] => {\n  if (typeof obj === \"string\") {\n    return [obj];\n  } else if (obj instanceof Array) {\n    return obj;\n  }\n  // If obj is undefined, return empty array\n  return [];\n};\n\n// #endregion\n\n// #region testing utilities\n\n// Exports to only be used for tests\nexport const Testing = {\n  EventManager: EventManager,\n  TaskQueueManager: TaskQueueManager,\n};\n\n// #endregion\n\n// #region asset loaders\n\n/**\n * Decodes bytes into an audio asset.\n *\n * Be sure to call `.unref()` on the audio once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeAudio = async (\n  bytes: Uint8Array,\n): Promise<AudioWrapper> => {\n  const decodedPromise = new Promise<rc.Audio>((resolve) =>\n    RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n      rive.decodeAudio(bytes, resolve, null);\n    }),\n  );\n  const audio: rc.Audio = await decodedPromise;\n  const audioWrapper = new AudioWrapper(audio);\n  finalizationRegistry.register(audioWrapper, audio);\n  return audioWrapper;\n};\n\n/**\n * Decodes bytes into an image.\n *\n * Be sure to call `.unref()` on the image once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeImage = async (\n  bytes: Uint8Array,\n): Promise<ImageWrapper> => {\n  // Immediate-typed on purpose, even for deferred files: the recorder routes\n  // images it didn't make through the session's ForeignImageRegistry at draw,\n  // so callers never need to know which mode their file imported in.\n  const decodedPromise = new Promise<rc.Image>((resolve) =>\n    RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n      rive.decodeImage(bytes, resolve, null);\n    }),\n  );\n  const image: rc.Image = await decodedPromise;\n  const imageWrapper = new ImageWrapper(image);\n  finalizationRegistry.register(imageWrapper, image);\n  return imageWrapper;\n};\n\n/**\n * Decodes bytes into a font.\n *\n * Be sure to call `.unref()` on the font once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeFont = async (\n  bytes: Uint8Array,\n): Promise<FontWrapper> => {\n  const decodedPromise = new Promise<rc.Font>((resolve) =>\n    RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n      rive.decodeFont(bytes, resolve, null);\n    }),\n  );\n  const font: rc.Font = await decodedPromise;\n  const fontWrapper = new FontWrapper(font);\n  finalizationRegistry.register(fontWrapper, font);\n  return fontWrapper;\n};\n\n// #endregion\n"]}