!function(n,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselClassNames=o()}(this,(function(){"use strict";const n={active:!0,breakpoints:{},snapped:"is-snapped",inView:"is-in-view",draggable:"is-draggable",dragging:"is-dragging",loop:"is-loop"};function o(n){return(Array.isArray(n)?n:[n]).filter(Boolean)}function e(n,o){n&&o.length&&n.classList.remove(...o)}function i(n,o){n&&o.length&&n.classList.add(...o)}function a(t={}){let s,r,g,l,d=[],p=[];const c=["select"],f=["pointerDown","pointerUp"],u=["slidesInView"],b={snapped:[],inView:[],draggable:[],dragging:[],loop:[]};function h(n,o){("pointerDown"===o?i:e)(g,b.dragging)}function w(n=[],o=[],a){const t=o.map((n=>l[n])),s=n.map((n=>l[n]));return t.forEach((n=>e(n,a))),s.forEach((n=>i(n,a))),n}function E(){const{slideRegistry:n}=r.internalEngine(),o=n[r.selectedScrollSnap()];d=w(o,d,b.snapped)}function m(){const n=r.slidesInView();p=w(n,p,b.inView)}return{name:"classNames",options:t,init:function(e,d){r=e;const{mergeOptions:p,optionsAtMedia:w}=d,y=p(n,a.globalOptions),V=p(y,t);s=w(V),g=r.rootNode(),l=r.slideNodes();const{watchDrag:v,loop:N}=r.internalEngine().options,O=!!v;s.loop&&N&&(b.loop=o(s.loop),i(g,b.loop)),s.draggable&&O&&(b.draggable=o(s.draggable),i(g,b.draggable)),s.dragging&&(b.dragging=o(s.dragging),f.forEach((n=>r.on(n,h)))),s.snapped&&(b.snapped=o(s.snapped),c.forEach((n=>r.on(n,E))),E()),s.inView&&(b.inView=o(s.inView),u.forEach((n=>r.on(n,m))),m())},destroy:function(){f.forEach((n=>r.off(n,h))),c.forEach((n=>r.off(n,E))),u.forEach((n=>r.off(n,m))),e(g,b.loop),e(g,b.draggable),e(g,b.dragging),w([],d,b.snapped),w([],p,b.inView),Object.keys(b).forEach((n=>{b[n]=[]}))}}}return a.globalOptions=void 0,a}));
