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