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