mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
14 lines
70 KiB
JavaScript
14 lines
70 KiB
JavaScript
(()=>{var ce=Object.create;var q=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames,wt=Object.getOwnPropertySymbols,fe=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var St=(s,e,t)=>e in s?q(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,kt=(s,e)=>{for(var t in e||(e={}))Et.call(e,t)&&St(s,t,e[t]);if(wt)for(var t of wt(e))de.call(e,t)&&St(s,t,e[t]);return s};var ve=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),me=(s,e)=>{for(var t in e)q(s,t,{get:e[t],enumerable:!0})},pe=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ue(e))!Et.call(s,i)&&i!==t&&q(s,i,{get:()=>e[i],enumerable:!(n=he(e,i))||n.enumerable});return s};var ye=(s,e,t)=>(t=s!=null?ce(fe(s)):{},pe(e||!s||!s.__esModule?q(t,"default",{value:s,enumerable:!0}):t,s));var W=(s,e,t)=>new Promise((n,i)=>{var r=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,o);a((t=t.apply(s,e)).next())});var ne=ve((ie,nt)=>{(function(s,e){typeof define=="function"&&define.amd?define([],function(){return s.svg4everybody=e()}):typeof nt=="object"&&nt.exports?nt.exports=e():s.svg4everybody=e()})(ie,function(){function s(i,r,o){if(o){var a=document.createDocumentFragment(),l=!r.hasAttribute("viewBox")&&o.getAttribute("viewBox");l&&r.setAttribute("viewBox",l);for(var c=o.cloneNode(!0);c.childNodes.length;)a.appendChild(c.firstChild);i.appendChild(a)}}function e(i){i.onreadystatechange=function(){if(i.readyState===4){var r=i._cachedDocument;r||(r=i._cachedDocument=document.implementation.createHTMLDocument(""),r.body.innerHTML=i.responseText,i._cachedTarget={}),i._embeds.splice(0).map(function(o){var a=i._cachedTarget[o.id];a||(a=i._cachedTarget[o.id]=r.getElementById(o.id)),s(o.parent,o.svg,a)})}},i.onreadystatechange()}function t(i){function r(){for(var T=0;T<C.length;){var k=C[T],w=k.parentNode,d=n(w),m=k.getAttribute("xlink:href")||k.getAttribute("href");if(!m&&a.attributeName&&(m=k.getAttribute(a.attributeName)),d&&m){if(o)if(!a.validate||a.validate(m,d,k)){w.removeChild(k);var b=m.split("#"),y=b.shift(),A=b.join("#");if(y.length){var g=h[y];g||(g=h[y]=new XMLHttpRequest,g.open("GET",y),g.send(),g._embeds=[]),g._embeds.push({parent:w,svg:d,id:A}),e(g)}else s(w,d,document.getElementById(A))}else++T,++D}else++T}(!C.length||C.length-D>0)&&p(r,67)}var o,a=Object(i),l=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,c=/\bAppleWebKit\/(\d+)\b/,f=/\bEdge\/12\.(\d+)\b/,u=/\bEdge\/.(\d+)\b/,v=window.top!==window.self;o="polyfill"in a?a.polyfill:l.test(navigator.userAgent)||(navigator.userAgent.match(f)||[])[1]<10547||(navigator.userAgent.match(c)||[])[1]<537||u.test(navigator.userAgent)&&v;var h={},p=window.requestAnimationFrame||setTimeout,C=document.getElementsByTagName("use"),D=0;o&&r()}function n(i){for(var r=i;r.nodeName.toLowerCase()!=="svg"&&(r=r.parentNode););return r}return t})});function K(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?K=function(e){return typeof e}:K=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(s)}function Ct(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function At(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function xt(s,e,t){return e&&At(s.prototype,e),t&&At(s,t),s}function Tt(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function X(s,e){return we(s)||Ee(s,e)||Ot(s,e)||Ae()}function ge(s){return be(s)||Se(s)||Ot(s)||ke()}function be(s){if(Array.isArray(s))return at(s)}function we(s){if(Array.isArray(s))return s}function Se(s){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(s))return Array.from(s)}function Ee(s,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(s)))){var t=[],n=!0,i=!1,r=void 0;try{for(var o=s[Symbol.iterator](),a;!(n=(a=o.next()).done)&&(t.push(a.value),!(e&&t.length===e));n=!0);}catch(l){i=!0,r=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw r}}return t}}function Ot(s,e){if(!!s){if(typeof s=="string")return at(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return at(s,e)}}function at(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=s[t];return n}function ke(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=function(){function s(e){Ct(this,s),this.mAttr="data-"+e.dataName,this.mCaptureEvents=["mouseenter","mouseleave"],this.el=e.el}return xt(s,[{key:"mInit",value:function(t){var n=this;this.modules=t,this.mCheckEventTarget=this.mCheckEventTarget.bind(this),this.events&&Object.keys(this.events).forEach(function(i){return n.mAddEvent(i)})}},{key:"mUpdate",value:function(t){this.modules=t}},{key:"mDestroy",value:function(){var t=this;this.events&&Object.keys(this.events).forEach(function(n){return t.mRemoveEvent(n)})}},{key:"mAddEvent",value:function(t){var n=!!this.mCaptureEvents.includes(t);this.el.addEventListener(t,this.mCheckEventTarget,n)}},{key:"mRemoveEvent",value:function(t){var n=!!this.mCaptureEvents.includes(t);this.el.removeEventListener(t,this.mCheckEventTarget,n)}},{key:"mCheckEventTarget",value:function(t){var n=this.events[t.type];if(typeof n=="string")this[n](t);else{var i="["+this.mAttr+"]",r=t.target;if(this.mCaptureEvents.includes(t.type))r.matches(i)&&this.mCallEventMethod(t,n,r);else for(;r&&r!==document&&!(r.matches(i)&&this.mCallEventMethod(t,n,r)!="undefined");)r=r.parentNode}}},{key:"mCallEventMethod",value:function(t,n,i){var r=i.getAttribute(this.mAttr);if(n.hasOwnProperty(r)){var o=n[r];t.hasOwnProperty("currentTarget")||Object.defineProperty(t,"currentTarget",{value:i}),t.hasOwnProperty("curTarget")||Object.defineProperty(t,"curTarget",{value:i}),this[o](t)}}},{key:"$",value:function(t,n){var i=t.indexOf("."),r=t.indexOf("#"),o=t.indexOf("["),a=[i,r,o].filter(function(v){return v!=-1}),l=!1,c=t,f="",u=this.el;return a.length&&(l=Math.min.apply(Math,ge(a)),c=t.slice(0,l),f=t.slice(l)),K(n)=="object"&&(u=n),u.querySelectorAll("["+this.mAttr+"="+c+"]"+f)}},{key:"parent",value:function(t,n){for(var i="["+this.mAttr+"="+t+"]",r=n.parentNode;r&&r!==document;){if(r.matches(i))return r;r=r.parentNode}}},{key:"getData",value:function(t,n){var i=n||this.el;return i.getAttribute(this.mAttr+"-"+t)}},{key:"setData",value:function(t,n,i){var r=i||this.el;return r.setAttribute(this.mAttr+"-"+t,n)}},{key:"call",value:function(t,n,i,r){var o=this;n&&!i&&(i=n,n=!1),this.modules[i]&&(r?this.modules[i][r]&&this.modules[i][r][t](n):Object.keys(this.modules[i]).forEach(function(a){o.modules[i][a][t](n)}))}},{key:"on",value:function(t,n,i,r){var o=this;this.modules[n]&&(r?this.modules[n][r].el.addEventListener(t,function(a){return i(a)}):Object.keys(this.modules[n]).forEach(function(a){o.modules[n][a].el.addEventListener(t,function(l){return i(l)})}))}},{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),s}(),Te=function(){function s(e){Ct(this,s),this.app,this.modules=e.modules,this.currentModules={},this.activeModules={},this.newModules={},this.moduleId=0}return xt(s,[{key:"init",value:function(t,n){var i=this,r=n||document,o=r.querySelectorAll("*");t&&!this.app&&(this.app=t),this.activeModules.app={app:this.app},o.forEach(function(a){Array.from(a.attributes).forEach(function(l){if(l.name.startsWith("data-module")){var c=!1,f=l.name.split("-").splice(2),u=i.toCamel(f);if(i.modules[u]?c=!0:i.modules[i.toUpper(u)]&&(u=i.toUpper(u),c=!0),c){var v={el:a,name:u,dataName:f.join("-")},h=new i.modules[u](v),p=l.value;p||(i.moduleId++,p="m"+i.moduleId,a.setAttribute(l.name,p)),i.addActiveModule(u,p,h);var C=u+"-"+p;n?i.newModules[C]=h:i.currentModules[C]=h}}})}),Object.entries(this.currentModules).forEach(function(a){var l=X(a,2),c=l[0],f=l[1];if(n){var u=c.split("-"),v=u.shift(),h=u.pop();i.addActiveModule(v,h,f)}else i.initModule(f)})}},{key:"initModule",value:function(t){t.mInit(this.activeModules),t.init()}},{key:"addActiveModule",value:function(t,n,i){this.activeModules[t]?Object.assign(this.activeModules[t],Tt({},n,i)):this.activeModules[t]=Tt({},n,i)}},{key:"update",value:function(t){var n=this;this.init(this.app,t),Object.entries(this.currentModules).forEach(function(i){var r=X(i,2),o=r[0],a=r[1];a.mUpdate(n.activeModules)}),Object.entries(this.newModules).forEach(function(i){var r=X(i,2),o=r[0],a=r[1];n.initModule(a)}),Object.assign(this.currentModules,this.newModules)}},{key:"destroy",value:function(t){t?this.destroyScope(t):this.destroyModules()}},{key:"destroyScope",value:function(t){var n=this,i=t.querySelectorAll("*");i.forEach(function(r){Array.from(r.attributes).forEach(function(o){if(o.name.startsWith("data-module")){var a=o.value,l=o.name.split("-").splice(2),c=n.toCamel(l)+"-"+a,f=!1;n.currentModules[c]?f=!0:n.currentModules[n.toUpper(c)]&&(c=n.toUpper(c),f=!0),f&&(n.destroyModule(n.currentModules[c]),delete n.currentModules[c])}})}),this.activeModules={},this.newModules={}}},{key:"destroyModules",value:function(){var t=this;Object.entries(this.currentModules).forEach(function(n){var i=X(n,2),r=i[0],o=i[1];t.destroyModule(o)}),this.currentModules=[]}},{key:"destroyModule",value:function(t){t.mDestroy(),t.destroy()}},{key:"toCamel",value:function(t){var n=this;return t.reduce(function(i,r){return i+n.toUpper(r)})}},{key:"toUpper",value:function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}]),s}(),_t=Te;var vt={};me(vt,{Example:()=>$,GridHelper:()=>_,Load:()=>Z,Scroll:()=>it});var Dt="fonts"in document;function Ce(s,e){for(let[t,n]of Object.entries(e))switch(t){case"family":{if(G(s[t])!==n)return!1;break}case"weight":{if(s[t]!=n)return!1;break}default:{if(s[t]!==n)return!1;break}}return!0}function xe(s,e){let t=G(s.family);return G(t)===e||e.endsWith(G(t))&&(e.match(s.weight)||e.match(s.style)),!0}function Oe(s){let e=[];for(let t of document.fonts)Ce(t,s)&&e.push(t);return e}function _e(s){let e=[];for(let t of document.fonts)xe(t,s)&&e.push(t);return e}function Mt(s){Array.isArray(s)||(s=[s]);let e=new Set;return s.forEach(t=>{if(t)switch(typeof t){case"string":e.add(..._e(t));return;case"object":e.add(...Oe(t));return}throw new TypeError("Expected font query to be font shorthand or font reference")}),[...e]}function It(s,e=!1){return W(this,null,function*(){var t;if(((t=s.size)!=null?t:s.length)===0)throw new TypeError("Expected at least one font");return yield Le([...s],e)})}function Lt(s){return W(this,null,function*(){return yield(s.status==="unloaded"?s.load():s.loaded).then(e=>e,e=>s)})}function Le(s,e=!1){return W(this,null,function*(){e&&console.group("[loadFonts:API]",s.length,"/",document.fonts.size);let t=[];for(let n of s)n instanceof FontFace?(document.fonts.has(n)||document.fonts.add(n),t.push(Lt(n))):t.push(...Mt(n).map(i=>Lt(i)));return e&&console.groupEnd(),yield Promise.all(t)})}function G(s){return s.replace(/['"]+/g,"")}function Rt(s){return W(this,null,function*(){let e=Mt(s);return yield Promise.all(e.map(t=>t.loaded))})}var $=class extends B{constructor(s){super(s)}init(){Rt(lt).then(s=>this.onFontsLoaded(s))}onFontsLoaded(s){console.log("Example: Eager Fonts Loaded!",s)}};var _=class extends B{static get settings(){return{GUTTER:"var(--grid-gutter, 0)",MARGIN:"var(--grid-margin, 0)",COLOR:"rgba(255, 0, 0, .1)"}}constructor(e){super(e)}init(){this.setColumns(),this.setStyles(),this.bindEvents(),window.addEventListener("resize",this.onResize=()=>this.setColumns())}setColumns(){this.el.innerHTML="";let e=Number(window.getComputedStyle(this.el).getPropertyValue("--grid-columns")),t;for(var n=0;n<e;n++)t=document.createElement("div"),t.style.flex="1 1 0",t.style.backgroundColor=_.settings.COLOR,this.el.appendChild(t)}setStyles(){let e=this.el.style;e.zIndex="10000",e.position="fixed",e.top="0",e.left="0",e.display="flex",e.width="100%",e.height="100%",e.columnGap=_.settings.GUTTER,e.paddingLeft=`calc(${_.settings.MARGIN} + ${_.settings.GUTTER})`,e.paddingRight=`calc(${_.settings.MARGIN} + ${_.settings.GUTTER})`,e.pointerEvents="none",e.visibility="hidden"}bindEvents(){let e=!1,t=!1;document.addEventListener("keydown",n=>{n.key=="Control"?e=!0:e&&n.key=="g"&&(t?this.el.style.visibility="visible":this.el.style.visibility="hidden",t=!t)}),document.addEventListener("keyup",n=>{n.key=="Control"&&(e=!1)})}destroy(){window.removeEventListener("resize",this.onResize)}};function De(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function Pt(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function Me(s,e,t){return e&&Pt(s.prototype,e),t&&Pt(s,t),s}function Ie(s,e){return Re(s)||Pe(s,e)||Be(s,e)||je()}function Re(s){if(Array.isArray(s))return s}function Pe(s,e){var t=s==null?null:typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(t!=null){var n=[],i=!0,r=!1,o,a;try{for(t=t.call(s);!(i=(o=t.next()).done)&&(n.push(o.value),!(e&&n.length===e));i=!0);}catch(l){r=!0,a=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(r)throw a}}return n}}function Be(s,e){if(!!s){if(typeof s=="string")return Bt(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Bt(s,e)}}function Bt(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=s[t];return n}function je(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var We=function(){function s(e){De(this,s),this.defaults={name:"load",loadingClass:"is-loading",loadedClass:"is-loaded",readyClass:"is-ready",transitionsPrefix:"is-",transitionsHistory:!0,enterDelay:0,exitDelay:0,loadedDelay:0,isLoaded:!1,isEntered:!1,isUrl:!1,transitionContainer:null,popstateIgnore:!1},Object.assign(this,this.defaults,e),this.options=e,this.namespace="modular",this.html=document.documentElement,this.href=window.location.href,this.container="data-"+this.name+"-container",this.subContainer=!1,this.prevTransition=null,this.loadAttributes=["src","srcset","style","href"],this.isInserted=!1,this.isLoading=!1,this.enterTimeout=!1,this.controller=new AbortController,this.classContainer=this.html,this.isChrome=navigator.userAgent.indexOf("Chrome")!=-1,this.init()}return Me(s,[{key:"init",value:function(){var t=this;window.addEventListener("popstate",function(n){return t.checkState(n)},!1),this.html.addEventListener("click",function(n){return t.checkClick(n)},!1),this.loadEls(document)}},{key:"checkClick",value:function(t){if(!t.ctrlKey&&!t.metaKey)for(var n=t.target;n&&n!==document;){if(n.matches("a")&&n.getAttribute("download")==null){var i=n.getAttribute("href");!i.startsWith("#")&&!i.startsWith("mailto:")&&!i.startsWith("tel:")&&(t.preventDefault(),this.reset(),this.getClickOptions(n));break}n=n.parentNode}}},{key:"checkState",value:function(){typeof this.popstateIgnore=="string"&&window.location.href.indexOf(this.popstateIgnore)>-1||(this.reset(),this.getStateOptions())}},{key:"reset",value:function(){this.isLoading&&(this.controller.abort(),this.isLoading=!1,this.controller=new AbortController),window.clearTimeout(this.enterTimeout),this.isInserted&&this.removeContainer(),this.classContainer=this.html,Object.assign(this,this.defaults,this.options)}},{key:"getClickOptions",value:function(t){this.transition=t.getAttribute("data-"+this.name),this.isUrl=t.getAttribute("data-"+this.name+"-url");var n=t.getAttribute("href"),i=t.getAttribute("target");if(i=="_blank"){window.open(n,"_blank");return}if(this.transition=="false"){window.location=n;return}this.setOptions(n,!0)}},{key:"getStateOptions",value:function(){this.transitionsHistory?this.transition=history.state:this.transition=!1;var t=window.location.href;this.setOptions(t)}},{key:"goTo",value:function(t,n,i){this.reset(),this.transition=n,this.isUrl=i,this.setOptions(t,!0)}},{key:"setOptions",value:function(t,n){var i="["+this.container+"]",r;this.transition&&this.transition!="true"&&(this.transitionContainer="["+this.container+'="'+this.transition+'"]',this.loadingClass=this.transitions[this.transition].loadingClass||this.loadingClass,this.loadedClass=this.transitions[this.transition].loadedClass||this.loadedClass,this.readyClass=this.transitions[this.transition].readyClass||this.readyClass,this.transitionsPrefix=this.transitions[this.transition].transitionsPrefix||this.transitionsPrefix,this.enterDelay=this.transitions[this.transition].enterDelay||this.enterDelay,this.exitDelay=this.transitions[this.transition].exitDelay||this.exitDelay,this.loadedDelay=this.transitions[this.transition].loadedDelay||this.loadedDelay,r=document.querySelector(this.transitionContainer)),r?(i=this.transitionContainer,this.oldContainer=r,this.classContainer=this.oldContainer.parentNode,this.subContainer||history.replaceState(this.transition,null,this.href),this.subContainer=!0):(this.oldContainer=document.querySelector(i),this.subContainer&&history.replaceState(this.prevTransition,null,this.href),this.subContainer=!1),this.href=t,this.parentContainer=this.oldContainer.parentNode,this.isUrl===""||this.isUrl!=null&&this.isUrl!="false"&&this.isUrl!=!1?history.pushState(this.transition,null,t):(this.oldContainer.classList.add("is-old"),this.setLoading(),this.startEnterDelay(),this.loadHref(t,i,n))}},{key:"setLoading",value:function(){this.classContainer.classList.remove(this.loadedClass,this.readyClass),this.classContainer.classList.add(this.loadingClass),this.classContainer.classList.remove(this.transitionsPrefix+this.prevTransition),this.transition&&this.classContainer.classList.add(this.transitionsPrefix+this.transition),this.subContainer||(this.prevTransition=this.transition);var t=new Event(this.namespace+"loading");window.dispatchEvent(t)}},{key:"startEnterDelay",value:function(){var t=this;this.enterTimeout=window.setTimeout(function(){t.isEntered=!0,t.isLoaded&&t.transitionContainers()},this.enterDelay)}},{key:"loadHref",value:function(t,n,i){var r=this;this.isLoading=!0;var o=this.controller.signal;fetch(t,{signal:o}).then(function(a){return a.text()}).then(function(a){i&&history.pushState(r.transition,null,t);var l=new DOMParser;r.data=l.parseFromString(a,"text/html"),r.newContainer=r.data.querySelector(n),r.newContainer.classList.add("is-new"),r.parentNewContainer=r.newContainer.parentNode,r.hideContainer(),r.parentContainer.insertBefore(r.newContainer,r.oldContainer),r.isInserted=!0,r.setSvgs(),r.isLoaded=!0,r.isEntered&&r.transitionContainers(),r.loadEls(r.newContainer),r.isLoading=!1}).catch(function(a){window.location=t})}},{key:"transitionContainers",value:function(){var t=this;this.setAttributes(),this.showContainer(),this.setLoaded(),setTimeout(function(){t.removeContainer(),t.setReady()},this.exitDelay)}},{key:"setSvgs",value:function(){if(this.isChrome){var t=this.newContainer.querySelectorAll("use");t.length&&t.forEach(function(n){var i=n.getAttribute("xlink:href");if(i)n.parentNode.innerHTML='<use xlink:href="'+i+'"></use>';else{var r=n.getAttribute("href");r&&(n.parentNode.innerHTML='<use href="'+r+'"></use>')}})}}},{key:"setAttributes",value:function(){var t=this,n=this.data.getElementsByTagName("title")[0],i=this.data.head.querySelector('meta[name="description"]'),r=document.head.querySelector('meta[name="description"]'),o,a;this.subContainer?(a=this.parentNewContainer,o=document.querySelector(this.transitionContainer).parentNode):(a=this.data.querySelector("html"),o=document.querySelector("html"));var l=Object.assign({},a.dataset);n&&(document.title=n.innerText),r&&i&&r.setAttribute("content",i.getAttribute("content")),l&&Object.entries(l).forEach(function(c){var f=Ie(c,2),u=f[0],v=f[1];o.setAttribute("data-"+t.toDash(u),v)})}},{key:"toDash",value:function(t){return t.split(/(?=[A-Z])/).join("-").toLowerCase()}},{key:"hideContainer",value:function(){this.newContainer.style.visibility="hidden",this.newContainer.style.height=0,this.newContainer.style.overflow="hidden"}},{key:"showContainer",value:function(){this.newContainer.style.visibility="",this.newContainer.style.height="",this.newContainer.style.overflow=""}},{key:"loadEls",value:function(t){var n=this,i=[];this.loadAttributes.forEach(function(r){var o="data-"+n.name+"-"+r,a=t.querySelectorAll("["+o+"]");a.length&&a.forEach(function(l){var c=l.getAttribute(o);if(l.setAttribute(r,c),r=="src"||r=="srcset"){var f=new Promise(function(u){l.onload=function(){return u(l)}});i.push(f)}})}),Promise.all(i).then(function(r){var o=new Event(n.namespace+"images");window.dispatchEvent(o)})}},{key:"setLoaded",value:function(){var t=this;this.classContainer.classList.remove(this.loadingClass),setTimeout(function(){t.classContainer.classList.add(t.loadedClass)},this.loadedDelay);var n=new Event(this.namespace+"loaded");window.dispatchEvent(n)}},{key:"removeContainer",value:function(){this.parentContainer.removeChild(this.oldContainer),this.newContainer.classList.remove("is-new"),this.isInserted=!1}},{key:"setReady",value:function(){this.classContainer.classList.add(this.readyClass);var t=new Event(this.namespace+"ready");window.dispatchEvent(t)}},{key:"on",value:function(t,n){var i=this;window.addEventListener(this.namespace+t,function(){switch(t){case"loading":return n(i.transition,i.oldContainer);case"loaded":return n(i.transition,i.oldContainer,i.newContainer);case"ready":return n(i.transition,i.newContainer);default:return n()}},!1)}}]),s}(),jt=We;var Z=class extends B{constructor(s){super(s)}init(){new jt({enterDelay:0,transitions:{customTransition:{}}}).on("loaded",(e,t,n)=>{this.call("destroy",t,"app"),this.call("update",n,"app")})}};var He=s=>({url:s.src,width:s.naturalWidth,height:s.naturalHeight,ratio:s.naturalWidth/s.naturalHeight}),ze=(s,e={})=>new Promise((t,n)=>{let i=new Image;e.crossOrigin&&(i.crossOrigin=e.crossOrigin);let r=()=>{t(kt({element:i},He(i)))};i.decode?(i.src=s,i.decode().then(r).catch(o=>{n(o)})):(i.onload=r,i.onerror=o=>{n(o)},i.src=s)}),Wt=[],Ht=(s,e,t)=>W(void 0,null,function*(){let n=e||s.dataset.src,i=Wt.find(r=>r.url===n);if(!i){if(i=yield ze(n),!i.url)return;Wt.push(i)}s.src!==n&&(s.tagName==="IMG"?s.src=i.url:s.style.backgroundImage=`url(${i.url})`,requestAnimationFrame(()=>{let r=s.closest(".c-lazy");r&&(r.classList.add("-lazy-loaded"),r.style.backgroundImage=""),s.classList.add("-lazy-loaded"),t==null||t()}))});function tt(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function zt(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function et(s,e,t){return e&&zt(s.prototype,e),t&&zt(s,t),s}function Ne(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Nt(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(s);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),t.push.apply(t,n)}return t}function ct(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(t),!0).forEach(function(n){Ne(s,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):Nt(Object(t)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(t,n))})}return s}function Ft(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),e&&ft(s,e)}function M(s){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},M(s)}function ft(s,e){return ft=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ft(s,e)}function Ye(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function Ut(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Fe(s,e){return e&&(typeof e=="object"||typeof e=="function")?e:Ut(s)}function Vt(s){var e=Ye();return function(){var n=M(s),i;if(e){var r=M(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Fe(this,i)}}function Ue(s,e){for(;!Object.prototype.hasOwnProperty.call(s,e)&&(s=M(s),s!==null););return s}function P(s,e,t){return typeof Reflect!="undefined"&&Reflect.get?P=Reflect.get:P=function(i,r,o){var a=Ue(i,r);if(!!a){var l=Object.getOwnPropertyDescriptor(a,r);return l.get?l.get.call(o):l.value}},P(s,e,t||s)}function z(s,e){return Xe(s)||Ge(s,e)||qt(s,e)||Ze()}function Ve(s){return qe(s)||Ke(s)||qt(s)||$e()}function qe(s){if(Array.isArray(s))return dt(s)}function Xe(s){if(Array.isArray(s))return s}function Ke(s){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(s))return Array.from(s)}function Ge(s,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(s)))){var t=[],n=!0,i=!1,r=void 0;try{for(var o=s[Symbol.iterator](),a;!(n=(a=o.next()).done)&&(t.push(a.value),!(e&&t.length===e));n=!0);}catch(l){i=!0,r=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw r}}return t}}function qt(s,e){if(!!s){if(typeof s=="string")return dt(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dt(s,e)}}function dt(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=s[t];return n}function $e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var N={el:document,name:"scroll",offset:[0,0],repeat:!1,smooth:!1,initPosition:{x:0,y:0},direction:"vertical",gestureDirection:"vertical",reloadOnContextChange:!1,lerp:.1,class:"is-inview",scrollbarContainer:!1,scrollbarClass:"c-scrollbar",scrollingClass:"has-scroll-scrolling",draggingClass:"has-scroll-dragging",smoothClass:"has-scroll-smooth",initClass:"has-scroll-init",getSpeed:!1,getDirection:!1,scrollFromAnywhere:!1,multiplier:1,firefoxMultiplier:50,touchMultiplier:2,resetNativeScroll:!0,tablet:{smooth:!1,direction:"vertical",gestureDirection:"vertical",breakpoint:1024},smartphone:{smooth:!1,direction:"vertical",gestureDirection:"vertical"}},Xt=function(){function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tt(this,s),Object.assign(this,N,e),this.smartphone=N.smartphone,e.smartphone&&Object.assign(this.smartphone,e.smartphone),this.tablet=N.tablet,e.tablet&&Object.assign(this.tablet,e.tablet),this.namespace="locomotive",this.html=document.documentElement,this.windowHeight=window.innerHeight,this.windowWidth=window.innerWidth,this.windowMiddle={x:this.windowWidth/2,y:this.windowHeight/2},this.els={},this.currentElements={},this.listeners={},this.hasScrollTicking=!1,this.hasCallEventSet=!1,this.checkScroll=this.checkScroll.bind(this),this.checkResize=this.checkResize.bind(this),this.checkEvent=this.checkEvent.bind(this),this.instance={scroll:{x:0,y:0},limit:{x:this.html.offsetWidth,y:this.html.offsetHeight},currentElements:this.currentElements},this.isMobile?this.isTablet?this.context="tablet":this.context="smartphone":this.context="desktop",this.isMobile&&(this.direction=this[this.context].direction),this.direction==="horizontal"?this.directionAxis="x":this.directionAxis="y",this.getDirection&&(this.instance.direction=null),this.getDirection&&(this.instance.speed=0),this.html.classList.add(this.initClass),window.addEventListener("resize",this.checkResize,!1)}return et(s,[{key:"init",value:function(){this.initEvents()}},{key:"checkScroll",value:function(){this.dispatchScroll()}},{key:"checkResize",value:function(){var t=this;this.resizeTick||(this.resizeTick=!0,requestAnimationFrame(function(){t.resize(),t.resizeTick=!1}))}},{key:"resize",value:function(){}},{key:"checkContext",value:function(){if(!!this.reloadOnContextChange){this.isMobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||this.windowWidth<this.tablet.breakpoint,this.isTablet=this.isMobile&&this.windowWidth>=this.tablet.breakpoint;var t=this.context;if(this.isMobile?this.isTablet?this.context="tablet":this.context="smartphone":this.context="desktop",t!=this.context){var n=t=="desktop"?this.smooth:this[t].smooth,i=this.context=="desktop"?this.smooth:this[this.context].smooth;n!=i&&window.location.reload()}}}},{key:"initEvents",value:function(){var t=this;this.scrollToEls=this.el.querySelectorAll("[data-".concat(this.name,"-to]")),this.setScrollTo=this.setScrollTo.bind(this),this.scrollToEls.forEach(function(n){n.addEventListener("click",t.setScrollTo,!1)})}},{key:"setScrollTo",value:function(t){t.preventDefault(),this.scrollTo(t.currentTarget.getAttribute("data-".concat(this.name,"-href"))||t.currentTarget.getAttribute("href"),{offset:t.currentTarget.getAttribute("data-".concat(this.name,"-offset"))})}},{key:"addElements",value:function(){}},{key:"detectElements",value:function(t){var n=this,i=this.instance.scroll.y,r=i+this.windowHeight,o=this.instance.scroll.x,a=o+this.windowWidth;Object.entries(this.els).forEach(function(l){var c=z(l,2),f=c[0],u=c[1];if(u&&(!u.inView||t)&&(n.direction==="horizontal"?a>=u.left&&o<u.right&&n.setInView(u,f):r>=u.top&&i<u.bottom&&n.setInView(u,f)),u&&u.inView)if(n.direction==="horizontal"){var v=u.right-u.left;u.progress=(n.instance.scroll.x-(u.left-n.windowWidth))/(v+n.windowWidth),(a<u.left||o>u.right)&&n.setOutOfView(u,f)}else{var h=u.bottom-u.top;u.progress=(n.instance.scroll.y-(u.top-n.windowHeight))/(h+n.windowHeight),(r<u.top||i>u.bottom)&&n.setOutOfView(u,f)}}),this.hasScrollTicking=!1}},{key:"setInView",value:function(t,n){this.els[n].inView=!0,t.el.classList.add(t.class),this.currentElements[n]=t,t.call&&this.hasCallEventSet&&(this.dispatchCall(t,"enter"),t.repeat||(this.els[n].call=!1))}},{key:"setOutOfView",value:function(t,n){var i=this;this.els[n].inView=!1,Object.keys(this.currentElements).forEach(function(r){r===n&&delete i.currentElements[r]}),t.call&&this.hasCallEventSet&&this.dispatchCall(t,"exit"),t.repeat&&t.el.classList.remove(t.class)}},{key:"dispatchCall",value:function(t,n){this.callWay=n,this.callValue=t.call.split(",").map(function(r){return r.trim()}),this.callObj=t,this.callValue.length==1&&(this.callValue=this.callValue[0]);var i=new Event(this.namespace+"call");this.el.dispatchEvent(i)}},{key:"dispatchScroll",value:function(){var t=new Event(this.namespace+"scroll");this.el.dispatchEvent(t)}},{key:"setEvents",value:function(t,n){this.listeners[t]||(this.listeners[t]=[]);var i=this.listeners[t];i.push(n),i.length===1&&this.el.addEventListener(this.namespace+t,this.checkEvent,!1),t==="call"&&(this.hasCallEventSet=!0,this.detectElements(!0))}},{key:"unsetEvents",value:function(t,n){if(!!this.listeners[t]){var i=this.listeners[t],r=i.indexOf(n);r<0||(i.splice(r,1),i.index===0&&this.el.removeEventListener(this.namespace+t,this.checkEvent,!1))}}},{key:"checkEvent",value:function(t){var n=this,i=t.type.replace(this.namespace,""),r=this.listeners[i];!r||r.length===0||r.forEach(function(o){switch(i){case"scroll":return o(n.instance);case"call":return o(n.callValue,n.callWay,n.callObj);default:return o()}})}},{key:"startScroll",value:function(){}},{key:"stopScroll",value:function(){}},{key:"setScroll",value:function(t,n){this.instance.scroll={x:0,y:0}}},{key:"destroy",value:function(){var t=this;window.removeEventListener("resize",this.checkResize,!1),Object.keys(this.listeners).forEach(function(n){t.el.removeEventListener(t.namespace+n,t.checkEvent,!1)}),this.listeners={},this.scrollToEls.forEach(function(n){n.removeEventListener("click",t.setScrollTo,!1)}),this.html.classList.remove(this.initClass)}}]),s}(),Je=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Kt(s,e){return e={exports:{}},s(e,e.exports),e.exports}var Gt=Kt(function(s,e){(function(){function t(){var n=window,i=document;if("scrollBehavior"in i.documentElement.style&&n.__forceSmoothScrollPolyfill__!==!0)return;var r=n.HTMLElement||n.Element,o=468,a={scroll:n.scroll||n.scrollTo,scrollBy:n.scrollBy,elementScroll:r.prototype.scroll||u,scrollIntoView:r.prototype.scrollIntoView},l=n.performance&&n.performance.now?n.performance.now.bind(n.performance):Date.now;function c(d){var m=["MSIE ","Trident/","Edge/"];return new RegExp(m.join("|")).test(d)}var f=c(n.navigator.userAgent)?1:0;function u(d,m){this.scrollLeft=d,this.scrollTop=m}function v(d){return .5*(1-Math.cos(Math.PI*d))}function h(d){if(d===null||typeof d!="object"||d.behavior===void 0||d.behavior==="auto"||d.behavior==="instant")return!0;if(typeof d=="object"&&d.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+d.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(d,m){if(m==="Y")return d.clientHeight+f<d.scrollHeight;if(m==="X")return d.clientWidth+f<d.scrollWidth}function C(d,m){var b=n.getComputedStyle(d,null)["overflow"+m];return b==="auto"||b==="scroll"}function D(d){var m=p(d,"Y")&&C(d,"Y"),b=p(d,"X")&&C(d,"X");return m||b}function T(d){for(;d!==i.body&&D(d)===!1;)d=d.parentNode||d.host;return d}function k(d){var m=l(),b,y,A,g=(m-d.startTime)/o;g=g>1?1:g,b=v(g),y=d.startX+(d.x-d.startX)*b,A=d.startY+(d.y-d.startY)*b,d.method.call(d.scrollable,y,A),(y!==d.x||A!==d.y)&&n.requestAnimationFrame(k.bind(n,d))}function w(d,m,b){var y,A,g,S,j=l();d===i.body?(y=n,A=n.scrollX||n.pageXOffset,g=n.scrollY||n.pageYOffset,S=a.scroll):(y=d,A=d.scrollLeft,g=d.scrollTop,S=u),k({scrollable:y,method:S,startTime:j,startX:A,startY:g,x:m,y:b})}n.scroll=n.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){a.scroll.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:n.scrollY||n.pageYOffset);return}w.call(n,i.body,arguments[0].left!==void 0?~~arguments[0].left:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:n.scrollY||n.pageYOffset)}},n.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])){a.scrollBy.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}w.call(n,i.body,~~arguments[0].left+(n.scrollX||n.pageXOffset),~~arguments[0].top+(n.scrollY||n.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");a.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}var d=arguments[0].left,m=arguments[0].top;w.call(this,this,typeof d=="undefined"?this.scrollLeft:~~d,typeof m=="undefined"?this.scrollTop:~~m)}},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){a.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(h(arguments[0])===!0){a.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}var d=T(this),m=d.getBoundingClientRect(),b=this.getBoundingClientRect();d!==i.body?(w.call(this,d,d.scrollLeft+b.left-m.left,d.scrollTop+b.top-m.top),n.getComputedStyle(d).position!=="fixed"&&n.scrollBy({left:m.left,top:m.top,behavior:"smooth"})):n.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}s.exports={polyfill:t}})()}),Ni=Gt.polyfill,Qe=function(s){Ft(t,s);var e=Vt(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return tt(this,t),n=e.call(this,i),n.resetNativeScroll&&(history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0)),window.addEventListener("scroll",n.checkScroll,!1),window.smoothscrollPolyfill===void 0&&(window.smoothscrollPolyfill=Gt,window.smoothscrollPolyfill.polyfill()),n}return et(t,[{key:"init",value:function(){this.instance.scroll.y=window.pageYOffset,this.addElements(),this.detectElements(),P(M(t.prototype),"init",this).call(this)}},{key:"checkScroll",value:function(){var i=this;P(M(t.prototype),"checkScroll",this).call(this),this.getDirection&&this.addDirection(),this.getSpeed&&(this.addSpeed(),this.speedTs=Date.now()),this.instance.scroll.y=window.pageYOffset,Object.entries(this.els).length&&(this.hasScrollTicking||(requestAnimationFrame(function(){i.detectElements()}),this.hasScrollTicking=!0))}},{key:"addDirection",value:function(){window.pageYOffset>this.instance.scroll.y?this.instance.direction!=="down"&&(this.instance.direction="down"):window.pageYOffset<this.instance.scroll.y&&this.instance.direction!=="up"&&(this.instance.direction="up")}},{key:"addSpeed",value:function(){window.pageYOffset!=this.instance.scroll.y?this.instance.speed=(window.pageYOffset-this.instance.scroll.y)/Math.max(1,Date.now()-this.speedTs):this.instance.speed=0}},{key:"resize",value:function(){Object.entries(this.els).length&&(this.windowHeight=window.innerHeight,this.updateElements())}},{key:"addElements",value:function(){var i=this;this.els={};var r=this.el.querySelectorAll("[data-"+this.name+"]");r.forEach(function(o,a){var l=o.getBoundingClientRect(),c=o.dataset[i.name+"Class"]||i.class,f=typeof o.dataset[i.name+"Id"]=="string"?o.dataset[i.name+"Id"]:a,u,v,h=typeof o.dataset[i.name+"Offset"]=="string"?o.dataset[i.name+"Offset"].split(","):i.offset,p=o.dataset[i.name+"Repeat"],C=o.dataset[i.name+"Call"],D=o.dataset[i.name+"Target"],T;D!==void 0?T=document.querySelector("".concat(D)):T=o;var k=T.getBoundingClientRect();u=k.top+i.instance.scroll.y,v=k.left+i.instance.scroll.x;var w=u+T.offsetHeight,d=v+T.offsetWidth;p=="false"?p=!1:p!=null?p=!0:p=i.repeat;var m=i.getRelativeOffset(h);u=u+m[0],w=w-m[1];var b={el:o,targetEl:T,id:f,class:c,top:u,bottom:w,left:v,right:d,offset:h,progress:0,repeat:p,inView:!1,call:C};i.els[f]=b,o.classList.contains(c)&&i.setInView(i.els[f],f)})}},{key:"updateElements",value:function(){var i=this;Object.entries(this.els).forEach(function(r){var o=z(r,2),a=o[0],l=o[1],c=l.targetEl.getBoundingClientRect().top+i.instance.scroll.y,f=c+l.targetEl.offsetHeight,u=i.getRelativeOffset(l.offset);i.els[a].top=c+u[0],i.els[a].bottom=f-u[1]}),this.hasScrollTicking=!1}},{key:"getRelativeOffset",value:function(i){var r=[0,0];if(i)for(var o=0;o<i.length;o++)typeof i[o]=="string"?i[o].includes("%")?r[o]=parseInt(i[o].replace("%","")*this.windowHeight/100):r[o]=parseInt(i[o]):r[o]=i[o];return r}},{key:"scrollTo",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=parseInt(r.offset)||0,a=r.callback?r.callback:!1;if(typeof i=="string"){if(i==="top")i=this.html;else if(i==="bottom")i=this.html.offsetHeight-window.innerHeight;else if(i=document.querySelector(i),!i)return}else if(typeof i=="number")i=parseInt(i);else if(!(i&&i.tagName)){console.warn("`target` parameter is not valid");return}typeof i!="number"?o=i.getBoundingClientRect().top+o+this.instance.scroll.y:o=i+o;var l=function(){return parseInt(window.pageYOffset)===parseInt(o)};if(a)if(l()){a();return}else{var c=function f(){l()&&(window.removeEventListener("scroll",f),a())};window.addEventListener("scroll",c)}window.scrollTo({top:o,behavior:r.duration===0?"auto":"smooth"})}},{key:"update",value:function(){this.addElements(),this.detectElements()}},{key:"destroy",value:function(){P(M(t.prototype),"destroy",this).call(this),window.removeEventListener("scroll",this.checkScroll,!1)}}]),t}(Xt);var Yt=Object.getOwnPropertySymbols,ti=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;function ii(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function ni(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(r){i[r]=r}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(r){return!1}}var si=ni()?Object.assign:function(s,e){for(var t,n=ii(s),i,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)ti.call(t,o)&&(n[o]=t[o]);if(Yt){i=Yt(t);for(var a=0;a<i.length;a++)ei.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n};function $t(){}$t.prototype={on:function(s,e,t){var n=this.e||(this.e={});return(n[s]||(n[s]=[])).push({fn:e,ctx:t}),this},once:function(s,e,t){var n=this;function i(){n.off(s,i),e.apply(t,arguments)}return i._=e,this.on(s,i,t)},emit:function(s){var e=[].slice.call(arguments,1),t=((this.e||(this.e={}))[s]||[]).slice(),n=0,i=t.length;for(n;n<i;n++)t[n].fn.apply(t[n].ctx,e);return this},off:function(s,e){var t=this.e||(this.e={}),n=t[s],i=[];if(n&&e)for(var r=0,o=n.length;r<o;r++)n[r].fn!==e&&n[r].fn._!==e&&i.push(n[r]);return i.length?t[s]=i:delete t[s],this}};var ri=$t,oi=Kt(function(s,e){(function(){var t;t=e!==null?e:this,t.Lethargy=function(){function n(i,r,o,a){this.stability=i!=null?Math.abs(i):8,this.sensitivity=r!=null?1+Math.abs(r):100,this.tolerance=o!=null?1+Math.abs(o):1.1,this.delay=a!=null?a:150,this.lastUpDeltas=function(){var l,c,f;for(f=[],l=1,c=this.stability*2;1<=c?l<=c:l>=c;1<=c?l++:l--)f.push(null);return f}.call(this),this.lastDownDeltas=function(){var l,c,f;for(f=[],l=1,c=this.stability*2;1<=c?l<=c:l>=c;1<=c?l++:l--)f.push(null);return f}.call(this),this.deltasTimestamp=function(){var l,c,f;for(f=[],l=1,c=this.stability*2;1<=c?l<=c:l>=c;1<=c?l++:l--)f.push(null);return f}.call(this)}return n.prototype.check=function(i){var r;return i=i.originalEvent||i,i.wheelDelta!=null?r=i.wheelDelta:i.deltaY!=null?r=i.deltaY*-40:(i.detail!=null||i.detail===0)&&(r=i.detail*-40),this.deltasTimestamp.push(Date.now()),this.deltasTimestamp.shift(),r>0?(this.lastUpDeltas.push(r),this.lastUpDeltas.shift(),this.isInertia(1)):(this.lastDownDeltas.push(r),this.lastDownDeltas.shift(),this.isInertia(-1))},n.prototype.isInertia=function(i){var r,o,a,l,c,f,u;return r=i===-1?this.lastDownDeltas:this.lastUpDeltas,r[0]===null?i:this.deltasTimestamp[this.stability*2-2]+this.delay>Date.now()&&r[0]===r[this.stability*2-1]?!1:(a=r.slice(0,this.stability),o=r.slice(this.stability,this.stability*2),u=a.reduce(function(v,h){return v+h}),c=o.reduce(function(v,h){return v+h}),f=u/a.length,l=c/o.length,Math.abs(f)<Math.abs(l*this.tolerance)&&this.sensitivity<Math.abs(l)?i:!1)},n.prototype.showLastUpDeltas=function(){return this.lastUpDeltas},n.prototype.showLastDownDeltas=function(){return this.lastDownDeltas},n}()}).call(Je)}),x=function(){return{hasWheelEvent:"onwheel"in document,hasMouseWheelEvent:"onmousewheel"in document,hasTouch:"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,hasTouchWin:navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints>1,hasPointer:!!window.navigator.msPointerEnabled,hasKeyDown:"onkeydown"in document,isFirefox:navigator.userAgent.indexOf("Firefox")>-1}}(),ai=Object.prototype.toString,li=Object.prototype.hasOwnProperty,ci=function(s){if(!s)return console.warn("bindAll requires at least one argument.");var e=Array.prototype.slice.call(arguments,1);if(e.length===0)for(var t in s)li.call(s,t)&&typeof s[t]=="function"&&ai.call(s[t])=="[object Function]"&&e.push(t);for(var n=0;n<e.length;n++){var i=e[n];s[i]=hi(s[i],s)}};function hi(s,e){return function(){return s.apply(e,arguments)}}var ui=oi.Lethargy,H="virtualscroll",fi=O,F={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32};function O(s){ci(this,"_onWheel","_onMouseWheel","_onTouchStart","_onTouchMove","_onKeyDown"),this.el=window,s&&s.el&&(this.el=s.el,delete s.el),this.options=si({mouseMultiplier:1,touchMultiplier:2,firefoxMultiplier:15,keyStep:120,preventTouch:!1,unpreventTouchClass:"vs-touchmove-allowed",limitInertia:!1,useKeyboard:!0,useTouch:!0},s),this.options.limitInertia&&(this._lethargy=new ui),this._emitter=new ri,this._event={y:0,x:0,deltaX:0,deltaY:0},this.touchStartX=null,this.touchStartY=null,this.bodyTouchAction=null,this.options.passive!==void 0&&(this.listenerOptions={passive:this.options.passive})}O.prototype._notify=function(s){var e=this._event;e.x+=e.deltaX,e.y+=e.deltaY,this._emitter.emit(H,{x:e.x,y:e.y,deltaX:e.deltaX,deltaY:e.deltaY,originalEvent:s})};O.prototype._onWheel=function(s){var e=this.options;if(!(this._lethargy&&this._lethargy.check(s)===!1)){var t=this._event;t.deltaX=s.wheelDeltaX||s.deltaX*-1,t.deltaY=s.wheelDeltaY||s.deltaY*-1,x.isFirefox&&s.deltaMode==1&&(t.deltaX*=e.firefoxMultiplier,t.deltaY*=e.firefoxMultiplier),t.deltaX*=e.mouseMultiplier,t.deltaY*=e.mouseMultiplier,this._notify(s)}};O.prototype._onMouseWheel=function(s){if(!(this.options.limitInertia&&this._lethargy.check(s)===!1)){var e=this._event;e.deltaX=s.wheelDeltaX?s.wheelDeltaX:0,e.deltaY=s.wheelDeltaY?s.wheelDeltaY:s.wheelDelta,this._notify(s)}};O.prototype._onTouchStart=function(s){var e=s.targetTouches?s.targetTouches[0]:s;this.touchStartX=e.pageX,this.touchStartY=e.pageY};O.prototype._onTouchMove=function(s){var e=this.options;e.preventTouch&&!s.target.classList.contains(e.unpreventTouchClass)&&s.preventDefault();var t=this._event,n=s.targetTouches?s.targetTouches[0]:s;t.deltaX=(n.pageX-this.touchStartX)*e.touchMultiplier,t.deltaY=(n.pageY-this.touchStartY)*e.touchMultiplier,this.touchStartX=n.pageX,this.touchStartY=n.pageY,this._notify(s)};O.prototype._onKeyDown=function(s){var e=this._event;e.deltaX=e.deltaY=0;var t=window.innerHeight-40;switch(s.keyCode){case F.LEFT:case F.UP:e.deltaY=this.options.keyStep;break;case F.RIGHT:case F.DOWN:e.deltaY=-this.options.keyStep;break;case s.shiftKey:e.deltaY=t;break;case F.SPACE:e.deltaY=-t;break;default:return}this._notify(s)};O.prototype._bind=function(){x.hasWheelEvent&&this.el.addEventListener("wheel",this._onWheel,this.listenerOptions),x.hasMouseWheelEvent&&this.el.addEventListener("mousewheel",this._onMouseWheel,this.listenerOptions),x.hasTouch&&this.options.useTouch&&(this.el.addEventListener("touchstart",this._onTouchStart,this.listenerOptions),this.el.addEventListener("touchmove",this._onTouchMove,this.listenerOptions)),x.hasPointer&&x.hasTouchWin&&(this.bodyTouchAction=document.body.style.msTouchAction,document.body.style.msTouchAction="none",this.el.addEventListener("MSPointerDown",this._onTouchStart,!0),this.el.addEventListener("MSPointerMove",this._onTouchMove,!0)),x.hasKeyDown&&this.options.useKeyboard&&document.addEventListener("keydown",this._onKeyDown)};O.prototype._unbind=function(){x.hasWheelEvent&&this.el.removeEventListener("wheel",this._onWheel),x.hasMouseWheelEvent&&this.el.removeEventListener("mousewheel",this._onMouseWheel),x.hasTouch&&(this.el.removeEventListener("touchstart",this._onTouchStart),this.el.removeEventListener("touchmove",this._onTouchMove)),x.hasPointer&&x.hasTouchWin&&(document.body.style.msTouchAction=this.bodyTouchAction,this.el.removeEventListener("MSPointerDown",this._onTouchStart,!0),this.el.removeEventListener("MSPointerMove",this._onTouchMove,!0)),x.hasKeyDown&&this.options.useKeyboard&&document.removeEventListener("keydown",this._onKeyDown)};O.prototype.on=function(s,e){this._emitter.on(H,s,e);var t=this._emitter.e;t&&t[H]&&t[H].length===1&&this._bind()};O.prototype.off=function(s,e){this._emitter.off(H,s,e);var t=this._emitter.e;(!t[H]||t[H].length<=0)&&this._unbind()};O.prototype.reset=function(){var s=this._event;s.x=0,s.y=0};O.prototype.destroy=function(){this._emitter.off(),this._unbind()};function ht(s,e,t){return(1-t)*s+t*e}function L(s){var e={};if(!!window.getComputedStyle){var t=getComputedStyle(s),n=t.transform||t.webkitTransform||t.mozTransform,i=n.match(/^matrix3d\((.+)\)$/);return i?(e.x=i?parseFloat(i[1].split(", ")[12]):0,e.y=i?parseFloat(i[1].split(", ")[13]):0):(i=n.match(/^matrix\((.+)\)$/),e.x=i?parseFloat(i[1].split(", ")[4]):0,e.y=i?parseFloat(i[1].split(", ")[5]):0),e}}function ut(s){for(var e=[];s&&s!==document;s=s.parentNode)e.push(s);return e}var di=4,vi=.001,mi=1e-7,pi=10,U=11,J=1/(U-1),yi=typeof Float32Array=="function";function Zt(s,e){return 1-3*e+3*s}function Jt(s,e){return 3*e-6*s}function Qt(s){return 3*s}function Q(s,e,t){return((Zt(e,t)*s+Jt(e,t))*s+Qt(e))*s}function te(s,e,t){return 3*Zt(e,t)*s*s+2*Jt(e,t)*s+Qt(e)}function gi(s,e,t,n,i){var r,o,a=0;do o=e+(t-e)/2,r=Q(o,n,i)-s,r>0?t=o:e=o;while(Math.abs(r)>mi&&++a<pi);return o}function bi(s,e,t,n){for(var i=0;i<di;++i){var r=te(e,t,n);if(r===0)return e;var o=Q(e,t,n)-s;e-=o/r}return e}function wi(s){return s}var Si=function(e,t,n,i){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return wi;for(var r=yi?new Float32Array(U):new Array(U),o=0;o<U;++o)r[o]=Q(o*J,e,n);function a(l){for(var c=0,f=1,u=U-1;f!==u&&r[f]<=l;++f)c+=J;--f;var v=(l-r[f])/(r[f+1]-r[f]),h=c+v*J,p=te(h,e,n);return p>=vi?bi(l,h,e,n):p===0?h:gi(l,c,c+J,e,n)}return function(c){return c===0?0:c===1?1:Q(a(c),t,i)}},R={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32,TAB:9,PAGEUP:33,PAGEDOWN:34,HOME:36,END:35},Ei=function(s){Ft(t,s);var e=Vt(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return tt(this,t),history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0),n=e.call(this,i),n.inertia&&(n.lerp=n.inertia*.1),n.isScrolling=!1,n.isDraggingScrollbar=!1,n.isTicking=!1,n.hasScrollTicking=!1,n.parallaxElements={},n.stop=!1,n.scrollbarContainer=i.scrollbarContainer,n.checkKey=n.checkKey.bind(Ut(n)),window.addEventListener("keydown",n.checkKey,!1),n}return et(t,[{key:"init",value:function(){var i=this;this.html.classList.add(this.smoothClass),this.html.setAttribute("data-".concat(this.name,"-direction"),this.direction),this.instance=ct({delta:{x:this.initPosition.x,y:this.initPosition.y},scroll:{x:this.initPosition.x,y:this.initPosition.y}},this.instance),this.vs=new fi({el:this.scrollFromAnywhere?document:this.el,mouseMultiplier:navigator.platform.indexOf("Win")>-1?1:.4,firefoxMultiplier:this.firefoxMultiplier,touchMultiplier:this.touchMultiplier,useKeyboard:!1,passive:!0}),this.vs.on(function(r){i.stop||i.isDraggingScrollbar||requestAnimationFrame(function(){i.updateDelta(r),i.isScrolling||i.startScrolling()})}),this.setScrollLimit(),this.initScrollBar(),this.addSections(),this.addElements(),this.checkScroll(!0),this.transformElements(!0,!0),P(M(t.prototype),"init",this).call(this)}},{key:"setScrollLimit",value:function(){if(this.instance.limit.y=this.el.offsetHeight-this.windowHeight,this.direction==="horizontal"){for(var i=0,r=this.el.children,o=0;o<r.length;o++)i+=r[o].offsetWidth;this.instance.limit.x=i-this.windowWidth}}},{key:"startScrolling",value:function(){this.startScrollTs=Date.now(),this.isScrolling=!0,this.checkScroll(),this.html.classList.add(this.scrollingClass)}},{key:"stopScrolling",value:function(){cancelAnimationFrame(this.checkScrollRaf),this.startScrollTs=void 0,this.scrollToRaf&&(cancelAnimationFrame(this.scrollToRaf),this.scrollToRaf=null),this.isScrolling=!1,this.instance.scroll.y=Math.round(this.instance.scroll.y),this.html.classList.remove(this.scrollingClass)}},{key:"checkKey",value:function(i){var r=this;if(this.stop){i.keyCode==R.TAB&&requestAnimationFrame(function(){r.html.scrollTop=0,document.body.scrollTop=0,r.html.scrollLeft=0,document.body.scrollLeft=0});return}switch(i.keyCode){case R.TAB:requestAnimationFrame(function(){r.html.scrollTop=0,document.body.scrollTop=0,r.html.scrollLeft=0,document.body.scrollLeft=0,r.scrollTo(document.activeElement,{offset:-window.innerHeight/2})});break;case R.UP:this.isActiveElementScrollSensitive()&&(this.instance.delta[this.directionAxis]-=240);break;case R.DOWN:this.isActiveElementScrollSensitive()&&(this.instance.delta[this.directionAxis]+=240);break;case R.PAGEUP:this.instance.delta[this.directionAxis]-=window.innerHeight;break;case R.PAGEDOWN:this.instance.delta[this.directionAxis]+=window.innerHeight;break;case R.HOME:this.instance.delta[this.directionAxis]-=this.instance.limit[this.directionAxis];break;case R.END:this.instance.delta[this.directionAxis]+=this.instance.limit[this.directionAxis];break;case R.SPACE:this.isActiveElementScrollSensitive()&&(i.shiftKey?this.instance.delta[this.directionAxis]-=window.innerHeight:this.instance.delta[this.directionAxis]+=window.innerHeight);break;default:return}this.instance.delta[this.directionAxis]<0&&(this.instance.delta[this.directionAxis]=0),this.instance.delta[this.directionAxis]>this.instance.limit[this.directionAxis]&&(this.instance.delta[this.directionAxis]=this.instance.limit[this.directionAxis]),this.stopScrolling(),this.isScrolling=!0,this.checkScroll(),this.html.classList.add(this.scrollingClass)}},{key:"isActiveElementScrollSensitive",value:function(){return!(document.activeElement instanceof HTMLInputElement)&&!(document.activeElement instanceof HTMLTextAreaElement)&&!(document.activeElement instanceof HTMLButtonElement)&&!(document.activeElement instanceof HTMLSelectElement)}},{key:"checkScroll",value:function(){var i=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(r||this.isScrolling||this.isDraggingScrollbar){this.hasScrollTicking||(this.checkScrollRaf=requestAnimationFrame(function(){return i.checkScroll()}),this.hasScrollTicking=!0),this.updateScroll();var o=Math.abs(this.instance.delta[this.directionAxis]-this.instance.scroll[this.directionAxis]),a=Date.now()-this.startScrollTs;if(!this.animatingScroll&&a>100&&(o<.5&&this.instance.delta[this.directionAxis]!=0||o<.5&&this.instance.delta[this.directionAxis]==0)&&this.stopScrolling(),Object.entries(this.sections).forEach(function(c){var f=z(c,2),u=f[0],v=f[1];v.persistent||i.instance.scroll[i.directionAxis]>v.offset[i.directionAxis]&&i.instance.scroll[i.directionAxis]<v.limit[i.directionAxis]?(i.direction==="horizontal"?i.transform(v.el,-i.instance.scroll[i.directionAxis],0):i.transform(v.el,0,-i.instance.scroll[i.directionAxis]),v.inView||(v.inView=!0,v.el.style.opacity=1,v.el.style.pointerEvents="all",v.el.setAttribute("data-".concat(i.name,"-section-inview"),""))):((v.inView||r)&&(v.inView=!1,v.el.style.opacity=0,v.el.style.pointerEvents="none",v.el.removeAttribute("data-".concat(i.name,"-section-inview"))),i.transform(v.el,0,0))}),this.getDirection&&this.addDirection(),this.getSpeed&&(this.addSpeed(),this.speedTs=Date.now()),this.detectElements(),this.transformElements(),this.hasScrollbar){var l=this.instance.scroll[this.directionAxis]/this.instance.limit[this.directionAxis]*this.scrollBarLimit[this.directionAxis];this.direction==="horizontal"?this.transform(this.scrollbarThumb,l,0):this.transform(this.scrollbarThumb,0,l)}P(M(t.prototype),"checkScroll",this).call(this),this.hasScrollTicking=!1}}},{key:"resize",value:function(){this.windowHeight=window.innerHeight,this.windowWidth=window.innerWidth,this.checkContext(),this.windowMiddle={x:this.windowWidth/2,y:this.windowHeight/2},this.update()}},{key:"updateDelta",value:function(i){var r,o=this[this.context]&&this[this.context].gestureDirection?this[this.context].gestureDirection:this.gestureDirection;o==="both"?r=i.deltaX+i.deltaY:o==="vertical"?r=i.deltaY:o==="horizontal"?r=i.deltaX:r=i.deltaY,this.instance.delta[this.directionAxis]-=r*this.multiplier,this.instance.delta[this.directionAxis]<0&&(this.instance.delta[this.directionAxis]=0),this.instance.delta[this.directionAxis]>this.instance.limit[this.directionAxis]&&(this.instance.delta[this.directionAxis]=this.instance.limit[this.directionAxis])}},{key:"updateScroll",value:function(i){this.isScrolling||this.isDraggingScrollbar?this.instance.scroll[this.directionAxis]=ht(this.instance.scroll[this.directionAxis],this.instance.delta[this.directionAxis],this.lerp):this.instance.scroll[this.directionAxis]>this.instance.limit[this.directionAxis]?this.setScroll(this.instance.scroll[this.directionAxis],this.instance.limit[this.directionAxis]):this.instance.scroll.y<0?this.setScroll(this.instance.scroll[this.directionAxis],0):this.setScroll(this.instance.scroll[this.directionAxis],this.instance.delta[this.directionAxis])}},{key:"addDirection",value:function(){this.instance.delta.y>this.instance.scroll.y?this.instance.direction!=="down"&&(this.instance.direction="down"):this.instance.delta.y<this.instance.scroll.y&&this.instance.direction!=="up"&&(this.instance.direction="up"),this.instance.delta.x>this.instance.scroll.x?this.instance.direction!=="right"&&(this.instance.direction="right"):this.instance.delta.x<this.instance.scroll.x&&this.instance.direction!=="left"&&(this.instance.direction="left")}},{key:"addSpeed",value:function(){this.instance.delta[this.directionAxis]!=this.instance.scroll[this.directionAxis]?this.instance.speed=(this.instance.delta[this.directionAxis]-this.instance.scroll[this.directionAxis])/Math.max(1,Date.now()-this.speedTs):this.instance.speed=0}},{key:"initScrollBar",value:function(){if(this.scrollbar=document.createElement("span"),this.scrollbarThumb=document.createElement("span"),this.scrollbar.classList.add("".concat(this.scrollbarClass)),this.scrollbarThumb.classList.add("".concat(this.scrollbarClass,"_thumb")),this.scrollbar.append(this.scrollbarThumb),this.scrollbarContainer?this.scrollbarContainer.append(this.scrollbar):document.body.append(this.scrollbar),this.getScrollBar=this.getScrollBar.bind(this),this.releaseScrollBar=this.releaseScrollBar.bind(this),this.moveScrollBar=this.moveScrollBar.bind(this),this.scrollbarThumb.addEventListener("mousedown",this.getScrollBar),window.addEventListener("mouseup",this.releaseScrollBar),window.addEventListener("mousemove",this.moveScrollBar),this.hasScrollbar=!1,this.direction=="horizontal"){if(this.instance.limit.x+this.windowWidth<=this.windowWidth)return}else if(this.instance.limit.y+this.windowHeight<=this.windowHeight)return;this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.direction==="horizontal"?this.scrollbarThumb.style.width="".concat(this.scrollbarWidth*this.scrollbarWidth/(this.instance.limit.x+this.scrollbarWidth),"px"):this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.instance.limit.y+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height}}},{key:"reinitScrollBar",value:function(){if(this.hasScrollbar=!1,this.direction=="horizontal"){if(this.instance.limit.x+this.windowWidth<=this.windowWidth)return}else if(this.instance.limit.y+this.windowHeight<=this.windowHeight)return;this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.direction==="horizontal"?this.scrollbarThumb.style.width="".concat(this.scrollbarWidth*this.scrollbarWidth/(this.instance.limit.x+this.scrollbarWidth),"px"):this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.instance.limit.y+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height}}},{key:"destroyScrollBar",value:function(){this.scrollbarThumb.removeEventListener("mousedown",this.getScrollBar),window.removeEventListener("mouseup",this.releaseScrollBar),window.removeEventListener("mousemove",this.moveScrollBar),this.scrollbar.remove()}},{key:"getScrollBar",value:function(i){this.isDraggingScrollbar=!0,this.checkScroll(),this.html.classList.remove(this.scrollingClass),this.html.classList.add(this.draggingClass)}},{key:"releaseScrollBar",value:function(i){this.isDraggingScrollbar=!1,this.isScrolling&&this.html.classList.add(this.scrollingClass),this.html.classList.remove(this.draggingClass)}},{key:"moveScrollBar",value:function(i){var r=this;this.isDraggingScrollbar&&requestAnimationFrame(function(){var o=(i.clientX-r.scrollbarBCR.left)*100/r.scrollbarWidth*r.instance.limit.x/100,a=(i.clientY-r.scrollbarBCR.top)*100/r.scrollbarHeight*r.instance.limit.y/100;a>0&&a<r.instance.limit.y&&(r.instance.delta.y=a),o>0&&o<r.instance.limit.x&&(r.instance.delta.x=o)})}},{key:"addElements",value:function(){var i=this;this.els={},this.parallaxElements={};var r=this.el.querySelectorAll("[data-".concat(this.name,"]"));r.forEach(function(o,a){var l=ut(o),c=Object.entries(i.sections).map(function(ot){var bt=z(ot,2),Ai=bt[0],le=bt[1];return le}).find(function(ot){return l.includes(ot.el)}),f=o.dataset[i.name+"Class"]||i.class,u=typeof o.dataset[i.name+"Id"]=="string"?o.dataset[i.name+"Id"]:"el"+a,v,h,p=o.dataset[i.name+"Repeat"],C=o.dataset[i.name+"Call"],D=o.dataset[i.name+"Position"],T=o.dataset[i.name+"Delay"],k=o.dataset[i.name+"Direction"],w=typeof o.dataset[i.name+"Sticky"]=="string",d=o.dataset[i.name+"Speed"]?parseFloat(o.dataset[i.name+"Speed"])/10:!1,m=typeof o.dataset[i.name+"Offset"]=="string"?o.dataset[i.name+"Offset"].split(","):i.offset,b=o.dataset[i.name+"Target"],y;b!==void 0?y=document.querySelector("".concat(b)):y=o;var A=y.getBoundingClientRect();c===null||c.inView?(v=A.top+i.instance.scroll.y-L(y).y,h=A.left+i.instance.scroll.x-L(y).x):(v=A.top-L(c.el).y-L(y).y,h=A.left-L(c.el).x-L(y).x);var g=v+y.offsetHeight,S=h+y.offsetWidth,j={x:(S-h)/2+h,y:(g-v)/2+v};if(w){var rt=o.getBoundingClientRect(),V=rt.top,pt=rt.left,yt={x:pt-h,y:V-v};v+=window.innerHeight,h+=window.innerWidth,g=V+y.offsetHeight-o.offsetHeight-yt[i.directionAxis],S=pt+y.offsetWidth-o.offsetWidth-yt[i.directionAxis],j={x:(S-h)/2+h,y:(g-v)/2+v}}p=="false"?p=!1:p!=null?p=!0:p=i.repeat;var I=[0,0];if(m)if(i.direction==="horizontal"){for(var E=0;E<m.length;E++)typeof m[E]=="string"?m[E].includes("%")?I[E]=parseInt(m[E].replace("%","")*i.windowWidth/100):I[E]=parseInt(m[E]):I[E]=m[E];h=h+I[0],S=S-I[1]}else{for(var E=0;E<m.length;E++)typeof m[E]=="string"?m[E].includes("%")?I[E]=parseInt(m[E].replace("%","")*i.windowHeight/100):I[E]=parseInt(m[E]):I[E]=m[E];v=v+I[0],g=g-I[1]}var gt={el:o,id:u,class:f,section:c,top:v,middle:j,bottom:g,left:h,right:S,offset:m,progress:0,repeat:p,inView:!1,call:C,speed:d,delay:T,position:D,target:y,direction:k,sticky:w};i.els[u]=gt,o.classList.contains(f)&&i.setInView(i.els[u],u),(d!==!1||w)&&(i.parallaxElements[u]=gt)})}},{key:"addSections",value:function(){var i=this;this.sections={};var r=this.el.querySelectorAll("[data-".concat(this.name,"-section]"));r.length===0&&(r=[this.el]),r.forEach(function(o,a){var l=typeof o.dataset[i.name+"Id"]=="string"?o.dataset[i.name+"Id"]:"section"+a,c=o.getBoundingClientRect(),f={x:c.left-window.innerWidth*1.5-L(o).x,y:c.top-window.innerHeight*1.5-L(o).y},u={x:f.x+c.width+window.innerWidth*2,y:f.y+c.height+window.innerHeight*2},v=typeof o.dataset[i.name+"Persistent"]=="string";o.setAttribute("data-scroll-section-id",l);var h={el:o,offset:f,limit:u,inView:!1,persistent:v,id:l};i.sections[l]=h})}},{key:"transform",value:function(i,r,o,a){var l;if(!a)l="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0,".concat(r,",").concat(o,",0,1)");else{var c=L(i),f=ht(c.x,r,a),u=ht(c.y,o,a);l="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0,".concat(f,",").concat(u,",0,1)")}i.style.webkitTransform=l,i.style.msTransform=l,i.style.transform=l}},{key:"transformElements",value:function(i){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.instance.scroll.x+this.windowWidth,l=this.instance.scroll.y+this.windowHeight,c={x:this.instance.scroll.x+this.windowMiddle.x,y:this.instance.scroll.y+this.windowMiddle.y};Object.entries(this.parallaxElements).forEach(function(f){var u=z(f,2),v=u[0],h=u[1],p=!1;if(i&&(p=0),h.inView||o)switch(h.position){case"top":p=r.instance.scroll[r.directionAxis]*-h.speed;break;case"elementTop":p=(l-h.top)*-h.speed;break;case"bottom":p=(r.instance.limit[r.directionAxis]-l+r.windowHeight)*h.speed;break;case"left":p=r.instance.scroll[r.directionAxis]*-h.speed;break;case"elementLeft":p=(a-h.left)*-h.speed;break;case"right":p=(r.instance.limit[r.directionAxis]-a+r.windowHeight)*h.speed;break;default:p=(c[r.directionAxis]-h.middle[r.directionAxis])*-h.speed;break}h.sticky&&(h.inView?r.direction==="horizontal"?p=r.instance.scroll.x-h.left+window.innerWidth:p=r.instance.scroll.y-h.top+window.innerHeight:r.direction==="horizontal"?r.instance.scroll.x<h.left-window.innerWidth&&r.instance.scroll.x<h.left-window.innerWidth/2?p=0:r.instance.scroll.x>h.right&&r.instance.scroll.x>h.right+100?p=h.right-h.left+window.innerWidth:p=!1:r.instance.scroll.y<h.top-window.innerHeight&&r.instance.scroll.y<h.top-window.innerHeight/2?p=0:r.instance.scroll.y>h.bottom&&r.instance.scroll.y>h.bottom+100?p=h.bottom-h.top+window.innerHeight:p=!1),p!==!1&&(h.direction==="horizontal"||r.direction==="horizontal"&&h.direction!=="vertical"?r.transform(h.el,p,0,i?!1:h.delay):r.transform(h.el,0,p,i?!1:h.delay))})}},{key:"scrollTo",value:function(i){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=parseInt(o.offset)||0,l=isNaN(parseInt(o.duration))?1e3:parseInt(o.duration),c=o.easing||[.25,0,.35,1],f=!!o.disableLerp,u=o.callback?o.callback:!1;if(c=Si.apply(void 0,Ve(c)),typeof i=="string"){if(i==="top")i=0;else if(i==="bottom")i=this.instance.limit.y;else if(i==="left")i=0;else if(i==="right")i=this.instance.limit.x;else if(i=document.querySelector(i),!i)return}else if(typeof i=="number")i=parseInt(i);else if(!(i&&i.tagName)){console.warn("`target` parameter is not valid");return}if(typeof i!="number"){var v=ut(i).includes(this.el);if(!v)return;var h=i.getBoundingClientRect(),p=h.top,C=h.left,D=ut(i),T=D.find(function(g){return Object.entries(r.sections).map(function(S){var j=z(S,2),rt=j[0],V=j[1];return V}).find(function(S){return S.el==g})}),k=0;T?k=L(T)[this.directionAxis]:k=-this.instance.scroll[this.directionAxis],this.direction==="horizontal"?a=C+a-k:a=p+a-k}else a=i+a;var w=parseFloat(this.instance.delta[this.directionAxis]),d=Math.max(0,Math.min(a,this.instance.limit[this.directionAxis])),m=d-w,b=function(S){f?r.direction==="horizontal"?r.setScroll(w+m*S,r.instance.delta.y):r.setScroll(r.instance.delta.x,w+m*S):r.instance.delta[r.directionAxis]=w+m*S};this.animatingScroll=!0,this.stopScrolling(),this.startScrolling();var y=Date.now(),A=function g(){var S=(Date.now()-y)/l;S>1?(b(1),r.animatingScroll=!1,l==0&&r.update(),u&&u()):(r.scrollToRaf=requestAnimationFrame(g),b(c(S)))};A()}},{key:"update",value:function(){this.setScrollLimit(),this.addSections(),this.addElements(),this.detectElements(),this.updateScroll(),this.transformElements(!0),this.reinitScrollBar(),this.checkScroll(!0)}},{key:"startScroll",value:function(){this.stop=!1}},{key:"stopScroll",value:function(){this.stop=!0}},{key:"setScroll",value:function(i,r){this.instance=ct(ct({},this.instance),{},{scroll:{x:i,y:r},delta:{x:i,y:r},speed:0})}},{key:"destroy",value:function(){P(M(t.prototype),"destroy",this).call(this),this.stopScrolling(),this.html.classList.remove(this.smoothClass),this.vs.destroy(),this.destroyScrollBar(),window.removeEventListener("keydown",this.checkKey,!1)}}]),t}(Xt),ki=function(){function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tt(this,s),this.options=e,Object.assign(this,N,e),this.smartphone=N.smartphone,e.smartphone&&Object.assign(this.smartphone,e.smartphone),this.tablet=N.tablet,e.tablet&&Object.assign(this.tablet,e.tablet),!this.smooth&&this.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible"),!this.tablet.smooth&&this.tablet.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (tablet)"),!this.smartphone.smooth&&this.smartphone.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (smartphone)"),this.init()}return et(s,[{key:"init",value:function(){if(this.options.isMobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||window.innerWidth<this.tablet.breakpoint,this.options.isTablet=this.options.isMobile&&window.innerWidth>=this.tablet.breakpoint,this.smooth&&!this.options.isMobile||this.tablet.smooth&&this.options.isTablet||this.smartphone.smooth&&this.options.isMobile&&!this.options.isTablet?this.scroll=new Ei(this.options):this.scroll=new Qe(this.options),this.scroll.init(),window.location.hash){var t=window.location.hash.slice(1,window.location.hash.length),n=document.getElementById(t);n&&this.scroll.scrollTo(n)}}},{key:"update",value:function(){this.scroll.update()}},{key:"start",value:function(){this.scroll.startScroll()}},{key:"stop",value:function(){this.scroll.stopScroll()}},{key:"scrollTo",value:function(t,n){this.scroll.scrollTo(t,n)}},{key:"setScroll",value:function(t,n){this.scroll.setScroll(t,n)}},{key:"on",value:function(t,n){this.scroll.setEvents(t,n)}},{key:"off",value:function(t,n){this.scroll.unsetEvents(t,n)}},{key:"destroy",value:function(){this.scroll.destroy()}}]),s}();var ee=ki;var it=class extends B{constructor(s){super(s)}init(){this.scroll=new ee({el:this.el,smooth:!0}),this.scroll.on("call",(s,e,t,n)=>{this.call(s[0],{way:e,obj:t},s[1],s[2])}),this.scroll.on("scroll",s=>{})}lazyLoad(s){Ht(s.obj.el,null,()=>{})}destroy(){this.scroll.destroy()}};var se=ye(ne(),1);function re(){(0,se.default)()}var Y=document.documentElement,Qi=document.body,tn=Y.hasAttribute("data-debug");var mt="production",st=config=Object.freeze({ENV:mt,IS_PROD:mt==="production",IS_DEV:mt==="development",CSS_CLASS:{LOADING:"is-loading",READY:"is-ready",LOADED:"is-loaded"}});var oe=new _t({modules:vt});window.onload=s=>{let e=document.getElementById("main-css");e?e.isLoaded?ae():e.addEventListener("load",t=>{ae()}):console.warn('The "main-css" stylesheet not found')};var lt=[{family:"Source Sans",style:"normal",weight:400},{family:"Source Sans",style:"normal",weight:700}];function ae(){re(),oe.init(oe),Y.classList.add(st.CSS_CLASS.LOADED),Y.classList.add(st.CSS_CLASS.READY),Y.classList.remove(st.CSS_CLASS.LOADING),Dt&&It(lt).then(s=>{Y.classList.add("fonts-loaded")})}})();
|
|
/*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*/
|
|
/*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */
|
|
//# sourceMappingURL=app.js.map
|