@rive-app/canvas-lite 2.38.5 → 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rive.d.ts +118 -1
- package/rive.js +2381 -94
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +131 -0
- package/rive_fallback.wasm +0 -0
- package/utils/registerKeyboardInteractions.d.ts +31 -1
package/rive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rive.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;ACVwC;;;;;;;;;;;ACOxC;;;;;;;;;;GAUG;AACH;IAUE;;;;;OAKG;IACH,mBACU,SAA0B,EAC1B,QAAkB,EAC1B,OAAmB,EACZ,OAAgB;QAHf,cAAS,GAAT,SAAS,CAAiB;QAC1B,aAAQ,GAAR,QAAQ,CAAU;QAEnB,YAAO,GAAP,OAAO,CAAS;QAnBlB,cAAS,GAAG,CAAC,CAAC;QAGrB;;;WAGG;QACI,YAAO,GAAkB,IAAI,CAAC;QAcnC,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3E,CAAC;IAKD,sBAAW,2BAAI;QAHf;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC7B,CAAC;;;OAAA;IAKD,sBAAW,2BAAI;QAHf;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC5B,CAAC;QAED;;WAEG;aACH,UAAgB,KAAa;YAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;QAC7B,CAAC;;;OAPA;IAYD,sBAAW,gCAAS;QAHpB;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,SAAS,CA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AAK,YAAY,WAAW,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACrD,aAAa,CAAC,UAAU,GAAG,KAAK,CAAC;YACjC,OAAO;QACT,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAChE,CAAC;IAED,qDAAqD;IACvC,2BAAa,GAA3B;QACE,OAAO,aAAa,CAAC,UAAU,CAAC;IAClC,CAAC;IAzLD,sDAAsD;IACvC,uBAAS,GAAG,KAAK,CAAC;IACjC,+DAA+D;IAChD,2BAAa,GAAsB,EAAE,CAAC;IAGrD,8DAA8D;IAC9D,oDAAoD;IACrC,qBAAO,GAAG,4BAAqB,8CAAgB,cAAI,iDAAmB,eAAY,CAAC;IAElG,6EAA6E;IAC7E,oEAAoE;IACrD,6BAAe,GAAkB,uCAAgC,8CAAgB,cAAI,iDAAmB,wBAAqB,CAAC;IAE9H,wBAAU,GAAuB,IAAI,CAAC;IAErD,+CAA+C;IAChC,gCAAkB,GAA+B,EAAE,CAAC;IAKnE;;;OAGG;IACW,6BAAe,GAAY,KAAK,CAAC;IAgKjD,oBAAC;CAAA;AA7LyB;;;;;;;;;;;;ACP1B;AACA;AACA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,sBAAsB,eAAe;AACpG;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG,EAAE;AACL,yDAAyD;AACzD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,GAAG,EAAE;AACL,mEAAmE;AACnE;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,YAAY;AACZ;AACA,OAAO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO,EAAE;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,oCAAoC,mCAAmC,yCAAyC,kCAAkC,+BAA+B,8BAA8B,+EAA+E,mBAAmB;AACpW,qDAAqD,0CAA0C,kCAAkC,+BAA+B,0DAA0D,mBAAmB;AAC7O;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,sBAAsB,UAAU,IAAI;AACzF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,8CAA8C,kBAAkB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,qCAAqC;AAC1C;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG,EAAE,sCAAsC;AAC3C;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH,cAAc;AACd,GAAG;AACH,cAAc;AACd,GAAG;AACH,oBAAoB,iBAAiB;AACrC,GAAG;AACH,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,2JAA2J;AACzK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA,GAAG,EAAE;AACL;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,EAAE;AACP;AACA;AACA,YAAY,IAAI;AAChB;AACA,qBAAqB;AACrB;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,kBAAkB;AAClB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,gBAAgB,0BAA0B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA,GAAG;AACH;AACA;AACA;AACA,+IAA+I,0BAA0B;AACzK,yCAAyC,EAAE;AAC3C;AACA;AACA,GAAG;AACH;AACA;AACA,SAAS,aAAa;AACtB;AACA;AACA,CAAC,mDAAmD,QAAQ;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,oDAAoD,UAAU,IAAI,aAAa;AAC/E;AACA;AACA,CAAC;AACD,mBAAmB,KAAK;AACxB;AACA;AACA;AACA,CAAC;AACD,SAAS,UAAU;AACnB;AACA;AACA;AACA;AACA,CAAC,aAAa;AACd;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,CAAC,SAAS;AACV;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,iBAAiB,GAAG,mBAAmB,MAAM;AAC7C;AACA;AACA,CAAC;AACD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,8BAA8B,GAAG,sBAAsB,EAAE;AACzD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,2BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV,SAAS,SAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,wBAAwB;AACxB;AACA;AACA,yBAAyB,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA,yCAAyC,EAAE;AAC3C;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,EAAE,gDAAgD,SAAS,sBAAsB,OAAO;AACzH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,kDAAkD,EAAE;AACpD;AACA;AACA;AACA,yGAAyG,EAAE;AAC3G;AACA;AACA,IAAI;AACJ;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kCAAkC,EAAE;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ;AACjB;AACA,kDAAkD,OAAO,uBAAuB,OAAO;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA,gCAAgC,MAAM,SAAS,UAAU;AACzD;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,MAAM,SAAS,UAAU;AACzD;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA,mDAAmD,iCAAiC,oBAAoB,UAAU;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,yDAAyD,iCAAiC,oBAAoB,UAAU;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA,gCAAgC,MAAM,SAAS,UAAU;AACzD;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA,mDAAmD,YAAY,oBAAoB,UAAU;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,2DAA2D,EAAE,IAAI,EAAE;AACnE;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE;AACpB;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,GAAG,cAAc,UAAU,sBAAsB,EAAE;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA,mBAAmB,GAAG,uBAAuB,EAAE;AAC/C;AACA;AACA,mBAAmB,GAAG,mCAAmC,mBAAmB;AAC5E;AACA;AACA,yDAAyD,GAAG;AAC5D;AACA;AACA,CAAC;AACD;AACA,CAAC,QAAQ;AACT;AACA;AACA;AACA,CAAC,iFAAiF;AAClF;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,oDAAoD,EAAE,KAAK,EAAE;AAC7D;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,EAAE,KAAK,EAAE;AAC3D;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,EAAE,KAAK,EAAE;AAC7D;AACA,CAAC;AACD;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,yBAAyB,cAAc;AACvC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA,CAAC;AACD,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,yBAAyB,cAAc;AACvC;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD,gCAAgC,OAAO;AACvC;AACA;AACA;AACA,CAAC,iCAAiC;AAClC;AACA,aAAa,kOAAkO;AAC/O;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG,KAAK;AAC1B;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,aAAa;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,MAAM;AACrE;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH,2BAA2B,cAAc;AACzC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,IAAI;AACtB;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,sBAAsB,GAAG,OAAO,yDAAyD,GAAG;AAC5F;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH,6BAA6B;AAC7B;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,kCAAkC,6BAA6B,kBAAkB,aAAa;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,uBAAuB,eAAe,UAAU;AACzG,CAAC,EAAE;AACH;AACA,UAAU;AACV;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,GAAG;AACjD;AACA,KAAK;AACL,6CAA6C,QAAQ;AACrD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,GAAG,SAAS;AAC/C;AACA;AACA;AACA;AACA,4DAA4D,EAAE;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,gEAAgE,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL,aAAa;AACb,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kDAAkD;AACvD,GAAG;AACH,CAAC;AACD,CAAC;AACD;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG,UAAU;AACb,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,GAAG;AAC9B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,GAAG,qCAAqC,SAAS,gBAAgB,4BAA4B;AAC5I;AACA;AACA,KAAK;AACL,8BAA8B,aAAa,QAAQ,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,GAAG;AAC3B;AACA;AACA,eAAe,OAAO,GAAG,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,eAAe,OAAO,GAAG,EAAE,QAAQ;AACnC,0BAA0B,GAAG;AAC7B,KAAK;AACL;AACA,0BAA0B,GAAG;AAC7B,MAAM;AACN,qBAAqB,GAAG;AACxB;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA,gGAAgG,MAAM,eAAe,OAAO;AAC5H;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,GAAG;AAC3B;AACA;AACA,eAAe,OAAO,GAAG,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,eAAe,OAAO,GAAG,EAAE,QAAQ;AACnC,0BAA0B,GAAG;AAC7B,KAAK;AACL,0CAA0C,GAAG;AAC7C;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG,4FAA4F;AAC/F;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA8C,OAAO,QAAQ,eAAe,YAAY,OAAO,GAAG,EAAE;AACpG,GAAG,EAAE,EAAE;AACP;AACA;AACA,CAAC;AACD;AACA,SAAS,8GAA8G;AACvH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,sBAAsB,GAAG;AACzB,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,SAAS,wGAAwG;AACjH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,kEAAkE,GAAG,OAAO;AACrF,CAAC;AACD;AACA;AACA,SAAS;AACT;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG,EAAE;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,SAAS;AACT,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,+DAA+D,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,IAAI;AACJ,CAAC;AACD,WAAW;AACX,CAAC;AACD,iBAAiB,yDAAyD;AAC1E,CAAC;AACD;AACA,SAAS;AACT,GAAG;AACH,GAAG,EAAE;AACL,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,uBAAuB,8BAA8B,OAAO,OAAO;AACnE;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC,iGAAiG;AAClG;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD,yBAAyB,OAAO;AAChC;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,+DAA+D,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,iBAAiB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,gBAAgB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,oEAAoE,qBAAqB;AACzF;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA,CAAC;AACD,iEAAe,IAAI,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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oBAClD,gEAAa,CAAC,WAAW,CAAC,UAAC,IAAmB;wBAC5C,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAClC,CAAC,CAAC;gBAFF,CAEE,CACH,CAAC;gBACoB,qBAAM,cAAc;;gBAApC,IAAI,GAAY,SAAoB;gBACpC,WAAW,GAAG,IAAI,+CAAW,CAAC,IAAI,CAAC,CAAC;gBAC1C,wDAAoB,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBACjD,sBAAO,WAAW,EAAC;;;KACpB,CAAC;AAEF,aAAa","sources":["webpack://rive/webpack/universalModuleDefinition","webpack://rive/./src/animation/index.ts","webpack://rive/./src/animation/Animation.ts","webpack://rive/./src/runtimeLoader.ts","webpack://rive/./npm/canvas_advanced_lite/canvas_advanced.mjs","webpack://rive/./src/utils/index.ts","webpack://rive/./src/utils/registerTouchInteractions.ts","webpack://rive/./src/utils/registerKeyboardInteractions.ts","webpack://rive/./src/utils/sanitizeUrl.ts","webpack://rive/./src/utils/finalizationRegistry.ts","webpack://rive/./src/utils/riveFont.ts","webpack://rive/webpack/bootstrap","webpack://rive/webpack/runtime/define property getters","webpack://rive/webpack/runtime/hasOwnProperty shorthand","webpack://rive/webpack/runtime/make namespace object","webpack://rive/./src/rive.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rive\"] = factory();\n\telse\n\t\troot[\"rive\"] = factory();\n})(this, () => {\nreturn ","export { Animation } from \"./Animation\";\n","import type {\n LinearAnimationInstance,\n LinearAnimation,\n Artboard,\n RiveCanvas,\n} from \"./../rive_advanced.mjs\";\n\n/**\n * Represents an animation that can be played on an Artboard. \n * Wraps animations and instances from the runtime and keeps track of playback state.\n *\n * The `Animation` class manages the state and behavior of a single animation instance,\n * including its current time, loop count, and ability to scrub to a specific time.\n *\n * The class provides methods to advance the animation, apply its interpolated keyframe\n * values to the Artboard, and clean up the underlying animation instance when the\n * animation is no longer needed.\n */\nexport class Animation {\n public loopCount = 0;\n public readonly instance: LinearAnimationInstance;\n\n /**\n * The time to which the animation should move to on the next render.\n * If not null, the animation will scrub to this time instead of advancing by the given time.\n */\n public scrubTo: number | null = null;\n\n /**\n * Constructs a new animation\n * @constructor\n * @param {any} animation: runtime animation object\n * @param {any} instance: runtime animation instance object\n */\n constructor(\n private animation: LinearAnimation,\n private artboard: Artboard,\n runtime: RiveCanvas,\n public playing: boolean\n ) {\n this.instance = new runtime.LinearAnimationInstance(animation, artboard);\n }\n\n /**\n * Returns the animation's name\n */\n public get name(): string {\n return this.animation.name;\n }\n\n /**\n * Returns the animation's name\n */\n public get time(): number {\n return this.instance.time;\n }\n\n /**\n * Sets the animation's current time\n */\n public set time(value: number) {\n this.instance.time = value;\n }\n\n /**\n * Returns the animation's loop type\n */\n public get loopValue(): number {\n return this.animation.loopValue;\n }\n\n /**\n * Indicates whether the animation needs to be scrubbed.\n * @returns `true` if the animation needs to be scrubbed, `false` otherwise.\n */\n public get needsScrub(): boolean {\n return this.scrubTo !== null;\n }\n\n /**\n * Advances the animation by the give time. If the animation needs scrubbing,\n * time is ignored and the stored scrub value is used.\n * @param time the time to advance the animation by if no scrubbing required\n */\n public advance(time: number) {\n if (this.scrubTo === null) {\n this.instance.advance(time);\n } else {\n this.instance.time = 0;\n this.instance.advance(this.scrubTo);\n this.scrubTo = null;\n }\n }\n\n /**\n * Apply interpolated keyframe values to the artboard. This should be called after calling\n * .advance() on an animation instance so that new values are applied to properties.\n *\n * Note: This does not advance the artboard, which updates all objects on the artboard\n * @param mix - Mix value for the animation from 0 to 1\n */\n public apply(mix: number) {\n this.instance.apply(mix);\n }\n\n /**\n * Deletes the backing Wasm animation instance; once this is called, this\n * animation is no more.\n */\n public cleanup() {\n this.instance.delete();\n }\n}\n","import * as rc from \"./rive_advanced.mjs\";\nimport packageData from \"package.json\";\n\n// Callback type when looking for a runtime instance\nexport type RuntimeCallback = (rive: rc.RiveCanvas) => void;\n\n// Runtime singleton; use getInstance to provide a callback that returns the\n// Rive runtime\nexport class RuntimeLoader {\n // Singleton helpers\n private static runtime: rc.RiveCanvas;\n // Flag to indicate that loading has started/completed\n private static isLoading = false;\n // List of callbacks for the runtime that come in while loading\n private static callBackQueue: RuntimeCallback[] = [];\n // Instance of the Rive runtime\n private static rive: rc.RiveCanvas;\n // Path to the Wasm file; default path works for testing only;\n // if embedded wasm is used then this is never used.\n private static wasmURL = `https://unpkg.com/${packageData.name}@${packageData.version}/rive.wasm`;\n\n // Fallback WASM URL tried when the primary URL fails. Set to null to disable\n // the fallback entirely. Defaults to pulling from the jsdelivr CDN.\n private static wasmFallbackURL: string | null = `https://cdn.jsdelivr.net/npm/${packageData.name}@${packageData.version}/rive_fallback.wasm`;\n\n private static wasmBinary: ArrayBuffer | null = null;\n\n // Error callbacks enqueued from .getInstance()\n private static errorCallbackQueue: ((error: Error) => void)[] = [];\n\n // Class is never instantiated\n private constructor() {}\n\n /**\n * When true, performance.mark / performance.measure entries are emitted for\n * WASM initialization.\n */\n public static enablePerfMarks: boolean = false;\n\n // Rejects all pending awaitInstance() promises and resets loading state so\n // the next call to getInstance() / awaitInstance() can retry with a new URL.\n private static notifyError(error: Error): void {\n RuntimeLoader.isLoading = false;\n while (RuntimeLoader.errorCallbackQueue.length > 0) {\n RuntimeLoader.errorCallbackQueue.shift()?.(error);\n }\n RuntimeLoader.callBackQueue = [];\n }\n\n // Loads the runtime\n private static loadRuntime(): void {\n // Capture the URL at call time so the catch closure always refers to the\n // URL this particular attempt used, even if wasmURL is mutated for a retry.\n const attemptedUrl = RuntimeLoader.wasmURL;\n const wasmBinary = RuntimeLoader.wasmBinary;\n if (RuntimeLoader.enablePerfMarks) performance.mark('rive:wasm-init:start');\n rc.default({\n // Loads Wasm bundle\n locateFile: () => attemptedUrl,\n ...(wasmBinary ? { wasmBinary } : {})\n })\n .then((rive: rc.RiveCanvas) => {\n if (RuntimeLoader.enablePerfMarks) {\n performance.mark('rive:wasm-init:end');\n performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');\n }\n RuntimeLoader.runtime = rive;\n RuntimeLoader.errorCallbackQueue = [];\n // Fire all the callbacks\n while (RuntimeLoader.callBackQueue.length > 0) {\n RuntimeLoader.callBackQueue.shift()?.(RuntimeLoader.runtime);\n }\n })\n .catch((error) => {\n // Capture specific error details\n const errorDetails = {\n message: error?.message || \"Unknown error\",\n type: error?.name || \"Error\",\n // Some browsers may provide additional WebAssembly-specific details\n wasmError:\n error instanceof WebAssembly.CompileError ||\n error instanceof WebAssembly.RuntimeError,\n originalError: error,\n };\n\n // Log detailed error for debugging\n console.debug(\"Rive WASM load error details:\", errorDetails);\n\n // In case the primary URL fails, or the wasm was not supported, try the\n // fallback URL (a rive_fallback.wasm compiled for older architectures).\n // The fallback can be customised or disabled via setWasmFallbackUrl().\n // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use the fallback only if the primary fails.\n const fallbackUrl = RuntimeLoader.wasmFallbackURL;\n const alreadyOnFallback =\n fallbackUrl !== null &&\n attemptedUrl.toLowerCase() === fallbackUrl.toLowerCase();\n\n if (fallbackUrl !== null && !alreadyOnFallback) {\n console.warn(\n `Failed to load WASM from ${attemptedUrl} (${errorDetails.message}), trying fallback URL: ${fallbackUrl}`,\n );\n // Clear wasmBinary so the retry actually fetches via locateFile\n // instead of re-using the same (failing) in-memory binary.\n RuntimeLoader.wasmBinary = null;\n RuntimeLoader.setWasmUrl(fallbackUrl);\n RuntimeLoader.loadRuntime();\n } else {\n // When alreadyOnFallback is true, wasmURL has already been overwritten\n // with the fallback URL, so we can no longer recover the original\n // primary URL here. The primary URL was logged in the earlier warning.\n const triedUrls = alreadyOnFallback\n ? `the configured WASM URL or its fallback (${fallbackUrl})`\n : attemptedUrl;\n const errorMessage = [\n `Could not load Rive WASM file from ${triedUrls}.`,\n \"Possible reasons:\",\n \"- Network connection is down\",\n \"- WebAssembly is not supported in this environment\",\n \"- The WASM file is corrupted or incompatible\",\n \"\\nError details:\",\n `- Type: ${errorDetails.type}`,\n `- Message: ${errorDetails.message}`,\n `- WebAssembly-specific error: ${errorDetails.wasmError}`,\n \"\\nTo resolve, you may need to:\",\n \"1. Check your network connection\",\n \"2. Set a new WASM source via RuntimeLoader.setWasmUrl()\",\n \"3. Call RuntimeLoader.awaitInstance() again\",\n ].join(\"\\n\");\n\n console.error(errorMessage);\n RuntimeLoader.notifyError(new Error(errorMessage));\n }\n });\n }\n\n // Provides a runtime instance via a callback\n public static getInstance(callback: RuntimeCallback, onError?: (error: Error) => void): void {\n // If it's not loading, start loading runtime\n if (!RuntimeLoader.isLoading) {\n RuntimeLoader.isLoading = true;\n RuntimeLoader.loadRuntime();\n }\n if (!RuntimeLoader.runtime) {\n RuntimeLoader.callBackQueue.push(callback);\n if (onError) {\n RuntimeLoader.errorCallbackQueue.push(onError);\n }\n } else {\n callback(RuntimeLoader.runtime);\n }\n }\n\n // Provides a runtime instance via a promise; rejects if WASM fails to load.\n public static awaitInstance(): Promise<rc.RiveCanvas> {\n return new Promise<rc.RiveCanvas>((resolve, reject) =>\n RuntimeLoader.getInstance(resolve, reject),\n );\n }\n\n // Manually sets the wasm url\n public static setWasmUrl(url: string): void {\n RuntimeLoader.wasmURL = url;\n }\n\n // Gets the current wasm url\n public static getWasmUrl(): string {\n return RuntimeLoader.wasmURL;\n }\n\n /**\n * Sets the URL used as a fallback when the primary WASM URL fails to load.\n * Pass `null` to disable the fallback entirely.\n *\n * Defaults to pulling from the jsdelivr CDN.\n */\n public static setWasmFallbackUrl(url: string | null): void {\n RuntimeLoader.wasmFallbackURL = url;\n }\n\n // Gets the current fallback wasm url (null means fallback is disabled)\n public static getWasmFallbackUrl(): string | null {\n return RuntimeLoader.wasmFallbackURL;\n }\n\n // Manually sets the wasm binary or clears it with null\n public static setWasmBinary(value: ArrayBuffer | null): void {\n if ((value instanceof ArrayBuffer) || value === null) {\n RuntimeLoader.wasmBinary = value;\n return;\n }\n console.error(\"setWasmBinary expects an ArrayBuffer or null\");\n }\n\n // Gets the current wasm build as ArrayBuffer or null\n public static getWasmBinary(): ArrayBuffer | null {\n return RuntimeLoader.wasmBinary;\n }\n}\n","\nvar Rive = (() => {\n var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;\n \n return (\nfunction(moduleArg = {}) {\n var moduleRtn;\n\nvar k = moduleArg, aa, ba, da = new Promise((b, a) => {\n aa = b;\n ba = a;\n}), ea = \"object\" == typeof window, fa = \"function\" == typeof importScripts;\nfunction ka() {\n function b(l) {\n const h = d;\n c = a = 0;\n d = new Map();\n h.forEach(n => {\n try {\n n(l);\n } catch (m) {\n console.error(m);\n }\n });\n this.va();\n e && e.Pa();\n }\n let a = 0, c = 0, d = new Map(), e = null, f = null;\n this.requestAnimationFrame = function(l) {\n a ||= requestAnimationFrame(b.bind(this));\n const h = ++c;\n d.set(h, l);\n return h;\n };\n this.cancelAnimationFrame = function(l) {\n d.delete(l);\n a && 0 == d.size && (cancelAnimationFrame(a), a = 0);\n };\n this.Na = function(l) {\n f && (document.body.remove(f), f = null);\n l || (f = document.createElement(\"div\"), f.style.backgroundColor = \"black\", f.style.position = \"fixed\", f.style.right = 0, f.style.top = 0, f.style.color = \"white\", f.style.padding = \"4px\", f.innerHTML = \"RIVE FPS\", l = function(h) {\n f.innerHTML = \"RIVE FPS \" + h.toFixed(1);\n }, document.body.appendChild(f));\n e = new function() {\n let h = 0, n = 0;\n this.Pa = function() {\n var m = performance.now();\n n ? (++h, m -= n, 1000 < m && (l(1000 * h / m), h = n = 0)) : (n = m, h = 0);\n };\n }();\n };\n this.Ka = function() {\n f && (document.body.remove(f), f = null);\n e = null;\n };\n this.va = function() {\n };\n}\nfunction la(b) {\n console.assert(!0);\n const a = new Map();\n let c = -Infinity;\n this.push = function(d) {\n d = d + ((1 << b) - 1) >> b;\n a.has(d) && clearTimeout(a.get(d));\n a.set(d, setTimeout(function() {\n a.delete(d);\n 0 == a.length ? c = -Infinity : d == c && (c = Math.max(...a.keys()), console.assert(c < d));\n }, 1000));\n c = Math.max(d, c);\n return c << b;\n };\n}\nconst ma = k.onRuntimeInitialized;\nk.onRuntimeInitialized = function() {\n ma && ma();\n let b = k.decodeAudio;\n k.decodeAudio = function(f, l) {\n f = b(f);\n l(f);\n };\n let a = k.decodeFont;\n k.decodeFont = function(f, l) {\n f = a(f);\n l(f);\n };\n let c = k.setFallbackFontCb;\n k.setFallbackFontCallback = \"function\" === typeof c ? function(f) {\n c(f);\n } : function() {\n console.warn(\"Module.setFallbackFontCallback called, but text support is not enabled in this build.\");\n };\n const d = k.FileAssetLoader;\n k.ptrToAsset = f => {\n let l = k.ptrToFileAsset(f);\n return l.isImage ? k.ptrToImageAsset(f) : l.isFont ? k.ptrToFontAsset(f) : l.isAudio ? k.ptrToAudioAsset(f) : l;\n };\n k.CustomFileAssetLoader = d.extend(\"CustomFileAssetLoader\", {__construct:function({loadContents:f}) {\n this.__parent.__construct.call(this);\n this.Ea = f;\n }, loadContents:function(f, l) {\n f = k.ptrToAsset(f);\n return this.Ea(f, l);\n },});\n k.CDNFileAssetLoader = d.extend(\"CDNFileAssetLoader\", {__construct:function() {\n this.__parent.__construct.call(this);\n }, loadContents:function(f) {\n let l = k.ptrToAsset(f);\n f = l.cdnUuid;\n if (\"\" === f) {\n return !1;\n }\n (function(h, n) {\n var m = new XMLHttpRequest();\n m.responseType = \"arraybuffer\";\n m.onreadystatechange = function() {\n 4 == m.readyState && 200 == m.status && n(m);\n };\n m.open(\"GET\", h, !0);\n m.send(null);\n })(l.cdnBaseUrl + \"/\" + f, h => {\n l.decode(new Uint8Array(h.response));\n });\n return !0;\n },});\n k.FallbackFileAssetLoader = d.extend(\"FallbackFileAssetLoader\", {__construct:function() {\n this.__parent.__construct.call(this);\n this.ua = [];\n }, addLoader:function(f) {\n this.ua.push(f);\n }, loadContents:function(f, l) {\n for (let h of this.ua) {\n if (h.loadContents(f, l)) {\n return !0;\n }\n }\n return !1;\n },});\n let e = k.computeAlignment;\n k.computeAlignment = function(f, l, h, n, m = 1.0) {\n return e.call(this, f, l, h, n, m);\n };\n};\nconst pa = \"createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText\".split(\" \"), qa = new function() {\n function b() {\n if (!a) {\n var g = document.createElement(\"canvas\"), t = {alpha:1, depth:0, stencil:0, antialias:0, premultipliedAlpha:1, preserveDrawingBuffer:0, powerPreference:\"high-performance\", failIfMajorPerformanceCaveat:0, enableExtensionsByDefault:1, explicitSwapControl:1, renderViaOffscreenBackBuffer:1,};\n let q;\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n if (q = g.getContext(\"webgl\", t), c = 1, !q) {\n return console.log(\"No WebGL support. Image mesh will not be drawn.\"), !1;\n }\n } else {\n if (q = g.getContext(\"webgl2\", t)) {\n c = 2;\n } else {\n if (q = g.getContext(\"webgl\", t)) {\n c = 1;\n } else {\n return console.log(\"No WebGL support. Image mesh will not be drawn.\"), !1;\n }\n }\n }\n q = new Proxy(q, {get(F, v) {\n if (F.isContextLost()) {\n if (n || (console.error(\"Cannot render the mesh because the GL Context was lost. Tried to invoke \", v), n = !0), \"function\" === typeof F[v]) {\n return function() {\n };\n }\n } else {\n return \"function\" === typeof F[v] ? function(...H) {\n return F[v].apply(F, H);\n } : F[v];\n }\n }, set(F, v, H) {\n if (F.isContextLost()) {\n n || (console.error(\"Cannot render the mesh because the GL Context was lost. Tried to set property \" + v), n = !0);\n } else {\n return F[v] = H, !0;\n }\n },});\n d = Math.min(q.getParameter(q.MAX_RENDERBUFFER_SIZE), q.getParameter(q.MAX_TEXTURE_SIZE));\n function G(F, v, H) {\n v = q.createShader(v);\n q.shaderSource(v, H);\n q.compileShader(v);\n H = q.getShaderInfoLog(v);\n if (0 < (H || \"\").length) {\n throw H;\n }\n q.attachShader(F, v);\n }\n g = q.createProgram();\n G(g, q.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 }\");\n G(g, q.FRAGMENT_SHADER, \"precision highp float;\\n uniform sampler2D image;\\n varying vec2 st;\\n void main() {\\n gl_FragColor = texture2D(image, st);\\n }\");\n q.bindAttribLocation(g, 0, \"vertex\");\n q.bindAttribLocation(g, 1, \"uv\");\n q.linkProgram(g);\n t = q.getProgramInfoLog(g);\n if (0 < (t || \"\").trim().length) {\n throw t;\n }\n e = q.getUniformLocation(g, \"mat\");\n f = q.getUniformLocation(g, \"translate\");\n q.useProgram(g);\n q.bindBuffer(q.ARRAY_BUFFER, q.createBuffer());\n q.enableVertexAttribArray(0);\n q.enableVertexAttribArray(1);\n q.bindBuffer(q.ELEMENT_ARRAY_BUFFER, q.createBuffer());\n q.uniform1i(q.getUniformLocation(g, \"image\"), 0);\n q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);\n a = q;\n }\n return !0;\n }\n let a = null, c = 0, d = 0, e = null, f = null, l = 0, h = 0, n = !1;\n b();\n this.Xa = function() {\n b();\n return d;\n };\n this.Ja = function(g) {\n a.deleteTexture && a.deleteTexture(g);\n };\n this.Ia = function(g) {\n if (!b()) {\n return null;\n }\n const t = a.createTexture();\n if (!t) {\n return null;\n }\n a.bindTexture(a.TEXTURE_2D, t);\n a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, g);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR);\n 2 == c ? (a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR_MIPMAP_LINEAR), a.generateMipmap(a.TEXTURE_2D)) : a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR);\n return t;\n };\n const m = new la(8), r = new la(8), w = new la(10), z = new la(10);\n this.Ma = function(g, t, q, G, F) {\n if (b()) {\n var v = m.push(g), H = r.push(t);\n if (a.canvas) {\n if (a.canvas.width != v || a.canvas.height != H) {\n a.canvas.width = v, a.canvas.height = H;\n }\n a.viewport(0, H - t, g, t);\n a.disable(a.SCISSOR_TEST);\n a.clearColor(0, 0, 0, 0);\n a.clear(a.COLOR_BUFFER_BIT);\n a.enable(a.SCISSOR_TEST);\n q.sort((E, V) => V.ya - E.ya);\n v = w.push(G);\n l != v && (a.bufferData(a.ARRAY_BUFFER, 8 * v, a.DYNAMIC_DRAW), l = v);\n v = 0;\n for (var L of q) {\n a.bufferSubData(a.ARRAY_BUFFER, v, L.ia), v += 4 * L.ia.length;\n }\n console.assert(v == 4 * G);\n for (var Q of q) {\n a.bufferSubData(a.ARRAY_BUFFER, v, Q.Ba), v += 4 * Q.Ba.length;\n }\n console.assert(v == 8 * G);\n v = z.push(F);\n h != v && (a.bufferData(a.ELEMENT_ARRAY_BUFFER, 2 * v, a.DYNAMIC_DRAW), h = v);\n L = 0;\n for (var ha of q) {\n a.bufferSubData(a.ELEMENT_ARRAY_BUFFER, L, ha.indices), L += 2 * ha.indices.length;\n }\n console.assert(L == 2 * F);\n ha = 0;\n Q = !0;\n v = L = 0;\n for (const E of q) {\n E.image.da != ha && (a.bindTexture(a.TEXTURE_2D, E.image.ca || null), ha = E.image.da);\n E.$a ? (a.scissor(E.na, H - E.oa - E.ta, E.lb, E.ta), Q = !0) : Q && (a.scissor(0, H - t, g, t), Q = !1);\n q = 2 / g;\n const V = -2 / t;\n a.uniform4f(e, E.N[0] * q * E.X, E.N[1] * V * E.Y, E.N[2] * q * E.X, E.N[3] * V * E.Y);\n a.uniform2f(f, E.N[4] * q * E.X + q * (E.na - E.Ya * E.X) - 1, E.N[5] * V * E.Y + V * (E.oa - E.Za * E.Y) + 1);\n a.vertexAttribPointer(0, 2, a.FLOAT, !1, 0, v);\n a.vertexAttribPointer(1, 2, a.FLOAT, !1, 0, v + 4 * G);\n a.drawElements(a.TRIANGLES, E.indices.length, a.UNSIGNED_SHORT, L);\n v += 4 * E.ia.length;\n L += 2 * E.indices.length;\n }\n console.assert(v == 4 * G);\n console.assert(L == 2 * F);\n }\n }\n };\n this.canvas = function() {\n return b() && a.canvas;\n };\n}(), ra = k.onRuntimeInitialized;\nk.onRuntimeInitialized = function() {\n function b(p) {\n switch(p) {\n case m.srcOver:\n return \"source-over\";\n case m.screen:\n return \"screen\";\n case m.overlay:\n return \"overlay\";\n case m.darken:\n return \"darken\";\n case m.lighten:\n return \"lighten\";\n case m.colorDodge:\n return \"color-dodge\";\n case m.colorBurn:\n return \"color-burn\";\n case m.hardLight:\n return \"hard-light\";\n case m.softLight:\n return \"soft-light\";\n case m.difference:\n return \"difference\";\n case m.exclusion:\n return \"exclusion\";\n case m.multiply:\n return \"multiply\";\n case m.hue:\n return \"hue\";\n case m.saturation:\n return \"saturation\";\n case m.color:\n return \"color\";\n case m.luminosity:\n return \"luminosity\";\n }\n }\n function a(p) {\n return \"rgba(\" + ((16711680 & p) >>> 16) + \",\" + ((65280 & p) >>> 8) + \",\" + ((255 & p) >>> 0) + \",\" + ((4278190080 & p) >>> 24) / 255 + \")\";\n }\n function c() {\n 0 < H.length && (qa.Ma(v.drawWidth(), v.drawHeight(), H, L, Q), H = [], Q = L = 0, v.reset(512, 512));\n for (const p of F) {\n for (const u of p.v) {\n u();\n }\n p.v = [];\n }\n F.clear();\n }\n ra && ra();\n var d = k.RenderPaintStyle;\n const e = k.RenderPath, f = k.RenderPaint, l = k.Renderer, h = k.StrokeCap, n = k.StrokeJoin, m = k.BlendMode, r = d.fill, w = d.stroke, z = k.FillRule.evenOdd;\n let g = 1;\n var t = k.RenderImage.extend(\"CanvasRenderImage\", {__construct:function({R:p, W:u} = {}) {\n this.__parent.__construct.call(this);\n this.da = g;\n g = g + 1 & 2147483647 || 1;\n this.R = p;\n this.W = u;\n }, __destruct:function() {\n this.ca && (qa.Ja(this.ca), URL.revokeObjectURL(this.la));\n this.__parent.__destruct.call(this);\n }, decode:function(p) {\n var u = this;\n u.W && u.W(u);\n var D = new Image();\n u.la = URL.createObjectURL(new Blob([p], {type:\"image/png\",}));\n D.onload = function() {\n u.Da = D;\n u.ca = qa.Ia(D);\n u.size(D.width, D.height);\n u.R && u.R(u);\n };\n D.src = u.la;\n },}), q = e.extend(\"CanvasRenderPath\", {__construct:function() {\n this.__parent.__construct.call(this);\n this.H = new Path2D();\n }, rewind:function() {\n this.H = new Path2D();\n }, addPath:function(p, u, D, B, x, C, A) {\n var I = this.H, na = I.addPath;\n p = p.H;\n const P = new DOMMatrix();\n P.a = u;\n P.b = D;\n P.c = B;\n P.d = x;\n P.e = C;\n P.f = A;\n na.call(I, p, P);\n }, fillRule:function(p) {\n this.ka = p;\n }, moveTo:function(p, u) {\n this.H.moveTo(p, u);\n }, lineTo:function(p, u) {\n this.H.lineTo(p, u);\n }, cubicTo:function(p, u, D, B, x, C) {\n this.H.bezierCurveTo(p, u, D, B, x, C);\n }, close:function() {\n this.H.closePath();\n },}), G = f.extend(\"CanvasRenderPaint\", {color:function(p) {\n this.ma = a(p);\n }, thickness:function(p) {\n this.Ga = p;\n }, join:function(p) {\n switch(p) {\n case n.miter:\n this.ba = \"miter\";\n break;\n case n.round:\n this.ba = \"round\";\n break;\n case n.bevel:\n this.ba = \"bevel\";\n }\n }, cap:function(p) {\n switch(p) {\n case h.butt:\n this.aa = \"butt\";\n break;\n case h.round:\n this.aa = \"round\";\n break;\n case h.square:\n this.aa = \"square\";\n }\n }, style:function(p) {\n this.Fa = p;\n }, blendMode:function(p) {\n this.Ca = b(p);\n }, clearGradient:function() {\n this.P = null;\n }, linearGradient:function(p, u, D, B) {\n this.P = {za:p, Aa:u, qa:D, ra:B, ga:[],};\n }, radialGradient:function(p, u, D, B) {\n this.P = {za:p, Aa:u, qa:D, ra:B, ga:[], Wa:!0,};\n }, addStop:function(p, u) {\n this.P.ga.push({color:p, stop:u,});\n }, completeGradient:function() {\n }, draw:function(p, u, D, B) {\n let x = this.Fa;\n var C = this.ma, A = this.P;\n const I = p.globalCompositeOperation, na = p.globalAlpha;\n p.globalCompositeOperation = this.Ca;\n p.globalAlpha = B;\n if (null != A) {\n C = A.za;\n const T = A.Aa, ca = A.qa;\n var P = A.ra;\n B = A.ga;\n A.Wa ? (A = ca - C, P -= T, C = p.createRadialGradient(C, T, 0, C, T, Math.sqrt(A * A + P * P))) : C = p.createLinearGradient(C, T, ca, P);\n for (let U = 0, W = B.length; U < W; U++) {\n A = B[U], C.addColorStop(A.stop, a(A.color));\n }\n this.ma = C;\n this.P = null;\n }\n switch(x) {\n case w:\n p.strokeStyle = C;\n p.lineWidth = this.Ga;\n p.lineCap = this.aa;\n p.lineJoin = this.ba;\n p.stroke(u);\n break;\n case r:\n p.fillStyle = C, p.fill(u, D);\n }\n p.globalCompositeOperation = I;\n p.globalAlpha = na;\n },});\n const F = new Set();\n let v = null, H = [], L = 0, Q = 0;\n var ha = k.CanvasRenderer = l.extend(\"Renderer\", {__construct:function(p) {\n this.__parent.__construct.call(this);\n this.G = [1, 0, 0, 1, 0, 0];\n this.u = [1.0];\n this.m = p.getContext(\"2d\");\n this.ja = p;\n this.v = [];\n }, save:function() {\n this.G.push(...this.G.slice(this.G.length - 6));\n this.u.push(this.u[this.u.length - 1]);\n this.v.push(this.m.save.bind(this.m));\n }, restore:function() {\n const p = this.G.length - 6;\n if (6 > p) {\n throw \"restore() called without matching save().\";\n }\n this.G.splice(p);\n this.u.pop();\n this.v.push(this.m.restore.bind(this.m));\n }, transform:function(p, u, D, B, x, C) {\n const A = this.G, I = A.length - 6;\n A.splice(I, 6, A[I] * p + A[I + 2] * u, A[I + 1] * p + A[I + 3] * u, A[I] * D + A[I + 2] * B, A[I + 1] * D + A[I + 3] * B, A[I] * x + A[I + 2] * C + A[I + 4], A[I + 1] * x + A[I + 3] * C + A[I + 5]);\n this.v.push(this.m.transform.bind(this.m, p, u, D, B, x, C));\n }, rotate:function(p) {\n const u = Math.sin(p);\n p = Math.cos(p);\n this.transform(p, u, -u, p, 0, 0);\n }, modulateOpacity:function(p) {\n this.u[this.u.length - 1] *= p;\n }, _drawPath:function(p, u) {\n this.v.push(u.draw.bind(u, this.m, p.H, p.ka === z ? \"evenodd\" : \"nonzero\", Math.max(0, this.u[this.u.length - 1])));\n }, _drawRiveImage:function(p, u, D, B) {\n var x = p.Da;\n if (x) {\n var C = this.m, A = b(D), I = Math.max(0, B * this.u[this.u.length - 1]);\n this.v.push(function() {\n C.globalCompositeOperation = A;\n C.globalAlpha = I;\n C.drawImage(x, 0, 0);\n C.globalAlpha = 1;\n });\n }\n }, _getMatrix:function(p) {\n const u = this.G, D = u.length - 6;\n for (let B = 0; 6 > B; ++B) {\n p[B] = u[D + B];\n }\n }, _drawImageMesh:function(p, u, D, B, x, C, A, I, na, P, T, ca, U, W) {\n let ub, vb, wb;\n try {\n ub = k.HEAPF32.slice(x >> 2, (x >> 2) + C), vb = k.HEAPF32.slice(A >> 2, (A >> 2) + I), wb = k.HEAPU16.slice(na >> 1, (na >> 1) + P);\n } catch (Ya) {\n console.error(\"[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.\");\n return;\n }\n u = this.m.canvas.width;\n x = this.m.canvas.height;\n A = U - T;\n I = W - ca;\n T = Math.max(T, 0);\n ca = Math.max(ca, 0);\n U = Math.min(U, u);\n W = Math.min(W, x);\n const va = U - T, wa = W - ca;\n console.assert(va <= Math.min(A, u));\n console.assert(wa <= Math.min(I, x));\n if (!(0 >= va || 0 >= wa)) {\n U = va < A || wa < I;\n u = W = 1;\n var ia = Math.ceil(va * W), ja = Math.ceil(wa * u);\n x = qa.Xa();\n ia > x && (W *= x / ia, ia = x);\n ja > x && (u *= x / ja, ja = x);\n v || (v = new k.DynamicRectanizer(x), v.reset(512, 512));\n x = v.addRect(ia, ja);\n 0 > x && (c(), F.add(this), x = v.addRect(ia, ja), console.assert(0 <= x));\n var xb = x & 65535, yb = x >> 16;\n H.push({N:this.G.slice(this.G.length - 6), image:p, na:xb, oa:yb, Ya:T, Za:ca, lb:ia, ta:ja, X:W, Y:u, ia:ub, Ba:vb, indices:wb, $a:U, ya:p.da << 1 | (U ? 1 : 0),});\n L += C;\n Q += P;\n var oa = this.m, oc = b(D), pc = Math.max(0, B * this.u[this.u.length - 1]);\n this.v.push(function() {\n oa.save();\n oa.resetTransform();\n oa.globalCompositeOperation = oc;\n oa.globalAlpha = pc;\n const Ya = qa.canvas();\n Ya && oa.drawImage(Ya, xb, yb, ia, ja, T, ca, va, wa);\n oa.restore();\n });\n }\n }, _clipPath:function(p) {\n this.v.push(this.m.clip.bind(this.m, p.H, p.ka === z ? \"evenodd\" : \"nonzero\"));\n }, clear:function() {\n F.add(this);\n this.v.push(this.m.clearRect.bind(this.m, 0, 0, this.ja.width, this.ja.height));\n }, flush:function() {\n }, translate:function(p, u) {\n this.transform(1, 0, 0, 1, p, u);\n },});\n k.makeRenderer = function(p) {\n const u = new ha(p), D = u.m;\n return new Proxy(u, {get(B, x) {\n if (\"function\" === typeof B[x]) {\n return function(...C) {\n return B[x].apply(B, C);\n };\n }\n if (\"function\" === typeof D[x]) {\n if (-1 < pa.indexOf(x)) {\n throw Error(\"RiveException: Method call to '\" + x + \"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.\");\n }\n return function(...C) {\n u.v.push(D[x].bind(D, ...C));\n };\n }\n return B[x];\n }, set(B, x, C) {\n if (x in D) {\n return u.v.push(() => {\n D[x] = C;\n }), !0;\n }\n },});\n };\n k.decodeImage = function(p, u) {\n (new t({R:u})).decode(p);\n };\n k.renderFactory = {makeRenderPaint:function() {\n return new G();\n }, makeRenderPath:function() {\n return new q();\n }, makeRenderImage:function() {\n let p = V;\n return new t({W:() => {\n p.total++;\n }, R:() => {\n p.loaded++;\n if (p.loaded === p.total) {\n const u = p.ready;\n u && (u(), p.ready = null);\n }\n },});\n },};\n let E = k.load, V = null;\n k.load = function(p, u, D = !0) {\n const B = new k.FallbackFileAssetLoader();\n void 0 !== u && B.addLoader(u);\n D && (u = new k.CDNFileAssetLoader(), B.addLoader(u));\n return new Promise(function(x) {\n let C = null;\n V = {total:0, loaded:0, ready:function() {\n x(C);\n },};\n C = E(p, B);\n 0 == V.total && x(C);\n });\n };\n let qc = k.RendererWrapper.prototype.align;\n k.RendererWrapper.prototype.align = function(p, u, D, B, x = 1.0) {\n qc.call(this, p, u, D, B, x);\n };\n d = new ka();\n k.requestAnimationFrame = d.requestAnimationFrame.bind(d);\n k.cancelAnimationFrame = d.cancelAnimationFrame.bind(d);\n k.enableFPSCounter = d.Na.bind(d);\n k.disableFPSCounter = d.Ka;\n d.va = c;\n k.resolveAnimationFrame = c;\n k.cleanup = function() {\n v && v.delete();\n };\n};\nvar sa = Object.assign({}, k), ta = \"./this.program\", y = \"\", ua, xa;\nif (ea || fa) {\n fa ? y = self.location.href : \"undefined\" != typeof document && document.currentScript && (y = document.currentScript.src), _scriptName && (y = _scriptName), y.startsWith(\"blob:\") ? y = \"\" : y = y.substr(0, y.replace(/[?#].*/, \"\").lastIndexOf(\"/\") + 1), fa && (xa = b => {\n var a = new XMLHttpRequest();\n a.open(\"GET\", b, !1);\n a.responseType = \"arraybuffer\";\n a.send(null);\n return new Uint8Array(a.response);\n }), ua = (b, a, c) => {\n if (ya(b)) {\n var d = new XMLHttpRequest();\n d.open(\"GET\", b, !0);\n d.responseType = \"arraybuffer\";\n d.onload = () => {\n 200 == d.status || 0 == d.status && d.response ? a(d.response) : c();\n };\n d.onerror = c;\n d.send(null);\n } else {\n fetch(b, {credentials:\"same-origin\"}).then(e => e.ok ? e.arrayBuffer() : Promise.reject(Error(e.status + \" : \" + e.url))).then(a, c);\n }\n };\n}\nvar za = k.print || console.log.bind(console), Aa = k.printErr || console.error.bind(console);\nObject.assign(k, sa);\nsa = null;\nk.thisProgram && (ta = k.thisProgram);\nvar Ba;\nk.wasmBinary && (Ba = k.wasmBinary);\nvar Ca, Da = !1, Ea, J, Fa, Ga, K, M, Ha, Ia;\nfunction Ja() {\n var b = Ca.buffer;\n k.HEAP8 = Ea = new Int8Array(b);\n k.HEAP16 = Fa = new Int16Array(b);\n k.HEAPU8 = J = new Uint8Array(b);\n k.HEAPU16 = Ga = new Uint16Array(b);\n k.HEAP32 = K = new Int32Array(b);\n k.HEAPU32 = M = new Uint32Array(b);\n k.HEAPF32 = Ha = new Float32Array(b);\n k.HEAPF64 = Ia = new Float64Array(b);\n}\nvar Ka = [], La = [], Ma = [];\nfunction Na() {\n var b = k.preRun.shift();\n Ka.unshift(b);\n}\nvar Oa = 0, Pa = null, Qa = null;\nfunction Ra(b) {\n k.onAbort?.(b);\n b = \"Aborted(\" + b + \")\";\n Aa(b);\n Da = !0;\n b = new WebAssembly.RuntimeError(b + \". Build with -sASSERTIONS for more info.\");\n ba(b);\n throw b;\n}\nvar Sa = b => b.startsWith(\"data:application/octet-stream;base64,\"), ya = b => b.startsWith(\"file://\"), Ta;\nfunction Ua(b) {\n if (b == Ta && Ba) {\n return new Uint8Array(Ba);\n }\n if (xa) {\n return xa(b);\n }\n throw \"both async and sync fetching of the wasm failed\";\n}\nfunction Va(b) {\n return Ba ? Promise.resolve().then(() => Ua(b)) : new Promise((a, c) => {\n ua(b, d => a(new Uint8Array(d)), () => {\n try {\n a(Ua(b));\n } catch (d) {\n c(d);\n }\n });\n });\n}\nfunction Wa(b, a, c) {\n return Va(b).then(d => WebAssembly.instantiate(d, a)).then(c, d => {\n Aa(`failed to asynchronously prepare wasm: ${d}`);\n Ra(d);\n });\n}\nfunction Xa(b, a) {\n var c = Ta;\n return Ba || \"function\" != typeof WebAssembly.instantiateStreaming || Sa(c) || ya(c) || \"function\" != typeof fetch ? Wa(c, b, a) : fetch(c, {credentials:\"same-origin\"}).then(d => WebAssembly.instantiateStreaming(d, b).then(a, function(e) {\n Aa(`wasm streaming compile failed: ${e}`);\n Aa(\"falling back to ArrayBuffer instantiation\");\n return Wa(c, b, a);\n }));\n}\nvar Za = b => {\n for (; 0 < b.length;) {\n b.shift()(k);\n }\n}, $a = (b, a) => Object.defineProperty(a, \"name\", {value:b}), ab = [], N = [], O, R = b => {\n if (!b) {\n throw new O(\"Cannot use deleted val. handle = \" + b);\n }\n return N[b];\n}, bb = b => {\n switch(b) {\n case void 0:\n return 2;\n case null:\n return 4;\n case !0:\n return 6;\n case !1:\n return 8;\n default:\n const a = ab.pop() || N.length;\n N[a] = b;\n N[a + 1] = 1;\n return a;\n }\n}, cb = b => {\n var a = Error, c = $a(b, function(d) {\n this.name = b;\n this.message = d;\n d = Error(d).stack;\n void 0 !== d && (this.stack = this.toString() + \"\\n\" + d.replace(/^Error(:[^\\n]*)?\\n/, \"\"));\n });\n c.prototype = Object.create(a.prototype);\n c.prototype.constructor = c;\n c.prototype.toString = function() {\n return void 0 === this.message ? this.name : `${this.name}: ${this.message}`;\n };\n return c;\n}, db, eb, S = b => {\n for (var a = \"\"; J[b];) {\n a += eb[J[b++]];\n }\n return a;\n}, fb = [], gb = () => {\n for (; fb.length;) {\n var b = fb.pop();\n b.g.M = !1;\n b[\"delete\"]();\n }\n}, hb, ib = {}, jb = (b, a) => {\n if (void 0 === a) {\n throw new O(\"ptr should not be undefined\");\n }\n for (; b.o;) {\n a = b.S(a), b = b.o;\n }\n return a;\n}, kb = {}, nb = b => {\n b = lb(b);\n var a = S(b);\n mb(b);\n return a;\n}, ob = (b, a) => {\n var c = kb[b];\n if (void 0 === c) {\n throw b = `${a} has unknown type ${nb(b)}`, new O(b);\n }\n return c;\n}, pb = () => {\n}, qb = !1, rb = (b, a, c) => {\n if (a === c) {\n return b;\n }\n if (void 0 === c.o) {\n return null;\n }\n b = rb(b, a, c.o);\n return null === b ? null : c.La(b);\n}, sb = {}, tb = (b, a) => {\n a = jb(b, a);\n return ib[a];\n}, zb, Bb = (b, a) => {\n if (!a.j || !a.i) {\n throw new zb(\"makeClassHandle requires ptr and ptrType\");\n }\n if (!!a.A !== !!a.s) {\n throw new zb(\"Both smartPtrType and smartPtr must be specified\");\n }\n a.count = {value:1};\n return Ab(Object.create(b, {g:{value:a, writable:!0,},}));\n}, Ab = b => {\n if (\"undefined\" === typeof FinalizationRegistry) {\n return Ab = a => a, b;\n }\n qb = new FinalizationRegistry(a => {\n a = a.g;\n --a.count.value;\n 0 === a.count.value && (a.s ? a.A.D(a.s) : a.j.h.D(a.i));\n });\n Ab = a => {\n var c = a.g;\n c.s && qb.register(a, {g:c}, a);\n return a;\n };\n pb = a => {\n qb.unregister(a);\n };\n return Ab(b);\n}, Cb = {}, Db = b => {\n for (; b.length;) {\n var a = b.pop();\n b.pop()(a);\n }\n};\nfunction Eb(b) {\n return this.fromWireType(M[b >> 2]);\n}\nvar Fb = {}, Gb = {}, X = (b, a, c) => {\n function d(h) {\n h = c(h);\n if (h.length !== b.length) {\n throw new zb(\"Mismatched type converter count\");\n }\n for (var n = 0; n < b.length; ++n) {\n Hb(b[n], h[n]);\n }\n }\n b.forEach(function(h) {\n Gb[h] = a;\n });\n var e = Array(a.length), f = [], l = 0;\n a.forEach((h, n) => {\n kb.hasOwnProperty(h) ? e[n] = kb[h] : (f.push(h), Fb.hasOwnProperty(h) || (Fb[h] = []), Fb[h].push(() => {\n e[n] = kb[h];\n ++l;\n l === f.length && d(e);\n }));\n });\n 0 === f.length && d(e);\n};\nfunction Ib(b, a, c = {}) {\n var d = a.name;\n if (!b) {\n throw new O(`type \"${d}\" must have a positive integer typeid pointer`);\n }\n if (kb.hasOwnProperty(b)) {\n if (c.Va) {\n return;\n }\n throw new O(`Cannot register type '${d}' twice`);\n }\n kb[b] = a;\n delete Gb[b];\n Fb.hasOwnProperty(b) && (a = Fb[b], delete Fb[b], a.forEach(e => e()));\n}\nfunction Hb(b, a, c = {}) {\n if (!(\"argPackAdvance\" in a)) {\n throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");\n }\n return Ib(b, a, c);\n}\nvar Jb = b => {\n throw new O(b.g.j.h.name + \" instance already deleted\");\n};\nfunction Kb() {\n}\nvar Lb = (b, a, c) => {\n if (void 0 === b[a].l) {\n var d = b[a];\n b[a] = function(...e) {\n if (!b[a].l.hasOwnProperty(e.length)) {\n throw new O(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${b[a].l})!`);\n }\n return b[a].l[e.length].apply(this, e);\n };\n b[a].l = [];\n b[a].l[d.L] = d;\n }\n}, Mb = (b, a, c) => {\n if (k.hasOwnProperty(b)) {\n if (void 0 === c || void 0 !== k[b].l && void 0 !== k[b].l[c]) {\n throw new O(`Cannot register public name '${b}' twice`);\n }\n Lb(k, b, b);\n if (k.hasOwnProperty(c)) {\n throw new O(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);\n }\n k[b].l[c] = a;\n } else {\n k[b] = a, void 0 !== c && (k[b].nb = c);\n }\n}, Nb = b => {\n if (void 0 === b) {\n return \"_unknown\";\n }\n b = b.replace(/[^a-zA-Z0-9_]/g, \"$\");\n var a = b.charCodeAt(0);\n return 48 <= a && 57 >= a ? `_${b}` : b;\n};\nfunction Ob(b, a, c, d, e, f, l, h) {\n this.name = b;\n this.constructor = a;\n this.C = c;\n this.D = d;\n this.o = e;\n this.Qa = f;\n this.S = l;\n this.La = h;\n this.wa = [];\n}\nvar Pb = (b, a, c) => {\n for (; a !== c;) {\n if (!a.S) {\n throw new O(`Expected null or instance of ${c.name}, got an instance of ${a.name}`);\n }\n b = a.S(b);\n a = a.o;\n }\n return b;\n};\nfunction Qb(b, a) {\n if (null === a) {\n if (this.ea) {\n throw new O(`null is not a valid ${this.name}`);\n }\n return 0;\n }\n if (!a.g) {\n throw new O(`Cannot pass \"${Rb(a)}\" as a ${this.name}`);\n }\n if (!a.g.i) {\n throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n return Pb(a.g.i, a.g.j.h, this.h);\n}\nfunction Sb(b, a) {\n if (null === a) {\n if (this.ea) {\n throw new O(`null is not a valid ${this.name}`);\n }\n if (this.V) {\n var c = this.fa();\n null !== b && b.push(this.D, c);\n return c;\n }\n return 0;\n }\n if (!a || !a.g) {\n throw new O(`Cannot pass \"${Rb(a)}\" as a ${this.name}`);\n }\n if (!a.g.i) {\n throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n if (!this.U && a.g.j.U) {\n throw new O(`Cannot convert argument of type ${a.g.A ? a.g.A.name : a.g.j.name} to parameter type ${this.name}`);\n }\n c = Pb(a.g.i, a.g.j.h, this.h);\n if (this.V) {\n if (void 0 === a.g.s) {\n throw new O(\"Passing raw pointer to smart pointer is illegal\");\n }\n switch(this.gb) {\n case 0:\n if (a.g.A === this) {\n c = a.g.s;\n } else {\n throw new O(`Cannot convert argument of type ${a.g.A ? a.g.A.name : a.g.j.name} to parameter type ${this.name}`);\n }\n break;\n case 1:\n c = a.g.s;\n break;\n case 2:\n if (a.g.A === this) {\n c = a.g.s;\n } else {\n var d = a.clone();\n c = this.bb(c, bb(() => d[\"delete\"]()));\n null !== b && b.push(this.D, c);\n }\n break;\n default:\n throw new O(\"Unsupporting sharing policy\");\n }\n }\n return c;\n}\nfunction Tb(b, a) {\n if (null === a) {\n if (this.ea) {\n throw new O(`null is not a valid ${this.name}`);\n }\n return 0;\n }\n if (!a.g) {\n throw new O(`Cannot pass \"${Rb(a)}\" as a ${this.name}`);\n }\n if (!a.g.i) {\n throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n if (a.g.j.U) {\n throw new O(`Cannot convert argument of type ${a.g.j.name} to parameter type ${this.name}`);\n }\n return Pb(a.g.i, a.g.j.h, this.h);\n}\nfunction Ub(b, a, c, d, e, f, l, h, n, m, r) {\n this.name = b;\n this.h = a;\n this.ea = c;\n this.U = d;\n this.V = e;\n this.ab = f;\n this.gb = l;\n this.xa = h;\n this.fa = n;\n this.bb = m;\n this.D = r;\n e || void 0 !== a.o ? this.toWireType = Sb : (this.toWireType = d ? Qb : Tb, this.B = null);\n}\nvar Vb = (b, a, c) => {\n if (!k.hasOwnProperty(b)) {\n throw new zb(\"Replacing nonexistent public symbol\");\n }\n void 0 !== k[b].l && void 0 !== c ? k[b].l[c] = a : (k[b] = a, k[b].L = c);\n}, Wb = [], Xb, Yb = b => {\n var a = Wb[b];\n a || (b >= Wb.length && (Wb.length = b + 1), Wb[b] = a = Xb.get(b));\n return a;\n}, Zb = (b, a, c = []) => {\n b.includes(\"j\") ? (b = b.replace(/p/g, \"i\"), a = (0,k[\"dynCall_\" + b])(a, ...c)) : a = Yb(a)(...c);\n return a;\n}, $b = (b, a) => (...c) => Zb(b, a, c), Y = (b, a) => {\n b = S(b);\n var c = b.includes(\"j\") ? $b(b, a) : Yb(a);\n if (\"function\" != typeof c) {\n throw new O(`unknown function pointer with signature ${b}: ${a}`);\n }\n return c;\n}, ac, bc = (b, a) => {\n function c(f) {\n e[f] || kb[f] || (Gb[f] ? Gb[f].forEach(c) : (d.push(f), e[f] = !0));\n }\n var d = [], e = {};\n a.forEach(c);\n throw new ac(`${b}: ` + d.map(nb).join([\", \"]));\n};\nfunction cc(b) {\n for (var a = 1; a < b.length; ++a) {\n if (null !== b[a] && void 0 === b[a].B) {\n return !0;\n }\n }\n return !1;\n}\nfunction dc(b, a, c, d, e) {\n var f = a.length;\n if (2 > f) {\n throw new O(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");\n }\n var l = null !== a[1] && null !== c, h = cc(a), n = \"void\" !== a[0].name, m = f - 2, r = Array(m), w = [], z = [];\n return $a(b, function(...g) {\n if (g.length !== m) {\n throw new O(`function ${b} called with ${g.length} arguments, expected ${m}`);\n }\n z.length = 0;\n w.length = l ? 2 : 1;\n w[0] = e;\n if (l) {\n var t = a[1].toWireType(z, this);\n w[1] = t;\n }\n for (var q = 0; q < m; ++q) {\n r[q] = a[q + 2].toWireType(z, g[q]), w.push(r[q]);\n }\n g = d(...w);\n if (h) {\n Db(z);\n } else {\n for (q = l ? 1 : 2; q < a.length; q++) {\n var G = 1 === q ? t : r[q - 2];\n null !== a[q].B && a[q].B(G);\n }\n }\n t = n ? a[0].fromWireType(g) : void 0;\n return t;\n });\n}\nvar ec = (b, a) => {\n for (var c = [], d = 0; d < b; d++) {\n c.push(M[a + 4 * d >> 2]);\n }\n return c;\n}, fc = b => {\n b = b.trim();\n const a = b.indexOf(\"(\");\n return -1 !== a ? b.substr(0, a) : b;\n}, gc = (b, a, c) => {\n if (!(b instanceof Object)) {\n throw new O(`${c} with invalid \"this\": ${b}`);\n }\n if (!(b instanceof a.h.constructor)) {\n throw new O(`${c} incompatible with \"this\" of type ${b.constructor.name}`);\n }\n if (!b.g.i) {\n throw new O(`cannot call emscripten binding method ${c} on deleted object`);\n }\n return Pb(b.g.i, b.g.j.h, a.h);\n}, hc = b => {\n 9 < b && 0 === --N[b + 1] && (N[b] = void 0, ab.push(b));\n}, ic = {name:\"emscripten::val\", fromWireType:b => {\n var a = R(b);\n hc(b);\n return a;\n}, toWireType:(b, a) => bb(a), argPackAdvance:8, readValueFromPointer:Eb, B:null,}, jc = (b, a, c) => {\n switch(a) {\n case 1:\n return c ? function(d) {\n return this.fromWireType(Ea[d]);\n } : function(d) {\n return this.fromWireType(J[d]);\n };\n case 2:\n return c ? function(d) {\n return this.fromWireType(Fa[d >> 1]);\n } : function(d) {\n return this.fromWireType(Ga[d >> 1]);\n };\n case 4:\n return c ? function(d) {\n return this.fromWireType(K[d >> 2]);\n } : function(d) {\n return this.fromWireType(M[d >> 2]);\n };\n default:\n throw new TypeError(`invalid integer width (${a}): ${b}`);\n }\n}, Rb = b => {\n if (null === b) {\n return \"null\";\n }\n var a = typeof b;\n return \"object\" === a || \"array\" === a || \"function\" === a ? b.toString() : \"\" + b;\n}, kc = (b, a) => {\n switch(a) {\n case 4:\n return function(c) {\n return this.fromWireType(Ha[c >> 2]);\n };\n case 8:\n return function(c) {\n return this.fromWireType(Ia[c >> 3]);\n };\n default:\n throw new TypeError(`invalid float width (${a}): ${b}`);\n }\n}, lc = (b, a, c) => {\n switch(a) {\n case 1:\n return c ? d => Ea[d] : d => J[d];\n case 2:\n return c ? d => Fa[d >> 1] : d => Ga[d >> 1];\n case 4:\n return c ? d => K[d >> 2] : d => M[d >> 2];\n default:\n throw new TypeError(`invalid integer width (${a}): ${b}`);\n }\n}, mc = (b, a, c, d) => {\n if (0 < d) {\n d = c + d - 1;\n for (var e = 0; e < b.length; ++e) {\n var f = b.charCodeAt(e);\n if (55296 <= f && 57343 >= f) {\n var l = b.charCodeAt(++e);\n f = 65536 + ((f & 1023) << 10) | l & 1023;\n }\n if (127 >= f) {\n if (c >= d) {\n break;\n }\n a[c++] = f;\n } else {\n if (2047 >= f) {\n if (c + 1 >= d) {\n break;\n }\n a[c++] = 192 | f >> 6;\n } else {\n if (65535 >= f) {\n if (c + 2 >= d) {\n break;\n }\n a[c++] = 224 | f >> 12;\n } else {\n if (c + 3 >= d) {\n break;\n }\n a[c++] = 240 | f >> 18;\n a[c++] = 128 | f >> 12 & 63;\n }\n a[c++] = 128 | f >> 6 & 63;\n }\n a[c++] = 128 | f & 63;\n }\n }\n a[c] = 0;\n }\n}, nc = b => {\n for (var a = 0, c = 0; c < b.length; ++c) {\n var d = b.charCodeAt(c);\n 127 >= d ? a++ : 2047 >= d ? a += 2 : 55296 <= d && 57343 >= d ? (a += 4, ++c) : a += 3;\n }\n return a;\n}, rc = \"undefined\" != typeof TextDecoder ? new TextDecoder(\"utf8\") : void 0, sc = (b, a, c) => {\n var d = a + c;\n for (c = a; b[c] && !(c >= d);) {\n ++c;\n }\n if (16 < c - a && b.buffer && rc) {\n return rc.decode(b.subarray(a, c));\n }\n for (d = \"\"; a < c;) {\n var e = b[a++];\n if (e & 128) {\n var f = b[a++] & 63;\n if (192 == (e & 224)) {\n d += String.fromCharCode((e & 31) << 6 | f);\n } else {\n var l = b[a++] & 63;\n e = 224 == (e & 240) ? (e & 15) << 12 | f << 6 | l : (e & 7) << 18 | f << 12 | l << 6 | b[a++] & 63;\n 65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));\n }\n } else {\n d += String.fromCharCode(e);\n }\n }\n return d;\n}, tc = \"undefined\" != typeof TextDecoder ? new TextDecoder(\"utf-16le\") : void 0, uc = (b, a) => {\n var c = b >> 1;\n for (var d = c + a / 2; !(c >= d) && Ga[c];) {\n ++c;\n }\n c <<= 1;\n if (32 < c - b && tc) {\n return tc.decode(J.subarray(b, c));\n }\n c = \"\";\n for (d = 0; !(d >= a / 2); ++d) {\n var e = Fa[b + 2 * d >> 1];\n if (0 == e) {\n break;\n }\n c += String.fromCharCode(e);\n }\n return c;\n}, vc = (b, a, c) => {\n c ??= 2147483647;\n if (2 > c) {\n return 0;\n }\n c -= 2;\n var d = a;\n c = c < 2 * b.length ? c / 2 : b.length;\n for (var e = 0; e < c; ++e) {\n Fa[a >> 1] = b.charCodeAt(e), a += 2;\n }\n Fa[a >> 1] = 0;\n return a - d;\n}, wc = b => 2 * b.length, xc = (b, a) => {\n for (var c = 0, d = \"\"; !(c >= a / 4);) {\n var e = K[b + 4 * c >> 2];\n if (0 == e) {\n break;\n }\n ++c;\n 65536 <= e ? (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023)) : d += String.fromCharCode(e);\n }\n return d;\n}, yc = (b, a, c) => {\n c ??= 2147483647;\n if (4 > c) {\n return 0;\n }\n var d = a;\n c = d + c - 4;\n for (var e = 0; e < b.length; ++e) {\n var f = b.charCodeAt(e);\n if (55296 <= f && 57343 >= f) {\n var l = b.charCodeAt(++e);\n f = 65536 + ((f & 1023) << 10) | l & 1023;\n }\n K[a >> 2] = f;\n a += 4;\n if (a + 4 > c) {\n break;\n }\n }\n K[a >> 2] = 0;\n return a - d;\n}, zc = b => {\n for (var a = 0, c = 0; c < b.length; ++c) {\n var d = b.charCodeAt(c);\n 55296 <= d && 57343 >= d && ++c;\n a += 4;\n }\n return a;\n}, Ac = (b, a, c) => {\n var d = [];\n b = b.toWireType(d, c);\n d.length && (M[a >> 2] = bb(d));\n return b;\n}, Bc = {}, Cc = b => {\n var a = Bc[b];\n return void 0 === a ? S(b) : a;\n}, Dc = [], Ec = b => {\n var a = Dc.length;\n Dc.push(b);\n return a;\n}, Fc = (b, a) => {\n for (var c = Array(b), d = 0; d < b; ++d) {\n c[d] = ob(M[a + 4 * d >> 2], \"parameter \" + d);\n }\n return c;\n}, Gc = Reflect.construct, Hc = {}, Jc = () => {\n if (!Ic) {\n var b = {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\", _:ta || \"./this.program\"}, a;\n for (a in Hc) {\n void 0 === Hc[a] ? delete b[a] : b[a] = Hc[a];\n }\n var c = [];\n for (a in b) {\n c.push(`${a}=${b[a]}`);\n }\n Ic = c;\n }\n return Ic;\n}, Ic, Kc = [null, [], []], Lc = b => 0 === b % 4 && (0 !== b % 100 || 0 === b % 400), Mc = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Nc = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nfunction Oc(b) {\n var a = Array(nc(b) + 1);\n mc(b, a, 0, a.length);\n return a;\n}\nvar Pc = (b, a, c, d) => {\n function e(g, t, q) {\n for (g = \"number\" == typeof g ? g.toString() : g || \"\"; g.length < t;) {\n g = q[0] + g;\n }\n return g;\n }\n function f(g, t) {\n return e(g, t, \"0\");\n }\n function l(g, t) {\n function q(F) {\n return 0 > F ? -1 : 0 < F ? 1 : 0;\n }\n var G;\n 0 === (G = q(g.getFullYear() - t.getFullYear())) && 0 === (G = q(g.getMonth() - t.getMonth())) && (G = q(g.getDate() - t.getDate()));\n return G;\n }\n function h(g) {\n switch(g.getDay()) {\n case 0:\n return new Date(g.getFullYear() - 1, 11, 29);\n case 1:\n return g;\n case 2:\n return new Date(g.getFullYear(), 0, 3);\n case 3:\n return new Date(g.getFullYear(), 0, 2);\n case 4:\n return new Date(g.getFullYear(), 0, 1);\n case 5:\n return new Date(g.getFullYear() - 1, 11, 31);\n case 6:\n return new Date(g.getFullYear() - 1, 11, 30);\n }\n }\n function n(g) {\n var t = g.J;\n for (g = new Date((new Date(g.K + 1900, 0, 1)).getTime()); 0 < t;) {\n var q = g.getMonth(), G = (Lc(g.getFullYear()) ? Mc : Nc)[q];\n if (t > G - g.getDate()) {\n t -= G - g.getDate() + 1, g.setDate(1), 11 > q ? g.setMonth(q + 1) : (g.setMonth(0), g.setFullYear(g.getFullYear() + 1));\n } else {\n g.setDate(g.getDate() + t);\n break;\n }\n }\n q = new Date(g.getFullYear() + 1, 0, 4);\n t = h(new Date(g.getFullYear(), 0, 4));\n q = h(q);\n return 0 >= l(t, g) ? 0 >= l(q, g) ? g.getFullYear() + 1 : g.getFullYear() : g.getFullYear() - 1;\n }\n var m = M[d + 40 >> 2];\n d = {jb:K[d >> 2], ib:K[d + 4 >> 2], Z:K[d + 8 >> 2], ha:K[d + 12 >> 2], $:K[d + 16 >> 2], K:K[d + 20 >> 2], F:K[d + 24 >> 2], J:K[d + 28 >> 2], ob:K[d + 32 >> 2], hb:K[d + 36 >> 2], kb:m ? m ? sc(J, m) : \"\" : \"\"};\n c = c ? sc(J, c) : \"\";\n m = {\"%c\":\"%a %b %d %H:%M:%S %Y\", \"%D\":\"%m/%d/%y\", \"%F\":\"%Y-%m-%d\", \"%h\":\"%b\", \"%r\":\"%I:%M:%S %p\", \"%R\":\"%H:%M\", \"%T\":\"%H:%M:%S\", \"%x\":\"%m/%d/%y\", \"%X\":\"%H:%M:%S\", \"%Ec\":\"%c\", \"%EC\":\"%C\", \"%Ex\":\"%m/%d/%y\", \"%EX\":\"%H:%M:%S\", \"%Ey\":\"%y\", \"%EY\":\"%Y\", \"%Od\":\"%d\", \"%Oe\":\"%e\", \"%OH\":\"%H\", \"%OI\":\"%I\", \"%Om\":\"%m\", \"%OM\":\"%M\", \"%OS\":\"%S\", \"%Ou\":\"%u\", \"%OU\":\"%U\", \"%OV\":\"%V\", \"%Ow\":\"%w\", \"%OW\":\"%W\", \"%Oy\":\"%y\",};\n for (var r in m) {\n c = c.replace(new RegExp(r, \"g\"), m[r]);\n }\n var w = \"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"), z = \"January February March April May June July August September October November December\".split(\" \");\n m = {\"%a\":g => w[g.F].substring(0, 3), \"%A\":g => w[g.F], \"%b\":g => z[g.$].substring(0, 3), \"%B\":g => z[g.$], \"%C\":g => f((g.K + 1900) / 100 | 0, 2), \"%d\":g => f(g.ha, 2), \"%e\":g => e(g.ha, 2, \" \"), \"%g\":g => n(g).toString().substring(2), \"%G\":n, \"%H\":g => f(g.Z, 2), \"%I\":g => {\n g = g.Z;\n 0 == g ? g = 12 : 12 < g && (g -= 12);\n return f(g, 2);\n }, \"%j\":g => {\n for (var t = 0, q = 0; q <= g.$ - 1; t += (Lc(g.K + 1900) ? Mc : Nc)[q++]) {\n }\n return f(g.ha + t, 3);\n }, \"%m\":g => f(g.$ + 1, 2), \"%M\":g => f(g.ib, 2), \"%n\":() => \"\\n\", \"%p\":g => 0 <= g.Z && 12 > g.Z ? \"AM\" : \"PM\", \"%S\":g => f(g.jb, 2), \"%t\":() => \"\\t\", \"%u\":g => g.F || 7, \"%U\":g => f(Math.floor((g.J + 7 - g.F) / 7), 2), \"%V\":g => {\n var t = Math.floor((g.J + 7 - (g.F + 6) % 7) / 7);\n 2 >= (g.F + 371 - g.J - 2) % 7 && t++;\n if (t) {\n 53 == t && (q = (g.F + 371 - g.J) % 7, 4 == q || 3 == q && Lc(g.K) || (t = 1));\n } else {\n t = 52;\n var q = (g.F + 7 - g.J - 1) % 7;\n (4 == q || 5 == q && Lc(g.K % 400 - 1)) && t++;\n }\n return f(t, 2);\n }, \"%w\":g => g.F, \"%W\":g => f(Math.floor((g.J + 7 - (g.F + 6) % 7) / 7), 2), \"%y\":g => (g.K + 1900).toString().substring(2), \"%Y\":g => g.K + 1900, \"%z\":g => {\n g = g.hb;\n var t = 0 <= g;\n g = Math.abs(g) / 60;\n return (t ? \"+\" : \"-\") + String(\"0000\" + (g / 60 * 100 + g % 60)).slice(-4);\n }, \"%Z\":g => g.kb, \"%%\":() => \"%\"};\n c = c.replace(/%%/g, \"\\x00\\x00\");\n for (r in m) {\n c.includes(r) && (c = c.replace(new RegExp(r, \"g\"), m[r](d)));\n }\n c = c.replace(/\\0\\0/g, \"%\");\n r = Oc(c);\n if (r.length > a) {\n return 0;\n }\n Ea.set(r, b);\n return r.length - 1;\n};\nO = k.BindingError = class extends Error {\n constructor(b) {\n super(b);\n this.name = \"BindingError\";\n }\n};\nN.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1,);\nk.count_emval_handles = () => N.length / 2 - 5 - ab.length;\ndb = k.PureVirtualError = cb(\"PureVirtualError\");\nfor (var Qc = Array(256), Rc = 0; 256 > Rc; ++Rc) {\n Qc[Rc] = String.fromCharCode(Rc);\n}\neb = Qc;\nk.getInheritedInstanceCount = () => Object.keys(ib).length;\nk.getLiveInheritedInstances = () => {\n var b = [], a;\n for (a in ib) {\n ib.hasOwnProperty(a) && b.push(ib[a]);\n }\n return b;\n};\nk.flushPendingDeletes = gb;\nk.setDelayFunction = b => {\n hb = b;\n fb.length && hb && hb(gb);\n};\nzb = k.InternalError = class extends Error {\n constructor(b) {\n super(b);\n this.name = \"InternalError\";\n }\n};\nObject.assign(Kb.prototype, {isAliasOf:function(b) {\n if (!(this instanceof Kb && b instanceof Kb)) {\n return !1;\n }\n var a = this.g.j.h, c = this.g.i;\n b.g = b.g;\n var d = b.g.j.h;\n for (b = b.g.i; a.o;) {\n c = a.S(c), a = a.o;\n }\n for (; d.o;) {\n b = d.S(b), d = d.o;\n }\n return a === d && c === b;\n}, clone:function() {\n this.g.i || Jb(this);\n if (this.g.O) {\n return this.g.count.value += 1, this;\n }\n var b = Ab, a = Object, c = a.create, d = Object.getPrototypeOf(this), e = this.g;\n b = b(c.call(a, d, {g:{value:{count:e.count, M:e.M, O:e.O, i:e.i, j:e.j, s:e.s, A:e.A,},}}));\n b.g.count.value += 1;\n b.g.M = !1;\n return b;\n}, [\"delete\"]() {\n this.g.i || Jb(this);\n if (this.g.M && !this.g.O) {\n throw new O(\"Object already scheduled for deletion\");\n }\n pb(this);\n var b = this.g;\n --b.count.value;\n 0 === b.count.value && (b.s ? b.A.D(b.s) : b.j.h.D(b.i));\n this.g.O || (this.g.s = void 0, this.g.i = void 0);\n}, isDeleted:function() {\n return !this.g.i;\n}, deleteLater:function() {\n this.g.i || Jb(this);\n if (this.g.M && !this.g.O) {\n throw new O(\"Object already scheduled for deletion\");\n }\n fb.push(this);\n 1 === fb.length && hb && hb(gb);\n this.g.M = !0;\n return this;\n},});\nObject.assign(Ub.prototype, {Ra(b) {\n this.xa && (b = this.xa(b));\n return b;\n}, pa(b) {\n this.D?.(b);\n}, argPackAdvance:8, readValueFromPointer:Eb, fromWireType:function(b) {\n function a() {\n return this.V ? Bb(this.h.C, {j:this.ab, i:c, A:this, s:b,}) : Bb(this.h.C, {j:this, i:b,});\n }\n var c = this.Ra(b);\n if (!c) {\n return this.pa(b), null;\n }\n var d = tb(this.h, c);\n if (void 0 !== d) {\n if (0 === d.g.count.value) {\n return d.g.i = c, d.g.s = b, d.clone();\n }\n d = d.clone();\n this.pa(b);\n return d;\n }\n d = this.h.Qa(c);\n d = sb[d];\n if (!d) {\n return a.call(this);\n }\n d = this.U ? d.Ha : d.pointerType;\n var e = rb(c, this.h, d.h);\n return null === e ? a.call(this) : this.V ? Bb(d.h.C, {j:d, i:e, A:this, s:b,}) : Bb(d.h.C, {j:d, i:e,});\n},});\nac = k.UnboundTypeError = cb(\"UnboundTypeError\");\nvar Tc = {_abort_js:() => {\n Ra(\"\");\n}, _embind_create_inheriting_constructor:(b, a, c) => {\n b = S(b);\n a = ob(a, \"wrapper\");\n c = R(c);\n var d = a.h, e = d.C, f = d.o.C, l = d.o.constructor;\n b = $a(b, function(...h) {\n d.o.wa.forEach(function(n) {\n if (this[n] === f[n]) {\n throw new db(`Pure virtual function ${n} must be implemented in JavaScript`);\n }\n }.bind(this));\n Object.defineProperty(this, \"__parent\", {value:e});\n this.__construct(...h);\n });\n e.__construct = function(...h) {\n if (this === e) {\n throw new O(\"Pass correct 'this' to __construct\");\n }\n h = l.implement(this, ...h);\n pb(h);\n var n = h.g;\n h.notifyOnDestruction();\n n.O = !0;\n Object.defineProperties(this, {g:{value:n}});\n Ab(this);\n h = n.i;\n h = jb(d, h);\n if (ib.hasOwnProperty(h)) {\n throw new O(`Tried to register registered instance: ${h}`);\n }\n ib[h] = this;\n };\n e.__destruct = function() {\n if (this === e) {\n throw new O(\"Pass correct 'this' to __destruct\");\n }\n pb(this);\n var h = this.g.i;\n h = jb(d, h);\n if (ib.hasOwnProperty(h)) {\n delete ib[h];\n } else {\n throw new O(`Tried to unregister unregistered instance: ${h}`);\n }\n };\n b.prototype = Object.create(e);\n Object.assign(b.prototype, c);\n return bb(b);\n}, _embind_finalize_value_object:b => {\n var a = Cb[b];\n delete Cb[b];\n var c = a.fa, d = a.D, e = a.sa, f = e.map(l => l.Ua).concat(e.map(l => l.eb));\n X([b], f, l => {\n var h = {};\n e.forEach((n, m) => {\n var r = l[m], w = n.Sa, z = n.Ta, g = l[m + e.length], t = n.cb, q = n.fb;\n h[n.Oa] = {read:G => r.fromWireType(w(z, G)), write:(G, F) => {\n var v = [];\n t(q, G, g.toWireType(v, F));\n Db(v);\n }};\n });\n return [{name:a.name, fromWireType:n => {\n var m = {}, r;\n for (r in h) {\n m[r] = h[r].read(n);\n }\n d(n);\n return m;\n }, toWireType:(n, m) => {\n for (var r in h) {\n if (!(r in m)) {\n throw new TypeError(`Missing field: \"${r}\"`);\n }\n }\n var w = c();\n for (r in h) {\n h[r].write(w, m[r]);\n }\n null !== n && n.push(d, w);\n return w;\n }, argPackAdvance:8, readValueFromPointer:Eb, B:d,}];\n });\n}, _embind_register_bigint:() => {\n}, _embind_register_bool:(b, a, c, d) => {\n a = S(a);\n Hb(b, {name:a, fromWireType:function(e) {\n return !!e;\n }, toWireType:function(e, f) {\n return f ? c : d;\n }, argPackAdvance:8, readValueFromPointer:function(e) {\n return this.fromWireType(J[e]);\n }, B:null,});\n}, _embind_register_class:(b, a, c, d, e, f, l, h, n, m, r, w, z) => {\n r = S(r);\n f = Y(e, f);\n h &&= Y(l, h);\n m &&= Y(n, m);\n z = Y(w, z);\n var g = Nb(r);\n Mb(g, function() {\n bc(`Cannot construct ${r} due to unbound types`, [d]);\n });\n X([b, a, c], d ? [d] : [], t => {\n t = t[0];\n if (d) {\n var q = t.h;\n var G = q.C;\n } else {\n G = Kb.prototype;\n }\n t = $a(r, function(...L) {\n if (Object.getPrototypeOf(this) !== F) {\n throw new O(\"Use 'new' to construct \" + r);\n }\n if (void 0 === v.I) {\n throw new O(r + \" has no accessible constructor\");\n }\n var Q = v.I[L.length];\n if (void 0 === Q) {\n throw new O(`Tried to invoke ctor of ${r} with invalid number of parameters (${L.length}) - expected (${Object.keys(v.I).toString()}) parameters instead!`);\n }\n return Q.apply(this, L);\n });\n var F = Object.create(G, {constructor:{value:t},});\n t.prototype = F;\n var v = new Ob(r, t, F, z, q, f, h, m);\n if (v.o) {\n var H;\n (H = v.o).T ?? (H.T = []);\n v.o.T.push(v);\n }\n q = new Ub(r, v, !0, !1, !1);\n H = new Ub(r + \"*\", v, !1, !1, !1);\n G = new Ub(r + \" const*\", v, !1, !0, !1);\n sb[b] = {pointerType:H, Ha:G};\n Vb(g, t);\n return [q, H, G];\n });\n}, _embind_register_class_class_function:(b, a, c, d, e, f, l) => {\n var h = ec(c, d);\n a = S(a);\n a = fc(a);\n f = Y(e, f);\n X([], [b], n => {\n function m() {\n bc(`Cannot call ${r} due to unbound types`, h);\n }\n n = n[0];\n var r = `${n.name}.${a}`;\n a.startsWith(\"@@\") && (a = Symbol[a.substring(2)]);\n var w = n.h.constructor;\n void 0 === w[a] ? (m.L = c - 1, w[a] = m) : (Lb(w, a, r), w[a].l[c - 1] = m);\n X([], h, z => {\n z = dc(r, [z[0], null].concat(z.slice(1)), null, f, l);\n void 0 === w[a].l ? (z.L = c - 1, w[a] = z) : w[a].l[c - 1] = z;\n if (n.h.T) {\n for (const g of n.h.T) {\n g.constructor.hasOwnProperty(a) || (g.constructor[a] = z);\n }\n }\n return [];\n });\n return [];\n });\n}, _embind_register_class_class_property:(b, a, c, d, e, f, l, h) => {\n a = S(a);\n f = Y(e, f);\n X([], [b], n => {\n n = n[0];\n var m = `${n.name}.${a}`, r = {get() {\n bc(`Cannot access ${m} due to unbound types`, [c]);\n }, enumerable:!0, configurable:!0};\n r.set = h ? () => {\n bc(`Cannot access ${m} due to unbound types`, [c]);\n } : () => {\n throw new O(`${m} is a read-only property`);\n };\n Object.defineProperty(n.h.constructor, a, r);\n X([], [c], w => {\n w = w[0];\n var z = {get() {\n return w.fromWireType(f(d));\n }, enumerable:!0};\n h && (h = Y(l, h), z.set = g => {\n var t = [];\n h(d, w.toWireType(t, g));\n Db(t);\n });\n Object.defineProperty(n.h.constructor, a, z);\n return [];\n });\n return [];\n });\n}, _embind_register_class_constructor:(b, a, c, d, e, f) => {\n var l = ec(a, c);\n e = Y(d, e);\n X([], [b], h => {\n h = h[0];\n var n = `constructor ${h.name}`;\n void 0 === h.h.I && (h.h.I = []);\n if (void 0 !== h.h.I[a - 1]) {\n throw new O(`Cannot register multiple constructors with identical number of parameters (${a - 1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);\n }\n h.h.I[a - 1] = () => {\n bc(`Cannot construct ${h.name} due to unbound types`, l);\n };\n X([], l, m => {\n m.splice(1, 0, null);\n h.h.I[a - 1] = dc(n, m, null, e, f);\n return [];\n });\n return [];\n });\n}, _embind_register_class_function:(b, a, c, d, e, f, l, h) => {\n var n = ec(c, d);\n a = S(a);\n a = fc(a);\n f = Y(e, f);\n X([], [b], m => {\n function r() {\n bc(`Cannot call ${w} due to unbound types`, n);\n }\n m = m[0];\n var w = `${m.name}.${a}`;\n a.startsWith(\"@@\") && (a = Symbol[a.substring(2)]);\n h && m.h.wa.push(a);\n var z = m.h.C, g = z[a];\n void 0 === g || void 0 === g.l && g.className !== m.name && g.L === c - 2 ? (r.L = c - 2, r.className = m.name, z[a] = r) : (Lb(z, a, w), z[a].l[c - 2] = r);\n X([], n, t => {\n t = dc(w, t, m, f, l);\n void 0 === z[a].l ? (t.L = c - 2, z[a] = t) : z[a].l[c - 2] = t;\n return [];\n });\n return [];\n });\n}, _embind_register_class_property:(b, a, c, d, e, f, l, h, n, m) => {\n a = S(a);\n e = Y(d, e);\n X([], [b], r => {\n r = r[0];\n var w = `${r.name}.${a}`, z = {get() {\n bc(`Cannot access ${w} due to unbound types`, [c, l]);\n }, enumerable:!0, configurable:!0};\n z.set = n ? () => bc(`Cannot access ${w} due to unbound types`, [c, l]) : () => {\n throw new O(w + \" is a read-only property\");\n };\n Object.defineProperty(r.h.C, a, z);\n X([], n ? [c, l] : [c], g => {\n var t = g[0], q = {get() {\n var F = gc(this, r, w + \" getter\");\n return t.fromWireType(e(f, F));\n }, enumerable:!0};\n if (n) {\n n = Y(h, n);\n var G = g[1];\n q.set = function(F) {\n var v = gc(this, r, w + \" setter\"), H = [];\n n(m, v, G.toWireType(H, F));\n Db(H);\n };\n }\n Object.defineProperty(r.h.C, a, q);\n return [];\n });\n return [];\n });\n}, _embind_register_emval:b => Hb(b, ic), _embind_register_enum:(b, a, c, d) => {\n function e() {\n }\n a = S(a);\n e.values = {};\n Hb(b, {name:a, constructor:e, fromWireType:function(f) {\n return this.constructor.values[f];\n }, toWireType:(f, l) => l.value, argPackAdvance:8, readValueFromPointer:jc(a, c, d), B:null,});\n Mb(a, e);\n}, _embind_register_enum_value:(b, a, c) => {\n var d = ob(b, \"enum\");\n a = S(a);\n b = d.constructor;\n d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:$a(`${d.name}_${a}`, function() {\n })},});\n b.values[c] = d;\n b[a] = d;\n}, _embind_register_float:(b, a, c) => {\n a = S(a);\n Hb(b, {name:a, fromWireType:d => d, toWireType:(d, e) => e, argPackAdvance:8, readValueFromPointer:kc(a, c), B:null,});\n}, _embind_register_function:(b, a, c, d, e, f) => {\n var l = ec(a, c);\n b = S(b);\n b = fc(b);\n e = Y(d, e);\n Mb(b, function() {\n bc(`Cannot call ${b} due to unbound types`, l);\n }, a - 1);\n X([], l, h => {\n Vb(b, dc(b, [h[0], null].concat(h.slice(1)), null, e, f), a - 1);\n return [];\n });\n}, _embind_register_integer:(b, a, c, d, e) => {\n a = S(a);\n -1 === e && (e = 4294967295);\n e = h => h;\n if (0 === d) {\n var f = 32 - 8 * c;\n e = h => h << f >>> f;\n }\n var l = a.includes(\"unsigned\") ? function(h, n) {\n return n >>> 0;\n } : function(h, n) {\n return n;\n };\n Hb(b, {name:a, fromWireType:e, toWireType:l, argPackAdvance:8, readValueFromPointer:lc(a, c, 0 !== d), B:null,});\n}, _embind_register_memory_view:(b, a, c) => {\n function d(f) {\n return new e(Ea.buffer, M[f + 4 >> 2], M[f >> 2]);\n }\n var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][a];\n c = S(c);\n Hb(b, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Va:!0,});\n}, _embind_register_std_string:(b, a) => {\n a = S(a);\n var c = \"std::string\" === a;\n Hb(b, {name:a, fromWireType:function(d) {\n var e = M[d >> 2], f = d + 4;\n if (c) {\n for (var l = f, h = 0; h <= e; ++h) {\n var n = f + h;\n if (h == e || 0 == J[n]) {\n l = l ? sc(J, l, n - l) : \"\";\n if (void 0 === m) {\n var m = l;\n } else {\n m += String.fromCharCode(0), m += l;\n }\n l = n + 1;\n }\n }\n } else {\n m = Array(e);\n for (h = 0; h < e; ++h) {\n m[h] = String.fromCharCode(J[f + h]);\n }\n m = m.join(\"\");\n }\n mb(d);\n return m;\n }, toWireType:function(d, e) {\n e instanceof ArrayBuffer && (e = new Uint8Array(e));\n var f = \"string\" == typeof e;\n if (!(f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array)) {\n throw new O(\"Cannot pass non-string to std::string\");\n }\n var l = c && f ? nc(e) : e.length;\n var h = Sc(4 + l + 1), n = h + 4;\n M[h >> 2] = l;\n if (c && f) {\n mc(e, J, n, l + 1);\n } else {\n if (f) {\n for (f = 0; f < l; ++f) {\n var m = e.charCodeAt(f);\n if (255 < m) {\n throw mb(n), new O(\"String has UTF-16 code units that do not fit in 8 bits\");\n }\n J[n + f] = m;\n }\n } else {\n for (f = 0; f < l; ++f) {\n J[n + f] = e[f];\n }\n }\n }\n null !== d && d.push(mb, h);\n return h;\n }, argPackAdvance:8, readValueFromPointer:Eb, B(d) {\n mb(d);\n },});\n}, _embind_register_std_wstring:(b, a, c) => {\n c = S(c);\n if (2 === a) {\n var d = uc;\n var e = vc;\n var f = wc;\n var l = h => Ga[h >> 1];\n } else {\n 4 === a && (d = xc, e = yc, f = zc, l = h => M[h >> 2]);\n }\n Hb(b, {name:c, fromWireType:h => {\n for (var n = M[h >> 2], m, r = h + 4, w = 0; w <= n; ++w) {\n var z = h + 4 + w * a;\n if (w == n || 0 == l(z)) {\n r = d(r, z - r), void 0 === m ? m = r : (m += String.fromCharCode(0), m += r), r = z + a;\n }\n }\n mb(h);\n return m;\n }, toWireType:(h, n) => {\n if (\"string\" != typeof n) {\n throw new O(`Cannot pass non-string to C++ string type ${c}`);\n }\n var m = f(n), r = Sc(4 + m + a);\n M[r >> 2] = m / a;\n e(n, r + 4, m + a);\n null !== h && h.push(mb, r);\n return r;\n }, argPackAdvance:8, readValueFromPointer:Eb, B(h) {\n mb(h);\n }});\n}, _embind_register_value_object:(b, a, c, d, e, f) => {\n Cb[b] = {name:S(a), fa:Y(c, d), D:Y(e, f), sa:[],};\n}, _embind_register_value_object_field:(b, a, c, d, e, f, l, h, n, m) => {\n Cb[b].sa.push({Oa:S(a), Ua:c, Sa:Y(d, e), Ta:f, eb:l, cb:Y(h, n), fb:m,});\n}, _embind_register_void:(b, a) => {\n a = S(a);\n Hb(b, {mb:!0, name:a, argPackAdvance:0, fromWireType:() => {\n }, toWireType:() => {\n },});\n}, _emscripten_get_now_is_monotonic:() => 1, _emscripten_memcpy_js:(b, a, c) => J.copyWithin(b, a, a + c), _emval_as:(b, a, c) => {\n b = R(b);\n a = ob(a, \"emval::as\");\n return Ac(a, c, b);\n}, _emval_call_method:(b, a, c, d, e) => {\n b = Dc[b];\n a = R(a);\n c = Cc(c);\n return b(a, a[c], d, e);\n}, _emval_decref:hc, _emval_get_method_caller:(b, a, c) => {\n var d = Fc(b, a), e = d.shift();\n b--;\n var f = Array(b);\n a = `methodCaller<(${d.map(l => l.name).join(\", \")}) => ${e.name}>`;\n return Ec($a(a, (l, h, n, m) => {\n for (var r = 0, w = 0; w < b; ++w) {\n f[w] = d[w].readValueFromPointer(m + r), r += d[w].argPackAdvance;\n }\n l = 1 === c ? Gc(h, f) : h.apply(l, f);\n return Ac(e, n, l);\n }));\n}, _emval_get_module_property:b => {\n b = Cc(b);\n return bb(k[b]);\n}, _emval_get_property:(b, a) => {\n b = R(b);\n a = R(a);\n return bb(b[a]);\n}, _emval_incref:b => {\n 9 < b && (N[b + 1] += 1);\n}, _emval_new_array:() => bb([]), _emval_new_cstring:b => bb(Cc(b)), _emval_new_object:() => bb({}), _emval_run_destructors:b => {\n var a = R(b);\n Db(a);\n hc(b);\n}, _emval_set_property:(b, a, c) => {\n b = R(b);\n a = R(a);\n c = R(c);\n b[a] = c;\n}, _emval_take_value:(b, a) => {\n b = ob(b, \"_emval_take_value\");\n b = b.readValueFromPointer(a);\n return bb(b);\n}, emscripten_date_now:() => Date.now(), emscripten_get_now:() => performance.now(), emscripten_resize_heap:b => {\n var a = J.length;\n b >>>= 0;\n if (2147483648 < b) {\n return !1;\n }\n for (var c = 1; 4 >= c; c *= 2) {\n var d = a * (1 + 0.2 / c);\n d = Math.min(d, b + 100663296);\n var e = Math;\n d = Math.max(b, d);\n a: {\n e = (e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) - Ca.buffer.byteLength + 65535) / 65536;\n try {\n Ca.grow(e);\n Ja();\n var f = 1;\n break a;\n } catch (l) {\n }\n f = void 0;\n }\n if (f) {\n return !0;\n }\n }\n return !1;\n}, environ_get:(b, a) => {\n var c = 0;\n Jc().forEach((d, e) => {\n var f = a + c;\n e = M[b + 4 * e >> 2] = f;\n for (f = 0; f < d.length; ++f) {\n Ea[e++] = d.charCodeAt(f);\n }\n Ea[e] = 0;\n c += d.length + 1;\n });\n return 0;\n}, environ_sizes_get:(b, a) => {\n var c = Jc();\n M[b >> 2] = c.length;\n var d = 0;\n c.forEach(e => d += e.length + 1);\n M[a >> 2] = d;\n return 0;\n}, fd_close:() => 52, fd_seek:function() {\n return 70;\n}, fd_write:(b, a, c, d) => {\n for (var e = 0, f = 0; f < c; f++) {\n var l = M[a >> 2], h = M[a + 4 >> 2];\n a += 8;\n for (var n = 0; n < h; n++) {\n var m = J[l + n], r = Kc[b];\n 0 === m || 10 === m ? ((1 === b ? za : Aa)(sc(r, 0)), r.length = 0) : r.push(m);\n }\n e += h;\n }\n M[d >> 2] = e;\n return 0;\n}, strftime_l:(b, a, c, d) => Pc(b, a, c, d)}, Z = function() {\n function b(c) {\n Z = c.exports;\n Ca = Z.memory;\n Ja();\n Xb = Z.__indirect_function_table;\n La.unshift(Z.__wasm_call_ctors);\n Oa--;\n k.monitorRunDependencies?.(Oa);\n 0 == Oa && (null !== Pa && (clearInterval(Pa), Pa = null), Qa && (c = Qa, Qa = null, c()));\n return Z;\n }\n var a = {env:Tc, wasi_snapshot_preview1:Tc,};\n Oa++;\n k.monitorRunDependencies?.(Oa);\n if (k.instantiateWasm) {\n try {\n return k.instantiateWasm(a, b);\n } catch (c) {\n Aa(`Module.instantiateWasm callback failed with error: ${c}`), ba(c);\n }\n }\n Ta ||= Sa(\"canvas_advanced.wasm\") ? \"canvas_advanced.wasm\" : k.locateFile ? k.locateFile(\"canvas_advanced.wasm\", y) : y + \"canvas_advanced.wasm\";\n Xa(a, function(c) {\n b(c.instance);\n }).catch(ba);\n return {};\n}(), mb = b => (mb = Z.free)(b), Sc = b => (Sc = Z.malloc)(b), lb = b => (lb = Z.__getTypeName)(b);\nk.dynCall_jiji = (b, a, c, d, e) => (k.dynCall_jiji = Z.dynCall_jiji)(b, a, c, d, e);\nk.dynCall_viijii = (b, a, c, d, e, f, l) => (k.dynCall_viijii = Z.dynCall_viijii)(b, a, c, d, e, f, l);\nk.dynCall_iiiiij = (b, a, c, d, e, f, l) => (k.dynCall_iiiiij = Z.dynCall_iiiiij)(b, a, c, d, e, f, l);\nk.dynCall_iiiiijj = (b, a, c, d, e, f, l, h, n) => (k.dynCall_iiiiijj = Z.dynCall_iiiiijj)(b, a, c, d, e, f, l, h, n);\nk.dynCall_iiiiiijj = (b, a, c, d, e, f, l, h, n, m) => (k.dynCall_iiiiiijj = Z.dynCall_iiiiiijj)(b, a, c, d, e, f, l, h, n, m);\nvar Uc;\nQa = function Vc() {\n Uc || Wc();\n Uc || (Qa = Vc);\n};\nfunction Wc() {\n function b() {\n if (!Uc && (Uc = !0, k.calledRun = !0, !Da)) {\n Za(La);\n aa(k);\n if (k.onRuntimeInitialized) {\n k.onRuntimeInitialized();\n }\n if (k.postRun) {\n for (\"function\" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length;) {\n var a = k.postRun.shift();\n Ma.unshift(a);\n }\n }\n Za(Ma);\n }\n }\n if (!(0 < Oa)) {\n if (k.preRun) {\n for (\"function\" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length;) {\n Na();\n }\n }\n Za(Ka);\n 0 < Oa || (k.setStatus ? (k.setStatus(\"Running...\"), setTimeout(function() {\n setTimeout(function() {\n k.setStatus(\"\");\n }, 1);\n b();\n }, 1)) : b());\n }\n}\nif (k.preInit) {\n for (\"function\" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length;) {\n k.preInit.pop()();\n }\n}\nWc();\nmoduleRtn = da;\n\n\n\n return moduleRtn;\n}\n);\n})();\nexport default Rive;\n","export { registerTouchInteractions } from \"./registerTouchInteractions\";\nexport { KeyboardInteractions, FocusSessionState } from \"./registerKeyboardInteractions\";\nexport type { KeyboardInteractionsParams } from \"./registerKeyboardInteractions\";\nexport { BLANK_URL, sanitizeUrl } from \"./sanitizeUrl\";\nexport {\n Finalizable,\n ImageWrapper,\n AudioWrapper,\n FontWrapper,\n FileAssetWrapper,\n ImageAssetWrapper,\n AudioAssetWrapper,\n FontAssetWrapper,\n finalizationRegistry,\n CustomFileAssetLoaderWrapper,\n AssetLoadCallbackWrapper,\n FileFinalizer,\n createFinalization,\n} from \"./finalizationRegistry\";\nexport { RiveFont } from \"./riveFont\";","import * as rc from \"../rive_advanced.mjs\";\n\nexport interface TouchInteractionsParams {\n canvas: HTMLCanvasElement | OffscreenCanvas;\n artboard: rc.Artboard;\n stateMachines: rc.StateMachineInstance[];\n renderer: rc.Renderer;\n rive: rc.RiveCanvas;\n fit: rc.Fit;\n alignment: rc.Alignment;\n isTouchScrollEnabled?: boolean;\n dispatchPointerExit?: boolean;\n enableMultiTouch?: boolean;\n layoutScaleFactor?: number;\n // Handles advancing the state machine and draining events/view model property callbacks, applicable to certain pointer interactions\n advanceAndDrain: (elapsedTime: number) => void;\n}\n\ninterface ClientCoordinates {\n clientX: number;\n clientY: number;\n identifier: number;\n transformedX?: number | undefined;\n transformedY?: number | undefined;\n}\n\n/**\n * Extracts ClientCoordinates from a TouchList, respecting multi-touch vs.\n * single-touch mode. In single-touch mode, only the touch matching\n * primaryTouchId is returned (or the first touch when primaryTouchId is null).\n */\nconst getTouchCoordinates = (\n changedTouches: TouchList,\n enableMultiTouch: boolean,\n primaryTouchId: number | null,\n): ClientCoordinates[] => {\n const coordinates: ClientCoordinates[] = [];\n if (enableMultiTouch) {\n for (let i = 0; i < changedTouches.length; i++) {\n const touch = changedTouches[i];\n coordinates.push({\n clientX: touch.clientX,\n clientY: touch.clientY,\n identifier: touch.identifier,\n });\n }\n } else {\n // In \"single-touch mode\", only track the primary finger identified at touchstart.\n // Search changedTouches for the touch matching the recorded primary touch identifier, or (on initial touchstart)\n // take the first available touch identifier.\n let primaryTouch: Touch | null =\n primaryTouchId !== null\n ? Array.from(changedTouches).find(\n (t) => t.identifier === primaryTouchId,\n ) ?? null\n : changedTouches[0];\n if (primaryTouch) {\n coordinates.push({\n clientX: primaryTouch.clientX,\n clientY: primaryTouch.clientY,\n identifier: primaryTouch.identifier,\n });\n }\n }\n return coordinates;\n};\n\n/**\n * Returns the clientX and clientY properties from touch or mouse events. Also\n * calls preventDefault() on the event if it is a touchstart or touchmove to prevent\n * scrolling the page on mobile devices\n * @param event - Either a TouchEvent or a MouseEvent\n * @param isTouchScrollEnabled - Whether touch scrolling is enabled\n * @param enableMultiTouch - Whether to process multiple simultaneous touches\n * @param primaryTouchId - When working with single touches, only process the touch\n * with this identifier. Pass null to accept any touch (used during touchstart to\n * capture the first finger down).\n * @returns - Coordinates of the clientX and clientY properties from the touch/mouse event\n */\nconst getClientCoordinates = (\n event: MouseEvent | TouchEvent,\n isTouchScrollEnabled: boolean,\n enableMultiTouch: boolean,\n primaryTouchId: number | null,\n): ClientCoordinates[] => {\n const touchEvent = event as TouchEvent;\n if (touchEvent.changedTouches?.length) {\n // This flag, if false, prevents touch events on the canvas default behavior\n // which may prevent scrolling if a drag motion on the canvas is performed\n if (!isTouchScrollEnabled && [\"touchstart\", \"touchmove\"].includes(event.type)) {\n event.preventDefault();\n }\n return getTouchCoordinates(touchEvent.changedTouches, enableMultiTouch, primaryTouchId);\n }\n return [\n {\n clientX: (event as MouseEvent).clientX,\n clientY: (event as MouseEvent).clientY,\n identifier: 0,\n },\n ];\n};\n\n/**\n * Registers mouse move/up/down callback handlers on the canvas to send meaningful coordinates to\n * the state machine pointer move/up/down functions based on cursor interaction\n */\nexport const registerTouchInteractions = ({\n canvas,\n artboard,\n stateMachines = [],\n renderer,\n rive,\n fit,\n alignment,\n isTouchScrollEnabled = false,\n dispatchPointerExit = true,\n enableMultiTouch = false,\n layoutScaleFactor = 1.0,\n advanceAndDrain,\n}: TouchInteractionsParams) => {\n if (\n !canvas ||\n !stateMachines.length ||\n !renderer ||\n !rive ||\n !artboard ||\n typeof window === \"undefined\"\n ) {\n return null;\n }\n /**\n * After a touchend event, some browsers may fire synthetic mouse events\n * (mouseover, mousedown, mousemove, mouseup) if the touch interaction did not cause\n * any default action (such as scrolling).\n *\n * This is done to simulate the behavior of a mouse for applications that do not support\n * touch events.\n *\n * We're keeping track of the previous event to not send the synthetic mouse events if the\n * touch event was a click (touchstart -> touchend).\n *\n * This is only needed when `isTouchScrollEnabled` is false\n * When true, `preventDefault()` is called which prevents this behaviour.\n **/\n let _prevEventType: string | null = null;\n let _syntheticEventsActive = false;\n\n /**\n * When enableMultiTouch is false (\"single-touch mode\"), we track the identifier of the first finger that touched down.\n * All subsequent touch events are filtered to this identifier so that a second finger\n * moving cannot displace the tracked pointer position.\n * Reset to null when the primary finger lifts (or touchcancel is called)\n */\n let _primaryTouchId: number | null = null;\n\n const processEventCallback = (event: MouseEvent | TouchEvent) => {\n // Exit early out of all synthetic mouse events\n // https://stackoverflow.com/questions/9656990/how-to-prevent-simulated-mouse-events-in-mobile-browsers\n // https://stackoverflow.com/questions/25572070/javascript-touchend-versus-click-dilemma\n if (_syntheticEventsActive && event instanceof MouseEvent) {\n // Synthetic event finished\n if (event.type == \"mouseup\") {\n _syntheticEventsActive = false;\n }\n\n return;\n }\n\n // Test if it's a \"touch click\". This could cause the browser to send\n // synthetic mouse events.\n _syntheticEventsActive =\n isTouchScrollEnabled &&\n event.type === \"touchend\" &&\n _prevEventType === \"touchstart\";\n\n _prevEventType = event.type;\n\n const boundingRect = (\n event.currentTarget as HTMLCanvasElement\n ).getBoundingClientRect();\n\n // On touchstart in single-touch mode, record the first new finger as the primary\n // touch if we aren't already tracking one.\n if (!enableMultiTouch && event.type === \"touchstart\" && _primaryTouchId === null) {\n const firstTouch = (event as TouchEvent).changedTouches?.[0];\n if (firstTouch) {\n _primaryTouchId = firstTouch.identifier;\n }\n }\n\n const coordinateSets = getClientCoordinates(\n event,\n isTouchScrollEnabled,\n enableMultiTouch,\n enableMultiTouch ? null : _primaryTouchId,\n );\n const forwardMatrix = rive.computeAlignment(\n fit,\n alignment,\n {\n minX: 0,\n minY: 0,\n maxX: boundingRect.width,\n maxY: boundingRect.height,\n },\n artboard.bounds,\n layoutScaleFactor,\n );\n const invertedMatrix = new rive.Mat2D();\n forwardMatrix.invert(invertedMatrix);\n\n coordinateSets.forEach((coordinateSet) => {\n const clientX = coordinateSet.clientX;\n const clientY = coordinateSet.clientY;\n if (!clientX && !clientY) {\n return;\n }\n const canvasX = clientX - boundingRect.left;\n const canvasY = clientY - boundingRect.top;\n const canvasCoordinatesVector = new rive.Vec2D(canvasX, canvasY);\n const transformedVector = rive.mapXY(\n invertedMatrix,\n canvasCoordinatesVector,\n );\n const transformedX = transformedVector.x();\n const transformedY = transformedVector.y();\n coordinateSet.transformedX = transformedX;\n coordinateSet.transformedY = transformedY;\n transformedVector.delete();\n canvasCoordinatesVector.delete();\n });\n\n invertedMatrix.delete();\n forwardMatrix.delete();\n\n switch (event.type) {\n /**\n * There's a 2px buffer for a hitRadius when translating the pointer coordinates\n * down to the state machine. In cases where the hitbox is about that much away\n * from the Artboard border, we don't have exact precision on determining pointer\n * exit. We're therefore adding to the translated coordinates on mouseout of a canvas\n * to ensure that we report the mouse has truly exited the hitarea.\n * https://github.com/rive-app/rive-cpp/blob/master/src/animation/state_machine_instance.cpp#L336\n *\n */\n case \"mouseout\":\n for (const stateMachine of stateMachines) {\n if (dispatchPointerExit) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerExit(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n } else {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerMove(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n }\n break;\n\n // Pointer moving/hovering on the canvas\n case \"touchmove\":\n case \"mouseover\":\n case \"mousemove\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerMove(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n break;\n }\n // Pointer click initiated but not released yet on the canvas\n case \"touchstart\":\n case \"mousedown\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerDown(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n // Advance the state machine immediately so pointer down(s) takes effect synchronously\n advanceAndDrain(0);\n break;\n }\n // Pointer click released on the canvas\n case \"touchend\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerUp(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n stateMachine.pointerExit(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n // Advance the state machine immediately so pointer up(s) takes effect synchronously\n advanceAndDrain(0);\n // Release the primary touch lock once that finger lifts so the next\n // touchstart can claim a new primary finger.\n if (\n !enableMultiTouch &&\n coordinateSets.some((c) => c.identifier === _primaryTouchId)\n ) {\n _primaryTouchId = null;\n }\n break;\n }\n case \"mouseup\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerUp(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n // Advance the state machine immediately so pointer up(s) takes effect synchronously\n advanceAndDrain(0);\n break;\n }\n default:\n }\n };\n\n const touchCancelCallback = () => {\n _primaryTouchId = null;\n };\n\n const callback = processEventCallback.bind(this);\n canvas.addEventListener(\"mouseover\", callback);\n canvas.addEventListener(\"mouseout\", callback);\n canvas.addEventListener(\"mousemove\", callback);\n canvas.addEventListener(\"mousedown\", callback);\n canvas.addEventListener(\"mouseup\", callback);\n canvas.addEventListener(\"touchmove\", callback, {\n passive: isTouchScrollEnabled,\n });\n canvas.addEventListener(\"touchstart\", callback, {\n passive: isTouchScrollEnabled,\n });\n canvas.addEventListener(\"touchend\", callback);\n canvas.addEventListener(\"touchcancel\", touchCancelCallback);\n return () => {\n canvas.removeEventListener(\"mouseover\", callback);\n canvas.removeEventListener(\"mouseout\", callback);\n canvas.removeEventListener(\"mousemove\", callback);\n canvas.removeEventListener(\"mousedown\", callback);\n canvas.removeEventListener(\"mouseup\", callback);\n canvas.removeEventListener(\"touchmove\", callback);\n canvas.removeEventListener(\"touchstart\", callback);\n canvas.removeEventListener(\"touchend\", callback);\n canvas.removeEventListener(\"touchcancel\", touchCancelCallback);\n };\n};\n","import * as rc from \"../rive_advanced.mjs\";\n\nexport interface KeyboardInteractionsParams {\n canvas: HTMLCanvasElement;\n stateMachine: rc.StateMachineInstance;\n /**\n * Whether this canvas has focus nodes that should participate in tab traversal.\n * When true, Tab/Shift+Tab will be intercepted and routed to the Rive focus manager.\n * focusNext() returning false means no more traversable nodes — tab is released to the page.\n */\n hasFocusNodes: boolean;\n}\n\n/**\n * Tracks the relationship between the canvas's DOM focus and Rive's internal focus for the\n * current focus session.\n *\n * NotFocused — the canvas is not the active DOM element, or Rive entered and then released focus\n * internally this session. Either way the next Tab should move on to the next page\n * element, so Tab events are ignored.\n * EntryPending — the canvas has DOM focus but Rive holds no active focus node yet, and the next Tab should enter\n * the focus tree. This is the resting state for pointer-driven focus (a click on the\n * canvas), or an edge case for keyboard focus where initial focus action did not land on a focus node. \n * RiveFocused — a Rive node currently holds focus. Tab/Shift+Tab are routed to the Rive focus\n * manager and trapped inside the canvas until Rive notifies focus has ended.\n *\n * When keyboard focus lands on the canvas, onCanvasFocus reads the direction focus came from and \n * moves into the focus tree immediately, going straight to RiveFocused. EntryPending is only set via pointer focus (or keyboard focus\n * where focusNext()/focusPrevious() return false but respects tabindex).\n */\nexport enum FocusSessionState {\n NotFocused = \"notFocused\",\n EntryPending = \"entryPending\",\n RiveFocused = \"riveFocused\",\n}\n\n/**\n * Manages keyboard and DOM focus interactions for a Rive canvas.\n *\n * Tracks the canvas focus session state (focusSessionState) and routes\n * Tab/Shift+Tab to the Rive state machine's focus manager. Exposes shared\n * state as properties so the Rive render loop can read them directly.\n */\nexport class KeyboardInteractions {\n public focusSessionState: FocusSessionState = FocusSessionState.NotFocused;\n\n private canvas: HTMLCanvasElement;\n private mainSm: rc.StateMachineInstance;\n private hasFocusNodes: boolean;\n\n constructor({ canvas, stateMachine, hasFocusNodes }: KeyboardInteractionsParams) {\n this.canvas = canvas;\n this.mainSm = stateMachine;\n this.hasFocusNodes = hasFocusNodes;\n\n canvas.addEventListener(\"focus\", this.onCanvasFocus);\n canvas.addEventListener(\"blur\", this.onCanvasBlur);\n canvas.addEventListener(\"keydown\", this.onKeyDown);\n }\n\n /**\n * Set the FocusSessionState. Useful for invoking a Rive \"blur\" without actually blurring from the <canvas>. This\n * helps put the DOM focus state on the canvas rather than the <body>, so the user doesn't lose the spot in page navigation\n *\n * @param state FocusSessionState enum\n */\n public setFocusSessionState(state: FocusSessionState): void {\n this.focusSessionState = state;\n }\n\n /**\n * Called by pollFocusState on the Rive instance when it observes hasFocus=true. Rive acquired\n * focus internally (e.g. via a listener action or state transition) without a DOM focus event,\n * so mark the session RiveFocused.\n */\n public notifyRiveFocused(): void {\n this.focusSessionState = FocusSessionState.RiveFocused;\n }\n\n /**\n * Handles the canvas gaining browser focus. The behavior differs based on how focus was gained -\n *\n * Pointer-driven focus: the canvas now has focus but Rive holds nothing yet, so we move to EntryPending — this lets the\n * next Tab enter the focus tree even when the focus is pointer-driven\n *\n * Keyboard-driven focus: we enter the Rive focus tree immediately once canvas gains focus.\n * The direction is inferred from where focus came from: an element before the canvas in DOM order\n * means a forward Tab (focusNext), one after means a Shift+Tab (focusPrevious). :focus-visible\n * gates this so a click doesn't yank Rive focus to the first node on the focus event itself.\n */\n public onCanvasFocus = (event: FocusEvent) => {\n if (!this.hasFocusNodes) return;\n if (this.mainSm.focusState().hasFocus) return;\n\n this.focusSessionState = FocusSessionState.EntryPending;\n\n // Pointer focus waits for the user's next Tab (handled in onKeyDown). Keyboard focus enters now.\n if (!this.isKeyboardDrivenFocus()) return;\n const forward = this.cameFromBeforeCanvas(event.relatedTarget as Node | null);\n if (forward ? this.mainSm.focusNext() : this.mainSm.focusPrevious()) {\n this.focusSessionState = FocusSessionState.RiveFocused;\n }\n };\n\n public onCanvasBlur = (_event: FocusEvent) => {\n this.focusSessionState = FocusSessionState.NotFocused;\n };\n\n public onKeyDown = (event: KeyboardEvent) => {\n if (this.focusSessionState === FocusSessionState.NotFocused) return;\n\n if (event.code === \"Tab\" && this.hasFocusNodes) {\n const forward = !event.shiftKey;\n const focusMoved = forward ? this.mainSm.focusNext() : this.mainSm.focusPrevious();\n if (focusMoved) {\n // A Rive node accepted focus — keep trapping Tab inside the canvas.\n this.focusSessionState = FocusSessionState.RiveFocused;\n event.preventDefault();\n } else {\n // No more traversable nodes — release Tab to the page.\n // Set state immediately; onCanvasBlur will also fire naturally.\n this.focusSessionState = FocusSessionState.NotFocused;\n }\n }\n };\n\n /**\n * Whether the canvas currently matches :focus-visible — the browser's heuristic for keyboard-\n * (vs pointer-) driven focus. For older browser versions that don't support this selector, return false\n * so that we don't incorrectly assume pointer vs keyboard focus. Next tab would enter the focus tree in those edge cases.\n */\n private isKeyboardDrivenFocus(): boolean {\n try {\n return this.canvas.matches(\":focus-visible\");\n } catch {\n return false;\n }\n }\n\n private cameFromBeforeCanvas(from: Node | null): boolean {\n if (!from) return true;\n const position = this.canvas.compareDocumentPosition(from);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return true;\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return false;\n return true;\n }\n\n public cleanup(): void {\n this.canvas.removeEventListener(\"focus\", this.onCanvasFocus);\n this.canvas.removeEventListener(\"blur\", this.onCanvasBlur);\n this.canvas.removeEventListener(\"keydown\", this.onKeyDown);\n }\n}\n","// Reference: https://github.com/braintree/sanitize-url/tree/main\nconst invalidProtocolRegex = /^([^\\w]*)(javascript|data|vbscript)/im;\nconst htmlEntitiesRegex = /&#(\\w+)(^\\w|;)?/g;\nconst htmlCtrlEntityRegex = /&(newline|tab);/gi;\nconst ctrlCharactersRegex =\n /[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim;\nconst urlSchemeRegex = /^.+(:|:)/gim;\nconst relativeFirstCharacters = [\".\", \"/\"];\nexport const BLANK_URL = \"about:blank\";\n\nfunction isRelativeUrlWithoutProtocol(url: string): boolean {\n return relativeFirstCharacters.indexOf(url[0]) > -1;\n}\n\n// adapted from https://stackoverflow.com/a/29824550/2601552\nfunction decodeHtmlCharacters(str: string) {\n const removedNullByte = str.replace(ctrlCharactersRegex, \"\");\n return removedNullByte.replace(htmlEntitiesRegex, (match, dec) => {\n return String.fromCharCode(dec);\n });\n}\n\nexport function sanitizeUrl(url?: string): string {\n if (!url) {\n return BLANK_URL;\n }\n\n const sanitizedUrl = decodeHtmlCharacters(url)\n .replace(htmlCtrlEntityRegex, \"\")\n .replace(ctrlCharactersRegex, \"\")\n .trim();\n\n if (!sanitizedUrl) {\n return BLANK_URL;\n }\n\n if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {\n return sanitizedUrl;\n }\n\n const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);\n\n if (!urlSchemeParseResults) {\n return sanitizedUrl;\n }\n\n const urlScheme = urlSchemeParseResults[0];\n\n if (invalidProtocolRegex.test(urlScheme)) {\n return BLANK_URL;\n }\n\n return sanitizedUrl;\n}\n","import * as rc from \"../rive_advanced.mjs\";\n\ninterface Finalizable {\n unref: () => void;\n}\n\nclass FileFinalizer implements Finalizable {\n private _file: rc.File;\n public selfUnref: boolean = false;\n constructor(file: rc.File) {\n this._file = file;\n }\n\n public unref() {\n if (this._file) {\n this._file.unref();\n }\n }\n}\n\nclass ObjectFinalizer<T extends Finalizable> {\n private _finalizableObject: T;\n constructor(finalizableObject: T) {\n this._finalizableObject = finalizableObject;\n }\n\n public unref() {\n this._finalizableObject.unref();\n }\n}\n\n\nclass AssetWrapper implements rc.FinalizableTarget {\n public selfUnref: boolean = false;\n public unref() {}\n}\n\nclass ImageWrapper extends AssetWrapper {\n private _nativeImage: rc.Image;\n\n constructor(image: rc.Image) {\n super();\n this._nativeImage = image;\n }\n\n public get nativeImage(): rc.ImageInternal {\n return this._nativeImage;\n }\n\n public unref() {\n if (this.selfUnref) {\n this._nativeImage.unref();\n }\n }\n}\n\nclass AudioWrapper extends AssetWrapper {\n private _nativeAudio: rc.Audio;\n\n constructor(audio: rc.Audio) {\n super();\n this._nativeAudio = audio;\n }\n\n public get nativeAudio(): rc.AudioInternal {\n return this._nativeAudio;\n }\n\n public unref() {\n if (this.selfUnref) {\n this._nativeAudio.unref();\n }\n }\n}\n\nclass FontWrapper extends AssetWrapper {\n private _nativeFont: rc.Font;\n\n constructor(font: rc.Font) {\n super();\n this._nativeFont = font;\n }\n\n public get nativeFont(): rc.FontInternal {\n return this._nativeFont;\n }\n\n public unref() {\n if (this.selfUnref) {\n this._nativeFont.unref();\n }\n }\n}\n\nexport type AssetLoadCallbackWrapper = (\n asset: rc.FileAssetInternal,\n bytes: Uint8Array,\n) => Boolean;\n\nclass CustomFileAssetLoaderWrapper {\n assetLoader: rc.CustomFileAssetLoader;\n _assetLoaderCallback: AssetLoadCallbackWrapper;\n\n constructor(\n runtime: rc.RiveCanvas,\n loaderCallback: AssetLoadCallbackWrapper,\n ) {\n this._assetLoaderCallback = loaderCallback;\n this.assetLoader = new runtime.CustomFileAssetLoader({\n loadContents: this.loadContents.bind(this),\n });\n }\n\n loadContents(asset: rc.FileAsset, bytes: any) {\n let assetWrapper: FileAssetWrapper;\n if (asset.isImage) {\n assetWrapper = new ImageAssetWrapper(asset);\n } else if (asset.isAudio) {\n assetWrapper = new AudioAssetWrapper(asset);\n } else if (asset.isFont) {\n assetWrapper = new FontAssetWrapper(asset);\n } else {\n return false;\n }\n return this._assetLoaderCallback(assetWrapper, bytes);\n }\n}\n\n/**\n * Rive class representing a FileAsset with relevant metadata fields to describe\n * an asset associated wtih the Rive File\n */\nclass FileAssetWrapper {\n _nativeFileAsset: rc.FileAssetInternal;\n\n constructor(nativeAsset: rc.FileAssetInternal) {\n this._nativeFileAsset = nativeAsset;\n }\n\n decode(bytes: Uint8Array): void {\n this._nativeFileAsset.decode(bytes);\n }\n\n get name(): string {\n return this._nativeFileAsset.name;\n }\n\n get fileExtension(): string {\n return this._nativeFileAsset.fileExtension;\n }\n\n get uniqueFilename(): string {\n return this._nativeFileAsset.uniqueFilename;\n }\n\n get isAudio(): boolean {\n return this._nativeFileAsset.isAudio;\n }\n\n get isImage(): boolean {\n return this._nativeFileAsset.isImage;\n }\n\n get isFont(): boolean {\n return this._nativeFileAsset.isFont;\n }\n\n get cdnUuid(): string {\n return this._nativeFileAsset.cdnUuid;\n }\n\n get nativeFileAsset() {\n return this._nativeFileAsset;\n }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setRenderImage()` API with a\n * decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset\n */\nclass ImageAssetWrapper extends FileAssetWrapper {\n setRenderImage(image: ImageWrapper): void {\n (this._nativeFileAsset as rc.ImageAssetInternal).setRenderImage(\n image.nativeImage,\n );\n }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setAudioSource()` API with a\n * decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset\n */\nclass AudioAssetWrapper extends FileAssetWrapper {\n setAudioSource(audio: AudioWrapper): void {\n (this._nativeFileAsset as rc.AudioAssetInternal).setAudioSource(\n audio.nativeAudio,\n );\n }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setFont()` API with a\n * decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset\n */\nclass FontAssetWrapper extends FileAssetWrapper {\n setFont(font: FontWrapper): void {\n (this._nativeFileAsset as rc.FontAssetInternal).setFont(font.nativeFont);\n }\n}\n\ndeclare const FinalizationRegistry: {\n new (fn: Function): typeof FinalizationRegistry;\n\n register<T extends rc.FinalizableTarget>(\n object: T,\n description: Finalizable,\n ): void;\n\n unregister<T>(object: T): void;\n};\n\nclass FakeFinalizationRegistry {\n constructor(_: Function) {}\n register(object: rc.FinalizableTarget) {\n object.selfUnref = true;\n }\n\n unregister<T>(_: T) {}\n}\nconst MyFinalizationRegistry =\n typeof FinalizationRegistry !== \"undefined\"\n ? FinalizationRegistry\n : FakeFinalizationRegistry;\n\nconst finalizationRegistry = new MyFinalizationRegistry((ob: Finalizable) => {\n ob?.unref();\n});\n\nconst createFinalization = <T extends Finalizable>(\n target: rc.FinalizableTarget,\n finalizable: T,\n) => {\n const finalizer = new ObjectFinalizer<T>(finalizable);\n finalizationRegistry.register(target, finalizer);\n};\n\nexport {\n finalizationRegistry,\n createFinalization,\n Finalizable,\n ImageWrapper,\n AudioWrapper,\n FontWrapper,\n ImageAssetWrapper,\n AudioAssetWrapper,\n FontAssetWrapper,\n CustomFileAssetLoaderWrapper,\n FileAssetWrapper,\n FileFinalizer,\n};\n","import * as rc from \"../rive_advanced.mjs\";\nimport { RuntimeLoader } from \"../runtimeLoader\";\nimport type { FontWrapper } from \"./finalizationRegistry\";\n\n// Callback type for the fallback fonts callback\nexport type FallbackFontsCallback = (missingGlyph: number, weight: number) => FontWrapper | FontWrapper[] | null | undefined;\n\ntype CallbackToPointerValue = (missingGlyph: number, fallbackFontIndex: number, weight: number) => number | null;\n\n// Class to manage fallback fonts for Rive.\nexport class RiveFont {\n private static _fallbackFontCallback: FallbackFontsCallback | null = null;\n\n // Class is never instantiated\n private constructor() {}\n\n\n /**\n * Set a callback to dynamically set a list of fallback fonts based on the missing glyph and/or style of the default font.\n * Set null to clear the callback.\n * @param fontCallback Callback to set a list of fallback fonts.\n */\n public static setFallbackFontCallback(fontCallback: FallbackFontsCallback | null): void {\n RiveFont._fallbackFontCallback = fontCallback ?? null;\n RiveFont._wireFallbackProc();\n }\n\n // Get the pointer value to the Embind Font object from FontWrapper\n private static _fontToPtr(\n fontWrapper: FontWrapper | null | undefined\n ): number | null {\n if (fontWrapper == null) return null;\n const embindFont = fontWrapper.nativeFont as rc.Font;\n const ptr = embindFont?.ptr?.();\n return ptr ?? null;\n }\n\n private static _getFallbackPtr(\n fonts: FontWrapper[] | null | undefined,\n index: number\n ): number | null {\n if (index < 0 || index >= fonts.length) return null;\n return RiveFont._fontToPtr(fonts![index]);\n }\n\n // Create the callback Rive expects to use for fallback fonts (regardless if set via a user-supplied static list, or callback)\n // 1. Ensure WASM is ready\n // 2. Bias for checking user callback over static list of fonts and pass it down to Rive to store as reference\n // - When calling the user callback, check if we have any fonts left to check, and if not, return null to indicate there are no more fallbacks to try.\n // - If the user callback returns an array of fonts, pass the pointer value to Rive of the font to try\n // 3. If no callback is provided, or the callback returns null, try the static list of fonts if they set any\n // 4. If no fallback method is set, return null.\n private static _wireFallbackProc(): void {\n RuntimeLoader.getInstance((rive: rc.RiveCanvas) => {\n const { _fallbackFontCallback: cb } = RiveFont;\n if (cb) {\n rive.setFallbackFontCallback(\n ((missingGlyph: number, fallbackFontIndex: number, weight: number) => {\n const fontsReturned = cb(missingGlyph, weight);\n if (fontsReturned) {\n if (Array.isArray(fontsReturned)) {\n return RiveFont._getFallbackPtr(\n fontsReturned,\n fallbackFontIndex\n );\n }\n // If the user callback only returns a single font, provide it to Rive the first time, otherwise if Rive\n // calls back a second time, return null to indicate there are no more fallbacks to try.\n return fallbackFontIndex === 0 ? RiveFont._fontToPtr(fontsReturned) : null;\n }\n return null;\n }) as CallbackToPointerValue\n );\n } else {\n rive.setFallbackFontCallback(null);\n }\n });\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import * as rc from \"./rive_advanced.mjs\";\nimport { Animation } from \"./animation\";\nimport { RuntimeLoader, type RuntimeCallback } from \"./runtimeLoader\";\nimport {\n registerTouchInteractions,\n KeyboardInteractions,\n FocusSessionState,\n sanitizeUrl,\n BLANK_URL,\n ImageWrapper,\n AudioWrapper,\n FontWrapper,\n finalizationRegistry,\n CustomFileAssetLoaderWrapper,\n FileFinalizer,\n createFinalization,\n RiveFont as RiveFontClassUtil,\n} from \"./utils\";\nexport type AssetLoadCallback = (\n asset: rc.FileAsset,\n bytes: Uint8Array,\n) => boolean;\n\nclass RiveError extends Error {\n public isHandledError = true;\n}\n\nexport { RiveFontClassUtil as RiveFont };\n\n// Note: Re-exporting a few types from rive_advanced.mjs to expose for high-level\n// API usage without re-defining their type definition here. May want to revisit\n// and see if we want to expose both types from rive.ts and rive_advanced.mjs in\n// the future\nexport type {\n FileAsset,\n AudioAsset,\n FontAsset,\n ImageAsset,\n} from \"./rive_advanced.mjs\";\n\n/**\n * Generic type for a parameterless void callback\n */\nexport type VoidCallback = () => void;\n\ninterface SetupRiveListenersOptions {\n isTouchScrollEnabled?: boolean;\n}\n\n/**\n * Type for artboard bounds\n */\nexport type Bounds = rc.AABB;\n\n// #regions helpers\nconst resolveErrorMessage = (error: any): string =>\n error && error.isHandledError\n ? error.message\n : \"Problem loading file; may be corrupt!\";\n\n// #region layout\n\n// Fit options for the canvas\nexport enum Fit {\n Cover = \"cover\",\n Contain = \"contain\",\n Fill = \"fill\",\n FitWidth = \"fitWidth\",\n FitHeight = \"fitHeight\",\n None = \"none\",\n ScaleDown = \"scaleDown\",\n Layout = \"layout\",\n}\n\n// Alignment options for the canvas\nexport enum Alignment {\n Center = \"center\",\n TopLeft = \"topLeft\",\n TopCenter = \"topCenter\",\n TopRight = \"topRight\",\n CenterLeft = \"centerLeft\",\n CenterRight = \"centerRight\",\n BottomLeft = \"bottomLeft\",\n BottomCenter = \"bottomCenter\",\n BottomRight = \"bottomRight\",\n}\n\n// Drawing optimization options\nexport enum DrawOptimizationOptions {\n AlwaysDraw = \"alwaysDraw\",\n DrawOnChanged = \"drawOnChanged\",\n}\n\n// Options for Rive focus management\nexport interface RiveFocusOptions {\n /**\n * When true, allows Rive to interrupt browser focus and programmatically\n * set/release focus on the canvas when the state machine reports focus\n * changes in Rive. This allows apps to direct focus to/from the canvas or\n * related elements as needed if not currently focused, which can happen at\n * any point in the Rive render loop.\n *\n * Note: Nodes in the Rive graphic may still receive/release focus respecting\n * any focus rules defined in the state machine.\n *\n * @default false to prevent unwanted focus interruptions\n */\n allowFocusInterrupt: boolean;\n}\n\n// Interface for the Layout static method constructor\nexport interface LayoutParameters {\n fit?: Fit;\n alignment?: Alignment;\n layoutScaleFactor?: number;\n minX?: number;\n minY?: number;\n maxX?: number;\n maxY?: number;\n}\n\n// Alignment options for Rive animations in a HTML canvas\nexport class Layout {\n // Runtime fit and alignment are accessed every frame, so we cache their\n // values to save cycles\n private cachedRuntimeFit: rc.Fit;\n private cachedRuntimeAlignment: rc.Alignment;\n\n public readonly fit: Fit;\n public readonly alignment: Alignment;\n public readonly layoutScaleFactor: number;\n public readonly minX: number;\n public readonly minY: number;\n public readonly maxX: number;\n public readonly maxY: number;\n\n constructor(params?: LayoutParameters) {\n this.fit = params?.fit ?? Fit.Contain;\n this.alignment = params?.alignment ?? Alignment.Center;\n this.layoutScaleFactor = params?.layoutScaleFactor ?? 1;\n this.minX = params?.minX ?? 0;\n this.minY = params?.minY ?? 0;\n this.maxX = params?.maxX ?? 0;\n this.maxY = params?.maxY ?? 0;\n }\n\n // Alternative constructor to build a Layout from an interface/object\n static new({\n fit,\n alignment,\n minX,\n minY,\n maxX,\n maxY,\n }: LayoutParameters): Layout {\n console.warn(\n \"This function is deprecated: please use `new Layout({})` instead\",\n );\n return new Layout({ fit, alignment, minX, minY, maxX, maxY });\n }\n\n /**\n * Makes a copy of the layout, replacing any specified parameters\n */\n public copyWith({\n fit,\n alignment,\n layoutScaleFactor,\n minX,\n minY,\n maxX,\n maxY,\n }: LayoutParameters): Layout {\n return new Layout({\n fit: fit ?? this.fit,\n alignment: alignment ?? this.alignment,\n layoutScaleFactor: layoutScaleFactor ?? this.layoutScaleFactor,\n minX: minX ?? this.minX,\n minY: minY ?? this.minY,\n maxX: maxX ?? this.maxX,\n maxY: maxY ?? this.maxY,\n });\n }\n\n // Returns fit for the Wasm runtime format\n public runtimeFit(rive: rc.RiveCanvas): rc.Fit {\n if (this.cachedRuntimeFit) return this.cachedRuntimeFit;\n\n let fit;\n if (this.fit === Fit.Cover) fit = rive.Fit.cover;\n else if (this.fit === Fit.Contain) fit = rive.Fit.contain;\n else if (this.fit === Fit.Fill) fit = rive.Fit.fill;\n else if (this.fit === Fit.FitWidth) fit = rive.Fit.fitWidth;\n else if (this.fit === Fit.FitHeight) fit = rive.Fit.fitHeight;\n else if (this.fit === Fit.ScaleDown) fit = rive.Fit.scaleDown;\n else if (this.fit === Fit.Layout) fit = rive.Fit.layout;\n else fit = rive.Fit.none;\n\n this.cachedRuntimeFit = fit;\n return fit;\n }\n\n // Returns alignment for the Wasm runtime format\n public runtimeAlignment(rive: rc.RiveCanvas): rc.Alignment {\n if (this.cachedRuntimeAlignment) return this.cachedRuntimeAlignment;\n\n let alignment;\n if (this.alignment === Alignment.TopLeft)\n alignment = rive.Alignment.topLeft;\n else if (this.alignment === Alignment.TopCenter)\n alignment = rive.Alignment.topCenter;\n else if (this.alignment === Alignment.TopRight)\n alignment = rive.Alignment.topRight;\n else if (this.alignment === Alignment.CenterLeft)\n alignment = rive.Alignment.centerLeft;\n else if (this.alignment === Alignment.CenterRight)\n alignment = rive.Alignment.centerRight;\n else if (this.alignment === Alignment.BottomLeft)\n alignment = rive.Alignment.bottomLeft;\n else if (this.alignment === Alignment.BottomCenter)\n alignment = rive.Alignment.bottomCenter;\n else if (this.alignment === Alignment.BottomRight)\n alignment = rive.Alignment.bottomRight;\n else alignment = rive.Alignment.center;\n\n this.cachedRuntimeAlignment = alignment;\n return alignment;\n }\n}\n\n// #endregion\n\n// #region runtime\n\nexport { RuntimeLoader, type RuntimeCallback };\n\n// #endregion\n\n// #region state machines\n\nexport enum StateMachineInputType {\n Number = 56,\n Trigger = 58,\n Boolean = 59,\n}\n\n/**\n * An input for a state machine\n */\nexport class StateMachineInput {\n constructor(\n public readonly type: StateMachineInputType,\n private runtimeInput: rc.SMIInput,\n ) {}\n\n /**\n * Returns the name of the input\n */\n public get name(): string {\n return this.runtimeInput.name;\n }\n\n /**\n * Returns the current value of the input\n */\n public get value(): number | boolean {\n return this.runtimeInput.value;\n }\n\n /**\n * Sets the value of the input\n */\n public set value(value: number | boolean) {\n this.runtimeInput.value = value;\n }\n\n /**\n * Fires a trigger; does nothing on Number or Boolean input types\n */\n public fire(): void {\n if (this.type === StateMachineInputType.Trigger) {\n this.runtimeInput.fire();\n }\n }\n\n /**\n * Deletes the input\n */\n public delete(): void {\n this.runtimeInput = null;\n }\n}\n\nexport enum RiveEventType {\n General = 128,\n OpenUrl = 131,\n}\n\nclass BaseArtboard {\n public isBindableArtboard: boolean = false;\n constructor(_isBindableArtboard: boolean) {\n this.isBindableArtboard = _isBindableArtboard;\n }\n}\n\nclass Artboard extends BaseArtboard {\n public nativeArtboard: rc.Artboard;\n public file: RiveFile;\n constructor(artboard: rc.Artboard, _file: RiveFile) {\n super(false);\n this.nativeArtboard = artboard;\n this.file = _file;\n }\n}\n\nclass BindableArtboard extends BaseArtboard implements rc.FinalizableTarget {\n public selfUnref: boolean = false;\n public nativeArtboard: rc.BindableArtboard;\n public nativeViewModel: rc.ViewModelInstance | null;\n constructor(artboard: rc.BindableArtboard) {\n super(true);\n this.nativeArtboard = artboard;\n }\n public set viewModel(value: ViewModelInstance) {\n this.nativeViewModel = value.nativeInstance;\n }\n destroy() {\n if (this.selfUnref) {\n this.nativeArtboard.unref();\n this.nativeViewModel?.unref();\n }\n }\n}\n\nclass StateMachine {\n /**\n * Caches the inputs from the runtime\n */\n public readonly inputs: StateMachineInput[] = [];\n\n /**\n * Runtime state machine instance\n */\n public readonly instance: rc.StateMachineInstance;\n\n /**\n * Whether this state machine has focus nodes that can receive focus\n * at any point\n */\n public readonly hasFocusNodes: boolean;\n\n /**\n * @constructor\n * @param stateMachine runtime state machine object\n * @param instance runtime state machine instance object\n */\n constructor(\n private stateMachine: rc.StateMachine,\n runtime: rc.RiveCanvas,\n public playing: boolean,\n private artboard: rc.Artboard,\n ) {\n this.instance = new runtime.StateMachineInstance(stateMachine, artboard);\n this.initInputs(runtime);\n this.hasFocusNodes = this.instance.hasFocusNodes();\n }\n\n public get name(): string {\n return this.stateMachine.name;\n }\n\n /**\n * Returns a list of state names that have changed on this frame\n */\n public get statesChanged(): string[] {\n const names: string[] = [];\n for (let i = 0; i < this.instance.stateChangedCount(); i++) {\n names.push(this.instance.stateChangedNameByIndex(i));\n }\n return names;\n }\n\n /**\n * Advances the state machine instance by a given time.\n * @param time - the time to advance the animation by in seconds\n */\n public advance(time: number) {\n this.instance.advance(time);\n }\n\n /**\n * Advances the state machine instance by a given time and apply changes to artboard.\n * @param time - the time to advance the animation by in seconds\n */\n public advanceAndApply(time: number) {\n this.instance.advanceAndApply(time);\n }\n\n /**\n * Returns the number of events reported from the last advance call\n * @returns Number of events reported\n */\n public reportedEventCount(): number {\n return this.instance.reportedEventCount();\n }\n\n /**\n * Returns a RiveEvent object emitted from the last advance call at the given index\n * of a list of potentially multiple events. If an event at the index is not found,\n * undefined is returned.\n * @param i index of the event reported in a list of potentially multiple events\n * @returns RiveEvent or extended RiveEvent object returned, or undefined\n */\n reportedEventAt(i: number): rc.OpenUrlEvent | rc.RiveEvent | undefined {\n return this.instance.reportedEventAt(i);\n }\n\n /**\n * Fetches references to the state machine's inputs and caches them\n * @param runtime an instance of the runtime; needed for the SMIInput types\n */\n private initInputs(runtime: rc.RiveCanvas): void {\n // Fetch the inputs from the runtime if we don't have them\n for (let i = 0; i < this.instance.inputCount(); i++) {\n const input = this.instance.input(i);\n this.inputs.push(this.mapRuntimeInput(input, runtime));\n }\n }\n\n /**\n * Maps a runtime input to it's appropriate type\n * @param input\n */\n private mapRuntimeInput(\n input: rc.SMIInput,\n runtime: rc.RiveCanvas,\n ): StateMachineInput {\n if (input.type === runtime.SMIInput.bool) {\n return new StateMachineInput(\n StateMachineInputType.Boolean,\n input.asBool(),\n );\n } else if (input.type === runtime.SMIInput.number) {\n return new StateMachineInput(\n StateMachineInputType.Number,\n input.asNumber(),\n );\n } else if (input.type === runtime.SMIInput.trigger) {\n return new StateMachineInput(\n StateMachineInputType.Trigger,\n input.asTrigger(),\n );\n }\n }\n\n /**\n * Deletes the backing Wasm state machine instance; once this is called, this\n * state machine is no more.\n */\n public cleanup() {\n this.inputs.forEach((input) => {\n input.delete();\n });\n this.inputs.length = 0;\n this.instance.delete();\n }\n\n public bindViewModelInstance(viewModelInstance: ViewModelInstance) {\n if (viewModelInstance.runtimeInstance != null) {\n this.instance.bindViewModelInstance(viewModelInstance.runtimeInstance);\n }\n }\n\n /**\n * Get metadata about the state of focus if applicable for this state machine.\n * @returns FocusState - { hasFocus: boolean, expectsKeyboardInput: boolean }\n */\n public focusState(): rc.FocusState { \n return this.instance.focusState();\n }\n\n /**\n * Clear focus from the Rive focus node tree.\n */\n public clearFocus(): void {\n this.instance.clearFocus();\n }\n}\n\n// #endregion\n\n// #region animator\n\n/**\n * Manages animation\n */\nclass Animator {\n /**\n * Constructs a new animator\n * @constructor\n * @param runtime Rive runtime; needed to instance animations & state machines\n * @param artboard the artboard that holds all animations and state machines\n * @param animations optional list of animations\n * @param stateMachines optional list of state machines\n */\n constructor(\n private runtime: rc.RiveCanvas,\n private artboard: rc.Artboard,\n private eventManager: EventManager,\n public readonly animations: Animation[] = [],\n public readonly stateMachines: StateMachine[] = [],\n ) {}\n\n /**\n * Adds animations and state machines by their names. If names are shared\n * between animations & state machines, then the first one found will be\n * created. Best not to use the same names for these in your Rive file.\n * @param animatable the name(s) of animations and state machines to add\n * @returns a list of names of the playing animations and state machines\n */\n public add(\n animatables: string | string[],\n playing: boolean,\n fireEvent = true,\n ): string[] {\n animatables = mapToStringArray(animatables);\n // If animatables is empty, play or pause everything\n if (animatables.length === 0) {\n this.animations.forEach((a) => (a.playing = playing));\n this.stateMachines.forEach((m) => (m.playing = playing));\n } else {\n // Play/pause already instanced items, or create new instances\n const instancedAnimationNames = this.animations.map((a) => a.name);\n const instancedMachineNames = this.stateMachines.map((m) => m.name);\n for (let i = 0; i < animatables.length; i++) {\n const aIndex = instancedAnimationNames.indexOf(animatables[i]);\n const mIndex = instancedMachineNames.indexOf(animatables[i]);\n if (aIndex >= 0 || mIndex >= 0) {\n if (aIndex >= 0) {\n // Animation is instanced, play/pause it\n this.animations[aIndex].playing = playing;\n } else {\n // State machine is instanced, play/pause it\n this.stateMachines[mIndex].playing = playing;\n }\n } else {\n // Try to create a new animation instance\n const anim = this.artboard.animationByName(animatables[i]);\n if (anim) {\n const newAnimation = new Animation(\n anim,\n this.artboard,\n this.runtime,\n playing,\n );\n // Display the first frame of the specified animation\n newAnimation.advance(0);\n newAnimation.apply(1.0);\n this.animations.push(newAnimation);\n } else {\n // Try to create a new state machine instance\n const sm = this.artboard.stateMachineByName(animatables[i]);\n if (sm) {\n const newStateMachine = new StateMachine(\n sm,\n this.runtime,\n playing,\n this.artboard,\n );\n this.stateMachines.push(newStateMachine);\n }\n }\n }\n }\n }\n // Fire play/paused events for animations\n if (fireEvent) {\n if (playing) {\n this.eventManager.fire({\n type: EventType.Play,\n data: this.playing,\n });\n } else {\n this.eventManager.fire({\n type: EventType.Pause,\n data: this.paused,\n });\n }\n }\n\n return playing ? this.playing : this.paused;\n }\n\n /**\n * Adds linear animations by their names.\n * @param animatables the name(s) of animations to add\n * @param playing whether animations should play on instantiation\n */\n public initLinearAnimations(animatables: string[], playing: boolean, isFallingBackFromStateMachines = false) {\n // Play/pause already instanced items, or create new instances\n // This validation is kept to maintain compatibility with current behavior.\n // But given that it this is called during artboard initialization\n // it should probably be safe to remove.\n const instancedAnimationNames = this.animations.map((a) => a.name);\n for (let i = 0; i < animatables.length; i++) {\n const aIndex = instancedAnimationNames.indexOf(animatables[i]);\n if (aIndex >= 0) {\n this.animations[aIndex].playing = playing;\n } else {\n // Try to create a new animation instance\n const anim = this.artboard.animationByName(animatables[i]);\n if (anim) {\n const newAnimation = new Animation(\n anim,\n this.artboard,\n this.runtime,\n playing,\n );\n // Display the first frame of the specified animation\n newAnimation.advance(0);\n newAnimation.apply(1.0);\n this.animations.push(newAnimation);\n } else if (isFallingBackFromStateMachines) { // Throw LoadError if we cannot load the state machine name at all\n const smInitializationMessage = `State Machine with name ${animatables[i]} not found`;\n throw new RiveError(smInitializationMessage);\n } else {\n console.error(`Animation with name ${animatables[i]} not found.`);\n }\n }\n }\n }\n\n /**\n * Adds state machines by their names.\n * @param animatables the name(s) of state machines to add\n * @param playing whether state machines should play on instantiation\n */\n public initStateMachines(animatables: string[], playing: boolean) {\n // Play/pause already instanced items, or create new instances\n // This validation is kept to maintain compatibility with current behavior.\n // But given that it this is called during artboard initialization\n // it should probably be safe to remove.\n const instancedStateMachineNames = this.stateMachines.map((a) => a.name);\n for (let i = 0; i < animatables.length; i++) {\n const aIndex = instancedStateMachineNames.indexOf(animatables[i]);\n if (aIndex >= 0) {\n this.stateMachines[aIndex].playing = playing;\n } else {\n // Try to create a new state machine instance\n const sm = this.artboard.stateMachineByName(animatables[i]);\n if (sm) {\n const newStateMachine = new StateMachine(\n sm,\n this.runtime,\n playing,\n this.artboard,\n );\n this.stateMachines.push(newStateMachine);\n } else {\n console.warn(`State Machine with name ${animatables[i]} not found. Falling back to find an animation with the same name.`);\n \n // TODO: Remove this fallback in next major release as it complicates initialization.\n // In order to maintain compatibility with current behavior, if a state machine is not found\n // we look for an animation with the same name\n this.initLinearAnimations([animatables[i]], playing, true);\n }\n }\n }\n }\n\n /**\n * Play the named animations/state machines\n * @param animatables the names of the animations/machines to play; plays all if empty\n * @returns a list of the playing items\n */\n public play(animatables: string | string[]): string[] {\n return this.add(animatables, true);\n }\n\n /**\n * Advance state machines if they are paused after initialization\n */\n public advanceIfPaused(): void {\n this.stateMachines.forEach((sm) => {\n if (!sm.playing) {\n sm.advanceAndApply(0);\n }\n });\n }\n\n /**\n * Pauses named animations and state machines, or everything if nothing is\n * specified\n * @param animatables names of the animations and state machines to pause\n * @returns a list of names of the animations and state machines paused\n */\n public pause(animatables: string[]): string[] {\n return this.add(animatables, false);\n }\n\n /**\n * Set time of named animations\n * @param animations names of the animations to scrub\n * @param value time scrub value, a floating point number to which the playhead is jumped\n * @returns a list of names of the animations that were scrubbed\n */\n public scrub(animatables: string[], value: number): string[] {\n const forScrubbing = this.animations.filter((a) =>\n animatables.includes(a.name),\n );\n forScrubbing.forEach((a) => (a.scrubTo = value));\n return forScrubbing.map((a) => a.name);\n }\n\n /**\n * Returns a list of names of all animations and state machines currently\n * playing\n */\n public get playing(): string[] {\n return this.animations\n .filter((a) => a.playing)\n .map((a) => a.name)\n .concat(this.stateMachines.filter((m) => m.playing).map((m) => m.name));\n }\n\n /**\n * Returns a list of names of all animations and state machines currently\n * paused\n */\n public get paused(): string[] {\n return this.animations\n .filter((a) => !a.playing)\n .map((a) => a.name)\n .concat(this.stateMachines.filter((m) => !m.playing).map((m) => m.name));\n }\n\n /**\n * Stops and removes all named animations and state machines\n * @param animatables animations and state machines to remove\n * @returns a list of names of removed items\n */\n public stop(animatables?: string[] | string): string[] {\n animatables = mapToStringArray(animatables);\n\n // If nothing's specified, wipe them out, all of them\n let removedNames: string[] = [];\n // Stop everything\n if (animatables.length === 0) {\n removedNames = this.animations\n .map((a) => a.name)\n .concat(this.stateMachines.map((m) => m.name));\n // Clean up before emptying the arrays\n this.animations.forEach((a) => a.cleanup());\n this.stateMachines.forEach((m) => m.cleanup());\n // Empty out the arrays\n this.animations.splice(0, this.animations.length);\n this.stateMachines.splice(0, this.stateMachines.length);\n } else {\n // Remove only the named animations/state machines\n const animationsToRemove = this.animations.filter((a) =>\n animatables.includes(a.name),\n );\n\n animationsToRemove.forEach((a) => {\n a.cleanup();\n this.animations.splice(this.animations.indexOf(a), 1);\n });\n const machinesToRemove = this.stateMachines.filter((m) =>\n animatables.includes(m.name),\n );\n machinesToRemove.forEach((m) => {\n m.cleanup();\n this.stateMachines.splice(this.stateMachines.indexOf(m), 1);\n });\n removedNames = animationsToRemove\n .map((a) => a.name)\n .concat(machinesToRemove.map((m) => m.name));\n }\n\n this.eventManager.fire({\n type: EventType.Stop,\n data: removedNames,\n });\n\n // Return the list of animations removed\n return removedNames;\n }\n\n /**\n * Returns true if at least one animation is active\n */\n public get isPlaying(): boolean {\n return (\n this.animations.reduce((acc, curr) => acc || curr.playing, false) ||\n this.stateMachines.reduce((acc, curr) => acc || curr.playing, false)\n );\n }\n\n /**\n * Returns true if all animations are paused and there's at least one animation\n */\n public get isPaused(): boolean {\n return (\n !this.isPlaying &&\n (this.animations.length > 0 || this.stateMachines.length > 0)\n );\n }\n\n /**\n * Returns true if there are no playing or paused animations/state machines\n */\n public get isStopped(): boolean {\n return this.animations.length === 0 && this.stateMachines.length === 0;\n }\n\n /**\n * If there are no animations or state machines, add the first one found\n * @returns the name of the animation or state machine instanced\n */\n public atLeastOne(playing: boolean, fireEvent = true): string {\n let instancedName: string;\n if (this.animations.length === 0 && this.stateMachines.length === 0) {\n if (this.artboard.animationCount() > 0) {\n // Add the first animation\n this.add(\n [(instancedName = this.artboard.animationByIndex(0).name)],\n playing,\n fireEvent,\n );\n } else if (this.artboard.stateMachineCount() > 0) {\n // Add the first state machine\n this.add(\n [(instancedName = this.artboard.stateMachineByIndex(0).name)],\n playing,\n fireEvent,\n );\n }\n }\n return instancedName;\n }\n\n /**\n * Checks if any animations have looped and if so, fire the appropriate event\n */\n public handleLooping() {\n for (const animation of this.animations.filter((a) => a.playing)) {\n // Emit if the animation looped\n if (animation.loopValue === 0 && animation.loopCount) {\n animation.loopCount = 0;\n // This is a one-shot; if it has ended, delete the instance\n this.stop(animation.name);\n } else if (animation.loopValue === 1 && animation.loopCount) {\n this.eventManager.fire({\n type: EventType.Loop,\n data: { animation: animation.name, type: LoopType.Loop },\n });\n animation.loopCount = 0;\n }\n // Wasm indicates a loop at each time the animation\n // changes direction, so a full loop/lap occurs every\n // two loop counts\n else if (animation.loopValue === 2 && animation.loopCount > 1) {\n this.eventManager.fire({\n type: EventType.Loop,\n data: { animation: animation.name, type: LoopType.PingPong },\n });\n animation.loopCount = 0;\n }\n }\n }\n\n /**\n * Checks if states have changed in state machines and fires a statechange\n * event\n */\n public handleStateChanges() {\n const statesChanged: string[] = [];\n for (const stateMachine of this.stateMachines.filter((sm) => sm.playing)) {\n statesChanged.push(...stateMachine.statesChanged);\n }\n if (statesChanged.length > 0) {\n this.eventManager.fire({\n type: EventType.StateChange,\n data: statesChanged,\n });\n }\n }\n\n public handleAdvancing(time: number) {\n this.eventManager.fire({\n type: EventType.Advance,\n data: time,\n });\n }\n}\n\n// #endregion\n\n// #region events\n\n/**\n * Supported event types triggered in Rive\n */\nexport enum EventType {\n Load = \"load\",\n LoadError = \"loaderror\",\n Play = \"play\",\n Pause = \"pause\",\n Stop = \"stop\",\n Loop = \"loop\",\n Draw = \"draw\",\n Advance = \"advance\",\n StateChange = \"statechange\",\n RiveEvent = \"riveevent\",\n AudioStatusChange = \"audiostatuschange\", // internal event. TODO: split\n}\n\nexport type RiveEventPayload = rc.RiveEvent | rc.OpenUrlEvent;\n\n// Event reported by Rive for significant events during animation playback (i.e. play, pause, stop, etc.),\n// as well as for custom Rive events reported from the state machine defined at design-time.\nexport interface Event {\n type: EventType;\n data?: string | string[] | LoopEvent | number | RiveEventPayload | RiveFile;\n}\n\n/**\n * Looping types: one-shot, loop, and ping-pong\n */\nexport enum LoopType {\n OneShot = \"oneshot\", // has value 0 in runtime\n Loop = \"loop\", // has value 1 in runtime\n PingPong = \"pingpong\", // has value 2 in runtime\n}\n\n/**\n * Loop events are returned through onloop callbacks\n */\nexport interface LoopEvent {\n animation: string;\n type: LoopType;\n}\n\n/**\n * Loop events are returned through onloop callbacks\n */\nexport type EventCallback = (event: Event) => void;\n\n/**\n * Event listeners registered with the event manager\n */\nexport interface EventListener {\n type: EventType;\n callback: EventCallback;\n}\n\n/**\n * FPS Reporting through callbacks sent to the WASM runtime\n */\nexport type FPSCallback = (fps: number) => void;\n\n// Manages Rive events and listeners\nclass EventManager {\n constructor(private listeners: EventListener[] = []) {}\n\n // Gets listeners of specified type\n private getListeners(type: EventType): EventListener[] {\n return this.listeners.filter((e) => e.type === type);\n }\n\n // Adds a listener\n public add(listener: EventListener): void {\n if (!this.listeners.includes(listener)) {\n this.listeners.push(listener);\n }\n }\n\n /**\n * Removes a listener\n * @param listener the listener with the callback to be removed\n */\n public remove(listener: EventListener): void {\n // We can't simply look for the listener as it'll be a different instance to\n // one originally subscribed. Find all the listeners of the right type and\n // then check their callbacks which should match.\n for (let i = 0; i < this.listeners.length; i++) {\n const currentListener = this.listeners[i];\n if (currentListener.type === listener.type) {\n if (currentListener.callback === listener.callback) {\n this.listeners.splice(i, 1);\n break;\n }\n }\n }\n }\n\n /**\n * Clears all listeners of specified type, or every listener if no type is\n * specified\n * @param type the type of listeners to clear, or all listeners if not\n * specified\n */\n public removeAll(type?: EventType) {\n if (!type) {\n this.listeners.splice(0, this.listeners.length);\n } else {\n this.listeners\n .filter((l) => l.type === type)\n .forEach((l) => this.remove(l));\n }\n }\n\n // Fires an event\n public fire(event: Event): void {\n const eventListeners = this.getListeners(event.type);\n eventListeners.forEach((listener) => listener.callback(event));\n }\n}\n\n// #endregion\n\n// #region Manages a queue of tasks\n\n// A task in the queue; will fire the action when the queue is processed; will\n// also optionally fire an event.\nexport interface Task {\n action?: VoidCallback;\n event?: Event;\n}\n\n// Manages a queue of tasks\nclass TaskQueueManager {\n private queue: Task[] = [];\n\n constructor(private eventManager: EventManager) {}\n\n // Adds a task top the queue\n public add(task: Task): void {\n this.queue.push(task);\n }\n\n // Processes all tasks in the queue\n public process(): void {\n while (this.queue.length > 0) {\n const task = this.queue.shift();\n if (task?.action) {\n task.action();\n }\n if (task?.event) {\n this.eventManager.fire(task.event);\n }\n }\n }\n}\n\n// #endregion\n\n// #region Audio\n\nenum SystemAudioStatus {\n AVAILABLE,\n UNAVAILABLE,\n}\n\n// Class to handle audio context availability and status changes\nclass AudioManager extends EventManager {\n private _started: boolean = false;\n private _enabled: boolean = false;\n\n private _status: SystemAudioStatus = SystemAudioStatus.UNAVAILABLE;\n private _audioContext: AudioContext;\n\n private async delay(time: number) {\n return new Promise((resolve) => setTimeout(resolve, time));\n }\n\n private async timeout() {\n return new Promise((_, reject) => setTimeout(reject, 50));\n }\n\n // Alerts animations on status changes and removes the listeners to avoid alerting twice.\n private reportToListeners() {\n this.fire({ type: EventType.AudioStatusChange });\n this.removeAll();\n }\n\n /**\n * The audio context has been resolved.\n * Alert any listeners that we can now play audio.\n * Rive will now play audio at the configured volume.\n */\n private async enableAudio() {\n if (!this._enabled) {\n this._enabled = true;\n this._status = SystemAudioStatus.AVAILABLE;\n this.reportToListeners();\n }\n }\n\n /**\n * Check if we are able to play audio.\n *\n * We currently check the audio context, when resume() returns before a timeout we know that the\n * audio context is running and we can enable audio.\n */\n private async testAudio() {\n if (\n this._status === SystemAudioStatus.UNAVAILABLE &&\n this._audioContext !== null\n ) {\n // if the audio context is not available, it will never resume,\n // so the timeout will throw after 50ms and a new cycle will start\n try {\n await Promise.race([this._audioContext.resume(), this.timeout()]);\n this.enableAudio();\n } catch {\n // we expect the promise race to timeout, which we ignore.\n }\n }\n }\n\n /**\n * Establish audio for use with rive.\n * We both test if we can use audio intermittently and listen for user interaction.\n * The aim is to enable audio playback as soon as the browser allows this.\n */\n private async _establishAudio() {\n if (!this._started) {\n this._started = true;\n // If window doesn't exist we assume they are not in a browser context\n // so audio will not be blocked\n if (typeof window == \"undefined\") {\n this.enableAudio();\n } else {\n this._audioContext = new AudioContext();\n this.listenForUserAction();\n while (this._status === SystemAudioStatus.UNAVAILABLE) {\n await this.testAudio();\n await this.delay(1000);\n }\n }\n }\n }\n\n private listenForUserAction() {\n // NOTE: AudioContexts are ready immediately if requested in a ui callback\n // we *could* re request one in this listener.\n const _clickListener = async () => {\n // note this has \"better\" results than calling `await this.testAudio()`\n // as we force audio to be enabled in the current thread, rather than chancing\n // the thread to be passed over for some other async context\n\n this.enableAudio();\n };\n // NOTE: we should test this on mobile/pads\n document.addEventListener(\"pointerdown\", _clickListener, {\n once: true,\n });\n }\n\n /**\n * Establish the audio context for rive, this lets rive know that we can play audio.\n */\n public async establishAudio() {\n this._establishAudio();\n }\n\n public get systemVolume() {\n if (this._status === SystemAudioStatus.UNAVAILABLE) {\n // We do an immediate test to avoid depending on the delay of the running test\n this.testAudio();\n return 0;\n }\n return 1;\n }\n\n public get status(): SystemAudioStatus {\n return this._status;\n }\n}\n\nconst audioManager = new AudioManager();\n\n// #endregion\n\n// #region Observers\n\ntype ObservedObject = {\n onResize: Function;\n element: HTMLCanvasElement;\n};\n\ntype MyResizeObserverType = {\n observe: Function;\n unobserve: Function;\n disconnect: Function;\n};\n\nclass FakeResizeObserver {\n observe() {}\n unobserve() {}\n disconnect() {}\n}\n\nconst MyResizeObserver = globalThis.ResizeObserver || FakeResizeObserver;\n\n/**\n * This class takes care of any observers that will be attached to an animation.\n * It should be treated as a singleton because observers are much more performant\n * when used for observing multiple elements by a single instance.\n */\n\nclass ObjectObservers {\n private _elementsMap: Map<HTMLCanvasElement, ObservedObject> = new Map();\n\n private _resizeObserver: MyResizeObserverType;\n\n constructor() {\n this._resizeObserver = new MyResizeObserver(this._onObserved);\n }\n\n /**\n * Resize observers trigger both when the element changes its size and also when the\n * element is added or removed from the document.\n */\n private _onObservedEntry = (entry: ResizeObserverEntry) => {\n const observed = this._elementsMap.get(entry.target as HTMLCanvasElement);\n if (observed !== null) {\n observed.onResize(\n entry.target.clientWidth == 0 || entry.target.clientHeight == 0,\n );\n } else {\n this._resizeObserver.unobserve(entry.target);\n }\n };\n\n private _onObserved = (entries: ResizeObserverEntry[]) => {\n entries.forEach(this._onObservedEntry);\n };\n\n // Adds an observable element\n public add(element: HTMLCanvasElement, onResize: Function) {\n let observed: ObservedObject = {\n onResize,\n element,\n };\n this._elementsMap.set(element, observed);\n this._resizeObserver.observe(element);\n return observed;\n }\n\n // Removes an observable element\n public remove(observed: ObservedObject) {\n this._resizeObserver.unobserve(observed.element);\n this._elementsMap.delete(observed.element);\n }\n}\n\nconst observers = new ObjectObservers();\n\n// #endregion\n\n// #region Rive\n\n// Interface for the Rive static method contructor\nexport interface RiveParameters {\n canvas: HTMLCanvasElement | OffscreenCanvas; // canvas is required\n src?: string; // one of src or buffer or file is required\n buffer?: ArrayBuffer; // one of src or buffer or file is required\n riveFile?: RiveFile;\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n layout?: Layout;\n autoplay?: boolean;\n useOffscreenRenderer?: boolean;\n /**\n * Optional tab index to set for the canvas element if there are any Focus nodes within the graphic\n */\n tabIndex?: number;\n /**\n * Optional settings for focus behavior\n */\n focusOptions?: RiveFocusOptions;\n /**\n * Allow the runtime to automatically load assets hosted in Rive's CDN.\n * enabled by default.\n */\n enableRiveAssetCDN?: boolean;\n /**\n * Turn off Rive Listeners. This means state machines that have Listeners\n * will not be invoked, and also, no event listeners pertaining to Listeners\n * will be attached to the <canvas> element\n */\n shouldDisableRiveListeners?: boolean;\n /**\n * For Rive Listeners, allows scrolling behavior to still occur on canvas elements\n * when a touch/drag action is performed on touch-enabled devices. Otherwise,\n * scroll behavior may be prevented on touch/drag actions on the canvas by default.\n */\n isTouchScrollEnabled?: boolean;\n /**\n * Enable Rive Events to be handled by the runtime. This means any special Rive Event may have\n * a side effect that takes place implicitly.\n *\n * For example, if during the render loop an OpenUrlEvent is detected, the\n * browser may try to open the specified URL in the payload.\n *\n * This flag is false by default to prevent any unwanted behaviors from taking place.\n * This means any special Rive Event will have to be handled manually by subscribing to\n * EventType.RiveEvent\n */\n automaticallyHandleEvents?: boolean;\n /**\n * Rive will look for a default view model and view model instance to bind to the artboard\n */\n autoBind?: boolean;\n /**\n * For Rive Listeners, dispatch a pointer exit when the pointer exits the canvas.\n */\n dispatchPointerExit?: boolean;\n /**\n * Enables multi touch support\n */\n enableMultiTouch?: boolean;\n /**\n * Enum with drawing options for optimizations\n */\n drawingOptions?: DrawOptimizationOptions;\n /**\n * Emit performance.mark / performance.measure entries for load lifecycle\n * events and the first 3 render frames. Useful for profiling Rive's\n * contribution to load and render time in browser devtools.\n * False by default.\n */\n enablePerfMarks?: boolean;\n onLoad?: EventCallback;\n onLoadError?: EventCallback;\n onPlay?: EventCallback;\n onPause?: EventCallback;\n onStop?: EventCallback;\n onLoop?: EventCallback;\n onStateChange?: EventCallback;\n onAdvance?: EventCallback;\n assetLoader?: AssetLoadCallback;\n /**\n * @deprecated Use `onLoad()` instead\n */\n onload?: EventCallback;\n /**\n * @deprecated Use `onLoadError()` instead\n */\n onloaderror?: EventCallback;\n /**\n * @deprecated Use `onPlay()` instead\n */\n onplay?: EventCallback;\n /**\n * @deprecated Use `onPause()` instead\n */\n onpause?: EventCallback;\n /**\n * @deprecated Use `onStop()` instead\n */\n onstop?: EventCallback;\n /**\n * @deprecated Use `onLoop()` instead\n */\n onloop?: EventCallback;\n /**\n * @deprecated Use `onStateChange()` instead\n */\n onstatechange?: EventCallback;\n}\n\n// Interface to Rive.load function\nexport interface RiveLoadParameters {\n src?: string;\n buffer?: ArrayBuffer;\n riveFile?: RiveFile;\n autoplay?: boolean;\n autoBind?: boolean;\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n useOffscreenRenderer?: boolean;\n shouldDisableRiveListeners?: boolean;\n tabIndex?: number;\n}\n\n// Interface ot Rive.reset function\nexport interface RiveResetParameters {\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n autoplay?: boolean;\n autoBind?: boolean;\n}\n// Interface to RiveFile.load function\nexport interface RiveFileParameters {\n src?: string;\n buffer?: ArrayBuffer;\n assetLoader?: AssetLoadCallback;\n enableRiveAssetCDN?: boolean;\n onLoad?: EventCallback;\n onLoadError?: EventCallback;\n /**\n * Emit performance.mark / performance.measure entries for load lifecycle\n * events. False by default.\n */\n enablePerfMarks?: boolean;\n}\n\nexport class RiveFile implements rc.FinalizableTarget {\n // Error message for missing source or buffer\n private static readonly missingErrorMessage: string =\n \"Rive source file or data buffer required\";\n\n // Error message for file load error\n private static readonly fileLoadErrorMessage: string =\n \"The file failed to load\";\n\n // A url to a Rive file; may be undefined if a buffer is specified\n private src: string;\n\n // Raw Rive file data; may be undefined if a src is specified\n private buffer: ArrayBuffer;\n\n // Wasm runtime\n private runtime: rc.RiveCanvas;\n\n // Runtime file\n private file: rc.File;\n\n // AssetLoadCallback: allows customizing asset loading for images and fonts.\n private assetLoader: AssetLoadCallback;\n\n // Allow the runtime to automatically load assets hosted in Rive's runtime.\n private enableRiveAssetCDN: boolean = true;\n\n // When true, emits performance.mark/measure entries during RiveFile load.\n private enablePerfMarks: boolean = false;\n\n // Holds event listeners\n private eventManager: EventManager;\n\n private referenceCount: number = 0;\n\n private destroyed: boolean = false;\n\n public selfUnref: boolean = false;\n\n private bindableArtboards: BindableArtboard[] = [];\n\n constructor(params: RiveFileParameters) {\n this.src = params.src;\n this.buffer = params.buffer;\n\n if (params.assetLoader) this.assetLoader = params.assetLoader;\n this.enableRiveAssetCDN =\n typeof params.enableRiveAssetCDN == \"boolean\"\n ? params.enableRiveAssetCDN\n : true;\n this.enablePerfMarks = !!params.enablePerfMarks;\n if (this.enablePerfMarks) RuntimeLoader.enablePerfMarks = true;\n\n // New event management system\n this.eventManager = new EventManager();\n if (params.onLoad) this.on(EventType.Load, params.onLoad);\n if (params.onLoadError) this.on(EventType.LoadError, params.onLoadError);\n }\n\n private releaseFile() {\n if (this.selfUnref) {\n this.file?.unref();\n }\n this.file = null;\n }\n\n private releaseBindableArtboards() {\n this.bindableArtboards.forEach((bindableArtboard) =>\n bindableArtboard.destroy(),\n );\n }\n\n private async initData() {\n if (this.src && !this.buffer) {\n try {\n this.buffer = await loadRiveFile(this.src);\n } catch (error) {\n if (error instanceof Error) {\n throw error;\n }\n throw new RiveError(RiveFile.fileLoadErrorMessage);\n }\n }\n if (this.destroyed) {\n return;\n }\n let loader;\n if (this.assetLoader) {\n const loaderWrapper = new CustomFileAssetLoaderWrapper(\n this.runtime,\n this.assetLoader,\n );\n loader = loaderWrapper.assetLoader;\n }\n // Load the Rive file\n if (this.enablePerfMarks) performance.mark('rive:file-load:start');\n this.file = await this.runtime.load(\n new Uint8Array(this.buffer),\n loader,\n this.enableRiveAssetCDN,\n );\n if (this.enablePerfMarks) {\n performance.mark('rive:file-load:end');\n performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');\n }\n const fileFinalizer = new FileFinalizer(this.file);\n finalizationRegistry.register(this, fileFinalizer);\n\n if (this.destroyed) {\n this.releaseFile();\n return;\n }\n if (this.file !== null) {\n this.eventManager.fire({\n type: EventType.Load,\n data: this,\n });\n } else {\n this.fireLoadError(RiveFile.fileLoadErrorMessage);\n }\n }\n\n private async loadRiveFileBytes(): Promise<ArrayBuffer> {\n if (this.enablePerfMarks) performance.mark('rive:fetch-riv:start');\n const bufferPromise: Promise<ArrayBuffer> = this.src\n ? loadRiveFile(this.src)\n : Promise.resolve(this.buffer);\n if (this.enablePerfMarks && this.src) {\n bufferPromise.then(() => {\n performance.mark('rive:fetch-riv:end');\n performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');\n })\n }\n return bufferPromise;\n }\n\n private async loadRuntime(): Promise<rc.RiveCanvas> {\n if (this.enablePerfMarks) performance.mark('rive:await-wasm:start');\n const runtimePromise = RuntimeLoader.awaitInstance();\n if (this.enablePerfMarks) {\n runtimePromise.then(() => {\n performance.mark('rive:await-wasm:end');\n performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');\n })\n }\n return runtimePromise;\n }\n\n public async init() {\n // If no source file url specified, it's a bust\n if (!this.src && !this.buffer) {\n this.fireLoadError(RiveFile.missingErrorMessage);\n return;\n }\n\n try {\n // Kick off the .riv file fetch and WASM module init simultaneously —\n // they have no dependency on each other so both can be in-flight at once.\n const [bufferResolved, runtimeResolved] = await Promise.all([this.loadRiveFileBytes(), this.loadRuntime()]);\n\n if (this.destroyed) {\n return;\n }\n // .riv file buffer and WASM runtime instance\n this.buffer = bufferResolved;\n this.runtime = runtimeResolved;\n\n if (this.enablePerfMarks) performance.mark('rive:init-data:start');\n await this.initData();\n if (this.enablePerfMarks) {\n performance.mark('rive:init-data:end');\n performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');\n }\n } catch (error) {\n this.fireLoadError(\n error instanceof Error ? error.message : RiveFile.fileLoadErrorMessage,\n );\n }\n }\n\n private fireLoadError(message: string): void {\n this.eventManager.fire({\n type: EventType.LoadError,\n data: message,\n });\n\n throw new RiveError(message);\n }\n\n /**\n * Subscribe to Rive-generated events\n * @param type the type of event to subscribe to\n * @param callback callback to fire when the event occurs\n */\n public on(type: EventType, callback: EventCallback) {\n this.eventManager.add({\n type: type,\n callback: callback,\n });\n }\n\n /**\n * Unsubscribes from a Rive-generated event\n * @param type the type of event to unsubscribe from\n * @param callback the callback to unsubscribe\n */\n public off(type: EventType, callback: EventCallback) {\n this.eventManager.remove({\n type: type,\n callback: callback,\n });\n }\n\n public cleanup() {\n this.referenceCount -= 1;\n if (this.referenceCount <= 0) {\n this.removeAllRiveEventListeners();\n this.releaseFile();\n this.releaseBindableArtboards();\n this.destroyed = true;\n }\n }\n\n /**\n * Unsubscribes all Rive listeners from an event type, or everything if no type is\n * given\n * @param type the type of event to unsubscribe from, or all types if\n * undefined\n */\n public removeAllRiveEventListeners(type?: EventType) {\n this.eventManager.removeAll(type);\n }\n\n public getInstance(): rc.File {\n if (this.file !== null) {\n this.referenceCount += 1;\n return this.file;\n }\n }\n\n public destroyIfUnused() {\n if (this.referenceCount <= 0) {\n this.cleanup();\n }\n }\n\n private createBindableArtboard(\n nativeBindableArtboard: rc.BindableArtboard,\n ): BindableArtboard | null {\n if (nativeBindableArtboard != null) {\n const bindableArtboard = new BindableArtboard(nativeBindableArtboard);\n createFinalization(bindableArtboard, bindableArtboard.nativeArtboard);\n this.bindableArtboards.push(bindableArtboard);\n return bindableArtboard;\n }\n return null;\n }\n\n /**\n * @deprecated This function is deprecated. For better stability and memory management\n * use `getBindableArtboard()` instead.\n * @param {string} name - The name of the artboard.\n * @returns {Artboard} The artboard to bind to.\n */\n public getArtboard(name: string): Artboard | null {\n const nativeArtboard = this.file.artboardByName(name);\n if (nativeArtboard != null) {\n return new Artboard(nativeArtboard, this);\n }\n }\n\n public getBindableArtboard(name: string): BindableArtboard | null {\n const nativeArtboard = this.file.bindableArtboardByName(name);\n return this.createBindableArtboard(nativeArtboard);\n }\n\n public getDefaultBindableArtboard(): BindableArtboard | null {\n const nativeArtboard = this.file.bindableArtboardDefault();\n return this.createBindableArtboard(nativeArtboard);\n }\n\n public internalBindableArtboardFromArtboard(\n artboard: rc.Artboard,\n ): BindableArtboard | null {\n const nativeBindableArtboard =\n this.file.internalBindableArtboardFromArtboard(artboard);\n return this.createBindableArtboard(nativeBindableArtboard);\n }\n\n public viewModelByName(name: string): ViewModel | null {\n const viewModel = this.file.viewModelByName(name);\n if (viewModel !== null) {\n return new ViewModel(viewModel);\n }\n return null;\n }\n}\n\nexport class Rive {\n // Canvas in which to render the artboard\n private readonly canvas: HTMLCanvasElement | OffscreenCanvas;\n\n // A url to a Rive file; may be undefined if a buffer is specified\n private src: string;\n\n // Raw Rive file data; may be undefined if a src is specified\n private buffer: ArrayBuffer;\n\n // The layout for rendering in the canvas\n private _layout: Layout;\n\n // The runtime renderer\n private renderer: rc.WrappedRenderer;\n\n // Tracks if a Rive file is loaded\n private loaded = false;\n\n // Tracks if a Rive file is destroyed\n private destroyed = false;\n\n // Reference of an object that handles any observers for the animation\n private _observed: ObservedObject | null = null;\n\n /**\n * Tracks if a Rive file is loaded; we need this in addition to loaded as some\n * commands (e.g. contents) can be called as soon as the file is loaded.\n * However, playback commands need to be queued and run in order once initial\n * animations and autoplay has been sorted out. This applies to play, pause,\n * and start.\n */\n private readyForPlaying = false;\n\n // Wasm runtime\n private runtime: rc.RiveCanvas;\n\n // Runtime artboard\n private artboard: rc.Artboard | null = null;\n\n // place to clear up pointer/touch event listeners\n private eventCleanup: VoidCallback | null = null;\n\n // Manages keyboard and DOM-focus interactions for the canvas.\n private _keyboardInteractions: KeyboardInteractions | null = null;\n\n // Runtime file\n private file: rc.File;\n\n // Rive file instance\n private riveFile: RiveFile;\n\n // Holds event listeners\n private eventManager: EventManager;\n\n // Manages the loading task queue\n private taskQueue: TaskQueueManager;\n\n // Animator: manages animations and state machines\n private animator: Animator;\n\n // AssetLoadCallback: allows customizing asset loading for images and fonts.\n private assetLoader: AssetLoadCallback;\n\n // Error message for missing source or buffer\n private static readonly missingErrorMessage: string =\n \"Rive source file or data buffer required\";\n\n // Error message for removed rive file\n private static readonly cleanupErrorMessage: string =\n \"Attempt to use file after calling cleanup.\";\n\n private shouldDisableRiveListeners = false;\n\n private automaticallyHandleEvents = false;\n\n private dispatchPointerExit = true;\n\n // Allow all pointers to be passed to the runtime\n private enableMultiTouch = false;\n\n // Allow the runtime to automatically load assets hosted in Rive's runtime.\n private enableRiveAssetCDN = true;\n\n // Keep a local value of the set volume to update it asynchronously\n private _volume = 1;\n\n // Keep a local value of the set width to update it asynchronously\n private _artboardWidth: number | undefined = undefined;\n\n // Keep a local value of the set height to update it asynchronously\n private _artboardHeight: number | undefined = undefined;\n\n // Keep a local value of the device pixel ratio used in rendering and canvas/artboard resizing\n private _devicePixelRatioUsed = 1;\n\n // Whether the canvas element's size is 0\n private _hasZeroSize = false;\n\n // Whether a draw operation needs to be forced\n private _needsRedraw = false;\n\n // Canvas width and height. Values are lazily updated so they might\n // not be in sync with current canvas size.\n private _currentCanvasWidth = 0;\n private _currentCanvasHeight = 0;\n\n // Audio event listener\n private _audioEventListener: EventListener | null = null;\n\n // draw method bound to the class\n private _boundDraw: (t: number) => void | null = null;\n\n // Page visibility handler — prevents state machine advancing / rAF from being invoked with large time delta\n // when the browser tab is switched back to after being hidden.\n private _pageVisibilityHandler: (() => void) | null = null;\n // True only when the page visibility handler itself cancelled an active frame.\n // Set by stopRendering(), cleared by startRendering(). Prevents the\n // visibilitychange handler from restarting a rendering loop the caller intentionally stopped.\n private _explicitlyStoppedRendering = false;\n\n private _viewModelInstance: ViewModelInstance | null = null;\n private _dataEnums: DataEnum[] | null = null;\n\n private _tabIndex: number | null = null;\n private _prevHasFocus = false;\n private _focusOptions: RiveFocusOptions = {\n allowFocusInterrupt: false,\n };\n\n private drawOptimization: DrawOptimizationOptions =\n DrawOptimizationOptions.DrawOnChanged;\n\n // When true, emits performance.mark/measure entries for load and render.\n private enablePerfMarks: boolean = false;\n\n // Durations to generate a frame for the last second. Used for performance profiling.\n public durations: number[] = [];\n public frameTimes: number[] = [];\n public frameCount = 0;\n public isTouchScrollEnabled = false;\n\n constructor(params: RiveParameters) {\n this._boundDraw = this.draw.bind(this);\n if (typeof document !== 'undefined') {\n this._pageVisibilityHandler = this._onPageVisibilityChange.bind(this);\n document.addEventListener('visibilitychange', this._pageVisibilityHandler);\n }\n this.canvas = params.canvas;\n if (params.canvas.constructor === HTMLCanvasElement) {\n this._observed = observers.add(\n this.canvas as HTMLCanvasElement,\n this.onCanvasResize,\n );\n }\n this._currentCanvasWidth = this.canvas.width;\n this._currentCanvasHeight = this.canvas.height;\n this.src = params.src;\n this.buffer = params.buffer;\n this.riveFile = params.riveFile;\n this.layout = params.layout ?? new Layout();\n this.shouldDisableRiveListeners = !!params.shouldDisableRiveListeners;\n this.isTouchScrollEnabled = !!params.isTouchScrollEnabled;\n this.automaticallyHandleEvents = !!params.automaticallyHandleEvents;\n this.dispatchPointerExit =\n params.dispatchPointerExit === false\n ? params.dispatchPointerExit\n : this.dispatchPointerExit;\n this.enableMultiTouch = !!params.enableMultiTouch;\n this.drawOptimization = params.drawingOptions ?? this.drawOptimization;\n this.enableRiveAssetCDN =\n params.enableRiveAssetCDN === undefined\n ? true\n : params.enableRiveAssetCDN;\n this.enablePerfMarks = !!params.enablePerfMarks;\n if (this.enablePerfMarks) RuntimeLoader.enablePerfMarks = true;\n this._focusOptions = params.focusOptions ?? this._focusOptions;\n\n // New event management system\n this.eventManager = new EventManager();\n if (params.onLoad) this.on(EventType.Load, params.onLoad);\n if (params.onLoadError) this.on(EventType.LoadError, params.onLoadError);\n if (params.onPlay) this.on(EventType.Play, params.onPlay);\n if (params.onPause) this.on(EventType.Pause, params.onPause);\n if (params.onStop) this.on(EventType.Stop, params.onStop);\n if (params.onLoop) this.on(EventType.Loop, params.onLoop);\n if (params.onStateChange)\n this.on(EventType.StateChange, params.onStateChange);\n if (params.onAdvance) this.on(EventType.Advance, params.onAdvance);\n\n /**\n * @deprecated Use camelCase'd versions instead.\n */\n if (params.onload && !params.onLoad) this.on(EventType.Load, params.onload);\n if (params.onloaderror && !params.onLoadError)\n this.on(EventType.LoadError, params.onloaderror);\n if (params.onplay && !params.onPlay) this.on(EventType.Play, params.onplay);\n if (params.onpause && !params.onPause)\n this.on(EventType.Pause, params.onpause);\n if (params.onstop && !params.onStop) this.on(EventType.Stop, params.onstop);\n if (params.onloop && !params.onLoop) this.on(EventType.Loop, params.onloop);\n if (params.onstatechange && !params.onStateChange)\n this.on(EventType.StateChange, params.onstatechange);\n\n /**\n * Asset loading\n */\n if (params.assetLoader) this.assetLoader = params.assetLoader;\n\n // Hook up the task queue\n this.taskQueue = new TaskQueueManager(this.eventManager);\n\n this.init({\n src: this.src,\n buffer: this.buffer,\n riveFile: this.riveFile,\n autoplay: params.autoplay,\n autoBind: params.autoBind,\n animations: params.animations,\n stateMachines: params.stateMachines,\n artboard: params.artboard,\n useOffscreenRenderer: params.useOffscreenRenderer,\n tabIndex: params.tabIndex,\n });\n }\n\n public get viewModelCount(): number {\n return this.file.viewModelCount();\n }\n\n // Alternative constructor to build a Rive instance from an interface/object\n public static new(params: RiveParameters): Rive {\n console.warn(\n \"This function is deprecated: please use `new Rive({})` instead\",\n );\n return new Rive(params);\n }\n\n // Event handler for when audio context becomes available\n private onSystemAudioChanged() {\n this.volume = this._volume;\n }\n\n private onCanvasResize = (hasZeroSize: boolean) => {\n const toggledDisplay = this._hasZeroSize !== hasZeroSize;\n this._hasZeroSize = hasZeroSize;\n if (!hasZeroSize) {\n if (toggledDisplay) {\n this.resizeDrawingSurfaceToCanvas();\n }\n } else if (!this._layout.maxX || !this._layout.maxY) {\n this.resizeToCanvas();\n }\n };\n\n // Initializes the Rive object either from constructor or load()\n private init({\n src,\n buffer,\n riveFile,\n animations,\n stateMachines,\n artboard,\n autoplay = false,\n useOffscreenRenderer = false,\n autoBind = false,\n tabIndex,\n }: RiveLoadParameters): void {\n if (this.destroyed) {\n return;\n }\n this.src = src;\n this.buffer = buffer;\n this.riveFile = riveFile;\n this._tabIndex = tabIndex ?? null;\n\n // If no source file url specified, it's a bust\n if (!this.src && !this.buffer && !this.riveFile) {\n throw new RiveError(Rive.missingErrorMessage);\n }\n\n // List of animations that should be initialized.\n const startingAnimationNames = mapToStringArray(animations);\n\n // List of state machines that should be initialized\n const startingStateMachineNames = mapToStringArray(stateMachines);\n\n // Ensure loaded is marked as false if loading new file\n this.loaded = false;\n this.readyForPlaying = false;\n\n // Ensure the runtime is loaded\n RuntimeLoader.awaitInstance()\n .then((runtime) => {\n if (this.destroyed) {\n return;\n }\n this.runtime = runtime;\n\n this.removeRiveListeners();\n this.deleteRiveRenderer();\n\n // Get the canvas where you want to render the animation and create a renderer\n if (this.enablePerfMarks) performance.mark('rive:make-renderer:start');\n try {\n this.renderer = this.runtime.makeRenderer(\n this.canvas,\n useOffscreenRenderer,\n );\n if (!this.renderer) {\n throw new Error(\"Renderer is null, cannot render Rive on the canvas.\");\n }\n } catch (e) {\n console.error(e);\n throw new RiveError(\"Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.\");\n }\n if (this.enablePerfMarks) {\n performance.mark('rive:make-renderer:end');\n performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');\n }\n\n // Initial size adjustment based on devicePixelRatio if no width/height are\n // specified explicitly\n if (!(this.canvas.width || this.canvas.height)) {\n this.resizeDrawingSurfaceToCanvas();\n }\n\n // Load Rive data from a source uri or a data buffer\n this.initData(\n artboard,\n startingAnimationNames,\n startingStateMachineNames,\n autoplay,\n autoBind,\n )\n .then((hasInitialized: boolean) => {\n if (hasInitialized) {\n return this.setupRiveListeners();\n }\n })\n .catch((e) => {\n // initData already catches RiveErrors for load issues like artboard/state machine initialization\n // failures, so just console error and catch here so we don't double-fire the LoadError event\n console.error(e);\n });\n })\n .catch((e: Error) => { // Catching errors from loading WASM\n this.eventManager.fire({ type: EventType.LoadError, data: e.message });\n });\n }\n\n /**\n * Setup Rive Listeners on the canvas\n * @param riveListenerOptions - Enables TouchEvent events on the canvas. Set to true to allow\n * touch scrolling on the canvas element on touch-enabled devices\n * i.e. { isTouchScrollEnabled: true }\n */\n public setupRiveListeners(\n riveListenerOptions?: SetupRiveListenersOptions,\n ): void {\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n if (!this.shouldDisableRiveListeners) {\n const playingStateMachines = this.animator.stateMachines.filter((sm) => sm.playing);\n const activeStateMachines = playingStateMachines\n .filter((sm) => this.runtime.hasListeners(sm.instance))\n .map((sm) => sm.instance);\n let touchScrollEnabledOption = this.isTouchScrollEnabled;\n let dispatchPointerExit = this.dispatchPointerExit;\n let enableMultiTouch = this.enableMultiTouch;\n if (\n riveListenerOptions &&\n \"isTouchScrollEnabled\" in riveListenerOptions\n ) {\n touchScrollEnabledOption = riveListenerOptions.isTouchScrollEnabled;\n }\n this.eventCleanup = registerTouchInteractions({\n canvas: this.canvas,\n artboard: this.artboard,\n stateMachines: activeStateMachines,\n renderer: this.renderer,\n rive: this.runtime,\n fit: this._layout.runtimeFit(this.runtime),\n alignment: this._layout.runtimeAlignment(this.runtime),\n isTouchScrollEnabled: touchScrollEnabledOption,\n dispatchPointerExit: dispatchPointerExit,\n enableMultiTouch: enableMultiTouch,\n layoutScaleFactor: this._layout.layoutScaleFactor,\n advanceAndDrain: this.advanceAndReportChanges.bind(this)\n });\n\n // Wire up keyboard interactions for state machines that have focus nodes.\n // hasFocusNodes — unified focus tree check, gates tab traversal\n const smWithFocusNodes = playingStateMachines.filter((sm) => sm.hasFocusNodes);\n\n if (smWithFocusNodes.length) {\n // Set the canvas as a tabbable element if there are any focus nodes.\n // Prefer the tabIndex param set by the user, otherwise use 0.\n // But do not override any explicit tabIndex already set on the canvas, if any.\n const currentCanvasTabIndex = (this.canvas as HTMLCanvasElement).tabIndex;\n // By default, canvas elements have a tabIndex of -1\n if (currentCanvasTabIndex === -1 || isNaN(currentCanvasTabIndex)) {\n (this.canvas as HTMLCanvasElement).tabIndex = (this._tabIndex !== null ? this._tabIndex : 0);\n }\n if (typeof window !== \"undefined\") {\n this._keyboardInteractions = new KeyboardInteractions({\n canvas: this.canvas as HTMLCanvasElement,\n stateMachine: smWithFocusNodes[0].instance, // work off assumption of single state machine\n hasFocusNodes: true,\n });\n }\n }\n }\n }\n\n private cleanupKeyboardInteractions(): void {\n if (this._keyboardInteractions) {\n this._keyboardInteractions.cleanup();\n this._keyboardInteractions = null;\n }\n }\n\n /**\n * Remove Rive Listeners setup on the canvas\n */\n public removeRiveListeners(): void {\n if (this.eventCleanup) {\n this.eventCleanup();\n this.eventCleanup = null;\n }\n this.cleanupKeyboardInteractions();\n }\n\n /**\n * If the instance has audio and the system audio is not ready\n * we hook the instance to the audio manager\n */\n private initializeAudio() {\n // Initialize audio if needed\n if (audioManager.status == SystemAudioStatus.UNAVAILABLE) {\n if (\n this.file.hasAudio ||\n (this.artboard?.hasAudio && this._audioEventListener === null)\n ) {\n this._audioEventListener = {\n type: EventType.AudioStatusChange,\n callback: () => this.onSystemAudioChanged(),\n };\n audioManager.add(this._audioEventListener);\n audioManager.establishAudio();\n }\n }\n }\n\n private initArtboardSize() {\n if (!this.artboard) return;\n\n // Use preset values if they are not undefined\n this._artboardWidth = this.artboard.width =\n this._artboardWidth || this.artboard.width;\n this._artboardHeight = this.artboard.height =\n this._artboardHeight || this.artboard.height;\n }\n\n // Initializes runtime with Rive data and preps for playing.\n // Returns true for successful initialization.\n private async initData(\n artboardName: string,\n animationNames: string[],\n stateMachineNames: string[],\n autoplay: boolean,\n autoBind: boolean,\n ): Promise<boolean> {\n try {\n if (this.riveFile == null) {\n const riveFile = new RiveFile({\n src: this.src,\n buffer: this.buffer,\n enableRiveAssetCDN: this.enableRiveAssetCDN,\n assetLoader: this.assetLoader,\n enablePerfMarks: this.enablePerfMarks,\n });\n this.riveFile = riveFile;\n await riveFile.init();\n if (this.destroyed) {\n // In the very unlikely scenario where the rive file created by this Rive is shared by\n // another rive file, we only want to destroy it if this file is the only owner.\n riveFile.destroyIfUnused();\n return false;\n }\n }\n this.file = this.riveFile.getInstance();\n // Initialize and draw frame\n this.initArtboard(\n artboardName,\n animationNames,\n stateMachineNames,\n autoplay,\n autoBind,\n );\n\n // Initialize the artboard size\n this.initArtboardSize();\n\n // Check for audio\n this.initializeAudio();\n\n // Everything's set up, emit a load event\n try {\n this.loaded = true;\n this.eventManager.fire({\n type: EventType.Load,\n data: this.src ?? \"buffer\",\n });\n } catch (e) {\n // If any synchronous errors surface from the user-supplied onLoad callback,\n // this will console.error the error but will not invoke LoadError (onLoadError).\n // Notably, this will not interfere with Rive rendering\n console.error(e);\n }\n\n // Only initialize paused state machines after the load event has been fired\n // to allow users to initialize inputs and view models before the first advance\n this.animator.advanceIfPaused();\n\n // Flag ready for playback commands and clear the task queue; this order\n // is important or it may infinitely recurse\n this.readyForPlaying = true;\n this.taskQueue.process();\n\n this.drawFrame();\n\n return true;\n } catch (error) {\n // Invoke LoadError for errors with loading the configured Artboard + State Machine\n const msg = resolveErrorMessage(error);\n this.eventManager.fire({ type: EventType.LoadError, data: msg });\n return Promise.reject(msg);\n }\n }\n\n // Initialize for playback\n private initArtboard(\n artboardName: string,\n animationNames: string[],\n stateMachineNames: string[],\n autoplay: boolean,\n autoBind: boolean,\n ): void {\n if (!this.file) {\n return;\n }\n // Fetch the artboard\n const rootArtboard = artboardName\n ? this.file.artboardByName(artboardName)\n : this.file.defaultArtboard();\n\n // Check we have a working artboard\n if (!rootArtboard) {\n throw new RiveError(\"Invalid artboard name or no default artboard\");\n }\n\n this.artboard = rootArtboard;\n rootArtboard.volume = this._volume * audioManager.systemVolume;\n\n // Initialize the animator\n this.animator = new Animator(\n this.runtime,\n this.artboard,\n this.eventManager,\n );\n\n // Initialize the animations; as loaded hasn't happened yet, we need to\n // suppress firing the play/pause events until the load event has fired. To\n // do this we tell the animator to suppress firing events, and add event\n // firing to the task queue.\n let instanceNames: string[];\n if (animationNames.length > 0 || stateMachineNames.length > 0) {\n instanceNames = animationNames.concat(stateMachineNames);\n this.animator.initLinearAnimations(animationNames, autoplay);\n this.animator.initStateMachines(stateMachineNames, autoplay);\n } else {\n instanceNames = [this.animator.atLeastOne(autoplay, false)];\n }\n // Queue up firing the playback events\n this.taskQueue.add({\n event: {\n type: autoplay ? EventType.Play : EventType.Pause,\n data: instanceNames,\n },\n });\n\n if (autoBind) {\n const viewModel = this.file.defaultArtboardViewModel(rootArtboard);\n if (viewModel !== null) {\n const runtimeInstance = viewModel.defaultInstance();\n if (runtimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(\n runtimeInstance,\n null,\n );\n createFinalization(\n viewModelInstance,\n viewModelInstance.runtimeInstance,\n );\n this.bindViewModelInstance(viewModelInstance);\n }\n }\n }\n }\n\n // Draws the current artboard frame\n public drawFrame() {\n if (document?.timeline?.currentTime) {\n if (this.loaded && this.artboard && !this.frameRequestId) {\n this._boundDraw(document!.timeline!.currentTime as number);\n this.runtime?.resolveAnimationFrame();\n }\n } else {\n this.scheduleRendering();\n }\n }\n\n private _canvasSizeChanged(): boolean {\n let changed = false;\n if (this.canvas) {\n if (this.canvas.width !== this._currentCanvasWidth) {\n this._currentCanvasWidth = this.canvas.width;\n changed = true;\n }\n if (this.canvas.height !== this._currentCanvasHeight) {\n this._currentCanvasHeight = this.canvas.height;\n changed = true;\n }\n }\n return changed;\n }\n\n /**\n * Poll focus state each frame to see if we should focus/blur the canvas in case\n * Rive internally updated focus outside of user interaction (e.g., via listener action)\n */\n private pollFocusState() {\n if (!this._keyboardInteractions) {\n this._prevHasFocus = false;\n return;\n }\n\n const activeSm = this.animator.stateMachines.find(\n (sm) => sm.playing && sm.hasFocusNodes,\n ); // work off assumption of single state machine\n if (!activeSm) {\n this._prevHasFocus = false;\n return;\n }\n\n if (this.canvas instanceof HTMLCanvasElement) {\n const { hasFocus } = activeSm.focusState();\n if (hasFocus) {\n // Rive has an active focus node. Mark the session RiveFocused so Tab stays\n // trapped and a later internal release (hasFocus true → false) is detected.\n this._keyboardInteractions.notifyRiveFocused();\n // Only steal DOM focus on the false→true transition. If hasFocus stays\n // true across frames and the user clicks away, do not re-focus the canvas again.\n if (!this._prevHasFocus) {\n if (this.canvas !== document.activeElement && this._focusOptions.allowFocusInterrupt) {\n this.canvas.focus();\n }\n this._prevHasFocus = true;\n }\n return;\n }\n\n this._prevHasFocus = false;\n\n // hasFocus is false — only act when Rive previously held focus and released it internally\n // (state change clears focus). Release the DOM Tab trap so the next Tab moves to the next\n // page element. EntryPending and NotFocused cases are intentional no-ops — EntryPending in\n // particular must stay in its state (a click awaiting its first Tab) rather than be reset here.\n if (this._keyboardInteractions.focusSessionState === FocusSessionState.RiveFocused) {\n this._keyboardInteractions.setFocusSessionState(FocusSessionState.NotFocused);\n }\n }\n }\n\n // Tracks the last timestamp at which the animation was rendered. Used only in\n // draw().\n private lastRenderTime: number;\n\n // Tracks the current animation frame request\n private frameRequestId: number | null = null;\n\n /**\n * Used be draw to track when a second of active rendering time has passed.\n * Used for debugging purposes\n */\n private renderSecondTimer = 0;\n\n /**\n * Handles important sequence of reporting Rive events, advancing the state machine or animation, and invoking various callbacks\n * due to state changes, view model property changes, etc.\n * \n * @param elapsedTime time to advance the state machine by\n */\n private advanceAndReportChanges(elapsedTime: number): void {\n // - Advance non-paused animations by the elapsed number of seconds\n // - Advance any animations that require scrubbing\n // - Advance to the first frame even when autoplay is false\n const activeAnimations = this.animator.animations\n .filter((a) => a.playing || a.needsScrub)\n // The scrubbed animations must be applied first to prevent weird artifacts\n // if the playing animations conflict with the scrubbed animating attribuates.\n .sort((first) => (first.needsScrub ? -1 : 1));\n for (const animation of activeAnimations) {\n animation.advance(elapsedTime);\n if (animation.instance.didLoop) {\n animation.loopCount += 1;\n }\n animation.apply(1.0);\n }\n\n // - Advance non-paused state machines by the elapsed number of seconds\n // - Advance to the first frame even when autoplay is false\n const activeStateMachines = this.animator.stateMachines.filter(\n (a) => a.playing,\n );\n // Instrument the first 3 frames so the Performance timeline shows precise\n // per-call latency for advance, draw, and flush without polluting the trace.\n const _perfFrame =\n this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;\n for (const stateMachine of activeStateMachines) {\n // Check for events before the current frame's state machine advance\n const numEventsReported = stateMachine.reportedEventCount();\n if (numEventsReported) {\n for (let i = 0; i < numEventsReported; i++) {\n const event = stateMachine.reportedEventAt(i);\n\n if (event) {\n if (event.type === RiveEventType.OpenUrl) {\n this.eventManager.fire({\n type: EventType.RiveEvent,\n data: event as rc.OpenUrlEvent,\n });\n // Handle the event side effect if explicitly enabled\n if (this.automaticallyHandleEvents) {\n const newAnchorTag = document.createElement(\"a\");\n const { url, target } = event as rc.OpenUrlEvent;\n\n const sanitizedUrl = sanitizeUrl(url);\n url && newAnchorTag.setAttribute(\"href\", sanitizedUrl);\n target && newAnchorTag.setAttribute(\"target\", target);\n if (sanitizedUrl && sanitizedUrl !== BLANK_URL) {\n newAnchorTag.click();\n }\n }\n } else {\n this.eventManager.fire({\n type: EventType.RiveEvent,\n data: event as rc.RiveEvent,\n });\n }\n }\n }\n }\n if (_perfFrame >= 0) performance.mark(`rive:sm-advance:start:f${_perfFrame}`);\n stateMachine.advanceAndApply(elapsedTime);\n if (_perfFrame >= 0) {\n performance.mark(`rive:sm-advance:end:f${_perfFrame}`);\n performance.measure(`rive:sm-advance:f${_perfFrame}`, `rive:sm-advance:start:f${_perfFrame}`, `rive:sm-advance:end:f${_perfFrame}`);\n }\n }\n\n // For linear animations that have been applied to the artboard, advance it\n // by the elapsed time.\n if (this.animator.stateMachines.length == 0) {\n this.artboard.advance(elapsedTime);\n }\n\n // Check for any animations that looped\n this.animator.handleLooping();\n\n // Check for any state machines that had a state change\n this.animator.handleStateChanges();\n\n // Report advanced time\n this.animator.handleAdvancing(elapsedTime);\n\n // Poll focus state to see whether or not to blur or pull up a virtual keyboard for any change to a text input node.\n this.pollFocusState();\n\n // Handle callbacks for view model property changes\n this._viewModelInstance?.handleCallbacks();\n }\n\n /**\n * Draw rendering loop; renders animation frames at the correct time interval.\n * @param time the time at which to render a frame\n */\n private draw(time: number, onSecond?: VoidCallback): void {\n // Clear the frameRequestId, as we're now rendering a fresh frame\n this.frameRequestId = null;\n const before = performance.now();\n\n // Instrument the first 3 frames so the Performance timeline shows precise\n // per-call latency for advance, draw, and flush without polluting the trace.\n const _perfFrame =\n this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;\n\n // On the first pass, make sure lastTime has a valid value\n if (!this.lastRenderTime) {\n this.lastRenderTime = time;\n }\n\n // Handle the onSecond callback\n this.renderSecondTimer += time - this.lastRenderTime;\n if (this.renderSecondTimer > 5000) {\n this.renderSecondTimer = 0;\n onSecond?.();\n }\n\n // Calculate the elapsed time between frames in seconds\n const elapsedTime = (time - this.lastRenderTime) / 1000;\n this.lastRenderTime = time;\n\n this.advanceAndReportChanges(elapsedTime);\n\n const { renderer } = this;\n // Do not draw on 0 canvas size\n if (!this._hasZeroSize) {\n // If there was no dirt on this frame, do not clear and draw\n if (\n this.drawOptimization == DrawOptimizationOptions.AlwaysDraw ||\n this.artboard.didChange() ||\n this._needsRedraw ||\n this._canvasSizeChanged()\n ) {\n // Canvas must be wiped to prevent artifacts\n renderer.clear();\n renderer.save();\n\n // Update the renderer alignment if necessary\n if (_perfFrame >= 0) performance.mark(`rive:align-renderer:start:f${_perfFrame}`);\n this.alignRenderer();\n if (_perfFrame >= 0) {\n performance.mark(`rive:align-renderer:end:f${_perfFrame}`);\n performance.measure(`rive:align-renderer:f${_perfFrame}`, `rive:align-renderer:start:f${_perfFrame}`, `rive:align-renderer:end:f${_perfFrame}`);\n }\n\n if (_perfFrame >= 0) performance.mark(`rive:artboard-draw:start:f${_perfFrame}`);\n this.artboard.draw(renderer);\n if (_perfFrame >= 0) {\n performance.mark(`rive:artboard-draw:end:f${_perfFrame}`);\n performance.measure(`rive:artboard-draw:f${_perfFrame}`, `rive:artboard-draw:start:f${_perfFrame}`, `rive:artboard-draw:end:f${_perfFrame}`);\n }\n\n renderer.restore();\n\n if (_perfFrame >= 0) performance.mark(`rive:renderer-flush:start:f${_perfFrame}`);\n renderer.flush();\n if (_perfFrame >= 0) {\n performance.mark(`rive:renderer-flush:end:f${_perfFrame}`);\n performance.measure(`rive:renderer-flush:f${_perfFrame}`, `rive:renderer-flush:start:f${_perfFrame}`, `rive:renderer-flush:end:f${_perfFrame}`);\n }\n\n this._needsRedraw = false;\n }\n }\n\n // Add duration to create frame to durations array\n this.frameCount++;\n const after = performance.now();\n this.frameTimes.push(after);\n this.durations.push(after - before);\n while (this.frameTimes[0] <= after - 1000) {\n this.frameTimes.shift();\n this.durations.shift();\n }\n\n // Calling requestAnimationFrame will rerun draw() at the correct rate:\n // https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations\n if (this.animator.isPlaying) {\n // Request a new rendering frame\n this.scheduleRendering();\n } else if (this.animator.isPaused) {\n // Reset the end time so on playback it starts at the correct frame\n this.lastRenderTime = 0;\n } else if (this.animator.isStopped) {\n // Reset animation instances, artboard and time\n // TODO: implement this properly when we have instancing\n // this.initArtboard();\n // this.drawFrame();\n this.lastRenderTime = 0;\n }\n }\n\n /**\n * Align the renderer\n */\n private alignRenderer(): void {\n const { renderer, runtime, _layout, artboard } = this;\n // Align things up safe in the knowledge we can restore if changed\n renderer.align(\n _layout.runtimeFit(runtime),\n _layout.runtimeAlignment(runtime),\n {\n minX: _layout.minX,\n minY: _layout.minY,\n maxX: _layout.maxX,\n maxY: _layout.maxY,\n },\n artboard.bounds,\n this._devicePixelRatioUsed * _layout.layoutScaleFactor,\n );\n }\n\n public get fps() {\n return this.durations.length;\n }\n\n public get frameTime() {\n if (this.durations.length === 0) {\n return 0;\n }\n return (\n this.durations.reduce((a, b) => a + b, 0) / this.durations.length\n ).toFixed(4);\n }\n\n /**\n * Cleans up all Wasm-generated objects that need to be manually destroyed:\n * artboard instances, animation instances, state machine instances,\n * renderer instance, file and runtime.\n *\n * Once this is called, you will need to initialise a new instance of the\n * Rive class\n */\n public cleanup() {\n this.destroyed = true;\n // Stop the renderer if it hasn't already been stopped.\n this.stopRendering();\n // Make the GL context backing this renderer current before any WASM teardown\n // that frees GPU resources. Binding here covers the artboard/file deletes;\n // deleteRiveRenderer() re-binds for the renderer's own delete. No-op on the\n // canvas2d build\n this.renderer?.bindContext?.();\n // Clean up any artboard, animation or state machine instances.\n this.cleanupInstances();\n // Remove from observer\n if (this._observed !== null) {\n observers.remove(this._observed);\n }\n this.removeRiveListeners();\n if (this.file) {\n this.riveFile?.cleanup();\n this.file = null;\n }\n this.riveFile = null;\n this.deleteRiveRenderer();\n if (this._audioEventListener !== null) {\n audioManager.remove(this._audioEventListener);\n this._audioEventListener = null;\n }\n if (this._pageVisibilityHandler) {\n document.removeEventListener('visibilitychange', this._pageVisibilityHandler);\n this._pageVisibilityHandler = null;\n }\n this._viewModelInstance?.cleanup();\n this._viewModelInstance = null;\n this._dataEnums = null;\n }\n\n /**\n * Cleans up the Renderer object. Only call this API if you no longer\n * need to render Rive content in your session.\n */\n public deleteRiveRenderer() {\n this.renderer?.delete();\n this.renderer = null;\n }\n\n /**\n * Cleans up any Wasm-generated objects that need to be manually destroyed:\n * artboard instances, animation instances, state machine instances.\n *\n * Once this is called, things will need to be reinitialized or bad things\n * might happen.\n */\n public cleanupInstances() {\n if (this.eventCleanup !== null) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n // Delete all animation and state machine instances\n this.stop();\n if (this.artboard) {\n this.artboard.delete();\n this.artboard = null;\n }\n }\n\n /**\n * Tries to query the setup Artboard for a text run node with the given name.\n *\n * @param textRunName - Name of the text run node associated with a text object\n * @returns - TextValueRun node or undefined if the text run cannot be queried\n */\n private retrieveTextRun(textRunName: string): rc.TextValueRun | undefined {\n if (!textRunName) {\n console.warn(\"No text run name provided\");\n return;\n }\n if (!this.artboard) {\n console.warn(\"Tried to access text run, but the Artboard is null\");\n return;\n }\n const textRun: rc.TextValueRun = this.artboard.textRun(textRunName);\n if (!textRun) {\n console.warn(\n `Could not access a text run with name '${textRunName}' in the '${this.artboard?.name}' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime.`,\n );\n return;\n }\n return textRun;\n }\n\n /**\n * Returns a string from a given text run node name, or undefined if the text run\n * cannot be queried.\n *\n * @param textRunName - Name of the text run node associated with a text object\n * @returns - String value of the text run node or undefined\n */\n public getTextRunValue(textRunName: string): string | undefined {\n const textRun = this.retrieveTextRun(textRunName);\n return textRun ? textRun.text : undefined;\n }\n\n /**\n * Sets a text value for a given text run node name if possible\n *\n * @param textRunName - Name of the text run node associated with a text object\n * @param textRunValue - String value to set on the text run node\n */\n public setTextRunValue(textRunName: string, textRunValue: string): void {\n const textRun = this.retrieveTextRun(textRunName);\n if (textRun) {\n textRun.text = textRunValue;\n }\n }\n\n // Plays specified animations; if none specified, it unpauses everything.\n public play(animationNames?: string | string[], autoplay?: true): void {\n animationNames = mapToStringArray(animationNames);\n\n // If the file's not loaded, queue up the play\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.play(animationNames, autoplay),\n });\n return;\n }\n this.animator.play(animationNames);\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n this.setupRiveListeners();\n this.startRendering();\n }\n\n // Pauses specified animations; if none specified, pauses all.\n public pause(animationNames?: string | string[]): void {\n animationNames = mapToStringArray(animationNames);\n\n // If the file's not loaded, early out, nothing to pause\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.pause(animationNames),\n });\n return;\n }\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n this.animator.pause(animationNames);\n }\n\n public scrub(animationNames?: string | string[], value?: number): void {\n animationNames = mapToStringArray(animationNames);\n\n // If the file's not loaded, early out, nothing to pause\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.scrub(animationNames, value),\n });\n return;\n }\n\n // Scrub the animation time; we draw a single frame here so that if\n // nothing's currently playing, the scrubbed animation is still rendered/\n this.animator.scrub(animationNames, value || 0);\n this.drawFrame();\n }\n\n // Stops specified animations; if none specifies, stops them all.\n public stop(animationNames?: string | string[] | undefined): void {\n animationNames = mapToStringArray(animationNames);\n // If the file's not loaded, early out, nothing to pause\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.stop(animationNames),\n });\n return;\n }\n // If there is no artboard, this.animator will be undefined\n if (this.animator) {\n this.animator.stop(animationNames);\n }\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n }\n\n /**\n * Resets the animation\n * @param artboard the name of the artboard, or default if none given\n * @param animations the names of animations for playback\n * @param stateMachines the names of state machines for playback\n * @param autoplay whether to autoplay when reset, defaults to false\n *\n */\n public reset(params?: RiveResetParameters): void {\n // Get the current artboard, animations, state machines, and playback states\n const artBoardName = params?.artboard;\n const animationNames = mapToStringArray(params?.animations);\n const stateMachineNames = mapToStringArray(params?.stateMachines);\n const autoplay = params?.autoplay ?? false;\n const autoBind = params?.autoBind ?? false;\n\n // Stop everything and clean up\n this.cleanupInstances();\n\n // Reinitialize an artboard instance with the state\n this.initArtboard(\n artBoardName,\n animationNames,\n stateMachineNames,\n autoplay,\n autoBind,\n );\n this.taskQueue.process();\n }\n\n // Loads a new Rive file, keeping listeners in place\n public load(params: RiveLoadParameters): void {\n this.file = null;\n // Stop all animations\n this.stop();\n // Reinitialize\n this.init(params);\n }\n\n // Sets a new layout\n public set layout(layout: Layout) {\n this._layout = layout;\n // If the maxX or maxY are 0, then set them to the canvas width and height\n if (!layout.maxX || !layout.maxY) {\n this.resizeToCanvas();\n }\n if (this.loaded && !this.animator.isPlaying) {\n this.drawFrame();\n }\n }\n\n /**\n * Returns the current layout. Note that layout should be treated as\n * immutable. If you want to change the layout, create a new one use the\n * layout setter\n */\n public get layout() {\n return this._layout;\n }\n\n /**\n * Sets the layout bounds to the current canvas size; this is typically called\n * when the canvas is resized\n */\n public resizeToCanvas() {\n this._layout = this.layout.copyWith({\n minX: 0,\n minY: 0,\n maxX: this.canvas.width,\n maxY: this.canvas.height,\n });\n }\n\n /**\n * Accounts for devicePixelRatio as a multiplier to render the size of the canvas drawing surface.\n * Uses the size of the backing canvas to set new width/height attributes. Need to re-render\n * and resize the layout to match the new drawing surface afterwards.\n * Useful function for consumers to include in a window resize listener.\n *\n * This method will set the {@link devicePixelRatioUsed} property.\n *\n * Optionally, you can provide a {@link customDevicePixelRatio} to provide a\n * custom value.\n */\n public resizeDrawingSurfaceToCanvas(customDevicePixelRatio?: number) {\n if (this.canvas instanceof HTMLCanvasElement && !!window) {\n const { width, height } = this.canvas.getBoundingClientRect();\n const dpr = customDevicePixelRatio || window.devicePixelRatio || 1;\n this.devicePixelRatioUsed = dpr;\n this.canvas.width = dpr * width;\n this.canvas.height = dpr * height;\n this._needsRedraw = true;\n this.resizeToCanvas();\n this.drawFrame();\n\n if (this.layout.fit === Fit.Layout) {\n const scaleFactor = this._layout.layoutScaleFactor;\n this.artboard.width = width / scaleFactor;\n this.artboard.height = height / scaleFactor;\n }\n }\n }\n\n // Returns the animation source, which may be undefined\n public get source(): string {\n return this.src;\n }\n\n /**\n * Returns the name of the active artboard\n */\n public get activeArtboard(): string {\n return this.artboard ? this.artboard.name : \"\";\n }\n\n // Returns a list of animation names on the chosen artboard\n public get animationNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded || !this.artboard) {\n return [];\n }\n const animationNames: string[] = [];\n for (let i = 0; i < this.artboard.animationCount(); i++) {\n animationNames.push(this.artboard.animationByIndex(i).name);\n }\n return animationNames;\n }\n\n /**\n * Returns a list of state machine names from the current artboard\n */\n public get stateMachineNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded || !this.artboard) {\n return [];\n }\n const stateMachineNames: string[] = [];\n for (let i = 0; i < this.artboard.stateMachineCount(); i++) {\n stateMachineNames.push(this.artboard.stateMachineByIndex(i).name);\n }\n return stateMachineNames;\n }\n\n /**\n * Returns the inputs for the specified instanced state machine, or an empty\n * list if the name is invalid or the state machine is not instanced\n * @param name the state machine name\n * @returns the inputs for the named state machine\n */\n public stateMachineInputs(name: string): StateMachineInput[] {\n // If the file's not loaded, early out, nothing to pause\n if (!this.loaded) {\n return;\n }\n const stateMachine = this.animator.stateMachines.find(\n (m) => m.name === name,\n );\n return stateMachine?.inputs;\n }\n\n // Returns the input with the provided name at the given path\n private retrieveInputAtPath(\n name: string,\n path: string,\n ): rc.SMIInput | undefined {\n if (!name) {\n console.warn(`No input name provided for path '${path}'`);\n return;\n }\n if (!this.artboard) {\n console.warn(\n `Tried to access input: '${name}', at path: '${path}', but the Artboard is null`,\n );\n return;\n }\n const input: rc.SMIInput = this.artboard.inputByPath(name, path);\n\n if (!input) {\n console.warn(\n `Could not access an input with name: '${name}', at path:'${path}'`,\n );\n return;\n }\n return input;\n }\n\n /**\n * Set the boolean input with the provided name at the given path with value\n * @param input the state machine input name\n * @param value the value to set the input to\n * @param path the path the input is located at an artboard level\n */\n public setBooleanStateAtPath(\n inputName: string,\n value: boolean,\n path: string,\n ) {\n const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n if (!input) return;\n\n if (input.type === StateMachineInputType.Boolean) {\n input.asBool().value = value;\n } else {\n console.warn(\n `Input with name: '${inputName}', at path:'${path}' is not a boolean`,\n );\n }\n }\n\n /**\n * Set the number input with the provided name at the given path with value\n * @param input the state machine input name\n * @param value the value to set the input to\n * @param path the path the input is located at an artboard level\n */\n public setNumberStateAtPath(inputName: string, value: number, path: string) {\n const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n if (!input) return;\n\n if (input.type === StateMachineInputType.Number) {\n input.asNumber().value = value;\n } else {\n console.warn(\n `Input with name: '${inputName}', at path:'${path}' is not a number`,\n );\n }\n }\n\n /**\n * Fire the trigger with the provided name at the given path\n * @param input the state machine input name\n * @param path the path the input is located at an artboard level\n */\n public fireStateAtPath(inputName: string, path: string) {\n const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n if (!input) return;\n\n if (input.type === StateMachineInputType.Trigger) {\n input.asTrigger().fire();\n } else {\n console.warn(\n `Input with name: '${inputName}', at path:'${path}' is not a trigger`,\n );\n }\n }\n\n // Returns the TextValueRun object for the provided name at the given path\n private retrieveTextAtPath(\n name: string,\n path: string,\n ): rc.TextValueRun | undefined {\n if (!name) {\n console.warn(`No text name provided for path '${path}'`);\n return;\n }\n if (!path) {\n console.warn(`No path provided for text '${name}'`);\n return;\n }\n if (!this.artboard) {\n console.warn(\n `Tried to access text: '${name}', at path: '${path}', but the Artboard is null`,\n );\n return;\n }\n const text: rc.TextValueRun = this.artboard.textByPath(name, path);\n if (!text) {\n console.warn(\n `Could not access text with name: '${name}', at path:'${path}'`,\n );\n return;\n }\n return text;\n }\n\n /**\n * Retrieves the text value for a specified text run at a given path\n * @param textName The name of the text run\n * @param path The path to the text run within the artboard\n * @returns The text value of the text run, or undefined if not found\n *\n * @example\n * // Get the text value for a text run named \"title\" at one nested artboard deep\n * const titleText = riveInstance.getTextRunValueAtPath(\"title\", \"artboard1\");\n *\n * @example\n * // Get the text value for a text run named \"subtitle\" within a nested group two artboards deep\n * const subtitleText = riveInstance.getTextRunValueAtPath(\"subtitle\", \"group/nestedGroup\");\n *\n * @remarks\n * If the text run cannot be found at the specified path, a warning will be logged to the console.\n */\n public getTextRunValueAtPath(\n textName: string,\n path: string,\n ): string | undefined {\n const run: rc.TextValueRun = this.retrieveTextAtPath(textName, path);\n if (!run) {\n console.warn(\n `Could not get text with name: '${textName}', at path:'${path}'`,\n );\n return;\n }\n return run.text;\n }\n\n /**\n * Sets the text value for a specified text run at a given path\n * @param textName The name of the text run\n * @param value The new text value to set\n * @param path The path to the text run within the artboard\n * @returns void\n *\n * @example\n * // Set the text value for a text run named \"title\" at one nested artboard deep\n * riveInstance.setTextRunValueAtPath(\"title\", \"New Title\", \"artboard1\");\n *\n * @example\n * // Set the text value for a text run named \"subtitle\" within a nested group two artboards deep\n * riveInstance.setTextRunValueAtPath(\"subtitle\", \"New Subtitle\", \"group/nestedGroup\");\n *\n * @remarks\n * If the text run cannot be found at the specified path, a warning will be logged to the console.\n */\n public setTextRunValueAtPath(textName: string, value: string, path: string) {\n const run: rc.TextValueRun = this.retrieveTextAtPath(textName, path);\n if (!run) {\n console.warn(\n `Could not set text with name: '${textName}', at path:'${path}'`,\n );\n return;\n }\n run.text = value;\n }\n\n // Returns a list of playing machine names\n public get playingStateMachineNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.stateMachines\n .filter((m) => m.playing)\n .map((m) => m.name);\n }\n\n // Returns a list of playing animation names\n public get playingAnimationNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.animations.filter((a) => a.playing).map((a) => a.name);\n }\n\n // Returns a list of paused animation names\n public get pausedAnimationNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.animations\n .filter((a) => !a.playing)\n .map((a) => a.name);\n }\n\n /**\n * Returns a list of paused machine names\n * @returns a list of state machine names that are paused\n */\n public get pausedStateMachineNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.stateMachines\n .filter((m) => !m.playing)\n .map((m) => m.name);\n }\n\n /**\n * @returns true if any animation is playing\n */\n public get isPlaying(): boolean {\n return this.animator.isPlaying;\n }\n\n /**\n * @returns true if all instanced animations are paused\n */\n public get isPaused(): boolean {\n return this.animator.isPaused;\n }\n\n /**\n * @returns true if no animations are playing or paused\n */\n public get isStopped(): boolean {\n return this.animator?.isStopped ?? true;\n }\n\n /**\n * @returns the bounds of the current artboard, or undefined if the artboard\n * isn't loaded yet.\n */\n public get bounds(): Bounds {\n return this.artboard ? this.artboard.bounds : undefined;\n }\n\n /**\n * Subscribe to Rive-generated events\n * @param type the type of event to subscribe to\n * @param callback callback to fire when the event occurs\n */\n public on(type: EventType, callback: EventCallback) {\n this.eventManager.add({\n type: type,\n callback: callback,\n });\n }\n\n /**\n * Unsubscribes from a Rive-generated event\n * @param type the type of event to unsubscribe from\n * @param callback the callback to unsubscribe\n */\n public off(type: EventType, callback: EventCallback) {\n this.eventManager.remove({\n type: type,\n callback: callback,\n });\n }\n\n /**\n * Unsubscribes from a Rive-generated event\n * @deprecated\n * @param callback the callback to unsubscribe from\n */\n public unsubscribe(type: EventType, callback: EventCallback) {\n console.warn(\"This function is deprecated: please use `off()` instead.\");\n this.off(type, callback);\n }\n\n /**\n * Unsubscribes all Rive listeners from an event type, or everything if no type is\n * given\n * @param type the type of event to unsubscribe from, or all types if\n * undefined\n */\n public removeAllRiveEventListeners(type?: EventType) {\n this.eventManager.removeAll(type);\n }\n\n /**\n * Unsubscribes all listeners from an event type, or everything if no type is\n * given\n * @deprecated\n * @param type the type of event to unsubscribe from, or all types if\n * undefined\n */\n public unsubscribeAll(type?: EventType) {\n console.warn(\n \"This function is deprecated: please use `removeAllRiveEventListeners()` instead.\",\n );\n this.removeAllRiveEventListeners(type);\n }\n\n /**\n * Stops the rendering loop; this is different from pausing in that it doesn't\n * change the state of any animation. It stops rendering from occurring. This\n * is designed for situations such as when Rive isn't visible.\n *\n * The only way to start rendering again is to call `startRendering`.\n * Animations that are marked as playing will start from the position that\n * they would have been at if rendering had not been stopped.\n */\n public stopRendering() {\n this._explicitlyStoppedRendering = true;\n if (this.loaded && this.frameRequestId) {\n if (this.runtime.cancelAnimationFrame) {\n this.runtime.cancelAnimationFrame(this.frameRequestId);\n } else {\n cancelAnimationFrame(this.frameRequestId);\n }\n this.frameRequestId = null;\n }\n }\n\n /**\n * Starts the rendering loop if it has been previously stopped. If the\n * renderer is already active, then this will have zero effect.\n */\n public startRendering() {\n this._explicitlyStoppedRendering = false;\n this.drawFrame();\n }\n\n private scheduleRendering() {\n if (this.loaded && this.artboard && !this.frameRequestId) {\n if (this.runtime.requestAnimationFrame) {\n this.frameRequestId = this.runtime.requestAnimationFrame(\n this._boundDraw,\n );\n } else {\n this.frameRequestId = requestAnimationFrame(this._boundDraw);\n }\n }\n }\n\n /**\n * Called when document.visibilitychange fires (tab change, window minimize, etc.). \n * Cancels the rAF loop on hide and resets the time reference so that no accumulated time is\n * applied to state machines when the tab becomes visible again. This prevents state machine\n * advances with large time deltas when rAF starts up again.\n */\n private _onPageVisibilityChange(): void {\n if (document.hidden) {\n if (this.frameRequestId !== null) {\n if (this.runtime?.cancelAnimationFrame) {\n this.runtime.cancelAnimationFrame(this.frameRequestId);\n } else {\n cancelAnimationFrame(this.frameRequestId);\n }\n this.frameRequestId = null;\n }\n // Reset so the first resumed frame starts with elapsedTime === 0.\n this.lastRenderTime = 0;\n } else if (this.animator?.isPlaying && !this._explicitlyStoppedRendering) {\n this.scheduleRendering();\n }\n }\n\n /**\n * Enables frames-per-second (FPS) reporting for the runtime\n * If no callback is provided, Rive will append a fixed-position div at the top-right corner of\n * the page with the FPS reading\n * @param fpsCallback - Callback from the runtime during the RAF loop that supplies the FPS value\n */\n public enableFPSCounter(fpsCallback?: FPSCallback) {\n this.runtime.enableFPSCounter(fpsCallback);\n }\n\n /**\n * Disables frames-per-second (FPS) reporting for the runtime\n */\n public disableFPSCounter() {\n this.runtime.disableFPSCounter();\n }\n\n /**\n * Returns the contents of a Rive file: the artboards, animations, and state machines\n */\n public get contents(): RiveFileContents {\n if (!this.loaded) {\n return undefined;\n }\n const riveContents: RiveFileContents = {\n artboards: [],\n };\n for (let i = 0; i < this.file.artboardCount(); i++) {\n const artboard = this.file.artboardByIndex(i);\n const artboardContents: ArtboardContents = {\n name: artboard.name,\n animations: [],\n stateMachines: [],\n };\n for (let j = 0; j < artboard.animationCount(); j++) {\n const animation = artboard.animationByIndex(j);\n artboardContents.animations.push(animation.name);\n }\n for (let k = 0; k < artboard.stateMachineCount(); k++) {\n const stateMachine = artboard.stateMachineByIndex(k);\n const name = stateMachine.name;\n const instance = new this.runtime.StateMachineInstance(\n stateMachine,\n artboard,\n );\n const inputContents: StateMachineInputContents[] = [];\n for (let l = 0; l < instance.inputCount(); l++) {\n const input = instance.input(l);\n inputContents.push({ name: input.name, type: input.type });\n }\n artboardContents.stateMachines.push({\n name: name,\n inputs: inputContents,\n });\n }\n riveContents.artboards.push(artboardContents);\n }\n return riveContents;\n }\n\n /**\n * Getter / Setter for the volume of the artboard\n */\n public get volume(): number {\n if (this.artboard && this.artboard.volume !== this._volume) {\n this._volume = this.artboard.volume;\n }\n return this._volume;\n }\n\n public set volume(value: number) {\n this._volume = value;\n if (this.artboard) {\n this.artboard.volume = value * audioManager.systemVolume;\n }\n }\n\n /**\n * The width of the artboard.\n *\n * This will return 0 if the artboard is not loaded yet and a custom\n * width has not been set.\n *\n * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}\n * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard width is\n * automatically set.\n */\n public get artboardWidth(): number {\n if (this.artboard) {\n return this.artboard.width;\n }\n return this._artboardWidth ?? 0;\n }\n\n public set artboardWidth(value: number) {\n this._artboardWidth = value;\n if (this.artboard) {\n this.artboard.width = value;\n }\n }\n\n /**\n * The height of the artboard.\n *\n * This will return 0 if the artboard is not loaded yet and a custom\n * height has not been set.\n *\n * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}\n * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard height is\n * automatically set.\n */\n public get artboardHeight(): number {\n if (this.artboard) {\n return this.artboard.height;\n }\n return this._artboardHeight ?? 0;\n }\n\n public set artboardHeight(value: number) {\n this._artboardHeight = value;\n\n if (this.artboard) {\n this.artboard.height = value;\n }\n }\n\n /**\n * Reset the artboard size to its original values.\n */\n public resetArtboardSize() {\n if (this.artboard) {\n this.artboard.resetArtboardSize();\n this._artboardWidth = this.artboard.width;\n this._artboardHeight = this.artboard.height;\n } else {\n // If the artboard isn't loaded, we need to reset the custom width and height\n this._artboardWidth = undefined;\n this._artboardHeight = undefined;\n }\n }\n\n /**\n * The device pixel ratio used in rendering and canvas/artboard resizing.\n *\n * This value will be overidden by the device pixel ratio used in\n * {@link resizeDrawingSurfaceToCanvas}. If you use that method, do not set this value.\n */\n public get devicePixelRatioUsed(): number {\n return this._devicePixelRatioUsed;\n }\n\n public set devicePixelRatioUsed(value: number) {\n this._devicePixelRatioUsed = value;\n }\n\n /**\n * Initialize the data context with the view model instance.\n */\n public bindViewModelInstance(viewModelInstance: ViewModelInstance | null) {\n if (this.artboard && !this.destroyed) {\n if (viewModelInstance && viewModelInstance.runtimeInstance) {\n viewModelInstance.internalIncrementReferenceCount();\n this._viewModelInstance?.cleanup();\n this._viewModelInstance = viewModelInstance;\n if (this.animator.stateMachines.length > 0) {\n this.animator.stateMachines.forEach((stateMachine) =>\n stateMachine.bindViewModelInstance(viewModelInstance),\n );\n } else {\n this.artboard.bindViewModelInstance(\n viewModelInstance.runtimeInstance,\n );\n }\n }\n }\n }\n\n public get viewModelInstance(): ViewModelInstance | null {\n return this._viewModelInstance;\n }\n\n public viewModelByIndex(index: number): ViewModel | null {\n const viewModel = this.file.viewModelByIndex(index);\n if (viewModel !== null) {\n return new ViewModel(viewModel);\n }\n return null;\n }\n\n public viewModelByName(name: string): ViewModel | null {\n return this.riveFile?.viewModelByName(name);\n }\n\n public enums(): DataEnum[] {\n if (this._dataEnums === null) {\n const dataEnums = this.file.enums();\n this._dataEnums = dataEnums.map((dataEnum) => {\n return new DataEnum(dataEnum);\n });\n }\n return this._dataEnums;\n }\n\n public defaultViewModel(): ViewModel | null {\n if (this.artboard) {\n const viewModel = this.file.defaultArtboardViewModel(this.artboard);\n if (viewModel) {\n return new ViewModel(viewModel);\n }\n }\n return null;\n }\n\n /**\n * @deprecated This function is deprecated. For better stability and memory management\n * use `getBindableArtboard()` instead.\n * @param {string} name - The name of the artboard.\n * @returns {Artboard} The artboard to bind to.\n */\n public getArtboard(name: string): Artboard | null {\n return this.riveFile?.getArtboard(name) ?? null;\n }\n\n public getBindableArtboard(name: string): BindableArtboard | null {\n return this.riveFile?.getBindableArtboard(name) ?? null;\n }\n\n public getDefaultBindableArtboard(): BindableArtboard | null {\n return this.riveFile?.getDefaultBindableArtboard() ?? null;\n }\n\n /**\n * Clear focus applicable to active state machines with focus nodes. Useful if users want to\n * reset focus state and behavior within the Rive graphic at any point (i.e. blurring off the canvas)\n */\n public clearFocus(): void {\n const playingStateMachines = this.animator.stateMachines.filter((sm) => sm.playing && sm.hasFocusNodes);\n playingStateMachines.forEach((sm) => sm.clearFocus());\n }\n\n}\n\nexport enum DataType {\n none = 'none',\n string = 'string',\n number = 'number',\n boolean = 'boolean',\n color = 'color',\n list = 'list',\n enumType = 'enumType',\n trigger = 'trigger',\n viewModel = 'viewModel',\n integer = 'integer',\n listIndex = 'listIndex',\n image = 'image',\n artboard = 'artboard',\n}\n\nexport class ViewModel {\n private _viewModel: rc.ViewModel;\n\n constructor(viewModel: rc.ViewModel) {\n this._viewModel = viewModel;\n }\n\n public get instanceCount(): number {\n return this._viewModel.instanceCount;\n }\n\n public get name(): string {\n return this._viewModel.name;\n }\n\n public instanceByIndex(index: number): ViewModelInstance | null {\n const instance = this._viewModel.instanceByIndex(index);\n if (instance !== null) {\n const viewModelInstance = new ViewModelInstance(instance, null);\n createFinalization(viewModelInstance, instance);\n return viewModelInstance;\n }\n return null;\n }\n\n public instanceByName(name: string): ViewModelInstance | null {\n const instance = this._viewModel.instanceByName(name);\n if (instance !== null) {\n const viewModelInstance = new ViewModelInstance(instance, null);\n createFinalization(viewModelInstance, instance);\n return viewModelInstance;\n }\n return null;\n }\n\n public defaultInstance(): ViewModelInstance | null {\n const runtimeInstance = this._viewModel.defaultInstance();\n if (runtimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n createFinalization(viewModelInstance, runtimeInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n public instance(): ViewModelInstance {\n const runtimeInstance = this._viewModel.instance();\n if (runtimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n createFinalization(viewModelInstance, runtimeInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n public get properties(): rc.ViewModelProperty[] {\n return this._viewModel.getProperties();\n }\n\n public get instanceNames(): string[] {\n return this._viewModel.getInstanceNames();\n }\n}\n\nexport class DataEnum {\n private _dataEnum: rc.DataEnum;\n\n constructor(dataEnum: rc.DataEnum) {\n this._dataEnum = dataEnum;\n }\n\n public get name(): string {\n return this._dataEnum.name;\n }\n\n public get values(): string[] {\n return this._dataEnum.values;\n }\n}\n\nenum PropertyType {\n Number = \"number\",\n String = \"string\",\n Boolean = \"boolean\",\n Color = \"color\",\n Trigger = \"trigger\",\n Enum = \"enum\",\n List = \"list\",\n Image = \"image\",\n Artboard = \"artboard\",\n}\n\nexport class ViewModelInstance {\n private _runtimeInstance: rc.ViewModelInstance | null;\n\n private _parents: ViewModelInstance[] = [];\n\n private _children: ViewModelInstance[] = [];\n\n private _viewModelInstances: Map<string, ViewModelInstance> = new Map();\n\n private _propertiesWithCallbacks: ViewModelInstanceValue[] = [];\n\n private _referenceCount = 0;\n\n public selfUnref: boolean = false;\n\n constructor(\n runtimeInstance: rc.ViewModelInstance,\n parent: ViewModelInstance | null,\n ) {\n this._runtimeInstance = runtimeInstance;\n if (parent !== null) {\n this._parents.push(parent);\n }\n }\n\n public get runtimeInstance(): rc.ViewModelInstance | null {\n return this._runtimeInstance;\n }\n\n public get nativeInstance(): rc.ViewModelInstance | null {\n return this._runtimeInstance;\n }\n\n public handleCallbacks() {\n if (this._propertiesWithCallbacks.length !== 0) {\n this._propertiesWithCallbacks.forEach((property) => {\n property.handleCallbacks();\n });\n this._propertiesWithCallbacks.forEach((property) => {\n property.clearChanges();\n });\n }\n this._children.forEach((child) => child.handleCallbacks());\n }\n\n public addParent(parent: ViewModelInstance) {\n if (!this._parents.includes(parent)) {\n this._parents.push(parent);\n if (\n this._propertiesWithCallbacks.length > 0 ||\n this._children.length > 0\n ) {\n parent.addToViewModelCallbacks(this);\n }\n }\n }\n\n public removeParent(parent: ViewModelInstance) {\n const index = this._parents.indexOf(parent);\n if (index !== -1) {\n const parent = this._parents[index];\n parent.removeFromViewModelCallbacks(this);\n this._parents.splice(index, 1);\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public addToPropertyCallbacks(property: ViewModelInstanceValue) {\n if (!this._propertiesWithCallbacks.includes(property)) {\n this._propertiesWithCallbacks.push(property);\n if (this._propertiesWithCallbacks.length > 0) {\n this._parents.forEach((parent) => {\n parent.addToViewModelCallbacks(this);\n });\n }\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public removeFromPropertyCallbacks(property: ViewModelInstanceValue) {\n if (this._propertiesWithCallbacks.includes(property)) {\n this._propertiesWithCallbacks = this._propertiesWithCallbacks.filter(\n (prop) => prop !== property,\n );\n if (\n this._children.length === 0 &&\n this._propertiesWithCallbacks.length === 0\n ) {\n this._parents.forEach((parent) => {\n parent.removeFromViewModelCallbacks(this);\n });\n }\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public addToViewModelCallbacks(instance: ViewModelInstance) {\n if (!this._children.includes(instance)) {\n this._children.push(instance);\n this._parents.forEach((parent) => {\n parent.addToViewModelCallbacks(this);\n });\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public removeFromViewModelCallbacks(instance: ViewModelInstance) {\n if (this._children.includes(instance)) {\n this._children = this._children.filter((child) => child !== instance);\n if (\n this._children.length === 0 &&\n this._propertiesWithCallbacks.length === 0\n ) {\n this._parents.forEach((parent) => {\n parent.removeFromViewModelCallbacks(this);\n });\n }\n }\n }\n\n private clearCallbacks() {\n this._propertiesWithCallbacks.forEach((property) => {\n property.clearCallbacks();\n });\n }\n\n private propertyFromPath(\n path: string,\n type: PropertyType,\n ): ViewModelInstanceValue | null {\n const pathSegments = path.split(\"/\");\n return this.propertyFromPathSegments(pathSegments, 0, type);\n }\n\n private viewModelFromPathSegments(\n pathSegments: string[],\n index: number,\n ): ViewModelInstance | null {\n const viewModelInstance = this.internalViewModelInstance(\n pathSegments[index],\n );\n if (viewModelInstance !== null) {\n if (index == pathSegments.length - 1) {\n return viewModelInstance;\n } else {\n return viewModelInstance.viewModelFromPathSegments(\n pathSegments,\n index++,\n );\n }\n }\n return null;\n }\n\n private propertyFromPathSegments(\n pathSegments: string[],\n index: number,\n type: PropertyType,\n ): ViewModelInstanceValue | null {\n if (index < pathSegments.length - 1) {\n const viewModelInstance = this.internalViewModelInstance(\n pathSegments[index],\n );\n if (viewModelInstance !== null) {\n return viewModelInstance.propertyFromPathSegments(\n pathSegments,\n index + 1,\n type,\n );\n } else {\n return null;\n }\n }\n let instance: rc.ViewModelInstanceValue | null = null;\n switch (type) {\n case PropertyType.Number:\n instance = this._runtimeInstance?.number(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceNumber(\n instance as rc.ViewModelInstanceNumber,\n this,\n );\n }\n break;\n case PropertyType.String:\n instance = this._runtimeInstance?.string(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceString(\n instance as rc.ViewModelInstanceString,\n this,\n );\n }\n break;\n case PropertyType.Boolean:\n instance = this._runtimeInstance?.boolean(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceBoolean(\n instance as rc.ViewModelInstanceBoolean,\n this,\n );\n }\n break;\n case PropertyType.Color:\n instance = this._runtimeInstance?.color(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceColor(\n instance as rc.ViewModelInstanceColor,\n this,\n );\n }\n break;\n case PropertyType.Trigger:\n instance = this._runtimeInstance?.trigger(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceTrigger(\n instance as rc.ViewModelInstanceTrigger,\n this,\n );\n }\n break;\n case PropertyType.Enum:\n instance = this._runtimeInstance?.enum(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceEnum(\n instance as rc.ViewModelInstanceEnum,\n this,\n );\n }\n break;\n case PropertyType.List:\n instance = this._runtimeInstance?.list(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceList(\n instance as rc.ViewModelInstanceList,\n this,\n );\n }\n break;\n case PropertyType.Image:\n instance = this._runtimeInstance?.image(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceAssetImage(\n instance as rc.ViewModelInstanceAssetImage,\n this,\n );\n }\n break;\n case PropertyType.Artboard:\n instance = this._runtimeInstance?.artboard(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceArtboard(\n instance as rc.ViewModelInstanceArtboard,\n this,\n );\n }\n break;\n }\n return null;\n }\n\n private internalViewModelInstance(name: string): ViewModelInstance | null {\n if (this._viewModelInstances.has(name)) {\n return this._viewModelInstances.get(name)!;\n }\n const viewModelRuntimeInstance = this._runtimeInstance?.viewModel(name);\n if (viewModelRuntimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(\n viewModelRuntimeInstance!,\n this,\n );\n createFinalization(viewModelInstance, viewModelRuntimeInstance);\n viewModelInstance.internalIncrementReferenceCount();\n this._viewModelInstances.set(name, viewModelInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n /**\n * method to access a property instance of type number belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the number property\n */\n public number(path: string): ViewModelInstanceNumber | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Number,\n );\n return viewmodelInstanceValue as ViewModelInstanceNumber;\n }\n\n /**\n * method to access a property instance of type string belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the string property\n */\n public string(path: string): ViewModelInstanceString | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.String,\n );\n return viewmodelInstanceValue as ViewModelInstanceString | null;\n }\n\n /**\n * method to access a property instance of type boolean belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the boolean property\n */\n public boolean(path: string): ViewModelInstanceBoolean | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Boolean,\n );\n return viewmodelInstanceValue as ViewModelInstanceBoolean | null;\n }\n\n /**\n * method to access a property instance of type color belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the ttrigger property\n */\n public color(path: string): ViewModelInstanceColor | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Color,\n );\n return viewmodelInstanceValue as ViewModelInstanceColor | null;\n }\n\n /**\n * method to access a property instance of type trigger belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the trigger property\n */\n public trigger(path: string): ViewModelInstanceTrigger | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Trigger,\n );\n return viewmodelInstanceValue as ViewModelInstanceTrigger | null;\n }\n\n /**\n * method to access a property instance of type enum belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the enum property\n */\n public enum(path: string): ViewModelInstanceEnum | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Enum,\n );\n return viewmodelInstanceValue as ViewModelInstanceEnum | null;\n }\n\n /**\n * method to access a property instance of type list belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the list property\n */\n public list(path: string): ViewModelInstanceList | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.List,\n );\n return viewmodelInstanceValue as ViewModelInstanceList | null;\n }\n\n /**\n * method to access a view model property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the image property\n */\n public image(path: string): ViewModelInstanceAssetImage | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Image,\n );\n return viewmodelInstanceValue as ViewModelInstanceAssetImage | null;\n }\n\n /**\n * method to access an artboard property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the image property\n */\n public artboard(path: string): ViewModelInstanceArtboard | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Artboard,\n );\n return viewmodelInstanceValue as ViewModelInstanceArtboard | null;\n }\n\n /**\n * method to access a view model property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the view model property\n */\n public viewModel(path: string): ViewModelInstance | null {\n const pathSegments = path.split(\"/\");\n const parentViewModelInstance =\n pathSegments.length > 1\n ? this.viewModelFromPathSegments(\n pathSegments.slice(0, pathSegments.length - 1),\n 0,\n )\n : this;\n if (parentViewModelInstance != null) {\n return parentViewModelInstance.internalViewModelInstance(\n pathSegments[pathSegments.length - 1],\n );\n }\n return null;\n }\n\n public internalReplaceViewModel(\n name: string,\n value: ViewModelInstance,\n ): boolean {\n if (value.runtimeInstance !== null) {\n const result =\n this._runtimeInstance?.replaceViewModel(name, value.runtimeInstance!) ||\n false;\n if (result) {\n value.internalIncrementReferenceCount();\n const oldInstance = this.internalViewModelInstance(name);\n if (oldInstance !== null) {\n oldInstance.removeParent(this);\n if (this._children.includes(oldInstance)) {\n this._children = this._children.filter(\n (child) => child !== oldInstance,\n );\n }\n oldInstance.cleanup();\n }\n this._viewModelInstances.set(name, value);\n value.addParent(this);\n }\n return result;\n }\n return false;\n }\n\n /**\n * method to replace a view model property with another view model value\n * @param path - path to the view model property\n * @param value - view model that will replace the original\n */\n public replaceViewModel(path: string, value: ViewModelInstance): boolean {\n const pathSegments = path.split(\"/\");\n const viewModelInstance =\n pathSegments.length > 1\n ? this.viewModelFromPathSegments(\n pathSegments.slice(0, pathSegments.length - 1),\n 0,\n )\n : this;\n return (\n viewModelInstance?.internalReplaceViewModel(\n pathSegments[pathSegments.length - 1],\n value,\n ) ?? false\n );\n }\n\n /*\n * method to add one to the reference counter of the instance.\n * Use if the file owning the reference is destroyed but the instance needs to stay around\n */\n public incrementReferenceCount() {\n this._referenceCount++;\n this._runtimeInstance?.incrementReferenceCount();\n }\n\n /*\n * method to subtract one to the reference counter of the instance.\n * Use if incrementReferenceCount has been called\n */\n public decrementReferenceCount() {\n this._referenceCount--;\n this._runtimeInstance?.decrementReferenceCount();\n }\n\n public get properties(): rc.ViewModelProperty[] {\n return (\n this._runtimeInstance?.getProperties().map((prop) => ({ ...prop })) || []\n );\n }\n\n /**\n * Get the name of the ViewModel definition this instance was created from.\n */\n public get viewModelName(): string {\n return this._runtimeInstance?.getViewModelName() ?? \"\";\n }\n\n public internalIncrementReferenceCount() {\n this._referenceCount++;\n }\n\n public cleanup() {\n this._referenceCount--;\n if (this._referenceCount <= 0) {\n if (this.selfUnref) {\n this._runtimeInstance?.unref();\n }\n this._runtimeInstance = null;\n this.clearCallbacks();\n this._propertiesWithCallbacks = [];\n this._viewModelInstances.forEach((value) => {\n value.cleanup();\n });\n this._viewModelInstances.clear();\n const children = [...this._children];\n this._children.length = 0;\n const parents = [...this._parents];\n this._parents.length = 0;\n children.forEach((child) => {\n child.removeParent(this);\n });\n parents.forEach((parent) => {\n parent.removeFromViewModelCallbacks(this);\n });\n }\n }\n}\n\nexport class ViewModelInstanceValue {\n protected _parentViewModel: ViewModelInstance;\n protected callbacks: EventCallback[] = [];\n protected _viewModelInstanceValue: rc.ViewModelInstanceValue;\n constructor(instance: rc.ViewModelInstanceValue, parent: ViewModelInstance) {\n this._viewModelInstanceValue = instance;\n this._parentViewModel = parent;\n }\n\n public on(callback: EventCallback) {\n // Since we don't clean the changed flag for properties that don't have listeners,\n // we clean it the first time we add a listener to it\n if (this.callbacks.length === 0) {\n this._viewModelInstanceValue.clearChanges();\n }\n if (!this.callbacks.includes(callback)) {\n this.callbacks.push(callback);\n this._parentViewModel.addToPropertyCallbacks(this);\n }\n }\n public off(callback?: EventCallback) {\n if (!callback) {\n this.callbacks.length = 0;\n } else {\n this.callbacks = this.callbacks.filter((cb) => cb !== callback);\n }\n if (this.callbacks.length === 0) {\n this._parentViewModel.removeFromPropertyCallbacks(this);\n }\n }\n public internalHandleCallback(callback: Function) {}\n\n public handleCallbacks() {\n if (this._viewModelInstanceValue.hasChanged) {\n this.callbacks.forEach((callback) => {\n this.internalHandleCallback(callback);\n });\n }\n }\n\n public clearChanges() {\n this._viewModelInstanceValue.clearChanges();\n }\n\n public clearCallbacks() {\n this.callbacks.length = 0;\n }\n\n public get name() {\n return this._viewModelInstanceValue.name;\n }\n}\n\nexport class ViewModelInstanceString extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceString, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): string {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceString).value;\n }\n\n public set value(val: string) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceString).value = val;\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceNumber extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceNumber, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceNumber).value;\n }\n\n public set value(val: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceNumber).value = val;\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceBoolean extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceBoolean,\n parent: ViewModelInstance,\n ) {\n super(instance, parent);\n }\n\n public get value(): boolean {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceBoolean).value;\n }\n\n public set value(val: boolean) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceBoolean).value = val;\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceTrigger extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceTrigger,\n parent: ViewModelInstance,\n ) {\n super(instance, parent);\n }\n\n public trigger(): void {\n return (\n this._viewModelInstanceValue as rc.ViewModelInstanceTrigger\n ).trigger();\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceEnum extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceEnum, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): string {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).value;\n }\n\n public set value(val: string) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).value = val;\n }\n\n public set valueIndex(val: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).valueIndex = val;\n }\n\n public get valueIndex(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum)\n .valueIndex;\n }\n\n public get values(): string[] {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).values;\n }\n\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceList extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceList, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get length(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceList).size;\n }\n\n public addInstance(instance: ViewModelInstance) {\n if (instance.runtimeInstance != null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).addInstance(\n instance.runtimeInstance!,\n );\n instance.addParent(this._parentViewModel);\n }\n }\n\n public addInstanceAt(instance: ViewModelInstance, index: number): boolean {\n if (instance.runtimeInstance != null) {\n if (\n (\n this._viewModelInstanceValue as rc.ViewModelInstanceList\n ).addInstanceAt(instance.runtimeInstance!, index)\n ) {\n instance.addParent(this._parentViewModel);\n return true;\n }\n }\n return false;\n }\n\n public removeInstance(instance: ViewModelInstance) {\n if (instance.runtimeInstance != null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).removeInstance(\n instance.runtimeInstance!,\n );\n instance.removeParent(this._parentViewModel);\n }\n }\n\n public removeInstanceAt(index: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).removeInstanceAt(\n index,\n );\n }\n\n public instanceAt(index: number): ViewModelInstance | null {\n const runtimeInstance = (\n this._viewModelInstanceValue as rc.ViewModelInstanceList\n ).instanceAt(index);\n if (runtimeInstance != null) {\n const viewModelInstance = new ViewModelInstance(\n runtimeInstance,\n this._parentViewModel,\n );\n createFinalization(viewModelInstance, runtimeInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n public swap(a: number, b: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).swap(a, b);\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceColor extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceColor, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceColor).value;\n }\n\n public set value(val: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).value = val;\n }\n\n public rgb(r: number, g: number, b: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).rgb(r, g, b);\n }\n\n public rgba(r: number, g: number, b: number, a: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).argb(\n a,\n r,\n g,\n b,\n );\n }\n\n public argb(a: number, r: number, g: number, b: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).argb(\n a,\n r,\n g,\n b,\n );\n }\n\n // Value 0 to 255\n public alpha(a: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).alpha(a);\n }\n\n // Value 0 to 1\n public opacity(o: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).alpha(\n Math.round(Math.max(0, Math.min(1, o)) * 255),\n );\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceAssetImage extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceAssetImage,\n root: ViewModelInstance,\n ) {\n super(instance, root);\n }\n\n public set value(image: rc.Image | null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceAssetImage).value(\n image?.nativeImage ?? null,\n );\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceArtboard extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceArtboard, root: ViewModelInstance) {\n super(instance, root);\n }\n\n public set value(artboard: BaseArtboard | null) {\n let bindableArtboard: BindableArtboard;\n if (artboard.isBindableArtboard) {\n bindableArtboard = artboard as BindableArtboard;\n } else {\n bindableArtboard = (\n artboard as Artboard\n ).file.internalBindableArtboardFromArtboard(\n (artboard as Artboard).nativeArtboard,\n );\n }\n (this._viewModelInstanceValue as rc.ViewModelInstanceArtboard).value(\n bindableArtboard?.nativeArtboard ?? null,\n );\n if (bindableArtboard?.nativeViewModel) {\n (\n this._viewModelInstanceValue as rc.ViewModelInstanceArtboard\n ).viewModelInstance(bindableArtboard?.nativeViewModel ?? null);\n }\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\n/**\n * Contents of a state machine input\n */\ninterface StateMachineInputContents {\n name: string;\n type: StateMachineInputType;\n initialValue?: boolean | number;\n}\n\n/**\n * Contents of a state machine\n */\ninterface StateMachineContents {\n name: string;\n inputs: StateMachineInputContents[];\n}\n\n/**\n * Contents of an artboard\n */\ninterface ArtboardContents {\n animations: string[];\n stateMachines: StateMachineContents[];\n name: string;\n}\n\n/**\n * contents of a Rive file\n */\ninterface RiveFileContents {\n artboards?: ArtboardContents[];\n}\n\n// Loads Rive data from a URI via fetch.\nconst loadRiveFile = async (src: string): Promise<ArrayBuffer> => {\n const req = new Request(src);\n const res = await fetch(req);\n if (!res.ok) {\n throw new Error(`Failed to fetch the Rive file: HTTP ${res.status}`);\n }\n const buffer = await res.arrayBuffer();\n return buffer;\n};\n\n// #endregion\n\n// #region utility functions\n\n/*\n * Utility function to ensure an object is a string array\n */\nconst mapToStringArray = (obj?: string[] | string | undefined): string[] => {\n if (typeof obj === \"string\") {\n return [obj];\n } else if (obj instanceof Array) {\n return obj;\n }\n // If obj is undefined, return empty array\n return [];\n};\n\n// #endregion\n\n// #region testing utilities\n\n// Exports to only be used for tests\nexport const Testing = {\n EventManager: EventManager,\n TaskQueueManager: TaskQueueManager,\n};\n\n// #endregion\n\n// #region asset loaders\n\n/**\n * Decodes bytes into an audio asset.\n *\n * Be sure to call `.unref()` on the audio once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeAudio = async (bytes: Uint8Array): Promise<AudioWrapper> => {\n const decodedPromise = new Promise<rc.Audio>((resolve) =>\n RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n rive.decodeAudio(bytes, resolve);\n }),\n );\n const audio: rc.Audio = await decodedPromise;\n const audioWrapper = new AudioWrapper(audio);\n finalizationRegistry.register(audioWrapper, audio);\n return audioWrapper;\n};\n\n/**\n * Decodes bytes into an image.\n *\n * Be sure to call `.unref()` on the image once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeImage = async (bytes: Uint8Array): Promise<ImageWrapper> => {\n const decodedPromise = new Promise<rc.Image>((resolve) =>\n RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n rive.decodeImage(bytes, resolve);\n }),\n );\n const image: rc.Image = await decodedPromise;\n const imageWrapper = new ImageWrapper(image);\n finalizationRegistry.register(imageWrapper, image);\n return imageWrapper;\n};\n\n/**\n * Decodes bytes into a font.\n *\n * Be sure to call `.unref()` on the font once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeFont = async (bytes: Uint8Array): Promise<FontWrapper> => {\n const decodedPromise = new Promise<rc.Font>((resolve) =>\n RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n rive.decodeFont(bytes, resolve);\n }),\n );\n const font: rc.Font = await decodedPromise;\n const fontWrapper = new FontWrapper(font);\n finalizationRegistry.register(fontWrapper, font);\n return fontWrapper;\n};\n\n// #endregion\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"rive.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;ACVwC;;;;;;;;;;;ACOxC;;;;;;;;;;GAUG;AACH;IAUE;;;;;OAKG;IACH,mBACU,SAA0B,EAC1B,QAAkB,EAC1B,OAAmB,EACZ,OAAgB;QAHf,cAAS,GAAT,SAAS,CAAiB;QAC1B,aAAQ,GAAR,QAAQ,CAAU;QAEnB,YAAO,GAAP,OAAO,CAAS;QAnBlB,cAAS,GAAG,CAAC,CAAC;QAGrB;;;WAGG;QACI,YAAO,GAAkB,IAAI,CAAC;QAcnC,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO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ACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,sBAAsB,eAAe;AACpG;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG,EAAE;AACL,yDAAyD;AACzD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,GAAG,EAAE;AACL,mEAAmE;AACnE;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,YAAY;AACZ;AACA,OAAO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO,EAAE;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,oCAAoC,mCAAmC,yCAAyC,kCAAkC,+BAA+B,8BAA8B,+EAA+E,mBAAmB;AACpW,qDAAqD,0CAA0C,kCAAkC,+BAA+B,0DAA0D,mBAAmB;AAC7O;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,sBAAsB,UAAU,IAAI;AACzF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,8CAA8C,kBAAkB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,qCAAqC;AAC1C;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG,EAAE,sCAAsC;AAC3C;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH,cAAc;AACd,GAAG;AACH,cAAc;AACd,GAAG;AACH,oBAAoB,iBAAiB;AACrC,GAAG;AACH,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,2JAA2J;AACzK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA,GAAG,EAAE;AACL;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,EAAE;AACP;AACA;AACA,YAAY,IAAI;AAChB;AACA,qBAAqB;AACrB;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,kBAAkB;AAClB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,gBAAgB,0BAA0B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA,GAAG;AACH;AACA;AACA;AACA,+IAA+I,0BAA0B;AACzK,yCAAyC,EAAE;AAC3C;AACA;AACA,GAAG;AACH;AACA;AACA,SAAS,aAAa;AACtB;AACA;AACA,CAAC,mDAAmD,QAAQ;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,oDAAoD,UAAU,IAAI,aAAa;AAC/E;AACA;AACA,CAAC;AACD,mBAAmB,KAAK;AACxB;AACA;AACA;AACA,CAAC;AACD,SAAS,UAAU;AACnB;AACA;AACA;AACA;AACA,CAAC,aAAa;AACd;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,CAAC,SAAS;AACV;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,iBAAiB,GAAG,mBAAmB,MAAM;AAC7C;AACA;AACA,CAAC;AACD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,8BAA8B,GAAG,sBAAsB,EAAE;AACzD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,2BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV,SAAS,SAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,wBAAwB;AACxB;AACA;AACA,yBAAyB,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA,yCAAyC,EAAE;AAC3C;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,EAAE,gDAAgD,SAAS,sBAAsB,OAAO;AACzH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,kDAAkD,EAAE;AACpD;AACA;AACA;AACA,yGAAyG,EAAE;AAC3G;AACA;AACA,IAAI;AACJ;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kCAAkC,EAAE;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ;AACjB;AACA,kDAAkD,OAAO,uBAAuB,OAAO;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA,gCAAgC,MAAM,SAAS,UAAU;AACzD;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,MAAM,SAAS,UAAU;AACzD;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA,mDAAmD,iCAAiC,oBAAoB,UAAU;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,yDAAyD,iCAAiC,oBAAoB,UAAU;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA,gCAAgC,MAAM,SAAS,UAAU;AACzD;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA,mDAAmD,YAAY,oBAAoB,UAAU;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,2DAA2D,EAAE,IAAI,EAAE;AACnE;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE;AACpB;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,GAAG,cAAc,UAAU,sBAAsB,EAAE;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA,mBAAmB,GAAG,uBAAuB,EAAE;AAC/C;AACA;AACA,mBAAmB,GAAG,mCAAmC,mBAAmB;AAC5E;AACA;AACA,yDAAyD,GAAG;AAC5D;AACA;AACA,CAAC;AACD;AACA,CAAC,QAAQ;AACT;AACA;AACA;AACA,CAAC,iFAAiF;AAClF;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,oDAAoD,EAAE,KAAK,EAAE;AAC7D;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,EAAE,KAAK,EAAE;AAC3D;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,EAAE,KAAK,EAAE;AAC7D;AACA,CAAC;AACD;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,yBAAyB,cAAc;AACvC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA,CAAC;AACD,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,yBAAyB,cAAc;AACvC;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD,gCAAgC,OAAO;AACvC;AACA;AACA;AACA,CAAC,iCAAiC;AAClC;AACA,aAAa,kOAAkO;AAC/O;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG,KAAK;AAC1B;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,aAAa;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,MAAM;AACrE;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH,2BAA2B,cAAc;AACzC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,IAAI;AACtB;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,sBAAsB,GAAG,OAAO,yDAAyD,GAAG;AAC5F;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH,6BAA6B;AAC7B;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,kCAAkC,6BAA6B,kBAAkB,aAAa;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,uBAAuB,eAAe,UAAU;AACzG,CAAC,EAAE;AACH;AACA,UAAU;AACV;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,GAAG;AACjD;AACA,KAAK;AACL,6CAA6C,QAAQ;AACrD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,GAAG,SAAS;AAC/C;AACA;AACA;AACA;AACA,4DAA4D,EAAE;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,gEAAgE,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL,aAAa;AACb,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kDAAkD;AACvD,GAAG;AACH,CAAC;AACD,CAAC;AACD;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG,UAAU;AACb,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,GAAG;AAC9B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,GAAG,qCAAqC,SAAS,gBAAgB,4BAA4B;AAC5I;AACA;AACA,KAAK;AACL,8BAA8B,aAAa,QAAQ,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,GAAG;AAC3B;AACA;AACA,eAAe,OAAO,GAAG,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,eAAe,OAAO,GAAG,EAAE,QAAQ;AACnC,0BAA0B,GAAG;AAC7B,KAAK;AACL;AACA,0BAA0B,GAAG;AAC7B,MAAM;AACN,qBAAqB,GAAG;AACxB;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA,gGAAgG,MAAM,eAAe,OAAO;AAC5H;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,GAAG;AAC3B;AACA;AACA,eAAe,OAAO,GAAG,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,eAAe,OAAO,GAAG,EAAE,QAAQ;AACnC,0BAA0B,GAAG;AAC7B,KAAK;AACL,0CAA0C,GAAG;AAC7C;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG,4FAA4F;AAC/F;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA8C,OAAO,QAAQ,eAAe,YAAY,OAAO,GAAG,EAAE;AACpG,GAAG,EAAE,EAAE;AACP;AACA;AACA,CAAC;AACD;AACA,SAAS,8GAA8G;AACvH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,sBAAsB,GAAG;AACzB,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,SAAS,wGAAwG;AACjH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,kEAAkE,GAAG,OAAO;AACrF,CAAC;AACD;AACA;AACA,SAAS;AACT;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG,EAAE;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,SAAS;AACT,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,+DAA+D,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,IAAI;AACJ,CAAC;AACD,WAAW;AACX,CAAC;AACD,iBAAiB,yDAAyD;AAC1E,CAAC;AACD;AACA,SAAS;AACT,GAAG;AACH,GAAG,EAAE;AACL,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,uBAAuB,8BAA8B,OAAO,OAAO;AACnE;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC,iGAAiG;AAClG;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD,yBAAyB,OAAO;AAChC;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,+DAA+D,EAAE;AAC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UAAC,IAAmB;wBAC5C,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAClC,CAAC,CAAC;gBAFF,CAEE,CACH,CAAC;gBACoB,qBAAM,cAAc;;gBAApC,IAAI,GAAY,SAAoB;gBACpC,WAAW,GAAG,IAAI,+CAAW,CAAC,IAAI,CAAC,CAAC;gBAC1C,wDAAoB,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBACjD,sBAAO,WAAW,EAAC;;;KACpB,CAAC;AAEF,aAAa","sources":["webpack://rive/webpack/universalModuleDefinition","webpack://rive/./src/animation/index.ts","webpack://rive/./src/animation/Animation.ts","webpack://rive/./src/runtimeLoader.ts","webpack://rive/./npm/canvas_advanced_lite/canvas_advanced.mjs","webpack://rive/./src/semantics/index.ts","webpack://rive/./src/semantics/semanticTreeModel.ts","webpack://rive/./src/semantics/types.ts","webpack://rive/./src/semantics/accessibilityOverlay.ts","webpack://rive/./src/utils/index.ts","webpack://rive/./src/utils/registerTouchInteractions.ts","webpack://rive/./src/utils/registerKeyboardInteractions.ts","webpack://rive/./src/utils/sanitizeUrl.ts","webpack://rive/./src/utils/finalizationRegistry.ts","webpack://rive/./src/utils/riveFont.ts","webpack://rive/webpack/bootstrap","webpack://rive/webpack/runtime/define property getters","webpack://rive/webpack/runtime/hasOwnProperty shorthand","webpack://rive/webpack/runtime/make namespace object","webpack://rive/./src/rive.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rive\"] = factory();\n\telse\n\t\troot[\"rive\"] = factory();\n})(this, () => {\nreturn ","export { Animation } from \"./Animation\";\n","import type {\n LinearAnimationInstance,\n LinearAnimation,\n Artboard,\n RiveCanvas,\n} from \"./../rive_advanced.mjs\";\n\n/**\n * Represents an animation that can be played on an Artboard. \n * Wraps animations and instances from the runtime and keeps track of playback state.\n *\n * The `Animation` class manages the state and behavior of a single animation instance,\n * including its current time, loop count, and ability to scrub to a specific time.\n *\n * The class provides methods to advance the animation, apply its interpolated keyframe\n * values to the Artboard, and clean up the underlying animation instance when the\n * animation is no longer needed.\n */\nexport class Animation {\n public loopCount = 0;\n public readonly instance: LinearAnimationInstance;\n\n /**\n * The time to which the animation should move to on the next render.\n * If not null, the animation will scrub to this time instead of advancing by the given time.\n */\n public scrubTo: number | null = null;\n\n /**\n * Constructs a new animation\n * @constructor\n * @param {any} animation: runtime animation object\n * @param {any} instance: runtime animation instance object\n */\n constructor(\n private animation: LinearAnimation,\n private artboard: Artboard,\n runtime: RiveCanvas,\n public playing: boolean\n ) {\n this.instance = new runtime.LinearAnimationInstance(animation, artboard);\n }\n\n /**\n * Returns the animation's name\n */\n public get name(): string {\n return this.animation.name;\n }\n\n /**\n * Returns the animation's name\n */\n public get time(): number {\n return this.instance.time;\n }\n\n /**\n * Sets the animation's current time\n */\n public set time(value: number) {\n this.instance.time = value;\n }\n\n /**\n * Returns the animation's loop type\n */\n public get loopValue(): number {\n return this.animation.loopValue;\n }\n\n /**\n * Indicates whether the animation needs to be scrubbed.\n * @returns `true` if the animation needs to be scrubbed, `false` otherwise.\n */\n public get needsScrub(): boolean {\n return this.scrubTo !== null;\n }\n\n /**\n * Advances the animation by the give time. If the animation needs scrubbing,\n * time is ignored and the stored scrub value is used.\n * @param time the time to advance the animation by if no scrubbing required\n */\n public advance(time: number) {\n if (this.scrubTo === null) {\n this.instance.advance(time);\n } else {\n this.instance.time = 0;\n this.instance.advance(this.scrubTo);\n this.scrubTo = null;\n }\n }\n\n /**\n * Apply interpolated keyframe values to the artboard. This should be called after calling\n * .advance() on an animation instance so that new values are applied to properties.\n *\n * Note: This does not advance the artboard, which updates all objects on the artboard\n * @param mix - Mix value for the animation from 0 to 1\n */\n public apply(mix: number) {\n this.instance.apply(mix);\n }\n\n /**\n * Deletes the backing Wasm animation instance; once this is called, this\n * animation is no more.\n */\n public cleanup() {\n this.instance.delete();\n }\n}\n","import * as rc from \"./rive_advanced.mjs\";\nimport packageData from \"package.json\";\n\n// Callback type when looking for a runtime instance\nexport type RuntimeCallback = (rive: rc.RiveCanvas) => void;\n\n// Runtime singleton; use getInstance to provide a callback that returns the\n// Rive runtime\nexport class RuntimeLoader {\n // Singleton helpers\n private static runtime: rc.RiveCanvas;\n // Flag to indicate that loading has started/completed\n private static isLoading = false;\n // List of callbacks for the runtime that come in while loading\n private static callBackQueue: RuntimeCallback[] = [];\n // Instance of the Rive runtime\n private static rive: rc.RiveCanvas;\n // Path to the Wasm file; default path works for testing only;\n // if embedded wasm is used then this is never used.\n private static wasmURL = `https://unpkg.com/${packageData.name}@${packageData.version}/rive.wasm`;\n\n // Fallback WASM URL tried when the primary URL fails. Set to null to disable\n // the fallback entirely. Defaults to pulling from the jsdelivr CDN.\n private static wasmFallbackURL: string | null = `https://cdn.jsdelivr.net/npm/${packageData.name}@${packageData.version}/rive_fallback.wasm`;\n\n private static wasmBinary: ArrayBuffer | null = null;\n\n // Error callbacks enqueued from .getInstance()\n private static errorCallbackQueue: ((error: Error) => void)[] = [];\n\n // Class is never instantiated\n private constructor() {}\n\n /**\n * When true, performance.mark / performance.measure entries are emitted for\n * WASM initialization.\n */\n public static enablePerfMarks: boolean = false;\n\n // Rejects all pending awaitInstance() promises and resets loading state so\n // the next call to getInstance() / awaitInstance() can retry with a new URL.\n private static notifyError(error: Error): void {\n RuntimeLoader.isLoading = false;\n while (RuntimeLoader.errorCallbackQueue.length > 0) {\n RuntimeLoader.errorCallbackQueue.shift()?.(error);\n }\n RuntimeLoader.callBackQueue = [];\n }\n\n // Loads the runtime\n private static loadRuntime(): void {\n // Capture the URL at call time so the catch closure always refers to the\n // URL this particular attempt used, even if wasmURL is mutated for a retry.\n const attemptedUrl = RuntimeLoader.wasmURL;\n const wasmBinary = RuntimeLoader.wasmBinary;\n if (RuntimeLoader.enablePerfMarks) performance.mark('rive:wasm-init:start');\n rc.default({\n // Loads Wasm bundle\n locateFile: () => attemptedUrl,\n ...(wasmBinary ? { wasmBinary } : {})\n })\n .then((rive: rc.RiveCanvas) => {\n if (RuntimeLoader.enablePerfMarks) {\n performance.mark('rive:wasm-init:end');\n performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');\n }\n RuntimeLoader.runtime = rive;\n RuntimeLoader.errorCallbackQueue = [];\n // Fire all the callbacks\n while (RuntimeLoader.callBackQueue.length > 0) {\n RuntimeLoader.callBackQueue.shift()?.(RuntimeLoader.runtime);\n }\n })\n .catch((error) => {\n // Capture specific error details\n const errorDetails = {\n message: error?.message || \"Unknown error\",\n type: error?.name || \"Error\",\n // Some browsers may provide additional WebAssembly-specific details\n wasmError:\n error instanceof WebAssembly.CompileError ||\n error instanceof WebAssembly.RuntimeError,\n originalError: error,\n };\n\n // Log detailed error for debugging\n console.debug(\"Rive WASM load error details:\", errorDetails);\n\n // In case the primary URL fails, or the wasm was not supported, try the\n // fallback URL (a rive_fallback.wasm compiled for older architectures).\n // The fallback can be customised or disabled via setWasmFallbackUrl().\n // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use the fallback only if the primary fails.\n const fallbackUrl = RuntimeLoader.wasmFallbackURL;\n const alreadyOnFallback =\n fallbackUrl !== null &&\n attemptedUrl.toLowerCase() === fallbackUrl.toLowerCase();\n\n if (fallbackUrl !== null && !alreadyOnFallback) {\n console.warn(\n `Failed to load WASM from ${attemptedUrl} (${errorDetails.message}), trying fallback URL: ${fallbackUrl}`,\n );\n // Clear wasmBinary so the retry actually fetches via locateFile\n // instead of re-using the same (failing) in-memory binary.\n RuntimeLoader.wasmBinary = null;\n RuntimeLoader.setWasmUrl(fallbackUrl);\n RuntimeLoader.loadRuntime();\n } else {\n // When alreadyOnFallback is true, wasmURL has already been overwritten\n // with the fallback URL, so we can no longer recover the original\n // primary URL here. The primary URL was logged in the earlier warning.\n const triedUrls = alreadyOnFallback\n ? `the configured WASM URL or its fallback (${fallbackUrl})`\n : attemptedUrl;\n const errorMessage = [\n `Could not load Rive WASM file from ${triedUrls}.`,\n \"Possible reasons:\",\n \"- Network connection is down\",\n \"- WebAssembly is not supported in this environment\",\n \"- The WASM file is corrupted or incompatible\",\n \"\\nError details:\",\n `- Type: ${errorDetails.type}`,\n `- Message: ${errorDetails.message}`,\n `- WebAssembly-specific error: ${errorDetails.wasmError}`,\n \"\\nTo resolve, you may need to:\",\n \"1. Check your network connection\",\n \"2. Set a new WASM source via RuntimeLoader.setWasmUrl()\",\n \"3. Call RuntimeLoader.awaitInstance() again\",\n ].join(\"\\n\");\n\n console.error(errorMessage);\n RuntimeLoader.notifyError(new Error(errorMessage));\n }\n });\n }\n\n // Provides a runtime instance via a callback\n public static getInstance(callback: RuntimeCallback, onError?: (error: Error) => void): void {\n // If it's not loading, start loading runtime\n if (!RuntimeLoader.isLoading) {\n RuntimeLoader.isLoading = true;\n RuntimeLoader.loadRuntime();\n }\n if (!RuntimeLoader.runtime) {\n RuntimeLoader.callBackQueue.push(callback);\n if (onError) {\n RuntimeLoader.errorCallbackQueue.push(onError);\n }\n } else {\n callback(RuntimeLoader.runtime);\n }\n }\n\n // Provides a runtime instance via a promise; rejects if WASM fails to load.\n public static awaitInstance(): Promise<rc.RiveCanvas> {\n return new Promise<rc.RiveCanvas>((resolve, reject) =>\n RuntimeLoader.getInstance(resolve, reject),\n );\n }\n\n // Manually sets the wasm url\n public static setWasmUrl(url: string): void {\n RuntimeLoader.wasmURL = url;\n }\n\n // Gets the current wasm url\n public static getWasmUrl(): string {\n return RuntimeLoader.wasmURL;\n }\n\n /**\n * Sets the URL used as a fallback when the primary WASM URL fails to load.\n * Pass `null` to disable the fallback entirely.\n *\n * Defaults to pulling from the jsdelivr CDN.\n */\n public static setWasmFallbackUrl(url: string | null): void {\n RuntimeLoader.wasmFallbackURL = url;\n }\n\n // Gets the current fallback wasm url (null means fallback is disabled)\n public static getWasmFallbackUrl(): string | null {\n return RuntimeLoader.wasmFallbackURL;\n }\n\n // Manually sets the wasm binary or clears it with null\n public static setWasmBinary(value: ArrayBuffer | null): void {\n if ((value instanceof ArrayBuffer) || value === null) {\n RuntimeLoader.wasmBinary = value;\n return;\n }\n console.error(\"setWasmBinary expects an ArrayBuffer or null\");\n }\n\n // Gets the current wasm build as ArrayBuffer or null\n public static getWasmBinary(): ArrayBuffer | null {\n return RuntimeLoader.wasmBinary;\n }\n}\n","\nvar Rive = (() => {\n var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;\n \n return (\nfunction(moduleArg = {}) {\n var moduleRtn;\n\nvar k = moduleArg, aa, ba, da = new Promise((b, a) => {\n aa = b;\n ba = a;\n}), ea = \"object\" == typeof window, fa = \"function\" == typeof importScripts;\nfunction ka() {\n function b(l) {\n const h = d;\n c = a = 0;\n d = new Map();\n h.forEach(n => {\n try {\n n(l);\n } catch (m) {\n console.error(m);\n }\n });\n this.va();\n e && e.Pa();\n }\n let a = 0, c = 0, d = new Map(), e = null, f = null;\n this.requestAnimationFrame = function(l) {\n a ||= requestAnimationFrame(b.bind(this));\n const h = ++c;\n d.set(h, l);\n return h;\n };\n this.cancelAnimationFrame = function(l) {\n d.delete(l);\n a && 0 == d.size && (cancelAnimationFrame(a), a = 0);\n };\n this.Na = function(l) {\n f && (document.body.remove(f), f = null);\n l || (f = document.createElement(\"div\"), f.style.backgroundColor = \"black\", f.style.position = \"fixed\", f.style.right = 0, f.style.top = 0, f.style.color = \"white\", f.style.padding = \"4px\", f.innerHTML = \"RIVE FPS\", l = function(h) {\n f.innerHTML = \"RIVE FPS \" + h.toFixed(1);\n }, document.body.appendChild(f));\n e = new function() {\n let h = 0, n = 0;\n this.Pa = function() {\n var m = performance.now();\n n ? (++h, m -= n, 1000 < m && (l(1000 * h / m), h = n = 0)) : (n = m, h = 0);\n };\n }();\n };\n this.Ka = function() {\n f && (document.body.remove(f), f = null);\n e = null;\n };\n this.va = function() {\n };\n}\nfunction la(b) {\n console.assert(!0);\n const a = new Map();\n let c = -Infinity;\n this.push = function(d) {\n d = d + ((1 << b) - 1) >> b;\n a.has(d) && clearTimeout(a.get(d));\n a.set(d, setTimeout(function() {\n a.delete(d);\n 0 == a.length ? c = -Infinity : d == c && (c = Math.max(...a.keys()), console.assert(c < d));\n }, 1000));\n c = Math.max(d, c);\n return c << b;\n };\n}\nconst ma = k.onRuntimeInitialized;\nk.onRuntimeInitialized = function() {\n ma && ma();\n let b = k.decodeAudio;\n k.decodeAudio = function(f, l) {\n f = b(f);\n l(f);\n };\n let a = k.decodeFont;\n k.decodeFont = function(f, l) {\n f = a(f);\n l(f);\n };\n let c = k.setFallbackFontCb;\n k.setFallbackFontCallback = \"function\" === typeof c ? function(f) {\n c(f);\n } : function() {\n console.warn(\"Module.setFallbackFontCallback called, but text support is not enabled in this build.\");\n };\n const d = k.FileAssetLoader;\n k.ptrToAsset = f => {\n let l = k.ptrToFileAsset(f);\n return l.isImage ? k.ptrToImageAsset(f) : l.isFont ? k.ptrToFontAsset(f) : l.isAudio ? k.ptrToAudioAsset(f) : l;\n };\n k.CustomFileAssetLoader = d.extend(\"CustomFileAssetLoader\", {__construct:function({loadContents:f}) {\n this.__parent.__construct.call(this);\n this.Ea = f;\n }, loadContents:function(f, l) {\n f = k.ptrToAsset(f);\n return this.Ea(f, l);\n },});\n k.CDNFileAssetLoader = d.extend(\"CDNFileAssetLoader\", {__construct:function() {\n this.__parent.__construct.call(this);\n }, loadContents:function(f) {\n let l = k.ptrToAsset(f);\n f = l.cdnUuid;\n if (\"\" === f) {\n return !1;\n }\n (function(h, n) {\n var m = new XMLHttpRequest();\n m.responseType = \"arraybuffer\";\n m.onreadystatechange = function() {\n 4 == m.readyState && 200 == m.status && n(m);\n };\n m.open(\"GET\", h, !0);\n m.send(null);\n })(l.cdnBaseUrl + \"/\" + f, h => {\n l.decode(new Uint8Array(h.response));\n });\n return !0;\n },});\n k.FallbackFileAssetLoader = d.extend(\"FallbackFileAssetLoader\", {__construct:function() {\n this.__parent.__construct.call(this);\n this.ua = [];\n }, addLoader:function(f) {\n this.ua.push(f);\n }, loadContents:function(f, l) {\n for (let h of this.ua) {\n if (h.loadContents(f, l)) {\n return !0;\n }\n }\n return !1;\n },});\n let e = k.computeAlignment;\n k.computeAlignment = function(f, l, h, n, m = 1.0) {\n return e.call(this, f, l, h, n, m);\n };\n};\nconst pa = \"createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText\".split(\" \"), qa = new function() {\n function b() {\n if (!a) {\n var g = document.createElement(\"canvas\"), t = {alpha:1, depth:0, stencil:0, antialias:0, premultipliedAlpha:1, preserveDrawingBuffer:0, powerPreference:\"high-performance\", failIfMajorPerformanceCaveat:0, enableExtensionsByDefault:1, explicitSwapControl:1, renderViaOffscreenBackBuffer:1,};\n let q;\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n if (q = g.getContext(\"webgl\", t), c = 1, !q) {\n return console.log(\"No WebGL support. Image mesh will not be drawn.\"), !1;\n }\n } else {\n if (q = g.getContext(\"webgl2\", t)) {\n c = 2;\n } else {\n if (q = g.getContext(\"webgl\", t)) {\n c = 1;\n } else {\n return console.log(\"No WebGL support. Image mesh will not be drawn.\"), !1;\n }\n }\n }\n q = new Proxy(q, {get(F, v) {\n if (F.isContextLost()) {\n if (n || (console.error(\"Cannot render the mesh because the GL Context was lost. Tried to invoke \", v), n = !0), \"function\" === typeof F[v]) {\n return function() {\n };\n }\n } else {\n return \"function\" === typeof F[v] ? function(...H) {\n return F[v].apply(F, H);\n } : F[v];\n }\n }, set(F, v, H) {\n if (F.isContextLost()) {\n n || (console.error(\"Cannot render the mesh because the GL Context was lost. Tried to set property \" + v), n = !0);\n } else {\n return F[v] = H, !0;\n }\n },});\n d = Math.min(q.getParameter(q.MAX_RENDERBUFFER_SIZE), q.getParameter(q.MAX_TEXTURE_SIZE));\n function G(F, v, H) {\n v = q.createShader(v);\n q.shaderSource(v, H);\n q.compileShader(v);\n H = q.getShaderInfoLog(v);\n if (0 < (H || \"\").length) {\n throw H;\n }\n q.attachShader(F, v);\n }\n g = q.createProgram();\n G(g, q.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 }\");\n G(g, q.FRAGMENT_SHADER, \"precision highp float;\\n uniform sampler2D image;\\n varying vec2 st;\\n void main() {\\n gl_FragColor = texture2D(image, st);\\n }\");\n q.bindAttribLocation(g, 0, \"vertex\");\n q.bindAttribLocation(g, 1, \"uv\");\n q.linkProgram(g);\n t = q.getProgramInfoLog(g);\n if (0 < (t || \"\").trim().length) {\n throw t;\n }\n e = q.getUniformLocation(g, \"mat\");\n f = q.getUniformLocation(g, \"translate\");\n q.useProgram(g);\n q.bindBuffer(q.ARRAY_BUFFER, q.createBuffer());\n q.enableVertexAttribArray(0);\n q.enableVertexAttribArray(1);\n q.bindBuffer(q.ELEMENT_ARRAY_BUFFER, q.createBuffer());\n q.uniform1i(q.getUniformLocation(g, \"image\"), 0);\n q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);\n a = q;\n }\n return !0;\n }\n let a = null, c = 0, d = 0, e = null, f = null, l = 0, h = 0, n = !1;\n b();\n this.Xa = function() {\n b();\n return d;\n };\n this.Ja = function(g) {\n a.deleteTexture && a.deleteTexture(g);\n };\n this.Ia = function(g) {\n if (!b()) {\n return null;\n }\n const t = a.createTexture();\n if (!t) {\n return null;\n }\n a.bindTexture(a.TEXTURE_2D, t);\n a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, g);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR);\n 2 == c ? (a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR_MIPMAP_LINEAR), a.generateMipmap(a.TEXTURE_2D)) : a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR);\n return t;\n };\n const m = new la(8), r = new la(8), w = new la(10), z = new la(10);\n this.Ma = function(g, t, q, G, F) {\n if (b()) {\n var v = m.push(g), H = r.push(t);\n if (a.canvas) {\n if (a.canvas.width != v || a.canvas.height != H) {\n a.canvas.width = v, a.canvas.height = H;\n }\n a.viewport(0, H - t, g, t);\n a.disable(a.SCISSOR_TEST);\n a.clearColor(0, 0, 0, 0);\n a.clear(a.COLOR_BUFFER_BIT);\n a.enable(a.SCISSOR_TEST);\n q.sort((E, V) => V.ya - E.ya);\n v = w.push(G);\n l != v && (a.bufferData(a.ARRAY_BUFFER, 8 * v, a.DYNAMIC_DRAW), l = v);\n v = 0;\n for (var L of q) {\n a.bufferSubData(a.ARRAY_BUFFER, v, L.ia), v += 4 * L.ia.length;\n }\n console.assert(v == 4 * G);\n for (var Q of q) {\n a.bufferSubData(a.ARRAY_BUFFER, v, Q.Ba), v += 4 * Q.Ba.length;\n }\n console.assert(v == 8 * G);\n v = z.push(F);\n h != v && (a.bufferData(a.ELEMENT_ARRAY_BUFFER, 2 * v, a.DYNAMIC_DRAW), h = v);\n L = 0;\n for (var ha of q) {\n a.bufferSubData(a.ELEMENT_ARRAY_BUFFER, L, ha.indices), L += 2 * ha.indices.length;\n }\n console.assert(L == 2 * F);\n ha = 0;\n Q = !0;\n v = L = 0;\n for (const E of q) {\n E.image.da != ha && (a.bindTexture(a.TEXTURE_2D, E.image.ca || null), ha = E.image.da);\n E.$a ? (a.scissor(E.na, H - E.oa - E.ta, E.lb, E.ta), Q = !0) : Q && (a.scissor(0, H - t, g, t), Q = !1);\n q = 2 / g;\n const V = -2 / t;\n a.uniform4f(e, E.N[0] * q * E.X, E.N[1] * V * E.Y, E.N[2] * q * E.X, E.N[3] * V * E.Y);\n a.uniform2f(f, E.N[4] * q * E.X + q * (E.na - E.Ya * E.X) - 1, E.N[5] * V * E.Y + V * (E.oa - E.Za * E.Y) + 1);\n a.vertexAttribPointer(0, 2, a.FLOAT, !1, 0, v);\n a.vertexAttribPointer(1, 2, a.FLOAT, !1, 0, v + 4 * G);\n a.drawElements(a.TRIANGLES, E.indices.length, a.UNSIGNED_SHORT, L);\n v += 4 * E.ia.length;\n L += 2 * E.indices.length;\n }\n console.assert(v == 4 * G);\n console.assert(L == 2 * F);\n }\n }\n };\n this.canvas = function() {\n return b() && a.canvas;\n };\n}(), ra = k.onRuntimeInitialized;\nk.onRuntimeInitialized = function() {\n function b(p) {\n switch(p) {\n case m.srcOver:\n return \"source-over\";\n case m.screen:\n return \"screen\";\n case m.overlay:\n return \"overlay\";\n case m.darken:\n return \"darken\";\n case m.lighten:\n return \"lighten\";\n case m.colorDodge:\n return \"color-dodge\";\n case m.colorBurn:\n return \"color-burn\";\n case m.hardLight:\n return \"hard-light\";\n case m.softLight:\n return \"soft-light\";\n case m.difference:\n return \"difference\";\n case m.exclusion:\n return \"exclusion\";\n case m.multiply:\n return \"multiply\";\n case m.hue:\n return \"hue\";\n case m.saturation:\n return \"saturation\";\n case m.color:\n return \"color\";\n case m.luminosity:\n return \"luminosity\";\n }\n }\n function a(p) {\n return \"rgba(\" + ((16711680 & p) >>> 16) + \",\" + ((65280 & p) >>> 8) + \",\" + ((255 & p) >>> 0) + \",\" + ((4278190080 & p) >>> 24) / 255 + \")\";\n }\n function c() {\n 0 < H.length && (qa.Ma(v.drawWidth(), v.drawHeight(), H, L, Q), H = [], Q = L = 0, v.reset(512, 512));\n for (const p of F) {\n for (const u of p.v) {\n u();\n }\n p.v = [];\n }\n F.clear();\n }\n ra && ra();\n var d = k.RenderPaintStyle;\n const e = k.RenderPath, f = k.RenderPaint, l = k.Renderer, h = k.StrokeCap, n = k.StrokeJoin, m = k.BlendMode, r = d.fill, w = d.stroke, z = k.FillRule.evenOdd;\n let g = 1;\n var t = k.RenderImage.extend(\"CanvasRenderImage\", {__construct:function({R:p, W:u} = {}) {\n this.__parent.__construct.call(this);\n this.da = g;\n g = g + 1 & 2147483647 || 1;\n this.R = p;\n this.W = u;\n }, __destruct:function() {\n this.ca && (qa.Ja(this.ca), URL.revokeObjectURL(this.la));\n this.__parent.__destruct.call(this);\n }, decode:function(p) {\n var u = this;\n u.W && u.W(u);\n var D = new Image();\n u.la = URL.createObjectURL(new Blob([p], {type:\"image/png\",}));\n D.onload = function() {\n u.Da = D;\n u.ca = qa.Ia(D);\n u.size(D.width, D.height);\n u.R && u.R(u);\n };\n D.src = u.la;\n },}), q = e.extend(\"CanvasRenderPath\", {__construct:function() {\n this.__parent.__construct.call(this);\n this.H = new Path2D();\n }, rewind:function() {\n this.H = new Path2D();\n }, addPath:function(p, u, D, B, x, C, A) {\n var I = this.H, na = I.addPath;\n p = p.H;\n const P = new DOMMatrix();\n P.a = u;\n P.b = D;\n P.c = B;\n P.d = x;\n P.e = C;\n P.f = A;\n na.call(I, p, P);\n }, fillRule:function(p) {\n this.ka = p;\n }, moveTo:function(p, u) {\n this.H.moveTo(p, u);\n }, lineTo:function(p, u) {\n this.H.lineTo(p, u);\n }, cubicTo:function(p, u, D, B, x, C) {\n this.H.bezierCurveTo(p, u, D, B, x, C);\n }, close:function() {\n this.H.closePath();\n },}), G = f.extend(\"CanvasRenderPaint\", {color:function(p) {\n this.ma = a(p);\n }, thickness:function(p) {\n this.Ga = p;\n }, join:function(p) {\n switch(p) {\n case n.miter:\n this.ba = \"miter\";\n break;\n case n.round:\n this.ba = \"round\";\n break;\n case n.bevel:\n this.ba = \"bevel\";\n }\n }, cap:function(p) {\n switch(p) {\n case h.butt:\n this.aa = \"butt\";\n break;\n case h.round:\n this.aa = \"round\";\n break;\n case h.square:\n this.aa = \"square\";\n }\n }, style:function(p) {\n this.Fa = p;\n }, blendMode:function(p) {\n this.Ca = b(p);\n }, clearGradient:function() {\n this.P = null;\n }, linearGradient:function(p, u, D, B) {\n this.P = {za:p, Aa:u, qa:D, ra:B, ga:[],};\n }, radialGradient:function(p, u, D, B) {\n this.P = {za:p, Aa:u, qa:D, ra:B, ga:[], Wa:!0,};\n }, addStop:function(p, u) {\n this.P.ga.push({color:p, stop:u,});\n }, completeGradient:function() {\n }, draw:function(p, u, D, B) {\n let x = this.Fa;\n var C = this.ma, A = this.P;\n const I = p.globalCompositeOperation, na = p.globalAlpha;\n p.globalCompositeOperation = this.Ca;\n p.globalAlpha = B;\n if (null != A) {\n C = A.za;\n const T = A.Aa, ca = A.qa;\n var P = A.ra;\n B = A.ga;\n A.Wa ? (A = ca - C, P -= T, C = p.createRadialGradient(C, T, 0, C, T, Math.sqrt(A * A + P * P))) : C = p.createLinearGradient(C, T, ca, P);\n for (let U = 0, W = B.length; U < W; U++) {\n A = B[U], C.addColorStop(A.stop, a(A.color));\n }\n this.ma = C;\n this.P = null;\n }\n switch(x) {\n case w:\n p.strokeStyle = C;\n p.lineWidth = this.Ga;\n p.lineCap = this.aa;\n p.lineJoin = this.ba;\n p.stroke(u);\n break;\n case r:\n p.fillStyle = C, p.fill(u, D);\n }\n p.globalCompositeOperation = I;\n p.globalAlpha = na;\n },});\n const F = new Set();\n let v = null, H = [], L = 0, Q = 0;\n var ha = k.CanvasRenderer = l.extend(\"Renderer\", {__construct:function(p) {\n this.__parent.__construct.call(this);\n this.G = [1, 0, 0, 1, 0, 0];\n this.u = [1.0];\n this.m = p.getContext(\"2d\");\n this.ja = p;\n this.v = [];\n }, save:function() {\n this.G.push(...this.G.slice(this.G.length - 6));\n this.u.push(this.u[this.u.length - 1]);\n this.v.push(this.m.save.bind(this.m));\n }, restore:function() {\n const p = this.G.length - 6;\n if (6 > p) {\n throw \"restore() called without matching save().\";\n }\n this.G.splice(p);\n this.u.pop();\n this.v.push(this.m.restore.bind(this.m));\n }, transform:function(p, u, D, B, x, C) {\n const A = this.G, I = A.length - 6;\n A.splice(I, 6, A[I] * p + A[I + 2] * u, A[I + 1] * p + A[I + 3] * u, A[I] * D + A[I + 2] * B, A[I + 1] * D + A[I + 3] * B, A[I] * x + A[I + 2] * C + A[I + 4], A[I + 1] * x + A[I + 3] * C + A[I + 5]);\n this.v.push(this.m.transform.bind(this.m, p, u, D, B, x, C));\n }, rotate:function(p) {\n const u = Math.sin(p);\n p = Math.cos(p);\n this.transform(p, u, -u, p, 0, 0);\n }, modulateOpacity:function(p) {\n this.u[this.u.length - 1] *= p;\n }, _drawPath:function(p, u) {\n this.v.push(u.draw.bind(u, this.m, p.H, p.ka === z ? \"evenodd\" : \"nonzero\", Math.max(0, this.u[this.u.length - 1])));\n }, _drawRiveImage:function(p, u, D, B) {\n var x = p.Da;\n if (x) {\n var C = this.m, A = b(D), I = Math.max(0, B * this.u[this.u.length - 1]);\n this.v.push(function() {\n C.globalCompositeOperation = A;\n C.globalAlpha = I;\n C.drawImage(x, 0, 0);\n C.globalAlpha = 1;\n });\n }\n }, _getMatrix:function(p) {\n const u = this.G, D = u.length - 6;\n for (let B = 0; 6 > B; ++B) {\n p[B] = u[D + B];\n }\n }, _drawImageMesh:function(p, u, D, B, x, C, A, I, na, P, T, ca, U, W) {\n let ub, vb, wb;\n try {\n ub = k.HEAPF32.slice(x >> 2, (x >> 2) + C), vb = k.HEAPF32.slice(A >> 2, (A >> 2) + I), wb = k.HEAPU16.slice(na >> 1, (na >> 1) + P);\n } catch (Ya) {\n console.error(\"[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.\");\n return;\n }\n u = this.m.canvas.width;\n x = this.m.canvas.height;\n A = U - T;\n I = W - ca;\n T = Math.max(T, 0);\n ca = Math.max(ca, 0);\n U = Math.min(U, u);\n W = Math.min(W, x);\n const va = U - T, wa = W - ca;\n console.assert(va <= Math.min(A, u));\n console.assert(wa <= Math.min(I, x));\n if (!(0 >= va || 0 >= wa)) {\n U = va < A || wa < I;\n u = W = 1;\n var ia = Math.ceil(va * W), ja = Math.ceil(wa * u);\n x = qa.Xa();\n ia > x && (W *= x / ia, ia = x);\n ja > x && (u *= x / ja, ja = x);\n v || (v = new k.DynamicRectanizer(x), v.reset(512, 512));\n x = v.addRect(ia, ja);\n 0 > x && (c(), F.add(this), x = v.addRect(ia, ja), console.assert(0 <= x));\n var xb = x & 65535, yb = x >> 16;\n H.push({N:this.G.slice(this.G.length - 6), image:p, na:xb, oa:yb, Ya:T, Za:ca, lb:ia, ta:ja, X:W, Y:u, ia:ub, Ba:vb, indices:wb, $a:U, ya:p.da << 1 | (U ? 1 : 0),});\n L += C;\n Q += P;\n var oa = this.m, oc = b(D), pc = Math.max(0, B * this.u[this.u.length - 1]);\n this.v.push(function() {\n oa.save();\n oa.resetTransform();\n oa.globalCompositeOperation = oc;\n oa.globalAlpha = pc;\n const Ya = qa.canvas();\n Ya && oa.drawImage(Ya, xb, yb, ia, ja, T, ca, va, wa);\n oa.restore();\n });\n }\n }, _clipPath:function(p) {\n this.v.push(this.m.clip.bind(this.m, p.H, p.ka === z ? \"evenodd\" : \"nonzero\"));\n }, clear:function() {\n F.add(this);\n this.v.push(this.m.clearRect.bind(this.m, 0, 0, this.ja.width, this.ja.height));\n }, flush:function() {\n }, translate:function(p, u) {\n this.transform(1, 0, 0, 1, p, u);\n },});\n k.makeRenderer = function(p) {\n const u = new ha(p), D = u.m;\n return new Proxy(u, {get(B, x) {\n if (\"function\" === typeof B[x]) {\n return function(...C) {\n return B[x].apply(B, C);\n };\n }\n if (\"function\" === typeof D[x]) {\n if (-1 < pa.indexOf(x)) {\n throw Error(\"RiveException: Method call to '\" + x + \"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.\");\n }\n return function(...C) {\n u.v.push(D[x].bind(D, ...C));\n };\n }\n return B[x];\n }, set(B, x, C) {\n if (x in D) {\n return u.v.push(() => {\n D[x] = C;\n }), !0;\n }\n },});\n };\n k.decodeImage = function(p, u) {\n (new t({R:u})).decode(p);\n };\n k.renderFactory = {makeRenderPaint:function() {\n return new G();\n }, makeRenderPath:function() {\n return new q();\n }, makeRenderImage:function() {\n let p = V;\n return new t({W:() => {\n p.total++;\n }, R:() => {\n p.loaded++;\n if (p.loaded === p.total) {\n const u = p.ready;\n u && (u(), p.ready = null);\n }\n },});\n },};\n let E = k.load, V = null;\n k.load = function(p, u, D = !0) {\n const B = new k.FallbackFileAssetLoader();\n void 0 !== u && B.addLoader(u);\n D && (u = new k.CDNFileAssetLoader(), B.addLoader(u));\n return new Promise(function(x) {\n let C = null;\n V = {total:0, loaded:0, ready:function() {\n x(C);\n },};\n C = E(p, B);\n 0 == V.total && x(C);\n });\n };\n let qc = k.RendererWrapper.prototype.align;\n k.RendererWrapper.prototype.align = function(p, u, D, B, x = 1.0) {\n qc.call(this, p, u, D, B, x);\n };\n d = new ka();\n k.requestAnimationFrame = d.requestAnimationFrame.bind(d);\n k.cancelAnimationFrame = d.cancelAnimationFrame.bind(d);\n k.enableFPSCounter = d.Na.bind(d);\n k.disableFPSCounter = d.Ka;\n d.va = c;\n k.resolveAnimationFrame = c;\n k.cleanup = function() {\n v && v.delete();\n };\n};\nvar sa = Object.assign({}, k), ta = \"./this.program\", y = \"\", ua, xa;\nif (ea || fa) {\n fa ? y = self.location.href : \"undefined\" != typeof document && document.currentScript && (y = document.currentScript.src), _scriptName && (y = _scriptName), y.startsWith(\"blob:\") ? y = \"\" : y = y.substr(0, y.replace(/[?#].*/, \"\").lastIndexOf(\"/\") + 1), fa && (xa = b => {\n var a = new XMLHttpRequest();\n a.open(\"GET\", b, !1);\n a.responseType = \"arraybuffer\";\n a.send(null);\n return new Uint8Array(a.response);\n }), ua = (b, a, c) => {\n if (ya(b)) {\n var d = new XMLHttpRequest();\n d.open(\"GET\", b, !0);\n d.responseType = \"arraybuffer\";\n d.onload = () => {\n 200 == d.status || 0 == d.status && d.response ? a(d.response) : c();\n };\n d.onerror = c;\n d.send(null);\n } else {\n fetch(b, {credentials:\"same-origin\"}).then(e => e.ok ? e.arrayBuffer() : Promise.reject(Error(e.status + \" : \" + e.url))).then(a, c);\n }\n };\n}\nvar za = k.print || console.log.bind(console), Aa = k.printErr || console.error.bind(console);\nObject.assign(k, sa);\nsa = null;\nk.thisProgram && (ta = k.thisProgram);\nvar Ba;\nk.wasmBinary && (Ba = k.wasmBinary);\nvar Ca, Da = !1, Ea, J, Fa, Ga, K, M, Ha, Ia;\nfunction Ja() {\n var b = Ca.buffer;\n k.HEAP8 = Ea = new Int8Array(b);\n k.HEAP16 = Fa = new Int16Array(b);\n k.HEAPU8 = J = new Uint8Array(b);\n k.HEAPU16 = Ga = new Uint16Array(b);\n k.HEAP32 = K = new Int32Array(b);\n k.HEAPU32 = M = new Uint32Array(b);\n k.HEAPF32 = Ha = new Float32Array(b);\n k.HEAPF64 = Ia = new Float64Array(b);\n}\nvar Ka = [], La = [], Ma = [];\nfunction Na() {\n var b = k.preRun.shift();\n Ka.unshift(b);\n}\nvar Oa = 0, Pa = null, Qa = null;\nfunction Ra(b) {\n k.onAbort?.(b);\n b = \"Aborted(\" + b + \")\";\n Aa(b);\n Da = !0;\n b = new WebAssembly.RuntimeError(b + \". Build with -sASSERTIONS for more info.\");\n ba(b);\n throw b;\n}\nvar Sa = b => b.startsWith(\"data:application/octet-stream;base64,\"), ya = b => b.startsWith(\"file://\"), Ta;\nfunction Ua(b) {\n if (b == Ta && Ba) {\n return new Uint8Array(Ba);\n }\n if (xa) {\n return xa(b);\n }\n throw \"both async and sync fetching of the wasm failed\";\n}\nfunction Va(b) {\n return Ba ? Promise.resolve().then(() => Ua(b)) : new Promise((a, c) => {\n ua(b, d => a(new Uint8Array(d)), () => {\n try {\n a(Ua(b));\n } catch (d) {\n c(d);\n }\n });\n });\n}\nfunction Wa(b, a, c) {\n return Va(b).then(d => WebAssembly.instantiate(d, a)).then(c, d => {\n Aa(`failed to asynchronously prepare wasm: ${d}`);\n Ra(d);\n });\n}\nfunction Xa(b, a) {\n var c = Ta;\n return Ba || \"function\" != typeof WebAssembly.instantiateStreaming || Sa(c) || ya(c) || \"function\" != typeof fetch ? Wa(c, b, a) : fetch(c, {credentials:\"same-origin\"}).then(d => WebAssembly.instantiateStreaming(d, b).then(a, function(e) {\n Aa(`wasm streaming compile failed: ${e}`);\n Aa(\"falling back to ArrayBuffer instantiation\");\n return Wa(c, b, a);\n }));\n}\nvar Za = b => {\n for (; 0 < b.length;) {\n b.shift()(k);\n }\n}, $a = (b, a) => Object.defineProperty(a, \"name\", {value:b}), ab = [], N = [], O, R = b => {\n if (!b) {\n throw new O(\"Cannot use deleted val. handle = \" + b);\n }\n return N[b];\n}, bb = b => {\n switch(b) {\n case void 0:\n return 2;\n case null:\n return 4;\n case !0:\n return 6;\n case !1:\n return 8;\n default:\n const a = ab.pop() || N.length;\n N[a] = b;\n N[a + 1] = 1;\n return a;\n }\n}, cb = b => {\n var a = Error, c = $a(b, function(d) {\n this.name = b;\n this.message = d;\n d = Error(d).stack;\n void 0 !== d && (this.stack = this.toString() + \"\\n\" + d.replace(/^Error(:[^\\n]*)?\\n/, \"\"));\n });\n c.prototype = Object.create(a.prototype);\n c.prototype.constructor = c;\n c.prototype.toString = function() {\n return void 0 === this.message ? this.name : `${this.name}: ${this.message}`;\n };\n return c;\n}, db, eb, S = b => {\n for (var a = \"\"; J[b];) {\n a += eb[J[b++]];\n }\n return a;\n}, fb = [], gb = () => {\n for (; fb.length;) {\n var b = fb.pop();\n b.g.M = !1;\n b[\"delete\"]();\n }\n}, hb, ib = {}, jb = (b, a) => {\n if (void 0 === a) {\n throw new O(\"ptr should not be undefined\");\n }\n for (; b.o;) {\n a = b.S(a), b = b.o;\n }\n return a;\n}, kb = {}, nb = b => {\n b = lb(b);\n var a = S(b);\n mb(b);\n return a;\n}, ob = (b, a) => {\n var c = kb[b];\n if (void 0 === c) {\n throw b = `${a} has unknown type ${nb(b)}`, new O(b);\n }\n return c;\n}, pb = () => {\n}, qb = !1, rb = (b, a, c) => {\n if (a === c) {\n return b;\n }\n if (void 0 === c.o) {\n return null;\n }\n b = rb(b, a, c.o);\n return null === b ? null : c.La(b);\n}, sb = {}, tb = (b, a) => {\n a = jb(b, a);\n return ib[a];\n}, zb, Bb = (b, a) => {\n if (!a.j || !a.i) {\n throw new zb(\"makeClassHandle requires ptr and ptrType\");\n }\n if (!!a.A !== !!a.s) {\n throw new zb(\"Both smartPtrType and smartPtr must be specified\");\n }\n a.count = {value:1};\n return Ab(Object.create(b, {g:{value:a, writable:!0,},}));\n}, Ab = b => {\n if (\"undefined\" === typeof FinalizationRegistry) {\n return Ab = a => a, b;\n }\n qb = new FinalizationRegistry(a => {\n a = a.g;\n --a.count.value;\n 0 === a.count.value && (a.s ? a.A.D(a.s) : a.j.h.D(a.i));\n });\n Ab = a => {\n var c = a.g;\n c.s && qb.register(a, {g:c}, a);\n return a;\n };\n pb = a => {\n qb.unregister(a);\n };\n return Ab(b);\n}, Cb = {}, Db = b => {\n for (; b.length;) {\n var a = b.pop();\n b.pop()(a);\n }\n};\nfunction Eb(b) {\n return this.fromWireType(M[b >> 2]);\n}\nvar Fb = {}, Gb = {}, X = (b, a, c) => {\n function d(h) {\n h = c(h);\n if (h.length !== b.length) {\n throw new zb(\"Mismatched type converter count\");\n }\n for (var n = 0; n < b.length; ++n) {\n Hb(b[n], h[n]);\n }\n }\n b.forEach(function(h) {\n Gb[h] = a;\n });\n var e = Array(a.length), f = [], l = 0;\n a.forEach((h, n) => {\n kb.hasOwnProperty(h) ? e[n] = kb[h] : (f.push(h), Fb.hasOwnProperty(h) || (Fb[h] = []), Fb[h].push(() => {\n e[n] = kb[h];\n ++l;\n l === f.length && d(e);\n }));\n });\n 0 === f.length && d(e);\n};\nfunction Ib(b, a, c = {}) {\n var d = a.name;\n if (!b) {\n throw new O(`type \"${d}\" must have a positive integer typeid pointer`);\n }\n if (kb.hasOwnProperty(b)) {\n if (c.Va) {\n return;\n }\n throw new O(`Cannot register type '${d}' twice`);\n }\n kb[b] = a;\n delete Gb[b];\n Fb.hasOwnProperty(b) && (a = Fb[b], delete Fb[b], a.forEach(e => e()));\n}\nfunction Hb(b, a, c = {}) {\n if (!(\"argPackAdvance\" in a)) {\n throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");\n }\n return Ib(b, a, c);\n}\nvar Jb = b => {\n throw new O(b.g.j.h.name + \" instance already deleted\");\n};\nfunction Kb() {\n}\nvar Lb = (b, a, c) => {\n if (void 0 === b[a].l) {\n var d = b[a];\n b[a] = function(...e) {\n if (!b[a].l.hasOwnProperty(e.length)) {\n throw new O(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${b[a].l})!`);\n }\n return b[a].l[e.length].apply(this, e);\n };\n b[a].l = [];\n b[a].l[d.L] = d;\n }\n}, Mb = (b, a, c) => {\n if (k.hasOwnProperty(b)) {\n if (void 0 === c || void 0 !== k[b].l && void 0 !== k[b].l[c]) {\n throw new O(`Cannot register public name '${b}' twice`);\n }\n Lb(k, b, b);\n if (k.hasOwnProperty(c)) {\n throw new O(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);\n }\n k[b].l[c] = a;\n } else {\n k[b] = a, void 0 !== c && (k[b].nb = c);\n }\n}, Nb = b => {\n if (void 0 === b) {\n return \"_unknown\";\n }\n b = b.replace(/[^a-zA-Z0-9_]/g, \"$\");\n var a = b.charCodeAt(0);\n return 48 <= a && 57 >= a ? `_${b}` : b;\n};\nfunction Ob(b, a, c, d, e, f, l, h) {\n this.name = b;\n this.constructor = a;\n this.C = c;\n this.D = d;\n this.o = e;\n this.Qa = f;\n this.S = l;\n this.La = h;\n this.wa = [];\n}\nvar Pb = (b, a, c) => {\n for (; a !== c;) {\n if (!a.S) {\n throw new O(`Expected null or instance of ${c.name}, got an instance of ${a.name}`);\n }\n b = a.S(b);\n a = a.o;\n }\n return b;\n};\nfunction Qb(b, a) {\n if (null === a) {\n if (this.ea) {\n throw new O(`null is not a valid ${this.name}`);\n }\n return 0;\n }\n if (!a.g) {\n throw new O(`Cannot pass \"${Rb(a)}\" as a ${this.name}`);\n }\n if (!a.g.i) {\n throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n return Pb(a.g.i, a.g.j.h, this.h);\n}\nfunction Sb(b, a) {\n if (null === a) {\n if (this.ea) {\n throw new O(`null is not a valid ${this.name}`);\n }\n if (this.V) {\n var c = this.fa();\n null !== b && b.push(this.D, c);\n return c;\n }\n return 0;\n }\n if (!a || !a.g) {\n throw new O(`Cannot pass \"${Rb(a)}\" as a ${this.name}`);\n }\n if (!a.g.i) {\n throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n if (!this.U && a.g.j.U) {\n throw new O(`Cannot convert argument of type ${a.g.A ? a.g.A.name : a.g.j.name} to parameter type ${this.name}`);\n }\n c = Pb(a.g.i, a.g.j.h, this.h);\n if (this.V) {\n if (void 0 === a.g.s) {\n throw new O(\"Passing raw pointer to smart pointer is illegal\");\n }\n switch(this.gb) {\n case 0:\n if (a.g.A === this) {\n c = a.g.s;\n } else {\n throw new O(`Cannot convert argument of type ${a.g.A ? a.g.A.name : a.g.j.name} to parameter type ${this.name}`);\n }\n break;\n case 1:\n c = a.g.s;\n break;\n case 2:\n if (a.g.A === this) {\n c = a.g.s;\n } else {\n var d = a.clone();\n c = this.bb(c, bb(() => d[\"delete\"]()));\n null !== b && b.push(this.D, c);\n }\n break;\n default:\n throw new O(\"Unsupporting sharing policy\");\n }\n }\n return c;\n}\nfunction Tb(b, a) {\n if (null === a) {\n if (this.ea) {\n throw new O(`null is not a valid ${this.name}`);\n }\n return 0;\n }\n if (!a.g) {\n throw new O(`Cannot pass \"${Rb(a)}\" as a ${this.name}`);\n }\n if (!a.g.i) {\n throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n if (a.g.j.U) {\n throw new O(`Cannot convert argument of type ${a.g.j.name} to parameter type ${this.name}`);\n }\n return Pb(a.g.i, a.g.j.h, this.h);\n}\nfunction Ub(b, a, c, d, e, f, l, h, n, m, r) {\n this.name = b;\n this.h = a;\n this.ea = c;\n this.U = d;\n this.V = e;\n this.ab = f;\n this.gb = l;\n this.xa = h;\n this.fa = n;\n this.bb = m;\n this.D = r;\n e || void 0 !== a.o ? this.toWireType = Sb : (this.toWireType = d ? Qb : Tb, this.B = null);\n}\nvar Vb = (b, a, c) => {\n if (!k.hasOwnProperty(b)) {\n throw new zb(\"Replacing nonexistent public symbol\");\n }\n void 0 !== k[b].l && void 0 !== c ? k[b].l[c] = a : (k[b] = a, k[b].L = c);\n}, Wb = [], Xb, Yb = b => {\n var a = Wb[b];\n a || (b >= Wb.length && (Wb.length = b + 1), Wb[b] = a = Xb.get(b));\n return a;\n}, Zb = (b, a, c = []) => {\n b.includes(\"j\") ? (b = b.replace(/p/g, \"i\"), a = (0,k[\"dynCall_\" + b])(a, ...c)) : a = Yb(a)(...c);\n return a;\n}, $b = (b, a) => (...c) => Zb(b, a, c), Y = (b, a) => {\n b = S(b);\n var c = b.includes(\"j\") ? $b(b, a) : Yb(a);\n if (\"function\" != typeof c) {\n throw new O(`unknown function pointer with signature ${b}: ${a}`);\n }\n return c;\n}, ac, bc = (b, a) => {\n function c(f) {\n e[f] || kb[f] || (Gb[f] ? Gb[f].forEach(c) : (d.push(f), e[f] = !0));\n }\n var d = [], e = {};\n a.forEach(c);\n throw new ac(`${b}: ` + d.map(nb).join([\", \"]));\n};\nfunction cc(b) {\n for (var a = 1; a < b.length; ++a) {\n if (null !== b[a] && void 0 === b[a].B) {\n return !0;\n }\n }\n return !1;\n}\nfunction dc(b, a, c, d, e) {\n var f = a.length;\n if (2 > f) {\n throw new O(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");\n }\n var l = null !== a[1] && null !== c, h = cc(a), n = \"void\" !== a[0].name, m = f - 2, r = Array(m), w = [], z = [];\n return $a(b, function(...g) {\n if (g.length !== m) {\n throw new O(`function ${b} called with ${g.length} arguments, expected ${m}`);\n }\n z.length = 0;\n w.length = l ? 2 : 1;\n w[0] = e;\n if (l) {\n var t = a[1].toWireType(z, this);\n w[1] = t;\n }\n for (var q = 0; q < m; ++q) {\n r[q] = a[q + 2].toWireType(z, g[q]), w.push(r[q]);\n }\n g = d(...w);\n if (h) {\n Db(z);\n } else {\n for (q = l ? 1 : 2; q < a.length; q++) {\n var G = 1 === q ? t : r[q - 2];\n null !== a[q].B && a[q].B(G);\n }\n }\n t = n ? a[0].fromWireType(g) : void 0;\n return t;\n });\n}\nvar ec = (b, a) => {\n for (var c = [], d = 0; d < b; d++) {\n c.push(M[a + 4 * d >> 2]);\n }\n return c;\n}, fc = b => {\n b = b.trim();\n const a = b.indexOf(\"(\");\n return -1 !== a ? b.substr(0, a) : b;\n}, gc = (b, a, c) => {\n if (!(b instanceof Object)) {\n throw new O(`${c} with invalid \"this\": ${b}`);\n }\n if (!(b instanceof a.h.constructor)) {\n throw new O(`${c} incompatible with \"this\" of type ${b.constructor.name}`);\n }\n if (!b.g.i) {\n throw new O(`cannot call emscripten binding method ${c} on deleted object`);\n }\n return Pb(b.g.i, b.g.j.h, a.h);\n}, hc = b => {\n 9 < b && 0 === --N[b + 1] && (N[b] = void 0, ab.push(b));\n}, ic = {name:\"emscripten::val\", fromWireType:b => {\n var a = R(b);\n hc(b);\n return a;\n}, toWireType:(b, a) => bb(a), argPackAdvance:8, readValueFromPointer:Eb, B:null,}, jc = (b, a, c) => {\n switch(a) {\n case 1:\n return c ? function(d) {\n return this.fromWireType(Ea[d]);\n } : function(d) {\n return this.fromWireType(J[d]);\n };\n case 2:\n return c ? function(d) {\n return this.fromWireType(Fa[d >> 1]);\n } : function(d) {\n return this.fromWireType(Ga[d >> 1]);\n };\n case 4:\n return c ? function(d) {\n return this.fromWireType(K[d >> 2]);\n } : function(d) {\n return this.fromWireType(M[d >> 2]);\n };\n default:\n throw new TypeError(`invalid integer width (${a}): ${b}`);\n }\n}, Rb = b => {\n if (null === b) {\n return \"null\";\n }\n var a = typeof b;\n return \"object\" === a || \"array\" === a || \"function\" === a ? b.toString() : \"\" + b;\n}, kc = (b, a) => {\n switch(a) {\n case 4:\n return function(c) {\n return this.fromWireType(Ha[c >> 2]);\n };\n case 8:\n return function(c) {\n return this.fromWireType(Ia[c >> 3]);\n };\n default:\n throw new TypeError(`invalid float width (${a}): ${b}`);\n }\n}, lc = (b, a, c) => {\n switch(a) {\n case 1:\n return c ? d => Ea[d] : d => J[d];\n case 2:\n return c ? d => Fa[d >> 1] : d => Ga[d >> 1];\n case 4:\n return c ? d => K[d >> 2] : d => M[d >> 2];\n default:\n throw new TypeError(`invalid integer width (${a}): ${b}`);\n }\n}, mc = (b, a, c, d) => {\n if (0 < d) {\n d = c + d - 1;\n for (var e = 0; e < b.length; ++e) {\n var f = b.charCodeAt(e);\n if (55296 <= f && 57343 >= f) {\n var l = b.charCodeAt(++e);\n f = 65536 + ((f & 1023) << 10) | l & 1023;\n }\n if (127 >= f) {\n if (c >= d) {\n break;\n }\n a[c++] = f;\n } else {\n if (2047 >= f) {\n if (c + 1 >= d) {\n break;\n }\n a[c++] = 192 | f >> 6;\n } else {\n if (65535 >= f) {\n if (c + 2 >= d) {\n break;\n }\n a[c++] = 224 | f >> 12;\n } else {\n if (c + 3 >= d) {\n break;\n }\n a[c++] = 240 | f >> 18;\n a[c++] = 128 | f >> 12 & 63;\n }\n a[c++] = 128 | f >> 6 & 63;\n }\n a[c++] = 128 | f & 63;\n }\n }\n a[c] = 0;\n }\n}, nc = b => {\n for (var a = 0, c = 0; c < b.length; ++c) {\n var d = b.charCodeAt(c);\n 127 >= d ? a++ : 2047 >= d ? a += 2 : 55296 <= d && 57343 >= d ? (a += 4, ++c) : a += 3;\n }\n return a;\n}, rc = \"undefined\" != typeof TextDecoder ? new TextDecoder(\"utf8\") : void 0, sc = (b, a, c) => {\n var d = a + c;\n for (c = a; b[c] && !(c >= d);) {\n ++c;\n }\n if (16 < c - a && b.buffer && rc) {\n return rc.decode(b.subarray(a, c));\n }\n for (d = \"\"; a < c;) {\n var e = b[a++];\n if (e & 128) {\n var f = b[a++] & 63;\n if (192 == (e & 224)) {\n d += String.fromCharCode((e & 31) << 6 | f);\n } else {\n var l = b[a++] & 63;\n e = 224 == (e & 240) ? (e & 15) << 12 | f << 6 | l : (e & 7) << 18 | f << 12 | l << 6 | b[a++] & 63;\n 65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));\n }\n } else {\n d += String.fromCharCode(e);\n }\n }\n return d;\n}, tc = \"undefined\" != typeof TextDecoder ? new TextDecoder(\"utf-16le\") : void 0, uc = (b, a) => {\n var c = b >> 1;\n for (var d = c + a / 2; !(c >= d) && Ga[c];) {\n ++c;\n }\n c <<= 1;\n if (32 < c - b && tc) {\n return tc.decode(J.subarray(b, c));\n }\n c = \"\";\n for (d = 0; !(d >= a / 2); ++d) {\n var e = Fa[b + 2 * d >> 1];\n if (0 == e) {\n break;\n }\n c += String.fromCharCode(e);\n }\n return c;\n}, vc = (b, a, c) => {\n c ??= 2147483647;\n if (2 > c) {\n return 0;\n }\n c -= 2;\n var d = a;\n c = c < 2 * b.length ? c / 2 : b.length;\n for (var e = 0; e < c; ++e) {\n Fa[a >> 1] = b.charCodeAt(e), a += 2;\n }\n Fa[a >> 1] = 0;\n return a - d;\n}, wc = b => 2 * b.length, xc = (b, a) => {\n for (var c = 0, d = \"\"; !(c >= a / 4);) {\n var e = K[b + 4 * c >> 2];\n if (0 == e) {\n break;\n }\n ++c;\n 65536 <= e ? (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023)) : d += String.fromCharCode(e);\n }\n return d;\n}, yc = (b, a, c) => {\n c ??= 2147483647;\n if (4 > c) {\n return 0;\n }\n var d = a;\n c = d + c - 4;\n for (var e = 0; e < b.length; ++e) {\n var f = b.charCodeAt(e);\n if (55296 <= f && 57343 >= f) {\n var l = b.charCodeAt(++e);\n f = 65536 + ((f & 1023) << 10) | l & 1023;\n }\n K[a >> 2] = f;\n a += 4;\n if (a + 4 > c) {\n break;\n }\n }\n K[a >> 2] = 0;\n return a - d;\n}, zc = b => {\n for (var a = 0, c = 0; c < b.length; ++c) {\n var d = b.charCodeAt(c);\n 55296 <= d && 57343 >= d && ++c;\n a += 4;\n }\n return a;\n}, Ac = (b, a, c) => {\n var d = [];\n b = b.toWireType(d, c);\n d.length && (M[a >> 2] = bb(d));\n return b;\n}, Bc = {}, Cc = b => {\n var a = Bc[b];\n return void 0 === a ? S(b) : a;\n}, Dc = [], Ec = b => {\n var a = Dc.length;\n Dc.push(b);\n return a;\n}, Fc = (b, a) => {\n for (var c = Array(b), d = 0; d < b; ++d) {\n c[d] = ob(M[a + 4 * d >> 2], \"parameter \" + d);\n }\n return c;\n}, Gc = Reflect.construct, Hc = {}, Jc = () => {\n if (!Ic) {\n var b = {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\", _:ta || \"./this.program\"}, a;\n for (a in Hc) {\n void 0 === Hc[a] ? delete b[a] : b[a] = Hc[a];\n }\n var c = [];\n for (a in b) {\n c.push(`${a}=${b[a]}`);\n }\n Ic = c;\n }\n return Ic;\n}, Ic, Kc = [null, [], []], Lc = b => 0 === b % 4 && (0 !== b % 100 || 0 === b % 400), Mc = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Nc = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nfunction Oc(b) {\n var a = Array(nc(b) + 1);\n mc(b, a, 0, a.length);\n return a;\n}\nvar Pc = (b, a, c, d) => {\n function e(g, t, q) {\n for (g = \"number\" == typeof g ? g.toString() : g || \"\"; g.length < t;) {\n g = q[0] + g;\n }\n return g;\n }\n function f(g, t) {\n return e(g, t, \"0\");\n }\n function l(g, t) {\n function q(F) {\n return 0 > F ? -1 : 0 < F ? 1 : 0;\n }\n var G;\n 0 === (G = q(g.getFullYear() - t.getFullYear())) && 0 === (G = q(g.getMonth() - t.getMonth())) && (G = q(g.getDate() - t.getDate()));\n return G;\n }\n function h(g) {\n switch(g.getDay()) {\n case 0:\n return new Date(g.getFullYear() - 1, 11, 29);\n case 1:\n return g;\n case 2:\n return new Date(g.getFullYear(), 0, 3);\n case 3:\n return new Date(g.getFullYear(), 0, 2);\n case 4:\n return new Date(g.getFullYear(), 0, 1);\n case 5:\n return new Date(g.getFullYear() - 1, 11, 31);\n case 6:\n return new Date(g.getFullYear() - 1, 11, 30);\n }\n }\n function n(g) {\n var t = g.J;\n for (g = new Date((new Date(g.K + 1900, 0, 1)).getTime()); 0 < t;) {\n var q = g.getMonth(), G = (Lc(g.getFullYear()) ? Mc : Nc)[q];\n if (t > G - g.getDate()) {\n t -= G - g.getDate() + 1, g.setDate(1), 11 > q ? g.setMonth(q + 1) : (g.setMonth(0), g.setFullYear(g.getFullYear() + 1));\n } else {\n g.setDate(g.getDate() + t);\n break;\n }\n }\n q = new Date(g.getFullYear() + 1, 0, 4);\n t = h(new Date(g.getFullYear(), 0, 4));\n q = h(q);\n return 0 >= l(t, g) ? 0 >= l(q, g) ? g.getFullYear() + 1 : g.getFullYear() : g.getFullYear() - 1;\n }\n var m = M[d + 40 >> 2];\n d = {jb:K[d >> 2], ib:K[d + 4 >> 2], Z:K[d + 8 >> 2], ha:K[d + 12 >> 2], $:K[d + 16 >> 2], K:K[d + 20 >> 2], F:K[d + 24 >> 2], J:K[d + 28 >> 2], ob:K[d + 32 >> 2], hb:K[d + 36 >> 2], kb:m ? m ? sc(J, m) : \"\" : \"\"};\n c = c ? sc(J, c) : \"\";\n m = {\"%c\":\"%a %b %d %H:%M:%S %Y\", \"%D\":\"%m/%d/%y\", \"%F\":\"%Y-%m-%d\", \"%h\":\"%b\", \"%r\":\"%I:%M:%S %p\", \"%R\":\"%H:%M\", \"%T\":\"%H:%M:%S\", \"%x\":\"%m/%d/%y\", \"%X\":\"%H:%M:%S\", \"%Ec\":\"%c\", \"%EC\":\"%C\", \"%Ex\":\"%m/%d/%y\", \"%EX\":\"%H:%M:%S\", \"%Ey\":\"%y\", \"%EY\":\"%Y\", \"%Od\":\"%d\", \"%Oe\":\"%e\", \"%OH\":\"%H\", \"%OI\":\"%I\", \"%Om\":\"%m\", \"%OM\":\"%M\", \"%OS\":\"%S\", \"%Ou\":\"%u\", \"%OU\":\"%U\", \"%OV\":\"%V\", \"%Ow\":\"%w\", \"%OW\":\"%W\", \"%Oy\":\"%y\",};\n for (var r in m) {\n c = c.replace(new RegExp(r, \"g\"), m[r]);\n }\n var w = \"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"), z = \"January February March April May June July August September October November December\".split(\" \");\n m = {\"%a\":g => w[g.F].substring(0, 3), \"%A\":g => w[g.F], \"%b\":g => z[g.$].substring(0, 3), \"%B\":g => z[g.$], \"%C\":g => f((g.K + 1900) / 100 | 0, 2), \"%d\":g => f(g.ha, 2), \"%e\":g => e(g.ha, 2, \" \"), \"%g\":g => n(g).toString().substring(2), \"%G\":n, \"%H\":g => f(g.Z, 2), \"%I\":g => {\n g = g.Z;\n 0 == g ? g = 12 : 12 < g && (g -= 12);\n return f(g, 2);\n }, \"%j\":g => {\n for (var t = 0, q = 0; q <= g.$ - 1; t += (Lc(g.K + 1900) ? Mc : Nc)[q++]) {\n }\n return f(g.ha + t, 3);\n }, \"%m\":g => f(g.$ + 1, 2), \"%M\":g => f(g.ib, 2), \"%n\":() => \"\\n\", \"%p\":g => 0 <= g.Z && 12 > g.Z ? \"AM\" : \"PM\", \"%S\":g => f(g.jb, 2), \"%t\":() => \"\\t\", \"%u\":g => g.F || 7, \"%U\":g => f(Math.floor((g.J + 7 - g.F) / 7), 2), \"%V\":g => {\n var t = Math.floor((g.J + 7 - (g.F + 6) % 7) / 7);\n 2 >= (g.F + 371 - g.J - 2) % 7 && t++;\n if (t) {\n 53 == t && (q = (g.F + 371 - g.J) % 7, 4 == q || 3 == q && Lc(g.K) || (t = 1));\n } else {\n t = 52;\n var q = (g.F + 7 - g.J - 1) % 7;\n (4 == q || 5 == q && Lc(g.K % 400 - 1)) && t++;\n }\n return f(t, 2);\n }, \"%w\":g => g.F, \"%W\":g => f(Math.floor((g.J + 7 - (g.F + 6) % 7) / 7), 2), \"%y\":g => (g.K + 1900).toString().substring(2), \"%Y\":g => g.K + 1900, \"%z\":g => {\n g = g.hb;\n var t = 0 <= g;\n g = Math.abs(g) / 60;\n return (t ? \"+\" : \"-\") + String(\"0000\" + (g / 60 * 100 + g % 60)).slice(-4);\n }, \"%Z\":g => g.kb, \"%%\":() => \"%\"};\n c = c.replace(/%%/g, \"\\x00\\x00\");\n for (r in m) {\n c.includes(r) && (c = c.replace(new RegExp(r, \"g\"), m[r](d)));\n }\n c = c.replace(/\\0\\0/g, \"%\");\n r = Oc(c);\n if (r.length > a) {\n return 0;\n }\n Ea.set(r, b);\n return r.length - 1;\n};\nO = k.BindingError = class extends Error {\n constructor(b) {\n super(b);\n this.name = \"BindingError\";\n }\n};\nN.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1,);\nk.count_emval_handles = () => N.length / 2 - 5 - ab.length;\ndb = k.PureVirtualError = cb(\"PureVirtualError\");\nfor (var Qc = Array(256), Rc = 0; 256 > Rc; ++Rc) {\n Qc[Rc] = String.fromCharCode(Rc);\n}\neb = Qc;\nk.getInheritedInstanceCount = () => Object.keys(ib).length;\nk.getLiveInheritedInstances = () => {\n var b = [], a;\n for (a in ib) {\n ib.hasOwnProperty(a) && b.push(ib[a]);\n }\n return b;\n};\nk.flushPendingDeletes = gb;\nk.setDelayFunction = b => {\n hb = b;\n fb.length && hb && hb(gb);\n};\nzb = k.InternalError = class extends Error {\n constructor(b) {\n super(b);\n this.name = \"InternalError\";\n }\n};\nObject.assign(Kb.prototype, {isAliasOf:function(b) {\n if (!(this instanceof Kb && b instanceof Kb)) {\n return !1;\n }\n var a = this.g.j.h, c = this.g.i;\n b.g = b.g;\n var d = b.g.j.h;\n for (b = b.g.i; a.o;) {\n c = a.S(c), a = a.o;\n }\n for (; d.o;) {\n b = d.S(b), d = d.o;\n }\n return a === d && c === b;\n}, clone:function() {\n this.g.i || Jb(this);\n if (this.g.O) {\n return this.g.count.value += 1, this;\n }\n var b = Ab, a = Object, c = a.create, d = Object.getPrototypeOf(this), e = this.g;\n b = b(c.call(a, d, {g:{value:{count:e.count, M:e.M, O:e.O, i:e.i, j:e.j, s:e.s, A:e.A,},}}));\n b.g.count.value += 1;\n b.g.M = !1;\n return b;\n}, [\"delete\"]() {\n this.g.i || Jb(this);\n if (this.g.M && !this.g.O) {\n throw new O(\"Object already scheduled for deletion\");\n }\n pb(this);\n var b = this.g;\n --b.count.value;\n 0 === b.count.value && (b.s ? b.A.D(b.s) : b.j.h.D(b.i));\n this.g.O || (this.g.s = void 0, this.g.i = void 0);\n}, isDeleted:function() {\n return !this.g.i;\n}, deleteLater:function() {\n this.g.i || Jb(this);\n if (this.g.M && !this.g.O) {\n throw new O(\"Object already scheduled for deletion\");\n }\n fb.push(this);\n 1 === fb.length && hb && hb(gb);\n this.g.M = !0;\n return this;\n},});\nObject.assign(Ub.prototype, {Ra(b) {\n this.xa && (b = this.xa(b));\n return b;\n}, pa(b) {\n this.D?.(b);\n}, argPackAdvance:8, readValueFromPointer:Eb, fromWireType:function(b) {\n function a() {\n return this.V ? Bb(this.h.C, {j:this.ab, i:c, A:this, s:b,}) : Bb(this.h.C, {j:this, i:b,});\n }\n var c = this.Ra(b);\n if (!c) {\n return this.pa(b), null;\n }\n var d = tb(this.h, c);\n if (void 0 !== d) {\n if (0 === d.g.count.value) {\n return d.g.i = c, d.g.s = b, d.clone();\n }\n d = d.clone();\n this.pa(b);\n return d;\n }\n d = this.h.Qa(c);\n d = sb[d];\n if (!d) {\n return a.call(this);\n }\n d = this.U ? d.Ha : d.pointerType;\n var e = rb(c, this.h, d.h);\n return null === e ? a.call(this) : this.V ? Bb(d.h.C, {j:d, i:e, A:this, s:b,}) : Bb(d.h.C, {j:d, i:e,});\n},});\nac = k.UnboundTypeError = cb(\"UnboundTypeError\");\nvar Tc = {_abort_js:() => {\n Ra(\"\");\n}, _embind_create_inheriting_constructor:(b, a, c) => {\n b = S(b);\n a = ob(a, \"wrapper\");\n c = R(c);\n var d = a.h, e = d.C, f = d.o.C, l = d.o.constructor;\n b = $a(b, function(...h) {\n d.o.wa.forEach(function(n) {\n if (this[n] === f[n]) {\n throw new db(`Pure virtual function ${n} must be implemented in JavaScript`);\n }\n }.bind(this));\n Object.defineProperty(this, \"__parent\", {value:e});\n this.__construct(...h);\n });\n e.__construct = function(...h) {\n if (this === e) {\n throw new O(\"Pass correct 'this' to __construct\");\n }\n h = l.implement(this, ...h);\n pb(h);\n var n = h.g;\n h.notifyOnDestruction();\n n.O = !0;\n Object.defineProperties(this, {g:{value:n}});\n Ab(this);\n h = n.i;\n h = jb(d, h);\n if (ib.hasOwnProperty(h)) {\n throw new O(`Tried to register registered instance: ${h}`);\n }\n ib[h] = this;\n };\n e.__destruct = function() {\n if (this === e) {\n throw new O(\"Pass correct 'this' to __destruct\");\n }\n pb(this);\n var h = this.g.i;\n h = jb(d, h);\n if (ib.hasOwnProperty(h)) {\n delete ib[h];\n } else {\n throw new O(`Tried to unregister unregistered instance: ${h}`);\n }\n };\n b.prototype = Object.create(e);\n Object.assign(b.prototype, c);\n return bb(b);\n}, _embind_finalize_value_object:b => {\n var a = Cb[b];\n delete Cb[b];\n var c = a.fa, d = a.D, e = a.sa, f = e.map(l => l.Ua).concat(e.map(l => l.eb));\n X([b], f, l => {\n var h = {};\n e.forEach((n, m) => {\n var r = l[m], w = n.Sa, z = n.Ta, g = l[m + e.length], t = n.cb, q = n.fb;\n h[n.Oa] = {read:G => r.fromWireType(w(z, G)), write:(G, F) => {\n var v = [];\n t(q, G, g.toWireType(v, F));\n Db(v);\n }};\n });\n return [{name:a.name, fromWireType:n => {\n var m = {}, r;\n for (r in h) {\n m[r] = h[r].read(n);\n }\n d(n);\n return m;\n }, toWireType:(n, m) => {\n for (var r in h) {\n if (!(r in m)) {\n throw new TypeError(`Missing field: \"${r}\"`);\n }\n }\n var w = c();\n for (r in h) {\n h[r].write(w, m[r]);\n }\n null !== n && n.push(d, w);\n return w;\n }, argPackAdvance:8, readValueFromPointer:Eb, B:d,}];\n });\n}, _embind_register_bigint:() => {\n}, _embind_register_bool:(b, a, c, d) => {\n a = S(a);\n Hb(b, {name:a, fromWireType:function(e) {\n return !!e;\n }, toWireType:function(e, f) {\n return f ? c : d;\n }, argPackAdvance:8, readValueFromPointer:function(e) {\n return this.fromWireType(J[e]);\n }, B:null,});\n}, _embind_register_class:(b, a, c, d, e, f, l, h, n, m, r, w, z) => {\n r = S(r);\n f = Y(e, f);\n h &&= Y(l, h);\n m &&= Y(n, m);\n z = Y(w, z);\n var g = Nb(r);\n Mb(g, function() {\n bc(`Cannot construct ${r} due to unbound types`, [d]);\n });\n X([b, a, c], d ? [d] : [], t => {\n t = t[0];\n if (d) {\n var q = t.h;\n var G = q.C;\n } else {\n G = Kb.prototype;\n }\n t = $a(r, function(...L) {\n if (Object.getPrototypeOf(this) !== F) {\n throw new O(\"Use 'new' to construct \" + r);\n }\n if (void 0 === v.I) {\n throw new O(r + \" has no accessible constructor\");\n }\n var Q = v.I[L.length];\n if (void 0 === Q) {\n throw new O(`Tried to invoke ctor of ${r} with invalid number of parameters (${L.length}) - expected (${Object.keys(v.I).toString()}) parameters instead!`);\n }\n return Q.apply(this, L);\n });\n var F = Object.create(G, {constructor:{value:t},});\n t.prototype = F;\n var v = new Ob(r, t, F, z, q, f, h, m);\n if (v.o) {\n var H;\n (H = v.o).T ?? (H.T = []);\n v.o.T.push(v);\n }\n q = new Ub(r, v, !0, !1, !1);\n H = new Ub(r + \"*\", v, !1, !1, !1);\n G = new Ub(r + \" const*\", v, !1, !0, !1);\n sb[b] = {pointerType:H, Ha:G};\n Vb(g, t);\n return [q, H, G];\n });\n}, _embind_register_class_class_function:(b, a, c, d, e, f, l) => {\n var h = ec(c, d);\n a = S(a);\n a = fc(a);\n f = Y(e, f);\n X([], [b], n => {\n function m() {\n bc(`Cannot call ${r} due to unbound types`, h);\n }\n n = n[0];\n var r = `${n.name}.${a}`;\n a.startsWith(\"@@\") && (a = Symbol[a.substring(2)]);\n var w = n.h.constructor;\n void 0 === w[a] ? (m.L = c - 1, w[a] = m) : (Lb(w, a, r), w[a].l[c - 1] = m);\n X([], h, z => {\n z = dc(r, [z[0], null].concat(z.slice(1)), null, f, l);\n void 0 === w[a].l ? (z.L = c - 1, w[a] = z) : w[a].l[c - 1] = z;\n if (n.h.T) {\n for (const g of n.h.T) {\n g.constructor.hasOwnProperty(a) || (g.constructor[a] = z);\n }\n }\n return [];\n });\n return [];\n });\n}, _embind_register_class_class_property:(b, a, c, d, e, f, l, h) => {\n a = S(a);\n f = Y(e, f);\n X([], [b], n => {\n n = n[0];\n var m = `${n.name}.${a}`, r = {get() {\n bc(`Cannot access ${m} due to unbound types`, [c]);\n }, enumerable:!0, configurable:!0};\n r.set = h ? () => {\n bc(`Cannot access ${m} due to unbound types`, [c]);\n } : () => {\n throw new O(`${m} is a read-only property`);\n };\n Object.defineProperty(n.h.constructor, a, r);\n X([], [c], w => {\n w = w[0];\n var z = {get() {\n return w.fromWireType(f(d));\n }, enumerable:!0};\n h && (h = Y(l, h), z.set = g => {\n var t = [];\n h(d, w.toWireType(t, g));\n Db(t);\n });\n Object.defineProperty(n.h.constructor, a, z);\n return [];\n });\n return [];\n });\n}, _embind_register_class_constructor:(b, a, c, d, e, f) => {\n var l = ec(a, c);\n e = Y(d, e);\n X([], [b], h => {\n h = h[0];\n var n = `constructor ${h.name}`;\n void 0 === h.h.I && (h.h.I = []);\n if (void 0 !== h.h.I[a - 1]) {\n throw new O(`Cannot register multiple constructors with identical number of parameters (${a - 1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);\n }\n h.h.I[a - 1] = () => {\n bc(`Cannot construct ${h.name} due to unbound types`, l);\n };\n X([], l, m => {\n m.splice(1, 0, null);\n h.h.I[a - 1] = dc(n, m, null, e, f);\n return [];\n });\n return [];\n });\n}, _embind_register_class_function:(b, a, c, d, e, f, l, h) => {\n var n = ec(c, d);\n a = S(a);\n a = fc(a);\n f = Y(e, f);\n X([], [b], m => {\n function r() {\n bc(`Cannot call ${w} due to unbound types`, n);\n }\n m = m[0];\n var w = `${m.name}.${a}`;\n a.startsWith(\"@@\") && (a = Symbol[a.substring(2)]);\n h && m.h.wa.push(a);\n var z = m.h.C, g = z[a];\n void 0 === g || void 0 === g.l && g.className !== m.name && g.L === c - 2 ? (r.L = c - 2, r.className = m.name, z[a] = r) : (Lb(z, a, w), z[a].l[c - 2] = r);\n X([], n, t => {\n t = dc(w, t, m, f, l);\n void 0 === z[a].l ? (t.L = c - 2, z[a] = t) : z[a].l[c - 2] = t;\n return [];\n });\n return [];\n });\n}, _embind_register_class_property:(b, a, c, d, e, f, l, h, n, m) => {\n a = S(a);\n e = Y(d, e);\n X([], [b], r => {\n r = r[0];\n var w = `${r.name}.${a}`, z = {get() {\n bc(`Cannot access ${w} due to unbound types`, [c, l]);\n }, enumerable:!0, configurable:!0};\n z.set = n ? () => bc(`Cannot access ${w} due to unbound types`, [c, l]) : () => {\n throw new O(w + \" is a read-only property\");\n };\n Object.defineProperty(r.h.C, a, z);\n X([], n ? [c, l] : [c], g => {\n var t = g[0], q = {get() {\n var F = gc(this, r, w + \" getter\");\n return t.fromWireType(e(f, F));\n }, enumerable:!0};\n if (n) {\n n = Y(h, n);\n var G = g[1];\n q.set = function(F) {\n var v = gc(this, r, w + \" setter\"), H = [];\n n(m, v, G.toWireType(H, F));\n Db(H);\n };\n }\n Object.defineProperty(r.h.C, a, q);\n return [];\n });\n return [];\n });\n}, _embind_register_emval:b => Hb(b, ic), _embind_register_enum:(b, a, c, d) => {\n function e() {\n }\n a = S(a);\n e.values = {};\n Hb(b, {name:a, constructor:e, fromWireType:function(f) {\n return this.constructor.values[f];\n }, toWireType:(f, l) => l.value, argPackAdvance:8, readValueFromPointer:jc(a, c, d), B:null,});\n Mb(a, e);\n}, _embind_register_enum_value:(b, a, c) => {\n var d = ob(b, \"enum\");\n a = S(a);\n b = d.constructor;\n d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:$a(`${d.name}_${a}`, function() {\n })},});\n b.values[c] = d;\n b[a] = d;\n}, _embind_register_float:(b, a, c) => {\n a = S(a);\n Hb(b, {name:a, fromWireType:d => d, toWireType:(d, e) => e, argPackAdvance:8, readValueFromPointer:kc(a, c), B:null,});\n}, _embind_register_function:(b, a, c, d, e, f) => {\n var l = ec(a, c);\n b = S(b);\n b = fc(b);\n e = Y(d, e);\n Mb(b, function() {\n bc(`Cannot call ${b} due to unbound types`, l);\n }, a - 1);\n X([], l, h => {\n Vb(b, dc(b, [h[0], null].concat(h.slice(1)), null, e, f), a - 1);\n return [];\n });\n}, _embind_register_integer:(b, a, c, d, e) => {\n a = S(a);\n -1 === e && (e = 4294967295);\n e = h => h;\n if (0 === d) {\n var f = 32 - 8 * c;\n e = h => h << f >>> f;\n }\n var l = a.includes(\"unsigned\") ? function(h, n) {\n return n >>> 0;\n } : function(h, n) {\n return n;\n };\n Hb(b, {name:a, fromWireType:e, toWireType:l, argPackAdvance:8, readValueFromPointer:lc(a, c, 0 !== d), B:null,});\n}, _embind_register_memory_view:(b, a, c) => {\n function d(f) {\n return new e(Ea.buffer, M[f + 4 >> 2], M[f >> 2]);\n }\n var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][a];\n c = S(c);\n Hb(b, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Va:!0,});\n}, _embind_register_std_string:(b, a) => {\n a = S(a);\n var c = \"std::string\" === a;\n Hb(b, {name:a, fromWireType:function(d) {\n var e = M[d >> 2], f = d + 4;\n if (c) {\n for (var l = f, h = 0; h <= e; ++h) {\n var n = f + h;\n if (h == e || 0 == J[n]) {\n l = l ? sc(J, l, n - l) : \"\";\n if (void 0 === m) {\n var m = l;\n } else {\n m += String.fromCharCode(0), m += l;\n }\n l = n + 1;\n }\n }\n } else {\n m = Array(e);\n for (h = 0; h < e; ++h) {\n m[h] = String.fromCharCode(J[f + h]);\n }\n m = m.join(\"\");\n }\n mb(d);\n return m;\n }, toWireType:function(d, e) {\n e instanceof ArrayBuffer && (e = new Uint8Array(e));\n var f = \"string\" == typeof e;\n if (!(f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array)) {\n throw new O(\"Cannot pass non-string to std::string\");\n }\n var l = c && f ? nc(e) : e.length;\n var h = Sc(4 + l + 1), n = h + 4;\n M[h >> 2] = l;\n if (c && f) {\n mc(e, J, n, l + 1);\n } else {\n if (f) {\n for (f = 0; f < l; ++f) {\n var m = e.charCodeAt(f);\n if (255 < m) {\n throw mb(n), new O(\"String has UTF-16 code units that do not fit in 8 bits\");\n }\n J[n + f] = m;\n }\n } else {\n for (f = 0; f < l; ++f) {\n J[n + f] = e[f];\n }\n }\n }\n null !== d && d.push(mb, h);\n return h;\n }, argPackAdvance:8, readValueFromPointer:Eb, B(d) {\n mb(d);\n },});\n}, _embind_register_std_wstring:(b, a, c) => {\n c = S(c);\n if (2 === a) {\n var d = uc;\n var e = vc;\n var f = wc;\n var l = h => Ga[h >> 1];\n } else {\n 4 === a && (d = xc, e = yc, f = zc, l = h => M[h >> 2]);\n }\n Hb(b, {name:c, fromWireType:h => {\n for (var n = M[h >> 2], m, r = h + 4, w = 0; w <= n; ++w) {\n var z = h + 4 + w * a;\n if (w == n || 0 == l(z)) {\n r = d(r, z - r), void 0 === m ? m = r : (m += String.fromCharCode(0), m += r), r = z + a;\n }\n }\n mb(h);\n return m;\n }, toWireType:(h, n) => {\n if (\"string\" != typeof n) {\n throw new O(`Cannot pass non-string to C++ string type ${c}`);\n }\n var m = f(n), r = Sc(4 + m + a);\n M[r >> 2] = m / a;\n e(n, r + 4, m + a);\n null !== h && h.push(mb, r);\n return r;\n }, argPackAdvance:8, readValueFromPointer:Eb, B(h) {\n mb(h);\n }});\n}, _embind_register_value_object:(b, a, c, d, e, f) => {\n Cb[b] = {name:S(a), fa:Y(c, d), D:Y(e, f), sa:[],};\n}, _embind_register_value_object_field:(b, a, c, d, e, f, l, h, n, m) => {\n Cb[b].sa.push({Oa:S(a), Ua:c, Sa:Y(d, e), Ta:f, eb:l, cb:Y(h, n), fb:m,});\n}, _embind_register_void:(b, a) => {\n a = S(a);\n Hb(b, {mb:!0, name:a, argPackAdvance:0, fromWireType:() => {\n }, toWireType:() => {\n },});\n}, _emscripten_get_now_is_monotonic:() => 1, _emscripten_memcpy_js:(b, a, c) => J.copyWithin(b, a, a + c), _emval_as:(b, a, c) => {\n b = R(b);\n a = ob(a, \"emval::as\");\n return Ac(a, c, b);\n}, _emval_call_method:(b, a, c, d, e) => {\n b = Dc[b];\n a = R(a);\n c = Cc(c);\n return b(a, a[c], d, e);\n}, _emval_decref:hc, _emval_get_method_caller:(b, a, c) => {\n var d = Fc(b, a), e = d.shift();\n b--;\n var f = Array(b);\n a = `methodCaller<(${d.map(l => l.name).join(\", \")}) => ${e.name}>`;\n return Ec($a(a, (l, h, n, m) => {\n for (var r = 0, w = 0; w < b; ++w) {\n f[w] = d[w].readValueFromPointer(m + r), r += d[w].argPackAdvance;\n }\n l = 1 === c ? Gc(h, f) : h.apply(l, f);\n return Ac(e, n, l);\n }));\n}, _emval_get_module_property:b => {\n b = Cc(b);\n return bb(k[b]);\n}, _emval_get_property:(b, a) => {\n b = R(b);\n a = R(a);\n return bb(b[a]);\n}, _emval_incref:b => {\n 9 < b && (N[b + 1] += 1);\n}, _emval_new_array:() => bb([]), _emval_new_cstring:b => bb(Cc(b)), _emval_new_object:() => bb({}), _emval_run_destructors:b => {\n var a = R(b);\n Db(a);\n hc(b);\n}, _emval_set_property:(b, a, c) => {\n b = R(b);\n a = R(a);\n c = R(c);\n b[a] = c;\n}, _emval_take_value:(b, a) => {\n b = ob(b, \"_emval_take_value\");\n b = b.readValueFromPointer(a);\n return bb(b);\n}, emscripten_date_now:() => Date.now(), emscripten_get_now:() => performance.now(), emscripten_resize_heap:b => {\n var a = J.length;\n b >>>= 0;\n if (2147483648 < b) {\n return !1;\n }\n for (var c = 1; 4 >= c; c *= 2) {\n var d = a * (1 + 0.2 / c);\n d = Math.min(d, b + 100663296);\n var e = Math;\n d = Math.max(b, d);\n a: {\n e = (e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) - Ca.buffer.byteLength + 65535) / 65536;\n try {\n Ca.grow(e);\n Ja();\n var f = 1;\n break a;\n } catch (l) {\n }\n f = void 0;\n }\n if (f) {\n return !0;\n }\n }\n return !1;\n}, environ_get:(b, a) => {\n var c = 0;\n Jc().forEach((d, e) => {\n var f = a + c;\n e = M[b + 4 * e >> 2] = f;\n for (f = 0; f < d.length; ++f) {\n Ea[e++] = d.charCodeAt(f);\n }\n Ea[e] = 0;\n c += d.length + 1;\n });\n return 0;\n}, environ_sizes_get:(b, a) => {\n var c = Jc();\n M[b >> 2] = c.length;\n var d = 0;\n c.forEach(e => d += e.length + 1);\n M[a >> 2] = d;\n return 0;\n}, fd_close:() => 52, fd_seek:function() {\n return 70;\n}, fd_write:(b, a, c, d) => {\n for (var e = 0, f = 0; f < c; f++) {\n var l = M[a >> 2], h = M[a + 4 >> 2];\n a += 8;\n for (var n = 0; n < h; n++) {\n var m = J[l + n], r = Kc[b];\n 0 === m || 10 === m ? ((1 === b ? za : Aa)(sc(r, 0)), r.length = 0) : r.push(m);\n }\n e += h;\n }\n M[d >> 2] = e;\n return 0;\n}, strftime_l:(b, a, c, d) => Pc(b, a, c, d)}, Z = function() {\n function b(c) {\n Z = c.exports;\n Ca = Z.memory;\n Ja();\n Xb = Z.__indirect_function_table;\n La.unshift(Z.__wasm_call_ctors);\n Oa--;\n k.monitorRunDependencies?.(Oa);\n 0 == Oa && (null !== Pa && (clearInterval(Pa), Pa = null), Qa && (c = Qa, Qa = null, c()));\n return Z;\n }\n var a = {env:Tc, wasi_snapshot_preview1:Tc,};\n Oa++;\n k.monitorRunDependencies?.(Oa);\n if (k.instantiateWasm) {\n try {\n return k.instantiateWasm(a, b);\n } catch (c) {\n Aa(`Module.instantiateWasm callback failed with error: ${c}`), ba(c);\n }\n }\n Ta ||= Sa(\"canvas_advanced.wasm\") ? \"canvas_advanced.wasm\" : k.locateFile ? k.locateFile(\"canvas_advanced.wasm\", y) : y + \"canvas_advanced.wasm\";\n Xa(a, function(c) {\n b(c.instance);\n }).catch(ba);\n return {};\n}(), mb = b => (mb = Z.free)(b), Sc = b => (Sc = Z.malloc)(b), lb = b => (lb = Z.__getTypeName)(b);\nk.dynCall_jiji = (b, a, c, d, e) => (k.dynCall_jiji = Z.dynCall_jiji)(b, a, c, d, e);\nk.dynCall_viijii = (b, a, c, d, e, f, l) => (k.dynCall_viijii = Z.dynCall_viijii)(b, a, c, d, e, f, l);\nk.dynCall_iiiiij = (b, a, c, d, e, f, l) => (k.dynCall_iiiiij = Z.dynCall_iiiiij)(b, a, c, d, e, f, l);\nk.dynCall_iiiiijj = (b, a, c, d, e, f, l, h, n) => (k.dynCall_iiiiijj = Z.dynCall_iiiiijj)(b, a, c, d, e, f, l, h, n);\nk.dynCall_iiiiiijj = (b, a, c, d, e, f, l, h, n, m) => (k.dynCall_iiiiiijj = Z.dynCall_iiiiiijj)(b, a, c, d, e, f, l, h, n, m);\nvar Uc;\nQa = function Vc() {\n Uc || Wc();\n Uc || (Qa = Vc);\n};\nfunction Wc() {\n function b() {\n if (!Uc && (Uc = !0, k.calledRun = !0, !Da)) {\n Za(La);\n aa(k);\n if (k.onRuntimeInitialized) {\n k.onRuntimeInitialized();\n }\n if (k.postRun) {\n for (\"function\" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length;) {\n var a = k.postRun.shift();\n Ma.unshift(a);\n }\n }\n Za(Ma);\n }\n }\n if (!(0 < Oa)) {\n if (k.preRun) {\n for (\"function\" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length;) {\n Na();\n }\n }\n Za(Ka);\n 0 < Oa || (k.setStatus ? (k.setStatus(\"Running...\"), setTimeout(function() {\n setTimeout(function() {\n k.setStatus(\"\");\n }, 1);\n b();\n }, 1)) : b());\n }\n}\nif (k.preInit) {\n for (\"function\" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length;) {\n k.preInit.pop()();\n }\n}\nWc();\nmoduleRtn = da;\n\n\n\n return moduleRtn;\n}\n);\n})();\nexport default Rive;\n","export { SemanticTreeModel } from \"./semanticTreeModel\";\nexport { AccessibilityOverlay } from \"./accessibilityOverlay\";\nexport type { AccessibilityOverlayOptions } from \"./accessibilityOverlay\";\nexport {\n SemanticRole,\n SemanticState,\n SemanticTrait,\n SemanticActionType,\n SemanticMode,\n hasState,\n hasTrait,\n roleName,\n stateNames,\n traitNames,\n} from \"./types\";\nexport type {\n SemanticsDiffNode,\n SemanticsDiff,\n SemanticNodeData,\n RiveSemanticsOptions,\n} from \"./types\";\n","import type {\n SemanticsDiff,\n SemanticsDiffNode,\n SemanticNodeData,\n} from \"./types\";\nimport { roleName, stateNames, traitNames } from \"./types\";\n\n/**\n * Maintains an in-memory semantic tree built from incremental\n * {@link SemanticsDiff} updates received each frame from the WASM runtime.\n *\n * Processing order within {@link applyDiff} follows the contract defined in\n * `semantic_snapshot.hpp`: removed → added → moved → childrenUpdated →\n * updatedSemantic → updatedGeometry.\n */\nexport class SemanticTreeModel {\n private _nodesById: Map<number, SemanticNodeData> = new Map();\n private _roots: number[] = [];\n private _semanticVersion = 0;\n private _geometryVersion = 0;\n private _geometryChangedIds: Set<number> = new Set();\n private _semanticChangedIds: Set<number> = new Set();\n\n get nodeCount(): number {\n return this._nodesById.size;\n }\n\n /** Bumped when semantic content or tree structure changes. */\n get semanticVersion(): number {\n return this._semanticVersion;\n }\n\n /** Bumped when node bounds change without a semantic/structural change. */\n get geometryVersion(): number {\n return this._geometryVersion;\n }\n\n /** Node IDs whose bounds changed in the most recent {@link applyDiff}. */\n get geometryChangedIds(): ReadonlySet<number> {\n return this._geometryChangedIds;\n }\n\n /**\n * Node IDs whose semantic fields (role/label/value/hint/flags/headingLevel)\n * changed in the most recent {@link applyDiff}. Structural changes (moves,\n * child reorders, removals) bump {@link semanticVersion} but don't mark\n * nodes here — element attributes don't depend on tree position.\n */\n get semanticChangedIds(): ReadonlySet<number> {\n return this._semanticChangedIds;\n }\n\n /** Root node IDs in sibling order. */\n get roots(): readonly number[] {\n return this._roots;\n }\n\n /** Look up a node by its ID, or undefined if not in the tree. */\n nodeById(id: number): SemanticNodeData | undefined {\n return this._nodesById.get(id);\n }\n\n /** Current index of a node among its siblings (or roots), or -1 if absent. */\n private siblingIndexOf(id: number): number {\n const node = this._nodesById.get(id);\n if (!node) return -1;\n if (node.parentId < 0) return this._roots.indexOf(id);\n const parent = this._nodesById.get(node.parentId);\n return parent ? parent.children.indexOf(id) : -1;\n }\n\n /** Detach a node from its current parent (or from roots). */\n private detach(id: number): void {\n const node = this._nodesById.get(id);\n if (!node) return;\n if (node.parentId < 0) {\n const idx = this._roots.indexOf(id);\n if (idx !== -1) this._roots.splice(idx, 1);\n } else {\n const parent = this._nodesById.get(node.parentId);\n if (parent) {\n const idx = parent.children.indexOf(id);\n if (idx !== -1) parent.children.splice(idx, 1);\n }\n }\n }\n\n /** Attach a node under a parent at a given sibling index (or as root). */\n private attach(id: number, parentId: number, siblingIndex: number): void {\n const node = this._nodesById.get(id);\n if (!node) return;\n if (parentId < 0) {\n node.parentId = -1;\n const idx = clamp(siblingIndex, 0, this._roots.length);\n this._roots.splice(idx, 0, id);\n } else {\n const parent = this._nodesById.get(parentId);\n if (!parent) {\n node.parentId = -1;\n this._roots.push(id);\n } else {\n node.parentId = parentId;\n const idx = clamp(siblingIndex, 0, parent.children.length);\n parent.children.splice(idx, 0, id);\n }\n }\n }\n\n /** Recursively remove a node and all descendants. */\n private removeSubtree(id: number): void {\n const node = this._nodesById.get(id);\n if (!node) return;\n // Copy children array — we're mutating during traversal\n const kids = [...node.children];\n for (const child of kids) {\n this.removeSubtree(child);\n }\n this.detach(id);\n this._nodesById.delete(id);\n }\n\n /**\n * Apply an incremental diff to the tree. Bumps version counters and notifies\n * listeners only when the tree actually changed.\n *\n * No-op diffs (field values identical to current model) do not bump\n * versions — the native side guards against emitting these, but applyDiff\n * defends its subscribers regardless.\n */\n applyDiff(diff: SemanticsDiff): void {\n this._geometryChangedIds.clear();\n this._semanticChangedIds.clear();\n let semanticChanged = false;\n let geometryChanged = false;\n\n const markSemantic = (): void => {\n semanticChanged = true;\n };\n const markSemanticNode = (id: number): void => {\n semanticChanged = true;\n this._semanticChangedIds.add(id);\n };\n const markGeometry = (id: number): void => {\n geometryChanged = true;\n this._geometryChangedIds.add(id);\n };\n\n // 1. removed\n for (const id of diff.removed) {\n if (this._nodesById.has(id)) {\n this.removeSubtree(id);\n markSemantic();\n }\n }\n\n // 2. added\n for (const n of diff.added) {\n const existing = this._nodesById.get(n.id);\n if (existing) {\n if (semanticFieldsDiffer(existing, n)) {\n applySemantic(existing, n);\n markSemanticNode(n.id);\n }\n if (geometryFieldsDiffer(existing, n)) {\n applyGeometry(existing, n);\n markGeometry(n.id);\n }\n } else {\n this._nodesById.set(n.id, nodeFromDiff(n));\n markSemanticNode(n.id);\n markGeometry(n.id);\n }\n this.detach(n.id);\n this.attach(n.id, n.parentId, n.siblingIndex);\n }\n\n // 3. moved\n // The runtime emits a node as \"moved\" when its parentId OR siblingIndex\n // changes, so a reorder-only move (same parent, new index) is still a\n // structural/semantic change. Compare the actual position before and after\n // re-attaching so that geometry-only or no-op moves don't bump the semantic\n // version (which would defeat the semantic/geometry version split).\n for (const n of diff.moved) {\n const existing = this._nodesById.get(n.id);\n if (!existing) continue;\n const parentChanged = existing.parentId !== n.parentId;\n const oldIndex = this.siblingIndexOf(n.id);\n const geomChanged = geometryFieldsDiffer(existing, n);\n if (geomChanged) {\n applyGeometry(existing, n);\n markGeometry(n.id);\n }\n this.detach(n.id);\n this.attach(n.id, n.parentId, n.siblingIndex);\n if (parentChanged || this.siblingIndexOf(n.id) !== oldIndex) {\n markSemantic();\n }\n }\n\n // 4. childrenUpdated\n for (const update of diff.childrenUpdated) {\n if (update.parentId < 0) {\n const next = update.childIds.filter((id) => this._nodesById.has(id));\n if (!arraysEqual(this._roots, next)) {\n this._roots.length = 0;\n this._roots.push(...next);\n for (const id of this._roots) {\n const node = this._nodesById.get(id);\n if (node) node.parentId = -1;\n }\n markSemantic();\n }\n } else {\n const parent = this._nodesById.get(update.parentId);\n if (!parent) continue;\n const next = update.childIds.filter((id) => this._nodesById.has(id));\n if (!arraysEqual(parent.children, next)) {\n parent.children.length = 0;\n parent.children.push(...next);\n for (const id of parent.children) {\n const node = this._nodesById.get(id);\n if (node) node.parentId = update.parentId;\n }\n markSemantic();\n }\n }\n }\n\n // 5. updatedSemantic — semantic fields updated\n for (const n of diff.updatedSemantic) {\n const existing = this._nodesById.get(n.id);\n if (!existing) continue;\n if (!semanticFieldsDiffer(existing, n)) continue;\n applySemantic(existing, n);\n markSemanticNode(n.id);\n }\n\n // 6. updatedGeometry — bounds of a semantic node updated\n for (const n of diff.updatedGeometry) {\n const existing = this._nodesById.get(n.id);\n if (!existing) continue;\n if (!geometryFieldsDiffer(existing, n)) continue;\n applyGeometry(existing, n);\n markGeometry(n.id);\n }\n\n if (!semanticChanged && !geometryChanged) return;\n if (semanticChanged) this._semanticVersion++;\n if (geometryChanged) this._geometryVersion++;\n if (this._debug) {\n this.logDiff(diff, semanticChanged, geometryChanged);\n }\n }\n\n private _debug = false;\n\n /** Enable/disable debug logging of diffs to the console. */\n set debug(enabled: boolean) {\n this._debug = enabled;\n }\n\n private logDiff(\n diff: SemanticsDiff,\n semanticChanged: boolean,\n geometryChanged: boolean,\n ): void {\n const lines: string[] = [\n `[rive:semantics] semantic v${this._semanticVersion}` +\n (geometryChanged ? ` geometry v${this._geometryVersion}` : \"\") +\n (semanticChanged ? \"\" : \" (geometry-only)\"),\n ];\n for (const id of diff.removed) {\n lines.push(` - removed #${id}`);\n }\n for (const n of diff.added) {\n lines.push(\n ` + added #${n.id} ${roleName(n.role)}` +\n (n.label ? ` \"${n.label}\"` : \"\") +\n ` bounds:(${n.minX.toFixed(1)},${n.minY.toFixed(1)})-(${n.maxX.toFixed(1)},${n.maxY.toFixed(1)})` +\n ` states=[${stateNames(n.stateFlags)}]` +\n ` traits=[${traitNames(n.traitFlags)}]`\n );\n }\n for (const n of diff.moved) {\n lines.push(\n ` ~ moved #${n.id} → parent=${n.parentId} idx=${n.siblingIndex}` +\n ` bounds:(${n.minX.toFixed(1)},${n.minY.toFixed(1)})-(${n.maxX.toFixed(1)},${n.maxY.toFixed(1)})`\n );\n }\n for (const u of diff.childrenUpdated) {\n lines.push(\n ` ↕ children of ${\n u.parentId < 0 ? \"root\" : \"#\" + u.parentId\n }: [${u.childIds.join(\", \")}]`\n );\n }\n for (const n of diff.updatedSemantic) {\n lines.push(\n ` ✎ semantic #${n.id} ${roleName(n.role)}` +\n (n.label ? ` \"${n.label}\"` : \"\") +\n ` states=[${stateNames(n.stateFlags)}]` +\n ` traits=[${traitNames(n.traitFlags)}]`\n );\n }\n for (const n of diff.updatedGeometry) {\n lines.push(\n ` ⊞ geometry #${n.id} (${n.minX.toFixed(1)},${n.minY.toFixed(1)})-(${n.maxX.toFixed(1)},${n.maxY.toFixed(1)})`\n );\n }\n console.log(lines.join(\"\\n\"));\n }\n\n /**\n * Returns every node in depth-first order, paired with its depth level.\n * Useful for debug logging / rendering a flat list.\n */\n flattened(): Array<{ depth: number; node: SemanticNodeData }> {\n const out: Array<{ depth: number; node: SemanticNodeData }> = [];\n const walk = (id: number, depth: number) => {\n const node = this._nodesById.get(id);\n if (!node) return;\n out.push({ depth, node });\n for (const child of node.children) {\n walk(child, depth + 1);\n }\n };\n for (const root of this._roots) {\n walk(root, 0);\n }\n return out;\n }\n}\n\nfunction clamp(v: number, min: number, max: number): number {\n return v < min ? min : v > max ? max : v;\n}\n\nfunction arraysEqual(a: number[], b: number[]): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\nfunction nodeFromDiff(n: SemanticsDiffNode): SemanticNodeData {\n return {\n id: n.id,\n parentId: -1,\n role: n.role,\n label: n.label,\n value: n.value,\n hint: n.hint,\n stateFlags: n.stateFlags,\n traitFlags: n.traitFlags,\n headingLevel: n.headingLevel,\n minX: n.minX,\n minY: n.minY,\n maxX: n.maxX,\n maxY: n.maxY,\n children: [],\n };\n}\n\n/** Compare role/label/value/hint/stateFlags/traitFlags/headingLevel. */\nfunction semanticFieldsDiffer(\n a: SemanticNodeData,\n b: SemanticsDiffNode\n): boolean {\n return (\n a.role !== b.role ||\n a.label !== b.label ||\n a.value !== b.value ||\n a.hint !== b.hint ||\n a.stateFlags !== b.stateFlags ||\n a.traitFlags !== b.traitFlags ||\n a.headingLevel !== b.headingLevel\n );\n}\n\n/** Compare only bounds (minX/minY/maxX/maxY). */\nfunction geometryFieldsDiffer(\n a: SemanticNodeData,\n b: { minX: number; minY: number; maxX: number; maxY: number }\n): boolean {\n return (\n a.minX !== b.minX ||\n a.minY !== b.minY ||\n a.maxX !== b.maxX ||\n a.maxY !== b.maxY\n );\n}\n\nfunction applySemantic(target: SemanticNodeData, src: SemanticsDiffNode): void {\n target.role = src.role;\n target.label = src.label;\n target.value = src.value;\n target.hint = src.hint;\n target.stateFlags = src.stateFlags;\n target.traitFlags = src.traitFlags;\n target.headingLevel = src.headingLevel;\n}\n\nfunction applyGeometry(\n target: SemanticNodeData,\n src: { minX: number; minY: number; maxX: number; maxY: number }\n): void {\n target.minX = src.minX;\n target.minY = src.minY;\n target.maxX = src.maxX;\n target.maxY = src.maxY;\n}\n","import type {\n SemanticsDiffNode,\n SemanticsDiff,\n} from \"../rive_advanced.mjs\";\n\nexport type {\n SemanticsDiffNode,\n SemanticsDiff,\n};\n\n// ---------------------------------------------------------------------------\n// SemanticRole — mirrors rive::SemanticRole\n// ---------------------------------------------------------------------------\nexport const SemanticRole = {\n none: 0,\n button: 1,\n link: 2,\n checkbox: 3,\n switchControl: 4,\n slider: 5,\n textField: 6,\n text: 7,\n image: 8,\n group: 9,\n list: 10,\n listItem: 11,\n tab: 12,\n tabList: 13,\n dialog: 14,\n alertDialog: 15,\n radioGroup: 16,\n radioButton: 17,\n} as const;\n\nexport type SemanticRole = (typeof SemanticRole)[keyof typeof SemanticRole];\n\n// ---------------------------------------------------------------------------\n// SemanticState — mirrors rive::SemanticState bitmask\n//\n// Bits 0-7 are trait-gated (only meaningful when the corresponding\n// SemanticTrait is set). Bits 8-13 are non-trait states.\n// ---------------------------------------------------------------------------\nexport const SemanticState = {\n None: 0,\n\n // Trait-gated\n Expanded: 1 << 0, // requires Expandable\n Selected: 1 << 1, // requires Selectable\n Checked: 1 << 2, // requires Checkable\n Mixed: 1 << 3, // requires Checkable; wins over Checked\n Toggled: 1 << 4, // requires Toggleable\n Required: 1 << 5, // requires Requirable\n Disabled: 1 << 6, // requires Enablable\n Focused: 1 << 7, // requires Focusable\n\n // Non-trait\n Hidden: 1 << 8,\n LiveRegion: 1 << 9,\n ReadOnly: 1 << 10,\n Modal: 1 << 11,\n Obscured: 1 << 12,\n Multiline: 1 << 13,\n} as const;\n\nexport function hasState(flags: number, state: number): boolean {\n return (flags & state) !== 0;\n}\n\n/**\n * Controls when the instance builds semantic trees and accessibility overlays.\n *\n * - `disabled`: no semantics work.\n * - `enabled`: semantics and overlay are active immediately after load.\n */\nexport const SemanticMode = {\n Disabled: \"disabled\",\n Enabled: \"enabled\",\n} as const;\n\nexport type SemanticMode = (typeof SemanticMode)[keyof typeof SemanticMode];\n\nexport interface RiveSemanticsOptions {\n /**\n * aria-label for the semantic DOM container element\n */\n riveCanvasLabel?: string;\n}\n\n// ---------------------------------------------------------------------------\n// SemanticTrait — mirrors rive::SemanticTrait bitmask\n//\n// Traits declare what *capabilities* a node has. A state flag is only\n// meaningful when its corresponding trait is set.\n// ---------------------------------------------------------------------------\nexport const SemanticTrait = {\n None: 0,\n Expandable: 1 << 0,\n Selectable: 1 << 1,\n Checkable: 1 << 2,\n Toggleable: 1 << 3,\n Requirable: 1 << 4,\n Enablable: 1 << 5,\n Focusable: 1 << 6,\n} as const;\n\nexport function hasTrait(flags: number, trait: number): boolean {\n return (flags & trait) !== 0;\n}\n\n// ---------------------------------------------------------------------------\n// SemanticActionType — mirrors rive::SemanticActionType\n// ---------------------------------------------------------------------------\nexport const SemanticActionType = {\n tap: 0,\n increase: 1,\n decrease: 2,\n} as const;\n\nexport type SemanticActionType =\n (typeof SemanticActionType)[keyof typeof SemanticActionType];\n\n// ---------------------------------------------------------------------------\n// SemanticNodeData — in-memory representation of a single node in the tree\n// ---------------------------------------------------------------------------\nexport interface SemanticNodeData {\n readonly id: number;\n parentId: number;\n role: number;\n label: string;\n value: string;\n hint: string;\n stateFlags: number;\n traitFlags: number;\n headingLevel: number;\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n children: number[];\n}\n\n// ---------------------------------------------------------------------------\n// Helpers — readable names for bitmask flags\n// ---------------------------------------------------------------------------\n\nconst _roleNames: Record<number, string> = {};\nfor (const [name, val] of Object.entries(SemanticRole)) {\n _roleNames[val as number] = name;\n}\n\nconst _stateEntries = Object.entries(SemanticState).filter(\n ([, v]) => v !== 0\n) as [string, number][];\n\nconst _traitEntries = Object.entries(SemanticTrait).filter(\n ([, v]) => v !== 0\n) as [string, number][];\n\nexport function roleName(role: number): string {\n return _roleNames[role] ?? `unknown(${role})`;\n}\n\nexport function stateNames(flags: number): string {\n if (flags === 0) return \"none\";\n const active: string[] = [];\n for (const [name, bit] of _stateEntries) {\n if (flags & bit) active.push(name);\n }\n return active.join(\", \") || \"none\";\n}\n\nexport function traitNames(flags: number): string {\n if (flags === 0) return \"none\";\n const active: string[] = [];\n for (const [name, bit] of _traitEntries) {\n if (flags & bit) active.push(name);\n }\n return active.join(\", \") || \"none\";\n}\n","import type * as rc from \"../rive_advanced.mjs\";\nimport type { SemanticTreeModel } from \"./semanticTreeModel\";\nimport type { SemanticNodeData } from \"./types\";\nimport {\n SemanticRole,\n SemanticState,\n SemanticTrait,\n SemanticActionType,\n RiveSemanticsOptions,\n hasState,\n hasTrait,\n} from \"./types\";\n\n// ---------------------------------------------------------------------------\n// Public interface\n// ---------------------------------------------------------------------------\n\nexport interface AccessibilityOverlayOptions {\n canvas: HTMLCanvasElement;\n /** Unique string per Rive instance (used for prefixed IDs). */\n instanceId: string;\n /** Optional options for controlling semantic tree behavior and rendering */\n semanticsOptions: RiveSemanticsOptions;\n /** Callback to fire a semantic action back into the state machine. */\n fireAction: (nodeId: number, actionType: SemanticActionType) => void;\n /** Callback when AT focuses a semantic node (routes to SemanticManager::requestFocus). */\n requestFocus: (nodeId: number) => void;\n /** Callback when AT focus leaves a semantic node. */\n clearFocus: () => void;\n /**\n * When false (default), the overlay only moves focus while focus is already\n * inside Rive (overlay or canvas); when true it may also pull focus from outside Rive.\n */\n allowFocusInterrupt?: boolean;\n}\n\n/**\n * Indication of what changed since the last overlay update.\n *\n * - `semanticChanged` — semantic tree content/structure changed; attributes,\n * DOM order, and stale removal need reconciling.\n * - `nodeGeometryChanged` — node bounds changed in the tree model.\n * - `layoutChanged` — canvas size/position changed (or the transform container\n * hasn't been created yet); the artboard→canvas transform must be recomputed.\n */\nexport interface OverlayChange {\n semanticChanged: boolean;\n nodeGeometryChanged: boolean;\n layoutChanged: boolean;\n}\n\n/**\n * Creates and manages an invisible DOM tree overlaying a Rive canvas. This is for\n * screen readers to discover and interact with the Rive content.\n *\n * Each semantic node in the {@link SemanticTreeModel} gets a corresponding\n * DOM element with appropriate ARIA role, states, and action handlers so\n * assistive technologies (i.e. screen readers) can discover\n * and interact with the Rive content.\n *\n * Each node receives a prefixed ID (`id=rive-{instanceId}-sem-{nodeId}`) to avoid host-page ID collisions.\n * The nodeID is Rive's semantic node ID from core runtime.\n * Each node is styled with `pointer-events: none`. Interactive nodes can receive\n * programmatic focus and keydown events without entering the browser Tab order.\n */\nexport class AccessibilityOverlay {\n private container: HTMLDivElement;\n private canvas: HTMLCanvasElement;\n private semanticsOptions: RiveSemanticsOptions;\n private elements: Map<number, HTMLElement> = new Map();\n /** Visually-hidden description spans keyed by node ID, referenced by aria-describedby. */\n private descElements: Map<number, HTMLSpanElement> = new Map();\n private instanceId: string;\n private fireAction: (nodeId: number, actionType: SemanticActionType) => void;\n private requestFocus: (nodeId: number) => void;\n private clearFocus: () => void;\n private lastSemanticVersion = -1;\n private lastGeometryVersion = -1;\n /** Text elements whose fit-scale needs recomputing, batched per update (see flushTextGeometry). */\n private pendingTextGeometry: HTMLElement[] = [];\n /** Last measured box-size|text key per text element, to skip redundant re-measures. */\n private textGeometryKeys: WeakMap<HTMLElement, string> = new WeakMap();\n private lastCanvasPositioning: { width: number; height: number; offsetTop: number; offsetLeft: number } = {\n width: -1, height: -1, offsetTop: -1, offsetLeft: -1,\n }\n /**\n * Set when a ResizeObserver/window-resize signals the canvas geometry may have\n * changed, cleared once the transform is re-synced. Lets {@link needsUpdate}\n * report geometry changes without a per-frame `getBoundingClientRect()` reflow.\n * Starts true so the first update computes the transform.\n */\n private _geometryDirty = true;\n /** True while reconciling the DOM (reserved for future focus-sync guards). */\n private isUpdating = false;\n /** See {@link AccessibilityOverlayOptions.allowFocusInterrupt}. */\n private allowFocusInterrupt: boolean;\n /**\n * Single child div of the overlay container that carries the artboard→CSS\n * transform. All semantic node elements are children of this div and express\n * their positions in raw artboard-space coordinates. The CSS transform on\n * this container maps artboard units to CSS pixels in one GPU pass — no\n * per-node matrix multiplication required.\n */\n private transformContainer: HTMLDivElement | null = null;\n private _artboardBounds: rc.AABB = { minX: 0, minY: 0, maxX: 0, maxY: 0 };\n\n private repositionTimer: ReturnType<typeof setTimeout> | null = null;\n private canvasResizeObserver: ResizeObserver | null = null;\n private parentResizeObserver: ResizeObserver | null = null;\n /**\n * Detects canvas *position* drift. See {@link observePosition}.\n */\n private positionObserver: IntersectionObserver | null = null;\n private readonly _onWindowResize = (): void => this.scheduleReposition();\n\n constructor(options: AccessibilityOverlayOptions) {\n this.instanceId = options.instanceId;\n this.fireAction = options.fireAction;\n this.requestFocus = options.requestFocus;\n this.clearFocus = options.clearFocus;\n this.canvas = options.canvas;\n this.semanticsOptions = options.semanticsOptions;\n this.allowFocusInterrupt = options.allowFocusInterrupt ?? false;\n this.container = this.createContainer(options.canvas);\n this.attachPositionObservers();\n }\n\n getSemanticOverlayContainer(): HTMLDivElement {\n return this.container;\n }\n\n // ---- Container lifecycle ----\n\n // Keep the a11y tree overlay matched to the canvas's position and size:\n // 1. The canvas resized — ResizeObserver\n // 2. The canvas's parent resized — ResizeObserver\n // 3. The window resized — resize event\n // 4. The canvas moved/drifted — IntersectionObserver (see observePosition)\n\n private attachPositionObservers(): void {\n this.canvasResizeObserver = new ResizeObserver(() => this.scheduleReposition());\n this.canvasResizeObserver.observe(this.canvas);\n\n const parent = this.canvas.parentElement;\n if (parent) {\n this.parentResizeObserver = new ResizeObserver(() => this.scheduleReposition());\n this.parentResizeObserver.observe(parent);\n }\n\n window.addEventListener(\"resize\", this._onWindowResize);\n\n this.observePosition();\n }\n\n /**\n * Arms an IntersectionObserver whose root box is bounded to the canvas, so it\n * fires when the canvas moves relative to the viewport — position drift that\n * no ResizeObserver reports. Lets us re-sync the overlay container on a move\n * instead of recalculating the canvas bounding box every frame.\n */\n private observePosition(): void {\n if (typeof IntersectionObserver === \"undefined\") return;\n this.positionObserver?.disconnect();\n this.positionObserver = null;\n\n const rect = this.canvas.getBoundingClientRect();\n // Can't frame a zero-area element; it will re-arm on the next reposition.\n if (!rect.width || !rect.height) return;\n\n // Shrink the viewport root box down to exactly the canvas: a negative inset\n // from each viewport edge to the matching canvas edge, in CSS shorthand\n // order (top, right, bottom, left). Rounded so sub-pixel jitter doesn't trip\n // the 1.0 threshold.\n const insetToPx = (v: number): string => `${-Math.round(v)}px`;\n const rootMargin = [\n rect.top, // top: viewport top → canvas top\n window.innerWidth - rect.right, // right: viewport right → canvas right\n window.innerHeight - rect.bottom, // bottom: viewport bottom → canvas bottom\n rect.left, // left: viewport left → canvas left\n ]\n .map(insetToPx)\n .join(\" \");\n\n // The observer emits an initial notification for the current (contained)\n // state; ignore that and only react to a subsequent move.\n let armed = false;\n this.positionObserver = new IntersectionObserver(\n () => {\n if (!armed) {\n armed = true;\n return;\n }\n this.scheduleReposition();\n },\n { threshold: 1.0, rootMargin }\n );\n this.positionObserver.observe(this.canvas);\n }\n\n private scheduleReposition(): void {\n // A resize/move may have changed canvas size/scale/position; force a\n // transform recompute on the next frame's update.\n this._geometryDirty = true;\n if (this.repositionTimer !== null) return;\n this.repositionTimer = setTimeout(() => {\n this.repositionTimer = null;\n this.syncContainerGeometry();\n // Re-arm the position observer at the canvas's new location.\n this.observePosition();\n }, 500); // Throttle to avoid rapid style recalculations\n }\n\n private syncContainerGeometry(): void {\n const rect = this.canvas.getBoundingClientRect();\n const top = this.canvas.offsetTop;\n const left = this.canvas.offsetLeft;\n if (\n rect.width === this.lastCanvasPositioning.width &&\n rect.height === this.lastCanvasPositioning.height &&\n top === this.lastCanvasPositioning.offsetTop &&\n left === this.lastCanvasPositioning.offsetLeft\n ) return;\n this.container.style.top = top + \"px\";\n this.container.style.left = left + \"px\";\n this.container.style.width = rect.width + \"px\";\n this.container.style.height = rect.height + \"px\";\n this.container.tabIndex = -1;\n this.lastCanvasPositioning.width = rect.width;\n this.lastCanvasPositioning.height = rect.height;\n this.lastCanvasPositioning.offsetTop = top;\n this.lastCanvasPositioning.offsetLeft = left;\n }\n\n private createContainer(canvas: HTMLCanvasElement): HTMLDivElement {\n const container = document.createElement(\"div\");\n container.id = `rive-a11y-${this.instanceId}`;\n container.setAttribute(\"role\", \"region\");\n container.setAttribute(\"aria-label\", this.semanticsOptions?.riveCanvasLabel ?? \"Rive animation\");\n // Size to the canvas's CSS layout box, not the parent container.\n const rect = canvas.getBoundingClientRect();\n container.style.cssText = [\n \"position:absolute\",\n `top:${canvas.offsetTop}px`,\n `left:${canvas.offsetLeft}px`,\n `width:${rect.width}px`,\n `height:${rect.height}px`,\n \"overflow:hidden\",\n \"pointer-events:none\",\n // Visually hidden but still in the accessibility tree.\n // `display:none` and `visibility:hidden` would hide from AT.\n \"opacity:0\",\n ].join(\";\");\n\n canvas.insertAdjacentElement(\"afterend\", container);\n return container;\n }\n\n /**\n * Returns what changed since the last update, or null if nothing changed.\n *\n * Callers use this to avoid recomputing the (relatively expensive)\n * artboard→canvas transform on frames where only node bounds changed in the\n * tree: the transform only needs recomputing when `layoutChanged` is true.\n */\n needsUpdate(tree: SemanticTreeModel): OverlayChange | null {\n const semanticChanged = tree.semanticVersion !== this.lastSemanticVersion;\n const nodeGeometryChanged =\n tree.geometryVersion !== this.lastGeometryVersion;\n const layoutChanged = this._geometryDirty || !this.transformContainer;\n if (!semanticChanged && !nodeGeometryChanged && !layoutChanged) return null;\n return { semanticChanged, nodeGeometryChanged, layoutChanged };\n }\n\n /**\n * Update the overlay DOM to reflect the current state of the semantic tree.\n * Call once per frame after `applyDiff` when {@link needsUpdate} reports a\n * change, when layout/transform inputs are dirty, or when a fresh\n * `forwardMat` is supplied (even if the tree versions are unchanged).\n *\n * @param tree The in-memory semantic tree model\n * @param forwardMat Artboard→canvas-pixel transform from `computeAlignment`,\n * or null to reuse the existing CSS transform on the\n * transform container\n * @param dpr Device pixel ratio used for the canvas backing store\n * @param artboardBounds The artboard's own bounding rectangle\n */\n update(\n tree: SemanticTreeModel,\n forwardMat: rc.Mat2D | null,\n dpr: number,\n artboardBounds: rc.AABB,\n change?: OverlayChange | null\n ): void {\n let overlayChange = change ?? this.needsUpdate(tree);\n if (!overlayChange && forwardMat) {\n overlayChange = {\n semanticChanged: false,\n nodeGeometryChanged: false,\n layoutChanged: true,\n };\n }\n if (!overlayChange) return;\n this.performUpdate(tree, forwardMat, dpr, artboardBounds, overlayChange);\n }\n\n private performUpdate(\n tree: SemanticTreeModel,\n forwardMat: rc.Mat2D | null,\n dpr: number,\n artboardBounds: rc.AABB,\n change: OverlayChange\n ): void {\n const { semanticChanged, nodeGeometryChanged } = change;\n // Per-node change sets only describe the most recent applyDiff. If more\n // than one semantic version elapsed since our last update (first build,\n // or a diff we never consumed), fall back to re-applying attributes on\n // every node rather than trusting an incomplete set.\n const reapplyAllAttributes =\n tree.semanticVersion - this.lastSemanticVersion > 1;\n this.lastSemanticVersion = tree.semanticVersion;\n this.lastGeometryVersion = tree.geometryVersion;\n\n this.isUpdating = true;\n\n this._artboardBounds = artboardBounds;\n\n // Container box + artboard transform only run when a fresh forwardMat was\n // supplied (layout/transform dirty). Node-only bounds updates reuse the\n // existing CSS transform and go through updateGeometryForChangedNodes.\n // Skipping syncContainerGeometry here on semantic-only frames avoids a\n // getBoundingClientRect() reflow on every animation frame. The throttled\n // scheduleReposition() path still keeps the container aligned when the page\n // layout shifts.\n if (forwardMat) {\n this.syncContainerGeometry();\n this.syncTransformContainer(forwardMat, dpr, artboardBounds);\n // Transform is now in sync with the latest layout.\n this._geometryDirty = false;\n }\n\n if (semanticChanged) {\n const rootEl = this.transformContainer ?? this.container;\n const activeIds = new Set<number>();\n\n this.rebuildChildren(\n rootEl,\n tree.roots as number[],\n tree,\n 0, // parentLeft in artboard space (transform container origin)\n 0, // parentTop in artboard space\n activeIds,\n reapplyAllAttributes\n );\n\n const staleIds: number[] = [];\n this.elements.forEach((_el, id) => {\n if (!activeIds.has(id)) staleIds.push(id);\n });\n for (const id of staleIds) {\n const el = this.elements.get(id);\n if (el && el.parentNode) el.parentNode.removeChild(el);\n this.elements.delete(id);\n const desc = this.descElements.get(id);\n if (desc && desc.parentNode) desc.parentNode.removeChild(desc);\n this.descElements.delete(id);\n }\n } else if (nodeGeometryChanged) {\n this.updateGeometryForChangedNodes(tree);\n }\n\n // Text scaling needs layout reads; batch them into one pass after all\n // position/attribute writes so each frame forces at most one reflow.\n this.flushTextGeometry();\n\n this.isUpdating = false;\n }\n\n /** Remove the overlay from the DOM entirely. */\n destroy(): void {\n if (this.repositionTimer !== null) {\n clearTimeout(this.repositionTimer);\n this.repositionTimer = null;\n }\n window.removeEventListener(\"resize\", this._onWindowResize);\n this.canvasResizeObserver?.disconnect();\n this.parentResizeObserver?.disconnect();\n this.positionObserver?.disconnect();\n if (this.container.parentNode) {\n this.container.parentNode.removeChild(this.container);\n }\n this.elements.clear();\n this.descElements.clear();\n this.pendingTextGeometry.length = 0;\n }\n\n // ---- Tree → DOM reconciliation ----\n\n /**\n * Reconcile a parent DOM element's children with an ordered list of\n * semantic node IDs. Creates, updates, and reorders elements as needed.\n *\n * Node positions are expressed in artboard-space coordinates. The CSS\n * transform on the transform container maps artboard units to CSS pixels,\n * so no per-node matrix multiplication is required here.\n *\n * @param parentArtboardLeft Absolute artboard minX of the parent node (0 for roots)\n * @param parentArtboardTop Absolute artboard minY of the parent node (0 for roots)\n */\n private rebuildChildren(\n parentEl: HTMLElement,\n childIds: number[],\n tree: SemanticTreeModel,\n parentArtboardLeft: number,\n parentArtboardTop: number,\n activeIds: Set<number>,\n applyAllAttributes: boolean\n ): void {\n for (let i = 0; i < childIds.length; i++) {\n const nodeId = childIds[i];\n const nodeData = tree.nodeById(nodeId);\n if (!nodeData) continue;\n\n activeIds.add(nodeId);\n\n let el = this.elements.get(nodeId);\n const isNew = !el;\n if (!el) {\n el = this.createElement(nodeData);\n this.elements.set(nodeId, el);\n }\n\n // Attributes are only applied to new elements and nodes whose semantic\n // fields changed in the latest diff. Skipping redundant setAttribute\n // calls eliminates WebKit AX notifications that knock VoiceOver off its\n // current element.\n if (isNew || applyAllAttributes || tree.semanticChangedIds.has(nodeId)) {\n this.applyAttributes(el, nodeData);\n }\n this.applyPosition(el, nodeData, parentArtboardLeft, parentArtboardTop);\n\n // Only touch the DOM tree if the element isn't already in the correct\n // position. Moving a focused element can blur it and knock AT off the\n // current node.\n const currentChild = parentEl.children[i] as HTMLElement | undefined;\n if (currentChild !== el) {\n if (currentChild) {\n parentEl.insertBefore(el, currentChild);\n } else {\n parentEl.appendChild(el);\n }\n }\n\n // Reflect the runtime Focused state into DOM focus. Runs after insertion\n // so the element is attached, and skips elements that already hold focus.\n // The cheap trait/state flag checks gate the (per-node) DOM queries below,\n // so the activeElement/closest/contains walks only run for a node that is\n // actually focusable + focused — not for every node on every frame.\n if (\n hasTrait(nodeData.traitFlags, SemanticTrait.Focusable) &&\n hasState(nodeData.stateFlags, SemanticState.Focused)\n ) {\n const active = document.activeElement as Element | null;\n // While focus is inside one of our modal dialogs, don't pull it back\n // out to a background node.\n const focusedModal = active?.closest('[aria-modal=\"true\"]');\n const trappedByModal =\n !!focusedModal &&\n this.container.contains(focusedModal) &&\n !focusedModal.contains(el);\n if (active !== el && !trappedByModal && this.canMoveFocus()) {\n el.focus();\n }\n }\n\n // Recurse into children with this node's absolute artboard position.\n if (nodeData.children.length > 0) {\n this.rebuildChildren(\n el,\n nodeData.children,\n tree,\n nodeData.minX,\n nodeData.minY,\n activeIds,\n applyAllAttributes\n );\n }\n\n // Focus a modal/alert dialog when it first appears (after children are\n // built so the focus target can be resolved from the subtree).\n if (isNew) this.autoFocusDialogOnAppear(el, nodeData, tree);\n }\n }\n\n /**\n * Reposition only the subtrees whose bounds changed in the latest diff.\n * Descendants are included because node CSS positions are parent-relative.\n */\n private updateGeometryForChangedNodes(tree: SemanticTreeModel): void {\n for (const nodeId of Array.from(tree.geometryChangedIds)) {\n const nodeData = tree.nodeById(nodeId);\n if (!nodeData) continue;\n\n let parentLeft = 0;\n let parentTop = 0;\n let parentEl: HTMLElement = this.transformContainer ?? this.container;\n if (nodeData.parentId >= 0) {\n const parent = tree.nodeById(nodeData.parentId);\n if (parent) {\n parentLeft = parent.minX;\n parentTop = parent.minY;\n parentEl = this.elements.get(nodeData.parentId) ?? parentEl;\n }\n }\n\n this.updateNodeGeometrySubtree(\n tree,\n nodeId,\n parentLeft,\n parentTop,\n parentEl\n );\n }\n }\n\n private updateNodeGeometrySubtree(\n tree: SemanticTreeModel,\n nodeId: number,\n parentArtboardLeft: number,\n parentArtboardTop: number,\n _parentEl: HTMLElement\n ): void {\n const nodeData = tree.nodeById(nodeId);\n if (!nodeData) return;\n const el = this.elements.get(nodeId);\n if (!el) return;\n\n this.applyPosition(el, nodeData, parentArtboardLeft, parentArtboardTop);\n\n for (const childId of nodeData.children) {\n this.updateNodeGeometrySubtree(\n tree,\n childId,\n nodeData.minX,\n nodeData.minY,\n el\n );\n }\n }\n\n /**\n * Whether the overlay may move focus now. Following focus already inside this\n * instance is always allowed; pulling it in from the host page is gated behind\n * allowFocusInterrupt (from the Rive class).\n */\n private canMoveFocus(): boolean {\n const active = document.activeElement as Element | null;\n const focusAlreadyInScope =\n active === this.canvas || this.container.contains(active);\n return focusAlreadyInScope || this.allowFocusInterrupt;\n }\n\n /**\n * Move focus into a newly appeared modal/alert dialog so screen readers\n * announce and read its content (web ATs don't auto-enter a freshly mounted\n * dialog). Skips when focus can't move (see canMoveFocus) or a descendant\n * already holds it. The dialog's aria-modal keeps focus trapped inside.\n */\n private autoFocusDialogOnAppear(\n el: HTMLElement,\n node: SemanticNodeData,\n tree: SemanticTreeModel\n ): void {\n if (!isModalDialogRole(node.role, node.stateFlags)) return;\n if (!this.canMoveFocus()) return;\n\n // A descendant already holds focus — don't override it.\n const active = document.activeElement;\n if (active && active !== el && el.contains(active)) return;\n\n const target = this.routeDefaultFocusTarget(node, tree) ?? el;\n if (!target.hasAttribute(\"tabindex\")) target.setAttribute(\"tabindex\", \"-1\");\n if (document.activeElement !== target) target.focus({ preventScroll: true });\n }\n\n /**\n * Resolve the element assistive technologies (AT) should focus on appearance. Walks the subtree\n * depth-first and returns the first focusable node's host element, else the\n * inner <span> of the first labeled leaf. Container and unlabeled nodes are\n * descended into but never focused. Returns null if nothing qualifies.\n */\n private routeDefaultFocusTarget(\n node: SemanticNodeData,\n tree: SemanticTreeModel\n ): HTMLElement | null {\n for (const childId of node.children) {\n const child = tree.nodeById(childId);\n if (!child) continue;\n const childEl = this.elements.get(childId);\n\n // Focusable node → its host element (even if it has children).\n if (childEl && isFocusableNode(child)) return childEl;\n\n // Container or unlabeled node → descend without focusing it.\n if (child.children.length > 0 || !child.label) {\n const nested = this.routeDefaultFocusTarget(child, tree);\n if (nested) return nested;\n continue;\n }\n\n // Labeled leaf → its inner label span.\n if (childEl) {\n return (childEl.querySelector(\":scope > span\") as HTMLElement | null) ?? childEl;\n }\n }\n return null;\n }\n\n // ---- Element creation ----\n\n /** Shared `id` prefix for all semantic node elements of this instance. */\n private get nodeIdPrefix(): string {\n return `rive-${this.instanceId}-sem-`;\n }\n\n /** Recover the semantic node ID from an overlay element, or null. */\n private nodeIdFromElement(el: Element): number | null {\n if (!el.id.startsWith(this.nodeIdPrefix)) return null;\n const raw = el.id.slice(this.nodeIdPrefix.length);\n // Guard the empty string explicitly: Number(\"\") is 0, not NaN.\n if (!raw) return null;\n const id = Number(raw);\n return Number.isNaN(id) ? null : id;\n }\n\n private createElement(node: SemanticNodeData): HTMLElement {\n const tag = tagForRole(node.role);\n const el = document.createElement(tag);\n el.id = `${this.nodeIdPrefix}${node.id}`;\n el.style.cssText = BASE_NODE_STYLE;\n\n if (node.role === SemanticRole.text) {\n // The positioned outer div is the AX element\n // VoiceOver uses for its highlight box; an inner <span> carries the text\n // without position:absolute (which would strip the span from VoiceOver's\n // bounds calculation).\n const textSpan = document.createElement(\"span\");\n textSpan.style.cssText = SPAN_EXP;\n el.appendChild(textSpan);\n }\n\n this.attachActionHandlers(el, node);\n return el;\n }\n\n // ---- Action handlers ----\n\n /**\n * Wire arrow-key roving focus for a group member (tab, radio). Arrow keys\n * move focus to the next/previous member (wrapping), optionally Home/End jump\n * to first/last, and the newly focused member receives a tap action.\n */\n private attachRovingNav(\n el: HTMLElement,\n opts: { members: () => HTMLElement[]; includeHomeEnd: boolean }\n ): void {\n el.addEventListener(\"keydown\", (e) => {\n let target: \"next\" | \"prev\" | \"first\" | \"last\" | null = null;\n if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") target = \"next\";\n else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") target = \"prev\";\n else if (opts.includeHomeEnd && e.key === \"Home\") target = \"first\";\n else if (opts.includeHomeEnd && e.key === \"End\") target = \"last\";\n if (!target) return;\n\n e.preventDefault();\n const members = opts.members();\n const idx = members.indexOf(el);\n if (idx < 0) return;\n\n const n = members.length;\n const next =\n target === \"next\" ? members[(idx + 1) % n]\n : target === \"prev\" ? members[(idx - 1 + n) % n]\n : target === \"first\" ? members[0]\n : members[n - 1];\n\n if (next && next !== el) {\n next.focus();\n const nextId = this.nodeIdFromElement(next);\n if (nextId !== null) this.fireAction(nextId, SemanticActionType.tap);\n }\n });\n }\n\n private attachActionHandlers(el: HTMLElement, node: SemanticNodeData): void {\n const role = node.role;\n const nodeId = node.id;\n\n if (isClickableRole(role)) {\n el.addEventListener(\"click\", () => {\n this.fireAction(nodeId, SemanticActionType.tap);\n });\n // Links activate on Enter only (Space scrolls the page per browser\n // convention). All other clickable roles accept both Enter and Space.\n const activationKeys =\n role === SemanticRole.link ? [\"Enter\"] : [\"Enter\", \" \"];\n el.addEventListener(\"keydown\", (e) => {\n if (activationKeys.includes(e.key)) {\n e.preventDefault();\n this.fireAction(nodeId, SemanticActionType.tap);\n }\n });\n }\n\n if (role === SemanticRole.slider) {\n el.addEventListener(\"keydown\", (e) => {\n if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n this.fireAction(nodeId, SemanticActionType.increase);\n } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") {\n e.preventDefault();\n this.fireAction(nodeId, SemanticActionType.decrease);\n }\n });\n }\n\n if (role === SemanticRole.tab) {\n this.attachRovingNav(el, {\n includeHomeEnd: true,\n members: () => {\n const parent = el.parentElement;\n if (!parent) return [];\n return Array.from(parent.children).filter(\n (c): c is HTMLElement =>\n c instanceof HTMLElement && c.getAttribute(\"role\") === \"tab\"\n );\n },\n });\n }\n\n if (role === SemanticRole.radioButton) {\n this.attachRovingNav(el, {\n includeHomeEnd: false,\n members: () => {\n const group =\n el.closest<HTMLElement>('[role=\"radiogroup\"]') ?? el.parentElement;\n if (!group) return [];\n return Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n },\n });\n }\n\n // Focus handler for nodes with the Focusable trait. When AT focuses an\n // element, notify the C++ runtime so it can update internal focus state\n // (visual focus rings, etc.). Gated on Focusable trait\n if (hasTrait(node.traitFlags, SemanticTrait.Focusable)) {\n el.addEventListener(\"focus\", () => {\n this.requestFocus(nodeId);\n });\n }\n }\n\n // ---- Attribute application ----\n\n private applyAttributes(el: HTMLElement, node: SemanticNodeData): void {\n const role = node.role;\n const flags = node.stateFlags;\n const traits = node.traitFlags;\n\n // Role\n const ariaRole = ariaRoleForSemantic(role);\n if (ariaRole) {\n setAttr(el, \"role\", ariaRole);\n } else {\n removeAttr(el, \"role\");\n }\n\n // Links: a bare <a> with no href has no link semantics, so set the role\n // explicitly (ariaRoleForSemantic returns null for link → native <a>).\n if (role === SemanticRole.link) {\n setAttr(el, \"role\", \"link\");\n }\n\n // Tabindex — keep the screen-reader overlay out of the browser's sequential\n // Tab order. Interactive/focusable nodes remain programmatically focusable\n // so AT/runtime focus sync can still target them when needed. List items are\n // included because Mobile Safari won't iterate them otherwise.\n if (\n isInteractiveRole(role) ||\n hasTrait(traits, SemanticTrait.Focusable) ||\n role === SemanticRole.listItem\n ) {\n setAttr(el, \"tabindex\", \"-1\");\n } else {\n removeAttr(el, \"tabindex\");\n }\n\n // Label / value / hint\n if (node.label) {\n setAttr(el, \"aria-label\", node.label);\n } else {\n removeAttr(el, \"aria-label\");\n }\n\n if (role === SemanticRole.slider) {\n if (node.value) {\n // aria-valuenow must be numeric; keep the display string (e.g. \"75%\")\n // in aria-valuetext only.\n const numericValue = parseFloat(node.value);\n if (Number.isFinite(numericValue)) {\n setAttr(el, \"aria-valuenow\", String(numericValue));\n } else {\n removeAttr(el, \"aria-valuenow\");\n }\n setAttr(el, \"aria-valuetext\", node.value);\n } else {\n removeAttr(el, \"aria-valuenow\");\n removeAttr(el, \"aria-valuetext\");\n }\n // TODO: aria-valuemin / aria-valuemax are required by ARIA.\n // Defaulting to horizontal; vertical sliders need orientation data from C++.\n setAttr(el, \"aria-orientation\", \"horizontal\");\n setBoolAttr(el, \"aria-readonly\", hasState(flags, SemanticState.ReadOnly));\n } else {\n removeAttr(el, \"aria-valuenow\");\n removeAttr(el, \"aria-valuetext\");\n removeAttr(el, \"aria-orientation\");\n removeAttr(el, \"aria-readonly\");\n }\n\n if (node.hint) {\n const descId = `rive-${this.instanceId}-desc-${node.id}`;\n let descEl = this.descElements.get(node.id);\n if (!descEl) {\n descEl = document.createElement(\"span\");\n descEl.id = descId;\n descEl.style.cssText = DESC_SPAN_STYLE;\n this.container.appendChild(descEl);\n this.descElements.set(node.id, descEl);\n }\n if (descEl.textContent !== node.hint) descEl.textContent = node.hint;\n setAttr(el, \"aria-describedby\", descId);\n } else {\n removeAttr(el, \"aria-describedby\");\n const staleDesc = this.descElements.get(node.id);\n if (staleDesc) {\n if (staleDesc.parentNode) staleDesc.parentNode.removeChild(staleDesc);\n this.descElements.delete(node.id);\n }\n }\n\n // Text nodes: use textContent rather than aria-label so screen readers\n // announce the text in virtual/browse mode (aria-label on a bare <span>\n // with no widget role is ignored by some AT in document browse mode).\n if (role === SemanticRole.text) {\n const textSpan = el.querySelector(\":scope > span\") ?? el;\n const text = node.label ?? \"\";\n if (textSpan.textContent !== text) textSpan.textContent = text;\n removeAttr(el, \"aria-label\");\n if (node.headingLevel > 0) {\n setAttr(el, \"role\", \"heading\");\n setAttr(el, \"aria-level\", String(node.headingLevel));\n } else {\n // The generic role branch above already cleared role=\"heading\";\n // aria-level must go with it when a heading reverts to plain text.\n removeAttr(el, \"aria-level\");\n }\n }\n\n // ---- Trait-gated states ----\n // Only set the ARIA property when the trait is present. When the trait\n // is absent, remove the attribute so AT sees \"not applicable\" rather\n // than \"false\".\n\n if (hasTrait(traits, SemanticTrait.Expandable) && ARIA_EXPANDED_ROLES.has(role)) {\n setBoolAttr(el, \"aria-expanded\", hasState(flags, SemanticState.Expanded));\n } else {\n removeAttr(el, \"aria-expanded\");\n }\n\n // aria-selected is required on ALL tabs per ARIA spec regardless of trait;\n // for other roles it is trait-gated and guarded to ARIA_SELECTED_ROLES.\n if (role === SemanticRole.tab) {\n setBoolAttr(el, \"aria-selected\", hasState(flags, SemanticState.Selected));\n } else if (hasTrait(traits, SemanticTrait.Selectable) && ARIA_SELECTED_ROLES.has(role)) {\n setBoolAttr(el, \"aria-selected\", hasState(flags, SemanticState.Selected));\n } else {\n removeAttr(el, \"aria-selected\");\n }\n\n if (hasTrait(traits, SemanticTrait.Checkable) && ARIA_CHECKED_ROLES.has(role)) {\n // Mixed wins over Checked per the C++ precedence contract, but\n // role=\"switch\" only accepts true/false — \"mixed\" is invalid per ARIA.\n if (hasState(flags, SemanticState.Mixed) && role !== SemanticRole.switchControl) {\n setAttr(el, \"aria-checked\", \"mixed\");\n } else {\n setBoolAttr(el, \"aria-checked\", hasState(flags, SemanticState.Checked));\n }\n } else {\n removeAttr(el, \"aria-checked\");\n }\n\n if (hasTrait(traits, SemanticTrait.Toggleable)) {\n if (ARIA_PRESSED_ROLES.has(role)) {\n setBoolAttr(el, \"aria-pressed\", hasState(flags, SemanticState.Toggled));\n } else {\n removeAttr(el, \"aria-pressed\");\n }\n // switch uses aria-checked (not aria-pressed) for its on/off state.\n if (role === SemanticRole.switchControl) {\n setBoolAttr(el, \"aria-checked\", hasState(flags, SemanticState.Toggled));\n }\n } else {\n removeAttr(el, \"aria-pressed\");\n }\n\n if (hasTrait(traits, SemanticTrait.Requirable) && ARIA_REQUIRED_ROLES.has(role)) {\n setBoolAttr(el, \"aria-required\", hasState(flags, SemanticState.Required));\n } else {\n removeAttr(el, \"aria-required\");\n }\n\n if (hasTrait(traits, SemanticTrait.Enablable)) {\n setBoolAttr(\n el,\n \"aria-disabled\",\n hasState(flags, SemanticState.Disabled)\n );\n } else {\n removeAttr(el, \"aria-disabled\");\n }\n\n // ---- Non-trait states ----\n\n // Hide from AT when explicitly hidden, or when an image has no accessible\n // name — a nameless role=\"img\" is a WCAG 1.1.1 violation; treat it as\n // decorative instead.\n const isDecorativeImage = role === SemanticRole.image && !node.label;\n if (hasState(flags, SemanticState.Hidden) || hasState(flags, SemanticState.Obscured) || isDecorativeImage) {\n setAttr(el, \"aria-hidden\", \"true\");\n } else {\n removeAttr(el, \"aria-hidden\");\n }\n\n if (hasState(flags, SemanticState.LiveRegion)) {\n setAttr(el, \"aria-live\", \"polite\");\n } else {\n removeAttr(el, \"aria-live\");\n }\n\n // textField-specific\n // TODO: Details here may change once we implement text inputs\n if (role === SemanticRole.textField) {\n setBoolAttr(el, \"aria-readonly\", hasState(flags, SemanticState.ReadOnly));\n setBoolAttr(\n el,\n \"aria-multiline\",\n hasState(flags, SemanticState.Multiline)\n );\n // Surface the current field value as DOM text so screen readers can\n // announce it. Only safe when the node has no semantic children —\n // setting textContent would remove any child elements from the DOM.\n if (node.children.length === 0) {\n const value = node.value ?? \"\";\n if (el.textContent !== value) el.textContent = value;\n }\n } else {\n removeAttr(el, \"aria-multiline\");\n }\n\n // alertDialog is always modal per WAI-ARIA; a plain dialog only when the Modal state flag is set.\n if (isModalDialogRole(role, flags)) {\n setAttr(el, \"aria-modal\", \"true\");\n } else {\n removeAttr(el, \"aria-modal\");\n }\n }\n\n // ---- Positioning ----\n\n /**\n * Positions an element in artboard-space coordinates relative to its parent.\n *\n * Node bounds stay in raw artboard units — the CSS `transform: matrix(...)`\n * on the transform container maps artboard units to CSS pixels in one GPU\n * pass. No per-node forwardMat multiplication or DPR division needed here.\n *\n * Round to whole artboard units before comparing to avoid triggering AX\n * layout notifications from sub-unit floating-point animation jitter.\n */\n private applyPosition(\n el: HTMLElement,\n node: SemanticNodeData,\n parentArtboardLeft: number,\n parentArtboardTop: number\n ): void {\n // Clamp each node's rect to the artboard viewport before computing CSS.\n // Without this, nodes whose artboard bounds exceed the artboard (e.g. a\n // scroll list container whose height is the full content, not the viewport)\n // produce CSS heights that overflow the transform container. WebKit then\n // unions all descendant AX rects and extends the container's AX origin\n // above the canvas regardless of overflow:hidden on ancestors.\n const ab = this._artboardBounds;\n const clampedMinX = Math.max(node.minX, ab.minX);\n const clampedMinY = Math.max(node.minY, ab.minY);\n const clampedMaxX = Math.min(node.maxX, ab.maxX);\n const clampedMaxY = Math.min(node.maxY, ab.maxY);\n\n const elLeft = clampedMinX - parentArtboardLeft;\n const elTop = clampedMinY - parentArtboardTop;\n const elWidth = Math.max(0, clampedMaxX - clampedMinX);\n const elHeight = Math.max(0, clampedMaxY - clampedMinY);\n\n const tx = Math.round(elLeft);\n const ty = Math.round(elTop);\n const pxWidth = Math.round(elWidth) + \"px\";\n const pxHeight = Math.round(elHeight) + \"px\";\n\n // Use left/top layout properties for positioning. VoiceOver reliably\n // handles layout position + a single ancestor CSS transform (the transform\n // container). Chaining CSS transforms across multiple stacking contexts\n // (transform container → node identity → item translate) caused VoiceOver\n // to compute the correct SIZE but wrong POSITION. Artboard clamping above\n // guarantees tx/ty are always ≥ 0, so the negative-top overflow problem\n // that originally prompted the switch to CSS transforms no longer applies.\n const pxLeft = tx + \"px\";\n const pxTop = ty + \"px\";\n if (el.style.left !== pxLeft) el.style.left = pxLeft;\n if (el.style.top !== pxTop) el.style.top = pxTop;\n if (el.style.width !== pxWidth) el.style.width = pxWidth;\n if (el.style.height !== pxHeight) el.style.height = pxHeight;\n // Clear any CSS transform from a previous render pass.\n if (el.style.transform) el.style.transform = \"\";\n\n if (node.role === SemanticRole.text) {\n this.pendingTextGeometry.push(el);\n }\n }\n\n /**\n * Scale each queued text span to fit its layout box, batched so a frame\n * pays at most one synchronous layout: all measurement-reset writes first,\n * then all rect reads, then all transform writes. Interleaving\n * write→read→write per node would force a reflow per text node instead.\n *\n * Nodes whose box size and text are unchanged since the last pass are\n * skipped entirely (their existing transform is still correct — the scale\n * is a ratio of two rects, so ancestor transform changes cancel out).\n */\n private flushTextGeometry(): void {\n if (this.pendingTextGeometry.length === 0) return;\n\n // Phase 1 — writes: reset spans to their natural size for measurement.\n // The previous pass's scale must be cleared, or the rect reads below\n // would measure the scaled span and compound the correction.\n const toMeasure: Array<{ host: HTMLElement; span: HTMLElement; key: string }> = [];\n for (const host of this.pendingTextGeometry) {\n const span = (host.querySelector(\":scope > span\") as HTMLElement | null) ?? host;\n const key = `${host.style.width}|${host.style.height}|${span.textContent}`;\n if (this.textGeometryKeys.get(host) === key) continue;\n span.style.width = \"auto\";\n span.style.height = \"auto\";\n span.style.transformOrigin = \"0 0\";\n span.style.transform = \"\";\n toMeasure.push({ host, span, key });\n }\n this.pendingTextGeometry.length = 0;\n\n // Phase 2 — reads: one layout pass covers every rect measurement.\n const transforms = toMeasure.map(({ host, span }) => {\n const parentRect = host.getBoundingClientRect();\n const natural = span.getBoundingClientRect();\n if (natural.width > 0 && natural.height > 0) {\n const scaleX = parentRect.width / natural.width;\n const scaleY = parentRect.height / natural.height;\n return `scale(${scaleX}, ${scaleY})`;\n }\n return \"none\";\n });\n\n // Phase 3 — writes: apply all transforms.\n for (let i = 0; i < toMeasure.length; i++) {\n const { host, span, key } = toMeasure[i];\n span.style.transform = transforms[i];\n this.textGeometryKeys.set(host, key);\n }\n }\n\n // ---- Transform container ----\n\n /**\n * Creates (on first call) and updates the artboard-space transform container.\n *\n * The container is sized to the artboard dimensions and carries a CSS\n * `transform: matrix(...)` equivalent to `forwardMat / dpr`. All semantic\n * node elements are children of this container and use raw artboard\n * coordinates as their CSS `left/top/width/height`, so the CSS compositor\n * applies the artboard→screen mapping in one pass.\n */\n private syncTransformContainer(\n forwardMat: rc.Mat2D,\n dpr: number,\n artboardBounds: rc.AABB\n ): void {\n if (!this.transformContainer) {\n const tc = document.createElement(\"div\");\n tc.style.cssText = [\n \"position:absolute\",\n \"top:0\",\n \"left:0\",\n // overflow:visible — artboard viewport clamping is done per-node in\n // applyPosition\n \"overflow:visible\",\n \"pointer-events:none\",\n \"transform-origin:0 0\",\n ].join(\";\");\n this.container.appendChild(tc);\n this.transformContainer = tc;\n }\n\n const w = artboardBounds.maxX - artboardBounds.minX;\n const h = artboardBounds.maxY - artboardBounds.minY;\n this.transformContainer.style.width = Math.round(w) + \"px\";\n this.transformContainer.style.height = Math.round(h) + \"px\";\n\n const s = 1 / (dpr || 1);\n const a = forwardMat.xx * s;\n const b = forwardMat.xy * s;\n const c = forwardMat.yx * s;\n const d = forwardMat.yy * s;\n const tx = forwardMat.tx * s;\n const ty = forwardMat.ty * s;\n this.transformContainer.style.transform =\n `matrix(${a},${b},${c},${d},${tx},${ty})`;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Static helpers (module-private)\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// ARIA attribute eligibility — role sets\n//\n// Each set lists the Rive roles for which a given ARIA attribute is valid per\n// WAI-ARIA 1.2 (\"Used in roles\" + \"Inherits into roles\"). The trait-gated\n// blocks in applyAttributes check these before setting an attribute so that\n// C++ nodes with unexpected trait combinations never produce invalid markup.\n//\n// To add a new role: append it to the relevant set(s) here — no other changes\n// needed in applyAttributes.\n// ---------------------------------------------------------------------------\n\n/** aria-expanded: button, link, checkbox, switch (inherits button), tab. */\nconst ARIA_EXPANDED_ROLES: Set<number> = new Set([\n SemanticRole.button,\n SemanticRole.link,\n SemanticRole.checkbox,\n SemanticRole.switchControl,\n SemanticRole.tab,\n]);\n\n/**\n * aria-selected: tab is the only role in our current set that natively\n * supports it. Tab is also handled by an explicit unconditional branch in\n * applyAttributes (ARIA requires it there regardless of Selectable trait), but\n * the set still lists it so the constraint is visible in one place.\n */\nconst ARIA_SELECTED_ROLES: Set<number> = new Set([\n SemanticRole.tab,\n]);\n\n/** aria-checked: checkbox, radio, switch. */\nconst ARIA_CHECKED_ROLES: Set<number> = new Set([\n SemanticRole.checkbox,\n SemanticRole.radioButton,\n SemanticRole.switchControl,\n]);\n\n/**\n * aria-pressed: button only. switch is a button subclass in ARIA but uses\n * aria-checked (not aria-pressed) for its on/off state — it is intentionally\n * excluded here and handled separately in the Toggleable block.\n */\nconst ARIA_PRESSED_ROLES: Set<number> = new Set([\n SemanticRole.button,\n]);\n\n/** aria-required: checkbox, textbox, radiogroup. */\nconst ARIA_REQUIRED_ROLES: Set<number> = new Set([\n SemanticRole.checkbox,\n SemanticRole.textField,\n SemanticRole.radioGroup,\n]);\n\n// ---------------------------------------------------------------------------\n\n/** Style for visually-hidden description spans used with aria-describedby. */\nconst DESC_SPAN_STYLE = [\n \"position:absolute\",\n \"width:1px\",\n \"height:1px\",\n \"overflow:hidden\",\n \"pointer-events:none\",\n \"left:-9999px\",\n].join(\";\");\n\nconst BASE_NODE_STYLE = [\n \"position:absolute\",\n \"pointer-events:none\",\n \"box-sizing:border-box\",\n \"overflow:visible\",\n \"margin:0\",\n \"padding:0\",\n \"transform-origin: 0px 0px 0px\",\n \"border:none\",\n \"background:transparent\",\n \"color:transparent\",\n // \"list-style:none\",\n].join(\";\");\n\nconst SPAN_EXP = [\n \"display:inline-block\",\n \"white-space:nowrap\",\n \"pointer-events:none\",\n].join(\";\");\n\n/**\n * Attribute writers that skip same-value mutations. Even a no-op setAttribute\n * fires a mutation record, and whether AX layers dedupe those is\n * browser-specific — skipping the write is the only browser-proof guard.\n */\nfunction setAttr(el: Element, attr: string, value: string): void {\n if (el.getAttribute(attr) !== value) el.setAttribute(attr, value);\n}\n\nfunction removeAttr(el: Element, attr: string): void {\n if (el.hasAttribute(attr)) el.removeAttribute(attr);\n}\n\nfunction setBoolAttr(el: HTMLElement, attr: string, value: boolean): void {\n setAttr(el, attr, value ? \"true\" : \"false\");\n}\n\n/** Roles that receive click/Enter/Space action handlers. */\nfunction isClickableRole(role: number): boolean {\n switch (role) {\n case SemanticRole.button:\n case SemanticRole.link:\n case SemanticRole.checkbox:\n case SemanticRole.switchControl:\n case SemanticRole.tab:\n case SemanticRole.radioButton:\n return true;\n default:\n return false;\n }\n}\n\n/** Roles that receive tabindex=\"-1\" for programmatic/AT focus (not Tab order). */\nfunction isInteractiveRole(role: number): boolean {\n switch (role) {\n case SemanticRole.button:\n case SemanticRole.link:\n case SemanticRole.checkbox:\n case SemanticRole.switchControl:\n case SemanticRole.slider:\n case SemanticRole.tab:\n case SemanticRole.radioButton:\n case SemanticRole.textField:\n return true;\n default:\n return false;\n }\n}\n\n/**\n * A modal/alert dialog: alertDialog is always modal per WAI-ARIA, a plain\n * dialog only when the Modal state flag is set.\n */\nfunction isModalDialogRole(role: number, flags: number): boolean {\n return (\n role === SemanticRole.alertDialog ||\n (role === SemanticRole.dialog && hasState(flags, SemanticState.Modal))\n );\n}\n\n/** Whether a node can receive focus: an interactive role or the Focusable trait. */\nfunction isFocusableNode(node: SemanticNodeData): boolean {\n return (\n isInteractiveRole(node.role) ||\n hasTrait(node.traitFlags, SemanticTrait.Focusable)\n );\n}\n\n/**\n * Choose an HTML tag for a given role. Prefer native semantic elements\n * where they exist — screen readers treat them more reliably than\n * generic elements with ARIA role overrides.\n */\nfunction tagForRole(role: number): string {\n switch (role) {\n case SemanticRole.link:\n return \"a\";\n case SemanticRole.text:\n // The outer div is the positioned AX element VoiceOver measures for its\n // highlight box. The text itself lives in a child <span> (see createElement).\n return \"div\";\n default:\n return \"div\";\n }\n}\n\n/**\n * Maps a Rive SemanticRole to an ARIA `role` attribute value.\n * Returns null for roles that don't need an explicit role attribute here\n * (e.g. text nodes use an outer div + inner span with textContent; heading\n * role is applied separately when headingLevel > 0).\n */\nfunction ariaRoleForSemantic(role: number): string | null {\n switch (role) {\n case SemanticRole.none:\n // TODO: Role \"none\" removes the node from the accessibility tree. For now, setting to Group, but maybe we want to switch to \"none\"\n // or \"presentation\".\n return \"group\";\n case SemanticRole.button:\n return \"button\";\n case SemanticRole.link:\n return null; // native <a>\n case SemanticRole.checkbox:\n return \"checkbox\";\n case SemanticRole.switchControl:\n return \"switch\";\n case SemanticRole.slider:\n return \"slider\";\n case SemanticRole.textField:\n return \"textbox\";\n case SemanticRole.image:\n return \"img\";\n case SemanticRole.group:\n return \"group\";\n case SemanticRole.list:\n return \"list\";\n case SemanticRole.listItem:\n return \"listitem\";\n case SemanticRole.tab:\n return \"tab\";\n case SemanticRole.tabList:\n return \"tablist\";\n case SemanticRole.dialog:\n return \"dialog\";\n case SemanticRole.alertDialog:\n return \"alertdialog\";\n case SemanticRole.radioGroup:\n return \"radiogroup\";\n case SemanticRole.radioButton:\n return \"radio\";\n case SemanticRole.text:\n // Text nodes use <span>; heading role is applied separately\n // when headingLevel > 0.\n return null;\n default:\n return null;\n }\n}\n","export { registerTouchInteractions } from \"./registerTouchInteractions\";\nexport { KeyboardInteractions, FocusSessionState } from \"./registerKeyboardInteractions\";\nexport type { KeyboardInteractionsParams } from \"./registerKeyboardInteractions\";\nexport { BLANK_URL, sanitizeUrl } from \"./sanitizeUrl\";\nexport {\n Finalizable,\n ImageWrapper,\n AudioWrapper,\n FontWrapper,\n FileAssetWrapper,\n ImageAssetWrapper,\n AudioAssetWrapper,\n FontAssetWrapper,\n finalizationRegistry,\n CustomFileAssetLoaderWrapper,\n AssetLoadCallbackWrapper,\n FileFinalizer,\n createFinalization,\n} from \"./finalizationRegistry\";\nexport { RiveFont } from \"./riveFont\";","import * as rc from \"../rive_advanced.mjs\";\n\nexport interface TouchInteractionsParams {\n canvas: HTMLCanvasElement | OffscreenCanvas;\n artboard: rc.Artboard;\n stateMachines: rc.StateMachineInstance[];\n renderer: rc.Renderer;\n rive: rc.RiveCanvas;\n fit: rc.Fit;\n alignment: rc.Alignment;\n isTouchScrollEnabled?: boolean;\n dispatchPointerExit?: boolean;\n enableMultiTouch?: boolean;\n layoutScaleFactor?: number;\n // Handles advancing the state machine and draining events/view model property callbacks, applicable to certain pointer interactions\n advanceAndDrain: (elapsedTime: number) => void;\n}\n\ninterface ClientCoordinates {\n clientX: number;\n clientY: number;\n identifier: number;\n transformedX?: number | undefined;\n transformedY?: number | undefined;\n}\n\n/**\n * Extracts ClientCoordinates from a TouchList, respecting multi-touch vs.\n * single-touch mode. In single-touch mode, only the touch matching\n * primaryTouchId is returned (or the first touch when primaryTouchId is null).\n */\nconst getTouchCoordinates = (\n changedTouches: TouchList,\n enableMultiTouch: boolean,\n primaryTouchId: number | null,\n): ClientCoordinates[] => {\n const coordinates: ClientCoordinates[] = [];\n if (enableMultiTouch) {\n for (let i = 0; i < changedTouches.length; i++) {\n const touch = changedTouches[i];\n coordinates.push({\n clientX: touch.clientX,\n clientY: touch.clientY,\n identifier: touch.identifier,\n });\n }\n } else {\n // In \"single-touch mode\", only track the primary finger identified at touchstart.\n // Search changedTouches for the touch matching the recorded primary touch identifier, or (on initial touchstart)\n // take the first available touch identifier.\n let primaryTouch: Touch | null =\n primaryTouchId !== null\n ? Array.from(changedTouches).find(\n (t) => t.identifier === primaryTouchId,\n ) ?? null\n : changedTouches[0];\n if (primaryTouch) {\n coordinates.push({\n clientX: primaryTouch.clientX,\n clientY: primaryTouch.clientY,\n identifier: primaryTouch.identifier,\n });\n }\n }\n return coordinates;\n};\n\n/**\n * Returns the clientX and clientY properties from touch or mouse events. Also\n * calls preventDefault() on the event if it is a touchstart or touchmove to prevent\n * scrolling the page on mobile devices\n * @param event - Either a TouchEvent or a MouseEvent\n * @param isTouchScrollEnabled - Whether touch scrolling is enabled\n * @param enableMultiTouch - Whether to process multiple simultaneous touches\n * @param primaryTouchId - When working with single touches, only process the touch\n * with this identifier. Pass null to accept any touch (used during touchstart to\n * capture the first finger down).\n * @returns - Coordinates of the clientX and clientY properties from the touch/mouse event\n */\nconst getClientCoordinates = (\n event: MouseEvent | TouchEvent,\n isTouchScrollEnabled: boolean,\n enableMultiTouch: boolean,\n primaryTouchId: number | null,\n): ClientCoordinates[] => {\n const touchEvent = event as TouchEvent;\n if (touchEvent.changedTouches?.length) {\n // This flag, if false, prevents touch events on the canvas default behavior\n // which may prevent scrolling if a drag motion on the canvas is performed\n if (!isTouchScrollEnabled && [\"touchstart\", \"touchmove\"].includes(event.type)) {\n event.preventDefault();\n }\n return getTouchCoordinates(touchEvent.changedTouches, enableMultiTouch, primaryTouchId);\n }\n return [\n {\n clientX: (event as MouseEvent).clientX,\n clientY: (event as MouseEvent).clientY,\n identifier: 0,\n },\n ];\n};\n\n/**\n * Registers mouse move/up/down callback handlers on the canvas to send meaningful coordinates to\n * the state machine pointer move/up/down functions based on cursor interaction\n */\nexport const registerTouchInteractions = ({\n canvas,\n artboard,\n stateMachines = [],\n renderer,\n rive,\n fit,\n alignment,\n isTouchScrollEnabled = false,\n dispatchPointerExit = true,\n enableMultiTouch = false,\n layoutScaleFactor = 1.0,\n advanceAndDrain,\n}: TouchInteractionsParams) => {\n if (\n !canvas ||\n !stateMachines.length ||\n !renderer ||\n !rive ||\n !artboard ||\n typeof window === \"undefined\"\n ) {\n return null;\n }\n /**\n * After a touchend event, some browsers may fire synthetic mouse events\n * (mouseover, mousedown, mousemove, mouseup) if the touch interaction did not cause\n * any default action (such as scrolling).\n *\n * This is done to simulate the behavior of a mouse for applications that do not support\n * touch events.\n *\n * We're keeping track of the previous event to not send the synthetic mouse events if the\n * touch event was a click (touchstart -> touchend).\n *\n * This is only needed when `isTouchScrollEnabled` is false\n * When true, `preventDefault()` is called which prevents this behaviour.\n **/\n let _prevEventType: string | null = null;\n let _syntheticEventsActive = false;\n\n /**\n * When enableMultiTouch is false (\"single-touch mode\"), we track the identifier of the first finger that touched down.\n * All subsequent touch events are filtered to this identifier so that a second finger\n * moving cannot displace the tracked pointer position.\n * Reset to null when the primary finger lifts (or touchcancel is called)\n */\n let _primaryTouchId: number | null = null;\n\n const processEventCallback = (event: MouseEvent | TouchEvent) => {\n // Exit early out of all synthetic mouse events\n // https://stackoverflow.com/questions/9656990/how-to-prevent-simulated-mouse-events-in-mobile-browsers\n // https://stackoverflow.com/questions/25572070/javascript-touchend-versus-click-dilemma\n if (_syntheticEventsActive && event instanceof MouseEvent) {\n // Synthetic event finished\n if (event.type == \"mouseup\") {\n _syntheticEventsActive = false;\n }\n\n return;\n }\n\n // Test if it's a \"touch click\". This could cause the browser to send\n // synthetic mouse events.\n _syntheticEventsActive =\n isTouchScrollEnabled &&\n event.type === \"touchend\" &&\n _prevEventType === \"touchstart\";\n\n _prevEventType = event.type;\n\n const boundingRect = (\n event.currentTarget as HTMLCanvasElement\n ).getBoundingClientRect();\n\n // On touchstart in single-touch mode, record the first new finger as the primary\n // touch if we aren't already tracking one.\n if (!enableMultiTouch && event.type === \"touchstart\" && _primaryTouchId === null) {\n const firstTouch = (event as TouchEvent).changedTouches?.[0];\n if (firstTouch) {\n _primaryTouchId = firstTouch.identifier;\n }\n }\n\n const coordinateSets = getClientCoordinates(\n event,\n isTouchScrollEnabled,\n enableMultiTouch,\n enableMultiTouch ? null : _primaryTouchId,\n );\n const forwardMatrix = rive.computeAlignment(\n fit,\n alignment,\n {\n minX: 0,\n minY: 0,\n maxX: boundingRect.width,\n maxY: boundingRect.height,\n },\n artboard.bounds,\n layoutScaleFactor,\n );\n const invertedMatrix = new rive.Mat2D();\n forwardMatrix.invert(invertedMatrix);\n\n coordinateSets.forEach((coordinateSet) => {\n const clientX = coordinateSet.clientX;\n const clientY = coordinateSet.clientY;\n if (!clientX && !clientY) {\n return;\n }\n const canvasX = clientX - boundingRect.left;\n const canvasY = clientY - boundingRect.top;\n const canvasCoordinatesVector = new rive.Vec2D(canvasX, canvasY);\n const transformedVector = rive.mapXY(\n invertedMatrix,\n canvasCoordinatesVector,\n );\n const transformedX = transformedVector.x();\n const transformedY = transformedVector.y();\n coordinateSet.transformedX = transformedX;\n coordinateSet.transformedY = transformedY;\n transformedVector.delete();\n canvasCoordinatesVector.delete();\n });\n\n invertedMatrix.delete();\n forwardMatrix.delete();\n\n switch (event.type) {\n /**\n * There's a 2px buffer for a hitRadius when translating the pointer coordinates\n * down to the state machine. In cases where the hitbox is about that much away\n * from the Artboard border, we don't have exact precision on determining pointer\n * exit. We're therefore adding to the translated coordinates on mouseout of a canvas\n * to ensure that we report the mouse has truly exited the hitarea.\n * https://github.com/rive-app/rive-cpp/blob/master/src/animation/state_machine_instance.cpp#L336\n *\n */\n case \"mouseout\":\n for (const stateMachine of stateMachines) {\n if (dispatchPointerExit) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerExit(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n } else {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerMove(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n }\n break;\n\n // Pointer moving/hovering on the canvas\n case \"touchmove\":\n case \"mouseover\":\n case \"mousemove\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerMove(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n break;\n }\n // Pointer click initiated but not released yet on the canvas\n case \"touchstart\":\n case \"mousedown\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerDown(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n // Advance the state machine immediately so pointer down(s) takes effect synchronously\n advanceAndDrain(0);\n break;\n }\n // Pointer click released on the canvas\n case \"touchend\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerUp(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n stateMachine.pointerExit(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n // Advance the state machine immediately so pointer up(s) takes effect synchronously\n advanceAndDrain(0);\n // Release the primary touch lock once that finger lifts so the next\n // touchstart can claim a new primary finger.\n if (\n !enableMultiTouch &&\n coordinateSets.some((c) => c.identifier === _primaryTouchId)\n ) {\n _primaryTouchId = null;\n }\n break;\n }\n case \"mouseup\": {\n for (const stateMachine of stateMachines) {\n coordinateSets.forEach((coordinateSet) => {\n stateMachine.pointerUp(\n coordinateSet.transformedX,\n coordinateSet.transformedY,\n coordinateSet.identifier,\n );\n });\n }\n // Advance the state machine immediately so pointer up(s) takes effect synchronously\n advanceAndDrain(0);\n break;\n }\n default:\n }\n };\n\n const touchCancelCallback = () => {\n _primaryTouchId = null;\n };\n\n const callback = processEventCallback.bind(this);\n canvas.addEventListener(\"mouseover\", callback);\n canvas.addEventListener(\"mouseout\", callback);\n canvas.addEventListener(\"mousemove\", callback);\n canvas.addEventListener(\"mousedown\", callback);\n canvas.addEventListener(\"mouseup\", callback);\n canvas.addEventListener(\"touchmove\", callback, {\n passive: isTouchScrollEnabled,\n });\n canvas.addEventListener(\"touchstart\", callback, {\n passive: isTouchScrollEnabled,\n });\n canvas.addEventListener(\"touchend\", callback);\n canvas.addEventListener(\"touchcancel\", touchCancelCallback);\n return () => {\n canvas.removeEventListener(\"mouseover\", callback);\n canvas.removeEventListener(\"mouseout\", callback);\n canvas.removeEventListener(\"mousemove\", callback);\n canvas.removeEventListener(\"mousedown\", callback);\n canvas.removeEventListener(\"mouseup\", callback);\n canvas.removeEventListener(\"touchmove\", callback);\n canvas.removeEventListener(\"touchstart\", callback);\n canvas.removeEventListener(\"touchend\", callback);\n canvas.removeEventListener(\"touchcancel\", touchCancelCallback);\n };\n};\n","import * as rc from \"../rive_advanced.mjs\";\n\nexport interface KeyboardInteractionsParams {\n canvas: HTMLCanvasElement;\n stateMachine: rc.StateMachineInstance;\n /**\n * Whether this canvas has focus nodes that should participate in tab traversal.\n * When true, Tab/Shift+Tab will be intercepted and routed to the Rive focus manager.\n * focusNext() returning false means no more traversable nodes — tab is released to the page.\n */\n hasFocusNodes: boolean;\n /**\n * Optional accessibility overlay that should be treated as part of this Rive\n * instance's focus domain. This is lazy because the overlay may be created\n * after keyboard listeners are registered.\n */\n getOverlayElement?: () => HTMLElement | null;\n}\n\n/**\n * Tracks the relationship between the canvas's DOM focus and Rive's internal focus for the\n * current focus session.\n *\n * NotFocused — the canvas is not the active DOM element, or Rive entered and then released focus\n * internally this session. Either way the next Tab should move on to the next page\n * element, so Tab events are ignored.\n * EntryPending — the canvas has DOM focus but Rive holds no active focus node yet, and the next Tab should enter\n * the focus tree. This is the resting state for pointer-driven focus (a click on the\n * canvas), or an edge case for keyboard focus where initial focus action did not land on a focus node. \n * RiveFocused — a Rive node currently holds focus. Tab/Shift+Tab are routed to the Rive focus\n * manager and trapped inside the canvas until Rive notifies focus has ended.\n *\n * When keyboard focus lands on the canvas, onCanvasFocus reads the direction focus came from and \n * moves into the focus tree immediately, going straight to RiveFocused. EntryPending is only set via pointer focus (or keyboard focus\n * where focusNext()/focusPrevious() return false but respects tabindex).\n */\nexport enum FocusSessionState {\n NotFocused = \"notFocused\",\n EntryPending = \"entryPending\",\n RiveFocused = \"riveFocused\",\n}\n\n/**\n * Manages keyboard and DOM focus interactions for a Rive canvas.\n *\n * Tracks the canvas focus session state (focusSessionState) and routes\n * Tab/Shift+Tab to the Rive state machine's focus manager. Exposes shared\n * state as properties so the Rive render loop can read them directly.\n */\nexport class KeyboardInteractions {\n public focusSessionState: FocusSessionState = FocusSessionState.NotFocused;\n\n private canvas: HTMLCanvasElement;\n private mainSm: rc.StateMachineInstance;\n private hasFocusNodes: boolean;\n /** Cached callback that returns the accessibility overlay element once created. */\n private getOverlayElement?: () => HTMLElement | null;\n\n /** Whether the canvas currently has browser DOM focus. */\n private canvasHasFocus = false;\n /** After Tab exits the last Rive node, ignore keydowns until focus re-enters the focus domain. */\n private focusDomainReleased = false;\n /** Overlay element currently wired with focusin/keydown listeners, if any. */\n private currentOverlayElement: HTMLElement | null = null;\n /** Canvas parent (or document) watched for focusin to attach overlay listeners lazily. */\n private focusDomainHost: HTMLElement | Document;\n\n constructor({\n canvas,\n stateMachine,\n hasFocusNodes,\n getOverlayElement,\n }: KeyboardInteractionsParams) {\n this.canvas = canvas;\n this.mainSm = stateMachine;\n this.hasFocusNodes = hasFocusNodes;\n this.getOverlayElement = getOverlayElement;\n this.focusDomainHost = canvas.parentElement ?? document;\n\n canvas.addEventListener(\"focus\", this.onCanvasFocus);\n canvas.addEventListener(\"blur\", this.onCanvasBlur);\n canvas.addEventListener(\"keydown\", this.onKeyDown);\n this.focusDomainHost.addEventListener(\"focusin\", this.onFocusDomainHostFocusIn);\n this.syncOverlayListener();\n }\n\n /**\n * Set the FocusSessionState. Useful for invoking a Rive \"blur\" without actually blurring from the <canvas>. This\n * helps put the DOM focus state on the canvas rather than the <body>, so the user doesn't lose the spot in page navigation\n *\n * @param state FocusSessionState enum\n */\n public setFocusSessionState(state: FocusSessionState): void {\n this.focusSessionState = state;\n }\n\n /**\n * Called by pollFocusState on the Rive instance when it observes hasFocus=true. Rive acquired\n * focus internally (e.g. via a listener action or state transition) without a DOM focus event,\n * so mark the session RiveFocused.\n */\n public notifyRiveFocused(): void {\n this.focusSessionState = FocusSessionState.RiveFocused;\n }\n\n /**\n * Handles the canvas gaining browser focus. The behavior differs based on how focus was gained -\n *\n * Pointer-driven focus: the canvas now has focus but Rive holds nothing yet, so we move to EntryPending — this lets the\n * next Tab enter the focus tree even when the focus is pointer-driven\n *\n * Keyboard-driven focus: we enter the Rive focus tree immediately once canvas gains focus.\n * The direction is inferred from where focus came from: an element before the canvas in DOM order\n * means a forward Tab (focusNext), one after means a Shift+Tab (focusPrevious). :focus-visible\n * gates this so a click doesn't yank Rive focus to the first node on the focus event itself.\n */\n public onCanvasFocus = (event: FocusEvent) => {\n this.syncOverlayListener();\n this.canvasHasFocus = true;\n this.focusDomainReleased = false;\n\n if (!this.hasFocusNodes) return;\n if (this.mainSm.focusState().hasFocus) return;\n\n this.focusSessionState = FocusSessionState.EntryPending;\n\n // Pointer focus waits for the user's next Tab (handled in onKeyDown). Keyboard focus enters now.\n if (!this.isKeyboardDrivenFocus()) return;\n const forward = this.cameFromBeforeCanvas(event.relatedTarget as Node | null);\n if (forward ? this.mainSm.focusNext() : this.mainSm.focusPrevious()) {\n this.focusSessionState = FocusSessionState.RiveFocused;\n }\n };\n\n public onCanvasBlur = (_event: FocusEvent) => {\n this.focusSessionState = FocusSessionState.NotFocused;\n this.canvasHasFocus = false;\n };\n\n private onOverlayFocusIn = (event: FocusEvent) => {\n if (this.isInOverlay(event.target)) {\n this.focusDomainReleased = false;\n }\n };\n\n private onFocusDomainHostFocusIn = (_event: FocusEvent) => {\n this.syncOverlayListener();\n };\n\n public onKeyDown = (event: KeyboardEvent) => {\n this.syncOverlayListener();\n\n // After Tab exits the last Rive node, ignore keys until focus re-enters the focus domain.\n if (this.focusDomainReleased) return;\n\n if (!this.shouldRiveHandleKeyEvent(event)) return;\n\n if (event.code === \"Tab\" && this.hasFocusNodes) {\n const forward = !event.shiftKey;\n const focusMoved = forward ? this.mainSm.focusNext() : this.mainSm.focusPrevious();\n if (focusMoved) {\n // A Rive node accepted focus — keep trapping Tab inside the canvas.\n this.focusSessionState = FocusSessionState.RiveFocused;\n event.preventDefault();\n } else {\n // No more traversable nodes — release Tab to the page.\n this.focusSessionState = FocusSessionState.NotFocused;\n this.focusDomainReleased = true;\n this.canvasHasFocus = false;\n }\n this.syncOverlayListener();\n }\n };\n\n /**\n * Whether Rive should handle this keydown — i.e. it currently owns keyboard input.\n * True when focus is anywhere in the Rive focus domain (the canvas itself or the\n * accessibility overlay), OR a focus session is active and the key landed on the\n * canvas.\n */\n private shouldRiveHandleKeyEvent(event: KeyboardEvent): boolean {\n const inFocusDomain =\n this.isInFocusDomain(document.activeElement) ||\n this.isInOverlay(event.target);\n if (inFocusDomain) return true;\n\n const sessionActive =\n this.focusSessionState !== FocusSessionState.NotFocused;\n const eventOnCanvas = event.target === this.canvas;\n return sessionActive && (this.canvasHasFocus || eventOnCanvas);\n }\n\n /** Rive focus domain = the canvas itself OR the accessibility overlay. */\n private isInFocusDomain(target: EventTarget | null): boolean {\n if (target === this.canvas) return true;\n return this.isInOverlay(target);\n }\n\n /** Overlay only (excludes the canvas) — the accessibility overlay subtree. */\n private isInOverlay(target: EventTarget | null): boolean {\n if (!(target instanceof Node)) return false;\n return this.getOverlayElement?.()?.contains(target) ?? false;\n }\n\n private syncOverlayListener(): void {\n const nextOverlayElement = this.getOverlayElement?.() ?? null;\n if (nextOverlayElement === this.currentOverlayElement) return;\n\n this.currentOverlayElement?.removeEventListener(\n \"focusin\",\n this.onOverlayFocusIn,\n );\n this.currentOverlayElement?.removeEventListener(\n \"keydown\",\n this.onKeyDown,\n true,\n );\n this.currentOverlayElement = nextOverlayElement;\n this.currentOverlayElement?.addEventListener(\n \"focusin\",\n this.onOverlayFocusIn,\n );\n this.currentOverlayElement?.addEventListener(\n \"keydown\",\n this.onKeyDown,\n true,\n );\n }\n\n /**\n * Whether the canvas currently matches :focus-visible — the browser's heuristic for keyboard-\n * (vs pointer-) driven focus. For older browser versions that don't support this selector, return false\n * so that we don't incorrectly assume pointer vs keyboard focus. Next tab would enter the focus tree in those edge cases.\n */\n private isKeyboardDrivenFocus(): boolean {\n try {\n return this.canvas.matches(\":focus-visible\");\n } catch {\n return false;\n }\n }\n\n private cameFromBeforeCanvas(from: Node | null): boolean {\n if (!from) return true;\n const position = this.canvas.compareDocumentPosition(from);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return true;\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return false;\n return true;\n }\n\n public cleanup(): void {\n this.canvas.removeEventListener(\"focus\", this.onCanvasFocus);\n this.canvas.removeEventListener(\"blur\", this.onCanvasBlur);\n this.canvas.removeEventListener(\"keydown\", this.onKeyDown);\n this.focusDomainHost.removeEventListener(\"focusin\", this.onFocusDomainHostFocusIn);\n this.currentOverlayElement?.removeEventListener(\n \"focusin\",\n this.onOverlayFocusIn,\n );\n this.currentOverlayElement?.removeEventListener(\n \"keydown\",\n this.onKeyDown,\n true,\n );\n }\n}\n","// Reference: https://github.com/braintree/sanitize-url/tree/main\nconst invalidProtocolRegex = /^([^\\w]*)(javascript|data|vbscript)/im;\nconst htmlEntitiesRegex = /&#(\\w+)(^\\w|;)?/g;\nconst htmlCtrlEntityRegex = /&(newline|tab);/gi;\nconst ctrlCharactersRegex =\n /[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim;\nconst urlSchemeRegex = /^.+(:|:)/gim;\nconst relativeFirstCharacters = [\".\", \"/\"];\nexport const BLANK_URL = \"about:blank\";\n\nfunction isRelativeUrlWithoutProtocol(url: string): boolean {\n return relativeFirstCharacters.indexOf(url[0]) > -1;\n}\n\n// adapted from https://stackoverflow.com/a/29824550/2601552\nfunction decodeHtmlCharacters(str: string) {\n const removedNullByte = str.replace(ctrlCharactersRegex, \"\");\n return removedNullByte.replace(htmlEntitiesRegex, (match, dec) => {\n return String.fromCharCode(dec);\n });\n}\n\nexport function sanitizeUrl(url?: string): string {\n if (!url) {\n return BLANK_URL;\n }\n\n const sanitizedUrl = decodeHtmlCharacters(url)\n .replace(htmlCtrlEntityRegex, \"\")\n .replace(ctrlCharactersRegex, \"\")\n .trim();\n\n if (!sanitizedUrl) {\n return BLANK_URL;\n }\n\n if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {\n return sanitizedUrl;\n }\n\n const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);\n\n if (!urlSchemeParseResults) {\n return sanitizedUrl;\n }\n\n const urlScheme = urlSchemeParseResults[0];\n\n if (invalidProtocolRegex.test(urlScheme)) {\n return BLANK_URL;\n }\n\n return sanitizedUrl;\n}\n","import * as rc from \"../rive_advanced.mjs\";\n\ninterface Finalizable {\n unref: () => void;\n}\n\nclass FileFinalizer implements Finalizable {\n private _file: rc.File;\n public selfUnref: boolean = false;\n constructor(file: rc.File) {\n this._file = file;\n }\n\n public unref() {\n if (this._file) {\n this._file.unref();\n }\n }\n}\n\nclass ObjectFinalizer<T extends Finalizable> {\n private _finalizableObject: T;\n constructor(finalizableObject: T) {\n this._finalizableObject = finalizableObject;\n }\n\n public unref() {\n this._finalizableObject.unref();\n }\n}\n\n\nclass AssetWrapper implements rc.FinalizableTarget {\n public selfUnref: boolean = false;\n public unref() {}\n}\n\nclass ImageWrapper extends AssetWrapper {\n private _nativeImage: rc.Image;\n\n constructor(image: rc.Image) {\n super();\n this._nativeImage = image;\n }\n\n public get nativeImage(): rc.ImageInternal {\n return this._nativeImage;\n }\n\n public unref() {\n if (this.selfUnref) {\n this._nativeImage.unref();\n }\n }\n}\n\nclass AudioWrapper extends AssetWrapper {\n private _nativeAudio: rc.Audio;\n\n constructor(audio: rc.Audio) {\n super();\n this._nativeAudio = audio;\n }\n\n public get nativeAudio(): rc.AudioInternal {\n return this._nativeAudio;\n }\n\n public unref() {\n if (this.selfUnref) {\n this._nativeAudio.unref();\n }\n }\n}\n\nclass FontWrapper extends AssetWrapper {\n private _nativeFont: rc.Font;\n\n constructor(font: rc.Font) {\n super();\n this._nativeFont = font;\n }\n\n public get nativeFont(): rc.FontInternal {\n return this._nativeFont;\n }\n\n public unref() {\n if (this.selfUnref) {\n this._nativeFont.unref();\n }\n }\n}\n\nexport type AssetLoadCallbackWrapper = (\n asset: rc.FileAssetInternal,\n bytes: Uint8Array,\n) => Boolean;\n\nclass CustomFileAssetLoaderWrapper {\n assetLoader: rc.CustomFileAssetLoader;\n _assetLoaderCallback: AssetLoadCallbackWrapper;\n\n constructor(\n runtime: rc.RiveCanvas,\n loaderCallback: AssetLoadCallbackWrapper,\n ) {\n this._assetLoaderCallback = loaderCallback;\n this.assetLoader = new runtime.CustomFileAssetLoader({\n loadContents: this.loadContents.bind(this),\n });\n }\n\n loadContents(asset: rc.FileAsset, bytes: any) {\n let assetWrapper: FileAssetWrapper;\n if (asset.isImage) {\n assetWrapper = new ImageAssetWrapper(asset);\n } else if (asset.isAudio) {\n assetWrapper = new AudioAssetWrapper(asset);\n } else if (asset.isFont) {\n assetWrapper = new FontAssetWrapper(asset);\n } else {\n return false;\n }\n return this._assetLoaderCallback(assetWrapper, bytes);\n }\n}\n\n/**\n * Rive class representing a FileAsset with relevant metadata fields to describe\n * an asset associated wtih the Rive File\n */\nclass FileAssetWrapper {\n _nativeFileAsset: rc.FileAssetInternal;\n\n constructor(nativeAsset: rc.FileAssetInternal) {\n this._nativeFileAsset = nativeAsset;\n }\n\n decode(bytes: Uint8Array): void {\n this._nativeFileAsset.decode(bytes);\n }\n\n get name(): string {\n return this._nativeFileAsset.name;\n }\n\n get fileExtension(): string {\n return this._nativeFileAsset.fileExtension;\n }\n\n get uniqueFilename(): string {\n return this._nativeFileAsset.uniqueFilename;\n }\n\n get isAudio(): boolean {\n return this._nativeFileAsset.isAudio;\n }\n\n get isImage(): boolean {\n return this._nativeFileAsset.isImage;\n }\n\n get isFont(): boolean {\n return this._nativeFileAsset.isFont;\n }\n\n get cdnUuid(): string {\n return this._nativeFileAsset.cdnUuid;\n }\n\n get nativeFileAsset() {\n return this._nativeFileAsset;\n }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setRenderImage()` API with a\n * decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset\n */\nclass ImageAssetWrapper extends FileAssetWrapper {\n setRenderImage(image: ImageWrapper): void {\n (this._nativeFileAsset as rc.ImageAssetInternal).setRenderImage(\n image.nativeImage,\n );\n }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setAudioSource()` API with a\n * decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset\n */\nclass AudioAssetWrapper extends FileAssetWrapper {\n setAudioSource(audio: AudioWrapper): void {\n (this._nativeFileAsset as rc.AudioAssetInternal).setAudioSource(\n audio.nativeAudio,\n );\n }\n}\n\n/**\n * Rive class extending the FileAsset that exposes a `setFont()` API with a\n * decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset\n */\nclass FontAssetWrapper extends FileAssetWrapper {\n setFont(font: FontWrapper): void {\n (this._nativeFileAsset as rc.FontAssetInternal).setFont(font.nativeFont);\n }\n}\n\ndeclare const FinalizationRegistry: {\n new (fn: Function): typeof FinalizationRegistry;\n\n register<T extends rc.FinalizableTarget>(\n object: T,\n description: Finalizable,\n ): void;\n\n unregister<T>(object: T): void;\n};\n\nclass FakeFinalizationRegistry {\n constructor(_: Function) {}\n register(object: rc.FinalizableTarget) {\n object.selfUnref = true;\n }\n\n unregister<T>(_: T) {}\n}\nconst MyFinalizationRegistry =\n typeof FinalizationRegistry !== \"undefined\"\n ? FinalizationRegistry\n : FakeFinalizationRegistry;\n\nconst finalizationRegistry = new MyFinalizationRegistry((ob: Finalizable) => {\n ob?.unref();\n});\n\nconst createFinalization = <T extends Finalizable>(\n target: rc.FinalizableTarget,\n finalizable: T,\n) => {\n const finalizer = new ObjectFinalizer<T>(finalizable);\n finalizationRegistry.register(target, finalizer);\n};\n\nexport {\n finalizationRegistry,\n createFinalization,\n Finalizable,\n ImageWrapper,\n AudioWrapper,\n FontWrapper,\n ImageAssetWrapper,\n AudioAssetWrapper,\n FontAssetWrapper,\n CustomFileAssetLoaderWrapper,\n FileAssetWrapper,\n FileFinalizer,\n};\n","import * as rc from \"../rive_advanced.mjs\";\nimport { RuntimeLoader } from \"../runtimeLoader\";\nimport type { FontWrapper } from \"./finalizationRegistry\";\n\n// Callback type for the fallback fonts callback\nexport type FallbackFontsCallback = (missingGlyph: number, weight: number) => FontWrapper | FontWrapper[] | null | undefined;\n\ntype CallbackToPointerValue = (missingGlyph: number, fallbackFontIndex: number, weight: number) => number | null;\n\n// Class to manage fallback fonts for Rive.\nexport class RiveFont {\n private static _fallbackFontCallback: FallbackFontsCallback | null = null;\n\n // Class is never instantiated\n private constructor() {}\n\n\n /**\n * Set a callback to dynamically set a list of fallback fonts based on the missing glyph and/or style of the default font.\n * Set null to clear the callback.\n * @param fontCallback Callback to set a list of fallback fonts.\n */\n public static setFallbackFontCallback(fontCallback: FallbackFontsCallback | null): void {\n RiveFont._fallbackFontCallback = fontCallback ?? null;\n RiveFont._wireFallbackProc();\n }\n\n // Get the pointer value to the Embind Font object from FontWrapper\n private static _fontToPtr(\n fontWrapper: FontWrapper | null | undefined\n ): number | null {\n if (fontWrapper == null) return null;\n const embindFont = fontWrapper.nativeFont as rc.Font;\n const ptr = embindFont?.ptr?.();\n return ptr ?? null;\n }\n\n private static _getFallbackPtr(\n fonts: FontWrapper[] | null | undefined,\n index: number\n ): number | null {\n if (index < 0 || index >= fonts.length) return null;\n return RiveFont._fontToPtr(fonts![index]);\n }\n\n // Create the callback Rive expects to use for fallback fonts (regardless if set via a user-supplied static list, or callback)\n // 1. Ensure WASM is ready\n // 2. Bias for checking user callback over static list of fonts and pass it down to Rive to store as reference\n // - When calling the user callback, check if we have any fonts left to check, and if not, return null to indicate there are no more fallbacks to try.\n // - If the user callback returns an array of fonts, pass the pointer value to Rive of the font to try\n // 3. If no callback is provided, or the callback returns null, try the static list of fonts if they set any\n // 4. If no fallback method is set, return null.\n private static _wireFallbackProc(): void {\n RuntimeLoader.getInstance((rive: rc.RiveCanvas) => {\n const { _fallbackFontCallback: cb } = RiveFont;\n if (cb) {\n rive.setFallbackFontCallback(\n ((missingGlyph: number, fallbackFontIndex: number, weight: number) => {\n const fontsReturned = cb(missingGlyph, weight);\n if (fontsReturned) {\n if (Array.isArray(fontsReturned)) {\n return RiveFont._getFallbackPtr(\n fontsReturned,\n fallbackFontIndex\n );\n }\n // If the user callback only returns a single font, provide it to Rive the first time, otherwise if Rive\n // calls back a second time, return null to indicate there are no more fallbacks to try.\n return fallbackFontIndex === 0 ? RiveFont._fontToPtr(fontsReturned) : null;\n }\n return null;\n }) as CallbackToPointerValue\n );\n } else {\n rive.setFallbackFontCallback(null);\n }\n });\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import * as rc from \"./rive_advanced.mjs\";\nimport { Animation } from \"./animation\";\nimport { RuntimeLoader, type RuntimeCallback } from \"./runtimeLoader\";\nimport {\n SemanticTreeModel,\n AccessibilityOverlay,\n SemanticMode,\n type RiveSemanticsOptions,\n type SemanticActionType,\n} from \"./semantics\";\nimport {\n registerTouchInteractions,\n KeyboardInteractions,\n FocusSessionState,\n sanitizeUrl,\n BLANK_URL,\n ImageWrapper,\n AudioWrapper,\n FontWrapper,\n finalizationRegistry,\n CustomFileAssetLoaderWrapper,\n FileFinalizer,\n createFinalization,\n RiveFont as RiveFontClassUtil,\n} from \"./utils\";\nexport type AssetLoadCallback = (\n asset: rc.FileAsset,\n bytes: Uint8Array,\n) => boolean;\n\nclass RiveError extends Error {\n public isHandledError = true;\n}\n\nexport { RiveFontClassUtil as RiveFont };\nexport { SemanticMode };\nexport type { RiveSemanticsOptions };\n\n// Note: Re-exporting a few types from rive_advanced.mjs to expose for high-level\n// API usage without re-defining their type definition here. May want to revisit\n// and see if we want to expose both types from rive.ts and rive_advanced.mjs in\n// the future\nexport type {\n FileAsset,\n AudioAsset,\n FontAsset,\n ImageAsset,\n} from \"./rive_advanced.mjs\";\n\n/**\n * Generic type for a parameterless void callback\n */\nexport type VoidCallback = () => void;\n\ninterface SetupRiveListenersOptions {\n isTouchScrollEnabled?: boolean;\n}\n\n/**\n * Type for artboard bounds\n */\nexport type Bounds = rc.AABB;\n\n// #regions helpers\nconst resolveErrorMessage = (error: any): string =>\n error && error.isHandledError\n ? error.message\n : \"Problem loading file; may be corrupt!\";\n\n// #region layout\n\n// Fit options for the canvas\nexport enum Fit {\n Cover = \"cover\",\n Contain = \"contain\",\n Fill = \"fill\",\n FitWidth = \"fitWidth\",\n FitHeight = \"fitHeight\",\n None = \"none\",\n ScaleDown = \"scaleDown\",\n Layout = \"layout\",\n}\n\n// Alignment options for the canvas\nexport enum Alignment {\n Center = \"center\",\n TopLeft = \"topLeft\",\n TopCenter = \"topCenter\",\n TopRight = \"topRight\",\n CenterLeft = \"centerLeft\",\n CenterRight = \"centerRight\",\n BottomLeft = \"bottomLeft\",\n BottomCenter = \"bottomCenter\",\n BottomRight = \"bottomRight\",\n}\n\n// Drawing optimization options\nexport enum DrawOptimizationOptions {\n AlwaysDraw = \"alwaysDraw\",\n DrawOnChanged = \"drawOnChanged\",\n}\n\n// Options for Rive focus management\nexport interface RiveFocusOptions {\n /**\n * When true, allows Rive to interrupt browser focus and programmatically\n * set/release focus on the canvas when the state machine reports focus\n * changes in Rive. This allows apps to direct focus to/from the canvas or\n * related elements as needed if not currently focused, which can happen at\n * any point in the Rive render loop.\n *\n * Note: Nodes in the Rive graphic may still receive/release focus respecting\n * any focus rules defined in the state machine.\n *\n * @default false to prevent unwanted focus interruptions\n */\n allowFocusInterrupt: boolean;\n}\n\n// Interface for the Layout static method constructor\nexport interface LayoutParameters {\n fit?: Fit;\n alignment?: Alignment;\n layoutScaleFactor?: number;\n minX?: number;\n minY?: number;\n maxX?: number;\n maxY?: number;\n}\n\n// Alignment options for Rive animations in a HTML canvas\nexport class Layout {\n // Runtime fit and alignment are accessed every frame, so we cache their\n // values to save cycles\n private cachedRuntimeFit: rc.Fit;\n private cachedRuntimeAlignment: rc.Alignment;\n\n public readonly fit: Fit;\n public readonly alignment: Alignment;\n public readonly layoutScaleFactor: number;\n public readonly minX: number;\n public readonly minY: number;\n public readonly maxX: number;\n public readonly maxY: number;\n\n constructor(params?: LayoutParameters) {\n this.fit = params?.fit ?? Fit.Contain;\n this.alignment = params?.alignment ?? Alignment.Center;\n this.layoutScaleFactor = params?.layoutScaleFactor ?? 1;\n this.minX = params?.minX ?? 0;\n this.minY = params?.minY ?? 0;\n this.maxX = params?.maxX ?? 0;\n this.maxY = params?.maxY ?? 0;\n }\n\n // Alternative constructor to build a Layout from an interface/object\n static new({\n fit,\n alignment,\n minX,\n minY,\n maxX,\n maxY,\n }: LayoutParameters): Layout {\n console.warn(\n \"This function is deprecated: please use `new Layout({})` instead\",\n );\n return new Layout({ fit, alignment, minX, minY, maxX, maxY });\n }\n\n /**\n * Makes a copy of the layout, replacing any specified parameters\n */\n public copyWith({\n fit,\n alignment,\n layoutScaleFactor,\n minX,\n minY,\n maxX,\n maxY,\n }: LayoutParameters): Layout {\n return new Layout({\n fit: fit ?? this.fit,\n alignment: alignment ?? this.alignment,\n layoutScaleFactor: layoutScaleFactor ?? this.layoutScaleFactor,\n minX: minX ?? this.minX,\n minY: minY ?? this.minY,\n maxX: maxX ?? this.maxX,\n maxY: maxY ?? this.maxY,\n });\n }\n\n // Returns fit for the Wasm runtime format\n public runtimeFit(rive: rc.RiveCanvas): rc.Fit {\n if (this.cachedRuntimeFit) return this.cachedRuntimeFit;\n\n let fit;\n if (this.fit === Fit.Cover) fit = rive.Fit.cover;\n else if (this.fit === Fit.Contain) fit = rive.Fit.contain;\n else if (this.fit === Fit.Fill) fit = rive.Fit.fill;\n else if (this.fit === Fit.FitWidth) fit = rive.Fit.fitWidth;\n else if (this.fit === Fit.FitHeight) fit = rive.Fit.fitHeight;\n else if (this.fit === Fit.ScaleDown) fit = rive.Fit.scaleDown;\n else if (this.fit === Fit.Layout) fit = rive.Fit.layout;\n else fit = rive.Fit.none;\n\n this.cachedRuntimeFit = fit;\n return fit;\n }\n\n // Returns alignment for the Wasm runtime format\n public runtimeAlignment(rive: rc.RiveCanvas): rc.Alignment {\n if (this.cachedRuntimeAlignment) return this.cachedRuntimeAlignment;\n\n let alignment;\n if (this.alignment === Alignment.TopLeft)\n alignment = rive.Alignment.topLeft;\n else if (this.alignment === Alignment.TopCenter)\n alignment = rive.Alignment.topCenter;\n else if (this.alignment === Alignment.TopRight)\n alignment = rive.Alignment.topRight;\n else if (this.alignment === Alignment.CenterLeft)\n alignment = rive.Alignment.centerLeft;\n else if (this.alignment === Alignment.CenterRight)\n alignment = rive.Alignment.centerRight;\n else if (this.alignment === Alignment.BottomLeft)\n alignment = rive.Alignment.bottomLeft;\n else if (this.alignment === Alignment.BottomCenter)\n alignment = rive.Alignment.bottomCenter;\n else if (this.alignment === Alignment.BottomRight)\n alignment = rive.Alignment.bottomRight;\n else alignment = rive.Alignment.center;\n\n this.cachedRuntimeAlignment = alignment;\n return alignment;\n }\n}\n\n// #endregion\n\n// #region runtime\n\nexport { RuntimeLoader, type RuntimeCallback };\n\n// #endregion\n\n// #region state machines\n\nexport enum StateMachineInputType {\n Number = 56,\n Trigger = 58,\n Boolean = 59,\n}\n\n/**\n * An input for a state machine\n */\nexport class StateMachineInput {\n constructor(\n public readonly type: StateMachineInputType,\n private runtimeInput: rc.SMIInput,\n ) {}\n\n /**\n * Returns the name of the input\n */\n public get name(): string {\n return this.runtimeInput.name;\n }\n\n /**\n * Returns the current value of the input\n */\n public get value(): number | boolean {\n return this.runtimeInput.value;\n }\n\n /**\n * Sets the value of the input\n */\n public set value(value: number | boolean) {\n this.runtimeInput.value = value;\n }\n\n /**\n * Fires a trigger; does nothing on Number or Boolean input types\n */\n public fire(): void {\n if (this.type === StateMachineInputType.Trigger) {\n this.runtimeInput.fire();\n }\n }\n\n /**\n * Deletes the input\n */\n public delete(): void {\n this.runtimeInput = null;\n }\n}\n\nexport enum RiveEventType {\n General = 128,\n OpenUrl = 131,\n}\n\nclass BaseArtboard {\n public isBindableArtboard: boolean = false;\n constructor(_isBindableArtboard: boolean) {\n this.isBindableArtboard = _isBindableArtboard;\n }\n}\n\nclass Artboard extends BaseArtboard {\n public nativeArtboard: rc.Artboard;\n public file: RiveFile;\n constructor(artboard: rc.Artboard, _file: RiveFile) {\n super(false);\n this.nativeArtboard = artboard;\n this.file = _file;\n }\n}\n\nclass BindableArtboard extends BaseArtboard implements rc.FinalizableTarget {\n public selfUnref: boolean = false;\n public nativeArtboard: rc.BindableArtboard;\n public nativeViewModel: rc.ViewModelInstance | null;\n constructor(artboard: rc.BindableArtboard) {\n super(true);\n this.nativeArtboard = artboard;\n }\n public set viewModel(value: ViewModelInstance) {\n this.nativeViewModel = value.nativeInstance;\n }\n destroy() {\n if (this.selfUnref) {\n this.nativeArtboard.unref();\n this.nativeViewModel?.unref();\n }\n }\n}\n\nclass StateMachine {\n /**\n * Caches the inputs from the runtime\n */\n public readonly inputs: StateMachineInput[] = [];\n\n /**\n * Runtime state machine instance\n */\n public readonly instance: rc.StateMachineInstance;\n\n /**\n * Whether this state machine has focus nodes\n */\n public get hasFocusNodes(): boolean {\n return this.instance.hasFocusNodes();\n }\n\n /**\n * @constructor\n * @param stateMachine runtime state machine object\n * @param instance runtime state machine instance object\n */\n constructor(\n private stateMachine: rc.StateMachine,\n runtime: rc.RiveCanvas,\n public playing: boolean,\n private artboard: rc.Artboard,\n ) {\n this.instance = new runtime.StateMachineInstance(stateMachine, artboard);\n this.initInputs(runtime);\n }\n\n public get name(): string {\n return this.stateMachine.name;\n }\n\n /**\n * Returns a list of state names that have changed on this frame\n */\n public get statesChanged(): string[] {\n const names: string[] = [];\n for (let i = 0; i < this.instance.stateChangedCount(); i++) {\n names.push(this.instance.stateChangedNameByIndex(i));\n }\n return names;\n }\n\n /**\n * Advances the state machine instance by a given time.\n * @param time - the time to advance the animation by in seconds\n */\n public advance(time: number) {\n this.instance.advance(time);\n }\n\n /**\n * Advances the state machine instance by a given time and apply changes to artboard.\n * @param time - the time to advance the animation by in seconds\n */\n public advanceAndApply(time: number) {\n this.instance.advanceAndApply(time);\n }\n\n /**\n * Enables semantic tree tracking for this state machine instance.\n */\n public enableSemantics() {\n this.instance.enableSemantics();\n }\n\n /**\n * Returns the incremental semantic diff since the last call, or null\n * if semantics is not enabled or nothing changed.\n */\n public drainSemanticsDiff(): rc.SemanticsDiff | null {\n return this.instance.drainSemanticsDiff();\n }\n\n /**\n * Fire a semantic action (tap, increase, decrease) on a node.\n * @param nodeId - The semantic node ID to target\n * @param actionType - 0 = tap, 1 = increase, 2 = decrease\n */\n public fireSemanticAction(nodeId: number, actionType: SemanticActionType) {\n this.instance.fireSemanticAction(nodeId, actionType);\n }\n\n /**\n * When tools that enable accessible experiences traverse elements with focus,\n * we should call this method to focus the semantic node. It will also trigger\n * focus on any Focus listeners for this node\n * @param nodeId ID of the Semantic Node to focus\n * @returns boolean - True if focus was set, false otherwise\n */\n public focusSemanticNode(nodeId: number): boolean {\n return this.instance.focusSemanticNode(nodeId);\n }\n\n /**\n * Returns the number of events reported from the last advance call\n * @returns Number of events reported\n */\n public reportedEventCount(): number {\n return this.instance.reportedEventCount();\n }\n\n /**\n * Returns a RiveEvent object emitted from the last advance call at the given index\n * of a list of potentially multiple events. If an event at the index is not found,\n * undefined is returned.\n * @param i index of the event reported in a list of potentially multiple events\n * @returns RiveEvent or extended RiveEvent object returned, or undefined\n */\n reportedEventAt(i: number): rc.OpenUrlEvent | rc.RiveEvent | undefined {\n return this.instance.reportedEventAt(i);\n }\n\n /**\n * Fetches references to the state machine's inputs and caches them\n * @param runtime an instance of the runtime; needed for the SMIInput types\n */\n private initInputs(runtime: rc.RiveCanvas): void {\n // Fetch the inputs from the runtime if we don't have them\n for (let i = 0; i < this.instance.inputCount(); i++) {\n const input = this.instance.input(i);\n this.inputs.push(this.mapRuntimeInput(input, runtime));\n }\n }\n\n /**\n * Maps a runtime input to it's appropriate type\n * @param input\n */\n private mapRuntimeInput(\n input: rc.SMIInput,\n runtime: rc.RiveCanvas,\n ): StateMachineInput {\n if (input.type === runtime.SMIInput.bool) {\n return new StateMachineInput(\n StateMachineInputType.Boolean,\n input.asBool(),\n );\n } else if (input.type === runtime.SMIInput.number) {\n return new StateMachineInput(\n StateMachineInputType.Number,\n input.asNumber(),\n );\n } else if (input.type === runtime.SMIInput.trigger) {\n return new StateMachineInput(\n StateMachineInputType.Trigger,\n input.asTrigger(),\n );\n }\n }\n\n /**\n * Deletes the backing Wasm state machine instance; once this is called, this\n * state machine is no more.\n */\n public cleanup() {\n this.inputs.forEach((input) => {\n input.delete();\n });\n this.inputs.length = 0;\n this.instance.delete();\n }\n\n public bindViewModelInstance(viewModelInstance: ViewModelInstance) {\n if (viewModelInstance.runtimeInstance != null) {\n this.instance.bindViewModelInstance(viewModelInstance.runtimeInstance);\n }\n }\n\n /**\n * Get metadata about the state of focus if applicable for this state machine.\n * @returns FocusState - { hasFocus: boolean, expectsKeyboardInput: boolean }\n */\n public focusState(): rc.FocusState { \n return this.instance.focusState();\n }\n\n /**\n * Clear focus from the Rive focus node tree.\n */\n public clearFocus(): void {\n this.instance.clearFocus();\n }\n}\n\n// #endregion\n\n// #region animator\n\n/**\n * Manages animation\n */\nclass Animator {\n /**\n * Constructs a new animator\n * @constructor\n * @param runtime Rive runtime; needed to instance animations & state machines\n * @param artboard the artboard that holds all animations and state machines\n * @param animations optional list of animations\n * @param stateMachines optional list of state machines\n */\n constructor(\n private runtime: rc.RiveCanvas,\n private artboard: rc.Artboard,\n private eventManager: EventManager,\n public readonly animations: Animation[] = [],\n public readonly stateMachines: StateMachine[] = [],\n ) {}\n\n /**\n * Adds animations and state machines by their names. If names are shared\n * between animations & state machines, then the first one found will be\n * created. Best not to use the same names for these in your Rive file.\n * @param animatable the name(s) of animations and state machines to add\n * @returns a list of names of the playing animations and state machines\n */\n public add(\n animatables: string | string[],\n playing: boolean,\n fireEvent = true,\n semanticsActive = false,\n ): string[] {\n animatables = mapToStringArray(animatables);\n // If animatables is empty, play or pause everything\n if (animatables.length === 0) {\n this.animations.forEach((a) => (a.playing = playing));\n this.stateMachines.forEach((m) => (m.playing = playing));\n } else {\n // Play/pause already instanced items, or create new instances\n const instancedAnimationNames = this.animations.map((a) => a.name);\n const instancedMachineNames = this.stateMachines.map((m) => m.name);\n for (let i = 0; i < animatables.length; i++) {\n const aIndex = instancedAnimationNames.indexOf(animatables[i]);\n const mIndex = instancedMachineNames.indexOf(animatables[i]);\n if (aIndex >= 0 || mIndex >= 0) {\n if (aIndex >= 0) {\n // Animation is instanced, play/pause it\n this.animations[aIndex].playing = playing;\n } else {\n // State machine is instanced, play/pause it\n this.stateMachines[mIndex].playing = playing;\n }\n } else {\n // Try to create a new animation instance\n const anim = this.artboard.animationByName(animatables[i]);\n if (anim) {\n const newAnimation = new Animation(\n anim,\n this.artboard,\n this.runtime,\n playing,\n );\n // Display the first frame of the specified animation\n newAnimation.advance(0);\n newAnimation.apply(1.0);\n this.animations.push(newAnimation);\n } else {\n // Try to create a new state machine instance\n const sm = this.artboard.stateMachineByName(animatables[i]);\n if (sm) {\n const newStateMachine = new StateMachine(\n sm,\n this.runtime,\n playing,\n this.artboard,\n );\n if (semanticsActive) {\n newStateMachine.enableSemantics();\n }\n this.stateMachines.push(newStateMachine);\n }\n }\n }\n }\n }\n // Fire play/paused events for animations\n if (fireEvent) {\n if (playing) {\n this.eventManager.fire({\n type: EventType.Play,\n data: this.playing,\n });\n } else {\n this.eventManager.fire({\n type: EventType.Pause,\n data: this.paused,\n });\n }\n }\n\n return playing ? this.playing : this.paused;\n }\n\n /**\n * Adds linear animations by their names.\n * @param animatables the name(s) of animations to add\n * @param playing whether animations should play on instantiation\n */\n public initLinearAnimations(animatables: string[], playing: boolean, isFallingBackFromStateMachines = false) {\n // Play/pause already instanced items, or create new instances\n // This validation is kept to maintain compatibility with current behavior.\n // But given that it this is called during artboard initialization\n // it should probably be safe to remove.\n const instancedAnimationNames = this.animations.map((a) => a.name);\n for (let i = 0; i < animatables.length; i++) {\n const aIndex = instancedAnimationNames.indexOf(animatables[i]);\n if (aIndex >= 0) {\n this.animations[aIndex].playing = playing;\n } else {\n // Try to create a new animation instance\n const anim = this.artboard.animationByName(animatables[i]);\n if (anim) {\n const newAnimation = new Animation(\n anim,\n this.artboard,\n this.runtime,\n playing,\n );\n // Display the first frame of the specified animation\n newAnimation.advance(0);\n newAnimation.apply(1.0);\n this.animations.push(newAnimation);\n } else if (isFallingBackFromStateMachines) { // Throw LoadError if we cannot load the state machine name at all\n const smInitializationMessage = `State Machine with name ${animatables[i]} not found`;\n throw new RiveError(smInitializationMessage);\n } else {\n console.error(`Animation with name ${animatables[i]} not found.`);\n }\n }\n }\n }\n\n /**\n * Adds state machines by their names.\n * @param animatables the name(s) of state machines to add\n * @param playing whether state machines should play on instantiation\n */\n public initStateMachines(animatables: string[], playing: boolean, semanticsActive: boolean) {\n // Play/pause already instanced items, or create new instances\n // This validation is kept to maintain compatibility with current behavior.\n // But given that it this is called during artboard initialization\n // it should probably be safe to remove.\n const instancedStateMachineNames = this.stateMachines.map((a) => a.name);\n for (let i = 0; i < animatables.length; i++) {\n const aIndex = instancedStateMachineNames.indexOf(animatables[i]);\n if (aIndex >= 0) {\n this.stateMachines[aIndex].playing = playing;\n } else {\n // Try to create a new state machine instance\n const sm = this.artboard.stateMachineByName(animatables[i]);\n if (sm) {\n const newStateMachine = new StateMachine(\n sm,\n this.runtime,\n playing,\n this.artboard,\n );\n if (semanticsActive) {\n newStateMachine.enableSemantics();\n }\n this.stateMachines.push(newStateMachine);\n } else {\n console.warn(`State Machine with name ${animatables[i]} not found. Falling back to find an animation with the same name.`);\n \n // TODO: Remove this fallback in next major release as it complicates initialization.\n // In order to maintain compatibility with current behavior, if a state machine is not found\n // we look for an animation with the same name\n this.initLinearAnimations([animatables[i]], playing, true);\n }\n }\n }\n }\n\n /**\n * Play the named animations/state machines\n * @param animatables the names of the animations/machines to play; plays all if empty\n * @returns a list of the playing items\n */\n public play(animatables: string | string[]): string[] {\n return this.add(animatables, true);\n }\n\n /**\n * Advance state machines if they are paused after initialization\n */\n public advanceIfPaused(): void {\n this.stateMachines.forEach((sm) => {\n if (!sm.playing) {\n sm.advanceAndApply(0);\n }\n });\n }\n\n /**\n * Pauses named animations and state machines, or everything if nothing is\n * specified\n * @param animatables names of the animations and state machines to pause\n * @returns a list of names of the animations and state machines paused\n */\n public pause(animatables: string[]): string[] {\n return this.add(animatables, false);\n }\n\n /**\n * Set time of named animations\n * @param animations names of the animations to scrub\n * @param value time scrub value, a floating point number to which the playhead is jumped\n * @returns a list of names of the animations that were scrubbed\n */\n public scrub(animatables: string[], value: number): string[] {\n const forScrubbing = this.animations.filter((a) =>\n animatables.includes(a.name),\n );\n forScrubbing.forEach((a) => (a.scrubTo = value));\n return forScrubbing.map((a) => a.name);\n }\n\n /**\n * Returns a list of names of all animations and state machines currently\n * playing\n */\n public get playing(): string[] {\n return this.animations\n .filter((a) => a.playing)\n .map((a) => a.name)\n .concat(this.stateMachines.filter((m) => m.playing).map((m) => m.name));\n }\n\n /**\n * Returns a list of names of all animations and state machines currently\n * paused\n */\n public get paused(): string[] {\n return this.animations\n .filter((a) => !a.playing)\n .map((a) => a.name)\n .concat(this.stateMachines.filter((m) => !m.playing).map((m) => m.name));\n }\n\n /**\n * Stops and removes all named animations and state machines\n * @param animatables animations and state machines to remove\n * @returns a list of names of removed items\n */\n public stop(animatables?: string[] | string): string[] {\n animatables = mapToStringArray(animatables);\n\n // If nothing's specified, wipe them out, all of them\n let removedNames: string[] = [];\n // Stop everything\n if (animatables.length === 0) {\n removedNames = this.animations\n .map((a) => a.name)\n .concat(this.stateMachines.map((m) => m.name));\n // Clean up before emptying the arrays\n this.animations.forEach((a) => a.cleanup());\n this.stateMachines.forEach((m) => m.cleanup());\n // Empty out the arrays\n this.animations.splice(0, this.animations.length);\n this.stateMachines.splice(0, this.stateMachines.length);\n } else {\n // Remove only the named animations/state machines\n const animationsToRemove = this.animations.filter((a) =>\n animatables.includes(a.name),\n );\n\n animationsToRemove.forEach((a) => {\n a.cleanup();\n this.animations.splice(this.animations.indexOf(a), 1);\n });\n const machinesToRemove = this.stateMachines.filter((m) =>\n animatables.includes(m.name),\n );\n machinesToRemove.forEach((m) => {\n m.cleanup();\n this.stateMachines.splice(this.stateMachines.indexOf(m), 1);\n });\n removedNames = animationsToRemove\n .map((a) => a.name)\n .concat(machinesToRemove.map((m) => m.name));\n }\n\n this.eventManager.fire({\n type: EventType.Stop,\n data: removedNames,\n });\n\n // Return the list of animations removed\n return removedNames;\n }\n\n /**\n * Returns true if at least one animation is active\n */\n public get isPlaying(): boolean {\n return (\n this.animations.reduce((acc, curr) => acc || curr.playing, false) ||\n this.stateMachines.reduce((acc, curr) => acc || curr.playing, false)\n );\n }\n\n /**\n * Returns true if all animations are paused and there's at least one animation\n */\n public get isPaused(): boolean {\n return (\n !this.isPlaying &&\n (this.animations.length > 0 || this.stateMachines.length > 0)\n );\n }\n\n /**\n * Returns true if there are no playing or paused animations/state machines\n */\n public get isStopped(): boolean {\n return this.animations.length === 0 && this.stateMachines.length === 0;\n }\n\n /**\n * If there are no animations or state machines, add the first one found\n * @returns the name of the animation or state machine instanced\n */\n public atLeastOne(playing: boolean, fireEvent = true, semanticsActive = false): string {\n let instancedName: string;\n if (this.animations.length === 0 && this.stateMachines.length === 0) {\n if (this.artboard.animationCount() > 0) {\n // Add the first animation\n this.add(\n [(instancedName = this.artboard.animationByIndex(0).name)],\n playing,\n fireEvent,\n );\n } else if (this.artboard.stateMachineCount() > 0) {\n // Add the first state machine\n this.add(\n [(instancedName = this.artboard.stateMachineByIndex(0).name)],\n playing,\n fireEvent,\n semanticsActive,\n );\n }\n }\n return instancedName;\n }\n\n /**\n * Checks if any animations have looped and if so, fire the appropriate event\n */\n public handleLooping() {\n for (const animation of this.animations.filter((a) => a.playing)) {\n // Emit if the animation looped\n if (animation.loopValue === 0 && animation.loopCount) {\n animation.loopCount = 0;\n // This is a one-shot; if it has ended, delete the instance\n this.stop(animation.name);\n } else if (animation.loopValue === 1 && animation.loopCount) {\n this.eventManager.fire({\n type: EventType.Loop,\n data: { animation: animation.name, type: LoopType.Loop },\n });\n animation.loopCount = 0;\n }\n // Wasm indicates a loop at each time the animation\n // changes direction, so a full loop/lap occurs every\n // two loop counts\n else if (animation.loopValue === 2 && animation.loopCount > 1) {\n this.eventManager.fire({\n type: EventType.Loop,\n data: { animation: animation.name, type: LoopType.PingPong },\n });\n animation.loopCount = 0;\n }\n }\n }\n\n /**\n * Checks if states have changed in state machines and fires a statechange\n * event\n */\n public handleStateChanges() {\n const statesChanged: string[] = [];\n for (const stateMachine of this.stateMachines.filter((sm) => sm.playing)) {\n statesChanged.push(...stateMachine.statesChanged);\n }\n if (statesChanged.length > 0) {\n this.eventManager.fire({\n type: EventType.StateChange,\n data: statesChanged,\n });\n }\n }\n\n public handleAdvancing(time: number) {\n this.eventManager.fire({\n type: EventType.Advance,\n data: time,\n });\n }\n}\n\n// #endregion\n\n// #region events\n\n/**\n * Supported event types triggered in Rive\n */\nexport enum EventType {\n Load = \"load\",\n LoadError = \"loaderror\",\n Play = \"play\",\n Pause = \"pause\",\n Stop = \"stop\",\n Loop = \"loop\",\n Draw = \"draw\",\n Advance = \"advance\",\n StateChange = \"statechange\",\n RiveEvent = \"riveevent\",\n AudioStatusChange = \"audiostatuschange\", // internal event. TODO: split\n}\n\nexport type RiveEventPayload = rc.RiveEvent | rc.OpenUrlEvent;\n\n// Event reported by Rive for significant events during animation playback (i.e. play, pause, stop, etc.),\n// as well as for custom Rive events reported from the state machine defined at design-time.\nexport interface Event {\n type: EventType;\n data?: string | string[] | LoopEvent | number | RiveEventPayload | RiveFile;\n}\n\n/**\n * Looping types: one-shot, loop, and ping-pong\n */\nexport enum LoopType {\n OneShot = \"oneshot\", // has value 0 in runtime\n Loop = \"loop\", // has value 1 in runtime\n PingPong = \"pingpong\", // has value 2 in runtime\n}\n\n/**\n * Loop events are returned through onloop callbacks\n */\nexport interface LoopEvent {\n animation: string;\n type: LoopType;\n}\n\n/**\n * Loop events are returned through onloop callbacks\n */\nexport type EventCallback = (event: Event) => void;\n\n/**\n * Event listeners registered with the event manager\n */\nexport interface EventListener {\n type: EventType;\n callback: EventCallback;\n}\n\n/**\n * FPS Reporting through callbacks sent to the WASM runtime\n */\nexport type FPSCallback = (fps: number) => void;\n\n// Manages Rive events and listeners\nclass EventManager {\n constructor(private listeners: EventListener[] = []) {}\n\n // Gets listeners of specified type\n private getListeners(type: EventType): EventListener[] {\n return this.listeners.filter((e) => e.type === type);\n }\n\n // Adds a listener\n public add(listener: EventListener): void {\n if (!this.listeners.includes(listener)) {\n this.listeners.push(listener);\n }\n }\n\n /**\n * Removes a listener\n * @param listener the listener with the callback to be removed\n */\n public remove(listener: EventListener): void {\n // We can't simply look for the listener as it'll be a different instance to\n // one originally subscribed. Find all the listeners of the right type and\n // then check their callbacks which should match.\n for (let i = 0; i < this.listeners.length; i++) {\n const currentListener = this.listeners[i];\n if (currentListener.type === listener.type) {\n if (currentListener.callback === listener.callback) {\n this.listeners.splice(i, 1);\n break;\n }\n }\n }\n }\n\n /**\n * Clears all listeners of specified type, or every listener if no type is\n * specified\n * @param type the type of listeners to clear, or all listeners if not\n * specified\n */\n public removeAll(type?: EventType) {\n if (!type) {\n this.listeners.splice(0, this.listeners.length);\n } else {\n this.listeners\n .filter((l) => l.type === type)\n .forEach((l) => this.remove(l));\n }\n }\n\n // Fires an event\n public fire(event: Event): void {\n const eventListeners = this.getListeners(event.type);\n eventListeners.forEach((listener) => listener.callback(event));\n }\n}\n\n// #endregion\n\n// #region Manages a queue of tasks\n\n// A task in the queue; will fire the action when the queue is processed; will\n// also optionally fire an event.\nexport interface Task {\n action?: VoidCallback;\n event?: Event;\n}\n\n// Manages a queue of tasks\nclass TaskQueueManager {\n private queue: Task[] = [];\n\n constructor(private eventManager: EventManager) {}\n\n // Adds a task top the queue\n public add(task: Task): void {\n this.queue.push(task);\n }\n\n // Processes all tasks in the queue\n public process(): void {\n while (this.queue.length > 0) {\n const task = this.queue.shift();\n if (task?.action) {\n task.action();\n }\n if (task?.event) {\n this.eventManager.fire(task.event);\n }\n }\n }\n}\n\n// #endregion\n\n// #region Audio\n\nenum SystemAudioStatus {\n AVAILABLE,\n UNAVAILABLE,\n}\n\n// Class to handle audio context availability and status changes\nclass AudioManager extends EventManager {\n private _started: boolean = false;\n private _enabled: boolean = false;\n\n private _status: SystemAudioStatus = SystemAudioStatus.UNAVAILABLE;\n private _audioContext: AudioContext;\n\n private async delay(time: number) {\n return new Promise((resolve) => setTimeout(resolve, time));\n }\n\n private async timeout() {\n return new Promise((_, reject) => setTimeout(reject, 50));\n }\n\n // Alerts animations on status changes and removes the listeners to avoid alerting twice.\n private reportToListeners() {\n this.fire({ type: EventType.AudioStatusChange });\n this.removeAll();\n }\n\n /**\n * The audio context has been resolved.\n * Alert any listeners that we can now play audio.\n * Rive will now play audio at the configured volume.\n */\n private async enableAudio() {\n if (!this._enabled) {\n this._enabled = true;\n this._status = SystemAudioStatus.AVAILABLE;\n this.reportToListeners();\n }\n }\n\n /**\n * Check if we are able to play audio.\n *\n * We currently check the audio context, when resume() returns before a timeout we know that the\n * audio context is running and we can enable audio.\n */\n private async testAudio() {\n if (\n this._status === SystemAudioStatus.UNAVAILABLE &&\n this._audioContext !== null\n ) {\n // if the audio context is not available, it will never resume,\n // so the timeout will throw after 50ms and a new cycle will start\n try {\n await Promise.race([this._audioContext.resume(), this.timeout()]);\n this.enableAudio();\n } catch {\n // we expect the promise race to timeout, which we ignore.\n }\n }\n }\n\n /**\n * Establish audio for use with rive.\n * We both test if we can use audio intermittently and listen for user interaction.\n * The aim is to enable audio playback as soon as the browser allows this.\n */\n private async _establishAudio() {\n if (!this._started) {\n this._started = true;\n // If window doesn't exist we assume they are not in a browser context\n // so audio will not be blocked\n if (typeof window == \"undefined\") {\n this.enableAudio();\n } else {\n this._audioContext = new AudioContext();\n this.listenForUserAction();\n while (this._status === SystemAudioStatus.UNAVAILABLE) {\n await this.testAudio();\n await this.delay(1000);\n }\n }\n }\n }\n\n private listenForUserAction() {\n // NOTE: AudioContexts are ready immediately if requested in a ui callback\n // we *could* re request one in this listener.\n const _clickListener = async () => {\n // note this has \"better\" results than calling `await this.testAudio()`\n // as we force audio to be enabled in the current thread, rather than chancing\n // the thread to be passed over for some other async context\n\n this.enableAudio();\n };\n // NOTE: we should test this on mobile/pads\n document.addEventListener(\"pointerdown\", _clickListener, {\n once: true,\n });\n }\n\n /**\n * Establish the audio context for rive, this lets rive know that we can play audio.\n */\n public async establishAudio() {\n this._establishAudio();\n }\n\n public get systemVolume() {\n if (this._status === SystemAudioStatus.UNAVAILABLE) {\n // We do an immediate test to avoid depending on the delay of the running test\n this.testAudio();\n return 0;\n }\n return 1;\n }\n\n public get status(): SystemAudioStatus {\n return this._status;\n }\n}\n\nconst audioManager = new AudioManager();\n\n// #endregion\n\n// #region Observers\n\ntype ObservedObject = {\n onResize: Function;\n element: HTMLCanvasElement;\n};\n\ntype MyResizeObserverType = {\n observe: Function;\n unobserve: Function;\n disconnect: Function;\n};\n\nclass FakeResizeObserver {\n observe() {}\n unobserve() {}\n disconnect() {}\n}\n\nconst MyResizeObserver = globalThis.ResizeObserver || FakeResizeObserver;\n\n/**\n * This class takes care of any observers that will be attached to an animation.\n * It should be treated as a singleton because observers are much more performant\n * when used for observing multiple elements by a single instance.\n */\n\nclass ObjectObservers {\n private _elementsMap: Map<HTMLCanvasElement, ObservedObject> = new Map();\n\n private _resizeObserver: MyResizeObserverType;\n\n constructor() {\n this._resizeObserver = new MyResizeObserver(this._onObserved);\n }\n\n /**\n * Resize observers trigger both when the element changes its size and also when the\n * element is added or removed from the document.\n */\n private _onObservedEntry = (entry: ResizeObserverEntry) => {\n const observed = this._elementsMap.get(entry.target as HTMLCanvasElement);\n if (observed !== null) {\n observed.onResize(\n entry.target.clientWidth == 0 || entry.target.clientHeight == 0,\n );\n } else {\n this._resizeObserver.unobserve(entry.target);\n }\n };\n\n private _onObserved = (entries: ResizeObserverEntry[]) => {\n entries.forEach(this._onObservedEntry);\n };\n\n // Adds an observable element\n public add(element: HTMLCanvasElement, onResize: Function) {\n let observed: ObservedObject = {\n onResize,\n element,\n };\n this._elementsMap.set(element, observed);\n this._resizeObserver.observe(element);\n return observed;\n }\n\n // Removes an observable element\n public remove(observed: ObservedObject) {\n this._resizeObserver.unobserve(observed.element);\n this._elementsMap.delete(observed.element);\n }\n}\n\nconst observers = new ObjectObservers();\n\n// #endregion\n\n// #region Rive\n\nlet nextRiveInstanceId = 0;\n\n// Interface for the Rive static method contructor\nexport interface RiveParameters {\n canvas: HTMLCanvasElement | OffscreenCanvas; // canvas is required\n src?: string; // one of src or buffer or file is required\n buffer?: ArrayBuffer; // one of src or buffer or file is required\n riveFile?: RiveFile;\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n layout?: Layout;\n autoplay?: boolean;\n useOffscreenRenderer?: boolean;\n /**\n * Optional tab index to set for the canvas element if there are any Focus nodes within the graphic\n */\n tabIndex?: number;\n /**\n * Optional settings for focus behavior\n */\n focusOptions?: RiveFocusOptions;\n /**\n * Allow the runtime to automatically load assets hosted in Rive's CDN.\n * enabled by default.\n */\n enableRiveAssetCDN?: boolean;\n /**\n * @experimental This API is early and may encounter breaking behavior change without a major version bump\n *\n * When to build semantic trees and the accessibility DOM overlay.\n * Defaults to {@link SemanticMode.Disabled}.\n */\n semanticsMode?: SemanticMode;\n /**\n * @experimental This API is early and may encounter breaking behavior change without a major version bump\n *\n * Optional options for the accessibility overlay container.\n */\n semanticsOptions?: RiveSemanticsOptions;\n /**\n * Turn off Rive Listeners. This means state machines that have Listeners\n * will not be invoked, and also, no event listeners pertaining to Listeners\n * will be attached to the <canvas> element\n */\n shouldDisableRiveListeners?: boolean;\n /**\n * For Rive Listeners, allows scrolling behavior to still occur on canvas elements\n * when a touch/drag action is performed on touch-enabled devices. Otherwise,\n * scroll behavior may be prevented on touch/drag actions on the canvas by default.\n */\n isTouchScrollEnabled?: boolean;\n /**\n * Enable Rive Events to be handled by the runtime. This means any special Rive Event may have\n * a side effect that takes place implicitly.\n *\n * For example, if during the render loop an OpenUrlEvent is detected, the\n * browser may try to open the specified URL in the payload.\n *\n * This flag is false by default to prevent any unwanted behaviors from taking place.\n * This means any special Rive Event will have to be handled manually by subscribing to\n * EventType.RiveEvent\n */\n automaticallyHandleEvents?: boolean;\n /**\n * Rive will look for a default view model and view model instance to bind to the artboard\n */\n autoBind?: boolean;\n /**\n * For Rive Listeners, dispatch a pointer exit when the pointer exits the canvas.\n */\n dispatchPointerExit?: boolean;\n /**\n * Enables multi touch support\n */\n enableMultiTouch?: boolean;\n /**\n * Enum with drawing options for optimizations\n */\n drawingOptions?: DrawOptimizationOptions;\n /**\n * Emit performance.mark / performance.measure entries for load lifecycle\n * events and the first 3 render frames. Useful for profiling Rive's\n * contribution to load and render time in browser devtools.\n * False by default.\n */\n enablePerfMarks?: boolean;\n onLoad?: EventCallback;\n onLoadError?: EventCallback;\n onPlay?: EventCallback;\n onPause?: EventCallback;\n onStop?: EventCallback;\n onLoop?: EventCallback;\n onStateChange?: EventCallback;\n onAdvance?: EventCallback;\n assetLoader?: AssetLoadCallback;\n /**\n * @deprecated Use `onLoad()` instead\n */\n onload?: EventCallback;\n /**\n * @deprecated Use `onLoadError()` instead\n */\n onloaderror?: EventCallback;\n /**\n * @deprecated Use `onPlay()` instead\n */\n onplay?: EventCallback;\n /**\n * @deprecated Use `onPause()` instead\n */\n onpause?: EventCallback;\n /**\n * @deprecated Use `onStop()` instead\n */\n onstop?: EventCallback;\n /**\n * @deprecated Use `onLoop()` instead\n */\n onloop?: EventCallback;\n /**\n * @deprecated Use `onStateChange()` instead\n */\n onstatechange?: EventCallback;\n}\n\n// Interface to Rive.load function\nexport interface RiveLoadParameters {\n src?: string;\n buffer?: ArrayBuffer;\n riveFile?: RiveFile;\n autoplay?: boolean;\n autoBind?: boolean;\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n useOffscreenRenderer?: boolean;\n shouldDisableRiveListeners?: boolean;\n tabIndex?: number;\n semanticsMode?: SemanticMode;\n semanticsOptions?: RiveSemanticsOptions;\n}\n\n// Interface ot Rive.reset function\nexport interface RiveResetParameters {\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n autoplay?: boolean;\n autoBind?: boolean;\n}\n// Interface to RiveFile.load function\nexport interface RiveFileParameters {\n src?: string;\n buffer?: ArrayBuffer;\n assetLoader?: AssetLoadCallback;\n enableRiveAssetCDN?: boolean;\n onLoad?: EventCallback;\n onLoadError?: EventCallback;\n /**\n * Emit performance.mark / performance.measure entries for load lifecycle\n * events. False by default.\n */\n enablePerfMarks?: boolean;\n}\n\nexport class RiveFile implements rc.FinalizableTarget {\n // Error message for missing source or buffer\n private static readonly missingErrorMessage: string =\n \"Rive source file or data buffer required\";\n\n // Error message for file load error\n private static readonly fileLoadErrorMessage: string =\n \"The file failed to load\";\n\n // A url to a Rive file; may be undefined if a buffer is specified\n private src: string;\n\n // Raw Rive file data; may be undefined if a src is specified\n private buffer: ArrayBuffer;\n\n // Wasm runtime\n private runtime: rc.RiveCanvas;\n\n // Runtime file\n private file: rc.File;\n\n // AssetLoadCallback: allows customizing asset loading for images and fonts.\n private assetLoader: AssetLoadCallback;\n\n // Allow the runtime to automatically load assets hosted in Rive's runtime.\n private enableRiveAssetCDN: boolean = true;\n\n // When true, emits performance.mark/measure entries during RiveFile load.\n private enablePerfMarks: boolean = false;\n\n // Holds event listeners\n private eventManager: EventManager;\n\n private referenceCount: number = 0;\n\n private destroyed: boolean = false;\n\n public selfUnref: boolean = false;\n\n private bindableArtboards: BindableArtboard[] = [];\n\n constructor(params: RiveFileParameters) {\n this.src = params.src;\n this.buffer = params.buffer;\n\n if (params.assetLoader) this.assetLoader = params.assetLoader;\n this.enableRiveAssetCDN =\n typeof params.enableRiveAssetCDN == \"boolean\"\n ? params.enableRiveAssetCDN\n : true;\n this.enablePerfMarks = !!params.enablePerfMarks;\n if (this.enablePerfMarks) RuntimeLoader.enablePerfMarks = true;\n\n // New event management system\n this.eventManager = new EventManager();\n if (params.onLoad) this.on(EventType.Load, params.onLoad);\n if (params.onLoadError) this.on(EventType.LoadError, params.onLoadError);\n }\n\n private releaseFile() {\n if (this.selfUnref) {\n this.file?.unref();\n }\n this.file = null;\n }\n\n private releaseBindableArtboards() {\n this.bindableArtboards.forEach((bindableArtboard) =>\n bindableArtboard.destroy(),\n );\n }\n\n private async initData() {\n if (this.src && !this.buffer) {\n try {\n this.buffer = await loadRiveFile(this.src);\n } catch (error) {\n if (error instanceof Error) {\n throw error;\n }\n throw new RiveError(RiveFile.fileLoadErrorMessage);\n }\n }\n if (this.destroyed) {\n return;\n }\n let loader;\n if (this.assetLoader) {\n const loaderWrapper = new CustomFileAssetLoaderWrapper(\n this.runtime,\n this.assetLoader,\n );\n loader = loaderWrapper.assetLoader;\n }\n // Load the Rive file\n if (this.enablePerfMarks) performance.mark('rive:file-load:start');\n this.file = await this.runtime.load(\n new Uint8Array(this.buffer),\n loader,\n this.enableRiveAssetCDN,\n );\n if (this.enablePerfMarks) {\n performance.mark('rive:file-load:end');\n performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');\n }\n const fileFinalizer = new FileFinalizer(this.file);\n finalizationRegistry.register(this, fileFinalizer);\n\n if (this.destroyed) {\n this.releaseFile();\n return;\n }\n if (this.file !== null) {\n this.eventManager.fire({\n type: EventType.Load,\n data: this,\n });\n } else {\n this.fireLoadError(RiveFile.fileLoadErrorMessage);\n }\n }\n\n private async loadRiveFileBytes(): Promise<ArrayBuffer> {\n if (this.enablePerfMarks) performance.mark('rive:fetch-riv:start');\n const bufferPromise: Promise<ArrayBuffer> = this.src\n ? loadRiveFile(this.src)\n : Promise.resolve(this.buffer);\n if (this.enablePerfMarks && this.src) {\n bufferPromise.then(() => {\n performance.mark('rive:fetch-riv:end');\n performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');\n })\n }\n return bufferPromise;\n }\n\n private async loadRuntime(): Promise<rc.RiveCanvas> {\n if (this.enablePerfMarks) performance.mark('rive:await-wasm:start');\n const runtimePromise = RuntimeLoader.awaitInstance();\n if (this.enablePerfMarks) {\n runtimePromise.then(() => {\n performance.mark('rive:await-wasm:end');\n performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');\n })\n }\n return runtimePromise;\n }\n\n public async init() {\n // If no source file url specified, it's a bust\n if (!this.src && !this.buffer) {\n this.fireLoadError(RiveFile.missingErrorMessage);\n return;\n }\n\n try {\n // Kick off the .riv file fetch and WASM module init simultaneously —\n // they have no dependency on each other so both can be in-flight at once.\n const [bufferResolved, runtimeResolved] = await Promise.all([this.loadRiveFileBytes(), this.loadRuntime()]);\n\n if (this.destroyed) {\n return;\n }\n // .riv file buffer and WASM runtime instance\n this.buffer = bufferResolved;\n this.runtime = runtimeResolved;\n\n if (this.enablePerfMarks) performance.mark('rive:init-data:start');\n await this.initData();\n if (this.enablePerfMarks) {\n performance.mark('rive:init-data:end');\n performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');\n }\n } catch (error) {\n this.fireLoadError(\n error instanceof Error ? error.message : RiveFile.fileLoadErrorMessage,\n );\n }\n }\n\n private fireLoadError(message: string): void {\n this.eventManager.fire({\n type: EventType.LoadError,\n data: message,\n });\n\n throw new RiveError(message);\n }\n\n /**\n * Subscribe to Rive-generated events\n * @param type the type of event to subscribe to\n * @param callback callback to fire when the event occurs\n */\n public on(type: EventType, callback: EventCallback) {\n this.eventManager.add({\n type: type,\n callback: callback,\n });\n }\n\n /**\n * Unsubscribes from a Rive-generated event\n * @param type the type of event to unsubscribe from\n * @param callback the callback to unsubscribe\n */\n public off(type: EventType, callback: EventCallback) {\n this.eventManager.remove({\n type: type,\n callback: callback,\n });\n }\n\n public cleanup() {\n this.referenceCount -= 1;\n if (this.referenceCount <= 0) {\n this.removeAllRiveEventListeners();\n this.releaseFile();\n this.releaseBindableArtboards();\n this.destroyed = true;\n }\n }\n\n /**\n * Unsubscribes all Rive listeners from an event type, or everything if no type is\n * given\n * @param type the type of event to unsubscribe from, or all types if\n * undefined\n */\n public removeAllRiveEventListeners(type?: EventType) {\n this.eventManager.removeAll(type);\n }\n\n public getInstance(): rc.File {\n if (this.file !== null) {\n this.referenceCount += 1;\n return this.file;\n }\n }\n\n public destroyIfUnused() {\n if (this.referenceCount <= 0) {\n this.cleanup();\n }\n }\n\n private createBindableArtboard(\n nativeBindableArtboard: rc.BindableArtboard,\n ): BindableArtboard | null {\n if (nativeBindableArtboard != null) {\n const bindableArtboard = new BindableArtboard(nativeBindableArtboard);\n createFinalization(bindableArtboard, bindableArtboard.nativeArtboard);\n this.bindableArtboards.push(bindableArtboard);\n return bindableArtboard;\n }\n return null;\n }\n\n /**\n * @deprecated This function is deprecated. For better stability and memory management\n * use `getBindableArtboard()` instead.\n * @param {string} name - The name of the artboard.\n * @returns {Artboard} The artboard to bind to.\n */\n public getArtboard(name: string): Artboard | null {\n const nativeArtboard = this.file.artboardByName(name);\n if (nativeArtboard != null) {\n return new Artboard(nativeArtboard, this);\n }\n }\n\n public getBindableArtboard(name: string): BindableArtboard | null {\n const nativeArtboard = this.file.bindableArtboardByName(name);\n return this.createBindableArtboard(nativeArtboard);\n }\n\n public getDefaultBindableArtboard(): BindableArtboard | null {\n const nativeArtboard = this.file.bindableArtboardDefault();\n return this.createBindableArtboard(nativeArtboard);\n }\n\n public internalBindableArtboardFromArtboard(\n artboard: rc.Artboard,\n ): BindableArtboard | null {\n const nativeBindableArtboard =\n this.file.internalBindableArtboardFromArtboard(artboard);\n return this.createBindableArtboard(nativeBindableArtboard);\n }\n\n public viewModelByName(name: string): ViewModel | null {\n const viewModel = this.file.viewModelByName(name);\n if (viewModel !== null) {\n return new ViewModel(viewModel);\n }\n return null;\n }\n\n /**\n * @returns the names of the file's global view models, in file order.\n */\n public globalViewModelNames(): string[] {\n return this.file.globalViewModelNames();\n }\n}\n\nexport class Rive {\n // Canvas in which to render the artboard\n private readonly canvas: HTMLCanvasElement | OffscreenCanvas;\n\n // A url to a Rive file; may be undefined if a buffer is specified\n private src: string;\n\n // Raw Rive file data; may be undefined if a src is specified\n private buffer: ArrayBuffer;\n\n // The layout for rendering in the canvas\n private _layout: Layout;\n\n // The runtime renderer\n private renderer: rc.WrappedRenderer;\n\n // Tracks if a Rive file is loaded\n private loaded = false;\n\n // Tracks if a Rive file is destroyed\n private destroyed = false;\n\n // Reference of an object that handles any observers for the animation\n private _observed: ObservedObject | null = null;\n\n /**\n * Tracks if a Rive file is loaded; we need this in addition to loaded as some\n * commands (e.g. contents) can be called as soon as the file is loaded.\n * However, playback commands need to be queued and run in order once initial\n * animations and autoplay has been sorted out. This applies to play, pause,\n * and start.\n */\n private readyForPlaying = false;\n\n // Wasm runtime\n private runtime: rc.RiveCanvas;\n\n // Runtime artboard\n private artboard: rc.Artboard | null = null;\n\n // place to clear up pointer/touch event listeners\n private eventCleanup: VoidCallback | null = null;\n\n // Manages keyboard and DOM-focus interactions for the canvas.\n private _keyboardInteractions: KeyboardInteractions | null = null;\n\n // Runtime file\n private file: rc.File;\n\n // Rive file instance\n private riveFile: RiveFile;\n\n // Holds event listeners\n private eventManager: EventManager;\n\n // Manages the loading task queue\n private taskQueue: TaskQueueManager;\n\n // Animator: manages animations and state machines\n private animator: Animator;\n\n // AssetLoadCallback: allows customizing asset loading for images and fonts.\n private assetLoader: AssetLoadCallback;\n\n // Error message for missing source or buffer\n private static readonly missingErrorMessage: string =\n \"Rive source file or data buffer required\";\n\n // Error message for removed rive file\n private static readonly cleanupErrorMessage: string =\n \"Attempt to use file after calling cleanup.\";\n\n private shouldDisableRiveListeners = false;\n\n private automaticallyHandleEvents = false;\n\n private dispatchPointerExit = true;\n\n // Allow all pointers to be passed to the runtime\n private enableMultiTouch = false;\n\n // Allow the runtime to automatically load assets hosted in Rive's runtime.\n private enableRiveAssetCDN = true;\n\n private semanticsMode: SemanticMode = SemanticMode.Disabled;\n\n private semanticsOptions: RiveSemanticsOptions = {\n riveCanvasLabel: \"Rive animation\",\n };\n\n /** True when this instance may drain semantics and render the overlay. */\n private _semanticsActive = false;\n\n // Keep a local value of the set volume to update it asynchronously\n private _volume = 1;\n\n // Keep a local value of the set width to update it asynchronously\n private _artboardWidth: number | undefined = undefined;\n\n // Keep a local value of the set height to update it asynchronously\n private _artboardHeight: number | undefined = undefined;\n\n // Keep a local value of the device pixel ratio used in rendering and canvas/artboard resizing\n private _devicePixelRatioUsed = 1;\n\n // Whether the canvas element's size is 0\n private _hasZeroSize = false;\n\n // Whether a draw operation needs to be forced\n private _needsRedraw = false;\n\n // Canvas width and height. Values are lazily updated so they might\n // not be in sync with current canvas size.\n private _currentCanvasWidth = 0;\n private _currentCanvasHeight = 0;\n\n // Audio event listener\n private _audioEventListener: EventListener | null = null;\n\n // draw method bound to the class\n private _boundDraw: (t: number) => void | null = null;\n\n // Page visibility handler — prevents state machine advancing / rAF from being invoked with large time delta\n // when the browser tab is switched back to after being hidden.\n private _pageVisibilityHandler: (() => void) | null = null;\n // True only when the page visibility handler itself cancelled an active frame.\n // Set by stopRendering(), cleared by startRendering(). Prevents the\n // visibilitychange handler from restarting a rendering loop the caller intentionally stopped.\n private _explicitlyStoppedRendering = false;\n\n private _viewModelInstance: ViewModelInstance | null = null;\n // User-provided global view model instances, keyed by their global view\n // model's name. Globals not present here are still driven by the default\n // instances the runtime seeds; the getter only surfaces instances the user\n // has explicitly set.\n private _globalViewModelInstances: Map<string, ViewModelInstance> = new Map();\n private _dataEnums: DataEnum[] | null = null;\n\n private _tabIndex: number | null = null;\n private _prevHasFocus = false;\n private _focusOptions: RiveFocusOptions = {\n allowFocusInterrupt: false,\n };\n\n // Tracks the semantic tree for the given graphic\n private _semanticTree: SemanticTreeModel | null = null;\n private _accessibilityOverlay: AccessibilityOverlay | null = null;\n /**\n * True when an input to the accessibility overlay's artboard→canvas transform\n * (layout fit/alignment/bounds, devicePixelRatio, or layout scale) has changed\n * and the matrix must be recomputed on the next overlay update. Avoids calling\n * computeAlignment every frame when only the semantic tree changed.\n */\n private _overlayTransformDirty = true;\n // Module-level counter for unique instance IDs for semantic overlay containers\n private readonly _instanceId = `${nextRiveInstanceId++}`;\n\n private drawOptimization: DrawOptimizationOptions =\n DrawOptimizationOptions.DrawOnChanged;\n\n // When true, emits performance.mark/measure entries for load and render.\n private enablePerfMarks: boolean = false;\n\n // Durations to generate a frame for the last second. Used for performance profiling.\n public durations: number[] = [];\n public frameTimes: number[] = [];\n public frameCount = 0;\n public isTouchScrollEnabled = false;\n\n constructor(params: RiveParameters) {\n this._boundDraw = this.draw.bind(this);\n if (typeof document !== 'undefined') {\n this._pageVisibilityHandler = this._onPageVisibilityChange.bind(this);\n document.addEventListener('visibilitychange', this._pageVisibilityHandler);\n }\n this.canvas = params.canvas;\n if (params.canvas.constructor === HTMLCanvasElement) {\n this._observed = observers.add(\n this.canvas as HTMLCanvasElement,\n this.onCanvasResize,\n );\n }\n this._currentCanvasWidth = this.canvas.width;\n this._currentCanvasHeight = this.canvas.height;\n this.src = params.src;\n this.buffer = params.buffer;\n this.riveFile = params.riveFile;\n this.layout = params.layout ?? new Layout();\n this.shouldDisableRiveListeners = !!params.shouldDisableRiveListeners;\n this.isTouchScrollEnabled = !!params.isTouchScrollEnabled;\n this.automaticallyHandleEvents = !!params.automaticallyHandleEvents;\n this.dispatchPointerExit =\n params.dispatchPointerExit === false\n ? params.dispatchPointerExit\n : this.dispatchPointerExit;\n this.enableMultiTouch = !!params.enableMultiTouch;\n this.drawOptimization = params.drawingOptions ?? this.drawOptimization;\n this.enableRiveAssetCDN =\n params.enableRiveAssetCDN === undefined\n ? true\n : params.enableRiveAssetCDN;\n this.enablePerfMarks = !!params.enablePerfMarks;\n if (this.enablePerfMarks) RuntimeLoader.enablePerfMarks = true;\n this._focusOptions = params.focusOptions ?? this._focusOptions;\n this._tabIndex = params.tabIndex ?? null;\n\n // New event management system\n this.eventManager = new EventManager();\n if (params.onLoad) this.on(EventType.Load, params.onLoad);\n if (params.onLoadError) this.on(EventType.LoadError, params.onLoadError);\n if (params.onPlay) this.on(EventType.Play, params.onPlay);\n if (params.onPause) this.on(EventType.Pause, params.onPause);\n if (params.onStop) this.on(EventType.Stop, params.onStop);\n if (params.onLoop) this.on(EventType.Loop, params.onLoop);\n if (params.onStateChange)\n this.on(EventType.StateChange, params.onStateChange);\n if (params.onAdvance) this.on(EventType.Advance, params.onAdvance);\n\n /**\n * @deprecated Use camelCase'd versions instead.\n */\n if (params.onload && !params.onLoad) this.on(EventType.Load, params.onload);\n if (params.onloaderror && !params.onLoadError)\n this.on(EventType.LoadError, params.onloaderror);\n if (params.onplay && !params.onPlay) this.on(EventType.Play, params.onplay);\n if (params.onpause && !params.onPause)\n this.on(EventType.Pause, params.onpause);\n if (params.onstop && !params.onStop) this.on(EventType.Stop, params.onstop);\n if (params.onloop && !params.onLoop) this.on(EventType.Loop, params.onloop);\n if (params.onstatechange && !params.onStateChange)\n this.on(EventType.StateChange, params.onstatechange);\n\n /**\n * Asset loading\n */\n if (params.assetLoader) this.assetLoader = params.assetLoader;\n\n // Hook up the task queue\n this.taskQueue = new TaskQueueManager(this.eventManager);\n\n this.init({\n src: this.src,\n buffer: this.buffer,\n riveFile: this.riveFile,\n autoplay: params.autoplay,\n autoBind: params.autoBind,\n animations: params.animations,\n stateMachines: params.stateMachines,\n artboard: params.artboard,\n useOffscreenRenderer: params.useOffscreenRenderer,\n tabIndex: params.tabIndex,\n semanticsMode: params.semanticsMode,\n semanticsOptions: params.semanticsOptions,\n });\n }\n\n public get viewModelCount(): number {\n return this.file.viewModelCount();\n }\n\n // Alternative constructor to build a Rive instance from an interface/object\n public static new(params: RiveParameters): Rive {\n console.warn(\n \"This function is deprecated: please use `new Rive({})` instead\",\n );\n return new Rive(params);\n }\n\n /**\n * @experimental Turns on semantics and the accessibility overlay for this\n * instance. Idempotent; safe to call before or after load. Use this to drive\n * a consumer-controlled accessibility toggle when constructed with the\n * default {@link SemanticMode.Disabled}.\n */\n public enableSemantics(): void {\n this.semanticsMode = SemanticMode.Enabled;\n this.activateSemantics();\n }\n\n private activateSemantics(): void {\n if (this._semanticsActive || this.semanticsMode === SemanticMode.Disabled) {\n return;\n }\n this._semanticsActive = true;\n this.syncSemanticsOnStateMachines();\n }\n\n private syncSemanticsOnStateMachines(): void {\n if (!this._semanticsActive || !this.animator) {\n return;\n }\n for (const stateMachine of this.animator.stateMachines) {\n stateMachine.enableSemantics();\n }\n }\n\n /**\n * Tears down the semantic tree and accessibility overlay. The overlay captures the\n * active state machine in its action closures, so it must not outlive the\n * instances it points at (reset/load delete them)\n */\n private cleanupSemantics(): void {\n this._semanticTree = null;\n if (this._accessibilityOverlay) {\n this._accessibilityOverlay.destroy();\n this._accessibilityOverlay = null;\n }\n }\n\n // Event handler for when audio context becomes available\n private onSystemAudioChanged() {\n this.volume = this._volume;\n }\n\n private onCanvasResize = (hasZeroSize: boolean) => {\n const toggledDisplay = this._hasZeroSize !== hasZeroSize;\n this._hasZeroSize = hasZeroSize;\n if (!hasZeroSize) {\n if (toggledDisplay) {\n this.resizeDrawingSurfaceToCanvas();\n }\n } else if (!this._layout.maxX || !this._layout.maxY) {\n this.resizeToCanvas();\n }\n };\n\n // Initializes the Rive object either from constructor or load()\n private init({\n src,\n buffer,\n riveFile,\n animations,\n stateMachines,\n artboard,\n autoplay = false,\n useOffscreenRenderer = false,\n autoBind = false,\n tabIndex,\n semanticsMode,\n semanticsOptions,\n }: RiveLoadParameters): void {\n if (this.destroyed) {\n return;\n }\n this.src = src;\n this.buffer = buffer;\n this.riveFile = riveFile;\n this._tabIndex = tabIndex ?? null;\n this.semanticsMode = semanticsMode ?? SemanticMode.Disabled;\n this.semanticsOptions = semanticsOptions ?? this.semanticsOptions;\n\n // If no source file url specified, it's a bust\n if (!this.src && !this.buffer && !this.riveFile) {\n throw new RiveError(Rive.missingErrorMessage);\n }\n\n // List of animations that should be initialized.\n const startingAnimationNames = mapToStringArray(animations);\n\n // List of state machines that should be initialized\n const startingStateMachineNames = mapToStringArray(stateMachines);\n\n // Ensure loaded is marked as false if loading new file\n this.loaded = false;\n this.readyForPlaying = false;\n\n // Ensure the runtime is loaded\n RuntimeLoader.awaitInstance()\n .then((runtime) => {\n if (this.destroyed) {\n return;\n }\n this.runtime = runtime;\n\n this.removeRiveListeners();\n // load() reinitializes without cleanupInstances(); drop any stale overlay\n // bound to the previous file's state machines (no-op on first construct).\n this.cleanupSemantics();\n this.deleteRiveRenderer();\n\n // Get the canvas where you want to render the animation and create a renderer\n if (this.enablePerfMarks) performance.mark('rive:make-renderer:start');\n try {\n this.renderer = this.runtime.makeRenderer(\n this.canvas,\n useOffscreenRenderer,\n );\n if (!this.renderer) {\n throw new Error(\"Renderer is null, cannot render Rive on the canvas.\");\n }\n } catch (e) {\n console.error(e);\n throw new RiveError(\"Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.\");\n }\n if (this.enablePerfMarks) {\n performance.mark('rive:make-renderer:end');\n performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');\n }\n\n // Initial size adjustment based on devicePixelRatio if no width/height are\n // specified explicitly\n if (!(this.canvas.width || this.canvas.height)) {\n this.resizeDrawingSurfaceToCanvas();\n }\n\n // Load Rive data from a source uri or a data buffer\n this.initData(\n artboard,\n startingAnimationNames,\n startingStateMachineNames,\n autoplay,\n autoBind,\n )\n .then((hasInitialized: boolean) => {\n if (hasInitialized) {\n return this.setupRiveListeners();\n }\n })\n .catch((e) => {\n // initData already catches RiveErrors for load issues like artboard/state machine initialization\n // failures, so just console error and catch here so we don't double-fire the LoadError event\n console.error(e);\n });\n })\n .catch((e: Error) => { // Catching errors from loading WASM\n this.eventManager.fire({ type: EventType.LoadError, data: e.message });\n });\n }\n\n /**\n * Setup Rive Listeners on the canvas\n * @param riveListenerOptions - Enables TouchEvent events on the canvas. Set to true to allow\n * touch scrolling on the canvas element on touch-enabled devices\n * i.e. { isTouchScrollEnabled: true }\n */\n public setupRiveListeners(\n riveListenerOptions?: SetupRiveListenersOptions,\n ): void {\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n if (!this.shouldDisableRiveListeners) {\n const playingStateMachines = this.animator.stateMachines.filter((sm) => sm.playing);\n const activeStateMachines = playingStateMachines\n .filter((sm) => this.runtime.hasListeners(sm.instance))\n .map((sm) => sm.instance);\n let touchScrollEnabledOption = this.isTouchScrollEnabled;\n let dispatchPointerExit = this.dispatchPointerExit;\n let enableMultiTouch = this.enableMultiTouch;\n if (\n riveListenerOptions &&\n \"isTouchScrollEnabled\" in riveListenerOptions\n ) {\n touchScrollEnabledOption = riveListenerOptions.isTouchScrollEnabled;\n }\n this.eventCleanup = registerTouchInteractions({\n canvas: this.canvas,\n artboard: this.artboard,\n stateMachines: activeStateMachines,\n renderer: this.renderer,\n rive: this.runtime,\n fit: this._layout.runtimeFit(this.runtime),\n alignment: this._layout.runtimeAlignment(this.runtime),\n isTouchScrollEnabled: touchScrollEnabledOption,\n dispatchPointerExit: dispatchPointerExit,\n enableMultiTouch: enableMultiTouch,\n layoutScaleFactor: this._layout.layoutScaleFactor,\n advanceAndDrain: this.advanceAndReportChanges.bind(this)\n });\n\n this.ensureKeyboardInteractions();\n }\n }\n\n /**\n * Wire keyboard interactions when a playing state machine has focus nodes.\n * Called at listener setup and lazily each frame so late-bound bindable artboards work.\n */\n private ensureKeyboardInteractions(): void {\n if (\n this._keyboardInteractions ||\n this.shouldDisableRiveListeners ||\n typeof window === \"undefined\" ||\n !(this.canvas instanceof HTMLCanvasElement)\n ) {\n return;\n }\n\n const smWithFocusNodes = this.animator.stateMachines.find(\n (sm) => sm.playing && sm.hasFocusNodes,\n );\n if (!smWithFocusNodes) {\n return;\n }\n\n const currentCanvasTabIndex = this.canvas.tabIndex;\n if (currentCanvasTabIndex === -1 || isNaN(currentCanvasTabIndex)) {\n this.canvas.tabIndex = (this._tabIndex !== null ? this._tabIndex : 0);\n }\n\n this._keyboardInteractions = new KeyboardInteractions({\n canvas: this.canvas as HTMLCanvasElement,\n stateMachine: smWithFocusNodes.instance, // work off assumption of single state machine\n hasFocusNodes: true,\n getOverlayElement: () =>\n this._accessibilityOverlay?.getSemanticOverlayContainer() ?? null,\n });\n }\n\n private cleanupKeyboardInteractions(): void {\n if (this._keyboardInteractions) {\n this._keyboardInteractions.cleanup();\n this._keyboardInteractions = null;\n }\n }\n\n /**\n * Remove Rive Listeners setup on the canvas\n */\n public removeRiveListeners(): void {\n if (this.eventCleanup) {\n this.eventCleanup();\n this.eventCleanup = null;\n }\n this.cleanupKeyboardInteractions();\n }\n\n /**\n * If the instance has audio and the system audio is not ready\n * we hook the instance to the audio manager\n */\n private initializeAudio() {\n // Initialize audio if needed\n if (audioManager.status == SystemAudioStatus.UNAVAILABLE) {\n if (\n this.file.hasAudio ||\n (this.artboard?.hasAudio && this._audioEventListener === null)\n ) {\n this._audioEventListener = {\n type: EventType.AudioStatusChange,\n callback: () => this.onSystemAudioChanged(),\n };\n audioManager.add(this._audioEventListener);\n audioManager.establishAudio();\n }\n }\n }\n\n private initArtboardSize() {\n if (!this.artboard) return;\n\n // Use preset values if they are not undefined\n this._artboardWidth = this.artboard.width =\n this._artboardWidth || this.artboard.width;\n this._artboardHeight = this.artboard.height =\n this._artboardHeight || this.artboard.height;\n }\n\n // Initializes runtime with Rive data and preps for playing.\n // Returns true for successful initialization.\n private async initData(\n artboardName: string,\n animationNames: string[],\n stateMachineNames: string[],\n autoplay: boolean,\n autoBind: boolean,\n ): Promise<boolean> {\n try {\n if (this.riveFile == null) {\n const riveFile = new RiveFile({\n src: this.src,\n buffer: this.buffer,\n enableRiveAssetCDN: this.enableRiveAssetCDN,\n assetLoader: this.assetLoader,\n enablePerfMarks: this.enablePerfMarks,\n });\n this.riveFile = riveFile;\n await riveFile.init();\n if (this.destroyed) {\n // In the very unlikely scenario where the rive file created by this Rive is shared by\n // another rive file, we only want to destroy it if this file is the only owner.\n riveFile.destroyIfUnused();\n return false;\n }\n }\n this.file = this.riveFile.getInstance();\n // Initialize and draw frame\n this.initArtboard(\n artboardName,\n animationNames,\n stateMachineNames,\n autoplay,\n autoBind,\n );\n\n // Initialize the artboard size\n this.initArtboardSize();\n\n // Check for audio\n this.initializeAudio();\n\n if (this.semanticsMode === SemanticMode.Enabled) {\n this.activateSemantics();\n } else if (this._semanticsActive) {\n this.syncSemanticsOnStateMachines();\n }\n\n // Everything's set up, emit a load event\n try {\n this.loaded = true;\n this.eventManager.fire({\n type: EventType.Load,\n data: this.src ?? \"buffer\",\n });\n } catch (e) {\n // If any synchronous errors surface from the user-supplied onLoad callback,\n // this will console.error the error but will not invoke LoadError (onLoadError).\n // Notably, this will not interfere with Rive rendering\n console.error(e);\n }\n\n // Only initialize paused state machines after the load event has been fired\n // to allow users to initialize inputs and view models before the first advance\n this.animator.advanceIfPaused();\n\n // Flag ready for playback commands and clear the task queue; this order\n // is important or it may infinitely recurse\n this.readyForPlaying = true;\n this.taskQueue.process();\n\n this.drawFrame();\n\n return true;\n } catch (error) {\n // Invoke LoadError for errors with loading the configured Artboard + State Machine\n const msg = resolveErrorMessage(error);\n this.eventManager.fire({ type: EventType.LoadError, data: msg });\n return Promise.reject(msg);\n }\n }\n\n // Initialize for playback\n private initArtboard(\n artboardName: string,\n animationNames: string[],\n stateMachineNames: string[],\n autoplay: boolean,\n autoBind: boolean,\n ): void {\n if (!this.file) {\n return;\n }\n // Fetch the artboard\n const rootArtboard = artboardName\n ? this.file.artboardByName(artboardName)\n : this.file.defaultArtboard();\n\n // Check we have a working artboard\n if (!rootArtboard) {\n throw new RiveError(\"Invalid artboard name or no default artboard\");\n }\n\n this.artboard = rootArtboard;\n rootArtboard.volume = this._volume * audioManager.systemVolume;\n\n // Initialize the animator\n this.animator = new Animator(\n this.runtime,\n this.artboard,\n this.eventManager,\n );\n\n // Initialize the animations; as loaded hasn't happened yet, we need to\n // suppress firing the play/pause events until the load event has fired. To\n // do this we tell the animator to suppress firing events, and add event\n // firing to the task queue.\n let instanceNames: string[];\n if (animationNames.length > 0 || stateMachineNames.length > 0) {\n instanceNames = animationNames.concat(stateMachineNames);\n this.animator.initLinearAnimations(animationNames, autoplay);\n this.animator.initStateMachines(stateMachineNames, autoplay, this._semanticsActive);\n } else {\n instanceNames = [this.animator.atLeastOne(autoplay, false, this._semanticsActive)];\n }\n // Queue up firing the playback events\n this.taskQueue.add({\n event: {\n type: autoplay ? EventType.Play : EventType.Pause,\n data: instanceNames,\n },\n });\n\n if (autoBind) {\n // Set the main view model instance (if the artboard has one)...\n const viewModel = this.file.defaultArtboardViewModel(rootArtboard);\n if (viewModel !== null) {\n const runtimeInstance = viewModel.defaultInstance();\n if (runtimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(\n runtimeInstance,\n null,\n );\n createFinalization(\n viewModelInstance,\n viewModelInstance.runtimeInstance,\n );\n this.setViewModelInstance(viewModelInstance);\n }\n }\n // ...and a default instance for each global view model (no longer\n // auto-created by the runtime), then apply everything in one rebind.\n for (const name of this.file.globalViewModelNames()) {\n const globalViewModel = this.file.viewModelByName(name);\n if (globalViewModel !== null) {\n const instance = new ViewModel(globalViewModel).defaultInstance();\n if (instance !== null) {\n this.setGlobalViewModelInstance(name, instance);\n }\n }\n }\n this.bind();\n }\n }\n\n // Draws the current artboard frame\n public drawFrame() {\n if (document?.timeline?.currentTime) {\n if (this.loaded && this.artboard && !this.frameRequestId) {\n this._boundDraw(document!.timeline!.currentTime as number);\n this.runtime?.resolveAnimationFrame();\n }\n } else {\n this.scheduleRendering();\n }\n }\n\n private _canvasSizeChanged(): boolean {\n let changed = false;\n if (this.canvas) {\n if (this.canvas.width !== this._currentCanvasWidth) {\n this._currentCanvasWidth = this.canvas.width;\n changed = true;\n }\n if (this.canvas.height !== this._currentCanvasHeight) {\n this._currentCanvasHeight = this.canvas.height;\n changed = true;\n }\n }\n return changed;\n }\n\n /**\n * Poll focus state each frame to see if we should focus/blur the canvas in case\n * Rive internally updated focus outside of user interaction (e.g., via listener action)\n */\n private pollFocusState() {\n this.ensureKeyboardInteractions();\n if (!this._keyboardInteractions) {\n this._prevHasFocus = false;\n return;\n }\n\n const activeSm = this.animator.stateMachines.find(\n (sm) => sm.playing && sm.hasFocusNodes,\n ); // work off assumption of single state machine\n if (!activeSm) {\n this._prevHasFocus = false;\n return;\n }\n\n if (this.canvas instanceof HTMLCanvasElement) {\n const { hasFocus } = activeSm.focusState();\n if (hasFocus) {\n // Rive has an active focus node. Mark the session RiveFocused so Tab stays\n // trapped and a later internal release (hasFocus true → false) is detected.\n this._keyboardInteractions.notifyRiveFocused();\n // Only steal DOM focus on the false→true transition. If hasFocus stays\n // true across frames and the user clicks away, do not re-focus the canvas again.\n if (!this._prevHasFocus) {\n // Steal DOM focus to the canvas only when focus isn't already held\n // somewhere inside this instance's focus scope. When the accessibility\n // overlay has driven focus onto a specific semantic node element (e.g.\n // an appearing alert dialog), focus is already in-scope. The steal\n // stays a fallback for runtime focus nodes that have no overlay element\n // to hold DOM focus.\n const scope = this._accessibilityOverlay?.getSemanticOverlayContainer();\n const focusAlreadyInScope =\n document.activeElement === this.canvas ||\n (scope?.contains(document.activeElement) ?? false);\n if (!focusAlreadyInScope && this._focusOptions.allowFocusInterrupt) {\n this.canvas.focus();\n }\n this._prevHasFocus = true;\n }\n return;\n }\n\n this._prevHasFocus = false;\n\n // hasFocus is false — only act when Rive previously held focus and released it internally\n // (state change clears focus). Release the DOM Tab trap so the next Tab moves to the next\n // page element. EntryPending and NotFocused cases are intentional no-ops — EntryPending in\n // particular must stay in its state (a click awaiting its first Tab) rather than be reset here.\n if (this._keyboardInteractions.focusSessionState === FocusSessionState.RiveFocused) {\n this._keyboardInteractions.setFocusSessionState(FocusSessionState.NotFocused);\n }\n }\n }\n\n // Tracks the last timestamp at which the animation was rendered. Used only in\n // draw().\n private lastRenderTime: number;\n\n // Tracks the current animation frame request\n private frameRequestId: number | null = null;\n\n /**\n * Used be draw to track when a second of active rendering time has passed.\n * Used for debugging purposes\n */\n private renderSecondTimer = 0;\n\n /**\n * Handles important sequence of reporting Rive events, advancing the state machine or animation, and invoking various callbacks\n * due to state changes, view model property changes, etc.\n * \n * @param elapsedTime time to advance the state machine by\n */\n private advanceAndReportChanges(elapsedTime: number): void {\n // - Advance non-paused animations by the elapsed number of seconds\n // - Advance any animations that require scrubbing\n // - Advance to the first frame even when autoplay is false\n const activeAnimations = this.animator.animations\n .filter((a) => a.playing || a.needsScrub)\n // The scrubbed animations must be applied first to prevent weird artifacts\n // if the playing animations conflict with the scrubbed animating attribuates.\n .sort((first) => (first.needsScrub ? -1 : 1));\n for (const animation of activeAnimations) {\n animation.advance(elapsedTime);\n if (animation.instance.didLoop) {\n animation.loopCount += 1;\n }\n animation.apply(1.0);\n }\n\n // - Advance non-paused state machines by the elapsed number of seconds\n // - Advance to the first frame even when autoplay is false\n const activeStateMachines = this.animator.stateMachines.filter(\n (a) => a.playing,\n );\n // Instrument the first 3 frames so the Performance timeline shows precise\n // per-call latency for advance, draw, and flush without polluting the trace.\n const _perfFrame =\n this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;\n for (const stateMachine of activeStateMachines) {\n // Check for events before the current frame's state machine advance\n const numEventsReported = stateMachine.reportedEventCount();\n if (numEventsReported) {\n for (let i = 0; i < numEventsReported; i++) {\n const event = stateMachine.reportedEventAt(i);\n\n if (event) {\n if (event.type === RiveEventType.OpenUrl) {\n this.eventManager.fire({\n type: EventType.RiveEvent,\n data: event as rc.OpenUrlEvent,\n });\n // Handle the event side effect if explicitly enabled\n if (this.automaticallyHandleEvents) {\n const newAnchorTag = document.createElement(\"a\");\n const { url, target } = event as rc.OpenUrlEvent;\n\n const sanitizedUrl = sanitizeUrl(url);\n url && newAnchorTag.setAttribute(\"href\", sanitizedUrl);\n target && newAnchorTag.setAttribute(\"target\", target);\n if (sanitizedUrl && sanitizedUrl !== BLANK_URL) {\n newAnchorTag.click();\n }\n }\n } else {\n this.eventManager.fire({\n type: EventType.RiveEvent,\n data: event as rc.RiveEvent,\n });\n }\n }\n }\n }\n if (_perfFrame >= 0) performance.mark(`rive:sm-advance:start:f${_perfFrame}`);\n stateMachine.advanceAndApply(elapsedTime);\n if (_perfFrame >= 0) {\n performance.mark(`rive:sm-advance:end:f${_perfFrame}`);\n performance.measure(`rive:sm-advance:f${_perfFrame}`, `rive:sm-advance:start:f${_perfFrame}`, `rive:sm-advance:end:f${_perfFrame}`);\n }\n\n if (this._semanticsActive) {\n const diff = stateMachine.drainSemanticsDiff();\n if (diff) {\n if (!this._semanticTree) {\n this._semanticTree = new SemanticTreeModel();\n }\n this._semanticTree.applyDiff(diff);\n }\n }\n }\n\n // Update the accessibility overlay after all state machines have\n // been advanced and their diffs applied to the tree model.\n if (\n this._semanticsActive &&\n this._semanticTree &&\n activeStateMachines.length > 0 &&\n this.canvas instanceof HTMLCanvasElement\n ) {\n if (!this._accessibilityOverlay) {\n const mainSm = activeStateMachines[0];\n this._accessibilityOverlay = new AccessibilityOverlay({\n canvas: this.canvas,\n instanceId: this._instanceId,\n semanticsOptions: this.semanticsOptions,\n allowFocusInterrupt: this._focusOptions.allowFocusInterrupt,\n fireAction: (nodeId, actionType) => {\n mainSm.fireSemanticAction(nodeId, actionType);\n },\n requestFocus: (nodeId) =>\n mainSm.focusSemanticNode(nodeId),\n clearFocus: () =>\n mainSm.instance.clearFocus(),\n });\n }\n const overlayChange = this._accessibilityOverlay?.needsUpdate(this._semanticTree);\n if (overlayChange || this._overlayTransformDirty) {\n // Only recompute the artboard→canvas transform when something that\n // affects it changed (canvas geometry or a layout/dpr input). When only\n // the semantic tree changed we pass null and reuse the existing CSS\n // transform on the overlay container.\n let forwardMat: rc.Mat2D | null = null;\n if (overlayChange?.layoutChanged || this._overlayTransformDirty) {\n const fit = this._layout.runtimeFit(this.runtime);\n const alignment = this._layout.runtimeAlignment(this.runtime);\n forwardMat = this.runtime.computeAlignment(\n fit,\n alignment,\n {\n minX: this._layout.minX,\n minY: this._layout.minY,\n maxX: this._layout.maxX,\n maxY: this._layout.maxY,\n },\n this.artboard.bounds,\n this._devicePixelRatioUsed * this._layout.layoutScaleFactor,\n );\n this._overlayTransformDirty = false;\n }\n this._accessibilityOverlay!.update(\n this._semanticTree,\n forwardMat,\n this._devicePixelRatioUsed,\n this.artboard.bounds,\n overlayChange,\n );\n forwardMat?.delete();\n }\n }\n\n // For linear animations that have been applied to the artboard, advance it\n // by the elapsed time.\n if (this.animator.stateMachines.length == 0) {\n this.artboard.advance(elapsedTime);\n }\n\n // Check for any animations that looped\n this.animator.handleLooping();\n\n // Check for any state machines that had a state change\n this.animator.handleStateChanges();\n\n // Report advanced time\n this.animator.handleAdvancing(elapsedTime);\n\n // Poll focus state to see whether or not to blur or pull up a virtual keyboard for any change to a text input node.\n this.pollFocusState();\n\n // Handle callbacks for view model property changes\n this._viewModelInstance?.handleCallbacks();\n }\n\n /**\n * Draw rendering loop; renders animation frames at the correct time interval.\n * @param time the time at which to render a frame\n */\n private draw(time: number, onSecond?: VoidCallback): void {\n // Clear the frameRequestId, as we're now rendering a fresh frame\n this.frameRequestId = null;\n const before = performance.now();\n\n // Instrument the first 3 frames so the Performance timeline shows precise\n // per-call latency for advance, draw, and flush without polluting the trace.\n const _perfFrame =\n this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;\n\n // On the first pass, make sure lastTime has a valid value\n if (!this.lastRenderTime) {\n this.lastRenderTime = time;\n }\n\n // Handle the onSecond callback\n this.renderSecondTimer += time - this.lastRenderTime;\n if (this.renderSecondTimer > 5000) {\n this.renderSecondTimer = 0;\n onSecond?.();\n }\n\n // Calculate the elapsed time between frames in seconds\n const elapsedTime = (time - this.lastRenderTime) / 1000;\n this.lastRenderTime = time;\n\n this.advanceAndReportChanges(elapsedTime);\n\n const { renderer } = this;\n // Do not draw on 0 canvas size\n if (!this._hasZeroSize) {\n // If there was no dirt on this frame, do not clear and draw\n if (\n this.drawOptimization == DrawOptimizationOptions.AlwaysDraw ||\n this.artboard.didChange() ||\n this._needsRedraw ||\n this._canvasSizeChanged()\n ) {\n // Canvas must be wiped to prevent artifacts\n renderer.clear();\n renderer.save();\n\n // Update the renderer alignment if necessary\n if (_perfFrame >= 0) performance.mark(`rive:align-renderer:start:f${_perfFrame}`);\n this.alignRenderer();\n if (_perfFrame >= 0) {\n performance.mark(`rive:align-renderer:end:f${_perfFrame}`);\n performance.measure(`rive:align-renderer:f${_perfFrame}`, `rive:align-renderer:start:f${_perfFrame}`, `rive:align-renderer:end:f${_perfFrame}`);\n }\n\n if (_perfFrame >= 0) performance.mark(`rive:artboard-draw:start:f${_perfFrame}`);\n this.artboard.draw(renderer);\n if (_perfFrame >= 0) {\n performance.mark(`rive:artboard-draw:end:f${_perfFrame}`);\n performance.measure(`rive:artboard-draw:f${_perfFrame}`, `rive:artboard-draw:start:f${_perfFrame}`, `rive:artboard-draw:end:f${_perfFrame}`);\n }\n\n renderer.restore();\n\n if (_perfFrame >= 0) performance.mark(`rive:renderer-flush:start:f${_perfFrame}`);\n renderer.flush();\n if (_perfFrame >= 0) {\n performance.mark(`rive:renderer-flush:end:f${_perfFrame}`);\n performance.measure(`rive:renderer-flush:f${_perfFrame}`, `rive:renderer-flush:start:f${_perfFrame}`, `rive:renderer-flush:end:f${_perfFrame}`);\n }\n\n this._needsRedraw = false;\n }\n }\n\n // Add duration to create frame to durations array\n this.frameCount++;\n const after = performance.now();\n this.frameTimes.push(after);\n this.durations.push(after - before);\n while (this.frameTimes[0] <= after - 1000) {\n this.frameTimes.shift();\n this.durations.shift();\n }\n\n // Calling requestAnimationFrame will rerun draw() at the correct rate:\n // https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations\n if (this.animator.isPlaying) {\n // Request a new rendering frame\n this.scheduleRendering();\n } else if (this.animator.isPaused) {\n // Reset the end time so on playback it starts at the correct frame\n this.lastRenderTime = 0;\n } else if (this.animator.isStopped) {\n // Reset animation instances, artboard and time\n // TODO: implement this properly when we have instancing\n // this.initArtboard();\n // this.drawFrame();\n this.lastRenderTime = 0;\n }\n }\n\n /**\n * Align the renderer\n */\n private alignRenderer(): void {\n const { renderer, runtime, _layout, artboard } = this;\n // Align things up safe in the knowledge we can restore if changed\n renderer.align(\n _layout.runtimeFit(runtime),\n _layout.runtimeAlignment(runtime),\n {\n minX: _layout.minX,\n minY: _layout.minY,\n maxX: _layout.maxX,\n maxY: _layout.maxY,\n },\n artboard.bounds,\n this._devicePixelRatioUsed * _layout.layoutScaleFactor,\n );\n }\n\n public get fps() {\n return this.durations.length;\n }\n\n public get frameTime() {\n if (this.durations.length === 0) {\n return 0;\n }\n return (\n this.durations.reduce((a, b) => a + b, 0) / this.durations.length\n ).toFixed(4);\n }\n\n /**\n * Cleans up all Wasm-generated objects that need to be manually destroyed:\n * artboard instances, animation instances, state machine instances,\n * renderer instance, file and runtime.\n *\n * Once this is called, you will need to initialise a new instance of the\n * Rive class\n */\n public cleanup() {\n this.destroyed = true;\n // Stop the renderer if it hasn't already been stopped.\n this.stopRendering();\n // Make the GL context backing this renderer current before any WASM teardown\n // that frees GPU resources. Binding here covers the artboard/file deletes;\n // deleteRiveRenderer() re-binds for the renderer's own delete. No-op on the\n // canvas2d build\n this.renderer?.bindContext?.();\n // Clean up any artboard, animation or state machine instances.\n this.cleanupInstances();\n // Remove from observer\n if (this._observed !== null) {\n observers.remove(this._observed);\n }\n this.removeRiveListeners();\n if (this.file) {\n this.riveFile?.cleanup();\n this.file = null;\n }\n this.riveFile = null;\n this.deleteRiveRenderer();\n if (this._audioEventListener !== null) {\n audioManager.remove(this._audioEventListener);\n this._audioEventListener = null;\n }\n if (this._pageVisibilityHandler) {\n document.removeEventListener('visibilitychange', this._pageVisibilityHandler);\n this._pageVisibilityHandler = null;\n }\n this._viewModelInstance?.cleanup();\n this._viewModelInstance = null;\n this._globalViewModelInstances.forEach((instance) => instance.cleanup());\n this._globalViewModelInstances.clear();\n this._dataEnums = null;\n }\n\n /**\n * Cleans up the Renderer object. Only call this API if you no longer\n * need to render Rive content in your session.\n */\n public deleteRiveRenderer() {\n this.renderer?.delete();\n this.renderer = null;\n }\n\n /**\n * Cleans up any Wasm-generated objects that need to be manually destroyed:\n * artboard instances, animation instances, state machine instances.\n *\n * Once this is called, things will need to be reinitialized or bad things\n * might happen.\n */\n public cleanupInstances() {\n if (this.eventCleanup !== null) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n // Tear down semantics before deleting state machines — the overlay's action\n // closures point at instances that stop() is about to free.\n this.cleanupSemantics();\n // Delete all animation and state machine instances\n this.stop();\n if (this.artboard) {\n this.artboard.delete();\n this.artboard = null;\n }\n }\n\n /**\n * Tries to query the setup Artboard for a text run node with the given name.\n *\n * @param textRunName - Name of the text run node associated with a text object\n * @returns - TextValueRun node or undefined if the text run cannot be queried\n */\n private retrieveTextRun(textRunName: string): rc.TextValueRun | undefined {\n if (!textRunName) {\n console.warn(\"No text run name provided\");\n return;\n }\n if (!this.artboard) {\n console.warn(\"Tried to access text run, but the Artboard is null\");\n return;\n }\n const textRun: rc.TextValueRun = this.artboard.textRun(textRunName);\n if (!textRun) {\n console.warn(\n `Could not access a text run with name '${textRunName}' in the '${this.artboard?.name}' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime.`,\n );\n return;\n }\n return textRun;\n }\n\n /**\n * Returns a string from a given text run node name, or undefined if the text run\n * cannot be queried.\n *\n * @param textRunName - Name of the text run node associated with a text object\n * @returns - String value of the text run node or undefined\n */\n public getTextRunValue(textRunName: string): string | undefined {\n const textRun = this.retrieveTextRun(textRunName);\n return textRun ? textRun.text : undefined;\n }\n\n /**\n * Sets a text value for a given text run node name if possible\n *\n * @param textRunName - Name of the text run node associated with a text object\n * @param textRunValue - String value to set on the text run node\n */\n public setTextRunValue(textRunName: string, textRunValue: string): void {\n const textRun = this.retrieveTextRun(textRunName);\n if (textRun) {\n textRun.text = textRunValue;\n }\n }\n\n // Plays specified animations; if none specified, it unpauses everything.\n public play(animationNames?: string | string[], autoplay?: true): void {\n animationNames = mapToStringArray(animationNames);\n\n // If the file's not loaded, queue up the play\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.play(animationNames, autoplay),\n });\n return;\n }\n this.animator.play(animationNames);\n this.syncSemanticsOnStateMachines();\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n this.setupRiveListeners();\n this.startRendering();\n }\n\n // Pauses specified animations; if none specified, pauses all.\n public pause(animationNames?: string | string[]): void {\n animationNames = mapToStringArray(animationNames);\n\n // If the file's not loaded, early out, nothing to pause\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.pause(animationNames),\n });\n return;\n }\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n this.animator.pause(animationNames);\n }\n\n public scrub(animationNames?: string | string[], value?: number): void {\n animationNames = mapToStringArray(animationNames);\n\n // If the file's not loaded, early out, nothing to pause\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.scrub(animationNames, value),\n });\n return;\n }\n\n // Scrub the animation time; we draw a single frame here so that if\n // nothing's currently playing, the scrubbed animation is still rendered/\n this.animator.scrub(animationNames, value || 0);\n this.drawFrame();\n }\n\n // Stops specified animations; if none specifies, stops them all.\n public stop(animationNames?: string | string[] | undefined): void {\n animationNames = mapToStringArray(animationNames);\n // If the file's not loaded, early out, nothing to pause\n if (!this.readyForPlaying) {\n this.taskQueue.add({\n action: () => this.stop(animationNames),\n });\n return;\n }\n // If there is no artboard, this.animator will be undefined\n if (this.animator) {\n this.animator.stop(animationNames);\n }\n if (this.eventCleanup) {\n this.eventCleanup();\n }\n this.cleanupKeyboardInteractions();\n this.cleanupSemantics();\n }\n\n /**\n * Resets the animation\n * @param artboard the name of the artboard, or default if none given\n * @param animations the names of animations for playback\n * @param stateMachines the names of state machines for playback\n * @param autoplay whether to autoplay when reset, defaults to false\n *\n */\n public reset(params?: RiveResetParameters): void {\n // Get the current artboard, animations, state machines, and playback states\n const artBoardName = params?.artboard;\n const animationNames = mapToStringArray(params?.animations);\n const stateMachineNames = mapToStringArray(params?.stateMachines);\n const autoplay = params?.autoplay ?? false;\n const autoBind = params?.autoBind ?? false;\n\n // Stop everything and clean up\n this.cleanupInstances();\n\n // Reinitialize an artboard instance with the state\n this.initArtboard(\n artBoardName,\n animationNames,\n stateMachineNames,\n autoplay,\n autoBind,\n );\n this.taskQueue.process();\n }\n\n // Loads a new Rive file, keeping listeners in place\n public load(params: RiveLoadParameters): void {\n this.file = null;\n // Stop all animations\n this.stop();\n // Reinitialize\n this.init(params);\n }\n\n // Sets a new layout\n public set layout(layout: Layout) {\n this._layout = layout;\n // Fit/alignment/bounds feed the overlay transform.\n this._overlayTransformDirty = true;\n // If the maxX or maxY are 0, then set them to the canvas width and height\n if (!layout.maxX || !layout.maxY) {\n this.resizeToCanvas();\n }\n if (this.loaded && !this.animator.isPlaying) {\n this.drawFrame();\n }\n }\n\n /**\n * Returns the current layout. Note that layout should be treated as\n * immutable. If you want to change the layout, create a new one use the\n * layout setter\n */\n public get layout() {\n return this._layout;\n }\n\n /**\n * Sets the layout bounds to the current canvas size; this is typically called\n * when the canvas is resized\n */\n public resizeToCanvas() {\n this._layout = this.layout.copyWith({\n minX: 0,\n minY: 0,\n maxX: this.canvas.width,\n maxY: this.canvas.height,\n });\n // Layout bounds feed the overlay transform.\n this._overlayTransformDirty = true;\n }\n\n /**\n * Accounts for devicePixelRatio as a multiplier to render the size of the canvas drawing surface.\n * Uses the size of the backing canvas to set new width/height attributes. Need to re-render\n * and resize the layout to match the new drawing surface afterwards.\n * Useful function for consumers to include in a window resize listener.\n *\n * This method will set the {@link devicePixelRatioUsed} property.\n *\n * Optionally, you can provide a {@link customDevicePixelRatio} to provide a\n * custom value.\n */\n public resizeDrawingSurfaceToCanvas(customDevicePixelRatio?: number) {\n if (this.canvas instanceof HTMLCanvasElement && !!window) {\n const { width, height } = this.canvas.getBoundingClientRect();\n const dpr = customDevicePixelRatio || window.devicePixelRatio || 1;\n this.devicePixelRatioUsed = dpr;\n this.canvas.width = dpr * width;\n this.canvas.height = dpr * height;\n this._needsRedraw = true;\n this.resizeToCanvas();\n\n if (this.layout.fit === Fit.Layout) {\n const scaleFactor = this._layout.layoutScaleFactor;\n this.artboard.width = width / scaleFactor;\n this.artboard.height = height / scaleFactor;\n }\n\n this.drawFrame();\n }\n }\n\n // Returns the animation source, which may be undefined\n public get source(): string {\n return this.src;\n }\n\n /**\n * Returns the name of the active artboard\n */\n public get activeArtboard(): string {\n return this.artboard ? this.artboard.name : \"\";\n }\n\n /**\n * Returns the semantic tree model when semantics are enabled, or null.\n * The overlay and external consumers use this to inspect the\n * current state of the semantic tree.\n */\n public get semanticTree(): SemanticTreeModel | null {\n return this._semanticTree;\n }\n\n /**\n * Returns the accessibility overlay when semantics are enabled, or null.\n * External consumers can use this to inspect the\n * current state of the accessibility overlay for this instance.\n */\n public get accessibilityOverlay(): AccessibilityOverlay | null {\n return this._accessibilityOverlay;\n }\n\n // Returns a list of animation names on the chosen artboard\n public get animationNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded || !this.artboard) {\n return [];\n }\n const animationNames: string[] = [];\n for (let i = 0; i < this.artboard.animationCount(); i++) {\n animationNames.push(this.artboard.animationByIndex(i).name);\n }\n return animationNames;\n }\n\n /**\n * Returns a list of state machine names from the current artboard\n */\n public get stateMachineNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded || !this.artboard) {\n return [];\n }\n const stateMachineNames: string[] = [];\n for (let i = 0; i < this.artboard.stateMachineCount(); i++) {\n stateMachineNames.push(this.artboard.stateMachineByIndex(i).name);\n }\n return stateMachineNames;\n }\n\n /**\n * Returns the inputs for the specified instanced state machine, or an empty\n * list if the name is invalid or the state machine is not instanced\n * @param name the state machine name\n * @returns the inputs for the named state machine\n */\n public stateMachineInputs(name: string): StateMachineInput[] {\n // If the file's not loaded, early out, nothing to pause\n if (!this.loaded) {\n return;\n }\n const stateMachine = this.animator.stateMachines.find(\n (m) => m.name === name,\n );\n return stateMachine?.inputs;\n }\n\n // Returns the input with the provided name at the given path\n private retrieveInputAtPath(\n name: string,\n path: string,\n ): rc.SMIInput | undefined {\n if (!name) {\n console.warn(`No input name provided for path '${path}'`);\n return;\n }\n if (!this.artboard) {\n console.warn(\n `Tried to access input: '${name}', at path: '${path}', but the Artboard is null`,\n );\n return;\n }\n const input: rc.SMIInput = this.artboard.inputByPath(name, path);\n\n if (!input) {\n console.warn(\n `Could not access an input with name: '${name}', at path:'${path}'`,\n );\n return;\n }\n return input;\n }\n\n /**\n * Set the boolean input with the provided name at the given path with value\n * @param input the state machine input name\n * @param value the value to set the input to\n * @param path the path the input is located at an artboard level\n */\n public setBooleanStateAtPath(\n inputName: string,\n value: boolean,\n path: string,\n ) {\n const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n if (!input) return;\n\n if (input.type === StateMachineInputType.Boolean) {\n input.asBool().value = value;\n } else {\n console.warn(\n `Input with name: '${inputName}', at path:'${path}' is not a boolean`,\n );\n }\n }\n\n /**\n * Set the number input with the provided name at the given path with value\n * @param input the state machine input name\n * @param value the value to set the input to\n * @param path the path the input is located at an artboard level\n */\n public setNumberStateAtPath(inputName: string, value: number, path: string) {\n const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n if (!input) return;\n\n if (input.type === StateMachineInputType.Number) {\n input.asNumber().value = value;\n } else {\n console.warn(\n `Input with name: '${inputName}', at path:'${path}' is not a number`,\n );\n }\n }\n\n /**\n * Fire the trigger with the provided name at the given path\n * @param input the state machine input name\n * @param path the path the input is located at an artboard level\n */\n public fireStateAtPath(inputName: string, path: string) {\n const input: rc.SMIInput = this.retrieveInputAtPath(inputName, path);\n if (!input) return;\n\n if (input.type === StateMachineInputType.Trigger) {\n input.asTrigger().fire();\n } else {\n console.warn(\n `Input with name: '${inputName}', at path:'${path}' is not a trigger`,\n );\n }\n }\n\n // Returns the TextValueRun object for the provided name at the given path\n private retrieveTextAtPath(\n name: string,\n path: string,\n ): rc.TextValueRun | undefined {\n if (!name) {\n console.warn(`No text name provided for path '${path}'`);\n return;\n }\n if (!path) {\n console.warn(`No path provided for text '${name}'`);\n return;\n }\n if (!this.artboard) {\n console.warn(\n `Tried to access text: '${name}', at path: '${path}', but the Artboard is null`,\n );\n return;\n }\n const text: rc.TextValueRun = this.artboard.textByPath(name, path);\n if (!text) {\n console.warn(\n `Could not access text with name: '${name}', at path:'${path}'`,\n );\n return;\n }\n return text;\n }\n\n /**\n * Retrieves the text value for a specified text run at a given path\n * @param textName The name of the text run\n * @param path The path to the text run within the artboard\n * @returns The text value of the text run, or undefined if not found\n *\n * @example\n * // Get the text value for a text run named \"title\" at one nested artboard deep\n * const titleText = riveInstance.getTextRunValueAtPath(\"title\", \"artboard1\");\n *\n * @example\n * // Get the text value for a text run named \"subtitle\" within a nested group two artboards deep\n * const subtitleText = riveInstance.getTextRunValueAtPath(\"subtitle\", \"group/nestedGroup\");\n *\n * @remarks\n * If the text run cannot be found at the specified path, a warning will be logged to the console.\n */\n public getTextRunValueAtPath(\n textName: string,\n path: string,\n ): string | undefined {\n const run: rc.TextValueRun = this.retrieveTextAtPath(textName, path);\n if (!run) {\n console.warn(\n `Could not get text with name: '${textName}', at path:'${path}'`,\n );\n return;\n }\n return run.text;\n }\n\n /**\n * Sets the text value for a specified text run at a given path\n * @param textName The name of the text run\n * @param value The new text value to set\n * @param path The path to the text run within the artboard\n * @returns void\n *\n * @example\n * // Set the text value for a text run named \"title\" at one nested artboard deep\n * riveInstance.setTextRunValueAtPath(\"title\", \"New Title\", \"artboard1\");\n *\n * @example\n * // Set the text value for a text run named \"subtitle\" within a nested group two artboards deep\n * riveInstance.setTextRunValueAtPath(\"subtitle\", \"New Subtitle\", \"group/nestedGroup\");\n *\n * @remarks\n * If the text run cannot be found at the specified path, a warning will be logged to the console.\n */\n public setTextRunValueAtPath(textName: string, value: string, path: string) {\n const run: rc.TextValueRun = this.retrieveTextAtPath(textName, path);\n if (!run) {\n console.warn(\n `Could not set text with name: '${textName}', at path:'${path}'`,\n );\n return;\n }\n run.text = value;\n }\n\n // Returns a list of playing machine names\n public get playingStateMachineNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.stateMachines\n .filter((m) => m.playing)\n .map((m) => m.name);\n }\n\n // Returns a list of playing animation names\n public get playingAnimationNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.animations.filter((a) => a.playing).map((a) => a.name);\n }\n\n // Returns a list of paused animation names\n public get pausedAnimationNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.animations\n .filter((a) => !a.playing)\n .map((a) => a.name);\n }\n\n /**\n * Returns a list of paused machine names\n * @returns a list of state machine names that are paused\n */\n public get pausedStateMachineNames(): string[] {\n // If the file's not loaded, we got nothing to return\n if (!this.loaded) {\n return [];\n }\n return this.animator.stateMachines\n .filter((m) => !m.playing)\n .map((m) => m.name);\n }\n\n /**\n * @returns true if any animation is playing\n */\n public get isPlaying(): boolean {\n return this.animator.isPlaying;\n }\n\n /**\n * @returns true if all instanced animations are paused\n */\n public get isPaused(): boolean {\n return this.animator.isPaused;\n }\n\n /**\n * @returns true if no animations are playing or paused\n */\n public get isStopped(): boolean {\n return this.animator?.isStopped ?? true;\n }\n\n /**\n * @returns the bounds of the current artboard, or undefined if the artboard\n * isn't loaded yet.\n */\n public get bounds(): Bounds {\n return this.artboard ? this.artboard.bounds : undefined;\n }\n\n /**\n * Subscribe to Rive-generated events\n * @param type the type of event to subscribe to\n * @param callback callback to fire when the event occurs\n */\n public on(type: EventType, callback: EventCallback) {\n this.eventManager.add({\n type: type,\n callback: callback,\n });\n }\n\n /**\n * Unsubscribes from a Rive-generated event\n * @param type the type of event to unsubscribe from\n * @param callback the callback to unsubscribe\n */\n public off(type: EventType, callback: EventCallback) {\n this.eventManager.remove({\n type: type,\n callback: callback,\n });\n }\n\n /**\n * Unsubscribes from a Rive-generated event\n * @deprecated\n * @param callback the callback to unsubscribe from\n */\n public unsubscribe(type: EventType, callback: EventCallback) {\n console.warn(\"This function is deprecated: please use `off()` instead.\");\n this.off(type, callback);\n }\n\n /**\n * Unsubscribes all Rive listeners from an event type, or everything if no type is\n * given\n * @param type the type of event to unsubscribe from, or all types if\n * undefined\n */\n public removeAllRiveEventListeners(type?: EventType) {\n this.eventManager.removeAll(type);\n }\n\n /**\n * Unsubscribes all listeners from an event type, or everything if no type is\n * given\n * @deprecated\n * @param type the type of event to unsubscribe from, or all types if\n * undefined\n */\n public unsubscribeAll(type?: EventType) {\n console.warn(\n \"This function is deprecated: please use `removeAllRiveEventListeners()` instead.\",\n );\n this.removeAllRiveEventListeners(type);\n }\n\n /**\n * Stops the rendering loop; this is different from pausing in that it doesn't\n * change the state of any animation. It stops rendering from occurring. This\n * is designed for situations such as when Rive isn't visible.\n *\n * The only way to start rendering again is to call `startRendering`.\n * Animations that are marked as playing will start from the position that\n * they would have been at if rendering had not been stopped.\n */\n public stopRendering() {\n this._explicitlyStoppedRendering = true;\n if (this.loaded && this.frameRequestId) {\n if (this.runtime.cancelAnimationFrame) {\n this.runtime.cancelAnimationFrame(this.frameRequestId);\n } else {\n cancelAnimationFrame(this.frameRequestId);\n }\n this.frameRequestId = null;\n }\n }\n\n /**\n * Starts the rendering loop if it has been previously stopped. If the\n * renderer is already active, then this will have zero effect.\n */\n public startRendering() {\n this._explicitlyStoppedRendering = false;\n this.drawFrame();\n }\n\n private scheduleRendering() {\n if (this.loaded && this.artboard && !this.frameRequestId) {\n if (this.runtime.requestAnimationFrame) {\n this.frameRequestId = this.runtime.requestAnimationFrame(\n this._boundDraw,\n );\n } else {\n this.frameRequestId = requestAnimationFrame(this._boundDraw);\n }\n }\n }\n\n /**\n * Called when document.visibilitychange fires (tab change, window minimize, etc.). \n * Cancels the rAF loop on hide and resets the time reference so that no accumulated time is\n * applied to state machines when the tab becomes visible again. This prevents state machine\n * advances with large time deltas when rAF starts up again.\n */\n private _onPageVisibilityChange(): void {\n if (document.hidden) {\n if (this.frameRequestId !== null) {\n if (this.runtime?.cancelAnimationFrame) {\n this.runtime.cancelAnimationFrame(this.frameRequestId);\n } else {\n cancelAnimationFrame(this.frameRequestId);\n }\n this.frameRequestId = null;\n }\n // Reset so the first resumed frame starts with elapsedTime === 0.\n this.lastRenderTime = 0;\n } else if (this.animator?.isPlaying && !this._explicitlyStoppedRendering) {\n this.scheduleRendering();\n }\n }\n\n /**\n * Enables frames-per-second (FPS) reporting for the runtime\n * If no callback is provided, Rive will append a fixed-position div at the top-right corner of\n * the page with the FPS reading\n * @param fpsCallback - Callback from the runtime during the RAF loop that supplies the FPS value\n */\n public enableFPSCounter(fpsCallback?: FPSCallback) {\n this.runtime.enableFPSCounter(fpsCallback);\n }\n\n /**\n * Disables frames-per-second (FPS) reporting for the runtime\n */\n public disableFPSCounter() {\n this.runtime.disableFPSCounter();\n }\n\n /**\n * Returns the contents of a Rive file: the artboards, animations, and state machines\n */\n public get contents(): RiveFileContents {\n if (!this.loaded) {\n return undefined;\n }\n const riveContents: RiveFileContents = {\n artboards: [],\n };\n for (let i = 0; i < this.file.artboardCount(); i++) {\n const artboard = this.file.artboardByIndex(i);\n const artboardContents: ArtboardContents = {\n name: artboard.name,\n animations: [],\n stateMachines: [],\n };\n for (let j = 0; j < artboard.animationCount(); j++) {\n const animation = artboard.animationByIndex(j);\n artboardContents.animations.push(animation.name);\n }\n for (let k = 0; k < artboard.stateMachineCount(); k++) {\n const stateMachine = artboard.stateMachineByIndex(k);\n const name = stateMachine.name;\n const instance = new this.runtime.StateMachineInstance(\n stateMachine,\n artboard,\n );\n const inputContents: StateMachineInputContents[] = [];\n for (let l = 0; l < instance.inputCount(); l++) {\n const input = instance.input(l);\n inputContents.push({ name: input.name, type: input.type });\n }\n artboardContents.stateMachines.push({\n name: name,\n inputs: inputContents,\n });\n }\n riveContents.artboards.push(artboardContents);\n }\n return riveContents;\n }\n\n /**\n * Getter / Setter for the volume of the artboard\n */\n public get volume(): number {\n if (this.artboard && this.artboard.volume !== this._volume) {\n this._volume = this.artboard.volume;\n }\n return this._volume;\n }\n\n public set volume(value: number) {\n this._volume = value;\n if (this.artboard) {\n this.artboard.volume = value * audioManager.systemVolume;\n }\n }\n\n /**\n * The width of the artboard.\n *\n * This will return 0 if the artboard is not loaded yet and a custom\n * width has not been set.\n *\n * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}\n * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard width is\n * automatically set.\n */\n public get artboardWidth(): number {\n if (this.artboard) {\n return this.artboard.width;\n }\n return this._artboardWidth ?? 0;\n }\n\n public set artboardWidth(value: number) {\n this._artboardWidth = value;\n if (this.artboard) {\n this.artboard.width = value;\n }\n }\n\n /**\n * The height of the artboard.\n *\n * This will return 0 if the artboard is not loaded yet and a custom\n * height has not been set.\n *\n * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}\n * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard height is\n * automatically set.\n */\n public get artboardHeight(): number {\n if (this.artboard) {\n return this.artboard.height;\n }\n return this._artboardHeight ?? 0;\n }\n\n public set artboardHeight(value: number) {\n this._artboardHeight = value;\n\n if (this.artboard) {\n this.artboard.height = value;\n }\n }\n\n /**\n * Reset the artboard size to its original values.\n */\n public resetArtboardSize() {\n if (this.artboard) {\n this.artboard.resetArtboardSize();\n this._artboardWidth = this.artboard.width;\n this._artboardHeight = this.artboard.height;\n } else {\n // If the artboard isn't loaded, we need to reset the custom width and height\n this._artboardWidth = undefined;\n this._artboardHeight = undefined;\n }\n }\n\n /**\n * The device pixel ratio used in rendering and canvas/artboard resizing.\n *\n * This value will be overidden by the device pixel ratio used in\n * {@link resizeDrawingSurfaceToCanvas}. If you use that method, do not set this value.\n */\n public get devicePixelRatioUsed(): number {\n return this._devicePixelRatioUsed;\n }\n\n public set devicePixelRatioUsed(value: number) {\n if (value !== this._devicePixelRatioUsed) {\n this._overlayTransformDirty = true;\n }\n this._devicePixelRatioUsed = value;\n }\n\n /**\n * Sets the main view model instance and applies it (rebinds). Equivalent to\n * `setViewModelInstance(vmi)` followed by `bind()`.\n */\n public bindViewModelInstance(viewModelInstance: ViewModelInstance | null) {\n if (!viewModelInstance) {\n return;\n }\n this.setViewModelInstance(viewModelInstance);\n this.bind();\n }\n\n /**\n * Sets the main view model instance in the data context WITHOUT rebinding.\n * Call {@link bind} to apply. Use this with {@link setGlobalViewModelInstance}\n * to batch multiple changes into a single rebind.\n */\n public setViewModelInstance(viewModelInstance: ViewModelInstance | null) {\n const runtimeInstance = viewModelInstance?.runtimeInstance;\n if (\n !this.artboard ||\n this.destroyed ||\n !viewModelInstance ||\n !runtimeInstance\n ) {\n return;\n }\n viewModelInstance.internalIncrementReferenceCount();\n this._viewModelInstance?.cleanup();\n this._viewModelInstance = viewModelInstance;\n if (this.animator.stateMachines.length > 0) {\n this.animator.stateMachines.forEach((stateMachine) =>\n stateMachine.instance.setViewModelInstance(runtimeInstance),\n );\n } else {\n this.artboard.setViewModelInstance(runtimeInstance);\n }\n }\n\n /**\n * Applies any pending `set*` view model instance changes by rebinding the\n * data binds once.\n * Implicitly creates and binds any view models that have not been set.\n */\n public bind() {\n if (!this.artboard || this.destroyed) {\n return;\n }\n if (this.animator.stateMachines.length > 0) {\n this.animator.stateMachines.forEach((stateMachine) =>\n stateMachine.instance.bind(),\n );\n } else {\n this.artboard.bind();\n }\n }\n\n public get viewModelInstance(): ViewModelInstance | null {\n return this._viewModelInstance;\n }\n\n /**\n * Sets (or replaces) the global view model instance for the given global view\n * model name in the data context WITHOUT rebinding. The main instance and any\n * other globals keep their order. Call {@link bind} to apply — batch several\n * `set*` calls then a single `bind()` to avoid rebinding per set.\n * @param name - the name of the global view model\n * @param viewModelInstance - the instance to set for that global\n * @returns whether the instance was set (false if `name` does not match a\n * global view model in the file)\n */\n public setGlobalViewModelInstance(\n name: string,\n viewModelInstance: ViewModelInstance,\n ): boolean {\n const runtimeInstance = viewModelInstance?.runtimeInstance;\n if (!this.artboard || this.destroyed || !runtimeInstance) {\n return false;\n }\n let bound = false;\n if (this.animator.stateMachines.length > 0) {\n this.animator.stateMachines.forEach((stateMachine) => {\n if (\n stateMachine.instance.setGlobalViewModelInstance(\n name,\n runtimeInstance,\n )\n ) {\n bound = true;\n }\n });\n } else {\n bound = this.artboard.setGlobalViewModelInstance(name, runtimeInstance);\n }\n if (bound) {\n viewModelInstance.internalIncrementReferenceCount();\n this._globalViewModelInstances.get(name)?.cleanup();\n this._globalViewModelInstances.set(name, viewModelInstance);\n }\n return bound;\n }\n\n /**\n * @param name - the name of the global view model\n * @returns the global view model instance bound under the given name — the\n * instance set via {@link setGlobalViewModelInstance} or one created by\n * auto-bind — or null if none has been set/created for that name (globals are\n * not auto-created; the getter never creates one).\n */\n public globalViewModelInstance(name: string): ViewModelInstance | null {\n const cached = this._globalViewModelInstances.get(name);\n if (cached) {\n return cached;\n }\n if (!this.artboard || this.destroyed) {\n return null;\n }\n // State machines share the artboard's data context; query the first one\n // when present (mirroring how the setter routes), otherwise the artboard.\n // This is a pure read — it returns null unless an instance was set/bound.\n const runtimeInstance =\n this.animator.stateMachines.length > 0\n ? this.animator.stateMachines[0].instance.globalViewModelInstance(name)\n : this.artboard.globalViewModelInstance(name);\n if (runtimeInstance === null) {\n return null;\n }\n const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n createFinalization(viewModelInstance, runtimeInstance);\n viewModelInstance.internalIncrementReferenceCount();\n this._globalViewModelInstances.set(name, viewModelInstance);\n return viewModelInstance;\n }\n\n /**\n * @returns the names of the file's global view models, in file order. Use\n * these with {@link setGlobalViewModelInstance} / {@link globalViewModelInstance}.\n */\n public globalViewModelNames(): string[] {\n return this.file?.globalViewModelNames() ?? [];\n }\n\n public viewModelByIndex(index: number): ViewModel | null {\n const viewModel = this.file.viewModelByIndex(index);\n if (viewModel !== null) {\n return new ViewModel(viewModel);\n }\n return null;\n }\n\n public viewModelByName(name: string): ViewModel | null {\n return this.riveFile?.viewModelByName(name);\n }\n\n public enums(): DataEnum[] {\n if (this._dataEnums === null) {\n const dataEnums = this.file.enums();\n this._dataEnums = dataEnums.map((dataEnum) => {\n return new DataEnum(dataEnum);\n });\n }\n return this._dataEnums;\n }\n\n public defaultViewModel(): ViewModel | null {\n if (this.artboard) {\n const viewModel = this.file.defaultArtboardViewModel(this.artboard);\n if (viewModel) {\n return new ViewModel(viewModel);\n }\n }\n return null;\n }\n\n /**\n * @deprecated This function is deprecated. For better stability and memory management\n * use `getBindableArtboard()` instead.\n * @param {string} name - The name of the artboard.\n * @returns {Artboard} The artboard to bind to.\n */\n public getArtboard(name: string): Artboard | null {\n return this.riveFile?.getArtboard(name) ?? null;\n }\n\n public getBindableArtboard(name: string): BindableArtboard | null {\n return this.riveFile?.getBindableArtboard(name) ?? null;\n }\n\n public getDefaultBindableArtboard(): BindableArtboard | null {\n return this.riveFile?.getDefaultBindableArtboard() ?? null;\n }\n\n /**\n * Clear focus applicable to active state machines with focus nodes. Useful if users want to\n * reset focus state and behavior within the Rive graphic at any point (i.e. blurring off the canvas)\n */\n public clearFocus(): void {\n const playingStateMachines = this.animator.stateMachines.filter((sm) => sm.playing && sm.hasFocusNodes);\n playingStateMachines.forEach((sm) => sm.clearFocus());\n }\n\n}\n\nexport enum DataType {\n none = 'none',\n string = 'string',\n number = 'number',\n boolean = 'boolean',\n color = 'color',\n list = 'list',\n enumType = 'enumType',\n trigger = 'trigger',\n viewModel = 'viewModel',\n integer = 'integer',\n listIndex = 'listIndex',\n image = 'image',\n artboard = 'artboard',\n}\n\nexport class ViewModel {\n private _viewModel: rc.ViewModel;\n\n constructor(viewModel: rc.ViewModel) {\n this._viewModel = viewModel;\n }\n\n public get instanceCount(): number {\n return this._viewModel.instanceCount;\n }\n\n public get name(): string {\n return this._viewModel.name;\n }\n\n public instanceByIndex(index: number): ViewModelInstance | null {\n const instance = this._viewModel.instanceByIndex(index);\n if (instance !== null) {\n const viewModelInstance = new ViewModelInstance(instance, null);\n createFinalization(viewModelInstance, instance);\n return viewModelInstance;\n }\n return null;\n }\n\n public instanceByName(name: string): ViewModelInstance | null {\n const instance = this._viewModel.instanceByName(name);\n if (instance !== null) {\n const viewModelInstance = new ViewModelInstance(instance, null);\n createFinalization(viewModelInstance, instance);\n return viewModelInstance;\n }\n return null;\n }\n\n public defaultInstance(): ViewModelInstance | null {\n const runtimeInstance = this._viewModel.defaultInstance();\n if (runtimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n createFinalization(viewModelInstance, runtimeInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n public instance(): ViewModelInstance {\n const runtimeInstance = this._viewModel.instance();\n if (runtimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(runtimeInstance, null);\n createFinalization(viewModelInstance, runtimeInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n public get properties(): rc.ViewModelProperty[] {\n return this._viewModel.getProperties();\n }\n\n public get instanceNames(): string[] {\n return this._viewModel.getInstanceNames();\n }\n}\n\nexport class DataEnum {\n private _dataEnum: rc.DataEnum;\n\n constructor(dataEnum: rc.DataEnum) {\n this._dataEnum = dataEnum;\n }\n\n public get name(): string {\n return this._dataEnum.name;\n }\n\n public get values(): string[] {\n return this._dataEnum.values;\n }\n}\n\nenum PropertyType {\n Number = \"number\",\n String = \"string\",\n Boolean = \"boolean\",\n Color = \"color\",\n Trigger = \"trigger\",\n Enum = \"enum\",\n List = \"list\",\n Image = \"image\",\n Font = \"font\",\n Artboard = \"artboard\",\n}\n\nexport class ViewModelInstance {\n private _runtimeInstance: rc.ViewModelInstance | null;\n\n private _parents: ViewModelInstance[] = [];\n\n private _children: ViewModelInstance[] = [];\n\n private _viewModelInstances: Map<string, ViewModelInstance> = new Map();\n\n private _propertiesWithCallbacks: ViewModelInstanceValue[] = [];\n\n private _referenceCount = 0;\n\n public selfUnref: boolean = false;\n\n constructor(\n runtimeInstance: rc.ViewModelInstance,\n parent: ViewModelInstance | null,\n ) {\n this._runtimeInstance = runtimeInstance;\n if (parent !== null) {\n this._parents.push(parent);\n }\n }\n\n public get runtimeInstance(): rc.ViewModelInstance | null {\n return this._runtimeInstance;\n }\n\n public get nativeInstance(): rc.ViewModelInstance | null {\n return this._runtimeInstance;\n }\n\n public handleCallbacks() {\n if (this._propertiesWithCallbacks.length !== 0) {\n this._propertiesWithCallbacks.forEach((property) => {\n property.handleCallbacks();\n });\n this._propertiesWithCallbacks.forEach((property) => {\n property.clearChanges();\n });\n }\n this._children.forEach((child) => child.handleCallbacks());\n }\n\n public addParent(parent: ViewModelInstance) {\n if (!this._parents.includes(parent)) {\n this._parents.push(parent);\n if (\n this._propertiesWithCallbacks.length > 0 ||\n this._children.length > 0\n ) {\n parent.addToViewModelCallbacks(this);\n }\n }\n }\n\n public removeParent(parent: ViewModelInstance) {\n const index = this._parents.indexOf(parent);\n if (index !== -1) {\n const parent = this._parents[index];\n parent.removeFromViewModelCallbacks(this);\n this._parents.splice(index, 1);\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public addToPropertyCallbacks(property: ViewModelInstanceValue) {\n if (!this._propertiesWithCallbacks.includes(property)) {\n this._propertiesWithCallbacks.push(property);\n if (this._propertiesWithCallbacks.length > 0) {\n this._parents.forEach((parent) => {\n parent.addToViewModelCallbacks(this);\n });\n }\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public removeFromPropertyCallbacks(property: ViewModelInstanceValue) {\n if (this._propertiesWithCallbacks.includes(property)) {\n this._propertiesWithCallbacks = this._propertiesWithCallbacks.filter(\n (prop) => prop !== property,\n );\n if (\n this._children.length === 0 &&\n this._propertiesWithCallbacks.length === 0\n ) {\n this._parents.forEach((parent) => {\n parent.removeFromViewModelCallbacks(this);\n });\n }\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public addToViewModelCallbacks(instance: ViewModelInstance) {\n if (!this._children.includes(instance)) {\n this._children.push(instance);\n this._parents.forEach((parent) => {\n parent.addToViewModelCallbacks(this);\n });\n }\n }\n\n /*\n * method for internal use, it shouldn't be called externally\n */\n public removeFromViewModelCallbacks(instance: ViewModelInstance) {\n if (this._children.includes(instance)) {\n this._children = this._children.filter((child) => child !== instance);\n if (\n this._children.length === 0 &&\n this._propertiesWithCallbacks.length === 0\n ) {\n this._parents.forEach((parent) => {\n parent.removeFromViewModelCallbacks(this);\n });\n }\n }\n }\n\n private clearCallbacks() {\n this._propertiesWithCallbacks.forEach((property) => {\n property.clearCallbacks();\n });\n }\n\n private propertyFromPath(\n path: string,\n type: PropertyType,\n ): ViewModelInstanceValue | null {\n const pathSegments = path.split(\"/\");\n return this.propertyFromPathSegments(pathSegments, 0, type);\n }\n\n private viewModelFromPathSegments(\n pathSegments: string[],\n index: number,\n ): ViewModelInstance | null {\n const viewModelInstance = this.internalViewModelInstance(\n pathSegments[index],\n );\n if (viewModelInstance !== null) {\n if (index == pathSegments.length - 1) {\n return viewModelInstance;\n } else {\n return viewModelInstance.viewModelFromPathSegments(\n pathSegments,\n index++,\n );\n }\n }\n return null;\n }\n\n private propertyFromPathSegments(\n pathSegments: string[],\n index: number,\n type: PropertyType,\n ): ViewModelInstanceValue | null {\n if (index < pathSegments.length - 1) {\n const viewModelInstance = this.internalViewModelInstance(\n pathSegments[index],\n );\n if (viewModelInstance !== null) {\n return viewModelInstance.propertyFromPathSegments(\n pathSegments,\n index + 1,\n type,\n );\n } else {\n return null;\n }\n }\n let instance: rc.ViewModelInstanceValue | null = null;\n switch (type) {\n case PropertyType.Number:\n instance = this._runtimeInstance?.number(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceNumber(\n instance as rc.ViewModelInstanceNumber,\n this,\n );\n }\n break;\n case PropertyType.String:\n instance = this._runtimeInstance?.string(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceString(\n instance as rc.ViewModelInstanceString,\n this,\n );\n }\n break;\n case PropertyType.Boolean:\n instance = this._runtimeInstance?.boolean(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceBoolean(\n instance as rc.ViewModelInstanceBoolean,\n this,\n );\n }\n break;\n case PropertyType.Color:\n instance = this._runtimeInstance?.color(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceColor(\n instance as rc.ViewModelInstanceColor,\n this,\n );\n }\n break;\n case PropertyType.Trigger:\n instance = this._runtimeInstance?.trigger(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceTrigger(\n instance as rc.ViewModelInstanceTrigger,\n this,\n );\n }\n break;\n case PropertyType.Enum:\n instance = this._runtimeInstance?.enum(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceEnum(\n instance as rc.ViewModelInstanceEnum,\n this,\n );\n }\n break;\n case PropertyType.List:\n instance = this._runtimeInstance?.list(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceList(\n instance as rc.ViewModelInstanceList,\n this,\n );\n }\n break;\n case PropertyType.Image:\n instance = this._runtimeInstance?.image(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceAssetImage(\n instance as rc.ViewModelInstanceAssetImage,\n this,\n );\n }\n break;\n case PropertyType.Font:\n instance = this._runtimeInstance?.font(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceAssetFont(\n instance as rc.ViewModelInstanceAssetFont,\n this,\n );\n }\n break;\n case PropertyType.Artboard:\n instance = this._runtimeInstance?.artboard(pathSegments[index]) ?? null;\n if (instance !== null) {\n return new ViewModelInstanceArtboard(\n instance as rc.ViewModelInstanceArtboard,\n this,\n );\n }\n break;\n }\n return null;\n }\n\n private internalViewModelInstance(name: string): ViewModelInstance | null {\n if (this._viewModelInstances.has(name)) {\n return this._viewModelInstances.get(name)!;\n }\n const viewModelRuntimeInstance = this._runtimeInstance?.viewModel(name);\n if (viewModelRuntimeInstance !== null) {\n const viewModelInstance = new ViewModelInstance(\n viewModelRuntimeInstance!,\n this,\n );\n createFinalization(viewModelInstance, viewModelRuntimeInstance);\n viewModelInstance.internalIncrementReferenceCount();\n this._viewModelInstances.set(name, viewModelInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n /**\n * method to access a property instance of type number belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the number property\n */\n public number(path: string): ViewModelInstanceNumber | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Number,\n );\n return viewmodelInstanceValue as ViewModelInstanceNumber;\n }\n\n /**\n * method to access a property instance of type string belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the string property\n */\n public string(path: string): ViewModelInstanceString | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.String,\n );\n return viewmodelInstanceValue as ViewModelInstanceString | null;\n }\n\n /**\n * method to access a property instance of type boolean belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the boolean property\n */\n public boolean(path: string): ViewModelInstanceBoolean | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Boolean,\n );\n return viewmodelInstanceValue as ViewModelInstanceBoolean | null;\n }\n\n /**\n * method to access a property instance of type color belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the ttrigger property\n */\n public color(path: string): ViewModelInstanceColor | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Color,\n );\n return viewmodelInstanceValue as ViewModelInstanceColor | null;\n }\n\n /**\n * method to access a property instance of type trigger belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the trigger property\n */\n public trigger(path: string): ViewModelInstanceTrigger | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Trigger,\n );\n return viewmodelInstanceValue as ViewModelInstanceTrigger | null;\n }\n\n /**\n * method to access a property instance of type enum belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the enum property\n */\n public enum(path: string): ViewModelInstanceEnum | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Enum,\n );\n return viewmodelInstanceValue as ViewModelInstanceEnum | null;\n }\n\n /**\n * method to access a property instance of type list belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the list property\n */\n public list(path: string): ViewModelInstanceList | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.List,\n );\n return viewmodelInstanceValue as ViewModelInstanceList | null;\n }\n\n /**\n * method to access a view model property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the image property\n */\n public image(path: string): ViewModelInstanceAssetImage | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Image,\n );\n return viewmodelInstanceValue as ViewModelInstanceAssetImage | null;\n }\n\n /**\n * method to access a view model property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the font property\n */\n public font(path: string): ViewModelInstanceAssetFont | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Font,\n );\n return viewmodelInstanceValue as ViewModelInstanceAssetFont | null;\n }\n\n /**\n * method to access an artboard property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the image property\n */\n public artboard(path: string): ViewModelInstanceArtboard | null {\n const viewmodelInstanceValue = this.propertyFromPath(\n path,\n PropertyType.Artboard,\n );\n return viewmodelInstanceValue as ViewModelInstanceArtboard | null;\n }\n\n /**\n * method to access a view model property instance belonging\n * to the view model instance or to a nested view model instance\n * @param path - path to the view model property\n */\n public viewModel(path: string): ViewModelInstance | null {\n const pathSegments = path.split(\"/\");\n const parentViewModelInstance =\n pathSegments.length > 1\n ? this.viewModelFromPathSegments(\n pathSegments.slice(0, pathSegments.length - 1),\n 0,\n )\n : this;\n if (parentViewModelInstance != null) {\n return parentViewModelInstance.internalViewModelInstance(\n pathSegments[pathSegments.length - 1],\n );\n }\n return null;\n }\n\n public internalReplaceViewModel(\n name: string,\n value: ViewModelInstance,\n ): boolean {\n if (value.runtimeInstance !== null) {\n const result =\n this._runtimeInstance?.replaceViewModel(name, value.runtimeInstance!) ||\n false;\n if (result) {\n value.internalIncrementReferenceCount();\n const oldInstance = this.internalViewModelInstance(name);\n if (oldInstance !== null) {\n oldInstance.removeParent(this);\n if (this._children.includes(oldInstance)) {\n this._children = this._children.filter(\n (child) => child !== oldInstance,\n );\n }\n oldInstance.cleanup();\n }\n this._viewModelInstances.set(name, value);\n value.addParent(this);\n }\n return result;\n }\n return false;\n }\n\n /**\n * method to replace a view model property with another view model value\n * @param path - path to the view model property\n * @param value - view model that will replace the original\n */\n public replaceViewModel(path: string, value: ViewModelInstance): boolean {\n const pathSegments = path.split(\"/\");\n const viewModelInstance =\n pathSegments.length > 1\n ? this.viewModelFromPathSegments(\n pathSegments.slice(0, pathSegments.length - 1),\n 0,\n )\n : this;\n return (\n viewModelInstance?.internalReplaceViewModel(\n pathSegments[pathSegments.length - 1],\n value,\n ) ?? false\n );\n }\n\n /*\n * method to add one to the reference counter of the instance.\n * Use if the file owning the reference is destroyed but the instance needs to stay around\n */\n public incrementReferenceCount() {\n this._referenceCount++;\n this._runtimeInstance?.incrementReferenceCount();\n }\n\n /*\n * method to subtract one to the reference counter of the instance.\n * Use if incrementReferenceCount has been called\n */\n public decrementReferenceCount() {\n this._referenceCount--;\n this._runtimeInstance?.decrementReferenceCount();\n }\n\n public get properties(): rc.ViewModelProperty[] {\n return (\n this._runtimeInstance?.getProperties().map((prop) => ({ ...prop })) || []\n );\n }\n\n /**\n * Get the name of the ViewModel definition this instance was created from.\n */\n public get viewModelName(): string {\n return this._runtimeInstance?.getViewModelName() ?? \"\";\n }\n\n public internalIncrementReferenceCount() {\n this._referenceCount++;\n }\n\n public cleanup() {\n this._referenceCount--;\n if (this._referenceCount <= 0) {\n if (this.selfUnref) {\n this._runtimeInstance?.unref();\n }\n this._runtimeInstance = null;\n this.clearCallbacks();\n this._propertiesWithCallbacks = [];\n this._viewModelInstances.forEach((value) => {\n value.cleanup();\n });\n this._viewModelInstances.clear();\n const children = [...this._children];\n this._children.length = 0;\n const parents = [...this._parents];\n this._parents.length = 0;\n children.forEach((child) => {\n child.removeParent(this);\n });\n parents.forEach((parent) => {\n parent.removeFromViewModelCallbacks(this);\n });\n }\n }\n}\n\nexport class ViewModelInstanceValue {\n protected _parentViewModel: ViewModelInstance;\n protected callbacks: EventCallback[] = [];\n protected _viewModelInstanceValue: rc.ViewModelInstanceValue;\n constructor(instance: rc.ViewModelInstanceValue, parent: ViewModelInstance) {\n this._viewModelInstanceValue = instance;\n this._parentViewModel = parent;\n }\n\n public on(callback: EventCallback) {\n // Since we don't clean the changed flag for properties that don't have listeners,\n // we clean it the first time we add a listener to it\n if (this.callbacks.length === 0) {\n this._viewModelInstanceValue.clearChanges();\n }\n if (!this.callbacks.includes(callback)) {\n this.callbacks.push(callback);\n this._parentViewModel.addToPropertyCallbacks(this);\n }\n }\n public off(callback?: EventCallback) {\n if (!callback) {\n this.callbacks.length = 0;\n } else {\n this.callbacks = this.callbacks.filter((cb) => cb !== callback);\n }\n if (this.callbacks.length === 0) {\n this._parentViewModel.removeFromPropertyCallbacks(this);\n }\n }\n public internalHandleCallback(callback: Function) {}\n\n public handleCallbacks() {\n if (this._viewModelInstanceValue.hasChanged) {\n this.callbacks.forEach((callback) => {\n this.internalHandleCallback(callback);\n });\n }\n }\n\n public clearChanges() {\n this._viewModelInstanceValue.clearChanges();\n }\n\n public clearCallbacks() {\n this.callbacks.length = 0;\n }\n\n public get name() {\n return this._viewModelInstanceValue.name;\n }\n}\n\nexport class ViewModelInstanceString extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceString, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): string {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceString).value;\n }\n\n public set value(val: string) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceString).value = val;\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceNumber extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceNumber, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceNumber).value;\n }\n\n public set value(val: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceNumber).value = val;\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceBoolean extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceBoolean,\n parent: ViewModelInstance,\n ) {\n super(instance, parent);\n }\n\n public get value(): boolean {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceBoolean).value;\n }\n\n public set value(val: boolean) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceBoolean).value = val;\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceTrigger extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceTrigger,\n parent: ViewModelInstance,\n ) {\n super(instance, parent);\n }\n\n public trigger(): void {\n return (\n this._viewModelInstanceValue as rc.ViewModelInstanceTrigger\n ).trigger();\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceEnum extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceEnum, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): string {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).value;\n }\n\n public set value(val: string) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).value = val;\n }\n\n public set valueIndex(val: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).valueIndex = val;\n }\n\n public get valueIndex(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum)\n .valueIndex;\n }\n\n public get values(): string[] {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceEnum).values;\n }\n\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceList extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceList, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get length(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceList).size;\n }\n\n public addInstance(instance: ViewModelInstance) {\n if (instance.runtimeInstance != null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).addInstance(\n instance.runtimeInstance!,\n );\n instance.addParent(this._parentViewModel);\n }\n }\n\n public addInstanceAt(instance: ViewModelInstance, index: number): boolean {\n if (instance.runtimeInstance != null) {\n if (\n (\n this._viewModelInstanceValue as rc.ViewModelInstanceList\n ).addInstanceAt(instance.runtimeInstance!, index)\n ) {\n instance.addParent(this._parentViewModel);\n return true;\n }\n }\n return false;\n }\n\n public removeInstance(instance: ViewModelInstance) {\n if (instance.runtimeInstance != null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).removeInstance(\n instance.runtimeInstance!,\n );\n instance.removeParent(this._parentViewModel);\n }\n }\n\n public removeInstanceAt(index: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).removeInstanceAt(\n index,\n );\n }\n\n public instanceAt(index: number): ViewModelInstance | null {\n const runtimeInstance = (\n this._viewModelInstanceValue as rc.ViewModelInstanceList\n ).instanceAt(index);\n if (runtimeInstance != null) {\n const viewModelInstance = new ViewModelInstance(\n runtimeInstance,\n this._parentViewModel,\n );\n createFinalization(viewModelInstance, runtimeInstance);\n return viewModelInstance;\n }\n return null;\n }\n\n public swap(a: number, b: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceList).swap(a, b);\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceColor extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceColor, parent: ViewModelInstance) {\n super(instance, parent);\n }\n\n public get value(): number {\n return (this._viewModelInstanceValue as rc.ViewModelInstanceColor).value;\n }\n\n public set value(val: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).value = val;\n }\n\n public rgb(r: number, g: number, b: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).rgb(r, g, b);\n }\n\n public rgba(r: number, g: number, b: number, a: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).argb(\n a,\n r,\n g,\n b,\n );\n }\n\n public argb(a: number, r: number, g: number, b: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).argb(\n a,\n r,\n g,\n b,\n );\n }\n\n // Value 0 to 255\n public alpha(a: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).alpha(a);\n }\n\n // Value 0 to 1\n public opacity(o: number) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceColor).alpha(\n Math.round(Math.max(0, Math.min(1, o)) * 255),\n );\n }\n public internalHandleCallback(callback: Function) {\n callback(this.value);\n }\n}\n\nexport class ViewModelInstanceAssetImage extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceAssetImage,\n root: ViewModelInstance,\n ) {\n super(instance, root);\n }\n\n public set value(image: rc.Image | null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceAssetImage).value(\n image?.nativeImage ?? null,\n );\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceAssetFont extends ViewModelInstanceValue {\n constructor(\n instance: rc.ViewModelInstanceAssetFont,\n root: ViewModelInstance,\n ) {\n super(instance, root);\n }\n\n public set value(font: rc.Font | null) {\n (this._viewModelInstanceValue as rc.ViewModelInstanceAssetFont).value(\n font?.nativeFont ?? null,\n );\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\nexport class ViewModelInstanceArtboard extends ViewModelInstanceValue {\n constructor(instance: rc.ViewModelInstanceArtboard, root: ViewModelInstance) {\n super(instance, root);\n }\n\n public set value(artboard: BaseArtboard | null) {\n let bindableArtboard: BindableArtboard;\n if (artboard.isBindableArtboard) {\n bindableArtboard = artboard as BindableArtboard;\n } else {\n bindableArtboard = (\n artboard as Artboard\n ).file.internalBindableArtboardFromArtboard(\n (artboard as Artboard).nativeArtboard,\n );\n }\n (this._viewModelInstanceValue as rc.ViewModelInstanceArtboard).value(\n bindableArtboard?.nativeArtboard ?? null,\n );\n if (bindableArtboard?.nativeViewModel) {\n (\n this._viewModelInstanceValue as rc.ViewModelInstanceArtboard\n ).viewModelInstance(bindableArtboard?.nativeViewModel ?? null);\n }\n }\n\n public internalHandleCallback(callback: Function) {\n callback();\n }\n}\n\n/**\n * Contents of a state machine input\n */\ninterface StateMachineInputContents {\n name: string;\n type: StateMachineInputType;\n initialValue?: boolean | number;\n}\n\n/**\n * Contents of a state machine\n */\ninterface StateMachineContents {\n name: string;\n inputs: StateMachineInputContents[];\n}\n\n/**\n * Contents of an artboard\n */\ninterface ArtboardContents {\n animations: string[];\n stateMachines: StateMachineContents[];\n name: string;\n}\n\n/**\n * contents of a Rive file\n */\ninterface RiveFileContents {\n artboards?: ArtboardContents[];\n}\n\n// Loads Rive data from a URI via fetch.\nconst loadRiveFile = async (src: string): Promise<ArrayBuffer> => {\n const req = new Request(src);\n const res = await fetch(req);\n if (!res.ok) {\n throw new Error(`Failed to fetch the Rive file: HTTP ${res.status}`);\n }\n const buffer = await res.arrayBuffer();\n return buffer;\n};\n\n// #endregion\n\n// #region utility functions\n\n/*\n * Utility function to ensure an object is a string array\n */\nconst mapToStringArray = (obj?: string[] | string | undefined): string[] => {\n if (typeof obj === \"string\") {\n return [obj];\n } else if (obj instanceof Array) {\n return obj;\n }\n // If obj is undefined, return empty array\n return [];\n};\n\n// #endregion\n\n// #region testing utilities\n\n// Exports to only be used for tests\nexport const Testing = {\n EventManager: EventManager,\n TaskQueueManager: TaskQueueManager,\n};\n\n// #endregion\n\n// #region asset loaders\n\n/**\n * Decodes bytes into an audio asset.\n *\n * Be sure to call `.unref()` on the audio once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeAudio = async (bytes: Uint8Array): Promise<AudioWrapper> => {\n const decodedPromise = new Promise<rc.Audio>((resolve) =>\n RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n rive.decodeAudio(bytes, resolve);\n }),\n );\n const audio: rc.Audio = await decodedPromise;\n const audioWrapper = new AudioWrapper(audio);\n finalizationRegistry.register(audioWrapper, audio);\n return audioWrapper;\n};\n\n/**\n * Decodes bytes into an image.\n *\n * Be sure to call `.unref()` on the image once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeImage = async (bytes: Uint8Array): Promise<ImageWrapper> => {\n const decodedPromise = new Promise<rc.Image>((resolve) =>\n RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n rive.decodeImage(bytes, resolve);\n }),\n );\n const image: rc.Image = await decodedPromise;\n const imageWrapper = new ImageWrapper(image);\n finalizationRegistry.register(imageWrapper, image);\n return imageWrapper;\n};\n\n/**\n * Decodes bytes into a font.\n *\n * Be sure to call `.unref()` on the font once it is no longer needed. This\n * allows the engine to clean it up when it is not used by any more animations.\n */\nexport const decodeFont = async (bytes: Uint8Array): Promise<FontWrapper> => {\n const decodedPromise = new Promise<rc.Font>((resolve) =>\n RuntimeLoader.getInstance((rive: rc.RiveCanvas): void => {\n rive.decodeFont(bytes, resolve);\n }),\n );\n const font: rc.Font = await decodedPromise;\n const fontWrapper = new FontWrapper(font);\n finalizationRegistry.register(fontWrapper, font);\n return fontWrapper;\n};\n\n// #endregion\n"],"names":[],"sourceRoot":""}
|