!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).barba=e()}(this,(function(){function t(t,e){for(var n=0;n-1)&&(f=_,s=s.slice(0,w))}s&&(i.push(s),s="",c=!1);var E=m||g,k=f||a;i.push({name:p||r++,prefix:f,delimiter:k,optional:"?"===b||"*"===b,repeat:"+"===b||"*"===b,pattern:E?S(E):"[^"+x(k===a?k:k+a)+"]+?"})}}return(s||o1?t>0?"forward":"back":0===t?"popstate":t>0?"back":"forward"},e(t,[{key:"current",get:function(){return this.h[this.v]}},{key:"state",get:function(){return this.h[this.h.length-1]}},{key:"previous",get:function(){return this.v<1?null:this.h[this.v-1]}},{key:"size",get:function(){return this.h.length}}]),t}()),P=function(t,e){try{var n=function(){if(!e.next.html)return Promise.resolve(t).then((function(t){var n=e.next;if(t){var i=T.toElement(t);n.namespace=T.getNamespace(i),n.container=T.getContainer(i),n.html=t,C.update({ns:n.namespace});var r=T.toDocument(t);document.title=r.title}}))}();return Promise.resolve(n&&n.then?n.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},L=d,M={__proto__:null,update:P,nextTick:function(){return new Promise((function(t){window.requestAnimationFrame(t)}))},pathToRegexp:L},O=function(){return window.location.origin},D=function(t){return void 0===t&&(t=window.location.href),q(t).port},q=function(t){var e,n=t.match(/:\d+/);if(null===n)/^http/.test(t)&&(e=80),/^https/.test(t)&&(e=443);else{var i=n[0].substring(1);e=parseInt(i,10)}var r,o=t.replace(O(),""),s={},a=o.indexOf("#");a>=0&&(r=o.slice(a+1),o=o.slice(0,a));var l=o.indexOf("?");return l>=0&&(s=z(o.slice(l+1)),o=o.slice(0,l)),{hash:r,path:o,port:e,query:s}},z=function(t){return t.split("&").reduce((function(t,e){var n=e.split("=");return t[n[0]]=n[1],t}),{})},I=function(t){return void 0===t&&(t=window.location.href),t.replace(/(\/#.*|\/|#.*)$/,"")},R={__proto__:null,getHref:function(){return window.location.href},getOrigin:O,getPort:D,getPath:function(t){return void 0===t&&(t=window.location.href),q(t).path},parse:q,parseQuery:z,clean:I};function F(t,e,n){return void 0===e&&(e=2e3),new Promise((function(i,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)if(200===o.status)i(o.responseText);else if(o.status){var e={status:o.status,statusText:o.statusText};n(t,e),r(e)}},o.ontimeout=function(){var i=new Error("Timeout error ["+e+"]");n(t,i),r(i)},o.onerror=function(){var e=new Error("Fetch error");n(t,e),r(e)},o.open("GET",t),o.timeout=e,o.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml"),o.setRequestHeader("x-barba","yes"),o.send()}))}function N(t,e){return void 0===e&&(e={}),function(){for(var n=arguments.length,i=new Array(n),r=0;r1?n-1:0),r=1;r1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey},Y=function(t){var e=t.el;return e.hasAttribute("target")&&"_blank"===e.target},X=function(t){var e=t.el;return void 0!==e.protocol&&window.location.protocol!==e.protocol||void 0!==e.hostname&&window.location.hostname!==e.hostname},G=function(t){var e=t.el;return void 0!==e.port&&D()!==D(e.href)},Q=function(t){var e=t.el;return e.getAttribute&&"string"==typeof e.getAttribute("download")},Z=function(t){return t.el.hasAttribute(A.prefix+"-"+A.prevent)},K=function(t){return Boolean(t.el.closest("["+A.prefix+"-"+A.prevent+'="all"]'))},J=function(t){var e=t.href;return I(e)===I()&&D(e)===D()},tt=function(t){function e(e){var n;return(n=t.call(this,e)||this).suite=[],n.tests=new Map,n.init(),n}i(e,t);var n=e.prototype;return n.init=function(){this.add("pushState",H),this.add("exists",U),this.add("newTab",V),this.add("blank",Y),this.add("corsDomain",X),this.add("corsPort",G),this.add("download",Q),this.add("preventSelf",Z),this.add("preventAll",K),this.add("sameUrl",J,!1)},n.add=function(t,e,n){void 0===n&&(n=!0),this.tests.set(t,e),n&&this.suite.push(t)},n.run=function(t,e,n,i){return this.tests.get(t)({el:e,event:n,href:i})},n.checkLink=function(t,e,n){var i=this;return this.suite.some((function(r){return i.run(r,t,e,n)}))},e}(B),et=function(t){function e(n,i){var r;void 0===i&&(i="Barba error");for(var o=arguments.length,s=new Array(o>2?o-2:0),a=2;a0&&c.push(s),(l=this.logger).info.apply(l,["Transition found ["+a.join(",")+"]"].concat(c))}else this.logger.info("No transition found ["+a.join(",")+"]");return o},e.update=function(){var t=this;this.all=this.all.map((function(e){return t.T(e)})).sort((function(t,e){return t.priority-e.priority})).reverse().map((function(t){return delete t.priority,t})),this.page=this.all.filter((function(t){return void 0!==t.leave||void 0!==t.enter})),this.once=this.all.filter((function(t){return void 0!==t.once}))},e.R=function(t,e,n,i,r){var o=!0,s=!1,a=t,l=e.name,c=l,u=l,h=l,d=r?a[r]:a,f="to"===r?n.next:n.current;if(r?d&&d[l]:d[l]){switch(e.type){case"strings":default:var p=Array.isArray(d[c])?d[c]:[d[c]];f[c]&&-1!==p.indexOf(f[c])&&(s=!0),-1===p.indexOf(f[c])&&(o=!1);break;case"object":var m=Array.isArray(d[u])?d[u]:[d[u]];f[u]?(f[u].name&&-1!==m.indexOf(f[u].name)&&(s=!0),-1===m.indexOf(f[u].name)&&(o=!1)):o=!1;break;case"function":d[h](n)?s=!0:o=!1}s&&(r?(i[r]=i[r]||{},i[r][l]=a[r][l]):i[l]=a[l])}return o},e.O=function(t,e,n){var i=0;return(t[e]||t.from&&t.from[e]||t.to&&t.to[e])&&(i+=Math.pow(10,n),t.from&&t.from[e]&&(i+=1),t.to&&t.to[e]&&(i+=2)),i},e.T=function(t){var e=this;t.priority=0;var n=0;return this.A.forEach((function(i,r){n+=e.O(t,i.name,r+1)})),t.priority=n,t},t}(),it=function(){function t(t){void 0===t&&(t=[]),this.logger=new h("@barba/core"),this.S=!1,this.store=new nt(t)}var n=t.prototype;return n.get=function(t,e){return this.store.resolve(t,e)},n.doOnce=function(t){var e=t.data,n=t.transition;try{var i=function(){r.S=!1},r=this,o=n||{};r.S=!0;var s=l((function(){return Promise.resolve(r.j("beforeOnce",e,o)).then((function(){return Promise.resolve(r.once(e,o)).then((function(){return Promise.resolve(r.j("afterOnce",e,o)).then((function(){}))}))}))}),(function(t){r.S=!1,r.logger.debug("Transition error [before/after/once]"),r.logger.error(t)}));return Promise.resolve(s&&s.then?s.then(i):i())}catch(t){return Promise.reject(t)}},n.doPage=function(t){var e=t.data,n=t.transition,i=t.page,r=t.wrapper;try{var o=function(t){if(s)return t;a.S=!1},s=!1,a=this,c=n||{},u=!0===c.sync||!1;a.S=!0;var h=l((function(){function t(){return Promise.resolve(a.j("before",e,c)).then((function(){function t(t){return Promise.resolve(a.remove(e)).then((function(){return Promise.resolve(a.j("after",e,c)).then((function(){}))}))}var n=function(){if(u)return l((function(){return Promise.resolve(a.add(e,r)).then((function(){return Promise.resolve(a.j("beforeLeave",e,c)).then((function(){return Promise.resolve(a.j("beforeEnter",e,c)).then((function(){return Promise.resolve(Promise.all([a.leave(e,c),a.enter(e,c)])).then((function(){return Promise.resolve(a.j("afterLeave",e,c)).then((function(){return Promise.resolve(a.j("afterEnter",e,c)).then((function(){}))}))}))}))}))}))}),(function(t){if(a.M(t))throw new et(t,"Transition error [sync]")}));var t=function(t){return l((function(){var t=function(){if(!1!==n)return Promise.resolve(a.add(e,r)).then((function(){return Promise.resolve(a.j("beforeEnter",e,c)).then((function(){return Promise.resolve(a.enter(e,c,n)).then((function(){return Promise.resolve(a.j("afterEnter",e,c)).then((function(){}))}))}))}))}();if(t&&t.then)return t.then((function(){}))}),(function(t){if(a.M(t))throw new et(t,"Transition error [before/after/enter]")}))},n=!1,o=l((function(){return Promise.resolve(a.j("beforeLeave",e,c)).then((function(){return Promise.resolve(Promise.all([a.leave(e,c),P(i,e)]).then((function(t){return t[0]}))).then((function(t){return n=t,Promise.resolve(a.j("afterLeave",e,c)).then((function(){}))}))}))}),(function(t){if(a.M(t))throw new et(t,"Transition error [before/after/leave]")}));return o&&o.then?o.then(t):t()}();return n&&n.then?n.then(t):t()}))}var n=function(){if(u)return Promise.resolve(P(i,e)).then((function(){}))}();return n&&n.then?n.then(t):t()}),(function(t){if(a.S=!1,t.name&&"BarbaError"===t.name)throw a.logger.debug(t.label),a.logger.error(t.error),t;throw a.logger.debug("Transition error [page]"),a.logger.error(t),t}));return Promise.resolve(h&&h.then?h.then(o):o(h))}catch(t){return Promise.reject(t)}},n.once=function(t,e){try{return Promise.resolve(j.do("once",t,e)).then((function(){return e.once?N(e.once,e)(t):Promise.resolve()}))}catch(t){return Promise.reject(t)}},n.leave=function(t,e){try{return Promise.resolve(j.do("leave",t,e)).then((function(){return e.leave?N(e.leave,e)(t):Promise.resolve()}))}catch(t){return Promise.reject(t)}},n.enter=function(t,e,n){try{return Promise.resolve(j.do("enter",t,e)).then((function(){return e.enter?N(e.enter,e)(t,n):Promise.resolve()}))}catch(t){return Promise.reject(t)}},n.add=function(t,e){try{return T.addContainer(t.next.container,e),j.do("nextAdded",t),Promise.resolve()}catch(t){return Promise.reject(t)}},n.remove=function(t){try{return T.removeContainer(t.current.container),j.do("currentRemoved",t),Promise.resolve()}catch(t){return Promise.reject(t)}},n.M=function(t){return t.message?!/Timeout error|Fetch error/.test(t.message):!t.status},n.j=function(t,e,n){try{return Promise.resolve(j.do(t,e,n)).then((function(){return n[t]?N(n[t],n)(e):Promise.resolve()}))}catch(t){return Promise.reject(t)}},e(t,[{key:"isRunning",get:function(){return this.S},set:function(t){this.S=t}},{key:"hasOnce",get:function(){return this.store.once.length>0}},{key:"hasSelf",get:function(){return this.store.all.some((function(t){return"self"===t.name}))}},{key:"shouldWait",get:function(){return this.store.all.some((function(t){return t.to&&!t.to.route||t.sync}))}}]),t}(),rt=function(){function t(t){var e=this;this.names=["beforeLeave","afterLeave","beforeEnter","afterEnter"],this.byNamespace=new Map,0!==t.length&&(t.forEach((function(t){e.byNamespace.set(t.namespace,t)})),this.names.forEach((function(t){j[t](e.L(t))})))}return t.prototype.L=function(t){var e=this;return function(n){var i=t.match(/enter/i)?n.next:n.current,r=e.byNamespace.get(i.namespace);return r&&r[t]?N(r[t],r)(n):Promise.resolve()}},t}();Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});var ot={container:null,html:"",namespace:"",url:{hash:"",href:"",path:"",port:null,query:{}}};return new(function(){function t(){this.version="2.9.7",this.schemaPage=ot,this.Logger=h,this.logger=new h("@barba/core"),this.plugins=[],this.hooks=j,this.dom=T,this.helpers=M,this.history=C,this.request=F,this.url=R}var i=t.prototype;return i.use=function(t,e){var n=this.plugins;n.indexOf(t)>-1?this.logger.warn("Plugin ["+t.name+"] already installed."):"function"==typeof t.install?(t.install(this,e),n.push(t)):this.logger.warn("Plugin ["+t.name+'] has no "install" method.')},i.init=function(t){var e=void 0===t?{}:t,i=e.transitions,r=void 0===i?[]:i,o=e.views,s=void 0===o?[]:o,a=e.schema,l=void 0===a?A:a,c=e.requestError,u=e.timeout,d=void 0===u?2e3:u,f=e.cacheIgnore,p=void 0!==f&&f,m=e.prefetchIgnore,g=void 0!==m&&m,v=e.preventRunning,y=void 0!==v&&v,b=e.prevent,w=void 0===b?null:b,_=e.debug,x=e.logLevel;if(h.setLevel(!0===(void 0!==_&&_)?"debug":void 0===x?"off":x),this.logger.info(this.version),Object.keys(l).forEach((function(t){A[t]&&(A[t]=l[t])})),this.$=c,this.timeout=d,this.cacheIgnore=p,this.prefetchIgnore=g,this.preventRunning=y,this._=this.dom.getWrapper(),!this._)throw new Error("[@barba/core] No Barba wrapper found");this._.setAttribute("aria-live","polite"),this.q();var S=this.data.current;if(!S.container)throw new Error("[@barba/core] No Barba container found");if(this.cache=new W(p),this.prevent=new tt(g),this.transitions=new it(r),this.views=new rt(s),null!==w){if("function"!=typeof w)throw new Error("[@barba/core] Prevent should be a function");this.prevent.add("preventCustom",w)}this.history.init(S.url.href,S.namespace),this.B=this.B.bind(this),this.U=this.U.bind(this),this.D=this.D.bind(this),this.F(),this.plugins.forEach((function(t){return t.init()}));var E=this.data;E.trigger="barba",E.next=E.current,E.current=n({},this.schemaPage),this.hooks.do("ready",E),this.once(E),this.q()},i.destroy=function(){this.q(),this.H(),this.history.clear(),this.hooks.clear(),this.plugins=[]},i.force=function(t){window.location.assign(t)},i.go=function(t,e,n){var i;if(void 0===e&&(e="barba"),this.transitions.isRunning)this.force(t);else if(!(i="popstate"===e?this.history.current&&this.url.getPath(this.history.current.url)===this.url.getPath(t):this.prevent.run("sameUrl",null,null,t))||this.transitions.hasSelf)return e=this.history.change(t,e,n),n&&(n.stopPropagation(),n.preventDefault()),this.page(t,e,i)},i.once=function(t){try{var e=this;return Promise.resolve(e.hooks.do("beforeEnter",t)).then((function(){function n(){return Promise.resolve(e.hooks.do("afterEnter",t)).then((function(){}))}var i=function(){if(e.transitions.hasOnce){var n=e.transitions.get(t,{once:!0});return Promise.resolve(e.transitions.doOnce({transition:n,data:t})).then((function(){}))}}();return i&&i.then?i.then(n):n()}))}catch(t){return Promise.reject(t)}},i.page=function(t,e,i){try{var r=function(){var t=o.data;return Promise.resolve(o.hooks.do("page",t)).then((function(){var e=l((function(){var e=o.transitions.get(t,{once:!1,self:i});return Promise.resolve(o.transitions.doPage({data:t,page:s,transition:e,wrapper:o._})).then((function(){o.q()}))}),(function(){0===h.getLevel()&&o.force(t.current.url.href)}));if(e&&e.then)return e.then((function(){}))}))},o=this;o.data.next.url=n({href:t},o.url.parse(t)),o.data.trigger=e;var s=o.cache.has(t)?o.cache.update(t,{action:"click"}).request:o.cache.set(t,o.request(t,o.timeout,o.onRequestError.bind(o,e)),"click").request,a=function(){if(o.transitions.shouldWait)return Promise.resolve(P(s,o.data)).then((function(){}))}();return Promise.resolve(a&&a.then?a.then(r):r())}catch(t){return Promise.reject(t)}},i.onRequestError=function(t){this.transitions.isRunning=!1;for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;io;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function O(t,e,n,i){void 0===n&&(n="_first"),void 0===i&&(i="_last");var r=e._prev,o=e._next;r?r._next=o:t[n]===e&&(t[n]=o),o?o._prev=r:t[i]===e&&(t[i]=r),e._next=e._prev=e.parent=null}function D(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function q(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t}function z(t,e,n,i){return t._startAt&&(bt?t._startAt.revert(fe):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function I(t){return t._repeat?Ee(t._tTime,t=t.duration()+t._rDelay)*t:0}function R(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function F(t){return t._end=_(t._start+(t._tDur/Math.abs(t._ts||t._rts||Gt)||0))}function N(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=_(n._time-(0Gt)&&e.render(n,!0)),q(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur(r=Math.abs(r))&&(o=i,a=r);return o}function st(t){return D(t),t.scrollTrigger&&t.scrollTrigger.kill(!!bt),t.progress()<1&&Me(t,"onInterrupt"),t}function at(t){if(c()&&t){var e=(t=!t.name&&t.default||t).name,n=r(t),i=e&&!n&&t.init?function(){this._props=[]}:t,o={init:m,render:yn,add:nn,kill:wn,modifier:bn,rawVars:0},s={targetTest:0,get:0,getSetter:pn,aliases:{},register:0};if(Fe(),t!==i){if(ye[e])return;T(i,T(P(t,o),s)),Se(i.prototype,Se(o,P(t,s))),ye[i.prop=e]=i,t.targetTest&&(_e.push(i),me[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}p(e,i),t.register&&t.register(Nn,i,xn)}else t&&Oe.push(t)}function lt(t,e,n){return(6*(t+=t<0?1:1>16,t>>8&De,t&De]:0:qe.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),qe[t])p=qe[t];else if("#"===t.charAt(0)){if(t.length<6&&(t="#"+(i=t.charAt(1))+i+(r=t.charAt(2))+r+(s=t.charAt(3))+s+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&De,p&De,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&De,t&De]}else if("hsl"===t.substr(0,3))if(p=f=t.match(re),e){if(~t.indexOf("="))return p=t.match(oe),n&&p.length<4&&(p[3]=1),p}else a=+p[0]%360/360,l=p[1]/100,i=2*(c=p[2]/100)-(r=c<=.5?c*(l+1):c+l-c*l),3=Xt?c.endTime(!1):e._dur;return i(n)&&(isNaN(n)||n in l)?(s=n.charAt(0),a="%"===n.substr(-1),o=n.indexOf("="),"<"===s||">"===s?(0<=o&&(n=n.replace(/=/,"")),("<"===s?c._start:c.endTime(0<=c._repeat))+(parseFloat(n.substr(1))||0)*(a?(o<0?c:r).totalDuration()/100:1)):o<0?(n in l||(l[n]=u),l[n]):(s=parseFloat(n.charAt(o-1)+n.substr(o+1)),a&&r&&(s=s/100*(ie(r)?r[0]:r).totalDuration()),1=n&&te)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if("isPause"===i.data&&i._start=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(t,e,n);if(r.render(0=this.totalDuration()||!y&&m)&&(h!==this._start&&Math.abs(u)===Math.abs(this._ts)||this._lock||(!t&&v||!(y===g&&0=i&&(o instanceof ln?e&&r.push(o):(n&&r.push(o),t&&r.push.apply(r,o.getChildren(!0,e,n)))),o=o._next;return r},a.getById=function(t){for(var e=this.getChildren(1,1,1),n=e.length;n--;)if(e[n].vars.id===t)return e[n]},a.remove=function(t){return i(t)?this.removeLabel(t):r(t)?this.killTweensOf(t):(O(this,t),t===this._recent&&(this._recent=this._last),q(this))},a.totalTime=function(e,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=_(Re.time-(0e:!e||s.isActive())&&i.push(s):(n=s.getTweensOf(r,e)).length&&i.push.apply(i,n),s=s._next;return i},a.tweenTo=function(t,e){e=e||{};var n,i=this,r=Ae(i,t),o=e.startAt,s=e.onStart,a=e.onStartParams,l=e.immediateRender,c=ln.to(i,T({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:e.duration||Math.abs((r-(o&&"time"in o?o.time:i._time))/i.timeScale())||Gt,onStart:function(){if(i.pause(),!n){var t=e.duration||Math.abs((r-(o&&"time"in o?o.time:i._time))/i.timeScale());c._dur!==t&&U(c,t,0,1).render(c._time,!0,!0),n=1}s&&s.apply(c,a||[])}},e));return l?c.render(0):c},a.tweenFromTo=function(t,e,n){return this.tweenTo(e,T({startAt:{time:Ae(this,t)}},n))},a.recent=function(){return this._recent},a.nextLabel=function(t){return void 0===t&&(t=this._time),ot(this,Ae(this,t))},a.previousLabel=function(t){return void 0===t&&(t=this._time),ot(this,Ae(this,t),1)},a.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+Gt)},a.shiftChildren=function(t,e,n){void 0===n&&(n=0);for(var i,r=this._first,o=this.labels;r;)r._start>=n&&(r._start+=t,r._end+=t),r=r._next;if(e)for(i in o)o[i]>=n&&(o[i]+=t);return q(this)},a.invalidate=function(e){var n=this._first;for(this._lock=0;n;)n.invalidate(e),n=n._next;return t.prototype.invalidate.call(this,e)},a.clear=function(t){void 0===t&&(t=!0);for(var e,n=this._first;n;)e=n._next,this.remove(n),n=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),q(this)},a.totalDuration=function(t){var e,n,i,r=0,o=this,s=o._last,a=Xt;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-t:t));if(o._dirty){for(i=o.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),a<(n=s._start)&&o._sort&&s._ts&&!o._lock?(o._lock=1,B(o,s,n-s._delay,1)._lock=0):a=n,n<0&&s._ts&&(r-=n,(!i&&!o._dp||i&&i.smoothChildTiming)&&(o._start+=n/o._ts,o._time-=n,o._tTime-=n),o.shiftChildren(-n,!1,-1/0),a=0),s._end>r&&s._ts&&(r=s._end),s=e;U(o,o===_t&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},s.updateRoot=function(t){if(_t._ts&&(k(_t,R(t,_t)),At=Re.frame),Re.frame>=we){we+=Vt.autoSleep||120;var e=_t._first;if((!e||!e._ts)&&Vt.autoSleep&&Re._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Re.sleep()}}},s}(Ge);function Ke(t,e,n,o,s,l){var c,u,h,d;if(ye[t]&&!1!==(c=new ye[t]).init(s,c.rawVars?e[t]:function(t,e,n,o,s){if(r(t)&&(t=on(t,s,e,n,o)),!a(t)||t.style&&t.nodeType||ie(t)||ne(t))return i(t)?on(t,s,e,n,o):t;var l,c={};for(l in t)c[l]=on(t[l],s,e,n,o);return c}(e[t],o,s,l,n),n,o,l)&&(n._pt=u=new xn(n._pt,s,t,0,1,c.render,c,0,c.priority),n!==Tt))for(h=n._ptLookup[n._targets.indexOf(s)],d=c._props.length;d--;)h[c._props[d]]=u;return c}function Je(t,e,n,i){var r,o,s=e.ease||i||"power1.inOut";if(ie(e))o=n[t]||(n[t]=[]),e.forEach((function(t,n){return o.push({t:n/(e.length-1)*100,v:t,e:s})}));else for(r in e)o=n[r]||(n[r]=[]),"ease"===r||o.push({t:parseFloat(t),v:e[r],e:s})}T(Ze.prototype,{_lock:0,_hasPause:0,_forcing:0});var tn,en,nn=function(t,e,n,o,s,a,l,c,u,h){r(o)&&(o=o(s||0,t,a));var f,p=t[e],m="get"!==n?n:r(p)?u?t[e.indexOf("set")||!r(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():p,g=r(p)?u?fn:dn:hn;if(i(o)&&(~o.indexOf("random(")&&(o=rt(o)),"="===o.charAt(1)&&(!(f=x(m,o)+(G(m)||0))&&0!==f||(o=f))),!h||m!==o||en)return isNaN(m*o)||""===o?(p||e in t||d(e,o),function(t,e,n,i,r,o,s){var a,l,c,u,h,d,f,p,m=new xn(this._pt,t,e,0,1,vn,null,r),g=0,v=0;for(m.b=n,m.e=i,n+="",(f=~(i+="").indexOf("random("))&&(i=rt(i)),o&&(o(p=[n,i],t,e),n=p[0],i=p[1]),l=n.match(ae)||[];a=ae.exec(i);)u=a[0],h=i.substring(g,a.index),c?c=(c+1)%5:"rgba("===h.substr(-5)&&(c=1),u!==l[v++]&&(d=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:h||1===v?h:",",s:d,c:"="===u.charAt(1)?x(d,u)-d:parseFloat(u)-d,m:c&&c<4?Math.round:0},g=ae.lastIndex);return m.c=g")})),h.duration();else{for(v in p={},C)"ease"===v||"easeEach"===v||Je(v,C[v],p,C.easeEach);for(v in p)for(I=p[v].sort((function(t,e){return t.t-e.t})),d=N=0;d=t._tDur||e<0)&&t.ratio===l&&(l&&D(t,1),n||bt||(Me(t,l?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,n);return this},s.targets=function(){return this._targets},s.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)},s.resetTo=function(t,e,n,i){Ct||Re.wake(),this._ts||this.play();var r=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||rn(this,r),function(t,e,n,i,r,o,s){var a,l,c,u,h=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!h)for(h=t._ptCache[e]=[],c=t._ptLookup,u=t._targets.length;u--;){if((a=c[u][e])&&a.d&&a.d._pt)for(a=a.d._pt;a&&a.p!==e&&a.fp!==e;)a=a._next;if(!a)return en=1,t.vars[e]="+=0",rn(t,s),en=0,1;h.push(a)}for(u=h.length;u--;)(a=(l=h[u])._pt||l).s=!i&&0!==i||r?a.s+(i||0)+o*a.c:i,a.c=n-a.s,l.e&&(l.e=w(n)+G(l.e)),l.b&&(l.b=a.s+G(l.b))}(this,t,e,n,i,this._ease(r/this._dur),r)?this.resetTo(t,e,n,i):(N(this,0),this.parent||M(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},s.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?st(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,tn&&!0!==tn.vars.overwrite)._first||st(this),this.parent&&n!==this.timeline.totalDuration()&&U(this,this._dur*this.timeline._tDur/n,0,1),this}var r,o,s,a,l,c,u,h=this._targets,d=t?Pe(t):h,f=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}(h,d))return"all"===e&&(this._pt=0),st(this);for(r=this._op=this._op||[],"all"!==e&&(i(e)&&(l={},b(e,(function(t){return l[t]=1})),e=l),e=function(t,e){var n,i,r,o,s=t[0]?v(t[0]).harness:0,a=s&&s.aliases;if(!a)return e;for(i in n=Se({},e),a)if(i in n)for(r=(o=a[i].split(",")).length;r--;)n[o[r]]=n[i];return n}(h,e)),u=h.length;u--;)if(~d.indexOf(h[u]))for(l in o=f[u],"all"===e?(r[u]=e,a=o,s={}):(s=r[u]=r[u]||{},a=e),a)(c=o&&o[l])&&("kill"in c.d&&!0!==c.d.kill(l)||O(this,c,"_pt"),delete o[l]),"all"!==s&&(s[l]=1);return this._initted&&!this._pt&&p&&st(this),this},r.to=function(t,e,n){return new r(t,e,n)},r.from=function(t,e){return Y(1,arguments)},r.delayedCall=function(t,e,n,i){return new r(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:i})},r.fromTo=function(t,e,n){return Y(2,arguments)},r.set=function(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new r(t,e)},r.killTweensOf=function(t,e,n){return _t.killTweensOf(t,e,n)},r}(Ge);function cn(t,e,n){return t.setAttribute(e,n)}function un(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)}T(ln.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),b("staggerTo,staggerFrom,staggerFromTo",(function(t){ln[t]=function(){var e=new Ze,n=Ce.call(arguments,0);return n.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,n)}}));var hn=function(t,e,n){return t[e]=n},dn=function(t,e,n){return t[e](n)},fn=function(t,e,n,i){return t[e](i.fp,n)},pn=function(t,e){return r(t[e])?dn:s(t[e])&&t.setAttribute?cn:hn},mn=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},gn=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},vn=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)},yn=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},bn=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},wn=function(t){for(var e,n,i=this._pt;i;)n=i._next,i.p===t&&!i.op||i.op===t?O(this,i,"_pt"):i.dep||(e=1),i=n;return!e},_n=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},xn=(Sn.prototype.modifier=function(t,e,n){this.mSet=this.mSet||this.set,this.set=un,this.m=t,this.mt=n,this.tween=e},Sn);function Sn(t,e,n,i,r,o,s,a,l){this.t=e,this.s=i,this.c=r,this.p=n,this.r=o||mn,this.d=s||this,this.set=a||hn,this.pr=l||0,(this._next=t)&&(t._prev=this)}function En(t){return(Tn[t]||Cn).map((function(t){return t()}))}function kn(){var t=Date.now(),e=[];2=Math.abs(n)?e:n}function p(){(E=g.core.globals().ScrollTrigger)&&E.core&&function(){var t=E.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,L),i.push.apply(i,M),L=n,M=i,D=function(t,n){return e[t](n)}}()}function m(t){return(g=t||n())&&"undefined"!=typeof document&&document.body&&(y=window,w=(b=document).documentElement,_=b.body,k=[y,b,w,_],g.utils.clamp,T=g.core.context||function(){},S="onpointerenter"in _?"pointer":"mouse",x=F.isTouch=y.matchMedia&&y.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in y||0=e,r=Math.abs(n)>=e;Z&&(i||r)&&Z(It,t,n,Yt,Xt),i&&(U&&0Math.abs(e)?"x":"y",qt=!0),"y"!==zt&&(Yt[2]+=t,It._vx.update(t,!0)),"x"!==zt&&(Xt[2]+=e,It._vy.update(e,!0)),C?Pt=Pt||requestAnimationFrame(yt):yt()}function _t(t){if(!vt(t,1)){var e=(t=d(t,L)).clientX,i=t.clientY,r=e-It.x,o=i-It.y,s=It.isDragging;It.x=e,It.y=i,(s||Math.abs(It.startX-e)>=n||Math.abs(It.startY-i)>=n)&&(B&&(Mt=!0),s||(It.isDragging=!0),wt(r,o),s||N&&N(It))}}function xt(t){return t.touches&&1=t)return n[o];return n[o-1]}for(o=n.length,t+=r;o--;)if(n[o]<=t)return n[o];return n[0]}:function(n,i,r){void 0===r&&(r=.001);var o=e(n);return!i||Math.abs(o-n)n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in ze?ze[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t}function mt(t,e,n,r,o,s,a,l){var c=o.startColor,u=o.endColor,h=o.fontSize,d=o.indent,f=o.fontWeight,p=qt.createElement("div"),m=G(n)||"fixed"===i(n,"pinType"),g=-1!==t.indexOf("scroller"),v=m?It:n,y=-1!==t.indexOf("start"),b=y?c:u,w="border-color:"+b+";font-size:"+h+";color:"+b+";font-weight:"+f+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return w+="position:"+((g||l)&&m?"fixed;":"absolute;"),!g&&!l&&m||(w+=(r===R?_e:xe)+":"+(s+parseFloat(d))+"px;"),a&&(w+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),p._isStart=y,p.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),p.style.cssText=w,p.innerText=e||0===e?t+"-"+e:t,v.children[0]?v.insertBefore(p,v.children[0]):v.appendChild(p),p._offset=p["offset"+r.op.d2],Ie(p,0,r,y),p}function gt(){return 34It.clientWidth)||(L.cache++,te?ue=ue||requestAnimationFrame(Xe):Xe(),ve||Be("scrollStart"),ve=me())}function yt(){ie=Dt.innerWidth,ne=Dt.innerHeight}function bt(){L.cache++,Ht||Jt||qt.fullscreenElement||qt.webkitFullscreenElement||ee&&ie===Dt.innerWidth&&!(Math.abs(Dt.innerHeight-ne)>.25*Dt.innerHeight)||Ft.restart(!0)}function wt(){return dt(en,"scrollEnd",wt)||Ue(!0)}function _t(t){for(var e=0;ee)&&t.setPositions(t.start,Math.max(t.start+1,e),!0)})),n.forEach((function(t){return t&&t.render&&t.render(-1)})),L.forEach((function(t){tt(t)&&(t.smooth&&requestAnimationFrame((function(){return t.target.style.scrollBehavior="smooth"})),t.rec&&t(t.rec))})),St(se,1),Ft.pause(),He++,Xe(he=2),Re.forEach((function(t){return tt(t.vars.onRefresh)&&t.vars.onRefresh(t)})),he=en.isRefreshing=!1,Be("refresh")}else ht(en,"scrollEnd",wt)},Ve=0,Ye=1,Xe=function(t){if(!he||2===t){en.isUpdating=!0,fe&&fe.update(0);var e=Re.length,n=me(),i=50<=n-ge,r=e&&Re[0].scroll();if(Ye=r=h}))},Ie.update=function(t,i,r){if(!ee||r||t){var o,c,u,d,f,m,g,v=!0===he?X:Ie.scroll(),b=t?0:(v-l)/y,S=b<0?0:1=K(se,re),Jt)if(t||!o&&!m)Tt(Ot,x);else{var C=Oe(Ot,!0),L=v-l;Tt(Ot,It,C.top+(re===R?L:0)+Me,C.left+(re===R?0:L)+Me)}Ke(o||m?w:_),O&&S<1&&o||k($+(1!==S||m?0:A))}}else k(V($+A*S));!Qt||n.tween||Ht||pe||Y.restart(!0),yt&&(f||Gt&&S&&(S<1||!ce))&&Nt(yt.targets).forEach((function(t){return t.classList[o||Gt?"add":"remove"](yt.className)})),!gt||oe||t||gt(Ie),d&&!Ht?(oe&&(g&&("complete"===u?e.pause().totalProgress(1):"reset"===u?e.restart(!0).pause():"restart"===u?e.restart(!0):e[u]()),gt&>(Ie)),!f&&ce||(xt&&f&&rt(Ie,xt),ge[c]&&rt(Ie,ge[c]),Gt&&(1===S?Ie.kill(!1,1):ge[c]=0),f||ge[c=1===S?1:3]&&rt(Ie,ge[c])),ne&&!o&&Math.abs(Ie.getVelocity())>(et(ne)?ne:2500)&&(it(Ie.callbackAnimation),N?N.progress(1):it(e,"reverse"===u?1:!S,1))):oe&>&&!Ht&>(Ie)}if(D){var M=ee?v/ee.duration()*(ee._caScrollDist||0):v;P(M+(p._isFlipped?1:0)),D(M)}ut&&ut(-v/ee.duration()*(ee._caScrollDist||0))}},Ie.enable=function(t,e){Ie.enabled||(Ie.enabled=!0,ht(se,"resize",bt),le||ht(se,"scroll",vt),Ne&&ht(nn,"refreshInit",Ne),!1!==t&&(Ie.progress=Xe=0,s=a=We=Ge()),!1!==e&&Ie.refresh())},Ie.getTween=function(t){return t&&n?n.tween:N},Ie.setPositions=function(t,e,n,i){if(ee){var r=ee.scrollTrigger,o=ee.duration(),s=r.end-r.start;t=r.start+s*t/o,e=r.start+s*e/o}Ie.refresh(!1,!1,{start:B(t,n&&!!Ie._startClamp),end:B(e,n&&!!Ie._endClamp)},i),Ie.update()},Ie.adjustPinSpacing=function(t){if(C&&t){var e=C.indexOf(re.d)+1;C[e]=parseFloat(C[e])+t+Me,C[1]=parseFloat(C[1])+t+Me,Ke(C)}},Ie.disable=function(t,e){if(Ie.enabled&&(!1!==t&&Ie.revert(!0,!0),Ie.enabled=Ie.isActive=!1,e||N&&N.pause(),X=0,r&&(r.uncache=1),Ne&&dt(nn,"refreshInit",Ne),Y&&(Y.pause(),n.tween&&n.tween.kill()&&(n.tween=0)),!le)){for(var i=Re.length;i--;)if(Re[i].scroller===se&&Re[i]!==Ie)return;dt(se,"resize",bt),le||dt(se,"scroll",vt)}},Ie.kill=function(n,i){Ie.disable(n,i),N&&!i&&N.kill(),_t&&delete Fe[_t];var o=Re.indexOf(Ie);0<=o&&Re.splice(o,1),o===Yt&&0s&&(S()>s?h.progress(1)&&S(s):h.resetTo("scrollY",s))}nt(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var o,s,a,l,h,d,f,p,m=t.normalizeScrollX,g=t.momentum,v=t.allowNestedScroll,y=t.onRelease,b=c(t.target)||zt,w=Mt.core.globals().ScrollSmoother,_=w&&w.get(),x=re&&(t.content&&c(t.content)||_&&!1!==t.content&&!_.smooth()&&_.content()),S=u(b,R),E=u(b,I),k=1,$=(F.isTouch&&Dt.visualViewport?Dt.visualViewport.scale*Dt.visualViewport.width:Dt.outerWidth)/Dt.innerWidth,A=0,T=tt(g)?function(){return g(o)}:function(){return g||2.8},C=an(b,t.type,!0,v),P=U,M=U;return x&&Mt.set(x,{y:"+=0"}),t.ignoreCheck=function(t){return re&&"touchmove"===t.type&&function(){if(l){requestAnimationFrame(e);var t=V(o.deltaY/2),n=M(S.v-t);if(x&&n!==S.v+S.offset){S.offset=n-S.v;var r=V((parseFloat(x&&x._gsap.y)||0)-S.offset);x.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+r+", 0, 1)",x._gsap.y=r+"px",S.cacheID=L.cache,Xe()}return!0}S.offset&&i(),l=!0}()||1.05=s||s-1<=n)&&Mt.to({},{onUpdate:r,duration:a})}else p.restart(!0);y&&y(t)},t.onWheel=function(){h._ts&&h.pause(),1e3e){for(;--r&&t[r]>e;);r<0&&(r=0)}else for(;t[++r] element or an SVG path data string")}function $(t){var e,n=0;for(t.reverse();n=1)?1:this.easing(a);this.value=this.from+(this.to-this.from)*l}null==(e=this.onUpdate)||e.call(this,this.value,s),s&&this.stop()}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,n){var i=n.lerp,r=void 0===i?.1:i,o=n.duration,s=void 0===o?1:o,a=n.easing,l=void 0===a?function(t){return t}:a,c=n.onStart,u=n.onUpdate;this.from=this.value=t,this.to=e,this.lerp=r,this.duration=s,this.easing=l,this.currentTime=0,this.isRunning=!0,null==c||c(),this.onUpdate=u},t}(),o=function(){function t(t){var e,n,i=this,r=void 0===t?{}:t,o=r.wrapper,s=r.content,a=r.autoResize,l=void 0===a||a;if(this.resize=function(){i.onWrapperResize(),i.onContentResize()},this.onWrapperResize=function(){i.wrapper===window?(i.width=window.innerWidth,i.height=window.innerHeight):(i.width=i.wrapper.clientWidth,i.height=i.wrapper.clientHeight)},this.onContentResize=function(){i.scrollHeight=i.content.scrollHeight,i.scrollWidth=i.content.scrollWidth},this.wrapper=o,this.content=s,l){var c=(e=this.resize,function(){var t=arguments,i=this;clearTimeout(n),n=setTimeout((function(){e.apply(i,t)}),250)});this.wrapper!==window&&(this.wrapperResizeObserver=new ResizeObserver(c),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(c),this.contentResizeObserver.observe(this.content)}this.resize()}return t.prototype.destroy=function(){var t,e;null==(t=this.wrapperResizeObserver)||t.disconnect(),null==(e=this.contentResizeObserver)||e.disconnect()},e(t,[{key:"limit",get:function(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}]),t}(),s=function(){function t(){this.events={}}var e=t.prototype;return e.emit=function(t){for(var e=this.events[t]||[],n=0,i=e.length;nMath.abs(i)?r:i:"horizontal"===e.options.gestureOrientation&&(c=i);var u=s&&e.options.syncTouch,h=s&&"touchend"===o.type&&Math.abs(c)>1;h&&(c=e.velocity*e.options.touchInertiaMultiplier),e.scrollTo(e.targetScroll+c,n({programmatic:!1},u&&{lerp:h?e.syncTouchLerp:e.options.__iosNoInertiaSyncTouchLerp}))}}}},this.onScroll=function(){if(!e.isScrolling){var t=e.animatedScroll;e.animatedScroll=e.targetScroll=e.actualScroll,e.velocity=0,e.direction=Math.sign(e.animatedScroll-t),e.emit()}},window.lenisVersion="1.0.27",c!==document.documentElement&&c!==document.body||(c=window),this.options={wrapper:c,content:h,wheelEventsTarget:f,eventsTarget:m,smoothWheel:v,smoothTouch:b,syncTouch:_,syncTouchLerp:S,__iosNoInertiaSyncTouchLerp:k,touchInertiaMultiplier:A,duration:T,easing:P,lerp:M,infinite:D,gestureOrientation:R,orientation:z,touchMultiplier:N,wheelMultiplier:B,normalizeWheel:H,autoResize:V},this.animate=new r,this.emitter=new s,this.dimensions=new o({wrapper:c,content:h,autoResize:V}),this.toggleClass("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=_||v||b,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onScroll,{passive:!1}),this.virtualScroll=new a(m,{touchMultiplier:N,wheelMultiplier:B,normalizeWheel:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}var l=t.prototype;return l.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onScroll,{passive:!1}),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClass("lenis",!1),this.toggleClass("lenis-smooth",!1),this.toggleClass("lenis-scrolling",!1),this.toggleClass("lenis-stopped",!1),this.toggleClass("lenis-locked",!1)},l.on=function(t,e){return this.emitter.on(t,e)},l.off=function(t,e){return this.emitter.off(t,e)},l.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},l.resize=function(){this.dimensions.resize()},l.emit=function(){this.emitter.emit("scroll",this)},l.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.velocity=0,this.animate.stop()},l.start=function(){this.isStopped=!1,this.reset()},l.stop=function(){this.isStopped=!0,this.animate.stop(),this.reset()},l.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},l.scrollTo=function(t,e){var n=this,r=void 0===e?{}:e,o=r.offset,s=void 0===o?0:o,a=r.immediate,l=void 0!==a&&a,c=r.lock,u=void 0!==c&&c,h=r.duration,d=void 0===h?this.options.duration:h,f=r.easing,p=void 0===f?this.options.easing:f,m=r.lerp,g=void 0===m?!d&&this.options.lerp:m,v=r.onComplete,y=void 0===v?null:v,b=r.force,w=r.programmatic,_=void 0===w||w;if(!this.isStopped&&!this.isLocked||void 0!==b&&b){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var x,S;if("string"==typeof t?S=document.querySelector(t):null!=(x=t)&&x.nodeType&&(S=t),S){if(this.options.wrapper!==window){var E=this.options.wrapper.getBoundingClientRect();s-=this.isHorizontal?E.left:E.top}var k=S.getBoundingClientRect();t=(this.isHorizontal?k.left:k.top)+this.animatedScroll}}if("number"==typeof t){if(t+=s,t=Math.round(t),this.options.infinite?_&&(this.targetScroll=this.animatedScroll=this.scroll):t=i(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==y||y(this));if(!_){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:d,easing:p,lerp:g,onStart:function(){u&&(n.isLocked=!0),n.isScrolling=!0},onUpdate:function(t,e){n.isScrolling=!0,n.velocity=t-n.animatedScroll,n.direction=Math.sign(n.velocity),n.animatedScroll=t,n.setScroll(n.scroll),_&&(n.targetScroll=t),e||n.emit(),e&&requestAnimationFrame((function(){n.reset(),n.emit(),null==y||y(n)}))}})}}},l.toggleClass=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},e(t,[{key:"rootElement",get:function(){return this.options.wrapper===window?this.options.content:this.options.wrapper}},{key:"limit",get:function(){return this.dimensions.limit[this.isHorizontal?"x":"y"]}},{key:"isHorizontal",get:function(){return"horizontal"===this.options.orientation}},{key:"actualScroll",get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop}},{key:"scroll",get:function(){return this.options.infinite?(this.animatedScroll%(t=this.limit)+t)%t:this.animatedScroll;var t}},{key:"progress",get:function(){return 0===this.limit?1:this.scroll/this.limit}},{key:"isSmooth",get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClass("lenis-smooth",t))}},{key:"isScrolling",get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClass("lenis-scrolling",t))}},{key:"isStopped",get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClass("lenis-stopped",t))}},{key:"isLocked",get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClass("lenis-locked",t))}},{key:"className",get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t}}]),t}()})),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).SplitType=e()}(this,(function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=c(e);return void 0!==n.types?t=n.types:void 0!==n.split&&(t=n.split),void 0!==t&&(n.types=(u(t)||h(t)?String(t):"").split(",").map((function(t){return String(t).trim()})).filter((function(t){return/((line)|(word)|(char))/i.test(t)}))),(n.absolute||n.position)&&(n.absolute=n.absolute||/absolute/.test(e.position)),n}function f(t){var e=u(t)||h(t)?String(t):"";return{none:!e,lines:/line/i.test(e),words:/word/i.test(e),chars:/char/i.test(e)}}function p(t){return null!==t&&"object"==typeof t}function m(t){return p(t)&&/^(1|3|11)$/.test(t.nodeType)}function g(t){return h(t)?t:null==t?[]:function(t){return p(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0}(t.length)}(t)?Array.prototype.slice.call(t):[t]}function v(t){var e=t;return u(t)&&(e=/^(#[a-z]\w+)$/.test(t.trim())?document.getElementById(t.trim().slice(1)):document.querySelectorAll(t)),g(e).reduce((function(t,e){return[].concat(s(t),s(g(e).filter(m)))}),[])}!function(){function t(){for(var t=arguments.length,e=0;e1&&void 0!==arguments[1]?arguments[1]:" ";return(t?String(t):"").trim().replace(/\s+/g," ").split(e)}(o).reduce((function(t,n,o,c){var h,d;return i.chars&&(d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t=function(t){return null==t?"":String(t)}(t))&&u(t)&&!e&&B(t)?function(t){return B(t)?function(t){return t.match(N)||[]}(t):function(t){return t.split("")}(t)}(t):t.split(e)}(n).map((function(t){var n=W(r,{class:"".concat(e.splitClass," ").concat(e.charClass),style:"display: inline-block;",children:t});return x(n,"isChar",!0),l=[].concat(s(l),[n]),n}))),i.words||i.lines?(x(h=W(r,{class:"".concat(e.wordClass," ").concat(e.splitClass),style:"display: inline-block; ".concat(i.words&&e.absolute?"position: relative;":""),children:i.chars?d:n}),{isWord:!0,isWordStart:!0,isWordEnd:!0}),a.appendChild(h)):d.forEach((function(t){a.appendChild(t)})),o=_)&&(d=f,u.push(h=[])),h.push(i)),e.absolute&&x(i,{top:f,left:p,width:l,height:c}))})),m&&m.removeChild(t),a.lines&&(p=u.map((function(t){var n=W(l,{class:"".concat(e.splitClass," ").concat(e.lineClass),style:"display: block; text-align: ".concat(w,"; width: 100%;")});x(n,"isLine",!0);var i={height:0,top:1e4};return y.appendChild(n),t.forEach((function(t,e,r){var o=S(t),s=o.isWordEnd,a=o.top,l=o.height,c=r[e+1];i.height=Math.max(i.height,l),i.top=Math.min(i.top,a),n.appendChild(t),s&&S(c).isWordStart&&n.append(" ")})),e.absolute&&x(n,{height:i.height,top:i.top}),n})),a.words||Y(y),t.replaceChildren(y)),e.absolute&&(t.style.width="".concat(t.style.width||r,"px"),t.style.height="".concat(i,"px"),g(c).forEach((function(t){var e=S(t),n=e.isLine,i=e.top,r=e.left,o=e.width,a=e.height,l=S(t.parentElement),c=!n&&l.isLine;t.style.top="".concat(c?i-l.top:i,"px"),t.style.left="".concat(n?s.left:r-(c?s.left:0),"px"),t.style.height="".concat(a,"px"),t.style.width="".concat(n?s.width:o,"px"),t.style.position="absolute"}))),m&&(v?m.insertBefore(t,v):m.appendChild(t)),p}(t,e.settings,n);e.lines=[].concat(s(e.lines),s(r))}})),this.isSplit=!0,window.scrollTo(n[0],n[1]),y(w).forEach((function(t){var e=o(t,2),n=e[0],i=e[1],r=i.isRoot,s=i.isSplit;r&&s||(w[n]=null,delete w[n])})))}},{key:"revert",value:function(){this.isSplit&&(this.lines=null,this.words=null,this.chars=null,this.isSplit=!1),t.revert(this.elements)}}]),t}()})),function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],(function(n){return e(t,n)})):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,(function(t,e){"use strict";var n=Array.prototype.slice,i=t.console,r=void 0===i?function(){}:function(t){i.error(t)};function o(i,o,a){(a=a||e||t.jQuery)&&(o.prototype.option||(o.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){return"string"==typeof t?function(t,e,n){var o,s="$()."+i+'("'+e+'")';return t.each((function(t,l){var c=a.data(l,i);if(c){var u=c[e];if(u&&"_"!=e.charAt(0)){var h=u.apply(c,n);o=void 0===o?h:o}else r(s+" is not a valid method")}else r(i+" not initialized. Cannot call methods, i.e. "+s)})),void 0!==o?o:t}(this,t,n.call(arguments,1)):(function(t,e){t.each((function(t,n){var r=a.data(n,i);r?(r.option(e),r._init()):(r=new o(n,e),a.data(n,i,r))}))}(this,t),this)},s(a))}function s(t){!t||t&&t.bridget||(t.bridget=o)}return s(e||t.jQuery),o})),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r