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.21 to 1.0.22

src/sass/themes/default/object/modifiers/_rtl.scss

4

dist/js/splide.min.js
/*!
* Splide.js
* Version : 1.0.20
* Version : 1.0.22
* 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(4)}).on("moved dragged",function(){return i.State.set(3)})}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(3),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(3)||this.State.is(4)&&!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(3)||(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(3)){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(),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(3)&&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});
!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,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=a(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 x(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 x(t,n,e){t&&t.setAttribute(n,e)}function y(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(a,u){return{start:function(t,n,e,i){var o=u.Elements.list,r=a.options,s=b(o,"transitionend",function(t){t.target===o&&(i(),s[0]())});h(o,{transition:"transform "+r.speed+"ms "+r.easing,transform:"translate("+e.x+"px,"+e.y+"px)"})}}}function _(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 S="loop",k="fade";var P="[SPLIDE]";function C(t){console.error(P+" "+t)}function I(t,n){if(!t)throw new Error(n);return t}function E(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=s(t.options,e),o=i.breakpoints;o&&r(o,function(t,n){i.breakpoints[n]=s(o[n],e)}),t.options=i}}}function H(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),I(this.track,"A track "+t),this.list=c(this.track,o.list),I(this.list,"A list "+t),this.slides=a(this.list.children),I(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 L=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),I(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){-1<t.indexOf(".")&&e[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(4)}).on("moved dragged",function(){return i.State.set(3)})}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)?_:w,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 C(t.message),null}return r(this.Components,function(t){t.mounted&&t.mounted()}),this.State.set(2),this.emit("mounted"),this.State.set(3),this.emit("ready"),h(this.root,{visibility:"visible"}),this},n.sync=function(t){return this.sibling=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(3)||this.State.is(4)&&!n)&&this.Components.Controller.go(t,!1)},n.is=function(t){return t===this._options.type},function(t,n,e){n&&E(t.prototype,n),e&&E(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 A(t){var n=typeof t;return"string"==n?t:"number"==n&&0<t?parseFloat(t)+"px":""}function j(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(S)||(t=o.rewind?this.rewind(t):O(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(S)){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(S)?t-1:t-o.perPage},get prevIndex(){var t=this.parse("-");return(r.is(S)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=this.parse("+");return(r.is(S)||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=[],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)}).on("resize",function(){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.trimSpace,i=d.index,o=d.length,r="center"===n,s=d.Components.Layout.numInView,a=r?s/2:parseInt(n)||0;if(e){if(i<a)return u<s;if(o-(s-a)<=i)return o-s<=u}return i-a+(r&&s%2==0?1:0)<=u&&u<i+s-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=!1!==n.focus?1:n.perPage;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 N(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+a.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(a.slideHeight+a.gap))},trim:function(t){return O(t,-(a.listHeight-(a.height+a.gap)),0)},get offset(){var t,n=a.height,e=a.slideHeight,i=a.gap,o=r.options.focus;return t="center"===o?(n-e)/2:(parseInt(o)||0)*(e+i),(e+i)*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+a.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(a.slideWidth+a.gap))},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)/2:(parseInt(o)||0)*(e+i),(e+i)*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(S)?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 B(c,l){var f=[];function p(t){var n=t.cloneNode(!0);return g(n,c.classes.clone),y(n,"id"),n}return{mount:function(){c.is(S)&&function(){var i=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,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 D(i,s){var a,u,d,o=i.root,r="ttb"===i.options.direction,t=s.Elements,c={mount:function(){a=t.list,u=s.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")},50);b(window,"resize",t),i.on("mounted resize",l).on("updated",n)}(),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},get numInView(){return d.numInView}};function n(){var t=i.options;for(var n in(d=r?function(n,t,e){var i,o,r,s,a,u=t.Elements,d=n.root,c=u.track;return{marginProp:"marginBottom",gap:j(d,e.gap),padding:(i=e.padding,o=i.top,r=void 0===o?i:o,s=i.bottom,a=void 0===s?i:s,{top:j(d,r),bottom:j(d,a)}),init:function(){h(c,{paddingTop:A(this.padding.top),paddingBottom:A(this.padding.bottom)})},get width(){return c.clientWidth},get height(){var t=e.height||this.width*e.heightRatio;return I(t,'"height" or "heightRatio" must be given in TTB mode.'),j(n.root,t)-this.padding.top-this.padding.bottom},get listWidth(){return this.width},get listHeight(){return(this.slideHeight+this.gap)*t.Slides.total},get slideWidth(){return j(n.root,e.fixedWidth||this.width)},get slideHeight(){var t=e.fixedHeight||(this.height+this.gap)/e.perPage-this.gap;return j(n.root,t)},get numInView(){return e.fixedHeight?Math.floor((this.height+this.gap)/(this.slideHeight+this.gap))||1:e.perPage}}}(i,s,t):function(t,n,e){var i,o,r,s,a,u=n.Elements,d=t.root,c=u.track;return{marginProp:"rtl"===e.direction?"marginLeft":"marginRight",height:0,listHeight:0,gap:j(d,e.gap),padding:(i=e.padding,o=i.left,r=void 0===o?i:o,s=i.right,a=void 0===s?i:s,{left:j(d,r),right:j(d,a)}),init:function(){h(c,{paddingLeft:A(this.padding.left),paddingRight:A(this.padding.right)})},get width(){return c.clientWidth-this.padding.left-this.padding.right},get listWidth(){return(this.slideWidth+this.gap)*n.Slides.total},get slideWidth(){var t=e.fixedWidth||(this.width+this.gap)/e.perPage-this.gap;return j(d,t)},get slideHeight(){var t=e.height||e.fixedHeight||this.width*e.heightRatio;return j(d,t)},get numInView(){return e.fixedWidth?Math.floor((this.width+this.gap)/(this.slideWidth+this.gap))||1:e.perPage}}}(i,s,t)).init(),h(o,{maxWidth:A(t.width)}),u){var e;h(u[n].slide,((e={})[d.marginProp]=A(t.gap),e))}l()}function l(){h(a,{width:A(c.listWidth),height:A(c.listHeight)}),h(s.Elements.track,{height:A(c.height)});var t=A(d.slideWidth),n=A(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})}}return c}function V(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;b(t,"touchstart mousedown",a),b(t,"touchmove mousemove",p,!1),b(t,"touchend touchcancel mouseleave mouseup dragend",h)}};function a(t){n.disabled||r||!u.State.is(3)||(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(S)){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(3)){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)));var a=c.toIndex(s);a===u.index&&(a+=l.isRtl()?r:-r),u.is(S)||(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 X(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.perPage&&(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));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(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)b(t[o],n,function(){u[i?"play":"pause"](e)})}return u}function F(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 40 40"\twidth="40"\theight="40"><path d="'+(a.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:a.options.arrows,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;b(c.prev,"click",function(){a.go(t?"-"+t:"<")}),b(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=1<a.length;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 G(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!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(){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(Q,n).on("updated.page",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(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 U(a,i){var u,d,c=a.i18n;function n(t,n){x(t,"aria-hidden",!n),x(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;x(t,nt,e),x(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,x(t,et,r),x(n,et,s)}function o(t,n){n&&x(n.button,tt,!0),t.items.forEach(function(t){var n=a.options,e=T(!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)}),x(o,nt,r.join(" ")),x(o,et,e)})}function r(t,n,e){n&&y(n.button,tt),e&&x(e.button,tt,!0)}function s(r){i.Slides.getSlides(!0,!0).forEach(function(t){var n=t.slide;"button"!==n.tagName.toLowerCase()&&x(n,"role","button");var e=-1<t.realIndex?t.realIndex:t.index,i=T(c.slideX,e+1),o=r.Components.Slides.getSlide(e);x(n,et,i),n.appendChild(f(i)),o&&x(n,nt,o.slide.id)})}function l(t,n){var e=t.slide;n?x(e,tt,!0):y(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,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:H,Controller:q,Slides:R,Track:N,Clones:B,Layout:D,Drag:V,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:F,Pagination:G,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.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"}),x(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(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.sibling,t=o&&o.options.isNavigation;function r(){i.on(it,function(t,n,e){o.off(it).go(o.is(S)?e:t,!1),s()})}function s(){o.on(it,function(t,n,e){i.off(it).go(i.is(S)?e:t,!1),r()})}function e(t){i.State.is(3)&&o.go(t)}return{required:!!o,mount:function(){r(),s(),t&&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)})},mounted:function(){t&&o.emit("navigation:mounted",i)}}},A11y:U,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 L(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});
{
"name": "@splidejs/splide",
"version": "1.0.21",
"version": "1.0.22",
"description": "Splide is a lightweight and powerful slider without any dependencies.",

@@ -5,0 +5,0 @@ "author": "Naotoshi Fujita",

@@ -182,5 +182,5 @@ /**

const realIndex = Slide.realIndex;
const label = sprintf( i18n.slideX, realIndex + 1 );
const mainSlide = main.Components.Slides.getSlide( realIndex );
const slideIndex = Slide.realIndex > -1 ? Slide.realIndex : Slide.index;
const label = sprintf( i18n.slideX, slideIndex + 1 );
const mainSlide = main.Components.Slides.getSlide( slideIndex );

@@ -187,0 +187,0 @@ setAttribute( slide, ARIA_LABEL, label );

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

*/
const THROTTLE = 30;
const THROTTLE = 50;

@@ -164,2 +164,11 @@

},
/**
* Return the number of slides in the current view.
*
* @return {number} - The number of slides in view.
*/
get numInView() {
return Resolver.numInView;
}
};

@@ -198,6 +207,2 @@

Splide.on( 'mounted resize', resize ).on( 'updated', init );
if ( ! isVertical ) {
Splide.on( 'resize', updatePerPage );
}
}

@@ -223,18 +228,3 @@

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

@@ -31,2 +31,9 @@ /**

/**
* Keep the root element.
*
* @type {Element}
*/
const root = Splide.root;
/**
* Keep the track element.

@@ -61,17 +68,31 @@ *

/**
* Gap in px.
*
* @type {number}
*/
gap: toPixel( root, options.gap ),
/**
* An object containing padding left and right in px.
*
* @type {Object}
*/
padding: ( () => {
const padding = options.padding;
const { left = padding, right = padding } = padding;
return {
left : toPixel( root, left ),
right: toPixel( root, right ),
};
} )(),
/**
* Initialization.
*/
init() {
let padding = options.padding;
if ( padding ) {
if ( typeof padding !== 'object' ) {
padding = {
left : padding,
right: padding,
}
}
applyStyle( track, { paddingLeft : unit( padding.left ), paddingRight: unit( padding.right ) } );
}
applyStyle( track, {
paddingLeft : unit( this.padding.left ),
paddingRight: unit( this.padding.right ),
} );
},

@@ -103,9 +124,4 @@

get slideWidth() {
let width = options.fixedWidth;
if ( ! width ) {
width = ( ( this.width + this.gap ) / options.perPage ) - this.gap;
}
return toPixel( Splide.root, width );
const width = options.fixedWidth || ( ( this.width + this.gap ) / options.perPage ) - this.gap;
return toPixel( root, width );
},

@@ -120,29 +136,18 @@

const height = options.height || options.fixedHeight || this.width * options.heightRatio;
return toPixel( Splide.root, height );
return toPixel( root, height );
},
/**
* Return gap in px.
* Return the number of slides in the current view.
*
* @return {Object} - Gap amount in px.
* @return {number} - The number of slides in view.
*/
get gap() {
const style = getComputedStyle( Elements.slides[ 0 ] );
return parseFloat( style[ this.marginProp ] ) || 0;
},
get numInView() {
if ( options.fixedWidth ) {
return Math.floor( ( this.width + this.gap ) / ( this.slideWidth + this.gap ) ) || 1;
}
/**
* Return padding object.
*
* @return {Object} - An object containing padding left and right.
*/
get padding() {
const style = getComputedStyle( track );
return {
left : parseFloat( style.paddingLeft ) || 0,
right : parseFloat( style.paddingRight ) || 0,
};
},
return options.perPage;
}
}
}

@@ -31,2 +31,9 @@ /**

/**
* Keep the root element.
*
* @type {Element}
*/
const root = Splide.root;
/**
* Keep the track element.

@@ -47,17 +54,31 @@ *

/**
* Gap in px.
*
* @type {number}
*/
gap: toPixel( root, options.gap ),
/**
* An object containing padding left and right in px.
*
* @type {Object}
*/
padding: ( () => {
const padding = options.padding;
const { top = padding, bottom = padding } = padding;
return {
top : toPixel( root, top ),
bottom: toPixel( root, bottom ),
};
} )(),
/**
* Init slider styles according to options.
*/
init() {
let padding = options.padding;
if ( padding ) {
if ( typeof padding !== 'object' ) {
padding = {
top : padding,
bottom: padding,
}
}
applyStyle( track, { paddingTop : unit( padding.top ), paddingBottom: unit( padding.bottom ) } );
}
applyStyle( track, {
paddingTop : unit( this.padding.top ),
paddingBottom: unit( this.padding.bottom ),
} );
},

@@ -82,3 +103,3 @@

exist( height, '"height" or "heightRatio" must be given in TTB mode.' );
return toPixel( Splide.root, height );
return toPixel( Splide.root, height ) - this.padding.top - this.padding.bottom;
},

@@ -119,8 +140,3 @@

get slideHeight() {
let height = options.fixedHeight;
if ( ! height ) {
height = ( this.height + this.gap ) / options.perPage - this.gap;
}
const height = options.fixedHeight || ( this.height + this.gap ) / options.perPage - this.gap;
return toPixel( Splide.root, height );

@@ -130,25 +146,14 @@ },

/**
* Return gap in px.
* Return the number of slides in the current view.
*
* @return {Object} - Gap amount in px.
* @return {number} - The number of slides in view.
*/
get gap() {
const style = getComputedStyle( Elements.slides[ 0 ] );
return parseFloat( style[ this.marginProp ] ) || 0;
},
get numInView() {
if ( options.fixedHeight ) {
return Math.floor( ( this.height + this.gap ) / ( this.slideHeight + this.gap ) ) || 1;
}
/**
* Return padding object.
*
* @return {Object} - An object containing padding top and bottom.
*/
get padding() {
const style = getComputedStyle( track );
return {
top : parseFloat( style.paddingTop ) || 0,
bottom: parseFloat( style.paddingBottom ) || 0,
};
},
return options.perPage;
}
}
}

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

this.update( this.isVisible(), true );
} );
} ).on( 'resize', () => { this.update( this.isVisible(), true ) } );
},

@@ -112,18 +112,19 @@

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

@@ -130,0 +131,0 @@

@@ -36,9 +36,16 @@ /**

/**
* Keep the sub Splide instance.
* Keep the sibling Splide instance.
*
* @type {Splide}
*/
let sub = Splide.sub;
let sibling = Splide.sibling;
/**
* Whether the sibling slider is navigation or not.
*
* @type {Splide|boolean}
*/
const isNavigation = sibling && sibling.options.isNavigation;
/**
* Layout component object.

@@ -54,3 +61,3 @@ *

*/
required: !! sub,
required: !! sibling,

@@ -61,9 +68,18 @@ /**

mount() {
sync();
syncSub();
syncMain();
syncSibling();
if ( sub.options.isNavigation ) {
if ( isNavigation ) {
bind();
}
},
/**
* Called after all components are mounted.
*/
mounted() {
if ( isNavigation ) {
sibling.emit( 'navigation:mounted', Splide );
}
}
};

@@ -75,9 +91,9 @@

*/
function sync() {
function syncMain() {
Splide.on( SYNC_EVENT, ( newIndex, prevIndex, destIndex ) => {
sub
sibling
.off( SYNC_EVENT )
.go( sub.is( LOOP ) ? destIndex : newIndex, false );
.go( sibling.is( LOOP ) ? destIndex : newIndex, false );
syncSub();
syncSibling();
} );

@@ -90,4 +106,4 @@ }

*/
function syncSub() {
sub.on( SYNC_EVENT, ( newIndex, prevIndex, destIndex ) => {
function syncSibling() {
sibling.on( SYNC_EVENT, ( newIndex, prevIndex, destIndex ) => {
Splide

@@ -97,3 +113,3 @@ .off( SYNC_EVENT )

sync();
syncMain();
} );

@@ -106,3 +122,3 @@ }

function bind() {
const Slides = sub.Components.Slides.getSlides( true, true );
const Slides = sibling.Components.Slides.getSlides( true, true );

@@ -119,3 +135,3 @@ Slides.forEach( Slide => {

if ( ! e.button || e.button === 0 ) {
moveSub( Slide.index );
moveSibling( Slide.index );
}

@@ -131,3 +147,3 @@ } );

e.preventDefault();
moveSub( Slide.index );
moveSibling( Slide.index );
}

@@ -138,5 +154,5 @@ }, false );

function moveSub( index ) {
function moveSibling( index ) {
if ( Splide.State.is( IDLE ) ) {
sub.go( index );
sibling.go( index );
}

@@ -143,0 +159,0 @@ }

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

event.split( ' ' ).forEach( name => {
// Prevent an event with a namespace from being registered twice.
if ( name.indexOf( '.' ) > -1 && handlers[ name ] ) {
return;
}
if ( ! handlers[ name ] ) {

@@ -34,0 +39,0 @@ handlers[ name ] = [];

@@ -100,3 +100,3 @@ /**

sync( splide ) {
this.sub = splide;
this.sibling = splide;
return this;

@@ -159,3 +159,3 @@ }

*
* @return {boolean} - True if the slide is the provided type or false if not.
* @return {boolean} - True if the slider type is the provided type or false if not.
*/

@@ -162,0 +162,0 @@ is( type ) {

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