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