=this.p.keyframes[this.p.keyframes.length-1].t?(m=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/c,0),P=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/c,0)):(m=this.p.pv,P=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/c,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){m=[],P=[];var p=this.px,x=this.py;p._caching.lastFrame+p.offsetTime<=p.keyframes[0].t?(m[0]=p.getValueAtTime((p.keyframes[0].t+.01)/c,0),m[1]=x.getValueAtTime((x.keyframes[0].t+.01)/c,0),P[0]=p.getValueAtTime(p.keyframes[0].t/c,0),P[1]=x.getValueAtTime(x.keyframes[0].t/c,0)):p._caching.lastFrame+p.offsetTime>=p.keyframes[p.keyframes.length-1].t?(m[0]=p.getValueAtTime(p.keyframes[p.keyframes.length-1].t/c,0),m[1]=x.getValueAtTime(x.keyframes[x.keyframes.length-1].t/c,0),P[0]=p.getValueAtTime((p.keyframes[p.keyframes.length-1].t-.01)/c,0),P[1]=x.getValueAtTime((x.keyframes[x.keyframes.length-1].t-.01)/c,0)):(m=[p.pv,x.pv],P[0]=p.getValueAtTime((p._caching.lastFrame+p.offsetTime-.01)/c,p.offsetTime),P[1]=x.getValueAtTime((x._caching.lastFrame+x.offsetTime-.01)/c,x.offsetTime))}else P=t,m=P;this.v.rotate(-Math.atan2(m[1]-P[1],m[0]-P[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}}function i(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;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)}function s(){}function n(o){this._addDynamicProperty(o),this.elem.addDynamicProperty(o),this._isDirty=!0}function a(o,c,m){if(this.elem=o,this.frameId=-1,this.propType="transform",this.data=c,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(m||o),c.p&&c.p.s?(this.px=PropertyFactory.getProp(o,c.p.x,0,0,this),this.py=PropertyFactory.getProp(o,c.p.y,0,0,this),c.p.z&&(this.pz=PropertyFactory.getProp(o,c.p.z,0,0,this))):this.p=PropertyFactory.getProp(o,c.p||{k:[0,0,0]},1,0,this),c.rx){if(this.rx=PropertyFactory.getProp(o,c.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(o,c.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(o,c.rz,0,degToRads,this),c.or.k[0].ti){var P,p=c.or.k.length;for(P=0;P0;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e0?Math.floor(p):Math.ceil(p),y=this.pMatrix.props,M=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var d=0;if(p>0){for(;db;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),d-=1;x&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-x,!0),d-=x)}i=this.data.m===1?0:this._currentCopies-1,s=this.data.m===1?1:-1,n=this._currentCopies;for(var f,g;n;){if(e=this.elemsData[i].it,r=e[e.length-1].transform.mProps.v.props,g=r.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._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),d!==0){for((i!==0&&s===1||i!==this._currentCopies-1&&s===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(M[0],M[1],M[2],M[3],M[4],M[5],M[6],M[7],M[8],M[9],M[10],M[11],M[12],M[13],M[14],M[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]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),f=0;f0&&i<1?[e]:[]:[e-i,e+i].filter(function(s){return s>0&&s<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return[singlePoint(this.points[0]),this];if(t>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),r=lerpPoint(this.points[1],this.points[2],t),i=lerpPoint(this.points[2],this.points[3],t),s=lerpPoint(e,r,t),n=lerpPoint(r,i,t),a=lerpPoint(s,n,t);return[new PolynomialBezier(this.points[0],e,s,a,!0),new PolynomialBezier(a,n,i,this.points[3],!0)]};function extrema(t,e){var r=t.points[0][e],i=t.points[t.points.length-1][e];if(r>i){var s=i;i=r,r=s}for(var n=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),a=0;a0&&n[a]<1){var l=t.point(n[a])[e];li&&(i=l)}return{min:r,max:i}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return{left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,r){var i=t.boundingBox();return{cx:i.cx,cy:i.cy,width:i.width,height:i.height,bez:t,t:(e+r)/2,t1:e,t2:r}}function splitData(t){var e=t.bez.split(.5);return[intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=n||t.width<=i&&t.height<=i&&e.width<=i&&e.height<=i){s.push([t.t,e.t]);return}var a=splitData(t),l=splitData(e);intersectsImpl(a[0],l[0],r+1,i,s,n),intersectsImpl(a[0],l[1],r+1,i,s,n),intersectsImpl(a[1],l[0],r+1,i,s,n),intersectsImpl(a[1],l[1],r+1,i,s,n)}}PolynomialBezier.prototype.intersections=function(t,e,r){e===void 0&&(e=2),r===void 0&&(r=7);var i=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,i,r),i},PolynomialBezier.shapeSegment=function(t,e){var r=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[r],t.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var r=(e+1)%t.length();return new PolynomialBezier(t.v[r],t.i[r],t.o[e],t.v[e],!0)};function crossProduct(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,r,i){var s=[t[0],t[1],1],n=[e[0],e[1],1],a=[r[0],r[1],1],l=[i[0],i[1],1],o=crossProduct(crossProduct(s,n),crossProduct(a,l));return floatZero(o[2])?null:[o[0]/o[2],o[1]/o[2]]}function polarOffset(t,e,r){return[t[0]+Math.cos(e)*r,t[1]-Math.sin(e)*r]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(t,e,r,i,s,n,a){var l=r-Math.PI/2,o=r+Math.PI/2,c=e[0]+Math.cos(r)*i*s,m=e[1]-Math.sin(r)*i*s;t.setTripleAt(c,m,c+Math.cos(l)*n,m-Math.sin(l)*n,c+Math.cos(o)*a,m-Math.sin(o)*a,t.length())}function getPerpendicularVector(t,e){var r=[e[0]-t[0],e[1]-t[1]],i=-Math.PI*.5,s=[Math.cos(i)*r[0]-Math.sin(i)*r[1],Math.sin(i)*r[0]+Math.cos(i)*r[1]];return s}function getProjectingAngle(t,e){var r=e===0?t.length()-1:e-1,i=(e+1)%t.length(),s=t.v[r],n=t.v[i],a=getPerpendicularVector(s,n);return Math.atan2(0,1)-Math.atan2(a[1],a[0])}function zigZagCorner(t,e,r,i,s,n,a){var l=getProjectingAngle(e,r),o=e.v[r%e._length],c=e.v[r===0?e._length-1:r-1],m=e.v[(r+1)%e._length],P=n===2?Math.sqrt(Math.pow(o[0]-c[0],2)+Math.pow(o[1]-c[1],2)):0,p=n===2?Math.sqrt(Math.pow(o[0]-m[0],2)+Math.pow(o[1]-m[1],2)):0;setPoint(t,e.v[r%e._length],l,a,i,p/((s+1)*2),P/((s+1)*2))}function zigZagSegment(t,e,r,i,s,n){for(var a=0;a1&&e.length>1&&(s=getIntersection(t[0],e[e.length-1]),s)?[[t[0].split(s[0])[0]],[e[e.length-1].split(s[1])[1]]]:[r,i]}function pruneIntersections(t){for(var e,r=1;r1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var r=t.inflectionPoints(),i,s,n,a;if(r.length===0)return[offsetSegment(t,e)];if(r.length===1||floatEqual(r[1],1))return n=t.split(r[0]),i=n[0],s=n[1],[offsetSegment(i,e),offsetSegment(s,e)];n=t.split(r[0]),i=n[0];var l=(r[1]-r[0])/(1-r[0]);return n=n[1].split(l),a=n[0],s=n[1],[offsetSegment(i,e),offsetSegment(a,e),offsetSegment(s,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(t,e,r,i){var s=shapePool.newElement();s.c=t.c;var n=t.length();t.c||(n-=1);var a,l,o,c=[];for(a=0;a=0;a-=1)o=PolynomialBezier.shapeSegmentInverted(t,a),c.push(offsetSegmentSplit(o,e));c=pruneIntersections(c);var m=null,P=null;for(a=0;a0&&(O=!1),O){var W=createTag("style");W.setAttribute("f-forigin",A[C].fOrigin),W.setAttribute("f-origin",A[C].origin),W.setAttribute("f-family",A[C].fFamily),W.type="text/css",W.innerText="@font-face {font-family: "+A[C].fFamily+"; font-style: normal; src: url('"+A[C].fPath+"');}",T.appendChild(W)}}else if(A[C].fOrigin==="g"||A[C].origin===1){for(q=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),j=0;j=55296&&A<=56319){var C=E.charCodeAt(1);C>=56320&&C<=57343&&(T=(A-55296)*1024+C-56320+65536)}return T}function k(E,T){var A=E.toString(16)+T.toString(16);return P.indexOf(A)!==-1}function _(E){return E===o}function F(E){return E===l}function B(E){var T=S(E);return T>=c&&T<=m}function H(E){return B(E.substr(0,2))&&B(E.substr(2,2))}function D(E){return r.indexOf(E)!==-1}function R(E,T){var A=S(E.substr(T,2));if(A!==i)return!1;var C=0;for(T+=2;C<5;){if(A=S(E.substr(T,2)),Aa)return!1;C+=1,T+=2}return S(E.substr(T,2))===s}function G(){this.isLoaded=!0}var z=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};z.isModifier=k,z.isZeroWidthJoiner=_,z.isFlagEmoji=H,z.isRegionalCode=B,z.isCombinedCharacter=D,z.isRegionalFlag=R,z.isVariationSelector=F,z.BLACK_FLAG_CODE_POINT=i;var L={addChars:u,addFonts:M,getCharData:d,getFontByName:g,measureText:f,checkLoadedFonts:b,setIsLoaded:G};return z.prototype=L,z}();function SlotManager(t){this.animationData=t}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency: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())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,r=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,r=this.layers.length,i;for(this.completeLayers=!0,e=r-1;e>=0;e-=1)this.elements[e]||(i=this.layers[e],i.ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=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 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",p),this.element.maskedElement.setAttribute(d,"url("+getLocationHref()+"#"+p+")"),i.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,r,i=this.masksProperties.length;for(r=0;r1&&(i+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==i){var a="";r.elem&&(e.c&&(a=t.inv?this.solidPath+i:i),r.elem.setAttribute("d",a)),r.lastPath=i}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=r;function e(i,s){var n=createNS("filter");return n.setAttribute("id",i),s!==!0&&(n.setAttribute("filterUnits","objectBoundingBox"),n.setAttribute("x","0%"),n.setAttribute("y","0%"),n.setAttribute("width","100%"),n.setAttribute("height","100%")),n}function r(){var i=createNS("feColorMatrix");return i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),i}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,r="SourceGraphic",i=t.data.ef?t.data.ef.length:0,s=createElementID(),n=filtersFactory.createFilter(s,!0),a=0;this.filters=[];var l;for(e=0;e=0&&(i=this.shapeModifiers[e].processShapes(this._isFirstFrame),!i);e-=1);}},searchProcessedElement:function(e){for(var r=this.processedElements,i=0,s=r.length;i.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=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;t0;)u=p.transformers[B].mProps._mdf||u,F-=1,B-=1;if(u)for(F=S-p.styles[f].lvl,B=p.transformers.length-1;F>0;)_.multiply(p.transformers[B].mProps.v),F-=1,B-=1}else _=t;if(k=p.sh.paths,y=k._length,u){for(M="",b=0;b=1?G=.99:G<=-1&&(G=-.99);var z=D*G,L=Math.cos(R+p.a.v)*z+M[0],E=Math.sin(R+p.a.v)*z+M[1];b.setAttribute("fx",L),b.setAttribute("fy",E),y&&!p.g._collapsable&&(p.of.setAttribute("fx",L),p.of.setAttribute("fy",E))}}}function m(P,p,x){var b=p.style,y=p.d;y&&(y._mdf||x)&&y.dashStr&&(b.pElem.setAttribute("stroke-dasharray",y.dashStr),b.pElem.setAttribute("stroke-dashoffset",y.dashoffset[0])),p.c&&(p.c._mdf||x)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(p.c.v[0])+","+bmFloor(p.c.v[1])+","+bmFloor(p.c.v[2])+")"),(p.o._mdf||x)&&b.pElem.setAttribute("stroke-opacity",p.o.v),(p.w._mdf||x)&&(b.pElem.setAttribute("stroke-width",p.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",p.w.v))}return r}();function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,r,i,s=this.stylesList.length,n,a=[],l=!1;for(i=0;i1&&l&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e=0;o-=1){if(M=this.searchProcessedElement(t[o]),M?e[o]=r[M-1]:t[o]._render=a,t[o].ty==="fl"||t[o].ty==="st"||t[o].ty==="gf"||t[o].ty==="gs"||t[o].ty==="no")M?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&e[o].style.pElem.parentNode!==i&&i.appendChild(e[o].style.pElem),p.push(e[o].style);else if(t[o].ty==="gr"){if(!M)e[o]=this.createGroupElement(t[o]);else for(P=e[o].it.length,m=0;m1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=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,r=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var i,s=this.effectsSequence.length,n=t||this.data.d.k[this.keysIndex].s;for(i=0;ie);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],r=0,i=t.length,s,n,a=!1,l=!1,o="";r=55296&&s<=56319?FontManager.isRegionalFlag(t,r)?o=t.substr(r,14):(n=t.charCodeAt(r+1),n>=56320&&n<=57343&&(FontManager.isModifier(s,n)?(o=t.substr(r,2),a=!0):FontManager.isFlagEmoji(t.substr(r,4))?o=t.substr(r,4):o=t.substr(r,2))):s>56319?(n=t.charCodeAt(r+1),FontManager.isVariationSelector(s)&&(a=!0)):FontManager.isZeroWidthJoiner(s)&&(a=!0,l=!0),a?(e[e.length-1]+=o,a=!1):e.push(o),r+=o.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,r=this.data,i=[],s,n,a,l=0,o,c=r.m.g,m=0,P=0,p=0,x=[],b=0,y=0,M,u,d=e.getFontByName(t.f),f,g=0,S=getFontProperties(d);t.fWeight=S.weight,t.fStyle=S.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),n=t.finalText.length,t.finalLineHeight=t.lh;var k=t.tr/1e3*t.finalSize,_;if(t.sz)for(var F=!0,B=t.sz[0],H=t.sz[1],D,R;F;){R=this.buildFinalText(t.t),D=0,b=0,n=R.length,k=t.tr/1e3*t.finalSize;var G=-1;for(s=0;sB&&R[s]!==" "?(G===-1?n+=1:s=G,D+=t.finalLineHeight||t.finalSize*1.2,R.splice(s,G===s?1:0,"\r"),G=-1,b=0):(b+=g,b+=k);D+=d.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&Hy?b:y,b=-2*k,o="",a=!0,p+=1):o=L,e.chars?(f=e.getCharData(L,d.fStyle,e.getFontByName(t.f).fFamily),g=a?0:f.w*t.finalSize/100):g=e.measureText(o,t.f,t.finalSize),L===" "?z+=g+k:(b+=g+k+z,z=0),i.push({l:g,an:g,add:m,n:a,anIndexes:[],val:o,line:p,animatorJustifyOffset:0}),c==2){if(m+=g,o===""||o===" "||s===n-1){for((o===""||o===" ")&&(m-=g);P<=s;)i[P].an=m,i[P].ind=l,i[P].extra=g,P+=1;l+=1,m=0}}else if(c==3){if(m+=g,o===""||s===n-1){for(o===""&&(m-=g);P<=s;)i[P].an=m,i[P].ind=l,i[P].extra=g,P+=1;m=0,l+=1}}else i[l].ind=l,i[l].extra=0,l+=1;if(t.l=i,y=b>y?b:y,x.push(b),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=x;var E=r.a,T,A;u=E.length;var C,V,I=[];for(M=0;M0?l=this.ne.v/100:o=-this.ne.v/100,this.xe.v>0?c=1-this.xe.v/100:m=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(l,o,c,m).get,p=0,x=this.finalS,b=this.finalE,y=this.data.sh;if(y===2)b===x?p=a>=b?1:0:p=t(0,e(.5/(b-x)+(a-x)/(b-x),1)),p=P(p);else if(y===3)b===x?p=a>=b?0:1:p=1-t(0,e(.5/(b-x)+(a-x)/(b-x),1)),p=P(p);else if(y===4)b===x?p=0:(p=t(0,e(.5/(b-x)+(a-x)/(b-x),1)),p<.5?p*=2:p=1-2*(p-.5)),p=P(p);else if(y===5){if(b===x)p=0;else{var M=b-x;a=e(t(0,a+.5-x),b-x);var u=-M/2+a,d=M/2;p=Math.sqrt(1-u*u/(d*d))}p=P(p)}else y===6?(b===x?p=0:(a=e(t(0,a+.5-x),b-x),p=(1+Math.cos(Math.PI+Math.PI*2*a/(b-x)))/2),p=P(p)):(a>=r(x)&&(a-x<0?p=t(0,e(e(b,1)-(x-a),1)):p=t(0,e(b-a,1))),p=P(p));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;p1&&(p=1))}return p*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var l=this.data.r===2?1:100/this.data.totalChars,o=this.o.v/l,c=this.s.v/l+o,m=this.e.v/l+o;if(c>m){var P=c;c=m,m=P}this.finalS=c,this.finalE=m}},extendPrototype([DynamicPropertyContainer],i);function s(n,a,l){return new i(n,a)}return{getTextSelectorProp:s}}();function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,n=e.a;this.a={r:n.r?s(t,n.r,0,degToRads,r):i,rx:n.rx?s(t,n.rx,0,degToRads,r):i,ry:n.ry?s(t,n.ry,0,degToRads,r):i,sk:n.sk?s(t,n.sk,0,degToRads,r):i,sa:n.sa?s(t,n.sa,0,degToRads,r):i,s:n.s?s(t,n.s,1,.01,r):i,a:n.a?s(t,n.a,1,0,r):i,o:n.o?s(t,n.o,0,.01,r):i,p:n.p?s(t,n.p,1,0,r):i,sw:n.sw?s(t,n.sw,0,0,r):i,sc:n.sc?s(t,n.sc,1,0,r):i,fc:n.fc?s(t,n.fc,1,0,r):i,fh:n.fh?s(t,n.fh,0,0,r):i,fs:n.fs?s(t,n.fs,0,.01,r):i,fb:n.fb?s(t,n.fb,0,.01,r):i,t:n.t?s(t,n.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,r,i=PropertyFactory.getProp;for(t=0;t=b+et||!S?(B=(b+et-M)/y.partialLength,j=g.point[0]+(y.point[0]-g.point[0])*B,W=g.point[1]+(y.point[1]-g.point[1])*B,n.translate(-r[0]*p[m].an*.005,-(r[1]*z)*.01),u=!1):S&&(M+=y.partialLength,d+=1,d>=S.length&&(d=0,f+=1,k[f]?S=k[f].points:D.v.c?(d=0,f=0,S=k[f].points):(M-=y.partialLength,S=null)),S&&(g=y,y=S[d],_=y.partialLength));q=p[m].an/2-p[m].add,n.translate(-q,0,0)}else q=p[m].an/2-p[m].add,n.translate(-q,0,0),n.translate(-r[0]*p[m].an*.005,-r[1]*z*.01,0);for(A=0;At?this.textSpans[t].span:createNS(l?"g":"text"),f<=t){if(o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=o,l){var S=createNS("g");o.appendChild(S),this.textSpans[t].childSpan=S}this.textSpans[t].span=o,this.layerElement.appendChild(o)}o.style.display="inherit"}if(c.reset(),P&&(a[t].n&&(p=-y,x+=r.yOffset,x+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(r,c,a[t].line,p,x),p+=a[t].l||0,p+=y),l){g=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily);var k;if(g.t===1)k=new SVGCompElement(g.data,this.globalData,this);else{var _=emptyShapeData;g.data&&g.data.shapes&&(_=this.buildShapeData(g.data,r.finalSize)),k=new SVGShapeElement(_,this.globalData,this)}if(this.textSpans[t].glyph){var F=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(F.layerElement),F.destroy()}this.textSpans[t].glyph=k,k._debug=!0,k.prepareFrame(0),k.renderFrame(),this.textSpans[t].childSpan.appendChild(k.layerElement),g.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else P&&o.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),o.textContent=a[t].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}P&&o&&o.setAttribute("d",m)}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)e.finalTransform.multiply(e.transforms[i].transform.mProps.v);e._mdf=n},processSequences:function(e){var r,i=this.sequenceList.length;for(r=0;r=1){this.buffers=[];var e=this.globalData.canvasContext,r=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(r);var i=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var r=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=r}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0],r=e.getContext("2d");this.clearCanvas(r),r.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],r=e.getContext("2d");this.clearCanvas(r),r.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var i=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(i.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var s=assetLoader.getLumaCanvas(this.canvasContext.canvas),n=s.getContext("2d");n.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(s,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var r=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(r),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(r),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s=4;e.ty==="rc"?s=5:e.ty==="el"?s=6:e.ty==="sr"&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,s,t);var n,a=r.length,l;for(n=0;n=0;n-=1){if(P=this.searchProcessedElement(t[n]),P?e[n]=r[P-1]:t[n]._shouldRender=i,t[n].ty==="fl"||t[n].ty==="st"||t[n].ty==="gf"||t[n].ty==="gs")P?e[n].style.closed=!1:e[n]=this.createStyleElement(t[n],b),c.push(e[n].style);else if(t[n].ty==="gr"){if(!P)e[n]=this.createGroupElement(t[n]);else for(o=e[n].it.length,l=0;l=0;s-=1)e[s].ty==="tr"?(a=r[s].transform,this.renderShapeTransform(t,a)):e[s].ty==="sh"||e[s].ty==="el"||e[s].ty==="rc"||e[s].ty==="sr"?this.renderPath(e[s],r[s]):e[s].ty==="fl"?this.renderFill(e[s],r[s],a):e[s].ty==="st"?this.renderStroke(e[s],r[s],a):e[s].ty==="gf"||e[s].ty==="gs"?this.renderGradientFill(e[s],r[s],a):e[s].ty==="gr"?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r=t.trNodes,i=e.paths,s,n,a,l=i._length;r.length=0;var o=t.transforms.finalTransform;for(a=0;a=1?m=.99:m<=-1&&(m=-.99);var P=o*m,p=Math.cos(c+e.a.v)*P+a[0],x=Math.sin(c+e.a.v)*P+a[1];s=n.createRadialGradient(p,x,0,a[0],a[1],o)}var b,y=t.g.p,M=e.g.c,u=1;for(b=0;bn&&o==="xMidYMid slice"||ss&&l==="meet"||ns&&l==="slice")?this.transformCanvas.tx=(r-this.transformCanvas.w*(i/this.transformCanvas.h))/2*this.renderConfig.dpr:c==="xMax"&&(ns&&l==="slice")?this.transformCanvas.tx=(r-this.transformCanvas.w*(i/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,m==="YMid"&&(n>s&&l==="meet"||ns&&l==="meet"||n=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(t,e){if(!(this.renderedFrame===t&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||t===-1)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var r,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=i-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!(e[t]||this.layers[t].ty===99)){var r=this.createItem(this.layers[t],this,this.globalData);e[t]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var t,e=15;for(t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var r=this.finalTransform.mat.toCSS();e.transform=r,e.webkitTransform=r}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(t,e,r){this.initElement(t,e,r)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?(t=createNS("rect"),t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(t=createTag("div"),t.style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)};function HShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var r,i=t.length;for(r=0;r0&&o<1&&s[p].push(this.calculateF(o,t,e,r,i,p))):(c=a*a-4*l*n,c>=0&&(m=(-a+bmSqrt(c))/(2*n),m>0&&m<1&&s[p].push(this.calculateF(m,t,e,r,i,p)),P=(-a-bmSqrt(c))/(2*n),P>0&&P<1&&s[p].push(this.calculateF(P,t,e,r,i,p)))));this.shapeBoundingBox.left=bmMin.apply(null,s[0]),this.shapeBoundingBox.top=bmMin.apply(null,s[1]),this.shapeBoundingBox.right=bmMax.apply(null,s[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,s[1])},HShapeElement.prototype.calculateF=function(t,e,r,i,s,n){return bmPow(1-t,3)*e[n]+3*bmPow(1-t,2)*t*r[n]+3*(1-t)*bmPow(t,2)*i[n]+bmPow(t,3)*s[n]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var r,i=t.length;for(r=0;rr&&(r=s)}r*=t.mult}else r=t.v*t.mult;e.x-=r,e.xMax+=r,e.y-=r,e.yMax+=r},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;e-=1){var i=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;this.p?s=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:s=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var n=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),a=[s[0]/n,s[1]/n,s[2]/n],l=Math.sqrt(a[2]*a[2]+a[0]*a[0]),o=Math.atan2(a[1],l),c=Math.atan2(a[0],-a[2]);this.mat.rotateY(c).rotateX(-o)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var m=!this._prevMat.equals(this.mat);if((m||this.pe._mdf)&&this.comp.threeDElements){r=this.comp.threeDElements.length;var P,p,x;for(e=0;e=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var r=createTag("div"),i,s;styleDiv(r);var n=createTag("div");if(styleDiv(n),e==="3d"){i=r.style,i.width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var a="50% 50%";i.webkitTransformOrigin=a,i.mozTransformOrigin=a,i.transformOrigin=a,s=n.style;var l="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";s.transform=l,s.webkitTransform=l}r.appendChild(n);var o={container:n,perspectiveElem:r,startPos:t,endPos:t,type:e};return this.threeDElements.push(o),o},HybridRendererBase.prototype.build3dContainers=function(){var t,e=this.layers.length,r,i="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var r=0,i=this.threeDElements.length;rr?(s=t/this.globalData.compSize.w,n=t/this.globalData.compSize.w,a=0,l=(e-this.globalData.compSize.h*(t/this.globalData.compSize.w))/2):(s=e/this.globalData.compSize.h,n=e/this.globalData.compSize.h,a=(t-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,l=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+s+",0,0,0,0,"+n+",0,0,0,0,1,0,"+a+","+l+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t=this.globalData.compSize.w,e=this.globalData.compSize.h,r,i=this.threeDElements.length;for(r=0;r=c;)D/=2,R/=2,G>>>=1;return(D+G)/R};return B.int32=function(){return F.g(4)|0},B.quick=function(){return F.g(4)/4294967296},B.double=B,M(d(F.S),t),(g.pass||S||function(H,D,R,G){return G&&(G.S&&b(G,F),H.state=function(){return b(F,{})}),R?(e[a]=H,D):H})(B,_,"global"in g?g.global:this==e,g.state)}e["seed"+a]=p;function x(f){var g,S=f.length,k=this,_=0,F=k.i=k.j=0,B=k.S=[];for(S||(f=[S++]);_r){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var r,i=Math.min(t.length,e.length),s=0;for(r=0;r.5?c/(2-s-n):c/(s+n),s){case e:a=(r-i)/c+(r1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e=t[0],r=t[1],i=t[2],s,n,a;if(r===0)s=i,a=i,n=i;else{var l=i<.5?i*(1+r):i+r-i*r,o=2*i-l;s=hue2rgb(o,l,e+1/3),n=hue2rgb(o,l,e),a=hue2rgb(o,l,e-1/3)}return[s,n,a,t[3]]}function linear(t,e,r,i,s){if((i===void 0||s===void 0)&&(i=e,s=r,e=0,r=1),r=r)return s;var a=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*a;var l,o=i.length,c=createTypedArray("float32",o);for(l=0;l1){for(s=0;s1?e=1:e<0&&(e=0);var a=t(e);if($bm_isInstanceOfArray(s)){var l,o=s.length,c=createTypedArray("float32",o);for(l=0;ldata.k[e].t&&tdata.k[e+1].t-t?(i=e+2,s=data.k[e+1].t):(i=e+1,s=data.k[e].t);break}i===-1&&(i=e+1,s=data.k[e].t)}var n={};return n.index=i,n.time=s/elem.comp.globalData.frameRate,n}function key(t){var e,r,i;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;rM.length-1)&&(x=M.length-1),f=M[M.length-1-x].t,d=u-f);var g,S,k;if(p==="pingpong"){var _=Math.floor((y-f)/d);if(_%2!==0)return this.getValueAtTime((d-(y-f)%d+f)/this.comp.globalData.frameRate,0)}else if(p==="offset"){var F=this.getValueAtTime(f/this.comp.globalData.frameRate,0),B=this.getValueAtTime(u/this.comp.globalData.frameRate,0),H=this.getValueAtTime(((y-f)%d+f)/this.comp.globalData.frameRate,0),D=Math.floor((y-f)/d);if(this.pv.length){for(k=new Array(F.length),S=k.length,g=0;g=u)return this.pv;var d,f;b?(x?d=Math.abs(this.elem.comp.globalData.frameRate*x):d=Math.max(0,this.elem.data.op-u),f=u+d):((!x||x>M.length-1)&&(x=M.length-1),f=M[x].t,d=f-u);var g,S,k;if(p==="pingpong"){var _=Math.floor((u-y)/d);if(_%2===0)return this.getValueAtTime(((u-y)%d+u)/this.comp.globalData.frameRate,0)}else if(p==="offset"){var F=this.getValueAtTime(u/this.comp.globalData.frameRate,0),B=this.getValueAtTime(f/this.comp.globalData.frameRate,0),H=this.getValueAtTime((d-(u-y)%d+u)/this.comp.globalData.frameRate,0),D=Math.floor((u-y)/d)+1;if(this.pv.length){for(k=new Array(F.length),S=k.length,g=0;g1?(M-y)/(x-1):1,d=0,f=0,g;this.pv.length?g=createTypedArray("float32",this.pv.length):g=0;for(var S;dd){var _=f,F=y.c&&f===g-1?0:f+1,B=(d-S)/u[f].addedLength;k=bez.getPointInSegment(y.v[_],y.v[F],y.o[_],y.i[F],B,u[f]);break}else S+=u[f].addedLength;f+=1}return k||(k=y.c?[y.v[0][0],y.v[0][1]]:[y.v[y._length-1][0],y.v[y._length-1][1]]),k},vectorOnPath:function(x,b,y){x==1?x=this.v.c:x==0&&(x=.999);var M=this.pointOnPath(x,b),u=this.pointOnPath(x+.001,b),d=u[0]-M[0],f=u[1]-M[1],g=Math.sqrt(Math.pow(d,2)+Math.pow(f,2));if(g===0)return[0,0];var S=y==="tangent"?[d/g,f/g]:[-f/g,d/g];return S},tangentOnPath:function(x,b){return this.vectorOnPath(x,b,"tangent")},normalOnPath:function(x,b){return this.vectorOnPath(x,b,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([m],o),extendPrototype([m],c),c.prototype.getValueAtTime=l,c.prototype.initiateExpression=ExpressionManager.initiateExpression;var P=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(p,x,b,y,M){var u=P(p,x,b,y,M);return u.propertyIndex=x.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(p,x.pt,u):b===4&&expressionHelpers.searchExpressions(p,x.ks,u),u.k&&p.addDynamicProperty(u),u}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,r){var i=this.calculateExpression(r);if(e.t!==i){var s={};return this.copyData(s,e),s.t=i.toString(),s.__complete=!1,s}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),r=this.searchExpressions();return this.kf=e||r,this.kf},TextProperty.prototype.searchExpressions=t}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,r){var i=createNS("feMerge");i.setAttribute("result",e);var s,n;for(n=0;n=c?P=b<0?i:s:P=i+x*Math.pow((l-t)/b,1/r),m[p]=P,p+=1,n+=256/(a-1);return m.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}};function SVGDropShadowEffect(t,e,r,i,s){var n=e.container.globalData.renderConfig.filterSize,a=e.data.fs||n;t.setAttribute("x",a.x||n.x),t.setAttribute("y",a.y||n.y),t.setAttribute("width",a.width||n.width),t.setAttribute("height",a.height||n.height),this.filterManager=e;var l=createNS("feGaussianBlur");l.setAttribute("in","SourceAlpha"),l.setAttribute("result",i+"_drop_shadow_1"),l.setAttribute("stdDeviation","0"),this.feGaussianBlur=l,t.appendChild(l);var o=createNS("feOffset");o.setAttribute("dx","25"),o.setAttribute("dy","0"),o.setAttribute("in",i+"_drop_shadow_1"),o.setAttribute("result",i+"_drop_shadow_2"),this.feOffset=o,t.appendChild(o);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",i+"_drop_shadow_3"),this.feFlood=c,t.appendChild(c);var m=createNS("feComposite");m.setAttribute("in",i+"_drop_shadow_3"),m.setAttribute("in2",i+"_drop_shadow_2"),m.setAttribute("operator","in"),m.setAttribute("result",i+"_drop_shadow_4"),t.appendChild(m);var P=this.createMergeNode(i,[i+"_drop_shadow_4",s]);t.appendChild(P)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),n=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",n)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e1)&&(t=1),t}function convertToPercentage(t){return Number(t)<=1?`${Number(t)*100}%`:t}function pad2(t){return t.length===1?"0"+t:String(t)}function rgbToRgb(t,e,r){return{r:bound01(t,255)*255,g:bound01(e,255)*255,b:bound01(r,255)*255}}function rgbToHsl(t,e,r){t=bound01(t,255),e=bound01(e,255),r=bound01(r,255);const i=Math.max(t,e,r),s=Math.min(t,e,r);let n=0,a=0;const l=(i+s)/2;if(i===s)a=0,n=0;else{const o=i-s;switch(a=l>.5?o/(2-i-s):o/(i+s),i){case t:n=(e-r)/o+(e1&&(r-=1),r<1/6?t+(e-t)*(6*r):r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t,e,r){let i,s,n;if(t=bound01(t,360),e=bound01(e,100),r=bound01(r,100),e===0)s=r,n=r,i=r;else{const a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=hue2rgb(l,a,t+1/3),s=hue2rgb(l,a,t),n=hue2rgb(l,a,t-1/3)}return{r:i*255,g:s*255,b:n*255}}function rgbToHsv(t,e,r){t=bound01(t,255),e=bound01(e,255),r=bound01(r,255);const i=Math.max(t,e,r),s=Math.min(t,e,r);let n=0;const a=i,l=i-s,o=i===0?0:l/i;if(i===s)n=0;else{switch(i){case t:n=(e-r)/l+(e>16,g:(t&65280)>>8,b:t&255}}const names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function inputToRGB(t){let e={r:0,g:0,b:0},r=1,i=null,s=null,n=null,a=!1,l=!1;return typeof t=="string"&&(t=stringInputToObject(t)),typeof t=="object"&&(isValidCSSUnit(t.r)&&isValidCSSUnit(t.g)&&isValidCSSUnit(t.b)?(e=rgbToRgb(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.v)?(i=convertToPercentage(t.s),s=convertToPercentage(t.v),e=hsvToRgb(t.h,i,s),a=!0,l="hsv"):isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.l)&&(i=convertToPercentage(t.s),n=convertToPercentage(t.l),e=hslToRgb(t.h,i,n),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=boundAlpha(r),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}const CSS_INTEGER="[-\\+]?\\d+%?",CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?",CSS_UNIT=`(?:${CSS_NUMBER})|(?:${CSS_INTEGER})`,PERMISSIVE_MATCH3=`[\\s|\\(]+(${CSS_UNIT})[,|\\s]+(${CSS_UNIT})[,|\\s]+(${CSS_UNIT})\\s*\\)?`,PERMISSIVE_MATCH4=`[\\s|\\(]+(${CSS_UNIT})[,|\\s]+(${CSS_UNIT})[,|\\s]+(${CSS_UNIT})[,|\\s]+(${CSS_UNIT})\\s*\\)?`,matchers={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function stringInputToObject(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;let e=!1;if(names[t])t=names[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let r=matchers.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=matchers.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=matchers.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=matchers.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=matchers.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=matchers.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=matchers.hex8.exec(t),r?{r:parseIntFromHex(r[1]),g:parseIntFromHex(r[2]),b:parseIntFromHex(r[3]),a:convertHexToDecimal(r[4]),format:e?"name":"hex8"}:(r=matchers.hex6.exec(t),r?{r:parseIntFromHex(r[1]),g:parseIntFromHex(r[2]),b:parseIntFromHex(r[3]),format:e?"name":"hex"}:(r=matchers.hex4.exec(t),r?{r:parseIntFromHex(r[1]+r[1]),g:parseIntFromHex(r[2]+r[2]),b:parseIntFromHex(r[3]+r[3]),a:convertHexToDecimal(r[4]+r[4]),format:e?"name":"hex8"}:(r=matchers.hex3.exec(t),r?{r:parseIntFromHex(r[1]+r[1]),g:parseIntFromHex(r[2]+r[2]),b:parseIntFromHex(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function isValidCSSUnit(t){return!!matchers.CSS_UNIT.exec(String(t))}class TinyColor{constructor(e="",r={}){if(e instanceof TinyColor)return e;typeof e=="number"&&(e=numberInputToObject(e)),this.originalInput=e;const i=inputToRGB(e);this.originalInput=e,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=r.format??i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){const e=this.toRgb();let r,i,s;const n=e.r/255,a=e.g/255,l=e.b/255;return n<=.03928?r=n/12.92:r=Math.pow((n+.055)/1.055,2.4),a<=.03928?i=a/12.92:i=Math.pow((a+.055)/1.055,2.4),l<=.03928?s=l/12.92:s=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*i+.0722*s}getAlpha(){return this.a}setAlpha(e){return this.a=boundAlpha(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:e}=this.toHsl();return e===0}toHsv(){const e=rgbToHsv(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){const e=rgbToHsv(this.r,this.g,this.b),r=Math.round(e.h*360),i=Math.round(e.s*100),s=Math.round(e.v*100);return this.a===1?`hsv(${r}, ${i}%, ${s}%)`:`hsva(${r}, ${i}%, ${s}%, ${this.roundA})`}toHsl(){const e=rgbToHsl(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){const e=rgbToHsl(this.r,this.g,this.b),r=Math.round(e.h*360),i=Math.round(e.s*100),s=Math.round(e.l*100);return this.a===1?`hsl(${r}, ${i}%, ${s}%)`:`hsla(${r}, ${i}%, ${s}%, ${this.roundA})`}toHex(e=!1){return rgbToHex(this.r,this.g,this.b,e)}toHexString(e=!1){return"#"+this.toHex(e)}toHex8(e=!1){return rgbaToHex(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return"#"+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const e=Math.round(this.r),r=Math.round(this.g),i=Math.round(this.b);return this.a===1?`rgb(${e}, ${r}, ${i})`:`rgba(${e}, ${r}, ${i}, ${this.roundA})`}toPercentageRgb(){const e=r=>`${Math.round(bound01(r,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){const e=r=>Math.round(bound01(r,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const e="#"+rgbToHex(this.r,this.g,this.b,!1);for(const[r,i]of Object.entries(names))if(e===i)return r;return!1}toString(e){const r=!!e;e=e??this.format;let i=!1;const s=this.a<1&&this.a>=0;return!r&&s&&(e.startsWith("hex")||e==="name")?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new TinyColor(this.toString())}lighten(e=10){const r=this.toHsl();return r.l+=e/100,r.l=clamp01(r.l),new TinyColor(r)}brighten(e=10){const r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),new TinyColor(r)}darken(e=10){const r=this.toHsl();return r.l-=e/100,r.l=clamp01(r.l),new TinyColor(r)}tint(e=10){return this.mix("white",e)}shade(e=10){return this.mix("black",e)}desaturate(e=10){const r=this.toHsl();return r.s-=e/100,r.s=clamp01(r.s),new TinyColor(r)}saturate(e=10){const r=this.toHsl();return r.s+=e/100,r.s=clamp01(r.s),new TinyColor(r)}greyscale(){return this.desaturate(100)}spin(e){const r=this.toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,new TinyColor(r)}mix(e,r=50){const i=this.toRgb(),s=new TinyColor(e).toRgb(),n=r/100,a={r:(s.r-i.r)*n+i.r,g:(s.g-i.g)*n+i.g,b:(s.b-i.b)*n+i.b,a:(s.a-i.a)*n+i.a};return new TinyColor(a)}analogous(e=6,r=30){const i=this.toHsl(),s=360/r,n=[this];for(i.h=(i.h-(s*e>>1)+720)%360;--e;)i.h=(i.h+s)%360,n.push(new TinyColor(i));return n}complement(){const e=this.toHsl();return e.h=(e.h+180)%360,new TinyColor(e)}monochromatic(e=6){const r=this.toHsv(),{h:i}=r,{s}=r;let{v:n}=r;const a=[],l=1/e;for(;e--;)a.push(new TinyColor({h:i,s,v:n})),n=(n+l)%1;return a}splitcomplement(){const e=this.toHsl(),{h:r}=e;return[this,new TinyColor({h:(r+72)%360,s:e.s,l:e.l}),new TinyColor({h:(r+216)%360,s:e.s,l:e.l})]}onBackground(e){const r=this.toRgb(),i=new TinyColor(e).toRgb(),s=r.a+i.a*(1-r.a);return new TinyColor({r:(r.r*r.a+i.r*i.a*(1-r.a))/s,g:(r.g*r.a+i.g*i.a*(1-r.a))/s,b:(r.b*r.a+i.b*i.a*(1-r.a))/s,a:s})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(e){const r=this.toHsl(),{h:i}=r,s=[this],n=360/e;for(let a=1;a1){(!t||!Array.isArray(t)||t.length==0)&&(t=Object.keys(e[0]));const r=document.createElement("table"),i=document.createElement("tr");return t.forEach(s=>{const n=document.createElement("th"),a=document.createTextNode(s);n.appendChild(a),i.appendChild(n)}),r.appendChild(i),e.forEach(s=>{const n=document.createElement("tr");t.forEach(a=>{let l=s[a];const o=document.createElement("td"),c=document.createTextNode(l);o.appendChild(c),n.appendChild(o)}),r.appendChild(n)}),r}else{const r=document.createElement("h5");return r.innerHTML="Table has no rows",r}}const main={selectorId:"",title:"",botName:"",greeting:"",init:function(t={}){return this.selectorId=t.selectorId,this.title=t.title,this.botName=t.botName,this.greeting=t.greeting,this.enableUpload=t.enableUpload??!1,this.uploadTypes=t.uploadTypes,this.generateUploadPreview=t.generateUploadPreview,this.setCssVars(t.themeColor),this.render(t.submitHandler),t.preChatRenderer&&this.renderPreChat(t.preChatRenderer),this.toggle(t.expand||INITIAL_STATE),{toggle:this.toggle,isOpen:this.isOpen}},isOpen:function(){return document.querySelector("#tarka-chat .t-container").style.display==="flex"},toggle:function(t=void 0){const e=document.querySelector("#tarka-chat .t-container"),r=document.querySelector("#tarka-chat .closed"),i=document.querySelector("#tarka-chat .opened");t===!0||t===void 0&&!this.isOpen()?(e.style.display="flex",i.style.display="block",r.style.display="none"):(e.style.display="none",i.style.display="none",r.style.display="block")},render:function(t){const e=document.getElementById(this.selectorId);if(!e){console.error(`Element with ID "${this.selectorId}" not found.`);return}const r=async m=>{const P=this.createNode("upload-preview-item"),p=await this.generateUploadPreview(m);return P.appendChild(p),P},i=async m=>{const P=document.querySelector("#tarka-chat .t-container > .upload-preview-container");P.innerHTML="";const p=m.target.files,x=new DataTransfer;for(const b of p){if(this.uploadTypes&&!this.uploadTypes.includes(b.type))continue;const y=await r(b);y&&(P.appendChild(y),x.items.add(b))}x.files.length>0?P.style.display="flex":P.style.display="none",m.target.files=x.files},s=m=>{this.isProcessing=m;const P=document.querySelector("#tarka-chat .input-container");P.style.display=m?"none":"flex";const p=document.querySelector("#tarka-chat .t-container > .upload-preview-container");m&&(p.style.display="none");const x=document.querySelector("#tarka-chat .chat-loader");x.style.display=m?"block":"none"},n=async()=>{const m=document.querySelector("#tarka-chat .chat-input"),P=m.value;if(this.isProcessing||P.length===0)return;s(!0);const p=document.querySelector("#tarka-chat .upload-input"),x=[];if(this.enableUpload&&p.files.length>0){const M={type:"thumbnails",nodes:[]};for(const u of p.files){x.push(u);const d=await this.generateUploadPreview(u);M.nodes.push(d)}this.insertMessage([P,M],!1)}else this.insertMessage(P,!1);const b=await t(P,x);this.insertMessage(b,!0),s(!1);const y=document.querySelector("#tarka-chat .t-container > .upload-preview-container");y&&(y.style.display="none"),m.value="",p.value="",m.focus()};e.innerHTML=layout,this.setupLaucher(),loadLottie(document.querySelector("#tarka-chat .logo")),document.querySelector("#tarka-chat .title").textContent=this.title,this.insertMessage(this.greeting,!0);const a=document.querySelector("#tarka-chat .upload-btn"),l=document.querySelector("#tarka-chat .upload-input"),o=document.querySelector("#tarka-chat .send-btn"),c=document.querySelector("#tarka-chat .chat-input");this.enableUpload&&(a.style.display="block",a.disabled=!1,a.addEventListener("click",()=>l==null?void 0:l.click()),l.addEventListener("change",i)),o.addEventListener("click",n),c.addEventListener("keyup",async function(m){m.keyCode===13&&await n()})},setupLaucher:function(){document.querySelector("#tarka-chat .launcher").addEventListener("click",()=>this.toggle());const e=document.querySelector("#tarka-chat .closed");loadLottie(e)},createNode(t,e=null){const r=document.createElement("div");return r.className=t,e!==null&&(r.innerHTML=e),r},validateFieldPresent(t,e){if(!(t in e))throw new Error(`'${t}' is mandatory in ${JSON.stringify(e)}`)},createNodeByType(t){switch(this.validateFieldPresent("type",t),t.type){case"text":return this.createNode("message-content",t.message);case"file":this.validateFieldPresent("link",t),this.validateFieldPresent("name",t);const e=`
@@ -82,4 +82,4 @@
- `;return this.createNode("image-container",r);case"highchart-config":this.validateFieldPresent("high_chart_config",t);let i=this.createNode("high-chart-container");return Highcharts.chart(i,t.high_chart_config),i;case"thumbnails":this.validateFieldPresent("nodes",t);const s=this.createNode("upload-preview-container");return s.style.display="flex",t.nodes.forEach(n=>{const a=this.createNode("upload-preview-item");a.appendChild(n),s.appendChild(a)}),s;default:throw new Error(`Invalid type: ${type}`)}},insertMessage(t="",e=!1){const r=document.querySelector("#tarka-chat .message-container"),i=this.createNode("wrapper");typeof t=="string"&&i.appendChild(this.createNodeByType({type:"text",message:t})),Array.isArray(t)&&t.forEach(n=>{let a=n;typeof a=="string"&&(a={type:"text",message:a}),i.appendChild(this.createNodeByType(a))}),typeof t=="object"&&!Array.isArray(t)&&i.appendChild(this.createNodeByType(t)),i.appendChild(this.createNode("message-meta",e?this.botName:"You"));const s=this.createNode(`message ${e?"incoming":"outgoing"}`);s.appendChild(i),r.appendChild(s),r.lastElementChild.scrollIntoView()},setCssVars:function(t="#F0DAFB"){const e=new TinyColor(t).toHsl(),r={primary:e.h,primaryOffset:e.h-10,primaryOffsetHover:e.h+10},i=document.querySelector(":root");i.style.setProperty("--primary-background",`hsla(${r.primaryOffset}, 80%, 99%, 1)`),i.style.setProperty("--primary-primary",`hsla(${r.primary}, 100%, 35%, 1)`),i.style.setProperty("--primary-primary-subtle",`hsla(${r.primaryOffset}, 80%, 92%, 1)`),i.style.setProperty("--primary-primary-subtle-hover",`hsla(${r.primaryOffsetHover}, 80%, 89%, 1)`),i.style.setProperty("--primary-primary-alt",`hsla(${r.primary}, 38%, 21%, 1)`),i.style.setProperty("--primary-primary-alt-subtle",`hsla(${r.primaryOffset}, 23%, 91%, 1)`),i.style.setProperty("--gradient-background",`linear-gradient(0deg, hsla(${r.primary}, 100%, 35%, 0.05) 0%, hsla(${r.primary}, 0%, 0%, 0) 100%)`),i.style.setProperty("--gradient-gradient-fade",`linear-gradient(-0deg, hsla(${r.primaryOffset}, 80%, 99%, 0) 0%, hsla(${r.primaryOffset}, 80%, 99%, 1) 50%)`)},renderPreChat:function(t){const e=document.querySelector("#tarka-chat > .t-container > .body"),r=document.querySelector("#tarka-chat > .t-container > .scroll-fade"),i=document.querySelector("#tarka-chat > .t-container > .body > .message-container"),s=document.querySelector("#tarka-chat > .t-container > .footer");r.style.display="none",i.style.display="none",s.style.display="none";const a=t(()=>{var l;(l=e.querySelector(".tc-injected-prechat"))==null||l.remove(),r.style.display="block",i.style.display="flex",s.style.display="flex"});a.className+=" tc-injected-prechat",e.appendChild(a)}};return main});
+ `;return this.createNode("image-container",r);case"table":this.validateFieldPresent("table_data",t);let i=this.createNode("table-container");return i.appendChild(create_table(t.table_data.header,t.table_data.rows)),i;case"highchart-config":this.validateFieldPresent("high_chart_config",t);let s=this.createNode("high-chart-container");return Highcharts.chart(s,t.high_chart_config),s;case"thumbnails":this.validateFieldPresent("nodes",t);const n=this.createNode("upload-preview-container");return n.style.display="flex",t.nodes.forEach(a=>{const l=this.createNode("upload-preview-item");l.appendChild(a),n.appendChild(l)}),n;default:throw new Error(`Invalid type: ${type}`)}},insertMessage(t="",e=!1){const r=document.querySelector("#tarka-chat .message-container"),i=this.createNode("wrapper");typeof t=="string"&&i.appendChild(this.createNodeByType({type:"text",message:t})),Array.isArray(t)&&t.forEach(n=>{let a=n;typeof a=="string"&&(a={type:"text",message:a}),i.appendChild(this.createNodeByType(a))}),typeof t=="object"&&!Array.isArray(t)&&i.appendChild(this.createNodeByType(t)),i.appendChild(this.createNode("message-meta",e?this.botName:"You"));const s=this.createNode(`message ${e?"incoming":"outgoing"}`);s.appendChild(i),r.appendChild(s),r.lastElementChild.scrollIntoView()},setCssVars:function(t="#F0DAFB"){const e=new TinyColor(t).toHsl(),r={primary:e.h,primaryOffset:e.h-10,primaryOffsetHover:e.h+10},i=document.querySelector(":root");i.style.setProperty("--primary-background",`hsla(${r.primaryOffset}, 80%, 99%, 1)`),i.style.setProperty("--primary-primary",`hsla(${r.primary}, 100%, 35%, 1)`),i.style.setProperty("--primary-primary-subtle",`hsla(${r.primaryOffset}, 80%, 92%, 1)`),i.style.setProperty("--primary-primary-subtle-hover",`hsla(${r.primaryOffsetHover}, 80%, 89%, 1)`),i.style.setProperty("--primary-primary-alt",`hsla(${r.primary}, 38%, 21%, 1)`),i.style.setProperty("--primary-primary-alt-subtle",`hsla(${r.primaryOffset}, 23%, 91%, 1)`),i.style.setProperty("--gradient-background",`linear-gradient(0deg, hsla(${r.primary}, 100%, 35%, 0.05) 0%, hsla(${r.primary}, 0%, 0%, 0) 100%)`),i.style.setProperty("--gradient-gradient-fade",`linear-gradient(-0deg, hsla(${r.primaryOffset}, 80%, 99%, 0) 0%, hsla(${r.primaryOffset}, 80%, 99%, 1) 50%)`)},renderPreChat:function(t){const e=document.querySelector("#tarka-chat > .t-container > .body"),r=document.querySelector("#tarka-chat > .t-container > .scroll-fade"),i=document.querySelector("#tarka-chat > .t-container > .body > .message-container"),s=document.querySelector("#tarka-chat > .t-container > .footer");r.style.display="none",i.style.display="none",s.style.display="none";const a=t(()=>{var l;(l=e.querySelector(".tc-injected-prechat"))==null||l.remove(),r.style.display="block",i.style.display="flex",s.style.display="flex"});a.className+=" tc-injected-prechat",e.appendChild(a)}};return main});
diff --git a/package.json b/package.json
index 5fb930e..d4d5eb2 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "tarka-chat",
"private": true,
- "version": "2.3.0",
+ "version": "2.3.1",
"type": "module",
"repository": {
"type": "git",