svgcinema-player 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cin-player.min.js +2 -2
- package/package.json +1 -1
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.0
|
|
16
|
+
https://cdn.jsdelivr.net/npm/svgcinema-player@1.1.0/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.0.
|
|
2
|
-
"use strict";(()=>{function he(y,v){var C={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"},X={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]},R={},B={},J=2*Math.PI/3,U=2*Math.PI/4.5,D={hold:function(n){return n<1?0:1},outBounce:F,inBounce:function(n){return 1-F(1-n)},inOutBounce:function(n){return n<.5?(1-F(1-2*n))/2:(1+F(2*n-1))/2},outElastic:function(n){return n===0||n===1?n:Math.pow(2,-10*n)*Math.sin((n*10-.75)*J)+1},inElastic:function(n){return n===0||n===1?n:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*J)},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 H(n){var e=3*n[0],r=3*(n[2]-n[0])-e,t=1-e-r,u=3*n[1],i=3*(n[3]-n[1])-u,o=1-u-i;function a(f){return((t*f+r)*f+e)*f}function l(f){return((o*f+i)*f+u)*f}function s(f){return(3*t*f+2*r)*f+e}return function(f){var c=f,b,g,p,h=0,M=1;for(b=0;b<8;b++){if(g=a(c)-f,Math.abs(g)<1e-6)return l(c);if(p=s(c),Math.abs(p)<1e-6)break;c-=g/p}for(c=f;M-h>1e-6&&(g=a(c),!(Math.abs(g-f)<1e-6));)f>g?h=c:M=c,c=(h+M)/2;return l(c)}}function F(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 Y(n,e){if(!n||n==="linear")return e;if(typeof n!="string"){var r=n.join(",");return(R[r]||(R[r]=H(n)))(e)}if(D[n])return D[n](e);var t=R[n]||(R[n]=H(X[n]||X.ease));return t(e)}function K(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 q(n){return!!n&&typeof n=="object"&&(n.g==="lin"||n.g==="rad")&&n.s&&n.s.length>0}function _n(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 ln(r[t][1],r[t+1][1],u>0?(e-r[t][0])/u:0)}return r[r.length-1][1]}function Ee(n,e,r){if(q(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]]}),q(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(s){t.indexOf(s[0])<0&&t.push(s[0])}),t.sort(function(s,f){return s-f});var u=n.s.length===e.s.length?n.s.map(function(s,f){return[s[0]+(e.s[f][0]-s[0])*r,ln(s[1],e.s[f][1],r)]}):t.map(function(s){return[s,ln(_n(n,s),_n(e,s),r)]}),i=function(s,f,c){return(s==null?c:s)+((f==null?c:f)-(s==null?c:s))*r},o={g:n.g,a:i(n.a,e.a,90),cx:i(n.cx,e.cx,.5),cy:i(n.cy,e.cy,.5),r:i(n.r,e.r,.5),s:u};if(n.p||e.p){var a=gn(n),l=gn(e);o.p=a.map(function(s,f){return s+(l[f]-s)*r})}return(n.ra!=null||e.ra!=null)&&(o.ra=i(n.ra,e.ra,0)),(n.rr!=null||e.rr!=null)&&(o.rr=i(n.rr,e.rr,1)),o}function ln(n,e,r){if(q(n)||q(e))return Ee(n,e,r);var t=K(n),u=K(e);if(!t||!u)return r<1?n:e;var i=[0,1,2].map(function(a){return Math.round(t[a]+(u[a]-t[a])*r)}),o=t[3]+(u[3]-t[3])*r;return o>=.999?"rgb("+i.join(",")+")":"rgba("+i.join(",")+","+Math.round(o*1e3)/1e3+")"}function Me(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 xe(n,e,r){return Me(n,e)?n.map(function(t,u){return{c:t.c,n:t.n.map(function(i,o){var a=e[u].n[o];return i.map(function(l,s){return l+(a[s]-l)*r})})}}):r<1?n:e}function Pe(n,e,r){n=n||[],e=e||[];var t=n.length,u=e.length,i=[],o;if(t!==u)if(!t)n=sn(e.map(Vn),1);else if(!u)e=sn(n.map(Vn),1);else{var a=t*u/Fn(t,u);n=sn(n,a/t),e=sn(e,a/u)}for(o=0;o<n.length;o++)i.push(n[o]+(e[o]-n[o])*r);return i}function Vn(){return 0}function Fn(n,e){return e?Fn(e,n%e):n||1}function sn(n,e){for(var r=[],t=0;t<e;t++)r=r.concat(n);return r}function Se(n,e,r,t){return n==="c"?ln(e,r,t):n==="a"?Pe(e,r,t):n==="m"?xe(e,r,t):n==="v"?[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]:e+(r-e)*t}function we(n,e,r,t,u){var i=u*u,o=i*u;return[0,1].map(function(a){return .5*(2*e[a]+(-n[a]+r[a])*u+(2*n[a]-5*e[a]+4*r[a]-t[a])*i+(-n[a]+3*e[a]-3*r[a]+t[a])*o)})}function Tn(n,e,r,t){var u=1-t,i=u*u*u,o=3*u*u*t,a=3*u*t*t,l=t*t*t;return[i*n[0]+o*(n[0]+e[0])+a*(r[0]+e[2])+l*r[0],i*n[1]+o*(n[1]+e[1])+a*(r[1]+e[3])+l*r[1]]}var En={},jn=0;function Ce(n,e,r,t){if(t<=0||t>=1)return t;var u=n.join()+";"+e.join()+";"+r.join(),i=En[u],o=64,a;if(!i){++jn>400&&(En={},jn=1),i=[0];var l=n;for(a=1;a<=o;a++){var s=Tn(n,e,r,a/o);i.push(i[a-1]+Math.hypot(s[0]-l[0],s[1]-l[1])),l=s}En[u]=i}var f=t*i[o];if(!(i[o]>0))return t;for(a=1;a<=o;a++)if(i[a]>=f)return(a-1+(f-i[a-1])/(i[a]-i[a-1]||1))/o;return 1}function ke(n,e,r){var t=n.t[e],u=t.length,i,o,a,l;if(u===1||r<=t[0][0])return t[0][1];if(r>=t[u-1][0])return t[u-1][1];for(i=0;i<u-1;i++)if(o=t[i],a=t[i+1],r<a[0])return l=Y(o[2],(r-o[0])/(a[0]-o[0])),e==="pos"&&o[3]?Tn(o[1],o[3],a[1],n.ev?Ce(o[1],o[3],a[1],l):l):e==="pos"&&n.sm&&u>2?we((t[i-1]||o)[1],o[1],a[1],(t[i+2]||a)[1],l):Se(C[e]||(typeof o[1]=="string"?"c":typeof o[1]=="object"?"v":"n"),o[1],a[1],l);return t[u-1][1]}var un=!1;function E(n,e,r){var t=!un&&n.t&&n.t[e];return t&&t.length?ke(n,e,r):e==="org"?n.o||[0,0]:n.b[e]}function fn(n,e,r){var t=E(n,"org",e)||[0,0],u=E(n,"pos",e)||[0,0],i=E(n,"rot",e)||0,o=E(n,"scl",e)||[1,1],a=E(n,"skw",e)||[0,0],l=n.t&&n.t.pos,s=E(n,"op",e);if(n.or&&l&&l.length>1&&!un){var f=l[0][0],c=l[l.length-1][0],b=Math.min(.02,(c-f)/4),g=Math.max(f,Math.min(e-b,c-2*b)),p=E(n,"pos",g),h=E(n,"pos",g+2*b);(h[0]!==p[0]||h[1]!==p[1])&&(i+=Math.atan2(h[1]-p[1],h[0]-p[0])*180/Math.PI)}return r?{x:u[0]+t[0],y:u[1]+t[1],r:i,sx:o[0],sy:o[1],ox:t[0],oy:t[1],kx:a[0],ky:a[1],ba:xn(n),cp:Gn(n,e)}:{x:u[0]+t[0],y:u[1]+t[1],r:i,sx:o[0],sy:o[1],ox:t[0],oy:t[1],op:s==null?1:s,fill:E(n,"fill",e),stk:E(n,"stk",e),sw:E(n,"sw",e),d:Ie(n,e),kx:a[0],ky:a[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:Ae(n,e),da:n.t&&n.t.da&&n.t.da.length?E(n,"da",e):null,trim:Re(n,e),ba:xn(n),cp:Gn(n,e)}}for(var zn={},Mn=null,mn=0;mn<y.L.length;mn++)zn[y.L[mn].id]=y.L[mn];function T(n){return n&&(zn[n]||Mn&&Mn(n))||null}function Gn(n,e){var r=n.cs||n.type==="bone"&&!n.inh?T(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[xn(r),t[0]||1e-6,t[1]||1e-6,u[0],u[1]]}function xn(n){return n.ba!=null?n.ba:n.type==="bone"&&n.geo&&n.geo.ang?n.geo.ang:0}function Re(n,e){var r=n.t||{},t=["ts","te","to"].some(function(a){return r[a]&&r[a].length||n.b&&n.b[a]!=null&&n.b[a]!==(a==="te"?100:0)});if(!t)return null;var u=E(n,"ts",e),i=E(n,"te",e),o=E(n,"to",e);return[u==null?0:u,i==null?100:i,o==null?0:o]}function Bn(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),i=(u%100+100)%100;return t<1e-6?["0 300",String(m(150-i))]:i+t<=100+1e-6?[m(t)+" "+m(200-t),String(m(-i))]:[m(t)+" "+m(100-t),String(m(-u))]}function Ie(n,e){var r=Te(n,e);return r&&n.t&&n.t.sz&&n.t.sz.length&&(r=Ne(n,r,e)),r&&n.pins&&n.pins.length&&!cn?Fe(n,r,e):r}function Oe(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 Qn(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 Ae(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 Oe(t,E(n,"sz",e),Qn(n,t,e))}function Ne(n,e,r){var t=Xn(n.b&&n.b.d||e),u=E(n,"sz",r),i=Qn(n,t,r),o=t[2]>1e-9?u[0]/t[2]:1,a=t[3]>1e-9?u[1]/t[3]:1;return e.map(function(l){return{c:l.c,n:l.n.map(function(s){return s.map(function(f,c){return c%2?i[1]+(f-i[1])*a:i[0]+(f-i[0])*o})})}})}function Xn(n){var e=1/0,r=1/0,t=-1/0,u=-1/0;function i(l,s){l<e&&(e=l),l>t&&(t=l),s<r&&(r=s),s>u&&(u=s)}function o(l,s,f,c){var b=-l+3*s-3*f+c,g=2*(l-2*s+f),p=s-l,h=[];if(Math.abs(b)<1e-12)Math.abs(g)>1e-12&&h.push(-p/g);else{var M=g*g-4*b*p;if(M>=0){var P=Math.sqrt(M);h.push((-g+P)/(2*b),(-g-P)/(2*b))}}return h.filter(function(tn){return tn>0&&tn<1})}function a(l,s){var f=[l[0],l[4],s[2],s[0]],c=[l[1],l[5],s[3],s[1]];i(s[0],s[1]),o(f[0],f[1],f[2],f[3]).concat(o(c[0],c[1],c[2],c[3])).forEach(function(b){var g=1-b,p=g*g*g,h=3*g*g*b,M=3*g*b*b,P=b*b*b;i(p*f[0]+h*f[1]+M*f[2]+P*f[3],p*c[0]+h*c[1]+M*c[2]+P*c[3])})}return(n||[]).forEach(function(l){var s=l.n;if(s.length){i(s[0][0],s[0][1]);for(var f=1;f<s.length;f++)a(s[f-1],s[f]);l.c&&s.length>1&&a(s[s.length-1],s[0])}}),isFinite(e)?[e,r,t-e,u-r]:[0,0,0,0]}var cn=!1;function x(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 _e(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 W(n,e){return[1,0,0,1,n,e]}function Z(n){var e=n*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}function Pn(n,e){return[n,0,0,e,0,0]}function Hn(n){var e=[1,0,0,1,0,0],r=n.cp;r&&(e=x(e,W(r[3],r[4])),e=x(e,Z(r[0])),e=x(e,Pn(1/r[1],1/r[2])),e=x(e,Z(-r[0])),e=x(e,W(-r[3],-r[4]))),e=x(e,W(n.x,n.y)),e=x(e,Z(n.r)),n.kx&&(e=x(e,[1,0,Math.tan(n.kx*Math.PI/180),1,0,0])),n.ky&&(e=x(e,[1,Math.tan(n.ky*Math.PI/180),0,1,0,0]));var t=n.ba&&n.sx!==n.sy;return t&&(e=x(e,Z(n.ba))),e=x(e,Pn(n.sx,n.sy)),t&&(e=x(e,Z(-n.ba))),x(e,W(-n.ox,-n.oy))}var Sn={};function wn(n){if(Sn[n])return Sn[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),i=t[1];i==="matrix"&&u.length===6?e=x(e,u):i==="translate"?e=x(e,W(u[0]||0,u[1]||0)):i==="scale"?e=x(e,Pn(u[0],u.length>1?u[1]:u[0])):i==="rotate"?e=u.length>2?x(x(x(e,W(u[1],u[2])),Z(u[0])),W(-u[1],-u[2])):x(e,Z(u[0]||0)):i==="skewX"?e=x(e,[1,0,Math.tan((u[0]||0)*Math.PI/180),1,0,0]):i==="skewY"&&(e=x(e,[1,Math.tan((u[0]||0)*Math.PI/180),0,1,0,0]))}return Sn[n]=e}function bn(n,e,r){for(var t=Hn(fn(n,e,!0)),u=T(n.parent),i=0;u&&u!==r&&i++<100;)u.xf&&(t=x(wn(u.xf),t)),t=x(Hn(fn(u,e,!0)),t),u=T(u.parent);return t}function Ve(n,e,r){var t=bn(n,e,r),u=n.type?n.type==="path":!n.mesh;return u&&n.xf?x(t,wn(n.xf)):t}function Yn(n,e,r,t,u){for(var i=[],o=T(e.parent),a=null,l=0;o&&l++<100;)i.push(o),o=T(o.parent);for(o=T(n.parent),l=0;o&&l++<100;o=T(o.parent))if(i.indexOf(o)>=0){a=o;break}var s=un;un=t;var f=Ve(n,r,a),c=Math.abs(f[0]*f[3]-f[1]*f[2])<1e-12?[1,0,0,1,0,0]:x(_e(f),bn(e,r,a));un=s;var b=e.geo||{},g=(b.ang||0)*Math.PI/180,p=(b.x||0)+(u&&u[0]||0),h=(b.y||0)+(u&&u[1]||0),M=c[0]*Math.cos(g)+c[2]*Math.sin(g),P=c[1]*Math.cos(g)+c[3]*Math.sin(g);return[c[0]*p+c[2]*h+c[4],c[1]*p+c[3]*h+c[5],Math.atan2(P,M)*180/Math.PI]}function Kn(n,e,r){var t=e.bone?T(e.bone):null;if(t){var u=Yn(n,t,r,!0,e.bo),i=Yn(n,t,r,!1,e.bo);return[u[0],u[1],i[0],i[1],i[2]-u[2]]}var o=E(n,"pin"+e.n,r)||[e.x,e.y];return[e.x,e.y,o[0],o[1],E(n,"pinr"+e.n,r)||0]}function Wn(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(i){var o=Kn(n,i,e),a=o[4]*Math.PI/180;return[o[0],o[1],o[2],o[3],Math.cos(a),Math.sin(a)]}),u]}function Zn(n,e,r,t,u,i,o,a){var l=0,s=0,f=0,c;for(c=0;c<n.length;c++){var b=n[c],g=r-b[0],p=t-b[1],h=1/(Math.pow(g*g+p*p,e/2)+1e-6),M=u-b[0],P=i-b[1];l+=h,s+=h*(b[2]+M*b[4]-P*b[5]),f+=h*(b[3]+M*b[5]+P*b[4])}o[a]=l?s/l:u,o[a+1]=l?f/l:i}function Fe(n,e,r){var t=Wn(n,r),u=t[0],i=t[1];return e.map(function(o){return{c:o.c,n:o.n.map(function(a){for(var l=[0,0,0,0,0,0],s=0;s<6;s+=2)Zn(u,i,a[0],a[1],a[s],a[s+1],l,s);return l})}})}function $n(n,e){var r=n.mesh,t=[];if(!r)return t;var u=!cn&&n.pins&&n.pins.length,i=u?Wn(n,e):null,o=[],a;for(a=0;a<r.v.length;a++)i?Zn(i[0],i[1],r.v[a][0],r.v[a][1],r.v[a][0],r.v[a][1],o,a*2):(o[a*2]=r.v[a][0],o[a*2+1]=r.v[a][1]);for(a=0;a<r.t.length;a++){var l=r.t[a],s=r.v[l[0]],f=r.v[l[1]],c=r.v[l[2]],b=f[0]-s[0],g=f[1]-s[1],p=c[0]-s[0],h=c[1]-s[1],M=b*h-g*p;if(!i||!M){t.push([1,0,0,1,0,0]);continue}var P=o[l[0]*2],tn=o[l[0]*2+1],ie=o[l[1]*2]-P,ae=o[l[1]*2+1]-tn,oe=o[l[2]*2]-P,le=o[l[2]*2+1]-tn,se=h/M,fe=-p/M,me=-g/M,ce=b/M,be=ie*se+oe*me,ge=ie*fe+oe*ce,ye=ae*se+le*me,de=ae*fe+le*ce;t.push([be,ye,ge,de,P-be*s[0]-ge*s[1],tn-ye*s[0]-de*s[1]])}return t}function Te(n,e){var r=E(n,"d",e),t=n.t||{};if(n.shape&&t.rad&&t.rad.length)return Dn(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(i,o){var a=t["p"+o]&&t["p"+o].length?E(n,"p"+o,e):null;if(!a)return i;var l=a[0]-i[0],s=a[1]-i[1];return[i[0]+l,i[1]+s,i[2]+l,i[3]+s,i[4]+l,i[5]+s]});return[{c:r[0].c,n:u}]}return r}function Jn(n){for(var e=[],r=n.kind==="star",t=r?n.n*2:n.n,u=0;u<t;u++){var i=(-90+n.rot+u*360/t)*Math.PI/180,o=r&&u%2?n.r*(n.ratio==null?.45:n.ratio):n.r;e.push([n.cx+o*Math.cos(i),n.cy+o*Math.sin(i)])}return e}function L(n,e){return Math.hypot(n[0]-e[0],n[1]-e[1])}function Un(n){for(var e=n.length,r=1/0,t=0;t<e;t++){var u=n[(t+e-1)%e],i=n[t],o=n[(t+1)%e],a=Math.atan2(u[1]-i[1],u[0]-i[0]),l=Math.atan2(o[1]-i[1],o[0]-i[0]),s=Math.abs(a-l);s>Math.PI&&(s=2*Math.PI-s),r=Math.min(r,Math.min(L(u,i),L(o,i))/2*Math.tan(s/2))}return isFinite(r)?Math.max(0,r):0}function w(n){return Math.round(n*100)/100}function Dn(n,e,r){for(var t=Jn(n),u=t.length,i=Math.max(0,Math.min(e||0,Un(t))),o=[],a=0;a<u;a++){var l=t[a];if(i<=0&&!r){o.push([w(l[0]),w(l[1]),w(l[0]),w(l[1]),w(l[0]),w(l[1])]);continue}var s=t[(a+u-1)%u],f=t[(a+1)%u],c=[(s[0]-l[0])/L(s,l),(s[1]-l[1])/L(s,l)],b=[(f[0]-l[0])/L(f,l),(f[1]-l[1])/L(f,l)],g=Math.acos(Math.max(-1,Math.min(1,c[0]*b[0]+c[1]*b[1]))),p=i/Math.tan(g/2),h=4/3*Math.tan((Math.PI-g)/4)*i,M=[l[0]+c[0]*p,l[1]+c[1]*p],P=[l[0]+b[0]*p,l[1]+b[1]*p];o.push([w(M[0]),w(M[1]),w(M[0]),w(M[1]),w(M[0]-c[0]*h),w(M[1]-c[1]*h)]),o.push([w(P[0]),w(P[1]),w(P[0]-b[0]*h),w(P[1]-b[1]*h),w(P[0]),w(P[1])])}return[{c:!0,n:o}]}function qn(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,i=n.rr==null?1:n.rr,o={cx:String(m(e)),cy:String(m(r)),r:String(m(t)),fx:String(m(e)),fy:String(m(r))};return(m(u)||m(i)!==1)&&(o.gradientTransform="translate("+m(e)+","+m(r)+") rotate("+m(u)+") scale(1,"+m(i)+") translate("+m(-e)+","+m(-r)+")"),o}var a=gn(n);return{x1:String(m(a[0])),y1:String(m(a[1])),x2:String(m(a[2])),y2:String(m(a[3]))}}function gn(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}function Ln(n){return Math.round(n*1e6)/1e6}function je(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 ne(n){return n&&n.length?n.map(function(e){return String(m(Math.max(0,e)))}).join(" "):"none"}function ee(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,i;if(u.length){for(e+="M"+m(u[0][0])+" "+m(u[0][1]),i=1;i<u.length;i++)r(u[i-1],u[i]);t.c&&(r(u[u.length-1],u[0]),e+="Z")}}),e||"M0 0"}function nn(n){return n in B||(B[n]=v?v.querySelector("#"+n):null),B[n]}function re(n,e,r){if(!q(r))return r;var t=r.g==="rad"?"radialGradient":"linearGradient",u=nn(e);if(!u||u.tagName!==t){var i=(n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg",t);i.setAttribute("id",e),u&&u.parentNode?u.parentNode.replaceChild(i,u):n.parentNode.insertBefore(i,n),u=i,B[e]=i}var o=qn(r);for(var a in o)u.setAttribute(a,o[a]);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 s=0;s<r.s.length;s++){var f=K(r.s[s][1])||[0,0,0,1];l[s].setAttribute("offset",String(m(r.s[s][0]))),l[s].setAttribute("stop-color","rgb("+Math.round(f[0])+","+Math.round(f[1])+","+Math.round(f[2])+")"),l[s].setAttribute("stop-opacity",String(m(f[3])))}return"url(#"+e+")"}function Cn(n){for(var e=0;e<y.L.length;e++){var r=y.L[e],t=nn(y.p+r.id),u=nn(y.p+r.id+"-s");if(!(!t||!u)){var i=fn(r,n);if(t.setAttribute("transform",je(i)),t.setAttribute("opacity",String(m(i.op))),i.fill!=null&&u.setAttribute("fill",re(u,y.p+r.id+"-gf",i.fill)),i.stk!=null&&u.setAttribute("stroke",re(u,y.p+r.id+"-gs",i.stk)),i.sw!=null&&u.setAttribute("stroke-width",String(m(i.sw))),i.trim){var o=Bn(i.trim);u.setAttribute("pathLength","100"),u.setAttribute("stroke-dasharray",o[0]),u.setAttribute("stroke-dashoffset",o[1])}else i.dof!=null&&u.setAttribute("stroke-dashoffset",String(m(i.dof))),i.da&&u.setAttribute("stroke-dasharray",ne(i.da));if(i.fo!=null&&u.setAttribute("fill-opacity",String(m(i.fo))),i.so!=null&&u.setAttribute("stroke-opacity",String(m(i.so))),i.d&&u.setAttribute("d",ee(i.d)),i.gb){var a=i.gb,l=r.type==="ellipse"?{cx:a[0]+a[2]/2,cy:a[1]+a[3]/2,rx:a[2]/2,ry:a[3]/2}:{x:a[0],y:a[1],width:a[2],height:a[3]};for(var s in l)u.setAttribute(s,String(m(l[s])))}if(i.rad!=null&&!r.shape&&(u.setAttribute("rx",String(m(i.rad))),u.setAttribute("ry",String(m(i.rad)))),r.dw){var f=T(r.dw),c=nn(y.p+r.id+"-w");f&&c&&c.setAttribute("transform","matrix("+bn(f,n,T(r.du)).map(Ln).join(",")+")")}if(r.mesh)for(var b=$n(r,n),g=0;g<b.length;g++){var p=nn(y.p+r.id+"-m"+g);p&&p.setAttribute("transform","matrix("+b[g].map(Ln).join(",")+")")}if(r.fa)for(var h in r.fa){var M=nn(y.p+r.id+r.fa[h][0]),P=E(r,h,n);M&&P!=null&&M.setAttribute(r.fa[h][1],typeof P=="number"?String(m(P)):P)}}}}var j=y.dur||1,A=y.it>0?Math.floor(y.it):0,yn=/alternate/.test(y.dir||""),z=/reverse/.test(y.dir||"")?-1:1,O=z,kn=y.speed>0?y.speed:1,Rn=y.fps>0?Math.min(100,y.fps):100,dn=y.fill===-1||y.fill==="backwards"?-1:1,_=!1,In=0,On=-1e9,V=!1,N=!1,I=!1,G={},an=0;function en(){return A?A*j:j}function $(){return z>0?0:en()}var S=$();function An(n){var e=Math.floor(n/j),r=n-e*j;return A&&(n<=0?(e=0,r=0):e>=A&&(e=A-1,r=j)),yn&&(e%2+2)%2===1?j-r:r}function Q(n){var e=G[n];e&&e.slice().forEach(function(r){try{r.call(d,Math.round(S*1e3))}catch{}})}function rn(){Cn(An(S)),Q("keyframe")}function on(){_=!1,an&&cancelAnimationFrame(an),an=0}function te(){on(),N&&(N=!1,O=z),V=!0,dn<0&&(S=$()),rn(),Q("end")}function ue(n){if(!(!_||I)){if(S+=(n-In)/1e3*kn*O,In=n,O>0&&(A||N&&z<0)&&S>=en())return S=en(),te();if(O<0&&(A||N&&z>0)&&S<=0)return S=0,te();n-On>=1e3/Rn-1&&(On=n,rn()),an=requestAnimationFrame(ue)}}function hn(){_||I||(_=!0,V=!1,In=performance.now(),On=-1e9,an=requestAnimationFrame(ue))}var d={play:function(){return I||_||(V&&(O=z,N=!1,S=$()),hn(),Q("play")),d},pause:function(){return I||!_||(on(),Q("pause")),d},toggle:function(){return _?d.pause():d.play()},togglePlay:function(){return d.toggle()},restart:function(){return I||(on(),N=!1,O=z,S=$(),V=!1,rn(),hn(),Q("restart")),d},reverse:function(){return I||(O=-O,N=!1,V=!1,hn(),Q("reverse")),d},rollback:function(){if(I)return d;if(!A){var n=yn?2*j:j;S=(S%n+n)%n}return Math.abs(S-$())<1e-6&&!_||(O=-z,N=!0,V=!1,hn(),Q("reverse")),d},stop:function(){return I||(on(),N=!1,O=z,S=$(),V=!1,rn(),Q("stop")),d},seek:function(n){return I||(S=Math.max(0,Math.min(100,+n||0))/100*en(),V=!1,rn()),d},seekTo:function(n){return I||(S=(+n||0)/1e3,A&&(S=Math.max(0,Math.min(en(),S))),V=!1,rn()),d},seekBy:function(n){return d.seekTo(S*1e3+(+n||0))},set:function(n,e){return I||(n==="speed"?kn=Math.max(.01,Math.min(100,+e||1)):n==="fps"?Rn=Math.max(1,Math.min(100,+e||100)):n==="iterations"?A=e===1/0||!(+e>0)?0:Math.floor(+e):n==="direction"?(O=+e<0?-1:1,N=!1):n==="alternate"?yn=!!e:n==="fill"&&(dn=+e<0?-1:1)),d},ready:function(n){return typeof n=="function"&&setTimeout(function(){n.call(d,d)},0),d},on:function(n,e,r){return typeof e!="function"||String(n).split(/[\s,]+/).forEach(function(t){t&&(G[t]=G[t]||[],r?G[t].unshift(e):G[t].push(e))}),d},off:function(n,e){return G[n]&&(G[n]=e?G[n].filter(function(r){return r!==e}):[]),d},destruct:function(){I||(on(),G={},(d._cleanup||[]).forEach(function(n){try{n()}catch{}}),d._cleanup=[],Cn(An($())),I=!0)},onEnd:function(n){return d.on("end",n)},setRate:function(n){return d.set("speed",n)},apply:Cn,comp:fn,lookup:function(n){Mn=n},meshMats:$n,pinAt:Kn,worldOf:bn,restPins:function(n){var e=cn;return cn=!!n,e},get:E,gAttrs:qn,linP:gn,trimDash:Bn,isG:q,pc:K,dstr:ee,dashStr:ne,pathBox:Xn,xfM:wn,poly:Dn,corners:Jn,maxRad:Un,ease:Y,loc:An,EZ:X,_cleanup:[]},k=function(n){return{get:n,enumerable:!0}};return Object.defineProperties(d,{currentTime:k(function(){return Math.round(S*1e3)}),duration:k(function(){return Math.round(j*1e3)}),totalTime:k(function(){return Math.round(en()*1e3)}),fps:k(function(){return Rn}),speed:k(function(){return kn}),direction:k(function(){return O}),fill:k(function(){return dn}),iterations:k(function(){return A}),hasEnded:k(function(){return V}),isAlternate:k(function(){return yn}),isBackwards:k(function(){return dn<0}),isInfinite:k(function(){return!A}),isPlaying:k(function(){return _}),isReversed:k(function(){return O<0}),isRollingBack:k(function(){return _&&N}),state:k(function(){return I?"destroyed":_?N?"rollback":"playing":V?"ended":"paused"})}),d}var Nn=1;function ze(y,v,C){let X=C.b===-1?-1:1,R=C.o||"pause",B=v._cleanup=[],J=(F,Y,K)=>{F.addEventListener(Y,K),B.push(()=>F.removeEventListener(Y,K))},U=()=>{(v.direction!==X||v.isRollingBack)&&v.set("direction",X),v.play()},D=()=>{R==="pause"?v.pause():R==="reverse"?v.rollback():R==="start"?v.stop():R==="restart"&&v.restart()},H=C.t||"load";if(H==="hover")J(y,"mouseenter",U),J(y,"mouseleave",D);else if(H==="click")y.style.cursor="pointer",J(y,"click",()=>{v.isPlaying&&!v.isRollingBack?R!=="none"&&D():U()});else if(H==="scroll")if("IntersectionObserver"in window){let F=new IntersectionObserver(Y=>{Y[0].isIntersecting?U():R!=="none"&&(v.isPlaying||v.currentTime>0)&&D()},{threshold:.35});F.observe(y),B.push(()=>F.disconnect())}else v.play();else H!=="api"&&v.play()}function pn(y,v){if(!y)return null;if(y.player)return y.player;if(!v){let R=y.querySelector('script[type="application/json"][data-cin]');if(!R)return null;try{v=JSON.parse(R.textContent||"")}catch{return null}}if((v.f||1)>Nn)return null;let C=he(v.d,y);y.player=y.cinPlayer=C,C.stop(),(v.rm==="first"||v.rm==="last")&&!!window.matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?C.seekTo(v.rm==="first"?0:Math.max(0,Math.round((v.d.dur||1)*1e3)-1)):ze(y,C,v);try{y.dispatchEvent(new CustomEvent("cinready",{detail:C}))}catch{}return C}function vn(y=document){y.querySelectorAll('script[type="application/json"][data-cin]').forEach(v=>{let C=v.closest("svg");C&&!C.player&&pn(C)})}var Ge="1.0.1",pe=typeof document!="undefined"?document.currentScript:null,ve=window;ve.CinPlayer=ve.CinPlayer||{version:Ge,f:Nn,boot:pn,scan:vn};pe&&pn(pe.closest("svg"));typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>vn()):vn());})();
|
|
1
|
+
/*! SVGcinema player 1.1.0. Proprietary, see the LICENSE file of the svgcinema-player package. */
|
|
2
|
+
"use strict";(()=>{function pr(d,M){var C={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]},R={},Q={},D=2*Math.PI/3,q=2*Math.PI/4.5,L={hold:function(n){return n<1?0:1},outBounce:F,inBounce:function(n){return 1-F(1-n)},inOutBounce:function(n){return n<.5?(1-F(1-2*n))/2:(1+F(2*n-1))/2},outElastic:function(n){return n===0||n===1?n:Math.pow(2,-10*n)*Math.sin((n*10-.75)*D)+1},inElastic:function(n){return n===0||n===1?n:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*D)},inOutElastic:function(n){return n===0||n===1?n:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*q))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*q)/2+1}};function K(n){var r=3*n[0],e=3*(n[2]-n[0])-r,t=1-r-e,u=3*n[1],i=3*(n[3]-n[1])-u,o=1-u-i;function a(f){return((t*f+e)*f+r)*f}function s(f){return((o*f+i)*f+u)*f}function l(f){return(3*t*f+2*e)*f+r}return function(f){var c=f,b,g,v,h=0,E=1;for(b=0;b<8;b++){if(g=a(c)-f,Math.abs(g)<1e-6)return s(c);if(v=l(c),Math.abs(v)<1e-6)break;c-=g/v}for(c=f;E-h>1e-6&&(g=a(c),!(Math.abs(g-f)<1e-6));)f>g?h=c:E=c,c=(h+E)/2;return s(c)}}function F(n){var r=7.5625,e=2.75;return n<1/e?r*n*n:n<2/e?r*(n-=1.5/e)*n+.75:n<2.5/e?r*(n-=2.25/e)*n+.9375:r*(n-=2.625/e)*n+.984375}function W(n,r){if(!n||n==="linear")return r;if(typeof n!="string"){var e=n.join(",");return(R[e]||(R[e]=K(n)))(r)}if(L[n])return L[n](r);var t=R[n]||(R[n]=K(H[n]||H.ease));return t(r)}function Z(n){if(typeof n!="string")return null;var r=n.trim();if(r[0]==="#"){var e=r.slice(1);return(e.length===3||e.length===4)&&(e=e.replace(/./g,"$&$&")),e.length===6&&(e+="ff"),e.length!==8?null:[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16),parseInt(e.substr(6,2),16)/255]}var t=r.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 nn(n){return!!n&&typeof n=="object"&&(n.g==="lin"||n.g==="rad")&&n.s&&n.s.length>0}function Fn(n,r){var e=n.s;if(r<=e[0][0])return e[0][1];for(var t=0;t<e.length-1;t++)if(r<=e[t+1][0]){var u=e[t+1][0]-e[t][0];return fn(e[t][1],e[t+1][1],u>0?(r-e[t][0])/u:0)}return e[e.length-1][1]}function Er(n,r,e){if(nn(n)||(n={g:r.g,a:r.a,cx:r.cx,cy:r.cy,r:r.r,p:r.p,ra:r.ra,rr:r.rr,s:[[0,n],[1,n]]}),nn(r)||(r={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,r],[1,r]]}),n.g!==r.g)return e<1?n:r;var t=[];n.s.concat(r.s).forEach(function(l){t.indexOf(l[0])<0&&t.push(l[0])}),t.sort(function(l,f){return l-f});var u=n.s.length===r.s.length?n.s.map(function(l,f){return[l[0]+(r.s[f][0]-l[0])*e,fn(l[1],r.s[f][1],e)]}):t.map(function(l){return[l,fn(Fn(n,l),Fn(r,l),e)]}),i=function(l,f,c){return(l==null?c:l)+((f==null?c:f)-(l==null?c:l))*e},o={g:n.g,a:i(n.a,r.a,90),cx:i(n.cx,r.cx,.5),cy:i(n.cy,r.cy,.5),r:i(n.r,r.r,.5),s:u};if(n.p||r.p){var a=yn(n),s=yn(r);o.p=a.map(function(l,f){return l+(s[f]-l)*e})}return(n.ra!=null||r.ra!=null)&&(o.ra=i(n.ra,r.ra,0)),(n.rr!=null||r.rr!=null)&&(o.rr=i(n.rr,r.rr,1)),o}function fn(n,r,e){if(nn(n)||nn(r))return Er(n,r,e);var t=Z(n),u=Z(r);if(!t||!u)return e<1?n:r;var i=[0,1,2].map(function(a){return Math.round(t[a]+(u[a]-t[a])*e)}),o=t[3]+(u[3]-t[3])*e;return o>=.999?"rgb("+i.join(",")+")":"rgba("+i.join(",")+","+Math.round(o*1e3)/1e3+")"}function xr(n,r){if(!n||!r||n.length!==r.length)return!1;for(var e=0;e<n.length;e++)if(n[e].n.length!==r[e].n.length)return!1;return!0}function Pr(n,r,e){return xr(n,r)?n.map(function(t,u){return{c:t.c,n:t.n.map(function(i,o){var a=r[u].n[o];return i.map(function(s,l){return s+(a[l]-s)*e})})}}):e<1?n:r}function Sr(n,r,e){n=n||[],r=r||[];var t=n.length,u=r.length,i=[],o;if(t!==u)if(!t)n=mn(r.map(jn),1);else if(!u)r=mn(n.map(jn),1);else{var a=t*u/Tn(t,u);n=mn(n,a/t),r=mn(r,a/u)}for(o=0;o<n.length;o++)i.push(n[o]+(r[o]-n[o])*e);return i}function jn(){return 0}function Tn(n,r){return r?Tn(r,n%r):n||1}function mn(n,r){for(var e=[],t=0;t<r;t++)e=e.concat(n);return e}function wr(n,r,e,t){return n==="c"?fn(r,e,t):n==="a"?Sr(r,e,t):n==="m"?Pr(r,e,t):n==="v"?[r[0]+(e[0]-r[0])*t,r[1]+(e[1]-r[1])*t]:r+(e-r)*t}function Cr(n,r,e,t,u){var i=u*u,o=i*u;return[0,1].map(function(a){return .5*(2*r[a]+(-n[a]+e[a])*u+(2*n[a]-5*r[a]+4*e[a]-t[a])*i+(-n[a]+3*r[a]-3*e[a]+t[a])*o)})}function zn(n,r,e,t){var u=1-t,i=u*u*u,o=3*u*u*t,a=3*u*t*t,s=t*t*t;return[i*n[0]+o*(n[0]+r[0])+a*(e[0]+r[2])+s*e[0],i*n[1]+o*(n[1]+r[1])+a*(e[1]+r[3])+s*e[1]]}var xn={},Gn=0;function kr(n,r,e,t){if(t<=0||t>=1)return t;var u=n.join()+";"+r.join()+";"+e.join(),i=xn[u],o=64,a;if(!i){++Gn>400&&(xn={},Gn=1),i=[0];var s=n;for(a=1;a<=o;a++){var l=zn(n,r,e,a/o);i.push(i[a-1]+Math.hypot(l[0]-s[0],l[1]-s[1])),s=l}xn[u]=i}var f=t*i[o];if(!(i[o]>0))return t;for(a=1;a<=o;a++)if(i[a]>=f)return(a-1+(f-i[a-1])/(i[a]-i[a-1]||1))/o;return 1}function Rr(n,r,e){var t=n.t[r],u=t.length,i,o,a,s;if(u===1||e<=t[0][0])return t[0][1];if(e>=t[u-1][0])return t[u-1][1];for(i=0;i<u-1;i++)if(o=t[i],a=t[i+1],e<a[0])return s=W(o[2],(e-o[0])/(a[0]-o[0])),r==="pos"&&o[3]?zn(o[1],o[3],a[1],n.ev?kr(o[1],o[3],a[1],s):s):r==="pos"&&n.sm&&u>2?Cr((t[i-1]||o)[1],o[1],a[1],(t[i+2]||a)[1],s):wr(C[r]||(typeof o[1]=="string"?"c":typeof o[1]=="object"?"v":"n"),o[1],a[1],s);return t[u-1][1]}var an=!1;function p(n,r,e){var t=!an&&n.t&&n.t[r];return t&&t.length?Rr(n,r,e):r==="org"?n.o||[0,0]:n.b[r]}function cn(n,r,e){var t=p(n,"org",r)||[0,0],u=p(n,"pos",r)||[0,0],i=p(n,"rot",r)||0,o=p(n,"scl",r)||[1,1],a=p(n,"skw",r)||[0,0],s=n.t&&n.t.pos,l=p(n,"op",r);if(n.or&&s&&s.length>1&&!an){var f=s[0][0],c=s[s.length-1][0],b=Math.min(.02,(c-f)/4),g=Math.max(f,Math.min(r-b,c-2*b)),v=p(n,"pos",g),h=p(n,"pos",g+2*b);(h[0]!==v[0]||h[1]!==v[1])&&(i+=Math.atan2(h[1]-v[1],h[0]-v[0])*180/Math.PI)}return e?{x:u[0]+t[0],y:u[1]+t[1],r:i,sx:o[0],sy:o[1],ox:t[0],oy:t[1],kx:a[0],ky:a[1],ba:Sn(n),cp:Qn(n,r)}:{x:u[0]+t[0],y:u[1]+t[1],r:i,sx:o[0],sy:o[1],ox:t[0],oy:t[1],op:l==null?1:l,fill:p(n,"fill",r),stk:p(n,"stk",r),sw:p(n,"sw",r),d:Or(n,r),kx:a[0],ky:a[1],fo:p(n,"fo",r),so:p(n,"so",r),dof:p(n,"dof",r),rad:n.t&&n.t.rad&&n.t.rad.length?p(n,"rad",r):null,gb:Nr(n,r),da:n.t&&n.t.da&&n.t.da.length?p(n,"da",r):null,trim:Ir(n,r),ba:Sn(n),cp:Qn(n,r)}}for(var Bn={},Pn=null,bn=0;bn<d.L.length;bn++)Bn[d.L[bn].id]=d.L[bn];function j(n){return n&&(Bn[n]||Pn&&Pn(n))||null}function Qn(n,r){var e=n.cs||n.type==="bone"&&!n.inh?j(n.parent):null;if(!e||!n.cs&&e.type!=="bone")return null;var t=p(e,"scl",r)||[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[Sn(e),t[0]||1e-6,t[1]||1e-6,u[0],u[1]]}function Sn(n){return n.ba!=null?n.ba:n.type==="bone"&&n.geo&&n.geo.ang?n.geo.ang:0}function Ir(n,r){var e=n.t||{},t=["ts","te","to"].some(function(a){return e[a]&&e[a].length||n.b&&n.b[a]!=null&&n.b[a]!==(a==="te"?100:0)});if(!t)return null;var u=p(n,"ts",r),i=p(n,"te",r),o=p(n,"to",r);return[u==null?0:u,i==null?100:i,o==null?0:o]}function Xn(n){var r=Math.max(0,Math.min(100,Math.min(n[0],n[1]))),e=Math.max(0,Math.min(100,Math.max(n[0],n[1]))),t=e-r,u=r+(n[2]||0),i=(u%100+100)%100;return t<1e-6?["0 300",String(m(150-i))]:i+t<=100+1e-6?[m(t)+" "+m(200-t),String(m(-i))]:[m(t)+" "+m(100-t),String(m(-u))]}function Or(n,r){var e=Tr(n,r);return e&&n.t&&n.t.sz&&n.t.sz.length&&(e=_r(n,e,r)),e&&n.pins&&n.pins.length&&!gn?jr(n,e,r):e}function Ar(n,r,e){var t=n[2]?r[0]/n[2]:1,u=n[3]?r[1]/n[3]:1;return[e[0]-(e[0]-n[0])*t,e[1]-(e[1]-n[1])*u,Math.max(0,r[0]),Math.max(0,r[1])]}function Yn(n,r,e){return n.sa?[r[0]+n.sa[0]*r[2],r[1]+n.sa[1]*r[3]]:p(n,"org",e)||[0,0]}function Nr(n,r){var e=n.geo;if(!e||!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"?[(e.cx||0)-(e.rx||0),(e.cy||0)-(e.ry||0),2*(e.rx||0),2*(e.ry||0)]:[e.x||0,e.y||0,e.w||0,e.h||0];return Ar(t,p(n,"sz",r),Yn(n,t,r))}function _r(n,r,e){var t=Hn(n.b&&n.b.d||r),u=p(n,"sz",e),i=Yn(n,t,e),o=t[2]>1e-9?u[0]/t[2]:1,a=t[3]>1e-9?u[1]/t[3]:1;return r.map(function(s){return{c:s.c,n:s.n.map(function(l){return l.map(function(f,c){return c%2?i[1]+(f-i[1])*a:i[0]+(f-i[0])*o})})}})}function Hn(n){var r=1/0,e=1/0,t=-1/0,u=-1/0;function i(s,l){s<r&&(r=s),s>t&&(t=s),l<e&&(e=l),l>u&&(u=l)}function o(s,l,f,c){var b=-s+3*l-3*f+c,g=2*(s-2*l+f),v=l-s,h=[];if(Math.abs(b)<1e-12)Math.abs(g)>1e-12&&h.push(-v/g);else{var E=g*g-4*b*v;if(E>=0){var x=Math.sqrt(E);h.push((-g+x)/(2*b),(-g-x)/(2*b))}}return h.filter(function(T){return T>0&&T<1})}function a(s,l){var f=[s[0],s[4],l[2],l[0]],c=[s[1],s[5],l[3],l[1]];i(l[0],l[1]),o(f[0],f[1],f[2],f[3]).concat(o(c[0],c[1],c[2],c[3])).forEach(function(b){var g=1-b,v=g*g*g,h=3*g*g*b,E=3*g*b*b,x=b*b*b;i(v*f[0]+h*f[1]+E*f[2]+x*f[3],v*c[0]+h*c[1]+E*c[2]+x*c[3])})}return(n||[]).forEach(function(s){var l=s.n;if(l.length){i(l[0][0],l[0][1]);for(var f=1;f<l.length;f++)a(l[f-1],l[f]);s.c&&l.length>1&&a(l[l.length-1],l[0])}}),isFinite(r)?[r,e,t-r,u-e]:[0,0,0,0]}var gn=!1;function P(n,r){return[n[0]*r[0]+n[2]*r[1],n[1]*r[0]+n[3]*r[1],n[0]*r[2]+n[2]*r[3],n[1]*r[2]+n[3]*r[3],n[0]*r[4]+n[2]*r[5]+n[4],n[1]*r[4]+n[3]*r[5]+n[5]]}function Vr(n){var r=n[0]*n[3]-n[1]*n[2]||1e-12;return[n[3]/r,-n[1]/r,-n[2]/r,n[0]/r,(n[2]*n[5]-n[3]*n[4])/r,(n[1]*n[4]-n[0]*n[5])/r]}function $(n,r){return[1,0,0,1,n,r]}function J(n){var r=n*Math.PI/180;return[Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]}function wn(n,r){return[n,0,0,r,0,0]}function Kn(n){var r=[1,0,0,1,0,0],e=n.cp;e&&(r=P(r,$(e[3],e[4])),r=P(r,J(e[0])),r=P(r,wn(1/e[1],1/e[2])),r=P(r,J(-e[0])),r=P(r,$(-e[3],-e[4]))),r=P(r,$(n.x,n.y)),r=P(r,J(n.r)),n.kx&&(r=P(r,[1,0,Math.tan(n.kx*Math.PI/180),1,0,0])),n.ky&&(r=P(r,[1,Math.tan(n.ky*Math.PI/180),0,1,0,0]));var t=n.ba&&n.sx!==n.sy;return t&&(r=P(r,J(n.ba))),r=P(r,wn(n.sx,n.sy)),t&&(r=P(r,J(-n.ba))),P(r,$(-n.ox,-n.oy))}var Cn={};function kn(n){if(Cn[n])return Cn[n];for(var r=[1,0,0,1,0,0],e=/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g,t;t=e.exec(n);){var u=t[2].split(/[\s,]+/).filter(Boolean).map(Number),i=t[1];i==="matrix"&&u.length===6?r=P(r,u):i==="translate"?r=P(r,$(u[0]||0,u[1]||0)):i==="scale"?r=P(r,wn(u[0],u.length>1?u[1]:u[0])):i==="rotate"?r=u.length>2?P(P(P(r,$(u[1],u[2])),J(u[0])),$(-u[1],-u[2])):P(r,J(u[0]||0)):i==="skewX"?r=P(r,[1,0,Math.tan((u[0]||0)*Math.PI/180),1,0,0]):i==="skewY"&&(r=P(r,[1,Math.tan((u[0]||0)*Math.PI/180),0,1,0,0]))}return Cn[n]=r}function dn(n,r,e){for(var t=Kn(cn(n,r,!0)),u=j(n.parent),i=0;u&&u!==e&&i++<100;)u.xf&&(t=P(kn(u.xf),t)),t=P(Kn(cn(u,r,!0)),t),u=j(u.parent);return t}function Fr(n,r,e){var t=dn(n,r,e),u=n.type?n.type==="path":!n.mesh;return u&&n.xf?P(t,kn(n.xf)):t}function Wn(n,r,e,t,u){for(var i=[],o=j(r.parent),a=null,s=0;o&&s++<100;)i.push(o),o=j(o.parent);for(o=j(n.parent),s=0;o&&s++<100;o=j(o.parent))if(i.indexOf(o)>=0){a=o;break}var l=an;an=t;var f=Fr(n,e,a),c=Math.abs(f[0]*f[3]-f[1]*f[2])<1e-12?[1,0,0,1,0,0]:P(Vr(f),dn(r,e,a));an=l;var b=r.geo||{},g=(b.ang||0)*Math.PI/180,v=(b.x||0)+(u&&u[0]||0),h=(b.y||0)+(u&&u[1]||0),E=c[0]*Math.cos(g)+c[2]*Math.sin(g),x=c[1]*Math.cos(g)+c[3]*Math.sin(g);return[c[0]*v+c[2]*h+c[4],c[1]*v+c[3]*h+c[5],Math.atan2(x,E)*180/Math.PI]}function Zn(n,r,e){var t=r.bone?j(r.bone):null;if(t){var u=Wn(n,t,e,!0,r.bo),i=Wn(n,t,e,!1,r.bo);return[u[0],u[1],i[0],i[1],i[2]-u[2]]}var o=p(n,"pin"+r.n,e)||[r.x,r.y];return[r.x,r.y,o[0],o[1],p(n,"pinr"+r.n,e)||0]}function $n(n,r){var e=n.pins||[],t=Math.max(10,Math.min(1e3,n.reach||100)),u=Math.max(.5,Math.min(8,200/t));return[e.map(function(i){var o=Zn(n,i,r),a=o[4]*Math.PI/180;return[o[0],o[1],o[2],o[3],Math.cos(a),Math.sin(a)]}),u]}function Jn(n,r,e,t,u,i,o,a){var s=0,l=0,f=0,c;for(c=0;c<n.length;c++){var b=n[c],g=e-b[0],v=t-b[1],h=1/(Math.pow(g*g+v*v,r/2)+1e-6),E=u-b[0],x=i-b[1];s+=h,l+=h*(b[2]+E*b[4]-x*b[5]),f+=h*(b[3]+E*b[5]+x*b[4])}o[a]=s?l/s:u,o[a+1]=s?f/s:i}function jr(n,r,e){var t=$n(n,e),u=t[0],i=t[1];return r.map(function(o){return{c:o.c,n:o.n.map(function(a){for(var s=[0,0,0,0,0,0],l=0;l<6;l+=2)Jn(u,i,a[0],a[1],a[l],a[l+1],s,l);return s})}})}function Un(n,r){var e=n.mesh,t=[];if(!e)return t;var u=!gn&&n.pins&&n.pins.length,i=u?$n(n,r):null,o=[],a;for(a=0;a<e.v.length;a++)i?Jn(i[0],i[1],e.v[a][0],e.v[a][1],e.v[a][0],e.v[a][1],o,a*2):(o[a*2]=e.v[a][0],o[a*2+1]=e.v[a][1]);for(a=0;a<e.t.length;a++){var s=e.t[a],l=e.v[s[0]],f=e.v[s[1]],c=e.v[s[2]],b=f[0]-l[0],g=f[1]-l[1],v=c[0]-l[0],h=c[1]-l[1],E=b*h-g*v;if(!i||!E){t.push([1,0,0,1,0,0]);continue}var x=o[s[0]*2],T=o[s[0]*2+1],Y=o[s[1]*2]-x,ln=o[s[1]*2+1]-T,sr=o[s[2]*2]-x,lr=o[s[2]*2+1]-T,fr=h/E,mr=-v/E,cr=-g/E,br=b/E,gr=Y*fr+sr*cr,dr=Y*mr+sr*br,yr=ln*fr+lr*cr,hr=ln*mr+lr*br;t.push([gr,yr,dr,hr,x-gr*l[0]-dr*l[1],T-yr*l[0]-hr*l[1]])}return t}function Tr(n,r){var e=p(n,"d",r),t=n.t||{};if(n.shape&&t.rad&&t.rad.length)return Ln(n.shape,p(n,"rad",r),!0);if(e&&e[0]&&e[0].n.length===2&&(t.p0&&t.p0.length||t.p1&&t.p1.length)){var u=e[0].n.map(function(i,o){var a=t["p"+o]&&t["p"+o].length?p(n,"p"+o,r):null;if(!a)return i;var s=a[0]-i[0],l=a[1]-i[1];return[i[0]+s,i[1]+l,i[2]+s,i[3]+l,i[4]+s,i[5]+l]});return[{c:e[0].c,n:u}]}return e}function Dn(n){for(var r=[],e=n.kind==="star",t=e?n.n*2:n.n,u=0;u<t;u++){var i=(-90+n.rot+u*360/t)*Math.PI/180,o=e&&u%2?n.r*(n.ratio==null?.45:n.ratio):n.r;r.push([n.cx+o*Math.cos(i),n.cy+o*Math.sin(i)])}return r}function rn(n,r){return Math.hypot(n[0]-r[0],n[1]-r[1])}function qn(n){for(var r=n.length,e=1/0,t=0;t<r;t++){var u=n[(t+r-1)%r],i=n[t],o=n[(t+1)%r],a=Math.atan2(u[1]-i[1],u[0]-i[0]),s=Math.atan2(o[1]-i[1],o[0]-i[0]),l=Math.abs(a-s);l>Math.PI&&(l=2*Math.PI-l),e=Math.min(e,Math.min(rn(u,i),rn(o,i))/2*Math.tan(l/2))}return isFinite(e)?Math.max(0,e):0}function w(n){return Math.round(n*100)/100}function Ln(n,r,e){for(var t=Dn(n),u=t.length,i=Math.max(0,Math.min(r||0,qn(t))),o=[],a=0;a<u;a++){var s=t[a];if(i<=0&&!e){o.push([w(s[0]),w(s[1]),w(s[0]),w(s[1]),w(s[0]),w(s[1])]);continue}var l=t[(a+u-1)%u],f=t[(a+1)%u],c=[(l[0]-s[0])/rn(l,s),(l[1]-s[1])/rn(l,s)],b=[(f[0]-s[0])/rn(f,s),(f[1]-s[1])/rn(f,s)],g=Math.acos(Math.max(-1,Math.min(1,c[0]*b[0]+c[1]*b[1]))),v=i/Math.tan(g/2),h=4/3*Math.tan((Math.PI-g)/4)*i,E=[s[0]+c[0]*v,s[1]+c[1]*v],x=[s[0]+b[0]*v,s[1]+b[1]*v];o.push([w(E[0]),w(E[1]),w(E[0]),w(E[1]),w(E[0]-c[0]*h),w(E[1]-c[1]*h)]),o.push([w(x[0]),w(x[1]),w(x[0]-b[0]*h),w(x[1]-b[1]*h),w(x[0]),w(x[1])])}return[{c:!0,n:o}]}function nr(n){if(n.g==="rad"){var r=n.cx==null?.5:n.cx,e=n.cy==null?.5:n.cy,t=n.r==null?.5:n.r,u=n.ra||0,i=n.rr==null?1:n.rr,o={cx:String(m(r)),cy:String(m(e)),r:String(m(t)),fx:String(m(r)),fy:String(m(e))};return(m(u)||m(i)!==1)&&(o.gradientTransform="translate("+m(r)+","+m(e)+") rotate("+m(u)+") scale(1,"+m(i)+") translate("+m(-r)+","+m(-e)+")"),o}var a=yn(n);return{x1:String(m(a[0])),y1:String(m(a[1])),x2:String(m(a[2])),y2:String(m(a[3]))}}function yn(n){if(n.p&&n.p.length===4)return n.p.slice();var r=((n.a==null?90:n.a)-90)*Math.PI/180,e=Math.cos(r)/2,t=Math.sin(r)/2;return[.5-e,.5-t,.5+e,.5+t]}function m(n){return Math.round(n*1e3)/1e3}var zr=[.2126,.7152,.0722,.2126,.7152,.0722,.2126,.7152,.0722],Gr=[.393,.769,.189,.349,.686,.168,.272,.534,.131];function rr(n,r,e){if(!n)return String(typeof r=="number"?m(r):r);var t=Math.max(0,+r||0),u;if(n==="add")return String(m(t+Math.max(0,+e||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 i=.5-.5*t;u=[t,0,0,0,i,0,t,0,0,i,0,0,t,0,i]}else if(n==="inv"){t=Math.min(1,t);var o=1-2*t;u=[o,0,0,0,t,0,o,0,0,t,0,0,o,0,t]}else{t=Math.min(1,t);var a=n==="sep"?Gr:zr;u=[];for(var s=0;s<3;s++){for(var l=0;l<3;l++)u.push(a[s*3+l]*t+(s===l?1-t:0));u.push(0,0)}}return u.concat([0,0,0,1,0]).map(m).join(" ")}function er(n){return Math.round(n*1e6)/1e6}function Br(n){var r=n.cp;return(r?"translate("+m(r[3])+","+m(r[4])+") rotate("+m(r[0])+") scale("+m(1/r[1])+","+m(1/r[2])+") rotate("+m(-r[0])+") translate("+m(-r[3])+","+m(-r[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 tr(n){return n&&n.length?n.map(function(r){return String(m(Math.max(0,r)))}).join(" "):"none"}function ur(n){var r="";function e(t,u){t[4]===t[0]&&t[5]===t[1]&&u[2]===u[0]&&u[3]===u[1]?r+="L"+m(u[0])+" "+m(u[1]):r+="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,i;if(u.length){for(r+="M"+m(u[0][0])+" "+m(u[0][1]),i=1;i<u.length;i++)e(u[i-1],u[i]);t.c&&(e(u[u.length-1],u[0]),r+="Z")}}),r||"M0 0"}function en(n){return n in Q||(Q[n]=M?M.querySelector("#"+n):null),Q[n]}function ir(n,r,e){if(!nn(e))return e;var t=e.g==="rad"?"radialGradient":"linearGradient",u=en(r);if(!u||u.tagName!==t){var i=(n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg",t);i.setAttribute("id",r),u&&u.parentNode?u.parentNode.replaceChild(i,u):n.parentNode.insertBefore(i,n),u=i,Q[r]=i}var o=nr(e);for(var a in o)u.setAttribute(a,o[a]);for(var s=u.getElementsByTagName("stop");s.length>e.s.length;)u.removeChild(s[s.length-1]);for(;s.length<e.s.length;)u.appendChild((n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg","stop"));for(var l=0;l<e.s.length;l++){var f=Z(e.s[l][1])||[0,0,0,1];s[l].setAttribute("offset",String(m(e.s[l][0]))),s[l].setAttribute("stop-color","rgb("+Math.round(f[0])+","+Math.round(f[1])+","+Math.round(f[2])+")"),s[l].setAttribute("stop-opacity",String(m(f[3])))}return"url(#"+r+")"}function Rn(n){for(var r=0;r<d.L.length;r++){var e=d.L[r],t=en(d.p+e.id),u=en(d.p+e.id+"-s");if(!(!t||!u)){var i=cn(e,n);if(t.setAttribute("transform",Br(i)),t.setAttribute("opacity",String(m(i.op))),i.fill!=null&&u.setAttribute("fill",ir(u,d.p+e.id+"-gf",i.fill)),i.stk!=null&&u.setAttribute("stroke",ir(u,d.p+e.id+"-gs",i.stk)),i.sw!=null&&u.setAttribute("stroke-width",String(m(i.sw))),i.trim){var o=Xn(i.trim);u.setAttribute("pathLength","100"),u.setAttribute("stroke-dasharray",o[0]),u.setAttribute("stroke-dashoffset",o[1])}else i.dof!=null&&u.setAttribute("stroke-dashoffset",String(m(i.dof))),i.da&&u.setAttribute("stroke-dasharray",tr(i.da));if(i.fo!=null&&u.setAttribute("fill-opacity",String(m(i.fo))),i.so!=null&&u.setAttribute("stroke-opacity",String(m(i.so))),i.d&&u.setAttribute("d",ur(i.d)),i.gb){var a=i.gb,s=e.type==="ellipse"?{cx:a[0]+a[2]/2,cy:a[1]+a[3]/2,rx:a[2]/2,ry:a[3]/2}:{x:a[0],y:a[1],width:a[2],height:a[3]};for(var l in s)u.setAttribute(l,String(m(s[l])))}if(i.rad!=null&&!e.shape&&(u.setAttribute("rx",String(m(i.rad))),u.setAttribute("ry",String(m(i.rad)))),e.dw){var f=j(e.dw),c=en(d.p+e.id+"-w");f&&c&&c.setAttribute("transform","matrix("+dn(f,n,j(e.du)).map(er).join(",")+")")}if(e.mesh)for(var b=Un(e,n),g=0;g<b.length;g++){var v=en(d.p+e.id+"-m"+g);v&&v.setAttribute("transform","matrix("+b[g].map(er).join(",")+")")}if(e.fa)for(var h in e.fa){var E=p(e,h,n),x=e.fa[h];if(E!=null){typeof x[0]=="string"&&(x=[x]);for(var T=0;T<x.length;T++){var Y=x[T],ln=en(d.p+e.id+Y[0]);ln&&ln.setAttribute(Y[1],rr(Y[2],E,Y[3]?p(e,Y[3],n):0))}}}}}}var z=d.dur||1,A=d.it>0?Math.floor(d.it):0,hn=/alternate/.test(d.dir||""),G=/reverse/.test(d.dir||"")?-1:1,O=G,In=d.speed>0?d.speed:1,On=d.fps>0?Math.min(100,d.fps):100,pn=d.fill===-1||d.fill==="backwards"?-1:1,_=!1,An=0,Nn=-1e9,V=!1,N=!1,I=!1,B={},on=0;function tn(){return A?A*z:z}function U(){return G>0?0:tn()}var S=U();function _n(n){var r=Math.floor(n/z),e=n-r*z;return A&&(n<=0?(r=0,e=0):r>=A&&(r=A-1,e=z)),hn&&(r%2+2)%2===1?z-e:e}function X(n){var r=B[n];r&&r.slice().forEach(function(e){try{e.call(y,Math.round(S*1e3))}catch{}})}function un(){Rn(_n(S)),X("keyframe")}function sn(){_=!1,on&&cancelAnimationFrame(on),on=0}function ar(){sn(),N&&(N=!1,O=G),V=!0,pn<0&&(S=U()),un(),X("end")}function or(n){if(!(!_||I)){if(S+=(n-An)/1e3*In*O,An=n,O>0&&(A||N&&G<0)&&S>=tn())return S=tn(),ar();if(O<0&&(A||N&&G>0)&&S<=0)return S=0,ar();n-Nn>=1e3/On-1&&(Nn=n,un()),on=requestAnimationFrame(or)}}function vn(){_||I||(_=!0,V=!1,An=performance.now(),Nn=-1e9,on=requestAnimationFrame(or))}var y={play:function(){return I||_||(V&&(O=G,N=!1,S=U()),vn(),X("play")),y},pause:function(){return I||!_||(sn(),X("pause")),y},toggle:function(){return _?y.pause():y.play()},togglePlay:function(){return y.toggle()},restart:function(){return I||(sn(),N=!1,O=G,S=U(),V=!1,un(),vn(),X("restart")),y},reverse:function(){return I||(O=-O,N=!1,V=!1,vn(),X("reverse")),y},rollback:function(){if(I)return y;if(!A){var n=hn?2*z:z;S=(S%n+n)%n}return Math.abs(S-U())<1e-6&&!_||(O=-G,N=!0,V=!1,vn(),X("reverse")),y},stop:function(){return I||(sn(),N=!1,O=G,S=U(),V=!1,un(),X("stop")),y},seek:function(n){return I||(S=Math.max(0,Math.min(100,+n||0))/100*tn(),V=!1,un()),y},seekTo:function(n){return I||(S=(+n||0)/1e3,A&&(S=Math.max(0,Math.min(tn(),S))),V=!1,un()),y},seekBy:function(n){return y.seekTo(S*1e3+(+n||0))},set:function(n,r){return I||(n==="speed"?In=Math.max(.01,Math.min(100,+r||1)):n==="fps"?On=Math.max(1,Math.min(100,+r||100)):n==="iterations"?A=r===1/0||!(+r>0)?0:Math.floor(+r):n==="direction"?(O=+r<0?-1:1,N=!1):n==="alternate"?hn=!!r:n==="fill"&&(pn=+r<0?-1:1)),y},ready:function(n){return typeof n=="function"&&setTimeout(function(){n.call(y,y)},0),y},on:function(n,r,e){return typeof r!="function"||String(n).split(/[\s,]+/).forEach(function(t){t&&(B[t]=B[t]||[],e?B[t].unshift(r):B[t].push(r))}),y},off:function(n,r){return B[n]&&(B[n]=r?B[n].filter(function(e){return e!==r}):[]),y},destruct:function(){I||(sn(),B={},(y._cleanup||[]).forEach(function(n){try{n()}catch{}}),y._cleanup=[],Rn(_n(U())),I=!0)},onEnd:function(n){return y.on("end",n)},setRate:function(n){return y.set("speed",n)},apply:Rn,comp:cn,lookup:function(n){Pn=n},meshMats:Un,pinAt:Zn,worldOf:dn,restPins:function(n){var r=gn;return gn=!!n,r},get:p,fxv:rr,gAttrs:nr,linP:yn,trimDash:Xn,isG:nn,pc:Z,dstr:ur,dashStr:tr,pathBox:Hn,xfM:kn,poly:Ln,corners:Dn,maxRad:qn,ease:W,loc:_n,EZ:H,_cleanup:[]},k=function(n){return{get:n,enumerable:!0}};return Object.defineProperties(y,{currentTime:k(function(){return Math.round(S*1e3)}),duration:k(function(){return Math.round(z*1e3)}),totalTime:k(function(){return Math.round(tn()*1e3)}),fps:k(function(){return On}),speed:k(function(){return In}),direction:k(function(){return O}),fill:k(function(){return pn}),iterations:k(function(){return A}),hasEnded:k(function(){return V}),isAlternate:k(function(){return hn}),isBackwards:k(function(){return pn<0}),isInfinite:k(function(){return!A}),isPlaying:k(function(){return _}),isReversed:k(function(){return O<0}),isRollingBack:k(function(){return _&&N}),state:k(function(){return I?"destroyed":_?N?"rollback":"playing":V?"ended":"paused"})}),y}var Vn=1;function Qr(d,M,C){let H=C.b===-1?-1:1,R=C.o||"pause",Q=M._cleanup=[],D=(F,W,Z)=>{F.addEventListener(W,Z),Q.push(()=>F.removeEventListener(W,Z))},q=()=>{(M.direction!==H||M.isRollingBack)&&M.set("direction",H),M.play()},L=()=>{R==="pause"?M.pause():R==="reverse"?M.rollback():R==="start"?M.stop():R==="restart"&&M.restart()},K=C.t||"load";if(K==="hover")D(d,"mouseenter",q),D(d,"mouseleave",L);else if(K==="click")d.style.cursor="pointer",D(d,"click",()=>{M.isPlaying&&!M.isRollingBack?R!=="none"&&L():q()});else if(K==="scroll")if("IntersectionObserver"in window){let F=new IntersectionObserver(W=>{W[0].isIntersecting?q():R!=="none"&&(M.isPlaying||M.currentTime>0)&&L()},{threshold:.35});F.observe(d),Q.push(()=>F.disconnect())}else M.play();else K!=="api"&&M.play()}function Mn(d,M){if(!d)return null;if(d.player)return d.player;if(!M){let R=d.querySelector('script[type="application/json"][data-cin]');if(!R)return null;try{M=JSON.parse(R.textContent||"")}catch{return null}}if((M.f||1)>Vn)return null;let C=pr(M.d,d);d.player=d.cinPlayer=C,C.stop(),(M.rm==="first"||M.rm==="last")&&!!window.matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?C.seekTo(M.rm==="first"?0:Math.max(0,Math.round((M.d.dur||1)*1e3)-1)):Qr(d,C,M);try{d.dispatchEvent(new CustomEvent("cinready",{detail:C}))}catch{}return C}function En(d=document){d.querySelectorAll('script[type="application/json"][data-cin]').forEach(M=>{let C=M.closest("svg");C&&!C.player&&Mn(C)})}var Xr="1.1.0",vr=typeof document!="undefined"?document.currentScript:null,Mr=window;Mr.CinPlayer=Mr.CinPlayer||{version:Xr,f:Vn,boot:Mn,scan:En};vr&&Mn(vr.closest("svg"));typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>En()):En());})();
|