Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@splidejs/splide

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@splidejs/splide - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

dist/css/themes/splide-default.min.css

2

dist/js/splide.min.js

@@ -7,2 +7,2 @@ /*!

*/
!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 a(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function s(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]=s(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,fixedWidth:0,fixedHeight:0,heightRatio:0,perView:1,perMove:0,start:0,focus:0,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:!0,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=a(t.children);for(var i in e){var o=e[i];if(m(o,n))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||null})}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 w(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 b(a,u){return{start:function(t,n,e,i){var o=u.Elements.list,r=a.options,s=w(o,"transitionend",function(){i(),s[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({perView: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 C="[SPLIDE]";function E(t){console.error(C+" "+t)}function P(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){E('"data-splide" must be a valid JSON.')}return{mount:function(){t.index=t.options.start},fix:function(e){var i=s(t.options,e),o=i.breakpoints;o&&r(o,function(t,n){i.breakpoints[n]=s(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),P(this.track,"A track "+t),this.list=c(this.track,o.list),P(this.list,"A list "+t),this.slides=a(this.list.children),P(this.slides.length,"A slide "+t);var n=s(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var e=s(o.autoplay);this.bar=f(s(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 s(t){return c(i,t)||c(r.track,t)}return r}var H=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),P(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=s(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:b,i.Transition=n(e,i),i}(this,s(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 E(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=s(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 O(t,n,e){return Math.min(Math.max(t,e<n?e:n),e<n?n:e)}function T(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(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(o.focus)return t;var n=r.length,e=o.perView,i=t*e;return n-e<=(i-=(this.pageLength*e-n)*V(i/n))&&i<n&&(i=n-e),i},indexToPage:function(t){if(o.focus)return t;var n=r.length,e=o.perView;return V(n-e<=t&&t<n?(n-1)/e:t/e)},trim:function(t){return r.is(_)||(t=o.rewind?this.rewind(t):O(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 o.focus?t:Math.ceil(t/o.perView)},get edgeIndex(){var t=r.length;return o.focus||o.isNavigation||r.is(_)?t-1:t-o.perView},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 V=Math.floor;function q(o,r){var e=[],s=[];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.perView,i=t.trimSpace,o=d.index,r=d.length,s="center"===n,a=s?e/2:parseInt(n)||0;if(i){if(o<a)return u<e;if(r-(e-a)<=o)return r-e<=u}return o-a+(s&&e%2==0?1:0)<=u&&u<o+e-a},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(),s.push(i)},getSlide:function(n){return s.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?s:s.filter(function(t){return!t.isClone}):t?s.map(function(t){return t.slide}):e},getSlidesByPage:function(t){var e=r.Controller.pageToIndex(t),n=o.options,i=n.focus?1:n.perView;return s.filter(function(t){var n=t.index;return e<=n&&n<e+i})},get length(){return e.length},get total(){return s.length}}}function z(s,a){var o,n,u=0,e="ttb"===s.options.direction;return{mount:function(){o=a.Elements.list,n=e?function(r,s){var a=s.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*a.slideHeight+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/a.slideHeight)},trim:function(t){return O(t,-(a.listHeight-r.options.perView*a.slideHeight),0)},get offset(){var t,n=a.listHeight,e=a.slideHeight,i=a.gap,o=r.options.focus;return t="center"===o?(n-e+i)/2:parseInt(o||0)*e,e*s.Clones.length/2-t}}}(s,a):function(r,s){var a=s.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*a.slideWidth+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/a.slideWidth)},trim:function(t){return O(t,this.sign*(a.listWidth-(a.width+a.gap)),0)},get sign(){return s.Controller.isRtl()?1:-1},get offset(){var t,n=a.width,e=a.slideWidth,i=a.gap,o=r.options.focus;return t="center"===o?(n-e+i)/2:parseInt(o||0)*e,e*s.Clones.length/2-t}}}(s,a)},mounted:function(){var t=this;s.is(k)||s.on("mounted resize updated",function(){t.jump(s.index)})},go:function(t,n,e){var i=this,o=this.trim(this.toPosition(t)),r=s.index;e||s.emit("move",n,r,t),1<=Math.abs(o-u)||s.is(k)?a.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:""}),s.is(k)||this.jump(n),i||s.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!s.options.trimSpace||s.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 R(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.perView,e=t.drag,r=t.flickMaxPages,s=void 0===r?1:r,a=i.length,u=n*(e?s+1:1)+(a<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+a,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 N(i,o){var s,a,u,r=i.root,d="ttb"===i.options.direction,c={mount:function(){s=o.Elements.list,a=o.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);w(window,"resize",t),i.on("mounted resize",l).on("updated",n),d||i.on("resize",e)}(),n()},get width(){return u.width},get listWidth(){return u.listWidth},get listHeight(){return u.listHeight},get slideWidth(){return u.getSlideWidth(!0)},get slideHeight(){return u.getSlideHeight(!0)},get gap(){return u.gap},get padding(){return u.padding}};function n(){var t=i.options;for(var n in(u=d?function(t,n,r){var e=n.Elements,s=e.track;return{marginProp:"marginBottom",init:function(){var t=r.padding,n=t.top,e=void 0===n?0:n,i=t.bottom,o=void 0===i?0:i;h(s,{paddingTop:j(e),paddingBottom:j(o)})},getSlideWidth:function(){return this.width},getSlideHeight:function(t){var n=(this.listHeight+this.gap)/r.perView;return t?n:n-this.gap},get width(){return s.clientWidth},get listWidth(){return this.width},get listHeight(){var t=r.heightRatio,n=r.height;return 0<t&&(n=this.width*t),n-this.padding.top-this.padding.bottom},get gap(){var t=getComputedStyle(e.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(s);return{top:parseFloat(t.paddingTop)||0,bottom:parseFloat(t.paddingBottom)||0}}}}(0,o,t):function(t,n,r){var e=n.Elements,s=e.track;return{marginProp:"rtl"===r.direction?"marginLeft":"marginRight",listHeight:0,init:function(){var t=r.padding,n=t.left,e=void 0===n?0:n,i=t.right,o=void 0===i?0:i;h(s,{paddingLeft:j(e),paddingRight:j(o)})},getSlideWidth:function(t){var n=r.fixedWidth;if(n)return t?n+this.gap:n;var e=(this.width+this.gap)/r.perView;return t?e:e-this.gap},getSlideHeight:function(){var t=r.heightRatio;return 0<t?this.width*t:r.fixedHeight},get width(){return s.clientWidth-this.padding.left-this.padding.right},get listWidth(){return this.getSlideWidth(!0)*n.Slides.total},get gap(){var t=getComputedStyle(e.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(s);return{left:parseFloat(t.paddingLeft)||0,right:parseFloat(t.paddingRight)||0}}}}(0,o,t)).init(),h(r,{maxWidth:j(t.width)}),a){var e;h(a[n].slide,((e={})[u.marginProp]=j(t.gap),e))}l()}function l(){h(s,{width:j(c.listWidth),height:j(c.listHeight)});var t=j(u.getSlideWidth(!1)),n=j(u.getSlideHeight(!1));for(var e in a){var i=a[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+u.gap)/c.slideWidth)||1;t.perView!==n&&(i.options={perView:n})}}return c}function B(u,d){var e,i,o,c=d.Track,l=d.Controller,r=!1,s="ttb"===u.options.direction,f=s?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;w(t,"touchstart mousedown",a),w(t,"touchmove mousemove",p,!1),w(t,"touchend touchcancel mouseleave mouseup dragend",h)}};function a(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 s&&(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,s=c.position;e>o.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='<svg xmlns="http://www.w3.org/2000/svg"\tviewBox="0 0 20 20"\twidth="20"\theight="20"><path d="'+(a.options.arrowPath||"m7.61 0.807-2.12 2.12 7.11 7.07-7.11 7.1 2.12 2.1 7.09-7.1 2.1-2.1-2.1-2.12-7.09-7.07z")+'" /></svg>',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<e&&o<e?c.last:c.prev,s=-1<i&&i<o?c.first:c.next;u.innerHTML=r,d.innerHTML=s,y(t,et,r),y(n,et,s)}function o(t,n){n&&y(n.button,tt,!0),t.items.forEach(function(t){var n=a.options,e=T(!n.focus&&1<n.perView?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 s(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=T(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:a.classes.sr});return n.textContent=t,n}return{required:a.options.accessibility,mount:function(){a.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),a.options.isNavigation&&a.on("navigation:mounted",s).on("active",function(t){l(t,!0)}).on("inactive",function(t){l(t,!1)})}}}var J=1,Y=2,K=3,U="move.page",Q="updated.page",Z="data-splide-lazy",$={ArrowLeft:"<",ArrowRight:">",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<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)),s&&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&&(s?d():o.on("mounted",function(){a(o.index)}).on("moved."+r,function(t){a(t)}))}}},Keyboard:function(n){var t;return{mount:function(){n.on("mounted updated",function(){t&&(t[0](),t=void 0),n.options.keyboard&&(t=w(n.root,"keydown",function(t){$[t.key]&&n.go($[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),s()})}function s(){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(),s(),o.options.isNavigation&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;w(t,"mouseup touchend",function(t){t.button&&0!==t.button||e(n.index)}),w(t,"keyup",function(t){-1<ot.indexOf(t.key)&&(t.preventDefault(),e(n.index))},!1)})}}},A11y:G,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 H(t,n,rt)}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,fixedWidth:0,fixedHeight:0,heightRatio:0,perPage:1,perMove:0,start:0,focus:0,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:!0,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 g(e,t){e&&r(t,function(t,n){e.style[n]=t||null})}function h(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(){i(),a[0]()});g(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&&g(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)},console.log(n),console.log(this.arrows);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;h(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 H=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"),g(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 O(t,n,e){return Math.min(Math.max(t,e<n?e:n),e<n?n:e)}function T(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(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(o.focus)return t;var n=r.length,e=o.perPage,i=t*e;return n-e<=(i-=(this.pageLength*e-n)*q(i/n))&&i<n&&(i=n-e),i},indexToPage:function(t){if(o.focus)return t;var n=r.length,e=o.perPage;return q(n-e<=t&&t<n?(n-1)/e:t/e)},trim:function(t){return r.is(_)||(t=o.rewind?this.rewind(t):O(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 o.focus?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return 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 q=Math.floor;function z(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?(h(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=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 R(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){g(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*s.slideHeight+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/s.slideHeight)},trim:function(t){return O(t,-(s.listHeight-r.options.perPage*s.slideHeight),0)},get offset(){var t,n=s.listHeight,e=s.slideHeight,i=s.gap,o=r.options.focus;return t="center"===o?(n-e+i)/2:parseInt(o||0)*e,e*a.Clones.length/2-t}}}(a,s):function(r,a){var s=a.Layout;return{translate:function(t,n){g(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*s.slideWidth+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/s.slideWidth)},trim:function(t){return O(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+i)/2:parseInt(o||0)*e,e*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){g(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 h(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 B(i,o){var a,s,u,r=i.root,d="ttb"===i.options.direction,c={mount:function(){a=o.Elements.list,s=o.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),d||i.on("resize",e)}(),n()},get width(){return u.width},get listWidth(){return u.listWidth},get listHeight(){return u.listHeight},get slideWidth(){return u.getSlideWidth(!0)},get slideHeight(){return u.getSlideHeight(!0)},get gap(){return u.gap},get padding(){return u.padding}};function n(){var t=i.options;for(var n in(u=d?function(t,n,r){var e=n.Elements,a=e.track;return{marginProp:"marginBottom",init:function(){var t=r.padding,n=t.top,e=void 0===n?0:n,i=t.bottom,o=void 0===i?0:i;g(a,{paddingTop:j(e),paddingBottom:j(o)})},getSlideWidth:function(){return this.width},getSlideHeight:function(t){var n=(this.listHeight+this.gap)/r.perPage;return t?n:n-this.gap},get width(){return a.clientWidth},get listWidth(){return this.width},get listHeight(){var t=r.heightRatio,n=r.height;return 0<t&&(n=this.width*t),n-this.padding.top-this.padding.bottom},get gap(){var t=getComputedStyle(e.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(a);return{top:parseFloat(t.paddingTop)||0,bottom:parseFloat(t.paddingBottom)||0}}}}(0,o,t):function(t,n,r){var e=n.Elements,a=e.track;return{marginProp:"rtl"===r.direction?"marginLeft":"marginRight",listHeight:0,init:function(){var t=r.padding,n=t.left,e=void 0===n?0:n,i=t.right,o=void 0===i?0:i;g(a,{paddingLeft:j(e),paddingRight:j(o)})},getSlideWidth:function(t){var n=r.fixedWidth;if(n)return t?n+this.gap:n;var e=(this.width+this.gap)/r.perPage;return t?e:e-this.gap},getSlideHeight:function(){var t=r.heightRatio;return 0<t?this.width*t:r.fixedHeight},get width(){return a.clientWidth-this.padding.left-this.padding.right},get listWidth(){return this.getSlideWidth(!0)*n.Slides.total},get gap(){var t=getComputedStyle(e.slides[0]);return parseFloat(t[this.marginProp])||0},get padding(){var t=getComputedStyle(a);return{left:parseFloat(t.paddingLeft)||0,right:parseFloat(t.paddingRight)||0}}}}(0,o,t)).init(),g(r,{maxWidth:j(t.width)}),s){var e;g(s[n].slide,((e={})[u.marginProp]=j(t.gap),e))}l()}function l(){g(a,{width:j(c.listWidth),height:j(c.listHeight)});var t=j(u.getSlideWidth(!1)),n=j(u.getSlideHeight(!1));for(var e in s){var i=s[e],o=i.slide,r=i.container;g(r,{height:n}),g(o,{width:t,height:r?"":n})}}function e(){var t=i.options;if(t.fixedWidth){var n=Math.floor((c.width+u.gap)/c.slideWidth)||1;t.perPage!==n&&(i.options={perPage:n})}}return c}function F(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",g)}};function s(t){n.disabled||r||!u.State.is(2)||(e=c.toCoord(c.position),i=h(t,{}),o=i)}function p(t){if(i)if(o=h(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 g(){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)):a+=r*i.slideWidth/2;var s=c.toIndex(a);u.is(_)||(s=O(s,0,l.edgeIndex)),l.go(s,o.isNavigation)}}(o),r=!1)}function h(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&&g(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 D(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 20 20"\twidth="20"\theight="20"><path d="'+(s.options.arrowPath||"m7.61 0.807-2.12 2.12 7.11 7.07-7.11 7.1 2.12 2.1 7.09-7.1 2.1-2.1-2.1-2.12-7.09-7.07z")+'" /></svg>',n}return{required:s.options.arrows||u.Elements.arrows.prev&&u.Elements.arrows.next,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=o===r;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 G(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 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(U,n).on(Q,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(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=a.getItem(n),i=a.getItem(t);e&&v(e.button,l.active),i&&h(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=T(!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=T(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,U="move.page",Q="updated.page",Z="data-splide-lazy",$={ArrowLeft:"<",ArrowRight:">",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:z,Track:R,Clones:N,Layout:B,Drag:F,Autoplay:X,Cover:function(t,n){function e(t){var n=t.parentElement;n&&(g(n,{background:'center/cover no-repeat url("'+t.src+'")'}),g(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:D,Pagination:G,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){h(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)},g(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),g(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(n){var t;return{mount:function(){n.on("mounted updated",function(){t&&(t[0](),t=void 0),n.options.keyboard&&(t=b(n.root,"keydown",function(t){$[t.key]&&n.go($[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 H(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});

@@ -28,9 +28,19 @@ 'use strict';

const css = {
all: {
path : './src/sass/core/*.scss',
dest : './dist/css',
merge: {
filename: 'splide.css',
path : './src/sass/themes/default/*.scss',
},
},
core: {
path: './src/sass/core/splide-core.scss',
path: './src/sass/core/*.scss',
dest: './dist/css',
},
theme: {
path: './src/sass/theme/splide-theme.scss',
dest: './dist/css',
themes: {
path: [
'./src/sass/themes/default/*.scss',
],
dest: './dist/css/themes',
},

@@ -42,8 +52,10 @@ };

*/
gulp.task( 'build:js', () => {
gulp.task( 'build:js', done => {
js.forEach( path => {
return webpackStream( { config: require( path ) } )
webpackStream( { config: require( path ) } )
.pipe( rename( { suffix: '.min' } ) )
.pipe( gulp.dest( './dist/js' ) );
} );
done();
} );

@@ -54,24 +66,23 @@

*/
gulp.task( 'build:sass', () => {
let mergedStream;
gulp.task( 'build:sass', done => {
Object.values( css ).forEach( settings => {
let stream = gulp.src( settings.path );
Object.values( css ).forEach( settings => {
const stream = gulp.src( settings.path )
if ( settings.merge ) {
stream = merge( stream, gulp.src( settings.merge.path ) )
.pipe( sass() )
.pipe( concat( settings.merge.filename ) );
}
stream
.pipe( sass() )
.pipe( postcss( [
cssnano( { reduceIdents: false } ),
autoprefixer( { browsers: [ '> 5%' ] } )
autoprefixer( { overrideBrowserslist: [ '> 5%' ] } )
] ) )
.pipe( rename( { suffix: '.min' } ) )
.pipe( gulp.dest( settings.dest ) );
mergedStream = ! mergedStream ? stream : merge( mergedStream, stream );
} );
if ( mergedStream ) {
mergedStream
.pipe( concat( 'splide.min.css' ) )
.pipe( postcss( [ cssnano( { reduceIdents: false } ) ] ) )
.pipe( gulp.dest( './dist/css' ) );
}
done();
} );

@@ -78,0 +89,0 @@

{
"name": "@splidejs/splide",
"version": "1.0.0",
"version": "1.0.1",
"description": "Splide is a lightweight and powerful slider without any dependencies.",

@@ -25,20 +25,20 @@ "author": "Naotoshi Fujita",

"devDependencies": {
"@babel/core": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"autoprefixer": "^8.4.1",
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"autoprefixer": "^9.6.1",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.6",
"cssnano": "^3.10.0",
"gulp": "^3.9.1",
"cssnano": "^4.1.10",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-eslint": "^6.0.0",
"gulp-postcss": "^7.0.1",
"gulp-rename": "^1.2.2",
"gulp-postcss": "^8.0.0",
"gulp-rename": "^1.4.0",
"gulp-rollup": "^2.16.2",
"gulp-sass": "^4.0.1",
"gulp-uglify": "^3.0.0",
"gulp-sass": "^4.0.2",
"gulp-uglify": "^3.0.2",
"jest": "^24.8.0",
"merge-stream": "^2.0.0",
"uglifyjs-webpack-plugin": "^2.1.3",
"webpack": "^4.37.0",
"webpack": "^4.38.0",
"webpack-stream": "^5.2.1"

@@ -45,0 +45,0 @@ },

@@ -135,3 +135,3 @@ /**

const options = Splide.options;
const text = ! options.focus && options.perView > 1 ? i18n.pageX : i18n.slideX;
const text = ! options.focus && options.perPage > 1 ? i18n.pageX : i18n.slideX;
const label = sprintf( text, item.page + 1 );

@@ -138,0 +138,0 @@ const srt = createSrt( label );

@@ -60,3 +60,3 @@ /**

* Called when the component is mounted.
* Note that autoplay starts only if there are slides over perView number.
* Note that autoplay starts only if there are slides over perPage number.
*/

@@ -67,3 +67,3 @@ mount() {

if ( slides.length > options.perView ) {
if ( slides.length > options.perPage ) {
interval = createInterval( () => { Splide.go( '>' ) }, options.interval, rate => {

@@ -70,0 +70,0 @@ Splide.emit( `${ name }:playing`, rate );

@@ -66,9 +66,9 @@ /**

* - Max pages a flick action can move.
* - Whether the slide length is enough for perView.
* - Whether the slide length is enough for perPage.
*/
function generateClones() {
const { Slides, Elements: { list } } = Components;
const { perView, drag, flickMaxPages = 1 } = Splide.options;
const { perPage, drag, flickMaxPages = 1 } = Splide.options;
const length = Slides.length;
const count = perView * ( drag ? flickMaxPages + 1 : 1 ) + ( length < perView ? perView : 0 );
const count = perPage * ( drag ? flickMaxPages + 1 : 1 ) + ( length < perPage ? perPage : 0 );

@@ -75,0 +75,0 @@ let slides = Slides.getSlides( false, false );

@@ -113,10 +113,10 @@ /**

const length = Splide.length;
const perView = options.perView;
const perPage = options.perPage;
let index = page * perView;
index = index - ( this.pageLength * perView - length ) * floor( index / length );
let index = page * perPage;
index = index - ( this.pageLength * perPage - length ) * floor( index / length );
// Adjustment for the last page.
if ( length - perView <= index && index < length ) {
index = length - perView;
if ( length - perPage <= index && index < length ) {
index = length - perPage;
}

@@ -140,10 +140,10 @@

const length = Splide.length;
const perView = options.perView;
const perPage = options.perPage;
// Make the last "perView" number of slides belong to the last page.
if ( length - perView <= index && index < length ) {
return floor( ( length - 1 ) / perView );
// Make the last "perPage" number of slides belong to the last page.
if ( length - perPage <= index && index < length ) {
return floor( ( length - 1 ) / perPage );
}
return floor( index / perView );
return floor( index / perPage );
},

@@ -212,3 +212,3 @@

const length = Splide.length;
return options.focus ? length : Math.ceil( length / options.perView );
return options.focus ? length : Math.ceil( length / options.perPage );
},

@@ -228,3 +228,3 @@

return length - options.perView;
return length - options.perPage;
},

@@ -231,0 +231,0 @@

@@ -112,3 +112,3 @@ /**

* Return slide width including gap size.
* Note that slideWidth * perView is NOT equal to slider width.
* Note that slideWidth * perPage is NOT equal to slider width.
*

@@ -183,3 +183,3 @@ * @return {number} - Current slide width including gap size.

if ( ! isVertical ) {
Splide.on( 'resize', updatePerView );
Splide.on( 'resize', updatePerPage );
}

@@ -206,12 +206,12 @@ }

/**
* Update the perView number automatically according to the fixedWidth.
* Update the perPage number automatically according to the fixedWidth.
*/
function updatePerView() {
function updatePerPage() {
const options = Splide.options;
if ( options.fixedWidth ) {
const perView = Math.floor( ( Layout.width + Resolver.gap ) / Layout.slideWidth ) || 1;
const perPage = Math.floor( ( Layout.width + Resolver.gap ) / Layout.slideWidth ) || 1;
if ( options.perView !== perView ) {
Splide.options = { perView };
if ( options.perPage !== perPage ) {
Splide.options = { perPage };
}

@@ -218,0 +218,0 @@ }

@@ -78,3 +78,3 @@ /**

const width = ( this.width + this.gap ) / options.perView;
const width = ( this.width + this.gap ) / options.perPage;
return includeGap ? width : width - this.gap;

@@ -81,0 +81,0 @@ },

@@ -72,3 +72,3 @@ /**

getSlideHeight( includeGap ) {
const height = ( this.listHeight + this.gap ) / options.perView;
const height = ( this.listHeight + this.gap ) / options.perPage;
return includeGap ? height : height - this.gap;

@@ -75,0 +75,0 @@ },

@@ -104,3 +104,3 @@ /**

images = images.filter( image => {
if ( image.Slide.isWithin( index, options.perView * ( options.preloadPages + 1 ) ) ) {
if ( image.Slide.isWithin( index, options.perPage * ( options.preloadPages + 1 ) ) ) {
load( image.img, image.Slide );

@@ -107,0 +107,0 @@ return false;

@@ -169,3 +169,3 @@ /**

const items = Slides.getSlides( false, true )
.filter( Slide => options.focus || Slide.index % options.perView === 0 )
.filter( Slide => options.focus || Slide.index % options.perPage === 0 )
.map( ( Slide, page ) => {

@@ -172,0 +172,0 @@ const li = create( 'li', {} );

@@ -94,3 +94,3 @@ /**

const options = Splide.options;
const max = options.focus ? 1 : options.perView;
const max = options.focus ? 1 : options.perPage;

@@ -97,0 +97,0 @@ return Slides.filter( ( { index } ) => idx <= index && index < idx + max );

@@ -111,18 +111,18 @@ /**

isVisible() {
const { focus, perView, trimSpace } = Splide.options;
const { focus, perPage, trimSpace } = Splide.options;
const { index: activeIndex, length } = Splide;
const isCenter = 'center' === focus;
const offset = isCenter ? perView / 2 : parseInt( focus ) || 0;
const offset = isCenter ? perPage / 2 : parseInt( focus ) || 0;
if ( trimSpace ) {
if ( activeIndex < offset ) {
return index < perView;
} else if ( activeIndex >= length - ( perView - offset ) ) {
return index >= length - perView;
return index < perPage;
} else if ( activeIndex >= length - ( perPage - offset ) ) {
return index >= length - perPage;
}
}
const min = activeIndex - offset + ( isCenter && perView % 2 === 0 ? 1 : 0 );
const min = activeIndex - offset + ( isCenter && perPage % 2 === 0 ? 1 : 0 );
return min <= index && index < activeIndex + perView - offset;
return min <= index && index < activeIndex + perPage - offset;
},

@@ -129,0 +129,0 @@

@@ -138,7 +138,7 @@ /**

/**
* Calculate coordinate by index.
* Calculate position by index.
*
* @param {number} index - Slide index.
*
* @return {Object} - Calculated coordinate.
* @return {Object} - Calculated position.
*/

@@ -150,3 +150,3 @@ toPosition( index ) {

/**
* Calculate the closest slide index from the given coordinates.
* Calculate the closest slide index by the given position.
*

@@ -153,0 +153,0 @@ * @return {number} - The closest slide index.

@@ -67,3 +67,3 @@ /**

trim( position ) {
const edge = -( Layout.listHeight - Splide.options.perView * Layout.slideHeight );
const edge = -( Layout.listHeight - Splide.options.perPage * Layout.slideHeight );
return between( position, edge, 0 );

@@ -70,0 +70,0 @@ },

@@ -17,3 +17,3 @@ /**

* - 'loop' : Carousel slider.
* - 'fade' : Change slides with fade transition. perView, drag options are ignored.
* - 'fade' : Change slides with fade transition. perPage, drag options are ignored.
*

@@ -48,3 +48,3 @@ * @type {string}

* Fix width of slides. CSS format is allowed such as 10em, 80% or 80vw.
* perView number will be ignored when this option is falsy.
* perPage number will be ignored when this option is falsy.
*

@@ -76,3 +76,3 @@ * @type {number|string}

*/
perView: 1,
perPage: 1,

@@ -285,7 +285,7 @@ /**

* '1000': {
* perView: 3,
* perPage: 3,
* gap: 20
* },
* '600': {
* perView: 1,
* perPage: 1,
* gap: 5,

@@ -292,0 +292,0 @@ * }

@@ -20,3 +20,3 @@ /**

export default ( Splide, Components ) => {
Components.Options.fix( { perView: 1, gap: 0, padding: 0 } );
Components.Options.fix( { perPage: 1, gap: 0, padding: 0 } );

@@ -23,0 +23,0 @@ if ( Components.Drag ) {

@@ -38,3 +38,3 @@ /**

if ( hasClass( child, className ) ) {
if ( hasClass( child, className.split( ' ' )[ 0 ] ) ) {
return child;

@@ -41,0 +41,0 @@ }

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc