@aarsteinmedia/dotlottie-player 6.3.12 → 6.4.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/CHANGELOG.md +15 -1
- package/README.md +24 -23
- package/custom-elements.json +3 -3
- package/dist/canvas.d.ts +2 -2
- package/dist/canvas.js +2 -2
- package/dist/chunks/{DotLottiePlayerBase-ClCZP878.js → DotLottiePlayerBase-DZEPP1-j.js} +34 -8
- package/dist/chunks/{DotLottiePlayerBase.d-DaXI0b6M.d.ts → DotLottiePlayerBase.d-avku0LBw.d.ts} +4 -0
- package/dist/full.d.ts +2 -2
- package/dist/full.js +2 -2
- package/dist/light.d.ts +2 -2
- package/dist/light.js +2 -2
- package/dist/svg.d.ts +2 -2
- package/dist/svg.js +2 -2
- package/dist/unpkg-canvas.js +3 -3
- package/dist/unpkg-full.js +2 -2
- package/dist/unpkg-light.js +5 -5
- package/dist/unpkg-svg.js +2 -2
- package/package.json +4 -2
package/dist/unpkg-svg.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t){"use strict";let e,s,i,r,a,n,o,h,l,p,m,c,d,u,f={current:""},g=(t,e)=>1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e)),y=t=>1e-5>=Math.abs(t),b=(t,e)=>g(t[0],e[0])&&g(t[1],e[1]),v=(i=0,()=>(i++,`${f.current}__lottie_element_${i}`)),_=(t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)},x=(t,e)=>{let s=new Blob([t],{type:e?.mimeType??""}),i=e?.name||v(),r=URL.createObjectURL(s),a=document.createElement("a");a.href=r,a.download=i,a.hidden=!0,document.body.appendChild(a),a.click(),setTimeout(()=>{a.remove(),URL.revokeObjectURL(r)},1e3)},w=t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()},E=t=>{let e=t.split(":")[1]?.split(";")[0];return e?.split("/")[1]?.split("+")[0]},C=(t,e)=>(w(t),`${t.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`),S=(t,e)=>{if(e)return w(e)?w(e)===t?e:`${C(e)}.${t}`:`${e}.${t}`},k=t=>Symbol.iterator in Object(t)&&t.length>0,M=t=>k(t)&&"number"==typeof t[0],P=t=>!("h"in t)&&!("w"in t)&&"p"in t&&"e"in t&&"u"in t&&"id"in t,A=t=>"w"in t&&"h"in t&&!("xt"in t)&&"p"in t,D=t=>!(!t||k(t))&&"_type"in t&&"ShapePath"===t._type,T=t=>t.slice(Math.max(0,t.indexOf(",")+1)),F=t=>{t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.display="block",t.style.transformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.transformStyle="preserve-3d"},I=t=>{if(!t)return"rgb(0,0,0)";let e=(t[0]??0)|0,s=(t[1]??0)|0,i=(t[2]??0)|0;return`rgb(${e},${s},${i})`},$=Math.PI/180,L="http://www.w3.org/1999/xlink",N="http://www.w3.org/2000/svg",B=!("u">typeof window&&document),V="u">typeof navigator,R=!!V&&/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent);var O,z,G,q,j,H,W,Y,U,J,X,Z,K=((O={}).Float32="float32",O.Int16="int16",O.Int32="int32",O.Uint8="uint8",O.Uint8c="uint8c",O),Q=((z={}).MouseModifier="ms",z.OffsetPathModifier="op",z.PuckerAndBloatModifier="pb",z.RepeaterModifier="rp",z.RoundCornersModifier="rd",z.TrimModifier="tm",z.ZigZagModifier="zz",z),tt=((G={}).Bounce="bounce",G.Normal="normal",G),te=((q={}).Active="_active",q.Complete="complete",q.ConfigError="configError",q.ConfigReady="config_ready",q.DataFailed="data_failed",q.DataReady="data_ready",q.Destroy="destroy",q.Destroyed="destroyed",q.DOMLoaded="DOMLoaded",q.DrawnFrame="drawnFrame",q.EnterFrame="enterFrame",q.Error="error",q.Frame="frame",q.Freeze="freeze",q.Idle="_idle",q.Load="load",q.LoadedImages="loaded_images",q.Loop="loop",q.LoopComplete="loopComplete",q.MouseEnter="mouseenter",q.MouseLeave="mouseleave",q.Next="next",q.Pause="_pause",q.Play="_play",q.Previous="previous",q.Ready="ready",q.Rendered="rendered",q.RenderFrameError="renderFrameError",q.SegmentStart="segmentStart",q.Stop="stop",q),ts=((j={}).Contain="xMidYMid meet",j.Cover="xMidYMid slice",j.Initial="none",j.None="xMinYMin slice",j),ti=((H={}).Canvas="canvas",H.HTML="html",H.SVG="svg",H),tr=((W={}).Ellipse="el",W.Fill="fl",W.GradientFill="gf",W.GradientStroke="gs",W.Group="gr",W.Merge="mm",W.NoStyle="no",W.OffsetPath="op",W.Path="sh",W.PolygonStar="sr",W.PuckerBloat="pb",W.Rectangle="rc",W.Repeater="rp",W.RoundedCorners="rd",W.Stroke="st",W.Transform="tr",W.Trim="tm",W.Twist="tw",W.Unknown="ms",W.ZigZag="zz",W),ta=((Y={}).TransformEffect="transformEffect",Y),tn=((U={}).MultiDimensional="multidimensiional",U.Shape="shape",U.TextSelector="textSelector",U.Transform="transform",U.UniDimensional="unidimensional",U);let to={1:"butt",2:"round",3:"square"},th={1:"miter",2:"round",3:"bevel"},tl=(()=>{function t(t,e){let s,i=[];switch(t){case K.Int16:case K.Uint8c:s=1;break;case K.Float32:case K.Int32:case K.Uint8:default:s=1.1}for(let t=0;t<e;t++)i.push(s);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(e,s){return e===K.Float32?new Float32Array(s):e===K.Int16?new Int16Array(s):e===K.Uint8c?new Uint8ClampedArray(s):t(e,s)}:t})();function tp(t){return Array.from({length:t})}class tm{constructor(){this.props=tl(K.Float32,16),this._identity=!0,this._identityCalculated=!1,this.reset()}applyToPoint(t,e,s){return{x:t*(this.props[0]??0)+e*(this.props[4]??0)+s*(this.props[8]??0)+(this.props[12]??0),y:t*(this.props[1]??0)+e*(this.props[5]??0)+s*(this.props[9]??0)+(this.props[13]??0),z:t*(this.props[2]??0)+e*(this.props[6]??0)+s*(this.props[10]??0)+(this.props[14]??0)}}applyToPointArray(t,e,s){return this.isIdentity()?[t,e,s]:[t*(this.props[0]??0)+e*(this.props[4]??0)+s*(this.props[8]??0)+(this.props[12]??0),t*(this.props[1]??0)+e*(this.props[5]??0)+s*(this.props[9]??0)+(this.props[13]??0),t*(this.props[2]??0)+e*(this.props[6]??0)+s*(this.props[10]??0)+(this.props[14]??0)]}applyToPointStringified(t,e){if(this.isIdentity())return`${t},${e}`;let s=this.props;return`${Math.round((t*(s[0]??0)+e*(s[4]??0)+(s[12]??0))*100)/100},${Math.round((t*(s[1]??0)+e*(s[5]??0)+(s[13]??0))*100)/100}`}applyToTriplePoints(t,e,s){let i=tl(K.Float32,6);if(this.isIdentity())i.set([t[0]??0,t[1]??0,e[0]??0,e[1]??0,s[0]??0,s[1]??0]);else{let r=this.props[0]??0,a=this.props[1]??0,n=this.props[4]??0,o=this.props[5]??0,h=this.props[12]??0,l=this.props[13]??0;i.set([(t[0]??0)*r+(t[1]??0)*n+h,(t[0]??0)*a+(t[1]??0)*o+l,(e[0]??0)*r+(e[1]??0)*n+h,(e[0]??0)*a+(e[1]??0)*o+l,(s[0]??0)*r+(s[1]??0)*n+h,(s[0]??0)*a+(s[1]??0)*o+l])}return i}applyToX(t,e,s){return t*(this.props[0]??0)+e*(this.props[4]??0)+s*(this.props[8]??0)+(this.props[12]??0)}applyToY(t,e,s){return t*(this.props[1]??0)+e*(this.props[5]??0)+s*(this.props[9]??0)+(this.props[13]??0)}applyToZ(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}clone(t){return t.props.set(this.props),t}cloneFromProps(t){return this.props.set(t),this}equals(t){return this.props.every((e,s)=>e===t?.props[s])}getInverseMatrix(){let t=(this.props[0]??0)*(this.props[5]??0)-(this.props[1]??0)*(this.props[4]??0),e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,r=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new tm;return o.setTransform(e,s,0,0,i,r,0,0,0,0,1,0,a,n,0,1),o}inversePoint(t){return this.getInverseMatrix().applyToPoint(t[0]??0,t[1]??0,t[2]??0)}inversePoints(t){return t.map(t=>this.inversePoint(t))}isIdentity(){return this._identityCalculated||(this._identity=1===this.props[0]&&0===this.props[1]&&0===this.props[2]&&0===this.props[3]&&0===this.props[4]&&1===this.props[5]&&0===this.props[6]&&0===this.props[7]&&0===this.props[8]&&0===this.props[9]&&1===this.props[10]&&0===this.props[11]&&0===this.props[12]&&0===this.props[13]&&0===this.props[14]&&1===this.props[15],this._identityCalculated=!0),this._identity}multiply(t){return this.transform(...t.props)}reset(){return this.props.set([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this}rotate(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}rotateX(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}rotateY(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}rotateZ(t){return this.rotate(t)}scale(t,e,s=1){return 1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}setTransform(t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f){return this.props.set([t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f]),this}shear(t,e){return this._t(1,e,t,1,0,0)}skew(t,e){return this.shear(Math.tan(t),Math.tan(e))}skewFromAxis(t,e){let s=Math.cos(e),i=Math.sin(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}to2dCSS(){let t=this.roundMatrixProperty(this.props[0]??0),e=this.roundMatrixProperty(this.props[1]??0),s=this.roundMatrixProperty(this.props[4]??0),i=this.roundMatrixProperty(this.props[5]??0),r=this.roundMatrixProperty(this.props[12]??0),a=this.roundMatrixProperty(this.props[13]??0);return`matrix(${t},${e},${s},${i},${r},${a})`}toCSS(){let t="matrix3d(";for(let e=0;e<16;e++)t+=`${Math.round((this.props[e]??0)*1e4)/1e4}`+(15===e?")":",");return t}transform(t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f){let g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===r&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return g[12]=(g[12]??0)*t+(g[15]??0)*c,g[13]=(g[13]??0)*a+(g[15]??0)*d,g[14]=(g[14]??0)*p+(g[15]??0)*u,g[15]*=f,this._identityCalculated=!1,this;let y=g[0]??0,b=g[1]??0,v=g[2]??0,_=g[3]??0,x=g[4]??0,w=g[5]??0,E=g[6]??0,C=g[7]??0,S=g[8]??0,k=g[9]??0,M=g[10]??0,P=g[11]??0,A=g[12]??0,D=g[13]??0,T=g[14]??0,F=g[15]??0;return g[0]=y*t+b*r+v*h+_*c,g[1]=y*e+b*a+v*l+_*d,g[2]=y*s+b*n+v*p+_*u,g[3]=y*i+b*o+v*m+_*f,g[4]=x*t+w*r+E*h+C*c,g[5]=x*e+w*a+E*l+C*d,g[6]=x*s+w*n+E*p+C*u,g[7]=x*i+w*o+E*m+C*f,g[8]=S*t+k*r+M*h+P*c,g[9]=S*e+k*a+M*l+P*d,g[10]=S*s+k*n+M*p+P*u,g[11]=S*i+k*o+M*m+P*f,g[12]=A*t+D*r+T*h+F*c,g[13]=A*e+D*a+T*l+F*d,g[14]=A*s+D*n+T*p+F*u,g[15]=A*i+D*o+T*m+F*f,this._identityCalculated=!1,this}translate(t,e,s){let i=s||0;return 0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}_t(...t){if(6===t.length){let[e,s,i,r,a,n]=t;return this.transform(e,s,0,0,i,r,0,0,0,0,1,0,a,n,0,1)}return this.transform(...t)}roundMatrixProperty(t){return t<1e-6&&t>0||t>-1e-6&&t<0?Math.round(1e4*t)/1e4:t}}function tc(t){return B?null:document.createElementNS(N,t)}let td={current:""},tu=()=>td.current,tf={};class tg{constructor(t){let e;this.filters=[];const{length:s}=t.data.ef??[];for(let i=0;i<s;i++){e=null;const s=t.data.ef?.[i]?.ty;s&&tf[s]&&(e=new tf[s].effect(t.effectsManager?.effectElements[i],t)),e&&this.filters.push(e)}this.filters.length>0&&t.addRenderableComponent(this)}getEffects(t){let{length:e}=this.filters,s=[];for(let i=0;i<e;i++){let e=this.filters[i];e?.type===t&&s.push(e)}return s}renderFrame(t){let{length:e}=this.filters;for(let s=0;s<e;s++)this.filters[s]?.renderFrame(t)}}class ty{constructor(t,e,s){this._length=0,this._maxLength=t,this._create=e,this._release=s,this.pool=tp(this._maxLength),this.newElement=this.newElement.bind(this),this.release=this.release.bind(this)}newElement(){let t;return this._length?(this._length-=1,t=this.pool[this._length]):t=this._create(),t}release(t){if(this._length===this._maxLength){var e;this.pool=[...e=this.pool,...tp(e.length)],this._maxLength*=2}this._release&&this._release(t),this.pool[this._length]=t,this._length++}}let tb=new ty(8,()=>tl(K.Float32,2));class tv{get _type(){return"ShapePath"}constructor(){this._length=0,this._maxLength=8,this.c=!1,this.lengths=[],this.v=tp(this._maxLength),this.o=tp(this._maxLength),this.i=tp(this._maxLength)}doubleArrayLength(){this.v=[...this.v,...tp(this._maxLength)],this.i=[...this.i,...tp(this._maxLength)],this.o=[...this.o,...tp(this._maxLength)],this._maxLength*=2}length(){return this._length}setLength(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t}setPathData(t,e){this.c=t,this.setLength(e);let s=0;for(;s<e;)this.v[s]=tb.newElement(),this.o[s]=tb.newElement(),this.i[s]=tb.newElement(),s++}setTripleAt(t,e,s,i,r,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(s,i,"o",n,o),this.setXYAt(r,a,"i",n,o)}setXYAt(t,e,s,i,r){let a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}a[i]&&r||(a[i]=tb.newElement()),a[i][0]=t,a[i][1]=e}toReversed(){let t=new tv;t.setPathData(this.c,this._length);let e=this.v,s=this.o,i=this.i,r=0;this.c&&(t.setTripleAt(e[0]?.[0]??0,e[0]?.[1]??0,i[0]?.[0]??0,i[0]?.[1]??0,s[0]?.[0]??0,s[0]?.[1]??0,0,!1),r=1);let{_length:a}=this,n=a-1;for(let o=r;o<a;o++)t.setTripleAt(e[n]?.[0]??0,e[n]?.[1]??0,i[n]?.[0]??0,i[n]?.[1]??0,s[n]?.[0]??0,s[n]?.[1]??0,o,!1),n-=1;return t}}let t_=new ty(4,function(){return new tv},function(t){if(!D(t))return;let e=t._length;for(let s=0;s<e;s++)tb.release(t.v[s]),tb.release(t.i[s]),tb.release(t.o[s]),t.v[s]=null,t.i[s]=null,t.o[s]=null;t._length=0,t.c=!1}),{newElement:tx}=t_,{release:tw}=t_;function tE(t){let e=tx(),s=t._length??t.v.length;e.setLength(s),e.c=t.c;for(let i=0;i<s;i++)e.setTripleAt(t.v[i]?.[0]??0,t.v[i]?.[1]??0,t.o[i]?.[0]??0,t.o[i]?.[1]??0,t.i[i]?.[0]??0,t.i[i]?.[1]??0,i);return e}class tC{constructor(){this._length=0,this._maxLength=4,this.shapes=tp(this._maxLength)}addShape(t){this._length===this._maxLength&&(this.shapes=[...this.shapes,...tp(this._maxLength)],this._maxLength*=2),this.shapes[this._length]=t,this._length++}releaseShapes(){for(let t=0;t<this._length;t++)tw(this.shapes[t]);this._length=0}}function tS(){return new tC}tp(4);let tk={default:150},tM=new ty(8,()=>({addedLength:0,lengths:tl(K.Float32,tk.default),percents:tl(K.Float32,tk.default)})),tP=new ty(8,()=>({lengths:[],totalLength:0}),t=>{if(!D(t))return;let{length:e}=t.lengths;for(let s=0;s<e;s++)tM.release(t.lengths[s]);t.lengths.length=0}),tA=tl(K.Float32,8);function tD(t,e,s,i){let r={},a=`${t[0]}_${t[1]}_${e[0]}_${e[1]}_${s[0]}_${s[1]}_${i[0]}_${i[1]}`.replaceAll(".","p");if(!r[a]){let n=tk.default,o,h,l=0,p,m,c=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&tI(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&tI(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(n=2);let d=new tB(n),{length:u}=s;for(let r=0;r<n;r++){m=tp(u),h=r/(n-1),p=0;for(let r=0;r<u;r++)o=Math.pow(1-h,3)*(t[r]??0)+3*Math.pow(1-h,2)*h*((t[r]??0)+(s[r]??0))+3*(1-h)*Math.pow(h,2)*((e[r]??0)+(i[r]??0))+Math.pow(h,3)*(e[r]??0),m[r]=o,null!==c&&(p+=Math.pow(Number(m[r])-Number(c[r]),2));l+=p=Math.sqrt(p),d.points[r]=new tV(p,m),c=m}d.segmentLength=l,r[a]=d}return r[a]}function tT(t,e,s,i,r,a,n){let o=r,h=a;o<0?o=0:o>1&&(o=1);let l=tN(o,n)??0,p=tN(h=h>1?1:h,n)??0,m=1-l,c=1-p,d=m*m*m,u=l*m*m*3,f=l*l*m*3,g=l*l*l,y=m*m*c,b=l*m*c+m*l*c+m*m*p,v=l*l*c+m*l*p+l*m*p,_=l*l*p,x=m*c*c,w=l*c*c+m*p*c+m*c*p,E=l*p*c+m*p*p+l*c*p,C=l*p*p,S=c*c*c,k=p*c*c+c*p*c+c*c*p,M=p*p*c+c*p*p+p*c*p,P=p*p*p,{length:A}=t;for(let r=0;r<A;r++)tA[4*r]=Math.round((d*(t[r]??0)+u*(s[r]??0)+f*(i[r]??0)+g*(e[r]??0))*1e3)/1e3,tA[4*r+1]=Math.round((y*(t[r]??0)+b*(s[r]??0)+v*(i[r]??0)+_*(e[r]??0))*1e3)/1e3,tA[4*r+2]=Math.round((x*(t[r]??0)+w*(s[r]??0)+E*(i[r]??0)+C*(e[r]??0))*1e3)/1e3,tA[4*r+3]=Math.round((S*(t[r]??0)+k*(s[r]??0)+M*(i[r]??0)+P*(e[r]??0))*1e3)/1e3;return tA}function tF(t){let e,s=tP.newElement(),i=t.c,r=t.v,a=t.o,n=t.i,o=t._length||0,{lengths:h}=s,l=0;for(e=0;e<o-1;e++)h[e]=tL(r[e],r[e+1],a[e],n[e+1]),l+=h[e]?.addedLength??0;return i&&o&&(h[e]=tL(r[e],r[0],a[e],n[0]),l+=h[e]?.addedLength??0),s.totalLength=l,s}function tI(t,e,s,i,r,a){let n=t*i+e*r+s*a-r*i-a*t-s*e;return n>-.001&&n<.001}function t$(t,e,s,i,r,a,n,o,h){let l;if(0===s&&0===a&&0===h)return tI(t,e,i,r,n,o);let p=Math.sqrt(Math.pow(i-t,2)+Math.pow(r-e,2)+Math.pow(a-s,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-s,2)),c=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-r,2)+Math.pow(h-a,2));return(l=p>m?p>c?p-m-c:c-m-p:c>m?c-m-p:m-p-c)>-1e-4&&l<1e-4}function tL(t,e,s,i){let r=tk.default,a,n,o=0,h,l=[],p=[],m=tM.newElement(),c=s.length;for(let d=0;d<r;d++){n=d/(r-1),h=0;for(let r=0;r<c;r++)a=Math.pow(1-n,3)*(t[r]??0)+3*Math.pow(1-n,2)*n*(s[r]??0)+3*(1-n)*Math.pow(n,2)*(i[r]??0)+Math.pow(n,3)*(e[r]??0),l[r]=a,"number"==typeof p[r]&&(h+=Math.pow((l[r]??0)-(p[r]??0),2)),p[r]=l[r]??0;h&&(o+=h=Math.sqrt(h)),m.percents[d]=n,m.lengths[d]=o}return m.addedLength=o,m}function tN(t,{addedLength:e,lengths:s,percents:i}){let{length:r}=i,a=Math.floor((r-1)*t),n=t*e,o=0;if(a===r-1||0===a||n===s[a])return i[a];let h=(s[a]??0)>n?-1:1,l=!0;for(;l;)if((s[a]??0)<=n&&(s[a+1]??0)>n?(o=(n-(s[a]??0))/((s[a+1]??0)-(s[a]??0)),l=!1):a+=h,a<0||a>=r-1){if(a===r-1)return i[a];l=!1}return(i[a]??0)+((i[a+1]??0)-(i[a]??0))*o}class tB{constructor(t){this.segmentLength=0,this.points=Array.from({length:t})}}class tV{constructor(t,e){this.partialLength=t,this.point=e}}let tR=function(t,e,s,i,r,a){let n=tN(r,a)??0,o=1-n;return[Math.round((o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*s[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0])*1e3)/1e3,Math.round((o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*s[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1])*1e3)/1e3]},tO={};function tz(t,e,s,i,r){let a=r||`bez_${t}_${e}_${s}_${i}`.replaceAll(".","p");if(tO[a])return tO[a];let n=new tG([t,e,s,i]);return tO[a]=n,n}class tG{constructor(t){this._precomputed=!1,this.float32ArraySupported="function"==typeof Float32Array,this.kSplineTableSize=11,this.kSampleStepSize=1/(this.kSplineTableSize-1),this.NEWTON_ITERATIONS=4,this.NEWTON_MIN_SLOPE=.001,this.SUBDIVISION_MAX_ITERATIONS=10,this.SUBDIVISION_PRECISION=1e-7,this._p=t,this._mSampleValues=this.float32ArraySupported?new Float32Array(this.kSplineTableSize):Array.from({length:this.kSplineTableSize}),this.get=this.get.bind(this)}_calcSampleValues(){let t=this._p[0],e=this._p[2];for(let s=0;s<this.kSplineTableSize;++s)this._mSampleValues[s]=this.calcBezier(s*this.kSampleStepSize,t??0,e??0)}_getTForX(t){let e=this._p[0],s=this._p[2],i=this._mSampleValues,r=0,a=1,n=this.kSplineTableSize-1;for(;a!==n&&Number(i[a])<=t;)r+=this.kSampleStepSize,++a;let o=r+(t-Number(i[--a]))/(Number(i[a+1])-Number(i[a]))*this.kSampleStepSize,h=this.getSlope(o,e??0,s??0);return h>=this.NEWTON_MIN_SLOPE?this.newtonRaphsonIterate(t,o,e??0,s??0):0===h?o:this.binarySubdivide(t,r,r+this.kSampleStepSize,e??0,s??0)}_precompute(){let t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,(t!==e||s!==i)&&this._calcSampleValues()}get(t){let e=this._p[0],s=this._p[1],i=this._p[2],r=this._p[3];return(this._precomputed||this._precompute(),e===s&&i===r)?t:0===t?0:1===t?1:this.calcBezier(this._getTForX(t),s??0,r??0)}A(t,e){return 1-3*e+3*t}B(t,e){return 3*e-6*t}binarySubdivide(t,e,s,i,r){let a=e,n=s,o,h,l=0;do h=a+(n-a)/2,(o=this.calcBezier(h,i,r)-t)>0?n=h:a=h;while(Math.abs(o)>this.SUBDIVISION_PRECISION&&++l<this.SUBDIVISION_MAX_ITERATIONS);return h}C(t){return 3*t}calcBezier(t,e,s){return((this.A(e,s)*t+this.B(e,s))*t+this.C(e))*t}getSlope(t,e,s){return 3*this.A(e,s)*t*t+2*this.B(e,s)*t+this.C(e)}newtonRaphsonIterate(t,e,s,i){let r=e;for(let e=0;e<this.NEWTON_ITERATIONS;++e){let e=this.getSlope(r,s,i);if(0===e)break;let a=this.calcBezier(r,s,i)-t;r-=a/e}return r}}class tq{addDynamicProperty(t){this.dynamicProperties.includes(t)||(this.dynamicProperties.push(t),this.container?.addDynamicProperty(this),this._isAnimated=!0)}getValue(t){throw Error(`${this.constructor.name}: Method getValue is not implemented`)}initDynamicPropertyContainer(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}iterateDynamicProperties(){this._mdf=!1;let{length:t}=this.dynamicProperties;for(let e=0;e<t;e++)this.dynamicProperties[e]?.getValue(),this.dynamicProperties[e]?._mdf&&(this._mdf=!0);return 0}setGroupProperty(t){}constructor(){this.dynamicProperties=[]}}let tj=t=>{let e=t[0]*$,s=t[1]*$,i=t[2]*$,r=Math.cos(e/2),a=Math.cos(s/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(s/2),l=Math.sin(i/2);return[o*h*n+r*a*l,o*a*n+r*h*l,r*h*n-o*a*l,r*a*n-o*h*l]};class tH extends tq{addEffect(t){this.effectsSequence.push(t),this.container?.addDynamicProperty(this)}getSpeedAtTime(t){throw Error(`${this.constructor.name}: Method getSpeedAtTime is not implemented`)}getValueAtCurrentTime(){if(this._caching=this._caching??{},!this.keyframes)return;let{_caching:t,comp:e,keyframes:s,offsetTime:i}=this,r=Number(e?.renderedFrame)-i,a=(s[0]?.t??0)-i,n=s.length-1,o=(s[n]?.t??0)-i,{lastFrame:h}=t;return r===h||-999999!==h&&(h>=o&&r>=o||h<a&&r<a)||(h>=r&&(t._lastKeyframeIndex=-1,t.lastIndex=0),this.pv=this.interpolateValue(r,t)),t.lastFrame=r,this.pv}getValueAtTime(t,e){throw Error(`${this.constructor.name}: Method getValueAtTime is not implemented`)}getVelocityAtTime(t){throw Error(`${this.constructor.name}: Method getVelocityAtTime is not implemented`)}initiateExpression(t,e,s){throw Error("Method not implemented")}interpolateValue(t,e={}){let s,{offsetTime:i,pv:r}=this,a=[0,0,0];this.propType===tn.MultiDimensional&&r&&(a=tl(K.Float32,r.length));let{keyframes:n=[],keyframesMetadata:o,propType:h}=this,l=e.lastIndex||0,p=l,m=n.length-1,c=!0,d=n[0]??{},u=n[1]??{};for(;c;){if(d=n[p]??{},u=n[p+1]??{},p===m-1&&t>=u.t-i){d.h&&(d=u),l=0;break}if(u.t-i>t){l=p;break}p<m-1?p++:(l=0,c=!1)}let f=o[p]??{},g,y,b,v,_=null,x=u.t-i,w=d.t-i;if(d.to&&d.s){f.bezierData=f.bezierData??tD(d.s,u.s??d.e,d.to,d.ti);let{__fnct:s,bezierData:i}=f;if(t>=x||t<w){let e=t>=x?i.points.length-1:0;g=i.points[e]?.point.length??0;for(let t=0;t<g;t++)a[t]=i.points[e]?.point[t]??0}else{s?_=s:f.__fnct=_=tz(d.o.x,d.o.y,d.i.x,d.i.y,d.n).get,y=_((t-w)/(x-w));let r=i.segmentLength*y,n,o=e.lastFrame<t&&e._lastKeyframeIndex===p?e._lastAddedLength:0;for(v=e.lastFrame<t&&e._lastKeyframeIndex===p?e._lastPoint:0,c=!0,b=i.points.length;c;){if(o+=i.points[v]?.partialLength??0,0===r||0===y||v===i.points.length-1){g=i.points[v]?.point.length??0;for(let t=0;t<g;t++)a[t]=i.points[v]?.point[t]??0;break}if(r>=o&&r<o+(i.points[v+1]?.partialLength??0)){n=(r-o)/(i.points[v+1]?.partialLength??0),g=i.points[v]?.point.length??0;for(let t=0;t<g;t++)a[t]=(i.points[v]?.point[t]??0)+((i.points[v+1]?.point[t]??0)-(i.points[v]?.point[t]??0))*n;break}v<b-1?v++:c=!1}e._lastPoint=v,e._lastAddedLength=o-(i.points[v]?.partialLength??0),e._lastKeyframeIndex=p}}else{let e,i,r,n;if(m=d.s?.length||0,s=u.s??d.e,this.sh&&1!==d.h)if(t>=x)a[0]=s[0],a[1]=s[1],a[2]=s[2];else if(t<=w&&d.s)a[0]=d.s[0],a[1]=d.s[1],a[2]=d.s[2];else{var E,C,S;let e,i,r,n,o,h,l,p,m,c,u,f,g,y,b,v,_,k,M,P,A,D=tj(d.s),T=tj(s);C=a,b=(E=(t-w)/(x-w),e=[0,0,0,0],i=D[0],r=D[1],n=D[2],o=D[3],h=T[0],l=T[1],(u=i*h+r*l+n*(p=T[2])+o*(m=T[3]))<0&&(u=-u,h=-h,l=-l,p=-p,m=-m),1-u>1e-6?(f=Math.sin(c=Math.acos(u)),g=Math.sin((1-E)*c)/f,y=Math.sin(E*c)/f):(g=1-E,y=E),e[0]=g*i+y*h,e[1]=g*r+y*l,e[2]=g*n+y*p,e[3]=g*o+y*m,S=e)[0],v=S[1],_=S[2],M=Math.atan2(2*v*(k=S[3])-2*b*_,1-2*v*v-2*_*_),P=Math.asin(2*b*v+2*_*k),A=Math.atan2(2*b*k-2*v*_,1-2*b*b-2*_*_),C[0]=M/$,C[1]=P/$,C[2]=A/$}else for(p=0;p<m;p++)1!==d.h&&(t>=x?y=1:t<w?y=0:(d.o.x.constructor===Array?(f.__fnct=f.__fnct??[],f.__fnct[p]?_=f.__fnct[p]:k(d.o.y)&&k(d.i.y)&&k(d.i.x)&&(e=d.o.x[p]??d.o.x[0],i=d.o.y[p]??d.o.y[0],_=tz(e??0,i??0,(r=d.i.x[p]??d.i.x[0])??0,d.i.y[p]??d.i.y[0]??0).get,f.__fnct[p]=_)):f.__fnct?_=f.__fnct:(e=d.o.x,i=d.o.y,_=tz(e,i,r=d.i.x,d.i.y).get,d.keyframeMetadata=_),y=_?.((t-w)/(x-w)))),s=u.s??d.e,void 0!==(n=1===d.h?d.s?.[p]:Number(d.s?.[p])+((s[p]??0)-Number(d.s?.[p]))*Number(y))&&(h===tn.MultiDimensional?a[p]=n:a=n)}return e.lastIndex=l,a}processEffectsSequence(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.elem)throw Error(`${this.constructor.name}: elem (ElementInterface) is not implemented`);if(this.elem.globalData?.frameId===this.frameId)return 0;if(0===this.effectsSequence.length)return this._mdf=!1,0;if(this.lock&&this.pv)return this.setVValue(this.pv),0;this.lock=!0,this._mdf=!!this._isFirstFrame;let t=this.effectsSequence.length,e=this.kf?this.pv:this.data.k;for(let s=0;s<t;s++)e=this.effectsSequence[s]?.(e);return this.setVValue(e),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData?.frameId,0}setVValue(t){let e;if("number"==typeof t&&this.propType===tn.UniDimensional){e=t*Number(this.mult),Math.abs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);return}let s=0,{length:i}=this.v;for(;s<i;)e=(t[s]??0)*Number(this.mult),Math.abs((this.v[s]??0)-e)>1e-5&&(this.v[s]=e,this._mdf=!0),s++}speedAtTime(t){throw Error("Method is not implemented")}valueAtTime(t,e){throw Error(`${this.constructor.name}: Method valueAtTime is not implemented`)}velocityAtTime(t){throw Error("Method is not implemented")}constructor(...t){super(...t),this._isFirstFrame=!1,this.effectsSequence=[],this.initFrame=-999999,this.keyframesMetadata=[],this.offsetTime=0}}class tW extends tH{constructor(t,e,s=null,i=null){let r,a,n,o;super(),this.propType=tn.MultiDimensional;const{length:h}=e.k;for(let t=0;t<h-1;t++)e.k[t]?.to&&e.k[t]?.s&&e.k[t+1]?.s&&(r=e.k[t]?.s,a=e.k[t+1]?.s,n=e.k[t]?.to,o=e.k[t]?.ti,(2===r.length&&(r[0]!==a[0]||r[1]!==a[1])&&tI(r[0]??0,r[1]??0,a[0]??0,a[1]??0,(r[0]??0)+(n[0]??0),(r[1]??0)+(n[1]??0))&&tI(r[0]??0,r[1]??0,a[0]??0,a[1]??0,(a[0]??0)+(o[0]??0),(a[1]??0)+(o[1]??0))||3===r.length&&(r[0]!==a[0]||r[1]!==a[1]||r[2]!==a[2])&&t$(r[0]??0,r[1]??0,r[2]??0,a[0]??0,a[1]??0,a[2]??0,(r[0]??0)+(n[0]??0),(r[1]??0)+(n[1]??0),(r[2]??0)+(n[2]??0))&&t$(r[0]??0,r[1]??0,r[2]??0,a[0]??0,a[1]??0,a[2]??0,(a[0]??0)+(o[0]??0),(a[1]??0)+(o[1]??0),(a[2]??0)+(o[2]??0)))&&(e.k[t].to=null,e.k[t].ti=null),(r[0]===a[0]&&r[1]===a[1]&&0===n[0]&&0===n[1]&&0===o[0]&&0===o[1]&&2===r.length||r[2]===a[2]&&0===n[2]&&0===o[2])&&(e.k[t].to=null,e.k[t].ti=null));this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=this.processEffectsSequence,this.frameId=-1;const l=e.k[0]?.s?.length||0;this.v=tl(K.Float32,l),this.pv=tl(K.Float32,l);for(let t=0;t<l;t++)this.v[t]=this.initFrame,this.pv[t]=this.initFrame;this._caching={lastFrame:this.initFrame,lastIndex:0,value:tl(K.Float32,l)}}}class tY extends tH{constructor(t,e,s=null,i=null){super(),this.propType=tn.UniDimensional,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={_lastKeyframeIndex:-1,lastFrame:this.initFrame,lastIndex:0,value:0},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=this.initFrame,this.pv=this.initFrame,this._isFirstFrame=!0,this.getValue=this.processEffectsSequence,this.effectsSequence=[this.getValueAtCurrentTime.bind(this)]}}class tU extends tH{constructor(t,e,s=null,i=null){super(),this.propType=tn.MultiDimensional,this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;const{length:r}=e.k;this.v=tl(K.Float32,r),this.pv=tl(K.Float32,r),this.vel=tl(K.Float32,r);for(let t=0;t<r;t++)this.v[t]=(e.k[t]??0)*this.mult,this.pv[t]=e.k[t]??0;this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class tJ extends tH{constructor(){super(),this.propType=!1}}class tX extends tH{constructor(t,e,s=null,i=null){super(),this.propType=tn.UniDimensional,this.mult=s||1,this.data=e,this.v=e.k*(s||1),this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=this.processEffectsSequence}}let tZ={getProp:function(t,e,s,i,r){let a,n=e;if(n&&"sid"in n&&n.sid&&(n=t.globalData?.slotManager?.getProp(n)),!n)return new tJ;if("number"==typeof n.k)a=new tX(t,n,i,r);else if(M(n.k))a=new tU(t,n,i,r);else switch(s){case 0:a=new tY(t,n,i,r);break;case 1:a=new tW(t,n,i,r)}return(a=a??new tJ).effectsSequence.length>0&&r?.addDynamicProperty(a),a}};class tK extends tq{getValueAtTime(t,e){throw Error(`${this.constructor.name}: Method getShapeValueAtTime is not implemented`)}initiateExpression(t,e,s){throw Error(`${this.constructor.name}: Method initiateExpression is not implemented`)}interpolateShape(t,e,s={}){let i=s.lastIndex||0,r,a,n,o=0,h,l=this.keyframes??[];if(t<(l[0]?.t??0)-this.offsetTime)r=l[0]?.s?.[0]??0,n=!0,i=0;else if(t>=(l[l.length-1]?.t??0)-this.offsetTime)r=l[l.length-1]?.s?l[l.length-1]?.s?.[0]:l[l.length-2]?.e[0],n=!0;else{let e=i,s=l.length-1,h=!0,p,m;for(;h&&(p=l[e],m=l[e+1],!((m?.t??0)-this.offsetTime>t));)e<s-1?e++:h=!1;if(!p||!m)throw Error(`${this.constructor.name}: Could not set keyframe data`);let c=this.keyframesMetadata[e]??{};if(n=1===p.h,i=e,!n){if(t>=m.t-this.offsetTime)o=1;else if(t<p.t-this.offsetTime)o=0;else{let e;c.__fnct?e=c.__fnct:"number"==typeof p.o.x&&"number"==typeof p.o.y&&"number"==typeof p.i.x&&"number"==typeof p.i.y&&(c.__fnct=e=tz(p.o.x,p.o.y,p.i.x,p.i.y).get),o=e?.((t-(p.t-this.offsetTime))/(m.t-this.offsetTime-(p.t-this.offsetTime)))||0}a=m.s?m.s[0]:p.e[0]}r=p.s?.[0]}if(!r||"number"==typeof r||k(r)||"number"==typeof a)return;let p=e._length,m=r.i[0]?.length??0;s.lastIndex=i;for(let t=0;t<p;t++)for(let s=0;s<m;s++)h=(n?r.i[t]?.[s]:(r.i[t]?.[s]??0)+((a?.i[t]?.[s]??0)-(r.i[t]?.[s]??0))*o)??0,e.i[t][s]=h,h=(n?r.o[t]?.[s]:(r.o[t]?.[s]??0)+((a?.o[t]?.[s]??0)-(r.o[t]?.[s]??0))*o)??0,e.o[t][s]=h,h=(n?r.v[t]?.[s]:(r.v[t]?.[s]??0)+((a?.v[t]?.[s]??0)-(r.v[t]?.[s]??0))*o)??0,e.v[t][s]=h}interpolateShapeCurrentTime(){if(!this.pv)throw Error(`${this.constructor.name}: Cannot parse ShapePath v value`);if(!this.keyframes)return;this._caching=this._caching??{};let t=Number(this.comp?.renderedFrame)-this.offsetTime,e=(this.keyframes[0]?.t??0)-this.offsetTime,s=(this.keyframes[this.keyframes.length-1]?.t??0)-this.offsetTime,{lastFrame:i,lastIndex:r}=this._caching;return -999999!==i&&(i<e&&t<e||i>s&&t>s)||(this._caching.lastIndex=i<t?r:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}processEffectsSequence(t){let e,s;if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(this.elem?.globalData?.frameId===this.frameId)return 0;if(0===this.effectsSequence.length)return this._mdf=!1,0;if(this.lock&&this.pv)return this.setVValue(this.pv),0;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt?.k;let i=this.effectsSequence.length;for(s=0;s<i;s++)e=this.effectsSequence[s]?.(e);return this.setVValue(e),this.lock=!1,this.frameId=this.elem?.globalData?.frameId||0,0}reset(){this.paths=this.localShapeCollection}setVValue(t){if(!this.v||!t)throw Error(`${this.constructor.name}: ShapePath is not set`);if(!this.localShapeCollection)throw Error(`${this.constructor.name}: localShapeCollection is not set`);this.shapesEqual(this.v,t)||(this.v=tE(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}shapesEqual(t,e){if(t._length!==e._length||t.c!==e.c)return!1;let s=t._length||0;for(let i=0;i<s;i++)if(t.v[i]?.[0]!==e.v[i]?.[0]||t.v[i]?.[1]!==e.v[i]?.[1]||t.o[i]?.[0]!==e.o[i]?.[0]||t.o[i]?.[1]!==e.o[i]?.[1]||t.i[i]?.[0]!==e.i[i]?.[0]||t.i[i]?.[1]!==e.i[i]?.[1])return!1;return!0}constructor(...t){super(...t),this.data=void 0,this.effectsSequence=[],this.keyframesMetadata=[],this.offsetTime=0,this.pathsData=[]}}class tQ extends tK{constructor(t,e){super(),this._cPoint=.5519,this.v=tx(),this.v.setPathData(!0,4),this.localShapeCollection=tS(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=tZ.getProp(t,e.p,1,0,this),this.s=tZ.getProp(t,e.s,1,0,this),this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertEllToPath())}convertEllToPath(){if("object"!=typeof this.p?.v)return;let t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=3!==this.d,a=this.v;if(!a?.v[0]||!a.v[1]||!a.v[2]||!a.v[3]||!a.i[0]||!a.i[1]||!a.i[2]||!a.i[3]||!a.o[0]||!a.o[1]||!a.o[2]||!a.o[3])throw Error(`${this.constructor.name}: Could not get value of ellipse`);a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=r?t+s:t-s,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=r?t-s:t+s,a.v[3][1]=e,a.i[0][0]=r?t-s*this._cPoint:t+s*this._cPoint,a.i[0][1]=e-i,a.i[1][0]=r?t+s:t-s,a.i[1][1]=e-i*this._cPoint,a.i[2][0]=r?t+s*this._cPoint:t-s*this._cPoint,a.i[2][1]=e+i,a.i[3][0]=r?t-s:t+s,a.i[3][1]=e+i*this._cPoint,a.o[0][0]=r?t+s*this._cPoint:t-s*this._cPoint,a.o[0][1]=e-i,a.o[1][0]=r?t+s:t-s,a.o[1][1]=e+i*this._cPoint,a.o[2][0]=r?t-s*this._cPoint:t+s*this._cPoint,a.o[2][1]=e+i,a.o[3][0]=r?t-s:t+s,a.o[3][1]=e-i*this._cPoint}getValue(t){return this.elem?.globalData?.frameId===this.frameId||(this.frameId=this.elem?.globalData?.frameId||0,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath()),0}}class t0 extends tK{constructor(t,e){super(),this.v=tx(),this.v.c=!0,this.localShapeCollection=tS(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=tZ.getProp(t,e.p,1,0,this),this.s=tZ.getProp(t,e.s,1,0,this),this.r=tZ.getProp(t,e.r,0,0,this),this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertRectToPath())}convertRectToPath(){if("object"!=typeof this.p?.v)throw TypeError(`${this.constructor.name}: p value is not implemented`);let t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=Math.min(s,i,this.r.v),a=r*(1-.5519);this.v&&(this.v._length=0),2===this.d||1===this.d?(this.v?.setTripleAt(t+s,e-i+r,t+s,e-i+r,t+s,e-i+a,0,!0),this.v?.setTripleAt(t+s,e+i-r,t+s,e+i-a,t+s,e+i-r,1,!0),0===r?(this.v?.setTripleAt(t-s,e+i,t-s+a,e+i,t-s,e+i,2),this.v?.setTripleAt(t-s,e-i,t-s,e-i+a,t-s,e-i,3)):(this.v?.setTripleAt(t+s-r,e+i,t+s-r,e+i,t+s-a,e+i,2,!0),this.v?.setTripleAt(t-s+r,e+i,t-s+a,e+i,t-s+r,e+i,3,!0),this.v?.setTripleAt(t-s,e+i-r,t-s,e+i-r,t-s,e+i-a,4,!0),this.v?.setTripleAt(t-s,e-i+r,t-s,e-i+a,t-s,e-i+r,5,!0),this.v?.setTripleAt(t-s+r,e-i,t-s+r,e-i,t-s+a,e-i,6,!0),this.v?.setTripleAt(t+s-r,e-i,t+s-a,e-i,t+s-r,e-i,7,!0))):(this.v?.setTripleAt(t+s,e-i+r,t+s,e-i+a,t+s,e-i+r,0,!0),0===r?(this.v?.setTripleAt(t-s,e-i,t-s+a,e-i,t-s,e-i,1,!0),this.v?.setTripleAt(t-s,e+i,t-s,e+i-a,t-s,e+i,2,!0),this.v?.setTripleAt(t+s,e+i,t+s-a,e+i,t+s,e+i,3,!0)):(this.v?.setTripleAt(t+s-r,e-i,t+s-r,e-i,t+s-a,e-i,1,!0),this.v?.setTripleAt(t-s+r,e-i,t-s+a,e-i,t-s+r,e-i,2,!0),this.v?.setTripleAt(t-s,e-i+r,t-s,e-i+r,t-s,e-i+a,3,!0),this.v?.setTripleAt(t-s,e+i-r,t-s,e+i-a,t-s,e+i-r,4,!0),this.v?.setTripleAt(t-s+r,e+i,t-s+r,e+i,t-s+a,e+i,5,!0),this.v?.setTripleAt(t+s-r,e+i,t+s-a,e+i,t+s-r,e+i,6,!0),this.v?.setTripleAt(t+s,e+i-r,t+s,e+i-r,t+s,e+i-a,7,!0)))}getValue(){return this.elem?.globalData?.frameId===this.frameId||(this.elem?.globalData?.frameId&&(this.frameId=this.elem.globalData.frameId),this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath()),0}}class t1 extends tK{constructor(t,e,s){super(),this.propType=tn.Shape,this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;const i=3===s?e.pt?.k:e.ks?.k;if(!i)throw Error(`${this.constructor.name}: Could now get Path Data`);this.v=tE(i),this.pv=tE(this.v),this.localShapeCollection=tS(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class t2 extends tK{constructor(t,e,s){super(),this.lastFrame=-999999,this.data=e,this.propType=tn.Shape,this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data?.st||0,this.keyframes=3===s?e.pt?.k:e.ks?.k??[],this.keyframesMetadata=[],this.k=!0,this.kf=!0;const i=this.keyframes[0]?.s,{length:r}=i?.[0]?.i??[];this.v=tx(),this.v.setPathData(!!i?.[0]?.c,r),this.pv=tE(this.v),this.localShapeCollection=tS(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this._caching={lastFrame:-999999,lastIndex:0},this.effectsSequence=[this.interpolateShapeCurrentTime.bind(this)],this.getValue=this.processEffectsSequence}}class t3 extends tK{constructor(t,e){super(),this.v=tx(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=tZ.getProp(t,e.ir,0,0,this),this.is=tZ.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=tZ.getProp(t,e.pt,0,0,this),this.p=tZ.getProp(t,e.p,1,0,this),this.r=tZ.getProp(t,e.r,0,$,this),this.or=tZ.getProp(t,e.or,0,0,this),this.os=tZ.getProp(t,e.os,0,.01,this),this.localShapeCollection=tS(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertToPath())}convertPolygonToPath(){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(!this.p)throw Error(`${this.constructor.name}: p value is not implemented`);let t=Math.floor(this.pt.v),e=2*Math.PI/t,s=this.or.v,i=this.os.v,r=2*Math.PI*s/(4*t),a=-(.5*Math.PI),n=3===this.data.d?-1:1;a+=this.r.v,this.v&&(this.v._length=0);for(let o=0;o<t;o++){let t=s*Math.cos(a),h=s*Math.sin(a),l=0===t&&0===h?0:h/Math.sqrt(t*t+h*h),p=0===t&&0===h?0:-t/Math.sqrt(t*t+h*h),m=Array.isArray(this.p.v)?this.p.v:[0,0];t+=m[0],h+=m[1],this.v?.setTripleAt(t,h,t-l*r*i*n,h-p*r*i*n,t+l*r*i*n,h+p*r*i*n,o,!0),a+=e*n}this.paths.length=0,this.paths[0]=this.v}convertStarToPath(){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(!this.v)throw Error(`${this.constructor.name}: v (ShapePath) is not implemented`);let t=2*Math.floor(this.pt.v),e=2*Math.PI/t,s=!0,i=this.or.v,r=Number(this.ir?.v),a=this.os.v,n=Number(this.is?.v),o=2*Math.PI*i/(2*t),h=2*Math.PI*r/(2*t),l,p,m,c=-Math.PI/2;c+=this.r.v;let d=3===this.data.d?-1:1;this.v._length=0;for(let u=0;u<t;u++){l=s?i:r,p=s?a:n,m=s?o:h;let t=l*Math.cos(c),f=l*Math.sin(c),g=0===t&&0===f?0:f/Math.sqrt(t*t+f*f),y=0===t&&0===f?0:-t/Math.sqrt(t*t+f*f),b=Array.isArray(this.p?.v)?this.p.v:[0,0];t+=b[0],f+=b[1],this.v.setTripleAt(t,f,t-g*m*p*d,f-y*m*p*d,t+g*m*p*d,f+y*m*p*d,u,!0),s=!s,c+=e*d}}convertToPath(){throw Error(`${this.constructor.name}: Method convertToPath is not implemented`)}getValue(t){return this.elem?.globalData?.frameId===this.frameId||(this.frameId=this.elem?.globalData?.frameId||0,this.iterateDynamicProperties(),this._mdf&&this.convertToPath()),0}}let t5={getConstructorFunction:function(){return t1},getKeyframedConstructorFunction:function(){return t2},getShapeProp:function(t,e,s,i,r){let a=null;switch(s){case 3:case 4:{let i=3===s?e.pt:e.ks,r=i?.k;if(r?.length){a=new t2(t,e,s);break}a=new t1(t,e,s);break}case 5:a=new t0(t,e);break;case 6:a=new tQ(t,e);break;case 7:a=new t3(t,e)}return a?.k&&t.addDynamicProperty(a),a}};class t4{constructor(t,e){this._isFirstFrame=!1,this.data=t,this.element=e,this.masksProperties=this.data.masksProperties??[],this.viewData=tp(this.masksProperties.length);const{length:s}=this.masksProperties;let i=!1;for(let t=0;t<s;t++)this.masksProperties[t]?.mode!=="n"&&(i=!0),this.viewData[t]=t5.getShapeProp(this.element,this.masksProperties[t],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}destroy(){this.element=null}getMaskProperty(t){return this.viewData[t]}renderFrame(t){let e,s;if(!this.element.globalData?.compSize)throw Error(`${this.constructor.name}: element->globalData->compSize is not implemented`);if(!this.hasMasks)return;let i=this.element.finalTransform?.mat,r=this.element.canvasContext,{length:a}=this.masksProperties;r?.beginPath();for(let t=0;t<a;t++)if(this.masksProperties[t]?.mode!=="n"){this.masksProperties[t]?.inv&&(r?.moveTo(0,0),r?.lineTo(this.element.globalData.compSize.w,0),r?.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),r?.lineTo(0,this.element.globalData.compSize.h),r?.lineTo(0,0));let a=this.viewData[t]?.v;if(!a)throw Error(`${this.constructor.name}: Could not access ShapePath`);let n=i?.applyToPointArray(a.v[0]?.[0]??0,a.v[0]?.[1]??0,0)??[];r?.moveTo(n[0]??0,n[1]??0);let o=a._length;for(e=1;e<o;e++)s=i?.applyToTriplePoints(a.o[e-1],a.i[e],a.v[e])??[],r?.bezierCurveTo(s[0]??0,s[1]??0,s[2]??0,s[3]??0,s[4]??0,s[5]??0);s=i?.applyToTriplePoints(a.o[e-1],a.i[0],a.v[0])??[],r?.bezierCurveTo(s[0]??0,s[1]??0,s[2]??0,s[3]??0,s[4]??0,s[5]??0)}this.element.globalData.renderer.save(!0),r?.clip()}}class t6{constructor(t,e,s){this.p=tZ.getProp(e,t.v,0,0,s)}}class t8{constructor(t,e,s){this.p=tZ.getProp(e,t.v,1,0,s)}}class t9 extends t6{}class t7 extends t6{}class et extends t8{}class ee extends t8{}class es extends t6{}class ei extends t6{}class er extends t6{}class ea{constructor(){this.p={}}}class en extends tq{constructor(t,e,s){super(),this.data=void 0,this.effectElements=[],this.getValue=this.iterateDynamicProperties,this.init(t,e,s)}init(t,e,s){let i;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);let r=this.data.ef,{length:a}=r;for(let t=0;t<a;t++){switch(r[t]?.ty){case 0:i=new t9(r[t],e,this);break;case 1:i=new t7(r[t],e,this);break;case 2:i=new et(r[t],e,this);break;case 3:i=new ee(r[t],e,this);break;case 4:case 7:i=new er(r[t],e,this);break;case 10:i=new es(r[t],e,this);break;case 11:i=new ei(r[t],e,this);break;case 5:i=new eo(s,e);break;default:i=new ea}this.effectElements.push(i)}}renderFrame(t){throw Error(`${this.constructor.name}: Method renderFrame is not implemented yet`)}}class eo{constructor(t,e,s){this.effectElements=[];const i=t.ef??[],{length:r}=i;for(let s=0;s<r;s++){const r=new en(i[s],e,t);this.effectElements.push(r)}}}let eh={interface:null,plugin:null},el=t=>{eh.plugin=t};function ep(t=16){return({0:"source-over",1:"multiply",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity",16:"normal",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light"})[t]??"normal"}class em{buildAllItems(){throw Error(`${this.constructor.name}: Method buildAllItems is not implemented`)}checkLayers(t){throw Error(`${this.constructor.name}: Method checkLayers is not implemented`)}checkMasks(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not initialized`);if(!this.data.hasMask)return!1;let t=0,{length:e}=this.data.masksProperties??[];for(;t<e;){if(this.data.masksProperties?.[t]?.mode!=="n"&&this.data.masksProperties?.[t]?.cl!==!1)return!0;t++}return!1}destroy(){}destroyBaseElement(){throw Error(`${this.constructor.name}: Method destroyBaseElement is not implemented`)}getBaseElement(){throw Error(`${this.constructor.name}: Method getBaseElement is not implemented`)}getType(){return this.type}initBaseData(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=v(),this.data.sr||(this.data.sr=1),this.effectsManager=new eo(this.data,this,this.dynamicProperties)}initExpressions(){try{if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=eh.interface;if(!t)return;let e=t("layer"),s=t("effects"),i=t("shape"),r=t("text"),a=t("comp");this.layerInterface=new e(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);let n=new s().createEffectsInterface(this,this.layerInterface);if(this.layerInterface.registerEffectsInterface(n),0===this.data.ty||this.data.xt){this.compInterface=new a(this);return}if(4===this.data.ty){this.layerInterface.shapeInterface=new i(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface;return}5===this.data.ty&&(this.layerInterface.textInterface=new r(this),this.layerInterface.text=this.layerInterface.textInterface)}catch(t){console.error(this.constructor.name,t)}}setBlendMode(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=ep(this.data.bm),e=this.baseElement??this.layerElement;if(!e)throw Error(`${this.constructor.name}: Both baseElement and layerElement are not implemented`);e.style.mixBlendMode=t}sourceRectAtTime(){throw Error(`${this.constructor.name}: Method sourceRectAtTime is not implemented`)}constructor(){this.baseElement=null,this.dynamicProperties=[],this.frameDuration=1,this.itemsData=[],this.layerElement=null,this.layerInterface=null,this.renderedFrame=-1,this.shapesData=[]}}class ec extends tH{constructor(t,e,s){if(super(),this.appliedTransformations=0,this.pre=new tm,this.defaultVector=[0,0],this.elem=t,this.frameId=-1,this.propType=tn.Transform,this.data=e,this.v=new tm,this.initDynamicPropertyContainer(s??t),e.p&&"s"in e.p?(this.px=tZ.getProp(t,e.p.x,0,0,this),this.py=tZ.getProp(t,e.p.y,0,0,this),"z"in e.p&&(this.pz=tZ.getProp(t,e.p.z,0,0,this))):this.p=tZ.getProp(t,e.p??{k:[0,0,0]},1,0,this),"rx"in e){if(this.rx=tZ.getProp(t,e.rx,0,$,this),this.ry=tZ.getProp(t,e.ry,0,$,this),this.rz=tZ.getProp(t,e.rz,0,$,this),e.or?.k[0]?.ti){const{length:t}=e.or.k;for(let s=0;s<t;s++){const t=e.or.k[s];t&&(t.to=null,t.ti=null)}}this.or=tZ.getProp(t,e.or,1,$,this),this.or.sh=!0}else this.r=tZ.getProp(t,e.r??{k:0},0,$,this);e.sk&&(this.sk=tZ.getProp(t,e.sk,0,$,this),this.sa=tZ.getProp(t,e.sa,0,$,this)),this.a=tZ.getProp(t,e.a??{k:[0,0,0]},1,0,this),this.s=tZ.getProp(t,e.s??{k:[100,100,100]},1,.01,this),e.o?this.o=tZ.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,0===this.dynamicProperties.length&&this.getValue(!0)}addDynamicProperty(t){super.addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}applyToMatrix(t){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);this.iterateDynamicProperties(),this._mdf=!!this._mdf,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.r?t.rotate(-this.r.v):t.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(Number(this.or?.v[1])).rotateX(Number(this.or?.v[0])),this.data.p&&"s"in this.data.p?"z"in this.data.p?t.translate(Number(this.px?.v),Number(this.py?.v),-Number(this.pz?.v)):t.translate(Number(this.px?.v),Number(this.py?.v),0):t.translate(Number(this.p?.v[0]),Number(this.p?.v[1]),-Number(this.p?.v[2]))}autoOrient(){throw Error(`${this.constructor.name}: Method autoOrient not implemented`)}getValue(t){if(this.elem.globalData?.frameId===this.frameId)return 0;if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(Number(this.or?.v[1])).rotateX(Number(this.or?.v[0])),this.autoOriented){let t,e,{frameRate:s}=this.elem.globalData??{frameRate:60};if(this.p?.keyframes)Number(this.p._caching?.lastFrame)+this.p.offsetTime<=(this.p.keyframes[0]?.t??0)?(t=this.p.getValueAtTime(((this.p.keyframes[0]?.t??0)+.01)/s,0),e=this.p.getValueAtTime(Number(this.p.keyframes[0]?.t)/s,0)):Number(this.p._caching?.lastFrame)+this.p.offsetTime>=(this.p.keyframes[this.p.keyframes.length-1]?.t??0)?(t=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1]?.t??0)/s,0),e=this.p.getValueAtTime(((this.p.keyframes[this.p.keyframes.length-1]?.t??0)-.05)/s,0)):(t=this.p.pv,e=this.p.getValueAtTime((Number(this.p._caching?.lastFrame)+this.p.offsetTime-.01)/s,this.p.offsetTime));else if(this.px?.keyframes&&this.py?.keyframes){t=[0,0],e=[0,0];let{px:i,py:r}=this,{keyframes:a=[]}=i,{keyframes:n=[]}=r;Number(i._caching?.lastFrame)+i.offsetTime<=(a[0]?.t??0)?(t[0]=i.getValueAtTime(((a[0]?.t??0)+.01)/s,0),t[1]=r.getValueAtTime(((n[0]?.t??0)+.01)/s,0),e[0]=i.getValueAtTime((a[0]?.t??0)/s,0),e[1]=r.getValueAtTime(Number(n[0]?.t)/s,0)):Number(i._caching?.lastFrame)+i.offsetTime>=(a[a.length-1]?.t??0)?(t[0]=i.getValueAtTime((a[a.length-1]?.t??0)/s,0),t[1]=r.getValueAtTime((n[n.length-1]?.t??0)/s,0),e[0]=i.getValueAtTime(((a[a.length-1]?.t??0)-.01)/s,0),e[1]=r.getValueAtTime(((n[n.length-1]?.t??0)-.01)/s,0)):(t=[i.pv,r.pv],e[0]=i.getValueAtTime((Number(i._caching?.lastFrame)+i.offsetTime-.01)/s,i.offsetTime),e[1]=r.getValueAtTime((Number(r._caching?.lastFrame)+r.offsetTime-.01)/s,r.offsetTime))}else t=e=this.defaultVector;this.v.rotate(-Math.atan2(t[1]-e[1],t[0]-e[0]))}this.data.p&&"s"in this.data.p?"z"in this.data.p?this.v.translate(Number(this.px?.v),Number(this.py?.v),-Number(this.pz?.v)):this.v.translate(Number(this.px?.v),Number(this.py?.v),0):this.p&&this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}return this.frameId=this.elem.globalData?.frameId,0}precalculateMatrix(){if(this.appliedTransformations=0,this.pre.reset(),!this.a?.effectsSequence.length){if(!this.a)throw Error(`${this.constructor.name}: Cannot read 'a' value`);if(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s?.effectsSequence.length){if(!this.s)throw Error(`${this.constructor.name}: Cannot read 's' value`);if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length>0||this.sa?.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.appliedTransformations=3}if(this.r){0===this.r.effectsSequence.length&&(this.pre.rotate(-this.r.v),this.appliedTransformations=4);return}this.rz?.effectsSequence.length||this.ry?.effectsSequence.length||this.rx?.effectsSequence.length||this.or?.effectsSequence.length||(this.pre.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(this.or?.v[1]).rotateX(this.or?.v[0]),this.appliedTransformations=4)}}}}let ed={getTransformProperty:(t,e,s)=>new ec(t,e,s)};class eu extends em{globalToLocal(t){let e,s=t,i=[this.finalTransform],r=!0,{comp:a}=this;for(;r;)a?.finalTransform?(a.data?.hasMask&&i.splice(0,0,a.finalTransform),a=a.comp):r=!1;let{length:n}=i;for(let t=0;t<n;t++)e=i[t]?.mat.applyToPointArray(0,0,0),s=[s[0]-Number(e?.[0]),s[1]-Number(e?.[1]),0];return s}initTransform(){if(!this.data)throw Error(`${this.constructor.name}: LottiePlayer is not initialized`);let t=new tm;this.finalTransform={_localMatMdf:!1,_matMdf:!1,_opMdf:!1,localMat:t,localOpacity:1,mat:t,mProp:this.data.ks?ed.getTransformProperty(this,this.data.ks,this):{o:0}},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0)}renderLocalTransform(){if(!this.localTransforms)return;if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not initialized`);let t=0,{length:e}=this.localTransforms;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;t<e;)this.localTransforms[t]?._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[t]?._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=Number(this.finalTransform.mProp.o?.v),this.finalTransform._opMdf=!0),t++;if(this.finalTransform._localMatMdf){let{localMat:s,mat:i}=this.finalTransform;for(this.localTransforms[0]?.matrix?.clone(s),t=1;t<e;t++){let e=this.localTransforms[t]?.matrix;e&&s.multiply(e)}s.multiply(i)}if(this.finalTransform._opMdf){let s=this.finalTransform.localOpacity;for(t=0;t<e;t++)s*=(this.localTransforms[t]?.opacity??1)*.01;this.finalTransform.localOpacity=s}}renderTransform(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not initialized`);this.finalTransform._opMdf=!!(this.finalTransform.mProp.o?._mdf||this._isFirstFrame),this.finalTransform._matMdf=!!(this.finalTransform.mProp._mdf||this._isFirstFrame);let t=this.finalTransform.mat,{length:e}=this.hierarchy,s=0;if(!this.finalTransform._matMdf)for(;s<e;){if(this.hierarchy[s]?.finalTransform?.mProp._mdf){this.finalTransform._matMdf=!0;break}s++}if(this.finalTransform._matMdf){let i=this.finalTransform.mProp.v.props;for(t.cloneFromProps(i),s=0;s<e;s++)if(this.hierarchy[s]?.finalTransform?.mProp.v){let{v:e}=this.hierarchy[s]?.finalTransform?.mProp??{v:null};e&&t.multiply(e)}}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=Number(this.finalTransform.mProp.o?.v))}searchEffectTransforms(){if(!this.renderableEffectsManager)return;let t=this.renderableEffectsManager.getEffects(ta.TransformEffect);if(0===t.length)return;this.localTransforms=[],this.finalTransform&&(this.finalTransform.localMat=new tm);let{length:e}=t;for(let s=0;s<e;s++)this.localTransforms.push(t[s])}constructor(...t){super(...t),this._isFirstFrame=!1,this.hierarchy=[],this.localTransforms=null,this.mHelper=new tm}}class ef extends eu{checkParenting(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.comp)throw Error(`${this.constructor.name}: comp (ElementInterface) is not implemented`);void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}initHierarchy(){this.hierarchy=[],this._isParent=!1,this.checkParenting()}setAsParent(){this._isParent=!0}setHierarchy(t){this.hierarchy=t}constructor(...t){super(...t),this._isParent=!1}}class eg extends ef{addDynamicProperty(t){this.dynamicProperties.includes(t)||this.dynamicProperties.push(t)}initFrame(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1}prepareProperties(t,e){let{length:s}=this.dynamicProperties;for(let t=0;t<s;t++)(e||this._isParent&&this.dynamicProperties[t]?.propType===tn.Transform)&&(this.dynamicProperties[t]?.getValue(),this.globalData&&this.dynamicProperties[t]?._mdf&&(this.globalData._mdf=!0,this._mdf=!0))}constructor(...t){super(...t),this._mdf=!1,this.displayStartTime=0}}class ey extends eg{addRenderableComponent(t){this.renderableComponents.includes(t)||this.renderableComponents.push(t)}checkLayerLimits(t){if(this.data&&this.globalData){if(this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t){this.isInRange||(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show());return}this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())}}checkTransparency(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not implemented`);if(0>=Number(this.finalTransform.mProp.o?.v)){!this.isTransparent&&(this.globalData?.renderConfig).hideOnTransparent&&(this.isTransparent=!0,this.hide());return}this.isTransparent&&(this.isTransparent=!1,this.show())}getLayerSize(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);return 5===this.data.ty?{h:Number(this.data.textData?.height),w:Number(this.data.textData?.width)}:{h:Number(this.data.height),w:Number(this.data.width)}}hide(){}initRenderable(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]}prepareRenderableFrame(t,e){this.checkLayerLimits(t)}removeRenderableComponent(t){this.renderableComponents.includes(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)}renderRenderable(){let{length:t}=this.renderableComponents;for(let e=0;e<t;e++)this.renderableComponents[e]?.renderFrame(Number(this._isFirstFrame))}show(){throw Error(`${this.constructor.name}: Method show is not implemented`)}sourceRectAtTime(){return{height:100,left:0,top:0,width:100}}constructor(...t){super(...t),this.hidden=!1,this.isInRange=!1,this.isTransparent=!1,this.renderableComponents=[]}}let eb=new class{constructor(){if(this.maskType=!0,this.offscreenCanvas="u">typeof OffscreenCanvas,this.svgLumaHidden=!0,!V)return;this.maskType=!/MSIE 10/i.test(navigator.userAgent)&&!/MSIE 9/i.test(navigator.userAgent)&&!/rv:11.0/i.test(navigator.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent),this.svgLumaHidden=!/firefox/i.test(navigator.userAgent)}};function ev(t){return B?null:document.createElement(t)}let e_="__lottie_element_luma_buffer",ex=null,ew=null,eE=null;function eC(){if(!ex||!ew){let t,e,s;t=tc("svg"),e=tc("filter"),s=tc("feColorMatrix"),e.id=e_,s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),e.appendChild(s),t.appendChild(e),t.id=`${e_}_svg`,eb.svgLumaHidden&&(t.style.display="none"),eE=t,document.body.appendChild(eE),(ew=(ex=ev("canvas")).getContext("2d"))&&(ew.filter=`url(#${e_})`,ew.fillStyle="rgba(0,0,0,0)",ew.fillRect(0,0,1,1))}}let eS=function(t,e){if(eb.offscreenCanvas)return new OffscreenCanvas(t,e);let s=ev("canvas");return s.width=t,s.height=e,s},ek=function(t){if(ex&&ew||eC(),!ex||!ew)throw Error("Could not create Canvas Element");return ex.width=t.width,ex.height=t.height,ew.filter=`url(#${e_})`,ex},eM={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};class eP extends ey{clearCanvas(t){if(!this.transformCanvas)throw Error(`${this.constructor.name}: transformCanvas is not implemented`);t?.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)}createContainerElements(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.globalData.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented in globalData`);if(this.data.tt&&this.data.tt>=1){this.buffers=[];let{canvasContext:t}=this.globalData,e=eS(t.canvas.width,t.canvas.height);this.buffers.push(e);let s=eS(t.canvas.width,t.canvas.height);this.buffers.push(s),this.data.tt>=3&&!document._isProxy&&eC()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new tg(this),this.searchEffectTransforms()}createContent(){}createElements(){throw Error(`${this.constructor.name}: createElements is not implemented`)}createRenderableComponents(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.maskManager=new t4(this.data,this),this.renderableEffectsManager&&(this.transformEffects=this.renderableEffectsManager.getEffects(ta.TransformEffect))}destroy(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager?.destroy()}exitLayer(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);let t=this.data.tt||0;if(t<1)return;let e=this.buffers[1],s=e?.getContext("2d");this.clearCanvas(s),s.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);let i=Number(this.data.ind)-1;"tp"in this.data&&void 0!==this.data.tp&&(i=this.data.tp);let r=this.comp?.getElementById(i);if(r?.renderFrame(1),this.canvasContext.setTransform(1,0,0,1,0,0),t>=3&&!document._isProxy){let t=ek(this.canvasContext.canvas),e=t.getContext("2d");e?.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(t,0,0)}this.canvasContext.globalCompositeOperation=eM[t],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}hideElement(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)}initRendererElement(){}prepareLayer(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);if(1>(this.data.tt||0))return;let t=this.buffers[0],e=t?.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}renderFrame(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.hidden||this.data.hd||1===this.data.td&&!t)return;this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();let e=0===this.data.ty;this.prepareLayer();let{renderer:s}=this.globalData;s.save(e),s.ctxTransform(this.finalTransform?.localMat.props),s.ctxOpacity(this.finalTransform?.localOpacity),this.renderInnerContent(),s.restore(e),this.exitLayer(),this.maskManager?.hasMasks&&s.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}renderInnerContent(){throw Error("Method is not implemented")}setBlendMode(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let{data:t,globalData:e}=this;if(!e.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented in globalData`);if(e.blendMode!==t.bm){e.blendMode=t.bm;let s=ep(t.bm);e.canvasContext.globalCompositeOperation=s}}showElement(){if(!this.maskManager)throw Error(`${this.constructor.name}: Method maskManager is not implemented`);this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)}constructor(...t){super(...t),this.buffers=[],this.maskManager=void 0,this.renderableEffectsManager=void 0,this.transformEffects=[]}}eP.prototype.hide=eP.prototype.hideElement,eP.prototype.show=eP.prototype.showElement;class eA extends ey{createContainerElements(){throw Error(`${this.constructor.name}: Method createContainerElements is not implemented`)}createContent(){throw Error(`${this.constructor.name}: Method createContent is not implemented`)}createRenderableComponents(){throw Error(`${this.constructor.name}: Method createRenderableComponents is not implemented`)}destroy(){this.innerElem=null,this.destroyBaseElement()}hide(){if(this.hidden||this.isInRange&&!this.isTransparent)return;let t=this.baseElement??this.layerElement;t&&(t.style.display="none"),this.hidden=!0}initElement(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()}initRendererElement(){throw Error(`${this.constructor.name}: Method initRendererElement is not implemented`)}prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()}renderElement(){throw Error(`${this.constructor.name}: Method renderElement is not implemented`)}renderFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))}renderInnerContent(){throw Error(`${this.constructor.name}: Method renderInnerContent is not implemented`)}show(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.isInRange||!this.isTransparent){if(!this.data.hd){let t=this.baseElement??this.layerElement;if(!t)throw Error(`${this.constructor.name}: Neither baseElement or layerElement is implemented`);t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}}constructor(...t){super(...t),this.innerElem=null}}class eD extends eA{destroy(){this.destroyElements(),this.destroyBaseElement()}destroyElements(){let{length:t}=this.layers;for(let e=0;e<t;e++)this.elements[e]?.destroy()}getElements(){return this.elements}initElement(t,e,s){if(this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);(this.data.xt||!e.progressiveLoad)&&this.buildAllItems(),this.hide()}prepareFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),!this.isInRange&&!this.data.xt)return;if(this.tm?._placeholder)this.renderedFrame=t/Number(this.data.sr);else{let t=this.tm?.v||0;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}let{length:e}=this.elements;this.completeLayers||this.checkLayers(this.renderedFrame);for(let t=e-1;t>=0;t--)(this.completeLayers||this.elements[t])&&(this.elements[t]?.prepareFrame(this.renderedFrame-(this.layers[t]?.st??0)),this.elements[t]?._mdf&&(this._mdf=!0))}renderInnerContent(){let{length:t}=this.layers;for(let e=0;e<t;e++)(this.completeLayers||this.elements[e])&&this.elements[e]?.renderFrame()}setElements(t){this.elements=t}constructor(...t){super(...t),this.currentFrame=0,this.elements=[],this.layers=[]}}function eT(t,e,s,i){if(0===e)return"";let r=t.o,a=t.i,n=t.v,o,h=[n[0]?.[0]??0,n[0]?.[1]??0],l=i.applyToPointStringified(...h),p,m,c,d,u=` M${l}`;for(o=1;o<e;o++)c=[r[o-1]?.[0]??0,r[o-1]?.[1]??0],d=i.applyToPointStringified(...c),p=[a[o]?.[0]??0,a[o]?.[1]??0],m=i.applyToPointStringified(...p),h=[n[o]?.[0]??0,n[o]?.[1]??0],l=i.applyToPointStringified(...h),u+=` C${d} ${m} ${l}`;return s&&(c=[r[o-1]?.[0]??0,r[o-1]?.[1]??0],d=i.applyToPointStringified(...c),p=[a[0]?.[0]??0,a[0]?.[1]??0],m=i.applyToPointStringified(...p),h=[n[0]?.[0]??0,n[0]?.[1]??0],l=i.applyToPointStringified(...h),u+=` C${d} ${m} ${l}z`),u}class eF{constructor(t,e,s){this.maskElement=null,this.masksProperties=[],this.solidPath="",this.storedData=[],this._identityMat=new tm,this.data=t,this.element=e,this.globalData=s,this.masksProperties=this.data.masksProperties??[];const{defs:i}=this.globalData,{length:r}=this.masksProperties;this.viewData=tp(r);const a=this.masksProperties;let n=0;const o=[],h=v();let l,p,m,c="clipPath",d="clip-path";for(let t=0;t<r;t++){let e;(a[t]?.mode!=="a"&&a[t]?.mode!=="n"||a[t]?.inv||a[t]?.o?.k!==100||a[t]?.o?.x)&&(c="mask",d="mask"),(a[t]?.mode==="s"||a[t]?.mode==="i")&&0===n?((l=tc("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",`${Number(this.element.comp?.data?.w)}`),l.setAttribute("height",`${Number(this.element.comp?.data?.h)}`),o.push(l)):l=null;const s=tc("path");if(a[t]?.mode==="n"){this.viewData[t]={elem:s,lastPath:"",op:tZ.getProp(this.element,a[t]?.o,0,.01,this.element),prop:t5.getShapeProp(this.element,a[t],3)},i.appendChild(s);continue}if(n++,s.setAttribute("fill",a[t]?.mode==="s"?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),a[t]?.x?.k===0)p=null,m=null;else{c="mask",d="mask",m=tZ.getProp(this.element,a[t]?.x,0,null,this.element),e=v();const r=tc("filter");r.id=e,(p=tc("feMorphology")).setAttribute("operator","erode"),p.setAttribute("in","SourceGraphic"),p.setAttribute("radius","0"),r.appendChild(p),i.appendChild(r),s.setAttribute("stroke",a[t]?.mode==="s"?"#000000":"#ffffff")}if(this.storedData[t]={elem:s,expan:p,filterId:e,lastOperator:"",lastPath:"",lastRadius:0,x:m},a[t]?.mode==="i"){const{length:t}=o,e=tc("g");for(let s=0;s<t;s++)e.appendChild(o[s]);const r=tc("mask");r.setAttribute("mask-type","alpha"),r.id=`${h}_${n}`,r.appendChild(s),i.appendChild(r),e.setAttribute("mask",`url(${tu()}#${h}_${n})`),o.length=0,o.push(e)}else o.push(s);a[t]?.inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[t]={elem:s,invRect:l,lastPath:"",op:tZ.getProp(this.element,a[t]?.o,0,.01,this.element),prop:t5.getShapeProp(this.element,a[t],3)};const r=this.viewData[t]?.prop?.v;!this.viewData[t]?.prop?.k&&r&&this.drawPath(a[t]??null,r,this.viewData[t])}this.maskElement=tc(c);const{length:u}=o;for(let t=0;t<u;t++)this.maskElement.appendChild(o[t]);n>0&&(this.maskElement.id=h,this.element.maskedElement?.setAttribute(d,`url(${tu()}#${h})`),i.appendChild(this.maskElement)),this.viewData.length>0&&this.element.addRenderableComponent(this)}createLayerSolidPath(){let t="M0,0 ";return t+` h${this.globalData.compSize?.w||0} v${this.globalData.compSize?.h||0} h-${this.globalData.compSize?.w||0} v-${this.globalData.compSize?.h||0} `}destroy(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null}drawPath(t,e,s){let i=e._length,r=eT(e,i,e.c,this._identityMat);if(s.lastPath!==r){let i="";e.c&&(i=t?.inv?this.solidPath+r:r),s.elem.setAttribute("d",i),s.lastPath=r}}getMaskelement(){return this.maskElement}getMaskProperty(t){return this.viewData[t]?.prop??null}renderFrame(t){let e=this.element.finalTransform?.mat,{length:s}=this.masksProperties;for(let i=0;i<s;i++){let s=this.viewData[i]?.prop?.v;if(s&&(this.viewData[i]?.prop?._mdf||t)&&this.drawPath(this.masksProperties[i]??null,s,this.viewData[i]),(this.viewData[i]?.op._mdf||t)&&this.viewData[i]?.elem.setAttribute("fill-opacity",`${this.viewData[i]?.op.v??1}`),this.masksProperties[i]?.mode==="n")continue;this.viewData[i]?.invRect&&(this.element.finalTransform?.mProp._mdf||t)&&e&&this.viewData[i]?.invRect?.setAttribute("transform",e.getInverseMatrix().to2dCSS());let r=this.storedData[i];if(!r?.x||!(r.x._mdf||t))continue;let a=r.expan;if(r.x.v<0){"erode"!==r.lastOperator&&(r.lastOperator="erode",r.elem.setAttribute("filter",`url(${tu()}#${r.filterId})`)),a?.setAttribute("radius",`${-r.x.v}`);continue}"dilate"!==r.lastOperator&&(r.lastOperator="dilate",r.elem.removeAttribute("filter")),r.elem.setAttribute("stroke-width",`${2*r.x.v}`)}}}let eI=function(){let t=tc("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t},e$=function(t,e){let s=tc("filter");return s.id=t,e||(s.setAttribute("filterUnits","objectBoundingBox"),s.setAttribute("x","0%"),s.setAttribute("y","0%"),s.setAttribute("width","100%"),s.setAttribute("height","100%")),s},eL="filter_result_",eN={};class eB{constructor(t){this.filters=[];let e="SourceGraphic";const s=v(),i=e$(s,!0);let r=0,a;const{length:n}=t.data.ef??[];for(let s=0;s<n;s++){a=null;const{ty:n}=t.data.ef?.[s]??{ty:null},o=null!==n&&eN[n]?eN[n].effect:null;o&&n&&t.effectsManager&&(a=new o(i,t.effectsManager.effectElements[s],t,`${eL}${r}`,e),e=`${eL}${r}`,eN[n]?.countsAsEffect&&r++),a&&this.filters.push(a)}r&&(t.globalData?.defs.appendChild(i),t.layerElement?.setAttribute("filter",`url(${tu()}#${s})`)),this.filters.length>0&&t.addRenderableComponent(this)}getEffects(t){let{length:e}=this.filters,s=[];for(let i=0;i<e;i++)this.filters[i]?.type===t&&s.push(this.filters[i]);return s}renderFrame(t){let{length:e}=this.filters;for(let s=0;s<e;s++)this.filters[s]?.renderFrame(t)}}class eV extends eA{createContainerElements(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);this.matteElement=tc("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;let t=null;if(this.data.td){this.matteMasks={};let e=tc("g");this.layerId&&(e.id=this.layerId),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&(this.layerElement.id=this.data.ln),this.data.cl&&this.layerElement.classList.add(this.data.cl),0===this.data.ty&&!this.data.hd){let e=tc("clipPath"),s=tc("path");s.setAttribute("d",`M0,0 L${this.data.w},0 L${this.data.w},${this.data.h} L0,${this.data.h}z`);let i=v();if(e.id=i,e.appendChild(s),this.globalData.defs.appendChild(e),this.checkMasks()){let e=tc("g");e.setAttribute("clip-path",`url(${tu()}#${i})`),e.appendChild(this.layerElement),this.transformedElement=e,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path",`url(${tu()}#${i})`)}0!==this.data.bm&&this.setBlendMode()}createRenderableComponents(){if(!this.data)throw Error(`${this.constructor.name}: layerData is not initialized`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not initialized`);this.maskManager=new eF(this.data,this,this.globalData),this.renderableEffectsManager=new eB(this),this.searchEffectTransforms()}destroyBaseElement(){this.layerElement=null,this.matteElement=null,this.maskManager?.destroy()}getBaseElement(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);return this.data.hd?null:this.baseElement??null}getMatte(t=1){let e,s,i,r;if(this.matteMasks=this.matteMasks??{},this.matteMasks[t])return this.matteMasks[t];let a=`${this.layerId}_${t}`;switch(t){case 1:case 3:{let n=tc("mask");if(n.id=a,n.setAttribute("mask-type",3===t?"luminance":"alpha"),(i=tc("use")).setAttributeNS(L,"href",`#${this.layerId}`),n.appendChild(i),this.globalData?.defs.appendChild(n),eb.maskType||1!==t)break;n.setAttribute("mask-type","luminance"),s=e$(e=v()),this.globalData?.defs.appendChild(s),s.appendChild(eI()),(r=tc("g")).appendChild(i),n.appendChild(r),r.setAttribute("filter",`url(${tu()}#${e})`)}break;case 2:{let t=tc("mask");t.id=a,t.setAttribute("mask-type","alpha");let n=tc("g");t.appendChild(n),s=e$(e=v());let o=tc("feComponentTransfer");o.setAttribute("in","SourceGraphic"),s.appendChild(o);let h=tc("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData?.defs.appendChild(s);let l=tc("rect");l.width.baseVal.value=this.comp?.data?.w||0,l.height.baseVal.value=this.comp?.data?.h||0,l.x.baseVal.value=0,l.y.baseVal.value=0,l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter",`url(${tu()}#${e})`),n.appendChild(l),(i=tc("use")).setAttributeNS(L,"href",`#${this.layerId}`),n.appendChild(i),eb.maskType||(t.setAttribute("mask-type","luminance"),s.appendChild(eI()),r=tc("g"),n.appendChild(l),this.layerElement&&r.appendChild(this.layerElement),n.appendChild(r)),this.globalData?.defs.appendChild(t)}}return this.matteMasks[t]=a,this.matteMasks[t]}initRendererElement(){this.layerElement=tc("g")}renderElement(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not implemented`);this.finalTransform._localMatMdf&&this.transformedElement?.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement?.setAttribute("opacity",`${this.finalTransform.localOpacity}`)}setMatte(t){this.matteElement&&this.matteElement.setAttribute("mask",`url(${tu()}#${t})`)}}class eR extends eV{constructor(t,e,s){super(),this.layers=[],t.refId&&(this.assetData=e.getAssetData(t.refId)),this.assetData?.sid&&(this.assetData=e.slotManager?.getProp(this.assetData)||null),this.initElement(t,e,s),this.sourceRect={height:Number(this.assetData?.h),left:0,top:0,width:Number(this.assetData?.w)}}createContent(){let t="";this.assetData&&this.globalData?.getAssetsPath&&(t=this.globalData.getAssetsPath(this.assetData)),this.assetData&&(this.innerElem=tc("image"),this.innerElem.setAttribute("width",`${this.assetData.w}px`),this.innerElem.setAttribute("height",`${this.assetData.h}px`),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData?.renderConfig?.imagePreserveAspectRatio||""),this.innerElem.setAttributeNS(L,"href",t),this.layerElement?.appendChild(this.innerElem))}renderInnerContent(){}sourceRectAtTime(){return this.sourceRect}}class eO{constructor(){this.gr=tc("g"),this.it=[],this.prevViewData=[]}}let ez=new tm,eG=new tm;function eq(t,e,s){if(!e)throw Error("SVGElementsRenderer: Method renderContetTransform is missing data");(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",`${e.transform.op.v}`),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function ej(t,e,s){if(!e)throw Error("SVGElementsRenderer: Method renderFill is missing data");let i=e.style;e.c?.v&&(e.c._mdf||s)&&i.pElem.setAttribute("fill",I(e.c.v)),(e.o?._mdf||s)&&i.pElem.setAttribute("fill-opacity",`${e.o?.v}`)}function eH(t,e,s){let i,r;if(!e)throw Error("SVGElementsRenderer: Method renderGradient is missing data");let a=e.gf,n=e.g?._hasOpacity,o=e.s?.v??[0,0],h=e.e?.v??[0,0];if(e.o?._mdf||s){let s=t.ty===tr.GradientFill?"fill-opacity":"stroke-opacity";e.style?.pElem.setAttribute(s,`${e.o?.v}`)}if(e.s?._mdf||s){let s=1===t.t?"x1":"cx",i="x1"===s?"y1":"cy";a?.setAttribute(s,`${o[0]}`),a?.setAttribute(i,`${o[1]}`),n&&!e.g?._collapsable&&(e.of?.setAttribute(s,`${o[0]}`),e.of?.setAttribute(i,`${o[1]}`))}if(e.g&&(e.g._cmdf||s)){i=e.cst;let t=e.g.c,{length:s}=i;for(let e=0;e<s;e++)(r=i[e]).setAttribute("offset",`${t[4*e]}%`),r.setAttribute("stop-color",`rgb(${t[4*e+1]},${t[4*e+2]},${t[4*e+3]})`)}if(n&&e.g&&(e.g._omdf||s)){let t=e.g.o,{length:s}=i=e.g._collapsable?e.cst:e.ost;for(let a=0;a<s;a++)r=i[a],e.g._collapsable||r.setAttribute("offset",`${t[2*a]}%`),r.setAttribute("stop-opacity",`${t[2*a+1]}`)}if(1===t.t)(e.e?._mdf||s)&&(a?.setAttribute("x2",`${h[0]}`),a?.setAttribute("y2",`${h[1]}`),n&&!e.g?._collapsable&&(e.of?.setAttribute("x2",`${h[0]}`),e.of?.setAttribute("y2",`${h[1]}`)));else{let t=0;if((e.s?._mdf||e.e?._mdf||s)&&(t=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)),a?.setAttribute("r",`${t}`),n&&!e.g?._collapsable&&e.of?.setAttribute("r",`${t}`)),e.e?._mdf||e.h?._mdf||e.a?._mdf||s){t||(t=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)));let s=Math.atan2(h[1]-o[1],h[0]-o[0]),i=Number(e.h?.v);i>=1?i=.99:i<=-1&&(i=-.99);let r=t*i,l=Math.cos(s+Number(e.a?.v))*r+o[0],p=Math.sin(s+Number(e.a?.v))*r+o[1];a?.setAttribute("fx",`${l}`),a?.setAttribute("fy",`${p}`),n&&!e.g?._collapsable&&(e.of?.setAttribute("fx",`${l}`),e.of?.setAttribute("fy",`${p}`))}}}function eW(t,e,s){eH(t,e,s),eJ(t,e,s)}function eY(t){}function eU(t,e,s){let i,r,a,n,o,h,l;if(!e)throw Error("SVGElementsRenderer: Method renderPath is missing data");let{caches:p,lvl:m,sh:c,styles:d,transformers:u}=e,{length:f}=d;for(let e=0;e<f;e++){r=c?._mdf||!!s;let f=d[e],{lvl:g}=f??{lvl:0};if(g<m){for(o=eG.reset(),h=m-g,l=u.length-1;!r&&h>0;)r=u[l]?.mProps._mdf||r,h--,l--;if(r)for(h=m-g,l=u.length-1;h>0;)o.multiply(u[l]?.mProps.v),h--,l--}else o=ez;n=c?.paths;let y=n?._length||0;if(r){i="";for(let t=0;t<y;t++)a=n?.shapes[t],a?._length&&(i+=eT(a,a._length,a.c,o));p[e]=i}else i=p[e];f&&(f.d+=!0===t.hd?"":i??"",f._mdf=r||f._mdf)}}function eJ(t,e,s){if(!e?.style)throw Error("SVGElementsRenderer: Method renderStroke is missing data");let{c:i,d:r,o:a,style:{msElem:n,pElem:o},w:h}=e;r&&(r._mdf||s)&&r.dashStr&&(o.setAttribute("stroke-dasharray",r.dashStr),o.setAttribute("stroke-dashoffset",`${r.dashoffset[0]}`)),i&&(i._mdf||s)&&o.setAttribute("stroke",I(i.v)),(a?._mdf||s)&&o.setAttribute("stroke-opacity",`${a?.v??1}`),(h?._mdf||s)&&(o.setAttribute("stroke-width",`${h?.v||0}`),n?.setAttribute("stroke-width",`${h?.v||0}`))}class eX extends tq{constructor(t,e,s){super(),this.it=[],this.prevViewData=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=tZ.getProp(t,e.o,0,.01,this),this.c=tZ.getProp(t,e.c,1,255,this),this.style=s}}class eZ extends tq{constructor(t,e,s){super(),this._cmdf=!1,this._omdf=!1,this.data=e,this.c=tl(K.Uint8c,4*e.p);const i=e.k.k?.[0]?.s?(e.k.k[0]?.s.length??0)-4*e.p:e.k.k.length-4*e.p;this.o=tl(K.Float32,i),this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=tZ.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}checkCollapsable(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k?.[0]?.s){let t=0,e=this.data.k.k.length;for(;t<e;){if(!this.comparePoints(this.data.k.k[t]?.s??[],this.data.p))return!1;t++}}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0}comparePoints(t,e){let s=0,i=this.o.length/2;for(;s<i;){if(Math.abs((t[4*s]??0)-(t[4*e+2*s]??0))>.01)return!1;s++}return!0}getValue(t){let e,s;if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,!this.prop._mdf&&!t||!M(this.prop.v))return 0;let i=4*this.data.p;for(let r=0;r<i;r++)e=r%4==0?100:255,s=Math.round((this.prop.v[r]??0)*e),this.c[r]!==s&&(this.c[r]=s,this._cmdf=!t);if(this.o.length>0){let{length:e}=this.prop.v;for(let i=4*this.data.p;i<e;i++)s=(i%2==0?Math.round((this.prop.v[i]??0)*100):this.prop.v[i])??0,this.o[i-4*this.data.p]!==s&&(this.o[i-4*this.data.p]=s,this._omdf=!t)}return this._mdf=!t,0}}class eK extends tq{constructor(t,e,s){super(),this.cst=[],this.it=[],this.ost=[],this.prevViewData=[],this.stops=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}initGradientData(t,e,s){this.o=tZ.getProp(t,e.o,0,.01,this),this.s=tZ.getProp(t,e.s,1,null,this),this.e=tZ.getProp(t,e.e,1,null,this),this.h=tZ.getProp(t,e.h??{k:0},0,.01,this),this.a=tZ.getProp(t,e.a??{k:0},0,$,this),this.g=new eZ(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated}setGradientData(t,e){let s,i=v(),r=tc(1===e.t?"linearGradient":"radialGradient");r.id=i,r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");let a=[],n=4*(e.g?.p||1);for(let t=0;t<n;t+=4)s=tc("stop"),r.appendChild(s),a.push(s);t.setAttribute(e.ty===tr.GradientFill?"fill":"stroke",`url(${tu()}#${i})`),this.gf=r,this.cst=a}setGradientOpacity(t,e){let s;if(!this.g?._hasOpacity||this.g._collapsable)return;let i=tc("mask"),r=tc("path");i.appendChild(r);let a=v(),n=v();i.id=n;let o=tc(1===t.t?"linearGradient":"radialGradient");o.id=a,o.setAttribute("spreadMethod","pad"),o.setAttribute("gradientUnits","userSpaceOnUse");let h=(t.g?.k.k?.[0]?.s?t.g?.k.k[0]?.s.length:t.g?.k.k.length)||0,{stops:l}=this;for(let e=4*(t.g?.p||1);e<h;e+=2)(s=tc("stop")).setAttribute("stop-color","rgb(255,255,255)"),o.appendChild(s),l.push(s);r.setAttribute(t.ty===tr.GradientFill?"fill":"stroke",`url(${tu()}#${a})`),t.ty===tr.GradientStroke&&(r.setAttribute("stroke-linecap",to[t.lc||2]),r.setAttribute("stroke-linejoin",th[t.lj||2]),1===t.lj&&r.setAttribute("stroke-miterlimit",`${Number(t.ml)}`)),this.of=o,this.ms=i,this.ost=l,this.maskId=n,e.msElem=r}}class eQ extends tq{constructor(t,e,s,i){let r;super(),this.dashoffset=tl(K.Float32,1),this.dashStr="",this.frameId=-1,this.k=!1,this.elem=t,this.dataProps=tp(e.length),this.renderer=s,this.dashArray=tl(K.Float32,e.length>0?e.length-1:0),this.initDynamicPropertyContainer(i);const a=e.length||0;for(let s=0;s<a;s++)r=tZ.getProp(t,e[s]?.v,0,0,this),this.k=r.k||this.k,this.dataProps[s]={n:e[s]?.n??"d",p:r};this.k||this.getValue(!0),this._isAnimated=this.k}getValue(t){if(this.elem.globalData?.frameId===this.frameId&&!t||(this.elem.globalData?.frameId&&(this.frameId=this.elem.globalData.frameId),this.iterateDynamicProperties(),this._mdf=this._mdf||!!t,!this._mdf))return 0;let e=this.dataProps.length;this.renderer===ti.SVG&&(this.dashStr="");for(let t=0;t<e;t++){if(this.dataProps[t]?.n==="o"){this.dashoffset[0]=this.dataProps[t]?.p.v;continue}if(this.renderer===ti.SVG){this.dashStr+=` ${this.dataProps[t]?.p.v}`;continue}this.dashArray[t]=this.dataProps[t]?.p.v}return 0}}class e0 extends eK{constructor(t,e,s){super(t,e,s),this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=tZ.getProp(t,e.w,0,null,this),this.d=new eQ(t,e.d||[],ti.SVG,this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}}class e1 extends tq{constructor(t,e,s){super(),this.it=[],this.prevViewData=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.style=s}}class e2{setAsAnimated(){this._isAnimated=!0}constructor(){this.caches=[],this.it=[],this.lStr="",this.lvl=0,this.pathsData=[],this.prevViewData=[],this.sh=null,this.styledShapes=[],this.styles=[],this.tr=[],this.transformers=[],this.trNodes=[]}}class e3 extends e2{constructor(t,e,s){super(),this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;let i=0;const{length:r}=t;for(;i<r;){if((t[i]?.mProps.dynamicProperties.length??0)>0){this._isAnimated=!0;break}i++}}}class e5 extends eX{constructor(t,e,s){super(t,e,s),this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=tZ.getProp(t,e.o,0,.01,this),this.w=tZ.getProp(t,e.w,0,null,this),this.d=new eQ(t,e.d||[],ti.SVG,this),this.c=tZ.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}}class e4{constructor(t,e){this._mdf=!1,this.d="",this.msElem=null,this.pElem=tc("path"),this.data=t,this.type=t.ty,this.lvl=e,this.closed=!0===t.hd}reset(){this.d="",this._mdf=!1}}class e6{constructor(t,e,s){this.elements=[],this.transform={container:s,mProps:t,op:e},this._isAnimated=this.transform.mProps.dynamicProperties.length>0||this.transform.op.effectsSequence.length>0}}class e8{constructor(t,e){this.elem=t,this.pos=e}}class e9 extends eA{addProcessedElement(t,e){let{processedElements:s}=this,i=s.length;for(;i;){let r=s[--i];if(r?.elem===t){r.pos=e;return}}s.push(new e8(t,e))}addShapeToModifiers(t){let{length:e}=this.shapeModifiers;for(let s=0;s<e;s++)this.shapeModifiers[s]?.addShape(t)}isShapeInAnimatedModifiers(t){let e=0,{length:s}=this.shapeModifiers;for(;e<s;){if(this.shapeModifiers[e]?.isAnimatedWithShape(t))return!0;e++}return!1}prepareFrame(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}renderModifiers(){if(0===this.shapeModifiers.length)return;let{length:t}=this.shapes;for(let e=0;e<t;e++)this.shapes[e]?.sh?.reset();let{length:e}=this.shapeModifiers;for(let t=e-1;t>=0&&!this.shapeModifiers[t]?.processShapes(!!this._isFirstFrame);t--);}searchProcessedElement(t){let{processedElements:e}=this,{length:s}=e,i=0;for(;i<s;){if(e[i]?.elem===t)return e[i]?.pos??0;i++}return 0}constructor(...t){super(...t),this.processedElements=[],this.shapeModifiers=[],this.shapes=[]}}let e7={};function st(t,e,s){if(!e7[t])throw Error("Invalid modifier");return new e7[t]}function se(t,e){e7[t]=e7[t]??e}class ss extends e9{constructor(t,e,s){super(),this.animatedContents=[],this.createContainerElements=eV.prototype.createContainerElements,this.createRenderableComponents=eV.prototype.createRenderableComponents,this.destroyBaseElement=eV.prototype.destroyBaseElement,this.getBaseElement=eV.prototype.getBaseElement,this.getMatte=eV.prototype.getMatte,this.identityMatrix=new tm,this.initRendererElement=eV.prototype.initRendererElement,this.prevViewData=[],this.renderElement=eV.prototype.renderElement,this.setMatte=eV.prototype.setMatte,this.stylesList=[],this.shapes=[],this.shapesData=t.shapes,this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.initElement(t,e,s)}addToAnimatedContents(t,e){let s=0,{length:i}=this.animatedContents;for(;s<i;){if(this.animatedContents[s]?.element===e)return;s++}this.animatedContents.push({data:t,element:e,fn:function(t){switch(t.ty){case tr.Fill:return ej;case tr.GradientFill:return eH;case tr.GradientStroke:return eW;case tr.Stroke:return eJ;case tr.Path:case tr.Ellipse:case tr.Rectangle:case tr.PolygonStar:return eU;case tr.Transform:return eq;case tr.NoStyle:return eY;default:return null}}(t)})}buildExpressionInterface(){}createContent(){if(!this.layerElement)throw Error(`${this.constructor.name}: Could not access Layer`);this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()}createGroupElement(t){let e=new eO;return t.ln&&(e.gr.id=t.ln),t.cl&&e.gr.classList.add(t.cl),t.bm&&(e.gr.style.mixBlendMode=ep(t.bm)),e}createShapeElement(t,e,s){let i=4;switch(t.ty){case tr.Rectangle:i=5;break;case tr.Ellipse:i=6;break;case tr.PolygonStar:i=7}let r=new e3(e,s,t5.getShapeProp(this,t,i));return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(t,r),r}createStyleElement(t,e){let s=null,i=new e4(t,e),r=i.pElem;switch(t.ty){case tr.Stroke:s=new e5(this,t,i);break;case tr.Fill:s=new eX(this,t,i);break;case tr.GradientFill:case tr.GradientStroke:(s=new(t.ty===tr.GradientFill?eK:e0)(this,t,i)).gf&&this.globalData?.defs.appendChild(s.gf),s.maskId&&s.ms&&s.of&&(this.globalData?.defs.appendChild(s.ms),this.globalData?.defs.appendChild(s.of),r.setAttribute("mask",`url(${tu()}#${s.maskId})`));break;case tr.NoStyle:s=new e1(this,t,i)}return(t.ty===tr.Stroke||t.ty===tr.GradientStroke)&&(r.setAttribute("stroke-linecap",to[t.lc||2]),r.setAttribute("stroke-linejoin",th[t.lj||2]),r.setAttribute("fill-opacity","0"),1===t.lj&&t.ml&&r.setAttribute("stroke-miterlimit",`${t.ml}`)),2===t.r&&r.setAttribute("fill-rule","evenodd"),t.ln&&(r.id=t.ln),t.cl&&r.classList.add(t.cl),t.bm&&(r.style.mixBlendMode=ep(t.bm)),this.stylesList.push(i),s&&this.addToAnimatedContents(t,s),s}createTransformElement(t,e){let s=ed.getTransformProperty(this,t,this);if(!s.o)throw Error(`${this.constructor.name}: Missing required data in TransformProperty`);let i=new e6(s,s.o,e);return this.addToAnimatedContents(t,i),i}destroy(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null}filterUniqueShapes(){let t,e,{length:s}=this.shapes,i=this.stylesList.length,r=[];for(let a=0;a<i;a++){t=this.stylesList[a],e=!1,r.length=0;for(let i=0;i<s;i++)this.shapes[i].styles.includes(t)&&(r.push(this.shapes[i]),e=this.shapes[i]?._isAnimated||e);r.length>1&&e&&this.setShapesAsAnimated(r)}}initSecondaryElement(){}reloadShapes(){if(!this.layerElement)throw Error(`${this.constructor.name}: Could not access layerElement`);this._isFirstFrame=!0;let{length:t}=this.itemsData;for(let e=0;e<t;e++)this.prevViewData[e]=this.itemsData[e];this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();let{length:e}=this.dynamicProperties;for(let t=0;t<e;t++)this.dynamicProperties[t]?.getValue();this.renderModifiers()}renderInnerContent(){this.renderModifiers();let{length:t}=this.stylesList;for(let e=0;e<t;e++)this.stylesList[e]?.reset();this.renderShape();for(let e=0;e<t;e++)(this.stylesList[e]?._mdf||this._isFirstFrame)&&(this.stylesList[e]?.msElem&&(this.stylesList[e]?.msElem?.setAttribute("d",this.stylesList[e]?.d??""),this.stylesList[e].d=`M0 0${this.stylesList[e]?.d??""}`),this.stylesList[e]?.pElem.setAttribute("d",this.stylesList[e]?.d||"M0 0"))}renderShape(){let{length:t}=this.animatedContents;for(let e=0;e<t;e++)(this._isFirstFrame||this.animatedContents[e]?.element._isAnimated)&&this.animatedContents[e]?.data!==!0&&this.animatedContents[e]?.fn&&this.animatedContents[e]?.fn?.(this.animatedContents[e]?.data,this.animatedContents[e]?.element,this._isFirstFrame)}searchShapes(t,e,s,i,r,a,n){let o,h,l=n,p=[...a],m=[],c=[],{length:d}=t;for(let a=d-1;a>=0;a--){let n=this.searchProcessedElement(t[a]);switch(n?e[a]=s[n-1]:t[a]._shouldRender=l,t[a]?.ty){case tr.Fill:case tr.Stroke:case tr.GradientFill:case tr.GradientStroke:case tr.NoStyle:if(n){let{style:t}=e[a]??{style:null};t&&(t.closed=!1)}else e[a]=this.createStyleElement(t[a],r);if(t[a]?._shouldRender&&e[a]?.style?.pElem.parentNode!==i){let{pElem:t}=e[a]?.style??{pElem:null};t&&i.appendChild(t)}m.push(e[a]?.style);break;case tr.Group:if(n){let{length:t}=e[a]?.it??[];for(let s=0;s<t;s++){let{it:t,prevViewData:i}=e[a]??{it:null,prevViewData:null};i&&t&&(i[s]=t[s])}}else e[a]=this.createGroupElement(t[a]);if(this.searchShapes(t[a]?.it,e[a]?.it??[],e[a]?.prevViewData??[],e[a]?.gr,r+1,p,l),t[a]?._shouldRender&&e[a]?.gr?.parentNode!==i){let{gr:t}=e[a]??{};t&&i.appendChild(t)}break;case tr.Transform:n||(e[a]=this.createTransformElement(t[a],i)),(o=e[a]?.transform)&&p.push(o);break;case tr.Path:case tr.Rectangle:case tr.Ellipse:case tr.PolygonStar:n||(e[a]=this.createShapeElement(t[a],p,r)),this.setElementStyles(e[a]);break;case tr.Trim:case tr.RoundedCorners:case tr.Unknown:case tr.PuckerBloat:case tr.ZigZag:case tr.OffsetPath:n?(h=e[a]).closed=!1:((h=st(t[a]?.ty??tr.Unknown)).init(this,t[a]),e[a]=h,this.shapeModifiers.push(h)),c.push(h);break;case tr.Repeater:if(n){(h=e[a]).closed=!0,c.push(h);break}h=st(t[a]?.ty??tr.Unknown),e[a]=h,h.init(this,t,a,e),this.shapeModifiers.push(h),l=!1,c.push(h)}this.addProcessedElement(t[a],a+1)}let{length:u}=m;for(let t=0;t<u;t++){let e=m[t];e&&(e.closed=!0)}let{length:f}=c;for(let t=0;t<f;t++)c[t].closed=!0}setElementStyles(t){let{length:e}=this.stylesList;for(let s=0;s<e;s++)this.stylesList[s]?.closed||t.styles.push(this.stylesList[s])}setShapesAsAnimated(t){let{length:e}=t;for(let s=0;s<e;s++)t[s]?.setAsAnimated()}}class si extends eP{constructor(t,e,s){if(super(),this.initElement=ss.prototype.initElement,this.prepareFrame=eR.prototype.prepareFrame,this.assetData=e.getAssetData(t.refId)??null,!e.imageLoader)throw Error(`${this.constructor.name} imageLoader is not implemented in globalData`);this.img=e.imageLoader.getAsset(this.assetData),this.initElement(t,e,s)}createContent(){let t,e;if(!this.assetData)throw Error(`${this.constructor.name}: assetData is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.img.width||this.assetData.w===this.img.width&&this.assetData.h===this.img.height)return;let s=ev("canvas");s.width=Number(this.assetData.w),s.height=Number(this.assetData.h);let i=s.getContext("2d"),r=this.img.width,a=this.img.height,n=r/a,o=Number(this.assetData.w)/Number(this.assetData.h),h=this.assetData.pr||this.globalData.renderConfig?.imagePreserveAspectRatio;n>o&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?t=(e=a)*o:e=(t=r)/o,i?.drawImage(this.img,(r-t)/2,(a-e)/2,t,e,0,0,Number(this.assetData.w),Number(this.assetData.h)),this.img=s}destroy(){this.img=null}renderInnerContent(){this.canvasContext?.drawImage(this.img,0,0)}}class sr extends e2{constructor(t,e,s,i){let r,a;switch(super(),this.styledShapes=[],this.tr=[0,0,0,0,0,0],e.ty){case tr.Rectangle:r=5;break;case tr.Ellipse:r=6;break;case tr.PolygonStar:r=7;break;default:r=4}this.sh=t5.getShapeProp(t,e,r);const{length:n}=s;for(let t=0;t<n;t++)s[t]?.closed||(a={transforms:i.addTransformSequence(s[t]?.transforms),trNodes:[]},this.styledShapes.push(a),s[t]?.elements.push(a))}}class sa{addTransformSequence(t){let{length:e}=t,s="_";for(let i=0;i<e;i++)s+=`${t[i]?.transform.key}_`;let i=this.sequences[s];return i||(i={_mdf:!1,finalTransform:new tm,transforms:[...t]},this.sequences[s]=i,this.sequenceList.push(i)),i}getNewKey(){return this.transform_key_count++,`_${this.transform_key_count}`}processSequence(t,e){let s=0,{length:i}=t.transforms??[],r=e;if(!e)for(;s<i;){if(t.transforms?.[s]?.transform.mProps._mdf){r=!0;break}s++}if(r)for(t.finalTransform?.reset(),s=i-1;s>=0;s-=1){let{v:e}=t.transforms?.[s]?.transform.mProps??{v:null};e&&t.finalTransform?.multiply(e)}t._mdf=!!r}processSequences(t){let{length:e}=this.sequenceList;for(let s=0;s<e;s++)this.processSequence(this.sequenceList[s],t)}constructor(){this.sequenceList=[],this.sequences={},this.transform_key_count=0}}class sn extends e9{constructor(t,e,s){super(),this.clearCanvas=eP.prototype.clearCanvas,this.createContainerElements=eP.prototype.createContainerElements,this.createRenderableComponents=eP.prototype.createRenderableComponents,this.dashResetter=[],this.exitLayer=eP.prototype.exitLayer,this.hide=eP.prototype.hide,this.initRendererElement=eP.prototype.initRendererElement,this.prepareLayer=eP.prototype.prepareLayer,this.prevViewData=[],this.renderFrame=eP.prototype.renderFrame,this.setBlendMode=eP.prototype.setBlendMode,this.show=eP.prototype.show,this.stylesList=[],this.transformHelper={_opMdf:!1,opacity:1},this.transformsManager=new sa,this.shapes=[],this.shapesData=t.shapes,this.itemsData=[],this.shapeModifiers=[],this.processedElements=[],this.initElement(t,e,s)}addTransformToStyleList(t){let{length:e}=this.stylesList;for(let s=0;s<e;s++)this.stylesList[s].closed||this.stylesList[s].transforms.push(t)}closeStyles(t){let{length:e}=t;for(let s=0;s<e;s++)t[s].closed=!0}createContent(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])}createGroupElement(t){return{it:[],prevViewData:[]}}createShapeElement(t){let e=new sr(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e}createStyleElement(t,e){try{let s={closed:!0===t.hd,data:t,elements:[],preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],type:t.ty},i={};switch(t.ty){case tr.Fill:case tr.Stroke:i.c=tZ.getProp(this,t.c,1,255,this),i.c.k||(s.co=I(i.c.v));break;case tr.GradientFill:case tr.GradientStroke:i.s=tZ.getProp(this,t.s,1,null,this),i.e=tZ.getProp(this,t.e,1,null,this),i.h=tZ.getProp(this,t.h??{k:0},0,.01,this),i.a=tZ.getProp(this,t.a??{k:0},0,$,this),t.g&&(i.g=new eZ(this,t.g,this))}return i.o=tZ.getProp(this,t.o,0,.01,this),t.ty===tr.Stroke||t.ty===tr.GradientStroke?(s.lc=to[t.lc||2],s.lj=th[t.lj||2],1===t.lj&&(s.ml=t.ml),i.w=tZ.getProp(this,t.w,0,null,this),i.w.k||(s.wi=i.w.v),t.d&&"object"==typeof t.d&&(i.d=new eQ(this,t.d,ti.Canvas,this),i.d.k||(s.da=i.d.dashArray,s.do=i.d.dashoffset[0]))):s.r=2===t.r?"evenodd":"nonzero",this.stylesList.push(s),i.style=s,i}catch(t){return console.error(this.constructor.name,t),null}}createTransformElement(t){return{transform:{_opMdf:!1,key:this.transformsManager.getNewKey(),mProps:ed.getTransformProperty(this,t,this),op:tZ.getProp(this,t.o,0,.01,this),opacity:1}}}destroy(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0}drawLayer(){try{let t;if(!this.globalData)throw Error(`${this.constructor.name} globalData is not implemented`);if(!this.globalData.renderer)throw Error(`${this.constructor.name} renderer is not implemented`);let{length:e}=this.stylesList,{renderer:s}=this.globalData,i=this.globalData.canvasContext;for(let r=0;r<e;r++){let{co:e,coOp:a,da:n,data:o,elements:h,grd:l,lc:p,lj:m,ml:c,preTransforms:d,r:u,type:f,wi:g}=t=this.stylesList[r],y=f===tr.Stroke||f===tr.GradientStroke;if(y&&0===g||!o._shouldRender||0===a||0===this.globalData.currentGlobalAlpha)continue;s.save(),y?(s.ctxStrokeStyle(f===tr.Stroke?e:l),s.ctxLineWidth(g||0),p&&s.ctxLineCap(p),m&&s.ctxLineJoin(m),s.ctxMiterLimit(c||0)):s.ctxFillStyle(f===tr.Fill?e:l),s.ctxOpacity(a),f!==tr.Stroke&&f!==tr.GradientStroke&&i?.beginPath(),s.ctxTransform(d.finalTransform?.props);let{length:b}=h;for(let e=0;e<b;e++){(f===tr.Stroke||f===tr.GradientStroke)&&(i?.beginPath(),i&&n&&(i.setLineDash(n),i.lineDashOffset=t.do||0));let r=h[e].trNodes,{length:a}=r;for(let t=0;t<a;t++){let{p:e=[],pts:s=[]}=r[t];"m"===r[t].t?i?.moveTo(e[0],e[1]):"c"===r[t].t?i?.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]):i?.closePath()}y&&(s.ctxStroke(),n&&i?.setLineDash(this.dashResetter))}y||this.globalData.renderer.ctxFill(u),s.restore()}}catch(t){console.error(this.constructor.name,t)}}reloadShapes(){this._isFirstFrame=!0;let{length:t}=this.itemsData;for(let e=0;e<t;e++)this.prevViewData[e]=this.itemsData[e];this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]);let{length:e}=this.dynamicProperties;for(let t=0;t<e;t++)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)}removeTransformFromStyleList(){let{length:t}=this.stylesList;for(let e=0;e<t;e++)this.stylesList[e].closed||this.stylesList[e].transforms.pop()}renderFill(t,e,s){let i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co=I(e.c.v)),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity)}renderGradientFill(t,e,s){let i;if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);let r=e.style;if(!r?.grd||e.g?._mdf||e.s?._mdf||e.e?._mdf||1!==t.t&&(e.h?._mdf||e.a?._mdf)){let s=this.globalData.canvasContext,a=e.s?.v??[0,0],n=e.e?.v??[0,0];if(1===t.t)i=s?.createLinearGradient(a[0],a[1],n[0],n[1]);else{let t=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),r=Math.atan2(n[1]-a[1],n[0]-a[0]),o=e.h?.v??0;o>=1?o=.99:o<=-1&&(o=-.99);let h=t*o,l=e.a?.v??0,p=Math.cos(r+l)*h+a[0],m=Math.sin(r+l)*h+a[1];i=s?.createRadialGradient(p,m,0,a[0],a[1],t)}let o=t.g?.p??0,h=e.g?.c??[],l=1;for(let t=0;t<o;t++)e.g?._hasOpacity&&e.g._collapsable&&(l=e.g.o[2*t+1]),i?.addColorStop(h[4*t]/100,`rgba(${h[4*t+1]},${h[4*t+2]},${h[4*t+3]},${l})`);r&&(r.grd=i)}r&&(r.coOp=(e.o?.v??0)*s.opacity)}renderInnerContent(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)}renderPath(t,e){if(!0===t.hd||!t._shouldRender||!e.sh)return;let{length:s}=e.styledShapes;for(let t=0;t<s;t++)this.renderStyledShape(e.styledShapes[t],e.sh)}renderShape(t,e,s,i){try{let r,a=e.length-1;r=t;for(let i=a;i>=0;i--)switch(e[i].ty){case tr.Transform:(r=s[i].transform)&&this.renderShapeTransform(t,r);break;case tr.Path:case tr.Ellipse:case tr.Rectangle:case tr.PolygonStar:this.renderPath(e[i],s[i]);break;case tr.Fill:this.renderFill(e[i],s[i],r);break;case tr.Stroke:this.renderStroke(e[i],s[i],r);break;case tr.GradientFill:case tr.GradientStroke:this.renderGradientFill(e[i],s[i],r);break;case tr.Group:this.renderShape(r,e[i].it??[],s[i].it);case tr.Trim:}i&&this.drawLayer()}catch(t){console.error(this.constructor.name,t)}}renderShapeTransform(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)}renderStroke(t,e,s){let i=e.style,{c:r,d:a,o:n,w:o}=e;a&&(a._mdf||this._isFirstFrame)&&(i.da=a.dashArray,i.do=a.dashoffset[0]),(r._mdf||this._isFirstFrame)&&(i.co=I(r.v)),(n._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=n.v*s.opacity),(o._mdf||this._isFirstFrame)&&(i.wi=o.v)}renderStyledShape(t,e){let s,i,r;if(!this._isFirstFrame&&!e._mdf&&!t.transforms._mdf)return;let{transforms:a,trNodes:n}=t,{paths:o}=e,h=o?._length||0;n.length=0;let l=a?.finalTransform;for(r=0;r<h;r++){let t=o?.shapes[r];if(t?.v){for(i=t._length,s=1;s<i;s++)1===s&&n.push({p:l?.applyToPointArray(t.v[0][0],t.v[0][1],0),t:"m"}),n.push({pts:l?.applyToTriplePoints(t.o[s-1],t.i[s],t.v[s]),t:"c"});1===i&&n.push({p:l?.applyToPointArray(t.v[0][0],t.v[0][1],0),t:"m"}),t.c&&i&&n.push({pts:l?.applyToTriplePoints(t.o[s-1],t.i[0],t.v[0]),t:"c"},{t:"z"})}}t.trNodes=n}searchShapes(t,e,s,i,r){let a,n,o=i,h=t.length-1,l=[],p=[],m=[...r];for(let i=h;i>=0;i--){let r=this.searchProcessedElement(t[i]);switch(r?e[i]=s[r-1]:t[i]._shouldRender=o,t[i].ty){case tr.Fill:case tr.Stroke:case tr.GradientFill:case tr.GradientStroke:r?e[i].style.closed=!1:e[i]=this.createStyleElement(t[i],m),l.push(e[i].style);break;case tr.Group:if(r){let{length:t}=e[i].it;for(let s=0;s<t;s++)e[i].prevViewData[s]=e[i].it[s]}else e[i]=this.createGroupElement(t[i]);this.searchShapes(t[i].it??[],e[i].it,e[i].prevViewData,o,m);break;case tr.Transform:r||(n=this.createTransformElement(t[i]),e[i]=n),m.push(e[i]),this.addTransformToStyleList(e[i]);break;case tr.Path:case tr.Rectangle:case tr.Ellipse:case tr.PolygonStar:r||(e[i]=this.createShapeElement(t[i]));break;case tr.Trim:case tr.RoundedCorners:case tr.PuckerBloat:case tr.ZigZag:case tr.OffsetPath:r?(a=e[i]).closed=!1:((a=st(t[i].ty)).init(this,t[i]),e[i]=a,this.shapeModifiers.push(a)),p.push(a);break;case tr.Repeater:r?(a=e[i]).closed=!0:(a=st(t[i].ty),e[i]=a,a.init(this,t,i,e),this.shapeModifiers.push(a),o=!1),p.push(a)}this.addProcessedElement(t[i],i+1)}this.removeTransformFromStyleList(),this.closeStyles(l);let{length:c}=p;for(let t=0;t<c;t++)p[t].closed=!0}}class so extends eP{constructor(t,e,s){super(),this.initElement=ss.prototype.initElement,this.prepareFrame=eR.prototype.prepareFrame,this.initElement(t,e,s)}renderInnerContent(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData it not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) it not implemented`);if(!this.globalData.renderer)throw Error(`${this.constructor.name}: globalData.renderer it not implemented`);this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw||0,this.data.sh||0)}}class sh{constructor(t,e,s,i,r,a){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=r,this.p=a,this._mdf={fc:!!i,m:!0,o:!0,p:!0,sc:!!s,sw:!!e}}update(t,e,s,i,r,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;let n=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,n=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,n=!0),this.sc!==s&&(this.sc=s,this._mdf.sc=!0,n=!0),this.fc!==i&&(this.fc=i,this._mdf.fc=!0,n=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,n=!0),a&&a.length>0&&(this.p[0]!==a[0]||this.p[1]!==a[1]||this.p[4]!==a[4]||this.p[5]!==a[5]||this.p[12]!==a[12]||this.p[13]!==a[13])&&(this.p=a,this._mdf.p=!0,n=!0),n}}class sl extends tH{constructor(t,e){super(),this._currentTextLength=-1,this.finalE=0,this.finalS=0,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.initDynamicPropertyContainer(t),this.s=tZ.getProp(t,e.s??{a:0,k:0},0,0,this),"e"in e?this.e=tZ.getProp(t,e.e,0,0,this):this.e={v:100},this.o=tZ.getProp(t,e.o??{a:0,k:0},0,0,this),this.xe=tZ.getProp(t,e.xe??{a:0,k:0},0,0,this),this.ne=tZ.getProp(t,e.ne??{a:0,k:0},0,0,this),this.sm=tZ.getProp(t,e.sm??{a:0,k:100},0,0,this),this.a=tZ.getProp(t,e.a,0,.01,this),0===this.dynamicProperties.length&&this.getValue()}getMult(t,e){let s=t;this._currentTextLength!==this.elem.textProperty?.currentData.l.length&&this.getValue();let i=0,r=0,a=1,n=1;this.ne.v>0?i=this.ne.v/100:r=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:n=1+this.xe.v/100;let o=tz(i,r,a,n).get,h=0,l=this.finalS,p=this.finalE;switch(this.data.sh){case 2:h=o(h=p===l?+(s>=p):Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)));break;case 3:h=o(h=p===l?s>=p?0:1:1-Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)));break;case 4:p===l?h=0:(h=Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)))<.5?h*=2:h=1-2*(h-.5),h=o(h);break;case 5:if(p===l)h=0;else{let t=p-l,e=-t/2+(s=Math.min(Math.max(0,s+.5-l),p-l)),i=t/2;h=Math.sqrt(1-e*e/(i*i))}h=o(h);break;case 6:h=o(h=p===l?0:(1+Math.cos(Math.PI+2*Math.PI*(s=Math.min(Math.max(0,s+.5-l),p-l))/(p-l)))/2);break;default:s>=Math.floor(l)&&(h=s-l<0?Math.max(0,Math.min(Math.min(p,1)-(l-s),1)):Math.max(0,Math.min(p-s,1))),h=o(h)}if(100!==this.sm.v){let t=.01*this.sm.v;0===t&&(t=1e-8);let e=.5-.5*t;h<e?h=0:(h=(h-e)/t)>1&&(h=1)}return h*this.a.v}getTextSelectorProp(t,e,s){throw Error("Method not implemented")}getValue(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty?.currentData.l.length||0,t&&2===this.data.r&&this.e.v&&(this.e.v=this._currentTextLength);let e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=Number(this.s?.v)/e+s,r=this.e.v/e+s;if(i>r){let t=i;i=r,r=t}return this.finalS=i,this.finalE=r,0}}class sp{constructor(t,e,s){const i={propType:!1},r=e?.a;this.a={a:r?.a?tZ.getProp(t,r.a,1,0,s):i,fb:r?.fb?tZ.getProp(t,r.fb,0,.01,s):i,fc:r?.fc?tZ.getProp(t,r.fc,1,0,s):i,fh:r?.fh?tZ.getProp(t,r.fh,0,0,s):i,fs:r?.fs?tZ.getProp(t,r.fs,0,.01,s):i,o:r?.o?tZ.getProp(t,r.o,0,.01,s):i,p:r?.p?tZ.getProp(t,r.p,1,0,s):i,r:r?.r?tZ.getProp(t,r.r,0,$,s):i,rx:r?.rx?tZ.getProp(t,r.rx,0,$,s):i,ry:r?.ry?tZ.getProp(t,r.ry,0,$,s):i,s:r?.s?tZ.getProp(t,r.s,1,.01,s):i,sa:r?.sa?tZ.getProp(t,r.sa,0,$,s):i,sc:r?.sc?tZ.getProp(t,r.sc,1,0,s):i,sk:r?.sk?tZ.getProp(t,r.sk,0,$,s):i,sw:r?.sw?tZ.getProp(t,r.sw,0,0,s):i,t:r?.t?tZ.getProp(t,r.t,0,0,s):i},this.s=new sl(t,e?.s),this.s.t=e?.s?.t}}let sm=(t,e,s)=>{let i=Math.max(t,e,s),r=Math.min(t,e,s),a=i-r,n=0;switch(i){case r:n=0;break;case t:n=(e-s+6*(e<s)*a)/(6*a);break;case e:n=(s-t+2*a)/(6*a);break;case s:n=(t-e+4*a)/(6*a)}return[n,0===i?0:a/i,i/255]},sc=(t,e,s)=>{let i=0,r=0,a=0,n=Math.floor(6*t),o=6*t-n,h=s*(1-e),l=s*(1-o*e),p=s*(1-(1-o)*e);switch(n%6){case 0:i=s,r=p,a=h;break;case 1:i=l,r=s,a=h;break;case 2:i=h,r=s,a=p;break;case 3:i=h,r=l,a=s;break;case 4:i=p,r=h,a=s;break;case 5:i=s,r=h,a=l}return[i,r,a]},sd=(t,e)=>{let s=sm(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),sc(s[0],s[1],s[2])},su=(t,e)=>{let s=sm(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&s[0]++,sc(s[0],s[1],s[2])},sf=(t,e)=>{let s=sm(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),sc(s[0],s[1],s[2])};class sg extends tq{constructor(t,e,s){super(),this._frameId=-1,this._isFirstFrame=!0,this.defaultPropsArray=[],this.lettersChangedFlag=!1,this.renderedLetters=[],this._hasMaskedPath=!1,this._moreOptions={alignment:{}},this._pathData={},this.mHelper=new tm,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=tp(Number(this._textData.a?.length)),this.initDynamicPropertyContainer(s)}getMeasures(t,e){try{if(this.lettersChangedFlag=!!e,!this._mdf&&!this._isFirstFrame&&!e&&(!this._hasMaskedPath||!this._pathData.m?._mdf))return;this._isFirstFrame=!1;let s=this._moreOptions.alignment.v,i=this._animatorsData,r=this._textData,a=this.mHelper,n=this._renderType,o=this.renderedLetters.length,h,l,p,m,c=t.l,d,u=0,f,g=0,y,b=0,v=0,_,x=null,w=[],E=0,C=0,S,M,P=null;if(this._hasMaskedPath&&this._pathData.m){if(P=this._pathData.m,!this._pathData.n||this._pathData._mdf){let t=P.v;if(t){let e;for(this._pathData.r?.v&&(t=t.toReversed()),d={segments:[],tLength:0},m=t._length-1,C=0,p=0;p<m;p++)k(t)||(e=tD(t.v[p],t.v[p+1],[(t.o[p]?.[0]??0)-(t.v[p]?.[0]??0),(t.o[p]?.[1]??0)-(t.v[p]?.[1]??0)],[(t.i[p+1]?.[0]??0)-(t.v[p+1]?.[0]??0),(t.i[p+1]?.[1]??0)-(t.v[p+1]?.[1]??0)]),d.tLength+=e.segmentLength,d.segments.push(e),C+=e.segmentLength);p=m,P.v?.c&&!k(t)&&(e=tD(t.v[p],t.v[0],[(t.o[p]?.[0]??0)-(t.v[p]?.[0]??0),(t.o[p]?.[1]??0)-(t.v[p]?.[1]??0)],[(t.i[0]?.[0]??0)-(t.v[0]?.[0]??0),(t.i[0]?.[1]??0)-(t.v[0]?.[1]??0)]),d.tLength+=e.segmentLength,d.segments.push(e),C+=e.segmentLength),this._pathData.pi=d}}if(d=this._pathData.pi,u=this._pathData.f?.v??0,v=0,b=1,g=0,w=d?.segments??[],u>0&&P.v?.c)for((d?.tLength??0<Math.abs(u))&&(u=-Math.abs(u)%(d?.tLength??0)),v=w.length-1,b=(x=w[v]?.points??[]).length-1;u<0;)u+=x[b]?.partialLength??0,(b-=1)<0&&(v-=1,b=(x=w[v]?.points??[]).length-1);_=(x=w[v]?.points??[])[b-1],f=x[b],E=f?.partialLength??0}m=c.length||0,h=0,l=0;let A=1.2*(t.finalSize||0)*.714,D=!0,T,F,$,L,N=i.length,B,V=-1,R,O=0,z=0,G=u,q=v,j=b,H=-1,W,Y=[0,0,0],U=0,J=[0,0,0],X,Z,K,Q,tt="",te=this.defaultPropsArray,ts;if(2===t.j||1===t.j){let e=0,s=0,a=2===t.j?-.5:-1,n=0,o=!0;for(p=0;p<m;p++){if(c[p]?.n){for(e&&(e+=s);n<p;)(c[n]??{}).animatorJustifyOffset=e,n++;e=0,o=!0;continue}for($=0;$<N;$++){if(T=i[$]?.a??{},!T.t?.propType)continue;let{v:n}=T.t;"number"==typeof n&&(o&&2===t.j&&(s+=n*a),F=i[$]?.s,B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars),void 0!==B&&(k(B)?e+=n*(B[0]??1)*a:e+=n*B*a))}o=!1}for(e&&(e+=s);n<p;)c[n].animatorJustifyOffset=e,n++}for(p=0;p<m;p++){if(a.reset(),W=1,c[p]?.n)h=0,l+=t.yOffset||0,l+=+!!D,u=G,D=!1,this._hasMaskedPath&&(v=q||0,b=j||0,_=(x=w[v]?.points??[])[b-1],f=x[b],E=f?.partialLength??0,g=0),tt="",Q="",Z="",ts="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(H!==c[p]?.line){switch(t.j){case 1:u+=C-(t.lineWidths[c[p]?.line??0]??0);break;case 2:u+=(C-(t.lineWidths[c[p]?.line??0]??0))/2}H=c[p]?.line||0}V!==c[p]?.ind&&(c[V]&&(u+=Number(c[V]?.extra)),u+=(c[p]?.an||0)/2,V=c[p]?.ind||0),u+=s[0]*(c[p]?.an||0)*.005;let e=0;for($=0;$<N;$++){if(T=i[$]?.a,T?.p.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars)))continue;k(T.p.v)&&(k(B)?e+=T.p.v[0]*(B[0]??1):e+=T.p.v[0]*B)}if(T?.a.propType){if((F=i[$]?.s,B=F?.getMult(Number(c[p]?.anIndexes[$]),r.a?.[$]?.s?.totalChars))&&k(T.a.v)){if(k(B)){e+=(T.a.v[0]??0)*(B[0]??1);continue}e+=(T.a.v[0]??0)*B}}}for(y=!0,this._pathData.a?.v&&(u=.5*(c[0]?.an||0)+(C-Number(this._pathData.f?.v)-.5*(c[0]?.an||0)-(c[c.length-1]?.an??0)*.5)*V/(m-1)+Number(this._pathData.f?.v));y;)g+E>=u+e||!x?(S=(u+e-g)/(f?.partialLength||0),O=Number(_?.point[0])+(Number(f?.point[0])-Number(_?.point[0]))*S,z=Number(_?.point[1])+(Number(f?.point[1])-Number(_?.point[1]))*S,a.translate(-s[0]*(c[p]?.an??0)*.005,-(.01*(s[1]*A))),y=!1):x.length>0&&(g+=Number(f?.partialLength),++b>=x.length&&(b=0,w[++v]?x=w[v]?.points??[]:P?.v?.c?(b=0,v=0,x=w[v]?.points??[]):(g-=Number(f?.partialLength),x=null)),x&&(_=f,f=x[b],E=f?.partialLength??0));R=(c[p]?.an??0)/2-(c[p]?.add??0),a.translate(-R,0,0)}else R=(c[p]?.an??0)/2-(c[p]?.add??0),a.translate(-R,0,0),a.translate(-s[0]*(c[p]?.an??0)*.005,-s[1]*A*.01,0);for($=0;$<N;$++)if(T=i[$]?.a??{},T.t?.propType&&(F=i[$]?.s,B=F?.getMult(Number(c[p]?.anIndexes[$]),r.a?.[$]?.s?.totalChars),0!==h||0!==t.j)){if(this._hasMaskedPath){k(B)?u+=Number(T.t.v)*(B[0]??1):u+=Number(T.t.v)*Number(B);continue}if(k(B)){h+=Number(T.t.v)*(B[0]??1);continue}h+=Number(T.t.v)*Number(B)}for(t.strokeWidthAnim&&(U=t.sw||0),t.strokeColorAnim&&(Y=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(J=[Number(t.fc[0]),Number(t.fc[1]),Number(t.fc[2])]),$=0;$<N;$++)if(T=i[$]?.a??{},T.a?.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars))||!k(T.a.v))continue;if(k(B)){a.translate(-(T.a.v[0]??0)*(B[0]??1),-(T.a.v[1]??0)*(B[1]??1),(T.a.v[2]??0)*(B[2]??1));continue}a.translate(-(T.a.v[0]??0)*B,-(T.a.v[1]??0)*B,(T.a.v[2]??0)*B)}for($=0;$<N;$++)if(T=i[$]?.a??{},T.s?.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars))||!k(T.s.v))continue;if(k(B)){a.scale(1+((T.s.v[0]??0)-1)*(B[0]??1),1+((T.s.v[1]??0)-1)*(B[1]??1),1);continue}a.scale(1+((T.s.v[0]??0)-1)*B,1+((T.s.v[1]??0)-1)*B,1)}for($=0;$<N;$++)if(T=i[$]?.a??{},F=i[$]?.s,B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars)){if(T.sk?.propType&&(k(B)?a.skewFromAxis(-Number(T.sk.v)*(B[0]??1),Number(T.sa?.v)*(B[1]??1)):a.skewFromAxis(-Number(T.sk.v)*B,Number(T.sa?.v)*B)),T.r?.propType&&(k(B)?a.rotateZ(-Number(T.r.v)*(B[2]??1)):a.rotateZ(-Number(T.r.v)*B)),T.ry?.propType&&(k(B)?a.rotateY(Number(T.ry.v)*(B[1]??1)):a.rotateY(Number(T.ry.v)*B)),T.rx?.propType&&(k(B)?a.rotateX(Number(T.rx.v)*(B[0]??1)):a.rotateX(Number(T.rx.v)*B)),T.o?.propType&&(k(B)?W+=(Number(T.o.v)*(B[0]??1)-W)*(B[0]??1):W+=(Number(T.o.v)*B-W)*B),t.strokeWidthAnim&&T.sw?.propType&&(k(B)?U+=Number(T.sw.v)*(B[0]??1):U+=Number(T.sw.v)*B),t.strokeColorAnim&&T.sc?.propType&&k(T.sc.v))for(X=0;X<3;X++)k(B)?Y[X]+=((T.sc.v[X]??0)-(Y[X]??0))*(B[0]??1):Y[X]+=((T.sc.v[X]??0)-(Y[X]??0))*B;if(t.fillColorAnim&&t.fc){if(T.fc?.propType)for(X=0;X<3;X++)k(T.fc.v)&&(k(B)?J[X]+=((T.fc.v[X]??0)-(J[X]??0))*(B[0]??1):J[X]+=((T.fc.v[X]??0)-(J[X]??0))*B);T.fh?.propType&&(J=k(B)?su(J,Number(T.fh.v)*(B[0]??1)):su(J,Number(T.fh.v)*B)),T.fs?.propType&&(J=k(B)?sf(J,Number(T.fs.v)*(B[0]??1)):sf(J,Number(T.fs.v)*B)),T.fb?.propType&&(J=k(B)?sd(J,Number(T.fb.v)*(B[0]??1)):sd(J,Number(T.fb.v)*B))}}for($=0;$<N;$++)if(T=i[$]?.a??{},T.p?.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars))||!k(T.p.v))continue;this._hasMaskedPath?k(B)?a.translate(0,T.p.v[1]*B[0],-T.p.v[2]*B[1]):a.translate(0,T.p.v[1]*B,-T.p.v[2]*B):k(B)?a.translate(T.p.v[0]*B[0],T.p.v[1]*B[1],-T.p.v[2]*B[2]):a.translate(T.p.v[0]*B,T.p.v[1]*B,-T.p.v[2]*B)}if(t.strokeWidthAnim&&(Z=U<0?0:U),t.strokeColorAnim&&(K=I(Y)),t.fillColorAnim&&t.fc&&(Q=I(J)),this._hasMaskedPath){if(a.translate(0,-Number(t.ls)),a.translate(0,s[1]*A*.01+l,0),this._pathData.p?.v){M=(Number(f?.point[1])-Number(_?.point[1]))/(Number(f?.point[0])-Number(_?.point[0]));let t=180*Math.atan(M)/Math.PI;Number(f?.point[0])<Number(_?.point[0])&&(t+=180),a.rotate(-t*Math.PI/180)}a.translate(O,z,0),u-=s[0]*(c[p]?.an??0)*.005,c[p+1]&&V!==c[p+1]?.ind&&(u+=(c[p]?.an??0)/2,u+=.001*t.tr*Number(t.finalSize))}else{switch(a.translate(h,l,0),t.ps&&a.translate(t.ps[0],t.ps[1]+Number(t.ascent),0),t.j){case 1:a.translate((c[p]?.animatorJustifyOffset??0)+Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[c[p]?.line??0])),0,0);break;case 2:a.translate((c[p]?.animatorJustifyOffset??0)+Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[c[p]?.line??0]))/2,0,0)}a.translate(0,-Number(t.ls)),a.translate(R,0,0),a.translate(s[0]*Number(c[p]?.an)*.005,s[1]*A*.01,0),h+=(c[p]?.l??0)+.001*t.tr*Number(t.finalSize)}n===ti.HTML?tt=a.toCSS():n===ti.SVG?tt=a.to2dCSS():te=[a.props[0]??0,a.props[1]??0,a.props[2]??0,a.props[3]??0,a.props[4]??0,a.props[5]??0,a.props[6]??0,a.props[7]??0,a.props[8]??0,a.props[9]??0,a.props[10]??0,a.props[11]??0,a.props[12]??0,a.props[13]??0,a.props[14]??0,a.props[15]??0],ts=W}if(o<=p){L=new sh(Number(ts),Number(Z),K,Q,tt,te),this.renderedLetters.push(L),o++,this.lettersChangedFlag=!0;continue}L=this.renderedLetters[p],this.lettersChangedFlag=L.update(Number(ts),Number(Z),K,Q,tt,te)||this.lettersChangedFlag}}catch(t){console.error(this.constructor.name,t)}}getValue(){return this._elem.globalData?.frameId===this._frameId||(this._frameId=this._elem.globalData?.frameId??0,this.iterateDynamicProperties()),0}searchProperties(t){let{length:e}=this._textData.a??[],{getProp:s}=tZ;for(let t=0;t<e;t++)this._animatorsData[t]=new sp(this._elem,this._textData.a?.[t],this);this._textData.p&&"m"in this._textData.p&&this._elem.maskManager?(this._pathData={a:s(this._elem,this._textData.p.a,0,0,this),f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m),p:s(this._elem,this._textData.p.p,0,0,this),r:s(this._elem,this._textData.p.r,0,0,this)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m?.a,1,0,this)}}function sy(t){let e=t.fStyle?t.fStyle.split(" "):[],s="normal",i="normal",{length:r}=e;for(let t=0;t<r;t++)switch(e[t]?.toLowerCase()){case"italic":i="italic";break;case"bold":s="700";break;case"black":s="900";break;case"medium":s="500";break;case"regular":case"normal":s="400";break;case"light":case"thin":s="200"}return{style:i,weight:t.fWeight||s}}let sb=[2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403],sv={data:{shapes:[]},shapes:[],size:0,w:0},s_=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function sx(t){let e=sw(t);return e>=127462&&e<=127487}function sw(t){let e=0,s=t.charCodeAt(0);if(s>=55296&&s<=56319){let i=t.charCodeAt(1);i>=56320&&i<=57343&&(e=(s-55296)*1024+i-56320+65536)}return e}function sE(t,e){if(B)return;let s=ev("span");s.setAttribute("aria-hidden","true"),s.style.fontFamily=e;let i=ev("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);let r=i.offsetWidth;return i.style.fontFamily=`${function(t){let e=t.split(","),{length:s}=e,i=[];for(let t=0;t<s;t++)"sans-serif"!==e[t]&&"monospace"!==e[t]&&i.push(e[t]);return i.join(",")}(t)}, ${e}`,{node:i,parent:s,w:r}}class sC{constructor(){this.chars=null,this.fonts=[],this.isLoaded=!1,this.typekitLoaded=0,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)}addChars(t){if(!t)return;this.chars=this.chars??[];let{length:e}=t,s,{length:i}=this.chars,r;for(let a=0;a<e;a++){for(s=0,r=!1;s<i;)this.chars[s]?.style===t[a]?.style&&this.chars[s]?.fFamily===t[a]?.fFamily&&this.chars[s]?.ch===t[a]?.ch&&(r=!0),s++;!r&&(this.chars.push(t[a]),i++)}}addFonts(t,e){if(!t){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=t.list;return}let{length:s}=t.list;if(!B){this.isLoaded=!0;for(let e=0;e<s;e++){let s=t.list[e];s&&(s.helper=this.createHelper(s),s.cache={})}this.fonts=t.list;return}let i=s;for(let s=0;s<i;s++){let r=!0,a,n=t.list[s];if(n){if(n.loaded=!1,n.monoCase=sE(n.fFamily,"monospace"),n.sansCase=sE(n.fFamily,"sans-serif"),n.fPath){if("p"===n.fOrigin||3===n.origin){if((a=document.querySelectorAll(`style[f-forigin="p"][f-family="${n.fFamily}"], style[f-origin="3"][f-family="${n.fFamily}"]`)).length>0&&(r=!1),r){let t=ev("style");t.setAttribute("f-forigin",n.fOrigin),t.setAttribute("f-origin",`${n.origin}`),t.setAttribute("f-family",n.fFamily),t.innerText=`@font-face {font-family: ${n.fFamily}; font-style: normal; src: url('${n.fPath}');}`,e?.appendChild(t)}}else if("g"===n.fOrigin||1===n.origin){let{length:t}=a=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');for(s=0;s<t;s++)a[s]?.href.includes(n.fPath)&&(r=!1);if(r){let t=ev("link");t.setAttribute("f-forigin",n.fOrigin),t.setAttribute("f-origin",`${n.origin}`),t.type="text/css",t.rel="stylesheet",t.href=n.fPath,document.body.appendChild(t)}}else if("t"===n.fOrigin||2===n.origin){let{length:t}=a=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');for(s=0;s<t;s++)n.fPath===a[s]?.src&&(r=!1);if(r){let t=ev("link");t.setAttribute("f-forigin",n.fOrigin),t.setAttribute("f-origin",`${n.origin}`),t.rel="stylesheet",t.href=n.fPath,e?.appendChild(t)}}}else n.loaded=!0,i-=1;n.helper=this.createHelper(n,e),n.cache={},this.fonts.push(n)}}0===i?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}getCharData(t,e,s){let i=0,{length:r}=this.chars??[];for(;i<r;){if(this.chars?.[i]?.ch===t&&this.chars[i]?.style===e&&this.chars[i]?.fFamily===s)return this.chars[i];i++}return("string"!=typeof t||13===t.charCodeAt(0))&&t||this._warned||(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),sv}getFontByName(t){let e=0,{length:s}=this.fonts;for(;e<s;){if(this.fonts[e]?.fName===t)return this.fonts[e];e++}return this.fonts[0]}measureText(t,e,s){let i=this.getFontByName(e);if(i.cache&&!i.cache[t]){let e=i.helper;if(" "===t){let s=Number(e?.measureText(`|${t}|`)),r=Number(e?.measureText("||"));i.cache[t]=(s-r)/100}else i.cache[t]=Number(e?.measureText(t))/100}return Number(i.cache?.[t])*Number(s)}checkLoadedFonts(){let t,e,s=this.fonts.length;for(let i=0;i<s;i++){let r=this.fonts[i];if(!r)continue;if(r.loaded){s-=1;continue}if("n"===r.fOrigin||0===r.origin){r.loaded=!0;continue}if(t=r.monoCase?.node,e=r.monoCase?.w||0,t?.offsetWidth===e?(t=r.sansCase?.node,e=r.sansCase?.w||0,t?.offsetWidth!==e&&(s-=1,r.loaded=!0)):(s-=1,r.loaded=!0),!r.loaded)continue;let{monoCase:a,sansCase:n}=r;n&&n.parent.parentNode?.removeChild(n.parent),a&&a.parent.parentNode?.removeChild(a.parent)}0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}createHelper(t,e){let s;if(B)return;let i=e?ti.SVG:ti.Canvas,r=sy(t);if(i===ti.SVG){let i=tc("text");i.style.fontSize="100px",i.setAttribute("font-family",t.fFamily),i.setAttribute("font-style",r.style),i.setAttribute("font-weight",r.weight),i.textContent="1",t.fClass?(i.style.fontFamily="inherit",i.classList.add(t.fClass)):i.style.fontFamily=t.fFamily,e?.appendChild(i),s=i}else{let e=new OffscreenCanvas(500,500).getContext("2d");e&&(e.font=`${r.style} ${r.weight} 100px ${t.fFamily}`,s=e)}return{measureText:t=>i===ti.SVG?(s.textContent=t,s.getComputedTextLength()):s.measureText(t).width}}setIsLoaded(){this.isLoaded=!0}}class sS extends tH{constructor(t,e){super(),this.canResize=!1,this.defaultBoxWidth=[0,0],this.effectsSequence=[],this.keysIndex=0,this.minimumFontSize=1,this.pv="",this.v="",this._frameId=-999999,this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d?.sid&&(e.d=t.globalData?.slotManager?.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.currentData={__complete:!1,ascent:0,boxWidth:this.defaultBoxWidth,f:"",fc:"",fillColorAnim:!1,finalLineHeight:0,finalSize:0,finalText:[],fStyle:"",fWeight:"",justifyOffset:0,l:[],lh:0,lineWidths:[],ls:0,of:"",ps:null,s:0,sc:"",strokeColorAnim:!1,strokeWidthAnim:!1,sw:0,t:0,tr:0,yOffset:0};const s=this.data.d?.k[0]?.s;s&&this.copyData(this.currentData,s),this.searchProperty()||this.completeTextData(this.currentData)}addEffect(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)}buildFinalText(t){let e=[],s=0,i=t.length,r,a,n,o=!1,h;for(;s<i;){var l;(n=o,o=!1,r=t.charCodeAt(s),h=t.charAt(s),sb.includes(r))?n=!0:r>=55296&&r<=56319?function(t,e){let s=e,i=sw(t.slice(s,2));if(127988!==i)return!1;let r=0;for(s+=2;r<5;){if((i=sw(t.slice(s,2)))<917601||i>917626)return!1;r++,s+=2}return 917631===sw(t.slice(s,2))}(t,s)?h=t.slice(s,14):(a=t.charCodeAt(s+1))>=56320&&a<=57343&&(function(t,e){let s=t.toString(16)+e.toString(16);return s_.includes(s)}(r,a)?(h=t.slice(s,2),n=!0):h=sx((l=t.slice(s,4)).slice(0,2))&&sx(l.slice(2,2))?t.slice(s,4):t.slice(s,2)):r>56319?65039===r&&(n=!0):8205===r&&(n=!0,o=!0),n?e[e.length-1]+=h:e.push(h),s+=h.length}return e}calculateExpression(t){throw Error(`${this.constructor.name}: Method calculateExpression is not implemented`)}canResizeFont(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}completeTextData(t){let e,s,i,r,a,n,o;t.__complete=!0;let{fontManager:h}=this.elem.globalData??{};if(!h)throw Error(`${this.constructor.name}: FontManager not loaded to globalData`);let{canResize:l,data:p,minimumFontSize:m}=this,c=[],d,u,f=0,g,y=p.m?.g,b=0,v=0,_=0,x=[],w,E=0,C=h.getFontByName(t.f),S=sy(C);t.fWeight=S.weight,t.fStyle=S.style,t.finalSize=t.s,t.finalText=this.buildFinalText(`${t.t}`),d=t.finalText.length||0,t.finalLineHeight=t.lh;let k=t.tr/1e3*t.finalSize;if(t.sz){let r,a,n=!0,[o,p]=t.sz;for(;n;){a=this.buildFinalText(`${t.t}`),r=0,w=0,d=a.length,k=t.tr/1e3*t.finalSize;let c=-1;for(let n=0;n<d;n++)i=a[n]?.charCodeAt(0)??0,u=!1," "===a[n]?c=n:(13===i||3===i)&&(w=0,u=!0,r+=t.finalLineHeight||1.2*t.finalSize),h.chars?(e=h.getCharData(a[n]??"",C.fStyle,C.fFamily),s=u?0:e.w*t.finalSize/100):s=h.measureText(a[n]??"",t.f,t.finalSize)||0,w+s>o&&" "!==a[n]?(-1===c?d++:n=c,r+=t.finalLineHeight||1.2*t.finalSize,a.splice(n,+(c===n),"\r"),c=-1,w=0):(w+=s,w+=k);r+=Number(C.ascent)*t.finalSize/100,l&&t.finalSize>m&&p<r?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=a,d=t.finalText.length,n=!1)}}w=-k;let M=0,P;for(let r=0;r<d;r++)if(u=!1,13===(i=(P=t.finalText[r]??"").charCodeAt(0))||3===i?(M=0,x.push(w),E=w>E?w:E,w=-2*k,g="",u=!0,_++):g=P,h.chars?(e=h.getCharData(P,C.fStyle,h.getFontByName(t.f).fFamily),s=u?0:e.w*t.finalSize/100):s=h.measureText(g,t.f,t.finalSize)," "===P?M+=s+k:(w+=s+k+M,M=0),c.push({add:b,an:s,animatorJustifyOffset:0,anIndexes:[],l:s,line:_,n:u,val:g}),2===y){if(b+=s,""===g||" "===g||r===d-1){for((""===g||" "===g)&&(b-=s);v<=r;){let t=c[v];t&&(t.an=b,t.ind=f,t.extra=s),v++}f++,b=0}}else if(3===y){if(b+=s,""===g||r===d-1){""===g&&(b-=s);let t=c[v];for(;v<=r;)t&&(t.an=b,t.ind=f,t.extra=s),v++;b=0,f++}}else{let t=c[f];t&&(t.ind=f,t.extra=0),f++}if(t.l=c,E=w>E?w:E,x.push(w),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=E,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=x;let A=p.a,{length:D}=A??[],T=[];for(let e=0;e<D;e++){if(!(r=A?.[e]))continue;r.a?.sc&&(t.strokeColorAnim=!0),r.a?.sw&&(t.strokeWidthAnim=!0),(r.a?.fc||r.a?.fh||r.a?.fs||r.a?.fb)&&(t.fillColorAnim=!0),o=0,n=Number(r.s?.b);for(let t=0;t<d;t++)(a=c[t]??{}).anIndexes[e]=o,(1===n&&""!==a.val||2===n&&""!==a.val&&" "!==a.val||3===n&&(a.n||" "===a.val||t===d-1)||4===n&&(a.n||t===d-1))&&(1===Number(r.s?.rn)&&T.push(o),o++);let s=p.a?.[e]?.s;s&&(s.totalChars=o);let i=-1,h;if(r.s?.rn===1)for(let t=0;t<d;t++)i!==Number((a=c[t]??{}).anIndexes[e])&&(i=a.anIndexes[e]??0,h=T.splice(Math.floor(Math.random()*T.length),1)[0]),h&&(a.anIndexes[e]=h)}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=Number(C.ascent)*t.finalSize/100}copyData(t,e){let s=Object.keys(e),{length:i}=s;for(let r=0;r<i;r++)Object.hasOwn(e,s[r]??"")&&(t[s[r]]=e[s[r]]);return t}getExpressionValue(t,e){throw Error(`${this.constructor.name}: Method getExpressionValue is not implemented`)}getKeyframeValue(){let t=this.data.d?.k??[],e=Number(this.elem.comp?.renderedFrame),s=0,i=t.length;for(;s<=i-1&&!(s===i-1||Number(t[s+1]?.t)>e);)s++;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d?.k[this.keysIndex]?.s}getValue(t){if((this.elem.globalData?.frameId===this.frameId||0===this.effectsSequence.length)&&!t)return 0;let e=this.data.d?.k[this.keysIndex]?.s.t;void 0!==e&&(this.currentData.t=e);let s=this.currentData,i=this.keysIndex;if(this.lock)return this.setCurrentData(this.currentData),0;this.lock=!0,this._mdf=!1;let{length:r}=this.effectsSequence,a=t??this.data.d?.k[this.keysIndex]?.s;for(let t=0;t<r;t++)a=i===this.keysIndex?this.effectsSequence[t]?.(this.currentData,a?.t):this.effectsSequence[t]?.(a,a?.t);return s!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData?.frameId,0}recalculate(t){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);let e=this.data.d.k[t]?.s;e&&(e.__complete=!1),this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)}searchExpressions(){throw Error(`${this.constructor.name}: Method searchExpressions is not implemented`)}searchKeyframes(){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf}searchProperty(){return this.searchKeyframes()}setCurrentData(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0}setMinimumFontSize(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}updateDocumentData(t,e){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);let s=e;s=s??this.keysIndex;let i=this.copyData({},this.data.d.k[s]?.s??{});i=this.copyData(i,t),(this.data.d.k[s]??{s:null}).s=i,this.recalculate(s),this.setCurrentData(i),this.elem.addDynamicProperty(this)}}class sk extends eA{applyTextPropertiesToMatrix(t,e,s,i,r){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+Number(t.ascent),0),e.translate(0,-Number(t.ls),0),t.j){case 1:e.translate(Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[s])),0,0);break;case 2:e.translate(Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[s]))/2,0,0)}e.translate(i,r,0)}buildColor(t){let e=Math.round(255*t[0]),s=Math.round(255*t[1]),i=Math.round(255*t[2]);return`rgb(${e},${s},${i})`}buildNewText(){throw Error(`${this.constructor.name}: Method buildNewText is not implemented`)}canResizeFont(t){this.textProperty?.canResizeFont(t)}createPathShape(t,e){let s,i="",{length:r}=e;for(let a=0;a<r;a++)e[a]?.ty===tr.Path&&e[a]?.ks?.k&&(i+=eT(s=e[a]?.ks?.k,s.i.length,!0,t));return i}initElement(t,e,s){if(!t.t)throw Error(`${this.constructor.name}: data.t (LottieLayer -> TextData) can't be undefined`);this.emptyProp=new sh,this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new sS(this,t.t),this.textAnimator=new sg(t.t,this.renderType||ti.SVG,this),this.initTransform(),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)}prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}setMinimumFontSize(t){this.textProperty?.setMinimumFontSize(t)}updateDocumentData(t,e){this.textProperty?.updateDocumentData(t,e)}validateText(){(this.textProperty?._mdf||this.textProperty?._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)}}let sM="rgba(0,0,0,0)";class sP extends sk{constructor(t,e,s){super(),this.clearCanvas=eP.prototype.clearCanvas,this.createContainerElements=eP.prototype.createContainerElements,this.createContent=eP.prototype.createContent,this.createElements=eP.prototype.createElements,this.createRenderableComponents=eP.prototype.createRenderableComponents,this.currentRender=null,this.destroy=eP.prototype.destroy,this.exitLayer=eP.prototype.exitLayer,this.fill=!1,this.fillColorAnim=!1,this.hide=eP.prototype.hide,this.hideElement=eP.prototype.hideElement,this.initRendererElement=eP.prototype.initRendererElement,this.justifyOffset=0,this.prepareLayer=eP.prototype.prepareLayer,this.renderedLetters=[],this.renderFrame=eP.prototype.renderFrame,this.renderLocalTransform=eP.prototype.renderLocalTransform,this.renderRenderable=eP.prototype.renderRenderable,this.searchEffectTransforms=eP.prototype.searchEffectTransforms,this.setBlendMode=eP.prototype.setBlendMode,this.show=eP.prototype.show,this.showElement=eP.prototype.showElement,this.stroke=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.textSpans=[],this.tHelper=ev("canvas").getContext("2d"),this.values={fill:sM,fValue:"",stroke:sM,sWidth:0},this.yOffset=0,this.renderType=ti.Canvas,this.initElement(t,e,s)}buildNewText(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.globalData.fontManager)throw Error(`${this.constructor.name}: fontManager is not implemented in globalData`);if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not implemented`);let t=this.textProperty.currentData;this.renderedLetters=tp(t.l.length||0);let e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;let s=!1;t.sc&&(s=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=Number(t.sw));let i=this.globalData.fontManager.getFontByName(t.f),r=t.l,a=this.mHelper;this.stroke=s,this.values.fValue=`${t.finalSize}px ${this.globalData.fontManager.getFontByName(t.f).fFamily}`;let{singleShape:n}=this.data,o=.001*t.tr*Number(t.finalSize),h,l=0,p=0,m=!0,c=0,{length:d}=t.finalText;for(let e=0;e<d;e++){let s=this.globalData.fontManager.getCharData(t.finalText[e],i.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily).data??{};a.reset(),n&&r[e]?.n&&(l=-o,p+=Number(t.yOffset),p+=+!!m,m=!1);let d=s.shapes?.[0]?.it??[];a.scale(Number(t.finalSize)/100,Number(t.finalSize)/100),n&&this.applyTextPropertiesToMatrix(t,a,r[e]?.line??0,l,p);let{length:u}=d,f=tp(u-1),g=0;for(let t=0;t<u;t++){if(d[t]?.ty!==tr.Path)continue;let{length:e}=(d[t]?.ks?.k).i,s=d[t]?.ks?.k,i=[];for(h=1;h<e;h++)1===h&&i.push(a.applyToX(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0),a.applyToY(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0)),i.push(a.applyToX(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToY(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToX(s.i[h]?.[0]??0,s.i[h]?.[1]??0,0),a.applyToY(s.i[h]?.[0]??0,s.i[h]?.[1]??0,0),a.applyToX(s.v[h]?.[0]??0,s.v[h]?.[1]??0,0),a.applyToY(s.v[h]?.[0]??0,s.v[h]?.[1]??0,0));i.push(a.applyToX(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToY(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToX(s.i[0]?.[0]??0,s.i[0]?.[1]??0,0),a.applyToY(s.i[0]?.[0]??0,s.i[0]?.[1]??0,0),a.applyToX(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0),a.applyToY(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0)),f[g]=i,g++}n&&(l+=r[e]?.l??0,l+=o),this.textSpans[c]?this.textSpans[c].elem=f:this.textSpans[c]={elem:f},c++}}renderInnerContent(){let t,e,s,i;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.textAnimator)throw Error(`${this.constructor.name}: textAnimator is not implemented`);if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer?.ctxLineCap("butt"),this.globalData.renderer?.ctxLineJoin("miter"),this.globalData.renderer?.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);let{renderedLetters:r}=this.textAnimator,a=this.textProperty.currentData.l,n,o=null,h=null,l=null,p,m,c=this.globalData.renderer,{length:d}=a;for(let u=0;u<d;u++)if(!a[u]?.n){if(n=r[u],c.save(),c.ctxTransform(n?.p),c.ctxOpacity(n?.o),this.fill){n?.fc?o!==n.fc&&(c.ctxFillStyle(n.fc),o=n.fc):o!==this.values.fill&&(o=this.values.fill,c.ctxFillStyle(this.values.fill));let{length:e}=p=this.textSpans[u]?.elem??[];for(this.globalData.canvasContext?.beginPath(),t=0;t<e;t++){let{length:e}=m=p[t]??[];for(this.globalData.canvasContext?.moveTo(m[0]??0,m[1]??0),s=2;s<e;s+=6)this.globalData.canvasContext?.bezierCurveTo(m[s]??0,m[s+1]??0,m[s+2]??0,m[s+3]??0,m[s+4]??0,m[s+5]??0)}this.globalData.canvasContext?.closePath(),c.ctxFill()}if(this.stroke){for(n?.sw?l!==n.sw&&(l=n.sw,c.ctxLineWidth(n.sw)):l!==this.values.sWidth&&(l=this.values.sWidth,c.ctxLineWidth(this.values.sWidth)),n?.sc?h!==n.sc&&(h=n.sc,c.ctxStrokeStyle(n.sc)):h!==this.values.stroke&&(h=this.values.stroke,c.ctxStrokeStyle(this.values.stroke)),e=(p=this.textSpans[u]?.elem??[]).length,this.globalData.canvasContext?.beginPath(),t=0;t<e;t++)for(i=(m=p[t]??[]).length,this.globalData.canvasContext?.moveTo(m[0]??0,m[1]??0),s=2;s<i;s+=6)this.globalData.canvasContext?.bezierCurveTo(m[s]??0,m[s+1]??0,m[s+2]??0,m[s+3]??0,m[s+4]??0,m[s+5]??0);this.globalData.canvasContext?.closePath(),c.ctxStroke()}this.globalData.renderer?.restore()}}}class sA extends ey{constructor(t,e,s){super(),this._canPlay=!1,this._currentTime=0,this._isPlaying=!1,this._previousVolume=null,this._volume=1,this._volumeMultiplier=1,this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId)??null,this.initBaseData(t,e,s);const i=this.globalData?.getAssetsPath(this.assetData);this.audio=this.globalData?.audioController?.createAudio(i),this.globalData?.audioController?.addAudio(this),this.tm=t.tm?tZ.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=tZ.getProp(this,t.au?.lv??{k:[100]},1,.01,this)}getBaseElement(){return null}hide(){this.audio.pause(),this._isPlaying=!1}initExpressions(){}pause(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1}prepareFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder?this._currentTime=t/Number(this.data.sr):this._currentTime=this.tm.v,this._volume=this.lv.v[0];let e=this._volume*this._volumeMultiplier;this._previousVolume!==e&&(this._previousVolume=e,this.audio.volume(e))}renderFrame(t){if(this.isInRange&&this._canPlay){if(!this._isPlaying){this.audio.play(),this.audio.seek(this._currentTime/Number(this.globalData?.frameRate)),this._isPlaying=!0;return}(!this.audio.playing()||Math.abs(this._currentTime/Number(this.globalData?.frameRate)-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/Number(this.globalData?.frameRate))}}resume(){this._canPlay=!0}setRate(t){this.audio.rate(t)}show(){}sourceRectAtTime(){return null}volume(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)}}class sD extends ey{constructor(t,e,s){if(super(),this.assetData=null,this.initFrame(),this.initRenderable(),t.refId&&(this.assetData=e.getAssetData(t.refId)??null),!e.imageLoader)throw Error(`${this.constructor.name}: imageLoader is not implemented in globalData`);this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(t,e,s)}getBaseElement(){return null}getFootageData(){return this.footageData}initExpressions(){let t=eh.interface;if(!t)return;let e=t("footage");this.layerInterface=new e(this)}prepareFrame(){}renderFrame(){}}class sT{constructor(t){this.animationData=t}getProp(t){let{sid:e}=t;return e&&this.animationData.slots?.[e]?Object.assign(t,this.animationData.slots[e].p):t}}class sF extends eg{addPendingElement(t){this.pendingElements.push(t)}buildAllItems(){let{length:t}=this.layers;for(let e=0;e<t;e++)this.buildItem(e);this.checkPendingElements()}buildElementParenting(t,e,s=[]){let{elements:i,layers:r}=this,{length:a}=r,n=0;for(;n<a;){if(r[n]?.ind!==e){n++;continue}let a=i[n];if(!a||!0===a){this.buildItem(n),this.addPendingElement(t),n++;continue}if(s.push(a),a.setAsParent(),r[n]?.parent===void 0){t.setHierarchy(s),n++;continue}this.buildElementParenting(t,r[n]?.parent,s),n++}}buildItem(t){throw Error(`${this.constructor.name}: Method buildItem not yet implemented`)}checkLayers(t){this.completeLayers=!0;let{length:e}=this.layers;for(let s=e-1;s>=0;s--){let e=this.layers[s];!this.elements[s]&&e&&e.ip-e.st<=Number(t)-e.st&&e.op-e.st>Number(t)-e.st&&this.buildItem(s),this.completeLayers=!!this.elements[s]&&this.completeLayers}this.checkPendingElements()}checkPendingElements(){throw Error(`${this.constructor.name}: Method checkPendingElements not yet implemented`)}createAudio(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sA(t,this.globalData,this)}createCamera(t){throw Error("You're using a 3d camera. Try the html renderer.")}createComp(t,e,s,i){throw Error(`${this.constructor.name}: Method createComp not yet implemented`)}createFootage(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sD(t,this.globalData,this)}createImage(t){throw Error(`${this.constructor.name}: Method createImage is not implemented`)}createItem(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}}createNull(t){throw Error(`${this.constructor.name}: Method createNull not implemented`)}createShape(t){throw Error(`${this.constructor.name}: Method createShape not implemented`)}createSolid(t){throw Error(`${this.constructor.name}: Method createSolid not implemented`)}createText(t){throw Error(`${this.constructor.name}: Method createText not implemented`)}getElementById(t){let{length:e}=this.elements;for(let s=0;s<e;s++)if(this.elements[s]?.data.ind===t)return this.elements[s]??null;return null}getElementByPath(t){let e,s=t.shift();if("number"==typeof s)e=this.elements[s];else{let{length:t}=this.elements;for(let i=0;i<t;i++)if(this.elements[i]?.data.nm===s){e=this.elements[i];break}}return 0===t.length?e:e?.getElementByPath(t)}includeLayers(t){this.completeLayers=!1;let{length:e}=t,{length:s}=this.layers;for(let i=0;i<e;i++){let e=0;for(;e<s;){if(this.layers[e]?.id===t[i]?.id){this.layers[e]=t[i];break}e++}}}initItems(){this.globalData?.progressiveLoad||this.buildAllItems()}prepareFrame(t){throw Error(`${this.constructor.name}: Method prepareFrame not yet implemented`)}searchExtraCompositions(t){let{length:e}=t;for(let s=0;s<e;s++)if(t[s]?.xt){let e=this.createComp(t[s]);e.initExpressions(),this.globalData?.projectInterface.registerComposition(e)}}setProjectInterface(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);t&&(this.globalData.projectInterface=t)}setupGlobalData(t,e){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);this.globalData.fontManager=new sC,this.globalData.slotManager=new sT(t),this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr||60,this.globalData.nm=t.nm,this.globalData.compSize={h:t.h,w:t.w}}constructor(...t){super(...t),this.completeLayers=!1,this.currentFrame=0,this.elements=[],this.layers=[],this.pendingElements=[]}}class sI extends eg{constructor(t,e,s){super(),this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initHierarchy()}getBaseElement(){return null}prepareFrame(t){this.prepareProperties(t,!0)}renderFrame(t){return null}}class s$ extends eR{constructor(t,e,s){super(t,e,s),this.initElement(t,e,s)}createContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=tc("rect");t.width.baseVal.value=this.data.sw||0,t.height.baseVal.value=this.data.sh||0,this.data.sc&&t.setAttribute("fill",this.data.sc),this.layerElement?.appendChild(t)}}let sL={shapes:[]};class sN extends sk{constructor(t,e,s){super(),this.createContainerElements=eV.prototype.createContainerElements,this.createRenderableComponents=eV.prototype.createRenderableComponents,this.destroyBaseElement=eV.prototype.destroyBaseElement,this.getBaseElement=eV.prototype.getBaseElement,this.getMatte=eV.prototype.getMatte,this.initRendererElement=eV.prototype.initRendererElement,this.renderedLetters=[],this.renderElement=eV.prototype.renderElement,this.setMatte=eV.prototype.setMatte,this.textSpans=[],this.renderType=ti.SVG,this.initElement(t,e,s)}buildNewText(){let t,e;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);if(!this.textProperty?.currentData)throw Error(`${this.constructor.name}: DocumentData is not implemented`);this.addDynamicProperty(this);let s=this.textProperty.currentData;this.renderedLetters=tp(s.l.length||0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",`${s.sw||0}`)),this.layerElement.setAttribute("font-size",`${s.finalSize||0}`);let i=this.globalData.fontManager?.getFontByName(s.f);if(i?.fClass)this.layerElement.classList.add(i.fClass);else{i?.fFamily&&this.layerElement.setAttribute("font-family",i.fFamily);let{fWeight:t}=s,{fStyle:e}=s;this.layerElement.setAttribute("font-style",e),this.layerElement.setAttribute("font-weight",t)}this.layerElement.ariaLabel=`${s.t}`;let r=s.l,a=!!this.globalData.fontManager?.chars;e=r.length;let n=null,o=this.mHelper,{singleShape:h}=this.data,l=0,p=0,m=!0,c=.001*s.tr*Number(s.finalSize);if(!h||a||s.sz){let d,u=this.textSpans.length;for(t=0;t<e;t++){if(this.textSpans[t]=this.textSpans[t]??{childSpan:null,glyph:null,span:null},!a||!h||0===t){if(!(n=(u>t?this.textSpans[t]?.span:tc(a?"g":"text"))??null))throw Error("Could not create tSpan");if(u<=t){if(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]&&(this.textSpans[t].span=n),a){let e=tc("g");n.appendChild(e),this.textSpans[t]&&(this.textSpans[t].childSpan=e)}this.textSpans[t]&&(this.textSpans[t].span=n),this.layerElement.appendChild(n)}n.style.display="inherit"}if(o.reset(),h&&(r[t]?.n&&(l=-c,p+=Number(s.yOffset),p+=+!!m,m=!1),this.applyTextPropertiesToMatrix(s,o,r[t]?.line??0,l,p),l+=r[t]?.l||0,l+=c),a){let e;if(d=this.globalData.fontManager?.getCharData(s.finalText[t]??"",i?.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily),d?.t===1)e=new sV(d.data,this.globalData,this);else{let t=sL;d?.data?.shapes&&(t=this.buildShapeData(d.data,Number(s.finalSize))),e=new ss(t,this.globalData,this)}if(this.textSpans[t]){let{glyph:s}=this.textSpans[t]??{};s&&(s.layerElement&&this.textSpans[t]?.childSpan?.removeChild(s.layerElement),s.destroy()),this.textSpans[t].glyph=e}e._debug=!0,e.prepareFrame(0),e.renderFrame(),e.layerElement&&this.textSpans[t]?.childSpan?.appendChild(e.layerElement),d?.t===1&&this.textSpans[t]?.childSpan?.setAttribute("transform",`scale(${Number(s.finalSize)/100},${Number(s.finalSize)/100})`);continue}n&&(h&&n.setAttribute("transform",`translate(${o.props[12]},${o.props[13]})`),n.textContent=r[t]?.val??"",n.style.whiteSpace="preserve")}h&&n?.setAttribute("d","")}else{let i,r=this.textContainer;switch(s.j){case 1:i="end";break;case 2:i="middle";break;default:i="start"}r?.setAttribute("text-anchor",i),r?.setAttribute("letter-spacing",`${c}`);let a=this.buildTextContents(s.finalText);for(e=a.length,p=s.ps?s.ps[1]+Number(s.ascent):0,t=0;t<e;t++)(n=this.textSpans[t]?.span??tc("tspan")).textContent=a[t]??"",n.setAttribute("x","0"),n.setAttribute("y",`${p}`),n.style.display="inherit",r?.appendChild(n),this.textSpans[t]=this.textSpans[t]??{glyph:null,span:null},this.textSpans[t].span=n,p+=Number(s.finalLineHeight);r&&this.layerElement.appendChild(r)}let d=this.textSpans[t]?.span;if(d)for(;t<this.textSpans.length;)d.style.display="none",t++;this._sizeChanged=!0}buildShapeData(t,e){if(t.shapes.length>0){let s=t.shapes[0];if(s?.it){let t=s.it[s.it.length-1];t?.s&&(t.s.k[0]=e,t.s.k[1]=e)}}return t}buildTextContents(t){let e=0,{length:s}=t,i=[],r="";for(;e<s;)"\r"===t[e]||"\x03"===t[e]?(i.push(r),r=""):r+=t[e]??"",e++;return i.push(r),i}createContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);this.data.singleShape&&!this.globalData.fontManager?.chars&&(this.textContainer=tc("text"))}getValue(){let t;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let{length:e}=this.textSpans;this.renderedFrame=this.comp?.renderedFrame??-1;for(let s=0;s<e;s++)(t=this.textSpans[s]?.glyph)&&(t.prepareFrame(Number(this.comp?.renderedFrame)-this.data.st),t._mdf&&(this._mdf=!0))}renderInnerContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.validateText(),!this.data.singleShape||this._mdf){if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not initialized`);if(this.textAnimator?.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator?.lettersChangedFlag){let t,e,s;this._sizeChanged=!0;let i=this.textAnimator?.renderedLetters,r=this.textProperty.currentData.l,{length:a}=r;for(let n=0;n<a;n++)!r[n]?.n&&(t=i?.[n],e=this.textSpans[n]?.span,(s=this.textSpans[n]?.glyph)&&s.renderFrame(),t?._mdf.m&&e?.setAttribute("transform",t.m),t?._mdf.o&&e?.setAttribute("opacity",`${t.o??1}`),t?._mdf.sw&&e?.setAttribute("stroke-width",`${t.sw||0}`),t?._mdf.sc&&e?.setAttribute("stroke",t.sc),t?._mdf.fc&&e?.setAttribute("fill",t.fc))}}}sourceRectAtTime(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.comp)throw Error(`${this.constructor.name}: comp (ElementInterface) is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;let t=this.layerElement.getBBox();return this.bbox={height:t.height,left:t.x,top:t.y,width:t.width},this.bbox}return null}}class sB extends sF{appendElementInPos(t,e){let s=t.getBaseElement();if(!s)return;let i=0,r;for(;i<e;)!0!==this.elements[i]&&this.elements[i]?.getBaseElement()&&(r=this.elements[i]?.getBaseElement()),i++;r?this.layerElement?.insertBefore(s,r):this.layerElement?.appendChild(s)}buildItem(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData it not implemented`);let{elements:e,globalData:s,layers:i}=this;if(e[t]||i[t]?.ty===99)return;e[t]=!0;let r=this.createItem(i[t]);if(e[t]=r,eh.plugin&&(i[t]?.ty===0&&s.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),i[t]?.tt){let s="tp"in i[t]?this.findIndexByInd(i[t].tp):t-1;if(-1===s)return;if(!e[s]||!0===e[s]){this.buildItem(s),this.addPendingElement(r);return}let a=e[s].getMatte(i[t].tt);r.setMatte(a)}}checkPendingElements(){for(;this.pendingElements.length>0;){let t=this.pendingElements.pop();if(t?.checkParenting(),t?.data.tt){let e=0,{length:s}=this.elements;for(;e<s;){if(this.elements[e]!==t){e++;continue}let s="tp"in t.data?this.findIndexByInd(t.data.tp):e-1,i=this.elements[s]?.getMatte(this.layers[e]?.tt)??"";t.setMatte(i);break}}}}configAnimation(t){try{if(!this.animationItem)throw Error(`${this.constructor.name}: Can't access animationItem`);if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);if(!this.renderConfig)throw Error(`${this.constructor.name}: Can't access renderConfig`);if(!this.svgElement)throw Error(`${this.constructor.name}: Can't access svgElement`);this.svgElement.setAttribute("xmlns",N),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox",`0 0 ${t.w} ${t.h}`),!this.renderConfig.viewBoxOnly&&(this.svgElement.setAttribute("width",`${t.w}`),this.svgElement.setAttribute("height",`${t.h}`),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.renderConfig.contentVisibility&&(this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility)),this.renderConfig.width&&this.svgElement.setAttribute("width",`${this.renderConfig.width}`),this.renderConfig.height&&this.svgElement.setAttribute("height",`${this.renderConfig.height}`),this.renderConfig.className&&this.svgElement.classList.add(this.renderConfig.className),this.renderConfig.id&&(this.svgElement.id=this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",`${this.renderConfig.focusable}`),this.renderConfig.preserveAspectRatio&&this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper?.appendChild(this.svgElement);let{defs:e}=this.globalData;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;let s=tc("clipPath"),i=tc("rect");i.width.baseVal.value=t.w,i.height.baseVal.value=t.h,i.x.baseVal.value=0,i.y.baseVal.value=0;let r=v();s.id=r,s.appendChild(i),this.layerElement?.setAttribute("clip-path",`url(${tu()}#${r})`),e.appendChild(s),this.layers=t.layers,this.elements=tp(t.layers.length)}catch(t){console.error(`${this.constructor.name}:
|
|
1
|
+
!function(t){"use strict";let e,s,i,r,a,n,o,h,l,p,m,c,d,u,f={current:""},g=(t,e)=>1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e)),y=t=>1e-5>=Math.abs(t),b=(t,e)=>g(t[0],e[0])&&g(t[1],e[1]),v=(i=0,()=>(i++,`${f.current}__lottie_element_${i}`)),_=(t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)},x=(t,e)=>{let s=new Blob([t],{type:e?.mimeType??""}),i=e?.name||v(),r=URL.createObjectURL(s),a=document.createElement("a");a.href=r,a.download=i,a.hidden=!0,document.body.appendChild(a),a.click(),setTimeout(()=>{a.remove(),URL.revokeObjectURL(r)},1e3)},w=t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()},E=t=>{let e=t.split(":")[1]?.split(";")[0];return e?.split("/")[1]?.split("+")[0]},C=(t,e)=>(w(t),`${t.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`),S=(t,e)=>{if(e)return w(e)?w(e)===t?e:`${C(e)}.${t}`:`${e}.${t}`},k=t=>Symbol.iterator in Object(t)&&t.length>0,M=t=>k(t)&&"number"==typeof t[0],P=t=>!("h"in t)&&!("w"in t)&&"p"in t&&"e"in t&&"u"in t&&"id"in t,A=t=>"w"in t&&"h"in t&&!("xt"in t)&&"p"in t,D=t=>!(!t||k(t))&&"_type"in t&&"ShapePath"===t._type,T=t=>t.slice(Math.max(0,t.indexOf(",")+1)),F=t=>{t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.display="block",t.style.transformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.transformStyle="preserve-3d"},I=t=>{if(!t)return"rgb(0,0,0)";let e=(t[0]??0)|0,s=(t[1]??0)|0,i=(t[2]??0)|0;return`rgb(${e},${s},${i})`},$=Math.PI/180,L="http://www.w3.org/1999/xlink",N="http://www.w3.org/2000/svg",B=!("u">typeof window&&document),V="u">typeof navigator,R=!!V&&/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent);var O,z,G,q,j,H,W,Y,U,J,X,Z,K=((O={}).Float32="float32",O.Int16="int16",O.Int32="int32",O.Uint8="uint8",O.Uint8c="uint8c",O),Q=((z={}).MouseModifier="ms",z.OffsetPathModifier="op",z.PuckerAndBloatModifier="pb",z.RepeaterModifier="rp",z.RoundCornersModifier="rd",z.TrimModifier="tm",z.ZigZagModifier="zz",z),tt=((G={}).Bounce="bounce",G.Normal="normal",G),te=((q={}).Active="_active",q.Complete="complete",q.ConfigError="configError",q.ConfigReady="config_ready",q.DataFailed="data_failed",q.DataReady="data_ready",q.Destroy="destroy",q.Destroyed="destroyed",q.DOMLoaded="DOMLoaded",q.DrawnFrame="drawnFrame",q.EnterFrame="enterFrame",q.Error="error",q.Frame="frame",q.Freeze="freeze",q.Idle="_idle",q.Load="load",q.LoadedImages="loaded_images",q.Loop="loop",q.LoopComplete="loopComplete",q.MouseEnter="mouseenter",q.MouseLeave="mouseleave",q.Next="next",q.Pause="_pause",q.Play="_play",q.Previous="previous",q.Ready="ready",q.Rendered="rendered",q.RenderFrameError="renderFrameError",q.SegmentStart="segmentStart",q.Stop="stop",q),ts=((j={}).Contain="xMidYMid meet",j.Cover="xMidYMid slice",j.Initial="none",j.None="xMinYMin slice",j),ti=((H={}).Canvas="canvas",H.HTML="html",H.SVG="svg",H),tr=((W={}).Ellipse="el",W.Fill="fl",W.GradientFill="gf",W.GradientStroke="gs",W.Group="gr",W.Merge="mm",W.NoStyle="no",W.OffsetPath="op",W.Path="sh",W.PolygonStar="sr",W.PuckerBloat="pb",W.Rectangle="rc",W.Repeater="rp",W.RoundedCorners="rd",W.Stroke="st",W.Transform="tr",W.Trim="tm",W.Twist="tw",W.Unknown="ms",W.ZigZag="zz",W),ta=((Y={}).TransformEffect="transformEffect",Y),tn=((U={}).MultiDimensional="multidimensiional",U.Shape="shape",U.TextSelector="textSelector",U.Transform="transform",U.UniDimensional="unidimensional",U);let to={1:"butt",2:"round",3:"square"},th={1:"miter",2:"round",3:"bevel"},tl=(()=>{function t(t,e){let s,i=[];switch(t){case K.Int16:case K.Uint8c:s=1;break;case K.Float32:case K.Int32:case K.Uint8:default:s=1.1}for(let t=0;t<e;t++)i.push(s);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(e,s){return e===K.Float32?new Float32Array(s):e===K.Int16?new Int16Array(s):e===K.Uint8c?new Uint8ClampedArray(s):t(e,s)}:t})();function tp(t){return Array.from({length:t})}class tm{constructor(){this.props=tl(K.Float32,16),this._identity=!0,this._identityCalculated=!1,this.reset()}applyToPoint(t,e,s){return{x:t*(this.props[0]??0)+e*(this.props[4]??0)+s*(this.props[8]??0)+(this.props[12]??0),y:t*(this.props[1]??0)+e*(this.props[5]??0)+s*(this.props[9]??0)+(this.props[13]??0),z:t*(this.props[2]??0)+e*(this.props[6]??0)+s*(this.props[10]??0)+(this.props[14]??0)}}applyToPointArray(t,e,s){return this.isIdentity()?[t,e,s]:[t*(this.props[0]??0)+e*(this.props[4]??0)+s*(this.props[8]??0)+(this.props[12]??0),t*(this.props[1]??0)+e*(this.props[5]??0)+s*(this.props[9]??0)+(this.props[13]??0),t*(this.props[2]??0)+e*(this.props[6]??0)+s*(this.props[10]??0)+(this.props[14]??0)]}applyToPointStringified(t,e){if(this.isIdentity())return`${t},${e}`;let s=this.props;return`${Math.round((t*(s[0]??0)+e*(s[4]??0)+(s[12]??0))*100)/100},${Math.round((t*(s[1]??0)+e*(s[5]??0)+(s[13]??0))*100)/100}`}applyToTriplePoints(t,e,s){let i=tl(K.Float32,6);if(this.isIdentity())i.set([t[0]??0,t[1]??0,e[0]??0,e[1]??0,s[0]??0,s[1]??0]);else{let r=this.props[0]??0,a=this.props[1]??0,n=this.props[4]??0,o=this.props[5]??0,h=this.props[12]??0,l=this.props[13]??0;i.set([(t[0]??0)*r+(t[1]??0)*n+h,(t[0]??0)*a+(t[1]??0)*o+l,(e[0]??0)*r+(e[1]??0)*n+h,(e[0]??0)*a+(e[1]??0)*o+l,(s[0]??0)*r+(s[1]??0)*n+h,(s[0]??0)*a+(s[1]??0)*o+l])}return i}applyToX(t,e,s){return t*(this.props[0]??0)+e*(this.props[4]??0)+s*(this.props[8]??0)+(this.props[12]??0)}applyToY(t,e,s){return t*(this.props[1]??0)+e*(this.props[5]??0)+s*(this.props[9]??0)+(this.props[13]??0)}applyToZ(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}clone(t){return t.props.set(this.props),t}cloneFromProps(t){return this.props.set(t),this}equals(t){return this.props.every((e,s)=>e===t?.props[s])}getInverseMatrix(){let t=(this.props[0]??0)*(this.props[5]??0)-(this.props[1]??0)*(this.props[4]??0),e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,r=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new tm;return o.setTransform(e,s,0,0,i,r,0,0,0,0,1,0,a,n,0,1),o}inversePoint(t){return this.getInverseMatrix().applyToPoint(t[0]??0,t[1]??0,t[2]??0)}inversePoints(t){return t.map(t=>this.inversePoint(t))}isIdentity(){return this._identityCalculated||(this._identity=1===this.props[0]&&0===this.props[1]&&0===this.props[2]&&0===this.props[3]&&0===this.props[4]&&1===this.props[5]&&0===this.props[6]&&0===this.props[7]&&0===this.props[8]&&0===this.props[9]&&1===this.props[10]&&0===this.props[11]&&0===this.props[12]&&0===this.props[13]&&0===this.props[14]&&1===this.props[15],this._identityCalculated=!0),this._identity}multiply(t){return this.transform(...t.props)}reset(){return this.props.set([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this}rotate(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}rotateX(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}rotateY(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}rotateZ(t){return this.rotate(t)}scale(t,e,s=1){return 1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}setTransform(t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f){return this.props.set([t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f]),this}shear(t,e){return this._t(1,e,t,1,0,0)}skew(t,e){return this.shear(Math.tan(t),Math.tan(e))}skewFromAxis(t,e){let s=Math.cos(e),i=Math.sin(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}to2dCSS(){let t=this.roundMatrixProperty(this.props[0]??0),e=this.roundMatrixProperty(this.props[1]??0),s=this.roundMatrixProperty(this.props[4]??0),i=this.roundMatrixProperty(this.props[5]??0),r=this.roundMatrixProperty(this.props[12]??0),a=this.roundMatrixProperty(this.props[13]??0);return`matrix(${t},${e},${s},${i},${r},${a})`}toCSS(){let t="matrix3d(";for(let e=0;e<16;e++)t+=`${Math.round((this.props[e]??0)*1e4)/1e4}`+(15===e?")":",");return t}transform(t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f){let g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===r&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return g[12]=(g[12]??0)*t+(g[15]??0)*c,g[13]=(g[13]??0)*a+(g[15]??0)*d,g[14]=(g[14]??0)*p+(g[15]??0)*u,g[15]*=f,this._identityCalculated=!1,this;let y=g[0]??0,b=g[1]??0,v=g[2]??0,_=g[3]??0,x=g[4]??0,w=g[5]??0,E=g[6]??0,C=g[7]??0,S=g[8]??0,k=g[9]??0,M=g[10]??0,P=g[11]??0,A=g[12]??0,D=g[13]??0,T=g[14]??0,F=g[15]??0;return g[0]=y*t+b*r+v*h+_*c,g[1]=y*e+b*a+v*l+_*d,g[2]=y*s+b*n+v*p+_*u,g[3]=y*i+b*o+v*m+_*f,g[4]=x*t+w*r+E*h+C*c,g[5]=x*e+w*a+E*l+C*d,g[6]=x*s+w*n+E*p+C*u,g[7]=x*i+w*o+E*m+C*f,g[8]=S*t+k*r+M*h+P*c,g[9]=S*e+k*a+M*l+P*d,g[10]=S*s+k*n+M*p+P*u,g[11]=S*i+k*o+M*m+P*f,g[12]=A*t+D*r+T*h+F*c,g[13]=A*e+D*a+T*l+F*d,g[14]=A*s+D*n+T*p+F*u,g[15]=A*i+D*o+T*m+F*f,this._identityCalculated=!1,this}translate(t,e,s){let i=s||0;return 0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}_t(...t){if(6===t.length){let[e,s,i,r,a,n]=t;return this.transform(e,s,0,0,i,r,0,0,0,0,1,0,a,n,0,1)}return this.transform(...t)}roundMatrixProperty(t){return t<1e-6&&t>0||t>-1e-6&&t<0?Math.round(1e4*t)/1e4:t}}function tc(t){return B?null:document.createElementNS(N,t)}let td={current:""},tu=()=>td.current,tf={};class tg{constructor(t){let e;this.filters=[];const{length:s}=t.data.ef??[];for(let i=0;i<s;i++){e=null;const s=t.data.ef?.[i]?.ty;s&&tf[s]&&(e=new tf[s].effect(t.effectsManager?.effectElements[i],t)),e&&this.filters.push(e)}this.filters.length>0&&t.addRenderableComponent(this)}getEffects(t){let{length:e}=this.filters,s=[];for(let i=0;i<e;i++){let e=this.filters[i];e?.type===t&&s.push(e)}return s}renderFrame(t){let{length:e}=this.filters;for(let s=0;s<e;s++)this.filters[s]?.renderFrame(t)}}class ty{constructor(t,e,s){this._length=0,this._maxLength=t,this._create=e,this._release=s,this.pool=tp(this._maxLength),this.newElement=this.newElement.bind(this),this.release=this.release.bind(this)}newElement(){let t;return this._length?(this._length-=1,t=this.pool[this._length]):t=this._create(),t}release(t){if(this._length===this._maxLength){var e;this.pool=[...e=this.pool,...tp(e.length)],this._maxLength*=2}this._release&&this._release(t),this.pool[this._length]=t,this._length++}}let tb=new ty(8,()=>tl(K.Float32,2));class tv{get _type(){return"ShapePath"}constructor(){this._length=0,this._maxLength=8,this.c=!1,this.lengths=[],this.v=tp(this._maxLength),this.o=tp(this._maxLength),this.i=tp(this._maxLength)}doubleArrayLength(){this.v=[...this.v,...tp(this._maxLength)],this.i=[...this.i,...tp(this._maxLength)],this.o=[...this.o,...tp(this._maxLength)],this._maxLength*=2}length(){return this._length}setLength(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t}setPathData(t,e){this.c=t,this.setLength(e);let s=0;for(;s<e;)this.v[s]=tb.newElement(),this.o[s]=tb.newElement(),this.i[s]=tb.newElement(),s++}setTripleAt(t,e,s,i,r,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(s,i,"o",n,o),this.setXYAt(r,a,"i",n,o)}setXYAt(t,e,s,i,r){let a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}a[i]&&r||(a[i]=tb.newElement()),a[i][0]=t,a[i][1]=e}toReversed(){let t=new tv;t.setPathData(this.c,this._length);let e=this.v,s=this.o,i=this.i,r=0;this.c&&(t.setTripleAt(e[0]?.[0]??0,e[0]?.[1]??0,i[0]?.[0]??0,i[0]?.[1]??0,s[0]?.[0]??0,s[0]?.[1]??0,0,!1),r=1);let{_length:a}=this,n=a-1;for(let o=r;o<a;o++)t.setTripleAt(e[n]?.[0]??0,e[n]?.[1]??0,i[n]?.[0]??0,i[n]?.[1]??0,s[n]?.[0]??0,s[n]?.[1]??0,o,!1),n-=1;return t}}let t_=new ty(4,function(){return new tv},function(t){if(!D(t))return;let e=t._length;for(let s=0;s<e;s++)tb.release(t.v[s]),tb.release(t.i[s]),tb.release(t.o[s]),t.v[s]=null,t.i[s]=null,t.o[s]=null;t._length=0,t.c=!1}),{newElement:tx}=t_,{release:tw}=t_;function tE(t){let e=tx(),s=t._length??t.v.length;e.setLength(s),e.c=t.c;for(let i=0;i<s;i++)e.setTripleAt(t.v[i]?.[0]??0,t.v[i]?.[1]??0,t.o[i]?.[0]??0,t.o[i]?.[1]??0,t.i[i]?.[0]??0,t.i[i]?.[1]??0,i);return e}class tC{constructor(){this._length=0,this._maxLength=4,this.shapes=tp(this._maxLength)}addShape(t){this._length===this._maxLength&&(this.shapes=[...this.shapes,...tp(this._maxLength)],this._maxLength*=2),this.shapes[this._length]=t,this._length++}releaseShapes(){for(let t=0;t<this._length;t++)tw(this.shapes[t]);this._length=0}}function tS(){return new tC}tp(4);let tk={default:150},tM=new ty(8,()=>({addedLength:0,lengths:tl(K.Float32,tk.default),percents:tl(K.Float32,tk.default)})),tP=new ty(8,()=>({lengths:[],totalLength:0}),t=>{if(!D(t))return;let{length:e}=t.lengths;for(let s=0;s<e;s++)tM.release(t.lengths[s]);t.lengths.length=0}),tA=tl(K.Float32,8);function tD(t,e,s,i){let r={},a=`${t[0]}_${t[1]}_${e[0]}_${e[1]}_${s[0]}_${s[1]}_${i[0]}_${i[1]}`.replaceAll(".","p");if(!r[a]){let n=tk.default,o,h,l=0,p,m,c=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&tI(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&tI(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(n=2);let d=new tB(n),{length:u}=s;for(let r=0;r<n;r++){m=tp(u),h=r/(n-1),p=0;for(let r=0;r<u;r++)o=Math.pow(1-h,3)*(t[r]??0)+3*Math.pow(1-h,2)*h*((t[r]??0)+(s[r]??0))+3*(1-h)*Math.pow(h,2)*((e[r]??0)+(i[r]??0))+Math.pow(h,3)*(e[r]??0),m[r]=o,null!==c&&(p+=Math.pow(Number(m[r])-Number(c[r]),2));l+=p=Math.sqrt(p),d.points[r]=new tV(p,m),c=m}d.segmentLength=l,r[a]=d}return r[a]}function tT(t,e,s,i,r,a,n){let o=r,h=a;o<0?o=0:o>1&&(o=1);let l=tN(o,n)??0,p=tN(h=h>1?1:h,n)??0,m=1-l,c=1-p,d=m*m*m,u=l*m*m*3,f=l*l*m*3,g=l*l*l,y=m*m*c,b=l*m*c+m*l*c+m*m*p,v=l*l*c+m*l*p+l*m*p,_=l*l*p,x=m*c*c,w=l*c*c+m*p*c+m*c*p,E=l*p*c+m*p*p+l*c*p,C=l*p*p,S=c*c*c,k=p*c*c+c*p*c+c*c*p,M=p*p*c+c*p*p+p*c*p,P=p*p*p,{length:A}=t;for(let r=0;r<A;r++)tA[4*r]=Math.round((d*(t[r]??0)+u*(s[r]??0)+f*(i[r]??0)+g*(e[r]??0))*1e3)/1e3,tA[4*r+1]=Math.round((y*(t[r]??0)+b*(s[r]??0)+v*(i[r]??0)+_*(e[r]??0))*1e3)/1e3,tA[4*r+2]=Math.round((x*(t[r]??0)+w*(s[r]??0)+E*(i[r]??0)+C*(e[r]??0))*1e3)/1e3,tA[4*r+3]=Math.round((S*(t[r]??0)+k*(s[r]??0)+M*(i[r]??0)+P*(e[r]??0))*1e3)/1e3;return tA}function tF(t){let e,s=tP.newElement(),i=t.c,r=t.v,a=t.o,n=t.i,o=t._length||0,{lengths:h}=s,l=0;for(e=0;e<o-1;e++)h[e]=tL(r[e],r[e+1],a[e],n[e+1]),l+=h[e]?.addedLength??0;return i&&o&&(h[e]=tL(r[e],r[0],a[e],n[0]),l+=h[e]?.addedLength??0),s.totalLength=l,s}function tI(t,e,s,i,r,a){let n=t*i+e*r+s*a-r*i-a*t-s*e;return n>-.001&&n<.001}function t$(t,e,s,i,r,a,n,o,h){let l;if(0===s&&0===a&&0===h)return tI(t,e,i,r,n,o);let p=Math.sqrt(Math.pow(i-t,2)+Math.pow(r-e,2)+Math.pow(a-s,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-s,2)),c=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-r,2)+Math.pow(h-a,2));return(l=p>m?p>c?p-m-c:c-m-p:c>m?c-m-p:m-p-c)>-1e-4&&l<1e-4}function tL(t,e,s,i){let r=tk.default,a,n,o=0,h,l=[],p=[],m=tM.newElement(),c=s.length;for(let d=0;d<r;d++){n=d/(r-1),h=0;for(let r=0;r<c;r++)a=Math.pow(1-n,3)*(t[r]??0)+3*Math.pow(1-n,2)*n*(s[r]??0)+3*(1-n)*Math.pow(n,2)*(i[r]??0)+Math.pow(n,3)*(e[r]??0),l[r]=a,"number"==typeof p[r]&&(h+=Math.pow((l[r]??0)-(p[r]??0),2)),p[r]=l[r]??0;h&&(o+=h=Math.sqrt(h)),m.percents[d]=n,m.lengths[d]=o}return m.addedLength=o,m}function tN(t,{addedLength:e,lengths:s,percents:i}){let{length:r}=i,a=Math.floor((r-1)*t),n=t*e,o=0;if(a===r-1||0===a||n===s[a])return i[a];let h=(s[a]??0)>n?-1:1,l=!0;for(;l;)if((s[a]??0)<=n&&(s[a+1]??0)>n?(o=(n-(s[a]??0))/((s[a+1]??0)-(s[a]??0)),l=!1):a+=h,a<0||a>=r-1){if(a===r-1)return i[a];l=!1}return(i[a]??0)+((i[a+1]??0)-(i[a]??0))*o}class tB{constructor(t){this.segmentLength=0,this.points=Array.from({length:t})}}class tV{constructor(t,e){this.partialLength=t,this.point=e}}let tR=function(t,e,s,i,r,a){let n=tN(r,a)??0,o=1-n;return[Math.round((o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*s[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0])*1e3)/1e3,Math.round((o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*s[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1])*1e3)/1e3]},tO={};function tz(t,e,s,i,r){let a=r||`bez_${t}_${e}_${s}_${i}`.replaceAll(".","p");if(tO[a])return tO[a];let n=new tG([t,e,s,i]);return tO[a]=n,n}class tG{constructor(t){this._precomputed=!1,this.float32ArraySupported="function"==typeof Float32Array,this.kSplineTableSize=11,this.kSampleStepSize=1/(this.kSplineTableSize-1),this.NEWTON_ITERATIONS=4,this.NEWTON_MIN_SLOPE=.001,this.SUBDIVISION_MAX_ITERATIONS=10,this.SUBDIVISION_PRECISION=1e-7,this._p=t,this._mSampleValues=this.float32ArraySupported?new Float32Array(this.kSplineTableSize):Array.from({length:this.kSplineTableSize}),this.get=this.get.bind(this)}_calcSampleValues(){let t=this._p[0],e=this._p[2];for(let s=0;s<this.kSplineTableSize;++s)this._mSampleValues[s]=this.calcBezier(s*this.kSampleStepSize,t??0,e??0)}_getTForX(t){let e=this._p[0],s=this._p[2],i=this._mSampleValues,r=0,a=1,n=this.kSplineTableSize-1;for(;a!==n&&Number(i[a])<=t;)r+=this.kSampleStepSize,++a;let o=r+(t-Number(i[--a]))/(Number(i[a+1])-Number(i[a]))*this.kSampleStepSize,h=this.getSlope(o,e??0,s??0);return h>=this.NEWTON_MIN_SLOPE?this.newtonRaphsonIterate(t,o,e??0,s??0):0===h?o:this.binarySubdivide(t,r,r+this.kSampleStepSize,e??0,s??0)}_precompute(){let t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,(t!==e||s!==i)&&this._calcSampleValues()}get(t){let e=this._p[0],s=this._p[1],i=this._p[2],r=this._p[3];return(this._precomputed||this._precompute(),e===s&&i===r)?t:0===t?0:1===t?1:this.calcBezier(this._getTForX(t),s??0,r??0)}A(t,e){return 1-3*e+3*t}B(t,e){return 3*e-6*t}binarySubdivide(t,e,s,i,r){let a=e,n=s,o,h,l=0;do h=a+(n-a)/2,(o=this.calcBezier(h,i,r)-t)>0?n=h:a=h;while(Math.abs(o)>this.SUBDIVISION_PRECISION&&++l<this.SUBDIVISION_MAX_ITERATIONS);return h}C(t){return 3*t}calcBezier(t,e,s){return((this.A(e,s)*t+this.B(e,s))*t+this.C(e))*t}getSlope(t,e,s){return 3*this.A(e,s)*t*t+2*this.B(e,s)*t+this.C(e)}newtonRaphsonIterate(t,e,s,i){let r=e;for(let e=0;e<this.NEWTON_ITERATIONS;++e){let e=this.getSlope(r,s,i);if(0===e)break;let a=this.calcBezier(r,s,i)-t;r-=a/e}return r}}class tq{addDynamicProperty(t){this.dynamicProperties.includes(t)||(this.dynamicProperties.push(t),this.container?.addDynamicProperty(this),this._isAnimated=!0)}getValue(t){throw Error(`${this.constructor.name}: Method getValue is not implemented`)}initDynamicPropertyContainer(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}iterateDynamicProperties(){this._mdf=!1;let{length:t}=this.dynamicProperties;for(let e=0;e<t;e++)this.dynamicProperties[e]?.getValue(),this.dynamicProperties[e]?._mdf&&(this._mdf=!0);return 0}setGroupProperty(t){}constructor(){this.dynamicProperties=[]}}let tj=t=>{let e=t[0]*$,s=t[1]*$,i=t[2]*$,r=Math.cos(e/2),a=Math.cos(s/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(s/2),l=Math.sin(i/2);return[o*h*n+r*a*l,o*a*n+r*h*l,r*h*n-o*a*l,r*a*n-o*h*l]};class tH extends tq{addEffect(t){this.effectsSequence.push(t),this.container?.addDynamicProperty(this)}getSpeedAtTime(t){throw Error(`${this.constructor.name}: Method getSpeedAtTime is not implemented`)}getValueAtCurrentTime(){if(this._caching=this._caching??{},!this.keyframes)return;let{_caching:t,comp:e,keyframes:s,offsetTime:i}=this,r=Number(e?.renderedFrame)-i,a=(s[0]?.t??0)-i,n=s.length-1,o=(s[n]?.t??0)-i,{lastFrame:h}=t;return r===h||-999999!==h&&(h>=o&&r>=o||h<a&&r<a)||(h>=r&&(t._lastKeyframeIndex=-1,t.lastIndex=0),this.pv=this.interpolateValue(r,t)),t.lastFrame=r,this.pv}getValueAtTime(t,e){throw Error(`${this.constructor.name}: Method getValueAtTime is not implemented`)}getVelocityAtTime(t){throw Error(`${this.constructor.name}: Method getVelocityAtTime is not implemented`)}initiateExpression(t,e,s){throw Error("Method not implemented")}interpolateValue(t,e={}){let s,{offsetTime:i,pv:r}=this,a=[0,0,0];this.propType===tn.MultiDimensional&&r&&(a=tl(K.Float32,r.length));let{keyframes:n=[],keyframesMetadata:o,propType:h}=this,l=e.lastIndex||0,p=l,m=n.length-1,c=!0,d=n[0]??{},u=n[1]??{};for(;c;){if(d=n[p]??{},u=n[p+1]??{},p===m-1&&t>=u.t-i){d.h&&(d=u),l=0;break}if(u.t-i>t){l=p;break}p<m-1?p++:(l=0,c=!1)}let f=o[p]??{},g,y,b,v,_=null,x=u.t-i,w=d.t-i;if(d.to&&d.s){f.bezierData=f.bezierData??tD(d.s,u.s??d.e,d.to,d.ti);let{__fnct:s,bezierData:i}=f;if(t>=x||t<w){let e=t>=x?i.points.length-1:0;g=i.points[e]?.point.length??0;for(let t=0;t<g;t++)a[t]=i.points[e]?.point[t]??0}else{s?_=s:f.__fnct=_=tz(d.o.x,d.o.y,d.i.x,d.i.y,d.n).get,y=_((t-w)/(x-w));let r=i.segmentLength*y,n,o=e.lastFrame<t&&e._lastKeyframeIndex===p?e._lastAddedLength:0;for(v=e.lastFrame<t&&e._lastKeyframeIndex===p?e._lastPoint:0,c=!0,b=i.points.length;c;){if(o+=i.points[v]?.partialLength??0,0===r||0===y||v===i.points.length-1){g=i.points[v]?.point.length??0;for(let t=0;t<g;t++)a[t]=i.points[v]?.point[t]??0;break}if(r>=o&&r<o+(i.points[v+1]?.partialLength??0)){n=(r-o)/(i.points[v+1]?.partialLength??0),g=i.points[v]?.point.length??0;for(let t=0;t<g;t++)a[t]=(i.points[v]?.point[t]??0)+((i.points[v+1]?.point[t]??0)-(i.points[v]?.point[t]??0))*n;break}v<b-1?v++:c=!1}e._lastPoint=v,e._lastAddedLength=o-(i.points[v]?.partialLength??0),e._lastKeyframeIndex=p}}else{let e,i,r,n;if(m=d.s?.length||0,s=u.s??d.e,this.sh&&1!==d.h)if(t>=x)a[0]=s[0],a[1]=s[1],a[2]=s[2];else if(t<=w&&d.s)a[0]=d.s[0],a[1]=d.s[1],a[2]=d.s[2];else{var E,C,S;let e,i,r,n,o,h,l,p,m,c,u,f,g,y,b,v,_,k,M,P,A,D=tj(d.s),T=tj(s);C=a,b=(E=(t-w)/(x-w),e=[0,0,0,0],i=D[0],r=D[1],n=D[2],o=D[3],h=T[0],l=T[1],(u=i*h+r*l+n*(p=T[2])+o*(m=T[3]))<0&&(u=-u,h=-h,l=-l,p=-p,m=-m),1-u>1e-6?(f=Math.sin(c=Math.acos(u)),g=Math.sin((1-E)*c)/f,y=Math.sin(E*c)/f):(g=1-E,y=E),e[0]=g*i+y*h,e[1]=g*r+y*l,e[2]=g*n+y*p,e[3]=g*o+y*m,S=e)[0],v=S[1],_=S[2],M=Math.atan2(2*v*(k=S[3])-2*b*_,1-2*v*v-2*_*_),P=Math.asin(2*b*v+2*_*k),A=Math.atan2(2*b*k-2*v*_,1-2*b*b-2*_*_),C[0]=M/$,C[1]=P/$,C[2]=A/$}else for(p=0;p<m;p++)1!==d.h&&(t>=x?y=1:t<w?y=0:(d.o.x.constructor===Array?(f.__fnct=f.__fnct??[],f.__fnct[p]?_=f.__fnct[p]:k(d.o.y)&&k(d.i.y)&&k(d.i.x)&&(e=d.o.x[p]??d.o.x[0],i=d.o.y[p]??d.o.y[0],_=tz(e??0,i??0,(r=d.i.x[p]??d.i.x[0])??0,d.i.y[p]??d.i.y[0]??0).get,f.__fnct[p]=_)):f.__fnct?_=f.__fnct:(e=d.o.x,i=d.o.y,_=tz(e,i,r=d.i.x,d.i.y).get,d.keyframeMetadata=_),y=_?.((t-w)/(x-w)))),s=u.s??d.e,void 0!==(n=1===d.h?d.s?.[p]:Number(d.s?.[p])+((s[p]??0)-Number(d.s?.[p]))*Number(y))&&(h===tn.MultiDimensional?a[p]=n:a=n)}return e.lastIndex=l,a}processEffectsSequence(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.elem)throw Error(`${this.constructor.name}: elem (ElementInterface) is not implemented`);if(this.elem.globalData?.frameId===this.frameId)return 0;if(0===this.effectsSequence.length)return this._mdf=!1,0;if(this.lock&&this.pv)return this.setVValue(this.pv),0;this.lock=!0,this._mdf=!!this._isFirstFrame;let t=this.effectsSequence.length,e=this.kf?this.pv:this.data.k;for(let s=0;s<t;s++)e=this.effectsSequence[s]?.(e);return this.setVValue(e),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData?.frameId,0}setVValue(t){let e;if("number"==typeof t&&this.propType===tn.UniDimensional){e=t*Number(this.mult),Math.abs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);return}let s=0,{length:i}=this.v;for(;s<i;)e=(t[s]??0)*Number(this.mult),Math.abs((this.v[s]??0)-e)>1e-5&&(this.v[s]=e,this._mdf=!0),s++}speedAtTime(t){throw Error("Method is not implemented")}valueAtTime(t,e){throw Error(`${this.constructor.name}: Method valueAtTime is not implemented`)}velocityAtTime(t){throw Error("Method is not implemented")}constructor(...t){super(...t),this._isFirstFrame=!1,this.effectsSequence=[],this.initFrame=-999999,this.keyframesMetadata=[],this.offsetTime=0}}class tW extends tH{constructor(t,e,s=null,i=null){let r,a,n,o;super(),this.propType=tn.MultiDimensional;const{length:h}=e.k;for(let t=0;t<h-1;t++)e.k[t]?.to&&e.k[t]?.s&&e.k[t+1]?.s&&(r=e.k[t]?.s,a=e.k[t+1]?.s,n=e.k[t]?.to,o=e.k[t]?.ti,(2===r.length&&(r[0]!==a[0]||r[1]!==a[1])&&tI(r[0]??0,r[1]??0,a[0]??0,a[1]??0,(r[0]??0)+(n[0]??0),(r[1]??0)+(n[1]??0))&&tI(r[0]??0,r[1]??0,a[0]??0,a[1]??0,(a[0]??0)+(o[0]??0),(a[1]??0)+(o[1]??0))||3===r.length&&(r[0]!==a[0]||r[1]!==a[1]||r[2]!==a[2])&&t$(r[0]??0,r[1]??0,r[2]??0,a[0]??0,a[1]??0,a[2]??0,(r[0]??0)+(n[0]??0),(r[1]??0)+(n[1]??0),(r[2]??0)+(n[2]??0))&&t$(r[0]??0,r[1]??0,r[2]??0,a[0]??0,a[1]??0,a[2]??0,(a[0]??0)+(o[0]??0),(a[1]??0)+(o[1]??0),(a[2]??0)+(o[2]??0)))&&(e.k[t].to=null,e.k[t].ti=null),r[0]===a[0]&&r[1]===a[1]&&0===n[0]&&0===n[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===a[2]&&0===n[2]&&0===o[2])&&(e.k[t].to=null,e.k[t].ti=null));this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=this.processEffectsSequence,this.frameId=-1;const l=e.k[0]?.s?.length||0;this.v=tl(K.Float32,l),this.pv=tl(K.Float32,l);for(let t=0;t<l;t++)this.v[t]=this.initFrame,this.pv[t]=this.initFrame;this._caching={lastFrame:this.initFrame,lastIndex:0,value:tl(K.Float32,l)}}}class tY extends tH{constructor(t,e,s=null,i=null){super(),this.propType=tn.UniDimensional,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={_lastKeyframeIndex:-1,lastFrame:this.initFrame,lastIndex:0,value:0},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=this.initFrame,this.pv=this.initFrame,this._isFirstFrame=!0,this.getValue=this.processEffectsSequence,this.effectsSequence=[this.getValueAtCurrentTime.bind(this)]}}class tU extends tH{constructor(t,e,s=null,i=null){super(),this.propType=tn.MultiDimensional,this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;const{length:r}=e.k;this.v=tl(K.Float32,r),this.pv=tl(K.Float32,r),this.vel=tl(K.Float32,r);for(let t=0;t<r;t++)this.v[t]=(e.k[t]??0)*this.mult,this.pv[t]=e.k[t]??0;this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class tJ extends tH{constructor(){super(),this.propType=!1}}class tX extends tH{constructor(t,e,s=null,i=null){super(),this.propType=tn.UniDimensional,this.mult=s||1,this.data=e,this.v=e.k*(s||1),this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=this.processEffectsSequence}}let tZ={getProp:function(t,e,s,i,r){let a,n=e;if(n&&"sid"in n&&n.sid&&(n=t.globalData?.slotManager?.getProp(n)),!n)return new tJ;if("number"==typeof n.k)a=new tX(t,n,i,r);else if(M(n.k))a=new tU(t,n,i,r);else switch(s){case 0:a=new tY(t,n,i,r);break;case 1:a=new tW(t,n,i,r)}return(a=a??new tJ).effectsSequence.length>0&&r?.addDynamicProperty(a),a}};class tK extends tq{getValueAtTime(t,e){throw Error(`${this.constructor.name}: Method getShapeValueAtTime is not implemented`)}initiateExpression(t,e,s){throw Error(`${this.constructor.name}: Method initiateExpression is not implemented`)}interpolateShape(t,e,s={}){let i=s.lastIndex||0,r,a,n,o=0,h,l=this.keyframes??[];if(t<(l[0]?.t??0)-this.offsetTime)r=l[0]?.s?.[0]??0,n=!0,i=0;else if(t>=(l[l.length-1]?.t??0)-this.offsetTime)r=l[l.length-1]?.s?l[l.length-1]?.s?.[0]:l[l.length-2]?.e[0],n=!0;else{let e=i,s=l.length-1,h=!0,p,m;for(;h&&(p=l[e],m=l[e+1],!((m?.t??0)-this.offsetTime>t));)e<s-1?e++:h=!1;if(!p||!m)throw Error(`${this.constructor.name}: Could not set keyframe data`);let c=this.keyframesMetadata[e]??{};if(n=1===p.h,i=e,!n){if(t>=m.t-this.offsetTime)o=1;else if(t<p.t-this.offsetTime)o=0;else{let e;c.__fnct?e=c.__fnct:"number"==typeof p.o.x&&"number"==typeof p.o.y&&"number"==typeof p.i.x&&"number"==typeof p.i.y&&(c.__fnct=e=tz(p.o.x,p.o.y,p.i.x,p.i.y).get),o=e?.((t-(p.t-this.offsetTime))/(m.t-this.offsetTime-(p.t-this.offsetTime)))||0}a=m.s?m.s[0]:p.e[0]}r=p.s?.[0]}if(!r||"number"==typeof r||k(r)||"number"==typeof a)return;let p=e._length,m=r.i[0]?.length??0;s.lastIndex=i;for(let t=0;t<p;t++)for(let s=0;s<m;s++)h=(n?r.i[t]?.[s]:(r.i[t]?.[s]??0)+((a?.i[t]?.[s]??0)-(r.i[t]?.[s]??0))*o)??0,e.i[t][s]=h,h=(n?r.o[t]?.[s]:(r.o[t]?.[s]??0)+((a?.o[t]?.[s]??0)-(r.o[t]?.[s]??0))*o)??0,e.o[t][s]=h,h=(n?r.v[t]?.[s]:(r.v[t]?.[s]??0)+((a?.v[t]?.[s]??0)-(r.v[t]?.[s]??0))*o)??0,e.v[t][s]=h}interpolateShapeCurrentTime(){if(!this.pv)throw Error(`${this.constructor.name}: Cannot parse ShapePath v value`);if(!this.keyframes)return;this._caching=this._caching??{};let t=Number(this.comp?.renderedFrame)-this.offsetTime,e=(this.keyframes[0]?.t??0)-this.offsetTime,s=(this.keyframes[this.keyframes.length-1]?.t??0)-this.offsetTime,{lastFrame:i,lastIndex:r}=this._caching;return -999999!==i&&(i<e&&t<e||i>s&&t>s)||(this._caching.lastIndex=i<t?r:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}processEffectsSequence(t){let e,s;if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(this.elem?.globalData?.frameId===this.frameId)return 0;if(0===this.effectsSequence.length)return this._mdf=!1,0;if(this.lock&&this.pv)return this.setVValue(this.pv),0;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt?.k;let i=this.effectsSequence.length;for(s=0;s<i;s++)e=this.effectsSequence[s]?.(e);return this.setVValue(e),this.lock=!1,this.frameId=this.elem?.globalData?.frameId||0,0}reset(){this.paths=this.localShapeCollection}setVValue(t){if(!this.v||!t)throw Error(`${this.constructor.name}: ShapePath is not set`);if(!this.localShapeCollection)throw Error(`${this.constructor.name}: localShapeCollection is not set`);this.shapesEqual(this.v,t)||(this.v=tE(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}shapesEqual(t,e){if(t._length!==e._length||t.c!==e.c)return!1;let s=t._length||0;for(let i=0;i<s;i++)if(t.v[i]?.[0]!==e.v[i]?.[0]||t.v[i]?.[1]!==e.v[i]?.[1]||t.o[i]?.[0]!==e.o[i]?.[0]||t.o[i]?.[1]!==e.o[i]?.[1]||t.i[i]?.[0]!==e.i[i]?.[0]||t.i[i]?.[1]!==e.i[i]?.[1])return!1;return!0}constructor(...t){super(...t),this.data=void 0,this.effectsSequence=[],this.keyframesMetadata=[],this.offsetTime=0,this.pathsData=[]}}class tQ extends tK{constructor(t,e){super(),this._cPoint=.5519,this.v=tx(),this.v.setPathData(!0,4),this.localShapeCollection=tS(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=tZ.getProp(t,e.p,1,0,this),this.s=tZ.getProp(t,e.s,1,0,this),this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertEllToPath())}convertEllToPath(){if("object"!=typeof this.p?.v)return;let t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=3!==this.d,a=this.v;if(!a?.v[0]||!a.v[1]||!a.v[2]||!a.v[3]||!a.i[0]||!a.i[1]||!a.i[2]||!a.i[3]||!a.o[0]||!a.o[1]||!a.o[2]||!a.o[3])throw Error(`${this.constructor.name}: Could not get value of ellipse`);a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=r?t+s:t-s,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=r?t-s:t+s,a.v[3][1]=e,a.i[0][0]=r?t-s*this._cPoint:t+s*this._cPoint,a.i[0][1]=e-i,a.i[1][0]=r?t+s:t-s,a.i[1][1]=e-i*this._cPoint,a.i[2][0]=r?t+s*this._cPoint:t-s*this._cPoint,a.i[2][1]=e+i,a.i[3][0]=r?t-s:t+s,a.i[3][1]=e+i*this._cPoint,a.o[0][0]=r?t+s*this._cPoint:t-s*this._cPoint,a.o[0][1]=e-i,a.o[1][0]=r?t+s:t-s,a.o[1][1]=e+i*this._cPoint,a.o[2][0]=r?t-s*this._cPoint:t+s*this._cPoint,a.o[2][1]=e+i,a.o[3][0]=r?t-s:t+s,a.o[3][1]=e-i*this._cPoint}getValue(t){return this.elem?.globalData?.frameId===this.frameId||(this.frameId=this.elem?.globalData?.frameId||0,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath()),0}}class t0 extends tK{constructor(t,e){super(),this.v=tx(),this.v.c=!0,this.localShapeCollection=tS(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=tZ.getProp(t,e.p,1,0,this),this.s=tZ.getProp(t,e.s,1,0,this),this.r=tZ.getProp(t,e.r,0,0,this),this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertRectToPath())}convertRectToPath(){if("object"!=typeof this.p?.v)throw TypeError(`${this.constructor.name}: p value is not implemented`);let t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=Math.min(s,i,this.r.v),a=r*(1-.5519);this.v&&(this.v._length=0),2===this.d||1===this.d?(this.v?.setTripleAt(t+s,e-i+r,t+s,e-i+r,t+s,e-i+a,0,!0),this.v?.setTripleAt(t+s,e+i-r,t+s,e+i-a,t+s,e+i-r,1,!0),0===r?(this.v?.setTripleAt(t-s,e+i,t-s+a,e+i,t-s,e+i,2),this.v?.setTripleAt(t-s,e-i,t-s,e-i+a,t-s,e-i,3)):(this.v?.setTripleAt(t+s-r,e+i,t+s-r,e+i,t+s-a,e+i,2,!0),this.v?.setTripleAt(t-s+r,e+i,t-s+a,e+i,t-s+r,e+i,3,!0),this.v?.setTripleAt(t-s,e+i-r,t-s,e+i-r,t-s,e+i-a,4,!0),this.v?.setTripleAt(t-s,e-i+r,t-s,e-i+a,t-s,e-i+r,5,!0),this.v?.setTripleAt(t-s+r,e-i,t-s+r,e-i,t-s+a,e-i,6,!0),this.v?.setTripleAt(t+s-r,e-i,t+s-a,e-i,t+s-r,e-i,7,!0))):(this.v?.setTripleAt(t+s,e-i+r,t+s,e-i+a,t+s,e-i+r,0,!0),0===r?(this.v?.setTripleAt(t-s,e-i,t-s+a,e-i,t-s,e-i,1,!0),this.v?.setTripleAt(t-s,e+i,t-s,e+i-a,t-s,e+i,2,!0),this.v?.setTripleAt(t+s,e+i,t+s-a,e+i,t+s,e+i,3,!0)):(this.v?.setTripleAt(t+s-r,e-i,t+s-r,e-i,t+s-a,e-i,1,!0),this.v?.setTripleAt(t-s+r,e-i,t-s+a,e-i,t-s+r,e-i,2,!0),this.v?.setTripleAt(t-s,e-i+r,t-s,e-i+r,t-s,e-i+a,3,!0),this.v?.setTripleAt(t-s,e+i-r,t-s,e+i-a,t-s,e+i-r,4,!0),this.v?.setTripleAt(t-s+r,e+i,t-s+r,e+i,t-s+a,e+i,5,!0),this.v?.setTripleAt(t+s-r,e+i,t+s-a,e+i,t+s-r,e+i,6,!0),this.v?.setTripleAt(t+s,e+i-r,t+s,e+i-r,t+s,e+i-a,7,!0)))}getValue(){return this.elem?.globalData?.frameId===this.frameId||(this.elem?.globalData?.frameId&&(this.frameId=this.elem.globalData.frameId),this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath()),0}}class t1 extends tK{constructor(t,e,s){super(),this.propType=tn.Shape,this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;const i=3===s?e.pt?.k:e.ks?.k;if(!i)throw Error(`${this.constructor.name}: Could now get Path Data`);this.v=tE(i),this.pv=tE(this.v),this.localShapeCollection=tS(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class t2 extends tK{constructor(t,e,s){super(),this.lastFrame=-999999,this.data=e,this.propType=tn.Shape,this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data?.st||0,this.keyframes=3===s?e.pt?.k:e.ks?.k??[],this.keyframesMetadata=[],this.k=!0,this.kf=!0;const i=this.keyframes[0]?.s,{length:r}=i?.[0]?.i??[];this.v=tx(),this.v.setPathData(!!i?.[0]?.c,r),this.pv=tE(this.v),this.localShapeCollection=tS(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this._caching={lastFrame:-999999,lastIndex:0},this.effectsSequence=[this.interpolateShapeCurrentTime.bind(this)],this.getValue=this.processEffectsSequence}}class t3 extends tK{constructor(t,e){super(),this.v=tx(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=tZ.getProp(t,e.ir,0,0,this),this.is=tZ.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=tZ.getProp(t,e.pt,0,0,this),this.p=tZ.getProp(t,e.p,1,0,this),this.r=tZ.getProp(t,e.r,0,$,this),this.or=tZ.getProp(t,e.or,0,0,this),this.os=tZ.getProp(t,e.os,0,.01,this),this.localShapeCollection=tS(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertToPath())}convertPolygonToPath(){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(!this.p)throw Error(`${this.constructor.name}: p value is not implemented`);let t=Math.floor(this.pt.v),e=2*Math.PI/t,s=this.or.v,i=this.os.v,r=2*Math.PI*s/(4*t),a=-(.5*Math.PI),n=3===this.data.d?-1:1;a+=this.r.v,this.v&&(this.v._length=0);for(let o=0;o<t;o++){let t=s*Math.cos(a),h=s*Math.sin(a),l=0===t&&0===h?0:h/Math.sqrt(t*t+h*h),p=0===t&&0===h?0:-t/Math.sqrt(t*t+h*h),m=Array.isArray(this.p.v)?this.p.v:[0,0];t+=m[0],h+=m[1],this.v?.setTripleAt(t,h,t-l*r*i*n,h-p*r*i*n,t+l*r*i*n,h+p*r*i*n,o,!0),a+=e*n}this.paths.length=0,this.paths[0]=this.v}convertStarToPath(){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(!this.v)throw Error(`${this.constructor.name}: v (ShapePath) is not implemented`);let t=2*Math.floor(this.pt.v),e=2*Math.PI/t,s=!0,i=this.or.v,r=Number(this.ir?.v),a=this.os.v,n=Number(this.is?.v),o=2*Math.PI*i/(2*t),h=2*Math.PI*r/(2*t),l,p,m,c=-Math.PI/2;c+=this.r.v;let d=3===this.data.d?-1:1;this.v._length=0;for(let u=0;u<t;u++){l=s?i:r,p=s?a:n,m=s?o:h;let t=l*Math.cos(c),f=l*Math.sin(c),g=0===t&&0===f?0:f/Math.sqrt(t*t+f*f),y=0===t&&0===f?0:-t/Math.sqrt(t*t+f*f),b=Array.isArray(this.p?.v)?this.p.v:[0,0];t+=b[0],f+=b[1],this.v.setTripleAt(t,f,t-g*m*p*d,f-y*m*p*d,t+g*m*p*d,f+y*m*p*d,u,!0),s=!s,c+=e*d}}convertToPath(){throw Error(`${this.constructor.name}: Method convertToPath is not implemented`)}getValue(t){return this.elem?.globalData?.frameId===this.frameId||(this.frameId=this.elem?.globalData?.frameId||0,this.iterateDynamicProperties(),this._mdf&&this.convertToPath()),0}}let t5={getConstructorFunction:function(){return t1},getKeyframedConstructorFunction:function(){return t2},getShapeProp:function(t,e,s,i,r){let a=null;switch(s){case 3:case 4:{let i=3===s?e.pt:e.ks,r=i?.k;if(r?.length){a=new t2(t,e,s);break}a=new t1(t,e,s);break}case 5:a=new t0(t,e);break;case 6:a=new tQ(t,e);break;case 7:a=new t3(t,e)}return a?.k&&t.addDynamicProperty(a),a}};class t4{constructor(t,e){this._isFirstFrame=!1,this.data=t,this.element=e,this.masksProperties=this.data.masksProperties??[],this.viewData=tp(this.masksProperties.length);const{length:s}=this.masksProperties;let i=!1;for(let t=0;t<s;t++)this.masksProperties[t]?.mode!=="n"&&(i=!0),this.viewData[t]=t5.getShapeProp(this.element,this.masksProperties[t],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}destroy(){this.element=null}getMaskProperty(t){return this.viewData[t]}renderFrame(t){let e,s;if(!this.element.globalData?.compSize)throw Error(`${this.constructor.name}: element->globalData->compSize is not implemented`);if(!this.hasMasks)return;let i=this.element.finalTransform?.mat,r=this.element.canvasContext,{length:a}=this.masksProperties;r?.beginPath();for(let t=0;t<a;t++)if(this.masksProperties[t]?.mode!=="n"){this.masksProperties[t]?.inv&&(r?.moveTo(0,0),r?.lineTo(this.element.globalData.compSize.w,0),r?.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),r?.lineTo(0,this.element.globalData.compSize.h),r?.lineTo(0,0));let a=this.viewData[t]?.v;if(!a)throw Error(`${this.constructor.name}: Could not access ShapePath`);let n=i?.applyToPointArray(a.v[0]?.[0]??0,a.v[0]?.[1]??0,0)??[];r?.moveTo(n[0]??0,n[1]??0);let o=a._length;for(e=1;e<o;e++)s=i?.applyToTriplePoints(a.o[e-1],a.i[e],a.v[e])??[],r?.bezierCurveTo(s[0]??0,s[1]??0,s[2]??0,s[3]??0,s[4]??0,s[5]??0);s=i?.applyToTriplePoints(a.o[e-1],a.i[0],a.v[0])??[],r?.bezierCurveTo(s[0]??0,s[1]??0,s[2]??0,s[3]??0,s[4]??0,s[5]??0)}this.element.globalData.renderer.save(!0),r?.clip()}}class t6{constructor(t,e,s){this.p=tZ.getProp(e,t.v,0,0,s)}}class t8{constructor(t,e,s){this.p=tZ.getProp(e,t.v,1,0,s)}}class t9 extends t6{}class t7 extends t6{}class et extends t8{}class ee extends t8{}class es extends t6{}class ei extends t6{}class er extends t6{}class ea{constructor(){this.p={}}}class en extends tq{constructor(t,e,s){super(),this.data=void 0,this.effectElements=[],this.getValue=this.iterateDynamicProperties,this.init(t,e,s)}init(t,e,s){let i;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);let r=this.data.ef,{length:a}=r;for(let t=0;t<a;t++){switch(r[t]?.ty){case 0:i=new t9(r[t],e,this);break;case 1:i=new t7(r[t],e,this);break;case 2:i=new et(r[t],e,this);break;case 3:i=new ee(r[t],e,this);break;case 4:case 7:i=new er(r[t],e,this);break;case 10:i=new es(r[t],e,this);break;case 11:i=new ei(r[t],e,this);break;case 5:i=new eo(s,e);break;default:i=new ea}this.effectElements.push(i)}}renderFrame(t){throw Error(`${this.constructor.name}: Method renderFrame is not implemented yet`)}}class eo{constructor(t,e,s){this.effectElements=[];const i=t.ef??[],{length:r}=i;for(let s=0;s<r;s++){const r=new en(i[s],e,t);this.effectElements.push(r)}}}let eh={interface:null,plugin:null},el=t=>{eh.plugin=t};function ep(t=16){return({0:"source-over",1:"multiply",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity",16:"normal",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light"})[t]??"normal"}class em{buildAllItems(){throw Error(`${this.constructor.name}: Method buildAllItems is not implemented`)}checkLayers(t){throw Error(`${this.constructor.name}: Method checkLayers is not implemented`)}checkMasks(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not initialized`);if(!this.data.hasMask)return!1;let t=0,{length:e}=this.data.masksProperties??[];for(;t<e;){if(this.data.masksProperties?.[t]?.mode!=="n"&&this.data.masksProperties?.[t]?.cl!==!1)return!0;t++}return!1}destroy(){}destroyBaseElement(){throw Error(`${this.constructor.name}: Method destroyBaseElement is not implemented`)}getBaseElement(){throw Error(`${this.constructor.name}: Method getBaseElement is not implemented`)}getType(){return this.type}initBaseData(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=v(),this.data.sr||(this.data.sr=1),this.effectsManager=new eo(this.data,this,this.dynamicProperties)}initExpressions(){try{if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=eh.interface;if(!t)return;let e=t("layer"),s=t("effects"),i=t("shape"),r=t("text"),a=t("comp");this.layerInterface=new e(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);let n=new s().createEffectsInterface(this,this.layerInterface);if(this.layerInterface.registerEffectsInterface(n),0===this.data.ty||this.data.xt){this.compInterface=new a(this);return}if(4===this.data.ty){this.layerInterface.shapeInterface=new i(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface;return}5===this.data.ty&&(this.layerInterface.textInterface=new r(this),this.layerInterface.text=this.layerInterface.textInterface)}catch(t){console.error(this.constructor.name,t)}}setBlendMode(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=ep(this.data.bm),e=this.baseElement??this.layerElement;if(!e)throw Error(`${this.constructor.name}: Both baseElement and layerElement are not implemented`);e.style.mixBlendMode=t}sourceRectAtTime(){throw Error(`${this.constructor.name}: Method sourceRectAtTime is not implemented`)}constructor(){this.baseElement=null,this.dynamicProperties=[],this.frameDuration=1,this.itemsData=[],this.layerElement=null,this.layerInterface=null,this.renderedFrame=-1,this.shapesData=[]}}class ec extends tH{constructor(t,e,s){if(super(),this.appliedTransformations=0,this.pre=new tm,this.defaultVector=[0,0],this.elem=t,this.frameId=-1,this.propType=tn.Transform,this.data=e,this.v=new tm,this.initDynamicPropertyContainer(s??t),e.p&&"s"in e.p?(this.px=tZ.getProp(t,e.p.x,0,0,this),this.py=tZ.getProp(t,e.p.y,0,0,this),"z"in e.p&&(this.pz=tZ.getProp(t,e.p.z,0,0,this))):this.p=tZ.getProp(t,e.p??{k:[0,0,0]},1,0,this),"rx"in e){if(this.rx=tZ.getProp(t,e.rx,0,$,this),this.ry=tZ.getProp(t,e.ry,0,$,this),this.rz=tZ.getProp(t,e.rz,0,$,this),e.or?.k[0]?.ti){const{length:t}=e.or.k;for(let s=0;s<t;s++){const t=e.or.k[s];t&&(t.to=null,t.ti=null)}}this.or=tZ.getProp(t,e.or,1,$,this),this.or.sh=!0}else this.r=tZ.getProp(t,e.r??{k:0},0,$,this);e.sk&&(this.sk=tZ.getProp(t,e.sk,0,$,this),this.sa=tZ.getProp(t,e.sa,0,$,this)),this.a=tZ.getProp(t,e.a??{k:[0,0,0]},1,0,this),this.s=tZ.getProp(t,e.s??{k:[100,100,100]},1,.01,this),e.o?this.o=tZ.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,0===this.dynamicProperties.length&&this.getValue(!0)}addDynamicProperty(t){super.addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}applyToMatrix(t){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);this.iterateDynamicProperties(),this._mdf=!!this._mdf,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.r?t.rotate(-this.r.v):t.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(Number(this.or?.v[1])).rotateX(Number(this.or?.v[0])),this.data.p&&"s"in this.data.p?"z"in this.data.p?t.translate(Number(this.px?.v),Number(this.py?.v),-Number(this.pz?.v)):t.translate(Number(this.px?.v),Number(this.py?.v),0):t.translate(Number(this.p?.v[0]),Number(this.p?.v[1]),-Number(this.p?.v[2]))}autoOrient(){throw Error(`${this.constructor.name}: Method autoOrient not implemented`)}getValue(t){if(this.elem.globalData?.frameId===this.frameId)return 0;if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(Number(this.or?.v[1])).rotateX(Number(this.or?.v[0])),this.autoOriented){let t,e,{frameRate:s}=this.elem.globalData??{frameRate:60};if(this.p?.keyframes)Number(this.p._caching?.lastFrame)+this.p.offsetTime<=(this.p.keyframes[0]?.t??0)?(t=this.p.getValueAtTime(((this.p.keyframes[0]?.t??0)+.01)/s,0),e=this.p.getValueAtTime(Number(this.p.keyframes[0]?.t)/s,0)):Number(this.p._caching?.lastFrame)+this.p.offsetTime>=(this.p.keyframes[this.p.keyframes.length-1]?.t??0)?(t=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1]?.t??0)/s,0),e=this.p.getValueAtTime(((this.p.keyframes[this.p.keyframes.length-1]?.t??0)-.05)/s,0)):(t=this.p.pv,e=this.p.getValueAtTime((Number(this.p._caching?.lastFrame)+this.p.offsetTime-.01)/s,this.p.offsetTime));else if(this.px?.keyframes&&this.py?.keyframes){t=[0,0],e=[0,0];let{px:i,py:r}=this,{keyframes:a=[]}=i,{keyframes:n=[]}=r;Number(i._caching?.lastFrame)+i.offsetTime<=(a[0]?.t??0)?(t[0]=i.getValueAtTime(((a[0]?.t??0)+.01)/s,0),t[1]=r.getValueAtTime(((n[0]?.t??0)+.01)/s,0),e[0]=i.getValueAtTime((a[0]?.t??0)/s,0),e[1]=r.getValueAtTime(Number(n[0]?.t)/s,0)):Number(i._caching?.lastFrame)+i.offsetTime>=(a[a.length-1]?.t??0)?(t[0]=i.getValueAtTime((a[a.length-1]?.t??0)/s,0),t[1]=r.getValueAtTime((n[n.length-1]?.t??0)/s,0),e[0]=i.getValueAtTime(((a[a.length-1]?.t??0)-.01)/s,0),e[1]=r.getValueAtTime(((n[n.length-1]?.t??0)-.01)/s,0)):(t=[i.pv,r.pv],e[0]=i.getValueAtTime((Number(i._caching?.lastFrame)+i.offsetTime-.01)/s,i.offsetTime),e[1]=r.getValueAtTime((Number(r._caching?.lastFrame)+r.offsetTime-.01)/s,r.offsetTime))}else t=e=this.defaultVector;this.v.rotate(-Math.atan2(t[1]-e[1],t[0]-e[0]))}this.data.p&&"s"in this.data.p?"z"in this.data.p?this.v.translate(Number(this.px?.v),Number(this.py?.v),-Number(this.pz?.v)):this.v.translate(Number(this.px?.v),Number(this.py?.v),0):this.p&&this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}return this.frameId=this.elem.globalData?.frameId,0}precalculateMatrix(){if(this.appliedTransformations=0,this.pre.reset(),!this.a?.effectsSequence.length){if(!this.a)throw Error(`${this.constructor.name}: Cannot read 'a' value`);if(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s?.effectsSequence.length){if(!this.s)throw Error(`${this.constructor.name}: Cannot read 's' value`);if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length>0||this.sa?.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.appliedTransformations=3}if(this.r){0===this.r.effectsSequence.length&&(this.pre.rotate(-this.r.v),this.appliedTransformations=4);return}this.rz?.effectsSequence.length||this.ry?.effectsSequence.length||this.rx?.effectsSequence.length||this.or?.effectsSequence.length||(this.pre.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(this.or?.v[1]).rotateX(this.or?.v[0]),this.appliedTransformations=4)}}}}let ed={getTransformProperty:(t,e,s)=>new ec(t,e,s)};class eu extends em{globalToLocal(t){let e,s=t,i=[this.finalTransform],r=!0,{comp:a}=this;for(;r;)a?.finalTransform?(a.data?.hasMask&&i.splice(0,0,a.finalTransform),a=a.comp):r=!1;let{length:n}=i;for(let t=0;t<n;t++)e=i[t]?.mat.applyToPointArray(0,0,0),s=[s[0]-Number(e?.[0]),s[1]-Number(e?.[1]),0];return s}initTransform(){if(!this.data)throw Error(`${this.constructor.name}: LottiePlayer is not initialized`);let t=new tm;this.finalTransform={_localMatMdf:!1,_matMdf:!1,_opMdf:!1,localMat:t,localOpacity:1,mat:t,mProp:this.data.ks?ed.getTransformProperty(this,this.data.ks,this):{o:0}},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0)}renderLocalTransform(){if(!this.localTransforms)return;if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not initialized`);let t=0,{length:e}=this.localTransforms;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;t<e;)this.localTransforms[t]?._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[t]?._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=Number(this.finalTransform.mProp.o?.v),this.finalTransform._opMdf=!0),t++;if(this.finalTransform._localMatMdf){let{localMat:s,mat:i}=this.finalTransform;for(this.localTransforms[0]?.matrix?.clone(s),t=1;t<e;t++){let e=this.localTransforms[t]?.matrix;e&&s.multiply(e)}s.multiply(i)}if(this.finalTransform._opMdf){let s=this.finalTransform.localOpacity;for(t=0;t<e;t++)s*=(this.localTransforms[t]?.opacity??1)*.01;this.finalTransform.localOpacity=s}}renderTransform(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not initialized`);this.finalTransform._opMdf=!!(this.finalTransform.mProp.o?._mdf||this._isFirstFrame),this.finalTransform._matMdf=!!(this.finalTransform.mProp._mdf||this._isFirstFrame);let t=this.finalTransform.mat,{length:e}=this.hierarchy,s=0;if(!this.finalTransform._matMdf)for(;s<e;){if(this.hierarchy[s]?.finalTransform?.mProp._mdf){this.finalTransform._matMdf=!0;break}s++}if(this.finalTransform._matMdf){let i=this.finalTransform.mProp.v.props;for(t.cloneFromProps(i),s=0;s<e;s++)if(this.hierarchy[s]?.finalTransform?.mProp.v){let{v:e}=this.hierarchy[s]?.finalTransform?.mProp??{v:null};e&&t.multiply(e)}}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=Number(this.finalTransform.mProp.o?.v))}searchEffectTransforms(){if(!this.renderableEffectsManager)return;let t=this.renderableEffectsManager.getEffects(ta.TransformEffect);if(0===t.length)return;this.localTransforms=[],this.finalTransform&&(this.finalTransform.localMat=new tm);let{length:e}=t;for(let s=0;s<e;s++)this.localTransforms.push(t[s])}constructor(...t){super(...t),this._isFirstFrame=!1,this.hierarchy=[],this.localTransforms=null,this.mHelper=new tm}}class ef extends eu{checkParenting(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.comp)throw Error(`${this.constructor.name}: comp (ElementInterface) is not implemented`);void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}initHierarchy(){this.hierarchy=[],this._isParent=!1,this.checkParenting()}setAsParent(){this._isParent=!0}setHierarchy(t){this.hierarchy=t}constructor(...t){super(...t),this._isParent=!1}}class eg extends ef{addDynamicProperty(t){this.dynamicProperties.includes(t)||this.dynamicProperties.push(t)}initFrame(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1}prepareProperties(t,e){let{length:s}=this.dynamicProperties;for(let t=0;t<s;t++)(e||this._isParent&&this.dynamicProperties[t]?.propType===tn.Transform)&&(this.dynamicProperties[t]?.getValue(),this.globalData&&this.dynamicProperties[t]?._mdf&&(this.globalData._mdf=!0,this._mdf=!0))}constructor(...t){super(...t),this._mdf=!1,this.displayStartTime=0}}class ey extends eg{addRenderableComponent(t){this.renderableComponents.includes(t)||this.renderableComponents.push(t)}checkLayerLimits(t){if(this.data&&this.globalData){if(this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t){this.isInRange||(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show());return}this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())}}checkTransparency(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not implemented`);if(0>=Number(this.finalTransform.mProp.o?.v)){!this.isTransparent&&(this.globalData?.renderConfig).hideOnTransparent&&(this.isTransparent=!0,this.hide());return}this.isTransparent&&(this.isTransparent=!1,this.show())}getLayerSize(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);return 5===this.data.ty?{h:Number(this.data.textData?.height),w:Number(this.data.textData?.width)}:{h:Number(this.data.height),w:Number(this.data.width)}}hide(){}initRenderable(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]}prepareRenderableFrame(t,e){this.checkLayerLimits(t)}removeRenderableComponent(t){this.renderableComponents.includes(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)}renderRenderable(){let{length:t}=this.renderableComponents;for(let e=0;e<t;e++)this.renderableComponents[e]?.renderFrame(Number(this._isFirstFrame))}show(){throw Error(`${this.constructor.name}: Method show is not implemented`)}sourceRectAtTime(){return{height:100,left:0,top:0,width:100}}constructor(...t){super(...t),this.hidden=!1,this.isInRange=!1,this.isTransparent=!1,this.renderableComponents=[]}}let eb=new class{constructor(){if(this.maskType=!0,this.offscreenCanvas="u">typeof OffscreenCanvas,this.svgLumaHidden=!0,!V)return;this.maskType=!/MSIE 10/i.test(navigator.userAgent)&&!/MSIE 9/i.test(navigator.userAgent)&&!/rv:11.0/i.test(navigator.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent),this.svgLumaHidden=!/firefox/i.test(navigator.userAgent)}};function ev(t){return B?null:document.createElement(t)}let e_="__lottie_element_luma_buffer",ex=null,ew=null,eE=null;function eC(){if(!ex||!ew){let t,e,s;t=tc("svg"),e=tc("filter"),s=tc("feColorMatrix"),e.id=e_,s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),e.appendChild(s),t.appendChild(e),t.id=`${e_}_svg`,eb.svgLumaHidden&&(t.style.display="none"),eE=t,document.body.appendChild(eE),(ew=(ex=ev("canvas")).getContext("2d"))&&(ew.filter=`url(#${e_})`,ew.fillStyle="rgba(0,0,0,0)",ew.fillRect(0,0,1,1))}}let eS=function(t,e){if(eb.offscreenCanvas)return new OffscreenCanvas(t,e);let s=ev("canvas");return s.width=t,s.height=e,s},ek=function(t){if(ex&&ew||eC(),!ex||!ew)throw Error("Could not create Canvas Element");return ex.width=t.width,ex.height=t.height,ew.filter=`url(#${e_})`,ex},eM={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};class eP extends ey{clearCanvas(t){if(!this.transformCanvas)throw Error(`${this.constructor.name}: transformCanvas is not implemented`);t?.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)}createContainerElements(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.globalData.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented in globalData`);if(this.data.tt&&this.data.tt>=1){this.buffers=[];let{canvasContext:t}=this.globalData,e=eS(t.canvas.width,t.canvas.height);this.buffers.push(e);let s=eS(t.canvas.width,t.canvas.height);this.buffers.push(s),this.data.tt>=3&&!document._isProxy&&eC()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new tg(this),this.searchEffectTransforms()}createContent(){}createElements(){throw Error(`${this.constructor.name}: createElements is not implemented`)}createRenderableComponents(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.maskManager=new t4(this.data,this),this.renderableEffectsManager&&(this.transformEffects=this.renderableEffectsManager.getEffects(ta.TransformEffect))}destroy(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager?.destroy()}exitLayer(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);let t=this.data.tt||0;if(t<1)return;let e=this.buffers[1],s=e?.getContext("2d");this.clearCanvas(s),s.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);let i=Number(this.data.ind)-1;"tp"in this.data&&void 0!==this.data.tp&&(i=this.data.tp);let r=this.comp?.getElementById(i);if(r?.renderFrame(1),this.canvasContext.setTransform(1,0,0,1,0,0),t>=3&&!document._isProxy){let t=ek(this.canvasContext.canvas),e=t.getContext("2d");e?.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(t,0,0)}this.canvasContext.globalCompositeOperation=eM[t],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}hideElement(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)}initRendererElement(){}prepareLayer(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);if(1>(this.data.tt||0))return;let t=this.buffers[0],e=t?.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}renderFrame(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.hidden||this.data.hd||1===this.data.td&&!t)return;this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();let e=0===this.data.ty;this.prepareLayer();let{renderer:s}=this.globalData;s.save(e),s.ctxTransform(this.finalTransform?.localMat.props),s.ctxOpacity(this.finalTransform?.localOpacity),this.renderInnerContent(),s.restore(e),this.exitLayer(),this.maskManager?.hasMasks&&s.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}renderInnerContent(){throw Error("Method is not implemented")}setBlendMode(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let{data:t,globalData:e}=this;if(!e.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented in globalData`);if(e.blendMode!==t.bm){e.blendMode=t.bm;let s=ep(t.bm);e.canvasContext.globalCompositeOperation=s}}showElement(){if(!this.maskManager)throw Error(`${this.constructor.name}: Method maskManager is not implemented`);this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)}constructor(...t){super(...t),this.buffers=[],this.maskManager=void 0,this.renderableEffectsManager=void 0,this.transformEffects=[]}}eP.prototype.hide=eP.prototype.hideElement,eP.prototype.show=eP.prototype.showElement;class eA extends ey{createContainerElements(){throw Error(`${this.constructor.name}: Method createContainerElements is not implemented`)}createContent(){throw Error(`${this.constructor.name}: Method createContent is not implemented`)}createRenderableComponents(){throw Error(`${this.constructor.name}: Method createRenderableComponents is not implemented`)}destroy(){this.innerElem=null,this.destroyBaseElement()}hide(){if(this.hidden||this.isInRange&&!this.isTransparent)return;let t=this.baseElement??this.layerElement;t&&(t.style.display="none"),this.hidden=!0}initElement(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()}initRendererElement(){throw Error(`${this.constructor.name}: Method initRendererElement is not implemented`)}prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()}renderElement(){throw Error(`${this.constructor.name}: Method renderElement is not implemented`)}renderFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))}renderInnerContent(){throw Error(`${this.constructor.name}: Method renderInnerContent is not implemented`)}show(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.isInRange||!this.isTransparent){if(!this.data.hd){let t=this.baseElement??this.layerElement;if(!t)throw Error(`${this.constructor.name}: Neither baseElement or layerElement is implemented`);t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}}constructor(...t){super(...t),this.innerElem=null}}class eD extends eA{destroy(){this.destroyElements(),this.destroyBaseElement()}destroyElements(){let{length:t}=this.layers;for(let e=0;e<t;e++)this.elements[e]?.destroy()}getElements(){return this.elements}initElement(t,e,s){if(this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);(this.data.xt||!e.progressiveLoad)&&this.buildAllItems(),this.hide()}prepareFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),!this.isInRange&&!this.data.xt)return;if(this.tm?._placeholder)this.renderedFrame=t/Number(this.data.sr);else{let t=this.tm?.v||0;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}let{length:e}=this.elements;this.completeLayers||this.checkLayers(this.renderedFrame);for(let t=e-1;t>=0;t--)(this.completeLayers||this.elements[t])&&(this.elements[t]?.prepareFrame(this.renderedFrame-(this.layers[t]?.st??0)),this.elements[t]?._mdf&&(this._mdf=!0))}renderInnerContent(){let{length:t}=this.layers;for(let e=0;e<t;e++)(this.completeLayers||this.elements[e])&&this.elements[e]?.renderFrame()}setElements(t){this.elements=t}constructor(...t){super(...t),this.currentFrame=0,this.elements=[],this.layers=[]}}function eT(t,e,s,i){if(0===e)return"";let r=t.o,a=t.i,n=t.v,o,h=[n[0]?.[0]??0,n[0]?.[1]??0],l=i.applyToPointStringified(...h),p,m,c,d,u=` M${l}`;for(o=1;o<e;o++)c=[r[o-1]?.[0]??0,r[o-1]?.[1]??0],d=i.applyToPointStringified(...c),p=[a[o]?.[0]??0,a[o]?.[1]??0],m=i.applyToPointStringified(...p),h=[n[o]?.[0]??0,n[o]?.[1]??0],l=i.applyToPointStringified(...h),u+=` C${d} ${m} ${l}`;return s&&(c=[r[o-1]?.[0]??0,r[o-1]?.[1]??0],d=i.applyToPointStringified(...c),p=[a[0]?.[0]??0,a[0]?.[1]??0],m=i.applyToPointStringified(...p),h=[n[0]?.[0]??0,n[0]?.[1]??0],l=i.applyToPointStringified(...h),u+=` C${d} ${m} ${l}z`),u}class eF{constructor(t,e,s){this.maskElement=null,this.masksProperties=[],this.solidPath="",this.storedData=[],this._identityMat=new tm,this.data=t,this.element=e,this.globalData=s,this.masksProperties=this.data.masksProperties??[];const{defs:i}=this.globalData,{length:r}=this.masksProperties;this.viewData=tp(r);const a=this.masksProperties;let n=0;const o=[],h=v();let l,p,m,c="clipPath",d="clip-path";for(let t=0;t<r;t++){let e;(a[t]?.mode!=="a"&&a[t]?.mode!=="n"||a[t]?.inv||a[t]?.o?.k!==100||a[t]?.o?.x)&&(c="mask",d="mask"),(a[t]?.mode==="s"||a[t]?.mode==="i")&&0===n?((l=tc("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",`${Number(this.element.comp?.data?.w)}`),l.setAttribute("height",`${Number(this.element.comp?.data?.h)}`),o.push(l)):l=null;const s=tc("path");if(a[t]?.mode==="n"){this.viewData[t]={elem:s,lastPath:"",op:tZ.getProp(this.element,a[t]?.o,0,.01,this.element),prop:t5.getShapeProp(this.element,a[t],3)},i.appendChild(s);continue}if(n++,s.setAttribute("fill",a[t]?.mode==="s"?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),a[t]?.x?.k===0)p=null,m=null;else{c="mask",d="mask",m=tZ.getProp(this.element,a[t]?.x,0,null,this.element),e=v();const r=tc("filter");r.id=e,(p=tc("feMorphology")).setAttribute("operator","erode"),p.setAttribute("in","SourceGraphic"),p.setAttribute("radius","0"),r.appendChild(p),i.appendChild(r),s.setAttribute("stroke",a[t]?.mode==="s"?"#000000":"#ffffff")}if(this.storedData[t]={elem:s,expan:p,filterId:e,lastOperator:"",lastPath:"",lastRadius:0,x:m},a[t]?.mode==="i"){const{length:t}=o,e=tc("g");for(let s=0;s<t;s++)e.appendChild(o[s]);const r=tc("mask");r.setAttribute("mask-type","alpha"),r.id=`${h}_${n}`,r.appendChild(s),i.appendChild(r),e.setAttribute("mask",`url(${tu()}#${h}_${n})`),o.length=0,o.push(e)}else o.push(s);a[t]?.inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[t]={elem:s,invRect:l,lastPath:"",op:tZ.getProp(this.element,a[t]?.o,0,.01,this.element),prop:t5.getShapeProp(this.element,a[t],3)};const r=this.viewData[t]?.prop?.v;!this.viewData[t]?.prop?.k&&r&&this.drawPath(a[t]??null,r,this.viewData[t])}this.maskElement=tc(c);const{length:u}=o;for(let t=0;t<u;t++)this.maskElement.appendChild(o[t]);n>0&&(this.maskElement.id=h,this.element.maskedElement?.setAttribute(d,`url(${tu()}#${h})`),i.appendChild(this.maskElement)),this.viewData.length>0&&this.element.addRenderableComponent(this)}createLayerSolidPath(){let t="M0,0 ";return t+` h${this.globalData.compSize?.w||0} v${this.globalData.compSize?.h||0} h-${this.globalData.compSize?.w||0} v-${this.globalData.compSize?.h||0} `}destroy(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null}drawPath(t,e,s){let i=e._length,r=eT(e,i,e.c,this._identityMat);if(s.lastPath!==r){let i="";e.c&&(i=t?.inv?this.solidPath+r:r),s.elem.setAttribute("d",i),s.lastPath=r}}getMaskelement(){return this.maskElement}getMaskProperty(t){return this.viewData[t]?.prop??null}renderFrame(t){let e=this.element.finalTransform?.mat,{length:s}=this.masksProperties;for(let i=0;i<s;i++){let s=this.viewData[i]?.prop?.v;if(s&&(this.viewData[i]?.prop?._mdf||t)&&this.drawPath(this.masksProperties[i]??null,s,this.viewData[i]),(this.viewData[i]?.op._mdf||t)&&this.viewData[i]?.elem.setAttribute("fill-opacity",`${this.viewData[i]?.op.v??1}`),this.masksProperties[i]?.mode==="n")continue;this.viewData[i]?.invRect&&(this.element.finalTransform?.mProp._mdf||t)&&e&&this.viewData[i]?.invRect?.setAttribute("transform",e.getInverseMatrix().to2dCSS());let r=this.storedData[i];if(!r?.x||!(r.x._mdf||t))continue;let a=r.expan;if(r.x.v<0){"erode"!==r.lastOperator&&(r.lastOperator="erode",r.elem.setAttribute("filter",`url(${tu()}#${r.filterId})`)),a?.setAttribute("radius",`${-r.x.v}`);continue}"dilate"!==r.lastOperator&&(r.lastOperator="dilate",r.elem.removeAttribute("filter")),r.elem.setAttribute("stroke-width",`${2*r.x.v}`)}}}let eI=function(){let t=tc("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t},e$=function(t,e){let s=tc("filter");return s.id=t,e||(s.setAttribute("filterUnits","objectBoundingBox"),s.setAttribute("x","0%"),s.setAttribute("y","0%"),s.setAttribute("width","100%"),s.setAttribute("height","100%")),s},eL="filter_result_",eN={};class eB{constructor(t){this.filters=[];let e="SourceGraphic";const s=v(),i=e$(s,!0);let r=0,a;const{length:n}=t.data.ef??[];for(let s=0;s<n;s++){a=null;const{ty:n}=t.data.ef?.[s]??{ty:null},o=null!==n&&eN[n]?eN[n].effect:null;o&&n&&t.effectsManager&&(a=new o(i,t.effectsManager.effectElements[s],t,`${eL}${r}`,e),e=`${eL}${r}`,eN[n]?.countsAsEffect&&r++),a&&this.filters.push(a)}r&&(t.globalData?.defs.appendChild(i),t.layerElement?.setAttribute("filter",`url(${tu()}#${s})`)),this.filters.length>0&&t.addRenderableComponent(this)}getEffects(t){let{length:e}=this.filters,s=[];for(let i=0;i<e;i++)this.filters[i]?.type===t&&s.push(this.filters[i]);return s}renderFrame(t){let{length:e}=this.filters;for(let s=0;s<e;s++)this.filters[s]?.renderFrame(t)}}class eV extends eA{createContainerElements(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);this.matteElement=tc("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;let t=null;if(this.data.td){this.matteMasks={};let e=tc("g");this.layerId&&(e.id=this.layerId),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&(this.layerElement.id=this.data.ln),this.data.cl&&this.layerElement.classList.add(this.data.cl),0===this.data.ty&&!this.data.hd){let e=tc("clipPath"),s=tc("path");s.setAttribute("d",`M0,0 L${this.data.w},0 L${this.data.w},${this.data.h} L0,${this.data.h}z`);let i=v();if(e.id=i,e.appendChild(s),this.globalData.defs.appendChild(e),this.checkMasks()){let e=tc("g");e.setAttribute("clip-path",`url(${tu()}#${i})`),e.appendChild(this.layerElement),this.transformedElement=e,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path",`url(${tu()}#${i})`)}0!==this.data.bm&&this.setBlendMode()}createRenderableComponents(){if(!this.data)throw Error(`${this.constructor.name}: layerData is not initialized`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not initialized`);this.maskManager=new eF(this.data,this,this.globalData),this.renderableEffectsManager=new eB(this),this.searchEffectTransforms()}destroyBaseElement(){this.layerElement=null,this.matteElement=null,this.maskManager?.destroy()}getBaseElement(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);return this.data.hd?null:this.baseElement??null}getMatte(t=1){let e,s,i,r;if(this.matteMasks=this.matteMasks??{},this.matteMasks[t])return this.matteMasks[t];let a=`${this.layerId}_${t}`;switch(t){case 1:case 3:{let n=tc("mask");if(n.id=a,n.setAttribute("mask-type",3===t?"luminance":"alpha"),(i=tc("use")).setAttributeNS(L,"href",`#${this.layerId}`),n.appendChild(i),this.globalData?.defs.appendChild(n),eb.maskType||1!==t)break;n.setAttribute("mask-type","luminance"),s=e$(e=v()),this.globalData?.defs.appendChild(s),s.appendChild(eI()),(r=tc("g")).appendChild(i),n.appendChild(r),r.setAttribute("filter",`url(${tu()}#${e})`)}break;case 2:{let t=tc("mask");t.id=a,t.setAttribute("mask-type","alpha");let n=tc("g");t.appendChild(n),s=e$(e=v());let o=tc("feComponentTransfer");o.setAttribute("in","SourceGraphic"),s.appendChild(o);let h=tc("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData?.defs.appendChild(s);let l=tc("rect");l.width.baseVal.value=this.comp?.data?.w||0,l.height.baseVal.value=this.comp?.data?.h||0,l.x.baseVal.value=0,l.y.baseVal.value=0,l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter",`url(${tu()}#${e})`),n.appendChild(l),(i=tc("use")).setAttributeNS(L,"href",`#${this.layerId}`),n.appendChild(i),eb.maskType||(t.setAttribute("mask-type","luminance"),s.appendChild(eI()),r=tc("g"),n.appendChild(l),this.layerElement&&r.appendChild(this.layerElement),n.appendChild(r)),this.globalData?.defs.appendChild(t)}}return this.matteMasks[t]=a,this.matteMasks[t]}initRendererElement(){this.layerElement=tc("g")}renderElement(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not implemented`);this.finalTransform._localMatMdf&&this.transformedElement?.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement?.setAttribute("opacity",`${this.finalTransform.localOpacity}`)}setMatte(t){this.matteElement&&this.matteElement.setAttribute("mask",`url(${tu()}#${t})`)}}class eR extends eV{constructor(t,e,s){super(),this.layers=[],t.refId&&(this.assetData=e.getAssetData(t.refId)),this.assetData?.sid&&(this.assetData=e.slotManager?.getProp(this.assetData)||null),this.initElement(t,e,s),this.sourceRect={height:Number(this.assetData?.h),left:0,top:0,width:Number(this.assetData?.w)}}createContent(){let t="";this.assetData&&this.globalData?.getAssetsPath&&(t=this.globalData.getAssetsPath(this.assetData)),this.assetData&&(this.innerElem=tc("image"),this.innerElem.setAttribute("width",`${this.assetData.w}px`),this.innerElem.setAttribute("height",`${this.assetData.h}px`),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData?.renderConfig?.imagePreserveAspectRatio||""),this.innerElem.setAttributeNS(L,"href",t),this.layerElement?.appendChild(this.innerElem))}renderInnerContent(){}sourceRectAtTime(){return this.sourceRect}}class eO{constructor(){this.gr=tc("g"),this.it=[],this.prevViewData=[]}}let ez=new tm,eG=new tm;function eq(t,e,s){if(!e)throw Error("SVGElementsRenderer: Method renderContetTransform is missing data");(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",`${e.transform.op.v}`),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function ej(t,e,s){if(!e)throw Error("SVGElementsRenderer: Method renderFill is missing data");let i=e.style;e.c?.v&&(e.c._mdf||s)&&i.pElem.setAttribute("fill",I(e.c.v)),(e.o?._mdf||s)&&i.pElem.setAttribute("fill-opacity",`${e.o?.v}`)}function eH(t,e,s){let i,r;if(!e)throw Error("SVGElementsRenderer: Method renderGradient is missing data");let a=e.gf,n=e.g?._hasOpacity,o=e.s?.v??[0,0],h=e.e?.v??[0,0];if(e.o?._mdf||s){let s=t.ty===tr.GradientFill?"fill-opacity":"stroke-opacity";e.style?.pElem.setAttribute(s,`${e.o?.v}`)}if(e.s?._mdf||s){let s=1===t.t?"x1":"cx",i="x1"===s?"y1":"cy";a?.setAttribute(s,`${o[0]}`),a?.setAttribute(i,`${o[1]}`),n&&!e.g?._collapsable&&(e.of?.setAttribute(s,`${o[0]}`),e.of?.setAttribute(i,`${o[1]}`))}if(e.g&&(e.g._cmdf||s)){i=e.cst;let t=e.g.c,{length:s}=i;for(let e=0;e<s;e++)(r=i[e]).setAttribute("offset",`${t[4*e]}%`),r.setAttribute("stop-color",`rgb(${t[4*e+1]},${t[4*e+2]},${t[4*e+3]})`)}if(n&&e.g&&(e.g._omdf||s)){let t=e.g.o,{length:s}=i=e.g._collapsable?e.cst:e.ost;for(let a=0;a<s;a++)r=i[a],e.g._collapsable||r.setAttribute("offset",`${t[2*a]}%`),r.setAttribute("stop-opacity",`${t[2*a+1]}`)}if(1===t.t)(e.e?._mdf||s)&&(a?.setAttribute("x2",`${h[0]}`),a?.setAttribute("y2",`${h[1]}`),n&&!e.g?._collapsable&&(e.of?.setAttribute("x2",`${h[0]}`),e.of?.setAttribute("y2",`${h[1]}`)));else{let t=0;if((e.s?._mdf||e.e?._mdf||s)&&(t=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)),a?.setAttribute("r",`${t}`),n&&!e.g?._collapsable&&e.of?.setAttribute("r",`${t}`)),e.e?._mdf||e.h?._mdf||e.a?._mdf||s){t||(t=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)));let s=Math.atan2(h[1]-o[1],h[0]-o[0]),i=Number(e.h?.v);i>=1?i=.99:i<=-1&&(i=-.99);let r=t*i,l=Math.cos(s+Number(e.a?.v))*r+o[0],p=Math.sin(s+Number(e.a?.v))*r+o[1];a?.setAttribute("fx",`${l}`),a?.setAttribute("fy",`${p}`),n&&!e.g?._collapsable&&(e.of?.setAttribute("fx",`${l}`),e.of?.setAttribute("fy",`${p}`))}}}function eW(t,e,s){eH(t,e,s),eJ(t,e,s)}function eY(t){}function eU(t,e,s){let i,r,a,n,o,h,l;if(!e)throw Error("SVGElementsRenderer: Method renderPath is missing data");let{caches:p,lvl:m,sh:c,styles:d,transformers:u}=e,{length:f}=d;for(let e=0;e<f;e++){r=c?._mdf||!!s;let f=d[e],{lvl:g}=f??{lvl:0};if(g<m){for(o=eG.reset(),h=m-g,l=u.length-1;!r&&h>0;)r=u[l]?.mProps._mdf||r,h--,l--;if(r)for(h=m-g,l=u.length-1;h>0;)o.multiply(u[l]?.mProps.v),h--,l--}else o=ez;n=c?.paths;let y=n?._length||0;if(r){i="";for(let t=0;t<y;t++)a=n?.shapes[t],a?._length&&(i+=eT(a,a._length,a.c,o));p[e]=i}else i=p[e];f&&(f.d+=!0===t.hd?"":i??"",f._mdf=r||f._mdf)}}function eJ(t,e,s){if(!e?.style)throw Error("SVGElementsRenderer: Method renderStroke is missing data");let{c:i,d:r,o:a,style:{msElem:n,pElem:o},w:h}=e;r&&(r._mdf||s)&&r.dashStr&&(o.setAttribute("stroke-dasharray",r.dashStr),o.setAttribute("stroke-dashoffset",`${r.dashoffset[0]}`)),i&&(i._mdf||s)&&o.setAttribute("stroke",I(i.v)),(a?._mdf||s)&&o.setAttribute("stroke-opacity",`${a?.v??1}`),(h?._mdf||s)&&(o.setAttribute("stroke-width",`${h?.v||0}`),n?.setAttribute("stroke-width",`${h?.v||0}`))}class eX extends tq{constructor(t,e,s){super(),this.it=[],this.prevViewData=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=tZ.getProp(t,e.o,0,.01,this),this.c=tZ.getProp(t,e.c,1,255,this),this.style=s}}class eZ extends tq{constructor(t,e,s){super(),this._cmdf=!1,this._omdf=!1,this.data=e,this.c=tl(K.Uint8c,4*e.p);const i=e.k.k?.[0]?.s?(e.k.k[0]?.s.length??0)-4*e.p:e.k.k.length-4*e.p;this.o=tl(K.Float32,i),this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=tZ.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}checkCollapsable(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k?.[0]?.s){let t=0,e=this.data.k.k.length;for(;t<e;){if(!this.comparePoints(this.data.k.k[t]?.s??[],this.data.p))return!1;t++}}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0}comparePoints(t,e){let s=0,i=this.o.length/2;for(;s<i;){if(Math.abs((t[4*s]??0)-(t[4*e+2*s]??0))>.01)return!1;s++}return!0}getValue(t){let e,s;if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,!this.prop._mdf&&!t||!M(this.prop.v))return 0;let i=4*this.data.p;for(let r=0;r<i;r++)e=r%4==0?100:255,s=Math.round((this.prop.v[r]??0)*e),this.c[r]!==s&&(this.c[r]=s,this._cmdf=!t);if(this.o.length>0){let{length:e}=this.prop.v;for(let i=4*this.data.p;i<e;i++)s=(i%2==0?Math.round((this.prop.v[i]??0)*100):this.prop.v[i])??0,this.o[i-4*this.data.p]!==s&&(this.o[i-4*this.data.p]=s,this._omdf=!t)}return this._mdf=!t,0}}class eK extends tq{constructor(t,e,s){super(),this.cst=[],this.it=[],this.ost=[],this.prevViewData=[],this.stops=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}initGradientData(t,e,s){this.o=tZ.getProp(t,e.o,0,.01,this),this.s=tZ.getProp(t,e.s,1,null,this),this.e=tZ.getProp(t,e.e,1,null,this),this.h=tZ.getProp(t,e.h??{k:0},0,.01,this),this.a=tZ.getProp(t,e.a??{k:0},0,$,this),this.g=new eZ(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated}setGradientData(t,e){let s,i=v(),r=tc(1===e.t?"linearGradient":"radialGradient");r.id=i,r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");let a=[],n=4*(e.g?.p||1);for(let t=0;t<n;t+=4)s=tc("stop"),r.appendChild(s),a.push(s);t.setAttribute(e.ty===tr.GradientFill?"fill":"stroke",`url(${tu()}#${i})`),this.gf=r,this.cst=a}setGradientOpacity(t,e){let s;if(!this.g?._hasOpacity||this.g._collapsable)return;let i=tc("mask"),r=tc("path");i.appendChild(r);let a=v(),n=v();i.id=n;let o=tc(1===t.t?"linearGradient":"radialGradient");o.id=a,o.setAttribute("spreadMethod","pad"),o.setAttribute("gradientUnits","userSpaceOnUse");let h=(t.g?.k.k?.[0]?.s?t.g?.k.k[0]?.s.length:t.g?.k.k.length)||0,{stops:l}=this;for(let e=4*(t.g?.p||1);e<h;e+=2)(s=tc("stop")).setAttribute("stop-color","rgb(255,255,255)"),o.appendChild(s),l.push(s);r.setAttribute(t.ty===tr.GradientFill?"fill":"stroke",`url(${tu()}#${a})`),t.ty===tr.GradientStroke&&(r.setAttribute("stroke-linecap",to[t.lc||2]),r.setAttribute("stroke-linejoin",th[t.lj||2]),1===t.lj&&r.setAttribute("stroke-miterlimit",`${Number(t.ml)}`)),this.of=o,this.ms=i,this.ost=l,this.maskId=n,e.msElem=r}}class eQ extends tq{constructor(t,e,s,i){let r;super(),this.dashoffset=tl(K.Float32,1),this.dashStr="",this.frameId=-1,this.k=!1,this.elem=t,this.dataProps=tp(e.length),this.renderer=s,this.dashArray=tl(K.Float32,e.length>0?e.length-1:0),this.initDynamicPropertyContainer(i);const a=e.length||0;for(let s=0;s<a;s++)r=tZ.getProp(t,e[s]?.v,0,0,this),this.k=r.k||this.k,this.dataProps[s]={n:e[s]?.n??"d",p:r};this.k||this.getValue(!0),this._isAnimated=this.k}getValue(t){if(this.elem.globalData?.frameId===this.frameId&&!t||(this.elem.globalData?.frameId&&(this.frameId=this.elem.globalData.frameId),this.iterateDynamicProperties(),this._mdf=this._mdf||!!t,!this._mdf))return 0;let e=this.dataProps.length;this.renderer===ti.SVG&&(this.dashStr="");for(let t=0;t<e;t++){if(this.dataProps[t]?.n==="o"){this.dashoffset[0]=this.dataProps[t]?.p.v;continue}if(this.renderer===ti.SVG){this.dashStr+=` ${this.dataProps[t]?.p.v}`;continue}this.dashArray[t]=this.dataProps[t]?.p.v}return 0}}class e0 extends eK{constructor(t,e,s){super(t,e,s),this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=tZ.getProp(t,e.w,0,null,this),this.d=new eQ(t,e.d||[],ti.SVG,this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}}class e1 extends tq{constructor(t,e,s){super(),this.it=[],this.prevViewData=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.style=s}}class e2{setAsAnimated(){this._isAnimated=!0}constructor(){this.caches=[],this.it=[],this.lStr="",this.lvl=0,this.pathsData=[],this.prevViewData=[],this.sh=null,this.styledShapes=[],this.styles=[],this.tr=[],this.transformers=[],this.trNodes=[]}}class e3 extends e2{constructor(t,e,s){super(),this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;let i=0;const{length:r}=t;for(;i<r;){if((t[i]?.mProps.dynamicProperties.length??0)>0){this._isAnimated=!0;break}i++}}}class e5 extends eX{constructor(t,e,s){super(t,e,s),this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=tZ.getProp(t,e.o,0,.01,this),this.w=tZ.getProp(t,e.w,0,null,this),this.d=new eQ(t,e.d||[],ti.SVG,this),this.c=tZ.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}}class e4{constructor(t,e){this._mdf=!1,this.d="",this.msElem=null,this.pElem=tc("path"),this.data=t,this.type=t.ty,this.lvl=e,this.closed=!0===t.hd}reset(){this.d="",this._mdf=!1}}class e6{constructor(t,e,s){this.elements=[],this.transform={container:s,mProps:t,op:e},this._isAnimated=this.transform.mProps.dynamicProperties.length>0||this.transform.op.effectsSequence.length>0}}class e8{constructor(t,e){this.elem=t,this.pos=e}}class e9 extends eA{addProcessedElement(t,e){let{processedElements:s}=this,i=s.length;for(;i;){let r=s[--i];if(r?.elem===t){r.pos=e;return}}s.push(new e8(t,e))}addShapeToModifiers(t){let{length:e}=this.shapeModifiers;for(let s=0;s<e;s++)this.shapeModifiers[s]?.addShape(t)}isShapeInAnimatedModifiers(t){let e=0,{length:s}=this.shapeModifiers;for(;e<s;){if(this.shapeModifiers[e]?.isAnimatedWithShape(t))return!0;e++}return!1}prepareFrame(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}renderModifiers(){if(0===this.shapeModifiers.length)return;let{length:t}=this.shapes;for(let e=0;e<t;e++)this.shapes[e]?.sh?.reset();let{length:e}=this.shapeModifiers;for(let t=e-1;t>=0&&!this.shapeModifiers[t]?.processShapes(!!this._isFirstFrame);t--);}searchProcessedElement(t){let{processedElements:e}=this,{length:s}=e,i=0;for(;i<s;){if(e[i]?.elem===t)return e[i]?.pos??0;i++}return 0}constructor(...t){super(...t),this.processedElements=[],this.shapeModifiers=[],this.shapes=[]}}let e7={};function st(t,e,s){if(!e7[t])throw Error("Invalid modifier");return new e7[t]}function se(t,e){e7[t]=e7[t]??e}class ss extends e9{constructor(t,e,s){super(),this.animatedContents=[],this.createContainerElements=eV.prototype.createContainerElements,this.createRenderableComponents=eV.prototype.createRenderableComponents,this.destroyBaseElement=eV.prototype.destroyBaseElement,this.getBaseElement=eV.prototype.getBaseElement,this.getMatte=eV.prototype.getMatte,this.identityMatrix=new tm,this.initRendererElement=eV.prototype.initRendererElement,this.prevViewData=[],this.renderElement=eV.prototype.renderElement,this.setMatte=eV.prototype.setMatte,this.stylesList=[],this.shapes=[],this.shapesData=t.shapes,this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.initElement(t,e,s)}addToAnimatedContents(t,e){let s=0,{length:i}=this.animatedContents;for(;s<i;){if(this.animatedContents[s]?.element===e)return;s++}this.animatedContents.push({data:t,element:e,fn:function(t){switch(t.ty){case tr.Fill:return ej;case tr.GradientFill:return eH;case tr.GradientStroke:return eW;case tr.Stroke:return eJ;case tr.Path:case tr.Ellipse:case tr.Rectangle:case tr.PolygonStar:return eU;case tr.Transform:return eq;case tr.NoStyle:return eY;default:return null}}(t)})}buildExpressionInterface(){}createContent(){if(!this.layerElement)throw Error(`${this.constructor.name}: Could not access Layer`);this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()}createGroupElement(t){let e=new eO;return t.ln&&(e.gr.id=t.ln),t.cl&&e.gr.classList.add(t.cl),t.bm&&(e.gr.style.mixBlendMode=ep(t.bm)),e}createShapeElement(t,e,s){let i=4;switch(t.ty){case tr.Rectangle:i=5;break;case tr.Ellipse:i=6;break;case tr.PolygonStar:i=7}let r=new e3(e,s,t5.getShapeProp(this,t,i));return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(t,r),r}createStyleElement(t,e){let s=null,i=new e4(t,e),r=i.pElem;switch(t.ty){case tr.Stroke:s=new e5(this,t,i);break;case tr.Fill:s=new eX(this,t,i);break;case tr.GradientFill:case tr.GradientStroke:(s=new(t.ty===tr.GradientFill?eK:e0)(this,t,i)).gf&&this.globalData?.defs.appendChild(s.gf),s.maskId&&s.ms&&s.of&&(this.globalData?.defs.appendChild(s.ms),this.globalData?.defs.appendChild(s.of),r.setAttribute("mask",`url(${tu()}#${s.maskId})`));break;case tr.NoStyle:s=new e1(this,t,i)}return(t.ty===tr.Stroke||t.ty===tr.GradientStroke)&&(r.setAttribute("stroke-linecap",to[t.lc||2]),r.setAttribute("stroke-linejoin",th[t.lj||2]),r.setAttribute("fill-opacity","0"),1===t.lj&&t.ml&&r.setAttribute("stroke-miterlimit",`${t.ml}`)),2===t.r&&r.setAttribute("fill-rule","evenodd"),t.ln&&(r.id=t.ln),t.cl&&r.classList.add(t.cl),t.bm&&(r.style.mixBlendMode=ep(t.bm)),this.stylesList.push(i),s&&this.addToAnimatedContents(t,s),s}createTransformElement(t,e){let s=ed.getTransformProperty(this,t,this);if(!s.o)throw Error(`${this.constructor.name}: Missing required data in TransformProperty`);let i=new e6(s,s.o,e);return this.addToAnimatedContents(t,i),i}destroy(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null}filterUniqueShapes(){let t,e,{length:s}=this.shapes,i=this.stylesList.length,r=[];for(let a=0;a<i;a++){t=this.stylesList[a],e=!1,r.length=0;for(let i=0;i<s;i++)this.shapes[i].styles.includes(t)&&(r.push(this.shapes[i]),e=this.shapes[i]?._isAnimated||e);r.length>1&&e&&this.setShapesAsAnimated(r)}}initSecondaryElement(){}reloadShapes(){if(!this.layerElement)throw Error(`${this.constructor.name}: Could not access layerElement`);this._isFirstFrame=!0;let{length:t}=this.itemsData;for(let e=0;e<t;e++)this.prevViewData[e]=this.itemsData[e];this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();let{length:e}=this.dynamicProperties;for(let t=0;t<e;t++)this.dynamicProperties[t]?.getValue();this.renderModifiers()}renderInnerContent(){this.renderModifiers();let{length:t}=this.stylesList;for(let e=0;e<t;e++)this.stylesList[e]?.reset();this.renderShape();for(let e=0;e<t;e++)(this.stylesList[e]?._mdf||this._isFirstFrame)&&(this.stylesList[e]?.msElem&&(this.stylesList[e]?.msElem?.setAttribute("d",this.stylesList[e]?.d??""),this.stylesList[e].d=`M0 0${this.stylesList[e]?.d??""}`),this.stylesList[e]?.pElem.setAttribute("d",this.stylesList[e]?.d||"M0 0"))}renderShape(){let{length:t}=this.animatedContents;for(let e=0;e<t;e++)(this._isFirstFrame||this.animatedContents[e]?.element._isAnimated)&&this.animatedContents[e]?.data!==!0&&this.animatedContents[e]?.fn&&this.animatedContents[e]?.fn?.(this.animatedContents[e]?.data,this.animatedContents[e]?.element,this._isFirstFrame)}searchShapes(t,e,s,i,r,a,n){let o,h,l=n,p=[...a],m=[],c=[],{length:d}=t;for(let a=d-1;a>=0;a--){let n=this.searchProcessedElement(t[a]);switch(n?e[a]=s[n-1]:t[a]._shouldRender=l,t[a]?.ty){case tr.Fill:case tr.Stroke:case tr.GradientFill:case tr.GradientStroke:case tr.NoStyle:if(n){let{style:t}=e[a]??{style:null};t&&(t.closed=!1)}else e[a]=this.createStyleElement(t[a],r);if(t[a]?._shouldRender&&e[a]?.style?.pElem.parentNode!==i){let{pElem:t}=e[a]?.style??{pElem:null};t&&i.appendChild(t)}m.push(e[a]?.style);break;case tr.Group:if(n){let{length:t}=e[a]?.it??[];for(let s=0;s<t;s++){let{it:t,prevViewData:i}=e[a]??{it:null,prevViewData:null};i&&t&&(i[s]=t[s])}}else e[a]=this.createGroupElement(t[a]);if(this.searchShapes(t[a]?.it,e[a]?.it??[],e[a]?.prevViewData??[],e[a]?.gr,r+1,p,l),t[a]?._shouldRender&&e[a]?.gr?.parentNode!==i){let{gr:t}=e[a]??{};t&&i.appendChild(t)}break;case tr.Transform:n||(e[a]=this.createTransformElement(t[a],i)),(o=e[a]?.transform)&&p.push(o);break;case tr.Path:case tr.Rectangle:case tr.Ellipse:case tr.PolygonStar:n||(e[a]=this.createShapeElement(t[a],p,r)),this.setElementStyles(e[a]);break;case tr.Trim:case tr.RoundedCorners:case tr.Unknown:case tr.PuckerBloat:case tr.ZigZag:case tr.OffsetPath:n?(h=e[a]).closed=!1:((h=st(t[a]?.ty??tr.Unknown)).init(this,t[a]),e[a]=h,this.shapeModifiers.push(h)),c.push(h);break;case tr.Repeater:if(n){(h=e[a]).closed=!0,c.push(h);break}h=st(t[a]?.ty??tr.Unknown),e[a]=h,h.init(this,t,a,e),this.shapeModifiers.push(h),l=!1,c.push(h)}this.addProcessedElement(t[a],a+1)}let{length:u}=m;for(let t=0;t<u;t++){let e=m[t];e&&(e.closed=!0)}let{length:f}=c;for(let t=0;t<f;t++)c[t].closed=!0}setElementStyles(t){let{length:e}=this.stylesList;for(let s=0;s<e;s++)this.stylesList[s]?.closed||t.styles.push(this.stylesList[s])}setShapesAsAnimated(t){let{length:e}=t;for(let s=0;s<e;s++)t[s]?.setAsAnimated()}}class si extends eP{constructor(t,e,s){if(super(),this.initElement=ss.prototype.initElement,this.prepareFrame=eR.prototype.prepareFrame,this.assetData=e.getAssetData(t.refId)??null,!e.imageLoader)throw Error(`${this.constructor.name} imageLoader is not implemented in globalData`);this.img=e.imageLoader.getAsset(this.assetData),this.initElement(t,e,s)}createContent(){let t,e;if(!this.assetData)throw Error(`${this.constructor.name}: assetData is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.img.width||this.assetData.w===this.img.width&&this.assetData.h===this.img.height)return;let s=ev("canvas");s.width=Number(this.assetData.w),s.height=Number(this.assetData.h);let i=s.getContext("2d"),r=this.img.width,a=this.img.height,n=r/a,o=Number(this.assetData.w)/Number(this.assetData.h),h=this.assetData.pr||this.globalData.renderConfig?.imagePreserveAspectRatio;n>o&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?t=(e=a)*o:e=(t=r)/o,i?.drawImage(this.img,(r-t)/2,(a-e)/2,t,e,0,0,Number(this.assetData.w),Number(this.assetData.h)),this.img=s}destroy(){this.img=null}renderInnerContent(){this.canvasContext?.drawImage(this.img,0,0)}}class sr extends e2{constructor(t,e,s,i){let r,a;switch(super(),this.styledShapes=[],this.tr=[0,0,0,0,0,0],e.ty){case tr.Rectangle:r=5;break;case tr.Ellipse:r=6;break;case tr.PolygonStar:r=7;break;default:r=4}this.sh=t5.getShapeProp(t,e,r);const{length:n}=s;for(let t=0;t<n;t++)s[t]?.closed||(a={transforms:i.addTransformSequence(s[t]?.transforms),trNodes:[]},this.styledShapes.push(a),s[t]?.elements.push(a))}}class sa{addTransformSequence(t){let{length:e}=t,s="_";for(let i=0;i<e;i++)s+=`${t[i]?.transform.key}_`;let i=this.sequences[s];return i||(i={_mdf:!1,finalTransform:new tm,transforms:[...t]},this.sequences[s]=i,this.sequenceList.push(i)),i}getNewKey(){return this.transform_key_count++,`_${this.transform_key_count}`}processSequence(t,e){let s=0,{length:i}=t.transforms??[],r=e;if(!e)for(;s<i;){if(t.transforms?.[s]?.transform.mProps._mdf){r=!0;break}s++}if(r)for(t.finalTransform?.reset(),s=i-1;s>=0;s-=1){let{v:e}=t.transforms?.[s]?.transform.mProps??{v:null};e&&t.finalTransform?.multiply(e)}t._mdf=!!r}processSequences(t){let{length:e}=this.sequenceList;for(let s=0;s<e;s++)this.processSequence(this.sequenceList[s],t)}constructor(){this.sequenceList=[],this.sequences={},this.transform_key_count=0}}class sn extends e9{constructor(t,e,s){super(),this.clearCanvas=eP.prototype.clearCanvas,this.createContainerElements=eP.prototype.createContainerElements,this.createRenderableComponents=eP.prototype.createRenderableComponents,this.dashResetter=[],this.exitLayer=eP.prototype.exitLayer,this.hide=eP.prototype.hide,this.initRendererElement=eP.prototype.initRendererElement,this.prepareLayer=eP.prototype.prepareLayer,this.prevViewData=[],this.renderFrame=eP.prototype.renderFrame,this.setBlendMode=eP.prototype.setBlendMode,this.show=eP.prototype.show,this.stylesList=[],this.transformHelper={_opMdf:!1,opacity:1},this.transformsManager=new sa,this.shapes=[],this.shapesData=t.shapes,this.itemsData=[],this.shapeModifiers=[],this.processedElements=[],this.initElement(t,e,s)}addTransformToStyleList(t){let{length:e}=this.stylesList;for(let s=0;s<e;s++)this.stylesList[s].closed||this.stylesList[s].transforms.push(t)}closeStyles(t){let{length:e}=t;for(let s=0;s<e;s++)t[s].closed=!0}createContent(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])}createGroupElement(t){return{it:[],prevViewData:[]}}createShapeElement(t){let e=new sr(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e}createStyleElement(t,e){try{let s={closed:!0===t.hd,data:t,elements:[],preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],type:t.ty},i={};switch(t.ty){case tr.Fill:case tr.Stroke:i.c=tZ.getProp(this,t.c,1,255,this),i.c.k||(s.co=I(i.c.v));break;case tr.GradientFill:case tr.GradientStroke:i.s=tZ.getProp(this,t.s,1,null,this),i.e=tZ.getProp(this,t.e,1,null,this),i.h=tZ.getProp(this,t.h??{k:0},0,.01,this),i.a=tZ.getProp(this,t.a??{k:0},0,$,this),t.g&&(i.g=new eZ(this,t.g,this))}return i.o=tZ.getProp(this,t.o,0,.01,this),t.ty===tr.Stroke||t.ty===tr.GradientStroke?(s.lc=to[t.lc||2],s.lj=th[t.lj||2],1===t.lj&&(s.ml=t.ml),i.w=tZ.getProp(this,t.w,0,null,this),i.w.k||(s.wi=i.w.v),t.d&&"object"==typeof t.d&&(i.d=new eQ(this,t.d,ti.Canvas,this),i.d.k||(s.da=i.d.dashArray,s.do=i.d.dashoffset[0]))):s.r=2===t.r?"evenodd":"nonzero",this.stylesList.push(s),i.style=s,i}catch(t){return console.error(this.constructor.name,t),null}}createTransformElement(t){return{transform:{_opMdf:!1,key:this.transformsManager.getNewKey(),mProps:ed.getTransformProperty(this,t,this),op:tZ.getProp(this,t.o,0,.01,this),opacity:1}}}destroy(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0}drawLayer(){try{let t;if(!this.globalData)throw Error(`${this.constructor.name} globalData is not implemented`);if(!this.globalData.renderer)throw Error(`${this.constructor.name} renderer is not implemented`);let{length:e}=this.stylesList,{renderer:s}=this.globalData,i=this.globalData.canvasContext;for(let r=0;r<e;r++){let{co:e,coOp:a,da:n,data:o,elements:h,grd:l,lc:p,lj:m,ml:c,preTransforms:d,r:u,type:f,wi:g}=t=this.stylesList[r],y=f===tr.Stroke||f===tr.GradientStroke;if(y&&0===g||!o._shouldRender||0===a||0===this.globalData.currentGlobalAlpha)continue;s.save(),y?(s.ctxStrokeStyle(f===tr.Stroke?e:l),s.ctxLineWidth(g||0),p&&s.ctxLineCap(p),m&&s.ctxLineJoin(m),s.ctxMiterLimit(c||0)):s.ctxFillStyle(f===tr.Fill?e:l),s.ctxOpacity(a),f!==tr.Stroke&&f!==tr.GradientStroke&&i?.beginPath(),s.ctxTransform(d.finalTransform?.props);let{length:b}=h;for(let e=0;e<b;e++){(f===tr.Stroke||f===tr.GradientStroke)&&(i?.beginPath(),i&&n&&(i.setLineDash(n),i.lineDashOffset=t.do||0));let r=h[e].trNodes,{length:a}=r;for(let t=0;t<a;t++){let{p:e=[],pts:s=[]}=r[t];"m"===r[t].t?i?.moveTo(e[0],e[1]):"c"===r[t].t?i?.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]):i?.closePath()}y&&(s.ctxStroke(),n&&i?.setLineDash(this.dashResetter))}y||this.globalData.renderer.ctxFill(u),s.restore()}}catch(t){console.error(this.constructor.name,t)}}reloadShapes(){this._isFirstFrame=!0;let{length:t}=this.itemsData;for(let e=0;e<t;e++)this.prevViewData[e]=this.itemsData[e];this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]);let{length:e}=this.dynamicProperties;for(let t=0;t<e;t++)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)}removeTransformFromStyleList(){let{length:t}=this.stylesList;for(let e=0;e<t;e++)this.stylesList[e].closed||this.stylesList[e].transforms.pop()}renderFill(t,e,s){let i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co=I(e.c.v)),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity)}renderGradientFill(t,e,s){let i;if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);let r=e.style;if(!r?.grd||e.g?._mdf||e.s?._mdf||e.e?._mdf||1!==t.t&&(e.h?._mdf||e.a?._mdf)){let s=this.globalData.canvasContext,a=e.s?.v??[0,0],n=e.e?.v??[0,0];if(1===t.t)i=s?.createLinearGradient(a[0],a[1],n[0],n[1]);else{let t=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),r=Math.atan2(n[1]-a[1],n[0]-a[0]),o=e.h?.v??0;o>=1?o=.99:o<=-1&&(o=-.99);let h=t*o,l=e.a?.v??0,p=Math.cos(r+l)*h+a[0],m=Math.sin(r+l)*h+a[1];i=s?.createRadialGradient(p,m,0,a[0],a[1],t)}let o=t.g?.p??0,h=e.g?.c??[],l=1;for(let t=0;t<o;t++)e.g?._hasOpacity&&e.g._collapsable&&(l=e.g.o[2*t+1]),i?.addColorStop(h[4*t]/100,`rgba(${h[4*t+1]},${h[4*t+2]},${h[4*t+3]},${l})`);r&&(r.grd=i)}r&&(r.coOp=(e.o?.v??0)*s.opacity)}renderInnerContent(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)}renderPath(t,e){if(!0===t.hd||!t._shouldRender||!e.sh)return;let{length:s}=e.styledShapes;for(let t=0;t<s;t++)this.renderStyledShape(e.styledShapes[t],e.sh)}renderShape(t,e,s,i){try{let r,a=e.length-1;r=t;for(let i=a;i>=0;i--)switch(e[i].ty){case tr.Transform:(r=s[i].transform)&&this.renderShapeTransform(t,r);break;case tr.Path:case tr.Ellipse:case tr.Rectangle:case tr.PolygonStar:this.renderPath(e[i],s[i]);break;case tr.Fill:this.renderFill(e[i],s[i],r);break;case tr.Stroke:this.renderStroke(e[i],s[i],r);break;case tr.GradientFill:case tr.GradientStroke:this.renderGradientFill(e[i],s[i],r);break;case tr.Group:this.renderShape(r,e[i].it??[],s[i].it);case tr.Trim:}i&&this.drawLayer()}catch(t){console.error(this.constructor.name,t)}}renderShapeTransform(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)}renderStroke(t,e,s){let i=e.style,{c:r,d:a,o:n,w:o}=e;a&&(a._mdf||this._isFirstFrame)&&(i.da=a.dashArray,i.do=a.dashoffset[0]),(r._mdf||this._isFirstFrame)&&(i.co=I(r.v)),(n._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=n.v*s.opacity),(o._mdf||this._isFirstFrame)&&(i.wi=o.v)}renderStyledShape(t,e){let s,i,r;if(!this._isFirstFrame&&!e._mdf&&!t.transforms._mdf)return;let{transforms:a,trNodes:n}=t,{paths:o}=e,h=o?._length||0;n.length=0;let l=a?.finalTransform;for(r=0;r<h;r++){let t=o?.shapes[r];if(t?.v){for(i=t._length,s=1;s<i;s++)1===s&&n.push({p:l?.applyToPointArray(t.v[0][0],t.v[0][1],0),t:"m"}),n.push({pts:l?.applyToTriplePoints(t.o[s-1],t.i[s],t.v[s]),t:"c"});1===i&&n.push({p:l?.applyToPointArray(t.v[0][0],t.v[0][1],0),t:"m"}),t.c&&i&&n.push({pts:l?.applyToTriplePoints(t.o[s-1],t.i[0],t.v[0]),t:"c"},{t:"z"})}}t.trNodes=n}searchShapes(t,e,s,i,r){let a,n,o=i,h=t.length-1,l=[],p=[],m=[...r];for(let i=h;i>=0;i--){let r=this.searchProcessedElement(t[i]);switch(r?e[i]=s[r-1]:t[i]._shouldRender=o,t[i].ty){case tr.Fill:case tr.Stroke:case tr.GradientFill:case tr.GradientStroke:r?e[i].style.closed=!1:e[i]=this.createStyleElement(t[i],m),l.push(e[i].style);break;case tr.Group:if(r){let{length:t}=e[i].it;for(let s=0;s<t;s++)e[i].prevViewData[s]=e[i].it[s]}else e[i]=this.createGroupElement(t[i]);this.searchShapes(t[i].it??[],e[i].it,e[i].prevViewData,o,m);break;case tr.Transform:r||(n=this.createTransformElement(t[i]),e[i]=n),m.push(e[i]),this.addTransformToStyleList(e[i]);break;case tr.Path:case tr.Rectangle:case tr.Ellipse:case tr.PolygonStar:r||(e[i]=this.createShapeElement(t[i]));break;case tr.Trim:case tr.RoundedCorners:case tr.PuckerBloat:case tr.ZigZag:case tr.OffsetPath:r?(a=e[i]).closed=!1:((a=st(t[i].ty)).init(this,t[i]),e[i]=a,this.shapeModifiers.push(a)),p.push(a);break;case tr.Repeater:r?(a=e[i]).closed=!0:(a=st(t[i].ty),e[i]=a,a.init(this,t,i,e),this.shapeModifiers.push(a),o=!1),p.push(a)}this.addProcessedElement(t[i],i+1)}this.removeTransformFromStyleList(),this.closeStyles(l);let{length:c}=p;for(let t=0;t<c;t++)p[t].closed=!0}}class so extends eP{constructor(t,e,s){super(),this.initElement=ss.prototype.initElement,this.prepareFrame=eR.prototype.prepareFrame,this.initElement(t,e,s)}renderInnerContent(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData it not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) it not implemented`);if(!this.globalData.renderer)throw Error(`${this.constructor.name}: globalData.renderer it not implemented`);this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw||0,this.data.sh||0)}}class sh{constructor(t,e,s,i,r,a){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=r,this.p=a,this._mdf={fc:!!i,m:!0,o:!0,p:!0,sc:!!s,sw:!!e}}update(t,e,s,i,r,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;let n=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,n=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,n=!0),this.sc!==s&&(this.sc=s,this._mdf.sc=!0,n=!0),this.fc!==i&&(this.fc=i,this._mdf.fc=!0,n=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,n=!0),a&&a.length>0&&(this.p[0]!==a[0]||this.p[1]!==a[1]||this.p[4]!==a[4]||this.p[5]!==a[5]||this.p[12]!==a[12]||this.p[13]!==a[13])&&(this.p=a,this._mdf.p=!0,n=!0),n}}class sl extends tH{constructor(t,e){super(),this._currentTextLength=-1,this.finalE=0,this.finalS=0,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.initDynamicPropertyContainer(t),this.s=tZ.getProp(t,e.s??{a:0,k:0},0,0,this),"e"in e?this.e=tZ.getProp(t,e.e,0,0,this):this.e={v:100},this.o=tZ.getProp(t,e.o??{a:0,k:0},0,0,this),this.xe=tZ.getProp(t,e.xe??{a:0,k:0},0,0,this),this.ne=tZ.getProp(t,e.ne??{a:0,k:0},0,0,this),this.sm=tZ.getProp(t,e.sm??{a:0,k:100},0,0,this),this.a=tZ.getProp(t,e.a,0,.01,this),0===this.dynamicProperties.length&&this.getValue()}getMult(t,e){let s=t;this._currentTextLength!==this.elem.textProperty?.currentData.l.length&&this.getValue();let i=0,r=0,a=1,n=1;this.ne.v>0?i=this.ne.v/100:r=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:n=1+this.xe.v/100;let o=tz(i,r,a,n).get,h=0,l=this.finalS,p=this.finalE;switch(this.data.sh){case 2:h=o(h=p===l?+(s>=p):Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)));break;case 3:h=o(h=p===l?s>=p?0:1:1-Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)));break;case 4:p===l?h=0:(h=Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)))<.5?h*=2:h=1-2*(h-.5),h=o(h);break;case 5:if(p===l)h=0;else{let t=p-l,e=-t/2+(s=Math.min(Math.max(0,s+.5-l),p-l)),i=t/2;h=Math.sqrt(1-e*e/(i*i))}h=o(h);break;case 6:h=o(h=p===l?0:(1+Math.cos(Math.PI+2*Math.PI*(s=Math.min(Math.max(0,s+.5-l),p-l))/(p-l)))/2);break;default:s>=Math.floor(l)&&(h=s-l<0?Math.max(0,Math.min(Math.min(p,1)-(l-s),1)):Math.max(0,Math.min(p-s,1))),h=o(h)}if(100!==this.sm.v){let t=.01*this.sm.v;0===t&&(t=1e-8);let e=.5-.5*t;h<e?h=0:(h=(h-e)/t)>1&&(h=1)}return h*this.a.v}getTextSelectorProp(t,e,s){throw Error("Method not implemented")}getValue(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty?.currentData.l.length||0,t&&2===this.data.r&&this.e.v&&(this.e.v=this._currentTextLength);let e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=Number(this.s?.v)/e+s,r=this.e.v/e+s;if(i>r){let t=i;i=r,r=t}return this.finalS=i,this.finalE=r,0}}class sp{constructor(t,e,s){const i={propType:!1},r=e?.a;this.a={a:r?.a?tZ.getProp(t,r.a,1,0,s):i,fb:r?.fb?tZ.getProp(t,r.fb,0,.01,s):i,fc:r?.fc?tZ.getProp(t,r.fc,1,0,s):i,fh:r?.fh?tZ.getProp(t,r.fh,0,0,s):i,fs:r?.fs?tZ.getProp(t,r.fs,0,.01,s):i,o:r?.o?tZ.getProp(t,r.o,0,.01,s):i,p:r?.p?tZ.getProp(t,r.p,1,0,s):i,r:r?.r?tZ.getProp(t,r.r,0,$,s):i,rx:r?.rx?tZ.getProp(t,r.rx,0,$,s):i,ry:r?.ry?tZ.getProp(t,r.ry,0,$,s):i,s:r?.s?tZ.getProp(t,r.s,1,.01,s):i,sa:r?.sa?tZ.getProp(t,r.sa,0,$,s):i,sc:r?.sc?tZ.getProp(t,r.sc,1,0,s):i,sk:r?.sk?tZ.getProp(t,r.sk,0,$,s):i,sw:r?.sw?tZ.getProp(t,r.sw,0,0,s):i,t:r?.t?tZ.getProp(t,r.t,0,0,s):i},this.s=new sl(t,e?.s),this.s.t=e?.s?.t}}let sm=(t,e,s)=>{let i=Math.max(t,e,s),r=Math.min(t,e,s),a=i-r,n=0;switch(i){case r:n=0;break;case t:n=(e-s+6*(e<s)*a)/(6*a);break;case e:n=(s-t+2*a)/(6*a);break;case s:n=(t-e+4*a)/(6*a)}return[n,0===i?0:a/i,i/255]},sc=(t,e,s)=>{let i=0,r=0,a=0,n=Math.floor(6*t),o=6*t-n,h=s*(1-e),l=s*(1-o*e),p=s*(1-(1-o)*e);switch(n%6){case 0:i=s,r=p,a=h;break;case 1:i=l,r=s,a=h;break;case 2:i=h,r=s,a=p;break;case 3:i=h,r=l,a=s;break;case 4:i=p,r=h,a=s;break;case 5:i=s,r=h,a=l}return[i,r,a]},sd=(t,e)=>{let s=sm(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),sc(s[0],s[1],s[2])},su=(t,e)=>{let s=sm(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&s[0]++,sc(s[0],s[1],s[2])},sf=(t,e)=>{let s=sm(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),sc(s[0],s[1],s[2])};class sg extends tq{constructor(t,e,s){super(),this._frameId=-1,this._isFirstFrame=!0,this.defaultPropsArray=[],this.lettersChangedFlag=!1,this.renderedLetters=[],this._hasMaskedPath=!1,this._moreOptions={alignment:{}},this._pathData={},this.mHelper=new tm,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=tp(Number(this._textData.a?.length)),this.initDynamicPropertyContainer(s)}getMeasures(t,e){try{if(this.lettersChangedFlag=!!e,!this._mdf&&!this._isFirstFrame&&!e&&(!this._hasMaskedPath||!this._pathData.m?._mdf))return;this._isFirstFrame=!1;let s=this._moreOptions.alignment.v,i=this._animatorsData,r=this._textData,a=this.mHelper,n=this._renderType,o=this.renderedLetters.length,h,l,p,m,c=t.l,d,u=0,f,g=0,y,b=0,v=0,_,x=null,w=[],E=0,C=0,S,M,P=null;if(this._hasMaskedPath&&this._pathData.m){if(P=this._pathData.m,!this._pathData.n||this._pathData._mdf){let t=P.v;if(t){let e;for(this._pathData.r?.v&&(t=t.toReversed()),d={segments:[],tLength:0},m=t._length-1,C=0,p=0;p<m;p++)k(t)||(e=tD(t.v[p],t.v[p+1],[(t.o[p]?.[0]??0)-(t.v[p]?.[0]??0),(t.o[p]?.[1]??0)-(t.v[p]?.[1]??0)],[(t.i[p+1]?.[0]??0)-(t.v[p+1]?.[0]??0),(t.i[p+1]?.[1]??0)-(t.v[p+1]?.[1]??0)]),d.tLength+=e.segmentLength,d.segments.push(e),C+=e.segmentLength);p=m,P.v?.c&&!k(t)&&(e=tD(t.v[p],t.v[0],[(t.o[p]?.[0]??0)-(t.v[p]?.[0]??0),(t.o[p]?.[1]??0)-(t.v[p]?.[1]??0)],[(t.i[0]?.[0]??0)-(t.v[0]?.[0]??0),(t.i[0]?.[1]??0)-(t.v[0]?.[1]??0)]),d.tLength+=e.segmentLength,d.segments.push(e),C+=e.segmentLength),this._pathData.pi=d}}if(d=this._pathData.pi,u=this._pathData.f?.v??0,v=0,b=1,g=0,w=d?.segments??[],u>0&&P.v?.c)for((d?.tLength??0<Math.abs(u))&&(u=-Math.abs(u)%(d?.tLength??0)),v=w.length-1,b=(x=w[v]?.points??[]).length-1;u<0;)u+=x[b]?.partialLength??0,(b-=1)<0&&(v-=1,b=(x=w[v]?.points??[]).length-1);_=(x=w[v]?.points??[])[b-1],f=x[b],E=f?.partialLength??0}m=c.length||0,h=0,l=0;let A=1.2*(t.finalSize||0)*.714,D=!0,T,F,$,L,N=i.length,B,V=-1,R,O=0,z=0,G=u,q=v,j=b,H=-1,W,Y=[0,0,0],U=0,J=[0,0,0],X,Z,K,Q,tt="",te=this.defaultPropsArray,ts;if(2===t.j||1===t.j){let e=0,s=0,a=2===t.j?-.5:-1,n=0,o=!0;for(p=0;p<m;p++){if(c[p]?.n){for(e&&(e+=s);n<p;)(c[n]??{}).animatorJustifyOffset=e,n++;e=0,o=!0;continue}for($=0;$<N;$++){if(T=i[$]?.a??{},!T.t?.propType)continue;let{v:n}=T.t;"number"==typeof n&&(o&&2===t.j&&(s+=n*a),F=i[$]?.s,B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars),void 0!==B&&(k(B)?e+=n*(B[0]??1)*a:e+=n*B*a))}o=!1}for(e&&(e+=s);n<p;)c[n].animatorJustifyOffset=e,n++}for(p=0;p<m;p++){if(a.reset(),W=1,c[p]?.n)h=0,l+=t.yOffset||0,l+=+!!D,u=G,D=!1,this._hasMaskedPath&&(v=q||0,b=j||0,_=(x=w[v]?.points??[])[b-1],f=x[b],E=f?.partialLength??0,g=0),tt="",Q="",Z="",ts="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(H!==c[p]?.line){switch(t.j){case 1:u+=C-(t.lineWidths[c[p]?.line??0]??0);break;case 2:u+=(C-(t.lineWidths[c[p]?.line??0]??0))/2}H=c[p]?.line||0}V!==c[p]?.ind&&(c[V]&&(u+=Number(c[V]?.extra)),u+=(c[p]?.an||0)/2,V=c[p]?.ind||0),u+=s[0]*(c[p]?.an||0)*.005;let e=0;for($=0;$<N;$++){if(T=i[$]?.a,T?.p.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars)))continue;k(T.p.v)&&(k(B)?e+=T.p.v[0]*(B[0]??1):e+=T.p.v[0]*B)}if(T?.a.propType){if((F=i[$]?.s,B=F?.getMult(Number(c[p]?.anIndexes[$]),r.a?.[$]?.s?.totalChars))&&k(T.a.v)){if(k(B)){e+=(T.a.v[0]??0)*(B[0]??1);continue}e+=(T.a.v[0]??0)*B}}}for(y=!0,this._pathData.a?.v&&(u=.5*(c[0]?.an||0)+(C-Number(this._pathData.f?.v)-.5*(c[0]?.an||0)-(c[c.length-1]?.an??0)*.5)*V/(m-1)+Number(this._pathData.f?.v));y;)g+E>=u+e||!x?(S=(u+e-g)/(f?.partialLength||0),O=Number(_?.point[0])+(Number(f?.point[0])-Number(_?.point[0]))*S,z=Number(_?.point[1])+(Number(f?.point[1])-Number(_?.point[1]))*S,a.translate(-s[0]*(c[p]?.an??0)*.005,-(.01*(s[1]*A))),y=!1):x.length>0&&(g+=Number(f?.partialLength),++b>=x.length&&(b=0,w[++v]?x=w[v]?.points??[]:P?.v?.c?(b=0,v=0,x=w[v]?.points??[]):(g-=Number(f?.partialLength),x=null)),x&&(_=f,f=x[b],E=f?.partialLength??0));R=(c[p]?.an??0)/2-(c[p]?.add??0),a.translate(-R,0,0)}else R=(c[p]?.an??0)/2-(c[p]?.add??0),a.translate(-R,0,0),a.translate(-s[0]*(c[p]?.an??0)*.005,-s[1]*A*.01,0);for($=0;$<N;$++)if(T=i[$]?.a??{},T.t?.propType&&(F=i[$]?.s,B=F?.getMult(Number(c[p]?.anIndexes[$]),r.a?.[$]?.s?.totalChars),0!==h||0!==t.j)){if(this._hasMaskedPath){k(B)?u+=Number(T.t.v)*(B[0]??1):u+=Number(T.t.v)*Number(B);continue}if(k(B)){h+=Number(T.t.v)*(B[0]??1);continue}h+=Number(T.t.v)*Number(B)}for(t.strokeWidthAnim&&(U=t.sw||0),t.strokeColorAnim&&(Y=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(J=[Number(t.fc[0]),Number(t.fc[1]),Number(t.fc[2])]),$=0;$<N;$++)if(T=i[$]?.a??{},T.a?.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars))||!k(T.a.v))continue;if(k(B)){a.translate(-(T.a.v[0]??0)*(B[0]??1),-(T.a.v[1]??0)*(B[1]??1),(T.a.v[2]??0)*(B[2]??1));continue}a.translate(-(T.a.v[0]??0)*B,-(T.a.v[1]??0)*B,(T.a.v[2]??0)*B)}for($=0;$<N;$++)if(T=i[$]?.a??{},T.s?.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars))||!k(T.s.v))continue;if(k(B)){a.scale(1+((T.s.v[0]??0)-1)*(B[0]??1),1+((T.s.v[1]??0)-1)*(B[1]??1),1);continue}a.scale(1+((T.s.v[0]??0)-1)*B,1+((T.s.v[1]??0)-1)*B,1)}for($=0;$<N;$++)if(T=i[$]?.a??{},F=i[$]?.s,B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars)){if(T.sk?.propType&&(k(B)?a.skewFromAxis(-Number(T.sk.v)*(B[0]??1),Number(T.sa?.v)*(B[1]??1)):a.skewFromAxis(-Number(T.sk.v)*B,Number(T.sa?.v)*B)),T.r?.propType&&(k(B)?a.rotateZ(-Number(T.r.v)*(B[2]??1)):a.rotateZ(-Number(T.r.v)*B)),T.ry?.propType&&(k(B)?a.rotateY(Number(T.ry.v)*(B[1]??1)):a.rotateY(Number(T.ry.v)*B)),T.rx?.propType&&(k(B)?a.rotateX(Number(T.rx.v)*(B[0]??1)):a.rotateX(Number(T.rx.v)*B)),T.o?.propType&&(k(B)?W+=(Number(T.o.v)*(B[0]??1)-W)*(B[0]??1):W+=(Number(T.o.v)*B-W)*B),t.strokeWidthAnim&&T.sw?.propType&&(k(B)?U+=Number(T.sw.v)*(B[0]??1):U+=Number(T.sw.v)*B),t.strokeColorAnim&&T.sc?.propType&&k(T.sc.v))for(X=0;X<3;X++)k(B)?Y[X]+=((T.sc.v[X]??0)-(Y[X]??0))*(B[0]??1):Y[X]+=((T.sc.v[X]??0)-(Y[X]??0))*B;if(t.fillColorAnim&&t.fc){if(T.fc?.propType)for(X=0;X<3;X++)k(T.fc.v)&&(k(B)?J[X]+=((T.fc.v[X]??0)-(J[X]??0))*(B[0]??1):J[X]+=((T.fc.v[X]??0)-(J[X]??0))*B);T.fh?.propType&&(J=k(B)?su(J,Number(T.fh.v)*(B[0]??1)):su(J,Number(T.fh.v)*B)),T.fs?.propType&&(J=k(B)?sf(J,Number(T.fs.v)*(B[0]??1)):sf(J,Number(T.fs.v)*B)),T.fb?.propType&&(J=k(B)?sd(J,Number(T.fb.v)*(B[0]??1)):sd(J,Number(T.fb.v)*B))}}for($=0;$<N;$++)if(T=i[$]?.a??{},T.p?.propType){if(F=i[$]?.s,!(B=F?.getMult(c[p]?.anIndexes[$]??0,r.a?.[$]?.s?.totalChars))||!k(T.p.v))continue;this._hasMaskedPath?k(B)?a.translate(0,T.p.v[1]*B[0],-T.p.v[2]*B[1]):a.translate(0,T.p.v[1]*B,-T.p.v[2]*B):k(B)?a.translate(T.p.v[0]*B[0],T.p.v[1]*B[1],-T.p.v[2]*B[2]):a.translate(T.p.v[0]*B,T.p.v[1]*B,-T.p.v[2]*B)}if(t.strokeWidthAnim&&(Z=U<0?0:U),t.strokeColorAnim&&(K=I(Y)),t.fillColorAnim&&t.fc&&(Q=I(J)),this._hasMaskedPath){if(a.translate(0,-Number(t.ls)),a.translate(0,s[1]*A*.01+l,0),this._pathData.p?.v){M=(Number(f?.point[1])-Number(_?.point[1]))/(Number(f?.point[0])-Number(_?.point[0]));let t=180*Math.atan(M)/Math.PI;Number(f?.point[0])<Number(_?.point[0])&&(t+=180),a.rotate(-t*Math.PI/180)}a.translate(O,z,0),u-=s[0]*(c[p]?.an??0)*.005,c[p+1]&&V!==c[p+1]?.ind&&(u+=(c[p]?.an??0)/2,u+=.001*t.tr*Number(t.finalSize))}else{switch(a.translate(h,l,0),t.ps&&a.translate(t.ps[0],t.ps[1]+Number(t.ascent),0),t.j){case 1:a.translate((c[p]?.animatorJustifyOffset??0)+Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[c[p]?.line??0])),0,0);break;case 2:a.translate((c[p]?.animatorJustifyOffset??0)+Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[c[p]?.line??0]))/2,0,0)}a.translate(0,-Number(t.ls)),a.translate(R,0,0),a.translate(s[0]*Number(c[p]?.an)*.005,s[1]*A*.01,0),h+=(c[p]?.l??0)+.001*t.tr*Number(t.finalSize)}n===ti.HTML?tt=a.toCSS():n===ti.SVG?tt=a.to2dCSS():te=[a.props[0]??0,a.props[1]??0,a.props[2]??0,a.props[3]??0,a.props[4]??0,a.props[5]??0,a.props[6]??0,a.props[7]??0,a.props[8]??0,a.props[9]??0,a.props[10]??0,a.props[11]??0,a.props[12]??0,a.props[13]??0,a.props[14]??0,a.props[15]??0],ts=W}if(o<=p){L=new sh(Number(ts),Number(Z),K,Q,tt,te),this.renderedLetters.push(L),o++,this.lettersChangedFlag=!0;continue}L=this.renderedLetters[p],this.lettersChangedFlag=L.update(Number(ts),Number(Z),K,Q,tt,te)||this.lettersChangedFlag}}catch(t){console.error(this.constructor.name,t)}}getValue(){return this._elem.globalData?.frameId===this._frameId||(this._frameId=this._elem.globalData?.frameId??0,this.iterateDynamicProperties()),0}searchProperties(t){let{length:e}=this._textData.a??[],{getProp:s}=tZ;for(let t=0;t<e;t++)this._animatorsData[t]=new sp(this._elem,this._textData.a?.[t],this);this._textData.p&&"m"in this._textData.p&&this._elem.maskManager?(this._pathData={a:s(this._elem,this._textData.p.a,0,0,this),f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m),p:s(this._elem,this._textData.p.p,0,0,this),r:s(this._elem,this._textData.p.r,0,0,this)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m?.a,1,0,this)}}function sy(t){let e=t.fStyle?t.fStyle.split(" "):[],s="normal",i="normal",{length:r}=e;for(let t=0;t<r;t++)switch(e[t]?.toLowerCase()){case"italic":i="italic";break;case"bold":s="700";break;case"black":s="900";break;case"medium":s="500";break;case"regular":case"normal":s="400";break;case"light":case"thin":s="200"}return{style:i,weight:t.fWeight||s}}let sb=[2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403],sv={data:{shapes:[]},shapes:[],size:0,w:0},s_=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function sx(t){let e=sw(t);return e>=127462&&e<=127487}function sw(t){let e=0,s=t.charCodeAt(0);if(s>=55296&&s<=56319){let i=t.charCodeAt(1);i>=56320&&i<=57343&&(e=(s-55296)*1024+i-56320+65536)}return e}function sE(t,e){if(B)return;let s=ev("span");s.setAttribute("aria-hidden","true"),s.style.fontFamily=e;let i=ev("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);let r=i.offsetWidth;return i.style.fontFamily=`${function(t){let e=t.split(","),{length:s}=e,i=[];for(let t=0;t<s;t++)"sans-serif"!==e[t]&&"monospace"!==e[t]&&i.push(e[t]);return i.join(",")}(t)}, ${e}`,{node:i,parent:s,w:r}}class sC{constructor(){this.chars=null,this.fonts=[],this.isLoaded=!1,this.typekitLoaded=0,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)}addChars(t){if(!t)return;this.chars=this.chars??[];let{length:e}=t,s,{length:i}=this.chars,r;for(let a=0;a<e;a++){for(s=0,r=!1;s<i;)this.chars[s]?.style===t[a]?.style&&this.chars[s]?.fFamily===t[a]?.fFamily&&this.chars[s]?.ch===t[a]?.ch&&(r=!0),s++;!r&&(this.chars.push(t[a]),i++)}}addFonts(t,e){if(!t){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=t.list;return}let{length:s}=t.list;if(!B){this.isLoaded=!0;for(let e=0;e<s;e++){let s=t.list[e];s&&(s.helper=this.createHelper(s),s.cache={})}this.fonts=t.list;return}let i=s;for(let s=0;s<i;s++){let r=!0,a,n=t.list[s];if(n){if(n.loaded=!1,n.monoCase=sE(n.fFamily,"monospace"),n.sansCase=sE(n.fFamily,"sans-serif"),n.fPath){if("p"===n.fOrigin||3===n.origin){if((a=document.querySelectorAll(`style[f-forigin="p"][f-family="${n.fFamily}"], style[f-origin="3"][f-family="${n.fFamily}"]`)).length>0&&(r=!1),r){let t=ev("style");t.setAttribute("f-forigin",n.fOrigin),t.setAttribute("f-origin",`${n.origin}`),t.setAttribute("f-family",n.fFamily),t.innerText=`@font-face {font-family: ${n.fFamily}; font-style: normal; src: url('${n.fPath}');}`,e?.appendChild(t)}}else if("g"===n.fOrigin||1===n.origin){let{length:t}=a=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');for(s=0;s<t;s++)a[s]?.href.includes(n.fPath)&&(r=!1);if(r){let t=ev("link");t.setAttribute("f-forigin",n.fOrigin),t.setAttribute("f-origin",`${n.origin}`),t.type="text/css",t.rel="stylesheet",t.href=n.fPath,document.body.appendChild(t)}}else if("t"===n.fOrigin||2===n.origin){let{length:t}=a=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');for(s=0;s<t;s++)n.fPath===a[s]?.src&&(r=!1);if(r){let t=ev("link");t.setAttribute("f-forigin",n.fOrigin),t.setAttribute("f-origin",`${n.origin}`),t.rel="stylesheet",t.href=n.fPath,e?.appendChild(t)}}}else n.loaded=!0,i-=1;n.helper=this.createHelper(n,e),n.cache={},this.fonts.push(n)}}0===i?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}getCharData(t,e,s){let i=0,{length:r}=this.chars??[];for(;i<r;){if(this.chars?.[i]?.ch===t&&this.chars[i]?.style===e&&this.chars[i]?.fFamily===s)return this.chars[i];i++}return("string"!=typeof t||13===t.charCodeAt(0))&&t||this._warned||(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),sv}getFontByName(t){let e=0,{length:s}=this.fonts;for(;e<s;){if(this.fonts[e]?.fName===t)return this.fonts[e];e++}return this.fonts[0]}measureText(t,e,s){let i=this.getFontByName(e);if(i.cache&&!i.cache[t]){let e=i.helper;if(" "===t){let s=Number(e?.measureText(`|${t}|`)),r=Number(e?.measureText("||"));i.cache[t]=(s-r)/100}else i.cache[t]=Number(e?.measureText(t))/100}return Number(i.cache?.[t])*Number(s)}checkLoadedFonts(){let t,e,s=this.fonts.length;for(let i=0;i<s;i++){let r=this.fonts[i];if(!r)continue;if(r.loaded){s-=1;continue}if("n"===r.fOrigin||0===r.origin){r.loaded=!0;continue}if(t=r.monoCase?.node,e=r.monoCase?.w||0,t?.offsetWidth===e?(t=r.sansCase?.node,e=r.sansCase?.w||0,t?.offsetWidth!==e&&(s-=1,r.loaded=!0)):(s-=1,r.loaded=!0),!r.loaded)continue;let{monoCase:a,sansCase:n}=r;n&&n.parent.parentNode?.removeChild(n.parent),a&&a.parent.parentNode?.removeChild(a.parent)}0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}createHelper(t,e){let s;if(B)return;let i=e?ti.SVG:ti.Canvas,r=sy(t);if(i===ti.SVG){let i=tc("text");i.style.fontSize="100px",i.setAttribute("font-family",t.fFamily),i.setAttribute("font-style",r.style),i.setAttribute("font-weight",r.weight),i.textContent="1",t.fClass?(i.style.fontFamily="inherit",i.classList.add(t.fClass)):i.style.fontFamily=t.fFamily,e?.appendChild(i),s=i}else{let e=new OffscreenCanvas(500,500).getContext("2d");e&&(e.font=`${r.style} ${r.weight} 100px ${t.fFamily}`,s=e)}return{measureText:t=>i===ti.SVG?(s.textContent=t,s.getComputedTextLength()):s.measureText(t).width}}setIsLoaded(){this.isLoaded=!0}}class sS extends tH{constructor(t,e){super(),this.canResize=!1,this.defaultBoxWidth=[0,0],this.effectsSequence=[],this.keysIndex=0,this.minimumFontSize=1,this.pv="",this.v="",this._frameId=-999999,this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d?.sid&&(e.d=t.globalData?.slotManager?.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.currentData={__complete:!1,ascent:0,boxWidth:this.defaultBoxWidth,f:"",fc:"",fillColorAnim:!1,finalLineHeight:0,finalSize:0,finalText:[],fStyle:"",fWeight:"",justifyOffset:0,l:[],lh:0,lineWidths:[],ls:0,of:"",ps:null,s:0,sc:"",strokeColorAnim:!1,strokeWidthAnim:!1,sw:0,t:0,tr:0,yOffset:0};const s=this.data.d?.k[0]?.s;s&&this.copyData(this.currentData,s),this.searchProperty()||this.completeTextData(this.currentData)}addEffect(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)}buildFinalText(t){let e=[],s=0,i=t.length,r,a,n,o=!1,h;for(;s<i;){var l;(n=o,o=!1,r=t.charCodeAt(s),h=t.charAt(s),sb.includes(r))?n=!0:r>=55296&&r<=56319?function(t,e){let s=e,i=sw(t.slice(s,2));if(127988!==i)return!1;let r=0;for(s+=2;r<5;){if((i=sw(t.slice(s,2)))<917601||i>917626)return!1;r++,s+=2}return 917631===sw(t.slice(s,2))}(t,s)?h=t.slice(s,14):(a=t.charCodeAt(s+1))>=56320&&a<=57343&&(function(t,e){let s=t.toString(16)+e.toString(16);return s_.includes(s)}(r,a)?(h=t.slice(s,2),n=!0):h=sx((l=t.slice(s,4)).slice(0,2))&&sx(l.slice(2,2))?t.slice(s,4):t.slice(s,2)):r>56319?65039===r&&(n=!0):8205===r&&(n=!0,o=!0),n?e[e.length-1]+=h:e.push(h),s+=h.length}return e}calculateExpression(t){throw Error(`${this.constructor.name}: Method calculateExpression is not implemented`)}canResizeFont(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}completeTextData(t){let e,s,i,r,a,n,o;t.__complete=!0;let{fontManager:h}=this.elem.globalData??{};if(!h)throw Error(`${this.constructor.name}: FontManager not loaded to globalData`);let{canResize:l,data:p,minimumFontSize:m}=this,c=[],d,u,f=0,g,y=p.m?.g,b=0,v=0,_=0,x=[],w,E=0,C=h.getFontByName(t.f),S=sy(C);t.fWeight=S.weight,t.fStyle=S.style,t.finalSize=t.s,t.finalText=this.buildFinalText(`${t.t}`),d=t.finalText.length||0,t.finalLineHeight=t.lh;let k=t.tr/1e3*t.finalSize;if(t.sz){let r,a,n=!0,[o,p]=t.sz;for(;n;){a=this.buildFinalText(`${t.t}`),r=0,w=0,d=a.length,k=t.tr/1e3*t.finalSize;let c=-1;for(let n=0;n<d;n++)i=a[n]?.charCodeAt(0)??0,u=!1," "===a[n]?c=n:(13===i||3===i)&&(w=0,u=!0,r+=t.finalLineHeight||1.2*t.finalSize),h.chars?(e=h.getCharData(a[n]??"",C.fStyle,C.fFamily),s=u?0:e.w*t.finalSize/100):s=h.measureText(a[n]??"",t.f,t.finalSize)||0,w+s>o&&" "!==a[n]?(-1===c?d++:n=c,r+=t.finalLineHeight||1.2*t.finalSize,a.splice(n,+(c===n),"\r"),c=-1,w=0):(w+=s,w+=k);r+=Number(C.ascent)*t.finalSize/100,l&&t.finalSize>m&&p<r?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=a,d=t.finalText.length,n=!1)}}w=-k;let M=0,P;for(let r=0;r<d;r++)if(u=!1,13===(i=(P=t.finalText[r]??"").charCodeAt(0))||3===i?(M=0,x.push(w),E=w>E?w:E,w=-2*k,g="",u=!0,_++):g=P,h.chars?(e=h.getCharData(P,C.fStyle,h.getFontByName(t.f).fFamily),s=u?0:e.w*t.finalSize/100):s=h.measureText(g,t.f,t.finalSize)," "===P?M+=s+k:(w+=s+k+M,M=0),c.push({add:b,an:s,animatorJustifyOffset:0,anIndexes:[],l:s,line:_,n:u,val:g}),2===y){if(b+=s,""===g||" "===g||r===d-1){for((""===g||" "===g)&&(b-=s);v<=r;){let t=c[v];t&&(t.an=b,t.ind=f,t.extra=s),v++}f++,b=0}}else if(3===y){if(b+=s,""===g||r===d-1){""===g&&(b-=s);let t=c[v];for(;v<=r;)t&&(t.an=b,t.ind=f,t.extra=s),v++;b=0,f++}}else{let t=c[f];t&&(t.ind=f,t.extra=0),f++}if(t.l=c,E=w>E?w:E,x.push(w),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=E,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=x;let A=p.a,{length:D}=A??[],T=[];for(let e=0;e<D;e++){if(!(r=A?.[e]))continue;r.a?.sc&&(t.strokeColorAnim=!0),r.a?.sw&&(t.strokeWidthAnim=!0),(r.a?.fc||r.a?.fh||r.a?.fs||r.a?.fb)&&(t.fillColorAnim=!0),o=0,n=Number(r.s?.b);for(let t=0;t<d;t++)(a=c[t]??{}).anIndexes[e]=o,(1===n&&""!==a.val||2===n&&""!==a.val&&" "!==a.val||3===n&&(a.n||" "===a.val||t===d-1)||4===n&&(a.n||t===d-1))&&(1===Number(r.s?.rn)&&T.push(o),o++);let s=p.a?.[e]?.s;s&&(s.totalChars=o);let i=-1,h;if(r.s?.rn===1)for(let t=0;t<d;t++)i!==Number((a=c[t]??{}).anIndexes[e])&&(i=a.anIndexes[e]??0,h=T.splice(Math.floor(Math.random()*T.length),1)[0]),h&&(a.anIndexes[e]=h)}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=Number(C.ascent)*t.finalSize/100}copyData(t,e){let s=Object.keys(e),{length:i}=s;for(let r=0;r<i;r++)Object.hasOwn(e,s[r]??"")&&(t[s[r]]=e[s[r]]);return t}getExpressionValue(t,e){throw Error(`${this.constructor.name}: Method getExpressionValue is not implemented`)}getKeyframeValue(){let t=this.data.d?.k??[],e=Number(this.elem.comp?.renderedFrame),s=0,i=t.length;for(;s<=i-1&&!(s===i-1||Number(t[s+1]?.t)>e);)s++;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d?.k[this.keysIndex]?.s}getValue(t){if((this.elem.globalData?.frameId===this.frameId||0===this.effectsSequence.length)&&!t)return 0;let e=this.data.d?.k[this.keysIndex]?.s.t;void 0!==e&&(this.currentData.t=e);let s=this.currentData,i=this.keysIndex;if(this.lock)return this.setCurrentData(this.currentData),0;this.lock=!0,this._mdf=!1;let{length:r}=this.effectsSequence,a=t??this.data.d?.k[this.keysIndex]?.s;for(let t=0;t<r;t++)a=i===this.keysIndex?this.effectsSequence[t]?.(this.currentData,a?.t):this.effectsSequence[t]?.(a,a?.t);return s!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData?.frameId,0}recalculate(t){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);let e=this.data.d.k[t]?.s;e&&(e.__complete=!1),this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)}searchExpressions(){throw Error(`${this.constructor.name}: Method searchExpressions is not implemented`)}searchKeyframes(){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf}searchProperty(){return this.searchKeyframes()}setCurrentData(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0}setMinimumFontSize(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}updateDocumentData(t,e){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);let s=e;s=s??this.keysIndex;let i=this.copyData({},this.data.d.k[s]?.s??{});i=this.copyData(i,t),(this.data.d.k[s]??{s:null}).s=i,this.recalculate(s),this.setCurrentData(i),this.elem.addDynamicProperty(this)}}class sk extends eA{applyTextPropertiesToMatrix(t,e,s,i,r){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+Number(t.ascent),0),e.translate(0,-Number(t.ls),0),t.j){case 1:e.translate(Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[s])),0,0);break;case 2:e.translate(Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[s]))/2,0,0)}e.translate(i,r,0)}buildColor(t){let e=Math.round(255*t[0]),s=Math.round(255*t[1]),i=Math.round(255*t[2]);return`rgb(${e},${s},${i})`}buildNewText(){throw Error(`${this.constructor.name}: Method buildNewText is not implemented`)}canResizeFont(t){this.textProperty?.canResizeFont(t)}createPathShape(t,e){let s,i="",{length:r}=e;for(let a=0;a<r;a++)e[a]?.ty===tr.Path&&e[a]?.ks?.k&&(i+=eT(s=e[a]?.ks?.k,s.i.length,!0,t));return i}initElement(t,e,s){if(!t.t)throw Error(`${this.constructor.name}: data.t (LottieLayer -> TextData) can't be undefined`);this.emptyProp=new sh,this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new sS(this,t.t),this.textAnimator=new sg(t.t,this.renderType||ti.SVG,this),this.initTransform(),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)}prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}setMinimumFontSize(t){this.textProperty?.setMinimumFontSize(t)}updateDocumentData(t,e){this.textProperty?.updateDocumentData(t,e)}validateText(){(this.textProperty?._mdf||this.textProperty?._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)}}let sM="rgba(0,0,0,0)";class sP extends sk{constructor(t,e,s){super(),this.clearCanvas=eP.prototype.clearCanvas,this.createContainerElements=eP.prototype.createContainerElements,this.createContent=eP.prototype.createContent,this.createElements=eP.prototype.createElements,this.createRenderableComponents=eP.prototype.createRenderableComponents,this.currentRender=null,this.destroy=eP.prototype.destroy,this.exitLayer=eP.prototype.exitLayer,this.fill=!1,this.fillColorAnim=!1,this.hide=eP.prototype.hide,this.hideElement=eP.prototype.hideElement,this.initRendererElement=eP.prototype.initRendererElement,this.justifyOffset=0,this.prepareLayer=eP.prototype.prepareLayer,this.renderedLetters=[],this.renderFrame=eP.prototype.renderFrame,this.renderLocalTransform=eP.prototype.renderLocalTransform,this.renderRenderable=eP.prototype.renderRenderable,this.searchEffectTransforms=eP.prototype.searchEffectTransforms,this.setBlendMode=eP.prototype.setBlendMode,this.show=eP.prototype.show,this.showElement=eP.prototype.showElement,this.stroke=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.textSpans=[],this.tHelper=ev("canvas").getContext("2d"),this.values={fill:sM,fValue:"",stroke:sM,sWidth:0},this.yOffset=0,this.renderType=ti.Canvas,this.initElement(t,e,s)}buildNewText(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.globalData.fontManager)throw Error(`${this.constructor.name}: fontManager is not implemented in globalData`);if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not implemented`);let t=this.textProperty.currentData;this.renderedLetters=tp(t.l.length||0);let e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;let s=!1;t.sc&&(s=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=Number(t.sw));let i=this.globalData.fontManager.getFontByName(t.f),r=t.l,a=this.mHelper;this.stroke=s,this.values.fValue=`${t.finalSize}px ${this.globalData.fontManager.getFontByName(t.f).fFamily}`;let{singleShape:n}=this.data,o=.001*t.tr*Number(t.finalSize),h,l=0,p=0,m=!0,c=0,{length:d}=t.finalText;for(let e=0;e<d;e++){let s=this.globalData.fontManager.getCharData(t.finalText[e],i.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily).data??{};a.reset(),n&&r[e]?.n&&(l=-o,p+=Number(t.yOffset),p+=+!!m,m=!1);let d=s.shapes?.[0]?.it??[];a.scale(Number(t.finalSize)/100,Number(t.finalSize)/100),n&&this.applyTextPropertiesToMatrix(t,a,r[e]?.line??0,l,p);let{length:u}=d,f=tp(u-1),g=0;for(let t=0;t<u;t++){if(d[t]?.ty!==tr.Path)continue;let{length:e}=(d[t]?.ks?.k).i,s=d[t]?.ks?.k,i=[];for(h=1;h<e;h++)1===h&&i.push(a.applyToX(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0),a.applyToY(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0)),i.push(a.applyToX(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToY(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToX(s.i[h]?.[0]??0,s.i[h]?.[1]??0,0),a.applyToY(s.i[h]?.[0]??0,s.i[h]?.[1]??0,0),a.applyToX(s.v[h]?.[0]??0,s.v[h]?.[1]??0,0),a.applyToY(s.v[h]?.[0]??0,s.v[h]?.[1]??0,0));i.push(a.applyToX(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToY(s.o[h-1]?.[0]??0,s.o[h-1]?.[1]??0,0),a.applyToX(s.i[0]?.[0]??0,s.i[0]?.[1]??0,0),a.applyToY(s.i[0]?.[0]??0,s.i[0]?.[1]??0,0),a.applyToX(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0),a.applyToY(s.v[0]?.[0]??0,s.v[0]?.[1]??0,0)),f[g]=i,g++}n&&(l+=r[e]?.l??0,l+=o),this.textSpans[c]?this.textSpans[c].elem=f:this.textSpans[c]={elem:f},c++}}renderInnerContent(){let t,e,s,i;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.textAnimator)throw Error(`${this.constructor.name}: textAnimator is not implemented`);if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer?.ctxLineCap("butt"),this.globalData.renderer?.ctxLineJoin("miter"),this.globalData.renderer?.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);let{renderedLetters:r}=this.textAnimator,a=this.textProperty.currentData.l,n,o=null,h=null,l=null,p,m,c=this.globalData.renderer,{length:d}=a;for(let u=0;u<d;u++)if(!a[u]?.n){if(n=r[u],c.save(),c.ctxTransform(n?.p),c.ctxOpacity(n?.o),this.fill){n?.fc?o!==n.fc&&(c.ctxFillStyle(n.fc),o=n.fc):o!==this.values.fill&&(o=this.values.fill,c.ctxFillStyle(this.values.fill));let{length:e}=p=this.textSpans[u]?.elem??[];for(this.globalData.canvasContext?.beginPath(),t=0;t<e;t++){let{length:e}=m=p[t]??[];for(this.globalData.canvasContext?.moveTo(m[0]??0,m[1]??0),s=2;s<e;s+=6)this.globalData.canvasContext?.bezierCurveTo(m[s]??0,m[s+1]??0,m[s+2]??0,m[s+3]??0,m[s+4]??0,m[s+5]??0)}this.globalData.canvasContext?.closePath(),c.ctxFill()}if(this.stroke){for(n?.sw?l!==n.sw&&(l=n.sw,c.ctxLineWidth(n.sw)):l!==this.values.sWidth&&(l=this.values.sWidth,c.ctxLineWidth(this.values.sWidth)),n?.sc?h!==n.sc&&(h=n.sc,c.ctxStrokeStyle(n.sc)):h!==this.values.stroke&&(h=this.values.stroke,c.ctxStrokeStyle(this.values.stroke)),e=(p=this.textSpans[u]?.elem??[]).length,this.globalData.canvasContext?.beginPath(),t=0;t<e;t++)for(i=(m=p[t]??[]).length,this.globalData.canvasContext?.moveTo(m[0]??0,m[1]??0),s=2;s<i;s+=6)this.globalData.canvasContext?.bezierCurveTo(m[s]??0,m[s+1]??0,m[s+2]??0,m[s+3]??0,m[s+4]??0,m[s+5]??0);this.globalData.canvasContext?.closePath(),c.ctxStroke()}this.globalData.renderer?.restore()}}}class sA extends ey{constructor(t,e,s){super(),this._canPlay=!1,this._currentTime=0,this._isPlaying=!1,this._previousVolume=null,this._volume=1,this._volumeMultiplier=1,this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId)??null,this.initBaseData(t,e,s);const i=this.globalData?.getAssetsPath(this.assetData);this.audio=this.globalData?.audioController?.createAudio(i),this.globalData?.audioController?.addAudio(this),this.tm=t.tm?tZ.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=tZ.getProp(this,t.au?.lv??{k:[100]},1,.01,this)}getBaseElement(){return null}hide(){this.audio.pause(),this._isPlaying=!1}initExpressions(){}pause(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1}prepareFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder?this._currentTime=t/Number(this.data.sr):this._currentTime=this.tm.v,this._volume=this.lv.v[0];let e=this._volume*this._volumeMultiplier;this._previousVolume!==e&&(this._previousVolume=e,this.audio.volume(e))}renderFrame(t){if(this.isInRange&&this._canPlay){if(!this._isPlaying){this.audio.play(),this.audio.seek(this._currentTime/Number(this.globalData?.frameRate)),this._isPlaying=!0;return}(!this.audio.playing()||Math.abs(this._currentTime/Number(this.globalData?.frameRate)-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/Number(this.globalData?.frameRate))}}resume(){this._canPlay=!0}setRate(t){this.audio.rate(t)}show(){}sourceRectAtTime(){return null}volume(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)}}class sD extends ey{constructor(t,e,s){if(super(),this.assetData=null,this.initFrame(),this.initRenderable(),t.refId&&(this.assetData=e.getAssetData(t.refId)??null),!e.imageLoader)throw Error(`${this.constructor.name}: imageLoader is not implemented in globalData`);this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(t,e,s)}getBaseElement(){return null}getFootageData(){return this.footageData}initExpressions(){let t=eh.interface;if(!t)return;let e=t("footage");this.layerInterface=new e(this)}prepareFrame(){}renderFrame(){}}class sT{constructor(t){this.animationData=t}getProp(t){let{sid:e}=t;return e&&this.animationData.slots?.[e]?Object.assign(t,this.animationData.slots[e].p):t}}class sF extends eg{addPendingElement(t){this.pendingElements.push(t)}buildAllItems(){let{length:t}=this.layers;for(let e=0;e<t;e++)this.buildItem(e);this.checkPendingElements()}buildElementParenting(t,e,s=[]){let{elements:i,layers:r}=this,{length:a}=r,n=0;for(;n<a;){if(r[n]?.ind!==e){n++;continue}let a=i[n];if(!a||!0===a){this.buildItem(n),this.addPendingElement(t),n++;continue}if(s.push(a),a.setAsParent(),r[n]?.parent===void 0){t.setHierarchy(s),n++;continue}this.buildElementParenting(t,r[n]?.parent,s),n++}}buildItem(t){throw Error(`${this.constructor.name}: Method buildItem not yet implemented`)}checkLayers(t){this.completeLayers=!0;let{length:e}=this.layers;for(let s=e-1;s>=0;s--){let e=this.layers[s];!this.elements[s]&&e&&e.ip-e.st<=Number(t)-e.st&&e.op-e.st>Number(t)-e.st&&this.buildItem(s),this.completeLayers=!!this.elements[s]&&this.completeLayers}this.checkPendingElements()}checkPendingElements(){throw Error(`${this.constructor.name}: Method checkPendingElements not yet implemented`)}createAudio(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sA(t,this.globalData,this)}createCamera(t){throw Error("You're using a 3d camera. Try the html renderer.")}createComp(t,e,s,i){throw Error(`${this.constructor.name}: Method createComp not yet implemented`)}createFootage(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sD(t,this.globalData,this)}createImage(t){throw Error(`${this.constructor.name}: Method createImage is not implemented`)}createItem(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}}createNull(t){throw Error(`${this.constructor.name}: Method createNull not implemented`)}createShape(t){throw Error(`${this.constructor.name}: Method createShape not implemented`)}createSolid(t){throw Error(`${this.constructor.name}: Method createSolid not implemented`)}createText(t){throw Error(`${this.constructor.name}: Method createText not implemented`)}getElementById(t){let{length:e}=this.elements;for(let s=0;s<e;s++)if(this.elements[s]?.data.ind===t)return this.elements[s]??null;return null}getElementByPath(t){let e,s=t.shift();if("number"==typeof s)e=this.elements[s];else{let{length:t}=this.elements;for(let i=0;i<t;i++)if(this.elements[i]?.data.nm===s){e=this.elements[i];break}}return 0===t.length?e:e?.getElementByPath(t)}includeLayers(t){this.completeLayers=!1;let{length:e}=t,{length:s}=this.layers;for(let i=0;i<e;i++){let e=0;for(;e<s;){if(this.layers[e]?.id===t[i]?.id){this.layers[e]=t[i];break}e++}}}initItems(){this.globalData?.progressiveLoad||this.buildAllItems()}prepareFrame(t){throw Error(`${this.constructor.name}: Method prepareFrame not yet implemented`)}searchExtraCompositions(t){let{length:e}=t;for(let s=0;s<e;s++)if(t[s]?.xt){let e=this.createComp(t[s]);e.initExpressions(),this.globalData?.projectInterface.registerComposition(e)}}setProjectInterface(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);t&&(this.globalData.projectInterface=t)}setupGlobalData(t,e){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);this.globalData.fontManager=new sC,this.globalData.slotManager=new sT(t),this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr||60,this.globalData.nm=t.nm,this.globalData.compSize={h:t.h,w:t.w}}constructor(...t){super(...t),this.completeLayers=!1,this.currentFrame=0,this.elements=[],this.layers=[],this.pendingElements=[]}}class sI extends eg{constructor(t,e,s){super(),this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initHierarchy()}getBaseElement(){return null}prepareFrame(t){this.prepareProperties(t,!0)}renderFrame(t){return null}}class s$ extends eR{constructor(t,e,s){super(t,e,s),this.initElement(t,e,s)}createContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=tc("rect");t.width.baseVal.value=this.data.sw||0,t.height.baseVal.value=this.data.sh||0,this.data.sc&&t.setAttribute("fill",this.data.sc),this.layerElement?.appendChild(t)}}let sL={shapes:[]};class sN extends sk{constructor(t,e,s){super(),this.createContainerElements=eV.prototype.createContainerElements,this.createRenderableComponents=eV.prototype.createRenderableComponents,this.destroyBaseElement=eV.prototype.destroyBaseElement,this.getBaseElement=eV.prototype.getBaseElement,this.getMatte=eV.prototype.getMatte,this.initRendererElement=eV.prototype.initRendererElement,this.renderedLetters=[],this.renderElement=eV.prototype.renderElement,this.setMatte=eV.prototype.setMatte,this.textSpans=[],this.renderType=ti.SVG,this.initElement(t,e,s)}buildNewText(){let t,e;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);if(!this.textProperty?.currentData)throw Error(`${this.constructor.name}: DocumentData is not implemented`);this.addDynamicProperty(this);let s=this.textProperty.currentData;this.renderedLetters=tp(s.l.length||0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",`${s.sw||0}`)),this.layerElement.setAttribute("font-size",`${s.finalSize||0}`);let i=this.globalData.fontManager?.getFontByName(s.f);if(i?.fClass)this.layerElement.classList.add(i.fClass);else{i?.fFamily&&this.layerElement.setAttribute("font-family",i.fFamily);let{fWeight:t}=s,{fStyle:e}=s;this.layerElement.setAttribute("font-style",e),this.layerElement.setAttribute("font-weight",t)}this.layerElement.ariaLabel=`${s.t}`;let r=s.l,a=!!this.globalData.fontManager?.chars;e=r.length;let n=null,o=this.mHelper,{singleShape:h}=this.data,l=0,p=0,m=!0,c=.001*s.tr*Number(s.finalSize);if(!h||a||s.sz){let d,u=this.textSpans.length;for(t=0;t<e;t++){if(this.textSpans[t]=this.textSpans[t]??{childSpan:null,glyph:null,span:null},!a||!h||0===t){if(!(n=(u>t?this.textSpans[t]?.span:tc(a?"g":"text"))??null))throw Error("Could not create tSpan");if(u<=t){if(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]&&(this.textSpans[t].span=n),a){let e=tc("g");n.appendChild(e),this.textSpans[t]&&(this.textSpans[t].childSpan=e)}this.textSpans[t]&&(this.textSpans[t].span=n),this.layerElement.appendChild(n)}n.style.display="inherit"}if(o.reset(),h&&(r[t]?.n&&(l=-c,p+=Number(s.yOffset),p+=+!!m,m=!1),this.applyTextPropertiesToMatrix(s,o,r[t]?.line??0,l,p),l+=r[t]?.l||0,l+=c),a){let e;if(d=this.globalData.fontManager?.getCharData(s.finalText[t]??"",i?.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily),d?.t===1)e=new sV(d.data,this.globalData,this);else{let t=sL;d?.data?.shapes&&(t=this.buildShapeData(d.data,Number(s.finalSize))),e=new ss(t,this.globalData,this)}if(this.textSpans[t]){let{glyph:s}=this.textSpans[t]??{};s&&(s.layerElement&&this.textSpans[t]?.childSpan?.removeChild(s.layerElement),s.destroy()),this.textSpans[t].glyph=e}e._debug=!0,e.prepareFrame(0),e.renderFrame(),e.layerElement&&this.textSpans[t]?.childSpan?.appendChild(e.layerElement),d?.t===1&&this.textSpans[t]?.childSpan?.setAttribute("transform",`scale(${Number(s.finalSize)/100},${Number(s.finalSize)/100})`);continue}n&&(h&&n.setAttribute("transform",`translate(${o.props[12]},${o.props[13]})`),n.textContent=r[t]?.val??"",n.style.whiteSpace="preserve")}h&&n?.setAttribute("d","")}else{let i,r=this.textContainer;switch(s.j){case 1:i="end";break;case 2:i="middle";break;default:i="start"}r?.setAttribute("text-anchor",i),r?.setAttribute("letter-spacing",`${c}`);let a=this.buildTextContents(s.finalText);for(e=a.length,p=s.ps?s.ps[1]+Number(s.ascent):0,t=0;t<e;t++)(n=this.textSpans[t]?.span??tc("tspan")).textContent=a[t]??"",n.setAttribute("x","0"),n.setAttribute("y",`${p}`),n.style.display="inherit",r?.appendChild(n),this.textSpans[t]=this.textSpans[t]??{glyph:null,span:null},this.textSpans[t].span=n,p+=Number(s.finalLineHeight);r&&this.layerElement.appendChild(r)}let d=this.textSpans[t]?.span;if(d)for(;t<this.textSpans.length;)d.style.display="none",t++;this._sizeChanged=!0}buildShapeData(t,e){if(t.shapes.length>0){let s=t.shapes[0];if(s?.it){let t=s.it[s.it.length-1];t?.s&&(t.s.k[0]=e,t.s.k[1]=e)}}return t}buildTextContents(t){let e=0,{length:s}=t,i=[],r="";for(;e<s;)"\r"===t[e]||"\x03"===t[e]?(i.push(r),r=""):r+=t[e]??"",e++;return i.push(r),i}createContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);this.data.singleShape&&!this.globalData.fontManager?.chars&&(this.textContainer=tc("text"))}getValue(){let t;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let{length:e}=this.textSpans;this.renderedFrame=this.comp?.renderedFrame??-1;for(let s=0;s<e;s++)(t=this.textSpans[s]?.glyph)&&(t.prepareFrame(Number(this.comp?.renderedFrame)-this.data.st),t._mdf&&(this._mdf=!0))}renderInnerContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.validateText(),!this.data.singleShape||this._mdf){if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not initialized`);if(this.textAnimator?.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator?.lettersChangedFlag){let t,e,s;this._sizeChanged=!0;let i=this.textAnimator?.renderedLetters,r=this.textProperty.currentData.l,{length:a}=r;for(let n=0;n<a;n++)!r[n]?.n&&(t=i?.[n],e=this.textSpans[n]?.span,(s=this.textSpans[n]?.glyph)&&s.renderFrame(),t?._mdf.m&&e?.setAttribute("transform",t.m),t?._mdf.o&&e?.setAttribute("opacity",`${t.o??1}`),t?._mdf.sw&&e?.setAttribute("stroke-width",`${t.sw||0}`),t?._mdf.sc&&e?.setAttribute("stroke",t.sc),t?._mdf.fc&&e?.setAttribute("fill",t.fc))}}}sourceRectAtTime(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.comp)throw Error(`${this.constructor.name}: comp (ElementInterface) is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;let t=this.layerElement.getBBox();return this.bbox={height:t.height,left:t.x,top:t.y,width:t.width},this.bbox}return null}}class sB extends sF{appendElementInPos(t,e){let s=t.getBaseElement();if(!s)return;let i=0,r;for(;i<e;)!0!==this.elements[i]&&this.elements[i]?.getBaseElement()&&(r=this.elements[i]?.getBaseElement()),i++;r?this.layerElement?.insertBefore(s,r):this.layerElement?.appendChild(s)}buildItem(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData it not implemented`);let{elements:e,globalData:s,layers:i}=this;if(e[t]||i[t]?.ty===99)return;e[t]=!0;let r=this.createItem(i[t]);if(e[t]=r,eh.plugin&&(i[t]?.ty===0&&s.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),i[t]?.tt){let s="tp"in i[t]?this.findIndexByInd(i[t].tp):t-1;if(-1===s)return;if(!e[s]||!0===e[s]){this.buildItem(s),this.addPendingElement(r);return}let a=e[s].getMatte(i[t].tt);r.setMatte(a)}}checkPendingElements(){for(;this.pendingElements.length>0;){let t=this.pendingElements.pop();if(t?.checkParenting(),t?.data.tt){let e=0,{length:s}=this.elements;for(;e<s;){if(this.elements[e]!==t){e++;continue}let s="tp"in t.data?this.findIndexByInd(t.data.tp):e-1,i=this.elements[s]?.getMatte(this.layers[e]?.tt)??"";t.setMatte(i);break}}}}configAnimation(t){try{if(!this.animationItem)throw Error(`${this.constructor.name}: Can't access animationItem`);if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);if(!this.renderConfig)throw Error(`${this.constructor.name}: Can't access renderConfig`);if(!this.svgElement)throw Error(`${this.constructor.name}: Can't access svgElement`);this.svgElement.setAttribute("xmlns",N),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox",`0 0 ${t.w} ${t.h}`),!this.renderConfig.viewBoxOnly&&(this.svgElement.setAttribute("width",`${t.w}`),this.svgElement.setAttribute("height",`${t.h}`),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.renderConfig.contentVisibility&&(this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility)),this.renderConfig.width&&this.svgElement.setAttribute("width",`${this.renderConfig.width}`),this.renderConfig.height&&this.svgElement.setAttribute("height",`${this.renderConfig.height}`),this.renderConfig.className&&this.svgElement.classList.add(this.renderConfig.className),this.renderConfig.id&&(this.svgElement.id=this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",`${this.renderConfig.focusable}`),this.renderConfig.preserveAspectRatio&&this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper?.appendChild(this.svgElement);let{defs:e}=this.globalData;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;let s=tc("clipPath"),i=tc("rect");i.width.baseVal.value=t.w,i.height.baseVal.value=t.h,i.x.baseVal.value=0,i.y.baseVal.value=0;let r=v();s.id=r,s.appendChild(i),this.layerElement?.setAttribute("clip-path",`url(${tu()}#${r})`),e.appendChild(s),this.layers=t.layers,this.elements=tp(t.layers.length)}catch(t){console.error(`${this.constructor.name}:
|
|
2
2
|
`,t)}}createImage(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new eR(t,this.globalData,this)}createNull(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sI(t,this.globalData,this)}createShape(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new ss(t,this.globalData,this)}createSolid(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new s$(t,this.globalData,this)}createText(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sN(t,this.globalData,this)}destroy(){if(!this.animationItem)throw Error(`${this.constructor.name}: Can't access animationItem`);if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;let{length:t}=this.layers;for(let e=0;e<t;e++)this.elements[e]?.destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null}findIndexByInd(t){let{length:e}=this.layers;for(let s=0;s<e;s++)if(this.layers[s]?.ind===t)return s;return -1}hide(){if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);this.layerElement.style.display="none"}renderFrame(t){try{if(!this.globalData||this.renderedFrame===t||this.destroyed)return;let e=t;!1===e?e=this.renderedFrame:this.renderedFrame=Number(e),this.globalData.frameNum=e,this.globalData.frameId++,this.globalData.projectInterface.currentFrame=e||0,this.globalData._mdf=!1;let{length:s}=this.layers;this.completeLayers||this.checkLayers(e);for(let t=s-1;t>=0;t--)"boolean"!=typeof this.elements[t]&&(this.completeLayers||this.elements[t])&&this.elements[t]?.prepareFrame(Number(e)-(this.layers[t]?.st??0));if(this.globalData._mdf)for(let t=0;t<s;t++)"boolean"!=typeof this.elements[t]&&(this.completeLayers||this.elements[t])&&this.elements[t]?.renderFrame()}catch(t){console.error(this.constructor.name,t)}}show(){if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);this.layerElement.style.display="block"}updateContainerSize(t,e){throw Error(`${this.constructor.name}: Method updateContainerSize is not implemented`)}constructor(...t){super(...t),this.destroyed=!1}}class sV extends eV{constructor(t,e,s){super(),this.addPendingElement=sB.prototype.addPendingElement,this.appendElementInPos=sB.prototype.appendElementInPos,this.buildAllItems=sB.prototype.buildAllItems,this.buildElementParenting=sB.prototype.buildElementParenting,this.buildItem=sB.prototype.buildItem,this.checkLayers=sB.prototype.checkLayers,this.checkPendingElements=sB.prototype.checkPendingElements,this.completeLayers=!1,this.configAnimation=sB.prototype.configAnimation,this.createAudio=sB.prototype.createAudio,this.createCamera=sB.prototype.createCamera,this.createFootage=sB.prototype.createFootage,this.createImage=sB.prototype.createImage,this.createItem=sB.prototype.createItem,this.createNull=sB.prototype.createNull,this.createShape=sB.prototype.createShape,this.createSolid=sB.prototype.createSolid,this.createText=sB.prototype.createText,this.currentFrame=0,this.destroy=eD.prototype.destroy,this.destroyElements=eD.prototype.destroyElements,this.findIndexByInd=sB.prototype.findIndexByInd,this.getElementById=sB.prototype.getElementById,this.getElementByPath=sB.prototype.getElementByPath,this.getElements=eD.prototype.getElements,this.hide=eD.prototype.hide,this.includeLayers=sB.prototype.includeLayers,this.initElement=eD.prototype.initElement,this.initItems=sB.prototype.initItems,this.pendingElements=[],this.prepareFrame=eD.prototype.prepareFrame,this.renderFrame=eD.prototype.renderFrame,this.renderInnerContent=eD.prototype.renderInnerContent,this.searchExtraCompositions=sB.prototype.searchExtraCompositions,this.setElements=eD.prototype.setElements,this.setProjectInterface=sB.prototype.setProjectInterface,this.setupGlobalData=sB.prototype.setupGlobalData,this.show=eD.prototype.show,this.supports3d=!0,this.updateContainerSize=sB.prototype.updateContainerSize,this.layers=t.layers,this.elements=this.layers?tp(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?tZ.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}createComp(t){if(!this.globalData)throw Error(`${this.constructor.name}: Cannot access global data`);return new sV(t,this.globalData,this)}}class sR extends sB{constructor(t,e={}){super(),this.rendererType=ti.SVG,this.animationItem=t,this.svgElement=tc("svg");let s="";if(e.title){const t=tc("title"),i=v();t.id=i,t.textContent=e.title,this.svgElement.appendChild(t),s+=i}if(e.description){const t=tc("desc"),i=v();t.id=i,t.textContent=e.description,this.svgElement.appendChild(t),s+=` ${i}`}s&&this.svgElement.setAttribute("aria-labelledby",s);const i=tc("defs");this.svgElement.appendChild(i);const r=tc("g");this.svgElement.appendChild(r),this.layerElement=r,this.renderConfig={className:e.className||"",contentVisibility:e.contentVisibility||"visible",filterSize:{height:e.filterSize?.height||"100%",width:e.filterSize?.width||"100%",x:e.filterSize?.x||"0%",y:e.filterSize?.y||"0%"},focusable:e.focusable,height:e.height,hideOnTransparent:!1!==e.hideOnTransparent,id:e.id||"",imagePreserveAspectRatio:e.imagePreserveAspectRatio||"xMidYMid slice",preserveAspectRatio:e.preserveAspectRatio||"xMidYMid meet",progressiveLoad:e.progressiveLoad||!1,runExpressions:void 0===e.runExpressions||e.runExpressions,viewBoxOnly:e.viewBoxOnly||!1,viewBoxSize:e.viewBoxSize||!1,width:e.width},this.globalData={_mdf:!1,defs:i,frameNum:-1,frameRate:60,renderConfig:this.renderConfig}}createComp(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new sV(t,this.globalData,this)}}class sO extends sF{buildItem(t){let{elements:e,layers:s}=this;if(e[t]||s[t]?.ty===99)return;let i=this.createItem(s[t]);e[t]=i,i.initExpressions()}checkPendingElements(){for(;this.pendingElements.length>0;){let t=this.pendingElements.pop();t?.checkParenting()}}configAnimation(t){if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);if(!this.renderConfig)throw Error(`${this.constructor.name}: renderConfig is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(this.animationItem.wrapper){this.animationItem.container=ev("canvas");let{style:t}=this.animationItem.container;t.width="100%",t.height="100%",t.transformOrigin="0px 0px 0px",t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&(this.animationItem.container.className=this.renderConfig.className),this.renderConfig.id&&(this.animationItem.container.id=this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData?.setContext(this.canvasContext),this.data=t,this.layers=t.layers,this.transformCanvas={h:t.h,sx:0,sy:0,tx:0,ty:0,w:t.w},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=tp(t.layers.length),this.updateContainerSize()}createImage(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return new si(t,this.globalData,this)}createShape(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return new sn(t,this.globalData,this)}createSolid(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return new so(t,this.globalData,this)}createText(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return new sP(t,this.globalData,this)}ctxFill(t){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.fill(t)}ctxFillRect(t,e,s,i){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.fillRect(t,e,s,i)}ctxFillStyle(t=""){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.fillStyle=t}ctxLineCap(t){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.lineCap=t}ctxLineJoin(t){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.lineJoin=t}ctxLineWidth(t){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.lineWidth=t}ctxMiterLimit(t){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.miterLimit=t}ctxOpacity(t=1){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.globalAlpha*=t<0?0:t}ctxStroke(){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.stroke()}ctxStrokeStyle(t=""){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.canvasContext.strokeStyle=t}ctxTransform(t){if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])&&this.canvasContext.transform(t[0]??0,t[1]??0,t[4]??0,t[5]??0,t[12]??0,t[13]??0)}destroy(){if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);this.renderConfig?.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText="");let{length:t}=this.layers;for(let e=t-1;e>=0;e-=1)this.elements[e]?.destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0}hide(){if(!this.animationItem?.container)throw Error(`${this.constructor.name}: animationItem -> container is not implemented`);this.animationItem.container.style.display="none"}renderFrame(t,e){try{if(!this.globalData)throw Error("globalData is not implemented");if(!this.animationItem)throw Error("animationItem is not implemented");if(!1===t||this.renderedFrame===t&&this.renderConfig?.clearCanvas===!0&&!e||this.destroyed||-1===t)return;this.renderedFrame=t,this.globalData.frameNum=t-Number(this.animationItem._isFirstFrame),this.globalData.frameId++,this.globalData._mdf=!!(!this.renderConfig?.clearCanvas||e),this.globalData.projectInterface.currentFrame=t;let{length:s}=this.layers;this.completeLayers||this.checkLayers(t);for(let e=s-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e]?.prepareFrame(t-(this.layers[e]?.st??0));if(this.globalData._mdf){this.renderConfig?.clearCanvas===!0?this.canvasContext?.clearRect(0,0,this.transformCanvas?.w||0,this.transformCanvas?.h||0):this.save();for(let t=s-1;t>=0;t--)(this.completeLayers||this.elements[t])&&this.elements[t]?.renderFrame();this.renderConfig?.clearCanvas!==!0&&this.restore()}}catch(t){console.error(this.constructor.name,t)}}reset(){this.renderConfig?.clearCanvas?this.contextData?.reset():this.canvasContext?.restore()}restore(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);this.renderConfig?.clearCanvas?(t&&(this.globalData.blendMode="source-over"),this.contextData?.restore(t)):this.canvasContext?.restore()}save(t){this.canvasContext?.save()}show(){if(!this.animationItem?.container)throw Error(`${this.constructor.name}: animationItem -> container is not implemented`);this.animationItem.container.style.display="block"}updateContainerSize(t,e){let s,i,r,a;if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);if(!this.renderConfig?.dpr)throw Error(`${this.constructor.name}: renderConfig -> dpr is not implemented`);if(!this.transformCanvas)throw Error(`${this.constructor.name}: transformCanvas is not implemented`);if(this.reset(),t&&e?(s=t,i=e,this.canvasContext.canvas.width=s,this.canvasContext.canvas.height=i):(this.animationItem.wrapper&&this.animationItem.container?(s=this.animationItem.wrapper.offsetWidth,i=this.animationItem.wrapper.offsetHeight):(s=this.canvasContext.canvas.width,i=this.canvasContext.canvas.height),this.canvasContext.canvas.width=s*this.renderConfig.dpr,this.canvasContext.canvas.height=i*this.renderConfig.dpr),this.renderConfig.preserveAspectRatio.includes("meet")||this.renderConfig.preserveAspectRatio.includes("slice")){let t=this.renderConfig.preserveAspectRatio.split(" "),e=t[1]||"meet",n=t[0]||"xMidYMid",o=n.slice(0,4),h=n.slice(4);r=s/i,(a=this.transformCanvas.w/this.transformCanvas.h)>r&&"meet"===e||a<r&&"slice"===e?(this.transformCanvas.sx=s/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=s/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=i/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=i/(this.transformCanvas.h/this.renderConfig.dpr)),"xMid"===o&&(a<r&&"meet"===e||a>r&&"slice"===e)?this.transformCanvas.tx=(s-this.transformCanvas.w*(i/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(a<r&&"meet"===e||a>r&&"slice"===e)?this.transformCanvas.tx=(s-this.transformCanvas.w*(i/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,"YMid"===h&&(a>r&&"meet"===e||a<r&&"slice"===e)?this.transformCanvas.ty=(i-this.transformCanvas.h*(s/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(a>r&&"meet"===e||a<r&&"slice"===e)?this.transformCanvas.ty=(i-this.transformCanvas.h*(s/this.transformCanvas.w))*this.renderConfig.dpr:this.transformCanvas.ty=0}else this.renderConfig.preserveAspectRatio===ts.Initial?(this.transformCanvas.sx=s/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=i/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)}}sO.prototype.createNull=sR.prototype.createNull;class sz extends eD{constructor(t,e,s){super(),this.addPendingElement=sO.prototype.addPendingElement,this.buildAllItems=sO.prototype.buildAllItems,this.buildElementParenting=sO.prototype.buildElementParenting,this.buildItem=sO.prototype.buildItem,this.checkLayers=sO.prototype.checkLayers,this.checkPendingElements=sO.prototype.checkPendingElements,this.clearCanvas=eP.prototype.clearCanvas,this.configAnimation=sO.prototype.configAnimation,this.createAudio=sO.prototype.createAudio,this.createCamera=sO.prototype.createCamera,this.createContainerElements=eP.prototype.createContainerElements,this.createContent=eP.prototype.createContent,this.createElements=eP.prototype.createElements,this.createFootage=sO.prototype.createFootage,this.createImage=sO.prototype.createImage,this.createItem=sO.prototype.createItem,this.createNull=sO.prototype.createNull,this.createRenderableComponents=eP.prototype.createRenderableComponents,this.createShape=sO.prototype.createShape,this.createSolid=sO.prototype.createSolid,this.createText=sO.prototype.createText,this.ctxFill=sO.prototype.ctxFill,this.ctxFillRect=sO.prototype.ctxFillRect,this.ctxFillStyle=sO.prototype.ctxFillStyle,this.ctxLineCap=sO.prototype.ctxLineCap,this.ctxLineJoin=sO.prototype.ctxLineJoin,this.ctxLineWidth=sO.prototype.ctxLineWidth,this.ctxMiterLimit=sO.prototype.ctxMiterLimit,this.ctxOpacity=sO.prototype.ctxOpacity,this.ctxStroke=sO.prototype.ctxStroke,this.ctxStrokeStyle=sO.prototype.ctxStrokeStyle,this.ctxTransform=sO.prototype.ctxTransform,this.exitLayer=eP.prototype.exitLayer,this.getElementById=sO.prototype.getElementById,this.getElementByPath=sO.prototype.getElementByPath,this.hide=eP.prototype.hide,this.hideElement=eP.prototype.hideElement,this.includeLayers=sO.prototype.includeLayers,this.initItems=sO.prototype.initItems,this.initRendererElement=eP.prototype.initRendererElement,this.pendingElements=[],this.prepareLayer=eP.prototype.prepareLayer,this.renderFrame=eP.prototype.renderFrame,this.reset=sO.prototype.reset,this.restore=sO.prototype.restore,this.save=sO.prototype.save,this.searchExtraCompositions=sO.prototype.searchExtraCompositions,this.setBlendMode=eP.prototype.setBlendMode,this.setProjectInterface=sO.prototype.setProjectInterface,this.setupGlobalData=sO.prototype.setupGlobalData,this.show=eP.prototype.show,this.showElement=eP.prototype.showElement,this.updateContainerSize=sO.prototype.updateContainerSize,this.completeLayers=!1,this.layers=t.layers,this.elements=tp(this.layers.length),this.initElement(t,e,s),this.tm=t.tm?tZ.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}createComp(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return new sz(t,this.globalData,this)}destroy(){let{length:t}=this.layers;for(let e=t-1;e>=0;e--)this.elements[e]?.destroy();this.layers=null,this.elements=null}renderInnerContent(){if(!this.data?.w||!this.data.h)throw Error(`${this.constructor.name} data (LottieLayer) is not implemented`);let{canvasContext:t,completeLayers:e,data:s,elements:i,layers:r}=this;if(!t)throw Error(`${this.constructor.name}: canvasContext is not implemented`);t.beginPath(),t.moveTo(0,0),t.lineTo(s.w||0,0),t.lineTo(s.w||0,s.h||0),t.lineTo(0,s.h||0),t.lineTo(0,0),t.clip();let{length:a}=r;for(let t=a-1;t>=0;t--)(e||i[t])&&i[t]?.renderFrame()}}class sG{constructor(){this.fillStyle="",this.lineCap="",this.lineJoin="",this.lineWidth="",this.miterLimit="",this.opacity=-1,this.strokeStyle="",this.transform=tl(K.Float32,16),this.id=Math.random()}}class sq{constructor(){this.appliedFillStyle="",this.appliedLineCap="",this.appliedLineJoin="",this.appliedLineWidth="",this.appliedMiterLimit="",this.appliedStrokeStyle="",this.cArrPos=0,this.cTr=new tm,this.currentFillStyle="",this.currentLineCap="",this.currentLineJoin="",this.currentLineWidth="",this.currentMiterLimit="",this.currentOpacity=1,this.currentStrokeStyle="",this.nativeContext=null,this.stack=[],this.transformMat=new tm;for(let t=0;t<15;t++){const e=new sG;this.stack[t]=e}this._length=15}duplicate(){let t=2*this._length;for(let e=this._length;e<t;e++)this.stack[e]=new sG;this._length=t}fill(t){this.nativeContext&&this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext?.fill(t)}fillRect(t,e,s,i){this.nativeContext&&this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext?.fillRect(t,e,s,i)}fillStyle(t){let e=this.stack[this.cArrPos];e?.fillStyle!==t&&(this.currentFillStyle=t,e&&(e.fillStyle=t))}lineCap(t){let e=this.stack[this.cArrPos];e?.lineCap!==t&&(this.currentLineCap=t,e&&(e.lineCap=t))}lineJoin(t){let e=this.stack[this.cArrPos];e&&e.lineJoin!==t&&(this.currentLineJoin=t,e.lineJoin=t)}lineWidth(t){let e=this.stack[this.cArrPos];e&&e.lineWidth!==t&&(this.currentLineWidth=t,e.lineWidth=t)}miterLimit(t){let e=this.stack[this.cArrPos];e&&e.miterLimit!==t&&(this.currentMiterLimit=t,e.miterLimit=t)}opacity(t){let e=this.stack[this.cArrPos];if(!e)return;let s=e.opacity;s*=t<0?0:t,e.opacity!==s&&(this.nativeContext&&this.currentOpacity!==t&&(this.nativeContext.globalAlpha=t,this.currentOpacity=t),e.opacity=s)}reset(){let t=this.stack[this.cArrPos];this.cArrPos=0,this.cTr.reset(),t&&(t.opacity=1)}restore(t){this.cArrPos-=1;let{fillStyle:e,lineCap:s,lineJoin:i,lineWidth:r,miterLimit:a,opacity:n,strokeStyle:o,transform:h}=this.stack[this.cArrPos],l=this.cTr.props;for(let t=0;t<16;t++)l[t]=h[t]??0;if(t){this.nativeContext?.restore();let t=this.stack[this.cArrPos+1];this.appliedFillStyle=t.fillStyle,this.appliedStrokeStyle=t.strokeStyle,this.appliedLineWidth=t.lineWidth,this.appliedLineCap=t.lineCap,this.appliedLineJoin=t.lineJoin,this.appliedMiterLimit=t.miterLimit}this.nativeContext?.setTransform(h[0],h[1],h[4],h[5],h[12],h[13]),this.nativeContext&&(t||-1!==n&&this.currentOpacity!==n)&&(this.nativeContext.globalAlpha=n,this.currentOpacity=n),this.currentFillStyle=e,this.currentStrokeStyle=o,this.currentLineWidth=r,this.currentLineCap=s,this.currentLineJoin=i,this.currentMiterLimit=a}save(t){let e;t&&this.nativeContext?.save();let{props:s}=this.cTr;this._length<=this.cArrPos&&this.duplicate();let i=this.stack[this.cArrPos];for(e=0;e<16;e++)i.transform[e]=s[e]??0;this.cArrPos++;let r=this.stack[this.cArrPos];r.opacity=i.opacity,r.fillStyle=i.fillStyle,r.strokeStyle=i.strokeStyle,r.lineWidth=i.lineWidth,r.lineCap=i.lineCap,r.lineJoin=i.lineJoin,r.miterLimit=i.miterLimit}setContext(t=null){this.nativeContext=t}setOpacity(t){let e=this.stack[this.cArrPos];e&&(e.opacity=t)}stroke(){if(!this.nativeContext)throw Error(`${this.constructor.name}: nativeContext is not implemented`);this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=Number(this.appliedLineWidth)),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=Number(this.appliedMiterLimit)),this.nativeContext.stroke()}strokeStyle(t){let e=this.stack[this.cArrPos];e?.strokeStyle!==t&&(this.currentStrokeStyle=t,e&&(e.strokeStyle=t))}transform(t){this.transformMat.cloneFromProps(t);let e=this.cTr;this.transformMat.multiply(e),e.cloneFromProps(this.transformMat.props);let s=e.props;this.nativeContext?.setTransform(s[0],s[1],s[4],s[5],s[12],s[13])}}class sj extends sO{constructor(t,e){super(),this.rendererType=ti.Canvas,this.transformMat=new tm,this.animationItem=t,this.renderConfig={className:e?.className||"",clearCanvas:e?.clearCanvas??!0,contentVisibility:e?.contentVisibility||"visible",context:e?.context??null,dpr:e?.dpr??1,id:e?.id||"",imagePreserveAspectRatio:e?.imagePreserveAspectRatio||ts.Cover,preserveAspectRatio:e?.preserveAspectRatio||ts.Contain,progressiveLoad:!!e?.progressiveLoad,runExpressions:e?.runExpressions??!0},this.animationItem.wrapper&&(this.renderConfig.dpr=e?.dpr||window.devicePixelRatio||1),this.globalData={_mdf:!1,currentGlobalAlpha:-1,frameNum:-1,renderConfig:this.renderConfig},this.contextData=new sq,this.elements=[],this.pendingElements=[],this.completeLayers=!1,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}createComp(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return new sz(t,this.globalData,this)}}class sH{constructor(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}}class sW{constructor(t,e){this.type=t,this.direction=e<0?-1:1}}class sY{constructor(t,e,s,i){this.type=t,this.direction=s,this.currentTime=e,this.totalTime=i}}class sU{constructor(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}}class sJ{constructor(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}}class sX{constructor(t,e){this.type=t,this.target=e}}class sZ{constructor(t,e){this.type=te.RenderFrameError,this.nativeError=t,this.currentTime=e}}class sK{constructor(t,e){this.type=te.ConfigError,this.nativeError=t}}class sQ{addEventListener(t,e){return this._cbs[t]=this._cbs[t]??[],this._cbs[t].push(e),()=>{this.removeEventListener(t,e)}}removeEventListener(t,e){if(!e){this._cbs[t]=null;return}if(this._cbs[t]){let s=0,{length:i}=this._cbs[t];for(;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s--,i--),s++;0===this._cbs[t].length&&(this._cbs[t]=null)}}triggerEvent(t,e){if(!this._cbs[t])return;let{length:s}=this._cbs[t];for(let i=0;i<s;i++)this._cbs[t][i]?.(e)}constructor(){this._cbs={}}}let s0={};class s1 extends ey{constructor(){super(),this.maskedElement=null,this.matteElement=null,this.svgElement=null,this.transformedElement=null;const{getBaseElement:t}=eV.prototype,{buildElementParenting:e}=sF.prototype;this.getBaseElement=t,this.destroyBaseElement=this.destroy,this.buildElementParenting=e}addEffects(){}buildElementParenting(t,e,s){throw Error(`${this.constructor.name}: Method buildElementParenting is not implemented`)}checkBlendMode(){}createContainerElements(){this.renderableEffectsManager=new tg(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data?.ln&&this.layerElement?.setAttribute("id",this.data.ln),this.data?.cl&&this.layerElement?.setAttribute("class",this.data.cl),this.data?.bm!==0&&this.setBlendMode()}createRenderableComponents(){if(!this.data||!this.globalData)throw Error(`${this.constructor.name}: data or globalData is not implemented`);this.maskManager=new eF(this.data,this,this.globalData)}destroy(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)}initRendererElement(){this.baseElement=ev(this.data?.tg||"div"),this.data?.hasMask?(this.svgElement=tc("svg"),this.layerElement=tc("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,F(this.baseElement)}renderElement(){let t=this.transformedElement?this.transformedElement.style:{};this.finalTransform?._matMdf&&(t.transform=this.finalTransform.mat.toCSS()),this.finalTransform?._opMdf&&(t.opacity=`${this.finalTransform.mProp.o?.v}`)}renderFrame(t){this.data?.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))}renderInnerContent(){throw Error(`${this.constructor.name}: Method renderInnerContent is not implemented`)}setMatte(){}}class s2 extends eg{constructor(t,e,s){if(super(),this.comp=void 0,this.initFrame(),this.initBaseData(t,e,s),this.initHierarchy(),this.pe=tZ.getProp(this,t.pe,0,0,this),t.ks.p?.s){const e=t.ks.p;this.px=tZ.getProp(this,e.x,1,0,this),this.py=tZ.getProp(this,e.y,1,0,this),this.pz=tZ.getProp(this,e.z,1,0,this)}else this.p=tZ.getProp(this,t.ks.p,1,0,this);if(t.ks.a&&(this.a=tZ.getProp(this,t.ks.a,1,0,this)),t.ks.or?.k.length&&t.ks.or.k[0]?.to){const{length:e}=t.ks.or.k;for(let s=0;s<e;s++){const e=t.ks.or.k[s];e&&(e.to=null,e.ti=null)}}this.or=tZ.getProp(this,t.ks.or,1,$,this),this.or.sh=!0,this.rx=tZ.getProp(this,t.ks.rx,0,$,this),this.ry=tZ.getProp(this,t.ks.ry,0,$,this),this.rz=tZ.getProp(this,t.ks.rz,0,$,this),this.mat=new tm,this._prevMat=new tm,this._isFirstFrame=!0,this.finalTransform={mProp:this}}createElements(){}getBaseElement(){return null}hide(){}prepareFrame(t){this.prepareProperties(t,!0)}renderFrame(t){if(!this.globalData?.compSize)throw Error(`${this.constructor.name}: globalData->compSize is not implemented`);let e=this._isFirstFrame,{length:s}=this.hierarchy;for(let t=0;t<s;t++)e=this.hierarchy[t]?.finalTransform?.mProp._mdf||e;if(e||this.pe?._mdf||this.p?._mdf||this.px&&(this.px._mdf||this.py?._mdf||this.pz?._mdf)||this.rx?._mdf||this.ry?._mdf||this.rz?._mdf||this.or?._mdf||this.a?._mdf){this.mat?.reset();let t=s-1;for(let e=t;e>=0;e--){let t=this.hierarchy[e]?.finalTransform?.mProp;t?.p&&t.or&&t.rx&&t.ry&&t.rz&&t.s&&t.a&&(this.mat?.translate(-t.p.v[0],-t.p.v[1],t.p.v[2]),this.mat?.rotateX(-t.or.v[0]).rotateY(-t.or.v[1]).rotateZ(t.or.v[2]),this.mat?.rotateX(-t.rx.v).rotateY(-t.ry.v).rotateZ(t.rz.v),this.mat?.scale(1/t.s.v[0],1/t.s.v[1],1/t.s.v[2]),this.mat?.translate(t.a.v[0]??0,t.a.v[1]??0,t.a.v[2]))}if(this.p?this.mat?.translate(-(this.p.v[0]??0),-(this.p.v[1]??0),this.p.v[2]):this.px&&this.py&&this.pz&&this.mat?.translate(-this.px.v,-this.py.v,this.pz.v),this.a){let t=[];this.p?t=[(this.p.v[0]??0)-this.a.v[0],(this.p.v[1]??0)-this.a.v[1],(this.p.v[2]??0)-this.a.v[2]]:this.px&&this.py&&this.pz&&(t=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]]);let e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)),s=[t[0]/e,t[1]/e,t[2]/e],i=Math.sqrt(s[2]*s[2]+s[0]*s[0]),r=Math.atan2(s[1],i),a=Math.atan2(s[0],-s[2]);this.mat?.rotateY(a).rotateX(-r)}this.rx&&this.ry&&this.rz&&this.mat?.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.or&&this.mat?.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat?.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat?.translate(0,0,this.pe?.v);let e=!this._prevMat.equals(this.mat);if((e||this.pe?._mdf)&&this.comp?.threeDElements){let t,s,{length:i}=this.comp.threeDElements;for(let r=0;r<i;r++)if(t=this.comp.threeDElements[r],t?.type==="3d"){if(e){let e=this.mat?.toCSS();s=t.container.style,e&&(s.transform=e)}this.pe?._mdf&&(t.perspectiveElem.style.perspective=`${this.pe.v}px`)}this.mat?.clone(this._prevMat)}}this._isFirstFrame=!1}setup(){let{length:t}=this.comp?.threeDElements??[];for(let e=0;e<t;e++){let t=this.comp?.threeDElements[e];if(t?.type==="3d"){let e=t.perspectiveElem.style,s=t.container.style;e.perspective=`${this.pe?.v}px`,s.transformOrigin="0px 0px 0px",e.transform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"}}}}class s3 extends s${constructor(t,e,s){super(t,e,s);const{addEffects:i,checkBlendMode:r,setMatte:a}=s1.prototype;this.addEffects=i,this.checkBlendMode=r,this.setMatte=a,this.initElement(t,e,s)}addEffects(){throw Error(`${this.constructor.name}: Method addEffects is not implemented`)}checkBlendMode(){throw Error(`${this.constructor.name}: Method checkBlendMode is not implemented`)}createContent(){let t;if(!this.data)throw Error(`${this.constructor.name}: data (LottierLayer) is not implemented`);this.data.hasMask?((t=tc("rect")).setAttribute("width",`${this.data.sw}`),t.setAttribute("height",`${this.data.sh}`),t.setAttribute("fill",`${this.data.sc}`),this.svgElement?.setAttribute("width",`${this.data.sw}`),this.svgElement?.setAttribute("height",`${this.data.sh}`)):((t=ev("div")).style.width=`${this.data.sw}px`,t.style.height=`${this.data.sh}px`,this.data.sc&&(t.style.backgroundColor=this.data.sc)),this.layerElement?.appendChild(t)}}class s5 extends s3{constructor(t,e,s){super(t,e,s),this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s)}createContent(){if(!this.assetData)throw Error(`${this.constructor.name}: assetData is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);let t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data?.hasMask?(this.imageElem=tc("image"),this.imageElem.setAttribute("width",`${this.assetData.w}px`),this.imageElem.setAttribute("height",`${this.assetData.h}px`),this.imageElem.setAttributeNS(L,"href",t),this.layerElement?.appendChild(this.imageElem),this.baseElement?.setAttribute("width",`${this.assetData.w}`),this.baseElement?.setAttribute("height",`${this.assetData.h}`)):this.layerElement?.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data?.ln&&this.baseElement?.setAttribute("id",this.data.ln)}}class s4 extends e9{constructor(t,e,s){super(),this.animatedContents=[],this.currentBBox={h:0,w:0,x:999999,y:-999999},this.prevViewData=[],this.shapeBoundingBox={bottom:0,left:0,right:0,top:0},this.shapesContainer=tc("g"),this.stylesList=[],this.tempBoundingBox={height:0,width:0,x:0,xMax:0,y:0,yMax:0},this.shapes=[],this.shapesData=t.shapes,this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.initElement(t,e,s),this._renderShapeFrame=this.renderInnerContent}_renderShapeFrame(){throw Error(`${this.constructor.name}: Method _renderShapeFrame is not implemented`)}calculateBoundingBox(t,e){let{length:s}=t;for(let i=0;i<s;i++){if(this.calculateShapeBoundingBox(t[i],e),t[i]?.it){this.calculateBoundingBox(t[i]?.it??[],e);continue}t[i]?.style&&t[i]?.w&&this.expandStrokeBoundingBox(t[i]?.w,e)}}calculateF(t,e,s,i,r,a){return Math.pow(1-t,3)*e[a]+3*Math.pow(1-t,2)*t*s[a]+3*(1-t)*Math.pow(t,2)*i[a]+Math.pow(t,3)*r[a]}calculateShapeBoundingBox(t,e){let s,i,r,a,n,o=t.sh.v,{transformers:h}=t,l=o._length;if(!(l<=1)){for(s=0;s<l-1;s++)i=this.getTransformedPoint(h,o.v[s]??[]),r=this.getTransformedPoint(h,o.o[s]??[]),a=this.getTransformedPoint(h,o.i[s+1]??[]),n=this.getTransformedPoint(h,o.v[s+1]??[]),this.checkBounds(i,r,a,n,e);o.c&&(i=this.getTransformedPoint(h,o.v[s]??[]),r=this.getTransformedPoint(h,o.o[s]??[]),a=this.getTransformedPoint(h,o.i[0]??[]),n=this.getTransformedPoint(h,o.v[0]??[]),this.checkBounds(i,r,a,n,e))}}checkBounds(t,e,s,i,r){this.getBoundsOfCurve(t,e,s,i);let a=this.shapeBoundingBox;r.x=Math.min(a.left,r.x),r.xMax=Math.max(a.right,r.xMax),r.y=Math.min(a.top,r.y),r.yMax=Math.max(a.bottom,r.yMax)}createContent(){let t;if(!this.baseElement)throw Error(`${this.constructor.name}: baseElement is not implemented`);if(this.baseElement.style.fontSize="0",this.data?.hasMask)this.layerElement?.appendChild(this.shapesContainer),t=this.svgElement;else{t=tc("svg");let e=this.comp?.data??this.globalData?.compSize;e&&(t.setAttribute("width",`${e.w}`),t.setAttribute("height",`${e.h}`)),t.appendChild(this.shapesContainer),this.layerElement?.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t}currentBoxContains(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height}expandStrokeBoundingBox(t,e){let s=0;if(t.keyframes){for(let e=0;e<t.keyframes.length;e++){let i=t.keyframes[e]?.s;i>s&&(s=i)}s*=t.mult??1}else s=t.v*(t.mult??1);e.x-=s,e.xMax+=s,e.y-=s,e.yMax+=s}filterUniqueShapes(){throw Error(`${this.constructor.name}: Method filterUniqueShapes is not implemented`)}getBoundsOfCurve(t,e,s,i){let r=[[t[0],i[0]],[t[1],i[1]]];for(let a,n,o,h,l,p,m,c=0;c<2;++c)n=6*t[c]-12*e[c]+6*s[c],a=-3*t[c]+9*e[c]-9*s[c]+3*i[c],o=3*e[c]-3*t[c],n|=0,o|=0,0==(a|=0)&&0===n||(0===a?(h=-o/n)>0&&h<1&&r[c]?.push(this.calculateF(h,t,e,s,i,c)):(l=n*n-4*o*a)>=0&&((p=(-n+Math.sqrt(l))/(2*a))>0&&p<1&&r[c]?.push(this.calculateF(p,t,e,s,i,c)),(m=(-n-Math.sqrt(l))/(2*a))>0&&m<1&&r[c]?.push(this.calculateF(m,t,e,s,i,c))));this.shapeBoundingBox.left=Math.min.apply(null,r[0]??[]),this.shapeBoundingBox.top=Math.min.apply(null,r[1]??[]),this.shapeBoundingBox.right=Math.max.apply(null,r[0]??[]),this.shapeBoundingBox.bottom=Math.max.apply(null,r[1]??[])}getTransformedPoint(t,e){let s=e,{length:i}=t;for(let e=0;e<i;e++)s=t[e]?.mProps.v.applyToPointArray(s[0]??0,s[1]??0,0)??[];return s}renderInnerContent(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){if(!this.shapeCont)throw Error(`${this.constructor.name}: shapeCont is not implemented`);let{currentBBox:t,itemsData:e,shapeCont:s,tempBoundingBox:i}=this;if(i.x=999999,i.xMax=-999999,i.y=999999,i.yMax=-999999,this.calculateBoundingBox(e,i),i.width=i.xMax<i.x?0:i.xMax-i.x,i.height=i.yMax<i.y?0:i.yMax-i.y,this.currentBoxContains(i))return;let r=!1;t.w!==i.width&&(t.w=i.width,s.setAttribute("width",`${i.width}`),r=!0),t.h!==i.height&&(t.h=i.height,s.setAttribute("height",`${i.height}`),r=!0),(r||t.x!==i.x||t.y!==i.y)&&(t.w=i.width,t.h=i.height,t.x=i.x,t.y=i.y,s.setAttribute("viewBox",`${t.x} ${t.y} ${t.w} ${t.h}`),s.style.transform=`translate(${t.x}px,${t.y}px)`)}}searchShapes(t,e,s,i,r,a,n){throw Error(`${this.constructor.name}: Method searchShapes is not implemented`)}}class s6 extends sk{constructor(t,e,s){super(),this.currentBBox={h:0,w:0,x:999999,y:-999999},this.isMasked=!1,this.renderedLetters=[],this.textPaths=[],this.textSpans=[],this.renderType=ti.SVG,this.initElement(t,e,s)}buildNewText(){let t=this.textProperty?.currentData;this.renderedLetters=tp(t?.l.length||0);let e=this.innerElem?.style,s=t?.fc?this.buildColor(t.fc):"rgba(0,0,0,0)";e&&(e.fill=s,e.color=s,t?.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=`${t.sw}px`));let i=this.globalData?.fontManager?.getFontByName(t?.f);if(e&&!this.globalData?.fontManager?.chars){if(e.fontSize=`${t?.finalSize||0}px`,e.lineHeight=`${t?.finalSize||0}px`,this.innerElem&&i?.fClass)this.innerElem.className=i.fClass;else if(i&&(e.fontFamily=i.fFamily),t){let{fWeight:s}=t,{fStyle:i}=t;e.fontStyle=i,e.fontWeight=s}}let r=t?.l??[],a,n=null,o=null,h=this.mHelper,l,p,m=0,{length:c}=r;for(let e=0;e<c;e++){if(this.globalData?.fontManager?.chars?(this.textPaths[m]?a=this.textPaths[m]:((a=tc("path")).setAttribute("stroke-linecap",to[1]),a.setAttribute("stroke-linejoin",th[2]),a.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?o=(n=this.textSpans[m]).children[0]:((n=ev("div")).style.lineHeight="0",(o=tc("svg")).appendChild(a),F(n)))):this.isMasked?a=this.textPaths[m]??tc("text"):this.textSpans[m]?(n=this.textSpans[m],a=this.textPaths[m]):(F(n=ev("span")),F(a=ev("span")),n.appendChild(a)),this.globalData?.fontManager?.chars){let s,m=this.globalData.fontManager.getCharData(t?.finalText[e],i?.fStyle,this.globalData.fontManager.getFontByName(t?.f).fFamily);if(s=m?m.data:null,h.reset(),s?.shapes&&s.shapes.length>0&&(l=s.shapes[0]?.it??[],h.scale((t?.finalSize||0)/100,(t?.finalSize||0)/100),p=this.createPathShape(h,l),a.setAttribute("d",p)),this.isMasked)this.innerElem?.appendChild(a);else if(n&&o){if(this.innerElem?.appendChild(n),s?.shapes){document.body.appendChild(o);let t=o.getBBox();o.setAttribute("width",`${t.width+2}`),o.setAttribute("height",`${t.height+2}`),o.setAttribute("viewBox",`${t.x-1} ${t.y-1} ${t.width+2} ${t.height+2}`),o.style.transform=`translate(${t.x-1}px,${t.y-1}px)`,r[e].yOffset=t.y-1}else o.setAttribute("width","1"),o.setAttribute("height","1");n.appendChild(o)}}else(a.textContent=r[e]?.val??null,a.style.whiteSpace="preserve",this.isMasked)?this.innerElem?.appendChild(a):(n&&this.innerElem?.appendChild(n),a.style.transform=`translate3d(0,${-(t?.finalSize||0)/1.2}px,0)`);this.isMasked?this.textSpans[m]=a:this.textSpans[m]=n,this.textSpans[m].style.display="block",this.textPaths[m]=a,m++}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m++}createContent(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType=ti.SVG,this.compW=this.comp?.data?.w,this.compH=this.comp?.data?.h,this.svgElement?.setAttribute("width",`${this.compW}`),this.svgElement?.setAttribute("height",`${this.compH}`);let t=tc("g");this.maskedElement?.appendChild(t),this.innerElem=t}else this.renderType=ti.HTML,this.innerElem=this.layerElement;this.checkParenting()}renderInnerContent(){let t,e,s,i;if(this.validateText(),this.data?.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform?._matMdf){let{v:e}=this.finalTransform.mProp.p??{v:[0,0]};this.svgElement?.setAttribute("viewBox",`${-e[0]} ${-e[1]} ${this.compW} ${this.compH}`),t=this.svgElement?.style;let s=`translate(${-e[0]}px,${-e[1]}px)`;t&&(t.transform=s)}}if(this.textAnimator?.getMeasures(this.textProperty?.currentData,this.lettersChangedFlag),!this.lettersChangedFlag&&!this.textAnimator?.lettersChangedFlag)return;let r=0,a=this.textAnimator?.renderedLetters??[],n=this.textProperty?.currentData.l??[],{length:o}=n;for(let t=0;t<o;t++){if(n[t]?.n){r++;continue}s=this.textSpans[t],i=this.textPaths[t],e=a[r],r++,e?._mdf.m&&(this.isMasked?s.setAttribute("transform",e.m):s.style.transform=e.m),s.style.opacity=`${e?.o??1}`,e?.sw&&e._mdf.sw&&i.setAttribute("stroke-width",`${e.sw}`),e?.sc&&e._mdf.sc&&i.setAttribute("stroke",e.sc),e?.fc&&e._mdf.fc&&(i.setAttribute("fill",e.fc),i.style.color=e.fc)}if(this.innerElem?.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){let e=this.innerElem.getBBox();if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.svgElement?.setAttribute("width",`${e.width}`)),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.svgElement?.setAttribute("height",`${e.height}`)),(this.currentBBox.w!==e.width+2||this.currentBBox.h!==e.height+2||this.currentBBox.x!==e.x-1||this.currentBBox.y!==e.y-1)&&(this.currentBBox.w=e.width+2,this.currentBBox.h=e.height+2,this.currentBBox.x=e.x-1,this.currentBBox.y=e.y-1,this.svgElement?.setAttribute("viewBox",`${this.currentBBox.x} ${this.currentBBox.y} ${this.currentBBox.w} ${this.currentBBox.h}`),this.svgElement)){t=this.svgElement.style;let e=`translate(${this.currentBBox.x}px,${this.currentBBox.y}px)`;t.transform=e}}}}class s8 extends sF{constructor(t,e){super(),this.destroyed=!1,this.rendererType=ti.HTML,this.supports3d=!0,this.animationItem=t,this.layers=null,this.renderConfig={className:e?.className||"",filterSize:{height:e?.filterSize?.height||"400%",width:e?.filterSize?.width||"400%",x:e?.filterSize?.x||"-100%",y:e?.filterSize?.y||"-100%"},hideOnTransparent:e?.hideOnTransparent!==!1,imagePreserveAspectRatio:e?.imagePreserveAspectRatio||"xMidYMid slice"},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.camera=null;const{buildItem:s,createNull:i,renderFrame:r}=sR.prototype;this.buildItem=s,this.createNull=i,this.renderFrame=r}addTo3dContainer(t,e){let s=0,{length:i}=this.threeDElements;for(;s<i;){if(e<=this.threeDElements[s].endPos){let i=this.threeDElements[s].startPos,r;for(;i<e;)r=this.elements[i]?.getBaseElement(),i++;r?this.threeDElements[s].container.insertBefore(t,r):this.threeDElements[s].container.appendChild(t);break}s++}}appendElementInPos(t,e){let s=t.getBaseElement();if(!s)return;let i=this.layers[e];if(i.ddd&&this.supports3d)this.addTo3dContainer(s,e);else if(this.threeDElements.length>0)this.addTo3dContainer(s,e);else{let t=0,r,a;for(;t<e;)!0!==this.elements[t]&&this.elements[t]?.getBaseElement&&(a=this.elements[t],r=(this.layers[t].ddd?this.getThreeDContainerByPos(t):a.getBaseElement())??r),t++;r?i.ddd&&this.supports3d||this.layerElement?.insertBefore(s,r):i.ddd&&this.supports3d||this.layerElement?.appendChild(s)}}build3dContainers(){let t,{length:e}=this.layers,s="";for(let i=0;i<e;i++)if(this.layers[i].ddd&&3!==this.layers[i].ty){if("3d"!==s&&(s="3d",t=this.createThreeDContainer(i,"3d")),!t)continue;t.endPos=Math.max(t.endPos,i)}else{if("2d"!==s&&(s="2d",t=this.createThreeDContainer(i,"2d")),!t)continue;t.endPos=Math.max(t.endPos,i)}let{length:i}=this.threeDElements;for(let t=i-1;t>=0;t--)this.resizerElem?.appendChild(this.threeDElements[t].perspectiveElem)}checkPendingElements(){for(;this.pendingElements.length>0;){let t=this.pendingElements.pop();t?.checkParenting()}}configAnimation(t){if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);let e=ev("div"),{wrapper:s}=this.animationItem,{classList:i,style:r}=e;r.width=`${t.w}px`,r.height=`${t.h}px`,this.resizerElem=e,F(e),r.transformStyle="flat",this.renderConfig.className&&i.add(this.renderConfig.className),s?.appendChild(e),r.overflow="hidden";let a=tc("svg");a.setAttribute("width","1"),a.setAttribute("height","1"),F(a),this.resizerElem.appendChild(a);let n=tc("defs");a.appendChild(n),this.data=t,this.setupGlobalData(t,a),this.globalData.defs=n,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()}createCamera(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.camera=new s2(t,this.globalData,this),this.camera}createImage(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.supports3d?new s5(t,this.globalData,this):new eR(t,this.globalData,this)}createShape(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.supports3d?new s4(t,this.globalData,this):new ss(t,this.globalData,this)}createSolid(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.supports3d?new s3(t,this.globalData,this):new s$(t,this.globalData,this)}createText(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.supports3d?new s6(t,this.globalData,this):new sN(t,this.globalData,this)}createThreeDContainer(t,e){let s,i=ev("div");F(i);let r=ev("div");F(r),"3d"===e&&((s=i.style).width=`${this.globalData?.compSize?.w}px`,s.height=`${this.globalData?.compSize?.h}px`,s.transformOrigin="50% 50%",r.style.transform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),i.appendChild(r);let a={container:r,endPos:t,perspectiveElem:i,startPos:t,type:e};return this.threeDElements.push(a),a}destroy(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;let{length:t}=this.layers;for(let e=0;e<t;e++)this.elements[e]?.destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null}getThreeDContainerByPos(t){let e=0,{length:s}=this.threeDElements;for(;e<s;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e++}return null}hide(){if(!this.resizerElem)throw Error(`${this.constructor.name}: resizerElem is not implemented`);this.resizerElem.style.display="none"}initItems(){if(this.buildAllItems(),this.camera)this.camera.setup();else{if(!this.globalData?.compSize)throw Error(`${this.constructor.name}: globalData->compSize is not implemented`);let t=this.globalData.compSize.w,e=this.globalData.compSize.h,{length:s}=this.threeDElements;for(let i=0;i<s;i++){let{style:s}=this.threeDElements[i].perspectiveElem;s.perspective=`${Math.sqrt(Math.pow(t,2)+Math.pow(e,2))}px`}}}renderFrame(t){throw Error(`${this.constructor.name}: Method renderFrame is not implemented`)}searchExtraCompositions(t){if(!this.globalData?.comp)throw Error(`${this.constructor.name}: globalData->comp is not implemented`);let{length:e}=t,s=ev("div");for(let i=0;i<e;i++)if(t[i].xt){let e=this.createComp(t[i],s,this.globalData.comp,null);e.initExpressions(),this.globalData.projectInterface.registerComposition(e)}}show(){if(!this.resizerElem)throw Error(`${this.constructor.name}: resizerElem is not implemented`);this.resizerElem.style.display="block"}updateContainerSize(){let t,e,s,i;if(!this.globalData?.compSize)throw Error(`${this.constructor.name}: compSize is not implemented in globalData`);if(!this.animationItem?.wrapper)throw Error(`${this.constructor.name}: wrapper is not implemented in animationItem`);let r=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight;if(this.globalData.compSize.w/this.globalData.compSize.h>r/a?(t=r/this.globalData.compSize.w,e=r/this.globalData.compSize.w,s=0,i=(a-this.globalData.compSize.h*(r/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,s=(r-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,i=0),this.resizerElem){let{style:r}=this.resizerElem;r.transform=`matrix3d(${t},0,0,0,0,${e},0,0,0,0,1,0,${s},${i},0,1)`}}}class s9 extends eD{constructor(t,e,s){super(),this.threeDElements=[],this.transformedElement=null,this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=tp(this.layers.length);const{appendElementInPos:i,build3dContainers:r,checkPendingElements:a,configAnimation:n,createCamera:o,createImage:h,createShape:l,createSolid:p,createText:m,createThreeDContainer:c,getThreeDContainerByPos:d,initItems:u,searchExtraCompositions:f,updateContainerSize:g}=s8.prototype,{addEffects:y,checkBlendMode:b,createRenderableComponents:v,destroy:_,initRendererElement:x,renderElement:w,renderFrame:E,setMatte:C}=s1.prototype;this.addEffects=y,this.appendElementInPos=i,this.build3dContainers=r,this.checkBlendMode=b,this.checkPendingElements=a,this.configAnimation=n,this.createCamera=o,this.createImage=h,this.createRenderableComponents=v,this.createShape=l,this.createSolid=p,this.createText=m,this.createThreeDContainer=c,this.destroy=_,this.getThreeDContainerByPos=d,this.initItems=u,this.initRendererElement=x,this.renderElement=w,this.renderFrame=E,this.searchExtraCompositions=f,this.setMatte=C,this.updateContainerSize=g,this.initElement(t,e,s),this.tm=t.tm?tZ.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this._createBaseContainerElements=this.createContainerElements}_createBaseContainerElements(){throw Error(`${this.constructor.name}: Method _createBaseContainerElements is not implemented`)}addEffects(){throw Error(`${this.constructor.name}: Method addEffects is not implemented`)}addTo3dContainer(t,e){let s=0,i;for(;s<e;)i=this.elements[s]?.getBaseElement(),s++;i?this.layerElement?.insertBefore(t,i):this.layerElement?.appendChild(t)}appendElementInPos(t,e){throw Error(`${this.constructor.name}: Method appendElementInPos is not implemented`)}build3dContainers(){throw Error(`${this.constructor.name}: Method build3dContainers is not implemented`)}buildElementParenting(t,e,s=[]){throw Error(`${this.constructor.name}: Method buildElementParenting is not implemented`)}checkBlendMode(){throw Error(`${this.constructor.name}: Method checkBlendMode is not implemented`)}checkPendingElements(){throw Error(`${this.constructor.name}: Method checkPendingElements is not implemented`)}configAnimation(t){throw Error(`${this.constructor.name}: Method configAnimation is not implemented`)}createCamera(t){throw Error(`${this.constructor.name}: Method createCamera is not implemented`)}createComp(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.supports3d?new s9(t,this.globalData,this):new sV(t,this.globalData,this)}createContainerElements(){this._createBaseContainerElements(),this.data?.hasMask?(this.svgElement?.setAttribute("width",`${this.data.w}`),this.svgElement?.setAttribute("height",`${this.data.h}`),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement}createImage(t){throw Error(`${this.constructor.name}: Method createImage is not implemented`)}createShape(t){throw Error(`${this.constructor.name}: Method createShape is not implemented`)}createSolid(t){throw Error(`${this.constructor.name}: Method createSolid is not implemented`)}createText(t){throw Error(`${this.constructor.name}: Method createText is not implemented`)}createThreeDContainer(t,e){throw Error(`${this.constructor.name}: Method createThreeDContainer is not implemented`)}getElementById(t){throw Error("Method is not implemented")}getThreeDContainerByPos(t){throw Error(`${this.constructor.name}: Method getThreeDContainerByPos is not implemented`)}initItems(){throw Error(`${this.constructor.name}: Method initItems is not implemented`)}searchExtraCompositions(t){throw Error(`${this.constructor.name}: Method searchExtraCompositions is not implemented`)}setMatte(){throw Error(`${this.constructor.name}: Method setMatte is not implemented`)}updateContainerSize(){throw Error(`${this.constructor.name}: Method updateContainerSize is not implemented`)}}class s7 extends s8{createComp(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);return this.supports3d?new s9(t,this.globalData,this):new sV(t,this.globalData,this)}}class it{constructor(t){this.audios=[],this._isMuted=!1,this._volume=1,this.audioFactory=t}addAudio(t){this.audios.push(t)}createAudio(t){return this.audioFactory?this.audioFactory(t):!B&&"Howl"in window?new window.Howl({src:[t]}):{isPlaying:!1,play:()=>{this.isPlaying=!0},playing:()=>{throw Error(`${this.constructor.name}: Method playing is not implemented`)},rate:()=>{throw Error(`${this.constructor.name}: Method rate is not implemented`)},seek:()=>{this.isPlaying=!1},setVolume:()=>{throw Error(`${this.constructor.name}: Method setVolume is not implemented`)}}}getVolume(){return this._volume}mute(){this._isMuted=!0,this._updateVolume()}pause(){for(let t of this.audios)t.pause()}resume(){for(let t of this.audios)t.resume()}setAudioFactory(t){this.audioFactory=t}setRate(t){for(let e of this.audios)e.setRate(t)}setVolume(t){this._volume=t,this._updateVolume()}unmute(){this._isMuted=!1,this._updateVolume()}_updateVolume(){let{length:t}=this.audios;for(let e=0;e<t;e++)this.audios[e]?.volume(!this._isMuted*this._volume)}}function ie(t,e,s,i){let r,a=new XMLHttpRequest;try{a.responseType="json"}catch(t){}a.onreadystatechange=()=>{if(4===a.readyState){if(200===a.status)return void s(r=is(a));try{r=is(a),s(r)}catch(t){i?.(t)}}};try{a.open("GET",t,!0)}catch(s){a.open("GET",`${e}/${t}`,!0)}a.send()}function is(t){let e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&e.includes("json")||t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function ii(t,e){let s,{length:i}=t;for(let a=0;a<i;a++)if("ks"in(s=t[a])&&!s.completed){if(s.completed=!0,s.hasMask){let t=s.masksProperties,{length:e}=t??[];for(let s=0;s<e;s++){let e=t?.[s]?.pt?.k;if(!e)continue;if(!k(e)){io(e);continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t]?.e??[],i=e[t]?.s??[];s.length>0&&io(s[0]),i.length>0&&io(i[0])}}}switch(s.ty){case 0:s.layers=ir(s.refId,e),ii(s.layers,e);break;case 4:ia(s.shapes);break;case 5:var r;r=s,r.t?.a?.length===0&&r.t.p}}}function ir(t,e){if(!t||!e)return;let s=function(t,e){let s=0,{length:i}=e;for(;s<i;){if(e[s]?.id===t)return e[s];s++}return null}(t,e);return s?.layers?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function ia(t=[]){let{length:e}=t;for(let s=e-1;s>=0;s--){if(t[s]?.ty===tr.Group){ia(t[s]?.it);continue}if(t[s]?.ty===tr.Path){let e=t[s]?.ks?.k;if(!k(e)){io(e);continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t]?.e,i=e[t]?.s;s&&io(s[0]),i&&io(i[0])}}}}function io(t){if(!t)return;let{length:e}=t.i;for(let s=0;s<e;s++)t.i[s][0]+=t.v[s]?.[0]??0,t.i[s][1]+=t.v[s]?.[1]??0,t.o[s][0]+=t.v[s]?.[0]??0,t.o[s][1]+=t.v[s]?.[1]??0}function ih(t,e){let s=e?e.split(".").map(Number):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&null))}let il=(t,e,s)=>{let{length:i}=t;for(let r=0;r<i;r++)t[r]?.ty===s&&e(t[r])},ip=(r=[4,4,14],a=t=>{let e=t.t?.d;t.t&&e&&(t.t.d={k:[{s:e,t:0}]})},t=>{if(!ih(r,t.v))return;il(t.layers,a,5);let{length:e}=t.assets;for(let s=0;s<e;s++)t.assets[s]?.layers&&il(t.assets[s]?.layers,a,5)}),im=(n=[4,7,99],t=>{if(!t.chars||ih(n,t.v))return;let{length:e}=t.chars;for(let s=0;s<e;s++){let e=t.chars[s];e?.data?.shapes&&(ia(e.data.shapes),e.data.ip=0,e.data.op=99999,e.data.st=0,e.data.sr=1,e.data.ks={a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]}},t.chars[s]?.t||(e.data.shapes.push({ty:tr.NoStyle}),e.data.shapes[0]?.it?.push({a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sa:{a:0,k:0},sk:{a:0,k:0},ty:tr.Transform})))}}),ic=(o=[5,7,15],h=t=>{let e=t.t?.p;e&&("number"==typeof e.a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r&&(e.r={a:0,k:e.r}))},t=>{if(!ih(o,t.v))return;il(t.layers,h,5);let{length:e}=t.assets;for(let s=0;s<e;s++)t.assets[s]?.layers&&il(t.assets[s]?.layers,h,5)}),id=(l=[4,1,9],p=t=>{let{length:e}=t;for(let s=0;s<e;s++){if(t[s]?.ty===tr.Group){p(t[s]?.it??[]);continue}if(t[s]?.ty!==tr.Fill&&t[s]?.ty!==tr.Stroke)continue;let e=t[s]?.c?.k;if(!e||"number"==typeof e)continue;if(M(e)&&e.length>=4){e[0]/=255,e[1]/=255,e[2]/=255,e[3]/=255;continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t];s.s[0]/=255,s.s[1]/=255,s.s[2]/=255,s.s[3]/=255,s.e[0]/=255,s.e[1]/=255,s.e[2]/=255,s.e[3]/=255}}},m=t=>{let{length:e}=t;for(let s=0;s<e;s++)t[s]?.ty===4&&p(t[s]?.shapes??[])},t=>{if(!ih(l,t.v))return;m(t.layers);let{length:e}=t.assets;for(let s=0;s<e;s++)t.assets[s]?.layers&&m(t.assets[s]?.layers)}),iu=(c=[4,4,18],d=t=>{let{length:e}=t;for(let s=e-1;s>=0;s--){if(t[s]?.ty===tr.Group){d(t[s]?.it??[]);continue}if(t[s]?.ty!==tr.Path)continue;let e=t[s]?.ks?.k;if(!e)continue;let i=!!t[s]?.closed;if(!k(e)){e.c=i;continue}let{length:r}=e;for(let t=0;t<r;t+=1){let s=e[t]?.e??[],r=e[t]?.s??[];s.length>0&&(s[0].c=i),r.length>0&&(r[0].c=i)}}},u=t=>{let e,{length:s}=t;for(let i=0;i<s;i++){if(e=t[i],e?.hasMask){let t=e.masksProperties,{length:s}=t??[];for(let e=0;e<s;e++){let s=t?.[e]?.pt?.k;if(!s)continue;let i=!!t[e]?.cl;if(!k(s)){s.c=i;continue}let{length:r}=s;for(let t=0;t<r;t++){let e=s[t]?.e??[],r=s[t]?.s??[];e.length>0&&(e[0].c=i),r.length>0&&(r[0].c=i)}}}e?.ty===4&&d(e.shapes)}},t=>{if(!ih(c,t.v))return;u(t.layers);let{length:e}=t.assets;for(let s=0;s<e;s++)t.assets[s]?.layers&&u(t.assets[s]?.layers)}),ig={checkChars:im,checkColors:id,checkPathProperties:ic,checkShapes:iu,completeData:function(t){t.__complete||(id(t),ip(t),im(t),ic(t),iu(t),ii(t.layers,t.assets),function(t,e){if(!t)return;let{length:s}=t;for(let i=0;i<s;i++){if(t[i]?.t!==1)continue;let{data:s}=t[i]??{};s&&(s.layers=ir(s.refId,e)),ii(t[i]?.data?.layers??[],e)}}(t.chars,t.assets),t.__complete=!0)},completeLayers:ii},iy={current:!1},ib=1,iv,i_="Function not implemented.",ix={addEventListener:(t,e,s)=>{throw Error(i_)},dispatchEvent:t=>{throw Error(i_)},onerror:null,onmessage:t=>{throw Error("workerProxy: Method onmessage not implemented")},onmessageerror:null,postMessage:t=>{iv({data:t})},removeEventListener:(t,e,s)=>{throw Error(i_)},terminate:()=>{throw Error(i_)}},iw={postMessage:t=>{ix.onmessage&&ix.onmessage({AT_TARGET:2,bubbles:!1,BUBBLING_PHASE:3,cancelable:!1,cancelBubble:!1,CAPTURING_PHASE:1,composed:!1,composedPath:()=>{throw Error(i_)},currentTarget:null,data:t,defaultPrevented:!1,eventPhase:0,initEvent:(t,e,s)=>{throw Error(i_)},initMessageEvent:(t,e,s,i,r,a,n,o)=>{throw Error(i_)},isTrusted:!1,lastEventId:"",NONE:0,origin:"",ports:[],preventDefault:()=>{throw Error(i_)},returnValue:!1,source:null,srcElement:null,stopImmediatePropagation:()=>{throw Error(i_)},stopPropagation:()=>{throw Error(i_)},target:null,timeStamp:0,type:""})}},iE={};function iC(){e||((e=function(t){if(!B&&iy.current){let e=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"});return new Worker(URL.createObjectURL(e))}return iv=t,ix}(t=>{if(iw.dataManager=iw.dataManager??ig,"loadAnimation"===t.data.type)return void ie(t.data.path,t.data.fullPath,e=>{e&&ig.completeData(e),iw.postMessage({id:t.data.id,payload:e,status:"success"})},()=>{iw.postMessage({id:t.data.id,status:"error"})});if("complete"===t.data.type){let{animation:e,id:s}=t.data;ig.completeData(e),iw.postMessage({id:s,payload:e,status:"success"});return}"loadData"===t.data.type&&ie(t.data.path,t.data.fullPath,e=>{iw.postMessage({id:t.data.id,payload:e,status:"success"})},()=>{iw.postMessage({id:t.data.id,status:"error"})})})).onmessage=({data:t})=>{let{id:e,payload:s,status:i}=t,r=iE[e];(iE[e]=null,"success"===i)?r?.onComplete(s):r?.onError&&r.onError()})}function iS(t,e){ib++;let s=`processId_${ib}`;try{return iE[s]={onComplete:t,onError:e},s}catch(t){throw console.error("DataManager}:\n",t),Error("Could not create animation proccess")}}function ik(t,s,i){iC();let r=iS(s,i);e?.postMessage({fullPath:B?t:window.location.origin+window.location.pathname,id:r,path:t,type:"loadData"})}function iM(t,s,i){iC();let r=iS(s,i);e?.postMessage({animation:t,id:r,type:"complete"})}class iP{getComposition(t){let e=0,{length:s}=this.compositions;for(;e<s;){if(this.compositions[e]?.data&&this.compositions[e]?.data?.nm===t)return this.compositions[e]?.data?.xt&&this.compositions[e]?.prepareFrame(this.currentFrame),this.compositions[e]?.compInterface;e++}return null}registerComposition(t){this.compositions.push(t)}constructor(){this.compositions=[],this.currentFrame=0}}let iA={current:!0};class iD{constructor(){this.assetsPath="",this.images=[],this.imagesLoadedCb=null,this.loadedAssets=0,this.loadedFootagesCount=0,this.path="",this.totalFootages=0,this.totalImages=0,this._imageLoaded=this.imageLoaded.bind(this),this._footageLoaded=this.footageLoaded.bind(this),this.testImageLoaded=this.testImageLoaded.bind(this),this.createFootageData=this.createFootageData.bind(this),this.proxyImage=this._createProxyImage()}createFootageData(t){let e={assetData:t,img:null};return ik(this.getAssetsPath(t,this.assetsPath,this.path),t=>{t&&(e.img=t),this._footageLoaded()},()=>{this._footageLoaded()}),e}createImageData(t){let e=this.getAssetsPath(t,this.assetsPath,this.path),s=tc("image"),i={assetData:t,img:s};return R?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",()=>{this.proxyImage&&(i.img=this.proxyImage),this._imageLoaded()},!1),s.setAttributeNS(L,"href",e),this._elementHelper?.append?this._elementHelper.append(s):this._elementHelper?.appendChild(s),i}destroy(){this.imagesLoadedCb=null,this.cleanupElementHelper(),this.images.length=0}footageLoaded(){this.loadedFootagesCount++,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&(this.cleanupElementHelper(),this.imagesLoadedCb(null))}getAsset(t){let e=0,{length:s}=this.images;for(;e<s;){if(this.images[e]?.assetData===t)return this.images[e]?.img??null;e++}return null}imageLoaded(){this.loadedAssets++,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&(this.cleanupElementHelper(),this.imagesLoadedCb(null))}loadAssets(t,e){this.imagesLoadedCb=e;let{length:s}=t;for(let e=0;e<s;e++)if(!t[e]?.layers){if((!t[e]?.t||t[e]?.t==="seq")&&this._createImageData){this.totalImages++;let s=this._createImageData(t[e]);s&&this.images.push(s);continue}3===Number(t[e]?.t)&&(this.totalFootages++,this.images.push(this.createFootageData(t[e])))}}loadedFootages(){return this.totalFootages===this.loadedFootagesCount}loadedImages(){return this.totalImages===this.loadedAssets}setAssetsPath(t){this.assetsPath=t||""}setCacheType(t,e){t===ti.SVG?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}setPath(t){this.path=t||""}_createProxyImage(){if(B)return null;let t=ev(ti.Canvas);t.width=1,t.height=1;let e=t.getContext("2d");return e&&(e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1)),t}cleanupElementHelper(){let t=this._elementHelper;if(t)for(let e=0;e<this.images.length;e++){let s=this.images[e]?.img;s&&"u">typeof SVGImageElement&&s instanceof SVGImageElement&&s.parentNode===t&&t.removeChild(s)}}createImgData(t){let e=this.getAssetsPath(t,this.assetsPath,this.path),s=ev("img"),i={assetData:t,img:s};return s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",()=>{this.proxyImage&&(i.img=this.proxyImage),this._imageLoaded()},!1),s.src=e,i}getAssetsPath(t,e,s){if(t.e)return t.p||"";if(e){let s=t.p;return s?.indexOf("images/")!==-1&&(s=s?.split("/")[1]),`${e}${s||""}`}let i=s;return i+=t.u??"",i+=t.p??""}testImageLoaded(t){if(B)return;let e=0,s=setInterval(()=>{(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(s)),e++},50)}}let iT=t=>{let e=t.split("\r\n"),s={},{length:i}=e,r=0;for(let t=0;t<i;t++){let i=e[t]?.split(":")??[];if(2===i.length){let[t,e]=i;if(!t||!e)continue;s[t]=e.trim(),r++}}if(0===r)throw Error("Could not parse markers");return s};class iF extends sQ{constructor(){super(),this._isFirstFrame=!1,this.animationData={},this.animationID=v(),this.assets=[],this.assetsPath="",this.audioController=new it(void 0),this.autoplay=!1,this.currentFrame=0,this.currentRawFrame=0,this.drawnFrameEvent=new sY(te.DrawnFrame,0,1,0),this.enterFrameEvent=new sH(te.EnterFrame,0,0,1),this.enterFrameLegacyEvent=new sH(te.EnterFrame,0,0,1),this.expressionsPlugin=eh.plugin,this.firstFrame=0,this.frameModifier=1,this.frameMult=0,this.frameRate=60,this.imagePreloader=new iD,this.isLoaded=!1,this.isPaused=!0,this.isSubframeEnabled=iA.current,this.loop=!0,this.markers=[],this.name="",this.path="",this.playCount=0,this.playDirection=1,this.playSpeed=1,this.projectInterface=new iP,this.renderer=null,this.segmentPos=0,this.segments=[],this.timeCompleted=0,this.totalFrames=0,this.wrapper=null,this.autoloadSegments=!1,this.onComplete=null,this.onDestroy=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onSegmentStart=null,this._completedLoop=!1,this._idle=!0,this._cbs={},this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this)}adjustSegment(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger(te.SegmentStart)}advanceTime(t){if(this.isPaused||!this.isLoaded)return;let e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount++,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger(te.LoopComplete))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&!0!==this.loop)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger(te.LoopComplete):this._completedLoop=!0):(s=!0,e=0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger(te.Complete))}checkLoaded(){if(this.isLoaded||!this.renderer.globalData?.fontManager?.isLoaded||!this.imagePreloader.loadedImages()&&this.renderer.rendererType===ti.Canvas||!this.imagePreloader.loadedFootages())return;this.isLoaded=!0;let t=eh.plugin;t?.initExpressions(this),this.renderer.initItems(),setTimeout(()=>{this.trigger(te.DOMLoaded)},0),this.gotoFrame(),this.autoplay&&this.play()}checkSegments(t){return this.segments.length>0&&(this.adjustSegment(this.segments.shift()??[0,0],t),!0)}configAnimation(t){try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor((this.animationData.op||1)-(this.animationData.ip||0)),this.firstFrame=Math.round(this.animationData.ip||0)),this.renderer.configAnimation(t),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,void 0!==this.animationData.fr&&(this.frameMult=this.animationData.fr/1e3),this.renderer.searchExtraCompositions(t.assets),this.markers=function(t){let e=[],{length:s}=t;for(let i=0;i<s;i++){if("duration"in(t[i]??{})){e.push(t[i]);continue}let s={duration:t[i].dr,time:t[i].tm};try{s.payload=JSON.parse(t[i].cm)}catch(e){try{s.payload=iT(t[i].cm)}catch(e){s.payload={name:t[i].cm}}}e.push(s)}return e}(t.markers??[]),this.trigger(te.ConfigReady),this.preloadImages(),this.loadSegments(),this.updateFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}}destroy(t){t&&this.name!==t||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger(te.Destroy),this._cbs={},this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)}getAssetData(t){let e=0,{length:s}=this.assets;for(;e<s;){if(t===this.assets[e]?.id)return this.assets[e];e++}return null}getAssetsPath(t){let e;if(!t)return"";if(t.e)e=t.p||"";else if(this.assetsPath){let s=t.p;["i/","images/"].some(t=>s?.includes(t))&&(s=s?.split("/")[1]),e=this.assetsPath+(s||"")}else e=this.path+(t.u??"")+(t.p??"");return e}getDuration(t){return t?this.totalFrames:this.totalFrames/this.frameRate}getMarkerData(t){for(let e=0;e<this.markers.length;e++)if(this.markers[e]?.payload?.name===t)return this.markers[e];return null}getPath(){return this.path}getVolume(){return this.audioController.getVolume()}goToAndPlay(t,e,s){if(!s||this.name===s){if(isNaN(t)){let e=this.getMarkerData(t);e&&(e.duration?this.playSegments([e.time,e.time+e.duration],!0):this.goToAndStop(e.time,!0))}else this.goToAndStop(t,e,s);this.play()}}goToAndStop(t,e,s){if(!s||this.name===s){if(isNaN(t)){let e=this.getMarkerData(t);e&&this.goToAndStop(e.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}}gotoFrame(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(te.EnterFrame),this.renderFrame(),this.trigger(te.DrawnFrame)}hide(){this.renderer.hide()}imagesLoaded(){this.trigger(te.LoadedImages),this.checkLoaded()}includeLayers(t){this.animationData.op&&t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-(this.animationData.ip||0)));let{assets:e,layers:s}=this.animationData,i,{length:r}=s,a=t.layers,{length:n}=a;for(let t=0;t<n;t++)for(i=0;i<r;){if(s[i]?.id===a[t]?.id){s[i]=a[t];break}i++}for((t.chars||t.fonts)&&(this.renderer.globalData?.fontManager?.addChars(t.chars),this.renderer.globalData?.fontManager?.addFonts(t.fonts,this.renderer.globalData.defs)),r=t.assets.length,i=0;i<r;i++)e.push(t.assets[i]);this.animationData.__complete=!1,iM(this.animationData,this.onSegmentComplete)}loadNextSegment(){let{segments:t}=this.animationData;if(!t||0===t.length||!this.autoloadSegments){this.trigger(te.DataReady),this.timeCompleted=this.totalFrames;return}let e=t.shift();this.timeCompleted=Number(e?.time)*this.frameRate;let s=`${this.path+(this.fileName||"")}_${this.segmentPos}.json`;this.segmentPos++,ik(s,this.includeLayers.bind(this),()=>{this.trigger(te.DataFailed)})}loadSegments(){let{segments:t}=this.animationData;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment()}mute(t){t&&this.name!==t||this.audioController.mute()}onSegmentComplete(t){this.animationData=t;let e=eh.plugin;e?.initExpressions(this),this.loadNextSegment()}onSetupError(){this.trigger(te.DataFailed)}pause(t){(!t||this.name===t)&&(this.isPaused||(this.isPaused=!0,this.trigger(te.Pause),this._idle=!0,this.trigger(te.Idle),this.audioController.pause()))}play(t){t&&this.name!==t||(this.isPaused&&(this.isPaused=!1,this.trigger(te.Play),this.audioController.resume(),this._idle&&(this._idle=!1)),this.trigger(te.Active))}playSegments(t,e){if(e&&(this.segments.length=0),k(t[0])){let{length:e}=t;for(let s=0;s<e;s++)this.segments.push(t[s])}else this.segments.push(t);this.segments.length>0&&e&&this.adjustSegment(this.segments.shift()??[0,0],0),this.isPaused&&this.play()}preloadImages(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))}renderFrame(t){if(!this.isLoaded)return;let e=t??this.currentFrame+this.firstFrame;try{this.expressionsPlugin?.resetFrame(),this.renderer.renderFrame(e)}catch(t){this.triggerRenderFrameError(t)}}resetSegments(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)}resize(t,e){this.renderer.updateContainerSize("number"==typeof t?t:void 0,"number"==typeof e?e:void 0)}setCurrentRawFrameValue(t){this.currentRawFrame=t,this.gotoFrame()}setData(t,e){try{let s=e;s&&"object"!=typeof s&&(s=JSON.parse(s));let i={animationData:s,wrapper:t},{attributes:r}=t;i.path=r.getNamedItem("data-animation-path")?.value??r.getNamedItem("data-bm-path")?.value??r.getNamedItem("bm-path")?.value??"";let a=r.getNamedItem("data-anim-type")?.value??r.getNamedItem("data-bm-type")?.value??r.getNamedItem("bm-type")?.value??r.getNamedItem("data-bm-renderer")?.value??r.getNamedItem("bm-renderer")?.value??(()=>{if(s0.canvas)return ti.Canvas;let t=Object.keys(s0),{length:e}=t;for(let s=0;s<e;s++)if(s0[t[s]])return t[s];return ti.SVG})();Object.values(ti).includes(a)?i.animType=a:i.animType=ti.Canvas;let n=r.getNamedItem("data-anim-loop")?.value??r.getNamedItem("data-bm-loop")?.value??r.getNamedItem("bm-loop")?.value??"";"false"===n?i.loop=!1:"true"===n?i.loop=!0:""!==n&&(i.loop=parseInt(n,10));let o=r.getNamedItem("data-anim-autoplay")?.value??r.getNamedItem("data-bm-autoplay")?.value??r.getNamedItem("bm-autoplay")?.value??!0;i.autoplay="false"!==o,i.name=r.getNamedItem("data-name")?.value??r.getNamedItem("data-bm-name")?.value??r.getNamedItem("bm-name")?.value??"";let h=r.getNamedItem("data-anim-prerender")?.value??r.getNamedItem("data-bm-prerender")?.value??r.getNamedItem("bm-prerender")?.value??"";"false"===h&&(i.prerender=!1),i.path?this.setParams(i):this.trigger(te.Destroy)}catch(t){throw console.error(`${this.constructor.name}:
|
|
3
3
|
`,t),Error(`${this.constructor.name}: Could not set data`)}}setDirection(t,e){e&&this.name!==e||(this.playDirection=t<0?-1:1,this.updateFrameModifier())}setLoop(t){this.loop=t}setParams(t){try{var s,i,r;let a;(t.wrapper||t.container)&&(this.wrapper=t.wrapper??t.container??null);let n=ti.SVG;switch(t.animType?n=t.animType:t.renderer&&(n=t.renderer),n){case ti.SVG:this.renderer=new sR(this,t.rendererSettings);break;case ti.Canvas:this.renderer=new sj(this,t.rendererSettings);break;case ti.HTML:this.renderer=new s7(this,t.rendererSettings);break;default:throw Error(`Unknown renderer type: ${n}`)}if(this.imagePreloader.setCacheType(n,this.renderer.globalData?.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=n,["",null,void 0,!0,1].includes(t.loop)?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(`${t.loop}`,10),this.autoplay=!("autoplay"in t)||!!t.autoplay,this.name=t.name??"",this.autoloadSegments=!!(!Object.hasOwn(t,"autoloadSegments")||t.autoloadSegments),this.assetsPath=t.assetsPath??this.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData)return void this.setupAnimation(t.animationData);if(!t.path)return;t.path.includes("\\")?this.path=t.path.slice(0,Math.max(0,t.path.lastIndexOf("\\")+1)):this.path=t.path.slice(0,Math.max(0,t.path.lastIndexOf("/")+1)),this.fileName=t.path.slice(Math.max(0,t.path.lastIndexOf("/")+1)),this.fileName=this.fileName.slice(0,Math.max(0,this.fileName.lastIndexOf(".json"))),s=t.path,i=this.configAnimation,r=this.onSetupError,iC(),a=iS(i,r),e?.postMessage({fullPath:B?s:window.location.origin+window.location.pathname,id:a,path:s,type:"loadAnimation"})}catch(t){throw console.error(`${this.constructor.name}:
|
|
4
4
|
`,t),Error(`${this.constructor.name}: Could not set params`)}}setSegment(t,e){let s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==s&&this.goToAndStop(s,!0)}setSpeed(t,e){e&&this.name!==e||(this.playSpeed=t,this.updateFrameModifier())}setSubframe(t=!1){this.isSubframeEnabled=t}setupAnimation(t){iM(t,this.configAnimation)}setVolume(t,e){e&&this.name!==e||this.audioController.setVolume(t)}show(){this.renderer.show()}stop(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))}togglePause(t){t&&this.name!==t||(this.isPaused?this.play():this.pause())}trigger(t){try{if(!this._cbs[t])return;switch(t){case te.EnterFrame:{let e=this.enterFrameEvent;e.type=t,e.currentTime=this.currentFrame,e.totalTime=this.totalFrames,e.direction=this.frameModifier<0?-1:1,this.triggerEvent(t,e);let s=this.enterFrameLegacyEvent;s.type=t,s.currentTime=this.currentFrame,s.totalTime=this.totalFrames,s.direction=this.frameMult<0?-1:1,this.onEnterFrame?.(s);break}case te.DrawnFrame:{let e=this.drawnFrameEvent;e.type=t,e.currentTime=this.currentFrame,e.direction=this.frameModifier<0?-1:1,e.totalTime=this.totalFrames,this.triggerEvent(t,e);break}case te.LoopComplete:this.triggerEvent(t,new sU(t,Number(this.loop),this.playCount,this.frameMult)),this.onLoopComplete?.(new sU(t,this.loop,this.playCount,this.frameMult));break;case te.Complete:this.triggerEvent(t,new sW(t,this.frameMult)),this.onComplete?.(new sW(t,this.frameMult));break;case te.SegmentStart:this.triggerEvent(t,new sJ(t,this.firstFrame,this.totalFrames)),this.onSegmentStart?.(new sJ(t,this.firstFrame,this.totalFrames));break;case te.Destroy:this.triggerEvent(t,new sX(t,this)),this.onDestroy?.(new sX(t,this));break;default:this.triggerEvent(t)}}catch(t){console.error(`${this.constructor.name}:
|
|
@@ -69,4 +69,4 @@
|
|
|
69
69
|
</svg>
|
|
70
70
|
`;var n9=((J={}).Contain="contain",J.Cover="cover",J.Fill="fill",J.None="none",J.ScaleDown="scale-down",J),n7=((X={}).Pause="pause",X.Reverse="reverse",X.Stop="stop",X.Void="void",X),ot=((Z={}).Completed="completed",Z.Destroyed="destroyed",Z.Error="error",Z.Frozen="frozen",Z.Loading="loading",Z.Paused="paused",Z.Playing="playing",Z.Stopped="stopped",Z);let oe="dotlottie-player";function os(t,e){let s=e===ot.Playing||e===ot.Paused;t.dataset.active=s.toString(),t.innerHTML=e===ot.Playing?n3:n5}var oi=Object.freeze({__proto__:null,default:function(){if(!this.shadow)throw Error("No Shadow Element");let t=this.shadow.querySelector("slot[name=controls]");if(!t)return;if(!this.controls){t.innerHTML="";return}t.innerHTML=`<div class="lottie-controls toolbar ${this.playerState===ot.Error?"has-error":""}" aria-label="Lottie Animation controls"><button class="togglePlay" data-active="${this.autoplay}" aria-label="Toggle Play/Pause">${n5}</button> <button class="stop" data-active="${!this.autoplay}" aria-label="Stop">${n8}</button> <button class="prev" aria-label="Previous animation" hidden="false">${n4}</button> <button class="next" aria-label="Next animation" hidden>${n2}</button><form class="progress-container${this.simple?" simple":""}"><input type="range" class="seeker" min="0" max="100" step="1" value="${this._seeker.toString()}" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${this._seeker.toString()}" tabindex="0" aria-label="Slider for search"><progress max="100" value="${this._seeker}"></progress></form>${this.simple?"":`<button class="toggleLoop" data-active="${this.loop}" tabindex="0" aria-label="Toggle loop">${n1}</button> <button class="toggleBoomerang" data-active="${this.mode===tt.Bounce}" aria-label="Toggle boomerang" tabindex="0">${nK}</button> <button class="toggleSettings" aria-label="Settings" aria-haspopup="true" aria-expanded="${this._isSettingsOpen}" aria-controls="${this._identifier}-settings">${n6}</button><div id="${this._identifier}-settings" class="popover" hidden><button class="convert" aria-label="Convert JSON animation to dotLottie format" aria-label="Convert ${this.isDotLottie?"dotLottie animation to JSON format":"JSON animation to dotLottie format"}" hidden>${nQ} ${this.isDotLottie?"Convert to JSON":"Convert to dotLottie"}</button> <button class="snapshot" aria-label="Download still image">${n0} Download still image</button></div>`}</div>`;let e=this.shadow.querySelector(".togglePlay");e instanceof HTMLButtonElement&&(e.onclick=this.togglePlay);let s=this.shadow.querySelector(".stop");s instanceof HTMLButtonElement&&(s.onclick=this.stop);let i=this.shadow.querySelector(".prev");i instanceof HTMLButtonElement&&(this.animations.length>0&&this.currentAnimation&&(i.hidden=!1),i.onclick=this.prev);let r=this.shadow.querySelector(".next");r instanceof HTMLButtonElement&&(this.animations.length>0&&this.currentAnimation<this.animations.length-1&&(r.hidden=!1),r.onclick=this.next);let a=this.shadow.querySelector(".seeker");if(a instanceof HTMLInputElement&&(a.onchange=this._handleSeekChange,a.onmousedown=this._freeze),!this.simple){let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.onclick=this.toggleLoop);let e=this.shadow.querySelector(".toggleBoomerang");e instanceof HTMLButtonElement&&(e.onclick=this.toggleBoomerang);let s=this.shadow.querySelector(".convert");s instanceof HTMLButtonElement&&(s.onclick=async()=>{s.disabled=!0;try{let{convert:t}=await (nX?Promise.resolve(nX):nZ=nZ??(async()=>{let{addAnimation:t,convert:e}=await Promise.resolve().then(function(){return nY});return nX={addAnimation:t,convert:e},{addAnimation:t,convert:e}})());await t({isDotLottie:this.isDotLottie,manifest:this.getManifest(),src:this.src||this.source})}finally{s.disabled=!1}});let i=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&(i.onclick=()=>this.snapshot(!0));let r=this.shadow.querySelector(".toggleSettings");r instanceof HTMLButtonElement&&(r.onclick=this._handleSettingsClick,r.onblur=this._handleBlur)}},updatePlayPauseButton:os});async function or(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}" ${this.description?`
|
|
71
71
|
aria-label="${this.description}"
|
|
72
|
-
`:""}></figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await om.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let oa=t=>{let e={message:"Unknown error",status:B?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},on=(t,e)=>null!=t&&Object.keys(e).filter(t=>Number.isNaN(Number(t))).some(s=>e[s]===t),oo=t=>null!==t&&["true","","1"].includes(t),oh=null,ol="Method is not implemented",op=async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t};class om extends nJ{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return op}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){return oo(this.getAttribute("animateOnScroll"))}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){return oo(this.getAttribute("autoplay"))}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){return oo(this.getAttribute("controls"))}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",(!!t).toString())}get dontFreezeOnBlur(){return oo(this.getAttribute("dontFreezeOnBlur"))}set hover(t){this.setAttribute("hover",(!!t).toString())}get hover(){return oo(this.getAttribute("hover"))}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){return oo(this.getAttribute("loop"))}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===tt.Bounce?t:tt.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case n7.Void:case n7.Pause:case n7.Reverse:return t;default:return n7.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return on(t,n9)?t:n9.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){return oo(this.getAttribute("once"))}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){return oo(this.getAttribute("playOnClick"))}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){return oo(this.getAttribute("playOnVisible"))}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||ts.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return on(t,ts)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===ti.Canvas||t===ti.HTML?t:ti.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){return oo(this.getAttribute("simple"))}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){return oo(this.getAttribute("subframe"))}constructor(){super(),this.isLight=!1,this.playerState=ot.Loading,this._container=null,this._DOMRect=null,this._errorMessage="Something went wrong",this._identifier=this.id||v(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:ot.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=or,this._seeker=0,this._animations=[],this._controlsLoadId=0,this._currentAnimation=0,this._errorLoadId=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._renderControls=async()=>{let t=this.shadow?.querySelector("slot[name=controls]");if(!t)return;if(!this.controls){t.innerHTML="";return}let e=++this._controlsLoadId,{default:i}=await (s=s??Promise.resolve().then(function(){return oi}));e===this._controlsLoadId&&i.call(this)},this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(ol)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":await this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");if(!on(s,tt))break;t instanceof HTMLButtonElement&&(t.dataset.active=(s===tt.Bounce).toString()),this._isBounce=s===tt.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._container&&(this._DOMRect=this._container.getBoundingClientRect()),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(te.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(te.Error))}}convert(t){throw Error(ol)}destroy(){this._lottieInstance?.destroy&&(this.playerState=ot.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(te.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await nH(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===tt.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===tt.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:v(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=ot.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=ot.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),await this._renderControls()}catch(t){console.error(t),this._errorMessage=oa(t).message,this.playerState=ot.Error,this.dispatchEvent(new CustomEvent(te.Error))}}loadAnimation(t){throw Error(ol)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(te.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ot.Error:ot.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(te.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ot.Error:ot.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),m=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(os(i,s),r.dataset.active=(s===ot.Stopped).toString()),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&m instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,m.hidden=this.renderer!==ti.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===ot.Playing||this.playerState===ot.Frozen&&this._playerState.prev===ot.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=ot.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{if(!this.shadowRoot)throw Error("Unknown error");let s=this.shadowRoot.querySelector(".animation svg");if(!s)throw Error("Could not retrieve animation from DOM");let i=s instanceof Node?new XMLSerializer().serializeToString(s):null;if(!i)throw Error("Could not serialize SVG element");return t&&x(i,{mimeType:"image/svg+xml",name:`${C(this.src||e)}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`}),i}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(te.Stop))}finally{this.playerState=ot.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===tt.Normal){t.mode=tt.Bounce,this._isBounce=!0;return}t.mode=tt.Normal,this._isBounce=!1;return}if(this.mode===tt.Normal){this.mode=tt.Bounce,this._isBounce=!0;return}this.mode=tt.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===ot.Playing)return void this.pause();if(this.playerState!==ot.Completed)return void this.play();if(this.playerState=ot.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(te.Freeze))}finally{this.playerState=ot.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}async _showError(){if(this.playerState!==ot.Error)return;let t=this.shadow?.querySelector(".animation");if(!(t instanceof HTMLElement))return;let e=++this._errorLoadId,{default:s}=await (oh=oh??Promise.resolve().then(function(){return od}));e===this._errorLoadId&&(t.innerHTML=s(this._errorMessage))}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===ot.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==ot.Frozen||this.play(),this.playOnVisible&&(this.playerState!==ot.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=ot.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=ot.Completed,this.dispatchEvent(new CustomEvent(te.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=ot.Error,this.dispatchEvent(new CustomEvent(te.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(te.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(te.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(te.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case n9.Contain:case n9.ScaleDown:return ts.Contain;case n9.Cover:return ts.Cover;case n9.Fill:return ts.Initial;case n9.None:return ts.None;default:return ts.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._DOMRect||!this._lottieInstance)return;if(B)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=ot.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let{bottom:s,height:i,top:r}=this._DOMRect,a=i-s;r>=innerHeight&&(a=i);let n=_(e/(innerHeight+a)*(t-1),0,t);requestAnimationFrame(()=>{if(n>=t){this.playerState=ot.Paused;return}this.playerState=ot.Playing,this._lottieInstance?.goToAndStop(n,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===ot.Playing&&"blur"===t&&this._freeze(),this.playerState===ot.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===ot.Playing||this.playerState===ot.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[1]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=ot.Completed,this.dispatchEvent(new CustomEvent(te.Complete));return}return(this.dispatchEvent(new CustomEvent(te.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===n7.Reverse&&this._lottieInstance.setDirection(1),this.playerState===ot.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=ot.Playing;return}this.playerState!==ot.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case n7.Void:break;case n7.Pause:this.pause();break;case n7.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===ot.Playing?this._freeze():this.playerState===ot.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===tt.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?te.Previous:te.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=ot.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=ot.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=ot.Stopped}catch(t){this._errorMessage=oa(t).message,this.playerState=ot.Error,this.dispatchEvent(new CustomEvent(te.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e](te.EnterFrame,this._enterFrame),this._lottieInstance[e](te.Complete,this._complete),this._lottieInstance[e](te.LoopComplete,this._loopComplete),this._lottieInstance[e](te.DOMLoaded,this._DOMLoaded),this._lottieInstance[e](te.DataReady,this._dataReady),this._lottieInstance[e](te.DataFailed,this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class oc extends om{get renderer(){return ti.SVG}constructor(){super(),this.isLight=!0}loadAnimation(t){return iR(t)}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:ti.SVG,rendererSettings:{hideOnTransparent:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new oc,B||customElements.define(oe,oc);var od=Object.freeze({__proto__:null,default:function(t){return`<div class="error"><svg preserveAspectRatio="${ts.Cover}" xmlns="${N}" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${t}</text></svg></div>`}});t.DotLottiePlayerBase=om,t.MouseOut=n7,t.PlayMode=tt,t.PlayerEvent=te,t.PlayerState=ot,t.RendererType=ti,t.default=oc,t.tagName=oe,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
|
|
72
|
+
`:""}></figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await om.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let oa=t=>{let e={message:"Unknown error",status:B?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},on=(t,e)=>null!=t&&Object.keys(e).filter(t=>Number.isNaN(Number(t))).some(s=>e[s]===t),oo=t=>null!==t&&["true","","1"].includes(t),oh=null,ol="Method is not implemented",op=async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t};class om extends nJ{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return op}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){return oo(this.getAttribute("animateOnScroll"))}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){return oo(this.getAttribute("autoplay"))}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){return oo(this.getAttribute("controls"))}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",(!!t).toString())}get dontFreezeOnBlur(){return oo(this.getAttribute("dontFreezeOnBlur"))}set hover(t){this.setAttribute("hover",(!!t).toString())}get hover(){return oo(this.getAttribute("hover"))}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){return oo(this.getAttribute("loop"))}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===tt.Bounce?t:tt.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case n7.Void:case n7.Pause:case n7.Reverse:return t;default:return n7.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return on(t,n9)?t:n9.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){return oo(this.getAttribute("once"))}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){return oo(this.getAttribute("playOnClick"))}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){return oo(this.getAttribute("playOnVisible"))}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||ts.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return on(t,ts)?t:null}set quiet(t){this.setAttribute("quiet",(!!t).toString())}get quiet(){return oo(this.getAttribute("quiet"))}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===ti.Canvas||t===ti.HTML?t:ti.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){return oo(this.getAttribute("simple"))}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){return oo(this.getAttribute("subframe"))}constructor(){super(),this.isLight=!1,this.playerState=ot.Loading,this._container=null,this._DOMRect=null,this._errorMessage="Something went wrong",this._identifier=this.id||v(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:ot.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=or,this._seeker=0,this._animations=[],this._controlsLoadId=0,this._currentAnimation=0,this._errorLoadId=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._renderControls=async()=>{let t=this.shadow?.querySelector("slot[name=controls]");if(!t)return;if(!this.controls){t.innerHTML="";return}let e=++this._controlsLoadId,{default:i}=await (s=s??Promise.resolve().then(function(){return oi}));e===this._controlsLoadId&&i.call(this)},this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(ol)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":await this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");if(!on(s,tt))break;t instanceof HTMLButtonElement&&(t.dataset.active=(s===tt.Bounce).toString()),this._isBounce=s===tt.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._container&&(this._DOMRect=this._container.getBoundingClientRect()),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(te.Rendered))})()}catch(t){this._handleError(t)}}convert(t){throw Error(ol)}destroy(){this._lottieInstance?.destroy&&(this.playerState=ot.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(te.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await nH(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===tt.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===tt.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:v(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._clearPrevious(),this.playerState=ot.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=ot.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),await this._renderControls()}catch(t){await this._handleError(t)}}loadAnimation(t){throw Error(ol)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(te.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ot.Error:ot.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(te.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ot.Error:ot.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),m=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(os(i,s),r.dataset.active=(s===ot.Stopped).toString()),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&m instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,m.hidden=this.renderer!==ti.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===ot.Playing||this.playerState===ot.Frozen&&this._playerState.prev===ot.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=ot.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{if(!this.shadowRoot)throw Error("Unknown error");let s=this.shadowRoot.querySelector(".animation svg");if(!s)throw Error("Could not retrieve animation from DOM");let i=s instanceof Node?new XMLSerializer().serializeToString(s):null;if(!i)throw Error("Could not serialize SVG element");return t&&x(i,{mimeType:"image/svg+xml",name:`${C(this.src||e)}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`}),i}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(te.Stop))}finally{this.playerState=ot.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===tt.Normal){t.mode=tt.Bounce,this._isBounce=!0;return}t.mode=tt.Normal,this._isBounce=!1;return}if(this.mode===tt.Normal){this.mode=tt.Bounce,this._isBounce=!0;return}this.mode=tt.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===ot.Playing)return void this.pause();if(this.playerState!==ot.Completed)return void this.play();if(this.playerState=ot.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(te.Freeze))}finally{this.playerState=ot.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}async _showError(){if(this.playerState!==ot.Error)return;let t=this.shadow?.querySelector(".animation"),e=this.shadow?.querySelector("slot[name=controls]");if(e&&(e.innerHTML=""),!(t instanceof HTMLElement))return;let s=++this._errorLoadId,{default:i}=await (oh=oh??Promise.resolve().then(function(){return od}));s===this._errorLoadId&&(t.innerHTML=i(this._errorMessage))}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===ot.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==ot.Frozen||this.play(),this.playOnVisible&&(this.playerState!==ot.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=ot.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_clearPrevious(){this._lottieInstance?.destroy();let t=this.shadow?.querySelector(".animation");t&&(t.innerHTML="")}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=ot.Completed,this.dispatchEvent(new CustomEvent(te.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=ot.Error,this.dispatchEvent(new CustomEvent(te.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(te.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(te.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(te.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case n9.Contain:case n9.ScaleDown:return ts.Contain;case n9.Cover:return ts.Cover;case n9.Fill:return ts.Initial;case n9.None:return ts.None;default:return ts.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}async _handleError(t){this.playerState=ot.Error,this.quiet||(this._errorMessage=oa(t).message,await this._showError()),this.dispatchEvent(new CustomEvent(te.Error)),console.error(t)}_handleScroll(){if(!this.animateOnScroll||!this._DOMRect||!this._lottieInstance)return;if(B)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=ot.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let{bottom:s,height:i,top:r}=this._DOMRect,a=i-s;r>=innerHeight&&(a=i);let n=_(e/(innerHeight+a)*(t-1),0,t);requestAnimationFrame(()=>{if(n>=t){this.playerState=ot.Paused;return}this.playerState=ot.Playing,this._lottieInstance?.goToAndStop(n,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===ot.Playing&&"blur"===t&&this._freeze(),this.playerState===ot.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===ot.Playing||this.playerState===ot.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[1]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=ot.Completed,this.dispatchEvent(new CustomEvent(te.Complete));return}return(this.dispatchEvent(new CustomEvent(te.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===n7.Reverse&&this._lottieInstance.setDirection(1),this.playerState===ot.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=ot.Playing;return}this.playerState!==ot.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case n7.Void:break;case n7.Pause:this.pause();break;case n7.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===ot.Playing?this._freeze():this.playerState===ot.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===tt.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?te.Previous:te.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=ot.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=ot.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=ot.Stopped}catch(t){this._errorMessage=oa(t).message,this.playerState=ot.Error,this.dispatchEvent(new CustomEvent(te.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e](te.EnterFrame,this._enterFrame),this._lottieInstance[e](te.Complete,this._complete),this._lottieInstance[e](te.LoopComplete,this._loopComplete),this._lottieInstance[e](te.DOMLoaded,this._DOMLoaded),this._lottieInstance[e](te.DataReady,this._dataReady),this._lottieInstance[e](te.DataFailed,this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class oc extends om{get renderer(){return ti.SVG}constructor(){super(),this.isLight=!0}loadAnimation(t){return iR(t)}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:ti.SVG,rendererSettings:{hideOnTransparent:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new oc,B||customElements.define(oe,oc);var od=Object.freeze({__proto__:null,default:function(t){return`<div class="error"><svg preserveAspectRatio="${ts.Cover}" xmlns="${N}" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${t}</text></svg></div>`}});t.DotLottiePlayerBase=om,t.MouseOut=n7,t.PlayMode=tt,t.PlayerEvent=te,t.PlayerState=ot,t.RendererType=ti,t.default=oc,t.tagName=oe,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
|