@rive-app/canvas-lite 2.40.1 → 2.41.1
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 +206 -5
- package/rive.js +409 -117
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +27 -12
- package/rive_fallback.wasm +0 -0
- package/semantics/index.d.ts +1 -1
- package/semantics/types.d.ts +15 -2
package/rive.js
CHANGED
|
@@ -349,98 +349,100 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
349
349
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
350
350
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
351
351
|
/* harmony export */ });
|
|
352
|
-
var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var
|
|
353
|
-
function
|
|
354
|
-
"fixed",f.style.right=0,f.style.top=0,f.style.color="white",f.style.padding="4px",f.innerHTML="RIVE FPS",h=function(g){f.innerHTML="RIVE FPS "+g.toFixed(1)},document.body.appendChild(f));e=new function(){let g=0,m=0;this.
|
|
355
|
-
function
|
|
356
|
-
|
|
357
|
-
h.isAudio?
|
|
358
|
-
n.onreadystatechange=function(){4==n.readyState&&200==n.status&&m(n)};n.open("GET",g,!0);n.send(null)})(h.cdnBaseUrl+"/"+f,g=>{h.decode(new Uint8Array(g.response))});return!0}});
|
|
352
|
+
var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var l=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
|
|
353
|
+
function ea(){function b(h){const g=d;c=a=0;d=new Map;g.forEach(m=>{try{m(h)}catch(n){console.error(n)}});this.rb();e&&e.Pb()}let a=0,c=0,d=new Map,e=null,f=null;this.requestAnimationFrame=function(h){a||=requestAnimationFrame(b.bind(this));const g=++c;d.set(g,h);return g};this.cancelAnimationFrame=function(h){d.delete(h);a&&0==d.size&&(cancelAnimationFrame(a),a=0)};this.Nb=function(h){f&&(document.body.remove(f),f=null);h||(f=document.createElement("div"),f.style.backgroundColor="black",f.style.position=
|
|
354
|
+
"fixed",f.style.right=0,f.style.top=0,f.style.color="white",f.style.padding="4px",f.innerHTML="RIVE FPS",h=function(g){f.innerHTML="RIVE FPS "+g.toFixed(1)},document.body.appendChild(f));e=new function(){let g=0,m=0;this.Pb=function(){var n=performance.now();m?(++g,n-=m,1E3<n&&(h(1E3*g/n),g=m=0)):(m=n,g=0)}}};this.Kb=function(){f&&(document.body.remove(f),f=null);e=null};this.rb=function(){}}
|
|
355
|
+
function ia(b){console.assert(!0);const a=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<b)-1)>>b;a.has(d)&&clearTimeout(a.get(d));a.set(d,setTimeout(function(){a.delete(d);0==a.length?c=-Infinity:d==c&&(c=Math.max(...a.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<b}}const ja=l.onRuntimeInitialized;
|
|
356
|
+
l.onRuntimeInitialized=function(){ja&&ja();let b=l.decodeAudio;l.decodeAudio=function(f,h){f=b(f);h(f)};let a=l.decodeFont;l.decodeFont=function(f,h){f=a(f);h(f)};let c=l.setFallbackFontCb;l.setFallbackFontCallback="function"===typeof c?function(f){c(f)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const d=l.FileAssetLoader;l.ptrToAsset=f=>{let h=l.ptrToFileAsset(f);return h.isImage?l.ptrToImageAsset(f):h.isFont?l.ptrToFontAsset(f):
|
|
357
|
+
h.isAudio?l.ptrToAudioAsset(f):h};l.CustomFileAssetLoader=d.extend("CustomFileAssetLoader",{__construct:function({loadContents:f}){this.__parent.__construct.call(this);this.Fb=f},loadContents:function(f,h){f=l.ptrToAsset(f);return this.Fb(f,h)}});l.CDNFileAssetLoader=d.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(f){let h=l.ptrToAsset(f);f=h.cdnUuid;if(""===f)return!1;(function(g,m){var n=new XMLHttpRequest;n.responseType="arraybuffer";
|
|
358
|
+
n.onreadystatechange=function(){4==n.readyState&&200==n.status&&m(n)};n.open("GET",g,!0);n.send(null)})(h.cdnBaseUrl+"/"+f,g=>{h.decode(new Uint8Array(g.response))});return!0}});l.FallbackFileAssetLoader=d.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);this.qb=[]},addLoader:function(f){this.qb.push(f)},loadContents:function(f,h){for(let g of this.qb)if(g.loadContents(f,h))return!0;return!1}});let e=l.computeAlignment;l.computeAlignment=function(f,h,g,
|
|
359
359
|
m,n=1){return e.call(this,f,h,g,m,n)}};
|
|
360
|
-
const
|
|
361
|
-
renderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=t.getContext("webgl",v),c=1,!p)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(p=t.getContext("webgl2",v))c=2;else if(p=t.getContext("webgl",v))c=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;p=new Proxy(p,{get(
|
|
362
|
-
"function"===typeof
|
|
363
|
-
p.attachShader(
|
|
360
|
+
const ka="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),la=new function(){function b(){if(!a){var t=document.createElement("canvas"),v={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,
|
|
361
|
+
renderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=t.getContext("webgl",v),c=1,!p)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(p=t.getContext("webgl2",v))c=2;else if(p=t.getContext("webgl",v))c=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;p=new Proxy(p,{get(G,r){if(G.isContextLost()){if(m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",r),m=!0),
|
|
362
|
+
"function"===typeof G[r])return function(){}}else return"function"===typeof G[r]?function(...E){return G[r].apply(G,E)}:G[r]},set(G,r,E){if(G.isContextLost())m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+r),m=!0);else return G[r]=E,!0}});d=Math.min(p.getParameter(p.MAX_RENDERBUFFER_SIZE),p.getParameter(p.MAX_TEXTURE_SIZE));function I(G,r,E){r=p.createShader(r);p.shaderSource(r,E);p.compileShader(r);E=p.getShaderInfoLog(r);if(0<(E||"").length)throw E;
|
|
363
|
+
p.attachShader(G,r)}t=p.createProgram();I(t,p.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }");I(t,p.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }");
|
|
364
364
|
p.bindAttribLocation(t,0,"vertex");p.bindAttribLocation(t,1,"uv");p.linkProgram(t);v=p.getProgramInfoLog(t);if(0<(v||"").trim().length)throw v;e=p.getUniformLocation(t,"mat");f=p.getUniformLocation(t,"translate");p.useProgram(t);p.bindBuffer(p.ARRAY_BUFFER,p.createBuffer());p.enableVertexAttribArray(0);p.enableVertexAttribArray(1);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,p.createBuffer());p.uniform1i(p.getUniformLocation(t,"image"),0);p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);a=p}return!0}let a=
|
|
365
|
-
null,c=0,d=0,e=null,f=null,h=0,g=0,m=!1;b();this.
|
|
366
|
-
a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_LINEAR),a.generateMipmap(a.TEXTURE_2D)):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);return v};const n=new
|
|
367
|
-
r=
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
case n.color:return"color";case n.luminosity:return"luminosity"}}function a(
|
|
372
|
-
let t=1;var v=
|
|
373
|
-
q.
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
var
|
|
392
|
-
class
|
|
393
|
-
var
|
|
394
|
-
|
|
395
|
-
var
|
|
396
|
-
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
var
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
a
|
|
404
|
-
function
|
|
405
|
-
|
|
406
|
-
function
|
|
407
|
-
|
|
408
|
-
function
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
|
|
365
|
+
null,c=0,d=0,e=null,f=null,h=0,g=0,m=!1;b();this.Yb=function(){b();return d};this.Jb=function(t){a.deleteTexture&&a.deleteTexture(t)};this.Ib=function(t){if(!b())return null;const v=a.createTexture();if(!v)return null;a.bindTexture(a.TEXTURE_2D,v);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,t);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);2==c?(a.texParameteri(a.TEXTURE_2D,
|
|
366
|
+
a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_LINEAR),a.generateMipmap(a.TEXTURE_2D)):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);return v};const n=new ia(8),u=new ia(8),A=new ia(10),x=new ia(10);this.Mb=function(t,v,p,I,G){if(b()){var r=n.push(t),E=u.push(v);if(a.canvas){if(a.canvas.width!=r||a.canvas.height!=E)a.canvas.width=r,a.canvas.height=E;a.viewport(0,E-v,t,v);a.disable(a.SCISSOR_TEST);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);a.enable(a.SCISSOR_TEST);p.sort((F,Z)=>Z.vb-F.vb);
|
|
367
|
+
r=A.push(I);h!=r&&(a.bufferData(a.ARRAY_BUFFER,8*r,a.DYNAMIC_DRAW),h=r);r=0;for(var L of p)a.bufferSubData(a.ARRAY_BUFFER,r,L.ab),r+=4*L.ab.length;console.assert(r==4*I);for(var O of p)a.bufferSubData(a.ARRAY_BUFFER,r,O.yb),r+=4*O.yb.length;console.assert(r==8*I);r=x.push(G);g!=r&&(a.bufferData(a.ELEMENT_ARRAY_BUFFER,2*r,a.DYNAMIC_DRAW),g=r);L=0;for(var W of p)a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,L,W.indices),L+=2*W.indices.length;console.assert(L==2*G);W=0;O=!0;r=L=0;for(const F of p){F.image.Va!=
|
|
368
|
+
W&&(a.bindTexture(a.TEXTURE_2D,F.image.Ta||null),W=F.image.Va);F.ac?(a.scissor(F.ib,E-F.jb-F.pb,F.ic,F.pb),O=!0):O&&(a.scissor(0,E-v,t,v),O=!1);p=2/t;const Z=-2/v;a.uniform4f(e,F.wa[0]*p*F.La,F.wa[1]*Z*F.Ma,F.wa[2]*p*F.La,F.wa[3]*Z*F.Ma);a.uniform2f(f,F.wa[4]*p*F.La+p*(F.ib-F.Zb*F.La)-1,F.wa[5]*Z*F.Ma+Z*(F.jb-F.$b*F.Ma)+1);a.vertexAttribPointer(0,2,a.FLOAT,!1,0,r);a.vertexAttribPointer(1,2,a.FLOAT,!1,0,r+4*I);a.drawElements(a.TRIANGLES,F.indices.length,a.UNSIGNED_SHORT,L);r+=4*F.ab.length;L+=2*F.indices.length}console.assert(r==
|
|
369
|
+
4*I);console.assert(L==2*G)}}};this.canvas=function(){return b()&&a.canvas}},ma=l.onRuntimeInitialized;
|
|
370
|
+
l.onRuntimeInitialized=function(){function b(k){switch(k){case n.srcOver:return"source-over";case n.screen:return"screen";case n.overlay:return"overlay";case n.darken:return"darken";case n.lighten:return"lighten";case n.colorDodge:return"color-dodge";case n.colorBurn:return"color-burn";case n.hardLight:return"hard-light";case n.softLight:return"soft-light";case n.difference:return"difference";case n.exclusion:return"exclusion";case n.multiply:return"multiply";case n.hue:return"hue";case n.saturation:return"saturation";
|
|
371
|
+
case n.color:return"color";case n.luminosity:return"luminosity"}}function a(k){return"rgba("+((16711680&k)>>>16)+","+((65280&k)>>>8)+","+((255&k)>>>0)+","+((4278190080&k)>>>24)/255+")"}function c(){0<L.length&&(la.Mb(E.drawWidth(),E.drawHeight(),L,O,W),L=[],W=O=0,E.reset(512,512));for(const k of r){for(const q of k.na)q();k.na=[]}r.clear()}ma&&ma();var d=l.RenderPaintStyle;const e=l.RenderPath,f=l.RenderPaint,h=l.Renderer,g=l.StrokeCap,m=l.StrokeJoin,n=l.BlendMode,u=d.fill,A=d.stroke,x=l.FillRule.evenOdd;
|
|
372
|
+
let t=1;var v=l.RenderImage.extend("CanvasRenderImage",{__construct:function({Ba:k,Ka:q}={}){this.__parent.__construct.call(this);this.Va=t;t=t+1&2147483647||1;this.Ba=k;this.Ka=q},__destruct:function(){this.Ta&&(la.Jb(this.Ta),URL.revokeObjectURL(this.gb));this.__parent.__destruct.call(this)},decode:function(k){var q=this;q.Ka&&q.Ka(q);var z=new Image;q.gb=URL.createObjectURL(new Blob([k],{type:"image/png"}));z.onload=function(){q.Eb=z;q.Ta=la.Ib(z);q.size(z.width,z.height);q.Ba&&q.Ba(q)};z.src=
|
|
373
|
+
q.gb}});class p{constructor(){this.Da=this.Ha=0;this.sa=new Path2D}clear(){this.Da=this.Ha=0;this.sa=new Path2D}Gb(k){for(0<this.Ha&&this.Da<k.length&&this.clear();this.Da<k.length;)k[this.Da++](this.sa);this.Ha++;return this.sa}release(k){k===this.sa&&this.Ha--}}var I=e.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this);this.Ra=[];this.sa=new p;this.Qa=!1;this.za=null},rewind:function(){this.Ra.length=0;this.sa.clear();this.Qa=!1;this.za=null},addPath:function(k,
|
|
374
|
+
q,z,y,D,w,C){const H=k.Ab();this.ya(fa=>{const M=new DOMMatrix;M.a=q;M.b=z;M.c=y;M.d=D;M.e=w;M.f=C;fa.addPath(H,M)})},fillRule:function(k){this.fb=k},moveTo:function(k,q){this.Qa=!0;const z={kb:!0};this.za=z;this.ya(y=>{y.moveTo(k,q);z.kb&&y.lineTo(k,q)})},lineTo:function(k,q){this.eb();this.Oa();this.ya(z=>{z.lineTo(k,q)})},cubicTo:function(k,q,z,y,D,w){this.eb();this.Oa();this.ya(C=>{C.bezierCurveTo(k,q,z,y,D,w)})},close:function(){this.Oa();this.ya(k=>{k.closePath()})},eb:function(){this.Qa||this.moveTo(0,
|
|
375
|
+
0)},Oa:function(){null!==this.za&&(this.za.kb=!1,this.za=null)},ya:function(k){this.Ra.push(k)},Na:function(){return this.sa.Gb(this.Ra)},hb:function(k){this.sa.release(k)},Ab:function(){const k=this.Na();this.sa.clear();return k}}),G=f.extend("CanvasRenderPaint",{__construct:function(){this.__parent.__construct.call(this);this.la=[];this.Pa=0;this.Sa=u;this.Wa=a(4278190080);this.Ua=1;this.Ga="miter";this.Fa="butt";this.bb=b(n.srcOver);this.va=null},color:function(k){this.la.push(()=>{this.Wa=a(k)})},
|
|
376
|
+
thickness:function(k){this.la.push(()=>{this.Ua=Math.abs(k)})},join:function(k){this.la.push(()=>{switch(k){case m.miter:this.Ga="miter";break;case m.round:this.Ga="round";break;case m.bevel:this.Ga="bevel"}})},cap:function(k){this.la.push(()=>{switch(k){case g.butt:this.Fa="butt";break;case g.round:this.Fa="round";break;case g.square:this.Fa="square"}})},style:function(k){this.la.push(()=>{this.Sa=k})},blendMode:function(k){this.la.push(()=>{this.bb=b(k)})},clearGradient:function(){this.la.push(()=>
|
|
377
|
+
{this.va=null})},linearGradient:function(k,q,z,y){this.la.push(()=>{this.va={wb:k,xb:q,mb:z,nb:y,$a:[]}})},radialGradient:function(k,q,z,y){this.la.push(()=>{this.va={wb:k,xb:q,mb:z,nb:y,$a:[],Wb:!0}})},addStop:function(k,q){this.la.push(()=>{this.va.$a.push({color:k,stop:q})})},completeGradient:function(){},Bb:function(k,q,z,y){if(this.Sa!==A||0<this.Ua){var D=this.Sa,w=this.Wa,C=this.va,H=k.globalCompositeOperation,fa=k.globalAlpha;k.globalCompositeOperation=this.bb;k.globalAlpha=y;if(null!=C){w=
|
|
378
|
+
C.wb;const S=C.xb,U=C.mb;var M=C.nb;y=C.$a;C.Wb?(C=U-w,M-=S,w=k.createRadialGradient(w,S,0,w,S,Math.sqrt(C*C+M*M))):w=k.createLinearGradient(w,S,U,M);for(let R=0,Aa=y.length;R<Aa;R++)C=y[R],w.addColorStop(C.stop,a(C.color));this.Wa=w;this.va=null}switch(D){case A:k.strokeStyle=w;k.lineWidth=this.Ua;k.lineCap=this.Fa;k.lineJoin=this.Ga;k.stroke(q);break;case u:k.fillStyle=w,k.fill(q,z)}k.globalCompositeOperation=H;k.globalAlpha=fa}},Db:function(){return this.Pa+this.la.length},Cb:function(k){const q=
|
|
379
|
+
k-this.Pa;for(let z=0;z<q;z++)this.la[z]();this.la.splice(0,q);this.Pa=k}});const r=new Set;let E=null,L=[],O=0,W=0;var F=l.CanvasRenderer=h.extend("Renderer",{__construct:function(k){this.__parent.__construct.call(this);this.ra=[1,0,0,1,0,0];this.ja=[1];this.ha=k.getContext("2d");this.cb=k;this.na=[]},save:function(){this.ra.push(...this.ra.slice(this.ra.length-6));this.ja.push(this.ja[this.ja.length-1]);this.na.push(this.ha.save.bind(this.ha))},restore:function(){const k=this.ra.length-6;if(6>k)throw"restore() called without matching save().";
|
|
380
|
+
this.ra.splice(k);this.ja.pop();this.na.push(this.ha.restore.bind(this.ha))},transform:function(k,q,z,y,D,w){const C=this.ra,H=C.length-6;C.splice(H,6,C[H]*k+C[H+2]*q,C[H+1]*k+C[H+3]*q,C[H]*z+C[H+2]*y,C[H+1]*z+C[H+3]*y,C[H]*D+C[H+2]*w+C[H+4],C[H+1]*D+C[H+3]*w+C[H+5]);this.na.push(this.ha.transform.bind(this.ha,k,q,z,y,D,w))},rotate:function(k){const q=Math.sin(k);k=Math.cos(k);this.transform(k,q,-q,k,0,0)},modulateOpacity:function(k){this.ja[this.ja.length-1]*=k},_drawPath:function(k,q){const z=k.fb===
|
|
381
|
+
x?"evenodd":"nonzero",y=Math.max(0,this.ja[this.ja.length-1]),D=k.Na(),w=q.Db();this.na.push(()=>{q.Cb(w);q.Bb(this.ha,D,z,y);k.hb(D)})},_drawRiveImage:function(k,q,z){var y=k.Eb;if(y){var D=this.ha,w=b(q),C=Math.max(0,z*this.ja[this.ja.length-1]);this.na.push(function(){D.globalCompositeOperation=w;D.globalAlpha=C;D.drawImage(y,0,0);D.globalAlpha=1})}},_getMatrix:function(k){const q=this.ra,z=q.length-6;for(let y=0;6>y;++y)k[y]=q[z+y]},_drawImageMesh:function(k,q,z,y,D,w,C,H,fa,M,S,U,R){let Aa,ob,
|
|
382
|
+
pb;try{Aa=l.HEAPF32.slice(y>>2,(y>>2)+D),ob=l.HEAPF32.slice(w>>2,(w>>2)+C),pb=l.HEAPU16.slice(H>>1,(H>>1)+fa)}catch(Ra){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}y=this.ha.canvas.width;w=this.ha.canvas.height;C=U-M;H=R-S;M=Math.max(M,0);S=Math.max(S,0);U=Math.min(U,y);R=Math.min(R,w);const pa=U-M,qa=R-S;console.assert(pa<=Math.min(C,y));console.assert(qa<=Math.min(H,w));if(!(0>=pa||0>=qa)){U=pa<C||qa<H;y=R=1;var ca=Math.ceil(pa*
|
|
383
|
+
R),da=Math.ceil(qa*y);w=la.Yb();ca>w&&(R*=w/ca,ca=w);da>w&&(y*=w/da,da=w);E||(E=new l.DynamicRectanizer(w),E.reset(512,512));w=E.addRect(ca,da);0>w&&(c(),r.add(this),w=E.addRect(ca,da),console.assert(0<=w));var qb=w&65535,rb=w>>16;L.push({wa:this.ra.slice(this.ra.length-6),image:k,ib:qb,jb:rb,Zb:M,$b:S,ic:ca,pb:da,La:R,Ma:y,ab:Aa,yb:ob,indices:pb,ac:U,vb:k.Va<<1|(U?1:0)});O+=D;W+=fa;var ha=this.ha,cc=b(q),dc=Math.max(0,z*this.ja[this.ja.length-1]);this.na.push(function(){ha.save();ha.resetTransform();
|
|
384
|
+
ha.globalCompositeOperation=cc;ha.globalAlpha=dc;const Ra=la.canvas();Ra&&ha.drawImage(Ra,qb,rb,ca,da,M,S,pa,qa);ha.restore()})}},_clipPath:function(k){const q=k.fb===x?"evenodd":"nonzero",z=k.Na();this.na.push(()=>{this.ha.clip(z,q);k.hb(z)})},beginFrame:function(k=!0){r.add(this);k&&this.na.push(this.ha.clearRect.bind(this.ha,0,0,this.cb.width,this.cb.height))},clear:function(){this.beginFrame(!0)},flush:function(){},translate:function(k,q){this.transform(1,0,0,1,k,q)}});l.makeRenderer=function(k){const q=
|
|
385
|
+
new F(k),z=q.ha;return new Proxy(q,{get(y,D){if("function"===typeof y[D])return function(...w){return y[D].apply(y,w)};if("function"===typeof z[D]){if(-1<ka.indexOf(D))throw Error("RiveException: Method call to '"+D+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...w){q.na.push(z[D].bind(z,...w))}}return y[D]},set(y,D,w){if(D in z)return q.na.push(()=>{z[D]=w}),!0}})};l.decodeImage=function(k,
|
|
386
|
+
q){(new v({Ba:q})).decode(k)};l.renderFactory={makeRenderPaint:function(){return new G},makeRenderPath:function(){return new I},makeRenderImage:function(){let k=Sa;return new v({Ka:()=>{k.total++},Ba:()=>{k.loaded++;if(k.loaded===k.total){const q=k.ready;q&&(q(),k.ready=null)}}})}};let Z=l.load,Sa=null;l.load=function(k,q,z=!0){const y=new l.FallbackFileAssetLoader;void 0!==q&&y.addLoader(q);z&&(q=new l.CDNFileAssetLoader,y.addLoader(q));return new Promise(function(D){let w=null;Sa={total:0,loaded:0,
|
|
387
|
+
ready:function(){D(w)}};w=Z(k,y);0==Sa.total&&D(w)})};let ec=l.RendererWrapper.prototype.align;l.RendererWrapper.prototype.align=function(k,q,z,y,D=1){ec.call(this,k,q,z,y,D)};d=new ea;l.requestAnimationFrame=d.requestAnimationFrame.bind(d);l.cancelAnimationFrame=d.cancelAnimationFrame.bind(d);l.enableFPSCounter=d.Nb.bind(d);l.disableFPSCounter=d.Kb;d.rb=c;l.resolveAnimationFrame=c;l.cleanup=function(){E&&E.delete()}};var na="./this.program";ba&&(_scriptName=self.location.href);var oa="",ra,sa;
|
|
388
|
+
if(aa||ba){try{oa=(new URL(".",_scriptName)).href}catch{}ba&&(sa=b=>{var a=new XMLHttpRequest;a.open("GET",b,!1);a.responseType="arraybuffer";a.send(null);return new Uint8Array(a.response)});ra=async b=>{if(ta(b))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var a=await fetch(b,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+
|
|
389
|
+
" : "+a.url);}}var ua=console.log.bind(console),va=console.error.bind(console),wa,xa=!1,ya,ta=b=>b.startsWith("file://"),za,Ba,Ca,B,Da,Ea,Fa,J,Ga,Ha,Ia,Ja,Ka=!1;function La(){var b=Ma.buffer;l.HEAP8=Ca=new Int8Array(b);Da=new Int16Array(b);l.HEAPU8=B=new Uint8Array(b);l.HEAPU16=Ea=new Uint16Array(b);l.HEAP32=Fa=new Int32Array(b);l.HEAPU32=J=new Uint32Array(b);l.HEAPF32=Ga=new Float32Array(b);Ha=new Float64Array(b);Ia=new BigInt64Array(b);Ja=new BigUint64Array(b)}
|
|
390
|
+
function Na(b){l.onAbort?.(b);b="Aborted("+b+")";va(b);xa=!0;b=new WebAssembly.RuntimeError(b+". Build with -sASSERTIONS for more info.");Ba?.(b);throw b;}var Oa;async function Pa(b){if(!wa)try{var a=await ra(b);return new Uint8Array(a)}catch{}if(b==Oa&&wa)b=new Uint8Array(wa);else if(sa)b=sa(b);else throw"both async and sync fetching of the wasm failed";return b}
|
|
391
|
+
async function Qa(b,a){try{var c=await Pa(b);return await WebAssembly.instantiate(c,a)}catch(d){va(`failed to asynchronously prepare wasm: ${d}`),Na(d)}}async function Ta(b){var a=Oa;if(!wa&&!ta(a))try{var c=fetch(a,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,b)}catch(d){va(`wasm streaming compile failed: ${d}`),va("falling back to ArrayBuffer instantiation")}return Qa(a,b)}
|
|
392
|
+
class Ua{name="ExitStatus";constructor(b){this.message=`Program terminated with exit(${b})`;this.status=b}}
|
|
393
|
+
var Va=b=>{for(;0<b.length;)b.shift()(l)},Wa=[],Xa=[],Ya=()=>{var b=l.preRun.shift();Xa.push(b)},Za=!0,$a=(b,a)=>Object.defineProperty(a,"name",{value:b}),ab=[],bb=[0,1,,1,null,1,!0,1,!1,1],K=class extends Error{constructor(b){super(b);this.name="BindingError"}},N=b=>{if(!b)throw new K(`Cannot use deleted val. handle = ${b}`);return bb[b]},P=b=>{switch(b){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const a=ab.pop()||bb.length;bb[a]=b;bb[a+1]=1;return a}};
|
|
394
|
+
class cb extends Error{}
|
|
395
|
+
var Q=b=>{for(var a="";;){var c=B[b++];if(!c)return a;a+=String.fromCharCode(c)}},db={},eb=(b,a)=>{if(void 0===a)throw new K("ptr should not be undefined");for(;b.ga;)a=b.Ca(a),b=b.ga;return a},fb={},ib=b=>{b=gb(b);var a=Q(b);hb(b);return a},jb=(b,a)=>{var c=fb[b];if(void 0===c)throw b=`${a} has unknown type ${ib(b)}`,new K(b);return c},kb=()=>{},lb=!1,mb=b=>{if(!globalThis.FinalizationRegistry)return mb=a=>a,b;lb=new FinalizationRegistry(a=>{a=a.$;--a.count.value;0===a.count.value&&(a.ia?a.oa.qa(a.ia):
|
|
396
|
+
a.da.aa.qa(a.ca))});mb=a=>{var c=a.$;c.ia&&lb.register(a,{$:c},a);return a};kb=a=>{lb.unregister(a)};return mb(b)},nb={},sb=b=>{for(;b.length;){var a=b.pop();b.pop()(a)}};function tb(b){return this.ba(J[b>>2])}
|
|
397
|
+
var ub={},vb={},wb=class extends Error{constructor(b){super(b);this.name="InternalError"}},V=(b,a,c)=>{function d(g){g=c(g);if(g.length!==b.length)throw new wb("Mismatched type converter count");for(var m=0;m<b.length;++m)T(b[m],g[m])}b.forEach(g=>vb[g]=a);var e=Array(a.length),f=[],h=0;for(let [g,m]of a.entries())fb.hasOwnProperty(m)?e[g]=fb[m]:(f.push(m),ub.hasOwnProperty(m)||(ub[m]=[]),ub[m].push(()=>{e[g]=fb[m];++h;h===f.length&&d(e)}));0===f.length&&d(e)};
|
|
398
|
+
function xb(b,a,c={}){var d=a.name;if(!b)throw new K(`type "${d}" must have a positive integer typeid pointer`);if(fb.hasOwnProperty(b)){if(c.Vb)return;throw new K(`Cannot register type '${d}' twice`);}fb[b]=a;delete vb[b];ub.hasOwnProperty(b)&&(a=ub[b],delete ub[b],a.forEach(e=>e()))}function T(b,a,c={}){return xb(b,a,c)}
|
|
399
|
+
var yb=(b,a,c)=>{switch(a){case 1:return c?d=>Ca[d]:d=>B[d];case 2:return c?d=>Da[d>>1]:d=>Ea[d>>1];case 4:return c?d=>Fa[d>>2]:d=>J[d>>2];case 8:return c?d=>Ia[d>>3]:d=>Ja[d>>3];default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},zb=b=>{throw new K(b.$.da.aa.name+" instance already deleted");},Ab=[];function Bb(){}
|
|
400
|
+
var Cb={},Db=(b,a,c)=>{if(void 0===b[a].fa){var d=b[a];b[a]=function(...e){if(!b[a].fa.hasOwnProperty(e.length))throw new K(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${b[a].fa})!`);return b[a].fa[e.length].apply(this,e)};b[a].fa=[];b[a].fa[d.ta]=d}},Eb=(b,a,c)=>{if(l.hasOwnProperty(b)){if(void 0===c||void 0!==l[b].fa&&void 0!==l[b].fa[c])throw new K(`Cannot register public name '${b}' twice`);Db(l,b,b);if(l[b].fa.hasOwnProperty(c))throw new K(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
|
|
401
|
+
l[b].fa[c]=a}else l[b]=a,l[b].ta=c},Fb=b=>{b=b.replace(/[^a-zA-Z0-9_]/g,"$");var a=b.charCodeAt(0);return 48<=a&&57>=a?`_${b}`:b};function Gb(b,a,c,d,e,f,h,g){this.name=b;this.constructor=a;this.pa=c;this.qa=d;this.ga=e;this.Qb=f;this.Ca=h;this.Lb=g;this.sb=[]}
|
|
402
|
+
var Hb=(b,a,c)=>{for(;a!==c;){if(!a.Ca)throw new K(`Expected null or instance of ${c.name}, got an instance of ${a.name}`);b=a.Ca(b);a=a.ga}return b},Ib=b=>{if(null===b)return"null";var a=typeof b;return"object"===a||"array"===a||"function"===a?b.toString():""+b};
|
|
403
|
+
function Jb(b,a){if(null===a){if(this.Xa)throw new K(`null is not a valid ${this.name}`);return 0}if(!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);return Hb(a.$.ca,a.$.da.aa,this.aa)}
|
|
404
|
+
function Kb(b,a){if(null===a){if(this.Xa)throw new K(`null is not a valid ${this.name}`);if(this.Ja){var c=this.Za();null!==b&&b.push(this.qa,c);return c}return 0}if(!a||!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ia&&a.$.da.Ia)throw new K(`Cannot convert argument of type ${a.$.oa?a.$.oa.name:a.$.da.name} to parameter type ${this.name}`);c=Hb(a.$.ca,a.$.da.aa,this.aa);if(this.Ja){if(void 0===
|
|
405
|
+
a.$.ia)throw new K("Passing raw pointer to smart pointer is illegal");switch(this.hc){case 0:if(a.$.oa===this)c=a.$.ia;else throw new K(`Cannot convert argument of type ${a.$.oa?a.$.oa.name:a.$.da.name} to parameter type ${this.name}`);break;case 1:c=a.$.ia;break;case 2:if(a.$.oa===this)c=a.$.ia;else{var d=a.clone();c=this.cc(c,P(()=>d["delete"]()));null!==b&&b.push(this.qa,c)}break;default:throw new K("Unsupported sharing policy");}}return c}
|
|
406
|
+
function Lb(b,a){if(null===a){if(this.Xa)throw new K(`null is not a valid ${this.name}`);return 0}if(!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(a.$.da.Ia)throw new K(`Cannot convert argument of type ${a.$.da.name} to parameter type ${this.name}`);return Hb(a.$.ca,a.$.da.aa,this.aa)}
|
|
407
|
+
var Mb=(b,a,c)=>{if(a===c)return b;if(void 0===c.ga)return null;b=Mb(b,a,c.ga);return null===b?null:c.Lb(b)},Nb=(b,a)=>{a=eb(b,a);return db[a]},Ob=(b,a)=>{if(!a.da||!a.ca)throw new wb("makeClassHandle requires ptr and ptrType");if(!!a.oa!==!!a.ia)throw new wb("Both smartPtrType and smartPtr must be specified");a.count={value:1};return mb(Object.create(b,{$:{value:a,writable:!0}}))};
|
|
408
|
+
function Pb(b,a,c,d,e,f,h,g,m,n,u){this.name=b;this.aa=a;this.Xa=c;this.Ia=d;this.Ja=e;this.bc=f;this.hc=h;this.tb=g;this.Za=m;this.cc=n;this.qa=u;e||void 0!==a.ga?this.ea=Kb:(this.ea=d?Jb:Lb,this.ka=null)}var Qb=(b,a,c)=>{if(!l.hasOwnProperty(b))throw new wb("Replacing nonexistent public symbol");void 0!==l[b].fa&&void 0!==c?l[b].fa[c]=a:(l[b]=a,l[b].ta=c)},X=(b,a)=>{b=Q(b);var c=Rb.get(a);if("function"!=typeof c)throw new K(`unknown function pointer with signature ${b}: ${a}`);return c};
|
|
409
|
+
class Sb extends Error{}var Y=(b,a)=>{function c(f){e[f]||fb[f]||(vb[f]?vb[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};a.forEach(c);throw new Sb(`${b}: `+d.map(ib).join([", "]));};function Tb(b){for(var a=1;a<b.length;++a)if(null!==b[a]&&void 0===b[a].ka)return!0;return!1}
|
|
410
|
+
function Ub(b,a,c,d,e){var f=a.length;if(2>f)throw new K("argTypes array size mismatch! Must at least get return value and 'this' types!");var h=null!==a[1]&&null!==c,g=Tb(a),m=!a[0].Xb,n=f-2,u=Array(n),A=[],x=[];return $a(b,function(...t){x.length=0;A.length=h?2:1;A[0]=e;if(h){var v=a[1].ea(x,this);A[1]=v}for(var p=0;p<n;++p)u[p]=a[p+2].ea(x,t[p]),A.push(u[p]);t=d(...A);if(g)sb(x);else for(p=h?1:2;p<a.length;p++){var I=1===p?v:u[p-2];null!==a[p].ka&&a[p].ka(I)}v=m?a[0].ba(t):void 0;return v})}
|
|
411
|
+
var Vb=(b,a)=>{for(var c=[],d=0;d<b;d++)c.push(J[a+4*d>>2]);return c},Wb=b=>{b=b.trim();const a=b.indexOf("(");return-1===a?b:b.slice(0,a)},Xb=(b,a,c)=>{if(!(b instanceof Object))throw new K(`${c} with invalid "this": ${b}`);if(!(b instanceof a.aa.constructor))throw new K(`${c} incompatible with "this" of type ${b.constructor.name}`);if(!b.$.ca)throw new K(`cannot call emscripten binding method ${c} on deleted object`);return Hb(b.$.ca,b.$.da.aa,a.aa)},Yb=b=>{9<b&&0===--bb[b+1]&&(bb[b]=void 0,ab.push(b))},
|
|
412
|
+
Zb={name:"emscripten::val",ba:b=>{var a=N(b);Yb(b);return a},ea:(b,a)=>P(a),ma:tb,ka:null},$b=(b,a,c)=>{switch(a){case 1:return c?function(d){return this.ba(Ca[d])}:function(d){return this.ba(B[d])};case 2:return c?function(d){return this.ba(Da[d>>1])}:function(d){return this.ba(Ea[d>>1])};case 4:return c?function(d){return this.ba(Fa[d>>2])}:function(d){return this.ba(J[d>>2])};default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},ac=(b,a)=>{switch(a){case 4:return function(c){return this.ba(Ga[c>>
|
|
413
|
+
2])};case 8:return function(c){return this.ba(Ha[c>>3])};default:throw new TypeError(`invalid float width (${a}): ${b}`);}},bc=(b,a,c)=>{var d=B;if(!(0<c))return 0;var e=a;c=a+c-1;for(var f=0;f<b.length;++f){var h=b.codePointAt(f);if(127>=h){if(a>=c)break;d[a++]=h}else if(2047>=h){if(a+1>=c)break;d[a++]=192|h>>6;d[a++]=128|h&63}else if(65535>=h){if(a+2>=c)break;d[a++]=224|h>>12;d[a++]=128|h>>6&63;d[a++]=128|h&63}else{if(a+3>=c)break;d[a++]=240|h>>18;d[a++]=128|h>>12&63;d[a++]=128|h>>6&63;d[a++]=128|
|
|
412
414
|
h&63;f++}}d[a]=0;return a-e},fc=b=>{for(var a=0,c=0;c<b.length;++c){var d=b.charCodeAt(c);127>=d?a++:2047>=d?a+=2:55296<=d&&57343>=d?(a+=4,++c):a+=3}return a},gc=globalThis.TextDecoder&&new TextDecoder,hc=(b,a,c,d)=>{c=a+c;if(d)return c;for(;b[a]&&!(a>=c);)++a;return a},ic=(b,a=0,c,d)=>{c=hc(b,a,c,d);if(16<c-a&&b.buffer&&gc)return gc.decode(b.subarray(a,c));for(d="";a<c;){var e=b[a++];if(e&128){var f=b[a++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var h=b[a++]&63;e=224==(e&240)?
|
|
413
415
|
(e&15)<<12|f<<6|h:(e&7)<<18|f<<12|h<<6|b[a++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},jc=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,kc=(b,a,c)=>{b>>=1;a=hc(Ea,b,a/2,c);if(16<a-b&&jc)return jc.decode(Ea.subarray(b,a));for(c="";b<a;++b)c+=String.fromCharCode(Ea[b]);return c},lc=(b,a,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=a;c=c<2*b.length?c/2:b.length;for(var e=0;e<c;++e)Da[a>>1]=
|
|
414
416
|
b.charCodeAt(e),a+=2;Da[a>>1]=0;return a-d},mc=b=>2*b.length,nc=(b,a,c)=>{var d="";b>>=2;for(var e=0;!(e>=a/4);e++){var f=J[b+e];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},oc=(b,a,c)=>{c??=2147483647;if(4>c)return 0;var d=a;c=d+c-4;for(var e=0;e<b.length;++e){var f=b.codePointAt(e);65535<f&&e++;Fa[a>>2]=f;a+=4;if(a+4>c)break}Fa[a>>2]=0;return a-d},pc=b=>{for(var a=0,c=0;c<b.length;++c)65535<b.codePointAt(c)&&c++,a+=4;return a},qc=0,rc=[],sc=b=>{var a=rc.length;rc.push(b);return a},tc=(b,
|
|
415
|
-
a)=>{for(var c=Array(b),d=0;d<b;++d)c[d]=
|
|
416
|
-
"_")+".UTF-8",_:
|
|
417
|
-
(()=>{let b=Bb.prototype;Object.assign(b,{isAliasOf:function(c){if(!(this instanceof Bb&&c instanceof Bb))return!1;var d=this.$.da.aa,e=this.$.ca;c.$=c.$;var f=c.$.da.aa;for(c=c.$.ca;d.
|
|
418
|
-
1;c.$.
|
|
417
|
+
a)=>{for(var c=Array(b),d=0;d<b;++d)c[d]=jb(J[a+4*d>>2],`parameter ${d}`);return c},uc={},vc=b=>{var a=uc[b];return void 0===a?Q(b):a},wc={},xc=b=>{if(!(b instanceof Ua||"unwind"==b))throw b;},yc=b=>{ya=b;Za||0<qc||(l.onExit?.(b),xa=!0);throw new Ua(b);},zc=b=>{if(!xa)try{if(b(),!(Za||0<qc))try{ya=b=ya,yc(b)}catch(a){xc(a)}}catch(a){xc(a)}},Ac={},Cc=()=>{if(!Bc){var b={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-",
|
|
418
|
+
"_")+".UTF-8",_:na||"./this.program"},a;for(a in Ac)void 0===Ac[a]?delete b[a]:b[a]=Ac[a];var c=[];for(a in b)c.push(`${a}=${b[a]}`);Bc=c}return Bc},Bc,Dc=[null,[],[]];
|
|
419
|
+
(()=>{let b=Bb.prototype;Object.assign(b,{isAliasOf:function(c){if(!(this instanceof Bb&&c instanceof Bb))return!1;var d=this.$.da.aa,e=this.$.ca;c.$=c.$;var f=c.$.da.aa;for(c=c.$.ca;d.ga;)e=d.Ca(e),d=d.ga;for(;f.ga;)c=f.Ca(c),f=f.ga;return d===f&&e===c},clone:function(){this.$.ca||zb(this);if(this.$.xa)return this.$.count.value+=1,this;var c=mb,d=Object,e=d.create,f=Object.getPrototypeOf(this),h=this.$;c=c(e.call(d,f,{$:{value:{count:h.count,Aa:h.Aa,xa:h.xa,ca:h.ca,da:h.da,ia:h.ia,oa:h.oa}}}));c.$.count.value+=
|
|
420
|
+
1;c.$.Aa=!1;return c},["delete"](){this.$.ca||zb(this);if(this.$.Aa&&!this.$.xa)throw new K("Object already scheduled for deletion");kb(this);var c=this.$;--c.count.value;0===c.count.value&&(c.ia?c.oa.qa(c.ia):c.da.aa.qa(c.ca));this.$.xa||(this.$.ia=void 0,this.$.ca=void 0)},isDeleted:function(){return!this.$.ca},deleteLater:function(){this.$.ca||zb(this);if(this.$.Aa&&!this.$.xa)throw new K("Object already scheduled for deletion");Ab.push(this);this.$.Aa=!0;return this}});const a=Symbol.dispose;
|
|
419
421
|
a&&(b[a]=b["delete"])})();
|
|
420
|
-
Object.assign(Pb.prototype,{
|
|
421
|
-
e?a.call(this):this.
|
|
422
|
-
var
|
|
423
|
-
!0;Object.defineProperties(this,{$:{value:m}});
|
|
424
|
-
a.
|
|
425
|
-
t);return t},
|
|
426
|
-
[d])});
|
|
427
|
-
v.prototype=
|
|
428
|
-
u),
|
|
429
|
-
};Object.defineProperty(m.aa.constructor,a,u);
|
|
430
|
-
g.aa.
|
|
431
|
-
(Db(
|
|
432
|
-
u,
|
|
433
|
-
{};T(b,{name:a,
|
|
434
|
-
d;break;case "number":d.
|
|
435
|
-
c)=>{function d(f){return new e(Ca.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][a];c=Q(c);T(b,{name:c,ba:d,
|
|
436
|
-
var f=e?fc(d):d.length;var h=Ec(4+f+1),g=h+4;J[h>>2]=f;e?bc(d,g,f+1):
|
|
437
|
-
|
|
438
|
-
case 3:v=g[0];break;case 1:v=
|
|
422
|
+
Object.assign(Pb.prototype,{Rb(b){this.tb&&(b=this.tb(b));return b},lb(b){this.qa?.(b)},ma:tb,ba:function(b){function a(){return this.Ja?Ob(this.aa.pa,{da:this.bc,ca:c,oa:this,ia:b}):Ob(this.aa.pa,{da:this,ca:b})}var c=this.Rb(b);if(!c)return this.lb(b),null;var d=Nb(this.aa,c);if(void 0!==d){if(0===d.$.count.value)return d.$.ca=c,d.$.ia=b,d.clone();d=d.clone();this.lb(b);return d}d=this.aa.Qb(c);d=Cb[d];if(!d)return a.call(this);d=this.Ia?d.Hb:d.pointerType;var e=Mb(c,this.aa,d.aa);return null===
|
|
423
|
+
e?a.call(this):this.Ja?Ob(d.aa.pa,{da:d,ca:e,oa:this,ia:b}):Ob(d.aa.pa,{da:d,ca:e})}});l.noExitRuntime&&(Za=l.noExitRuntime);l.print&&(ua=l.print);l.printErr&&(va=l.printErr);l.wasmBinary&&(wa=l.wasmBinary);l.thisProgram&&(na=l.thisProgram);if(l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.shift()();
|
|
424
|
+
var hb,Ec,gb,Fc,Ma,Rb,Gc={E:()=>Na(""),n:(b,a,c)=>{b=Q(b);a=jb(a,"wrapper");c=N(c);var d=a.aa,e=d.pa,f=d.ga.pa,h=d.ga.constructor;b=$a(b,function(...g){for(var m of d.ga.sb)if(this[m]===f[m])throw new cb(`Pure virtual function ${m} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:e});this.__construct(...g)});e.__construct=function(...g){if(this===e)throw new K("Pass correct 'this' to __construct");g=h.implement(this,...g);kb(g);var m=g.$;g.notifyOnDestruction();m.xa=
|
|
425
|
+
!0;Object.defineProperties(this,{$:{value:m}});mb(this);g=m.ca;g=eb(d,g);if(db.hasOwnProperty(g))throw new K(`Tried to register registered instance: ${g}`);db[g]=this};e.__destruct=function(){if(this===e)throw new K("Pass correct 'this' to __destruct");kb(this);var g=this.$.ca;g=eb(d,g);if(db.hasOwnProperty(g))delete db[g];else throw new K(`Tried to unregister unregistered instance: ${g}`);};b.prototype=Object.create(e);Object.assign(b.prototype,c);return P(b)},N:b=>{var a=nb[b];delete nb[b];var c=
|
|
426
|
+
a.Za,d=a.qa,e=a.ob,f=e.map(h=>h.Ub).concat(e.map(h=>h.ec));V([b],f,h=>{var g={},m,n;for([m,n]of e.entries()){const u=h[m],A=n.Sb,x=n.Tb,t=h[m+e.length],v=n.dc,p=n.fc;g[n.Ob]={read:I=>u.ba(A(x,I)),write:(I,G)=>{var r=[];v(p,I,t.ea(r,G));sb(r)},optional:u.optional}}return[{name:a.name,ba:u=>{var A={},x;for(x in g)A[x]=g[x].read(u);d(u);return A},ea:(u,A)=>{for(var x in g)if(!(x in A||g[x].optional))throw new TypeError(`Missing field: "${x}"`);var t=c();for(x in g)g[x].write(t,A[x]);null!==u&&u.push(d,
|
|
427
|
+
t);return t},ma:tb,ka:d}]})},r:(b,a,c,d,e)=>{a=Q(a);d=0n===d;let f=h=>h;if(d){const h=8*c;f=g=>BigInt.asUintN(h,g);e=f(e)}T(b,{name:a,ba:f,ea:(h,g)=>{"number"==typeof g&&(g=BigInt(g));return g},ma:yb(a,c,!d),ka:null})},H:(b,a,c,d)=>{a=Q(a);T(b,{name:a,ba:function(e){return!!e},ea:function(e,f){return f?c:d},ma:function(e){return this.ba(B[e])},ka:null})},c:(b,a,c,d,e,f,h,g,m,n,u,A,x)=>{u=Q(u);f=X(e,f);g&&=X(h,g);n&&=X(m,n);x=X(A,x);var t=Fb(u);Eb(t,function(){Y(`Cannot construct ${u} due to unbound types`,
|
|
428
|
+
[d])});V([b,a,c],d?[d]:[],v=>{v=v[0];if(d){var p=v.aa;var I=p.pa}else I=Bb.prototype;v=$a(u,function(...L){if(Object.getPrototypeOf(this)!==G)throw new K(`Use 'new' to construct ${u}`);if(void 0===r.ua)throw new K(`${u} has no accessible constructor`);var O=r.ua[L.length];if(void 0===O)throw new K(`Tried to invoke ctor of ${u} with invalid number of parameters (${L.length}) - expected (${Object.keys(r.ua).toString()}) parameters instead!`);return O.apply(this,L)});var G=Object.create(I,{constructor:{value:v}});
|
|
429
|
+
v.prototype=G;var r=new Gb(u,v,G,x,p,f,g,n);if(r.ga){var E;(E=r.ga).Ea??(E.Ea=[]);r.ga.Ea.push(r)}p=new Pb(u,r,!0,!1,!1);E=new Pb(u+"*",r,!1,!1,!1);I=new Pb(u+" const*",r,!1,!0,!1);Cb[b]={pointerType:E,Hb:I};Qb(t,v);return[p,E,I]})},j:(b,a,c,d,e,f,h)=>{var g=Vb(c,d);a=Q(a);a=Wb(a);f=X(e,f);V([],[b],m=>{function n(){Y(`Cannot call ${u} due to unbound types`,g)}m=m[0];var u=`${m.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);var A=m.aa.constructor;void 0===A[a]?(n.ta=c-1,A[a]=n):(Db(A,a,
|
|
430
|
+
u),A[a].fa[c-1]=n);V([],g,x=>{x=Ub(u,[x[0],null].concat(x.slice(1)),null,f,h);void 0===A[a].fa?(x.ta=c-1,A[a]=x):A[a].fa[c-1]=x;if(m.aa.Ea)for(const t of m.aa.Ea)t.constructor.hasOwnProperty(a)||(t.constructor[a]=x);return[]});return[]})},p:(b,a,c,d,e,f,h,g)=>{a=Q(a);f=X(e,f);V([],[b],m=>{m=m[0];var n=`${m.name}.${a}`,u={get(){Y(`Cannot access ${n} due to unbound types`,[c])},enumerable:!0,configurable:!0};u.set=g?()=>{Y(`Cannot access ${n} due to unbound types`,[c])}:()=>{throw new K(`${n} is a read-only property`);
|
|
431
|
+
};Object.defineProperty(m.aa.constructor,a,u);V([],[c],A=>{A=A[0];var x={get(){return A.ba(f(d))},enumerable:!0};g&&(g=X(h,g),x.set=t=>{var v=[];g(d,A.ea(v,t));sb(v)});Object.defineProperty(m.aa.constructor,a,x);return[]});return[]})},m:(b,a,c,d,e,f)=>{var h=Vb(a,c);e=X(d,e);V([],[b],g=>{g=g[0];var m=`constructor ${g.name}`;void 0===g.aa.ua&&(g.aa.ua=[]);if(void 0!==g.aa.ua[a-1])throw new K(`Cannot register multiple constructors with identical number of parameters (${a-1}) for class '${g.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
432
|
+
g.aa.ua[a-1]=()=>{Y(`Cannot construct ${g.name} due to unbound types`,h)};V([],h,n=>{n.splice(1,0,null);g.aa.ua[a-1]=Ub(m,n,null,e,f);return[]});return[]})},a:(b,a,c,d,e,f,h,g)=>{var m=Vb(c,d);a=Q(a);a=Wb(a);f=X(e,f);V([],[b],n=>{function u(){Y(`Cannot call ${A} due to unbound types`,m)}n=n[0];var A=`${n.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);g&&n.aa.sb.push(a);var x=n.aa.pa,t=x[a];void 0===t||void 0===t.fa&&t.className!==n.name&&t.ta===c-2?(u.ta=c-2,u.className=n.name,x[a]=u):
|
|
433
|
+
(Db(x,a,A),x[a].fa[c-2]=u);V([],m,v=>{v=Ub(A,v,n,f,h);void 0===x[a].fa?(v.ta=c-2,x[a]=v):x[a].fa[c-2]=v;return[]});return[]})},b:(b,a,c,d,e,f,h,g,m,n)=>{a=Q(a);e=X(d,e);V([],[b],u=>{u=u[0];var A=`${u.name}.${a}`,x={get(){Y(`Cannot access ${A} due to unbound types`,[c,h])},enumerable:!0,configurable:!0};x.set=m?()=>Y(`Cannot access ${A} due to unbound types`,[c,h]):()=>{throw new K(A+" is a read-only property");};Object.defineProperty(u.aa.pa,a,x);V([],m?[c,h]:[c],t=>{var v=t[0],p={get(){var G=Xb(this,
|
|
434
|
+
u,A+" getter");return v.ba(e(f,G))},enumerable:!0};if(m){m=X(g,m);var I=t[1];p.set=function(G){var r=Xb(this,u,A+" setter"),E=[];m(n,r,I.ea(E,G));sb(E)}}Object.defineProperty(u.aa.pa,a,p);return[]});return[]})},F:b=>T(b,Zb),l:(b,a,c,d,e)=>{a=Q(a);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function h(){}h.values={};T(b,{name:a,constructor:h,valueType:e,ba:function(g){return this.constructor.values[g]},ea:(g,m)=>m.value,ma:$b(a,c,d),ka:null});Eb(a,h);break;case "number":var f=
|
|
435
|
+
{};T(b,{name:a,Ya:f,valueType:e,ba:g=>g,ea:(g,m)=>m,ma:$b(a,c,d),ka:null});Eb(a,f);delete l[a].ta;break;case "string":f={},T(b,{name:a,zb:{},ub:{},Ya:f,valueType:e,ba:function(g){return this.ub[g]},ea:function(g,m){return this.zb[m]},ma:$b(a,c,d),ka:null}),Eb(a,f),delete l[a].ta}},d:(b,a,c)=>{var d=jb(b,"enum");a=Q(a);switch(d.valueType){case "object":b=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:$a(`${d.name}_${a}`,function(){})}});b.values[c]=d;b[a]=
|
|
436
|
+
d;break;case "number":d.Ya[a]=c;break;case "string":d.zb[a]=c,d.ub[c]=a,d.Ya[a]=a}},q:(b,a,c)=>{a=Q(a);T(b,{name:a,ba:d=>d,ea:(d,e)=>e,ma:ac(a,c),ka:null})},i:(b,a,c,d,e,f)=>{var h=Vb(a,c);b=Q(b);b=Wb(b);e=X(d,e);Eb(b,function(){Y(`Cannot call ${b} due to unbound types`,h)},a-1);V([],h,g=>{Qb(b,Ub(b,[g[0],null].concat(g.slice(1)),null,e,f),a-1);return[]})},k:(b,a,c,d,e)=>{a=Q(a);let f=g=>g;if(0===d){var h=32-8*c;f=g=>g<<h>>>h;e=f(e)}T(b,{name:a,ba:f,ea:(g,m)=>m,ma:yb(a,c,0!==d),ka:null})},h:(b,a,
|
|
437
|
+
c)=>{function d(f){return new e(Ca.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][a];c=Q(c);T(b,{name:c,ba:d,ma:d},{Vb:!0})},G:(b,a)=>{a=Q(a);T(b,{name:a,ba(c){var d=(d=c+4)?ic(B,d,J[c>>2],!0):"";hb(c);return d},ea(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new K("Cannot pass non-string to std::string");
|
|
438
|
+
var f=e?fc(d):d.length;var h=Ec(4+f+1),g=h+4;J[h>>2]=f;e?bc(d,g,f+1):B.set(d,g);null!==c&&c.push(hb,h);return h},ma:tb,ka(c){hb(c)}})},o:(b,a,c)=>{c=Q(c);if(2===a){var d=kc;var e=lc;var f=mc}else d=nc,e=oc,f=pc;T(b,{name:c,ba:h=>{var g=d(h+4,J[h>>2]*a,!0);hb(h);return g},ea:(h,g)=>{if("string"!=typeof g)throw new K(`Cannot pass non-string to C++ string type ${c}`);var m=f(g),n=Ec(4+m+a);J[n>>2]=m/a;e(g,n+4,m+a);null!==h&&h.push(hb,n);return n},ma:tb,ka(h){hb(h)}})},P:(b,a,c,d,e,f)=>{nb[b]={name:Q(a),
|
|
439
|
+
Za:X(c,d),qa:X(e,f),ob:[]}},O:(b,a,c,d,e,f,h,g,m,n)=>{nb[b].ob.push({Ob:Q(a),Ub:c,Sb:X(d,e),Tb:f,ec:h,dc:X(g,m),fc:n})},I:(b,a)=>{a=Q(a);T(b,{Xb:!0,name:a,ba:()=>{},ea:()=>{}})},u:()=>{Za=!1;qc=0},f:(b,a,c)=>{var [d,...e]=tc(b,a),f=d.ea.bind(d),h=e.map(m=>m.ma.bind(m));b--;var g=Array(b);a=`methodCaller<(${e.map(m=>m.name)}) => ${d.name}>`;return sc($a(a,(m,n,u,A)=>{for(var x=0,t=0;t<b;++t)g[t]=h[t](A+x),x+=8;switch(c){case 0:var v=N(m).apply(null,g);break;case 2:v=Reflect.construct(N(m),g);break;
|
|
440
|
+
case 3:v=g[0];break;case 1:v=N(m)[vc(n)](...g)}m=[];v=f(m,v);m.length&&(J[u>>2]=P(m));return v}))},R:Yb,J:b=>{b=vc(b);return P(l[b])},K:(b,a)=>{b=N(b);a=N(a);return P(b[a])},L:b=>{9<b&&(bb[b+1]+=1)},e:(b,a,c,d,e)=>rc[b](a,c,d,e),M:()=>P([]),s:b=>P(vc(b)),S:()=>P({}),Q:b=>{var a=N(b);sb(a);Yb(b)},g:(b,a,c)=>{b=N(b);a=N(a);c=N(c);b[a]=c},v:(b,a)=>{wc[b]&&(clearTimeout(wc[b].id),delete wc[b]);if(!a)return 0;var c=setTimeout(()=>{delete wc[b];zc(()=>Fc(b,performance.now()))},a);wc[b]={id:c,jc:a};return 0},
|
|
439
441
|
w:(b,a,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();J[b>>2]=60*Math.max(f,e);Fa[a>>2]=Number(f!=e);a=h=>{var g=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(g/60)).padStart(2,"0")}${String(g%60).padStart(2,"0")}`};b=a(f);a=a(e);e<f?(bc(b,c,17),bc(a,d,17)):(bc(b,d,17),bc(a,c,17))},z:function(b,a,c){if(!(0<=b&&3>=b))return 28;Ia[c>>3]=BigInt(Math.round(1E6*(0===b?Date.now():performance.now())));return 0},A:b=>{var a=
|
|
440
|
-
|
|
441
|
-
C:(b,a,c,d)=>{for(var e=0,f=0;f<c;f++){var h=J[a>>2],g=J[a+4>>2];a+=8;for(var m=0;m<g;m++){var n=b,u=
|
|
442
|
-
Hc=await (async function(){function b(c){c=Hc=c.exports;
|
|
443
|
-
(function(){function b(){
|
|
442
|
+
B.length;b>>>=0;if(2147483648<b)return!1;for(var c=1;4>=c;c*=2){var d=a*(1+.2/c);d=Math.min(d,b+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(b,d)/65536))-Ma.buffer.byteLength+65535)/65536|0;try{Ma.grow(d);La();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},x:(b,a)=>{var c=0,d=0,e;for(e of Cc()){var f=a+c;J[b+d>>2]=f;c+=bc(e,f,Infinity)+1;d+=4}return 0},y:(b,a)=>{var c=Cc();J[b>>2]=c.length;b=0;for(var d of c)b+=fc(d)+1;J[a>>2]=b;return 0},D:()=>52,B:function(){return 70},
|
|
443
|
+
C:(b,a,c,d)=>{for(var e=0,f=0;f<c;f++){var h=J[a>>2],g=J[a+4>>2];a+=8;for(var m=0;m<g;m++){var n=b,u=B[h+m],A=Dc[n];0===u||10===u?((1===n?ua:va)(ic(A)),A.length=0):A.push(u)}e+=g}J[d>>2]=e;return 0},t:yc},Hc;
|
|
444
|
+
Hc=await (async function(){function b(c){c=Hc=c.exports;hb=c.V;Ec=c.W;gb=c.X;Fc=c.Z;Ma=c.T;Rb=c.Y;La();return Hc}var a={a:Gc};if(l.instantiateWasm)return new Promise(c=>{l.instantiateWasm(a,(d,e)=>{c(b(d,e))})});Oa??=l.locateFile?l.locateFile("canvas_advanced.wasm",oa):oa+"canvas_advanced.wasm";return b((await Ta(a)).instance)}());
|
|
445
|
+
(function(){function b(){l.calledRun=!0;if(!xa){Ka=!0;Hc.U();za?.(l);l.onRuntimeInitialized?.();if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var a=l.postRun.shift();Wa.push(a)}Va(Wa)}}if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)Ya();Va(Xa);l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1);b()},1)):b()})();Ka?moduleRtn=l:moduleRtn=new Promise((b,a)=>{za=b;Ba=a});
|
|
444
446
|
;return moduleRtn}})();
|
|
445
447
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
|
|
446
448
|
|
|
@@ -449,7 +451,7 @@ Hc=await (async function(){function b(c){c=Hc=c.exports;gb=c.V;Ec=c.W;fb=c.X;Fc=
|
|
|
449
451
|
/* 5 */
|
|
450
452
|
/***/ ((module) => {
|
|
451
453
|
|
|
452
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.
|
|
454
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.41.1","description":"A lite version of Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
453
455
|
|
|
454
456
|
/***/ }),
|
|
455
457
|
/* 6 */
|
|
@@ -458,12 +460,16 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","versi
|
|
|
458
460
|
__webpack_require__.r(__webpack_exports__);
|
|
459
461
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
460
462
|
/* harmony export */ AccessibilityOverlay: () => (/* reexport safe */ _accessibilityOverlay__WEBPACK_IMPORTED_MODULE_1__.AccessibilityOverlay),
|
|
463
|
+
/* harmony export */ CHECK_STATE_MASK: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.CHECK_STATE_MASK),
|
|
464
|
+
/* harmony export */ CHECK_STATE_OFFSET: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.CHECK_STATE_OFFSET),
|
|
461
465
|
/* harmony export */ SemanticActionType: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticActionType),
|
|
466
|
+
/* harmony export */ SemanticCheckState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticCheckState),
|
|
462
467
|
/* harmony export */ SemanticMode: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticMode),
|
|
463
468
|
/* harmony export */ SemanticRole: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticRole),
|
|
464
469
|
/* harmony export */ SemanticState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticState),
|
|
465
470
|
/* harmony export */ SemanticTrait: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticTrait),
|
|
466
471
|
/* harmony export */ SemanticTreeModel: () => (/* reexport safe */ _semanticTreeModel__WEBPACK_IMPORTED_MODULE_0__.SemanticTreeModel),
|
|
472
|
+
/* harmony export */ checkStateOf: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.checkStateOf),
|
|
467
473
|
/* harmony export */ hasState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.hasState),
|
|
468
474
|
/* harmony export */ hasTrait: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.hasTrait),
|
|
469
475
|
/* harmony export */ roleName: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.roleName),
|
|
@@ -928,11 +934,15 @@ function applyGeometry(target, src) {
|
|
|
928
934
|
|
|
929
935
|
__webpack_require__.r(__webpack_exports__);
|
|
930
936
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
937
|
+
/* harmony export */ CHECK_STATE_MASK: () => (/* binding */ CHECK_STATE_MASK),
|
|
938
|
+
/* harmony export */ CHECK_STATE_OFFSET: () => (/* binding */ CHECK_STATE_OFFSET),
|
|
931
939
|
/* harmony export */ SemanticActionType: () => (/* binding */ SemanticActionType),
|
|
940
|
+
/* harmony export */ SemanticCheckState: () => (/* binding */ SemanticCheckState),
|
|
932
941
|
/* harmony export */ SemanticMode: () => (/* binding */ SemanticMode),
|
|
933
942
|
/* harmony export */ SemanticRole: () => (/* binding */ SemanticRole),
|
|
934
943
|
/* harmony export */ SemanticState: () => (/* binding */ SemanticState),
|
|
935
944
|
/* harmony export */ SemanticTrait: () => (/* binding */ SemanticTrait),
|
|
945
|
+
/* harmony export */ checkStateOf: () => (/* binding */ checkStateOf),
|
|
936
946
|
/* harmony export */ hasState: () => (/* binding */ hasState),
|
|
937
947
|
/* harmony export */ hasTrait: () => (/* binding */ hasTrait),
|
|
938
948
|
/* harmony export */ roleName: () => (/* binding */ roleName),
|
|
@@ -967,14 +977,17 @@ var SemanticRole = {
|
|
|
967
977
|
//
|
|
968
978
|
// Bits 0-7 are trait-gated (only meaningful when the corresponding
|
|
969
979
|
// SemanticTrait is set). Bits 8-13 are non-trait states.
|
|
980
|
+
//
|
|
981
|
+
// Check state is the exception: it is a two-bit *field* at bits 2-3 rather
|
|
982
|
+
// than a flag, because a checkbox is tri-state. It is not a member of this
|
|
983
|
+
// table — read it with checkStateOf().
|
|
970
984
|
// ---------------------------------------------------------------------------
|
|
971
985
|
var SemanticState = {
|
|
972
986
|
None: 0,
|
|
973
987
|
// Trait-gated
|
|
974
988
|
Expanded: 1 << 0, // requires Expandable
|
|
975
989
|
Selected: 1 << 1, // requires Selectable
|
|
976
|
-
|
|
977
|
-
Mixed: 1 << 3, // requires Checkable; wins over Checked
|
|
990
|
+
// Bits 2-3 are the check state field, not independent flags -- see SemanticCheckState.
|
|
978
991
|
Toggled: 1 << 4, // requires Toggleable
|
|
979
992
|
Required: 1 << 5, // requires Requirable
|
|
980
993
|
Disabled: 1 << 6, // requires Enablable
|
|
@@ -990,6 +1003,30 @@ var SemanticState = {
|
|
|
990
1003
|
function hasState(flags, state) {
|
|
991
1004
|
return (flags & state) !== 0;
|
|
992
1005
|
}
|
|
1006
|
+
// SemanticCheckState — mirrors rive::SemanticCheckState
|
|
1007
|
+
//
|
|
1008
|
+
// The tri-state of a checkable node. Occupies two bits of stateFlags at
|
|
1009
|
+
// CHECK_STATE_OFFSET, so it is read as a value rather than tested as a flag.
|
|
1010
|
+
// Only meaningful when the Checkable trait is set.
|
|
1011
|
+
var SemanticCheckState = {
|
|
1012
|
+
Unchecked: 0,
|
|
1013
|
+
Checked: 1,
|
|
1014
|
+
Mixed: 2,
|
|
1015
|
+
};
|
|
1016
|
+
/** Bit offset of the check field within stateFlags. */
|
|
1017
|
+
var CHECK_STATE_OFFSET = 2;
|
|
1018
|
+
/** Mask of the check field within stateFlags. */
|
|
1019
|
+
var CHECK_STATE_MASK = 3 << CHECK_STATE_OFFSET;
|
|
1020
|
+
/**
|
|
1021
|
+
* Decodes the check field out of `flags`. The field is two bits. Returns 0, 1, or 2
|
|
1022
|
+
* per the mapping in SemanticCheckState.
|
|
1023
|
+
*/
|
|
1024
|
+
function checkStateOf(flags) {
|
|
1025
|
+
var value = (flags & CHECK_STATE_MASK) >> CHECK_STATE_OFFSET;
|
|
1026
|
+
return value >= SemanticCheckState.Mixed
|
|
1027
|
+
? SemanticCheckState.Mixed
|
|
1028
|
+
: value;
|
|
1029
|
+
}
|
|
993
1030
|
/**
|
|
994
1031
|
* Controls when the instance builds semantic trees and accessibility overlays.
|
|
995
1032
|
*
|
|
@@ -1056,6 +1093,14 @@ function stateNames(flags) {
|
|
|
1056
1093
|
if (flags & bit)
|
|
1057
1094
|
active.push(name_2);
|
|
1058
1095
|
}
|
|
1096
|
+
switch (checkStateOf(flags)) {
|
|
1097
|
+
case SemanticCheckState.Checked:
|
|
1098
|
+
active.push("Checked");
|
|
1099
|
+
break;
|
|
1100
|
+
case SemanticCheckState.Mixed:
|
|
1101
|
+
active.push("Mixed");
|
|
1102
|
+
break;
|
|
1103
|
+
}
|
|
1059
1104
|
return active.join(", ") || "none";
|
|
1060
1105
|
}
|
|
1061
1106
|
function traitNames(flags) {
|
|
@@ -1824,13 +1869,15 @@ var AccessibilityOverlay = /** @class */ (function () {
|
|
|
1824
1869
|
removeAttr(el, "aria-selected");
|
|
1825
1870
|
}
|
|
1826
1871
|
if ((0,_types__WEBPACK_IMPORTED_MODULE_0__.hasTrait)(traits, _types__WEBPACK_IMPORTED_MODULE_0__.SemanticTrait.Checkable) && ARIA_CHECKED_ROLES.has(role)) {
|
|
1827
|
-
//
|
|
1828
|
-
//
|
|
1829
|
-
|
|
1872
|
+
// Check state is a tri-state field, but not every checkable role
|
|
1873
|
+
// accepts all three values — see ARIA_MIXED_ROLES.
|
|
1874
|
+
var checkState = (0,_types__WEBPACK_IMPORTED_MODULE_0__.checkStateOf)(flags);
|
|
1875
|
+
if (checkState === _types__WEBPACK_IMPORTED_MODULE_0__.SemanticCheckState.Mixed &&
|
|
1876
|
+
ARIA_MIXED_ROLES.has(role)) {
|
|
1830
1877
|
setAttr(el, "aria-checked", "mixed");
|
|
1831
1878
|
}
|
|
1832
1879
|
else {
|
|
1833
|
-
setBoolAttr(el, "aria-checked",
|
|
1880
|
+
setBoolAttr(el, "aria-checked", checkState === _types__WEBPACK_IMPORTED_MODULE_0__.SemanticCheckState.Checked);
|
|
1834
1881
|
}
|
|
1835
1882
|
}
|
|
1836
1883
|
else {
|
|
@@ -2090,6 +2137,15 @@ var ARIA_CHECKED_ROLES = new Set([
|
|
|
2090
2137
|
_types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.radioButton,
|
|
2091
2138
|
_types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.switchControl,
|
|
2092
2139
|
]);
|
|
2140
|
+
/**
|
|
2141
|
+
* aria-checked="mixed": checkbox only. ARIA defines checkbox as three-valued
|
|
2142
|
+
* (true/false/mixed) but radio and switch as two-valued (true/false), so an
|
|
2143
|
+
* indeterminate check state degrades to false for those roles rather than
|
|
2144
|
+
* emitting a value they do not support.
|
|
2145
|
+
*/
|
|
2146
|
+
var ARIA_MIXED_ROLES = new Set([
|
|
2147
|
+
_types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.checkbox,
|
|
2148
|
+
]);
|
|
2093
2149
|
/**
|
|
2094
2150
|
* aria-pressed: button only. switch is a button subclass in ARIA but uses
|
|
2095
2151
|
* aria-checked (not aria-pressed) for its on/off state — it is intentionally
|
|
@@ -3574,6 +3630,12 @@ var Layout = /** @class */ (function () {
|
|
|
3574
3630
|
|
|
3575
3631
|
// #endregion
|
|
3576
3632
|
// #region state machines
|
|
3633
|
+
/**
|
|
3634
|
+
* @deprecated State machine inputs are deprecated and will be removed in a
|
|
3635
|
+
* future major version: please use data binding properties instead. See
|
|
3636
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
3637
|
+
* for how to migrate.
|
|
3638
|
+
*/
|
|
3577
3639
|
var StateMachineInputType;
|
|
3578
3640
|
(function (StateMachineInputType) {
|
|
3579
3641
|
StateMachineInputType[StateMachineInputType["Number"] = 56] = "Number";
|
|
@@ -3582,6 +3644,10 @@ var StateMachineInputType;
|
|
|
3582
3644
|
})(StateMachineInputType || (StateMachineInputType = {}));
|
|
3583
3645
|
/**
|
|
3584
3646
|
* An input for a state machine
|
|
3647
|
+
* @deprecated State machine inputs are deprecated and will be removed in a
|
|
3648
|
+
* future major version: please use data binding properties instead. See
|
|
3649
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
3650
|
+
* for how to migrate.
|
|
3585
3651
|
*/
|
|
3586
3652
|
var StateMachineInput = /** @class */ (function () {
|
|
3587
3653
|
function StateMachineInput(type, runtimeInput) {
|
|
@@ -3631,6 +3697,11 @@ var StateMachineInput = /** @class */ (function () {
|
|
|
3631
3697
|
return StateMachineInput;
|
|
3632
3698
|
}());
|
|
3633
3699
|
|
|
3700
|
+
/**
|
|
3701
|
+
* @deprecated Rive Events are deprecated and will be removed in a future major
|
|
3702
|
+
* version: please use data binding instead. See
|
|
3703
|
+
* {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.
|
|
3704
|
+
*/
|
|
3634
3705
|
var RiveEventType;
|
|
3635
3706
|
(function (RiveEventType) {
|
|
3636
3707
|
RiveEventType[RiveEventType["General"] = 128] = "General";
|
|
@@ -4173,6 +4244,12 @@ var Animator = /** @class */ (function () {
|
|
|
4173
4244
|
var instancedName;
|
|
4174
4245
|
if (this.animations.length === 0 && this.stateMachines.length === 0) {
|
|
4175
4246
|
if (this.artboard.animationCount() > 0) {
|
|
4247
|
+
// Warn only when the v3 default would actually change what plays
|
|
4248
|
+
if (this.artboard.stateMachineCount() > 0) {
|
|
4249
|
+
warnOnce("No `stateMachine` was specified, so the artboard's first linear animation is playing by default. " +
|
|
4250
|
+
"In the next major version, the artboard's state machine will be played by default instead when one exists. " +
|
|
4251
|
+
"Pass the `stateMachine` parameter to adopt that behavior now.");
|
|
4252
|
+
}
|
|
4176
4253
|
// Add the first animation
|
|
4177
4254
|
this.add([(instancedName = this.artboard.animationByIndex(0).name)], playing, fireEvent);
|
|
4178
4255
|
}
|
|
@@ -4251,15 +4328,84 @@ var EventType;
|
|
|
4251
4328
|
EventType["Play"] = "play";
|
|
4252
4329
|
EventType["Pause"] = "pause";
|
|
4253
4330
|
EventType["Stop"] = "stop";
|
|
4331
|
+
/**
|
|
4332
|
+
* @deprecated Loop events are deprecated and will be removed in a future
|
|
4333
|
+
* major version: they are only reported for linear animation playback, which
|
|
4334
|
+
* is deprecated. Use a state machine to control playback and data binding to
|
|
4335
|
+
* react to changes instead. See
|
|
4336
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide} for how
|
|
4337
|
+
* to migrate.
|
|
4338
|
+
*/
|
|
4254
4339
|
EventType["Loop"] = "loop";
|
|
4255
4340
|
EventType["Draw"] = "draw";
|
|
4256
4341
|
EventType["Advance"] = "advance";
|
|
4342
|
+
/**
|
|
4343
|
+
* @deprecated State change events are deprecated and will be removed in a
|
|
4344
|
+
* future major version. Use data binding (view model property observers) or
|
|
4345
|
+
* state machine actions to react to changes from your graphic instead. See
|
|
4346
|
+
* {@link https://rive.app/docs/editor/state-machine/states#actions} for more details.
|
|
4347
|
+
*/
|
|
4257
4348
|
EventType["StateChange"] = "statechange";
|
|
4349
|
+
/**
|
|
4350
|
+
* @deprecated Rive Events are deprecated and will be removed in a future
|
|
4351
|
+
* major version: please use data binding instead. See
|
|
4352
|
+
* {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.
|
|
4353
|
+
*/
|
|
4258
4354
|
EventType["RiveEvent"] = "riveevent";
|
|
4259
4355
|
EventType["AudioStatusChange"] = "audiostatuschange";
|
|
4260
4356
|
})(EventType || (EventType = {}));
|
|
4357
|
+
var riveEventsDeprecationWarning = "Rive Events are deprecated and will be removed in a future major version: " +
|
|
4358
|
+
"please use data binding instead. See " +
|
|
4359
|
+
"https://rive.app/docs/runtimes/web/rive-events for how to migrate.";
|
|
4360
|
+
var stateMachineInputsDeprecationWarning = "State machine inputs are deprecated and will be removed in a future major version: " +
|
|
4361
|
+
"please use data binding properties instead. See " +
|
|
4362
|
+
"https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.";
|
|
4363
|
+
var textRunsDeprecationWarning = "Text run APIs are deprecated and will be removed in a future major version: " +
|
|
4364
|
+
"please use data binding instead. See " +
|
|
4365
|
+
"https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.";
|
|
4366
|
+
var loopEventsDeprecationWarning = "Loop events are deprecated and will be removed in a future major version: " +
|
|
4367
|
+
"they are only reported for linear animation playback, which is deprecated. " +
|
|
4368
|
+
"Use a state machine to control playback and data binding to react to changes instead. See " +
|
|
4369
|
+
"https://rive.app/docs/editor/data-binding/migration-guide for how to migrate.";
|
|
4370
|
+
var stateChangeEventsDeprecationWarning = "State change events are deprecated and will be removed in a future major version: " +
|
|
4371
|
+
"use data binding (view model property observers) or state machine actions to react to " +
|
|
4372
|
+
"changes from your graphic instead. See " +
|
|
4373
|
+
"https://rive.app/docs/editor/state-machine/states#actions for how to migrate.";
|
|
4374
|
+
// Deprecation warnings already emitted; each is logged at most once per page
|
|
4375
|
+
// session to avoid flooding the console when many instances are created.
|
|
4376
|
+
var emittedWarnings = new Set();
|
|
4377
|
+
var warnOnce = function (message) {
|
|
4378
|
+
if (!emittedWarnings.has(message)) {
|
|
4379
|
+
emittedWarnings.add(message);
|
|
4380
|
+
console.warn("[Rive] ".concat(message));
|
|
4381
|
+
}
|
|
4382
|
+
};
|
|
4383
|
+
/**
|
|
4384
|
+
* Warns that a playback-control method received an array of names; the next
|
|
4385
|
+
* major version restricts these parameters to a single string, since playing
|
|
4386
|
+
* multiple animations or state machines at once will not be supported.
|
|
4387
|
+
*/
|
|
4388
|
+
var warnIfNamesArray = function (names, methodName) {
|
|
4389
|
+
if (Array.isArray(names)) {
|
|
4390
|
+
warnOnce("Passing an array of names to `".concat(methodName, "()` is deprecated: in the next major version this parameter will be a single string, and playing multiple animations or state machines at once will not be supported."));
|
|
4391
|
+
}
|
|
4392
|
+
};
|
|
4393
|
+
/**
|
|
4394
|
+
* Warns that a playback-control method received linear animation names;
|
|
4395
|
+
* name-based control remains supported for state machines only, so
|
|
4396
|
+
* user-specified linear animation names are going away in a future major
|
|
4397
|
+
* version.
|
|
4398
|
+
*/
|
|
4399
|
+
var warnDeprecatedAnimationNames = function (methodName) {
|
|
4400
|
+
warnOnce("Passing linear animation names to `".concat(methodName, "()` is deprecated and will be removed in a future major version: ") +
|
|
4401
|
+
"Pass a single state machine name to control playback instead.");
|
|
4402
|
+
};
|
|
4261
4403
|
/**
|
|
4262
4404
|
* Looping types: one-shot, loop, and ping-pong
|
|
4405
|
+
* @deprecated Loop events are deprecated and will be removed in a future major
|
|
4406
|
+
* version: they are only reported for linear animation playback, which is
|
|
4407
|
+
* deprecated. Use a state machine to control playback and data binding to
|
|
4408
|
+
* react to changes instead.
|
|
4263
4409
|
*/
|
|
4264
4410
|
var LoopType;
|
|
4265
4411
|
(function (LoopType) {
|
|
@@ -4573,6 +4719,31 @@ var observers = new ObjectObservers();
|
|
|
4573
4719
|
// #endregion
|
|
4574
4720
|
// #region Rive
|
|
4575
4721
|
var nextRiveInstanceId = 0;
|
|
4722
|
+
/**
|
|
4723
|
+
* Resolves which animation/state machine names playback should start with.
|
|
4724
|
+
* The `stateMachine` parameter takes priority; the deprecated plural
|
|
4725
|
+
* `animations`/`stateMachines` parameters apply only when it
|
|
4726
|
+
* is not provided.
|
|
4727
|
+
*/
|
|
4728
|
+
var resolveStartingPlayback = function (_a) {
|
|
4729
|
+
var stateMachine = _a.stateMachine, animations = _a.animations, stateMachines = _a.stateMachines;
|
|
4730
|
+
if (animations !== undefined) {
|
|
4731
|
+
warnOnce("The `animations` parameter is deprecated and will be removed in a future major version: please use the `stateMachine` parameter to play a state machine instead.");
|
|
4732
|
+
}
|
|
4733
|
+
if (stateMachines !== undefined) {
|
|
4734
|
+
warnOnce("The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead.");
|
|
4735
|
+
}
|
|
4736
|
+
if (stateMachine) {
|
|
4737
|
+
return {
|
|
4738
|
+
startingAnimationNames: [],
|
|
4739
|
+
startingStateMachineNames: [stateMachine],
|
|
4740
|
+
};
|
|
4741
|
+
}
|
|
4742
|
+
return {
|
|
4743
|
+
startingAnimationNames: mapToStringArray(animations),
|
|
4744
|
+
startingStateMachineNames: mapToStringArray(stateMachines),
|
|
4745
|
+
};
|
|
4746
|
+
};
|
|
4576
4747
|
var RiveFile = /** @class */ (function () {
|
|
4577
4748
|
function RiveFile(params) {
|
|
4578
4749
|
// Allow the runtime to automatically load assets hosted in Rive's runtime.
|
|
@@ -4994,6 +5165,10 @@ var Rive = /** @class */ (function () {
|
|
|
4994
5165
|
this.layout = (_a = params.layout) !== null && _a !== void 0 ? _a : new Layout();
|
|
4995
5166
|
this.shouldDisableRiveListeners = !!params.shouldDisableRiveListeners;
|
|
4996
5167
|
this.isTouchScrollEnabled = !!params.isTouchScrollEnabled;
|
|
5168
|
+
if (params.automaticallyHandleEvents) {
|
|
5169
|
+
warnOnce("The `automaticallyHandleEvents` parameter is deprecated. " +
|
|
5170
|
+
riveEventsDeprecationWarning);
|
|
5171
|
+
}
|
|
4997
5172
|
this.automaticallyHandleEvents = !!params.automaticallyHandleEvents;
|
|
4998
5173
|
this.dispatchPointerExit =
|
|
4999
5174
|
params.dispatchPointerExit === false
|
|
@@ -5058,6 +5233,7 @@ var Rive = /** @class */ (function () {
|
|
|
5058
5233
|
riveFile: this.riveFile,
|
|
5059
5234
|
autoplay: params.autoplay,
|
|
5060
5235
|
autoBind: params.autoBind,
|
|
5236
|
+
stateMachine: params.stateMachine,
|
|
5061
5237
|
animations: params.animations,
|
|
5062
5238
|
stateMachines: params.stateMachines,
|
|
5063
5239
|
artboard: params.artboard,
|
|
@@ -5124,7 +5300,7 @@ var Rive = /** @class */ (function () {
|
|
|
5124
5300
|
// Initializes the Rive object either from constructor or load()
|
|
5125
5301
|
Rive.prototype.init = function (_a) {
|
|
5126
5302
|
var _this = this;
|
|
5127
|
-
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d, tabIndex = _a.tabIndex, semanticsMode = _a.semanticsMode, semanticsOptions = _a.semanticsOptions;
|
|
5303
|
+
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, stateMachine = _a.stateMachine, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d, tabIndex = _a.tabIndex, semanticsMode = _a.semanticsMode, semanticsOptions = _a.semanticsOptions;
|
|
5128
5304
|
if (this.destroyed) {
|
|
5129
5305
|
return;
|
|
5130
5306
|
}
|
|
@@ -5138,10 +5314,12 @@ var Rive = /** @class */ (function () {
|
|
|
5138
5314
|
if (!this.src && !this.buffer && !this.riveFile) {
|
|
5139
5315
|
throw new RiveError(Rive.missingErrorMessage);
|
|
5140
5316
|
}
|
|
5141
|
-
//
|
|
5142
|
-
var
|
|
5143
|
-
|
|
5144
|
-
|
|
5317
|
+
// Names of the animations and state machines that should be initialized
|
|
5318
|
+
var _e = resolveStartingPlayback({
|
|
5319
|
+
stateMachine: stateMachine,
|
|
5320
|
+
animations: animations,
|
|
5321
|
+
stateMachines: stateMachines,
|
|
5322
|
+
}), startingAnimationNames = _e.startingAnimationNames, startingStateMachineNames = _e.startingStateMachineNames;
|
|
5145
5323
|
// Ensure loaded is marked as false if loading new file
|
|
5146
5324
|
this.loaded = false;
|
|
5147
5325
|
this.readyForPlaying = false;
|
|
@@ -5858,6 +6036,7 @@ var Rive = /** @class */ (function () {
|
|
|
5858
6036
|
* might happen.
|
|
5859
6037
|
*/
|
|
5860
6038
|
Rive.prototype.cleanupInstances = function () {
|
|
6039
|
+
var _a;
|
|
5861
6040
|
if (this.eventCleanup !== null) {
|
|
5862
6041
|
this.eventCleanup();
|
|
5863
6042
|
}
|
|
@@ -5865,8 +6044,9 @@ var Rive = /** @class */ (function () {
|
|
|
5865
6044
|
// Tear down semantics before deleting state machines — the overlay's action
|
|
5866
6045
|
// closures point at instances that stop() is about to free.
|
|
5867
6046
|
this.cleanupSemantics();
|
|
5868
|
-
// Delete all animation and state machine instances
|
|
5869
|
-
|
|
6047
|
+
// Delete all animation and state machine instances synchronously via the
|
|
6048
|
+
// animator
|
|
6049
|
+
(_a = this.animator) === null || _a === void 0 ? void 0 : _a.stop();
|
|
5870
6050
|
if (this.artboard) {
|
|
5871
6051
|
this.artboard.delete();
|
|
5872
6052
|
this.artboard = null;
|
|
@@ -5899,29 +6079,58 @@ var Rive = /** @class */ (function () {
|
|
|
5899
6079
|
* Returns a string from a given text run node name, or undefined if the text run
|
|
5900
6080
|
* cannot be queried.
|
|
5901
6081
|
*
|
|
6082
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6083
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6084
|
+
* for how to migrate.
|
|
5902
6085
|
* @param textRunName - Name of the text run node associated with a text object
|
|
5903
6086
|
* @returns - String value of the text run node or undefined
|
|
5904
6087
|
*/
|
|
5905
6088
|
Rive.prototype.getTextRunValue = function (textRunName) {
|
|
6089
|
+
warnOnce(textRunsDeprecationWarning);
|
|
5906
6090
|
var textRun = this.retrieveTextRun(textRunName);
|
|
5907
6091
|
return textRun ? textRun.text : undefined;
|
|
5908
6092
|
};
|
|
5909
6093
|
/**
|
|
5910
6094
|
* Sets a text value for a given text run node name if possible
|
|
5911
6095
|
*
|
|
6096
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6097
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6098
|
+
* for how to migrate.
|
|
5912
6099
|
* @param textRunName - Name of the text run node associated with a text object
|
|
5913
6100
|
* @param textRunValue - String value to set on the text run node
|
|
5914
6101
|
*/
|
|
5915
6102
|
Rive.prototype.setTextRunValue = function (textRunName, textRunValue) {
|
|
6103
|
+
warnOnce(textRunsDeprecationWarning);
|
|
5916
6104
|
var textRun = this.retrieveTextRun(textRunName);
|
|
5917
6105
|
if (textRun) {
|
|
5918
6106
|
textRun.text = textRunValue;
|
|
5919
6107
|
}
|
|
5920
6108
|
};
|
|
5921
|
-
|
|
6109
|
+
/**
|
|
6110
|
+
* Warns when playback-control names match linear animations in the
|
|
6111
|
+
* Animator's instanced context; state machine playback remain supported.
|
|
6112
|
+
*
|
|
6113
|
+
* Remove for v3 release
|
|
6114
|
+
*/
|
|
6115
|
+
Rive.prototype.warnIfLinearAnimationNames = function (names, methodName) {
|
|
6116
|
+
if (this.animator &&
|
|
6117
|
+
this.animator.animations.some(function (a) { return names.includes(a.name); })) {
|
|
6118
|
+
warnDeprecatedAnimationNames(methodName);
|
|
6119
|
+
}
|
|
6120
|
+
};
|
|
6121
|
+
/**
|
|
6122
|
+
* Plays specified animations or state machines; if none specified, it
|
|
6123
|
+
* unpauses everything.
|
|
6124
|
+
* @param animationNames Animation or state machine name(s) to play.
|
|
6125
|
+
*
|
|
6126
|
+
* Deprecated usage: passing linear animation names (control playback with a
|
|
6127
|
+
* state machine instead) and passing an array of names (this parameter
|
|
6128
|
+
* becomes a single string in the next major version).
|
|
6129
|
+
*/
|
|
5922
6130
|
Rive.prototype.play = function (animationNames, autoplay) {
|
|
5923
6131
|
var _this = this;
|
|
5924
|
-
animationNames
|
|
6132
|
+
warnIfNamesArray(animationNames, "play");
|
|
6133
|
+
var names = mapToStringArray(animationNames);
|
|
5925
6134
|
// If the file's not loaded, queue up the play
|
|
5926
6135
|
if (!this.readyForPlaying) {
|
|
5927
6136
|
this.taskQueue.add({
|
|
@@ -5929,7 +6138,8 @@ var Rive = /** @class */ (function () {
|
|
|
5929
6138
|
});
|
|
5930
6139
|
return;
|
|
5931
6140
|
}
|
|
5932
|
-
this.animator.play(
|
|
6141
|
+
this.animator.play(names);
|
|
6142
|
+
this.warnIfLinearAnimationNames(names, "play");
|
|
5933
6143
|
this.syncSemanticsOnStateMachines();
|
|
5934
6144
|
if (this.eventCleanup) {
|
|
5935
6145
|
this.eventCleanup();
|
|
@@ -5938,10 +6148,19 @@ var Rive = /** @class */ (function () {
|
|
|
5938
6148
|
this.setupRiveListeners();
|
|
5939
6149
|
this.startRendering();
|
|
5940
6150
|
};
|
|
5941
|
-
|
|
6151
|
+
/**
|
|
6152
|
+
* Pauses specified animations or state machines; if none specified, pauses
|
|
6153
|
+
* all.
|
|
6154
|
+
* @param animationNames Animation or state machine name(s) to pause.
|
|
6155
|
+
*
|
|
6156
|
+
* Deprecated usage: passing linear animation names (control playback with a
|
|
6157
|
+
* state machine instead) and passing an array of names (this parameter
|
|
6158
|
+
* becomes a single string in the next major version).
|
|
6159
|
+
*/
|
|
5942
6160
|
Rive.prototype.pause = function (animationNames) {
|
|
5943
6161
|
var _this = this;
|
|
5944
|
-
animationNames
|
|
6162
|
+
warnIfNamesArray(animationNames, "pause");
|
|
6163
|
+
var names = mapToStringArray(animationNames);
|
|
5945
6164
|
// If the file's not loaded, early out, nothing to pause
|
|
5946
6165
|
if (!this.readyForPlaying) {
|
|
5947
6166
|
this.taskQueue.add({
|
|
@@ -5953,11 +6172,20 @@ var Rive = /** @class */ (function () {
|
|
|
5953
6172
|
this.eventCleanup();
|
|
5954
6173
|
}
|
|
5955
6174
|
this.cleanupKeyboardInteractions();
|
|
5956
|
-
this.animator.pause(
|
|
6175
|
+
this.animator.pause(names);
|
|
6176
|
+
this.warnIfLinearAnimationNames(names, "pause");
|
|
5957
6177
|
};
|
|
6178
|
+
/**
|
|
6179
|
+
* Scrubs specified animations to the given time; if none specified, scrubs
|
|
6180
|
+
* all of them.
|
|
6181
|
+
* @deprecated `scrub()` will be removed in a future major version: use a
|
|
6182
|
+
* state machine to control playback instead
|
|
6183
|
+
*/
|
|
5958
6184
|
Rive.prototype.scrub = function (animationNames, value) {
|
|
5959
6185
|
var _this = this;
|
|
5960
|
-
|
|
6186
|
+
warnOnce("`scrub()` is deprecated and will be removed in a future major version: " +
|
|
6187
|
+
"use a state machine to control playback instead.");
|
|
6188
|
+
var names = mapToStringArray(animationNames);
|
|
5961
6189
|
// If the file's not loaded, early out, nothing to pause
|
|
5962
6190
|
if (!this.readyForPlaying) {
|
|
5963
6191
|
this.taskQueue.add({
|
|
@@ -5967,13 +6195,22 @@ var Rive = /** @class */ (function () {
|
|
|
5967
6195
|
}
|
|
5968
6196
|
// Scrub the animation time; we draw a single frame here so that if
|
|
5969
6197
|
// nothing's currently playing, the scrubbed animation is still rendered/
|
|
5970
|
-
this.animator.scrub(
|
|
6198
|
+
this.animator.scrub(names, value || 0);
|
|
5971
6199
|
this.drawFrame();
|
|
5972
6200
|
};
|
|
5973
|
-
|
|
6201
|
+
/**
|
|
6202
|
+
* Stops specified animations or state machines; if none specified, stops
|
|
6203
|
+
* them all.
|
|
6204
|
+
* @param animationNames Animation or state machine name(s) to stop.
|
|
6205
|
+
*
|
|
6206
|
+
* Deprecated usage: passing linear animation names (control playback with a
|
|
6207
|
+
* state machine instead) and passing an array of names (this parameter
|
|
6208
|
+
* becomes a single string in the next major version).
|
|
6209
|
+
*/
|
|
5974
6210
|
Rive.prototype.stop = function (animationNames) {
|
|
5975
6211
|
var _this = this;
|
|
5976
|
-
animationNames
|
|
6212
|
+
warnIfNamesArray(animationNames, "stop");
|
|
6213
|
+
var names = mapToStringArray(animationNames);
|
|
5977
6214
|
// If the file's not loaded, early out, nothing to pause
|
|
5978
6215
|
if (!this.readyForPlaying) {
|
|
5979
6216
|
this.taskQueue.add({
|
|
@@ -5981,9 +6218,10 @@ var Rive = /** @class */ (function () {
|
|
|
5981
6218
|
});
|
|
5982
6219
|
return;
|
|
5983
6220
|
}
|
|
6221
|
+
this.warnIfLinearAnimationNames(names, "stop");
|
|
5984
6222
|
// If there is no artboard, this.animator will be undefined
|
|
5985
6223
|
if (this.animator) {
|
|
5986
|
-
this.animator.stop(
|
|
6224
|
+
this.animator.stop(names);
|
|
5987
6225
|
}
|
|
5988
6226
|
if (this.eventCleanup) {
|
|
5989
6227
|
this.eventCleanup();
|
|
@@ -5994,8 +6232,7 @@ var Rive = /** @class */ (function () {
|
|
|
5994
6232
|
/**
|
|
5995
6233
|
* Resets the animation
|
|
5996
6234
|
* @param artboard the name of the artboard, or default if none given
|
|
5997
|
-
* @param
|
|
5998
|
-
* @param stateMachines the names of state machines for playback
|
|
6235
|
+
* @param stateMachine the name of the state machine for playback
|
|
5999
6236
|
* @param autoplay whether to autoplay when reset, defaults to false
|
|
6000
6237
|
*
|
|
6001
6238
|
*/
|
|
@@ -6003,15 +6240,22 @@ var Rive = /** @class */ (function () {
|
|
|
6003
6240
|
var _a, _b;
|
|
6004
6241
|
// Get the current artboard, animations, state machines, and playback states
|
|
6005
6242
|
var artBoardName = params === null || params === void 0 ? void 0 : params.artboard;
|
|
6006
|
-
var
|
|
6007
|
-
|
|
6243
|
+
var _c = resolveStartingPlayback({
|
|
6244
|
+
stateMachine: params === null || params === void 0 ? void 0 : params.stateMachine,
|
|
6245
|
+
animations: params === null || params === void 0 ? void 0 : params.animations,
|
|
6246
|
+
stateMachines: params === null || params === void 0 ? void 0 : params.stateMachines,
|
|
6247
|
+
}), animationNames = _c.startingAnimationNames, stateMachineNames = _c.startingStateMachineNames;
|
|
6008
6248
|
var autoplay = (_a = params === null || params === void 0 ? void 0 : params.autoplay) !== null && _a !== void 0 ? _a : false;
|
|
6009
6249
|
var autoBind = (_b = params === null || params === void 0 ? void 0 : params.autoBind) !== null && _b !== void 0 ? _b : false;
|
|
6010
6250
|
// Stop everything and clean up
|
|
6011
6251
|
this.cleanupInstances();
|
|
6012
6252
|
// Reinitialize an artboard instance with the state
|
|
6013
6253
|
this.initArtboard(artBoardName, animationNames, stateMachineNames, autoplay, autoBind);
|
|
6014
|
-
|
|
6254
|
+
// Only drain the task queue once playback commands can execute; tasks
|
|
6255
|
+
// queued before then re-add themselves in a loop.
|
|
6256
|
+
if (this.readyForPlaying) {
|
|
6257
|
+
this.taskQueue.process();
|
|
6258
|
+
}
|
|
6015
6259
|
};
|
|
6016
6260
|
// Loads a new Rive file, keeping listeners in place
|
|
6017
6261
|
Rive.prototype.load = function (params) {
|
|
@@ -6166,11 +6410,18 @@ var Rive = /** @class */ (function () {
|
|
|
6166
6410
|
});
|
|
6167
6411
|
/**
|
|
6168
6412
|
* Returns the inputs for the specified instanced state machine, or an empty
|
|
6169
|
-
* list if the name is invalid or the state machine is not instanced
|
|
6413
|
+
* list if the name is invalid or the state machine is not instanced. Returns
|
|
6414
|
+
* undefined if the file is not loaded yet.
|
|
6415
|
+
*
|
|
6416
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6417
|
+
* properties instead. See
|
|
6418
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6419
|
+
* for how to migrate.
|
|
6170
6420
|
* @param name the state machine name
|
|
6171
|
-
* @returns the inputs for the named state machine
|
|
6421
|
+
* @returns the inputs for the named state machine or undefined
|
|
6172
6422
|
*/
|
|
6173
6423
|
Rive.prototype.stateMachineInputs = function (name) {
|
|
6424
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6174
6425
|
// If the file's not loaded, early out, nothing to pause
|
|
6175
6426
|
if (!this.loaded) {
|
|
6176
6427
|
return;
|
|
@@ -6197,11 +6448,16 @@ var Rive = /** @class */ (function () {
|
|
|
6197
6448
|
};
|
|
6198
6449
|
/**
|
|
6199
6450
|
* Set the boolean input with the provided name at the given path with value
|
|
6451
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6452
|
+
* properties instead. See
|
|
6453
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6454
|
+
* for how to migrate.
|
|
6200
6455
|
* @param input the state machine input name
|
|
6201
6456
|
* @param value the value to set the input to
|
|
6202
6457
|
* @param path the path the input is located at an artboard level
|
|
6203
6458
|
*/
|
|
6204
6459
|
Rive.prototype.setBooleanStateAtPath = function (inputName, value, path) {
|
|
6460
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6205
6461
|
var input = this.retrieveInputAtPath(inputName, path);
|
|
6206
6462
|
if (!input)
|
|
6207
6463
|
return;
|
|
@@ -6214,11 +6470,16 @@ var Rive = /** @class */ (function () {
|
|
|
6214
6470
|
};
|
|
6215
6471
|
/**
|
|
6216
6472
|
* Set the number input with the provided name at the given path with value
|
|
6473
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6474
|
+
* properties instead. See
|
|
6475
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6476
|
+
* for how to migrate.
|
|
6217
6477
|
* @param input the state machine input name
|
|
6218
6478
|
* @param value the value to set the input to
|
|
6219
6479
|
* @param path the path the input is located at an artboard level
|
|
6220
6480
|
*/
|
|
6221
6481
|
Rive.prototype.setNumberStateAtPath = function (inputName, value, path) {
|
|
6482
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6222
6483
|
var input = this.retrieveInputAtPath(inputName, path);
|
|
6223
6484
|
if (!input)
|
|
6224
6485
|
return;
|
|
@@ -6231,10 +6492,15 @@ var Rive = /** @class */ (function () {
|
|
|
6231
6492
|
};
|
|
6232
6493
|
/**
|
|
6233
6494
|
* Fire the trigger with the provided name at the given path
|
|
6495
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6496
|
+
* properties instead. See
|
|
6497
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6498
|
+
* for how to migrate.
|
|
6234
6499
|
* @param input the state machine input name
|
|
6235
6500
|
* @param path the path the input is located at an artboard level
|
|
6236
6501
|
*/
|
|
6237
6502
|
Rive.prototype.fireStateAtPath = function (inputName, path) {
|
|
6503
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6238
6504
|
var input = this.retrieveInputAtPath(inputName, path);
|
|
6239
6505
|
if (!input)
|
|
6240
6506
|
return;
|
|
@@ -6282,8 +6548,13 @@ var Rive = /** @class */ (function () {
|
|
|
6282
6548
|
*
|
|
6283
6549
|
* @remarks
|
|
6284
6550
|
* If the text run cannot be found at the specified path, a warning will be logged to the console.
|
|
6551
|
+
*
|
|
6552
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6553
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6554
|
+
* for how to migrate.
|
|
6285
6555
|
*/
|
|
6286
6556
|
Rive.prototype.getTextRunValueAtPath = function (textName, path) {
|
|
6557
|
+
warnOnce(textRunsDeprecationWarning);
|
|
6287
6558
|
var run = this.retrieveTextAtPath(textName, path);
|
|
6288
6559
|
if (!run) {
|
|
6289
6560
|
console.warn("Could not get text with name: '".concat(textName, "', at path:'").concat(path, "'"));
|
|
@@ -6308,8 +6579,13 @@ var Rive = /** @class */ (function () {
|
|
|
6308
6579
|
*
|
|
6309
6580
|
* @remarks
|
|
6310
6581
|
* If the text run cannot be found at the specified path, a warning will be logged to the console.
|
|
6582
|
+
*
|
|
6583
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6584
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6585
|
+
* for how to migrate.
|
|
6311
6586
|
*/
|
|
6312
6587
|
Rive.prototype.setTextRunValueAtPath = function (textName, value, path) {
|
|
6588
|
+
warnOnce(textRunsDeprecationWarning);
|
|
6313
6589
|
var run = this.retrieveTextAtPath(textName, path);
|
|
6314
6590
|
if (!run) {
|
|
6315
6591
|
console.warn("Could not set text with name: '".concat(textName, "', at path:'").concat(path, "'"));
|
|
@@ -6418,10 +6694,26 @@ var Rive = /** @class */ (function () {
|
|
|
6418
6694
|
});
|
|
6419
6695
|
/**
|
|
6420
6696
|
* Subscribe to Rive-generated events
|
|
6697
|
+
*
|
|
6698
|
+
* Note: subscribing to {@link EventType.RiveEvent},
|
|
6699
|
+
* {@link EventType.StateChange}, or {@link EventType.Loop} is deprecated;
|
|
6700
|
+
* use data binding instead. See
|
|
6701
|
+
* {@link https://rive.app/docs/runtimes/web/rive-events} (Rive Events) and
|
|
6702
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide} for how
|
|
6703
|
+
* to migrate Rive graphics to a data binding workflow instead.
|
|
6421
6704
|
* @param type the type of event to subscribe to
|
|
6422
6705
|
* @param callback callback to fire when the event occurs
|
|
6423
6706
|
*/
|
|
6424
6707
|
Rive.prototype.on = function (type, callback) {
|
|
6708
|
+
if (type === EventType.RiveEvent) {
|
|
6709
|
+
warnOnce(riveEventsDeprecationWarning);
|
|
6710
|
+
}
|
|
6711
|
+
else if (type === EventType.StateChange) {
|
|
6712
|
+
warnOnce(stateChangeEventsDeprecationWarning);
|
|
6713
|
+
}
|
|
6714
|
+
else if (type === EventType.Loop) {
|
|
6715
|
+
warnOnce(loopEventsDeprecationWarning);
|
|
6716
|
+
}
|
|
6425
6717
|
this.eventManager.add({
|
|
6426
6718
|
type: type,
|
|
6427
6719
|
callback: callback,
|