lottie.js 268 KB

1
  1. "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var defaultCurveSegments=200;function rafFactory(){var r=Date.now(),a=1e3/60;return function(t){var e=Date.now(),i=Math.min(1e3/24,Math.max(a,e-r+a)),s=setTimeout(function(){t(e+i)},i);return r=e+i,s}}var raf=rafFactory();function createSizedArray(t){return Array.apply(null,{length:t})}function createTypedArray(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):null}function createTag(t){var e={};switch(t){case"canvas":return e.getContext=function(){},e;default:return e}}function randomString(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var i=void 0,s="";for(i=t;0<i;--i)s+=e[Math.round(Math.random()*(e.length-1))];return s}var subframeEnabled=!0;function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function getEnvObj(){return"undefined"!=typeof wx&&"getSystemInfo"in wx&&"function"==typeof wx.getSystemInfo?wx:"undefined"!=typeof my&&"function"==typeof my.getSystemInfo?my:"undefined"!=typeof swan&&"function"==typeof swan.getSystemInfo?swan:"undefined"!=typeof qq&&"function"==typeof qq.getSystemInfo?qq:"undefined"!=typeof tt&&"function"==typeof tt.getSystemInfo?tt:void console.log("in uni")}var _typeof="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},classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function s(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),t}}(),_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},get=function t(e,i,s){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,s)}if("value"in r)return r.value;var n=r.get;return void 0!==n?n.call(s):void 0},inherits=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},possibleConstructorReturn=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},slicedToArray=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],s=!0,r=!1,a=void 0;try{for(var n,o=t[Symbol.iterator]();!(s=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){r=!0,a=t}finally{try{!s&&o.return&&o.return()}finally{if(r)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},ALI_OBJ=getEnvObj(),handleSuccess=function(t,e,i){var s=1<arguments.length&&void 0!==e?e:noop,r=i;if(t.success){var a=r,n=t.success;t.success=function(t){var e=s(t)||t;n.call(a,e)}}};function noop(){}var wxToAliApi={request:function(t){var e=changeOpts(0<arguments.length&&void 0!==t?t:{},{header:"headers"});return handleSuccess(e,function(t){return changeOpts(t,{headers:"header",status:"statusCode"})}),ALI_OBJ.canIUse("request")?ALI_OBJ.request(e):ALI_OBJ.httpRequest(e)},downloadFile:function(t){var e=changeOpts(0<arguments.length&&void 0!==t?t:{});return handleSuccess(e,function(t){return changeOpts(t,{apFilePath:"tempFilePath"})}),ALI_OBJ.downloadFile(e)}};function changeOpts(i){var s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r={};return Object.keys(i).forEach(function(t){var e=Object.prototype.hasOwnProperty.call(s,t)?s[t]:t;""!==e&&(r[e]=i[t])}),r=_extends({},r,t)}var api=_extends({},getEnvObj());function getUserDataPath(){try{return api.env.USER_DATA_PATH}catch(t){return console.warn("getUserDataPath error"),"/USER_DATA_PATH"}}if(api.getFileSystemManager||(api.getFileSystemManager=function(){console.warn("当前小程序不支持 getFileSystemManager")}),!api.base64ToArrayBuffer){for(var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup=new Uint8Array(256),i=0;i<chars.length;i++)lookup[chars.charCodeAt(i)]=i;api.base64ToArrayBuffer=function(t){var e=.75*t.length,i=t.length,s=void 0,r=0,a=void 0,n=void 0,o=void 0,h=void 0;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);var p=new ArrayBuffer(e),l=new Uint8Array(p);for(s=0;s<i;s+=4)a=lookup[t.charCodeAt(s)],n=lookup[t.charCodeAt(s+1)],o=lookup[t.charCodeAt(s+2)],h=lookup[t.charCodeAt(s+3)],l[r++]=a<<2|n>>4,l[r++]=(15&n)<<4|o>>2,l[r++]=(3&o)<<6|63&h;return p}}api.ap&&Object.keys(wxToAliApi).forEach(function(t){api[t]=wxToAliApi[t]});var _cos=Math.cos,_sin=Math.sin,_tan=Math.tan,_rnd=Math.round,Matrix=function(){function t(){classCallCheck(this,t),this._identity=!0,this._identityCalculated=!1,this.props=new Float32Array(16),this.reset()}return createClass(t,[{key:"reset",value:function(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}},{key:"rotate",value:function(t){if(0===t)return this;var e=_cos(t),i=_sin(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}},{key:"rotateX",value:function(t){if(0===t)return this;var e=_cos(t),i=_sin(t);return this._t(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1)}},{key:"rotateY",value:function(t){if(0===t)return this;var e=_cos(t),i=_sin(t);return this._t(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1)}},{key:"rotateZ",value:function(t){if(0===t)return this;var e=_cos(t),i=_sin(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}},{key:"shear",value:function(t,e){return this._t(1,e,t,1,0,0)}},{key:"skew",value:function(t,e){return this.shear(_tan(t),_tan(e))}},{key:"skewFromAxis",value:function(t,e){var i=_cos(e),s=_sin(e);return this._t(i,s,0,0,-s,i,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,_tan(t),1,0,0,0,0,1,0,0,0,0,1)._t(i,-s,0,0,s,i,0,0,0,0,1,0,0,0,0,1)}},{key:"scale",value:function(t,e,i){return i=isNaN(i)?1:i,1===t&&1===e&&1===i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}},{key:"setTransform",value:function(t,e,i,s,r,a,n,o,h,p,l,c,u,f,d,m){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=s,this.props[4]=r,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=p,this.props[10]=l,this.props[11]=c,this.props[12]=u,this.props[13]=f,this.props[14]=d,this.props[15]=m,this}},{key:"translate",value:function(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}},{key:"transform",value:function(t,e,i,s,r,a,n,o,h,p,l,c,u,f,d,m){var y=this.props;if(1===t&&0===e&&0===i&&0===s&&0===r&&1===a&&0===n&&0===o&&0===h&&0===p&&1===l&&0===c)return y[12]=y[12]*t+y[15]*u,y[13]=y[13]*a+y[15]*f,y[14]=y[14]*l+y[15]*d,y[15]*=m,this._identityCalculated=!1,this;var v=y[0],g=y[1],k=y[2],x=y[3],b=y[4],P=y[5],_=y[6],C=y[7],S=y[8],T=y[9],E=y[10],A=y[11],w=y[12],I=y[13],D=y[14],F=y[15];return y[0]=v*t+g*r+k*h+x*u,y[1]=v*e+g*a+k*p+x*f,y[2]=v*i+g*n+k*l+x*d,y[3]=v*s+g*o+k*c+x*m,y[4]=b*t+P*r+_*h+C*u,y[5]=b*e+P*a+_*p+C*f,y[6]=b*i+P*n+_*l+C*d,y[7]=b*s+P*o+_*c+C*m,y[8]=S*t+T*r+E*h+A*u,y[9]=S*e+T*a+E*p+A*f,y[10]=S*i+T*n+E*l+A*d,y[11]=S*s+T*o+E*c+A*m,y[12]=w*t+I*r+D*h+F*u,y[13]=w*e+I*a+D*p+F*f,y[14]=w*i+I*n+D*l+F*d,y[15]=w*s+I*o+D*c+F*m,this._identityCalculated=!1,this}},{key:"isIdentity",value:function(){var t=this.props;return this._identityCalculated||(this._identity=!(1!==t[0]||0!==t[1]||0!==t[2]||0!==t[3]||0!==t[4]||1!==t[5]||0!==t[6]||0!==t[7]||0!==t[8]||0!==t[9]||1!==t[10]||0!==t[11]||0!==t[12]||0!==t[13]||0!==t[14]||1!==t[15]),this._identityCalculated=!0),this._identity}},{key:"equals",value:function(t){for(var e=0,i=this.props;e<16;){if(t.props[e]!==i[e])return!1;e+=1}return!0}},{key:"clone",value:function(t){var e=void 0,i=this.props;for(e=0;e<16;e+=1)t.props[e]=i[e]}},{key:"cloneFromProps",value:function(t){var e=void 0;for(e=0;e<16;e+=1)this.props[e]=t[e]}},{key:"applyToPoint",value:function(t,e,i){var s=this.props;return{x:t*s[0]+e*s[4]+i*s[8]+s[12],y:t*s[1]+e*s[5]+i*s[9]+s[13],z:t*s[2]+e*s[6]+i*s[10]+s[14]}}},{key:"applyToX",value:function(t,e,i){var s=this.props;return t*s[0]+e*s[4]+i*s[8]+s[12]}},{key:"applyToY",value:function(t,e,i){var s=this.props;return t*s[1]+e*s[5]+i*s[9]+s[13]}},{key:"applyToZ",value:function(t,e,i){var s=this.props;return t*s[2]+e*s[6]+i*s[10]+s[14]}},{key:"inversePoint",value:function(t){var e=this.props,i=e[0]*e[5]-e[1]*e[4],s=e[5]/i,r=-e[1]/i,a=-e[4]/i,n=e[0]/i,o=(e[4]*e[13]-e[5]*e[12])/i,h=-(e[0]*e[13]-e[1]*e[12])/i;return[t[0]*s+t[1]*a+o,t[0]*r+t[1]*n+h,0]}},{key:"inversePoints",value:function(t){var e=void 0,i=t.length,s=[];for(e=0;e<i;e+=1)s[e]=this.inversePoint(t[e]);return s}},{key:"applyToTriplePoints",value:function(t,e,i){var s=createTypedArray("float32",6);if(this.isIdentity())s[0]=t[0],s[1]=t[1],s[2]=e[0],s[3]=e[1],s[4]=i[0],s[5]=i[1];else{var r=this.props,a=r[0],n=r[1],o=r[4],h=r[5],p=r[12],l=r[13];s[0]=t[0]*a+t[1]*o+p,s[1]=t[0]*n+t[1]*h+l,s[2]=e[0]*a+e[1]*o+p,s[3]=e[0]*n+e[1]*h+l,s[4]=i[0]*a+i[1]*o+p,s[5]=i[0]*n+i[1]*h+l}return s}},{key:"applyToPointArray",value:function(t,e,i){var s=void 0;if(this.isIdentity())s=[t,e,i];else{var r=this.props;s=[t*r[0]+e*r[4]+i*r[8]+r[12],t*r[1]+e*r[5]+i*r[9]+r[13],t*r[2]+e*r[6]+i*r[10]+r[14]]}return s}},{key:"applyToPointStringified",value:function(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}},{key:"toCSS",value:function(){for(var t=0,e=this.props,i="matrix3d(";t<16;)i+=_rnd(1e4*e[t])/1e4,i+=15===t?")":",",t+=1;return i}},{key:"roundMatrixProperty",value:function(t){return t<1e-6&&0<t||-1e-6<t&&t<0?_rnd(1e4*t)/1e4:t}},{key:"to2dCSS",value:function(){var t=this.props,e=this.roundMatrixProperty;return"matrix("+e(t[0])+","+e(t[1])+","+e(t[4])+","+e(t[5])+","+e(t[12])+","+e(t[13])+")"}},{key:"_t",value:function(){return this.transform.apply(this,arguments)}}]),t}();function Mixin(t){for(var e=arguments.length,a=Array(1<e?e-1:0),i=1;i<e;i++)a[i-1]=arguments[i];function n(e,i){Object.getOwnPropertyNames(i).forEach(function(t){try{t.match(/^(?:constructor|prototype|arguments|caller|name|bind|call|apply|toString|length)$/)||Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}catch(t){console.error(t)}})}var s=(inherits(o,t),o);function o(){var t;classCallCheck(this,o);for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];var r=possibleConstructorReturn(this,(t=o.__proto__||Object.getPrototypeOf(o)).call.apply(t,[this].concat(i)));return a.forEach(function(t){var e=new t;n(r,e)}),r}return a.forEach(function(t){for(var e=t.prototype.__proto__;e&&e.constructor!==Object;)n(s.prototype,e),e=e.__proto__;n(s.prototype,t.prototype),n(s,t)}),s}var beziers={},NEWTON_ITERATIONS=4,NEWTON_MIN_SLOPE=.001,SUBDIVISION_PRECISION=1e-7,SUBDIVISION_MAX_ITERATIONS=10,kSplineTableSize=11,kSampleStepSize=1/(kSplineTableSize-1),float32ArraySupported="function"==typeof Float32Array;function A(t,e){return 1-3*e+3*t}function B(t,e){return 3*e-6*t}function C(t){return 3*t}function calcBezier(t,e,i){return((A(e,i)*t+B(e,i))*t+C(e))*t}function getSlope(t,e,i){return 3*A(e,i)*t*t+2*B(e,i)*t+C(e)}function binarySubdivide(t,e,i,s,r){for(var a=void 0,n=void 0,o=0;0<(a=calcBezier(n=e+(i-e)/2,s,r)-t)?i=n:e=n,Math.abs(a)>SUBDIVISION_PRECISION&&++o<SUBDIVISION_MAX_ITERATIONS;);return n}function newtonRaphsonIterate(t,e,i,s){for(var r=0;r<NEWTON_ITERATIONS;++r){var a=getSlope(e,i,s);if(0==+a)return e;e-=(calcBezier(e,i,s)-t)/a}return e}function BezierEasing(t){this._p=t,this._mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize),this._precomputed=!1,this.get=this.get.bind(this)}function getBezierEasing(t,e,i,s,r){var a=r||("bez_"+t+"_"+e+"_"+i+"_"+s).replace(/\./g,"p");if(beziers[a])return beziers[a];var n=new BezierEasing([t,e,i,s]);return beziers[a]=n}BezierEasing.prototype={get:function(t){var e=this._p[0],i=this._p[1],s=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),e===i&&s===r?t:0===t?0:1===t?1:calcBezier(this._getTForX(t),i,r)},_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<kSplineTableSize;++i)this._mSampleValues[i]=calcBezier(i*kSampleStepSize,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],s=this._mSampleValues,r=0,a=1,n=kSplineTableSize-1;a!==n&&s[a]<=t;++a)r+=kSampleStepSize;var o=r+(t-s[--a])/(s[a+1]-s[a])*kSampleStepSize,h=getSlope(o,e,i);return NEWTON_MIN_SLOPE<=h?newtonRaphsonIterate(t,o,e,i):0===h?o:binarySubdivide(t,r,r+kSampleStepSize,e,i)}};var ob={};ob.getBezierEasing=getBezierEasing;var reservedWords={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords={5:ecma5AndLessKeywords,6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",nonASCIIidentifierChars="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");nonASCIIidentifierStartChars=nonASCIIidentifierChars=null;var astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239];function isInAstralSet(t,e){for(var i=65536,s=0;s<e.length;s+=2){if(t<(i+=e[s]))return!1;if(t<=(i+=e[s+1]))return!0}}function isIdentifierStart(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?170<=t&&nonASCIIidentifierStart.test(String.fromCharCode(t)):!1!==e&&isInAstralSet(t,astralIdentifierStartCodes)))}function isIdentifierChar(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?170<=t&&nonASCIIidentifier.test(String.fromCharCode(t)):!1!==e&&(isInAstralSet(t,astralIdentifierStartCodes)||isInAstralSet(t,astralIdentifierCodes)))))}var TokenType=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function binop(t,e){return new TokenType(t,{beforeExpr:!0,binop:e})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords$1={};function kw(t,e){return void 0===e&&(e={}),e.keyword=t,keywords$1[t]=new TokenType(t,e)}var types={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import"),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(t){return 10===t||13===t||8232===t||8233===t}var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref=Object.prototype,hasOwnProperty=ref.hasOwnProperty,toString=ref.toString;function has(t,e){return hasOwnProperty.call(t,e)}var isArray=Array.isArray||function(t){return"[object Array]"===toString.call(t)},Position=function(t,e){this.line=t,this.column=e};Position.prototype.offset=function(t){return new Position(this.line,this.column+t)};var SourceLocation=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function getLineInfo(t,e){for(var i=1,s=0;;){lineBreakG.lastIndex=s;var r=lineBreakG.exec(t);if(!(r&&r.index<e))return new Position(i,e-s);++i,s=r.index+r[0].length}}var defaultOptions={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}};function getOptions(t){var e={};for(var i in defaultOptions)e[i]=t&&has(t,i)?t[i]:defaultOptions[i];if(2015<=e.ecmaVersion&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),isArray(e.onToken)){var s=e.onToken;e.onToken=function(t){return s.push(t)}}return isArray(e.onComment)&&(e.onComment=pushComment(e,e.onComment)),e}function pushComment(o,h){return function(t,e,i,s,r,a){var n={type:t?"Block":"Line",value:e,start:i,end:s};o.locations&&(n.loc=new SourceLocation(this,r,a)),o.ranges&&(n.range=[i,s]),h.push(n)}}var plugins={};function keywordRegexp(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Parser=function(t,e,i){this.options=t=getOptions(t),this.sourceFile=t.sourceFile,this.keywords=keywordRegexp(keywords[6<=t.ecmaVersion?6:5]);var s="";if(!t.allowReserved){for(var r=t.ecmaVersion;!(s=reservedWords[r]);r--);"module"==t.sourceType&&(s+=" await")}this.reservedWords=keywordRegexp(s);var a=(s?s+" ":"")+reservedWords.strict;this.reservedWordsStrict=keywordRegexp(a),this.reservedWordsStrictBind=keywordRegexp(a+" "+reservedWords.strictBind),this.input=String(e),this.containsEsc=!1,this.loadPlugins(t.plugins),i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope()};Parser.prototype.isKeyword=function(t){return this.keywords.test(t)},Parser.prototype.isReservedWord=function(t){return this.reservedWords.test(t)},Parser.prototype.extend=function(t,e){this[t]=e(this[t])},Parser.prototype.loadPlugins=function(t){for(var e in t){var i=plugins[e];if(!i)throw new Error("Plugin '"+e+"' not found");i(this,t[e])}},Parser.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};var pp=Parser.prototype,literal=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;function DestructuringErrors(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}pp.strictDirective=function(t){for(;;){skipWhiteSpace.lastIndex=t,t+=skipWhiteSpace.exec(this.input)[0].length;var e=literal.exec(this.input.slice(t));if(!e)return!1;if("use strict"==(e[1]||e[2]))return!0;t+=e[0].length}},pp.eat=function(t){return this.type===t&&(this.next(),!0)},pp.isContextual=function(t){return this.type===types.name&&this.value===t&&!this.containsEsc},pp.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},pp.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},pp.canInsertSemicolon=function(){return this.type===types.eof||this.type===types.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp.semicolon=function(){this.eat(types.semi)||this.insertSemicolon()||this.unexpected()},pp.afterTrailingComma=function(t,e){if(this.type==t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},pp.expect=function(t){this.eat(t)||this.unexpected()},pp.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},pp.checkPatternErrors=function(t,e){if(t){-1<t.trailingComma&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;-1<i&&this.raiseRecoverable(i,"Parenthesized pattern")}},pp.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return 0<=i||0<=s;0<=i&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),0<=s&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},pp.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},pp.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};var pp$1=Parser.prototype;pp$1.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==types.eof;){var i=this.parseStatement(!0,!0,e);t.body.push(i)}return this.adaptDirectivePrologue(t.body),this.next(),6<=this.options.ecmaVersion&&(t.sourceType=this.options.sourceType),this.finishNode(t,"Program")};var loopLabel={kind:"loop"},switchLabel={kind:"switch"};pp$1.isLet=function(){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;skipWhiteSpace.lastIndex=this.pos;var t=skipWhiteSpace.exec(this.input),e=this.pos+t[0].length,i=this.input.charCodeAt(e);if(91===i||123==i)return!0;if(isIdentifierStart(i,!0)){for(var s=e+1;isIdentifierChar(this.input.charCodeAt(s),!0);)++s;var r=this.input.slice(e,s);if(!keywordRelationalOperator.test(r))return!0}return!1},pp$1.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;skipWhiteSpace.lastIndex=this.pos;var t=skipWhiteSpace.exec(this.input),e=this.pos+t[0].length;return!(lineBreak.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!=this.input.length&&isIdentifierChar(this.input.charAt(e+8)))},pp$1.parseStatement=function(t,e,i){var s,r=this.type,a=this.startNode();switch(this.isLet()&&(r=types._var,s="let"),r){case types._break:case types._continue:return this.parseBreakContinueStatement(a,r.keyword);case types._debugger:return this.parseDebuggerStatement(a);case types._do:return this.parseDoStatement(a);case types._for:return this.parseForStatement(a);case types._function:return!t&&6<=this.options.ecmaVersion&&this.unexpected(),this.parseFunctionStatement(a,!1);case types._class:return t||this.unexpected(),this.parseClass(a,!0);case types._if:return this.parseIfStatement(a);case types._return:return this.parseReturnStatement(a);case types._switch:return this.parseSwitchStatement(a);case types._throw:return this.parseThrowStatement(a);case types._try:return this.parseTryStatement(a);case types._const:case types._var:return s=s||this.value,t||"var"==s||this.unexpected(),this.parseVarStatement(a,s);case types._while:return this.parseWhileStatement(a);case types._with:return this.parseWithStatement(a);case types.braceL:return this.parseBlock();case types.semi:return this.parseEmptyStatement(a);case types._export:case types._import:return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===types._import?this.parseImport(a):this.parseExport(a,i);default:if(this.isAsyncFunction())return t||this.unexpected(),this.next(),this.parseFunctionStatement(a,!0);var n=this.value,o=this.parseExpression();return r===types.name&&"Identifier"===o.type&&this.eat(types.colon)?this.parseLabeledStatement(a,n,o):this.parseExpressionStatement(a,o)}},pp$1.parseBreakContinueStatement=function(t,e){var i="break"==e;this.next(),this.eat(types.semi)||this.insertSemicolon()?t.label=null:this.type!==types.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s<this.labels.length;++s){var r=this.labels[s];if(null==t.label||r.name===t.label.name){if(null!=r.kind&&(i||"loop"===r.kind))break;if(t.label&&i)break}}return s===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},pp$1.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},pp$1.parseDoStatement=function(t){return this.next(),this.labels.push(loopLabel),t.body=this.parseStatement(!1),this.labels.pop(),this.expect(types._while),t.test=this.parseParenExpression(),6<=this.options.ecmaVersion?this.eat(types.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},pp$1.parseForStatement=function(t){this.next();var e=9<=this.options.ecmaVersion&&this.inAsync&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel),this.enterLexicalScope(),this.expect(types.parenL),this.type===types.semi)return-1<e&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===types._var||this.type===types._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),!(this.type===types._in||6<=this.options.ecmaVersion&&this.isContextual("of"))||1!==s.declarations.length||"var"!==r&&s.declarations[0].init?(-1<e&&this.unexpected(e),this.parseFor(t,s)):(9<=this.options.ecmaVersion&&(this.type===types._in?-1<e&&this.unexpected(e):t.await=-1<e),this.parseForIn(t,s))}var a=new DestructuringErrors,n=this.parseExpression(!0,a);return this.type===types._in||6<=this.options.ecmaVersion&&this.isContextual("of")?(9<=this.options.ecmaVersion&&(this.type===types._in?-1<e&&this.unexpected(e):t.await=-1<e),this.toAssignable(n,!1,a),this.checkLVal(n),this.parseForIn(t,n)):(this.checkExpressionErrors(a,!0),-1<e&&this.unexpected(e),this.parseFor(t,n))},pp$1.parseFunctionStatement=function(t,e){return this.next(),this.parseFunction(t,!0,!1,e)},pp$1.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement(!this.strict&&this.type==types._function),t.alternate=this.eat(types._else)?this.parseStatement(!this.strict&&this.type==types._function):null,this.finishNode(t,"IfStatement")},pp$1.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},pp$1.parseSwitchStatement=function(t){var e,i=this;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(types.braceL),this.labels.push(switchLabel),this.enterLexicalScope();for(var s=!1;this.type!=types.braceR;)if(i.type===types._case||i.type===types._default){var r=i.type===types._case;e&&i.finishNode(e,"SwitchCase"),t.cases.push(e=i.startNode()),e.consequent=[],i.next(),r?e.test=i.parseExpression():(s&&i.raiseRecoverable(i.lastTokStart,"Multiple default clauses"),s=!0,e.test=null),i.expect(types.colon)}else e||i.unexpected(),e.consequent.push(i.parseStatement(!0));return this.exitLexicalScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},pp$1.parseThrowStatement=function(t){return this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var empty=[];pp$1.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===types._catch){var e=this.startNode();this.next(),this.expect(types.parenL),e.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(e.param,"let"),this.expect(types.parenR),e.body=this.parseBlock(!1),this.exitLexicalScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(types._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},pp$1.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},pp$1.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(loopLabel),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"WhileStatement")},pp$1.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement(!1),this.finishNode(t,"WithStatement")},pp$1.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},pp$1.parseLabeledStatement=function(t,e,i){for(var s=0,r=this.labels;s<r.length;s+=1){r[s].name===e&&this.raise(i.start,"Label '"+e+"' is already declared")}for(var a=this.type.isLoop?"loop":this.type===types._switch?"switch":null,n=this.labels.length-1;0<=n;n--){var o=this.labels[n];if(o.statementStart!=t.start)break;o.statementStart=this.start,o.kind=a}return this.labels.push({name:e,kind:a,statementStart:this.start}),t.body=this.parseStatement(!0),("ClassDeclaration"==t.body.type||"VariableDeclaration"==t.body.type&&"var"!=t.body.kind||"FunctionDeclaration"==t.body.type&&(this.strict||t.body.generator))&&this.raiseRecoverable(t.body.start,"Invalid labeled declaration"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},pp$1.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},pp$1.parseBlock=function(t){void 0===t&&(t=!0);var e=this.startNode();for(e.body=[],this.expect(types.braceL),t&&this.enterLexicalScope();!this.eat(types.braceR);){var i=this.parseStatement(!0);e.body.push(i)}return t&&this.exitLexicalScope(),this.finishNode(e,"BlockStatement")},pp$1.parseFor=function(t,e){return t.init=e,this.expect(types.semi),t.test=this.type===types.semi?null:this.parseExpression(),this.expect(types.semi),t.update=this.type===types.parenR?null:this.parseExpression(),this.expect(types.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"ForStatement")},pp$1.parseForIn=function(t,e){var i=this.type===types._in?"ForInStatement":"ForOfStatement";return this.next(),"ForInStatement"==i&&("AssignmentPattern"!==e.type&&("VariableDeclaration"!==e.type||null==e.declarations[0].init||!this.strict&&"Identifier"===e.declarations[0].id.type)||this.raise(e.start,"Invalid assignment in for-in loop head")),t.left=e,t.right="ForInStatement"==i?this.parseExpression():this.parseMaybeAssign(),this.expect(types.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,i)},pp$1.parseVar=function(t,e,i){var s=this;for(t.declarations=[],t.kind=i;;){var r=s.startNode();if(s.parseVarId(r,i),s.eat(types.eq)?r.init=s.parseMaybeAssign(e):"const"!==i||s.type===types._in||6<=s.options.ecmaVersion&&s.isContextual("of")?"Identifier"==r.id.type||e&&(s.type===types._in||s.isContextual("of"))?r.init=null:s.raise(s.lastTokEnd,"Complex binding patterns require an initialization value"):s.unexpected(),t.declarations.push(s.finishNode(r,"VariableDeclarator")),!s.eat(types.comma))break}return t},pp$1.parseVarId=function(t,e){t.id=this.parseBindingAtom(e),this.checkLVal(t.id,e,!1)},pp$1.parseFunction=function(t,e,i,s){this.initFunction(t),(9<=this.options.ecmaVersion||6<=this.options.ecmaVersion&&!s)&&(t.generator=this.eat(types.star)),8<=this.options.ecmaVersion&&(t.async=!!s),e&&(t.id="nullableID"===e&&this.type!=types.name?null:this.parseIdent(),t.id&&this.checkLVal(t.id,"var"));var r=this.inGenerator,a=this.inAsync,n=this.yieldPos,o=this.awaitPos,h=this.inFunction;return this.inGenerator=t.generator,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),e||(t.id=this.type==types.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i),this.inGenerator=r,this.inAsync=a,this.yieldPos=n,this.awaitPos=o,this.inFunction=h,this.finishNode(t,e?"FunctionDeclaration":"FunctionExpression")},pp$1.parseFunctionParams=function(t){this.expect(types.parenL),t.params=this.parseBindingList(types.parenR,!1,8<=this.options.ecmaVersion),this.checkYieldAwaitInDefaultParams()},pp$1.parseClass=function(t,e){this.next(),this.parseClassId(t,e),this.parseClassSuper(t);var i=this.startNode(),s=!1;for(i.body=[],this.expect(types.braceL);!this.eat(types.braceR);){var r=this.parseClassMember(i);r&&"MethodDefinition"===r.type&&"constructor"===r.kind&&(s&&this.raise(r.start,"Duplicate constructor in the same class"),s=!0)}return t.body=this.finishNode(i,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},pp$1.parseClassMember=function(t){var r=this;if(this.eat(types.semi))return null;function e(t,e){void 0===e&&(e=!1);var i=r.start,s=r.startLoc;return!!r.eatContextual(t)&&(!(r.type===types.parenL||e&&r.canInsertSemicolon())||(a.key&&r.unexpected(),a.computed=!1,a.key=r.startNodeAt(i,s),a.key.name=t,r.finishNode(a.key,"Identifier"),!1))}var a=this.startNode();a.kind="method",a.static=e("static");var i=this.eat(types.star),s=!1;i||(8<=this.options.ecmaVersion&&e("async",!0)?(s=!0,i=9<=this.options.ecmaVersion&&this.eat(types.star)):e("get")?a.kind="get":e("set")&&(a.kind="set")),a.key||this.parsePropertyName(a);var n=a.key;return a.computed||a.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?a.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==a.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),i&&this.raise(n.start,"Constructor can't be a generator"),s&&this.raise(n.start,"Constructor can't be an async method"),a.kind="constructor"),this.parseClassMethod(t,a,i,s),"get"===a.kind&&0!==a.value.params.length&&this.raiseRecoverable(a.value.start,"getter should have no params"),"set"===a.kind&&1!==a.value.params.length&&this.raiseRecoverable(a.value.start,"setter should have exactly one param"),"set"===a.kind&&"RestElement"===a.value.params[0].type&&this.raiseRecoverable(a.value.params[0].start,"Setter cannot use rest params"),a},pp$1.parseClassMethod=function(t,e,i,s){e.value=this.parseMethod(i,s),t.body.push(this.finishNode(e,"MethodDefinition"))},pp$1.parseClassId=function(t,e){t.id=this.type===types.name?this.parseIdent():!0===e?this.unexpected():null},pp$1.parseClassSuper=function(t){t.superClass=this.eat(types._extends)?this.parseExprSubscripts():null},pp$1.parseExport=function(t,e){if(this.next(),this.eat(types.star))return this.expectContextual("from"),this.type!==types.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(types._default)){var i;if(this.checkExport(e,"default",this.lastTokStart),this.type===types._function||(i=this.isAsyncFunction())){var s=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(s,"nullableID",!1,i)}else if(this.type===types._class){var r=this.startNode();t.declaration=this.parseClass(r,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(!0),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==types.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var a=0,n=t.specifiers;a<n.length;a+=1){var o=n[a];this.checkUnreserved(o.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},pp$1.checkExport=function(t,e,i){t&&(has(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},pp$1.checkPatternExport=function(t,e){var i=e.type;if("Identifier"==i)this.checkExport(t,e.name,e.start);else if("ObjectPattern"==i)for(var s=0,r=e.properties;s<r.length;s+=1){var a=r[s];this.checkPatternExport(t,a)}else if("ArrayPattern"==i)for(var n=0,o=e.elements;n<o.length;n+=1){var h=o[n];h&&this.checkPatternExport(t,h)}else"Property"==i?this.checkPatternExport(t,e.value):"AssignmentPattern"==i?this.checkPatternExport(t,e.left):"RestElement"==i?this.checkPatternExport(t,e.argument):"ParenthesizedExpression"==i&&this.checkPatternExport(t,e.expression)},pp$1.checkVariableExport=function(t,e){if(t)for(var i=0,s=e;i<s.length;i+=1){var r=s[i];this.checkPatternExport(t,r.id)}},pp$1.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},pp$1.parseExportSpecifiers=function(t){var e=this,i=[],s=!0;for(this.expect(types.braceL);!this.eat(types.braceR);){if(s)s=!1;else if(e.expect(types.comma),e.afterTrailingComma(types.braceR))break;var r=e.startNode();r.local=e.parseIdent(!0),r.exported=e.eatContextual("as")?e.parseIdent(!0):r.local,e.checkExport(t,r.exported.name,r.exported.start),i.push(e.finishNode(r,"ExportSpecifier"))}return i},pp$1.parseImport=function(t){return this.next(),this.type===types.string?(t.specifiers=empty,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===types.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},pp$1.parseImportSpecifiers=function(){var t=this,e=[],i=!0;if(this.type===types.name){var s=this.startNode();if(s.local=this.parseIdent(),this.checkLVal(s.local,"let"),e.push(this.finishNode(s,"ImportDefaultSpecifier")),!this.eat(types.comma))return e}if(this.type===types.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLVal(r.local,"let"),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(types.braceL);!this.eat(types.braceR);){if(i)i=!1;else if(t.expect(types.comma),t.afterTrailingComma(types.braceR))break;var a=t.startNode();a.imported=t.parseIdent(!0),t.eatContextual("as")?a.local=t.parseIdent():(t.checkUnreserved(a.imported),a.local=a.imported),t.checkLVal(a.local,"let"),e.push(t.finishNode(a,"ImportSpecifier"))}return e},pp$1.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},pp$1.isDirectiveCandidate=function(t){return"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])};var pp$2=Parser.prototype;pp$2.toAssignable=function(t,e,i){if(6<=this.options.ecmaVersion&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=t.properties;s<r.length;s+=1){var a=r[s];this.toAssignable(a,e),"RestElement"!==a.type||"ArrayPattern"!==a.argument.type&&"ObjectPattern"!==a.argument.type||this.raise(a.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e);break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},pp$2.toAssignableList=function(t,e){for(var i=t.length,s=0;s<i;s++){var r=t[s];r&&this.toAssignable(r,e)}if(i){var a=t[i-1];6===this.options.ecmaVersion&&e&&a&&"RestElement"===a.type&&"Identifier"!==a.argument.type&&this.unexpected(a.argument.start)}return t},pp$2.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},pp$2.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==types.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},pp$2.parseBindingAtom=function(){if(6<=this.options.ecmaVersion)switch(this.type){case types.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(types.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case types.braceL:return this.parseObj(!0)}return this.parseIdent()},pp$2.parseBindingList=function(t,e,i){for(var s=this,r=[],a=!0;!this.eat(t);)if(a?a=!1:s.expect(types.comma),e&&s.type===types.comma)r.push(null);else{if(i&&s.afterTrailingComma(t))break;if(s.type===types.ellipsis){var n=s.parseRestBinding();s.parseBindingListItem(n),r.push(n),s.type===types.comma&&s.raise(s.start,"Comma is not permitted after the rest element"),s.expect(t);break}var o=s.parseMaybeDefault(s.start,s.startLoc);s.parseBindingListItem(o),r.push(o)}return r},pp$2.parseBindingListItem=function(t){return t},pp$2.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(types.eq))return i;var s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")},pp$2.checkLVal=function(t,e,i){switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),i&&(has(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),e&&"none"!==e&&(("var"===e&&!this.canDeclareVarName(t.name)||"var"!==e&&!this.canDeclareLexicalName(t.name))&&this.raiseRecoverable(t.start,"Identifier '"+t.name+"' has already been declared"),"var"===e?this.declareVarName(t.name):this.declareLexicalName(t.name));break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var s=0,r=t.properties;s<r.length;s+=1){var a=r[s];this.checkLVal(a,e,i)}break;case"Property":this.checkLVal(t.value,e,i);break;case"ArrayPattern":for(var n=0,o=t.elements;n<o.length;n+=1){var h=o[n];h&&this.checkLVal(h,e,i)}break;case"AssignmentPattern":this.checkLVal(t.left,e,i);break;case"RestElement":this.checkLVal(t.argument,e,i);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,i);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}};var pp$3=Parser.prototype;pp$3.checkPropClash=function(t,e,i){if(!(9<=this.options.ecmaVersion&&"SpreadElement"===t.type||6<=this.options.ecmaVersion&&(t.computed||t.method||t.shorthand))){var s,r=t.key;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var a=t.kind;if(6<=this.options.ecmaVersion)"__proto__"===s&&"init"===a&&(e.proto&&(i&&i.doubleProto<0?i.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),e.proto=!0);else{var n=e[s="$"+s];if(n)("init"===a?this.strict&&n.init||n.get||n.set:n.init||n[a])&&this.raiseRecoverable(r.start,"Redefinition of property");else n=e[s]={init:!1,get:!1,set:!1};n[a]=!0}}},pp$3.parseExpression=function(t,e){var i=this.start,s=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type!==types.comma)return r;var a=this.startNodeAt(i,s);for(a.expressions=[r];this.eat(types.comma);)a.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(a,"SequenceExpression")},pp$3.parseMaybeAssign=function(t,e,i){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var s=!1,r=-1,a=-1;e?(r=e.parenthesizedAssign,a=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new DestructuringErrors,s=!0);var n=this.start,o=this.startLoc;this.type!=types.parenL&&this.type!=types.name||(this.potentialArrowAt=this.start);var h=this.parseMaybeConditional(t,e);if(i&&(h=i.call(this,h,n,o)),this.type.isAssign){var p=this.startNodeAt(n,o);return p.operator=this.value,p.left=this.type===types.eq?this.toAssignable(h,!1,e):h,s||DestructuringErrors.call(e),e.shorthandAssign=-1,this.checkLVal(h),this.next(),p.right=this.parseMaybeAssign(t),this.finishNode(p,"AssignmentExpression")}return s&&this.checkExpressionErrors(e,!0),-1<r&&(e.parenthesizedAssign=r),-1<a&&(e.trailingComma=a),h},pp$3.parseMaybeConditional=function(t,e){var i=this.start,s=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(this.eat(types.question)){var a=this.startNodeAt(i,s);return a.test=r,a.consequent=this.parseMaybeAssign(),this.expect(types.colon),a.alternate=this.parseMaybeAssign(t),this.finishNode(a,"ConditionalExpression")}return r},pp$3.parseExprOps=function(t,e){var i=this.start,s=this.startLoc,r=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)?r:r.start==i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,s,-1,t)},pp$3.parseExprOp=function(t,e,i,s,r){var a=this.type.binop;if(null==a||r&&this.type===types._in||!(s<a))return t;var n=this.type===types.logicalOR||this.type===types.logicalAND,o=this.value;this.next();var h=this.start,p=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1),h,p,a,r),c=this.buildBinary(e,i,t,l,o,n);return this.parseExprOp(c,e,i,s,r)},pp$3.buildBinary=function(t,e,i,s,r,a){var n=this.startNodeAt(t,e);return n.left=i,n.operator=r,n.right=s,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")},pp$3.parseMaybeUnary=function(t,e){var i,s=this,r=this.start,a=this.startLoc;if(this.inAsync&&this.isContextual("await"))i=this.parseAwait(),e=!0;else if(this.type.prefix){var n=this.startNode(),o=this.type===types.incDec;n.operator=this.value,n.prefix=!0,this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),o?this.checkLVal(n.argument):this.strict&&"delete"===n.operator&&"Identifier"===n.argument.type?this.raiseRecoverable(n.start,"Deleting local variable in strict mode"):e=!0,i=this.finishNode(n,o?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var h=s.startNodeAt(r,a);h.operator=s.value,h.prefix=!1,h.argument=i,s.checkLVal(i),s.next(),i=s.finishNode(h,"UpdateExpression")}}return!e&&this.eat(types.starstar)?this.buildBinary(r,a,i,this.parseMaybeUnary(null,!1),"**",!1):i},pp$3.parseExprSubscripts=function(t){var e=this.start,i=this.startLoc,s=this.parseExprAtom(t),r="ArrowFunctionExpression"===s.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(t)||r)return s;var a=this.parseSubscripts(s,e,i);return t&&"MemberExpression"===a.type&&(t.parenthesizedAssign>=a.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=a.start&&(t.parenthesizedBind=-1)),a},pp$3.parseSubscripts=function(t,e,i,s){for(var r=this,a=8<=this.options.ecmaVersion&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd==t.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(t.start,t.end),n=void 0;;)if((n=r.eat(types.bracketL))||r.eat(types.dot)){var o=r.startNodeAt(e,i);o.object=t,o.property=n?r.parseExpression():r.parseIdent(!0),o.computed=!!n,n&&r.expect(types.bracketR),t=r.finishNode(o,"MemberExpression")}else if(!s&&r.eat(types.parenL)){var h=new DestructuringErrors,p=r.yieldPos,l=r.awaitPos;r.yieldPos=0,r.awaitPos=0;var c=r.parseExprList(types.parenR,8<=r.options.ecmaVersion,!1,h);if(a&&!r.canInsertSemicolon()&&r.eat(types.arrow))return r.checkPatternErrors(h,!1),r.checkYieldAwaitInDefaultParams(),r.yieldPos=p,r.awaitPos=l,r.parseArrowExpression(r.startNodeAt(e,i),c,!0);r.checkExpressionErrors(h,!0),r.yieldPos=p||r.yieldPos,r.awaitPos=l||r.awaitPos;var u=r.startNodeAt(e,i);u.callee=t,u.arguments=c,t=r.finishNode(u,"CallExpression")}else{if(r.type!==types.backQuote)return t;var f=r.startNodeAt(e,i);f.tag=t,f.quasi=r.parseTemplate({isTagged:!0}),t=r.finishNode(f,"TaggedTemplateExpression")}},pp$3.parseExprAtom=function(t){var e,i=this.potentialArrowAt==this.start;switch(this.type){case types._super:return this.inFunction||this.raise(this.start,"'super' outside of function or class"),e=this.startNode(),this.next(),this.type!==types.dot&&this.type!==types.bracketL&&this.type!==types.parenL&&this.unexpected(),this.finishNode(e,"Super");case types._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case types.name:var s=this.start,r=this.startLoc,a=this.containsEsc,n=this.parseIdent(this.type!==types.name);if(8<=this.options.ecmaVersion&&!a&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(types._function))return this.parseFunction(this.startNodeAt(s,r),!1,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(types.arrow))return this.parseArrowExpression(this.startNodeAt(s,r),[n],!1);if(8<=this.options.ecmaVersion&&"async"===n.name&&this.type===types.name&&!a)return n=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(types.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,r),[n],!0)}return n;case types.regexp:var o=this.value;return(e=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},e;case types.num:case types.string:return this.parseLiteral(this.value);case types._null:case types._true:case types._false:return(e=this.startNode()).value=this.type===types._null?null:this.type===types._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case types.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(i);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(t.parenthesizedAssign=h),t.parenthesizedBind<0&&(t.parenthesizedBind=h)),p;case types.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(types.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case types.braceL:return this.parseObj(!1,t);case types._function:return e=this.startNode(),this.next(),this.parseFunction(e,!1);case types._class:return this.parseClass(this.startNode(),!1);case types._new:return this.parseNew();case types.backQuote:return this.parseTemplate();default:this.unexpected()}},pp$3.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(e,"Literal")},pp$3.parseParenExpression=function(){this.expect(types.parenL);var t=this.parseExpression();return this.expect(types.parenR),t},pp$3.parseParenAndDistinguishExpression=function(t){var e,i=this,s=this.start,r=this.startLoc,a=8<=this.options.ecmaVersion;if(6<=this.options.ecmaVersion){this.next();var n,o=this.start,h=this.startLoc,p=[],l=!0,c=!1,u=new DestructuringErrors,f=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==types.parenR;){if(l?l=!1:i.expect(types.comma),a&&i.afterTrailingComma(types.parenR,!0)){c=!0;break}if(i.type===types.ellipsis){n=i.start,p.push(i.parseParenItem(i.parseRestBinding())),i.type===types.comma&&i.raise(i.start,"Comma is not permitted after the rest element");break}p.push(i.parseMaybeAssign(!1,u,i.parseParenItem))}var m=this.start,y=this.startLoc;if(this.expect(types.parenR),t&&!this.canInsertSemicolon()&&this.eat(types.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=d,this.parseParenArrowList(s,r,p);p.length&&!c||this.unexpected(this.lastTokStart),n&&this.unexpected(n),this.checkExpressionErrors(u,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=d||this.awaitPos,1<p.length?((e=this.startNodeAt(o,h)).expressions=p,this.finishNodeAt(e,"SequenceExpression",m,y)):e=p[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(s,r);return v.expression=e,this.finishNode(v,"ParenthesizedExpression")}return e},pp$3.parseParenItem=function(t){return t},pp$3.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)};var empty$1=[];pp$3.parseNew=function(){var t=this.startNode(),e=this.parseIdent(!0);if(6<=this.options.ecmaVersion&&this.eat(types.dot)){t.meta=e;var i=this.containsEsc;return t.property=this.parseIdent(!0),"target"===t.property.name&&!i||this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var s=this.start,r=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(),s,r,!0),this.eat(types.parenL)?t.arguments=this.parseExprList(types.parenR,8<=this.options.ecmaVersion,!1):t.arguments=empty$1,this.finishNode(t,"NewExpression")},pp$3.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===types.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===types.backQuote,this.finishNode(i,"TemplateElement")},pp$3.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});for(i.quasis=[s];!s.tail;)this.expect(types.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(types.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},pp$3.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===types.name||this.type===types.num||this.type===types.string||this.type===types.bracketL||this.type.keyword||9<=this.options.ecmaVersion&&this.type===types.star)&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp$3.parseObj=function(t,e){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(types.braceR);){if(s)s=!1;else if(this.expect(types.comma),this.afterTrailingComma(types.braceR))break;var a=this.parseProperty(t,e);t||this.checkPropClash(a,r,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},pp$3.parseProperty=function(t,e){var i,s,r,a,n=this.startNode();if(9<=this.options.ecmaVersion&&this.eat(types.ellipsis))return t?(n.argument=this.parseIdent(!1),this.type===types.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===types.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,e),this.type===types.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(n,"SpreadElement"));6<=this.options.ecmaVersion&&(n.method=!1,n.shorthand=!1,(t||e)&&(r=this.start,a=this.startLoc),t||(i=this.eat(types.star)));var o=this.containsEsc;return this.parsePropertyName(n),!t&&!o&&8<=this.options.ecmaVersion&&!i&&this.isAsyncProp(n)?(s=!0,i=9<=this.options.ecmaVersion&&this.eat(types.star),this.parsePropertyName(n,e)):s=!1,this.parsePropertyValue(n,t,i,s,r,a,e,o),this.finishNode(n,"Property")},pp$3.parsePropertyValue=function(t,e,i,s,r,a,n,o){if((i||s)&&this.type===types.colon&&this.unexpected(),this.eat(types.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init";else if(6<=this.options.ecmaVersion&&this.type===types.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,s);else if(e||o||!(5<=this.options.ecmaVersion)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type==types.comma||this.type==types.braceR)6<=this.options.ecmaVersion&&!t.computed&&"Identifier"===t.key.type?(this.checkUnreserved(t.key),t.kind="init",e?t.value=this.parseMaybeDefault(r,a,t.key):this.type===types.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,a,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(i||s)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var h="get"===t.kind?0:1;if(t.value.params.length!==h){var p=t.value.start;"get"===t.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},pp$3.parsePropertyName=function(t){if(6<=this.options.ecmaVersion){if(this.eat(types.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(types.bracketR),t.key;t.computed=!1}return t.key=this.type===types.num||this.type===types.string?this.parseExprAtom():this.parseIdent(!0)},pp$3.initFunction=function(t){t.id=null,6<=this.options.ecmaVersion&&(t.generator=!1,t.expression=!1),8<=this.options.ecmaVersion&&(t.async=!1)},pp$3.parseMethod=function(t,e){var i=this.startNode(),s=this.inGenerator,r=this.inAsync,a=this.yieldPos,n=this.awaitPos,o=this.inFunction;return this.initFunction(i),6<=this.options.ecmaVersion&&(i.generator=t),8<=this.options.ecmaVersion&&(i.async=!!e),this.inGenerator=i.generator,this.inAsync=i.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(types.parenL),i.params=this.parseBindingList(types.parenR,!1,8<=this.options.ecmaVersion),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1),this.inGenerator=s,this.inAsync=r,this.yieldPos=a,this.awaitPos=n,this.inFunction=o,this.finishNode(i,"FunctionExpression")},pp$3.parseArrowExpression=function(t,e,i){var s=this.inGenerator,r=this.inAsync,a=this.yieldPos,n=this.awaitPos,o=this.inFunction;return this.enterFunctionScope(),this.initFunction(t),8<=this.options.ecmaVersion&&(t.async=!!i),this.inGenerator=!1,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0),this.inGenerator=s,this.inAsync=r,this.yieldPos=a,this.awaitPos=n,this.inFunction=o,this.finishNode(t,"ArrowFunctionExpression")},pp$3.parseFunctionBody=function(t,e){var i=e&&this.type!==types.braceL,s=this.strict,r=!1;if(i)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var a=7<=this.options.ecmaVersion&&!this.isSimpleParamList(t.params);s&&!a||(r=this.strictDirective(this.end))&&a&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var n=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(t,!s&&!r&&!e&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=n}this.exitFunctionScope(),this.strict&&t.id&&this.checkLVal(t.id,"none"),this.strict=s},pp$3.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1){if("Identifier"!==i[e].type)return!1}return!0},pp$3.checkParams=function(t,e){for(var i={},s=0,r=t.params;s<r.length;s+=1){var a=r[s];this.checkLVal(a,"var",e?null:i)}},pp$3.parseExprList=function(t,e,i,s){for(var r=this,a=[],n=!0;!this.eat(t);){if(n)n=!1;else if(r.expect(types.comma),e&&r.afterTrailingComma(t))break;var o=void 0;i&&r.type===types.comma?o=null:r.type===types.ellipsis?(o=r.parseSpread(s),s&&r.type===types.comma&&s.trailingComma<0&&(s.trailingComma=r.start)):o=r.parseMaybeAssign(!1,s),a.push(o)}return a},pp$3.checkUnreserved=function(t){var e=t.start,i=t.end,s=t.name;this.inGenerator&&"yield"===s&&this.raiseRecoverable(e,"Can not use 'yield' as identifier inside a generator"),this.inAsync&&"await"===s&&this.raiseRecoverable(e,"Can not use 'await' as identifier inside an async function"),this.isKeyword(s)&&this.raise(e,"Unexpected keyword '"+s+"'"),this.options.ecmaVersion<6&&-1!=this.input.slice(e,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(s)&&(this.inAsync||"await"!==s||this.raiseRecoverable(e,"Can not use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+s+"' is reserved"))},pp$3.parseIdent=function(t,e){var i=this.startNode();return t&&"never"==this.options.allowReserved&&(t=!1),this.type===types.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(),this.finishNode(i,"Identifier"),t||this.checkUnreserved(i),i},pp$3.parseYield=function(){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type==types.semi||this.canInsertSemicolon()||this.type!=types.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(types.star),t.argument=this.parseMaybeAssign()),this.finishNode(t,"YieldExpression")},pp$3.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0),this.finishNode(t,"AwaitExpression")};var pp$4=Parser.prototype;pp$4.raise=function(t,e){var i=getLineInfo(this.input,t);e+=" ("+i.line+":"+i.column+")";var s=new SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s},pp$4.raiseRecoverable=pp$4.raise,pp$4.curPosition=function(){if(this.options.locations)return new Position(this.curLine,this.pos-this.lineStart)};var pp$5=Parser.prototype,assign=Object.assign||function(t){for(var e=[],i=arguments.length-1;0<i--;)e[i]=arguments[i+1];for(var s=0,r=e;s<r.length;s+=1){var a=r[s];for(var n in a)has(a,n)&&(t[n]=a[n])}return t};pp$5.enterFunctionScope=function(){this.scopeStack.push({var:{},lexical:{},childVar:{},parentLexical:{}})},pp$5.exitFunctionScope=function(){this.scopeStack.pop()},pp$5.enterLexicalScope=function(){var t=this.scopeStack[this.scopeStack.length-1],e={var:{},lexical:{},childVar:{},parentLexical:{}};this.scopeStack.push(e),assign(e.parentLexical,t.lexical,t.parentLexical)},pp$5.exitLexicalScope=function(){var t=this.scopeStack.pop(),e=this.scopeStack[this.scopeStack.length-1];assign(e.childVar,t.var,t.childVar)},pp$5.canDeclareVarName=function(t){var e=this.scopeStack[this.scopeStack.length-1];return!has(e.lexical,t)&&!has(e.parentLexical,t)},pp$5.canDeclareLexicalName=function(t){var e=this.scopeStack[this.scopeStack.length-1];return!has(e.lexical,t)&&!has(e.var,t)&&!has(e.childVar,t)},pp$5.declareVarName=function(t){this.scopeStack[this.scopeStack.length-1].var[t]=!0},pp$5.declareLexicalName=function(t){this.scopeStack[this.scopeStack.length-1].lexical[t]=!0};var Node=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new SourceLocation(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},pp$6=Parser.prototype;function finishNodeAt(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}pp$6.startNode=function(){return new Node(this,this.start,this.startLoc)},pp$6.startNodeAt=function(t,e){return new Node(this,t,e)},pp$6.finishNode=function(t,e){return finishNodeAt.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};var TokContext=function(t,e,i,s,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!r},types$1={b_stat:new TokContext("{",!(pp$6.finishNodeAt=function(t,e,i,s){return finishNodeAt.call(this,t,e,i,s)})),b_expr:new TokContext("{",!0),b_tmpl:new TokContext("${",!1),p_stat:new TokContext("(",!1),p_expr:new TokContext("(",!0),q_tmpl:new TokContext("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new TokContext("function",!1),f_expr:new TokContext("function",!0),f_expr_gen:new TokContext("function",!0,!1,null,!0),f_gen:new TokContext("function",!1,!1,null,!0)},pp$7=Parser.prototype;pp$7.initialContext=function(){return[types$1.b_stat]},pp$7.braceIsBlock=function(t){var e=this.curContext();return e===types$1.f_expr||e===types$1.f_stat||(t!==types.colon||e!==types$1.b_stat&&e!==types$1.b_expr?t===types._return||t==types.name&&this.exprAllowed?lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):t===types._else||t===types.semi||t===types.eof||t===types.parenR||t==types.arrow||(t==types.braceL?e===types$1.b_stat:t!=types._var&&t!=types.name&&!this.exprAllowed):!e.isExpr)},pp$7.inGeneratorContext=function(){for(var t=this.context.length-1;1<=t;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},pp$7.updateContext=function(t){var e,i=this.type;i.keyword&&t==types.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},types.parenR.updateContext=types.braceR.updateContext=function(){if(1!=this.context.length){var t=this.context.pop();t===types$1.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},types.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?types$1.b_stat:types$1.b_expr),this.exprAllowed=!0},types.dollarBraceL.updateContext=function(){this.context.push(types$1.b_tmpl),this.exprAllowed=!0},types.parenL.updateContext=function(t){var e=t===types._if||t===types._for||t===types._with||t===types._while;this.context.push(e?types$1.p_stat:types$1.p_expr),this.exprAllowed=!0},types.incDec.updateContext=function(){},types._function.updateContext=types._class.updateContext=function(t){t.beforeExpr&&t!==types.semi&&t!==types._else&&(t!==types.colon&&t!==types.braceL||this.curContext()!==types$1.b_stat)?this.context.push(types$1.f_expr):this.context.push(types$1.f_stat),this.exprAllowed=!1},types.backQuote.updateContext=function(){this.curContext()===types$1.q_tmpl?this.context.pop():this.context.push(types$1.q_tmpl),this.exprAllowed=!1},types.star.updateContext=function(t){if(t==types._function){var e=this.context.length-1;this.context[e]===types$1.f_expr?this.context[e]=types$1.f_expr_gen:this.context[e]=types$1.f_gen}this.exprAllowed=!0},types.name.updateContext=function(t){var e=!1;6<=this.options.ecmaVersion&&("of"==this.value&&!this.exprAllowed||"yield"==this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Token=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new SourceLocation(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},pp$8=Parser.prototype,isRhino="object"==("undefined"==typeof Packages?"undefined":_typeof(Packages))&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);function tryCreateRegexp(t,e,i,s){try{return new RegExp(t,e)}catch(t){if(void 0!==i)throw t instanceof SyntaxError&&s.raise(i,"Error parsing regular expression: "+t.message),t}}pp$8.next=function(){this.options.onToken&&this.options.onToken(new Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pp$8.getToken=function(){return this.next(),new Token(this)},"undefined"!=typeof Symbol&&(pp$8[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===types.eof,value:t}}}}),pp$8.curContext=function(){return this.context[this.context.length-1]},pp$8.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(types.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},pp$8.readToken=function(t){return isIdentifierStart(t,6<=this.options.ecmaVersion)||92===t?this.readWord():this.getTokenFromCode(t)},pp$8.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||57344<=t?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},pp$8.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(lineBreakG.lastIndex=i;(t=lineBreakG.exec(this.input))&&t.index<this.pos;)++this.curLine,this.lineStart=t.index+t[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,s),i,this.pos,e,this.curPosition())},pp$8.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!isNewLine(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},pp$8.skipSpace=function(){var t=this;t:for(;this.pos<this.input.length;){var e=t.input.charCodeAt(t.pos);switch(e){case 32:case 160:++t.pos;break;case 13:10===t.input.charCodeAt(t.pos+1)&&++t.pos;case 10:case 8232:case 8233:++t.pos,t.options.locations&&(++t.curLine,t.lineStart=t.pos);break;case 47:switch(t.input.charCodeAt(t.pos+1)){case 42:t.skipBlockComment();break;case 47:t.skipLineComment(2);break;default:break t}break;default:if(!(8<e&&e<14||5760<=e&&nonASCIIwhitespace.test(String.fromCharCode(e))))break t;++t.pos}}},pp$8.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},pp$8.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(48<=t&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return 6<=this.options.ecmaVersion&&46===t&&46===e?(this.pos+=3,this.finishToken(types.ellipsis)):(++this.pos,this.finishToken(types.dot))},pp$8.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(types.assign,2):this.finishOp(types.slash,1)},pp$8.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=42===t?types.star:types.modulo;return 7<=this.options.ecmaVersion&&42==t&&42===e&&(++i,s=types.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(types.assign,i+1):this.finishOp(s,i)},pp$8.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(124===t?types.logicalOR:types.logicalAND,2):61===e?this.finishOp(types.assign,2):this.finishOp(124===t?types.bitwiseOR:types.bitwiseAND,1)},pp$8.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(types.assign,2):this.finishOp(types.bitwiseXOR,1)},pp$8.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!=e||this.inModule||62!=this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(types.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(types.assign,2):this.finishOp(types.plusMin,1)},pp$8.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(types.assign,i+1):this.finishOp(types.bitShift,i)):33!=e||60!=t||this.inModule||45!=this.input.charCodeAt(this.pos+2)||45!=this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(types.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},pp$8.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(types.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&6<=this.options.ecmaVersion?(this.pos+=2,this.finishToken(types.arrow)):this.finishOp(61===t?types.eq:types.prefix,1)},pp$8.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(types.parenL);case 41:return++this.pos,this.finishToken(types.parenR);case 59:return++this.pos,this.finishToken(types.semi);case 44:return++this.pos,this.finishToken(types.comma);case 91:return++this.pos,this.finishToken(types.bracketL);case 93:return++this.pos,this.finishToken(types.bracketR);case 123:return++this.pos,this.finishToken(types.braceL);case 125:return++this.pos,this.finishToken(types.braceR);case 58:return++this.pos,this.finishToken(types.colon);case 63:return++this.pos,this.finishToken(types.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(types.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(6<=this.options.ecmaVersion){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(types.prefix,1)}this.raise(this.pos,"Unexpected character '"+codePointToString(t)+"'")},pp$8.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};var regexpUnicodeSupport=!!tryCreateRegexp("￿","u");function codePointToString(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}pp$8.readRegexp=function(){for(var t,e,s=this,r=this.pos;;){s.pos>=s.input.length&&s.raise(r,"Unterminated regular expression");var i=s.input.charAt(s.pos);if(lineBreak.test(i)&&s.raise(r,"Unterminated regular expression"),t)t=!1;else{if("["===i)e=!0;else if("]"===i&&e)e=!1;else if("/"===i&&!e)break;t="\\"===i}++s.pos}var a=this.input.slice(r,this.pos);++this.pos;var n=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(n);var h=a,p="";if(o){var l="gim";6<=this.options.ecmaVersion&&(l+="uy"),9<=this.options.ecmaVersion&&(l+="s");for(var c=0;c<o.length;c++){var u=o.charAt(c);-1==l.indexOf(u)&&s.raise(r,"Invalid regular expression flag"),-1<o.indexOf(u,c+1)&&s.raise(r,"Duplicate regular expression flag")}0<=o.indexOf("u")&&(p=regexpUnicodeSupport?"u":(h=(h=h.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(t,e,i){return 1114111<(e=Number("0x"+e))&&s.raise(r+i+3,"Code point out of bounds"),"x"})).replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"),p.replace("u","")))}var f=null;return isRhino||(tryCreateRegexp(h,p,r,this),f=tryCreateRegexp(a,o)),this.finishToken(types.regexp,{pattern:a,flags:o,value:f})},pp$8.readInt=function(t,e){for(var i=this.pos,s=0,r=0,a=null==e?1/0:e;r<a;++r){var n=this.input.charCodeAt(this.pos),o=void 0;if(t<=(o=97<=n?n-97+10:65<=n?n-65+10:48<=n&&n<=57?n-48:1/0))break;++this.pos,s=s*t+o}return this.pos===i||null!=e&&this.pos-i!==e?null:s},pp$8.readRadixNumber=function(t){this.pos+=2;var e=this.readInt(t);return null==e&&this.raise(this.start+2,"Expected number in radix "+t),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types.num,e)},pp$8.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10)||this.raise(e,"Invalid number");var i=2<=this.pos-e&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number"),i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1);var s=this.input.charCodeAt(this.pos);46!==s||i||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r=this.input.slice(e,this.pos),a=i?parseInt(r,8):parseFloat(r);return this.finishToken(types.num,a)},pp$8.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,1114111<t&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},pp$8.readString=function(t){for(var e=this,i="",s=++this.pos;;){e.pos>=e.input.length&&e.raise(e.start,"Unterminated string constant");var r=e.input.charCodeAt(e.pos);if(r===t)break;92===r?(i+=e.input.slice(s,e.pos),i+=e.readEscapedChar(!1),s=e.pos):(isNewLine(r)&&e.raise(e.start,"Unterminated string constant"),++e.pos)}return i+=this.input.slice(s,this.pos++),this.finishToken(types.string,i)};var INVALID_TEMPLATE_ESCAPE_ERROR={};function parse(t,e){return new Parser(e,t).parse()}pp$8.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==INVALID_TEMPLATE_ESCAPE_ERROR)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},pp$8.invalidStringToken=function(t,e){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw INVALID_TEMPLATE_ESCAPE_ERROR;this.raise(t,e)},pp$8.readTmplToken=function(){for(var t=this,e="",i=this.pos;;){t.pos>=t.input.length&&t.raise(t.start,"Unterminated template");var s=t.input.charCodeAt(t.pos);if(96===s||36===s&&123===t.input.charCodeAt(t.pos+1))return t.pos!==t.start||t.type!==types.template&&t.type!==types.invalidTemplate?(e+=t.input.slice(i,t.pos),t.finishToken(types.template,e)):36===s?(t.pos+=2,t.finishToken(types.dollarBraceL)):(++t.pos,t.finishToken(types.backQuote));if(92===s)e+=t.input.slice(i,t.pos),e+=t.readEscapedChar(!0),i=t.pos;else if(isNewLine(s)){switch(e+=t.input.slice(i,t.pos),++t.pos,s){case 13:10===t.input.charCodeAt(t.pos)&&++t.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}t.options.locations&&(++t.curLine,t.lineStart=t.pos),i=t.pos}else++t.pos}},pp$8.readInvalidTemplateToken=function(){for(var t=this;this.pos<this.input.length;this.pos++)switch(t.input[t.pos]){case"\\":++t.pos;break;case"$":if("{"!==t.input[t.pos+1])break;case"`":return t.finishToken(types.invalidTemplate,t.input.slice(t.start,t.pos))}this.raise(this.start,"Unterminated template")},pp$8.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(48<=e&&e<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return 255<s&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),"0"===i&&56!=e&&57!=e||!this.strict&&!t||this.invalidStringToken(this.pos-1-i.length,"Octal literal in strict mode"),String.fromCharCode(s)}return String.fromCharCode(e)}},pp$8.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},pp$8.readWord1=function(){for(var t=this,e="",i=!(this.containsEsc=!1),s=this.pos,r=6<=this.options.ecmaVersion;this.pos<this.input.length;){var a=t.fullCharCodeAtPos();if(isIdentifierChar(a,r))t.pos+=a<=65535?1:2;else{if(92!==a)break;t.containsEsc=!0,e+=t.input.slice(s,t.pos);var n=t.pos;117!=t.input.charCodeAt(++t.pos)&&t.invalidStringToken(t.pos,"Expecting Unicode escape sequence \\uXXXX"),++t.pos;var o=t.readCodePoint();(i?isIdentifierStart:isIdentifierChar)(o,r)||t.invalidStringToken(n,"Invalid Unicode escape"),e+=codePointToString(o),s=t.pos}i=!1}return e+this.input.slice(s,this.pos)},pp$8.readWord=function(){var t=this.readWord1(),e=types.name;return this.keywords.test(t)&&(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+t),e=keywords$1[t]),this.finishToken(e,t)};var ScopeVar=function(){function t(t,e){this.value=e,this.kind=t}return t.prototype.$set=function(t){return"const"!==this.value&&(this.value=t,!0)},t.prototype.$get=function(){return this.value},t}(),Scope=function(){function t(t,e,i){this.prefix="@",this.type=t,this.parent=e||null,this.content={},this.invasived=!1}return t.prototype.$find=function(t){var e=this.prefix+t;return this.content.hasOwnProperty(e)?this.content[e]:this.parent?this.parent.$find(t):null},t.prototype.$let=function(t,e){var i=this.prefix+t;return!this.content[i]&&(this.content[i]=new ScopeVar("let",e),!0)},t.prototype.$const=function(t,e){var i=this.prefix+t;return!this.content[i]&&(this.content[i]=new ScopeVar("const",e),!0)},t.prototype.$var=function(t,e){for(var i=this.prefix+t,s=this;null!==s.parent&&"function"!==s.type;)s=s.parent;return!s.content[i]&&(this.content[i]=new ScopeVar("var",e),!0)},t.prototype.$declar=function(t,e,i){var s=this;return{var:function(){return s.$var(e,i)},let:function(){return s.$let(e,i)},const:function(){return s.$const(e,i)}}[t]()},t}(),BREAK_SINGAL={},CONTINUE_SINGAL={},RETURN_SINGAL={result:void 0},evaluate_map={Program:function(t,e){for(var i=0,s=t.body;i<s.length;i++){var r=s[i];evaluate(r,e)}},Identifier:function(t,e){if("undefined"!==t.name){var i=e.$find(t.name);if(i)return i.$get();throw"[Error] "+t.loc+", '"+t.name+"' 未定义"}},Literal:function(t,e){return t.value},BlockStatement:function(t,e){for(var i=e.invasived?e:new Scope("block",e),s=0,r=t.body;s<r.length;s++){var a=r[s],n=evaluate(a,i);if(n===BREAK_SINGAL||n===CONTINUE_SINGAL||n===RETURN_SINGAL)return n}},EmptyStatement:function(t,e){},DebuggerStatement:function(t,e){},ExpressionStatement:function(t,e){evaluate(t.expression,e)},ReturnStatement:function(t,e){return RETURN_SINGAL.result=t.argument?evaluate(t.argument,e):void 0,RETURN_SINGAL},LabeledStatement:function(t,e){t.type},BreakStatement:function(t,e){return BREAK_SINGAL},ContinueStatement:function(t,e){return CONTINUE_SINGAL},IfStatement:function(t,e){return evaluate(t.test,e)?evaluate(t.consequent,e):t.alternate?evaluate(t.alternate,e):void 0},SwitchStatement:function(t,e){for(var i=evaluate(t.discriminant,e),s=new Scope("switch",e),r=!1,a=0,n=t.cases;a<n.length;a++){var o=n[a];if(r||o.test&&i!==evaluate(o.test,s)||(r=!0),r){var h=evaluate(o,s);if(h===BREAK_SINGAL)break;if(h===CONTINUE_SINGAL||h===RETURN_SINGAL)return h}}},SwitchCase:function(t,e){for(var i=0,s=t.consequent;i<s.length;i++){var r=s[i],a=evaluate(r,e);if(a===BREAK_SINGAL||a===CONTINUE_SINGAL||a===RETURN_SINGAL)return a}},WithStatement:function(t,e){throw"因为 with 很多问题,已经被基本弃用了,不实现"},ThrowStatement:function(t,e){throw evaluate(t.argument,e)},TryStatement:function(e,i){try{return evaluate(e.block,i)}catch(t){if(e.handler){var s=e.handler.param,r=new Scope("block",i);return r.invasived=!0,r.$const(s.name,t),evaluate(e.handler,r)}throw t}finally{if(e.finalizer)return evaluate(e.finalizer,i)}},CatchClause:function(t,e){return evaluate(t.body,e)},WhileStatement:function(t,e){for(;evaluate(t.test,e);){var i=new Scope("loop",e);i.invasived=!0;var s=evaluate(t.body,i);if(s===BREAK_SINGAL)break;if(s!==CONTINUE_SINGAL&&s===RETURN_SINGAL)return s}},DoWhileStatement:function(t,e){do{var i=new Scope("loop",e);i.invasived=!0;var s=evaluate(t.body,i);if(s===BREAK_SINGAL)break;if(s!==CONTINUE_SINGAL&&s===RETURN_SINGAL)return s}while(evaluate(t.test,e))},ForStatement:function(t,e){var i=new Scope("loop",e);for(t.init&&evaluate(t.init,i);!t.test||evaluate(t.test,i);t.update&&evaluate(t.update,i)){var s=evaluate(t.body,i);if(s===BREAK_SINGAL)break;if(s!==CONTINUE_SINGAL&&s===RETURN_SINGAL)return s}},ForInStatement:function(t,e){var i=t.left.kind,s=t.left.declarations[0].id.name;for(var r in evaluate(t.right,e)){var a=new Scope("loop",e);a.invasived=!0,e.$declar(i,s,r);var n=evaluate(t.body,a);if(n===BREAK_SINGAL)break;if(n!==CONTINUE_SINGAL&&n===RETURN_SINGAL)return n}},FunctionDeclaration:function(t,e){var i=evaluate_map.FunctionExpression(t,e),s=t.id.name;if(!e.$const(s,i))throw"[Error] "+name+" 重复定义"},VariableDeclaration:function(t,e){for(var i=t.kind,s=0,r=t.declarations;s<r.length;s++){var a=r[s],n=a.id.name,o=a.init?evaluate(a.init,e):void 0;if(!e.$declar(i,n,o))throw"[Error] "+n+" 重复定义"}},VariableDeclarator:function(t,e){throw"执行这里就错了"},ThisExpression:function(t,e){var i=e.$find("this");return i?i.$get():null},ArrayExpression:function(t,e){return t.elements.map(function(t){return evaluate(t,e)})},ObjectExpression:function(t,e){for(var i={},s=0,r=t.properties;s<r.length;s++){var a=r[s],n=a.kind,o=void 0;if("Literal"===a.key.type)o=evaluate(a.key,e);else{if("Identifier"!==a.key.type)throw"这里绝对就错了";o=a.key.name}var h=evaluate(a.value,e);if("init"===n)i[o]=h;else if("set"===n)Object.defineProperty(i,o,{set:h});else{if("get"!==n)throw"这里绝对就错了";Object.defineProperty(i,o,{get:h})}}return i},FunctionExpression:function(n,o){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=new Scope("function",o);i.invasived=!0;for(var s=0;s<n.params.length;s++){var r=n.params[s].name;i.$const(r,t[s])}i.$const("this",this),i.$const("arguments",arguments);var a=evaluate(n.body,i);if(a===RETURN_SINGAL)return a.result}},UnaryExpression:function(r,a){return{"-":function(){return-evaluate(r.argument,a)},"+":function(){return+evaluate(r.argument,a)},"!":function(){return!evaluate(r.argument,a)},"~":function(){return~evaluate(r.argument,a)},void:function(){evaluate(r.argument,a)},typeof:function(){if("Identifier"!==r.argument.type)return _typeof(evaluate(r.argument,a));var t=a.$find(r.argument.name);return t?_typeof(t.$get()):"undefined"},delete:function(){if("MemberExpression"===r.argument.type){var t=r.argument,e=t.object,i=t.property;return t.computed?delete evaluate(e,a)[evaluate(i,a)]:delete evaluate(e,a)[i.name]}if("Identifier"===r.argument.type){var s=a.$find("this");if(s)return s.$get()[r.argument.name]}}}[r.operator]()},UpdateExpression:function(t,e){var i,s=t.prefix;if("Identifier"===t.argument.type){var r=t.argument.name;if(!(i=e.$find(r)))throw r+" 未定义"}else if("MemberExpression"===t.argument.type){var a=t.argument,n=evaluate(a.object,e),o=a.computed?evaluate(a.property,e):a.property.name;i={$set:function(t){return n[o]=t,!0},$get:function(){return n[o]}}}return{"--":function(t){return i.$set(t-1),s?--t:t--},"++":function(t){return i.$set(t+1),s?++t:t++}}[t.operator](evaluate(t.argument,e))},BinaryExpression:function(t,e){return{"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return e<t},">=":function(t,e){return e<=t},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},in:function(t,e){return t in e},instanceof:function(t,e){return t instanceof e}}[t.operator](evaluate(t.left,e),evaluate(t.right,e))},AssignmentExpression:function(t,e){var i;if("Identifier"===t.left.type){var s=t.left.name,r=e.$find(s);if(!r)throw s+" 未定义";i=r}else{if("MemberExpression"!==t.left.type)throw"如果出现在这里,那就说明有问题了";var a=t.left,n=evaluate(a.object,e),o=a.computed?evaluate(a.property,e):a.property.name;i={$set:function(t){return n[o]=t,!0},$get:function(){return n[o]}}}return{"=":function(t){return i.$set(t),t},"+=":function(t){return i.$set(i.$get()+t),i.$get()},"-=":function(t){return i.$set(i.$get()-t),i.$get()},"*=":function(t){return i.$set(i.$get()*t),i.$get()},"/=":function(t){return i.$set(i.$get()/t),i.$get()},"%=":function(t){return i.$set(i.$get()%t),i.$get()},"<<=":function(t){return i.$set(i.$get()<<t),i.$get()},">>=":function(t){return i.$set(i.$get()>>t),i.$get()},">>>=":function(t){return i.$set(i.$get()>>>t),i.$get()},"|=":function(t){return i.$set(i.$get()|t),i.$get()},"^=":function(t){return i.$set(i.$get()^t),i.$get()},"&=":function(t){return i.$set(i.$get()&t),i.$get()}}[t.operator](evaluate(t.right,e))},LogicalExpression:function(t,e){return{"||":function(){return evaluate(t.left,e)||evaluate(t.right,e)},"&&":function(){return evaluate(t.left,e)&&evaluate(t.right,e)}}[t.operator]()},MemberExpression:function(t,e){var i=t.object,s=t.property;return t.computed?evaluate(i,e)[evaluate(s,e)]:evaluate(i,e)[s.name]},ConditionalExpression:function(t,e){return evaluate(t.test,e)?evaluate(t.consequent,e):evaluate(t.alternate,e)},CallExpression:function(t,e){var i=evaluate(t.callee,e),s=t.arguments.map(function(t){return evaluate(t,e)});if("MemberExpression"===t.callee.type){var r=evaluate(t.callee.object,e);return i.apply(r,s)}var a=e.$find("this");return i.apply(a?a.$get():null,s)},NewExpression:function(t,e){var i=evaluate(t.callee,e),s=t.arguments.map(function(t){return evaluate(t,e)});return new(i.bind.apply(i,[null].concat(s)))},SequenceExpression:function(t,e){for(var i,s=0,r=t.expressions;s<r.length;s++){var a=r[s];i=evaluate(a,e)}return i},Property:function(t,e,i){throw"这里如果被执行了那也是错的..."},ClassExpression:function(t,e){throw t.type+" 未实现"},RestElement:function(t,e){throw t.type+" 未实现"},MetaProperty:function(t,e){throw t.type+" 未实现"},AwaitExpression:function(t,e){throw t.type+" 未实现"},Super:function(t,e){throw t.type+" 未实现"},SpreadElement:function(t,e){throw t.type+" 未实现"},TemplateElement:function(t,e){throw t.type+" 未实现"},ClassDeclaration:function(t,e){throw t.type+" 未实现"},TaggedTemplateExpression:function(t,e){throw t.type+" 未实现"},MethodDefinition:function(t,e){throw t.type+" 未实现"},AssignmentPattern:function(t,e){throw t.type+" 未实现"},ObjectPattern:function(t,e){throw t.type+" 未实现"},ArrayPattern:function(t,e){throw t.type+" 未实现"},ForOfStatement:function(t,e){throw t.type+" 未实现"},TemplateLiteral:function(t,e){throw t.type+" 未实现"},ClassBody:function(t,e){throw t.type+" 未实现"},ImportDeclaration:function(t,e){throw t.type+" 未实现"},ExportNamedDeclaration:function(t,e){throw t.type+" 未实现"},ExportDefaultDeclaration:function(t,e){throw t.type+" 未实现"},ExportAllDeclaration:function(t,e){throw t.type+" 未实现"},ImportSpecifier:function(t,e){throw t.type+" 未实现"},ImportDefaultSpecifier:function(t,e){throw t.type+" 未实现"},ImportNamespaceSpecifier:function(t,e){throw t.type+" 未实现"},ExportSpecifier:function(t,e){throw t.type+" 未实现"},YieldExpression:function(t,e){throw t.type+" 未实现"},ArrowFunctionExpression:function(t,e){throw t.type+" 未实现"}},evaluate=function(t,e,i){return(0,evaluate_map[t.type])(t,e,i)},options={ecmaVersion:5,sourceType:"script",locations:!0},default_api={console:console,setTimeout:setTimeout,setInterval:setInterval,clearTimeout:clearTimeout,clearInterval:clearInterval,encodeURI:encodeURI,encodeURIComponent:encodeURIComponent,decodeURI:decodeURI,decodeURIComponent:decodeURIComponent,escape:escape,unescape:unescape,Infinity:1/0,NaN:NaN,isFinite:isFinite,isNaN:isNaN,parseFloat:parseFloat,parseInt:parseInt,Object:Object,Boolean:Boolean,Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError,Number:Number,Math:Math,Date:Date,String:String,RegExp:RegExp,Array:Array,JSON:JSON,Promise:Promise};function run(t,e){void 0===e&&(e={});var i=new Scope("block");i.$const("this",this);for(var s=0,r=Object.getOwnPropertyNames(default_api);s<r.length;s++){var a=r[s];i.$const(a,default_api[a])}for(var n=0,o=Object.getOwnPropertyNames(e);n<o.length;n++){var h=o[n];i.$const(h,e[h])}var p={},l={exports:p};i.$const("module",l),i.$const("exports",p),evaluate(parse(t,options),i);var c=i.$find("module");return c?c.$get().exports:null}var _appendApis=Object.create(null),interpreter={clearApi:function(){_appendApis=Object.create(null)},appendApis:function(t){var e=0<arguments.length&&void 0!==t?t:{};Object.keys(e).forEach(function(t){_appendApis[t]=e[t]})},run:function(t,e){var i=1<arguments.length&&void 0!==e?e:{};return run(t,Object.assign(_appendApis,i))}},bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_floor=Math.floor,bm_min=Math.min,roundCorner=.5519;function RGBtoHSV(t,e,i){var s=Math.max(t,e,i),r=Math.min(t,e,i),a=s-r,n=void 0,o=0===s?0:a/s,h=s/255;switch(s){case r:n=0;break;case t:n=e-i+a*(e<i?6:0),n/=6*a;break;case e:n=i-t+2*a,n/=6*a;break;case i:n=t-e+4*a,n/=6*a}return[n,o,h]}function HSVtoRGB(t,e,i){var s,r,a,n,o,h=void 0,p=void 0,l=void 0;switch(a=i*(1-e),n=i*(1-(r=6*t-(s=Math.floor(6*t)))*e),o=i*(1-(1-r)*e),s%6){case 0:h=i,p=o,l=a;break;case 1:h=n,p=i,l=a;break;case 2:h=a,p=i,l=o;break;case 3:h=a,p=n,l=i;break;case 4:h=o,p=a,l=i;break;case 5:h=i,p=a,l=n}return[h,p,l]}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,1<i[0]?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}function addSaturationToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[1]+=e,1<i[1]?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,1<i[2]?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function BMEnterFrameEvent(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<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 double(t){return t.concat(createSizedArray(t.length))}var pooling={double:double};function pool_factory(t,e,i,s){var r=0,a=t,n=createSizedArray(a);function o(){return r?n[r-=1]:e()}return{clone:function(){var t=o();return s(t)},newElement:o,release:function(t){r===a&&(n=pooling.double(n),a*=2),i&&i(t),n[r]=t,r+=1}}}function create(){return createTypedArray("float32",2)}var point_pool=pool_factory(8,create),ShapePath=function(){function h(){classCallCheck(this,h),this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}return createClass(h,[{key:"setPathData",value:function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=point_pool.newElement(),this.o[i]=point_pool.newElement(),this.i[i]=point_pool.newElement(),i+=1}},{key:"setLength",value:function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t}},{key:"doubleArrayLength",value:function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2}},{key:"setXYAt",value:function(t,e,i,s,r){var a=void 0;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}a[s]&&(!a[s]||r)||(a[s]=point_pool.newElement()),a[s][0]=t,a[s][1]=e}},{key:"setTripleAt",value:function(t,e,i,s,r,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,s,"o",n,o),this.setXYAt(r,a,"i",n,o)}},{key:"reverse",value:function(){var t=new h;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=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),r=1);var a=this._length-1,n=this._length,o=void 0;for(o=r;o<n;o+=1)t.setTripleAt(e[a][0],e[a][1],s[a][0],s[a][1],i[a][0],i[a][1],o,!1),a-=1;return t}}]),h}();function create$1(){return new ShapePath}function release(t){var e=t._length,i=void 0;for(i=0;i<e;i+=1)point_pool.release(t.v[i]),point_pool.release(t.i[i]),point_pool.release(t.o[i]),t.v[i]=null,t.i[i]=null,t.o[i]=null;t._length=0,t.c=!1}var factory=pool_factory(4,create$1,release);factory.clone=function(t){var e=factory.newElement(),i=void 0,s=void 0===t._length?t.v.length:t._length;for(e.setLength(s),e.c=t.c,i=0;i<s;i+=1)e.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],i);return e};var ob$1={},degToRads=Math.PI/180;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}var easeInBez=ob.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=ob.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=ob.getBezierEasing(.33,0,.667,1,"easeInOut").get;function initiateExpression(n,o,t){var e=o.x,i=/velocity(?![\w\d])/.test(e),s=-1!==e.indexOf("random"),r=n.data.ty,a=void 0,h=void 0,p=void 0,l=void 0,c=t;c.valueAtTime=c.getValueAtTime,Object.defineProperty(c,"value",{get:function(){return c.v}}),n.comp.frameDuration=1/n.comp.globalData.frameRate,n.comp.displayStartTime=0;var u=n.data.ip/n.comp.globalData.frameRate,f=n.data.op/n.comp.globalData.frameRate,d=n.data.sw?n.data.sw:0,m=n.data.sh?n.data.sh:0,y=(n.data.nm,void 0),v=void 0,g=void 0,k=void 0,x=void 0,b=void 0,P=void 0,_=void 0,C=void 0,S=void 0,T=void 0,E=void 0,A=void 0,w=void 0,I=[];if(interpreter.appendApis({thisProperty:c,_needsRandom:s,loopInDuration:function(t,e){return y(t,e,!0)},loopOutDuration:function(t,e){return g(t,e,!0)},outPoint:f,inPoint:u,width:d,height:m,lookAt:function(t,e){var i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],s=Math.atan2(i[0],Math.sqrt(i[1]*i[1]+i[2]*i[2]))/degToRads;return[-Math.atan2(i[1],i[2])/degToRads,s,0]},easeOut:function(t,e,i,s,r){return j(easeOutBez,t,e,i,s,r)},sourceRectAtTime:function(){return n.sourceRectAtTime()},easeIn:function(t,e,i,s,r){return j(easeInBez,t,e,i,s,r)},ease:function(t,e,i,s,r){return j(easeInOutBez,t,e,i,s,r)},key:function(t){var e,i,s;if(!o.k.length||"number"==typeof o.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:o.k[t].t/n.comp.globalData.frameRate,value:[]};var r=o.k[t].hasOwnProperty("s")?o.k[t].s:o.k[t-1].e;for(s=r.length,i=0;i<s;i+=1)e[i]=r[i],e.value[i]=r[i];return e},wiggle:L,substring:function(t,e){return"string"!=typeof V?"":void 0!==e?V.substring(t,e):V.substring(t)},substr:function(t,e){return"string"!=typeof V?"":void 0!==e?V.substr(t,e):V.substr(t)},framesToTime:function(t,e){e=e||n.comp.globalData.frameRate;return t/e},timeToFrames:function(t,e){t||0===t||(t=R);e=e||n.comp.globalData.frameRate;return t*e},nearestKey:function(t){var e,i,s,r=o.k.length;if(o.k.length&&"number"!=typeof o.k[0])if(i=-1,(t*=n.comp.globalData.frameRate)<o.k[0].t)i=1,s=o.k[0].t;else{for(e=0;e<r-1;e+=1){if(t===o.k[e].t){i=e+1,s=o.k[e].t;break}if(t>o.k[e].t&&t<o.k[e+1].t){s=t-o.k[e].t>o.k[e+1].t-t?(i=e+2,o.k[e+1].t):(i=e+1,o.k[e].t);break}}-1===i&&(i=e+1,s=o.k[e].t)}else s=i=0;var a={};return a.index=i,a.time=s/n.comp.globalData.frameRate,a},scoped_bm_rt:M}),o.xf){var D=void 0,F=o.xf.length;for(D=0;D<F;D+=1)I[D]=interpreter.run("module.exports = "+o.xf[D])}var M=void 0,L=(t.kf&&o.k.length,this.data&&this.data.hd,function(t,e){var i=void 0,s=void 0,r=this.pv.length?this.pv.length:1,a=createTypedArray("float32",r);var n=Math.floor(5*R);for(s=i=0;i<n;){for(s=0;s<r;s+=1)a[s]+=-e+2*e*Math.random();i+=1}var o=5*R,h=o-Math.floor(o),p=createTypedArray("float32",r);if(1<r){for(s=0;s<r;s+=1)p[s]=this.pv[s]+a[s]+(-e+2*e*Math.random())*h;return p}return this.pv+a[0]+(-e+2*e*Math.random())*h}.bind(this));c.loopIn&&(y=c.loopIn.bind(c),v=y),c.loopOut&&(g=c.loopOut.bind(c),k=g),c.smooth&&(x=c.smooth.bind(c)),this.getValueAtTime&&this.getValueAtTime.bind(this),this.getVelocityAtTime&&(w=this.getVelocityAtTime.bind(this));var R,$,V,O,N,z,B;n.comp.globalData.projectInterface.bind(n.comp.globalData.projectInterface);function j(t,e,i,s,r,a){void 0===r?(r=i,a=s):e=(e-i)/(s-i);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(r)){var o,h=r.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=(a[o]-r[o])*n+r[o];return p}return(a-r)*n+r}var G,q=n.data.ind,W=(n.hierarchy&&n.hierarchy.length,Math.floor(1e6*Math.random()));n.globalData;return function(t){if(V=t,s&&function(t){Math.seedrandom(W+t)}(W),this.frameExpressionId===n.globalData.frameId&&"textSelector"!==this.propType)return V;"textSelector"===this.propType&&(N=this.textIndex,z=this.textTotal,B=this.selectorValue),E||(O=n.layerInterface.text,E=n.layerInterface,n.comp.compInterface,b=E.toWorld.bind(E),P=E.fromWorld.bind(E),_=E.fromComp.bind(E),C=E.toComp.bind(E),A=E.mask?E.mask.bind(E):null,S=_),a||(a=n.layerInterface("ADBE Transform Group"),(h=a)&&(T=a.anchorPoint)),4!==r||p||(p=E("ADBE Root Vectors Group")),l=l||E(4),!(!n.hierarchy||!n.hierarchy.length)&&!G&&(G=n.hierarchy[0].layerInterface),R=this.comp.renderedFrame/this.comp.globalData.frameRate,i&&($=w(R));try{interpreter.appendApis({velocity:$,parent:G,anchorPoint:T,textIndex:N,textTotal:z,selectorValue:B,index:q,transform:a,loopOut:g,loop_out:k,loop_in:v,smooth:x,text:O,thisLayer:E,toWorld:b,fromWorld:P,fromComp:_,toComp:C,mask:A,fromCompToSurface:S,$bm_transform:h}),M=interpreter.run(e+";module.exports = $bm_rt")}catch(t){console.error(t)}return this.frameExpressionId=n.globalData.frameId,"shape"===M.propType&&(M=factory.clone(M.v)),M}}function searchExpressions(t,e,i){e.x&&(i.k=!0,i.x=!0,i.initiateExpression=ob$1.initiateExpression,i.effectsSequence.push(i.initiateExpression(t,e,i).bind(i)))}function getValueAtTime(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value}function getSpeedAtTime(t){var e=this.getValueAtTime(t),i=this.getValueAtTime(t+-.01),s=0;if(e.length){var r=void 0;for(r=0;r<e.length;r+=1)s+=Math.pow(i[r]-e[r],2);s=100*Math.sqrt(s)}else s=0;return s}function getVelocityAtTime(t){if(void 0!==this.vel)return this.vel;var e=this.getValueAtTime(t),i=this.getValueAtTime(t+-.001),s=void 0;if(e.length){s=createTypedArray("float32",e.length);var r=void 0;for(r=0;r<e.length;r+=1)s[r]=(i[r]-e[r])/-.001}else s=(i-e)/-.001;return s}function getStaticValueAtTime(){return this.pv}function setGroupProperty(t){this.propertyGroup=t}function loopOut(t,e,i){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var s=this.comp.renderedFrame,r=this.keyframes,a=r[r.length-1].t;if(s<=a)return this.pv;var n=void 0,o=void 0;i?o=a-(n=e?Math.abs(a-this.elem.comp.globalData.frameRate*e):Math.max(0,a-this.elem.data.ip)):((!e||e>r.length-1)&&(e=r.length-1),n=a-(o=r[r.length-1-e].t));var h=void 0,p=void 0,l=void 0;if("pingpong"===t){if(Math.floor((s-o)/n)%2!=0)return this.getValueAtTime((n-(s-o)%n+o)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var c=this.getValueAtTime(o/this.comp.globalData.frameRate,0),u=this.getValueAtTime(a/this.comp.globalData.frameRate,0),f=this.getValueAtTime(((s-o)%n+o)/this.comp.globalData.frameRate,0),d=Math.floor((s-o)/n);if(this.pv.length){for(p=(l=new Array(c.length)).length,h=0;h<p;h+=1)l[h]=(u[h]-c[h])*d+f[h];return l}return(u-c)*d+f}if("continue"===t){var m=this.getValueAtTime(a/this.comp.globalData.frameRate,0),y=this.getValueAtTime((a-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(p=(l=new Array(m.length)).length,h=0;h<p;h+=1)l[h]=m[h]+(m[h]-y[h])*((s-a)/this.comp.globalData.frameRate)/5e-4;return l}return m+(s-a)/.001*(m-y)}}return this.getValueAtTime(((s-o)%n+o)/this.comp.globalData.frameRate,0)}function loopIn(t,e,i){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var s=this.comp.renderedFrame,r=this.keyframes,a=r[0].t;if(a<=s)return this.pv;var n=void 0,o=void 0;i?o=a+(n=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-a)):((!e||e>r.length-1)&&(e=r.length-1),n=(o=r[e].t)-a);var h=void 0,p=void 0,l=void 0;if("pingpong"===t){if(Math.floor((a-s)/n)%2==0)return this.getValueAtTime(((a-s)%n+a)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var c=this.getValueAtTime(a/this.comp.globalData.frameRate,0),u=this.getValueAtTime(o/this.comp.globalData.frameRate,0),f=this.getValueAtTime((n-(a-s)%n+a)/this.comp.globalData.frameRate,0),d=Math.floor((a-s)/n)+1;if(this.pv.length){for(p=(l=new Array(c.length)).length,h=0;h<p;h+=1)l[h]=f[h]-(u[h]-c[h])*d;return l}return f-(u-c)*d}if("continue"===t){var m=this.getValueAtTime(a/this.comp.globalData.frameRate,0),y=this.getValueAtTime((a+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(p=(l=new Array(m.length)).length,h=0;h<p;h+=1)l[h]=m[h]+(m[h]-y[h])*(a-s)/.001;return l}return m+(m-y)*(a-s)/.001}}return this.getValueAtTime((n-(a-s)%n+a)/this.comp.globalData.frameRate,0)}function smooth(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var i=this.comp.renderedFrame/this.comp.globalData.frameRate,s=i-t,r=1<e?(i+t-s)/(e-1):1,a=0,n=0,o=void 0;o=this.pv.length?createTypedArray("float32",this.pv.length):0;for(var h=void 0;a<e;){if(h=this.getValueAtTime(s+a*r),this.pv.length)for(n=0;n<this.pv.length;n+=1)o[n]+=h[n];else o+=h;a+=1}if(this.pv.length)for(n=0;n<this.pv.length;n+=1)o[n]/=e;else o/=e;return o}function getShapeValueAtTime(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:factory.clone(this.pv),lastIndex:0,lastTime:-999999}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue}function GetProp(t,e,i){var o=i.value;return i.value=function(t,e,i,s,r){var a=o(t,e,i,s,r);a.kf?a.getValueAtTime=getValueAtTime.bind(a):a.getValueAtTime=getStaticValueAtTime.bind(a),a.setGroupProperty=setGroupProperty,a.loopOut=loopOut,a.loopIn=loopIn,a.smooth=smooth,a.getVelocityAtTime=getVelocityAtTime.bind(a),a.getSpeedAtTime=getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==i&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:-999999,lastIndex:0,value:n},searchExpressions(t,e,a),a.k&&r.addDynamicProperty(a),a},i}function GetShapeProp(t,e,i){var n=i.value;return i.value=function(t,e,i,s,r){var a=n(t,e,i,s,r);return a.propertyIndex=e.ix,a.lock=!1,3===i?searchExpressions(t,e.pt,a):4===i&&searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a},i}function getValueProxy(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}function TextExpressionSelectorProp(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ob$1.initiateExpression.bind(this)(t,e,this),this.getMult=getValueProxy,this.getVelocityAtTime=getVelocityAtTime,this.kf?this.getValueAtTime=getValueAtTime.bind(this):this.getValueAtTime=getStaticValueAtTime.bind(this),this.setGroupProperty=setGroupProperty}function GetTextSelectorProp(t,e,i){var s=i.value;return i.value=function(t,e,i){return 1===e.t?new TextExpressionSelectorProp(t,e,i):s(t,e,i)},i}ob$1.initiateExpression=initiateExpression;var bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function create$2(){return{lengths:[],totalLength:0}}function release$1(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}var segments_length_pool=pool_factory(8,create$2,release$1);function bezFunction(){function y(t,e,i,s,r,a){var n=t*s+e*r+i*a-r*s-a*t-i*e;return-.001<n&&n<.001}var l=function(t,e,i,s){var r,a=defaultCurveSegments,n=void 0,o=void 0,h=void 0,p=void 0,l=0,c=void 0,u=[],f=[],d=bezier_length_pool.newElement();for(r=i.length,n=0;n<a;n+=1){for(p=n/(a-1),o=c=0;o<r;o+=1)h=bm_pow(1-p,3)*t[o]+3*bm_pow(1-p,2)*p*i[o]+3*(1-p)*bm_pow(p,2)*s[o]+bm_pow(p,3)*e[o],u[o]=h,null!==f[o]&&(c+=bm_pow(u[o]-f[o],2)),f[o]=u[o];c&&(l+=c=bm_sqrt(c)),d.percents[n]=p,d.lengths[n]=l}return d.addedLength=l,d};function v(t){this.segmentLength=0,this.points=new Array(t)}function g(t,e){this.partialLength=t,this.point=e}var k,t=(k={},function(t,e,i,s){var r=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+i[0]+"_"+i[1]+"_"+s[0]+"_"+s[1]).replace(/\./g,"p");if(!k[r]){var a,n=defaultCurveSegments,o=void 0,h=void 0,p=void 0,l=void 0,c=0,u=void 0,f=void 0,d=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+i[0],t[1]+i[1])&&y(t[0],t[1],e[0],e[1],e[0]+s[0],e[1]+s[1])&&(n=2);var m=new v(n);for(a=i.length,o=0;o<n;o+=1){for(f=createSizedArray(a),l=o/(n-1),h=u=0;h<a;h+=1)p=bm_pow(1-l,3)*t[h]+3*bm_pow(1-l,2)*l*(t[h]+i[h])+3*(1-l)*bm_pow(l,2)*(e[h]+s[h])+bm_pow(l,3)*e[h],f[h]=p,null!==d&&(u+=bm_pow(f[h]-d[h],2));c+=u=bm_sqrt(u),m.points[o]=new g(u,f),d=f}m.segmentLength=c,k[r]=m}return k[r]});function w(t,e){var i=e.percents,s=e.lengths,r=i.length,a=bm_floor((r-1)*t),n=t*e.addedLength,o=0;if(a===r-1||0===a||n===s[a])return i[a];for(var h=s[a]>n?-1:1,p=!0;p;)if(s[a]<=n&&s[a+1]>n?(o=(n-s[a])/(s[a+1]-s[a]),p=!1):a+=h,a<0||r-1<=a){if(a===r-1)return i[a];p=!1}return i[a]+(i[a+1]-i[a])*o}var I=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e=segments_length_pool.newElement(),i=t.c,s=t.v,r=t.o,a=t.i,n=void 0,o=t._length,h=e.lengths,p=0;for(n=0;n<o-1;n+=1)h[n]=l(s[n],s[n+1],r[n],a[n+1]),p+=h[n].addedLength;return i&&(h[n]=l(s[n],s[0],r[n],a[0]),p+=h[n].addedLength),e.totalLength=p,e},getNewSegment:function(t,e,i,s,r,a,n){var o=w(r=r<0?0:1<r?1:r,n),h=w(a=1<a?1:a,n),p=void 0,l=t.length,c=1-o,u=1-h,f=c*c*c,d=o*c*c*3,m=o*o*c*3,y=o*o*o,v=c*c*u,g=o*c*u+c*o*u+c*c*h,k=o*o*u+c*o*h+o*c*h,x=o*o*h,b=c*u*u,P=o*u*u+c*h*u+c*u*h,_=o*h*u+c*h*h+o*u*h,C=o*h*h,S=u*u*u,T=h*u*u+u*h*u+u*u*h,E=h*h*u+u*h*h+h*u*h,A=h*h*h;for(p=0;p<l;p+=1)I[4*p]=Math.round(1e3*(f*t[p]+d*i[p]+m*s[p]+y*e[p]))/1e3,I[4*p+1]=Math.round(1e3*(v*t[p]+g*i[p]+k*s[p]+x*e[p]))/1e3,I[4*p+2]=Math.round(1e3*(b*t[p]+P*i[p]+_*s[p]+C*e[p]))/1e3,I[4*p+3]=Math.round(1e3*(S*t[p]+T*i[p]+E*s[p]+A*e[p]))/1e3;return I},getPointInSegment:function(t,e,i,s,r,a){var n=w(r,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*i[0]+(n*n*o+o*n*n+n*o*n)*s[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*i[1]+(n*n*o+o*n*n+n*o*n)*s[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,i,s,r,a,n,o,h){if(0===i&&0===a&&0===h)return y(t,e,s,r,n,o);var p=Math.sqrt(Math.pow(s-t,2)+Math.pow(r-e,2)+Math.pow(a-i,2)),l=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-i,2)),c=Math.sqrt(Math.pow(n-s,2)+Math.pow(o-r,2)+Math.pow(h-a,2)),u=void 0;return-1e-4<(u=l<p?c<p?p-l-c:c-l-p:l<c?c-l-p:l-p-c)&&u<1e-4}}}var _class,bez=bezFunction();function _applyDecoratedDescriptor(i,s,t,e,r){var a={};return Object.keys(e).forEach(function(t){a[t]=e[t]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=t.slice().reverse().reduce(function(t,e){return e(i,s,t)||t},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(i,s,a),a=null),a}var initFrame=-999999,math_abs=Math.abs,degToRads$1=Math/180;function interpolateValue(t,e){var i=this.offsetTime,s=void 0;"multidimensional"===this.propType&&(s=createTypedArray("float32",this.pv.length));for(var r=e.lastIndex,a=r,n=this.keyframes.length-1,o=!0,h=void 0,p=void 0;o;){if(h=this.keyframes[a],p=this.keyframes[a+1],a===n-1&&t>=p.t-i){h.h&&(h=p),r=0;break}if(p.t-i>t){r=a;break}a<n-1?a+=1:(r=0,o=!1)}var l=void 0,c=void 0,u=void 0,f=void 0,d=void 0,m=void 0,y=p.t-i,v=h.t-i,g=void 0;if(h.to){h.bezierData||(h.bezierData=bez.buildBezierData(h.s,p.s||h.e,h.to,h.ti));var k=h.bezierData;if(y<=t||t<v){var x=y<=t?k.points.length-1:0;for(c=k.points[x].point.length,l=0;l<c;l+=1)s[l]=k.points[x].point[l]}else{h.__fnct?m=h.__fnct:(m=ob.getBezierEasing(h.o.x,h.o.y,h.i.x,h.i.y,h.n).get,h.__fnct=m),u=m((t-v)/(y-v));var b=k.segmentLength*u,P=void 0,_=e.lastFrame<t&&e._lastKeyframeIndex===a?e._lastAddedLength:0;for(d=e.lastFrame<t&&e._lastKeyframeIndex===a?e._lastPoint:0,o=!0,f=k.points.length;o;){if(_+=k.points[d].partialLength,0==b||0===u||d===k.points.length-1){for(c=k.points[d].point.length,l=0;l<c;l+=1)s[l]=k.points[d].point[l];break}if(_<=b&&b<_+k.points[d+1].partialLength){for(P=(b-_)/k.points[d+1].partialLength,c=k.points[d].point.length,l=0;l<c;l+=1)s[l]=k.points[d].point[l]+(k.points[d+1].point[l]-k.points[d].point[l])*P;break}d<f-1?d+=1:o=!1}e._lastPoint=d,e._lastAddedLength=_-k.points[d].partialLength,e._lastKeyframeIndex=a}}else{var C=void 0,S=void 0,T=void 0,E=void 0,A=void 0;if(n=h.s.length,g=p.s||h.e,this.sh&&1!==h.h)if(y<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=v)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else{quaternionToEuler(s,slerp(createQuaternion(h.s),createQuaternion(g),(t-v)/(y-v)))}else for(a=0;a<n;a+=1)1!==h.h&&(u=y<=t?1:t<v?0:(h.o.x.constructor===Array?(h.__fnct||(h.__fnct=[]),h.__fnct[a]?m=h.__fnct[a]:(C=void 0===h.o.x[a]?h.o.x[0]:h.o.x[a],S=void 0===h.o.y[a]?h.o.y[0]:h.o.y[a],T=void 0===h.i.x[a]?h.i.x[0]:h.i.x[a],E=void 0===h.i.y[a]?h.i.y[0]:h.i.y[a],m=ob.getBezierEasing(C,S,T,E).get,h.__fnct[a]=m)):h.__fnct?m=h.__fnct:(C=h.o.x,S=h.o.y,T=h.i.x,E=h.i.y,m=ob.getBezierEasing(C,S,T,E).get,h.__fnct=m),m((t-v)/(y-v)))),g=p.s||h.e,A=1===h.h?h.s[a]:h.s[a]+(g[a]-h.s[a])*u,1===n?s=A:s[a]=A}return e.lastIndex=r,s}function slerp(t,e,i){var s=[],r=t[0],a=t[1],n=t[2],o=t[3],h=e[0],p=e[1],l=e[2],c=e[3],u=void 0,f=void 0,d=void 0,m=void 0,y=void 0;return(f=r*h+a*p+n*l+o*c)<0&&(f=-f,h=-h,p=-p,l=-l,c=-c),y=1e-6<1-f?(u=Math.acos(f),d=Math.sin(u),m=Math.sin((1-i)*u)/d,Math.sin(i*u)/d):(m=1-i,i),s[0]=m*r+y*h,s[1]=m*a+y*p,s[2]=m*n+y*l,s[3]=m*o+y*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),o=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads$1,t[1]=o/degToRads$1,t[2]=h/degToRads$1}function createQuaternion(t){var e=t[0]*degToRads$1,i=t[1]*degToRads$1,s=t[2]*degToRads$1,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),o=Math.sin(e/2),h=Math.sin(i/2),p=Math.sin(s/2);return[o*h*n+r*a*p,o*a*n+r*h*p,r*h*n-o*a*p,r*a*n-o*h*p]}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&&i<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastIndex=this._caching.lastFrame<t?this._caching.lastIndex:0;var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e=void 0;if("unidimensional"===this.propType)e=t*this.mult,1e-5<math_abs(this.v-e)&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i<s;)e=t[i]*this.mult,1e-5<math_abs(this.v[i]-e)&&(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);else{this.lock=!0,this._mdf=this._isFirstFrame;var t=void 0,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,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=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(t,e,i,s){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=void 0,a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),r=0;r<a;r+=1)this.v[r]=e.k[r]*this.mult,this.pv[r]=e.k[r];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(t,e,i,s){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=s,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,s){this.propType="multidimensional";var r=void 0,a=e.k.length,n=void 0,o=void 0,h=void 0,p=void 0;for(r=0;r<a-1;r+=1)e.k[r].to&&e.k[r].s&&e.k[r].e&&(n=e.k[r].s,o=e.k[r].e,h=e.k[r].to,p=e.k[r].ti,(2===n.length&&(n[0]!==o[0]||n[1]!==o[1])&&bez.pointOnLine2D(n[0],n[1],o[0],o[1],n[0]+h[0],n[1]+h[1])&&bez.pointOnLine2D(n[0],n[1],o[0],o[1],o[0]+p[0],o[1]+p[1])||3===n.length&&(n[0]!==o[0]||n[1]!==o[1]||n[2]!==o[2])&&bez.pointOnLine3D(n[0],n[1],n[2],o[0],o[1],o[2],n[0]+h[0],n[1]+h[1],n[2]+h[2])&&bez.pointOnLine3D(n[0],n[1],n[2],o[0],o[1],o[2],o[0]+p[0],o[1]+p[1],o[2]+p[2]))&&(e.k[r].to=null,e.k[r].ti=null),n[0]===o[0]&&n[1]===o[1]&&0===h[0]&&0===h[1]&&0===p[0]&&0===p[1]&&(2===n.length||n[2]===o[2]&&0===h[2]&&0===p[2])&&(e.k[r].to=null,e.k[r].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var l=e.k[0].s.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),r=0;r<l;r+=1)this.v[r]=initFrame,this.pv[r]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",l)},this.addEffect=addEffect}var PropertyFactory=(_applyDecoratedDescriptor((_class=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"getProp",value:function(t,e,i,s,r){var a=void 0;if(e.k.length)if("number"==typeof e.k[0])a=new MultiDimensionalProperty(t,e,s,r);else switch(i){case 0:a=new KeyframedValueProperty(t,e,s,r);break;case 1:a=new KeyframedMultidimensionalProperty(t,e,s,r)}else a=new ValueProperty(t,e,s,r);return a.effectsSequence.length&&r.addDynamicProperty(a),a}}]),t}()).prototype,"getProp",[GetProp],Object.getOwnPropertyDescriptor(_class.prototype,"getProp"),_class.prototype),_class),PropertyFactory$1=new PropertyFactory;function SliderEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,0,0,i)}function AngleEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,0,0,i)}function ColorEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,1,0,i)}function PointEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,1,0,i)}function LayerIndexEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,0,0,i)}function MaskIndexEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,0,0,i)}function CheckboxEffect(t,e,i){this.p=PropertyFactory$1.getProp(e,t.v,0,0,i)}function NoValueEffect(){this.p={}}var DynamicPropertyContainer=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"addDynamicProperty",value:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)}},{key:"iterateDynamicProperties",value:function(){this._mdf=!1;var t=void 0,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)}},{key:"initDynamicPropertyContainer",value:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}}]),t}();function EffectsManager(t,e){var i=t.ef||[];this.effectElements=[];var s=void 0,r=i.length,a=void 0;for(s=0;s<r;s++)a=new GroupEffect(i[s],e),this.effectElements.push(a)}var GroupEffect=function(){function s(t,e){classCallCheck(this,s);var i=possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return i.init(t,e),i}return inherits(s,DynamicPropertyContainer),createClass(s,[{key:"init",value:function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i=void 0,s=this.data.ef.length,r=void 0,a=this.data.ef;for(i=0;i<s;i+=1){switch(r=null,a[i].ty){case 0:r=new SliderEffect(a[i],e,this);break;case 1:r=new AngleEffect(a[i],e,this);break;case 2:r=new ColorEffect(a[i],e,this);break;case 3:r=new PointEffect(a[i],e,this);break;case 4:case 7:r=new CheckboxEffect(a[i],e,this);break;case 10:r=new LayerIndexEffect(a[i],e,this);break;case 11:r=new MaskIndexEffect(a[i],e,this);break;case 5:r=new EffectsManager(a[i],e,this);break;default:r=new NoValueEffect(a[i],e,this)}r&&this.effectElements.push(r)}}}]),s}();function MaskInterface(t,e){this._mask=t,this._data=e}function MaskManagerInterface(e){var i=createSizedArray(e.viewData.length),s=void 0,r=e.viewData.length;for(s=0;s<r;s+=1)i[s]=new MaskInterface(e.viewData[s],e.masksProperties[s]);return function(t){for(s=0;s<r;){if(e.masksProperties[s].nm===t)return i[s];s+=1}}}GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,Object.defineProperty(MaskInterface.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}});var defaultUnidimensionalValue={pv:0,v:0,mult:1},defaultMultidimensionalValue={pv:[0,0,0],v:[0,0,0],mult:1};function completeProperty(s,r,a){Object.defineProperty(s,"velocity",{get:function(){return r.getVelocityAtTime(r.comp.currentFrame)}}),s.numKeys=r.keyframes?r.keyframes.length:0,s.key=function(t){if(!s.numKeys)return 0;var e="";e="s"in r.keyframes[t-1]?r.keyframes[t-1].s:"e"in r.keyframes[t-2]?r.keyframes[t-2].e:r.keyframes[t-2].s;var i="unidimensional"===a?new Number(e):_extends({},e);return i.time=r.keyframes[t-1].t/r.elem.comp.globalData.frameRate,i},s.valueAtTime=r.getValueAtTime,s.speedAtTime=r.getSpeedAtTime,s.velocityAtTime=r.getVelocityAtTime,s.propertyGroup=r.propertyGroup}function UnidimensionalPropertyInterface(t){t&&"pv"in t||(t=defaultUnidimensionalValue);var e=1/t.mult,i=t.pv*e,s=new Number(i);return s.value=i,completeProperty(s,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*e,s.value!==i&&((s=new Number(i)).value=i,completeProperty(s,t,"unidimensional")),s}}function MultidimensionalPropertyInterface(e){e&&"pv"in e||(e=defaultMultidimensionalValue);var i=1/e.mult,s=e.pv.length,r=createTypedArray("float32",s),a=createTypedArray("float32",s);return r.value=a,completeProperty(r,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<s;t+=1)r[t]=a[t]=e.v[t]*i;return r}}function defaultGetter(){return defaultUnidimensionalValue}function ExpressionPropertyInterface(t){return t?"unidimensional"===t.propType?UnidimensionalPropertyInterface(t):MultidimensionalPropertyInterface(t):defaultGetter}var TextExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)});var i=void 0;return t.p&&(i=ExpressionPropertyInterface(t.p)),Object.defineProperty(e,"position",{get:function(){return t.p?i():[t.px.v,t.py.v,t.pz?t.pz.v:0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e};function toWorld(t,e){var i=new Matrix;i.reset();if(this._elem.finalTransform.mProp.applyToMatrix(i),this._elem.hierarchy&&this._elem.hierarchy.length){var s=void 0,r=this._elem.hierarchy.length;for(s=0;s<r;s+=1)this._elem.hierarchy[s].finalTransform.mProp.applyToMatrix(i);return i.applyToPointArray(t[0],t[1],t[2]||0)}return i.applyToPointArray(t[0],t[1],t[2]||0)}function fromWorld(t,e){var i=new Matrix;i.reset();if(this._elem.finalTransform.mProp.applyToMatrix(i),this._elem.hierarchy&&this._elem.hierarchy.length){var s=void 0,r=this._elem.hierarchy.length;for(s=0;s<r;s+=1)this._elem.hierarchy[s].finalTransform.mProp.applyToMatrix(i);return i.inversePoint(t)}return i.inversePoint(t)}function fromComp(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var i=void 0,s=this._elem.hierarchy.length;for(i=0;i<s;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function sampleImage(){return[1,1,1,1]}function LayerExpressionInterface(e){var i=void 0;function s(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return s.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return i;case 4:case"ADBE Effect Parade":return s.effect}}s.toWorld=toWorld,s.fromWorld=fromWorld,s.toComp=toWorld,s.fromComp=fromComp,s.sampleImage=sampleImage,s.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(i=TextExpressionInterface((s._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(s,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(i,"rotation"),scale:getDescriptor(i,"scale"),position:getDescriptor(i,"position"),opacity:getDescriptor(i,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return i}},active:{get:function(){return e.isInRange}}}),s.startTime=e.data.st,s.index=e.data.ind,s.source=e.data.refId,s.height=0===e.data.ty?e.data.h:100,s.width=0===e.data.ty?e.data.w:100,s.registerMaskInterface=function(t){s.mask=new MaskManagerInterface(t,e)},s.registerEffectsInterface=function(t){s.effect=t},s}function createEffectsInterface(i,t){if(i.effectsManager){var s=[],e=i.data.ef,r=void 0,a=i.effectsManager.effectElements.length;for(r=0;r<a;r+=1)s.push(createGroupInterface(e[r],i.effectsManager.effectElements[r],t,i));return function(t){for(var e=i.data.ef||[];r<a;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return s[r];r+=1}}}}function createGroupInterface(i,t,e,s){var r=[],a=void 0,n=i.ef.length;for(a=0;a<n;a+=1)5===i.ef[a].ty?r.push(createGroupInterface(i.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,s)):r.push(createValueInterface(t.effectElements[a],i.ef[a].ty,s,h));var o=function(t){for(var e=i.ef;a<n;){if(t===e[a].nm||t===e[a].mn||t===e[a].ix)return 5===e[a].ty?r[a]:r[a]();a+=1}return r[0]()};function h(t){return 1===t?o:e(t-1)}return o.propertyGroup=h,"ADBE Color Control"===i.mn&&Object.defineProperty(o,"color",{get:function(){return r[0]()}}),Object.defineProperty(o,"numProperties",{get:function(){return i.np}}),o.active=o.enabled=0!==i.en,o}function createValueInterface(t,e,i,s){var r=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(s),function(){return 10===e?i.comp.compInterface(t.p.v):r()}}var ob$2={createEffectsInterface:createEffectsInterface};function iterateElements(t,e,i){var s=[],r=void 0,a=t?t.length:0;for(r=0;r<a;r+=1)"gr"===t[r].ty?s.push(groupInterfaceFactory(t[r],e[r],i)):"fl"===t[r].ty?s.push(fillInterfaceFactory(t[r],e[r],i)):"st"===t[r].ty?s.push(strokeInterfaceFactory(t[r],e[r],i)):"tm"===t[r].ty?s.push(trimInterfaceFactory(t[r],e[r],i)):"tr"===t[r].ty||("el"===t[r].ty?s.push(ellipseInterfaceFactory(t[r],e[r],i)):"sr"===t[r].ty?s.push(starInterfaceFactory(t[r],e[r],i)):"sh"===t[r].ty?s.push(pathInterfaceFactory(t[r],e[r],i)):"rc"===t[r].ty?s.push(rectInterfaceFactory(t[r],e[r],i)):"rd"===t[r].ty?s.push(roundedInterfaceFactory(t[r],e[r],i)):"rp"===t[r].ty&&s.push(repeaterInterfaceFactory(t[r],e[r],i)));return s}function contentsInterfaceFactory(t,e,i){function s(t){for(var e=0,i=r.length;e<i;){if(r[e]._name===t||r[e].mn===t||r[e].propertyIndex===t||r[e].ix===t||r[e].ind===t)return r[e];e+=1}if("number"==typeof t)return r[t-1]}var r=void 0;return s.propertyGroup=function(t){return 1===t?s:i(t-1)},r=iterateElements(t.it,e.it,s.propertyGroup),s.numProperties=r.length,s.propertyIndex=t.cix,s._name=t.nm,s}function groupInterfaceFactory(t,e,i){var s=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return s.content;default:return s.transform}};s.propertyGroup=function(t){return 1===t?s:i(t-1)};var r=contentsInterfaceFactory(t,e,s.propertyGroup),a=transformInterfaceFactory(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.content=r,s.transform=a,Object.defineProperty(s,"_name",{get:function(){return t.nm}}),s.numProperties=t.np,s.propertyIndex=t.ix,s.nm=t.nm,s.mn=t.mn,s}function fillInterfaceFactory(t,e,i){function s(t){return"Color"===t||"color"===t?s.color:"Opacity"===t||"opacity"===t?s.opacity:void 0}return Object.defineProperties(s,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(i),e.o.setGroupProperty(i),s}var ob$3={};function strokeInterfaceFactory(t,e,i){function s(t){return 1===t?ob$3:i(t-1)}function r(t){return 1===t?h:s(t-1)}var a,n=void 0,o=t.d?t.d.length:0,h={};for(n=0;n<o;n+=1)a=n,Object.defineProperty(h,t.d[a].nm,{get:ExpressionPropertyInterface(e.d.dataProps[a].p)}),e.d.dataProps[n].p.setGroupProperty(r);function p(t){return"Color"===t||"color"===t?p.color:"Opacity"===t||"opacity"===t?p.opacity:"Stroke Width"===t||"stroke width"===t?p.strokeWidth:void 0}return Object.defineProperties(p,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(s),e.o.setGroupProperty(s),e.w.setGroupProperty(s),p}function trimInterfaceFactory(e,t,i){function s(t){return 1===t?r:i(--t)}function r(t){return t===e.e.ix||"End"===t||"end"===t?r.end:t===e.s.ix?r.start:t===e.o.ix?r.offset:void 0}return r.propertyIndex=e.ix,t.s.setGroupProperty(s),t.e.setGroupProperty(s),t.o.setGroupProperty(s),r.propertyIndex=e.ix,r.propertyGroup=i,Object.defineProperties(r,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),r.mn=e.mn,r}function transformInterfaceFactory(e,t,i){function s(t){return 1===t?r:i(--t)}function r(t){return e.a.ix===t||"Anchor Point"===t?r.anchorPoint:e.o.ix===t||"Opacity"===t?r.opacity:e.p.ix===t||"Position"===t?r.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?r.rotation:e.s.ix===t||"Scale"===t?r.scale:e.sk&&e.sk.ix===t||"Skew"===t?r.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?r.skewAxis:void 0}return t.transform.mProps.o.setGroupProperty(s),t.transform.mProps.p.setGroupProperty(s),t.transform.mProps.a.setGroupProperty(s),t.transform.mProps.s.setGroupProperty(s),t.transform.mProps.r.setGroupProperty(s),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(s),t.transform.mProps.sa.setGroupProperty(s)),t.transform.op.setGroupProperty(s),Object.defineProperties(r,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),r.ty="tr",r.mn=e.mn,r.propertyGroup=i,r}function ellipseInterfaceFactory(e,t,i){function s(t){return 1===t?a:i(--t)}a.propertyIndex=e.ix;var r="tm"===t.sh.ty?t.sh.prop:t.sh;function a(t){return e.p.ix===t?a.position:e.s.ix===t?a.size:void 0}return r.s.setGroupProperty(s),r.p.setGroupProperty(s),Object.defineProperties(a,{size:{get:ExpressionPropertyInterface(r.s)},position:{get:ExpressionPropertyInterface(r.p)},_name:{value:e.nm}}),a.mn=e.mn,a}function starInterfaceFactory(e,t,i){function s(t){return 1===t?a:i(--t)}var r="tm"===t.sh.ty?t.sh.prop:t.sh;function a(t){return e.p.ix===t?a.position:e.r.ix===t?a.rotation:e.pt.ix===t?a.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?a.outerRadius:e.os.ix===t?a.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?a.innerRoundness:void 0:a.innerRadius}return a.propertyIndex=e.ix,r.or.setGroupProperty(s),r.os.setGroupProperty(s),r.pt.setGroupProperty(s),r.p.setGroupProperty(s),r.r.setGroupProperty(s),e.ir&&(r.ir.setGroupProperty(s),r.is.setGroupProperty(s)),Object.defineProperties(a,{position:{get:ExpressionPropertyInterface(r.p)},rotation:{get:ExpressionPropertyInterface(r.r)},points:{get:ExpressionPropertyInterface(r.pt)},outerRadius:{get:ExpressionPropertyInterface(r.or)},outerRoundness:{get:ExpressionPropertyInterface(r.os)},innerRadius:{get:ExpressionPropertyInterface(r.ir)},innerRoundness:{get:ExpressionPropertyInterface(r.is)},_name:{value:e.nm}}),a.mn=e.mn,a}function rectInterfaceFactory(e,t,i){function s(t){return 1===t?a:i(--t)}var r="tm"===t.sh.ty?t.sh.prop:t.sh;function a(t){return e.p.ix===t?a.position:e.r.ix===t?a.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?a.size:void 0}return a.propertyIndex=e.ix,r.p.setGroupProperty(s),r.s.setGroupProperty(s),r.r.setGroupProperty(s),Object.defineProperties(a,{position:{get:ExpressionPropertyInterface(r.p)},roundness:{get:ExpressionPropertyInterface(r.r)},size:{get:ExpressionPropertyInterface(r.s)},_name:{value:e.nm}}),a.mn=e.mn,a}function roundedInterfaceFactory(e,t,i){var s=t;function r(t){if(e.r.ix===t||"Round Corners 1"===t)return r.radius}return r.propertyIndex=e.ix,s.rd.setGroupProperty(function(t){return 1===t?r:i(--t)}),Object.defineProperties(r,{radius:{get:ExpressionPropertyInterface(s.rd)},_name:{value:e.nm}}),r.mn=e.mn,r}function repeaterInterfaceFactory(e,t,i){function s(t){return 1===t?a:i(--t)}var r=t;function a(t){return e.c.ix===t||"Copies"===t?a.copies:e.o.ix===t||"Offset"===t?a.offset:void 0}return a.propertyIndex=e.ix,r.c.setGroupProperty(s),r.o.setGroupProperty(s),Object.defineProperties(a,{copies:{get:ExpressionPropertyInterface(r.c)},offset:{get:ExpressionPropertyInterface(r.o)},_name:{value:e.nm}}),a.mn=e.mn,a}function pathInterfaceFactory(t,e,i){var s=e.sh;function r(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return r.path}return s.setGroupProperty(function(t){return 1===t?r:i(--t)}),Object.defineProperties(r,{path:{get:function(){return s.k&&s.getValue(),s}},shape:{get:function(){return s.k&&s.getValue(),s}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn}}),r}function ShapeExpressionInterface(t,e,i){var s=void 0;function r(t){if("number"==typeof t)return s[t-1];for(var e=0,i=s.length;e<i;){if(s[e]._name===t)return s[e];e+=1}}return r.propertyGroup=i,s=iterateElements(t,e,r),r.numProperties=s.length,r}function CompExpressionInterface(s){function t(t){for(var e=0,i=s.layers.length;e<i;){if(s.layers[e].nm===t||s.layers[e].ind===t)return s.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:s.data.nm}),(t.layer=t).pixelAspect=1,t.height=s.data.h||s.globalData.compSize.h,t.width=s.data.w||s.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/s.globalData.frameRate,t.displayStartTime=0,t.numLayers=s.layers.length,t}var BaseElement=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"checkMasks",value:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1}},{key:"initExpressions",value:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=ob$2.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)}},{key:"getBlendMode",value:function(){return this.blendModeEnums[this.data.bm]||""}},{key:"setBlendMode",value:function(){var t=this.getBlendMode();(this.baseElement||this.layerElement).style["mix-blend-mode"]=t}},{key:"initBaseData",value:function(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId="ly_"+randomString(10),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)}},{key:"getType",value:function(){return this.type}},{key:"blendModeEnums",get:function(){return{1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"}}}]),t}(),degToRads$2=Math.PI/180,TransformProperty=function(){function n(t,e,i){classCallCheck(this,n);var s=possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));if(s.elem=t,s.frameId=-1,s.propType="transform",s.data=e,s.v=new Matrix,s.pre=new Matrix,s.appliedTransformations=0,s.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(s.px=PropertyFactory$1.getProp(t,e.p.x,0,0,s),s.py=PropertyFactory$1.getProp(t,e.p.y,0,0,s),e.p.z&&(s.pz=PropertyFactory$1.getProp(t,e.p.z,0,0,s))):s.p=PropertyFactory$1.getProp(t,e.p||{k:[0,0,0]},1,0,s),e.rx){if(s.rx=PropertyFactory$1.getProp(t,e.rx,0,degToRads$2,s),s.ry=PropertyFactory$1.getProp(t,e.ry,0,degToRads$2,s),s.rz=PropertyFactory$1.getProp(t,e.rz,0,degToRads$2,s),e.or.k[0].ti){var r=void 0,a=e.or.k.length;for(r=0;r<a;r+=1)e.or.k[r].to=e.or.k[r].ti=null}s.or=PropertyFactory$1.getProp(t,e.or,1,degToRads$2,s),s.or.sh=!0}else s.r=PropertyFactory$1.getProp(t,e.r||{k:0},0,degToRads$2,s);return e.sk&&(s.sk=PropertyFactory$1.getProp(t,e.sk,0,degToRads$2,s),s.sa=PropertyFactory$1.getProp(t,e.sa,0,degToRads$2,s)),s.a=PropertyFactory$1.getProp(t,e.a||{k:[0,0,0]},1,0,s),s.s=PropertyFactory$1.getProp(t,e.s||{k:[100,100,100]},1,.01,s),e.o?s.o=PropertyFactory$1.getProp(t,e.o,0,.01,t):s.o={_mdf:!1,v:1},s._isDirty=!0,s.dynamicProperties.length||s.getValue(!0),s}return inherits(n,DynamicPropertyContainer),createClass(n,[{key:"applyToMatrix",value:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}},{key:"getValue",value:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var e=void 0,i=void 0,s=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/s,0),this.p.getValueAtTime(this.p.keyframes[0].t/s,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/s,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.01)/s,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/s,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],i=[];var r=this.px,a=this.py;r._caching.lastFrame+r.offsetTime<=r.keyframes[0].t?(e[0]=r.getValueAtTime((r.keyframes[0].t+.01)/s,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/s,0),i[0]=r.getValueAtTime(r.keyframes[0].t/s,0),i[1]=a.getValueAtTime(a.keyframes[0].t/s,0)):r._caching.lastFrame+r.offsetTime>=r.keyframes[r.keyframes.length-1].t?(e[0]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/s,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/s,0),i[0]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/s,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/s,0)):(e=[r.pv,a.pv],i[0]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/s,r.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/s,a.offsetTime))}this.v.rotate(-Math.atan2(e[1]-i[1],e[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}},{key:"precalculateMatrix",value:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}}},{key:"autoOrient",value:function(){}},{key:"addDynamicProperty",value:function(t){get(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"addDynamicProperty",this).call(this,t),this.elem.addDynamicProperty(t),this._isDirty=!0}}]),n}();TransformProperty.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty;var TransformPropertyFactory={getTransformProperty:function(t,e,i){return new TransformProperty(t,e,i)}},TransformElement=function(){function t(){classCallCheck(this,t),this.mHelper=new Matrix}return createClass(t,[{key:"initTransform",value:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty}},{key:"renderTransform",value:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t=void 0,e=this.finalTransform.mat,i=0,s=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<s;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<s;i+=1)t=this.hierarchy[i].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}}},{key:"globalToLocal",value:function(t){var e=[];e.push(this.finalTransform);for(var i=!0,s=this.comp;i;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):i=!1;var r=void 0,a=e.length,n=void 0;for(r=0;r<a;r+=1)n=e[r].mat.applyToPointArray(0,0,0),t=[t[0]-n[0],t[1]-n[1],0];return t}}]),t}(),HierarchyElement=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"initHierarchy",value:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()}},{key:"setHierarchy",value:function(t){this.hierarchy=t}},{key:"setAsParent",value:function(){this._isParent=!0}},{key:"checkParenting",value:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}}]),t}(),FrameElement=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"initFrame",value:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1}},{key:"prepareProperties",value:function(t,e){var i=void 0,s=this.dynamicProperties.length;for(i=0;i<s;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))}},{key:"addDynamicProperty",value:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}}]),t}(),RenderableElement=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"initRenderable",value:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]}},{key:"addRenderableComponent",value:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)}},{key:"removeRenderableComponent",value:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)}},{key:"prepareRenderableFrame",value:function(t){this.checkLayerLimits(t)}},{key:"checkTransparency",value:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())}},{key:"checkLayerLimits",value:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())}},{key:"renderRenderable",value:function(){var t=void 0,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)}},{key:"sourceRectAtTime",value:function(){return{top:0,left:0,width:100,height:100}}},{key:"getLayerSize",value:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}}]),t}(),RenderableDOMElement=function(){function t(){return classCallCheck(this,t),possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return inherits(t,RenderableElement),createClass(t,[{key:"initElement",value:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide()}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"renderFrame",value:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))}},{key:"renderInnerContent",value:function(){}},{key:"prepareFrame",value:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()}},{key:"destroy",value:function(){this.innerElem=null,this.destroyBaseElement()}}]),t}(),ICompElement=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return inherits(e,t),createClass(e,[{key:"initElement",value:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()}},{key:"prepareFrame",value:function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i=void 0,s=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=s-1;0<=i;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}}},{key:"renderInnerContent",value:function(){var t=void 0,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},{key:"setElements",value:function(t){this.elements=t}},{key:"getElements",value:function(){return this.elements}},{key:"destroyElements",value:function(){var t=void 0,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()}},{key:"destroy",value:function(){this.destroyElements(),this.destroyBaseElement()}}]),e}(Mixin(BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement)),CVEffects=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"renderFrame",value:function(){}}]),t}(),initFrame$1=-9999;function interpolateShape(t,e,i){var s,r,a=i.lastIndex,n=void 0,o=void 0,h=void 0,p=void 0,l=void 0,c=void 0,u=void 0,f=this.keyframes;if(t<f[0].t-this.offsetTime)n=f[0].s[0],h=!0,a=0;else if(t>=f[f.length-1].t-this.offsetTime)n=f[f.length-1].s?f[f.length-1].s[0]:f[f.length-2].e[0],h=!0;else{for(var d=a,m=f.length-1,y=!0,v=void 0,g=void 0;y&&(v=f[d],!((g=f[d+1]).t-this.offsetTime>t));)d<m-1?d+=1:y=!1;if(a=d,!(h=1===v.h)){if(t>=g.t-this.offsetTime)c=1;else if(t<v.t-this.offsetTime)c=0;else{var k=void 0;v.__fnct?k=v.__fnct:(k=ob.getBezierEasing(v.o.x,v.o.y,v.i.x,v.i.y).get,v.__fnct=k),c=k((t-(v.t-this.offsetTime))/(g.t-this.offsetTime-(v.t-this.offsetTime)))}o=g.s?g.s[0]:v.e[0]}n=v.s[0]}for(s=e._length,r=n.i[0].length,i.lastIndex=a,p=0;p<s;p+=1)for(l=0;l<r;l+=1)u=h?n.i[p][l]:n.i[p][l]+(o.i[p][l]-n.i[p][l])*c,e.i[p][l]=u,u=h?n.o[p][l]:n.o[p][l]+(o.o[p][l]-n.o[p][l])*c,e.o[p][l]=u,u=h?n.v[p][l]:n.v[p][l]+(o.v[p][l]-n.v[p][l])*c,e.v[p][l]=u}function interpolateShapeCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime,s=this._caching.lastFrame;return s!==initFrame$1&&(s<e&&t<e||i<s&&i<t)||(this._caching.lastIndex=s<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function resetShape(){this.paths=this.localShapeCollection}function shapesEqual(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i=void 0,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 setVValue$1(t){shapesEqual(this.v,t)||(this.v=factory.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function processEffectsSequence$1(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,e=void 0,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 addEffect$1(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}var ShapeCollection=function(){function t(){classCallCheck(this,t),this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}return createClass(t,[{key:"addShape",value:function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1}},{key:"releaseShapes",value:function(){var t=void 0;for(t=0;t<this._length;t+=1)factory.release(this.shapes[t]);this._length=0}}]),t}(),_length=0,_maxLength=4,pool=createSizedArray(_maxLength);function newShapeCollection(){return _length?pool[_length-=1]:new ShapeCollection}function release$2(t){var e=void 0,i=t._length;for(e=0;e<i;e+=1)factory.release(t.shapes[e]);t._length=0,_length===_maxLength&&(pool=pooling.double(pool),_maxLength*=2),pool[_length]=t,_length+=1}var ob$4={newShapeCollection:newShapeCollection,release:release$2},ShapeExpressions=function(){function t(){classCallCheck(this,t),this.setGroupProperty=setGroupProperty,this.getValueAtTime=getStaticValueAtTime}return createClass(t,[{key:"vertices",value:function(t,e){this.k&&this.getValue();var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var s=void 0,r=i._length,a=i[t],n=i.v,o=createSizedArray(r);for(s=0;s<r;s+=1)o[s]="i"===t||"o"===t?[a[s][0]-n[s][0],a[s][1]-n[s][1]]:[a[s][0],a[s][1]];return o}},{key:"points",value:function(t){return this.vertices("v",t)}},{key:"inTangents",value:function(t){return this.vertices("i",t)}},{key:"outTangents",value:function(t){return this.vertices("o",t)}},{key:"isClosed",value:function(){return this.v.c}},{key:"pointOnPath",value:function(t,e){var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(i));for(var s=this._segmentsLength,r=s.lengths,a=s.totalLength*t,n=0,o=r.length,h=0,p=void 0;n<o;){if(h+r[n].addedLength>a){var l=n,c=i.c&&n===o-1?0:n+1,u=(a-h)/r[n].addedLength;p=bez.getPointInSegment(i.v[l],i.v[c],i.o[l],i.i[c],u,r[n]);break}h+=r[n].addedLength,n+=1}return p=p||(i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]])}},{key:"vectorOnPath",value:function(t,e,i){t=1===t?this.v.c?0:.999:t;var s=this.pointOnPath(t,e),r=this.pointOnPath(t+.001,e),a=r[0]-s[0],n=r[1]-s[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===i?[a/o,n/o]:[-n/o,a/o]}},{key:"tangentOnPath",value:function(t,e){return this.vectorOnPath(t,e,"tangent")}},{key:"normalOnPath",value:function(t,e){return this.vectorOnPath(t,e,"normal")}}]),t}(),KeyframedShapeProperty=function(){function a(t,e,i){classCallCheck(this,a);var s=possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));s.getShapeValueAtTime=getShapeValueAtTime,s.initiateExpression=ob$1.initiateExpression,s.propType="shape",s.comp=t.comp,s.elem=t,s.container=t,s.offsetTime=t.data.st,s.keyframes=3===i?e.pt.k:e.ks.k,s.k=!0,s.kf=!0;var r=s.keyframes[0].s[0].i.length;return s.v=factory.newElement(),s.v.setPathData(s.keyframes[0].s[0].c,r),s.pv=factory.clone(s.v),s.localShapeCollection=ob$4.newShapeCollection(),s.paths=s.localShapeCollection,s.paths.addShape(s.v),s.lastFrame=initFrame$1,s.reset=resetShape,s._caching={lastFrame:initFrame$1,lastIndex:0},s.effectsSequence=[interpolateShapeCurrentTime.bind(s)],s}return inherits(a,ShapeExpressions),a}();KeyframedShapeProperty.prototype.getValue=processEffectsSequence$1,KeyframedShapeProperty.prototype.interpolateShape=interpolateShape,KeyframedShapeProperty.prototype.setVValue=setVValue$1,KeyframedShapeProperty.prototype.addEffect=addEffect$1;var ShapeProperty=function(){function a(t,e,i){classCallCheck(this,a);var s=possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));s.propType="shape",s.comp=t.comp,s.container=t,s.elem=t,s.data=e,s.k=!1,s.kf=!1,s._mdf=!1;var r=3===i?e.pt.k:e.ks.k;return s.v=factory.clone(r),s.pv=factory.clone(s.v),s.localShapeCollection=ob$4.newShapeCollection(),s.paths=s.localShapeCollection,s.paths.addShape(s.v),s.reset=resetShape,s.effectsSequence=[],s}return inherits(a,ShapeExpressions),a}();ShapeProperty.prototype.interpolateShape=interpolateShape,ShapeProperty.prototype.getValue=processEffectsSequence$1,ShapeProperty.prototype.setVValue=setVValue$1,ShapeProperty.prototype.addEffect=addEffect$1;var _class$1,RectShapeProperty=function(){function s(t,e){classCallCheck(this,s);var i=possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return i.reset=resetShape,i.v=factory.newElement(),i.v.c=!0,i.localShapeCollection=ob$4.newShapeCollection(),i.localShapeCollection.addShape(i.v),i.paths=i.localShapeCollection,i.elem=t,i.comp=t.comp,i.frameId=-1,i.d=e.d,i.initDynamicPropertyContainer(t),i.p=PropertyFactory$1.getProp(t,e.p,1,0,i),i.s=PropertyFactory$1.getProp(t,e.s,1,0,i),i.r=PropertyFactory$1.getProp(t,e.r,0,0,i),i.dynamicProperties.length?i.k=!0:(i.k=!1,i.convertRectToPath()),i}return inherits(s,DynamicPropertyContainer),createClass(s,[{key:"convertRectToPath",value:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,s=this.s.v[1]/2,r=bm_min(i,s,this.r.v),a=r*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-s+r,t+i,e-s+r,t+i,e-s+a,0,!0),this.v.setTripleAt(t+i,e+s-r,t+i,e+s-a,t+i,e+s-r,1,!0),0!==r?(this.v.setTripleAt(t+i-r,e+s,t+i-r,e+s,t+i-a,e+s,2,!0),this.v.setTripleAt(t-i+r,e+s,t-i+a,e+s,t-i+r,e+s,3,!0),this.v.setTripleAt(t-i,e+s-r,t-i,e+s-r,t-i,e+s-a,4,!0),this.v.setTripleAt(t-i,e-s+r,t-i,e-s+a,t-i,e-s+r,5,!0),this.v.setTripleAt(t-i+r,e-s,t-i+r,e-s,t-i+a,e-s,6,!0),this.v.setTripleAt(t+i-r,e-s,t+i-a,e-s,t+i-r,e-s,7,!0)):(this.v.setTripleAt(t-i,e+s,t-i+a,e+s,t-i,e+s,2),this.v.setTripleAt(t-i,e-s,t-i,e-s+a,t-i,e-s,3))):(this.v.setTripleAt(t+i,e-s+r,t+i,e-s+a,t+i,e-s+r,0,!0),0!==r?(this.v.setTripleAt(t+i-r,e-s,t+i-r,e-s,t+i-a,e-s,1,!0),this.v.setTripleAt(t-i+r,e-s,t-i+a,e-s,t-i+r,e-s,2,!0),this.v.setTripleAt(t-i,e-s+r,t-i,e-s+r,t-i,e-s+a,3,!0),this.v.setTripleAt(t-i,e+s-r,t-i,e+s-a,t-i,e+s-r,4,!0),this.v.setTripleAt(t-i+r,e+s,t-i+r,e+s,t-i+a,e+s,5,!0),this.v.setTripleAt(t+i-r,e+s,t+i-a,e+s,t+i-r,e+s,6,!0),this.v.setTripleAt(t+i,e+s-r,t+i,e+s-r,t+i,e+s-a,7,!0)):(this.v.setTripleAt(t-i,e-s,t-i+a,e-s,t-i,e-s,1,!0),this.v.setTripleAt(t-i,e+s,t-i,e+s-a,t-i,e+s,2,!0),this.v.setTripleAt(t+i,e+s,t+i-a,e+s,t+i,e+s,3,!0)))}},{key:"getValue",value:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())}}]),s}(),cPoint=.5519,EllShapeProperty=function(){function s(t,e){classCallCheck(this,s);var i=possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return i.reset=resetShape,i.v=factory.newElement(),i.v.setPathData(!0,4),i.localShapeCollection=ob$4.newShapeCollection(),i.paths=i.localShapeCollection,i.localShapeCollection.addShape(i.v),i.d=e.d,i.elem=t,i.comp=t.comp,i.frameId=-1,i.initDynamicPropertyContainer(t),i.p=PropertyFactory$1.getProp(t,e.p,1,0,i),i.s=PropertyFactory$1.getProp(t,e.s,1,0,i),i.dynamicProperties.length?i.k=!0:(i.k=!1,i.convertEllToPath()),i}return inherits(s,DynamicPropertyContainer),createClass(s,[{key:"getValue",value:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())}},{key:"convertEllToPath",value:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,s=this.s.v[1]/2,r=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-s,a.v[1][0]=r?t+i:t-i,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+s,a.v[3][0]=r?t-i:t+i,a.v[3][1]=e,a.i[0][0]=r?t-i*cPoint:t+i*cPoint,a.i[0][1]=e-s,a.i[1][0]=r?t+i:t-i,a.i[1][1]=e-s*cPoint,a.i[2][0]=r?t+i*cPoint:t-i*cPoint,a.i[2][1]=e+s,a.i[3][0]=r?t-i:t+i,a.i[3][1]=e+s*cPoint,a.o[0][0]=r?t+i*cPoint:t-i*cPoint,a.o[0][1]=e-s,a.o[1][0]=r?t+i:t-i,a.o[1][1]=e+s*cPoint,a.o[2][0]=r?t-i*cPoint:t+i*cPoint,a.o[2][1]=e+s,a.o[3][0]=r?t-i:t+i,a.o[3][1]=e-s*cPoint}}]),s}(),degToRads$3=Math.PI/180,StarShapeProperty=function(){function s(t,e){classCallCheck(this,s);var i=possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return i.reset=resetShape,i.v=factory.newElement(),i.v.setPathData(!0,0),i.elem=t,i.comp=t.comp,i.data=e,i.frameId=-1,i.d=e.d,i.initDynamicPropertyContainer(t),1===e.sy?(i.ir=PropertyFactory$1.getProp(t,e.ir,0,0,i),i.is=PropertyFactory$1.getProp(t,e.is,0,.01,i),i.convertToPath=i.convertStarToPath):i.convertToPath=i.convertPolygonToPath,i.pt=PropertyFactory$1.getProp(t,e.pt,0,0,i),i.p=PropertyFactory$1.getProp(t,e.p,1,0,i),i.r=PropertyFactory$1.getProp(t,e.r,0,degToRads$3,i),i.or=PropertyFactory$1.getProp(t,e.or,0,0,i),i.os=PropertyFactory$1.getProp(t,e.os,0,.01,i),i.localShapeCollection=ob$4.newShapeCollection(),i.localShapeCollection.addShape(i.v),i.paths=i.localShapeCollection,i.dynamicProperties.length?i.k=!0:(i.k=!1,i.convertToPath()),i}return inherits(s,DynamicPropertyContainer),createClass(s,[{key:"getValue",value:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())}},{key:"convertStarToPath",value:function(){var t=2*Math.floor(this.pt.v),e=2*Math.PI/t,i=!0,s=this.or.v,r=this.ir.v,a=this.os.v,n=this.is.v,o=2*Math.PI*s/(2*t),h=2*Math.PI*r/(2*t),p=void 0,l=void 0,c=void 0,u=void 0,f=-Math.PI/2;f+=this.r.v;var d=3===this.data.d?-1:1;for(p=this.v._length=0;p<t;p+=1){c=i?a:n,u=i?o:h;var m=(l=i?s:r)*Math.cos(f),y=l*Math.sin(f),v=0===m&&0===y?0:y/Math.sqrt(m*m+y*y),g=0===m&&0===y?0:-m/Math.sqrt(m*m+y*y);m+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(m,y,m-v*u*c*d,y-g*u*c*d,m+v*u*c*d,y+g*u*c*d,p,!0),i=!i,f+=e*d}}},{key:"convertPolygonToPath",value:function(){var t=Math.floor(this.pt.v),e=2*Math.PI/t,i=this.or.v,s=this.os.v,r=2*Math.PI*i/(4*t),a=void 0,n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,a=this.v._length=0;a<t;a+=1){var h=i*Math.cos(n),p=i*Math.sin(n),l=0===h&&0===p?0:p/Math.sqrt(h*h+p*p),c=0===h&&0===p?0:-h/Math.sqrt(h*h+p*p);h+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(h,p,h-l*r*s*o,p-c*r*s*o,h+l*r*s*o,p+c*r*s*o,a,!0),n+=e*o}this.paths.length=0,this.paths[0]=this.v}}]),s}();function _applyDecoratedDescriptor$1(i,s,t,e,r){var a={};return Object.keys(e).forEach(function(t){a[t]=e[t]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=t.slice().reverse().reduce(function(t,e){return e(i,s,t)||t},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(i,s,a),a=null),a}var ShapePropertyFactory=(_applyDecoratedDescriptor$1((_class$1=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"getShapeProp",value:function(t,e,i){var s=void 0;3===i||4===i?s=(3===i?e.pt:e.ks).k.length?new KeyframedShapeProperty(t,e,i):new ShapeProperty(t,e,i):5===i?s=new RectShapeProperty(t,e):6===i?s=new EllShapeProperty(t,e):7===i&&(s=new StarShapeProperty(t,e));return s.k&&t.addDynamicProperty(s),s}},{key:"getConstructorFunction",value:function(){return ShapeProperty}},{key:"getKeyframedConstructorFunction",value:function(){return KeyframedShapeProperty}}]),t}()).prototype,"getShapeProp",[GetShapeProp],Object.getOwnPropertyDescriptor(_class$1.prototype,"getShapeProp"),_class$1.prototype),_class$1),ShapePropertyFactory$1=new ShapePropertyFactory,CVMaskElement=function(){function a(t,e){classCallCheck(this,a),this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var i=void 0,s=this.masksProperties.length,r=!1;for(i=0;i<s;i++)"n"!==this.masksProperties[i].mode&&(r=!0),this.viewData[i]=ShapePropertyFactory$1.getShapeProp(this.element,this.masksProperties[i],3);(this.hasMasks=r)&&this.element.addRenderableComponent(this)}return createClass(a,[{key:"renderFrame",value:function(){if(this.hasMasks){var t=this.element.finalTransform.mat,e=this.element.canvasContext,i=void 0,s=this.masksProperties.length,r=void 0,a=void 0,n=void 0;for(e.beginPath(),i=0;i<s;i++)if("n"!==this.masksProperties[i].mode){this.masksProperties[i].inv&&(e.moveTo(0,0),e.lineTo(this.element.globalData.compSize.w,0),e.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),e.lineTo(0,this.element.globalData.compSize.h),e.lineTo(0,0)),n=this.viewData[i].v,r=t.applyToPointArray(n.v[0][0],n.v[0][1],0),e.moveTo(r[0],r[1]);var o=void 0,h=n._length;for(o=1;o<h;o++)a=t.applyToTriplePoints(n.o[o-1],n.i[o],n.v[o]),e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);a=t.applyToTriplePoints(n.o[o-1],n.i[0],n.v[0]),e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}this.element.globalData.renderer.save(!0),e.clip()}}},{key:"getMaskProperty",value:function(t){return this.viewData[t].prop}},{key:"destroy",value:function(){this.element=null}}]),a}(),blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};function getBlendMode(t){return blendModeEnums[t]||""}var CVBaseElement=function(){function t(){classCallCheck(this,t),this.mHelper=new Matrix}return createClass(t,[{key:"createElements",value:function(){}},{key:"initRendererElement",value:function(){}},{key:"createContainerElements",value:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)}},{key:"createContent",value:function(){}},{key:"setBlendMode",value:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}}},{key:"createRenderableComponents",value:function(){this.maskManager=new CVMaskElement(this.data,this)}},{key:"addMasks",value:function(){this.maskManager=new CVMaskElement(this.data,this)}},{key:"hideElement",value:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)}},{key:"showElement",value:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)}},{key:"renderFrame",value:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}}},{key:"destroy",value:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()}},{key:"hide",value:function(){this.hideElement()}},{key:"show",value:function(){this.showElement()}}]),t}(),CVCompElementClass=void 0,CVCompElementFactory=function(t){if(CVCompElementClass)return CVCompElementClass;function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.completeLayers=!1,s.layers=t.layers||[],s.pendingElements=[],s.elements=Array.apply(null,{length:s.layers.length}),s.initElement(t,e,i),s.tm=t.tm?PropertyFactory$1.getProp(s,t.tm,0,e.frameRate,s):{_placeholder:!0},s}var e;return e=Mixin(t,ICompElement,CVBaseElement),inherits(r,e),createClass(r,[{key:"renderInnerContent",value:function(){var t=void 0;for(t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},{key:"destroy",value:function(){var t=void 0;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null}}]),CVCompElementClass=r},CVContextData=function(){function e(){classCallCheck(this,e),this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;var t=void 0;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}return createClass(e,[{key:"duplicate",value:function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var i=0;for(i=this._length;i<t;i+=1)this.saved[i]=createTypedArray("float32",16);this._length=t}},{key:"reset",value:function(){this.cArrPos=0,this.cTr.reset(),this.cO=1}}]),e}(),SVGBaseElement=function t(){classCallCheck(this,t)},IImageElement=function(t){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.assetData=e.getAssetData(t.refId),s.initElement(t,e,i),s}return inherits(r,t),createClass(r,[{key:"createContent",value:function(){console.warn("createContent")}}]),r}(Mixin(BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement)),CVImageElement=function(t){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.initElement=RenderableDOMElement.prototype.initElement,s.prepareFrame=IImageElement.prototype.prepareFrame,s.failed=!1,s.assetData=e.getAssetData(t.refId),s.img=e.imageLoader.getImage(s.assetData),s.renderer=i,s.initElement(t,e,i),s}return inherits(r,t),createClass(r,[{key:"createContent",value:function(){}},{key:"renderInnerContent",value:function(){!this.failed&&this.img.src&&(this.img.src instanceof Uint8ClampedArray?this.canvasContext.canvasPutImageData({canvasId:this.canvasContext.canvasId||"",data:this.img.src,x:0,y:0}):!this.img.width||this.assetData.w===this.img.width&&this.assetData.h===this.img.height?this.canvasContext.drawImage(this.img.src||this.img,0,0):this.canvasContext.drawImage(this.img.src||this.img,0,0,this.assetData.w,this.assetData.h))}},{key:"destroy",value:function(){this.img=null}}]),r}(Mixin(BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement)),CVShapeData=function(){function h(t,e,i,s){classCallCheck(this,h),this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;"rc"===e.ty?r=5:"el"===e.ty?r=6:"sr"===e.ty&&(r=7),this.sh=ShapePropertyFactory$1.getShapeProp(t,e,r,t);var a=void 0,n=i.length,o=void 0;for(a=0;a<n;a+=1)i[a].closed||(o={transforms:s.addTransformSequence(i[a].transforms),trNodes:[]},this.styledShapes.push(o),i[a].elements.push(o))}return createClass(h,[{key:"setAsAnimated",value:function(){this._isAnimated=!0}}]),h}(),ProcessedElement=function t(e,i){classCallCheck(this,t),this.elem=e,this.pos=i},IShapeElement=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"addShapeToModifiers",value:function(t){var e=void 0,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)}},{key:"isShapeInAnimatedModifiers",value:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1}},{key:"renderModifiers",value:function(){if(this.shapeModifiers.length){var t=void 0,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}}},{key:"searchProcessedElement",value:function(t){for(var e=this.processedElements,i=0,s=e.length;i<s;){if(e[i].elem===t)return e[i].pos;i+=1}return 0}},{key:"addProcessedElement",value:function(t,e){for(var i=this.processedElements,s=i.length;s;)if(i[s-=1].elem===t)return void(i[s].pos=e);i.push(new ProcessedElement(t,e))}},{key:"prepareFrame",value:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},{key:"lcEnum",get:function(){return{1:"butt",2:"round",3:"square"}}},{key:"ljEnum",get:function(){return{1:"miter",2:"round",3:"butt"}}}]),t}(),DashProperty=function(){function h(t,e,i,s){classCallCheck(this,h);var r=possibleConstructorReturn(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));r.elem=t,r.frameId=-1,r.dataProps=createSizedArray(e.length),r.renderer=i,r.k=!1,r.dashStr="",r.dashArray=createTypedArray("float32",e.length?e.length-1:0),r.dashoffset=createTypedArray("float32",1),r.initDynamicPropertyContainer(s);var a=void 0,n=e.length||0,o=void 0;for(a=0;a<n;a+=1)o=PropertyFactory$1.getProp(t,e[a].v,0,0,r),r.k=o.k||r.k,r.dataProps[a]={n:e[a].n,p:o};return r.k||r.getValue(!0),r._isAnimated=r.k,r}return inherits(h,DynamicPropertyContainer),createClass(h,[{key:"getValue",value:function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}}}]),h}(),ShapeModifier=function(){function t(){return classCallCheck(this,t),possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return inherits(t,DynamicPropertyContainer),createClass(t,[{key:"initModifierProperties",value:function(){}},{key:"addShapeToModifier",value:function(){}},{key:"addShape",value:function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:ob$4.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}}},{key:"init",value:function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=-999999,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)}},{key:"processKeys",value:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())}}]),t}(),modifiers={},ShapeModifiers={registerModifier:function(t,e){modifiers[t]||(modifiers[t]=e)},getModifier:function(t,e,i){return new modifiers[t](e,i)}},GradientProperty=function(){function s(t,e){classCallCheck(this,s),this.container=t,this.prop=PropertyFactory$1.getProp(t,e.k,1,null,this),this.data=e,this.k=this.prop.k,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this._mdf=!1,this.getValue(!0)}return createClass(s,[{key:"addDynamicProperty",value:function(){this.container.addDynamicProperty(this)}},{key:"comparePoints",value:function(t,e){for(var i=0,s=this.o.length/2;i<s;){if(.01<Math.abs(t[4*i]-t[4*e+2*i]))return!1;i+=1}return!0}},{key:"checkCollapsable",value:function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0}},{key:"getValue",value:function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e=void 0,i=4*this.data.p,s=void 0,r=void 0;for(e=0;e<i;e+=1)s=e%4==0?100:255,r=Math.round(this.prop.v[e]*s),this.c[e]!==r&&(this.c[e]=r,this._cmdf=!t);if(this.o.length)for(i=this.prop.v.length,e=4*this.data.p;e<i;e+=1)s=e%2==0?100:1,r=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==r&&(this.o[e-4*this.data.p]=r,this._omdf=!t);this._mdf=!t}}}]),s}(),RoundCornersModifier=function(){function t(){return classCallCheck(this,t),possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return inherits(t,ShapeModifier),createClass(t,[{key:"initModifierProperties",value:function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory$1.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length}},{key:"processPath",value:function(t,e){var i=factory.newElement();i.c=t.c;var s=void 0,r=t._length,a=void 0,n=void 0,o=void 0,h=void 0,p=void 0,l=void 0,c=0,u=void 0,f=void 0,d=void 0,m=void 0,y=void 0,v=void 0;for(s=0;s<r;s+=1)a=t.v[s],o=t.o[s],n=t.i[s],a[0]===o[0]&&a[1]===o[1]&&a[0]===n[0]&&a[1]===n[1]?0!==s&&s!==r-1||t.c?(h=0===s?t.v[r-1]:t.v[s-1],l=(p=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(p/2,e)/p:0,u=y=a[0]+(h[0]-a[0])*l,f=v=a[1]-(a[1]-h[1])*l,d=u-(u-a[0])*roundCorner,m=f-(f-a[1])*roundCorner,i.setTripleAt(u,f,d,m,y,v,c),c+=1,h=s===r-1?t.v[0]:t.v[s+1],l=(p=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(p/2,e)/p:0,u=d=a[0]+(h[0]-a[0])*l,f=m=a[1]+(h[1]-a[1])*l,y=u-(u-a[0])*roundCorner,v=f-(f-a[1])*roundCorner,i.setTripleAt(u,f,d,m,y,v,c)):i.setTripleAt(a[0],a[1],o[0],o[1],n[0],n[1],c):i.setTripleAt(t.v[s][0],t.v[s][1],t.o[s][0],t.o[s][1],t.i[s][0],t.i[s][1],c),c+=1;return i}},{key:"processShapes",value:function(t){var e=void 0,i=void 0,s=this.shapes.length,r=void 0,a=void 0,n=this.rd.v;if(0!==n){var o=void 0,h=void 0;for(i=0;i<s;i+=1){if(h=(o=this.shapes[i]).localShapeCollection,o.shape._mdf||this._mdf||t)for(h.releaseShapes(),o.shape._mdf=!0,e=o.shape.paths.shapes,a=o.shape.paths._length,r=0;r<a;r+=1)h.addShape(this.processPath(e[r],n));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)}}]),t}(),MouseModifier=function(){function t(){return classCallCheck(this,t),possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return inherits(t,ShapeModifier),createClass(t,[{key:"processKeys",value:function(t){this.elem.globalData.frameId===this.frameId&&!t||(this._mdf=!0)}},{key:"addShapeToModifier",value:function(){this.positions.push([])}},{key:"processPath",value:function(t,e,i){var s=void 0,r=t.v.length,a=[],n=[],o=[],h=void 0,p=void 0,l=void 0;for(s=0;s<r;s+=1){i.v[s]||(i.v[s]=[t.v[s][0],t.v[s][1]],i.o[s]=[t.o[s][0],t.o[s][1]],i.i[s]=[t.i[s][0],t.i[s][1]],i.distV[s]=0,i.distO[s]=0,i.distI[s]=0),h=Math.atan2(t.v[s][1]-e[1],t.v[s][0]-e[0]),p=e[0]-i.v[s][0],l=e[1]-i.v[s][1];var c=Math.sqrt(p*p+l*l);i.distV[s]+=(c-i.distV[s])*this.data.dc,i.v[s][0]=Math.cos(h)*Math.max(0,this.data.maxDist-i.distV[s])/2+t.v[s][0],i.v[s][1]=Math.sin(h)*Math.max(0,this.data.maxDist-i.distV[s])/2+t.v[s][1],h=Math.atan2(t.o[s][1]-e[1],t.o[s][0]-e[0]),p=e[0]-i.o[s][0],l=e[1]-i.o[s][1],c=Math.sqrt(p*p+l*l),i.distO[s]+=(c-i.distO[s])*this.data.dc,i.o[s][0]=Math.cos(h)*Math.max(0,this.data.maxDist-i.distO[s])/2+t.o[s][0],i.o[s][1]=Math.sin(h)*Math.max(0,this.data.maxDist-i.distO[s])/2+t.o[s][1],h=Math.atan2(t.i[s][1]-e[1],t.i[s][0]-e[0]),p=e[0]-i.i[s][0],l=e[1]-i.i[s][1],c=Math.sqrt(p*p+l*l),i.distI[s]+=(c-i.distI[s])*this.data.dc,i.i[s][0]=Math.cos(h)*Math.max(0,this.data.maxDist-i.distI[s])/2+t.i[s][0],i.i[s][1]=Math.sin(h)*Math.max(0,this.data.maxDist-i.distI[s])/2+t.i[s][1],a.push(i.v[s]),n.push(i.o[s]),o.push(i.i[s])}return{v:a,o:n,i:o,c:t.c}}},{key:"processShapes",value:function(){var t=this.elem.globalData.mouseX,e=this.elem.globalData.mouseY,i=void 0,s=void 0,r=this.shapes.length,a=void 0,n=void 0;if(t){var o=this.elem.globalToLocal([t,e,0]),h=void 0,p=[],l=this.shapes,c=this._mdf,u=this.positions;for(s=0;s<r;s+=1)if((h=l[s]).shape._mdf||c){for(h.shape._mdf=!0,n=(i=h.shape.paths).length,a=0;a<n;a+=1)u[s][a]||(this.positions[s][a]={v:[],o:[],i:[],distV:[],distO:[],distI:[]}),p.push(this.processPath(i[a],o,this.positions[s][a]));h.shape.paths=p,h.last=p}else h.shape.paths=h.last}}},{key:"initModifierProperties",value:function(t,e){this.getValue=this.processKeys,this.data=e,this.positions=[]}}]),t}(),RepeaterModifier=function(){function t(){return classCallCheck(this,t),possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return inherits(t,ShapeModifier),createClass(t,[{key:"initModifierProperties",value:function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory$1.getProp(t,e.c,0,null,this),this.o=PropertyFactory$1.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory$1.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory$1.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix}},{key:"applyTransforms",value:function(t,e,i,s,r,a){var n=a?-1:1,o=s.s.v[0]+(1-s.s.v[0])*(1-r),h=s.s.v[1]+(1-s.s.v[1])*(1-r);t.translate(s.p.v[0]*n*r,s.p.v[1]*n*r,s.p.v[2]),e.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),e.rotate(-s.r.v*n*r),e.translate(s.a.v[0],s.a.v[1],s.a.v[2]),i.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),i.scale(a?1/o:o,a?1/h:h),i.translate(s.a.v[0],s.a.v[1],s.a.v[2])}},{key:"init",value:function(t,e,i,s){for(this.elem=t,this.arr=e,this.pos=i,this.elemsData=s,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);0<i;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)}},{key:"resetElements",value:function(t){var e=void 0,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)}},{key:"cloneElements",value:function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e}},{key:"changeGroupRender",value:function(t,e){var i=void 0,s=t.length;for(i=0;i<s;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)}},{key:"processShapes",value:function(t){var e=void 0,i=void 0,s=void 0,r=void 0,a=void 0;if(this._mdf||t){var n=Math.ceil(this.c.v);if(this._groups.length<n){for(;this._groups.length<n;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}var h=void(a=0);for(s=0;s<=this._groups.length-1;s+=1)h=a<n,this._groups[s]._render=h,this.changeGroupRender(this._groups[s].it,h),a+=1;this._currentCopies=n;var p=this.o.v,l=p%1,c=0<p?Math.floor(p):Math.ceil(p),u=this.pMatrix.props,f=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var m=0;if(0<p){for(;m<c;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),m+=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,l,!1),m+=l)}else if(p<0){for(;c<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),m-=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-l,!0),m-=l)}s=1===this.data.m?0:this._currentCopies-1,r=1===this.data.m?1:-1,a=this._currentCopies;for(var y=void 0,v=void 0;a;){if(v=(i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),0!==m){for((0!==s&&1===r||s!==this._currentCopies-1&&-1===r)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),y=0;y<v;y+=1)i[y]=this.matrix.props[y];this.matrix.reset()}else for(this.matrix.reset(),y=0;y<v;y+=1)i[y]=this.matrix.props[y];m+=1,a-=1,s+=r}}else for(a=this._currentCopies,s=0,r=1;a;)i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r}},{key:"addShape",value:function(){}}]),t}(),TrimModifier=function(){function t(){return classCallCheck(this,t),possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return inherits(t,ShapeModifier),createClass(t,[{key:"initModifierProperties",value:function(t,e){this.s=PropertyFactory$1.getProp(t,e.s,0,.01,this),this.e=PropertyFactory$1.getProp(t,e.e,0,.01,this),this.o=PropertyFactory$1.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length}},{key:"addShapeToModifier",value:function(t){t.pathsData=[]}},{key:"calculateShapeEdges",value:function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],o=void 0,h=a.length,p=void 0;for(o=0;o<h;o+=1)if((p=a[o]).e*r<s||p.s*r>s+i);else{var l=void 0,c=void 0;l=p.s*r<=s?0:(p.s*r-s)/i,c=p.e*r>=s+i?1:(p.e*r-s)/i,n.push([l,c])}return n.length||n.push([0,0]),n}},{key:"releasePathsData",value:function(t){var e=void 0,i=t.length;for(e=0;e<i;e+=1)segments_length_pool.release(t[e]);return t.length=0,t}},{key:"processShapes",value:function(t){var e=void 0,i=void 0;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(i=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var r=e;e=i,i=r}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var a=void 0,n=void 0,o=this.shapes.length,h=void 0,p=void 0,l=void 0,c=void 0,u=void 0,f=0;if(i===e)for(n=0;n<o;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection;else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(n=0;n<o;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var d=[],m=void 0,y=void 0;for(n=0;n<o;n+=1)if((m=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(p=(a=m.shape.paths)._length,u=0,!m.shape._mdf&&m.pathsData.length)u=m.totalShapeLength;else{for(l=this.releasePathsData(m.pathsData),h=0;h<p;h+=1)c=bez.getSegmentsLength(a.shapes[h]),l.push(c),u+=c.totalLength;m.totalShapeLength=u,m.pathsData=l}f+=u,m.shape._mdf=!0}else m.shape.paths=m.localShapeCollection;var v=e,g=i,k=0,x=void 0;for(n=o-1;0<=n;n-=1)if((m=this.shapes[n]).shape._mdf){for((y=m.localShapeCollection).releaseShapes(),2===this.m&&1<o?(x=this.calculateShapeEdges(e,i,m.totalShapeLength,k,f),k+=m.totalShapeLength):x=[[v,g]],p=x.length,h=0;h<p;h+=1){v=x[h][0],g=x[h][1],d.length=0,g<=1?d.push({s:m.totalShapeLength*v,e:m.totalShapeLength*g}):1<=v?d.push({s:m.totalShapeLength*(v-1),e:m.totalShapeLength*(g-1)}):(d.push({s:m.totalShapeLength*v,e:m.totalShapeLength}),d.push({s:0,e:m.totalShapeLength*(g-1)}));var b=this.addShapes(m,d[0]);if(d[0].s!==d[0].e){if(1<d.length)if(m.shape.paths.shapes[m.shape.paths._length-1].c){var P=b.pop();this.addPaths(b,y),b=this.addShapes(m,d[1],P)}else this.addPaths(b,y),b=this.addShapes(m,d[1]);this.addPaths(b,y)}}m.shape.paths=y}}}},{key:"addPaths",value:function(t,e){var i=void 0,s=t.length;for(i=0;i<s;i+=1)e.addShape(t[i])}},{key:"addSegment",value:function(t,e,i,s,r,a,n){r.setXYAt(e[0],e[1],"o",a),r.setXYAt(i[0],i[1],"i",a+1),n&&r.setXYAt(t[0],t[1],"v",a),r.setXYAt(s[0],s[1],"v",a+1)}},{key:"addSegmentFromArray",value:function(t,e,i,s){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),s&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)}},{key:"addShapes",value:function(t,e,i){var s=t.pathsData,r=t.shape.paths.shapes,a=void 0,n=t.shape.paths._length,o=void 0,h=void 0,p=0,l=void 0,c=void 0,u=void 0,f=void 0,d=[],m=void 0,y=!0;for(m=i?(c=i._length,i._length):(i=factory.newElement(),c=0),d.push(i),a=0;a<n;a+=1){for(u=s[a].lengths,i.c=r[a].c,h=r[a].c?u.length:u.length+1,o=1;o<h;o+=1)if(p+(l=u[o-1]).addedLength<e.s)p+=l.addedLength,i.c=!1;else{if(p>e.e){i.c=!1;break}e.s<=p&&e.e>=p+l.addedLength?(this.addSegment(r[a].v[o-1],r[a].o[o-1],r[a].i[o],r[a].v[o],i,c,y),y=!1):(f=bez.getNewSegment(r[a].v[o-1],r[a].v[o],r[a].o[o-1],r[a].i[o],(e.s-p)/l.addedLength,(e.e-p)/l.addedLength,u[o-1]),this.addSegmentFromArray(f,i,c,y),y=!1,i.c=!1),p+=l.addedLength,c+=1}if(r[a].c&&u.length){if(l=u[o-1],p<=e.e){var v=u[o-1].addedLength;e.s<=p&&e.e>=p+v?(this.addSegment(r[a].v[o-1],r[a].o[o-1],r[a].i[0],r[a].v[0],i,c,y),y=!1):(f=bez.getNewSegment(r[a].v[o-1],r[a].v[0],r[a].o[o-1],r[a].i[0],(e.s-p)/v,(e.e-p)/v,u[o-1]),this.addSegmentFromArray(f,i,c,y),y=!1,i.c=!1)}else i.c=!1;p+=l.addedLength,c+=1}if(i._length&&(i.setXYAt(i.v[m][0],i.v[m][1],"i",m),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),p>e.e)break;a<n-1&&(i=factory.newElement(),y=!0,d.push(i),c=0)}return d}}]),t}(),ShapeTransformManager=function(){function t(){classCallCheck(this,t),this.sequences={},this.sequenceList=[],this.transform_key_count=0}return createClass(t,[{key:"addTransformSequence",value:function(t){var e=void 0,i=t.length,s="_";for(e=0;e<i;e+=1)s+=t[e].transform.key+"_";var r=this.sequences[s];return r||(r={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[s]=r,this.sequenceList.push(r)),r}},{key:"processSequence",value:function(t,e){for(var i=0,s=t.transforms.length,r=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){r=!0;break}i+=1}if(r){var a=void 0;for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)a=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])}t._mdf=r}},{key:"processSequences",value:function(t){var e=void 0,i=this.sequenceList.length;for(e=0;e<i;e+=1)this.processSequence(this.sequenceList[e],t)}},{key:"getNewKey",value:function(){return"_"+this.transform_key_count++}}]),t}();ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("ms",MouseModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("tm",TrimModifier);var degToRads$4=Math.PI/180,CVShapeElement=function(t){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.initElement=RenderableDOMElement.prototype.initElement,s.transformHelper={opacity:1,_opMdf:!1},s.dashResetter=[],s.shapes=[],s.shapesData=t.shapes,s.stylesList=[],s.itemsData=[],s.prevViewData=[],s.shapeModifiers=[],s.processedElements=[],s.transformsManager=new ShapeTransformManager,s.initElement(t,e,i),s}return inherits(r,t),createClass(r,[{key:"createContent",value:function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])}},{key:"createStyleElement",value:function(t,e){var i={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},s={};if("fl"===t.ty||"st"===t.ty?(s.c=PropertyFactory$1.getProp(this,t.c,1,255,this),s.c.k||(i.co="rgb("+bm_floor(s.c.v[0])+","+bm_floor(s.c.v[1])+","+bm_floor(s.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(s.s=PropertyFactory$1.getProp(this,t.s,1,null,this),s.e=PropertyFactory$1.getProp(this,t.e,1,null,this),s.h=PropertyFactory$1.getProp(this,t.h||{k:0},0,.01,this),s.a=PropertyFactory$1.getProp(this,t.a||{k:0},0,degToRads$4,this),s.g=new GradientProperty(this,t.g,this)),s.o=PropertyFactory$1.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(i.lc=this.lcEnum[t.lc]||"round",i.lj=this.ljEnum[t.lj]||"round",1===t.lj&&(i.ml=t.ml),s.w=PropertyFactory$1.getProp(this,t.w,0,null,this),s.w.k||(i.wi=s.w.v),t.d){var r=new DashProperty(this,t.d,"canvas",this);s.d=r,s.d.k||(i.da=s.d.dashArray,i.do=s.d.dashoffset[0])}}else i.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(i),s.style=i,s}},{key:"createGroupElement",value:function(){return{it:[],prevViewData:[]}}},{key:"createTransformElement",value:function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory$1.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}}},{key:"createShapeElement",value:function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e}},{key:"reloadShapes",value:function(){this._isFirstFrame=!0;var t=void 0,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)}},{key:"addTransformToStyleList",value:function(t){var e=void 0,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)}},{key:"removeTransformFromStyleList",value:function(){var t=void 0,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()}},{key:"closeStyles",value:function(t){var e=void 0,i=t.length;for(e=0;e<i;e+=1)t[e].closed=!0}},{key:"searchShapes",value:function(t,e,i,s,r){var a=void 0,n=t.length-1,o=void 0,h=void 0,p=[],l=[],c=void 0,u=void 0,f=void 0,d=[].concat(r);for(a=n;0<=a;a-=1){if((c=this.searchProcessedElement(t[a]))?e[a]=i[c-1]:t[a]._shouldRender=s,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)c?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),p.push(e[a].style);else if("gr"===t[a].ty){if(c)for(h=e[a].it.length,o=0;o<h;o+=1)e[a].prevViewData[o]=e[a].it[o];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,s,d)}else"tr"===t[a].ty?(c||(f=this.createTransformElement(t[a]),e[a]=f),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"===t[a].ty||"rc"===t[a].ty||"el"===t[a].ty||"sr"===t[a].ty?c||(e[a]=this.createShapeElement(t[a])):"tm"===t[a].ty||"rd"===t[a].ty?(c?(u=e[a]).closed=!1:((u=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=u,this.shapeModifiers.push(u)),l.push(u)):"rp"===t[a].ty&&(c?(u=e[a]).closed=!0:(u=ShapeModifiers.getModifier(t[a].ty),(e[a]=u).init(this,t,a,e),this.shapeModifiers.push(u),s=!1),l.push(u));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(p),n=l.length,a=0;a<n;a+=1)l[a].closed=!0}},{key:"renderInnerContent",value:function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)}},{key:"renderShapeTransform",value:function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)}},{key:"drawLayer",value:function(){var t=void 0,e=this.stylesList.length,i=void 0,s=void 0,r=void 0,a=void 0,n=void 0,o=void 0,h=this.globalData.renderer,p=this.globalData.canvasContext,l=void 0,c=void 0;for(t=0;t<e;t+=1)if(("st"!==(l=(c=this.stylesList[t]).type)&&"gs"!==l||0!==c.wi)&&c.data._shouldRender&&0!==c.coOp&&0!==this.globalData.currentGlobalAlpha){for(h.save(),n=c.elements,"st"===l||"gs"===l?(p.strokeStyle="st"===l?c.co:c.grd,p.lineWidth=c.wi,p.lineCap=c.lc,p.lineJoin=c.lj,p.miterLimit=c.ml||0):p.fillStyle="fl"===l?c.co:c.grd,h.ctxOpacity(c.coOp),"st"!==l&&"gs"!==l&&p.beginPath(),h.ctxTransform(c.preTransforms.finalTransform.props),s=n.length,i=0;i<s;i+=1){for("st"!==l&&"gs"!==l||(p.beginPath(),c.da&&(p.setLineDash(c.da),p.lineDashOffset=c.do)),a=(o=n[i].trNodes).length,r=0;r<a;r+=1)"m"===o[r].t?p.moveTo(o[r].p[0],o[r].p[1]):"c"===o[r].t?p.bezierCurveTo(o[r].pts[0],o[r].pts[1],o[r].pts[2],o[r].pts[3],o[r].pts[4],o[r].pts[5]):p.closePath();"st"!==l&&"gs"!==l||(p.stroke(),c.da&&p.setLineDash(this.dashResetter))}"st"!==l&&"gs"!==l&&("nonzero"===c.r?p.fill():p.fill(c.r)),h.restore()}}},{key:"renderShape",value:function(t,e,i,s){var r=void 0,a=void 0;for(a=t,r=e.length-1;0<=r;r-=1)"tr"===e[r].ty?(a=i[r].transform,this.renderShapeTransform(t,a)):"sh"===e[r].ty||"el"===e[r].ty||"rc"===e[r].ty||"sr"===e[r].ty?this.renderPath(e[r],i[r]):"fl"===e[r].ty?this.renderFill(e[r],i[r],a):"st"===e[r].ty?this.renderStroke(e[r],i[r],a):"gf"===e[r].ty||"gs"===e[r].ty?this.renderGradientFill(e[r],i[r],a):"gr"===e[r].ty?this.renderShape(a,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer()}},{key:"renderStyledShape",value:function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i=t.trNodes,s=e.paths,r=void 0,a=void 0,n=void 0,o=s._length;i.length=0;var h=t.transforms.finalTransform;for(n=0;n<o;n+=1){var p=s.shapes[n];if(p&&p.v){for(a=p._length,r=1;r<a;r+=1)1===r&&i.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),i.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[r],p.v[r])});1===a&&i.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),p.c&&a&&(i.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[0],p.v[0])}),i.push({t:"z"}))}}t.trNodes=i}}},{key:"renderPath",value:function(t,e){if(!0!==t.hd&&t._shouldRender){var i=void 0,s=e.styledShapes.length;for(i=0;i<s;i+=1)this.renderStyledShape(e.styledShapes[i],e.sh)}}},{key:"renderFill",value:function(t,e,i){var s=e.style;(e.c._mdf||this._isFirstFrame)&&(s.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(s.coOp=e.o.v*i.opacity)}},{key:"renderGradientFill",value:function(t,e,i){var s=e.style;if(!s.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var r=this.globalData.canvasContext,a=void 0,n=e.s.v,o=e.e.v;if(1===t.t)a=r.createLinearGradient(n[0],n[1],o[0],o[1]);else{var h=Math.sqrt(Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)),p=Math.atan2(o[1]-n[1],o[0]-n[0]),l=h*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),c=Math.cos(p+e.a.v)*l+n[0],u=Math.sin(p+e.a.v)*l+n[1];a=r.createRadialGradient(c,u,0,n[0],n[1],h)}var f=void 0,d=t.g.p,m=e.g.c,y=1;for(f=0;f<d;f+=1)e.g._hasOpacity&&e.g._collapsable&&(y=e.g.o[2*f+1]),a.addColorStop(m[4*f]/100,"rgba("+m[4*f+1]+","+m[4*f+2]+","+m[4*f+3]+","+y+")");s.grd=a}s.coOp=e.o.v*i.opacity}},{key:"renderStroke",value:function(t,e,i){var s=e.style,r=e.d;r&&(r._mdf||this._isFirstFrame)&&(s.da=r.dashArray,s.do=r.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(s.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(s.coOp=e.o.v*i.opacity),(e.w._mdf||this._isFirstFrame)&&(s.wi=e.w.v)}},{key:"destroy",value:function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0}}]),r}(Mixin(BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement)),CVSolidElement=function(t){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.prepareFrame=IImageElement.prototype.prepareFrame,s.initElement(t,e,i),s}return inherits(r,t),createClass(r,[{key:"initElement",value:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide()}},{key:"renderInnerContent",value:function(){var t=this.canvasContext;t.setFillStyle(this.data.sc),t.fillRect(0,0,this.data.sw,this.data.sh)}}]),r}(Mixin(BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement)),LetterProps=function(){function n(t,e,i,s,r,a){classCallCheck(this,n),this.o=t,this.sw=e,this.sc=i,this.fc=s,this.m=r,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!s,m:!0,p:!0}}return createClass(n,[{key:"update",value:function(t,e,i,s,r,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==i&&(this.sc=i,n=this._mdf.sc=!0),this.fc!==s&&(this.fc=s,n=this._mdf.fc=!0),this.m!==r&&(this.m=r,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n}}]),n}(),emptyChar={w:0,size:0,shapes:[]},combinedCharacters=[];combinedCharacters=combinedCharacters.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var Font=function(){function t(){classCallCheck(this,t),this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this.initTime=Date.now()}return createClass(t,[{key:"addChars",value:function(t){if(t){var e;this.chars||(this.chars=[]);var i,s,r=t.length,a=this.chars.length;for(e=0;e<r;e+=1){for(i=0,s=!1;i<a;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(s=!0),i+=1;s||(this.chars.push(t[e]),a+=1)}}}},{key:"addFonts",value:function(t){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var e=t.list,i=void 0,s=e.length,r=s;for(i=0;i<s;i+=1){var a=!0;e[i].loaded=!1,e[i].monoCase=this.setUpNode(e[i].fFamily,"monospace"),e[i].sansCase=this.setUpNode(e[i].fFamily,"sans-serif"),e[i].fPath?"p"===e[i].fOrigin||3===e[i].origin?a&&(api.loadFontFace?api.loadFontFace({family:e[i].fFamily,source:e[i].fPath,fail:function(t){console.error(t)}}):console.warn("下载字体文件方法:wx.loadFontFace 基础库 2.1.0 开始支持")):"t"!==e[i].fOrigin&&2!==e[i].origin||(console.warn("not support"),a=!1):(e[i].loaded=!0,r-=1),e[i].cache={},this.fonts.push(e[i])}0===r?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0}},{key:"setUpNode",value:function(t,e){console.log(t,e)}},{key:"checkLoadedFonts",value:function(){}},{key:"getCharData",value:function(t,e,i){var s=0;if(!this.chars)return emptyChar;for(var r=this.chars.length;s<r;){if(this.chars[s].ch===t&&this.chars[s].style===e&&this.chars[s].fFamily===i)return this.chars[s];s+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&console.warn("Missing character from exported characters list: ",t,e,i),emptyChar}},{key:"getFontByName",value:function(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]}},{key:"measureText",value:function(){return 0}},{key:"loaded",value:function(){return this.isLoaded}}],[{key:"getCombinedCharacterCodes",value:function(){return combinedCharacters}}]),t}();function searchExpressions$1(){if(this.data.d.x)return this.calculateExpression=ob$1.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0}function getExpressionValue(t,e){var i=this.calculateExpression(e);if(t.t===i)return t;var s={};return this.copyData(s,t),s.t=i.toString(),s.__complete=!1,s}function searchProperty(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf}var _class$2,TextProperty=function(){function i(t,e){classCallCheck(this,i),_initialiseProps.call(this),this._frameId=-999999,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}return createClass(i,[{key:"copyData",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}},{key:"searchProperty",value:function(){return this.searchKeyframes()}},{key:"searchKeyframes",value:function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf}},{key:"addEffect",value:function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)}},{key:"getValue",value:function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var s=void 0,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;s<r;s+=1)a=i!==this.keysIndex?this.effectsSequence[s](a,a.t):this.effectsSequence[s](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}}},{key:"getKeyframeValue",value:function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,i=0,s=t.length;i<=s-1&&!(i===s-1||t[i+1].t>e);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s}},{key:"buildFinalText",value:function(t){for(var e=Font.getCombinedCharacterCodes(),i=[],s=0,r=t.length,a=void 0;s<r;)a=t.charCodeAt(s),-1!==e.indexOf(a)?i[i.length-1]+=t.charAt(s):55296<=a&&a<=56319&&56320<=(a=t.charCodeAt(s+1))&&a<=57343?(i.push(t.substr(s,2)),++s):i.push(t.charAt(s)),s+=1;return i}},{key:"completeTextData",value:function(t){t.__complete=!0;var e,i=this.elem.globalData.fontManager,s=this.data,r=[],a=void 0,n=void 0,o=void 0,h=0,p=void 0,l=s.m.g,c=0,u=0,f=0,d=[],m=0,y=0,v=void 0,g=i.getFontByName(t.f),k=void 0,x=0,b=g.fStyle?g.fStyle.split(" "):[],P="normal",_="normal";n=b.length;for(a=0;a<n;a+=1)switch(b[a].toLowerCase()){case"italic":_="italic";break;case"bold":P="700";break;case"black":P="900";break;case"medium":P="500";break;case"regular":case"normal":P="400";break;case"light":case"thin":P="200"}t.fWeight=g.fWeight||P,t.fStyle=_,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),n=t.finalText.length,t.finalLineHeight=t.lh;var C=t.tr/1e3*t.finalSize,S=void 0;if(t.sz)for(var T=!0,E=t.sz[0],A=t.sz[1],w=void 0,I=void 0;T;){m=w=0,n=(I=this.buildFinalText(t.t)).length,C=t.tr/1e3*t.finalSize;var D=-1;for(a=0;a<n;a+=1)S=I[a].charCodeAt(0),o=!1," "===I[a]?D=a:13!==S&&3!==S||(o=!(m=0),w+=t.finalLineHeight||1.2*t.finalSize),E<m+(x=i.chars?(k=i.getCharData(I[a],g.fStyle,g.fFamily),o?0:k.w*t.finalSize/100):i.measureText(I[a],t.f,t.finalSize))&&" "!==I[a]?(-1===D?n+=1:a=D,w+=t.finalLineHeight||1.2*t.finalSize,I.splice(a,D===a?1:0,"\r"),D=-1,m=0):(m+=x,m+=C);w+=g.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&A<w?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=I,n=t.finalText.length,T=!1)}m=-C;var F=x=0,M=void 0;for(a=0;a<n;a+=1)if(o=!1,S=(M=t.finalText[a]).charCodeAt(0)," "===M?p=" ":13===S||3===S?(F=0,d.push(m),y=y<m?m:y,m=-2*C,o=!(p=""),f+=1):p=t.finalText[a],x=i.chars?(k=i.getCharData(M,g.fStyle,i.getFontByName(t.f).fFamily),o?0:k.w*t.finalSize/100):i.measureText(p,t.f,t.finalSize)," "===M?F+=x+C:(m+=x+C+F,F=0),r.push({l:x,an:x,add:c,n:o,anIndexes:[],val:p,line:f,animatorJustifyOffset:0}),2===l){if(c+=x,""===p||" "===p||a===n-1){for(""!==p&&" "!==p||(c-=x);u<=a;)r[u].an=c,r[u].ind=h,r[u].extra=x,u+=1;h+=1,c=0}}else if(3===l){if(c+=x,""===p||a===n-1){for(""===p&&(c-=x);u<=a;)r[u].an=c,r[u].ind=h,r[u].extra=x,u+=1;c=0,h+=1}}else r[h].ind=h,r[h].extra=0,h+=1;if(t.l=r,y=y<m?m:y,d.push(m),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=y,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=d;var L=s.a,R=void 0,$=void 0;e=L.length;var V=void 0,O=void 0,N=[];for(v=0;v<e;v+=1){for((R=L[v]).a.sc&&(t.strokeColorAnim=!0),R.a.sw&&(t.strokeWidthAnim=!0),(R.a.fc||R.a.fh||R.a.fs||R.a.fb)&&(t.fillColorAnim=!0),O=0,V=R.s.b,a=0;a<n;a+=1)($=r[a]).anIndexes[v]=O,(1===V&&""!==$.val||2===V&&""!==$.val&&" "!==$.val||3===V&&($.n||" "===$.val||a===n-1)||4===V&&($.n||a===n-1))&&(1===R.s.rn&&N.push(O),O+=1);s.a[v].s.totalChars=O;var z=-1,B=void 0;if(1===R.s.rn)for(a=0;a<n;a+=1)z!==($=r[a]).anIndexes[v]&&(z=$.anIndexes[v],B=N.splice(Math.floor(Math.random()*N.length),1)[0]),$.anIndexes[v]=B}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=g.ascent*t.finalSize/100}},{key:"updateDocumentData",value:function(t,e){e=void 0===e?this.keysIndex:e;var i=this.copyData({},this.data.d.k[e].s);i=this.copyData(i,t),this.data.d.k[e].s=i,this.recalculate(e),this.elem.addDynamicProperty(this)}},{key:"recalculate",value:function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)}},{key:"canResizeFont",value:function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}},{key:"setMinimumFontSize",value:function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}}]),i}(),_initialiseProps=function(){this.defaultBoxWidth=[0,0],this.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0}};function addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this))}function _applyDecoratedDescriptor$2(i,s,t,e,r){var a={};return Object.keys(e).forEach(function(t){a[t]=e[t]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=t.slice().reverse().reduce(function(t,e){return e(i,s,t)||t},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(i,s,a),a=null),a}TextProperty.prototype.getExpressionValue=getExpressionValue,TextProperty.prototype.searchProperty=searchProperty,TextProperty.prototype.searchExpressions=searchExpressions$1;var max=Math.max,min=Math.min,floor=Math.floor,TextSelectorProp=function(){function s(t,e){classCallCheck(this,s);var i=possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return i.addDynamicProperty=addDynamicProperty,i._mdf=!1,i.k=!1,i.data=e,i.dynamicProperties=[],i.elem=t,i.container=t,i.comp=t.comp,i.finalS=0,i.finalE=0,i.s=PropertyFactory$1.getProp(t,e.s||{k:0},0,0,i),i.e="e"in e?PropertyFactory$1.getProp(t,e.e,0,0,i):{v:100},i.o=PropertyFactory$1.getProp(t,e.o||{k:0},0,0,i),i.xe=PropertyFactory$1.getProp(t,e.xe||{k:0},0,0,i),i.ne=PropertyFactory$1.getProp(t,e.ne||{k:0},0,0,i),i.a=PropertyFactory$1.getProp(t,e.a,0,.01,i),i.dynamicProperties.length||i.getValue(),i}return inherits(s,DynamicPropertyContainer),createClass(s,[{key:"getMult",value:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=ob.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get,i=0,s=this.finalS,r=this.finalE,a=this.data.sh;if(2===a)i=e(i=r===s?r<=t?1:0:max(0,min(.5/(r-s)+(t-s)/(r-s),1)));else if(3===a)i=e(i=r===s?r<=t?0:1:1-max(0,min(.5/(r-s)+(t-s)/(r-s),1)));else if(4===a)r===s?i=0:(i=max(0,min(.5/(r-s)+(t-s)/(r-s),1)))<.5?i*=2:i=1-2*(i-.5),i=e(i);else if(5===a){if(r===s)i=0;else{var n=r-s,o=-n/2+(t=min(max(0,t+.5-s),r-s)),h=n/2;i=Math.sqrt(1-o*o/(h*h))}i=e(i)}else i=6===a?e(i=r===s?0:(t=min(max(0,t+.5-s),r-s),(1+Math.cos(Math.PI+2*Math.PI*t/(r-s)))/2)):(t>=floor(s)&&(i=t-s<0?1-(s-t):max(0,min(r-t,1))),e(i));return i*this.a.v}},{key:"getValue",value:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,s=this.s.v/e+i,r=this.e.v/e+i;if(r<s){var a=s;s=r,r=a}this.finalS=s,this.finalE=r}}]),s}(),TextSelectorProperty=(_applyDecoratedDescriptor$2((_class$2=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"getTextSelectorProp",value:function(t,e,i){return new TextSelectorProp(t,e,i)}}]),t}()).prototype,"getTextSelectorProp",[GetTextSelectorProp],Object.getOwnPropertyDescriptor(_class$2.prototype,"getTextSelectorProp"),_class$2.prototype),_class$2),TextSelectorProp$1=new TextSelectorProperty,degToRads$5=Math.PI/180,TextAnimatorDataProperty=function t(e,i,s){classCallCheck(this,t);var r={propType:!1},a=PropertyFactory$1.getProp,n=i.a;this.a={r:n.r?a(e,n.r,0,degToRads$5,s):r,rx:n.rx?a(e,n.rx,0,degToRads$5,s):r,ry:n.ry?a(e,n.ry,0,degToRads$5,s):r,sk:n.sk?a(e,n.sk,0,degToRads$5,s):r,sa:n.sa?a(e,n.sa,0,degToRads$5,s):r,s:n.s?a(e,n.s,1,.01,s):r,a:n.a?a(e,n.a,1,0,s):r,o:n.o?a(e,n.o,0,.01,s):r,p:n.p?a(e,n.p,1,0,s):r,sw:n.sw?a(e,n.sw,0,0,s):r,sc:n.sc?a(e,n.sc,1,0,s):r,fc:n.fc?a(e,n.fc,1,0,s):r,fh:n.fh?a(e,n.fh,0,0,s):r,fs:n.fs?a(e,n.fs,0,.01,s):r,fb:n.fb?a(e,n.fb,0,.01,s):r,t:n.t?a(e,n.t,0,0,s):r},this.s=TextSelectorProp$1.getTextSelectorProp(e,i.s,s),this.s.t=i.s.t},TextAnimatorProperty=function(){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.mHelper=new Matrix,s.defaultPropsArray=[],s._isFirstFrame=!0,s._hasMaskedPath=!1,s._frameId=-1,s._textData=t,s._renderType=e,s._elem=i,s._animatorsData=createSizedArray(s._textData.a.length),s._pathData={},s._moreOptions={alignment:{}},s.renderedLetters=[],s.lettersChangedFlag=!1,s.initDynamicPropertyContainer(i),s}return inherits(r,DynamicPropertyContainer),createClass(r,[{key:"addDynamicProperty",value:function(){console.log("see:","https://github.com/airbnb/lottie-web/blob/adb67aaed3058a331d93fe0b87df5129f9fcab57/player/js/utils/text/TextAnimatorProperty.js#L21:53")}},{key:"searchProperties",value:function(){var t=void 0,e=this._textData.a.length,i=void 0,s=PropertyFactory$1.getProp;for(t=0;t<e;t+=1)i=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,i,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m.a,1,0,this)}},{key:"getMeasures",value:function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i=this._moreOptions.alignment.v,s=this._animatorsData,r=this._textData,a=this.mHelper,n=this._renderType,o=this.renderedLetters.length,h=void 0,p=void 0,l=void 0,c=void 0,u=t.l,f=void 0,d=void 0,m=void 0,y=void 0,v=void 0,g=void 0,k=void 0,x=void 0,b=void 0,P=void 0,_=void 0,C=void 0,S=void 0,T=void 0,E=void 0;if(this._hasMaskedPath){if(E=this._pathData.m,!this._pathData.n||this._pathData._mdf){var A=E.v;this._pathData.r&&(A=A.reverse()),f={tLength:0,segments:[]},c=A._length-1;var w=void 0;for(l=C=0;l<c;l+=1)w=bez.buildBezierData(A.v[l],A.v[l+1],[A.o[l][0]-A.v[l][0],A.o[l][1]-A.v[l][1]],[A.i[l+1][0]-A.v[l+1][0],A.i[l+1][1]-A.v[l+1][1]]),f.tLength+=w.segmentLength,f.segments.push(w),C+=w.segmentLength;l=c,E.v.c&&(w=bez.buildBezierData(A.v[l],A.v[0],[A.o[l][0]-A.v[l][0],A.o[l][1]-A.v[l][1]],[A.i[0][0]-A.v[0][0],A.i[0][1]-A.v[0][1]]),f.tLength+=w.segmentLength,f.segments.push(w),C+=w.segmentLength),this._pathData.pi=f}if(f=this._pathData.pi,d=this._pathData.f.v,g=1,v=!(y=k=0),P=f.segments,d<0&&E.v.c)for(f.tLength<Math.abs(d)&&(d=-Math.abs(d)%f.tLength),g=(b=P[k=P.length-1].points).length-1;d<0;)d+=b[g].partialLength,(g-=1)<0&&(g=(b=P[k-=1].points).length-1);x=(b=P[k].points)[g-1],_=(m=b[g]).partialLength}c=u.length,p=h=0;var I,D=1.2*t.finalSize*.714,F=!0,M=void 0,L=void 0,R=void 0;I=s.length;var $=void 0,V=-1,O=void 0,N=void 0,z=void 0,B=d,j=k,G=g,q=-1,W=void 0,U=void 0,H=void 0,Y=void 0,K=void 0,X=void 0,J=void 0,Z=void 0,Q="",tt=this.defaultPropsArray,et=void 0;if(2===t.j||1===t.j){var it=0,st=0,rt=2===t.j?-.5:-1,at=0,nt=!0;for(l=0;l<c;l+=1)if(u[l].n){for(it&&(it+=st);at<l;)u[at].animatorJustifyOffset=it,at+=1;nt=!(it=0)}else{for(L=0;L<I;L+=1)(M=s[L].a).t.propType&&(nt&&2===t.j&&(st+=M.t.v*rt),($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars)).length?it+=M.t.v*$[0]*rt:it+=M.t.v*$*rt);nt=!1}for(it&&(it+=st);at<l;)u[at].animatorJustifyOffset=it,at+=1}for(l=0;l<c;l+=1){if(a.reset(),W=1,u[l].n)h=0,p+=t.yOffset,p+=F?1:0,d=B,F=!1,this._hasMaskedPath&&(g=G,x=(b=P[k=j].points)[g-1],_=(m=b[g]).partialLength,y=0),et=X=Z=Q="",tt=this.defaultPropsArray;else{if(this._hasMaskedPath){if(q!==u[l].line){switch(t.j){case 1:d+=C-t.lineWidths[u[l].line];break;case 2:d+=(C-t.lineWidths[u[l].line])/2}q=u[l].line}V!==u[l].ind&&(u[V]&&(d+=u[V].extra),d+=u[l].an/2,V=u[l].ind),d+=i[0]*u[l].an/200;var ot=0;for(L=0;L<I;L+=1)(M=s[L].a).p.propType&&(($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars)).length?ot+=M.p.v[0]*$[0]:ot+=M.p.v[0]*$),M.a.propType&&(($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars)).length?ot+=M.a.v[0]*$[0]:ot+=M.a.v[0]*$);for(v=!0;v;)d+ot<=y+_||!b?(S=(d+ot-y)/m.partialLength,N=x.point[0]+(m.point[0]-x.point[0])*S,z=x.point[1]+(m.point[1]-x.point[1])*S,a.translate(-i[0]*u[l].an/200,-i[1]*D/100),v=!1):b&&(y+=m.partialLength,(g+=1)>=b.length&&(g=0,b=P[k+=1]?P[k].points:E.v.c?P[k=g=0].points:(y-=m.partialLength,null)),b&&(x=m,_=(m=b[g]).partialLength));O=u[l].an/2-u[l].add,a.translate(-O,0,0)}else O=u[l].an/2-u[l].add,a.translate(-O,0,0),a.translate(-i[0]*u[l].an/200,-i[1]*D/100,0);for(L=0;L<I;L+=1)(M=s[L].a).t.propType&&($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars),0===h&&0===t.j||(this._hasMaskedPath?$.length?d+=M.t.v*$[0]:d+=M.t.v*$:$.length?h+=M.t.v*$[0]:h+=M.t.v*$));for(t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(U=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(Y=[t.fc[0],t.fc[1],t.fc[2]]),L=0;L<I;L+=1)(M=s[L].a).a.propType&&(($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars)).length?a.translate(-M.a.v[0]*$[0],-M.a.v[1]*$[1],M.a.v[2]*$[2]):a.translate(-M.a.v[0]*$,-M.a.v[1]*$,M.a.v[2]*$));for(L=0;L<I;L+=1)(M=s[L].a).s.propType&&(($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars)).length?a.scale(1+(M.s.v[0]-1)*$[0],1+(M.s.v[1]-1)*$[1],1):a.scale(1+(M.s.v[0]-1)*$,1+(M.s.v[1]-1)*$,1));for(L=0;L<I;L+=1){if(M=s[L].a,$=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars),M.sk.propType&&($.length?a.skewFromAxis(-M.sk.v*$[0],M.sa.v*$[1]):a.skewFromAxis(-M.sk.v*$,M.sa.v*$)),M.r.propType&&($.length?a.rotateZ(-M.r.v*$[2]):a.rotateZ(-M.r.v*$)),M.ry.propType&&($.length?a.rotateY(M.ry.v*$[1]):a.rotateY(M.ry.v*$)),M.rx.propType&&($.length?a.rotateX(M.rx.v*$[0]):a.rotateX(M.rx.v*$)),M.o.propType&&($.length?W+=(M.o.v*$[0]-W)*$[0]:W+=(M.o.v*$-W)*$),t.strokeWidthAnim&&M.sw.propType&&($.length?H+=M.sw.v*$[0]:H+=M.sw.v*$),t.strokeColorAnim&&M.sc.propType)for(K=0;K<3;K+=1)$.length?U[K]=U[K]+(M.sc.v[K]-U[K])*$[0]:U[K]=U[K]+(M.sc.v[K]-U[K])*$;if(t.fillColorAnim&&t.fc){if(M.fc.propType)for(K=0;K<3;K+=1)$.length?Y[K]=Y[K]+(M.fc.v[K]-Y[K])*$[0]:Y[K]=Y[K]+(M.fc.v[K]-Y[K])*$;M.fh.propType&&(Y=$.length?addHueToRGB(Y,M.fh.v*$[0]):addHueToRGB(Y,M.fh.v*$)),M.fs.propType&&(Y=$.length?addSaturationToRGB(Y,M.fs.v*$[0]):addSaturationToRGB(Y,M.fs.v*$)),M.fb.propType&&(Y=$.length?addBrightnessToRGB(Y,M.fb.v*$[0]):addBrightnessToRGB(Y,M.fb.v*$))}}for(L=0;L<I;L+=1)(M=s[L].a).p.propType&&($=s[L].s.getMult(u[l].anIndexes[L],r.a[L].s.totalChars),this._hasMaskedPath?$.length?a.translate(0,M.p.v[1]*$[0],-M.p.v[2]*$[1]):a.translate(0,M.p.v[1]*$,-M.p.v[2]*$):$.length?a.translate(M.p.v[0]*$[0],M.p.v[1]*$[1],-M.p.v[2]*$[2]):a.translate(M.p.v[0]*$,M.p.v[1]*$,-M.p.v[2]*$));if(t.strokeWidthAnim&&(X=H<0?0:H),t.strokeColorAnim&&(J="rgb("+Math.round(255*U[0])+","+Math.round(255*U[1])+","+Math.round(255*U[2])+")"),t.fillColorAnim&&t.fc&&(Z="rgb("+Math.round(255*Y[0])+","+Math.round(255*Y[1])+","+Math.round(255*Y[2])+")"),this._hasMaskedPath){if(a.translate(0,-t.ls),a.translate(0,i[1]*D/100+p,0),r.p.p){T=(m.point[1]-x.point[1])/(m.point[0]-x.point[0]);var ht=180*Math.atan(T)/Math.PI;m.point[0]<x.point[0]&&(ht+=180),a.rotate(-ht*Math.PI/180)}a.translate(N,z,0),d-=i[0]*u[l].an/200,u[l+1]&&V!==u[l+1].ind&&(d+=u[l].an/2,d+=t.tr/1e3*t.finalSize)}else{switch(a.translate(h,p,0),t.ps&&a.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:a.translate(u[l].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[u[l].line]),0,0);break;case 2:a.translate(u[l].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[u[l].line])/2,0,0)}a.translate(0,-t.ls),a.translate(O,0,0),a.translate(i[0]*u[l].an/200,i[1]*D/100,0),h+=u[l].l+t.tr/1e3*t.finalSize}"html"===n?Q=a.toCSS():"svg"===n?Q=a.to2dCSS():tt=[a.props[0],a.props[1],a.props[2],a.props[3],a.props[4],a.props[5],a.props[6],a.props[7],a.props[8],a.props[9],a.props[10],a.props[11],a.props[12],a.props[13],a.props[14],a.props[15]],et=W}o<=l?(R=new LetterProps(et,X,J,Z,Q,tt),this.renderedLetters.push(R),o+=1,this.lettersChangedFlag=!0):(R=this.renderedLetters[l],this.lettersChangedFlag=R.update(et,X,J,Z,Q,tt)||this.lettersChangedFlag)}}}},{key:"getValue",value:function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())}}]),r}();function buildShapeString(t,e,i,s){if(0===e)return"";var r=t.o,a=t.i,n=t.v,o=void 0,h=" M"+s.applyToPointStringified(n[0][0],n[0][1]);for(o=1;o<e;o+=1)h+=" C"+s.applyToPointStringified(r[o-1][0],r[o-1][1])+" "+s.applyToPointStringified(a[o][0],a[o][1])+" "+s.applyToPointStringified(n[o][0],n[o][1]);return i&&e&&(h+=" C"+s.applyToPointStringified(r[o-1][0],r[o-1][1])+" "+s.applyToPointStringified(a[0][0],a[0][1])+" "+s.applyToPointStringified(n[0][0],n[0][1]),h+="z"),h}var ITextElement=function(){function t(){classCallCheck(this,t),this.emptyProp=new LetterProps}return createClass(t,[{key:"initElement",value:function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)}},{key:"prepareFrame",value:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)}},{key:"createPathShape",value:function(t,e){var i=void 0,s=e.length,r=void 0,a="";for(i=0;i<s;i+=1)a+=buildShapeString(r=e[i].ks.k,r.i.length,!0,t);return a}},{key:"updateDocumentData",value:function(t,e){this.textProperty.updateDocumentData(t,e)}},{key:"canResizeFont",value:function(t){this.textProperty.canResizeFont(t)}},{key:"setMinimumFontSize",value:function(t){this.textProperty.setMinimumFontSize(t)}},{key:"applyTextPropertiesToMatrix",value:function(t,e,i,s,r){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(s,r,0)}},{key:"buildColor",value:function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"}},{key:"destroy",value:function(){}}]),t}(),CVTextElement=function(t){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.tHelper=createTag("canvas"),s.textSpans=[],s.yOffset=0,s.fillColorAnim=!1,s.strokeColorAnim=!1,s.strokeWidthAnim=!1,s.stroke=!1,s.fill=!1,s.justifyOffset=0,s.currentRender=null,s.renderType="canvas",s.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},s.initElement(t,e,i),s}return inherits(r,t),createClass(r,[{key:"buildNewText",value:function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var i=!1;t.sc&&(i=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var s,r=this.globalData.fontManager.getFontByName(t.f),a=void 0,n=t.l,o=this.mHelper;this.stroke=i,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var h=void 0,p=void 0,l=void 0,c=void 0,u=void 0,f=void 0,d=void 0,m=void 0,y=void 0,v=void 0,g=this.data.singleShape,k=t.tr/1e3*t.finalSize,x=0,b=0,P=!0,_=0;for(a=0;a<s;a+=1){for(p=(h=this.globalData.fontManager.getCharData(t.finalText[a],r.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&h.data||{},o.reset(),g&&n[a].n&&(x=-k,b+=t.yOffset,b+=P?1:0,P=!1),d=(u=p.shapes?p.shapes[0].it:[]).length,o.scale(t.finalSize/100,t.finalSize/100),g&&this.applyTextPropertiesToMatrix(t,o,n[a].line,x,b),y=createSizedArray(d),f=0;f<d;f+=1){for(c=u[f].ks.k.i.length,m=u[f].ks.k,v=[],l=1;l<c;l+=1)1===l&&v.push(o.applyToX(m.v[0][0],m.v[0][1],0),o.applyToY(m.v[0][0],m.v[0][1],0)),v.push(o.applyToX(m.o[l-1][0],m.o[l-1][1],0),o.applyToY(m.o[l-1][0],m.o[l-1][1],0),o.applyToX(m.i[l][0],m.i[l][1],0),o.applyToY(m.i[l][0],m.i[l][1],0),o.applyToX(m.v[l][0],m.v[l][1],0),o.applyToY(m.v[l][0],m.v[l][1],0));v.push(o.applyToX(m.o[l-1][0],m.o[l-1][1],0),o.applyToY(m.o[l-1][0],m.o[l-1][1],0),o.applyToX(m.i[0][0],m.i[0][1],0),o.applyToY(m.i[0][0],m.i[0][1],0),o.applyToX(m.v[0][0],m.v[0][1],0),o.applyToY(m.v[0][0],m.v[0][1],0)),y[f]=v}g&&(x+=n[a].l,x+=k),this.textSpans[_]?this.textSpans[_].elem=y:this.textSpans[_]={elem:y},_+=1}}},{key:"renderInnerContent",value:function(){var t=this.canvasContext;t.font=this.values.fValue,t.setLineCap("butt"),t.setLineJoin("miter"),t.setMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var e,i=void 0,s=void 0,r=void 0,a=void 0,n=void 0,o=this.textAnimator.renderedLetters,h=this.textProperty.currentData.l;e=h.length;var p=void 0,l=null,c=null,u=null,f=void 0,d=void 0;for(i=0;i<e;i+=1)if(!h[i].n){if((p=o[i])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(p.p),this.globalData.renderer.ctxOpacity(p.o)),this.fill){for(p&&p.fc?l!==p.fc&&(l=p.fc,t.setFillStyle(p.fc)):l!==this.values.fill&&(l=this.values.fill,t.setFillStyle(this.values.fill)),r=(f=this.textSpans[i].elem).length,this.globalData.canvasContext.beginPath(),s=0;s<r;s+=1)for(n=(d=f[s]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),a=2;a<n;a+=6)this.globalData.canvasContext.bezierCurveTo(d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(p&&p.sw?u!==p.sw&&(u=p.sw,t.setLineWidth(p.sw)):u!==this.values.sWidth&&(u=this.values.sWidth,t.setLineWidth(this.values.sWidth)),p&&p.sc?c!==p.sc&&(c=p.sc,t.setStrokeStyle(p.sc)):c!==this.values.stroke&&(c=this.values.stroke,t.setStrokeStyle(this.values.stroke)),r=(f=this.textSpans[i].elem).length,this.globalData.canvasContext.beginPath(),s=0;s<r;s+=1)for(n=(d=f[s]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),a=2;a<n;a+=6)this.globalData.canvasContext.bezierCurveTo(d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}p&&this.globalData.renderer.restore()}}}]),r}(Mixin(BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement)),NullElement=function(t){function r(t,e,i){classCallCheck(this,r);var s=possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return s.initFrame(),s.initBaseData(t,e,i),s.initFrame(),s.initTransform(t,e,i),s.initHierarchy(),s}return inherits(r,t),createClass(r,[{key:"prepareFrame",value:function(t){this.prepareProperties(t,!0)}},{key:"renderFrame",value:function(){}},{key:"getBaseElement",value:function(){return null}},{key:"destroy",value:function(){}},{key:"sourceRectAtTime",value:function(){}},{key:"hide",value:function(){}}]),r}(Mixin(BaseElement,TransformElement,HierarchyElement,FrameElement)),BaseRenderer=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"checkLayers",value:function(t){var e=void 0,i=this.layers.length,s=void 0;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()}},{key:"createItem",value:function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t)}return this.createNull(t)}},{key:"createCamera",value:function(){throw new Error("You're using a 3d camera. Try the html renderer.")}},{key:"buildAllItems",value:function(){var t=void 0,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()}},{key:"includeLayers",value:function(t){this.completeLayers=!1;var e=void 0,i=t.length,s=void 0,r=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<r;){if(this.layers[s].id===t[e].id){this.layers[s]=t[e];break}s+=1}}},{key:"setProjectInterface",value:function(t){this.globalData.projectInterface=t}},{key:"initItems",value:function(){this.globalData.progressiveLoad||this.buildAllItems()}},{key:"buildElementParenting",value:function(t,e,i){for(var s=this.elements,r=this.layers,a=0,n=r.length;a<n;)r[a].ind===e&&(s[a]&&!0!==s[a]?(i.push(s[a]),s[a].setAsParent(),void 0!==r[a].parent?this.buildElementParenting(t,r[a].parent,i):t.setHierarchy(i)):(this.buildItem(a),this.addPendingElement(t))),a+=1}},{key:"addPendingElement",value:function(t){this.pendingElements.push(t)}},{key:"searchExtraCompositions",value:function(t){var e=void 0,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e]);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}}},{key:"setupGlobalData",value:function(t,e){this.globalData.fontManager=new Font,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}}}]),t}(),CVCompElement=void 0,CanvasRenderer=function(){function s(t,e){classCallCheck(this,s);var i=possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return i.animationItem=t,i.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,canvas:e&&e.canvas,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||""},i.renderConfig.dpr=e&&e.dpr||1,i.renderedFrame=-1,i.globalData={frameNum:-1,_mdf:!1,renderConfig:i.renderConfig,currentGlobalAlpha:-1},i.contextData=new CVContextData,i.elements=[],i.pendingElements=[],i.transformMat=new Matrix,i.completeLayers=!1,i.rendererType="canvas",i}return inherits(s,BaseRenderer),createClass(s,[{key:"createShape",value:function(t){return new CVShapeElement(t,this.globalData,this)}},{key:"createText",value:function(t){return new CVTextElement(t,this.globalData,this)}},{key:"createImage",value:function(t){return new CVImageElement(t,this.globalData,this)}},{key:"createComp",value:function(t){return new CVCompElement(t,this.globalData,this)}},{key:"createSolid",value:function(t){return new CVSolidElement(t,this.globalData,this)}},{key:"createNull",value:function(t){return new NullElement(t,this.globalData,this)}},{key:"ctxTransform",value:function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var i=this.contextData.cTr.props;this.canvasContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])}},{key:"ctxOpacity",value:function(t){if(!this.renderConfig.clearCanvas){var e=this.canvasContext.globalAlpha*(t<0?0:t);return this.canvasContext.globalAlpha=e,this.canvasContext.setGlobalAlpha(e),void(this.globalData.currentGlobalAlpha=this.contextData.cO)}this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.canvasContext.setGlobalAlpha(this.contextData.cO),this.globalData.currentGlobalAlpha=this.contextData.cO)}},{key:"reset",value:function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()}},{key:"save",value:function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i=void 0,s=this.contextData.saved[this.contextData.cArrPos];for(i=0;i<16;i+=1)s[i]=e[i];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()}},{key:"restore",value:function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e=this.contextData.saved[this.contextData.cArrPos],i=void 0,s=this.contextData.cTr.props;for(i=0;i<16;i+=1)s[i]=e[i];this.canvasContext.setTransform(e[0],e[1],e[4],e[5],e[12],e[13]),e=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=e,this.globalData.currentGlobalAlpha!==e&&(this.canvasContext.globalAlpha=e,this.canvasContext.setGlobalAlpha(e),this.globalData.currentGlobalAlpha=e)}else this.canvasContext.restore()}},{key:"configAnimation",value:function(t){this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()}},{key:"updateContainerSize",value:function(){this.reset();var t,e;t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr;var i=void 0,s=void 0;if(-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var r=this.renderConfig.preserveAspectRatio.split(" "),a=r[1]||"meet",n=r[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);(i=t/e)<(s=this.transformCanvas.w/this.transformCanvas.h)&&"meet"===a||s<i&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(s<i&&"meet"===a||i<s&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(s<i&&"meet"===a||i<s&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(i<s&&"meet"===a||s<i&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(i<s&&"meet"===a||s<i&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip()}},{key:"destroy",value:function(){var t=void 0;for(t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0}},{key:"renderFrame",value:function(t){if(!(this.renderedFrame===t&&!0===this.renderConfig.clearCanvas||this.destroyed||-1===t)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas,this.globalData.projectInterface.currentFrame=t;var e=void 0,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=0;e<i;e++)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),e=i-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame(0===e);this.canvasContext.draw&&this.canvasContext.draw(),!0!==this.renderConfig.clearCanvas||this.save(),this.restore()}}}},{key:"buildItem",value:function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);(e[t]=i).initExpressions()}}},{key:"checkPendingElements",value:function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}}},{key:"hide",value:function(){}},{key:"show",value:function(){}}]),s}();CVCompElement=CVCompElementFactory(CanvasRenderer);var assetLoader={load:function(t,s,e){var r=this;if(t.includes(".zip"))return loadZipFiles(t).then(function(t){var e=t.data,i=t.tempDir;r.path=i,s(e)}).catch(function(t){"function"==typeof e&&e(t)});api.request({url:t,success:function(t){s(t.data)},fail:function(t){"function"==typeof e&&e(t)}})}},fs="function"==typeof api.getFileSystemManager?api.getFileSystemManager():{};function downloadZip(t){return new Promise(function(e){api.downloadFile({url:t,success:function(t){console.log("downloadZip",t),e(t.tempFilePath)}})})}function ensureDir(t){for(var e=t.split("/"),i=e.length,s=1;s<=i;){var r=e.slice(0,s).join("/");try{fs.mkdirSync(r)}catch(t){console.warn("ensureDir ["+r+"]",t)}s++}}function unzipFile(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:getUserDataPath()+"/tmp-unzip";return new Promise(function(e){ensureDir(i),fs.unzip({targetPath:i,zipFilePath:t,success:function(t){console.log("unzipFile",t),e({targetPath:i})},fail:function(t){console.error("unzipFile",t)}})})}function getDirStat(t){return fs.statSync(t)}function getFileTree(s){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return fs.readdirSync(s).forEach(function(t){var e=s+"/"+t,i=getDirStat(e).isDirectory();r[t]=i?getFileTree(e):e}),r}function loadZipFiles(t){var e=getUserDataPath()+"/tmp-unzip/"+easyHashCode(t);return downloadZip(t).then(function(t){return unzipFile(t,e)}).then(function(t){var e=t.targetPath,i=flatAETree(e,getFileTree(e)),s=i.dir,r=i.dataJsonPath;if(r)return{tempDir:s,data:JSON.parse(fs.readFileSync(r,"utf-8")||"{}")}})}function flatAETree(t,e){if("string"==typeof e){var i=t.split("/");return i.pop(),{dir:i.join("/")+"/",dataJsonPath:e.endsWith("data.json")?e:""}}if(e&&"object"===(void 0===e?"undefined":_typeof(e)))for(var s=Object.keys(e),r=0;r<s.length;r++)if("__MACOSX"!==s[r]){var a=flatAETree(t+"/"+s[r],e[s[r]]);if(a.dataJsonPath)return a}return{dir:t+"/",dataJsonPath:""}}function easyHashCode(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=t.length,i=0,s=0;i<e;){s=(s<<5)-s+t.charCodeAt(i),s&=s,i++}return Math.abs((""+s).toString(16))}var BaseEvent=function(){function t(){classCallCheck(this,t)}return createClass(t,[{key:"triggerEvent",value:function(t,e){if(this._cbs[t])for(var i=this._cbs[t].length,s=0;s<i;s++)this._cbs[t][s](e)}},{key:"addEventListener",value:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)}},{key:"removeEventListener",value: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}}]),t}();function dataFunctionManager(){function c(t,e){for(var i=0,s=e.length;i<s;){if(e[i].id===t)return e[i].layers.__used?JSON.parse(JSON.stringify(e[i].layers)):(e[i].layers.__used=!0,e[i].layers);i+=1}}function u(t){var e=void 0,i=void 0,s=void 0;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)f(t[e].ks.k);else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&f(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&f(t[e].ks.k[i].e[0]);else"gr"===t[e].ty&&u(t[e].it)}function f(t){var e=void 0,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 o(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])&&void 0))}var s,i=(s=[4,4,14],function(t){if(o(s,t.v)&&(r(t.layers),t.assets)){var e=void 0,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&r(t.assets[e].layers)}});function r(t){var e,i,s=void 0,r=t.length;for(s=0;s<r;s+=1)5===t[s].ty&&(e=t[s],void 0,i=e.t.d,e.t.d={k:[{s:i,t:0}]})}var h,a,n=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e=void 0,i=t.chars.length,s=void 0,r=void 0,a=void 0,n=void 0;for(e=0;e<i;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(r=(n=t.chars[e].data.shapes[0].it).length,s=0;s<r;s+=1)(a=n[s].ks.k).__converted||(f(n[s].ks.k),a.__converted=!0)}}),p=(a=[4,1,9],function(t){if(o(a,t.v)&&(d(t.layers),t.assets)){var e=void 0,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&d(t.assets[e].layers)}});function l(t){var e=void 0,i=t.length,s=void 0,r=void 0;for(e=0;e<i;e+=1)if("gr"===t[e].ty)l(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(r=t[e].c.k.length,s=0;s<r;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function d(t){var e=void 0,i=t.length;for(e=0;e<i;e+=1)4===t[e].ty&&l(t[e].shapes)}var m,y=(m=[4,4,18],function(t){if(o(m,t.v)&&(g(t.layers),t.assets)){var e=void 0,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&g(t.assets[e].layers)}});function v(t){var e=void 0,i=void 0,s=void 0;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&(t[e].ks.k[i].s[0].c=t[e].closed),t[e].ks.k[i].e&&(t[e].ks.k[i].e[0].c=t[e].closed);else"gr"===t[e].ty&&v(t[e].it)}function g(t){var e=void 0,i=void 0,s=t.length,r=void 0,a=void 0,n=void 0,o=void 0;for(i=0;i<s;i+=1){if((e=t[i]).hasMask){var h=e.masksProperties;for(a=h.length,r=0;r<a;r+=1)if(h[r].pt.k.i)h[r].pt.k.c=h[r].cl;else for(o=h[r].pt.k.length,n=0;n<o;n+=1)h[r].pt.k[n].s&&(h[r].pt.k[n].s[0].c=h[r].cl),h[r].pt.k[n].e&&(h[r].pt.k[n].e[0].c=h[r].cl)}4===e.ty&&v(e.shapes)}}function k(t){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={};return t.completeData=function(t,e){t.__complete||(p(t),i(t),n(t),y(t),function t(e,i){var s=void 0,r=void 0,a=e.length,n=void 0,o=void 0,h=void 0,p=void 0;for(r=0;r<a;r+=1)if("ks"in(s=e[r])&&!s.completed){if(s.completed=!0,s.tt&&(e[r-1].td=s.tt),s.hasMask){var l=s.masksProperties;for(o=l.length,n=0;n<o;n+=1)if(l[n].pt.k.i)f(l[n].pt.k);else for(p=l[n].pt.k.length,h=0;h<p;h+=1)l[n].pt.k[h].s&&f(l[n].pt.k[h].s[0]),l[n].pt.k[h].e&&f(l[n].pt.k[h].e[0])}0===s.ty?(s.layers=c(s.refId,i),t(s.layers,i)):4===s.ty?u(s.shapes):5===s.ty&&k(s)}}(t.layers,t.assets),t.__complete=!0)},t}var dataManager=dataFunctionManager(),expressionsPlugin={initExpressions:function(t){var e=0,i=[];t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0===(e-=1)&&function(){var t,e=i.length;for(t=0;t<e;t+=1)i[t].release();i.length=0}()},t.renderer.globalData.registerExpressionProperty=function(t){-1===i.indexOf(t)&&i.push(t)}}},ImagePreloader=function(){function t(){classCallCheck(this,t),this.assetsPath="",this.path="",this.totalAssets=0,this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.canvas=null,this.images=[]}return createClass(t,[{key:"imageLoaded",value:function(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}},{key:"getAssetsPath",value: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}},{key:"getImage",value:function(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}}},{key:"createImageData",value:function(t){var i=this,e=this.getAssetsPath(t,this.assetsPath,this.path),r={src:e};return this.loadImage(e,function(s){if(s){if(i.canvas&&i.canvas.createImage){var e=i.canvas.createImage();return void new Promise(function(t){e.onload=t,e.onerror=t,(r.src=e).src=s}).then(function(){return i.imageLoaded()})}new Promise(function(t){return api.getImageInfo({src:s,success:function(t){var e=t.width,i=t.height;r.src=s,r.width=e,r.height=i},complete:t})}).then(function(){return i.imageLoaded()})}}),{img:r,assetData:t}}},{key:"loadImage",value:function(t,e){var i=this.imageLoaded.bind(this);t.startsWith("data:")?loadBase64Image(t).then(function(t){console.log("loadImage base64",t),e(t)},function(t){console.log("loadBase64Image:fail",t),e()}):t.startsWith("http")?api.downloadFile({url:t,success:function(t){e(t.tempFilePath)},fail:function(){e(),i()}}):e(t)}},{key:"loaded",value:function(){return this.totalImages===this.loadedAssets}},{key:"loadAssets",value:function(t,e){this.imagesLoadedCb=e;var i=void 0,s=t.length;for(i=0;i<s;i+=1)t[i].layers||(this.images.push(this.createImageData(t[i])),this.totalImages+=1)}},{key:"setPath",value:function(t){this.path=t||""}},{key:"setAssetsPath",value:function(t){this.assetsPath=t||""}},{key:"setCanvas",value:function(t){this.canvas=t}},{key:"destroy",value:function(){this.imagesLoadedCb=null,this.images.length=0}}]),t}();function easyHashCode$1(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=t.length,i=0,s=0;i<e;){s=(s<<5)-s+t.charCodeAt(i),s&=s,i++}return Math.abs((""+s).toString(16))}function loadBase64Image(l){return new Promise(function(t,e){var i=/data:image\/(\w+);base64,(.*)/.exec(l)||[],s=slicedToArray(i,3),r=s[1],a=s[2];if(!r)return e(new Error("ERROR_BASE64SRC_PARSE"));var n=api.base64ToArrayBuffer(a),o=api.getFileSystemManager();if(!o||"undefined"!=typeof my&&my.ap)try{return t(new Uint8ClampedArray(n))}catch(t){return e()}var h="lottie-"+easyHashCode$1(a),p=getUserDataPath()+"/"+h+"."+r;try{if(o.accessSync(p))return t(p)}catch(t){}o.writeFile({filePath:p,data:n,encoding:"binary",success:function(){t(p)},fail:function(t){console.error(t.errMsg),e(new Error("ERROR_BASE64SRC_WRITE"))}})})}function registerComposition(t){this.compositions.push(t)}function ProjectInterface(){function t(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 t.compositions=[],t.currentFrame=0,t.registerComposition=registerComposition,t}var AnimationItem=function(){function e(){classCallCheck(this,e);var t=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._cbs=[],t.name="",t.path="",t.isLoaded=!1,t.currentFrame=0,t.currentRawFrame=0,t.totalFrames=0,t.frameRate=0,t.frameMult=0,t.playSpeed=1,t.playDirection=1,t.pendingElements=0,t.playCount=0,t.animationData={},t.assets=[],t.isPaused=!0,t.autoplay=!1,t.loop=!0,t.renderer=null,t.animationID=randomString(10),t.assetsPath="",t.timeCompleted=0,t.segmentPos=0,t.subframeEnabled=subframeEnabled,t.segments=[],t._idle=!0,t.projectInterface=ProjectInterface(),t.imagePreloader=new ImagePreloader,t}return inherits(e,BaseEvent),createClass(e,[{key:"fixMissingApi",value:function(s){[{fn:"setGlobalAlpha",key:"globalAlpha"},{fn:"setFillStyle",key:"fillStyle"},{fn:"setFontSize",key:"font"},{fn:"setLineCap",key:"lineCap"},{fn:"setLineJoin",key:"lineJoin"},{fn:"setLineWidth",key:"lineWidth"},{fn:"setMiterLimit",key:"miterLimit"},{fn:"setStrokeStyle",key:"strokeStyle"}].forEach(function(t){var e=t.fn,i=t.key;"function"!=typeof s[e]&&Object.defineProperty(s,e,{value:function(t){s[i]=t}})})}},{key:"setParams",value:function(t){var e=this;if(this.fixMissingApi(t.rendererSettings.context),t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container),this.renderer=new CanvasRenderer(this,t.rendererSettings),this.renderer.setProjectInterface(this.projectInterface),this.animType="canvas",""===t.loop||null===t.loop?this.loop=!1:!1===t.loop?this.loop=!1:!0===t.loop?this.loop=!0:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.hasTriggerplay=!1,this.name=t.name?t.name:"",this.autoloadSegments=!t.autoloadSegments||t.autoloadSegments,this.assetsPath=t.assetsPath,t.animationData?this.configAnimation(t.animationData):t.path&&(-1===t.path.lastIndexOf(".zip")&&"json"!==t.path.substr(-4)&&("/"!==t.path.substr(-1,1)&&(t.path+="/"),t.path+="data.json"),-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")),assetLoader.load.call(this,t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this))),api.createIntersectionObserver){var i=t.rendererSettings.context.canvasId,s=api.createIntersectionObserver(this.context);(this.$observer=s).relativeToViewport({bottom:10,top:10,left:0,right:10}).observe("#"+i,function(t){e.hasTriggerplay&&(0<t.intersectionRatio?e.play():e.stop())})}}},{key:"includeLayers",value: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=void 0,s=e.length,r=t.layers,a=void 0,n=r.length;for(a=0;a<n;a+=1)for(i=0;i<s;){if(e[i].id===r[a].id){e[i]=r[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(s=t.assets.length,i=0;i<s;i+=1)this.animationData.assets.push(t.assets[i]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()}},{key:"loadNextSegment",value: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,assetLoader.load(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))}},{key:"loadSegments",value:function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()}},{key:"imagesLoaded",value:function(){this.trigger("loaded_images"),this.checkLoaded()}},{key:"preloadImages",value:function(){this.imagePreloader.setCanvas(this.renderer.renderConfig.canvas),this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))}},{key:"configAnimation",value:function(t){this.renderer&&(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.renderer.searchExtraCompositions(t.assets),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded())}},{key:"waitForFontsLoaded",value:function(){this.renderer&&this.checkLoaded()}},{key:"checkLoaded",value:function(){!this.isLoaded&&this.renderer.globalData.fontManager.loaded()&&this.imagePreloader.loaded()&&(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())}},{key:"resize",value:function(){this.renderer.updateContainerSize()}},{key:"setSubframe",value:function(t){this.subframeEnabled=!!t}},{key:"gotoFrame",value:function(){this.currentFrame=this.subframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()}},{key:"renderFrame",value:function(){!1!==this.isLoaded&&this.renderer&&this.renderer.renderFrame(this.currentFrame+this.firstFrame)}},{key:"play",value:function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.hasTriggerplay=!0,this.trigger("_active")))}},{key:"pause",value:function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"))}},{key:"togglePause",value:function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())}},{key:"stop",value:function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this.setCurrentRawFrameValue(0))}},{key:"goToAndStop",value:function(t,e,i){i&&this.name!==i||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())}},{key:"goToAndPlay",value:function(t,e,i){this.goToAndStop(t,e,i),this.play()}},{key:"advanceTime",value:function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e%this.totalFrames)||(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.trigger("loopComplete"))):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}}},{key:"adjustSegment",value:function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],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.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")}},{key:"setSegment",value: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.timeCompleted=this.totalFrames=e-t,-1!==i&&this.goToAndStop(i,!0)}},{key:"playSegments",value:function(t,e){if("object"===_typeof(t[0])){var i=void 0,s=t.length;for(i=0;i<s;i+=1)this.segments.push(t[i])}else this.segments.push(t);e&&this.checkSegments(0),this.isPaused&&this.play()}},{key:"resetSegments",value:function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)}},{key:"checkSegments",value:function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)}},{key:"destroy",value:function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null,this.$observer&&this.$observer.disconnect())}},{key:"setCurrentRawFrameValue",value:function(t){this.currentRawFrame=t,this.gotoFrame()}},{key:"setSpeed",value:function(t){this.playSpeed=t,this.updaFrameModifier()}},{key:"setDirection",value:function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()}},{key:"updaFrameModifier",value:function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection}},{key:"getPath",value:function(){return this.path}},{key:"getAssetsPath",value: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}},{key:"getAssetData",value:function(t){for(var e=0,i=this.assets.length;e<i;){if(t===this.assets[e].id)return this.assets[e];e+=1}}},{key:"hide",value:function(){this.renderer.hide()}},{key:"show",value:function(){this.renderer.show()}},{key:"getDuration",value:function(t){return t?this.totalFrames:this.totalFrames/this.frameRate}},{key:"trigger",value:function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult));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)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))}}]),e}(),AnimationManager=function(){function t(){classCallCheck(this,t),this.moduleOb={},this.registeredAnimations=[],this.initTime=0,this.len=0,this.playingAnimationsNum=0,this._stopped=!0,this._isFrozen=!1,this.raf=raf}return createClass(t,[{key:"removeElement",value:function(t){for(var e=0,i=t.target,s=this.registeredAnimations;e<this.len;)s[e].animation===i&&(s.splice(e,1),e-=1,this.len-=1,i.isPaused||this.subtractPlayingCount()),e+=1}},{key:"getRegisteredAnimations",value:function(){var t=this.registeredAnimations,e=void 0,i=t.length,s=[];for(e=0;e<i;e+=1)s.push(t[e].animation);return s}},{key:"addPlayingCount",value:function(){this.playingAnimationsNum+=1,this.activate()}},{key:"subtractPlayingCount",value:function(){this.playingAnimationsNum-=1}},{key:"setupAnimation",value:function(t,e){t.addEventListener("destroy",this.removeElement.bind(this)),t.addEventListener("_active",this.addPlayingCount.bind(this)),t.addEventListener("_idle",this.subtractPlayingCount.bind(this)),this.registeredAnimations.push({elem:e,animation:t}),this.len+=1}},{key:"loadAnimation",value:function(t){var e=new AnimationItem;return this.setupAnimation(e,null),e.setParams(t),e}},{key:"setSpeed",value:function(t,e){var i=void 0,s=this.registeredAnimations;for(i=0;i<this.len;i+=1)s[i].animation.setSpeed(t,e)}},{key:"setDirection",value:function(t,e){var i=void 0,s=this.registeredAnimations;for(i=0;i<this.len;i+=1)s[i].animation.setDirection(t,e)}},{key:"play",value:function(t){var e=void 0,i=this.registeredAnimations;for(e=0;e<this.len;e+=1)i[e].animation.play(t)}},{key:"resume",value:function(t){var e=~~(t-this.initTime),i=this.registeredAnimations,s=void 0;for(s=0;s<this.len;s+=1)i[s].animation.advanceTime(e);this.initTime=t,this.playingAnimationsNum&&!this._isFrozen?this.raf(this.resume.bind(this)):this._stopped=!0}},{key:"first",value:function(t){this.initTime=t,this.raf(this.resume.bind(this))}},{key:"pause",value:function(t){var e=void 0,i=this.registeredAnimations;for(e=0;e<this.len;e+=1)i[e].animation.pause(t)}},{key:"goToAndStop",value:function(t,e,i){var s=void 0,r=this.registeredAnimations;for(s=0;s<this.len;s+=1)r[s].animation.goToAndStop(t,e,i)}},{key:"stop",value:function(t){var e=void 0,i=this.registeredAnimations;for(e=0;e<this.len;e+=1)i[e].animation.stop(t)}},{key:"togglePause",value:function(t){var e=void 0,i=this.registeredAnimations;for(e=0;e<this.len;e+=1)i[e].animation.togglePause(t)}},{key:"destroy",value:function(t){var e=void 0,i=this.registeredAnimations;for(e=this.len-1;0<=e;e-=1)i[e].animation.destroy(t);this.registeredAnimations.length=0,this.len=0}},{key:"resize",value:function(){var t=void 0,e=this.registeredAnimations;for(t=0;t<this.len;t+=1)e[t].animation.resize()}},{key:"activate",value:function(){!this._isFrozen&&this.playingAnimationsNum&&this._stopped&&(this.raf(this.first.bind(this)),this._stopped=!1)}},{key:"freeze",value:function(){this._isFrozen=!0}},{key:"unfreeze",value:function(){this._isFrozen=!1,this.activate()}}]),t}(),AnimationManager$1=new AnimationManager,enableProxyLog=!0;function enableDebug(t){enableProxyLog=!!t}var methods=["save","setFillStyle","moveTo","bezierCurveTo","closePath","fill","draw","beginPath","stroke","setTransform"];function proxyCtx(a){methods.forEach(function(s){var r=a[s];"function"==typeof r&&Object.defineProperty(a,s,{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return enableProxyLog&&console.log.call(null,["ctx."+s+"("].concat(e.join(",")).concat(")").join("")),r.apply(a,e)}})}),"undefined"!=typeof Proxy&&new Proxy(a,{set:function(t,e,i){console.log("ctx."+e+" = "+i),a[e]=i}})}function debugElapsedTimeFactory(){var i={};return{start:function(t){i[t]=+new Date},end:function(t){var e=i[t];if(void 0===e)throw new Error("debugElapsedTimeFactory start("+t+") is not invoke before end()");console.log("debug:"+t,+new Date-e+"ms"),delete i[t]}}}var debug=debugElapsedTimeFactory();exports.api=api,exports.debug=debug,exports.default=AnimationManager$1,exports.enableDebug=enableDebug,exports.proxyCtx=proxyCtx;