!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,function(){"use strict";function e(t,e,n,r,a){function i(t){return o.sampleCurveY(o.solveCurveX(t))}var o=this,t=t||0,e=e||0,n=n||1,r=r||1;return this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,Object.defineProperty(i,"name",{writable:!0}),i.name=a||"cubic-bezier("+[t,e,n,r]+")",i}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t){if(t<=0)return 0;if(1<=t)return 1;for(var e,n=t,r=0,a=0;a<8;a+=1){if(r=this.sampleCurveX(n)-t,Math.abs(r)<1e-6)return n;if(e=this.sampleCurveDerivativeX(n),Math.abs(e)<1e-6)break;n-=r/e}for(var i=0,o=1,n=t;i>0)/10:E(e,n,r)>>0)+"px"})}function _(t){var e,n;return/rgb|rgba/.test(t)&&(e=(e=(n=t.replace(/\s|\)/,"").split("(")[1].split(","))[3]||null)?{r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(e)}:{r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),/^#/.test(t)&&(e={r:(n=nt(t)).r,g:n.g,b:n.b}),/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),/^#|^rgb/.test(t)||((n=document.getElementsByTagName("head")[0]).style.color=t,t=getComputedStyle(n,null).color,t=/rgb/.test(t)?t.replace(/[^\d,]/g,"").split(","):[0,0,0],n.style.color="",e={r:parseInt(t[0],10),g:parseInt(t[1],10),b:parseInt(t[2],10)}),e}var tt=["top","left","width","height"],et={},k=(tt.forEach(function(t){et[t]=J}),{prepareStart:function(t){return i(this.element,t)||p[t]},prepareProperty:function(t,e){return"%"===(e=w(e)).u?e.v*this.element["height"===t?"offsetHeight":"offsetWidth"]/100:e.v},onStart:et}),tt={component:"essentialBoxModel",category:"boxModel",properties:tt,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:E},functions:k,Util:{trueDimension:w}},nt=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,r){return e+e+n+n+r+r}),t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null};function rt(e,n,r){var a={};return Object.keys(n).forEach(function(t){"a"!==t?a[t]=E(e[t],n[t],r)>>0||0:e[t]&&n[t]&&(a[t]=(100*E(e[t],n[t],r)>>0)/100)}),a.a?"rgba("+a.r+","+a.g+","+a.b+","+a.a+")":"rgb("+a.r+","+a.g+","+a.b+")"}function at(a){this.valuesEnd[a]&&!s[a]&&(s[a]=function(t,e,n,r){t.style[a]=rt(e,n,r)})}var k=["color","backgroundColor","outlineColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],it={},ot=(k.forEach(function(t){it[t]="#000"}),{});k.forEach(function(t){ot[t]=at});var k={component:"colorProperties",category:"colors",properties:k,defaultValues:it,Interpolate:{numbers:E,colors:rt},functions:{prepareStart:function(t){return i(this.element,t)||p[t]},prepareProperty:function(t,e){return _(e)},onStart:ot},Util:{trueColor:_}},O={},st="htmlAttributes",ut=["fill","stroke","stop-color"];function ct(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var lt={component:st,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:E,colors:rt},functions:{prepareStart:function(t,e){var r=this,a={};return Object.keys(e).forEach(function(t){var e=ct(t).replace(/_+[a-z]+/,""),n=r.element.getAttribute(e);a[e]=ut.includes(e)?n||"rgba(0,0,0,0)":n||(/opacity/i.test(t)?1:0)}),a},prepareProperty:function(o,s){var u=this,c={};return Object.keys(s).forEach(function(t){var e,i,n=ct(t),r=/(%|[a-z]+)$/,a=u.element.getAttribute(n.replace(/_+[a-z]+/,""));ut.includes(n)?(l[st][n]=function(t){!u.valuesEnd[o]||!u.valuesEnd[o][t]||t in O||(O[t]=function(t,e,n,r,a){t.setAttribute(e,rt(n,r,a))})},c[n]=_(s[t])||p.htmlAttributes[t]):null!==a&&r.test(a)?(e=w(a).u||w(s[t]).u,i=/%/.test(e)?"_percent":"_"+e,l[st][n+i]=function(t){!u.valuesEnd[o]||!u.valuesEnd[o][t]||t in O||(O[t]=function(t,e,n,r,a){e=e.replace(i,"");t.setAttribute(e,(1e3*E(n.v,r.v,a)>>0)/1e3+r.u)})},c[n+i]=w(s[t])):r.test(s[t])&&null!==a&&(!a||r.test(a))||(l[st][n]=function(t){!u.valuesEnd[o]||!u.valuesEnd[o][t]||t in O||(O[t]=function(t,e,n,r,a){t.setAttribute(e,(1e3*E(n,r,a)>>0)/1e3)})},c[n]=parseFloat(s[t]))}),c},onStart:{attr:function(t){!s[t]&&this.valuesEnd[t]&&(s[t]=function(e,n,r,a){Object.keys(r).forEach(function(t){s.attributes[t](e,t,n[t],r[t],a)})})},attributes:function(t){!s[t]&&this.valuesEnd.attr&&(s[t]=O)}}},Util:{replaceUppercase:ct,trueColor:_,trueDimension:w}};var pt={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:E},functions:{prepareStart:function(t){return i(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(a){a in this.valuesEnd&&!s[a]&&(s[a]=function(t,e,n,r){t.style[a]=(1e3*E(e,n,r)>>0)/1e3})}}},ht=String("abcdefghijklmnopqrstuvwxyz").split(""),ft=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),yt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),dt=String("0123456789").split(""),gt=ht.concat(ft,dt),mt=gt.concat(yt),vt={alpha:ht,upper:ft,symbols:yt,numeric:dt,alphanumeric:gt,all:mt};function C(t,e){var n,r;return"string"==typeof t?((n=document.createElement("SPAN")).innerHTML=t,n.className=e,n):(!t.children.length||t.children.length&&t.children[0].className!==e?(n=t.innerHTML,(r=document.createElement("SPAN")).className=e,r.innerHTML=n,t.appendChild(r),t.innerHTML=r.outerHTML):t.children.length&&t.children[0].className===e&&(r=t.children[0]),r)}function xt(t,e){var n=[],r=t.children.length;if(r){for(var a,i,o,s=[],u=t.innerHTML,c=0,l=void 0,p=void 0;c>0)/1e3+n+")"}function Mt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function wt(t,e,n,r){var a="";return(a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"")+(t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"")+(t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":"")}function Et(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function _t(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function kt(t,e){return parseFloat(t)/100*e}function Ot(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Ct(t){var e=t.getAttribute("points").split(" "),n=0;if(1=T[n]&&("m"===n&&2=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}Vt(t)}else Vt(t);else t.err=I+": "+A+' "'+s[u]+'" is not a path command'}function Ft(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function Qt(t){if(Lt(t))return S(t);var t=function(t){if(Pt(t))return S(t);var e=new Ft(t);for(qt(e);e.index>0)/Math.pow(10,9)),M=Math.asin(((c-x)/a*Math.pow(10,9)>>0)/Math.pow(10,9)),b=ep&&(m=M,g=u,o=c,M=b+p*(s&&bh[2]&&(m=(p-c)/(p-h[2]),y={x:f[0]*(1-m)+h[0]*m,y:f[1]*(1-m)+h[1]*m}),h=[v,x,p]}return{length:p,point:y=l&&p<=c?{x:s,y:u}:y,min:{x:Math.min.apply(Math,d.map(function(t){return t.x})),y:Math.min.apply(Math,d.map(function(t){return t.y}))},max:{x:Math.max.apply(Math,d.map(function(t){return t.x})),y:Math.max.apply(Math,d.map(function(t){return t.y}))}}}function $t(t,e,n,r,a,i,o,s,u){for(var c,l,p,h,f,y,d,g,m,v,x="number"==typeof u,b=t,M=e,w=0,E=[b,M,w],_=[b,M],k={x:0,y:0},O=[{x:b,y:M}],C=(x&&u<=0&&(k={x:b,y:M}),0);C<=300;C+=1)c=t,l=e,p=n,h=r,f=a,y=i,d=o,g=s,v=void 0,v=1-(m=C/300),c={x:Math.pow(v,3)*c+3*Math.pow(v,2)*m*p+3*v*Math.pow(m,2)*f+Math.pow(m,3)*d,y:Math.pow(v,3)*l+3*Math.pow(v,2)*m*h+3*v*Math.pow(m,2)*y+Math.pow(m,3)*g},O=O.concat([{x:b=c.x,y:M=c.y}]),w+=L(_,[b,M]),_=[b,M],x&&uE[2]&&(p=(w-u)/(w-E[2]),k={x:_[0]*(1-p)+E[0]*p,y:_[1]*(1-p)+E[1]*p}),E=[b,M,w];return{length:w,point:k=x&&w<=u?{x:o,y:s}:k,min:{x:Math.min.apply(Math,O.map(function(t){return t.x})),y:Math.min.apply(Math,O.map(function(t){return t.y}))},max:{x:Math.max.apply(Math,O.map(function(t){return t.x})),y:Math.max.apply(Math,O.map(function(t){return t.y}))}}}function Gt(t,e,n,r,a,i,o){for(var s,u,c,l,p,h,f,y,d="number"==typeof o,g=t,m=e,v=0,x=[g,m,v],b=[g,m],M={x:0,y:0},w=[{x:g,y:m}],E=(d&&o<=0&&(M={x:g,y:m}),0);E<=300;E+=1)s=t,u=e,c=n,l=r,p=a,h=i,y=void 0,y=1-(f=E/300),s={x:Math.pow(y,2)*s+2*y*f*c+Math.pow(f,2)*p,y:Math.pow(y,2)*u+2*y*f*l+Math.pow(f,2)*h},w=w.concat([{x:g=s.x,y:m=s.y}]),v+=L(b,[g,m]),b=[g,m],d&&ox[2]&&(c=(v-o)/(v-x[2]),M={x:b[0]*(1-c)+x[0]*c,y:b[1]*(1-c)+x[1]*c}),x=[g,m,v];return{length:v,point:M=d&&v<=o?{x:a,y:i}:M,min:{x:Math.min.apply(Math,w.map(function(t){return t.x})),y:Math.min.apply(Math,w.map(function(t){return t.y}))},max:{x:Math.max.apply(Math,w.map(function(t){return t.x})),y:Math.max.apply(Math,w.map(function(t){return t.y}))}}}function Wt(t,e){for(var n,r,a,i=Dt(t),o="number"==typeof e,s=[],u=0,c=0,l=0,p=0,h=[],f=[],y=0,d={x:0,y:0},g=d,m=d,v=d,x=0,b=0,M=i.length;b>0)/1e3)}return a}function ae(t,e){r=[],a=-1,t.forEach(function(t){"M"===t[0]?(n=[t],a+=1):n=n.concat([t]),r[a]=n});var n,r,a,i,o=Dt(r[0]),s=Jt(o),u=[],c=3;e&&!Number.isNaN(e)&&0<+e&&(c=Math.max(c,Math.ceil(s/e)));for(var l=0;le;)r=P(n,r,.5),t.splice(a+1,0,r)}function ce(t){return Array.isArray(t)&&t.every(function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])})}function le(t,e){if("string"==typeof t)var n=ie(t,e),r=n.polygon,n=n.skipBisect;else if(!Array.isArray(t))throw Error(A+": "+t);t=[].concat(r);if(ce(t))return 1>0];" "===e?(i=u.substring(Math.min(r*u.length,u.length)>>0,0),t.innerHTML=r<1?i+c:o):" "===n?(a=s.substring(0,Math.min((1-r)*s.length,s.length)>>0),t.innerHTML=r<1?a+c:o):(a=s.substring(s.length,Math.min(r*s.length,s.length)>>0),i=u.substring(0,Math.min(r*u.length,u.length)>>0),t.innerHTML=r<1?i+c+a:o)})},number:function(t){t in this.valuesEnd&&!s[t]&&(s[t]=function(t,e,n,r){t.innerHTML=E(e,n,r)>>0})}}},Util:{charSet:vt,createTextTweens:function(n,r,t){if(n.playing)return!1;var a=t||{},i=(a.duration=1e3,"auto"===t.duration?a.duration="auto":Number.isFinite(+t.duration)&&(a.duration=+t.duration),v.tween),e=(t=r,u=xt(e=n,"text-part"),t=xt(C(t),"text-part"),e.innerHTML="",e.innerHTML+=u.map(function(t){return t.className+=" oldText",t.outerHTML}).join(""),e.innerHTML+=t.map(function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")}).join(""),[u,t]),o=e[0],s=e[1],u=[].slice.call(n.getElementsByClassName("oldText")).reverse(),t=[].slice.call(n.getElementsByClassName("newText")),c=[],l=0;return(c=(c=c.concat(u.map(function(t,e){return a.duration="auto"===a.duration?75*o[e].innerHTML.length:a.duration,a.delay=l,a.onComplete=null,l+=a.duration,new i(t,{text:t.innerHTML},{text:""},a)}))).concat(t.map(function(t,e){return a.duration="auto"===a.duration?75*s[e].innerHTML.length:a.duration,a.delay=l,a.onComplete=e===s.length-1?function(){n.innerHTML=r,n.playing=!1}:null,l+=a.duration,new i(t,{text:""},{text:s[e].innerHTML},a)}))).start=function(){n.playing||(c.forEach(function(t){return t.start()}),n.playing=!0)},c}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){var e=B(this.element);return e[t]||p[t]},prepareProperty:function(t,u){var c=["X","Y","Z"],l={},p=[],h=[],f=[],y=["translate3d","translate","rotate3d","skew"];return Object.keys(u).forEach(function(t){var e="object"==typeof u[t]&&u[t].length?u[t].map(function(t){return parseInt(t,10)}):parseInt(u[t],10);if(y.includes(t)){var n="translate"===t||"rotate"===t?t+"3d":t;l[n]="skew"===t?e.length?[e[0]||0,e[1]||0]:[e||0,0]:"translate"!==t||e.length?[e[0]||0,e[1]||0,e[2]||0]:[e||0,0,0]}else if(/[XYZ]/.test(t)){var r=t.replace(/[XYZ]/,""),n="skew"===r?r:r+"3d",a="skew"===r?2:3,i=[];"translate"===r?i=p:"rotate"===r?i=h:"skew"===r&&(i=f);for(var o=0;o>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:Et,skew:_t}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:E},functions:{prepareStart:function(){return At(this.element)},prepareProperty:function(t,e){return At(this.element,e)},onStart:function(t){t in this.valuesEnd&&!s[t]&&(s[t]=function(t,e,n,r){var a=(100*e.l>>0)/100,i=0-(100*E(e.s,n.s,r)>>0)/100,e=(100*E(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(e<1?0:e)>>0)/100+"px, "+a+"px"})}},Util:{getRectLength:Ot,getPolyLength:Ct,getLineLength:Tt,getCircleLength:St,getEllipseLength:It,getTotalLength:jt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:At,percent:kt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:re,defaultOptions:{morphPrecision:10},functions:{prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGPathElement?a=e:/^\.|^#/.test(e)&&(a=b(e)),"object"==typeof e&&e.polygon?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!s[t]&&this.valuesEnd[t]&&(s[t]=function(t,e,n,r){var e=e.polygon,a=n.polygon,i=a.length;t.setAttribute("d",1===r?n.original:"M"+re(e,a,i,r).join("L")+"Z")})},crossCheck:function(t){var e,n;this.valuesEnd[t]&&(n=this.valuesStart[t].polygon,e=this.valuesEnd[t].polygon,n&&e&&n.length===e.length||(e=(n=pe(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):c.morphPrecision))[0],n=n[1],this.valuesStart[t].polygon=e,this.valuesEnd[t].polygon=n))}},Util:{addPoints:se,bisect:ue,getPolygon:le,validPolygon:ce,getInterpolationPoints:pe,pathStringToPolygon:ie,distanceSquareRoot:L,midPoint:P,approximatePolygon:ae,rotatePolygon:oe,pathToString:function(t,e){return Yt(t,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")},pathToCurve:function(t){var e;if(Nt(e=t)&&e.every(function(t){t=t[0];return"MC".includes(t)}))return S(t);for(var n=Dt(t),r=Object.assign({},Ut),a=[],i=n.length,o=0;o