p-1e-8&&!m?p:t<1e-8?0:t;if(f){if(g!==this._tTime||!t||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==m){if(i=g,c=this.timeline,this._repeat){if(s=f+this._rDelay,this._repeat<-1&&m)return this.totalTime(100*s+t,e,n);if(i=Ri(g%s),g===p?(o=this._repeat,i=f):((o=~~(g/s))&&o===g/s&&(i=f,o--),i>f&&(i=f)),(l=this._yoyo&&1&o)&&(h=this._yEase,i=f-i),a=er(this._tTime,s),i===d&&!n&&this._initted)return this._tTime=g,this;o!==a&&(c&&this._yEase&&Kr(c,l),!this.vars.repeatRefresh||l||this._lock||(this._lock=n=1,this.render(Ri(s*o),!0).invalidate()._lock=0))}if(!this._initted){if(lr(this,m?t:i,n,e,g))return this._tTime=0,this;if(d!==this._time)return this;if(f!==this._dur)return this.render(t,e,n)}if(this._tTime=g,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=u=(h||this._ease)(i/f),this._from&&(this.ratio=u=1-u),i&&!d&&!e&&(Pr(this,"onStart"),this._tTime!==g))return this;for(r=this._pt;r;)r.r(u,r.d),r=r._next;c&&c.render(t<0?t:!i&&l?-1e-8:c._dur*c._ease(i/this._dur),e,n)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(m&&Qi(this,t,0,n),Pr(this,"onUpdate")),this._repeat&&o!==a&&this.vars.onRepeat&&!e&&this.parent&&Pr(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(m&&!this._onUpdate&&Qi(this,t,0,!0),(t||!f)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Zi(this,1),e||m&&!d||!(g||d||l)||(Pr(this,g===p?"onComplete":"onReverseComplete",!0),this._prom&&!(g0)&&this._prom()))}}else!function(t,e,n,i){var r,o,s,a=t.ratio,l=e<0||!e&&(!t._start&&ur(t)&&(t._initted||!cr(t))||(t._ts<0||t._dp._ts<0)&&!cr(t))?0:1,u=t._rDelay,c=0;if(u&&t._repeat&&(c=_r(0,t._tDur,e),o=er(c,u),t._yoyo&&1&o&&(l=1-l),o!==er(t._tTime,u)&&(a=1-l,t.vars.repeatRefresh&&t._initted&&t.invalidate())),l!==a||$n||i||1e-8===t._zTime||!e&&t._zTime){if(!t._initted&&lr(t,e,i,n,c))return;for(s=t._zTime,t._zTime=e||(n?1e-8:0),n||(n=e&&!s),t.ratio=l,t._from&&(l=1-l),t._time=0,t._tTime=c,r=t._pt;r;)r.r(l,r.d),r=r._next;e<0&&Qi(t,e,0,!0),t._onUpdate&&!n&&Pr(t,"onUpdate"),c&&t._repeat&&!n&&t.parent&&Pr(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===l&&(l&&Zi(t,1),n||$n||(Pr(t,l?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,n);return this},n.targets=function(){return this._targets},n.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},n.resetTo=function(t,e,n,i){Bn||Yr.wake(),this._ts||this.play();var r=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||ho(this,r),function(t,e,n,i,r,o,s){var a,l,u,c,h=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!h)for(h=t._ptCache[e]=[],u=t._ptLookup,c=t._targets.length;c--;){if((a=u[c][e])&&a.d&&a.d._pt)for(a=a.d._pt;a&&a.p!==e&&a.fp!==e;)a=a._next;if(!a)return ao=1,t.vars[e]="+=0",ho(t,s),ao=0,1;h.push(a)}for(c=h.length;c--;)(a=(l=h[c])._pt||l).s=!i&&0!==i||r?a.s+(i||0)+o*a.c:i,a.c=n-a.s,l.e&&(l.e=Di(n)+vr(l.e)),l.b&&(l.b=a.s+vr(l.b))}(this,t,e,n,i,this._ease(r/this._dur),r)?this.resetTo(t,e,n,i):(rr(this,0),this.parent||Wi(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?Dr(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,so&&!0!==so.vars.overwrite)._first||Dr(this),this.parent&&n!==this.timeline.totalDuration()&&hr(this,this._dur*this.timeline._tDur/n,0,1),this}var i,r,o,s,a,l,u,c=this._targets,h=t?wr(t):c,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0}(c,h))return"all"===e&&(this._pt=0),Dr(this);for(i=this._op=this._op||[],"all"!==e&&(Zn(e)&&(a={},Pi(e,(function(t){return a[t]=1})),e=a),e=function(t,e){var n,i,r,o,s=t[0]?$i(t[0]).harness:0,a=s&&s.aliases;if(!a)return e;for(i in n=Xi({},e),a)if(i in n)for(r=(o=a[i].split(",")).length;r--;)n[o[r]]=n[i];return n}(c,e)),u=c.length;u--;)if(~h.indexOf(c[u]))for(a in r=d[u],"all"===e?(i[u]=e,s=r,o={}):(o=i[u]=i[u]||{},s=e),s)(l=r&&r[a])&&("kill"in l.d&&!0!==l.d.kill(a)||qi(this,l,"_pt"),delete r[a]),"all"!==o&&(o[a]=1);return this._initted&&!this._pt&&p&&Dr(this),this},e.to=function(t,n){return new e(t,n,arguments[2])},e.from=function(t,e){return mr(1,arguments)},e.delayedCall=function(t,n,i,r){return new e(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:n,onReverseComplete:n,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:r})},e.fromTo=function(t,e,n){return mr(2,arguments)},e.set=function(t,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new e(t,n)},e.killTweensOf=function(t,e,n){return Pn.killTweensOf(t,e,n)},e}(ro);ji(_o.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Pi("staggerTo,staggerFrom,staggerFromTo",(function(t){_o[t]=function(){var e=new oo,n=yr.call(arguments,0);return n.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,n)}}));var vo=function(t,e,n){return t[e]=n},yo=function(t,e,n){return t[e](n)},xo=function(t,e,n,i){return t[e](i.fp,n)},bo=function(t,e,n){return t.setAttribute(e,n)},wo=function(t,e){return Gn(t[e])?yo:Qn(t[e])&&t.setAttribute?bo:vo},To=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},Ao=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Co=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round(1e4*(n.s+n.c*t))/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},Mo=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},ko=function(t,e,n,i){for(var r,o=this._pt;o;)r=o._next,o.p===i&&o.modifier(t,e,n),o=r},Eo=function(t){for(var e,n,i=this._pt;i;)n=i._next,i.p===t&&!i.op||i.op===t?qi(this,i,"_pt"):i.dep||(e=1),i=n;return!e},So=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Lo=function(t){for(var e,n,i,r,o=t._pt;o;){for(e=o._next,n=i;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:r)?o._prev._next=o:i=o,(o._next=n)?n._prev=o:r=o,o=e}t._pt=i},$o=function(){function t(t,e,n,i,r,o,s,a,l){this.t=e,this.s=i,this.c=r,this.p=n,this.r=o||To,this.d=s||this,this.set=a||vo,this.pr=l||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,n){this.mSet=this.mSet||this.set,this.set=So,this.m=t,this.mt=n,this.tween=e},t}();Pi(Si+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return wi[t]=1})),di.TweenMax=di.TweenLite=_o,di.TimelineLite=di.TimelineMax=oo,Pn=new oo({sortChildren:!1,defaults:jn,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Vn.stringFilter=Xr;var Oo=[],Po={},Do=[],Ro=0,No=function(t){return(Po[t]||Do).map((function(t){return t()}))},zo=function(){var t=Date.now(),e=[];t-Ro>2&&(No("matchMediaInit"),Oo.forEach((function(t){var n,i,r,o,s=t.queries,a=t.conditions;for(i in s)(n=Dn.matchMedia(s[i]).matches)&&(r=1),n!==a[i]&&(a[i]=n,o=1);o&&(t.revert(),r&&e.push(t))})),No("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t)})),Ro=t,No("matchMedia"))},Fo=function(){function t(t,e){this.selector=e&&Tr(e),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,n){Gn(t)&&(n=e,e=t,t=Gn);var i=this,r=function(){var t,r=On,o=i.selector;return r&&r!==i&&r.data.push(i),n&&(i.selector=Tr(n)),On=i,t=e.apply(i,arguments),Gn(t)&&i._r.push(t),On=r,i.selector=o,i.isReverted=!1,t};return i.last=r,t===Gn?r(i):t?i[t]=r:r},e.ignore=function(t){var e=On;On=null,t(this),On=e},e.getTweens=function(){var e=[];return this.data.forEach((function(n){return n instanceof t?e.push.apply(e,n.getTweens()):n instanceof _o&&!(n.parent&&"nested"===n.parent.data)&&e.push(n)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var n=this;if(t){var i=this.getTweens();this.data.forEach((function(t){"isFlip"===t.data&&(t.revert(),t.getChildren(!0,!0,!1).forEach((function(t){return i.splice(i.indexOf(t),1)})))})),i.map((function(t){return{g:t.globalTime(0),t:t}})).sort((function(t,e){return e.g-t.g||-1})).forEach((function(e){return e.t.revert(t)})),this.data.forEach((function(e){return!(e instanceof ro)&&e.revert&&e.revert(t)})),this._r.forEach((function(e){return e(t,n)})),this.isReverted=!0}else this.data.forEach((function(t){return t.kill&&t.kill()}));if(this.clear(),e){var r=Oo.indexOf(this);~r&&Oo.splice(r,1)}},e.revert=function(t){this.kill(t||{})},t}(),Io=function(){function t(t){this.contexts=[],this.scope=t}var e=t.prototype;return e.add=function(t,e,n){Jn(t)||(t={matches:t});var i,r,o,s=new Fo(0,n||this.scope),a=s.conditions={};for(r in this.contexts.push(s),e=s.add("onMatch",e),s.queries=t,t)"all"===r?o=1:(i=Dn.matchMedia(t[r]))&&(Oo.indexOf(s)<0&&Oo.push(s),(a[r]=i.matches)&&(o=1),i.addListener?i.addListener(zo):i.addEventListener("change",zo));return o&&e(s),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Bo={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n1){var i=t.map((function(t){return Xo.quickSetter(t,e,n)})),r=i.length;return function(t){for(var e=r;e--;)i[e](t)}}t=t[0]||{};var o=Ci[e],s=$i(t),a=s.harness&&(s.harness.aliases||{})[e]||e,l=o?function(e){var i=new o;In._pt=0,i.init(t,n?e+n:e,In,0,[t]),i.render(1,i),In._pt&&Mo(1,In)}:s.set(t,a);return o?l:function(e){return l(t,a,n?e+n:e,s,1)}},quickTo:function(t,e,n){var i,r=Xo.to(t,Xi(((i={})[e]="+=0.1",i.paused=!0,i),n||{})),o=function(t,n,i){return r.resetTo(e,t,n,i)};return o.tween=r,o},isTweening:function(t){return Pn.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Qr(t.ease,jn.ease)),Yi(jn,t||{})},config:function(t){return Yi(Vn,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,r=t.defaults,o=t.extendTimeline;(i||"").split(",").forEach((function(t){return t&&!Ci[t]&&!di[t]&&gi(e+" effect requires "+t+" plugin.")})),Mi[e]=function(t,e,i){return n(wr(t),ji(e||{},r),i)},o&&(oo.prototype[e]=function(t,n,i){return this.add(Mi[e](t,Jn(n)?n:(i=n)&&{},this),i)})},registerEase:function(t,e){Ur[t]=Qr(e)},parseEase:function(t,e){return arguments.length?Qr(t,e):Ur},getById:function(t){return Pn.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var n,i,r=new oo(t);for(r.smoothChildTiming=ti(t.smoothChildTiming),Pn.remove(r),r._dp=0,r._time=r._tTime=Pn._time,n=Pn._first;n;)i=n._next,!e&&!n._dur&&n instanceof _o&&n.vars.onComplete===n._targets[0]||sr(r,n,n._start-n._delay),n=i;return sr(Pn,r,0),r},context:function(t,e){return t?new Fo(t,e):On},matchMedia:function(t){return new Io(t)},matchMediaRefresh:function(){return Oo.forEach((function(t){var e,n,i=t.conditions;for(n in i)i[n]&&(i[n]=!1,e=1);e&&t.revert()}))||zo()},addEventListener:function(t,e){var n=Po[t]||(Po[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=Po[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:function t(e,n,i){var r=n-e;return ri(e)?Sr(e,t(0,e.length),n):gr(i,(function(t){return(r+(t-e)%r)%r+e}))},wrapYoyo:function t(e,n,i){var r=n-e,o=2*r;return ri(e)?Sr(e,t(0,e.length-1),n):gr(i,(function(t){return e+((t=(o+(t-e)%o)%o||0)>r?o-t:t)}))},distribute:Cr,random:Er,snap:kr,normalize:function(t,e,n){return $r(t,e,0,1,n)},getUnit:vr,clamp:function(t,e,n){return gr(n,(function(n){return _r(t,e,n)}))},splitColor:Fr,toArray:wr,selector:Tr,mapRange:$r,pipe:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0)return;i._gsap.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(ys,e,"")),t=vs}(r||e)&&this.props.push(t,e,r[t])},bs=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},ws=function(){var t,e,n=this.props,i=this.target,r=i.style,o=i._gsap;for(t=0;t=0?Ms[r]:"")+t},Es=function(){"undefined"!=typeof window&&window.document&&(Yo=window,Ho=Yo.document,Uo=Ho.documentElement,qo=As("div")||{style:{}},As("div"),vs=ks(vs),ys=vs+"Origin",qo.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ko=!!ks("perspective"),Go=Xo.core.reverting,Wo=1)},Ss=function t(e){var n,i=As("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,o=this.nextSibling,s=this.style.cssText;if(Uo.appendChild(i),i.appendChild(this),this.style.display="block",e)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(n=this._gsapBBox());return r&&(o?r.insertBefore(this,o):r.appendChild(this)),Uo.removeChild(i),this.style.cssText=s,n},Ls=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},$s=function(t){var e;try{e=t.getBBox()}catch(n){e=Ss.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Ss||(e=Ss.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+Ls(t,["x","cx","x1"])||0,y:+Ls(t,["y","cy","y1"])||0,width:0,height:0}},Os=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!$s(t))},Ps=function(t,e){if(e){var n=t.style;e in Qo&&e!==ys&&(e=vs),n.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty(e.replace(ns,"-$1").toLowerCase())):n.removeAttribute(e)}},Ds=function(t,e,n,i,r,o){var s=new $o(t._pt,e,n,0,1,o?hs:cs);return t._pt=s,s.b=i,s.e=r,t._props.push(n),s},Rs={deg:1,rad:1,turn:1},Ns={grid:1,flex:1},zs=function t(e,n,i,r){var o,s,a,l,u=parseFloat(i)||0,c=(i+"").trim().substr((u+"").length)||"px",h=qo.style,d=is.test(n),p="svg"===e.tagName.toLowerCase(),f=(p?"client":"offset")+(d?"Width":"Height"),m=100,g="px"===r,_="%"===r;return r===c||!u||Rs[r]||Rs[c]?u:("px"!==c&&!g&&(u=t(e,n,i,"px")),l=e.getCTM&&Os(e),!_&&"%"!==c||!Qo[n]&&!~n.indexOf("adius")?(h[d?"width":"height"]=m+(g?c:r),s=~n.indexOf("adius")||"em"===r&&e.appendChild&&!p?e:e.parentNode,l&&(s=(e.ownerSVGElement||{}).parentNode),s&&s!==Ho&&s.appendChild||(s=Ho.body),(a=s._gsap)&&_&&a.width&&d&&a.time===Yr.time&&!a.uncache?Di(u/a.width*m):((_||"%"===c)&&!Ns[Cs(s,"display")]&&(h.position=Cs(e,"position")),s===e&&(h.position="static"),s.appendChild(qo),o=qo[f],s.removeChild(qo),h.position="absolute",d&&_&&((a=$i(s)).time=Yr.time,a.width=s[f]),Di(g?o*u/m:o&&u?m/o*u:0))):(o=l?e.getBBox()[d?"width":"height"]:e[f],Di(_?u/o*m:u/100*o)))},Fs=function(t,e,n,i){var r;return Wo||Es(),e in os&&"transform"!==e&&~(e=os[e]).indexOf(",")&&(e=e.split(",")[0]),Qo[e]&&"transform"!==e?(r=Gs(t,i),r="transformOrigin"!==e?r[e]:r.svg?r.origin:Ks(Cs(t,ys))+" "+r.zOrigin+"px"):(!(r=t.style[e])||"auto"===r||i||~(r+"").indexOf("calc("))&&(r=Xs[e]&&Xs[e](t,e,n)||Cs(t,e)||Oi(t,e)||("opacity"===e?1:0)),n&&!~(r+"").trim().indexOf(" ")?zs(t,e,r,n)+n:r},Is=function(t,e,n,i){if(!n||"none"===n){var r=ks(e,t,1),o=r&&Cs(t,r,1);o&&o!==n?(e=r,n=o):"borderColor"===e&&(n=Cs(t,"borderTopColor"))}var s,a,l,u,c,h,d,p,f,m,g,_=new $o(this._pt,t.style,e,0,1,Co),v=0,y=0;if(_.b=n,_.e=i,n+="","auto"===(i+="")&&(t.style[e]=i,i=Cs(t,e)||i,t.style[e]=n),Xr(s=[n,i]),i=s[1],l=(n=s[0]).match(ai)||[],(i.match(ai)||[]).length){for(;a=ai.exec(i);)d=a[0],f=i.substring(v,a.index),c?c=(c+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(c=1),d!==(h=l[y++]||"")&&(u=parseFloat(h)||0,g=h.substr((u+"").length),"="===d.charAt(1)&&(d=Ni(u,d)+g),p=parseFloat(d),m=d.substr((p+"").length),v=ai.lastIndex-m.length,m||(m=m||Vn.units[e]||g,v===i.length&&(i+=m,_.e+=m)),g!==m&&(u=zs(t,e,h,m)||0),_._pt={_next:_._pt,p:f||1===y?f:",",s:u,c:p-u,m:c&&c<4||"zIndex"===e?Math.round:0});_.c=v-1;)n=a[r],Qo[n]&&(i=1,n="transformOrigin"===n?ys:vs),Ps(o,n);i&&(Ps(o,vs),l&&(l.svg&&o.removeAttribute("transform"),Gs(o,1),l.uncache=1,bs(s)))}},Xs={clearProps:function(t,e,n,i,r){if("isFromStart"!==r.data){var o=t._pt=new $o(t._pt,e,n,0,0,js);return o.u=i,o.pr=-10,o.tween=r,t._props.push(n),1}}},Ys=[1,0,0,1,0,0],Hs={},Us=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Ws=function(t){var e=Cs(t,vs);return Us(e)?Ys:e.substr(7).match(si).map(Di)},qs=function(t,e){var n,i,r,o,s=t._gsap||$i(t),a=t.style,l=Ws(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(r=t.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?Ys:l:(l!==Ys||t.offsetParent||t===Uo||s.svg||(r=a.display,a.display="block",(n=t.parentNode)&&t.offsetParent||(o=1,i=t.nextElementSibling,Uo.appendChild(t)),l=Ws(t),r?a.display=r:Ps(t,"display"),o&&(i?n.insertBefore(t,i):n?n.appendChild(t):Uo.removeChild(t))),e&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},Zs=function(t,e,n,i,r,o){var s,a,l,u=t._gsap,c=r||qs(t,!0),h=u.xOrigin||0,d=u.yOrigin||0,p=u.xOffset||0,f=u.yOffset||0,m=c[0],g=c[1],_=c[2],v=c[3],y=c[4],x=c[5],b=e.split(" "),w=parseFloat(b[0])||0,T=parseFloat(b[1])||0;n?c!==Ys&&(a=m*v-g*_)&&(l=w*(-g/a)+T*(m/a)-(m*x-g*y)/a,w=w*(v/a)+T*(-_/a)+(_*x-v*y)/a,T=l):(w=(s=$s(t)).x+(~b[0].indexOf("%")?w/100*s.width:w),T=s.y+(~(b[1]||b[0]).indexOf("%")?T/100*s.height:T)),i||!1!==i&&u.smooth?(y=w-h,x=T-d,u.xOffset=p+(y*m+x*_)-y,u.yOffset=f+(y*g+x*v)-x):u.xOffset=u.yOffset=0,u.xOrigin=w,u.yOrigin=T,u.smooth=!!i,u.origin=e,u.originIsAbsolute=!!n,t.style[ys]="0px 0px",o&&(Ds(o,u,"xOrigin",h,w),Ds(o,u,"yOrigin",d,T),Ds(o,u,"xOffset",p,u.xOffset),Ds(o,u,"yOffset",f,u.yOffset)),t.setAttribute("data-svg-origin",w+" "+T)},Gs=function(t,e){var n=t._gsap||new io(t);if("x"in n&&!e&&!n.uncache)return n;var i,r,o,s,a,l,u,c,h,d,p,f,m,g,_,v,y,x,b,w,T,A,C,M,k,E,S,L,$,O,P,D,R=t.style,N=n.scaleX<0,z="px",F="deg",I=getComputedStyle(t),B=Cs(t,ys)||"0";return i=r=o=l=u=c=h=d=p=0,s=a=1,n.svg=!(!t.getCTM||!Os(t)),I.translate&&("none"===I.translate&&"none"===I.scale&&"none"===I.rotate||(R[vs]=("none"!==I.translate?"translate3d("+(I.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==I.rotate?"rotate("+I.rotate+") ":"")+("none"!==I.scale?"scale("+I.scale.split(" ").join(",")+") ":"")+("none"!==I[vs]?I[vs]:"")),R.scale=R.rotate=R.translate="none"),g=qs(t,n.svg),n.svg&&(n.uncache?(k=t.getBBox(),B=n.xOrigin-k.x+"px "+(n.yOrigin-k.y)+"px",M=""):M=!e&&t.getAttribute("data-svg-origin"),Zs(t,M||B,!!M||n.originIsAbsolute,!1!==n.smooth,g)),f=n.xOrigin||0,m=n.yOrigin||0,g!==Ys&&(x=g[0],b=g[1],w=g[2],T=g[3],i=A=g[4],r=C=g[5],6===g.length?(s=Math.sqrt(x*x+b*b),a=Math.sqrt(T*T+w*w),l=x||b?es(b,x)*Jo:0,(h=w||T?es(w,T)*Jo+l:0)&&(a*=Math.abs(Math.cos(h*ts))),n.svg&&(i-=f-(f*x+m*w),r-=m-(f*b+m*T))):(D=g[6],O=g[7],S=g[8],L=g[9],$=g[10],P=g[11],i=g[12],r=g[13],o=g[14],u=(_=es(D,$))*Jo,_&&(M=A*(v=Math.cos(-_))+S*(y=Math.sin(-_)),k=C*v+L*y,E=D*v+$*y,S=A*-y+S*v,L=C*-y+L*v,$=D*-y+$*v,P=O*-y+P*v,A=M,C=k,D=E),c=(_=es(-w,$))*Jo,_&&(v=Math.cos(-_),P=T*(y=Math.sin(-_))+P*v,x=M=x*v-S*y,b=k=b*v-L*y,w=E=w*v-$*y),l=(_=es(b,x))*Jo,_&&(M=x*(v=Math.cos(_))+b*(y=Math.sin(_)),k=A*v+C*y,b=b*v-x*y,C=C*v-A*y,x=M,A=k),u&&Math.abs(u)+Math.abs(l)>359.9&&(u=l=0,c=180-c),s=Di(Math.sqrt(x*x+b*b+w*w)),a=Di(Math.sqrt(C*C+D*D)),_=es(A,C),h=Math.abs(_)>2e-4?_*Jo:0,p=P?1/(P<0?-P:P):0),n.svg&&(M=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Us(Cs(t,vs)),M&&t.setAttribute("transform",M))),Math.abs(h)>90&&Math.abs(h)<270&&(N?(s*=-1,h+=l<=0?180:-180,l+=l<=0?180:-180):(a*=-1,h+=h<=0?180:-180)),e=e||n.uncache,n.x=i-((n.xPercent=i&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+z,n.y=r-((n.yPercent=r&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-r)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+z,n.z=o+z,n.scaleX=Di(s),n.scaleY=Di(a),n.rotation=Di(l)+F,n.rotationX=Di(u)+F,n.rotationY=Di(c)+F,n.skewX=h+F,n.skewY=d+F,n.transformPerspective=p+z,(n.zOrigin=parseFloat(B.split(" ")[2])||0)&&(R[ys]=Ks(B)),n.xOffset=n.yOffset=0,n.force3D=Vn.force3D,n.renderTransform=n.svg?ea:Ko?ta:Js,n.uncache=0,n},Ks=function(t){return(t=t.split(" "))[0]+" "+t[1]},Qs=function(t,e,n){var i=vr(e);return Di(parseFloat(e)+parseFloat(zs(t,"x",n+"px",i)))+i},Js=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,ta(t,e)},ta=function(t,e){var n=e||this,i=n.xPercent,r=n.yPercent,o=n.x,s=n.y,a=n.z,l=n.rotation,u=n.rotationY,c=n.rotationX,h=n.skewX,d=n.skewY,p=n.scaleX,f=n.scaleY,m=n.transformPerspective,g=n.force3D,_=n.target,v=n.zOrigin,y="",x="auto"===g&&t&&1!==t||!0===g;if(v&&("0deg"!==c||"0deg"!==u)){var b,w=parseFloat(u)*ts,T=Math.sin(w),A=Math.cos(w);w=parseFloat(c)*ts,b=Math.cos(w),o=Qs(_,o,T*b*-v),s=Qs(_,s,-Math.sin(w)*-v),a=Qs(_,a,A*b*-v+v)}"0px"!==m&&(y+="perspective("+m+") "),(i||r)&&(y+="translate("+i+"%, "+r+"%) "),(x||"0px"!==o||"0px"!==s||"0px"!==a)&&(y+="0px"!==a||x?"translate3d("+o+", "+s+", "+a+") ":"translate("+o+", "+s+") "),"0deg"!==l&&(y+="rotate("+l+") "),"0deg"!==u&&(y+="rotateY("+u+") "),"0deg"!==c&&(y+="rotateX("+c+") "),"0deg"===h&&"0deg"===d||(y+="skew("+h+", "+d+") "),1===p&&1===f||(y+="scale("+p+", "+f+") "),_.style[vs]=y||"translate(0, 0)"},ea=function(t,e){var n,i,r,o,s,a=e||this,l=a.xPercent,u=a.yPercent,c=a.x,h=a.y,d=a.rotation,p=a.skewX,f=a.skewY,m=a.scaleX,g=a.scaleY,_=a.target,v=a.xOrigin,y=a.yOrigin,x=a.xOffset,b=a.yOffset,w=a.forceCSS,T=parseFloat(c),A=parseFloat(h);d=parseFloat(d),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),d+=f),d||p?(d*=ts,p*=ts,n=Math.cos(d)*m,i=Math.sin(d)*m,r=Math.sin(d-p)*-g,o=Math.cos(d-p)*g,p&&(f*=ts,s=Math.tan(p-f),r*=s=Math.sqrt(1+s*s),o*=s,f&&(s=Math.tan(f),n*=s=Math.sqrt(1+s*s),i*=s)),n=Di(n),i=Di(i),r=Di(r),o=Di(o)):(n=m,o=g,i=r=0),(T&&!~(c+"").indexOf("px")||A&&!~(h+"").indexOf("px"))&&(T=zs(_,"x",c,"px"),A=zs(_,"y",h,"px")),(v||y||x||b)&&(T=Di(T+v-(v*n+y*r)+x),A=Di(A+y-(v*i+y*o)+b)),(l||u)&&(s=_.getBBox(),T=Di(T+l/100*s.width),A=Di(A+u/100*s.height)),s="matrix("+n+","+i+","+r+","+o+","+T+","+A+")",_.setAttribute("transform",s),w&&(_.style[vs]=s)},na=function(t,e,n,i,r){var o,s,a=360,l=Zn(r),u=parseFloat(r)*(l&&~r.indexOf("rad")?Jo:1)-i,c=i+u+"deg";return l&&("short"===(o=r.split("_")[1])&&(u%=a)!==u%180&&(u+=u<0?a:-360),"cw"===o&&u<0?u=(u+36e9)%a-~~(u/a)*a:"ccw"===o&&u>0&&(u=(u-36e9)%a-~~(u/a)*a)),t._pt=s=new $o(t._pt,e,n,i,u,as),s.e=c,s.u="deg",t._props.push(n),s},ia=function(t,e){for(var n in e)t[n]=e[n];return t},ra=function(t,e,n){var i,r,o,s,a,l,u,c=ia({},n._gsap),h=n.style;for(r in c.svg?(o=n.getAttribute("transform"),n.setAttribute("transform",""),h[vs]=e,i=Gs(n,1),Ps(n,vs),n.setAttribute("transform",o)):(o=getComputedStyle(n)[vs],h[vs]=e,i=Gs(n,1),h[vs]=o),Qo)(o=c[r])!==(s=i[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(a=vr(o)!==(u=vr(s))?zs(n,r,o,u):parseFloat(o),l=parseFloat(s),t._pt=new $o(t._pt,i,r,a,l-a,ss),t._pt.u=u||0,t._props.push(r));ia(i,c)};Pi("padding,margin,Width,Radius",(function(t,e){var n="Top",i="Right",r="Bottom",o="Left",s=(e<3?[n,i,r,o]:[n+o,n+i,r+i,r+o]).map((function(n){return e<2?t+n:"border"+n+t}));Xs[e>1?"border"+t:t]=function(t,e,n,i,r){var o,a;if(arguments.length<4)return o=s.map((function(e){return Fs(t,e,n)})),5===(a=o.join(" ")).split(o[0]).length?o[0]:a;o=(i+"").split(" "),a={},s.forEach((function(t,e){return a[t]=o[e]=o[e]||o[(e-1)/2|0]})),t.init(e,a,r)}}));var oa,sa,aa,la={name:"css",register:Es,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,r){var o,s,a,l,u,c,h,d,p,f,m,g,_,v,y,x,b=this._props,w=t.style,T=n.vars.startAt;for(h in Wo||Es(),this.styles=this.styles||Ts(t),x=this.styles.props,this.tween=n,e)if("autoRound"!==h&&(s=e[h],!Ci[h]||!co(h,e,n,i,t,r)))if(u=typeof s,c=Xs[h],"function"===u&&(u=typeof(s=s.call(n,i,t,r))),"string"===u&&~s.indexOf("random(")&&(s=Lr(s)),c)c(this,t,h,s,n)&&(y=1);else if("--"===h.substr(0,2))o=(getComputedStyle(t).getPropertyValue(h)+"").trim(),s+="",Vr.lastIndex=0,Vr.test(o)||(d=vr(o),p=vr(s)),p?d!==p&&(o=zs(t,h,o,p)+p):d&&(s+=d),this.add(w,"setProperty",o,s,i,r,0,0,h),b.push(h),x.push(h,0,w[h]);else if("undefined"!==u){if(T&&h in T?(o="function"==typeof T[h]?T[h].call(n,i,t,r):T[h],Zn(o)&&~o.indexOf("random(")&&(o=Lr(o)),vr(o+"")||(o+=Vn.units[h]||vr(Fs(t,h))||""),"="===(o+"").charAt(1)&&(o=Fs(t,h))):o=Fs(t,h),l=parseFloat(o),(f="string"===u&&"="===s.charAt(1)&&s.substr(0,2))&&(s=s.substr(2)),a=parseFloat(s),h in os&&("autoAlpha"===h&&(1===l&&"hidden"===Fs(t,"visibility")&&a&&(l=0),x.push("visibility",0,w.visibility),Ds(this,w,"visibility",l?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==h&&"transform"!==h&&~(h=os[h]).indexOf(",")&&(h=h.split(",")[0])),m=h in Qo)if(this.styles.save(h),g||((_=t._gsap).renderTransform&&!e.parseTransform||Gs(t,e.parseTransform),v=!1!==e.smoothOrigin&&_.smooth,(g=this._pt=new $o(this._pt,w,vs,0,1,_.renderTransform,_,0,-1)).dep=1),"scale"===h)this._pt=new $o(this._pt,_,"scaleY",l,(f?Ni(l,f+a):a)-l||0,ss),this._pt.u=0,b.push("scaleY",h),h+="X";else{if("transformOrigin"===h){x.push(ys,0,w[ys]),s=Vs(s),_.svg?Zs(t,s,0,v,0,this):((p=parseFloat(s.split(" ")[2])||0)!==_.zOrigin&&Ds(this,_,"zOrigin",_.zOrigin,p),Ds(this,w,h,Ks(o),Ks(s)));continue}if("svgOrigin"===h){Zs(t,s,1,v,0,this);continue}if(h in Hs){na(this,_,h,l,f?Ni(l,f+s):s);continue}if("smoothOrigin"===h){Ds(this,_,"smooth",_.smooth,s);continue}if("force3D"===h){_[h]=s;continue}if("transform"===h){ra(this,s,t);continue}}else h in w||(h=ks(h)||h);if(m||(a||0===a)&&(l||0===l)&&!rs.test(s)&&h in w)a||(a=0),(d=(o+"").substr((l+"").length))!==(p=vr(s)||(h in Vn.units?Vn.units[h]:d))&&(l=zs(t,h,o,p)),this._pt=new $o(this._pt,m?_:w,h,l,(f?Ni(l,f+a):a)-l,m||"px"!==p&&"zIndex"!==h||!1===e.autoRound?ss:us),this._pt.u=p||0,d!==p&&"%"!==p&&(this._pt.b=o,this._pt.r=ls);else if(h in w)Is.call(this,t,h,o,f?f+s:s);else{if(!(h in t)){mi(h,s);continue}this.add(t,h,o||t[h],f?f+s:s,i,r)}m||(h in w?x.push(h,0,w[h]):x.push(h,1,o||t[h])),b.push(h)}y&&Lo(this)},render:function(t,e){if(e.tween._time||!Go())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Fs,aliases:os,getSetter:function(t,e,n){var i=os[e];return i&&i.indexOf(",")<0&&(e=i),e in Qo&&e!==ys&&(t._gsap.x||Fs(t,"x"))?n&&Zo===n?"scale"===e?ms:fs:(Zo=n||{})&&("scale"===e?gs:_s):t.style&&!Qn(t.style[e])?ds:~e.indexOf("-")?ps:wo(t,e)},core:{_removeProperty:Ps,_getMatrix:qs}};Xo.utils.checkPrefix=ks,Xo.core.getStyleSaver=Ts,aa=Pi((oa="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(sa="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Qo[t]=1})),Pi(sa,(function(t){Vn.units[t]="deg",Hs[t]=1})),os[aa[13]]=oa+","+sa,Pi("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");os[e[1]]=aa[e[0]]})),Pi("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){Vn.units[t]="px"})),Xo.registerPlugin(la);var ua=Xo.registerPlugin(la)||Xo;ua.core.Tween;var ca=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,ha=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,da=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,pa=/(^[#\.][a-z]|[a-y][a-z])/i,fa=Math.PI/180,ma=180/Math.PI,ga=Math.sin,_a=Math.cos,va=Math.abs,ya=Math.sqrt,xa=Math.atan2,ba=function(t){return"string"==typeof t},wa=function(t){return"number"==typeof t},Ta={},Aa={},Ca=function(t){return Math.round((t+1e8)%1*1e5)/1e5||(t<0?0:1)},Ma=function(t){return Math.round(1e5*t)/1e5||0},ka=function(t){return Math.round(1e10*t)/1e10||0},Ea=function(t,e,n,i){var r=t[e],o=1===i?6:Ba(r,n,i);if(o&&o+n+2e){for(;--r&&t[r]>e;);r<0&&(r=0)}else for(;t[++r] element or an SVG path data string")}function Pa(t){var e,n=0;for(t.reverse();n-1;)n=r[o].nodeName.toLowerCase(),e.indexOf(","+n+",")<0&&i.setAttributeNS(null,n,r[o].nodeValue);return i}(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),T=function(t,e){for(var n=e?e.split(","):[],i={},r=n.length;--r>-1;)i[n[r]]=+t.getAttribute(n[r])||0;return i}(t,Da[A]),"rect"===A?(o=T.rx,s=T.ry||o,i=T.x,r=T.y,h=T.width-2*o,d=T.height-2*s,n=o||s?"M"+(_=(m=(f=i+o)+h)+o)+","+(y=r+s)+" V"+(x=y+d)+" C"+[_,b=x+s*C,g=m+o*C,w=x+s,m,w,m-(m-f)/3,w,f+(m-f)/3,w,f,w,p=i+o*(1-C),w,i,b,i,x,i,x-(x-y)/3,i,y+(x-y)/3,i,y,i,v=r+s*(1-C),p,r,f,r,f+(m-f)/3,r,m-(m-f)/3,r,m,r,g,r,_,v,_,y].join(",")+"z":"M"+(i+h)+","+r+" v"+d+" h"+-h+" v"+-d+" h"+h+"z"):"circle"===A||"ellipse"===A?("circle"===A?u=(o=s=T.r)*C:(o=T.rx,u=(s=T.ry)*C),n="M"+((i=T.cx)+o)+","+(r=T.cy)+" C"+[i+o,r+u,i+(l=o*C),r+s,i,r+s,i-l,r+s,i-o,r+u,i-o,r,i-o,r-u,i-l,r-s,i,r-s,i+l,r-s,i+o,r-u,i+o,r].join(",")+"z"):"line"===A?n="M"+T.x1+","+T.y1+" L"+T.x2+","+T.y2:"polyline"!==A&&"polygon"!==A||(n="M"+(i=(c=(t.getAttribute("points")+"").match(ha)||[]).shift())+","+(r=c.shift())+" L"+c.join(","),"polygon"===A&&(n+=","+i+","+r+"z")),a.setAttribute("d",qa(a._gsRawPath=Ha(n))),e&&t.parentNode&&(t.parentNode.insertBefore(a,t),t.parentNode.removeChild(t)),a):t}function Na(t,e,n){var i,r=t[e],o=t[e+2],s=t[e+4];return r+=(o-r)*n,r+=((o+=(s-o)*n)-r)*n,i=o+(s+(t[e+6]-s)*n-o)*n-r,r=t[e+1],r+=((o=t[e+3])-r)*n,r+=((o+=((s=t[e+5])-o)*n)-r)*n,Ma(xa(o+(s+(t[e+7]-s)*n-o)*n-r,i)*ma)}function za(t,e,n){n=void 0===n?1:ka(n)||0,e=ka(e)||0;var i=Math.max(0,~~(va(n-e)-1e-8)),r=function(t){for(var e=[],n=0;nn&&(e=1-e,n=1-n,function(t,e){var n=t.length;for(e||t.reverse();n--;)t[n].reversed||Pa(t[n])}(r),r.totalLength=0),e<0||n<0){var o=Math.abs(~~Math.min(e,n))+1;e+=o,n+=o}r.totalLength||Ia(r);var s,a,l,u,c,h,d,p,f=n>1,m=Va(r,e,Ta,!0),g=Va(r,n,Aa),_=g.segment,v=m.segment,y=g.segIndex,x=m.segIndex,b=g.i,w=m.i,T=x===y,A=b===w&&T;if(f||i){for(s=yy)&&r.splice(u,1);else _.angle=Na(_,b+l,0),m=_[b+=l],g=_[b+1],_.length=_.totalLength=0,_.totalPoints=r.totalPoints=8,_.push(m,g,m,g,m,g,m,g);return r.totalLength=0,r}function Fa(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var i,r,o,s,a,l,u,c,h,d,p,f,m,g,_,v,y,x=~~t.resolution||12,b=1/x,w=n?e+6*n+1:t.length,T=t[e],A=t[e+1],C=e?e/6*x:0,M=t.samples,k=t.lookup,E=(e?t.minLength:1e8)||1e8,S=M[C+n*x-1],L=e?M[C-1]:0;for(M.length=k.length=0,r=e+2;r8&&(t.splice(r,6),r-=6,w-=6);else for(i=1;i<=x;i++)l=u-(u=((g=b*i)*g*o+3*(m=1-g)*(g*s+m*a))*g),p=f-(f=(g*g*c+3*m*(g*h+m*d))*g),(v=ya(p*p+l*l))=1)return 0;var i=t[e],r=t[e+1],o=t[e+2],s=t[e+3],a=t[e+4],l=t[e+5],u=i+(o-i)*n,c=o+(a-o)*n,h=r+(s-r)*n,d=s+(l-s)*n,p=u+(c-u)*n,f=h+(d-h)*n,m=a+(t[e+6]-a)*n,g=l+(t[e+7]-l)*n;return c+=(m-c)*n,d+=(g-d)*n,t.splice(e+2,4,Ma(u),Ma(h),Ma(p),Ma(f),Ma(p+(c-p)*n),Ma(f+(d-f)*n),Ma(c),Ma(d),Ma(m),Ma(g)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}function Va(t,e,n,i){n=n||{},t.totalLength||Ia(t),(e<0||e>1)&&(e=Ca(e));var r,o,s,a,l,u,c,h=0,d=t[0];if(e)if(1===e)c=1,u=(d=t[h=t.length-1]).length-8;else{if(t.length>1){for(s=t.totalLength*e,l=u=0;(l+=t[u++].totalLength)1)&&(e=Ca(e)),t.length>1){for(s=t.totalLength*e,l=u=0;(l+=t[u++].totalLength)=1?1-1e-9:c||1e-9):p.angle||0),f}function Xa(t,e,n,i,r,o,s){for(var a,l,u,c,h,d=t.length;--d>-1;)for(l=(a=t[d]).length,u=0;u1&&(n=ya(x)*n,i=ya(x)*i);var b=n*n,w=i*i,T=(b*w-b*y-w*v)/(b*y+w*v);T<0&&(T=0);var A=(o===s?-1:1)*ya(T),C=A*(n*_/i),M=A*(-i*g/n),k=(t+a)/2+(c*C-h*M),E=(e+l)/2+(h*C+c*M),S=(g-C)/n,L=(_-M)/i,$=(-g-C)/n,O=(-_-M)/i,P=S*S+L*L,D=(L<0?-1:1)*Math.acos(S/ya(P)),R=(S*O-L*$<0?-1:1)*Math.acos((S*$+L*O)/ya(P*($*$+O*O)));isNaN(R)&&(R=d),!s&&R>0?R-=p:s&&R<0&&(R+=p),D%=p,R%=p;var N,z=Math.ceil(va(R)/(p/4)),F=[],I=R/z,B=4/3*ga(I/2)/(1+_a(I/2)),V=c*n,j=h*n,X=h*-i,Y=c*i;for(N=0;N-1e-4?0:e})).match(ca)||[],_=[],v=0,y=0,x=2/3,b=g.length,w=0,T="ERROR: malformed path: "+t,A=function(t,e,n,i){c=(n-t)/3,h=(i-e)/3,a.push(t+c,e+h,n-c,i-h,n,i)};if(!t||!isNaN(g[0])||isNaN(g[1]))return console.log(T),_;for(e=0;e.5||va(y-r)>.5)&&(A(v,y,i,r),"L"===o&&(e+=2)),v=i,y=r;else if("A"===o){if(f=g[e+4],m=g[e+5],c=g[e+6],h=g[e+7],n=7,f.length>1&&(f.length<3?(h=c,c=m,n--):(h=m,c=f.substr(2),n-=2),m=f.charAt(1),f=f.charAt(0)),d=Ya(v,y,+g[e+1],+g[e+2],+g[e+3],+f,+m,(s?v:0)+1*c,(s?y:0)+1*h),e+=n,d)for(n=0;n1?function(t){for(var e=new fl,n=0;n4&&(o=r.offsetLeft,s=r.offsetTop,r=0);if("absolute"!==(a=Ga.getComputedStyle(t)).position&&"fixed"!==a.position)for(i=t.offsetParent;h&&h!==i;)o+=h.scrollLeft||0,s+=h.scrollTop||0,h=h.parentNode;(r=n.style).top=t.offsetTop-s+"px",r.left=t.offsetLeft-o+"px",r[rl]=a[rl],r[ol]=a[ol],r.position="fixed"===a.position?"fixed":"absolute",t.parentNode.appendChild(n)}return n},pl=function(t,e,n,i,r,o,s){return t.a=e,t.b=n,t.c=i,t.d=r,t.e=o,t.f=s,t},fl=function(){function t(t,e,n,i,r,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===o&&(o=0),pl(this,t,e,n,i,r,o)}var e=t.prototype;return e.inverse=function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f,s=t*i-e*n||1e-10;return pl(this,i/s,-e/s,-n/s,t/s,(n*o-i*r)/s,-(t*o-e*r)/s)},e.multiply=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,o=this.e,s=this.f,a=t.a,l=t.c,u=t.b,c=t.d,h=t.e,d=t.f;return pl(this,a*e+u*i,a*n+u*r,l*e+c*i,l*n+c*r,o+h*e+d*i,s+h*n+d*r)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,o=this.e,s=this.f;return e===t.a&&n===t.b&&i===t.c&&r===t.d&&o===t.e&&s===t.f},e.apply=function(t,e){void 0===e&&(e={});var n=t.x,i=t.y,r=this.a,o=this.b,s=this.c,a=this.d,l=this.e,u=this.f;return e.x=n*r+i*s+l||0,e.y=n*o+i*a+u||0,e},t}();function ml(t,e,n,i){if(!t||!t.parentNode||(Za||sl(t)).documentElement===t)return new fl;var r=function(t){for(var e,n;t&&t!==Qa;)(n=t._gsap)&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e}(t),o=ul(t)?al:ll,s=dl(t,n),a=o[0].getBoundingClientRect(),l=o[1].getBoundingClientRect(),u=o[2].getBoundingClientRect(),c=s.parentNode,h=!i&&cl(t),d=new fl((l.left-a.left)/100,(l.top-a.top)/100,(u.left-a.left)/100,(u.top-a.top)/100,a.left+(h?0:Ga.pageXOffset||Za.scrollLeft||Ka.scrollLeft||Qa.scrollLeft||0),a.top+(h?0:Ga.pageYOffset||Za.scrollTop||Ka.scrollTop||Qa.scrollTop||0));if(c.removeChild(s),r)for(a=r.length;a--;)(l=r[a]).scaleX=l.scaleY=0,l.renderTransform(1,l);return e?d.inverse():d}
/*!
* MotionPathPlugin 3.11.3
* https://greensock.com
*
* @license Copyright 2008-2022, GreenSock. All rights reserved.
* Subject to the terms at https://greensock.com/standard-license or for
* Club GreenSock members, the agreement issued with that membership.
* @author: Jack Doyle, jack@greensock.com
*/var gl,_l,vl,yl,xl,bl,wl="x,translateX,left,marginLeft,xPercent".split(","),Tl="y,translateY,top,marginTop,yPercent".split(","),Al=Math.PI/180,Cl=function(t,e,n,i){for(var r=e.length,o=2===i?0:i,s=0;s1?t=1:t<0&&(t=0);i--;)ja(n[i],t,!i&&e.rotate,n[i]);for(;r;)r.set(r.t,r.p,r.path[r.pp]+r.u,r.d,t),r=r._next;e.rotate&&e.rSet(e.target,e.rProp,n[0].angle*(e.radians?Al:1)+e.rOffset+e.ru,e,t)}else e.styles.revert()},getLength:function(t){return Ia(Oa(t)).totalLength},sliceRawPath:za,getRawPath:Oa,pointsToSegment:Wa,stringToRawPath:Ha,rawPathToString:qa,transformRawPath:Xa,getGlobalMatrix:ml,getPositionOnPath:ja,cacheRawPathMeasurements:Ia,convertToPath:function(t,e){return yl(t).map((function(t){return Ra(t,!1!==e)}))},convertCoordinates:function(t,e,n){var i=ml(e,!0,!0).multiply(ml(t));return n?i.apply(n):i},getAlignMatrix:Ol,getRelativePosition:function(t,e,n,i){var r=Ol(t,e,n,i);return{x:r.e,y:r.f}},arrayToRawPath:function(t,e){var n=Cl(Cl([],t,(e=e||{}).x||"x",0),t,e.y||"y",1);return e.relative&&kl(n),["cubic"===e.type?n:Wa(n,e.curviness)]}};(gl||"undefined"!=typeof window&&(gl=window.gsap)&&gl.registerPlugin&&gl)&&gl.registerPlugin(Rl);var Nl,zl,Fl,Il,Bl,Vl,jl,Xl,Yl,Hl,Ul,Wl,ql,Zl,Gl,Kl,Ql,Jl,tu,eu,nu=0,iu=function(){return"undefined"!=typeof window},ru=function(){return Nl||iu()&&(Nl=window.gsap)&&Nl.registerPlugin&&Nl},ou=function(t){return"function"==typeof t},su=function(t){return"object"==typeof t},au=function(t){return void 0===t},lu=function(){return!1},uu="transform",cu="transformOrigin",hu=function(t){return Math.round(1e4*t)/1e4},du=Array.isArray,pu=function(t,e){var n=Fl.createElementNS?Fl.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Fl.createElement(t);return n.style?n:Fl.createElement(t)},fu=180/Math.PI,mu=1e20,gu=new fl,_u=Date.now||function(){return(new Date).getTime()},vu=[],yu={},xu=0,bu=/^(?:a|input|textarea|button|select)$/i,wu=0,Tu={},Au={},Cu=function(t,e){var n,i={};for(n in t)i[n]=e?t[n]*e:t[n];return i},Mu=function t(e,n){for(var i,r=e.length;r--;)n?e[r].style.touchAction=n:e[r].style.removeProperty("touch-action"),(i=e[r].children)&&i.length&&t(i,n)},ku=function(){return vu.forEach((function(t){return t()}))},Eu=function(){return!vu.length&&Nl.ticker.remove(ku)},Su=function(t){for(var e=vu.length;e--;)vu[e]===t&&vu.splice(e,1);Nl.to(Eu,{overwrite:!0,delay:15,duration:0,onComplete:Eu,data:"_draggable"})},Lu=function(t,e,n,i){if(t.addEventListener){var r=ql[e];i=i||(Ul?{passive:!1}:null),t.addEventListener(r||e,n,i),r&&e!==r&&t.addEventListener(e,n,i)}},$u=function(t,e,n){if(t.removeEventListener){var i=ql[e];t.removeEventListener(i||e,n),i&&e!==i&&t.removeEventListener(e,n)}},Ou=function(t){t.preventDefault&&t.preventDefault(),t.preventManipulation&&t.preventManipulation()},Pu=function t(e){Zl=e.touches&&nu2||r<-2)&&!i)return f=t.scrollLeft,Nl.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-f),void(e.onKill&&e.onKill());(n=-n)<0?(d=n-.5|0,n=0):n>v?(d=n-v|0,n=v):d=0,(d||o)&&(this._skip||(u[uu]=s+-d+"px,"+-h+a),d+_>=0&&(u.paddingRight=d+_+"px")),t.scrollLeft=0|n,f=t.scrollLeft},this.top=function(n,i){if(!arguments.length)return-(t.scrollTop+h);var r=t.scrollTop-p,o=h;if((r>2||r<-2)&&!i)return p=t.scrollTop,Nl.killTweensOf(this,{top:1,scrollTop:1}),this.top(-p),void(e.onKill&&e.onKill());(n=-n)<0?(h=n-.5|0,n=0):n>y?(h=n-y|0,n=y):h=0,(h||o)&&(this._skip||(u[uu]=s+-d+"px,"+-h+a)),t.scrollTop=0|n,p=t.scrollTop},this.maxScrollTop=function(){return y},this.maxScrollLeft=function(){return v},this.disable=function(){for(c=l.firstChild;c;)o=c.nextSibling,t.appendChild(c),c=o;t===l.parentNode&&t.removeChild(l)},this.enable=function(){if((c=t.firstChild)!==l){for(;c;)o=c.nextSibling,l.appendChild(c),c=o;t.appendChild(l),this.calibrate()}},this.calibrate=function(e){var o,s,a,c=t.clientWidth===n;p=t.scrollTop,f=t.scrollLeft,c&&t.clientHeight===i&&l.offsetHeight===r&&m===t.scrollWidth&&g===t.scrollHeight&&!e||((h||d)&&(s=this.left(),a=this.top(),this.left(-t.scrollLeft),this.top(-t.scrollTop)),o=Xu(t),c&&!e||(u.display="block",u.width="auto",u.paddingRight="0px",(_=Math.max(0,t.scrollWidth-t.clientWidth))&&(_+=parseFloat(o.paddingLeft)+(eu?parseFloat(o.paddingRight):0))),u.display="inline-block",u.position="relative",u.overflow="visible",u.verticalAlign="top",u.boxSizing="content-box",u.width="100%",u.paddingRight=_+"px",eu&&(u.paddingBottom=o.paddingBottom),n=t.clientWidth,i=t.clientHeight,m=t.scrollWidth,g=t.scrollHeight,v=t.scrollWidth-n,y=t.scrollHeight-i,r=l.offsetHeight,u.display="block",(s||a)&&(this.left(s),this.top(a)))},this.content=l,this.element=t,this._skip=!1,this.enable()},ec=function(t){if(iu()&&document.body){var e=window&&window.navigator;zl=window,Fl=document,Il=Fl.documentElement,Bl=Fl.body,Vl=pu("div"),Jl=!!window.PointerEvent,(jl=pu("div")).style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",Ql="grab"===jl.style.cursor?"grab":"move",Gl=e&&-1!==e.userAgent.toLowerCase().indexOf("android"),Wl="ontouchstart"in Il&&"orientation"in zl||e&&(e.MaxTouchPoints>0||e.msMaxTouchPoints>0),i=pu("div"),r=pu("div"),o=r.style,s=Bl,o.display="inline-block",o.position="relative",i.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",i.appendChild(r),s.appendChild(i),n=r.offsetHeight+18>i.scrollHeight,s.removeChild(i),eu=n,ql=function(t){for(var e=t.split(","),n=(("onpointerdown"in Vl?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in Vl?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":t).split(",")),i={},r=4;--r>-1;)i[e[r]]=n[r],i[n[r]]=e[r];try{Il.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){Ul=1}}))}catch(t){}return i}("touchstart,touchmove,touchend,touchcancel"),Lu(Fl,"touchcancel",lu),Lu(zl,"touchmove",lu),Bl&&Bl.addEventListener("touchstart",lu),Lu(Fl,"contextmenu",(function(){for(var t in yu)yu[t].isPressed&&yu[t].endDrag()})),Nl=Xl=ru()}var n,i,r,o,s;Nl?(Kl=Nl.plugins.inertia,Yl=Nl.utils.checkPrefix,uu=Yl(uu),cu=Yl(cu),Hl=Nl.utils.toArray,tu=!!Yl("perspective")):t&&console.warn("Please gsap.registerPlugin(Draggable)")},nc=function(){function t(t){this._listeners={},this.target=t||this}var e=t.prototype;return e.addEventListener=function(t,e){var n=this._listeners[t]||(this._listeners[t]=[]);~n.indexOf(e)||n.push(e)},e.removeEventListener=function(t,e){var n=this._listeners[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},e.dispatchEvent=function(t){var e,n=this;return(this._listeners[t]||[]).forEach((function(i){return!1===i.call(n,{type:t,target:n.target})&&(e=!1)})),e},t}(),ic=function(t){var e,n;function i(e,n){var r;r=t.call(this)||this,Xl||ec(1),e=Hl(e)[0],Kl||(Kl=Nl.plugins.inertia),r.vars=n=Cu(n||{}),r.target=e,r.x=r.y=r.rotation=0,r.dragResistance=parseFloat(n.dragResistance)||0,r.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,r.lockAxis=n.lockAxis,r.autoScroll=n.autoScroll||0,r.lockedAxis=null,r.allowEventDefault=!!n.allowEventDefault,Nl.getProperty(e,"x");var o,s,a,l,u,c,h,d,p,f,m,g,_,v,y,x,b,w,T,A,C,M,k,E,S,L,$,O,P,D,R,N,z,F=(n.type||"x,y").toLowerCase(),I=~F.indexOf("x")||~F.indexOf("y"),B=-1!==F.indexOf("rotation"),V=B?"rotation":I?"x":"left",j=I?"y":"top",X=!(!~F.indexOf("x")&&!~F.indexOf("left")&&"scroll"!==F),Y=!(!~F.indexOf("y")&&!~F.indexOf("top")&&"scroll"!==F),H=n.minimumMovement||2,U=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(r),W=Hl(n.trigger||n.handle||e),q={},Z=0,G=!1,K=n.autoScrollMarginTop||40,Q=n.autoScrollMarginRight||40,J=n.autoScrollMarginBottom||40,tt=n.autoScrollMarginLeft||40,et=n.clickableTest||Ku,nt=0,it=e._gsap||Nl.core.getCache(e),rt=Ju(e),ot=function(t,n){return parseFloat(it.get(e,t,n))},st=e.ownerDocument||Fl,at=function(t){return Ou(t),t.stopImmediatePropagation&&t.stopImmediatePropagation(),!1},lt=function t(n){if(U.autoScroll&&U.isDragging&&(G||b)){var i,r,o,a,l,u,c,h,p=e,f=15*U.autoScroll;for(G=!1,Au.scrollTop=null!=zl.pageYOffset?zl.pageYOffset:null!=st.documentElement.scrollTop?st.documentElement.scrollTop:st.body.scrollTop,Au.scrollLeft=null!=zl.pageXOffset?zl.pageXOffset:null!=st.documentElement.scrollLeft?st.documentElement.scrollLeft:st.body.scrollLeft,a=U.pointerX-Au.scrollLeft,l=U.pointerY-Au.scrollTop;p&&!r;)i=(r=Iu(p.parentNode))?Au:p.parentNode,o=r?{bottom:Math.max(Il.clientHeight,zl.innerHeight||0),right:Math.max(Il.clientWidth,zl.innerWidth||0),left:0,top:0}:i.getBoundingClientRect(),u=c=0,Y&&((h=i._gsMaxScrollY-i.scrollTop)<0?c=h:l>o.bottom-J&&h?(G=!0,c=Math.min(h,f*(1-Math.max(0,o.bottom-l)/J)|0)):lo.right-Q&&h?(G=!0,u=Math.min(h,f*(1-Math.max(0,o.right-a)/Q)|0)):an?n+(r-n)*o:r-1;)(o=(r=t[s])-i)<0&&(o=-o),o=e&&r<=n&&(a=s,l=o);return t[a]}:isNaN(t)?function(t){return t}:function(){return t*i}},ht=function(){var t,i,r,o;h=!1,s?(s.calibrate(),U.minX=m=-s.maxScrollLeft(),U.minY=_=-s.maxScrollTop(),U.maxX=f=U.maxY=g=0,h=!0):n.bounds&&(t=Wu(n.bounds,e.parentNode),B?(U.minX=m=t.left,U.maxX=f=t.left+t.width,U.minY=_=U.maxY=g=0):au(n.bounds.maxX)&&au(n.bounds.maxY)?(i=Wu(e,e.parentNode),U.minX=m=Math.round(ot(V,"px")+t.left-i.left),U.minY=_=Math.round(ot(j,"px")+t.top-i.top),U.maxX=f=Math.round(m+(t.width-i.width)),U.maxY=g=Math.round(_+(t.height-i.height))):(t=n.bounds,U.minX=m=t.minX,U.minY=_=t.minY,U.maxX=f=t.maxX,U.maxY=g=t.maxY),m>f&&(U.minX=f,U.maxX=f=m,m=U.minX),_>g&&(U.minY=g,U.maxY=g=_,_=U.minY),B&&(U.minRotation=m,U.maxRotation=f),h=!0),n.liveSnap&&(r=!0===n.liveSnap?n.snap||{}:n.liveSnap,o=du(r)||ou(r),B?(T=ct(o?r:r.rotation,m,f,1),A=null):r.points?C=function(t,e,n,i,r,o,s){return o=o&&on?n+(d-n)*h:dr?r+(p-r)*h:po&&(a.x=d,a.y=p),a}:du(t)?function(e){for(var n,i,r,s,a=t.length,l=0,u=mu;--a>-1;)(s=(n=(r=t[a]).x-e.x)*n+(i=r.y-e.y)*i)1e3?0:.5:n.minDuration,overshoot:l}),U.tween=a=Nl.to(s||e,{inertia:t,data:"_draggable",onComplete:dt,onInterrupt:pt,onUpdate:n.fastMode?Uu:ut,onUpdateParams:n.fastMode?[U,"onthrowupdate","onThrowUpdate"]:r&&r.radius?[!1,!0]:[]}),n.fastMode||(s&&(s._skip=!0),a.render(1e9,!0,!0),ut(!0,!0),U.endX=U.x,U.endY=U.y,B&&(U.endRotation=U.x),a.play(0),ut(!0,!0),s&&(s._skip=!1))):h&&U.applyBounds()},mt=function(t){var n,i=E;E=ml(e.parentNode,!0),t&&U.isPressed&&!E.equals(i||new fl)&&(n=i.inverse().apply({x:a,y:l}),E.apply(n,n),a=n.x,l=n.y),E.equals(gu)&&(E=null)},gt=function(){var t,n,i,r=1-U.edgeResistance,o=rt?Nu(st):0,d=rt?Ru(st):0;I&&(it.x=ot(V,"px")+"px",it.y=ot(j,"px")+"px",it.renderTransform()),mt(!1),qu.x=U.pointerX-o,qu.y=U.pointerY-d,E&&E.apply(qu,qu),a=qu.x,l=qu.y,b&&(bt(U.pointerX,U.pointerY),lt(!0)),N=ml(e),s?(ht(),c=s.top(),u=s.left()):(_t()?(ut(!0,!0),ht()):U.applyBounds(),B?(t=e.ownerSVGElement?[it.xOrigin-e.getBBox().x,it.yOrigin-e.getBBox().y]:(Xu(e)[cu]||"0 0").split(" "),x=U.rotationOrigin=ml(e).apply({x:parseFloat(t[0])||0,y:parseFloat(t[1])||0}),ut(!0,!0),n=U.pointerX-x.x-o,i=x.y-U.pointerY+d,u=U.x,c=U.y=Math.atan2(i,n)*fu):(c=ot(j,"px"),u=ot(V,"px"))),h&&r&&(u>f?u=f+(u-f)/r:ug?c=g+(c-g)/r:c<_&&(c=_-(_-c)/r))),U.startX=u=hu(u),U.startY=c=hu(c)},_t=function(){return U.tween&&U.tween.isActive()},vt=function(){!jl.parentNode||_t()||U.isDragging||jl.parentNode.removeChild(jl)},yt=function(t,r){var u;if(!o||U.isPressed||!t||!("mousedown"!==t.type&&"pointerdown"!==t.type||r)&&_u()-nt<30&&ql[U.pointerEvent.type])R&&t&&o&&Ou(t);else{if(S=_t(),z=!1,U.pointerEvent=t,ql[t.type]?(k=~t.type.indexOf("touch")?t.currentTarget||t.target:st,Lu(k,"touchend",wt),Lu(k,"touchmove",xt),Lu(k,"touchcancel",wt),Lu(st,"touchstart",Du)):(k=null,Lu(st,"mousemove",xt)),$=null,Jl&&k||(Lu(st,"mouseup",wt),t&&t.target&&Lu(t.target,"mouseup",wt)),M=et.call(U,t.target)&&!1===n.dragClickables&&!r)return Lu(t.target,"change",wt),Uu(U,"pressInit","onPressInit"),Uu(U,"press","onPress"),Qu(W,!0),void(R=!1);var c;if(L=!(!k||X===Y||!1===U.vars.allowNativeTouchScrolling||U.vars.allowContextMenu&&t&&(t.ctrlKey||t.which>2))&&(X?"y":"x"),(R=!L&&!U.allowEventDefault)&&(Ou(t),Lu(zl,"touchforcechange",Ou)),t.changedTouches?(t=v=t.changedTouches[0],y=t.identifier):t.pointerId?y=t.pointerId:v=y=null,nu++,c=lt,vu.push(c),1===vu.length&&Nl.ticker.add(ku),l=U.pointerY=t.pageY,a=U.pointerX=t.pageX,Uu(U,"pressInit","onPressInit"),(L||U.autoScroll)&&Vu(e.parentNode),!e.parentNode||!U.autoScroll||s||B||!e.parentNode._gsMaxScrollX||jl.parentNode||e.getBBox||(jl.style.width=e.parentNode.scrollWidth+"px",e.parentNode.appendChild(jl)),gt(),U.tween&&U.tween.kill(),U.isThrowing=!1,Nl.killTweensOf(s||e,q,!0),s&&Nl.killTweensOf(e,{scrollTo:1},!0),U.tween=U.lockedAxis=null,(n.zIndexBoost||!B&&!s&&!1!==n.zIndexBoost)&&(e.style.zIndex=i.zIndex++),U.isPressed=!0,d=!(!n.onDrag&&!U._listeners.drag),p=!(!n.onMove&&!U._listeners.move),!1!==n.cursor||n.activeCursor)for(u=W.length;--u>-1;)Nl.set(W[u],{cursor:n.activeCursor||n.cursor||("grab"===Ql?"grabbing":Ql)});Uu(U,"press","onPress")}},xt=function(t){var n,i,r,s,u,c,h=t;if(o&&!Zl&&U.isPressed&&t){if(U.pointerEvent=t,n=t.changedTouches){if((t=n[0])!==v&&t.identifier!==y){for(s=n.length;--s>-1&&(t=n[s]).identifier!==y&&t.target!==e;);if(s<0)return}}else if(t.pointerId&&y&&t.pointerId!==y)return;k&&L&&!$&&(qu.x=t.pageX-(rt?Nu(st):0),qu.y=t.pageY-(rt?Ru(st):0),E&&E.apply(qu,qu),i=qu.x,r=qu.y,((u=Math.abs(i-a))!==(c=Math.abs(r-l))&&(u>H||c>H)||Gl&&L===$)&&($=u>c&&X?"x":"y",L&&$!==L&&Lu(zl,"touchforcechange",Ou),!1!==U.vars.lockAxisOnTouchScroll&&X&&Y&&(U.lockedAxis="x"===$?"y":"x",ou(U.vars.onLockAxis)&&U.vars.onLockAxis.call(U,h)),Gl&&L===$))?wt(h):(U.allowEventDefault||L&&(!$||L===$)||!1===h.cancelable?R&&(R=!1):(Ou(h),R=!0),U.autoScroll&&(G=!0),bt(t.pageX,t.pageY,p))}else R&&t&&o&&Ou(t)},bt=function(t,e,n){var i,r,o,s,d,p,v=1-U.dragResistance,y=1-U.edgeResistance,w=U.pointerX,M=U.pointerY,k=c,S=U.x,L=U.y,$=U.endX,O=U.endY,P=U.endRotation,D=b;U.pointerX=t,U.pointerY=e,rt&&(t-=Nu(st),e-=Ru(st)),B?(s=Math.atan2(x.y-e,t-x.x)*fu,(d=U.y-s)>180?(c-=360,U.y=s):d<-180&&(c+=360,U.y=s),U.x!==u||Math.abs(c-s)>H?(U.y=s,o=u+(c-s)*v):o=u):(E&&(p=t*E.a+e*E.c+E.e,e=t*E.b+e*E.d+E.f,t=p),(r=e-l)-H&&(r=0),(i=t-a)-H&&(i=0),(U.lockAxis||U.lockedAxis)&&(i||r)&&((p=U.lockedAxis)||(U.lockedAxis=p=X&&Math.abs(i)>Math.abs(r)?"y":Y?"x":null,p&&ou(U.vars.onLockAxis)&&U.vars.onLockAxis.call(U,U.pointerEvent)),"y"===p?r=0:"x"===p&&(i=0)),o=hu(u+i*v),s=hu(c+r*v)),(T||A||C)&&(U.x!==o||U.y!==s&&!B)&&(C&&(Tu.x=o,Tu.y=s,p=C(Tu),o=hu(p.x),s=hu(p.y)),T&&(o=hu(T(o))),A&&(s=hu(A(s)))),h&&(o>f?o=f+Math.round((o-f)*y):og?s=Math.round(g+(s-g)*y):s<_&&(s=Math.round(_+(s-_)*y)))),(U.x!==o||U.y!==s&&!B)&&(B?(U.endRotation=U.x=U.endX=o,b=!0):(Y&&(U.y=U.endY=s,b=!0),X&&(U.x=U.endX=o,b=!0)),n&&!1===Uu(U,"move","onMove")?(U.pointerX=w,U.pointerY=M,c=k,U.x=S,U.y=L,U.endX=$,U.endY=O,U.endRotation=P,b=D):!U.isDragging&&U.isPressed&&(U.isDragging=z=!0,Uu(U,"dragstart","onDragStart")))},wt=function t(i,r){if(o&&U.isPressed&&(!i||null==y||r||!(i.pointerId&&i.pointerId!==y&&i.target!==e||i.changedTouches&&!function(t,e){for(var n=t.length;n--;)if(t[n].identifier===e)return!0}(i.changedTouches,y)))){U.isPressed=!1;var s,a,l,u,c,h=i,d=U.isDragging,p=U.vars.allowContextMenu&&i&&(i.ctrlKey||i.which>2),f=Nl.delayedCall(.001,vt);if(k?($u(k,"touchend",t),$u(k,"touchmove",xt),$u(k,"touchcancel",t),$u(st,"touchstart",Du)):$u(st,"mousemove",xt),$u(zl,"touchforcechange",Ou),Jl&&k||($u(st,"mouseup",t),i&&i.target&&$u(i.target,"mouseup",t)),b=!1,d&&(Z=wu=_u(),U.isDragging=!1),Su(lt),M&&!p)return i&&($u(i.target,"change",t),U.pointerEvent=h),Qu(W,!1),Uu(U,"release","onRelease"),Uu(U,"click","onClick"),void(M=!1);for(a=W.length;--a>-1;)ju(W[a],"cursor",n.cursor||(!1!==n.cursor?Ql:null));if(nu--,i){if((s=i.changedTouches)&&(i=s[0])!==v&&i.identifier!==y){for(a=s.length;--a>-1&&(i=s[a]).identifier!==y&&i.target!==e;);if(a<0&&!r)return}U.pointerEvent=h,U.pointerX=i.pageX,U.pointerY=i.pageY}return p&&h?(Ou(h),R=!0,Uu(U,"release","onRelease")):h&&!d?(R=!1,S&&(n.snap||n.bounds)&&ft(n.inertia||n.throwProps),Uu(U,"release","onRelease"),Gl&&"touchmove"===h.type||-1!==h.type.indexOf("cancel")||(Uu(U,"click","onClick"),_u()-nt<300&&Uu(U,"doubleclick","onDoubleClick"),u=h.target||e,nt=_u(),c=function(){nt===P||!U.enabled()||U.isPressed||h.defaultPrevented||(u.click?u.click():st.createEvent&&((l=st.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,zl,1,U.pointerEvent.screenX,U.pointerEvent.screenY,U.pointerX,U.pointerY,!1,!1,!1,!1,0,null),u.dispatchEvent(l)))},Gl||h.defaultPrevented||Nl.delayedCall(.05,c))):(ft(n.inertia||n.throwProps),U.allowEventDefault||!h||!1===n.dragClickables&&et.call(U,h.target)||!d||L&&(!$||L!==$)||!1===h.cancelable?R=!1:(R=!0,Ou(h)),Uu(U,"release","onRelease")),_t()&&f.duration(U.tween.duration()),d&&Uu(U,"dragend","onDragEnd"),!0}R&&i&&o&&Ou(i)},Tt=function(t){if(t&&U.isDragging&&!s){var n=t.target||e.parentNode,i=n.scrollLeft-n._gsScrollX,r=n.scrollTop-n._gsScrollY;(i||r)&&(E?(a-=i*E.a+r*E.c,l-=r*E.d+i*E.b):(a-=i,l-=r),n._gsScrollX+=i,n._gsScrollY+=r,bt(U.pointerX,U.pointerY))}},At=function(t){var e=_u(),n=e-nt<100,i=e-Z<50,r=n&&P===nt,o=U.pointerEvent&&U.pointerEvent.defaultPrevented,s=n&&D===nt,a=t.isTrusted||null==t.isTrusted&&n&&r;if((r||i&&!1!==U.vars.suppressClickOnDrag)&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),n&&(!U.pointerEvent||!U.pointerEvent.defaultPrevented)&&(!r||a&&!s))return a&&r&&(D=nt),void(P=nt);(U.isPressed||i||n)&&(a&&t.detail&&n&&!o||Ou(t)),n||i||z||(t&&t.target&&(U.pointerEvent=t),Uu(U,"click","onClick"))},Ct=function(t){return E?{x:t.x*E.a+t.y*E.c+E.e,y:t.x*E.b+t.y*E.d+E.f}:{x:t.x,y:t.y}};return(w=i.get(e))&&w.kill(),r.startDrag=function(t,n){var i,r,o,s;yt(t||U.pointerEvent,!0),n&&!U.hitTest(t||U.pointerEvent)&&(i=Hu(t||U.pointerEvent),r=Hu(e),o=Ct({x:i.left+i.width/2,y:i.top+i.height/2}),s=Ct({x:r.left+r.width/2,y:r.top+r.height/2}),a-=o.x-s.x,l-=o.y-s.y),U.isDragging||(U.isDragging=z=!0,Uu(U,"dragstart","onDragStart"))},r.drag=xt,r.endDrag=function(t){return wt(t||U.pointerEvent,!0)},r.timeSinceDrag=function(){return U.isDragging?0:(_u()-Z)/1e3},r.timeSinceClick=function(){return(_u()-nt)/1e3},r.hitTest=function(t,e){return i.hitTest(U.target,t,e)},r.getDirection=function(t,n){var i,r,o,s,a,l,h="velocity"===t&&Kl?t:su(t)&&!B?"element":"start";return"element"===h&&(a=Hu(U.target),l=Hu(t)),i="start"===h?U.x-u:"velocity"===h?Kl.getVelocity(e,V):a.left+a.width/2-(l.left+l.width/2),B?i<0?"counter-clockwise":"clockwise":(n=n||2,r="start"===h?U.y-c:"velocity"===h?Kl.getVelocity(e,j):a.top+a.height/2-(l.top+l.height/2),s=(o=Math.abs(i/r))<1/n?"":i<0?"left":"right",of?r=f:rg?o=g:o<_&&(o=_),(U.x!==r||U.y!==o)&&(s=!0,U.x=U.endX=r,B?U.endRotation=r:U.y=U.endY=o,b=!0,lt(!0),U.autoScroll&&!U.isDragging))for(Vu(e.parentNode),a=e,Au.scrollTop=null!=zl.pageYOffset?zl.pageYOffset:null!=st.documentElement.scrollTop?st.documentElement.scrollTop:st.body.scrollTop,Au.scrollLeft=null!=zl.pageXOffset?zl.pageXOffset:null!=st.documentElement.scrollLeft?st.documentElement.scrollLeft:st.body.scrollLeft;a&&!u;)l=(u=Iu(a.parentNode))?Au:a.parentNode,Y&&l.scrollTop>l._gsMaxScrollY&&(l.scrollTop=l._gsMaxScrollY),X&&l.scrollLeft>l._gsMaxScrollX&&(l.scrollLeft=l._gsMaxScrollX),a=l;U.isThrowing&&(s||U.endX>f||U.endXg||U.endY<_)&&ft(n.inertia||n.throwProps,s)}return U},r.update=function(t,n,i){if(n&&U.isPressed){var r=ml(e),o=N.apply({x:U.x-u,y:U.y-c}),s=ml(e.parentNode,!0);s.apply({x:r.e-o.x,y:r.f-o.y},o),U.x-=o.x-s.e,U.y-=o.y-s.f,lt(!0),gt()}var a=U.x,l=U.y;return mt(!n),t?U.applyBounds():(b&&i&<(!0),ut(!0)),n&&(bt(U.pointerX,U.pointerY),b&<(!0)),U.isPressed&&!n&&(X&&Math.abs(a-U.x)>.01||Y&&Math.abs(l-U.y)>.01&&!B)&>(),U.autoScroll&&(Vu(e.parentNode,U.isDragging),G=U.isDragging,lt(!0),Fu(e,Tt),zu(e,Tt)),U},r.enable=function(t){var i,r,a,l={lazy:!0};if(!1!==n.cursor&&(l.cursor=n.cursor||Ql),Nl.utils.checkPrefix("touchCallout")&&(l.touchCallout="none"),"soft"!==t){for(Mu(W,X===Y?"none":n.allowNativeTouchScrolling&&e.scrollHeight===e.clientHeight==(e.scrollWidth===e.clientHeight)||n.allowEventDefault?"manipulation":X?"pan-y":"pan-x"),r=W.length;--r>-1;)a=W[r],Jl||Lu(a,"mousedown",yt),Lu(a,"touchstart",yt),Lu(a,"click",At,!0),Nl.set(a,l),a.getBBox&&a.ownerSVGElement&&X!==Y&&Nl.set(a.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":X?"pan-y":"pan-x"}),n.allowContextMenu||Lu(a,"contextmenu",at);Qu(W,!1)}return zu(e,Tt),o=!0,Kl&&"soft"!==t&&Kl.track(s||e,I?"x,y":B?"rotation":"top,left"),e._gsDragID=i="d"+xu++,yu[i]=U,s&&(s.enable(),s.element._gsDragID=i),(n.bounds||B)&>(),n.bounds&&U.applyBounds(),U},r.disable=function(t){for(var n,i=U.isDragging,r=W.length;--r>-1;)ju(W[r],"cursor",null);if("soft"!==t){for(Mu(W,null),r=W.length;--r>-1;)n=W[r],ju(n,"touchCallout",null),$u(n,"mousedown",yt),$u(n,"touchstart",yt),$u(n,"click",At),$u(n,"contextmenu",at);Qu(W,!0),k&&($u(k,"touchcancel",wt),$u(k,"touchend",wt),$u(k,"touchmove",xt)),$u(st,"mouseup",wt),$u(st,"mousemove",xt)}return Fu(e,Tt),o=!1,Kl&&"soft"!==t&&Kl.untrack(s||e,I?"x,y":B?"rotation":"top,left"),s&&s.disable(),Su(lt),U.isDragging=U.isPressed=M=!1,i&&Uu(U,"dragend","onDragEnd"),U},r.enabled=function(t,e){return arguments.length?t?U.enable(e):U.disable(e):o},r.kill=function(){return U.isThrowing=!1,U.tween&&U.tween.kill(),U.disable(),Nl.set(W,{clearProps:"userSelect"}),delete yu[e._gsDragID],U},~F.indexOf("scroll")&&(s=r.scrollProxy=new tc(e,function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t}({onKill:function(){U.isPressed&&wt(null)}},n)),e.style.overflowY=Y&&!Wl?"auto":"hidden",e.style.overflowX=X&&!Wl?"auto":"hidden",e=s.content),B?q.rotation=1:(X&&(q[V]=1),Y&&(q[j]=1)),it.force3D=!("force3D"in n)||n.force3D,r.enable(),r}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i.register=function(t){Nl=t,ec()},i.create=function(t,e){return Xl||ec(!0),Hl(t).map((function(t){return new i(t,e)}))},i.get=function(t){return yu[(Hl(t)[0]||{})._gsDragID]},i.timeSinceDrag=function(){return(_u()-wu)/1e3},i.hitTest=function(t,e,n){if(t===e)return!1;var i,r,o,s=Hu(t),a=Hu(e),l=s.top,u=s.left,c=s.right,h=s.bottom,d=s.width,p=s.height,f=a.left>c||a.righth||a.bottom=d*p*n||r>=a.width*a.height*n):i.width>n&&i.height>n))},i}(nc);!function(t,e){for(var n in e)n in t||(t[n]=e[n])}(ic.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1}),ic.zIndex=1e3,ic.version="3.11.3",ru()&&Nl.registerPlugin(ic),ua.registerPlugin(Rl),ua.registerPlugin(ic);const rc={auto:"M18,11V12.5C21.19,12.5 23.09,16.05 21.33,18.71L20.24,17.62C21.06,15.96 19.85,14 18,14V15.5L15.75,13.25L18,11M18,22V20.5C14.81,20.5 12.91,16.95 14.67,14.29L15.76,15.38C14.94,17.04 16.15,19 18,19V17.5L20.25,19.75L18,22M19,3H18V1H16V3H8V1H6V3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H14C13.36,20.45 12.86,19.77 12.5,19H5V8H19V10.59C19.71,10.7 20.39,10.94 21,11.31V5A2,2 0 0,0 19,3Z",heat_cool:"M12,6V9L16,5L12,1V4A8,8 0 0,0 4,12C4,13.57 4.46,15.03 5.24,16.26L6.7,14.8C6.25,13.97 6,13 6,12A6,6 0 0,1 12,6M18.76,7.74L17.3,9.2C17.74,10.04 18,11 18,12A6,6 0 0,1 12,18V15L8,19L12,23V20A8,8 0 0,0 20,12C20,10.43 19.54,8.97 18.76,7.74Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",dry:ft,window_open:mt,eco:"M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z",summer:pt,temperature:"M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",humidity:ft};function oc(t){const e=window;e.customCards=e.customCards||[],e.customCards.push(Object.assign(Object.assign({},t),{preview:!0}))}console.info("%c BetterThermostatUI-CARD \n%c version: 1.0.3 ","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),oc({type:"better-thermostat-ui-card",name:"Better Thermostat Climate Card",description:"Card for climate entity"});let sc=class extends nt{constructor(){super(),this.value=0,this.current=0,this.humidity=0,this.min=0,this.max=35,this.step=1,this.window=!1,this.summer=!1,this.status="loading",this.mode="off",this.dragging=!1,this._init=!0,this._firstRender=!0,this._ignore=!1,this._hasWindow=!1,this._hasSummer=!1,this._oldValueMin=0,this._oldValueMax=0,this._display_bottom=0,this._display_top=0,this.modes=[],this.render=()=>{var t,e,n,i,r,o,s,a,l,u,c,h,d,p,f,m,g,_,v;return N`
${null===(t=this._config)||void 0===t?void 0:t.name}
${(null==this?void 0:this._hasSummer)?z`
${(null===(h=null==this?void 0:this._config)||void 0===h?void 0:h.disable_heat)?N``:this._renderIcon("heat",this.mode)}
${(null===(d=null==this?void 0:this._config)||void 0===d?void 0:d.disable_eco)?N``:(null===(f=null===(p=null==this?void 0:this.stateObj)||void 0===p?void 0:p.attributes)||void 0===f?void 0:f.saved_temperature)&&"none"!==(null===(g=null===(m=null==this?void 0:this.stateObj)||void 0===m?void 0:m.attributes)||void 0===g?void 0:g.saved_temperature)&&"unavailable"!==(null===(_=null==this?void 0:this.stateObj)||void 0===_?void 0:_.state)?this._renderIcon("eco","eco"):this._renderIcon("eco","none")}
${(null===(v=null==this?void 0:this._config)||void 0===v?void 0:v.disable_off)?N``:this._renderIcon("off",this.mode)}
`:z`
${this.modes.map((t=>{var e,n,i;return(null===(e=this._config)||void 0===e?void 0:e.disable_heat)&&"heat"===t||(null===(n=this._config)||void 0===n?void 0:n.disable_eco)&&"eco"===t||(null===(i=this._config)||void 0===i?void 0:i.disable_off)&&"off"===t?N``:this._renderIcon(t,this.mode)}))}
`}
`}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}static async getConfigElement(){return await Promise.resolve().then((function(){return pc})),document.createElement("better-thermostat-ui-card-editor")}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>["climate"].includes(t.split(".")[0]))),n=e.filter((e=>{var n;return null===(n=t.states[e].attributes)||void 0===n?void 0:n.call_for_heat}));return{type:"custom:better-thermostat-ui-card",entity:n[0]||e[0]}}setConfig(t){this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}getCardSize(){return 1}_percent2bar(t){return 176-1.76*t}_value2percent(t){return(t-this.min)/(this.max-this.min)*100}_percent2value(t){return t/100*(this.max-this.min)+this.min}_updateValue(t){const e=Math.round(t/this.step)*this.step;this.value!==e&&(this.value=e,this._updateDisplay(),this._vibrate(2))}_updateDragger(t){this.dragging=t}_liveSnapPont(t,e){var n;const i=180/Math.PI,r=null===(n=null==t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("#shadowpath"),o=(null==r?void 0:r.getTotalLength())||0;return function(e){const n=function(t,e,n){let r,o,s=8,a=1/0;for(var l,u,c=0;c<=e;c+=s)(u=f(l=t.getPointAtLength(c))).5;){let n,i,l,u,c,h;(l=o-s)>=0&&(c=f(n=t.getPointAtLength(l))){clearTimeout(u._timeout),0===u._oldValueMin&&(u._oldValueMin=u.value),u._ignore=!0;let t=u.value;t-=u.step,t{t._ignore=!1,t._setTemperature(),t.requestUpdate("value",t._oldValueMin),t._oldValueMin=0}),600,u)})),null===(s=null===(o=null==this?void 0:this.shadowRoot)||void 0===o?void 0:o.querySelector("#c-plus"))||void 0===s||s.addEventListener("click",(()=>{clearTimeout(u._timeout),0===u._oldValueMax&&(u._oldValueMax=u.value),u._ignore=!0;let t=u.value;t+=u.step,t>u.max&&(t=u.max),u.value=t,u._updateDisplay(),u._timeout=setTimeout((t=>{t._ignore=!1,t._setTemperature(),t.requestUpdate("value",t._oldValueMax),t._oldValueMax=0}),600,u)})),ic.create(c,{type:"x,y",edgeResistance:1,liveSnap:{points:t=>this._liveSnapPont(u,t)},onRelease:()=>{u._updateDragger(!1),c.blur(),c.classList.remove("active");let t=new CustomEvent("value-changed",{detail:{value:this.value},bubbles:!0,composed:!0});this.dispatchEvent(t),this._setTemperature()},onPress:()=>{u._vibrate(30),c.classList.add("active"),c.focus()},onDragStart:function(){u._updateDragger(!0)}}),ua.to(c,{duration:0,repeat:0,repeatDelay:0,yoyo:!1,ease:"power1.inOut",motionPath:{path:null===(a=null==this?void 0:this.shadowRoot)||void 0===a?void 0:a.querySelector("#shadowpath"),autoRotate:!1,fromCurrent:!0,useRadians:!0,curviness:2,start:this._value2percent(this.value)/100||0,end:this._value2percent(this.value)/100||0}}),ua.to(h,{duration:0,repeat:0,repeatDelay:0,yoyo:!1,ease:"power1.inOut",motionPath:{path:null===(l=null==this?void 0:this.shadowRoot)||void 0===l?void 0:l.querySelector("#shadowpath"),autoRotate:!1,fromCurrent:!0,useRadians:!0,curviness:2,start:this._value2percent(this.current)/100||0,end:this._value2percent(this.current)/100||0}}),this._init=!1}shouldUpdate(t){return void 0!==t.has("_config")&&void 0!==t.get("_config")&&(this._hasSummer=!1,this._hasWindow=!1,this.humidity=0),void 0!==t.get("hass")&&(this._init=!1),!0}updated(t){var e,n,i,r;if(super.updated(t),this._ignore||this._init||this.dragging)return;const o=null===(e=null==this?void 0:this.shadowRoot)||void 0===e?void 0:e.querySelector(".value-handler"),s=null===(n=null==this?void 0:this.shadowRoot)||void 0===n?void 0:n.querySelector(".current-handler");t.has("value")&&ua.to(o,{duration:this._firstRender?0:5,repeat:0,repeatDelay:0,yoyo:!1,ease:"power1.inOut",motionPath:{path:null===(i=null==this?void 0:this.shadowRoot)||void 0===i?void 0:i.querySelector("#shadowpath"),autoRotate:!1,fromCurrent:!0,useRadians:!0,curviness:2,immediateRender:!0,start:this._value2percent(t.get("value"))/100||0,end:this._value2percent(this.value)/100||0}}),t.has("current")&&ua.to(s,{duration:this._firstRender?0:25,repeat:0,repeatDelay:0,yoyo:!1,ease:"power1.inOut",motionPath:{path:null===(r=null==this?void 0:this.shadowRoot)||void 0===r?void 0:r.querySelector("#shadowpath"),autoRotate:!1,fromCurrent:!0,useRadians:!0,curviness:2,start:this._value2percent(t.get("current"))/100||0,end:this._value2percent(this.current)/100||0}}),this._firstRender=!1}willUpdate(t){if(!this.hass||!this._config||!t.has("hass")&&!t.has("_config"))return;const e=this._config.entity,n=this.hass.states[e];if(!n)return;const i=t.get("hass");if(!i||i.states[e]!==n){if(!this._config||!this.hass||!this._config.entity)return;this.stateObj=n;const t=this.stateObj.attributes,e=this.stateObj.state;this.mode=e||"off",t.hvac_modes&&(this.modes=Object.values(t.hvac_modes)),t.temperature&&(this.value=t.temperature),t.target_temp_step&&(this.step=t.target_temp_step),t.min_temp&&(this.min=t.min_temp),t.max_temp&&(this.max=t.max_temp),t.current_temperature&&(this.current=t.current_temperature),void 0!==(null==t?void 0:t.humidity)&&(this.humidity=parseFloat(t.humidity)),void 0!==(null==t?void 0:t.window_open)&&(this._hasWindow=!0,this.window=t.window_open),void 0!==(null==t?void 0:t.call_for_heat)&&(this._hasSummer=!0,this.summer=!t.call_for_heat),this._updateDisplay()}}_updateDisplay(){var t;(null===(t=null==this?void 0:this._config)||void 0===t?void 0:t.set_current_as_main)?(this._display_bottom=this.value,this._display_top=this.current):(this._display_bottom=this.current,this._display_top=this.value)}_handleAction(t){var e,n,i;if("eco"===t.currentTarget.mode){null===((null===(n=null===(e=null==this?void 0:this.stateObj)||void 0===e?void 0:e.attributes)||void 0===n?void 0:n.saved_temperature)||null)?this.hass.callService("better_thermostat","set_temp_target_temperature",{entity_id:this._config.entity,temperature:(null===(i=this._config)||void 0===i?void 0:i.eco_temperature)||18}):this.hass.callService("better_thermostat","restore_saved_target_temperature",{entity_id:this._config.entity})}else this.hass.callService("climate","set_hvac_mode",{entity_id:this._config.entity,hvac_mode:t.currentTarget.mode})}_setTemperature(){this.hass.callService("climate","set_temperature",{entity_id:this._config.entity,temperature:this.value})}_renderIcon(t,e){if(!rc[t])return N``;const n=this.hass.localize(`component.climate.state._.${t}`)||Xe({hass:this.hass,string:`extra_states.${t}`});return N`
`}_handleMoreInfo(){Ke(this,"hass-more-info",{entityId:this._config.entity})}};sc.styles=s`
:host {
display: block;
overflow: hidden;
box-sizing: border-box;
}
ha-card {
height: 100%;
width: 100%;
vertical-align: middle;
justify-content: center;
justify-items: center;
padding-left: 1em;
padding-right: 1em;
box-sizing: border-box;
}
.unavailable {
opacity: 0.3;
}
.unavailable #bar, .unavailable .main-value, .unavailable #value,.unavailable #current, .unavailable .current-info,
.unknown #bar, .unknown .main-value, .unknown #value,.unknown #current, .unknown .current-info {
display: none;
}
.more-info {
position: absolute;
cursor: pointer;
top: 0px;
right: 0px;
inset-inline-end: 0px;
inset-inline-start: initial;
border-radius: 100%;
color: var(--secondary-text-color);
z-index: 1;
direction: var(--direction);
}
.container {
position: relative;
width: 100%;
height: 100%;
}
.content {
margin: -0.5em auto;
position: relative;
width: 100%;
box-sizing: border-box;
}
.name {
display: block;
width: 100%;
text-align: center;
font-size: 20px;
padding-top: 1em;
}
svg {
height: auto;
margin: auto;
display: block;
width: 100%;
transform: scale(1.5);
-webkit-backface-visibility: hidden;
max-width: 255px;
}
path {
stroke-linecap: round;
stroke-width: 1;
}
text {
fill: var(--primary-text-color);
}
.window_open {
--mode-color: var(--energy-grid-consumption-color)
}
.summer {
--mode-color: var(--state-not_home-color)
}
.auto,
.heat_cool {
--mode-color: var(--state-climate-auto-color);
}
.cool {
--mode-color: var(--state-climate-cool-color);
}
.heat {
--mode-color: var(--label-badge-red);
}
.manual {
--mode-color: var(--state-climate-manual-color);
}
.off {
--mode-color: var(--state-climate-off-color);
}
.fan_only {
--mode-color: var(--state-climate-fan_only-color);
}
.eco {
--mode-color: var(--state-climate-eco-color);
}
.dry {
--mode-color: var(--state-climate-dry-color);
}
.idle {
--mode-color: var(--state-climate-idle-color);
}
.unknown-mode {
--mode-color: var(--state-unknown-color);
}
#modes {
z-index: 1;
position: relative;
display: flex;
width: auto;
justify-content: center;
margin-top: 1em;
margin-bottom: 1em;
}
#modes > * {
color: var(--disabled-text-color);
cursor: pointer;
display: inline-block;
}
#modes .selected-icon {
color: var(--mode-color);
}
#shadowpath {
stroke: #e7e7e8;
}
#value {
fill: var(--mode-color);
r: 5;
z-index: 9999 !important;
transition: r 0.3s ease-in-out, fill 0.6s ease-in-out;
}
#value,#current {
filter: drop-shadow(0px 0px 1px #000);
}
#value:hover, #value:active, #value:focus, #value.active {
r: 8 !important;
}
#current {
pointer-events: none;
fill: var(--label-badge-grey);
}
.status {
transition: fill 0.6s ease-in-out, filter 0.6s ease-in-out;
filter: none;
}
.status.active {
fill: var(--error-color);
filter: drop-shadow(0px 0px 6px var(--error-color));
}
#bar {
stroke: var(--mode-color);
stroke-dasharray: 176;
stroke-dashoffset: 0;
transition: stroke-dashoffset 5.1s ease-in-out 0s, stroke 0.6s ease-in-out;
}
#bar.drag {
transition: none !important;
}
#c-minus,#c-plus {
cursor: pointer;
}
.control {
cursor: pointer;
pointer-events: none;
}
ha-icon-button {
transition: color 0.6s ease-in-out;
}
.eco ha-icon-button[title="heat"], .window_open ha-icon-button[title="heat"], .summer ha-icon-button[title="heat"] {
--mode-color: var(--disabled-text-color);
}
.summer,.window {
transition: fill 0.3s ease;
fill: var(--disabled-text-color);
}
line {
stroke: var(--disabled-text-color);
}
.summer.active {
fill: var(--state-not_home-color);
}
.window.active {
fill: var(--energy-grid-consumption-color);
}
`,t([st({attribute:!1})],sc.prototype,"hass",void 0),t([st({type:Number})],sc.prototype,"value",void 0),t([st({type:Number})],sc.prototype,"current",void 0),t([st({type:Number})],sc.prototype,"humidity",void 0),t([st({type:Number})],sc.prototype,"min",void 0),t([st({type:Number})],sc.prototype,"max",void 0),t([st({type:Number})],sc.prototype,"step",void 0),t([st({type:Boolean})],sc.prototype,"window",void 0),t([st({type:Boolean})],sc.prototype,"summer",void 0),t([st({type:String})],sc.prototype,"status",void 0),t([st({type:String})],sc.prototype,"mode",void 0),t([st({type:Boolean,reflect:!0})],sc.prototype,"dragging",void 0),t([at()],sc.prototype,"_config",void 0),sc=t([rt("better-thermostat-ui-card")],sc);const ac=function(){for(var t=arguments.length,e=new Array(t),n=0;nt.schema)),o=Object.assign({},...r);return i?vn(o):mn(o)}(mn({index:gn(fn()),view_index:gn(fn()),view_layout:cn("any",(()=>!0)),type:_n()}),mn({entity:gn(_n()),name:gn(_n()),icon:gn(_n())}),mn({disable_window:gn(dn()),disable_summer:gn(dn()),disable_eco:gn(dn()),disable_heat:gn(dn()),disable_off:gn(dn()),set_current_as_main:gn(dn()),eco_temperature:gn(fn())})),lc=["icon_color","layout","fill_container","primary_info","secondary_info","icon_type","content_info","use_entity_picture","collapsible_controls","icon_animation"],uc=t=>{var e,n;customElements.get("ha-form")&&(customElements.get("hui-action-editor")||((t,e,n,i)=>{const[r,o,s]=t.split(".",3);return Number(r)>e||Number(r)===e&&(void 0===i?Number(o)>=n:Number(o)>n)||void 0!==i&&Number(r)===e&&Number(o)===n&&Number(s)>=i})(t,2022,11))||null===(e=customElements.get("hui-button-card"))||void 0===e||e.getConfigElement(),customElements.get("ha-entity-picker")||null===(n=customElements.get("hui-entities-card"))||void 0===n||n.getConfigElement()},cc=["eco_temperature","disable_window","disable_summer","disable_eco","disable_heat","disable_off","set_current_as_main"],hc=Ze((()=>[{name:"entity",selector:{entity:{domain:["climate"]}}},{name:"name",selector:{text:{}}},{name:"eco_temperature",selector:{number:{placeholder:20,min:5,max:45}}},{type:"grid",name:"",schema:[{name:"disable_window",selector:{boolean:{}}},{name:"disable_summer",selector:{boolean:{}}},{name:"disable_eco",selector:{boolean:{}}},{name:"disable_heat",selector:{boolean:{}}},{name:"disable_off",selector:{boolean:{}}},{name:"set_current_as_main",selector:{boolean:{}}}]}]));let dc=class extends nt{constructor(){super(...arguments),this._computeLabel=t=>{const e=(n=this.hass,function(t){var e;let i=Ye(t,null!==(e=null==n?void 0:n.locale.language)&&void 0!==e?e:"en");return i||(i=Ye(t,"en")),null!=i?i:t});var n;return lc.includes(t.name)?e(`editor.card.generic.${t.name}`):cc.includes(t.name)?e(`editor.card.climate.${t.name}`):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${t.name}`)}}connectedCallback(){super.connectedCallback(),uc(this.hass.connection.haVersion)}setConfig(t){ln(t,ac),this._config=t}render(){if(!this.hass||!this._config)return N``;const t=hc();return N`
`}_valueChanged(t){Ke(this,"config-changed",{config:t.detail.value}),Ke(this,"hass",{config:t.detail.value})}};t([at()],dc.prototype,"_config",void 0),t([st({attribute:!1})],dc.prototype,"hass",void 0),dc=t([rt("better-thermostat-ui-card-editor")],dc);var pc=Object.freeze({__proto__:null,get ClimateCardEditor(){return dc}});export{sc as BetterThermostatUi,oc as registerCustomCard};