diff --git a/docs/index.js b/docs/index.js index f155281ab..1d7841438 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("EmblaCarousel",[],t):"object"==typeof exports?exports.EmblaCarousel=t():e.EmblaCarousel=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Vector1D=function(e){var t={value:e};function n(){return t.value}function r(e){return t.value/=e,u}function o(){return n()}function i(){var e=o();return 0!==e&&r(e),u}var u={add:function(e){return t.value+=e.get(),u},addNumber:function(e){return t.value+=e,u},divide:r,get:n,limit:function(e){return o()>e&&i().multiply(e),u},magnitude:o,multiply:function(e){return t.value*=e,u},normalize:i,set:function(e){return t.value=e.get(),u},setNumber:function(e){return t.value=e,u},subtract:function(e){return t.value-=e.get(),u},subtractNumber:function(e){return t.value-=e,u}};return Object.freeze(u)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.Direction=function(e){var t=r.Vector1D(n(e));function n(e){return 0===e?0:e/Math.abs(e)}var o={get:t.get,set:function(e){var r=n(e.get());return 0!==r&&t.setNumber(r),o}};return Object.freeze(o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rectWidth=function(e){return e.getBoundingClientRect().width},t.map=function(e,t,n,r,o){return r+(e-t)/(n-t)*(o-r)},t.arrayFromCollection=function(e){return Array.prototype.slice.call(e)},t.debounce=function(e,t){var n={id:0};return function(){window.clearTimeout(n.id),n.id=window.setTimeout(e,t)||0}},t.groupNumbers=function(e,t){for(var n=[],r=0;r3&&void 0!==arguments[3]&&arguments[3];return n.addEventListener(r,o,i),e.listeners.push(function(){return n.removeEventListener(r,o,i)}),t},removeAll:function(){return e.listeners.filter(function(e){return e()}),t}};return Object.freeze(t)}},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n={active:!1,lastWindowWidth:0},s=r({},a.defaultOptions,t),d=i.EventDispatcher(),f=u.EventStore(),l=c.debounce(function(){var e=window.innerWidth;e!==n.lastWindowWidth&&(n.lastWindowWidth=e,M())},500),v=M,m={},p={},g=d.on,b=d.off;function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=!n.active;if(n.lastWindowWidth=window.innerWidth,function(){if(!e)throw new Error("No root element provided 😢");var t=s.containerSelector,r=e.querySelector(t);if(!r)throw new Error("No valid container element found 😢");p.root=e,p.container=r,p.slides=c.arrayFromCollection(r.children),n.active=!0}(),p.slides.length>0){var u=p.root,a=p.container,v=p.slides,g=r(s,t),b=o.Engine(u,a,v,g,d);r(m,b),f.add(window,"resize",l),v.forEach(y),m.translate.to(m.mover.location),s.draggable&&function(){var e=p.root.classList,t=s.draggingClass,n=s.draggableClass;m.pointer.addActivationEvents(),d.on("dragStart",function(){return e.add(t)}),d.on("dragEnd",function(){return e.remove(t)}),e.add(n)}(),s.loop&&m.shifter.shiftInfinite(v),i&&(d.on("select",x),d.on("init",x),setTimeout(function(){return d.dispatch("init")},0))}}function x(){var e=p.slides,t=m.index,n=m.indexPrevious,r=m.indexGroups,o=s.selectedClass,i=r[n.get()],u=r[t.get()];i.forEach(function(t){return e[t].classList.remove(o)}),u.forEach(function(t){return e[t].classList.add(o)})}function y(t,n){f.add(t,"focus",function(){var t=Math.floor(n/s.groupSlides),r=n?t:n;e.scrollLeft=0,j(r)},!0)}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.active){var t=r({startIndex:m.index.get()},e);O(),h(t)}}function O(){var e=p.root,t=p.container,n=p.slides;m.pointer.removeAllEvents(),m.animation.stop(),f.removeAll(),e.classList.remove(s.draggableClass),t.style.transform="",n.forEach(function(e){return e.style.left=""})}function j(e){m.mover.useDefaultSpeed(),m.travel.toIndex(e)}h(s);var _={changeOptions:v,containerNode:function(){return p.container},destroy:function(){n.active=!1,O(),d.dispatch("destroy")},goTo:j,groupedIndexes:function(){return m.indexGroups},next:function(){m.mover.useDefaultSpeed(),m.travel.toNext()},off:b,on:g,previous:function(){m.mover.useDefaultSpeed(),m.travel.toPrevious()},previousIndex:function(){return m.indexPrevious.get()},selectedIndex:function(){return m.index.get()},slideNodes:function(){return p.slides}};return Object.freeze(_)}t.EmblaCarousel=s,t.default=s,e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),o=n(8),i=n(9),u=n(10),a=n(11),c=n(12),s=n(13),d=n(14),f=n(15),l=n(16),v=n(17),m=n(18),p=n(19),g=n(20),b=n(2),h=n(0);t.Engine=function(e,t,n,x,y){var M=x.align,O=x.startIndex,j=x.loop,_=x.speed,S=x.dragFree,P=x.groupSlides,D=Math.ceil(n.length/P)-1,w=Object.keys(n).map(Number),z=b.groupNumbers(w,P),E=u.Counter({limit:f.Limit({max:D,min:0}),loop:j,start:O}),T=E.clone(),N=b.rectWidth(t),C=i.ChunkSize(N),A=r.AlignSize({align:M,root:C.root}),k=n.map(b.rectWidth).map(C.measure),F=b.groupNumbers(k,P).map(function(e){return e.reduce(function(e,t){return e+t})}),I=F.map(A.measure),L=F.reduce(function(e,t){return e+t}),V=F.map(function(e,t){var n=E.clone().set(t+1);return e+I[t]-I[n.get()]}),W=F.map(function(e,t){return V.slice(0,t).reduce(function(e,t){return e-t},I[0])}),G=-L+C.measure(1),B=W[0],X=j?B+G:W[E.max],q=f.Limit({max:B,min:X}),R=o.Animation(function(){$.mover.seek(H).update(),Z.isDown()||(j||$.edgeGuard.constrain(H),$.mover.settle(H)&&($.animation.stop(),$.translate.useType("x"))),j&&($.edgeLooper.loop(Z.isDown()?Z.direction.get():$.mover.direction.get()),$.shifter.shiftInfinite(n)),$.translate.to($.mover.location).useType("x3d"),$.animation.proceed()}),U=W[E.get()],Y=h.Vector1D(U),H=h.Vector1D(U),J=[Y,H],K=l.Mover({location:Y,mass:1.5,maxForce:2*C.root,speed:_}),Q=g.Traveller({animation:R,events:y,findTarget:m.TargetFinder({diffSizes:V,dragFree:S,groupPositions:W,groupSizes:F,index:E,limit:q,loop:j,span:L,target:H}),index:E,indexPrevious:T,target:H}),Z=a.DragBehaviour({animation:R,dragFree:S,element:e,events:y,groupSizes:F,index:E,limit:q,location:Y,loop:j,mover:K,pointer:v.Pointer(C),target:H,travel:Q}),$={animation:R,edgeGuard:c.EdgeGuard({animation:R,limit:q,location:Y,mover:K,tolerance:50}),edgeLooper:s.EdgeLooper({limit:q,location:Y,span:L,vectors:J}),index:E,indexGroups:z,indexPrevious:T,mover:K,pointer:Z,shifter:d.InfiniteShifter({alignSizes:I,chunkSize:C,location:Y,slideSizes:k,span:L}),target:H,translate:p.Translate(t),travel:Q};return Object.freeze($)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlignSize=function(e){var t=e.root,n=e.align,r={start:function(e){return 0*e},center:function(e){return(t-e)/2},end:function(e){return t-e}},o={measure:function(e){return r[n](e)}};return Object.freeze(o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=function(e){var t=requestAnimationFrame.bind(window),n=cancelAnimationFrame.bind(window),r={animationFrame:0};function o(e,t){return function(){return e===!!r.animationFrame&&t(),u}}function i(){r.animationFrame=t(e)}var u={proceed:o(!0,i),start:o(!1,i),stop:o(!0,function(){n(r.animationFrame),r.animationFrame=0})};return Object.freeze(u)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkSize=function(e){var t={root:e},n={measure:function(e){return e/t.root*100},root:100};return Object.freeze(n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=function e(t){var n=t.start,r=t.limit,o=t.loop,i=r.min,u=r.max,a=o?"loop":"constrain",c={value:f(n)};function s(){return c.value}function d(e){return c.value=f(e),l}function f(e){return r[a](e)}var l={add:function e(t){if(0!==t){var n=t/Math.abs(t);return d(s()+n),e(t+-1*n)}return l},clone:function(){return e({start:s(),limit:r,loop:o})},get:s,max:u,min:i,set:d};return Object.freeze(l)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=n(0);t.DragBehaviour=function(e){var t=e.element,n=e.pointer,u=e.location,a=e.events,c=e.target,s=e.mover,d=e.dragFree,f=e.animation,l=n.direction,v=["INPUT","SELECT","TEXTAREA"],m=i.Vector1D(0),p=i.Vector1D(0),g=o.EventStore(),b=o.EventStore(),h={mouse:2,touch:2.8},x={mouse:4,touch:7},y={mouse:12,touch:15},M={mouse:6,touch:5},O=5,j={isDown:!1,isMouse:!1,preventClick:!1,preventScroll:!1};function _(e){var r,o=e.target,i=e.type;j.isMouse=!!i.match(/mouse/),n.down(e),c.set(u),j.preventClick=!1,j.isDown=!0,s.useSpeed(50),f.start(),r=j.isMouse?document:t,b.add(r,"touchmove",S).add(r,"touchend",P).add(r,"mousemove",S).add(r,"mouseup",P),a.dispatch("dragStart"),j.isMouse?function(e){var t=e.nodeName||"";return v.indexOf(t)>-1}(o)||e.preventDefault():(m.set(n.read(e,"x")),p.set(n.read(e,"y")))}function S(t){if(j.preventScroll||j.isMouse){var r=e.limit,o=e.loop,i=n.move(t),a=r.reachedAny(u.get()),s=!o&&a?2:1;c.addNumber(i/s),t.preventDefault()}else{var d=n.read(t,"x").get(),f=n.read(t,"y").get(),l=Math.abs(d-m.get()),v=Math.abs(f-p.get());j.preventScroll=l>v,j.preventScroll||P()}}function P(){var t=e.travel,o=function(t){var n=e.groupSizes,o=e.index,i=Math.abs(t),u=n[o.get()]/2,a=i>O,c=i0?t.concat([n]):t},[])}function p(e,t,n){return t.reduce(function(t,n){var r=t+a[n];return rf?c:s;return t.setNumber(n)},location:l,index:a}})}var b={shiftInfinite:function(t){var n=e.location;l.forEach(function(e){var r=e.findTarget,o=e.location,i=e.index,u=r(n.get());u.get()!==o.get()&&(t[i].style.left="".concat(u.get(),"%"),o.set(u))})},shiftPoints:l};return Object.freeze(b)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Limit=function(e){var t=e.min,n=e.max,r={max:t,min:n},o={min:t,max:n};function i(e){return en}function a(e){var t=i(e)&&"min",n=u(e)&&"max";return t||n||""}var c={constrain:function(e){var t=a(e);return t?o[t]:e},loop:function(e){var t=a(e);return t?r[t]:e},max:n,min:t,reachedAny:function(e){return i(e)||u(e)},reachedMax:u,reachedMin:i};return Object.freeze(c)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(2),i=n(0);t.Mover=function(e){var t=e.location,n=e.speed,u=e.mass,a=e.maxForce,c=i.Vector1D(0),s=i.Vector1D(0),d=i.Vector1D(0),f=r.Direction(0),l={speed:n};function v(e){return l.speed=e,m}var m={direction:f,location:t,seek:function(e){d.set(e).subtract(t);var n,r=d.magnitude(),i=o.map(r,0,100,0,l.speed);return f.set(d),d.normalize().multiply(i).subtract(c).limit(a),(n=d).divide(u),s.add(n),m},settle:function(e){var n=e.get()-t.get(),r=!(Math.round(100*n)/100);return r&&t.set(e),r},update:function(){return c.add(s),t.add(c),s.multiply(0),m},useDefaultSpeed:function(){return v(n),m},useSpeed:v};return Object.freeze(m)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(0);t.Pointer=function(e){var t={x:"clientX",y:"clientY"},n=o.Vector1D(0),i=o.Vector1D(0),u=o.Vector1D(0),a=o.Vector1D(0),c=r.Direction(0),s=10,d={isMouse:!1,trackPoints:[],trackTime:(new Date).getTime()};function f(e,n){var r=d.isMouse,o=t[n],i=r?e[o]:e.touches[0][o];return a.setNumber(i)}var l={direction:c,down:function(t){d.isMouse=!!t.type.match(/mouse/);var r=f(t,"x");return n.set(r),u.set(r),e.measure(n.get())},move:function(t){var n=f(t,"x"),r=(new Date).getTime();return r-d.trackTime>=s&&(d.trackPoints.push(n.get()),d.trackTime=r),i.set(n).subtract(u),c.set(i),u.set(n),e.measure(i.get())},read:f,up:function(){var t=u.get(),n=d.isMouse?5:4;return u.setNumber(d.trackPoints.slice(-n).map(function(e){return t-e}).sort(function(e,t){return Math.abs(e)t.end?n:e},0);return{distance:a,index:c}}(l),m=!r&&d(l);if(m||a){var p=s.min,g=s.max,b=f(l)?p:g;return{distance:t,index:m?b:v.index}}return{distance:l+function(t){var n=t.distance,u=t.index,a=o[e.index.max],c=r&&ne&&i().multiply(e),u},magnitude:o,multiply:function(e){return t.value*=e,u},normalize:i,set:function(e){return t.value=e.get(),u},setNumber:function(e){return t.value=e,u},subtract:function(e){return t.value-=e.get(),u},subtractNumber:function(e){return t.value-=e,u}};return Object.freeze(u)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.Direction=function(e){var t=r.Vector1D(n(e));function n(e){return 0===e?0:e/Math.abs(e)}var o={get:t.get,set:function(e){var r=n(e.get());return 0!==r&&t.setNumber(r),o}};return Object.freeze(o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rectWidth=function(e){return e.getBoundingClientRect().width},t.map=function(e,t,n,r,o){return r+(e-t)/(n-t)*(o-r)},t.arrayFromCollection=function(e){return Array.prototype.slice.call(e)},t.debounce=function(e,t){var n={id:0};return function(){window.clearTimeout(n.id),n.id=window.setTimeout(e,t)||0}},t.groupNumbers=function(e,t){for(var n=[],r=0;r3&&void 0!==arguments[3]&&arguments[3];return n.addEventListener(r,o,i),e.listeners.push(function(){return n.removeEventListener(r,o,i)}),t},removeAll:function(){return e.listeners.filter(function(e){return e()}),t}};return Object.freeze(t)}},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n={active:!1,lastWindowWidth:0},s=r({},a.defaultOptions,t),d=i.EventDispatcher(),f=u.EventStore(),l=c.debounce(function(){var e=window.innerWidth;e!==n.lastWindowWidth&&(n.lastWindowWidth=e,M())},500),v=M,m={},p={},g=d.on,b=d.off;function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=!n.active;if(n.lastWindowWidth=window.innerWidth,function(){if(!e)throw new Error("No root element provided 😢");var t=s.containerSelector,r=e.querySelector(t);if(!r)throw new Error("No valid container element found 😢");p.root=e,p.container=r,p.slides=c.arrayFromCollection(r.children),n.active=!0}(),p.slides.length>0){var u=p.root,a=p.container,v=p.slides,g=r(s,t),b=o.Engine(u,a,v,g,d);r(m,b),f.add(window,"resize",l),v.forEach(y),m.translate.to(m.mover.location),s.draggable&&function(){var e=p.root.classList,t=s.draggingClass,n=s.draggableClass;m.pointer.addActivationEvents(),d.on("dragStart",function(){return e.add(t)}),d.on("dragEnd",function(){return e.remove(t)}),e.add(n)}(),s.loop&&m.shifter.shiftInfinite(v),i&&(d.on("select",x),d.on("init",x),setTimeout(function(){return d.dispatch("init")},0))}}function x(){var e=p.slides,t=m.index,n=m.indexPrevious,r=m.indexGroups,o=s.selectedClass,i=r[n.get()],u=r[t.get()];i.forEach(function(t){return e[t].classList.remove(o)}),u.forEach(function(t){return e[t].classList.add(o)})}function y(t,n){f.add(t,"focus",function(){var t=Math.floor(n/s.groupSlides),r=n?t:n;e.scrollLeft=0,j(r)},!0)}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.active){var t=r({startIndex:m.index.get()},e);O(),h(t)}}function O(){var e=p.root,t=p.container,n=p.slides;m.pointer.removeAllEvents(),m.animation.stop(),f.removeAll(),e.classList.remove(s.draggableClass),t.style.transform="",n.forEach(function(e){return e.style.left=""})}function j(e){m.mover.useDefaultSpeed(),m.travel.toIndex(e)}function _(){return m.index.get()}function S(){return _()===m.index.min}function P(){return _()===m.index.max}h(s);var D={changeOptions:v,containerNode:function(){return p.container},destroy:function(){n.active=!1,O(),d.dispatch("destroy")},goTo:j,groupedIndexes:function(){return m.indexGroups},hasNextIndex:function(){return!s.loop&&!P()},hasPreviousIndex:function(){return!s.loop&&!S()},isFirstIndex:S,isLastIndex:P,next:function(){m.mover.useDefaultSpeed(),m.travel.toNext()},off:b,on:g,previous:function(){m.mover.useDefaultSpeed(),m.travel.toPrevious()},previousIndex:function(){return m.indexPrevious.get()},selectedIndex:_,slideNodes:function(){return p.slides}};return Object.freeze(D)}t.EmblaCarousel=s,t.default=s,e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),o=n(8),i=n(9),u=n(10),a=n(11),c=n(12),s=n(13),d=n(14),f=n(15),l=n(16),v=n(17),m=n(18),p=n(19),g=n(20),b=n(2),h=n(0);t.Engine=function(e,t,n,x,y){var M=x.align,O=x.startIndex,j=x.loop,_=x.speed,S=x.dragFree,P=x.groupSlides,D=Math.ceil(n.length/P)-1,w=Object.keys(n).map(Number),z=b.groupNumbers(w,P),E=u.Counter({limit:f.Limit({max:D,min:0}),loop:j,start:O}),T=E.clone(),N=b.rectWidth(t),C=i.ChunkSize(N),A=r.AlignSize({align:M,root:C.root}),k=n.map(b.rectWidth).map(C.measure),F=b.groupNumbers(k,P).map(function(e){return e.reduce(function(e,t){return e+t})}),I=F.map(A.measure),L=F.reduce(function(e,t){return e+t}),V=F.map(function(e,t){var n=E.clone().set(t+1);return e+I[t]-I[n.get()]}),W=F.map(function(e,t){return V.slice(0,t).reduce(function(e,t){return e-t},I[0])}),G=-L+C.measure(1),B=W[0],X=j?B+G:W[E.max],q=f.Limit({max:B,min:X}),R=o.Animation(function(){$.mover.seek(H).update(),Z.isDown()||(j||$.edgeGuard.constrain(H),$.mover.settle(H)&&($.animation.stop(),$.translate.useType("x"))),j&&($.edgeLooper.loop(Z.isDown()?Z.direction.get():$.mover.direction.get()),$.shifter.shiftInfinite(n)),$.translate.to($.mover.location).useType("x3d"),$.animation.proceed()}),U=W[E.get()],Y=h.Vector1D(U),H=h.Vector1D(U),J=[Y,H],K=l.Mover({location:Y,mass:1.5,maxForce:2*C.root,speed:_}),Q=g.Traveller({animation:R,events:y,findTarget:m.TargetFinder({diffSizes:V,dragFree:S,groupPositions:W,groupSizes:F,index:E,limit:q,loop:j,span:L,target:H}),index:E,indexPrevious:T,target:H}),Z=a.DragBehaviour({animation:R,dragFree:S,element:e,events:y,groupSizes:F,index:E,limit:q,location:Y,loop:j,mover:K,pointer:v.Pointer(C),target:H,travel:Q}),$={animation:R,edgeGuard:c.EdgeGuard({animation:R,limit:q,location:Y,mover:K,tolerance:50}),edgeLooper:s.EdgeLooper({limit:q,location:Y,span:L,vectors:J}),index:E,indexGroups:z,indexPrevious:T,mover:K,pointer:Z,shifter:d.InfiniteShifter({alignSizes:I,chunkSize:C,location:Y,slideSizes:k,span:L}),target:H,translate:p.Translate(t),travel:Q};return Object.freeze($)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlignSize=function(e){var t=e.root,n=e.align,r={start:function(e){return 0*e},center:function(e){return(t-e)/2},end:function(e){return t-e}},o={measure:function(e){return r[n](e)}};return Object.freeze(o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=function(e){var t=requestAnimationFrame.bind(window),n=cancelAnimationFrame.bind(window),r={animationFrame:0};function o(e,t){return function(){return e===!!r.animationFrame&&t(),u}}function i(){r.animationFrame=t(e)}var u={proceed:o(!0,i),start:o(!1,i),stop:o(!0,function(){n(r.animationFrame),r.animationFrame=0})};return Object.freeze(u)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkSize=function(e){var t={root:e},n={measure:function(e){return e/t.root*100},root:100};return Object.freeze(n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=function e(t){var n=t.start,r=t.limit,o=t.loop,i=r.min,u=r.max,a=o?"loop":"constrain",c={value:f(n)};function s(){return c.value}function d(e){return c.value=f(e),l}function f(e){return r[a](e)}var l={add:function e(t){if(0!==t){var n=t/Math.abs(t);return d(s()+n),e(t+-1*n)}return l},clone:function(){return e({start:s(),limit:r,loop:o})},get:s,max:u,min:i,set:d};return Object.freeze(l)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=n(0);t.DragBehaviour=function(e){var t=e.element,n=e.pointer,u=e.location,a=e.events,c=e.target,s=e.mover,d=e.dragFree,f=e.animation,l=n.direction,v=["INPUT","SELECT","TEXTAREA"],m=i.Vector1D(0),p=i.Vector1D(0),g=o.EventStore(),b=o.EventStore(),h={mouse:2,touch:2.8},x={mouse:4,touch:7},y={mouse:12,touch:14},M={mouse:6,touch:5},O=4,j={isDown:!1,isMouse:!1,preventClick:!1,preventScroll:!1};function _(e){var r,o=e.target,i=e.type;j.isMouse=!!i.match(/mouse/),n.down(e),c.set(u),j.preventClick=!1,j.isDown=!0,s.useSpeed(70),f.start(),r=j.isMouse?document:t,b.add(r,"touchmove",S).add(r,"touchend",P).add(r,"mousemove",S).add(r,"mouseup",P),a.dispatch("dragStart"),j.isMouse?function(e){var t=e.nodeName||"";return v.indexOf(t)>-1}(o)||e.preventDefault():(m.set(n.read(e,"x")),p.set(n.read(e,"y")))}function S(t){if(j.preventScroll||j.isMouse){var r=e.limit,o=e.loop,i=n.move(t),a=r.reachedAny(u.get()),s=!o&&a?2:1;c.addNumber(i/s),t.preventDefault()}else{var d=n.read(t,"x").get(),f=n.read(t,"y").get(),l=Math.abs(d-m.get()),v=Math.abs(f-p.get());j.preventScroll=l>v,j.preventScroll||P()}}function P(){var t=e.travel,o=function(t){var n=e.groupSizes,o=e.index,i=Math.abs(t),u=n[o.get()]/2,a=i>O,c=i0?t.concat([n]):t},[])}function p(e,t,n){return t.reduce(function(t,n){var r=t+a[n];return rf?c:s;return t.setNumber(n)},location:l,index:a}})}var b={shiftInfinite:function(t){var n=e.location;l.forEach(function(e){var r=e.findTarget,o=e.location,i=e.index,u=r(n.get());u.get()!==o.get()&&(t[i].style.left="".concat(u.get(),"%"),o.set(u))})},shiftPoints:l};return Object.freeze(b)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Limit=function(e){var t=e.min,n=e.max,r={max:t,min:n},o={min:t,max:n};function i(e){return en}function a(e){var t=i(e)&&"min",n=u(e)&&"max";return t||n||""}var c={constrain:function(e){var t=a(e);return t?o[t]:e},loop:function(e){var t=a(e);return t?r[t]:e},max:n,min:t,reachedAny:function(e){return i(e)||u(e)},reachedMax:u,reachedMin:i};return Object.freeze(c)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(2),i=n(0);t.Mover=function(e){var t=e.location,n=e.speed,u=e.mass,a=e.maxForce,c=i.Vector1D(0),s=i.Vector1D(0),d=i.Vector1D(0),f=r.Direction(0),l={speed:n};function v(e){return l.speed=e,m}var m={direction:f,location:t,seek:function(e){d.set(e).subtract(t);var n,r=d.magnitude(),i=o.map(r,0,100,0,l.speed);return f.set(d),d.normalize().multiply(i).subtract(c).limit(a),(n=d).divide(u),s.add(n),m},settle:function(e){var n=e.get()-t.get(),r=!(Math.round(100*n)/100);return r&&t.set(e),r},update:function(){return c.add(s),t.add(c),s.multiply(0),m},useDefaultSpeed:function(){return v(n),m},useSpeed:v};return Object.freeze(m)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(0);t.Pointer=function(e){var t={x:"clientX",y:"clientY"},n=o.Vector1D(0),i=o.Vector1D(0),u=o.Vector1D(0),a=o.Vector1D(0),c=r.Direction(0),s=10,d={isMouse:!1,trackPoints:[],trackTime:(new Date).getTime()};function f(e,n){var r=d.isMouse,o=t[n],i=r?e[o]:e.touches[0][o];return a.setNumber(i)}var l={direction:c,down:function(t){d.isMouse=!!t.type.match(/mouse/);var r=f(t,"x");return n.set(r),u.set(r),e.measure(n.get())},move:function(t){var n=f(t,"x"),r=(new Date).getTime();return r-d.trackTime>=s&&(d.trackPoints.push(n.get()),d.trackTime=r),i.set(n).subtract(u),c.set(i),u.set(n),e.measure(i.get())},read:f,up:function(){var t=u.get(),n=d.isMouse?5:4;return u.setNumber(d.trackPoints.slice(-n).map(function(e){return t-e}).sort(function(e,t){return Math.abs(e)t.end?n:e},0);return{distance:a,index:c}}(l),m=!r&&d(l);if(m||a){var p=s.min,g=s.max,b=f(l)?p:g;return{distance:t,index:m?b:v.index}}return{distance:l+function(t){var n=t.distance,u=t.index,a=o[e.index.max],c=r&&n