@splidejs/splide
Advanced tools
Comparing version 1.0.19 to 1.0.20
/*! | ||
* Splide.js | ||
* Version : 1.0.18 | ||
* Version : 1.0.19 | ||
* 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<arguments.length;n++){var e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t}).apply(this,arguments)}function r(e,i){Object.keys(e).some(function(t,n){return i(e[t],t,n)})}function s(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function a(t,n){var e=i({},t);return o(e)&&o(n)&&r(n,function(t,n){o(t)?(o(e[n])||(e[n]={}),e[n]=a(e[n],t)):e[n]=t}),e}e.r(n);var u="splide",l={active:"is-active",visible:"is-visible",loading:"is-loading"},d={type:"slide",rewind:!1,speed:400,width:0,height:0,fixedWidth:0,fixedHeight:0,heightRatio:0,perPage:1,perMove:0,start:0,focus:!1,gap:0,padding:0,arrows:!0,arrowPath:"",pagination:!0,autoplay:!1,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,lazyLoad:!1,preloadPages:1,easing:"cubic-bezier(.42,.65,.27,.99)",keyboard:!0,drag:!0,flickThreshold:.6,flickPower:600,flickMaxPages:1,direction:"ltr",cover:!1,accessibility:!0,isNavigation:!1,trimSpace:!0,breakpoints:!1,classes:{root:u,track:u+"__track",list:u+"__list",slide:u+"__slide",container:u+"__slide__container",arrows:u+"__arrows",arrow:u+"__arrow",prev:u+"__arrow--prev",next:u+"__arrow--next",pagination:u+"__pagination",page:u+"__pagination__page",clone:u+"__slide--clone",progress:u+"__progress",bar:u+"__progress__bar",autoplay:u+"__autoplay",play:u+"__autoplay__play",pause:u+"__autoplay__pause",spinner:u+"__spinner",sr:u+"__sr"},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"}};function f(t,n){return t&&n?t.querySelector(n.split(" ")[0]):null}function c(t,n){if(t){var e=s(t.children);for(var i in e){var o=e[i];if(m(o,n.split(" ")[0]))return o}}return null}function p(t,n){var e=document.createElement(t);return r(n,function(t,n){return y(e,n,t)}),e}function h(e,t){e&&r(t,function(t,n){e.style[n]=t||""})}function g(n){if(n){for(var t=arguments.length,e=new Array(1<t?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];e.forEach(function(t){t&&n.classList.add(t)})}}function v(t,n){t&&t.classList.remove(n)}function m(t,n){return!!t&&t.classList.contains(n)}function y(t,n,e){t&&t.setAttribute(n,e)}function x(t,n){t&&t.removeAttribute(n)}function b(n,t,e,i){return void 0===i&&(i=!0),n?t.split(" ").map(function(t){return n.addEventListener(t,e,{passive:i}),function(){return n.removeEventListener(t,e)}}):[]}function w(s,u){return{start:function(t,n,e,i){var o=u.Elements.list,r=s.options,a=b(o,"transitionend",function(t){t.target===o&&(i(),a[0]())});h(o,{transition:"transform "+r.speed+"ms "+r.easing,transform:"translate("+e.x+"px,"+e.y+"px)"})}}}function S(i,o){function r(t){var n=o.Slides.getSlide(t),e=i.options;n&&h(n.slide,{transition:"opacity "+e.speed+"ms "+e.easing})}return o.Options.fix({perPage:1,gap:0,padding:0}),o.Drag&&(o.Drag.required=!1),{mount:function(){r(i.index)},start:function(t,n,e,i){r(n),i()}}}var _="loop",k="fade";var P="[SPLIDE]";function C(t){console.error(P+" "+t)}function E(t,n){if(!t)throw new Error(n);return t}function I(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function M(t){var n=t.root.getAttribute("data-splide");if(n)try{t.options=JSON.parse(n)}catch(t){C('"data-splide" must be a valid JSON.')}return{mount:function(){t.index=t.options.start},fix:function(e){var i=a(t.options,e),o=i.breakpoints;o&&r(o,function(t,n){i.breakpoints[n]=a(o[n],e)}),t.options=i}}}function L(e){var i=e.root,o=e.classes;if(!i.id){var t=window[W]||0;window[W]=++t,i.id="splide"+(t<10?"0"+t:t)}var r={mount:function(){var t="was not found.";this.track=c(i,o.track),E(this.track,"A track "+t),this.list=c(this.track,o.list),E(this.list,"A list "+t),this.slides=s(this.list.children),E(this.slides.length,"A slide "+t);var n=a(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var e=a(o.autoplay);this.bar=f(a(o.progress),"."+o.bar),this.play=f(e,"."+o.play),this.pause=f(e,"."+o.pause),function(){r.track.id||(r.track.id=i.id+"-track");r.list.id||(r.list.id=i.id+"-list")}()},mounted:function(){var t=o.root,n=e.options;g(i,""+t,t+"--"+n.type,t+"--"+n.direction,n.drag?t+"--draggable":"",n.isNavigation?t+"--nav":"")}};function a(t){return c(i,t)||c(r.track,t)}return r}var T=function(){function t(t,n,e){var i=this;void 0===n&&(n={}),void 0===e&&(e={}),this.root=t instanceof HTMLElement?t:f(document,t),E(this.root,"An invalid root element or selector was given."),this.Components={},this.Event=function(){var e={};return{on:function(t,n){t.split(" ").forEach(function(t){e[t]||(e[t]=[]),e[t].push(n)})},off:function(t){t.split(" ").forEach(function(t){return delete e[t]})},emit:function(i){for(var t=arguments.length,o=new Array(1<t?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];r(e,function(t,n){if(n.split(".")[0]===i&&t)for(var e in t)t[e].apply(t,o)})}}}(),this.State=function(t){var n=t;return{set:function(t){n=t},is:function(t){return t===n}}}(1),this._options=a(d,n),this._index=0,this._components=e,this.on("move drag",function(){return i.State.set(3)}).on("moved dragged",function(){return i.State.set(2)})}var n=t.prototype;return n.mount=function(t,n){var i=this;void 0===t&&(t={}),void 0===n&&(n=null),this.Components=function(e,t,n){var i={};return r(t,function(t,n){i[n]=t(e,i,n.toLowerCase())}),n=n||e.is(k)?S:w,i.Transition=n(e,i),i}(this,a(this._components,t),n);try{r(this.Components,function(t,n){var e=t.required;void 0===e||e?t.mount&&t.mount():delete i.Components[n]})}catch(t){return C(t.message),null}return r(this.Components,function(t){t.mounted&&t.mounted()}),this.State.set(2),this.emit("mounted"),this.State.set(2),this.emit("ready"),h(this.root,{visibility:"visible"}),this},n.sync=function(t){return this.sub=t,this},n.on=function(t,n){return this.Event.on(t,n),this},n.off=function(t){return this.Event.off(t),this},n.emit=function(t){for(var n,e=arguments.length,i=new Array(1<e?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return(n=this.Event).emit.apply(n,[t].concat(i)),this},n.go=function(t,n){void 0===n&&(n=!0),(this.State.is(2)||this.State.is(3)&&!n)&&this.Components.Controller.go(t,!1)},n.is=function(t){return t===this._options.type},function(t,n,e){n&&I(t.prototype,n),e&&I(t,e)}(t,[{key:"index",get:function(){return this._index},set:function(t){this._index=parseInt(t)}},{key:"length",get:function(){return this.Components.Slides.length}},{key:"options",get:function(){return this._options},set:function(t){this._options=a(this._options,t),this.State.is(1)||this.emit("updated",this._options)}},{key:"classes",get:function(){return this._options.classes}},{key:"i18n",get:function(){return this._options.i18n}}]),t}(),W="splideUid";function H(t,n,e){return Math.min(Math.max(t,e<n?e:n),e<n?n:e)}function O(t){for(var n=arguments.length,e=new Array(1<n?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];var o=0;return t.replace(/%s/g,function(){return e[o++]})}function j(t){var n=typeof t;return"string"==n?t:"number"==n&&0<t?parseFloat(t)+"px":""}function A(t,n){if("number"==typeof n)return n;var e=p("div",{});h(e,{position:"absolute",width:n}),t.appendChild(e);var i=e.clientWidth;return t.removeChild(e),i}function q(r,i){var o,n={mount:function(){o=r.options,r.on("move",function(t){r.index=t}).on("updated",function(t){o=t,r.index=n.rewind(n.trim(r.index))})},go:function(t,n){var e=this.trim(this.parse(t));i.Track.go(e,this.rewind(e),n)},parse:function(t){var n=r.index,e=String(t).match(/([+\-<>])(\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(-1<o?o:this.indexToPage(n)+1);break;case"<":n=this.pageToIndex(-1<o?o:this.indexToPage(n)-1);break;default:n=parseInt(t)}return n},pageToIndex:function(t){if(!1!==o.focus)return t;var n=r.length,e=o.perPage,i=t*e;return n-e<=(i-=(this.pageLength*e-n)*z(i/n))&&i<n&&(i=n-e),i},indexToPage:function(t){if(!1!==o.focus)return t;var n=r.length,e=o.perPage;return z(n-e<=t&&t<n?(n-1)/e:t/e)},trim:function(t){return r.is(_)||(t=o.rewind?this.rewind(t):H(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(_)){for(;n<t;)t-=n+1;for(;t<0;)t+=n+1}else n<t?t=0:t<0&&(t=n);return t},isRtl:function(){return"rtl"===o.direction},get pageLength(){var t=r.length;return!1!==o.focus?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return!1!==o.focus||o.isNavigation||r.is(_)?t-1:t-o.perPage},get prevIndex(){var t=this.parse("-");return(r.is(_)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=this.parse("+");return(r.is(_)||o.rewind)&&(t=this.rewind(t)),r.index<t&&t<=this.edgeIndex||0===t?t:-1}};return n}var z=Math.floor;function R(o,r){var e=[],a=[];return{mount:function(){for(var t in e=r.Elements.slides)this.register(parseInt(t),-1,e[t])},register:function(t,n,e){var i=function(u,t,o,d){return{slide:o,index:u,realIndex:t,container:f(o,"."+d.classes.container),isClone:-1<t,init:function(){var t=this;if(!o.id&&!this.isClone){var n=u+1;o.id=d.root.id+"-slide"+(n<10?"0"+n:n)}d.on("mounted moved updated",function(){t.update(t.isActive(),!1),t.update(t.isVisible(),!0)})},update:function(t,n){var e=n?"visible":"active",i=l[e];t?(g(o,i),d.emit(e,this)):m(o,i)&&(v(o,i),d.emit(n?"hidden":"inactive",this))},isActive:function(){return d.index===u},isVisible:function(){var t=d.options,n=t.focus,e=t.perPage,i=t.trimSpace,o=d.index,r=d.length,a="center"===n,s=a?e/2:parseInt(n)||0;if(i){if(o<s)return u<e;if(r-(e-s)<=o)return r-e<=u}return o-s+(a&&e%2==0?1:0)<=u&&u<o+e-s},isWithin:function(t,n){var e=Math.abs(t-u);return d.is("slide")||this.isClone||(e=Math.min(e,d.length-e)),e<n}}}(t,n,e,o);i.init(),a.push(i)},getSlide:function(n){return a.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?a:a.filter(function(t){return!t.isClone}):t?a.map(function(t){return t.slide}):e},getSlidesByPage:function(t){var e=r.Controller.pageToIndex(t),n=o.options,i=!1!==n.focus?1:n.perPage;return a.filter(function(t){var n=t.index;return e<=n&&n<e+i})},get length(){return e.length},get total(){return a.length}}}function B(a,s){var o,n,u=0,e="ttb"===a.options.direction;return{mount:function(){o=s.Elements.list,n=e?function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*(s.slideHeight+s.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(s.slideHeight+s.gap))},trim:function(t){return H(t,-(s.listHeight-(s.height+s.gap)),0)},get offset(){var t,n=s.height,e=s.slideHeight,i=s.gap,o=r.options.focus;return t="center"===o?(n-e)/2:(parseInt(o)||0)*(e+i),(e+i)*a.Clones.length/2-t}}}(a,s):function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*(s.slideWidth+s.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(s.slideWidth+s.gap))},trim:function(t){return H(t,this.sign*(s.listWidth-(s.width+s.gap)),0)},get sign(){return a.Controller.isRtl()?1:-1},get offset(){var t,n=s.width,e=s.slideWidth,i=s.gap,o=r.options.focus;return t="center"===o?(n-e)/2:(parseInt(o)||0)*(e+i),(e+i)*a.Clones.length/2-t}}}(a,s)},mounted:function(){var t=this;a.is(k)||a.on("mounted resize updated",function(){t.jump(a.index)})},go:function(t,n,e){var i=this,o=this.trim(this.toPosition(t)),r=a.index;e||a.emit("move",n,r,t),1<=Math.abs(o-u)||a.is(k)?s.Transition.start(t,n,this.toCoord(o),function(){i.end(t,n,r,e)}):this.end(t,n,r,e)},end:function(t,n,e,i){h(o,{transition:""}),a.is(k)||this.jump(n),i||a.emit("moved",n,e,t)},jump:function(t){var n=this.trim(this.toPosition(t));this.translate(n)},translate:function(t){u=t,n.translate(o,t)},toPosition:function(t){return n.toPosition(t)},toIndex:function(t){return n.toIndex(t)},trim:function(t){return!a.options.trimSpace||a.is(_)?t:n.trim(t)},toCoord:function(t){return{x:e?0:t,y:e?t:0}},get position(){return u},get offset(){return n.offset}}}function N(c,l){var f=[];function p(t){var n=t.cloneNode(!0);return g(n,c.classes.clone),x(n,"id"),n}return{mount:function(){c.is(_)&&function(){var i=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,e=t.drag,r=t.flickMaxPages,a=void 0===r?1:r,s=i.length,u=n*(e?a+1:1)+(s<n?n:0),d=i.getSlides(!1,!1);for(;d.length<u;)d=d.concat(d);d.slice(0,u).forEach(function(t,n){var e=p(t);o.appendChild(e),f.push(e),i.register(n+s,n,e)}),d.slice(-u).forEach(function(t,n){var e=p(t);o.insertBefore(e,d[0]),f.push(e),i.register(n-u,n,e)})}()},get clones(){return f},get length(){return f.length}}}function F(i,a){var s,u,d,o=i.root,r="ttb"===i.options.direction,t=a.Elements,c={mount:function(){s=t.list,u=a.Slides.getSlides(!0,!0),function(){var t=function(t,n){var e=null;return function(){e=e||setTimeout(function(){t(),e=null},n)}}(function(){i.emit("resize")},30);b(window,"resize",t),i.on("mounted resize",l).on("updated",n),r||i.on("resize",e)}(),n()},get width(){return d.width},get height(){return d.height},get listWidth(){return d.listWidth},get listHeight(){return d.listHeight},get slideWidth(){return d.slideWidth},get slideHeight(){return d.slideHeight},get gap(){return d.gap},get padding(){return d.padding}};function n(){var t=i.options;for(var n in(d=r?function(n,t,e){var i=t.Elements,o=i.track;return{marginProp:"marginBottom",init:function(){var t=e.padding;t&&("object"!=typeof t&&(t={top:t,bottom:t}),h(o,{paddingTop:j(t.top),paddingBottom:j(t.bottom)}))},get width(){return o.clientWidth},get height(){var t=e.height||this.width*e.heightRatio;return E(t,'"height" or "heightRatio" must be given in TTB mode.'),A(n.root,t)},get listWidth(){return this.width},get listHeight(){return(this.slideHeight+this.gap)*t.Slides.total},get slideWidth(){return A(n.root,e.fixedWidth||this.width)},get slideHeight(){var t=e.fixedHeight;return t=t||(this.height+this.gap)/e.perPage-this.gap,A(n.root,t)},get gap(){var t=getComputedStyle(i.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(o);return{top:parseFloat(t.paddingTop)||0,bottom:parseFloat(t.paddingBottom)||0}}}}(i,a,t):function(n,t,e){var i=t.Elements,o=i.track;return{marginProp:"rtl"===e.direction?"marginLeft":"marginRight",height:0,listHeight:0,init:function(){var t=e.padding;t&&("object"!=typeof t&&(t={left:t,right:t}),h(o,{paddingLeft:j(t.left),paddingRight:j(t.right)}))},get width(){return o.clientWidth-this.padding.left-this.padding.right},get listWidth(){return(this.slideWidth+this.gap)*t.Slides.total},get slideWidth(){var t=e.fixedWidth;return t=t||(this.width+this.gap)/e.perPage-this.gap,A(n.root,t)},get slideHeight(){var t=e.height||e.fixedHeight||this.width*e.heightRatio;return A(n.root,t)},get gap(){var t=getComputedStyle(i.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(o);return{left:parseFloat(t.paddingLeft)||0,right:parseFloat(t.paddingRight)||0}}}}(i,a,t)).init(),h(o,{maxWidth:j(t.width)}),u){var e;h(u[n].slide,((e={})[d.marginProp]=j(t.gap),e))}l()}function l(){h(s,{width:j(c.listWidth),height:j(c.listHeight)}),h(a.Elements.track,{height:j(c.height)});var t=j(d.slideWidth),n=j(d.slideHeight);for(var e in u){var i=u[e],o=i.slide,r=i.container;h(r,{height:n}),h(o,{width:t,height:r?"":n})}}function e(){var t=i.options;if(t.fixedWidth){var n=Math.floor((c.width+d.gap)/(c.slideWidth+d.gap))||1;t.perPage!==n&&(i.options={perPage:n})}}return c}function D(u,d){var e,i,o,c=d.Track,l=d.Controller,r=!1,a="ttb"===u.options.direction,f=a?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;b(t,"touchstart mousedown",s),b(t,"touchmove mousemove",p,!1),b(t,"touchend touchcancel mouseleave mouseup dragend",h)}};function s(t){n.disabled||r||!u.State.is(2)||(e=c.toCoord(c.position),i=g(t,{}),o=i)}function p(t){if(i)if(o=g(t,i),r){t.cancelable&&t.preventDefault();var n=e[f]+o.offset[f];c.translate(function(t){if(!u.is(_)){var n=c.trim,e=c.toPosition,i=l.isRtl()?-1:1,o=i*n(e(0)),r=i*n(e(l.edgeIndex));o<(t*=i)?t=5*Math.log(t-o)+o:t<r&&(t=-5*Math.log(r-t)+r),t*=i}return t}(n))}else!function(t){var n=t.offset;if(u.State.is(2)){var e=180*Math.atan(Math.abs(n.y)/Math.abs(n.x))/Math.PI;return a&&(e=90-e),e<30}return!1}(o)||(u.emit("drag",i),r=!0)}function h(){i=null,r&&(u.emit("dragged",o),function(t){var n=t.velocity[f],e=Math.abs(n);if(0<e){var i=d.Layout,o=u.options,r=n<0?-1:1,a=c.position;e>o.flickThreshold&&Math.abs(t.offset[f])<150&&(a+=r*Math.min(e*o.flickPower,i.width*(o.flickMaxPages||1)));var s=c.toIndex(a);s===u.index&&(s+=l.isRtl()?r:-r),u.is(_)||(s=H(s,0,l.edgeIndex)),l.go(s,o.isNavigation)}}(o),r=!1)}function g(t,n){var e=t.timeStamp,i=t.touches,o=i?i[0]:t,r=o.clientX,a=o.clientY,s=n.to||{},u=s.x,d=void 0===u?r:u,c=s.y,l=void 0===c?a:c,f={x:r-d,y:a-l},p=e-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:a},offset:f,timeStamp:e,velocity:{x:f.x/p,y:f.y/p}}}return n}function X(o,r,a){var s,e=[],u={required:o.options.autoplay,mount:function(){var t=o.options,n=r.Elements,e=n.slides,i=n.bar;e.length>t.perPage&&(s=function(n,e,i){function o(t){d||(s=(a=t-(r=r||t))/e,e<=a&&(r=0,s=1,n()),i&&i(s),u(o))}var r,a,s,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(a+":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",V,!0),d(i,"mouseenter",V,!1));t.pauseOnFocus&&(d(i,"focusout",Y,!0),d(i,"focusin",Y,!1));b(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(a+":play"),s.play())},pause:function(t){void 0===t&&(t=0),s.pause(),-1===e.indexOf(t)&&e.push(t),1===e.length&&o.emit(a+":pause")}};function d(t,n,e,i){for(var o in t)b(t[o],n,function(){u[i?"play":"pause"](e)})}return u}function G(s,u,d){var c,i=s.classes,n=s.root;function o(t){var n=p("button",{class:i.arrow+" "+(t?i.prev:i.next)});return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg"\tviewBox="0 0 40 40"\twidth="40"\theight="40"><path d="'+(s.options.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")+'" /></svg>',n}return{required:s.options.arrows,mount:function(){var t=u.Elements;(c=t.arrows).prev&&c.next||!s.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=s.options.perMove;b(c.prev,"click",function(){s.go(t?"-"+t:"<")}),b(c.next,"click",function(){s.go(t?"+"+t:">")})}(),s.on("mounted move updated",function(){var t=c,n=t.prev,e=t.next,i=u.Controller,o=i.prevIndex,r=i.nextIndex,a=1<s.length;n.disabled=o<0||!a,e.disabled=r<0||!a,s.emit(d+":updated",n,e,o,r)})),this.arrows=c},mounted:function(){s.emit(d+":mounted",c.prev,c.next)}}}function U(s,e,o){var r={},a={required:s.options.pagination,mount:function(){r=function(){var n=s.options,o=s.classes,r=p("ul",{class:o.pagination}),a=e.Slides,t=a.getSlides(!1,!0).filter(function(t){return!1!==n.focus||t.index%n.perPage==0}).map(function(t,n){var e=p("li",{}),i=p("button",{class:o.page});return e.appendChild(i),r.appendChild(e),b(i,"click",function(){s.go(">"+n)}),{li:e,button:i,page:n,Slides:a.getSlidesByPage(n)}});return{list:r,items:t}}();var t=s.root;"top"===s.options.pagination?t.insertBefore(r.list,e.Elements.track):t.appendChild(r.list),s.on(Q,n).on(Z,function(){a.destroy(),s.options.pagination&&(a.mount(),a.mounted())})},mounted:function(){var t=s.index;s.emit(o+":mounted",r,this.getItem(t)),n(t,-1)},destroy:function(){r&&r.list&&s.root.removeChild(r.list),s.off(Q).off(Z),r=null},getItem:function(t){return r.items[e.Controller.indexToPage(t)]},get data(){return r}};function n(t,n){var e=a.getItem(n),i=a.getItem(t);e&&v(e.button,l.active),i&&g(i.button,l.active),s.emit(o+":updated",r,e,i)}return a}function J(s,i){var u,d,c=s.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,et,e),y(n,et,e)}function e(t,n,e,i){var o=s.index,r=-1<e&&o<e?c.last:c.prev,a=-1<i&&i<o?c.first:c.next;u.innerHTML=r,d.innerHTML=a,y(t,it,r),y(n,it,a)}function o(t,n){n&&y(n.button,nt,!0),t.items.forEach(function(t){var n=s.options,e=O(!1===n.focus&&1<n.perPage?c.pageX:c.slideX,t.page+1),i=f(e),o=t.button,r=[];o.appendChild(i),t.Slides.forEach(function(t){r.push(t.slide.id)}),y(o,et,r.join(" ")),y(o,it,e)})}function r(t,n,e){n&&x(n.button,nt),e&&y(e.button,nt,!0)}function a(r){i.Slides.getSlides(!0,!0).forEach(function(t){var n=t.slide;"button"!==n.tagName.toLowerCase()&&y(n,"role","button");var e=t.realIndex,i=O(c.slideX,e+1),o=r.Components.Slides.getSlide(e);y(n,it,i),n.appendChild(f(i)),o&&y(n,et,o.slide.id)})}function l(t,n){var e=t.slide;n?y(e,nt,!0):x(e,nt)}function f(t){var n=p("span",{class:s.classes.sr});return n.textContent=t,n}return{required:s.options.accessibility,mount:function(){s.on("visible",function(t){n(t.slide,!0)}).on("hidden",function(t){n(t.slide,!1)}).on("arrows:mounted",t).on("arrows:updated",e).on("pagination:mounted",o).on("pagination:updated",r),s.options.isNavigation&&s.on("navigation:mounted",a).on("active",function(t){l(t,!0)}).on("inactive",function(t){l(t,!1)})}}}var V=1,Y=2,K=3,Q="move.page",Z="updated.page",$="data-splide-lazy",tt={horizontal:{ArrowLeft:"<",ArrowRight:">",Left:"<",Right:">"},vertical:{ArrowUp:"<",ArrowDown:">",Up:"<",Down:">"}},nt="aria-current",et="aria-controls",it="aria-label",ot="move.sync",rt=[" ","Enter","Spacebar"],at={Options:M,Elements:L,Controller:q,Slides:R,Track:B,Clones:N,Layout:F,Drag:D,Autoplay:X,Cover:function(t,n){var e=t.options;function i(t){var n=t.parentElement;n&&(h(n,{background:'center/cover no-repeat url("'+t.src+'")'}),h(t,{display:"none"}))}return{required:e.cover&&(e.height||e.heightRatio||e.fixedHeight),mount:function(){n.Slides.getSlides(!0,!1).forEach(function(t){var n=f(t,"img");n&&n.src&&i(n)}),t.on("lazyload:loaded",function(t){i(t)})}}},Arrows:G,Pagination:U,LazyLoad:function(o,t,r){var n=0,i=[],e=o.options.lazyLoad,a="sequential"===e;function s(n){var e=o.options;(i=i.filter(function(t){return!t.Slide.isWithin(n,e.perPage*(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($))}function d(){if(n<i.length){var t=i[n];u(t.img,t.Slide)}n++}function c(t,n,e,i){v(e.slide,l.loading),i||(t.parentElement.removeChild(n),h(t,{visibility:"visible"}),o.emit(r+":loaded",t)),a&&d()}return{required:e,mount:function(){t.Slides.getSlides(!0,!0).forEach(function(t){var n=f(t.slide,"["+$+"]");n&&i.push({img:n,Slide:t})}),i.length&&(a?d():o.on("mounted",function(){s(o.index)}).on("moved."+r,function(t){s(t)}))}}},Keyboard:function(e){var t;return{mount:function(){var n=tt["ttb"===e.options.direction?"vertical":"horizontal"];e.on("mounted updated",function(){t&&(t[0](),t=void 0),e.options.keyboard&&(t=b(e.root,"keydown",function(t){n[t.key]&&e.go(n[t.key])}))})}}},Sync:function(i){var o=i.sub;function r(){i.on(ot,function(t,n,e){o.off(ot).go(o.is(_)?e:t,!1),a()})}function a(){o.on(ot,function(t,n,e){i.off(ot).go(i.is(_)?e:t,!1),r()})}function e(t){i.State.is(2)&&o.go(t)}return{required:!!o,mount:function(){r(),a(),o.options.isNavigation&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;b(t,"mouseup touchend",function(t){t.button&&0!==t.button||e(n.index)}),b(t,"keyup",function(t){-1<rt.indexOf(t.key)&&(t.preventDefault(),e(n.index))},!1)})}}},A11y:J,Breakpoints:function(n){var e,i,o=n.options.breakpoints,r=[];return{required:o&&matchMedia,mount:function(){r=Object.keys(o).sort(function(t,n){return parseInt(t)-parseInt(n)}).map(function(t){return{point:t,mql:matchMedia("(max-width:"+t+"px)")}}),n.on("mounted resize",function(){var t=function(){var t=r.filter(function(t){return t.mql.matches})[0];return t?t.point:-1}();t!==i&&(n.options=o[t]||e,i=t)})},mounted:function(){e=n.options}}}};function st(t,n){return void 0===n&&(n={}),new T(t,n,at)}e.d(n,"default",function(){return st}),window.splide=st}],o.c=i,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)o.d(e,i,function(t){return n[t]}.bind(null,i));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=0);function o(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var e,i}); | ||
!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<arguments.length;n++){var e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t}).apply(this,arguments)}function r(e,i){Object.keys(e).some(function(t,n){return i(e[t],t,n)})}function s(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function a(t,n){var e=i({},t);return o(e)&&o(n)&&r(n,function(t,n){o(t)?(o(e[n])||(e[n]={}),e[n]=a(e[n],t)):e[n]=t}),e}e.r(n);var u="splide",l={active:"is-active",visible:"is-visible",loading:"is-loading"},d={type:"slide",rewind:!1,speed:400,width:0,height:0,fixedWidth:0,fixedHeight:0,heightRatio:0,perPage:1,perMove:0,start:0,focus:!1,gap:0,padding:0,arrows:!0,arrowPath:"",pagination:!0,autoplay:!1,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,lazyLoad:!1,preloadPages:1,easing:"cubic-bezier(.42,.65,.27,.99)",keyboard:!0,drag:!0,flickThreshold:.6,flickPower:600,flickMaxPages:1,direction:"ltr",cover:!1,accessibility:!0,isNavigation:!1,trimSpace:!0,breakpoints:!1,classes:{root:u,track:u+"__track",list:u+"__list",slide:u+"__slide",container:u+"__slide__container",arrows:u+"__arrows",arrow:u+"__arrow",prev:u+"__arrow--prev",next:u+"__arrow--next",pagination:u+"__pagination",page:u+"__pagination__page",clone:u+"__slide--clone",progress:u+"__progress",bar:u+"__progress__bar",autoplay:u+"__autoplay",play:u+"__autoplay__play",pause:u+"__autoplay__pause",spinner:u+"__spinner",sr:u+"__sr"},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"}};function f(t,n){return t&&n?t.querySelector(n.split(" ")[0]):null}function c(t,n){if(t){var e=s(t.children);for(var i in e){var o=e[i];if(m(o,n.split(" ")[0]))return o}}return null}function p(t,n){var e=document.createElement(t);return r(n,function(t,n){return y(e,n,t)}),e}function h(e,t){e&&r(t,function(t,n){e.style[n]=t||""})}function g(n){if(n){for(var t=arguments.length,e=new Array(1<t?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];e.forEach(function(t){t&&n.classList.add(t)})}}function v(t,n){t&&t.classList.remove(n)}function m(t,n){return!!t&&t.classList.contains(n)}function y(t,n,e){t&&t.setAttribute(n,e)}function x(t,n){t&&t.removeAttribute(n)}function b(n,t,e,i){return void 0===i&&(i=!0),n?t.split(" ").map(function(t){return n.addEventListener(t,e,{passive:i}),function(){return n.removeEventListener(t,e)}}):[]}function w(s,u){return{start:function(t,n,e,i){var o=u.Elements.list,r=s.options,a=b(o,"transitionend",function(t){t.target===o&&(i(),a[0]())});h(o,{transition:"transform "+r.speed+"ms "+r.easing,transform:"translate("+e.x+"px,"+e.y+"px)"})}}}function S(i,o){function r(t){var n=o.Slides.getSlide(t),e=i.options;n&&h(n.slide,{transition:"opacity "+e.speed+"ms "+e.easing})}return o.Options.fix({perPage:1,gap:0,padding:0}),o.Drag&&(o.Drag.required=!1),{mount:function(){r(i.index)},start:function(t,n,e,i){r(n),i()}}}var _="loop",k="fade";var P="[SPLIDE]";function C(t){console.error(P+" "+t)}function E(t,n){if(!t)throw new Error(n);return t}function I(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function M(t){var n=t.root.getAttribute("data-splide");if(n)try{t.options=JSON.parse(n)}catch(t){C('"data-splide" must be a valid JSON.')}return{mount:function(){t.index=t.options.start},fix:function(e){var i=a(t.options,e),o=i.breakpoints;o&&r(o,function(t,n){i.breakpoints[n]=a(o[n],e)}),t.options=i}}}function L(e){var i=e.root,o=e.classes;if(!i.id){var t=window[W]||0;window[W]=++t,i.id="splide"+(t<10?"0"+t:t)}var r={mount:function(){var t="was not found.";this.track=c(i,o.track),E(this.track,"A track "+t),this.list=c(this.track,o.list),E(this.list,"A list "+t),this.slides=s(this.list.children),E(this.slides.length,"A slide "+t);var n=a(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var e=a(o.autoplay);this.bar=f(a(o.progress),"."+o.bar),this.play=f(e,"."+o.play),this.pause=f(e,"."+o.pause),function(){r.track.id||(r.track.id=i.id+"-track");r.list.id||(r.list.id=i.id+"-list")}()},mounted:function(){var t=o.root,n=e.options;g(i,""+t,t+"--"+n.type,t+"--"+n.direction,n.drag?t+"--draggable":"",n.isNavigation?t+"--nav":"")}};function a(t){return c(i,t)||c(r.track,t)}return r}var T=function(){function t(t,n,e){var i=this;void 0===n&&(n={}),void 0===e&&(e={}),this.root=t instanceof HTMLElement?t:f(document,t),E(this.root,"An invalid root element or selector was given."),this.Components={},this.Event=function(){var e={};return{on:function(t,n){t.split(" ").forEach(function(t){e[t]||(e[t]=[]),e[t].push(n)})},off:function(t){t.split(" ").forEach(function(t){return delete e[t]})},emit:function(i){for(var t=arguments.length,o=new Array(1<t?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];r(e,function(t,n){if(n.split(".")[0]===i&&t)for(var e in t)t[e].apply(t,o)})}}}(),this.State=function(t){var n=t;return{set:function(t){n=t},is:function(t){return t===n}}}(1),this._options=a(d,n),this._index=0,this._components=e,this.on("move drag",function(){return i.State.set(3)}).on("moved dragged",function(){return i.State.set(2)})}var n=t.prototype;return n.mount=function(t,n){var i=this;void 0===t&&(t={}),void 0===n&&(n=null),this.Components=function(e,t,n){var i={};return r(t,function(t,n){i[n]=t(e,i,n.toLowerCase())}),n=n||e.is(k)?S:w,i.Transition=n(e,i),i}(this,a(this._components,t),n);try{r(this.Components,function(t,n){var e=t.required;void 0===e||e?t.mount&&t.mount():delete i.Components[n]})}catch(t){return C(t.message),null}return r(this.Components,function(t){t.mounted&&t.mounted()}),this.State.set(2),this.emit("mounted"),this.State.set(2),this.emit("ready"),h(this.root,{visibility:"visible"}),this},n.sync=function(t){return this.sub=t,this},n.on=function(t,n){return this.Event.on(t,n),this},n.off=function(t){return this.Event.off(t),this},n.emit=function(t){for(var n,e=arguments.length,i=new Array(1<e?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return(n=this.Event).emit.apply(n,[t].concat(i)),this},n.go=function(t,n){void 0===n&&(n=!0),(this.State.is(2)||this.State.is(3)&&!n)&&this.Components.Controller.go(t,!1)},n.is=function(t){return t===this._options.type},function(t,n,e){n&&I(t.prototype,n),e&&I(t,e)}(t,[{key:"index",get:function(){return this._index},set:function(t){this._index=parseInt(t)}},{key:"length",get:function(){return this.Components.Slides.length}},{key:"options",get:function(){return this._options},set:function(t){this._options=a(this._options,t),this.State.is(1)||this.emit("updated",this._options)}},{key:"classes",get:function(){return this._options.classes}},{key:"i18n",get:function(){return this._options.i18n}}]),t}(),W="splideUid";function H(t,n,e){return Math.min(Math.max(t,e<n?e:n),e<n?n:e)}function O(t){for(var n=arguments.length,e=new Array(1<n?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];var o=0;return t.replace(/%s/g,function(){return e[o++]})}function j(t){var n=typeof t;return"string"==n?t:"number"==n&&0<t?parseFloat(t)+"px":""}function A(t,n){if("number"==typeof n)return n;var e=p("div",{});h(e,{position:"absolute",width:n}),t.appendChild(e);var i=e.clientWidth;return t.removeChild(e),i}function q(r,i){var o,n={mount:function(){o=r.options,r.on("move",function(t){r.index=t}).on("updated",function(t){o=t,r.index=n.rewind(n.trim(r.index))})},go:function(t,n){var e=this.trim(this.parse(t));i.Track.go(e,this.rewind(e),n)},parse:function(t){var n=r.index,e=String(t).match(/([+\-<>])(\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(-1<o?o:this.indexToPage(n)+1);break;case"<":n=this.pageToIndex(-1<o?o:this.indexToPage(n)-1);break;default:n=parseInt(t)}return n},pageToIndex:function(t){if(!1!==o.focus)return t;var n=r.length,e=o.perPage,i=t*e;return n-e<=(i-=(this.pageLength*e-n)*z(i/n))&&i<n&&(i=n-e),i},indexToPage:function(t){if(!1!==o.focus)return t;var n=r.length,e=o.perPage;return z(n-e<=t&&t<n?(n-1)/e:t/e)},trim:function(t){return r.is(_)||(t=o.rewind?this.rewind(t):H(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(_)){for(;n<t;)t-=n+1;for(;t<0;)t+=n+1}else n<t?t=0:t<0&&(t=n);return t},isRtl:function(){return"rtl"===o.direction},get pageLength(){var t=r.length;return!1!==o.focus?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return!1!==o.focus||o.isNavigation||r.is(_)?t-1:t-o.perPage},get prevIndex(){var t=this.parse("-");return(r.is(_)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=this.parse("+");return(r.is(_)||o.rewind)&&(t=this.rewind(t)),r.index<t&&t<=this.edgeIndex||0===t?t:-1}};return n}var z=Math.floor;function R(o,r){var e=[],a=[];return{mount:function(){for(var t in e=r.Elements.slides)this.register(parseInt(t),-1,e[t])},register:function(t,n,e){var i=function(u,t,o,d){return{slide:o,index:u,realIndex:t,container:f(o,"."+d.classes.container),isClone:-1<t,init:function(){var t=this;if(!o.id&&!this.isClone){var n=u+1;o.id=d.root.id+"-slide"+(n<10?"0"+n:n)}d.on("mounted moved updated",function(){t.update(t.isActive(),!1),t.update(t.isVisible(),!0)})},update:function(t,n){var e=n?"visible":"active",i=l[e];t?(g(o,i),d.emit(e,this)):m(o,i)&&(v(o,i),d.emit(n?"hidden":"inactive",this))},isActive:function(){return d.index===u},isVisible:function(){var t=d.options,n=t.focus,e=t.perPage,i=t.trimSpace,o=d.index,r=d.length,a="center"===n,s=a?e/2:parseInt(n)||0;if(i){if(o<s)return u<e;if(r-(e-s)<=o)return r-e<=u}return o-s+(a&&e%2==0?1:0)<=u&&u<o+e-s},isWithin:function(t,n){var e=Math.abs(t-u);return d.is("slide")||this.isClone||(e=Math.min(e,d.length-e)),e<n}}}(t,n,e,o);i.init(),a.push(i)},getSlide:function(n){return a.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?a:a.filter(function(t){return!t.isClone}):t?a.map(function(t){return t.slide}):e},getSlidesByPage:function(t){var e=r.Controller.pageToIndex(t),n=o.options,i=!1!==n.focus?1:n.perPage;return a.filter(function(t){var n=t.index;return e<=n&&n<e+i})},get length(){return e.length},get total(){return a.length}}}function B(a,s){var o,n,u=0,e="ttb"===a.options.direction;return{mount:function(){o=s.Elements.list,n=e?function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*(s.slideHeight+s.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(s.slideHeight+s.gap))},trim:function(t){return H(t,-(s.listHeight-(s.height+s.gap)),0)},get offset(){var t,n=s.height,e=s.slideHeight,i=s.gap,o=r.options.focus;return t="center"===o?(n-e)/2:(parseInt(o)||0)*(e+i),(e+i)*a.Clones.length/2-t}}}(a,s):function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*(s.slideWidth+s.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(s.slideWidth+s.gap))},trim:function(t){return H(t,this.sign*(s.listWidth-(s.width+s.gap)),0)},get sign(){return a.Controller.isRtl()?1:-1},get offset(){var t,n=s.width,e=s.slideWidth,i=s.gap,o=r.options.focus;return t="center"===o?(n-e)/2:(parseInt(o)||0)*(e+i),(e+i)*a.Clones.length/2-t}}}(a,s)},mounted:function(){var t=this;a.is(k)||a.on("mounted resize updated",function(){t.jump(a.index)})},go:function(t,n,e){var i=this,o=this.trim(this.toPosition(t)),r=a.index;e||a.emit("move",n,r,t),1<=Math.abs(o-u)||a.is(k)?s.Transition.start(t,n,this.toCoord(o),function(){i.end(t,n,r,e)}):this.end(t,n,r,e)},end:function(t,n,e,i){h(o,{transition:""}),a.is(k)||this.jump(n),i||a.emit("moved",n,e,t)},jump:function(t){var n=this.trim(this.toPosition(t));this.translate(n)},translate:function(t){u=t,n.translate(o,t)},toPosition:function(t){return n.toPosition(t)},toIndex:function(t){return n.toIndex(t)},trim:function(t){return!a.options.trimSpace||a.is(_)?t:n.trim(t)},toCoord:function(t){return{x:e?0:t,y:e?t:0}},get position(){return u},get offset(){return n.offset}}}function N(c,l){var f=[];function p(t){var n=t.cloneNode(!0);return g(n,c.classes.clone),x(n,"id"),n}return{mount:function(){c.is(_)&&function(){var i=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,e=t.drag,r=t.flickMaxPages,a=void 0===r?1:r,s=i.length,u=n*(e?a+1:1)+(s<n?n:0),d=i.getSlides(!1,!1);for(;d.length<u;)d=d.concat(d);d.slice(0,u).forEach(function(t,n){var e=p(t);o.appendChild(e),f.push(e),i.register(n+s,n,e)}),d.slice(-u).forEach(function(t,n){var e=p(t);o.insertBefore(e,d[0]),f.push(e),i.register(n-u,n,e)})}()},get clones(){return f},get length(){return f.length}}}function F(i,a){var s,u,d,o=i.root,r="ttb"===i.options.direction,t=a.Elements,c={mount:function(){s=t.list,u=a.Slides.getSlides(!0,!0),function(){var t=function(t,n){var e=null;return function(){e=e||setTimeout(function(){t(),e=null},n)}}(function(){i.emit("resize")},30);b(window,"resize",t),i.on("mounted resize",l).on("updated",n),r||i.on("resize",e)}(),n()},get width(){return d.width},get height(){return d.height},get listWidth(){return d.listWidth},get listHeight(){return d.listHeight},get slideWidth(){return d.slideWidth},get slideHeight(){return d.slideHeight},get gap(){return d.gap},get padding(){return d.padding}};function n(){var t=i.options;for(var n in(d=r?function(n,t,e){var i=t.Elements,o=i.track;return{marginProp:"marginBottom",init:function(){var t=e.padding;t&&("object"!=typeof t&&(t={top:t,bottom:t}),h(o,{paddingTop:j(t.top),paddingBottom:j(t.bottom)}))},get width(){return o.clientWidth},get height(){var t=e.height||this.width*e.heightRatio;return E(t,'"height" or "heightRatio" must be given in TTB mode.'),A(n.root,t)},get listWidth(){return this.width},get listHeight(){return(this.slideHeight+this.gap)*t.Slides.total},get slideWidth(){return A(n.root,e.fixedWidth||this.width)},get slideHeight(){var t=e.fixedHeight;return t=t||(this.height+this.gap)/e.perPage-this.gap,A(n.root,t)},get gap(){var t=getComputedStyle(i.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(o);return{top:parseFloat(t.paddingTop)||0,bottom:parseFloat(t.paddingBottom)||0}}}}(i,a,t):function(n,t,e){var i=t.Elements,o=i.track;return{marginProp:"rtl"===e.direction?"marginLeft":"marginRight",height:0,listHeight:0,init:function(){var t=e.padding;t&&("object"!=typeof t&&(t={left:t,right:t}),h(o,{paddingLeft:j(t.left),paddingRight:j(t.right)}))},get width(){return o.clientWidth-this.padding.left-this.padding.right},get listWidth(){return(this.slideWidth+this.gap)*t.Slides.total},get slideWidth(){var t=e.fixedWidth;return t=t||(this.width+this.gap)/e.perPage-this.gap,A(n.root,t)},get slideHeight(){var t=e.height||e.fixedHeight||this.width*e.heightRatio;return A(n.root,t)},get gap(){var t=getComputedStyle(i.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(o);return{left:parseFloat(t.paddingLeft)||0,right:parseFloat(t.paddingRight)||0}}}}(i,a,t)).init(),h(o,{maxWidth:j(t.width)}),u){var e;h(u[n].slide,((e={})[d.marginProp]=j(t.gap),e))}l()}function l(){h(s,{width:j(c.listWidth),height:j(c.listHeight)}),h(a.Elements.track,{height:j(c.height)});var t=j(d.slideWidth),n=j(d.slideHeight);for(var e in u){var i=u[e],o=i.slide,r=i.container;h(r,{height:n}),h(o,{width:t,height:r?"":n})}}function e(){var t=i.options;if(t.fixedWidth){var n=Math.floor((c.width+d.gap)/(c.slideWidth+d.gap))||1;t.perPage!==n&&(i.options={perPage:n})}}return c}function D(u,d){var e,i,o,c=d.Track,l=d.Controller,r=!1,a="ttb"===u.options.direction,f=a?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;b(t,"touchstart mousedown",s),b(t,"touchmove mousemove",p,!1),b(t,"touchend touchcancel mouseleave mouseup dragend",h)}};function s(t){n.disabled||r||!u.State.is(2)||(e=c.toCoord(c.position),i=g(t,{}),o=i)}function p(t){if(i)if(o=g(t,i),r){t.cancelable&&t.preventDefault();var n=e[f]+o.offset[f];c.translate(function(t){if(!u.is(_)){var n=c.trim,e=c.toPosition,i=l.isRtl()?-1:1,o=i*n(e(0)),r=i*n(e(l.edgeIndex));o<(t*=i)?t=5*Math.log(t-o)+o:t<r&&(t=-5*Math.log(r-t)+r),t*=i}return t}(n))}else!function(t){var n=t.offset;if(u.State.is(2)){var e=180*Math.atan(Math.abs(n.y)/Math.abs(n.x))/Math.PI;return a&&(e=90-e),e<30}return!1}(o)||(u.emit("drag",i),r=!0)}function h(){i=null,r&&(u.emit("dragged",o),function(t){var n=t.velocity[f],e=Math.abs(n);if(0<e){var i=d.Layout,o=u.options,r=n<0?-1:1,a=c.position;e>o.flickThreshold&&Math.abs(t.offset[f])<150&&(a+=r*Math.min(e*o.flickPower,i.width*(o.flickMaxPages||1)));var s=c.toIndex(a);s===u.index&&(s+=l.isRtl()?r:-r),u.is(_)||(s=H(s,0,l.edgeIndex)),l.go(s,o.isNavigation)}}(o),r=!1)}function g(t,n){var e=t.timeStamp,i=t.touches,o=i?i[0]:t,r=o.clientX,a=o.clientY,s=n.to||{},u=s.x,d=void 0===u?r:u,c=s.y,l=void 0===c?a:c,f={x:r-d,y:a-l},p=e-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:a},offset:f,timeStamp:e,velocity:{x:f.x/p,y:f.y/p}}}return n}function X(o,r,a){var s,e=[],u={required:o.options.autoplay,mount:function(){var t=o.options,n=r.Elements,e=n.slides,i=n.bar;e.length>t.perPage&&(s=function(n,e,i){function o(t){d||(s=(a=t-(r=r||t))/e,e<=a&&(r=0,s=1,n()),i&&i(s),u(o))}var r,a,s,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(a+":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",V,!0),d(i,"mouseenter",V,!1));t.pauseOnFocus&&(d(i,"focusout",Y,!0),d(i,"focusin",Y,!1));b(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(a+":play"),s.play())},pause:function(t){void 0===t&&(t=0),s.pause(),-1===e.indexOf(t)&&e.push(t),1===e.length&&o.emit(a+":pause")}};function d(t,n,e,i){for(var o in t)b(t[o],n,function(){u[i?"play":"pause"](e)})}return u}function G(s,u,d){var c,i=s.classes,n=s.root;function o(t){var n=p("button",{class:i.arrow+" "+(t?i.prev:i.next)});return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg"\tviewBox="0 0 40 40"\twidth="40"\theight="40"><path d="'+(s.options.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")+'" /></svg>',n}return{required:s.options.arrows,mount:function(){var t=u.Elements;(c=t.arrows).prev&&c.next||!s.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=s.options.perMove;b(c.prev,"click",function(){s.go(t?"-"+t:"<")}),b(c.next,"click",function(){s.go(t?"+"+t:">")})}(),s.on("mounted move updated",function(){var t=c,n=t.prev,e=t.next,i=u.Controller,o=i.prevIndex,r=i.nextIndex,a=1<s.length;n.disabled=o<0||!a,e.disabled=r<0||!a,s.emit(d+":updated",n,e,o,r)})),this.arrows=c},mounted:function(){s.emit(d+":mounted",c.prev,c.next)}}}function U(s,e,o){var r={},a={required:s.options.pagination,mount:function(){r=function(){var n=s.options,o=s.classes,r=p("ul",{class:o.pagination}),a=e.Slides,t=a.getSlides(!1,!0).filter(function(t){return!1!==n.focus||t.index%n.perPage==0}).map(function(t,n){var e=p("li",{}),i=p("button",{class:o.page});return e.appendChild(i),r.appendChild(e),b(i,"click",function(){s.go(">"+n)}),{li:e,button:i,page:n,Slides:a.getSlidesByPage(n)}});return{list:r,items:t}}();var t=s.root;"top"===s.options.pagination?t.insertBefore(r.list,e.Elements.track):t.appendChild(r.list),s.on(Q,n).on("updated.page",function(){a.destroy(),console.log(s.options.pagination,s.options.height),s.options.pagination&&(a.mount(),a.mounted())})},mounted:function(){var t=s.index;s.emit(o+":mounted",r,this.getItem(t)),n(t,-1)},destroy:function(){r&&r.list&&s.root.removeChild(r.list),s.off(Q),r=null},getItem:function(t){return r.items[e.Controller.indexToPage(t)]},get data(){return r}};function n(t,n){var e=a.getItem(n),i=a.getItem(t);e&&v(e.button,l.active),i&&g(i.button,l.active),s.emit(o+":updated",r,e,i)}return a}function J(s,i){var u,d,c=s.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=s.index,r=-1<e&&o<e?c.last:c.prev,a=-1<i&&i<o?c.first:c.next;u.innerHTML=r,d.innerHTML=a,y(t,et,r),y(n,et,a)}function o(t,n){n&&y(n.button,tt,!0),t.items.forEach(function(t){var n=s.options,e=O(!1===n.focus&&1<n.perPage?c.pageX:c.slideX,t.page+1),i=f(e),o=t.button,r=[];o.appendChild(i),t.Slides.forEach(function(t){r.push(t.slide.id)}),y(o,nt,r.join(" ")),y(o,et,e)})}function r(t,n,e){n&&x(n.button,tt),e&&y(e.button,tt,!0)}function a(r){i.Slides.getSlides(!0,!0).forEach(function(t){var n=t.slide;"button"!==n.tagName.toLowerCase()&&y(n,"role","button");var e=t.realIndex,i=O(c.slideX,e+1),o=r.Components.Slides.getSlide(e);y(n,et,i),n.appendChild(f(i)),o&&y(n,nt,o.slide.id)})}function l(t,n){var e=t.slide;n?y(e,tt,!0):x(e,tt)}function f(t){var n=p("span",{class:s.classes.sr});return n.textContent=t,n}return{required:s.options.accessibility,mount:function(){s.on("visible",function(t){n(t.slide,!0)}).on("hidden",function(t){n(t.slide,!1)}).on("arrows:mounted",t).on("arrows:updated",e).on("pagination:mounted",o).on("pagination:updated",r),s.options.isNavigation&&s.on("navigation:mounted",a).on("active",function(t){l(t,!0)}).on("inactive",function(t){l(t,!1)})}}}var V=1,Y=2,K=3,Q="move.page",Z="data-splide-lazy",$={horizontal:{ArrowLeft:"<",ArrowRight:">",Left:"<",Right:">"},vertical:{ArrowUp:"<",ArrowDown:">",Up:"<",Down:">"}},tt="aria-current",nt="aria-controls",et="aria-label",it="move.sync",ot=[" ","Enter","Spacebar"],rt={Options:M,Elements:L,Controller:q,Slides:R,Track:B,Clones:N,Layout:F,Drag:D,Autoplay:X,Cover:function(t,n){var e=t.options;function i(t){var n=t.parentElement;n&&(h(n,{background:'center/cover no-repeat url("'+t.src+'")'}),h(t,{display:"none"}))}return{required:e.cover&&(e.height||e.heightRatio||e.fixedHeight),mount:function(){n.Slides.getSlides(!0,!1).forEach(function(t){var n=f(t,"img");n&&n.src&&i(n)}),t.on("lazyload:loaded",function(t){i(t)})}}},Arrows:G,Pagination:U,LazyLoad:function(o,t,r){var n=0,i=[],e=o.options.lazyLoad,a="sequential"===e;function s(n){var e=o.options;(i=i.filter(function(t){return!t.Slide.isWithin(n,e.perPage*(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<i.length){var t=i[n];u(t.img,t.Slide)}n++}function c(t,n,e,i){v(e.slide,l.loading),i||(t.parentElement.removeChild(n),h(t,{visibility:"visible"}),o.emit(r+":loaded",t)),a&&d()}return{required:e,mount:function(){t.Slides.getSlides(!0,!0).forEach(function(t){var n=f(t.slide,"["+Z+"]");n&&i.push({img:n,Slide:t})}),i.length&&(a?d():o.on("mounted",function(){s(o.index)}).on("moved."+r,function(t){s(t)}))}}},Keyboard:function(e){var t;return{mount:function(){var n=$["ttb"===e.options.direction?"vertical":"horizontal"];e.on("mounted updated",function(){t&&(t[0](),t=void 0),e.options.keyboard&&(t=b(e.root,"keydown",function(t){n[t.key]&&e.go(n[t.key])}))})}}},Sync:function(i){var o=i.sub;function r(){i.on(it,function(t,n,e){o.off(it).go(o.is(_)?e:t,!1),a()})}function a(){o.on(it,function(t,n,e){i.off(it).go(i.is(_)?e:t,!1),r()})}function e(t){i.State.is(2)&&o.go(t)}return{required:!!o,mount:function(){r(),a(),o.options.isNavigation&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;b(t,"mouseup touchend",function(t){t.button&&0!==t.button||e(n.index)}),b(t,"keyup",function(t){-1<ot.indexOf(t.key)&&(t.preventDefault(),e(n.index))},!1)})}}},A11y:J,Breakpoints:function(n){var e,i,o=n.options.breakpoints,r=[];return{required:o&&matchMedia,mount:function(){r=Object.keys(o).sort(function(t,n){return parseInt(t)-parseInt(n)}).map(function(t){return{point:t,mql:matchMedia("(max-width:"+t+"px)")}}),n.on("mounted resize",function(){var t=function(){var t=r.filter(function(t){return t.mql.matches})[0];return t?t.point:-1}();t!==i&&(n.options=o[t]||e,i=t)})},mounted:function(){e=n.options}}}};function at(t,n){return void 0===n&&(n={}),new T(t,n,rt)}e.d(n,"default",function(){return at}),window.splide=at}],o.c=i,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)o.d(e,i,function(t){return n[t]}.bind(null,i));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=0);function o(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var e,i}); |
{ | ||
"name": "@splidejs/splide", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "Splide is a lightweight and powerful slider without any dependencies.", | ||
@@ -5,0 +5,0 @@ "author": "Naotoshi Fujita", |
@@ -95,3 +95,3 @@ /** | ||
Splide.off( ATTRIBUTES_UPDATE_EVENT ).off( UPDATE_EVENT ); | ||
Splide.off( ATTRIBUTES_UPDATE_EVENT ); | ||
data = null; | ||
@@ -98,0 +98,0 @@ }, |
@@ -27,3 +27,3 @@ /** | ||
*/ | ||
export const IDLE = 2; | ||
export const IDLE = 3; | ||
@@ -35,2 +35,2 @@ /** | ||
*/ | ||
export const MOVING = 3; | ||
export const MOVING = 4; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
172020
0