UNPKG

lottie-light-react

Version:
1 lines 174 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=e(t),s=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,{exports:{}});!function(t,e){"undefined"!=typeof navigator&&(s.exports=function(){var t="http://www.w3.org/2000/svg",i="",s=!1,a=-999999,r=function(t){s=!!t},n=function(){return s},o=function(t){i=t},h=function(){return i};function l(t){return document.createElement(t)}function p(t,e){var i,s,a=t.length;for(i=0;i<a;i+=1)for(var r in s=t[i].prototype)Object.prototype.hasOwnProperty.call(s,r)&&(e.prototype[r]=s[r])}function f(t){function e(){}return e.prototype=t,e}var u=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):window.Howl?new window.Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),d=function(){function t(t,e){var i,s=0,a=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(s=0;s<e;s+=1)a.push(i);return a}function e(e,i){return"float32"===e?new Float32Array(i):"int16"===e?new Int16Array(i):"uint8c"===e?new Uint8ClampedArray(i):t(e,i)}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?e:t}();function m(t){return Array.apply(null,{length:t})}var c=!0,g=null,y="",v=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=Math.pow,_=Math.sqrt,k=Math.floor,P=Math.min,A=150,S=Math.PI/180,w=.5519;function x(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function D(t,e){this.type=t,this.direction=e<0?-1:1}function C(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function M(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function F(t,e){this.type=t,this.target=e}function T(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function E(t){this.type="configError",this.nativeError=t}var I,L=(I=0,function(){return y+"__lottie_element_"+(I+=1)});function R(t,e,i){var s,a,r,n,o,h,l,p;switch(h=i*(1-e),l=i*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=i*(1-(1-o)*e),n%6){case 0:s=i,a=p,r=h;break;case 1:s=l,a=i,r=h;break;case 2:s=h,a=i,r=p;break;case 3:s=h,a=l,r=i;break;case 4:s=p,a=h,r=i;break;case 5:s=i,a=h,r=l}return[s,a,r]}function V(t,e,i){var s,a=Math.max(t,e,i),r=Math.min(t,e,i),n=a-r,o=0===a?0:n/a,h=a/255;switch(a){case r:s=0;break;case t:s=e-i+n*(e<i?6:0),s/=6*n;break;case e:s=i-t+2*n,s/=6*n;break;case i:s=t-e+4*n,s/=6*n}return[s,o,h]}function O(t,e){var i=V(255*t[0],255*t[1],255*t[2]);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),R(i[0],i[1],i[2])}function z(t,e){var i=V(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),R(i[0],i[1],i[2])}function N(t,e){var i=V(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),R(i[0],i[1],i[2])}!function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e}();var j=function(t){c=!!t},B=function(){return c},q=function(t){g=t},W=function(){return g},H=function(t){A=t},X=function(){return A},Y=function(t){y=t};function G(e){return document.createElementNS(t,e)}function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}var K=function(){var t,e,i=1,s=[],a={onmessage:function(){},postMessage:function(e){t({data:e})}},r={postMessage:function(t){a.onmessage({data:t})}};function o(e){if(window.Worker&&window.Blob&&n()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),s=URL.createObjectURL(i);return new Worker(s)}return t=e,a}function h(){e||((e=o((function(t){function e(){function t(e,i){var n,o,h,l,p,f,u=e.length;for(o=0;o<u;o+=1)if("ks"in(n=e[o])&&!n.completed){if(n.completed=!0,n.hasMask){var d=n.masksProperties;for(l=d.length,h=0;h<l;h+=1)if(d[h].pt.k.i)r(d[h].pt.k);else for(f=d[h].pt.k.length,p=0;p<f;p+=1)d[h].pt.k[p].s&&r(d[h].pt.k[p].s[0]),d[h].pt.k[p].e&&r(d[h].pt.k[p].e[0])}0===n.ty?(n.layers=s(n.refId,i),t(n.layers,i)):4===n.ty?a(n.shapes):5===n.ty&&m(n)}}function e(e,i){if(e){var a=0,r=e.length;for(a=0;a<r;a+=1)1===e[a].t&&(e[a].data.layers=s(e[a].data.refId,i),t(e[a].data.layers,i))}}function i(t,e){for(var i=0,s=e.length;i<s;){if(e[i].id===t)return e[i];i+=1}return null}function s(t,e){var s=i(t,e);return s?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function a(t){var e,i,s;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)r(t[e].ks.k);else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&r(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&r(t[e].ks.k[i].e[0]);else"gr"===t[e].ty&&a(t[e].it)}function r(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function n(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var o,h=function(){var t=[4,4,14];function e(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),l=(o=[4,7,99],function(t){if(t.chars&&!n(o,t.v)){var e,i=t.chars.length;for(e=0;e<i;e+=1){var s=t.chars[e];s.data&&s.data.shapes&&(a(s.data.shapes),s.data.ip=0,s.data.op=99999,s.data.st=0,s.data.sr=1,s.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}},t.chars[e].t||(s.data.shapes.push({ty:"no"}),s.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"})))}}}),p=function(){var t=[5,7,15];function e(t){var e=t.t.p;"number"==typeof e.a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r&&(e.r={a:0,k:e.r})}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),f=function(){var t=[4,1,9];function e(t){var i,s,a,r=t.length;for(i=0;i<r;i+=1)if("gr"===t[i].ty)e(t[i].it);else if("fl"===t[i].ty||"st"===t[i].ty)if(t[i].c.k&&t[i].c.k[0].i)for(a=t[i].c.k.length,s=0;s<a;s+=1)t[i].c.k[s].s&&(t[i].c.k[s].s[0]/=255,t[i].c.k[s].s[1]/=255,t[i].c.k[s].s[2]/=255,t[i].c.k[s].s[3]/=255),t[i].c.k[s].e&&(t[i].c.k[s].e[0]/=255,t[i].c.k[s].e[1]/=255,t[i].c.k[s].e[2]/=255,t[i].c.k[s].e[3]/=255);else t[i].c.k[0]/=255,t[i].c.k[1]/=255,t[i].c.k[2]/=255,t[i].c.k[3]/=255}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)4===t[i].ty&&e(t[i].shapes)}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),u=function(){var t=[4,4,18];function e(t){var i,s,a;for(i=t.length-1;i>=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(a=t[i].ks.k.length,s=0;s<a;s+=1)t[i].ks.k[s].s&&(t[i].ks.k[s].s[0].c=t[i].closed),t[i].ks.k[s].e&&(t[i].ks.k[s].e[0].c=t[i].closed);else"gr"===t[i].ty&&e(t[i].it)}function i(t){var i,s,a,r,n,o,h=t.length;for(s=0;s<h;s+=1){if((i=t[s]).hasMask){var l=i.masksProperties;for(r=l.length,a=0;a<r;a+=1)if(l[a].pt.k.i)l[a].pt.k.c=l[a].cl;else for(o=l[a].pt.k.length,n=0;n<o;n+=1)l[a].pt.k[n].s&&(l[a].pt.k[n].s[0].c=l[a].cl),l[a].pt.k[n].e&&(l[a].pt.k[n].e[0].c=l[a].cl)}4===i.ty&&e(i.shapes)}}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}();function d(i){i.__complete||(f(i),h(i),l(i),p(i),u(i),t(i.layers,i.assets),e(i.chars,i.assets),i.__complete=!0)}function m(t){0===t.t.a.length&&t.t.p}var c={completeData:function(e){e.__complete||(f(e),h(e),l(e),p(e),u(e),t(e.layers,e.assets),function(e,i){if(e){var a=0,r=e.length;for(a=0;a<r;a+=1)1===e[a].t&&(e[a].data.layers=s(e[a].data.refId,i),t(e[a].data.layers,i))}}(e.chars,e.assets),e.__complete=!0)}};return c.completeData=d,c.checkColors=f,c.checkChars=l,c.checkPathProperties=p,c.checkShapes=u,c.completeLayers=t,c}if(r.dataManager||(r.dataManager=e()),r.assetLoader||(r.assetLoader=function(){function t(t){var e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&-1!==e.indexOf("json")||t.response&&"object"===J(t.response)?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function e(e,i,s,a){var r,n=new XMLHttpRequest;try{n.responseType="json"}catch(t){}n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status)r=t(n),s(r);else try{r=t(n),s(r)}catch(t){a&&a(t)}};try{n.open(["G","E","T"].join(""),e,!0)}catch(t){n.open(["G","E","T"].join(""),i+"/"+e,!0)}n.send()}return{load:e}}()),"loadAnimation"===t.data.type)r.assetLoader.load(t.data.path,t.data.fullPath,(function(e){r.dataManager.completeData(e),r.postMessage({id:t.data.id,payload:e,status:"success"})}),(function(){r.postMessage({id:t.data.id,status:"error"})}));else if("complete"===t.data.type){var i=t.data.animation;r.dataManager.completeData(i),r.postMessage({id:t.data.id,payload:i,status:"success"})}else"loadData"===t.data.type&&r.assetLoader.load(t.data.path,t.data.fullPath,(function(e){r.postMessage({id:t.data.id,payload:e,status:"success"})}),(function(){r.postMessage({id:t.data.id,status:"error"})}))}))).onmessage=function(t){var e=t.data,i=e.id,a=s[i];s[i]=null,"success"===e.status?a.onComplete(e.payload):a.onError&&a.onError()})}function l(t,e){var a="processId_"+(i+=1);return s[a]={onComplete:t,onError:e},a}function p(t,i,s){h();var a=l(i,s);e.postMessage({type:"loadAnimation",path:t,fullPath:window.location.origin+window.location.pathname,id:a})}function f(t,i,s){h();var a=l(i,s);e.postMessage({type:"loadData",path:t,fullPath:window.location.origin+window.location.pathname,id:a})}function u(t,i,s){h();var a=l(i,s);e.postMessage({type:"complete",animation:t,id:a})}return{loadAnimation:p,loadData:f,completeAnimation:u}}(),U=function(){var t=function(){var t=l("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();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 s(t,e,i){var s="";if(t.e)s=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),s=e+a}else s=i,s+=t.u?t.u:"",s+=t.p;return s}function a(t){var e=0,i=setInterval(function(){(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function r(e){var i=s(e,this.assetsPath,this.path),a=G("image");v?this.testImageLoaded(a):a.addEventListener("load",this._imageLoaded,!1),a.addEventListener("error",function(){r.img=t,this._imageLoaded()}.bind(this),!1),a.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(a):this._elementHelper.appendChild(a);var r={img:a,assetData:e};return r}function n(e){var i=s(e,this.assetsPath,this.path),a=l("img");a.crossOrigin="anonymous",a.addEventListener("load",this._imageLoaded,!1),a.addEventListener("error",function(){r.img=t,this._imageLoaded()}.bind(this),!1),a.src=i;var r={img:a,assetData:e};return r}function o(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return K.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function h(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;i<s;i+=1)t[i].layers||(t[i].t&&"seq"!==t[i].t?3===t[i].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(t[i]))):(this.totalImages+=1,this.images.push(this._createImageData(t[i]))))}function p(t){this.path=t||""}function f(t){this.assetsPath=t||""}function u(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null}function d(){this.imagesLoadedCb=null,this.images.length=0}function m(){return this.totalImages===this.loadedAssets}function c(){return this.totalFootages===this.loadedFootagesCount}function g(t,e){"svg"===t?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function y(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=a.bind(this),this.createFootageData=o.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return y.prototype={loadAssets:h,setAssetsPath:f,setPath:p,loadedImages:m,loadedFootages:c,destroy:d,getAsset:u,createImgData:n,createImageData:r,imageLoaded:e,footageLoaded:i,setCacheType:g},y}();function Z(){}Z.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],s=0;s<i.length;s+=1)i[s](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){if(this._cbs[t]){for(var i=0,s=this._cbs[t].length;i<s;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,s-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var Q=function(){function t(t){for(var e,i=t.split("\r\n"),s={},a=0,r=0;r<i.length;r+=1)2===(e=i[r].split(":")).length&&(s[e[0]]=e[1].trim(),a+=1);if(0===a)throw new Error;return s}return function(e){for(var i=[],s=0;s<e.length;s+=1){var a=e[s],r={time:a.tm,duration:a.dr};try{r.payload=JSON.parse(e[s].cm)}catch(i){try{r.payload=t(e[s].cm)}catch(t){r.payload={name:e[s].cm}}}i.push(r)}return i}}(),$=function(){function t(t){this.compositions.push(t)}return function(){function e(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),tt={},et=function(t,e){tt[t]=e};function it(t){return tt[t]}function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}var at=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=L(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=B(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=$(),this.imagePreloader=new U,this.audioController=u(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new x("drawnFrame",0,0,0)};p([Z],at),at.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=it(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||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?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")),K.loadAnimation(t.path,this.configAnimation,this.onSetupError))},at.prototype.onSetupError=function(){this.trigger("data_failed")},at.prototype.setupAnimation=function(t){K.completeAnimation(t,this.configAnimation)},at.prototype.setData=function(t,e){e&&"object"!==st(e)&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},s=t.attributes;i.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",i.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:"canvas";var a=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";"false"===a?i.loop=!1:"true"===a?i.loop=!0:""!==a&&(i.loop=parseInt(a,10));var r=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:!s.getNamedItem("bm-autoplay")||s.getNamedItem("bm-autoplay").value;i.autoplay="false"!==r,i.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"","false"===(s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),this.setParams(i)},at.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,i,s=this.animationData.layers,a=s.length,r=t.layers,n=r.length;for(i=0;i<n;i+=1)for(e=0;e<a;){if(s[e].id===r[i].id){s[e]=r[i];break}e+=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(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,K.completeAnimation(this.animationData,this.onSegmentComplete)},at.prototype.onSegmentComplete=function(t){this.animationData=t;var e=W();e&&e.initExpressions(this),this.loadNextSegment()},at.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,K.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},at.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},at.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},at.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},at.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=Q(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},at.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},at.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=W();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},at.prototype.resize=function(t,e){var i="number"==typeof t?t:void 0,s="number"==typeof e?e:void 0;this.renderer.updateContainerSize(i,s)},at.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},at.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")},at.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},at.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_pause"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},at.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_play"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},at.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},at.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},at.prototype.getMarkerData=function(t){for(var e,i=0;i<this.markers.length;i+=1)if((e=this.markers[i]).payload&&e.payload.name===t)return e;return null},at.prototype.goToAndStop=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var a=this.getMarkerData(t);a&&this.goToAndStop(a.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},at.prototype.goToAndPlay=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var a=this.getMarkerData(t);a&&(a.duration?this.playSegments([a.time,a.time+a.duration],!0):this.goToAndStop(a.time,!0))}else this.goToAndStop(s,e,i);this.play()}},at.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?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):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},at.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")},at.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,-1!==i&&this.goToAndStop(i,!0)},at.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===st(t[0])){var i,s=t.length;for(i=0;i<s;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()},at.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},at.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},at.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.renderer=null,this.imagePreloader=null,this.projectInterface=null)},at.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},at.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},at.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},at.prototype.setLoop=function(t){this.loop=t},at.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},at.prototype.getVolume=function(){return this.audioController.getVolume()},at.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},at.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},at.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},at.prototype.getPath=function(){return this.path},at.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},at.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},at.prototype.hide=function(){this.renderer.hide()},at.prototype.show=function(){this.renderer.show()},at.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},at.prototype.updateDocumentData=function(t,e,i){try{this.renderer.getElementByPath(t).updateDocumentData(e,i)}catch(t){}},at.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new x(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 C(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new D(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new M(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new F(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new x(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new C(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new D(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new M(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new F(t,this))},at.prototype.triggerRenderFrameError=function(t){var e=new T(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},at.prototype.triggerConfigError=function(t){var e=new E(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var rt=function(){var t={},e=[],i=0,s=0,a=0,r=!0,n=!1;function o(t){for(var i=0,a=t.target;i<s;)e[i].animation===a&&(e.splice(i,1),i-=1,s-=1,a.isPaused||u()),i+=1}function h(t,i){if(!t)return null;for(var a=0;a<s;){if(e[a].elem===t&&null!==e[a].elem)return e[a].animation;a+=1}var r=new at;return d(r,t),r.setData(t,i),r}function p(){var t,i=e.length,s=[];for(t=0;t<i;t+=1)s.push(e[t].animation);return s}function f(){a+=1,D()}function u(){a-=1}function d(t,i){t.addEventListener("destroy",o),t.addEventListener("_active",f),t.addEventListener("_idle",u),e.push({elem:i,animation:t}),s+=1}function m(t){var e=new at;return d(e,null),e.setParams(t),e}function c(t,i){var a;for(a=0;a<s;a+=1)e[a].animation.setSpeed(t,i)}function g(t,i){var a;for(a=0;a<s;a+=1)e[a].animation.setDirection(t,i)}function y(t){var i;for(i=0;i<s;i+=1)e[i].animation.play(t)}function v(t){var o,h=t-i;for(o=0;o<s;o+=1)e[o].animation.advanceTime(h);i=t,a&&!n?window.requestAnimationFrame(v):r=!0}function b(t){i=t,window.requestAnimationFrame(v)}function _(t){var i;for(i=0;i<s;i+=1)e[i].animation.pause(t)}function k(t,i,a){var r;for(r=0;r<s;r+=1)e[r].animation.goToAndStop(t,i,a)}function P(t){var i;for(i=0;i<s;i+=1)e[i].animation.stop(t)}function A(t){var i;for(i=0;i<s;i+=1)e[i].animation.togglePause(t)}function S(t){var i;for(i=s-1;i>=0;i-=1)e[i].animation.destroy(t)}function w(t,e,i){var s,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(s=0;s<r;s+=1)i&&a[s].setAttribute("data-bm-type",i),h(a[s],t);if(e&&0===r){i||(i="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=l("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),n.appendChild(o),h(o,t)}}function x(){var t;for(t=0;t<s;t+=1)e[t].animation.resize()}function D(){!n&&a&&r&&(window.requestAnimationFrame(b),r=!1)}function C(){n=!0}function M(){n=!1,D()}function F(t,i){var a;for(a=0;a<s;a+=1)e[a].animation.setVolume(t,i)}function T(t){var i;for(i=0;i<s;i+=1)e[i].animation.mute(t)}function E(t){var i;for(i=0;i<s;i+=1)e[i].animation.unmute(t)}return t.registerAnimation=h,t.loadAnimation=m,t.setSpeed=c,t.setDirection=g,t.play=y,t.pause=_,t.stop=P,t.togglePause=A,t.searchAnimations=w,t.resize=x,t.goToAndStop=k,t.destroy=S,t.freeze=C,t.unfreeze=M,t.setVolume=F,t.mute=T,t.unmute=E,t.getRegisteredAnimations=p,t}(),nt=function(){var t={getBezierEasing:function(t,i,s,a,r){var n=r||("bez_"+t+"_"+i+"_"+s+"_"+a).replace(/\./g,"p");if(e[n])return e[n];var o=new y([t,i,s,a]);return e[n]=o,o}};t.getBezierEasing=i;var e={};function i(t,i,s,a,r){var n=r||("bez_"+t+"_"+i+"_"+s+"_"+a).replace(/\./g,"p");if(e[n])return e[n];var o=new y([t,i,s,a]);return e[n]=o,o}var s=4,a=.001,r=1e-7,n=10,o=11,h=1/(o-1),l="function"==typeof Float32Array;function p(t,e){return 1-3*e+3*t}function f(t,e){return 3*e-6*t}function u(t){return 3*t}function d(t,e,i){return((p(e,i)*t+f(e,i))*t+u(e))*t}function m(t,e,i){return 3*p(e,i)*t*t+2*f(e,i)*t+u(e)}function c(t,e,i,s,a){var o,h,l=0;do{(o=d(h=e+(i-e)/2,s,a)-t)>0?i=h:e=h}while(Math.abs(o)>r&&++l<n);return h}function g(t,e,i,a){for(var r=0;r<s;++r){var n=m(e,i,a);if(0===n)return e;e-=(d(e,i,a)-t)/n}return e}function y(t){this._p=t,this._mSampleValues=l?new Float32Array(o):new Array(o),this._precomputed=!1,this.get=this.get.bind(this)}return y.prototype={get:function(t){var e=this._p[0],i=this._p[1],s=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===i&&s===a?t:0===t?0:1===t?1:d(this._getTForX(t),i,a)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],s=this._p[3];this._precomputed=!0,t===e&&i===s||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<o;++i)this._mSampleValues[i]=d(i*h,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],s=this._mSampleValues,r=0,n=1,l=o-1;n!==l&&s[n]<=t;++n)r+=h;var p=r+(t-s[--n])/(s[n+1]-s[n])*h,f=m(p,e,i);return f>=a?g(t,p,e,i):0===f?p:c(t,r,r+h,e,i)}},t}(),ot=function(){function t(t){return t.concat(m(t.length))}return{double:t}}(),ht=function(t,e,i){var s=0,a=t,r=m(a);function n(){return s?r[s-=1]:e()}function o(t){s===a&&(r=ot.double(r),a*=2),i&&i(t),r[s]=t,s+=1}return{newElement:n,release:o}},lt=function(){function t(){return{addedLength:0,percents:d("float32",X()),lengths:d("float32",X())}}return ht(8,t)}(),pt=function(){function t(){return{lengths:[],totalLength:0}}function e(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)lt.release(t.lengths[e]);t.lengths.length=0}return ht(8,t,e)}();function ft(){var t=Math;function e(t,e,i,s,a,r){var n=t*s+e*a+i*r-a*s-r*t-i*e;return n>-.001&&n<.001}function i(i,s,a,r,n,o,h,l,p){if(0===a&&0===o&&0===p)return e(i,s,r,n,h,l);var f,u=t.sqrt(t.pow(r-i,2)+t.pow(n-s,2)+t.pow(o-a,2)),d=t.sqrt(t.pow(h-i,2)+t.pow(l-s,2)+t.pow(p-a,2)),m=t.sqrt(t.pow(h-r,2)+t.pow(l-n,2)+t.pow(p-o,2));return(f=u>d?u>m?u-d-m:m-d-u:m>d?m-d-u:d-u-m)>-1e-4&&f<1e-4}var s=function(t,e,i,s){var a,r,n,o,h,l,p=X(),f=0,u=[],d=[],m=lt.newElement();for(n=i.length,a=0;a<p;a+=1){for(h=a/(p-1),l=0,r=0;r<n;r+=1)o=b(1-h,3)*t[r]+3*b(1-h,2)*h*i[r]+3*(1-h)*b(h,2)*s[r]+b(h,3)*e[r],u[r]=o,null!==d[r]&&(l+=b(u[r]-d[r],2)),d[r]=u[r];l&&(f+=l=_(l)),m.percents[a]=h,m.lengths[a]=f}return m.addedLength=f,m};function a(t){var e,i=pt.newElement(),a=t.c,r=t.v,n=t.o,o=t.i,h=t._length,l=i.lengths,p=0;for(e=0;e<h-1;e+=1)l[e]=s(r[e],r[e+1],n[e],o[e+1]),p+=l[e].addedLength;return a&&h&&(l[e]=s(r[e],r[0],n[e],o[0]),p+=l[e].addedLength),i.totalLength=p,i}function r(t){this.segmentLength=0,this.points=new Array(t)}function n(t,e){this.partialLength=t,this.point=e}var o,h=(o={},function(t,i,s,a){var h=(t[0]+"_"+t[1]+"_"+i[0]+"_"+i[1]+"_"+s[0]+"_"+s[1]+"_"+a[0]+"_"+a[1]).replace(/\./g,"p");if(!o[h]){var l,p,f,u,d,c,g,y=X(),v=0,k=null;2===t.length&&(t[0]!==i[0]||t[1]!==i[1])&&e(t[0],t[1],i[0],i[1],t[0]+s[0],t[1]+s[1])&&e(t[0],t[1],i[0],i[1],i[0]+a[0],i[1]+a[1])&&(y=2);var P=new r(y);for(f=s.length,l=0;l<y;l+=1){for(g=m(f),d=l/(y-1),c=0,p=0;p<f;p+=1)u=b(1-d,3)*t[p]+3*b(1-d,2)*d*(t[p]+s[p])+3*(1-d)*b(d,2)*(i[p]+a[p])+b(d,3)*i[p],g[p]=u,null!==k&&(c+=b(g[p]-k[p],2));v+=c=_(c),P.points[l]=new n(c,g),k=g}P.segmentLength=v,o[h]=P}return o[h]});function l(t,e){var i=e.percents,s=e.lengths,a=i.length,r=k((a-1)*t),n=t*e.addedLength,o=0;if(r===a-1||0===r||n===s[r])return i[r];for(var h=s[r]>n?-1:1,l=!0;l;)if(s[r]<=n&&s[r+1]>n?(o=(n-s[r])/(s[r+1]-s[r]),l=!1):r+=h,r<0||r>=a-1){if(r===a-1)return i[r];l=!1}return i[r]+(i[r+1]-i[r])*o}function p(e,i,s,a,r,n){var o=l(r,n),h=1-o;return[t.round(1e3*(h*h*h*e[0]+(o*h*h+h*o*h+h*h*o)*s[0]+(o*o*h+h*o*o+o*h*o)*a[0]+o*o*o*i[0]))/1e3,t.round(1e3*(h*h*h*e[1]+(o*h*h+h*o*h+h*h*o)*s[1]+(o*o*h+h*o*o+o*h*o)*a[1]+o*o*o*i[1]))/1e3]}var f=d("float32",8);function u(e,i,s,a,r,n,o){r<0?r=0:r>1&&(r=1);var h,p=l(r,o),u=l(n=n>1?1:n,o),d=e.length,m=1-p,c=1-u,g=m*m*m,y=p*m*m*3,v=p*p*m*3,b=p*p*p,_=m*m*c,k=p*m*c+m*p*c+m*m*u,P=p*p*c+m*p*u+p*m*u,A=p*p*u,S=m*c*c,w=p*c*c+m*u*c+m*c*u,x=p*u*c+m*u*u+p*c*u,D=p*u*u,C=c*c*c,M=u*c*c+c*u*c+c*c*u,F=u*u*c+c*u*u+u*c*u,T=u*u*u;for(h=0;h<d;h+=1)f[4*h]=t.round(1e3*(g*e[h]+y*s[h]+v*a[h]+b*i[h]))/1e3,f[4*h+1]=t.round(1e3*(_*e[h]+k*s[h]+P*a[h]+A*i[h]))/1e3,f[4*h+2]=t.round(1e3*(S*e[h]+w*s[h]+x*a[h]+D*i[h]))/1e3,f[4*h+3]=t.round(1e3*(C*e[h]+M*s[h]+F*a[h]+T*i[h]))/1e3;return f}return{getSegmentsLength:a,getNewSegment:u,getPointInSegment:p,buildBezierData:h,pointOnLine2D:e,pointOnLine3D:i}}var ut=ft(),dt=function(){var t=a,e=Math.abs;function i(t,e){var i,a=this.offsetTime;"multidimensional"===this.propType&&(i=d("float32",this.pv.length));for(var o,h,l,p,f,u,m,c,g,y=e.lastIndex,v=y,b=this.keyframes.length-1,_=!0;_;){if(o=this.keyframes[v],h=this.keyframes[v+1],v===b-1&&t>=h.t-a){o.h&&(o=h),y=0;break}if(h.t-a>t){y=v;break}v<b-1?v+=1:(y=0,_=!1)}l=this.keyframesMetadata[v]||{};var k,P=h.t-a,A=o.t-a;if(o.to){l.bezierData||(l.bezierData=ut.buildBezierData(o.s,h.s||o.e,o.to,o.ti));var S=l.bezierData;if(t>=P||t<A){var w=t>=P?S.points.length-1:0;for(f=S.points[w].point.length,p=0;p<f;p+=1)i[p]=S.points[w].point[p]}else{l.__fnct?g=l.__fnct:(g=nt.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n).get,l.__fnct=g),u=g((t-A)/(P-A));var x,D=S.segmentLength*u,C=e.lastFrame<t&&e._lastKeyframeIndex===v?e._lastAddedLength:0;for(c=e.lastFrame<t&&e._lastKeyframeIndex===v?e._lastPoint:0,_=!0,m=S.points.length;_;){if(C+=S.points[c].partialLength,0===D||0===u||c===S.points.length-1){for(f=S.points[c].point.length,p=0;p<f;p+=1)i[p]=S.points[c].point[p];break}if(D>=C&&D<C+S.points[c+1].partialLength){for(x=(D-C)/S.points[c+1].partialLength,f=S.points[c].point.length,p=0;p<f;p+=1)i[p]=S.points[c].point[p]+(S.points[c+1].point[p]-S.points[c].point[p])*x;break}c<m-1?c+=1:_=!1}e._lastPoint=c,e._lastAddedLength=C-S.points[c].partialLength,e._lastKeyframeIndex=v}}else{var M,F,T,E,I;if(b=o.s.length,k=h.s||o.e,this.sh&&1!==o.h)t>=P?(i[0]=k[0],i[1]=k[1],i[2]=k[2]):t<=A?(i[0]=o.s[0],i[1]=o.s[1],i[2]=o.s[2]):r(i,s(n(o.s),n(k),(t-A)/(P-A)));else for(v=0;v<b;v+=1)1!==o.h&&(t>=P?u=1:t<A?u=0:(o.o.x.constructor===Array?(l.__fnct||(l.__fnct=[]),l.__fnct[v]?g=l.__fnct[v]:(M=void 0===o.o.x[v]?o.o.x[0]:o.o.x[v],F=void 0===o.o.y[v]?o.o.y[0]:o.o.y[v],T=void 0===o.i.x[v]?o.i.x[0]:o.i.x[v],E=void 0===o.i.y[v]?o.i.y[0]:o.i.y[v],g=nt.getBezierEasing(M,F,T,E).get,l.__fnct[v]=g)):l.__fnct?g=l.__fnct:(M=o.o.x,F=o.o.y,T=o.i.x,E=o.i.y,g=nt.getBezierEasing(M,F,T,E).get,o.keyframeMetadata=g),u=g((t-A)/(P-A)))),k=h.s||o.e,I=1===o.h?o.s[v]:o.s[v]+(k[v]-o.s[v])*u,"multidimensional"===this.propType?i[v]=I:i=I}return e.lastIndex=y,i}function s(t,e,i){var s,a,r,n,o,h=[],l=t[0],p=t[1],f=t[2],u=t[3],d=e[0],m=e[1],c=e[2],g=e[3];return(a=l*d+p*m+f*c+u*g)<0&&(a=-a,d=-d,m=-m,c=-c,g=-g),1-a>1e-6?(s=Math.acos(a),r=Math.sin(s),n=Math.sin((1-i)*s)/r,o=Math.sin(i*s)/r):(n=1-i,o=i),h[0]=n*l+o*d,h[1]=n*p+o*m,h[2]=n*f+o*c,h[3]=n*u+o*g,h}function r(t,e){var i=e[0],s=e[1],a=e[2],r=e[3],n=Math.atan2(2*s*r-2*i*a,1-2*s*s-2*a*a),o=Math.asin(2*i*s+2*a*r),h=Math.atan2(2*i*r-2*s*a,1-2*i*i-2*a*a);t[0]=n/S,t[1]=o/S,t[2]=h/S}function n(t){var e=t[0]*S,i=t[1]*S,s=t[2]*S,a=Math.cos(e/2),r=Math.cos(i/2),n=Math.cos(s/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(s/2);return[o*h*n+a*r*l,o*r*n+a*h*l,a*h*n-o*r*l,a*r*n-o*h*l]}function o(){var e=this.comp.renderedFrame-this.offsetTime,i=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==t&&(this._caching.lastFrame>=s&&e>=s||this._caching.lastFrame<i&&e<i))){this._caching.lastFrame>=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var a=this.interpolateValue(e,this._caching);this.pv=a}return this._caching.lastFrame=e,this.pv}function h(t){var i;if("unidimensional"===this.propType)i=t*this.mult,e(this.v-i)>1e-5&&(this.v=i,this._mdf=!0);else for(var s=0,a=this.v.length;s<a;)i=t[s]*this.mult,e(this.v[s]-i)>1e-5&&(this.v[s]=i,this._mdf=!0),s+=1}function l(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var 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 p(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function f(t,e,i,s){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=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=l,this.setVValue=h,this.addEffect=p}function u(t,e,i,s){var a;this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r=e.k.length;for(this.v=d("float32",r),this.pv=d("float32",r),this.vel=d("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=l,this.setVValue=h,this.addEffect=p}function m(e,s,a,r){this.propType="unidimensional",this.keyframes=s.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:t,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=s,this.mult=a||1,this.elem=e,this.container=r,this.comp=e.comp,this.v=t,this.pv=t,this._isFirstFrame=!0,this.getValue=l,this.setVValue=h,this.interpolateValue=i,this.effectsSequence=[o.bind(this)],this.addEffect=p}function c(e,s,a,r){var n;this.propType="multidimensional";var f,u,m,c,g=s.k.length;for(n=0;n<g-1;n+=1)s.k[n].to&&s.k[n].s&&s.k[n+1]&&s.k[n+1].s&&(f=s.k[n].s,u=s.k[n+1].s,m=s.k[n].to,c=s.k[n].ti,(2===f.length&&(f[0]!==u[0]||f[1]!==u[1])&&ut.pointOnLine2D(f[0],f[1],u[0],u[1],f[0]+m[0],f[1]+m[1])&&ut.pointOnLine2D(f[0],f[1],u[0],u[1],u[0]+c[0],u[1]+c[1])||3===f.length&&(f[0]!==u[0]||f[1]!==u[1]||f[2]!==u[2])&&ut.pointOnLine3D(f[0],f[1],f[2],u[0],u[1],u[2],f[0]+m[0],f[1]+m[1],f[2]+m[2])&&ut.pointOnLine3D(f[0],f[1],f[2],u[0],u[1],u[2],u[0]+c[0],u[1]+c[1],u[2]+c[2]))&&(s.k[n].to=null,s.k[n].ti=null),f[0]===u[0]&&f[1]===u[1]&&0===m[0]&&0===m[1]&&0===c[0]&&0===c[1]&&(2===f.length||f[2]===u[2]&&0===m[2]&&0===c[2])&&(s.k[n].to=null,s.k[n].ti=null));this.effectsSequence=[o.bind(this)],this.data=s,this.keyframes=s.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=a||1,this.elem=e,this.container=r,this.comp=e.comp,this.getValue=l,this.setVValue=h,this.interpolateValue=i,this.frameId=-1;var y=s.k[0].s.length;for(this.v=d("float32",y),this.pv=d("float32",y),n=0;n<y;n+=1)this.v[n]=t,this.pv[n]=t;this._caching={lastFrame:t,lastIndex:0,value:d("float32",y)},this.addEffect=p}function g(t,e,i,s,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new u(t,e,s,a);else switch(i){case 0:r=new m(t,e,s,a);break;case 1:r=new c(t,e,s,a)}else r=new f(t,e,s,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}return{getProp:g}}();function mt(){}mt.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var 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 ct=function(){function t(){return d("float32",2)}return ht(8,t)}();function gt(){this.c=!1,this._length=0,this._maxLength=8,this.v=m(this._maxLength),this.o=m(this._maxLength),this.i=m(this._maxLength)}gt.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=ct.newElement(),this.o[i]=ct.newElement(),this.i[i]=ct.newElement(),i+=1},gt.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},gt.prototype.doubleArrayLength=function(){this.v=this.v.concat(m(this._maxLength)),this.i=this.i.concat(m(this._maxLength)),this.o=this.o.concat(m(this._maxLength)),this._maxLength*=2},gt.prototype.setXYAt=function(t,e,i,s,a){var r;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[]}(!r[s]||r[s]&&!a)&&(r[s]=ct.newElement()),r[s][0]=t,r[s][1]=e},gt.prototype.setTripleAt=function(t,e,i,s,a,r,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,s,"o",n,o),this.setXYAt(a,r,"i",n,o)},gt.prototype.reverse=function(){var t=new gt;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),a=1);var r,n=this._length-1,o=this._length;for(r=a;r<o;r+=1)t.setTripleAt(e[n][0],e[n][1],s[n][0],s[n][1],i[n][0],i[n][1],r,!1),n-=1;return t},gt.prototype.length=function(){return this._length};var yt=function(){function t(){return new gt}function e(t){var e,i=t._length;for(e=0;e<i;e+=1)ct.release(t.v[e]),ct.release(t.i[e]),ct.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}function i(t){var e,i=s.newElement(),a=void 0===t._length?t.v.length:t._length;for(i.setLength(a),i.c=t.c,e=0;e<a;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i}var s=ht(4,t,e);return s.clone=i,s}();function vt(){this._length=0,this._maxLength=4,this.shapes=m(this._maxLength)}vt.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(m(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},vt.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)yt.release(this.shapes[t]);this._length=0};var bt=function(){var t={newShapeCollection:a,release:r},e=0,i=4,s=m(i);function a(){return e?s[e-=1]:new vt}function r(t){var a,r=t._length;for(a=0;a<r;a+=1)yt.release(t.shapes[a]);t._length=0,e===i&&(s=ot.double(s),i*=2),s[e]=t,e+=1}return t}(),_t=function(){var t=-999999;function e(t,e,i){var s,a,r,n,o,h,l,p,f,u=i.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)s=d[0].s[0],r=!0,u=0;else if(t>=d[d.length-1].t-this.offsetTime)s=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var m,c,g,y=u,v=d.length-1,b=!0;b&&(m=d[y],!((c=d[y+1]).t-this.offsetTime>t));)y<v-1?y+=1:b=!1;if(g=this.keyframesMetadata[y]||{},u=y,!(r=1===m.h)){if(t>=c.t-this.offsetTime)p=1;else if(t<m.t-this.offsetTime)p=0;else{var _;g.__fnct?_=g.__fnct:(_=nt.getBezierEasing(m.o.x,m.o.y,m.i.x,m.i.y).get,g.__fnct=_),p=_((t-(m.t-this.offsetTime))/(c.t-this.offsetTime-(m.t-this.offsetTime)))}a=c.s?c.s[0]:m.e[0]}s=m.s[0]}for(h=e._length,l=s.i[0].length,i.lastIndex=u,n=0;n<h;n+=1)for(o=0;o<l;o+=1)f=r?s.i[n][o]:s.i[n][o]+(a.i[n][o]-s.i[n][o])*p,e.i[n][o]=f,f=r?s.o[n][o]:s.o[n][o]+(a.o[n][o]-s.o[n][o])*p,e.o[n][o]=f,f=r?s.v[n][o]:s.v[n][o]+(a.v[n][o]-s.v[n][o])*p,e.v[n][o]=f}function i(){var e=this.comp.renderedFrame-this.offsetTime,i=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,a=this._caching.lastFrame;return a!==t&&(a<i&&e<i||a>s&&e>s)||(this._caching.lastIndex=a<e?this._caching.lastIndex:0,this.interpolateShape(e,this.pv,this._caching)),this._caching.lastFrame=e,this.pv}function s(){this.paths=this.localShapeCollection}function a(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,s=t._length;for(i=0;i<s;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0}function r(t){a(this.v,t)||(this.v=yt.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function n(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var i=this.effectsSequence.length;for(e=0;e<i;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function o(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var a=3===i?e.pt.k:e.ks.k;this.v=yt.clone(a),this.pv=yt.clone(this.v),this.localShapeCollection=bt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=s,this.effectsSequence=[]}function h(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function l(e,a,r){this.propType="shape",this.comp=e.comp,this.elem=e,this.container=e,this.off