blob: 0fabbd70c509774e189ea422d0f17027daf6ccd0 [file] [log] [blame]
(function(window){function createElement(t,e,a){if(void 0===e||null===e){var i=Object.create(t.prototype,a),r={};return i&&"[object Function]"===r.toString.call(i.init)&&i.init(),i}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.parent=t.prototype}function defineDescriptor(t,e,a,i){var r={writable:!1,configurable:!1,enumerable:!1,value:a};if(i)for(var n in i)r[n]=i[n];var s={};t&&"[object Function]"===s.toString.call(t)&&(t=t.prototype),Object.defineProperty(t,e,r)}function defineAccessor(t,e,a){var i,r={enumerable:!1,configurable:!1,get:function(){return i},set:function(t){i=t}};if(a)for(var n in a)r[n]=a[n];var s={};t&&"[object Function]"===s.toString.call(t)&&(t=t.prototype),Object.defineProperty(t,e,r)}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.verticalAlign="top",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="hidden",styleUnselectableDiv(t)}function styleUnselectableDiv(t){t.style.userSelect="none",t.style.MozUserSelect="none",t.style.webkitUserSelect="none",t.style.oUserSelect="none"}function randomString(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var a,i="";for(a=t;a>0;--a)i+=e[Math.round(Math.random()*(e.length-1))];return i}function bez(t,e){e=t,t="bez_"+e.join("_").replace(/\./g,"p");var a=function(t,e){var a=[null,null],i=[null,null],r=[null,null],n=function(n,s){return r[s]=3*t[s],i[s]=3*(e[s]-t[s])-r[s],a[s]=1-r[s]-i[s],n*(r[s]+n*(i[s]+n*a[s]))},s=function(t){return r[0]+t*(2*i[0]+3*a[0]*t)},o=function(t){for(var e,a=t,i=0;++i<14&&(e=n(a,0)-t,!(Math.abs(e)<.001));)a-=e/s(a);return a};return function(t){return n(o(t),1)}};return easingFunctions[t]=function(t,i,r,n,s){return n*a([e[0],e[1]],[e[2],e[3]])(i/s)+r},t}function getInterpolatedValues(t,e){var a,i,r=[];if(null==t[0].i||null==t[0].o){for(a=0;e>a;a+=1)r.push(t);return r}var n,s;r=[];var o,l,h,m,p=[];i=t.length;var c;for(a=0;i>a;a+=1)if(n=t[a],n.to){var d=[],u=[];for(h=n.to.length,l=0;h>l;l+=1)d.push(n.s[l]+n.to[l]),u.push(n.e[l]+n.ti[l]);n.absTo=d,n.absTi=u}for(a=0;e>a;a+=1){o=0;for(var f=!1;i-1>o;){if(n=t[o],s=t[o+1],a<n.t&&0==o){for(h=n.o.y.length,p=[],l=0;h>l;l+=1)p.push(n.s[l]);r.push(p),f=!0;break}if(a>=n.t&&a<s.t){for(h=n.o.y.length,p=[],n.to&&(d=n.absTo,u=n.absTi),l=0;h>l;l+=1)if(m=bez([n.o.x,n.o.y[l],n.i.x,n.i.y[l]]),c=easingFunctions[m]("",a-n.t,0,1,s.t-n.t+1),n.to){d=n.absTo,u=n.absTi;var g=n.s[l]+(d[l]-n.s[l])*c,y=d[l]+(u[l]-d[l])*c,v=u[l]+(n.e[l]-u[l])*c,b=g+(y-g)*c,w=y+(v-y)*c,A=b+(w-b)*c;p.push(A)}else if(n.s[l].i){var E,M={i:[],o:[],v:[]},F=n.s[l].i.length;k=n.s[l].i[0].length;var S,k;for(E=0;F>E;E+=1){var x=[],D=[],I=[];for(S=0;k>S;S+=1)x.push(n.s[l].i[E][S]+(n.e[l].i[E][S]-n.s[l].i[E][S])*c),D.push(n.s[l].o[E][S]+(n.e[l].o[E][S]-n.s[l].o[E][S])*c),I.push(n.s[l].v[E][S]+(n.e[l].v[E][S]-n.s[l].v[E][S])*c);M.i.push(x),M.o.push(D),M.v.push(I)}p.push(M)}else p.push(n.s[l]+(n.e[l]-n.s[l])*c);r.push(p),f=!0;break}o+=1}if(0==f){for(n=t[t.length-2],p=[],l=0;h>l;l+=1)p.push(n.e[l]);r.push(p)}}return r}function EffectsManager(){}function StrokeEffectManager(){}function MaskElement(){}function ICompElement(t,e,a){this.parent.constructor.call(this,t,e,a)}function IImageElement(t,e,a){this.animationItem=a,this.assets=this.animationItem.getAssets(),this.path=this.animationItem.getPath(),this.parent.constructor.call(this,t,e,a)}function IShapeElement(t,e,a){this.shapes=[],this.parent.constructor.call(this,t,e,a)}function ShapeItemElement(t){this.data=t,this.shapeG=document.createElementNS(svgNS,"g"),this.pathLength=0,this.cachedData=[],"pathShape"===this.data.type?this.shape=document.createElementNS(svgNS,"path"):"rectShape"===this.data.type?this.shape=document.createElementNS(svgNS,"rect"):"ellipseShape"===this.data.type?(this.shape=document.createElementNS(svgNS,"ellipse"),this.data.trim&&this.adjustTrim()):this.shape=document.createElementNS(svgNS,"path"),this.data.trim?this.shape.setAttribute("stroke-linecap","butt"):(this.shape.setAttribute("stroke-linejoin","round"),this.shape.setAttribute("stroke-linecap","round")),this.data.renderedData||(this.data.renderedData={}),this.shape.setAttribute("name",this.data.name),styleUnselectableDiv(this.shapeG),styleUnselectableDiv(this.shape),this.shapeG.appendChild(this.shape)}function ISolidElement(t,e,a){this.parent.constructor.call(this,t,e,a)}function ITextElement(t,e,a){this.parent.constructor.call(this,t,e,a)}function PlayerManager(){}function BasicPlayer(){}var svgNS="http://www.w3.org/2000/svg";eval(function(t,e,a,i,r,n){if(r=function(t){return(e>t?"":r(parseInt(t/e)))+((t%=e)>35?String.fromCharCode(t+29):t.toString(36))},!"".replace(/^/,String)){for(;a--;)n[r(a)]=i[a]||r(a);i=[function(t){return n[t]}],r=function(){return"\\w+"},a=1}for(;a--;)i[a]&&(t=t.replace(new RegExp("\\b"+r(a)+"\\b","g"),i[a]));return t}("9 17={3i:'0.1.3',16:1e-6};l v(){}v.23={e:l(i){8(i<1||i>7.4.q)?w:7.4[i-1]},2R:l(){8 7.4.q},1u:l(){8 F.1x(7.2u(7))},24:l(a){9 n=7.4.q;9 V=a.4||a;o(n!=V.q){8 1L}J{o(F.13(7.4[n-1]-V[n-1])>17.16){8 1L}}H(--n);8 2x},1q:l(){8 v.u(7.4)},1b:l(a){9 b=[];7.28(l(x,i){b.19(a(x,i))});8 v.u(b)},28:l(a){9 n=7.4.q,k=n,i;J{i=k-n;a(7.4[i],i+1)}H(--n)},2q:l(){9 r=7.1u();o(r===0){8 7.1q()}8 7.1b(l(x){8 x/r})},1C:l(a){9 V=a.4||a;9 n=7.4.q,k=n,i;o(n!=V.q){8 w}9 b=0,1D=0,1F=0;7.28(l(x,i){b+=x*V[i-1];1D+=x*x;1F+=V[i-1]*V[i-1]});1D=F.1x(1D);1F=F.1x(1F);o(1D*1F===0){8 w}9 c=b/(1D*1F);o(c<-1){c=-1}o(c>1){c=1}8 F.37(c)},1m:l(a){9 b=7.1C(a);8(b===w)?w:(b<=17.16)},34:l(a){9 b=7.1C(a);8(b===w)?w:(F.13(b-F.1A)<=17.16)},2k:l(a){9 b=7.2u(a);8(b===w)?w:(F.13(b)<=17.16)},2j:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x+V[i-1]})},2C:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x-V[i-1]})},22:l(k){8 7.1b(l(x){8 x*k})},x:l(k){8 7.22(k)},2u:l(a){9 V=a.4||a;9 i,2g=0,n=7.4.q;o(n!=V.q){8 w}J{2g+=7.4[n-1]*V[n-1]}H(--n);8 2g},2f:l(a){9 B=a.4||a;o(7.4.q!=3||B.q!=3){8 w}9 A=7.4;8 v.u([(A[1]*B[2])-(A[2]*B[1]),(A[2]*B[0])-(A[0]*B[2]),(A[0]*B[1])-(A[1]*B[0])])},2A:l(){9 m=0,n=7.4.q,k=n,i;J{i=k-n;o(F.13(7.4[i])>F.13(m)){m=7.4[i]}}H(--n);8 m},2Z:l(x){9 a=w,n=7.4.q,k=n,i;J{i=k-n;o(a===w&&7.4[i]==x){a=i+1}}H(--n);8 a},3g:l(){8 S.2X(7.4)},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(y){8(F.13(y-x)<=17.16)?x:y})},1o:l(a){o(a.K){8 a.1o(7)}9 V=a.4||a;o(V.q!=7.4.q){8 w}9 b=0,2b;7.28(l(x,i){2b=x-V[i-1];b+=2b*2b});8 F.1x(b)},3a:l(a){8 a.1h(7)},2T:l(a){8 a.1h(7)},1V:l(t,a){9 V,R,x,y,z;2S(7.4.q){27 2:V=a.4||a;o(V.q!=2){8 w}R=S.1R(t).4;x=7.4[0]-V[0];y=7.4[1]-V[1];8 v.u([V[0]+R[0][0]*x+R[0][1]*y,V[1]+R[1][0]*x+R[1][1]*y]);1I;27 3:o(!a.U){8 w}9 C=a.1r(7).4;R=S.1R(t,a.U).4;x=7.4[0]-C[0];y=7.4[1]-C[1];z=7.4[2]-C[2];8 v.u([C[0]+R[0][0]*x+R[0][1]*y+R[0][2]*z,C[1]+R[1][0]*x+R[1][1]*y+R[1][2]*z,C[2]+R[2][0]*x+R[2][1]*y+R[2][2]*z]);1I;2P:8 w}},1t:l(a){o(a.K){9 P=7.4.2O();9 C=a.1r(P).4;8 v.u([C[0]+(C[0]-P[0]),C[1]+(C[1]-P[1]),C[2]+(C[2]-(P[2]||0))])}1d{9 Q=a.4||a;o(7.4.q!=Q.q){8 w}8 7.1b(l(x,i){8 Q[i-1]+(Q[i-1]-x)})}},1N:l(){9 V=7.1q();2S(V.4.q){27 3:1I;27 2:V.4.19(0);1I;2P:8 w}8 V},2n:l(){8'['+7.4.2K(', ')+']'},26:l(a){7.4=(a.4||a).2O();8 7}};v.u=l(a){9 V=25 v();8 V.26(a)};v.i=v.u([1,0,0]);v.j=v.u([0,1,0]);v.k=v.u([0,0,1]);v.2J=l(n){9 a=[];J{a.19(F.2F())}H(--n);8 v.u(a)};v.1j=l(n){9 a=[];J{a.19(0)}H(--n);8 v.u(a)};l S(){}S.23={e:l(i,j){o(i<1||i>7.4.q||j<1||j>7.4[0].q){8 w}8 7.4[i-1][j-1]},33:l(i){o(i>7.4.q){8 w}8 v.u(7.4[i-1])},2E:l(j){o(j>7.4[0].q){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][j-1])}H(--n);8 v.u(a)},2R:l(){8{2D:7.4.q,1p:7.4[0].q}},2D:l(){8 7.4.q},1p:l(){8 7.4[0].q},24:l(a){9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}o(7.4.q!=M.q||7.4[0].q!=M[0].q){8 1L}9 b=7.4.q,15=b,i,G,10=7.4[0].q,j;J{i=15-b;G=10;J{j=10-G;o(F.13(7.4[i][j]-M[i][j])>17.16){8 1L}}H(--G)}H(--b);8 2x},1q:l(){8 S.u(7.4)},1b:l(a){9 b=[],12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;b[i]=[];J{j=10-G;b[i][j]=a(7.4[i][j],i+1,j+1)}H(--G)}H(--12);8 S.u(b)},2i:l(a){9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}8(7.4.q==M.q&&7.4[0].q==M[0].q)},2j:l(a){9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x+M[i-1][j-1]})},2C:l(a){9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x-M[i-1][j-1]})},2B:l(a){9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}8(7.4[0].q==M.q)},22:l(a){o(!a.4){8 7.1b(l(x){8 x*a})}9 b=a.1u?2x:1L;9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}o(!7.2B(M)){8 w}9 d=7.4.q,15=d,i,G,10=M[0].q,j;9 e=7.4[0].q,4=[],21,20,c;J{i=15-d;4[i]=[];G=10;J{j=10-G;21=0;20=e;J{c=e-20;21+=7.4[i][c]*M[c][j]}H(--20);4[i][j]=21}H(--G)}H(--d);9 M=S.u(4);8 b?M.2E(1):M},x:l(a){8 7.22(a)},32:l(a,b,c,d){9 e=[],12=c,i,G,j;9 f=7.4.q,1p=7.4[0].q;J{i=c-12;e[i]=[];G=d;J{j=d-G;e[i][j]=7.4[(a+i-1)%f][(b+j-1)%1p]}H(--G)}H(--12);8 S.u(e)},31:l(){9 a=7.4.q,1p=7.4[0].q;9 b=[],12=1p,i,G,j;J{i=1p-12;b[i]=[];G=a;J{j=a-G;b[i][j]=7.4[j][i]}H(--G)}H(--12);8 S.u(b)},1y:l(){8(7.4.q==7.4[0].q)},2A:l(){9 m=0,12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;J{j=10-G;o(F.13(7.4[i][j])>F.13(m)){m=7.4[i][j]}}H(--G)}H(--12);8 m},2Z:l(x){9 a=w,12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;J{j=10-G;o(7.4[i][j]==x){8{i:i+1,j:j+1}}}H(--G)}H(--12);8 w},30:l(){o(!7.1y){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][i])}H(--n);8 v.u(a)},1K:l(){9 M=7.1q(),1c;9 n=7.4.q,k=n,i,1s,1n=7.4[0].q,p;J{i=k-n;o(M.4[i][i]==0){2e(j=i+1;j<k;j++){o(M.4[j][i]!=0){1c=[];1s=1n;J{p=1n-1s;1c.19(M.4[i][p]+M.4[j][p])}H(--1s);M.4[i]=1c;1I}}}o(M.4[i][i]!=0){2e(j=i+1;j<k;j++){9 a=M.4[j][i]/M.4[i][i];1c=[];1s=1n;J{p=1n-1s;1c.19(p<=i?0:M.4[j][p]-M.4[i][p]*a)}H(--1s);M.4[j]=1c}}}H(--n);8 M},3h:l(){8 7.1K()},2z:l(){o(!7.1y()){8 w}9 M=7.1K();9 a=M.4[0][0],n=M.4.q-1,k=n,i;J{i=k-n+1;a=a*M.4[i][i]}H(--n);8 a},3f:l(){8 7.2z()},2y:l(){8(7.1y()&&7.2z()===0)},2Y:l(){o(!7.1y()){8 w}9 a=7.4[0][0],n=7.4.q-1,k=n,i;J{i=k-n+1;a+=7.4[i][i]}H(--n);8 a},3e:l(){8 7.2Y()},1Y:l(){9 M=7.1K(),1Y=0;9 a=7.4.q,15=a,i,G,10=7.4[0].q,j;J{i=15-a;G=10;J{j=10-G;o(F.13(M.4[i][j])>17.16){1Y++;1I}}H(--G)}H(--a);8 1Y},3d:l(){8 7.1Y()},2W:l(a){9 M=a.4||a;o(1g(M[0][0])=='1f'){M=S.u(M).4}9 T=7.1q(),1p=T.4[0].q;9 b=T.4.q,15=b,i,G,10=M[0].q,j;o(b!=M.q){8 w}J{i=15-b;G=10;J{j=10-G;T.4[i][1p+j]=M[i][j]}H(--G)}H(--b);8 T},2w:l(){o(!7.1y()||7.2y()){8 w}9 a=7.4.q,15=a,i,j;9 M=7.2W(S.I(a)).1K();9 b,1n=M.4[0].q,p,1c,2v;9 c=[],2c;J{i=a-1;1c=[];b=1n;c[i]=[];2v=M.4[i][i];J{p=1n-b;2c=M.4[i][p]/2v;1c.19(2c);o(p>=15){c[i].19(2c)}}H(--b);M.4[i]=1c;2e(j=0;j<i;j++){1c=[];b=1n;J{p=1n-b;1c.19(M.4[j][p]-M.4[i][p]*M.4[j][i])}H(--b);M.4[j]=1c}}H(--a);8 S.u(c)},3c:l(){8 7.2w()},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(p){8(F.13(p-x)<=17.16)?x:p})},2n:l(){9 a=[];9 n=7.4.q,k=n,i;J{i=k-n;a.19(v.u(7.4[i]).2n())}H(--n);8 a.2K('\\n')},26:l(a){9 i,4=a.4||a;o(1g(4[0][0])!='1f'){9 b=4.q,15=b,G,10,j;7.4=[];J{i=15-b;G=4[i].q;10=G;7.4[i]=[];J{j=10-G;7.4[i][j]=4[i][j]}H(--G)}H(--b);8 7}9 n=4.q,k=n;7.4=[];J{i=k-n;7.4.19([4[i]])}H(--n);8 7}};S.u=l(a){9 M=25 S();8 M.26(a)};S.I=l(n){9 a=[],k=n,i,G,j;J{i=k-n;a[i]=[];G=k;J{j=k-G;a[i][j]=(i==j)?1:0}H(--G)}H(--n);8 S.u(a)};S.2X=l(a){9 n=a.q,k=n,i;9 M=S.I(n);J{i=k-n;M.4[i][i]=a[i]}H(--n);8 M};S.1R=l(b,a){o(!a){8 S.u([[F.1H(b),-F.1G(b)],[F.1G(b),F.1H(b)]])}9 d=a.1q();o(d.4.q!=3){8 w}9 e=d.1u();9 x=d.4[0]/e,y=d.4[1]/e,z=d.4[2]/e;9 s=F.1G(b),c=F.1H(b),t=1-c;8 S.u([[t*x*x+c,t*x*y-s*z,t*x*z+s*y],[t*x*y+s*z,t*y*y+c,t*y*z-s*x],[t*x*z-s*y,t*y*z+s*x,t*z*z+c]])};S.3b=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[1,0,0],[0,c,-s],[0,s,c]])};S.39=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[c,0,s],[0,1,0],[-s,0,c]])};S.38=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[c,-s,0],[s,c,0],[0,0,1]])};S.2J=l(n,m){8 S.1j(n,m).1b(l(){8 F.2F()})};S.1j=l(n,m){9 a=[],12=n,i,G,j;J{i=n-12;a[i]=[];G=m;J{j=m-G;a[i][j]=0}H(--G)}H(--12);8 S.u(a)};l 14(){}14.23={24:l(a){8(7.1m(a)&&7.1h(a.K))},1q:l(){8 14.u(7.K,7.U)},2U:l(a){9 V=a.4||a;8 14.u([7.K.4[0]+V[0],7.K.4[1]+V[1],7.K.4[2]+(V[2]||0)],7.U)},1m:l(a){o(a.W){8 a.1m(7)}9 b=7.U.1C(a.U);8(F.13(b)<=17.16||F.13(b-F.1A)<=17.16)},1o:l(a){o(a.W){8 a.1o(7)}o(a.U){o(7.1m(a)){8 7.1o(a.K)}9 N=7.U.2f(a.U).2q().4;9 A=7.K.4,B=a.K.4;8 F.13((A[0]-B[0])*N[0]+(A[1]-B[1])*N[1]+(A[2]-B[2])*N[2])}1d{9 P=a.4||a;9 A=7.K.4,D=7.U.4;9 b=P[0]-A[0],2a=P[1]-A[1],29=(P[2]||0)-A[2];9 c=F.1x(b*b+2a*2a+29*29);o(c===0)8 0;9 d=(b*D[0]+2a*D[1]+29*D[2])/c;9 e=1-d*d;8 F.13(c*F.1x(e<0?0:e))}},1h:l(a){9 b=7.1o(a);8(b!==w&&b<=17.16)},2T:l(a){8 a.1h(7)},1v:l(a){o(a.W){8 a.1v(7)}8(!7.1m(a)&&7.1o(a)<=17.16)},1U:l(a){o(a.W){8 a.1U(7)}o(!7.1v(a)){8 w}9 P=7.K.4,X=7.U.4,Q=a.K.4,Y=a.U.4;9 b=X[0],1z=X[1],1B=X[2],1T=Y[0],1S=Y[1],1M=Y[2];9 c=P[0]-Q[0],2s=P[1]-Q[1],2r=P[2]-Q[2];9 d=-b*c-1z*2s-1B*2r;9 e=1T*c+1S*2s+1M*2r;9 f=b*b+1z*1z+1B*1B;9 g=1T*1T+1S*1S+1M*1M;9 h=b*1T+1z*1S+1B*1M;9 k=(d*g/f+h*e)/(g-h*h);8 v.u([P[0]+k*b,P[1]+k*1z,P[2]+k*1B])},1r:l(a){o(a.U){o(7.1v(a)){8 7.1U(a)}o(7.1m(a)){8 w}9 D=7.U.4,E=a.U.4;9 b=D[0],1l=D[1],1k=D[2],1P=E[0],1O=E[1],1Q=E[2];9 x=(1k*1P-b*1Q),y=(b*1O-1l*1P),z=(1l*1Q-1k*1O);9 N=v.u([x*1Q-y*1O,y*1P-z*1Q,z*1O-x*1P]);9 P=11.u(a.K,N);8 P.1U(7)}1d{9 P=a.4||a;o(7.1h(P)){8 v.u(P)}9 A=7.K.4,D=7.U.4;9 b=D[0],1l=D[1],1k=D[2],1w=A[0],18=A[1],1a=A[2];9 x=b*(P[1]-18)-1l*(P[0]-1w),y=1l*((P[2]||0)-1a)-1k*(P[1]-18),z=1k*(P[0]-1w)-b*((P[2]||0)-1a);9 V=v.u([1l*x-1k*z,1k*y-b*x,b*z-1l*y]);9 k=7.1o(P)/V.1u();8 v.u([P[0]+V.4[0]*k,P[1]+V.4[1]*k,(P[2]||0)+V.4[2]*k])}},1V:l(t,a){o(1g(a.U)=='1f'){a=14.u(a.1N(),v.k)}9 R=S.1R(t,a.U).4;9 C=a.1r(7.K).4;9 A=7.K.4,D=7.U.4;9 b=C[0],1E=C[1],1J=C[2],1w=A[0],18=A[1],1a=A[2];9 x=1w-b,y=18-1E,z=1a-1J;8 14.u([b+R[0][0]*x+R[0][1]*y+R[0][2]*z,1E+R[1][0]*x+R[1][1]*y+R[1][2]*z,1J+R[2][0]*x+R[2][1]*y+R[2][2]*z],[R[0][0]*D[0]+R[0][1]*D[1]+R[0][2]*D[2],R[1][0]*D[0]+R[1][1]*D[1]+R[1][2]*D[2],R[2][0]*D[0]+R[2][1]*D[1]+R[2][2]*D[2]])},1t:l(a){o(a.W){9 A=7.K.4,D=7.U.4;9 b=A[0],18=A[1],1a=A[2],2N=D[0],1l=D[1],1k=D[2];9 c=7.K.1t(a).4;9 d=b+2N,2h=18+1l,2o=1a+1k;9 Q=a.1r([d,2h,2o]).4;9 e=[Q[0]+(Q[0]-d)-c[0],Q[1]+(Q[1]-2h)-c[1],Q[2]+(Q[2]-2o)-c[2]];8 14.u(c,e)}1d o(a.U){8 7.1V(F.1A,a)}1d{9 P=a.4||a;8 14.u(7.K.1t([P[0],P[1],(P[2]||0)]),7.U)}},1Z:l(a,b){a=v.u(a);b=v.u(b);o(a.4.q==2){a.4.19(0)}o(b.4.q==2){b.4.19(0)}o(a.4.q>3||b.4.q>3){8 w}9 c=b.1u();o(c===0){8 w}7.K=a;7.U=v.u([b.4[0]/c,b.4[1]/c,b.4[2]/c]);8 7}};14.u=l(a,b){9 L=25 14();8 L.1Z(a,b)};14.X=14.u(v.1j(3),v.i);14.Y=14.u(v.1j(3),v.j);14.Z=14.u(v.1j(3),v.k);l 11(){}11.23={24:l(a){8(7.1h(a.K)&&7.1m(a))},1q:l(){8 11.u(7.K,7.W)},2U:l(a){9 V=a.4||a;8 11.u([7.K.4[0]+V[0],7.K.4[1]+V[1],7.K.4[2]+(V[2]||0)],7.W)},1m:l(a){9 b;o(a.W){b=7.W.1C(a.W);8(F.13(b)<=17.16||F.13(F.1A-b)<=17.16)}1d o(a.U){8 7.W.2k(a.U)}8 w},2k:l(a){9 b=7.W.1C(a.W);8(F.13(F.1A/2-b)<=17.16)},1o:l(a){o(7.1v(a)||7.1h(a)){8 0}o(a.K){9 A=7.K.4,B=a.K.4,N=7.W.4;8 F.13((A[0]-B[0])*N[0]+(A[1]-B[1])*N[1]+(A[2]-B[2])*N[2])}1d{9 P=a.4||a;9 A=7.K.4,N=7.W.4;8 F.13((A[0]-P[0])*N[0]+(A[1]-P[1])*N[1]+(A[2]-(P[2]||0))*N[2])}},1h:l(a){o(a.W){8 w}o(a.U){8(7.1h(a.K)&&7.1h(a.K.2j(a.U)))}1d{9 P=a.4||a;9 A=7.K.4,N=7.W.4;9 b=F.13(N[0]*(A[0]-P[0])+N[1]*(A[1]-P[1])+N[2]*(A[2]-(P[2]||0)));8(b<=17.16)}},1v:l(a){o(1g(a.U)=='1f'&&1g(a.W)=='1f'){8 w}8!7.1m(a)},1U:l(a){o(!7.1v(a)){8 w}o(a.U){9 A=a.K.4,D=a.U.4,P=7.K.4,N=7.W.4;9 b=(N[0]*(P[0]-A[0])+N[1]*(P[1]-A[1])+N[2]*(P[2]-A[2]))/(N[0]*D[0]+N[1]*D[1]+N[2]*D[2]);8 v.u([A[0]+D[0]*b,A[1]+D[1]*b,A[2]+D[2]*b])}1d o(a.W){9 c=7.W.2f(a.W).2q();9 N=7.W.4,A=7.K.4,O=a.W.4,B=a.K.4;9 d=S.1j(2,2),i=0;H(d.2y()){i++;d=S.u([[N[i%3],N[(i+1)%3]],[O[i%3],O[(i+1)%3]]])}9 e=d.2w().4;9 x=N[0]*A[0]+N[1]*A[1]+N[2]*A[2];9 y=O[0]*B[0]+O[1]*B[1]+O[2]*B[2];9 f=[e[0][0]*x+e[0][1]*y,e[1][0]*x+e[1][1]*y];9 g=[];2e(9 j=1;j<=3;j++){g.19((i==j)?0:f[(j+(5-i)%3)%3])}8 14.u(g,c)}},1r:l(a){9 P=a.4||a;9 A=7.K.4,N=7.W.4;9 b=(A[0]-P[0])*N[0]+(A[1]-P[1])*N[1]+(A[2]-(P[2]||0))*N[2];8 v.u([P[0]+N[0]*b,P[1]+N[1]*b,(P[2]||0)+N[2]*b])},1V:l(t,a){9 R=S.1R(t,a.U).4;9 C=a.1r(7.K).4;9 A=7.K.4,N=7.W.4;9 b=C[0],1E=C[1],1J=C[2],1w=A[0],18=A[1],1a=A[2];9 x=1w-b,y=18-1E,z=1a-1J;8 11.u([b+R[0][0]*x+R[0][1]*y+R[0][2]*z,1E+R[1][0]*x+R[1][1]*y+R[1][2]*z,1J+R[2][0]*x+R[2][1]*y+R[2][2]*z],[R[0][0]*N[0]+R[0][1]*N[1]+R[0][2]*N[2],R[1][0]*N[0]+R[1][1]*N[1]+R[1][2]*N[2],R[2][0]*N[0]+R[2][1]*N[1]+R[2][2]*N[2]])},1t:l(a){o(a.W){9 A=7.K.4,N=7.W.4;9 b=A[0],18=A[1],1a=A[2],2M=N[0],2L=N[1],2Q=N[2];9 c=7.K.1t(a).4;9 d=b+2M,2p=18+2L,2m=1a+2Q;9 Q=a.1r([d,2p,2m]).4;9 e=[Q[0]+(Q[0]-d)-c[0],Q[1]+(Q[1]-2p)-c[1],Q[2]+(Q[2]-2m)-c[2]];8 11.u(c,e)}1d o(a.U){8 7.1V(F.1A,a)}1d{9 P=a.4||a;8 11.u(7.K.1t([P[0],P[1],(P[2]||0)]),7.W)}},1Z:l(a,b,c){a=v.u(a);a=a.1N();o(a===w){8 w}b=v.u(b);b=b.1N();o(b===w){8 w}o(1g(c)=='1f'){c=w}1d{c=v.u(c);c=c.1N();o(c===w){8 w}}9 d=a.4[0],18=a.4[1],1a=a.4[2];9 e=b.4[0],1W=b.4[1],1X=b.4[2];9 f,1i;o(c!==w){9 g=c.4[0],2l=c.4[1],2t=c.4[2];f=v.u([(1W-18)*(2t-1a)-(1X-1a)*(2l-18),(1X-1a)*(g-d)-(e-d)*(2t-1a),(e-d)*(2l-18)-(1W-18)*(g-d)]);1i=f.1u();o(1i===0){8 w}f=v.u([f.4[0]/1i,f.4[1]/1i,f.4[2]/1i])}1d{1i=F.1x(e*e+1W*1W+1X*1X);o(1i===0){8 w}f=v.u([b.4[0]/1i,b.4[1]/1i,b.4[2]/1i])}7.K=a;7.W=f;8 7}};11.u=l(a,b,c){9 P=25 11();8 P.1Z(a,b,c)};11.2I=11.u(v.1j(3),v.k);11.2H=11.u(v.1j(3),v.i);11.2G=11.u(v.1j(3),v.j);11.36=11.2I;11.35=11.2H;11.3j=11.2G;9 $V=v.u;9 $M=S.u;9 $L=14.u;9 $P=11.u;",62,206,"||||elements|||this|return|var||||||||||||function|||if||length||||create|Vector|null|||||||||Math|nj|while||do|anchor||||||||Matrix||direction||normal||||kj|Plane|ni|abs|Line|ki|precision|Sylvester|A2|push|A3|map|els|else||undefined|typeof|contains|mod|Zero|D3|D2|isParallelTo|kp|distanceFrom|cols|dup|pointClosestTo|np|reflectionIn|modulus|intersects|A1|sqrt|isSquare|X2|PI|X3|angleFrom|mod1|C2|mod2|sin|cos|break|C3|toRightTriangular|false|Y3|to3D|E2|E1|E3|Rotation|Y2|Y1|intersectionWith|rotate|v12|v13|rank|setVectors|nc|sum|multiply|prototype|eql|new|setElements|case|each|PA3|PA2|part|new_element|round|for|cross|product|AD2|isSameSizeAs|add|isPerpendicularTo|v22|AN3|inspect|AD3|AN2|toUnitVector|PsubQ3|PsubQ2|v23|dot|divisor|inverse|true|isSingular|determinant|max|canMultiplyFromLeft|subtract|rows|col|random|ZX|YZ|XY|Random|join|N2|N1|D1|slice|default|N3|dimensions|switch|liesIn|translate|snapTo|augment|Diagonal|trace|indexOf|diagonal|transpose|minor|row|isAntiparallelTo|ZY|YX|acos|RotationZ|RotationY|liesOn|RotationX|inv|rk|tr|det|toDiagonalMatrix|toUpperTriangular|version|XZ".split("|"),0,{}));var MatrixManager=function(){var t=function(t,e,a,i,r,n,s,o,l){var h,m,p,c,d,u,f;return h=$M([[1,0,0,0],[0,Math.cos(t),Math.sin(-t),0],[0,Math.sin(t),Math.cos(t),0],[0,0,0,1]]),m=$M([[Math.cos(e),0,Math.sin(e),0],[0,1,0,0],[Math.sin(-e),0,Math.cos(e),0],[0,0,0,1]]),p=$M([[Math.cos(a),Math.sin(-a),0,0],[Math.sin(a),Math.cos(a),0,0],[0,0,1,0],[0,0,0,1]]),d=$M([[i,0,0,0],[0,r,0,0],[0,0,n,0],[0,0,0,1]]),u=h.x(m).x(p).x(d),u=u.transpose(),f=$M([[1,0,0,0],[0,1,0,0],[0,0,1,0],[s,o,l,1]]),u=u.x(f),c="matrix3d(",c+=u.e(1,1).toFixed(5)+","+u.e(1,2).toFixed(5)+","+u.e(1,3).toFixed(5)+","+u.e(1,4).toFixed(5)+",",c+=u.e(2,1).toFixed(5)+","+u.e(2,2).toFixed(5)+","+u.e(2,3).toFixed(5)+","+u.e(2,4).toFixed(5)+",",c+=u.e(3,1).toFixed(5)+","+u.e(3,2).toFixed(5)+","+u.e(3,3).toFixed(5)+","+u.e(3,4).toFixed(5)+",",c+=u.e(4,1).toFixed(5)+","+u.e(4,2).toFixed(5)+","+u.e(4,3).toFixed(5)+","+u.e(4,4).toFixed(5),c+=")"},e=function(t,e,a,i,r){var n,s,o,l,h;return n=$M([[Math.cos(-t),Math.sin(-t),0],[Math.sin(t),Math.cos(-t),0],[0,0,1]]),o=$M([[e,0,0],[0,a,0],[0,0,1]]),l=n.x(o),l=l.transpose(),h=$M([[1,0,0],[0,1,0],[i,r,1]]),l=l.x(h),s="matrix(",s+=l.e(1,1).toFixed(5)+","+l.e(1,2).toFixed(5)+",",s+=l.e(2,1).toFixed(5)+","+l.e(2,2).toFixed(5)+",",s+=l.e(3,1).toFixed(5)+","+l.e(3,2).toFixed(5),s+=")"},a=function(t){return e(t.r,t.s[0],t.s[1],t.p[0],t.p[1])},i=function(a,i){return i?t(-a.tr.r[0],a.tr.r[1],a.tr.r[2],a.tr.s[0],a.tr.s[1],a.tr.s[2],a.tr.p[0],a.tr.p[1],a.tr.p[2]):e(a.tr.r[2],a.tr.s[0],a.tr.s[1],a.tr.p[0],a.tr.p[1])};return{get2DMatrix:a,getMatrix:i}};!function(){for(var t=0,e=["ms","moz","webkit","o"],a=0;a<e.length&&!window.requestAnimationFrame;++a)window.requestAnimationFrame=window[e[a]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[a]+"CancelAnimationFrame"]||window[e[a]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var a=(new Date).getTime(),i=Math.max(0,16-(a-t)),r=window.setTimeout(function(){e(a+i)},i);return t=a+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var DataManager=function(){this.totalFrames=0};DataManager.prototype.completeMasks=function(t,e,a){var i,r,n,s,o,l=t.length;for(i=0;l>i;i++){for(o="",s=t[i],n=s.v.length,r=0;n>r;r++)s.v[r][0]+=-a.x,s.v[r][1]+=-a.y,0==r?o="M"+Math.round(10*s.v[r][0])/10+","+Math.round(10*s.v[r][1])/10:(o+=" C"+Math.round(10*(s.o[r-1][0]+s.v[r-1][0]))/10+","+Math.round(10*(s.o[r-1][1]+s.v[r-1][1]))/10,o+=" "+Math.round(10*(s.i[r][0]+s.v[r][0]))/10+","+Math.round(10*(s.i[r][1]+s.v[r][1]))/10,o+=" "+Math.round(10*s.v[r][0])/10+","+Math.round(10*s.v[r][1])/10);e[i].cl&&(o+=" C"+Math.round(10*(s.o[r-1][0]+s.v[r-1][0]))/10+","+Math.round(10*(s.o[r-1][1]+s.v[r-1][1]))/10,o+=" "+Math.round(10*(s.i[0][0]+s.v[0][0]))/10+","+Math.round(10*(s.i[0][1]+s.v[0][1]))/10,o+=" "+Math.round(10*s.v[0][0])/10+","+Math.round(10*s.v[0][1])/10),t[i].pathString=o}},DataManager.prototype.completeEffects=function(t){if(void 0!==t){var e,a=t.length;for(e=0;a>e;e+=1)"Stroke"==t[e].type&&this.completeAnimatedData(t[e].animated)}},DataManager.prototype.completeAnimatedData=function(t){var e,a,i={};for(a in t)i[a]={arr:[],pos:-1};for(e=0;e<this.totalFrames;e++)for(a in t)void 0!==t[a][e]?(i[a].arr.push(t[a][e]),i[a].pos=e):i[a].arr.push({forwardFrame:i[a].pos});for(a in t)t[a]=i[a].arr},DataManager.prototype.completeShapes=function(t){var e,a,i,r,n,s,o,l,h,m=new MatrixManager,p=t.length,c={},d={i:null,o:null,v:null};for(e=0;p>e;e++){if(h={tr:[],fill:[],path:[],rect:[],ell:[],stroke:[]},l=t[e].an,t[e].ks){var u=getInterpolatedValues(t[e].ks,this.totalFrames),f={i:[],o:[],v:[]};i=u.length;var g,y,v;for(a=0;i>a;a+=1){for(n=u[a].length,g=[],y=[],v=[],r=0;n>r;r+=1)g.push(u[a][r].i),y.push(u[a][r].o),v.push(u[a][r].v);f.i.push(g),f.o.push(y),f.v.push(v)}l.path=f}for(h.renderedFrame={tr:-1,fill:-1,path:-1,rect:-1,ell:-1,stroke:-1},a=0;a<this.totalFrames;a++){l.tr[a]?(l.tr[a].mt=m.get2DMatrix(l.tr[a]),c.tr=l.tr[a],c.tr.forwardFrame=a,h.tr.push(c.tr),c.trFrame=a):h.tr.push({forwardFrame:c.trFrame}),l.fill&&(l.fill[a]?(c.fill=l.fill[a],c.fill.forwardFrame=a,h.fill.push(c.fill),c.fillFrame=a):h.fill.push({forwardFrame:c.fillFrame}));var b=this.animW/2,w=this.animH/2;if(b=w=0,l.path)if(l.path.i[a]||l.path.o[a]||l.path.v[a]){for(d.i=l.path.i[a]?l.path.i[a]:d.i,d.o=l.path.o[a]?l.path.o[a]:d.o,d.v=l.path.v[a]?l.path.v[a]:d.v,o=d.i.length,c.path=[],s=0;o>s;s+=1)c.path.push({i:d.i[s],o:d.o[s],v:d.v[s]});c.path.forwardFrame=a,h.path.push(c.path),c.pathFrame=a,o=c.path.length;var A,E="";for(s=0;o>s;s+=1){for(A=c.path[s],n=A.v.length,r=0;n>r;r++)0==r?E+="M"+Math.round(10*(A.v[r][0]+b))/10+","+Math.round(10*(A.v[r][1]+w))/10:(E+=" C"+Math.round(10*(A.o[r-1][0]+A.v[r-1][0]+b))/10+","+Math.round(10*(A.o[r-1][1]+A.v[r-1][1]+w))/10,E+=" "+Math.round(10*(A.i[r][0]+A.v[r][0]+b))/10+","+Math.round(10*(A.i[r][1]+A.v[r][1]+w))/10,E+=" "+Math.round(10*(A.v[r][0]+b))/10+","+Math.round(10*(A.v[r][1]+w))/10);t[e].closed!==!1&&(E+=" C"+Math.round(10*(A.o[r-1][0]+A.v[r-1][0]+b))/10+","+Math.round(10*(A.o[r-1][1]+A.v[r-1][1]+w))/10,E+=" "+Math.round(10*(A.i[0][0]+A.v[0][0]+b))/10+","+Math.round(10*(A.i[0][1]+A.v[0][1]+w))/10,E+=" "+Math.round(10*(A.v[0][0]+b))/10+","+Math.round(10*(A.v[0][1]+w))/10)}c.path.pathString=E}else h.path.push({forwardFrame:c.pathFrame});l.rect&&(l.rect[a]?(c.rect=l.rect[a],c.rect.forwardFrame=a,h.rect.push(c.rect),c.rectFrame=a):h.rect.push({forwardFrame:c.rectFrame})),l.ell&&(l.ell[a]?(c.ell=l.ell[a],c.ell.forwardFrame=a,h.ell.push(c.ell),c.ellFrame=a):h.ell.push({forwardFrame:c.ellFrame})),l.stroke&&(l.stroke[a]?(c.stroke=l.stroke[a],c.stroke.forwardFrame=a,h.stroke.push(c.stroke),c.strokeFrame=a):h.stroke.push({forwardFrame:c.strokeFrame}))}0==h.tr.length&&delete h.tr,0==h.fill.length&&delete h.fill,0==h.path.length&&delete h.path,0==h.rect.length&&delete h.rect,0==h.ell.length&&delete h.ell,0==h.stroke.length&&delete h.stroke,t[e].trim&&this.completeTrim(t[e]),t[e].an=h}},DataManager.prototype.completeTrim=function(t){var e=t.trim;t.renderedData={trim:-1};var a,i=this.totalFrames,r={},n=-1,s=[];for(a=0;i>a;a+=1)void 0!=e.s[a]||void 0!=e.e[a]||void 0!=e.o[a]?(r.s=void 0!=e.s[a]?e.s[a]:r.s,r.e=void 0!=e.e[a]?e.e[a]:r.e,r.o=void 0!=e.o[a]?e.o[a]:r.o,s.push({s:r.s,e:r.e,o:r.o,forwardFrame:a}),n=a):s.push({forwardFrame:n});t.trim=s},DataManager.prototype.interpolateTransform=function(t){var e=t.ks,a=new MatrixManager,i={};i.p=[],i.r=[],i.a=[],i.s=[],i.o=[];var r,n;if(e.p instanceof Array==!1?i.p[0]=[e.p,e.p,e.p]:i.p=getInterpolatedValues(e.p,this.totalFrames),e.r instanceof Array==!1)i.r.x=0,i.r.y=0,i.r.z=e.r*Math.PI/180;else for(n=getInterpolatedValues(e.r,this.totalFrames),r=0;r<this.totalFrames;r+=1)i.r.push([]),i.r[r].push(n[r].length>1?n[r][0]*Math.PI/180:0),i.r[r].push(n[r].length>1?n[r][1]*Math.PI/180:0),i.r[r].push(n[r].length>1?n[r][2]*Math.PI/180:n[r][0]*Math.PI/180);if(e.a instanceof Array==!1)i.a.x=e.a,i.a.y=e.a,i.a.z=e.a;else for(n=getInterpolatedValues(e.a,this.totalFrames),r=0;r<this.totalFrames;r+=1)i.a.push([]),i.a[r].push(n[r].length>1?n[r][0]:0),i.a[r].push(n[r].length>1?n[r][1]:0),i.a[r].push(n[r].length>1?n[r][2]:n[r][0]);if(e.s instanceof Array==!1)i.s.x=e.s/100,i.s.y=e.s/100,i.s.z=e.s/100;else for(n=getInterpolatedValues(e.s,this.totalFrames),r=0;r<this.totalFrames;r+=1)i.s.push([]),i.s[r].push(n[r].length>1?n[r][0]/100:0),i.s[r].push(n[r].length>1?n[r][1]/100:0),i.s[r].push(n[r].length>1?n[r][2]/100:n[r][0]/100);if(e.o instanceof Array==!1)i.o=e.o/100;else for(n=getInterpolatedValues(e.o,this.totalFrames),r=0;r<this.totalFrames;r+=1)i.o.push(n[r][0]/100);var s,o="",l="",h=-1,m=[];for(r=0;r<this.totalFrames;r++)if(s={tr:{a:i.a[r],s:i.s[r],p:i.p[r],r:i.r[r]?i.r[r]:[i.r.x,i.r.y,i.r.z],o:i.o instanceof Array?i.o[r]:i.o}},o=a.getMatrix(s,t.threeD),o!=l?(m.push({forwardFrame:r,matrixValue:o,tr:{o:s.tr.o,a:s.tr.a}}),h=r):m.push({forwardFrame:r}),t.hasMask){var p={x:0,y:0};"TextLayer"==t.type&&(p.x=t.textData.xOffset,p.y=t.textData.yOffset),this.completeMasks(lastData.mk,t.masksProperties,p)}t.an=m},DataManager.prototype.completeData=function(t,e){this.totalFrames=e;var a,i,r,n,s,o,l=new MatrixManager,h=t.length;for(a=0;h>a;a++){if(i=t[a],i.layerName||(i.layerName=""),i.layerName=this.convertLayerNameToID(i.layerName),i.parent&&(i.parent=this.convertLayerNameToID(i.parent)),i.renderedFrame=-1,n=[],s=-1,i.ks)this.interpolateTransform(i,this.totalFrames);else{if(i.an)for(o=0;o<this.totalFrames;o++)if(i.an[o]){if(n.push(i.an[o]),r=i.an[o],r.matrixValue=l.getMatrix(r,i.threeD),s=o,r.forwardFrame=s,i.hasMask){var m={x:0,y:0};"TextLayer"==i.type&&(m.x=i.textData.xOffset,m.y=i.textData.yOffset),this.completeMasks(r.mk,i.masksProperties,m)}}else n.push({forwardFrame:s});i.an=n}"PreCompLayer"==i.type?this.completeData(i.layers,this.totalFrames):"ShapeLayer"==i.type&&(i.trim&&this.completeTrim(i),this.completeShapes(i.shapes)),this.completeEffects(i.eff)}},DataManager.prototype.setSize=function(t,e){this.animW=parseInt(t),this.animH=parseInt(e)},DataManager.prototype.convertLayerNameToID=function(t){return t=t.replace(/ /g,"_"),t=t.replace(/-/g,"_"),t=t.replace(/\./g,"_"),t=t.replace(/\//g,"_")};var easingFunctions={};EffectsManager.prototype.init=function(){this.effectElements=[];var t,e=this.effects.length;for(t=0;e>t;t++)switch(this.effects[t].type){case"Stroke":this.addStrokeEffect(this.effects[t])}},EffectsManager.prototype.addStrokeEffect=function(t){var e={data:{value:t},element:{value:this.element}};this.effectElements.push(createElement(StrokeEffectManager,null,e))},EffectsManager.prototype.renderFrame=function(){},defineDescriptor(EffectsManager,"data",null),defineDescriptor(EffectsManager,"element",null),defineDescriptor(EffectsManager,"maskManager",null),StrokeEffectManager.prototype.init=function(){this.element.maskManager.registerEffect(this),this.layerSize=this.element.getLayerSize(),this.svgElement=document.createElementNS(svgNS,"svg"),this.svgElement.setAttribute("width",this.layerSize.w),this.svgElement.setAttribute("height",this.layerSize.h),this.pathGroup=document.createElementNS(svgNS,"g"),this.path=document.createElementNS(svgNS,"path"),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("fill","none"),this.svgElement.appendChild(this.path),this.setStaticAttributes();var t=this.element.maskManager.getMaskelement();t.appendChild(this.pathGroup),this.pathGroup.appendChild(this.path)},StrokeEffectManager.prototype.renderMask=function(t,e){var a=e[this.data.path-1].pathString;this.path.setAttribute("d",a);var i=this.path.getTotalLength(),r=void 0===this.data.animated.Start[t].forwardFrame?this.data.animated.Start[t]:this.data.animated.Start[this.data.animated.Start[t].forwardFrame],n=void 0===this.data.animated.End[t].forwardFrame?this.data.animated.End[t]:this.data.animated.End[this.data.animated.End[t].forwardFrame],s="0 ";s+=r*i/100+" ",s+=(n-r)*i/100+" ",s+=(100-n)*i/100+" ",this.path.style["stroke-dasharray"]=s},StrokeEffectManager.prototype.setStaticAttributes=function(){var t=this.data.static;t["Brush Size"]&&this.path.setAttribute("stroke-width",2*t["Brush Size"]),t.Color&&this.path.setAttribute("stroke",t.Color)},StrokeEffectManager.prototype.renderFrame=function(){},MaskElement.prototype.init=function(){this.paths=[],this.registeredEffects=[],this.masksProperties=this.data.masksProperties,this.totalMasks=this.masksProperties.length;var t=this.element.maskingGroup,e=this.element.maskedElement,a=document.createElementNS(svgNS,"defs");t.appendChild(a);var i,r=this.data.an[0].mk,n=r.length;if(1===this.totalMasks&&(this.usePaths=!0),this.usePaths===!0){this.maskElement=document.createElementNS(svgNS,"clipPath"),this.masksArray=[];var s,o,l=this.data.masksProperties;for(i=0;n>i;i++)s=document.createElementNS(svgNS,"path"),this.masksArray.push(s),o=l[i].inv?"#000000":"#ffffff",l[i].cl?s.setAttribute("fill",o):(s.setAttribute("fill","none"),s.setAttribute("stroke",o),s.setAttribute("stroke-width","1"),s.setAttribute("stroke-miterlimit","10")),s.setAttribute("clip-rule","nonezero"),this.maskElement.appendChild(s),this.paths.push({lastPath:"",elem:s});var h=this.data.layerName+"_clip";h=randomString(10),this.maskElement.setAttribute("id",h),e.setAttribute("clip-path","url(#"+h+")")}else this.maskElement=document.createElementNS(svgNS,"mask"),this.canvas=document.createElement("canvas"),this.imageElement=document.createElementNS(svgNS,"image"),this.layerSize=this.element.getLayerSize(),this.imageElement.setAttribute("width",this.layerSize.w),this.imageElement.setAttribute("height",this.layerSize.h),this.imageElement.setAttribute("x","0"),this.imageElement.setAttribute("y","0"),this.canvasContext=this.canvas.getContext("2d"),this.canvas.width=this.layerSize.w,this.canvas.height=this.layerSize.h,this.maskElement.appendChild(this.imageElement),e.setAttribute("mask","url(#"+this.data.layerName+"_clip)");a.appendChild(this.maskElement)},MaskElement.prototype.createInvertedMask=function(t,e){this.helperCanvas.width=this.layerSize.w,this.helperCanvas.height=this.layerSize.h;var a=this.invertedContext;if(a.globalCompositeOperation="source-over","a"==t.mode)a.fillStyle="rgba(255, 255, 255, "+e.t+")",this.canvasContext.globalCompositeOperation="source-over";else if("s"==t.mode)a.fillStyle="rgba(0, 0, 0, "+e.t+")",this.canvasContext.globalCompositeOperation="source-over";else if("f"==t.mode)a.fillStyle="rgba(255, 255, 255, "+e.t+")",this.canvasContext.globalCompositeOperation="xor";else{if("i"!=t.mode)return;a.fillStyle="rgba(255, 255, 255, "+e.t+")",this.canvasContext.globalCompositeOperation="destination-in"}a.fillRect(0,0,this.helperCanvas.width,this.helperCanvas.height),a.fillStyle="rgba(255, 255, 255, 1)",a.globalCompositeOperation="destination-out",a.beginPath(),this.drawShape(a,e),this.canvasContext.drawImage(this.helperCanvas,0,0)},MaskElement.prototype.renderFrame=function(t,e){var a,i,r=e.length;if(this.usePaths===!0){if("fullSvg"!==this.element.animationItem.animType)for(a=0;r>a;a++)i=e[a],this.drawPath(this.paths[a],i)
}else{this.canvas.width=this.canvas.width;var n=this.canvasContext;for(a=0;r>a;a++)if(i=e[a],this.masksProperties[a].inv)this.createInvertedMask(this.masksProperties[a],i);else{if("a"==this.masksProperties[a].mode)n.globalCompositeOperation="source-over",n.fillStyle="rgba(255, 255, 255, "+i.t+")";else if("s"==this.masksProperties[a].mode)n.globalCompositeOperation="source-over",n.fillStyle="rgba(0, 0, 0, "+i.t+")";else if("f"==this.masksProperties[a].mode)n.globalCompositeOperation="xor",n.fillStyle="rgba(255, 255, 255, "+i.t+")";else{if("i"!=this.masksProperties[a].mode)continue;n.globalCompositeOperation="destination-in",n.fillStyle="rgba(255, 255, 255, "+i.t+")"}this.drawShape(n,i)}this.processMaskFromEffects(t,e);var s=this.canvas.toDataURL("image/png");this.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",s)}},MaskElement.prototype.processMaskFromEffects=function(t,e){var a,i=this.registeredEffects.length;for(a=0;i>a;a++)this.registeredEffects[a].renderMask(t,e)},MaskElement.prototype.registerEffect=function(t){this.registeredEffects.push(t)},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.drawPath=function(t,e){t.lastPath!==e.pathString&&(t.elem.setAttribute("d",e.pathString),t.lastPath=e.pathString)},MaskElement.prototype.drawShape=function(t,e){t.beginPath();var a,i=e.v.length;for(a=0;i>a;a++)0==a?t.moveTo(e.v[a][0],e.v[a][1]):t.bezierCurveTo(e.o[a-1][0]+e.v[a-1][0],e.o[a-1][1]+e.v[a-1][1],e.i[a][0]+e.v[a][0],e.i[a][1]+e.v[a][1],e.v[a][0],e.v[a][1]);t.bezierCurveTo(e.o[a-1][0]+e.v[a-1][0],e.o[a-1][1]+e.v[a-1][1],e.i[0][0]+e.v[0][0],e.i[0][1]+e.v[0][1],e.v[0][0],e.v[0][1]),t.closePath(),t.fill()},defineDescriptor(MaskElement,"helperCanvas",document.createElement("canvas")),defineDescriptor(MaskElement,"helperContext",MaskElement.prototype.helperCanvas.getContext("2d")),defineDescriptor(MaskElement,"data",null),defineDescriptor(MaskElement,"element",null),defineDescriptor(MaskElement,"usePaths",!0),defineDescriptor(MaskElement,"paths",[],{writable:!0});var BaseElement=function(t,e,a){this.animationItem=a,this.type=e,this.parentType=e,this.data=t,this.init()};BaseElement.prototype.init=function(){this.createElements(),this.data.hasMask&&this.addMasks(this.data),this.data.eff&&this.createEffectsManager(this.data)},BaseElement.prototype.createElements=function(){"svg"==this.type?(this.layerElement="svg"==this.parentType?document.createElementNS(svgNS,"g"):document.createElementNS(svgNS,"svg"),this.anchorElement=document.createElementNS(svgNS,"g")):(this.layerElement=document.createElement("div"),styleDiv(this.layerElement),this.anchorElement=document.createElement("div"),styleDiv(this.anchorElement)),this.anchorElement.setAttribute("id",this.data.layerName),this.layerElement.appendChild(this.anchorElement),this.maskingGroup="svg"==this.type?this.anchorElement:this.svgElem,this.maskedElement=this.svgElem},BaseElement.prototype.renderFrame=function(t){if(!(this.data.inPoint<=t&&this.data.outPoint>t))return this.isVisible!==!1&&(this.isVisible=!1,this.mainElement.setAttribute("opacity",0)),!1;this.isVisible!==!0&&(this.isVisible=!0,this.mainElement.setAttribute("opacity",1));var e=this.data.an[this.data.an[t].forwardFrame];if(null!==this.data.eff&&void 0!==this.data.eff&&this.effectsManager.renderFrame(t,e.mk),this.data.an[t].forwardFrame==this.data.renderedFrame)return!0;if(this.data.hasMask&&this.maskManager.renderFrame(t,e.mk),this.data.renderedFrame=e.forwardFrame,this.anchorElement.setAttribute("opacity",e.tr.o),this.anchorElement.setAttribute("transform","translate("+-e.tr.a[0]+" "+-e.tr.a[1]+")"),this.layerElement.setAttribute("transform",e.matrixValue),null!==this.data.relateds&&void 0!==this.data.relateds){var a,i,r,n,s=this.data.relateds,o=s.length;for(a=0;o>a;a++)i=s[a].item,r=s[a].itemCont,n=s[a].type,i.setAttribute("transform","translate("+-e.tr.a[0]+" "+-e.tr.a[1]+")"),r.setAttribute("transform",e.matrixValue)}},BaseElement.prototype.getDomElement=function(){return this.layerElement},BaseElement.prototype.setMainElement=function(t){this.mainElement=t},BaseElement.prototype.getMaskManager=function(){return this.maskManager},BaseElement.prototype.addMasks=function(t){var e={data:{value:t},element:{value:this}};this.maskManager=createElement(MaskElement,null,e)},BaseElement.prototype.createEffectsManager=function(t){var e={effects:{value:t.eff},element:{value:this}};this.effectsManager=createElement(EffectsManager,null,e)},BaseElement.prototype.getType=function(){return this.type},BaseElement.prototype.getLayerSize=function(){return"TextLayer"==this.data.type?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}},defineDescriptor(BaseElement,"svgElem",null,{writable:!0}),defineDescriptor(BaseElement,"layerElement",null,{writable:!0}),defineDescriptor(BaseElement,"mainElement",null,{writable:!0}),defineDescriptor(BaseElement,"anchorElement",null,{writable:!0}),defineDescriptor(BaseElement,"maskingGroup",null,{writable:!0}),defineDescriptor(BaseElement,"maskedElement",null,{writable:!0}),defineDescriptor(BaseElement,"maskManager",null,{writable:!0}),defineDescriptor(BaseElement,"effectsManager",null,{writable:!0}),defineDescriptor(BaseElement,"isVisible",null,{writable:!0}),defineDescriptor(BaseElement,"animationItem",null,{writable:!0}),createElement(BaseElement,ICompElement),ICompElement.prototype.createElements=function(){this.svgElem=document.createElementNS(svgNS,"g"),this.parent.createElements.call(this)},ICompElement.prototype.getComposingElement=function(){return this.anchorElement},createElement(BaseElement,IImageElement),IImageElement.prototype.createElements=function(){var t=this,e=function(){t.image.setAttributeNS("http://www.w3.org/1999/xlink","href",t.path+t.assets[t.data.assetId].path),t.maskedElement=t.image,t.animationItem.elementLoaded()},a=new Image;a.addEventListener("load",e,!1),a.src=this.path+this.assets[this.data.assetId].path,this.svgElem=document.createElementNS(svgNS,"g"),this.parent.createElements.call(this),this.image=document.createElementNS(svgNS,"image"),this.image.setAttribute("width",this.data.width+"px"),this.image.setAttribute("height",this.data.height+"px"),this.svgElem.appendChild(this.image),this.anchorElement.appendChild(this.svgElem),this.maskingGroup=this.svgElem,styleUnselectableDiv(this.image)},createElement(BaseElement,IShapeElement),IShapeElement.prototype.createElements=function(){this.svgElem=document.createElementNS(svgNS,"g"),styleUnselectableDiv(this.svgElem),this.parent.createElements.call(this),this.anchorElement.appendChild(this.svgElem);var t,e,a=this.data.shapes.length;for(t=a-1;t>=0;t--)this.data.trim&&(this.data.shapes[t].trim=this.data.trim),e=new ShapeItemElement(this.data.shapes[t]),this.svgElem.appendChild(e.getElement()),this.shapes.push(e)},IShapeElement.prototype.renderFrame=function(t){this.parent.renderFrame.call(this,t)!==!1&&this.renderShapes(t)},IShapeElement.prototype.renderShapes=function(t){var e,a,i,r=this.data.shapes.length;for(e=r-1;e>=0;e--)a=this.data.shapes[e],i=this.shapes[r-1-e],i.renderShape(t)},ShapeItemElement.prototype.adjustTrim=function(){var t,e=this.data.trim,a=e.length;for(t=0;a>t;t+=1)e[t].o&&(e[t].o-=90)},ShapeItemElement.prototype.getElement=function(){return this.shapeG},ShapeItemElement.prototype.renderShape=function(t){"pathShape"==this.data.type?this.pathLength=this.renderPath(t):"rectShape"==this.data.type?this.renderRect(t):"ellipseShape"==this.data.type&&(this.pathLength=this.renderEllipse(t)),this.data.trim&&this.renderTrim(t),this.renderFill(t),this.renderStroke(t),this.renderTransform(t)},ShapeItemElement.prototype.renderPath=function(t){var e=this.data.an;{if(e.path[t].forwardFrame!=e.renderedFrame.path){var a=e.path[e.path[t].forwardFrame];return e.renderedFrame.path=a.forwardFrame,this.shape.setAttribute("d",a.pathString),this.data.trim?(null==this.cachedData.pathLengths&&(this.cachedData.pathLengths={}),null==this.cachedData.pathLengths[a.pathString]&&(this.cachedData.pathLengths[a.pathString]=this.shape.getTotalLength()),this.cachedData.pathLengths[a.pathString]):void 0}if(this.data.trim)return this.cachedData.pathLengths[e.path[e.path[t].forwardFrame].pathString]}},ShapeItemElement.prototype.renderEllipse=function(t){var e=this.data.an;if(e.ell[t].forwardFrame==e.renderedFrame.ell)return this.data.trim?this.cachedData.pathLengths["ellipse_"+e.ell[t].forwardFrame]:0;var a=e.ell[e.ell[t].forwardFrame];if(e.renderedFrame.ell=a.forwardFrame,this.shape.setAttribute("rx",a.size[0]/2),this.shape.setAttribute("ry",a.size[1]/2),this.shape.setAttribute("cx",a.p[0]),this.shape.setAttribute("cy",a.p[1]),this.data.trim){if(null==this.cachedData.pathLengths&&(this.cachedData.pathLengths={}),null==this.cachedData.pathLengths["ellipse_"+t])if(a.size[0]==a.size[1])this.cachedData.pathLengths["ellipse_"+t]=Math.PI*a.size[0];else{var i=Math.max(a.size[0],a.size[1])/2,r=Math.max(a.size[0],a.size[1])/2,n=(i-r)/(i+r),s=(i+r)*Math.PI*(1+.25*n+1/64*Math.pow(n,2)+1/256*Math.pow(n,3));this.cachedData.pathLengths["ellipse_"+t]=s}return this.cachedData.pathLengths["ellipse_"+t]}},ShapeItemElement.prototype.renderRect=function(t){var e=this.data.an;if(e.rect[t].forwardFrame!=e.renderedFrame.rect){var a=e.rect[e.rect[t].forwardFrame];e.renderedFrame.rect=a.forwardFrame,this.shape.setAttribute("width",a.size[0]),this.shape.setAttribute("height",a.size[1]),this.shape.setAttribute("rx",a.roundness),this.shape.setAttribute("ry",a.roundness)}},ShapeItemElement.prototype.renderFill=function(t){var e=this.data.an;if(e.fill){if(e.fill[t].forwardFrame==e.renderedFrame.fill)return;var a=e.fill[e.fill[t].forwardFrame];e.renderedFrame.fill=a.forwardFrame,this.shape.setAttribute("fill",a.color),this.data.fillEnabled!==!1?this.shape.setAttribute("fill-opacity",a.opacity/100):this.shape.setAttribute("fill-opacity",0)}else this.shape.setAttribute("fill-opacity",0)},ShapeItemElement.prototype.renderStroke=function(t){var e=this.data.an;if(e.stroke){if(e.stroke[t].forwardFrame==e.renderedFrame.stroke)return;var a=e.stroke[e.stroke[t].forwardFrame];e.renderedFrame.stroke=a.forwardFrame,this.shape.setAttribute("stroke",a.color),this.shape.setAttribute("stroke-width",a.width),this.data.strokeEnabled!==!1?this.shape.setAttribute("stroke-opacity",a.opacity/100):this.shape.setAttribute("stroke-opacity",0)}},ShapeItemElement.prototype.renderTransform=function(t){var e=this.data.an;if(e.tr){if(e.tr[t].forwardFrame==e.renderedFrame.tr)return;var a=e.tr[e.tr[t].forwardFrame];e.renderedFrame.tr=a.forwardFrame;var i=a.mt;this.shapeG.setAttribute("transform",i),this.shape.setAttribute("transform","translate("+-a.a[0]+", "+-a.a[1]+")")}},ShapeItemElement.prototype.renderTrim=function(t){if(this.data.trim[t].forwardFrame!=this.data.renderedData.trim){var e=this.data.trim[this.data.trim[t].forwardFrame];if(this.data.renderedData.trim=e.forwardFrame,0==this.pathLength)this.shape.setAttribute("stroke-opacity",0);else{var a=this.pathLength*(e.e-e.s)/100,i=this.pathLength-a,r=this.pathLength*e.s/100+this.pathLength*e.o/360,n=a+" , "+i;if(this.shape.setAttribute("stroke-dasharray",n),this.shape.setAttribute("stroke-dashoffset",-r),e.e==e.s)this.shape.setAttribute("stroke-opacity",0);else if(this.data.an.stroke){var s=this.data.an.stroke[this.data.an.stroke[t].forwardFrame];this.data.strokeEnabled!==!1?this.shape.setAttribute("stroke-opacity",s.opacity/100):this.shape.setAttribute("stroke-opacity",0)}}}},createElement(BaseElement,ISolidElement),ISolidElement.prototype.createElements=function(){this.svgElem=document.createElementNS(svgNS,"g"),this.parent.createElements.call(this),this.anchorElement.appendChild(this.svgElem);var t=document.createElementNS(svgNS,"rect");t.setAttribute("width",this.data.width),t.setAttribute("height",this.data.height),t.setAttribute("fill",this.data.color),this.svgElem.appendChild(t),styleUnselectableDiv(this.svgElem),styleUnselectableDiv(t),this.maskingGroup=this.svgElem,this.maskedElement=t},createElement(BaseElement,ITextElement),ITextElement.prototype.createElements=function(){this.svgElem=document.createElementNS(svgNS,"g");var t=document.createElementNS(svgNS,"text");t.textContent=this.data.textData.text,t.setAttribute("fill",this.data.textData.fillColor),t.setAttribute("x","0"),t.setAttribute("y",this.data.textData.height-(this.data.textData.fontSize-this.data.textData.height)/2),this.svgElem.setAttribute("width",this.data.textData.width),this.svgElem.setAttribute("height",this.data.textData.height),this.svgElem.style.transform="translate("+this.data.textData.xOffset+"px,"+this.data.textData.yOffset+"px)",this.svgElem.style["-webkit-transform"]="translate("+this.data.textData.xOffset+"px,"+this.data.textData.yOffset+"px)",t.setAttribute("font-size",this.data.textData.fontSize),t.setAttribute("font-family","Arial, sans-serif"),this.svgElem.appendChild(t),this.parent.createElements.call(this),this.anchorElement.appendChild(this.svgElem),this.maskingGroup=this.svgElem,this.maskedElement=t};var AnimationManager=function(){};AnimationManager.prototype.registerAnimation=function(t){var e=createElement(AnimationItem);return e.setData(t),this.registeredAnimations.push(e),e},AnimationManager.prototype.setSpeed=function(t,e){if(void 0===e){var a,i=this.registeredAnimations.length;for(a=0;i>a;a+=1)this.registeredAnimations[a].setSpeed(t)}},AnimationManager.prototype.setDirection=function(t,e){if(void 0===e){var a,i=this.registeredAnimations.length;for(a=0;i>a;a+=1)this.registeredAnimations[a].setDirection(t)}},AnimationManager.prototype.play=function(t){this.initTime=Date.now();var e,a=this.registeredAnimations.length;for(e=0;a>e;e+=1)this.registeredAnimations[e].play(t);this.resume()},AnimationManager.prototype.moveFrame=function(t,e){this.isPaused=!1,this.initTime=Date.now();var a,i=this.registeredAnimations.length;for(a=0;i>a;a+=1)this.registeredAnimations[a].moveFrame(t,e)},AnimationManager.prototype.resume=function(){this.nowTime=Date.now(),this.elapsedTime=this.nowTime-this.initTime;var t,e=this.registeredAnimations.length;for(t=0;e>t;t+=1)this.registeredAnimations[t].advanceTime(this.elapsedTime);requestAnimationFrame(this.resume.bind(this)),this.initTime=this.nowTime},AnimationManager.prototype.pause=function(t){var e,a=this.registeredAnimations.length;for(e=0;a>e;e+=1)this.registeredAnimations[e].pause(t)},AnimationManager.prototype.stop=function(t){var e,a=this.registeredAnimations.length;for(e=0;a>e;e+=1)this.registeredAnimations[e].stop(t)},AnimationManager.prototype.togglePause=function(t){var e,a=this.registeredAnimations.length;for(e=0;a>e;e+=1)this.registeredAnimations[e].togglePause(t)},AnimationManager.prototype.searchAnimations=function(){var t,e=document.getElementsByClassName("bodymoving"),a=e.length;for(t=0;a>t;t+=1)this.registerAnimation(e[t]);this.resume()},defineDescriptor(AnimationManager,"registeredAnimations",[],{writable:!0}),defineDescriptor(AnimationManager,"initTime",0,{writable:!0}),defineDescriptor(AnimationManager,"nowTime",0,{writable:!0}),defineDescriptor(AnimationManager,"elapsedTime",0,{writable:!0});var animationManager=createElement(AnimationManager),AnimationItem=function(){};AnimationItem.prototype.setData=function(t){this.wrapper=t,this.wrapper.style.position="relative";var e=this;this.path=this.wrapper.attributes.getNamedItem("data-animation-path").value,this.playerType=this.wrapper.attributes.getNamedItem("data-bm-player").value,this.animType=this.wrapper.attributes.getNamedItem("data-anim-type")?this.wrapper.attributes.getNamedItem("data-anim-type").value:"div",this.containerType="svg",this.repeat=this.wrapper.attributes.getNamedItem("data-anim-repeat")?this.wrapper.attributes.getNamedItem("data-anim-repeat").value:this.repeat,this.loop=this.wrapper.attributes.getNamedItem("data-anim-loop")?"false"!==this.wrapper.attributes.getNamedItem("data-anim-loop").value:this.loop,this.name=this.wrapper.attributes.getNamedItem("id")?this.wrapper.attributes.getNamedItem("id").value:"","/"!=this.path.substr(-1,1)&&(this.path+="/");var a=new XMLHttpRequest;a.open("GET",this.path+"data.json",!0),a.send(),a.onreadystatechange=function(){4==a.readyState&&e.configAnimation(JSON.parse(a.responseText))}},AnimationItem.prototype.configAnimation=function(t){this.container=document.createElementNS(svgNS,"svg"),this.container.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.container.setAttribute("width",t.animation.compWidth),this.container.setAttribute("height",t.animation.compHeight),this.container.setAttribute("viewBox","0 0 "+t.animation.compWidth+" "+t.animation.compHeight),this.container.setAttribute("preserveAspectRatio","xMidYMid meet"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.opactiy=".5";var e=this.wrapper.getAttribute("width")/this.wrapper.getAttribute("height"),a=t.animation.compWidth/t.animation.compHeight,i=1;i=a>e?this.wrapper.clientWidth/t.animation.compWidth:this.wrapper.clientHeight/t.animation.compHeight;(this.wrapper.clientWidth-i*t.animation.compWidth)/2/i,(this.wrapper.clientHeight-i*t.animation.compHeight)/2/i;this.container.style.transformOrigin=this.container.style.mozTransformOrigin=this.container.style.webkitTransformOrigin=this.container.style["-webkit-transform"]="0px 0px 0px",this.container.style.overflow="hidden",styleDiv(this.container),this.wrapper.appendChild(this.container),this.effectsManager=new EffectsManager,this.animationData=t,this.layers=this.animationData.animation.layers,this.assets=this.animationData.assets,this.totalFrames=this.animationData.animation.totalFrames,this.frameRate=this.animationData.animation.frameRate,this.frameMult=this.animationData.animation.frameRate/1e3;var r=new DataManager;r.setSize(t.animation.compWidth,t.animation.compHeight),r.completeData(this.layers,this.totalFrames),this.buildItems(this.animationData.animation.layers,this.containerType),this.checkLoaded()},AnimationItem.prototype.buildItems=function(t,e){var a,i=0,r=t.length;for(a=0;r>a;a++)"StillLayer"==t[a].type?(i++,this.createImage(t[a],e)):"PreCompLayer"==t[a].type?this.createComp(t[a],e):"SolidLayer"==t[a].type?this.createSolid(t[a],e):"ShapeLayer"==t[a].type?this.createShape(t[a],e):"TextLayer"==t[a].type&&this.createText(t[a],e);this.pendingElements+=i},AnimationItem.prototype.createShape=function(t,e){t.element=new IShapeElement(t,e,this)},AnimationItem.prototype.createText=function(t,e){t.element=new ITextElement(t,e,this)},AnimationItem.prototype.createImage=function(t,e){t.element=new IImageElement(t,e,this)},AnimationItem.prototype.createComp=function(t,e){t.element=new ICompElement(t,e,this),this.buildItems(t.layers,t.element.getType())},AnimationItem.prototype.createSolid=function(t,e){t.element=new ISolidElement(t,e,this)},AnimationItem.prototype.elementLoaded=function(){this.pendingElements--,this.checkLoaded()},AnimationItem.prototype.checkLoaded=function(){0==this.pendingElements&&(this.isLoaded=!0,this.buildStage(this.container,this.layers,this.containerType),this.buildControls(),this.gotoFrame(),this.dispatchEvent("bmLoaded"))},AnimationItem.prototype.buildStage=function(t,e,a){var i,r,n=e.length;for(i=n-1;i>=0;i--){if(r=e[i],r.parent){var s=this.buildItemHierarchy(r.element.getDomElement(),r.layerName,r.parent,e,t,a);s.setAttribute("data-layer-name",r.layerName),t.appendChild(s),r.element.setMainElement(s)}else r.element.getDomElement().setAttribute("data-layer-name",r.layerName),t.appendChild(r.element.getDomElement()),r.element.setMainElement(r.element.getDomElement());"PreCompLayer"==r.type&&this.buildStage(r.element.getComposingElement(),r.layers,r.element.getType())}},AnimationItem.prototype.buildItemHierarchy=function(t,e,a,i,r,n){for(var s=0,o=i.length;o>s;){if(i[s].layerName==a){i[s].relateds||(i[s].relateds=[]);var l,h;return"svg"==n?(l=document.createElementNS(svgNS,"g"),h=document.createElementNS(svgNS,"g")):(l=document.createElement("div"),styleDiv(l),h=document.createElement("div"),styleDiv(h)),i[s].relateds.push({item:l,itemCont:h,type:n}),l.appendChild(t),h.appendChild(l),void 0!=i[s].parent?this.buildItemHierarchy(h,e,i[s].parent,i,r,n):h}s+=1}},AnimationItem.prototype.buildControls=function(){"0"!==this.playerType&&(this.player=playerManager.createPlayer(this.playerType),this.player.buildControls(this,this.wrapper))},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=Math.floor(this.currentRawFrame),this.renderFrame(this.layers),null!==this.player&&void 0!==this.player&&this.player.setProgress(this.currentFrame/this.totalFrames)},AnimationItem.prototype.renderFrame=function(t){if(this.isLoaded!==!1){var e,a,i=t.length;for(e=0;i>e;e++)a=t[e],a.element&&(a.element.renderFrame(this.currentFrame),"PreCompLayer"==a.type&&this.renderFrame(a.layers))}},AnimationItem.prototype.dispatchEvent=function(t){var e;document.createEvent?(e=document.createEvent("CustomEvent"),e.initCustomEvent(t,!1,!1,{})):e=new CustomEvent("bmPlay"),this.wrapper.dispatchEvent(e)},AnimationItem.prototype.play=function(t){t&&this.name!=t||this.isPaused===!0&&(this.isPaused=!1,"svg"===this.containerType&&this.container&&this.container.unpauseAnimations(),this.dispatchEvent("bmPlay"))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||this.isPaused===!1&&(this.isPaused=!0,"svg"===this.containerType&&this.container.pauseAnimations(),this.dispatchEvent("bmPause"))},AnimationItem.prototype.toglePause=function(t){t&&this.name!=t||(this.isPaused===!1?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.isPaused=!0,this.currentFrame=this.currentRawFrame=0,this.dispatchEvent("bmStop"))},AnimationItem.prototype.goToAndStop=function(t){this.isPaused=!0,this.currentFrame=this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.advanceTime=function(t){this.isPaused!==!0&&this.isScrolling!==!0&&this.isLoaded!==!1&&this.setCurrentRawFrameValue(this.currentRawFrame+t*this.frameMult*this.playSpeed*this.playDirection)},AnimationItem.prototype.updateAnimation=function(t){this.setCurrentRawFrameValue(this.totalFrames*t)},AnimationItem.prototype.moveFrame=function(t,e){e&&this.name!=e||this.setCurrentRawFrameValue(this.currentRawFrame+t)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.currentRawFrame>=this.totalFrames?(this.currentRawFrame=this.currentRawFrame%this.totalFrames,this.loop===!1&&this.goToAndStop(this.totalFrames-1)):this.currentRawFrame<0&&(this.currentRawFrame=this.totalFrames+this.currentRawFrame),this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t},AnimationItem.prototype.setDirection=function(t){this.playDirection=t},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssets=function(){return this.assets},defineDescriptor(AnimationItem,"name","",{writable:!0}),defineDescriptor(AnimationItem,"path","",{writable:!0}),defineDescriptor(AnimationItem,"isLoaded",!1,{writable:!0}),defineDescriptor(AnimationItem,"currentFrame",0,{writable:!0}),defineDescriptor(AnimationItem,"currentRawFrame",0,{writable:!0}),defineDescriptor(AnimationItem,"totalFrames",0,{writable:!0}),defineDescriptor(AnimationItem,"frameRate",0,{writable:!0}),defineDescriptor(AnimationItem,"frameMult",0,{writable:!0}),defineDescriptor(AnimationItem,"playSpeed",1,{writable:!0}),defineDescriptor(AnimationItem,"playDirection",1,{writable:!0}),defineDescriptor(AnimationItem,"pendingElements",0,{writable:!0}),defineDescriptor(AnimationItem,"repeat","indefinite",{writable:!0}),defineDescriptor(AnimationItem,"animationData",{},{writable:!0}),defineDescriptor(AnimationItem,"layers",null,{writable:!0}),defineDescriptor(AnimationItem,"assets",null,{writable:!0}),defineDescriptor(AnimationItem,"effectsManager",null,{writable:!0}),defineDescriptor(AnimationItem,"isPaused",!0,{writable:!0}),defineDescriptor(AnimationItem,"isScrolling",!1,{writable:!0}),defineDescriptor(AnimationItem,"loop",!0,{writable:!0}),PlayerManager.prototype.createPlayer=function(t){switch(t){case"1":return createElement(BasicPlayer)}};var playerManager=createElement(PlayerManager);BasicPlayer.prototype.setAnimationItem=function(){},BasicPlayer.prototype.playStarted=function(){this.playButton.style.display="none",this.pauseButton.style.display="block",this.pauseAnimation.goToAndStop(0),this.pauseAnimation.play()},BasicPlayer.prototype.pauseStarted=function(){this.playButton.style.display="block",this.pauseButton.style.display="none",this.playAnimation.goToAndStop(0),this.playAnimation.play()},BasicPlayer.prototype.buildControls=function(t,e){var a=this;this.animationItem=t,e.addEventListener("bmPlay",function(){a.playStarted()}),e.addEventListener("bmPause",function(){a.pauseStarted()}),this.controls=document.createElement("div"),this.controls.style.width="100%",this.controls.style.height="70px",this.controls.style.position="absolute",this.controls.style.left=0,this.controls.style.bottom=0,this.controls.style.backgroundColor="rgba(0,0,0,.3)",e.appendChild(this.controls),styleUnselectableDiv(this.controls),this.scrollBar=document.createElement("div"),this.scrollBar.style.width="100%",this.scrollBar.style.height="14px",this.scrollBar.style.backgroundColor="rgba(25,25,25,1)",styleUnselectableDiv(this.scrollBar),this.controls.appendChild(this.scrollBar),this.scrollBarThumb=document.createElement("div"),this.scrollBarThumb.style.width="18px",this.scrollBarThumb.style.height="18px",this.scrollBarThumb.style.position="absolute",this.scrollBarThumb.style.transform=this.scrollBarThumb.style.webkitTransform="translate(-7px,0px)",this.scrollBarThumb.style.top="-3px",this.scrollBarThumb.style.left="0px",this.scrollBarThumb.style.borderRadius="11px",this.scrollBarThumb.style.border="solid 2px #000000",this.scrollBarThumb.style.backgroundColor="rgba(255,255,255,1)",this.scrollBarThumb.style.cursor="pointer",this.controls.appendChild(this.scrollBarThumb),styleUnselectableDiv(this.scrollBarThumb),this.scrollBar.addEventListener("mousedown",function(t){var e=t.layerX,i=a.scrollBar.clientWidth;a.scrollAnimation(e/i)}),this.scrollBarThumb.addEventListener("mousedown",function(){a.scrollAnimation()}),this.playButton=document.createElement("div"),this.playButton.style.width="40px",this.playButton.style.height="30px",this.playButton.style.marginTop="12px",this.playButton.style.marginLeft="10px",this.playButton.style.backgroundColor="rgba(25,25,25,1)",this.playButton.style.cursor="pointer",this.playButton.setAttribute("data-animation-path","exports/pause"),this.playButton.setAttribute("data-bm-player","0"),this.playButton.setAttribute("data-anim-type","svg"),this.playButton.setAttribute("data-anim-name","play"),this.playButton.setAttribute("data-anim-repeat","0"),this.playButton.style.display="none",this.playAnimation=animationManager.registerAnimation(this.playButton),this.playAnimation.loop=!1,this.controls.appendChild(this.playButton),styleUnselectableDiv(this.playButton),this.playButton.addEventListener("click",function(){a.animationItem.play()}),this.pauseButton=document.createElement("div"),this.pauseButton.style.width="40px",this.pauseButton.style.height="30px",this.pauseButton.style.marginTop="12px",this.pauseButton.style.marginLeft="10px",this.pauseButton.style.backgroundColor="rgba(25,25,25,1)",this.pauseButton.style.cursor="pointer",this.pauseButton.setAttribute("data-animation-path","exports/play"),this.pauseButton.setAttribute("data-bm-player","0"),this.pauseButton.setAttribute("data-anim-type","svg"),this.pauseButton.setAttribute("data-anim-name","pause"),this.pauseButton.setAttribute("data-anim-repeat","0"),this.pauseAnimation=animationManager.registerAnimation(this.pauseButton),this.pauseAnimation.wrapper.addEventListener("bmLoaded",function(){a.pauseAnimation.goToAndStop(a.pauseAnimation.totalFrames-1)}),this.pauseAnimation.loop=!1,this.controls.appendChild(this.pauseButton),styleUnselectableDiv(this.pauseButton),this.pauseButton.addEventListener("click",function(){a.animationItem.pause()})},BasicPlayer.prototype.setProgress=function(t){this.progress=t,this.scrollBarThumb.style.left=100*this.progress+"%"},BasicPlayer.prototype.scrollAnimation=function(t){this.animationItem.isScrolling=!0,this.boundingRect=this.scrollBar.getBoundingClientRect(),this.scrollBarWidth=this.scrollBar.clientWidth;var e=this,a=function(t){var a=t.pageX-e.boundingRect.left;0>a?a=0:a>=e.scrollBarWidth&&(a=e.scrollBarWidth-1),e.animationItem.updateAnimation(a/e.scrollBarWidth)},i=function(){window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",i),e.animationItem.isScrolling=!1};window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),void 0!==t&&e.animationItem.updateAnimation(t)},function(t){function e(t){animationManager.play(t)}function a(t){animationManager.pause(t)}function i(t){animationManager.togglePause(t)}function r(t,e){animationManager.setSpeed(t/10,e)}function n(t,e){animationManager.setDirection(t,e)}function s(t){animationManager.stop(t)}function o(t){animationManager.moveFrame(t)}function l(){animationManager.searchAnimations()}function h(t){var e=t.keyCode?t.keyCode:t.which;88==e||90==e?88==e?m.moveFrame(1):90==e&&m.moveFrame(-1):32==e?m.togglePause():e>48&&58>e?m.setSpeed(e-48):39==e?m.setDirection(1):37==e&&m.setDirection(-1)}var m={};m.play=e,m.pause=a,m.togglePause=i,m.setSpeed=r,m.setDirection=n,m.stop=s,m.moveFrame=o,m.searchAnimations=l,t.bodymovinjs=m,t.onkeydown=h;var p=setInterval(function(){"complete"===document.readyState&&(clearInterval(p),l(),e())},100);!function(){function e(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var a=document.createEvent("CustomEvent");return a.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),a}e.prototype=t.Event.prototype,t.CustomEvent=e}()}(window);}(window));