/*! * Splide.js * Version : 1.0.0 * License : MIT * Copyright: 2019 Naotoshi Fujita */ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Splide=n():t.Splide=n()}(window,function(){return i={},o.m=e=[function(t,n,e){"use strict";function i(){return(i=Object.assign||function(t){for(var n=1;n])(\d+)?/),i=e&&e[1]||"",o=e?parseInt(e[2]):0;switch(i){case"+":n+=o||1;break;case"-":n-=o||1;break;case">":n=this.pageToIndex(-1o.flickThreshold&&Math.abs(t.offset[f])<150?s+=r*Math.min(e*o.flickPower,i.width*(o.flickMaxPages||1)):s+=r*i.slideWidth/2;var a=c.toIndex(s);u.is(_)||(a=O(a,0,l.edgeIndex)),l.go(a,o.isNavigation)}}(o),r=!1)}function g(t,n){var e=t.timeStamp,i=t.touches,o=i?i[0]:t,r=o.clientX,s=o.clientY,a=n.to||{},u=a.x,d=void 0===u?r:u,c=a.y,l=void 0===c?s:c,f={x:r-d,y:s-l},p=e-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:s},offset:f,timeStamp:e,velocity:{x:f.x/p,y:f.y/p}}}return n}function F(o,r,s){var a,e=[],u={required:o.options.autoplay,mount:function(){var t=o.options,n=r.Elements,e=n.slides,i=n.bar;e.length>t.perView&&(a=function(n,e,i){function o(t){d||(a=(s=t-(r=r||t))/e,e<=s&&(r=0,a=1,n()),i&&i(a),u(o))}var r,s,a,u=window.requestAnimationFrame,d=!0;return{pause:function(){d=!0,r=0},play:function(){r=0,d&&(d=!1,u(o))}}}(function(){o.go(">")},t.interval,function(t){o.emit(s+":playing",t),i&&h(i,{width:100*t+"%"})}),function(){var t=o.options,n=r.Elements,e=o.sub,i=[o.root,e?e.root:null];t.pauseOnHover&&(d(i,"mouseleave",J,!0),d(i,"mouseenter",J,!1));t.pauseOnFocus&&(d(i,"focusout",Y,!0),d(i,"focusin",Y,!1));w(n.play,"click",function(){u.play(Y),u.play(K)}),d([n.pause],"click",K,!1),o.on("move",function(){u.play()})}(),this.play())},play:function(n){void 0===n&&(n=0),(e=e.filter(function(t){return t!==n})).length||(o.emit(s+":play"),a.play())},pause:function(t){void 0===t&&(t=0),a.pause(),-1===e.indexOf(t)&&e.push(t),1===e.length&&o.emit(s+":pause")}};function d(t,n,e,i){for(var o in t)w(t[o],n,function(){u[i?"play":"pause"](e)})}return u}function X(a,u,d){var c,i=a.classes,n=a.root;function o(t){var n=p("button",{class:i.arrow+" "+(t?i.prev:i.next)});return n.innerHTML='',n}return{required:a.options.arrows||u.Elements.arrows.prev&&u.Elements.arrows.next,mount:function(){var t=u.Elements;(c=t.arrows).prev&&c.next||!a.options.arrows||(c=function(){var t=p("div",{class:i.arrows}),n=o(!0),e=o(!1);return t.appendChild(n),t.appendChild(e),{wrapper:t,prev:n,next:e}}(),n.insertBefore(c.wrapper,t.track)),c&&(function(){var t=a.options.perMove;w(c.prev,"click",function(){a.go(t?"-"+t:"<")}),w(c.next,"click",function(){a.go(t?"+"+t:">")})}(),a.on("mounted move updated",function(){var t=c,n=t.prev,e=t.next,i=u.Controller,o=i.prevIndex,r=i.nextIndex,s=o===r;n.disabled=o<0||s,e.disabled=r<0||s,a.emit(d+":updated",n,e,o,r)})),this.arrows=c},mounted:function(){a.emit(d+":mounted",c.prev,c.next)}}}function D(a,e,o){var r={},s={required:a.options.pagination,mount:function(){r=function(){var n=a.options,o=a.classes,r=p("ul",{class:o.pagination}),s=e.Slides,t=s.getSlides(!1,!0).filter(function(t){return n.focus||t.index%n.perView==0}).map(function(t,n){var e=p("li",{}),i=p("button",{class:o.page});return e.appendChild(i),r.appendChild(e),w(i,"click",function(){a.go(">"+n)}),{li:e,button:i,page:n,Slides:s.getSlidesByPage(n)}});return{list:r,items:t}}();var t=a.root;"top"===a.options.pagination?t.insertBefore(r.list,e.Elements.track):t.appendChild(r.list),a.on(U,n).on(Q,function(){s.destroy(),a.options.pagination&&(s.mount(),s.mounted())})},mounted:function(){var t=a.index;a.emit(o+":mounted",r,this.getItem(t)),n(t,-1)},destroy:function(){r&&r.list&&a.root.removeChild(r.list),a.off(U).off(Q),r=null},getItem:function(t){return r.items[e.Controller.indexToPage(t)]},get data(){return r}};function n(t,n){var e=s.getItem(n),i=s.getItem(t);e&&v(e.button,l.active),i&&g(i.button,l.active),a.emit(o+":updated",r,e,i)}return s}function G(a,i){var u,d,c=a.i18n;function n(t,n){y(t,"aria-hidden",!n),y(t,"tabindex",n?0:-1)}function t(t,n){u=f(c.prev),d=f(c.next),t.appendChild(u),n.appendChild(d);var e=i.Elements.track.id;y(t,nt,e),y(n,nt,e)}function e(t,n,e,i){var o=a.index,r=-1",Left:"<",Right:">"},tt="aria-current",nt="aria-controls",et="aria-label",it="move.sync",ot=[" ","Enter","Spacebar"],rt={Options:M,Elements:L,Controller:A,Slides:q,Track:z,Clones:R,Layout:N,Drag:B,Autoplay:F,Cover:function(t,n){function e(t){var n=t.parentElement;n&&(h(n,{background:'center/cover no-repeat url("'+t.src+'")'}),h(t,{display:"none"}))}return{required:t.options.cover&&(t.options.fixedHeight||t.options.heightRatio),mount:function(){n.Slides.getSlides(!0,!1).forEach(function(t){var n=f(t,"img");n&&n.src&&e(n)}),t.on("lazyload:loaded",function(t){e(t)})}}},Arrows:X,Pagination:D,LazyLoad:function(o,t,r){var n=0,i=[],e=o.options.lazyLoad,s="sequential"===e;function a(n){var e=o.options;(i=i.filter(function(t){return!t.Slide.isWithin(n,e.perView*(e.preloadPages+1))||(u(t.img,t.Slide),!1)})).length||o.off("moved."+r)}function u(t,n){g(n.slide,l.loading);var e=p("span",{class:o.classes.spinner});t.parentElement.appendChild(e),t.onload=function(){c(t,e,n,!1)},t.onerror=function(){c(t,e,n,!0)},h(t,{visibility:"hidden"}),y(t,"src",t.getAttribute(Z))}function d(){if(n