12 |
- function _defineProperties(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function _createClass(n,t,e){return t&&_defineProperties(n.prototype,t),e&&_defineProperties(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).Splide=t()}(this,function(){"use strict";var F="mounted",r="ready",C="move",L="moved",D="shifted",z="click",M="active",T="inactive",N="visible",I="hidden",R="slide:keydown",O="refresh",j="updated",E="resize",P="resized",W="repositioned",b="scroll",B="scrolled",o="destroy",X="navigation:mounted",w="autoplay:play",_="autoplay:pause",g="lazyload:loaded",n={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,DRAGGING:5,DESTROYED:6};function x(n){n.length=0}function f(n,t,e){return Array.prototype.slice.call(n,t,e)}function G(n){return n.bind.apply(n,[null].concat(f(arguments,1)))}function H(){}var Y=setTimeout;function p(n){return requestAnimationFrame(n)}function t(n,t){return typeof t===n}function q(n){return!s(n)&&t("object",n)}var u=Array.isArray,m=G(t,"function"),U=G(t,"string"),J=G(t,"undefined");function s(n){return null===n}function y(n){return n instanceof HTMLElement}function S(n){return u(n)?n:[n]}function k(n,t){S(n).forEach(t)}function A(n,t){return-1<n.indexOf(t)}function K(n,t){return n.push.apply(n,S(t)),n}function Q(t,n,e){t&&k(n,function(n){n&&t.classList[e?"add":"remove"](n)})}function V(n,t){Q(n,U(t)?t.split(" "):t,!0)}function Z(n,t){k(t,n.appendChild.bind(n))}function $(n,e){k(n,function(n){var t=e.parentNode;t&&t.insertBefore(n,e)})}function nn(n,t){return y(n)&&(n.msMatchesSelector||n.matches).call(n,t)}function tn(n,t){return n?f(n.children).filter(function(n){return nn(n,t)}):[]}function en(n,t){return t?tn(n,t)[0]:n.firstElementChild}function a(n,t,e){if(n)for(var i=Object.keys(n),i=e?i.reverse():i,o=0;o<i.length;o++){var r=i[o];if("__proto__"!==r&&!1===t(n[r],r))break}return n}function on(i){return f(arguments,1).forEach(function(e){a(e,function(n,t){i[t]=e[t]})}),i}function l(e){return f(arguments).forEach(function(n){a(n,function(n,t){u(n)?e[t]=n.slice():q(n)?e[t]=l(q(e[t])?e[t]:{},n):e[t]=n})}),e}function rn(n,e){k(n,function(t){k(e,function(n){t&&t.removeAttribute(n)})})}function un(e,t,i){q(t)?a(t,function(n,t){un(e,t,n)}):k(e,function(n){s(i)||""===i?rn(n,t):n.setAttribute(t,String(i))})}function sn(n,t,e){n=document.createElement(n);return t&&(U(t)?V:un)(n,t),e&&Z(e,n),n}function an(n,t,e){if(J(e))return getComputedStyle(n)[t];s(e)||(n=n.style)[t]!==(e=""+e)&&(n[t]=e)}function cn(n,t){an(n,"display",t)}function fn(n){n.setActive&&n.setActive()||n.focus({preventScroll:!0})}function ln(n,t){return n.getAttribute(t)}function dn(n,t){return n&&n.classList.contains(t)}function pn(n){return n.getBoundingClientRect()}function vn(n){k(n,function(n){n&&n.parentNode&&n.parentNode.removeChild(n)})}function hn(n){return en((new DOMParser).parseFromString(n,"text/html").body)}function gn(n,t){n.preventDefault(),t&&(n.stopPropagation(),n.stopImmediatePropagation())}function mn(n,t){return n&&n.querySelector(t)}function yn(n,t){return t?f(n.querySelectorAll(t)):[]}function bn(n,t){Q(n,t,!1)}function wn(n){return n.timeStamp}function _n(n){return U(n)?n:n?n+"px":""}var En="splide",i="data-"+En;function xn(n,t){if(!n)throw new Error("["+En+"] "+(t||""))}var Sn=Math.min,Pn=Math.max,kn=Math.floor,An=Math.ceil,Cn=Math.abs;function Ln(n,t,e,i){var o=Sn(t,e),e=Pn(t,e);return i?o<n&&n<e:o<=n&&n<=e}function Dn(n,t,e){var i=Sn(t,e),e=Pn(t,e);return Sn(Pn(i,n),e)}function zn(n){return(0<n)-(n<0)}function Mn(t,n){return k(n,function(n){t=t.replace("%s",""+n)}),t}function Tn(n){return n<10?"0"+n:""+n}var Nn={};function d(){var s=[];function e(n,e,i){k(n,function(t){t&&k(e,function(n){n.split(" ").forEach(function(n){n=n.split(".");i(t,n[0],n[1])})})})}return{bind:function(n,t,r,u){e(n,t,function(n,t,e){var i="addEventListener"in n,o=i?n.removeEventListener.bind(n,t,r,u):n.removeListener.bind(n,r);i?n.addEventListener(t,r,u):n.addListener(r),s.push([n,t,e,r,o])})},unbind:function(n,t,o){e(n,t,function(t,e,i){s=s.filter(function(n){return!!(n[0]!==t||n[1]!==e||n[2]!==i||o&&n[3]!==o)||(n[4](),!1)})})},dispatch:function(n,t,e){var i;return"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:!0,detail:e}):(i=document.createEvent("CustomEvent")).initEvent(t,!0,!1),n.dispatchEvent(i),i},destroy:function(){s.forEach(function(n){n[4]()}),x(s)}}}function In(n){var e=n?n.event.bus:document.createDocumentFragment(),i=d();return n&&n.event.on(o,i.destroy),on(i,{bus:e,on:function(n,t){i.bind(e,S(n).join(" "),function(n){t.apply(t,u(n.detail)?n.detail:[])})},off:G(i.unbind,e),emit:function(n){i.dispatch(e,n,f(arguments,1))}})}function Rn(t,e,i,o){var r,n,u=Date.now,s=0,a=!0,c=0;function f(){if(!a){var n=u()-r;if(t<=n?(s=1,r=u()):s=n/t,i&&i(s),1===s&&(e(),o&&++c>=o))return l();p(f)}}function l(){a=!0}function d(){cancelAnimationFrame(n),a=!(n=s=0)}return{start:function(n){n||d(),r=u()-(n?s*t:0),a=!1,p(f)},rewind:function(){r=u(),s=0,i&&i(s)},pause:l,cancel:d,set:function(n){t=n},isPaused:function(){return a}}}function c(n){var t=n;return{set:function(n){t=n},is:function(n){return A(S(n),t)}}}function On(e,i){var o;return function(){var n,t=this;o||(n=f(arguments),(o=Rn(i||0,function(){e.apply(t,n),o=null},null,1)).start())}}var v={marginRight:["marginBottom","marginLeft"],autoWidth:["autoHeight"],fixedWidth:["fixedHeight"],paddingLeft:["paddingTop","paddingRight"],paddingRight:["paddingBottom","paddingLeft"],width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:["ArrowUp","ArrowRight"],ArrowRight:["ArrowDown","ArrowLeft"]};var Fn="role",jn="tabindex",e="aria-",Wn=e+"controls",Bn=e+"current",Xn=e+"selected",Gn=e+"label",Hn=e+"hidden",h=e+"orientation",Yn=e+"roledescription",qn=e+"atomic",Un=e+"live",Jn=[Fn,jn,"disabled",Wn,Bn,Gn,Hn,h,Yn,qn,Un],Kn=En,Qn=En+"__slider",Vn=En+"__track",Zn=En+"__list",$n=En+"__slide",nt=$n+"--clone",tt=$n+"__container",et=En+"__arrows",it=En+"__arrow",ot=it+"--prev",rt=it+"--next",e=En+"__pagination",ut=En+"__progress",st=ut+"__bar",at=En+"__autoplay",ct=En+"__play",ft=En+"__pause",lt="is-active",dt="is-prev",pt="is-next",vt="is-visible",ht="is-loading",gt=[lt,vt,dt,pt,ht];var mt="slide",yt="loop",bt="fade";function wt(o,e,t,r){var i,n=In(o),u=n.on,s=n.emit,a=n.bind,c=n.destroy,f=o.Components,l=o.root,d=o.options,p=d.isNavigation,v=d.updateOnMove,h=d.i18n,g=f.Direction.resolve,m=ln(r,"style"),y=-1<t,b=en(r,"."+tt),w=yn(r,d.focusableNodes||"");function _(){var n=o.splides.map(function(n){n=n.splide.Components.Slides.getAt(e);return n?n.slide.id:""}).join(" ");un(r,Gn,Mn(h.slideX,(y?t:e)+1)),un(r,Wn,n),S(k())}function E(){i||x()}function x(){var n;i||(n=o.index,S(k()),function(n){var t=!n&&(!k()||y);document.activeElement===r&&t&&Y(P);un(r,Hn,t||""),un(r,jn,!t&&d.slideFocus?0:""),un(w||[],jn,t?-1:""),n!==dn(r,vt)&&(Q(r,vt,n),s(n?N:I,A))}(function(){if(o.is(bt))return k();var n=pn(f.Elements.track),t=pn(r),e=g("left"),i=g("right");return kn(n[e])<=An(t[e])&&kn(t[i])<=An(n[i])}()),Q(r,dt,e===n-1),Q(r,pt,e===n+1))}function S(n){n!==dn(r,lt)&&(Q(r,lt,n),un(r,Bn,p&&n||""),s(n?M:T,A))}function P(){var n=f.Slides.getAt(o.index);n&&fn(n.slide)}function k(){var n=o.index;return n===e||d.cloneStatus&&n===t}var A={index:e,slideIndex:t,slide:r,container:b,isClone:y,mount:function(){y||(r.id=l.id+"-slide"+Tn(e+1),un(r,Fn,d.pagination?"tabpanel":"group"),un(r,Yn,h.slide),un(r,Gn,Mn(h.slideLabel,[e+1,o.length]))),a(r,"click keydown",function(n){s("click"===n.type?z:R,A,n)}),u([O,W,D,L,B],x),u(X,_),v&&u(C,E)},destroy:function(){i=!0,c(),bn(r,gt),rn(r,Jn),un(r,"style",m)},update:x,style:function(n,t,e){an(e&&b||r,n,t)},isWithin:function(n,t){return n=Cn(n-e),(n=!y&&(d.rewind||o.is(yt))?Sn(n,o.length-n):n)<=t}};return A}var _t=i+"-interval";var Et={passive:!1,capture:!0},xt="touchmove mousemove",St="touchend touchcancel mouseup";var Pt={spacebar:" ",Right:"ArrowRight",Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown"};function kt(n){return n=U(n)?n:n.key,Pt[n]||n}var At="keydown";var Ct=i+"-lazy",Lt=Ct+"-srcset",Dt="["+Ct+"], ["+Lt+"]";var zt=[" ","Enter"];var Mt=Object.freeze({__proto__:null,Media:function(i,n,t){var e=d(),o=t.breakpoints||{},r=l({},t),u=[];function s(n){n&&e.destroy()}function a(n){u.push(n.map(function(n){var t=matchMedia(n[1]);return e.bind(t,"change",c),[n[0],t]}))}function c(){var n=u.reduce(function(n,t){var e=(e=function(n){return n[1].matches},f(t).filter(e)[0]||[]);return e[1]&&i.emit("media",e[1]),l(n,e[0]||{})},l({},r)),t=n.destroy;t?(i.options=r,i.destroy("completely"===t)):i.state.is(6)?(s(!0),i.mount()):i.options=n}return{setup:function(){var e="min"===t.mediaQuery;a(Object.keys(o).sort(function(n,t){return e?+t-+n:+n-+t}).map(function(n){return[o[n],"("+(e?"min":"max")+"-width:"+n+"px)"]})),a([[{speed:0,autoplay:"pause"},"(prefers-reduced-motion: reduce)"]]),c()},mount:H,destroy:s}},Direction:function(n,t,i){return{resolve:function(n,t){var e=i.direction;return v[n]["rtl"!==e||t?"ttb"===e?0:-1:1]||n},orient:function(n){return n*("rtl"===i.direction?1:-1)}}},Elements:function(n,t,e){var i,o,r,u,s=In(n),a=s.on,c=(s.bind,n.root),f=e.i18n,l={},d=[];function p(){var n;!function(){o=en(c,"."+Qn),r=mn(c,"."+Vn),u=en(r,"."+Zn),xn(r&&u,"A track/list element is missing."),K(d,tn(u,"."+$n+":not(."+nt+")"));var n=g("."+at),t=g("."+et);on(l,{root:c,slider:o,track:r,list:u,slides:d,arrows:t,autoplay:n,prev:mn(t,"."+ot),next:mn(t,"."+rt),bar:mn(g("."+ut),"."+st),play:mn(n,"."+ct),pause:mn(n,"."+ft)})}(),n=c.id||function(n){return""+n+Tn(Nn[n]=(Nn[n]||0)+1)}(En),c.id=n,r.id=r.id||n+"-track",u.id=u.id||n+"-list",un(c,Yn,f.carousel),un(c,Fn,"SECTION"!==c.tagName&&e.role||""),un(u,Fn,"none"),V(c,i=m())}function v(){x(d),bn(c,i),rn([c,r,u],Jn.concat("style"))}function h(){bn(c,i),V(c,i=m())}function g(n){return en(c,n)||en(o,n)}function m(){return[Kn+"--"+e.type,Kn+"--"+e.direction,e.drag&&Kn+"--draggable",e.isNavigation&&Kn+"--nav",lt]}return on(l,{setup:p,mount:function(){a(O,v),a(O,p),a(j,h)},destroy:v})},Slides:function(i,o,r){var n=In(i),t=n.on,u=n.emit,s=n.bind,a=(n=o.Elements).slides,c=n.list,f=[];function e(){a.forEach(function(n,t){d(n,t,-1)})}function l(){v(function(n){n.destroy()}),x(f)}function d(n,t,e){n=wt(i,t,e,n);n.mount(),f.push(n)}function p(n){return n?h(function(n){return!n.isClone}):f}function v(n,t){p(t).forEach(n)}function h(t){return f.filter(m(t)?t:function(n){return U(t)?nn(n.slide,t):A(S(t),n.index)})}return{mount:function(){e(),t(O,l),t(O,e),t([F,O],function(){f.sort(function(n,t){return n.index-t.index})})},destroy:l,update:function(){v(function(n){n.update()})},register:d,get:p,getIn:function(n){var t=o.Controller,e=t.toIndex(n),i=t.hasFocus()?1:r.perPage;return h(function(n){return Ln(n.index,e,e+i-1)})},getAt:function(n){return h(n)[0]},add:function(n,o){k(n,function(n){var t,e,i;y(n=U(n)?hn(n):n)&&((t=a[o])?$(n,t):Z(c,n),V(n,r.classes.slide),n=n,e=G(u,E),n=yn(n,"img"),(i=n.length)?n.forEach(function(n){s(n,"load error",function(){--i||e()})}):e())}),u(O)},remove:function(n){vn(h(n).map(function(n){return n.slide})),u(O)},forEach:v,filter:h,style:function(t,e,i){v(function(n){n.style(t,e,i)})},getLength:function(n){return(n?a:f).length},isEnough:function(){return f.length>r.perPage}}},Layout:function(n,t,e){var i,o,r=(a=In(n)).on,u=a.bind,s=a.emit,a=t.Slides,c=t.Direction.resolve,f=(t=t.Elements).root,l=t.track,d=t.list,p=a.getAt,v=a.style;function h(){o=null,i="ttb"===e.direction,an(f,"maxWidth",_n(e.width)),an(l,c("paddingLeft"),m(!1)),an(l,c("paddingRight"),m(!0)),g()}function g(){var n=pn(f);o&&o.width===n.width&&o.height===n.height||(an(l,"height",function(){var n="";i&&(xn(n=y(),"height or heightRatio is missing."),n="calc("+n+" - "+m(!1)+" - "+m(!0)+")");return n}()),v(c("marginRight"),_n(e.gap)),v("width",(e.autoWidth?"":_n(e.fixedWidth)||(i?"":b()))||null),v("height",_n(e.fixedHeight)||(i?e.autoHeight?"":b():y())||null,!0),o=n,s(P))}function m(n){var t=e.padding,n=c(n?"right":"left");return t&&_n(t[n]||(q(t)?0:t))||"0px"}function y(){return _n(e.height||pn(d).width*e.heightRatio)}function b(){var n=_n(e.gap);return"calc((100%"+(n&&" + "+n)+")/"+(e.perPage||1)+(n&&" - "+n)+")"}function w(n,t){var e=p(n);if(e){n=pn(e.slide)[c("right")],e=pn(d)[c("left")];return Cn(n-e)+(t?0:_())}return 0}function _(){var n=p(0);return n&&parseFloat(an(n.slide,c("marginRight")))||0}return{mount:function(){h(),u(window,"resize load",On(G(s,E))),r([j,O],h),r(E,g)},listSize:function(){return pn(d)[c("width")]},slideSize:function(n,t){return(n=p(n||0))?pn(n.slide)[c("width")]+(t?0:_()):0},sliderSize:function(){return w(n.length-1,!0)-w(-1,!0)},totalSize:w,getPadding:function(n){return parseFloat(an(l,c("padding"+(n?"Right":"Left"))))||0}}},Clones:function(s,e,a){var n,t=In(s),i=t.on,o=t.emit,c=e.Elements,f=e.Slides,r=e.Direction.resolve,l=[];function u(){(n=v())&&(function(o){var r=f.get().slice(),u=r.length;if(u){for(;r.length<o;)K(r,r);K(r.slice(-o),r.slice(0,o)).forEach(function(n,t){var e=t<o,i=function(n,t){n=n.cloneNode(!0);return V(n,a.classes.clone),n.id=s.root.id+"-clone"+Tn(t+1),n}(n.slide,t);e?$(i,r[0].slide):Z(c.list,i),K(l,i),f.register(i,t-o+(e?0:u),n.index)})}}(n),o(E))}function d(){vn(l),x(l)}function p(){n<v()&&o(O)}function v(){var n,t=a.clones;return s.is(yt)?t||(t=(n=a[r("fixedWidth")]&&e.Layout.slideSize(0))&&An(pn(c.track)[r("width")]/n)||a[r("autoWidth")]&&s.length||a.perPage):t=0,t}return{mount:function(){u(),i(O,d),i(O,u),i([j,E],p)},destroy:d}},Move:function(u,s,a){var c,n=In(u),t=n.on,f=n.emit,i=(n=s.Layout).slideSize,e=n.getPadding,o=n.totalSize,r=n.listSize,l=n.sliderSize,d=(n=s.Direction).resolve,p=n.orient,v=(n=s.Elements).list,h=n.track;function g(){x()||(s.Scroll.cancel(),m(u.index),f(W))}function m(n){y(w(n,!0))}function y(n,t){u.is(bt)||(t=t?n:function(n){{var t,e;u.is(yt)&&(e=p(n-_()),t=S(!1,n)&&e<0,e=S(!0,n)&&0<e,(t||e)&&(n=b(n,e)))}return n}(n),v.style.transform="translate"+d("X")+"("+t+"px)",n!==t&&f(D))}function b(n,t){var e=n-E(t),i=l();return n-=p(i*(An(Cn(e)/i)||1))*(t?1:-1)}function w(n,t){var e=p(o(n-1)-(e=n,"center"===(n=a.focus)?(r()-i(e,!0))/2:+n*i(e)||0));return t?function(n){a.trimSpace&&u.is(mt)&&(n=Dn(n,0,p(l()-r())));return n}(e):e}function _(){var n=d("left");return pn(v)[n]-pn(h)[n]+p(e(!1))}function E(n){return w(n?s.Controller.getEnd():0,!!a.trimSpace)}function x(){return u.state.is(4)&&a.waitForTransition}function S(n,t){t=J(t)?_():t;var e=!0!==n&&p(t)<p(E(!1)),t=!1!==n&&p(t)>p(E(!0));return e||t}return{mount:function(){c=s.Transition,t([F,P,j,O],g)},move:function(n,t,e,i){var o,r;x()||(o=u.state.set,r=_(),n!==t&&(c.cancel(),y(b(r,t<n),!0)),o(4),f(C,t,e,n),c.start(t,function(){o(3),f(L,t,e,n),"move"===a.trimSpace&&n!==e&&r===_()?s.Controller.go(e<n?">":"<",!1,i):i&&i()}))},jump:m,translate:y,shift:b,cancel:function(){y(_()),c.cancel()},toIndex:function(n){for(var t=s.Slides.get(),e=0,i=1/0,o=0;o<t.length;o++){var r=t[o].index,u=Cn(w(r,!0)-n);if(!(u<=i))break;i=u,e=r}return e},toPosition:w,getPosition:_,getLimit:E,isBusy:x,exceededLimit:S,reposition:g}},Controller:function(n,u,o){var r,s,a,t=In(n).on,c=u.Move,f=c.getPosition,l=c.getLimit,e=u.Slides,d=e.isEnough,i=e.getLength,p=n.is(yt),v=n.is(mt),h=G(_,!1),g=G(_,!0),m=o.start||0,y=m;function b(){r=i(!0),s=o.perMove,a=o.perPage;var n=Dn(m,0,r-1);n!==m&&(m=n,c.reposition())}function w(n,t,e,i,o){var r=t?n:A(n);u.Scroll.scroll(t||e?c.toPosition(r,!0):n,i,function(){C(c.toIndex(c.getPosition())),o&&o()})}function _(n,t){var e,i,o=s||(L()?1:a),r=E(m+o*(n?-1:1),m);return-1!==r||!v||(e=f(),i=l(!n),o=1,Cn(e-i)<o)?t?r:S(r):n?0:x()}function E(n,t,e){var i;return d()?(i=x(),n<0||i<n?n=Ln(0,n,t,!0)||Ln(i,t,n,!0)?P(k(n)):p?s||L()?n:n<0?-(r%a||a):r:o.rewind?n<0?i:0:-1:e||n===t||(n=s?n:P(k(t)+(n<t?-1:1)))):n=-1,n}function x(){var n=r-a;return(L()||p&&s)&&(n=r-1),Pn(n,0)}function S(n){return p?d()?n%r+(n<0?r:0):-1:n}function P(n){return Dn(L()?n:a*n,0,x())}function k(n){return L()||(n=Ln(n,r-a,r-1)?r-1:n,n=kn(n/a)),n}function A(n){n=c.toIndex(n);return v?Dn(n,0,x()):n}function C(n){n!==m&&(y=m,m=n)}function L(){return!J(o.focus)||o.isNavigation}return{mount:function(){b(),t([j,O],b)},go:function(n,t,e){var i=function(n){var t=m;{var e,i;U(n)?(i=n.match(/([+\-<>])(\d+)?/)||[],e=i[1],i=i[2],"+"===e||"-"===e?t=E(m+ +(""+e+(+i||1)),m,!0):">"===e?t=i?P(+i):h(!0):"<"===e&&(t=g(!0))):t=p?n:Dn(n,0,x())}return t}(n);o.useScroll?w(i,!0,!0,o.speed,e):-1<(n=S(i))&&!c.isBusy()&&(t||n!==m)&&(C(n),c.move(i,n,y,e))},scroll:w,getNext:h,getPrev:g,getAdjacent:_,getEnd:x,setIndex:C,getIndex:function(n){return n?y:m},toIndex:P,toPage:k,toDest:A,hasFocus:L}},Arrows:function(o,n,t){var e,i=In(o),r=i.on,u=i.bind,s=i.emit,a=t.classes,c=t.i18n,f=n.Elements,l=n.Controller,d=f.arrows,p=f.prev,v=f.next,h={};function g(){var n;t.arrows&&(p&&v||(d=sn("div",a.arrows),p=m(!0),v=m(!1),e=!0,Z(d,[p,v]),$(d,en("slider"===t.arrows&&f.slider||o.root)))),p&&v&&(h.prev||(un([p,v],Wn,f.list.id),h.prev=p,h.next=v,n=l.go,r([F,L,j,O,B],y),u(v,"click",G(n,">",!0,void 0)),u(p,"click",G(n,"<",!0,void 0)),s("arrows:mounted",p,v)),cn(d,!1===t.arrows?"none":""))}function m(n){return hn('<button class="'+a.arrow+" "+(n?a.prev:a.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="'+(t.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 y(){var n=o.index,t=l.getPrev(),e=l.getNext(),i=-1<t&&n<t?c.last:c.prev,n=-1<e&&e<n?c.first:c.next;p.disabled=t<0,v.disabled=e<0,un(p,Gn,i),un(v,Gn,n),s("arrows:updated",p,v,t,e)}return{arrows:h,mount:function(){g(),r(j,g)},destroy:function(){e?vn(d):rn([p,v],Jn)}}},Autoplay:function(t,e,i){var o,r,n=In(t),u=n.on,s=n.bind,a=n.emit,c=Rn(i.interval,t.go.bind(t,">"),function(n){var t=l.bar;t&&an(t,"width",100*n+"%"),a("autoplay:playing",n)}),f=c.isPaused,l=e.Elements,d=i.autoplay,p="pause"===d;function v(n){var t=n?"pause":"play",e=l[t];e&&(un(e,Wn,l.track.id),un(e,Gn,i.i18n[t]),s(e,"click",n?g:h))}function h(){f()&&e.Slides.isEnough()&&(c.start(!i.resetProgress),r=o=p=!1,a(w))}function g(n){void 0===n&&(n=!0),f()||(c.pause(),a(_)),p=n}function m(){p||(o||r?g(!1):h())}function y(){var n=e.Slides.getAt(t.index);c.set(n&&+ln(n.slide,_t)||i.interval)}return{mount:function(){d&&(v(!0),v(!1),function(){var n=l.root;i.pauseOnHover&&s(n,"mouseenter mouseleave",function(n){o="mouseenter"===n.type,m()});i.pauseOnFocus&&s(n,"focusin focusout",function(n){r="focusin"===n.type,m()});u([C,b,O],c.rewind),u(C,y)}(),p||h())},destroy:c.cancel,play:h,pause:g,isPaused:f}},Cover:function(n,t,e){var i=In(n).on;function o(e){t.Slides.forEach(function(n){var t=en(n.container||n.slide,"img");t&&t.src&&r(e,t,n)})}function r(n,t,e){e.style("background",n?'center/cover no-repeat url("'+t.src+'")':"",!0),cn(t,n?"none":"")}return{mount:function(){e.cover&&(i(g,G(r,!0)),i([F,j,O],G(o,!0)))},destroy:G(o,!1)}},Scroll:function(s,n,a){var c,f,t=In(s),e=t.on,l=t.emit,d=n.Move,p=d.getPosition,v=d.getLimit,h=d.exceededLimit;function g(i,n,t,o){var e,r=p(),u=1;n=n||(e=Cn(i-r),Pn(e/1.5,800)),f=t,y(),c=Rn(n,m,function(n){var t=p(),e=(r+(i-r)*(e=n,(n=a.easingFunc)?n(e):1-Math.pow(1-e,4))-p())*u;d.translate(t+e),s.is(mt)&&!o&&h()&&(u*=.6,Cn(e)<10&&(e=h(!1),g(v(!e),600,null,!0)))},1),l(b),c.start()}function m(){var n=p(),t=d.toIndex(n);Ln(t,0,s.length-1)||d.translate(d.shift(n,0<t),!0),f&&f(),l(B)}function y(){c&&c.cancel()}function i(){c&&!c.isPaused()&&(y(),m())}return{mount:function(){e(C,y),e([j,O],i)},destroy:y,scroll:g,cancel:i}},Drag:function(r,o,u){var s,t,i,a,c,f,l,d,n=In(r),e=n.on,p=n.emit,v=n.bind,h=n.unbind,g=r.state,m=o.Move,y=o.Scroll,b=o.Controller,w=o.Elements.track,_=(n=o.Direction).resolve,E=n.orient,x=m.getPosition,S=m.exceededLimit,P=!1;function k(){var n=u.drag;O(!n),a="free"===n}function A(n){var t,e;f=!1,l||(t=u.noDrag,e=R(n),!(!t||!nn(n.target,t))||!e&&n.button||(m.isBusy()?gn(n,!0):(d=e?w:window,c=g.is(4),i=null,v(d,xt,C,Et),v(d,St,L,Et),m.cancel(),y.cancel(),z(n))))}function C(n){var t,e,i,o;g.is(5)||(g.set(5),p("drag")),n.cancelable&&(c?(m.translate(s+M(n)/(P&&r.is(mt)?5:1)),e=200<T(n),i=P!==(P=S()),(e||i)&&z(n),f=!0,p("dragging"),gn(n)):Cn(M(o=n))>Cn(M(o,!0))&&(t=n,e=u.dragMinThreshold,i=q(e),o=i&&e.mouse||0,e=(i?e.touch:+e)||10,c=Cn(M(t))>(R(t)?e:o),gn(n)))}function L(n){var t,e,i;g.is(5)&&(g.set(3),p("dragged")),c&&(e=function(n){if(r.is(yt)||!P){var t=T(n);if(t&&t<200)return M(n)/t}return 0}(t=n),i=function(n){return x()+zn(n)*Sn(Cn(n)*(u.flickPower||600),a?1/0:o.Layout.listSize()*(u.flickMaxPages||1))}(e),t=u.rewind&&u.rewindByDrag,a?b.scroll(i):r.is(bt)?b.go(E(zn(e))<0?t?"<":"-":t?">":"+"):r.is(mt)&&P&&t?b.go(S(!0)?">":"<"):b.go(b.toDest(i),!0),gn(n)),h(d,xt,C),h(d,St,L),c=!1}function D(n){!l&&f&&gn(n,!0)}function z(n){i=t,t=n,s=x()}function M(n,t){return I(n,t)-I(N(n),t)}function T(n){return wn(n)-wn(N(n))}function N(n){return t===n&&i||t}function I(n,t){return(R(n)?n.changedTouches[0]:n)["page"+_(t?"Y":"X")]}function R(n){return"undefined"!=typeof TouchEvent&&n instanceof TouchEvent}function O(n){l=n}return{mount:function(){v(w,xt,H,Et),v(w,St,H,Et),v(w,"touchstart mousedown",A,Et),v(w,"click",D,{capture:!0}),v(w,"dragstart",gn),e([F,j],k)},disable:O,isDragging:function(){return c}}},Keyboard:function(t,n,e){var i,o,r=In(t),u=r.on,s=r.bind,a=r.unbind,c=t.root,f=n.Direction.resolve;function l(){var n=e.keyboard;n&&("focused"===n?un(i=c,jn,0):i=window,s(i,At,v))}function d(){a(i,At)}function p(){var n=o;o=!0,Y(function(){o=n})}function v(n){o||((n=kt(n))===f("ArrowLeft")?t.go("<"):n===f("ArrowRight")&&t.go(">"))}return{mount:function(){l(),u(j,d),u(j,l),u(C,p)},destroy:d,disable:function(n){o=n}}},LazyLoad:function(e,n,u){var t=In(e),i=t.on,o=t.off,r=t.bind,s=t.emit,a="sequential"===u.lazyLoad,c=[],f=0;function l(){n.Slides.forEach(function(r){yn(r.slide,Dt).forEach(function(n){var t,e,i=ln(n,Ct),o=ln(n,Lt);i===n.src&&o===n.srcset||(t=u.classes.spinner,un(e=en(e=n.parentElement,"."+t)||sn("span",t,e),Fn,"presentation"),c.push({_img:n,_Slide:r,src:i,srcset:o,_spinner:e}),n.src||cn(n,"none"))})}),a&&h()}function d(){f=0,c=[]}function p(){(c=c.filter(function(n){var t=u.perPage*((u.preloadPages||1)+1)-1;return!n._Slide.isWithin(e.index,t)||v(n)})).length||o(L)}function v(t){var e=t._img;V(t._Slide.slide,ht),r(e,"load error",function(n){!function(n,t){var e=n._Slide;bn(e.slide,ht),t||(vn(n._spinner),cn(n._img,""),s(g,n._img,e),s(E));a&&h()}(t,"error"===n.type)}),["srcset","src"].forEach(function(n){t[n]&&(un(e,n,t[n]),rn(e,"src"===n?Ct:Lt))})}function h(){f<c.length&&v(c[f++])}return{mount:function(){u.lazyLoad&&(l(),i(O,d),i(O,l),a||i([F,O,L,B],p))},destroy:d}},Pagination:function(l,n,d){var p,t=In(l),e=t.on,i=t.emit,v=t.bind,o=t.unbind,h=n.Slides,g=n.Elements,r=n.Controller,m=r.hasFocus,u=r.getIndex,s=r.go,a=n.Direction.resolve,y=[];function c(){f(),d.pagination&&h.isEnough()&&(function(){var n=l.length,t=d.classes,e=d.i18n,i=d.perPage,o="slider"===d.pagination&&g.slider||g.root,r=m()?n:An(n/i);un(p=sn("ul",t.pagination,o),Fn,"tablist"),un(p,Gn,e.select);for(var u=0;u<r;u++){var s=sn("li",null,p),a=sn("button",{class:t.page,type:"button"},s),c=h.getIn(u).map(function(n){return n.slide.id}),f=!m()&&1<i?e.pageX:e.slideX;v(a,"click",G(b,u)),v(a,"keydown",G(w,u)),un(s,Fn,"none"),un(a,Fn,"tab"),un(a,Wn,c.join(" ")),un(a,Gn,Mn(f,u+1)),un(a,jn,-1),y.push({li:s,button:a,page:u})}}(),i("pagination:mounted",{list:p,items:y},_(l.index)),E())}function f(){p&&(vn(p),y.forEach(function(n){o(n.button,"click keydown focus")}),x(y),p=null)}function b(n){s(">"+n,!0)}function w(n,t){var e=y.length,i=kt(t),o=-1;i===a("ArrowRight")?o=++n%e:i===a("ArrowLeft")?o=(--n+e)%e:"Home"===i?o=0:"End"===i&&(o=e-1);o=y[o];o&&(fn(o.button),s(">"+n),gn(t,!0))}function _(n){return y[r.toPage(n)]}function E(){var n,t=_(u(!0)),e=_(u());t&&(bn(n=t.button,lt),rn(n,Xn),un(n,jn,-1)),e&&(V(n=e.button,lt),un(n,Xn,!0),un(n,jn,"")),i("pagination:updated",{list:p,items:y},t,e)}return{items:y,mount:function(){c(),e([j,O],c),e([C,B],E)},destroy:f,getAt:_,update:E}},Sync:function(o,n,e){var t=n.Elements.list,r=[];function i(){var n,t;o.splides.forEach(function(n){var e;n.isParent||(e=n.splide,[o,e].forEach(function(n){var t=In(n),i=n===o?e:o;t.on(C,function(n,t,e){i.go(i.is(yt)?e:n)}),r.push(t)}))}),e.isNavigation&&(n=In(o),(t=n.on)(z,a),t(R,c),t([F,j],s),r.push(n),n.emit(X,o.splides))}function u(){r.forEach(function(n){n.destroy()}),x(r)}function s(){un(t,h,"ttb"===e.direction?"vertical":"")}function a(n){o.go(n.index)}function c(n,t){A(zt,kt(t))&&(a(n),gn(t))}return{mount:i,destroy:u,remount:function(){u(),i()}}},Wheel:function(o,r,u){var n=In(o).bind,t=u.wheel,s=q(t)?t:t&&{},a=0;function e(n){var t,e,i;n.cancelable&&(i=(t=n.deltaY)<0,e=wn(n),Cn(t)>(s.min||0)&&e-a>(s.sleep||0)&&(o.go(i?"<":">"),a=e),i=i,u.releaseWheel&&!o.state.is(4)&&-1===r.Controller.getAdjacent(i)||gn(n))}return{mount:function(){s&&n(r.Elements.track,"wheel",e,Et)}}},Live:function(n,t,e){var i=In(n).on,o=t.Elements.list,r=e.live&&!e.isNavigation;function u(n){r&&un(o,Un,n?"off":"polite")}return{mount:function(){r&&(un(o,qn,!1),u(!t.Autoplay.isPaused()),i(w,G(u,!0)),i(_,G(u,!1)))},disable:u}}}),Tt={type:"slide",role:"region",speed:400,waitForTransition:!0,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,keyboard:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",slideFocus:!0,trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:{slide:$n,clone:nt,arrows:et,arrow:it,prev:ot,next:rt,pagination:e,page:e+"__page",spinner:En+"__spinner"},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 slide to show",slideLabel:"%s of %s"}};function Nt(n,i,t){var e=In(n).on;return{mount:function(){e([F,O],function(){Y(function(){i.Slides.style("transition","opacity "+t.speed+"ms "+t.easing)})})},start:function(n,t){var e=i.Elements.track;an(e,"height",_n(pn(e).height)),Y(function(){t(),an(e,"height","")})},cancel:H}}function It(r,n,u){var s,t=In(r).bind,a=n.Move,c=n.Controller,e=n.Elements.list;function i(){f("")}function f(n){an(e,"transition",n)}return{mount:function(){t(e,"transitionend",function(n){n.target===e&&s&&(i(),s())})},start:function(n,t){var e=a.toPosition(n,!0),i=a.getPosition(),o=function(n){var t=u.rewindSpeed;if(r.is(mt)&&t){var e=c.getIndex(!0),i=c.getEnd();if(0===e&&i<=n||i<=e&&0===n)return t}return u.speed}(n);1<=Cn(e-i)&&1<=o?(f("transform "+o+"ms "+u.easing),a.translate(e,!0),s=t):(a.jump(n),t())},cancel:i}}e=function(){function e(n,t){this.event=In(),this.Components={},this.state=c(1),this.splides=[],this._options={},this._Extensions={};n=U(n)?mn(document,n):n;xn(n,n+" is invalid."),this.root=n,t=l({},Tt,e.defaults,t||{});try{l(t,JSON.parse(ln(n,i)))}catch(n){xn(!1,"Invalid JSON")}this._options=t}var n=e.prototype;return n.mount=function(n,t){var e=this,i=this.state,o=this.Components;return xn(i.is([1,6]),"Already mounted!"),i.set(1),this._Components=o,this._Transition=t||this._Transition||(this.is(bt)?Nt:It),this._Extensions=n||this._Extensions,a(on({},Mt,this._Extensions,{Transition:this._Transition}),function(n,t){n=n(e,o,e._options);(o[t]=n).setup&&n.setup()}),a(o,function(n){n.mount&&n.mount()}),this.emit(F),V(this.root,"is-initialized"),i.set(3),this.emit(r),this},n.sync=function(n){return this.splides.push({splide:n}),n.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._Components.Sync.remount(),n.Components.Sync.remount()),this},n.go=function(n){return this._Components.Controller.go(n),this},n.on=function(n,t){return this.event.on(n,t),this},n.off=function(n){return this.event.off(n),this},n.emit=function(n){var t;return(t=this.event).emit.apply(t,[n].concat(f(arguments,1))),this},n.add=function(n,t){return this._Components.Slides.add(n,t),this},n.remove=function(n){return this._Components.Slides.remove(n),this},n.is=function(n){return this._options.type===n},n.refresh=function(){return this.emit(O),this},n.destroy=function(t){void 0===t&&(t=!0);var n=this.event,e=this.state;return e.is(1)?In(this).on(r,this.destroy.bind(this,t)):(a(this._Components,function(n){n.destroy&&n.destroy(t)},!0),n.emit(o),n.destroy(),t&&x(this.splides),e.set(6)),this},_createClass(e,[{key:"options",get:function(){return this._options},set:function(n){var t=this._options;l(t,n),this.state.is(1)||this.emit(j,t)}},{key:"length",get:function(){return this._Components.Slides.getLength(!0)}},{key:"index",get:function(){return this._Components.Controller.getIndex()}}]),e}();return e.defaults={},e.STATES=n,e});
- //# sourceMappingURL=splide.min.js.map
|