splide.min.js 28 KB

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