lido-player 0.0.2-beta-18-dev → 0.0.2-beta-21-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/{decode-DUZYNXIv.js → decode-Buln7Iaf.js} +1 -1
  3. package/dist/cjs/{index-BEjUmVtH.js → index-Bb_TFgTA.js} +137 -64
  4. package/dist/cjs/{index-DnqQXD5x.js → index-DBCFoh1I.js} +12 -53
  5. package/dist/cjs/index.cjs.js +2 -2
  6. package/dist/cjs/lido-avatar_22.cjs.entry.js +139 -50
  7. package/dist/cjs/lido-player.cjs.js +2 -2
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/collection-manifest.json +1 -1
  10. package/dist/collection/components/avatar/lido-avatar.css +4 -4
  11. package/dist/collection/components/avatar/lido-avatar.js +1 -1
  12. package/dist/collection/components/avatar/lido-avatar.tsx +207 -207
  13. package/dist/collection/components/avatar/readme.md +49 -49
  14. package/dist/collection/components/calculator/lido-calculator.css +89 -89
  15. package/dist/collection/components/calculator/lido-calculator.js +2 -2
  16. package/dist/collection/components/canvas/lido-canvas.css +33 -33
  17. package/dist/collection/components/canvas/lido-canvas.js +1 -1
  18. package/dist/collection/components/cell/lido-cell.css +100 -100
  19. package/dist/collection/components/cell/lido-cell.js +12 -12
  20. package/dist/collection/components/column/lido-col.css +19 -19
  21. package/dist/collection/components/column/lido-col.js +6 -6
  22. package/dist/collection/components/container/lido-container.css +10 -10
  23. package/dist/collection/components/container/lido-container.js +8 -8
  24. package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
  25. package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
  26. package/dist/collection/components/float/lido-float.css +30 -30
  27. package/dist/collection/components/float/lido-float.js +2 -2
  28. package/dist/collection/components/home/lido-home.css +309 -309
  29. package/dist/collection/components/home/lido-home.js +5 -5
  30. package/dist/collection/components/image/lido-image.css +17 -17
  31. package/dist/collection/components/image/lido-image.js +6 -6
  32. package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
  33. package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
  34. package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
  35. package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
  36. package/dist/collection/components/position/lido-pos.css +16 -16
  37. package/dist/collection/components/position/lido-pos.js +2 -2
  38. package/dist/collection/components/random/lido-random.css +8 -8
  39. package/dist/collection/components/random/lido-random.js +2 -2
  40. package/dist/collection/components/root/lido-root.js +5 -5
  41. package/dist/collection/components/row/lido-row.css +10 -10
  42. package/dist/collection/components/row/lido-row.js +6 -6
  43. package/dist/collection/components/scale/assets/Shadow.svg +9 -9
  44. package/dist/collection/components/scale/lido-balance.css +145 -145
  45. package/dist/collection/components/scale/lido-balance.js +13 -13
  46. package/dist/collection/components/shape/lido-shape.css +216 -216
  47. package/dist/collection/components/shape/lido-shape.js +6 -6
  48. package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
  49. package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
  50. package/dist/collection/components/text/lido-text.css +53 -53
  51. package/dist/collection/components/text/lido-text.js +5 -5
  52. package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
  53. package/dist/collection/components/trace/lido-trace.css +97 -97
  54. package/dist/collection/components/trace/lido-trace.js +108 -19
  55. package/dist/collection/components/wrap/lido-wrap.css +18 -18
  56. package/dist/collection/components/wrap/lido-wrap.js +6 -6
  57. package/dist/collection/css/animation.css +211 -211
  58. package/dist/collection/css/index.css +324 -315
  59. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
  60. package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
  61. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
  62. package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
  63. package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
  64. package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
  65. package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
  66. package/dist/collection/stories/Templates/blender/blender.stories.js +59 -59
  67. package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
  68. package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
  69. package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
  70. package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
  71. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +29 -29
  72. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
  73. package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
  74. package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
  75. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +43 -43
  76. package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
  77. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
  78. package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
  79. package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
  80. package/dist/collection/stories/Templates/imageMatch/imageMatch.stories.js +44 -44
  81. package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
  82. package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
  83. package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
  84. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
  85. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +84 -84
  86. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
  87. package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
  88. package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
  89. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +57 -57
  90. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
  91. package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
  92. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
  93. package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
  94. package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
  95. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
  96. package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
  97. package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
  98. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
  99. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
  100. package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
  101. package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
  102. package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
  103. package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
  104. package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
  105. package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
  106. package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
  107. package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
  108. package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
  109. package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
  110. package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
  111. package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
  112. package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
  113. package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
  114. package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
  115. package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
  116. package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
  117. package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
  118. package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
  119. package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
  120. package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
  121. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +58 -58
  122. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
  123. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
  124. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
  125. package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +631 -631
  126. package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
  127. package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
  128. package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
  129. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
  130. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
  131. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
  132. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
  133. package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
  134. package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
  135. package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +62 -62
  136. package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
  137. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
  138. package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
  139. package/dist/collection/stories/Templates/total/total.stories.js +28 -28
  140. package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
  141. package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
  142. package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
  143. package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
  144. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
  145. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
  146. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
  147. package/dist/collection/stories/components/flash-card.stories.js +48 -48
  148. package/dist/collection/stories/components/keyboard.stories.js +10 -10
  149. package/dist/collection/stories/components/slider.stories.js +4 -4
  150. package/dist/collection/stories/components/trace.stories.js +5 -5
  151. package/dist/collection/utils/audioPlayer.js +2 -5
  152. package/dist/collection/utils/utils.js +49 -9
  153. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +10 -10
  154. package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
  155. package/dist/collection/utils/utilsHandlers/sortHandler.js +53 -15
  156. package/dist/components/index.js +1 -1
  157. package/dist/components/lido-avatar.js +1 -1
  158. package/dist/components/lido-balance.js +1 -1
  159. package/dist/components/lido-calculator.js +1 -1
  160. package/dist/components/lido-canvas.js +1 -1
  161. package/dist/components/lido-cell.js +1 -1
  162. package/dist/components/lido-col.js +1 -1
  163. package/dist/components/lido-container.js +1 -1
  164. package/dist/components/lido-flash-card.js +1 -1
  165. package/dist/components/lido-float.js +1 -1
  166. package/dist/components/lido-home.js +1 -1
  167. package/dist/components/lido-keyboard.js +1 -1
  168. package/dist/components/lido-math-matrix.js +1 -1
  169. package/dist/components/lido-pos.js +1 -1
  170. package/dist/components/lido-random.js +1 -1
  171. package/dist/components/lido-root.js +1 -1
  172. package/dist/components/lido-row.js +1 -1
  173. package/dist/components/lido-shape.js +1 -1
  174. package/dist/components/lido-slide-fill.js +1 -1
  175. package/dist/components/lido-text.js +1 -1
  176. package/dist/components/lido-trace.js +1 -1
  177. package/dist/components/lido-wrap.js +1 -1
  178. package/dist/components/{p-yT7udDfd.js → p-B4YAipq-.js} +1 -1
  179. package/dist/components/{p-DdQ1eqJr.js → p-B8nzzM8c.js} +1 -1
  180. package/dist/components/p-BAfFgI9q.js +1 -0
  181. package/dist/components/{p-Sl9R-E6h.js → p-BBHM059l.js} +1 -1
  182. package/dist/components/{p-SPZTb5fI.js → p-BJMjg5wu.js} +1 -1
  183. package/dist/components/{p-Cj-6tqzU.js → p-BOQDbCrm.js} +1 -1
  184. package/dist/components/{p-CwDTdXe5.js → p-BeRr8u5m.js} +1 -1
  185. package/dist/components/{p-CjdDpXfk.js → p-BfqihbR6.js} +1 -1
  186. package/dist/components/{p-CPYnt0P-.js → p-C5WmmkI6.js} +1 -1
  187. package/dist/components/{p-useuhkjH.js → p-C70ykycD.js} +1 -1
  188. package/dist/components/{p-BE25wHoo.js → p-CCR42e0i.js} +1 -1
  189. package/dist/components/{p-BfwUqpXc.js → p-CTlcpv4a.js} +1 -1
  190. package/dist/components/{p-CyGxEcn7.js → p-CXHPZN3m.js} +1 -1
  191. package/dist/components/{p-Bw-OC9iR.js → p-CgsPIpg0.js} +1 -1
  192. package/dist/components/{p-D54c-ybm.js → p-CljvnHkI.js} +1 -1
  193. package/dist/components/p-CwIlwnQk.js +1 -0
  194. package/dist/components/p-DLyacZap.js +1 -0
  195. package/dist/components/p-DONbWJGn.js +1 -0
  196. package/dist/components/p-DVTigdH_.js +1 -0
  197. package/dist/components/{p-BNNX1Pew.js → p-wF7SBGpr.js} +2 -2
  198. package/dist/esm/{decode-BgBfbPZu.js → decode-B_VrYFdJ.js} +1 -1
  199. package/dist/esm/{index-D-29PaRa.js → index-B-VyHxJa.js} +137 -64
  200. package/dist/esm/{index-BeHFCsWf.js → index-mMpK8062.js} +12 -53
  201. package/dist/esm/index.js +2 -2
  202. package/dist/esm/lido-avatar_22.entry.js +139 -50
  203. package/dist/esm/lido-player.js +3 -3
  204. package/dist/esm/loader.js +2 -2
  205. package/dist/lido-player/assets/Shadow.svg +9 -9
  206. package/dist/lido-player/assets/Tracing-hand.svg +8 -8
  207. package/dist/lido-player/index.esm.js +1 -1
  208. package/dist/lido-player/lido-avatar.css +4 -4
  209. package/dist/lido-player/lido-avatar.tsx +207 -207
  210. package/dist/lido-player/lido-player.css +8 -8
  211. package/dist/lido-player/lido-player.esm.js +1 -1
  212. package/dist/lido-player/{p-856e1956.entry.js → p-744dee1c.entry.js} +2 -2
  213. package/dist/lido-player/p-BK926Rl3.js +1 -0
  214. package/dist/lido-player/{p-BA2X6O7O.js → p-Cw84dpIR.js} +1 -1
  215. package/dist/lido-player/p-mMpK8062.js +2 -0
  216. package/dist/lido-player/readme.md +49 -49
  217. package/dist/types/components/trace/lido-trace.d.ts +9 -1
  218. package/dist/types/stencil-public-runtime.d.ts +0 -12
  219. package/dist/types/types/json.d.ts +3 -3
  220. package/dist/types/utils/utils.d.ts +1 -1
  221. package/dist/types/utils/utilsHandlers/dragDropHandler.d.ts +1 -0
  222. package/dist/types/utils/utilsHandlers/sortHandler.d.ts +2 -0
  223. package/loader/index.d.ts +1 -1
  224. package/package.json +74 -74
  225. package/readme.md +113 -113
  226. package/dist/components/p-BSV5U72F.js +0 -1
  227. package/dist/components/p-CTlwn9r7.js +0 -1
  228. package/dist/components/p-D-B1groh.js +0 -1
  229. package/dist/components/p-DbR5sNOj.js +0 -1
  230. package/dist/components/p-leIEepjl.js +0 -1
  231. package/dist/lido-player/p-BeHFCsWf.js +0 -3
  232. package/dist/lido-player/p-TuBmCgtK.js +0 -1
@@ -1 +1 @@
1
- import{p as t,t as n,H as i,R as e,k as r,i as o,c as s,h as u,b as a}from"./index.js";var c,h,f={exports:{}},l=c?f.exports:(c=1,h=()=>(()=>{var t=[,(t,n,i)=>{i.r(n),i.d(n,{default:()=>o});var e,r=(e="undefined"!=typeof document?document.currentScript?.src:void 0,function(t={}){var n,i,r=t,o=new Promise(((t,e)=>{n=t,i=e})),s="object"==typeof window,u="function"==typeof importScripts;function a(){function t(t){const o=e;i=n=0,e=new Map,o.forEach((n=>{try{n(t)}catch(t){console.error(t)}})),this.nb(),r&&r.Pb()}let n=0,i=0,e=new Map,r=null,o=null;this.requestAnimationFrame=function(r){n||=requestAnimationFrame(t.bind(this));const o=++i;return e.set(o,r),o},this.cancelAnimationFrame=function(t){e.delete(t),n&&0==e.size&&(cancelAnimationFrame(n),n=0)},this.Nb=function(t){o&&(document.body.remove(o),o=null),t||(o=document.createElement("div"),o.style.backgroundColor="black",o.style.position="fixed",o.style.right=0,o.style.top=0,o.style.color="white",o.style.padding="4px",o.innerHTML="RIVE FPS",t=function(t){o.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(o)),r=new function(){let n=0,i=0;this.Pb=function(){var e=performance.now();i?(++n,1e3<(e-=i)&&(t(1e3*n/e),n=i=0)):(i=e,n=0)}}},this.Kb=function(){o&&(document.body.remove(o),o=null),r=null},this.nb=function(){}}function c(t){console.assert(!0);const n=new Map;let i=-1/0;this.push=function(e){return n.has(e=e+((1<<t)-1)>>t)&&clearTimeout(n.get(e)),n.set(e,setTimeout((function(){n.delete(e),0==n.length?i=-1/0:e==i&&(i=Math.max(...n.keys()),console.assert(i<e))}),1e3)),i=Math.max(e,i),i<<t}}const h=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){h&&h();let t=r.decodeAudio;r.decodeAudio=function(n,i){i(n=t(n))};let n=r.decodeFont;r.decodeFont=function(t,i){i(t=n(t))};const i=r.FileAssetLoader;r.ptrToAsset=t=>{let n=r.ptrToFileAsset(t);return n.isImage?r.ptrToImageAsset(t):n.isFont?r.ptrToFontAsset(t):n.isAudio?r.ptrToAudioAsset(t):n},r.CustomFileAssetLoader=i.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Db=t},loadContents:function(t,n){return t=r.ptrToAsset(t),this.Db(t,n)}}),r.CDNFileAssetLoader=i.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let n=r.ptrToAsset(t);return""!==(t=n.cdnUuid)&&(i=n.cdnBaseUrl+"/"+t,(e=new XMLHttpRequest).responseType="arraybuffer",e.onreadystatechange=function(){4==e.readyState&&200==e.status&&(t=>{n.decode(new Uint8Array(t.response))})(e)},e.open("GET",i,!0),e.send(null),!0);var i,e}}),r.FallbackFileAssetLoader=i.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.jb=[]},addLoader:function(t){this.jb.push(t)},loadContents:function(t,n){for(let i of this.jb)if(i.loadContents(t,n))return!0;return!1}});let e=r.computeAlignment;r.computeAlignment=function(t,n,i,r,o=1){return e.call(this,t,n,i,r,o)}};const f="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),l=new function(){function t(){if(!n){var t=document.createElement("canvas"),s={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let u;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(u=t.getContext("webgl",s),i=1,!u)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(u=t.getContext("webgl2",s))i=2;else{if(!(u=t.getContext("webgl",s)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;i=1}function c(t,n,i){if(n=u.createShader(n),u.shaderSource(n,i),u.compileShader(n),0<((i=u.getShaderInfoLog(n))||"").length)throw i;u.attachShader(t,n)}if(u=new Proxy(u,{get:(t,n)=>t.isContextLost()?(a||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",n),a=!0),"function"==typeof t[n]?function(){}:void 0):"function"==typeof t[n]?function(...i){return t[n].apply(t,i)}:t[n],set(t,n,i){if(!t.isContextLost())return t[n]=i,!0;a||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+n),a=!0)}}),e=Math.min(u.getParameter(u.MAX_RENDERBUFFER_SIZE),u.getParameter(u.MAX_TEXTURE_SIZE)),c(t=u.createProgram(),u.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 }"),c(t,u.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),u.bindAttribLocation(t,0,"vertex"),u.bindAttribLocation(t,1,"uv"),u.linkProgram(t),0<((s=u.getProgramInfoLog(t))||"").trim().length)throw s;r=u.getUniformLocation(t,"mat"),o=u.getUniformLocation(t,"translate"),u.useProgram(t),u.bindBuffer(u.ARRAY_BUFFER,u.createBuffer()),u.enableVertexAttribArray(0),u.enableVertexAttribArray(1),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,u.createBuffer()),u.uniform1i(u.getUniformLocation(t,"image"),0),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n=u}return!0}let n=null,i=0,e=0,r=null,o=null,s=0,u=0,a=!1;t(),this.ac=function(){return t(),e},this.Jb=function(t){n.deleteTexture&&n.deleteTexture(t)},this.Ib=function(e){if(!t())return null;const r=n.createTexture();return r?(n.bindTexture(n.TEXTURE_2D,r),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),2==i?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.generateMipmap(n.TEXTURE_2D)):n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),r):null};const h=new c(8),f=new c(8),l=new c(10),v=new c(10);this.Mb=function(i,e,a,c,d){if(t()){var w=h.push(i),b=f.push(e);if(n.canvas){for(var m of(n.canvas.width==w&&n.canvas.height==b||(n.canvas.width=w,n.canvas.height=b),n.viewport(0,b-e,i,e),n.disable(n.SCISSOR_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.SCISSOR_TEST),a.sort(((t,n)=>n.ub-t.ub)),w=l.push(c),s!=w&&(n.bufferData(n.ARRAY_BUFFER,8*w,n.DYNAMIC_DRAW),s=w),w=0,a))n.bufferSubData(n.ARRAY_BUFFER,w,m.Sa),w+=4*m.Sa.length;for(var p of(console.assert(w==4*c),a))n.bufferSubData(n.ARRAY_BUFFER,w,p.Ab),w+=4*p.Ab.length;for(var g of(console.assert(w==8*c),w=v.push(d),u!=w&&(n.bufferData(n.ELEMENT_ARRAY_BUFFER,2*w,n.DYNAMIC_DRAW),u=w),m=0,a))n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,m,g.indices),m+=2*g.indices.length;console.assert(m==2*d),g=0,p=!0,w=m=0;for(const t of a){t.image.Ia!=g&&(n.bindTexture(n.TEXTURE_2D,t.image.Ha||null),g=t.image.Ia),t.fc?(n.scissor(t.Ya,b-t.Za-t.ib,t.tc,t.ib),p=!0):p&&(n.scissor(0,b-e,i,e),p=!1);const s=-2/e;n.uniform4f(r,t.ga[0]*(a=2/i)*t.za,t.ga[1]*s*t.Aa,t.ga[2]*a*t.za,t.ga[3]*s*t.Aa),n.uniform2f(o,t.ga[4]*a*t.za+a*(t.Ya-t.bc*t.za)-1,t.ga[5]*s*t.Aa+s*(t.Za-t.cc*t.Aa)+1),n.vertexAttribPointer(0,2,n.FLOAT,!1,0,w),n.vertexAttribPointer(1,2,n.FLOAT,!1,0,w+4*c),n.drawElements(n.TRIANGLES,t.indices.length,n.UNSIGNED_SHORT,m),w+=4*t.Sa.length,m+=2*t.indices.length}console.assert(w==4*c),console.assert(m==2*d)}}},this.canvas=function(){return t()&&n.canvas}},v=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case d.srcOver:return"source-over";case d.screen:return"screen";case d.overlay:return"overlay";case d.darken:return"darken";case d.lighten:return"lighten";case d.colorDodge:return"color-dodge";case d.colorBurn:return"color-burn";case d.hardLight:return"hard-light";case d.softLight:return"soft-light";case d.difference:return"difference";case d.exclusion:return"exclusion";case d.multiply:return"multiply";case d.hue:return"hue";case d.saturation:return"saturation";case d.color:return"color";case d.luminosity:return"luminosity"}}function n(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function i(){0<O.length&&(l.Mb(A.drawWidth(),A.drawHeight(),O,M,k),O=[],k=M=0,A.reset(512,512));for(const t of j){for(const n of t.H)n();t.H=[]}j.clear()}v&&v();var e=r.RenderPaintStyle;const o=r.RenderPath,s=r.RenderPaint,u=r.Renderer,c=r.StrokeCap,h=r.StrokeJoin,d=r.BlendMode,w=e.fill,b=e.stroke,m=r.FillRule.evenOdd;let p=1;var g=r.RenderImage.extend("CanvasRenderImage",{__construct:function({ka:t,va:n}={}){this.__parent.__construct.call(this),this.Ia=p,p=p+1&2147483647||1,this.ka=t,this.va=n},__destruct:function(){this.Ha&&(l.Jb(this.Ha),URL.revokeObjectURL(this.Va)),this.__parent.__destruct.call(this)},decode:function(t){var n=this;n.va&&n.va(n);var i=new Image;n.Va=URL.createObjectURL(new Blob([t],{type:"image/png"})),i.onload=function(){n.Cb=i,n.Ha=l.Ib(i),n.size(i.width,i.height),n.ka&&n.ka(n)},i.src=n.Va}}),y=o.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,n,i,e,r,o,s){var u=this.T,a=u.addPath;t=t.T;const c=new DOMMatrix;c.a=n,c.b=i,c.c=e,c.d=r,c.e=o,c.f=s,a.call(u,t,c)},fillRule:function(t){this.Ua=t},moveTo:function(t,n){this.T.moveTo(t,n)},lineTo:function(t,n){this.T.lineTo(t,n)},cubicTo:function(t,n,i,e,r,o){this.T.bezierCurveTo(t,n,i,e,r,o)},close:function(){this.T.closePath()}}),_=s.extend("CanvasRenderPaint",{color:function(t){this.Wa=n(t)},thickness:function(t){this.Fb=t},join:function(t){switch(t){case h.miter:this.Ga="miter";break;case h.round:this.Ga="round";break;case h.bevel:this.Ga="bevel"}},cap:function(t){switch(t){case c.butt:this.Fa="butt";break;case c.round:this.Fa="round";break;case c.square:this.Fa="square"}},style:function(t){this.Eb=t},blendMode:function(n){this.Bb=t(n)},clearGradient:function(){this.ia=null},linearGradient:function(t,n,i,e){this.ia={wb:t,xb:n,bb:i,cb:e,Pa:[]}},radialGradient:function(t,n,i,e){this.ia={wb:t,xb:n,bb:i,cb:e,Pa:[],$b:!0}},addStop:function(t,n){this.ia.Pa.push({color:t,stop:n})},completeGradient:function(){},draw:function(t,i,e){let r=this.Eb;var o=this.Wa,s=this.ia;if(t.globalCompositeOperation=this.Bb,null!=s){o=s.wb;var u=s.xb;const i=s.bb;var a=s.cb;const e=s.Pa;s.$b?(s=i-o,a-=u,o=t.createRadialGradient(o,u,0,o,u,Math.sqrt(s*s+a*a))):o=t.createLinearGradient(o,u,i,a);for(let t=0,i=e.length;t<i;t++)o.addColorStop((u=e[t]).stop,n(u.color));this.Wa=o,this.ia=null}switch(r){case b:t.strokeStyle=o,t.lineWidth=this.Fb,t.lineCap=this.Fa,t.lineJoin=this.Ga,t.stroke(i);break;case w:t.fillStyle=o,t.fill(i,e)}}});const j=new Set;let A=null,O=[],M=0,k=0;var T=r.CanvasRenderer=u.extend("Renderer",{__construct:function(t){this.__parent.__construct.call(this),this.S=[1,0,0,1,0,0],this.B=t.getContext("2d"),this.Ta=t,this.H=[]},save:function(){this.S.push(...this.S.slice(this.S.length-6)),this.H.push(this.B.save.bind(this.B))},restore:function(){const t=this.S.length-6;if(6>t)throw"restore() called without matching save().";this.S.splice(t),this.H.push(this.B.restore.bind(this.B))},transform:function(t,n,i,e,r,o){const s=this.S,u=s.length-6;s.splice(u,6,s[u]*t+s[u+2]*n,s[u+1]*t+s[u+3]*n,s[u]*i+s[u+2]*e,s[u+1]*i+s[u+3]*e,s[u]*r+s[u+2]*o+s[u+4],s[u+1]*r+s[u+3]*o+s[u+5]),this.H.push(this.B.transform.bind(this.B,t,n,i,e,r,o))},rotate:function(t){const n=Math.sin(t);t=Math.cos(t),this.transform(t,n,-n,t,0,0)},_drawPath:function(t,n){this.H.push(n.draw.bind(n,this.B,t.T,t.Ua===m?"evenodd":"nonzero"))},_drawRiveImage:function(n,i,e,r){var o=n.Cb;if(o){var s=this.B,u=t(e);this.H.push((function(){s.globalCompositeOperation=u,s.globalAlpha=r,s.drawImage(o,0,0),s.globalAlpha=1}))}},_getMatrix:function(t){const n=this.S,i=n.length-6;for(let e=0;6>e;++e)t[e]=n[i+e]},_drawImageMesh:function(n,e,o,s,u,a,c,h,f,v,d){e=this.B.canvas.width;var w=this.B.canvas.height;const b=v-h,m=d-f;h=Math.max(h,0),f=Math.max(f,0),v=Math.min(v,e),d=Math.min(d,w);const p=v-h,g=d-f;if(console.assert(p<=Math.min(b,e)),console.assert(g<=Math.min(m,w)),!(0>=p||0>=g)){v=p<b||g<m,e=d=1;var y=Math.ceil(p*d),_=Math.ceil(g*e);w=l.ac(),y>w&&(d*=w/y,y=w),_>w&&(e*=w/_,_=w),A||(A=new r.DynamicRectanizer(w),A.reset(512,512)),0>(w=A.addRect(y,_))&&(i(),j.add(this),w=A.addRect(y,_),console.assert(0<=w));var T=65535&w,$=w>>16;O.push({ga:this.S.slice(this.S.length-6),image:n,Ya:T,Za:$,bc:h,cc:f,tc:y,ib:_,za:d,Aa:e,Sa:new Float32Array(u),Ab:new Float32Array(a),indices:new Uint16Array(c),fc:v,ub:n.Ia<<1|(v?1:0)}),M+=u.length,k+=c.length;var E=this.B,x=t(o);this.H.push((function(){E.save(),E.resetTransform(),E.globalCompositeOperation=x,E.globalAlpha=s;const t=l.canvas();t&&E.drawImage(t,T,$,y,_,h,f,p,g),E.restore()}))}},_clipPath:function(t){this.H.push(this.B.clip.bind(this.B,t.T,t.Ua===m?"evenodd":"nonzero"))},clear:function(){j.add(this),this.H.push(this.B.clearRect.bind(this.B,0,0,this.Ta.width,this.Ta.height))},flush:function(){},translate:function(t,n){this.transform(1,0,0,1,t,n)}});r.makeRenderer=function(t){const n=new T(t),i=n.B;return new Proxy(n,{get(t,e){if("function"==typeof t[e])return function(...n){return t[e].apply(t,n)};if("function"==typeof i[e]){if(-1<f.indexOf(e))throw Error("RiveException: Method call to '"+e+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...t){n.H.push(i[e].bind(i,...t))}}return t[e]},set(t,e,r){if(e in i)return n.H.push((()=>{i[e]=r})),!0}})},r.decodeImage=function(t,n){new g({ka:n}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new _},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=E;return new g({va:()=>{t.total++},ka:()=>{if(t.loaded++,t.loaded===t.total){const n=t.ready;n&&(n(),t.ready=null)}}})}};let $=r.load,E=null;r.load=function(t,n,i=!0){const e=new r.FallbackFileAssetLoader;return void 0!==n&&e.addLoader(n),i&&(n=new r.CDNFileAssetLoader,e.addLoader(n)),new Promise((function(n){let i=null;E={total:0,loaded:0,ready:function(){n(i)}},i=$(t,e),0==E.total&&n(i)}))};let x=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,n,i,e,r=1){x.call(this,t,n,i,e,r)},e=new a,r.requestAnimationFrame=e.requestAnimationFrame.bind(e),r.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),r.enableFPSCounter=e.Nb.bind(e),r.disableFPSCounter=e.Kb,e.nb=i,r.resolveAnimationFrame=i,r.cleanup=function(){A&&A.delete()}};var d,w,b=Object.assign({},r),m="./this.program",p="";(s||u)&&(u?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=p.startsWith("blob:")?"":p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),u&&(w=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),d=(t,n,i)=>{if(N(t)){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=()=>{200==e.status||0==e.status&&e.response?n(e.response):i()},e.onerror=i,e.send(null)}else fetch(t,{credentials:"same-origin"}).then((t=>t.ok?t.arrayBuffer():Promise.reject(Error(t.status+" : "+t.url)))).then(n,i)});var g,y=r.print||console.log.bind(console),_=r.printErr||console.error.bind(console);Object.assign(r,b),b=null,r.thisProgram&&(m=r.thisProgram),r.wasmBinary&&(g=r.wasmBinary);var j,A,O,M,k,T,$,E,x,P=!1;function C(){var t=j.buffer;r.HEAP8=A=new Int8Array(t),r.HEAP16=M=new Int16Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=k=new Uint16Array(t),r.HEAP32=T=new Int32Array(t),r.HEAPU32=$=new Uint32Array(t),r.HEAPF32=E=new Float32Array(t),r.HEAPF64=x=new Float64Array(t)}var F=[],I=[],S=[];function R(){var t=r.preRun.shift();F.unshift(t)}var W=0,L=null;function D(t){throw r.onAbort?.(t),_(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),i(t),t}var U,V=t=>t.startsWith("data:application/octet-stream;base64,"),N=t=>t.startsWith("file://");function z(t){if(t==U&&g)return new Uint8Array(g);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}function X(t,n,i){return function(t){return g?Promise.resolve().then((()=>z(t))):new Promise(((n,i)=>{d(t,(t=>n(new Uint8Array(t))),(()=>{try{n(z(t))}catch(t){i(t)}}))}))}(t).then((t=>WebAssembly.instantiate(t,n))).then(i,(t=>{_(`failed to asynchronously prepare wasm: ${t}`),D(t)}))}var G,H,Y={464256:(t,n,i,e,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={ya:0},window.h.I={},window.h.I.wa=t,window.h.I.capture=n,window.h.I.Ja=i,window.h.fa={},window.h.fa.stopped=e,window.h.fa.vb=r;let o=window.h;o.D=[],o.rc=function(t){for(var n=0;n<o.D.length;++n)if(null==o.D[n])return o.D[n]=t,n;return o.D.push(t),o.D.length-1},o.zb=function(t){for(o.D[t]=null;0<o.D.length&&null==o.D[o.D.length-1];)o.D.pop()},o.Oc=function(t){for(var n=0;n<o.D.length;++n)if(o.D[n]==t)return o.zb(n)},o.pa=function(t){return o.D[t]},o.Ra=["touchend","click"],o.unlock=function(){for(var t=0;t<o.D.length;++t){var n=o.D[t];null!=n&&null!=n.K&&n.state===o.fa.vb&&n.K.resume().then((()=>{$i(n.ob)}),(t=>{console.error("Failed to resume audiocontext",t)}))}o.Ra.map((function(t){document.removeEventListener(t,o.unlock,!0)}))},o.Ra.map((function(t){document.addEventListener(t,o.unlock,!0)}))}return window.h.ya+=1,1},466434:()=>{void 0!==window.h&&(window.h.Ra.map((function(t){document.removeEventListener(t,window.h.unlock,!0)})),--window.h.ya,0===window.h.ya&&delete window.h)},466738:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,466842:()=>{try{var t=new(window.AudioContext||window.webkitAudioContext),n=t.sampleRate;return t.close(),n}catch(t){return 0}},467013:(t,n,i,e,r,o)=>{if(void 0===window.h)return-1;var s={},u={};return t==window.h.I.wa&&0!=i&&(u.sampleRate=i),s.K=new(window.AudioContext||window.webkitAudioContext)(u),s.K.suspend(),s.state=window.h.fa.stopped,i=0,t!=window.h.I.wa&&(i=n),s.Y=s.K.createScriptProcessor(e,i,n),s.Y.onaudioprocess=function(i){if(null!=s.qa&&0!=s.qa.length||(s.qa=new Float32Array(E.buffer,r,e*n)),t==window.h.I.capture||t==window.h.I.Ja){for(var u=0;u<n;u+=1)for(var a=i.inputBuffer.getChannelData(u),c=s.qa,h=0;h<e;h+=1)c[h*n+u]=a[h];xi(o,e,r)}if(t==window.h.I.wa||t==window.h.I.Ja)for(Pi(o,e,r),u=0;u<i.outputBuffer.numberOfChannels;++u)for(a=i.outputBuffer.getChannelData(u),c=s.qa,h=0;h<e;h+=1)a[h]=c[h*n+u];else for(u=0;u<i.outputBuffer.numberOfChannels;++u)i.outputBuffer.getChannelData(u).fill(0)},t!=window.h.I.capture&&t!=window.h.I.Ja||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){s.Ba=s.K.createMediaStreamSource(t),s.Ba.connect(s.Y),s.Y.connect(s.K.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.wa&&s.Y.connect(s.K.destination),s.ob=o,window.h.rc(s)},469890:t=>window.h.pa(t).K.sampleRate,469963:t=>{void 0!==(t=window.h.pa(t)).Y&&(t.Y.onaudioprocess=function(){},t.Y.disconnect(),t.Y=void 0),void 0!==t.Ba&&(t.Ba.disconnect(),t.Ba=void 0),t.K.close(),t.K=void 0,t.ob=void 0},470363:t=>{window.h.zb(t)},470413:t=>{(t=window.h.pa(t)).K.resume(),t.state=window.h.fa.vb},470552:t=>{(t=window.h.pa(t)).K.suspend(),t.state=window.h.fa.stopped}},B=t=>{for(;0<t.length;)t.shift()(r)};function q(){var t=T[+tn>>2];return tn+=4,t}var J=(t,n)=>{for(var i=0,e=t.length-1;0<=e;e--){var r=t[e];"."===r?t.splice(e,1):".."===r?(t.splice(e,1),i++):i&&(t.splice(e,1),i--)}if(n)for(;i;i--)t.unshift("..");return t},Z=t=>{var n="/"===t.charAt(0),i="/"===t.substr(-1);return(t=J(t.split("/").filter((t=>!!t)),!n).join("/"))||n||(t="."),t&&i&&(t+="/"),(n?"/":"")+t},K=t=>{var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=n[0],n=n[1],t||n?(n&&=n.substr(0,n.length-1),t+n):"."},Q=t=>{if("/"===t)return"/";var n=(t=(t=Z(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===n?t:t.substr(n+1)},tt=t=>(tt=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);D("initRandomDevice")})())(t),nt=(...t)=>{for(var n="",i=!1,e=t.length-1;-1<=e&&!i;e--){if("string"!=typeof(i=0<=e?t[e]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";n=i+"/"+n,i="/"===i.charAt(0)}return(i?"/":"")+(n=J(n.split("/").filter((t=>!!t)),!i).join("/"))||"."},it="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,et=(t,n,i)=>{var e=n+i;for(i=n;t[i]&&!(i>=e);)++i;if(16<i-n&&t.buffer&&it)return it.decode(t.subarray(n,i));for(e="";n<i;){var r=t[n++];if(128&r){var o=63&t[n++];if(192==(224&r))e+=String.fromCharCode((31&r)<<6|o);else{var s=63&t[n++];65536>(r=224==(240&r)?(15&r)<<12|o<<6|s:(7&r)<<18|o<<12|s<<6|63&t[n++])?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else e+=String.fromCharCode(r)}return e},rt=[],ot=t=>{for(var n=0,i=0;i<t.length;++i){var e=t.charCodeAt(i);127>=e?n++:2047>=e?n+=2:55296<=e&&57343>=e?(n+=4,++i):n+=3}return n},st=(t,n,i,e)=>{if(!(0<e))return 0;var r=i;e=i+e-1;for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(i>=e)break;n[i++]=s}else{if(2047>=s){if(i+1>=e)break;n[i++]=192|s>>6}else{if(65535>=s){if(i+2>=e)break;n[i++]=224|s>>12}else{if(i+3>=e)break;n[i++]=240|s>>18,n[i++]=128|s>>12&63}n[i++]=128|s>>6&63}n[i++]=128|63&s}}return n[i]=0,i-r};function ut(t,n){var i=Array(ot(t)+1);return t=st(t,i,0,i.length),n&&(i.length=t),i}var at=[];function ct(t,n){at[t]={input:[],G:[],V:n},Wt(t,ht)}var ht={open(t){var n=at[t.node.xa];if(!n)throw new _t(43);t.s=n,t.seekable=!1},close(t){t.s.V.oa(t.s)},oa(t){t.s.V.oa(t.s)},read(t,n,i,e){if(!t.s||!t.s.V.hb)throw new _t(60);for(var r=0,o=0;o<e;o++){try{var s=t.s.V.hb(t.s)}catch(t){throw new _t(29)}if(void 0===s&&0===r)throw new _t(6);if(null==s)break;r++,n[i+o]=s}return r&&(t.node.timestamp=Date.now()),r},write(t,n,i,e){if(!t.s||!t.s.V.Ma)throw new _t(60);try{for(var r=0;r<e;r++)t.s.V.Ma(t.s,n[i+r])}catch(t){throw new _t(29)}return e&&(t.node.timestamp=Date.now()),r}},ft={hb(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n"),!t){t=null;break t}rt=ut(t,!0)}t=rt.shift()}return t},Ma(t,n){null===n||10===n?(y(et(t.G,0)),t.G=[]):0!=n&&t.G.push(n)},oa(t){t.G&&0<t.G.length&&(y(et(t.G,0)),t.G=[])},Xb:()=>({zc:25856,Bc:5,yc:191,Ac:35387,xc:[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]}),Yb:()=>0,Zb:()=>[24,80]},lt={Ma(t,n){null===n||10===n?(_(et(t.G,0)),t.G=[]):0!=n&&t.G.push(n)},oa(t){t.G&&0<t.G.length&&(_(et(t.G,0)),t.G=[])}};function vt(t,n){var i=t.l?t.l.length:0;i>=n||(n=Math.max(n,i*(1048576>i?2:1.125)>>>0),0!=i&&(n=Math.max(n,256)),i=t.l,t.l=new Uint8Array(n),0<t.v&&t.l.set(i.subarray(0,t.v),0))}var dt={N:null,U:()=>dt.createNode(null,"/",16895,0),createNode(t,n,i,e){if(24576==(61440&i)||4096==(61440&i))throw new _t(63);return dt.N||(dt.N={dir:{node:{X:dt.j.X,P:dt.j.P,ja:dt.j.ja,ta:dt.j.ta,sb:dt.j.sb,yb:dt.j.yb,tb:dt.j.tb,rb:dt.j.rb,Ca:dt.j.Ca},stream:{aa:dt.m.aa}},file:{node:{X:dt.j.X,P:dt.j.P},stream:{aa:dt.m.aa,read:dt.m.read,write:dt.m.write,Xa:dt.m.Xa,kb:dt.m.kb,mb:dt.m.mb}},link:{node:{X:dt.j.X,P:dt.j.P,la:dt.j.la},stream:{}},$a:{node:{X:dt.j.X,P:dt.j.P},stream:Rt}}),16384==(61440&(i=Et(t,n,i,e)).mode)?(i.j=dt.N.dir.node,i.m=dt.N.dir.stream,i.l={}):32768==(61440&i.mode)?(i.j=dt.N.file.node,i.m=dt.N.file.stream,i.v=0,i.l=null):40960==(61440&i.mode)?(i.j=dt.N.link.node,i.m=dt.N.link.stream):8192==(61440&i.mode)&&(i.j=dt.N.$a.node,i.m=dt.N.$a.stream),i.timestamp=Date.now(),t&&(t.l[n]=i,t.timestamp=i.timestamp),i},Fc:t=>t.l?t.l.subarray?t.l.subarray(0,t.v):new Uint8Array(t.l):new Uint8Array(0),j:{X(t){var n={};return n.Dc=8192==(61440&t.mode)?t.id:1,n.Hc=t.id,n.mode=t.mode,n.Kc=1,n.uid=0,n.Gc=0,n.xa=t.xa,n.size=16384==(61440&t.mode)?4096:32768==(61440&t.mode)?t.v:40960==(61440&t.mode)?t.link.length:0,n.vc=new Date(t.timestamp),n.Jc=new Date(t.timestamp),n.Cc=new Date(t.timestamp),n.Gb=4096,n.wc=Math.ceil(n.size/n.Gb),n},P(t,n){if(void 0!==n.mode&&(t.mode=n.mode),void 0!==n.timestamp&&(t.timestamp=n.timestamp),void 0!==n.size&&t.v!=(n=n.size))if(0==n)t.l=null,t.v=0;else{var i=t.l;t.l=new Uint8Array(n),i&&t.l.set(i.subarray(0,Math.min(n,t.v))),t.v=n}},ja(){throw jt[44]},ta:(t,n,i,e)=>dt.createNode(t,n,i,e),sb(t,n,i){if(16384==(61440&t.mode)){try{var e=$t(n,i)}catch(t){}if(e)for(var r in e.l)throw new _t(55)}delete t.parent.l[t.name],t.parent.timestamp=Date.now(),t.name=i,n.l[i]=t,n.timestamp=t.parent.timestamp},yb(t,n){delete t.l[n],t.timestamp=Date.now()},tb(t,n){var i,e=$t(t,n);for(i in e.l)throw new _t(55);delete t.l[n],t.timestamp=Date.now()},rb(t){var n,i=[".",".."];for(n of Object.keys(t.l))i.push(n);return i},Ca:(t,n,i)=>((t=dt.createNode(t,n,41471,0)).link=i,t),la(t){if(40960!=(61440&t.mode))throw new _t(28);return t.link}},m:{read(t,n,i,e,r){var o=t.node.l;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,e))&&o.subarray)n.set(o.subarray(r,r+t),i);else for(e=0;e<t;e++)n[i+e]=o[r+e];return t},write(t,n,i,e,r,o){if(n.buffer===A.buffer&&(o=!1),!e)return 0;if((t=t.node).timestamp=Date.now(),n.subarray&&(!t.l||t.l.subarray)){if(o)return t.l=n.subarray(i,i+e),t.v=e;if(0===t.v&&0===r)return t.l=n.slice(i,i+e),t.v=e;if(r+e<=t.v)return t.l.set(n.subarray(i,i+e),r),e}if(vt(t,r+e),t.l.subarray&&n.subarray)t.l.set(n.subarray(i,i+e),r);else for(o=0;o<e;o++)t.l[r+o]=n[i+o];return t.v=Math.max(t.v,r+e),e},aa(t,n,i){if(1===i?n+=t.position:2===i&&32768==(61440&t.node.mode)&&(n+=t.node.v),0>n)throw new _t(28);return n},Xa(t,n,i){vt(t.node,n+i),t.node.v=Math.max(t.node.v,n+i)},kb(t,n,i,e,r){if(32768!=(61440&t.node.mode))throw new _t(43);if(t=t.node.l,2&r||t.buffer!==A.buffer){if((0<i||i+n<t.length)&&(t=t.subarray?t.subarray(i,i+n):Array.prototype.slice.call(t,i,i+n)),i=!0,D(),!(n=void 0))throw new _t(48);A.set(t,n)}else i=!1,n=t.byteOffset;return{o:n,uc:i}},mb:(t,n,i,e)=>(dt.m.write(t,n,0,e,i,!1),0)}},wt=null,bt={},mt=[],pt=1,gt=null,yt=!0,_t=class{constructor(t){this.name="ErrnoError",this.$=t}},jt={},At=class{constructor(){this.h={},this.node=null}get flags(){return this.h.flags}set flags(t){this.h.flags=t}get position(){return this.h.position}set position(t){this.h.position=t}},Ot=class{constructor(t,n,i,e){t||=this,this.parent=t,this.U=t.U,this.ua=null,this.id=pt++,this.name=n,this.mode=i,this.j={},this.m={},this.xa=e}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}};function Mt(t,n={}){if(!(t=nt(t)))return{path:"",node:null};if(8<(n=Object.assign({gb:!0,Oa:0},n)).Oa)throw new _t(32);t=t.split("/").filter((t=>!!t));for(var i=wt,e="/",r=0;r<t.length;r++){var o=r===t.length-1;if(o&&n.parent)break;if(i=$t(i,t[r]),e=Z(e+"/"+t[r]),i.ua&&(!o||o&&n.gb)&&(i=i.ua.root),!o||n.fb)for(o=0;40960==(61440&i.mode);)if(i=zt(e),i=Mt(e=nt(K(e),i),{Oa:n.Oa+1}).node,40<o++)throw new _t(32)}return{path:e,node:i}}function kt(t){for(var n;;){if(t===t.parent)return t=t.U.lb,n?"/"!==t[t.length-1]?`${t}/${n}`:t+n:t;n=n?`${t.name}/${n}`:t.name,t=t.parent}}function Tt(t,n){for(var i=0,e=0;e<n.length;e++)i=(i<<5)-i+n.charCodeAt(e)|0;return(t+i>>>0)%gt.length}function $t(t,n){var i=16384==(61440&t.mode)?(i=Pt(t,"x"))?i:t.j.ja?0:2:54;if(i)throw new _t(i);for(i=gt[Tt(t.id,n)];i;i=i.ec)if(i.parent.id===t.id&&i.name===n)return i;return t.j.ja(t,n)}function Et(t,n,i,e){return n=Tt((t=new Ot(t,n,i,e)).parent.id,t.name),t.ec=gt[n],gt[n]=t}function xt(t){var n=["r","w","rw"][3&t];return 512&t&&(n+="w"),n}function Pt(t,n){return yt?0:!n.includes("r")||292&t.mode?n.includes("w")&&!(146&t.mode)||n.includes("x")&&!(73&t.mode)?2:0:2}function Ct(t,n){try{return $t(t,n),20}catch(t){}return Pt(t,"wx")}function Ft(t){if(!(t=mt[t]))throw new _t(8);return t}function It(t,n=-1){if(t=Object.assign(new At,t),-1==n)t:{for(n=0;4096>=n;n++)if(!mt[n])break t;throw new _t(33)}return t.W=n,mt[n]=t}var St,Rt={open(t){t.m=bt[t.node.xa].m,t.m.open?.(t)},aa(){throw new _t(70)}};function Wt(t,n){bt[t]={m:n}}function Lt(t,n){var i="/"===n;if(i&&wt)throw new _t(10);if(!i&&n){var e=Mt(n,{gb:!1});if(n=e.path,(e=e.node).ua)throw new _t(10);if(16384!=(61440&e.mode))throw new _t(54)}(t=t.U(n={type:t,Mc:{},lb:n,dc:[]})).U=n,n.root=t,i?wt=t:e&&(e.ua=n,e.U&&e.U.dc.push(n))}function Dt(t,n,i){var e=Mt(t,{parent:!0}).node;if(!(t=Q(t))||"."===t||".."===t)throw new _t(28);var r=Ct(e,t);if(r)throw new _t(r);if(!e.j.ta)throw new _t(63);return e.j.ta(e,t,n,i)}function Ut(t){return Dt(t,16895,0)}function Vt(t,n,i){void 0===i&&(i=n,n=438),Dt(t,8192|n,i)}function Nt(t,n){if(!nt(t))throw new _t(44);var i=Mt(n,{parent:!0}).node;if(!i)throw new _t(44);var e=Ct(i,n=Q(n));if(e)throw new _t(e);if(!i.j.Ca)throw new _t(63);i.j.Ca(i,n,t)}function zt(t){if(!(t=Mt(t).node))throw new _t(44);if(!t.j.la)throw new _t(28);return nt(kt(t.parent),t.j.la(t))}function Xt(t,n,i){if(""===t)throw new _t(44);if("string"==typeof n){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[n];if(void 0===e)throw Error(`Unknown file open mode: ${n}`);n=e}if(i=64&n?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)var o=t;else{t=Z(t);try{o=Mt(t,{fb:!(131072&n)}).node}catch(t){}}if(e=!1,64&n)if(o){if(128&n)throw new _t(20)}else o=Dt(t,i,0),e=!0;if(!o)throw new _t(44);if(8192==(61440&o.mode)&&(n&=-513),65536&n&&16384!=(61440&o.mode))throw new _t(54);if(!e&&(i=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==xt(n)||512&n)?31:Pt(o,xt(n)):44))throw new _t(i);if(512&n&&!e){if(!(i="string"==typeof(i=o)?Mt(i,{fb:!0}).node:i).j.P)throw new _t(63);if(16384==(61440&i.mode))throw new _t(31);if(32768!=(61440&i.mode))throw new _t(28);if(e=Pt(i,"w"))throw new _t(e);i.j.P(i,{size:0,timestamp:Date.now()})}return n&=-131713,(o=It({node:o,path:kt(o),flags:n,seekable:!0,position:0,m:o.m,sc:[],error:!1})).m.open&&o.m.open(o),!r.logReadFiles||1&n||(Bt||={},t in Bt||(Bt[t]=1)),o}function Gt(t,n,i){if(null===t.W)throw new _t(8);if(!t.seekable||!t.m.aa)throw new _t(70);if(0!=i&&1!=i&&2!=i)throw new _t(28);t.position=t.m.aa(t,n,i),t.sc=[]}function Ht(t,n,i){t=Z("/dev/"+t);var e=((t,n)=>{var i=0;return t&&(i|=365),n&&(i|=146),i})(!!n,!!i);Yt||=64;var r=Yt++<<8;Wt(r,{open(t){t.seekable=!1},close(){i?.buffer?.length&&i(10)},read(t,i,e,r){for(var o=0,s=0;s<r;s++){try{var u=n()}catch(t){throw new _t(29)}if(void 0===u&&0===o)throw new _t(6);if(null==u)break;o++,i[e+s]=u}return o&&(t.node.timestamp=Date.now()),o},write(t,n,e,r){for(var o=0;o<r;o++)try{i(n[e+o])}catch(t){throw new _t(29)}return r&&(t.node.timestamp=Date.now()),o}}),Vt(t,e,r)}var Yt,Bt,qt,Jt,Zt,Kt,Qt,tn=void 0,nn=(t,n)=>Object.defineProperty(n,"name",{value:t}),en=[],rn=[],on=t=>{if(!t)throw new qt("Cannot use deleted val. handle = "+t);return rn[t]},sn=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const n=en.pop()||rn.length;return rn[n]=t,rn[n+1]=1,n}},un=t=>{var n=Error,i=nn(t,(function(n){this.name=t,this.message=n,void 0!==(n=Error(n).stack)&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},i},an=t=>{for(var n="";O[t];)n+=Zt[O[t++]];return n},cn=[],hn=()=>{for(;cn.length;){var t=cn.pop();t.g.ea=!1,t.delete()}},fn={},ln=(t,n)=>{if(void 0===n)throw new qt("ptr should not be undefined");for(;t.C;)n=t.ma(n),t=t.C;return n},vn={},dn=t=>{t=Ti(t);var n=an(t);return Mi(t),n},wn=(t,n)=>{var i=vn[t];if(void 0===i)throw t=`${n} has unknown type ${dn(t)}`,new qt(t);return i},bn=()=>{},mn=!1,pn=(t,n,i)=>n===i?t:void 0===i.C||null===(t=pn(t,n,i.C))?null:i.Lb(t),gn={},yn=(t,n)=>{if(!n.u||!n.o)throw new Qt("makeClassHandle requires ptr and ptrType");if(!!n.J!=!!n.F)throw new Qt("Both smartPtrType and smartPtr must be specified");return n.count={value:1},_n(Object.create(t,{g:{value:n,writable:!0}}))},_n=t=>"undefined"==typeof FinalizationRegistry?(_n=t=>t,t):(mn=new FinalizationRegistry((t=>{--(t=t.g).count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o))})),bn=t=>{mn.unregister(t)},(_n=t=>{var n=t.g;return n.F&&mn.register(t,{g:n},t),t})(t)),jn={},An=t=>{for(;t.length;){var n=t.pop();t.pop()(n)}};function On(t){return this.fromWireType($[t>>2])}var Mn={},kn={},Tn=(t,n,i)=>{function e(n){if((n=i(n)).length!==t.length)throw new Qt("Mismatched type converter count");for(var e=0;e<t.length;++e)$n(t[e],n[e])}t.forEach((function(t){kn[t]=n}));var r=Array(n.length),o=[],s=0;n.forEach(((t,n)=>{vn.hasOwnProperty(t)?r[n]=vn[t]:(o.push(t),Mn.hasOwnProperty(t)||(Mn[t]=[]),Mn[t].push((()=>{r[n]=vn[t],++s===o.length&&e(r)})))})),0===o.length&&e(r)};function $n(t,n,i={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,n,i={}){var e=n.name;if(!t)throw new qt(`type "${e}" must have a positive integer typeid pointer`);if(vn.hasOwnProperty(t)){if(i.Vb)return;throw new qt(`Cannot register type '${e}' twice`)}vn[t]=n,delete kn[t],Mn.hasOwnProperty(t)&&(n=Mn[t],delete Mn[t],n.forEach((t=>t())))}(t,n,i)}var En=t=>{throw new qt(t.g.u.i.name+" instance already deleted")};function xn(){}var Pn=(t,n,i)=>{if(void 0===t[n].A){var e=t[n];t[n]=function(...e){if(!t[n].A.hasOwnProperty(e.length))throw new qt(`Function '${i}' called with an invalid number of arguments (${e.length}) - expects one of (${t[n].A})!`);return t[n].A[e.length].apply(this,e)},t[n].A=[],t[n].A[e.da]=e}},Cn=(t,n,i)=>{if(r.hasOwnProperty(t)){if(void 0===i||void 0!==r[t].A&&void 0!==r[t].A[i])throw new qt(`Cannot register public name '${t}' twice`);if(Pn(r,t,t),r.hasOwnProperty(i))throw new qt(`Cannot register multiple overloads of a function with the same number of arguments (${i})!`);r[t].A[i]=n}else r[t]=n,void 0!==i&&(r[t].Lc=i)};function Fn(t,n,i,e,r,o,s,u){this.name=t,this.constructor=n,this.M=i,this.O=e,this.C=r,this.Qb=o,this.ma=s,this.Lb=u,this.pb=[]}var In=(t,n,i)=>{for(;n!==i;){if(!n.ma)throw new qt(`Expected null or instance of ${i.name}, got an instance of ${n.name}`);t=n.ma(t),n=n.C}return t};function Sn(t,n){if(null===n){if(this.La)throw new qt(`null is not a valid ${this.name}`);return 0}if(!n.g)throw new qt(`Cannot pass "${ti(n)}" as a ${this.name}`);if(!n.g.o)throw new qt(`Cannot pass deleted object as a pointer of type ${this.name}`);return In(n.g.o,n.g.u.i,this.i)}function Rn(t,n){if(null===n){if(this.La)throw new qt(`null is not a valid ${this.name}`);if(this.sa){var i=this.Na();return null!==t&&t.push(this.O,i),i}return 0}if(!n||!n.g)throw new qt(`Cannot pass "${ti(n)}" as a ${this.name}`);if(!n.g.o)throw new qt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ra&&n.g.u.ra)throw new qt(`Cannot convert argument of type ${n.g.J?n.g.J.name:n.g.u.name} to parameter type ${this.name}`);if(i=In(n.g.o,n.g.u.i,this.i),this.sa){if(void 0===n.g.F)throw new qt("Passing raw pointer to smart pointer is illegal");switch(this.mc){case 0:if(n.g.J!==this)throw new qt(`Cannot convert argument of type ${n.g.J?n.g.J.name:n.g.u.name} to parameter type ${this.name}`);i=n.g.F;break;case 1:i=n.g.F;break;case 2:if(n.g.J===this)i=n.g.F;else{var e=n.clone();i=this.ic(i,sn((()=>e.delete()))),null!==t&&t.push(this.O,i)}break;default:throw new qt("Unsupporting sharing policy")}}return i}function Wn(t,n){if(null===n){if(this.La)throw new qt(`null is not a valid ${this.name}`);return 0}if(!n.g)throw new qt(`Cannot pass "${ti(n)}" as a ${this.name}`);if(!n.g.o)throw new qt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(n.g.u.ra)throw new qt(`Cannot convert argument of type ${n.g.u.name} to parameter type ${this.name}`);return In(n.g.o,n.g.u.i,this.i)}function Ln(t,n,i,e,r,o,s,u,a,c,h){this.name=t,this.i=n,this.La=i,this.ra=e,this.sa=r,this.hc=o,this.mc=s,this.qb=u,this.Na=a,this.ic=c,this.O=h,r||void 0!==n.C?this.toWireType=Rn:(this.toWireType=e?Sn:Wn,this.L=null)}var Dn,Un,Vn=(t,n,i)=>{if(!r.hasOwnProperty(t))throw new Qt("Replacing nonexistent public symbol");void 0!==r[t].A&&void 0!==i?r[t].A[i]=n:(r[t]=n,r[t].da=i)},Nn=[],zn=t=>{var n=Nn[t];return n||(t>=Nn.length&&(Nn.length=t+1),Nn[t]=n=Dn.get(t)),n},Xn=(t,n)=>{var i=(t=an(t)).includes("j")?((t,n)=>(...i)=>((t,n,i=[])=>(t.includes("j")?(t=t.replace(/p/g,"i"),n=(0,r["dynCall_"+t])(n,...i)):n=zn(n)(...i),n))(t,n,i))(t,n):zn(n);if("function"!=typeof i)throw new qt(`unknown function pointer with signature ${t}: ${n}`);return i},Gn=(t,n)=>{var i=[],e={};throw n.forEach((function t(n){e[n]||vn[n]||(kn[n]?kn[n].forEach(t):(i.push(n),e[n]=!0))})),new Un(`${t}: `+i.map(dn).join([", "]))};function Hn(t,n,i,e,r){var o=n.length;if(2>o)throw new qt("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==n[1]&&null!==i,u=function(t){for(var n=1;n<t.length;++n)if(null!==t[n]&&void 0===t[n].L)return!0;return!1}(n),a="void"!==n[0].name,c=o-2,h=Array(c),f=[],l=[];return nn(t,(function(...i){if(i.length!==c)throw new qt(`function ${t} called with ${i.length} arguments, expected ${c}`);if(l.length=0,f.length=s?2:1,f[0]=r,s){var o=n[1].toWireType(l,this);f[1]=o}for(var v=0;v<c;++v)h[v]=n[v+2].toWireType(l,i[v]),f.push(h[v]);if(i=e(...f),u)An(l);else for(v=s?1:2;v<n.length;v++)null!==n[v].L&&n[v].L(1===v?o:h[v-2]);return a?n[0].fromWireType(i):void 0}))}var Yn,Bn=(t,n)=>{for(var i=[],e=0;e<t;e++)i.push($[n+4*e>>2]);return i},qn=t=>{const n=(t=t.trim()).indexOf("(");return-1!==n?t.substr(0,n):t},Jn=(t,n,i)=>{if(!(t instanceof Object))throw new qt(`${i} with invalid "this": ${t}`);if(!(t instanceof n.i.constructor))throw new qt(`${i} incompatible with "this" of type ${t.constructor.name}`);if(!t.g.o)throw new qt(`cannot call emscripten binding method ${i} on deleted object`);return In(t.g.o,t.g.u.i,n.i)},Zn=t=>{9<t&&0==--rn[t+1]&&(rn[t]=void 0,en.push(t))},Kn={name:"emscripten::val",fromWireType:t=>{var n=on(t);return Zn(t),n},toWireType:(t,n)=>sn(n),argPackAdvance:8,readValueFromPointer:On,L:null},Qn=(t,n,i)=>{switch(n){case 1:return i?function(t){return this.fromWireType(A[t])}:function(t){return this.fromWireType(O[t])};case 2:return i?function(t){return this.fromWireType(M[t>>1])}:function(t){return this.fromWireType(k[t>>1])};case 4:return i?function(t){return this.fromWireType(T[t>>2])}:function(t){return this.fromWireType($[t>>2])};default:throw new TypeError(`invalid integer width (${n}): ${t}`)}},ti=t=>{if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t},ni=(t,n)=>{switch(n){case 4:return function(t){return this.fromWireType(E[t>>2])};case 8:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError(`invalid float width (${n}): ${t}`)}},ii=(t,n,i)=>{switch(n){case 1:return i?t=>A[t]:t=>O[t];case 2:return i?t=>M[t>>1]:t=>k[t>>1];case 4:return i?t=>T[t>>2]:t=>$[t>>2];default:throw new TypeError(`invalid integer width (${n}): ${t}`)}},ei="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ri=(t,n)=>{for(var i=t>>1,e=i+n/2;!(i>=e)&&k[i];)++i;if(32<(i<<=1)-t&&ei)return ei.decode(O.subarray(t,i));for(i="",e=0;!(e>=n/2);++e){var r=M[t+2*e>>1];if(0==r)break;i+=String.fromCharCode(r)}return i},oi=(t,n,i)=>{if(i??=2147483647,2>i)return 0;var e=n;i=(i-=2)<2*t.length?i/2:t.length;for(var r=0;r<i;++r)M[n>>1]=t.charCodeAt(r),n+=2;return M[n>>1]=0,n-e},si=t=>2*t.length,ui=(t,n)=>{for(var i=0,e="";!(i>=n/4);){var r=T[t+4*i>>2];if(0==r)break;++i,65536<=r?(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=String.fromCharCode(r)}return e},ai=(t,n,i)=>{if(i??=2147483647,4>i)return 0;var e=n;i=e+i-4;for(var r=0;r<t.length;++r){var o=t.charCodeAt(r);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++r)),T[n>>2]=o,(n+=4)+4>i)break}return T[n>>2]=0,n-e},ci=t=>{for(var n=0,i=0;i<t.length;++i){var e=t.charCodeAt(i);55296<=e&&57343>=e&&++i,n+=4}return n},hi=(t,n,i)=>{var e=[];return t=t.toWireType(e,i),e.length&&($[n>>2]=sn(e)),t},fi={},li=t=>{var n=fi[t];return void 0===n?an(t):n},vi=[],di=Reflect.construct,wi=[],bi={},mi=()=>{if(!Yn){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in bi)void 0===bi[t]?delete n[t]:n[t]=bi[t];var i=[];for(t in n)i.push(`${t}=${n[t]}`);Yn=i}return Yn},pi=t=>0==t%4&&(0!=t%100||0==t%400),gi=[31,29,31,30,31,30,31,31,30,31,30,31],yi=[31,28,31,30,31,30,31,31,30,31,30,31];[44].forEach((t=>{jt[t]=new _t(t),jt[t].stack="<generic error, no stack>"})),gt=Array(4096),Lt(dt,"/"),Ut("/tmp"),Ut("/home"),Ut("/home/web_user"),function(){Ut("/dev"),Wt(259,{read:()=>0,write:(t,n,i,e)=>e}),Vt("/dev/null",259),ct(1280,ft),ct(1536,lt),Vt("/dev/tty",1280),Vt("/dev/tty1",1536);var t=new Uint8Array(1024),n=0,i=()=>(0===n&&(n=tt(t).byteLength),t[--n]);Ht("random",i),Ht("urandom",i),Ut("/dev/shm"),Ut("/dev/shm/tmp")}(),function(){Ut("/proc");var t=Ut("/proc/self");Ut("/proc/self/fd"),Lt({U(){var n=Et(t,"fd",16895,73);return n.j={ja(t,n){var i=Ft(+n);return(t={parent:null,U:{lb:"fake"},j:{la:()=>i.path}}).parent=t}},n}},"/proc/self/fd")}(),qt=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},rn.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>rn.length/2-5-en.length,Jt=r.PureVirtualError=un("PureVirtualError");for(var _i=Array(256),ji=0;256>ji;++ji)_i[ji]=String.fromCharCode(ji);Zt=_i,r.getInheritedInstanceCount=()=>Object.keys(fn).length,r.getLiveInheritedInstances=()=>{var t,n=[];for(t in fn)fn.hasOwnProperty(t)&&n.push(fn[t]);return n},r.flushPendingDeletes=hn,r.setDelayFunction=t=>{Kt=t,cn.length&&Kt&&Kt(hn)},Qt=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(xn.prototype,{isAliasOf:function(t){if(!(this instanceof xn&&t instanceof xn))return!1;var n=this.g.u.i,i=this.g.o;t.g=t.g;var e=t.g.u.i;for(t=t.g.o;n.C;)i=n.ma(i),n=n.C;for(;e.C;)t=e.ma(t),e=e.C;return n===e&&i===t},clone:function(){if(this.g.o||En(this),this.g.ha)return this.g.count.value+=1,this;var t=_n,n=Object,i=n.create,e=Object.getPrototypeOf(this),r=this.g;return(t=t(i.call(n,e,{g:{value:{count:r.count,ea:r.ea,ha:r.ha,o:r.o,u:r.u,F:r.F,J:r.J}}}))).g.count.value+=1,t.g.ea=!1,t},delete(){if(this.g.o||En(this),this.g.ea&&!this.g.ha)throw new qt("Object already scheduled for deletion");bn(this);var t=this.g;--t.count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o)),this.g.ha||(this.g.F=void 0,this.g.o=void 0)},isDeleted:function(){return!this.g.o},deleteLater:function(){if(this.g.o||En(this),this.g.ea&&!this.g.ha)throw new qt("Object already scheduled for deletion");return cn.push(this),1===cn.length&&Kt&&Kt(hn),this.g.ea=!0,this}}),Object.assign(Ln.prototype,{Rb(t){return this.qb&&(t=this.qb(t)),t},ab(t){this.O?.(t)},argPackAdvance:8,readValueFromPointer:On,fromWireType:function(t){function n(){return yn(this.i.M,this.sa?{u:this.hc,o:i,J:this,F:t}:{u:this,o:t})}var i=this.Rb(t);if(!i)return this.ab(t),null;var e=((t,n)=>(n=ln(this.i,n),fn[n]))(0,i);if(void 0!==e)return 0===e.g.count.value?(e.g.o=i,e.g.F=t,e.clone()):(e=e.clone(),this.ab(t),e);if(e=this.i.Qb(i),!(e=gn[e]))return n.call(this);var r=pn(i,this.i,(e=this.ra?e.Hb:e.pointerType).i);return null===r?n.call(this):yn(e.i.M,this.sa?{u:e,o:r,J:this,F:t}:{u:e,o:r})}}),Un=r.UnboundTypeError=un("UnboundTypeError");var Ai={__syscall_fcntl64:function(t,n,i){tn=i;try{var e=Ft(t);switch(n){case 0:var r=q();if(0>r)break;for(;mt[r];)r++;return function(t,n=-1){return t=It(t,n),t.m?.Ec?.(t),t}(e,r).W;case 1:case 2:case 13:case 14:return 0;case 3:return e.flags;case 4:return r=q(),e.flags|=r,0;case 12:return r=q(),M[r+0>>1]=2,0}return-28}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_ioctl:function(t,n,i){tn=i;try{var e=Ft(t);switch(n){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return e.s?0:-59;case 21505:if(!e.s)return-59;if(e.s.V.Xb){t=[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 r=q();T[r>>2]=25856,T[r+4>>2]=5,T[r+8>>2]=191,T[r+12>>2]=35387;for(var o=0;32>o;o++)A[r+o+17]=t[o]||0}return 0;case 21506:case 21507:case 21508:if(!e.s)return-59;if(e.s.V.Yb)for(r=q(),t=[],o=0;32>o;o++)t.push(A[r+o+17]);return 0;case 21519:return e.s?(r=q(),T[r>>2]=0):-59;case 21520:return e.s?-28:-59;case 21531:if(r=q(),!e.m.Wb)throw new _t(59);return e.m.Wb(e,n,r);case 21523:return e.s?(e.s.V.Zb&&(o=[24,80],r=q(),M[r>>1]=o[0],M[r+2>>1]=o[1]),0):-59;default:return-28}}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_openat:function(t,n,i,e){tn=e;try{var r=n=n?et(O,n):"";if("/"===r.charAt(0))n=r;else{var o=-100===t?"/":Ft(t).path;if(0==r.length)throw new _t(44);n=Z(o+"/"+r)}return Xt(n,i,e?q():0).W}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},_abort_js:()=>{D("")},_embind_create_inheriting_constructor:(t,n,i)=>{t=an(t),n=wn(n,"wrapper"),i=on(i);var e=n.i,r=e.M,o=e.C.M,s=e.C.constructor;return t=nn(t,(function(...t){e.C.pb.forEach(function(t){if(this[t]===o[t])throw new Jt(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:r}),this.__construct(...t)})),r.__construct=function(...t){if(this===r)throw new qt("Pass correct 'this' to __construct");t=s.implement(this,...t),bn(t);var n=t.g;if(t.notifyOnDestruction(),n.ha=!0,Object.defineProperties(this,{g:{value:n}}),_n(this),t=ln(e,t=n.o),fn.hasOwnProperty(t))throw new qt(`Tried to register registered instance: ${t}`);fn[t]=this},r.__destruct=function(){if(this===r)throw new qt("Pass correct 'this' to __destruct");bn(this);var t=this.g.o;if(t=ln(e,t),!fn.hasOwnProperty(t))throw new qt(`Tried to unregister unregistered instance: ${t}`);delete fn[t]},t.prototype=Object.create(r),Object.assign(t.prototype,i),sn(t)},_embind_finalize_value_object:t=>{var n=jn[t];delete jn[t];var i=n.Na,e=n.O,r=n.eb,o=r.map((t=>t.Ub)).concat(r.map((t=>t.kc)));Tn([t],o,(t=>{var o={};return r.forEach(((n,i)=>{var e=t[i],s=n.Sb,u=n.Tb,a=t[i+r.length],c=n.jc,h=n.lc;o[n.Ob]={read:t=>e.fromWireType(s(u,t)),write:(t,n)=>{var i=[];c(h,t,a.toWireType(i,n)),An(i)}}})),[{name:n.name,fromWireType:t=>{var n,i={};for(n in o)i[n]=o[n].read(t);return e(t),i},toWireType:(t,n)=>{for(var r in o)if(!(r in n))throw new TypeError(`Missing field: "${r}"`);var s=i();for(r in o)o[r].write(s,n[r]);return null!==t&&t.push(e,s),s},argPackAdvance:8,readValueFromPointer:On,L:e}]}))},_embind_register_bigint:()=>{},_embind_register_bool:(t,n,i,e)=>{$n(t,{name:n=an(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?i:e},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(O[t])},L:null})},_embind_register_class:(t,n,i,e,r,o,s,u,a,c,h,f,l)=>{h=an(h),o=Xn(r,o),u&&=Xn(s,u),c&&=Xn(a,c),l=Xn(f,l);var v=(t=>{if(void 0===t)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?`_${t}`:t})(h);Cn(v,(function(){Gn(`Cannot construct ${h} due to unbound types`,[e])})),Tn([t,n,i],e?[e]:[],(n=>{if(n=n[0],e)var i=n.i,r=i.M;else r=xn.prototype;n=nn(h,(function(...t){if(Object.getPrototypeOf(this)!==s)throw new qt("Use 'new' to construct "+h);if(void 0===f.Z)throw new qt(h+" has no accessible constructor");var n=f.Z[t.length];if(void 0===n)throw new qt(`Tried to invoke ctor of ${h} with invalid number of parameters (${t.length}) - expected (${Object.keys(f.Z).toString()}) parameters instead!`);return n.apply(this,t)}));var s=Object.create(r,{constructor:{value:n}});n.prototype=s;var a,f=new Fn(h,n,s,l,i,o,u,c);return f.C&&((a=f.C).na??(a.na=[]),f.C.na.push(f)),i=new Ln(h,f,!0,!1,!1),a=new Ln(h+"*",f,!1,!1,!1),r=new Ln(h+" const*",f,!1,!0,!1),gn[t]={pointerType:a,Hb:r},Vn(v,n),[i,a,r]}))},_embind_register_class_class_function:(t,n,i,e,r,o,s)=>{var u=Bn(i,e);n=an(n),n=qn(n),o=Xn(r,o),Tn([],[t],(t=>{function e(){Gn(`Cannot call ${r} due to unbound types`,u)}var r=`${(t=t[0]).name}.${n}`;n.startsWith("@@")&&(n=Symbol[n.substring(2)]);var a=t.i.constructor;return void 0===a[n]?(e.da=i-1,a[n]=e):(Pn(a,n,r),a[n].A[i-1]=e),Tn([],u,(e=>{if(e=Hn(r,[e[0],null].concat(e.slice(1)),null,o,s),void 0===a[n].A?(e.da=i-1,a[n]=e):a[n].A[i-1]=e,t.i.na)for(const i of t.i.na)i.constructor.hasOwnProperty(n)||(i.constructor[n]=e);return[]})),[]}))},_embind_register_class_class_property:(t,n,i,e,r,o,s,u)=>{n=an(n),o=Xn(r,o),Tn([],[t],(t=>{var r=`${(t=t[0]).name}.${n}`,a={get(){Gn(`Cannot access ${r} due to unbound types`,[i])},enumerable:!0,configurable:!0};return a.set=u?()=>{Gn(`Cannot access ${r} due to unbound types`,[i])}:()=>{throw new qt(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,n,a),Tn([],[i],(i=>{i=i[0];var r={get:()=>i.fromWireType(o(e)),enumerable:!0};return u&&(u=Xn(s,u),r.set=t=>{var n=[];u(e,i.toWireType(n,t)),An(n)}),Object.defineProperty(t.i.constructor,n,r),[]})),[]}))},_embind_register_class_constructor:(t,n,i,e,r,o)=>{var s=Bn(n,i);r=Xn(e,r),Tn([],[t],(t=>{var i=`constructor ${(t=t[0]).name}`;if(void 0===t.i.Z&&(t.i.Z=[]),void 0!==t.i.Z[n-1])throw new qt(`Cannot register multiple constructors with identical number of parameters (${n-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.Z[n-1]=()=>{Gn(`Cannot construct ${t.name} due to unbound types`,s)},Tn([],s,(e=>(e.splice(1,0,null),t.i.Z[n-1]=Hn(i,e,null,r,o),[]))),[]}))},_embind_register_class_function:(t,n,i,e,r,o,s,u)=>{var a=Bn(i,e);n=an(n),n=qn(n),o=Xn(r,o),Tn([],[t],(t=>{function e(){Gn(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${n}`;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),u&&t.i.pb.push(n);var c=t.i.M,h=c[n];return void 0===h||void 0===h.A&&h.className!==t.name&&h.da===i-2?(e.da=i-2,e.className=t.name,c[n]=e):(Pn(c,n,r),c[n].A[i-2]=e),Tn([],a,(e=>(e=Hn(r,e,t,o,s),void 0===c[n].A?(e.da=i-2,c[n]=e):c[n].A[i-2]=e,[]))),[]}))},_embind_register_class_property:(t,n,i,e,r,o,s,u,a,c)=>{n=an(n),r=Xn(e,r),Tn([],[t],(t=>{var e=`${(t=t[0]).name}.${n}`,h={get(){Gn(`Cannot access ${e} due to unbound types`,[i,s])},enumerable:!0,configurable:!0};return h.set=a?()=>Gn(`Cannot access ${e} due to unbound types`,[i,s]):()=>{throw new qt(e+" is a read-only property")},Object.defineProperty(t.i.M,n,h),Tn([],a?[i,s]:[i],(i=>{var s=i[0],h={get(){var n=Jn(this,t,e+" getter");return s.fromWireType(r(o,n))},enumerable:!0};if(a){a=Xn(u,a);var f=i[1];h.set=function(n){var i=Jn(this,t,e+" setter"),r=[];a(c,i,f.toWireType(r,n)),An(r)}}return Object.defineProperty(t.i.M,n,h),[]})),[]}))},_embind_register_emval:t=>$n(t,Kn),_embind_register_enum:(t,n,i,e)=>{function r(){}n=an(n),r.values={},$n(t,{name:n,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:(t,n)=>n.value,argPackAdvance:8,readValueFromPointer:Qn(n,i,e),L:null}),Cn(n,r)},_embind_register_enum_value:(t,n,i)=>{var e=wn(t,"enum");n=an(n),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:i},constructor:{value:nn(`${e.name}_${n}`,(function(){}))}}),t.values[i]=e,t[n]=e},_embind_register_float:(t,n,i)=>{$n(t,{name:n=an(n),fromWireType:t=>t,toWireType:(t,n)=>n,argPackAdvance:8,readValueFromPointer:ni(n,i),L:null})},_embind_register_function:(t,n,i,e,r,o)=>{var s=Bn(n,i);t=an(t),t=qn(t),r=Xn(e,r),Cn(t,(function(){Gn(`Cannot call ${t} due to unbound types`,s)}),n-1),Tn([],s,(i=>(Vn(t,Hn(t,[i[0],null].concat(i.slice(1)),null,r,o),n-1),[])))},_embind_register_integer:(t,n,i,e,r)=>{if(n=an(n),-1===r&&(r=4294967295),r=t=>t,0===e){var o=32-8*i;r=t=>t<<o>>>o}var s=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n};$n(t,{name:n,fromWireType:r,toWireType:s,argPackAdvance:8,readValueFromPointer:ii(n,i,0!==e),L:null})},_embind_register_memory_view:(t,n,i)=>{function e(t){return new r(A.buffer,$[t+4>>2],$[t>>2])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];$n(t,{name:i=an(i),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Vb:!0})},_embind_register_std_string:(t,n)=>{var i="std::string"===(n=an(n));$n(t,{name:n,fromWireType:function(t){var n=$[t>>2],e=t+4;if(i)for(var r=e,o=0;o<=n;++o){var s=e+o;if(o==n||0==O[s]){if(r=r?et(O,r,s-r):"",void 0===u)var u=r;else u+=String.fromCharCode(0),u+=r;r=s+1}}else{for(u=Array(n),o=0;o<n;++o)u[o]=String.fromCharCode(O[e+o]);u=u.join("")}return Mi(t),u},toWireType:function(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var e="string"==typeof n;if(!(e||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array))throw new qt("Cannot pass non-string to std::string");var r=i&&e?ot(n):n.length,o=ki(4+r+1),s=o+4;if($[o>>2]=r,i&&e)st(n,O,s,r+1);else if(e)for(e=0;e<r;++e){var u=n.charCodeAt(e);if(255<u)throw Mi(s),new qt("String has UTF-16 code units that do not fit in 8 bits");O[s+e]=u}else for(e=0;e<r;++e)O[s+e]=n[e];return null!==t&&t.push(Mi,o),o},argPackAdvance:8,readValueFromPointer:On,L(t){Mi(t)}})},_embind_register_std_wstring:(t,n,i)=>{if(i=an(i),2===n)var e=ri,r=oi,o=si,s=t=>k[t>>1];else 4===n&&(e=ui,r=ai,o=ci,s=t=>$[t>>2]);$n(t,{name:i,fromWireType:t=>{for(var i,r=$[t>>2],o=t+4,u=0;u<=r;++u){var a=t+4+u*n;u!=r&&0!=s(a)||(o=e(o,a-o),void 0===i?i=o:(i+=String.fromCharCode(0),i+=o),o=a+n)}return Mi(t),i},toWireType:(t,e)=>{if("string"!=typeof e)throw new qt(`Cannot pass non-string to C++ string type ${i}`);var s=o(e),u=ki(4+s+n);return $[u>>2]=s/n,r(e,u+4,s+n),null!==t&&t.push(Mi,u),u},argPackAdvance:8,readValueFromPointer:On,L(t){Mi(t)}})},_embind_register_value_object:(t,n,i,e,r,o)=>{jn[t]={name:an(n),Na:Xn(i,e),O:Xn(r,o),eb:[]}},_embind_register_value_object_field:(t,n,i,e,r,o,s,u,a,c)=>{jn[t].eb.push({Ob:an(n),Ub:i,Sb:Xn(e,r),Tb:o,kc:s,jc:Xn(u,a),lc:c})},_embind_register_void:(t,n)=>{$n(t,{Ic:!0,name:n=an(n),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(t,n,i)=>O.copyWithin(t,n,n+i),_emval_as:(t,n,i)=>(t=on(t),n=wn(n,"emval::as"),hi(n,i,t)),_emval_call_method:(t,n,i,e,r)=>(t=vi[t])(n=on(n),n[i=li(i)],e,r),_emval_decref:Zn,_emval_get_method_caller:(t,n,i)=>{var e=((t,n)=>{for(var i=Array(t),e=0;e<t;++e)i[e]=wn($[n+4*e>>2],"parameter "+e);return i})(t,n),r=e.shift();t--;var o=Array(t);return n=`methodCaller<(${e.map((t=>t.name)).join(", ")}) => ${r.name}>`,(t=>{var n=vi.length;return vi.push(t),n})(nn(n,((n,s,u,a)=>{for(var c=0,h=0;h<t;++h)o[h]=e[h].readValueFromPointer(a+c),c+=e[h].argPackAdvance;return n=1===i?di(s,o):s.apply(n,o),hi(r,u,n)})))},_emval_get_module_property:t=>(t=li(t),sn(r[t])),_emval_get_property:(t,n)=>(t=on(t),n=on(n),sn(t[n])),_emval_incref:t=>{9<t&&(rn[t+1]+=1)},_emval_new_array:()=>sn([]),_emval_new_cstring:t=>sn(li(t)),_emval_new_object:()=>sn({}),_emval_run_destructors:t=>{var n=on(t);An(n),Zn(t)},_emval_set_property:(t,n,i)=>{t=on(t),n=on(n),i=on(i),t[n]=i},_emval_take_value:(t,n)=>(t=(t=wn(t,"_emval_take_value")).readValueFromPointer(n),sn(t)),emscripten_asm_const_int:(t,n,i)=>{wi.length=0;for(var e;e=O[n++];){var r=105!=e;i+=(r&=112!=e)&&i%8?4:0,wi.push(112==e?$[i>>2]:105==e?T[i>>2]:x[i>>3]),i+=r?8:4}return Y[t](...wi)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:t=>{var n=O.length;if(2147483648<(t>>>=0))return!1;for(var i=1;4>=i;i*=2){var e=n*(1+.2/i);e=Math.min(e,t+100663296);var r=Math;e=Math.max(t,e);t:{r=(r.min.call(r,2147483648,e+(65536-e%65536)%65536)-j.buffer.byteLength+65535)/65536;try{j.grow(r),C();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},environ_get:(t,n)=>{var i=0;return mi().forEach(((e,r)=>{var o=n+i;for(r=$[t+4*r>>2]=o,o=0;o<e.length;++o)A[r++]=e.charCodeAt(o);A[r]=0,i+=e.length+1})),0},environ_sizes_get:(t,n)=>{var i=mi();$[t>>2]=i.length;var e=0;return i.forEach((t=>e+=t.length+1)),$[n>>2]=e,0},fd_close:function(t){try{var n=Ft(t);if(null===n.W)throw new _t(8);n.Ka&&(n.Ka=null);try{n.m.close&&n.m.close(n)}catch(t){throw t}finally{mt[n.W]=null}return n.W=null,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_read:function(t,n,i,e){try{t:{var r=Ft(t);t=n;for(var o,s=n=0;s<i;s++){var u=$[t>>2],a=$[t+4>>2];t+=8;var c=r,h=o,f=A;if(0>a||0>h)throw new _t(28);if(null===c.W)throw new _t(8);if(1==(2097155&c.flags))throw new _t(8);if(16384==(61440&c.node.mode))throw new _t(31);if(!c.m.read)throw new _t(28);var l=void 0!==h;if(l){if(!c.seekable)throw new _t(70)}else h=c.position;var v=c.m.read(c,f,u,a,h);l||(c.position+=v);var d=v;if(0>d){var w=-1;break t}if(n+=d,d<a)break;void 0!==o&&(o+=d)}w=n}return $[e>>2]=w,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_seek:function(t,n,i,e,r){n=i+2097152>>>0<4194305-!!n?(n>>>0)+4294967296*i:NaN;try{if(isNaN(n))return 61;var o=Ft(t);return Gt(o,n,e),H=[o.position>>>0,(G=o.position,1<=+Math.abs(G)?0<G?+Math.floor(G/4294967296)>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],T[r>>2]=H[0],T[r+4>>2]=H[1],o.Ka&&0===n&&0===e&&(o.Ka=null),0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_write:function(t,n,i,e){try{t:{var r=Ft(t);t=n;for(var o,s=n=0;s<i;s++){var u=$[t>>2],a=$[t+4>>2];t+=8;var c=r,h=u,f=a,l=o,v=A;if(0>f||0>l)throw new _t(28);if(null===c.W)throw new _t(8);if(!(2097155&c.flags))throw new _t(8);if(16384==(61440&c.node.mode))throw new _t(31);if(!c.m.write)throw new _t(28);c.seekable&&1024&c.flags&&Gt(c,0,2);var d=void 0!==l;if(d){if(!c.seekable)throw new _t(70)}else l=c.position;var w=c.m.write(c,v,h,f,l,void 0);d||(c.position+=w);var b=w;if(0>b){var m=-1;break t}n+=b,void 0!==o&&(o+=b)}m=n}return $[e>>2]=m,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},strftime_l:(t,n,i,e)=>((t,n,i,e)=>{function r(t,n,i){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=i[0]+t;return t}function o(t,n){return r(t,n,"0")}function s(t,n){function i(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=i(t.getFullYear()-n.getFullYear()))&&0===(e=i(t.getMonth()-n.getMonth()))&&(e=i(t.getDate()-n.getDate())),e}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function a(t){var n=t.ba;for(t=new Date(new Date(t.ca+1900,0,1).getTime());0<n;){var i=t.getMonth(),e=(pi(t.getFullYear())?gi:yi)[i];if(!(n>e-t.getDate())){t.setDate(t.getDate()+n);break}n-=e-t.getDate()+1,t.setDate(1),11>i?t.setMonth(i+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return i=new Date(t.getFullYear()+1,0,4),n=u(new Date(t.getFullYear(),0,4)),i=u(i),0>=s(n,t)?0>=s(i,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=$[e+40>>2];for(var h in e={pc:T[e>>2],oc:T[e+4>>2],Da:T[e+8>>2],Qa:T[e+12>>2],Ea:T[e+16>>2],ca:T[e+20>>2],R:T[e+24>>2],ba:T[e+28>>2],Nc:T[e+32>>2],nc:T[e+36>>2],qc:c&&c?et(O,c):""},i=i?et(O,i):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})i=i.replace(new RegExp(h,"g"),c[h]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),l="January February March April May June July August September October November December".split(" ");for(h in c={"%a":t=>f[t.R].substring(0,3),"%A":t=>f[t.R],"%b":t=>l[t.Ea].substring(0,3),"%B":t=>l[t.Ea],"%C":t=>o((t.ca+1900)/100|0,2),"%d":t=>o(t.Qa,2),"%e":t=>r(t.Qa,2," "),"%g":t=>a(t).toString().substring(2),"%G":a,"%H":t=>o(t.Da,2),"%I":t=>(0==(t=t.Da)?t=12:12<t&&(t-=12),o(t,2)),"%j":t=>{for(var n=0,i=0;i<=t.Ea-1;n+=(pi(t.ca+1900)?gi:yi)[i++]);return o(t.Qa+n,3)},"%m":t=>o(t.Ea+1,2),"%M":t=>o(t.oc,2),"%n":()=>"\n","%p":t=>0<=t.Da&&12>t.Da?"AM":"PM","%S":t=>o(t.pc,2),"%t":()=>"\t","%u":t=>t.R||7,"%U":t=>o(Math.floor((t.ba+7-t.R)/7),2),"%V":t=>{var n=Math.floor((t.ba+7-(t.R+6)%7)/7);if(2>=(t.R+371-t.ba-2)%7&&n++,n)53==n&&(4==(i=(t.R+371-t.ba)%7)||3==i&&pi(t.ca)||(n=1));else{n=52;var i=(t.R+7-t.ba-1)%7;(4==i||5==i&&pi(t.ca%400-1))&&n++}return o(n,2)},"%w":t=>t.R,"%W":t=>o(Math.floor((t.ba+7-(t.R+6)%7)/7),2),"%y":t=>(t.ca+1900).toString().substring(2),"%Y":t=>t.ca+1900,"%z":t=>{var n=0<=(t=t.nc);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":t=>t.qc,"%%":()=>"%"},i=i.replace(/%%/g,"\0\0"),c)i.includes(h)&&(i=i.replace(new RegExp(h,"g"),c[h](e)));return(h=ut(i=i.replace(/\0\0/g,"%"),!1)).length>n?0:(A.set(h,t),h.length-1)})(t,n,i,e)},Oi=function(){function t(t){return j=(Oi=t.exports).memory,C(),Dn=Oi.__indirect_function_table,I.unshift(Oi.__wasm_call_ctors),W--,r.monitorRunDependencies?.(W),0==W&&L&&(t=L,L=null,t()),Oi}var n={env:Ai,wasi_snapshot_preview1:Ai};if(W++,r.monitorRunDependencies?.(W),r.instantiateWasm)try{return r.instantiateWasm(n,t)}catch(t){_(`Module.instantiateWasm callback failed with error: ${t}`),i(t)}return U||=V("canvas_advanced.wasm")?"canvas_advanced.wasm":r.locateFile?r.locateFile("canvas_advanced.wasm",p):p+"canvas_advanced.wasm",function(t,n){var i=U;return g||"function"!=typeof WebAssembly.instantiateStreaming||V(i)||N(i)||"function"!=typeof fetch?X(i,t,n):fetch(i,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(n,(function(e){return _(`wasm streaming compile failed: ${e}`),_("falling back to ArrayBuffer instantiation"),X(i,t,n)}))))}(n,(function(n){t(n.instance)})).catch(i),{}}(),Mi=t=>(Mi=Oi.free)(t),ki=t=>(ki=Oi.malloc)(t),Ti=t=>(Ti=Oi.__getTypeName)(t),$i=r._ma_device__on_notification_unlocked=t=>($i=r._ma_device__on_notification_unlocked=Oi.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,n)=>(r._ma_malloc_emscripten=Oi.ma_malloc_emscripten)(t,n),r._ma_free_emscripten=(t,n)=>(r._ma_free_emscripten=Oi.ma_free_emscripten)(t,n);var Ei,xi=r._ma_device_process_pcm_frames_capture__webaudio=(t,n,i)=>(xi=r._ma_device_process_pcm_frames_capture__webaudio=Oi.ma_device_process_pcm_frames_capture__webaudio)(t,n,i),Pi=r._ma_device_process_pcm_frames_playback__webaudio=(t,n,i)=>(Pi=r._ma_device_process_pcm_frames_playback__webaudio=Oi.ma_device_process_pcm_frames_playback__webaudio)(t,n,i);function Ci(){function t(){if(!Ei&&(Ei=!0,r.calledRun=!0,!P)){if(r.noFSInit||St||(St=!0,r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Ht("stdin",r.stdin):Nt("/dev/tty","/dev/stdin"),r.stdout?Ht("stdout",null,r.stdout):Nt("/dev/tty","/dev/stdout"),r.stderr?Ht("stderr",null,r.stderr):Nt("/dev/tty1","/dev/stderr"),Xt("/dev/stdin",0),Xt("/dev/stdout",1),Xt("/dev/stderr",1)),yt=!1,B(I),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();S.unshift(t)}B(S)}}if(!(0<W)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)R();B(F),0<W||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.dynCall_iiji=(t,n,i,e,o)=>(r.dynCall_iiji=Oi.dynCall_iiji)(t,n,i,e,o),r.dynCall_jiji=(t,n,i,e,o)=>(r.dynCall_jiji=Oi.dynCall_jiji)(t,n,i,e,o),r.dynCall_iiiji=(t,n,i,e,o,s)=>(r.dynCall_iiiji=Oi.dynCall_iiiji)(t,n,i,e,o,s),r.dynCall_iij=(t,n,i,e)=>(r.dynCall_iij=Oi.dynCall_iij)(t,n,i,e),r.dynCall_jii=(t,n,i)=>(r.dynCall_jii=Oi.dynCall_jii)(t,n,i),r.dynCall_viijii=(t,n,i,e,o,s,u)=>(r.dynCall_viijii=Oi.dynCall_viijii)(t,n,i,e,o,s,u),r.dynCall_iiiiij=(t,n,i,e,o,s,u)=>(r.dynCall_iiiiij=Oi.dynCall_iiiiij)(t,n,i,e,o,s,u),r.dynCall_iiiiijj=(t,n,i,e,o,s,u,a,c)=>(r.dynCall_iiiiijj=Oi.dynCall_iiiiijj)(t,n,i,e,o,s,u,a,c),r.dynCall_iiiiiijj=(t,n,i,e,o,s,u,a,c,h)=>(r.dynCall_iiiiiijj=Oi.dynCall_iiiiiijj)(t,n,i,e,o,s,u,a,c,h),L=function t(){Ei||Ci(),Ei||(L=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ci(),o});const o=r},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.32.0","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,n,i)=>{i.r(n),i.d(n,{Animation:()=>e.Animation});var e=i(4)},(t,n,i)=>{i.r(n),i.d(n,{Animation:()=>e});var e=function(){function t(t,n,i,e){this.animation=t,this.artboard=n,this.playing=e,this.loopCount=0,this.scrubTo=null,this.instance=new i.LinearAnimationInstance(t,n)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.instance.time},set:function(t){this.instance.time=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){null===this.scrubTo?this.instance.advance(t):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},t.prototype.apply=function(t){this.instance.apply(t)},t.prototype.cleanup=function(){this.instance.delete()},t}()},(t,n,i)=>{i.r(n),i.d(n,{AudioAssetWrapper:()=>o.AudioAssetWrapper,AudioWrapper:()=>o.AudioWrapper,BLANK_URL:()=>r.BLANK_URL,CustomFileAssetLoaderWrapper:()=>o.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>o.FileAssetWrapper,FileFinalizer:()=>o.FileFinalizer,FontAssetWrapper:()=>o.FontAssetWrapper,FontWrapper:()=>o.FontWrapper,ImageAssetWrapper:()=>o.ImageAssetWrapper,ImageWrapper:()=>o.ImageWrapper,createFinalization:()=>o.createFinalization,finalizationRegistry:()=>o.finalizationRegistry,registerTouchInteractions:()=>e.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var e=i(6),r=i(7),o=i(8)},(t,n,i)=>{i.r(n),i.d(n,{registerTouchInteractions:()=>e});var e=function(t){var n=t.canvas,i=t.artboard,e=t.stateMachines,r=void 0===e?[]:e,o=t.rive,s=t.fit,u=t.alignment,a=t.isTouchScrollEnabled,c=void 0!==a&&a,h=t.dispatchPointerExit,f=void 0===h||h,l=t.enableMultiTouch,v=void 0!==l&&l,d=t.layoutScaleFactor,w=void 0===d?1:d;if(!(n&&r.length&&t.renderer&&o&&i&&"undefined"!=typeof window))return null;var b=null,m=!1,p=function(t){if(m&&t instanceof MouseEvent)"mouseup"==t.type&&(m=!1);else{m=c&&"touchend"===t.type&&"touchstart"===b,b=t.type;var n=t.currentTarget.getBoundingClientRect(),e=function(t,n,i){var e,r,o=[];if(["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(e=t.changedTouches)||void 0===e?void 0:e.length)){n||t.preventDefault();for(var s=0,u=i?t.changedTouches.length:1;s<u;)o.push({clientX:(a=t.changedTouches[s]).clientX,clientY:a.clientY,identifier:a.identifier}),s++}else if("touchend"===t.type&&(null===(r=t.changedTouches)||void 0===r?void 0:r.length))for(s=0,u=i?t.changedTouches.length:1;s<u;){var a;o.push({clientX:(a=t.changedTouches[s]).clientX,clientY:a.clientY,identifier:a.identifier}),s++}else o.push({clientX:t.clientX,clientY:t.clientY,identifier:0});return o}(t,c,v),a=o.computeAlignment(s,u,{minX:0,minY:0,maxX:n.width,maxY:n.height},i.bounds,w),h=new o.Mat2D;switch(a.invert(h),e.forEach((function(t){var i=t.clientX,e=t.clientY;if(i||e){var r=new o.Vec2D(i-n.left,e-n.top),s=o.mapXY(h,r),u=s.x(),a=s.y();t.transformedX=u,t.transformedY=a,s.delete(),r.delete()}})),h.delete(),a.delete(),t.type){case"mouseout":for(var l=function(t){e.forEach(f?function(n){t.pointerExit(n.transformedX,n.transformedY,n.identifier)}:function(n){t.pointerMove(n.transformedX,n.transformedY,n.identifier)})},d=0,p=r;d<p.length;d++)l(p[d]);break;case"touchmove":case"mouseover":case"mousemove":for(var g=function(t){e.forEach((function(n){t.pointerMove(n.transformedX,n.transformedY,n.identifier)}))},y=0,_=r;y<_.length;y++)g(_[y]);break;case"touchstart":case"mousedown":for(var j=function(t){e.forEach((function(n){t.pointerDown(n.transformedX,n.transformedY,n.identifier)}))},A=0,O=r;A<O.length;A++)j(O[A]);break;case"touchend":for(var M=function(t){e.forEach((function(n){t.pointerUp(n.transformedX,n.transformedY,n.identifier),t.pointerExit(n.transformedX,n.transformedY,n.identifier)}))},k=0,T=r;k<T.length;k++)M(T[k]);break;case"mouseup":for(var $=function(t){e.forEach((function(n){t.pointerUp(n.transformedX,n.transformedY,n.identifier)}))},E=0,x=r;E<x.length;E++)$(x[E])}}}.bind(void 0);return n.addEventListener("mouseover",p),n.addEventListener("mouseout",p),n.addEventListener("mousemove",p),n.addEventListener("mousedown",p),n.addEventListener("mouseup",p),n.addEventListener("touchmove",p,{passive:c}),n.addEventListener("touchstart",p,{passive:c}),n.addEventListener("touchend",p),function(){n.removeEventListener("mouseover",p),n.removeEventListener("mouseout",p),n.removeEventListener("mousemove",p),n.removeEventListener("mousedown",p),n.removeEventListener("mouseup",p),n.removeEventListener("touchmove",p),n.removeEventListener("touchstart",p),n.removeEventListener("touchend",p)}}},(t,n,i)=>{i.r(n),i.d(n,{BLANK_URL:()=>c,sanitizeUrl:()=>h});var e=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,u=/^.+(:|&colon;)/gim,a=[".","/"],c="about:blank";function h(t){if(!t)return c;var n,i=(n=t,n.replace(s,"").replace(r,(function(t,n){return String.fromCharCode(n)}))).replace(o,"").replace(s,"").trim();if(!i)return c;if(function(t){return a.indexOf(t[0])>-1}(i))return i;var h=i.match(u);return h&&e.test(h[0])?c:i}},(t,n,i)=>{i.r(n),i.d(n,{AudioAssetWrapper:()=>d,AudioWrapper:()=>c,CustomFileAssetLoaderWrapper:()=>f,FileAssetWrapper:()=>l,FileFinalizer:()=>o,FontAssetWrapper:()=>w,FontWrapper:()=>h,ImageAssetWrapper:()=>v,ImageWrapper:()=>a,createFinalization:()=>p,finalizationRegistry:()=>m});var e,r=(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},e(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),o=function(){function t(t){this.selfUnref=!1,this._file=t}return t.prototype.unref=function(){this._file&&this._file.unref()},t}(),s=function(){function t(t){this._finalizableObject=t}return t.prototype.unref=function(){this._finalizableObject.unref()},t}(),u=function(){function t(){this.selfUnref=!1}return t.prototype.unref=function(){},t}(),a=function(t){function n(n){var i=t.call(this)||this;return i._nativeImage=n,i}return r(n,t),Object.defineProperty(n.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),n.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},n}(u),c=function(t){function n(n){var i=t.call(this)||this;return i._nativeAudio=n,i}return r(n,t),Object.defineProperty(n.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),n.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},n}(u),h=function(t){function n(n){var i=t.call(this)||this;return i._nativeFont=n,i}return r(n,t),Object.defineProperty(n.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),n.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},n}(u),f=function(){function t(t,n){this._assetLoaderCallback=n,this.assetLoader=new t.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return t.prototype.loadContents=function(t,n){var i;return t.isImage?i=new v(t):t.isAudio?i=new d(t):t.isFont&&(i=new w(t)),this._assetLoaderCallback(i,n)},t}(),l=function(){function t(t){this._nativeFileAsset=t}return t.prototype.decode=function(t){this._nativeFileAsset.decode(t)},Object.defineProperty(t.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),t}(),v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.setRenderImage=function(t){this._nativeFileAsset.setRenderImage(t.nativeImage)},n}(l),d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.setAudioSource=function(t){this._nativeFileAsset.setAudioSource(t.nativeAudio)},n}(l),w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.setFont=function(t){this._nativeFileAsset.setFont(t.nativeFont)},n}(l),b=function(){function t(){}return t.prototype.register=function(t){t.selfUnref=!0},t.prototype.unregister=function(){},t}(),m=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:b)((function(t){null==t||t.unref()})),p=function(t,n){var i=new s(n);m.register(t,i)}}],n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=(t,n)=>{for(var e in n)i.o(n,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};return(()=>{i.r(e),i.d(e,{Alignment:()=>r,DataEnum:()=>L,EventType:()=>y,Fit:()=>n,Layout:()=>b,LoopType:()=>_,Rive:()=>R,RiveEventType:()=>p,RiveFile:()=>S,RuntimeLoader:()=>m,StateMachineInput:()=>g,StateMachineInputType:()=>w,Testing:()=>K,ViewModel:()=>W,ViewModelInstance:()=>D,ViewModelInstanceArtboard:()=>q,ViewModelInstanceAssetImage:()=>B,ViewModelInstanceBoolean:()=>z,ViewModelInstanceColor:()=>Y,ViewModelInstanceEnum:()=>G,ViewModelInstanceList:()=>H,ViewModelInstanceNumber:()=>N,ViewModelInstanceString:()=>V,ViewModelInstanceTrigger:()=>X,ViewModelInstanceValue:()=>U,decodeAudio:()=>Q,decodeFont:()=>nt,decodeImage:()=>tt});var t,n,r,o=i(1),s=i(2),u=i(3),a=i(5),c=(t=function(n,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},t(n,i)},function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),h=function(){return h=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},h.apply(this,arguments)},f=function(t,n,i,e){return new(i||(i=Promise))((function(r,o){function s(t){try{a(e.next(t))}catch(t){o(t)}}function u(t){try{a(e.throw(t))}catch(t){o(t)}}function a(t){var n;t.done?r(t.value):(n=t.value,n instanceof i?n:new i((function(t){t(n)}))).then(s,u)}a((e=e.apply(t,n||[])).next())}))},l=function(t,n){var i,e,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(a){return function(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(i=1,e&&(r=2&u[0]?e.return:u[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,u[1])).done)return r;switch(e=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,e=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){o.label=u[1];break}if(6===u[0]&&o.label<r[1]){o.label=r[1],r=u;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(u);break}r[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(t,o)}catch(t){u=[6,t],e=0}finally{i=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},v=function(t,n,i){if(i||2===arguments.length)for(var e,r=0,o=n.length;r<o;r++)!e&&r in n||(e||(e=Array.prototype.slice.call(n,0,r)),e[r]=n[r]);return t.concat(e||Array.prototype.slice.call(n))},d=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.isHandledError=!0,n}return c(n,t),n}(Error);!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(n||(n={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var w,b=function(){function t(t){var i,e,o,s,u,a,c;this.fit=null!==(i=null==t?void 0:t.fit)&&void 0!==i?i:n.Contain,this.alignment=null!==(e=null==t?void 0:t.alignment)&&void 0!==e?e:r.Center,this.layoutScaleFactor=null!==(o=null==t?void 0:t.layoutScaleFactor)&&void 0!==o?o:1,this.minX=null!==(s=null==t?void 0:t.minX)&&void 0!==s?s:0,this.minY=null!==(u=null==t?void 0:t.minY)&&void 0!==u?u:0,this.maxX=null!==(a=null==t?void 0:t.maxX)&&void 0!==a?a:0,this.maxY=null!==(c=null==t?void 0:t.maxY)&&void 0!==c?c:0}return t.new=function(n){var i=n.fit,e=n.alignment,r=n.minX,o=n.minY,s=n.maxX,u=n.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:i,alignment:e,minX:r,minY:o,maxX:s,maxY:u})},t.prototype.copyWith=function(n){var i=n.fit,e=n.alignment,r=n.layoutScaleFactor,o=n.minX,s=n.minY,u=n.maxX,a=n.maxY;return new t({fit:null!=i?i:this.fit,alignment:null!=e?e:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=o?o:this.minX,minY:null!=s?s:this.minY,maxX:null!=u?u:this.maxX,maxY:null!=a?a:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=i=this.fit===n.Cover?t.Fit.cover:this.fit===n.Contain?t.Fit.contain:this.fit===n.Fill?t.Fit.fill:this.fit===n.FitWidth?t.Fit.fitWidth:this.fit===n.FitHeight?t.Fit.fitHeight:this.fit===n.ScaleDown?t.Fit.scaleDown:this.fit===n.Layout?t.Fit.layout:t.Fit.none,i);var i},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=n=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,n);var n},t}(),m=function(){function t(){}return t.loadRuntime=function(){o.default({locateFile:function(){return t.wasmURL}}).then((function(n){var i;for(t.runtime=n;t.callBackQueue.length>0;)null===(i=t.callBackQueue.shift())||void 0===i||i(t.runtime)})).catch((function(n){var i={message:(null==n?void 0:n.message)||"Unknown error",type:(null==n?void 0:n.name)||"Error",wasmError:n instanceof WebAssembly.CompileError||n instanceof WebAssembly.RuntimeError,originalError:n};console.debug("Rive WASM load error details:",i);var e="https://cdn.jsdelivr.net/npm/".concat(s.name,"@").concat(s.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==e)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(i.message,"), trying jsdelivr as a backup")),t.setWasmUrl(e),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(e,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(i.type),"- Message: ".concat(i.message),"- WebAssembly-specific error: ".concat(i.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(n){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?n(t.runtime):t.callBackQueue.push(n)},t.awaitInstance=function(){return new Promise((function(n){return t.getInstance((function(t){return n(t)}))}))},t.setWasmUrl=function(n){t.wasmURL=n},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(s.name,"@").concat(s.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(w||(w={}));var p,g=function(){function t(t,n){this.type=t,this.runtimeInput=n}return Object.defineProperty(t.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(t){this.runtimeInput.value=t},enumerable:!1,configurable:!0}),t.prototype.fire=function(){this.type===w.Trigger&&this.runtimeInput.fire()},t.prototype.delete=function(){this.runtimeInput=null},t}();!function(t){t[t.General=128]="General",t[t.OpenUrl=131]="OpenUrl"}(p||(p={}));var y,_,j=function(t){this.isBindableArtboard=!1,this.isBindableArtboard=t},A=function(t){function n(n,i){var e=t.call(this,!1)||this;return e.nativeArtboard=n,e.file=i,e}return c(n,t),n}(j),O=function(t){function n(n){var i=t.call(this,!0)||this;return i.selfUnref=!1,i.nativeArtboard=n,i}return c(n,t),n.prototype.destroy=function(){this.selfUnref&&this.nativeArtboard.unref()},n}(j),M=function(){function t(t,n,i,e){this.stateMachine=t,this.playing=i,this.artboard=e,this.inputs=[],this.instance=new n.StateMachineInstance(t,e),this.initInputs(n)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statesChanged",{get:function(){for(var t=[],n=0;n<this.instance.stateChangedCount();n++)t.push(this.instance.stateChangedNameByIndex(n));return t},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){this.instance.advance(t)},t.prototype.advanceAndApply=function(t){this.instance.advanceAndApply(t)},t.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},t.prototype.reportedEventAt=function(t){return this.instance.reportedEventAt(t)},t.prototype.initInputs=function(t){for(var n=0;n<this.instance.inputCount();n++){var i=this.instance.input(n);this.inputs.push(this.mapRuntimeInput(i,t))}},t.prototype.mapRuntimeInput=function(t,n){return t.type===n.SMIInput.bool?new g(w.Boolean,t.asBool()):t.type===n.SMIInput.number?new g(w.Number,t.asNumber()):t.type===n.SMIInput.trigger?new g(w.Trigger,t.asTrigger()):void 0},t.prototype.cleanup=function(){this.inputs.forEach((function(t){t.delete()})),this.inputs.length=0,this.instance.delete()},t.prototype.bindViewModelInstance=function(t){null!=t.runtimeInstance&&this.instance.bindViewModelInstance(t.runtimeInstance)},t}(),k=function(){function t(t,n,i,e,r){void 0===e&&(e=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=n,this.eventManager=i,this.animations=e,this.stateMachines=r}return t.prototype.add=function(t,n,i){if(void 0===i&&(i=!0),0===(t=Z(t)).length)this.animations.forEach((function(t){return t.playing=n})),this.stateMachines.forEach((function(t){return t.playing=n}));else for(var e=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),o=0;o<t.length;o++){var s=e.indexOf(t[o]),a=r.indexOf(t[o]);if(s>=0||a>=0)s>=0?this.animations[s].playing=n:this.stateMachines[a].playing=n;else{var c=this.artboard.animationByName(t[o]);if(c){var h=new u.Animation(c,this.artboard,this.runtime,n);h.advance(0),h.apply(1),this.animations.push(h)}else{var f=this.artboard.stateMachineByName(t[o]);if(f){var l=new M(f,this.runtime,n,this.artboard);this.stateMachines.push(l)}}}}return i&&this.eventManager.fire(n?{type:y.Play,data:this.playing}:{type:y.Pause,data:this.paused}),n?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,n){for(var i=this.animations.map((function(t){return t.name})),e=0;e<t.length;e++){var r=i.indexOf(t[e]);if(r>=0)this.animations[r].playing=n;else{var o=this.artboard.animationByName(t[e]);if(o){var s=new u.Animation(o,this.artboard,this.runtime,n);s.advance(0),s.apply(1),this.animations.push(s)}else console.error("Animation with name ".concat(t[e]," not found."))}}},t.prototype.initStateMachines=function(t,n){for(var i=this.stateMachines.map((function(t){return t.name})),e=0;e<t.length;e++){var r=i.indexOf(t[e]);if(r>=0)this.stateMachines[r].playing=n;else{var o=this.artboard.stateMachineByName(t[e]);if(o){var s=new M(o,this.runtime,n,this.artboard);this.stateMachines.push(s)}else console.warn("State Machine with name ".concat(t[e]," not found.")),this.initLinearAnimations([t[e]],n)}}},t.prototype.play=function(t){return this.add(t,!0)},t.prototype.advanceIfPaused=function(){this.stateMachines.forEach((function(t){t.playing||t.advanceAndApply(0)}))},t.prototype.pause=function(t){return this.add(t,!1)},t.prototype.scrub=function(t,n){var i=this.animations.filter((function(n){return t.includes(n.name)}));return i.forEach((function(t){return t.scrubTo=n})),i.map((function(t){return t.name}))},Object.defineProperty(t.prototype,"playing",{get:function(){return this.animations.filter((function(t){return t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paused",{get:function(){return this.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),t.prototype.stop=function(t){var n=this,i=[];if(0===(t=Z(t)).length)i=this.animations.map((function(t){return t.name})).concat(this.stateMachines.map((function(t){return t.name}))),this.animations.forEach((function(t){return t.cleanup()})),this.stateMachines.forEach((function(t){return t.cleanup()})),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var e=this.animations.filter((function(n){return t.includes(n.name)}));e.forEach((function(t){t.cleanup(),n.animations.splice(n.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(n){return t.includes(n.name)}));r.forEach((function(t){t.cleanup(),n.stateMachines.splice(n.stateMachines.indexOf(t),1)})),i=e.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:y.Stop,data:i}),i},Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animations.reduce((function(t,n){return t||n.playing}),!1)||this.stateMachines.reduce((function(t,n){return t||n.playing}),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),t.prototype.atLeastOne=function(t,n){var i;return void 0===n&&(n=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([i=this.artboard.animationByIndex(0).name],t,n):this.artboard.stateMachineCount()>0&&this.add([i=this.artboard.stateMachineByIndex(0).name],t,n)),i},t.prototype.handleLooping=function(){for(var t=0,n=this.animations.filter((function(t){return t.playing}));t<n.length;t++){var i=n[t];0===i.loopValue&&i.loopCount?(i.loopCount=0,this.stop(i.name)):1===i.loopValue&&i.loopCount?(this.eventManager.fire({type:y.Loop,data:{animation:i.name,type:_.Loop}}),i.loopCount=0):2===i.loopValue&&i.loopCount>1&&(this.eventManager.fire({type:y.Loop,data:{animation:i.name,type:_.PingPong}}),i.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],n=0,i=this.stateMachines.filter((function(t){return t.playing}));n<i.length;n++)t.push.apply(t,i[n].statesChanged);t.length>0&&this.eventManager.fire({type:y.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:y.Advance,data:t})},t}();!function(t){t.Load="load",t.LoadError="loaderror",t.Play="play",t.Pause="pause",t.Stop="stop",t.Loop="loop",t.Draw="draw",t.Advance="advance",t.StateChange="statechange",t.RiveEvent="riveevent",t.AudioStatusChange="audiostatuschange"}(y||(y={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(_||(_={}));var T,$=function(){function t(t){void 0===t&&(t=[]),this.listeners=t}return t.prototype.getListeners=function(t){return this.listeners.filter((function(n){return n.type===t}))},t.prototype.add=function(t){this.listeners.includes(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var n=0;n<this.listeners.length;n++){var i=this.listeners[n];if(i.type===t.type&&i.callback===t.callback){this.listeners.splice(n,1);break}}},t.prototype.removeAll=function(t){var n=this;t?this.listeners.filter((function(n){return n.type===t})).forEach((function(t){return n.remove(t)})):this.listeners.splice(0,this.listeners.length)},t.prototype.fire=function(t){this.getListeners(t.type).forEach((function(n){return n.callback(t)}))},t}(),E=function(){function t(t){this.eventManager=t,this.queue=[]}return t.prototype.add=function(t){this.queue.push(t)},t.prototype.process=function(){for(;this.queue.length>0;){var t=this.queue.shift();(null==t?void 0:t.action)&&t.action(),(null==t?void 0:t.event)&&this.eventManager.fire(t.event)}},t}();!function(t){t[t.AVAILABLE=0]="AVAILABLE",t[t.UNAVAILABLE=1]="UNAVAILABLE"}(T||(T={}));var x,P=new(function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n._started=!1,n._enabled=!1,n._status=T.UNAVAILABLE,n}return c(n,t),n.prototype.delay=function(t){return f(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(n){return setTimeout(n,t)}))]}))}))},n.prototype.timeout=function(){return f(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(t,n){return setTimeout(n,50)}))]}))}))},n.prototype.reportToListeners=function(){this.fire({type:y.AudioStatusChange}),this.removeAll()},n.prototype.enableAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(){return this._enabled||(this._enabled=!0,this._status=T.AVAILABLE,this.reportToListeners()),[2]}))}))},n.prototype.testAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:if(this._status!==T.UNAVAILABLE||null===this._audioContext)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return t.sent(),this.enableAudio(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},n.prototype._establishAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this._started?[3,5]:(this._started=!0,"undefined"!=typeof window?[3,1]:(this.enableAudio(),[3,5]));case 1:this._audioContext=new AudioContext,this.listenForUserAction(),t.label=2;case 2:return this._status!==T.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return t.sent(),[4,this.delay(1e3)];case 4:return t.sent(),[3,2];case 5:return[2]}}))}))},n.prototype.listenForUserAction=function(){var t=this;document.addEventListener("pointerdown",(function(){return f(t,void 0,void 0,(function(){return l(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},n.prototype.establishAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(n.prototype,"systemVolume",{get:function(){return this._status===T.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),n}($)),C=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),F=globalThis.ResizeObserver||C,I=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(n){var i=t._elementsMap.get(n.target);null!==i?i.onResize(0==n.target.clientWidth||0==n.target.clientHeight):t._resizeObserver.unobserve(n.target)},this._onObserved=function(n){n.forEach(t._onObservedEntry)},this._resizeObserver=new F(this._onObserved)}return t.prototype.add=function(t,n){var i={onResize:n,element:t};return this._elementsMap.set(t,i),this._resizeObserver.observe(t),i},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),S=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new $,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError)}return t.prototype.releaseFile=function(){var t;this.selfUnref&&(null===(t=this.file)||void 0===t||t.unref()),this.file=null},t.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach((function(t){return t.destroy()}))},t.prototype.initData=function(){return f(this,void 0,void 0,(function(){var n,i,e,r,o;return l(this,(function(s){switch(s.label){case 0:return this.src?(n=this,[4,J(this.src)]):[3,2];case 1:n.buffer=s.sent(),s.label=2;case 2:return this.destroyed?[2]:(this.assetLoader&&(e=new a.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),i=e.assetLoader),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),i,this.enableRiveAssetCDN)]);case 3:return r.file=s.sent(),o=new a.FileFinalizer(this.file),a.finalizationRegistry.register(this,o),this.destroyed?(this.releaseFile(),[2]):(null!==this.file?this.eventManager.fire({type:y.Load,data:this}):this.fireLoadError(t.fileLoadErrorMessage),[2])}}))}))},t.prototype.init=function(){return f(this,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(t.missingErrorMessage),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),n=this,[4,m.awaitInstance()];case 2:return n.runtime=e.sent(),this.destroyed?[2]:[4,this.initData()];case 3:return e.sent(),[3,5];case 4:return i=e.sent(),this.fireLoadError(i instanceof Error?i.message:t.fileLoadErrorMessage),[3,5];case 5:return[2]}}))}))},t.prototype.fireLoadError=function(t){throw this.eventManager.fire({type:y.LoadError,data:t}),new Error(t)},t.prototype.on=function(t,n){this.eventManager.add({type:t,callback:n})},t.prototype.off=function(t,n){this.eventManager.remove({type:t,callback:n})},t.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},t.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},t.prototype.createBindableArtboard=function(t){if(null!=t){var n=new O(t);return(0,a.createFinalization)(n,n.nativeArtboard),this.bindableArtboards.push(n),n}return null},t.prototype.getArtboard=function(t){var n=this.file.artboardByName(t);if(null!=n)return new A(n,this)},t.prototype.getBindableArtboard=function(t){var n=this.file.bindableArtboardByName(t);return this.createBindableArtboard(n)},t.prototype.getDefaultBindableArtboard=function(){var t=this.file.bindableArtboardDefault();return this.createBindableArtboard(t)},t.prototype.internalBindableArtboardFromArtboard=function(t){var n=this.file.internalBindableArtboardFromArtboard(t);return this.createBindableArtboard(n)},t.missingErrorMessage="Rive source file or data buffer required",t.fileLoadErrorMessage="The file failed to load",t}(),R=function(){function t(t){var n,i=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(t){var n=i._hasZeroSize!==t;i._hasZeroSize=t,t?i._layout.maxX&&i._layout.maxY||i.resizeToCanvas():n&&i.resizeDrawingSurfaceToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=I.add(this.canvas,this.onCanvasResize)),this.src=t.src,this.buffer=t.buffer,this.riveFile=t.riveFile,this.layout=null!==(n=t.layout)&&void 0!==n?n:new b,this.shouldDisableRiveListeners=!!t.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!t.isTouchScrollEnabled,this.automaticallyHandleEvents=!!t.automaticallyHandleEvents,this.dispatchPointerExit=!1===t.dispatchPointerExit?t.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!t.enableMultiTouch,this.enableRiveAssetCDN=void 0===t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new $,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError),t.onPlay&&this.on(y.Play,t.onPlay),t.onPause&&this.on(y.Pause,t.onPause),t.onStop&&this.on(y.Stop,t.onStop),t.onLoop&&this.on(y.Loop,t.onLoop),t.onStateChange&&this.on(y.StateChange,t.onStateChange),t.onAdvance&&this.on(y.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(y.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(y.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(y.Play,t.onplay),t.onpause&&!t.onPause&&this.on(y.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(y.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(y.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(y.StateChange,t.onstatechange),t.assetLoader&&(this.assetLoader=t.assetLoader),this.taskQueue=new E(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:t.autoplay,autoBind:t.autoBind,animations:t.animations,stateMachines:t.stateMachines,artboard:t.artboard,useOffscreenRenderer:t.useOffscreenRenderer})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(n){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(n)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(n){var i=this,e=n.buffer,r=n.riveFile,o=n.animations,s=n.stateMachines,u=n.artboard,a=n.autoplay,c=void 0!==a&&a,h=n.useOffscreenRenderer,f=void 0!==h&&h,l=n.autoBind,v=void 0!==l&&l;if(!this.destroyed){if(this.src=n.src,this.buffer=e,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new d(t.missingErrorMessage);var w=Z(o),b=Z(s);this.loaded=!1,this.readyForPlaying=!1,m.awaitInstance().then((function(t){i.destroyed||(i.runtime=t,i.removeRiveListeners(),i.deleteRiveRenderer(),i.renderer=i.runtime.makeRenderer(i.canvas,f),i.canvas.width||i.canvas.height||i.resizeDrawingSurfaceToCanvas(),i.initData(u,w,b,c,v).then((function(t){if(t)return i.setupRiveListeners()})).catch((function(t){console.error(t)})))})).catch((function(t){console.error(t)}))}},t.prototype.setupRiveListeners=function(t){var n=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var i=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&n.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),e=this.isTouchScrollEnabled,r=this.dispatchPointerExit,o=this.enableMultiTouch;t&&"isTouchScrollEnabled"in t&&(e=t.isTouchScrollEnabled),this.eventCleanup=(0,a.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:i,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:e,dispatchPointerExit:r,enableMultiTouch:o,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,n=this;P.status==T.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:y.AudioStatusChange,callback:function(){return n.onSystemAudioChanged()}},P.add(this._audioEventListener),P.establishAudio())},t.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},t.prototype.initData=function(t,n,i,e,r){return f(this,void 0,void 0,(function(){var o,s,u,a;return l(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(o=new S({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=o,[4,o.init()]);case 1:if(c.sent(),this.destroyed)return o.destroyIfUnused(),[2,!1];c.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,n,i,e,r),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:y.Load,data:null!==(a=this.src)&&void 0!==a?a:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return s=c.sent(),u=(h=s)&&h.isHandledError?h.message:"Problem loading file; may be corrupt!",console.warn(u),this.eventManager.fire({type:y.LoadError,data:u}),[2,Promise.reject(u)];case 4:return[2]}var h}))}))},t.prototype.initArtboard=function(t,n,i,e,r){if(this.file){var o,s=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!s){var u="Invalid artboard name or no default artboard";return console.warn(u),void this.eventManager.fire({type:y.LoadError,data:u})}if(this.artboard=s,s.volume=this._volume*P.systemVolume,this.animator=new k(this.runtime,this.artboard,this.eventManager),n.length>0||i.length>0?(o=n.concat(i),this.animator.initLinearAnimations(n,e),this.animator.initStateMachines(i,e)):o=[this.animator.atLeastOne(e,!1)],this.taskQueue.add({event:{type:e?y.Play:y.Pause,data:o}}),r){var c=this.file.defaultArtboardViewModel(s);if(null!==c){var h=c.defaultInstance();if(null!==h){var f=new D(h,null);(0,a.createFinalization)(f,f.runtimeInstance),this.bindViewModelInstance(f)}}}}},t.prototype.drawFrame=function(){var t,n;(null===(t=null===document||void 0===document?void 0:document.timeline)||void 0===t?void 0:t.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null===(n=this.runtime)||void 0===n||n.resolveAnimationFrame()):this.startRendering()},t.prototype.draw=function(t,n){var i;this.frameRequestId=null;var e=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==n||n());var r=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var o=0,s=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));o<s.length;o++){var u=s[o];u.advance(r),u.instance.didLoop&&(u.loopCount+=1),u.apply(1)}for(var c=0,h=this.animator.stateMachines.filter((function(t){return t.playing}));c<h.length;c++){var f=h[c],l=f.reportedEventCount();if(l)for(var v=0;v<l;v++){var d=f.reportedEventAt(v);if(d)if(d.type===p.OpenUrl){if(this.eventManager.fire({type:y.RiveEvent,data:d}),this.automaticallyHandleEvents){var w=document.createElement("a"),b=d.url,m=d.target,g=(0,a.sanitizeUrl)(b);b&&w.setAttribute("href",g),m&&w.setAttribute("target",m),g&&g!==a.BLANK_URL&&w.click()}}else this.eventManager.fire({type:y.RiveEvent,data:d})}f.advanceAndApply(r)}0==this.animator.stateMachines.length&&this.artboard.advance(r);var _=this.renderer;_.clear(),_.save(),this.alignRenderer(),this._hasZeroSize||this.artboard.draw(_),_.restore(),_.flush(),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(r),this.frameCount++;var j=performance.now();for(this.frameTimes.push(j),this.durations.push(j-e);this.frameTimes[0]<=j-1e3;)this.frameTimes.shift(),this.durations.shift();null===(i=this._viewModelInstance)||void 0===i||i.handleCallbacks(),this.animator.isPlaying?this.startRendering():(this.animator.isPaused||this.animator.isStopped)&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var t=this,n=t.runtime,i=t._layout,e=t.artboard;t.renderer.align(i.runtimeFit(n),i.runtimeAlignment(n),{minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY},e.bounds,this._devicePixelRatioUsed*i.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce((function(t,n){return t+n}),0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var t,n;this.destroyed=!0,this.stopRendering(),this.cleanupInstances(),null!==this._observed&&I.remove(this._observed),this.removeRiveListeners(),this.file&&(null===(t=this.riveFile)||void 0===t||t.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(P.remove(this._audioEventListener),this._audioEventListener=null),null===(n=this._viewModelInstance)||void 0===n||n.cleanup(),this._viewModelInstance=null,this._dataEnums=null},t.prototype.deleteRiveRenderer=function(){var t;null===(t=this.renderer)||void 0===t||t.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(t){var n;if(t)if(this.artboard){var i=this.artboard.textRun(t);if(i)return i;console.warn("Could not access a text run with name '".concat(t,"' in the '").concat(null===(n=this.artboard)||void 0===n?void 0:n.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))}else console.warn("Tried to access text run, but the Artboard is null");else console.warn("No text run name provided")},t.prototype.getTextRunValue=function(t){var n=this.retrieveTextRun(t);return n?n.text:void 0},t.prototype.setTextRunValue=function(t,n){var i=this.retrieveTextRun(t);i&&(i.text=n)},t.prototype.play=function(t,n){var i=this;t=Z(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return i.play(t,n)}})},t.prototype.pause=function(t){var n=this;t=Z(t),this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.animator.pause(t)):this.taskQueue.add({action:function(){return n.pause(t)}})},t.prototype.scrub=function(t,n){var i=this;t=Z(t),this.readyForPlaying?(this.animator.scrub(t,n||0),this.drawFrame()):this.taskQueue.add({action:function(){return i.scrub(t,n)}})},t.prototype.stop=function(t){var n=this;t=Z(t),this.readyForPlaying?(this.animator&&this.animator.stop(t),this.eventCleanup&&this.eventCleanup()):this.taskQueue.add({action:function(){return n.stop(t)}})},t.prototype.reset=function(t){var n,i,e=null==t?void 0:t.artboard,r=Z(null==t?void 0:t.animations),o=Z(null==t?void 0:t.stateMachines),s=null!==(n=null==t?void 0:t.autoplay)&&void 0!==n&&n,u=null!==(i=null==t?void 0:t.autoBind)&&void 0!==i&&i;this.cleanupInstances(),this.initArtboard(e,r,o,s,u),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var i=this.canvas.getBoundingClientRect(),e=i.width,r=i.height,o=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=o,this.canvas.width=o*e,this.canvas.height=o*r,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===n.Layout){var s=this._layout.layoutScaleFactor;this.artboard.width=e/s,this.artboard.height=r/s}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],n=0;n<this.artboard.animationCount();n++)t.push(this.artboard.animationByIndex(n).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],n=0;n<this.artboard.stateMachineCount();n++)t.push(this.artboard.stateMachineByIndex(n).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var n=this.animator.stateMachines.find((function(n){return n.name===t}));return null==n?void 0:n.inputs}},t.prototype.retrieveInputAtPath=function(t,n){if(t)if(this.artboard){var i=this.artboard.inputByPath(t,n);if(i)return i;console.warn("Could not access an input with name: '".concat(t,"', at path:'").concat(n,"'"))}else console.warn("Tried to access input: '".concat(t,"', at path: '").concat(n,"', but the Artboard is null"));else console.warn("No input name provided for path '".concat(n,"'"))},t.prototype.setBooleanStateAtPath=function(t,n,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===w.Boolean?e.asBool().value=n:console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,n,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===w.Number?e.asNumber().value=n:console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a number")))},t.prototype.fireStateAtPath=function(t,n){var i=this.retrieveInputAtPath(t,n);i&&(i.type===w.Trigger?i.asTrigger().fire():console.warn("Input with name: '".concat(t,"', at path:'").concat(n,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(t,n){if(t)if(n)if(this.artboard){var i=this.artboard.textByPath(t,n);if(i)return i;console.warn("Could not access text with name: '".concat(t,"', at path:'").concat(n,"'"))}else console.warn("Tried to access text: '".concat(t,"', at path: '").concat(n,"', but the Artboard is null"));else console.warn("No path provided for text '".concat(t,"'"));else console.warn("No text name provided for path '".concat(n,"'"))},t.prototype.getTextRunValueAtPath=function(t,n){var i=this.retrieveTextAtPath(t,n);if(i)return i.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(n,"'"))},t.prototype.setTextRunValueAtPath=function(t,n,i){var e=this.retrieveTextAtPath(t,i);e?e.text=n:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(i,"'"))},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return this.animator.isStopped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(t,n){this.eventManager.add({type:t,callback:n})},t.prototype.off=function(t,n){this.eventManager.remove({type:t,callback:n})},t.prototype.unsubscribe=function(t,n){console.warn("This function is deprecated: please use `off()` instead."),this.off(t,n)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.unsubscribeAll=function(t){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(t)},t.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.frameRequestId=this.runtime.requestAnimationFrame?this.runtime.requestAnimationFrame(this._boundDraw):requestAnimationFrame(this._boundDraw))},t.prototype.enableFPSCounter=function(t){this.runtime.enableFPSCounter(t)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var t={artboards:[]},n=0;n<this.file.artboardCount();n++){for(var i=this.file.artboardByIndex(n),e={name:i.name,animations:[],stateMachines:[]},r=0;r<i.animationCount();r++){var o=i.animationByIndex(r);e.animations.push(o.name)}for(var s=0;s<i.stateMachineCount();s++){for(var u=i.stateMachineByIndex(s),a=u.name,c=new this.runtime.StateMachineInstance(u,i),h=[],f=0;f<c.inputCount();f++){var l=c.input(f);h.push({name:l.name,type:l.type})}e.stateMachines.push({name:a,inputs:h})}t.artboards.push(e)}return t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(t){this._volume=t,this.artboard&&(this.artboard.volume=t*P.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(t){var n;this.artboard&&!this.destroyed&&t&&t.runtimeInstance&&(t.internalIncrementReferenceCount(),null===(n=this._viewModelInstance)||void 0===n||n.cleanup(),this._viewModelInstance=t,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach((function(n){return n.bindViewModelInstance(t)})):this.artboard.bindViewModelInstance(t.runtimeInstance))},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.viewModelByIndex=function(t){var n=this.file.viewModelByIndex(t);return null!==n?new W(n):null},t.prototype.viewModelByName=function(t){var n=this.file.viewModelByName(t);return null!==n?new W(n):null},t.prototype.enums=function(){if(null===this._dataEnums){var t=this.file.enums();this._dataEnums=t.map((function(t){return new L(t)}))}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var t=this.file.defaultArtboardViewModel(this.artboard);if(t)return new W(t)}return null},t.prototype.getArtboard=function(t){var n,i;return null!==(i=null===(n=this.riveFile)||void 0===n?void 0:n.getArtboard(t))&&void 0!==i?i:null},t.prototype.getBindableArtboard=function(t){var n,i;return null!==(i=null===(n=this.riveFile)||void 0===n?void 0:n.getBindableArtboard(t))&&void 0!==i?i:null},t.prototype.getDefaultBindableArtboard=function(){var t,n;return null!==(n=null===(t=this.riveFile)||void 0===t?void 0:t.getDefaultBindableArtboard())&&void 0!==n?n:null},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),W=function(){function t(t){this._viewModel=t}return Object.defineProperty(t.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),t.prototype.instanceByIndex=function(t){var n=this._viewModel.instanceByIndex(t);if(null!==n){var i=new D(n,null);return(0,a.createFinalization)(i,n),i}return null},t.prototype.instanceByName=function(t){var n=this._viewModel.instanceByName(t);if(null!==n){var i=new D(n,null);return(0,a.createFinalization)(i,n),i}return null},t.prototype.defaultInstance=function(){var t=this._viewModel.defaultInstance();if(null!==t){var n=new D(t,null);return(0,a.createFinalization)(n,t),n}return null},t.prototype.instance=function(){var t=this._viewModel.instance();if(null!==t){var n=new D(t,null);return(0,a.createFinalization)(n,t),n}return null},Object.defineProperty(t.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),t}(),L=function(){function t(t){this._dataEnum=t}return Object.defineProperty(t.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),t}();!function(t){t.Number="number",t.String="string",t.Boolean="boolean",t.Color="color",t.Trigger="trigger",t.Enum="enum",t.List="list",t.Image="image",t.Artboard="artboard"}(x||(x={}));var D=function(){function t(t,n){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=t,null!==n&&this._parents.push(n)}return Object.defineProperty(t.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),t.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach((function(t){t.handleCallbacks()})),this._propertiesWithCallbacks.forEach((function(t){t.clearChanges()}))),this._children.forEach((function(t){return t.handleCallbacks()}))},t.prototype.addParent=function(t){this._parents.includes(t)||(this._parents.push(t),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&t.addToViewModelCallbacks(this))},t.prototype.removeParent=function(t){var n=this._parents.indexOf(t);-1!==n&&(this._parents[n].removeFromViewModelCallbacks(this),this._parents.splice(n,1))},t.prototype.addToPropertyCallbacks=function(t){var n=this;this._propertiesWithCallbacks.includes(t)||(this._propertiesWithCallbacks.push(t),this._propertiesWithCallbacks.length>0&&this._parents.forEach((function(t){t.addToViewModelCallbacks(n)})))},t.prototype.removeFromPropertyCallbacks=function(t){var n=this;this._propertiesWithCallbacks.includes(t)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter((function(n){return n!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(n)})))},t.prototype.addToViewModelCallbacks=function(t){var n=this;this._children.includes(t)||(this._children.push(t),this._parents.forEach((function(t){t.addToViewModelCallbacks(n)})))},t.prototype.removeFromViewModelCallbacks=function(t){var n=this;this._children.includes(t)&&(this._children=this._children.filter((function(n){return n!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(n)})))},t.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach((function(t){t.clearCallbacks()}))},t.prototype.propertyFromPath=function(t,n){var i=t.split("/");return this.propertyFromPathSegments(i,0,n)},t.prototype.viewModelFromPathSegments=function(t,n){var i=this.internalViewModelInstance(t[n]);return null!==i?n==t.length-1?i:i.viewModelFromPathSegments(t,n++):null},t.prototype.propertyFromPathSegments=function(t,n,i){var e,r,o,s,u,a,c,h,f,l,v,d,w,b,m,p,g,y;if(n<t.length-1){var _=this.internalViewModelInstance(t[n]);return null!==_?_.propertyFromPathSegments(t,n+1,i):null}var j=null;switch(i){case x.Number:if(null!==(j=null!==(r=null===(e=this._runtimeInstance)||void 0===e?void 0:e.number(t[n]))&&void 0!==r?r:null))return new N(j,this);break;case x.String:if(null!==(j=null!==(s=null===(o=this._runtimeInstance)||void 0===o?void 0:o.string(t[n]))&&void 0!==s?s:null))return new V(j,this);break;case x.Boolean:if(null!==(j=null!==(a=null===(u=this._runtimeInstance)||void 0===u?void 0:u.boolean(t[n]))&&void 0!==a?a:null))return new z(j,this);break;case x.Color:if(null!==(j=null!==(h=null===(c=this._runtimeInstance)||void 0===c?void 0:c.color(t[n]))&&void 0!==h?h:null))return new Y(j,this);break;case x.Trigger:if(null!==(j=null!==(l=null===(f=this._runtimeInstance)||void 0===f?void 0:f.trigger(t[n]))&&void 0!==l?l:null))return new X(j,this);break;case x.Enum:if(null!==(j=null!==(d=null===(v=this._runtimeInstance)||void 0===v?void 0:v.enum(t[n]))&&void 0!==d?d:null))return new G(j,this);break;case x.List:if(null!==(j=null!==(b=null===(w=this._runtimeInstance)||void 0===w?void 0:w.list(t[n]))&&void 0!==b?b:null))return new H(j,this);break;case x.Image:if(null!==(j=null!==(p=null===(m=this._runtimeInstance)||void 0===m?void 0:m.image(t[n]))&&void 0!==p?p:null))return new B(j,this);break;case x.Artboard:if(null!==(j=null!==(y=null===(g=this._runtimeInstance)||void 0===g?void 0:g.artboard(t[n]))&&void 0!==y?y:null))return new q(j,this)}return null},t.prototype.internalViewModelInstance=function(n){var i;if(this._viewModelInstances.has(n))return this._viewModelInstances.get(n);var e=null===(i=this._runtimeInstance)||void 0===i?void 0:i.viewModel(n);if(null!==e){var r=new t(e,this);return(0,a.createFinalization)(r,e),r.internalIncrementReferenceCount(),this._viewModelInstances.set(n,r),r}return null},t.prototype.number=function(t){return this.propertyFromPath(t,x.Number)},t.prototype.string=function(t){return this.propertyFromPath(t,x.String)},t.prototype.boolean=function(t){return this.propertyFromPath(t,x.Boolean)},t.prototype.color=function(t){return this.propertyFromPath(t,x.Color)},t.prototype.trigger=function(t){return this.propertyFromPath(t,x.Trigger)},t.prototype.enum=function(t){return this.propertyFromPath(t,x.Enum)},t.prototype.list=function(t){return this.propertyFromPath(t,x.List)},t.prototype.image=function(t){return this.propertyFromPath(t,x.Image)},t.prototype.artboard=function(t){return this.propertyFromPath(t,x.Artboard)},t.prototype.viewModel=function(t){var n=t.split("/"),i=n.length>1?this.viewModelFromPathSegments(n.slice(0,n.length-1),0):this;return null!=i?i.internalViewModelInstance(n[n.length-1]):null},t.prototype.internalReplaceViewModel=function(t,n){var i;if(null!==n.runtimeInstance){var e=(null===(i=this._runtimeInstance)||void 0===i?void 0:i.replaceViewModel(t,n.runtimeInstance))||!1;if(e){n.internalIncrementReferenceCount();var r=this.internalViewModelInstance(t);null!==r&&(r.removeParent(this),this._children.includes(r)&&(this._children=this._children.filter((function(t){return t!==r}))),r.cleanup()),this._viewModelInstances.set(t,n),n.addParent(this)}return e}return!1},t.prototype.replaceViewModel=function(t,n){var i,e=t.split("/"),r=e.length>1?this.viewModelFromPathSegments(e.slice(0,e.length-1),0):this;return null!==(i=null==r?void 0:r.internalReplaceViewModel(e[e.length-1],n))&&void 0!==i&&i},t.prototype.incrementReferenceCount=function(){var t;this._referenceCount++,null===(t=this._runtimeInstance)||void 0===t||t.incrementReferenceCount()},t.prototype.decrementReferenceCount=function(){var t;this._referenceCount--,null===(t=this._runtimeInstance)||void 0===t||t.decrementReferenceCount()},Object.defineProperty(t.prototype,"properties",{get:function(){var t;return(null===(t=this._runtimeInstance)||void 0===t?void 0:t.getProperties().map((function(t){return h({},t)})))||[]},enumerable:!1,configurable:!0}),t.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},t.prototype.cleanup=function(){var t,n=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null===(t=this._runtimeInstance)||void 0===t||t.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach((function(t){t.cleanup()})),this._viewModelInstances.clear();var i=v([],this._children,!0);this._children.length=0;var e=v([],this._parents,!0);this._parents.length=0,i.forEach((function(t){t.removeParent(n)})),e.forEach((function(t){t.removeFromViewModelCallbacks(n)}))}},t}(),U=function(){function t(t,n){this.callbacks=[],this._viewModelInstanceValue=t,this._parentViewModel=n}return t.prototype.on=function(t){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(t)||(this.callbacks.push(t),this._parentViewModel.addToPropertyCallbacks(this))},t.prototype.off=function(t){t?this.callbacks=this.callbacks.filter((function(n){return n!==t})):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},t.prototype.internalHandleCallback=function(){},t.prototype.handleCallbacks=function(){var t=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach((function(n){t.internalHandleCallback(n)}))},t.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},t.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),t}(),V=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),N=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),z=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),X=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),n.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},n.prototype.internalHandleCallback=function(t){t()},n}(U),G=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(t){this._viewModelInstanceValue.valueIndex=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),H=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),n.prototype.addInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.addInstance(t.runtimeInstance),t.addParent(this._parentViewModel))},n.prototype.addInstanceAt=function(t,n){return!(null==t.runtimeInstance||!this._viewModelInstanceValue.addInstanceAt(t.runtimeInstance,n)||(t.addParent(this._parentViewModel),0))},n.prototype.removeInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(t.runtimeInstance),t.removeParent(this._parentViewModel))},n.prototype.removeInstanceAt=function(t){this._viewModelInstanceValue.removeInstanceAt(t)},n.prototype.instanceAt=function(t){var n=this._viewModelInstanceValue.instanceAt(t);if(null!=n){var i=new D(n,this._parentViewModel);return(0,a.createFinalization)(i,n),i}return null},n.prototype.swap=function(t,n){this._viewModelInstanceValue.swap(t,n)},n.prototype.internalHandleCallback=function(t){t()},n}(U),Y=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.rgb=function(t,n,i){this._viewModelInstanceValue.rgb(t,n,i)},n.prototype.rgba=function(t,n,i,e){this._viewModelInstanceValue.argb(e,t,n,i)},n.prototype.argb=function(t,n,i,e){this._viewModelInstanceValue.argb(t,n,i,e)},n.prototype.alpha=function(t){this._viewModelInstanceValue.alpha(t)},n.prototype.opacity=function(t){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,t))))},n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),B=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{set:function(t){var n;this._viewModelInstanceValue.value(null!==(n=null==t?void 0:t.nativeImage)&&void 0!==n?n:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t()},n}(U),q=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{set:function(t){var n,i;i=t.isBindableArtboard?t:t.file.internalBindableArtboardFromArtboard(t.nativeArtboard),this._viewModelInstanceValue.value(null!==(n=null==i?void 0:i.nativeArtboard)&&void 0!==n?n:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t()},n}(U),J=function(t){return f(void 0,void 0,void 0,(function(){var n;return l(this,(function(i){switch(i.label){case 0:return n=new Request(t),[4,fetch(n)];case 1:return[4,i.sent().arrayBuffer()];case 2:return[2,i.sent()]}}))}))},Z=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},K={EventManager:$,TaskQueueManager:E},Q=function(t){return f(void 0,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(n){return m.getInstance((function(i){i.decodeAudio(t,n)}))}))];case 1:return n=e.sent(),i=new a.AudioWrapper(n),a.finalizationRegistry.register(i,n),[2,i]}}))}))},tt=function(t){return f(void 0,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(n){return m.getInstance((function(i){i.decodeImage(t,n)}))}))];case 1:return n=e.sent(),i=new a.ImageWrapper(n),a.finalizationRegistry.register(i,n),[2,i]}}))}))},nt=function(t){return f(void 0,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(n){return m.getInstance((function(i){i.decodeFont(t,n)}))}))];case 1:return n=e.sent(),i=new a.FontWrapper(n),a.finalizationRegistry.register(i,n),[2,i]}}))}))}})(),e})(),f.exports=h());const v=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.id="",this.value="",this.height="",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.src="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.delayVisible="",this.initializeRive=t=>{const n=e.getInstance(),i=this.el.querySelector("canvas");this.riveInstance=new l.Rive({src:t,canvas:i,stateMachines:"Idle",autoplay:!0,onLoad:()=>{this.riveInstance.resizeDrawingSurfaceToCanvas(),n.setRiveInstance(this.riveInstance)}})}}async componentDidLoad(){l.RuntimeLoader.setWasmUrl(t.RIVE_WASM_URL),r(this.el,this.delayVisible),o(this.el,this.type),this.initializeRive(s(this.src))}render(){return u(a,{key:"14599bbd626e766d35b9611f80dd401ee76717b4",id:this.id,type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,backgroundColor:this.bgColor,top:this.y,left:this.x,display:this.visible?"flex":"none",zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,src:this.src},u("canvas",{key:"6f128e61bee6797c0cf83c15b3fd3ba4d1d7b1ea",class:"lido-canvas"}))}static get assetsDirs(){return["."]}get el(){return this}static get style(){return".lido-canvas{height:100%;width:100%}"}},[0,"lido-avatar",{id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[4],audio:[1],src:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],delayVisible:[1,"delay-visible"]}]);function d(){"undefined"!=typeof customElements&&["lido-avatar"].forEach((t=>{"lido-avatar"===t&&(customElements.get(n(t))||customElements.define(n(t),v))}))}v.RIVE_WASM_URL="https://unpkg.com/@rive-app/canvas@2.32.0/rive.wasm",d();export{v as L,d}
1
+ import{p as t,t as n,H as i,R as e,k as r,i as o,c as s,h as u,b as a}from"./index.js";var c,h,f={exports:{}},l=c?f.exports:(c=1,h=()=>(()=>{var t=[,(t,n,i)=>{i.r(n),i.d(n,{default:()=>o});var e,r=(e="undefined"!=typeof document?document.currentScript?.src:void 0,function(t={}){var n,i,r=t,o=new Promise(((t,e)=>{n=t,i=e})),s="object"==typeof window,u="function"==typeof importScripts;function a(){function t(t){const o=e;i=n=0,e=new Map,o.forEach((n=>{try{n(t)}catch(t){console.error(t)}})),this.nb(),r&&r.Pb()}let n=0,i=0,e=new Map,r=null,o=null;this.requestAnimationFrame=function(r){n||=requestAnimationFrame(t.bind(this));const o=++i;return e.set(o,r),o},this.cancelAnimationFrame=function(t){e.delete(t),n&&0==e.size&&(cancelAnimationFrame(n),n=0)},this.Nb=function(t){o&&(document.body.remove(o),o=null),t||(o=document.createElement("div"),o.style.backgroundColor="black",o.style.position="fixed",o.style.right=0,o.style.top=0,o.style.color="white",o.style.padding="4px",o.innerHTML="RIVE FPS",t=function(t){o.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(o)),r=new function(){let n=0,i=0;this.Pb=function(){var e=performance.now();i?(++n,1e3<(e-=i)&&(t(1e3*n/e),n=i=0)):(i=e,n=0)}}},this.Kb=function(){o&&(document.body.remove(o),o=null),r=null},this.nb=function(){}}function c(t){console.assert(!0);const n=new Map;let i=-1/0;this.push=function(e){return n.has(e=e+((1<<t)-1)>>t)&&clearTimeout(n.get(e)),n.set(e,setTimeout((function(){n.delete(e),0==n.length?i=-1/0:e==i&&(i=Math.max(...n.keys()),console.assert(i<e))}),1e3)),i=Math.max(e,i),i<<t}}const h=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){h&&h();let t=r.decodeAudio;r.decodeAudio=function(n,i){i(n=t(n))};let n=r.decodeFont;r.decodeFont=function(t,i){i(t=n(t))};const i=r.FileAssetLoader;r.ptrToAsset=t=>{let n=r.ptrToFileAsset(t);return n.isImage?r.ptrToImageAsset(t):n.isFont?r.ptrToFontAsset(t):n.isAudio?r.ptrToAudioAsset(t):n},r.CustomFileAssetLoader=i.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Db=t},loadContents:function(t,n){return t=r.ptrToAsset(t),this.Db(t,n)}}),r.CDNFileAssetLoader=i.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let n=r.ptrToAsset(t);return""!==(t=n.cdnUuid)&&(i=n.cdnBaseUrl+"/"+t,(e=new XMLHttpRequest).responseType="arraybuffer",e.onreadystatechange=function(){4==e.readyState&&200==e.status&&(t=>{n.decode(new Uint8Array(t.response))})(e)},e.open("GET",i,!0),e.send(null),!0);var i,e}}),r.FallbackFileAssetLoader=i.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.jb=[]},addLoader:function(t){this.jb.push(t)},loadContents:function(t,n){for(let i of this.jb)if(i.loadContents(t,n))return!0;return!1}});let e=r.computeAlignment;r.computeAlignment=function(t,n,i,r,o=1){return e.call(this,t,n,i,r,o)}};const f="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),l=new function(){function t(){if(!n){var t=document.createElement("canvas"),s={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let u;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(u=t.getContext("webgl",s),i=1,!u)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(u=t.getContext("webgl2",s))i=2;else{if(!(u=t.getContext("webgl",s)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;i=1}function c(t,n,i){if(n=u.createShader(n),u.shaderSource(n,i),u.compileShader(n),0<((i=u.getShaderInfoLog(n))||"").length)throw i;u.attachShader(t,n)}if(u=new Proxy(u,{get:(t,n)=>t.isContextLost()?(a||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",n),a=!0),"function"==typeof t[n]?function(){}:void 0):"function"==typeof t[n]?function(...i){return t[n].apply(t,i)}:t[n],set(t,n,i){if(!t.isContextLost())return t[n]=i,!0;a||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+n),a=!0)}}),e=Math.min(u.getParameter(u.MAX_RENDERBUFFER_SIZE),u.getParameter(u.MAX_TEXTURE_SIZE)),c(t=u.createProgram(),u.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 }"),c(t,u.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),u.bindAttribLocation(t,0,"vertex"),u.bindAttribLocation(t,1,"uv"),u.linkProgram(t),0<((s=u.getProgramInfoLog(t))||"").trim().length)throw s;r=u.getUniformLocation(t,"mat"),o=u.getUniformLocation(t,"translate"),u.useProgram(t),u.bindBuffer(u.ARRAY_BUFFER,u.createBuffer()),u.enableVertexAttribArray(0),u.enableVertexAttribArray(1),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,u.createBuffer()),u.uniform1i(u.getUniformLocation(t,"image"),0),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n=u}return!0}let n=null,i=0,e=0,r=null,o=null,s=0,u=0,a=!1;t(),this.ac=function(){return t(),e},this.Jb=function(t){n.deleteTexture&&n.deleteTexture(t)},this.Ib=function(e){if(!t())return null;const r=n.createTexture();return r?(n.bindTexture(n.TEXTURE_2D,r),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),2==i?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.generateMipmap(n.TEXTURE_2D)):n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),r):null};const h=new c(8),f=new c(8),l=new c(10),v=new c(10);this.Mb=function(i,e,a,c,d){if(t()){var w=h.push(i),b=f.push(e);if(n.canvas){for(var m of(n.canvas.width==w&&n.canvas.height==b||(n.canvas.width=w,n.canvas.height=b),n.viewport(0,b-e,i,e),n.disable(n.SCISSOR_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.SCISSOR_TEST),a.sort(((t,n)=>n.ub-t.ub)),w=l.push(c),s!=w&&(n.bufferData(n.ARRAY_BUFFER,8*w,n.DYNAMIC_DRAW),s=w),w=0,a))n.bufferSubData(n.ARRAY_BUFFER,w,m.Sa),w+=4*m.Sa.length;for(var p of(console.assert(w==4*c),a))n.bufferSubData(n.ARRAY_BUFFER,w,p.Ab),w+=4*p.Ab.length;for(var g of(console.assert(w==8*c),w=v.push(d),u!=w&&(n.bufferData(n.ELEMENT_ARRAY_BUFFER,2*w,n.DYNAMIC_DRAW),u=w),m=0,a))n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,m,g.indices),m+=2*g.indices.length;console.assert(m==2*d),g=0,p=!0,w=m=0;for(const t of a){t.image.Ia!=g&&(n.bindTexture(n.TEXTURE_2D,t.image.Ha||null),g=t.image.Ia),t.fc?(n.scissor(t.Ya,b-t.Za-t.ib,t.tc,t.ib),p=!0):p&&(n.scissor(0,b-e,i,e),p=!1);const s=-2/e;n.uniform4f(r,t.ga[0]*(a=2/i)*t.za,t.ga[1]*s*t.Aa,t.ga[2]*a*t.za,t.ga[3]*s*t.Aa),n.uniform2f(o,t.ga[4]*a*t.za+a*(t.Ya-t.bc*t.za)-1,t.ga[5]*s*t.Aa+s*(t.Za-t.cc*t.Aa)+1),n.vertexAttribPointer(0,2,n.FLOAT,!1,0,w),n.vertexAttribPointer(1,2,n.FLOAT,!1,0,w+4*c),n.drawElements(n.TRIANGLES,t.indices.length,n.UNSIGNED_SHORT,m),w+=4*t.Sa.length,m+=2*t.indices.length}console.assert(w==4*c),console.assert(m==2*d)}}},this.canvas=function(){return t()&&n.canvas}},v=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case d.srcOver:return"source-over";case d.screen:return"screen";case d.overlay:return"overlay";case d.darken:return"darken";case d.lighten:return"lighten";case d.colorDodge:return"color-dodge";case d.colorBurn:return"color-burn";case d.hardLight:return"hard-light";case d.softLight:return"soft-light";case d.difference:return"difference";case d.exclusion:return"exclusion";case d.multiply:return"multiply";case d.hue:return"hue";case d.saturation:return"saturation";case d.color:return"color";case d.luminosity:return"luminosity"}}function n(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function i(){0<O.length&&(l.Mb(A.drawWidth(),A.drawHeight(),O,M,k),O=[],k=M=0,A.reset(512,512));for(const t of j){for(const n of t.H)n();t.H=[]}j.clear()}v&&v();var e=r.RenderPaintStyle;const o=r.RenderPath,s=r.RenderPaint,u=r.Renderer,c=r.StrokeCap,h=r.StrokeJoin,d=r.BlendMode,w=e.fill,b=e.stroke,m=r.FillRule.evenOdd;let p=1;var g=r.RenderImage.extend("CanvasRenderImage",{__construct:function({ka:t,va:n}={}){this.__parent.__construct.call(this),this.Ia=p,p=p+1&2147483647||1,this.ka=t,this.va=n},__destruct:function(){this.Ha&&(l.Jb(this.Ha),URL.revokeObjectURL(this.Va)),this.__parent.__destruct.call(this)},decode:function(t){var n=this;n.va&&n.va(n);var i=new Image;n.Va=URL.createObjectURL(new Blob([t],{type:"image/png"})),i.onload=function(){n.Cb=i,n.Ha=l.Ib(i),n.size(i.width,i.height),n.ka&&n.ka(n)},i.src=n.Va}}),y=o.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,n,i,e,r,o,s){var u=this.T,a=u.addPath;t=t.T;const c=new DOMMatrix;c.a=n,c.b=i,c.c=e,c.d=r,c.e=o,c.f=s,a.call(u,t,c)},fillRule:function(t){this.Ua=t},moveTo:function(t,n){this.T.moveTo(t,n)},lineTo:function(t,n){this.T.lineTo(t,n)},cubicTo:function(t,n,i,e,r,o){this.T.bezierCurveTo(t,n,i,e,r,o)},close:function(){this.T.closePath()}}),_=s.extend("CanvasRenderPaint",{color:function(t){this.Wa=n(t)},thickness:function(t){this.Fb=t},join:function(t){switch(t){case h.miter:this.Ga="miter";break;case h.round:this.Ga="round";break;case h.bevel:this.Ga="bevel"}},cap:function(t){switch(t){case c.butt:this.Fa="butt";break;case c.round:this.Fa="round";break;case c.square:this.Fa="square"}},style:function(t){this.Eb=t},blendMode:function(n){this.Bb=t(n)},clearGradient:function(){this.ia=null},linearGradient:function(t,n,i,e){this.ia={wb:t,xb:n,bb:i,cb:e,Pa:[]}},radialGradient:function(t,n,i,e){this.ia={wb:t,xb:n,bb:i,cb:e,Pa:[],$b:!0}},addStop:function(t,n){this.ia.Pa.push({color:t,stop:n})},completeGradient:function(){},draw:function(t,i,e){let r=this.Eb;var o=this.Wa,s=this.ia;if(t.globalCompositeOperation=this.Bb,null!=s){o=s.wb;var u=s.xb;const i=s.bb;var a=s.cb;const e=s.Pa;s.$b?(s=i-o,a-=u,o=t.createRadialGradient(o,u,0,o,u,Math.sqrt(s*s+a*a))):o=t.createLinearGradient(o,u,i,a);for(let t=0,i=e.length;t<i;t++)o.addColorStop((u=e[t]).stop,n(u.color));this.Wa=o,this.ia=null}switch(r){case b:t.strokeStyle=o,t.lineWidth=this.Fb,t.lineCap=this.Fa,t.lineJoin=this.Ga,t.stroke(i);break;case w:t.fillStyle=o,t.fill(i,e)}}});const j=new Set;let A=null,O=[],M=0,k=0;var T=r.CanvasRenderer=u.extend("Renderer",{__construct:function(t){this.__parent.__construct.call(this),this.S=[1,0,0,1,0,0],this.B=t.getContext("2d"),this.Ta=t,this.H=[]},save:function(){this.S.push(...this.S.slice(this.S.length-6)),this.H.push(this.B.save.bind(this.B))},restore:function(){const t=this.S.length-6;if(6>t)throw"restore() called without matching save().";this.S.splice(t),this.H.push(this.B.restore.bind(this.B))},transform:function(t,n,i,e,r,o){const s=this.S,u=s.length-6;s.splice(u,6,s[u]*t+s[u+2]*n,s[u+1]*t+s[u+3]*n,s[u]*i+s[u+2]*e,s[u+1]*i+s[u+3]*e,s[u]*r+s[u+2]*o+s[u+4],s[u+1]*r+s[u+3]*o+s[u+5]),this.H.push(this.B.transform.bind(this.B,t,n,i,e,r,o))},rotate:function(t){const n=Math.sin(t);t=Math.cos(t),this.transform(t,n,-n,t,0,0)},_drawPath:function(t,n){this.H.push(n.draw.bind(n,this.B,t.T,t.Ua===m?"evenodd":"nonzero"))},_drawRiveImage:function(n,i,e,r){var o=n.Cb;if(o){var s=this.B,u=t(e);this.H.push((function(){s.globalCompositeOperation=u,s.globalAlpha=r,s.drawImage(o,0,0),s.globalAlpha=1}))}},_getMatrix:function(t){const n=this.S,i=n.length-6;for(let e=0;6>e;++e)t[e]=n[i+e]},_drawImageMesh:function(n,e,o,s,u,a,c,h,f,v,d){e=this.B.canvas.width;var w=this.B.canvas.height;const b=v-h,m=d-f;h=Math.max(h,0),f=Math.max(f,0),v=Math.min(v,e),d=Math.min(d,w);const p=v-h,g=d-f;if(console.assert(p<=Math.min(b,e)),console.assert(g<=Math.min(m,w)),!(0>=p||0>=g)){v=p<b||g<m,e=d=1;var y=Math.ceil(p*d),_=Math.ceil(g*e);w=l.ac(),y>w&&(d*=w/y,y=w),_>w&&(e*=w/_,_=w),A||(A=new r.DynamicRectanizer(w),A.reset(512,512)),0>(w=A.addRect(y,_))&&(i(),j.add(this),w=A.addRect(y,_),console.assert(0<=w));var T=65535&w,$=w>>16;O.push({ga:this.S.slice(this.S.length-6),image:n,Ya:T,Za:$,bc:h,cc:f,tc:y,ib:_,za:d,Aa:e,Sa:new Float32Array(u),Ab:new Float32Array(a),indices:new Uint16Array(c),fc:v,ub:n.Ia<<1|(v?1:0)}),M+=u.length,k+=c.length;var E=this.B,x=t(o);this.H.push((function(){E.save(),E.resetTransform(),E.globalCompositeOperation=x,E.globalAlpha=s;const t=l.canvas();t&&E.drawImage(t,T,$,y,_,h,f,p,g),E.restore()}))}},_clipPath:function(t){this.H.push(this.B.clip.bind(this.B,t.T,t.Ua===m?"evenodd":"nonzero"))},clear:function(){j.add(this),this.H.push(this.B.clearRect.bind(this.B,0,0,this.Ta.width,this.Ta.height))},flush:function(){},translate:function(t,n){this.transform(1,0,0,1,t,n)}});r.makeRenderer=function(t){const n=new T(t),i=n.B;return new Proxy(n,{get(t,e){if("function"==typeof t[e])return function(...n){return t[e].apply(t,n)};if("function"==typeof i[e]){if(-1<f.indexOf(e))throw Error("RiveException: Method call to '"+e+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...t){n.H.push(i[e].bind(i,...t))}}return t[e]},set(t,e,r){if(e in i)return n.H.push((()=>{i[e]=r})),!0}})},r.decodeImage=function(t,n){new g({ka:n}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new _},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=E;return new g({va:()=>{t.total++},ka:()=>{if(t.loaded++,t.loaded===t.total){const n=t.ready;n&&(n(),t.ready=null)}}})}};let $=r.load,E=null;r.load=function(t,n,i=!0){const e=new r.FallbackFileAssetLoader;return void 0!==n&&e.addLoader(n),i&&(n=new r.CDNFileAssetLoader,e.addLoader(n)),new Promise((function(n){let i=null;E={total:0,loaded:0,ready:function(){n(i)}},i=$(t,e),0==E.total&&n(i)}))};let x=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,n,i,e,r=1){x.call(this,t,n,i,e,r)},e=new a,r.requestAnimationFrame=e.requestAnimationFrame.bind(e),r.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),r.enableFPSCounter=e.Nb.bind(e),r.disableFPSCounter=e.Kb,e.nb=i,r.resolveAnimationFrame=i,r.cleanup=function(){A&&A.delete()}};var d,w,b=Object.assign({},r),m="./this.program",p="";(s||u)&&(u?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=p.startsWith("blob:")?"":p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),u&&(w=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),d=(t,n,i)=>{if(N(t)){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=()=>{200==e.status||0==e.status&&e.response?n(e.response):i()},e.onerror=i,e.send(null)}else fetch(t,{credentials:"same-origin"}).then((t=>t.ok?t.arrayBuffer():Promise.reject(Error(t.status+" : "+t.url)))).then(n,i)});var g,y=r.print||console.log.bind(console),_=r.printErr||console.error.bind(console);Object.assign(r,b),b=null,r.thisProgram&&(m=r.thisProgram),r.wasmBinary&&(g=r.wasmBinary);var j,A,O,M,k,T,$,E,x,P=!1;function C(){var t=j.buffer;r.HEAP8=A=new Int8Array(t),r.HEAP16=M=new Int16Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=k=new Uint16Array(t),r.HEAP32=T=new Int32Array(t),r.HEAPU32=$=new Uint32Array(t),r.HEAPF32=E=new Float32Array(t),r.HEAPF64=x=new Float64Array(t)}var F=[],I=[],S=[];function R(){var t=r.preRun.shift();F.unshift(t)}var W=0,L=null;function D(t){throw r.onAbort?.(t),_(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),i(t),t}var U,V=t=>t.startsWith("data:application/octet-stream;base64,"),N=t=>t.startsWith("file://");function z(t){if(t==U&&g)return new Uint8Array(g);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}function X(t,n,i){return function(t){return g?Promise.resolve().then((()=>z(t))):new Promise(((n,i)=>{d(t,(t=>n(new Uint8Array(t))),(()=>{try{n(z(t))}catch(t){i(t)}}))}))}(t).then((t=>WebAssembly.instantiate(t,n))).then(i,(t=>{_(`failed to asynchronously prepare wasm: ${t}`),D(t)}))}var G,H,Y={464256:(t,n,i,e,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={ya:0},window.h.I={},window.h.I.wa=t,window.h.I.capture=n,window.h.I.Ja=i,window.h.fa={},window.h.fa.stopped=e,window.h.fa.vb=r;let o=window.h;o.D=[],o.rc=function(t){for(var n=0;n<o.D.length;++n)if(null==o.D[n])return o.D[n]=t,n;return o.D.push(t),o.D.length-1},o.zb=function(t){for(o.D[t]=null;0<o.D.length&&null==o.D[o.D.length-1];)o.D.pop()},o.Oc=function(t){for(var n=0;n<o.D.length;++n)if(o.D[n]==t)return o.zb(n)},o.pa=function(t){return o.D[t]},o.Ra=["touchend","click"],o.unlock=function(){for(var t=0;t<o.D.length;++t){var n=o.D[t];null!=n&&null!=n.K&&n.state===o.fa.vb&&n.K.resume().then((()=>{$i(n.ob)}),(t=>{console.error("Failed to resume audiocontext",t)}))}o.Ra.map((function(t){document.removeEventListener(t,o.unlock,!0)}))},o.Ra.map((function(t){document.addEventListener(t,o.unlock,!0)}))}return window.h.ya+=1,1},466434:()=>{void 0!==window.h&&(window.h.Ra.map((function(t){document.removeEventListener(t,window.h.unlock,!0)})),--window.h.ya,0===window.h.ya&&delete window.h)},466738:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,466842:()=>{try{var t=new(window.AudioContext||window.webkitAudioContext),n=t.sampleRate;return t.close(),n}catch(t){return 0}},467013:(t,n,i,e,r,o)=>{if(void 0===window.h)return-1;var s={},u={};return t==window.h.I.wa&&0!=i&&(u.sampleRate=i),s.K=new(window.AudioContext||window.webkitAudioContext)(u),s.K.suspend(),s.state=window.h.fa.stopped,i=0,t!=window.h.I.wa&&(i=n),s.Y=s.K.createScriptProcessor(e,i,n),s.Y.onaudioprocess=function(i){if(null!=s.qa&&0!=s.qa.length||(s.qa=new Float32Array(E.buffer,r,e*n)),t==window.h.I.capture||t==window.h.I.Ja){for(var u=0;u<n;u+=1)for(var a=i.inputBuffer.getChannelData(u),c=s.qa,h=0;h<e;h+=1)c[h*n+u]=a[h];xi(o,e,r)}if(t==window.h.I.wa||t==window.h.I.Ja)for(Pi(o,e,r),u=0;u<i.outputBuffer.numberOfChannels;++u)for(a=i.outputBuffer.getChannelData(u),c=s.qa,h=0;h<e;h+=1)a[h]=c[h*n+u];else for(u=0;u<i.outputBuffer.numberOfChannels;++u)i.outputBuffer.getChannelData(u).fill(0)},t!=window.h.I.capture&&t!=window.h.I.Ja||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){s.Ba=s.K.createMediaStreamSource(t),s.Ba.connect(s.Y),s.Y.connect(s.K.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.wa&&s.Y.connect(s.K.destination),s.ob=o,window.h.rc(s)},469890:t=>window.h.pa(t).K.sampleRate,469963:t=>{void 0!==(t=window.h.pa(t)).Y&&(t.Y.onaudioprocess=function(){},t.Y.disconnect(),t.Y=void 0),void 0!==t.Ba&&(t.Ba.disconnect(),t.Ba=void 0),t.K.close(),t.K=void 0,t.ob=void 0},470363:t=>{window.h.zb(t)},470413:t=>{(t=window.h.pa(t)).K.resume(),t.state=window.h.fa.vb},470552:t=>{(t=window.h.pa(t)).K.suspend(),t.state=window.h.fa.stopped}},B=t=>{for(;0<t.length;)t.shift()(r)};function q(){var t=T[+tn>>2];return tn+=4,t}var J=(t,n)=>{for(var i=0,e=t.length-1;0<=e;e--){var r=t[e];"."===r?t.splice(e,1):".."===r?(t.splice(e,1),i++):i&&(t.splice(e,1),i--)}if(n)for(;i;i--)t.unshift("..");return t},Z=t=>{var n="/"===t.charAt(0),i="/"===t.substr(-1);return(t=J(t.split("/").filter((t=>!!t)),!n).join("/"))||n||(t="."),t&&i&&(t+="/"),(n?"/":"")+t},K=t=>{var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=n[0],n=n[1],t||n?(n&&=n.substr(0,n.length-1),t+n):"."},Q=t=>{if("/"===t)return"/";var n=(t=(t=Z(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===n?t:t.substr(n+1)},tt=t=>(tt=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);D("initRandomDevice")})())(t),nt=(...t)=>{for(var n="",i=!1,e=t.length-1;-1<=e&&!i;e--){if("string"!=typeof(i=0<=e?t[e]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";n=i+"/"+n,i="/"===i.charAt(0)}return(i?"/":"")+(n=J(n.split("/").filter((t=>!!t)),!i).join("/"))||"."},it="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,et=(t,n,i)=>{var e=n+i;for(i=n;t[i]&&!(i>=e);)++i;if(16<i-n&&t.buffer&&it)return it.decode(t.subarray(n,i));for(e="";n<i;){var r=t[n++];if(128&r){var o=63&t[n++];if(192==(224&r))e+=String.fromCharCode((31&r)<<6|o);else{var s=63&t[n++];65536>(r=224==(240&r)?(15&r)<<12|o<<6|s:(7&r)<<18|o<<12|s<<6|63&t[n++])?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else e+=String.fromCharCode(r)}return e},rt=[],ot=t=>{for(var n=0,i=0;i<t.length;++i){var e=t.charCodeAt(i);127>=e?n++:2047>=e?n+=2:55296<=e&&57343>=e?(n+=4,++i):n+=3}return n},st=(t,n,i,e)=>{if(!(0<e))return 0;var r=i;e=i+e-1;for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(i>=e)break;n[i++]=s}else{if(2047>=s){if(i+1>=e)break;n[i++]=192|s>>6}else{if(65535>=s){if(i+2>=e)break;n[i++]=224|s>>12}else{if(i+3>=e)break;n[i++]=240|s>>18,n[i++]=128|s>>12&63}n[i++]=128|s>>6&63}n[i++]=128|63&s}}return n[i]=0,i-r};function ut(t,n){var i=Array(ot(t)+1);return t=st(t,i,0,i.length),n&&(i.length=t),i}var at=[];function ct(t,n){at[t]={input:[],G:[],V:n},Wt(t,ht)}var ht={open(t){var n=at[t.node.xa];if(!n)throw new _t(43);t.s=n,t.seekable=!1},close(t){t.s.V.oa(t.s)},oa(t){t.s.V.oa(t.s)},read(t,n,i,e){if(!t.s||!t.s.V.hb)throw new _t(60);for(var r=0,o=0;o<e;o++){try{var s=t.s.V.hb(t.s)}catch(t){throw new _t(29)}if(void 0===s&&0===r)throw new _t(6);if(null==s)break;r++,n[i+o]=s}return r&&(t.node.timestamp=Date.now()),r},write(t,n,i,e){if(!t.s||!t.s.V.Ma)throw new _t(60);try{for(var r=0;r<e;r++)t.s.V.Ma(t.s,n[i+r])}catch(t){throw new _t(29)}return e&&(t.node.timestamp=Date.now()),r}},ft={hb(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n"),!t){t=null;break t}rt=ut(t,!0)}t=rt.shift()}return t},Ma(t,n){null===n||10===n?(y(et(t.G,0)),t.G=[]):0!=n&&t.G.push(n)},oa(t){t.G&&0<t.G.length&&(y(et(t.G,0)),t.G=[])},Xb:()=>({zc:25856,Bc:5,yc:191,Ac:35387,xc:[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]}),Yb:()=>0,Zb:()=>[24,80]},lt={Ma(t,n){null===n||10===n?(_(et(t.G,0)),t.G=[]):0!=n&&t.G.push(n)},oa(t){t.G&&0<t.G.length&&(_(et(t.G,0)),t.G=[])}};function vt(t,n){var i=t.l?t.l.length:0;i>=n||(n=Math.max(n,i*(1048576>i?2:1.125)>>>0),0!=i&&(n=Math.max(n,256)),i=t.l,t.l=new Uint8Array(n),0<t.v&&t.l.set(i.subarray(0,t.v),0))}var dt={N:null,U:()=>dt.createNode(null,"/",16895,0),createNode(t,n,i,e){if(24576==(61440&i)||4096==(61440&i))throw new _t(63);return dt.N||(dt.N={dir:{node:{X:dt.j.X,P:dt.j.P,ja:dt.j.ja,ta:dt.j.ta,sb:dt.j.sb,yb:dt.j.yb,tb:dt.j.tb,rb:dt.j.rb,Ca:dt.j.Ca},stream:{aa:dt.m.aa}},file:{node:{X:dt.j.X,P:dt.j.P},stream:{aa:dt.m.aa,read:dt.m.read,write:dt.m.write,Xa:dt.m.Xa,kb:dt.m.kb,mb:dt.m.mb}},link:{node:{X:dt.j.X,P:dt.j.P,la:dt.j.la},stream:{}},$a:{node:{X:dt.j.X,P:dt.j.P},stream:Rt}}),16384==(61440&(i=Et(t,n,i,e)).mode)?(i.j=dt.N.dir.node,i.m=dt.N.dir.stream,i.l={}):32768==(61440&i.mode)?(i.j=dt.N.file.node,i.m=dt.N.file.stream,i.v=0,i.l=null):40960==(61440&i.mode)?(i.j=dt.N.link.node,i.m=dt.N.link.stream):8192==(61440&i.mode)&&(i.j=dt.N.$a.node,i.m=dt.N.$a.stream),i.timestamp=Date.now(),t&&(t.l[n]=i,t.timestamp=i.timestamp),i},Fc:t=>t.l?t.l.subarray?t.l.subarray(0,t.v):new Uint8Array(t.l):new Uint8Array(0),j:{X(t){var n={};return n.Dc=8192==(61440&t.mode)?t.id:1,n.Hc=t.id,n.mode=t.mode,n.Kc=1,n.uid=0,n.Gc=0,n.xa=t.xa,n.size=16384==(61440&t.mode)?4096:32768==(61440&t.mode)?t.v:40960==(61440&t.mode)?t.link.length:0,n.vc=new Date(t.timestamp),n.Jc=new Date(t.timestamp),n.Cc=new Date(t.timestamp),n.Gb=4096,n.wc=Math.ceil(n.size/n.Gb),n},P(t,n){if(void 0!==n.mode&&(t.mode=n.mode),void 0!==n.timestamp&&(t.timestamp=n.timestamp),void 0!==n.size&&t.v!=(n=n.size))if(0==n)t.l=null,t.v=0;else{var i=t.l;t.l=new Uint8Array(n),i&&t.l.set(i.subarray(0,Math.min(n,t.v))),t.v=n}},ja(){throw jt[44]},ta:(t,n,i,e)=>dt.createNode(t,n,i,e),sb(t,n,i){if(16384==(61440&t.mode)){try{var e=$t(n,i)}catch(t){}if(e)for(var r in e.l)throw new _t(55)}delete t.parent.l[t.name],t.parent.timestamp=Date.now(),t.name=i,n.l[i]=t,n.timestamp=t.parent.timestamp},yb(t,n){delete t.l[n],t.timestamp=Date.now()},tb(t,n){var i,e=$t(t,n);for(i in e.l)throw new _t(55);delete t.l[n],t.timestamp=Date.now()},rb(t){var n,i=[".",".."];for(n of Object.keys(t.l))i.push(n);return i},Ca:(t,n,i)=>((t=dt.createNode(t,n,41471,0)).link=i,t),la(t){if(40960!=(61440&t.mode))throw new _t(28);return t.link}},m:{read(t,n,i,e,r){var o=t.node.l;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,e))&&o.subarray)n.set(o.subarray(r,r+t),i);else for(e=0;e<t;e++)n[i+e]=o[r+e];return t},write(t,n,i,e,r,o){if(n.buffer===A.buffer&&(o=!1),!e)return 0;if((t=t.node).timestamp=Date.now(),n.subarray&&(!t.l||t.l.subarray)){if(o)return t.l=n.subarray(i,i+e),t.v=e;if(0===t.v&&0===r)return t.l=n.slice(i,i+e),t.v=e;if(r+e<=t.v)return t.l.set(n.subarray(i,i+e),r),e}if(vt(t,r+e),t.l.subarray&&n.subarray)t.l.set(n.subarray(i,i+e),r);else for(o=0;o<e;o++)t.l[r+o]=n[i+o];return t.v=Math.max(t.v,r+e),e},aa(t,n,i){if(1===i?n+=t.position:2===i&&32768==(61440&t.node.mode)&&(n+=t.node.v),0>n)throw new _t(28);return n},Xa(t,n,i){vt(t.node,n+i),t.node.v=Math.max(t.node.v,n+i)},kb(t,n,i,e,r){if(32768!=(61440&t.node.mode))throw new _t(43);if(t=t.node.l,2&r||t.buffer!==A.buffer){if((0<i||i+n<t.length)&&(t=t.subarray?t.subarray(i,i+n):Array.prototype.slice.call(t,i,i+n)),i=!0,D(),!(n=void 0))throw new _t(48);A.set(t,n)}else i=!1,n=t.byteOffset;return{o:n,uc:i}},mb:(t,n,i,e)=>(dt.m.write(t,n,0,e,i,!1),0)}},wt=null,bt={},mt=[],pt=1,gt=null,yt=!0,_t=class{constructor(t){this.name="ErrnoError",this.$=t}},jt={},At=class{constructor(){this.h={},this.node=null}get flags(){return this.h.flags}set flags(t){this.h.flags=t}get position(){return this.h.position}set position(t){this.h.position=t}},Ot=class{constructor(t,n,i,e){t||=this,this.parent=t,this.U=t.U,this.ua=null,this.id=pt++,this.name=n,this.mode=i,this.j={},this.m={},this.xa=e}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}};function Mt(t,n={}){if(!(t=nt(t)))return{path:"",node:null};if(8<(n=Object.assign({gb:!0,Oa:0},n)).Oa)throw new _t(32);t=t.split("/").filter((t=>!!t));for(var i=wt,e="/",r=0;r<t.length;r++){var o=r===t.length-1;if(o&&n.parent)break;if(i=$t(i,t[r]),e=Z(e+"/"+t[r]),i.ua&&(!o||o&&n.gb)&&(i=i.ua.root),!o||n.fb)for(o=0;40960==(61440&i.mode);)if(i=zt(e),i=Mt(e=nt(K(e),i),{Oa:n.Oa+1}).node,40<o++)throw new _t(32)}return{path:e,node:i}}function kt(t){for(var n;;){if(t===t.parent)return t=t.U.lb,n?"/"!==t[t.length-1]?`${t}/${n}`:t+n:t;n=n?`${t.name}/${n}`:t.name,t=t.parent}}function Tt(t,n){for(var i=0,e=0;e<n.length;e++)i=(i<<5)-i+n.charCodeAt(e)|0;return(t+i>>>0)%gt.length}function $t(t,n){var i=16384==(61440&t.mode)?(i=Pt(t,"x"))?i:t.j.ja?0:2:54;if(i)throw new _t(i);for(i=gt[Tt(t.id,n)];i;i=i.ec)if(i.parent.id===t.id&&i.name===n)return i;return t.j.ja(t,n)}function Et(t,n,i,e){return n=Tt((t=new Ot(t,n,i,e)).parent.id,t.name),t.ec=gt[n],gt[n]=t}function xt(t){var n=["r","w","rw"][3&t];return 512&t&&(n+="w"),n}function Pt(t,n){return yt?0:!n.includes("r")||292&t.mode?n.includes("w")&&!(146&t.mode)||n.includes("x")&&!(73&t.mode)?2:0:2}function Ct(t,n){try{return $t(t,n),20}catch(t){}return Pt(t,"wx")}function Ft(t){if(!(t=mt[t]))throw new _t(8);return t}function It(t,n=-1){if(t=Object.assign(new At,t),-1==n)t:{for(n=0;4096>=n;n++)if(!mt[n])break t;throw new _t(33)}return t.W=n,mt[n]=t}var St,Rt={open(t){t.m=bt[t.node.xa].m,t.m.open?.(t)},aa(){throw new _t(70)}};function Wt(t,n){bt[t]={m:n}}function Lt(t,n){var i="/"===n;if(i&&wt)throw new _t(10);if(!i&&n){var e=Mt(n,{gb:!1});if(n=e.path,(e=e.node).ua)throw new _t(10);if(16384!=(61440&e.mode))throw new _t(54)}(t=t.U(n={type:t,Mc:{},lb:n,dc:[]})).U=n,n.root=t,i?wt=t:e&&(e.ua=n,e.U&&e.U.dc.push(n))}function Dt(t,n,i){var e=Mt(t,{parent:!0}).node;if(!(t=Q(t))||"."===t||".."===t)throw new _t(28);var r=Ct(e,t);if(r)throw new _t(r);if(!e.j.ta)throw new _t(63);return e.j.ta(e,t,n,i)}function Ut(t){return Dt(t,16895,0)}function Vt(t,n,i){void 0===i&&(i=n,n=438),Dt(t,8192|n,i)}function Nt(t,n){if(!nt(t))throw new _t(44);var i=Mt(n,{parent:!0}).node;if(!i)throw new _t(44);var e=Ct(i,n=Q(n));if(e)throw new _t(e);if(!i.j.Ca)throw new _t(63);i.j.Ca(i,n,t)}function zt(t){if(!(t=Mt(t).node))throw new _t(44);if(!t.j.la)throw new _t(28);return nt(kt(t.parent),t.j.la(t))}function Xt(t,n,i){if(""===t)throw new _t(44);if("string"==typeof n){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[n];if(void 0===e)throw Error(`Unknown file open mode: ${n}`);n=e}if(i=64&n?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)var o=t;else{t=Z(t);try{o=Mt(t,{fb:!(131072&n)}).node}catch(t){}}if(e=!1,64&n)if(o){if(128&n)throw new _t(20)}else o=Dt(t,i,0),e=!0;if(!o)throw new _t(44);if(8192==(61440&o.mode)&&(n&=-513),65536&n&&16384!=(61440&o.mode))throw new _t(54);if(!e&&(i=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==xt(n)||512&n)?31:Pt(o,xt(n)):44))throw new _t(i);if(512&n&&!e){if(!(i="string"==typeof(i=o)?Mt(i,{fb:!0}).node:i).j.P)throw new _t(63);if(16384==(61440&i.mode))throw new _t(31);if(32768!=(61440&i.mode))throw new _t(28);if(e=Pt(i,"w"))throw new _t(e);i.j.P(i,{size:0,timestamp:Date.now()})}return n&=-131713,(o=It({node:o,path:kt(o),flags:n,seekable:!0,position:0,m:o.m,sc:[],error:!1})).m.open&&o.m.open(o),!r.logReadFiles||1&n||(Bt||={},t in Bt||(Bt[t]=1)),o}function Gt(t,n,i){if(null===t.W)throw new _t(8);if(!t.seekable||!t.m.aa)throw new _t(70);if(0!=i&&1!=i&&2!=i)throw new _t(28);t.position=t.m.aa(t,n,i),t.sc=[]}function Ht(t,n,i){t=Z("/dev/"+t);var e=((t,n)=>{var i=0;return t&&(i|=365),n&&(i|=146),i})(!!n,!!i);Yt||=64;var r=Yt++<<8;Wt(r,{open(t){t.seekable=!1},close(){i?.buffer?.length&&i(10)},read(t,i,e,r){for(var o=0,s=0;s<r;s++){try{var u=n()}catch(t){throw new _t(29)}if(void 0===u&&0===o)throw new _t(6);if(null==u)break;o++,i[e+s]=u}return o&&(t.node.timestamp=Date.now()),o},write(t,n,e,r){for(var o=0;o<r;o++)try{i(n[e+o])}catch(t){throw new _t(29)}return r&&(t.node.timestamp=Date.now()),o}}),Vt(t,e,r)}var Yt,Bt,qt,Jt,Zt,Kt,Qt,tn=void 0,nn=(t,n)=>Object.defineProperty(n,"name",{value:t}),en=[],rn=[],on=t=>{if(!t)throw new qt("Cannot use deleted val. handle = "+t);return rn[t]},sn=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const n=en.pop()||rn.length;return rn[n]=t,rn[n+1]=1,n}},un=t=>{var n=Error,i=nn(t,(function(n){this.name=t,this.message=n,void 0!==(n=Error(n).stack)&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},i},an=t=>{for(var n="";O[t];)n+=Zt[O[t++]];return n},cn=[],hn=()=>{for(;cn.length;){var t=cn.pop();t.g.ea=!1,t.delete()}},fn={},ln=(t,n)=>{if(void 0===n)throw new qt("ptr should not be undefined");for(;t.C;)n=t.ma(n),t=t.C;return n},vn={},dn=t=>{t=Ti(t);var n=an(t);return Mi(t),n},wn=(t,n)=>{var i=vn[t];if(void 0===i)throw t=`${n} has unknown type ${dn(t)}`,new qt(t);return i},bn=()=>{},mn=!1,pn=(t,n,i)=>n===i?t:void 0===i.C||null===(t=pn(t,n,i.C))?null:i.Lb(t),gn={},yn=(t,n)=>{if(!n.u||!n.o)throw new Qt("makeClassHandle requires ptr and ptrType");if(!!n.J!=!!n.F)throw new Qt("Both smartPtrType and smartPtr must be specified");return n.count={value:1},_n(Object.create(t,{g:{value:n,writable:!0}}))},_n=t=>"undefined"==typeof FinalizationRegistry?(_n=t=>t,t):(mn=new FinalizationRegistry((t=>{--(t=t.g).count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o))})),bn=t=>{mn.unregister(t)},(_n=t=>{var n=t.g;return n.F&&mn.register(t,{g:n},t),t})(t)),jn={},An=t=>{for(;t.length;){var n=t.pop();t.pop()(n)}};function On(t){return this.fromWireType($[t>>2])}var Mn={},kn={},Tn=(t,n,i)=>{function e(n){if((n=i(n)).length!==t.length)throw new Qt("Mismatched type converter count");for(var e=0;e<t.length;++e)$n(t[e],n[e])}t.forEach((function(t){kn[t]=n}));var r=Array(n.length),o=[],s=0;n.forEach(((t,n)=>{vn.hasOwnProperty(t)?r[n]=vn[t]:(o.push(t),Mn.hasOwnProperty(t)||(Mn[t]=[]),Mn[t].push((()=>{r[n]=vn[t],++s===o.length&&e(r)})))})),0===o.length&&e(r)};function $n(t,n,i={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,n,i={}){var e=n.name;if(!t)throw new qt(`type "${e}" must have a positive integer typeid pointer`);if(vn.hasOwnProperty(t)){if(i.Vb)return;throw new qt(`Cannot register type '${e}' twice`)}vn[t]=n,delete kn[t],Mn.hasOwnProperty(t)&&(n=Mn[t],delete Mn[t],n.forEach((t=>t())))}(t,n,i)}var En=t=>{throw new qt(t.g.u.i.name+" instance already deleted")};function xn(){}var Pn=(t,n,i)=>{if(void 0===t[n].A){var e=t[n];t[n]=function(...e){if(!t[n].A.hasOwnProperty(e.length))throw new qt(`Function '${i}' called with an invalid number of arguments (${e.length}) - expects one of (${t[n].A})!`);return t[n].A[e.length].apply(this,e)},t[n].A=[],t[n].A[e.da]=e}},Cn=(t,n,i)=>{if(r.hasOwnProperty(t)){if(void 0===i||void 0!==r[t].A&&void 0!==r[t].A[i])throw new qt(`Cannot register public name '${t}' twice`);if(Pn(r,t,t),r.hasOwnProperty(i))throw new qt(`Cannot register multiple overloads of a function with the same number of arguments (${i})!`);r[t].A[i]=n}else r[t]=n,void 0!==i&&(r[t].Lc=i)};function Fn(t,n,i,e,r,o,s,u){this.name=t,this.constructor=n,this.M=i,this.O=e,this.C=r,this.Qb=o,this.ma=s,this.Lb=u,this.pb=[]}var In=(t,n,i)=>{for(;n!==i;){if(!n.ma)throw new qt(`Expected null or instance of ${i.name}, got an instance of ${n.name}`);t=n.ma(t),n=n.C}return t};function Sn(t,n){if(null===n){if(this.La)throw new qt(`null is not a valid ${this.name}`);return 0}if(!n.g)throw new qt(`Cannot pass "${ti(n)}" as a ${this.name}`);if(!n.g.o)throw new qt(`Cannot pass deleted object as a pointer of type ${this.name}`);return In(n.g.o,n.g.u.i,this.i)}function Rn(t,n){if(null===n){if(this.La)throw new qt(`null is not a valid ${this.name}`);if(this.sa){var i=this.Na();return null!==t&&t.push(this.O,i),i}return 0}if(!n||!n.g)throw new qt(`Cannot pass "${ti(n)}" as a ${this.name}`);if(!n.g.o)throw new qt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ra&&n.g.u.ra)throw new qt(`Cannot convert argument of type ${n.g.J?n.g.J.name:n.g.u.name} to parameter type ${this.name}`);if(i=In(n.g.o,n.g.u.i,this.i),this.sa){if(void 0===n.g.F)throw new qt("Passing raw pointer to smart pointer is illegal");switch(this.mc){case 0:if(n.g.J!==this)throw new qt(`Cannot convert argument of type ${n.g.J?n.g.J.name:n.g.u.name} to parameter type ${this.name}`);i=n.g.F;break;case 1:i=n.g.F;break;case 2:if(n.g.J===this)i=n.g.F;else{var e=n.clone();i=this.ic(i,sn((()=>e.delete()))),null!==t&&t.push(this.O,i)}break;default:throw new qt("Unsupporting sharing policy")}}return i}function Wn(t,n){if(null===n){if(this.La)throw new qt(`null is not a valid ${this.name}`);return 0}if(!n.g)throw new qt(`Cannot pass "${ti(n)}" as a ${this.name}`);if(!n.g.o)throw new qt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(n.g.u.ra)throw new qt(`Cannot convert argument of type ${n.g.u.name} to parameter type ${this.name}`);return In(n.g.o,n.g.u.i,this.i)}function Ln(t,n,i,e,r,o,s,u,a,c,h){this.name=t,this.i=n,this.La=i,this.ra=e,this.sa=r,this.hc=o,this.mc=s,this.qb=u,this.Na=a,this.ic=c,this.O=h,r||void 0!==n.C?this.toWireType=Rn:(this.toWireType=e?Sn:Wn,this.L=null)}var Dn,Un,Vn=(t,n,i)=>{if(!r.hasOwnProperty(t))throw new Qt("Replacing nonexistent public symbol");void 0!==r[t].A&&void 0!==i?r[t].A[i]=n:(r[t]=n,r[t].da=i)},Nn=[],zn=t=>{var n=Nn[t];return n||(t>=Nn.length&&(Nn.length=t+1),Nn[t]=n=Dn.get(t)),n},Xn=(t,n)=>{var i=(t=an(t)).includes("j")?((t,n)=>(...i)=>((t,n,i=[])=>(t.includes("j")?(t=t.replace(/p/g,"i"),n=(0,r["dynCall_"+t])(n,...i)):n=zn(n)(...i),n))(t,n,i))(t,n):zn(n);if("function"!=typeof i)throw new qt(`unknown function pointer with signature ${t}: ${n}`);return i},Gn=(t,n)=>{var i=[],e={};throw n.forEach((function t(n){e[n]||vn[n]||(kn[n]?kn[n].forEach(t):(i.push(n),e[n]=!0))})),new Un(`${t}: `+i.map(dn).join([", "]))};function Hn(t,n,i,e,r){var o=n.length;if(2>o)throw new qt("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==n[1]&&null!==i,u=function(t){for(var n=1;n<t.length;++n)if(null!==t[n]&&void 0===t[n].L)return!0;return!1}(n),a="void"!==n[0].name,c=o-2,h=Array(c),f=[],l=[];return nn(t,(function(...i){if(i.length!==c)throw new qt(`function ${t} called with ${i.length} arguments, expected ${c}`);if(l.length=0,f.length=s?2:1,f[0]=r,s){var o=n[1].toWireType(l,this);f[1]=o}for(var v=0;v<c;++v)h[v]=n[v+2].toWireType(l,i[v]),f.push(h[v]);if(i=e(...f),u)An(l);else for(v=s?1:2;v<n.length;v++)null!==n[v].L&&n[v].L(1===v?o:h[v-2]);return a?n[0].fromWireType(i):void 0}))}var Yn,Bn=(t,n)=>{for(var i=[],e=0;e<t;e++)i.push($[n+4*e>>2]);return i},qn=t=>{const n=(t=t.trim()).indexOf("(");return-1!==n?t.substr(0,n):t},Jn=(t,n,i)=>{if(!(t instanceof Object))throw new qt(`${i} with invalid "this": ${t}`);if(!(t instanceof n.i.constructor))throw new qt(`${i} incompatible with "this" of type ${t.constructor.name}`);if(!t.g.o)throw new qt(`cannot call emscripten binding method ${i} on deleted object`);return In(t.g.o,t.g.u.i,n.i)},Zn=t=>{9<t&&0==--rn[t+1]&&(rn[t]=void 0,en.push(t))},Kn={name:"emscripten::val",fromWireType:t=>{var n=on(t);return Zn(t),n},toWireType:(t,n)=>sn(n),argPackAdvance:8,readValueFromPointer:On,L:null},Qn=(t,n,i)=>{switch(n){case 1:return i?function(t){return this.fromWireType(A[t])}:function(t){return this.fromWireType(O[t])};case 2:return i?function(t){return this.fromWireType(M[t>>1])}:function(t){return this.fromWireType(k[t>>1])};case 4:return i?function(t){return this.fromWireType(T[t>>2])}:function(t){return this.fromWireType($[t>>2])};default:throw new TypeError(`invalid integer width (${n}): ${t}`)}},ti=t=>{if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t},ni=(t,n)=>{switch(n){case 4:return function(t){return this.fromWireType(E[t>>2])};case 8:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError(`invalid float width (${n}): ${t}`)}},ii=(t,n,i)=>{switch(n){case 1:return i?t=>A[t]:t=>O[t];case 2:return i?t=>M[t>>1]:t=>k[t>>1];case 4:return i?t=>T[t>>2]:t=>$[t>>2];default:throw new TypeError(`invalid integer width (${n}): ${t}`)}},ei="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ri=(t,n)=>{for(var i=t>>1,e=i+n/2;!(i>=e)&&k[i];)++i;if(32<(i<<=1)-t&&ei)return ei.decode(O.subarray(t,i));for(i="",e=0;!(e>=n/2);++e){var r=M[t+2*e>>1];if(0==r)break;i+=String.fromCharCode(r)}return i},oi=(t,n,i)=>{if(i??=2147483647,2>i)return 0;var e=n;i=(i-=2)<2*t.length?i/2:t.length;for(var r=0;r<i;++r)M[n>>1]=t.charCodeAt(r),n+=2;return M[n>>1]=0,n-e},si=t=>2*t.length,ui=(t,n)=>{for(var i=0,e="";!(i>=n/4);){var r=T[t+4*i>>2];if(0==r)break;++i,65536<=r?(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=String.fromCharCode(r)}return e},ai=(t,n,i)=>{if(i??=2147483647,4>i)return 0;var e=n;i=e+i-4;for(var r=0;r<t.length;++r){var o=t.charCodeAt(r);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++r)),T[n>>2]=o,(n+=4)+4>i)break}return T[n>>2]=0,n-e},ci=t=>{for(var n=0,i=0;i<t.length;++i){var e=t.charCodeAt(i);55296<=e&&57343>=e&&++i,n+=4}return n},hi=(t,n,i)=>{var e=[];return t=t.toWireType(e,i),e.length&&($[n>>2]=sn(e)),t},fi={},li=t=>{var n=fi[t];return void 0===n?an(t):n},vi=[],di=Reflect.construct,wi=[],bi={},mi=()=>{if(!Yn){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in bi)void 0===bi[t]?delete n[t]:n[t]=bi[t];var i=[];for(t in n)i.push(`${t}=${n[t]}`);Yn=i}return Yn},pi=t=>0==t%4&&(0!=t%100||0==t%400),gi=[31,29,31,30,31,30,31,31,30,31,30,31],yi=[31,28,31,30,31,30,31,31,30,31,30,31];[44].forEach((t=>{jt[t]=new _t(t),jt[t].stack="<generic error, no stack>"})),gt=Array(4096),Lt(dt,"/"),Ut("/tmp"),Ut("/home"),Ut("/home/web_user"),function(){Ut("/dev"),Wt(259,{read:()=>0,write:(t,n,i,e)=>e}),Vt("/dev/null",259),ct(1280,ft),ct(1536,lt),Vt("/dev/tty",1280),Vt("/dev/tty1",1536);var t=new Uint8Array(1024),n=0,i=()=>(0===n&&(n=tt(t).byteLength),t[--n]);Ht("random",i),Ht("urandom",i),Ut("/dev/shm"),Ut("/dev/shm/tmp")}(),function(){Ut("/proc");var t=Ut("/proc/self");Ut("/proc/self/fd"),Lt({U(){var n=Et(t,"fd",16895,73);return n.j={ja(t,n){var i=Ft(+n);return(t={parent:null,U:{lb:"fake"},j:{la:()=>i.path}}).parent=t}},n}},"/proc/self/fd")}(),qt=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},rn.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>rn.length/2-5-en.length,Jt=r.PureVirtualError=un("PureVirtualError");for(var _i=Array(256),ji=0;256>ji;++ji)_i[ji]=String.fromCharCode(ji);Zt=_i,r.getInheritedInstanceCount=()=>Object.keys(fn).length,r.getLiveInheritedInstances=()=>{var t,n=[];for(t in fn)fn.hasOwnProperty(t)&&n.push(fn[t]);return n},r.flushPendingDeletes=hn,r.setDelayFunction=t=>{Kt=t,cn.length&&Kt&&Kt(hn)},Qt=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(xn.prototype,{isAliasOf:function(t){if(!(this instanceof xn&&t instanceof xn))return!1;var n=this.g.u.i,i=this.g.o;t.g=t.g;var e=t.g.u.i;for(t=t.g.o;n.C;)i=n.ma(i),n=n.C;for(;e.C;)t=e.ma(t),e=e.C;return n===e&&i===t},clone:function(){if(this.g.o||En(this),this.g.ha)return this.g.count.value+=1,this;var t=_n,n=Object,i=n.create,e=Object.getPrototypeOf(this),r=this.g;return(t=t(i.call(n,e,{g:{value:{count:r.count,ea:r.ea,ha:r.ha,o:r.o,u:r.u,F:r.F,J:r.J}}}))).g.count.value+=1,t.g.ea=!1,t},delete(){if(this.g.o||En(this),this.g.ea&&!this.g.ha)throw new qt("Object already scheduled for deletion");bn(this);var t=this.g;--t.count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o)),this.g.ha||(this.g.F=void 0,this.g.o=void 0)},isDeleted:function(){return!this.g.o},deleteLater:function(){if(this.g.o||En(this),this.g.ea&&!this.g.ha)throw new qt("Object already scheduled for deletion");return cn.push(this),1===cn.length&&Kt&&Kt(hn),this.g.ea=!0,this}}),Object.assign(Ln.prototype,{Rb(t){return this.qb&&(t=this.qb(t)),t},ab(t){this.O?.(t)},argPackAdvance:8,readValueFromPointer:On,fromWireType:function(t){function n(){return yn(this.i.M,this.sa?{u:this.hc,o:i,J:this,F:t}:{u:this,o:t})}var i=this.Rb(t);if(!i)return this.ab(t),null;var e=((t,n)=>(n=ln(this.i,n),fn[n]))(0,i);if(void 0!==e)return 0===e.g.count.value?(e.g.o=i,e.g.F=t,e.clone()):(e=e.clone(),this.ab(t),e);if(e=this.i.Qb(i),!(e=gn[e]))return n.call(this);var r=pn(i,this.i,(e=this.ra?e.Hb:e.pointerType).i);return null===r?n.call(this):yn(e.i.M,this.sa?{u:e,o:r,J:this,F:t}:{u:e,o:r})}}),Un=r.UnboundTypeError=un("UnboundTypeError");var Ai={__syscall_fcntl64:function(t,n,i){tn=i;try{var e=Ft(t);switch(n){case 0:var r=q();if(0>r)break;for(;mt[r];)r++;return function(t,n=-1){return t=It(t,n),t.m?.Ec?.(t),t}(e,r).W;case 1:case 2:case 13:case 14:return 0;case 3:return e.flags;case 4:return r=q(),e.flags|=r,0;case 12:return r=q(),M[r+0>>1]=2,0}return-28}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_ioctl:function(t,n,i){tn=i;try{var e=Ft(t);switch(n){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return e.s?0:-59;case 21505:if(!e.s)return-59;if(e.s.V.Xb){t=[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 r=q();T[r>>2]=25856,T[r+4>>2]=5,T[r+8>>2]=191,T[r+12>>2]=35387;for(var o=0;32>o;o++)A[r+o+17]=t[o]||0}return 0;case 21506:case 21507:case 21508:if(!e.s)return-59;if(e.s.V.Yb)for(r=q(),t=[],o=0;32>o;o++)t.push(A[r+o+17]);return 0;case 21519:return e.s?(r=q(),T[r>>2]=0):-59;case 21520:return e.s?-28:-59;case 21531:if(r=q(),!e.m.Wb)throw new _t(59);return e.m.Wb(e,n,r);case 21523:return e.s?(e.s.V.Zb&&(o=[24,80],r=q(),M[r>>1]=o[0],M[r+2>>1]=o[1]),0):-59;default:return-28}}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_openat:function(t,n,i,e){tn=e;try{var r=n=n?et(O,n):"";if("/"===r.charAt(0))n=r;else{var o=-100===t?"/":Ft(t).path;if(0==r.length)throw new _t(44);n=Z(o+"/"+r)}return Xt(n,i,e?q():0).W}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},_abort_js:()=>{D("")},_embind_create_inheriting_constructor:(t,n,i)=>{t=an(t),n=wn(n,"wrapper"),i=on(i);var e=n.i,r=e.M,o=e.C.M,s=e.C.constructor;return t=nn(t,(function(...t){e.C.pb.forEach(function(t){if(this[t]===o[t])throw new Jt(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:r}),this.__construct(...t)})),r.__construct=function(...t){if(this===r)throw new qt("Pass correct 'this' to __construct");t=s.implement(this,...t),bn(t);var n=t.g;if(t.notifyOnDestruction(),n.ha=!0,Object.defineProperties(this,{g:{value:n}}),_n(this),t=ln(e,t=n.o),fn.hasOwnProperty(t))throw new qt(`Tried to register registered instance: ${t}`);fn[t]=this},r.__destruct=function(){if(this===r)throw new qt("Pass correct 'this' to __destruct");bn(this);var t=this.g.o;if(t=ln(e,t),!fn.hasOwnProperty(t))throw new qt(`Tried to unregister unregistered instance: ${t}`);delete fn[t]},t.prototype=Object.create(r),Object.assign(t.prototype,i),sn(t)},_embind_finalize_value_object:t=>{var n=jn[t];delete jn[t];var i=n.Na,e=n.O,r=n.eb,o=r.map((t=>t.Ub)).concat(r.map((t=>t.kc)));Tn([t],o,(t=>{var o={};return r.forEach(((n,i)=>{var e=t[i],s=n.Sb,u=n.Tb,a=t[i+r.length],c=n.jc,h=n.lc;o[n.Ob]={read:t=>e.fromWireType(s(u,t)),write:(t,n)=>{var i=[];c(h,t,a.toWireType(i,n)),An(i)}}})),[{name:n.name,fromWireType:t=>{var n,i={};for(n in o)i[n]=o[n].read(t);return e(t),i},toWireType:(t,n)=>{for(var r in o)if(!(r in n))throw new TypeError(`Missing field: "${r}"`);var s=i();for(r in o)o[r].write(s,n[r]);return null!==t&&t.push(e,s),s},argPackAdvance:8,readValueFromPointer:On,L:e}]}))},_embind_register_bigint:()=>{},_embind_register_bool:(t,n,i,e)=>{$n(t,{name:n=an(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?i:e},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(O[t])},L:null})},_embind_register_class:(t,n,i,e,r,o,s,u,a,c,h,f,l)=>{h=an(h),o=Xn(r,o),u&&=Xn(s,u),c&&=Xn(a,c),l=Xn(f,l);var v=(t=>{if(void 0===t)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?`_${t}`:t})(h);Cn(v,(function(){Gn(`Cannot construct ${h} due to unbound types`,[e])})),Tn([t,n,i],e?[e]:[],(n=>{if(n=n[0],e)var i=n.i,r=i.M;else r=xn.prototype;n=nn(h,(function(...t){if(Object.getPrototypeOf(this)!==s)throw new qt("Use 'new' to construct "+h);if(void 0===f.Z)throw new qt(h+" has no accessible constructor");var n=f.Z[t.length];if(void 0===n)throw new qt(`Tried to invoke ctor of ${h} with invalid number of parameters (${t.length}) - expected (${Object.keys(f.Z).toString()}) parameters instead!`);return n.apply(this,t)}));var s=Object.create(r,{constructor:{value:n}});n.prototype=s;var a,f=new Fn(h,n,s,l,i,o,u,c);return f.C&&((a=f.C).na??(a.na=[]),f.C.na.push(f)),i=new Ln(h,f,!0,!1,!1),a=new Ln(h+"*",f,!1,!1,!1),r=new Ln(h+" const*",f,!1,!0,!1),gn[t]={pointerType:a,Hb:r},Vn(v,n),[i,a,r]}))},_embind_register_class_class_function:(t,n,i,e,r,o,s)=>{var u=Bn(i,e);n=an(n),n=qn(n),o=Xn(r,o),Tn([],[t],(t=>{function e(){Gn(`Cannot call ${r} due to unbound types`,u)}var r=`${(t=t[0]).name}.${n}`;n.startsWith("@@")&&(n=Symbol[n.substring(2)]);var a=t.i.constructor;return void 0===a[n]?(e.da=i-1,a[n]=e):(Pn(a,n,r),a[n].A[i-1]=e),Tn([],u,(e=>{if(e=Hn(r,[e[0],null].concat(e.slice(1)),null,o,s),void 0===a[n].A?(e.da=i-1,a[n]=e):a[n].A[i-1]=e,t.i.na)for(const i of t.i.na)i.constructor.hasOwnProperty(n)||(i.constructor[n]=e);return[]})),[]}))},_embind_register_class_class_property:(t,n,i,e,r,o,s,u)=>{n=an(n),o=Xn(r,o),Tn([],[t],(t=>{var r=`${(t=t[0]).name}.${n}`,a={get(){Gn(`Cannot access ${r} due to unbound types`,[i])},enumerable:!0,configurable:!0};return a.set=u?()=>{Gn(`Cannot access ${r} due to unbound types`,[i])}:()=>{throw new qt(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,n,a),Tn([],[i],(i=>{i=i[0];var r={get:()=>i.fromWireType(o(e)),enumerable:!0};return u&&(u=Xn(s,u),r.set=t=>{var n=[];u(e,i.toWireType(n,t)),An(n)}),Object.defineProperty(t.i.constructor,n,r),[]})),[]}))},_embind_register_class_constructor:(t,n,i,e,r,o)=>{var s=Bn(n,i);r=Xn(e,r),Tn([],[t],(t=>{var i=`constructor ${(t=t[0]).name}`;if(void 0===t.i.Z&&(t.i.Z=[]),void 0!==t.i.Z[n-1])throw new qt(`Cannot register multiple constructors with identical number of parameters (${n-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.Z[n-1]=()=>{Gn(`Cannot construct ${t.name} due to unbound types`,s)},Tn([],s,(e=>(e.splice(1,0,null),t.i.Z[n-1]=Hn(i,e,null,r,o),[]))),[]}))},_embind_register_class_function:(t,n,i,e,r,o,s,u)=>{var a=Bn(i,e);n=an(n),n=qn(n),o=Xn(r,o),Tn([],[t],(t=>{function e(){Gn(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${n}`;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),u&&t.i.pb.push(n);var c=t.i.M,h=c[n];return void 0===h||void 0===h.A&&h.className!==t.name&&h.da===i-2?(e.da=i-2,e.className=t.name,c[n]=e):(Pn(c,n,r),c[n].A[i-2]=e),Tn([],a,(e=>(e=Hn(r,e,t,o,s),void 0===c[n].A?(e.da=i-2,c[n]=e):c[n].A[i-2]=e,[]))),[]}))},_embind_register_class_property:(t,n,i,e,r,o,s,u,a,c)=>{n=an(n),r=Xn(e,r),Tn([],[t],(t=>{var e=`${(t=t[0]).name}.${n}`,h={get(){Gn(`Cannot access ${e} due to unbound types`,[i,s])},enumerable:!0,configurable:!0};return h.set=a?()=>Gn(`Cannot access ${e} due to unbound types`,[i,s]):()=>{throw new qt(e+" is a read-only property")},Object.defineProperty(t.i.M,n,h),Tn([],a?[i,s]:[i],(i=>{var s=i[0],h={get(){var n=Jn(this,t,e+" getter");return s.fromWireType(r(o,n))},enumerable:!0};if(a){a=Xn(u,a);var f=i[1];h.set=function(n){var i=Jn(this,t,e+" setter"),r=[];a(c,i,f.toWireType(r,n)),An(r)}}return Object.defineProperty(t.i.M,n,h),[]})),[]}))},_embind_register_emval:t=>$n(t,Kn),_embind_register_enum:(t,n,i,e)=>{function r(){}n=an(n),r.values={},$n(t,{name:n,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:(t,n)=>n.value,argPackAdvance:8,readValueFromPointer:Qn(n,i,e),L:null}),Cn(n,r)},_embind_register_enum_value:(t,n,i)=>{var e=wn(t,"enum");n=an(n),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:i},constructor:{value:nn(`${e.name}_${n}`,(function(){}))}}),t.values[i]=e,t[n]=e},_embind_register_float:(t,n,i)=>{$n(t,{name:n=an(n),fromWireType:t=>t,toWireType:(t,n)=>n,argPackAdvance:8,readValueFromPointer:ni(n,i),L:null})},_embind_register_function:(t,n,i,e,r,o)=>{var s=Bn(n,i);t=an(t),t=qn(t),r=Xn(e,r),Cn(t,(function(){Gn(`Cannot call ${t} due to unbound types`,s)}),n-1),Tn([],s,(i=>(Vn(t,Hn(t,[i[0],null].concat(i.slice(1)),null,r,o),n-1),[])))},_embind_register_integer:(t,n,i,e,r)=>{if(n=an(n),-1===r&&(r=4294967295),r=t=>t,0===e){var o=32-8*i;r=t=>t<<o>>>o}var s=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n};$n(t,{name:n,fromWireType:r,toWireType:s,argPackAdvance:8,readValueFromPointer:ii(n,i,0!==e),L:null})},_embind_register_memory_view:(t,n,i)=>{function e(t){return new r(A.buffer,$[t+4>>2],$[t>>2])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];$n(t,{name:i=an(i),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Vb:!0})},_embind_register_std_string:(t,n)=>{var i="std::string"===(n=an(n));$n(t,{name:n,fromWireType:function(t){var n=$[t>>2],e=t+4;if(i)for(var r=e,o=0;o<=n;++o){var s=e+o;if(o==n||0==O[s]){if(r=r?et(O,r,s-r):"",void 0===u)var u=r;else u+=String.fromCharCode(0),u+=r;r=s+1}}else{for(u=Array(n),o=0;o<n;++o)u[o]=String.fromCharCode(O[e+o]);u=u.join("")}return Mi(t),u},toWireType:function(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var e="string"==typeof n;if(!(e||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array))throw new qt("Cannot pass non-string to std::string");var r=i&&e?ot(n):n.length,o=ki(4+r+1),s=o+4;if($[o>>2]=r,i&&e)st(n,O,s,r+1);else if(e)for(e=0;e<r;++e){var u=n.charCodeAt(e);if(255<u)throw Mi(s),new qt("String has UTF-16 code units that do not fit in 8 bits");O[s+e]=u}else for(e=0;e<r;++e)O[s+e]=n[e];return null!==t&&t.push(Mi,o),o},argPackAdvance:8,readValueFromPointer:On,L(t){Mi(t)}})},_embind_register_std_wstring:(t,n,i)=>{if(i=an(i),2===n)var e=ri,r=oi,o=si,s=t=>k[t>>1];else 4===n&&(e=ui,r=ai,o=ci,s=t=>$[t>>2]);$n(t,{name:i,fromWireType:t=>{for(var i,r=$[t>>2],o=t+4,u=0;u<=r;++u){var a=t+4+u*n;u!=r&&0!=s(a)||(o=e(o,a-o),void 0===i?i=o:(i+=String.fromCharCode(0),i+=o),o=a+n)}return Mi(t),i},toWireType:(t,e)=>{if("string"!=typeof e)throw new qt(`Cannot pass non-string to C++ string type ${i}`);var s=o(e),u=ki(4+s+n);return $[u>>2]=s/n,r(e,u+4,s+n),null!==t&&t.push(Mi,u),u},argPackAdvance:8,readValueFromPointer:On,L(t){Mi(t)}})},_embind_register_value_object:(t,n,i,e,r,o)=>{jn[t]={name:an(n),Na:Xn(i,e),O:Xn(r,o),eb:[]}},_embind_register_value_object_field:(t,n,i,e,r,o,s,u,a,c)=>{jn[t].eb.push({Ob:an(n),Ub:i,Sb:Xn(e,r),Tb:o,kc:s,jc:Xn(u,a),lc:c})},_embind_register_void:(t,n)=>{$n(t,{Ic:!0,name:n=an(n),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(t,n,i)=>O.copyWithin(t,n,n+i),_emval_as:(t,n,i)=>(t=on(t),n=wn(n,"emval::as"),hi(n,i,t)),_emval_call_method:(t,n,i,e,r)=>(t=vi[t])(n=on(n),n[i=li(i)],e,r),_emval_decref:Zn,_emval_get_method_caller:(t,n,i)=>{var e=((t,n)=>{for(var i=Array(t),e=0;e<t;++e)i[e]=wn($[n+4*e>>2],"parameter "+e);return i})(t,n),r=e.shift();t--;var o=Array(t);return n=`methodCaller<(${e.map((t=>t.name)).join(", ")}) => ${r.name}>`,(t=>{var n=vi.length;return vi.push(t),n})(nn(n,((n,s,u,a)=>{for(var c=0,h=0;h<t;++h)o[h]=e[h].readValueFromPointer(a+c),c+=e[h].argPackAdvance;return n=1===i?di(s,o):s.apply(n,o),hi(r,u,n)})))},_emval_get_module_property:t=>(t=li(t),sn(r[t])),_emval_get_property:(t,n)=>(t=on(t),n=on(n),sn(t[n])),_emval_incref:t=>{9<t&&(rn[t+1]+=1)},_emval_new_array:()=>sn([]),_emval_new_cstring:t=>sn(li(t)),_emval_new_object:()=>sn({}),_emval_run_destructors:t=>{var n=on(t);An(n),Zn(t)},_emval_set_property:(t,n,i)=>{t=on(t),n=on(n),i=on(i),t[n]=i},_emval_take_value:(t,n)=>(t=(t=wn(t,"_emval_take_value")).readValueFromPointer(n),sn(t)),emscripten_asm_const_int:(t,n,i)=>{wi.length=0;for(var e;e=O[n++];){var r=105!=e;i+=(r&=112!=e)&&i%8?4:0,wi.push(112==e?$[i>>2]:105==e?T[i>>2]:x[i>>3]),i+=r?8:4}return Y[t](...wi)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:t=>{var n=O.length;if(2147483648<(t>>>=0))return!1;for(var i=1;4>=i;i*=2){var e=n*(1+.2/i);e=Math.min(e,t+100663296);var r=Math;e=Math.max(t,e);t:{r=(r.min.call(r,2147483648,e+(65536-e%65536)%65536)-j.buffer.byteLength+65535)/65536;try{j.grow(r),C();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},environ_get:(t,n)=>{var i=0;return mi().forEach(((e,r)=>{var o=n+i;for(r=$[t+4*r>>2]=o,o=0;o<e.length;++o)A[r++]=e.charCodeAt(o);A[r]=0,i+=e.length+1})),0},environ_sizes_get:(t,n)=>{var i=mi();$[t>>2]=i.length;var e=0;return i.forEach((t=>e+=t.length+1)),$[n>>2]=e,0},fd_close:function(t){try{var n=Ft(t);if(null===n.W)throw new _t(8);n.Ka&&(n.Ka=null);try{n.m.close&&n.m.close(n)}catch(t){throw t}finally{mt[n.W]=null}return n.W=null,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_read:function(t,n,i,e){try{t:{var r=Ft(t);t=n;for(var o,s=n=0;s<i;s++){var u=$[t>>2],a=$[t+4>>2];t+=8;var c=r,h=o,f=A;if(0>a||0>h)throw new _t(28);if(null===c.W)throw new _t(8);if(1==(2097155&c.flags))throw new _t(8);if(16384==(61440&c.node.mode))throw new _t(31);if(!c.m.read)throw new _t(28);var l=void 0!==h;if(l){if(!c.seekable)throw new _t(70)}else h=c.position;var v=c.m.read(c,f,u,a,h);l||(c.position+=v);var d=v;if(0>d){var w=-1;break t}if(n+=d,d<a)break;void 0!==o&&(o+=d)}w=n}return $[e>>2]=w,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_seek:function(t,n,i,e,r){n=i+2097152>>>0<4194305-!!n?(n>>>0)+4294967296*i:NaN;try{if(isNaN(n))return 61;var o=Ft(t);return Gt(o,n,e),H=[o.position>>>0,(G=o.position,1<=+Math.abs(G)?0<G?+Math.floor(G/4294967296)>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],T[r>>2]=H[0],T[r+4>>2]=H[1],o.Ka&&0===n&&0===e&&(o.Ka=null),0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_write:function(t,n,i,e){try{t:{var r=Ft(t);t=n;for(var o,s=n=0;s<i;s++){var u=$[t>>2],a=$[t+4>>2];t+=8;var c=r,h=u,f=a,l=o,v=A;if(0>f||0>l)throw new _t(28);if(null===c.W)throw new _t(8);if(!(2097155&c.flags))throw new _t(8);if(16384==(61440&c.node.mode))throw new _t(31);if(!c.m.write)throw new _t(28);c.seekable&&1024&c.flags&&Gt(c,0,2);var d=void 0!==l;if(d){if(!c.seekable)throw new _t(70)}else l=c.position;var w=c.m.write(c,v,h,f,l,void 0);d||(c.position+=w);var b=w;if(0>b){var m=-1;break t}n+=b,void 0!==o&&(o+=b)}m=n}return $[e>>2]=m,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},strftime_l:(t,n,i,e)=>((t,n,i,e)=>{function r(t,n,i){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=i[0]+t;return t}function o(t,n){return r(t,n,"0")}function s(t,n){function i(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=i(t.getFullYear()-n.getFullYear()))&&0===(e=i(t.getMonth()-n.getMonth()))&&(e=i(t.getDate()-n.getDate())),e}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function a(t){var n=t.ba;for(t=new Date(new Date(t.ca+1900,0,1).getTime());0<n;){var i=t.getMonth(),e=(pi(t.getFullYear())?gi:yi)[i];if(!(n>e-t.getDate())){t.setDate(t.getDate()+n);break}n-=e-t.getDate()+1,t.setDate(1),11>i?t.setMonth(i+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return i=new Date(t.getFullYear()+1,0,4),n=u(new Date(t.getFullYear(),0,4)),i=u(i),0>=s(n,t)?0>=s(i,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=$[e+40>>2];for(var h in e={pc:T[e>>2],oc:T[e+4>>2],Da:T[e+8>>2],Qa:T[e+12>>2],Ea:T[e+16>>2],ca:T[e+20>>2],R:T[e+24>>2],ba:T[e+28>>2],Nc:T[e+32>>2],nc:T[e+36>>2],qc:c&&c?et(O,c):""},i=i?et(O,i):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})i=i.replace(new RegExp(h,"g"),c[h]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),l="January February March April May June July August September October November December".split(" ");for(h in c={"%a":t=>f[t.R].substring(0,3),"%A":t=>f[t.R],"%b":t=>l[t.Ea].substring(0,3),"%B":t=>l[t.Ea],"%C":t=>o((t.ca+1900)/100|0,2),"%d":t=>o(t.Qa,2),"%e":t=>r(t.Qa,2," "),"%g":t=>a(t).toString().substring(2),"%G":a,"%H":t=>o(t.Da,2),"%I":t=>(0==(t=t.Da)?t=12:12<t&&(t-=12),o(t,2)),"%j":t=>{for(var n=0,i=0;i<=t.Ea-1;n+=(pi(t.ca+1900)?gi:yi)[i++]);return o(t.Qa+n,3)},"%m":t=>o(t.Ea+1,2),"%M":t=>o(t.oc,2),"%n":()=>"\n","%p":t=>0<=t.Da&&12>t.Da?"AM":"PM","%S":t=>o(t.pc,2),"%t":()=>"\t","%u":t=>t.R||7,"%U":t=>o(Math.floor((t.ba+7-t.R)/7),2),"%V":t=>{var n=Math.floor((t.ba+7-(t.R+6)%7)/7);if(2>=(t.R+371-t.ba-2)%7&&n++,n)53==n&&(4==(i=(t.R+371-t.ba)%7)||3==i&&pi(t.ca)||(n=1));else{n=52;var i=(t.R+7-t.ba-1)%7;(4==i||5==i&&pi(t.ca%400-1))&&n++}return o(n,2)},"%w":t=>t.R,"%W":t=>o(Math.floor((t.ba+7-(t.R+6)%7)/7),2),"%y":t=>(t.ca+1900).toString().substring(2),"%Y":t=>t.ca+1900,"%z":t=>{var n=0<=(t=t.nc);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":t=>t.qc,"%%":()=>"%"},i=i.replace(/%%/g,"\0\0"),c)i.includes(h)&&(i=i.replace(new RegExp(h,"g"),c[h](e)));return(h=ut(i=i.replace(/\0\0/g,"%"),!1)).length>n?0:(A.set(h,t),h.length-1)})(t,n,i,e)},Oi=function(){function t(t){return j=(Oi=t.exports).memory,C(),Dn=Oi.__indirect_function_table,I.unshift(Oi.__wasm_call_ctors),W--,r.monitorRunDependencies?.(W),0==W&&L&&(t=L,L=null,t()),Oi}var n={env:Ai,wasi_snapshot_preview1:Ai};if(W++,r.monitorRunDependencies?.(W),r.instantiateWasm)try{return r.instantiateWasm(n,t)}catch(t){_(`Module.instantiateWasm callback failed with error: ${t}`),i(t)}return U||=V("canvas_advanced.wasm")?"canvas_advanced.wasm":r.locateFile?r.locateFile("canvas_advanced.wasm",p):p+"canvas_advanced.wasm",function(t,n){var i=U;return g||"function"!=typeof WebAssembly.instantiateStreaming||V(i)||N(i)||"function"!=typeof fetch?X(i,t,n):fetch(i,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(n,(function(e){return _(`wasm streaming compile failed: ${e}`),_("falling back to ArrayBuffer instantiation"),X(i,t,n)}))))}(n,(function(n){t(n.instance)})).catch(i),{}}(),Mi=t=>(Mi=Oi.free)(t),ki=t=>(ki=Oi.malloc)(t),Ti=t=>(Ti=Oi.__getTypeName)(t),$i=r._ma_device__on_notification_unlocked=t=>($i=r._ma_device__on_notification_unlocked=Oi.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,n)=>(r._ma_malloc_emscripten=Oi.ma_malloc_emscripten)(t,n),r._ma_free_emscripten=(t,n)=>(r._ma_free_emscripten=Oi.ma_free_emscripten)(t,n);var Ei,xi=r._ma_device_process_pcm_frames_capture__webaudio=(t,n,i)=>(xi=r._ma_device_process_pcm_frames_capture__webaudio=Oi.ma_device_process_pcm_frames_capture__webaudio)(t,n,i),Pi=r._ma_device_process_pcm_frames_playback__webaudio=(t,n,i)=>(Pi=r._ma_device_process_pcm_frames_playback__webaudio=Oi.ma_device_process_pcm_frames_playback__webaudio)(t,n,i);function Ci(){function t(){if(!Ei&&(Ei=!0,r.calledRun=!0,!P)){if(r.noFSInit||St||(St=!0,r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Ht("stdin",r.stdin):Nt("/dev/tty","/dev/stdin"),r.stdout?Ht("stdout",null,r.stdout):Nt("/dev/tty","/dev/stdout"),r.stderr?Ht("stderr",null,r.stderr):Nt("/dev/tty1","/dev/stderr"),Xt("/dev/stdin",0),Xt("/dev/stdout",1),Xt("/dev/stderr",1)),yt=!1,B(I),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();S.unshift(t)}B(S)}}if(!(0<W)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)R();B(F),0<W||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.dynCall_iiji=(t,n,i,e,o)=>(r.dynCall_iiji=Oi.dynCall_iiji)(t,n,i,e,o),r.dynCall_jiji=(t,n,i,e,o)=>(r.dynCall_jiji=Oi.dynCall_jiji)(t,n,i,e,o),r.dynCall_iiiji=(t,n,i,e,o,s)=>(r.dynCall_iiiji=Oi.dynCall_iiiji)(t,n,i,e,o,s),r.dynCall_iij=(t,n,i,e)=>(r.dynCall_iij=Oi.dynCall_iij)(t,n,i,e),r.dynCall_jii=(t,n,i)=>(r.dynCall_jii=Oi.dynCall_jii)(t,n,i),r.dynCall_viijii=(t,n,i,e,o,s,u)=>(r.dynCall_viijii=Oi.dynCall_viijii)(t,n,i,e,o,s,u),r.dynCall_iiiiij=(t,n,i,e,o,s,u)=>(r.dynCall_iiiiij=Oi.dynCall_iiiiij)(t,n,i,e,o,s,u),r.dynCall_iiiiijj=(t,n,i,e,o,s,u,a,c)=>(r.dynCall_iiiiijj=Oi.dynCall_iiiiijj)(t,n,i,e,o,s,u,a,c),r.dynCall_iiiiiijj=(t,n,i,e,o,s,u,a,c,h)=>(r.dynCall_iiiiiijj=Oi.dynCall_iiiiiijj)(t,n,i,e,o,s,u,a,c,h),L=function t(){Ei||Ci(),Ei||(L=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ci(),o});const o=r},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.32.0","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,n,i)=>{i.r(n),i.d(n,{Animation:()=>e.Animation});var e=i(4)},(t,n,i)=>{i.r(n),i.d(n,{Animation:()=>e});var e=function(){function t(t,n,i,e){this.animation=t,this.artboard=n,this.playing=e,this.loopCount=0,this.scrubTo=null,this.instance=new i.LinearAnimationInstance(t,n)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.instance.time},set:function(t){this.instance.time=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){null===this.scrubTo?this.instance.advance(t):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},t.prototype.apply=function(t){this.instance.apply(t)},t.prototype.cleanup=function(){this.instance.delete()},t}()},(t,n,i)=>{i.r(n),i.d(n,{AudioAssetWrapper:()=>o.AudioAssetWrapper,AudioWrapper:()=>o.AudioWrapper,BLANK_URL:()=>r.BLANK_URL,CustomFileAssetLoaderWrapper:()=>o.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>o.FileAssetWrapper,FileFinalizer:()=>o.FileFinalizer,FontAssetWrapper:()=>o.FontAssetWrapper,FontWrapper:()=>o.FontWrapper,ImageAssetWrapper:()=>o.ImageAssetWrapper,ImageWrapper:()=>o.ImageWrapper,createFinalization:()=>o.createFinalization,finalizationRegistry:()=>o.finalizationRegistry,registerTouchInteractions:()=>e.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var e=i(6),r=i(7),o=i(8)},(t,n,i)=>{i.r(n),i.d(n,{registerTouchInteractions:()=>e});var e=function(t){var n=t.canvas,i=t.artboard,e=t.stateMachines,r=void 0===e?[]:e,o=t.rive,s=t.fit,u=t.alignment,a=t.isTouchScrollEnabled,c=void 0!==a&&a,h=t.dispatchPointerExit,f=void 0===h||h,l=t.enableMultiTouch,v=void 0!==l&&l,d=t.layoutScaleFactor,w=void 0===d?1:d;if(!(n&&r.length&&t.renderer&&o&&i&&"undefined"!=typeof window))return null;var b=null,m=!1,p=function(t){if(m&&t instanceof MouseEvent)"mouseup"==t.type&&(m=!1);else{m=c&&"touchend"===t.type&&"touchstart"===b,b=t.type;var n=t.currentTarget.getBoundingClientRect(),e=function(t,n,i){var e,r,o=[];if(["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(e=t.changedTouches)||void 0===e?void 0:e.length)){n||t.preventDefault();for(var s=0,u=i?t.changedTouches.length:1;s<u;)o.push({clientX:(a=t.changedTouches[s]).clientX,clientY:a.clientY,identifier:a.identifier}),s++}else if("touchend"===t.type&&(null===(r=t.changedTouches)||void 0===r?void 0:r.length))for(s=0,u=i?t.changedTouches.length:1;s<u;){var a;o.push({clientX:(a=t.changedTouches[s]).clientX,clientY:a.clientY,identifier:a.identifier}),s++}else o.push({clientX:t.clientX,clientY:t.clientY,identifier:0});return o}(t,c,v),a=o.computeAlignment(s,u,{minX:0,minY:0,maxX:n.width,maxY:n.height},i.bounds,w),h=new o.Mat2D;switch(a.invert(h),e.forEach((function(t){var i=t.clientX,e=t.clientY;if(i||e){var r=new o.Vec2D(i-n.left,e-n.top),s=o.mapXY(h,r),u=s.x(),a=s.y();t.transformedX=u,t.transformedY=a,s.delete(),r.delete()}})),h.delete(),a.delete(),t.type){case"mouseout":for(var l=function(t){e.forEach(f?function(n){t.pointerExit(n.transformedX,n.transformedY,n.identifier)}:function(n){t.pointerMove(n.transformedX,n.transformedY,n.identifier)})},d=0,p=r;d<p.length;d++)l(p[d]);break;case"touchmove":case"mouseover":case"mousemove":for(var g=function(t){e.forEach((function(n){t.pointerMove(n.transformedX,n.transformedY,n.identifier)}))},y=0,_=r;y<_.length;y++)g(_[y]);break;case"touchstart":case"mousedown":for(var j=function(t){e.forEach((function(n){t.pointerDown(n.transformedX,n.transformedY,n.identifier)}))},A=0,O=r;A<O.length;A++)j(O[A]);break;case"touchend":for(var M=function(t){e.forEach((function(n){t.pointerUp(n.transformedX,n.transformedY,n.identifier),t.pointerExit(n.transformedX,n.transformedY,n.identifier)}))},k=0,T=r;k<T.length;k++)M(T[k]);break;case"mouseup":for(var $=function(t){e.forEach((function(n){t.pointerUp(n.transformedX,n.transformedY,n.identifier)}))},E=0,x=r;E<x.length;E++)$(x[E])}}}.bind(void 0);return n.addEventListener("mouseover",p),n.addEventListener("mouseout",p),n.addEventListener("mousemove",p),n.addEventListener("mousedown",p),n.addEventListener("mouseup",p),n.addEventListener("touchmove",p,{passive:c}),n.addEventListener("touchstart",p,{passive:c}),n.addEventListener("touchend",p),function(){n.removeEventListener("mouseover",p),n.removeEventListener("mouseout",p),n.removeEventListener("mousemove",p),n.removeEventListener("mousedown",p),n.removeEventListener("mouseup",p),n.removeEventListener("touchmove",p),n.removeEventListener("touchstart",p),n.removeEventListener("touchend",p)}}},(t,n,i)=>{i.r(n),i.d(n,{BLANK_URL:()=>c,sanitizeUrl:()=>h});var e=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,u=/^.+(:|&colon;)/gim,a=[".","/"],c="about:blank";function h(t){if(!t)return c;var n,i=(n=t,n.replace(s,"").replace(r,(function(t,n){return String.fromCharCode(n)}))).replace(o,"").replace(s,"").trim();if(!i)return c;if(function(t){return a.indexOf(t[0])>-1}(i))return i;var h=i.match(u);return h&&e.test(h[0])?c:i}},(t,n,i)=>{i.r(n),i.d(n,{AudioAssetWrapper:()=>d,AudioWrapper:()=>c,CustomFileAssetLoaderWrapper:()=>f,FileAssetWrapper:()=>l,FileFinalizer:()=>o,FontAssetWrapper:()=>w,FontWrapper:()=>h,ImageAssetWrapper:()=>v,ImageWrapper:()=>a,createFinalization:()=>p,finalizationRegistry:()=>m});var e,r=(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},e(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),o=function(){function t(t){this.selfUnref=!1,this._file=t}return t.prototype.unref=function(){this._file&&this._file.unref()},t}(),s=function(){function t(t){this._finalizableObject=t}return t.prototype.unref=function(){this._finalizableObject.unref()},t}(),u=function(){function t(){this.selfUnref=!1}return t.prototype.unref=function(){},t}(),a=function(t){function n(n){var i=t.call(this)||this;return i._nativeImage=n,i}return r(n,t),Object.defineProperty(n.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),n.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},n}(u),c=function(t){function n(n){var i=t.call(this)||this;return i._nativeAudio=n,i}return r(n,t),Object.defineProperty(n.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),n.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},n}(u),h=function(t){function n(n){var i=t.call(this)||this;return i._nativeFont=n,i}return r(n,t),Object.defineProperty(n.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),n.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},n}(u),f=function(){function t(t,n){this._assetLoaderCallback=n,this.assetLoader=new t.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return t.prototype.loadContents=function(t,n){var i;return t.isImage?i=new v(t):t.isAudio?i=new d(t):t.isFont&&(i=new w(t)),this._assetLoaderCallback(i,n)},t}(),l=function(){function t(t){this._nativeFileAsset=t}return t.prototype.decode=function(t){this._nativeFileAsset.decode(t)},Object.defineProperty(t.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),t}(),v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.setRenderImage=function(t){this._nativeFileAsset.setRenderImage(t.nativeImage)},n}(l),d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.setAudioSource=function(t){this._nativeFileAsset.setAudioSource(t.nativeAudio)},n}(l),w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.setFont=function(t){this._nativeFileAsset.setFont(t.nativeFont)},n}(l),b=function(){function t(){}return t.prototype.register=function(t){t.selfUnref=!0},t.prototype.unregister=function(){},t}(),m=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:b)((function(t){null==t||t.unref()})),p=function(t,n){var i=new s(n);m.register(t,i)}}],n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=(t,n)=>{for(var e in n)i.o(n,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};return(()=>{i.r(e),i.d(e,{Alignment:()=>r,DataEnum:()=>L,EventType:()=>y,Fit:()=>n,Layout:()=>b,LoopType:()=>_,Rive:()=>R,RiveEventType:()=>p,RiveFile:()=>S,RuntimeLoader:()=>m,StateMachineInput:()=>g,StateMachineInputType:()=>w,Testing:()=>K,ViewModel:()=>W,ViewModelInstance:()=>D,ViewModelInstanceArtboard:()=>q,ViewModelInstanceAssetImage:()=>B,ViewModelInstanceBoolean:()=>z,ViewModelInstanceColor:()=>Y,ViewModelInstanceEnum:()=>G,ViewModelInstanceList:()=>H,ViewModelInstanceNumber:()=>N,ViewModelInstanceString:()=>V,ViewModelInstanceTrigger:()=>X,ViewModelInstanceValue:()=>U,decodeAudio:()=>Q,decodeFont:()=>nt,decodeImage:()=>tt});var t,n,r,o=i(1),s=i(2),u=i(3),a=i(5),c=(t=function(n,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},t(n,i)},function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),h=function(){return h=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},h.apply(this,arguments)},f=function(t,n,i,e){return new(i||(i=Promise))((function(r,o){function s(t){try{a(e.next(t))}catch(t){o(t)}}function u(t){try{a(e.throw(t))}catch(t){o(t)}}function a(t){var n;t.done?r(t.value):(n=t.value,n instanceof i?n:new i((function(t){t(n)}))).then(s,u)}a((e=e.apply(t,n||[])).next())}))},l=function(t,n){var i,e,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(a){return function(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(i=1,e&&(r=2&u[0]?e.return:u[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,u[1])).done)return r;switch(e=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,e=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){o.label=u[1];break}if(6===u[0]&&o.label<r[1]){o.label=r[1],r=u;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(u);break}r[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(t,o)}catch(t){u=[6,t],e=0}finally{i=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},v=function(t,n,i){if(i||2===arguments.length)for(var e,r=0,o=n.length;r<o;r++)!e&&r in n||(e||(e=Array.prototype.slice.call(n,0,r)),e[r]=n[r]);return t.concat(e||Array.prototype.slice.call(n))},d=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.isHandledError=!0,n}return c(n,t),n}(Error);!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(n||(n={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var w,b=function(){function t(t){var i,e,o,s,u,a,c;this.fit=null!==(i=null==t?void 0:t.fit)&&void 0!==i?i:n.Contain,this.alignment=null!==(e=null==t?void 0:t.alignment)&&void 0!==e?e:r.Center,this.layoutScaleFactor=null!==(o=null==t?void 0:t.layoutScaleFactor)&&void 0!==o?o:1,this.minX=null!==(s=null==t?void 0:t.minX)&&void 0!==s?s:0,this.minY=null!==(u=null==t?void 0:t.minY)&&void 0!==u?u:0,this.maxX=null!==(a=null==t?void 0:t.maxX)&&void 0!==a?a:0,this.maxY=null!==(c=null==t?void 0:t.maxY)&&void 0!==c?c:0}return t.new=function(n){var i=n.fit,e=n.alignment,r=n.minX,o=n.minY,s=n.maxX,u=n.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:i,alignment:e,minX:r,minY:o,maxX:s,maxY:u})},t.prototype.copyWith=function(n){var i=n.fit,e=n.alignment,r=n.layoutScaleFactor,o=n.minX,s=n.minY,u=n.maxX,a=n.maxY;return new t({fit:null!=i?i:this.fit,alignment:null!=e?e:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=o?o:this.minX,minY:null!=s?s:this.minY,maxX:null!=u?u:this.maxX,maxY:null!=a?a:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=i=this.fit===n.Cover?t.Fit.cover:this.fit===n.Contain?t.Fit.contain:this.fit===n.Fill?t.Fit.fill:this.fit===n.FitWidth?t.Fit.fitWidth:this.fit===n.FitHeight?t.Fit.fitHeight:this.fit===n.ScaleDown?t.Fit.scaleDown:this.fit===n.Layout?t.Fit.layout:t.Fit.none,i);var i},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=n=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,n);var n},t}(),m=function(){function t(){}return t.loadRuntime=function(){o.default({locateFile:function(){return t.wasmURL}}).then((function(n){var i;for(t.runtime=n;t.callBackQueue.length>0;)null===(i=t.callBackQueue.shift())||void 0===i||i(t.runtime)})).catch((function(n){var i={message:(null==n?void 0:n.message)||"Unknown error",type:(null==n?void 0:n.name)||"Error",wasmError:n instanceof WebAssembly.CompileError||n instanceof WebAssembly.RuntimeError,originalError:n};console.debug("Rive WASM load error details:",i);var e="https://cdn.jsdelivr.net/npm/".concat(s.name,"@").concat(s.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==e)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(i.message,"), trying jsdelivr as a backup")),t.setWasmUrl(e),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(e,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(i.type),"- Message: ".concat(i.message),"- WebAssembly-specific error: ".concat(i.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(n){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?n(t.runtime):t.callBackQueue.push(n)},t.awaitInstance=function(){return new Promise((function(n){return t.getInstance((function(t){return n(t)}))}))},t.setWasmUrl=function(n){t.wasmURL=n},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(s.name,"@").concat(s.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(w||(w={}));var p,g=function(){function t(t,n){this.type=t,this.runtimeInput=n}return Object.defineProperty(t.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(t){this.runtimeInput.value=t},enumerable:!1,configurable:!0}),t.prototype.fire=function(){this.type===w.Trigger&&this.runtimeInput.fire()},t.prototype.delete=function(){this.runtimeInput=null},t}();!function(t){t[t.General=128]="General",t[t.OpenUrl=131]="OpenUrl"}(p||(p={}));var y,_,j=function(t){this.isBindableArtboard=!1,this.isBindableArtboard=t},A=function(t){function n(n,i){var e=t.call(this,!1)||this;return e.nativeArtboard=n,e.file=i,e}return c(n,t),n}(j),O=function(t){function n(n){var i=t.call(this,!0)||this;return i.selfUnref=!1,i.nativeArtboard=n,i}return c(n,t),n.prototype.destroy=function(){this.selfUnref&&this.nativeArtboard.unref()},n}(j),M=function(){function t(t,n,i,e){this.stateMachine=t,this.playing=i,this.artboard=e,this.inputs=[],this.instance=new n.StateMachineInstance(t,e),this.initInputs(n)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statesChanged",{get:function(){for(var t=[],n=0;n<this.instance.stateChangedCount();n++)t.push(this.instance.stateChangedNameByIndex(n));return t},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){this.instance.advance(t)},t.prototype.advanceAndApply=function(t){this.instance.advanceAndApply(t)},t.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},t.prototype.reportedEventAt=function(t){return this.instance.reportedEventAt(t)},t.prototype.initInputs=function(t){for(var n=0;n<this.instance.inputCount();n++){var i=this.instance.input(n);this.inputs.push(this.mapRuntimeInput(i,t))}},t.prototype.mapRuntimeInput=function(t,n){return t.type===n.SMIInput.bool?new g(w.Boolean,t.asBool()):t.type===n.SMIInput.number?new g(w.Number,t.asNumber()):t.type===n.SMIInput.trigger?new g(w.Trigger,t.asTrigger()):void 0},t.prototype.cleanup=function(){this.inputs.forEach((function(t){t.delete()})),this.inputs.length=0,this.instance.delete()},t.prototype.bindViewModelInstance=function(t){null!=t.runtimeInstance&&this.instance.bindViewModelInstance(t.runtimeInstance)},t}(),k=function(){function t(t,n,i,e,r){void 0===e&&(e=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=n,this.eventManager=i,this.animations=e,this.stateMachines=r}return t.prototype.add=function(t,n,i){if(void 0===i&&(i=!0),0===(t=Z(t)).length)this.animations.forEach((function(t){return t.playing=n})),this.stateMachines.forEach((function(t){return t.playing=n}));else for(var e=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),o=0;o<t.length;o++){var s=e.indexOf(t[o]),a=r.indexOf(t[o]);if(s>=0||a>=0)s>=0?this.animations[s].playing=n:this.stateMachines[a].playing=n;else{var c=this.artboard.animationByName(t[o]);if(c){var h=new u.Animation(c,this.artboard,this.runtime,n);h.advance(0),h.apply(1),this.animations.push(h)}else{var f=this.artboard.stateMachineByName(t[o]);if(f){var l=new M(f,this.runtime,n,this.artboard);this.stateMachines.push(l)}}}}return i&&this.eventManager.fire(n?{type:y.Play,data:this.playing}:{type:y.Pause,data:this.paused}),n?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,n){for(var i=this.animations.map((function(t){return t.name})),e=0;e<t.length;e++){var r=i.indexOf(t[e]);if(r>=0)this.animations[r].playing=n;else{var o=this.artboard.animationByName(t[e]);if(o){var s=new u.Animation(o,this.artboard,this.runtime,n);s.advance(0),s.apply(1),this.animations.push(s)}else console.error("Animation with name ".concat(t[e]," not found."))}}},t.prototype.initStateMachines=function(t,n){for(var i=this.stateMachines.map((function(t){return t.name})),e=0;e<t.length;e++){var r=i.indexOf(t[e]);if(r>=0)this.stateMachines[r].playing=n;else{var o=this.artboard.stateMachineByName(t[e]);if(o){var s=new M(o,this.runtime,n,this.artboard);this.stateMachines.push(s)}else console.warn("State Machine with name ".concat(t[e]," not found.")),this.initLinearAnimations([t[e]],n)}}},t.prototype.play=function(t){return this.add(t,!0)},t.prototype.advanceIfPaused=function(){this.stateMachines.forEach((function(t){t.playing||t.advanceAndApply(0)}))},t.prototype.pause=function(t){return this.add(t,!1)},t.prototype.scrub=function(t,n){var i=this.animations.filter((function(n){return t.includes(n.name)}));return i.forEach((function(t){return t.scrubTo=n})),i.map((function(t){return t.name}))},Object.defineProperty(t.prototype,"playing",{get:function(){return this.animations.filter((function(t){return t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paused",{get:function(){return this.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),t.prototype.stop=function(t){var n=this,i=[];if(0===(t=Z(t)).length)i=this.animations.map((function(t){return t.name})).concat(this.stateMachines.map((function(t){return t.name}))),this.animations.forEach((function(t){return t.cleanup()})),this.stateMachines.forEach((function(t){return t.cleanup()})),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var e=this.animations.filter((function(n){return t.includes(n.name)}));e.forEach((function(t){t.cleanup(),n.animations.splice(n.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(n){return t.includes(n.name)}));r.forEach((function(t){t.cleanup(),n.stateMachines.splice(n.stateMachines.indexOf(t),1)})),i=e.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:y.Stop,data:i}),i},Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animations.reduce((function(t,n){return t||n.playing}),!1)||this.stateMachines.reduce((function(t,n){return t||n.playing}),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),t.prototype.atLeastOne=function(t,n){var i;return void 0===n&&(n=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([i=this.artboard.animationByIndex(0).name],t,n):this.artboard.stateMachineCount()>0&&this.add([i=this.artboard.stateMachineByIndex(0).name],t,n)),i},t.prototype.handleLooping=function(){for(var t=0,n=this.animations.filter((function(t){return t.playing}));t<n.length;t++){var i=n[t];0===i.loopValue&&i.loopCount?(i.loopCount=0,this.stop(i.name)):1===i.loopValue&&i.loopCount?(this.eventManager.fire({type:y.Loop,data:{animation:i.name,type:_.Loop}}),i.loopCount=0):2===i.loopValue&&i.loopCount>1&&(this.eventManager.fire({type:y.Loop,data:{animation:i.name,type:_.PingPong}}),i.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],n=0,i=this.stateMachines.filter((function(t){return t.playing}));n<i.length;n++)t.push.apply(t,i[n].statesChanged);t.length>0&&this.eventManager.fire({type:y.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:y.Advance,data:t})},t}();!function(t){t.Load="load",t.LoadError="loaderror",t.Play="play",t.Pause="pause",t.Stop="stop",t.Loop="loop",t.Draw="draw",t.Advance="advance",t.StateChange="statechange",t.RiveEvent="riveevent",t.AudioStatusChange="audiostatuschange"}(y||(y={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(_||(_={}));var T,$=function(){function t(t){void 0===t&&(t=[]),this.listeners=t}return t.prototype.getListeners=function(t){return this.listeners.filter((function(n){return n.type===t}))},t.prototype.add=function(t){this.listeners.includes(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var n=0;n<this.listeners.length;n++){var i=this.listeners[n];if(i.type===t.type&&i.callback===t.callback){this.listeners.splice(n,1);break}}},t.prototype.removeAll=function(t){var n=this;t?this.listeners.filter((function(n){return n.type===t})).forEach((function(t){return n.remove(t)})):this.listeners.splice(0,this.listeners.length)},t.prototype.fire=function(t){this.getListeners(t.type).forEach((function(n){return n.callback(t)}))},t}(),E=function(){function t(t){this.eventManager=t,this.queue=[]}return t.prototype.add=function(t){this.queue.push(t)},t.prototype.process=function(){for(;this.queue.length>0;){var t=this.queue.shift();(null==t?void 0:t.action)&&t.action(),(null==t?void 0:t.event)&&this.eventManager.fire(t.event)}},t}();!function(t){t[t.AVAILABLE=0]="AVAILABLE",t[t.UNAVAILABLE=1]="UNAVAILABLE"}(T||(T={}));var x,P=new(function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n._started=!1,n._enabled=!1,n._status=T.UNAVAILABLE,n}return c(n,t),n.prototype.delay=function(t){return f(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(n){return setTimeout(n,t)}))]}))}))},n.prototype.timeout=function(){return f(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(t,n){return setTimeout(n,50)}))]}))}))},n.prototype.reportToListeners=function(){this.fire({type:y.AudioStatusChange}),this.removeAll()},n.prototype.enableAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(){return this._enabled||(this._enabled=!0,this._status=T.AVAILABLE,this.reportToListeners()),[2]}))}))},n.prototype.testAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:if(this._status!==T.UNAVAILABLE||null===this._audioContext)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return t.sent(),this.enableAudio(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},n.prototype._establishAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this._started?[3,5]:(this._started=!0,"undefined"!=typeof window?[3,1]:(this.enableAudio(),[3,5]));case 1:this._audioContext=new AudioContext,this.listenForUserAction(),t.label=2;case 2:return this._status!==T.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return t.sent(),[4,this.delay(1e3)];case 4:return t.sent(),[3,2];case 5:return[2]}}))}))},n.prototype.listenForUserAction=function(){var t=this;document.addEventListener("pointerdown",(function(){return f(t,void 0,void 0,(function(){return l(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},n.prototype.establishAudio=function(){return f(this,void 0,void 0,(function(){return l(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(n.prototype,"systemVolume",{get:function(){return this._status===T.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),n}($)),C=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),F=globalThis.ResizeObserver||C,I=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(n){var i=t._elementsMap.get(n.target);null!==i?i.onResize(0==n.target.clientWidth||0==n.target.clientHeight):t._resizeObserver.unobserve(n.target)},this._onObserved=function(n){n.forEach(t._onObservedEntry)},this._resizeObserver=new F(this._onObserved)}return t.prototype.add=function(t,n){var i={onResize:n,element:t};return this._elementsMap.set(t,i),this._resizeObserver.observe(t),i},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),S=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new $,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError)}return t.prototype.releaseFile=function(){var t;this.selfUnref&&(null===(t=this.file)||void 0===t||t.unref()),this.file=null},t.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach((function(t){return t.destroy()}))},t.prototype.initData=function(){return f(this,void 0,void 0,(function(){var n,i,e,r,o;return l(this,(function(s){switch(s.label){case 0:return this.src?(n=this,[4,J(this.src)]):[3,2];case 1:n.buffer=s.sent(),s.label=2;case 2:return this.destroyed?[2]:(this.assetLoader&&(e=new a.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),i=e.assetLoader),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),i,this.enableRiveAssetCDN)]);case 3:return r.file=s.sent(),o=new a.FileFinalizer(this.file),a.finalizationRegistry.register(this,o),this.destroyed?(this.releaseFile(),[2]):(null!==this.file?this.eventManager.fire({type:y.Load,data:this}):this.fireLoadError(t.fileLoadErrorMessage),[2])}}))}))},t.prototype.init=function(){return f(this,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(t.missingErrorMessage),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),n=this,[4,m.awaitInstance()];case 2:return n.runtime=e.sent(),this.destroyed?[2]:[4,this.initData()];case 3:return e.sent(),[3,5];case 4:return i=e.sent(),this.fireLoadError(i instanceof Error?i.message:t.fileLoadErrorMessage),[3,5];case 5:return[2]}}))}))},t.prototype.fireLoadError=function(t){throw this.eventManager.fire({type:y.LoadError,data:t}),new Error(t)},t.prototype.on=function(t,n){this.eventManager.add({type:t,callback:n})},t.prototype.off=function(t,n){this.eventManager.remove({type:t,callback:n})},t.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},t.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},t.prototype.createBindableArtboard=function(t){if(null!=t){var n=new O(t);return(0,a.createFinalization)(n,n.nativeArtboard),this.bindableArtboards.push(n),n}return null},t.prototype.getArtboard=function(t){var n=this.file.artboardByName(t);if(null!=n)return new A(n,this)},t.prototype.getBindableArtboard=function(t){var n=this.file.bindableArtboardByName(t);return this.createBindableArtboard(n)},t.prototype.getDefaultBindableArtboard=function(){var t=this.file.bindableArtboardDefault();return this.createBindableArtboard(t)},t.prototype.internalBindableArtboardFromArtboard=function(t){var n=this.file.internalBindableArtboardFromArtboard(t);return this.createBindableArtboard(n)},t.missingErrorMessage="Rive source file or data buffer required",t.fileLoadErrorMessage="The file failed to load",t}(),R=function(){function t(t){var n,i=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(t){var n=i._hasZeroSize!==t;i._hasZeroSize=t,t?i._layout.maxX&&i._layout.maxY||i.resizeToCanvas():n&&i.resizeDrawingSurfaceToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=I.add(this.canvas,this.onCanvasResize)),this.src=t.src,this.buffer=t.buffer,this.riveFile=t.riveFile,this.layout=null!==(n=t.layout)&&void 0!==n?n:new b,this.shouldDisableRiveListeners=!!t.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!t.isTouchScrollEnabled,this.automaticallyHandleEvents=!!t.automaticallyHandleEvents,this.dispatchPointerExit=!1===t.dispatchPointerExit?t.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!t.enableMultiTouch,this.enableRiveAssetCDN=void 0===t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new $,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError),t.onPlay&&this.on(y.Play,t.onPlay),t.onPause&&this.on(y.Pause,t.onPause),t.onStop&&this.on(y.Stop,t.onStop),t.onLoop&&this.on(y.Loop,t.onLoop),t.onStateChange&&this.on(y.StateChange,t.onStateChange),t.onAdvance&&this.on(y.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(y.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(y.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(y.Play,t.onplay),t.onpause&&!t.onPause&&this.on(y.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(y.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(y.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(y.StateChange,t.onstatechange),t.assetLoader&&(this.assetLoader=t.assetLoader),this.taskQueue=new E(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:t.autoplay,autoBind:t.autoBind,animations:t.animations,stateMachines:t.stateMachines,artboard:t.artboard,useOffscreenRenderer:t.useOffscreenRenderer})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(n){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(n)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(n){var i=this,e=n.buffer,r=n.riveFile,o=n.animations,s=n.stateMachines,u=n.artboard,a=n.autoplay,c=void 0!==a&&a,h=n.useOffscreenRenderer,f=void 0!==h&&h,l=n.autoBind,v=void 0!==l&&l;if(!this.destroyed){if(this.src=n.src,this.buffer=e,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new d(t.missingErrorMessage);var w=Z(o),b=Z(s);this.loaded=!1,this.readyForPlaying=!1,m.awaitInstance().then((function(t){i.destroyed||(i.runtime=t,i.removeRiveListeners(),i.deleteRiveRenderer(),i.renderer=i.runtime.makeRenderer(i.canvas,f),i.canvas.width||i.canvas.height||i.resizeDrawingSurfaceToCanvas(),i.initData(u,w,b,c,v).then((function(t){if(t)return i.setupRiveListeners()})).catch((function(t){console.error(t)})))})).catch((function(t){console.error(t)}))}},t.prototype.setupRiveListeners=function(t){var n=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var i=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&n.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),e=this.isTouchScrollEnabled,r=this.dispatchPointerExit,o=this.enableMultiTouch;t&&"isTouchScrollEnabled"in t&&(e=t.isTouchScrollEnabled),this.eventCleanup=(0,a.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:i,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:e,dispatchPointerExit:r,enableMultiTouch:o,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,n=this;P.status==T.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:y.AudioStatusChange,callback:function(){return n.onSystemAudioChanged()}},P.add(this._audioEventListener),P.establishAudio())},t.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},t.prototype.initData=function(t,n,i,e,r){return f(this,void 0,void 0,(function(){var o,s,u,a;return l(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(o=new S({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=o,[4,o.init()]);case 1:if(c.sent(),this.destroyed)return o.destroyIfUnused(),[2,!1];c.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,n,i,e,r),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:y.Load,data:null!==(a=this.src)&&void 0!==a?a:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return s=c.sent(),u=(h=s)&&h.isHandledError?h.message:"Problem loading file; may be corrupt!",console.warn(u),this.eventManager.fire({type:y.LoadError,data:u}),[2,Promise.reject(u)];case 4:return[2]}var h}))}))},t.prototype.initArtboard=function(t,n,i,e,r){if(this.file){var o,s=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!s){var u="Invalid artboard name or no default artboard";return console.warn(u),void this.eventManager.fire({type:y.LoadError,data:u})}if(this.artboard=s,s.volume=this._volume*P.systemVolume,this.animator=new k(this.runtime,this.artboard,this.eventManager),n.length>0||i.length>0?(o=n.concat(i),this.animator.initLinearAnimations(n,e),this.animator.initStateMachines(i,e)):o=[this.animator.atLeastOne(e,!1)],this.taskQueue.add({event:{type:e?y.Play:y.Pause,data:o}}),r){var c=this.file.defaultArtboardViewModel(s);if(null!==c){var h=c.defaultInstance();if(null!==h){var f=new D(h,null);(0,a.createFinalization)(f,f.runtimeInstance),this.bindViewModelInstance(f)}}}}},t.prototype.drawFrame=function(){var t,n;(null===(t=null===document||void 0===document?void 0:document.timeline)||void 0===t?void 0:t.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null===(n=this.runtime)||void 0===n||n.resolveAnimationFrame()):this.startRendering()},t.prototype.draw=function(t,n){var i;this.frameRequestId=null;var e=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==n||n());var r=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var o=0,s=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));o<s.length;o++){var u=s[o];u.advance(r),u.instance.didLoop&&(u.loopCount+=1),u.apply(1)}for(var c=0,h=this.animator.stateMachines.filter((function(t){return t.playing}));c<h.length;c++){var f=h[c],l=f.reportedEventCount();if(l)for(var v=0;v<l;v++){var d=f.reportedEventAt(v);if(d)if(d.type===p.OpenUrl){if(this.eventManager.fire({type:y.RiveEvent,data:d}),this.automaticallyHandleEvents){var w=document.createElement("a"),b=d.url,m=d.target,g=(0,a.sanitizeUrl)(b);b&&w.setAttribute("href",g),m&&w.setAttribute("target",m),g&&g!==a.BLANK_URL&&w.click()}}else this.eventManager.fire({type:y.RiveEvent,data:d})}f.advanceAndApply(r)}0==this.animator.stateMachines.length&&this.artboard.advance(r);var _=this.renderer;_.clear(),_.save(),this.alignRenderer(),this._hasZeroSize||this.artboard.draw(_),_.restore(),_.flush(),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(r),this.frameCount++;var j=performance.now();for(this.frameTimes.push(j),this.durations.push(j-e);this.frameTimes[0]<=j-1e3;)this.frameTimes.shift(),this.durations.shift();null===(i=this._viewModelInstance)||void 0===i||i.handleCallbacks(),this.animator.isPlaying?this.startRendering():(this.animator.isPaused||this.animator.isStopped)&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var t=this,n=t.runtime,i=t._layout,e=t.artboard;t.renderer.align(i.runtimeFit(n),i.runtimeAlignment(n),{minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY},e.bounds,this._devicePixelRatioUsed*i.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce((function(t,n){return t+n}),0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var t,n;this.destroyed=!0,this.stopRendering(),this.cleanupInstances(),null!==this._observed&&I.remove(this._observed),this.removeRiveListeners(),this.file&&(null===(t=this.riveFile)||void 0===t||t.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(P.remove(this._audioEventListener),this._audioEventListener=null),null===(n=this._viewModelInstance)||void 0===n||n.cleanup(),this._viewModelInstance=null,this._dataEnums=null},t.prototype.deleteRiveRenderer=function(){var t;null===(t=this.renderer)||void 0===t||t.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(t){var n;if(t)if(this.artboard){var i=this.artboard.textRun(t);if(i)return i;console.warn("Could not access a text run with name '".concat(t,"' in the '").concat(null===(n=this.artboard)||void 0===n?void 0:n.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))}else console.warn("Tried to access text run, but the Artboard is null");else console.warn("No text run name provided")},t.prototype.getTextRunValue=function(t){var n=this.retrieveTextRun(t);return n?n.text:void 0},t.prototype.setTextRunValue=function(t,n){var i=this.retrieveTextRun(t);i&&(i.text=n)},t.prototype.play=function(t,n){var i=this;t=Z(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return i.play(t,n)}})},t.prototype.pause=function(t){var n=this;t=Z(t),this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.animator.pause(t)):this.taskQueue.add({action:function(){return n.pause(t)}})},t.prototype.scrub=function(t,n){var i=this;t=Z(t),this.readyForPlaying?(this.animator.scrub(t,n||0),this.drawFrame()):this.taskQueue.add({action:function(){return i.scrub(t,n)}})},t.prototype.stop=function(t){var n=this;t=Z(t),this.readyForPlaying?(this.animator&&this.animator.stop(t),this.eventCleanup&&this.eventCleanup()):this.taskQueue.add({action:function(){return n.stop(t)}})},t.prototype.reset=function(t){var n,i,e=null==t?void 0:t.artboard,r=Z(null==t?void 0:t.animations),o=Z(null==t?void 0:t.stateMachines),s=null!==(n=null==t?void 0:t.autoplay)&&void 0!==n&&n,u=null!==(i=null==t?void 0:t.autoBind)&&void 0!==i&&i;this.cleanupInstances(),this.initArtboard(e,r,o,s,u),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var i=this.canvas.getBoundingClientRect(),e=i.width,r=i.height,o=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=o,this.canvas.width=o*e,this.canvas.height=o*r,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===n.Layout){var s=this._layout.layoutScaleFactor;this.artboard.width=e/s,this.artboard.height=r/s}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],n=0;n<this.artboard.animationCount();n++)t.push(this.artboard.animationByIndex(n).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],n=0;n<this.artboard.stateMachineCount();n++)t.push(this.artboard.stateMachineByIndex(n).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var n=this.animator.stateMachines.find((function(n){return n.name===t}));return null==n?void 0:n.inputs}},t.prototype.retrieveInputAtPath=function(t,n){if(t)if(this.artboard){var i=this.artboard.inputByPath(t,n);if(i)return i;console.warn("Could not access an input with name: '".concat(t,"', at path:'").concat(n,"'"))}else console.warn("Tried to access input: '".concat(t,"', at path: '").concat(n,"', but the Artboard is null"));else console.warn("No input name provided for path '".concat(n,"'"))},t.prototype.setBooleanStateAtPath=function(t,n,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===w.Boolean?e.asBool().value=n:console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,n,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===w.Number?e.asNumber().value=n:console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a number")))},t.prototype.fireStateAtPath=function(t,n){var i=this.retrieveInputAtPath(t,n);i&&(i.type===w.Trigger?i.asTrigger().fire():console.warn("Input with name: '".concat(t,"', at path:'").concat(n,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(t,n){if(t)if(n)if(this.artboard){var i=this.artboard.textByPath(t,n);if(i)return i;console.warn("Could not access text with name: '".concat(t,"', at path:'").concat(n,"'"))}else console.warn("Tried to access text: '".concat(t,"', at path: '").concat(n,"', but the Artboard is null"));else console.warn("No path provided for text '".concat(t,"'"));else console.warn("No text name provided for path '".concat(n,"'"))},t.prototype.getTextRunValueAtPath=function(t,n){var i=this.retrieveTextAtPath(t,n);if(i)return i.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(n,"'"))},t.prototype.setTextRunValueAtPath=function(t,n,i){var e=this.retrieveTextAtPath(t,i);e?e.text=n:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(i,"'"))},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return this.animator.isStopped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(t,n){this.eventManager.add({type:t,callback:n})},t.prototype.off=function(t,n){this.eventManager.remove({type:t,callback:n})},t.prototype.unsubscribe=function(t,n){console.warn("This function is deprecated: please use `off()` instead."),this.off(t,n)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.unsubscribeAll=function(t){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(t)},t.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.frameRequestId=this.runtime.requestAnimationFrame?this.runtime.requestAnimationFrame(this._boundDraw):requestAnimationFrame(this._boundDraw))},t.prototype.enableFPSCounter=function(t){this.runtime.enableFPSCounter(t)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var t={artboards:[]},n=0;n<this.file.artboardCount();n++){for(var i=this.file.artboardByIndex(n),e={name:i.name,animations:[],stateMachines:[]},r=0;r<i.animationCount();r++){var o=i.animationByIndex(r);e.animations.push(o.name)}for(var s=0;s<i.stateMachineCount();s++){for(var u=i.stateMachineByIndex(s),a=u.name,c=new this.runtime.StateMachineInstance(u,i),h=[],f=0;f<c.inputCount();f++){var l=c.input(f);h.push({name:l.name,type:l.type})}e.stateMachines.push({name:a,inputs:h})}t.artboards.push(e)}return t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(t){this._volume=t,this.artboard&&(this.artboard.volume=t*P.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(t){var n;this.artboard&&!this.destroyed&&t&&t.runtimeInstance&&(t.internalIncrementReferenceCount(),null===(n=this._viewModelInstance)||void 0===n||n.cleanup(),this._viewModelInstance=t,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach((function(n){return n.bindViewModelInstance(t)})):this.artboard.bindViewModelInstance(t.runtimeInstance))},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.viewModelByIndex=function(t){var n=this.file.viewModelByIndex(t);return null!==n?new W(n):null},t.prototype.viewModelByName=function(t){var n=this.file.viewModelByName(t);return null!==n?new W(n):null},t.prototype.enums=function(){if(null===this._dataEnums){var t=this.file.enums();this._dataEnums=t.map((function(t){return new L(t)}))}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var t=this.file.defaultArtboardViewModel(this.artboard);if(t)return new W(t)}return null},t.prototype.getArtboard=function(t){var n,i;return null!==(i=null===(n=this.riveFile)||void 0===n?void 0:n.getArtboard(t))&&void 0!==i?i:null},t.prototype.getBindableArtboard=function(t){var n,i;return null!==(i=null===(n=this.riveFile)||void 0===n?void 0:n.getBindableArtboard(t))&&void 0!==i?i:null},t.prototype.getDefaultBindableArtboard=function(){var t,n;return null!==(n=null===(t=this.riveFile)||void 0===t?void 0:t.getDefaultBindableArtboard())&&void 0!==n?n:null},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),W=function(){function t(t){this._viewModel=t}return Object.defineProperty(t.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),t.prototype.instanceByIndex=function(t){var n=this._viewModel.instanceByIndex(t);if(null!==n){var i=new D(n,null);return(0,a.createFinalization)(i,n),i}return null},t.prototype.instanceByName=function(t){var n=this._viewModel.instanceByName(t);if(null!==n){var i=new D(n,null);return(0,a.createFinalization)(i,n),i}return null},t.prototype.defaultInstance=function(){var t=this._viewModel.defaultInstance();if(null!==t){var n=new D(t,null);return(0,a.createFinalization)(n,t),n}return null},t.prototype.instance=function(){var t=this._viewModel.instance();if(null!==t){var n=new D(t,null);return(0,a.createFinalization)(n,t),n}return null},Object.defineProperty(t.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),t}(),L=function(){function t(t){this._dataEnum=t}return Object.defineProperty(t.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),t}();!function(t){t.Number="number",t.String="string",t.Boolean="boolean",t.Color="color",t.Trigger="trigger",t.Enum="enum",t.List="list",t.Image="image",t.Artboard="artboard"}(x||(x={}));var D=function(){function t(t,n){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=t,null!==n&&this._parents.push(n)}return Object.defineProperty(t.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),t.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach((function(t){t.handleCallbacks()})),this._propertiesWithCallbacks.forEach((function(t){t.clearChanges()}))),this._children.forEach((function(t){return t.handleCallbacks()}))},t.prototype.addParent=function(t){this._parents.includes(t)||(this._parents.push(t),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&t.addToViewModelCallbacks(this))},t.prototype.removeParent=function(t){var n=this._parents.indexOf(t);-1!==n&&(this._parents[n].removeFromViewModelCallbacks(this),this._parents.splice(n,1))},t.prototype.addToPropertyCallbacks=function(t){var n=this;this._propertiesWithCallbacks.includes(t)||(this._propertiesWithCallbacks.push(t),this._propertiesWithCallbacks.length>0&&this._parents.forEach((function(t){t.addToViewModelCallbacks(n)})))},t.prototype.removeFromPropertyCallbacks=function(t){var n=this;this._propertiesWithCallbacks.includes(t)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter((function(n){return n!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(n)})))},t.prototype.addToViewModelCallbacks=function(t){var n=this;this._children.includes(t)||(this._children.push(t),this._parents.forEach((function(t){t.addToViewModelCallbacks(n)})))},t.prototype.removeFromViewModelCallbacks=function(t){var n=this;this._children.includes(t)&&(this._children=this._children.filter((function(n){return n!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(n)})))},t.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach((function(t){t.clearCallbacks()}))},t.prototype.propertyFromPath=function(t,n){var i=t.split("/");return this.propertyFromPathSegments(i,0,n)},t.prototype.viewModelFromPathSegments=function(t,n){var i=this.internalViewModelInstance(t[n]);return null!==i?n==t.length-1?i:i.viewModelFromPathSegments(t,n++):null},t.prototype.propertyFromPathSegments=function(t,n,i){var e,r,o,s,u,a,c,h,f,l,v,d,w,b,m,p,g,y;if(n<t.length-1){var _=this.internalViewModelInstance(t[n]);return null!==_?_.propertyFromPathSegments(t,n+1,i):null}var j=null;switch(i){case x.Number:if(null!==(j=null!==(r=null===(e=this._runtimeInstance)||void 0===e?void 0:e.number(t[n]))&&void 0!==r?r:null))return new N(j,this);break;case x.String:if(null!==(j=null!==(s=null===(o=this._runtimeInstance)||void 0===o?void 0:o.string(t[n]))&&void 0!==s?s:null))return new V(j,this);break;case x.Boolean:if(null!==(j=null!==(a=null===(u=this._runtimeInstance)||void 0===u?void 0:u.boolean(t[n]))&&void 0!==a?a:null))return new z(j,this);break;case x.Color:if(null!==(j=null!==(h=null===(c=this._runtimeInstance)||void 0===c?void 0:c.color(t[n]))&&void 0!==h?h:null))return new Y(j,this);break;case x.Trigger:if(null!==(j=null!==(l=null===(f=this._runtimeInstance)||void 0===f?void 0:f.trigger(t[n]))&&void 0!==l?l:null))return new X(j,this);break;case x.Enum:if(null!==(j=null!==(d=null===(v=this._runtimeInstance)||void 0===v?void 0:v.enum(t[n]))&&void 0!==d?d:null))return new G(j,this);break;case x.List:if(null!==(j=null!==(b=null===(w=this._runtimeInstance)||void 0===w?void 0:w.list(t[n]))&&void 0!==b?b:null))return new H(j,this);break;case x.Image:if(null!==(j=null!==(p=null===(m=this._runtimeInstance)||void 0===m?void 0:m.image(t[n]))&&void 0!==p?p:null))return new B(j,this);break;case x.Artboard:if(null!==(j=null!==(y=null===(g=this._runtimeInstance)||void 0===g?void 0:g.artboard(t[n]))&&void 0!==y?y:null))return new q(j,this)}return null},t.prototype.internalViewModelInstance=function(n){var i;if(this._viewModelInstances.has(n))return this._viewModelInstances.get(n);var e=null===(i=this._runtimeInstance)||void 0===i?void 0:i.viewModel(n);if(null!==e){var r=new t(e,this);return(0,a.createFinalization)(r,e),r.internalIncrementReferenceCount(),this._viewModelInstances.set(n,r),r}return null},t.prototype.number=function(t){return this.propertyFromPath(t,x.Number)},t.prototype.string=function(t){return this.propertyFromPath(t,x.String)},t.prototype.boolean=function(t){return this.propertyFromPath(t,x.Boolean)},t.prototype.color=function(t){return this.propertyFromPath(t,x.Color)},t.prototype.trigger=function(t){return this.propertyFromPath(t,x.Trigger)},t.prototype.enum=function(t){return this.propertyFromPath(t,x.Enum)},t.prototype.list=function(t){return this.propertyFromPath(t,x.List)},t.prototype.image=function(t){return this.propertyFromPath(t,x.Image)},t.prototype.artboard=function(t){return this.propertyFromPath(t,x.Artboard)},t.prototype.viewModel=function(t){var n=t.split("/"),i=n.length>1?this.viewModelFromPathSegments(n.slice(0,n.length-1),0):this;return null!=i?i.internalViewModelInstance(n[n.length-1]):null},t.prototype.internalReplaceViewModel=function(t,n){var i;if(null!==n.runtimeInstance){var e=(null===(i=this._runtimeInstance)||void 0===i?void 0:i.replaceViewModel(t,n.runtimeInstance))||!1;if(e){n.internalIncrementReferenceCount();var r=this.internalViewModelInstance(t);null!==r&&(r.removeParent(this),this._children.includes(r)&&(this._children=this._children.filter((function(t){return t!==r}))),r.cleanup()),this._viewModelInstances.set(t,n),n.addParent(this)}return e}return!1},t.prototype.replaceViewModel=function(t,n){var i,e=t.split("/"),r=e.length>1?this.viewModelFromPathSegments(e.slice(0,e.length-1),0):this;return null!==(i=null==r?void 0:r.internalReplaceViewModel(e[e.length-1],n))&&void 0!==i&&i},t.prototype.incrementReferenceCount=function(){var t;this._referenceCount++,null===(t=this._runtimeInstance)||void 0===t||t.incrementReferenceCount()},t.prototype.decrementReferenceCount=function(){var t;this._referenceCount--,null===(t=this._runtimeInstance)||void 0===t||t.decrementReferenceCount()},Object.defineProperty(t.prototype,"properties",{get:function(){var t;return(null===(t=this._runtimeInstance)||void 0===t?void 0:t.getProperties().map((function(t){return h({},t)})))||[]},enumerable:!1,configurable:!0}),t.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},t.prototype.cleanup=function(){var t,n=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null===(t=this._runtimeInstance)||void 0===t||t.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach((function(t){t.cleanup()})),this._viewModelInstances.clear();var i=v([],this._children,!0);this._children.length=0;var e=v([],this._parents,!0);this._parents.length=0,i.forEach((function(t){t.removeParent(n)})),e.forEach((function(t){t.removeFromViewModelCallbacks(n)}))}},t}(),U=function(){function t(t,n){this.callbacks=[],this._viewModelInstanceValue=t,this._parentViewModel=n}return t.prototype.on=function(t){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(t)||(this.callbacks.push(t),this._parentViewModel.addToPropertyCallbacks(this))},t.prototype.off=function(t){t?this.callbacks=this.callbacks.filter((function(n){return n!==t})):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},t.prototype.internalHandleCallback=function(){},t.prototype.handleCallbacks=function(){var t=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach((function(n){t.internalHandleCallback(n)}))},t.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},t.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),t}(),V=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),N=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),z=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),X=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),n.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},n.prototype.internalHandleCallback=function(t){t()},n}(U),G=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(t){this._viewModelInstanceValue.valueIndex=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),H=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),n.prototype.addInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.addInstance(t.runtimeInstance),t.addParent(this._parentViewModel))},n.prototype.addInstanceAt=function(t,n){return!(null==t.runtimeInstance||!this._viewModelInstanceValue.addInstanceAt(t.runtimeInstance,n)||(t.addParent(this._parentViewModel),0))},n.prototype.removeInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(t.runtimeInstance),t.removeParent(this._parentViewModel))},n.prototype.removeInstanceAt=function(t){this._viewModelInstanceValue.removeInstanceAt(t)},n.prototype.instanceAt=function(t){var n=this._viewModelInstanceValue.instanceAt(t);if(null!=n){var i=new D(n,this._parentViewModel);return(0,a.createFinalization)(i,n),i}return null},n.prototype.swap=function(t,n){this._viewModelInstanceValue.swap(t,n)},n.prototype.internalHandleCallback=function(t){t()},n}(U),Y=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),n.prototype.rgb=function(t,n,i){this._viewModelInstanceValue.rgb(t,n,i)},n.prototype.rgba=function(t,n,i,e){this._viewModelInstanceValue.argb(e,t,n,i)},n.prototype.argb=function(t,n,i,e){this._viewModelInstanceValue.argb(t,n,i,e)},n.prototype.alpha=function(t){this._viewModelInstanceValue.alpha(t)},n.prototype.opacity=function(t){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,t))))},n.prototype.internalHandleCallback=function(t){t(this.value)},n}(U),B=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{set:function(t){var n;this._viewModelInstanceValue.value(null!==(n=null==t?void 0:t.nativeImage)&&void 0!==n?n:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t()},n}(U),q=function(t){function n(n,i){return t.call(this,n,i)||this}return c(n,t),Object.defineProperty(n.prototype,"value",{set:function(t){var n,i;i=t.isBindableArtboard?t:t.file.internalBindableArtboardFromArtboard(t.nativeArtboard),this._viewModelInstanceValue.value(null!==(n=null==i?void 0:i.nativeArtboard)&&void 0!==n?n:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(t){t()},n}(U),J=function(t){return f(void 0,void 0,void 0,(function(){var n;return l(this,(function(i){switch(i.label){case 0:return n=new Request(t),[4,fetch(n)];case 1:return[4,i.sent().arrayBuffer()];case 2:return[2,i.sent()]}}))}))},Z=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},K={EventManager:$,TaskQueueManager:E},Q=function(t){return f(void 0,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(n){return m.getInstance((function(i){i.decodeAudio(t,n)}))}))];case 1:return n=e.sent(),i=new a.AudioWrapper(n),a.finalizationRegistry.register(i,n),[2,i]}}))}))},tt=function(t){return f(void 0,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(n){return m.getInstance((function(i){i.decodeImage(t,n)}))}))];case 1:return n=e.sent(),i=new a.ImageWrapper(n),a.finalizationRegistry.register(i,n),[2,i]}}))}))},nt=function(t){return f(void 0,void 0,void 0,(function(){var n,i;return l(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(n){return m.getInstance((function(i){i.decodeFont(t,n)}))}))];case 1:return n=e.sent(),i=new a.FontWrapper(n),a.finalizationRegistry.register(i,n),[2,i]}}))}))}})(),e})(),f.exports=h());const v=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.id="",this.value="",this.height="",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.src="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.delayVisible="",this.initializeRive=t=>{const n=e.getInstance(),i=this.el.querySelector("canvas");this.riveInstance=new l.Rive({src:t,canvas:i,stateMachines:"Idle",autoplay:!0,onLoad:()=>{this.riveInstance.resizeDrawingSurfaceToCanvas(),n.setRiveInstance(this.riveInstance)}})}}async componentDidLoad(){l.RuntimeLoader.setWasmUrl(t.RIVE_WASM_URL),r(this.el,this.delayVisible),o(this.el,this.type),this.initializeRive(s(this.src))}render(){return u(a,{key:"bb967cb7f353a454adce62c2bb18590f47697110",id:this.id,type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,backgroundColor:this.bgColor,top:this.y,left:this.x,display:this.visible?"flex":"none",zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,src:this.src},u("canvas",{key:"09824386b4f1c3622111abc86d66ddedb5980bc6",class:"lido-canvas"}))}static get assetsDirs(){return["."]}get el(){return this}static get style(){return".lido-canvas{height:100%;width:100%}"}},[0,"lido-avatar",{id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[4],audio:[1],src:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],delayVisible:[1,"delay-visible"]}]);function d(){"undefined"!=typeof customElements&&["lido-avatar"].forEach((t=>{"lido-avatar"===t&&(customElements.get(n(t))||customElements.define(n(t),v))}))}v.RIVE_WASM_URL="https://unpkg.com/@rive-app/canvas@2.32.0/rive.wasm",d();export{v as L,d}