12345678 |
- /*!
- * Splide.js
- * Version : 4.1.3
- * License : MIT
- * Copyright: 2022 Naotoshi Fujita
- */
- var t,n;t=this,n=function(){"use strict";const g="(prefers-reduced-motion: reduce)";const F=4,st=5;var n={CREATED:1,MOUNTED:2,IDLE:3,MOVING:F,SCROLLING:st,DRAGGING:6,DESTROYED:7};function _(t){t.length=0}function T(t,...n){return t.bind(null,...n)}const u=setTimeout,at=()=>{};function v(t){return requestAnimationFrame(t)}function e(t,n){return typeof n===t}function ft(t){return!i(t)&&e("object",t)}const o=Array.isArray,m=T(e,"function"),N=T(e,"string"),lt=(T(e,"boolean"),T(e,"undefined"));function i(t){return null===t}function y(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch(t){return!1}}function b(t){return o(t)?t:[t]}function p(t,n){b(t).forEach(n)}function w(t,n){return t.push(...b(n)),t}const r=Array.prototype;function c(t,n,e){return r.slice.call(t,n,e)}function R(t,n){return r.includes.call(t,n)}function O(n,t,e){n&&p(N(t)?t.split(" "):t,t=>{t&&n.classList.toggle(t,e)})}function C(t,n){O(t,n,!0)}function z(t,...n){t&&t.append(...n)}function A(t,...n){t&&t.before(...n)}function dt(t,n){return y(t)&&t.matches(n)}function x(t,n){const e=t?c(t.children):[];return n?e.filter(t=>dt(t,n)):e}function vt(t,n){return n?x(t,n)[0]:t.firstElementChild}const $=Object.assign,S=Object.keys;function s(n,e,t){n&&(t?S(n).reverse():S(n)).forEach(t=>{"__proto__"!==t&&e(n[t],t)})}function h(e,...t){return t.forEach(t=>{s(t,(t,n)=>{o(t)?t=t.slice():ft(t)&&(t=h({},ft(e[n])?e[n]:{},t)),e[n]=t})}),e}function k(n,t){p(t||S(n),t=>{delete n[t]})}function D(t,e){p(t,n=>{p(e,t=>{n&&n.removeAttribute(t)})})}function I(e,n,o){ft(n)?s(n,(t,n)=>{I(e,n,t)}):p(e,t=>{i(o)||""===o?D(t,n):t.setAttribute(n,String(o))})}function M(t,n,e){t=document.createElement(t);return n&&(N(n)?C:I)(t,n),e&&z(e,t),t}function j(t,n,e){if(lt(e))return getComputedStyle(t)[n];i(e)||(t.style[n]=""+e)}function ht(t,n){j(t,"display",n)}function gt(t){y(t)&&t.focus({preventScroll:!0})}function P(t,n){return t.getAttribute(n)}function pt(t,n){return!!t&&t.classList.contains(n)}function G(t){return t.getBoundingClientRect()}function X(t){p(t,t=>{t&&t.parentNode&&t.parentNode.removeChild(t)})}function L(t){return vt((new DOMParser).parseFromString(t,"text/html").body)}function W(t,n){t.preventDefault(),n&&(t.stopPropagation(),t.stopImmediatePropagation())}function E(t,n){return t&&t.querySelector(n)}function mt(t,n){return n&&t?c(t.querySelectorAll(n)):[]}function Y(t,n){O(t,n,!1)}function yt(t){return t.timeStamp}function B(t){return N(t)?t:t?t+"px":""}const{min:q,max:bt,floor:wt,ceil:xt,abs:H,sign:St}=Math;function kt(t,n,e){return H(t-n)<e}function Et(t,n,e,o){var i=q(n,e),n=bt(n,e);return o?i<t&&t<n:i<=t&&t<=n}function J(t,n,e){var o=q(n,e),n=bt(n,e);return q(bt(o,t),n)}function zt(t,...n){return n.reduce((t,n)=>t.replace("%s",""+n),t)}function At(t,n=2){return(""+t).padStart(n,"0")}const $t={};function a(t,n){p(t,t=>{N(t)&&t.split(" ").forEach(n)})}function f(n,e){const o=[];for(let t=n.length-1;0<=t;t--)e(n[t])&&o.push(...n.splice(t,1));return o}function Lt(t){const i=t||[],r=t?{}:void 0;return{bind:function(n,t,e,o){a(t,t=>{n.addEventListener(t,e,o),i.push([n.removeEventListener.bind(n,t,e,o),r])})},create:T(Lt,i),destroy:function(){r?f(i,t=>t[1]===r).forEach(t=>{t[0]()}):(i.forEach(t=>{t[0]()}),_(i))}}}function l(t){const o=t||[],i=t?{}:void 0;return{on:function(t,n){a(t,t=>{o.push([t,n,i])})},off:function(t,e){a(t,n=>{f(o,t=>t[0]===n&&(!e||t[1]===e)&&t[2]===i)})},emit:function(n,...e){o.slice().forEach(t=>{t[0]===n&&t[1](...e)})},create:T(l,o),destroy:function(){i?f(o,t=>t[2]===i):_(o)}}}function Pt(n,t,e,o){const i=Date["now"];let r,u=0,c,s=!0,a=0;function f(){if(!s){if(u=n?q((i()-r)/n,1):1,e&&e(u),1<=u&&(t(),r=i(),o&&++a>=o))return l();c=v(f)}}function l(){s=!0}function d(){c&&cancelAnimationFrame(c),u=0,c=0,s=!0}return{start:function(t){t||d(),r=i()-(t?u*n:0),s=!1,c=v(f)},rewind:function(){r=i(),u=0,e&&e(u)},pause:l,cancel:d,set:function(t){n=t},isPaused:function(){return s}}}function d(t){let n=t;return{set:function(t){n=t},is:function(t){return R(b(t),n)}}}const K="mounted",U="move",V="moved",_t="click",Ot="active",Ct="inactive",Dt="visible",It="hidden",Q="refresh",Z="updated",Mt="resize",Tt="resized",Nt="scroll",tt="scrolled",Rt="overflow",jt="navigation:mounted",Ft="autoplay:play",Gt="autoplay:pause",Xt="_sk",Wt="_sh",Yt="_ei",Bt="!overflow";const qt="ArrowLeft",Ht="ArrowRight";const Jt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:["ArrowUp",Ht],ArrowRight:["ArrowDown",qt]};const nt="role",et="tabindex";const Ut="aria-controls",Vt="aria-current",Qt="aria-selected",ot="aria-label",Zt="aria-labelledby",tn="aria-hidden",nn="aria-orientation",en="aria-roledescription",on="aria-live",rn="aria-busy",un="aria-atomic",cn=[nt,et,"disabled",Ut,Vt,ot,Zt,tn,nn,en],sn="splide",an="data-"+sn;var t=sn+"__";const fn=sn,ln=t+"track",dn=t+"list",vn=t+"slide",hn=vn+"--clone",gn=vn+"__container",pn=t+"arrows",mn=t+"arrow",yn=mn+"--prev",bn=mn+"--next",wn=t+"pagination",xn=wn+"__page",Sn=t+"progress"+"__bar",kn=t+"toggle",En=t+"spinner",zn=t+"sr",it="is-active",An="is-prev",$n="is-next",Ln="is-visible",Pn="is-loading",_n="is-focus-in",On="is-overflow",Cn=[it,Ln,An,$n,Pn,_n,On];t={slide:vn,clone:hn,arrows:pn,arrow:mn,prev:yn,next:bn,pagination:wn,page:xn,spinner:En};function Dn(t,n){if(!t)throw new Error(`[${sn}] `+(n||""))}const In="touchstart mousedown",Mn="touchmove mousemove",Tn="touchend touchcancel mouseup click";const rt="slide",ut="loop",ct="fade",Nn=(r,o,e,u)=>{const t=r.event.create(),{on:n,emit:i,bind:c}=t,{Components:s,root:a,options:f}=r,{isNavigation:l,updateOnMove:d,i18n:v,pagination:h,slideFocus:g}=f,p=s["Elements"],m=s.Direction["resolve"],y=P(u,"style"),b=P(u,ot),w=-1<e,x=vt(u,"."+gn);let S;function k(){var t=r.splides.map(t=>{t=t.splide.Components.Slides.getAt(o);return t?t.slide.id:""}).join(" ");I(u,ot,zt(v.slideX,(w?e:o)+1)),I(u,Ut,t),I(u,nt,g?"button":""),g&&D(u,en)}function E(){S||z()}function z(){var t,n,e;S||(t=r["index"],(e=A())!==pt(u,it)&&(O(u,it,e),I(u,Vt,l&&e||""),i(e?Ot:Ct,L)),e=$(),n=!e&&(!A()||w),r.state.is([F,st])||I(u,tn,n||""),I(mt(u,f.focusableNodes||""),et,n?-1:""),g&&I(u,et,n?-1:0),e!==pt(u,Ln)&&(O(u,Ln,e),i(e?Dt:It,L)),e||document.activeElement!==u||(n=s.Slides.getAt(r.index))&>(n.slide),O(u,An,o===t-1),O(u,$n,o===t+1))}function A(){var t=r["index"],{cloneStatus:n=!0}=f;return t===o||n&&t===e}function $(t){var n,e,o,i;return r.is(ct)?A():(n=G(p.track),e=G(u),o=m("left",!0),i=m("right",!0),wt(n[o])<=xt(e[t?i:o])&&wt(e[t?o:i])<=xt(n[i]))}const L={index:o,slideIndex:e,slide:u,container:x,isClone:w,mount:function(){w||(u.id=a.id+"-slide"+At(o+1),I(u,nt,h?"tabpanel":"group"),I(u,en,v.slide),I(u,ot,b||zt(v.slideLabel,o+1,r.length))),c(u,"click",T(i,_t,L)),c(u,"keydown",T(i,Xt,L)),n([V,Wt,tt],z),n(jt,k),d&&n(U,E)},destroy:function(){S=!0,t.destroy(),Y(u,Cn),D(u,cn),I(u,"style",y),I(u,ot,b||"")},update:z,style:function(t,n,e){j(e&&x||u,t,n)},isVisible:$,isWithin:function(t,n){let e=H(t-o);return(e=w||!f.rewind&&!r.is(ut)?e:q(e,r.length-e))<=n}};return L};const Rn=an+"-interval";const jn={passive:!1,capture:!0};const Fn=an+"-lazy",Gn=Fn+"-srcset",Xn=`[${Fn}], [${Gn}]`;const Wn=[" ","Enter"];const Yn={Breakpoints:(o,t,i,n)=>{const r=o["state"],u=i.breakpoints||{},c=i.reducedMotion||{},s=Lt(),a=[];function f(t){t&&s.destroy()}function l(t,n){const e=matchMedia(n);s.bind(e,"change",d),a.push([t,()=>e.matches])}function d(){var t=r.is(7),n=i.direction,e=a.reduce((t,n)=>h(t,n[1]()?n[0]:{}),{});k(i),v(e,!1,!r.is(1)),i.destroy?o.destroy("completely"===i.destroy):t?(f(!0),o.mount()):n!==i.direction&&o.refresh()}function v(t,n,e){h(i,t),n&&h(Object.getPrototypeOf(i),t),e&&o.emit(Z,i)}return{setup:function(){const e="min"===i.mediaQuery;S(u).sort((t,n)=>e?+t-+n:+n-+t).forEach(t=>{t!==Bt&&l(u[t],`(${e?"min":"max"}-width:${t}px)`)}),u[Bt]&&(a.push([u[Bt],()=>t.Layout&&!t.Layout.isOverflow()]),n.on(Rt,d)),l(c,g),d()},destroy:f,reduce:function(t){matchMedia(g).matches&&(t?h(i,c):k(i,S(c)))},set:v}},Direction:(t,n,i)=>{function e(t,n,e=i.direction){const o="rtl"!==e||n?e===Jt?0:-1:1;return Kt[t]&&Kt[t][o]||t.replace(/width|left|right/i,(t,n)=>{const e=Kt[t.toLowerCase()][o]||t;return 0<n?e.charAt(0).toUpperCase()+e.slice(1):e})}return{resolve:e,orient:function(t,n=i.direction){return t*("rtl"===n?1:-1)},left:T(e,"left"),right:T(e,"right"),width:T(e,"width")}},Elements:(t,n,e,o)=>{const{on:i,bind:r}=o,u=t["root"],c=e["i18n"],s={},a=[];let f=[],l=[],d,v,h;function g(){d=y(ln),v=vt(d,"."+dn),Dn(d&&v,"A track/list element is missing."),w(a,x(v,`.${vn}:not(.${hn})`)),$(s,{root:u,track:d,list:v,slides:a,arrows:y(pn),pagination:y(wn),prev:y(yn),next:y(bn),bar:y(Sn),toggle:y(kn)});var{role:t="region"}=e,n=u.id||function(t){return""+t+At($t[t]=($t[t]||0)+1)}(sn);u.id=n,d.id=d.id||n+"-track",v.id=v.id||n+"-list",!P(u,nt)&&"SECTION"!==u.tagName&&t&&I(u,nt,t),I(u,en,c.carousel),I(v,nt,"presentation"),m()}function p(t){var n=cn.concat("style");_(a),Y(u,f),Y(d,l),D([d,v],n),D(u,t?n:["style",en])}function m(){Y(u,f),Y(d,l),f=b(fn),l=b(ln),C(u,f),C(d,l),I(u,ot,e.label),I(u,Zt,e.labelledby)}function y(t){var n,e,t=E(u,"."+t);return t&&(n=t,e="."+fn,n.closest(e)===u)?t:void 0}function b(t){return[t+"--"+e.type,t+"--"+e.direction,e.drag&&t+"--draggable",e.isNavigation&&t+"--nav",t===fn&&it]}return $(s,{setup:g,mount:function(){i(Q,p),i(Q,g),i(Z,m),r(document,In+" keydown",t=>{h="keydown"===t.type},{capture:!0}),r(u,"focusin",()=>{O(u,_n,!!h)})},destroy:p})},Slides:(i,r,u,t)=>{const{on:n,emit:c,bind:s}=t,{slides:a,list:f}=r.Elements,l=[];function e(){a.forEach((t,n)=>{d(t,n,-1)})}function o(){h(t=>{t.destroy()}),_(l)}function d(t,n,e){const o=Nn(i,n,e,t);o.mount(),l.push(o),l.sort((t,n)=>t.index-n.index)}function v(t){return t?g(t=>!t.isClone):l}function h(t,n){v(n).forEach(t)}function g(n){return l.filter(m(n)?n:t=>N(n)?dt(t.slide,n):R(b(n),t.index))}return{mount:function(){e(),n(Q,o),n(Q,e)},destroy:o,update:function(){h(t=>{t.update()})},register:d,get:v,getIn:function(t){const n=r["Controller"],e=n.toIndex(t),o=n.hasFocus()?1:u.perPage;return g(t=>Et(t.index,e,e+o-1))},getAt:function(t){return g(t)[0]},add:function(t,n){p(t,t=>{if(y(t=N(t)?L(t):t)){var e=a[n];e?A(e,t):z(f,t),C(t,u.classes.slide);{var e=t,o=T(c,Mt);const i=mt(e,"img");let n=i["length"];n?i.forEach(t=>{s(t,"load error",()=>{--n||o()})}):o()}}}),c(Q)},remove:function(t){X(g(t).map(t=>t.slide)),c(Q)},forEach:h,filter:g,style:function(n,e,o){h(t=>{t.style(n,e,o)})},getLength:function(t){return(t?a:l).length},isEnough:function(){return l.length>u.perPage}}},Layout:(n,o,e,t)=>{const{on:i,bind:r,emit:u}=t;t=o.Slides;const{resolve:c,left:s,right:a,width:f}=o.Direction,{root:l,track:d,list:v}=o.Elements,{getAt:h,style:g}=t;let p,m,y;function b(){p=e.direction===Jt,j(l,"maxWidth",B(e.width)),j(d,c("paddingLeft"),x(!1)),j(d,c("paddingRight"),x(!0)),w(!0)}function w(t){var n=G(l);!t&&m.width===n.width&&m.height===n.height||(j(d,"height",function(){let t="";p&&(Dn(t=S(),"height or heightRatio is missing."),t=`calc(${t} - ${x(!1)} - ${x(!0)})`);return t}()),g(c("marginRight"),B(e.gap)),g("width",e.autoWidth?null:B(e.fixedWidth)||(p?"":k())),g("height",B(e.fixedHeight)||(p?e.autoHeight?null:k():S()),!0),m=n,u(Tt),y!==(y=P())&&(O(l,On,y),u(Rt,y)))}function x(t){var n=e["padding"],t=(t?a:s)();return n&&B(n[t]||(ft(n)?0:n))||"0px"}function S(){return B(e.height||G(v).width*e.heightRatio)}function k(){var t=B(e.gap);return`calc((100%${t&&" + "+t})/${e.perPage||1}${t&&" - "+t})`}function E(t){return t?v[c("scrollWidth")]:G(v)[f()]}function z(t=0,n){t=h(t);return(t?G(t.slide)[f()]:0)+(n?0:L())}function A(t,n){var e=o.Slides.get()[0],t=h(t);return e&&t?H(G(t.slide)[a()]-G(e.slide)[s()])+(n?0:L()):0}function $(t){return A(n.length-1)-A(0)+z(0,t)}function L(){var t=h(0),n=h(1);return t&&n?(t=G(t.slide),H(G(n.slide)[s()]-t[s()])-t[f()]):0}function P(){return n.is(ct)||$(!0)>E()}return{mount:function(){b(),r(window,"resize load",function(t,n){const e=Pt(n||0,t,void 0,1);return()=>{e.isPaused()&&e.start()}}(T(u,Mt))),i([Z,Q],b),i(Mt,w)},resize:w,trackSize:function(){return G(d)[f()]},listSize:E,slideSize:z,sliderSize:$,totalSize:A,getPadding:function(t){return parseFloat(j(d,c("padding"+(t?"Right":"Left"))))||0},isOverflow:P}},Clones:(c,e,s,n)=>{const t=n["on"],{Elements:a,Slides:f,Layout:{resize:o,trackSize:i}}=e,r=e.Direction["resolve"],l=[];let d;function u(){if(t(Q,v),t([Z,Mt],g),d=p()){{var i=d;const r=f.get().slice(),u=r["length"];if(u){for(;r.length<i;)w(r,r);w(r.slice(-i),r.slice(0,i)).forEach((t,n)=>{var e=n<i,o=function(t,n){const e=t.cloneNode(!0);return C(e,s.classes.clone),e.id=c.root.id+"-clone"+At(n+1),e}(t.slide,n);e?A(r[0].slide,o):z(a.list,o),w(l,o),f.register(o,n-i+(e?0:u),t.index)})}}o(!0)}}function v(){h(),u(),o(!0)}function h(){X(l),_(l),n.destroy()}function g(){var t=p();d!==t&&(d<t||!t)&&(t||c.go(0),n.emit(Q))}function p(){let t=s["clones"];var n;return c.is(ut)?lt(t)&&(n=(n=s[r("fixedWidth")]&&e.Layout.slideSize(0))&&xt(i()/n),t=n||s[r("autoWidth")]&&c.length||2*s.perPage):t=0,t}return{mount:u,destroy:h}},Move:(u,n,o,t)=>{const{on:e,emit:c}=t,s=u.state["set"],a=n["Slides"],{slideSize:i,getPadding:r,listSize:f,sliderSize:l,totalSize:d,trackSize:v}=n.Layout,{resolve:h,orient:g}=n.Direction,{list:p,track:m}=n.Elements;let y,b;function w(){n.Controller.isBusy()||(n.Scroll.cancel(),S(u.index),a.update())}function x(){u.state.is(F)&&b&&(k(A(),!0),y.cancel(),s(3),c(V,...b))}function S(t){k(z(t))}function k(t,n){u.is(ct)||(n=n?t:function(t){{var n;!u.is(ut)||(n=g(t)-g(A()))&&P(0<n,t)&&(t=E(t,0<n))}return t}(t),j(p,"transform",`translate${h("X")}(${n}px)`),t!==n&&c(Wt))}function E(t,n){var e=t-$(n),o=l();return t-=g(o*(xt(H(e)/o)||1))*(n?1:-1)}function z(t){let n=g(d(t-1)-(t=t,"center"===(e=o.focus)?(f()-i(t,!0))/2:+e*i(t)||0));var e;return n=o.trimSpace&&u.is(rt)?J(n,0,g(l(!0)-f())):n}function A(){var t=h("left");return G(p)[t]-G(m)[t]+g(r(!1))}function $(t){return z(t?n.Controller.getEnd():0)}function L(t){var n=r(!1),e=g(E(A(),t));return t?n<=e:e<=f(!0)-v()+n}function P(t,n=A()){var e=!0!==t&&g(n)<g($(!1)),t=!1!==t&&g(n)>g($(!0));return e||t}return{mount:function(){y=n.Transition,e([K,Tt,Z,Q],w)},move:function(t,n,e,o,i){x();var r=t!==n?n<t:o;(t!==n||P(o))&&L(r)&&k(E(A(),r),!0),b=[n,e,t],s(F),c(U,n,e,t),y.start(n,()=>{s(3),c(V,n,e,t),i&&i()})},jump:S,translate:k,shift:E,cancel:x,toIndex:function(n){var e=a.get();let o=0,i=1/0;for(let t=0;t<e.length;t++){var r=e[t].index,u=H(z(r)-n);if(!(u<=i))break;i=u,o=r}return o},toPosition:z,getPosition:A,getRate:function(t){var n,e,o,i=!lt(t);let r;return u.is(ct)?r=(i?t:u.index)/(u.length-1):(n=u.is(ut),i=g(i?z(t):A()),t=g($(!1)),e=g($(!0)),o=l(),r=(i-t)%o/(n?o:e-t)||0,n&&r<0&&(r+=1)),J(r,0,1)},getLimit:$,exceededLimit:P,reposition:w,canShift:L}},Scroll:(t,u,c,n)=>{const{on:e,emit:s}=n,{set:a}=t["state"],f=u["Move"],{getPosition:l,getLimit:d,exceededLimit:v,translate:h}=f,g=t.is(rt);let p,m,y=1;function b(t,n,e,o,i){S();var t=function(t,n){{var e;!n||g&&v()||(n=t%u.Layout.sliderSize(),e=f.toPosition(u.Controller.toDest(n)),t-=n-e)}return t}(t,e),e=l(),r=kt(e,t,1)||0===n;y=1,n=r?0:n||bt(H(t-e)/1.5,800),m=o,p=Pt(n,w,T(x,e,t,i),1),a(st),s(Nt),p.start()}function w(){a(3),m&&m(),s(tt)}function x(t,n,e,o){const{easingFunc:i=t=>1-Math.pow(1-t,4)}=c;var r=l(),n=(t+(n-t)*i(o)-r)*y;h(r+n),s("scrolling"),g&&!e&&v()&&(y*=.6,H(n)<10&&b(d(v(!0)),600,!1,m,!0))}function S(){p&&p.cancel()}function o(){p&&!p.isPaused()&&(S(),w())}return{mount:function(){e(U,S),e([Z,Q],o)},destroy:S,scroll:b,cancel:o}},Controller:(i,o,r,t)=>{const{on:n,emit:e}=t,{Move:c,Scroll:s}=o,{getPosition:u,getLimit:a,toPosition:f}=c,{isEnough:l,getLength:d}=o.Slides,v=r["omitEnd"],h=i.is(ut),g=i.is(rt);var t=T(A,!1),p=T(A,!0);let m=r.start||0,y,b=m,w,x,S;function k(){w=d(!0),x=r.perMove,S=r.perPage,y=P();var t=v?y:w-1,t=J(m,0,t);(b=t)!==m&&(m=t,c.reposition())}function E(){y!==P()&&e(Yt)}function z(t,n){var e,o,i,r,u;M()||([t,e]=function(t){let n=m,e=!0;if(N(t)){const[,i,r]=t.match(/([+-]|>>?|<<?)(-?\d+)?/)||[];var o=(...t)=>R(t,i);e=o("+",">",">>"),o("+","-")?n=$(m+ +(""+i+(+r||1)),m):o(">","<")?n=r?_(+r):A(!e,!0):o(">>","<<")&&(n=r?+r||0:e?y:0)}else n=h?t:J(t,0,y);return[n,e]}(t),o=L(t),r=o,u=(i=t)>b,-1<r&&(r!==m||!I())&&(i===r||c.exceededLimit(!u)||c.canShift(u))&&(s.cancel(),C(o),c.move(t,o,b,e,n)))}function A(t,n){var e=x||(D()?1:S),e=$(m+e*(t?-1:1),m,!(x||D()));return-1===e&&g&&!kt(u(),a(!t),1)?t?0:y:n?e:L(e)}function $(t,n,e){var o;return l()||D()?((o=function(t){if(g&&"move"===r.trimSpace&&t!==m)for(var n=u();n===f(t)&&Et(t,0,i.length-1,!r.rewind);)t<m?--t:++t;return t}(t))!==t&&(n=t,t=o,e=!1),t<0||t>y?t=x||!Et(0,t,n,!0)&&!Et(y,n,t,!0)?h?e?t<0?-(w%S||S):w:t:r.rewind?t<0?y:0:-1:_(O(t)):e&&t!==n&&(t=_(O(n)+(t<n?-1:1)))):t=-1,t}function L(t){return h?(t+w)%w||0:t}function P(){let t=w-(D()||h&&x?1:S);for(;v&&0<t--;)if(f(w-1)!==f(t)){t++;break}return J(t,0,w-1)}function _(t){return J(D()?t:S*t,0,y)}function O(t){return D()?q(t,y):wt((t>=y?w-1:t)/S)}function C(t){t!==m&&(b=m,m=t)}function D(){return!lt(r.focus)||r.isNavigation}function I(){return i.state.is([F,st])}function M(){return I()&&!!r.waitForTransition}return{mount:function(){k(),n([Z,Q,Yt],k),n(Tt,E)},go:z,jump:function(t){const n=o.Breakpoints["set"];var e=r["speed"];n({speed:0}),z(t),n({speed:e})},scroll:function(t,n,e,o){s.scroll(t,n,e,()=>{var t=L(c.toIndex(u()));C(v?q(t,y):t),o&&o()})},getNext:t,getPrev:p,getAdjacent:A,getEnd:P,setIndex:C,getIndex:function(t){return t?b:m},toIndex:_,toPage:O,toDest:function(t){return t=c.toIndex(t),g?J(t,0,y):t},hasFocus:D,isBusy:M}},Arrows:(i,t,n,e)=>{const{on:o,bind:r,emit:u}=e,{classes:c,i18n:s}=n,{Elements:a,Controller:f}=t,{arrows:l,track:d}=a;let v=l,h=a.prev,g=a.next,p,m;const y={};function b(){var{arrows:t=!0}=n;!t||h&&g||(v=l||M("div",c.arrows),h=k(!0),g=k(!1),p=!0,z(v,h,g),l||A(d,v)),h&&g&&($(y,{prev:h,next:g}),ht(v,t?"":"none"),C(v,m=pn+"--"+n.direction),t&&(o([K,V,Q,tt,Yt],E),r(g,"click",T(S,">")),r(h,"click",T(S,"<")),E(),I([h,g],Ut,d.id),u("arrows:mounted",h,g))),o(Z,w)}function w(){x(),b()}function x(){e.destroy(),Y(v,m),p?(X(l?[h,g]:v),h=g=null):D([h,g],cn)}function S(t){f.go(t)}function k(t){return L(`<button class="${c.arrow} ${t?c.prev:c.next}" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="${n.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z"}" />`)}function E(){var t,n,e,o;h&&g&&(o=i.index,t=f.getPrev(),n=f.getNext(),e=-1<t&&o<t?s.last:s.prev,o=-1<n&&n<o?s.first:s.next,h.disabled=t<0,g.disabled=n<0,I(h,ot,e),I(g,ot,o),u("arrows:updated",h,g,t,n))}return{arrows:y,mount:b,destroy:x,update:E}},Autoplay:(t,n,e,o)=>{const{on:i,bind:r,emit:u}=o,{interval:c=5e3,pauseOnHover:s=!0,pauseOnFocus:a=!0,resetProgress:f=!0}=e,l=Pt(c,t.go.bind(t,">"),function(t){var n=v["bar"];n&&j(n,"width",100*t+"%"),u("autoplay:playing",t)}),d=l["isPaused"],{Elements:v,Elements:{root:h,toggle:g}}=n,p=e["autoplay"];let m,y,b="pause"===p;function w(){d()&&n.Slides.isEnough()&&(l.start(!f),y=m=b=!1,k(),u(Ft))}function x(t=!0){b=!!t,k(),d()||(l.pause(),u(Gt))}function S(){b||(m||y?x(!1):w())}function k(){g&&(O(g,it,!b),I(g,ot,e.i18n[b?"play":"pause"]))}function E(t){t=n.Slides.getAt(t);l.set(t&&+P(t.slide,Rn)||e.interval)}return{mount:function(){p&&(s&&r(h,"mouseenter mouseleave",t=>{m="mouseenter"===t.type,S()}),a&&r(h,"focusin focusout",t=>{y="focusin"===t.type,S()}),g&&r(g,"click",()=>{b?w():x(!0)}),i([U,Nt,Q],l.rewind),i(U,E),g&&I(g,Ut,v.track.id),b||w(),k())},destroy:l.cancel,play:w,pause:x,isPaused:d}},Drag:(a,f,l,t)=>{const{on:n,emit:d,bind:e}=t,v=t.create(),h=a["state"],{Move:u,Scroll:g,Controller:p,Elements:{track:i},Breakpoints:{reduce:m}}=f,{resolve:o,orient:y}=f.Direction,{getPosition:b,exceededLimit:w}=u;let x,c,r,s,S,k,E=!1,z,A,$;function T(){var t=l["drag"];M(!t),S="free"===t}function N(t){var n,e,o;z=!1,A||(n=I(t),e=t.target,o=l.noDrag,dt(e,`.${xn}, .`+mn)||o&&dt(e,o)||!n&&t.button||(p.isBusy()?W(t,!0):($=n?i:window,k=h.is([F,st]),s=null,x=D(t),v.bind($,Mn,R,jn),v.bind($,Tn,L,jn),u.cancel(),g.cancel(),P(t))))}function R(t){if(h.is(6)||(h.set(6),d("drag")),function(t){if(l.releaseTouch&&a.is(rt)&&I(t)){var n=a["index"],t=_(t);if(w()||0===n&&0<t||n===a.length-1&&t<0)return 1}return}(t))return L(t);var n,e,o,i,r;t.cancelable&&(k?(u.translate(c+_(t)/(E&&a.is(rt)?5:1)),r=200<O(t),n=E!==(E=w()),(r||n)&&P(t),z=!0,d("dragging"),W(t)):(r=t,H(_(r))>H(_(r,!0))&&(k=(n=t,e=l.dragMinThreshold,o=ft(e),i=o&&e.mouse||0,o=(o?e.touch:+e)||10,H(_(n))>(I(n)?o:i)),W(t))))}function L(t){if(h.is(6)&&(h.set(3),d("dragged")),k){{var n=t;const e=p["go"],{updateOnDragged:o=!0}=l,i=function(t){if(a.is(ut)||!E){var n=O(t);if(n&&n<200)return _(t)/n}return 0}(n),r=function(t){return b()+St(t)*q(H(t)*(l.flickPower||600),S?1/0:f.Layout.listSize()*(l.flickMaxPages||1))}(i),u=0<y(D(n)-x),c=l.rewind&&l.rewindByDrag,s=(o?p:g).scroll;m(!1),S?s(r,void 0,l.snap):a.is(ct)?e(u?c?">":"+":c?"<":"-"):a.is(rt)&&E&&c?e(w(!0)?">":"<"):e((u?">>":"<<")+p.toDest(r));m(!0)}W(t)}v.destroy(),k=!1,E=!1}function j(t){!A&&z&&W(t,!0)}function P(t){s=r,r=t,c=b()}function _(t,n){return D(t,n)-D(C(t),n)}function O(t){return yt(t)-yt(C(t))}function C(t){return r===t&&s||r}function D(t,n){return(I(t)?t.changedTouches[0]:t)["page"+o(n?"Y":"X")]}function I(t){return"undefined"!=typeof TouchEvent&&t instanceof TouchEvent}function M(t){A=t}return{mount:function(){e(i,Mn,at,jn),e(i,Tn,at,jn),e(i,In,N,jn),e(i,"click",j,{capture:!0}),e(i,"dragstart",W),n([K,Z],T)},disable:M,isDragging:function(){return k}}},Keyboard:(n,t,e,o)=>{const i=o["destroy"],r=t.Direction["resolve"];function u(){var t=e["keyboard"];i(),t&&o.bind("global"===t?window:n.root,"keydown",c),o.on(Z,u)}function c(t){t.key===r(qt)?(n.go("<"),W(t,!0)):t.key===r(Ht)&&(n.go(">"),W(t,!0))}return{mount:u,destroy:i,disable:function(t){(t?i:u)()}}},LazyLoad:(e,t,i,n)=>{const{on:o,off:r,bind:u,emit:c}=n,s="sequential"===i.lazyLoad,a=[V,tt];let f=[];function l(){_(f),t.Slides.forEach(o=>{mt(o.slide,Xn).forEach(t=>{var n=P(t,Fn),e=P(t,Gn);n===t.src&&e===t.srcset||(e=vt(n=t.parentElement,"."+En)||M("span",i.classes.spinner,n),f.push([t,o,e]),t.src||ht(t,"none"))})}),(s?g:(r(a),o(a,d),d))()}function d(){(f=f.filter(t=>{var n=i.perPage*((i.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,n)||v(t)})).length||r(a)}function v(t){var[n]=t;C(t[1].slide,Pn),u(n,"load error",T(h,t)),I(n,"src",P(n,Fn)),I(n,"srcset",P(n,Gn)),D(n,[Fn,Gn])}function h(t,n){var[e,o]=t;Y(o.slide,Pn),"error"!==n.type?(X(t[2]),ht(e,""),c("lazyload:loaded",e,o),c(Mt)):c("lazyload:error",e,o),s&&g()}function g(){f.length&&v(f.shift())}return{mount:function(){i.lazyLoad&&(l(),o(Q,l))},destroy:T(_,f),check:d}},Pagination:(l,t,d,n)=>{const{on:v,emit:h,bind:g}=n,{Slides:p,Elements:m,Controller:y}=t,{hasFocus:b,getIndex:o,go:w}=y,u=t.Direction["resolve"],x=m["pagination"],S=[];let k,E;function z(){k&&(X(x?c(k.children):k),Y(k,E),_(S),k=null),n.destroy()}function A(t,n){var e=S["length"],o=n["key"],i=$();let r=-1;o===u(Ht,!1,i)?r=++t%e:o===u(qt,!1,i)?r=(--t+e)%e:"Home"===o?r=0:"End"===o&&(r=e-1);i=S[r];i&&(gt(i.button),w(">"+r),W(n,!0))}function $(){return d.paginationDirection||d.direction}function L(t){return S[y.toPage(t)]}function P(){var t,n=L(o(!0)),e=L(o());n&&(t=n["button"],Y(t,it),D(t,Qt),I(t,et,-1)),e&&(t=e["button"],C(t,it),I(t,Qt,!0),I(t,et,"")),h("pagination:updated",{list:k,items:S},n,e)}return{items:S,mount:function t(){z(),v([Z,Q,Yt],t);var{pagination:n=!0}=d;if(x&&ht(x,n?"":"none"),n){v([U,Nt,tt],P);var n=l.length,{classes:e,i18n:o,perPage:i,paginationKeyboard:r=!0}=d,u=b()?y.getEnd()+1:xt(n/i),n=$();C(k=x||M("ul",e.pagination,m.track.parentElement),E=wn+"--"+n),I(k,nt,"tablist"),I(k,ot,o.select),I(k,nn,n===Jt?"vertical":"");for(let t=0;t<u;t++){var c=M("li",null,k),s=M("button",{class:e.page,type:"button"},c);const f=p.getIn(t).map(t=>t.slide.id);var a=!b()&&1<i?o.pageX:o.slideX;g(s,"click",()=>{w(">"+t)}),r&&g(s,"keydown",T(A,t)),I(c,nt,"presentation"),I(s,nt,"tab"),I(s,Ut,f.join(" ")),I(s,ot,zt(a,t+1)),I(s,et,-1),S.push({li:c,button:s,page:t})}P(),h("pagination:mounted",{list:k,items:S},L(l.index))}},destroy:z,getAt:L,update:P}},Sync:(e,t,n,o)=>{const{isNavigation:i,slideFocus:r}=n,u=[];function c(){if(e.splides.forEach(t=>{t.isParent||(a(e,t.splide),a(t.splide,e))}),i){const t=o.create(),n=t["on"];n(_t,l),n(Xt,d),n([K,Z],f),u.push(t),t.emit(jt,e.splides)}}function s(){u.forEach(t=>{t.destroy()}),_(u)}function a(t,o){const n=t.event.create();n.on(U,(t,n,e)=>{o.go(o.is(ut)?e:t)}),u.push(n)}function f(){I(t.Elements.list,nn,n.direction===Jt?"vertical":"")}function l(t){e.go(t.index)}function d(t,n){R(Wn,n.key)&&(l(t),W(n))}return{setup:T(t.Breakpoints.set,{slideFocus:lt(r)?i:r},!0),mount:c,destroy:s,remount:function(){s(),c()}}},Wheel:(u,c,s,n)=>{let a=0;function e(t){var n,e,o,i,r;t.cancelable&&(e=(n=function(t){var{wheelAxis:n="y"}=s,{deltaX:t,deltaY:e}=t,t=R(n,"x")?c.Direction.orient(-t):0,n=R(n,"y")?e:0;return t||n}(t))<0,o=yt(t),r=s.wheelMinThreshold||0,i=s.wheelSleep||0,H(n)>r&&o-a>i&&(u.go(n<0?"<":">"),a=o),r=e,s.releaseWheel&&!u.state.is(F)&&-1===c.Controller.getAdjacent(r)||W(t))}return{mount:function t(){n.destroy(),s.wheel&&n.bind(c.Elements.track,"wheel",e,jn),n.on(Z,t)}}},Live:(t,n,e,o)=>{const i=o["on"],r=n.Elements["track"];var{live:o=!0}=e;const u=o&&!e.isNavigation,c=M("span",zn),s=Pt(90,T(a,!1));function a(t){I(r,rn,t),t?(z(r,c),s.start()):(X(c),s.cancel())}function f(t){u&&I(r,on,t?"off":"polite")}return{mount:function(){u&&(f(!n.Autoplay.isPaused()),I(r,un,!0),c.textContent="…",i(Ft,T(f,!0)),i(Gt,T(f,!1)),i([V,tt],T(a,!0)))},disable:f,destroy:function(){D(r,[on,un,rn]),X(c)}}}};const Bn={type:"slide",speed:400,perPage:1,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",classes:t,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}},qn=(t,n,e,o)=>{const i=n["Slides"];function r(){i.forEach(t=>{t.style("transform",`translateX(-${100*t.index}%)`)})}return{mount:function(){o.on([K,Q],r)},start:function(t,n){i.style("transition",`opacity ${e.speed}ms `+e.easing),u(n)},cancel:at}},Hn=(r,t,u,n)=>{const{Move:c,Controller:s,Scroll:a}=t,e=t.Elements["list"],f=T(j,e,"transition");let l;function o(){f(""),a.cancel()}return{mount:function(){n.bind(e,"transitionend",t=>{t.target===e&&l&&(o(),l())})},start:function(t,n){var e=c.toPosition(t),o=c.getPosition(),i=function(t){var n=u["rewindSpeed"];if(r.is(rt)&&n){var e=s.getIndex(!0),o=s.getEnd();if(0===e&&o<=t||o<=e&&0===t)return n}return u.speed}(t);1<=H(e-o)&&1<=i?u.useScroll?a.scroll(e,i,!1,n):(f(`transform ${i}ms `+u.easing),c.translate(e,!0),l=n):(c.jump(t),n())},cancel:o}};return class Jn{static defaults={};static STATES=n;root;event=function t(n=Lt(),e=l()){return $({},n,e,{create:function(){return t(n.create(),e.create())},destroy:function(){n.destroy(),e.destroy()}})}();Components={};state=d(1);splides=[];t={};n;e={};o;constructor(t,n={}){Dn(t=N(t)?E(document,t):t,t+" is invalid."),n=h({label:P(this.root=t,ot)||"",labelledby:P(t,Zt)||""},Bn,Jn.defaults,n);try{h(n,JSON.parse(P(t,an)))}catch(t){Dn(!1,"Invalid JSON")}this.t=Object.create(h({},n))}mount(t=this.e,n=this.o){const{state:e,Components:o}=this;return Dn(e.is([1,7]),"Already mounted!"),e.set(1),this.n=o,this.o=n||(this.is(ct)?qn:Hn),this.e=t,s($({},Yn,this.e,{Transition:this.o}),(t,n)=>{const e=t(this,o,this.t,this.event.create());(o[n]=e).setup&&e.setup()}),s(o,t=>{t.mount&&t.mount()}),this.emit(K),C(this.root,"is-initialized"),e.set(3),this.emit("ready"),this}sync(t){return this.splides.push({splide:t}),t.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this.n.Sync.remount(),t.Components.Sync.remount()),this}go(t){return this.n.Controller.go(t),this}jump(t){return this.n.Controller.jump(t),this}on(t,n){return this.event.on(t,n),this}off(t,n){return this.event.off(t,n),this}emit(t,...n){return this.event.emit(t,...n),this}add(t,n){return this.n.Slides.add(t,n),this}remove(t){return this.n.Slides.remove(t),this}is(t){return this.t.type===t}refresh(){return this.emit(Q),this}destroy(n=!0){const{event:t,state:e}=this;return e.is(1)?this.on("ready",this.destroy.bind(this,n)):(s(this.n,t=>{t.destroy&&t.destroy(n)},!0),t.emit("destroy"),t.destroy(),n&&_(this.splides),e.set(7)),this}get options(){return this.t}set options(t){this.n.Breakpoints.set(t,!0,!0)}get length(){return this.n.Slides.getLength(!0)}get index(){return this.n.Controller.getIndex()}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).Splide=n();
- //# sourceMappingURL=splide.min.js.map
|