embla-carousel-vue
Advanced tools
Comparing version 8.3.1 to 8.4.0
{ | ||
"name": "embla-carousel-vue", | ||
"version": "8.3.1", | ||
"version": "8.4.0", | ||
"author": "David Jerleke", | ||
@@ -52,4 +52,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision", | ||
"dependencies": { | ||
"embla-carousel": "8.3.1", | ||
"embla-carousel-reactive-utils": "8.3.1" | ||
"embla-carousel": "8.4.0", | ||
"embla-carousel-reactive-utils": "8.4.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "peerDependencies": { |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselVue=t(n.Vue)}(this,(function(n){"use strict";function t(n){return function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)||Array.isArray(n)}function e(n,r){const o=Object.keys(n),i=Object.keys(r);if(o.length!==i.length)return!1;return JSON.stringify(Object.keys(n.breakpoints||{}))===JSON.stringify(Object.keys(r.breakpoints||{}))&&o.every((o=>{const i=n[o],c=r[o];return"function"==typeof i?`${i}`==`${c}`:t(i)&&t(c)?e(i,c):i===c}))}function r(n){return n.concat().sort(((n,t)=>n.name>t.name?1:-1)).map((n=>n.options))}function o(n){return"number"==typeof n}function i(n){return"string"==typeof n}function c(n){return"boolean"==typeof n}function u(n){return"[object Object]"===Object.prototype.toString.call(n)}function s(n){return Math.abs(n)}function a(n){return Math.sign(n)}function l(n,t){return s(n-t)}function d(n){return h(n).map(Number)}function f(n){return n[p(n)]}function p(n){return Math.max(0,n.length-1)}function m(n,t){return t===p(n)}function g(n,t=0){return Array.from(Array(n),((n,e)=>t+e))}function h(n){return Object.keys(n)}function y(n,t){return[n,t].reduce(((n,t)=>(h(t).forEach((e=>{const r=n[e],o=t[e],i=u(r)&&u(o);n[e]=i?y(r,o):o})),n)),{})}function x(n,t){return void 0!==t.MouseEvent&&n instanceof t.MouseEvent}function v(){let n=[];const t={add:function(e,r,o,i={passive:!0}){let c;if("addEventListener"in e)e.addEventListener(r,o,i),c=()=>e.removeEventListener(r,o,i);else{const n=e;n.addListener(o),c=()=>n.removeListener(o)}return n.push(c),t},clear:function(){n=n.filter((n=>n()))}};return t}function b(n,t,e,r){const o=v(),i=1e3/60;let c=null,u=0,s=0;function a(n){if(!s)return;c||(c=n);const o=n-c;for(c=n,u+=o;u>=i;)e(i),u-=i;r(u/i),s&&t.requestAnimationFrame(a)}function l(){t.cancelAnimationFrame(s),c=null,u=0,s=0}return{init:function(){o.add(n,"visibilitychange",(()=>{n.hidden&&(c=null,u=0)}))},destroy:function(){l(),o.clear()},start:function(){s||(s=t.requestAnimationFrame(a))},stop:l,update:()=>e(i),render:r}}function w(n=0,t=0){const e=s(n-t);function r(t){return t<n}function o(n){return n>t}function i(n){return r(n)||o(n)}return{length:e,max:t,min:n,constrain:function(e){return i(e)?r(e)?n:t:e},reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:function(n){return e?n-e*Math.ceil((n-t)/e):n}}}function S(n,t,e){const{constrain:r}=w(0,n),o=n+1;let i=c(t);function c(n){return e?s((o+n)%o):r(n)}function u(){return i}function a(){return S(n,u(),e)}const l={get:u,set:function(n){return i=c(n),l},add:function(n){return a().set(u()+n)},clone:a};return l}function E(n,t,e,r,o,i,u,d,f,p,m,g,h,y,b,S,E,O,L){const{cross:D,direction:I}=n,A=["INPUT","SELECT","TEXTAREA"],M={passive:!1},F=v(),T=v(),k=w(50,225).constrain(y.measure(20)),P={mouse:300,touch:400},z={mouse:500,touch:600},H=b?43:25;let V=!1,j=0,R=0,B=!1,N=!1,C=!1,q=!1;function G(n){if(!x(n,r)&&n.touches.length>=2)return U(n);const t=i.readPoint(n),e=i.readPoint(n,D),c=l(t,j),u=l(e,R);if(!N&&!q){if(!n.cancelable)return U(n);if(N=c>u,!N)return U(n)}const s=i.pointerMove(n);c>S&&(C=!0),p.useFriction(.3).useDuration(.75),d.start(),o.add(I(s)),n.preventDefault()}function U(n){const t=m.byDistance(0,!1).index!==g.get(),e=i.pointerUp(n)*(b?z:P)[q?"mouse":"touch"],r=function(n,t){const e=g.add(-1*a(n)),r=m.byDistance(n,!b).distance;return b||s(n)<k?r:E&&t?.5*r:m.byIndex(e.get(),0).distance}(I(e),t),o=function(n,t){if(0===n||0===t)return 0;if(s(n)<=s(t))return 0;const e=l(s(n),s(t));return s(e/n)}(e,r),c=H-10*o,u=O+o/50;N=!1,B=!1,T.clear(),p.useDuration(c).useFriction(u),f.distance(r,!b),q=!1,h.emit("pointerUp")}function $(n){C&&(n.stopPropagation(),n.preventDefault(),C=!1)}return{init:function(n){if(!L)return;function s(s){(c(L)||L(n,s))&&function(n){const c=x(n,r);if(q=c,C=b&&c&&!n.buttons&&V,V=l(o.get(),u.get())>=2,c&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return A.includes(t)}(n.target))return;B=!0,i.pointerDown(n),p.useFriction(0).useDuration(0),o.set(u),function(){const n=q?e:t;T.add(n,"touchmove",G,M).add(n,"touchend",U).add(n,"mousemove",G,M).add(n,"mouseup",U)}(),j=i.readPoint(n),R=i.readPoint(n,D),h.emit("pointerDown")}(s)}const a=t;F.add(a,"dragstart",(n=>n.preventDefault()),M).add(a,"touchmove",(()=>{}),M).add(a,"touchend",(()=>{})).add(a,"touchstart",s).add(a,"mousedown",s).add(a,"touchcancel",U).add(a,"contextmenu",U).add(a,"click",$,!0)},destroy:function(){F.clear(),T.clear()},pointerDown:function(){return B}}}function O(n,t){let e,r;function o(n){return n.timeStamp}function i(e,r){const o="client"+("x"===(r||n.scroll)?"X":"Y");return(x(e,t)?e:e.touches[0])[o]}return{pointerDown:function(n){return e=n,r=n,i(n)},pointerMove:function(n){const t=i(n)-i(r),c=o(n)-o(e)>170;return r=n,c&&(e=n),t},pointerUp:function(n){if(!e||!r)return 0;const t=i(r)-i(e),c=o(n)-o(e),u=o(n)-o(r)>170,a=t/c;return c&&!u&&s(a)>.1?a:0},readPoint:i}}function L(n,t,e,r,o,i,u){const a=[n].concat(r);let l,d,f=[],p=!1;function m(n){return o.measureSize(u.measure(n))}return{init:function(o){i&&(d=m(n),f=r.map(m),l=new ResizeObserver((e=>{(c(i)||i(o,e))&&function(e){for(const i of e){if(p)return;const e=i.target===n,c=r.indexOf(i.target),u=e?d:f[c];if(s(m(e?n:r[c])-u)>=.5){o.reInit(),t.emit("resize");break}}}(e)})),e.requestAnimationFrame((()=>{a.forEach((n=>l.observe(n)))})))},destroy:function(){p=!0,l&&l.disconnect()}}}function D(n,t,e,r,o){const i=o.measure(10),c=o.measure(50),u=w(.1,.99);let a=!1;function l(){return!a&&(!!n.reachedAny(e.get())&&!!n.reachedAny(t.get()))}return{shouldConstrain:l,constrain:function(o){if(!l())return;const a=n.reachedMin(t.get())?"min":"max",d=s(n[a]-t.get()),f=e.get()-t.get(),p=u.constrain(d/c);e.subtract(f*p),!o&&s(f)<i&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function I(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=w(o,i);return{loop:function(t){if(!function(n){return 1===n?u(e.get()):-1===n&&c(e.get())}(t))return;const o=n*(-1*t);r.forEach((n=>n.add(o)))}}}function A(n,t,e,r,o){const{reachedAny:i,removeOffset:c,constrain:u}=r;function l(n){return n.concat().sort(((n,t)=>s(n)-s(t)))[0]}function d(t,r){const o=[t,t+e,t-e];if(!n)return t;if(!r)return l(o);const i=o.filter((n=>a(n)===r));return i.length?l(i):f(o)-e}return{byDistance:function(e,r){const a=o.get()+e,{index:l,distance:f}=function(e){const r=n?c(e):u(e),o=t.map(((n,t)=>({diff:d(n-r,0),index:t}))).sort(((n,t)=>s(n.diff)-s(t.diff))),{index:i}=o[0];return{index:i,distance:r}}(a),p=!n&&i(a);return!r||p?{index:l,distance:e}:{index:l,distance:e+d(t[l]-f,0)}},byIndex:function(n,e){return{index:n,distance:d(t[n]-o.get(),e)}},shortcut:d}}function M(n,t,e,r,i,u,s,a){const l={passive:!0,capture:!0};let d=0;function f(n){"Tab"===n.code&&(d=(new Date).getTime())}return{init:function(p){a&&(u.add(document,"keydown",f,!1),t.forEach(((t,f)=>{u.add(t,"focus",(t=>{(c(a)||a(p,t))&&function(t){if((new Date).getTime()-d>10)return;s.emit("slideFocusStart"),n.scrollLeft=0;const c=e.findIndex((n=>n.includes(t)));o(c)&&(i.useDuration(0),r.index(c,0),s.emit("slideFocus"))}(f)}),l)})))}}}function F(n){let t=n;function e(n){return o(n)?n:n.get()}return{get:function(){return t},set:function(n){t=e(n)},add:function(n){t+=e(n)},subtract:function(n){t-=e(n)}}}function T(n,t){const e="x"===n.scroll?function(n){return`translate3d(${n}px,0px,0px)`}:function(n){return`translate3d(0px,${n}px,0px)`},r=t.style;let o=!1;return{clear:function(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){o||(r.transform=e(n.direction(t)))},toggleActive:function(n){o=!n}}}function k(n,t,e,r,o,i,c,u,s){const a=.5,l=d(o),f=d(o).reverse(),p=function(){const n=c[0];return h(g(f,n),e,!1)}().concat(function(){const n=t-c[0]-1;return h(g(l,n),-e,!0)}());function m(n,t){return n.reduce(((n,t)=>n-o[t]),t)}function g(n,t){return n.reduce(((n,e)=>m(n,t)>0?n.concat([e]):n),[])}function h(o,c,l){const d=function(n){return i.map(((e,o)=>({start:e-r[o]+a+n,end:e+t-a+n})))}(c);return o.map((t=>{const r=l?0:-e,o=l?e:0,i=l?"end":"start",c=d[t][i];return{index:t,loopPoint:c,slideLocation:F(-1),translate:T(n,s[t]),target:()=>u.get()>c?r:o}}))}return{canLoop:function(){return p.every((({index:n})=>m(l.filter((t=>t!==n)),t)<=.1))},clear:function(){p.forEach((n=>n.translate.clear()))},loop:function(){p.forEach((n=>{const{target:t,translate:e,slideLocation:r}=n,o=t();o!==r.get()&&(e.to(o),r.set(o))}))},loopPoints:p}}function P(n,t,e){let r,o=!1;return{init:function(i){e&&(r=new MutationObserver((n=>{o||(c(e)||e(i,n))&&function(n){for(const e of n)if("childList"===e.type){i.reInit(),t.emit("slidesChanged");break}}(n)})),r.observe(n,{childList:!0}))},destroy:function(){r&&r.disconnect(),o=!0}}}function z(n,t,e,r){const o={};let i,c=null,u=null,s=!1;return{init:function(){i=new IntersectionObserver((n=>{s||(n.forEach((n=>{const e=t.indexOf(n.target);o[e]=n})),c=null,u=null,e.emit("slidesInView"))}),{root:n.parentElement,threshold:r}),t.forEach((n=>i.observe(n)))},destroy:function(){i&&i.disconnect(),s=!0},get:function(n=!0){if(n&&c)return c;if(!n&&u)return u;const t=function(n){return h(o).reduce(((t,e)=>{const r=parseInt(e),{isIntersecting:i}=o[r];return(n&&i||!n&&!i)&&t.push(r),t}),[])}(n);return n&&(c=t),n||(u=t),t}}}function H(n,t,e,r,i,c,u,a,l){const{startEdge:m,endEdge:g,direction:h}=n,y=o(e);return{groupSlides:function(n){return y?function(n,t){return d(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,e):function(n){return n.length?d(n).reduce(((e,o,d)=>{const y=f(e)||0,x=0===y,v=o===p(n),b=i[m]-c[y][m],w=i[m]-c[o][g],S=!r&&x?h(u):0,E=s(w-(!r&&v?h(a):0)-(b+S));return d&&E>t+l&&e.push(o),v&&e.push(n.length),e}),[]).map(((t,e,r)=>{const o=Math.max(r[e-1]||0);return n.slice(o,t)})):[]}(n)}}}function V(n,t,e,r,o,c,u){const{align:h,axis:y,direction:x,startIndex:V,loop:j,duration:R,dragFree:B,dragThreshold:N,inViewThreshold:C,slidesToScroll:q,skipSnaps:G,containScroll:U,watchResize:$,watchSlides:W,watchDrag:J,watchFocus:Q}=c,X={measure:function(n){const{offsetTop:t,offsetLeft:e,offsetWidth:r,offsetHeight:o}=n;return{top:t,right:e+r,bottom:t+o,left:e,width:r,height:o}}},Y=X.measure(t),K=e.map(X.measure),Z=function(n,t){const e="rtl"===t,r="y"===n,o=!r&&e?-1:1;return{scroll:r?"y":"x",cross:r?"x":"y",startEdge:r?"top":e?"right":"left",endEdge:r?"bottom":e?"left":"right",measureSize:function(n){const{height:t,width:e}=n;return r?t:e},direction:function(n){return n*o}}}(y,x),_=Z.measureSize(Y),nn=function(n){return{measure:function(t){return n*(t/100)}}}(_),tn=function(n,t){const e={start:function(){return 0},center:function(n){return r(n)/2},end:r};function r(n){return t-n}return{measure:function(r,o){return i(n)?e[n](r):n(t,r,o)}}}(h,_),en=!j&&!!U,rn=j||!!U,{slideSizes:on,slideSizesWithGaps:cn,startGap:un,endGap:sn}=function(n,t,e,r,o,i){const{measureSize:c,startEdge:u,endEdge:a}=n,l=e[0]&&o,d=function(){if(!l)return 0;const n=e[0];return s(t[u]-n[u])}(),p=function(){if(!l)return 0;const n=i.getComputedStyle(f(r));return parseFloat(n.getPropertyValue(`margin-${a}`))}(),g=e.map(c),h=e.map(((n,t,e)=>{const r=!t,o=m(e,t);return r?g[t]+d:o?g[t]+p:e[t+1][u]-n[u]})).map(s);return{slideSizes:g,slideSizesWithGaps:h,startGap:d,endGap:p}}(Z,Y,K,e,rn,o),an=H(Z,_,q,j,Y,K,un,sn,2),{snaps:ln,snapsAligned:dn}=function(n,t,e,r,o){const{startEdge:i,endEdge:c}=n,{groupSlides:u}=o,a=u(r).map((n=>f(n)[c]-n[0][i])).map(s).map(t.measure),l=r.map((n=>e[i]-n[i])).map((n=>-s(n))),d=u(l).map((n=>n[0])).map(((n,t)=>n+a[t]));return{snaps:l,snapsAligned:d}}(Z,tn,Y,K,an),fn=-f(ln)+f(cn),{snapsContained:pn,scrollContainLimit:mn}=function(n,t,e,r,o){const i=w(-t+n,0),c=e.map(((n,t)=>{const{min:r,max:o}=i,c=i.constrain(n),u=!t,a=m(e,t);return u?o:a||s(r,c)?r:s(o,c)?o:c})).map((n=>parseFloat(n.toFixed(3)))),u=function(){const n=c[0],t=f(c);return w(c.lastIndexOf(n),c.indexOf(t)+1)}();function s(n,t){return l(n,t)<1}return{snapsContained:function(){if(t<=n+o)return[i.max];if("keepSnaps"===r)return c;const{min:e,max:s}=u;return c.slice(e,s)}(),scrollContainLimit:u}}(_,fn,dn,U,2),gn=en?pn:dn,{limit:hn}=function(n,t,e){const r=t[0];return{limit:w(e?r-n:f(t),r)}}(fn,gn,j),yn=S(p(gn),V,j),xn=yn.clone(),vn=d(e),bn=b(r,o,(n=>(({dragHandler:n,scrollBody:t,scrollBounds:e,options:{loop:r}},o)=>{r||e.constrain(n.pointerDown()),t.seek(o)})(zn,n)),(n=>(({scrollBody:n,translate:t,location:e,offsetLocation:r,scrollLooper:o,slideLooper:i,dragHandler:c,animation:u,eventHandler:s,scrollBounds:a,options:{loop:l}},d)=>{const f=n.settled(),p=!a.shouldConstrain(),m=l?f:f&&p;m&&!c.pointerDown()&&(u.stop(),s.emit("settle")),m||s.emit("scroll");const g=e.get()*d+En.get()*(1-d);r.set(g),l&&(o.loop(n.direction()),i.loop()),t.to(r.get())})(zn,n))),wn=gn[yn.get()],Sn=F(wn),En=F(wn),On=F(wn),Ln=F(wn),Dn=function(n,t,e,r,o,i){let c=0,u=0,l=o,d=i,f=n.get(),p=0;function m(n){return l=n,h}function g(n){return d=n,h}const h={direction:function(){return u},duration:function(){return l},velocity:function(){return c},seek:function(t){const o=t/1e3,i=l*o,s=r.get()-n.get();let m=0;return l?(e.set(n),c+=s/i,c*=d,f+=c,n.add(c*o),m=f-p):(c=0,e.set(r),n.set(r),m=s),u=a(m),p=f,h},settled:function(){return s(r.get()-t.get())<.001},useBaseFriction:function(){return g(i)},useBaseDuration:function(){return m(o)},useFriction:g,useDuration:m};return h}(Sn,On,En,Ln,R,.68),In=A(j,gn,fn,hn,Ln),An=function(n,t,e,r,o,i,c){function u(o){const u=o.distance,s=o.index!==t.get();i.add(u),u&&(r.duration()?n.start():(n.update(),n.render(1),n.update())),s&&(e.set(t.get()),t.set(o.index),c.emit("select"))}return{distance:function(n,t){u(o.byDistance(n,t))},index:function(n,e){const r=t.clone().set(n);u(o.byIndex(r.get(),e))}}}(bn,yn,xn,Dn,In,Ln,u),Mn=function(n){const{max:t,length:e}=n;return{get:function(n){return e?(n-t)/-e:0}}}(hn),Fn=v(),Tn=z(t,e,u,C),{slideRegistry:kn}=function(n,t,e,r,o,i){const{groupSlides:c}=o,{min:u,max:s}=r;return{slideRegistry:function(){const r=c(i),o=!n||"keepSnaps"===t;return 1===e.length?[i]:o?r:r.slice(u,s).map(((n,t,e)=>{const r=!t,o=m(e,t);return r?g(f(e[0])+1):o?g(p(i)-f(e)[0]+1,f(e)[0]):n}))}()}}(en,U,gn,mn,an,vn),Pn=M(n,e,kn,An,Dn,Fn,u,Q),zn={ownerDocument:r,ownerWindow:o,eventHandler:u,containerRect:Y,slideRects:K,animation:bn,axis:Z,dragHandler:E(Z,n,r,o,Ln,O(Z,o),Sn,bn,An,Dn,In,yn,u,nn,B,N,G,.68,J),eventStore:Fn,percentOfView:nn,index:yn,indexPrevious:xn,limit:hn,location:Sn,offsetLocation:On,previousLocation:En,options:c,resizeHandler:L(t,u,o,e,Z,$,X),scrollBody:Dn,scrollBounds:D(hn,On,Ln,Dn,nn),scrollLooper:I(fn,hn,On,[Sn,On,En,Ln]),scrollProgress:Mn,scrollSnapList:gn.map(Mn.get),scrollSnaps:gn,scrollTarget:In,scrollTo:An,slideLooper:k(Z,_,fn,on,cn,ln,gn,On,e),slideFocus:Pn,slidesHandler:P(t,u,W),slidesInView:Tn,slideIndexes:vn,slideRegistry:kn,slidesToScroll:an,target:Ln,translate:T(Z,t)};return zn}const j={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function R(n){function t(n,t){return y(n,t||{})}const e={mergeOptions:t,optionsAtMedia:function(e){const r=e.breakpoints||{},o=h(r).filter((t=>n.matchMedia(t).matches)).map((n=>r[n])).reduce(((n,e)=>t(n,e)),{});return t(e,o)},optionsMediaQueries:function(t){return t.map((n=>h(n.breakpoints||{}))).reduce(((n,t)=>n.concat(t)),[]).map(n.matchMedia)}};return e}function B(n,t,e){const r=n.ownerDocument,o=r.defaultView,c=R(o),u=function(n){let t=[];return{init:function(e,r){return t=r.filter((({options:t})=>!1!==n.optionsAtMedia(t).active)),t.forEach((t=>t.init(e,n))),r.reduce(((n,t)=>Object.assign(n,{[t.name]:t})),{})},destroy:function(){t=t.filter((n=>n.destroy()))}}}(c),s=v(),a=function(){let n,t={};function e(n){return t[n]||[]}const r={init:function(t){n=t},emit:function(t){return e(t).forEach((e=>e(n,t))),r},off:function(n,o){return t[n]=e(n).filter((n=>n!==o)),r},on:function(n,o){return t[n]=e(n).concat([o]),r},clear:function(){t={}}};return r}(),{mergeOptions:l,optionsAtMedia:d,optionsMediaQueries:f}=c,{on:p,off:m,emit:g}=a,h=A;let y,x,b,w,S=!1,E=l(j,B.globalOptions),O=l(E),L=[];function D(t){const e=V(n,b,w,r,o,t,a);if(t.loop&&!e.slideLooper.canLoop()){return D(Object.assign({},t,{loop:!1}))}return e}function I(t,e){S||(E=l(E,t),O=d(E),L=e||L,function(){const{container:t,slides:e}=O,r=i(t)?n.querySelector(t):t;b=r||n.children[0];const o=i(e)?b.querySelectorAll(e):e;w=[].slice.call(o||b.children)}(),y=D(O),f([E,...L.map((({options:n})=>n))]).forEach((n=>s.add(n,"change",A))),O.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(k),y.eventHandler.init(k),y.resizeHandler.init(k),y.slidesHandler.init(k),y.options.loop&&y.slideLooper.loop(),b.offsetParent&&w.length&&y.dragHandler.init(k),x=u.init(k,L)))}function A(n,t){const e=T();M(),I(l({startIndex:e},n),t),a.emit("reInit")}function M(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),u.destroy(),s.clear()}function F(n,t,e){O.active&&!S&&(y.scrollBody.useBaseFriction().useDuration(!0===t?0:O.duration),y.scrollTo.index(n,e||0))}function T(){return y.index.get()}const k={canScrollNext:function(){return y.index.add(1).get()!==T()},canScrollPrev:function(){return y.index.add(-1).get()!==T()},containerNode:function(){return b},internalEngine:function(){return y},destroy:function(){S||(S=!0,s.clear(),M(),a.emit("destroy"),a.clear())},off:m,on:p,emit:g,plugins:function(){return x},previousScrollSnap:function(){return y.indexPrevious.get()},reInit:h,rootNode:function(){return n},scrollNext:function(n){F(y.index.add(1).get(),n,-1)},scrollPrev:function(n){F(y.index.add(-1).get(),n,1)},scrollProgress:function(){return y.scrollProgress.get(y.location.get())},scrollSnapList:function(){return y.scrollSnapList},scrollTo:F,selectedScrollSnap:T,slideNodes:function(){return w},slidesInView:function(){return y.slidesInView.get()},slidesNotInView:function(){return y.slidesInView.get(!1)}};return I(t,e),setTimeout((()=>a.emit("init")),0),k}function N(t={},o=[]){const i=n.isRef(t),c=n.isRef(o);let u=i?t.value:t,s=c?o.value:o;const a=n.shallowRef(),l=n.shallowRef();function d(){l.value&&l.value.reInit(u,s)}return n.onMounted((()=>{"undefined"!=typeof window&&window.document&&window.document.createElement&&a.value&&(B.globalOptions=N.globalOptions,l.value=B(a.value,u,s))})),n.onBeforeUnmount((()=>{l.value&&l.value.destroy()})),i&&n.watch(t,(n=>{e(u,n)||(u=n,d())})),c&&n.watch(o,(n=>{(function(n,t){if(n.length!==t.length)return!1;const o=r(n),i=r(t);return o.every(((n,t)=>e(n,i[t])))})(s,n)||(s=n,d())})),[a,l]}return B.globalOptions=void 0,N.globalOptions=void 0,N})); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselVue=t(n.Vue)}(this,(function(n){"use strict";function t(n){return function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)||Array.isArray(n)}function e(n,r){const o=Object.keys(n),i=Object.keys(r);if(o.length!==i.length)return!1;return JSON.stringify(Object.keys(n.breakpoints||{}))===JSON.stringify(Object.keys(r.breakpoints||{}))&&o.every((o=>{const i=n[o],c=r[o];return"function"==typeof i?`${i}`==`${c}`:t(i)&&t(c)?e(i,c):i===c}))}function r(n){return n.concat().sort(((n,t)=>n.name>t.name?1:-1)).map((n=>n.options))}function o(n){return"number"==typeof n}function i(n){return"string"==typeof n}function c(n){return"boolean"==typeof n}function u(n){return"[object Object]"===Object.prototype.toString.call(n)}function s(n){return Math.abs(n)}function a(n){return Math.sign(n)}function l(n,t){return s(n-t)}function d(n){return h(n).map(Number)}function f(n){return n[p(n)]}function p(n){return Math.max(0,n.length-1)}function m(n,t){return t===p(n)}function g(n,t=0){return Array.from(Array(n),((n,e)=>t+e))}function h(n){return Object.keys(n)}function y(n,t){return[n,t].reduce(((n,t)=>(h(t).forEach((e=>{const r=n[e],o=t[e],i=u(r)&&u(o);n[e]=i?y(r,o):o})),n)),{})}function x(n,t){return void 0!==t.MouseEvent&&n instanceof t.MouseEvent}function v(){let n=[];const t={add:function(e,r,o,i={passive:!0}){let c;if("addEventListener"in e)e.addEventListener(r,o,i),c=()=>e.removeEventListener(r,o,i);else{const n=e;n.addListener(o),c=()=>n.removeListener(o)}return n.push(c),t},clear:function(){n=n.filter((n=>n()))}};return t}function b(n,t,e,r){const o=v(),i=1e3/60;let c=null,u=0,s=0;function a(){return u>=i}function l(){e(),u-=i,a()&&l()}function d(){r(u/i)}function f(n){if(!s)return;c||(c=n,e(),d());const r=n-c;c=n,u+=r,a()&&l(),d(),s&&(s=t.requestAnimationFrame(f))}function p(){t.cancelAnimationFrame(s),c=null,u=0,s=0}return{init:function(){o.add(n,"visibilitychange",(()=>{n.hidden&&(c=null,u=0)}))},destroy:function(){p(),o.clear()},start:function(){s||(s=t.requestAnimationFrame(f))},stop:p,update:e,render:r}}function w(n=0,t=0){const e=s(n-t);function r(t){return t<n}function o(n){return n>t}function i(n){return r(n)||o(n)}return{length:e,max:t,min:n,constrain:function(e){return i(e)?r(e)?n:t:e},reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:function(n){return e?n-e*Math.ceil((n-t)/e):n}}}function S(n,t,e){const{constrain:r}=w(0,n),o=n+1;let i=c(t);function c(n){return e?s((o+n)%o):r(n)}function u(){return i}function a(){return S(n,u(),e)}const l={get:u,set:function(n){return i=c(n),l},add:function(n){return a().set(u()+n)},clone:a};return l}function E(n,t,e,r,o,i,u,d,f,p,m,g,h,y,b,S,E,L,O){const{cross:D,direction:I}=n,A=["INPUT","SELECT","TEXTAREA"],M={passive:!1},F=v(),T=v(),k=w(50,225).constrain(y.measure(20)),P={mouse:300,touch:400},z={mouse:500,touch:600},H=b?43:25;let V=!1,j=0,R=0,B=!1,N=!1,C=!1,q=!1;function G(n){if(!x(n,r)&&n.touches.length>=2)return U(n);const t=i.readPoint(n),e=i.readPoint(n,D),c=l(t,j),u=l(e,R);if(!N&&!q){if(!n.cancelable)return U(n);if(N=c>u,!N)return U(n)}const s=i.pointerMove(n);c>S&&(C=!0),p.useFriction(.3).useDuration(.75),d.start(),o.add(I(s)),n.preventDefault()}function U(n){const t=m.byDistance(0,!1).index!==g.get(),e=i.pointerUp(n)*(b?z:P)[q?"mouse":"touch"],r=function(n,t){const e=g.add(-1*a(n)),r=m.byDistance(n,!b).distance;return b||s(n)<k?r:E&&t?.5*r:m.byIndex(e.get(),0).distance}(I(e),t),o=function(n,t){if(0===n||0===t)return 0;if(s(n)<=s(t))return 0;const e=l(s(n),s(t));return s(e/n)}(e,r),c=H-10*o,u=L+o/50;N=!1,B=!1,T.clear(),p.useDuration(c).useFriction(u),f.distance(r,!b),q=!1,h.emit("pointerUp")}function $(n){C&&(n.stopPropagation(),n.preventDefault(),C=!1)}return{init:function(n){if(!O)return;function s(s){(c(O)||O(n,s))&&function(n){const c=x(n,r);if(q=c,C=b&&c&&!n.buttons&&V,V=l(o.get(),u.get())>=2,c&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return A.includes(t)}(n.target))return;B=!0,i.pointerDown(n),p.useFriction(0).useDuration(0),o.set(u),function(){const n=q?e:t;T.add(n,"touchmove",G,M).add(n,"touchend",U).add(n,"mousemove",G,M).add(n,"mouseup",U)}(),j=i.readPoint(n),R=i.readPoint(n,D),h.emit("pointerDown")}(s)}const a=t;F.add(a,"dragstart",(n=>n.preventDefault()),M).add(a,"touchmove",(()=>{}),M).add(a,"touchend",(()=>{})).add(a,"touchstart",s).add(a,"mousedown",s).add(a,"touchcancel",U).add(a,"contextmenu",U).add(a,"click",$,!0)},destroy:function(){F.clear(),T.clear()},pointerDown:function(){return B}}}function L(n,t){let e,r;function o(n){return n.timeStamp}function i(e,r){const o="client"+("x"===(r||n.scroll)?"X":"Y");return(x(e,t)?e:e.touches[0])[o]}return{pointerDown:function(n){return e=n,r=n,i(n)},pointerMove:function(n){const t=i(n)-i(r),c=o(n)-o(e)>170;return r=n,c&&(e=n),t},pointerUp:function(n){if(!e||!r)return 0;const t=i(r)-i(e),c=o(n)-o(e),u=o(n)-o(r)>170,a=t/c;return c&&!u&&s(a)>.1?a:0},readPoint:i}}function O(n,t,e,r,o,i,u){const a=[n].concat(r);let l,d,f=[],p=!1;function m(n){return o.measureSize(u.measure(n))}return{init:function(o){i&&(d=m(n),f=r.map(m),l=new ResizeObserver((e=>{(c(i)||i(o,e))&&function(e){for(const i of e){if(p)return;const e=i.target===n,c=r.indexOf(i.target),u=e?d:f[c];if(s(m(e?n:r[c])-u)>=.5){o.reInit(),t.emit("resize");break}}}(e)})),e.requestAnimationFrame((()=>{a.forEach((n=>l.observe(n)))})))},destroy:function(){p=!0,l&&l.disconnect()}}}function D(n,t,e,r,o){const i=o.measure(10),c=o.measure(50),u=w(.1,.99);let a=!1;function l(){return!a&&(!!n.reachedAny(e.get())&&!!n.reachedAny(t.get()))}return{shouldConstrain:l,constrain:function(o){if(!l())return;const a=n.reachedMin(t.get())?"min":"max",d=s(n[a]-t.get()),f=e.get()-t.get(),p=u.constrain(d/c);e.subtract(f*p),!o&&s(f)<i&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function I(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=w(o,i);return{loop:function(t){if(!function(n){return 1===n?u(e.get()):-1===n&&c(e.get())}(t))return;const o=n*(-1*t);r.forEach((n=>n.add(o)))}}}function A(n,t,e,r,o){const{reachedAny:i,removeOffset:c,constrain:u}=r;function l(n){return n.concat().sort(((n,t)=>s(n)-s(t)))[0]}function d(t,r){const o=[t,t+e,t-e];if(!n)return t;if(!r)return l(o);const i=o.filter((n=>a(n)===r));return i.length?l(i):f(o)-e}return{byDistance:function(e,r){const a=o.get()+e,{index:l,distance:f}=function(e){const r=n?c(e):u(e),o=t.map(((n,t)=>({diff:d(n-r,0),index:t}))).sort(((n,t)=>s(n.diff)-s(t.diff))),{index:i}=o[0];return{index:i,distance:r}}(a),p=!n&&i(a);return!r||p?{index:l,distance:e}:{index:l,distance:e+d(t[l]-f,0)}},byIndex:function(n,e){return{index:n,distance:d(t[n]-o.get(),e)}},shortcut:d}}function M(n,t,e,r,i,u,s,a){const l={passive:!0,capture:!0};let d=0;function f(n){"Tab"===n.code&&(d=(new Date).getTime())}return{init:function(p){a&&(u.add(document,"keydown",f,!1),t.forEach(((t,f)=>{u.add(t,"focus",(t=>{(c(a)||a(p,t))&&function(t){if((new Date).getTime()-d>10)return;s.emit("slideFocusStart"),n.scrollLeft=0;const c=e.findIndex((n=>n.includes(t)));o(c)&&(i.useDuration(0),r.index(c,0),s.emit("slideFocus"))}(f)}),l)})))}}}function F(n){let t=n;function e(n){return o(n)?n:n.get()}return{get:function(){return t},set:function(n){t=e(n)},add:function(n){t+=e(n)},subtract:function(n){t-=e(n)}}}function T(n,t){const e="x"===n.scroll?function(n){return`translate3d(${n}px,0px,0px)`}:function(n){return`translate3d(0px,${n}px,0px)`},r=t.style;let o=null,i=!1;return{clear:function(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(i)return;const c=(u=n.direction(t),Math.round(100*u)/100);var u;c!==o&&(r.transform=e(c),o=c)},toggleActive:function(n){i=!n}}}function k(n,t,e,r,o,i,c,u,s){const a=.5,l=d(o),f=d(o).reverse(),p=function(){const n=c[0];return h(g(f,n),e,!1)}().concat(function(){const n=t-c[0]-1;return h(g(l,n),-e,!0)}());function m(n,t){return n.reduce(((n,t)=>n-o[t]),t)}function g(n,t){return n.reduce(((n,e)=>m(n,t)>0?n.concat([e]):n),[])}function h(o,c,l){const d=function(n){return i.map(((e,o)=>({start:e-r[o]+a+n,end:e+t-a+n})))}(c);return o.map((t=>{const r=l?0:-e,o=l?e:0,i=l?"end":"start",c=d[t][i];return{index:t,loopPoint:c,slideLocation:F(-1),translate:T(n,s[t]),target:()=>u.get()>c?r:o}}))}return{canLoop:function(){return p.every((({index:n})=>m(l.filter((t=>t!==n)),t)<=.1))},clear:function(){p.forEach((n=>n.translate.clear()))},loop:function(){p.forEach((n=>{const{target:t,translate:e,slideLocation:r}=n,o=t();o!==r.get()&&(e.to(o),r.set(o))}))},loopPoints:p}}function P(n,t,e){let r,o=!1;return{init:function(i){e&&(r=new MutationObserver((n=>{o||(c(e)||e(i,n))&&function(n){for(const e of n)if("childList"===e.type){i.reInit(),t.emit("slidesChanged");break}}(n)})),r.observe(n,{childList:!0}))},destroy:function(){r&&r.disconnect(),o=!0}}}function z(n,t,e,r){const o={};let i,c=null,u=null,s=!1;return{init:function(){i=new IntersectionObserver((n=>{s||(n.forEach((n=>{const e=t.indexOf(n.target);o[e]=n})),c=null,u=null,e.emit("slidesInView"))}),{root:n.parentElement,threshold:r}),t.forEach((n=>i.observe(n)))},destroy:function(){i&&i.disconnect(),s=!0},get:function(n=!0){if(n&&c)return c;if(!n&&u)return u;const t=function(n){return h(o).reduce(((t,e)=>{const r=parseInt(e),{isIntersecting:i}=o[r];return(n&&i||!n&&!i)&&t.push(r),t}),[])}(n);return n&&(c=t),n||(u=t),t}}}function H(n,t,e,r,i,c,u,a,l){const{startEdge:m,endEdge:g,direction:h}=n,y=o(e);return{groupSlides:function(n){return y?function(n,t){return d(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,e):function(n){return n.length?d(n).reduce(((e,o,d)=>{const y=f(e)||0,x=0===y,v=o===p(n),b=i[m]-c[y][m],w=i[m]-c[o][g],S=!r&&x?h(u):0,E=s(w-(!r&&v?h(a):0)-(b+S));return d&&E>t+l&&e.push(o),v&&e.push(n.length),e}),[]).map(((t,e,r)=>{const o=Math.max(r[e-1]||0);return n.slice(o,t)})):[]}(n)}}}function V(n,t,e,r,o,c,u){const{align:h,axis:y,direction:x,startIndex:V,loop:j,duration:R,dragFree:B,dragThreshold:N,inViewThreshold:C,slidesToScroll:q,skipSnaps:G,containScroll:U,watchResize:$,watchSlides:W,watchDrag:J,watchFocus:Q}=c,X={measure:function(n){const{offsetTop:t,offsetLeft:e,offsetWidth:r,offsetHeight:o}=n;return{top:t,right:e+r,bottom:t+o,left:e,width:r,height:o}}},Y=X.measure(t),K=e.map(X.measure),Z=function(n,t){const e="rtl"===t,r="y"===n,o=!r&&e?-1:1;return{scroll:r?"y":"x",cross:r?"x":"y",startEdge:r?"top":e?"right":"left",endEdge:r?"bottom":e?"left":"right",measureSize:function(n){const{height:t,width:e}=n;return r?t:e},direction:function(n){return n*o}}}(y,x),_=Z.measureSize(Y),nn=function(n){return{measure:function(t){return n*(t/100)}}}(_),tn=function(n,t){const e={start:function(){return 0},center:function(n){return r(n)/2},end:r};function r(n){return t-n}return{measure:function(r,o){return i(n)?e[n](r):n(t,r,o)}}}(h,_),en=!j&&!!U,rn=j||!!U,{slideSizes:on,slideSizesWithGaps:cn,startGap:un,endGap:sn}=function(n,t,e,r,o,i){const{measureSize:c,startEdge:u,endEdge:a}=n,l=e[0]&&o,d=function(){if(!l)return 0;const n=e[0];return s(t[u]-n[u])}(),p=function(){if(!l)return 0;const n=i.getComputedStyle(f(r));return parseFloat(n.getPropertyValue(`margin-${a}`))}(),g=e.map(c),h=e.map(((n,t,e)=>{const r=!t,o=m(e,t);return r?g[t]+d:o?g[t]+p:e[t+1][u]-n[u]})).map(s);return{slideSizes:g,slideSizesWithGaps:h,startGap:d,endGap:p}}(Z,Y,K,e,rn,o),an=H(Z,_,q,j,Y,K,un,sn,2),{snaps:ln,snapsAligned:dn}=function(n,t,e,r,o){const{startEdge:i,endEdge:c}=n,{groupSlides:u}=o,a=u(r).map((n=>f(n)[c]-n[0][i])).map(s).map(t.measure),l=r.map((n=>e[i]-n[i])).map((n=>-s(n))),d=u(l).map((n=>n[0])).map(((n,t)=>n+a[t]));return{snaps:l,snapsAligned:d}}(Z,tn,Y,K,an),fn=-f(ln)+f(cn),{snapsContained:pn,scrollContainLimit:mn}=function(n,t,e,r,o){const i=w(-t+n,0),c=e.map(((n,t)=>{const{min:r,max:o}=i,c=i.constrain(n),u=!t,a=m(e,t);return u?o:a||s(r,c)?r:s(o,c)?o:c})).map((n=>parseFloat(n.toFixed(3)))),u=function(){const n=c[0],t=f(c);return w(c.lastIndexOf(n),c.indexOf(t)+1)}();function s(n,t){return l(n,t)<1}return{snapsContained:function(){if(t<=n+o)return[i.max];if("keepSnaps"===r)return c;const{min:e,max:s}=u;return c.slice(e,s)}(),scrollContainLimit:u}}(_,fn,dn,U,2),gn=en?pn:dn,{limit:hn}=function(n,t,e){const r=t[0];return{limit:w(e?r-n:f(t),r)}}(fn,gn,j),yn=S(p(gn),V,j),xn=yn.clone(),vn=d(e),bn=b(r,o,(()=>(({dragHandler:n,scrollBody:t,scrollBounds:e,options:{loop:r}})=>{r||e.constrain(n.pointerDown()),t.seek()})(zn)),(n=>(({scrollBody:n,translate:t,location:e,offsetLocation:r,previousLocation:o,scrollLooper:i,slideLooper:c,dragHandler:u,animation:s,eventHandler:a,scrollBounds:l,options:{loop:d}},f)=>{const p=n.settled(),m=!l.shouldConstrain(),g=d?p:p&&m;g&&!u.pointerDown()&&(s.stop(),a.emit("settle")),g||a.emit("scroll");const h=e.get()*f+o.get()*(1-f);r.set(h),d&&(i.loop(n.direction()),c.loop()),t.to(r.get())})(zn,n))),wn=gn[yn.get()],Sn=F(wn),En=F(wn),Ln=F(wn),On=F(wn),Dn=function(n,t,e,r,o,i){let c=0,u=0,l=o,d=i,f=n.get(),p=0;function m(n){return l=n,h}function g(n){return d=n,h}const h={direction:function(){return u},duration:function(){return l},velocity:function(){return c},seek:function(){const t=r.get()-n.get();let o=0;return l?(e.set(n),c+=t/l,c*=d,f+=c,n.add(c),o=f-p):(c=0,e.set(r),n.set(r),o=t),u=a(o),p=f,h},settled:function(){return s(r.get()-t.get())<.001},useBaseFriction:function(){return g(i)},useBaseDuration:function(){return m(o)},useFriction:g,useDuration:m};return h}(Sn,Ln,En,On,R,.68),In=A(j,gn,fn,hn,On),An=function(n,t,e,r,o,i,c){function u(o){const u=o.distance,s=o.index!==t.get();i.add(u),u&&(r.duration()?n.start():(n.update(),n.render(1),n.update())),s&&(e.set(t.get()),t.set(o.index),c.emit("select"))}return{distance:function(n,t){u(o.byDistance(n,t))},index:function(n,e){const r=t.clone().set(n);u(o.byIndex(r.get(),e))}}}(bn,yn,xn,Dn,In,On,u),Mn=function(n){const{max:t,length:e}=n;return{get:function(n){return e?(n-t)/-e:0}}}(hn),Fn=v(),Tn=z(t,e,u,C),{slideRegistry:kn}=function(n,t,e,r,o,i){const{groupSlides:c}=o,{min:u,max:s}=r;return{slideRegistry:function(){const r=c(i),o=!n||"keepSnaps"===t;return 1===e.length?[i]:o?r:r.slice(u,s).map(((n,t,e)=>{const r=!t,o=m(e,t);return r?g(f(e[0])+1):o?g(p(i)-f(e)[0]+1,f(e)[0]):n}))}()}}(en,U,gn,mn,an,vn),Pn=M(n,e,kn,An,Dn,Fn,u,Q),zn={ownerDocument:r,ownerWindow:o,eventHandler:u,containerRect:Y,slideRects:K,animation:bn,axis:Z,dragHandler:E(Z,n,r,o,On,L(Z,o),Sn,bn,An,Dn,In,yn,u,nn,B,N,G,.68,J),eventStore:Fn,percentOfView:nn,index:yn,indexPrevious:xn,limit:hn,location:Sn,offsetLocation:Ln,previousLocation:En,options:c,resizeHandler:O(t,u,o,e,Z,$,X),scrollBody:Dn,scrollBounds:D(hn,Ln,On,Dn,nn),scrollLooper:I(fn,hn,Ln,[Sn,Ln,En,On]),scrollProgress:Mn,scrollSnapList:gn.map(Mn.get),scrollSnaps:gn,scrollTarget:In,scrollTo:An,slideLooper:k(Z,_,fn,on,cn,ln,gn,Ln,e),slideFocus:Pn,slidesHandler:P(t,u,W),slidesInView:Tn,slideIndexes:vn,slideRegistry:kn,slidesToScroll:an,target:On,translate:T(Z,t)};return zn}const j={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function R(n){function t(n,t){return y(n,t||{})}const e={mergeOptions:t,optionsAtMedia:function(e){const r=e.breakpoints||{},o=h(r).filter((t=>n.matchMedia(t).matches)).map((n=>r[n])).reduce(((n,e)=>t(n,e)),{});return t(e,o)},optionsMediaQueries:function(t){return t.map((n=>h(n.breakpoints||{}))).reduce(((n,t)=>n.concat(t)),[]).map(n.matchMedia)}};return e}function B(n,t,e){const r=n.ownerDocument,o=r.defaultView,c=R(o),u=function(n){let t=[];return{init:function(e,r){return t=r.filter((({options:t})=>!1!==n.optionsAtMedia(t).active)),t.forEach((t=>t.init(e,n))),r.reduce(((n,t)=>Object.assign(n,{[t.name]:t})),{})},destroy:function(){t=t.filter((n=>n.destroy()))}}}(c),s=v(),a=function(){let n,t={};function e(n){return t[n]||[]}const r={init:function(t){n=t},emit:function(t){return e(t).forEach((e=>e(n,t))),r},off:function(n,o){return t[n]=e(n).filter((n=>n!==o)),r},on:function(n,o){return t[n]=e(n).concat([o]),r},clear:function(){t={}}};return r}(),{mergeOptions:l,optionsAtMedia:d,optionsMediaQueries:f}=c,{on:p,off:m,emit:g}=a,h=A;let y,x,b,w,S=!1,E=l(j,B.globalOptions),L=l(E),O=[];function D(t){const e=V(n,b,w,r,o,t,a);if(t.loop&&!e.slideLooper.canLoop()){return D(Object.assign({},t,{loop:!1}))}return e}function I(t,e){S||(E=l(E,t),L=d(E),O=e||O,function(){const{container:t,slides:e}=L,r=i(t)?n.querySelector(t):t;b=r||n.children[0];const o=i(e)?b.querySelectorAll(e):e;w=[].slice.call(o||b.children)}(),y=D(L),f([E,...O.map((({options:n})=>n))]).forEach((n=>s.add(n,"change",A))),L.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(k),y.eventHandler.init(k),y.resizeHandler.init(k),y.slidesHandler.init(k),y.options.loop&&y.slideLooper.loop(),b.offsetParent&&w.length&&y.dragHandler.init(k),x=u.init(k,O)))}function A(n,t){const e=T();M(),I(l({startIndex:e},n),t),a.emit("reInit")}function M(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),u.destroy(),s.clear()}function F(n,t,e){L.active&&!S&&(y.scrollBody.useBaseFriction().useDuration(!0===t?0:L.duration),y.scrollTo.index(n,e||0))}function T(){return y.index.get()}const k={canScrollNext:function(){return y.index.add(1).get()!==T()},canScrollPrev:function(){return y.index.add(-1).get()!==T()},containerNode:function(){return b},internalEngine:function(){return y},destroy:function(){S||(S=!0,s.clear(),M(),a.emit("destroy"),a.clear())},off:m,on:p,emit:g,plugins:function(){return x},previousScrollSnap:function(){return y.indexPrevious.get()},reInit:h,rootNode:function(){return n},scrollNext:function(n){F(y.index.add(1).get(),n,-1)},scrollPrev:function(n){F(y.index.add(-1).get(),n,1)},scrollProgress:function(){return y.scrollProgress.get(y.location.get())},scrollSnapList:function(){return y.scrollSnapList},scrollTo:F,selectedScrollSnap:T,slideNodes:function(){return w},slidesInView:function(){return y.slidesInView.get()},slidesNotInView:function(){return y.slidesInView.get(!1)}};return I(t,e),setTimeout((()=>a.emit("init")),0),k}function N(t={},o=[]){const i=n.isRef(t),c=n.isRef(o);let u=i?t.value:t,s=c?o.value:o;const a=n.shallowRef(),l=n.shallowRef();function d(){l.value&&l.value.reInit(u,s)}return n.onMounted((()=>{"undefined"!=typeof window&&window.document&&window.document.createElement&&a.value&&(B.globalOptions=N.globalOptions,l.value=B(a.value,u,s))})),n.onBeforeUnmount((()=>{l.value&&l.value.destroy()})),i&&n.watch(t,(n=>{e(u,n)||(u=n,d())})),c&&n.watch(o,(n=>{(function(n,t){if(n.length!==t.length)return!1;const o=r(n),i=r(t);return o.every(((n,t)=>e(n,i[t])))})(s,n)||(s=n,d())})),[a,l]}return B.globalOptions=void 0,N.globalOptions=void 0,N})); |
{ | ||
"name": "embla-carousel-vue", | ||
"version": "8.3.1", | ||
"version": "8.4.0", | ||
"author": "David Jerleke", | ||
@@ -52,4 +52,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision", | ||
"dependencies": { | ||
"embla-carousel": "8.3.1", | ||
"embla-carousel-reactive-utils": "8.3.1" | ||
"embla-carousel": "8.4.0", | ||
"embla-carousel-reactive-utils": "8.4.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "peerDependencies": { |
{ | ||
"name": "embla-carousel-vue", | ||
"version": "8.3.1", | ||
"version": "8.4.0", | ||
"author": "David Jerleke", | ||
@@ -63,4 +63,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision", | ||
"dependencies": { | ||
"embla-carousel": "8.3.1", | ||
"embla-carousel-reactive-utils": "8.3.1" | ||
"embla-carousel": "8.4.0", | ||
"embla-carousel-reactive-utils": "8.4.0" | ||
}, | ||
@@ -67,0 +67,0 @@ "peerDependencies": { |
@@ -112,2 +112,4 @@ <br /> | ||
<img src="https://avatars2.githubusercontent.com/u/3440094?s=120&v=4" title="wopian" width="50" height="50" style="max-width: 100%" /> | ||
</a><a href="https://github.com/nikrowell"> | ||
<img src="https://avatars2.githubusercontent.com/u/260039?s=120&v=4" title="nikrowell" width="50" height="50" style="max-width: 100%" /> | ||
</a><a href="https://github.com/horseeyephil"> | ||
@@ -141,6 +143,6 @@ <img src="https://avatars2.githubusercontent.com/u/32337092?s=120&v=4" title="horseeyephil" width="50" height="50" style="max-width: 100%" /> | ||
<img src="https://avatars2.githubusercontent.com/u/9334305?s=120&v=4" title="silllli" width="50" height="50" style="max-width: 100%" /> | ||
</a><a href="https://github.com/nikrowell"> | ||
<img src="https://avatars2.githubusercontent.com/u/260039?s=120&v=4" title="nikrowell" width="50" height="50" style="max-width: 100%" /> | ||
</a><a href="https://github.com/mujahidfa"> | ||
<img src="https://avatars2.githubusercontent.com/u/17759705?s=120&v=4" title="mujahidfa" width="50" height="50" style="max-width: 100%" /> | ||
</a><a href="https://github.com/Mitch-At-Work"> | ||
<img src="https://avatars2.githubusercontent.com/u/99835933?s=120&v=4" title="Mitch-At-Work" width="50" height="50" style="max-width: 100%" /> | ||
</a><a href="https://github.com/romellem"> | ||
@@ -147,0 +149,0 @@ <img src="https://avatars2.githubusercontent.com/u/8504000?s=120&v=4" title="romellem" width="50" height="50" style="max-width: 100%" /> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49993
196
230
+ Addedembla-carousel@8.4.0(transitive)
+ Addedembla-carousel-reactive-utils@8.4.0(transitive)
- Removedembla-carousel@8.3.1(transitive)
- Removedembla-carousel-reactive-utils@8.3.1(transitive)
Updatedembla-carousel@8.4.0