vevet 2.0.1-dev.2 → 2.0.1-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/build/cdn/index.js +1 -1
  2. package/build/cjs/components/scroll/plugins/SmoothScrollDragPlugin.js +40 -5
  3. package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +9 -0
  4. package/build/cjs/components/scroll/scrollable/ScrollView.js +2 -0
  5. package/build/cjs/components/scroll/scrollbar/Bar.js +3 -0
  6. package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +6 -0
  7. package/build/cjs/components/timeline/Timeline.js +1 -0
  8. package/build/cjs/handlers/wheel/WheelHandler.js +195 -0
  9. package/build/cjs/index.js +3 -1
  10. package/build/cjs/utils/listeners/onScroll.js +4 -2
  11. package/build/es/app/Application.js +50 -93
  12. package/build/es/app/events/PageLoad.js +3 -7
  13. package/build/es/app/events/Viewport.js +10 -34
  14. package/build/es/base/Callbacks.js +8 -19
  15. package/build/es/base/Component.js +0 -1
  16. package/build/es/base/Module.js +41 -61
  17. package/build/es/base/MutableProp.js +10 -32
  18. package/build/es/base/Plugin.js +0 -1
  19. package/build/es/components/animation-frame/AnimationFrame.js +4 -28
  20. package/build/es/components/canvas/Ctx2D.js +21 -49
  21. package/build/es/components/canvas/Ctx2DPrerender.js +1 -5
  22. package/build/es/components/cursor/CustomCursor.js +25 -58
  23. package/build/es/components/dragger/Dragger.js +20 -41
  24. package/build/es/components/dragger/DraggerDirection.js +1 -4
  25. package/build/es/components/loading/Preloader.js +26 -41
  26. package/build/es/components/loading/ProgressPreloader.js +17 -36
  27. package/build/es/components/page/Page.js +14 -33
  28. package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +47 -29
  29. package/build/es/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +9 -0
  30. package/build/es/components/scroll/scrollable/ScrollEventsBase.js +15 -22
  31. package/build/es/components/scroll/scrollable/ScrollView.js +10 -29
  32. package/build/es/components/scroll/scrollbar/Bar.js +38 -52
  33. package/build/es/components/scroll/scrollbar/ScrollBar.js +47 -73
  34. package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +61 -135
  35. package/build/es/components/text/SplitText.js +21 -42
  36. package/build/es/components/timeline/StaticTimeline.js +11 -22
  37. package/build/es/components/timeline/Timeline.js +13 -28
  38. package/build/es/handlers/wheel/WheelHandler.js +153 -0
  39. package/build/es/index.js +2 -1
  40. package/build/es/utils/listeners/onScroll.js +4 -2
  41. package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts +11 -0
  42. package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts.map +1 -1
  43. package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts.map +1 -1
  44. package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -1
  45. package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -1
  46. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -1
  47. package/build/types/components/timeline/Timeline.d.ts.map +1 -1
  48. package/build/types/handlers/wheel/WheelHandler.d.ts +100 -0
  49. package/build/types/handlers/wheel/WheelHandler.d.ts.map +1 -0
  50. package/build/types/index.d.ts +2 -1
  51. package/build/types/index.d.ts.map +1 -1
  52. package/build/types/utils/listeners/onScroll.d.ts +5 -1
  53. package/build/types/utils/listeners/onScroll.d.ts.map +1 -1
  54. package/package.json +3 -2
  55. package/src/sass/components/cursor/_custom-cursor.scss +0 -1
  56. package/src/ts/components/scroll/plugins/SmoothScrollDragPlugin.ts +58 -5
  57. package/src/ts/components/scroll/plugins/SmoothScrollKeyboardPlugin.ts +12 -0
  58. package/src/ts/components/scroll/scrollable/ScrollView.ts +4 -1
  59. package/src/ts/components/scroll/scrollbar/Bar.ts +3 -0
  60. package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +7 -0
  61. package/src/ts/components/timeline/Timeline.ts +1 -0
  62. package/src/ts/handlers/wheel/WheelHandler.ts +269 -0
  63. package/src/ts/index.ts +4 -0
  64. package/src/ts/utils/listeners/onScroll.ts +8 -0
@@ -9,4 +9,4 @@ GitHub Repository: https://github.com/antonbobrov/vevet
9
9
 
10
10
  Powered by Anton Bobrov | https://github.com/antonbobrov
11
11
  */
12
- (()=>{var t={554:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[s]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=e&&!e.nodeType&&e,y=d&&t&&!t.nodeType&&t,v=y&&y.exports===d,_=v&&f.process,b=function(){try{var t=y&&y.require&&y.require("util").types;return t||_&&_.binding&&_.binding("util")}catch(e){}}(),g=b&&b.isTypedArray;function m(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var w,O,P,k=Array.prototype,j=Function.prototype,S=Object.prototype,E=p["__core-js_shared__"],x=j.toString,T=S.hasOwnProperty,R=(w=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=S.toString,C=x.call(Object),D=RegExp("^"+x.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,B=p.Symbol,W=p.Uint8Array,I=M?M.allocUnsafe:void 0,F=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),A=Object.create,H=S.propertyIsEnumerable,z=k.splice,N=B?B.toStringTag:void 0,V=function(){try{var t=dt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),X=M?M.isBuffer:void 0,Q=Math.max,U=Date.now,$=dt(p,"Map"),Y=dt(Object,"create"),q=function(){function t(){}return function(e){if(!St(e))return{};if(A)return A(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Z(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var n=wt(t),r=!n&&mt(t),o=!n&&!r&&Pt(t),i=!n&&!r&&!o&&xt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!T.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yt(u,c))||a.push(u);return a}function et(t,e,n){(void 0!==n&&!gt(t[e],n)||void 0===n&&!(e in t))&&ot(t,e,n)}function nt(t,e,n){var r=t[e];T.call(t,e)&&gt(r,n)&&(void 0!==n||e in t)||ot(t,e,n)}function rt(t,e){for(var n=t.length;n--;)if(gt(t[n][0],e))return n;return-1}function ot(t,e,n){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}K.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if(Y){var n=e[t];return n===r?void 0:n}return T.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return Y?void 0!==e[t]:T.call(e,t)},K.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Y&&void 0===e?r:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,n=rt(e,t);return!(n<0)&&(n==e.length-1?e.pop():z.call(e,n,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,n=rt(e,t);return n<0?void 0:e[n][1]},J.prototype.has=function(t){return rt(this.__data__,t)>-1},J.prototype.set=function(t,e){var n=this.__data__,r=rt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new($||J),string:new K}},G.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return pt(this,t).get(t)},G.prototype.has=function(t){return pt(this,t).has(t)},G.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new J,this.size=0},Z.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,e){var n=this.__data__;if(n instanceof J){var r=n.__data__;if(!$||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(t,e),this.size=n.size,this};var it,st=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[it?s:++r];if(!1===e(o[a],a,o))break}return t};function at(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=T.call(t,N),n=t[N];try{t[N]=void 0;var r=!0}catch(i){}var o=L.call(t);r&&(e?t[N]=n:delete t[N]);return o}(t):function(t){return L.call(t)}(t)}function ct(t){return Et(t)&&at(t)==i}function ut(t){return!(!St(t)||function(t){return!!R&&R in t}(t))&&(kt(t)?D:c).test(function(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}function lt(t){if(!St(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&T.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,o){t!==e&&st(e,(function(i,s){if(o||(o=new Z),St(i))!function(t,e,n,r,o,i,s){var c=_t(t,n),u=_t(e,n),l=s.get(u);if(l)return void et(t,n,l);var f=i?i(c,u,n+"",t,e,s):void 0,h=void 0===f;if(h){var p=wt(u),d=!p&&Pt(u),y=!p&&!d&&xt(u);f=u,p||d||y?wt(c)?f=c:Et(m=c)&&Ot(m)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(c):d?(h=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=I?I(n):new t.constructor(n);return t.copy(r),r}(u,!0)):y?(h=!1,v=u,_=!0?(b=v.buffer,g=new b.constructor(b.byteLength),new W(g).set(new W(b)),g):v.buffer,f=new v.constructor(_,v.byteOffset,v.length)):f=[]:function(t){if(!Et(t)||at(t)!=a)return!1;var e=F(t);if(null===e)return!0;var n=T.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==C}(u)||mt(u)?(f=c,mt(c)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ot(n,a,c):nt(n,a,c)}return n}(t,Tt(t))}(c):St(c)&&!kt(c)||(f=function(t){return"function"!=typeof t.constructor||vt(t)?{}:q(F(t))}(u))):h=!1}var v,_,b,g;var m;h&&(s.set(u,f),o(f,u,r,i,s),s.delete(u));et(t,n,f)}(t,e,s,n,ft,r,o);else{var c=r?r(_t(t,s),i,s+"",t,e,o):void 0;void 0===c&&(c=i),et(t,s,c)}}),Tt)}function ht(t,e){return bt(function(t,e,n){return e=Q(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Q(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),m(t,this,a)}}(t,e,Ct),t+"")}function pt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ut(n)?n:void 0}function yt(t,e){var n=typeof t;return!!(e=null==e?o:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||S)}function _t(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bt=function(t){var e=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Ct);function gt(t,e){return t===e||t!=t&&e!=e}var mt=ct(function(){return arguments}())?ct:function(t){return Et(t)&&T.call(t,"callee")&&!H.call(t,"callee")},wt=Array.isArray;function Ot(t){return null!=t&&jt(t.length)&&!kt(t)}var Pt=X||function(){return!1};function kt(t){if(!St(t))return!1;var e=at(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return Et(t)&&jt(t.length)&&!!l[at(t)]};function Tt(t){return Ot(t)?tt(t,!0):lt(t)}var Rt,Lt=(Rt=function(t,e,n,r){ft(t,e,n,r)},ht((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Rt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!St(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&yt(e,n.length):"string"==r&&e in n)&&gt(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Rt(t,s,n,o)}return t})));function Ct(t){return t}t.exports=Lt},796:(t,e,n)=>{t.exports=n(643)},264:t=>{"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=n},518:t=>{var e,n,r,o,i,s,a,c,u,l,f,h,p,d,y,v=!1;function _(){if(!v){v=!0;var t=navigator.userAgent,_=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),b=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(h=/\b(iPhone|iP[ao]d)/.exec(t),p=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),d=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),f=!!/Win64/.exec(t),_){(e=_[1]?parseFloat(_[1]):_[5]?parseFloat(_[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var g=/(?:Trident\/(\d+.\d+))/.exec(t);s=g?parseFloat(g[1])+4:e,n=_[2]?parseFloat(_[2]):NaN,r=_[3]?parseFloat(_[3]):NaN,(o=_[4]?parseFloat(_[4]):NaN)?(_=/(?:Chrome\/(\d+\.\d+))/.exec(t),i=_&&_[1]?parseFloat(_[1]):NaN):i=NaN}else e=n=r=i=o=NaN;if(b){if(b[1]){var m=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);a=!m||parseFloat(m[1].replace("_","."))}else a=!1;c=!!b[2],u=!!b[3]}else a=c=u=!1}}var b={ie:function(){return _()||e},ieCompatibilityMode:function(){return _()||s>e},ie64:function(){return b.ie()&&f},firefox:function(){return _()||n},opera:function(){return _()||r},webkit:function(){return _()||o},safari:function(){return b.webkit()},chrome:function(){return _()||i},windows:function(){return _()||c},osx:function(){return _()||a},linux:function(){return _()||u},iphone:function(){return _()||h},mobile:function(){return _()||h||p||l||y},nativeApp:function(){return _()||d},android:function(){return _()||l},ipad:function(){return _()||p}};t.exports=b},534:(t,e,n)=>{"use strict";var r,o=n(264);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&r&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},643:(t,e,n)=>{"use strict";var r=n(518),o=n(534);function i(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=10*e,o=10*n,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(1==t.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=i}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t={};n.r(t),n.d(t,{mergeWithoutArrays:()=>u,randID:()=>s,timeoutCallback:()=>l});var e={};n.r(e),n.d(e,{boundVal:()=>K,lerp:()=>J,scopeProgress:()=>G});var r={};n.r(r),n.d(r,{intersectionObserverSupported:()=>St,onScroll:()=>jt});var o={};n.r(o);var i={};function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",e="".concat(+new Date,"_").concat(Math.round(1e3*Math.random()));return"".concat(t,"_").concat(e)}n.r(i),n.d(i,{AnimationFrame:()=>ft,Application:()=>Te,Callbacks:()=>T,Component:()=>q,Ctx2D:()=>Gr,Ctx2DPrerender:()=>ho,CustomCursor:()=>qi,Dragger:()=>br,DraggerDirection:()=>Ar,DraggerMove:()=>Er,GeneralTypes:()=>o,Module:()=>F,MutableProp:()=>D,Page:()=>Ge,PageLoad:()=>Pe,Plugin:()=>Fe,Preloader:()=>Un,ProgressPreloader:()=>ir,ScrollBar:()=>To,ScrollEventsBase:()=>No,ScrollView:()=>ei,SmoothScroll:()=>kt,SmoothScrollDragPlugin:()=>Pi,SmoothScrollKeyboardPlugin:()=>li,SplitText:()=>Wi,StaticTimeline:()=>mn,Timeline:()=>Dn,Viewport:()=>ye,utils:()=>Ki});var a=n(554),c=n.n(a);function u(t,e){return c()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function l(t,e){0===e?t():setTimeout((function(){t()}),e)}function f(t,e){return h(t,e)}function h(t,e){return t===e||null!==t&&h(t.parentNode,e)}function p(t){return t instanceof HTMLElement||t instanceof Element}function d(t){return t instanceof Window}function y(t,e){if(d(t))return t;if(p(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelector(t)}return document.querySelector(t)}function v(t,e){if(t instanceof NodeList)return t;if(p(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelectorAll(t)}return document.querySelectorAll(t)}function _(t,e,n){const r=e.split(" ");for(let o=0;o<r.length;o++)void 0===n?t.classList.toggle(r[o]):n?t.classList.add(r[o]):t.classList.remove(r[o])}function b(t,e={}){const n=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)_(t,e,!0);else for(let n=0;n<t.length;n++)_(t[n],e,!0)}(n,e.class),e.id&&n.setAttribute("id",e.id),e.attr)for(let r=0,o=e.attr.length;r<o;r++){const t=e.attr[r];n.setAttribute(t[0],t[1])}if(e.parent&&e.parent.appendChild(n),e.html&&(n.innerHTML=e.html),e.children)for(let r=0,o=e.children.length;r<o;r++)n.appendChild(e.children[r]);return n}const g=[];function m(t,e,n,r){if(void 0!==r){const o={passive:!1,once:!1};r.once&&(o.once=!0),r.passive&&(o.passive=!0),t.addEventListener(e,n,o)}else t.addEventListener(e,n);const o=`${Math.random()}-${+new Date}`;return g.push({id:o,el:t,target:e,callback:n}),{id:o,remove:w.bind(this,o)}}function w(t){const e=[];for(let n=0,r=g.length;n<r;n++){const r=g[n];r.id===t?r.el.removeEventListener(r.target,r.callback):e.push(r)}}var O=n(796),P=n.n(O);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var T=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];S(this,t),x(this,"_app",void 0),x(this,"_callbacks",void 0),this._app=window.vevetApp,this._callbacks=[],e&&this._init()}var e,n,r;return e=t,(n=[{key:"callbacks",get:function(){return this._callbacks}},{key:"_init",value:function(){this._constructor(),this._setEvents()}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s("callback"),o={id:r,on:!0,data:j({target:t,do:e},n)};return this._callbacks.push(o),this._onAdd(r),{id:r,remove:this.remove.bind(this,r)}}},{key:"_onAdd",value:function(t){}},{key:"remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1,o=this._callbacks.filter((function(o){return o.id!==t||!(!o.data.protected||n)||(e._onRemove(t),r=!0,!1)}));return this._callbacks=o,r}},{key:"_onRemove",value:function(t){}},{key:"removeAll",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._callbacks.length>0;)this.remove(this._callbacks[0].id,t)}},{key:"turn",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.get(t);return!!n&&(n.on=e,this._onTurn(t),!0)}},{key:"_onTurn",value:function(t){}},{key:"get",value:function(t){var e=this._callbacks.filter((function(e){return e.id===t}));return e.length>0&&e[0]}},{key:"_trigger",value:function(t,e){if(t.on){var n=t.data,r=n.timeout,o=n.once,i=t.data.do;r?l(e?this._triggerFunc.bind(this,i,e):this._triggerFunc.bind(this,i,!1),r):e?this._triggerFunc(i,e):this._triggerFunc(i,!1),o&&this.remove(t.id)}}},{key:"_triggerFunc",value:function(t,e){e?t(e):t()}},{key:"tbt",value:function(t,e){var n=this;this._callbacks.forEach((function(r){r.data.target===t&&n._trigger(r,e)}))}},{key:"destroy",value:function(){this.removeAll(!0)}}])&&E(e.prototype,n),r&&E(e,r),t}();function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Responsive Prop";R(this,t),C(this,"_initProp",void 0),C(this,"_onResponsive",void 0),C(this,"_onChange",void 0),C(this,"_name",void 0),C(this,"_app",void 0),C(this,"_refProp",void 0),C(this,"_prop",void 0),C(this,"_responsiveRules",[]),C(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=n,this._onChange=r,this._name=o,this._app=window.vevetApp,this._refProp=u({},e),this._prop=u({},e)}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"addResponsiveProp",value:function(t){this._responsiveRules.push(t),void 0===this._viewportCallback&&(this._viewportCallback=this._app.viewport.add("w",this._responseProp.bind(this,!0),{name:this._name})),this._responseProp()}},{key:"_responseProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._responsiveRules,n=this._app,r=n.viewport,o=r.width,i=!1,s=u({},this._refProp);e.forEach((function(t){var e=t.settings,a=t.breakpoint;if("number"==typeof a)o<=t.breakpoint&&(i=u(s,e));else if("string"==typeof a){var c=a.toLowerCase();("d"===c&&r.isDesktop||"t"===c&&r.isTablet||"p"===c&&r.isPhone)&&(i=u(s,e)),("phone"===c&&n.isPhone||"tablet"===c&&n.isTablet||"mobile"===c&&n.isMobile)&&(i=u(s,e))}})),this._prop=u(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=u(this._prop,t),this._refProp=u(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}])&&L(e.prototype,n),r&&L(e,r),t}();function M(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function B(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];B(this,t),I(this,"_mutableProp",void 0),I(this,"_callbacks",void 0),I(this,"_listeners",void 0),I(this,"_app",void 0),I(this,"_inited",!1),I(this,"_destroyed",void 0),I(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:M(),this._destroyed=!1,this._listeners=[],this._callbacks=new T;var r=u(this._getDefaultProp(),e||{});this._mutableProp=new D(r,this._onPropResponsive.bind(this),this._onPropChange.bind(this),this.name),n&&this.init()}var e,n,r;return e=t,(n=[{key:"_getDefaultProp",value:function(){return{parent:!1}}},{key:"prop",get:function(){return this._mutableProp.prop}},{key:"callbacks",get:function(){return this._callbacks}},{key:"prefix",get:function(){return""}},{key:"name",get:function(){return this.constructor.name}},{key:"inited",get:function(){return this._inited}},{key:"destroyed",get:function(){return this._destroyed}},{key:"addResponsiveProp",value:function(t){if(this._inited)throw new Error("Responsive properties cannot be added because the class instance is already initialized");this._mutableProp.addResponsiveProp(t)}},{key:"changeProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._mutableProp.changeProp(t),this._callbacks.tbt("changeProp",!1)}},{key:"_onPropResponsive",value:function(){this._onPropMutate()}},{key:"_onPropChange",value:function(t){this._onPropMutate()}},{key:"_onPropMutate",value:function(){}},{key:"init",value:function(){var t=this;this._inited||(this._inited=!0,this._constructor(),this._setEvents(),this.prop.parent&&this.prop.parent.addCallback("destroy",(function(){t.destroy()})))}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"addViewportCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{name:this.constructor.name},r=this._app.viewport.add(t,e,n);return this._viewportCallbacks.push(r),r}},{key:"addCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.callbacks.add(t,e,n);return r}},{key:"addEventListeners",value:function(t,e,n,r){var o=m(t,e,n,r);return this._listeners.push(o),o}},{key:"destroy",value:function(){this.destroyed||this._destroy()}},{key:"_destroy",value:function(){this._callbacks.tbt("destroy",!1),this._callbacks.destroy(),this._mutableProp.destroy(),this._viewportCallbacks.forEach((function(t){t.remove()})),this._listeners.forEach((function(t){t.remove()})),this._destroyed=!0}}])&&W(e.prototype,n),r&&W(e,r),t}();function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return(N="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function V(t,e){return(V=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=$(t);if(e){var o=$(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(t,e){return!e||"object"!==A(e)&&"function"!=typeof e?U(t):e}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&V(t,e)}(i,t);var e,n,r,o=X(i);function i(){var t;H(this,i);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Y(U(t=o.call.apply(o,[this].concat(n))),"_plugins",void 0),t}return e=i,(n=[{key:"addPlugin",value:function(t){void 0===this._plugins&&(this._plugins=[]),this._plugins.push(t),t.inited||t.initPlugin(this)}},{key:"_destroyPlugins",value:function(){this._plugins&&this._plugins.forEach((function(t){t.destroy()}))}},{key:"_destroy",value:function(){N($(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&z(e.prototype,n),r&&z(e,r),i}(F);function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t<e[0]?e[0]:t>e[1]?e[1]:t}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001,o=t*(1-n)+e*n,i=Math.abs(e-o);return i<=r?e:o}function G(t,e){return(t-e[0])/(e[1]-e[0])}function Z(t){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(n),!0).forEach((function(e){lt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ot(t,e,n){return(ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ut(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function it(t,e){return(it=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ut(t);if(e){var o=ut(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return at(this,n)}}function at(t,e){return!e||"object"!==Z(e)&&"function"!=typeof e?ct(t):e}function ct(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(t){return(ut=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ft=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&it(t,e)}(i,t);var e,n,r,o=st(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return nt(this,i),lt(ct(e=o.call(this,t,!1)),"_isPlaying",void 0),lt(ct(e),"_frame",void 0),lt(ct(e),"_frameIndex",void 0),lt(ct(e),"_timeStamp",void 0),lt(ct(e),"_prevFrameTime",void 0),e._isPlaying=!1,e._frame=null,e._frameIndex=-1,e._timeStamp=null,e._prevFrameTime=null,n&&e.init(),e}return e=i,(n=[{key:"isPlaying",get:function(){return this._isPlaying}},{key:"_getDefaultProp",value:function(){return et(et({},ot(ut(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){ot(ut(i.prototype),"_constructor",this).call(this),this._create()}},{key:"_create",value:function(){this.prop.run&&this.play()}},{key:"_onPropMutate",value:function(){this._frameIndex=-1,this._timeStamp=null,this._prevFrameTime=null,this.prop.run?this._play():this._pause()}},{key:"play",value:function(){this.destroyed||this.prop.run||this.changeProp({run:!0})}},{key:"_play",value:function(){this.isPlaying||(this._isPlaying=!0,this._frame=window.requestAnimationFrame(this._animate.bind(this)))}},{key:"pause",value:function(){this.prop.run&&this.changeProp({run:!1})}},{key:"_pause",value:function(){this.isPlaying&&(this._frame&&(window.cancelAnimationFrame(this._frame),this._frame=null),this._isPlaying=!1)}},{key:"_animate",value:function(t){if(this._isPlaying){this._frame=window.requestAnimationFrame(this._animate.bind(this));var e=+new Date;null==this._timeStamp&&(this._timeStamp=t),null==this._prevFrameTime&&(this._prevFrameTime=e);var n=Math.floor((t-this._timeStamp)/(1e3/this.prop.fps));if(!(n<=this._frameIndex)){this._frameIndex=n;var r=e-this._prevFrameTime,o=K(0===r?1e3/60:Math.floor(1e3/r),[1,1/0]);this.callbacks.tbt("frame",{fps:this.prop.fps,realFPS:o,prevFrameDuration:e-this._prevFrameTime}),this._prevFrameTime=+new Date}}}},{key:"_destroy",value:function(){this.pause(),ot(ut(i.prototype),"_destroy",this).call(this)}}])&&rt(e.prototype,n),r&&rt(e,r),i}(q);function ht(t){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(n),!0).forEach((function(e){Pt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _t(t,e,n){return(_t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ot(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function bt(t,e){return(bt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ot(t);if(e){var o=Ot(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mt(this,n)}}function mt(t,e){return!e||"object"!==ht(e)&&"function"!=typeof e?wt(t):e}function wt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ot(t){return(Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var kt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bt(t,e)}(i,t);var e,n,r,o=gt(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];yt(this,i),Pt(wt(e=o.call(this,t,!1)),"_outer",void 0),Pt(wt(e),"_container",void 0),Pt(wt(e),"_containerExists",void 0),Pt(wt(e),"_elements",void 0),Pt(wt(e),"_elementsLength",void 0),Pt(wt(e),"_targetLeft",void 0),Pt(wt(e),"_targetTop",void 0),Pt(wt(e),"_scrollLeft",void 0),Pt(wt(e),"_scrollTop",void 0),Pt(wt(e),"_scrollWidth",void 0),Pt(wt(e),"_scrollHeight",void 0),Pt(wt(e),"_clientWidth",void 0),Pt(wt(e),"_clientHeight",void 0),Pt(wt(e),"_instant",void 0),Pt(wt(e),"_animationFrame",void 0),Pt(wt(e),"_outerAnimationFrameEvent",void 0),Pt(wt(e),"_currentFPS",void 0);var r=e.prop.selectors;if(e._targetLeft=0,e._targetTop=0,e._scrollLeft=0,e._scrollTop=0,e._scrollWidth=0,e._scrollHeight=0,e._clientWidth=0,e._clientHeight=0,e._instant=!1,e._currentFPS=60,e._outer=y(r.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(r.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=y(".".concat(e.prefix,"__container"),e.outer);return p(s)?(e._container=s,e._containerExists=!0):(e._container=b("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),r.elements?e._elements=Array.from(v(r.elements,e._outer)):e._elements=[e._container],e._elementsLength=e._elements.length,e._elements.forEach((function(t){t.style.willChange="transform"})),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"smooth-scroll")}},{key:"outer",get:function(){return this._outer}},{key:"container",get:function(){return this._container}},{key:"elements",get:function(){return this._elements}},{key:"targetLeft",get:function(){return this._targetLeft},set:function(t){this.targetLeftBound=t,this._enable()}},{key:"targetLeftBound",get:function(){return this._targetLeft},set:function(t){var e=this.prop.overscroll&&this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableWidth+(this.prop.overscroll&&this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetLeft=K(t,[e,n])}},{key:"targetTop",get:function(){return this._targetTop},set:function(t){this.targetTopBound=t,this._enable()}},{key:"targetTopBound",get:function(){return this._targetTop},set:function(t){var e=this.prop.overscroll&&!this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableHeight+(this.prop.overscroll&&!this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetTop=K(t,[e,n])}},{key:"scrollLeft",get:function(){return this._scrollLeft},set:function(t){this.targetLeftBound=t,this._scrollLeft=this._targetLeft,this._enable()}},{key:"scrollTop",get:function(){return this._scrollTop},set:function(t){this.targetTopBound=t,this._scrollTop=this._targetTop,this._enable()}},{key:"scrollWidth",get:function(){return this._scrollWidth}},{key:"scrollHeight",get:function(){return this._scrollHeight}},{key:"clientWidth",get:function(){return this._clientWidth}},{key:"clientHeight",get:function(){return this._clientHeight}},{key:"maxScrollableWidth",get:function(){return this.scrollWidth-this.clientWidth}},{key:"maxScrollableHeight",get:function(){return this.scrollHeight-this.clientHeight}},{key:"_getDefaultProp",value:function(){return dt(dt({},_t(Ot(i.prototype),"_getDefaultProp",this).call(this)),{},{selectors:{outer:"#".concat(this.prefix),elements:!1},enabled:!0,animationFrame:!1,recalculateSizes:!0,useWheel:!0,autoStop:!0,isHorizontal:!1,stopPropagation:!0,useWillChange:!0,render:{lerp:.1,lerpToFixed:2,approximation:.1,normalizeLerp:!1},overscroll:{friction:.5,max:250}})}},{key:"_constructor",value:function(){_t(Ot(i.prototype),"_constructor",this).call(this),this._toggle()}},{key:"_setEvents",value:function(){var t=this;this.resize(),this.addViewportCallback("",(function(){t.resize(!0)})),this.addEventListeners(this.outer,"wheel",(function(e){t._handleWheel(e)})),this.addEventListeners(this.outer,"scroll",(function(){t.outer.scrollTop=0,t.outer.scrollLeft=0}))}},{key:"_onPropMutate",value:function(){_t(Ot(i.prototype),"_onPropMutate",this).call(this),this.resize(),this._toggle()}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.container,n=this.outer;this._clientWidth=n.clientWidth,this._clientHeight=n.clientHeight,this._scrollWidth=K(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=K(e.clientHeight,[this.clientHeight,1/0]),t&&(this._instant=!0),t&&(this.targetLeft=parseInt(this.targetLeft.toFixed(0),10),this.targetTop=parseInt(this.targetTop.toFixed(0),10)),this._updateElementsProp(),this.callbacks.tbt("resize",!1)}},{key:"_recalculateSizes",value:function(){var t=this.container,e=t.clientHeight,n=t.clientWidth;e===this.scrollHeight&&n===this.scrollWidth||this.resize()}},{key:"_updateElementsProp",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t];e.smoothScrollLeft=this.scrollLeft,e.smoothScrollTop=this.scrollTop;var n=e.getAttribute("".concat(this.prefix,"-ease"));if(n)try{e.smoothScrollLerpEase=parseFloat(n)}catch(r){}}}},{key:"_handleWheel",value:function(t){var e=this.prop;if(e.enabled&&e.useWheel){(e.stopPropagation||!e.stopPropagation&&(this.scrollLeft>0&&this.scrollLeft<this.maxScrollableWidth||this.scrollTop>0&&this.scrollTop<this.maxScrollableHeight))&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault());var n=P()(t);this.targetLeftBound+=e.isHorizontal?n.pixelY:n.pixelX,this.targetTopBound+=e.isHorizontal?n.pixelX:n.pixelY,this._enable(),this.callbacks.tbt("wheel",t)}}},{key:"_toggle",value:function(){this.prop.enabled?this._enable():this._disable()}},{key:"_enable",value:function(){var t=this;this.prop.enabled&&(this.prop.animationFrame&&!this._outerAnimationFrameEvent?this._outerAnimationFrameEvent=this.prop.animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})):(this._animationFrame||(this._animationFrame=new ft,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()}))),this._animationFrame.play()))}},{key:"_disable",value:function(){this._outerAnimationFrameEvent&&this.prop.animationFrame&&this._outerAnimationFrameEvent.remove(),this._animationFrame&&this._animationFrame.pause()}},{key:"render",value:function(){var t=this.prop;t.recalculateSizes&&this._recalculateSizes(),this._calcScroll(),this._calcElements(),this._renderElements(),this._instant&&(this._instant=!1),this.callbacks.tbt("scroll",!1);var e=Math.abs(this.targetTop-this.scrollTop);0===Math.abs(this.targetLeft-this.scrollLeft)&&0===e&&t.autoStop&&(this._disable(),this.callbacks.tbt("approximate",!1))}},{key:"_calcScroll",value:function(){var t=this.prop.overscroll;t&&(this.targetLeft<0?this.targetLeftBound=this._lerp(this.targetLeftBound,0,t.friction):this.targetLeft>this.maxScrollableWidth&&(this.targetLeftBound=this._lerp(this.targetLeftBound,this.maxScrollableWidth,t.friction)),this.targetTop<0?this.targetTopBound=this._lerp(this.targetTopBound,0,t.friction):this.targetTop>this.maxScrollableHeight&&(this.targetTopBound=this._lerp(this.targetTopBound,this.maxScrollableHeight,t.friction))),this._scrollLeft=this._lerp(this.scrollLeft,this.targetLeft),this._scrollTop=this._lerp(this.scrollTop,this.targetTop)}},{key:"_calcElements",value:function(){for(var t=this._getLerpEase(),e=0;e<this._elementsLength;e+=1){var n=this._elements[e],r=this._getLerpEase(n);r===t?(n.smoothScrollLeft=this._scrollLeft,n.smoothScrollTop=this._scrollTop):(n.smoothScrollLeft=this._lerp(n.smoothScrollLeft,this._targetLeft,r),n.smoothScrollTop=this._lerp(n.smoothScrollTop,this._targetTop,r))}}},{key:"_lerp",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getLerpEase(),r=this.prop.render,o=r.lerpToFixed,i=r.approximation,s=this._instant?1:n,a=J(t,e,s,i);if("number"==typeof o){var c=Math.round(Math.abs(o));return parseFloat(a.toFixed(c))}return a}},{key:"_getLerpEase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.prop.render,n=e.lerp,r=e.normalizeLerp,o=r?60/this._currentFPS:1;return t&&t.smoothScrollLerpEase||n*o}},{key:"_renderElements",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t],n=-e.smoothScrollLeft,r=-e.smoothScrollTop;e.style.transform="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ".concat(n,", ").concat(r,", 0,1)")}}},{key:"scrollTo",value:function(){var t=arguments;if(1===t.length&&"object"===ht(t[0])){var e=t[0],n=e.top,r=e.left,o=e.behavior;void 0!==r&&("smooth"===o?this.targetLeftBound=r:this.scrollLeft=r),void 0!==n&&("smooth"===o?this.targetTopBound=n:this.scrollTop=n),"smooth"===o&&this._enable()}"number"!=typeof t[0]&&"number"!=typeof t[1]||("number"==typeof t[0]&&(this.scrollLeft=t[0]),"number"==typeof t[1]&&(this.scrollTop=t[1]))}},{key:"_destroy",value:function(){if(_t(Ot(i.prototype),"_destroy",this).call(this),this._disable(),this._animationFrame&&this._animationFrame.destroy(),!this._containerExists){for(;this._container.firstChild;)this._outer.appendChild(this._container.firstChild);this._container.remove()}this._outer.classList.remove(this.prefix),this._elements.forEach((function(t){t.style.transform="",t.style.willChange=""}))}}])&&vt(e.prototype,n),r&&vt(e,r),i}(q);function jt(t,e){var n,r=[];t instanceof kt?t.addCallback("scroll",(function(){e({scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})})):(n="string"==typeof t?y(t):t)&&r.push(m(n,"scroll",(function(){var t=n instanceof Window?n.pageYOffset:n.scrollTop,r=n instanceof Window?n.pageXOffset:n.scrollLeft;e({scrollTop:t,scrollLeft:r})})));return{remove:function(){r.forEach((function(t){t.remove()}))}}}function St(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}var Et=/iPhone/i,xt=/iPod/i,Tt=/iPad/i,Rt=/\biOS-universal(?:.+)Mac\b/i,Lt=/\bAndroid(?:.+)Mobile\b/i,Ct=/Android/i,Dt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Mt=/Silk/i,Bt=/Windows Phone/i,Wt=/\bWindows(?:.+)ARM\b/i,It=/BlackBerry/i,Ft=/BB10/i,At=/Opera Mini/i,Ht=/\b(CriOS|Chrome)(?:.+)Mobile/i,zt=/Mobile(?:.+)Firefox\b/i,Nt=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Vt(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=e.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var o=function(t){return function(e){return e.test(t)}}(n),i={apple:{phone:o(Et)&&!o(Bt),ipod:o(xt),tablet:!o(Et)&&(o(Tt)||Nt(e))&&!o(Bt),universal:o(Rt),device:(o(Et)||o(xt)||o(Tt)||o(Rt)||Nt(e))&&!o(Bt)},amazon:{phone:o(Dt),tablet:!o(Dt)&&o(Mt),device:o(Dt)||o(Mt)},android:{phone:!o(Bt)&&o(Dt)||!o(Bt)&&o(Lt),tablet:!o(Bt)&&!o(Dt)&&!o(Lt)&&(o(Mt)||o(Ct)),device:!o(Bt)&&(o(Dt)||o(Mt)||o(Lt)||o(Ct))||o(/\bokhttp\b/i)},windows:{phone:o(Bt),tablet:o(Wt),device:o(Bt)||o(Wt)},other:{blackberry:o(It),blackberry10:o(Ft),opera:o(At),firefox:o(zt),chrome:o(Ht),device:o(It)||o(Ft)||o(At)||o(zt)||o(Ht)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Xt,Qt,Ut=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},$t=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},Yt=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},qt=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},Kt=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},Jt=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},Gt=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Zt=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],te=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ee(t){return t?re(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new Jt:"undefined"!=typeof navigator?re(navigator.userAgent):"undefined"!=typeof process&&process.version?new Yt(process.version.slice(1)):null}function ne(t){return""!==t&&Zt.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function re(t){var e=ne(t);if(!e)return null;var n=e[0],r=e[1];if("searchbot"===n)return new Kt;var o=r[1]&&r[1].split(/[._]/).slice(0,3);o?o.length<3&&(o=Ut(o,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-o.length))):o=[];var i=o.join("."),s=function(t){for(var e=0,n=te.length;e<n;e++){var r=te[e],o=r[0];if(r[1].exec(t))return o}return null}(t),a=Gt.exec(t);return a&&a[1]?new qt(n,i,s,a[1]):new $t(n,i,s)}class oe extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class ie{static fn(t){return(...e)=>new ie(((n,r,o)=>{e.push(o),t(...e).then(n,r)}))}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,n)=>{this._reject=n;const r=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};Object.defineProperties(r,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&r.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,n(t)}),r)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new oe(t))}}get isCanceled(){return this._isCanceled}}function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ce(t,e,n){return(ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=pe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ue(t,e){return(ue=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=pe(t);if(e){var o=pe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fe(this,n)}}function fe(t,e){return!e||"object"!==se(e)&&"function"!=typeof e?he(t):e}function he(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pe(t){return(pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function de(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.setPrototypeOf(ie.prototype,Promise.prototype),function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(Xt||(Xt={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(Qt||(Qt={}));var ye=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ue(t,e)}(i,t);var e,n,r,o=le(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),de(he(t=o.call(this,!1)),"_width",void 0),de(he(t),"_height",void 0),de(he(t),"_prevSize",void 0),de(he(t),"_isDesktop",void 0),de(he(t),"_isTablet",void 0),de(he(t),"_isPhone",void 0),t._width=0,t._height=0,t._prevSize={w:0,h:0},t._isDesktop=!1,t._isTablet=!1,t._isPhone=!1,t._init(),t}return e=i,(n=[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"prevSize",get:function(){return this._prevSize}},{key:"isLandscape",get:function(){return this.width>this.height}},{key:"isPortrait",get:function(){return this.width<this.height}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isPhone",get:function(){return this._isPhone}},{key:"dpr",get:function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1}},{key:"lowerDesktopDPR",get:function(){return this._app.isDesktop?1:this.dpr}},{key:"_constructor",value:function(){ce(pe(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){l((function(){t._onResize()}),t._app.prop.viewportResizeTimeout)}))}},{key:"_setValues",value:function(){var t=this._app,e=t.html,n=t.prop;this._width=e.clientWidth,this._height=e.clientHeight,this._prevSize={w:this._width,h:this._height};var r=this.width;this._isDesktop=r>=n.tablet,this._isTablet=r<=n.tablet&&r>n.phone,this._isPhone=r<=n.phone,this._updateClasses(),this._updateCSSVars()}},{key:"_updateClasses",value:function(){var t=[Xt.Desktop,Xt.Tablet,Xt.Phone];this.isDesktop?this._updateBreakpointClasses(Xt.Desktop,t):this.isTablet?this._updateBreakpointClasses(Xt.Tablet,t):this._updateBreakpointClasses(Xt.Phone,t);var e=[Qt.Landscape,Qt.Portrait];this.isLandscape?this._updateBreakpointClasses(Qt.Landscape,e):this.isPortrait?this._updateBreakpointClasses(Qt.Portrait,e):this._updateBreakpointClasses("",e)}},{key:"_updateBreakpointClasses",value:function(t,e){var n=this._app.html,r=this._app.prefix;e.forEach((function(e){e===t?n.classList.add("".concat(r,"viewport-").concat(e)):n.classList.remove("".concat(r,"viewport-").concat(e))}))}},{key:"_updateCSSVars",value:function(){var t=this._app.html;t.style.setProperty("--vw","".concat(this.vw,"px")),t.style.setProperty("--vh","".concat(this.vh,"px"))}},{key:"_onResize",value:function(){var t=this._prevSize.w,e=this._prevSize.h;this._setValues();var n=this.width,r=this.height,o={widthChanged:n!==t,heightChanged:r!==e,orientationChanged:n>r!=t>e};n!==t&&r===e&&this.tbt("w_",o),r!==e&&n===t&&this.tbt("h_",o),n!==t&&r!==e&&(this.tbt("wh",o),this.tbt("hw",o)),n!==t&&this.tbt("w",o),r!==e&&this.tbt("h",o),this.tbt("",o)}}])&&ae(e.prototype,n),r&&ae(e,r),i}(T);function ve(t){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function be(t,e){return(be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ge(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Oe(t);if(e){var o=Oe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return me(this,n)}}function me(t,e){return!e||"object"!==ve(e)&&"function"!=typeof e?we(t):e}function we(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Oe(t){return(Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&be(t,e)}(i,t);var e,n,r,o=ge(i);function i(){var t,e,n,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,!1),e=we(t),r=void 0,(n="_loaded")in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._loaded=!1,t._init(),t}return e=i,(n=[{key:"loaded",get:function(){return this._loaded}},{key:"_setEvents",value:function(){var t=this;"complete"===document.readyState?this._handleLoaded():window.addEventListener("load",(function(){t._handleLoaded()}))}},{key:"_handleLoaded",value:function(){var t=this._app,e=t.prefix;this._loaded=!0,t.html.classList.remove("".concat(e,"loading")),t.body.classList.remove("".concat(e,"loading")),t.html.classList.add("".concat(e,"loaded")),this.tbt("",!1)}},{key:"onLoaded",value:function(t){if(!this.loaded)return this.add("",t.bind(this));t()}}])&&_e(e.prototype,n),r&&_e(e,r),i}(T);function ke(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function je(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ke(Object(n),!0).forEach((function(e){xe(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Se(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Te=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Se(this,t),xe(this,"_prop",void 0),xe(this,"_prefix",void 0),xe(this,"_isPhone",void 0),xe(this,"_isTablet",void 0),xe(this,"_isMobile",void 0),xe(this,"_isDesktop",void 0),xe(this,"_osName",void 0),xe(this,"_browserName",void 0),xe(this,"_pages",[]),xe(this,"_page",!1),xe(this,"_pageLoad",void 0),xe(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=je(je({},this.defaultProp),e),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Vt();this._isPhone=n.phone,this.html.classList.toggle("".concat(this.prefix,"phone"),this._isPhone),this._isTablet=n.tablet,this.html.classList.toggle("".concat(this.prefix,"tablet"),this._isTablet),this._isMobile=n.phone||n.tablet,this.html.classList.toggle("".concat(this.prefix,"mobile"),this._isMobile),this._isDesktop=!this._isMobile,this.html.classList.toggle("".concat(this.prefix,"desktop"),this._isDesktop);var r=ee();if(null!=r&&r.os){var o=r.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(o)),this._osName=o}else this._osName="";if(null!=r&&r.name){var i=r.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(i)),this._browserName=i}else this._browserName="";this._pageLoad=new Pe,this._viewport=new ye}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0}}},{key:"prefix",get:function(){return this._prefix}},{key:"isPhone",get:function(){return this._isPhone}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isMobile",get:function(){return this._isMobile}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"osName",get:function(){return this._osName}},{key:"browserName",get:function(){return this._browserName}},{key:"doc",get:function(){return document}},{key:"html",get:function(){return document.documentElement}},{key:"body",get:function(){return document.body}},{key:"pages",get:function(){return this._pages}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onPageCreated",value:function(){var t=this;return new ie((function(e){t._page?t._page.onCreate().then((function(){e(t.page)})):setTimeout((function(){t.onPageCreated().then((function(){e(t.page)}))}),30)}))}},{key:"onPageShown",value:function(){var t=this;return new ie((function(e){t.onPageCreated().then((function(){t._page&&t._page.onShow().then((function(){e(t.page)}))}))}))}},{key:"pageLoad",get:function(){return this._pageLoad}},{key:"onPageLoaded",value:function(){var t=this;return new ie((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){var t=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",t,"Vevet")}}])&&Ee(e.prototype,n),r&&Ee(e,r),t}();function Re(t){return(Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ce(t,e,n){return(Ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ie(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function De(t,e){return(De=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ie(t);if(e){var o=Ie(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Be(this,n)}}function Be(t,e){return!e||"object"!==Re(e)&&"function"!=typeof e?We(t):e}function We(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ie(t){return(Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&De(t,e)}(i,t);var e,n,r,o=Me(i);function i(t){var e,n,r,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t,!1),n=We(e),s=void 0,(r="_component")in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,e}return e=i,(n=[{key:"component",get:function(){return this._component}},{key:"init",value:function(){if(!this._component)throw new Error("Component is not set. Be sure that initlugin is called before.");Ce(Ie(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Le(e.prototype,n),r&&Le(e,r),i}(F);function Ae(t){return(Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ze(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?He(Object(n),!0).forEach((function(e){Ke(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Xe(t,e,n){return(Xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Qe(t,e){return(Qe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ue(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=qe(t);if(e){var o=qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $e(this,n)}}function $e(t,e){return!e||"object"!==Ae(e)&&"function"!=typeof e?Ye(t):e}function Ye(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(t){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ke(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Je,Ge=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qe(t,e)}(i,t);var e,n,r,o=Ue(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ne(this,i),Ke(Ye(e=o.call(this,t,!1)),"_created",void 0),Ke(Ye(e),"_shown",void 0),Ke(Ye(e),"_hidden",void 0),Ke(Ye(e),"_viaAJAX",void 0),e._created=!1,e._shown=!1,e._hidden=!1,e._destroyed=!1,e._viaAJAX=!1,n&&e.init(),e}return e=i,(n=[{key:"created",get:function(){return this._created}},{key:"shown",get:function(){return this._shown}},{key:"hidden",get:function(){return this._hidden}},{key:"viaAJAX",get:function(){return this._viaAJAX}},{key:"pageClassName",get:function(){return"".concat(this._app.prefix,"page-").concat(this.prop.name)}},{key:"_getDefaultProp",value:function(){return ze(ze({},Xe(qe(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home"})}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(n,r){t.canCreate().then((function(){t.created||(t._created=!0,t._shown=!1,t._hidden=!1,t._destroyed=!1,t._viaAJAX=e,t._app.page=t,t._app.html.classList.add(t.pageClassName),t._create().then((function(){t.callbacks.tbt("create",!1),n()})))})).catch((function(){r()}))}))}},{key:"_create",value:function(){return new Promise((function(t){t()}))}},{key:"canCreate",value:function(){var t=this;return new Promise((function(e,n){t.created?n():e()}))}},{key:"show",value:function(){var t=this;return new Promise((function(e,n){t.canShow().then((function(){t.shown||(t._created=!0,t._shown=!0,t._hidden=!1,t._destroyed=!1,t._show().then((function(){t.callbacks.tbt("show",!1),e()})))})).catch((function(){n()}))}))}},{key:"_show",value:function(){return new Promise((function(t){t()}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,n){!t.created||t.shown?n():e()}))}},{key:"hide",value:function(){var t=this;return new Promise((function(e,n){t.canHide().then((function(){t.hidden||(t._created=!0,t._shown=!1,t._hidden=!0,t._destroyed=!1,t._hide().then((function(){t.callbacks.tbt("hide",!1),e()})))})).catch((function(){n()}))}))}},{key:"_hide",value:function(){return new Promise((function(t){t()}))}},{key:"canHide",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.shown&&!t.hidden?e():n()}))}},{key:"destroy",value:function(){var t=this;return new Promise((function(e,n){t.canDestroy().then((function(){t.destroyed||(t._created=!1,t._shown=!1,t._hidden=!0,t._destroyed=!0,t._app.page=!1,t._app.html.classList.remove(t.pageClassName),t._destroy().then((function(){e()})))})).catch((function(){n()}))}))}},{key:"_destroy",value:function(){var t=this;return new Promise((function(e){Xe(qe(i.prototype),"_destroy",t).call(t),e()}))}},{key:"canDestroy",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.hidden&&!t.destroyed?e():n()}))}},{key:"onCreate",value:function(){var t=this;return new ie((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new ie((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new ie((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}])&&Ve(e.prototype,n),r&&Ve(e,r),i}(q);function Ze(t,e){const[n,r,o,i]=e;if(n===r&&o===i)return t;const s=[];for(let a=0;a<11;++a)s[a]=tn(.1*a,n,o);return 0===t?0:1===t?1:tn(function(t,e,n){const r=t[0],o=t[2];let i=0,s=1;for(;10!==s&&n[s]<=e;++s)i+=.1;--s;const a=(e-n[s])/(n[s+1]-n[s]),c=i+.1*a,u=on(c,r,o);if(u>=.001)return function(t,e,n,r){for(let o=0;o<4;++o){const o=on(e,n,r);if(0===o)return e;e-=(tn(e,n,r)-t)/o}return e}(e,c,r,o);if(0===u)return c;return function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=tn(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,i,i+.1,r,o)}(e,t,s),r,i)}function tn(t,e,n){return((en(e,n)*t+nn(e,n))*t+rn(e))*t}function en(t,e){return 1-3*e+3*t}function nn(t,e){return 3*e-6*t}function rn(t){return 3*t}function on(t,e,n){return 3*en(e,n)*t*t+2*nn(e,n)*t+rn(e)}function sn(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}function an(t,e){switch(e){case Je.easeInSine:return n=t,1-Math.cos(n*Math.PI/2);case Je.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case Je.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case Je.easeInQuad:return function(t){return Math.pow(t,2)}(t);case Je.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case Je.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case Je.easeInCubic:return function(t){return Math.pow(t,3)}(t);case Je.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case Je.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case Je.easeInQuart:return function(t){return Math.pow(t,4)}(t);case Je.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case Je.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case Je.easeInQuint:return function(t){return Math.pow(t,5)}(t);case Je.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case Je.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case Je.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case Je.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case Je.easeInOutExpo:return function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}(t);case Je.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case Je.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case Je.easeInOutCirc:return function(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}(t);case Je.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case Je.easeOutBack:return function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(t);case Je.easeInOutBack:return function(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}(t);case Je.easeInElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}(t);case Je.easeOutElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}(t);case Je.easeInOutElastic:return function(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}(t);case Je.easeInBounce:return function(t){return 1-sn(1-t)}(t);case Je.easeOutBounce:return sn(t);case Je.easeInOutBounce:return function(t){return t<.5?(1-sn(1-2*t))/2:(1+sn(2*t-1))/2}(t);default:return t}var n}function cn(t){return(cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function un(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ln(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?un(Object(n),!0).forEach((function(e){gn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pn(t,e){return(pn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=bn(t);if(e){var o=bn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yn(this,n)}}function yn(t,e){return!e||"object"!==cn(e)&&"function"!=typeof e?vn(t):e}function vn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _n(t,e,n){return(_n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function bn(t){return(bn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t.easeInSine="easeInSine",t.easeOutSine="easeOutSine",t.easeInOutSine="easeInOutSine",t.easeInQuad="easeInQuad",t.easeOutQuad="easeOutQuad",t.easeInOutQuad="easeInOutQuad",t.easeInCubic="easeInCubic",t.easeOutCubic="easeOutCubic",t.easeInOutCubic="easeInOutCubic",t.easeInQuart="easeInQuart",t.easeOutQuart="easeOutQuart",t.easeInOutQuart="easeInOutQuart",t.easeInQuint="easeInQuint",t.easeOutQuint="easeOutQuint",t.easeInOutQuint="easeInOutQuint",t.easeInExpo="easeInExpo",t.easeOutExpo="easeOutExpo",t.easeInOutExpo="easeInOutExpo",t.easeInCirc="easeInCirc",t.easeOutCirc="easeOutCirc",t.easeInOutCirc="easeInOutCirc",t.easeInBack="easeInBack",t.easeOutBack="easeOutBack",t.easeInOutBack="easeInOutBack",t.easeInElastic="easeInElastic",t.easeOutElastic="easeOutElastic",t.easeInOutElastic="easeInOutElastic",t.easeInBounce="easeInBounce",t.easeOutBounce="easeOutBounce",t.easeInOutBounce="easeInOutBounce"}(Je||(Je={}));var mn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pn(t,e)}(i,t);var e,n,r,o=dn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return fn(this,i),gn(vn(e=o.call(this,t,!1)),"_progress",void 0),gn(vn(e),"_easing",void 0),gn(vn(e),"_nestedTimelines",void 0),e._progress=0,e._easing=0,e._nestedTimelines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return ln(ln({},_n(bn(i.prototype),"_getDefaultProp",this).call(this)),{},{easing:this._app.prop.easing,scope:[0,1],useNestedEasingProgress:!1})}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"easing",get:function(){return this._easing}},{key:"addNestedTimeline",value:function(t){this._nestedTimelines.push(t)}},{key:"_handleProgress",value:function(){this._easing=function(t,e=!1){return e?Array.isArray(e)?Ze(t,e):"function"==typeof e?e(t):an(t,e):t}(this._progress,this.prop.easing),this._callbacks.tbt("progress",{progress:this._progress,easing:this._easing}),this._renderNestedTimelines()}},{key:"_renderNestedTimelines",value:function(){var t=this._nestedTimelines.length;if(0!==t)for(var e=this.prop.useNestedEasingProgress?this.easing:this.progress,n=0,r=t;n<r;n+=1){var o=this._nestedTimelines[n],i=K(G(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){_n(bn(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}])&&hn(e.prototype,n),r&&hn(e,r),i}(q);function wn(t){return(wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function On(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?On(Object(n),!0).forEach((function(e){Cn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Sn(t,e){return(Sn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ln(t);if(e){var o=Ln(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xn(this,n)}}function xn(t,e){return!e||"object"!==wn(e)&&"function"!=typeof e?Tn(t):e}function Tn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rn(t,e,n){return(Rn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ln(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ln(t){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Dn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Sn(t,e)}(i,t);var e,n,r,o=En(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return kn(this,i),Cn(Tn(e=o.call(this,t,!1)),"_isPlaying",void 0),Cn(Tn(e),"_isReversed",void 0),Cn(Tn(e),"_isPaused",void 0),Cn(Tn(e),"_animationFrame",void 0),Cn(Tn(e),"_animationFrameLastTime",void 0),e._isPlaying=!1,e._isReversed=!1,e._isPaused=!1,e._animationFrameLastTime=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Pn(Pn({},Rn(Ln(i.prototype),"_getDefaultProp",this).call(this)),{},{duration:1e3,reset:!1,destroyOnEnd:!1})}},{key:"isPlaying",get:function(){return void 0!==this._animationFrame}},{key:"isReversed",get:function(){return this._isReversed}},{key:"isPaused",get:function(){return this._isPaused}},{key:"play",value:function(){this._destroyed||(this.prop.reset&&1===this.progress&&(this._progress=0),this._isReversed=!1,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"reverse",value:function(){this._destroyed||(this.prop.reset&&0===this.progress&&(this._progress=1),this._isReversed=!0,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"pause",value:function(){this._destroyed||(this._isPaused=!0,this._animationFrame&&window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}},{key:"_animate",value:function(){if(!this._isPaused){var t=this.isReversed,e=+new Date,n=Math.abs(this._animationFrameLastTime-e);this._animationFrameLastTime=e;var r=n/this.prop.duration/(t?-1:1),o=K(this.progress+r,[0,1]);if(this.progress=o,1===o&&!t||0===o&&t)return this._isReversed=!1,this._isPaused=!1,void(this._animationFrame=void 0);this._animationFrame=window.requestAnimationFrame(this._animate.bind(this))}}},{key:"_handleProgress",value:function(){Rn(Ln(i.prototype),"_handleProgress",this).call(this);var t=this._progress;0===t?this.callbacks.tbt("start",!1):1===t&&(this.callbacks.tbt("end",!1),this.prop.destroyOnEnd&&this.destroy())}},{key:"_destroy",value:function(){this.pause(),Rn(Ln(i.prototype),"_destroy",this).call(this)}}])&&jn(e.prototype,n),r&&jn(e,r),i}(mn);function Mn(t){return(Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bn(Object(n),!0).forEach((function(e){Qn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function In(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function An(t,e){return(An=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Hn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Xn(t);if(e){var o=Xn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zn(this,n)}}function zn(t,e){return!e||"object"!==Mn(e)&&"function"!=typeof e?Nn(t):e}function Nn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vn(t,e,n){return(Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Xn(t){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Un=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&An(t,e)}(i,t);var e,n,r,o=Hn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(In(this,i),Qn(Nn(e=o.call(this,t,!1)),"_container",void 0),Qn(Nn(e),"_startTime",void 0),Qn(Nn(e),"_endTime",void 0),Qn(Nn(e),"_toBeHidden",void 0),Qn(Nn(e),"_isHidden",void 0),Qn(Nn(e),"_pageLoadEvent",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._startTime=+new Date,e._endTime=1/0,e._toBeHidden=!1,e._isHidden=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Wn(Wn({},Vn(Xn(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),hide:250})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"preloader")}},{key:"container",get:function(){return this._container}},{key:"startTime",get:function(){return this._startTime}},{key:"endTime",get:function(){return this._endTime}},{key:"totalTime",get:function(){return this._endTime-this._startTime}},{key:"isHidden",get:function(){return this._isHidden}},{key:"_setEvents",value:function(){var t=this;Vn(Xn(i.prototype),"_setEvents",this).call(this),this._onLoaded().then((function(){t._endTime=+new Date,t._handleLoaded()}))}},{key:"_onLoaded",value:function(){var t=this;return new ie((function(e){t._app.pageLoad.loaded?e():t._pageLoadEvent=t._app.pageLoad.add("",(function(){e()}))}))}},{key:"_handleLoaded",value:function(){this.callbacks.tbt("loaded",!1),"boolean"!=typeof this.prop.hide&&this.hideContainer()}},{key:"hideContainer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"boolean"!=typeof this.prop.hide?this.prop.hide:250;return this.callbacks.tbt("hide",!1),this._toBeHidden=!0,new ie((function(n){var r=t._container;if(!r)return t._handleHidden(),void n();r.style.transition="opacity ".concat(e,"ms, visibility ").concat(e,"ms"),r.style.opacity="0",r.style.visibility="hidden",l((function(){r.style.display="none",t._handleHidden(),n()}),e)}))}},{key:"_handleHidden",value:function(){this._isHidden=!0,this.callbacks.tbt("hidden",!1)}},{key:"onHide",value:function(t){if(!this._toBeHidden)return this.callbacks.add("hide",(function(){t()}));t()}},{key:"onHidden",value:function(t){if(!this._isHidden)return this.callbacks.add("hidden",(function(){t()}));t()}},{key:"_destroy",value:function(){var t;Vn(Xn(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}])&&Fn(e.prototype,n),r&&Fn(e,r),i}(q);function $n(t){return($n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yn(Object(n),!0).forEach((function(e){or(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gn(t,e){return(Gn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=rr(t);if(e){var o=rr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return tr(this,n)}}function tr(t,e){return!e||"object"!==$n(e)&&"function"!=typeof e?er(t):e}function er(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nr(t,e,n){return(nr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function or(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ir=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gn(t,e)}(i,t);var e,n,r,o=Zn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kn(this,i),or(er(e=o.call(this,t,!1)),"_imgs",void 0),or(er(e),"_videos",void 0),or(er(e),"_customResources",void 0),or(er(e),"_resourcesTotal",void 0),or(er(e),"_resourcesLoaded",void 0),or(er(e),"_progress",void 0),or(er(e),"_animationFrame",void 0),or(er(e),"_endTimeline",void 0),e._imgs=[],e._videos=[],e._customResources=[],e._resourcesTotal=1+e.prop.resources,e._resourcesLoaded=0,e._progress=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return qn(qn({},nr(rr(i.prototype),"_getDefaultProp",this).call(this)),{},{resources:0,loaders:{img:!0,video:!0,custom:".js-preload"},calc:{lerp:.1,forceEnd:500}})}},{key:"imgs",get:function(){return this._imgs}},{key:"videos",get:function(){return this._videos}},{key:"customResources",get:function(){return this._customResources}},{key:"resourcesTotal",get:function(){return this._resourcesTotal}},{key:"resourcesLoaded",get:function(){return this._resourcesLoaded}},{key:"loadProgress",get:function(){return this.resourcesLoaded/this.resourcesTotal}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"_constructor",value:function(){nr(rr(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;nr(rr(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new ft,this._animationFrame.addCallback("frame",(function(){t.progress=J(t.progress,t.loadProgress,e)})),this._animationFrame.play()),this._preloadResources(),this._app.onPageLoaded().then((function(){t._handleLoadedResource()}))}},{key:"_onLoaded",value:function(){var t=this;return new ie((function(e){var n=!1;t.callbacks.add("progress",(function(t){t.progress>=1&&!n&&(e(),n=!0)}),{protected:!0})}))}},{key:"_getResources",value:function(){var t=this,e=this.prop.loaders;e.img&&v("img").forEach((function(e){t._imgs.push(e),t._resourcesTotal+=1})),e.video&&v("video").forEach((function(e){t._videos.push(e),t._resourcesTotal+=1})),e.custom&&(this._customResources=Array.from(v(e.custom)),this._resourcesTotal+=this._customResources.length)}},{key:"_preloadResources",value:function(){var t=this;0===this._resourcesTotal&&(this._resourcesTotal=1,this._handleLoadedResource()),this._imgs.forEach((function(e){if(e.complete)t._handleLoadedResource();else{var n=new Image;e.addEventListener("load",(function(){t._handleLoadedResource()})),e.addEventListener("error",(function(){t._handleLoadedResource()})),n.src=e.src}})),this._videos.forEach((function(e){if(e.readyState>0)t._handleLoadedResource();else{if("none"===e.preload)return void t._handleLoadedResource();e.addEventListener("error",(function(){t._handleLoadedResource()})),e.addEventListener("loadedmetadata",(function(){t._handleLoadedResource()}))}})),this._customResources.forEach((function(e){t._seekCustomResourceLoaded(e).then((function(){t._handleLoadedResource()}))}))}},{key:"_seekCustomResourceLoaded",value:function(t){var e=this;return new Promise((function(n){t.isComplete||t.isLoaded||t.getAttribute("data-is-loaded")||t.getAttribute("is-loaded")?n():setTimeout((function(){e.destroyed||e._seekCustomResourceLoaded(t).then((function(){n()}))}),50)}))}},{key:"addResourcesLoaded",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<t;e+=1)this._handleLoadedResource()}},{key:"addResourcesTotal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._resourcesTotal+=t}},{key:"_handleLoadedResource",value:function(){this.loadProgress>=1||(this._resourcesLoaded+=1,this.callbacks.tbt("resourceLoad",!1),this._animationFrame||(this.progress=this.loadProgress))}},{key:"_handleProgress",value:function(){var t=this;if(this.callbacks.tbt("progress",{progress:this._progress}),this.progress>=1)this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0);else if("number"==typeof this.prop.calc.forceEnd&&this.loadProgress>=1&&!this._endTimeline){this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0),this._endTimeline=new Dn({duration:this.prop.calc.forceEnd});var e=this.progress;this._endTimeline.addCallback("progress",(function(n){var r=1-e;t.progress=e+r*n.progress})),this._endTimeline.play()}}},{key:"_destroy",value:function(){nr(rr(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}])&&Jn(e.prototype,n),r&&Jn(e,r),i}(Un);function sr(t){return(sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ar(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function cr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ar(Object(n),!0).forEach((function(e){_r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fr(t,e){return(fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=vr(t);if(e){var o=vr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pr(this,n)}}function pr(t,e){return!e||"object"!==sr(e)&&"function"!=typeof e?dr(t):e}function dr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yr(t,e,n){return(yr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function vr(t){return(vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var br=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fr(t,e)}(i,t);var e,n,r,o=hr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(ur(this,i),_r(dr(e=o.call(this,t,!1)),"_container",void 0),_r(dr(e),"_runtimeEvents",void 0),_r(dr(e),"_isDragging",void 0),_r(dr(e),"_pointerID",void 0),_r(dr(e),"_coords",void 0),_r(dr(e),"_prevCoords",void 0),_r(dr(e),"_startCoords",void 0),e._container=y(e.prop.container),!p(e._container)&&!d(e._container))throw new Error("No container");return e._runtimeEvents=[],e._isDragging=!1,e._pointerID=null,e._coords={x:0,y:0},e._prevCoords={x:0,y:0},e._startCoords={x:0,y:0},n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return cr(cr({},yr(vr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),usePassive:!1,enabled:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"dragger")}},{key:"container",get:function(){return this._container}},{key:"isDragging",get:function(){return this._isDragging}},{key:"coords",get:function(){return this._coords}},{key:"startCoords",get:function(){return this._startCoords}},{key:"_setEvents",value:function(){var t=this.container,e=this.prop.usePassive;this.addEventListeners(t,"mousedown",this._handleStart.bind(this),{passive:e}),this.addEventListeners(t,"touchstart",this._handleStart.bind(this),{passive:e})}},{key:"_addRuntimeEvents",value:function(){var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"blur",this.cancel.bind(this),{passive:t}))}},{key:"_removeRuntimeEvents",value:function(){this._runtimeEvents.forEach((function(t){t.remove()})),this._runtimeEvents=[]}},{key:"_normalizeEvent",value:function(t){if(t.type.includes("touch")){var e=t,n=e.targetTouches[0]||e.changedTouches[0];return{x:n.clientX,y:n.clientY,id:n.identifier}}var r=t;return{x:r.clientX,y:r.clientY,id:null}}},{key:"_handleStart",value:function(t){if(!this.prop.enabled)return!1;if(this.isDragging)return!1;var e=this._normalizeEvent(t);if("mousedown"===t.type){if(1!==t.which)return!1;t.stopPropagation()}return this._isDragging=!0,this._pointerID=e.id,this._coords={x:e.x,y:e.y},this._prevCoords={x:e.x,y:e.y},this._startCoords={x:e.x,y:e.y},this._addRuntimeEvents(),this.callbacks.tbt("start",{evt:t}),!0}},{key:"_handleEnd",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this.cancel(),0))}},{key:"cancel",value:function(){this._removeRuntimeEvents(),this._isDragging=!1,this.callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){yr(vr(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&lr(e.prototype,n),r&&lr(e,r),i}(q);function gr(t){return(gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Or(t,e,n){return(Or="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Pr(t,e){return(Pr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Sr(t);if(e){var o=Sr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jr(this,n)}}function jr(t,e){return!e||"object"!==gr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Sr(t){return(Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Er=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pr(t,e)}(i,t);var e,n,r,o=kr(i);function i(){return mr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){Or(Sr(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchmove",this._handleMove.bind(this),{passive:t}))}},{key:"_handleMove",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this._prevCoords={x:this._coords.x,y:this._coords.y},this._coords={x:e.x,y:e.y},this.callbacks.tbt("move",{evt:t,start:this.startCoords,coords:this.coords,step:this.stepCoords}),0))}},{key:"_destroy",value:function(){Or(Sr(i.prototype),"_destroy",this).call(this)}}])&&wr(e.prototype,n),r&&wr(e,r),i}(br);function xr(t){return(xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tr(Object(n),!0).forEach((function(e){Lr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Lr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Mr(t,e,n){return(Mr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Br(t,e){return(Br=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Fr(t);if(e){var o=Fr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ir(this,n)}}function Ir(t,e){return!e||"object"!==xr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Fr(t){return(Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ar=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Br(t,e)}(i,t);var e,n,r,o=Wr(i);function i(){return Cr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Rr(Rr({},Mr(Fr(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=Mr(Fr(i.prototype),"_handleEnd",this).call(this,t);if(!e)return e;var n=this._normalizeEvent(t),r=this.startCoords,o=Math.abs(this.prop.min);return r.y>n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("up",!1),r.y<n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("down",!1),r.x>n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("left",!1),r.x<n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("right",!1),!0}}])&&Dr(e.prototype,n),r&&Dr(e,r),i}(br);function Hr(t){return(Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zr(Object(n),!0).forEach((function(e){Jr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qr(t,e,n){return(Qr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Kr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ur(t,e){return(Ur=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $r(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Kr(t);if(e){var o=Kr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Yr(this,n)}}function Yr(t,e){return!e||"object"!==Hr(e)&&"function"!=typeof e?qr(t):e}function qr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kr(t){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ur(t,e)}(i,t);var e,n,r,o=$r(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Vr(this,i),Jr(qr(e=o.call(this,t,!1)),"_canvas",void 0),Jr(qr(e),"_ctx",void 0),Jr(qr(e),"_width",void 0),Jr(qr(e),"_height",void 0),Jr(qr(e),"_dpr",void 0),e._width=0,e._height=0,e._dpr=1;var r=e.prop,s=r.append,a=r.container,c=s&&a?a:void 0;return e._canvas=b("canvas",{parent:c}),e._ctx=e._canvas.getContext("2d"),e.resize(),n&&e.init(),e}return e=i,(n=[{key:"container",get:function(){return this.prop.container}},{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"width",get:function(){return this._width}},{key:"nonDPRWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"_getDefaultProp",value:function(){return Nr(Nr({},Qr(Kr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,append:!0,updateOnResize:!1,width:!1,height:!1,dpr:!1})}},{key:"_setEvents",value:function(){var t=this;if(Qr(Kr(i.prototype),"_setEvents",this).call(this),!1!==this.prop.updateOnResize){var e="boolean"==typeof this.prop.updateOnResize?"":this.prop.updateOnResize;this.addViewportCallback(e,(function(){t.resize()})),this.resize()}}},{key:"_onPropMutate",value:function(){Qr(Kr(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){var t=this.prop,e=this.canvas;if(e){var n=this._app.viewport;"number"==typeof t.dpr?this._dpr=t.dpr:this._dpr=n.dpr;var r=this._dpr,o=0,i=0;"number"==typeof t.width&&"number"==typeof t.height?(o=t.width,i=t.height):this.container?(o=this.container.clientWidth,i=this.container.clientHeight):(o=n.width,i=n.height),o*=r,i*=r,this._width=o,this._height=i,e.width=o,e.height=i,this.callbacks.tbt("resize",!1)}}},{key:"_destroy",value:function(){Qr(Kr(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&Xr(e.prototype,n),r&&Xr(e,r),i}(q);function Zr(t){const e=function(t){if("container"in t)return{width:t.container.clientWidth,height:t.container.clientHeight};return{width:t.width,height:t.height}}(t),n=function(t){const{source:e}=t;if(e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};return{width:e.width,height:e.height}}(t);let r;return"cover"===t.rule?r=function(t,e,n){let r=e.width*to(t),o=n.height*r/n.width;o/to(t)<e.height&&(o=e.height*to(t),r=n.width*o/n.height);const i=(e.width-r)/2,s=(e.height-o)/2;return{width:r,height:o,x:i,y:s}}(t,e,n):"contain"===t.rule?r=function(t,e,n){let r=0,o=0;const i=n.width/n.height;e.width>e.height?(o=e.height,r=o*i,r>e.width&&(r=e.width,o=r/i)):e.height>=e.width&&(r=e.width,o=r/i,o>e.height&&(o=e.height,r=o*i));r*=to(t),o*=to(t);const s=(e.width-r)/2,a=(e.height-o)/2;return{width:r,height:o,x:s,y:a}}(t,e,n):"top-left"===t.rule?r=function(t,e){const n=e.width*to(t),r=e.height*to(t);return{width:n,height:r,x:0,y:0}}(t,n):"top-right"===t.rule?r=function(t,e,n){const r=n.width*to(t),o=n.height*to(t),i=e.width-n.width;return{width:r,height:o,x:i,y:0}}(t,e,n):"bottom-left"===t.rule?r=function(t,e,n){const r=n.width*to(t),o=n.height*to(t),i=e.height-n.height;return{width:r,height:o,x:0,y:i}}(t,e,n):"bottom-right"===t.rule?r=function(t,e,n){const r=n.width*to(t),o=n.height*to(t),i=e.width-n.width,s=e.height-n.height;return{width:r,height:o,x:i,y:s}}(t,e,n):"center"===t.rule&&(r=function(t,e,n){const r=n.width*to(t),o=n.height*to(t),i=(e.width-n.width)/2,s=(e.height-n.height)/2;return{width:r,height:o,x:i,y:s}}(t,e,n)),Object.assign(r,{sourceWidth:n.width,sourceHeight:n.height})}function to(t){return void 0!==t.scale?t.scale:1}function eo(t){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function no(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ro(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?no(Object(n),!0).forEach((function(e){oo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function oo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function io(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function so(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ao(t,e,n){return(ao="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function co(t,e){return(co=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function uo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo(t);if(e){var o=fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return lo(this,n)}}function lo(t,e){return!e||"object"!==eo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function fo(t){return(fo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ho=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&co(t,e)}(i,t);var e,n,r,o=uo(i);function i(){return io(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return ro(ro({},ao(fo(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){ao(fo(i.prototype),"resize",this).call(this),this._prerender()}},{key:"_prerender",value:function(){var t=this.prop.media;if(t){var e=Zr({source:t,rule:this.prop.posRule,scale:1,width:this.width,height:this.height});this._ctx.clearRect(0,0,this.width,this.height),this._ctx.drawImage(t,0,0,e.sourceWidth,e.sourceHeight,e.x,e.y,e.width,e.height),this.callbacks.tbt("prerender",!1)}}}])&&so(e.prototype,n),r&&so(e,r),i}(Gr);function po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),yo(this,"_prop",void 0),yo(this,"_outer",void 0),yo(this,"_thumb",void 0),yo(this,"_outerHeight",void 0),yo(this,"_outerWidth",void 0),yo(this,"_thumbHeight",void 0),yo(this,"_thumbWidth",void 0),yo(this,"_scrollVal",void 0),yo(this,"_coordsAtDragStart",void 0),yo(this,"_listeners",void 0),yo(this,"_scrollEvent",void 0),yo(this,"_actionTimeout",void 0),yo(this,"_dragger",void 0),this._prop=e;var n=e.prefix,r=e.dir,o=e.domParent,i=e.container,s=e.autoHide;this._outerHeight=0,this._outerWidth=0,this._thumbHeight=0,this._thumbWidth=0,this._scrollVal=0,this._coordsAtDragStart={left:0,top:0};var a="".concat(n," ").concat(n,"_").concat(r);i instanceof Window&&(a+=" in-window"),this._outer=b("div",{parent:o,class:a}),this._thumb=b("div",{parent:this._outer,class:"".concat(n,"__thumb ").concat(n,"__thumb_").concat(r)}),s&&this.outer.classList.add("auto-hide"),this._listeners=[],this._setEvents()}var e,n,r;return e=t,(n=[{key:"outer",get:function(){return this._outer}},{key:"thumb",get:function(){return this._thumb}},{key:"prefix",get:function(){return this._prop.prefix}},{key:"isX",get:function(){return"x"===this.prop.dir}},{key:"isY",get:function(){return!this.isX}},{key:"scrollElement",get:function(){return this.prop.container instanceof Window?document.documentElement:this.prop.container}},{key:"scrollLine",get:function(){var t=this.scrollElement;return this.isX?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight}},{key:"scrollWidth",get:function(){return this.scrollElement.scrollWidth}},{key:"scrollHeight",get:function(){return this.scrollElement.scrollHeight}},{key:"prop",get:function(){return this._prop}},{key:"scrollValues",get:function(){var t=this.prop.container,e=0,n=0;return t instanceof Window?(e=t.pageYOffset,n=t.pageXOffset):t instanceof kt?(e=t.targetTop,n=t.targetLeft):(e=t.scrollTop,n=t.scrollLeft),{left:n,top:e}}},{key:"_setEvents",value:function(){var t=this;this._listeners.push(m(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(m(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=jt(this.prop.container,(function(e){t._handleScroll(e)})),this.prop.isDraggable&&(this._dragger=new Er({container:this.thumb}),this._dragger.addCallback("start",(function(){t.thumb.classList.add("in-action"),t._disableScrollBehaviour(!0),t._coordsAtDragStart=t.scrollValues})),this._dragger.addCallback("move",(function(e){t._handleThumbDrag(e)})),this._dragger.addCallback("end",(function(){t.thumb.classList.remove("in-action"),t._disableScrollBehaviour(!1)})))}},{key:"_disableScrollBehaviour",value:function(t){var e=t?"auto":"unset";(this.prop.container instanceof Window||this.prop.container instanceof HTMLElement)&&(document.documentElement.style.scrollBehavior=e)}},{key:"_handleHover",value:function(t){this.outer.classList.toggle("is-hovered",t)}},{key:"_handleScroll",value:function(t){var e=this;this.prop.optimizeCalculations||this.resize();var n=!1;this.isX?(n=t.scrollLeft!==this._scrollVal,this._scrollVal=t.scrollLeft):(n=t.scrollTop!==this._scrollVal,this._scrollVal=t.scrollTop),n&&(this.prop.autoHide&&n&&(this.outer.classList.add("in-action"),this._actionTimeout&&(clearTimeout(this._actionTimeout),this._actionTimeout=void 0),this._actionTimeout=setTimeout((function(){e.outer.classList.remove("in-action")}),500)),this.prop.optimizeCalculations&&this._renderThumb())}},{key:"_handleThumbDrag",value:function(t){t.evt.preventDefault();var e=this.prop.container,n=(t.coords.x-t.start.x)/(this._outerWidth-this._thumbWidth)*this.scrollLine,r=(t.coords.y-t.start.y)/(this._outerHeight-this._thumbHeight)*this.scrollLine,o=this._coordsAtDragStart,i=o.left,s=o.top;this.isX?i+=n:s+=r,e.scrollTo({top:s,left:i,behavior:e instanceof kt?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=K(this._scrollVal/this.scrollLine,[0,1]),e=this.isX?(this._outerWidth-this._thumbWidth)*t:0,n=this.isY?(this._outerHeight-this._thumbHeight)*t:0;this._thumb.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}},{key:"resize",value:function(){var t=this.outer,e=this.thumb,n=this.scrollLine,r=this.prop.minSize;if(this._outerHeight=t.clientHeight,this._outerWidth=t.clientWidth,this.prop.autoSize)if(this.isX){var o=K(this._outerWidth/(this.scrollWidth/(this.scrollWidth-n)),[r,1/0]);e.style.width="".concat(o,"px")}else{var i=K(this._outerHeight/(this.scrollHeight/(this.scrollHeight-n)),[r,1/0]);e.style.height="".concat(i,"px")}this._thumbHeight=e.clientHeight,this._thumbWidth=e.clientWidth,t.classList.toggle("is-empty",0===n),this._renderThumb()}},{key:"destroy",value:function(){this._listeners.forEach((function(t){t.remove()})),this._scrollEvent&&this._scrollEvent.remove(),this._actionTimeout&&clearTimeout(this._actionTimeout),this._dragger&&this._dragger.destroy(),this._outer.remove()}}])&&po(e.prototype,n),r&&po(e,r),t}();function _o(t){return(_o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function go(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?bo(Object(n),!0).forEach((function(e){xo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Oo(t,e){return(Oo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Eo(t);if(e){var o=Eo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ko(this,n)}}function ko(t,e){return!e||"object"!==_o(e)&&"function"!=typeof e?jo(t):e}function jo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function So(t,e,n){return(So="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Eo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Eo(t){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var To=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Oo(t,e)}(i,t);var e,n,r,o=Po(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];mo(this,i),xo(jo(e=o.call(this,t,!1)),"_container",void 0),xo(jo(e),"_scrollWrapper",void 0),xo(jo(e),"_xBar",void 0),xo(jo(e),"_yBar",void 0);var r=e.prop,s=r.autoHide,a=r.autoSize,c=r.minSize,u=r.optimizeCalculations,l=r.isDraggable,f=r.draggableScrollBehavior;if("string"==typeof e.prop.container){var h=y(e.prop.container);if(!h)throw new Error("No scroll container");e._container=h}else e._container=e.prop.container;if(e.container instanceof Element){var p=e.container.parentElement;p&&(e._scrollWrapper=b("div"),e._scrollWrapper.style.position="relative",e._scrollWrapper.style.display="inline-block",p.insertBefore(e._scrollWrapper,e.container),e._scrollWrapper.appendChild(e.container),e._scrollWrapper.classList.add("".concat(e.prefix,"-wrapper")))}var d={container:e.container,domParent:e.domParent,autoHide:s,autoSize:a,minSize:c,optimizeCalculations:u,prefix:e.prefix,isDraggable:l,draggableScrollBehavior:f};return e._xBar=new vo(go({dir:"x"},d)),e._yBar=new vo(go({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return go(go({},So(Eo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,domParent:!1,draggable:!0,autoSize:!0,autoHide:!0,minSize:50,optimizeCalculations:!1,isDraggable:!0,draggableScrollBehavior:"smooth"})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"scrollbar")}},{key:"container",get:function(){return this._container}},{key:"scrollableElement",get:function(){var t=this.container;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"domParent",get:function(){var t=this.prop.domParent,e=this.container;return t||(this._scrollWrapper?this._scrollWrapper:e instanceof Window?this._app.body:e instanceof Element?e:e.outer)}},{key:"_setEvents",value:function(){var t=this;So(Eo(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof kt?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()})),this.resize()}},{key:"_onPropMutate",value:function(){So(Eo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(So(Eo(i.prototype),"_destroy",this).call(this),this._xBar.destroy(),this._yBar.destroy(),this._scrollWrapper&&this.container instanceof Element){var t=this._scrollWrapper.parentElement;t&&t.insertBefore(this.container,this._scrollWrapper),this._scrollWrapper.remove()}this.scrollableElement.classList.remove("".concat(this.prefix,"-parent"))}}])&&wo(e.prototype,n),r&&wo(e,r),i}(q);function Ro(t){return(Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Co(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(n),!0).forEach((function(e){zo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Do(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bo(t,e){return(Bo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ho(t);if(e){var o=Ho(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Io(this,n)}}function Io(t,e){return!e||"object"!==Ro(e)&&"function"!=typeof e?Fo(t):e}function Fo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ao(t,e,n){return(Ao="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ho(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ho(t){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var No=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bo(t,e)}(i,t);var e,n,r,o=Wo(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Do(this,i),zo(Fo(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=y(e.prop.container):e._scrollContainer=e.prop.container,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Co(Co({},Ao(Ho(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"scrollableElement",get:function(){return this._scrollContainer instanceof Window?this._app.html:this._scrollContainer}},{key:"domParent",get:function(){var t=this.scrollContainer;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"intersectionRoot",get:function(){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}},{key:"scrollContainerBounding",get:function(){if(this.intersectionRoot){var t=this.intersectionRoot.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:0,left:0,width:this._app.viewport.width,height:this._app.viewport.height}}}])&&Mo(e.prototype,n),r&&Mo(e,r),i}(q);function Vo(t){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xo(Object(n),!0).forEach((function(e){ti(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yo(t,e){return(Yo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Zo(t);if(e){var o=Zo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ko(this,n)}}function Ko(t,e){return!e||"object"!==Vo(e)&&"function"!=typeof e?Jo(t):e}function Jo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Go(t,e,n){return(Go="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Zo(t){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ti(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ei=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yo(t,e)}(i,t);var e,n,r,o=qo(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Uo(this,i),ti(Jo(e=o.call(this,t,!1)),"_scrollEvent",void 0),ti(Jo(e),"_intersectionObserver",void 0),ti(Jo(e),"_firstStart",void 0),ti(Jo(e),"_elements",void 0),e._firstStart=!0,e.updateElements(),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"scroll-view")}},{key:"_getDefaultProp",value:function(){return Qo(Qo({},Go(Zo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,elements:".".concat(this.prefix,"__el"),threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0})}},{key:"init",value:function(){Go(Zo(i.prototype),"init",this).call(this),this.seekBounding()}},{key:"_setEvents",value:function(){var t=this;Go(Zo(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback("",(function(){t.resize()}))}},{key:"_onPropMutate",value:function(){Go(Zo(i.prototype),"_onPropMutate",this).call(this),this._removeViewEvents(),this.updateElements(),this._setViewEvents()}},{key:"resize",value:function(){this._removeViewEvents(),this._setViewEvents()}},{key:"_setViewEvents",value:function(){var t=this;if(St()&&this.prop.useIntersectionObserver){var e=this.scrollContainerBounding,n=this._firstStart?0:e.width*(1-this.prop.threshold)*-1,r=this._firstStart?0:e.height*(1-this.prop.threshold)*-1;this._intersectionObserver=new IntersectionObserver(this._handleIntersectionObserver.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px ".concat(n,"px ").concat(r,"px 0px")}),this.elements&&this.elements.forEach((function(e){var n;null===(n=t._intersectionObserver)||void 0===n||n.observe(e)}))}else this._scrollEvent=jt(this.prop.container,this._handleScroll.bind(this))}},{key:"_removeViewEvents",value:function(){this._scrollEvent&&(this._scrollEvent.remove(),this._scrollEvent=void 0),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0)}},{key:"elements",get:function(){return this._elements}},{key:"updateElements",value:function(){var t=this;void 0===this.elements&&(this._elements=[]),this.elements.forEach((function(e){t._intersectionObserver&&t._intersectionObserver.unobserve(e)})),this._elements=Array.from(v(this.prop.elements,this.domParent||void 0)).filter((function(e){return!e.classList.contains(t.prop.classToToggle)})),this._elements.forEach((function(e){t._intersectionObserver&&t._intersectionObserver.observe(e)}))}},{key:"_handleIntersectionObserver",value:function(t){for(var e=!!this._firstStart&&this.scrollContainerBounding,n=0;n<t.length;n+=1){var r=t[n],o=0;this._firstStart&&e&&r.isIntersecting&&(o=this._elementInViewportData(r.target,e).delay),this._handleInOut(r.target,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1,this.resize())}},{key:"_handleScroll",value:function(){this.seekBounding()}},{key:"seekBounding",value:function(){if(!St()||!this.prop.useIntersectionObserver){for(var t=this.scrollContainerBounding,e=0;e<this.elements.length;e+=1){var n=this.elements[e],r=this._elementInViewportData(n,t),o=r.isIntersecting?r.delay:0;this._handleInOut(n,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1)}}},{key:"_elementInViewportData",value:function(t,e){var n=this.prop,r=n.threshold,o=n.states,i=n.useDelay,s=this._firstStart?1:r,a=t.getBoundingClientRect(),c=!1;a.top<e.top+e.height*s&&a.left<e.left+e.width*s&&(c="in"===o||!(a.right<e.left*s||a.bottom<e.top*s));var u=0;return i&&this._firstStart&&(u=K("x"===i.dir?(a.left-e.left)/e.width:(a.top-e.top)/e.height,[0,1])*i.max),{isIntersecting:c,delay:u}}},{key:"_handleInOut",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.prop.states;t.scrollViewIn&&e||!t.scrollViewIn&&!e||(t.scrollViewIn=e,l((function(){t.classList.toggle(n.prop.classToToggle,e)}),r),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||l((function(){n.callbacks.tbt("out",t)}),r):l((function(){n.callbacks.tbt("in",t)}),r))}},{key:"_processUnusedElements",value:function(){var t=this;"in"===this.prop.states&&(this._elements.filter((function(t){return t.scrollViewIn})).forEach((function(e){t._intersectionObserver&&t._intersectionObserver.unobserve(e)})),this._elements=this._elements.filter((function(t){return!t.scrollViewIn})))}},{key:"_destroy",value:function(){Go(Zo(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}])&&$o(e.prototype,n),r&&$o(e,r),i}(No);function ni(t){return(ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ri(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ii(t,e,n){return(ii="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ui(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function si(t,e){return(si=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ai(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ui(t);if(e){var o=ui(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ci(this,n)}}function ci(t,e){return!e||"object"!==ni(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ui(t){return(ui=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var li=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&si(t,e)}(i,t);var e,n,r,o=ai(i);function i(){return ri(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_setEvents",value:function(){var t=this;ii(ui(i.prototype),"_setEvents",this).call(this),this.addEventListeners(window,"keydown",(function(e){t._handleKeydown(e)}))}},{key:"_handleKeydown",value:function(t){var e=this._component;if(e.prop.enabled)if(9!==t.keyCode){var n=document.activeElement;if(!n||!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){var r=40;switch(t.keyCode){case 38:e.targetTop-=r;break;case 40:e.targetTop+=r;break;case 39:e.targetLeft+=r;break;case 37:e.targetLeft-=r;break;case 34:e.targetTop+=400;break;case 33:e.targetTop-=400;break;case 36:e.targetTop=0,e.targetLeft=0;break;case 35:e.targetTop=e.scrollHeight,e.targetLeft=e.scrollWidth;break;case 32:e.targetTop+=200}}}else this._handleTab()}},{key:"_handleTab",value:function(){var t=this;l((function(){var e=t._component,n=document.activeElement;if(n instanceof HTMLElement&&f(n,e.outer)){var r=e.outer.getBoundingClientRect(),o=n.getBoundingClientRect(),i=e.scrollTop+(o.top-r.top)-(e.clientHeight/2-o.height/2),s=e.scrollLeft+(o.left-r.left)-(e.clientWidth/2-o.width/2);e.targetTop=i,e.targetLeft=s}}),120)}}])&&oi(e.prototype,n),r&&oi(e,r),i}(Fe);function fi(t){return(fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hi(Object(n),!0).forEach((function(e){wi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function di(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yi(t,e){return(yi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=mi(t);if(e){var o=mi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _i(this,n)}}function _i(t,e){return!e||"object"!==fi(e)&&"function"!=typeof e?bi(t):e}function bi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gi(t,e,n){return(gi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function mi(t){return(mi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function wi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Oi="is-dragging",Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yi(t,e)}(i,t);var e,n,r,o=vi(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),wi(bi(e=o.call(this,t)),"_dragger",void 0),wi(bi(e),"_componentEvents",void 0),wi(bi(e),"_currentLerp",void 0),e._componentEvents=[],e._currentLerp=!1,e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return pi(pi({},gi(mi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,speed:1,lerp:!1,reverseDir:!1})}},{key:"isDragging",get:function(){return!!this._dragger&&this._dragger.isDragging}},{key:"_constructor",value:function(){gi(mi(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){gi(mi(i.prototype),"_onPropMutate",this).call(this),this._toggleDragger()}},{key:"_toggleDragger",value:function(){this.prop.enabled?this._addDragger():this._removeDragger()}},{key:"_addDragger",value:function(){var t=this;if(!this._dragger){var e=this.component;this._dragger=new Er({container:e.outer}),this._dragger.addCallback("start",this._handleDragStart.bind(this)),this._dragger.addCallback("move",this._handleDragMove.bind(this)),this._dragger.addCallback("end",this._handleDragEnd.bind(this)),this._componentEvents.push(e.addCallback("wheel",(function(){var e;null===(e=t._dragger)||void 0===e||e.cancel()})))}}},{key:"_removeDragger",value:function(){this._dragger&&(this._dragger.destroy(),this._dragger=void 0,this._componentEvents.forEach((function(t){t.remove()})),this._componentEvents=[])}},{key:"_handleDragStart",value:function(){var t=this.component;if(t.prop.enabled){t.outer.classList.add(Oi),t.container.classList.add(Oi);var e=this.prop.lerp;"boolean"!=typeof e&&(this._currentLerp=t.prop.render.lerp,t.changeProp({render:{lerp:e}}))}}},{key:"_handleDragMove",value:function(t){var e=this.component;if(e.prop.enabled){var n=this.prop,r=n.speed,o=n.reverseDir,i=t.step.x*r,s=t.step.y*r;e.targetLeft-=o?s:i,e.targetTop-=o?i:s}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(Oi),t.container.classList.remove(Oi),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1)}},{key:"_destroy",value:function(){gi(mi(i.prototype),"_destroy",this).call(this),this._removeDragger()}}])&&di(e.prototype,n),r&&di(e,r),i}(Fe);function ki(t){return(ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Si(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ji(Object(n),!0).forEach((function(e){Bi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ji(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ei(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ti(t,e){return(Ti=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Mi(t);if(e){var o=Mi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Li(this,n)}}function Li(t,e){return!e||"object"!==ki(e)&&"function"!=typeof e?Ci(t):e}function Ci(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Di(t,e,n){return(Di="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Mi(t){return(Mi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Bi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Wi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ti(t,e)}(i,t);var e,n,r,o=Ri(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ei(this,i),Bi(Ci(e=o.call(this,t,!1)),"_initText",void 0),Bi(Ci(e),"_initHTML",void 0),Bi(Ci(e),"_isPrimarySplit",void 0),Bi(Ci(e),"_container",void 0),Bi(Ci(e),"_letters",void 0),Bi(Ci(e),"_words",void 0),Bi(Ci(e),"_lines",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML,e._initText=(e._container.innerText||"no rendered text").trim(),e._initText=e._initText.replace(/\s+\n/gm,"\n"),e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Si(Si({},Di(Mi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),appendLetters:!0,appendLines:!1})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"split-text")}},{key:"container",get:function(){return this._container}},{key:"letters",get:function(){return this._letters}},{key:"words",get:function(){return this._words}},{key:"lines",get:function(){return this._lines}},{key:"_setEvents",value:function(){var t=this;Di(Mi(i.prototype),"_setEvents",this).call(this),this.splitText(),this.prop.appendLines&&this.addViewportCallback("",(function(){t.splitText()}))}},{key:"splitText",value:function(){this._isPrimarySplit||(this.container.innerHTML="",this._splitIntoWords(),this._splitIntoLetters(),this._appendWords(),this._isPrimarySplit=!0),this.prop.appendLines&&this._splitIntoLines(),this.callbacks.tbt("split",!1)}},{key:"_splitIntoWords",value:function(){var t=this,e=this._initText.split(""),n=0;e.forEach((function(e){var r=t._words[n]||{content:"",hasNewLine:!1,el:b("span",{class:"".concat(t.prefix,"__word")}),letters:[]};r.el.style.display="inline-block",t._words[n]=r;var o=e.charCodeAt(0),i=32===o||160===o,s=10===o;i&&(r.whitespace=document.createTextNode(" ")),s&&(r.br=b("br")),r.hasNewLine=s,i||s?n+=1:(r.content+=e,t.prop.appendLetters||(r.el.innerHTML=r.content))}))}},{key:"_appendWords",value:function(){var t=this;this._words.forEach((function(e){t.container.appendChild(e.el),e.whitespace&&t.container.appendChild(e.whitespace),e.br&&t.container.appendChild(e.br)}))}},{key:"_removeWords",value:function(){this._words.forEach((function(t){t.el.remove(),t.whitespace&&t.whitespace.remove(),t.br&&t.br.remove()}))}},{key:"_splitIntoLetters",value:function(){var t=this;this.prop.appendLetters&&(this._words.forEach((function(e){var n=e.content.split(""),r=[];n.forEach((function(n){var o={el:b("span",{class:"".concat(t.prefix,"__letter"),html:n}),content:n,word:e};o.el.style.display="inline-block",t._letters.push(o),r.push(o)})),e.letters=r})),this._letters.forEach((function(t){t.word.el.appendChild(t.el)})))}},{key:"_splitIntoLines",value:function(){var t=this;this._removeLines();var e=!1,n=1/0,r=!1;this.words.forEach((function(o){var i=!1,s=o.el.offsetTop;i=!(!r||!r.br)||s!==n,r=o,n=s,i&&((e={el:b("span",{class:"".concat(t.prefix,"__line")}),content:"",words:[]}).el.style.display="block",t._lines.push(e)),e&&e.words.push(o)})),this._lines.forEach((function(t){t.content=t.words.map((function(t){return t.content})).join(" ")})),this._lines.forEach((function(e){e.words.forEach((function(t){e.el.appendChild(t.el),t.br&&t.br.remove(),t.whitespace&&e.el.appendChild(t.whitespace)})),t.container.appendChild(e.el)}))}},{key:"_removeLines",value:function(){this._lines.forEach((function(t){t.el.remove()})),this._lines=[],this._appendWords()}},{key:"_destroy",value:function(){Di(Mi(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}])&&xi(e.prototype,n),r&&xi(e,r),i}(q);function Ii(t){return(Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ai(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fi(Object(n),!0).forEach((function(e){Yi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ni(t,e){return(Ni=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=$i(t);if(e){var o=$i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xi(this,n)}}function Xi(t,e){return!e||"object"!==Ii(e)&&"function"!=typeof e?Qi(t):e}function Qi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ui(t,e,n){return(Ui="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function $i(t){return($i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Yi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var qi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ni(t,e)}(i,t);var e,n,r,o=Vi(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Hi(this,i),Yi(Qi(e=o.call(this,t,!1)),"_container",void 0),Yi(Qi(e),"_containerIsWindow",void 0),Yi(Qi(e),"_outerCursor",void 0),Yi(Qi(e),"_innerCursor",void 0),Yi(Qi(e),"_animationFrame",void 0),Yi(Qi(e),"_currentFPS",void 0),Yi(Qi(e),"_canPlay",void 0),Yi(Qi(e),"_x",void 0),Yi(Qi(e),"_xTarget",void 0),Yi(Qi(e),"_y",void 0),Yi(Qi(e),"_yTarget",void 0);var r=y(e.prop.container);if(!r)throw new Error("No cursor container for ".concat(e.prop.container));return e._container=r,e._containerIsWindow=r instanceof Window,e._x=0,e._xTarget=0,e._y=0,e._yTarget=0,e._currentFPS=60,e._canPlay=e.prop.run,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Ai(Ai({},Ui($i(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},autoStop:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"custom-cursor")}},{key:"container",get:function(){return this._container}},{key:"eventsContainer",get:function(){return this._container}},{key:"domContainer",get:function(){return this.container instanceof Window?this._app.html:this.container}},{key:"outerCursor",get:function(){return this._outerCursor}},{key:"innerCursor",get:function(){return this._innerCursor}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"_constructor",value:function(){Ui($i(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;Ui($i(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new ft,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})),this._canPlay&&this.enable(),this.addEventListeners(e,"mouseenter",this._handleMouseEnter.bind(this)),this.addEventListeners(e,"mouseleave",this._handleMouseLeave.bind(this)),this.addEventListeners(e,"mousemove",this._handleMouseMove.bind(this)),this.addEventListeners(e,"mousedown",this._handleMouseDown.bind(this)),this.addEventListeners(e,"mouseup",this._handleMouseUp.bind(this)),this.addEventListeners(window,"blur",this._handleWindowBlur.bind(this))}},{key:"_createCursor",value:function(){var t=this.prefix,e=this.container,n=this.domContainer;this.prop.hideNativeCursor&&(n.style.cursor="none",n.classList.add("hide-defaut-cursor")),n.classList.add("".concat(t,"-container")),this._outerCursor=b("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:n}),this._innerCursor=b("div",{class:"".concat(t,"__inner disabled"),parent:this._outerCursor}),this.callbacks.tbt("create",{outerCursor:this.outerCursor,innerCursor:this.innerCursor})}},{key:"_destroyCursor",value:function(){var t=this.prefix,e=this.domContainer;e.style.cursor="",e.classList.remove("hide-defaut-cursor"),e.classList.remove("".concat(t,"-container")),this._outerCursor.remove(),this._innerCursor.remove()}},{key:"_handleMouseEnter",value:function(t){this._xTarget=t.clientX,this._x=this._xTarget,this._yTarget=t.clientY,this._y=this._yTarget,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._xTarget=t.clientX,this._yTarget=t.clientY,this.outerCursor.classList.add("in-action"),this._canPlay&&this._animationFrame.play()}},{key:"_handleMouseDown",value:function(t){1===t.which&&(this.outerCursor.classList.add("click"),this.innerCursor.classList.add("click"))}},{key:"_handleMouseUp",value:function(){this.outerCursor.classList.remove("click"),this.innerCursor.classList.remove("click")}},{key:"_handleWindowBlur",value:function(){this._handleMouseUp()}},{key:"render",value:function(){var t=this.prop,e=this.domContainer,n=t.render,r=n.normalizeLerp,o=n.lerp,i=n.lerpToFixed,s=r?60/this._currentFPS:1;if(this._x=J(this._x,this._xTarget,o*s,.02),this._y=J(this._y,this._yTarget,o*s,.02),"number"==typeof i){var a=Math.round(Math.abs(i));this._x=parseFloat(this._x.toFixed(a)),this._y=parseFloat(this._y.toFixed(a))}var c=this._x,u=this._y;if(!this._containerIsWindow){var l=e.getBoundingClientRect();c-=l.left,u-=l.top}this.outerCursor.style.transform="translate(".concat(c,"px, ").concat(u,"px)"),t.autoStop&&this._x===this._xTarget&&this._y===this._yTarget&&this._animationFrame.pause(),this._callbacks.tbt("render",{x:c,y:u})}},{key:"enable",value:function(){this._canPlay=!0,this._animationFrame.isPlaying||(this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play())}},{key:"disable",value:function(){this._canPlay=!1,this._animationFrame.isPlaying&&(this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause())}},{key:"_destroy",value:function(){Ui($i(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}])&&zi(e.prototype,n),r&&zi(e,r),i}(q),Ki={common:t,listeners:r,math:e};window.Vevet=i})()})();
12
+ (()=>{var t={554:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[s]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=e&&!e.nodeType&&e,y=d&&t&&!t.nodeType&&t,v=y&&y.exports===d,_=v&&f.process,b=function(){try{var t=y&&y.require&&y.require("util").types;return t||_&&_.binding&&_.binding("util")}catch(e){}}(),g=b&&b.isTypedArray;function m(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var w,O,P,k=Array.prototype,j=Function.prototype,E=Object.prototype,S=p["__core-js_shared__"],x=j.toString,T=E.hasOwnProperty,R=(w=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=E.toString,C=x.call(Object),D=RegExp("^"+x.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,W=p.Symbol,B=p.Uint8Array,I=M?M.allocUnsafe:void 0,F=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),A=Object.create,H=E.propertyIsEnumerable,z=k.splice,N=W?W.toStringTag:void 0,V=function(){try{var t=dt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),X=M?M.isBuffer:void 0,Q=Math.max,U=Date.now,Y=dt(p,"Map"),$=dt(Object,"create"),q=function(){function t(){}return function(e){if(!Et(e))return{};if(A)return A(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Z(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var n=wt(t),r=!n&&mt(t),o=!n&&!r&&Pt(t),i=!n&&!r&&!o&&xt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!T.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yt(u,c))||a.push(u);return a}function et(t,e,n){(void 0!==n&&!gt(t[e],n)||void 0===n&&!(e in t))&&ot(t,e,n)}function nt(t,e,n){var r=t[e];T.call(t,e)&&gt(r,n)&&(void 0!==n||e in t)||ot(t,e,n)}function rt(t,e){for(var n=t.length;n--;)if(gt(t[n][0],e))return n;return-1}function ot(t,e,n){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}K.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if($){var n=e[t];return n===r?void 0:n}return T.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return $?void 0!==e[t]:T.call(e,t)},K.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$&&void 0===e?r:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,n=rt(e,t);return!(n<0)&&(n==e.length-1?e.pop():z.call(e,n,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,n=rt(e,t);return n<0?void 0:e[n][1]},J.prototype.has=function(t){return rt(this.__data__,t)>-1},J.prototype.set=function(t,e){var n=this.__data__,r=rt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(Y||J),string:new K}},G.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return pt(this,t).get(t)},G.prototype.has=function(t){return pt(this,t).has(t)},G.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new J,this.size=0},Z.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,e){var n=this.__data__;if(n instanceof J){var r=n.__data__;if(!Y||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(t,e),this.size=n.size,this};var it,st=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[it?s:++r];if(!1===e(o[a],a,o))break}return t};function at(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=T.call(t,N),n=t[N];try{t[N]=void 0;var r=!0}catch(i){}var o=L.call(t);r&&(e?t[N]=n:delete t[N]);return o}(t):function(t){return L.call(t)}(t)}function ct(t){return St(t)&&at(t)==i}function ut(t){return!(!Et(t)||function(t){return!!R&&R in t}(t))&&(kt(t)?D:c).test(function(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}function lt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&T.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,o){t!==e&&st(e,(function(i,s){if(o||(o=new Z),Et(i))!function(t,e,n,r,o,i,s){var c=_t(t,n),u=_t(e,n),l=s.get(u);if(l)return void et(t,n,l);var f=i?i(c,u,n+"",t,e,s):void 0,h=void 0===f;if(h){var p=wt(u),d=!p&&Pt(u),y=!p&&!d&&xt(u);f=u,p||d||y?wt(c)?f=c:St(m=c)&&Ot(m)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(c):d?(h=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=I?I(n):new t.constructor(n);return t.copy(r),r}(u,!0)):y?(h=!1,v=u,_=!0?(b=v.buffer,g=new b.constructor(b.byteLength),new B(g).set(new B(b)),g):v.buffer,f=new v.constructor(_,v.byteOffset,v.length)):f=[]:function(t){if(!St(t)||at(t)!=a)return!1;var e=F(t);if(null===e)return!0;var n=T.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==C}(u)||mt(u)?(f=c,mt(c)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ot(n,a,c):nt(n,a,c)}return n}(t,Tt(t))}(c):Et(c)&&!kt(c)||(f=function(t){return"function"!=typeof t.constructor||vt(t)?{}:q(F(t))}(u))):h=!1}var v,_,b,g;var m;h&&(s.set(u,f),o(f,u,r,i,s),s.delete(u));et(t,n,f)}(t,e,s,n,ft,r,o);else{var c=r?r(_t(t,s),i,s+"",t,e,o):void 0;void 0===c&&(c=i),et(t,s,c)}}),Tt)}function ht(t,e){return bt(function(t,e,n){return e=Q(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Q(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),m(t,this,a)}}(t,e,Ct),t+"")}function pt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ut(n)?n:void 0}function yt(t,e){var n=typeof t;return!!(e=null==e?o:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function _t(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bt=function(t){var e=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Ct);function gt(t,e){return t===e||t!=t&&e!=e}var mt=ct(function(){return arguments}())?ct:function(t){return St(t)&&T.call(t,"callee")&&!H.call(t,"callee")},wt=Array.isArray;function Ot(t){return null!=t&&jt(t.length)&&!kt(t)}var Pt=X||function(){return!1};function kt(t){if(!Et(t))return!1;var e=at(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function St(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return St(t)&&jt(t.length)&&!!l[at(t)]};function Tt(t){return Ot(t)?tt(t,!0):lt(t)}var Rt,Lt=(Rt=function(t,e,n,r){ft(t,e,n,r)},ht((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Rt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!Et(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&yt(e,n.length):"string"==r&&e in n)&&gt(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Rt(t,s,n,o)}return t})));function Ct(t){return t}t.exports=Lt},796:(t,e,n)=>{t.exports=n(643)},264:t=>{"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=n},518:t=>{var e,n,r,o,i,s,a,c,u,l,f,h,p,d,y,v=!1;function _(){if(!v){v=!0;var t=navigator.userAgent,_=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),b=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(h=/\b(iPhone|iP[ao]d)/.exec(t),p=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),d=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),f=!!/Win64/.exec(t),_){(e=_[1]?parseFloat(_[1]):_[5]?parseFloat(_[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var g=/(?:Trident\/(\d+.\d+))/.exec(t);s=g?parseFloat(g[1])+4:e,n=_[2]?parseFloat(_[2]):NaN,r=_[3]?parseFloat(_[3]):NaN,(o=_[4]?parseFloat(_[4]):NaN)?(_=/(?:Chrome\/(\d+\.\d+))/.exec(t),i=_&&_[1]?parseFloat(_[1]):NaN):i=NaN}else e=n=r=i=o=NaN;if(b){if(b[1]){var m=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);a=!m||parseFloat(m[1].replace("_","."))}else a=!1;c=!!b[2],u=!!b[3]}else a=c=u=!1}}var b={ie:function(){return _()||e},ieCompatibilityMode:function(){return _()||s>e},ie64:function(){return b.ie()&&f},firefox:function(){return _()||n},opera:function(){return _()||r},webkit:function(){return _()||o},safari:function(){return b.webkit()},chrome:function(){return _()||i},windows:function(){return _()||c},osx:function(){return _()||a},linux:function(){return _()||u},iphone:function(){return _()||h},mobile:function(){return _()||h||p||l||y},nativeApp:function(){return _()||d},android:function(){return _()||l},ipad:function(){return _()||p}};t.exports=b},534:(t,e,n)=>{"use strict";var r,o=n(264);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&r&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},643:(t,e,n)=>{"use strict";var r=n(518),o=n(534);function i(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=10*e,o=10*n,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(1==t.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=i}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t={};n.r(t),n.d(t,{mergeWithoutArrays:()=>u,randID:()=>s,timeoutCallback:()=>l});var e={};n.r(e),n.d(e,{boundVal:()=>K,lerp:()=>J,scopeProgress:()=>G});var r={};n.r(r),n.d(r,{intersectionObserverSupported:()=>Et,onScroll:()=>jt});var o={};n.r(o);var i={};function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",e="".concat(+new Date,"_").concat(Math.round(1e3*Math.random()));return"".concat(t,"_").concat(e)}n.r(i),n.d(i,{AnimationFrame:()=>ft,Application:()=>Te,Callbacks:()=>T,Component:()=>q,Ctx2D:()=>fo,Ctx2DPrerender:()=>Eo,CustomCursor:()=>cs,Dragger:()=>Lr,DraggerDirection:()=>Gr,DraggerMove:()=>Hr,GeneralTypes:()=>o,Module:()=>F,MutableProp:()=>D,Page:()=>Je,PageLoad:()=>Pe,Plugin:()=>Fe,Preloader:()=>ir,ProgressPreloader:()=>br,ScrollBar:()=>No,ScrollEventsBase:()=>ei,ScrollView:()=>di,SmoothScroll:()=>kt,SmoothScrollDragPlugin:()=>Bi,SmoothScrollKeyboardPlugin:()=>Pi,SplitText:()=>qi,StaticTimeline:()=>Dn,Timeline:()=>Un,Viewport:()=>ye,WheelHandler:()=>hn,utils:()=>us});var a=n(554),c=n.n(a);function u(t,e){return c()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function l(t,e){0===e?t():setTimeout((function(){t()}),e)}function f(t,e){return h(t,e)}function h(t,e){return t===e||null!==t&&h(t.parentNode,e)}function p(t){return t instanceof HTMLElement||t instanceof Element}function d(t){return t instanceof Window}function y(t,e){if(d(t))return t;if(p(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelector(t)}return document.querySelector(t)}function v(t,e){if(t instanceof NodeList)return t;if(p(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelectorAll(t)}return document.querySelectorAll(t)}function _(t,e,n){const r=e.split(" ");for(let o=0;o<r.length;o++)void 0===n?t.classList.toggle(r[o]):n?t.classList.add(r[o]):t.classList.remove(r[o])}function b(t,e={}){const n=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)_(t,e,!0);else for(let n=0;n<t.length;n++)_(t[n],e,!0)}(n,e.class),e.id&&n.setAttribute("id",e.id),e.attr)for(let r=0,o=e.attr.length;r<o;r++){const t=e.attr[r];n.setAttribute(t[0],t[1])}if(e.parent&&e.parent.appendChild(n),e.html&&(n.innerHTML=e.html),e.children)for(let r=0,o=e.children.length;r<o;r++)n.appendChild(e.children[r]);return n}const g=[];function m(t,e,n,r){if(void 0!==r){const o={passive:!1,once:!1};r.once&&(o.once=!0),r.passive&&(o.passive=!0),t.addEventListener(e,n,o)}else t.addEventListener(e,n);const o=`${Math.random()}-${+new Date}`;return g.push({id:o,el:t,target:e,callback:n}),{id:o,remove:w.bind(this,o)}}function w(t){const e=[];for(let n=0,r=g.length;n<r;n++){const r=g[n];r.id===t?r.el.removeEventListener(r.target,r.callback):e.push(r)}}var O=n(796),P=n.n(O);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var T=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];E(this,t),x(this,"_app",void 0),x(this,"_callbacks",void 0),this._app=window.vevetApp,this._callbacks=[],e&&this._init()}var e,n,r;return e=t,(n=[{key:"callbacks",get:function(){return this._callbacks}},{key:"_init",value:function(){this._constructor(),this._setEvents()}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s("callback"),o={id:r,on:!0,data:j({target:t,do:e},n)};return this._callbacks.push(o),this._onAdd(r),{id:r,remove:this.remove.bind(this,r)}}},{key:"_onAdd",value:function(t){}},{key:"remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1,o=this._callbacks.filter((function(o){return o.id!==t||!(!o.data.protected||n)||(e._onRemove(t),r=!0,!1)}));return this._callbacks=o,r}},{key:"_onRemove",value:function(t){}},{key:"removeAll",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._callbacks.length>0;)this.remove(this._callbacks[0].id,t)}},{key:"turn",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.get(t);return!!n&&(n.on=e,this._onTurn(t),!0)}},{key:"_onTurn",value:function(t){}},{key:"get",value:function(t){var e=this._callbacks.filter((function(e){return e.id===t}));return e.length>0&&e[0]}},{key:"_trigger",value:function(t,e){if(t.on){var n=t.data,r=n.timeout,o=n.once,i=t.data.do;r?l(e?this._triggerFunc.bind(this,i,e):this._triggerFunc.bind(this,i,!1),r):e?this._triggerFunc(i,e):this._triggerFunc(i,!1),o&&this.remove(t.id)}}},{key:"_triggerFunc",value:function(t,e){e?t(e):t()}},{key:"tbt",value:function(t,e){var n=this;this._callbacks.forEach((function(r){r.data.target===t&&n._trigger(r,e)}))}},{key:"destroy",value:function(){this.removeAll(!0)}}])&&S(e.prototype,n),r&&S(e,r),t}();function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Responsive Prop";R(this,t),C(this,"_initProp",void 0),C(this,"_onResponsive",void 0),C(this,"_onChange",void 0),C(this,"_name",void 0),C(this,"_app",void 0),C(this,"_refProp",void 0),C(this,"_prop",void 0),C(this,"_responsiveRules",[]),C(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=n,this._onChange=r,this._name=o,this._app=window.vevetApp,this._refProp=u({},e),this._prop=u({},e)}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"addResponsiveProp",value:function(t){this._responsiveRules.push(t),void 0===this._viewportCallback&&(this._viewportCallback=this._app.viewport.add("w",this._responseProp.bind(this,!0),{name:this._name})),this._responseProp()}},{key:"_responseProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._responsiveRules,n=this._app,r=n.viewport,o=r.width,i=!1,s=u({},this._refProp);e.forEach((function(t){var e=t.settings,a=t.breakpoint;if("number"==typeof a)o<=t.breakpoint&&(i=u(s,e));else if("string"==typeof a){var c=a.toLowerCase();("d"===c&&r.isDesktop||"t"===c&&r.isTablet||"p"===c&&r.isPhone)&&(i=u(s,e)),("phone"===c&&n.isPhone||"tablet"===c&&n.isTablet||"mobile"===c&&n.isMobile)&&(i=u(s,e))}})),this._prop=u(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=u(this._prop,t),this._refProp=u(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}])&&L(e.prototype,n),r&&L(e,r),t}();function M(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function W(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];W(this,t),I(this,"_mutableProp",void 0),I(this,"_callbacks",void 0),I(this,"_listeners",void 0),I(this,"_app",void 0),I(this,"_inited",!1),I(this,"_destroyed",void 0),I(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:M(),this._destroyed=!1,this._listeners=[],this._callbacks=new T;var r=u(this._getDefaultProp(),e||{});this._mutableProp=new D(r,this._onPropResponsive.bind(this),this._onPropChange.bind(this),this.name),n&&this.init()}var e,n,r;return e=t,(n=[{key:"_getDefaultProp",value:function(){return{parent:!1}}},{key:"prop",get:function(){return this._mutableProp.prop}},{key:"callbacks",get:function(){return this._callbacks}},{key:"prefix",get:function(){return""}},{key:"name",get:function(){return this.constructor.name}},{key:"inited",get:function(){return this._inited}},{key:"destroyed",get:function(){return this._destroyed}},{key:"addResponsiveProp",value:function(t){if(this._inited)throw new Error("Responsive properties cannot be added because the class instance is already initialized");this._mutableProp.addResponsiveProp(t)}},{key:"changeProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._mutableProp.changeProp(t),this._callbacks.tbt("changeProp",!1)}},{key:"_onPropResponsive",value:function(){this._onPropMutate()}},{key:"_onPropChange",value:function(t){this._onPropMutate()}},{key:"_onPropMutate",value:function(){}},{key:"init",value:function(){var t=this;this._inited||(this._inited=!0,this._constructor(),this._setEvents(),this.prop.parent&&this.prop.parent.addCallback("destroy",(function(){t.destroy()})))}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"addViewportCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{name:this.constructor.name},r=this._app.viewport.add(t,e,n);return this._viewportCallbacks.push(r),r}},{key:"addCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.callbacks.add(t,e,n);return r}},{key:"addEventListeners",value:function(t,e,n,r){var o=m(t,e,n,r);return this._listeners.push(o),o}},{key:"destroy",value:function(){this.destroyed||this._destroy()}},{key:"_destroy",value:function(){this._callbacks.tbt("destroy",!1),this._callbacks.destroy(),this._mutableProp.destroy(),this._viewportCallbacks.forEach((function(t){t.remove()})),this._listeners.forEach((function(t){t.remove()})),this._destroyed=!0}}])&&B(e.prototype,n),r&&B(e,r),t}();function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return(N="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Y(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function V(t,e){return(V=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Y(t);if(e){var o=Y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(t,e){return!e||"object"!==A(e)&&"function"!=typeof e?U(t):e}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Y(t){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&V(t,e)}(i,t);var e,n,r,o=X(i);function i(){var t;H(this,i);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return $(U(t=o.call.apply(o,[this].concat(n))),"_plugins",void 0),t}return e=i,(n=[{key:"addPlugin",value:function(t){void 0===this._plugins&&(this._plugins=[]),this._plugins.push(t),t.inited||t.initPlugin(this)}},{key:"_destroyPlugins",value:function(){this._plugins&&this._plugins.forEach((function(t){t.destroy()}))}},{key:"_destroy",value:function(){N(Y(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&z(e.prototype,n),r&&z(e,r),i}(F);function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t<e[0]?e[0]:t>e[1]?e[1]:t}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001,o=t*(1-n)+e*n,i=Math.abs(e-o);return i<=r?e:o}function G(t,e){return(t-e[0])/(e[1]-e[0])}function Z(t){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(n),!0).forEach((function(e){lt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ot(t,e,n){return(ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ut(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function it(t,e){return(it=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ut(t);if(e){var o=ut(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return at(this,n)}}function at(t,e){return!e||"object"!==Z(e)&&"function"!=typeof e?ct(t):e}function ct(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(t){return(ut=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ft=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&it(t,e)}(i,t);var e,n,r,o=st(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return nt(this,i),lt(ct(e=o.call(this,t,!1)),"_isPlaying",void 0),lt(ct(e),"_frame",void 0),lt(ct(e),"_frameIndex",void 0),lt(ct(e),"_timeStamp",void 0),lt(ct(e),"_prevFrameTime",void 0),e._isPlaying=!1,e._frame=null,e._frameIndex=-1,e._timeStamp=null,e._prevFrameTime=null,n&&e.init(),e}return e=i,(n=[{key:"isPlaying",get:function(){return this._isPlaying}},{key:"_getDefaultProp",value:function(){return et(et({},ot(ut(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){ot(ut(i.prototype),"_constructor",this).call(this),this._create()}},{key:"_create",value:function(){this.prop.run&&this.play()}},{key:"_onPropMutate",value:function(){this._frameIndex=-1,this._timeStamp=null,this._prevFrameTime=null,this.prop.run?this._play():this._pause()}},{key:"play",value:function(){this.destroyed||this.prop.run||this.changeProp({run:!0})}},{key:"_play",value:function(){this.isPlaying||(this._isPlaying=!0,this._frame=window.requestAnimationFrame(this._animate.bind(this)))}},{key:"pause",value:function(){this.prop.run&&this.changeProp({run:!1})}},{key:"_pause",value:function(){this.isPlaying&&(this._frame&&(window.cancelAnimationFrame(this._frame),this._frame=null),this._isPlaying=!1)}},{key:"_animate",value:function(t){if(this._isPlaying){this._frame=window.requestAnimationFrame(this._animate.bind(this));var e=+new Date;null==this._timeStamp&&(this._timeStamp=t),null==this._prevFrameTime&&(this._prevFrameTime=e);var n=Math.floor((t-this._timeStamp)/(1e3/this.prop.fps));if(!(n<=this._frameIndex)){this._frameIndex=n;var r=e-this._prevFrameTime,o=K(0===r?1e3/60:Math.floor(1e3/r),[1,1/0]);this.callbacks.tbt("frame",{fps:this.prop.fps,realFPS:o,prevFrameDuration:e-this._prevFrameTime}),this._prevFrameTime=+new Date}}}},{key:"_destroy",value:function(){this.pause(),ot(ut(i.prototype),"_destroy",this).call(this)}}])&&rt(e.prototype,n),r&&rt(e,r),i}(q);function ht(t){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(n),!0).forEach((function(e){Pt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _t(t,e,n){return(_t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ot(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function bt(t,e){return(bt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ot(t);if(e){var o=Ot(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mt(this,n)}}function mt(t,e){return!e||"object"!==ht(e)&&"function"!=typeof e?wt(t):e}function wt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ot(t){return(Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var kt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bt(t,e)}(i,t);var e,n,r,o=gt(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];yt(this,i),Pt(wt(e=o.call(this,t,!1)),"_outer",void 0),Pt(wt(e),"_container",void 0),Pt(wt(e),"_containerExists",void 0),Pt(wt(e),"_elements",void 0),Pt(wt(e),"_elementsLength",void 0),Pt(wt(e),"_targetLeft",void 0),Pt(wt(e),"_targetTop",void 0),Pt(wt(e),"_scrollLeft",void 0),Pt(wt(e),"_scrollTop",void 0),Pt(wt(e),"_scrollWidth",void 0),Pt(wt(e),"_scrollHeight",void 0),Pt(wt(e),"_clientWidth",void 0),Pt(wt(e),"_clientHeight",void 0),Pt(wt(e),"_instant",void 0),Pt(wt(e),"_animationFrame",void 0),Pt(wt(e),"_outerAnimationFrameEvent",void 0),Pt(wt(e),"_currentFPS",void 0);var r=e.prop.selectors;if(e._targetLeft=0,e._targetTop=0,e._scrollLeft=0,e._scrollTop=0,e._scrollWidth=0,e._scrollHeight=0,e._clientWidth=0,e._clientHeight=0,e._instant=!1,e._animationFrame=void 0,e._outerAnimationFrameEvent=void 0,e._currentFPS=60,e._outer=y(r.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(r.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=y(".".concat(e.prefix,"__container"),e.outer);return p(s)?(e._container=s,e._containerExists=!0):(e._container=b("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),r.elements?e._elements=Array.from(v(r.elements,e._outer)):e._elements=[e._container],e._elementsLength=e._elements.length,e._elements.forEach((function(t){t.style.willChange="transform"})),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"smooth-scroll")}},{key:"outer",get:function(){return this._outer}},{key:"container",get:function(){return this._container}},{key:"elements",get:function(){return this._elements}},{key:"targetLeft",get:function(){return this._targetLeft},set:function(t){this.targetLeftBound=t,this._enable()}},{key:"targetLeftBound",get:function(){return this._targetLeft},set:function(t){var e=this.prop.overscroll&&this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableWidth+(this.prop.overscroll&&this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetLeft=K(t,[e,n])}},{key:"targetTop",get:function(){return this._targetTop},set:function(t){this.targetTopBound=t,this._enable()}},{key:"targetTopBound",get:function(){return this._targetTop},set:function(t){var e=this.prop.overscroll&&!this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableHeight+(this.prop.overscroll&&!this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetTop=K(t,[e,n])}},{key:"scrollLeft",get:function(){return this._scrollLeft},set:function(t){this.targetLeftBound=t,this._scrollLeft=this._targetLeft,this._enable()}},{key:"scrollTop",get:function(){return this._scrollTop},set:function(t){this.targetTopBound=t,this._scrollTop=this._targetTop,this._enable()}},{key:"scrollWidth",get:function(){return this._scrollWidth}},{key:"scrollHeight",get:function(){return this._scrollHeight}},{key:"clientWidth",get:function(){return this._clientWidth}},{key:"clientHeight",get:function(){return this._clientHeight}},{key:"maxScrollableWidth",get:function(){return this.scrollWidth-this.clientWidth}},{key:"maxScrollableHeight",get:function(){return this.scrollHeight-this.clientHeight}},{key:"_getDefaultProp",value:function(){return dt(dt({},_t(Ot(i.prototype),"_getDefaultProp",this).call(this)),{},{selectors:{outer:"#".concat(this.prefix),elements:!1},enabled:!0,animationFrame:!1,recalculateSizes:!0,useWheel:!0,autoStop:!0,isHorizontal:!1,stopPropagation:!0,useWillChange:!0,render:{lerp:.1,lerpToFixed:2,approximation:.1,normalizeLerp:!1},overscroll:{friction:.5,max:250}})}},{key:"_constructor",value:function(){_t(Ot(i.prototype),"_constructor",this).call(this),this._toggle()}},{key:"_setEvents",value:function(){var t=this;this.resize(),this.addViewportCallback("",(function(){t.resize(!0)})),this.addEventListeners(this.outer,"wheel",(function(e){t._handleWheel(e)})),this.addEventListeners(this.outer,"scroll",(function(){t.outer.scrollTop=0,t.outer.scrollLeft=0}))}},{key:"_onPropMutate",value:function(){_t(Ot(i.prototype),"_onPropMutate",this).call(this),this.resize(),this._toggle()}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.container,n=this.outer;this._clientWidth=n.clientWidth,this._clientHeight=n.clientHeight,this._scrollWidth=K(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=K(e.clientHeight,[this.clientHeight,1/0]),t&&(this._instant=!0),t&&(this.targetLeft=parseInt(this.targetLeft.toFixed(0),10),this.targetTop=parseInt(this.targetTop.toFixed(0),10));var r=this.maxScrollableHeight>0||this.maxScrollableWidth>0;n.classList.toggle("has-scroll",r),n.classList.toggle("no-scroll",!r),this._updateElementsProp(),this.callbacks.tbt("resize",!1)}},{key:"_recalculateSizes",value:function(){var t=this.container,e=t.clientHeight,n=t.clientWidth;e===this.scrollHeight&&n===this.scrollWidth||this.resize()}},{key:"_updateElementsProp",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t];e.smoothScrollLeft=this.scrollLeft,e.smoothScrollTop=this.scrollTop;var n=e.getAttribute("".concat(this.prefix,"-ease"));if(n)try{e.smoothScrollLerpEase=parseFloat(n)}catch(r){}}}},{key:"_handleWheel",value:function(t){var e=this.prop;if(e.enabled&&e.useWheel){(e.stopPropagation||!e.stopPropagation&&(this.scrollLeft>0&&this.scrollLeft<this.maxScrollableWidth||this.scrollTop>0&&this.scrollTop<this.maxScrollableHeight))&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault());var n=P()(t);this.targetLeftBound+=e.isHorizontal?n.pixelY:n.pixelX,this.targetTopBound+=e.isHorizontal?n.pixelX:n.pixelY,this._enable(),this.callbacks.tbt("wheel",t)}}},{key:"_toggle",value:function(){this.prop.enabled?this._enable():this._disable()}},{key:"_enable",value:function(){var t=this;this.prop.enabled&&(this.prop.animationFrame&&!this._outerAnimationFrameEvent?this._outerAnimationFrameEvent=this.prop.animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})):(this._animationFrame||(this._animationFrame=new ft,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()}))),this._animationFrame.play()))}},{key:"_disable",value:function(){this._outerAnimationFrameEvent&&this.prop.animationFrame&&this._outerAnimationFrameEvent.remove(),this._animationFrame&&this._animationFrame.pause()}},{key:"render",value:function(){var t=this.prop;t.recalculateSizes&&this._recalculateSizes(),this._calcScroll(),this._calcElements(),this._renderElements(),this._instant&&(this._instant=!1),this.callbacks.tbt("scroll",!1);var e=Math.abs(this.targetTop-this.scrollTop);0===Math.abs(this.targetLeft-this.scrollLeft)&&0===e&&t.autoStop&&(this._disable(),this.callbacks.tbt("approximate",!1))}},{key:"_calcScroll",value:function(){var t=this.prop.overscroll;t&&(this.targetLeft<0?this.targetLeftBound=this._lerp(this.targetLeftBound,0,t.friction):this.targetLeft>this.maxScrollableWidth&&(this.targetLeftBound=this._lerp(this.targetLeftBound,this.maxScrollableWidth,t.friction)),this.targetTop<0?this.targetTopBound=this._lerp(this.targetTopBound,0,t.friction):this.targetTop>this.maxScrollableHeight&&(this.targetTopBound=this._lerp(this.targetTopBound,this.maxScrollableHeight,t.friction))),this._scrollLeft=this._lerp(this.scrollLeft,this.targetLeft),this._scrollTop=this._lerp(this.scrollTop,this.targetTop)}},{key:"_calcElements",value:function(){for(var t=this._getLerpEase(),e=0;e<this._elementsLength;e+=1){var n=this._elements[e],r=this._getLerpEase(n);r===t?(n.smoothScrollLeft=this._scrollLeft,n.smoothScrollTop=this._scrollTop):(n.smoothScrollLeft=this._lerp(n.smoothScrollLeft,this._targetLeft,r),n.smoothScrollTop=this._lerp(n.smoothScrollTop,this._targetTop,r))}}},{key:"_lerp",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getLerpEase(),r=this.prop.render,o=r.lerpToFixed,i=r.approximation,s=this._instant?1:n,a=J(t,e,s,i);if("number"==typeof o){var c=Math.round(Math.abs(o));return parseFloat(a.toFixed(c))}return a}},{key:"_getLerpEase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.prop.render,n=e.lerp,r=e.normalizeLerp,o=r?60/this._currentFPS:1;return t&&t.smoothScrollLerpEase||n*o}},{key:"_renderElements",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t],n=-e.smoothScrollLeft,r=-e.smoothScrollTop;e.style.transform="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ".concat(n,", ").concat(r,", 0,1)")}}},{key:"scrollTo",value:function(){var t=arguments;if(1===t.length&&"object"===ht(t[0])){var e=t[0],n=e.top,r=e.left,o=e.behavior;void 0!==r&&("smooth"===o?this.targetLeftBound=r:this.scrollLeft=r),void 0!==n&&("smooth"===o?this.targetTopBound=n:this.scrollTop=n),"smooth"===o&&this._enable()}"number"!=typeof t[0]&&"number"!=typeof t[1]||("number"==typeof t[0]&&(this.scrollLeft=t[0]),"number"==typeof t[1]&&(this.scrollTop=t[1]))}},{key:"_destroy",value:function(){if(_t(Ot(i.prototype),"_destroy",this).call(this),this._disable(),this._animationFrame&&this._animationFrame.destroy(),!this._containerExists){for(;this._container.firstChild;)this._outer.appendChild(this._container.firstChild);this._container.remove()}this._outer.classList.remove(this.prefix),this._elements.forEach((function(t){t.style.transform="",t.style.willChange=""}))}}])&&vt(e.prototype,n),r&&vt(e,r),i}(q);function jt(t,e,n){var r,o=[];t instanceof kt?t.addCallback("scroll",(function(){e({scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})})):(r="string"==typeof t?y(t):t)&&o.push(m(r,"scroll",(function(){var t=r instanceof Window?r.pageYOffset:r.scrollTop,n=r instanceof Window?r.pageXOffset:r.scrollLeft;e({scrollTop:t,scrollLeft:n})}),n?{passive:n.passive}:void 0));return{remove:function(){o.forEach((function(t){t.remove()}))}}}function Et(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}var St=/iPhone/i,xt=/iPod/i,Tt=/iPad/i,Rt=/\biOS-universal(?:.+)Mac\b/i,Lt=/\bAndroid(?:.+)Mobile\b/i,Ct=/Android/i,Dt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Mt=/Silk/i,Wt=/Windows Phone/i,Bt=/\bWindows(?:.+)ARM\b/i,It=/BlackBerry/i,Ft=/BB10/i,At=/Opera Mini/i,Ht=/\b(CriOS|Chrome)(?:.+)Mobile/i,zt=/Mobile(?:.+)Firefox\b/i,Nt=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Vt(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=e.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var o=function(t){return function(e){return e.test(t)}}(n),i={apple:{phone:o(St)&&!o(Wt),ipod:o(xt),tablet:!o(St)&&(o(Tt)||Nt(e))&&!o(Wt),universal:o(Rt),device:(o(St)||o(xt)||o(Tt)||o(Rt)||Nt(e))&&!o(Wt)},amazon:{phone:o(Dt),tablet:!o(Dt)&&o(Mt),device:o(Dt)||o(Mt)},android:{phone:!o(Wt)&&o(Dt)||!o(Wt)&&o(Lt),tablet:!o(Wt)&&!o(Dt)&&!o(Lt)&&(o(Mt)||o(Ct)),device:!o(Wt)&&(o(Dt)||o(Mt)||o(Lt)||o(Ct))||o(/\bokhttp\b/i)},windows:{phone:o(Wt),tablet:o(Bt),device:o(Wt)||o(Bt)},other:{blackberry:o(It),blackberry10:o(Ft),opera:o(At),firefox:o(zt),chrome:o(Ht),device:o(It)||o(Ft)||o(At)||o(zt)||o(Ht)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Xt,Qt,Ut=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},Yt=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},$t=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},qt=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},Kt=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},Jt=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},Gt=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Zt=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],te=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ee(t){return t?re(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new Jt:"undefined"!=typeof navigator?re(navigator.userAgent):"undefined"!=typeof process&&process.version?new $t(process.version.slice(1)):null}function ne(t){return""!==t&&Zt.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function re(t){var e=ne(t);if(!e)return null;var n=e[0],r=e[1];if("searchbot"===n)return new Kt;var o=r[1]&&r[1].split(/[._]/).slice(0,3);o?o.length<3&&(o=Ut(o,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-o.length))):o=[];var i=o.join("."),s=function(t){for(var e=0,n=te.length;e<n;e++){var r=te[e],o=r[0];if(r[1].exec(t))return o}return null}(t),a=Gt.exec(t);return a&&a[1]?new qt(n,i,s,a[1]):new Yt(n,i,s)}class oe extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class ie{static fn(t){return(...e)=>new ie(((n,r,o)=>{e.push(o),t(...e).then(n,r)}))}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,n)=>{this._reject=n;const r=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};Object.defineProperties(r,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&r.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,n(t)}),r)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new oe(t))}}get isCanceled(){return this._isCanceled}}function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ce(t,e,n){return(ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=pe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ue(t,e){return(ue=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=pe(t);if(e){var o=pe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fe(this,n)}}function fe(t,e){return!e||"object"!==se(e)&&"function"!=typeof e?he(t):e}function he(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pe(t){return(pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function de(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.setPrototypeOf(ie.prototype,Promise.prototype),function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(Xt||(Xt={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(Qt||(Qt={}));var ye=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ue(t,e)}(i,t);var e,n,r,o=le(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),de(he(t=o.call(this,!1)),"_width",void 0),de(he(t),"_height",void 0),de(he(t),"_prevSize",void 0),de(he(t),"_isDesktop",void 0),de(he(t),"_isTablet",void 0),de(he(t),"_isPhone",void 0),t._width=0,t._height=0,t._prevSize={w:0,h:0},t._isDesktop=!1,t._isTablet=!1,t._isPhone=!1,t._init(),t}return e=i,(n=[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"prevSize",get:function(){return this._prevSize}},{key:"isLandscape",get:function(){return this.width>this.height}},{key:"isPortrait",get:function(){return this.width<this.height}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isPhone",get:function(){return this._isPhone}},{key:"dpr",get:function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1}},{key:"lowerDesktopDPR",get:function(){return this._app.isDesktop?1:this.dpr}},{key:"_constructor",value:function(){ce(pe(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){l((function(){t._onResize()}),t._app.prop.viewportResizeTimeout)}))}},{key:"_setValues",value:function(){var t=this._app,e=t.html,n=t.prop;this._width=e.clientWidth,this._height=e.clientHeight,this._prevSize={w:this._width,h:this._height};var r=this.width;this._isDesktop=r>=n.tablet,this._isTablet=r<=n.tablet&&r>n.phone,this._isPhone=r<=n.phone,this._updateClasses(),this._updateCSSVars()}},{key:"_updateClasses",value:function(){var t=[Xt.Desktop,Xt.Tablet,Xt.Phone];this.isDesktop?this._updateBreakpointClasses(Xt.Desktop,t):this.isTablet?this._updateBreakpointClasses(Xt.Tablet,t):this._updateBreakpointClasses(Xt.Phone,t);var e=[Qt.Landscape,Qt.Portrait];this.isLandscape?this._updateBreakpointClasses(Qt.Landscape,e):this.isPortrait?this._updateBreakpointClasses(Qt.Portrait,e):this._updateBreakpointClasses("",e)}},{key:"_updateBreakpointClasses",value:function(t,e){var n=this._app.html,r=this._app.prefix;e.forEach((function(e){e===t?n.classList.add("".concat(r,"viewport-").concat(e)):n.classList.remove("".concat(r,"viewport-").concat(e))}))}},{key:"_updateCSSVars",value:function(){var t=this._app.html;t.style.setProperty("--vw","".concat(this.vw,"px")),t.style.setProperty("--vh","".concat(this.vh,"px"))}},{key:"_onResize",value:function(){var t=this._prevSize.w,e=this._prevSize.h;this._setValues();var n=this.width,r=this.height,o={widthChanged:n!==t,heightChanged:r!==e,orientationChanged:n>r!=t>e};n!==t&&r===e&&this.tbt("w_",o),r!==e&&n===t&&this.tbt("h_",o),n!==t&&r!==e&&(this.tbt("wh",o),this.tbt("hw",o)),n!==t&&this.tbt("w",o),r!==e&&this.tbt("h",o),this.tbt("",o)}}])&&ae(e.prototype,n),r&&ae(e,r),i}(T);function ve(t){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function be(t,e){return(be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ge(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Oe(t);if(e){var o=Oe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return me(this,n)}}function me(t,e){return!e||"object"!==ve(e)&&"function"!=typeof e?we(t):e}function we(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Oe(t){return(Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&be(t,e)}(i,t);var e,n,r,o=ge(i);function i(){var t,e,n,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,!1),e=we(t),r=void 0,(n="_loaded")in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._loaded=!1,t._init(),t}return e=i,(n=[{key:"loaded",get:function(){return this._loaded}},{key:"_setEvents",value:function(){var t=this;"complete"===document.readyState?this._handleLoaded():window.addEventListener("load",(function(){t._handleLoaded()}))}},{key:"_handleLoaded",value:function(){var t=this._app,e=t.prefix;this._loaded=!0,t.html.classList.remove("".concat(e,"loading")),t.body.classList.remove("".concat(e,"loading")),t.html.classList.add("".concat(e,"loaded")),this.tbt("",!1)}},{key:"onLoaded",value:function(t){if(!this.loaded)return this.add("",t.bind(this));t()}}])&&_e(e.prototype,n),r&&_e(e,r),i}(T);function ke(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function je(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ke(Object(n),!0).forEach((function(e){xe(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Se(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Te=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ee(this,t),xe(this,"_prop",void 0),xe(this,"_prefix",void 0),xe(this,"_isPhone",void 0),xe(this,"_isTablet",void 0),xe(this,"_isMobile",void 0),xe(this,"_isDesktop",void 0),xe(this,"_osName",void 0),xe(this,"_browserName",void 0),xe(this,"_pages",[]),xe(this,"_page",!1),xe(this,"_pageLoad",void 0),xe(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=je(je({},this.defaultProp),e),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Vt();this._isPhone=n.phone,this.html.classList.toggle("".concat(this.prefix,"phone"),this._isPhone),this._isTablet=n.tablet,this.html.classList.toggle("".concat(this.prefix,"tablet"),this._isTablet),this._isMobile=n.phone||n.tablet,this.html.classList.toggle("".concat(this.prefix,"mobile"),this._isMobile),this._isDesktop=!this._isMobile,this.html.classList.toggle("".concat(this.prefix,"desktop"),this._isDesktop);var r=ee();if(null!=r&&r.os){var o=r.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(o)),this._osName=o}else this._osName="";if(null!=r&&r.name){var i=r.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(i)),this._browserName=i}else this._browserName="";this._pageLoad=new Pe,this._viewport=new ye}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0}}},{key:"prefix",get:function(){return this._prefix}},{key:"isPhone",get:function(){return this._isPhone}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isMobile",get:function(){return this._isMobile}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"osName",get:function(){return this._osName}},{key:"browserName",get:function(){return this._browserName}},{key:"doc",get:function(){return document}},{key:"html",get:function(){return document.documentElement}},{key:"body",get:function(){return document.body}},{key:"pages",get:function(){return this._pages}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onPageCreated",value:function(){var t=this;return new ie((function(e){t._page?t._page.onCreate().then((function(){e(t.page)})):setTimeout((function(){t.onPageCreated().then((function(){e(t.page)}))}),30)}))}},{key:"onPageShown",value:function(){var t=this;return new ie((function(e){t.onPageCreated().then((function(){t._page&&t._page.onShow().then((function(){e(t.page)}))}))}))}},{key:"pageLoad",get:function(){return this._pageLoad}},{key:"onPageLoaded",value:function(){var t=this;return new ie((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){var t=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",t,"Vevet")}}])&&Se(e.prototype,n),r&&Se(e,r),t}();function Re(t){return(Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ce(t,e,n){return(Ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ie(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function De(t,e){return(De=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ie(t);if(e){var o=Ie(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return We(this,n)}}function We(t,e){return!e||"object"!==Re(e)&&"function"!=typeof e?Be(t):e}function Be(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ie(t){return(Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&De(t,e)}(i,t);var e,n,r,o=Me(i);function i(t){var e,n,r,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t,!1),n=Be(e),s=void 0,(r="_component")in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,e}return e=i,(n=[{key:"component",get:function(){return this._component}},{key:"init",value:function(){if(!this._component)throw new Error("Component is not set. Be sure that initlugin is called before.");Ce(Ie(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Le(e.prototype,n),r&&Le(e,r),i}(F);function Ae(t){return(Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ze(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?He(Object(n),!0).forEach((function(e){Ke(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Xe(t,e,n){return(Xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Qe(t,e){return(Qe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ue(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=qe(t);if(e){var o=qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ye(this,n)}}function Ye(t,e){return!e||"object"!==Ae(e)&&"function"!=typeof e?$e(t):e}function $e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(t){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ke(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Je=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qe(t,e)}(i,t);var e,n,r,o=Ue(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ne(this,i),Ke($e(e=o.call(this,t,!1)),"_created",void 0),Ke($e(e),"_shown",void 0),Ke($e(e),"_hidden",void 0),Ke($e(e),"_viaAJAX",void 0),e._created=!1,e._shown=!1,e._hidden=!1,e._destroyed=!1,e._viaAJAX=!1,n&&e.init(),e}return e=i,(n=[{key:"created",get:function(){return this._created}},{key:"shown",get:function(){return this._shown}},{key:"hidden",get:function(){return this._hidden}},{key:"viaAJAX",get:function(){return this._viaAJAX}},{key:"pageClassName",get:function(){return"".concat(this._app.prefix,"page-").concat(this.prop.name)}},{key:"_getDefaultProp",value:function(){return ze(ze({},Xe(qe(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home"})}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(n,r){t.canCreate().then((function(){t.created||(t._created=!0,t._shown=!1,t._hidden=!1,t._destroyed=!1,t._viaAJAX=e,t._app.page=t,t._app.html.classList.add(t.pageClassName),t._create().then((function(){t.callbacks.tbt("create",!1),n()})))})).catch((function(){r()}))}))}},{key:"_create",value:function(){return new Promise((function(t){t()}))}},{key:"canCreate",value:function(){var t=this;return new Promise((function(e,n){t.created?n():e()}))}},{key:"show",value:function(){var t=this;return new Promise((function(e,n){t.canShow().then((function(){t.shown||(t._created=!0,t._shown=!0,t._hidden=!1,t._destroyed=!1,t._show().then((function(){t.callbacks.tbt("show",!1),e()})))})).catch((function(){n()}))}))}},{key:"_show",value:function(){return new Promise((function(t){t()}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,n){!t.created||t.shown?n():e()}))}},{key:"hide",value:function(){var t=this;return new Promise((function(e,n){t.canHide().then((function(){t.hidden||(t._created=!0,t._shown=!1,t._hidden=!0,t._destroyed=!1,t._hide().then((function(){t.callbacks.tbt("hide",!1),e()})))})).catch((function(){n()}))}))}},{key:"_hide",value:function(){return new Promise((function(t){t()}))}},{key:"canHide",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.shown&&!t.hidden?e():n()}))}},{key:"destroy",value:function(){var t=this;return new Promise((function(e,n){t.canDestroy().then((function(){t.destroyed||(t._created=!1,t._shown=!1,t._hidden=!0,t._destroyed=!0,t._app.page=!1,t._app.html.classList.remove(t.pageClassName),t._destroy().then((function(){e()})))})).catch((function(){n()}))}))}},{key:"_destroy",value:function(){var t=this;return new Promise((function(e){Xe(qe(i.prototype),"_destroy",t).call(t),e()}))}},{key:"canDestroy",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.hidden&&!t.destroyed?e():n()}))}},{key:"onCreate",value:function(){var t=this;return new ie((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new ie((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new ie((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}])&&Ve(e.prototype,n),r&&Ve(e,r),i}(q);function Ge(t){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(n),!0).forEach((function(e){ln(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function en(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rn(t,e){return(rn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function on(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=un(t);if(e){var o=un(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sn(this,n)}}function sn(t,e){return!e||"object"!==Ge(e)&&"function"!=typeof e?an(t):e}function an(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cn(t,e,n){return(cn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=un(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function un(t){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fn,hn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rn(t,e)}(i,t);var e,n,r,o=on(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return en(this,i),ln(an(e=o.call(this,t,!1)),"_wheelListener",void 0),ln(an(e),"_lockWheel",void 0),ln(an(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return tn(tn({},cn(un(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,enabled:!0,stopPropagation:!1,threshold:20})}},{key:"container",get:function(){return this.prop.container?this.prop.container:window}},{key:"_setEvents",value:function(){cn(un(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(m(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(m(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){cn(un(i.prototype),"_onPropMutate",this).call(this),this._toggleWheelEvent()}},{key:"_handleMouseEnter",value:function(){this.prop.enabled&&this._createWheelEvent()}},{key:"_handleMouseLeave",value:function(){this._destroyWheelEvent()}},{key:"_toggleWheelEvent",value:function(){this.prop.enabled?this._createWheelEvent():this._destroyWheelEvent()}},{key:"_createWheelEvent",value:function(){this._wheelListener||(this._lockWheel=!1,this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),this._wheelListener=m(this.container,"wheel",this._handleWheel.bind(this)))}},{key:"_destroyWheelEvent",value:function(){this._wheelListener&&(this._wheelListener.remove(),this._wheelListener=void 0)}},{key:"_handleWheel",value:function(t){var e=this;if(this._wheelListener){if(this.prop.stopPropagation&&(t.preventDefault(),t.stopPropagation()),this._lockWheel)return this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),void(this._lockWheelTimeout=setTimeout((function(){e._lockWheel=!1}),300));var n=P()(t),r=this.prop.threshold,o=!1;n.pixelY>r?(this._callbacks.tbt("down",!1),o=!0):n.pixelY<-1*r&&(this._callbacks.tbt("up",!1),o=!0),n.pixelX>r?(this._callbacks.tbt("right",!1),o=!0):n.pixelX<-1*r&&(this._callbacks.tbt("left",!1),o=!0),o&&(this._lockWheel=!0)}}},{key:"_destroy",value:function(){cn(un(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&nn(e.prototype,n),r&&nn(e,r),i}(F);function pn(t,e){const[n,r,o,i]=e;if(n===r&&o===i)return t;const s=[];for(let a=0;a<11;++a)s[a]=dn(.1*a,n,o);return 0===t?0:1===t?1:dn(function(t,e,n){const r=t[0],o=t[2];let i=0,s=1;for(;10!==s&&n[s]<=e;++s)i+=.1;--s;const a=(e-n[s])/(n[s+1]-n[s]),c=i+.1*a,u=bn(c,r,o);if(u>=.001)return function(t,e,n,r){for(let o=0;o<4;++o){const o=bn(e,n,r);if(0===o)return e;e-=(dn(e,n,r)-t)/o}return e}(e,c,r,o);if(0===u)return c;return function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=dn(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,i,i+.1,r,o)}(e,t,s),r,i)}function dn(t,e,n){return((yn(e,n)*t+vn(e,n))*t+_n(e))*t}function yn(t,e){return 1-3*e+3*t}function vn(t,e){return 3*e-6*t}function _n(t){return 3*t}function bn(t,e,n){return 3*yn(e,n)*t*t+2*vn(e,n)*t+_n(e)}function gn(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}function mn(t,e){switch(e){case fn.easeInSine:return n=t,1-Math.cos(n*Math.PI/2);case fn.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case fn.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case fn.easeInQuad:return function(t){return Math.pow(t,2)}(t);case fn.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case fn.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case fn.easeInCubic:return function(t){return Math.pow(t,3)}(t);case fn.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case fn.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case fn.easeInQuart:return function(t){return Math.pow(t,4)}(t);case fn.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case fn.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case fn.easeInQuint:return function(t){return Math.pow(t,5)}(t);case fn.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case fn.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case fn.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case fn.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case fn.easeInOutExpo:return function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}(t);case fn.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case fn.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case fn.easeInOutCirc:return function(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}(t);case fn.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case fn.easeOutBack:return function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(t);case fn.easeInOutBack:return function(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}(t);case fn.easeInElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}(t);case fn.easeOutElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}(t);case fn.easeInOutElastic:return function(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}(t);case fn.easeInBounce:return function(t){return 1-gn(1-t)}(t);case fn.easeOutBounce:return gn(t);case fn.easeInOutBounce:return function(t){return t<.5?(1-gn(1-2*t))/2:(1+gn(2*t-1))/2}(t);default:return t}var n}function wn(t){return(wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function On(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?On(Object(n),!0).forEach((function(e){Cn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function En(t,e){return(En=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ln(t);if(e){var o=Ln(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xn(this,n)}}function xn(t,e){return!e||"object"!==wn(e)&&"function"!=typeof e?Tn(t):e}function Tn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rn(t,e,n){return(Rn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ln(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ln(t){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t.easeInSine="easeInSine",t.easeOutSine="easeOutSine",t.easeInOutSine="easeInOutSine",t.easeInQuad="easeInQuad",t.easeOutQuad="easeOutQuad",t.easeInOutQuad="easeInOutQuad",t.easeInCubic="easeInCubic",t.easeOutCubic="easeOutCubic",t.easeInOutCubic="easeInOutCubic",t.easeInQuart="easeInQuart",t.easeOutQuart="easeOutQuart",t.easeInOutQuart="easeInOutQuart",t.easeInQuint="easeInQuint",t.easeOutQuint="easeOutQuint",t.easeInOutQuint="easeInOutQuint",t.easeInExpo="easeInExpo",t.easeOutExpo="easeOutExpo",t.easeInOutExpo="easeInOutExpo",t.easeInCirc="easeInCirc",t.easeOutCirc="easeOutCirc",t.easeInOutCirc="easeInOutCirc",t.easeInBack="easeInBack",t.easeOutBack="easeOutBack",t.easeInOutBack="easeInOutBack",t.easeInElastic="easeInElastic",t.easeOutElastic="easeOutElastic",t.easeInOutElastic="easeInOutElastic",t.easeInBounce="easeInBounce",t.easeOutBounce="easeOutBounce",t.easeInOutBounce="easeInOutBounce"}(fn||(fn={}));var Dn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&En(t,e)}(i,t);var e,n,r,o=Sn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return kn(this,i),Cn(Tn(e=o.call(this,t,!1)),"_progress",void 0),Cn(Tn(e),"_easing",void 0),Cn(Tn(e),"_nestedTimelines",void 0),e._progress=0,e._easing=0,e._nestedTimelines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Pn(Pn({},Rn(Ln(i.prototype),"_getDefaultProp",this).call(this)),{},{easing:this._app.prop.easing,scope:[0,1],useNestedEasingProgress:!1})}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"easing",get:function(){return this._easing}},{key:"addNestedTimeline",value:function(t){this._nestedTimelines.push(t)}},{key:"_handleProgress",value:function(){this._easing=function(t,e=!1){return e?Array.isArray(e)?pn(t,e):"function"==typeof e?e(t):mn(t,e):t}(this._progress,this.prop.easing),this._callbacks.tbt("progress",{progress:this._progress,easing:this._easing}),this._renderNestedTimelines()}},{key:"_renderNestedTimelines",value:function(){var t=this._nestedTimelines.length;if(0!==t)for(var e=this.prop.useNestedEasingProgress?this.easing:this.progress,n=0,r=t;n<r;n+=1){var o=this._nestedTimelines[n],i=K(G(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){Rn(Ln(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}])&&jn(e.prototype,n),r&&jn(e,r),i}(q);function Mn(t){return(Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wn(Object(n),!0).forEach((function(e){Qn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function In(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function An(t,e){return(An=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Hn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Xn(t);if(e){var o=Xn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zn(this,n)}}function zn(t,e){return!e||"object"!==Mn(e)&&"function"!=typeof e?Nn(t):e}function Nn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vn(t,e,n){return(Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Xn(t){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Un=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&An(t,e)}(i,t);var e,n,r,o=Hn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return In(this,i),Qn(Nn(e=o.call(this,t,!1)),"_isPlaying",void 0),Qn(Nn(e),"_isReversed",void 0),Qn(Nn(e),"_isPaused",void 0),Qn(Nn(e),"_animationFrame",void 0),Qn(Nn(e),"_animationFrameLastTime",void 0),e._isPlaying=!1,e._isReversed=!1,e._isPaused=!1,e._animationFrame=void 0,e._animationFrameLastTime=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Bn(Bn({},Vn(Xn(i.prototype),"_getDefaultProp",this).call(this)),{},{duration:1e3,reset:!1,destroyOnEnd:!1})}},{key:"isPlaying",get:function(){return void 0!==this._animationFrame}},{key:"isReversed",get:function(){return this._isReversed}},{key:"isPaused",get:function(){return this._isPaused}},{key:"play",value:function(){this._destroyed||(this.prop.reset&&1===this.progress&&(this._progress=0),this._isReversed=!1,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"reverse",value:function(){this._destroyed||(this.prop.reset&&0===this.progress&&(this._progress=1),this._isReversed=!0,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"pause",value:function(){this._destroyed||(this._isPaused=!0,this._animationFrame&&window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}},{key:"_animate",value:function(){if(!this._isPaused){var t=this.isReversed,e=+new Date,n=Math.abs(this._animationFrameLastTime-e);this._animationFrameLastTime=e;var r=n/this.prop.duration/(t?-1:1),o=K(this.progress+r,[0,1]);if(this.progress=o,1===o&&!t||0===o&&t)return this._isReversed=!1,this._isPaused=!1,void(this._animationFrame=void 0);this._animationFrame=window.requestAnimationFrame(this._animate.bind(this))}}},{key:"_handleProgress",value:function(){Vn(Xn(i.prototype),"_handleProgress",this).call(this);var t=this._progress;0===t?this.callbacks.tbt("start",!1):1===t&&(this.callbacks.tbt("end",!1),this.prop.destroyOnEnd&&this.destroy())}},{key:"_destroy",value:function(){this.pause(),Vn(Xn(i.prototype),"_destroy",this).call(this)}}])&&Fn(e.prototype,n),r&&Fn(e,r),i}(Dn);function Yn(t){return(Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$n(Object(n),!0).forEach((function(e){or(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$n(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gn(t,e){return(Gn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=rr(t);if(e){var o=rr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return tr(this,n)}}function tr(t,e){return!e||"object"!==Yn(e)&&"function"!=typeof e?er(t):e}function er(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nr(t,e,n){return(nr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function or(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ir=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gn(t,e)}(i,t);var e,n,r,o=Zn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Kn(this,i),or(er(e=o.call(this,t,!1)),"_container",void 0),or(er(e),"_startTime",void 0),or(er(e),"_endTime",void 0),or(er(e),"_toBeHidden",void 0),or(er(e),"_isHidden",void 0),or(er(e),"_pageLoadEvent",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._startTime=+new Date,e._endTime=1/0,e._toBeHidden=!1,e._isHidden=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return qn(qn({},nr(rr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),hide:250})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"preloader")}},{key:"container",get:function(){return this._container}},{key:"startTime",get:function(){return this._startTime}},{key:"endTime",get:function(){return this._endTime}},{key:"totalTime",get:function(){return this._endTime-this._startTime}},{key:"isHidden",get:function(){return this._isHidden}},{key:"_setEvents",value:function(){var t=this;nr(rr(i.prototype),"_setEvents",this).call(this),this._onLoaded().then((function(){t._endTime=+new Date,t._handleLoaded()}))}},{key:"_onLoaded",value:function(){var t=this;return new ie((function(e){t._app.pageLoad.loaded?e():t._pageLoadEvent=t._app.pageLoad.add("",(function(){e()}))}))}},{key:"_handleLoaded",value:function(){this.callbacks.tbt("loaded",!1),"boolean"!=typeof this.prop.hide&&this.hideContainer()}},{key:"hideContainer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"boolean"!=typeof this.prop.hide?this.prop.hide:250;return this.callbacks.tbt("hide",!1),this._toBeHidden=!0,new ie((function(n){var r=t._container;if(!r)return t._handleHidden(),void n();r.style.transition="opacity ".concat(e,"ms, visibility ").concat(e,"ms"),r.style.opacity="0",r.style.visibility="hidden",l((function(){r.style.display="none",t._handleHidden(),n()}),e)}))}},{key:"_handleHidden",value:function(){this._isHidden=!0,this.callbacks.tbt("hidden",!1)}},{key:"onHide",value:function(t){if(!this._toBeHidden)return this.callbacks.add("hide",(function(){t()}));t()}},{key:"onHidden",value:function(t){if(!this._isHidden)return this.callbacks.add("hidden",(function(){t()}));t()}},{key:"_destroy",value:function(){var t;nr(rr(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}])&&Jn(e.prototype,n),r&&Jn(e,r),i}(q);function sr(t){return(sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ar(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function cr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ar(Object(n),!0).forEach((function(e){_r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fr(t,e){return(fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=vr(t);if(e){var o=vr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pr(this,n)}}function pr(t,e){return!e||"object"!==sr(e)&&"function"!=typeof e?dr(t):e}function dr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yr(t,e,n){return(yr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function vr(t){return(vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var br=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fr(t,e)}(i,t);var e,n,r,o=hr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ur(this,i),_r(dr(e=o.call(this,t,!1)),"_imgs",void 0),_r(dr(e),"_videos",void 0),_r(dr(e),"_customResources",void 0),_r(dr(e),"_resourcesTotal",void 0),_r(dr(e),"_resourcesLoaded",void 0),_r(dr(e),"_progress",void 0),_r(dr(e),"_animationFrame",void 0),_r(dr(e),"_endTimeline",void 0),e._imgs=[],e._videos=[],e._customResources=[],e._resourcesTotal=1+e.prop.resources,e._resourcesLoaded=0,e._progress=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return cr(cr({},yr(vr(i.prototype),"_getDefaultProp",this).call(this)),{},{resources:0,loaders:{img:!0,video:!0,custom:".js-preload"},calc:{lerp:.1,forceEnd:500}})}},{key:"imgs",get:function(){return this._imgs}},{key:"videos",get:function(){return this._videos}},{key:"customResources",get:function(){return this._customResources}},{key:"resourcesTotal",get:function(){return this._resourcesTotal}},{key:"resourcesLoaded",get:function(){return this._resourcesLoaded}},{key:"loadProgress",get:function(){return this.resourcesLoaded/this.resourcesTotal}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"_constructor",value:function(){yr(vr(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;yr(vr(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new ft,this._animationFrame.addCallback("frame",(function(){t.progress=J(t.progress,t.loadProgress,e)})),this._animationFrame.play()),this._preloadResources(),this._app.onPageLoaded().then((function(){t._handleLoadedResource()}))}},{key:"_onLoaded",value:function(){var t=this;return new ie((function(e){var n=!1;t.callbacks.add("progress",(function(t){t.progress>=1&&!n&&(e(),n=!0)}),{protected:!0})}))}},{key:"_getResources",value:function(){var t=this,e=this.prop.loaders;e.img&&v("img").forEach((function(e){t._imgs.push(e),t._resourcesTotal+=1})),e.video&&v("video").forEach((function(e){t._videos.push(e),t._resourcesTotal+=1})),e.custom&&(this._customResources=Array.from(v(e.custom)),this._resourcesTotal+=this._customResources.length)}},{key:"_preloadResources",value:function(){var t=this;0===this._resourcesTotal&&(this._resourcesTotal=1,this._handleLoadedResource()),this._imgs.forEach((function(e){if(e.complete)t._handleLoadedResource();else{var n=new Image;e.addEventListener("load",(function(){t._handleLoadedResource()})),e.addEventListener("error",(function(){t._handleLoadedResource()})),n.src=e.src}})),this._videos.forEach((function(e){if(e.readyState>0)t._handleLoadedResource();else{if("none"===e.preload)return void t._handleLoadedResource();e.addEventListener("error",(function(){t._handleLoadedResource()})),e.addEventListener("loadedmetadata",(function(){t._handleLoadedResource()}))}})),this._customResources.forEach((function(e){t._seekCustomResourceLoaded(e).then((function(){t._handleLoadedResource()}))}))}},{key:"_seekCustomResourceLoaded",value:function(t){var e=this;return new Promise((function(n){t.isComplete||t.isLoaded||t.getAttribute("data-is-loaded")||t.getAttribute("is-loaded")?n():setTimeout((function(){e.destroyed||e._seekCustomResourceLoaded(t).then((function(){n()}))}),50)}))}},{key:"addResourcesLoaded",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<t;e+=1)this._handleLoadedResource()}},{key:"addResourcesTotal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._resourcesTotal+=t}},{key:"_handleLoadedResource",value:function(){this.loadProgress>=1||(this._resourcesLoaded+=1,this.callbacks.tbt("resourceLoad",!1),this._animationFrame||(this.progress=this.loadProgress))}},{key:"_handleProgress",value:function(){var t=this;if(this.callbacks.tbt("progress",{progress:this._progress}),this.progress>=1)this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0);else if("number"==typeof this.prop.calc.forceEnd&&this.loadProgress>=1&&!this._endTimeline){this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0),this._endTimeline=new Un({duration:this.prop.calc.forceEnd});var e=this.progress;this._endTimeline.addCallback("progress",(function(n){var r=1-e;t.progress=e+r*n.progress})),this._endTimeline.play()}}},{key:"_destroy",value:function(){yr(vr(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}])&&lr(e.prototype,n),r&&lr(e,r),i}(ir);function gr(t){return(gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mr(Object(n),!0).forEach((function(e){Rr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function kr(t,e){return(kr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Tr(t);if(e){var o=Tr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Er(this,n)}}function Er(t,e){return!e||"object"!==gr(e)&&"function"!=typeof e?Sr(t):e}function Sr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xr(t,e,n){return(xr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Tr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Tr(t){return(Tr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Rr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kr(t,e)}(i,t);var e,n,r,o=jr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Or(this,i),Rr(Sr(e=o.call(this,t,!1)),"_container",void 0),Rr(Sr(e),"_runtimeEvents",void 0),Rr(Sr(e),"_isDragging",void 0),Rr(Sr(e),"_pointerID",void 0),Rr(Sr(e),"_coords",void 0),Rr(Sr(e),"_prevCoords",void 0),Rr(Sr(e),"_startCoords",void 0),e._container=y(e.prop.container),!p(e._container)&&!d(e._container))throw new Error("No container");return e._runtimeEvents=[],e._isDragging=!1,e._pointerID=null,e._coords={x:0,y:0},e._prevCoords={x:0,y:0},e._startCoords={x:0,y:0},n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return wr(wr({},xr(Tr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),usePassive:!1,enabled:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"dragger")}},{key:"container",get:function(){return this._container}},{key:"isDragging",get:function(){return this._isDragging}},{key:"coords",get:function(){return this._coords}},{key:"startCoords",get:function(){return this._startCoords}},{key:"_setEvents",value:function(){var t=this.container,e=this.prop.usePassive;this.addEventListeners(t,"mousedown",this._handleStart.bind(this),{passive:e}),this.addEventListeners(t,"touchstart",this._handleStart.bind(this),{passive:e})}},{key:"_addRuntimeEvents",value:function(){var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"blur",this.cancel.bind(this),{passive:t}))}},{key:"_removeRuntimeEvents",value:function(){this._runtimeEvents.forEach((function(t){t.remove()})),this._runtimeEvents=[]}},{key:"_normalizeEvent",value:function(t){if(t.type.includes("touch")){var e=t,n=e.targetTouches[0]||e.changedTouches[0];return{x:n.clientX,y:n.clientY,id:n.identifier}}var r=t;return{x:r.clientX,y:r.clientY,id:null}}},{key:"_handleStart",value:function(t){if(!this.prop.enabled)return!1;if(this.isDragging)return!1;var e=this._normalizeEvent(t);if("mousedown"===t.type){if(1!==t.which)return!1;t.stopPropagation()}return this._isDragging=!0,this._pointerID=e.id,this._coords={x:e.x,y:e.y},this._prevCoords={x:e.x,y:e.y},this._startCoords={x:e.x,y:e.y},this._addRuntimeEvents(),this.callbacks.tbt("start",{evt:t}),!0}},{key:"_handleEnd",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this.cancel(),0))}},{key:"cancel",value:function(){this._removeRuntimeEvents(),this._isDragging=!1,this.callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){xr(Tr(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&Pr(e.prototype,n),r&&Pr(e,r),i}(q);function Cr(t){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wr(t,e,n){return(Wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ar(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Br(t,e){return(Br=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ir(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ar(t);if(e){var o=Ar(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fr(this,n)}}function Fr(t,e){return!e||"object"!==Cr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ar(t){return(Ar=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Hr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Br(t,e)}(i,t);var e,n,r,o=Ir(i);function i(){return Dr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){Wr(Ar(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchmove",this._handleMove.bind(this),{passive:t}))}},{key:"_handleMove",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this._prevCoords={x:this._coords.x,y:this._coords.y},this._coords={x:e.x,y:e.y},this.callbacks.tbt("move",{evt:t,start:this.startCoords,coords:this.coords,step:this.stepCoords}),0))}},{key:"_destroy",value:function(){Wr(Ar(i.prototype),"_destroy",this).call(this)}}])&&Mr(e.prototype,n),r&&Mr(e,r),i}(Lr);function zr(t){return(zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nr(Object(n),!0).forEach((function(e){Xr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Xr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ur(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yr(t,e,n){return(Yr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Jr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function $r(t,e){return($r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Jr(t);if(e){var o=Jr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Kr(this,n)}}function Kr(t,e){return!e||"object"!==zr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Jr(t){return(Jr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$r(t,e)}(i,t);var e,n,r,o=qr(i);function i(){return Qr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Vr(Vr({},Yr(Jr(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=Yr(Jr(i.prototype),"_handleEnd",this).call(this,t);if(!e)return e;var n=this._normalizeEvent(t),r=this.startCoords,o=Math.abs(this.prop.min);return r.y>n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("up",!1),r.y<n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("down",!1),r.x>n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("left",!1),r.x<n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("right",!1),!0}}])&&Ur(e.prototype,n),r&&Ur(e,r),i}(Lr);function Zr(t){return(Zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function to(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function eo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?to(Object(n),!0).forEach((function(e){lo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oo(t,e,n){return(oo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=uo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function io(t,e){return(io=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function so(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=uo(t);if(e){var o=uo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ao(this,n)}}function ao(t,e){return!e||"object"!==Zr(e)&&"function"!=typeof e?co(t):e}function co(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uo(t){return(uo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&io(t,e)}(i,t);var e,n,r,o=so(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];no(this,i),lo(co(e=o.call(this,t,!1)),"_canvas",void 0),lo(co(e),"_ctx",void 0),lo(co(e),"_width",void 0),lo(co(e),"_height",void 0),lo(co(e),"_dpr",void 0),e._width=0,e._height=0,e._dpr=1;var r=e.prop,s=r.append,a=r.container,c=s&&a?a:void 0;return e._canvas=b("canvas",{parent:c}),e._ctx=e._canvas.getContext("2d"),e.resize(),n&&e.init(),e}return e=i,(n=[{key:"container",get:function(){return this.prop.container}},{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"width",get:function(){return this._width}},{key:"nonDPRWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"_getDefaultProp",value:function(){return eo(eo({},oo(uo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,append:!0,updateOnResize:!1,width:!1,height:!1,dpr:!1})}},{key:"_setEvents",value:function(){var t=this;if(oo(uo(i.prototype),"_setEvents",this).call(this),!1!==this.prop.updateOnResize){var e="boolean"==typeof this.prop.updateOnResize?"":this.prop.updateOnResize;this.addViewportCallback(e,(function(){t.resize()})),this.resize()}}},{key:"_onPropMutate",value:function(){oo(uo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){var t=this.prop,e=this.canvas;if(e){var n=this._app.viewport;"number"==typeof t.dpr?this._dpr=t.dpr:this._dpr=n.dpr;var r=this._dpr,o=0,i=0;"number"==typeof t.width&&"number"==typeof t.height?(o=t.width,i=t.height):this.container?(o=this.container.clientWidth,i=this.container.clientHeight):(o=n.width,i=n.height),o*=r,i*=r,this._width=o,this._height=i,e.width=o,e.height=i,this.callbacks.tbt("resize",!1)}}},{key:"_destroy",value:function(){oo(uo(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&ro(e.prototype,n),r&&ro(e,r),i}(q);function ho(t){const e=function(t){if("container"in t)return{width:t.container.clientWidth,height:t.container.clientHeight};return{width:t.width,height:t.height}}(t),n=function(t){const{source:e}=t;if(e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};return{width:e.width,height:e.height}}(t);let r;return"cover"===t.rule?r=function(t,e,n){let r=e.width*po(t),o=n.height*r/n.width;o/po(t)<e.height&&(o=e.height*po(t),r=n.width*o/n.height);const i=(e.width-r)/2,s=(e.height-o)/2;return{width:r,height:o,x:i,y:s}}(t,e,n):"contain"===t.rule?r=function(t,e,n){let r=0,o=0;const i=n.width/n.height;e.width>e.height?(o=e.height,r=o*i,r>e.width&&(r=e.width,o=r/i)):e.height>=e.width&&(r=e.width,o=r/i,o>e.height&&(o=e.height,r=o*i));r*=po(t),o*=po(t);const s=(e.width-r)/2,a=(e.height-o)/2;return{width:r,height:o,x:s,y:a}}(t,e,n):"top-left"===t.rule?r=function(t,e){const n=e.width*po(t),r=e.height*po(t);return{width:n,height:r,x:0,y:0}}(t,n):"top-right"===t.rule?r=function(t,e,n){const r=n.width*po(t),o=n.height*po(t),i=e.width-n.width;return{width:r,height:o,x:i,y:0}}(t,e,n):"bottom-left"===t.rule?r=function(t,e,n){const r=n.width*po(t),o=n.height*po(t),i=e.height-n.height;return{width:r,height:o,x:0,y:i}}(t,e,n):"bottom-right"===t.rule?r=function(t,e,n){const r=n.width*po(t),o=n.height*po(t),i=e.width-n.width,s=e.height-n.height;return{width:r,height:o,x:i,y:s}}(t,e,n):"center"===t.rule&&(r=function(t,e,n){const r=n.width*po(t),o=n.height*po(t),i=(e.width-n.width)/2,s=(e.height-n.height)/2;return{width:r,height:o,x:i,y:s}}(t,e,n)),Object.assign(r,{sourceWidth:n.width,sourceHeight:n.height})}function po(t){return void 0!==t.scale?t.scale:1}function yo(t){return(yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vo(Object(n),!0).forEach((function(e){bo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function bo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function wo(t,e,n){return(wo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=jo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Oo(t,e){return(Oo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=jo(t);if(e){var o=jo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ko(this,n)}}function ko(t,e){return!e||"object"!==yo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function jo(t){return(jo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Eo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Oo(t,e)}(i,t);var e,n,r,o=Po(i);function i(){return go(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return _o(_o({},wo(jo(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){wo(jo(i.prototype),"resize",this).call(this),this._prerender()}},{key:"_prerender",value:function(){var t=this.prop.media;if(t){var e=ho({source:t,rule:this.prop.posRule,scale:1,width:this.width,height:this.height});this._ctx.clearRect(0,0,this.width,this.height),this._ctx.drawImage(t,0,0,e.sourceWidth,e.sourceHeight,e.x,e.y,e.width,e.height),this.callbacks.tbt("prerender",!1)}}}])&&mo(e.prototype,n),r&&mo(e,r),i}(fo);function So(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var To=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),xo(this,"_prop",void 0),xo(this,"_outer",void 0),xo(this,"_thumb",void 0),xo(this,"_outerHeight",void 0),xo(this,"_outerWidth",void 0),xo(this,"_thumbHeight",void 0),xo(this,"_thumbWidth",void 0),xo(this,"_scrollVal",void 0),xo(this,"_coordsAtDragStart",void 0),xo(this,"_listeners",void 0),xo(this,"_scrollEvent",void 0),xo(this,"_actionTimeout",void 0),xo(this,"_dragger",void 0),this._prop=e;var n=e.prefix,r=e.dir,o=e.domParent,i=e.container,s=e.autoHide;this._outerHeight=0,this._outerWidth=0,this._thumbHeight=0,this._thumbWidth=0,this._scrollVal=0,this._coordsAtDragStart={left:0,top:0},this._scrollEvent=void 0,this._actionTimeout=void 0,this._dragger=void 0;var a="".concat(n," ").concat(n,"_").concat(r);i instanceof Window&&(a+=" in-window"),this._outer=b("div",{parent:o,class:a}),this._thumb=b("div",{parent:this._outer,class:"".concat(n,"__thumb ").concat(n,"__thumb_").concat(r)}),s&&this.outer.classList.add("auto-hide"),this._listeners=[],this._setEvents()}var e,n,r;return e=t,(n=[{key:"outer",get:function(){return this._outer}},{key:"thumb",get:function(){return this._thumb}},{key:"prefix",get:function(){return this._prop.prefix}},{key:"isX",get:function(){return"x"===this.prop.dir}},{key:"isY",get:function(){return!this.isX}},{key:"scrollElement",get:function(){return this.prop.container instanceof Window?document.documentElement:this.prop.container}},{key:"scrollLine",get:function(){var t=this.scrollElement;return this.isX?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight}},{key:"scrollWidth",get:function(){return this.scrollElement.scrollWidth}},{key:"scrollHeight",get:function(){return this.scrollElement.scrollHeight}},{key:"prop",get:function(){return this._prop}},{key:"scrollValues",get:function(){var t=this.prop.container,e=0,n=0;return t instanceof Window?(e=t.pageYOffset,n=t.pageXOffset):t instanceof kt?(e=t.targetTop,n=t.targetLeft):(e=t.scrollTop,n=t.scrollLeft),{left:n,top:e}}},{key:"_setEvents",value:function(){var t=this;this._listeners.push(m(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(m(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=jt(this.prop.container,(function(e){t._handleScroll(e)})),this.prop.isDraggable&&(this._dragger=new Hr({container:this.thumb}),this._dragger.addCallback("start",(function(){t.thumb.classList.add("in-action"),t._disableScrollBehaviour(!0),t._coordsAtDragStart=t.scrollValues})),this._dragger.addCallback("move",(function(e){t._handleThumbDrag(e)})),this._dragger.addCallback("end",(function(){t.thumb.classList.remove("in-action"),t._disableScrollBehaviour(!1)})))}},{key:"_disableScrollBehaviour",value:function(t){var e=t?"auto":"unset";(this.prop.container instanceof Window||this.prop.container instanceof HTMLElement)&&(document.documentElement.style.scrollBehavior=e)}},{key:"_handleHover",value:function(t){this.outer.classList.toggle("is-hovered",t)}},{key:"_handleScroll",value:function(t){var e=this;this.prop.optimizeCalculations||this.resize();var n=!1;this.isX?(n=t.scrollLeft!==this._scrollVal,this._scrollVal=t.scrollLeft):(n=t.scrollTop!==this._scrollVal,this._scrollVal=t.scrollTop),n&&(this.prop.autoHide&&n&&(this.outer.classList.add("in-action"),this._actionTimeout&&(clearTimeout(this._actionTimeout),this._actionTimeout=void 0),this._actionTimeout=setTimeout((function(){e.outer.classList.remove("in-action")}),500)),this.prop.optimizeCalculations&&this._renderThumb())}},{key:"_handleThumbDrag",value:function(t){t.evt.preventDefault();var e=this.prop.container,n=(t.coords.x-t.start.x)/(this._outerWidth-this._thumbWidth)*this.scrollLine,r=(t.coords.y-t.start.y)/(this._outerHeight-this._thumbHeight)*this.scrollLine,o=this._coordsAtDragStart,i=o.left,s=o.top;this.isX?i+=n:s+=r,e.scrollTo({top:s,left:i,behavior:e instanceof kt?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=K(this._scrollVal/this.scrollLine,[0,1]),e=this.isX?(this._outerWidth-this._thumbWidth)*t:0,n=this.isY?(this._outerHeight-this._thumbHeight)*t:0;this._thumb.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}},{key:"resize",value:function(){var t=this.outer,e=this.thumb,n=this.scrollLine,r=this.prop.minSize;if(this._outerHeight=t.clientHeight,this._outerWidth=t.clientWidth,this.prop.autoSize)if(this.isX){var o=K(this._outerWidth/(this.scrollWidth/(this.scrollWidth-n)),[r,1/0]);e.style.width="".concat(o,"px")}else{var i=K(this._outerHeight/(this.scrollHeight/(this.scrollHeight-n)),[r,1/0]);e.style.height="".concat(i,"px")}this._thumbHeight=e.clientHeight,this._thumbWidth=e.clientWidth,t.classList.toggle("is-empty",0===n),this._renderThumb()}},{key:"destroy",value:function(){this._listeners.forEach((function(t){t.remove()})),this._scrollEvent&&this._scrollEvent.remove(),this._actionTimeout&&clearTimeout(this._actionTimeout),this._dragger&&this._dragger.destroy(),this._outer.remove()}}])&&So(e.prototype,n),r&&So(e,r),t}();function Ro(t){return(Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Co(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(n),!0).forEach((function(e){zo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Do(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wo(t,e){return(Wo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ho(t);if(e){var o=Ho(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Io(this,n)}}function Io(t,e){return!e||"object"!==Ro(e)&&"function"!=typeof e?Fo(t):e}function Fo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ao(t,e,n){return(Ao="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ho(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ho(t){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var No=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wo(t,e)}(i,t);var e,n,r,o=Bo(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Do(this,i),zo(Fo(e=o.call(this,t,!1)),"_container",void 0),zo(Fo(e),"_scrollWrapper",void 0),zo(Fo(e),"_xBar",void 0),zo(Fo(e),"_yBar",void 0);var r=e.prop,s=r.autoHide,a=r.autoSize,c=r.minSize,u=r.optimizeCalculations,l=r.isDraggable,f=r.draggableScrollBehavior;if("string"==typeof e.prop.container){var h=y(e.prop.container);if(!h)throw new Error("No scroll container");e._container=h}else e._container=e.prop.container;if(e.container instanceof Element){var p=e.container.parentElement;p&&(e._scrollWrapper=b("div"),e._scrollWrapper.style.position="relative",e._scrollWrapper.style.display="inline-block",p.insertBefore(e._scrollWrapper,e.container),e._scrollWrapper.appendChild(e.container),e._scrollWrapper.classList.add("".concat(e.prefix,"-wrapper")))}var d={container:e.container,domParent:e.domParent,autoHide:s,autoSize:a,minSize:c,optimizeCalculations:u,prefix:e.prefix,isDraggable:l,draggableScrollBehavior:f};return e._xBar=new To(Co({dir:"x"},d)),e._yBar=new To(Co({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Co(Co({},Ao(Ho(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,domParent:!1,draggable:!0,autoSize:!0,autoHide:!0,minSize:50,optimizeCalculations:!1,isDraggable:!0,draggableScrollBehavior:"smooth"})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"scrollbar")}},{key:"container",get:function(){return this._container}},{key:"scrollableElement",get:function(){var t=this.container;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"domParent",get:function(){var t=this.prop.domParent,e=this.container;return t||(this._scrollWrapper?this._scrollWrapper:e instanceof Window?this._app.body:e instanceof Element?e:e.outer)}},{key:"_setEvents",value:function(){var t=this;Ao(Ho(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof kt?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()})),this.resize()}},{key:"_onPropMutate",value:function(){Ao(Ho(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(Ao(Ho(i.prototype),"_destroy",this).call(this),this._xBar.destroy(),this._yBar.destroy(),this._scrollWrapper&&this.container instanceof Element){var t=this._scrollWrapper.parentElement;t&&t.insertBefore(this.container,this._scrollWrapper),this._scrollWrapper.remove()}this.scrollableElement.classList.remove("".concat(this.prefix,"-parent"))}}])&&Mo(e.prototype,n),r&&Mo(e,r),i}(q);function Vo(t){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xo(Object(n),!0).forEach((function(e){ti(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $o(t,e){return($o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Zo(t);if(e){var o=Zo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ko(this,n)}}function Ko(t,e){return!e||"object"!==Vo(e)&&"function"!=typeof e?Jo(t):e}function Jo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Go(t,e,n){return(Go="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Zo(t){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ti(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ei=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$o(t,e)}(i,t);var e,n,r,o=qo(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Uo(this,i),ti(Jo(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=y(e.prop.container):e._scrollContainer=e.prop.container,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Qo(Qo({},Go(Zo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"scrollableElement",get:function(){return this._scrollContainer instanceof Window?this._app.html:this._scrollContainer}},{key:"domParent",get:function(){var t=this.scrollContainer;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"intersectionRoot",get:function(){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}},{key:"scrollContainerBounding",get:function(){if(this.intersectionRoot){var t=this.intersectionRoot.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:0,left:0,width:this._app.viewport.width,height:this._app.viewport.height}}}])&&Yo(e.prototype,n),r&&Yo(e,r),i}(q);function ni(t){return(ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ri(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function oi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ri(Object(n),!0).forEach((function(e){pi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ri(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ii(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function si(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ai(t,e){return(ai=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ci(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=hi(t);if(e){var o=hi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ui(this,n)}}function ui(t,e){return!e||"object"!==ni(e)&&"function"!=typeof e?li(t):e}function li(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fi(t,e,n){return(fi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function hi(t){return(hi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ai(t,e)}(i,t);var e,n,r,o=ci(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ii(this,i),pi(li(e=o.call(this,t,!1)),"_scrollEvent",void 0),pi(li(e),"_intersectionObserver",void 0),pi(li(e),"_firstStart",void 0),pi(li(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserver=void 0,e._firstStart=!0,e.updateElements(),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"scroll-view")}},{key:"_getDefaultProp",value:function(){return oi(oi({},fi(hi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,elements:".".concat(this.prefix,"__el"),threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0})}},{key:"init",value:function(){fi(hi(i.prototype),"init",this).call(this),this.seekBounding()}},{key:"_setEvents",value:function(){var t=this;fi(hi(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback("",(function(){t.resize()}))}},{key:"_onPropMutate",value:function(){fi(hi(i.prototype),"_onPropMutate",this).call(this),this._removeViewEvents(),this.updateElements(),this._setViewEvents()}},{key:"resize",value:function(){this._removeViewEvents(),this._setViewEvents()}},{key:"_setViewEvents",value:function(){var t=this;if(Et()&&this.prop.useIntersectionObserver){var e=this.scrollContainerBounding,n=this._firstStart?0:e.width*(1-this.prop.threshold)*-1,r=this._firstStart?0:e.height*(1-this.prop.threshold)*-1;this._intersectionObserver=new IntersectionObserver(this._handleIntersectionObserver.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px ".concat(n,"px ").concat(r,"px 0px")}),this.elements&&this.elements.forEach((function(e){var n;null===(n=t._intersectionObserver)||void 0===n||n.observe(e)}))}else this._scrollEvent=jt(this.prop.container,this._handleScroll.bind(this))}},{key:"_removeViewEvents",value:function(){this._scrollEvent&&(this._scrollEvent.remove(),this._scrollEvent=void 0),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0)}},{key:"elements",get:function(){return this._elements}},{key:"updateElements",value:function(){var t=this;void 0===this.elements&&(this._elements=[]),this.elements.forEach((function(e){t._intersectionObserver&&t._intersectionObserver.unobserve(e)})),this._elements=Array.from(v(this.prop.elements,this.domParent||void 0)).filter((function(e){return!e.classList.contains(t.prop.classToToggle)})),this._elements.forEach((function(e){t._intersectionObserver&&t._intersectionObserver.observe(e)}))}},{key:"_handleIntersectionObserver",value:function(t){for(var e=!!this._firstStart&&this.scrollContainerBounding,n=0;n<t.length;n+=1){var r=t[n],o=0;this._firstStart&&e&&r.isIntersecting&&(o=this._elementInViewportData(r.target,e).delay),this._handleInOut(r.target,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1,this.resize())}},{key:"_handleScroll",value:function(){this.seekBounding()}},{key:"seekBounding",value:function(){if(!Et()||!this.prop.useIntersectionObserver){for(var t=this.scrollContainerBounding,e=0;e<this.elements.length;e+=1){var n=this.elements[e],r=this._elementInViewportData(n,t),o=r.isIntersecting?r.delay:0;this._handleInOut(n,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1)}}},{key:"_elementInViewportData",value:function(t,e){var n=this.prop,r=n.threshold,o=n.states,i=n.useDelay,s=this._firstStart?1:r,a=t.getBoundingClientRect(),c=!1;a.top<e.top+e.height*s&&a.left<e.left+e.width*s&&(c="in"===o||!(a.right<e.left*s||a.bottom<e.top*s));var u=0;return i&&this._firstStart&&(u=K("x"===i.dir?(a.left-e.left)/e.width:(a.top-e.top)/e.height,[0,1])*i.max),{isIntersecting:c,delay:u}}},{key:"_handleInOut",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.prop.states;t.scrollViewIn&&e||!t.scrollViewIn&&!e||(t.scrollViewIn=e,l((function(){t.classList.toggle(n.prop.classToToggle,e)}),r),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||l((function(){n.callbacks.tbt("out",t)}),r):l((function(){n.callbacks.tbt("in",t)}),r))}},{key:"_processUnusedElements",value:function(){var t=this;"in"===this.prop.states&&(this._elements.filter((function(t){return t.scrollViewIn})).forEach((function(e){t._intersectionObserver&&t._intersectionObserver.unobserve(e)})),this._elements=this._elements.filter((function(t){return!t.scrollViewIn})))}},{key:"_destroy",value:function(){fi(hi(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}])&&si(e.prototype,n),r&&si(e,r),i}(ei);function yi(t){return(yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bi(t,e,n){return(bi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Oi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function gi(t,e){return(gi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Oi(t);if(e){var o=Oi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wi(this,n)}}function wi(t,e){return!e||"object"!==yi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Oi(t){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gi(t,e)}(i,t);var e,n,r,o=mi(i);function i(){return vi(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_setEvents",value:function(){var t=this;bi(Oi(i.prototype),"_setEvents",this).call(this),this.addEventListeners(window,"keydown",(function(e){t._handleKeydown(e)}))}},{key:"_handleKeydown",value:function(t){var e=this._component;if(e.prop.enabled)if(9!==t.keyCode){var n=document.activeElement;if(!n||!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){var r=this._app.viewport,o=e.outer.getBoundingClientRect();if(o.left<r.width&&o.right>0&&o.top<r.height&&o.bottom>0){var i=40;switch(t.keyCode){case 38:e.targetTop-=i;break;case 40:e.targetTop+=i;break;case 39:e.targetLeft+=i;break;case 37:e.targetLeft-=i;break;case 34:e.targetTop+=400;break;case 33:e.targetTop-=400;break;case 36:e.targetTop=0,e.targetLeft=0;break;case 35:e.targetTop=e.scrollHeight,e.targetLeft=e.scrollWidth;break;case 32:e.targetTop+=200}}}}else this._handleTab()}},{key:"_handleTab",value:function(){var t=this;l((function(){var e=t._component,n=document.activeElement;if(n instanceof HTMLElement&&f(n,e.outer)){var r=e.outer.getBoundingClientRect(),o=n.getBoundingClientRect(),i=e.scrollTop+(o.top-r.top)-(e.clientHeight/2-o.height/2),s=e.scrollLeft+(o.left-r.left)-(e.clientWidth/2-o.width/2);e.targetTop=i,e.targetLeft=s}}),120)}}])&&_i(e.prototype,n),r&&_i(e,r),i}(Fe);function ki(t){return(ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ei(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ji(Object(n),!0).forEach((function(e){Mi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ji(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Si(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ti(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Di(t);if(e){var o=Di(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ri(this,n)}}function Ri(t,e){return!e||"object"!==ki(e)&&"function"!=typeof e?Li(t):e}function Li(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ci(t,e,n){return(Ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Di(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Di(t){return(Di=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Wi="is-dragging",Bi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(i,t);var e,n,r,o=Ti(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Mi(Li(e=o.call(this,t)),"_dragger",void 0),Mi(Li(e),"_componentEvents",void 0),Mi(Li(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Ei(Ei({},Ci(Di(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,speed:1,lerp:!1,reverseDir:!1,stopPropagation:!1})}},{key:"isDragging",get:function(){return!!this._dragger&&this._dragger.isDragging}},{key:"_constructor",value:function(){Ci(Di(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){Ci(Di(i.prototype),"_onPropMutate",this).call(this),this._toggleDragger()}},{key:"_toggleDragger",value:function(){this.prop.enabled?this._addDragger():this._removeDragger()}},{key:"_addDragger",value:function(){var t=this;if(!this._dragger){var e=this.component;this._dragger=new Hr({container:e.outer}),this._dragger.addCallback("start",this._handleDragStart.bind(this)),this._dragger.addCallback("move",(function(e){t._handleDragMove(e)})),this._dragger.addCallback("end",this._handleDragEnd.bind(this)),this._componentEvents.push(e.addCallback("wheel",(function(){var e;null===(e=t._dragger)||void 0===e||e.cancel()})))}}},{key:"_removeDragger",value:function(){this._dragger&&(this._dragger.destroy(),this._dragger=void 0,this._componentEvents.forEach((function(t){t.remove()})),this._componentEvents=[])}},{key:"_handleDragStart",value:function(){var t=this.component;if(t.prop.enabled&&!(t.maxScrollableWidth<=0&&t.maxScrollableHeight<=0)){var e=this.prop.lerp;"boolean"!=typeof e&&(this._currentLerp=t.prop.render.lerp,t.changeProp({render:{lerp:e}})),this._callbacks.tbt("start",!1)}}},{key:"_handleDragMove",value:function(t){var e=this.component;if(e.prop.enabled&&!(e.maxScrollableWidth<=0&&e.maxScrollableHeight<=0)){var n=t.evt,r=this.prop.stopPropagation;if(r){if(!n.cancelable)return;var o=Math.abs(t.coords.x-t.start.x),i=Math.abs(t.coords.y-t.start.y);(o>r.threshold&&"x"===r.dir||i>r.threshold&&"y"===r.dir)&&n.cancelable&&(n.preventDefault(),n.stopPropagation())}var s=this.prop,a=s.speed,c=s.reverseDir,u=t.step.x*a,l=t.step.y*a;e.targetLeft-=c?l:u,e.targetTop-=c?u:l,e.outer.classList.add(Wi),e.container.classList.add(Wi),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(Wi),t.container.classList.remove(Wi),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Ci(Di(i.prototype),"_destroy",this).call(this),this._removeDragger()}}])&&Si(e.prototype,n),r&&Si(e,r),i}(Fe);function Ii(t){return(Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ai(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fi(Object(n),!0).forEach((function(e){$i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ni(t,e){return(Ni=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Yi(t);if(e){var o=Yi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xi(this,n)}}function Xi(t,e){return!e||"object"!==Ii(e)&&"function"!=typeof e?Qi(t):e}function Qi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ui(t,e,n){return(Ui="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Yi(t){return(Yi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var qi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ni(t,e)}(i,t);var e,n,r,o=Vi(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Hi(this,i),$i(Qi(e=o.call(this,t,!1)),"_initText",void 0),$i(Qi(e),"_initHTML",void 0),$i(Qi(e),"_isPrimarySplit",void 0),$i(Qi(e),"_container",void 0),$i(Qi(e),"_letters",void 0),$i(Qi(e),"_words",void 0),$i(Qi(e),"_lines",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML,e._initText=(e._container.innerText||"no rendered text").trim(),e._initText=e._initText.replace(/\s+\n/gm,"\n"),e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Ai(Ai({},Ui(Yi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),appendLetters:!0,appendLines:!1})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"split-text")}},{key:"container",get:function(){return this._container}},{key:"letters",get:function(){return this._letters}},{key:"words",get:function(){return this._words}},{key:"lines",get:function(){return this._lines}},{key:"_setEvents",value:function(){var t=this;Ui(Yi(i.prototype),"_setEvents",this).call(this),this.splitText(),this.prop.appendLines&&this.addViewportCallback("",(function(){t.splitText()}))}},{key:"splitText",value:function(){this._isPrimarySplit||(this.container.innerHTML="",this._splitIntoWords(),this._splitIntoLetters(),this._appendWords(),this._isPrimarySplit=!0),this.prop.appendLines&&this._splitIntoLines(),this.callbacks.tbt("split",!1)}},{key:"_splitIntoWords",value:function(){var t=this,e=this._initText.split(""),n=0;e.forEach((function(e){var r=t._words[n]||{content:"",hasNewLine:!1,el:b("span",{class:"".concat(t.prefix,"__word")}),letters:[]};r.el.style.display="inline-block",t._words[n]=r;var o=e.charCodeAt(0),i=32===o||160===o,s=10===o;i&&(r.whitespace=document.createTextNode(" ")),s&&(r.br=b("br")),r.hasNewLine=s,i||s?n+=1:(r.content+=e,t.prop.appendLetters||(r.el.innerHTML=r.content))}))}},{key:"_appendWords",value:function(){var t=this;this._words.forEach((function(e){t.container.appendChild(e.el),e.whitespace&&t.container.appendChild(e.whitespace),e.br&&t.container.appendChild(e.br)}))}},{key:"_removeWords",value:function(){this._words.forEach((function(t){t.el.remove(),t.whitespace&&t.whitespace.remove(),t.br&&t.br.remove()}))}},{key:"_splitIntoLetters",value:function(){var t=this;this.prop.appendLetters&&(this._words.forEach((function(e){var n=e.content.split(""),r=[];n.forEach((function(n){var o={el:b("span",{class:"".concat(t.prefix,"__letter"),html:n}),content:n,word:e};o.el.style.display="inline-block",t._letters.push(o),r.push(o)})),e.letters=r})),this._letters.forEach((function(t){t.word.el.appendChild(t.el)})))}},{key:"_splitIntoLines",value:function(){var t=this;this._removeLines();var e=!1,n=1/0,r=!1;this.words.forEach((function(o){var i=!1,s=o.el.offsetTop;i=!(!r||!r.br)||s!==n,r=o,n=s,i&&((e={el:b("span",{class:"".concat(t.prefix,"__line")}),content:"",words:[]}).el.style.display="block",t._lines.push(e)),e&&e.words.push(o)})),this._lines.forEach((function(t){t.content=t.words.map((function(t){return t.content})).join(" ")})),this._lines.forEach((function(e){e.words.forEach((function(t){e.el.appendChild(t.el),t.br&&t.br.remove(),t.whitespace&&e.el.appendChild(t.whitespace)})),t.container.appendChild(e.el)}))}},{key:"_removeLines",value:function(){this._lines.forEach((function(t){t.el.remove()})),this._lines=[],this._appendWords()}},{key:"_destroy",value:function(){Ui(Yi(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}])&&zi(e.prototype,n),r&&zi(e,r),i}(q);function Ki(t){return(Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ji(Object(n),!0).forEach((function(e){as(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ji(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Zi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ts(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function es(t,e){return(es=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ns(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ss(t);if(e){var o=ss(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return rs(this,n)}}function rs(t,e){return!e||"object"!==Ki(e)&&"function"!=typeof e?os(t):e}function os(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function is(t,e,n){return(is="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ss(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ss(t){return(ss=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function as(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&es(t,e)}(i,t);var e,n,r,o=ns(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Zi(this,i),as(os(e=o.call(this,t,!1)),"_container",void 0),as(os(e),"_containerIsWindow",void 0),as(os(e),"_outerCursor",void 0),as(os(e),"_innerCursor",void 0),as(os(e),"_animationFrame",void 0),as(os(e),"_currentFPS",void 0),as(os(e),"_canPlay",void 0),as(os(e),"_x",void 0),as(os(e),"_xTarget",void 0),as(os(e),"_y",void 0),as(os(e),"_yTarget",void 0);var r=y(e.prop.container);if(!r)throw new Error("No cursor container for ".concat(e.prop.container));return e._container=r,e._containerIsWindow=r instanceof Window,e._x=0,e._xTarget=0,e._y=0,e._yTarget=0,e._currentFPS=60,e._canPlay=e.prop.run,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Gi(Gi({},is(ss(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},autoStop:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"custom-cursor")}},{key:"container",get:function(){return this._container}},{key:"eventsContainer",get:function(){return this._container}},{key:"domContainer",get:function(){return this.container instanceof Window?this._app.html:this.container}},{key:"outerCursor",get:function(){return this._outerCursor}},{key:"innerCursor",get:function(){return this._innerCursor}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"_constructor",value:function(){is(ss(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;is(ss(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new ft,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})),this._canPlay&&this.enable(),this.addEventListeners(e,"mouseenter",this._handleMouseEnter.bind(this)),this.addEventListeners(e,"mouseleave",this._handleMouseLeave.bind(this)),this.addEventListeners(e,"mousemove",this._handleMouseMove.bind(this)),this.addEventListeners(e,"mousedown",this._handleMouseDown.bind(this)),this.addEventListeners(e,"mouseup",this._handleMouseUp.bind(this)),this.addEventListeners(window,"blur",this._handleWindowBlur.bind(this))}},{key:"_createCursor",value:function(){var t=this.prefix,e=this.container,n=this.domContainer;this.prop.hideNativeCursor&&(n.style.cursor="none",n.classList.add("hide-defaut-cursor")),n.classList.add("".concat(t,"-container")),this._outerCursor=b("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:n}),this._innerCursor=b("div",{class:"".concat(t,"__inner disabled"),parent:this._outerCursor}),this.callbacks.tbt("create",{outerCursor:this.outerCursor,innerCursor:this.innerCursor})}},{key:"_destroyCursor",value:function(){var t=this.prefix,e=this.domContainer;e.style.cursor="",e.classList.remove("hide-defaut-cursor"),e.classList.remove("".concat(t,"-container")),this._outerCursor.remove(),this._innerCursor.remove()}},{key:"_handleMouseEnter",value:function(t){this._xTarget=t.clientX,this._x=this._xTarget,this._yTarget=t.clientY,this._y=this._yTarget,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._xTarget=t.clientX,this._yTarget=t.clientY,this.outerCursor.classList.add("in-action"),this._canPlay&&this._animationFrame.play()}},{key:"_handleMouseDown",value:function(t){1===t.which&&(this.outerCursor.classList.add("click"),this.innerCursor.classList.add("click"))}},{key:"_handleMouseUp",value:function(){this.outerCursor.classList.remove("click"),this.innerCursor.classList.remove("click")}},{key:"_handleWindowBlur",value:function(){this._handleMouseUp()}},{key:"render",value:function(){var t=this.prop,e=this.domContainer,n=t.render,r=n.normalizeLerp,o=n.lerp,i=n.lerpToFixed,s=r?60/this._currentFPS:1;if(this._x=J(this._x,this._xTarget,o*s,.02),this._y=J(this._y,this._yTarget,o*s,.02),"number"==typeof i){var a=Math.round(Math.abs(i));this._x=parseFloat(this._x.toFixed(a)),this._y=parseFloat(this._y.toFixed(a))}var c=this._x,u=this._y;if(!this._containerIsWindow){var l=e.getBoundingClientRect();c-=l.left,u-=l.top}this.outerCursor.style.transform="translate(".concat(c,"px, ").concat(u,"px)"),t.autoStop&&this._x===this._xTarget&&this._y===this._yTarget&&this._animationFrame.pause(),this._callbacks.tbt("render",{x:c,y:u})}},{key:"enable",value:function(){this._canPlay=!0,this._animationFrame.isPlaying||(this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play())}},{key:"disable",value:function(){this._canPlay=!1,this._animationFrame.isPlaying&&(this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause())}},{key:"_destroy",value:function(){is(ss(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}])&&ts(e.prototype,n),r&&ts(e,r),i}(q),us={common:t,listeners:r,math:e};window.Vevet=i})()})();