@dotlottie/player-component
Version:
dotLottie animation player web component.
5 lines (4 loc) • 268 kB
JavaScript
import { a } from './chunk-HDDX7F4A.mjs';
import './chunk-ZWH2ESXT.mjs';
var ut=a((exports,module)=>{typeof navigator<"u"&&function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.lottie=e());}(exports,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t;},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t;},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,r=t.length,s;for(i=0;i<r;i+=1){s=t[i].prototype;for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e.prototype[a]=s[a]);}}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}var audioControllerFactory=function(){function t(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1;}return t.prototype={addAudio:function(e){this.audios.push(e);},pause:function(){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].pause();},resume:function(){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].resume();},setRate:function(e){var i,r=this.audios.length;for(i=0;i<r;i+=1)this.audios[i].setRate(e);},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0;},seek:function(){this.isPlaying=!1;},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e;},setVolume:function(e){this._volume=e,this._updateVolume();},mute:function(){this._isMuted=!0,this._updateVolume();},unmute:function(){this._isMuted=!1,this._updateVolume();},getVolume:function(){return this._volume},_updateVolume:function(){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1));}},function(){return new t}}(),createTypedArray=function(){function t(i,r){var s=0,a=[],n;switch(i){case"int16":case"uint8c":n=1;break;default:n=1.1;break}for(s=0;s<r;s+=1)a.push(n);return a}function e(i,r){return i==="float32"?new Float32Array(r):i==="int16"?new Int16Array(r):i==="uint8c"?new Uint8ClampedArray(r):t(i,r)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:t}();function createSizedArray(t){return Array.apply(null,{length:t})}function _typeof$6(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(e){return typeof e}:_typeof$6=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(t)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMin=Math.min,BMMath={};((function(){var t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e,i=t.length;for(e=0;e<i;e+=1)BMMath[t[e]]=Math[t[e]];}))(),BMMath.random=Math.random,BMMath.abs=function(t){var e=_typeof$6(t);if(e==="object"&&t.length){var i=createSizedArray(t.length),r,s=t.length;for(r=0;r<s;r+=1)i[r]=Math.abs(t[r]);return i}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function BMEnterFrameEvent(t,e,i,r){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=r<0?-1:1;}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1;}function BMCompleteLoopEvent(t,e,i,r){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=r<0?-1:1;}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i;}function BMDestroyEvent(t,e){this.type=t,this.target=e;}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e;}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t;}var createElementID=function(){var t=0;return function(){return t+=1,idPrefix$1+"__lottie_element_"+t}}();function HSVtoRGB(t,e,i){var r,s,a,n,p,o,d,v;switch(n=Math.floor(t*6),p=t*6-n,o=i*(1-e),d=i*(1-p*e),v=i*(1-(1-p)*e),n%6){case 0:r=i,s=v,a=o;break;case 1:r=d,s=i,a=o;break;case 2:r=o,s=i,a=v;break;case 3:r=o,s=d,a=i;break;case 4:r=v,s=o,a=i;break;case 5:r=i,s=o,a=d;break}return [r,s,a]}function RGBtoHSV(t,e,i){var r=Math.max(t,e,i),s=Math.min(t,e,i),a=r-s,n,p=r===0?0:a/r,o=r/255;switch(r){case s:n=0;break;case t:n=e-i+a*(e<i?6:0),n/=6*a;break;case e:n=i-t+a*2,n/=6*a;break;case i:n=t-e+a*4,n/=6*a;break}return [n,p,o]}function addSaturationToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}(function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(r,s,a){return r<0&&(r=0),s<0&&(s=0),a<0&&(a=0),"#"+t[r]+t[s]+t[a]}})();var setSubframeEnabled=function(t){subframeEnabled=!!t;},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t;},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t;},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t;},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t;};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(e){return typeof e}:_typeof$5=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=function(){var t=1,e=[],i,r,s={onmessage:function(){},postMessage:function(c){i({data:c});}},a={postMessage:function(c){s.onmessage({data:c});}};function n(c){if(window.Worker&&window.Blob&&getWebWorker()){var P=new Blob(["var _workerSelf = self; self.onmessage = ",c.toString()],{type:"text/javascript"}),g=URL.createObjectURL(P);return new Worker(g)}return i=c,s}function p(){r||(r=n(function(c){function P(){function y(F,w){var x,E,u=F.length,C,M,k,z;for(E=0;E<u;E+=1)if(x=F[E],"ks"in x&&!x.completed){if(x.completed=!0,x.hasMask){var O=x.masksProperties;for(M=O.length,C=0;C<M;C+=1)if(O[C].pt.k.i)m(O[C].pt.k);else for(z=O[C].pt.k.length,k=0;k<z;k+=1)O[C].pt.k[k].s&&m(O[C].pt.k[k].s[0]),O[C].pt.k[k].e&&m(O[C].pt.k[k].e[0]);}x.ty===0?(x.layers=h(x.refId,w),y(x.layers,w)):x.ty===4?l(x.shapes):x.ty===5&&V(x);}}function _(F,w){if(F){var x=0,E=F.length;for(x=0;x<E;x+=1)F[x].t===1&&(F[x].data.layers=h(F[x].data.refId,w),y(F[x].data.layers,w));}}function f(F,w){for(var x=0,E=w.length;x<E;){if(w[x].id===F)return w[x];x+=1;}return null}function h(F,w){var x=f(F,w);return x?x.layers.__used?JSON.parse(JSON.stringify(x.layers)):(x.layers.__used=!0,x.layers):null}function l(F){var w,x=F.length,E,u;for(w=x-1;w>=0;w-=1)if(F[w].ty==="sh")if(F[w].ks.k.i)m(F[w].ks.k);else for(u=F[w].ks.k.length,E=0;E<u;E+=1)F[w].ks.k[E].s&&m(F[w].ks.k[E].s[0]),F[w].ks.k[E].e&&m(F[w].ks.k[E].e[0]);else F[w].ty==="gr"&&l(F[w].it);}function m(F){var w,x=F.i.length;for(w=0;w<x;w+=1)F.i[w][0]+=F.v[w][0],F.i[w][1]+=F.v[w][1],F.o[w][0]+=F.v[w][0],F.o[w][1]+=F.v[w][1];}function S(F,w){var x=w?w.split("."):[100,100,100];return F[0]>x[0]?!0:x[0]>F[0]?!1:F[1]>x[1]?!0:x[1]>F[1]?!1:F[2]>x[2]?!0:x[2]>F[2]?!1:null}var T=function(){var F=[4,4,14];function w(E){var u=E.t.d;E.t.d={k:[{s:u,t:0}]};}function x(E){var u,C=E.length;for(u=0;u<C;u+=1)E[u].ty===5&&w(E[u]);}return function(E){if(S(F,E.v)&&(x(E.layers),E.assets)){var u,C=E.assets.length;for(u=0;u<C;u+=1)E.assets[u].layers&&x(E.assets[u].layers);}}}(),A=function(){var F=[4,7,99];return function(w){if(w.chars&&!S(F,w.v)){var x,E=w.chars.length;for(x=0;x<E;x+=1){var u=w.chars[x];u.data&&u.data.shapes&&(l(u.data.shapes),u.data.ip=0,u.data.op=99999,u.data.st=0,u.data.sr=1,u.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},w.chars[x].t||(u.data.shapes.push({ty:"no"}),u.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})));}}}}(),D=function(){var F=[5,7,15];function w(E){var u=E.t.p;typeof u.a=="number"&&(u.a={a:0,k:u.a}),typeof u.p=="number"&&(u.p={a:0,k:u.p}),typeof u.r=="number"&&(u.r={a:0,k:u.r});}function x(E){var u,C=E.length;for(u=0;u<C;u+=1)E[u].ty===5&&w(E[u]);}return function(E){if(S(F,E.v)&&(x(E.layers),E.assets)){var u,C=E.assets.length;for(u=0;u<C;u+=1)E.assets[u].layers&&x(E.assets[u].layers);}}}(),I=function(){var F=[4,1,9];function w(E){var u,C=E.length,M,k;for(u=0;u<C;u+=1)if(E[u].ty==="gr")w(E[u].it);else if(E[u].ty==="fl"||E[u].ty==="st")if(E[u].c.k&&E[u].c.k[0].i)for(k=E[u].c.k.length,M=0;M<k;M+=1)E[u].c.k[M].s&&(E[u].c.k[M].s[0]/=255,E[u].c.k[M].s[1]/=255,E[u].c.k[M].s[2]/=255,E[u].c.k[M].s[3]/=255),E[u].c.k[M].e&&(E[u].c.k[M].e[0]/=255,E[u].c.k[M].e[1]/=255,E[u].c.k[M].e[2]/=255,E[u].c.k[M].e[3]/=255);else E[u].c.k[0]/=255,E[u].c.k[1]/=255,E[u].c.k[2]/=255,E[u].c.k[3]/=255;}function x(E){var u,C=E.length;for(u=0;u<C;u+=1)E[u].ty===4&&w(E[u].shapes);}return function(E){if(S(F,E.v)&&(x(E.layers),E.assets)){var u,C=E.assets.length;for(u=0;u<C;u+=1)E.assets[u].layers&&x(E.assets[u].layers);}}}(),R=function(){var F=[4,4,18];function w(E){var u,C=E.length,M,k;for(u=C-1;u>=0;u-=1)if(E[u].ty==="sh")if(E[u].ks.k.i)E[u].ks.k.c=E[u].closed;else for(k=E[u].ks.k.length,M=0;M<k;M+=1)E[u].ks.k[M].s&&(E[u].ks.k[M].s[0].c=E[u].closed),E[u].ks.k[M].e&&(E[u].ks.k[M].e[0].c=E[u].closed);else E[u].ty==="gr"&&w(E[u].it);}function x(E){var u,C,M=E.length,k,z,O,j;for(C=0;C<M;C+=1){if(u=E[C],u.hasMask){var N=u.masksProperties;for(z=N.length,k=0;k<z;k+=1)if(N[k].pt.k.i)N[k].pt.k.c=N[k].cl;else for(j=N[k].pt.k.length,O=0;O<j;O+=1)N[k].pt.k[O].s&&(N[k].pt.k[O].s[0].c=N[k].cl),N[k].pt.k[O].e&&(N[k].pt.k[O].e[0].c=N[k].cl);}u.ty===4&&w(u.shapes);}}return function(E){if(S(F,E.v)&&(x(E.layers),E.assets)){var u,C=E.assets.length;for(u=0;u<C;u+=1)E.assets[u].layers&&x(E.assets[u].layers);}}}();function L(F){F.__complete||(I(F),T(F),A(F),D(F),R(F),y(F.layers,F.assets),_(F.chars,F.assets),F.__complete=!0);}function V(F){F.t.a.length===0&&"m"in F.t.p;}var B={};return B.completeData=L,B.checkColors=I,B.checkChars=A,B.checkPathProperties=D,B.checkShapes=R,B.completeLayers=y,B}if(a.dataManager||(a.dataManager=P()),a.assetLoader||(a.assetLoader=function(){function y(f){var h=f.getResponseHeader("content-type");return h&&f.responseType==="json"&&h.indexOf("json")!==-1||f.response&&_typeof$5(f.response)==="object"?f.response:f.response&&typeof f.response=="string"?JSON.parse(f.response):f.responseText?JSON.parse(f.responseText):null}function _(f,h,l,m){var S,T=new XMLHttpRequest;try{T.responseType="json";}catch{}T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200)S=y(T),l(S);else try{S=y(T),l(S);}catch(A){m&&m(A);}};try{T.open(["G","E","T"].join(""),f,!0);}catch{T.open(["G","E","T"].join(""),h+"/"+f,!0);}T.send();}return {load:_}}()),c.data.type==="loadAnimation")a.assetLoader.load(c.data.path,c.data.fullPath,function(y){a.dataManager.completeData(y),a.postMessage({id:c.data.id,payload:y,status:"success"});},function(){a.postMessage({id:c.data.id,status:"error"});});else if(c.data.type==="complete"){var g=c.data.animation;a.dataManager.completeData(g),a.postMessage({id:c.data.id,payload:g,status:"success"});}else c.data.type==="loadData"&&a.assetLoader.load(c.data.path,c.data.fullPath,function(y){a.postMessage({id:c.data.id,payload:y,status:"success"});},function(){a.postMessage({id:c.data.id,status:"error"});});}),r.onmessage=function(c){var P=c.data,g=P.id,y=e[g];e[g]=null,P.status==="success"?y.onComplete(P.payload):y.onError&&y.onError();});}function o(c,P){t+=1;var g="processId_"+t;return e[g]={onComplete:c,onError:P},g}function d(c,P,g){p();var y=o(P,g);r.postMessage({type:"loadAnimation",path:c,fullPath:window.location.origin+window.location.pathname,id:y});}function v(c,P,g){p();var y=o(P,g);r.postMessage({type:"loadData",path:c,fullPath:window.location.origin+window.location.pathname,id:y});}function b(c,P,g){p();var y=o(P,g);r.postMessage({type:"complete",animation:c,id:y});}return {loadAnimation:d,loadData:v,completeAnimation:b}}(),ImagePreloader=function(){var t=function(){var f=createTag("canvas");f.width=1,f.height=1;var h=f.getContext("2d");return h.fillStyle="rgba(0,0,0,0)",h.fillRect(0,0,1,1),f}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null);}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null);}function r(f,h,l){var m="";if(f.e)m=f.p;else if(h){var S=f.p;S.indexOf("images/")!==-1&&(S=S.split("/")[1]),m=h+S;}else m=l,m+=f.u?f.u:"",m+=f.p;return m}function s(f){var h=0,l=setInterval(function(){var m=f.getBBox();(m.width||h>500)&&(this._imageLoaded(),clearInterval(l)),h+=1;}.bind(this),50);}function a(f){var h=r(f,this.assetsPath,this.path),l=createNS("image");isSafari?this.testImageLoaded(l):l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",function(){m.img=t,this._imageLoaded();}.bind(this),!1),l.setAttributeNS("http://www.w3.org/1999/xlink","href",h),this._elementHelper.append?this._elementHelper.append(l):this._elementHelper.appendChild(l);var m={img:l,assetData:f};return m}function n(f){var h=r(f,this.assetsPath,this.path),l=createTag("img");l.crossOrigin="anonymous",l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",function(){m.img=t,this._imageLoaded();}.bind(this),!1),l.src=h;var m={img:l,assetData:f};return m}function p(f){var h={assetData:f},l=r(f,this.assetsPath,this.path);return dataManager.loadData(l,function(m){h.img=m,this._footageLoaded();}.bind(this),function(){h.img={},this._footageLoaded();}.bind(this)),h}function o(f,h){this.imagesLoadedCb=h;var l,m=f.length;for(l=0;l<m;l+=1)f[l].layers||(!f[l].t||f[l].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(f[l]))):f[l].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(f[l]))));}function d(f){this.path=f||"";}function v(f){this.assetsPath=f||"";}function b(f){for(var h=0,l=this.images.length;h<l;){if(this.images[h].assetData===f)return this.images[h].img;h+=1;}return null}function c(){this.imagesLoadedCb=null,this.images.length=0;}function P(){return this.totalImages===this.loadedAssets}function g(){return this.totalFootages===this.loadedFootagesCount}function y(f,h){f==="svg"?(this._elementHelper=h,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this);}function _(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=s.bind(this),this.createFootageData=p.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[];}return _.prototype={loadAssets:o,setAssetsPath:v,setPath:d,loadedImages:P,loadedFootages:g,destroy:c,getAsset:b,createImgData:n,createImageData:a,imageLoaded:e,footageLoaded:i,setCacheType:y},_}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],r=0;r<i.length;r+=1)i[r](e);},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e);}.bind(this)},removeEventListener:function(t,e){if(!e)this._cbs[t]=null;else if(this._cbs[t]){for(var i=0,r=this._cbs[t].length;i<r;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,r-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null);}}};var markerParser=function(){function t(e){for(var i=e.split(`\r
`),r={},s,a=0,n=0;n<i.length;n+=1)s=i[n].split(":"),s.length===2&&(r[s[0]]=s[1].trim(),a+=1);if(a===0)throw new Error;return r}return function(e){for(var i=[],r=0;r<e.length;r+=1){var s=e[r],a={time:s.tm,duration:s.dr};try{a.payload=JSON.parse(e[r].cm);}catch{try{a.payload=t(e[r].cm);}catch{a.payload={name:e[r].cm};}}i.push(a);}return i}}(),ProjectInterface=function(){function t(e){this.compositions.push(e);}return function(){function e(i){for(var r=0,s=this.compositions.length;r<s;){if(this.compositions[r].data&&this.compositions[r].data.nm===i)return this.compositions[r].prepareFrame&&this.compositions[r].data.xt&&this.compositions[r].prepareFrame(this.currentFrame),this.compositions[r].compInterface;r+=1;}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),renderers={},registerRenderer=function(t,e){renderers[t]=e;};function getRenderer(t){return renderers[t]}function getRegisteredRenderer(){if(renderers.canvas)return "canvas";for(var t in renderers)if(renderers[t])return t;return ""}function _typeof$4(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(e){return typeof e}:_typeof$4=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(t)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin();};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var i=getRenderer(e);this.renderer=new i(this,t.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,t.loop===""||t.loop===null||t.loop===void 0||t.loop===!0?this.loop=!0:t.loop===!1?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(t,"autoloadSegments")?t.autoloadSegments:!0,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(t.path.lastIndexOf("\\")!==-1?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(t.path,this.configAnimation,this.onSetupError));},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed");},AnimationItem.prototype.setupAnimation=function(t){dataManager.completeAnimation(t,this.configAnimation);},AnimationItem.prototype.setData=function(t,e){e&&_typeof$4(e)!=="object"&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",i.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var s=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";s==="false"?i.loop=!1:s==="true"?i.loop=!0:s!==""&&(i.loop=parseInt(s,10));var a=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:r.getNamedItem("bm-autoplay")?r.getNamedItem("bm-autoplay").value:!0;i.autoplay=a!=="false",i.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"";var n=r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"";n==="false"&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy");},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,r=e.length,s=t.layers,a,n=s.length;for(a=0;a<n;a+=1)for(i=0;i<r;){if(e[i].id===s[a].id){e[i]=s[a];break}i+=1;}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(r=t.assets.length,i=0;i<r;i+=1)this.animationData.assets.push(t.assets[i]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete);},AnimationItem.prototype.onSegmentComplete=function(t){this.animationData=t;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.loadNextSegment();},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||t.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed");}.bind(this));},AnimationItem.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment();},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded();},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this));},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.markers=markerParser(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause();}catch(e){this.triggerConfigError(e);}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20));},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded");}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play();}},AnimationItem.prototype.resize=function(t,e){var i=typeof t=="number"?t:void 0,r=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(i,r);},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t;},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i<this.markers.length;i+=1)if(e=this.markers[i],e.payload&&e.payload.name===t)return e;return null},AnimationItem.prototype.goToAndStop=function(t,e,i){if(!(i&&this.name!==i)){var r=Number(t);if(isNaN(r)){var s=this.getMarkerData(t);s&&this.goToAndStop(s.time,!0);}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause();}},AnimationItem.prototype.goToAndPlay=function(t,e,i){if(!(i&&this.name!==i)){var r=Number(t);if(isNaN(r)){var s=this.getMarkerData(t);s&&(s.duration?this.playSegments([s.time,s.time+s.duration],!0):this.goToAndStop(s.time,!0));}else this.goToAndStop(r,e,i);this.play();}},AnimationItem.prototype.advanceTime=function(t){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,r=t.length;for(i=0;i<r;i+=1)this.segments.push(t[i]);}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play();},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0);},AnimationItem.prototype.checkSegments=function(t){return this.segments.length?(this.adjustSegment(this.segments.shift(),t),!0):!1},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null);},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame();},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier();},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier();},AnimationItem.prototype.setLoop=function(t){this.loop=t;},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t);},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute();},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute();},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection);},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;i.indexOf("images/")!==-1&&(i=i.split("/")[1]),e=this.assetsPath+i;}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t===this.assets[e].id)return this.assets[e];e+=1;}return null},AnimationItem.prototype.hide=function(){this.renderer.hide();},AnimationItem.prototype.show=function(){this.renderer.show();},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(t,e,i){try{var r=this.renderer.getElementByPath(t);r.updateDocumentData(e,i);}catch{}},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(t,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t);}t==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),t==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),t==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),t==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),t==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this));},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e);},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e);};var animationManager=function(){var t={},e=[],i=0,r=0,s=0,a=!0,n=!1;function p(x){for(var E=0,u=x.target;E<r;)e[E].animation===u&&(e.splice(E,1),E-=1,r-=1,u.isPaused||b()),E+=1;}function o(x,E){if(!x)return null;for(var u=0;u<r;){if(e[u].elem===x&&e[u].elem!==null)return e[u].animation;u+=1;}var C=new AnimationItem;return c(C,x),C.setData(x,E),C}function d(){var x,E=e.length,u=[];for(x=0;x<E;x+=1)u.push(e[x].animation);return u}function v(){s+=1,R();}function b(){s-=1;}function c(x,E){x.addEventListener("destroy",p),x.addEventListener("_active",v),x.addEventListener("_idle",b),e.push({elem:E,animation:x}),r+=1;}function P(x){var E=new AnimationItem;return c(E,null),E.setParams(x),E}function g(x,E){var u;for(u=0;u<r;u+=1)e[u].animation.setSpeed(x,E);}function y(x,E){var u;for(u=0;u<r;u+=1)e[u].animation.setDirection(x,E);}function _(x){var E;for(E=0;E<r;E+=1)e[E].animation.play(x);}function f(x){var E=x-i,u;for(u=0;u<r;u+=1)e[u].animation.advanceTime(E);i=x,s&&!n?window.requestAnimationFrame(f):a=!0;}function h(x){i=x,window.requestAnimationFrame(f);}function l(x){var E;for(E=0;E<r;E+=1)e[E].animation.pause(x);}function m(x,E,u){var C;for(C=0;C<r;C+=1)e[C].animation.goToAndStop(x,E,u);}function S(x){var E;for(E=0;E<r;E+=1)e[E].animation.stop(x);}function T(x){var E;for(E=0;E<r;E+=1)e[E].animation.togglePause(x);}function A(x){var E;for(E=r-1;E>=0;E-=1)e[E].animation.destroy(x);}function D(x,E,u){var C=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),M,k=C.length;for(M=0;M<k;M+=1)u&&C[M].setAttribute("data-bm-type",u),o(C[M],x);if(E&&k===0){u||(u="svg");var z=document.getElementsByTagName("body")[0];z.innerText="";var O=createTag("div");O.style.width="100%",O.style.height="100%",O.setAttribute("data-bm-type",u),z.appendChild(O),o(O,x);}}function I(){var x;for(x=0;x<r;x+=1)e[x].animation.resize();}function R(){!n&&s&&a&&(window.requestAnimationFrame(h),a=!1);}function L(){n=!0;}function V(){n=!1,R();}function B(x,E){var u;for(u=0;u<r;u+=1)e[u].animation.setVolume(x,E);}function F(x){var E;for(E=0;E<r;E+=1)e[E].animation.mute(x);}function w(x){var E;for(E=0;E<r;E+=1)e[E].animation.unmute(x);}return t.registerAnimation=o,t.loadAnimation=P,t.setSpeed=g,t.setDirection=y,t.play=_,t.pause=l,t.stop=S,t.togglePause=T,t.searchAnimations=D,t.resize=I,t.goToAndStop=m,t.destroy=A,t.freeze=L,t.unfreeze=V,t.setVolume=B,t.mute=F,t.unmute=w,t.getRegisteredAnimations=d,t}(),BezierFactory=function(){var t={};t.getBezierEasing=i;var e={};function i(h,l,m,S,T){var A=T||("bez_"+h+"_"+l+"_"+m+"_"+S).replace(/\./g,"p");if(e[A])return e[A];var D=new f([h,l,m,S]);return e[A]=D,D}var r=4,s=.001,a=1e-7,n=10,p=11,o=1/(p-1),d=typeof Float32Array=="function";function v(h,l){return 1-3*l+3*h}function b(h,l){return 3*l-6*h}function c(h){return 3*h}function P(h,l,m){return ((v(l,m)*h+b(l,m))*h+c(l))*h}function g(h,l,m){return 3*v(l,m)*h*h+2*b(l,m)*h+c(l)}function y(h,l,m,S,T){var A,D,I=0;do D=l+(m-l)/2,A=P(D,S,T)-h,A>0?m=D:l=D;while(Math.abs(A)>a&&++I<n);return D}function _(h,l,m,S){for(var T=0;T<r;++T){var A=g(l,m,S);if(A===0)return l;var D=P(l,m,S)-h;l-=D/A;}return l}function f(h){this._p=h,this._mSampleValues=d?new Float32Array(p):new Array(p),this._precomputed=!1,this.get=this.get.bind(this);}return f.prototype={get:function(h){var l=this._p[0],m=this._p[1],S=this._p[2],T=this._p[3];return this._precomputed||this._precompute(),l===m&&S===T?h:h===0?0:h===1?1:P(this._getTForX(h),m,T)},_precompute:function(){var h=this._p[0],l=this._p[1],m=this._p[2],S=this._p[3];this._precomputed=!0,(h!==l||m!==S)&&this._calcSampleValues();},_calcSampleValues:function(){for(var h=this._p[0],l=this._p[2],m=0;m<p;++m)this._mSampleValues[m]=P(m*o,h,l);},_getTForX:function(h){for(var l=this._p[0],m=this._p[2],S=this._mSampleValues,T=0,A=1,D=p-1;A!==D&&S[A]<=h;++A)T+=o;--A;var I=(h-S[A])/(S[A+1]-S[A]),R=T+I*o,L=g(R,l,m);return L>=s?_(h,R,l,m):L===0?R:y(h,T,T+o,l,m)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var r=0,s=t,a=createSizedArray(s),n={newElement:p,release:o};function p(){var d;return r?(r-=1,d=a[r]):d=e(),d}function o(d){r===s&&(a=pooling.double(a),s*=2),i&&i(d),a[r]=d,r+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var r,s=i.lengths.length;for(r=0;r<s;r+=1)bezierLengthPool.release(i.lengths[r]);i.lengths.length=0;}return poolFactory(8,t,e)}();function bezFunction(){var t=Math;function e(c,P,g,y,_,f){var h=c*y+P*_+g*f-_*y-f*c-g*P;return h>-.001&&h<.001}function i(c,P,g,y,_,f,h,l,m){if(g===0&&f===0&&m===0)return e(c,P,y,_,h,l);var S=t.sqrt(t.pow(y-c,2)+t.pow(_-P,2)+t.pow(f-g,2)),T=t.sqrt(t.pow(h-c,2)+t.pow(l-P,2)+t.pow(m-g,2)),A=t.sqrt(t.pow(h-y,2)+t.pow(l-_,2)+t.pow(m-f,2)),D;return S>T?S>A?D=S-T-A:D=A-T-S:A>T?D=A-T-S:D=T-S-A,D>-1e-4&&D<1e-4}var r=function(){return function(c,P,g,y){var _=getDefaultCurveSegments(),f,h,l,m,S,T=0,A,D=[],I=[],R=bezierLengthPool.newElement();for(l=g.length,f=0;f<_;f+=1){for(S=f/(_-1),A=0,h=0;h<l;h+=1)m=bmPow(1-S,3)*c[h]+3*bmPow(1-S,2)*S*g[h]+3*(1-S)*bmPow(S,2)*y[h]+bmPow(S,3)*P[h],D[h]=m,I[h]!==null&&(A+=bmPow(D[h]-I[h],2)),I[h]=D[h];A&&(A=bmSqrt(A),T+=A),R.percents[f]=S,R.lengths[f]=T;}return R.addedLength=T,R}}();function s(c){var P=segmentsLengthPool.newElement(),g=c.c,y=c.v,_=c.o,f=c.i,h,l=c._length,m=P.lengths,S=0;for(h=0;h<l-1;h+=1)m[h]=r(y[h],y[h+1],_[h],f[h+1]),S+=m[h].addedLength;return g&&l&&(m[h]=r(y[h],y[0],_[h],f[0]),S+=m[h].addedLength),P.totalLength=S,P}function a(c){this.segmentLength=0,this.points=new Array(c);}function n(c,P){this.partialLength=c,this.point=P;}var p=function(){var c={};return function(P,g,y,_){var f=(P[0]+"_"+P[1]+"_"+g[0]+"_"+g[1]+"_"+y[0]+"_"+y[1]+"_"+_[0]+"_"+_[1]).replace(/\./g,"p");if(!c[f]){var h=getDefaultCurveSegments(),l,m,S,T,A,D=0,I,R,L=null;P.length===2&&(P[0]!==g[0]||P[1]!==g[1])&&e(P[0],P[1],g[0],g[1],P[0]+y[0],P[1]+y[1])&&e(P[0],P[1],g[0],g[1],g[0]+_[0],g[1]+_[1])&&(h=2);var V=new a(h);for(S=y.length,l=0;l<h;l+=1){for(R=createSizedArray(S),A=l/(h-1),I=0,m=0;m<S;m+=1)T=bmPow(1-A,3)*P[m]+3*bmPow(1-A,2)*A*(P[m]+y[m])+3*(1-A)*bmPow(A,2)*(g[m]+_[m])+bmPow(A,3)*g[m],R[m]=T,L!==null&&(I+=bmPow(R[m]-L[m],2));I=bmSqrt(I),D+=I,V.points[l]=new n(I,R),L=R;}V.segmentLength=D,c[f]=V;}return c[f]}}();function o(c,P){var g=P.percents,y=P.lengths,_=g.length,f=bmFloor((_-1)*c),h=c*P.addedLength,l=0;if(f===_-1||f===0||h===y[f])return g[f];for(var m=y[f]>h?-1:1,S=!0;S;)if(y[f]<=h&&y[f+1]>h?(l=(h-y[f])/(y[f+1]-y[f]),S=!1):f+=m,f<0||f>=_-1){if(f===_-1)return g[f];S=!1;}return g[f]+(g[f+1]-g[f])*l}function d(c,P,g,y,_,f){var h=o(_,f),l=1-h,m=t.round((l*l*l*c[0]+(h*l*l+l*h*l+l*l*h)*g[0]+(h*h*l+l*h*h+h*l*h)*y[0]+h*h*h*P[0])*1e3)/1e3,S=t.round((l*l*l*c[1]+(h*l*l+l*h*l+l*l*h)*g[1]+(h*h*l+l*h*h+h*l*h)*y[1]+h*h*h*P[1])*1e3)/1e3;return [m,S]}var v=createTypedArray("float32",8);function b(c,P,g,y,_,f,h){_<0?_=0:_>1&&(_=1);var l=o(_,h);f=f>1?1:f;var m=o(f,h),S,T=c.length,A=1-l,D=1-m,I=A*A*A,R=l*A*A*3,L=l*l*A*3,V=l*l*l,B=A*A*D,F=l*A*D+A*l*D+A*A*m,w=l*l*D+A*l*m+l*A*m,x=l*l*m,E=A*D*D,u=l*D*D+A*m*D+A*D*m,C=l*m*D+A*m*m+l*D*m,M=l*m*m,k=D*D*D,z=m*D*D+D*m*D+D*D*m,O=m*m*D+D*m*m+m*D*m,j=m*m*m;for(S=0;S<T;S+=1)v[S*4]=t.round((I*c[S]+R*g[S]+L*y[S]+V*P[S])*1e3)/1e3,v[S*4+1]=t.round((B*c[S]+F*g[S]+w*y[S]+x*P[S])*1e3)/1e3,v[S*4+2]=t.round((E*c[S]+u*g[S]+C*y[S]+M*P[S])*1e3)/1e3,v[S*4+3]=t.round((k*c[S]+z*g[S]+O*y[S]+j*P[S])*1e3)/1e3;return v}return {getSegmentsLength:s,getNewSegment:b,getPointInSegment:d,buildBezierData:p,pointOnLine2D:e,pointOnLine3D:i}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var i=this.offsetTime,r;this.propType==="multidimensional"&&(r=createTypedArray("float32",this.pv.length));for(var s=e.lastIndex,a=s,n=this.keyframes.length-1,p=!0,o,d,v;p;){if(o=this.keyframes[a],d=this.keyframes[a+1],a===n-1&&t>=d.t-i){o.h&&(o=d),s=0;break}if(d.t-i>t){s=a;break}a<n-1?a+=1:(s=0,p=!1);}v=this.keyframesMetadata[a]||{};var b,c,P,g,y,_,f=d.t-i,h=o.t-i,l;if(o.to){v.bezierData||(v.bezierData=bez.buildBezierData(o.s,d.s||o.e,o.to,o.ti));var m=v.bezierData;if(t>=f||t<h){var S=t>=f?m.points.length-1:0;for(c=m.points[S].point.length,b=0;b<c;b+=1)r[b]=m.points[S].point[b];}else {v.__fnct?_=v.__fnct:(_=BezierFactory.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n).get,v.__fnct=_),P=_((t-h)/(f-h));var T=m.segmentLength*P,A,D=e.lastFrame<t&&e._lastKeyframeIndex===a?e._lastAddedLength:0;for(y=e.lastFrame<t&&e._lastKeyframeIndex===a?e._lastPoint:0,p=!0,g=m.points.length;p;){if(D+=m.points[y].partialLength,T===0||P===0||y===m.points.length-1){for(c=m.points[y].point.length,b=0;b<c;b+=1)r[b]=m.points[y].point[b];break}else if(T>=D&&T<D+m.points[y+1].partialLength){for(A=(T-D)/m.points[y+1].partialLength,c=m.points[y].point.length,b=0;b<c;b+=1)r[b]=m.points[y].point[b]+(m.points[y+1].point[b]-m.points[y].point[b])*A;break}y<g-1?y+=1:p=!1;}e._lastPoint=y,e._lastAddedLength=D-m.points[y].partialLength,e._lastKeyframeIndex=a;}}else {var I,R,L,V,B;if(n=o.s.length,l=d.s||o.e,this.sh&&o.h!==1)if(t>=f)r[0]=l[0],r[1]=l[1],r[2]=l[2];else if(t<=h)r[0]=o.s[0],r[1]=o.s[1],r[2]=o.s[2];else {var F=createQuaternion(o.s),w=createQuaternion(l),x=(t-h)/(f-h);quaternionToEuler(r,slerp(F,w,x));}else for(a=0;a<n;a+=1)o.h!==1&&(t>=f?P=1:t<h?P=0:(o.o.x.constructor===Array?(v.__fnct||(v.__fnct=[]),v.__fnct[a]?_=v.__fnct[a]:(I=o.o.x[a]===void 0?o.o.x[0]:o.o.x[a],R=o.o.y[a]===void 0?o.o.y[0]:o.o.y[a],L=o.i.x[a]===void 0?o.i.x[0]:o.i.x[a],V=o.i.y[a]===void 0?o.i.y[0]:o.i.y[a],_=BezierFactory.getBezierEasing(I,R,L,V).get,v.__fnct[a]=_)):v.__fnct?_=v.__fnct:(I=o.o.x,R=o.o.y,L=o.i.x,V=o.i.y,_=BezierFactory.getBezierEasing(I,R,L,V).get,o.keyframeMetadata=_),P=_((t-h)/(f-h)))),l=d.s||o.e,B=o.h===1?o.s[a]:o.s[a]+(l[a]-o.s[a])*P,this.propType==="multidimensional"?r[a]=B:r=B;}return e.lastIndex=s,r}function slerp(t,e,i){var r=[],s=t[0],a=t[1],n=t[2],p=t[3],o=e[0],d=e[1],v=e[2],b=e[3],c,P,g,y,_;return P=s*o+a*d+n*v+p*b,P<0&&(P=-P,o=-o,d=-d,v=-v,b=-b),1-P>1e-6?(c=Math.acos(P),g=Math.sin(c),y=Math.sin((1-i)*c)/g,_=Math.sin(i*c)/g):(y=1-i,_=i),r[0]=y*s+_*o,r[1]=y*a+_*d,r[2]=y*n+_*v,r[3]=y*p+_*b,r}function quaternionToEuler(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=Math.atan2(2*r*a-2*i*s,1-2*r*r-2*s*s),p=Math.asin(2*i*r+2*s*a),o=Math.atan2(2*i*a-2*r*s,1-2*i*i-2*s*s);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=o/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,r=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(r/2),p=Math.sin(e/2),o=Math.sin(i/2),d=Math.sin(r/2),v=s*a*n-p*o*d,b=p*o*n+s*a*d,c=p*a*n+s*o*d,P=s*o*n-p*a*d;return [b,c,P,v]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(t,this._caching);this.pv=r;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,r=this.v.length;i<r;)e=t[i]*this.mult,mathAbs(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId;}}function addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this);}function ValueProperty(t,e,i,r){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect;}function MultiDimensionalProperty(t,e,i,r){this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect;}function KeyframedValueProperty(t,e,i,r){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect;}function KeyframedMultidimensionalProperty(t,e,i,r){this.propType="multidimensional";var s,a=e.k.length,n,p,o,d;for(s=0;s<a-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(n=e.k[s].s,p=e.k[s+1].s,o=e.k[s].to,d=e.k[s].ti,(n.length===2&&!(n[0]===p[0]&&n[1]===p[1])&&bez.pointOnLine2D(n[0],n[1],p[0],p[1],n[0]+o[0],n[1]+o[1])&&bez.pointOnLine2D(n[0],n[1],p[0],p[1],p[0]+d[0],p[1]+d[1])||n.length===3&&!(n[0]===p[0]&&n[1]===p[1]&&n[2]===p[2])&&bez.pointOnLine3D(n[0],n[1],n[2],p[0],p[1],p[2],n[0]+o[0],n[1]+o[1],n[2]+o[2])&&bez.pointOnLine3D(n[0],n[1],n[2],p[0],p[1],p[2],p[0]+d[0],p[1]+d[1],p[2]+d[2]))&&(e.k[s].to=null,e.k[s].ti=null),n[0]===p[0]&&n[1]===p[1]&&o[0]===0&&o[1]===0&&d[0]===0&&d[1]===0&&(n.length===2||n[2]===p[2]&&o[2]===0&&d[2]===0)&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var v=e.k[0].s.length;for(this.v=createTypedArray("float32",v),this.pv=createTypedArray("float32",v),s=0;s<v;s+=1)this.v[s]=initFrame,this.pv[s]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",v)},this.addEffect=addEffect;}var PropertyFactory=function(){function t(i,r,s,a,n){r.sid&&(r=i.globalData.slotManager.getProp(r));var p;if(!r.k.length)p=new ValueProperty(i,r,a,n);else if(typeof r.k[0]=="number")p=new MultiDimensionalProperty(i,r,a,n);else switch(s){case 0:p=new KeyframedValueProperty(i,r,a,n);break;case 1:p=new KeyframedMultidimensionalProperty(i,r,a,n);break}return p.effectsSequence.length&&n.addDynamicProperty(p),p}var e={getProp:t};return e}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){this.dynamicProperties.indexOf(t)===-1&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0);},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0);},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1;}};var pointPool=function(){function t(){return createTypedArray("float32",2)}return poolFactory(8,t)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),th