@eva/plugin-renderer-lottie 1.2.7-editor.5 → 1.2.7-editor.8

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.
@@ -6,6 +6,7 @@ var eva_js = require('@eva/eva.js');
6
6
  var pluginRenderer = require('@eva/plugin-renderer');
7
7
  var pixi_js = require('pixi.js');
8
8
  var iOSVersion = require('ios-version');
9
+ var inspectorDecorator = require('@eva/inspector-decorator');
9
10
 
10
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
11
12
 
@@ -70,6 +71,10 @@ function __decorate(decorators, target, key, desc) {
70
71
  return c > 3 && r && Object.defineProperty(target, key, r), r;
71
72
  }
72
73
 
74
+ function __metadata(metadataKey, metadataValue) {
75
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
76
+ }
77
+
73
78
  function __awaiter(thisArg, _arguments, P, generator) {
74
79
  return new (P || (P = Promise))(function (resolve, reject) {
75
80
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5239,6 +5244,10 @@ var Lottie = (function (_super) {
5239
5244
  });
5240
5245
  };
5241
5246
  Lottie.componentName = 'Lottie';
5247
+ __decorate([
5248
+ inspectorDecorator.Field({ type: 'resource', required: true }),
5249
+ __metadata("design:type", String)
5250
+ ], Lottie.prototype, "resource", void 0);
5242
5251
  return Lottie;
5243
5252
  }(eva_js.Component));
5244
5253
  var Lottie$1 = Lottie;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@eva/eva.js"),s=require("@eva/plugin-renderer"),e=require("pixi.js");function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var h=i(require("ios-version")),r=function(t,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var e in s)s.hasOwnProperty(e)&&(t[e]=s[e])},r(t,s)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@eva/eva.js"),s=require("@eva/plugin-renderer"),e=require("pixi.js"),i=require("ios-version"),h=require("@eva/inspector-decorator");function r(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var n=r(i),a=function(t,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var e in s)s.hasOwnProperty(e)&&(t[e]=s[e])},a(t,s)};
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -12,7 +12,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
12
12
 
13
13
  See the Apache Version 2.0 License for specific language governing permissions
14
14
  and limitations under the License.
15
- ***************************************************************************** */function n(t,s){function e(){this.constructor=t}r(t,s),t.prototype=null===s?Object.create(s):(e.prototype=s.prototype,new e)}var a=function(){return a=Object.assign||function(t){for(var s,e=1,i=arguments.length;e<i;e++)for(var h in s=arguments[e])Object.prototype.hasOwnProperty.call(s,h)&&(t[h]=s[h]);return t},a.apply(this,arguments)};function o(t,s,e,i){return new(e||(e=Promise))((function(h,r){function n(t){try{o(i.next(t))}catch(t){r(t)}}function a(t){try{o(i.throw(t))}catch(t){r(t)}}function o(t){t.done?h(t.value):new e((function(s){s(t.value)})).then(n,a)}o((i=i.apply(t,s||[])).next())}))}function l(t,s){var e,i,h,r,n={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(e)throw new TypeError("Generator is already executing.");for(;n;)try{if(e=1,i&&(h=2&r[0]?i.return:r[0]?i.throw||((h=i.return)&&h.call(i),0):i.next)&&!(h=h.call(i,r[1])).done)return h;switch(i=0,h&&(r=[2&r[0],h.value]),r[0]){case 0:case 1:h=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,i=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if(!(h=n.trys,(h=h.length>0&&h[h.length-1])||6!==r[0]&&2!==r[0])){n=0;continue}if(3===r[0]&&(!h||r[1]>h[0]&&r[1]<h[3])){n.label=r[1];break}if(6===r[0]&&n.label<h[1]){n.label=h[1],h=r;break}if(h&&n.label<h[2]){n.label=h[2],n.ops.push(r);break}h[2]&&n.ops.pop(),n.trys.pop();continue}r=s.call(t,n)}catch(t){r=[6,t],i=0}finally{e=h=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function p(t){return Object.prototype.toString.call(t)}const c={copyJSON:function(t){return JSON.parse(JSON.stringify(t))},isArray:function(){let t=p([]);return function(s){return p(s)===t}}(),isString:function(){let t=p("s");return function(s){return p(s)===t}}(),isNumber:function(){let t=p(1);return function(s){return p(s)===t}}(),isFunction:function(){let t=p((function(){}));return function(s){return p(s)===t}}(),isUndefined:function(t){return void 0===t},isBoolean:function(){let t=p(!0);return function(s){return p(s)===t}}(),isObject:function(){let t=p({});return function(s){return p(s)===t}}(),random:function(t,s){return this.isArray(t)?t[~~(Math.random()*t.length)]:(this.isNumber(s)||(s=t||1,t=0),t+Math.random()*(s-t))},euclideanModulo:function(t,s){return(t%s+s)%s},codomainBounce:function(t,s,e){return t<s?2*s-t:t>e?2*e-t:t},clamp:function(t,s,e){return t<s?s:t>e?e:t},inRange:(t,s,e)=>t>=s&&t<=e,getAssets(t,s){for(let e=0;e<s.length;e++)if(t===s[e].id)return s[e];return console.error("have not assets name as",t),{}},rgb2hex:t=>(t[0]<<16)+(t[1]<<8)+(0|t[2])};class u{constructor(){this.listeners={},this.addEventListener=this.on,this.removeEventListener=this.off}on(t,s){return c.isFunction(s)?(c.isUndefined(this.listeners[t])&&(this.listeners[t]=[]),this.listeners[t].push(s),this):this}off(t,s){if(c.isUndefined(this.listeners[t]))return this;const e=this.listeners[t];let i=e.length;if(i>0)if(s)for(;i--;)e[i]===s&&e.splice(i,1);else e.length=0;return this}once(t,s){if(!c.isFunction(s))return this;const e=i=>{s(i),this.off(t,e)};return this.on(t,e),this}emit(t,...s){if(c.isUndefined(this.listeners[t]))return this;const e=(this.listeners[t]||[]).slice(0);for(let t=0;t<e.length;t++)e[t].apply(this,s);return this}}const d={},f={Ajax:"Ajax",Texture:"Texture"};var m=f,g=function(t,s){d[t]=s};function y(t,s,e){let i,h,r,n,a,o,l=t.length;for(h=0;h<l;h+=1)if(i=t[h],"ks"in i&&!i.completed){if(i.completed=!0,i.tt&&(t[h-1].td=i.tt),i.hasMask){let t=i.masksProperties;for(n=t.length,r=0;r<n;r+=1)if(t[r].pt.k.i)k(t[r].pt.k);else for(o=t[r].pt.k.length,a=0;a<o;a+=1)t[r].pt.k[a].s&&k(t[r].pt.k[a].s[0]),t[r].pt.k[a].e&&k(t[r].pt.k[a].e[0])}0===i.ty?(i.layers=v(i.refId,s),y(i.layers,s)):4===i.ty?_(i.shapes):5==i.ty&&P(i)}}function v(t,s){let e=0,i=s.length;for(;e<i;){if(s[e].id===t)return s[e].layers.__used?JSON.parse(JSON.stringify(s[e].layers)):(s[e].layers.__used=!0,s[e].layers);e+=1}}function _(t){let s,e,i;for(s=t.length-1;s>=0;s-=1)if("sh"==t[s].ty)if(t[s].ks.k.i)k(t[s].ks.k);else for(i=t[s].ks.k.length,e=0;e<i;e+=1)t[s].ks.k[e].s&&k(t[s].ks.k[e].s[0]),t[s].ks.k[e].e&&k(t[s].ks.k[e].e[0]);else"gr"==t[s].ty&&_(t[s].it)}function k(t){let s,e=t.i.length;for(s=0;s<e;s+=1)t.i[s][0]+=t.v[s][0],t.i[s][1]+=t.v[s][1],t.o[s][0]+=t.v[s][0],t.o[s][1]+=t.v[s][1]}function S(t,s){let e=s?s.split("."):[100,100,100];return t[0]>e[0]||!(e[0]>t[0])&&(t[1]>e[1]||!(e[1]>t[1])&&(t[2]>e[2]||!(e[2]>t[2])&&void 0))}let x=function(){let t=[4,4,14];function s(t){let s=t.t.d;t.t.d={k:[{s:s,t:0}]}}function e(t){let e,i=t.length;for(e=0;e<i;e+=1)5===t[e].ty&&s(t[e])}return function(s){if(S(t,s.v)&&(e(s.layers),s.assets)){let t,i=s.assets.length;for(t=0;t<i;t+=1)s.assets[t].layers&&e(s.assets[t].layers)}}}(),M=function(){let t=[4,7,99];return function(s){if(s.chars&&!S(t,s.v)){let t,e,i,h,r,n=s.chars.length;for(t=0;t<n;t+=1)if(s.chars[t].data&&s.chars[t].data.shapes)for(r=s.chars[t].data.shapes[0].it,i=r.length,e=0;e<i;e+=1)h=r[e].ks.k,h.__converted||(k(r[e].ks.k),h.__converted=!0)}}}(),T=function(){let t=[4,1,9];function s(t){let e,i,h,r=t.length;for(e=0;e<r;e+=1)if("gr"===t[e].ty)s(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(h=t[e].c.k.length,i=0;i<h;i+=1)t[e].c.k[i].s&&(t[e].c.k[i].s[0]/=255,t[e].c.k[i].s[1]/=255,t[e].c.k[i].s[2]/=255,t[e].c.k[i].s[3]/=255),t[e].c.k[i].e&&(t[e].c.k[i].e[0]/=255,t[e].c.k[i].e[1]/=255,t[e].c.k[i].e[2]/=255,t[e].c.k[i].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function e(t){let e,i=t.length;for(e=0;e<i;e+=1)4===t[e].ty&&s(t[e].shapes)}return function(s){if(S(t,s.v)&&(e(s.layers),s.assets)){let t,i=s.assets.length;for(t=0;t<i;t+=1)s.assets[t].layers&&e(s.assets[t].layers)}}}(),w=function(){let t=[4,4,18];function s(t){let e,i,h;for(e=t.length-1;e>=0;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(h=t[e].ks.k.length,i=0;i<h;i+=1)t[e].ks.k[i].s&&(t[e].ks.k[i].s[0].c=t[e].closed),t[e].ks.k[i].e&&(t[e].ks.k[i].e[0].c=t[e].closed);else"gr"==t[e].ty&&s(t[e].it)}function e(t){let e,i,h,r,n,a,o=t.length;for(i=0;i<o;i+=1){if(e=t[i],e.hasMask){let t=e.masksProperties;for(r=t.length,h=0;h<r;h+=1)if(t[h].pt.k.i)t[h].pt.k.c=t[h].cl;else for(a=t[h].pt.k.length,n=0;n<a;n+=1)t[h].pt.k[n].s&&(t[h].pt.k[n].s[0].c=t[h].cl),t[h].pt.k[n].e&&(t[h].pt.k[n].e[0].c=t[h].cl)}4===e.ty&&s(e.shapes)}}return function(s){if(S(t,s.v)&&(e(s.layers),s.assets)){let t,i=s.assets.length;for(t=0;t<i;t+=1)s.assets[t].layers&&e(s.assets[t].layers)}}}();function P(t,s){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var b=function(t,s){t.__complete||(T(t),x(t),M(t),w(t),y(t.layers,t.assets),t.__complete=!0)};let D="function"==typeof Float32Array;function C(t,s){return 1-3*s+3*t}function L(t,s){return 3*s-6*t}function A(t){return 3*t}function O(t,s,e){return((C(s,e)*t+L(s,e))*t+A(s))*t}function F(t,s,e){return 3*C(s,e)*t*t+2*L(s,e)*t+A(s)}function I(t,s,e,i){if(!(0<=t&&t<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");this.mX1=t,this.mY1=s,this.mX2=e,this.mY2=i,this.sampleValues=D?new Float32Array(11):new Array(11),this._preCompute(),this.get=this.get.bind(this)}I.prototype._preCompute=function(){if(this.mX1!==this.mY1||this.mX2!==this.mY2)for(let t=0;t<11;++t)this.sampleValues[t]=O(.1*t,this.mX1,this.mX2)},I.prototype._getTForX=function(t){let s=0,e=1;for(;10!==e&&this.sampleValues[e]<=t;++e)s+=.1;--e;let i=s+(t-this.sampleValues[e])/(this.sampleValues[e+1]-this.sampleValues[e])*.1,h=F(i,this.mX1,this.mX2);return h>=.001?function(t,s,e,i){for(let h=0;h<4;++h){let h=F(s,e,i);if(0===h)return s;s-=(O(s,e,i)-t)/h}return s}(t,i,this.mX1,this.mX2):0===h?i:function(t,s,e,i,h){let r,n,a=0;do{n=s+(e-s)/2,r=O(n,i,h)-t,r>0?e=n:s=n}while(Math.abs(r)>1e-7&&++a<10);return n}(t,s,s+.1,this.mX1,this.mX2)},I.prototype.get=function(t){return this.mX1===this.mY1&&this.mX2===this.mY2?t:0===t?0:1===t?1:O(this._getTForX(t),this.mY1,this.mY2)};const E={};var N=function(t,s,e,i,h){const r=h||("bez_"+t+"_"+s+"_"+e+"_"+i).replace(/\./g,"p");if(E[r])return E[r];const n=new I(t,s,e,i);return E[r]=n,n};let V;function q(t){return new Array(t)}V="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,s){return"float32"===t?new Float32Array(s):"int16"===t?new Int16Array(s):"uint8c"===t?new Uint8ClampedArray(s):void 0}:function(t,s){let e=0;const i=[];let h;switch(t){case"int16":case"uint8c":h=1;break;default:h=1.1}for(e=0;e<s;e+=1)i.push(h);return i};var j=function(t){return t.concat(q(t.length))};const R=function(t,s,e){let i=0,h=t,r=q(h);return{newElement:function(){let t;return i?(i-=1,t=r[i]):t=s(),t},release:function(t){i===h&&(r=j(r),h*=2),e&&e(t),r[i]=t,i+=1}}},X=R(8,(function(){return V("float32",2)}));class Y{constructor(){this.c=!1,this._length=0,this._maxLength=8,this.v=q(this._maxLength),this.o=q(this._maxLength),this.i=q(this._maxLength)}setPathData(t,s){this.c=t,this.setLength(s);let e=0;for(;e<s;)this.v[e]=X.newElement(),this.o[e]=X.newElement(),this.i[e]=X.newElement(),e+=1}setLength(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t}doubleArrayLength(){this.v=this.v.concat(q(this._maxLength)),this.i=this.i.concat(q(this._maxLength)),this.o=this.o.concat(q(this._maxLength)),this._maxLength*=2}setXYAt(t,s,e,i,h){let r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),e){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!h)&&(r[i]=X.newElement()),r[i][0]=t,r[i][1]=s}setTripleAt(t,s,e,i,h,r,n,a){this.setXYAt(t,s,"v",n,a),this.setXYAt(e,i,"o",n,a),this.setXYAt(h,r,"i",n,a)}reverse(){const t=new Y;t.setPathData(this.c,this._length);const s=this.v,e=this.o,i=this.i;let h=0;this.c&&(t.setTripleAt(s[0][0],s[0][1],i[0][0],i[0][1],e[0][0],e[0][1],0,!1),h=1);let r=this._length-1;const n=this._length;for(let a=h;a<n;a+=1)t.setTripleAt(s[r][0],s[r][1],i[r][0],i[r][1],e[r][0],e[r][1],a,!1),r-=1;return t}}const B=R(4,(function(){return new Y}),(function(t){const s=t._length;for(let e=0;e<s;e+=1)X.release(t.v[e]),X.release(t.i[e]),X.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}));B.clone=function(t){const s=B.newElement(),e=void 0===t._length?t.v.length:t._length;s.setLength(e),s.c=t.c;for(let i=0;i<e;i+=1)s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],i);return s};class G{constructor(){this._length=0,this._maxLength=4,this.shapes=q(this._maxLength)}addShape(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(q(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1}releaseShapes(){for(let t=0;t<this._length;t+=1)B.release(this.shapes[t]);this._length=0}}let U=0,z=4,W=q(z);var J=function(){let t;return U?(U-=1,t=W[U]):t=new G,t};class H{outTypeExpressionMode(){this._hasOutTypeExpression=!0,this.container&&this.container.outTypeExpressionMode()}addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0,t._hasOutTypeExpression&&this.outTypeExpressionMode())}iterateDynamicProperties(t){this._mdf=!1;const s=this.dynamicProperties.length;for(let e=0;e<s;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e]._mdf&&(this._mdf=!0)}initDynamicPropertyContainer(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1,this._hasOutTypeExpression=!1}}const K=R(8,(function(){return{addedLength:0,percents:V("float32",200),lengths:V("float32",200)}})),Z=R(8,(function(){return{lengths:[],totalLength:0}}),(function(t){const s=t.lengths.length;for(let e=0;e<s;e+=1)K.release(t.lengths[e]);t.lengths.length=0}));function $(t,s,e,i,h,r){const n=t*i+s*h+e*r-h*i-r*t-e*s;return n>-.001&&n<.001}function Q(t,s,e,i){let h,r=0;const n=[],a=[],o=K.newElement(),l=e.length;for(let p=0;p<200;p+=1){const c=p/199;h=0;for(let r=0;r<l;r+=1){const o=Math.pow(1-c,3)*t[r]+3*Math.pow(1-c,2)*c*e[r]+3*(1-c)*Math.pow(c,2)*i[r]+Math.pow(c,3)*s[r];n[r]=o,null!==a[r]&&(h+=Math.pow(n[r]-a[r],2)),a[r]=n[r]}h&&(h=Math.sqrt(h),r+=h),o.percents[p]=c,o.lengths[p]=r}return o.addedLength=r,o}function tt(t){this.segmentLength=0,this.points=new Array(t)}function st(t,s){this.partialLength=t,this.point=s}const et={};function it(t,s){const e=s.percents,i=s.lengths,h=e.length;let r=Math.floor((h-1)*t);const n=t*s.addedLength;let a=0;if(r===h-1||0===r||n===i[r])return e[r];{const t=i[r]>n?-1:1;let s=!0;for(;s;)if(i[r]<=n&&i[r+1]>n?(a=(n-i[r])/(i[r+1]-i[r]),s=!1):r+=t,r<0||r>=h-1){if(r===h-1)return e[r];s=!1}return e[r]+(e[r+1]-e[r])*a}}const ht=V("float32",8);var rt={getSegmentsLength:function(t){const s=Z.newElement(),e=t.c,i=t.v,h=t.o,r=t.i,n=t._length,a=s.lengths;let o=0,l=0;for(;l<n-1;l+=1)a[l]=Q(i[l],i[l+1],h[l],r[l+1]),o+=a[l].addedLength;return e&&n&&(a[l]=Q(i[l],i[0],h[l],r[0]),o+=a[l].addedLength),s.totalLength=o,s},getNewSegment:function(t,s,e,i,h,r,n){const a=it(h=h<0?0:h>1?1:h,n),o=it(r=r>1?1:r,n),l=t.length,p=1-a,c=1-o,u=p*p*p,d=a*p*p*3,f=a*a*p*3,m=a*a*a,g=p*p*c,y=a*p*c+p*a*c+p*p*o,v=a*a*c+p*a*o+a*p*o,_=a*a*o,k=p*c*c,S=a*c*c+p*o*c+p*c*o,x=a*o*c+p*o*o+a*c*o,M=a*o*o,T=c*c*c,w=o*c*c+c*o*c+c*c*o,P=o*o*c+c*o*o+o*c*o,b=o*o*o;for(let h=0;h<l;h+=1)ht[4*h]=Math.round(1e3*(u*t[h]+d*e[h]+f*i[h]+m*s[h]))/1e3,ht[4*h+1]=Math.round(1e3*(g*t[h]+y*e[h]+v*i[h]+_*s[h]))/1e3,ht[4*h+2]=Math.round(1e3*(k*t[h]+S*e[h]+x*i[h]+M*s[h]))/1e3,ht[4*h+3]=Math.round(1e3*(T*t[h]+w*e[h]+P*i[h]+b*s[h]))/1e3;return ht},getPointInSegment:function(t,s,e,i,h,r){const n=it(h,r),a=1-n;return[Math.round(1e3*(a*a*a*t[0]+(n*a*a+a*n*a+a*a*n)*e[0]+(n*n*a+a*n*n+n*a*n)*i[0]+n*n*n*s[0]))/1e3,Math.round(1e3*(a*a*a*t[1]+(n*a*a+a*n*a+a*a*n)*e[1]+(n*n*a+a*n*n+n*a*n)*i[1]+n*n*n*s[1]))/1e3]},buildBezierData:function(t,s,e,i){const h=(t[0]+"_"+t[1]+"_"+s[0]+"_"+s[1]+"_"+e[0]+"_"+e[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!et[h]){let r,n,a=200,o=0,l=null;2===t.length&&(t[0]!=s[0]||t[1]!=s[1])&&$(t[0],t[1],s[0],s[1],t[0]+e[0],t[1]+e[1])&&$(t[0],t[1],s[0],s[1],s[0]+i[0],s[1]+i[1])&&(a=2);const p=new tt(a),c=e.length;for(let h=0;h<a;h+=1){n=q(c);const u=h/(a-1);r=0;for(let h=0;h<c;h+=1){const a=Math.pow(1-u,3)*t[h]+3*Math.pow(1-u,2)*u*(t[h]+e[h])+3*(1-u)*Math.pow(u,2)*(s[h]+i[h])+Math.pow(u,3)*s[h];n[h]=a,null!==l&&(r+=Math.pow(n[h]-l[h],2))}r=Math.sqrt(r),o+=r,p.points[h]=new st(r,n),l=n}p.segmentLength=o,et[h]=p}return et[h]},pointOnLine2D:$,pointOnLine3D:function(t,s,e,i,h,r,n,a,o){if(0===e&&0===r&&0===o)return $(t,s,i,h,n,a);const l=Math.sqrt(Math.pow(i-t,2)+Math.pow(h-s,2)+Math.pow(r-e,2)),p=Math.sqrt(Math.pow(n-t,2)+Math.pow(a-s,2)+Math.pow(o-e,2)),c=Math.sqrt(Math.pow(n-i,2)+Math.pow(a-h,2)+Math.pow(o-r,2));let u;return u=l>p?l>c?l-p-c:c-p-l:c>p?c-p-l:p-l-c,u>-1e-4&&u<1e-4}};const nt=Math.PI/180,at=[0,0],ot=/(loopIn|loopOut)\(([^)]+)/,lt=/["']\w+["']/;class pt{constructor(t,s,e){this.begin=s,this.end=e,this.total=this.end-this.begin,this.type=t}update(t){return"in"===this.type?t>=this.begin?t:this.end-c.euclideanModulo(this.begin-t,this.total):"out"===this.type?t<=this.end?t:this.begin+c.euclideanModulo(t-this.end,this.total):void 0}}class ct{constructor(t,s,e){this.begin=s,this.end=e,this.total=this.end-this.begin,this.type=t}update(t){if("in"===this.type&&t<this.begin||"out"===this.type&&t>this.end){const s=t-this.end;return this.pingpong(s)}return t}pingpong(t){return Math.floor(t/this.total)%2?this.begin+c.euclideanModulo(t,this.total):this.end-c.euclideanModulo(t,this.total)}}const ut={loopIn(t,s,e){const i=t[0].t,h=t.length-1,r=t[Math.min(h,e)].t;switch(s){case"cycle":return new pt("in",i,r);case"pingpong":return new ct("in",i,r)}return null},loopOut(t,s,e){const i=t.length-1,h=t[Math.max(0,i-e)].t,r=t[i].t;switch(s){case"cycle":return new pt("out",h,r);case"pingpong":return new ct("out",h,r)}return null}};var dt=function(t){return t.x&&ot.test(t.x)},ft=function(t){const{name:s,mode:e,offset:i=0}=function(t){const s=t.match(ot),e=s[2].split(/\s*,\s*/).map((t=>lt.test(t)?t.replace(/"|'/g,""):parseInt(t)));return{name:s[1],mode:e[0],offset:e[1]}}(t.x),h=0===i?t.k.length-1:i;return ut[s]&&ut[s](t.k,e,h)};function mt(t){const s=t[0]*nt,e=t[1]*nt,i=t[2]*nt,h=Math.cos(s/2),r=Math.cos(e/2),n=Math.cos(i/2),a=Math.sin(s/2),o=Math.sin(e/2),l=Math.sin(i/2);return[a*o*n+h*r*l,a*r*n+h*o*l,h*o*n-a*r*l,h*r*n-a*o*l]}class gt{interpolateValue(t,s){let e;"multidimensional"===this.propType&&(e=V("float32",this.pv.length));let i,h,r,n,a,o,l,p,c=s.lastIndex,u=c,d=this.keyframes.length-1,f=!0;for(;f;){if(i=this.keyframes[u],h=this.keyframes[u+1],u===d-1&&t>=h.t){i.h&&(i=h),c=0;break}if(h.t>t){c=u;break}u<d-1?u+=1:(c=0,f=!1)}let m,g=h.t,y=i.t;if(i.to){i.bezierData||(i.bezierData=rt.buildBezierData(i.s,h.s||i.e,i.to,i.ti));let c=i.bezierData;if(t>=g||t<y){let s=t>=g?c.points.length-1:0;for(n=c.points[s].point.length,r=0;r<n;r+=1)e[r]=c.points[s].point[r]}else{i.__fnct?p=i.__fnct:(p=N(i.o.x,i.o.y,i.i.x,i.i.y,i.n).get,i.__fnct=p),a=p((t-y)/(g-y));let h,d=c.segmentLength*a,m=s.lastFrame<t&&s._lastKeyframeIndex===u?s._lastAddedLength:0;for(l=s.lastFrame<t&&s._lastKeyframeIndex===u?s._lastPoint:0,f=!0,o=c.points.length;f;){if(m+=c.points[l].partialLength,0===d||0===a||l===c.points.length-1){for(n=c.points[l].point.length,r=0;r<n;r+=1)e[r]=c.points[l].point[r];break}if(d>=m&&d<m+c.points[l+1].partialLength){for(h=(d-m)/c.points[l+1].partialLength,n=c.points[l].point.length,r=0;r<n;r+=1)e[r]=c.points[l].point[r]+(c.points[l+1].point[r]-c.points[l].point[r])*h;break}l<o-1?l+=1:f=!1}s._lastPoint=l,s._lastAddedLength=m-c.points[l].partialLength,s._lastKeyframeIndex=u}}else{let s,r,n,o,l;if(d=i.s.length,m=h.s||i.e,this.sh&&1!==i.h)t>=g?(e[0]=m[0],e[1]=m[1],e[2]=m[2]):t<=y?(e[0]=i.s[0],e[1]=i.s[1],e[2]=i.s[2]):function(t,s){const e=s[0],i=s[1],h=s[2],r=s[3],n=Math.atan2(2*i*r-2*e*h,1-2*i*i-2*h*h),a=Math.asin(2*e*i+2*h*r),o=Math.atan2(2*e*r-2*i*h,1-2*e*e-2*h*h);t[0]=n/nt,t[1]=a/nt,t[2]=o/nt}(e,function(t,s,e){const i=[],h=t[0],r=t[1],n=t[2],a=t[3];let o,l,p,c,u,d=s[0],f=s[1],m=s[2],g=s[3];return l=h*d+r*f+n*m+a*g,l<0&&(l=-l,d=-d,f=-f,m=-m,g=-g),1-l>1e-6?(o=Math.acos(l),p=Math.sin(o),c=Math.sin((1-e)*o)/p,u=Math.sin(e*o)/p):(c=1-e,u=e),i[0]=c*h+u*d,i[1]=c*r+u*f,i[2]=c*n+u*m,i[3]=c*a+u*g,i}(mt(i.s),mt(m),(t-y)/(g-y)));else for(u=0;u<d;u+=1)1!==i.h&&(t>=g?a=1:t<y?a=0:(i.o.x.constructor===Array?(i.__fnct||(i.__fnct=[]),i.__fnct[u]?p=i.__fnct[u]:(s=void 0===i.o.x[u]?i.o.x[0]:i.o.x[u],r=void 0===i.o.y[u]?i.o.y[0]:i.o.y[u],n=void 0===i.i.x[u]?i.i.x[0]:i.i.x[u],o=void 0===i.i.y[u]?i.i.y[0]:i.i.y[u],p=N(s,r,n,o).get,i.__fnct[u]=p)):i.__fnct?p=i.__fnct:(s=i.o.x,r=i.o.y,n=i.i.x,o=i.i.y,p=N(s,r,n,o).get,i.__fnct=p),a=p((t-y)/(g-y)))),m=h.s||i.e,l=1===i.h?i.s[u]:i.s[u]+(m[u]-i.s[u])*a,"multidimensional"===this.propType?e[u]=l:e=l}return s.lastIndex=c,e}getValueAtCurrentTime(t){let s=this.keyframes[0].t,e=this.keyframes[this.keyframes.length-1].t;if(!(t===this._caching.lastFrame||-999999!==this._caching.lastFrame&&(this._caching.lastFrame>=e&&t>=e||this._caching.lastFrame<s&&t<s))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);let s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}setVValue(t){let s;if("unidimensional"===this.propType)s=t*this.mult,Math.abs(this.v-s)>1e-5&&(this.v=s,this._mdf=!0);else{let e=0;const i=this.v.length;for(;e<i;)s=t[e]*this.mult,Math.abs(this.v[e]-s)>1e-5&&(this.v[e]=s,this._mdf=!0),e+=1}}processEffectsSequence(t){if(this.expression&&(t=this.expression.update(t)),t===this.frameId||!this.effectsSequence.length)return;if(this.lock)return void this.setVValue(this.pv);let s;this.lock=!0,this._mdf=this._isFirstFrame;let e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(s=0;s<e;s+=1)i=this.effectsSequence[s](t);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=t}addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}}class yt extends gt{constructor(t,s,e,i){super(),this.propType="unidimensional",this.mult=e||1,this.data=s,this.v=e?s.k*e:s.k,this.pv=s.k,this._mdf=!1,this.elem=t,this.container=i,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=this.processEffectsSequence}}class vt extends gt{constructor(t,s,e,i){super(),this.propType="multidimensional",this.mult=e||1,this.data=s,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;const h=s.k.length;this.v=V("float32",h),this.pv=V("float32",h),this.vel=V("float32",h);for(let t=0;t<h;t+=1)this.v[t]=s.k[t]*this.mult,this.pv[t]=s.k[t];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class _t extends gt{constructor(t,s,e,i){super(),this.propType="unidimensional",this.keyframes=s.k,this.frameId=-1,this._caching={lastFrame:-999999,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=s,this.mult=e||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=-999999,this.pv=-999999,this._isFirstFrame=!0,this.getValue=this.processEffectsSequence,this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this._hasOutTypeExpression=!1,dt(s)&&(this.expression=ft(s),this._hasOutTypeExpression="out"===this.expression.type)}}class kt extends gt{constructor(t,s,e,i){let h;super(),this.propType="multidimensional";let r,n,a,o,l=s.k.length;for(h=0;h<l-1;h+=1)s.k[h].to&&s.k[h].s&&s.k[h+1]&&s.k[h+1].s&&(r=s.k[h].s,n=s.k[h+1].s,a=s.k[h].to,o=s.k[h].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&rt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+a[0],r[1]+a[1])&&rt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&rt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+a[0],r[1]+a[1],r[2]+a[2])&&rt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(s.k[h].to=null,s.k[h].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===a[0]&&0===a[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===a[2]&&0===o[2])&&(s.k[h].to=null,s.k[h].ti=null));this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this.keyframes=s.k,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=e||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=this.processEffectsSequence,this.frameId=-1;let p=s.k[0].s.length;for(this.v=V("float32",p),this.pv=V("float32",p),h=0;h<p;h+=1)this.v[h]=-999999,this.pv[h]=-999999;this._caching={lastFrame:-999999,lastIndex:0,value:V("float32",p)},this._hasOutTypeExpression=!1,dt(s)&&(this.expression=ft(s),this._hasOutTypeExpression="out"===this.expression.type)}}var St=function(t,s,e,i,h){let r;if(s.k.length)if("number"==typeof s.k[0])r=new vt(t,s,i,h);else switch(e){case 0:r=new _t(t,s,i,h);break;case 1:r=new kt(t,s,i,h)}else r=new yt(t,s,i,h);return r.effectsSequence.length&&h.addDynamicProperty(r),r};class xt{interpolateShape(t,s,e){let i,h,r,n,a,o,l,p,c,u=e.lastIndex,d=this.keyframes;if(t<d[0].t)i=d[0].s[0],r=!0,u=0;else if(t>=d[d.length-1].t)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{let s,e,n=u,a=d.length-1,o=!0;for(;o&&(s=d[n],e=d[n+1],!(e.t>t));)n<a-1?n+=1:o=!1;if(r=1===s.h,u=n,!r){if(t>=e.t)p=1;else if(t<s.t)p=0;else{let i;s.__fnct?i=s.__fnct:(i=N(s.o.x,s.o.y,s.i.x,s.i.y).get,s.__fnct=i),p=i((t-s.t)/(e.t-s.t))}h=e.s?e.s[0]:s.e[0]}i=s.s[0]}for(o=s._length,l=i.i[0].length,e.lastIndex=u,n=0;n<o;n+=1)for(a=0;a<l;a+=1)c=r?i.i[n][a]:i.i[n][a]+(h.i[n][a]-i.i[n][a])*p,s.i[n][a]=c,c=r?i.o[n][a]:i.o[n][a]+(h.o[n][a]-i.o[n][a])*p,s.o[n][a]=c,c=r?i.v[n][a]:i.v[n][a]+(h.v[n][a]-i.v[n][a])*p,s.v[n][a]=c}interpolateShapeCurrentTime(t){let s=this.keyframes[0].t,e=this.keyframes[this.keyframes.length-1].t,i=this._caching.lastFrame;return-999999!==i&&(i<s&&t<s||i>e&&t>e)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}resetShape(){this.paths=this.localShapeCollection}shapesEqual(t,s){if(t._length!==s._length||t.c!==s.c)return!1;let e,i=t._length;for(e=0;e<i;e+=1)if(t.v[e][0]!==s.v[e][0]||t.v[e][1]!==s.v[e][1]||t.o[e][0]!==s.o[e][0]||t.o[e][1]!==s.o[e][1]||t.i[e][0]!==s.i[e][0]||t.i[e][1]!==s.i[e][1])return!1;return!0}setVValue(t){this.shapesEqual(this.v,t)||(this.v=B.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}processEffectsSequence(t){if(t===this.frameId)return;if(!this.effectsSequence.length)return void(this._mdf=!1);if(this.lock)return void this.setVValue(this.pv);this.lock=!0,this._mdf=!1;let s,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,i=this.effectsSequence.length;for(s=0;s<i;s+=1)e=this.effectsSequence[s](t);this.setVValue(e),this.lock=!1,this.frameId=t}addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}}class Mt extends xt{constructor(t,s,e){super(),this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=s,this.k=!1,this.kf=!1,this._mdf=!1;let i=3===e?s.pt.k:s.ks.k;this.v=B.clone(i),this.pv=B.clone(this.v),this.localShapeCollection=J(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=this.resetShape,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class Tt extends xt{constructor(t,s,e){super(),this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.keyframes=3===e?s.pt.k:s.ks.k,this.k=!0,this.kf=!0;let i=this.keyframes[0].s[0].i.length;this.v=B.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=B.clone(this.v),this.localShapeCollection=J(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=-999999,this.reset=this.resetShape,this._caching={lastFrame:-999999,lastIndex:0},this.effectsSequence=[this.interpolateShapeCurrentTime.bind(this)],this.getValue=this.processEffectsSequence,this._hasOutTypeExpression=!1,dt(s)&&(this.expression=ft(s),this._hasOutTypeExpression="out"===this.expression.type)}}class wt extends H{constructor(t,s){super(),this.v=B.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=J(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=s.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=St(t,s.p,1,0,this),this.s=St(t,s.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}reset(){this.paths=this.localShapeCollection}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.frameId=t,this._mdf&&this.convertEllToPath())}convertEllToPath(){const t=this.p.v[0],s=this.p.v[1],e=this.s.v[0]/2,i=this.s.v[1]/2,h=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=s-i,r.v[1][0]=h?t+e:t-e,r.v[1][1]=s,r.v[2][0]=t,r.v[2][1]=s+i,r.v[3][0]=h?t-e:t+e,r.v[3][1]=s,r.i[0][0]=h?t-e*bt:t+e*bt,r.i[0][1]=s-i,r.i[1][0]=h?t+e:t-e,r.i[1][1]=s-i*bt,r.i[2][0]=h?t+e*bt:t-e*bt,r.i[2][1]=s+i,r.i[3][0]=h?t-e:t+e,r.i[3][1]=s+i*bt,r.o[0][0]=h?t+e*bt:t-e*bt,r.o[0][1]=s-i,r.o[1][0]=h?t+e:t-e,r.o[1][1]=s+i*bt,r.o[2][0]=h?t-e*bt:t+e*bt,r.o[2][1]=s+i,r.o[3][0]=h?t-e:t+e,r.o[3][1]=s-i*bt}}class Pt extends H{constructor(t,s){super(),this.v=B.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=s,this.frameId=-1,this.d=s.d,this.initDynamicPropertyContainer(t),1===s.sy?(this.ir=St(t,s.ir,0,0,this),this.is=St(t,s.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=St(t,s.pt,0,0,this),this.p=St(t,s.p,1,0,this),this.r=St(t,s.r,0,nt,this),this.or=St(t,s.or,0,0,this),this.os=St(t,s.os,0,.01,this),this.localShapeCollection=J(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}reset(){this.paths=this.localShapeCollection}getValue(t){t!==this.frameId&&(this.frameId=t,this.iterateDynamicProperties(t),this._mdf&&this.convertToPath())}convertStarToPath(){let t,s,e,i,h=2*Math.floor(this.pt.v),r=2*Math.PI/h,n=!0,a=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,c=2*Math.PI*a/(2*h),u=2*Math.PI*o/(2*h),d=-Math.PI/2;d+=this.r.v;let f=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<h;t+=1){s=n?a:o,e=n?l:p,i=n?c:u;let h=s*Math.cos(d),m=s*Math.sin(d),g=0===h&&0===m?0:m/Math.sqrt(h*h+m*m),y=0===h&&0===m?0:-h/Math.sqrt(h*h+m*m);h+=+this.p.v[0],m+=+this.p.v[1],this.v.setTripleAt(h,m,h-g*i*e*f,m-y*i*e*f,h+g*i*e*f,m+y*i*e*f,t,!0),n=!n,d+=r*f}}convertPolygonToPath(){let t,s=Math.floor(this.pt.v),e=2*Math.PI/s,i=this.or.v,h=this.os.v,r=2*Math.PI*i/(4*s),n=-Math.PI/2,a=3===this.data.d?-1:1;for(n+=this.r.v,this.v._length=0,t=0;t<s;t+=1){let s=i*Math.cos(n),o=i*Math.sin(n),l=0===s&&0===o?0:o/Math.sqrt(s*s+o*o),p=0===s&&0===o?0:-s/Math.sqrt(s*s+o*o);s+=+this.p.v[0],o+=+this.p.v[1],this.v.setTripleAt(s,o,s-l*r*h*a,o-p*r*h*a,s+l*r*h*a,o+p*r*h*a,t,!0),n+=e*a}this.paths.length=0,this.paths[0]=this.v}}const bt=.5519;class Dt extends H{constructor(t,s){super(),this.v=B.newElement(),this.v.c=!0,this.localShapeCollection=J(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=s.d,this.initDynamicPropertyContainer(t),this.p=St(t,s.p,1,0,this),this.s=St(t,s.s,1,0,this),this.r=St(t,s.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}reset(){this.paths=this.localShapeCollection}getValue(t){t!==this.frameId&&(this.frameId=t,this.iterateDynamicProperties(t),this._mdf&&this.convertRectToPath())}convertRectToPath(){let t=this.p.v[0],s=this.p.v[1],e=this.s.v[0]/2,i=this.s.v[1]/2,h=Math.min(e,i,this.r.v),r=h*(1-.5519);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+e,s-i+h,t+e,s-i+h,t+e,s-i+r,0,!0),this.v.setTripleAt(t+e,s+i-h,t+e,s+i-r,t+e,s+i-h,1,!0),0!==h?(this.v.setTripleAt(t+e-h,s+i,t+e-h,s+i,t+e-r,s+i,2,!0),this.v.setTripleAt(t-e+h,s+i,t-e+r,s+i,t-e+h,s+i,3,!0),this.v.setTripleAt(t-e,s+i-h,t-e,s+i-h,t-e,s+i-r,4,!0),this.v.setTripleAt(t-e,s-i+h,t-e,s-i+r,t-e,s-i+h,5,!0),this.v.setTripleAt(t-e+h,s-i,t-e+h,s-i,t-e+r,s-i,6,!0),this.v.setTripleAt(t+e-h,s-i,t+e-r,s-i,t+e-h,s-i,7,!0)):(this.v.setTripleAt(t-e,s+i,t-e+r,s+i,t-e,s+i,2),this.v.setTripleAt(t-e,s-i,t-e,s-i+r,t-e,s-i,3))):(this.v.setTripleAt(t+e,s-i+h,t+e,s-i+r,t+e,s-i+h,0,!0),0!==h?(this.v.setTripleAt(t+e-h,s-i,t+e-h,s-i,t+e-r,s-i,1,!0),this.v.setTripleAt(t-e+h,s-i,t-e+r,s-i,t-e+h,s-i,2,!0),this.v.setTripleAt(t-e,s-i+h,t-e,s-i+h,t-e,s-i+r,3,!0),this.v.setTripleAt(t-e,s+i-h,t-e,s+i-r,t-e,s+i-h,4,!0),this.v.setTripleAt(t-e+h,s+i,t-e+h,s+i,t-e+r,s+i,5,!0),this.v.setTripleAt(t+e-h,s+i,t+e-r,s+i,t+e-h,s+i,6,!0),this.v.setTripleAt(t+e,s+i-h,t+e,s+i-h,t+e,s+i-r,7,!0)):(this.v.setTripleAt(t-e,s-i,t-e+r,s-i,t-e,s-i,1,!0),this.v.setTripleAt(t-e,s+i,t-e,s+i-r,t-e,s+i,2,!0),this.v.setTripleAt(t+e,s+i,t+e-r,s+i,t+e,s+i,3,!0)))}}var Ct=function(t,s,e){let i;return 3===e||4===e?i=(3===e?s.pt:s.ks).k.length?new Tt(t,s,e):new Mt(t,s,e):5===e?i=new Dt(t,s):6===e?i=new wt(t,s):7===e&&(i=new Pt(t,s)),i.k&&t.addDynamicProperty(i),i};class Lt extends H{constructor(t,s,e){super(),this.frameId=-1,this.elem=t,this.session=e,this.masksProperties=s||[],this.initDynamicPropertyContainer(t),this.viewData=q(this.masksProperties.length);const i=this.masksProperties.length;let h=!1;for(let t=0;t<i;t++)"n"!==this.masksProperties[t].mode&&(h=!0),this.viewData[t]=Ct(this,this.masksProperties[t],3),this.viewData[t].inv=this.masksProperties[t].inv;this.hasMasks=h}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.frameId=t)}}
15
+ ***************************************************************************** */function o(t,s){function e(){this.constructor=t}a(t,s),t.prototype=null===s?Object.create(s):(e.prototype=s.prototype,new e)}var l=function(){return l=Object.assign||function(t){for(var s,e=1,i=arguments.length;e<i;e++)for(var h in s=arguments[e])Object.prototype.hasOwnProperty.call(s,h)&&(t[h]=s[h]);return t},l.apply(this,arguments)};function p(t,s,e,i){var h,r=arguments.length,n=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,e,i);else for(var a=t.length-1;a>=0;a--)(h=t[a])&&(n=(r<3?h(n):r>3?h(s,e,n):h(s,e))||n);return r>3&&n&&Object.defineProperty(s,e,n),n}function c(t,s){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,s)}function u(t,s,e,i){return new(e||(e=Promise))((function(h,r){function n(t){try{o(i.next(t))}catch(t){r(t)}}function a(t){try{o(i.throw(t))}catch(t){r(t)}}function o(t){t.done?h(t.value):new e((function(s){s(t.value)})).then(n,a)}o((i=i.apply(t,s||[])).next())}))}function d(t,s){var e,i,h,r,n={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(e)throw new TypeError("Generator is already executing.");for(;n;)try{if(e=1,i&&(h=2&r[0]?i.return:r[0]?i.throw||((h=i.return)&&h.call(i),0):i.next)&&!(h=h.call(i,r[1])).done)return h;switch(i=0,h&&(r=[2&r[0],h.value]),r[0]){case 0:case 1:h=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,i=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if(!(h=n.trys,(h=h.length>0&&h[h.length-1])||6!==r[0]&&2!==r[0])){n=0;continue}if(3===r[0]&&(!h||r[1]>h[0]&&r[1]<h[3])){n.label=r[1];break}if(6===r[0]&&n.label<h[1]){n.label=h[1],h=r;break}if(h&&n.label<h[2]){n.label=h[2],n.ops.push(r);break}h[2]&&n.ops.pop(),n.trys.pop();continue}r=s.call(t,n)}catch(t){r=[6,t],i=0}finally{e=h=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function f(t){return Object.prototype.toString.call(t)}const m={copyJSON:function(t){return JSON.parse(JSON.stringify(t))},isArray:function(){let t=f([]);return function(s){return f(s)===t}}(),isString:function(){let t=f("s");return function(s){return f(s)===t}}(),isNumber:function(){let t=f(1);return function(s){return f(s)===t}}(),isFunction:function(){let t=f((function(){}));return function(s){return f(s)===t}}(),isUndefined:function(t){return void 0===t},isBoolean:function(){let t=f(!0);return function(s){return f(s)===t}}(),isObject:function(){let t=f({});return function(s){return f(s)===t}}(),random:function(t,s){return this.isArray(t)?t[~~(Math.random()*t.length)]:(this.isNumber(s)||(s=t||1,t=0),t+Math.random()*(s-t))},euclideanModulo:function(t,s){return(t%s+s)%s},codomainBounce:function(t,s,e){return t<s?2*s-t:t>e?2*e-t:t},clamp:function(t,s,e){return t<s?s:t>e?e:t},inRange:(t,s,e)=>t>=s&&t<=e,getAssets(t,s){for(let e=0;e<s.length;e++)if(t===s[e].id)return s[e];return console.error("have not assets name as",t),{}},rgb2hex:t=>(t[0]<<16)+(t[1]<<8)+(0|t[2])};class g{constructor(){this.listeners={},this.addEventListener=this.on,this.removeEventListener=this.off}on(t,s){return m.isFunction(s)?(m.isUndefined(this.listeners[t])&&(this.listeners[t]=[]),this.listeners[t].push(s),this):this}off(t,s){if(m.isUndefined(this.listeners[t]))return this;const e=this.listeners[t];let i=e.length;if(i>0)if(s)for(;i--;)e[i]===s&&e.splice(i,1);else e.length=0;return this}once(t,s){if(!m.isFunction(s))return this;const e=i=>{s(i),this.off(t,e)};return this.on(t,e),this}emit(t,...s){if(m.isUndefined(this.listeners[t]))return this;const e=(this.listeners[t]||[]).slice(0);for(let t=0;t<e.length;t++)e[t].apply(this,s);return this}}const y={},v={Ajax:"Ajax",Texture:"Texture"};var _=v,k=function(t,s){y[t]=s};function S(t,s,e){let i,h,r,n,a,o,l=t.length;for(h=0;h<l;h+=1)if(i=t[h],"ks"in i&&!i.completed){if(i.completed=!0,i.tt&&(t[h-1].td=i.tt),i.hasMask){let t=i.masksProperties;for(n=t.length,r=0;r<n;r+=1)if(t[r].pt.k.i)T(t[r].pt.k);else for(o=t[r].pt.k.length,a=0;a<o;a+=1)t[r].pt.k[a].s&&T(t[r].pt.k[a].s[0]),t[r].pt.k[a].e&&T(t[r].pt.k[a].e[0])}0===i.ty?(i.layers=x(i.refId,s),S(i.layers,s)):4===i.ty?M(i.shapes):5==i.ty&&L(i)}}function x(t,s){let e=0,i=s.length;for(;e<i;){if(s[e].id===t)return s[e].layers.__used?JSON.parse(JSON.stringify(s[e].layers)):(s[e].layers.__used=!0,s[e].layers);e+=1}}function M(t){let s,e,i;for(s=t.length-1;s>=0;s-=1)if("sh"==t[s].ty)if(t[s].ks.k.i)T(t[s].ks.k);else for(i=t[s].ks.k.length,e=0;e<i;e+=1)t[s].ks.k[e].s&&T(t[s].ks.k[e].s[0]),t[s].ks.k[e].e&&T(t[s].ks.k[e].e[0]);else"gr"==t[s].ty&&M(t[s].it)}function T(t){let s,e=t.i.length;for(s=0;s<e;s+=1)t.i[s][0]+=t.v[s][0],t.i[s][1]+=t.v[s][1],t.o[s][0]+=t.v[s][0],t.o[s][1]+=t.v[s][1]}function w(t,s){let e=s?s.split("."):[100,100,100];return t[0]>e[0]||!(e[0]>t[0])&&(t[1]>e[1]||!(e[1]>t[1])&&(t[2]>e[2]||!(e[2]>t[2])&&void 0))}let P=function(){let t=[4,4,14];function s(t){let s=t.t.d;t.t.d={k:[{s:s,t:0}]}}function e(t){let e,i=t.length;for(e=0;e<i;e+=1)5===t[e].ty&&s(t[e])}return function(s){if(w(t,s.v)&&(e(s.layers),s.assets)){let t,i=s.assets.length;for(t=0;t<i;t+=1)s.assets[t].layers&&e(s.assets[t].layers)}}}(),b=function(){let t=[4,7,99];return function(s){if(s.chars&&!w(t,s.v)){let t,e,i,h,r,n=s.chars.length;for(t=0;t<n;t+=1)if(s.chars[t].data&&s.chars[t].data.shapes)for(r=s.chars[t].data.shapes[0].it,i=r.length,e=0;e<i;e+=1)h=r[e].ks.k,h.__converted||(T(r[e].ks.k),h.__converted=!0)}}}(),D=function(){let t=[4,1,9];function s(t){let e,i,h,r=t.length;for(e=0;e<r;e+=1)if("gr"===t[e].ty)s(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(h=t[e].c.k.length,i=0;i<h;i+=1)t[e].c.k[i].s&&(t[e].c.k[i].s[0]/=255,t[e].c.k[i].s[1]/=255,t[e].c.k[i].s[2]/=255,t[e].c.k[i].s[3]/=255),t[e].c.k[i].e&&(t[e].c.k[i].e[0]/=255,t[e].c.k[i].e[1]/=255,t[e].c.k[i].e[2]/=255,t[e].c.k[i].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function e(t){let e,i=t.length;for(e=0;e<i;e+=1)4===t[e].ty&&s(t[e].shapes)}return function(s){if(w(t,s.v)&&(e(s.layers),s.assets)){let t,i=s.assets.length;for(t=0;t<i;t+=1)s.assets[t].layers&&e(s.assets[t].layers)}}}(),C=function(){let t=[4,4,18];function s(t){let e,i,h;for(e=t.length-1;e>=0;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(h=t[e].ks.k.length,i=0;i<h;i+=1)t[e].ks.k[i].s&&(t[e].ks.k[i].s[0].c=t[e].closed),t[e].ks.k[i].e&&(t[e].ks.k[i].e[0].c=t[e].closed);else"gr"==t[e].ty&&s(t[e].it)}function e(t){let e,i,h,r,n,a,o=t.length;for(i=0;i<o;i+=1){if(e=t[i],e.hasMask){let t=e.masksProperties;for(r=t.length,h=0;h<r;h+=1)if(t[h].pt.k.i)t[h].pt.k.c=t[h].cl;else for(a=t[h].pt.k.length,n=0;n<a;n+=1)t[h].pt.k[n].s&&(t[h].pt.k[n].s[0].c=t[h].cl),t[h].pt.k[n].e&&(t[h].pt.k[n].e[0].c=t[h].cl)}4===e.ty&&s(e.shapes)}}return function(s){if(w(t,s.v)&&(e(s.layers),s.assets)){let t,i=s.assets.length;for(t=0;t<i;t+=1)s.assets[t].layers&&e(s.assets[t].layers)}}}();function L(t,s){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var A=function(t,s){t.__complete||(D(t),P(t),b(t),C(t),S(t.layers,t.assets),t.__complete=!0)};let O="function"==typeof Float32Array;function F(t,s){return 1-3*s+3*t}function I(t,s){return 3*s-6*t}function E(t){return 3*t}function N(t,s,e){return((F(s,e)*t+I(s,e))*t+E(s))*t}function V(t,s,e){return 3*F(s,e)*t*t+2*I(s,e)*t+E(s)}function q(t,s,e,i){if(!(0<=t&&t<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");this.mX1=t,this.mY1=s,this.mX2=e,this.mY2=i,this.sampleValues=O?new Float32Array(11):new Array(11),this._preCompute(),this.get=this.get.bind(this)}q.prototype._preCompute=function(){if(this.mX1!==this.mY1||this.mX2!==this.mY2)for(let t=0;t<11;++t)this.sampleValues[t]=N(.1*t,this.mX1,this.mX2)},q.prototype._getTForX=function(t){let s=0,e=1;for(;10!==e&&this.sampleValues[e]<=t;++e)s+=.1;--e;let i=s+(t-this.sampleValues[e])/(this.sampleValues[e+1]-this.sampleValues[e])*.1,h=V(i,this.mX1,this.mX2);return h>=.001?function(t,s,e,i){for(let h=0;h<4;++h){let h=V(s,e,i);if(0===h)return s;s-=(N(s,e,i)-t)/h}return s}(t,i,this.mX1,this.mX2):0===h?i:function(t,s,e,i,h){let r,n,a=0;do{n=s+(e-s)/2,r=N(n,i,h)-t,r>0?e=n:s=n}while(Math.abs(r)>1e-7&&++a<10);return n}(t,s,s+.1,this.mX1,this.mX2)},q.prototype.get=function(t){return this.mX1===this.mY1&&this.mX2===this.mY2?t:0===t?0:1===t?1:N(this._getTForX(t),this.mY1,this.mY2)};const j={};var R=function(t,s,e,i,h){const r=h||("bez_"+t+"_"+s+"_"+e+"_"+i).replace(/\./g,"p");if(j[r])return j[r];const n=new q(t,s,e,i);return j[r]=n,n};let X;function Y(t){return new Array(t)}X="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,s){return"float32"===t?new Float32Array(s):"int16"===t?new Int16Array(s):"uint8c"===t?new Uint8ClampedArray(s):void 0}:function(t,s){let e=0;const i=[];let h;switch(t){case"int16":case"uint8c":h=1;break;default:h=1.1}for(e=0;e<s;e+=1)i.push(h);return i};var B=function(t){return t.concat(Y(t.length))};const G=function(t,s,e){let i=0,h=t,r=Y(h);return{newElement:function(){let t;return i?(i-=1,t=r[i]):t=s(),t},release:function(t){i===h&&(r=B(r),h*=2),e&&e(t),r[i]=t,i+=1}}},U=G(8,(function(){return X("float32",2)}));class z{constructor(){this.c=!1,this._length=0,this._maxLength=8,this.v=Y(this._maxLength),this.o=Y(this._maxLength),this.i=Y(this._maxLength)}setPathData(t,s){this.c=t,this.setLength(s);let e=0;for(;e<s;)this.v[e]=U.newElement(),this.o[e]=U.newElement(),this.i[e]=U.newElement(),e+=1}setLength(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t}doubleArrayLength(){this.v=this.v.concat(Y(this._maxLength)),this.i=this.i.concat(Y(this._maxLength)),this.o=this.o.concat(Y(this._maxLength)),this._maxLength*=2}setXYAt(t,s,e,i,h){let r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),e){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!h)&&(r[i]=U.newElement()),r[i][0]=t,r[i][1]=s}setTripleAt(t,s,e,i,h,r,n,a){this.setXYAt(t,s,"v",n,a),this.setXYAt(e,i,"o",n,a),this.setXYAt(h,r,"i",n,a)}reverse(){const t=new z;t.setPathData(this.c,this._length);const s=this.v,e=this.o,i=this.i;let h=0;this.c&&(t.setTripleAt(s[0][0],s[0][1],i[0][0],i[0][1],e[0][0],e[0][1],0,!1),h=1);let r=this._length-1;const n=this._length;for(let a=h;a<n;a+=1)t.setTripleAt(s[r][0],s[r][1],i[r][0],i[r][1],e[r][0],e[r][1],a,!1),r-=1;return t}}const W=G(4,(function(){return new z}),(function(t){const s=t._length;for(let e=0;e<s;e+=1)U.release(t.v[e]),U.release(t.i[e]),U.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}));W.clone=function(t){const s=W.newElement(),e=void 0===t._length?t.v.length:t._length;s.setLength(e),s.c=t.c;for(let i=0;i<e;i+=1)s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],i);return s};class J{constructor(){this._length=0,this._maxLength=4,this.shapes=Y(this._maxLength)}addShape(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(Y(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1}releaseShapes(){for(let t=0;t<this._length;t+=1)W.release(this.shapes[t]);this._length=0}}let H=0,K=4,Z=Y(K);var $=function(){let t;return H?(H-=1,t=Z[H]):t=new J,t};class Q{outTypeExpressionMode(){this._hasOutTypeExpression=!0,this.container&&this.container.outTypeExpressionMode()}addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0,t._hasOutTypeExpression&&this.outTypeExpressionMode())}iterateDynamicProperties(t){this._mdf=!1;const s=this.dynamicProperties.length;for(let e=0;e<s;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e]._mdf&&(this._mdf=!0)}initDynamicPropertyContainer(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1,this._hasOutTypeExpression=!1}}const tt=G(8,(function(){return{addedLength:0,percents:X("float32",200),lengths:X("float32",200)}})),st=G(8,(function(){return{lengths:[],totalLength:0}}),(function(t){const s=t.lengths.length;for(let e=0;e<s;e+=1)tt.release(t.lengths[e]);t.lengths.length=0}));function et(t,s,e,i,h,r){const n=t*i+s*h+e*r-h*i-r*t-e*s;return n>-.001&&n<.001}function it(t,s,e,i){let h,r=0;const n=[],a=[],o=tt.newElement(),l=e.length;for(let p=0;p<200;p+=1){const c=p/199;h=0;for(let r=0;r<l;r+=1){const o=Math.pow(1-c,3)*t[r]+3*Math.pow(1-c,2)*c*e[r]+3*(1-c)*Math.pow(c,2)*i[r]+Math.pow(c,3)*s[r];n[r]=o,null!==a[r]&&(h+=Math.pow(n[r]-a[r],2)),a[r]=n[r]}h&&(h=Math.sqrt(h),r+=h),o.percents[p]=c,o.lengths[p]=r}return o.addedLength=r,o}function ht(t){this.segmentLength=0,this.points=new Array(t)}function rt(t,s){this.partialLength=t,this.point=s}const nt={};function at(t,s){const e=s.percents,i=s.lengths,h=e.length;let r=Math.floor((h-1)*t);const n=t*s.addedLength;let a=0;if(r===h-1||0===r||n===i[r])return e[r];{const t=i[r]>n?-1:1;let s=!0;for(;s;)if(i[r]<=n&&i[r+1]>n?(a=(n-i[r])/(i[r+1]-i[r]),s=!1):r+=t,r<0||r>=h-1){if(r===h-1)return e[r];s=!1}return e[r]+(e[r+1]-e[r])*a}}const ot=X("float32",8);var lt={getSegmentsLength:function(t){const s=st.newElement(),e=t.c,i=t.v,h=t.o,r=t.i,n=t._length,a=s.lengths;let o=0,l=0;for(;l<n-1;l+=1)a[l]=it(i[l],i[l+1],h[l],r[l+1]),o+=a[l].addedLength;return e&&n&&(a[l]=it(i[l],i[0],h[l],r[0]),o+=a[l].addedLength),s.totalLength=o,s},getNewSegment:function(t,s,e,i,h,r,n){const a=at(h=h<0?0:h>1?1:h,n),o=at(r=r>1?1:r,n),l=t.length,p=1-a,c=1-o,u=p*p*p,d=a*p*p*3,f=a*a*p*3,m=a*a*a,g=p*p*c,y=a*p*c+p*a*c+p*p*o,v=a*a*c+p*a*o+a*p*o,_=a*a*o,k=p*c*c,S=a*c*c+p*o*c+p*c*o,x=a*o*c+p*o*o+a*c*o,M=a*o*o,T=c*c*c,w=o*c*c+c*o*c+c*c*o,P=o*o*c+c*o*o+o*c*o,b=o*o*o;for(let h=0;h<l;h+=1)ot[4*h]=Math.round(1e3*(u*t[h]+d*e[h]+f*i[h]+m*s[h]))/1e3,ot[4*h+1]=Math.round(1e3*(g*t[h]+y*e[h]+v*i[h]+_*s[h]))/1e3,ot[4*h+2]=Math.round(1e3*(k*t[h]+S*e[h]+x*i[h]+M*s[h]))/1e3,ot[4*h+3]=Math.round(1e3*(T*t[h]+w*e[h]+P*i[h]+b*s[h]))/1e3;return ot},getPointInSegment:function(t,s,e,i,h,r){const n=at(h,r),a=1-n;return[Math.round(1e3*(a*a*a*t[0]+(n*a*a+a*n*a+a*a*n)*e[0]+(n*n*a+a*n*n+n*a*n)*i[0]+n*n*n*s[0]))/1e3,Math.round(1e3*(a*a*a*t[1]+(n*a*a+a*n*a+a*a*n)*e[1]+(n*n*a+a*n*n+n*a*n)*i[1]+n*n*n*s[1]))/1e3]},buildBezierData:function(t,s,e,i){const h=(t[0]+"_"+t[1]+"_"+s[0]+"_"+s[1]+"_"+e[0]+"_"+e[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!nt[h]){let r,n,a=200,o=0,l=null;2===t.length&&(t[0]!=s[0]||t[1]!=s[1])&&et(t[0],t[1],s[0],s[1],t[0]+e[0],t[1]+e[1])&&et(t[0],t[1],s[0],s[1],s[0]+i[0],s[1]+i[1])&&(a=2);const p=new ht(a),c=e.length;for(let h=0;h<a;h+=1){n=Y(c);const u=h/(a-1);r=0;for(let h=0;h<c;h+=1){const a=Math.pow(1-u,3)*t[h]+3*Math.pow(1-u,2)*u*(t[h]+e[h])+3*(1-u)*Math.pow(u,2)*(s[h]+i[h])+Math.pow(u,3)*s[h];n[h]=a,null!==l&&(r+=Math.pow(n[h]-l[h],2))}r=Math.sqrt(r),o+=r,p.points[h]=new rt(r,n),l=n}p.segmentLength=o,nt[h]=p}return nt[h]},pointOnLine2D:et,pointOnLine3D:function(t,s,e,i,h,r,n,a,o){if(0===e&&0===r&&0===o)return et(t,s,i,h,n,a);const l=Math.sqrt(Math.pow(i-t,2)+Math.pow(h-s,2)+Math.pow(r-e,2)),p=Math.sqrt(Math.pow(n-t,2)+Math.pow(a-s,2)+Math.pow(o-e,2)),c=Math.sqrt(Math.pow(n-i,2)+Math.pow(a-h,2)+Math.pow(o-r,2));let u;return u=l>p?l>c?l-p-c:c-p-l:c>p?c-p-l:p-l-c,u>-1e-4&&u<1e-4}};const pt=Math.PI/180,ct=[0,0],ut=/(loopIn|loopOut)\(([^)]+)/,dt=/["']\w+["']/;class ft{constructor(t,s,e){this.begin=s,this.end=e,this.total=this.end-this.begin,this.type=t}update(t){return"in"===this.type?t>=this.begin?t:this.end-m.euclideanModulo(this.begin-t,this.total):"out"===this.type?t<=this.end?t:this.begin+m.euclideanModulo(t-this.end,this.total):void 0}}class mt{constructor(t,s,e){this.begin=s,this.end=e,this.total=this.end-this.begin,this.type=t}update(t){if("in"===this.type&&t<this.begin||"out"===this.type&&t>this.end){const s=t-this.end;return this.pingpong(s)}return t}pingpong(t){return Math.floor(t/this.total)%2?this.begin+m.euclideanModulo(t,this.total):this.end-m.euclideanModulo(t,this.total)}}const gt={loopIn(t,s,e){const i=t[0].t,h=t.length-1,r=t[Math.min(h,e)].t;switch(s){case"cycle":return new ft("in",i,r);case"pingpong":return new mt("in",i,r)}return null},loopOut(t,s,e){const i=t.length-1,h=t[Math.max(0,i-e)].t,r=t[i].t;switch(s){case"cycle":return new ft("out",h,r);case"pingpong":return new mt("out",h,r)}return null}};var yt=function(t){return t.x&&ut.test(t.x)},vt=function(t){const{name:s,mode:e,offset:i=0}=function(t){const s=t.match(ut),e=s[2].split(/\s*,\s*/).map((t=>dt.test(t)?t.replace(/"|'/g,""):parseInt(t)));return{name:s[1],mode:e[0],offset:e[1]}}(t.x),h=0===i?t.k.length-1:i;return gt[s]&&gt[s](t.k,e,h)};function _t(t){const s=t[0]*pt,e=t[1]*pt,i=t[2]*pt,h=Math.cos(s/2),r=Math.cos(e/2),n=Math.cos(i/2),a=Math.sin(s/2),o=Math.sin(e/2),l=Math.sin(i/2);return[a*o*n+h*r*l,a*r*n+h*o*l,h*o*n-a*r*l,h*r*n-a*o*l]}class kt{interpolateValue(t,s){let e;"multidimensional"===this.propType&&(e=X("float32",this.pv.length));let i,h,r,n,a,o,l,p,c=s.lastIndex,u=c,d=this.keyframes.length-1,f=!0;for(;f;){if(i=this.keyframes[u],h=this.keyframes[u+1],u===d-1&&t>=h.t){i.h&&(i=h),c=0;break}if(h.t>t){c=u;break}u<d-1?u+=1:(c=0,f=!1)}let m,g=h.t,y=i.t;if(i.to){i.bezierData||(i.bezierData=lt.buildBezierData(i.s,h.s||i.e,i.to,i.ti));let c=i.bezierData;if(t>=g||t<y){let s=t>=g?c.points.length-1:0;for(n=c.points[s].point.length,r=0;r<n;r+=1)e[r]=c.points[s].point[r]}else{i.__fnct?p=i.__fnct:(p=R(i.o.x,i.o.y,i.i.x,i.i.y,i.n).get,i.__fnct=p),a=p((t-y)/(g-y));let h,d=c.segmentLength*a,m=s.lastFrame<t&&s._lastKeyframeIndex===u?s._lastAddedLength:0;for(l=s.lastFrame<t&&s._lastKeyframeIndex===u?s._lastPoint:0,f=!0,o=c.points.length;f;){if(m+=c.points[l].partialLength,0===d||0===a||l===c.points.length-1){for(n=c.points[l].point.length,r=0;r<n;r+=1)e[r]=c.points[l].point[r];break}if(d>=m&&d<m+c.points[l+1].partialLength){for(h=(d-m)/c.points[l+1].partialLength,n=c.points[l].point.length,r=0;r<n;r+=1)e[r]=c.points[l].point[r]+(c.points[l+1].point[r]-c.points[l].point[r])*h;break}l<o-1?l+=1:f=!1}s._lastPoint=l,s._lastAddedLength=m-c.points[l].partialLength,s._lastKeyframeIndex=u}}else{let s,r,n,o,l;if(d=i.s.length,m=h.s||i.e,this.sh&&1!==i.h)t>=g?(e[0]=m[0],e[1]=m[1],e[2]=m[2]):t<=y?(e[0]=i.s[0],e[1]=i.s[1],e[2]=i.s[2]):function(t,s){const e=s[0],i=s[1],h=s[2],r=s[3],n=Math.atan2(2*i*r-2*e*h,1-2*i*i-2*h*h),a=Math.asin(2*e*i+2*h*r),o=Math.atan2(2*e*r-2*i*h,1-2*e*e-2*h*h);t[0]=n/pt,t[1]=a/pt,t[2]=o/pt}(e,function(t,s,e){const i=[],h=t[0],r=t[1],n=t[2],a=t[3];let o,l,p,c,u,d=s[0],f=s[1],m=s[2],g=s[3];return l=h*d+r*f+n*m+a*g,l<0&&(l=-l,d=-d,f=-f,m=-m,g=-g),1-l>1e-6?(o=Math.acos(l),p=Math.sin(o),c=Math.sin((1-e)*o)/p,u=Math.sin(e*o)/p):(c=1-e,u=e),i[0]=c*h+u*d,i[1]=c*r+u*f,i[2]=c*n+u*m,i[3]=c*a+u*g,i}(_t(i.s),_t(m),(t-y)/(g-y)));else for(u=0;u<d;u+=1)1!==i.h&&(t>=g?a=1:t<y?a=0:(i.o.x.constructor===Array?(i.__fnct||(i.__fnct=[]),i.__fnct[u]?p=i.__fnct[u]:(s=void 0===i.o.x[u]?i.o.x[0]:i.o.x[u],r=void 0===i.o.y[u]?i.o.y[0]:i.o.y[u],n=void 0===i.i.x[u]?i.i.x[0]:i.i.x[u],o=void 0===i.i.y[u]?i.i.y[0]:i.i.y[u],p=R(s,r,n,o).get,i.__fnct[u]=p)):i.__fnct?p=i.__fnct:(s=i.o.x,r=i.o.y,n=i.i.x,o=i.i.y,p=R(s,r,n,o).get,i.__fnct=p),a=p((t-y)/(g-y)))),m=h.s||i.e,l=1===i.h?i.s[u]:i.s[u]+(m[u]-i.s[u])*a,"multidimensional"===this.propType?e[u]=l:e=l}return s.lastIndex=c,e}getValueAtCurrentTime(t){let s=this.keyframes[0].t,e=this.keyframes[this.keyframes.length-1].t;if(!(t===this._caching.lastFrame||-999999!==this._caching.lastFrame&&(this._caching.lastFrame>=e&&t>=e||this._caching.lastFrame<s&&t<s))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);let s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}setVValue(t){let s;if("unidimensional"===this.propType)s=t*this.mult,Math.abs(this.v-s)>1e-5&&(this.v=s,this._mdf=!0);else{let e=0;const i=this.v.length;for(;e<i;)s=t[e]*this.mult,Math.abs(this.v[e]-s)>1e-5&&(this.v[e]=s,this._mdf=!0),e+=1}}processEffectsSequence(t){if(this.expression&&(t=this.expression.update(t)),t===this.frameId||!this.effectsSequence.length)return;if(this.lock)return void this.setVValue(this.pv);let s;this.lock=!0,this._mdf=this._isFirstFrame;let e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(s=0;s<e;s+=1)i=this.effectsSequence[s](t);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=t}addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}}class St extends kt{constructor(t,s,e,i){super(),this.propType="unidimensional",this.mult=e||1,this.data=s,this.v=e?s.k*e:s.k,this.pv=s.k,this._mdf=!1,this.elem=t,this.container=i,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=this.processEffectsSequence}}class xt extends kt{constructor(t,s,e,i){super(),this.propType="multidimensional",this.mult=e||1,this.data=s,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;const h=s.k.length;this.v=X("float32",h),this.pv=X("float32",h),this.vel=X("float32",h);for(let t=0;t<h;t+=1)this.v[t]=s.k[t]*this.mult,this.pv[t]=s.k[t];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class Mt extends kt{constructor(t,s,e,i){super(),this.propType="unidimensional",this.keyframes=s.k,this.frameId=-1,this._caching={lastFrame:-999999,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=s,this.mult=e||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=-999999,this.pv=-999999,this._isFirstFrame=!0,this.getValue=this.processEffectsSequence,this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this._hasOutTypeExpression=!1,yt(s)&&(this.expression=vt(s),this._hasOutTypeExpression="out"===this.expression.type)}}class Tt extends kt{constructor(t,s,e,i){let h;super(),this.propType="multidimensional";let r,n,a,o,l=s.k.length;for(h=0;h<l-1;h+=1)s.k[h].to&&s.k[h].s&&s.k[h+1]&&s.k[h+1].s&&(r=s.k[h].s,n=s.k[h+1].s,a=s.k[h].to,o=s.k[h].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&lt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+a[0],r[1]+a[1])&&lt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&lt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+a[0],r[1]+a[1],r[2]+a[2])&&lt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(s.k[h].to=null,s.k[h].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===a[0]&&0===a[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===a[2]&&0===o[2])&&(s.k[h].to=null,s.k[h].ti=null));this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this.keyframes=s.k,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=e||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=this.processEffectsSequence,this.frameId=-1;let p=s.k[0].s.length;for(this.v=X("float32",p),this.pv=X("float32",p),h=0;h<p;h+=1)this.v[h]=-999999,this.pv[h]=-999999;this._caching={lastFrame:-999999,lastIndex:0,value:X("float32",p)},this._hasOutTypeExpression=!1,yt(s)&&(this.expression=vt(s),this._hasOutTypeExpression="out"===this.expression.type)}}var wt=function(t,s,e,i,h){let r;if(s.k.length)if("number"==typeof s.k[0])r=new xt(t,s,i,h);else switch(e){case 0:r=new Mt(t,s,i,h);break;case 1:r=new Tt(t,s,i,h)}else r=new St(t,s,i,h);return r.effectsSequence.length&&h.addDynamicProperty(r),r};class Pt{interpolateShape(t,s,e){let i,h,r,n,a,o,l,p,c,u=e.lastIndex,d=this.keyframes;if(t<d[0].t)i=d[0].s[0],r=!0,u=0;else if(t>=d[d.length-1].t)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{let s,e,n=u,a=d.length-1,o=!0;for(;o&&(s=d[n],e=d[n+1],!(e.t>t));)n<a-1?n+=1:o=!1;if(r=1===s.h,u=n,!r){if(t>=e.t)p=1;else if(t<s.t)p=0;else{let i;s.__fnct?i=s.__fnct:(i=R(s.o.x,s.o.y,s.i.x,s.i.y).get,s.__fnct=i),p=i((t-s.t)/(e.t-s.t))}h=e.s?e.s[0]:s.e[0]}i=s.s[0]}for(o=s._length,l=i.i[0].length,e.lastIndex=u,n=0;n<o;n+=1)for(a=0;a<l;a+=1)c=r?i.i[n][a]:i.i[n][a]+(h.i[n][a]-i.i[n][a])*p,s.i[n][a]=c,c=r?i.o[n][a]:i.o[n][a]+(h.o[n][a]-i.o[n][a])*p,s.o[n][a]=c,c=r?i.v[n][a]:i.v[n][a]+(h.v[n][a]-i.v[n][a])*p,s.v[n][a]=c}interpolateShapeCurrentTime(t){let s=this.keyframes[0].t,e=this.keyframes[this.keyframes.length-1].t,i=this._caching.lastFrame;return-999999!==i&&(i<s&&t<s||i>e&&t>e)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}resetShape(){this.paths=this.localShapeCollection}shapesEqual(t,s){if(t._length!==s._length||t.c!==s.c)return!1;let e,i=t._length;for(e=0;e<i;e+=1)if(t.v[e][0]!==s.v[e][0]||t.v[e][1]!==s.v[e][1]||t.o[e][0]!==s.o[e][0]||t.o[e][1]!==s.o[e][1]||t.i[e][0]!==s.i[e][0]||t.i[e][1]!==s.i[e][1])return!1;return!0}setVValue(t){this.shapesEqual(this.v,t)||(this.v=W.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}processEffectsSequence(t){if(t===this.frameId)return;if(!this.effectsSequence.length)return void(this._mdf=!1);if(this.lock)return void this.setVValue(this.pv);this.lock=!0,this._mdf=!1;let s,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,i=this.effectsSequence.length;for(s=0;s<i;s+=1)e=this.effectsSequence[s](t);this.setVValue(e),this.lock=!1,this.frameId=t}addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}}class bt extends Pt{constructor(t,s,e){super(),this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=s,this.k=!1,this.kf=!1,this._mdf=!1;let i=3===e?s.pt.k:s.ks.k;this.v=W.clone(i),this.pv=W.clone(this.v),this.localShapeCollection=$(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=this.resetShape,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class Dt extends Pt{constructor(t,s,e){super(),this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.keyframes=3===e?s.pt.k:s.ks.k,this.k=!0,this.kf=!0;let i=this.keyframes[0].s[0].i.length;this.v=W.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=W.clone(this.v),this.localShapeCollection=$(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=-999999,this.reset=this.resetShape,this._caching={lastFrame:-999999,lastIndex:0},this.effectsSequence=[this.interpolateShapeCurrentTime.bind(this)],this.getValue=this.processEffectsSequence,this._hasOutTypeExpression=!1,yt(s)&&(this.expression=vt(s),this._hasOutTypeExpression="out"===this.expression.type)}}class Ct extends Q{constructor(t,s){super(),this.v=W.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=$(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=s.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=wt(t,s.p,1,0,this),this.s=wt(t,s.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}reset(){this.paths=this.localShapeCollection}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.frameId=t,this._mdf&&this.convertEllToPath())}convertEllToPath(){const t=this.p.v[0],s=this.p.v[1],e=this.s.v[0]/2,i=this.s.v[1]/2,h=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=s-i,r.v[1][0]=h?t+e:t-e,r.v[1][1]=s,r.v[2][0]=t,r.v[2][1]=s+i,r.v[3][0]=h?t-e:t+e,r.v[3][1]=s,r.i[0][0]=h?t-e*At:t+e*At,r.i[0][1]=s-i,r.i[1][0]=h?t+e:t-e,r.i[1][1]=s-i*At,r.i[2][0]=h?t+e*At:t-e*At,r.i[2][1]=s+i,r.i[3][0]=h?t-e:t+e,r.i[3][1]=s+i*At,r.o[0][0]=h?t+e*At:t-e*At,r.o[0][1]=s-i,r.o[1][0]=h?t+e:t-e,r.o[1][1]=s+i*At,r.o[2][0]=h?t-e*At:t+e*At,r.o[2][1]=s+i,r.o[3][0]=h?t-e:t+e,r.o[3][1]=s-i*At}}class Lt extends Q{constructor(t,s){super(),this.v=W.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=s,this.frameId=-1,this.d=s.d,this.initDynamicPropertyContainer(t),1===s.sy?(this.ir=wt(t,s.ir,0,0,this),this.is=wt(t,s.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=wt(t,s.pt,0,0,this),this.p=wt(t,s.p,1,0,this),this.r=wt(t,s.r,0,pt,this),this.or=wt(t,s.or,0,0,this),this.os=wt(t,s.os,0,.01,this),this.localShapeCollection=$(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}reset(){this.paths=this.localShapeCollection}getValue(t){t!==this.frameId&&(this.frameId=t,this.iterateDynamicProperties(t),this._mdf&&this.convertToPath())}convertStarToPath(){let t,s,e,i,h=2*Math.floor(this.pt.v),r=2*Math.PI/h,n=!0,a=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,c=2*Math.PI*a/(2*h),u=2*Math.PI*o/(2*h),d=-Math.PI/2;d+=this.r.v;let f=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<h;t+=1){s=n?a:o,e=n?l:p,i=n?c:u;let h=s*Math.cos(d),m=s*Math.sin(d),g=0===h&&0===m?0:m/Math.sqrt(h*h+m*m),y=0===h&&0===m?0:-h/Math.sqrt(h*h+m*m);h+=+this.p.v[0],m+=+this.p.v[1],this.v.setTripleAt(h,m,h-g*i*e*f,m-y*i*e*f,h+g*i*e*f,m+y*i*e*f,t,!0),n=!n,d+=r*f}}convertPolygonToPath(){let t,s=Math.floor(this.pt.v),e=2*Math.PI/s,i=this.or.v,h=this.os.v,r=2*Math.PI*i/(4*s),n=-Math.PI/2,a=3===this.data.d?-1:1;for(n+=this.r.v,this.v._length=0,t=0;t<s;t+=1){let s=i*Math.cos(n),o=i*Math.sin(n),l=0===s&&0===o?0:o/Math.sqrt(s*s+o*o),p=0===s&&0===o?0:-s/Math.sqrt(s*s+o*o);s+=+this.p.v[0],o+=+this.p.v[1],this.v.setTripleAt(s,o,s-l*r*h*a,o-p*r*h*a,s+l*r*h*a,o+p*r*h*a,t,!0),n+=e*a}this.paths.length=0,this.paths[0]=this.v}}const At=.5519;class Ot extends Q{constructor(t,s){super(),this.v=W.newElement(),this.v.c=!0,this.localShapeCollection=$(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=s.d,this.initDynamicPropertyContainer(t),this.p=wt(t,s.p,1,0,this),this.s=wt(t,s.s,1,0,this),this.r=wt(t,s.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}reset(){this.paths=this.localShapeCollection}getValue(t){t!==this.frameId&&(this.frameId=t,this.iterateDynamicProperties(t),this._mdf&&this.convertRectToPath())}convertRectToPath(){let t=this.p.v[0],s=this.p.v[1],e=this.s.v[0]/2,i=this.s.v[1]/2,h=Math.min(e,i,this.r.v),r=h*(1-.5519);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+e,s-i+h,t+e,s-i+h,t+e,s-i+r,0,!0),this.v.setTripleAt(t+e,s+i-h,t+e,s+i-r,t+e,s+i-h,1,!0),0!==h?(this.v.setTripleAt(t+e-h,s+i,t+e-h,s+i,t+e-r,s+i,2,!0),this.v.setTripleAt(t-e+h,s+i,t-e+r,s+i,t-e+h,s+i,3,!0),this.v.setTripleAt(t-e,s+i-h,t-e,s+i-h,t-e,s+i-r,4,!0),this.v.setTripleAt(t-e,s-i+h,t-e,s-i+r,t-e,s-i+h,5,!0),this.v.setTripleAt(t-e+h,s-i,t-e+h,s-i,t-e+r,s-i,6,!0),this.v.setTripleAt(t+e-h,s-i,t+e-r,s-i,t+e-h,s-i,7,!0)):(this.v.setTripleAt(t-e,s+i,t-e+r,s+i,t-e,s+i,2),this.v.setTripleAt(t-e,s-i,t-e,s-i+r,t-e,s-i,3))):(this.v.setTripleAt(t+e,s-i+h,t+e,s-i+r,t+e,s-i+h,0,!0),0!==h?(this.v.setTripleAt(t+e-h,s-i,t+e-h,s-i,t+e-r,s-i,1,!0),this.v.setTripleAt(t-e+h,s-i,t-e+r,s-i,t-e+h,s-i,2,!0),this.v.setTripleAt(t-e,s-i+h,t-e,s-i+h,t-e,s-i+r,3,!0),this.v.setTripleAt(t-e,s+i-h,t-e,s+i-r,t-e,s+i-h,4,!0),this.v.setTripleAt(t-e+h,s+i,t-e+h,s+i,t-e+r,s+i,5,!0),this.v.setTripleAt(t+e-h,s+i,t+e-r,s+i,t+e-h,s+i,6,!0),this.v.setTripleAt(t+e,s+i-h,t+e,s+i-h,t+e,s+i-r,7,!0)):(this.v.setTripleAt(t-e,s-i,t-e+r,s-i,t-e,s-i,1,!0),this.v.setTripleAt(t-e,s+i,t-e,s+i-r,t-e,s+i,2,!0),this.v.setTripleAt(t+e,s+i,t+e-r,s+i,t+e,s+i,3,!0)))}}var Ft=function(t,s,e){let i;return 3===e||4===e?i=(3===e?s.pt:s.ks).k.length?new Dt(t,s,e):new bt(t,s,e):5===e?i=new Ot(t,s):6===e?i=new Ct(t,s):7===e&&(i=new Lt(t,s)),i.k&&t.addDynamicProperty(i),i};class It extends Q{constructor(t,s,e){super(),this.frameId=-1,this.elem=t,this.session=e,this.masksProperties=s||[],this.initDynamicPropertyContainer(t),this.viewData=Y(this.masksProperties.length);const i=this.masksProperties.length;let h=!1;for(let t=0;t<i;t++)"n"!==this.masksProperties[t].mode&&(h=!0),this.viewData[t]=Ft(this,this.masksProperties[t],3),this.viewData[t].inv=this.masksProperties[t].inv;this.hasMasks=h}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.frameId=t)}}
16
16
  /*!
17
17
  Transformation Matrix v2.0
18
18
  (c) Epistemex 2014-2015
@@ -20,4 +20,4 @@ and limitations under the License.
20
20
  By Ken Fyrstenberg
21
21
  Contributions by leeoniya.
22
22
  License: MIT, header required.
23
- */var At=function(){var t=Math.cos,s=Math.sin,e=Math.tan,i=Math.round;function h(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function r(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(i,-h,0,0,h,i,0,0,0,0,1,0,0,0,0,1)}function n(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(1,0,0,0,0,i,-h,0,0,h,i,0,0,0,0,1)}function a(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(i,0,h,0,0,1,0,0,-h,0,i,0,0,0,0,1)}function o(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(i,-h,0,0,h,i,0,0,0,0,1,0,0,0,0,1)}function l(t,s){return this._t(1,s,t,1,0,0)}function p(t,s){return this.shear(e(t),e(s))}function c(i,h){var r=t(h),n=s(h);return this._t(r,n,0,0,-n,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,e(i),1,0,0,0,0,1,0,0,0,0,1)._t(r,-n,0,0,n,r,0,0,0,0,1,0,0,0,0,1)}function u(t,s,e){return e||0===e||(e=1),1===t&&1===s&&1===e?this:this._t(t,0,0,0,0,s,0,0,0,0,e,0,0,0,0,1)}function d(t,s,e,i,h,r,n,a,o,l,p,c,u,d,f,m){return this.props[0]=t,this.props[1]=s,this.props[2]=e,this.props[3]=i,this.props[4]=h,this.props[5]=r,this.props[6]=n,this.props[7]=a,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=c,this.props[12]=u,this.props[13]=d,this.props[14]=f,this.props[15]=m,this}function f(t,s,e){return e=e||0,0!==t||0!==s||0!==e?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,s,e,1):this}function m(t,s,e,i,h,r,n,a,o,l,p,c,u,d,f,m){var g=this.props;if(1===t&&0===s&&0===e&&0===i&&0===h&&1===r&&0===n&&0===a&&0===o&&0===l&&1===p&&0===c)return g[12]=g[12]*t+g[15]*u,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*f,g[15]=g[15]*m,this._identityCalculated=!1,this;var y=g[0],v=g[1],_=g[2],k=g[3],S=g[4],x=g[5],M=g[6],T=g[7],w=g[8],P=g[9],b=g[10],D=g[11],C=g[12],L=g[13],A=g[14],O=g[15];return g[0]=y*t+v*h+_*o+k*u,g[1]=y*s+v*r+_*l+k*d,g[2]=y*e+v*n+_*p+k*f,g[3]=y*i+v*a+_*c+k*m,g[4]=S*t+x*h+M*o+T*u,g[5]=S*s+x*r+M*l+T*d,g[6]=S*e+x*n+M*p+T*f,g[7]=S*i+x*a+M*c+T*m,g[8]=w*t+P*h+b*o+D*u,g[9]=w*s+P*r+b*l+D*d,g[10]=w*e+P*n+b*p+D*f,g[11]=w*i+P*a+b*c+D*m,g[12]=C*t+L*h+A*o+O*u,g[13]=C*s+L*r+A*l+O*d,g[14]=C*e+L*n+A*p+O*f,g[15]=C*i+L*a+A*c+O*m,this._identityCalculated=!1,this}function g(){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}function y(t){for(var s=0;s<16;){if(t.props[s]!==this.props[s])return!1;s+=1}return!0}function v(t){var s;for(s=0;s<16;s+=1)t.props[s]=this.props[s]}function _(t){var s;for(s=0;s<16;s+=1)this.props[s]=t[s]}function k(t,s,e){return{x:t*this.props[0]+s*this.props[4]+e*this.props[8]+this.props[12],y:t*this.props[1]+s*this.props[5]+e*this.props[9]+this.props[13],z:t*this.props[2]+s*this.props[6]+e*this.props[10]+this.props[14]}}function S(t,s,e){return t*this.props[0]+s*this.props[4]+e*this.props[8]+this.props[12]}function x(t,s,e){return t*this.props[1]+s*this.props[5]+e*this.props[9]+this.props[13]}function M(t,s,e){return t*this.props[2]+s*this.props[6]+e*this.props[10]+this.props[14]}function T(t){var s=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/s,i=-this.props[1]/s,h=-this.props[4]/s,r=this.props[0]/s,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/s,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/s;return[t[0]*e+t[1]*h+n,t[0]*i+t[1]*r+a,0]}function w(t){var s,e=t.length,i=[];for(s=0;s<e;s+=1)i[s]=T(t[s]);return i}function P(t,s,e){var i=V("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=s[0],i[3]=s[1],i[4]=e[0],i[5]=e[1];else{var h=this.props[0],r=this.props[1],n=this.props[4],a=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*h+t[1]*n+o,i[1]=t[0]*r+t[1]*a+l,i[2]=s[0]*h+s[1]*n+o,i[3]=s[0]*r+s[1]*a+l,i[4]=e[0]*h+e[1]*n+o,i[5]=e[0]*r+e[1]*a+l}return i}function b(t,s,e){return this.isIdentity()?[t,s,e]:[t*this.props[0]+s*this.props[4]+e*this.props[8]+this.props[12],t*this.props[1]+s*this.props[5]+e*this.props[9]+this.props[13],t*this.props[2]+s*this.props[6]+e*this.props[10]+this.props[14]]}function D(t,s){if(this.isIdentity())return t+","+s;var e=this.props;return Math.round(100*(t*e[0]+s*e[4]+e[12]))/100+","+Math.round(100*(t*e[1]+s*e[5]+e[13]))/100}function C(){for(var t=0,s=this.props,e="matrix3d(";t<16;)e+=i(1e4*s[t])/1e4,e+=15===t?")":",",t+=1;return e}function L(t){return t<1e-6&&t>0||t>-1e-6&&t<0?i(1e4*t)/1e4:t}function A(){var t=this.props;return"matrix("+L(t[0])+","+L(t[1])+","+L(t[4])+","+L(t[5])+","+L(t[12])+","+L(t[13])+")"}return function(){this.reset=h,this.rotate=r,this.rotateX=n,this.rotateY=a,this.rotateZ=o,this.skew=p,this.skewFromAxis=c,this.shear=l,this.scale=u,this.setTransform=d,this.translate=f,this.transform=m,this.applyToPoint=k,this.applyToX=S,this.applyToY=x,this.applyToZ=M,this.applyToPointArray=b,this.applyToTriplePoints=P,this.applyToPointStringified=D,this.toCSS=C,this.to2dCSS=A,this.clone=v,this.cloneFromProps=_,this.equals=y,this.inversePoints=w,this.inversePoint=T,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=V("float32",16),this.reset()}}();class Ot{constructor(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}addTransformSequence(t){const s=t.length;let e="_";for(let i=0;i<s;i+=1)e+=t[i].transform.key+"_";let i=this.sequences[e];return i||(i={transforms:[].concat(t),finalTransform:new At,_mdf:!1},this.sequences[e]=i,this.sequenceList.push(i)),i}processSequence(t,s){let e=0,i=s;const h=t.transforms.length;for(;e<h&&!s;){if(t.transforms[e].transform.mProps._mdf){i=!0;break}e+=1}if(i){let s;for(t.finalTransform.reset(),e=h-1;e>=0;e-=1)s=t.transforms[e].transform.mProps.v.props,t.finalTransform.transform(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12],s[13],s[14],s[15])}t._mdf=i}processSequences(t){const s=this.sequenceList.length;for(let e=0;e<s;e+=1)this.processSequence(this.sequenceList[e],t)}getNewKey(){return"_"+this.transform_key_count++}}class Ft{constructor(t,s){this.elem=t,this.pos=s}}class It{constructor(t,s,e,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];let h=4;"rc"==s.ty?h=5:"el"==s.ty?h=6:"sr"==s.ty&&(h=7),this.sh=Ct(t,s,h);const r=e.length;for(let t=0;t<r;t+=1)if(!e[t].closed){const s={transforms:i.addTransformSequence(e[t].transforms),trNodes:[]};this.styledShapes.push(s),e[t].elements.push(s)}}setAsAnimated(){this._isAnimated=!0}}const Et={};function Nt(t){return Et[t]}var Vt={Null:"Null",Path:"Path",Shape:"Shape",Solid:"Solid",Sprite:"Sprite",Component:"Component",Container:"Container"},qt=function(t,s){Et[t]=s};class jt{constructor(t,s,e){this.elem=t,this.data=s,this.type=s.ty,this.preTransforms=e,this.transforms=[],this.elements=[],this.closed=!0===s.hd,this.displayType=Vt.Path;const i=Nt(this.displayType);this.display=new i(this,s),this.elem.innerDisplay?this.elem.innerDisplay.addChild(this.display):this.elem.display.addChild(this.display)}updateGrahpics(){this.display.updateLottieGrahpics(this)}}class Rt extends H{constructor(t,s,e){if(super(),this.elem=t,this.frameId=-1,this.propType="transform",this.data=s,this.v=new At,this.pre=new At,this.appliedTransformations=0,this.initDynamicPropertyContainer(e||t),s.p&&s.p.s?(this.px=St(t,s.p.x,0,0,this),this.py=St(t,s.p.y,0,0,this),s.p.z&&(this.pz=St(t,s.p.z,0,0,this))):this.p=St(t,s.p||{k:[0,0,0]},1,0,this),s.rx){if(this.rx=St(t,s.rx,0,nt,this),this.ry=St(t,s.ry,0,nt,this),this.rz=St(t,s.rz,0,nt,this),s.or.k[0].ti){let t,e=s.or.k.length;for(t=0;t<e;t+=1)s.or.k[t].to=s.or.k[t].ti=null}this.or=St(t,s.or,1,nt,this),this.or.sh=!0}else this.r=St(t,s.r||{k:0},0,nt,this);s.sk&&(this.sk=St(t,s.sk,0,nt,this),this.sa=St(t,s.sa,0,nt,this)),this.a=St(t,s.a||{k:[0,0,0]},1,0,this),this.s=St(t,s.s||{k:[100,100,100]},1,.01,this),s.o?this.o=St(t,s.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(-999999,!0)}getValue(t,s){if(t!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||s){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&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,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){let t,s;const e=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(t=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),s=this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(t=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),s=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(t=this.p.pv,s=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){t=[],s=[];let i=this.px,h=this.py;i._caching.lastFrame+i.offsetTime<=i.keyframes[0].t?(t[0]=i.getValueAtTime((i.keyframes[0].t+.01)/e,0),t[1]=h.getValueAtTime((h.keyframes[0].t+.01)/e,0),s[0]=i.getValueAtTime(i.keyframes[0].t/e,0),s[1]=h.getValueAtTime(h.keyframes[0].t/e,0)):i._caching.lastFrame+i.offsetTime>=i.keyframes[i.keyframes.length-1].t?(t[0]=i.getValueAtTime(i.keyframes[i.keyframes.length-1].t/e,0),t[1]=h.getValueAtTime(h.keyframes[h.keyframes.length-1].t/e,0),s[0]=i.getValueAtTime((i.keyframes[i.keyframes.length-1].t-.01)/e,0),s[1]=h.getValueAtTime((h.keyframes[h.keyframes.length-1].t-.01)/e,0)):(t=[i.pv,h.pv],s[0]=i.getValueAtTime((i._caching.lastFrame+i.offsetTime-.01)/e,i.offsetTime),s[1]=h.getValueAtTime((h._caching.lastFrame+h.offsetTime-.01)/e,h.offsetTime))}else t=s=at;this.v.rotate(-Math.atan2(t[1]-s[1],t[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=t}}precalculateMatrix(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){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||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}}applyToMatrix(t){let s=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||s,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,this.sa.v),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}}function Xt(t,s,e){return new Rt(t,s,e)}class Yt extends H{initModifierProperties(){}addShapeToModifier(){}addShape(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);const s={shape:t.sh,data:t,localShapeCollection:J()};this.shapes.push(s),this.addShapeToModifier(s),this._isAnimated&&t.setAsAnimated()}}init(t,s){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,s),this.frameId=-999999,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)}processKeys(t){t!==this.frameId&&(this.frameId=t,this.iterateDynamicProperties(t))}}const Bt={};function Gt(t,s){Bt[t]||(Bt[t]=s)}Gt("tm",class extends Yt{initModifierProperties(t,s){this.s=St(t,s.s,0,.01,this),this.e=St(t,s.e,0,.01,this),this.o=St(t,s.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=s.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length}addShapeToModifier(t){t.pathsData=[]}calculateShapeEdges(t,s,e,i,h){let r=[];s<=1?r.push({s:t,e:s}):t>=1?r.push({s:t-1,e:s-1}):(r.push({s:t,e:1}),r.push({s:0,e:s-1}));let n,a,o=[],l=r.length;for(n=0;n<l;n+=1)if(a=r[n],a.e*h<i||a.s*h>i+e);else{let t,s;t=a.s*h<=i?0:(a.s*h-i)/e,s=a.e*h>=i+e?1:(a.e*h-i)/e,o.push([t,s])}return o.length||o.push([0,0]),o}releasePathsData(t){const s=t.length;for(let e=0;e<s;e+=1)Z.release(t[e]);return t.length=0,t}processShapes(t){let s,e,i,h;if(this._mdf||t){let t=this.o.v%360/360;if(t<0&&(t+=1),s=(this.s.v>1?1:this.s.v<0?0:this.s.v)+t,e=(this.e.v>1?1:this.e.v<0?0:this.e.v)+t,s>e){let t=s;s=e,e=t}s=1e-4*Math.round(1e4*s),e=1e-4*Math.round(1e4*e),this.sValue=s,this.eValue=e}else s=this.sValue,e=this.eValue;let r,n,a,o,l,p=this.shapes.length,c=0;if(e===s)for(h=0;h<p;h+=1)this.shapes[h].localShapeCollection.releaseShapes(),this.shapes[h].shape._mdf=!0,this.shapes[h].shape.paths=this.shapes[h].localShapeCollection,this._mdf&&(this.shapes[h].pathsData.length=0);else if(1===e&&0===s||0===e&&1===s){if(this._mdf)for(h=0;h<p;h+=1)this.shapes[h].pathsData.length=0,this.shapes[h].shape._mdf=!0}else{let u,d,f=[];for(h=0;h<p;h+=1)if(u=this.shapes[h],u.shape._mdf||this._mdf||t||2===this.m){if(i=u.shape.paths,n=i._length,l=0,!u.shape._mdf&&u.pathsData.length)l=u.totalShapeLength;else{for(a=this.releasePathsData(u.pathsData),r=0;r<n;r+=1)o=rt.getSegmentsLength(i.shapes[r]),a.push(o),l+=o.totalLength;u.totalShapeLength=l,u.pathsData=a}c+=l,u.shape._mdf=!0}else u.shape.paths=u.localShapeCollection;let m,g=s,y=e,v=0;for(h=p-1;h>=0;h-=1)if(u=this.shapes[h],u.shape._mdf){for(d=u.localShapeCollection,d.releaseShapes(),2===this.m&&p>1?(m=this.calculateShapeEdges(s,e,u.totalShapeLength,v,c),v+=u.totalShapeLength):m=[[g,y]],n=m.length,r=0;r<n;r+=1){g=m[r][0],y=m[r][1],f.length=0,y<=1?f.push({s:u.totalShapeLength*g,e:u.totalShapeLength*y}):g>=1?f.push({s:u.totalShapeLength*(g-1),e:u.totalShapeLength*(y-1)}):(f.push({s:u.totalShapeLength*g,e:u.totalShapeLength}),f.push({s:0,e:u.totalShapeLength*(y-1)}));let t=this.addShapes(u,f[0]);if(f[0].s!==f[0].e){if(f.length>1)if(u.shape.paths.shapes[u.shape.paths._length-1].c){let s=t.pop();this.addPaths(t,d),t=this.addShapes(u,f[1],s)}else this.addPaths(t,d),t=this.addShapes(u,f[1]);this.addPaths(t,d)}}u.shape.paths=d}}}addPaths(t,s){const e=t.length;for(let i=0;i<e;i+=1)s.addShape(t[i])}addSegment(t,s,e,i,h,r,n){h.setXYAt(s[0],s[1],"o",r),h.setXYAt(e[0],e[1],"i",r+1),n&&h.setXYAt(t[0],t[1],"v",r),h.setXYAt(i[0],i[1],"v",r+1)}addSegmentFromArray(t,s,e,i){s.setXYAt(t[1],t[5],"o",e),s.setXYAt(t[2],t[6],"i",e+1),i&&s.setXYAt(t[0],t[4],"v",e),s.setXYAt(t[3],t[7],"v",e+1)}addShapes(t,s,e){let i,h,r,n,a,o,l,p,c=t.pathsData,u=t.shape.paths.shapes,d=t.shape.paths._length,f=0,m=[],g=!0;for(e?(a=e._length,p=e._length):(e=B.newElement(),a=0,p=0),m.push(e),i=0;i<d;i+=1){for(o=c[i].lengths,e.c=u[i].c,r=u[i].c?o.length:o.length+1,h=1;h<r;h+=1)if(n=o[h-1],f+n.addedLength<s.s)f+=n.addedLength,e.c=!1;else{if(f>s.e){e.c=!1;break}s.s<=f&&s.e>=f+n.addedLength?(this.addSegment(u[i].v[h-1],u[i].o[h-1],u[i].i[h],u[i].v[h],e,a,g),g=!1):(l=rt.getNewSegment(u[i].v[h-1],u[i].v[h],u[i].o[h-1],u[i].i[h],(s.s-f)/n.addedLength,(s.e-f)/n.addedLength,o[h-1]),this.addSegmentFromArray(l,e,a,g),g=!1,e.c=!1),f+=n.addedLength,a+=1}if(u[i].c&&o.length){if(n=o[h-1],f<=s.e){let t=o[h-1].addedLength;s.s<=f&&s.e>=f+t?(this.addSegment(u[i].v[h-1],u[i].o[h-1],u[i].i[0],u[i].v[0],e,a,g),g=!1):(l=rt.getNewSegment(u[i].v[h-1],u[i].v[0],u[i].o[h-1],u[i].i[0],(s.s-f)/t,(s.e-f)/t,o[h-1]),this.addSegmentFromArray(l,e,a,g),g=!1,e.c=!1)}else e.c=!1;f+=n.addedLength,a+=1}if(e._length&&(e.setXYAt(e.v[p][0],e.v[p][1],"i",p),e.setXYAt(e.v[e._length-1][0],e.v[e._length-1][1],"o",e._length-1)),f>s.e)break;i<d-1&&(e=B.newElement(),g=!0,m.push(e),a=0)}return m}}),Gt("rd",class extends Yt{initModifierProperties(t,s){this.getValue=this.processKeys,this.rd=St(t,s.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length}processPath(t,s){const e=B.newElement();let i;e.c=t.c;let h,r,n,a,o,l,p,c,u,d,f,m,g=t._length,y=0;for(i=0;i<g;i+=1)h=t.v[i],n=t.o[i],r=t.i[i],h[0]===n[0]&&h[1]===n[1]&&h[0]===r[0]&&h[1]===r[1]?0!==i&&i!==g-1||t.c?(a=0===i?t.v[g-1]:t.v[i-1],o=Math.sqrt(Math.pow(h[0]-a[0],2)+Math.pow(h[1]-a[1],2)),l=o?Math.min(o/2,s)/o:0,p=f=h[0]+(a[0]-h[0])*l,c=m=h[1]-(h[1]-a[1])*l,u=p-.5519*(p-h[0]),d=c-.5519*(c-h[1]),e.setTripleAt(p,c,u,d,f,m,y),y+=1,a=i===g-1?t.v[0]:t.v[i+1],o=Math.sqrt(Math.pow(h[0]-a[0],2)+Math.pow(h[1]-a[1],2)),l=o?Math.min(o/2,s)/o:0,p=u=h[0]+(a[0]-h[0])*l,c=d=h[1]+(a[1]-h[1])*l,f=p-.5519*(p-h[0]),m=c-.5519*(c-h[1]),e.setTripleAt(p,c,u,d,f,m,y),y+=1):(e.setTripleAt(h[0],h[1],n[0],n[1],r[0],r[1],y),y+=1):(e.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1);return e}processShapes(t){let s,e,i,h,r=this.shapes.length,n=this.rd.v;if(0!==n){let a,o;for(e=0;e<r;e+=1){if(a=this.shapes[e],o=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(o.releaseShapes(),a.shape._mdf=!0,s=a.shape.paths.shapes,h=a.shape.paths._length,i=0;i<h;i+=1)o.addShape(this.processPath(s[i],n));a.shape.paths=a.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)}}),Gt("rp",class extends Yt{initModifierProperties(t,s){this.getValue=this.processKeys,this.c=St(t,s.c,0,null,this),this.o=St(t,s.o,0,null,this),this.tr=Xt(t,s.tr,this),this.so=St(t,s.tr.so,0,.01,this),this.eo=St(t,s.tr.eo,0,.01,this),this.data=s,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new At,this.rMatrix=new At,this.sMatrix=new At,this.tMatrix=new At,this.matrix=new At}applyTransforms(t,s,e,i,h,r){let n=r?-1:1,a=i.s.v[0]+(1-i.s.v[0])*(1-h),o=i.s.v[1]+(1-i.s.v[1])*(1-h);t.translate(i.p.v[0]*n*h,i.p.v[1]*n*h,i.p.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.rotate(-i.r.v*n*h),s.translate(i.a.v[0],i.a.v[1],i.a.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.scale(r?1/a:a,r?1/o:o),e.translate(i.a.v[0],i.a.v[1],i.a.v[2])}init(t,s,e,i){for(this.elem=t,this.arr=s,this.pos=e,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,s[e]);e>0;)e-=1,this._elements.unshift(s[e]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)}resetElements(t){const s=t.length;for(let e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)}cloneElements(t){let s=JSON.parse(JSON.stringify(t));return this.resetElements(s),s}changeGroupRender(t,s){const e=t.length;for(let i=0;i<e;i+=1)t[i]._render=s,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,s)}processShapes(t){if(this._mdf||t){let t=Math.ceil(this.c.v);if(this._groups.length<t){for(;this._groups.length<t;){let t={it:this.cloneElements(this._elements),ty:"gr"};t.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,t),this._groups.splice(0,0,t),this._currentCopies+=1}this.elem.reloadShapes()}let s,e,i=0;for(s=0;s<=this._groups.length-1;s+=1)e=i<t,this._groups[s]._render=e,this.changeGroupRender(this._groups[s].it,e),i+=1;this._currentCopies=t;let h=this.o.v,r=h%1,n=h>0?Math.floor(h):Math.ceil(h),a=this.pMatrix.props,o=this.rMatrix.props,l=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();let p=0;if(h>0){for(;p<n;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),p+=1;r&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,r,!1),p+=r)}else if(h<0){for(;p>n;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),p-=1;r&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-r,!0),p-=r)}s=1===this.data.m?0:this._currentCopies-1;const c=1===this.data.m?1:-1;for(i=this._currentCopies;i;){const t=this.elemsData[s].it,e=t[t.length-1].transform.mProps.v.props,h=e.length;if(t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),0!==p){(0!==s&&1===c||s!==this._currentCopies-1&&-1===c)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],o[8],o[9],o[10],o[11],o[12],o[13],o[14],o[15]),this.matrix.transform(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15]),this.matrix.transform(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]);for(let t=0;t<h;t+=1)e[t]=this.matrix.props[t];this.matrix.reset()}else{this.matrix.reset();for(let t=0;t<h;t+=1)e[t]=this.matrix.props[t]}p+=1,i-=1,s+=c}}else{let t=this._currentCopies,s=0;const e=1;for(;t;){const i=this.elemsData[s].it;i[i.length-1].transform.mProps._mdf=!1,i[i.length-1].transform.op._mdf=!1,t-=1,s+=e}}}addShape(){}}),Gt("ms",class extends Yt{initModifierProperties(t,s){this.getValue=this.processKeys,this.data=s,this.positions=[]}processKeys(t,s){(t!==this.frameId||s)&&(this._mdf=!0)}addShapeToModifier(){this.positions.push([])}processPath(t,s,e){let i,h,r,n,a=t.v.length,o=[],l=[],p=[];for(i=0;i<a;i+=1){e.v[i]||(e.v[i]=[t.v[i][0],t.v[i][1]],e.o[i]=[t.o[i][0],t.o[i][1]],e.i[i]=[t.i[i][0],t.i[i][1]],e.distV[i]=0,e.distO[i]=0,e.distI[i]=0),h=Math.atan2(t.v[i][1]-s[1],t.v[i][0]-s[0]),r=s[0]-e.v[i][0],n=s[1]-e.v[i][1];let a=Math.sqrt(r*r+n*n);e.distV[i]+=(a-e.distV[i])*this.data.dc,e.v[i][0]=Math.cos(h)*Math.max(0,this.data.maxDist-e.distV[i])/2+t.v[i][0],e.v[i][1]=Math.sin(h)*Math.max(0,this.data.maxDist-e.distV[i])/2+t.v[i][1],h=Math.atan2(t.o[i][1]-s[1],t.o[i][0]-s[0]),r=s[0]-e.o[i][0],n=s[1]-e.o[i][1],a=Math.sqrt(r*r+n*n),e.distO[i]+=(a-e.distO[i])*this.data.dc,e.o[i][0]=Math.cos(h)*Math.max(0,this.data.maxDist-e.distO[i])/2+t.o[i][0],e.o[i][1]=Math.sin(h)*Math.max(0,this.data.maxDist-e.distO[i])/2+t.o[i][1],h=Math.atan2(t.i[i][1]-s[1],t.i[i][0]-s[0]),r=s[0]-e.i[i][0],n=s[1]-e.i[i][1],a=Math.sqrt(r*r+n*n),e.distI[i]+=(a-e.distI[i])*this.data.dc,e.i[i][0]=Math.cos(h)*Math.max(0,this.data.maxDist-e.distI[i])/2+t.i[i][0],e.i[i][1]=Math.sin(h)*Math.max(0,this.data.maxDist-e.distI[i])/2+t.i[i][1],o.push(e.v[i]),l.push(e.o[i]),p.push(e.i[i])}return{v:o,o:l,i:p,c:t.c}}processShapes(){let t,s,e,i,h=this.elem.globalData.mouseX,r=this.elem.globalData.mouseY,n=this.shapes.length;if(h){let a,o=this.elem.globalToLocal([h,r,0]),l=[];for(s=0;s<n;s+=1)if(a=this.shapes[s],a.shape._mdf||this._mdf){for(a.shape._mdf=!0,t=a.shape.paths,i=t.length,e=0;e<i;e+=1)this.positions[s][e]||(this.positions[s][e]={v:[],o:[],i:[],distV:[],distO:[],distI:[]}),l.push(this.processPath(t[e],o,this.positions[s][e]));a.shape.paths=l,a.last=l}else a.shape.paths=a.last}}});var Ut=function(t,s,e){return new Bt[t](s,e)};class zt extends H{constructor(t,s,e){let i;super(),this.elem=t,this.frameId=-1,this.dataProps=q(s.length),this.k=!1,this.dashArray=V("float32",s.length?s.length-1:0),this.dashoffset=V("float32",1),this.initDynamicPropertyContainer(e);let h,r=s.length||0;for(i=0;i<r;i+=1)h=St(t,s[i].v,0,0,this),this.k=h.k||this.k,this.dataProps[i]={n:s[i].n,p:h};this.k||this.getValue(!0),this._isAnimated=this.k}getValue(t,s){if((t!==this.frameId||s)&&(this.frameId=t,this.iterateDynamicProperties(),this._mdf=this._mdf||s,this._mdf)){let t=0,s=this.dataProps.length;for(t=0;t<s;t+=1)"o"!=this.dataProps[t].n?this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}}}class Wt extends H{constructor(t,s,e){super(),this.data=s,this.c=V("uint8c",4*s.p);let i=s.k.k[0].s?s.k.k[0].s.length-4*s.p:s.k.k.length-4*s.p;this.o=V("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(e),this.prop=St(t,s.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}comparePoints(t,s){let e,i=0,h=this.o.length/2;for(;i<h;){if(e=Math.abs(t[4*i]-t[4*s+2*i]),e>.01)return!1;i+=1}return!0}checkCollapsable(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s){let t=0,s=this.data.k.k.length;for(;t<s;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0}getValue(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){let s,e,i,h=4*this.data.p;for(s=0;s<h;s+=1)e=s%4==0?100:255,i=Math.round(this.prop.v[s]*e),this.c[s]!==i&&(this.c[s]=i,this._cmdf=!t);if(this.o.length)for(h=this.prop.v.length,s=4*this.data.p;s<h;s+=1)e=s%2==0?100:1,i=s%2==0?Math.round(100*this.prop.v[s]):this.prop.v[s],this.o[s-4*this.data.p]!==i&&(this.o[s-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}}}class Jt extends H{constructor(t,s,e){super(),this.frameId=-1,this.keyframesManager=t,this.elem=t.elem,this.session=e,this.shapes=[],this.shapesData=s,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new Ot,this.initDynamicPropertyContainer(t),this.lcEnum={1:"butt",2:"round",3:"square"},this.ljEnum={1:"miter",2:"round",3:"bevel"},this._isFirstFrame=!0,this.transformHelper={opacity:1,_opMdf:!1},this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),this._isAnimated||(this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.updateModifiers(this.frameId),this.transformsManager.processSequences(this._isFirstFrame),this.updateShape(this.transformHelper,this.shapesData,this.itemsData),this.updateGrahpics())}createStyleElement(t,s){const e=new jt(this.elem,t,this.transformsManager.addTransformSequence(s)),i={};if("fl"==t.ty||"st"==t.ty?(i.c=St(this,t.c,1,255,this),i.c.k||(e.co=i.c.v)):"gf"!==t.ty&&"gs"!==t.ty||(i.s=St(this,t.s,1,null,this),i.e=St(this,t.e,1,null,this),i.h=St(this,t.h||{k:0},0,.01,this),i.a=St(this,t.a||{k:0},0,nt,this),i.g=new Wt(this,t.g,this)),i.o=St(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(e.lc=this.lcEnum[t.lc]||"round",e.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(e.ml=t.ml),i.w=St(this,t.w,0,null,this),i.w.k||(e.wi=i.w.v),t.d){let s=new zt(this,t.d,"canvas",this);i.d=s,i.d.k||(e.da=i.d.dashArray,e.do=i.d.dashoffset[0])}}else e.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(e),i.style=e,i}addShapeToModifiers(t){let s,e=this.shapeModifiers.length;for(s=0;s<e;s+=1)this.shapeModifiers[s].addShape(t)}isShapeInAnimatedModifiers(t){let s=this.shapeModifiers.length;for(;0<s;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1}updateModifiers(t){if(!this.shapeModifiers.length)return;let s,e=this.shapes.length;for(s=0;s<e;s+=1)this.shapes[s].sh.reset();for(e=this.shapeModifiers.length,s=e-1;s>=0;s-=1)this.shapeModifiers[s].processShapes(t,this._isFirstFrame)}searchProcessedElement(t){let s=this.processedElements,e=0,i=s.length;for(;e<i;){if(s[e].elem===t)return s[e].pos;e+=1}return 0}addProcessedElement(t,s){let e=this.processedElements,i=e.length;for(;i;)if(i-=1,e[i].elem===t)return void(e[i].pos=s);e.push(new Ft(t,s))}createGroupElement(){return{it:[],prevViewData:[]}}createTransformElement(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:St(this,t.o,0,.01,this),mProps:Xt(this,t,this)}}}createShapeElement(t){const s=new It(this,t,this.stylesList,this.transformsManager);return this.shapes.push(s),this.addShapeToModifiers(s),s}reloadShapes(){let t;this._isFirstFrame=!0;let s=this.itemsData.length;for(t=0;t<s;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),s=this.dynamicProperties.length,t=0;t<s;t+=1)this.dynamicProperties[t].getValue();this.updateModifiers(),this.transformsManager.processSequences(this._isFirstFrame)}addTransformToStyleList(t){const s=this.stylesList.length;for(let e=0;e<s;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)}removeTransformFromStyleList(){const t=this.stylesList.length;for(let s=0;s<t;s+=1)this.stylesList[s].closed||this.stylesList[s].transforms.pop()}closeStyles(t){const s=t.length;for(let e=0;e<s;e+=1)t[e].closed=!0}searchShapes(t,s,e,i,h){let r,n,a,o,l,p,c=t.length-1,u=[],d=[],f=[].concat(h);for(r=c;r>=0;r-=1){if(o=this.searchProcessedElement(t[r]),o?s[r]=e[o-1]:t[r]._shouldRender=i,"fl"==t[r].ty||"st"==t[r].ty||"gf"==t[r].ty||"gs"==t[r].ty)o?s[r].style.closed=!1:s[r]=this.createStyleElement(t[r],f),u.push(s[r].style);else if("gr"==t[r].ty){if(o)for(a=s[r].it.length,n=0;n<a;n+=1)s[r].prevViewData[n]=s[r].it[n];else s[r]=this.createGroupElement(t[r]);this.searchShapes(t[r].it,s[r].it,s[r].prevViewData,i,f)}else"tr"==t[r].ty?(o||(p=this.createTransformElement(t[r]),s[r]=p),f.push(s[r]),this.addTransformToStyleList(s[r])):"sh"==t[r].ty||"rc"==t[r].ty||"el"==t[r].ty||"sr"==t[r].ty?o||(s[r]=this.createShapeElement(t[r])):"tm"==t[r].ty||"rd"==t[r].ty?(o?(l=s[r],l.closed=!1):(l=Ut(t[r].ty),l.init(this,t[r]),s[r]=l,this.shapeModifiers.push(l)),d.push(l)):"rp"==t[r].ty&&(o?(l=s[r],l.closed=!0):(l=Ut(t[r].ty),s[r]=l,l.init(this,t,r,s),this.shapeModifiers.push(l),i=!1),d.push(l));this.addProcessedElement(t[r],r+1)}for(this.removeTransformFromStyleList(),this.closeStyles(u),c=d.length,r=0;r<c;r+=1)d[r].closed=!0}updateShapeTransform(t,s){(t._opMdf||s.op._mdf||this._isFirstFrame)&&(s.opacity=t.opacity,s.opacity*=s.op.v,s._opMdf=!0)}updateStyledShape(t,s){if(this._isFirstFrame||s._mdf||t.transforms._mdf){let e,i,h,r=t.trNodes,n=s.paths,a=n._length;r.length=0;let o=t.transforms.finalTransform;for(h=0;h<a;h+=1){let t=n.shapes[h];if(t&&t.v){for(i=t._length,e=1;e<i;e+=1)1===e&&r.push({t:"m",p:o.applyToPointArray(t.v[0][0],t.v[0][1],0)}),r.push({t:"c",pts:o.applyToTriplePoints(t.o[e-1],t.i[e],t.v[e])});1===i&&r.push({t:"m",p:o.applyToPointArray(t.v[0][0],t.v[0][1],0)}),t.c&&i&&(r.push({t:"c",pts:o.applyToTriplePoints(t.o[e-1],t.i[0],t.v[0])}),r.push({t:"z"}))}}t.trNodes=r}}updatePath(t,s){if(!0!==t.hd&&t._shouldRender){let t,e=s.styledShapes.length;for(t=0;t<e;t+=1)this.updateStyledShape(s.styledShapes[t],s.sh)}}updateFill(t,s,e){const i=s.style;(s.c._mdf||this._isFirstFrame)&&(i.co=s.c.v),(s.o._mdf||e._opMdf||this._isFirstFrame)&&(i.coOp=s.o.v*e.opacity)}updateStroke(t,s,e){let i=s.style,h=s.d;h&&(h._mdf||this._isFirstFrame)&&(i.da=h.dashArray,i.do=h.dashoffset[0]),(s.c._mdf||this._isFirstFrame)&&(i.co=s.c.v),(s.o._mdf||e._opMdf||this._isFirstFrame)&&(i.coOp=s.o.v*e.opacity),(s.w._mdf||this._isFirstFrame)&&(i.wi=s.w.v)}updateGradientFill(t,s,e){let i=s.style;i.grd=s.g.c,i.coOp=s.o.v*e.opacity}updateShape(t,s,e){let i=t;for(let h=s.length-1;h>=0;h-=1)"tr"==s[h].ty?(i=e[h].transform,this.updateShapeTransform(t,i)):"sh"==s[h].ty||"el"==s[h].ty||"rc"==s[h].ty||"sr"==s[h].ty?this.updatePath(s[h],e[h]):"fl"==s[h].ty?this.updateFill(s[h],e[h],i):"st"==s[h].ty?this.updateStroke(s[h],e[h],i):"gf"==s[h].ty||"gs"==s[h].ty?this.updateGradientFill(s[h],e[h],i):"gr"==s[h].ty&&this.updateShape(i,s[h].it,e[h].it)}updateGrahpics(){const t=this.stylesList.length;for(let s=0;s<t;s+=1)this.stylesList[s].updateGrahpics()}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.updateModifiers(t),this.transformsManager.processSequences(this._isFirstFrame),this.updateShape(this.transformHelper,this.shapesData,this.itemsData),this.updateGrahpics(),this.frameId=t)}}class Ht extends Rt{constructor(t,s,e){super(t,s),this.frameId=-1,this.hs=s,this.session=e}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.frameId=t)}get x(){return this.p?this.p.v[0]:this.px.v}get y(){return this.p?this.p.v[1]:this.py.v}get anchorX(){return this.a.v[0]}get anchorY(){return this.a.v[1]}get scaleX(){return this.s.v[0]}get scaleY(){return this.s.v[1]}get rotation(){return this.r&&this.r.v||0}get alpha(){return this.o.v}}class Kt{constructor(t){this.elem=t,this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1,this.transform=null,this.masks=null,this.shapes=null,this._hasOutTypeExpression=!1,this.needUpdateOverlap=!1,this.isOverlapMode=!1,this.visible=!0,this._isFirstFrame=!0}initFrame(t,s){this.layer=t;const{local:e,global:i}=s;this.session=s,this.isOverlapLayer=this.layer.op>=e.op-e.st,this.isOverlapMode=i.overlapMode,this.parseLayer(t,s)}outTypeExpressionMode(){this._hasOutTypeExpression=!0,this.isOverlapLayer&&(this.needUpdateOverlap=!0)}prepareProperties(t,s){let e,i=this.dynamicProperties.length;for(e=0;e<i;e+=1)(s||this.needUpdateOverlap||this.elem._isParent&&"transform"===this.dynamicProperties[e].propType)&&(this.dynamicProperties[e].getValue(t),this.dynamicProperties[e]._mdf&&(this._mdf=!0))}addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}parseLayer({ks:t,hasMask:s,masksProperties:e,shapes:i,tm:h},r){if(t&&(this.transform=new Ht(this,t,r)),s&&(this.masks=new Lt(this,e,r)),i&&(this.shapes=new Jt(this,i,r)),h){const{frameRate:t}=r.global;this.tm=St(this,h,0,t,this)}}updateFrame(t){this._mdf=!1;const s=c.inRange(t,this.layer.ip,this.layer.op);this.isOverlapMode&&this.isOverlapLayer?this.visible=t>=this.layer.ip:this.visible=s,this.prepareProperties(t,s)}updateDisplay(){const t=this.elem.display;this.elem._isRoot||(this.visible?t.show():t.hide(),(this._mdf||this.transform._mdf||this._isFirstFrame)&&t.updateLottieTransform(this.transform),this.masks&&(this.masks._mdf||this._isFirstFrame)&&t.updateLottieMasks(this.masks)),this._isFirstFrame=!1}}class Zt{constructor(t){this.data=t,void 0===this.data.sr&&(this.data.sr=1),this.offsetTime=t.st||0,this.fullname=t.nm||"",this.idname=t.ln||"",this.classnames=t.cl?t.cl.split(" "):[],this.bodymovin=new Kt(this),this.displayType="",this.display=null,this.hierarchy=null,this.lottieTreeParent=null}initBodymovin(t,s){this.bodymovin.initFrame(t,s),this.display&&this.display.onSetupLottie&&this.display.onSetupLottie()}hasValidMasks(){return!(!this.bodymovin.masks||!this.bodymovin.masks.hasMasks)}setHierarchy(t){this.hierarchy=t,this.display.setHierarchy(t.display)}initDisplayInstance(t,s){return new(Nt(t))(this,s)}updateFrame(t){this.bodymovin.updateFrame(t),this.bodymovin.updateDisplay()}}class $t extends Zt{constructor(t,s){super(t);const{global:e}=s;this.session=s;const i={layer:t,session:s};if(e.maskComp){i.maskComp=e.maskComp;const{w:s,h:h}=t;i.viewport={w:s,h:h}}this.config=i,this.childNodes=[],this.displayType=Vt.Component,this.innerDisplay=null,this.display=this.initDisplayInstance(this.displayType,i),this.initBodymovin(t,s)}updateFrame(t){if(this.bodymovin.updateFrame(t),this.bodymovin.updateDisplay(),t-=this.offsetTime,this.bodymovin.tm){let s=this.bodymovin.tm.v;s===this.data.op&&(s=this.data.op-1),t=s}else t/=this.data.sr;for(let s=0;s<this.childNodes.length;s++)this.childNodes[s].updateFrame(t)}addChild(t){t.lottieTreeParent=this,this.childNodes.push(t),this.innerDisplay?this.innerDisplay.addChild(t.display):this.display.addChild(t.display)}}class Qt extends Zt{constructor(t,s){super(t);const e={layer:t,session:s,rect:{x:0,y:0,width:t.sw,height:t.sh},color:t.sc};this.config=e,this.session=s,this.displayType=Vt.Solid,this.display=this.initDisplayInstance(this.displayType,e),this.initBodymovin(t,s)}}class ts extends Zt{constructor(t,s){super(t);const{global:{textureLoader:e,assets:i}}=s,h=c.getAssets(t.refId,i),r={layer:t,session:s,texture:e.getTextureById(h.id),asset:h};this.config=r,this.session=s,this.displayType=Vt.Sprite,this.display=this.initDisplayInstance(this.displayType,r),this.initBodymovin(t,s)}}class ss extends Zt{constructor(t,s){super(t);const e={layer:t,session:s};this.config=e,this.session=s,this.displayType=Vt.Shape,this.display=this.initDisplayInstance(this.displayType,e),this.initBodymovin(t,s)}}class es extends Zt{constructor(t,s){super(t);const e={layer:t,session:s};this.config=e,this.session=s,this.displayType=Vt.Null,this.display=this.initDisplayInstance(this.displayType,e),this.initBodymovin(t,s)}}class is extends u{constructor(t){super(),this.living=!0,this.infinite=t.infinite||!1,this.repeats=t.repeats||0,this.alternate=t.alternate||!1,this.wait=t.wait||0,this.delay=t.delay||0,this.overlapMode=t.overlapMode||!1,this.timeScale=c.isNumber(t.timeScale)?t.timeScale:1,this.frameNum=0,this.isPaused=!0,this.direction=1,this._lastFrame=-1/0,this._repeatsCut=this.repeats,this._delayCut=this.delay,this._waitCut=this.wait,this.segments=t.segments||{},this._segmentName=t.initSegment||"",this._prefix=t.prefix||"",this._autoLoad=!c.isBoolean(t.autoLoad)||t.autoLoad,this._autoStart=!c.isBoolean(t.autoStart)||t.autoStart,this._justDisplayOnImagesLoaded=!c.isBoolean(t.justDisplayOnImagesLoaded)||t.justDisplayOnImagesLoaded,this._maskComp=t.maskComp||!1,this.textureLoader=null,this.jsonLoader=null,this.root=null,this.parent=null;const s=Nt(Vt.Container);if(this.group=new s,this.display=null,this.isDisplayLoaded=!1,this.isImagesLoaded=!1,this._copyJSON=t.copyJSON||!1,t.keyframes)!this._prefix&&t.keyframes.prefix&&(this._prefix=t.keyframes.prefix),this._setupDate(t.keyframes);else if(t.path){let s="";s=-1!==t.path.lastIndexOf("\\")?t.path.substr(0,t.path.lastIndexOf("\\")+1):t.path.substr(0,t.path.lastIndexOf("/")+1),!this._prefix&&s&&(this._prefix=s),this.jsonLoader=function(t){const s=d[f.Ajax];return s||console.warn("must register an ajax loader, before you parse an animation from path"),s(t)}(t.path),this.jsonLoader.once("success",(t=>{this._setupDate(t)})),this.jsonLoader.once("error",(t=>{this.emit("error",t)}))}}_setupDate(t){this._sourceData=t,this._copyJSON&&(t=c.copyJSON(t)),b(t),this.keyframes=t;const{w:s,h:e,st:i=0,fr:h,ip:r,op:n,assets:a}=t;this.frameRate=h,this.frameMult=h/1e3,this._defaultSegment=[r,n];const o=this._segmentName&&this.segments[this._segmentName]||this._defaultSegment;this.beginFrame=o[0],this.endFrame=o[1],this._timePerFrame=1e3/h,this.duration=Math.floor(this.endFrame-this.beginFrame);let l=null;const p=a.filter((t=>t.u||t.p));p.length>0?(this.textureLoader=l=function(t,s){const e=d[f.Texture];return e||console.warn("must register an image loader, before you parse an animation some has image assets"),e(t,s)}(p,{prefix:this._prefix,autoLoad:this._autoLoad}),l.loaded?(this.isImagesLoaded=!0,this.isPaused=!this._autoStart,this.emit("ImageReady")):(l.once("complete",(()=>{this.isImagesLoaded=!0,this.emit("ImageReady")})),null!==this._pausedNeedSet&&(this._pausedNeedSet=!0,l.once("complete",(()=>{this._pausedNeedSet&&(this._pausedNeedSet=!1,this.isPaused=!this._autoStart)}))))):(this.isImagesLoaded=!0,this.isPaused=!this._autoStart);const u={global:{assets:a,textureLoader:l,frameRate:h,maskComp:this._maskComp,overlapMode:this.overlapMode},local:{w:s,h:e,ip:r,op:n,st:i}};this._buildElements(u),null!==this.textureLoader&&this._justDisplayOnImagesLoaded&&!this.textureLoader.loaded&&null!==this._justDisplayNeedSet&&(this.group.visible=!1,this._justDisplayNeedSet=!0,this.textureLoader.once("complete",(()=>{this._justDisplayNeedSet&&(this._justDisplayNeedSet=!1,this.group.visible=!0)}))),this.isDisplayLoaded=!0,this.update(0,!0)}_buildElements(t){this.root=this._extraCompositions(this.keyframes,t,!0),this.display=this.root.display,this.group.addChild(this.display),this.emit("DOMLoaded").emit("DisplayReady"),null===this.textureLoader||this.textureLoader.loaded?this.emit("success"):this.textureLoader.once("complete",(()=>this.emit("success")))}_extraCompositions(t,{global:s,local:e},i=!1){const{w:h,h:r,ip:n,op:a,st:o=0}=t,l=new $t(t,{global:s,local:e});l._isRoot=i;const p=t.layers||c.getAssets(t.refId,s.assets).layers,u={global:s,local:{w:h,h:r,ip:n,op:a,st:o}},d=this._createElements(p,u);for(let t=p.length-1;t>=0;t--){const s=p[t],e=d[s.ind];if(e){if(!c.isUndefined(s.parent)){const t=d[s.parent];t._isParent=!0,e.setHierarchy(t)}l.addChild(e)}}return l}_createElements(t,s){const e={};for(let i=t.length-1;i>=0;i--){const h=t[i];let r=null;if(void 0===h.td){switch(h.ty){case 0:r=this._extraCompositions(h,s);break;case 1:r=new Qt(h,s);break;case 2:r=new ts(h,s);break;case 3:r=new es(h,s);break;case 4:r=new ss(h,s);break;default:continue}r&&(void 0===h.ind&&(h.ind=i),e[h.ind]=r,r.name=h.nm||null)}}return e}getDisplayByQuerySelector(t){const s=this.querySelector(t);return s&&s.display?s.display:(console.warn("can not find display which query with ",t),null)}_queryMatch(t,s,e){const i=t.substr(0,1),h=t.substr(1,t.length);let r=!1;return r="#"===i?s.idname===h:"."===i?-1!==s.classnames.indexOf(h):s.fullname===t,r&&e.push(s),r}_searchNodes(t,s,e,i=!1){if(s.childNodes&&s.childNodes.length>0){const h=[];for(let r=0;r<s.childNodes.length;r++){const n=s.childNodes[r];if(this._queryMatch(t,n,e)&&i)return!0;n.childNodes&&n.childNodes.length>0&&h.push(n)}for(let s=0;s<h.length;s++)if(this._searchNodes(t,h[s],e,i))return!0}return!1}querySelector(t){const s=[];return this._queryMatch(t,this.root,s)?s[0]:(this._searchNodes(t,this.root,s,!0),s[0]||null)}querySelectorAll(t){const s=[],e="#"===t.substr(0,1);return this._queryMatch(t,this.root,s)&&e||this._searchNodes(t,this.root,s,e),s}bindSlot(t,s){return this.getDisplayByQuerySelector(t).addChild(s),this}unbindSlot(t,s){return this.getDisplayByQuerySelector(t).removeChild(s),this}_emitFrame(t){this.emit(`@${t}`)}update(t,s=!1){if(!this.living||!this.isDisplayLoaded||this.isPaused&&!s)return;const e=this._updateTime(t),i=this.beginFrame+this.frameNum;this.root.updateFrame(i);const h=i>>0;this._lastFrame!==h&&(this._emitFrame(this.direction>0?h:this._lastFrame),this._lastFrame=h),!1===e?(this.emit("enterFrame",i),this.emit("update",this.frameNum/this.duration)):this.hadEnded!==e&&!0===e&&this.emit("complete"),this.hadEnded=e}_updateTime(t){const s=this.direction*this.timeScale*t;if(this._waitCut>0)return this._waitCut-=Math.abs(s),null;if(this.isPaused||this._delayCut>0)return this._delayCut>0&&(this._delayCut-=Math.abs(s)),null;this.frameNum+=s/this._timePerFrame;let e=!1;return this._spill()&&(this._repeatsCut>0||this.infinite?(this._repeatsCut>0&&--this._repeatsCut,this._delayCut=this.delay,this.alternate?(this.direction*=-1,this.frameNum=c.codomainBounce(this.frameNum,0,this.duration)):(this.direction=1,this.frameNum=c.euclideanModulo(this.frameNum,this.duration)),this.emit("loopComplete")):(this.overlapMode||(this.frameNum=c.clamp(this.frameNum,0,this.duration),this.living=!1),e=!0)),e}_spill(){const t=this.frameNum<=0&&-1===this.direction,s=this.frameNum>=this.duration&&1===this.direction;return t||s}frameToTime(t){return t*this._timePerFrame}setSpeed(t){this.timeScale=t}playSegment(t,s={}){if(!t)return;let e=null;c.isArray(t)?e=t:c.isString(t)&&(e=this.segments[t],c.isArray(e)&&(this._segmentName=t)),c.isArray(e)&&(this.beginFrame=c.isNumber(e[0])?e[0]:this._defaultSegment[0],this.endFrame=c.isNumber(e[1])?e[1]:this._defaultSegment[1],c.isNumber(s.repeats)&&(this.repeats=s.repeats),c.isBoolean(s.infinite)&&(this.infinite=s.infinite),c.isBoolean(s.alternate)&&(this.alternate=s.alternate),c.isNumber(s.wait)&&(this.wait=s.wait),c.isNumber(s.delay)&&(this.delay=s.delay),this.replay())}goToAndStop(t,s=!1){this.frameNum=s?t:t*this.frameMult,this.update(0,!0),this.pause()}goToAndPlay(t,s=!1){this.frameNum=s?t:t*this.frameMult,this.update(0,!0),this.resume()}getDuration(t){const s=this.endFrame-this.beginFrame;return t?s:s/this.frameRate}setDirection(t){return this.direction=t<0?-1:1,this}pause(){return this._pausedNeedSet?this._pausedNeedSet=!1:this._pausedNeedSet=null,this.isPaused=!0,this}resume(){return this._pausedNeedSet?this._pausedNeedSet=!1:this._pausedNeedSet=null,this.isPaused=!1,this}play(){return this.resume()}replay(){return this._pausedNeedSet?this._pausedNeedSet=!1:this._pausedNeedSet=null,this.isPaused=!1,this._repeatsCut=this.repeats,this._delayCut=this.delay,this.living=!0,this.frameNum=0,this.duration=Math.floor(this.endFrame-this.beginFrame),this.direction=1,this}show(){this._justDisplayNeedSet?this._justDisplayNeedSet=!1:this._justDisplayNeedSet=null,this.group.visible=!0}hide(){this._justDisplayNeedSet?this._justDisplayNeedSet=!1:this._justDisplayNeedSet=null,this.group.visible=!1}destroy(){this.parent&&this.parent.remove(this),this.group.parent&&this.group.parent.removeChild(this.group),this.pause(),this.root=null,this.group=null,this.display=null,this.textureLoader&&(this.textureLoader.off("complete"),this.textureLoader=null),this.jsonLoader&&(this.jsonLoader.off("success"),this.jsonLoader=null),this.keyframes=null,this.living=!1}}class hs extends u{constructor(t){super(),this._lastTime=0,this._snippet=0,this.timeScale=1,this.isPaused=!1,this.ticker=t.ticker?t.ticker:t,this.groups=[],this.update=this.update.bind(this),this.ticker&&this.start()}add(t){const s=arguments.length;if(s>1)for(let t=0;t<s;t++)this.add(arguments[t]);else null!==t.parent&&t.parent.remove(t),t.parent=this,this.groups.push(t);return t}remove(t){if(arguments.length>1)for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);const s=this.groups.indexOf(t);-1!==s&&(t.parent=null,this.groups.splice(s,1))}parseAnimation(t){const s=new is(t);return this.add(s)}setSpeed(t){this.timeScale=t}start(){return this._lastTime=Date.now(),this.ticker.add(this.update),this}stop(){return this.ticker.remove(this.update),this}pause(){return this.isPaused=!0,this}resume(){return this.isPaused=!1,this}update(){if(this.timeline(),this.isPaused)return;const t=this.timeScale*this._snippet,s=this.groups.length;for(let e=0;e<s;e++)this.groups[e].update(t);this.emit("update",this._snippet)}timeline(){let t=Date.now()-this._lastTime;(!this._lastTime||t>200)&&(this._lastTime=Date.now(),t=Date.now()-this._lastTime),this._lastTime+=t,this._snippet=t}destroy(){for(let t=this.groups.length-1;t>=0;t--)this.groups[t].destroy()}}class rs extends e.Graphics{constructor(t){super(),this.parentCompBox=t,this.lineStyle(0)}updateLayerMask(t){for(let s=0;s<t.viewData.length;s++){if(t.viewData[s].inv){const t=this.parentCompBox;this.moveTo(0,0),this.lineTo(t.w,0),this.lineTo(t.w,t.h),this.lineTo(0,t.h),this.lineTo(0,0)}const e=t.viewData[s].v,i=e.v[0];this.moveTo(i[0],i[1]);const h=e._length;let r=1;for(;r<h;r++){const t=e.o[r-1],s=e.i[r],i=e.v[r];this.bezierCurveTo(t[0],t[1],s[0],s[1],i[0],i[1])}const n=e.o[r-1],a=e.i[0],o=e.v[0];this.bezierCurveTo(n[0],n[1],a[0],a[1],o[0],o[1]),t.viewData[s].inv&&this.addHole()}}updateMasks(t){this.clear(),this.beginFill(0),this.updateLayerMask(t),this.endFill()}}class ns extends e.Graphics{constructor(t){super(),this.viewport=t,this.lineStyle(0),this.initCompMask()}initCompMask(){this.clear(),this.beginFill(0);const t=this.viewport;this.moveTo(0,0),this.lineTo(t.w,0),this.lineTo(t.w,t.h),this.lineTo(0,t.h),this.lineTo(0,0),this.endFill()}}class as extends e.Container{constructor(t,s){super(),this.lottieElement=t,this.config=s}onSetupLottie(){if(this.config.maskComp){const t=this.config.viewport;this.preCompMask=new ns(t),this.mask=this.preCompMask,this.addChild(this.mask)}if(this.lottieElement.hasValidMasks()){const t=this.config.session.local;if(this.graphicsMasks=new rs(t),this.mask){const t=new e.Container;t.mask=this.graphicsMasks,t.addChild(this.mask),this.lottieElement.innerDisplay=t,this.addChild(t)}else this.mask=this.graphicsMasks,this.addChild(this.mask)}}setHierarchy(t){this.hierarchy=t}show(){this.visible=!0}hide(){this.visible=!1}updateLottieTransform(t){this.x=t.x,this.y=t.y,this.pivot.x=t.anchorX,this.pivot.y=t.anchorY,this.scale.x=t.scaleX,this.scale.y=t.scaleY,this.rotation=t.rotation,this.alpha=t.alpha}updateLottieMasks(t){this.graphicsMasks&&this.graphicsMasks.updateMasks(t)}}class os extends e.Shader{constructor(t){super(t,["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);","}"].join("\n"),["uniform float alpha;","uniform vec3 color;","void main(void){"," gl_FragColor = vec4(color * alpha, alpha);","}"].join("\n"))}}function ls(t,s){this.buffer=new t(10),this.length=0}ls.prototype={reset(){this.length=0},destroy(){this.buffer=null,this.length=0},push(...t){if(this.length+t.length>this.buffer.length){const s=new this.buffer.constructor(Math.max(this.length+t.length,Math.round(2*this.buffer.length)));s.set(this.buffer,0),this.buffer=s}for(let s=0;s<t.length;s++)this.buffer[this.length++]=t[s];return this.length},setBuffer(t){this.buffer=t,this.length=this.buffer.length}};class ps{constructor(t,s,i){this.gl=t,this.vertices=new ls(Float32Array),this.indices=new ls(Uint16Array),this.buffer=e.glCore.GLBuffer.createVertexBuffer(t),this.indexBuffer=e.glCore.GLBuffer.createIndexBuffer(t),this.dirty=!0,this.shader=s,this.vao=new e.glCore.VertexArrayObject(t,i).addIndex(this.indexBuffer).addAttribute(this.buffer,s.attributes.aVertexPosition,t.FLOAT,!1,8,0)}reset(){this.vertices.reset(),this.indices.reset()}upload(){this.buffer.upload(this.vertices.buffer),this.indexBuffer.upload(this.indices.buffer),this.dirty=!1}destroy(){this.vertices.destroy(),this.indices.destroy(),this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null}}function cs(t,s,e){return t.push(s,e),t}function us(t,s){return Math.sqrt(t*t+s*s)}function ds(t,s,e,i,h){return function(t,s){const e=1-t;return e*e*e*s}(t,s)+function(t,s){const e=1-t;return 3*e*e*t*s}(t,e)+function(t,s){return 3*(1-t)*t*t*s}(t,i)+function(t,s){return t*t*t*s}(t,h)}function fs(t,s,e,i,h,r,n){if(!(isFinite(s)&&isFinite(e)&&isFinite(i)&&isFinite(h)&&isFinite(r)&&isFinite(n)))return t;const a=t[t.length-2],o=t[t.length-1],l=function(t,s,e,i,h,r,n,a){const o=h-e,l=r-i,p=e-t,c=i-s;return us(n-h,a-r)+us(o,l)+us(p,c)}(a,o,s,e,i,h,r,n),p=Math.min(10/l,.5);for(let l=p;l<1;l+=p){const p=ds(l,a,s,i,r),c=ds(l,o,e,h,n);t.push(p,c)}return t.push(r,n),t}function ms(t,s){for(let e=0;e<t.length;e++){const{cmd:i,args:h}=t[e];switch(i){case"M":case"L":cs(s,h[0],h[1]);break;case"C":fs(s,h[0],h[1],h[2],h[3],h[4],h[5])}}return s}function gs(t,s,e,i,h,r,n){h%=2*Math.PI,r%=2*Math.PI,h<0&&(h+=2*Math.PI),r<0&&(r+=2*Math.PI),h>=r&&(r+=2*Math.PI);let a=r-h,o=1;n&&(o=-1,a=2*Math.PI-a,0==a&&(a=2*Math.PI));const l=a*i;let p=Math.sqrt(l/1)>>0;p=p%2==0?p+1:p;const c=a/p;let u=h;for(let h=0;h<p+1;h++)t.push(s,e,s+i*Math.cos(u),e+i*Math.sin(u)),u+=o*c}function ys(t,s,e){const i=ms(t.cmds,[]),h=t.isClosed,r=s.lineDash.length>=2,n=s.lineWidth/2;let a,o=[i[0],i[1]];for(let t=2;t<i.length;t+=2)i[t]==o[o.length-2]&&i[t+1]==o[o.length-1]||o.push(i[t],i[t+1]);if(!h||o[o.length-2]==o[0]&&o[o.length-1]==o[1]||o.push(o[0],o[1]),r){const t=function(t,s,e,i){s&&t.push(t[0],t[1]);let h=i,r=0,n=1;for(;h>e[r];)h-=e[r],r++,n=n?0:1,r==e.length&&(r=0);let a=[t[0],t[1]],o=[n];for(let s=2;s<t.length;s+=2){let i=[t[s]-t[s-2],t[s+1]-t[s-1]],l=us(i[0],i[1]);i[0]/=l,i[1]/=l;let p=0;for(;l-p+h>=e[r];)p+=e[r]-h,h=0,n=n?0:1,r++,r==e.length&&(r=0),o.push(n),a.push(t[s-2]+p*i[0],t[s-1]+p*i[1]);l-p!=0&&(a.push(t[s],t[s+1]),o.push(n)),h+=l-p}return s&&(t.pop(),t.pop(),a.pop(),a.pop(),o.pop()),{newPoints:a,toDrawOrNotToDraw:o}}(o,h,s.lineDash,s.lineDashOffset);a=t.toDrawOrNotToDraw,o=t.newPoints}const l=e.length;let p=e.length;const c=[];if(h)o.push(o[2],o[3]);else{const t=[o[2]-o[0],o[3]-o[1]],i=us(t[0],t[1]);t[0]/=i,t[1]/=i;const h=[-t[1],t[0]],l=[o[0]+n*h[0],o[1]+n*h[1]],u=[o[0]-n*h[0],o[1]-n*h[1]];if("butt"==s.lineCap)e.push(l[0],l[1],u[0],u[1]);else if("square"==s.lineCap)e.push(l[0]-n*t[0],l[1]-n*t[1],u[0]-n*t[0],u[1]-n*t[1]);else{e.push(o[0],o[1],l[0],l[1]);const t=Math.atan2(l[1]-o[1],l[0]-o[0]),s=Math.atan2(u[1]-o[1],u[0]-o[0]);gs(e,o[0],o[1],n,t,s),e.push(o[0],o[1],u[0],u[1]),e.push(l[0],l[1],u[0],u[1])}if(r){const t=a[0];for(let s=p;s<e.length;s+=2)c.push(t);p=e.length}}for(let t=2;t<o.length-2;t+=2){const i=[o[t]-o[t-2],o[t+1]-o[t-1]],h=[-i[1],i[0]];let l=us(h[0],h[1]);h[0]/=l,h[1]/=l;let u=[o[t+2]-o[t],o[t+3]-o[t+1]];l=us(u[0],u[1]),u[0]/=l,u[1]/=l;let d=[o[t]-o[t-2],o[t+1]-o[t-1]];l=us(d[0],d[1]),d[0]/=l,d[1]/=l;let f=[d[0]+u[0],d[1]+u[1]];l=us(f[0],f[1]);let m,g,y=0;l>0?(f[0]/=l,f[1]/=l,g=[-f[1],f[0]],m=g[0]*h[0]+g[1]*h[1],y=n/m):(y=0,g=[-f[1],f[0]]);const v=[o[t]+y*g[0],o[t+1]+y*g[1]],_=[o[t]-y*g[0],o[t+1]-y*g[1]];if("miter"==s.lineJoin&&1/m<=s.miterLimit)e.push(v[0],v[1],_[0],_[1]);else{const i=d[1]*u[0]-d[0]*u[1];if("round"==s.lineJoin)if(i<0){const s=[o[t]+d[1]*n,o[t+1]-d[0]*n],i=[o[t]+u[1]*n,o[t+1]-u[0]*n];e.push(v[0],v[1],s[0],s[1]);const h=Math.atan2(s[1]-o[t+1],s[0]-o[t]),r=Math.atan2(i[1]-o[t+1],i[0]-o[t]);gs(e,o[t],o[t+1],n,h,r),e.push(v[0],v[1],i[0],i[1])}else{const s=[o[t]-d[1]*n,o[t+1]+d[0]*n],i=[o[t]-u[1]*n,o[t+1]+u[0]*n];e.push(s[0],s[1],_[0],_[1]);const h=Math.atan2(i[1]-o[t+1],i[0]-o[t]),r=Math.atan2(s[1]-o[t+1],s[0]-o[t]);gs(e,o[t],o[t+1],n,h,r),e.push(i[0],i[1],_[0],_[1])}else if(i<0){const s=[o[t]+d[1]*n,o[t+1]-d[0]*n],i=[o[t]+u[1]*n,o[t+1]-u[0]*n];e.push(v[0],v[1],s[0],s[1],v[0],v[1],i[0],i[1])}else{const s=[o[t]-d[1]*n,o[t+1]+d[0]*n],i=[o[t]-u[1]*n,o[t+1]+u[0]*n];e.push(s[0],s[1],_[0],_[1],i[0],i[1],_[0],_[1])}}if(r){const s=a[t/2];for(let t=p;t<e.length;t+=2)c.push(s);p=e.length}}if(h)e.push(e.buffer[l],e.buffer[l+1],e.buffer[l+2],e.buffer[l+3]);else{const t=[o[o.length-2]-o[o.length-4],o[o.length-1]-o[o.length-3]],i=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));t[0]/=i,t[1]/=i;const h=[-t[1],t[0]],r=[o[o.length-2]+n*h[0],o[o.length-1]+n*h[1]],a=[o[o.length-2]-n*h[0],o[o.length-1]-n*h[1]];if("butt"==s.lineCap)e.push(r[0],r[1],a[0],a[1]);else if("square"==s.lineCap)e.push(r[0]+n*t[0],r[1]+n*t[1],a[0]+n*t[0],a[1]+n*t[1]);else{e.push(r[0],r[1],a[0],a[1]),e.push(o[o.length-2],o[o.length-1],a[0],a[1]);const t=Math.atan2(a[1]-o[o.length-1],a[0]-o[o.length-2]),s=Math.atan2(r[1]-o[o.length-1],r[0]-o[o.length-2]);gs(e,o[o.length-2],o[o.length-1],n,t,s),e.push(o[o.length-2],o[o.length-1],r[0],r[1])}}if(r){const t=a[a.length-1];for(let s=p;s<e.length;s+=2)c.push(t);p=e.length}return c}function vs(t,s){const e=t.isClosed;let i=!0;const h=ms(t.cmds,[]);let r=[h[0],h[1]];for(let t=2;t<h.length;t+=2)h[t]==r[r.length-2]&&h[t+1]==r[r.length-1]||r.push(h[t],h[t+1]);if(!e||r[r.length-2]==r[0]&&r[r.length-1]==r[1]||r.push(r[0],r[1]),r.length>=6){for(let t=0;t<r.length;t++)s.push(r[t]);i=!1}return i}e.WebGLRenderer.registerPlugin("lottiegraphics",class extends e.ObjectRenderer{constructor(t){super(t),this.graphicsDataPool=[],this.primitiveShader=null,this.webGLData=null,this.gl=t.gl,this.CONTEXT_UID=0}onContextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new os(this.gl)}destroy(){e.ObjectRenderer.prototype.destroy.call(this);for(let t=0;t<this.graphicsDataPool.length;++t)this.graphicsDataPool[t].destroy();this.graphicsDataPool=null}render(t){const s=this.renderer,i=s.gl,h=this.getWebGLData(t);if(t.isDirty&&this.updateGraphics(t,h),0===h.indices.length)return;const r=this.primitiveShader;s.bindShader(r),s.state.setBlendMode(t.blendMode),r.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),r.uniforms.color=e.utils.hex2rgb(t.color),r.uniforms.alpha=t.worldAlpha,s.bindVao(h.vao),h.vao.draw(i.TRIANGLES,h.indices.length)}updateGraphics(t,s){s.reset(),"stroke"===t.drawType?this.buildStroke(t,s):this.buildFill(t,s),t.isDirty=!1}buildStroke(t,s){const{vertices:e,indices:i}=s,{paths:h,lineStyle:r}=t,n=r.lineDash.length>=2;for(let t=0;t<h.length;t++){const s=h[t],a=e.length/2,o=ys(s,r,e);if(n)for(let t=a+2;t<e.length/2;t+=2)o[t-a-1]&&i.push(t-2,t,t-1,t,t+1,t-1);else for(let t=a+2;t<e.length/2;t+=2)i.push(t-2,t,t-1,t,t+1,t-1)}s.upload()}buildFill(t,s){const{vertices:i,indices:h}=s,{paths:r}=t;let n=[];const a=[];for(let t=0;t<r.length;t++){const s=r[t],i=[];if(vs(s,i))break;const h=s.holes,o=[];for(let t=0;t<h.length;t++){const s=h[t],e=i.length;if(vs(s,i))break;o.push(e/2)}const l=e.utils.earcut(i,o,2),p=n.length/2;for(let t=0;t<i.length;t+=2)n.push(i[t],i[t+1]);for(let t=0;t<l.length;t+=3)a.push(p+l[t],p+l[t+1],p+l[t+2])}n.length<6||a<3||(i.setBuffer(new Float32Array(n)),h.setBuffer(new Uint16Array(a)),s.upload())}getWebGLData(t){return t.webGLData&&this.CONTEXT_UID===t.webGLData.CONTEXT_UID||(t.webGLData=new ps(this.renderer.gl,this.primitiveShader,this.renderer.state.attribState),t.webGLData.CONTEXT_UID=this.CONTEXT_UID),t.webGLData}}),e.CanvasRenderer.registerPlugin("lottiegraphics",class{constructor(t){this.renderer=t}destroy(){this.renderer=null}render(t){const s=this.renderer,e=s.context,i=t.lineStyle,h=t.worldAlpha,r=t.transform.worldTransform,n=s.resolution;e.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n,r.ty*n),s.setBlendMode(t.blendMode),e.globalAlpha=h,"stroke"===t.drawType?(e.lineWidth=i.lineWidth,e.lineJoin=i.lineJoin,e.miterLimit=i.miterLimit,e.lineCap=i.lineCap,e.lineDashOffset=i.lineDashOffset,e.setLineDash(i.lineDash||[]),this.buildStroke(t)):this.buildFill(t)}buildStroke(t){const s=this.renderer.context,e=`#${`00000${(0|t.color).toString(16)}`.substr(-6)}`,{paths:i,lineStyle:h}=t;s.lineWidth=h.lineWidth,s.lineJoin=h.lineJoin,s.miterLimit=h.miterLimit,s.lineCap=h.lineCap,s.lineDashOffset=h.lineDashOffset,s.setLineDash(h.lineDash||[]),s.beginPath();for(let t=0;t<i.length;t++)this.drawPath(s,i[t]);s.strokeStyle=e,s.stroke()}buildFill(t){const s=this.renderer.context,e=`#${`00000${(0|t.color).toString(16)}`.substr(-6)}`,{paths:i}=t;s.beginPath();for(let t=0;t<i.length;t++){const e=i[t];this.drawPath(s,e);for(let t=0;t<e.holes.length;t++)this.drawPath(s,e.holes[t])}s.fillStyle=e,s.fill()}drawPath(t,s){for(let e=0;e<s.cmds.length;e++){const{cmd:i,args:h}=s.cmds[e];switch(i){case"M":t.moveTo(h[0],h[1]);break;case"L":t.lineTo(h[0],h[1]);break;case"C":t.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5])}}}});class _s{constructor(){this.cmds=[],this.holes=[],this.isClosed=!1,this.isClockWise=!1}getLength(){return this.cmds.length}add(t,s){this.cmds.push({cmd:t,args:s})}moveTo(t=0,s=0){this.add("M",[t,s])}lineTo(t,s){this.add("L",[t,s])}bezierCurveTo(t,s,e,i,h,r){this.add("C",[t,s,e,i,h,r])}closePath(){this.isClosed=!0}}class ks extends e.Container{constructor(){super(),this.paths=[],this._samplerPoints=[],this.currentPath=null,this.color=0,this.lineStyle={lineWidth:1,lineJoin:"miter",miterLimit:10,lineCap:"butt",lineDash:[],lineDashOffset:0},this.isDirty=!0,this.drawType="",this.blendMode=e.BLEND_MODES.NORMAL,this.webGLData=null,this.firstIsClockWise=!0,this.preClockWiseStatus=null}clear(){this.paths.length=0,this.currentPath=null,this.firstIsClockWise=!0,this.preClockWiseStatus=null,this.isDirty=!0}moveTo(t=0,s=0){this.endPath(),this.currentPath=new _s,this.currentPath.moveTo(t,s),this._samplerPoints.push([t,s])}lineTo(t,s){this.currentPath.lineTo(t,s),this._samplerPoints.push([t,s])}bezierCurveTo(t,s,e,i,h,r){this.currentPath.bezierCurveTo(t,s,e,i,h,r),this._samplerPoints.push([h,r])}endPath(){if(this.currentPath&&this.currentPath.getLength()>1){const t=this.paths.length,s=function(t){const s=t.length;let e=0;for(let i=s-1,h=0;h<s;i=h++)e+=t[i][0]*t[h][1]-t[h][0]*t[i][1];return.5*e}(this._samplerPoints)>0;this.currentPath.isClockWise=s,0===t&&(this.firstIsClockWise=s),t>0&&this.preClockWiseStatus===this.firstIsClockWise&&this.preClockWiseStatus!==s?(t>0?this.paths[t-1]:null).holes.push(this.currentPath):(this.paths.push(this.currentPath),this.preClockWiseStatus=s),this.currentPath=null,this.isDirty=!0}this._samplerPoints.length=0}closePath(){this.currentPath.closePath()}stroke(){this.endPath(),this.drawType="stroke"}fill(){null!==this.currentPath&&(this.closePath(),this.endPath(),this.drawType="fill")}_renderWebGL(t){t.setObjectRenderer(t.plugins.lottiegraphics),t.plugins.lottiegraphics.render(this)}_renderCanvas(t){t.plugins.lottiegraphics.render(this)}}class Ss extends e.Graphics{constructor(t,s){super(),this.lottieElement=t,this.config=s;const e=parseInt(s.color.replace("#",""),16);this.beginFill(e),this.drawRect(0,0,s.rect.width,s.rect.height),this.endFill()}onSetupLottie(){if(this.lottieElement.hasValidMasks()){const t=this.config.session.local;this.graphicsMasks=new rs(t),this.mask=this.graphicsMasks,this.addChild(this.mask)}}setHierarchy(t){this.hierarchy=t}show(){this.visible=!0}hide(){this.visible=!1}updateLottieTransform(t){this.x=t.x,this.y=t.y,this.pivot.x=t.anchorX,this.pivot.y=t.anchorY,this.scale.x=t.scaleX,this.scale.y=t.scaleY,this.rotation=t.rotation,this.alpha=t.alpha}updateLottieMasks(t){this.graphicsMasks&&this.graphicsMasks.updateMasks(t)}}class xs extends e.Sprite{constructor(t,s){const{texture:i,asset:h}=s;super(i),i.baseTexture.hasLoaded?(i.orig=new e.Rectangle(0,0,h.w,h.h),i._updateUvs()):i.baseTexture.on("loaded",(()=>{i.orig=new e.Rectangle(0,0,h.w,h.h),i._updateUvs()})),this.lottieElement=t,this.config=s}onSetupLottie(){if(this.lottieElement.hasValidMasks()){const t=this.config.session.local;this.graphicsMasks=new rs(t),this.mask=this.graphicsMasks,this.addChild(this.mask)}}setHierarchy(t){this.hierarchy=t}show(){this.visible=!0}hide(){this.visible=!1}updateLottieTransform(t){this.x=t.x,this.y=t.y,this.pivot.x=t.anchorX,this.pivot.y=t.anchorY,this.scale.x=t.scaleX,this.scale.y=t.scaleY,this.rotation=t.rotation,this.alpha=t.alpha}updateLottieMasks(t){this.graphicsMasks&&this.graphicsMasks.updateMasks(t)}}const Ms=/^(https?:)?\/\//;class Ts extends u{constructor(t,{prefix:s,autoLoad:e=!0}){super(),this.assets=t,this.prefix=s||"",this.textures={},this._total=0,this._failed=0,this._received=0,this.loaded=!1,e&&this.load()}load(){this.assets.forEach((t=>{const s=t.id,i=function(t,s){if(1===t.e)return t.p;s&&(s=s.replace(/\/?$/,"/"));const e=t.u+t.p;let i="";return i=t.up?t.up:Ms.test(e)?e:s+e,i}(t,this.prefix),h=e.Texture.fromImage(i,"*");this.textures[s]=h,this._total++,h.baseTexture.hasLoaded?(this._received++,this.emit("update"),this._received+this._failed>=this._total&&this._onComplete()):(h.baseTexture.once("loaded",(()=>{this._received++,this.emit("update"),this._received+this._failed>=this._total&&this._onComplete()})),h.baseTexture.once("error",(()=>{this._failed++,this.emit("update"),this._received+this._failed>=this._total&&this._onComplete()})))}))}_onComplete(){this.loaded=!0,this.emit("complete"),this._failed>0&&(this._failed>=this._total?this.emit("fail"):this.emit("partlyfail",this._failed))}getTextureById(t){return this.textures[t]}}function ws(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}class Ps extends u{constructor(t){super(),this.path=t,this.onSuccess=this.onSuccess.bind(this),this.onFail=this.onFail.bind(this),function(t,s,e){let i,h=new XMLHttpRequest;h.open("GET",t,!0);try{h.responseType="json"}catch(t){console.error("lottie-pixi loadAjax:",t)}h.send(),h.onreadystatechange=function(){if(4==h.readyState)if(200==h.status)i=ws(h),s(i);else try{i=ws(h),s(i)}catch(t){e&&e(t)}}}(t,this.onSuccess,this.onFail)}onSuccess(t){this.emit("success",t),this.emit("complete",t)}onFail(t){this.emit("fail",t),this.emit("error",t)}}const bs={Linear:{None:t=>t},Ease:{In:function(){const t=new I(.42,0,1,1);return function(s){return t.get(s)}}(),Out:function(){const t=new I(0,0,.58,1);return function(s){return t.get(s)}}(),InOut:function(){const t=new I(.42,0,.58,1);return function(s){return t.get(s)}}(),Bezier(t,s,e,i){const h=new I(t,s,e,i);return function(t){return h.get(t)}}},Elastic:{In:t=>0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI),Out:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1,InOut:t=>0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1},Back:{In(t){const s=1.70158;return t*t*((s+1)*t-s)},Out(t){const s=1.70158;return--t*t*((s+1)*t+s)+1},InOut(t){const s=2.5949095;return(t*=2)<1?t*t*((s+1)*t-s)*.5:.5*((t-=2)*t*((s+1)*t+s)+2)}},Bounce:{In:t=>1-bs.Bounce.Out(1-t),Out:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,InOut:t=>t<.5?.5*bs.Bounce.In(2*t):.5*bs.Bounce.Out(2*t-1)+.5}};function Ds(t){u.call(this),this.element=t.element||{},this.duration=t.duration||300,this.living=!0,this.resident=t.resident||!1,this.infinite=t.infinite||!1,this.alternate=t.alternate||!1,this.repeats=t.repeats||0,this.delay=t.delay||0,this.wait=t.wait||0,this.timeScale=c.isNumber(t.timeScale)?t.timeScale:1,t.onComplete&&this.on("complete",t.onComplete.bind(this)),t.onUpdate&&this.on("update",t.onUpdate.bind(this)),this.init(),this.paused=!1}function Cs(t){Ds.call(this,t),t.from=t.from||{};for(const s in t.to)c.isUndefined(t.from[s])&&(t.from[s]=this.element[s]);this.ease=t.ease||bs.Ease.InOut,this.from=t.from,this.to=t.to}function Ls(t){Ds.call(this,t),this.dynamicProperties=[],this._mdf=!1,this.keyframes=c.copyJSON(t.keyframes),this.frameRate=t.frameRate||30,this.tpf=1e3/this.frameRate,this.ip=c.isUndefined(t.ip)?this.keyframes.ip:t.ip,this.op=c.isUndefined(t.ip)?this.keyframes.op:t.op,this.tfs=this.op-this.ip,this.duration=this.tfs*this.tpf,this.ignoreProps=c.isArray(t.ignoreProps)?t.ignoreProps:[],this.transform=new Ht(this,this.keyframes.ks)}function As(t,s){Ds.call(this,s),this.runners=[],this.queues=[],this.cursor=0,this.total=0,this.alternate=!1,t&&this.then(t)}Ds.prototype=Object.create(u.prototype),Ds.prototype.update=function(t){const s=this.direction*this.timeScale*t;if(this.waitCut>0)return void(this.waitCut-=Math.abs(s));if(this.paused||!this.living||this.delayCut>0)return void(this.delayCut>0&&(this.delayCut-=Math.abs(s)));this.progress+=s;let e=!1;const i=this.progress;let h;return this.spill()&&(this.repeatsCut>0||this.infinite?(this.repeatsCut>0&&--this.repeatsCut,this.delayCut=this.delay,this.alternate?(this.direction*=-1,this.progress=c.codomainBounce(this.progress,0,this.duration)):(this.direction=1,this.progress=c.euclideanModulo(this.progress,this.duration))):e=!0),e?(this.resident||(this.living=!1),this.progress=c.clamp(i,0,this.duration),h=this.nextPose(),this.emit("complete",h,i-this.progress)):(h=this.nextPose(),this.emit("update",h,this.progress/this.duration)),h},Ds.prototype.spill=function(){const t=this.progress<=0&&-1===this.direction,s=this.progress>=this.duration&&1===this.direction;return t||s},Ds.prototype.init=function(){this.direction=1,this.progress=0,this.repeatsCut=this.repeats,this.delayCut=this.delay,this.waitCut=this.wait},Ds.prototype.nextPose=function(){console.warn("should be overwrite")},Ds.prototype.linear=function(t,s,e){return(s-t)*e+t},Ds.prototype.setSpeed=function(t){return this.timeScale=t,this},Ds.prototype.pause=function(){return this.paused=!0,this},Ds.prototype.resume=function(){return this.paused=!1,this},Ds.prototype.restart=Ds.prototype.resume,Ds.prototype.stop=function(){return this.repeats=0,this.infinite=!1,this.progress=this.duration,this},Ds.prototype.cancel=function(){return this.living=!1,this},Cs.prototype=Object.create(Ds.prototype),Cs.prototype.nextPose=function(){const t={},s=this.ease(this.progress/this.duration);for(const e in this.to)void 0!==this.element[e]&&(this.element[e]=t[e]=this.linear(this.from[e],this.to[e],s));return t},Ls.prototype=Object.create(Ds.prototype),Ls.prototype.prepareProperties=function(t){const s=this.dynamicProperties.length;let e;for(e=0;e<s;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},Ls.prototype.addDynamicProperty=function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)},Ls.prototype.nextPose=function(){const t={},s=this.ip+this.progress/this.tpf;return this.prepareProperties(s),-1===this.ignoreProps.indexOf("position")&&(-1===this.ignoreProps.indexOf("x")&&(t.x=this.element.x=this.transform.x),-1===this.ignoreProps.indexOf("y")&&(t.y=this.element.y=this.transform.y)),-1===this.ignoreProps.indexOf("pivot")&&(t.pivot={},-1===this.ignoreProps.indexOf("pivotX")&&(t.pivot.x=this.element.pivot.x=this.transform.anchorX),-1===this.ignoreProps.indexOf("pivotY")&&(t.pivot.y=this.element.pivot.y=this.transform.anchorY)),-1===this.ignoreProps.indexOf("scale")&&(t.scale={},-1===this.ignoreProps.indexOf("scaleX")&&(t.scale.x=this.element.scale.x=this.transform.scaleX),-1===this.ignoreProps.indexOf("scaleY")&&(t.scale.y=this.element.scale.y=this.transform.scaleY)),-1===this.ignoreProps.indexOf("rotation")&&(t.rotation=this.element.rotation=this.transform.rotation),-1===this.ignoreProps.indexOf("alpha")&&(t.alpha=this.element.alpha=this.transform.alpha),t},As.prototype=Object.create(Ds.prototype),As.prototype.then=function(t){return this.queues.push(t),this.total=this.queues.length,this},As.prototype.nextOne=function(t,s){this.runners[this.cursor].init(),this.cursor++,this._residueTime=Math.abs(s)},As.prototype.initOne=function(){const t=this.queues[this.cursor];t.infinite=!1,t.resident=!0,t.element=this.element;let s=null;t.keyframes?s=new Ls(t):t.to&&(s=new Cs(t)),null!==s&&(s.on("complete",this.nextOne.bind(this)),this.runners.push(s))},As.prototype.nextPose=function(t){return!this.runners[this.cursor]&&this.queues[this.cursor]&&this.initOne(),this._residueTime>0&&(t+=this._residueTime,this._residueTime=0),this.runners[this.cursor].update(t)},As.prototype.update=function(t){if(this.wait>0)return void(this.wait-=Math.abs(t));if(this.paused||!this.living||this.delayCut>0)return void(this.delayCut>0&&(this.delayCut-=Math.abs(t)));const s=this.cursor,e=this.nextPose(this.timeScale*t);return this.emit("update",{index:s,pose:e},this.progress/this.duration),this.spill()&&(this.repeats>0||this.infinite?(this.repeats>0&&--this.repeats,this.delayCut=this.delay,this.cursor=0):(this.resident||(this.living=!1),this.emit("complete",e))),e},As.prototype.spill=function(){return this.cursor>=this.total};const Os={settings:e.settings,UPDATE_PRIORITY:e.UPDATE_PRIORITY,animationTicker:e.ticker.shared};function Fs(t){this.element=t,this.animates=[],this.timeScale=1,this.paused=!1,this.updateDeltaTime=this.updateDeltaTime.bind(this),Os.animationTicker.add(this.updateDeltaTime,Os.UPDATE_PRIORITY.HIGH)}Fs.prototype.clearAnimators=function(t){if(this.paused)return;const s=this.animates;for(let e=0;e<t.length;e++){const i=t[e];s[i].living||s[i].resident||this.animates.splice(i,1)}},Fs.prototype.updateDeltaTime=function(t){if(this.animates.length<=0)return;const s=t/Os.settings.TARGET_FPMS;this.update(s)},Fs.prototype.update=function(t){if(this.paused)return;if(this.animates.length<=0)return;t=this.timeScale*t;const s=[];for(let e=0;e<this.animates.length;e++)this.animates[e].living||this.animates[e].resident?this.animates[e].update(t):s.push(e);s.length>0&&this.clearAnimators(s)},Fs.prototype.animate=function(t,s){return t.element=this.element,this._addMove(new Cs(t),s)},Fs.prototype.queues=function(t,s,e){return s.element=this.element,this._addMove(new As(t,s),e)},Fs.prototype.bodymovin=function(t,s){return t.element=this.element,this._addMove(new Ls(t),s)},Fs.prototype._addMove=function(t,s){return s&&this.clearAll(),this.animates.push(t),t},Fs.prototype.pause=function(){this.paused=!0},Fs.prototype.resume=function(){this.paused=!1},Fs.prototype.restart=Fs.prototype.resume,Fs.prototype.setSpeed=function(t){this.timeScale=t},Fs.prototype.clearAll=function(){this.animates.length=0},e.DisplayObject.prototype.setupAnimations=function(){this.animations||(this.animations=new Fs(this))},e.DisplayObject.prototype.animate=function(t,s){return this.animations||this.setupAnimations(),this.animations.animate(t,s)},e.DisplayObject.prototype.queues=function(t,s={},e){return this.animations||this.setupAnimations(),this.animations.queues(t,s,e)},e.DisplayObject.prototype.bodymovin=function(t,s){return this.animations||this.setupAnimations(),this.animations.bodymovin(t,s)},Object.defineProperties(e.DisplayObject.prototype,{scaleXY:{get(){return this.scale.x},set(t){this.scale.set(t)}},scaleX:{get(){return this.scale.x},set(t){this.scale.x=t}},scaleY:{get(){return this.scale.y},set(t){this.scale.y=t}},pivotX:{get(){return this.pivot.x},set(t){this.pivot.x=t}},pivotY:{get(){return this.pivot.y},set(t){this.pivot.y=t}}}),e.Container.prototype.updateTransform=function(){this.emit("pretransform"),this._boundsID++,this.hierarchy&&this.hierarchy.transform?(this.hierarchy.updateTransform(),this.transform.updateTransform(this.hierarchy.transform)):this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,s=this.children.length;t<s;++t){const s=this.children[t];s.visible&&s.updateTransform()}this.emit("posttransform")},e.Container.prototype.containerUpdateTransform=e.Container.prototype.updateTransform;const{major:Is}=h(window.navigator.userAgent)||{};function Es(t){if(window.URL=window.URL||window.webkitURL,window.URL&&URL.createObjectURL){const s=function(t){let s=atob(t.split(",")[1]),e=new ArrayBuffer(s.length),i=new Uint8Array(e),h=t.split(",")[0].match(/:(.*?);/)[1];for(let t=0,e=s.length;t<e;t++)i[t]=s.charCodeAt(t);let r,n=[i];try{r=new Blob(n,{type:h})}catch(t){console.log(t)}return r}(t);return URL.createObjectURL(s)}return t}g(m.Texture,(function(t,s){return new Ts(t,s)})),g(m.Ajax,(function(t){return new Ps(t)})),qt(Vt.Null,as),qt(Vt.Path,class extends ks{constructor(t,s){super(),this.lottieElement=t,this.config=s,this.passMatrix=new e.Matrix}setShapeTransform(){const t=this.lottieElement.preTransforms.finalTransform.props;this.passMatrix.set(t[0],t[1],t[4],t[5],t[12],t[13]),this.transform.setFromMatrix(this.passMatrix)}updateTransform(){this.setShapeTransform(),this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++}updateLottieGrahpics(t){const s=t.type;if(this.clear(),("st"===s||"gs"===s)&&0===t.wi||!t.data._shouldRender||0===t.coOp)return;const e=t.elements,i=e.length;for(let t=0;t<i;t+=1){const s=e[t].trNodes,i=s.length;for(let t=0;t<i;t++)"m"==s[t].t?this.moveTo(s[t].p[0],s[t].p[1]):"c"==s[t].t?this.bezierCurveTo(s[t].pts[0],s[t].pts[1],s[t].pts[2],s[t].pts[3],s[t].pts[4],s[t].pts[5]):this.closePath()}"st"!==s&&"gs"!==s||(t.da?(this.lineStyle.lineDash=t.da,this.lineStyle.lineDashOffset=t.do):this.lineStyle.lineDash=[]),"st"===s||"gs"===s?(this.lineStyle.lineWidth=t.wi,this.lineStyle.lineCap=t.lc,this.lineStyle.lineJoin=t.lj,this.lineStyle.miterLimit=t.ml||0,this.color=c.rgb2hex(t.co||t.grd),this.alpha=t.coOp,this.stroke()):(this.color=c.rgb2hex(t.co||t.grd),this.alpha=t.coOp,this.fill())}}),qt(Vt.Shape,as),qt(Vt.Solid,Ss),qt(Vt.Sprite,xs),qt(Vt.Component,as),qt(Vt.Container,e.Container);var Ns=function(s){function e(){var t=null!==s&&s.apply(this,arguments)||this;return t.managerLife=["DisplayReady","ImageReady","success","error","complete","loopComplete","enterFrame","update"],t}return n(e,s),e.prototype.init=function(){this.renderSystem=this.game.getSystem("Renderer"),this.app=this.renderSystem.application},e.prototype.componentChanged=function(s){return o(this,void 0,void 0,(function(){return l(this,(function(e){return"Lottie"===s.componentName&&(s.type===t.OBSERVER_TYPE.ADD?this.add(s):s.type===t.OBSERVER_TYPE.REMOVE&&this.remove(s)),[2]}))}))},e.prototype.add=function(s){return o(this,void 0,void 0,(function(){var e,i,h,r,n,o,p,c;return l(this,(function(l){switch(l.label){case 0:return this.manager=new hs(this.app),e=s.component,(i=this.renderSystem.containerManager.getContainer(s.gameObject.id))?(h=e.options,r=h.resource,n=function(t,s){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&s.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(i=Object.getOwnPropertySymbols(t);h<i.length;h++)s.indexOf(i[h])<0&&Object.prototype.propertyIsEnumerable.call(t,i[h])&&(e[i[h]]=t[i[h]])}return e}(h,["resource"]),[4,t.resource.getResource(r)]):[2];case 1:return o=l.sent().data,p=a({},o.json||{}),(p.assets||[]).forEach((function(t){var s;t.p&&(t.p=(s=t.p,Is<=8&&/^data:image\/png;base64/.test(s)?Es(s):s))})),c=this.manager.parseAnimation(a({keyframes:p},n)),e.anim=c,i.addChildAt(c.group,0),this.managerLife.forEach((function(t){c.on(t,(function(s){return e.emit(t,s)}))})),c.isImagesLoaded&&e.emit("success",{}),[2]}}))}))},e.prototype.remove=function(t){var s=t.component,e=this.renderSystem.containerManager.getContainer(t.gameObject.id);e&&(e.removeChild(s.anim.group),s.anim.destroy()),s.anim=null},e.systemName="LottieSystem",e=function(t,s,e,i){var h,r=arguments.length,n=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,e,i);else for(var a=t.length-1;a>=0;a--)(h=t[a])&&(n=(r<3?h(n):r>3?h(s,e,n):h(s,e))||n);return r>3&&n&&Object.defineProperty(s,e,n),n}([t.decorators.componentObserver({Lottie:[]})],e),e}(s.Renderer),Vs=Ns,qs=function(t){function s(s){var e=t.call(this)||this;return e.loadStatus=!1,e.firstPlay=null,e.prevSlot={},e.currentSlot={},e.options=a({autoStart:!1},s),e.on("success",(function(){e.loadStatus=!0;for(var t=e.anim.keyframes,s=t.ip,i=t.op,h=function(t){var s="@"+t;e.anim.on(s,(function(t){return e.emit(s,t)}))},r=s;r<=i;r++)h(r);e.firstPlay&&e.firstPlay()})),e}return n(s,t),s.prototype.play=function(t,s){var i=this;if(void 0===t&&(t=[]),void 0===s&&(s={repeats:0}),this.loadStatus){var h=s.slot;(void 0===h?[]:h).forEach((function(t){var s=t.name,h=t.type,r=t.value,n=t.style,a=void 0===n?{}:n,o=a.x,l=a.y,p=a.anchor,c=void 0===p?{x:0,y:0}:p,u=a.pivot,d=void 0===u?{x:0,y:0}:u,f=a.width,m=a.height;"IMAGE"===h?i.currentSlot[s]=e.Sprite.from(r):"TEXT"===h&&(i.currentSlot[s]=new e.Text(r,new e.TextStyle(a))),o&&(i.currentSlot[s].x=o),l&&(i.currentSlot[s].y=l),f&&(i.currentSlot[s].width=f),m&&(i.currentSlot[s].height=m),i.currentSlot[s].anchor.set(c.x||0,c.y||0),i.currentSlot[s].pivot.set(i.currentSlot[s].width*(d.x||0),i.currentSlot[s].height*(d.y||0)),i.prevSlot[s]&&i.anim.unbindSlot(s,i.prevSlot[s]),i.anim.bindSlot(s,i.currentSlot[s]),i.prevSlot[s]=i.currentSlot[s]})),this.anim.playSegment(this.playParamsHandle(t),s)}else this.firstPlay=function(){i.play(t,s)}},s.prototype.playParamsHandle=function(t){var s=[].concat(t),e=this.anim.keyframes;return!s.length||s.length>2?s=[e.ip,e.op]:1===s.length&&(s=[s[0]%e.op,e.op]),s},s.prototype.onTap=function(t,s){var i=this,h=new e.Graphics;this.on("success",(function(){var e=i.anim.querySelector(t),r=e.display;h.beginFill(16777215),h.drawRect(0,0,100,100),h.endFill(),h.alpha=0,r.addChild(h),e.display.interactive=!0,e.display.on("pointertap",(function(){s()}))}))},s.componentName="Lottie",s}(t.Component),js=qs;t.resource.registerResourceType("LOTTIE"),exports.Lottie=js,exports.LottieSystem=Vs;
23
+ */var Et=function(){var t=Math.cos,s=Math.sin,e=Math.tan,i=Math.round;function h(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function r(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(i,-h,0,0,h,i,0,0,0,0,1,0,0,0,0,1)}function n(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(1,0,0,0,0,i,-h,0,0,h,i,0,0,0,0,1)}function a(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(i,0,h,0,0,1,0,0,-h,0,i,0,0,0,0,1)}function o(e){if(0===e)return this;var i=t(e),h=s(e);return this._t(i,-h,0,0,h,i,0,0,0,0,1,0,0,0,0,1)}function l(t,s){return this._t(1,s,t,1,0,0)}function p(t,s){return this.shear(e(t),e(s))}function c(i,h){var r=t(h),n=s(h);return this._t(r,n,0,0,-n,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,e(i),1,0,0,0,0,1,0,0,0,0,1)._t(r,-n,0,0,n,r,0,0,0,0,1,0,0,0,0,1)}function u(t,s,e){return e||0===e||(e=1),1===t&&1===s&&1===e?this:this._t(t,0,0,0,0,s,0,0,0,0,e,0,0,0,0,1)}function d(t,s,e,i,h,r,n,a,o,l,p,c,u,d,f,m){return this.props[0]=t,this.props[1]=s,this.props[2]=e,this.props[3]=i,this.props[4]=h,this.props[5]=r,this.props[6]=n,this.props[7]=a,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=c,this.props[12]=u,this.props[13]=d,this.props[14]=f,this.props[15]=m,this}function f(t,s,e){return e=e||0,0!==t||0!==s||0!==e?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,s,e,1):this}function m(t,s,e,i,h,r,n,a,o,l,p,c,u,d,f,m){var g=this.props;if(1===t&&0===s&&0===e&&0===i&&0===h&&1===r&&0===n&&0===a&&0===o&&0===l&&1===p&&0===c)return g[12]=g[12]*t+g[15]*u,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*f,g[15]=g[15]*m,this._identityCalculated=!1,this;var y=g[0],v=g[1],_=g[2],k=g[3],S=g[4],x=g[5],M=g[6],T=g[7],w=g[8],P=g[9],b=g[10],D=g[11],C=g[12],L=g[13],A=g[14],O=g[15];return g[0]=y*t+v*h+_*o+k*u,g[1]=y*s+v*r+_*l+k*d,g[2]=y*e+v*n+_*p+k*f,g[3]=y*i+v*a+_*c+k*m,g[4]=S*t+x*h+M*o+T*u,g[5]=S*s+x*r+M*l+T*d,g[6]=S*e+x*n+M*p+T*f,g[7]=S*i+x*a+M*c+T*m,g[8]=w*t+P*h+b*o+D*u,g[9]=w*s+P*r+b*l+D*d,g[10]=w*e+P*n+b*p+D*f,g[11]=w*i+P*a+b*c+D*m,g[12]=C*t+L*h+A*o+O*u,g[13]=C*s+L*r+A*l+O*d,g[14]=C*e+L*n+A*p+O*f,g[15]=C*i+L*a+A*c+O*m,this._identityCalculated=!1,this}function g(){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}function y(t){for(var s=0;s<16;){if(t.props[s]!==this.props[s])return!1;s+=1}return!0}function v(t){var s;for(s=0;s<16;s+=1)t.props[s]=this.props[s]}function _(t){var s;for(s=0;s<16;s+=1)this.props[s]=t[s]}function k(t,s,e){return{x:t*this.props[0]+s*this.props[4]+e*this.props[8]+this.props[12],y:t*this.props[1]+s*this.props[5]+e*this.props[9]+this.props[13],z:t*this.props[2]+s*this.props[6]+e*this.props[10]+this.props[14]}}function S(t,s,e){return t*this.props[0]+s*this.props[4]+e*this.props[8]+this.props[12]}function x(t,s,e){return t*this.props[1]+s*this.props[5]+e*this.props[9]+this.props[13]}function M(t,s,e){return t*this.props[2]+s*this.props[6]+e*this.props[10]+this.props[14]}function T(t){var s=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/s,i=-this.props[1]/s,h=-this.props[4]/s,r=this.props[0]/s,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/s,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/s;return[t[0]*e+t[1]*h+n,t[0]*i+t[1]*r+a,0]}function w(t){var s,e=t.length,i=[];for(s=0;s<e;s+=1)i[s]=T(t[s]);return i}function P(t,s,e){var i=X("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=s[0],i[3]=s[1],i[4]=e[0],i[5]=e[1];else{var h=this.props[0],r=this.props[1],n=this.props[4],a=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*h+t[1]*n+o,i[1]=t[0]*r+t[1]*a+l,i[2]=s[0]*h+s[1]*n+o,i[3]=s[0]*r+s[1]*a+l,i[4]=e[0]*h+e[1]*n+o,i[5]=e[0]*r+e[1]*a+l}return i}function b(t,s,e){return this.isIdentity()?[t,s,e]:[t*this.props[0]+s*this.props[4]+e*this.props[8]+this.props[12],t*this.props[1]+s*this.props[5]+e*this.props[9]+this.props[13],t*this.props[2]+s*this.props[6]+e*this.props[10]+this.props[14]]}function D(t,s){if(this.isIdentity())return t+","+s;var e=this.props;return Math.round(100*(t*e[0]+s*e[4]+e[12]))/100+","+Math.round(100*(t*e[1]+s*e[5]+e[13]))/100}function C(){for(var t=0,s=this.props,e="matrix3d(";t<16;)e+=i(1e4*s[t])/1e4,e+=15===t?")":",",t+=1;return e}function L(t){return t<1e-6&&t>0||t>-1e-6&&t<0?i(1e4*t)/1e4:t}function A(){var t=this.props;return"matrix("+L(t[0])+","+L(t[1])+","+L(t[4])+","+L(t[5])+","+L(t[12])+","+L(t[13])+")"}return function(){this.reset=h,this.rotate=r,this.rotateX=n,this.rotateY=a,this.rotateZ=o,this.skew=p,this.skewFromAxis=c,this.shear=l,this.scale=u,this.setTransform=d,this.translate=f,this.transform=m,this.applyToPoint=k,this.applyToX=S,this.applyToY=x,this.applyToZ=M,this.applyToPointArray=b,this.applyToTriplePoints=P,this.applyToPointStringified=D,this.toCSS=C,this.to2dCSS=A,this.clone=v,this.cloneFromProps=_,this.equals=y,this.inversePoints=w,this.inversePoint=T,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=X("float32",16),this.reset()}}();class Nt{constructor(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}addTransformSequence(t){const s=t.length;let e="_";for(let i=0;i<s;i+=1)e+=t[i].transform.key+"_";let i=this.sequences[e];return i||(i={transforms:[].concat(t),finalTransform:new Et,_mdf:!1},this.sequences[e]=i,this.sequenceList.push(i)),i}processSequence(t,s){let e=0,i=s;const h=t.transforms.length;for(;e<h&&!s;){if(t.transforms[e].transform.mProps._mdf){i=!0;break}e+=1}if(i){let s;for(t.finalTransform.reset(),e=h-1;e>=0;e-=1)s=t.transforms[e].transform.mProps.v.props,t.finalTransform.transform(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12],s[13],s[14],s[15])}t._mdf=i}processSequences(t){const s=this.sequenceList.length;for(let e=0;e<s;e+=1)this.processSequence(this.sequenceList[e],t)}getNewKey(){return"_"+this.transform_key_count++}}class Vt{constructor(t,s){this.elem=t,this.pos=s}}class qt{constructor(t,s,e,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];let h=4;"rc"==s.ty?h=5:"el"==s.ty?h=6:"sr"==s.ty&&(h=7),this.sh=Ft(t,s,h);const r=e.length;for(let t=0;t<r;t+=1)if(!e[t].closed){const s={transforms:i.addTransformSequence(e[t].transforms),trNodes:[]};this.styledShapes.push(s),e[t].elements.push(s)}}setAsAnimated(){this._isAnimated=!0}}const jt={};function Rt(t){return jt[t]}var Xt={Null:"Null",Path:"Path",Shape:"Shape",Solid:"Solid",Sprite:"Sprite",Component:"Component",Container:"Container"},Yt=function(t,s){jt[t]=s};class Bt{constructor(t,s,e){this.elem=t,this.data=s,this.type=s.ty,this.preTransforms=e,this.transforms=[],this.elements=[],this.closed=!0===s.hd,this.displayType=Xt.Path;const i=Rt(this.displayType);this.display=new i(this,s),this.elem.innerDisplay?this.elem.innerDisplay.addChild(this.display):this.elem.display.addChild(this.display)}updateGrahpics(){this.display.updateLottieGrahpics(this)}}class Gt extends Q{constructor(t,s,e){if(super(),this.elem=t,this.frameId=-1,this.propType="transform",this.data=s,this.v=new Et,this.pre=new Et,this.appliedTransformations=0,this.initDynamicPropertyContainer(e||t),s.p&&s.p.s?(this.px=wt(t,s.p.x,0,0,this),this.py=wt(t,s.p.y,0,0,this),s.p.z&&(this.pz=wt(t,s.p.z,0,0,this))):this.p=wt(t,s.p||{k:[0,0,0]},1,0,this),s.rx){if(this.rx=wt(t,s.rx,0,pt,this),this.ry=wt(t,s.ry,0,pt,this),this.rz=wt(t,s.rz,0,pt,this),s.or.k[0].ti){let t,e=s.or.k.length;for(t=0;t<e;t+=1)s.or.k[t].to=s.or.k[t].ti=null}this.or=wt(t,s.or,1,pt,this),this.or.sh=!0}else this.r=wt(t,s.r||{k:0},0,pt,this);s.sk&&(this.sk=wt(t,s.sk,0,pt,this),this.sa=wt(t,s.sa,0,pt,this)),this.a=wt(t,s.a||{k:[0,0,0]},1,0,this),this.s=wt(t,s.s||{k:[100,100,100]},1,.01,this),s.o?this.o=wt(t,s.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(-999999,!0)}getValue(t,s){if(t!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||s){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&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,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){let t,s;const e=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(t=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),s=this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(t=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),s=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(t=this.p.pv,s=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){t=[],s=[];let i=this.px,h=this.py;i._caching.lastFrame+i.offsetTime<=i.keyframes[0].t?(t[0]=i.getValueAtTime((i.keyframes[0].t+.01)/e,0),t[1]=h.getValueAtTime((h.keyframes[0].t+.01)/e,0),s[0]=i.getValueAtTime(i.keyframes[0].t/e,0),s[1]=h.getValueAtTime(h.keyframes[0].t/e,0)):i._caching.lastFrame+i.offsetTime>=i.keyframes[i.keyframes.length-1].t?(t[0]=i.getValueAtTime(i.keyframes[i.keyframes.length-1].t/e,0),t[1]=h.getValueAtTime(h.keyframes[h.keyframes.length-1].t/e,0),s[0]=i.getValueAtTime((i.keyframes[i.keyframes.length-1].t-.01)/e,0),s[1]=h.getValueAtTime((h.keyframes[h.keyframes.length-1].t-.01)/e,0)):(t=[i.pv,h.pv],s[0]=i.getValueAtTime((i._caching.lastFrame+i.offsetTime-.01)/e,i.offsetTime),s[1]=h.getValueAtTime((h._caching.lastFrame+h.offsetTime-.01)/e,h.offsetTime))}else t=s=ct;this.v.rotate(-Math.atan2(t[1]-s[1],t[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=t}}precalculateMatrix(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){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||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}}applyToMatrix(t){let s=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||s,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,this.sa.v),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}}function Ut(t,s,e){return new Gt(t,s,e)}class zt extends Q{initModifierProperties(){}addShapeToModifier(){}addShape(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);const s={shape:t.sh,data:t,localShapeCollection:$()};this.shapes.push(s),this.addShapeToModifier(s),this._isAnimated&&t.setAsAnimated()}}init(t,s){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,s),this.frameId=-999999,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)}processKeys(t){t!==this.frameId&&(this.frameId=t,this.iterateDynamicProperties(t))}}const Wt={};function Jt(t,s){Wt[t]||(Wt[t]=s)}Jt("tm",class extends zt{initModifierProperties(t,s){this.s=wt(t,s.s,0,.01,this),this.e=wt(t,s.e,0,.01,this),this.o=wt(t,s.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=s.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length}addShapeToModifier(t){t.pathsData=[]}calculateShapeEdges(t,s,e,i,h){let r=[];s<=1?r.push({s:t,e:s}):t>=1?r.push({s:t-1,e:s-1}):(r.push({s:t,e:1}),r.push({s:0,e:s-1}));let n,a,o=[],l=r.length;for(n=0;n<l;n+=1)if(a=r[n],a.e*h<i||a.s*h>i+e);else{let t,s;t=a.s*h<=i?0:(a.s*h-i)/e,s=a.e*h>=i+e?1:(a.e*h-i)/e,o.push([t,s])}return o.length||o.push([0,0]),o}releasePathsData(t){const s=t.length;for(let e=0;e<s;e+=1)st.release(t[e]);return t.length=0,t}processShapes(t){let s,e,i,h;if(this._mdf||t){let t=this.o.v%360/360;if(t<0&&(t+=1),s=(this.s.v>1?1:this.s.v<0?0:this.s.v)+t,e=(this.e.v>1?1:this.e.v<0?0:this.e.v)+t,s>e){let t=s;s=e,e=t}s=1e-4*Math.round(1e4*s),e=1e-4*Math.round(1e4*e),this.sValue=s,this.eValue=e}else s=this.sValue,e=this.eValue;let r,n,a,o,l,p=this.shapes.length,c=0;if(e===s)for(h=0;h<p;h+=1)this.shapes[h].localShapeCollection.releaseShapes(),this.shapes[h].shape._mdf=!0,this.shapes[h].shape.paths=this.shapes[h].localShapeCollection,this._mdf&&(this.shapes[h].pathsData.length=0);else if(1===e&&0===s||0===e&&1===s){if(this._mdf)for(h=0;h<p;h+=1)this.shapes[h].pathsData.length=0,this.shapes[h].shape._mdf=!0}else{let u,d,f=[];for(h=0;h<p;h+=1)if(u=this.shapes[h],u.shape._mdf||this._mdf||t||2===this.m){if(i=u.shape.paths,n=i._length,l=0,!u.shape._mdf&&u.pathsData.length)l=u.totalShapeLength;else{for(a=this.releasePathsData(u.pathsData),r=0;r<n;r+=1)o=lt.getSegmentsLength(i.shapes[r]),a.push(o),l+=o.totalLength;u.totalShapeLength=l,u.pathsData=a}c+=l,u.shape._mdf=!0}else u.shape.paths=u.localShapeCollection;let m,g=s,y=e,v=0;for(h=p-1;h>=0;h-=1)if(u=this.shapes[h],u.shape._mdf){for(d=u.localShapeCollection,d.releaseShapes(),2===this.m&&p>1?(m=this.calculateShapeEdges(s,e,u.totalShapeLength,v,c),v+=u.totalShapeLength):m=[[g,y]],n=m.length,r=0;r<n;r+=1){g=m[r][0],y=m[r][1],f.length=0,y<=1?f.push({s:u.totalShapeLength*g,e:u.totalShapeLength*y}):g>=1?f.push({s:u.totalShapeLength*(g-1),e:u.totalShapeLength*(y-1)}):(f.push({s:u.totalShapeLength*g,e:u.totalShapeLength}),f.push({s:0,e:u.totalShapeLength*(y-1)}));let t=this.addShapes(u,f[0]);if(f[0].s!==f[0].e){if(f.length>1)if(u.shape.paths.shapes[u.shape.paths._length-1].c){let s=t.pop();this.addPaths(t,d),t=this.addShapes(u,f[1],s)}else this.addPaths(t,d),t=this.addShapes(u,f[1]);this.addPaths(t,d)}}u.shape.paths=d}}}addPaths(t,s){const e=t.length;for(let i=0;i<e;i+=1)s.addShape(t[i])}addSegment(t,s,e,i,h,r,n){h.setXYAt(s[0],s[1],"o",r),h.setXYAt(e[0],e[1],"i",r+1),n&&h.setXYAt(t[0],t[1],"v",r),h.setXYAt(i[0],i[1],"v",r+1)}addSegmentFromArray(t,s,e,i){s.setXYAt(t[1],t[5],"o",e),s.setXYAt(t[2],t[6],"i",e+1),i&&s.setXYAt(t[0],t[4],"v",e),s.setXYAt(t[3],t[7],"v",e+1)}addShapes(t,s,e){let i,h,r,n,a,o,l,p,c=t.pathsData,u=t.shape.paths.shapes,d=t.shape.paths._length,f=0,m=[],g=!0;for(e?(a=e._length,p=e._length):(e=W.newElement(),a=0,p=0),m.push(e),i=0;i<d;i+=1){for(o=c[i].lengths,e.c=u[i].c,r=u[i].c?o.length:o.length+1,h=1;h<r;h+=1)if(n=o[h-1],f+n.addedLength<s.s)f+=n.addedLength,e.c=!1;else{if(f>s.e){e.c=!1;break}s.s<=f&&s.e>=f+n.addedLength?(this.addSegment(u[i].v[h-1],u[i].o[h-1],u[i].i[h],u[i].v[h],e,a,g),g=!1):(l=lt.getNewSegment(u[i].v[h-1],u[i].v[h],u[i].o[h-1],u[i].i[h],(s.s-f)/n.addedLength,(s.e-f)/n.addedLength,o[h-1]),this.addSegmentFromArray(l,e,a,g),g=!1,e.c=!1),f+=n.addedLength,a+=1}if(u[i].c&&o.length){if(n=o[h-1],f<=s.e){let t=o[h-1].addedLength;s.s<=f&&s.e>=f+t?(this.addSegment(u[i].v[h-1],u[i].o[h-1],u[i].i[0],u[i].v[0],e,a,g),g=!1):(l=lt.getNewSegment(u[i].v[h-1],u[i].v[0],u[i].o[h-1],u[i].i[0],(s.s-f)/t,(s.e-f)/t,o[h-1]),this.addSegmentFromArray(l,e,a,g),g=!1,e.c=!1)}else e.c=!1;f+=n.addedLength,a+=1}if(e._length&&(e.setXYAt(e.v[p][0],e.v[p][1],"i",p),e.setXYAt(e.v[e._length-1][0],e.v[e._length-1][1],"o",e._length-1)),f>s.e)break;i<d-1&&(e=W.newElement(),g=!0,m.push(e),a=0)}return m}}),Jt("rd",class extends zt{initModifierProperties(t,s){this.getValue=this.processKeys,this.rd=wt(t,s.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length}processPath(t,s){const e=W.newElement();let i;e.c=t.c;let h,r,n,a,o,l,p,c,u,d,f,m,g=t._length,y=0;for(i=0;i<g;i+=1)h=t.v[i],n=t.o[i],r=t.i[i],h[0]===n[0]&&h[1]===n[1]&&h[0]===r[0]&&h[1]===r[1]?0!==i&&i!==g-1||t.c?(a=0===i?t.v[g-1]:t.v[i-1],o=Math.sqrt(Math.pow(h[0]-a[0],2)+Math.pow(h[1]-a[1],2)),l=o?Math.min(o/2,s)/o:0,p=f=h[0]+(a[0]-h[0])*l,c=m=h[1]-(h[1]-a[1])*l,u=p-.5519*(p-h[0]),d=c-.5519*(c-h[1]),e.setTripleAt(p,c,u,d,f,m,y),y+=1,a=i===g-1?t.v[0]:t.v[i+1],o=Math.sqrt(Math.pow(h[0]-a[0],2)+Math.pow(h[1]-a[1],2)),l=o?Math.min(o/2,s)/o:0,p=u=h[0]+(a[0]-h[0])*l,c=d=h[1]+(a[1]-h[1])*l,f=p-.5519*(p-h[0]),m=c-.5519*(c-h[1]),e.setTripleAt(p,c,u,d,f,m,y),y+=1):(e.setTripleAt(h[0],h[1],n[0],n[1],r[0],r[1],y),y+=1):(e.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1);return e}processShapes(t){let s,e,i,h,r=this.shapes.length,n=this.rd.v;if(0!==n){let a,o;for(e=0;e<r;e+=1){if(a=this.shapes[e],o=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(o.releaseShapes(),a.shape._mdf=!0,s=a.shape.paths.shapes,h=a.shape.paths._length,i=0;i<h;i+=1)o.addShape(this.processPath(s[i],n));a.shape.paths=a.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)}}),Jt("rp",class extends zt{initModifierProperties(t,s){this.getValue=this.processKeys,this.c=wt(t,s.c,0,null,this),this.o=wt(t,s.o,0,null,this),this.tr=Ut(t,s.tr,this),this.so=wt(t,s.tr.so,0,.01,this),this.eo=wt(t,s.tr.eo,0,.01,this),this.data=s,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Et,this.rMatrix=new Et,this.sMatrix=new Et,this.tMatrix=new Et,this.matrix=new Et}applyTransforms(t,s,e,i,h,r){let n=r?-1:1,a=i.s.v[0]+(1-i.s.v[0])*(1-h),o=i.s.v[1]+(1-i.s.v[1])*(1-h);t.translate(i.p.v[0]*n*h,i.p.v[1]*n*h,i.p.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.rotate(-i.r.v*n*h),s.translate(i.a.v[0],i.a.v[1],i.a.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.scale(r?1/a:a,r?1/o:o),e.translate(i.a.v[0],i.a.v[1],i.a.v[2])}init(t,s,e,i){for(this.elem=t,this.arr=s,this.pos=e,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,s[e]);e>0;)e-=1,this._elements.unshift(s[e]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)}resetElements(t){const s=t.length;for(let e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)}cloneElements(t){let s=JSON.parse(JSON.stringify(t));return this.resetElements(s),s}changeGroupRender(t,s){const e=t.length;for(let i=0;i<e;i+=1)t[i]._render=s,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,s)}processShapes(t){if(this._mdf||t){let t=Math.ceil(this.c.v);if(this._groups.length<t){for(;this._groups.length<t;){let t={it:this.cloneElements(this._elements),ty:"gr"};t.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,t),this._groups.splice(0,0,t),this._currentCopies+=1}this.elem.reloadShapes()}let s,e,i=0;for(s=0;s<=this._groups.length-1;s+=1)e=i<t,this._groups[s]._render=e,this.changeGroupRender(this._groups[s].it,e),i+=1;this._currentCopies=t;let h=this.o.v,r=h%1,n=h>0?Math.floor(h):Math.ceil(h),a=this.pMatrix.props,o=this.rMatrix.props,l=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();let p=0;if(h>0){for(;p<n;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),p+=1;r&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,r,!1),p+=r)}else if(h<0){for(;p>n;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),p-=1;r&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-r,!0),p-=r)}s=1===this.data.m?0:this._currentCopies-1;const c=1===this.data.m?1:-1;for(i=this._currentCopies;i;){const t=this.elemsData[s].it,e=t[t.length-1].transform.mProps.v.props,h=e.length;if(t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),0!==p){(0!==s&&1===c||s!==this._currentCopies-1&&-1===c)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],o[8],o[9],o[10],o[11],o[12],o[13],o[14],o[15]),this.matrix.transform(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15]),this.matrix.transform(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]);for(let t=0;t<h;t+=1)e[t]=this.matrix.props[t];this.matrix.reset()}else{this.matrix.reset();for(let t=0;t<h;t+=1)e[t]=this.matrix.props[t]}p+=1,i-=1,s+=c}}else{let t=this._currentCopies,s=0;const e=1;for(;t;){const i=this.elemsData[s].it;i[i.length-1].transform.mProps._mdf=!1,i[i.length-1].transform.op._mdf=!1,t-=1,s+=e}}}addShape(){}}),Jt("ms",class extends zt{initModifierProperties(t,s){this.getValue=this.processKeys,this.data=s,this.positions=[]}processKeys(t,s){(t!==this.frameId||s)&&(this._mdf=!0)}addShapeToModifier(){this.positions.push([])}processPath(t,s,e){let i,h,r,n,a=t.v.length,o=[],l=[],p=[];for(i=0;i<a;i+=1){e.v[i]||(e.v[i]=[t.v[i][0],t.v[i][1]],e.o[i]=[t.o[i][0],t.o[i][1]],e.i[i]=[t.i[i][0],t.i[i][1]],e.distV[i]=0,e.distO[i]=0,e.distI[i]=0),h=Math.atan2(t.v[i][1]-s[1],t.v[i][0]-s[0]),r=s[0]-e.v[i][0],n=s[1]-e.v[i][1];let a=Math.sqrt(r*r+n*n);e.distV[i]+=(a-e.distV[i])*this.data.dc,e.v[i][0]=Math.cos(h)*Math.max(0,this.data.maxDist-e.distV[i])/2+t.v[i][0],e.v[i][1]=Math.sin(h)*Math.max(0,this.data.maxDist-e.distV[i])/2+t.v[i][1],h=Math.atan2(t.o[i][1]-s[1],t.o[i][0]-s[0]),r=s[0]-e.o[i][0],n=s[1]-e.o[i][1],a=Math.sqrt(r*r+n*n),e.distO[i]+=(a-e.distO[i])*this.data.dc,e.o[i][0]=Math.cos(h)*Math.max(0,this.data.maxDist-e.distO[i])/2+t.o[i][0],e.o[i][1]=Math.sin(h)*Math.max(0,this.data.maxDist-e.distO[i])/2+t.o[i][1],h=Math.atan2(t.i[i][1]-s[1],t.i[i][0]-s[0]),r=s[0]-e.i[i][0],n=s[1]-e.i[i][1],a=Math.sqrt(r*r+n*n),e.distI[i]+=(a-e.distI[i])*this.data.dc,e.i[i][0]=Math.cos(h)*Math.max(0,this.data.maxDist-e.distI[i])/2+t.i[i][0],e.i[i][1]=Math.sin(h)*Math.max(0,this.data.maxDist-e.distI[i])/2+t.i[i][1],o.push(e.v[i]),l.push(e.o[i]),p.push(e.i[i])}return{v:o,o:l,i:p,c:t.c}}processShapes(){let t,s,e,i,h=this.elem.globalData.mouseX,r=this.elem.globalData.mouseY,n=this.shapes.length;if(h){let a,o=this.elem.globalToLocal([h,r,0]),l=[];for(s=0;s<n;s+=1)if(a=this.shapes[s],a.shape._mdf||this._mdf){for(a.shape._mdf=!0,t=a.shape.paths,i=t.length,e=0;e<i;e+=1)this.positions[s][e]||(this.positions[s][e]={v:[],o:[],i:[],distV:[],distO:[],distI:[]}),l.push(this.processPath(t[e],o,this.positions[s][e]));a.shape.paths=l,a.last=l}else a.shape.paths=a.last}}});var Ht=function(t,s,e){return new Wt[t](s,e)};class Kt extends Q{constructor(t,s,e){let i;super(),this.elem=t,this.frameId=-1,this.dataProps=Y(s.length),this.k=!1,this.dashArray=X("float32",s.length?s.length-1:0),this.dashoffset=X("float32",1),this.initDynamicPropertyContainer(e);let h,r=s.length||0;for(i=0;i<r;i+=1)h=wt(t,s[i].v,0,0,this),this.k=h.k||this.k,this.dataProps[i]={n:s[i].n,p:h};this.k||this.getValue(!0),this._isAnimated=this.k}getValue(t,s){if((t!==this.frameId||s)&&(this.frameId=t,this.iterateDynamicProperties(),this._mdf=this._mdf||s,this._mdf)){let t=0,s=this.dataProps.length;for(t=0;t<s;t+=1)"o"!=this.dataProps[t].n?this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}}}class Zt extends Q{constructor(t,s,e){super(),this.data=s,this.c=X("uint8c",4*s.p);let i=s.k.k[0].s?s.k.k[0].s.length-4*s.p:s.k.k.length-4*s.p;this.o=X("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(e),this.prop=wt(t,s.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}comparePoints(t,s){let e,i=0,h=this.o.length/2;for(;i<h;){if(e=Math.abs(t[4*i]-t[4*s+2*i]),e>.01)return!1;i+=1}return!0}checkCollapsable(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s){let t=0,s=this.data.k.k.length;for(;t<s;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0}getValue(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){let s,e,i,h=4*this.data.p;for(s=0;s<h;s+=1)e=s%4==0?100:255,i=Math.round(this.prop.v[s]*e),this.c[s]!==i&&(this.c[s]=i,this._cmdf=!t);if(this.o.length)for(h=this.prop.v.length,s=4*this.data.p;s<h;s+=1)e=s%2==0?100:1,i=s%2==0?Math.round(100*this.prop.v[s]):this.prop.v[s],this.o[s-4*this.data.p]!==i&&(this.o[s-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}}}class $t extends Q{constructor(t,s,e){super(),this.frameId=-1,this.keyframesManager=t,this.elem=t.elem,this.session=e,this.shapes=[],this.shapesData=s,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new Nt,this.initDynamicPropertyContainer(t),this.lcEnum={1:"butt",2:"round",3:"square"},this.ljEnum={1:"miter",2:"round",3:"bevel"},this._isFirstFrame=!0,this.transformHelper={opacity:1,_opMdf:!1},this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),this._isAnimated||(this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.updateModifiers(this.frameId),this.transformsManager.processSequences(this._isFirstFrame),this.updateShape(this.transformHelper,this.shapesData,this.itemsData),this.updateGrahpics())}createStyleElement(t,s){const e=new Bt(this.elem,t,this.transformsManager.addTransformSequence(s)),i={};if("fl"==t.ty||"st"==t.ty?(i.c=wt(this,t.c,1,255,this),i.c.k||(e.co=i.c.v)):"gf"!==t.ty&&"gs"!==t.ty||(i.s=wt(this,t.s,1,null,this),i.e=wt(this,t.e,1,null,this),i.h=wt(this,t.h||{k:0},0,.01,this),i.a=wt(this,t.a||{k:0},0,pt,this),i.g=new Zt(this,t.g,this)),i.o=wt(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(e.lc=this.lcEnum[t.lc]||"round",e.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(e.ml=t.ml),i.w=wt(this,t.w,0,null,this),i.w.k||(e.wi=i.w.v),t.d){let s=new Kt(this,t.d,"canvas",this);i.d=s,i.d.k||(e.da=i.d.dashArray,e.do=i.d.dashoffset[0])}}else e.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(e),i.style=e,i}addShapeToModifiers(t){let s,e=this.shapeModifiers.length;for(s=0;s<e;s+=1)this.shapeModifiers[s].addShape(t)}isShapeInAnimatedModifiers(t){let s=this.shapeModifiers.length;for(;0<s;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1}updateModifiers(t){if(!this.shapeModifiers.length)return;let s,e=this.shapes.length;for(s=0;s<e;s+=1)this.shapes[s].sh.reset();for(e=this.shapeModifiers.length,s=e-1;s>=0;s-=1)this.shapeModifiers[s].processShapes(t,this._isFirstFrame)}searchProcessedElement(t){let s=this.processedElements,e=0,i=s.length;for(;e<i;){if(s[e].elem===t)return s[e].pos;e+=1}return 0}addProcessedElement(t,s){let e=this.processedElements,i=e.length;for(;i;)if(i-=1,e[i].elem===t)return void(e[i].pos=s);e.push(new Vt(t,s))}createGroupElement(){return{it:[],prevViewData:[]}}createTransformElement(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:wt(this,t.o,0,.01,this),mProps:Ut(this,t,this)}}}createShapeElement(t){const s=new qt(this,t,this.stylesList,this.transformsManager);return this.shapes.push(s),this.addShapeToModifiers(s),s}reloadShapes(){let t;this._isFirstFrame=!0;let s=this.itemsData.length;for(t=0;t<s;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),s=this.dynamicProperties.length,t=0;t<s;t+=1)this.dynamicProperties[t].getValue();this.updateModifiers(),this.transformsManager.processSequences(this._isFirstFrame)}addTransformToStyleList(t){const s=this.stylesList.length;for(let e=0;e<s;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)}removeTransformFromStyleList(){const t=this.stylesList.length;for(let s=0;s<t;s+=1)this.stylesList[s].closed||this.stylesList[s].transforms.pop()}closeStyles(t){const s=t.length;for(let e=0;e<s;e+=1)t[e].closed=!0}searchShapes(t,s,e,i,h){let r,n,a,o,l,p,c=t.length-1,u=[],d=[],f=[].concat(h);for(r=c;r>=0;r-=1){if(o=this.searchProcessedElement(t[r]),o?s[r]=e[o-1]:t[r]._shouldRender=i,"fl"==t[r].ty||"st"==t[r].ty||"gf"==t[r].ty||"gs"==t[r].ty)o?s[r].style.closed=!1:s[r]=this.createStyleElement(t[r],f),u.push(s[r].style);else if("gr"==t[r].ty){if(o)for(a=s[r].it.length,n=0;n<a;n+=1)s[r].prevViewData[n]=s[r].it[n];else s[r]=this.createGroupElement(t[r]);this.searchShapes(t[r].it,s[r].it,s[r].prevViewData,i,f)}else"tr"==t[r].ty?(o||(p=this.createTransformElement(t[r]),s[r]=p),f.push(s[r]),this.addTransformToStyleList(s[r])):"sh"==t[r].ty||"rc"==t[r].ty||"el"==t[r].ty||"sr"==t[r].ty?o||(s[r]=this.createShapeElement(t[r])):"tm"==t[r].ty||"rd"==t[r].ty?(o?(l=s[r],l.closed=!1):(l=Ht(t[r].ty),l.init(this,t[r]),s[r]=l,this.shapeModifiers.push(l)),d.push(l)):"rp"==t[r].ty&&(o?(l=s[r],l.closed=!0):(l=Ht(t[r].ty),s[r]=l,l.init(this,t,r,s),this.shapeModifiers.push(l),i=!1),d.push(l));this.addProcessedElement(t[r],r+1)}for(this.removeTransformFromStyleList(),this.closeStyles(u),c=d.length,r=0;r<c;r+=1)d[r].closed=!0}updateShapeTransform(t,s){(t._opMdf||s.op._mdf||this._isFirstFrame)&&(s.opacity=t.opacity,s.opacity*=s.op.v,s._opMdf=!0)}updateStyledShape(t,s){if(this._isFirstFrame||s._mdf||t.transforms._mdf){let e,i,h,r=t.trNodes,n=s.paths,a=n._length;r.length=0;let o=t.transforms.finalTransform;for(h=0;h<a;h+=1){let t=n.shapes[h];if(t&&t.v){for(i=t._length,e=1;e<i;e+=1)1===e&&r.push({t:"m",p:o.applyToPointArray(t.v[0][0],t.v[0][1],0)}),r.push({t:"c",pts:o.applyToTriplePoints(t.o[e-1],t.i[e],t.v[e])});1===i&&r.push({t:"m",p:o.applyToPointArray(t.v[0][0],t.v[0][1],0)}),t.c&&i&&(r.push({t:"c",pts:o.applyToTriplePoints(t.o[e-1],t.i[0],t.v[0])}),r.push({t:"z"}))}}t.trNodes=r}}updatePath(t,s){if(!0!==t.hd&&t._shouldRender){let t,e=s.styledShapes.length;for(t=0;t<e;t+=1)this.updateStyledShape(s.styledShapes[t],s.sh)}}updateFill(t,s,e){const i=s.style;(s.c._mdf||this._isFirstFrame)&&(i.co=s.c.v),(s.o._mdf||e._opMdf||this._isFirstFrame)&&(i.coOp=s.o.v*e.opacity)}updateStroke(t,s,e){let i=s.style,h=s.d;h&&(h._mdf||this._isFirstFrame)&&(i.da=h.dashArray,i.do=h.dashoffset[0]),(s.c._mdf||this._isFirstFrame)&&(i.co=s.c.v),(s.o._mdf||e._opMdf||this._isFirstFrame)&&(i.coOp=s.o.v*e.opacity),(s.w._mdf||this._isFirstFrame)&&(i.wi=s.w.v)}updateGradientFill(t,s,e){let i=s.style;i.grd=s.g.c,i.coOp=s.o.v*e.opacity}updateShape(t,s,e){let i=t;for(let h=s.length-1;h>=0;h-=1)"tr"==s[h].ty?(i=e[h].transform,this.updateShapeTransform(t,i)):"sh"==s[h].ty||"el"==s[h].ty||"rc"==s[h].ty||"sr"==s[h].ty?this.updatePath(s[h],e[h]):"fl"==s[h].ty?this.updateFill(s[h],e[h],i):"st"==s[h].ty?this.updateStroke(s[h],e[h],i):"gf"==s[h].ty||"gs"==s[h].ty?this.updateGradientFill(s[h],e[h],i):"gr"==s[h].ty&&this.updateShape(i,s[h].it,e[h].it)}updateGrahpics(){const t=this.stylesList.length;for(let s=0;s<t;s+=1)this.stylesList[s].updateGrahpics()}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.updateModifiers(t),this.transformsManager.processSequences(this._isFirstFrame),this.updateShape(this.transformHelper,this.shapesData,this.itemsData),this.updateGrahpics(),this.frameId=t)}}class Qt extends Gt{constructor(t,s,e){super(t,s),this.frameId=-1,this.hs=s,this.session=e}getValue(t){t!==this.frameId&&(this.iterateDynamicProperties(t),this.frameId=t)}get x(){return this.p?this.p.v[0]:this.px.v}get y(){return this.p?this.p.v[1]:this.py.v}get anchorX(){return this.a.v[0]}get anchorY(){return this.a.v[1]}get scaleX(){return this.s.v[0]}get scaleY(){return this.s.v[1]}get rotation(){return this.r&&this.r.v||0}get alpha(){return this.o.v}}class ts{constructor(t){this.elem=t,this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1,this.transform=null,this.masks=null,this.shapes=null,this._hasOutTypeExpression=!1,this.needUpdateOverlap=!1,this.isOverlapMode=!1,this.visible=!0,this._isFirstFrame=!0}initFrame(t,s){this.layer=t;const{local:e,global:i}=s;this.session=s,this.isOverlapLayer=this.layer.op>=e.op-e.st,this.isOverlapMode=i.overlapMode,this.parseLayer(t,s)}outTypeExpressionMode(){this._hasOutTypeExpression=!0,this.isOverlapLayer&&(this.needUpdateOverlap=!0)}prepareProperties(t,s){let e,i=this.dynamicProperties.length;for(e=0;e<i;e+=1)(s||this.needUpdateOverlap||this.elem._isParent&&"transform"===this.dynamicProperties[e].propType)&&(this.dynamicProperties[e].getValue(t),this.dynamicProperties[e]._mdf&&(this._mdf=!0))}addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}parseLayer({ks:t,hasMask:s,masksProperties:e,shapes:i,tm:h},r){if(t&&(this.transform=new Qt(this,t,r)),s&&(this.masks=new It(this,e,r)),i&&(this.shapes=new $t(this,i,r)),h){const{frameRate:t}=r.global;this.tm=wt(this,h,0,t,this)}}updateFrame(t){this._mdf=!1;const s=m.inRange(t,this.layer.ip,this.layer.op);this.isOverlapMode&&this.isOverlapLayer?this.visible=t>=this.layer.ip:this.visible=s,this.prepareProperties(t,s)}updateDisplay(){const t=this.elem.display;this.elem._isRoot||(this.visible?t.show():t.hide(),(this._mdf||this.transform._mdf||this._isFirstFrame)&&t.updateLottieTransform(this.transform),this.masks&&(this.masks._mdf||this._isFirstFrame)&&t.updateLottieMasks(this.masks)),this._isFirstFrame=!1}}class ss{constructor(t){this.data=t,void 0===this.data.sr&&(this.data.sr=1),this.offsetTime=t.st||0,this.fullname=t.nm||"",this.idname=t.ln||"",this.classnames=t.cl?t.cl.split(" "):[],this.bodymovin=new ts(this),this.displayType="",this.display=null,this.hierarchy=null,this.lottieTreeParent=null}initBodymovin(t,s){this.bodymovin.initFrame(t,s),this.display&&this.display.onSetupLottie&&this.display.onSetupLottie()}hasValidMasks(){return!(!this.bodymovin.masks||!this.bodymovin.masks.hasMasks)}setHierarchy(t){this.hierarchy=t,this.display.setHierarchy(t.display)}initDisplayInstance(t,s){return new(Rt(t))(this,s)}updateFrame(t){this.bodymovin.updateFrame(t),this.bodymovin.updateDisplay()}}class es extends ss{constructor(t,s){super(t);const{global:e}=s;this.session=s;const i={layer:t,session:s};if(e.maskComp){i.maskComp=e.maskComp;const{w:s,h:h}=t;i.viewport={w:s,h:h}}this.config=i,this.childNodes=[],this.displayType=Xt.Component,this.innerDisplay=null,this.display=this.initDisplayInstance(this.displayType,i),this.initBodymovin(t,s)}updateFrame(t){if(this.bodymovin.updateFrame(t),this.bodymovin.updateDisplay(),t-=this.offsetTime,this.bodymovin.tm){let s=this.bodymovin.tm.v;s===this.data.op&&(s=this.data.op-1),t=s}else t/=this.data.sr;for(let s=0;s<this.childNodes.length;s++)this.childNodes[s].updateFrame(t)}addChild(t){t.lottieTreeParent=this,this.childNodes.push(t),this.innerDisplay?this.innerDisplay.addChild(t.display):this.display.addChild(t.display)}}class is extends ss{constructor(t,s){super(t);const e={layer:t,session:s,rect:{x:0,y:0,width:t.sw,height:t.sh},color:t.sc};this.config=e,this.session=s,this.displayType=Xt.Solid,this.display=this.initDisplayInstance(this.displayType,e),this.initBodymovin(t,s)}}class hs extends ss{constructor(t,s){super(t);const{global:{textureLoader:e,assets:i}}=s,h=m.getAssets(t.refId,i),r={layer:t,session:s,texture:e.getTextureById(h.id),asset:h};this.config=r,this.session=s,this.displayType=Xt.Sprite,this.display=this.initDisplayInstance(this.displayType,r),this.initBodymovin(t,s)}}class rs extends ss{constructor(t,s){super(t);const e={layer:t,session:s};this.config=e,this.session=s,this.displayType=Xt.Shape,this.display=this.initDisplayInstance(this.displayType,e),this.initBodymovin(t,s)}}class ns extends ss{constructor(t,s){super(t);const e={layer:t,session:s};this.config=e,this.session=s,this.displayType=Xt.Null,this.display=this.initDisplayInstance(this.displayType,e),this.initBodymovin(t,s)}}class as extends g{constructor(t){super(),this.living=!0,this.infinite=t.infinite||!1,this.repeats=t.repeats||0,this.alternate=t.alternate||!1,this.wait=t.wait||0,this.delay=t.delay||0,this.overlapMode=t.overlapMode||!1,this.timeScale=m.isNumber(t.timeScale)?t.timeScale:1,this.frameNum=0,this.isPaused=!0,this.direction=1,this._lastFrame=-1/0,this._repeatsCut=this.repeats,this._delayCut=this.delay,this._waitCut=this.wait,this.segments=t.segments||{},this._segmentName=t.initSegment||"",this._prefix=t.prefix||"",this._autoLoad=!m.isBoolean(t.autoLoad)||t.autoLoad,this._autoStart=!m.isBoolean(t.autoStart)||t.autoStart,this._justDisplayOnImagesLoaded=!m.isBoolean(t.justDisplayOnImagesLoaded)||t.justDisplayOnImagesLoaded,this._maskComp=t.maskComp||!1,this.textureLoader=null,this.jsonLoader=null,this.root=null,this.parent=null;const s=Rt(Xt.Container);if(this.group=new s,this.display=null,this.isDisplayLoaded=!1,this.isImagesLoaded=!1,this._copyJSON=t.copyJSON||!1,t.keyframes)!this._prefix&&t.keyframes.prefix&&(this._prefix=t.keyframes.prefix),this._setupDate(t.keyframes);else if(t.path){let s="";s=-1!==t.path.lastIndexOf("\\")?t.path.substr(0,t.path.lastIndexOf("\\")+1):t.path.substr(0,t.path.lastIndexOf("/")+1),!this._prefix&&s&&(this._prefix=s),this.jsonLoader=function(t){const s=y[v.Ajax];return s||console.warn("must register an ajax loader, before you parse an animation from path"),s(t)}(t.path),this.jsonLoader.once("success",(t=>{this._setupDate(t)})),this.jsonLoader.once("error",(t=>{this.emit("error",t)}))}}_setupDate(t){this._sourceData=t,this._copyJSON&&(t=m.copyJSON(t)),A(t),this.keyframes=t;const{w:s,h:e,st:i=0,fr:h,ip:r,op:n,assets:a}=t;this.frameRate=h,this.frameMult=h/1e3,this._defaultSegment=[r,n];const o=this._segmentName&&this.segments[this._segmentName]||this._defaultSegment;this.beginFrame=o[0],this.endFrame=o[1],this._timePerFrame=1e3/h,this.duration=Math.floor(this.endFrame-this.beginFrame);let l=null;const p=a.filter((t=>t.u||t.p));p.length>0?(this.textureLoader=l=function(t,s){const e=y[v.Texture];return e||console.warn("must register an image loader, before you parse an animation some has image assets"),e(t,s)}(p,{prefix:this._prefix,autoLoad:this._autoLoad}),l.loaded?(this.isImagesLoaded=!0,this.isPaused=!this._autoStart,this.emit("ImageReady")):(l.once("complete",(()=>{this.isImagesLoaded=!0,this.emit("ImageReady")})),null!==this._pausedNeedSet&&(this._pausedNeedSet=!0,l.once("complete",(()=>{this._pausedNeedSet&&(this._pausedNeedSet=!1,this.isPaused=!this._autoStart)}))))):(this.isImagesLoaded=!0,this.isPaused=!this._autoStart);const c={global:{assets:a,textureLoader:l,frameRate:h,maskComp:this._maskComp,overlapMode:this.overlapMode},local:{w:s,h:e,ip:r,op:n,st:i}};this._buildElements(c),null!==this.textureLoader&&this._justDisplayOnImagesLoaded&&!this.textureLoader.loaded&&null!==this._justDisplayNeedSet&&(this.group.visible=!1,this._justDisplayNeedSet=!0,this.textureLoader.once("complete",(()=>{this._justDisplayNeedSet&&(this._justDisplayNeedSet=!1,this.group.visible=!0)}))),this.isDisplayLoaded=!0,this.update(0,!0)}_buildElements(t){this.root=this._extraCompositions(this.keyframes,t,!0),this.display=this.root.display,this.group.addChild(this.display),this.emit("DOMLoaded").emit("DisplayReady"),null===this.textureLoader||this.textureLoader.loaded?this.emit("success"):this.textureLoader.once("complete",(()=>this.emit("success")))}_extraCompositions(t,{global:s,local:e},i=!1){const{w:h,h:r,ip:n,op:a,st:o=0}=t,l=new es(t,{global:s,local:e});l._isRoot=i;const p=t.layers||m.getAssets(t.refId,s.assets).layers,c={global:s,local:{w:h,h:r,ip:n,op:a,st:o}},u=this._createElements(p,c);for(let t=p.length-1;t>=0;t--){const s=p[t],e=u[s.ind];if(e){if(!m.isUndefined(s.parent)){const t=u[s.parent];t._isParent=!0,e.setHierarchy(t)}l.addChild(e)}}return l}_createElements(t,s){const e={};for(let i=t.length-1;i>=0;i--){const h=t[i];let r=null;if(void 0===h.td){switch(h.ty){case 0:r=this._extraCompositions(h,s);break;case 1:r=new is(h,s);break;case 2:r=new hs(h,s);break;case 3:r=new ns(h,s);break;case 4:r=new rs(h,s);break;default:continue}r&&(void 0===h.ind&&(h.ind=i),e[h.ind]=r,r.name=h.nm||null)}}return e}getDisplayByQuerySelector(t){const s=this.querySelector(t);return s&&s.display?s.display:(console.warn("can not find display which query with ",t),null)}_queryMatch(t,s,e){const i=t.substr(0,1),h=t.substr(1,t.length);let r=!1;return r="#"===i?s.idname===h:"."===i?-1!==s.classnames.indexOf(h):s.fullname===t,r&&e.push(s),r}_searchNodes(t,s,e,i=!1){if(s.childNodes&&s.childNodes.length>0){const h=[];for(let r=0;r<s.childNodes.length;r++){const n=s.childNodes[r];if(this._queryMatch(t,n,e)&&i)return!0;n.childNodes&&n.childNodes.length>0&&h.push(n)}for(let s=0;s<h.length;s++)if(this._searchNodes(t,h[s],e,i))return!0}return!1}querySelector(t){const s=[];return this._queryMatch(t,this.root,s)?s[0]:(this._searchNodes(t,this.root,s,!0),s[0]||null)}querySelectorAll(t){const s=[],e="#"===t.substr(0,1);return this._queryMatch(t,this.root,s)&&e||this._searchNodes(t,this.root,s,e),s}bindSlot(t,s){return this.getDisplayByQuerySelector(t).addChild(s),this}unbindSlot(t,s){return this.getDisplayByQuerySelector(t).removeChild(s),this}_emitFrame(t){this.emit(`@${t}`)}update(t,s=!1){if(!this.living||!this.isDisplayLoaded||this.isPaused&&!s)return;const e=this._updateTime(t),i=this.beginFrame+this.frameNum;this.root.updateFrame(i);const h=i>>0;this._lastFrame!==h&&(this._emitFrame(this.direction>0?h:this._lastFrame),this._lastFrame=h),!1===e?(this.emit("enterFrame",i),this.emit("update",this.frameNum/this.duration)):this.hadEnded!==e&&!0===e&&this.emit("complete"),this.hadEnded=e}_updateTime(t){const s=this.direction*this.timeScale*t;if(this._waitCut>0)return this._waitCut-=Math.abs(s),null;if(this.isPaused||this._delayCut>0)return this._delayCut>0&&(this._delayCut-=Math.abs(s)),null;this.frameNum+=s/this._timePerFrame;let e=!1;return this._spill()&&(this._repeatsCut>0||this.infinite?(this._repeatsCut>0&&--this._repeatsCut,this._delayCut=this.delay,this.alternate?(this.direction*=-1,this.frameNum=m.codomainBounce(this.frameNum,0,this.duration)):(this.direction=1,this.frameNum=m.euclideanModulo(this.frameNum,this.duration)),this.emit("loopComplete")):(this.overlapMode||(this.frameNum=m.clamp(this.frameNum,0,this.duration),this.living=!1),e=!0)),e}_spill(){const t=this.frameNum<=0&&-1===this.direction,s=this.frameNum>=this.duration&&1===this.direction;return t||s}frameToTime(t){return t*this._timePerFrame}setSpeed(t){this.timeScale=t}playSegment(t,s={}){if(!t)return;let e=null;m.isArray(t)?e=t:m.isString(t)&&(e=this.segments[t],m.isArray(e)&&(this._segmentName=t)),m.isArray(e)&&(this.beginFrame=m.isNumber(e[0])?e[0]:this._defaultSegment[0],this.endFrame=m.isNumber(e[1])?e[1]:this._defaultSegment[1],m.isNumber(s.repeats)&&(this.repeats=s.repeats),m.isBoolean(s.infinite)&&(this.infinite=s.infinite),m.isBoolean(s.alternate)&&(this.alternate=s.alternate),m.isNumber(s.wait)&&(this.wait=s.wait),m.isNumber(s.delay)&&(this.delay=s.delay),this.replay())}goToAndStop(t,s=!1){this.frameNum=s?t:t*this.frameMult,this.update(0,!0),this.pause()}goToAndPlay(t,s=!1){this.frameNum=s?t:t*this.frameMult,this.update(0,!0),this.resume()}getDuration(t){const s=this.endFrame-this.beginFrame;return t?s:s/this.frameRate}setDirection(t){return this.direction=t<0?-1:1,this}pause(){return this._pausedNeedSet?this._pausedNeedSet=!1:this._pausedNeedSet=null,this.isPaused=!0,this}resume(){return this._pausedNeedSet?this._pausedNeedSet=!1:this._pausedNeedSet=null,this.isPaused=!1,this}play(){return this.resume()}replay(){return this._pausedNeedSet?this._pausedNeedSet=!1:this._pausedNeedSet=null,this.isPaused=!1,this._repeatsCut=this.repeats,this._delayCut=this.delay,this.living=!0,this.frameNum=0,this.duration=Math.floor(this.endFrame-this.beginFrame),this.direction=1,this}show(){this._justDisplayNeedSet?this._justDisplayNeedSet=!1:this._justDisplayNeedSet=null,this.group.visible=!0}hide(){this._justDisplayNeedSet?this._justDisplayNeedSet=!1:this._justDisplayNeedSet=null,this.group.visible=!1}destroy(){this.parent&&this.parent.remove(this),this.group.parent&&this.group.parent.removeChild(this.group),this.pause(),this.root=null,this.group=null,this.display=null,this.textureLoader&&(this.textureLoader.off("complete"),this.textureLoader=null),this.jsonLoader&&(this.jsonLoader.off("success"),this.jsonLoader=null),this.keyframes=null,this.living=!1}}class os extends g{constructor(t){super(),this._lastTime=0,this._snippet=0,this.timeScale=1,this.isPaused=!1,this.ticker=t.ticker?t.ticker:t,this.groups=[],this.update=this.update.bind(this),this.ticker&&this.start()}add(t){const s=arguments.length;if(s>1)for(let t=0;t<s;t++)this.add(arguments[t]);else null!==t.parent&&t.parent.remove(t),t.parent=this,this.groups.push(t);return t}remove(t){if(arguments.length>1)for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);const s=this.groups.indexOf(t);-1!==s&&(t.parent=null,this.groups.splice(s,1))}parseAnimation(t){const s=new as(t);return this.add(s)}setSpeed(t){this.timeScale=t}start(){return this._lastTime=Date.now(),this.ticker.add(this.update),this}stop(){return this.ticker.remove(this.update),this}pause(){return this.isPaused=!0,this}resume(){return this.isPaused=!1,this}update(){if(this.timeline(),this.isPaused)return;const t=this.timeScale*this._snippet,s=this.groups.length;for(let e=0;e<s;e++)this.groups[e].update(t);this.emit("update",this._snippet)}timeline(){let t=Date.now()-this._lastTime;(!this._lastTime||t>200)&&(this._lastTime=Date.now(),t=Date.now()-this._lastTime),this._lastTime+=t,this._snippet=t}destroy(){for(let t=this.groups.length-1;t>=0;t--)this.groups[t].destroy()}}class ls extends e.Graphics{constructor(t){super(),this.parentCompBox=t,this.lineStyle(0)}updateLayerMask(t){for(let s=0;s<t.viewData.length;s++){if(t.viewData[s].inv){const t=this.parentCompBox;this.moveTo(0,0),this.lineTo(t.w,0),this.lineTo(t.w,t.h),this.lineTo(0,t.h),this.lineTo(0,0)}const e=t.viewData[s].v,i=e.v[0];this.moveTo(i[0],i[1]);const h=e._length;let r=1;for(;r<h;r++){const t=e.o[r-1],s=e.i[r],i=e.v[r];this.bezierCurveTo(t[0],t[1],s[0],s[1],i[0],i[1])}const n=e.o[r-1],a=e.i[0],o=e.v[0];this.bezierCurveTo(n[0],n[1],a[0],a[1],o[0],o[1]),t.viewData[s].inv&&this.addHole()}}updateMasks(t){this.clear(),this.beginFill(0),this.updateLayerMask(t),this.endFill()}}class ps extends e.Graphics{constructor(t){super(),this.viewport=t,this.lineStyle(0),this.initCompMask()}initCompMask(){this.clear(),this.beginFill(0);const t=this.viewport;this.moveTo(0,0),this.lineTo(t.w,0),this.lineTo(t.w,t.h),this.lineTo(0,t.h),this.lineTo(0,0),this.endFill()}}class cs extends e.Container{constructor(t,s){super(),this.lottieElement=t,this.config=s}onSetupLottie(){if(this.config.maskComp){const t=this.config.viewport;this.preCompMask=new ps(t),this.mask=this.preCompMask,this.addChild(this.mask)}if(this.lottieElement.hasValidMasks()){const t=this.config.session.local;if(this.graphicsMasks=new ls(t),this.mask){const t=new e.Container;t.mask=this.graphicsMasks,t.addChild(this.mask),this.lottieElement.innerDisplay=t,this.addChild(t)}else this.mask=this.graphicsMasks,this.addChild(this.mask)}}setHierarchy(t){this.hierarchy=t}show(){this.visible=!0}hide(){this.visible=!1}updateLottieTransform(t){this.x=t.x,this.y=t.y,this.pivot.x=t.anchorX,this.pivot.y=t.anchorY,this.scale.x=t.scaleX,this.scale.y=t.scaleY,this.rotation=t.rotation,this.alpha=t.alpha}updateLottieMasks(t){this.graphicsMasks&&this.graphicsMasks.updateMasks(t)}}class us extends e.Shader{constructor(t){super(t,["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);","}"].join("\n"),["uniform float alpha;","uniform vec3 color;","void main(void){"," gl_FragColor = vec4(color * alpha, alpha);","}"].join("\n"))}}function ds(t,s){this.buffer=new t(10),this.length=0}ds.prototype={reset(){this.length=0},destroy(){this.buffer=null,this.length=0},push(...t){if(this.length+t.length>this.buffer.length){const s=new this.buffer.constructor(Math.max(this.length+t.length,Math.round(2*this.buffer.length)));s.set(this.buffer,0),this.buffer=s}for(let s=0;s<t.length;s++)this.buffer[this.length++]=t[s];return this.length},setBuffer(t){this.buffer=t,this.length=this.buffer.length}};class fs{constructor(t,s,i){this.gl=t,this.vertices=new ds(Float32Array),this.indices=new ds(Uint16Array),this.buffer=e.glCore.GLBuffer.createVertexBuffer(t),this.indexBuffer=e.glCore.GLBuffer.createIndexBuffer(t),this.dirty=!0,this.shader=s,this.vao=new e.glCore.VertexArrayObject(t,i).addIndex(this.indexBuffer).addAttribute(this.buffer,s.attributes.aVertexPosition,t.FLOAT,!1,8,0)}reset(){this.vertices.reset(),this.indices.reset()}upload(){this.buffer.upload(this.vertices.buffer),this.indexBuffer.upload(this.indices.buffer),this.dirty=!1}destroy(){this.vertices.destroy(),this.indices.destroy(),this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null}}function ms(t,s,e){return t.push(s,e),t}function gs(t,s){return Math.sqrt(t*t+s*s)}function ys(t,s,e,i,h){return function(t,s){const e=1-t;return e*e*e*s}(t,s)+function(t,s){const e=1-t;return 3*e*e*t*s}(t,e)+function(t,s){return 3*(1-t)*t*t*s}(t,i)+function(t,s){return t*t*t*s}(t,h)}function vs(t,s,e,i,h,r,n){if(!(isFinite(s)&&isFinite(e)&&isFinite(i)&&isFinite(h)&&isFinite(r)&&isFinite(n)))return t;const a=t[t.length-2],o=t[t.length-1],l=function(t,s,e,i,h,r,n,a){const o=h-e,l=r-i,p=e-t,c=i-s;return gs(n-h,a-r)+gs(o,l)+gs(p,c)}(a,o,s,e,i,h,r,n),p=Math.min(10/l,.5);for(let l=p;l<1;l+=p){const p=ys(l,a,s,i,r),c=ys(l,o,e,h,n);t.push(p,c)}return t.push(r,n),t}function _s(t,s){for(let e=0;e<t.length;e++){const{cmd:i,args:h}=t[e];switch(i){case"M":case"L":ms(s,h[0],h[1]);break;case"C":vs(s,h[0],h[1],h[2],h[3],h[4],h[5])}}return s}function ks(t,s,e,i,h,r,n){h%=2*Math.PI,r%=2*Math.PI,h<0&&(h+=2*Math.PI),r<0&&(r+=2*Math.PI),h>=r&&(r+=2*Math.PI);let a=r-h,o=1;n&&(o=-1,a=2*Math.PI-a,0==a&&(a=2*Math.PI));const l=a*i;let p=Math.sqrt(l/1)>>0;p=p%2==0?p+1:p;const c=a/p;let u=h;for(let h=0;h<p+1;h++)t.push(s,e,s+i*Math.cos(u),e+i*Math.sin(u)),u+=o*c}function Ss(t,s,e){const i=_s(t.cmds,[]),h=t.isClosed,r=s.lineDash.length>=2,n=s.lineWidth/2;let a,o=[i[0],i[1]];for(let t=2;t<i.length;t+=2)i[t]==o[o.length-2]&&i[t+1]==o[o.length-1]||o.push(i[t],i[t+1]);if(!h||o[o.length-2]==o[0]&&o[o.length-1]==o[1]||o.push(o[0],o[1]),r){const t=function(t,s,e,i){s&&t.push(t[0],t[1]);let h=i,r=0,n=1;for(;h>e[r];)h-=e[r],r++,n=n?0:1,r==e.length&&(r=0);let a=[t[0],t[1]],o=[n];for(let s=2;s<t.length;s+=2){let i=[t[s]-t[s-2],t[s+1]-t[s-1]],l=gs(i[0],i[1]);i[0]/=l,i[1]/=l;let p=0;for(;l-p+h>=e[r];)p+=e[r]-h,h=0,n=n?0:1,r++,r==e.length&&(r=0),o.push(n),a.push(t[s-2]+p*i[0],t[s-1]+p*i[1]);l-p!=0&&(a.push(t[s],t[s+1]),o.push(n)),h+=l-p}return s&&(t.pop(),t.pop(),a.pop(),a.pop(),o.pop()),{newPoints:a,toDrawOrNotToDraw:o}}(o,h,s.lineDash,s.lineDashOffset);a=t.toDrawOrNotToDraw,o=t.newPoints}const l=e.length;let p=e.length;const c=[];if(h)o.push(o[2],o[3]);else{const t=[o[2]-o[0],o[3]-o[1]],i=gs(t[0],t[1]);t[0]/=i,t[1]/=i;const h=[-t[1],t[0]],l=[o[0]+n*h[0],o[1]+n*h[1]],u=[o[0]-n*h[0],o[1]-n*h[1]];if("butt"==s.lineCap)e.push(l[0],l[1],u[0],u[1]);else if("square"==s.lineCap)e.push(l[0]-n*t[0],l[1]-n*t[1],u[0]-n*t[0],u[1]-n*t[1]);else{e.push(o[0],o[1],l[0],l[1]);const t=Math.atan2(l[1]-o[1],l[0]-o[0]),s=Math.atan2(u[1]-o[1],u[0]-o[0]);ks(e,o[0],o[1],n,t,s),e.push(o[0],o[1],u[0],u[1]),e.push(l[0],l[1],u[0],u[1])}if(r){const t=a[0];for(let s=p;s<e.length;s+=2)c.push(t);p=e.length}}for(let t=2;t<o.length-2;t+=2){const i=[o[t]-o[t-2],o[t+1]-o[t-1]],h=[-i[1],i[0]];let l=gs(h[0],h[1]);h[0]/=l,h[1]/=l;let u=[o[t+2]-o[t],o[t+3]-o[t+1]];l=gs(u[0],u[1]),u[0]/=l,u[1]/=l;let d=[o[t]-o[t-2],o[t+1]-o[t-1]];l=gs(d[0],d[1]),d[0]/=l,d[1]/=l;let f=[d[0]+u[0],d[1]+u[1]];l=gs(f[0],f[1]);let m,g,y=0;l>0?(f[0]/=l,f[1]/=l,g=[-f[1],f[0]],m=g[0]*h[0]+g[1]*h[1],y=n/m):(y=0,g=[-f[1],f[0]]);const v=[o[t]+y*g[0],o[t+1]+y*g[1]],_=[o[t]-y*g[0],o[t+1]-y*g[1]];if("miter"==s.lineJoin&&1/m<=s.miterLimit)e.push(v[0],v[1],_[0],_[1]);else{const i=d[1]*u[0]-d[0]*u[1];if("round"==s.lineJoin)if(i<0){const s=[o[t]+d[1]*n,o[t+1]-d[0]*n],i=[o[t]+u[1]*n,o[t+1]-u[0]*n];e.push(v[0],v[1],s[0],s[1]);const h=Math.atan2(s[1]-o[t+1],s[0]-o[t]),r=Math.atan2(i[1]-o[t+1],i[0]-o[t]);ks(e,o[t],o[t+1],n,h,r),e.push(v[0],v[1],i[0],i[1])}else{const s=[o[t]-d[1]*n,o[t+1]+d[0]*n],i=[o[t]-u[1]*n,o[t+1]+u[0]*n];e.push(s[0],s[1],_[0],_[1]);const h=Math.atan2(i[1]-o[t+1],i[0]-o[t]),r=Math.atan2(s[1]-o[t+1],s[0]-o[t]);ks(e,o[t],o[t+1],n,h,r),e.push(i[0],i[1],_[0],_[1])}else if(i<0){const s=[o[t]+d[1]*n,o[t+1]-d[0]*n],i=[o[t]+u[1]*n,o[t+1]-u[0]*n];e.push(v[0],v[1],s[0],s[1],v[0],v[1],i[0],i[1])}else{const s=[o[t]-d[1]*n,o[t+1]+d[0]*n],i=[o[t]-u[1]*n,o[t+1]+u[0]*n];e.push(s[0],s[1],_[0],_[1],i[0],i[1],_[0],_[1])}}if(r){const s=a[t/2];for(let t=p;t<e.length;t+=2)c.push(s);p=e.length}}if(h)e.push(e.buffer[l],e.buffer[l+1],e.buffer[l+2],e.buffer[l+3]);else{const t=[o[o.length-2]-o[o.length-4],o[o.length-1]-o[o.length-3]],i=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));t[0]/=i,t[1]/=i;const h=[-t[1],t[0]],r=[o[o.length-2]+n*h[0],o[o.length-1]+n*h[1]],a=[o[o.length-2]-n*h[0],o[o.length-1]-n*h[1]];if("butt"==s.lineCap)e.push(r[0],r[1],a[0],a[1]);else if("square"==s.lineCap)e.push(r[0]+n*t[0],r[1]+n*t[1],a[0]+n*t[0],a[1]+n*t[1]);else{e.push(r[0],r[1],a[0],a[1]),e.push(o[o.length-2],o[o.length-1],a[0],a[1]);const t=Math.atan2(a[1]-o[o.length-1],a[0]-o[o.length-2]),s=Math.atan2(r[1]-o[o.length-1],r[0]-o[o.length-2]);ks(e,o[o.length-2],o[o.length-1],n,t,s),e.push(o[o.length-2],o[o.length-1],r[0],r[1])}}if(r){const t=a[a.length-1];for(let s=p;s<e.length;s+=2)c.push(t);p=e.length}return c}function xs(t,s){const e=t.isClosed;let i=!0;const h=_s(t.cmds,[]);let r=[h[0],h[1]];for(let t=2;t<h.length;t+=2)h[t]==r[r.length-2]&&h[t+1]==r[r.length-1]||r.push(h[t],h[t+1]);if(!e||r[r.length-2]==r[0]&&r[r.length-1]==r[1]||r.push(r[0],r[1]),r.length>=6){for(let t=0;t<r.length;t++)s.push(r[t]);i=!1}return i}e.WebGLRenderer.registerPlugin("lottiegraphics",class extends e.ObjectRenderer{constructor(t){super(t),this.graphicsDataPool=[],this.primitiveShader=null,this.webGLData=null,this.gl=t.gl,this.CONTEXT_UID=0}onContextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new us(this.gl)}destroy(){e.ObjectRenderer.prototype.destroy.call(this);for(let t=0;t<this.graphicsDataPool.length;++t)this.graphicsDataPool[t].destroy();this.graphicsDataPool=null}render(t){const s=this.renderer,i=s.gl,h=this.getWebGLData(t);if(t.isDirty&&this.updateGraphics(t,h),0===h.indices.length)return;const r=this.primitiveShader;s.bindShader(r),s.state.setBlendMode(t.blendMode),r.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),r.uniforms.color=e.utils.hex2rgb(t.color),r.uniforms.alpha=t.worldAlpha,s.bindVao(h.vao),h.vao.draw(i.TRIANGLES,h.indices.length)}updateGraphics(t,s){s.reset(),"stroke"===t.drawType?this.buildStroke(t,s):this.buildFill(t,s),t.isDirty=!1}buildStroke(t,s){const{vertices:e,indices:i}=s,{paths:h,lineStyle:r}=t,n=r.lineDash.length>=2;for(let t=0;t<h.length;t++){const s=h[t],a=e.length/2,o=Ss(s,r,e);if(n)for(let t=a+2;t<e.length/2;t+=2)o[t-a-1]&&i.push(t-2,t,t-1,t,t+1,t-1);else for(let t=a+2;t<e.length/2;t+=2)i.push(t-2,t,t-1,t,t+1,t-1)}s.upload()}buildFill(t,s){const{vertices:i,indices:h}=s,{paths:r}=t;let n=[];const a=[];for(let t=0;t<r.length;t++){const s=r[t],i=[];if(xs(s,i))break;const h=s.holes,o=[];for(let t=0;t<h.length;t++){const s=h[t],e=i.length;if(xs(s,i))break;o.push(e/2)}const l=e.utils.earcut(i,o,2),p=n.length/2;for(let t=0;t<i.length;t+=2)n.push(i[t],i[t+1]);for(let t=0;t<l.length;t+=3)a.push(p+l[t],p+l[t+1],p+l[t+2])}n.length<6||a<3||(i.setBuffer(new Float32Array(n)),h.setBuffer(new Uint16Array(a)),s.upload())}getWebGLData(t){return t.webGLData&&this.CONTEXT_UID===t.webGLData.CONTEXT_UID||(t.webGLData=new fs(this.renderer.gl,this.primitiveShader,this.renderer.state.attribState),t.webGLData.CONTEXT_UID=this.CONTEXT_UID),t.webGLData}}),e.CanvasRenderer.registerPlugin("lottiegraphics",class{constructor(t){this.renderer=t}destroy(){this.renderer=null}render(t){const s=this.renderer,e=s.context,i=t.lineStyle,h=t.worldAlpha,r=t.transform.worldTransform,n=s.resolution;e.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n,r.ty*n),s.setBlendMode(t.blendMode),e.globalAlpha=h,"stroke"===t.drawType?(e.lineWidth=i.lineWidth,e.lineJoin=i.lineJoin,e.miterLimit=i.miterLimit,e.lineCap=i.lineCap,e.lineDashOffset=i.lineDashOffset,e.setLineDash(i.lineDash||[]),this.buildStroke(t)):this.buildFill(t)}buildStroke(t){const s=this.renderer.context,e=`#${`00000${(0|t.color).toString(16)}`.substr(-6)}`,{paths:i,lineStyle:h}=t;s.lineWidth=h.lineWidth,s.lineJoin=h.lineJoin,s.miterLimit=h.miterLimit,s.lineCap=h.lineCap,s.lineDashOffset=h.lineDashOffset,s.setLineDash(h.lineDash||[]),s.beginPath();for(let t=0;t<i.length;t++)this.drawPath(s,i[t]);s.strokeStyle=e,s.stroke()}buildFill(t){const s=this.renderer.context,e=`#${`00000${(0|t.color).toString(16)}`.substr(-6)}`,{paths:i}=t;s.beginPath();for(let t=0;t<i.length;t++){const e=i[t];this.drawPath(s,e);for(let t=0;t<e.holes.length;t++)this.drawPath(s,e.holes[t])}s.fillStyle=e,s.fill()}drawPath(t,s){for(let e=0;e<s.cmds.length;e++){const{cmd:i,args:h}=s.cmds[e];switch(i){case"M":t.moveTo(h[0],h[1]);break;case"L":t.lineTo(h[0],h[1]);break;case"C":t.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5])}}}});class Ms{constructor(){this.cmds=[],this.holes=[],this.isClosed=!1,this.isClockWise=!1}getLength(){return this.cmds.length}add(t,s){this.cmds.push({cmd:t,args:s})}moveTo(t=0,s=0){this.add("M",[t,s])}lineTo(t,s){this.add("L",[t,s])}bezierCurveTo(t,s,e,i,h,r){this.add("C",[t,s,e,i,h,r])}closePath(){this.isClosed=!0}}class Ts extends e.Container{constructor(){super(),this.paths=[],this._samplerPoints=[],this.currentPath=null,this.color=0,this.lineStyle={lineWidth:1,lineJoin:"miter",miterLimit:10,lineCap:"butt",lineDash:[],lineDashOffset:0},this.isDirty=!0,this.drawType="",this.blendMode=e.BLEND_MODES.NORMAL,this.webGLData=null,this.firstIsClockWise=!0,this.preClockWiseStatus=null}clear(){this.paths.length=0,this.currentPath=null,this.firstIsClockWise=!0,this.preClockWiseStatus=null,this.isDirty=!0}moveTo(t=0,s=0){this.endPath(),this.currentPath=new Ms,this.currentPath.moveTo(t,s),this._samplerPoints.push([t,s])}lineTo(t,s){this.currentPath.lineTo(t,s),this._samplerPoints.push([t,s])}bezierCurveTo(t,s,e,i,h,r){this.currentPath.bezierCurveTo(t,s,e,i,h,r),this._samplerPoints.push([h,r])}endPath(){if(this.currentPath&&this.currentPath.getLength()>1){const t=this.paths.length,s=function(t){const s=t.length;let e=0;for(let i=s-1,h=0;h<s;i=h++)e+=t[i][0]*t[h][1]-t[h][0]*t[i][1];return.5*e}(this._samplerPoints)>0;this.currentPath.isClockWise=s,0===t&&(this.firstIsClockWise=s),t>0&&this.preClockWiseStatus===this.firstIsClockWise&&this.preClockWiseStatus!==s?(t>0?this.paths[t-1]:null).holes.push(this.currentPath):(this.paths.push(this.currentPath),this.preClockWiseStatus=s),this.currentPath=null,this.isDirty=!0}this._samplerPoints.length=0}closePath(){this.currentPath.closePath()}stroke(){this.endPath(),this.drawType="stroke"}fill(){null!==this.currentPath&&(this.closePath(),this.endPath(),this.drawType="fill")}_renderWebGL(t){t.setObjectRenderer(t.plugins.lottiegraphics),t.plugins.lottiegraphics.render(this)}_renderCanvas(t){t.plugins.lottiegraphics.render(this)}}class ws extends e.Graphics{constructor(t,s){super(),this.lottieElement=t,this.config=s;const e=parseInt(s.color.replace("#",""),16);this.beginFill(e),this.drawRect(0,0,s.rect.width,s.rect.height),this.endFill()}onSetupLottie(){if(this.lottieElement.hasValidMasks()){const t=this.config.session.local;this.graphicsMasks=new ls(t),this.mask=this.graphicsMasks,this.addChild(this.mask)}}setHierarchy(t){this.hierarchy=t}show(){this.visible=!0}hide(){this.visible=!1}updateLottieTransform(t){this.x=t.x,this.y=t.y,this.pivot.x=t.anchorX,this.pivot.y=t.anchorY,this.scale.x=t.scaleX,this.scale.y=t.scaleY,this.rotation=t.rotation,this.alpha=t.alpha}updateLottieMasks(t){this.graphicsMasks&&this.graphicsMasks.updateMasks(t)}}class Ps extends e.Sprite{constructor(t,s){const{texture:i,asset:h}=s;super(i),i.baseTexture.hasLoaded?(i.orig=new e.Rectangle(0,0,h.w,h.h),i._updateUvs()):i.baseTexture.on("loaded",(()=>{i.orig=new e.Rectangle(0,0,h.w,h.h),i._updateUvs()})),this.lottieElement=t,this.config=s}onSetupLottie(){if(this.lottieElement.hasValidMasks()){const t=this.config.session.local;this.graphicsMasks=new ls(t),this.mask=this.graphicsMasks,this.addChild(this.mask)}}setHierarchy(t){this.hierarchy=t}show(){this.visible=!0}hide(){this.visible=!1}updateLottieTransform(t){this.x=t.x,this.y=t.y,this.pivot.x=t.anchorX,this.pivot.y=t.anchorY,this.scale.x=t.scaleX,this.scale.y=t.scaleY,this.rotation=t.rotation,this.alpha=t.alpha}updateLottieMasks(t){this.graphicsMasks&&this.graphicsMasks.updateMasks(t)}}const bs=/^(https?:)?\/\//;class Ds extends g{constructor(t,{prefix:s,autoLoad:e=!0}){super(),this.assets=t,this.prefix=s||"",this.textures={},this._total=0,this._failed=0,this._received=0,this.loaded=!1,e&&this.load()}load(){this.assets.forEach((t=>{const s=t.id,i=function(t,s){if(1===t.e)return t.p;s&&(s=s.replace(/\/?$/,"/"));const e=t.u+t.p;let i="";return i=t.up?t.up:bs.test(e)?e:s+e,i}(t,this.prefix),h=e.Texture.fromImage(i,"*");this.textures[s]=h,this._total++,h.baseTexture.hasLoaded?(this._received++,this.emit("update"),this._received+this._failed>=this._total&&this._onComplete()):(h.baseTexture.once("loaded",(()=>{this._received++,this.emit("update"),this._received+this._failed>=this._total&&this._onComplete()})),h.baseTexture.once("error",(()=>{this._failed++,this.emit("update"),this._received+this._failed>=this._total&&this._onComplete()})))}))}_onComplete(){this.loaded=!0,this.emit("complete"),this._failed>0&&(this._failed>=this._total?this.emit("fail"):this.emit("partlyfail",this._failed))}getTextureById(t){return this.textures[t]}}function Cs(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}class Ls extends g{constructor(t){super(),this.path=t,this.onSuccess=this.onSuccess.bind(this),this.onFail=this.onFail.bind(this),function(t,s,e){let i,h=new XMLHttpRequest;h.open("GET",t,!0);try{h.responseType="json"}catch(t){console.error("lottie-pixi loadAjax:",t)}h.send(),h.onreadystatechange=function(){if(4==h.readyState)if(200==h.status)i=Cs(h),s(i);else try{i=Cs(h),s(i)}catch(t){e&&e(t)}}}(t,this.onSuccess,this.onFail)}onSuccess(t){this.emit("success",t),this.emit("complete",t)}onFail(t){this.emit("fail",t),this.emit("error",t)}}const As={Linear:{None:t=>t},Ease:{In:function(){const t=new q(.42,0,1,1);return function(s){return t.get(s)}}(),Out:function(){const t=new q(0,0,.58,1);return function(s){return t.get(s)}}(),InOut:function(){const t=new q(.42,0,.58,1);return function(s){return t.get(s)}}(),Bezier(t,s,e,i){const h=new q(t,s,e,i);return function(t){return h.get(t)}}},Elastic:{In:t=>0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI),Out:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1,InOut:t=>0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1},Back:{In(t){const s=1.70158;return t*t*((s+1)*t-s)},Out(t){const s=1.70158;return--t*t*((s+1)*t+s)+1},InOut(t){const s=2.5949095;return(t*=2)<1?t*t*((s+1)*t-s)*.5:.5*((t-=2)*t*((s+1)*t+s)+2)}},Bounce:{In:t=>1-As.Bounce.Out(1-t),Out:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,InOut:t=>t<.5?.5*As.Bounce.In(2*t):.5*As.Bounce.Out(2*t-1)+.5}};function Os(t){g.call(this),this.element=t.element||{},this.duration=t.duration||300,this.living=!0,this.resident=t.resident||!1,this.infinite=t.infinite||!1,this.alternate=t.alternate||!1,this.repeats=t.repeats||0,this.delay=t.delay||0,this.wait=t.wait||0,this.timeScale=m.isNumber(t.timeScale)?t.timeScale:1,t.onComplete&&this.on("complete",t.onComplete.bind(this)),t.onUpdate&&this.on("update",t.onUpdate.bind(this)),this.init(),this.paused=!1}function Fs(t){Os.call(this,t),t.from=t.from||{};for(const s in t.to)m.isUndefined(t.from[s])&&(t.from[s]=this.element[s]);this.ease=t.ease||As.Ease.InOut,this.from=t.from,this.to=t.to}function Is(t){Os.call(this,t),this.dynamicProperties=[],this._mdf=!1,this.keyframes=m.copyJSON(t.keyframes),this.frameRate=t.frameRate||30,this.tpf=1e3/this.frameRate,this.ip=m.isUndefined(t.ip)?this.keyframes.ip:t.ip,this.op=m.isUndefined(t.ip)?this.keyframes.op:t.op,this.tfs=this.op-this.ip,this.duration=this.tfs*this.tpf,this.ignoreProps=m.isArray(t.ignoreProps)?t.ignoreProps:[],this.transform=new Qt(this,this.keyframes.ks)}function Es(t,s){Os.call(this,s),this.runners=[],this.queues=[],this.cursor=0,this.total=0,this.alternate=!1,t&&this.then(t)}Os.prototype=Object.create(g.prototype),Os.prototype.update=function(t){const s=this.direction*this.timeScale*t;if(this.waitCut>0)return void(this.waitCut-=Math.abs(s));if(this.paused||!this.living||this.delayCut>0)return void(this.delayCut>0&&(this.delayCut-=Math.abs(s)));this.progress+=s;let e=!1;const i=this.progress;let h;return this.spill()&&(this.repeatsCut>0||this.infinite?(this.repeatsCut>0&&--this.repeatsCut,this.delayCut=this.delay,this.alternate?(this.direction*=-1,this.progress=m.codomainBounce(this.progress,0,this.duration)):(this.direction=1,this.progress=m.euclideanModulo(this.progress,this.duration))):e=!0),e?(this.resident||(this.living=!1),this.progress=m.clamp(i,0,this.duration),h=this.nextPose(),this.emit("complete",h,i-this.progress)):(h=this.nextPose(),this.emit("update",h,this.progress/this.duration)),h},Os.prototype.spill=function(){const t=this.progress<=0&&-1===this.direction,s=this.progress>=this.duration&&1===this.direction;return t||s},Os.prototype.init=function(){this.direction=1,this.progress=0,this.repeatsCut=this.repeats,this.delayCut=this.delay,this.waitCut=this.wait},Os.prototype.nextPose=function(){console.warn("should be overwrite")},Os.prototype.linear=function(t,s,e){return(s-t)*e+t},Os.prototype.setSpeed=function(t){return this.timeScale=t,this},Os.prototype.pause=function(){return this.paused=!0,this},Os.prototype.resume=function(){return this.paused=!1,this},Os.prototype.restart=Os.prototype.resume,Os.prototype.stop=function(){return this.repeats=0,this.infinite=!1,this.progress=this.duration,this},Os.prototype.cancel=function(){return this.living=!1,this},Fs.prototype=Object.create(Os.prototype),Fs.prototype.nextPose=function(){const t={},s=this.ease(this.progress/this.duration);for(const e in this.to)void 0!==this.element[e]&&(this.element[e]=t[e]=this.linear(this.from[e],this.to[e],s));return t},Is.prototype=Object.create(Os.prototype),Is.prototype.prepareProperties=function(t){const s=this.dynamicProperties.length;let e;for(e=0;e<s;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},Is.prototype.addDynamicProperty=function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)},Is.prototype.nextPose=function(){const t={},s=this.ip+this.progress/this.tpf;return this.prepareProperties(s),-1===this.ignoreProps.indexOf("position")&&(-1===this.ignoreProps.indexOf("x")&&(t.x=this.element.x=this.transform.x),-1===this.ignoreProps.indexOf("y")&&(t.y=this.element.y=this.transform.y)),-1===this.ignoreProps.indexOf("pivot")&&(t.pivot={},-1===this.ignoreProps.indexOf("pivotX")&&(t.pivot.x=this.element.pivot.x=this.transform.anchorX),-1===this.ignoreProps.indexOf("pivotY")&&(t.pivot.y=this.element.pivot.y=this.transform.anchorY)),-1===this.ignoreProps.indexOf("scale")&&(t.scale={},-1===this.ignoreProps.indexOf("scaleX")&&(t.scale.x=this.element.scale.x=this.transform.scaleX),-1===this.ignoreProps.indexOf("scaleY")&&(t.scale.y=this.element.scale.y=this.transform.scaleY)),-1===this.ignoreProps.indexOf("rotation")&&(t.rotation=this.element.rotation=this.transform.rotation),-1===this.ignoreProps.indexOf("alpha")&&(t.alpha=this.element.alpha=this.transform.alpha),t},Es.prototype=Object.create(Os.prototype),Es.prototype.then=function(t){return this.queues.push(t),this.total=this.queues.length,this},Es.prototype.nextOne=function(t,s){this.runners[this.cursor].init(),this.cursor++,this._residueTime=Math.abs(s)},Es.prototype.initOne=function(){const t=this.queues[this.cursor];t.infinite=!1,t.resident=!0,t.element=this.element;let s=null;t.keyframes?s=new Is(t):t.to&&(s=new Fs(t)),null!==s&&(s.on("complete",this.nextOne.bind(this)),this.runners.push(s))},Es.prototype.nextPose=function(t){return!this.runners[this.cursor]&&this.queues[this.cursor]&&this.initOne(),this._residueTime>0&&(t+=this._residueTime,this._residueTime=0),this.runners[this.cursor].update(t)},Es.prototype.update=function(t){if(this.wait>0)return void(this.wait-=Math.abs(t));if(this.paused||!this.living||this.delayCut>0)return void(this.delayCut>0&&(this.delayCut-=Math.abs(t)));const s=this.cursor,e=this.nextPose(this.timeScale*t);return this.emit("update",{index:s,pose:e},this.progress/this.duration),this.spill()&&(this.repeats>0||this.infinite?(this.repeats>0&&--this.repeats,this.delayCut=this.delay,this.cursor=0):(this.resident||(this.living=!1),this.emit("complete",e))),e},Es.prototype.spill=function(){return this.cursor>=this.total};const Ns={settings:e.settings,UPDATE_PRIORITY:e.UPDATE_PRIORITY,animationTicker:e.ticker.shared};function Vs(t){this.element=t,this.animates=[],this.timeScale=1,this.paused=!1,this.updateDeltaTime=this.updateDeltaTime.bind(this),Ns.animationTicker.add(this.updateDeltaTime,Ns.UPDATE_PRIORITY.HIGH)}Vs.prototype.clearAnimators=function(t){if(this.paused)return;const s=this.animates;for(let e=0;e<t.length;e++){const i=t[e];s[i].living||s[i].resident||this.animates.splice(i,1)}},Vs.prototype.updateDeltaTime=function(t){if(this.animates.length<=0)return;const s=t/Ns.settings.TARGET_FPMS;this.update(s)},Vs.prototype.update=function(t){if(this.paused)return;if(this.animates.length<=0)return;t=this.timeScale*t;const s=[];for(let e=0;e<this.animates.length;e++)this.animates[e].living||this.animates[e].resident?this.animates[e].update(t):s.push(e);s.length>0&&this.clearAnimators(s)},Vs.prototype.animate=function(t,s){return t.element=this.element,this._addMove(new Fs(t),s)},Vs.prototype.queues=function(t,s,e){return s.element=this.element,this._addMove(new Es(t,s),e)},Vs.prototype.bodymovin=function(t,s){return t.element=this.element,this._addMove(new Is(t),s)},Vs.prototype._addMove=function(t,s){return s&&this.clearAll(),this.animates.push(t),t},Vs.prototype.pause=function(){this.paused=!0},Vs.prototype.resume=function(){this.paused=!1},Vs.prototype.restart=Vs.prototype.resume,Vs.prototype.setSpeed=function(t){this.timeScale=t},Vs.prototype.clearAll=function(){this.animates.length=0},e.DisplayObject.prototype.setupAnimations=function(){this.animations||(this.animations=new Vs(this))},e.DisplayObject.prototype.animate=function(t,s){return this.animations||this.setupAnimations(),this.animations.animate(t,s)},e.DisplayObject.prototype.queues=function(t,s={},e){return this.animations||this.setupAnimations(),this.animations.queues(t,s,e)},e.DisplayObject.prototype.bodymovin=function(t,s){return this.animations||this.setupAnimations(),this.animations.bodymovin(t,s)},Object.defineProperties(e.DisplayObject.prototype,{scaleXY:{get(){return this.scale.x},set(t){this.scale.set(t)}},scaleX:{get(){return this.scale.x},set(t){this.scale.x=t}},scaleY:{get(){return this.scale.y},set(t){this.scale.y=t}},pivotX:{get(){return this.pivot.x},set(t){this.pivot.x=t}},pivotY:{get(){return this.pivot.y},set(t){this.pivot.y=t}}}),e.Container.prototype.updateTransform=function(){this.emit("pretransform"),this._boundsID++,this.hierarchy&&this.hierarchy.transform?(this.hierarchy.updateTransform(),this.transform.updateTransform(this.hierarchy.transform)):this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,s=this.children.length;t<s;++t){const s=this.children[t];s.visible&&s.updateTransform()}this.emit("posttransform")},e.Container.prototype.containerUpdateTransform=e.Container.prototype.updateTransform;const{major:qs}=n(window.navigator.userAgent)||{};function js(t){if(window.URL=window.URL||window.webkitURL,window.URL&&URL.createObjectURL){const s=function(t){let s=atob(t.split(",")[1]),e=new ArrayBuffer(s.length),i=new Uint8Array(e),h=t.split(",")[0].match(/:(.*?);/)[1];for(let t=0,e=s.length;t<e;t++)i[t]=s.charCodeAt(t);let r,n=[i];try{r=new Blob(n,{type:h})}catch(t){console.log(t)}return r}(t);return URL.createObjectURL(s)}return t}k(_.Texture,(function(t,s){return new Ds(t,s)})),k(_.Ajax,(function(t){return new Ls(t)})),Yt(Xt.Null,cs),Yt(Xt.Path,class extends Ts{constructor(t,s){super(),this.lottieElement=t,this.config=s,this.passMatrix=new e.Matrix}setShapeTransform(){const t=this.lottieElement.preTransforms.finalTransform.props;this.passMatrix.set(t[0],t[1],t[4],t[5],t[12],t[13]),this.transform.setFromMatrix(this.passMatrix)}updateTransform(){this.setShapeTransform(),this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++}updateLottieGrahpics(t){const s=t.type;if(this.clear(),("st"===s||"gs"===s)&&0===t.wi||!t.data._shouldRender||0===t.coOp)return;const e=t.elements,i=e.length;for(let t=0;t<i;t+=1){const s=e[t].trNodes,i=s.length;for(let t=0;t<i;t++)"m"==s[t].t?this.moveTo(s[t].p[0],s[t].p[1]):"c"==s[t].t?this.bezierCurveTo(s[t].pts[0],s[t].pts[1],s[t].pts[2],s[t].pts[3],s[t].pts[4],s[t].pts[5]):this.closePath()}"st"!==s&&"gs"!==s||(t.da?(this.lineStyle.lineDash=t.da,this.lineStyle.lineDashOffset=t.do):this.lineStyle.lineDash=[]),"st"===s||"gs"===s?(this.lineStyle.lineWidth=t.wi,this.lineStyle.lineCap=t.lc,this.lineStyle.lineJoin=t.lj,this.lineStyle.miterLimit=t.ml||0,this.color=m.rgb2hex(t.co||t.grd),this.alpha=t.coOp,this.stroke()):(this.color=m.rgb2hex(t.co||t.grd),this.alpha=t.coOp,this.fill())}}),Yt(Xt.Shape,cs),Yt(Xt.Solid,ws),Yt(Xt.Sprite,Ps),Yt(Xt.Component,cs),Yt(Xt.Container,e.Container);var Rs=function(s){function e(){var t=null!==s&&s.apply(this,arguments)||this;return t.managerLife=["DisplayReady","ImageReady","success","error","complete","loopComplete","enterFrame","update"],t}return o(e,s),e.prototype.init=function(){this.renderSystem=this.game.getSystem("Renderer"),this.app=this.renderSystem.application},e.prototype.componentChanged=function(s){return u(this,void 0,void 0,(function(){return d(this,(function(e){return"Lottie"===s.componentName&&(s.type===t.OBSERVER_TYPE.ADD?this.add(s):s.type===t.OBSERVER_TYPE.REMOVE&&this.remove(s)),[2]}))}))},e.prototype.add=function(s){return u(this,void 0,void 0,(function(){var e,i,h,r,n,a,o,p;return d(this,(function(c){switch(c.label){case 0:return this.manager=new os(this.app),e=s.component,(i=this.renderSystem.containerManager.getContainer(s.gameObject.id))?(h=e.options,r=h.resource,n=function(t,s){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&s.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(i=Object.getOwnPropertySymbols(t);h<i.length;h++)s.indexOf(i[h])<0&&Object.prototype.propertyIsEnumerable.call(t,i[h])&&(e[i[h]]=t[i[h]])}return e}(h,["resource"]),[4,t.resource.getResource(r)]):[2];case 1:return a=c.sent().data,o=l({},a.json||{}),(o.assets||[]).forEach((function(t){var s;t.p&&(t.p=(s=t.p,qs<=8&&/^data:image\/png;base64/.test(s)?js(s):s))})),p=this.manager.parseAnimation(l({keyframes:o},n)),e.anim=p,i.addChildAt(p.group,0),this.managerLife.forEach((function(t){p.on(t,(function(s){return e.emit(t,s)}))})),p.isImagesLoaded&&e.emit("success",{}),[2]}}))}))},e.prototype.remove=function(t){var s=t.component,e=this.renderSystem.containerManager.getContainer(t.gameObject.id);e&&(e.removeChild(s.anim.group),s.anim.destroy()),s.anim=null},e.systemName="LottieSystem",e=p([t.decorators.componentObserver({Lottie:[]})],e)}(s.Renderer),Xs=Rs,Ys=function(t){function s(s){var e=t.call(this)||this;return e.loadStatus=!1,e.firstPlay=null,e.prevSlot={},e.currentSlot={},e.options=l({autoStart:!1},s),e.on("success",(function(){e.loadStatus=!0;for(var t=e.anim.keyframes,s=t.ip,i=t.op,h=function(t){var s="@"+t;e.anim.on(s,(function(t){return e.emit(s,t)}))},r=s;r<=i;r++)h(r);e.firstPlay&&e.firstPlay()})),e}return o(s,t),s.prototype.play=function(t,s){var i=this;if(void 0===t&&(t=[]),void 0===s&&(s={repeats:0}),this.loadStatus){var h=s.slot;(void 0===h?[]:h).forEach((function(t){var s=t.name,h=t.type,r=t.value,n=t.style,a=void 0===n?{}:n,o=a.x,l=a.y,p=a.anchor,c=void 0===p?{x:0,y:0}:p,u=a.pivot,d=void 0===u?{x:0,y:0}:u,f=a.width,m=a.height;"IMAGE"===h?i.currentSlot[s]=e.Sprite.from(r):"TEXT"===h&&(i.currentSlot[s]=new e.Text(r,new e.TextStyle(a))),o&&(i.currentSlot[s].x=o),l&&(i.currentSlot[s].y=l),f&&(i.currentSlot[s].width=f),m&&(i.currentSlot[s].height=m),i.currentSlot[s].anchor.set(c.x||0,c.y||0),i.currentSlot[s].pivot.set(i.currentSlot[s].width*(d.x||0),i.currentSlot[s].height*(d.y||0)),i.prevSlot[s]&&i.anim.unbindSlot(s,i.prevSlot[s]),i.anim.bindSlot(s,i.currentSlot[s]),i.prevSlot[s]=i.currentSlot[s]})),this.anim.playSegment(this.playParamsHandle(t),s)}else this.firstPlay=function(){i.play(t,s)}},s.prototype.playParamsHandle=function(t){var s=[].concat(t),e=this.anim.keyframes;return!s.length||s.length>2?s=[e.ip,e.op]:1===s.length&&(s=[s[0]%e.op,e.op]),s},s.prototype.onTap=function(t,s){var i=this,h=new e.Graphics;this.on("success",(function(){var e=i.anim.querySelector(t),r=e.display;h.beginFill(16777215),h.drawRect(0,0,100,100),h.endFill(),h.alpha=0,r.addChild(h),e.display.interactive=!0,e.display.on("pointertap",(function(){s()}))}))},s.componentName="Lottie",p([h.Field({type:"resource",required:!0}),c("design:type",String)],s.prototype,"resource",void 0),s}(t.Component),Bs=Ys;t.resource.registerResourceType("LOTTIE"),exports.Lottie=Bs,exports.LottieSystem=Xs;