/*! For license information please see shifty.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("shifty",[],t):"object"==typeof exports?exports.shifty=t():e.shifty=t()}(self,(function(){return function(){"use strict";var e={933:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.setBezierFunction=t.getCubicBezierTransition=void 0;const i=n(55);t.getCubicBezierTransition=(e=.25,t=.25,n=.75,i=.75)=>s=>function(e,t,n,i,s,r){let a=0,o=0,u=0,l=0,c=0,h=0;const p=e=>((a*e+o)*e+u)*e,d=e=>(3*a*e+2*o)*e+u,_=e=>e>=0?e:0-e;return u=3*t,o=3*(i-t)-u,a=1-u-o,h=3*n,c=3*(s-n)-h,l=1-h-c,f=e,g=(e=>1/(200*e))(r),(e=>((l*e+c)*e+h)*e)(((e,t)=>{let n,i,s,r,a,o;for(s=e,o=0;o<8;o++){if(r=p(s)-e,_(r)<t)return s;if(a=d(s),_(a)<1e-6)break;s-=r/a}if(n=0,i=1,s=e,s<n)return n;if(s>i)return i;for(;n<i;){if(r=p(s),_(r-e)<t)return s;e>r?n=s:i=s,s=.5*(i-n)+n}return s})(f,g));var f,g}(s,e,t,n,i,1),t.setBezierFunction=(e,n,s,r,a)=>{const o=(0,t.getCubicBezierTransition)(n,s,r,a);return o.displayName=e,o.x1=n,o.y1=s,o.x2=r,o.y2=a,i.Tweenable.easing[e]=o}},156:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.standardEasingFunctions=t.setBezierFunction=t.Scene=t.interpolate=t.tween=t.Tweenable=t.shouldScheduleUpdate=t.processTweens=void 0;const r=n(55);Object.defineProperty(t,"processTweens",{enumerable:!0,get:function(){return r.processTweens}}),Object.defineProperty(t,"shouldScheduleUpdate",{enumerable:!0,get:function(){return r.shouldScheduleUpdate}}),Object.defineProperty(t,"Tweenable",{enumerable:!0,get:function(){return r.Tweenable}}),Object.defineProperty(t,"tween",{enumerable:!0,get:function(){return r.tween}});var a=n(243);Object.defineProperty(t,"interpolate",{enumerable:!0,get:function(){return a.interpolate}});var o=n(612);Object.defineProperty(t,"Scene",{enumerable:!0,get:function(){return o.Scene}});var u=n(933);Object.defineProperty(t,"setBezierFunction",{enumerable:!0,get:function(){return u.setBezierFunction}});var l=n(809);Object.defineProperty(t,"standardEasingFunctions",{enumerable:!0,get:function(){return l.standardEasingFunctions}}),s(n(613),t),t.VERSION=String("3.0.6")},243:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.interpolate=void 0;const i=n(55),s=new i.Tweenable,{filters:r}=i.Tweenable;t.interpolate=(e,t,n,a=i.Tweenable.easing.linear,o=0)=>{const u=Object.assign({},e),l=(0,i.composeEasingObject)(e,a);s._filters.length=0,s.setState({}),s._currentState=u,s._originalState=e,s._targetState=t,s._easing=l;for(const e in r)r[e].doesApply(s)&&s._filters.push(r[e]);s._applyFilter("tweenCreated"),s._applyFilter("beforeTween");const c=(0,i.tweenProps)(n,u,e,t,1,o,l);return s._applyFilter("afterTween"),c}},612:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Scene=void 0,t.Scene=class{constructor(...e){this._tweenables=[],e.forEach(this.add.bind(this))}get tweenables(){return[...this._tweenables]}get promises(){return this._tweenables.map((e=>e.then()))}add(e){return this._tweenables.push(e),e}remove(e){const t=this._tweenables.indexOf(e);return t>-1&&this._tweenables.splice(t,1),e}empty(){return this.tweenables.map(this.remove.bind(this))}get isPlaying(){return this._tweenables.some((({isPlaying:e})=>e))}tween(){return this._tweenables.forEach((e=>e.tween())),this}pause(){return this._tweenables.forEach((e=>e.pause())),this}resume(){return this._tweenables.filter((({hasEnded:e})=>!e)).forEach((e=>e.resume())),this}stop(e){return this._tweenables.forEach((t=>t.stop(e))),this}}},809:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardEasingFunctions=void 0,t.standardEasingFunctions=Object.freeze({linear:e=>e,easeInQuad:e=>Math.pow(e,2),easeOutQuad:e=>-(Math.pow(e-1,2)-1),easeInOutQuad:e=>(e/=.5)<1?.5*Math.pow(e,2):-.5*((e-=2)*e-2),easeInCubic:e=>Math.pow(e,3),easeOutCubic:e=>Math.pow(e-1,3)+1,easeInOutCubic:e=>(e/=.5)<1?.5*Math.pow(e,3):.5*(Math.pow(e-2,3)+2),easeInQuart:e=>Math.pow(e,4),easeOutQuart:e=>-(Math.pow(e-1,4)-1),easeInOutQuart:e=>(e/=.5)<1?.5*Math.pow(e,4):-.5*((e-=2)*Math.pow(e,3)-2),easeInQuint:e=>Math.pow(e,5),easeOutQuint:e=>Math.pow(e-1,5)+1,easeInOutQuint:e=>(e/=.5)<1?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2),easeInSine:e=>1-Math.cos(e*(Math.PI/2)),easeOutSine:e=>Math.sin(e*(Math.PI/2)),easeInOutSine:e=>-.5*(Math.cos(Math.PI*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e)),easeInCirc:e=>-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,easeInBack:e=>{const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:e=>{const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:e=>{let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},elastic:e=>-1*Math.pow(4,-8*e)*Math.sin((6*e-1)*(2*Math.PI)/2)+1,swingFromTo:e=>{let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},swingFrom:e=>{const t=1.70158;return e*e*((t+1)*e-t)},swingTo:e=>{const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},bounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,bouncePast:e=>e<1/2.75?7.5625*e*e:e<2/2.75?2-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?2-(7.5625*(e-=2.25/2.75)*e+.9375):2-(7.5625*(e-=2.625/2.75)*e+.984375),easeFromTo:e=>(e/=.5)<1?.5*Math.pow(e,4):-.5*((e-=2)*Math.pow(e,3)-2),easeFrom:e=>Math.pow(e,4),easeTo:e=>Math.pow(e,.25)})},525:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.afterTween=t.beforeTween=t.tweenCreated=t.doesApply=void 0;const i=n(613),s=/(\d|-|\.)/,r=/([^\-0-9.]+)/g,a=/[0-9.-]+/g,o=(()=>{const e=a.source,t=/,\s*/.source;return new RegExp(`rgba?\\(${e}${t}${e}${t}${e}(${t}${e})?\\)`,"g")})(),u=/^.*\(/,l=/#([0-9]|[a-f]){3,6}/gi,c="VAL",h=(e,t)=>e.map(((e,n)=>`_${t}_${n}`)),p=e=>{let t=e.match(r);return t?(1===t.length||e.charAt(0).match(s))&&t.unshift(""):t=["",""],t.join(c)};function d(e){return parseInt(e,16)}const _=e=>`rgb(${(e=>{if(3===(e=e.replace(/#/,"")).length){const[t,n,i]=e.split("");e=t+t+n+n+i+i}return[d(e.substring(0,2)),d(e.substring(2,4)),d(e.substring(4,6))]})(e).join(",")})`,f=(e,t,n)=>{const i=t.match(e);let s=t.replace(e,c);return i&&i.forEach((e=>s=s.replace(c,n(e)))),s},g=e=>{for(const t in e){const n=e[t];"string"==typeof n&&n.match(l)&&(e[t]=f(l,n,_))}},w=e=>{var t,n;const i=null!==(t=e.match(a))&&void 0!==t?t:[],s=i.slice(0,3).map((e=>Math.floor(Number(e)))),r=null===(n=e.match(u))||void 0===n?void 0:n[0];if(3===i.length)return`${r}${s.join(",")})`;if(4===i.length)return`${r}${s.join(",")},${i[3]})`;throw new Error(`Invalid rgbChunk: ${e}`)},m=e=>{var t;return null!==(t=e.match(a))&&void 0!==t?t:[]},b=(e,t)=>{const n={};return t.forEach((t=>{n[t]=e[t],delete e[t]})),n},y=(e,t)=>t.map((t=>Number(e[t]))),v=(e,t)=>(t.forEach((t=>e=e.replace(c,String(+t.toFixed(4))))),e);t.doesApply=e=>{for(const t in e._currentState)if("string"==typeof e._currentState[t])return!0;return!1},t.tweenCreated=function(e){const{_currentState:t,_originalState:n,_targetState:i}=e;[t,n,i].forEach(g),e._tokenData=(e=>{var t;const n={};for(const i in e){const s=e[i];"string"==typeof s&&(n[i]={formatString:p(s),chunkNames:h(null===(t=m(s))||void 0===t?void 0:t.map(Number),i)})}return n})(t)},t.beforeTween=function(e){const{_currentState:t,_originalState:n,_targetState:s,_easing:r,_tokenData:a}=e;"function"!=typeof r&&a&&((e,t)=>{var n;for(const s in t){const{chunkNames:r}=t[s],a=e[s];if("string"==typeof a){const t=a.split(" "),s=t[t.length-1];for(let a=0;a<r.length;a++){const o=r[a],u=null!==(n=t[a])&&void 0!==n?n:s;(0,i.isEasingKey)(u)&&(e[o]=u)}}else r.forEach((t=>e[t]=a));delete e[s]}})(r,a),[t,n,s].forEach((e=>((e,t)=>{for(const n in t)m(String(e[n])).forEach(((i,s)=>e[t[n].chunkNames[s]]=+i)),delete e[n]})(e,null!=a?a:{})))},t.afterTween=function(e){const{_currentState:t,_originalState:n,_targetState:i,_easing:s,_tokenData:r}=e;[t,n,i].forEach((e=>((e,t)=>{for(const n in t){const{chunkNames:i,formatString:s}=t[n],r=v(s,y(b(e,i),i));e[n]=f(o,r,w)}})(e,null!=r?r:{}))),"function"!=typeof s&&r&&((e,t)=>{for(const n in t){const{chunkNames:i}=t[n],s=e[i[0]];e[n]="string"==typeof s?i.map((t=>{const n=e[t];return delete e[t],n})).join(" "):s}})(s,r)}},55:function(e,t,n){var i,s=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.shouldScheduleUpdate=t.tween=t.Tweenable=t.composeEasingObject=t.scheduleUpdate=t.processTweens=t.tweenProps=t.getListTail=t.getListHead=t.resetList=void 0;const o=n(809),u=n(933),l=n(613),c=a(n(525)),h="linear",p=1e3/60,d="undefined"!=typeof window?window:n.g,_="afterTween",f="beforeTween",g="string",w="function";let m=d.requestAnimationFrame;m||(m="undefined"==typeof window?setTimeout:window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||window.mozCancelRequestAnimationFrame&&window.mozRequestAnimationFrame||setTimeout);const b=()=>{};let y=null,v=null;t.resetList=()=>{y=v=null},t.getListHead=()=>y,t.getListTail=()=>v,t.tweenProps=(e,t,n,i,s,r,a)=>{var u;let l,c=0;const h=e<r?0:(e-r)/s;let p;for(const e in t){if(typeof a===w)p=a;else{const t=a[e];p=typeof t===w?t:null!==(u=E.easing[t])&&void 0!==u?u:o.standardEasingFunctions.linear}c=p(h),l=n[e],t[e]=l+(i[e]-l)*c}return t};const S=(e,n)=>{var i;let s=null!==(i=e._timestamp)&&void 0!==i?i:0;const r=e._currentState,a=e._delay;if(n<s+a)return;let o=e._duration;const u=e._targetState,l=s+a+o;let c=n>l?l:n;e._hasEnded=c>=l;const h=o-(l-c);if(e._hasEnded)return e._render(u,h,e._data),e.stop(!0);e._applyFilter(f),c<s+a?s=o=c=1:s+=a,(0,t.tweenProps)(c,r,e._originalState,u,o,s,e._easing),e._applyFilter(_),e._render(r,h,e._data)};t.processTweens=()=>{let e;const t=E.now();let n=y;for(;n;)e=n._next,S(n,t),n=e};const{now:O}=Date;let j,M=!1;t.scheduleUpdate=()=>{j=O(),M&&m.call(d,t.scheduleUpdate,p),(0,t.processTweens)()},t.composeEasingObject=(e,t=h,n={})=>{if(typeof t===g&&(0,l.isEasingKey)(t))return E.easing[t];if(Array.isArray(t))return(0,u.getCubicBezierTransition)(...t);if("object"==typeof n)if(typeof t===g||typeof t===w)for(const i in e)n[i]=t;else for(const i in e)n[i]=t[i]||h;return n};const P=(()=>{let e,t;return n=>{e=null,t=null,n===y?(y=n._next,y?y._previous=null:v=null):n===v?(v=n._previous,v?v._next=null:y=null):(e=n._previous,t=n._next,e&&(e._next=t),t&&(t._previous=e)),n._previous=n._next=null}})(),T=typeof Promise===w?Promise:null;class E{constructor(e={},t){this[i]="Promise",this._next=null,this._previous=null,this._config={},this._data={},this._delay=0,this._duration=500,this._filters=[],this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._originalState={},this._targetState={},this._start=b,this._render=b,this._promiseCtor=T,this._promise=null,this._isPlaying=!1,this._pausedAtTime=null,this._easing={},this._currentState=e||{},t&&this.setConfig(t)}_applyFilter(e){var t;for(let n=this._filters.length;n>0;n--){const i=this._filters[n-n];null===(t=i[e])||void 0===t||t.call(i,this)}}tween(e){return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=E.now(),this._start(this.state,this._data),this._delay&&this._render(this._currentState,0,this._data),this._resume(this._timestamp)}setConfig(e={}){var n;const{_config:i}=this;let s;for(s in e)i[s]=e[s];const{promise:r=this._promiseCtor,start:a=b,finish:o,render:u=b}=i;this._data=i.data||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._delay=e.delay||0,this._start=a,this._render=u,this._duration=i.duration||500,this._promiseCtor=r,o&&(this._resolve=o);const{from:l,to:c={}}=e,{_currentState:h,_originalState:p,_targetState:d}=this;for(const e in l)h[e]=l[e];let _=!1;for(const e in h){const t=h[e];_||typeof t!==g||(_=!0),p[e]=t,d[e]=null!==(n=c[e])&&void 0!==n?n:t}if(this._easing=(0,t.composeEasingObject)(this._currentState,i.easing,this._easing),this._filters.length=0,_){for(const e in E.filters)E.filters[e].doesApply(this)&&this._filters.push(E.filters[e]);this._applyFilter("tweenCreated")}return this}then(e,t){if(!this._promiseCtor)throw new Error("Promise implementation is unavailable");return this._promise=new this._promiseCtor(((e,t)=>{this._resolve=e,this._reject=t})),this._promise.then(e,t)}catch(e){return this.then().catch(e)}finally(e){return this.then().finally(e)}get state(){return Object.assign({},this._currentState)}setState(e){this._currentState=e}pause(){return this._isPlaying?(this._pausedAtTime=E.now(),this._isPlaying=!1,P(this),this):this}resume(){return this._resume()}_resume(e=E.now()){if(null===this._timestamp)return this.tween();if(this._isPlaying&&this._promise)return this;this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0;const n=Boolean(y);return null===y?(y=this,v=this):(this._previous=v,v&&(v._next=this),v=this),n||(0,t.shouldScheduleUpdate)(!0),this}seek(e){var t;e=Math.max(e,0);const n=E.now();return(null!==(t=this._timestamp)&&void 0!==t?t:0)+e===0||(this._timestamp=n-e,S(this,n)),this}stop(e=!1){var n;return this._isPlaying?(this._isPlaying=!1,P(this),e&&(this._applyFilter(f),(0,t.tweenProps)(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),this._applyFilter(_),this._applyFilter("afterTweenEnd")),null===(n=this._resolve)||void 0===n||n.call(this,{data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this):this}cancel(e=!1){var t;const{_currentState:n,_data:i,_isPlaying:s}=this;return s?(null===(t=this._reject)||void 0===t||t.call(this,{data:i,state:n,tweenable:this}),this._resolve=null,this._reject=null,this.stop(e)):this}get isPlaying(){return this._isPlaying}get hasEnded(){return this._hasEnded}data(e=null){return e&&(this._data=Object.assign({},e)),this._data}dispose(){for(const e in this)delete this[e]}}t.Tweenable=E,i=Symbol.toStringTag,E.now=()=>(M||(j=O()),j),E.setScheduleFunction=e=>m=e,E.filters={token:c},E.easing=Object.create(o.standardEasingFunctions),t.tween=function(e={}){return new E({},{}).tween(e)},t.shouldScheduleUpdate=e=>{e&&M||(M=e,e&&(0,t.scheduleUpdate)())}},613:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isEasingKey=void 0;const i=n(55);t.isEasingKey=e=>e in i.Tweenable.easing}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(156)}()}));
//# sourceMappingURL=shifty.js.map