svgcinema-player 1.3.0 → 1.3.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/LICENSE CHANGED
@@ -36,8 +36,8 @@ at any time, at their own discretion and without prior notice:
36
36
  Continuing to use the Software after a change means accepting the changed terms. No permission in
37
37
  these terms is irrevocable, and none limits these rights.
38
38
 
39
- Third-party components included with the Software (such as paper.js, opentype.js and the image
40
- encoders listed in third-party-notices.txt) remain under their own licenses.
39
+ Third-party components included with the Software (such as paper.js and the image encoders
40
+ listed in third-party-notices.txt) remain under their own licenses.
41
41
 
42
42
  Versions of the Software that were published earlier under the PolyForm Noncommercial License
43
43
  1.0.0 stay under that license for those copies. This notice applies from the version that
package/README.md CHANGED
@@ -13,7 +13,7 @@ Once the page has loaded, the loader inside each SVG:
13
13
  change:
14
14
 
15
15
  ```text
16
- https://cdn.jsdelivr.net/npm/svgcinema-player@1.3.0/cin-player.min.js
16
+ https://cdn.jsdelivr.net/npm/svgcinema-player@1.3.1/cin-player.min.js
17
17
  ```
18
18
 
19
19
  The first SVG on the page loads it, and that one copy starts every SVG on the page.
package/cin-player.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! SVGcinema player 1.3.0. Proprietary, see the LICENSE file of the svgcinema-player package. */
2
- "use strict";(()=>{function Ne(g,p){var S={pos:"v",org:"v",p0:"v",p1:"v",rad:"n",ts:"n",te:"n",to:"n",rot:"n",scl:"v",op:"n",fill:"c",stk:"c",sw:"n",d:"m",skw:"v",fo:"n",so:"n",dof:"n",sz:"v",da:"a"},H={ease:[.25,.1,.25,1],in:[.42,0,1,1],out:[0,0,.58,1],inOut:[.42,0,.58,1],inSine:[.12,0,.39,0],outSine:[.61,1,.88,1],inOutSine:[.37,0,.63,1],inQuad:[.11,0,.5,0],outQuad:[.5,1,.89,1],inOutQuad:[.45,0,.55,1],inCubic:[.32,0,.67,0],outCubic:[.33,1,.68,1],inOutCubic:[.65,0,.35,1],inQuart:[.5,0,.75,0],outQuart:[.25,1,.5,1],inOutQuart:[.76,0,.24,1],inQuint:[.64,0,.78,0],outQuint:[.22,1,.36,1],inOutQuint:[.83,0,.17,1],inExpo:[.7,0,.84,0],outExpo:[.16,1,.3,1],inOutExpo:[.87,0,.13,1],inCirc:[.55,0,1,.45],outCirc:[0,.55,.45,1],inOutCirc:[.85,0,.15,1],inBack:[.36,0,.66,-.56],outBack:[.34,1.56,.64,1],inOutBack:[.68,-.6,.32,1.6]},O={},J={},P=2*Math.PI/3,U=2*Math.PI/4.5,T={hold:function(n){return n<1?0:1},outBounce:j,inBounce:function(n){return 1-j(1-n)},inOutBounce:function(n){return n<.5?(1-j(1-2*n))/2:(1+j(2*n-1))/2},outElastic:function(n){return n===0||n===1?n:Math.pow(2,-10*n)*Math.sin((n*10-.75)*P)+1},inElastic:function(n){return n===0||n===1?n:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*P)},inOutElastic:function(n){return n===0||n===1?n:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*U))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*U)/2+1}};function Y(n){var e=3*n[0],r=3*(n[2]-n[0])-e,t=1-e-r,u=3*n[1],a=3*(n[3]-n[1])-u,i=1-u-a;function o(s){return((t*s+r)*s+e)*s}function l(s){return((i*s+a)*s+u)*s}function f(s){return(3*t*s+2*r)*s+e}return function(s){var c=s,b,d,M,h=0,y=1;for(b=0;b<8;b++){if(d=o(c)-s,Math.abs(d)<1e-6)return l(c);if(M=f(c),Math.abs(M)<1e-6)break;c-=d/M}for(c=s;y-h>1e-6&&(d=o(c),!(Math.abs(d-s)<1e-6));)s>d?h=c:y=c,c=(h+y)/2;return l(c)}}function j(n){var e=7.5625,r=2.75;return n<1/r?e*n*n:n<2/r?e*(n-=1.5/r)*n+.75:n<2.5/r?e*(n-=2.25/r)*n+.9375:e*(n-=2.625/r)*n+.984375}function R(n,e){if(!n||n==="linear")return e;if(typeof n!="string"){var r=n.join(",");return(O[r]||(O[r]=Y(n)))(e)}if(T[n])return T[n](e);var t=O[n]||(O[n]=Y(H[n]||H.ease));return t(e)}function Q(n){if(typeof n!="string")return null;var e=n.trim();if(e[0]==="#"){var r=e.slice(1);return(r.length===3||r.length===4)&&(r=r.replace(/./g,"$&$&")),r.length===6&&(r+="ff"),r.length!==8?null:[parseInt(r.substr(0,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(6,2),16)/255]}var t=e.match(/^rgba?\(([^)]+)\)$/);if(t){var u=t[1].split(/[\s,\/]+/).filter(Boolean).map(parseFloat);return u.length===3&&u.push(1),u.length===4?u:null}return null}function L(n){return!!n&&typeof n=="object"&&(n.g==="lin"||n.g==="rad")&&n.s&&n.s.length>0}function vn(n,e){var r=n.s;if(e<=r[0][0])return r[0][1];for(var t=0;t<r.length-1;t++)if(e<=r[t+1][0]){var u=r[t+1][0]-r[t][0];return N(r[t][1],r[t+1][1],u>0?(e-r[t][0])/u:0)}return r[r.length-1][1]}function On(n,e,r){if(L(n)||(n={g:e.g,a:e.a,cx:e.cx,cy:e.cy,r:e.r,p:e.p,ra:e.ra,rr:e.rr,s:[[0,n],[1,n]]}),L(e)||(e={g:n.g,a:n.a,cx:n.cx,cy:n.cy,r:n.r,p:n.p,ra:n.ra,rr:n.rr,s:[[0,e],[1,e]]}),n.g!==e.g)return r<1?n:e;var t=[];n.s.concat(e.s).forEach(function(f){t.indexOf(f[0])<0&&t.push(f[0])}),t.sort(function(f,s){return f-s});var u=n.s.length===e.s.length?n.s.map(function(f,s){return[f[0]+(e.s[s][0]-f[0])*r,N(f[1],e.s[s][1],r)]}):t.map(function(f){return[f,N(vn(n,f),vn(e,f),r)]}),a=function(f,s,c){return(f==null?c:f)+((s==null?c:s)-(f==null?c:f))*r},i={g:n.g,a:a(n.a,e.a,90),cx:a(n.cx,e.cx,.5),cy:a(n.cy,e.cy,.5),r:a(n.r,e.r,.5),s:u};if(n.p||e.p){var o=Hn(n),l=Hn(e);i.p=o.map(function(f,s){return f+(l[s]-f)*r})}return(n.ra!=null||e.ra!=null)&&(i.ra=a(n.ra,e.ra,0)),(n.rr!=null||e.rr!=null)&&(i.rr=a(n.rr,e.rr,1)),i}function N(n,e,r){if(L(n)||L(e))return On(n,e,r);var t=Q(n),u=Q(e);if(!t||!u)return r<1?n:e;var a=[0,1,2].map(function(o){return Math.round(t[o]+(u[o]-t[o])*r)}),i=t[3]+(u[3]-t[3])*r;return i>=.999?"rgb("+a.join(",")+")":"rgba("+a.join(",")+","+Math.round(i*1e3)/1e3+")"}function X(n,e){if(!n||!e||n.length!==e.length)return!1;for(var r=0;r<n.length;r++)if(n[r].n.length!==e[r].n.length)return!1;return!0}function B(n,e,r){return X(n,e)?n.map(function(t,u){return{c:t.c,n:t.n.map(function(a,i){var o=e[u].n[i];return a.map(function(l,f){return l+(o[f]-l)*r})})}}):r<1?n:e}function gn(n,e,r){n=n||[],e=e||[];var t=n.length,u=e.length,a=[],i;if(t!==u)if(!t)n=on(e.map(Mn),1);else if(!u)e=on(n.map(Mn),1);else{var o=t*u/En(t,u);n=on(n,o/t),e=on(e,o/u)}for(i=0;i<n.length;i++)a.push(n[i]+(e[i]-n[i])*r);return a}function Mn(){return 0}function En(n,e){return e?En(e,n%e):n||1}function on(n,e){for(var r=[],t=0;t<e;t++)r=r.concat(n);return r}function tn(n,e,r,t){return n==="c"?N(e,r,t):n==="a"?gn(e,r,t):n==="m"?B(e,r,t):n==="v"?[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]:e+(r-e)*t}function An(n,e,r,t,u){var a=u*u,i=a*u;return[0,1].map(function(o){return .5*(2*e[o]+(-n[o]+r[o])*u+(2*n[o]-5*e[o]+4*r[o]-t[o])*a+(-n[o]+3*e[o]-3*r[o]+t[o])*i)})}function xn(n,e,r,t){var u=1-t,a=u*u*u,i=3*u*u*t,o=3*u*t*t,l=t*t*t;return[a*n[0]+i*(n[0]+e[0])+o*(r[0]+e[2])+l*r[0],a*n[1]+i*(n[1]+e[1])+o*(r[1]+e[3])+l*r[1]]}var k={},D=0;function fn(n,e,r,t){if(t<=0||t>=1)return t;var u=n.join()+";"+e.join()+";"+r.join(),a=k[u],i=64,o;if(!a){++D>400&&(k={},D=1),a=[0];var l=n;for(o=1;o<=i;o++){var f=xn(n,e,r,o/i);a.push(a[o-1]+Math.hypot(f[0]-l[0],f[1]-l[1])),l=f}k[u]=a}var s=t*a[i];if(!(a[i]>0))return t;for(o=1;o<=i;o++)if(a[o]>=s)return(o-1+(s-a[o-1])/(a[o]-a[o-1]||1))/i;return 1}function F(n,e,r){var t=n.t[e],u=t.length,a,i,o,l;if(u===1||r<=t[0][0])return t[0][1];if(r>=t[u-1][0])return t[u-1][1];for(a=0;a<u-1;a++)if(i=t[a],o=t[a+1],r<o[0])return l=R(i[2],(r-i[0])/(o[0]-i[0])),e==="pos"&&i[3]?xn(i[1],i[3],o[1],n.ev?fn(i[1],i[3],o[1],l):l):e==="pos"&&n.sm&&u>2?An((t[a-1]||i)[1],i[1],o[1],(t[a+2]||o)[1],l):tn(S[e]||(typeof i[1]=="string"?"c":typeof i[1]=="object"?"v":"n"),i[1],o[1],l);return t[u-1][1]}function ln(n){return typeof n=="number"||!!n&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"}function wn(n,e,r,t){return typeof n=="number"?n+(e-r)*t:[n[0]+(e[0]-r[0])*t,n[1]+(e[1]-r[1])*t]}function te(n,e,r,t,u,a,i){var o=u-t,l=i.s;if(!(o>0))return F(n,e,r);var f=F(n,e,t),s=F(n,e,u),c=(l==="o"||l==="c")&&ln(f);if(l==="c"&&c){var b=Math.min(o/2,.01),d=a>0?u:t;return wn(F(n,e,d),F(n,e,d),F(n,e,d-a*b),(a>0?r-u:t-r)/b)}var M=a>0?r-u:t-r,h=Math.floor(M/o),y=M-h*o;i.x>0&&M>=i.x*o&&(h=i.x-1,y=o);var x=l==="p"&&h%2===0,Z=a>0?x?u-y:t+y:x?t+y:u-y,$=F(n,e,Z);return l==="o"&&c?wn($,s,f,a*(h+1)):$}function Ve(n,e,r,t,u){var a=t.length,i=u.n>=2?Math.min(u.n,a):a,o=u.w||"a";return o!=="b"&&r>t[a-1][0]?te(n,e,r,t[a-i][0],t[a-1][0],1,u):o!=="a"&&r<t[0][0]?te(n,e,r,t[0][0],t[i-1][0],-1,u):F(n,e,r)}function Nn(n,e){var r=Math.imul((n|0)^Math.imul(e|0,668265261),739982445);return r=Math.imul(r^r>>>15,695872825),r^=r>>>15,(r>>>0)/4294967295*2-1}function Qn(n,e){var r=Math.floor(n),t=n-r,u=Nn(r-1,e),a=Nn(r,e),i=Nn(r+1,e),o=Nn(r+2,e);return .5*(2*a+(i-u)*t+(2*u-5*a+4*i-o)*t*t+(3*a-u-3*i+o)*t*t*t)}function Xn(n,e,r,t){if(!(t>0))return Qn(n*e,r);var u=n-Math.floor(n/t)*t,a=u/t;return Qn(u*e,r)*(1-a)+Qn((u-t)*e,r)*a}function He(n,e,r,t){var u=t.lp<0?g.dur||1:t.lp||0,a=+t.a||0,i=t.f>0?t.f:1,o=t.sd|0;if(typeof e=="number")return e+a*Xn(r,i,o,u);if(!ln(e))return e;var l=a*Xn(r,i,o,u);return[e[0]+l,e[1]+(n==="scl"?l:a*Xn(r,i,o+7919,u))]}function je(n,e,r,t,u){var a=u.lp&&!u.lp.off?u.lp:null,i=u.wg&&!u.wg.off?u.wg:null,o=a&&t.length>1?Ve(n,e,r,t,a):F(n,e,r);return i?He(e,o,r,i):o}var Sn=!1;function E(n,e,r){var t=!Sn&&n.t&&n.t[e];if(!t||!t.length)return e==="org"?n.o||[0,0]:n.b[e];var u=!g.nm&&n.m&&n.m[e];return u?je(n,e,r,t,u):F(n,e,r)}function Tn(n,e,r){var t=E(n,"org",e)||[0,0],u=E(n,"pos",e)||[0,0],a=E(n,"rot",e)||0,i=E(n,"scl",e)||[1,1],o=E(n,"skw",e)||[0,0],l=n.t&&n.t.pos,f=E(n,"op",e);if(n.type==="raw"&&n.geo&&n.geo.box){var s=E(n,"sz",e),c=n.geo.box;s&&c[2]>0&&c[3]>0&&(i=[i[0]*(s[0]/c[2]),i[1]*(s[1]/c[3])])}if(n.or&&l&&l.length>1&&!Sn){var b=l[0][0],d=l[l.length-1][0],M=Math.min(.02,(d-b)/4),h=Math.max(b,Math.min(e-M,d-2*M)),y=E(n,"pos",h),x=E(n,"pos",h+2*M);(x[0]!==y[0]||x[1]!==y[1])&&(a+=Math.atan2(x[1]-y[1],x[0]-y[0])*180/Math.PI)}return r?{x:u[0]+t[0],y:u[1]+t[1],r:a,sx:i[0],sy:i[1],ox:t[0],oy:t[1],kx:o[0],ky:o[1],ba:Wn(n),cp:ie(n,e)}:{x:u[0]+t[0],y:u[1]+t[1],r:a,sx:i[0],sy:i[1],ox:t[0],oy:t[1],op:f==null?1:f,fill:E(n,"fill",e),stk:E(n,"stk",e),sw:E(n,"sw",e),d:Ge(n,e),kx:o[0],ky:o[1],fo:E(n,"fo",e),so:E(n,"so",e),dof:E(n,"dof",e),rad:n.t&&n.t.rad&&n.t.rad.length?E(n,"rad",e):null,gb:Ye(n,e),da:n.t&&n.t.da&&n.t.da.length?E(n,"da",e):null,trim:Be(n,e),ba:Wn(n),cp:ie(n,e)}}for(var ue={},Kn=null,_n=0;_n<g.L.length;_n++)ue[g.L[_n].id]=g.L[_n];function q(n){return n&&(ue[n]||Kn&&Kn(n))||null}function ie(n,e){var r=n.cs||n.type==="bone"&&!n.inh?q(n.parent):null;if(!r||!n.cs&&r.type!=="bone")return null;var t=E(r,"scl",e)||[1,1];if(t[0]===1&&t[1]===1)return null;var u=n.j||(n.geo?[n.geo.x,n.geo.y]:[0,0]);return[Wn(r),t[0]||1e-6,t[1]||1e-6,u[0],u[1]]}function Wn(n){return n.ba!=null?n.ba:n.type==="bone"&&n.geo&&n.geo.ang?n.geo.ang:0}function Be(n,e){var r=n.t||{},t=["ts","te","to"].some(function(o){return r[o]&&r[o].length||n.b&&n.b[o]!=null&&n.b[o]!==(o==="te"?100:0)});if(!t)return null;var u=E(n,"ts",e),a=E(n,"te",e),i=E(n,"to",e);return[u==null?0:u,a==null?100:a,i==null?0:i]}function ae(n){var e=Math.max(0,Math.min(100,Math.min(n[0],n[1]))),r=Math.max(0,Math.min(100,Math.max(n[0],n[1]))),t=r-e,u=e+(n[2]||0),a=(u%100+100)%100;return t<1e-6?["0 300",String(m(150-a))]:a+t<=100+1e-6?[m(t)+" "+m(200-t),String(m(-a))]:[m(t)+" "+m(100-t),String(m(-u))]}function Ge(n,e){var r=Ze(n,e);return r&&n.t&&n.t.sz&&n.t.sz.length&&(r=Qe(n,r,e)),r&&n.pins&&n.pins.length&&!Fn?We(n,r,e):r}function ze(n,e,r){var t=n[2]?e[0]/n[2]:1,u=n[3]?e[1]/n[3]:1;return[r[0]-(r[0]-n[0])*t,r[1]-(r[1]-n[1])*u,Math.max(0,e[0]),Math.max(0,e[1])]}function oe(n,e,r){return n.sa?[e[0]+n.sa[0]*e[2],e[1]+n.sa[1]*e[3]]:E(n,"org",r)||[0,0]}function Ye(n,e){var r=n.geo;if(!r||!n.t||!n.t.sz||!n.t.sz.length||n.type!=="rect"&&n.type!=="image"&&n.type!=="ellipse")return null;var t=n.type==="ellipse"?[(r.cx||0)-(r.rx||0),(r.cy||0)-(r.ry||0),2*(r.rx||0),2*(r.ry||0)]:[r.x||0,r.y||0,r.w||0,r.h||0];return ze(t,E(n,"sz",e),oe(n,t,e))}function Qe(n,e,r){var t=fe(n.b&&n.b.d||e),u=E(n,"sz",r),a=oe(n,t,r),i=t[2]>1e-9?u[0]/t[2]:1,o=t[3]>1e-9?u[1]/t[3]:1;return e.map(function(l){return{c:l.c,n:l.n.map(function(f){return f.map(function(s,c){return c%2?a[1]+(s-a[1])*o:a[0]+(s-a[0])*i})})}})}function fe(n){var e=1/0,r=1/0,t=-1/0,u=-1/0;function a(l,f){l<e&&(e=l),l>t&&(t=l),f<r&&(r=f),f>u&&(u=f)}function i(l,f,s,c){var b=-l+3*f-3*s+c,d=2*(l-2*f+s),M=f-l,h=[];if(Math.abs(b)<1e-12)Math.abs(d)>1e-12&&h.push(-M/d);else{var y=d*d-4*b*M;if(y>=0){var x=Math.sqrt(y);h.push((-d+x)/(2*b),(-d-x)/(2*b))}}return h.filter(function(Z){return Z>0&&Z<1})}function o(l,f){var s=[l[0],l[4],f[2],f[0]],c=[l[1],l[5],f[3],f[1]];a(f[0],f[1]),i(s[0],s[1],s[2],s[3]).concat(i(c[0],c[1],c[2],c[3])).forEach(function(b){var d=1-b,M=d*d*d,h=3*d*d*b,y=3*d*b*b,x=b*b*b;a(M*s[0]+h*s[1]+y*s[2]+x*s[3],M*c[0]+h*c[1]+y*c[2]+x*c[3])})}return(n||[]).forEach(function(l){var f=l.n;if(f.length){a(f[0][0],f[0][1]);for(var s=1;s<f.length;s++)o(f[s-1],f[s]);l.c&&f.length>1&&o(f[f.length-1],f[0])}}),isFinite(e)?[e,r,t-e,u-r]:[0,0,0,0]}var Fn=!1;function w(n,e){return[n[0]*e[0]+n[2]*e[1],n[1]*e[0]+n[3]*e[1],n[0]*e[2]+n[2]*e[3],n[1]*e[2]+n[3]*e[3],n[0]*e[4]+n[2]*e[5]+n[4],n[1]*e[4]+n[3]*e[5]+n[5]]}function Xe(n){var e=n[0]*n[3]-n[1]*n[2]||1e-12;return[n[3]/e,-n[1]/e,-n[2]/e,n[0]/e,(n[2]*n[5]-n[3]*n[4])/e,(n[1]*n[4]-n[0]*n[5])/e]}function sn(n,e){return[1,0,0,1,n,e]}function mn(n){var e=n*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}function Zn(n,e){return[n,0,0,e,0,0]}function le(n){var e=[1,0,0,1,0,0],r=n.cp;r&&(e=w(e,sn(r[3],r[4])),e=w(e,mn(r[0])),e=w(e,Zn(1/r[1],1/r[2])),e=w(e,mn(-r[0])),e=w(e,sn(-r[3],-r[4]))),e=w(e,sn(n.x,n.y)),e=w(e,mn(n.r)),n.kx&&(e=w(e,[1,0,Math.tan(n.kx*Math.PI/180),1,0,0])),n.ky&&(e=w(e,[1,Math.tan(n.ky*Math.PI/180),0,1,0,0]));var t=n.ba&&n.sx!==n.sy;return t&&(e=w(e,mn(n.ba))),e=w(e,Zn(n.sx,n.sy)),t&&(e=w(e,mn(-n.ba))),w(e,sn(-n.ox,-n.oy))}var $n={};function Jn(n){if($n[n])return $n[n];for(var e=[1,0,0,1,0,0],r=/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g,t;t=r.exec(n);){var u=t[2].split(/[\s,]+/).filter(Boolean).map(Number),a=t[1];a==="matrix"&&u.length===6?e=w(e,u):a==="translate"?e=w(e,sn(u[0]||0,u[1]||0)):a==="scale"?e=w(e,Zn(u[0],u.length>1?u[1]:u[0])):a==="rotate"?e=u.length>2?w(w(w(e,sn(u[1],u[2])),mn(u[0])),sn(-u[1],-u[2])):w(e,mn(u[0]||0)):a==="skewX"?e=w(e,[1,0,Math.tan((u[0]||0)*Math.PI/180),1,0,0]):a==="skewY"&&(e=w(e,[1,Math.tan((u[0]||0)*Math.PI/180),0,1,0,0]))}return $n[n]=e}function Vn(n,e,r){for(var t=le(Tn(n,e,!0)),u=q(n.parent),a=0;u&&u!==r&&a++<100;)u.xf&&(t=w(Jn(u.xf),t)),t=w(le(Tn(u,e,!0)),t),u=q(u.parent);return t}function Ke(n,e,r){var t=Vn(n,e,r),u=n.type?n.type==="path":!n.mesh;return u&&n.xf?w(t,Jn(n.xf)):t}function se(n,e,r,t,u){for(var a=[],i=q(e.parent),o=null,l=0;i&&l++<100;)a.push(i),i=q(i.parent);for(i=q(n.parent),l=0;i&&l++<100;i=q(i.parent))if(a.indexOf(i)>=0){o=i;break}var f=Sn;Sn=t;var s=Ke(n,r,o),c=Math.abs(s[0]*s[3]-s[1]*s[2])<1e-12?[1,0,0,1,0,0]:w(Xe(s),Vn(e,r,o));Sn=f;var b=e.geo||{},d=(b.ang||0)*Math.PI/180,M=(b.x||0)+(u&&u[0]||0),h=(b.y||0)+(u&&u[1]||0),y=c[0]*Math.cos(d)+c[2]*Math.sin(d),x=c[1]*Math.cos(d)+c[3]*Math.sin(d);return[c[0]*M+c[2]*h+c[4],c[1]*M+c[3]*h+c[5],Math.atan2(x,y)*180/Math.PI]}function me(n,e,r){var t=e.bone?q(e.bone):null;if(t){var u=se(n,t,r,!0,e.bo),a=se(n,t,r,!1,e.bo);return[u[0],u[1],a[0],a[1],a[2]-u[2]]}var i=E(n,"pin"+e.n,r)||[e.x,e.y];return[e.x,e.y,i[0],i[1],E(n,"pinr"+e.n,r)||0]}function ce(n,e){var r=n.pins||[],t=Math.max(10,Math.min(1e3,n.reach||100)),u=Math.max(.5,Math.min(8,200/t));return[r.map(function(a){var i=me(n,a,e),o=i[4]*Math.PI/180;return[i[0],i[1],i[2],i[3],Math.cos(o),Math.sin(o)]}),u]}function be(n,e,r,t,u,a,i,o){var l=0,f=0,s=0,c;for(c=0;c<n.length;c++){var b=n[c],d=r-b[0],M=t-b[1],h=1/(Math.pow(d*d+M*M,e/2)+1e-6),y=u-b[0],x=a-b[1];l+=h,f+=h*(b[2]+y*b[4]-x*b[5]),s+=h*(b[3]+y*b[5]+x*b[4])}i[o]=l?f/l:u,i[o+1]=l?s/l:a}function We(n,e,r){var t=ce(n,r),u=t[0],a=t[1];return e.map(function(i){return{c:i.c,n:i.n.map(function(o){for(var l=[0,0,0,0,0,0],f=0;f<6;f+=2)be(u,a,o[0],o[1],o[f],o[f+1],l,f);return l})}})}function ge(n,e){var r=n.mesh,t=[];if(!r)return t;var u=!Fn&&n.pins&&n.pins.length,a=u?ce(n,e):null,i=[],o;for(o=0;o<r.v.length;o++)a?be(a[0],a[1],r.v[o][0],r.v[o][1],r.v[o][0],r.v[o][1],i,o*2):(i[o*2]=r.v[o][0],i[o*2+1]=r.v[o][1]);for(o=0;o<r.t.length;o++){var l=r.t[o],f=r.v[l[0]],s=r.v[l[1]],c=r.v[l[2]],b=s[0]-f[0],d=s[1]-f[1],M=c[0]-f[0],h=c[1]-f[1],y=b*h-d*M;if(!a||!y){t.push([1,0,0,1,0,0]);continue}var x=i[l[0]*2],Z=i[l[0]*2+1],$=i[l[1]*2]-x,pn=i[l[1]*2+1]-Z,an=i[l[2]*2]-x,Rn=i[l[2]*2+1]-Z,kn=h/y,In=-M/y,Ce=-d/y,Re=b/y,ke=$*kn+an*Ce,Ie=$*In+an*Re,Oe=pn*kn+Rn*Ce,Ae=pn*In+Rn*Re;t.push([ke,Oe,Ie,Ae,x-ke*f[0]-Ie*f[1],Z-Oe*f[0]-Ae*f[1]])}return t}function Ze(n,e){var r=E(n,"d",e),t=n.t||{};if(n.shape&&t.rad&&t.rad.length)return he(n.shape,E(n,"rad",e),!0);if(r&&r[0]&&r[0].n.length===2&&(t.p0&&t.p0.length||t.p1&&t.p1.length)){var u=r[0].n.map(function(a,i){var o=t["p"+i]&&t["p"+i].length?E(n,"p"+i,e):null;if(!o)return a;var l=o[0]-a[0],f=o[1]-a[1];return[a[0]+l,a[1]+f,a[2]+l,a[3]+f,a[4]+l,a[5]+f]});return[{c:r[0].c,n:u}]}return r}function de(n){for(var e=[],r=n.kind==="star",t=r?n.n*2:n.n,u=0;u<t;u++){var a=(-90+n.rot+u*360/t)*Math.PI/180,i=r&&u%2?n.r*(n.ratio==null?.45:n.ratio):n.r;e.push([n.cx+i*Math.cos(a),n.cy+i*Math.sin(a)])}return e}function dn(n,e){return Math.hypot(n[0]-e[0],n[1]-e[1])}function ye(n){for(var e=n.length,r=1/0,t=0;t<e;t++){var u=n[(t+e-1)%e],a=n[t],i=n[(t+1)%e],o=Math.atan2(u[1]-a[1],u[0]-a[0]),l=Math.atan2(i[1]-a[1],i[0]-a[0]),f=Math.abs(o-l);f>Math.PI&&(f=2*Math.PI-f),r=Math.min(r,Math.min(dn(u,a),dn(i,a))/2*Math.tan(f/2))}return isFinite(r)?Math.max(0,r):0}function I(n){return Math.round(n*100)/100}function he(n,e,r){for(var t=de(n),u=t.length,a=Math.max(0,Math.min(e||0,ye(t))),i=[],o=0;o<u;o++){var l=t[o];if(a<=0&&!r){i.push([I(l[0]),I(l[1]),I(l[0]),I(l[1]),I(l[0]),I(l[1])]);continue}var f=t[(o+u-1)%u],s=t[(o+1)%u],c=[(f[0]-l[0])/dn(f,l),(f[1]-l[1])/dn(f,l)],b=[(s[0]-l[0])/dn(s,l),(s[1]-l[1])/dn(s,l)],d=Math.acos(Math.max(-1,Math.min(1,c[0]*b[0]+c[1]*b[1]))),M=a/Math.tan(d/2),h=4/3*Math.tan((Math.PI-d)/4)*a,y=[l[0]+c[0]*M,l[1]+c[1]*M],x=[l[0]+b[0]*M,l[1]+b[1]*M];i.push([I(y[0]),I(y[1]),I(y[0]),I(y[1]),I(y[0]-c[0]*h),I(y[1]-c[1]*h)]),i.push([I(x[0]),I(x[1]),I(x[0]-b[0]*h),I(x[1]-b[1]*h),I(x[0]),I(x[1])])}return[{c:!0,n:i}]}function pe(n){if(n.g==="rad"){var e=n.cx==null?.5:n.cx,r=n.cy==null?.5:n.cy,t=n.r==null?.5:n.r,u=n.ra||0,a=n.rr==null?1:n.rr,i={cx:String(m(e)),cy:String(m(r)),r:String(m(t)),fx:String(m(e)),fy:String(m(r))};return(m(u)||m(a)!==1)&&(i.gradientTransform="translate("+m(e)+","+m(r)+") rotate("+m(u)+") scale(1,"+m(a)+") translate("+m(-e)+","+m(-r)+")"),i}var o=Hn(n);return{x1:String(m(o[0])),y1:String(m(o[1])),x2:String(m(o[2])),y2:String(m(o[3]))}}function Hn(n){if(n.p&&n.p.length===4)return n.p.slice();var e=((n.a==null?90:n.a)-90)*Math.PI/180,r=Math.cos(e)/2,t=Math.sin(e)/2;return[.5-r,.5-t,.5+r,.5+t]}function m(n){return Math.round(n*1e3)/1e3}var $e=[.2126,.7152,.0722,.2126,.7152,.0722,.2126,.7152,.0722],Je=[.393,.769,.189,.349,.686,.168,.272,.534,.131];function ve(n,e,r){if(!n)return String(typeof e=="number"?m(e):e);var t=Math.max(0,+e||0),u;if(n==="add")return String(m(t+Math.max(0,+r||0)));if(n==="half")return String(m(t/2));if(n==="bri")u=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0];else if(n==="con"){var a=.5-.5*t;u=[t,0,0,0,a,0,t,0,0,a,0,0,t,0,a]}else if(n==="inv"){t=Math.min(1,t);var i=1-2*t;u=[i,0,0,0,t,0,i,0,0,t,0,0,i,0,t]}else{t=Math.min(1,t);var o=n==="sep"?Je:$e;u=[];for(var l=0;l<3;l++){for(var f=0;f<3;f++)u.push(o[l*3+f]*t+(l===f?1-t:0));u.push(0,0)}}return u.concat([0,0,0,1,0]).map(m).join(" ")}function Me(n){return Math.round(n*1e6)/1e6}function Ue(n){var e=n.cp;return(e?"translate("+m(e[3])+","+m(e[4])+") rotate("+m(e[0])+") scale("+m(1/e[1])+","+m(1/e[2])+") rotate("+m(-e[0])+") translate("+m(-e[3])+","+m(-e[4])+") ":"")+"translate("+m(n.x)+","+m(n.y)+") rotate("+m(n.r)+(n.kx?") skewX("+m(n.kx):"")+(n.ky?") skewY("+m(n.ky):"")+(n.ba&&n.sx!==n.sy?") rotate("+m(n.ba):"")+") scale("+m(n.sx)+","+m(n.sy)+(n.ba&&n.sx!==n.sy?") rotate("+m(-n.ba):"")+") translate("+m(-n.ox)+","+m(-n.oy)+")"}function Ee(n){return n&&n.length?n.map(function(e){return String(m(Math.max(0,e)))}).join(" "):"none"}function xe(n){var e="";function r(t,u){t[4]===t[0]&&t[5]===t[1]&&u[2]===u[0]&&u[3]===u[1]?e+="L"+m(u[0])+" "+m(u[1]):e+="C"+m(t[4])+" "+m(t[5])+" "+m(u[2])+" "+m(u[3])+" "+m(u[0])+" "+m(u[1])}return(n||[]).forEach(function(t){var u=t.n,a;if(u.length){for(e+="M"+m(u[0][0])+" "+m(u[0][1]),a=1;a<u.length;a++)r(u[a-1],u[a]);t.c&&(r(u[u.length-1],u[0]),e+="Z")}}),e||"M0 0"}function cn(n){return n in J||(J[n]=p?p.querySelector("#"+n):null),J[n]}function we(n,e,r){if(!L(r))return r;var t=r.g==="rad"?"radialGradient":"linearGradient",u=cn(e);if(!u||u.tagName!==t){var a=(n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg",t);a.setAttribute("id",e),u&&u.parentNode?u.parentNode.replaceChild(a,u):n.parentNode.insertBefore(a,n),u=a,J[e]=a}var i=pe(r);for(var o in i)u.setAttribute(o,i[o]);for(var l=u.getElementsByTagName("stop");l.length>r.s.length;)u.removeChild(l[l.length-1]);for(;l.length<r.s.length;)u.appendChild((n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg","stop"));for(var f=0;f<r.s.length;f++){var s=Q(r.s[f][1])||[0,0,0,1];l[f].setAttribute("offset",String(m(r.s[f][0]))),l[f].setAttribute("stop-color","rgb("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+")"),l[f].setAttribute("stop-opacity",String(m(s[3])))}return"url(#"+e+")"}function Un(n){for(var e=0;e<g.L.length;e++){var r=g.L[e],t=cn(g.p+r.id),u=cn(g.p+r.id+"-s"),a=cn(g.p+r.id+"-sf");if(!(!t||!u)){var i=Tn(r,n),o=function(kn,In){u.setAttribute(kn,In),a&&a.setAttribute(kn,In)};if(t.setAttribute("transform",Ue(i)),t.setAttribute("opacity",String(m(i.op))),i.fill!=null&&o("fill",we(u,g.p+r.id+"-gf",i.fill)),i.stk!=null&&u.setAttribute("stroke",we(u,g.p+r.id+"-gs",i.stk)),i.sw!=null&&u.setAttribute("stroke-width",String(m(a?i.sw*2:i.sw))),i.trim){var l=ae(i.trim);u.setAttribute("pathLength","100"),u.setAttribute("stroke-dasharray",l[0]),u.setAttribute("stroke-dashoffset",l[1])}else i.dof!=null&&u.setAttribute("stroke-dashoffset",String(m(i.dof))),i.da&&u.setAttribute("stroke-dasharray",Ee(i.da));if(i.fo!=null&&o("fill-opacity",String(m(i.fo))),i.so!=null&&u.setAttribute("stroke-opacity",String(m(i.so))),i.d&&o("d",xe(i.d)),i.gb){var f=i.gb,s=r.type==="ellipse"?{cx:f[0]+f[2]/2,cy:f[1]+f[3]/2,rx:f[2]/2,ry:f[3]/2}:{x:f[0],y:f[1],width:f[2],height:f[3]};for(var c in s)o(c,String(m(s[c])))}if(i.rad!=null&&!r.shape&&(o("rx",String(m(i.rad))),o("ry",String(m(i.rad)))),r.dw){var b=q(r.dw),d=cn(g.p+r.id+"-w");b&&d&&d.setAttribute("transform","matrix("+Vn(b,n,q(r.du)).map(Me).join(",")+")")}if(r.mesh)for(var M=ge(r,n),h=0;h<M.length;h++){var y=cn(g.p+r.id+"-m"+h);y&&y.setAttribute("transform","matrix("+M[h].map(Me).join(",")+")")}if(r.fa)for(var x in r.fa){var Z=E(r,x,n),$=r.fa[x];if(Z!=null){typeof $[0]=="string"&&($=[$]);for(var pn=0;pn<$.length;pn++){var an=$[pn],Rn=cn(g.p+r.id+an[0]);Rn&&Rn.setAttribute(an[1],ve(an[2],Z,an[3]?E(r,an[3],n):0))}}}}}}var nn=g.dur||1,G=g.it>0?Math.floor(g.it):0,jn=/alternate/.test(g.dir||""),en=/reverse/.test(g.dir||"")?-1:1,V=en,Dn=g.speed>0?g.speed:1,qn=g.fps>0?Math.min(100,g.fps):100,Bn=g.fill===-1||g.fill==="backwards"?-1:1,K=!1,Ln=0,ne=-1e9,W=!1,z=!1,_=!1,rn={},Pn=0;function yn(){return G?G*nn:nn}function bn(){return en>0?0:yn()}var C=bn();function ee(n){var e=Math.floor(n/nn),r=n-e*nn;return G&&(n<=0?(e=0,r=0):e>=G&&(e=G-1,r=nn)),jn&&(e%2+2)%2===1?nn-r:r}function un(n){var e=rn[n];e&&e.slice().forEach(function(r){try{r.call(v,Math.round(C*1e3))}catch{}})}function hn(){Un(ee(C)),un("keyframe")}function Cn(){K=!1,Pn&&cancelAnimationFrame(Pn),Pn=0}function Se(){Cn(),z&&(z=!1,V=en),W=!0,Bn<0&&(C=bn()),hn(),un("end")}function Pe(n){if(!(!K||_)){if(C+=(n-Ln)/1e3*Dn*V,Ln=n,V>0&&(G||z&&en<0)&&C>=yn())return C=yn(),Se();if(V<0&&(G||z&&en>0)&&C<=0)return C=0,Se();n-ne>=1e3/qn-1&&(ne=n,hn()),Pn=requestAnimationFrame(Pe)}}function Gn(){K||_||(K=!0,W=!1,Ln=performance.now(),ne=-1e9,Pn=requestAnimationFrame(Pe))}var v={play:function(){return _||K||(W&&(V=en,z=!1,C=bn()),Gn(),un("play")),v},pause:function(){return _||!K||(Cn(),un("pause")),v},toggle:function(){return K?v.pause():v.play()},togglePlay:function(){return v.toggle()},restart:function(){return _||(Cn(),z=!1,V=en,C=bn(),W=!1,hn(),Gn(),un("restart")),v},reverse:function(){return _||(V=-V,z=!1,W=!1,Gn(),un("reverse")),v},rollback:function(){if(_)return v;if(!G){var n=jn?2*nn:nn;C=(C%n+n)%n}return Math.abs(C-bn())<1e-6&&!K||(V=-en,z=!0,W=!1,Gn(),un("reverse")),v},stop:function(){return _||(Cn(),z=!1,V=en,C=bn(),W=!1,hn(),un("stop")),v},seek:function(n){return _||(C=Math.max(0,Math.min(100,+n||0))/100*yn(),W=!1,hn()),v},seekTo:function(n){return _||(C=(+n||0)/1e3,G&&(C=Math.max(0,Math.min(yn(),C))),W=!1,hn()),v},seekBy:function(n){return v.seekTo(C*1e3+(+n||0))},set:function(n,e){return _||(n==="speed"?Dn=Math.max(.01,Math.min(100,+e||1)):n==="fps"?qn=Math.max(1,Math.min(100,+e||100)):n==="iterations"?G=e===1/0||!(+e>0)?0:Math.floor(+e):n==="direction"?(V=+e<0?-1:1,z=!1):n==="alternate"?jn=!!e:n==="fill"&&(Bn=+e<0?-1:1)),v},ready:function(n){return typeof n=="function"&&setTimeout(function(){n.call(v,v)},0),v},on:function(n,e,r){return typeof e!="function"||String(n).split(/[\s,]+/).forEach(function(t){t&&(rn[t]=rn[t]||[],r?rn[t].unshift(e):rn[t].push(e))}),v},off:function(n,e){return rn[n]&&(rn[n]=e?rn[n].filter(function(r){return r!==e}):[]),v},destruct:function(){_||(Cn(),rn={},(v._cleanup||[]).forEach(function(n){try{n()}catch{}}),v._cleanup=[],Un(ee(bn())),_=!0)},onEnd:function(n){return v.on("end",n)},setRate:function(n){return v.set("speed",n)},apply:Un,comp:Tn,lookup:function(n){Kn=n},meshMats:ge,pinAt:me,worldOf:Vn,restPins:function(n){var e=Fn;return Fn=!!n,e},get:E,fxv:ve,gAttrs:pe,linP:Hn,trimDash:ae,isG:L,pc:Q,dstr:xe,dashStr:Ee,pathBox:fe,xfM:Jn,poly:he,corners:de,maxRad:ye,ease:R,loc:ee,EZ:H,_cleanup:[]},A=function(n){return{get:n,enumerable:!0}};return Object.defineProperties(v,{currentTime:A(function(){return Math.round(C*1e3)}),duration:A(function(){return Math.round(nn*1e3)}),totalTime:A(function(){return Math.round(yn()*1e3)}),fps:A(function(){return qn}),speed:A(function(){return Dn}),direction:A(function(){return V}),fill:A(function(){return Bn}),iterations:A(function(){return G}),hasEnded:A(function(){return W}),isAlternate:A(function(){return jn}),isBackwards:A(function(){return Bn<0}),isInfinite:A(function(){return!G}),isPlaying:A(function(){return K}),isReversed:A(function(){return V<0}),isRollingBack:A(function(){return K&&z}),state:A(function(){return _?"destroyed":K?z?"rollback":"playing":W?"ended":"paused"})}),v}function Te(g,p,S){var H=S&&S.r||[0,100,1,0],O=Math.max(0,+(S&&S.sm)||0),J=!!S&&S.b===-1,P=window,U=g,T=null;try{P.frameElement&&P.parent&&P.parent!==P&&(U=P.frameElement,P=P.parent)}catch{}for(var Y=P.document.documentElement,j=P.document.body,R=U.parentNode;R&&R.nodeType===1&&R!==Y&&R!==j;R=R.parentNode){var Q=P.getComputedStyle(R).overflowY;if((Q==="auto"||Q==="scroll"||Q==="overlay")&&R.scrollHeight>R.clientHeight){T=R;break}}function L(k,D,fn,F){var ln=k+H[0]*D-(fn+H[1]/100*F),wn=k+H[2]*D-(fn+H[3]/100*F);return wn<=ln?ln<=0?1:0:Math.max(0,Math.min(1,-ln/(wn-ln)))}function vn(){var k=U.getBoundingClientRect(),D=0,fn=P.innerHeight||Y.clientHeight;return T&&(D=T.getBoundingClientRect().top+T.clientTop,fn=T.clientHeight),L(k.top,k.height,D,fn)}var On=O/3,N=-1,X=0,B=0,gn=0,Mn=P.requestAnimationFrame||function(k){return setTimeout(function(){k(Date.now())},16)},En=P.cancelAnimationFrame||clearTimeout;function on(k){B=0;var D=gn?(k-gn)/1e3:1/60;gn=k,N<0||!On?N=X:N+=(X-N)*(1-Math.exp(-D/On)),Math.abs(X-N)<.5&&(N=X),p.seekTo(N),N!==X?B=Mn(on):gn=0}function tn(){var k=p.duration||0;X=vn()*k,J&&(X=k-X),B||(B=Mn(on))}var An=T||P,xn={passive:!0};return An.addEventListener("scroll",tn,xn),P.addEventListener("resize",tn),p._cleanup&&p._cleanup.push(function(){An.removeEventListener("scroll",tn,xn),P.removeEventListener("resize",tn),B&&En(B),B=0}),tn(),B&&En(B),B=0,N=X,p.seekTo(N),{progress:vn,at:L,update:tn,box:T}}var re=3;function De(g,p,S){let H=S.b===-1?-1:1,O=S.o||"pause",J=p._cleanup=[],P=(j,R,Q)=>{j.addEventListener(R,Q),J.push(()=>j.removeEventListener(R,Q))},U=()=>{(p.direction!==H||p.isRollingBack)&&p.set("direction",H),p.play()},T=()=>{O==="pause"?p.pause():O==="reverse"?p.rollback():O==="start"?p.stop():O==="restart"&&p.restart()},Y=S.t||"load";if(Y==="hover")P(g,"mouseenter",U),P(g,"mouseleave",T);else if(Y==="click")g.style.cursor="pointer",P(g,"click",()=>{p.isPlaying&&!p.isRollingBack?O!=="none"&&T():U()});else if(Y==="scroll")if("IntersectionObserver"in window){let j=new IntersectionObserver(R=>{R[0].isIntersecting?U():O!=="none"&&(p.isPlaying||p.currentTime>0)&&T()},{threshold:.35});j.observe(g),J.push(()=>j.disconnect())}else p.play();else Y==="scrub"?Te(g,p,S.sc||{r:[0,100,1,0]}):Y!=="api"&&p.play()}function zn(g,p){if(!g)return null;if(g.player)return g.player;if(!p){let O=g.querySelector('script[type="application/json"][data-cin]');if(!O)return null;try{p=JSON.parse(O.textContent||"")}catch{return null}}if((p.f||1)>re)return null;let S=Ne(p.d,g);g.player=g.cinPlayer=S,S.stop(),(p.rm==="first"||p.rm==="last")&&!!window.matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?S.seekTo(p.rm==="first"?0:Math.max(0,Math.round((p.d.dur||1)*1e3)-1)):De(g,S,p);try{g.dispatchEvent(new CustomEvent("cinready",{detail:S}))}catch{}return S}function Yn(g=document){g.querySelectorAll('script[type="application/json"][data-cin]').forEach(p=>{let S=p.closest("svg");S&&!S.player&&zn(S)})}var qe="1.3.0",_e=typeof document!="undefined"?document.currentScript:null,Fe=window;Fe.CinPlayer=Fe.CinPlayer||{version:qe,f:re,boot:zn,scan:Yn};_e&&zn(_e.closest("svg"));typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Yn()):Yn());})();
1
+ /*! SVGcinema player 1.3.1. Proprietary, see the LICENSE file of the svgcinema-player package. */
2
+ "use strict";(()=>{function Ne(g,p){var S={pos:"v",org:"v",p0:"v",p1:"v",rad:"n",ts:"n",te:"n",to:"n",rot:"n",scl:"v",op:"n",fill:"c",stk:"c",sw:"n",d:"m",skw:"v",fo:"n",so:"n",dof:"n",sz:"v",da:"a"},H={ease:[.25,.1,.25,1],in:[.42,0,1,1],out:[0,0,.58,1],inOut:[.42,0,.58,1],inSine:[.12,0,.39,0],outSine:[.61,1,.88,1],inOutSine:[.37,0,.63,1],inQuad:[.11,0,.5,0],outQuad:[.5,1,.89,1],inOutQuad:[.45,0,.55,1],inCubic:[.32,0,.67,0],outCubic:[.33,1,.68,1],inOutCubic:[.65,0,.35,1],inQuart:[.5,0,.75,0],outQuart:[.25,1,.5,1],inOutQuart:[.76,0,.24,1],inQuint:[.64,0,.78,0],outQuint:[.22,1,.36,1],inOutQuint:[.83,0,.17,1],inExpo:[.7,0,.84,0],outExpo:[.16,1,.3,1],inOutExpo:[.87,0,.13,1],inCirc:[.55,0,1,.45],outCirc:[0,.55,.45,1],inOutCirc:[.85,0,.15,1],inBack:[.36,0,.66,-.56],outBack:[.34,1.56,.64,1],inOutBack:[.68,-.6,.32,1.6]},O={},J={},P=2*Math.PI/3,U=2*Math.PI/4.5,T={hold:function(n){return n<1?0:1},outBounce:j,inBounce:function(n){return 1-j(1-n)},inOutBounce:function(n){return n<.5?(1-j(1-2*n))/2:(1+j(2*n-1))/2},outElastic:function(n){return n===0||n===1?n:Math.pow(2,-10*n)*Math.sin((n*10-.75)*P)+1},inElastic:function(n){return n===0||n===1?n:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*P)},inOutElastic:function(n){return n===0||n===1?n:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*U))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*U)/2+1}};function Y(n){var e=3*n[0],r=3*(n[2]-n[0])-e,t=1-e-r,u=3*n[1],a=3*(n[3]-n[1])-u,i=1-u-a;function o(s){return((t*s+r)*s+e)*s}function l(s){return((i*s+a)*s+u)*s}function f(s){return(3*t*s+2*r)*s+e}return function(s){var c=s,b,d,M,h=0,y=1;for(b=0;b<8;b++){if(d=o(c)-s,Math.abs(d)<1e-6)return l(c);if(M=f(c),Math.abs(M)<1e-6)break;c-=d/M}for(c=s;y-h>1e-6&&(d=o(c),!(Math.abs(d-s)<1e-6));)s>d?h=c:y=c,c=(h+y)/2;return l(c)}}function j(n){var e=7.5625,r=2.75;return n<1/r?e*n*n:n<2/r?e*(n-=1.5/r)*n+.75:n<2.5/r?e*(n-=2.25/r)*n+.9375:e*(n-=2.625/r)*n+.984375}function R(n,e){if(!n||n==="linear")return e;if(typeof n!="string"){var r=n.join(",");return(O[r]||(O[r]=Y(n)))(e)}if(T[n])return T[n](e);var t=O[n]||(O[n]=Y(H[n]||H.ease));return t(e)}function Q(n){if(typeof n!="string")return null;var e=n.trim();if(e[0]==="#"){var r=e.slice(1);return(r.length===3||r.length===4)&&(r=r.replace(/./g,"$&$&")),r.length===6&&(r+="ff"),r.length!==8?null:[parseInt(r.substr(0,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(6,2),16)/255]}var t=e.match(/^rgba?\(([^)]+)\)$/);if(t){var u=t[1].split(/[\s,\/]+/).filter(Boolean).map(parseFloat);return u.length===3&&u.push(1),u.length===4?u:null}return null}function L(n){return!!n&&typeof n=="object"&&(n.g==="lin"||n.g==="rad")&&n.s&&n.s.length>0}function vn(n,e){var r=n.s;if(e<=r[0][0])return r[0][1];for(var t=0;t<r.length-1;t++)if(e<=r[t+1][0]){var u=r[t+1][0]-r[t][0];return N(r[t][1],r[t+1][1],u>0?(e-r[t][0])/u:0)}return r[r.length-1][1]}function On(n,e,r){if(L(n)||(n={g:e.g,a:e.a,cx:e.cx,cy:e.cy,r:e.r,p:e.p,ra:e.ra,rr:e.rr,s:[[0,n],[1,n]]}),L(e)||(e={g:n.g,a:n.a,cx:n.cx,cy:n.cy,r:n.r,p:n.p,ra:n.ra,rr:n.rr,s:[[0,e],[1,e]]}),n.g!==e.g)return r<1?n:e;var t=[];n.s.concat(e.s).forEach(function(f){t.indexOf(f[0])<0&&t.push(f[0])}),t.sort(function(f,s){return f-s});var u=n.s.length===e.s.length?n.s.map(function(f,s){return[f[0]+(e.s[s][0]-f[0])*r,N(f[1],e.s[s][1],r)]}):t.map(function(f){return[f,N(vn(n,f),vn(e,f),r)]}),a=function(f,s,c){return(f==null?c:f)+((s==null?c:s)-(f==null?c:f))*r},i={g:n.g,a:a(n.a,e.a,90),cx:a(n.cx,e.cx,.5),cy:a(n.cy,e.cy,.5),r:a(n.r,e.r,.5),s:u};if(n.p||e.p){var o=Hn(n),l=Hn(e);i.p=o.map(function(f,s){return f+(l[s]-f)*r})}return(n.ra!=null||e.ra!=null)&&(i.ra=a(n.ra,e.ra,0)),(n.rr!=null||e.rr!=null)&&(i.rr=a(n.rr,e.rr,1)),i}function N(n,e,r){if(L(n)||L(e))return On(n,e,r);var t=Q(n),u=Q(e);if(!t||!u)return r<1?n:e;var a=[0,1,2].map(function(o){return Math.round(t[o]+(u[o]-t[o])*r)}),i=t[3]+(u[3]-t[3])*r;return i>=.999?"rgb("+a.join(",")+")":"rgba("+a.join(",")+","+Math.round(i*1e3)/1e3+")"}function X(n,e){if(!n||!e||n.length!==e.length)return!1;for(var r=0;r<n.length;r++)if(n[r].n.length!==e[r].n.length)return!1;return!0}function B(n,e,r){return X(n,e)?n.map(function(t,u){return{c:t.c,n:t.n.map(function(a,i){var o=e[u].n[i];return a.map(function(l,f){return l+(o[f]-l)*r})})}}):r<1?n:e}function gn(n,e,r){n=n||[],e=e||[];var t=n.length,u=e.length,a=[],i;if(t!==u)if(!t)n=on(e.map(Mn),1);else if(!u)e=on(n.map(Mn),1);else{var o=t*u/En(t,u);n=on(n,o/t),e=on(e,o/u)}for(i=0;i<n.length;i++)a.push(n[i]+(e[i]-n[i])*r);return a}function Mn(){return 0}function En(n,e){return e?En(e,n%e):n||1}function on(n,e){for(var r=[],t=0;t<e;t++)r=r.concat(n);return r}function tn(n,e,r,t){return n==="c"?N(e,r,t):n==="a"?gn(e,r,t):n==="m"?B(e,r,t):n==="v"?[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]:e+(r-e)*t}function An(n,e,r,t,u){var a=u*u,i=a*u;return[0,1].map(function(o){return .5*(2*e[o]+(-n[o]+r[o])*u+(2*n[o]-5*e[o]+4*r[o]-t[o])*a+(-n[o]+3*e[o]-3*r[o]+t[o])*i)})}function xn(n,e,r,t){var u=1-t,a=u*u*u,i=3*u*u*t,o=3*u*t*t,l=t*t*t;return[a*n[0]+i*(n[0]+e[0])+o*(r[0]+e[2])+l*r[0],a*n[1]+i*(n[1]+e[1])+o*(r[1]+e[3])+l*r[1]]}var k={},D=0;function fn(n,e,r,t){if(t<=0||t>=1)return t;var u=n.join()+";"+e.join()+";"+r.join(),a=k[u],i=64,o;if(!a){++D>400&&(k={},D=1),a=[0];var l=n;for(o=1;o<=i;o++){var f=xn(n,e,r,o/i);a.push(a[o-1]+Math.hypot(f[0]-l[0],f[1]-l[1])),l=f}k[u]=a}var s=t*a[i];if(!(a[i]>0))return t;for(o=1;o<=i;o++)if(a[o]>=s)return(o-1+(s-a[o-1])/(a[o]-a[o-1]||1))/i;return 1}function F(n,e,r){var t=n.t[e],u=t.length,a,i,o,l;if(u===1||r<=t[0][0])return t[0][1];if(r>=t[u-1][0])return t[u-1][1];for(a=0;a<u-1;a++)if(i=t[a],o=t[a+1],r<o[0])return l=R(i[2],(r-i[0])/(o[0]-i[0])),e==="pos"&&i[3]?xn(i[1],i[3],o[1],n.ev?fn(i[1],i[3],o[1],l):l):e==="pos"&&n.sm&&u>2?An((t[a-1]||i)[1],i[1],o[1],(t[a+2]||o)[1],l):tn(S[e]||(typeof i[1]=="string"?"c":typeof i[1]=="object"?"v":"n"),i[1],o[1],l);return t[u-1][1]}function ln(n){return typeof n=="number"||!!n&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"}function wn(n,e,r,t){return typeof n=="number"?n+(e-r)*t:[n[0]+(e[0]-r[0])*t,n[1]+(e[1]-r[1])*t]}function te(n,e,r,t,u,a,i){var o=u-t,l=i.s;if(!(o>0))return F(n,e,r);var f=F(n,e,t),s=F(n,e,u),c=(l==="o"||l==="c")&&ln(f);if(l==="c"&&c){var b=Math.min(o/2,.01),d=a>0?u:t;return wn(F(n,e,d),F(n,e,d),F(n,e,d-a*b),(a>0?r-u:t-r)/b)}var M=a>0?r-u:t-r,h=Math.floor(M/o),y=M-h*o;i.x>0&&M>=i.x*o&&(h=i.x-1,y=o);var x=l==="p"&&h%2===0,Z=a>0?x?u-y:t+y:x?t+y:u-y,$=F(n,e,Z);return l==="o"&&c?wn($,s,f,a*(h+1)):$}function Ve(n,e,r,t,u){var a=t.length,i=u.n>=2?Math.min(u.n,a):a,o=u.w||"a";return o!=="b"&&r>t[a-1][0]?te(n,e,r,t[a-i][0],t[a-1][0],1,u):o!=="a"&&r<t[0][0]?te(n,e,r,t[0][0],t[i-1][0],-1,u):F(n,e,r)}function Nn(n,e){var r=Math.imul((n|0)^Math.imul(e|0,668265261),739982445);return r=Math.imul(r^r>>>15,695872825),r^=r>>>15,(r>>>0)/4294967295*2-1}function Qn(n,e){var r=Math.floor(n),t=n-r,u=Nn(r-1,e),a=Nn(r,e),i=Nn(r+1,e),o=Nn(r+2,e);return .5*(2*a+(i-u)*t+(2*u-5*a+4*i-o)*t*t+(3*a-u-3*i+o)*t*t*t)}function Xn(n,e,r,t){if(!(t>0))return Qn(n*e,r);var u=n-Math.floor(n/t)*t,a=u/t;return Qn(u*e,r)*(1-a)+Qn((u-t)*e,r)*a}function He(n,e,r,t){var u=t.lp<0?g.dur||1:t.lp||0,a=+t.a||0,i=t.f>0?t.f:1,o=t.sd|0;if(typeof e=="number")return e+a*Xn(r,i,o,u);if(!ln(e))return e;var l=a*Xn(r,i,o,u);return[e[0]+l,e[1]+(n==="scl"?l:a*Xn(r,i,o+7919,u))]}function je(n,e,r,t,u){var a=u.lp&&!u.lp.off?u.lp:null,i=u.wg&&!u.wg.off?u.wg:null,o=a&&t.length>1?Ve(n,e,r,t,a):F(n,e,r);return i?He(e,o,r,i):o}var Sn=!1;function E(n,e,r){var t=!Sn&&n.t&&n.t[e];if(!t||!t.length)return e==="org"?n.o||[0,0]:n.b[e];var u=!g.nm&&n.m&&n.m[e];return u?je(n,e,r,t,u):F(n,e,r)}function Tn(n,e,r){var t=E(n,"org",e)||[0,0],u=E(n,"pos",e)||[0,0],a=E(n,"rot",e)||0,i=E(n,"scl",e)||[1,1],o=E(n,"skw",e)||[0,0],l=n.t&&n.t.pos,f=E(n,"op",e);if(n.type==="raw"&&n.geo&&n.geo.box){var s=E(n,"sz",e),c=n.geo.box;s&&c[2]>0&&c[3]>0&&(i=[i[0]*(s[0]/c[2]),i[1]*(s[1]/c[3])])}if(n.or&&l&&l.length>1&&!Sn){var b=l[0][0],d=l[l.length-1][0],M=Math.min(.02,(d-b)/4),h=Math.max(b,Math.min(e-M,d-2*M)),y=E(n,"pos",h),x=E(n,"pos",h+2*M);(x[0]!==y[0]||x[1]!==y[1])&&(a+=Math.atan2(x[1]-y[1],x[0]-y[0])*180/Math.PI)}return r?{x:u[0]+t[0],y:u[1]+t[1],r:a,sx:i[0],sy:i[1],ox:t[0],oy:t[1],kx:o[0],ky:o[1],ba:Wn(n),cp:ie(n,e)}:{x:u[0]+t[0],y:u[1]+t[1],r:a,sx:i[0],sy:i[1],ox:t[0],oy:t[1],op:f==null?1:f,fill:E(n,"fill",e),stk:E(n,"stk",e),sw:E(n,"sw",e),d:Ge(n,e),kx:o[0],ky:o[1],fo:E(n,"fo",e),so:E(n,"so",e),dof:E(n,"dof",e),rad:n.t&&n.t.rad&&n.t.rad.length?E(n,"rad",e):null,gb:Ye(n,e),da:n.t&&n.t.da&&n.t.da.length?E(n,"da",e):null,trim:Be(n,e),ba:Wn(n),cp:ie(n,e)}}for(var ue={},Kn=null,_n=0;_n<g.L.length;_n++)ue[g.L[_n].id]=g.L[_n];function q(n){return n&&(ue[n]||Kn&&Kn(n))||null}function ie(n,e){var r=n.cs||n.type==="bone"&&!n.inh?q(n.parent):null;if(!r||!n.cs&&r.type!=="bone")return null;var t=E(r,"scl",e)||[1,1];if(t[0]===1&&t[1]===1)return null;var u=n.j||(n.geo?[n.geo.x,n.geo.y]:[0,0]);return[Wn(r),t[0]||1e-6,t[1]||1e-6,u[0],u[1]]}function Wn(n){return n.ba!=null?n.ba:n.type==="bone"&&n.geo&&n.geo.ang?n.geo.ang:0}function Be(n,e){var r=n.t||{},t=["ts","te","to"].some(function(o){return r[o]&&r[o].length||n.b&&n.b[o]!=null&&n.b[o]!==(o==="te"?100:0)});if(!t)return null;var u=E(n,"ts",e),a=E(n,"te",e),i=E(n,"to",e);return[u==null?0:u,a==null?100:a,i==null?0:i]}function ae(n){var e=Math.max(0,Math.min(100,Math.min(n[0],n[1]))),r=Math.max(0,Math.min(100,Math.max(n[0],n[1]))),t=r-e,u=e+(n[2]||0),a=(u%100+100)%100;return t<1e-6?["0 300",String(m(150-a))]:a+t<=100+1e-6?[m(t)+" "+m(200-t),String(m(-a))]:[m(t)+" "+m(100-t),String(m(-u))]}function Ge(n,e){var r=Ze(n,e);return r&&n.t&&n.t.sz&&n.t.sz.length&&(r=Qe(n,r,e)),r&&n.pins&&n.pins.length&&!Fn?We(n,r,e):r}function ze(n,e,r){var t=n[2]?e[0]/n[2]:1,u=n[3]?e[1]/n[3]:1;return[r[0]-(r[0]-n[0])*t,r[1]-(r[1]-n[1])*u,Math.max(0,e[0]),Math.max(0,e[1])]}function oe(n,e,r){return n.sa?[e[0]+n.sa[0]*e[2],e[1]+n.sa[1]*e[3]]:E(n,"org",r)||[0,0]}function Ye(n,e){var r=n.geo;if(!r||!n.t||!n.t.sz||!n.t.sz.length||n.type!=="rect"&&n.type!=="image"&&n.type!=="ellipse")return null;var t=n.type==="ellipse"?[(r.cx||0)-(r.rx||0),(r.cy||0)-(r.ry||0),2*(r.rx||0),2*(r.ry||0)]:[r.x||0,r.y||0,r.w||0,r.h||0];return ze(t,E(n,"sz",e),oe(n,t,e))}function Qe(n,e,r){var t=fe(n.b&&n.b.d||e),u=E(n,"sz",r),a=oe(n,t,r),i=t[2]>1e-9?u[0]/t[2]:1,o=t[3]>1e-9?u[1]/t[3]:1;return e.map(function(l){return{c:l.c,n:l.n.map(function(f){return f.map(function(s,c){return c%2?a[1]+(s-a[1])*o:a[0]+(s-a[0])*i})})}})}function fe(n){var e=1/0,r=1/0,t=-1/0,u=-1/0;function a(l,f){l<e&&(e=l),l>t&&(t=l),f<r&&(r=f),f>u&&(u=f)}function i(l,f,s,c){var b=-l+3*f-3*s+c,d=2*(l-2*f+s),M=f-l,h=[];if(Math.abs(b)<1e-12)Math.abs(d)>1e-12&&h.push(-M/d);else{var y=d*d-4*b*M;if(y>=0){var x=Math.sqrt(y);h.push((-d+x)/(2*b),(-d-x)/(2*b))}}return h.filter(function(Z){return Z>0&&Z<1})}function o(l,f){var s=[l[0],l[4],f[2],f[0]],c=[l[1],l[5],f[3],f[1]];a(f[0],f[1]),i(s[0],s[1],s[2],s[3]).concat(i(c[0],c[1],c[2],c[3])).forEach(function(b){var d=1-b,M=d*d*d,h=3*d*d*b,y=3*d*b*b,x=b*b*b;a(M*s[0]+h*s[1]+y*s[2]+x*s[3],M*c[0]+h*c[1]+y*c[2]+x*c[3])})}return(n||[]).forEach(function(l){var f=l.n;if(f.length){a(f[0][0],f[0][1]);for(var s=1;s<f.length;s++)o(f[s-1],f[s]);l.c&&f.length>1&&o(f[f.length-1],f[0])}}),isFinite(e)?[e,r,t-e,u-r]:[0,0,0,0]}var Fn=!1;function w(n,e){return[n[0]*e[0]+n[2]*e[1],n[1]*e[0]+n[3]*e[1],n[0]*e[2]+n[2]*e[3],n[1]*e[2]+n[3]*e[3],n[0]*e[4]+n[2]*e[5]+n[4],n[1]*e[4]+n[3]*e[5]+n[5]]}function Xe(n){var e=n[0]*n[3]-n[1]*n[2]||1e-12;return[n[3]/e,-n[1]/e,-n[2]/e,n[0]/e,(n[2]*n[5]-n[3]*n[4])/e,(n[1]*n[4]-n[0]*n[5])/e]}function sn(n,e){return[1,0,0,1,n,e]}function mn(n){var e=n*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}function Zn(n,e){return[n,0,0,e,0,0]}function le(n){var e=[1,0,0,1,0,0],r=n.cp;r&&(e=w(e,sn(r[3],r[4])),e=w(e,mn(r[0])),e=w(e,Zn(1/r[1],1/r[2])),e=w(e,mn(-r[0])),e=w(e,sn(-r[3],-r[4]))),e=w(e,sn(n.x,n.y)),e=w(e,mn(n.r)),n.kx&&(e=w(e,[1,0,Math.tan(n.kx*Math.PI/180),1,0,0])),n.ky&&(e=w(e,[1,Math.tan(n.ky*Math.PI/180),0,1,0,0]));var t=n.ba&&n.sx!==n.sy;return t&&(e=w(e,mn(n.ba))),e=w(e,Zn(n.sx,n.sy)),t&&(e=w(e,mn(-n.ba))),w(e,sn(-n.ox,-n.oy))}var $n={};function Jn(n){if($n[n])return $n[n];for(var e=[1,0,0,1,0,0],r=/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g,t;t=r.exec(n);){var u=t[2].split(/[\s,]+/).filter(Boolean).map(Number),a=t[1];a==="matrix"&&u.length===6?e=w(e,u):a==="translate"?e=w(e,sn(u[0]||0,u[1]||0)):a==="scale"?e=w(e,Zn(u[0],u.length>1?u[1]:u[0])):a==="rotate"?e=u.length>2?w(w(w(e,sn(u[1],u[2])),mn(u[0])),sn(-u[1],-u[2])):w(e,mn(u[0]||0)):a==="skewX"?e=w(e,[1,0,Math.tan((u[0]||0)*Math.PI/180),1,0,0]):a==="skewY"&&(e=w(e,[1,Math.tan((u[0]||0)*Math.PI/180),0,1,0,0]))}return $n[n]=e}function Vn(n,e,r){for(var t=le(Tn(n,e,!0)),u=q(n.parent),a=0;u&&u!==r&&a++<100;)u.xf&&(t=w(Jn(u.xf),t)),t=w(le(Tn(u,e,!0)),t),u=q(u.parent);return t}function Ke(n,e,r){var t=Vn(n,e,r),u=n.type?n.type==="path":!n.mesh;return u&&n.xf?w(t,Jn(n.xf)):t}function se(n,e,r,t,u){for(var a=[],i=q(e.parent),o=null,l=0;i&&l++<100;)a.push(i),i=q(i.parent);for(i=q(n.parent),l=0;i&&l++<100;i=q(i.parent))if(a.indexOf(i)>=0){o=i;break}var f=Sn;Sn=t;var s=Ke(n,r,o),c=Math.abs(s[0]*s[3]-s[1]*s[2])<1e-12?[1,0,0,1,0,0]:w(Xe(s),Vn(e,r,o));Sn=f;var b=e.geo||{},d=(b.ang||0)*Math.PI/180,M=(b.x||0)+(u&&u[0]||0),h=(b.y||0)+(u&&u[1]||0),y=c[0]*Math.cos(d)+c[2]*Math.sin(d),x=c[1]*Math.cos(d)+c[3]*Math.sin(d);return[c[0]*M+c[2]*h+c[4],c[1]*M+c[3]*h+c[5],Math.atan2(x,y)*180/Math.PI]}function me(n,e,r){var t=e.bone?q(e.bone):null;if(t){var u=se(n,t,r,!0,e.bo),a=se(n,t,r,!1,e.bo);return[u[0],u[1],a[0],a[1],a[2]-u[2]]}var i=E(n,"pin"+e.n,r)||[e.x,e.y];return[e.x,e.y,i[0],i[1],E(n,"pinr"+e.n,r)||0]}function ce(n,e){var r=n.pins||[],t=Math.max(10,Math.min(1e3,n.reach||100)),u=Math.max(.5,Math.min(8,200/t));return[r.map(function(a){var i=me(n,a,e),o=i[4]*Math.PI/180;return[i[0],i[1],i[2],i[3],Math.cos(o),Math.sin(o)]}),u]}function be(n,e,r,t,u,a,i,o){var l=0,f=0,s=0,c;for(c=0;c<n.length;c++){var b=n[c],d=r-b[0],M=t-b[1],h=1/(Math.pow(d*d+M*M,e/2)+1e-6),y=u-b[0],x=a-b[1];l+=h,f+=h*(b[2]+y*b[4]-x*b[5]),s+=h*(b[3]+y*b[5]+x*b[4])}i[o]=l?f/l:u,i[o+1]=l?s/l:a}function We(n,e,r){var t=ce(n,r),u=t[0],a=t[1];return e.map(function(i){return{c:i.c,n:i.n.map(function(o){for(var l=[0,0,0,0,0,0],f=0;f<6;f+=2)be(u,a,o[0],o[1],o[f],o[f+1],l,f);return l})}})}function ge(n,e){var r=n.mesh,t=[];if(!r)return t;var u=!Fn&&n.pins&&n.pins.length,a=u?ce(n,e):null,i=[],o;for(o=0;o<r.v.length;o++)a?be(a[0],a[1],r.v[o][0],r.v[o][1],r.v[o][0],r.v[o][1],i,o*2):(i[o*2]=r.v[o][0],i[o*2+1]=r.v[o][1]);for(o=0;o<r.t.length;o++){var l=r.t[o],f=r.v[l[0]],s=r.v[l[1]],c=r.v[l[2]],b=s[0]-f[0],d=s[1]-f[1],M=c[0]-f[0],h=c[1]-f[1],y=b*h-d*M;if(!a||!y){t.push([1,0,0,1,0,0]);continue}var x=i[l[0]*2],Z=i[l[0]*2+1],$=i[l[1]*2]-x,pn=i[l[1]*2+1]-Z,an=i[l[2]*2]-x,Rn=i[l[2]*2+1]-Z,kn=h/y,In=-M/y,Ce=-d/y,Re=b/y,ke=$*kn+an*Ce,Ie=$*In+an*Re,Oe=pn*kn+Rn*Ce,Ae=pn*In+Rn*Re;t.push([ke,Oe,Ie,Ae,x-ke*f[0]-Ie*f[1],Z-Oe*f[0]-Ae*f[1]])}return t}function Ze(n,e){var r=E(n,"d",e),t=n.t||{};if(n.shape&&t.rad&&t.rad.length)return he(n.shape,E(n,"rad",e),!0);if(r&&r[0]&&r[0].n.length===2&&(t.p0&&t.p0.length||t.p1&&t.p1.length)){var u=r[0].n.map(function(a,i){var o=t["p"+i]&&t["p"+i].length?E(n,"p"+i,e):null;if(!o)return a;var l=o[0]-a[0],f=o[1]-a[1];return[a[0]+l,a[1]+f,a[2]+l,a[3]+f,a[4]+l,a[5]+f]});return[{c:r[0].c,n:u}]}return r}function de(n){for(var e=[],r=n.kind==="star",t=r?n.n*2:n.n,u=0;u<t;u++){var a=(-90+n.rot+u*360/t)*Math.PI/180,i=r&&u%2?n.r*(n.ratio==null?.45:n.ratio):n.r;e.push([n.cx+i*Math.cos(a),n.cy+i*Math.sin(a)])}return e}function dn(n,e){return Math.hypot(n[0]-e[0],n[1]-e[1])}function ye(n){for(var e=n.length,r=1/0,t=0;t<e;t++){var u=n[(t+e-1)%e],a=n[t],i=n[(t+1)%e],o=Math.atan2(u[1]-a[1],u[0]-a[0]),l=Math.atan2(i[1]-a[1],i[0]-a[0]),f=Math.abs(o-l);f>Math.PI&&(f=2*Math.PI-f),r=Math.min(r,Math.min(dn(u,a),dn(i,a))/2*Math.tan(f/2))}return isFinite(r)?Math.max(0,r):0}function I(n){return Math.round(n*100)/100}function he(n,e,r){for(var t=de(n),u=t.length,a=Math.max(0,Math.min(e||0,ye(t))),i=[],o=0;o<u;o++){var l=t[o];if(a<=0&&!r){i.push([I(l[0]),I(l[1]),I(l[0]),I(l[1]),I(l[0]),I(l[1])]);continue}var f=t[(o+u-1)%u],s=t[(o+1)%u],c=[(f[0]-l[0])/dn(f,l),(f[1]-l[1])/dn(f,l)],b=[(s[0]-l[0])/dn(s,l),(s[1]-l[1])/dn(s,l)],d=Math.acos(Math.max(-1,Math.min(1,c[0]*b[0]+c[1]*b[1]))),M=a/Math.tan(d/2),h=4/3*Math.tan((Math.PI-d)/4)*a,y=[l[0]+c[0]*M,l[1]+c[1]*M],x=[l[0]+b[0]*M,l[1]+b[1]*M];i.push([I(y[0]),I(y[1]),I(y[0]),I(y[1]),I(y[0]-c[0]*h),I(y[1]-c[1]*h)]),i.push([I(x[0]),I(x[1]),I(x[0]-b[0]*h),I(x[1]-b[1]*h),I(x[0]),I(x[1])])}return[{c:!0,n:i}]}function pe(n){if(n.g==="rad"){var e=n.cx==null?.5:n.cx,r=n.cy==null?.5:n.cy,t=n.r==null?.5:n.r,u=n.ra||0,a=n.rr==null?1:n.rr,i={cx:String(m(e)),cy:String(m(r)),r:String(m(t)),fx:String(m(e)),fy:String(m(r))};return(m(u)||m(a)!==1)&&(i.gradientTransform="translate("+m(e)+","+m(r)+") rotate("+m(u)+") scale(1,"+m(a)+") translate("+m(-e)+","+m(-r)+")"),i}var o=Hn(n);return{x1:String(m(o[0])),y1:String(m(o[1])),x2:String(m(o[2])),y2:String(m(o[3]))}}function Hn(n){if(n.p&&n.p.length===4)return n.p.slice();var e=((n.a==null?90:n.a)-90)*Math.PI/180,r=Math.cos(e)/2,t=Math.sin(e)/2;return[.5-r,.5-t,.5+r,.5+t]}function m(n){return Math.round(n*1e3)/1e3}var $e=[.2126,.7152,.0722,.2126,.7152,.0722,.2126,.7152,.0722],Je=[.393,.769,.189,.349,.686,.168,.272,.534,.131];function ve(n,e,r){if(!n)return String(typeof e=="number"?m(e):e);var t=Math.max(0,+e||0),u;if(n==="add")return String(m(t+Math.max(0,+r||0)));if(n==="half")return String(m(t/2));if(n==="bri")u=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0];else if(n==="con"){var a=.5-.5*t;u=[t,0,0,0,a,0,t,0,0,a,0,0,t,0,a]}else if(n==="inv"){t=Math.min(1,t);var i=1-2*t;u=[i,0,0,0,t,0,i,0,0,t,0,0,i,0,t]}else{t=Math.min(1,t);var o=n==="sep"?Je:$e;u=[];for(var l=0;l<3;l++){for(var f=0;f<3;f++)u.push(o[l*3+f]*t+(l===f?1-t:0));u.push(0,0)}}return u.concat([0,0,0,1,0]).map(m).join(" ")}function Me(n){return Math.round(n*1e6)/1e6}function Ue(n){var e=n.cp;return(e?"translate("+m(e[3])+","+m(e[4])+") rotate("+m(e[0])+") scale("+m(1/e[1])+","+m(1/e[2])+") rotate("+m(-e[0])+") translate("+m(-e[3])+","+m(-e[4])+") ":"")+"translate("+m(n.x)+","+m(n.y)+") rotate("+m(n.r)+(n.kx?") skewX("+m(n.kx):"")+(n.ky?") skewY("+m(n.ky):"")+(n.ba&&n.sx!==n.sy?") rotate("+m(n.ba):"")+") scale("+m(n.sx)+","+m(n.sy)+(n.ba&&n.sx!==n.sy?") rotate("+m(-n.ba):"")+") translate("+m(-n.ox)+","+m(-n.oy)+")"}function Ee(n){return n&&n.length?n.map(function(e){return String(m(Math.max(0,e)))}).join(" "):"none"}function xe(n){var e="";function r(t,u){t[4]===t[0]&&t[5]===t[1]&&u[2]===u[0]&&u[3]===u[1]?e+="L"+m(u[0])+" "+m(u[1]):e+="C"+m(t[4])+" "+m(t[5])+" "+m(u[2])+" "+m(u[3])+" "+m(u[0])+" "+m(u[1])}return(n||[]).forEach(function(t){var u=t.n,a;if(u.length){for(e+="M"+m(u[0][0])+" "+m(u[0][1]),a=1;a<u.length;a++)r(u[a-1],u[a]);t.c&&(r(u[u.length-1],u[0]),e+="Z")}}),e||"M0 0"}function cn(n){return n in J||(J[n]=p?p.querySelector("#"+n):null),J[n]}function we(n,e,r){if(!L(r))return r;var t=r.g==="rad"?"radialGradient":"linearGradient",u=cn(e);if(!u||u.tagName!==t){var a=(n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg",t);a.setAttribute("id",e),u&&u.parentNode?u.parentNode.replaceChild(a,u):n.parentNode.insertBefore(a,n),u=a,J[e]=a}var i=pe(r);for(var o in i)u.setAttribute(o,i[o]);for(var l=u.getElementsByTagName("stop");l.length>r.s.length;)u.removeChild(l[l.length-1]);for(;l.length<r.s.length;)u.appendChild((n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg","stop"));for(var f=0;f<r.s.length;f++){var s=Q(r.s[f][1])||[0,0,0,1];l[f].setAttribute("offset",String(m(r.s[f][0]))),l[f].setAttribute("stop-color","rgb("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+")"),l[f].setAttribute("stop-opacity",String(m(s[3])))}return"url(#"+e+")"}function Un(n){for(var e=0;e<g.L.length;e++){var r=g.L[e],t=cn(g.p+r.id),u=cn(g.p+r.id+"-s"),a=cn(g.p+r.id+"-sf");if(!(!t||!u)){var i=Tn(r,n),o=function(kn,In){u.setAttribute(kn,In),a&&a.setAttribute(kn,In)};if(t.setAttribute("transform",Ue(i)),t.setAttribute("opacity",String(m(i.op))),i.fill!=null&&o("fill",we(u,g.p+r.id+"-gf",i.fill)),i.stk!=null&&u.setAttribute("stroke",we(u,g.p+r.id+"-gs",i.stk)),i.sw!=null&&u.setAttribute("stroke-width",String(m(a?i.sw*2:i.sw))),i.trim){var l=ae(i.trim);u.setAttribute("pathLength","100"),u.setAttribute("stroke-dasharray",l[0]),u.setAttribute("stroke-dashoffset",l[1])}else i.dof!=null&&u.setAttribute("stroke-dashoffset",String(m(i.dof))),i.da&&u.setAttribute("stroke-dasharray",Ee(i.da));if(i.fo!=null&&o("fill-opacity",String(m(i.fo))),i.so!=null&&u.setAttribute("stroke-opacity",String(m(i.so))),i.d&&o("d",xe(i.d)),i.gb){var f=i.gb,s=r.type==="ellipse"?{cx:f[0]+f[2]/2,cy:f[1]+f[3]/2,rx:f[2]/2,ry:f[3]/2}:{x:f[0],y:f[1],width:f[2],height:f[3]};for(var c in s)o(c,String(m(s[c])))}if(i.rad!=null&&!r.shape&&(o("rx",String(m(i.rad))),o("ry",String(m(i.rad)))),r.dw){var b=q(r.dw),d=cn(g.p+r.id+"-w");b&&d&&d.setAttribute("transform","matrix("+Vn(b,n,q(r.du)).map(Me).join(",")+")")}if(r.mesh)for(var M=ge(r,n),h=0;h<M.length;h++){var y=cn(g.p+r.id+"-m"+h);y&&y.setAttribute("transform","matrix("+M[h].map(Me).join(",")+")")}if(r.fa)for(var x in r.fa){var Z=E(r,x,n),$=r.fa[x];if(Z!=null){typeof $[0]=="string"&&($=[$]);for(var pn=0;pn<$.length;pn++){var an=$[pn],Rn=cn(g.p+r.id+an[0]);Rn&&Rn.setAttribute(an[1],ve(an[2],Z,an[3]?E(r,an[3],n):0))}}}}}}var nn=g.dur||1,G=g.it>0?Math.floor(g.it):0,jn=/alternate/.test(g.dir||""),en=/reverse/.test(g.dir||"")?-1:1,V=en,Dn=g.speed>0?g.speed:1,qn=g.fps>0?Math.min(100,g.fps):100,Bn=g.fill===-1||g.fill==="backwards"?-1:1,K=!1,Ln=0,ne=-1e9,W=!1,z=!1,_=!1,rn={},Pn=0;function yn(){return G?G*nn:nn}function bn(){return en>0?0:yn()}var C=bn();function ee(n){var e=Math.floor(n/nn),r=n-e*nn;return G&&(n<=0?(e=0,r=0):e>=G&&(e=G-1,r=nn)),jn&&(e%2+2)%2===1?nn-r:r}function un(n){var e=rn[n];e&&e.slice().forEach(function(r){try{r.call(v,Math.round(C*1e3))}catch{}})}function hn(){Un(ee(C)),un("keyframe")}function Cn(){K=!1,Pn&&cancelAnimationFrame(Pn),Pn=0}function Se(){Cn(),z&&(z=!1,V=en),W=!0,Bn<0&&(C=bn()),hn(),un("end")}function Pe(n){if(!(!K||_)){if(C+=(n-Ln)/1e3*Dn*V,Ln=n,V>0&&(G||z&&en<0)&&C>=yn())return C=yn(),Se();if(V<0&&(G||z&&en>0)&&C<=0)return C=0,Se();n-ne>=1e3/qn-1&&(ne=n,hn()),Pn=requestAnimationFrame(Pe)}}function Gn(){K||_||(K=!0,W=!1,Ln=performance.now(),ne=-1e9,Pn=requestAnimationFrame(Pe))}var v={play:function(){return _||K||(W&&(V=en,z=!1,C=bn()),Gn(),un("play")),v},pause:function(){return _||!K||(Cn(),un("pause")),v},toggle:function(){return K?v.pause():v.play()},togglePlay:function(){return v.toggle()},restart:function(){return _||(Cn(),z=!1,V=en,C=bn(),W=!1,hn(),Gn(),un("restart")),v},reverse:function(){return _||(V=-V,z=!1,W=!1,Gn(),un("reverse")),v},rollback:function(){if(_)return v;if(!G){var n=jn?2*nn:nn;C=(C%n+n)%n}return Math.abs(C-bn())<1e-6&&!K||(V=-en,z=!0,W=!1,Gn(),un("reverse")),v},stop:function(){return _||(Cn(),z=!1,V=en,C=bn(),W=!1,hn(),un("stop")),v},seek:function(n){return _||(C=Math.max(0,Math.min(100,+n||0))/100*yn(),W=!1,hn()),v},seekTo:function(n){return _||(C=(+n||0)/1e3,G&&(C=Math.max(0,Math.min(yn(),C))),W=!1,hn()),v},seekBy:function(n){return v.seekTo(C*1e3+(+n||0))},set:function(n,e){return _||(n==="speed"?Dn=Math.max(.01,Math.min(100,+e||1)):n==="fps"?qn=Math.max(1,Math.min(100,+e||100)):n==="iterations"?G=e===1/0||!(+e>0)?0:Math.floor(+e):n==="direction"?(V=+e<0?-1:1,z=!1):n==="alternate"?jn=!!e:n==="fill"&&(Bn=+e<0?-1:1)),v},ready:function(n){return typeof n=="function"&&setTimeout(function(){n.call(v,v)},0),v},on:function(n,e,r){return typeof e!="function"||String(n).split(/[\s,]+/).forEach(function(t){t&&(rn[t]=rn[t]||[],r?rn[t].unshift(e):rn[t].push(e))}),v},off:function(n,e){return rn[n]&&(rn[n]=e?rn[n].filter(function(r){return r!==e}):[]),v},destruct:function(){_||(Cn(),rn={},(v._cleanup||[]).forEach(function(n){try{n()}catch{}}),v._cleanup=[],Un(ee(bn())),_=!0)},onEnd:function(n){return v.on("end",n)},setRate:function(n){return v.set("speed",n)},apply:Un,comp:Tn,lookup:function(n){Kn=n},meshMats:ge,pinAt:me,worldOf:Vn,restPins:function(n){var e=Fn;return Fn=!!n,e},get:E,fxv:ve,gAttrs:pe,linP:Hn,trimDash:ae,isG:L,pc:Q,dstr:xe,dashStr:Ee,pathBox:fe,xfM:Jn,poly:he,corners:de,maxRad:ye,ease:R,loc:ee,EZ:H,_cleanup:[]},A=function(n){return{get:n,enumerable:!0}};return Object.defineProperties(v,{currentTime:A(function(){return Math.round(C*1e3)}),duration:A(function(){return Math.round(nn*1e3)}),totalTime:A(function(){return Math.round(yn()*1e3)}),fps:A(function(){return qn}),speed:A(function(){return Dn}),direction:A(function(){return V}),fill:A(function(){return Bn}),iterations:A(function(){return G}),hasEnded:A(function(){return W}),isAlternate:A(function(){return jn}),isBackwards:A(function(){return Bn<0}),isInfinite:A(function(){return!G}),isPlaying:A(function(){return K}),isReversed:A(function(){return V<0}),isRollingBack:A(function(){return K&&z}),state:A(function(){return _?"destroyed":K?z?"rollback":"playing":W?"ended":"paused"})}),v}function Te(g,p,S){var H=S&&S.r||[0,100,1,0],O=Math.max(0,+(S&&S.sm)||0),J=!!S&&S.b===-1,P=window,U=g,T=null;try{P.frameElement&&P.parent&&P.parent!==P&&(U=P.frameElement,P=P.parent)}catch{}for(var Y=P.document.documentElement,j=P.document.body,R=U.parentNode;R&&R.nodeType===1&&R!==Y&&R!==j;R=R.parentNode){var Q=P.getComputedStyle(R).overflowY;if((Q==="auto"||Q==="scroll"||Q==="overlay")&&R.scrollHeight>R.clientHeight){T=R;break}}function L(k,D,fn,F){var ln=k+H[0]*D-(fn+H[1]/100*F),wn=k+H[2]*D-(fn+H[3]/100*F);return wn<=ln?ln<=0?1:0:Math.max(0,Math.min(1,-ln/(wn-ln)))}function vn(){var k=U.getBoundingClientRect(),D=0,fn=P.innerHeight||Y.clientHeight;return T&&(D=T.getBoundingClientRect().top+T.clientTop,fn=T.clientHeight),L(k.top,k.height,D,fn)}var On=O/3,N=-1,X=0,B=0,gn=0,Mn=P.requestAnimationFrame||function(k){return setTimeout(function(){k(Date.now())},16)},En=P.cancelAnimationFrame||clearTimeout;function on(k){B=0;var D=gn?(k-gn)/1e3:1/60;gn=k,N<0||!On?N=X:N+=(X-N)*(1-Math.exp(-D/On)),Math.abs(X-N)<.5&&(N=X),p.seekTo(N),N!==X?B=Mn(on):gn=0}function tn(){var k=p.duration||0;X=vn()*k,J&&(X=k-X),B||(B=Mn(on))}var An=T||P,xn={passive:!0};return An.addEventListener("scroll",tn,xn),P.addEventListener("resize",tn),p._cleanup&&p._cleanup.push(function(){An.removeEventListener("scroll",tn,xn),P.removeEventListener("resize",tn),B&&En(B),B=0}),tn(),B&&En(B),B=0,N=X,p.seekTo(N),{progress:vn,at:L,update:tn,box:T}}var re=3;function De(g,p,S){let H=S.b===-1?-1:1,O=S.o||"pause",J=p._cleanup=[],P=(j,R,Q)=>{j.addEventListener(R,Q),J.push(()=>j.removeEventListener(R,Q))},U=()=>{(p.direction!==H||p.isRollingBack)&&p.set("direction",H),p.play()},T=()=>{O==="pause"?p.pause():O==="reverse"?p.rollback():O==="start"?p.stop():O==="restart"&&p.restart()},Y=S.t||"load";if(Y==="hover")P(g,"mouseenter",U),P(g,"mouseleave",T);else if(Y==="click")g.style.cursor="pointer",P(g,"click",()=>{p.isPlaying&&!p.isRollingBack?O!=="none"&&T():U()});else if(Y==="scroll")if("IntersectionObserver"in window){let j=new IntersectionObserver(R=>{R[0].isIntersecting?U():O!=="none"&&(p.isPlaying||p.currentTime>0)&&T()},{threshold:.35});j.observe(g),J.push(()=>j.disconnect())}else p.play();else Y==="scrub"?Te(g,p,S.sc||{r:[0,100,1,0]}):Y!=="api"&&p.play()}function zn(g,p){if(!g)return null;if(g.player)return g.player;if(!p){let O=g.querySelector('script[type="application/json"][data-cin]');if(!O)return null;try{p=JSON.parse(O.textContent||"")}catch{return null}}if((p.f||1)>re)return null;let S=Ne(p.d,g);g.player=g.cinPlayer=S,S.stop(),(p.rm==="first"||p.rm==="last")&&!!window.matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?S.seekTo(p.rm==="first"?0:Math.max(0,Math.round((p.d.dur||1)*1e3)-1)):De(g,S,p);try{g.dispatchEvent(new CustomEvent("cinready",{detail:S}))}catch{}return S}function Yn(g=document){g.querySelectorAll('script[type="application/json"][data-cin]').forEach(p=>{let S=p.closest("svg");S&&!S.player&&zn(S)})}var qe="1.3.1",_e=typeof document!="undefined"?document.currentScript:null,Fe=window;Fe.CinPlayer=Fe.CinPlayer||{version:qe,f:re,boot:zn,scan:Yn};_e&&zn(_e.closest("svg"));typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Yn()):Yn());})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svgcinema-player",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "The player for animated SVGs exported from SVGcinema with Player › External.",
5
5
  "main": "cin-player.min.js",
6
6
  "browser": "cin-player.min.js",
@@ -18,5 +18,10 @@
18
18
  "svgcinema"
19
19
  ],
20
20
  "homepage": "https://www.svgcinema.com/",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/asafco83/svgcinema.git",
24
+ "directory": "player"
25
+ },
21
26
  "license": "SEE LICENSE IN LICENSE"
22
27
  }