Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

embla-carousel-react

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-react - npm Package Compare versions

Comparing version 8.1.6 to 8.1.7

6

cjs/package.json
{
"name": "embla-carousel-react",
"version": "8.1.6",
"version": "8.1.7",
"author": "David Jerleke",

@@ -52,4 +52,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

"dependencies": {
"embla-carousel": "8.1.6",
"embla-carousel-reactive-utils": "8.1.6"
"embla-carousel": "8.1.7",
"embla-carousel-reactive-utils": "8.1.7"
},

@@ -56,0 +56,0 @@ "peerDependencies": {

@@ -1,1 +0,1 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselReact=t(n.React)}(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 f(n,t){return s(n-t)}function l(n){return h(n).map(Number)}function d(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 b(){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 v(n,t,e){const r=b(),o=1e3/60;let i=null,c=0,u=0;function s(n){if(!c)return;i||(i=n);const r=n-i;for(i=n,u+=r;u>=o;)e(),u-=o;c&&t.requestAnimationFrame(s)}function a(){t.cancelAnimationFrame(c),i=null,u=0,c=0}return{init:function(){r.add(n,"visibilitychange",(()=>{n.hidden&&(i=null,u=0)}))},destroy:function(){a(),r.clear()},start:function(){c||(c=t.requestAnimationFrame(s))},stop:a,update:e}}function S(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 w(n,t,e){const{constrain:r}=S(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 w(n,u(),e)}const f={get:u,set:function(n){return i=c(n),f},add:function(n){return a().set(u()+n)},clone:a};return f}function E(n,t,e,r,o,i,u,l,d,p,m,g,h,y,v,w,E,O,D){const{cross:I,direction:L}=n,A=["INPUT","SELECT","TEXTAREA"],M={passive:!1},T=b(),k=b(),F=S(50,225).constrain(y.measure(20)),P={mouse:300,touch:400},z={mouse:500,touch:600},j=v?43:25;let H=!1,R=0,V=0,C=!1,N=!1,B=!1,q=!1;function G(n){if(!x(n,r)&&n.touches.length>=2)return $(n);const t=i.readPoint(n),e=i.readPoint(n,I),c=f(t,R),u=f(e,V);if(!N&&!q){if(!n.cancelable)return $(n);if(N=c>u,!N)return $(n)}const s=i.pointerMove(n);c>w&&(B=!0),p.useFriction(.3).useDuration(.75),l.start(),o.add(L(s)),n.preventDefault()}function $(n){const t=m.byDistance(0,!1).index!==g.get(),e=i.pointerUp(n)*(v?z:P)[q?"mouse":"touch"],r=function(n,t){const e=g.add(-1*a(n)),r=m.byDistance(n,!v).distance;return v||s(n)<F?r:E&&t?.5*r:m.byIndex(e.get(),0).distance}(L(e),t),o=function(n,t){if(0===n||0===t)return 0;if(s(n)<=s(t))return 0;const e=f(s(n),s(t));return s(e/n)}(e,r),c=j-10*o,u=O+o/50;N=!1,C=!1,k.clear(),p.useDuration(c).useFriction(u),d.distance(r,!v),q=!1,h.emit("pointerUp")}function U(n){B&&(n.stopPropagation(),n.preventDefault(),B=!1)}return{init:function(n){if(!D)return;function s(s){(c(D)||D(n,s))&&function(n){const c=x(n,r);if(q=c,B=v&&c&&!n.buttons&&H,H=f(o.get(),u.get())>=2,c&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return A.includes(t)}(n.target))return;C=!0,i.pointerDown(n),p.useFriction(0).useDuration(0),o.set(u),function(){const n=q?e:t;k.add(n,"touchmove",G,M).add(n,"touchend",$).add(n,"mousemove",G,M).add(n,"mouseup",$)}(),R=i.readPoint(n),V=i.readPoint(n,I),h.emit("pointerDown")}(s)}const a=t;T.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",$).add(a,"contextmenu",$).add(a,"click",U,!0)},destroy:function(){T.clear(),k.clear()},pointerDown:function(){return C}}}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 D(n,t,e,r,o,i,u){let a,f,l=[],d=!1;function p(n){return o.measureSize(u.measure(n))}return{init:function(o){if(!i)return;f=p(n),l=r.map(p),a=new ResizeObserver((u=>{d||(c(i)||i(o,u))&&function(i){for(const c of i){const i=c.target===n,u=r.indexOf(c.target),a=i?f:l[u];if(s(p(i?n:r[u])-a)>=.5){e.requestAnimationFrame((()=>{o.reInit(),t.emit("resize")}));break}}}(u)})),[n].concat(r).forEach((n=>a.observe(n)))},destroy:function(){a&&a.disconnect(),d=!0}}}function I(n,t,e,r,o){const i=o.measure(10),c=o.measure(50),u=S(.1,.99);let a=!1;function f(){return!a&&(!!n.reachedAny(e.get())&&!!n.reachedAny(t.get()))}return{shouldConstrain:f,constrain:function(o){if(!f())return;const a=n.reachedMin(t.get())?"min":"max",l=s(n[a]-t.get()),d=e.get()-t.get(),p=u.constrain(l/c);e.subtract(d*p),!o&&s(d)<i&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function L(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=S(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 f(n){return n.concat().sort(((n,t)=>s(n)-s(t)))[0]}function l(t,r){const o=[t,t+e,t-e];if(!n)return t;if(!r)return f(o);const i=o.filter((n=>a(n)===r));return i.length?f(i):d(o)-e}return{byDistance:function(e,r){const a=o.get()+e,{index:f,distance:d}=function(e){const r=n?c(e):u(e),o=t.map(((n,t)=>({diff:l(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:f,distance:e}:{index:f,distance:e+l(t[f]-d,0)}},byIndex:function(n,e){return{index:n,distance:l(t[n]-o.get(),e)}},shortcut:l}}function M(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,f=l(o),d=l(o).reverse(),p=function(){const n=c[0];return h(g(d,n),e,!1)}().concat(function(){const n=t-c[0]-1;return h(g(f,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,f){const l=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=f?0:-e,o=f?e:0,i=f?"end":"start",c=l[t][i];return{index:t,loopPoint:c,slideLocation:M(-1),translate:T(n,s[t]),target:()=>u.get()>c?r:o}}))}return{canLoop:function(){return p.every((({index:n})=>m(f.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 F(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 P(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 z(n,t,e,r,i,c,u,a,f){const{startEdge:m,endEdge:g,direction:h}=n,y=o(e);return{groupSlides:function(n){return y?function(n,t){return l(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,e):function(n){return n.length?l(n).reduce(((e,o,l)=>{const y=d(e)||0,x=0===y,b=o===p(n),v=i[m]-c[y][m],S=i[m]-c[o][g],w=!r&&x?h(u):0,E=s(S-(!r&&b?h(a):0)-(v+w));return l&&E>t+f&&e.push(o),b&&e.push(n.length),e}),[]).map(((t,e,r)=>{const o=Math.max(r[e-1]||0);return n.slice(o,t)})):[]}(n)}}}function j(n,t,e,r,c,u,h){const{align:y,axis:x,direction:j,startIndex:H,loop:R,duration:V,dragFree:C,dragThreshold:N,inViewThreshold:B,slidesToScroll:q,skipSnaps:G,containScroll:$,watchResize:U,watchSlides:W,watchDrag:J}=u,Q={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}}},X=Q.measure(t),Y=e.map(Q.measure),K=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}}}(x,j),Z=K.measureSize(X),_=function(n){return{measure:function(t){return n*(t/100)}}}(Z),nn=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)}}}(y,Z),tn=!R&&!!$,en=R||!!$,{slideSizes:rn,slideSizesWithGaps:on,startGap:cn,endGap:un}=function(n,t,e,r,o,i){const{measureSize:c,startEdge:u,endEdge:a}=n,f=e[0]&&o,l=function(){if(!f)return 0;const n=e[0];return s(t[u]-n[u])}(),p=function(){if(!f)return 0;const n=i.getComputedStyle(d(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]+l:o?g[t]+p:e[t+1][u]-n[u]})).map(s);return{slideSizes:g,slideSizesWithGaps:h,startGap:l,endGap:p}}(K,X,Y,e,en,c),sn=z(K,Z,q,R,X,Y,cn,un,2),{snaps:an,snapsAligned:fn}=function(n,t,e,r,o){const{startEdge:i,endEdge:c}=n,{groupSlides:u}=o,a=u(r).map((n=>d(n)[c]-n[0][i])).map(s).map(t.measure),f=r.map((n=>e[i]-n[i])).map((n=>-s(n))),l=u(f).map((n=>n[0])).map(((n,t)=>n+a[t]));return{snaps:f,snapsAligned:l}}(K,nn,X,Y,sn),ln=-d(an)+d(on),{snapsContained:dn,scrollContainLimit:pn}=function(n,t,e,r,o){const i=S(-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=d(c);return S(c.lastIndexOf(n),c.indexOf(t)+1)}();function s(n,t){return f(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}}(Z,ln,fn,$,2),mn=tn?dn:fn,{limit:gn}=function(n,t,e){const r=t[0];return{limit:S(e?r-n:d(t),r)}}(ln,mn,R),hn=w(p(mn),H,R),yn=hn.clone(),xn=l(e),bn=v(r,c,(()=>(({dragHandler:n,eventHandler:t,scrollBody:e,scrollBounds:r,scrollLooper:o,slideLooper:i,translate:c,location:u,animation:s,options:{loop:a}})=>{a||r.constrain(n.pointerDown()),e.seek();const f=e.settled(),l=!r.shouldConstrain(),d=a?f:f&&l;d&&!n.pointerDown()&&(s.stop(),t.emit("settle")),d||t.emit("scroll"),a&&(o.loop(e.direction()),i.loop()),c.to(u.get())})(kn))),vn=mn[hn.get()],Sn=M(vn),wn=M(vn),En=function(n,t,e,r){let o=0,i=0,c=e,u=r,f=n.get(),l=0;function d(n){return c=n,m}function p(n){return u=n,m}const m={direction:function(){return i},duration:function(){return c},velocity:function(){return o},seek:function(){const e=t.get()-n.get();let r=0;return c?(o+=e/c,o*=u,f+=o,n.add(o),r=f-l):(o=0,n.set(t),r=e),i=a(r),l=f,m},settled:function(){return s(t.get()-n.get())<.001},useBaseFriction:function(){return p(r)},useBaseDuration:function(){return d(e)},useFriction:p,useDuration:d};return m}(Sn,wn,V,.68),On=A(R,mn,ln,gn,wn),Dn=function(n,t,e,r,o,i){function c(r){const c=r.distance,u=r.index!==t.get();o.add(c),c&&n.start(),u&&(e.set(t.get()),t.set(r.index),i.emit("select"))}return{distance:function(n,t){c(r.byDistance(n,t))},index:function(n,e){const o=t.clone().set(n);c(r.byIndex(o.get(),e))}}}(bn,hn,yn,On,wn,h),In=function(n){const{max:t,length:e}=n;return{get:function(n){return e?(n-t)/-e:0}}}(gn),Ln=b(),An=P(t,e,h,B),{slideRegistry:Mn}=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(d(e[0])+1):o?g(p(i)-d(e)[0]+1,d(e)[0]):n}))}()}}(tn,$,mn,pn,sn,xn),Tn=function(n,t,e,r,i,c,u){let s=0;function a(n){"Tab"===n.code&&(s=(new Date).getTime())}function f(a){c.add(a,"focus",(()=>{if((new Date).getTime()-s>10)return;n.scrollLeft=0;const c=t.indexOf(a),f=e.findIndex((n=>n.includes(c)));o(f)&&(i.useDuration(0),r.index(f,0),u.emit("slideFocus"))}),{passive:!0,capture:!0})}return{init:function(){c.add(document,"keydown",a,!1),t.forEach(f)}}}(n,e,Mn,Dn,En,Ln,h),kn={ownerDocument:r,ownerWindow:c,eventHandler:h,containerRect:X,slideRects:Y,animation:bn,axis:K,dragHandler:E(K,n,r,c,wn,O(K,c),Sn,bn,Dn,En,On,hn,h,_,C,N,G,.68,J),eventStore:Ln,percentOfView:_,index:hn,indexPrevious:yn,limit:gn,location:Sn,options:u,resizeHandler:D(t,h,c,e,K,U,Q),scrollBody:En,scrollBounds:I(gn,Sn,wn,En,_),scrollLooper:L(ln,gn,Sn,[Sn,wn]),scrollProgress:In,scrollSnapList:mn.map(In.get),scrollSnaps:mn,scrollTarget:On,scrollTo:Dn,slideLooper:k(K,Z,ln,rn,on,an,mn,Sn,e),slideFocus:Tn,slidesHandler:F(t,h,W),slidesInView:An,slideIndexes:xn,slideRegistry:Mn,slidesToScroll:sn,target:wn,translate:T(K,t)};return kn}const H={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};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 V(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=b(),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:f,optionsAtMedia:l,optionsMediaQueries:d}=c,{on:p,off:m,emit:g}=a,h=A;let y,x,v,S,w=!1,E=f(H,V.globalOptions),O=f(E),D=[];function I(t){const e=j(n,v,S,r,o,t,a);if(t.loop&&!e.slideLooper.canLoop()){return I(Object.assign({},t,{loop:!1}))}return e}function L(t,e){w||(E=f(E,t),O=l(E),D=e||D,function(){const{container:t,slides:e}=O,r=i(t)?n.querySelector(t):t;v=r||n.children[0];const o=i(e)?v.querySelectorAll(e):e;S=[].slice.call(o||v.children)}(),y=I(O),d([E,...D.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(),y.eventHandler.init(F),y.resizeHandler.init(F),y.slidesHandler.init(F),y.options.loop&&y.slideLooper.loop(),v.offsetParent&&S.length&&y.dragHandler.init(F),x=u.init(F,D)))}function A(n,t){const e=k();M(),L(f({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 T(n,t,e){O.active&&!w&&(y.scrollBody.useBaseFriction().useDuration(!0===t?0:O.duration),y.scrollTo.index(n,e||0))}function k(){return y.index.get()}const F={canScrollNext:function(){return y.index.add(1).get()!==k()},canScrollPrev:function(){return y.index.add(-1).get()!==k()},containerNode:function(){return v},internalEngine:function(){return y},destroy:function(){w||(w=!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){T(y.index.add(1).get(),n,-1)},scrollPrev:function(n){T(y.index.add(-1).get(),n,1)},scrollProgress:function(){return y.scrollProgress.get(y.location.get())},scrollSnapList:function(){return y.scrollSnapList},scrollTo:T,selectedScrollSnap:k,slideNodes:function(){return S},slidesInView:function(){return y.slidesInView.get()},slidesNotInView:function(){return y.slidesInView.get(!1)}};return L(t,e),setTimeout((()=>a.emit("init")),0),F}function C(t={},o=[]){const i=n.useRef(t),c=n.useRef(o),[u,s]=n.useState(),[a,f]=n.useState(),l=n.useCallback((()=>{u&&u.reInit(i.current,c.current)}),[u]);return n.useEffect((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){V.globalOptions=C.globalOptions;const n=V(a,i.current,c.current);return s(n),()=>n.destroy()}s(void 0)}),[a,s]),n.useEffect((()=>{e(i.current,t)||(i.current=t,l())}),[t,l]),n.useEffect((()=>{(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])))})(c.current,o)||(c.current=o,l())}),[o,l]),[f,u]}return V.globalOptions=void 0,C.globalOptions=void 0,C}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselReact=t(n.React)}(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 d(n,t){return s(n-t)}function f(n){return h(n).map(Number)}function l(n){return n[p(n)]}function p(n){return Math.max(0,n.length-1)}function g(n,t){return t===p(n)}function m(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 b(){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 v(n,t,e,r){const o=b(),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 d(){t.cancelAnimationFrame(s),c=null,u=0,s=0}return{init:function(){o.add(n,"visibilitychange",(()=>{n.hidden&&(c=null,u=0)}))},destroy:function(){d(),o.clear()},start:function(){s||(s=t.requestAnimationFrame(a))},stop:d,update:()=>e(i),render:r}}function S(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 w(n,t,e){const{constrain:r}=S(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 w(n,u(),e)}const d={get:u,set:function(n){return i=c(n),d},add:function(n){return a().set(u()+n)},clone:a};return d}function E(n,t,e,r,o,i,u,f,l,p,g,m,h,y,v,w,E,O,L){const{cross:D,direction:I}=n,A=["INPUT","SELECT","TEXTAREA"],M={passive:!1},T=b(),k=b(),F=S(50,225).constrain(y.measure(20)),P={mouse:300,touch:400},z={mouse:500,touch:600},H=v?43:25;let j=!1,R=0,V=0,B=!1,C=!1,N=!1,q=!1;function G(n){if(!x(n,r)&&n.touches.length>=2)return $(n);const t=i.readPoint(n),e=i.readPoint(n,D),c=d(t,R),u=d(e,V);if(!C&&!q){if(!n.cancelable)return $(n);if(C=c>u,!C)return $(n)}const s=i.pointerMove(n);c>w&&(N=!0),p.useFriction(.3).useDuration(.75),f.start(),o.add(I(s)),n.preventDefault()}function $(n){const t=g.byDistance(0,!1).index!==m.get(),e=i.pointerUp(n)*(v?z:P)[q?"mouse":"touch"],r=function(n,t){const e=m.add(-1*a(n)),r=g.byDistance(n,!v).distance;return v||s(n)<F?r:E&&t?.5*r:g.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=d(s(n),s(t));return s(e/n)}(e,r),c=H-10*o,u=O+o/50;C=!1,B=!1,k.clear(),p.useDuration(c).useFriction(u),l.distance(r,!v),q=!1,h.emit("pointerUp")}function U(n){N&&(n.stopPropagation(),n.preventDefault(),N=!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,N=v&&c&&!n.buttons&&j,j=d(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;k.add(n,"touchmove",G,M).add(n,"touchend",$).add(n,"mousemove",G,M).add(n,"mouseup",$)}(),R=i.readPoint(n),V=i.readPoint(n,D),h.emit("pointerDown")}(s)}const a=t;T.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",$).add(a,"contextmenu",$).add(a,"click",U,!0)},destroy:function(){T.clear(),k.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){let a,d,f=[],l=!1;function p(n){return o.measureSize(u.measure(n))}return{init:function(o){if(!i)return;d=p(n),f=r.map(p),a=new ResizeObserver((u=>{l||(c(i)||i(o,u))&&function(i){for(const c of i){const i=c.target===n,u=r.indexOf(c.target),a=i?d:f[u];if(s(p(i?n:r[u])-a)>=.5){e.requestAnimationFrame((()=>{o.reInit(),t.emit("resize")}));break}}}(u)})),[n].concat(r).forEach((n=>a.observe(n)))},destroy:function(){a&&a.disconnect(),l=!0}}}function D(n,t,e,r,o){const i=o.measure(10),c=o.measure(50),u=S(.1,.99);let a=!1;function d(){return!a&&(!!n.reachedAny(e.get())&&!!n.reachedAny(t.get()))}return{shouldConstrain:d,constrain:function(o){if(!d())return;const a=n.reachedMin(t.get())?"min":"max",f=s(n[a]-t.get()),l=e.get()-t.get(),p=u.constrain(f/c);e.subtract(l*p),!o&&s(l)<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}=S(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 d(n){return n.concat().sort(((n,t)=>s(n)-s(t)))[0]}function f(t,r){const o=[t,t+e,t-e];if(!n)return t;if(!r)return d(o);const i=o.filter((n=>a(n)===r));return i.length?d(i):l(o)-e}return{byDistance:function(e,r){const a=o.get()+e,{index:d,distance:l}=function(e){const r=n?c(e):u(e),o=t.map(((n,t)=>({diff:f(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:d,distance:e}:{index:d,distance:e+f(t[d]-l,0)}},byIndex:function(n,e){return{index:n,distance:f(t[n]-o.get(),e)}},shortcut:f}}function M(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,d=f(o),l=f(o).reverse(),p=function(){const n=c[0];return h(m(l,n),e,!1)}().concat(function(){const n=t-c[0]-1;return h(m(d,n),-e,!0)}());function g(n,t){return n.reduce(((n,t)=>n-o[t]),t)}function m(n,t){return n.reduce(((n,e)=>g(n,t)>0?n.concat([e]):n),[])}function h(o,c,d){const f=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=d?0:-e,o=d?e:0,i=d?"end":"start",c=f[t][i];return{index:t,loopPoint:c,slideLocation:M(-1),translate:T(n,s[t]),target:()=>u.get()>c?r:o}}))}return{canLoop:function(){return p.every((({index:n})=>g(d.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 F(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 P(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 z(n,t,e,r,i,c,u,a,d){const{startEdge:g,endEdge:m,direction:h}=n,y=o(e);return{groupSlides:function(n){return y?function(n,t){return f(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,e):function(n){return n.length?f(n).reduce(((e,o,f)=>{const y=l(e)||0,x=0===y,b=o===p(n),v=i[g]-c[y][g],S=i[g]-c[o][m],w=!r&&x?h(u):0,E=s(S-(!r&&b?h(a):0)-(v+w));return f&&E>t+d&&e.push(o),b&&e.push(n.length),e}),[]).map(((t,e,r)=>{const o=Math.max(r[e-1]||0);return n.slice(o,t)})):[]}(n)}}}function H(n,t,e,r,c,u,h){const{align:y,axis:x,direction:H,startIndex:j,loop:R,duration:V,dragFree:B,dragThreshold:C,inViewThreshold:N,slidesToScroll:q,skipSnaps:G,containScroll:$,watchResize:U,watchSlides:W,watchDrag:J}=u,Q={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}}},X=Q.measure(t),Y=e.map(Q.measure),K=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}}}(x,H),Z=K.measureSize(X),_=function(n){return{measure:function(t){return n*(t/100)}}}(Z),nn=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)}}}(y,Z),tn=!R&&!!$,en=R||!!$,{slideSizes:rn,slideSizesWithGaps:on,startGap:cn,endGap:un}=function(n,t,e,r,o,i){const{measureSize:c,startEdge:u,endEdge:a}=n,d=e[0]&&o,f=function(){if(!d)return 0;const n=e[0];return s(t[u]-n[u])}(),p=function(){if(!d)return 0;const n=i.getComputedStyle(l(r));return parseFloat(n.getPropertyValue(`margin-${a}`))}(),m=e.map(c),h=e.map(((n,t,e)=>{const r=!t,o=g(e,t);return r?m[t]+f:o?m[t]+p:e[t+1][u]-n[u]})).map(s);return{slideSizes:m,slideSizesWithGaps:h,startGap:f,endGap:p}}(K,X,Y,e,en,c),sn=z(K,Z,q,R,X,Y,cn,un,2),{snaps:an,snapsAligned:dn}=function(n,t,e,r,o){const{startEdge:i,endEdge:c}=n,{groupSlides:u}=o,a=u(r).map((n=>l(n)[c]-n[0][i])).map(s).map(t.measure),d=r.map((n=>e[i]-n[i])).map((n=>-s(n))),f=u(d).map((n=>n[0])).map(((n,t)=>n+a[t]));return{snaps:d,snapsAligned:f}}(K,nn,X,Y,sn),fn=-l(an)+l(on),{snapsContained:ln,scrollContainLimit:pn}=function(n,t,e,r,o){const i=S(-t+n,0),c=e.map(((n,t)=>{const{min:r,max:o}=i,c=i.constrain(n),u=!t,a=g(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=l(c);return S(c.lastIndexOf(n),c.indexOf(t)+1)}();function s(n,t){return d(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}}(Z,fn,dn,$,2),gn=tn?ln:dn,{limit:mn}=function(n,t,e){const r=t[0];return{limit:S(e?r-n:l(t),r)}}(fn,gn,R),hn=w(p(gn),j,R),yn=hn.clone(),xn=f(e),bn=v(r,c,(n=>(({dragHandler:n,scrollBody:t,scrollBounds:e,options:{loop:r}},o)=>{r||e.constrain(n.pointerDown()),t.seek(o)})(Pn,n)),(n=>(({scrollBody:n,translate:t,location:e,offsetLocation:r,scrollLooper:o,slideLooper:i,dragHandler:c,animation:u,eventHandler:s,scrollBounds:a,options:{loop:d}},f)=>{const l=n.settled(),p=!a.shouldConstrain(),g=d?l:l&&p;g&&!c.pointerDown()&&(u.stop(),s.emit("settle")),g||s.emit("scroll");const m=e.get()*f+wn.get()*(1-f);r.set(m),d&&(o.loop(n.direction()),i.loop()),t.to(r.get())})(Pn,n))),vn=gn[hn.get()],Sn=M(vn),wn=M(vn),En=M(vn),On=M(vn),Ln=function(n,t,e,r,o,i){let c=0,u=0,d=o,f=i,l=n.get(),p=0;function g(n){return d=n,h}function m(n){return f=n,h}const h={direction:function(){return u},duration:function(){return d},velocity:function(){return c},seek:function(t){const o=t/1e3,i=d*o,s=r.get()-n.get();let g=0;return d?(e.set(n),c+=s/i,c*=f,l+=c,n.add(c*o),g=l-p):(c=0,e.set(r),n.set(r),g=s),u=a(g),p=l,h},settled:function(){return s(r.get()-t.get())<.001},useBaseFriction:function(){return m(i)},useBaseDuration:function(){return g(o)},useFriction:m,useDuration:g};return h}(Sn,En,wn,On,V,.68),Dn=A(R,gn,fn,mn,On),In=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,hn,yn,Ln,Dn,On,h),An=function(n){const{max:t,length:e}=n;return{get:function(n){return e?(n-t)/-e:0}}}(mn),Mn=b(),Tn=P(t,e,h,N),{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=g(e,t);return r?m(l(e[0])+1):o?m(p(i)-l(e)[0]+1,l(e)[0]):n}))}()}}(tn,$,gn,pn,sn,xn),Fn=function(n,t,e,r,i,c,u){let s=0;function a(n){"Tab"===n.code&&(s=(new Date).getTime())}function d(a){c.add(a,"focus",(()=>{if((new Date).getTime()-s>10)return;n.scrollLeft=0;const c=t.indexOf(a),d=e.findIndex((n=>n.includes(c)));o(d)&&(i.useDuration(0),r.index(d,0),u.emit("slideFocus"))}),{passive:!0,capture:!0})}return{init:function(){c.add(document,"keydown",a,!1),t.forEach(d)}}}(n,e,kn,In,Ln,Mn,h),Pn={ownerDocument:r,ownerWindow:c,eventHandler:h,containerRect:X,slideRects:Y,animation:bn,axis:K,dragHandler:E(K,n,r,c,On,O(K,c),Sn,bn,In,Ln,Dn,hn,h,_,B,C,G,.68,J),eventStore:Mn,percentOfView:_,index:hn,indexPrevious:yn,limit:mn,location:Sn,offsetLocation:En,previousLocation:wn,options:u,resizeHandler:L(t,h,c,e,K,U,Q),scrollBody:Ln,scrollBounds:D(mn,En,On,Ln,_),scrollLooper:I(fn,mn,En,[Sn,En,wn,On]),scrollProgress:An,scrollSnapList:gn.map(An.get),scrollSnaps:gn,scrollTarget:Dn,scrollTo:In,slideLooper:k(K,Z,fn,rn,on,an,gn,En,e),slideFocus:Fn,slidesHandler:F(t,h,W),slidesInView:Tn,slideIndexes:xn,slideRegistry:kn,slidesToScroll:sn,target:On,translate:T(K,t)};return Pn}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};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 V(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=b(),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:d,optionsAtMedia:f,optionsMediaQueries:l}=c,{on:p,off:g,emit:m}=a,h=A;let y,x,v,S,w=!1,E=d(j,V.globalOptions),O=d(E),L=[];function D(t){const e=H(n,v,S,r,o,t,a);if(t.loop&&!e.slideLooper.canLoop()){return D(Object.assign({},t,{loop:!1}))}return e}function I(t,e){w||(E=d(E,t),O=f(E),L=e||L,function(){const{container:t,slides:e}=O,r=i(t)?n.querySelector(t):t;v=r||n.children[0];const o=i(e)?v.querySelectorAll(e):e;S=[].slice.call(o||v.children)}(),y=D(O),l([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(),y.eventHandler.init(F),y.resizeHandler.init(F),y.slidesHandler.init(F),y.options.loop&&y.slideLooper.loop(),v.offsetParent&&S.length&&y.dragHandler.init(F),x=u.init(F,L)))}function A(n,t){const e=k();M(),I(d({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 T(n,t,e){O.active&&!w&&(y.scrollBody.useBaseFriction().useDuration(!0===t?0:O.duration),y.scrollTo.index(n,e||0))}function k(){return y.index.get()}const F={canScrollNext:function(){return y.index.add(1).get()!==k()},canScrollPrev:function(){return y.index.add(-1).get()!==k()},containerNode:function(){return v},internalEngine:function(){return y},destroy:function(){w||(w=!0,s.clear(),M(),a.emit("destroy"),a.clear())},off:g,on:p,emit:m,plugins:function(){return x},previousScrollSnap:function(){return y.indexPrevious.get()},reInit:h,rootNode:function(){return n},scrollNext:function(n){T(y.index.add(1).get(),n,-1)},scrollPrev:function(n){T(y.index.add(-1).get(),n,1)},scrollProgress:function(){return y.scrollProgress.get(y.location.get())},scrollSnapList:function(){return y.scrollSnapList},scrollTo:T,selectedScrollSnap:k,slideNodes:function(){return S},slidesInView:function(){return y.slidesInView.get()},slidesNotInView:function(){return y.slidesInView.get(!1)}};return I(t,e),setTimeout((()=>a.emit("init")),0),F}function B(t={},o=[]){const i=n.useRef(t),c=n.useRef(o),[u,s]=n.useState(),[a,d]=n.useState(),f=n.useCallback((()=>{u&&u.reInit(i.current,c.current)}),[u]);return n.useEffect((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){V.globalOptions=B.globalOptions;const n=V(a,i.current,c.current);return s(n),()=>n.destroy()}s(void 0)}),[a,s]),n.useEffect((()=>{e(i.current,t)||(i.current=t,f())}),[t,f]),n.useEffect((()=>{(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])))})(c.current,o)||(c.current=o,f())}),[o,f]),[d,u]}return V.globalOptions=void 0,B.globalOptions=void 0,B}));
{
"name": "embla-carousel-react",
"version": "8.1.6",
"version": "8.1.7",
"author": "David Jerleke",

@@ -52,4 +52,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

"dependencies": {
"embla-carousel": "8.1.6",
"embla-carousel-reactive-utils": "8.1.6"
"embla-carousel": "8.1.7",
"embla-carousel-reactive-utils": "8.1.7"
},

@@ -56,0 +56,0 @@ "peerDependencies": {

{
"name": "embla-carousel-react",
"version": "8.1.6",
"version": "8.1.7",
"author": "David Jerleke",

@@ -63,4 +63,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

"dependencies": {
"embla-carousel": "8.1.6",
"embla-carousel-reactive-utils": "8.1.6"
"embla-carousel": "8.1.7",
"embla-carousel-reactive-utils": "8.1.7"
},

@@ -67,0 +67,0 @@ "peerDependencies": {

@@ -102,2 +102,4 @@ <br />

<img src="https://avatars2.githubusercontent.com/u/91487491?s=120&v=4" title="hamidrezahanafi" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/negezor">
<img src="https://avatars2.githubusercontent.com/u/9392723?s=120&v=4" title="negezor" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/th-km">

@@ -104,0 +106,0 @@ <img src="https://avatars2.githubusercontent.com/u/35410212?s=120&v=4" title="th-km" width="50" height="50" style="max-width: 100%" />

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc