var e={active:!0,breakpoints:{},delay:4e3,jump:!1,playOnInit:!0,stopOnFocusIn:!0,stopOnInteraction:!0,stopOnMouseEnter:!1,stopOnLastSnap:!1,rootNode:null};function t(e,t){let n=e.scrollSnapList();return typeof t==`number`?n.map(()=>t):t(n,e)}function n(e,t){let n=e.rootNode();return t&&t(n)||n}function r(i={}){let a,o,s,c,l=null,u=0,d=!1,f=!1,p=!1,m=!1;function h(l,u){o=l;let{mergeOptions:d,optionsAtMedia:f}=u;if(a=f(d(d(e,r.globalOptions),i)),o.scrollSnapList().length<=1)return;m=a.jump,s=!1,c=t(o,a.delay);let{eventStore:p,ownerDocument:h}=o.internalEngine(),g=!!o.internalEngine().options.watchDrag,_=n(o,a.rootNode);p.add(h,`visibilitychange`,x),g&&o.on(`pointerDown`,C),g&&!a.stopOnInteraction&&o.on(`pointerUp`,w),a.stopOnMouseEnter&&p.add(_,`mouseenter`,T),a.stopOnMouseEnter&&!a.stopOnInteraction&&p.add(_,`mouseleave`,E),a.stopOnFocusIn&&o.on(`slideFocusStart`,b),a.stopOnFocusIn&&!a.stopOnInteraction&&p.add(o.containerNode(),`focusout`,y),a.playOnInit&&y()}function g(){o.off(`pointerDown`,C).off(`pointerUp`,w).off(`slideFocusStart`,b),b(),s=!0,d=!1}function _(){let{ownerWindow:e}=o.internalEngine();e.clearTimeout(u),u=e.setTimeout(j,c[o.selectedScrollSnap()]),l=new Date().getTime(),o.emit(`autoplay:timerset`)}function v(){let{ownerWindow:e}=o.internalEngine();e.clearTimeout(u),u=0,l=null,o.emit(`autoplay:timerstopped`)}function y(){if(!s){if(S()){p=!0;return}d||o.emit(`autoplay:play`),_(),d=!0}}function b(){s||(d&&o.emit(`autoplay:stop`),v(),d=!1)}function x(){if(S())return p=d,b();p&&y()}function S(){let{ownerDocument:e}=o.internalEngine();return e.visibilityState===`hidden`}function C(){f||b()}function w(){f||y()}function T(){f=!0,b()}function E(){f=!1,y()}function D(e){e!==void 0&&(m=e),y()}function O(){d&&b()}function k(){d&&y()}function A(){return d}function j(){let{index:e}=o.internalEngine(),t=e.clone().add(1).get(),n=o.scrollSnapList().length-1,r=a.stopOnLastSnap&&t===n;if(o.canScrollNext()?o.scrollNext(m):o.scrollTo(0,m),o.emit(`autoplay:select`),r)return b();y()}function M(){return l?c[o.selectedScrollSnap()]-(new Date().getTime()-l):null}return{name:`autoplay`,options:i,init:h,destroy:g,play:D,stop:O,reset:k,isPlaying:A,timeUntilNext:M}}r.globalOptions=void 0;export{r as t};