@aurodesignsystem-dev/auro-slideshow 0.0.0-pr18.0 → 0.0.0-pr19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/demo/api.min.js CHANGED
@@ -1,4418 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const t$1=globalThis,e$2=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$3=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$3.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$3.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$2(o,t,s$2)},S$1=(s,o)=>{if(e$2)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
1
+ import { A as AuroSlideshow } from './auro-slideshow.min.js';
7
2
 
8
- /**
9
- * @license
10
- * Copyright 2017 Google LLC
11
- * SPDX-License-Identifier: BSD-3-Clause
12
- */const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$2,getPrototypeOf:n$1}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$2(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$1(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$2(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.0");
13
-
14
- /**
15
- * @license
16
- * Copyright 2017 Google LLC
17
- * SPDX-License-Identifier: BSD-3-Clause
18
- */
19
- const t=globalThis,i$1=t.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$1="?"+h,n=`<${o$1}>`,r=document,l=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$1)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
20
-
21
- /**
22
- * @license
23
- * Copyright 2017 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */const s=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}}i._$litElement$=true,i["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});(s.litElementVersions??=[]).push("4.2.0");
26
-
27
- /**
28
- * SSR Window 5.0.0
29
- * Better handling for window object in SSR environment
30
- * https://github.com/nolimits4web/ssr-window
31
- *
32
- * Copyright 2025, Vladimir Kharlampidi
33
- *
34
- * Licensed under MIT
35
- *
36
- * Released on: February 12, 2025
37
- */
38
- /* eslint-disable no-param-reassign */
39
- function isObject$1(obj) {
40
- return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
41
- }
42
- function extend$1(target, src) {
43
- if (target === void 0) {
44
- target = {};
45
- }
46
- if (src === void 0) {
47
- src = {};
48
- }
49
- const noExtend = ['__proto__', 'constructor', 'prototype'];
50
- Object.keys(src).filter(key => noExtend.indexOf(key) < 0).forEach(key => {
51
- if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$1(src[key]) && isObject$1(target[key]) && Object.keys(src[key]).length > 0) {
52
- extend$1(target[key], src[key]);
53
- }
54
- });
55
- }
56
- const ssrDocument = {
57
- body: {},
58
- addEventListener() {},
59
- removeEventListener() {},
60
- activeElement: {
61
- blur() {},
62
- nodeName: ''
63
- },
64
- querySelector() {
65
- return null;
66
- },
67
- querySelectorAll() {
68
- return [];
69
- },
70
- getElementById() {
71
- return null;
72
- },
73
- createEvent() {
74
- return {
75
- initEvent() {}
76
- };
77
- },
78
- createElement() {
79
- return {
80
- children: [],
81
- childNodes: [],
82
- style: {},
83
- setAttribute() {},
84
- getElementsByTagName() {
85
- return [];
86
- }
87
- };
88
- },
89
- createElementNS() {
90
- return {};
91
- },
92
- importNode() {
93
- return null;
94
- },
95
- location: {
96
- hash: '',
97
- host: '',
98
- hostname: '',
99
- href: '',
100
- origin: '',
101
- pathname: '',
102
- protocol: '',
103
- search: ''
104
- }
105
- };
106
- function getDocument() {
107
- const doc = typeof document !== 'undefined' ? document : {};
108
- extend$1(doc, ssrDocument);
109
- return doc;
110
- }
111
- const ssrWindow = {
112
- document: ssrDocument,
113
- navigator: {
114
- userAgent: ''
115
- },
116
- location: {
117
- hash: '',
118
- host: '',
119
- hostname: '',
120
- href: '',
121
- origin: '',
122
- pathname: '',
123
- protocol: '',
124
- search: ''
125
- },
126
- history: {
127
- replaceState() {},
128
- pushState() {},
129
- go() {},
130
- back() {}
131
- },
132
- CustomEvent: function CustomEvent() {
133
- return this;
134
- },
135
- addEventListener() {},
136
- removeEventListener() {},
137
- getComputedStyle() {
138
- return {
139
- getPropertyValue() {
140
- return '';
141
- }
142
- };
143
- },
144
- Image() {},
145
- Date() {},
146
- screen: {},
147
- setTimeout() {},
148
- clearTimeout() {},
149
- matchMedia() {
150
- return {};
151
- },
152
- requestAnimationFrame(callback) {
153
- if (typeof setTimeout === 'undefined') {
154
- callback();
155
- return null;
156
- }
157
- return setTimeout(callback, 0);
158
- },
159
- cancelAnimationFrame(id) {
160
- if (typeof setTimeout === 'undefined') {
161
- return;
162
- }
163
- clearTimeout(id);
164
- }
165
- };
166
- function getWindow() {
167
- const win = typeof window !== 'undefined' ? window : {};
168
- extend$1(win, ssrWindow);
169
- return win;
170
- }
171
-
172
- function classesToTokens(classes) {
173
- if (classes === void 0) {
174
- classes = '';
175
- }
176
- return classes.trim().split(' ').filter(c => !!c.trim());
177
- }
178
-
179
- function deleteProps(obj) {
180
- const object = obj;
181
- Object.keys(object).forEach(key => {
182
- try {
183
- object[key] = null;
184
- } catch (e) {
185
- // no getter for object
186
- }
187
- try {
188
- delete object[key];
189
- } catch (e) {
190
- // something got wrong
191
- }
192
- });
193
- }
194
- function nextTick(callback, delay) {
195
- if (delay === void 0) {
196
- delay = 0;
197
- }
198
- return setTimeout(callback, delay);
199
- }
200
- function now() {
201
- return Date.now();
202
- }
203
- function getComputedStyle$1(el) {
204
- const window = getWindow();
205
- let style;
206
- if (window.getComputedStyle) {
207
- style = window.getComputedStyle(el, null);
208
- }
209
- if (!style && el.currentStyle) {
210
- style = el.currentStyle;
211
- }
212
- if (!style) {
213
- style = el.style;
214
- }
215
- return style;
216
- }
217
- function getTranslate(el, axis) {
218
- if (axis === void 0) {
219
- axis = 'x';
220
- }
221
- const window = getWindow();
222
- let matrix;
223
- let curTransform;
224
- let transformMatrix;
225
- const curStyle = getComputedStyle$1(el);
226
- if (window.WebKitCSSMatrix) {
227
- curTransform = curStyle.transform || curStyle.webkitTransform;
228
- if (curTransform.split(',').length > 6) {
229
- curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
230
- }
231
- // Some old versions of Webkit choke when 'none' is passed; pass
232
- // empty string instead in this case
233
- transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
234
- } else {
235
- transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
236
- matrix = transformMatrix.toString().split(',');
237
- }
238
- if (axis === 'x') {
239
- // Latest Chrome and webkits Fix
240
- if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
241
- // Crazy IE10 Matrix
242
- else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
243
- // Normal Browsers
244
- else curTransform = parseFloat(matrix[4]);
245
- }
246
- if (axis === 'y') {
247
- // Latest Chrome and webkits Fix
248
- if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
249
- // Crazy IE10 Matrix
250
- else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
251
- // Normal Browsers
252
- else curTransform = parseFloat(matrix[5]);
253
- }
254
- return curTransform || 0;
255
- }
256
- function isObject(o) {
257
- return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
258
- }
259
- function isNode(node) {
260
- // eslint-disable-next-line
261
- if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
262
- return node instanceof HTMLElement;
263
- }
264
- return node && (node.nodeType === 1 || node.nodeType === 11);
265
- }
266
- function extend() {
267
- const to = Object(arguments.length <= 0 ? undefined : arguments[0]);
268
- const noExtend = ['__proto__', 'constructor', 'prototype'];
269
- for (let i = 1; i < arguments.length; i += 1) {
270
- const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
271
- if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
272
- const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
273
- for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
274
- const nextKey = keysArray[nextIndex];
275
- const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
276
- if (desc !== undefined && desc.enumerable) {
277
- if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
278
- if (nextSource[nextKey].__swiper__) {
279
- to[nextKey] = nextSource[nextKey];
280
- } else {
281
- extend(to[nextKey], nextSource[nextKey]);
282
- }
283
- } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
284
- to[nextKey] = {};
285
- if (nextSource[nextKey].__swiper__) {
286
- to[nextKey] = nextSource[nextKey];
287
- } else {
288
- extend(to[nextKey], nextSource[nextKey]);
289
- }
290
- } else {
291
- to[nextKey] = nextSource[nextKey];
292
- }
293
- }
294
- }
295
- }
296
- }
297
- return to;
298
- }
299
- function setCSSProperty(el, varName, varValue) {
300
- el.style.setProperty(varName, varValue);
301
- }
302
- function animateCSSModeScroll(_ref) {
303
- let {
304
- swiper,
305
- targetPosition,
306
- side
307
- } = _ref;
308
- const window = getWindow();
309
- const startPosition = -swiper.translate;
310
- let startTime = null;
311
- let time;
312
- const duration = swiper.params.speed;
313
- swiper.wrapperEl.style.scrollSnapType = 'none';
314
- window.cancelAnimationFrame(swiper.cssModeFrameID);
315
- const dir = targetPosition > startPosition ? 'next' : 'prev';
316
- const isOutOfBound = (current, target) => {
317
- return dir === 'next' && current >= target || dir === 'prev' && current <= target;
318
- };
319
- const animate = () => {
320
- time = new Date().getTime();
321
- if (startTime === null) {
322
- startTime = time;
323
- }
324
- const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
325
- const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
326
- let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
327
- if (isOutOfBound(currentPosition, targetPosition)) {
328
- currentPosition = targetPosition;
329
- }
330
- swiper.wrapperEl.scrollTo({
331
- [side]: currentPosition
332
- });
333
- if (isOutOfBound(currentPosition, targetPosition)) {
334
- swiper.wrapperEl.style.overflow = 'hidden';
335
- swiper.wrapperEl.style.scrollSnapType = '';
336
- setTimeout(() => {
337
- swiper.wrapperEl.style.overflow = '';
338
- swiper.wrapperEl.scrollTo({
339
- [side]: currentPosition
340
- });
341
- });
342
- window.cancelAnimationFrame(swiper.cssModeFrameID);
343
- return;
344
- }
345
- swiper.cssModeFrameID = window.requestAnimationFrame(animate);
346
- };
347
- animate();
348
- }
349
- function elementChildren(element, selector) {
350
- if (selector === void 0) {
351
- selector = '';
352
- }
353
- const window = getWindow();
354
- const children = [...element.children];
355
- if (window.HTMLSlotElement && element instanceof HTMLSlotElement) {
356
- children.push(...element.assignedElements());
357
- }
358
- if (!selector) {
359
- return children;
360
- }
361
- return children.filter(el => el.matches(selector));
362
- }
363
- function elementIsChildOfSlot(el, slot) {
364
- // Breadth-first search through all parent's children and assigned elements
365
- const elementsQueue = [slot];
366
- while (elementsQueue.length > 0) {
367
- const elementToCheck = elementsQueue.shift();
368
- if (el === elementToCheck) {
369
- return true;
370
- }
371
- elementsQueue.push(...elementToCheck.children, ...(elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : []), ...(elementToCheck.assignedElements ? elementToCheck.assignedElements() : []));
372
- }
373
- }
374
- function elementIsChildOf(el, parent) {
375
- const window = getWindow();
376
- let isChild = parent.contains(el);
377
- if (!isChild && window.HTMLSlotElement && parent instanceof HTMLSlotElement) {
378
- const children = [...parent.assignedElements()];
379
- isChild = children.includes(el);
380
- if (!isChild) {
381
- isChild = elementIsChildOfSlot(el, parent);
382
- }
383
- }
384
- return isChild;
385
- }
386
- function showWarning(text) {
387
- try {
388
- console.warn(text);
389
- return;
390
- } catch (err) {
391
- // err
392
- }
393
- }
394
- function createElement(tag, classes) {
395
- if (classes === void 0) {
396
- classes = [];
397
- }
398
- const el = document.createElement(tag);
399
- el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
400
- return el;
401
- }
402
- function elementPrevAll(el, selector) {
403
- const prevEls = [];
404
- while (el.previousElementSibling) {
405
- const prev = el.previousElementSibling; // eslint-disable-line
406
- if (selector) {
407
- if (prev.matches(selector)) prevEls.push(prev);
408
- } else prevEls.push(prev);
409
- el = prev;
410
- }
411
- return prevEls;
412
- }
413
- function elementNextAll(el, selector) {
414
- const nextEls = [];
415
- while (el.nextElementSibling) {
416
- const next = el.nextElementSibling; // eslint-disable-line
417
- if (selector) {
418
- if (next.matches(selector)) nextEls.push(next);
419
- } else nextEls.push(next);
420
- el = next;
421
- }
422
- return nextEls;
423
- }
424
- function elementStyle(el, prop) {
425
- const window = getWindow();
426
- return window.getComputedStyle(el, null).getPropertyValue(prop);
427
- }
428
- function elementIndex(el) {
429
- let child = el;
430
- let i;
431
- if (child) {
432
- i = 0;
433
- // eslint-disable-next-line
434
- while ((child = child.previousSibling) !== null) {
435
- if (child.nodeType === 1) i += 1;
436
- }
437
- return i;
438
- }
439
- return undefined;
440
- }
441
- function elementParents(el, selector) {
442
- const parents = []; // eslint-disable-line
443
- let parent = el.parentElement; // eslint-disable-line
444
- while (parent) {
445
- if (selector) {
446
- if (parent.matches(selector)) parents.push(parent);
447
- } else {
448
- parents.push(parent);
449
- }
450
- parent = parent.parentElement;
451
- }
452
- return parents;
453
- }
454
- function elementOuterSize(el, size, includeMargins) {
455
- const window = getWindow();
456
- {
457
- return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));
458
- }
459
- }
460
- function makeElementsArray(el) {
461
- return (Array.isArray(el) ? el : [el]).filter(e => !!e);
462
- }
463
-
464
- let support;
465
- function calcSupport() {
466
- const window = getWindow();
467
- const document = getDocument();
468
- return {
469
- smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style,
470
- touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)
471
- };
472
- }
473
- function getSupport() {
474
- if (!support) {
475
- support = calcSupport();
476
- }
477
- return support;
478
- }
479
-
480
- let deviceCached;
481
- function calcDevice(_temp) {
482
- let {
483
- userAgent
484
- } = _temp === void 0 ? {} : _temp;
485
- const support = getSupport();
486
- const window = getWindow();
487
- const platform = window.navigator.platform;
488
- const ua = userAgent || window.navigator.userAgent;
489
- const device = {
490
- ios: false,
491
- android: false
492
- };
493
- const screenWidth = window.screen.width;
494
- const screenHeight = window.screen.height;
495
- const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
496
- let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
497
- const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
498
- const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
499
- const windows = platform === 'Win32';
500
- let macos = platform === 'MacIntel';
501
-
502
- // iPadOs 13 fix
503
- const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];
504
- if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {
505
- ipad = ua.match(/(Version)\/([\d.]+)/);
506
- if (!ipad) ipad = [0, 1, '13_0_0'];
507
- macos = false;
508
- }
509
-
510
- // Android
511
- if (android && !windows) {
512
- device.os = 'android';
513
- device.android = true;
514
- }
515
- if (ipad || iphone || ipod) {
516
- device.os = 'ios';
517
- device.ios = true;
518
- }
519
-
520
- // Export object
521
- return device;
522
- }
523
- function getDevice(overrides) {
524
- if (overrides === void 0) {
525
- overrides = {};
526
- }
527
- if (!deviceCached) {
528
- deviceCached = calcDevice(overrides);
529
- }
530
- return deviceCached;
531
- }
532
-
533
- let browser;
534
- function calcBrowser() {
535
- const window = getWindow();
536
- const device = getDevice();
537
- let needPerspectiveFix = false;
538
- function isSafari() {
539
- const ua = window.navigator.userAgent.toLowerCase();
540
- return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
541
- }
542
- if (isSafari()) {
543
- const ua = String(window.navigator.userAgent);
544
- if (ua.includes('Version/')) {
545
- const [major, minor] = ua.split('Version/')[1].split(' ')[0].split('.').map(num => Number(num));
546
- needPerspectiveFix = major < 16 || major === 16 && minor < 2;
547
- }
548
- }
549
- const isWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent);
550
- const isSafariBrowser = isSafari();
551
- const need3dFix = isSafariBrowser || isWebView && device.ios;
552
- return {
553
- isSafari: needPerspectiveFix || isSafariBrowser,
554
- needPerspectiveFix,
555
- need3dFix,
556
- isWebView
557
- };
558
- }
559
- function getBrowser() {
560
- if (!browser) {
561
- browser = calcBrowser();
562
- }
563
- return browser;
564
- }
565
-
566
- function Resize(_ref) {
567
- let {
568
- swiper,
569
- on,
570
- emit
571
- } = _ref;
572
- const window = getWindow();
573
- let observer = null;
574
- let animationFrame = null;
575
- const resizeHandler = () => {
576
- if (!swiper || swiper.destroyed || !swiper.initialized) return;
577
- emit('beforeResize');
578
- emit('resize');
579
- };
580
- const createObserver = () => {
581
- if (!swiper || swiper.destroyed || !swiper.initialized) return;
582
- observer = new ResizeObserver(entries => {
583
- animationFrame = window.requestAnimationFrame(() => {
584
- const {
585
- width,
586
- height
587
- } = swiper;
588
- let newWidth = width;
589
- let newHeight = height;
590
- entries.forEach(_ref2 => {
591
- let {
592
- contentBoxSize,
593
- contentRect,
594
- target
595
- } = _ref2;
596
- if (target && target !== swiper.el) return;
597
- newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
598
- newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
599
- });
600
- if (newWidth !== width || newHeight !== height) {
601
- resizeHandler();
602
- }
603
- });
604
- });
605
- observer.observe(swiper.el);
606
- };
607
- const removeObserver = () => {
608
- if (animationFrame) {
609
- window.cancelAnimationFrame(animationFrame);
610
- }
611
- if (observer && observer.unobserve && swiper.el) {
612
- observer.unobserve(swiper.el);
613
- observer = null;
614
- }
615
- };
616
- const orientationChangeHandler = () => {
617
- if (!swiper || swiper.destroyed || !swiper.initialized) return;
618
- emit('orientationchange');
619
- };
620
- on('init', () => {
621
- if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {
622
- createObserver();
623
- return;
624
- }
625
- window.addEventListener('resize', resizeHandler);
626
- window.addEventListener('orientationchange', orientationChangeHandler);
627
- });
628
- on('destroy', () => {
629
- removeObserver();
630
- window.removeEventListener('resize', resizeHandler);
631
- window.removeEventListener('orientationchange', orientationChangeHandler);
632
- });
633
- }
634
-
635
- function Observer(_ref) {
636
- let {
637
- swiper,
638
- extendParams,
639
- on,
640
- emit
641
- } = _ref;
642
- const observers = [];
643
- const window = getWindow();
644
- const attach = function (target, options) {
645
- if (options === void 0) {
646
- options = {};
647
- }
648
- const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
649
- const observer = new ObserverFunc(mutations => {
650
- // The observerUpdate event should only be triggered
651
- // once despite the number of mutations. Additional
652
- // triggers are redundant and are very costly
653
- if (swiper.__preventObserver__) return;
654
- if (mutations.length === 1) {
655
- emit('observerUpdate', mutations[0]);
656
- return;
657
- }
658
- const observerUpdate = function observerUpdate() {
659
- emit('observerUpdate', mutations[0]);
660
- };
661
- if (window.requestAnimationFrame) {
662
- window.requestAnimationFrame(observerUpdate);
663
- } else {
664
- window.setTimeout(observerUpdate, 0);
665
- }
666
- });
667
- observer.observe(target, {
668
- attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
669
- childList: swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList,
670
- characterData: typeof options.characterData === 'undefined' ? true : options.characterData
671
- });
672
- observers.push(observer);
673
- };
674
- const init = () => {
675
- if (!swiper.params.observer) return;
676
- if (swiper.params.observeParents) {
677
- const containerParents = elementParents(swiper.hostEl);
678
- for (let i = 0; i < containerParents.length; i += 1) {
679
- attach(containerParents[i]);
680
- }
681
- }
682
- // Observe container
683
- attach(swiper.hostEl, {
684
- childList: swiper.params.observeSlideChildren
685
- });
686
-
687
- // Observe wrapper
688
- attach(swiper.wrapperEl, {
689
- attributes: false
690
- });
691
- };
692
- const destroy = () => {
693
- observers.forEach(observer => {
694
- observer.disconnect();
695
- });
696
- observers.splice(0, observers.length);
697
- };
698
- extendParams({
699
- observer: false,
700
- observeParents: false,
701
- observeSlideChildren: false
702
- });
703
- on('init', init);
704
- on('destroy', destroy);
705
- }
706
-
707
- /* eslint-disable no-underscore-dangle */
708
-
709
- var eventsEmitter = {
710
- on(events, handler, priority) {
711
- const self = this;
712
- if (!self.eventsListeners || self.destroyed) return self;
713
- if (typeof handler !== 'function') return self;
714
- const method = priority ? 'unshift' : 'push';
715
- events.split(' ').forEach(event => {
716
- if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
717
- self.eventsListeners[event][method](handler);
718
- });
719
- return self;
720
- },
721
- once(events, handler, priority) {
722
- const self = this;
723
- if (!self.eventsListeners || self.destroyed) return self;
724
- if (typeof handler !== 'function') return self;
725
- function onceHandler() {
726
- self.off(events, onceHandler);
727
- if (onceHandler.__emitterProxy) {
728
- delete onceHandler.__emitterProxy;
729
- }
730
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
731
- args[_key] = arguments[_key];
732
- }
733
- handler.apply(self, args);
734
- }
735
- onceHandler.__emitterProxy = handler;
736
- return self.on(events, onceHandler, priority);
737
- },
738
- onAny(handler, priority) {
739
- const self = this;
740
- if (!self.eventsListeners || self.destroyed) return self;
741
- if (typeof handler !== 'function') return self;
742
- const method = priority ? 'unshift' : 'push';
743
- if (self.eventsAnyListeners.indexOf(handler) < 0) {
744
- self.eventsAnyListeners[method](handler);
745
- }
746
- return self;
747
- },
748
- offAny(handler) {
749
- const self = this;
750
- if (!self.eventsListeners || self.destroyed) return self;
751
- if (!self.eventsAnyListeners) return self;
752
- const index = self.eventsAnyListeners.indexOf(handler);
753
- if (index >= 0) {
754
- self.eventsAnyListeners.splice(index, 1);
755
- }
756
- return self;
757
- },
758
- off(events, handler) {
759
- const self = this;
760
- if (!self.eventsListeners || self.destroyed) return self;
761
- if (!self.eventsListeners) return self;
762
- events.split(' ').forEach(event => {
763
- if (typeof handler === 'undefined') {
764
- self.eventsListeners[event] = [];
765
- } else if (self.eventsListeners[event]) {
766
- self.eventsListeners[event].forEach((eventHandler, index) => {
767
- if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
768
- self.eventsListeners[event].splice(index, 1);
769
- }
770
- });
771
- }
772
- });
773
- return self;
774
- },
775
- emit() {
776
- const self = this;
777
- if (!self.eventsListeners || self.destroyed) return self;
778
- if (!self.eventsListeners) return self;
779
- let events;
780
- let data;
781
- let context;
782
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
783
- args[_key2] = arguments[_key2];
784
- }
785
- if (typeof args[0] === 'string' || Array.isArray(args[0])) {
786
- events = args[0];
787
- data = args.slice(1, args.length);
788
- context = self;
789
- } else {
790
- events = args[0].events;
791
- data = args[0].data;
792
- context = args[0].context || self;
793
- }
794
- data.unshift(context);
795
- const eventsArray = Array.isArray(events) ? events : events.split(' ');
796
- eventsArray.forEach(event => {
797
- if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
798
- self.eventsAnyListeners.forEach(eventHandler => {
799
- eventHandler.apply(context, [event, ...data]);
800
- });
801
- }
802
- if (self.eventsListeners && self.eventsListeners[event]) {
803
- self.eventsListeners[event].forEach(eventHandler => {
804
- eventHandler.apply(context, data);
805
- });
806
- }
807
- });
808
- return self;
809
- }
810
- };
811
-
812
- function updateSize() {
813
- const swiper = this;
814
- let width;
815
- let height;
816
- const el = swiper.el;
817
- if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
818
- width = swiper.params.width;
819
- } else {
820
- width = el.clientWidth;
821
- }
822
- if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
823
- height = swiper.params.height;
824
- } else {
825
- height = el.clientHeight;
826
- }
827
- if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
828
- return;
829
- }
830
-
831
- // Subtract paddings
832
- width = width - parseInt(elementStyle(el, 'padding-left') || 0, 10) - parseInt(elementStyle(el, 'padding-right') || 0, 10);
833
- height = height - parseInt(elementStyle(el, 'padding-top') || 0, 10) - parseInt(elementStyle(el, 'padding-bottom') || 0, 10);
834
- if (Number.isNaN(width)) width = 0;
835
- if (Number.isNaN(height)) height = 0;
836
- Object.assign(swiper, {
837
- width,
838
- height,
839
- size: swiper.isHorizontal() ? width : height
840
- });
841
- }
842
-
843
- function updateSlides() {
844
- const swiper = this;
845
- function getDirectionPropertyValue(node, label) {
846
- return parseFloat(node.getPropertyValue(swiper.getDirectionLabel(label)) || 0);
847
- }
848
- const params = swiper.params;
849
- const {
850
- wrapperEl,
851
- slidesEl,
852
- size: swiperSize,
853
- rtlTranslate: rtl,
854
- wrongRTL
855
- } = swiper;
856
- const isVirtual = swiper.virtual && params.virtual.enabled;
857
- const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
858
- const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);
859
- const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
860
- let snapGrid = [];
861
- const slidesGrid = [];
862
- const slidesSizesGrid = [];
863
- let offsetBefore = params.slidesOffsetBefore;
864
- if (typeof offsetBefore === 'function') {
865
- offsetBefore = params.slidesOffsetBefore.call(swiper);
866
- }
867
- let offsetAfter = params.slidesOffsetAfter;
868
- if (typeof offsetAfter === 'function') {
869
- offsetAfter = params.slidesOffsetAfter.call(swiper);
870
- }
871
- const previousSnapGridLength = swiper.snapGrid.length;
872
- const previousSlidesGridLength = swiper.slidesGrid.length;
873
- let spaceBetween = params.spaceBetween;
874
- let slidePosition = -offsetBefore;
875
- let prevSlideSize = 0;
876
- let index = 0;
877
- if (typeof swiperSize === 'undefined') {
878
- return;
879
- }
880
- if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
881
- spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
882
- } else if (typeof spaceBetween === 'string') {
883
- spaceBetween = parseFloat(spaceBetween);
884
- }
885
- swiper.virtualSize = -spaceBetween;
886
-
887
- // reset margins
888
- slides.forEach(slideEl => {
889
- if (rtl) {
890
- slideEl.style.marginLeft = '';
891
- } else {
892
- slideEl.style.marginRight = '';
893
- }
894
- slideEl.style.marginBottom = '';
895
- slideEl.style.marginTop = '';
896
- });
897
-
898
- // reset cssMode offsets
899
- if (params.centeredSlides && params.cssMode) {
900
- setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
901
- setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
902
- }
903
- const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
904
- if (gridEnabled) {
905
- swiper.grid.initSlides(slides);
906
- } else if (swiper.grid) {
907
- swiper.grid.unsetSlides();
908
- }
909
-
910
- // Calc slides
911
- let slideSize;
912
- const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {
913
- return typeof params.breakpoints[key].slidesPerView !== 'undefined';
914
- }).length > 0;
915
- for (let i = 0; i < slidesLength; i += 1) {
916
- slideSize = 0;
917
- let slide;
918
- if (slides[i]) slide = slides[i];
919
- if (gridEnabled) {
920
- swiper.grid.updateSlide(i, slide, slides);
921
- }
922
- if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
923
-
924
- if (params.slidesPerView === 'auto') {
925
- if (shouldResetSlideSize) {
926
- slides[i].style[swiper.getDirectionLabel('width')] = ``;
927
- }
928
- const slideStyles = getComputedStyle(slide);
929
- const currentTransform = slide.style.transform;
930
- const currentWebKitTransform = slide.style.webkitTransform;
931
- if (currentTransform) {
932
- slide.style.transform = 'none';
933
- }
934
- if (currentWebKitTransform) {
935
- slide.style.webkitTransform = 'none';
936
- }
937
- if (params.roundLengths) {
938
- slideSize = swiper.isHorizontal() ? elementOuterSize(slide, 'width') : elementOuterSize(slide, 'height');
939
- } else {
940
- // eslint-disable-next-line
941
- const width = getDirectionPropertyValue(slideStyles, 'width');
942
- const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
943
- const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
944
- const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
945
- const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
946
- const boxSizing = slideStyles.getPropertyValue('box-sizing');
947
- if (boxSizing && boxSizing === 'border-box') {
948
- slideSize = width + marginLeft + marginRight;
949
- } else {
950
- const {
951
- clientWidth,
952
- offsetWidth
953
- } = slide;
954
- slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
955
- }
956
- }
957
- if (currentTransform) {
958
- slide.style.transform = currentTransform;
959
- }
960
- if (currentWebKitTransform) {
961
- slide.style.webkitTransform = currentWebKitTransform;
962
- }
963
- if (params.roundLengths) slideSize = Math.floor(slideSize);
964
- } else {
965
- slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
966
- if (params.roundLengths) slideSize = Math.floor(slideSize);
967
- if (slides[i]) {
968
- slides[i].style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
969
- }
970
- }
971
- if (slides[i]) {
972
- slides[i].swiperSlideSize = slideSize;
973
- }
974
- slidesSizesGrid.push(slideSize);
975
- if (params.centeredSlides) {
976
- slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
977
- if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
978
- if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
979
- if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
980
- if (params.roundLengths) slidePosition = Math.floor(slidePosition);
981
- if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
982
- slidesGrid.push(slidePosition);
983
- } else {
984
- if (params.roundLengths) slidePosition = Math.floor(slidePosition);
985
- if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
986
- slidesGrid.push(slidePosition);
987
- slidePosition = slidePosition + slideSize + spaceBetween;
988
- }
989
- swiper.virtualSize += slideSize + spaceBetween;
990
- prevSlideSize = slideSize;
991
- index += 1;
992
- }
993
- swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
994
- if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
995
- wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
996
- }
997
- if (params.setWrapperSize) {
998
- wrapperEl.style[swiper.getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
999
- }
1000
- if (gridEnabled) {
1001
- swiper.grid.updateWrapperSize(slideSize, snapGrid);
1002
- }
1003
-
1004
- // Remove last grid elements depending on width
1005
- if (!params.centeredSlides) {
1006
- const newSlidesGrid = [];
1007
- for (let i = 0; i < snapGrid.length; i += 1) {
1008
- let slidesGridItem = snapGrid[i];
1009
- if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
1010
- if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
1011
- newSlidesGrid.push(slidesGridItem);
1012
- }
1013
- }
1014
- snapGrid = newSlidesGrid;
1015
- if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
1016
- snapGrid.push(swiper.virtualSize - swiperSize);
1017
- }
1018
- }
1019
- if (isVirtual && params.loop) {
1020
- const size = slidesSizesGrid[0] + spaceBetween;
1021
- if (params.slidesPerGroup > 1) {
1022
- const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup);
1023
- const groupSize = size * params.slidesPerGroup;
1024
- for (let i = 0; i < groups; i += 1) {
1025
- snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize);
1026
- }
1027
- }
1028
- for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) {
1029
- if (params.slidesPerGroup === 1) {
1030
- snapGrid.push(snapGrid[snapGrid.length - 1] + size);
1031
- }
1032
- slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size);
1033
- swiper.virtualSize += size;
1034
- }
1035
- }
1036
- if (snapGrid.length === 0) snapGrid = [0];
1037
- if (spaceBetween !== 0) {
1038
- const key = swiper.isHorizontal() && rtl ? 'marginLeft' : swiper.getDirectionLabel('marginRight');
1039
- slides.filter((_, slideIndex) => {
1040
- if (!params.cssMode || params.loop) return true;
1041
- if (slideIndex === slides.length - 1) {
1042
- return false;
1043
- }
1044
- return true;
1045
- }).forEach(slideEl => {
1046
- slideEl.style[key] = `${spaceBetween}px`;
1047
- });
1048
- }
1049
- if (params.centeredSlides && params.centeredSlidesBounds) {
1050
- let allSlidesSize = 0;
1051
- slidesSizesGrid.forEach(slideSizeValue => {
1052
- allSlidesSize += slideSizeValue + (spaceBetween || 0);
1053
- });
1054
- allSlidesSize -= spaceBetween;
1055
- const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0;
1056
- snapGrid = snapGrid.map(snap => {
1057
- if (snap <= 0) return -offsetBefore;
1058
- if (snap > maxSnap) return maxSnap + offsetAfter;
1059
- return snap;
1060
- });
1061
- }
1062
- if (params.centerInsufficientSlides) {
1063
- let allSlidesSize = 0;
1064
- slidesSizesGrid.forEach(slideSizeValue => {
1065
- allSlidesSize += slideSizeValue + (spaceBetween || 0);
1066
- });
1067
- allSlidesSize -= spaceBetween;
1068
- const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
1069
- if (allSlidesSize + offsetSize < swiperSize) {
1070
- const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
1071
- snapGrid.forEach((snap, snapIndex) => {
1072
- snapGrid[snapIndex] = snap - allSlidesOffset;
1073
- });
1074
- slidesGrid.forEach((snap, snapIndex) => {
1075
- slidesGrid[snapIndex] = snap + allSlidesOffset;
1076
- });
1077
- }
1078
- }
1079
- Object.assign(swiper, {
1080
- slides,
1081
- snapGrid,
1082
- slidesGrid,
1083
- slidesSizesGrid
1084
- });
1085
- if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
1086
- setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
1087
- setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
1088
- const addToSnapGrid = -swiper.snapGrid[0];
1089
- const addToSlidesGrid = -swiper.slidesGrid[0];
1090
- swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);
1091
- swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);
1092
- }
1093
- if (slidesLength !== previousSlidesLength) {
1094
- swiper.emit('slidesLengthChange');
1095
- }
1096
- if (snapGrid.length !== previousSnapGridLength) {
1097
- if (swiper.params.watchOverflow) swiper.checkOverflow();
1098
- swiper.emit('snapGridLengthChange');
1099
- }
1100
- if (slidesGrid.length !== previousSlidesGridLength) {
1101
- swiper.emit('slidesGridLengthChange');
1102
- }
1103
- if (params.watchSlidesProgress) {
1104
- swiper.updateSlidesOffset();
1105
- }
1106
- swiper.emit('slidesUpdated');
1107
- if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
1108
- const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
1109
- const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
1110
- if (slidesLength <= params.maxBackfaceHiddenSlides) {
1111
- if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass);
1112
- } else if (hasClassBackfaceClassAdded) {
1113
- swiper.el.classList.remove(backFaceHiddenClass);
1114
- }
1115
- }
1116
- }
1117
-
1118
- function updateAutoHeight(speed) {
1119
- const swiper = this;
1120
- const activeSlides = [];
1121
- const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1122
- let newHeight = 0;
1123
- let i;
1124
- if (typeof speed === 'number') {
1125
- swiper.setTransition(speed);
1126
- } else if (speed === true) {
1127
- swiper.setTransition(swiper.params.speed);
1128
- }
1129
- const getSlideByIndex = index => {
1130
- if (isVirtual) {
1131
- return swiper.slides[swiper.getSlideIndexByData(index)];
1132
- }
1133
- return swiper.slides[index];
1134
- };
1135
- // Find slides currently in view
1136
- if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
1137
- if (swiper.params.centeredSlides) {
1138
- (swiper.visibleSlides || []).forEach(slide => {
1139
- activeSlides.push(slide);
1140
- });
1141
- } else {
1142
- for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
1143
- const index = swiper.activeIndex + i;
1144
- if (index > swiper.slides.length && !isVirtual) break;
1145
- activeSlides.push(getSlideByIndex(index));
1146
- }
1147
- }
1148
- } else {
1149
- activeSlides.push(getSlideByIndex(swiper.activeIndex));
1150
- }
1151
-
1152
- // Find new height from highest slide in view
1153
- for (i = 0; i < activeSlides.length; i += 1) {
1154
- if (typeof activeSlides[i] !== 'undefined') {
1155
- const height = activeSlides[i].offsetHeight;
1156
- newHeight = height > newHeight ? height : newHeight;
1157
- }
1158
- }
1159
-
1160
- // Update Height
1161
- if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`;
1162
- }
1163
-
1164
- function updateSlidesOffset() {
1165
- const swiper = this;
1166
- const slides = swiper.slides;
1167
- // eslint-disable-next-line
1168
- const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0;
1169
- for (let i = 0; i < slides.length; i += 1) {
1170
- slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();
1171
- }
1172
- }
1173
-
1174
- const toggleSlideClasses$1 = (slideEl, condition, className) => {
1175
- if (condition && !slideEl.classList.contains(className)) {
1176
- slideEl.classList.add(className);
1177
- } else if (!condition && slideEl.classList.contains(className)) {
1178
- slideEl.classList.remove(className);
1179
- }
1180
- };
1181
- function updateSlidesProgress(translate) {
1182
- if (translate === void 0) {
1183
- translate = this && this.translate || 0;
1184
- }
1185
- const swiper = this;
1186
- const params = swiper.params;
1187
- const {
1188
- slides,
1189
- rtlTranslate: rtl,
1190
- snapGrid
1191
- } = swiper;
1192
- if (slides.length === 0) return;
1193
- if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
1194
- let offsetCenter = -translate;
1195
- if (rtl) offsetCenter = translate;
1196
- swiper.visibleSlidesIndexes = [];
1197
- swiper.visibleSlides = [];
1198
- let spaceBetween = params.spaceBetween;
1199
- if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
1200
- spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;
1201
- } else if (typeof spaceBetween === 'string') {
1202
- spaceBetween = parseFloat(spaceBetween);
1203
- }
1204
- for (let i = 0; i < slides.length; i += 1) {
1205
- const slide = slides[i];
1206
- let slideOffset = slide.swiperSlideOffset;
1207
- if (params.cssMode && params.centeredSlides) {
1208
- slideOffset -= slides[0].swiperSlideOffset;
1209
- }
1210
- const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
1211
- const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
1212
- const slideBefore = -(offsetCenter - slideOffset);
1213
- const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
1214
- const isFullyVisible = slideBefore >= 0 && slideBefore <= swiper.size - swiper.slidesSizesGrid[i];
1215
- const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
1216
- if (isVisible) {
1217
- swiper.visibleSlides.push(slide);
1218
- swiper.visibleSlidesIndexes.push(i);
1219
- }
1220
- toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
1221
- toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
1222
- slide.progress = rtl ? -slideProgress : slideProgress;
1223
- slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
1224
- }
1225
- }
1226
-
1227
- function updateProgress(translate) {
1228
- const swiper = this;
1229
- if (typeof translate === 'undefined') {
1230
- const multiplier = swiper.rtlTranslate ? -1 : 1;
1231
- // eslint-disable-next-line
1232
- translate = swiper && swiper.translate && swiper.translate * multiplier || 0;
1233
- }
1234
- const params = swiper.params;
1235
- const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1236
- let {
1237
- progress,
1238
- isBeginning,
1239
- isEnd,
1240
- progressLoop
1241
- } = swiper;
1242
- const wasBeginning = isBeginning;
1243
- const wasEnd = isEnd;
1244
- if (translatesDiff === 0) {
1245
- progress = 0;
1246
- isBeginning = true;
1247
- isEnd = true;
1248
- } else {
1249
- progress = (translate - swiper.minTranslate()) / translatesDiff;
1250
- const isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1;
1251
- const isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1;
1252
- isBeginning = isBeginningRounded || progress <= 0;
1253
- isEnd = isEndRounded || progress >= 1;
1254
- if (isBeginningRounded) progress = 0;
1255
- if (isEndRounded) progress = 1;
1256
- }
1257
- if (params.loop) {
1258
- const firstSlideIndex = swiper.getSlideIndexByData(0);
1259
- const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1);
1260
- const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex];
1261
- const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex];
1262
- const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1];
1263
- const translateAbs = Math.abs(translate);
1264
- if (translateAbs >= firstSlideTranslate) {
1265
- progressLoop = (translateAbs - firstSlideTranslate) / translateMax;
1266
- } else {
1267
- progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax;
1268
- }
1269
- if (progressLoop > 1) progressLoop -= 1;
1270
- }
1271
- Object.assign(swiper, {
1272
- progress,
1273
- progressLoop,
1274
- isBeginning,
1275
- isEnd
1276
- });
1277
- if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);
1278
- if (isBeginning && !wasBeginning) {
1279
- swiper.emit('reachBeginning toEdge');
1280
- }
1281
- if (isEnd && !wasEnd) {
1282
- swiper.emit('reachEnd toEdge');
1283
- }
1284
- if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
1285
- swiper.emit('fromEdge');
1286
- }
1287
- swiper.emit('progress', progress);
1288
- }
1289
-
1290
- const toggleSlideClasses = (slideEl, condition, className) => {
1291
- if (condition && !slideEl.classList.contains(className)) {
1292
- slideEl.classList.add(className);
1293
- } else if (!condition && slideEl.classList.contains(className)) {
1294
- slideEl.classList.remove(className);
1295
- }
1296
- };
1297
- function updateSlidesClasses() {
1298
- const swiper = this;
1299
- const {
1300
- slides,
1301
- params,
1302
- slidesEl,
1303
- activeIndex
1304
- } = swiper;
1305
- const isVirtual = swiper.virtual && params.virtual.enabled;
1306
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
1307
- const getFilteredSlide = selector => {
1308
- return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
1309
- };
1310
- let activeSlide;
1311
- let prevSlide;
1312
- let nextSlide;
1313
- if (isVirtual) {
1314
- if (params.loop) {
1315
- let slideIndex = activeIndex - swiper.virtual.slidesBefore;
1316
- if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex;
1317
- if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length;
1318
- activeSlide = getFilteredSlide(`[data-swiper-slide-index="${slideIndex}"]`);
1319
- } else {
1320
- activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
1321
- }
1322
- } else {
1323
- if (gridEnabled) {
1324
- activeSlide = slides.find(slideEl => slideEl.column === activeIndex);
1325
- nextSlide = slides.find(slideEl => slideEl.column === activeIndex + 1);
1326
- prevSlide = slides.find(slideEl => slideEl.column === activeIndex - 1);
1327
- } else {
1328
- activeSlide = slides[activeIndex];
1329
- }
1330
- }
1331
- if (activeSlide) {
1332
- if (!gridEnabled) {
1333
- // Next Slide
1334
- nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1335
- if (params.loop && !nextSlide) {
1336
- nextSlide = slides[0];
1337
- }
1338
-
1339
- // Prev Slide
1340
- prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1341
- if (params.loop && !prevSlide === 0) {
1342
- prevSlide = slides[slides.length - 1];
1343
- }
1344
- }
1345
- }
1346
- slides.forEach(slideEl => {
1347
- toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
1348
- toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
1349
- toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
1350
- });
1351
- swiper.emitSlidesClasses();
1352
- }
1353
-
1354
- const processLazyPreloader = (swiper, imageEl) => {
1355
- if (!swiper || swiper.destroyed || !swiper.params) return;
1356
- const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;
1357
- const slideEl = imageEl.closest(slideSelector());
1358
- if (slideEl) {
1359
- let lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1360
- if (!lazyEl && swiper.isElement) {
1361
- if (slideEl.shadowRoot) {
1362
- lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1363
- } else {
1364
- // init later
1365
- requestAnimationFrame(() => {
1366
- if (slideEl.shadowRoot) {
1367
- lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1368
- if (lazyEl) lazyEl.remove();
1369
- }
1370
- });
1371
- }
1372
- }
1373
- if (lazyEl) lazyEl.remove();
1374
- }
1375
- };
1376
- const unlazy = (swiper, index) => {
1377
- if (!swiper.slides[index]) return;
1378
- const imageEl = swiper.slides[index].querySelector('[loading="lazy"]');
1379
- if (imageEl) imageEl.removeAttribute('loading');
1380
- };
1381
- const preload = swiper => {
1382
- if (!swiper || swiper.destroyed || !swiper.params) return;
1383
- let amount = swiper.params.lazyPreloadPrevNext;
1384
- const len = swiper.slides.length;
1385
- if (!len || !amount || amount < 0) return;
1386
- amount = Math.min(amount, len);
1387
- const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView);
1388
- const activeIndex = swiper.activeIndex;
1389
- if (swiper.params.grid && swiper.params.grid.rows > 1) {
1390
- const activeColumn = activeIndex;
1391
- const preloadColumns = [activeColumn - amount];
1392
- preloadColumns.push(...Array.from({
1393
- length: amount
1394
- }).map((_, i) => {
1395
- return activeColumn + slidesPerView + i;
1396
- }));
1397
- swiper.slides.forEach((slideEl, i) => {
1398
- if (preloadColumns.includes(slideEl.column)) unlazy(swiper, i);
1399
- });
1400
- return;
1401
- }
1402
- const slideIndexLastInView = activeIndex + slidesPerView - 1;
1403
- if (swiper.params.rewind || swiper.params.loop) {
1404
- for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) {
1405
- const realIndex = (i % len + len) % len;
1406
- if (realIndex < activeIndex || realIndex > slideIndexLastInView) unlazy(swiper, realIndex);
1407
- }
1408
- } else {
1409
- for (let i = Math.max(activeIndex - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) {
1410
- if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) {
1411
- unlazy(swiper, i);
1412
- }
1413
- }
1414
- }
1415
- };
1416
-
1417
- function getActiveIndexByTranslate(swiper) {
1418
- const {
1419
- slidesGrid,
1420
- params
1421
- } = swiper;
1422
- const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1423
- let activeIndex;
1424
- for (let i = 0; i < slidesGrid.length; i += 1) {
1425
- if (typeof slidesGrid[i + 1] !== 'undefined') {
1426
- if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
1427
- activeIndex = i;
1428
- } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
1429
- activeIndex = i + 1;
1430
- }
1431
- } else if (translate >= slidesGrid[i]) {
1432
- activeIndex = i;
1433
- }
1434
- }
1435
- // Normalize slideIndex
1436
- if (params.normalizeSlideIndex) {
1437
- if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
1438
- }
1439
- return activeIndex;
1440
- }
1441
- function updateActiveIndex(newActiveIndex) {
1442
- const swiper = this;
1443
- const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1444
- const {
1445
- snapGrid,
1446
- params,
1447
- activeIndex: previousIndex,
1448
- realIndex: previousRealIndex,
1449
- snapIndex: previousSnapIndex
1450
- } = swiper;
1451
- let activeIndex = newActiveIndex;
1452
- let snapIndex;
1453
- const getVirtualRealIndex = aIndex => {
1454
- let realIndex = aIndex - swiper.virtual.slidesBefore;
1455
- if (realIndex < 0) {
1456
- realIndex = swiper.virtual.slides.length + realIndex;
1457
- }
1458
- if (realIndex >= swiper.virtual.slides.length) {
1459
- realIndex -= swiper.virtual.slides.length;
1460
- }
1461
- return realIndex;
1462
- };
1463
- if (typeof activeIndex === 'undefined') {
1464
- activeIndex = getActiveIndexByTranslate(swiper);
1465
- }
1466
- if (snapGrid.indexOf(translate) >= 0) {
1467
- snapIndex = snapGrid.indexOf(translate);
1468
- } else {
1469
- const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
1470
- snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
1471
- }
1472
- if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1473
- if (activeIndex === previousIndex && !swiper.params.loop) {
1474
- if (snapIndex !== previousSnapIndex) {
1475
- swiper.snapIndex = snapIndex;
1476
- swiper.emit('snapIndexChange');
1477
- }
1478
- return;
1479
- }
1480
- if (activeIndex === previousIndex && swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
1481
- swiper.realIndex = getVirtualRealIndex(activeIndex);
1482
- return;
1483
- }
1484
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
1485
-
1486
- // Get real index
1487
- let realIndex;
1488
- if (swiper.virtual && params.virtual.enabled && params.loop) {
1489
- realIndex = getVirtualRealIndex(activeIndex);
1490
- } else if (gridEnabled) {
1491
- const firstSlideInColumn = swiper.slides.find(slideEl => slideEl.column === activeIndex);
1492
- let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
1493
- if (Number.isNaN(activeSlideIndex)) {
1494
- activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
1495
- }
1496
- realIndex = Math.floor(activeSlideIndex / params.grid.rows);
1497
- } else if (swiper.slides[activeIndex]) {
1498
- const slideIndex = swiper.slides[activeIndex].getAttribute('data-swiper-slide-index');
1499
- if (slideIndex) {
1500
- realIndex = parseInt(slideIndex, 10);
1501
- } else {
1502
- realIndex = activeIndex;
1503
- }
1504
- } else {
1505
- realIndex = activeIndex;
1506
- }
1507
- Object.assign(swiper, {
1508
- previousSnapIndex,
1509
- snapIndex,
1510
- previousRealIndex,
1511
- realIndex,
1512
- previousIndex,
1513
- activeIndex
1514
- });
1515
- if (swiper.initialized) {
1516
- preload(swiper);
1517
- }
1518
- swiper.emit('activeIndexChange');
1519
- swiper.emit('snapIndexChange');
1520
- if (swiper.initialized || swiper.params.runCallbacksOnInit) {
1521
- if (previousRealIndex !== realIndex) {
1522
- swiper.emit('realIndexChange');
1523
- }
1524
- swiper.emit('slideChange');
1525
- }
1526
- }
1527
-
1528
- function updateClickedSlide(el, path) {
1529
- const swiper = this;
1530
- const params = swiper.params;
1531
- let slide = el.closest(`.${params.slideClass}, swiper-slide`);
1532
- if (!slide && swiper.isElement && path && path.length > 1 && path.includes(el)) {
1533
- [...path.slice(path.indexOf(el) + 1, path.length)].forEach(pathEl => {
1534
- if (!slide && pathEl.matches && pathEl.matches(`.${params.slideClass}, swiper-slide`)) {
1535
- slide = pathEl;
1536
- }
1537
- });
1538
- }
1539
- let slideFound = false;
1540
- let slideIndex;
1541
- if (slide) {
1542
- for (let i = 0; i < swiper.slides.length; i += 1) {
1543
- if (swiper.slides[i] === slide) {
1544
- slideFound = true;
1545
- slideIndex = i;
1546
- break;
1547
- }
1548
- }
1549
- }
1550
- if (slide && slideFound) {
1551
- swiper.clickedSlide = slide;
1552
- if (swiper.virtual && swiper.params.virtual.enabled) {
1553
- swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10);
1554
- } else {
1555
- swiper.clickedIndex = slideIndex;
1556
- }
1557
- } else {
1558
- swiper.clickedSlide = undefined;
1559
- swiper.clickedIndex = undefined;
1560
- return;
1561
- }
1562
- if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
1563
- swiper.slideToClickedSlide();
1564
- }
1565
- }
1566
-
1567
- var update = {
1568
- updateSize,
1569
- updateSlides,
1570
- updateAutoHeight,
1571
- updateSlidesOffset,
1572
- updateSlidesProgress,
1573
- updateProgress,
1574
- updateSlidesClasses,
1575
- updateActiveIndex,
1576
- updateClickedSlide
1577
- };
1578
-
1579
- function getSwiperTranslate(axis) {
1580
- if (axis === void 0) {
1581
- axis = this.isHorizontal() ? 'x' : 'y';
1582
- }
1583
- const swiper = this;
1584
- const {
1585
- params,
1586
- rtlTranslate: rtl,
1587
- translate,
1588
- wrapperEl
1589
- } = swiper;
1590
- if (params.virtualTranslate) {
1591
- return rtl ? -translate : translate;
1592
- }
1593
- if (params.cssMode) {
1594
- return translate;
1595
- }
1596
- let currentTranslate = getTranslate(wrapperEl, axis);
1597
- currentTranslate += swiper.cssOverflowAdjustment();
1598
- if (rtl) currentTranslate = -currentTranslate;
1599
- return currentTranslate || 0;
1600
- }
1601
-
1602
- function setTranslate(translate, byController) {
1603
- const swiper = this;
1604
- const {
1605
- rtlTranslate: rtl,
1606
- params,
1607
- wrapperEl,
1608
- progress
1609
- } = swiper;
1610
- let x = 0;
1611
- let y = 0;
1612
- const z = 0;
1613
- if (swiper.isHorizontal()) {
1614
- x = rtl ? -translate : translate;
1615
- } else {
1616
- y = translate;
1617
- }
1618
- if (params.roundLengths) {
1619
- x = Math.floor(x);
1620
- y = Math.floor(y);
1621
- }
1622
- swiper.previousTranslate = swiper.translate;
1623
- swiper.translate = swiper.isHorizontal() ? x : y;
1624
- if (params.cssMode) {
1625
- wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
1626
- } else if (!params.virtualTranslate) {
1627
- if (swiper.isHorizontal()) {
1628
- x -= swiper.cssOverflowAdjustment();
1629
- } else {
1630
- y -= swiper.cssOverflowAdjustment();
1631
- }
1632
- wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`;
1633
- }
1634
-
1635
- // Check if we need to update progress
1636
- let newProgress;
1637
- const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1638
- if (translatesDiff === 0) {
1639
- newProgress = 0;
1640
- } else {
1641
- newProgress = (translate - swiper.minTranslate()) / translatesDiff;
1642
- }
1643
- if (newProgress !== progress) {
1644
- swiper.updateProgress(translate);
1645
- }
1646
- swiper.emit('setTranslate', swiper.translate, byController);
1647
- }
1648
-
1649
- function minTranslate() {
1650
- return -this.snapGrid[0];
1651
- }
1652
-
1653
- function maxTranslate() {
1654
- return -this.snapGrid[this.snapGrid.length - 1];
1655
- }
1656
-
1657
- function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
1658
- if (translate === void 0) {
1659
- translate = 0;
1660
- }
1661
- if (speed === void 0) {
1662
- speed = this.params.speed;
1663
- }
1664
- if (runCallbacks === void 0) {
1665
- runCallbacks = true;
1666
- }
1667
- if (translateBounds === void 0) {
1668
- translateBounds = true;
1669
- }
1670
- const swiper = this;
1671
- const {
1672
- params,
1673
- wrapperEl
1674
- } = swiper;
1675
- if (swiper.animating && params.preventInteractionOnTransition) {
1676
- return false;
1677
- }
1678
- const minTranslate = swiper.minTranslate();
1679
- const maxTranslate = swiper.maxTranslate();
1680
- let newTranslate;
1681
- if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate;
1682
-
1683
- // Update progress
1684
- swiper.updateProgress(newTranslate);
1685
- if (params.cssMode) {
1686
- const isH = swiper.isHorizontal();
1687
- if (speed === 0) {
1688
- wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
1689
- } else {
1690
- if (!swiper.support.smoothScroll) {
1691
- animateCSSModeScroll({
1692
- swiper,
1693
- targetPosition: -newTranslate,
1694
- side: isH ? 'left' : 'top'
1695
- });
1696
- return true;
1697
- }
1698
- wrapperEl.scrollTo({
1699
- [isH ? 'left' : 'top']: -newTranslate,
1700
- behavior: 'smooth'
1701
- });
1702
- }
1703
- return true;
1704
- }
1705
- if (speed === 0) {
1706
- swiper.setTransition(0);
1707
- swiper.setTranslate(newTranslate);
1708
- if (runCallbacks) {
1709
- swiper.emit('beforeTransitionStart', speed, internal);
1710
- swiper.emit('transitionEnd');
1711
- }
1712
- } else {
1713
- swiper.setTransition(speed);
1714
- swiper.setTranslate(newTranslate);
1715
- if (runCallbacks) {
1716
- swiper.emit('beforeTransitionStart', speed, internal);
1717
- swiper.emit('transitionStart');
1718
- }
1719
- if (!swiper.animating) {
1720
- swiper.animating = true;
1721
- if (!swiper.onTranslateToWrapperTransitionEnd) {
1722
- swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
1723
- if (!swiper || swiper.destroyed) return;
1724
- if (e.target !== this) return;
1725
- swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
1726
- swiper.onTranslateToWrapperTransitionEnd = null;
1727
- delete swiper.onTranslateToWrapperTransitionEnd;
1728
- swiper.animating = false;
1729
- if (runCallbacks) {
1730
- swiper.emit('transitionEnd');
1731
- }
1732
- };
1733
- }
1734
- swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
1735
- }
1736
- }
1737
- return true;
1738
- }
1739
-
1740
- var translate = {
1741
- getTranslate: getSwiperTranslate,
1742
- setTranslate,
1743
- minTranslate,
1744
- maxTranslate,
1745
- translateTo
1746
- };
1747
-
1748
- function setTransition(duration, byController) {
1749
- const swiper = this;
1750
- if (!swiper.params.cssMode) {
1751
- swiper.wrapperEl.style.transitionDuration = `${duration}ms`;
1752
- swiper.wrapperEl.style.transitionDelay = duration === 0 ? `0ms` : '';
1753
- }
1754
- swiper.emit('setTransition', duration, byController);
1755
- }
1756
-
1757
- function transitionEmit(_ref) {
1758
- let {
1759
- swiper,
1760
- runCallbacks,
1761
- direction,
1762
- step
1763
- } = _ref;
1764
- const {
1765
- activeIndex,
1766
- previousIndex
1767
- } = swiper;
1768
- let dir = direction;
1769
- if (!dir) {
1770
- if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
1771
- }
1772
- swiper.emit(`transition${step}`);
1773
- if (runCallbacks && activeIndex !== previousIndex) {
1774
- if (dir === 'reset') {
1775
- swiper.emit(`slideResetTransition${step}`);
1776
- return;
1777
- }
1778
- swiper.emit(`slideChangeTransition${step}`);
1779
- if (dir === 'next') {
1780
- swiper.emit(`slideNextTransition${step}`);
1781
- } else {
1782
- swiper.emit(`slidePrevTransition${step}`);
1783
- }
1784
- }
1785
- }
1786
-
1787
- function transitionStart(runCallbacks, direction) {
1788
- if (runCallbacks === void 0) {
1789
- runCallbacks = true;
1790
- }
1791
- const swiper = this;
1792
- const {
1793
- params
1794
- } = swiper;
1795
- if (params.cssMode) return;
1796
- if (params.autoHeight) {
1797
- swiper.updateAutoHeight();
1798
- }
1799
- transitionEmit({
1800
- swiper,
1801
- runCallbacks,
1802
- direction,
1803
- step: 'Start'
1804
- });
1805
- }
1806
-
1807
- function transitionEnd(runCallbacks, direction) {
1808
- if (runCallbacks === void 0) {
1809
- runCallbacks = true;
1810
- }
1811
- const swiper = this;
1812
- const {
1813
- params
1814
- } = swiper;
1815
- swiper.animating = false;
1816
- if (params.cssMode) return;
1817
- swiper.setTransition(0);
1818
- transitionEmit({
1819
- swiper,
1820
- runCallbacks,
1821
- direction,
1822
- step: 'End'
1823
- });
1824
- }
1825
-
1826
- var transition = {
1827
- setTransition,
1828
- transitionStart,
1829
- transitionEnd
1830
- };
1831
-
1832
- function slideTo(index, speed, runCallbacks, internal, initial) {
1833
- if (index === void 0) {
1834
- index = 0;
1835
- }
1836
- if (runCallbacks === void 0) {
1837
- runCallbacks = true;
1838
- }
1839
- if (typeof index === 'string') {
1840
- index = parseInt(index, 10);
1841
- }
1842
- const swiper = this;
1843
- let slideIndex = index;
1844
- if (slideIndex < 0) slideIndex = 0;
1845
- const {
1846
- params,
1847
- snapGrid,
1848
- slidesGrid,
1849
- previousIndex,
1850
- activeIndex,
1851
- rtlTranslate: rtl,
1852
- wrapperEl,
1853
- enabled
1854
- } = swiper;
1855
- if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {
1856
- return false;
1857
- }
1858
- if (typeof speed === 'undefined') {
1859
- speed = swiper.params.speed;
1860
- }
1861
- const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
1862
- let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
1863
- if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1864
- const translate = -snapGrid[snapIndex];
1865
- // Normalize slideIndex
1866
- if (params.normalizeSlideIndex) {
1867
- for (let i = 0; i < slidesGrid.length; i += 1) {
1868
- const normalizedTranslate = -Math.floor(translate * 100);
1869
- const normalizedGrid = Math.floor(slidesGrid[i] * 100);
1870
- const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
1871
- if (typeof slidesGrid[i + 1] !== 'undefined') {
1872
- if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
1873
- slideIndex = i;
1874
- } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
1875
- slideIndex = i + 1;
1876
- }
1877
- } else if (normalizedTranslate >= normalizedGrid) {
1878
- slideIndex = i;
1879
- }
1880
- }
1881
- }
1882
- // Directions locks
1883
- if (swiper.initialized && slideIndex !== activeIndex) {
1884
- if (!swiper.allowSlideNext && (rtl ? translate > swiper.translate && translate > swiper.minTranslate() : translate < swiper.translate && translate < swiper.minTranslate())) {
1885
- return false;
1886
- }
1887
- if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
1888
- if ((activeIndex || 0) !== slideIndex) {
1889
- return false;
1890
- }
1891
- }
1892
- }
1893
- if (slideIndex !== (previousIndex || 0) && runCallbacks) {
1894
- swiper.emit('beforeSlideChangeStart');
1895
- }
1896
-
1897
- // Update progress
1898
- swiper.updateProgress(translate);
1899
- let direction;
1900
- if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
1901
-
1902
- // initial virtual
1903
- const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1904
- const isInitialVirtual = isVirtual && initial;
1905
- // Update Index
1906
- if (!isInitialVirtual && (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate)) {
1907
- swiper.updateActiveIndex(slideIndex);
1908
- // Update Height
1909
- if (params.autoHeight) {
1910
- swiper.updateAutoHeight();
1911
- }
1912
- swiper.updateSlidesClasses();
1913
- if (params.effect !== 'slide') {
1914
- swiper.setTranslate(translate);
1915
- }
1916
- if (direction !== 'reset') {
1917
- swiper.transitionStart(runCallbacks, direction);
1918
- swiper.transitionEnd(runCallbacks, direction);
1919
- }
1920
- return false;
1921
- }
1922
- if (params.cssMode) {
1923
- const isH = swiper.isHorizontal();
1924
- const t = rtl ? translate : -translate;
1925
- if (speed === 0) {
1926
- if (isVirtual) {
1927
- swiper.wrapperEl.style.scrollSnapType = 'none';
1928
- swiper._immediateVirtual = true;
1929
- }
1930
- if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {
1931
- swiper._cssModeVirtualInitialSet = true;
1932
- requestAnimationFrame(() => {
1933
- wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
1934
- });
1935
- } else {
1936
- wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
1937
- }
1938
- if (isVirtual) {
1939
- requestAnimationFrame(() => {
1940
- swiper.wrapperEl.style.scrollSnapType = '';
1941
- swiper._immediateVirtual = false;
1942
- });
1943
- }
1944
- } else {
1945
- if (!swiper.support.smoothScroll) {
1946
- animateCSSModeScroll({
1947
- swiper,
1948
- targetPosition: t,
1949
- side: isH ? 'left' : 'top'
1950
- });
1951
- return true;
1952
- }
1953
- wrapperEl.scrollTo({
1954
- [isH ? 'left' : 'top']: t,
1955
- behavior: 'smooth'
1956
- });
1957
- }
1958
- return true;
1959
- }
1960
- const browser = getBrowser();
1961
- const isSafari = browser.isSafari;
1962
- if (isVirtual && !initial && isSafari && swiper.isElement) {
1963
- swiper.virtual.update(false, false, slideIndex);
1964
- }
1965
- swiper.setTransition(speed);
1966
- swiper.setTranslate(translate);
1967
- swiper.updateActiveIndex(slideIndex);
1968
- swiper.updateSlidesClasses();
1969
- swiper.emit('beforeTransitionStart', speed, internal);
1970
- swiper.transitionStart(runCallbacks, direction);
1971
- if (speed === 0) {
1972
- swiper.transitionEnd(runCallbacks, direction);
1973
- } else if (!swiper.animating) {
1974
- swiper.animating = true;
1975
- if (!swiper.onSlideToWrapperTransitionEnd) {
1976
- swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
1977
- if (!swiper || swiper.destroyed) return;
1978
- if (e.target !== this) return;
1979
- swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
1980
- swiper.onSlideToWrapperTransitionEnd = null;
1981
- delete swiper.onSlideToWrapperTransitionEnd;
1982
- swiper.transitionEnd(runCallbacks, direction);
1983
- };
1984
- }
1985
- swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
1986
- }
1987
- return true;
1988
- }
1989
-
1990
- function slideToLoop(index, speed, runCallbacks, internal) {
1991
- if (index === void 0) {
1992
- index = 0;
1993
- }
1994
- if (runCallbacks === void 0) {
1995
- runCallbacks = true;
1996
- }
1997
- if (typeof index === 'string') {
1998
- const indexAsNumber = parseInt(index, 10);
1999
- index = indexAsNumber;
2000
- }
2001
- const swiper = this;
2002
- if (swiper.destroyed) return;
2003
- if (typeof speed === 'undefined') {
2004
- speed = swiper.params.speed;
2005
- }
2006
- const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
2007
- let newIndex = index;
2008
- if (swiper.params.loop) {
2009
- if (swiper.virtual && swiper.params.virtual.enabled) {
2010
- // eslint-disable-next-line
2011
- newIndex = newIndex + swiper.virtual.slidesBefore;
2012
- } else {
2013
- let targetSlideIndex;
2014
- if (gridEnabled) {
2015
- const slideIndex = newIndex * swiper.params.grid.rows;
2016
- targetSlideIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
2017
- } else {
2018
- targetSlideIndex = swiper.getSlideIndexByData(newIndex);
2019
- }
2020
- const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
2021
- const {
2022
- centeredSlides
2023
- } = swiper.params;
2024
- let slidesPerView = swiper.params.slidesPerView;
2025
- if (slidesPerView === 'auto') {
2026
- slidesPerView = swiper.slidesPerViewDynamic();
2027
- } else {
2028
- slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
2029
- if (centeredSlides && slidesPerView % 2 === 0) {
2030
- slidesPerView = slidesPerView + 1;
2031
- }
2032
- }
2033
- let needLoopFix = cols - targetSlideIndex < slidesPerView;
2034
- if (centeredSlides) {
2035
- needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
2036
- }
2037
- if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
2038
- needLoopFix = false;
2039
- }
2040
- if (needLoopFix) {
2041
- const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
2042
- swiper.loopFix({
2043
- direction,
2044
- slideTo: true,
2045
- activeSlideIndex: direction === 'next' ? targetSlideIndex + 1 : targetSlideIndex - cols + 1,
2046
- slideRealIndex: direction === 'next' ? swiper.realIndex : undefined
2047
- });
2048
- }
2049
- if (gridEnabled) {
2050
- const slideIndex = newIndex * swiper.params.grid.rows;
2051
- newIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
2052
- } else {
2053
- newIndex = swiper.getSlideIndexByData(newIndex);
2054
- }
2055
- }
2056
- }
2057
- requestAnimationFrame(() => {
2058
- swiper.slideTo(newIndex, speed, runCallbacks, internal);
2059
- });
2060
- return swiper;
2061
- }
2062
-
2063
- /* eslint no-unused-vars: "off" */
2064
- function slideNext(speed, runCallbacks, internal) {
2065
- if (runCallbacks === void 0) {
2066
- runCallbacks = true;
2067
- }
2068
- const swiper = this;
2069
- const {
2070
- enabled,
2071
- params,
2072
- animating
2073
- } = swiper;
2074
- if (!enabled || swiper.destroyed) return swiper;
2075
- if (typeof speed === 'undefined') {
2076
- speed = swiper.params.speed;
2077
- }
2078
- let perGroup = params.slidesPerGroup;
2079
- if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
2080
- perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
2081
- }
2082
- const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
2083
- const isVirtual = swiper.virtual && params.virtual.enabled;
2084
- if (params.loop) {
2085
- if (animating && !isVirtual && params.loopPreventsSliding) return false;
2086
- swiper.loopFix({
2087
- direction: 'next'
2088
- });
2089
- // eslint-disable-next-line
2090
- swiper._clientLeft = swiper.wrapperEl.clientLeft;
2091
- if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {
2092
- requestAnimationFrame(() => {
2093
- swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
2094
- });
2095
- return true;
2096
- }
2097
- }
2098
- if (params.rewind && swiper.isEnd) {
2099
- return swiper.slideTo(0, speed, runCallbacks, internal);
2100
- }
2101
- return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
2102
- }
2103
-
2104
- /* eslint no-unused-vars: "off" */
2105
- function slidePrev(speed, runCallbacks, internal) {
2106
- if (runCallbacks === void 0) {
2107
- runCallbacks = true;
2108
- }
2109
- const swiper = this;
2110
- const {
2111
- params,
2112
- snapGrid,
2113
- slidesGrid,
2114
- rtlTranslate,
2115
- enabled,
2116
- animating
2117
- } = swiper;
2118
- if (!enabled || swiper.destroyed) return swiper;
2119
- if (typeof speed === 'undefined') {
2120
- speed = swiper.params.speed;
2121
- }
2122
- const isVirtual = swiper.virtual && params.virtual.enabled;
2123
- if (params.loop) {
2124
- if (animating && !isVirtual && params.loopPreventsSliding) return false;
2125
- swiper.loopFix({
2126
- direction: 'prev'
2127
- });
2128
- // eslint-disable-next-line
2129
- swiper._clientLeft = swiper.wrapperEl.clientLeft;
2130
- }
2131
- const translate = rtlTranslate ? swiper.translate : -swiper.translate;
2132
- function normalize(val) {
2133
- if (val < 0) return -Math.floor(Math.abs(val));
2134
- return Math.floor(val);
2135
- }
2136
- const normalizedTranslate = normalize(translate);
2137
- const normalizedSnapGrid = snapGrid.map(val => normalize(val));
2138
- const isFreeMode = params.freeMode && params.freeMode.enabled;
2139
- let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
2140
- if (typeof prevSnap === 'undefined' && (params.cssMode || isFreeMode)) {
2141
- let prevSnapIndex;
2142
- snapGrid.forEach((snap, snapIndex) => {
2143
- if (normalizedTranslate >= snap) {
2144
- // prevSnap = snap;
2145
- prevSnapIndex = snapIndex;
2146
- }
2147
- });
2148
- if (typeof prevSnapIndex !== 'undefined') {
2149
- prevSnap = isFreeMode ? snapGrid[prevSnapIndex] : snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
2150
- }
2151
- }
2152
- let prevIndex = 0;
2153
- if (typeof prevSnap !== 'undefined') {
2154
- prevIndex = slidesGrid.indexOf(prevSnap);
2155
- if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
2156
- if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
2157
- prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;
2158
- prevIndex = Math.max(prevIndex, 0);
2159
- }
2160
- }
2161
- if (params.rewind && swiper.isBeginning) {
2162
- const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
2163
- return swiper.slideTo(lastIndex, speed, runCallbacks, internal);
2164
- } else if (params.loop && swiper.activeIndex === 0 && params.cssMode) {
2165
- requestAnimationFrame(() => {
2166
- swiper.slideTo(prevIndex, speed, runCallbacks, internal);
2167
- });
2168
- return true;
2169
- }
2170
- return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
2171
- }
2172
-
2173
- /* eslint no-unused-vars: "off" */
2174
- function slideReset(speed, runCallbacks, internal) {
2175
- if (runCallbacks === void 0) {
2176
- runCallbacks = true;
2177
- }
2178
- const swiper = this;
2179
- if (swiper.destroyed) return;
2180
- if (typeof speed === 'undefined') {
2181
- speed = swiper.params.speed;
2182
- }
2183
- return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
2184
- }
2185
-
2186
- /* eslint no-unused-vars: "off" */
2187
- function slideToClosest(speed, runCallbacks, internal, threshold) {
2188
- if (runCallbacks === void 0) {
2189
- runCallbacks = true;
2190
- }
2191
- if (threshold === void 0) {
2192
- threshold = 0.5;
2193
- }
2194
- const swiper = this;
2195
- if (swiper.destroyed) return;
2196
- if (typeof speed === 'undefined') {
2197
- speed = swiper.params.speed;
2198
- }
2199
- let index = swiper.activeIndex;
2200
- const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
2201
- const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
2202
- const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
2203
- if (translate >= swiper.snapGrid[snapIndex]) {
2204
- // The current translate is on or after the current snap index, so the choice
2205
- // is between the current index and the one after it.
2206
- const currentSnap = swiper.snapGrid[snapIndex];
2207
- const nextSnap = swiper.snapGrid[snapIndex + 1];
2208
- if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
2209
- index += swiper.params.slidesPerGroup;
2210
- }
2211
- } else {
2212
- // The current translate is before the current snap index, so the choice
2213
- // is between the current index and the one before it.
2214
- const prevSnap = swiper.snapGrid[snapIndex - 1];
2215
- const currentSnap = swiper.snapGrid[snapIndex];
2216
- if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {
2217
- index -= swiper.params.slidesPerGroup;
2218
- }
2219
- }
2220
- index = Math.max(index, 0);
2221
- index = Math.min(index, swiper.slidesGrid.length - 1);
2222
- return swiper.slideTo(index, speed, runCallbacks, internal);
2223
- }
2224
-
2225
- function slideToClickedSlide() {
2226
- const swiper = this;
2227
- if (swiper.destroyed) return;
2228
- const {
2229
- params,
2230
- slidesEl
2231
- } = swiper;
2232
- const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
2233
- let slideToIndex = swiper.clickedIndex;
2234
- let realIndex;
2235
- const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
2236
- if (params.loop) {
2237
- if (swiper.animating) return;
2238
- realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
2239
- if (params.centeredSlides) {
2240
- if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
2241
- swiper.loopFix();
2242
- slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2243
- nextTick(() => {
2244
- swiper.slideTo(slideToIndex);
2245
- });
2246
- } else {
2247
- swiper.slideTo(slideToIndex);
2248
- }
2249
- } else if (slideToIndex > swiper.slides.length - slidesPerView) {
2250
- swiper.loopFix();
2251
- slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2252
- nextTick(() => {
2253
- swiper.slideTo(slideToIndex);
2254
- });
2255
- } else {
2256
- swiper.slideTo(slideToIndex);
2257
- }
2258
- } else {
2259
- swiper.slideTo(slideToIndex);
2260
- }
2261
- }
2262
-
2263
- var slide = {
2264
- slideTo,
2265
- slideToLoop,
2266
- slideNext,
2267
- slidePrev,
2268
- slideReset,
2269
- slideToClosest,
2270
- slideToClickedSlide
2271
- };
2272
-
2273
- function loopCreate(slideRealIndex, initial) {
2274
- const swiper = this;
2275
- const {
2276
- params,
2277
- slidesEl
2278
- } = swiper;
2279
- if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2280
- const initSlides = () => {
2281
- const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
2282
- slides.forEach((el, index) => {
2283
- el.setAttribute('data-swiper-slide-index', index);
2284
- });
2285
- };
2286
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
2287
- const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
2288
- const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
2289
- const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
2290
- const addBlankSlides = amountOfSlides => {
2291
- for (let i = 0; i < amountOfSlides; i += 1) {
2292
- const slideEl = swiper.isElement ? createElement('swiper-slide', [params.slideBlankClass]) : createElement('div', [params.slideClass, params.slideBlankClass]);
2293
- swiper.slidesEl.append(slideEl);
2294
- }
2295
- };
2296
- if (shouldFillGroup) {
2297
- if (params.loopAddBlankSlides) {
2298
- const slidesToAdd = slidesPerGroup - swiper.slides.length % slidesPerGroup;
2299
- addBlankSlides(slidesToAdd);
2300
- swiper.recalcSlides();
2301
- swiper.updateSlides();
2302
- } else {
2303
- showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
2304
- }
2305
- initSlides();
2306
- } else if (shouldFillGrid) {
2307
- if (params.loopAddBlankSlides) {
2308
- const slidesToAdd = params.grid.rows - swiper.slides.length % params.grid.rows;
2309
- addBlankSlides(slidesToAdd);
2310
- swiper.recalcSlides();
2311
- swiper.updateSlides();
2312
- } else {
2313
- showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
2314
- }
2315
- initSlides();
2316
- } else {
2317
- initSlides();
2318
- }
2319
- swiper.loopFix({
2320
- slideRealIndex,
2321
- direction: params.centeredSlides ? undefined : 'next',
2322
- initial
2323
- });
2324
- }
2325
-
2326
- function loopFix(_temp) {
2327
- let {
2328
- slideRealIndex,
2329
- slideTo = true,
2330
- direction,
2331
- setTranslate,
2332
- activeSlideIndex,
2333
- initial,
2334
- byController,
2335
- byMousewheel
2336
- } = _temp === void 0 ? {} : _temp;
2337
- const swiper = this;
2338
- if (!swiper.params.loop) return;
2339
- swiper.emit('beforeLoopFix');
2340
- const {
2341
- slides,
2342
- allowSlidePrev,
2343
- allowSlideNext,
2344
- slidesEl,
2345
- params
2346
- } = swiper;
2347
- const {
2348
- centeredSlides,
2349
- initialSlide
2350
- } = params;
2351
- swiper.allowSlidePrev = true;
2352
- swiper.allowSlideNext = true;
2353
- if (swiper.virtual && params.virtual.enabled) {
2354
- if (slideTo) {
2355
- if (!params.centeredSlides && swiper.snapIndex === 0) {
2356
- swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
2357
- } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
2358
- swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
2359
- } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
2360
- swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
2361
- }
2362
- }
2363
- swiper.allowSlidePrev = allowSlidePrev;
2364
- swiper.allowSlideNext = allowSlideNext;
2365
- swiper.emit('loopFix');
2366
- return;
2367
- }
2368
- let slidesPerView = params.slidesPerView;
2369
- if (slidesPerView === 'auto') {
2370
- slidesPerView = swiper.slidesPerViewDynamic();
2371
- } else {
2372
- slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
2373
- if (centeredSlides && slidesPerView % 2 === 0) {
2374
- slidesPerView = slidesPerView + 1;
2375
- }
2376
- }
2377
- const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
2378
- let loopedSlides = slidesPerGroup;
2379
- if (loopedSlides % slidesPerGroup !== 0) {
2380
- loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
2381
- }
2382
- loopedSlides += params.loopAdditionalSlides;
2383
- swiper.loopedSlides = loopedSlides;
2384
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
2385
- if (slides.length < slidesPerView + loopedSlides || swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
2386
- showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
2387
- } else if (gridEnabled && params.grid.fill === 'row') {
2388
- showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
2389
- }
2390
- const prependSlidesIndexes = [];
2391
- const appendSlidesIndexes = [];
2392
- const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
2393
- const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !centeredSlides;
2394
- let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
2395
- if (typeof activeSlideIndex === 'undefined') {
2396
- activeSlideIndex = swiper.getSlideIndex(slides.find(el => el.classList.contains(params.slideActiveClass)));
2397
- } else {
2398
- activeIndex = activeSlideIndex;
2399
- }
2400
- const isNext = direction === 'next' || !direction;
2401
- const isPrev = direction === 'prev' || !direction;
2402
- let slidesPrepended = 0;
2403
- let slidesAppended = 0;
2404
- const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
2405
- const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
2406
- // prepend last slides before start
2407
- if (activeColIndexWithShift < loopedSlides) {
2408
- slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
2409
- for (let i = 0; i < loopedSlides - activeColIndexWithShift; i += 1) {
2410
- const index = i - Math.floor(i / cols) * cols;
2411
- if (gridEnabled) {
2412
- const colIndexToPrepend = cols - index - 1;
2413
- for (let i = slides.length - 1; i >= 0; i -= 1) {
2414
- if (slides[i].column === colIndexToPrepend) prependSlidesIndexes.push(i);
2415
- }
2416
- // slides.forEach((slide, slideIndex) => {
2417
- // if (slide.column === colIndexToPrepend) prependSlidesIndexes.push(slideIndex);
2418
- // });
2419
- } else {
2420
- prependSlidesIndexes.push(cols - index - 1);
2421
- }
2422
- }
2423
- } else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
2424
- slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
2425
- if (isInitialOverflow) {
2426
- slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
2427
- }
2428
- for (let i = 0; i < slidesAppended; i += 1) {
2429
- const index = i - Math.floor(i / cols) * cols;
2430
- if (gridEnabled) {
2431
- slides.forEach((slide, slideIndex) => {
2432
- if (slide.column === index) appendSlidesIndexes.push(slideIndex);
2433
- });
2434
- } else {
2435
- appendSlidesIndexes.push(index);
2436
- }
2437
- }
2438
- }
2439
- swiper.__preventObserver__ = true;
2440
- requestAnimationFrame(() => {
2441
- swiper.__preventObserver__ = false;
2442
- });
2443
- if (swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
2444
- if (appendSlidesIndexes.includes(activeSlideIndex)) {
2445
- appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
2446
- }
2447
- if (prependSlidesIndexes.includes(activeSlideIndex)) {
2448
- prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
2449
- }
2450
- }
2451
- if (isPrev) {
2452
- prependSlidesIndexes.forEach(index => {
2453
- slides[index].swiperLoopMoveDOM = true;
2454
- slidesEl.prepend(slides[index]);
2455
- slides[index].swiperLoopMoveDOM = false;
2456
- });
2457
- }
2458
- if (isNext) {
2459
- appendSlidesIndexes.forEach(index => {
2460
- slides[index].swiperLoopMoveDOM = true;
2461
- slidesEl.append(slides[index]);
2462
- slides[index].swiperLoopMoveDOM = false;
2463
- });
2464
- }
2465
- swiper.recalcSlides();
2466
- if (params.slidesPerView === 'auto') {
2467
- swiper.updateSlides();
2468
- } else if (gridEnabled && (prependSlidesIndexes.length > 0 && isPrev || appendSlidesIndexes.length > 0 && isNext)) {
2469
- swiper.slides.forEach((slide, slideIndex) => {
2470
- swiper.grid.updateSlide(slideIndex, slide, swiper.slides);
2471
- });
2472
- }
2473
- if (params.watchSlidesProgress) {
2474
- swiper.updateSlidesOffset();
2475
- }
2476
- if (slideTo) {
2477
- if (prependSlidesIndexes.length > 0 && isPrev) {
2478
- if (typeof slideRealIndex === 'undefined') {
2479
- const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2480
- const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended];
2481
- const diff = newSlideTranslate - currentSlideTranslate;
2482
- if (byMousewheel) {
2483
- swiper.setTranslate(swiper.translate - diff);
2484
- } else {
2485
- swiper.slideTo(activeIndex + Math.ceil(slidesPrepended), 0, false, true);
2486
- if (setTranslate) {
2487
- swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;
2488
- swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;
2489
- }
2490
- }
2491
- } else {
2492
- if (setTranslate) {
2493
- const shift = gridEnabled ? prependSlidesIndexes.length / params.grid.rows : prependSlidesIndexes.length;
2494
- swiper.slideTo(swiper.activeIndex + shift, 0, false, true);
2495
- swiper.touchEventsData.currentTranslate = swiper.translate;
2496
- }
2497
- }
2498
- } else if (appendSlidesIndexes.length > 0 && isNext) {
2499
- if (typeof slideRealIndex === 'undefined') {
2500
- const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2501
- const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended];
2502
- const diff = newSlideTranslate - currentSlideTranslate;
2503
- if (byMousewheel) {
2504
- swiper.setTranslate(swiper.translate - diff);
2505
- } else {
2506
- swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
2507
- if (setTranslate) {
2508
- swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;
2509
- swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;
2510
- }
2511
- }
2512
- } else {
2513
- const shift = gridEnabled ? appendSlidesIndexes.length / params.grid.rows : appendSlidesIndexes.length;
2514
- swiper.slideTo(swiper.activeIndex - shift, 0, false, true);
2515
- }
2516
- }
2517
- }
2518
- swiper.allowSlidePrev = allowSlidePrev;
2519
- swiper.allowSlideNext = allowSlideNext;
2520
- if (swiper.controller && swiper.controller.control && !byController) {
2521
- const loopParams = {
2522
- slideRealIndex,
2523
- direction,
2524
- setTranslate,
2525
- activeSlideIndex,
2526
- byController: true
2527
- };
2528
- if (Array.isArray(swiper.controller.control)) {
2529
- swiper.controller.control.forEach(c => {
2530
- if (!c.destroyed && c.params.loop) c.loopFix({
2531
- ...loopParams,
2532
- slideTo: c.params.slidesPerView === params.slidesPerView ? slideTo : false
2533
- });
2534
- });
2535
- } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) {
2536
- swiper.controller.control.loopFix({
2537
- ...loopParams,
2538
- slideTo: swiper.controller.control.params.slidesPerView === params.slidesPerView ? slideTo : false
2539
- });
2540
- }
2541
- }
2542
- swiper.emit('loopFix');
2543
- }
2544
-
2545
- function loopDestroy() {
2546
- const swiper = this;
2547
- const {
2548
- params,
2549
- slidesEl
2550
- } = swiper;
2551
- if (!params.loop || !slidesEl || swiper.virtual && swiper.params.virtual.enabled) return;
2552
- swiper.recalcSlides();
2553
- const newSlidesOrder = [];
2554
- swiper.slides.forEach(slideEl => {
2555
- const index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex;
2556
- newSlidesOrder[index] = slideEl;
2557
- });
2558
- swiper.slides.forEach(slideEl => {
2559
- slideEl.removeAttribute('data-swiper-slide-index');
2560
- });
2561
- newSlidesOrder.forEach(slideEl => {
2562
- slidesEl.append(slideEl);
2563
- });
2564
- swiper.recalcSlides();
2565
- swiper.slideTo(swiper.realIndex, 0);
2566
- }
2567
-
2568
- var loop = {
2569
- loopCreate,
2570
- loopFix,
2571
- loopDestroy
2572
- };
2573
-
2574
- function setGrabCursor(moving) {
2575
- const swiper = this;
2576
- if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
2577
- const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;
2578
- if (swiper.isElement) {
2579
- swiper.__preventObserver__ = true;
2580
- }
2581
- el.style.cursor = 'move';
2582
- el.style.cursor = moving ? 'grabbing' : 'grab';
2583
- if (swiper.isElement) {
2584
- requestAnimationFrame(() => {
2585
- swiper.__preventObserver__ = false;
2586
- });
2587
- }
2588
- }
2589
-
2590
- function unsetGrabCursor() {
2591
- const swiper = this;
2592
- if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
2593
- return;
2594
- }
2595
- if (swiper.isElement) {
2596
- swiper.__preventObserver__ = true;
2597
- }
2598
- swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';
2599
- if (swiper.isElement) {
2600
- requestAnimationFrame(() => {
2601
- swiper.__preventObserver__ = false;
2602
- });
2603
- }
2604
- }
2605
-
2606
- var grabCursor = {
2607
- setGrabCursor,
2608
- unsetGrabCursor
2609
- };
2610
-
2611
- // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
2612
- function closestElement(selector, base) {
2613
- if (base === void 0) {
2614
- base = this;
2615
- }
2616
- function __closestFrom(el) {
2617
- if (!el || el === getDocument() || el === getWindow()) return null;
2618
- if (el.assignedSlot) el = el.assignedSlot;
2619
- const found = el.closest(selector);
2620
- if (!found && !el.getRootNode) {
2621
- return null;
2622
- }
2623
- return found || __closestFrom(el.getRootNode().host);
2624
- }
2625
- return __closestFrom(base);
2626
- }
2627
- function preventEdgeSwipe(swiper, event, startX) {
2628
- const window = getWindow();
2629
- const {
2630
- params
2631
- } = swiper;
2632
- const edgeSwipeDetection = params.edgeSwipeDetection;
2633
- const edgeSwipeThreshold = params.edgeSwipeThreshold;
2634
- if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
2635
- if (edgeSwipeDetection === 'prevent') {
2636
- event.preventDefault();
2637
- return true;
2638
- }
2639
- return false;
2640
- }
2641
- return true;
2642
- }
2643
- function onTouchStart(event) {
2644
- const swiper = this;
2645
- const document = getDocument();
2646
- let e = event;
2647
- if (e.originalEvent) e = e.originalEvent;
2648
- const data = swiper.touchEventsData;
2649
- if (e.type === 'pointerdown') {
2650
- if (data.pointerId !== null && data.pointerId !== e.pointerId) {
2651
- return;
2652
- }
2653
- data.pointerId = e.pointerId;
2654
- } else if (e.type === 'touchstart' && e.targetTouches.length === 1) {
2655
- data.touchId = e.targetTouches[0].identifier;
2656
- }
2657
- if (e.type === 'touchstart') {
2658
- // don't proceed touch event
2659
- preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX);
2660
- return;
2661
- }
2662
- const {
2663
- params,
2664
- touches,
2665
- enabled
2666
- } = swiper;
2667
- if (!enabled) return;
2668
- if (!params.simulateTouch && e.pointerType === 'mouse') return;
2669
- if (swiper.animating && params.preventInteractionOnTransition) {
2670
- return;
2671
- }
2672
- if (!swiper.animating && params.cssMode && params.loop) {
2673
- swiper.loopFix();
2674
- }
2675
- let targetEl = e.target;
2676
- if (params.touchEventsTarget === 'wrapper') {
2677
- if (!elementIsChildOf(targetEl, swiper.wrapperEl)) return;
2678
- }
2679
- if ('which' in e && e.which === 3) return;
2680
- if ('button' in e && e.button > 0) return;
2681
- if (data.isTouched && data.isMoved) return;
2682
-
2683
- // change target el for shadow root component
2684
- const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
2685
- // eslint-disable-next-line
2686
- const eventPath = e.composedPath ? e.composedPath() : e.path;
2687
- if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
2688
- targetEl = eventPath[0];
2689
- }
2690
- const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
2691
- const isTargetShadow = !!(e.target && e.target.shadowRoot);
2692
-
2693
- // use closestElement for shadow root element to get the actual closest for nested shadow root element
2694
- if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) {
2695
- swiper.allowClick = true;
2696
- return;
2697
- }
2698
- if (params.swipeHandler) {
2699
- if (!targetEl.closest(params.swipeHandler)) return;
2700
- }
2701
- touches.currentX = e.pageX;
2702
- touches.currentY = e.pageY;
2703
- const startX = touches.currentX;
2704
- const startY = touches.currentY;
2705
-
2706
- // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
2707
-
2708
- if (!preventEdgeSwipe(swiper, e, startX)) {
2709
- return;
2710
- }
2711
- Object.assign(data, {
2712
- isTouched: true,
2713
- isMoved: false,
2714
- allowTouchCallbacks: true,
2715
- isScrolling: undefined,
2716
- startMoving: undefined
2717
- });
2718
- touches.startX = startX;
2719
- touches.startY = startY;
2720
- data.touchStartTime = now();
2721
- swiper.allowClick = true;
2722
- swiper.updateSize();
2723
- swiper.swipeDirection = undefined;
2724
- if (params.threshold > 0) data.allowThresholdMove = false;
2725
- let preventDefault = true;
2726
- if (targetEl.matches(data.focusableElements)) {
2727
- preventDefault = false;
2728
- if (targetEl.nodeName === 'SELECT') {
2729
- data.isTouched = false;
2730
- }
2731
- }
2732
- if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl && (e.pointerType === 'mouse' || e.pointerType !== 'mouse' && !targetEl.matches(data.focusableElements))) {
2733
- document.activeElement.blur();
2734
- }
2735
- const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
2736
- if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) {
2737
- e.preventDefault();
2738
- }
2739
- if (params.freeMode && params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {
2740
- swiper.freeMode.onTouchStart();
2741
- }
2742
- swiper.emit('touchStart', e);
2743
- }
2744
-
2745
- function onTouchMove(event) {
2746
- const document = getDocument();
2747
- const swiper = this;
2748
- const data = swiper.touchEventsData;
2749
- const {
2750
- params,
2751
- touches,
2752
- rtlTranslate: rtl,
2753
- enabled
2754
- } = swiper;
2755
- if (!enabled) return;
2756
- if (!params.simulateTouch && event.pointerType === 'mouse') return;
2757
- let e = event;
2758
- if (e.originalEvent) e = e.originalEvent;
2759
- if (e.type === 'pointermove') {
2760
- if (data.touchId !== null) return; // return from pointer if we use touch
2761
- const id = e.pointerId;
2762
- if (id !== data.pointerId) return;
2763
- }
2764
- let targetTouch;
2765
- if (e.type === 'touchmove') {
2766
- targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
2767
- if (!targetTouch || targetTouch.identifier !== data.touchId) return;
2768
- } else {
2769
- targetTouch = e;
2770
- }
2771
- if (!data.isTouched) {
2772
- if (data.startMoving && data.isScrolling) {
2773
- swiper.emit('touchMoveOpposite', e);
2774
- }
2775
- return;
2776
- }
2777
- const pageX = targetTouch.pageX;
2778
- const pageY = targetTouch.pageY;
2779
- if (e.preventedByNestedSwiper) {
2780
- touches.startX = pageX;
2781
- touches.startY = pageY;
2782
- return;
2783
- }
2784
- if (!swiper.allowTouchMove) {
2785
- if (!e.target.matches(data.focusableElements)) {
2786
- swiper.allowClick = false;
2787
- }
2788
- if (data.isTouched) {
2789
- Object.assign(touches, {
2790
- startX: pageX,
2791
- startY: pageY,
2792
- currentX: pageX,
2793
- currentY: pageY
2794
- });
2795
- data.touchStartTime = now();
2796
- }
2797
- return;
2798
- }
2799
- if (params.touchReleaseOnEdges && !params.loop) {
2800
- if (swiper.isVertical()) {
2801
- // Vertical
2802
- if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
2803
- data.isTouched = false;
2804
- data.isMoved = false;
2805
- return;
2806
- }
2807
- } else if (rtl && (pageX > touches.startX && -swiper.translate <= swiper.maxTranslate() || pageX < touches.startX && -swiper.translate >= swiper.minTranslate())) {
2808
- return;
2809
- } else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
2810
- return;
2811
- }
2812
- }
2813
- if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== e.target && e.pointerType !== 'mouse') {
2814
- document.activeElement.blur();
2815
- }
2816
- if (document.activeElement) {
2817
- if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
2818
- data.isMoved = true;
2819
- swiper.allowClick = false;
2820
- return;
2821
- }
2822
- }
2823
- if (data.allowTouchCallbacks) {
2824
- swiper.emit('touchMove', e);
2825
- }
2826
- touches.previousX = touches.currentX;
2827
- touches.previousY = touches.currentY;
2828
- touches.currentX = pageX;
2829
- touches.currentY = pageY;
2830
- const diffX = touches.currentX - touches.startX;
2831
- const diffY = touches.currentY - touches.startY;
2832
- if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
2833
- if (typeof data.isScrolling === 'undefined') {
2834
- let touchAngle;
2835
- if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
2836
- data.isScrolling = false;
2837
- } else {
2838
- // eslint-disable-next-line
2839
- if (diffX * diffX + diffY * diffY >= 25) {
2840
- touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
2841
- data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
2842
- }
2843
- }
2844
- }
2845
- if (data.isScrolling) {
2846
- swiper.emit('touchMoveOpposite', e);
2847
- }
2848
- if (typeof data.startMoving === 'undefined') {
2849
- if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
2850
- data.startMoving = true;
2851
- }
2852
- }
2853
- if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) {
2854
- data.isTouched = false;
2855
- return;
2856
- }
2857
- if (!data.startMoving) {
2858
- return;
2859
- }
2860
- swiper.allowClick = false;
2861
- if (!params.cssMode && e.cancelable) {
2862
- e.preventDefault();
2863
- }
2864
- if (params.touchMoveStopPropagation && !params.nested) {
2865
- e.stopPropagation();
2866
- }
2867
- let diff = swiper.isHorizontal() ? diffX : diffY;
2868
- let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY;
2869
- if (params.oneWayMovement) {
2870
- diff = Math.abs(diff) * (rtl ? 1 : -1);
2871
- touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);
2872
- }
2873
- touches.diff = diff;
2874
- diff *= params.touchRatio;
2875
- if (rtl) {
2876
- diff = -diff;
2877
- touchesDiff = -touchesDiff;
2878
- }
2879
- const prevTouchesDirection = swiper.touchesDirection;
2880
- swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
2881
- swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';
2882
- const isLoop = swiper.params.loop && !params.cssMode;
2883
- const allowLoopFix = swiper.touchesDirection === 'next' && swiper.allowSlideNext || swiper.touchesDirection === 'prev' && swiper.allowSlidePrev;
2884
- if (!data.isMoved) {
2885
- if (isLoop && allowLoopFix) {
2886
- swiper.loopFix({
2887
- direction: swiper.swipeDirection
2888
- });
2889
- }
2890
- data.startTranslate = swiper.getTranslate();
2891
- swiper.setTransition(0);
2892
- if (swiper.animating) {
2893
- const evt = new window.CustomEvent('transitionend', {
2894
- bubbles: true,
2895
- cancelable: true,
2896
- detail: {
2897
- bySwiperTouchMove: true
2898
- }
2899
- });
2900
- swiper.wrapperEl.dispatchEvent(evt);
2901
- }
2902
- data.allowMomentumBounce = false;
2903
- // Grab Cursor
2904
- if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2905
- swiper.setGrabCursor(true);
2906
- }
2907
- swiper.emit('sliderFirstMove', e);
2908
- }
2909
- new Date().getTime();
2910
- if (params._loopSwapReset !== false && data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
2911
- Object.assign(touches, {
2912
- startX: pageX,
2913
- startY: pageY,
2914
- currentX: pageX,
2915
- currentY: pageY,
2916
- startTranslate: data.currentTranslate
2917
- });
2918
- data.loopSwapReset = true;
2919
- data.startTranslate = data.currentTranslate;
2920
- return;
2921
- }
2922
- swiper.emit('sliderMove', e);
2923
- data.isMoved = true;
2924
- data.currentTranslate = diff + data.startTranslate;
2925
- let disableParentSwiper = true;
2926
- let resistanceRatio = params.resistanceRatio;
2927
- if (params.touchReleaseOnEdges) {
2928
- resistanceRatio = 0;
2929
- }
2930
- if (diff > 0) {
2931
- if (isLoop && allowLoopFix && true && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] - (params.slidesPerView !== 'auto' && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.activeIndex + 1] + swiper.params.spaceBetween : 0) - swiper.params.spaceBetween : swiper.minTranslate())) {
2932
- swiper.loopFix({
2933
- direction: 'prev',
2934
- setTranslate: true,
2935
- activeSlideIndex: 0
2936
- });
2937
- }
2938
- if (data.currentTranslate > swiper.minTranslate()) {
2939
- disableParentSwiper = false;
2940
- if (params.resistance) {
2941
- data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
2942
- }
2943
- }
2944
- } else if (diff < 0) {
2945
- if (isLoop && allowLoopFix && true && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween + (params.slidesPerView !== 'auto' && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween : 0) : swiper.maxTranslate())) {
2946
- swiper.loopFix({
2947
- direction: 'next',
2948
- setTranslate: true,
2949
- activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)))
2950
- });
2951
- }
2952
- if (data.currentTranslate < swiper.maxTranslate()) {
2953
- disableParentSwiper = false;
2954
- if (params.resistance) {
2955
- data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
2956
- }
2957
- }
2958
- }
2959
- if (disableParentSwiper) {
2960
- e.preventedByNestedSwiper = true;
2961
- }
2962
-
2963
- // Directions locks
2964
- if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
2965
- data.currentTranslate = data.startTranslate;
2966
- }
2967
- if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
2968
- data.currentTranslate = data.startTranslate;
2969
- }
2970
- if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
2971
- data.currentTranslate = data.startTranslate;
2972
- }
2973
-
2974
- // Threshold
2975
- if (params.threshold > 0) {
2976
- if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
2977
- if (!data.allowThresholdMove) {
2978
- data.allowThresholdMove = true;
2979
- touches.startX = touches.currentX;
2980
- touches.startY = touches.currentY;
2981
- data.currentTranslate = data.startTranslate;
2982
- touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
2983
- return;
2984
- }
2985
- } else {
2986
- data.currentTranslate = data.startTranslate;
2987
- return;
2988
- }
2989
- }
2990
- if (!params.followFinger || params.cssMode) return;
2991
-
2992
- // Update active index in free mode
2993
- if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
2994
- swiper.updateActiveIndex();
2995
- swiper.updateSlidesClasses();
2996
- }
2997
- if (params.freeMode && params.freeMode.enabled && swiper.freeMode) {
2998
- swiper.freeMode.onTouchMove();
2999
- }
3000
- // Update progress
3001
- swiper.updateProgress(data.currentTranslate);
3002
- // Update translate
3003
- swiper.setTranslate(data.currentTranslate);
3004
- }
3005
-
3006
- function onTouchEnd(event) {
3007
- const swiper = this;
3008
- const data = swiper.touchEventsData;
3009
- let e = event;
3010
- if (e.originalEvent) e = e.originalEvent;
3011
- let targetTouch;
3012
- const isTouchEvent = e.type === 'touchend' || e.type === 'touchcancel';
3013
- if (!isTouchEvent) {
3014
- if (data.touchId !== null) return; // return from pointer if we use touch
3015
- if (e.pointerId !== data.pointerId) return;
3016
- targetTouch = e;
3017
- } else {
3018
- targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
3019
- if (!targetTouch || targetTouch.identifier !== data.touchId) return;
3020
- }
3021
- if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
3022
- const proceed = ['pointercancel', 'contextmenu'].includes(e.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
3023
- if (!proceed) {
3024
- return;
3025
- }
3026
- }
3027
- data.pointerId = null;
3028
- data.touchId = null;
3029
- const {
3030
- params,
3031
- touches,
3032
- rtlTranslate: rtl,
3033
- slidesGrid,
3034
- enabled
3035
- } = swiper;
3036
- if (!enabled) return;
3037
- if (!params.simulateTouch && e.pointerType === 'mouse') return;
3038
- if (data.allowTouchCallbacks) {
3039
- swiper.emit('touchEnd', e);
3040
- }
3041
- data.allowTouchCallbacks = false;
3042
- if (!data.isTouched) {
3043
- if (data.isMoved && params.grabCursor) {
3044
- swiper.setGrabCursor(false);
3045
- }
3046
- data.isMoved = false;
3047
- data.startMoving = false;
3048
- return;
3049
- }
3050
-
3051
- // Return Grab Cursor
3052
- if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
3053
- swiper.setGrabCursor(false);
3054
- }
3055
-
3056
- // Time diff
3057
- const touchEndTime = now();
3058
- const timeDiff = touchEndTime - data.touchStartTime;
3059
-
3060
- // Tap, doubleTap, Click
3061
- if (swiper.allowClick) {
3062
- const pathTree = e.path || e.composedPath && e.composedPath();
3063
- swiper.updateClickedSlide(pathTree && pathTree[0] || e.target, pathTree);
3064
- swiper.emit('tap click', e);
3065
- if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
3066
- swiper.emit('doubleTap doubleClick', e);
3067
- }
3068
- }
3069
- data.lastClickTime = now();
3070
- nextTick(() => {
3071
- if (!swiper.destroyed) swiper.allowClick = true;
3072
- });
3073
- if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 && !data.loopSwapReset || data.currentTranslate === data.startTranslate && !data.loopSwapReset) {
3074
- data.isTouched = false;
3075
- data.isMoved = false;
3076
- data.startMoving = false;
3077
- return;
3078
- }
3079
- data.isTouched = false;
3080
- data.isMoved = false;
3081
- data.startMoving = false;
3082
- let currentPos;
3083
- if (params.followFinger) {
3084
- currentPos = rtl ? swiper.translate : -swiper.translate;
3085
- } else {
3086
- currentPos = -data.currentTranslate;
3087
- }
3088
- if (params.cssMode) {
3089
- return;
3090
- }
3091
- if (params.freeMode && params.freeMode.enabled) {
3092
- swiper.freeMode.onTouchEnd({
3093
- currentPos
3094
- });
3095
- return;
3096
- }
3097
-
3098
- // Find current slide
3099
- const swipeToLast = currentPos >= -swiper.maxTranslate() && !swiper.params.loop;
3100
- let stopIndex = 0;
3101
- let groupSize = swiper.slidesSizesGrid[0];
3102
- for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
3103
- const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
3104
- if (typeof slidesGrid[i + increment] !== 'undefined') {
3105
- if (swipeToLast || currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
3106
- stopIndex = i;
3107
- groupSize = slidesGrid[i + increment] - slidesGrid[i];
3108
- }
3109
- } else if (swipeToLast || currentPos >= slidesGrid[i]) {
3110
- stopIndex = i;
3111
- groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
3112
- }
3113
- }
3114
- let rewindFirstIndex = null;
3115
- let rewindLastIndex = null;
3116
- if (params.rewind) {
3117
- if (swiper.isBeginning) {
3118
- rewindLastIndex = params.virtual && params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
3119
- } else if (swiper.isEnd) {
3120
- rewindFirstIndex = 0;
3121
- }
3122
- }
3123
- // Find current slide size
3124
- const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
3125
- const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
3126
- if (timeDiff > params.longSwipesMs) {
3127
- // Long touches
3128
- if (!params.longSwipes) {
3129
- swiper.slideTo(swiper.activeIndex);
3130
- return;
3131
- }
3132
- if (swiper.swipeDirection === 'next') {
3133
- if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);
3134
- }
3135
- if (swiper.swipeDirection === 'prev') {
3136
- if (ratio > 1 - params.longSwipesRatio) {
3137
- swiper.slideTo(stopIndex + increment);
3138
- } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {
3139
- swiper.slideTo(rewindLastIndex);
3140
- } else {
3141
- swiper.slideTo(stopIndex);
3142
- }
3143
- }
3144
- } else {
3145
- // Short swipes
3146
- if (!params.shortSwipes) {
3147
- swiper.slideTo(swiper.activeIndex);
3148
- return;
3149
- }
3150
- const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
3151
- if (!isNavButtonTarget) {
3152
- if (swiper.swipeDirection === 'next') {
3153
- swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);
3154
- }
3155
- if (swiper.swipeDirection === 'prev') {
3156
- swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);
3157
- }
3158
- } else if (e.target === swiper.navigation.nextEl) {
3159
- swiper.slideTo(stopIndex + increment);
3160
- } else {
3161
- swiper.slideTo(stopIndex);
3162
- }
3163
- }
3164
- }
3165
-
3166
- function onResize() {
3167
- const swiper = this;
3168
- const {
3169
- params,
3170
- el
3171
- } = swiper;
3172
- if (el && el.offsetWidth === 0) return;
3173
-
3174
- // Breakpoints
3175
- if (params.breakpoints) {
3176
- swiper.setBreakpoint();
3177
- }
3178
-
3179
- // Save locks
3180
- const {
3181
- allowSlideNext,
3182
- allowSlidePrev,
3183
- snapGrid
3184
- } = swiper;
3185
- const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
3186
-
3187
- // Disable locks on resize
3188
- swiper.allowSlideNext = true;
3189
- swiper.allowSlidePrev = true;
3190
- swiper.updateSize();
3191
- swiper.updateSlides();
3192
- swiper.updateSlidesClasses();
3193
- const isVirtualLoop = isVirtual && params.loop;
3194
- if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {
3195
- swiper.slideTo(swiper.slides.length - 1, 0, false, true);
3196
- } else {
3197
- if (swiper.params.loop && !isVirtual) {
3198
- swiper.slideToLoop(swiper.realIndex, 0, false, true);
3199
- } else {
3200
- swiper.slideTo(swiper.activeIndex, 0, false, true);
3201
- }
3202
- }
3203
- if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
3204
- clearTimeout(swiper.autoplay.resizeTimeout);
3205
- swiper.autoplay.resizeTimeout = setTimeout(() => {
3206
- if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
3207
- swiper.autoplay.resume();
3208
- }
3209
- }, 500);
3210
- }
3211
- // Return locks after resize
3212
- swiper.allowSlidePrev = allowSlidePrev;
3213
- swiper.allowSlideNext = allowSlideNext;
3214
- if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
3215
- swiper.checkOverflow();
3216
- }
3217
- }
3218
-
3219
- function onClick(e) {
3220
- const swiper = this;
3221
- if (!swiper.enabled) return;
3222
- if (!swiper.allowClick) {
3223
- if (swiper.params.preventClicks) e.preventDefault();
3224
- if (swiper.params.preventClicksPropagation && swiper.animating) {
3225
- e.stopPropagation();
3226
- e.stopImmediatePropagation();
3227
- }
3228
- }
3229
- }
3230
-
3231
- function onScroll() {
3232
- const swiper = this;
3233
- const {
3234
- wrapperEl,
3235
- rtlTranslate,
3236
- enabled
3237
- } = swiper;
3238
- if (!enabled) return;
3239
- swiper.previousTranslate = swiper.translate;
3240
- if (swiper.isHorizontal()) {
3241
- swiper.translate = -wrapperEl.scrollLeft;
3242
- } else {
3243
- swiper.translate = -wrapperEl.scrollTop;
3244
- }
3245
- // eslint-disable-next-line
3246
- if (swiper.translate === 0) swiper.translate = 0;
3247
- swiper.updateActiveIndex();
3248
- swiper.updateSlidesClasses();
3249
- let newProgress;
3250
- const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
3251
- if (translatesDiff === 0) {
3252
- newProgress = 0;
3253
- } else {
3254
- newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
3255
- }
3256
- if (newProgress !== swiper.progress) {
3257
- swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
3258
- }
3259
- swiper.emit('setTranslate', swiper.translate, false);
3260
- }
3261
-
3262
- function onLoad(e) {
3263
- const swiper = this;
3264
- processLazyPreloader(swiper, e.target);
3265
- if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) {
3266
- return;
3267
- }
3268
- swiper.update();
3269
- }
3270
-
3271
- function onDocumentTouchStart() {
3272
- const swiper = this;
3273
- if (swiper.documentTouchHandlerProceeded) return;
3274
- swiper.documentTouchHandlerProceeded = true;
3275
- if (swiper.params.touchReleaseOnEdges) {
3276
- swiper.el.style.touchAction = 'auto';
3277
- }
3278
- }
3279
-
3280
- const events = (swiper, method) => {
3281
- const document = getDocument();
3282
- const {
3283
- params,
3284
- el,
3285
- wrapperEl,
3286
- device
3287
- } = swiper;
3288
- const capture = !!params.nested;
3289
- const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
3290
- const swiperMethod = method;
3291
- if (!el || typeof el === 'string') return;
3292
-
3293
- // Touch Events
3294
- document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
3295
- passive: false,
3296
- capture
3297
- });
3298
- el[domMethod]('touchstart', swiper.onTouchStart, {
3299
- passive: false
3300
- });
3301
- el[domMethod]('pointerdown', swiper.onTouchStart, {
3302
- passive: false
3303
- });
3304
- document[domMethod]('touchmove', swiper.onTouchMove, {
3305
- passive: false,
3306
- capture
3307
- });
3308
- document[domMethod]('pointermove', swiper.onTouchMove, {
3309
- passive: false,
3310
- capture
3311
- });
3312
- document[domMethod]('touchend', swiper.onTouchEnd, {
3313
- passive: true
3314
- });
3315
- document[domMethod]('pointerup', swiper.onTouchEnd, {
3316
- passive: true
3317
- });
3318
- document[domMethod]('pointercancel', swiper.onTouchEnd, {
3319
- passive: true
3320
- });
3321
- document[domMethod]('touchcancel', swiper.onTouchEnd, {
3322
- passive: true
3323
- });
3324
- document[domMethod]('pointerout', swiper.onTouchEnd, {
3325
- passive: true
3326
- });
3327
- document[domMethod]('pointerleave', swiper.onTouchEnd, {
3328
- passive: true
3329
- });
3330
- document[domMethod]('contextmenu', swiper.onTouchEnd, {
3331
- passive: true
3332
- });
3333
-
3334
- // Prevent Links Clicks
3335
- if (params.preventClicks || params.preventClicksPropagation) {
3336
- el[domMethod]('click', swiper.onClick, true);
3337
- }
3338
- if (params.cssMode) {
3339
- wrapperEl[domMethod]('scroll', swiper.onScroll);
3340
- }
3341
-
3342
- // Resize handler
3343
- if (params.updateOnWindowResize) {
3344
- swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
3345
- } else {
3346
- swiper[swiperMethod]('observerUpdate', onResize, true);
3347
- }
3348
-
3349
- // Images loader
3350
- el[domMethod]('load', swiper.onLoad, {
3351
- capture: true
3352
- });
3353
- };
3354
- function attachEvents() {
3355
- const swiper = this;
3356
- const {
3357
- params
3358
- } = swiper;
3359
- swiper.onTouchStart = onTouchStart.bind(swiper);
3360
- swiper.onTouchMove = onTouchMove.bind(swiper);
3361
- swiper.onTouchEnd = onTouchEnd.bind(swiper);
3362
- swiper.onDocumentTouchStart = onDocumentTouchStart.bind(swiper);
3363
- if (params.cssMode) {
3364
- swiper.onScroll = onScroll.bind(swiper);
3365
- }
3366
- swiper.onClick = onClick.bind(swiper);
3367
- swiper.onLoad = onLoad.bind(swiper);
3368
- events(swiper, 'on');
3369
- }
3370
- function detachEvents() {
3371
- const swiper = this;
3372
- events(swiper, 'off');
3373
- }
3374
- var events$1 = {
3375
- attachEvents,
3376
- detachEvents
3377
- };
3378
-
3379
- const isGridEnabled = (swiper, params) => {
3380
- return swiper.grid && params.grid && params.grid.rows > 1;
3381
- };
3382
- function setBreakpoint() {
3383
- const swiper = this;
3384
- const {
3385
- realIndex,
3386
- initialized,
3387
- params,
3388
- el
3389
- } = swiper;
3390
- const breakpoints = params.breakpoints;
3391
- if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
3392
- const document = getDocument();
3393
-
3394
- // Get breakpoint for window/container width and update parameters
3395
- const breakpointsBase = params.breakpointsBase === 'window' || !params.breakpointsBase ? params.breakpointsBase : 'container';
3396
- const breakpointContainer = ['window', 'container'].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document.querySelector(params.breakpointsBase);
3397
- const breakpoint = swiper.getBreakpoint(breakpoints, breakpointsBase, breakpointContainer);
3398
- if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
3399
- const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
3400
- const breakpointParams = breakpointOnlyParams || swiper.originalParams;
3401
- const wasMultiRow = isGridEnabled(swiper, params);
3402
- const isMultiRow = isGridEnabled(swiper, breakpointParams);
3403
- const wasGrabCursor = swiper.params.grabCursor;
3404
- const isGrabCursor = breakpointParams.grabCursor;
3405
- const wasEnabled = params.enabled;
3406
- if (wasMultiRow && !isMultiRow) {
3407
- el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
3408
- swiper.emitContainerClasses();
3409
- } else if (!wasMultiRow && isMultiRow) {
3410
- el.classList.add(`${params.containerModifierClass}grid`);
3411
- if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {
3412
- el.classList.add(`${params.containerModifierClass}grid-column`);
3413
- }
3414
- swiper.emitContainerClasses();
3415
- }
3416
- if (wasGrabCursor && !isGrabCursor) {
3417
- swiper.unsetGrabCursor();
3418
- } else if (!wasGrabCursor && isGrabCursor) {
3419
- swiper.setGrabCursor();
3420
- }
3421
-
3422
- // Toggle navigation, pagination, scrollbar
3423
- ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
3424
- if (typeof breakpointParams[prop] === 'undefined') return;
3425
- const wasModuleEnabled = params[prop] && params[prop].enabled;
3426
- const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;
3427
- if (wasModuleEnabled && !isModuleEnabled) {
3428
- swiper[prop].disable();
3429
- }
3430
- if (!wasModuleEnabled && isModuleEnabled) {
3431
- swiper[prop].enable();
3432
- }
3433
- });
3434
- const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
3435
- const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
3436
- const wasLoop = params.loop;
3437
- if (directionChanged && initialized) {
3438
- swiper.changeDirection();
3439
- }
3440
- extend(swiper.params, breakpointParams);
3441
- const isEnabled = swiper.params.enabled;
3442
- const hasLoop = swiper.params.loop;
3443
- Object.assign(swiper, {
3444
- allowTouchMove: swiper.params.allowTouchMove,
3445
- allowSlideNext: swiper.params.allowSlideNext,
3446
- allowSlidePrev: swiper.params.allowSlidePrev
3447
- });
3448
- if (wasEnabled && !isEnabled) {
3449
- swiper.disable();
3450
- } else if (!wasEnabled && isEnabled) {
3451
- swiper.enable();
3452
- }
3453
- swiper.currentBreakpoint = breakpoint;
3454
- swiper.emit('_beforeBreakpoint', breakpointParams);
3455
- if (initialized) {
3456
- if (needsReLoop) {
3457
- swiper.loopDestroy();
3458
- swiper.loopCreate(realIndex);
3459
- swiper.updateSlides();
3460
- } else if (!wasLoop && hasLoop) {
3461
- swiper.loopCreate(realIndex);
3462
- swiper.updateSlides();
3463
- } else if (wasLoop && !hasLoop) {
3464
- swiper.loopDestroy();
3465
- }
3466
- }
3467
- swiper.emit('breakpoint', breakpointParams);
3468
- }
3469
-
3470
- function getBreakpoint(breakpoints, base, containerEl) {
3471
- if (base === void 0) {
3472
- base = 'window';
3473
- }
3474
- if (!breakpoints || base === 'container' && !containerEl) return undefined;
3475
- let breakpoint = false;
3476
- const window = getWindow();
3477
- const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
3478
- const points = Object.keys(breakpoints).map(point => {
3479
- if (typeof point === 'string' && point.indexOf('@') === 0) {
3480
- const minRatio = parseFloat(point.substr(1));
3481
- const value = currentHeight * minRatio;
3482
- return {
3483
- value,
3484
- point
3485
- };
3486
- }
3487
- return {
3488
- value: point,
3489
- point
3490
- };
3491
- });
3492
- points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
3493
- for (let i = 0; i < points.length; i += 1) {
3494
- const {
3495
- point,
3496
- value
3497
- } = points[i];
3498
- if (base === 'window') {
3499
- if (window.matchMedia(`(min-width: ${value}px)`).matches) {
3500
- breakpoint = point;
3501
- }
3502
- } else if (value <= containerEl.clientWidth) {
3503
- breakpoint = point;
3504
- }
3505
- }
3506
- return breakpoint || 'max';
3507
- }
3508
-
3509
- var breakpoints = {
3510
- setBreakpoint,
3511
- getBreakpoint
3512
- };
3513
-
3514
- function prepareClasses(entries, prefix) {
3515
- const resultClasses = [];
3516
- entries.forEach(item => {
3517
- if (typeof item === 'object') {
3518
- Object.keys(item).forEach(classNames => {
3519
- if (item[classNames]) {
3520
- resultClasses.push(prefix + classNames);
3521
- }
3522
- });
3523
- } else if (typeof item === 'string') {
3524
- resultClasses.push(prefix + item);
3525
- }
3526
- });
3527
- return resultClasses;
3528
- }
3529
- function addClasses() {
3530
- const swiper = this;
3531
- const {
3532
- classNames,
3533
- params,
3534
- rtl,
3535
- el,
3536
- device
3537
- } = swiper;
3538
- // prettier-ignore
3539
- const suffixes = prepareClasses(['initialized', params.direction, {
3540
- 'free-mode': swiper.params.freeMode && params.freeMode.enabled
3541
- }, {
3542
- 'autoheight': params.autoHeight
3543
- }, {
3544
- 'rtl': rtl
3545
- }, {
3546
- 'grid': params.grid && params.grid.rows > 1
3547
- }, {
3548
- 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'
3549
- }, {
3550
- 'android': device.android
3551
- }, {
3552
- 'ios': device.ios
3553
- }, {
3554
- 'css-mode': params.cssMode
3555
- }, {
3556
- 'centered': params.cssMode && params.centeredSlides
3557
- }, {
3558
- 'watch-progress': params.watchSlidesProgress
3559
- }], params.containerModifierClass);
3560
- classNames.push(...suffixes);
3561
- el.classList.add(...classNames);
3562
- swiper.emitContainerClasses();
3563
- }
3564
-
3565
- function removeClasses() {
3566
- const swiper = this;
3567
- const {
3568
- el,
3569
- classNames
3570
- } = swiper;
3571
- if (!el || typeof el === 'string') return;
3572
- el.classList.remove(...classNames);
3573
- swiper.emitContainerClasses();
3574
- }
3575
-
3576
- var classes = {
3577
- addClasses,
3578
- removeClasses
3579
- };
3580
-
3581
- function checkOverflow() {
3582
- const swiper = this;
3583
- const {
3584
- isLocked: wasLocked,
3585
- params
3586
- } = swiper;
3587
- const {
3588
- slidesOffsetBefore
3589
- } = params;
3590
- if (slidesOffsetBefore) {
3591
- const lastSlideIndex = swiper.slides.length - 1;
3592
- const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
3593
- swiper.isLocked = swiper.size > lastSlideRightEdge;
3594
- } else {
3595
- swiper.isLocked = swiper.snapGrid.length === 1;
3596
- }
3597
- if (params.allowSlideNext === true) {
3598
- swiper.allowSlideNext = !swiper.isLocked;
3599
- }
3600
- if (params.allowSlidePrev === true) {
3601
- swiper.allowSlidePrev = !swiper.isLocked;
3602
- }
3603
- if (wasLocked && wasLocked !== swiper.isLocked) {
3604
- swiper.isEnd = false;
3605
- }
3606
- if (wasLocked !== swiper.isLocked) {
3607
- swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
3608
- }
3609
- }
3610
- var checkOverflow$1 = {
3611
- checkOverflow
3612
- };
3613
-
3614
- var defaults = {
3615
- init: true,
3616
- direction: 'horizontal',
3617
- oneWayMovement: false,
3618
- swiperElementNodeName: 'SWIPER-CONTAINER',
3619
- touchEventsTarget: 'wrapper',
3620
- initialSlide: 0,
3621
- speed: 300,
3622
- cssMode: false,
3623
- updateOnWindowResize: true,
3624
- resizeObserver: true,
3625
- nested: false,
3626
- createElements: false,
3627
- eventsPrefix: 'swiper',
3628
- enabled: true,
3629
- focusableElements: 'input, select, option, textarea, button, video, label',
3630
- // Overrides
3631
- width: null,
3632
- height: null,
3633
- //
3634
- preventInteractionOnTransition: false,
3635
- // ssr
3636
- userAgent: null,
3637
- url: null,
3638
- // To support iOS's swipe-to-go-back gesture (when being used in-app).
3639
- edgeSwipeDetection: false,
3640
- edgeSwipeThreshold: 20,
3641
- // Autoheight
3642
- autoHeight: false,
3643
- // Set wrapper width
3644
- setWrapperSize: false,
3645
- // Virtual Translate
3646
- virtualTranslate: false,
3647
- // Effects
3648
- effect: 'slide',
3649
- // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
3650
-
3651
- // Breakpoints
3652
- breakpoints: undefined,
3653
- breakpointsBase: 'window',
3654
- // Slides grid
3655
- spaceBetween: 0,
3656
- slidesPerView: 1,
3657
- slidesPerGroup: 1,
3658
- slidesPerGroupSkip: 0,
3659
- slidesPerGroupAuto: false,
3660
- centeredSlides: false,
3661
- centeredSlidesBounds: false,
3662
- slidesOffsetBefore: 0,
3663
- // in px
3664
- slidesOffsetAfter: 0,
3665
- // in px
3666
- normalizeSlideIndex: true,
3667
- centerInsufficientSlides: false,
3668
- // Disable swiper and hide navigation when container not overflow
3669
- watchOverflow: true,
3670
- // Round length
3671
- roundLengths: false,
3672
- // Touches
3673
- touchRatio: 1,
3674
- touchAngle: 45,
3675
- simulateTouch: true,
3676
- shortSwipes: true,
3677
- longSwipes: true,
3678
- longSwipesRatio: 0.5,
3679
- longSwipesMs: 300,
3680
- followFinger: true,
3681
- allowTouchMove: true,
3682
- threshold: 5,
3683
- touchMoveStopPropagation: false,
3684
- touchStartPreventDefault: true,
3685
- touchStartForcePreventDefault: false,
3686
- touchReleaseOnEdges: false,
3687
- // Unique Navigation Elements
3688
- uniqueNavElements: true,
3689
- // Resistance
3690
- resistance: true,
3691
- resistanceRatio: 0.85,
3692
- // Progress
3693
- watchSlidesProgress: false,
3694
- // Cursor
3695
- grabCursor: false,
3696
- // Clicks
3697
- preventClicks: true,
3698
- preventClicksPropagation: true,
3699
- slideToClickedSlide: false,
3700
- // loop
3701
- loop: false,
3702
- loopAddBlankSlides: true,
3703
- loopAdditionalSlides: 0,
3704
- loopPreventsSliding: true,
3705
- // rewind
3706
- rewind: false,
3707
- // Swiping/no swiping
3708
- allowSlidePrev: true,
3709
- allowSlideNext: true,
3710
- swipeHandler: null,
3711
- // '.swipe-handler',
3712
- noSwiping: true,
3713
- noSwipingClass: 'swiper-no-swiping',
3714
- noSwipingSelector: null,
3715
- // Passive Listeners
3716
- passiveListeners: true,
3717
- maxBackfaceHiddenSlides: 10,
3718
- // NS
3719
- containerModifierClass: 'swiper-',
3720
- // NEW
3721
- slideClass: 'swiper-slide',
3722
- slideBlankClass: 'swiper-slide-blank',
3723
- slideActiveClass: 'swiper-slide-active',
3724
- slideVisibleClass: 'swiper-slide-visible',
3725
- slideFullyVisibleClass: 'swiper-slide-fully-visible',
3726
- slideNextClass: 'swiper-slide-next',
3727
- slidePrevClass: 'swiper-slide-prev',
3728
- wrapperClass: 'swiper-wrapper',
3729
- lazyPreloaderClass: 'swiper-lazy-preloader',
3730
- lazyPreloadPrevNext: 0,
3731
- // Callbacks
3732
- runCallbacksOnInit: true,
3733
- // Internals
3734
- _emitClasses: false
3735
- };
3736
-
3737
- function moduleExtendParams(params, allModulesParams) {
3738
- return function extendParams(obj) {
3739
- if (obj === void 0) {
3740
- obj = {};
3741
- }
3742
- const moduleParamName = Object.keys(obj)[0];
3743
- const moduleParams = obj[moduleParamName];
3744
- if (typeof moduleParams !== 'object' || moduleParams === null) {
3745
- extend(allModulesParams, obj);
3746
- return;
3747
- }
3748
- if (params[moduleParamName] === true) {
3749
- params[moduleParamName] = {
3750
- enabled: true
3751
- };
3752
- }
3753
- if (moduleParamName === 'navigation' && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].prevEl && !params[moduleParamName].nextEl) {
3754
- params[moduleParamName].auto = true;
3755
- }
3756
- if (['pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].el) {
3757
- params[moduleParamName].auto = true;
3758
- }
3759
- if (!(moduleParamName in params && 'enabled' in moduleParams)) {
3760
- extend(allModulesParams, obj);
3761
- return;
3762
- }
3763
- if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
3764
- params[moduleParamName].enabled = true;
3765
- }
3766
- if (!params[moduleParamName]) params[moduleParamName] = {
3767
- enabled: false
3768
- };
3769
- extend(allModulesParams, obj);
3770
- };
3771
- }
3772
-
3773
- /* eslint no-param-reassign: "off" */
3774
- const prototypes = {
3775
- eventsEmitter,
3776
- update,
3777
- translate,
3778
- transition,
3779
- slide,
3780
- loop,
3781
- grabCursor,
3782
- events: events$1,
3783
- breakpoints,
3784
- checkOverflow: checkOverflow$1,
3785
- classes
3786
- };
3787
- const extendedDefaults = {};
3788
- class Swiper {
3789
- constructor() {
3790
- let el;
3791
- let params;
3792
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3793
- args[_key] = arguments[_key];
3794
- }
3795
- if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
3796
- params = args[0];
3797
- } else {
3798
- [el, params] = args;
3799
- }
3800
- if (!params) params = {};
3801
- params = extend({}, params);
3802
- if (el && !params.el) params.el = el;
3803
- const document = getDocument();
3804
- if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) {
3805
- const swipers = [];
3806
- document.querySelectorAll(params.el).forEach(containerEl => {
3807
- const newParams = extend({}, params, {
3808
- el: containerEl
3809
- });
3810
- swipers.push(new Swiper(newParams));
3811
- });
3812
- // eslint-disable-next-line no-constructor-return
3813
- return swipers;
3814
- }
3815
-
3816
- // Swiper Instance
3817
- const swiper = this;
3818
- swiper.__swiper__ = true;
3819
- swiper.support = getSupport();
3820
- swiper.device = getDevice({
3821
- userAgent: params.userAgent
3822
- });
3823
- swiper.browser = getBrowser();
3824
- swiper.eventsListeners = {};
3825
- swiper.eventsAnyListeners = [];
3826
- swiper.modules = [...swiper.__modules__];
3827
- if (params.modules && Array.isArray(params.modules)) {
3828
- swiper.modules.push(...params.modules);
3829
- }
3830
- const allModulesParams = {};
3831
- swiper.modules.forEach(mod => {
3832
- mod({
3833
- params,
3834
- swiper,
3835
- extendParams: moduleExtendParams(params, allModulesParams),
3836
- on: swiper.on.bind(swiper),
3837
- once: swiper.once.bind(swiper),
3838
- off: swiper.off.bind(swiper),
3839
- emit: swiper.emit.bind(swiper)
3840
- });
3841
- });
3842
-
3843
- // Extend defaults with modules params
3844
- const swiperParams = extend({}, defaults, allModulesParams);
3845
-
3846
- // Extend defaults with passed params
3847
- swiper.params = extend({}, swiperParams, extendedDefaults, params);
3848
- swiper.originalParams = extend({}, swiper.params);
3849
- swiper.passedParams = extend({}, params);
3850
-
3851
- // add event listeners
3852
- if (swiper.params && swiper.params.on) {
3853
- Object.keys(swiper.params.on).forEach(eventName => {
3854
- swiper.on(eventName, swiper.params.on[eventName]);
3855
- });
3856
- }
3857
- if (swiper.params && swiper.params.onAny) {
3858
- swiper.onAny(swiper.params.onAny);
3859
- }
3860
-
3861
- // Extend Swiper
3862
- Object.assign(swiper, {
3863
- enabled: swiper.params.enabled,
3864
- el,
3865
- // Classes
3866
- classNames: [],
3867
- // Slides
3868
- slides: [],
3869
- slidesGrid: [],
3870
- snapGrid: [],
3871
- slidesSizesGrid: [],
3872
- // isDirection
3873
- isHorizontal() {
3874
- return swiper.params.direction === 'horizontal';
3875
- },
3876
- isVertical() {
3877
- return swiper.params.direction === 'vertical';
3878
- },
3879
- // Indexes
3880
- activeIndex: 0,
3881
- realIndex: 0,
3882
- //
3883
- isBeginning: true,
3884
- isEnd: false,
3885
- // Props
3886
- translate: 0,
3887
- previousTranslate: 0,
3888
- progress: 0,
3889
- velocity: 0,
3890
- animating: false,
3891
- cssOverflowAdjustment() {
3892
- // Returns 0 unless `translate` is > 2**23
3893
- // Should be subtracted from css values to prevent overflow
3894
- return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;
3895
- },
3896
- // Locks
3897
- allowSlideNext: swiper.params.allowSlideNext,
3898
- allowSlidePrev: swiper.params.allowSlidePrev,
3899
- // Touch Events
3900
- touchEventsData: {
3901
- isTouched: undefined,
3902
- isMoved: undefined,
3903
- allowTouchCallbacks: undefined,
3904
- touchStartTime: undefined,
3905
- isScrolling: undefined,
3906
- currentTranslate: undefined,
3907
- startTranslate: undefined,
3908
- allowThresholdMove: undefined,
3909
- // Form elements to match
3910
- focusableElements: swiper.params.focusableElements,
3911
- // Last click time
3912
- lastClickTime: 0,
3913
- clickTimeout: undefined,
3914
- // Velocities
3915
- velocities: [],
3916
- allowMomentumBounce: undefined,
3917
- startMoving: undefined,
3918
- pointerId: null,
3919
- touchId: null
3920
- },
3921
- // Clicks
3922
- allowClick: true,
3923
- // Touches
3924
- allowTouchMove: swiper.params.allowTouchMove,
3925
- touches: {
3926
- startX: 0,
3927
- startY: 0,
3928
- currentX: 0,
3929
- currentY: 0,
3930
- diff: 0
3931
- },
3932
- // Images
3933
- imagesToLoad: [],
3934
- imagesLoaded: 0
3935
- });
3936
- swiper.emit('_swiper');
3937
-
3938
- // Init
3939
- if (swiper.params.init) {
3940
- swiper.init();
3941
- }
3942
-
3943
- // Return app instance
3944
- // eslint-disable-next-line no-constructor-return
3945
- return swiper;
3946
- }
3947
- getDirectionLabel(property) {
3948
- if (this.isHorizontal()) {
3949
- return property;
3950
- }
3951
- // prettier-ignore
3952
- return {
3953
- 'width': 'height',
3954
- 'margin-top': 'margin-left',
3955
- 'margin-bottom ': 'margin-right',
3956
- 'margin-left': 'margin-top',
3957
- 'margin-right': 'margin-bottom',
3958
- 'padding-left': 'padding-top',
3959
- 'padding-right': 'padding-bottom',
3960
- 'marginRight': 'marginBottom'
3961
- }[property];
3962
- }
3963
- getSlideIndex(slideEl) {
3964
- const {
3965
- slidesEl,
3966
- params
3967
- } = this;
3968
- const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3969
- const firstSlideIndex = elementIndex(slides[0]);
3970
- return elementIndex(slideEl) - firstSlideIndex;
3971
- }
3972
- getSlideIndexByData(index) {
3973
- return this.getSlideIndex(this.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index));
3974
- }
3975
- recalcSlides() {
3976
- const swiper = this;
3977
- const {
3978
- slidesEl,
3979
- params
3980
- } = swiper;
3981
- swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3982
- }
3983
- enable() {
3984
- const swiper = this;
3985
- if (swiper.enabled) return;
3986
- swiper.enabled = true;
3987
- if (swiper.params.grabCursor) {
3988
- swiper.setGrabCursor();
3989
- }
3990
- swiper.emit('enable');
3991
- }
3992
- disable() {
3993
- const swiper = this;
3994
- if (!swiper.enabled) return;
3995
- swiper.enabled = false;
3996
- if (swiper.params.grabCursor) {
3997
- swiper.unsetGrabCursor();
3998
- }
3999
- swiper.emit('disable');
4000
- }
4001
- setProgress(progress, speed) {
4002
- const swiper = this;
4003
- progress = Math.min(Math.max(progress, 0), 1);
4004
- const min = swiper.minTranslate();
4005
- const max = swiper.maxTranslate();
4006
- const current = (max - min) * progress + min;
4007
- swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
4008
- swiper.updateActiveIndex();
4009
- swiper.updateSlidesClasses();
4010
- }
4011
- emitContainerClasses() {
4012
- const swiper = this;
4013
- if (!swiper.params._emitClasses || !swiper.el) return;
4014
- const cls = swiper.el.className.split(' ').filter(className => {
4015
- return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
4016
- });
4017
- swiper.emit('_containerClasses', cls.join(' '));
4018
- }
4019
- getSlideClasses(slideEl) {
4020
- const swiper = this;
4021
- if (swiper.destroyed) return '';
4022
- return slideEl.className.split(' ').filter(className => {
4023
- return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
4024
- }).join(' ');
4025
- }
4026
- emitSlidesClasses() {
4027
- const swiper = this;
4028
- if (!swiper.params._emitClasses || !swiper.el) return;
4029
- const updates = [];
4030
- swiper.slides.forEach(slideEl => {
4031
- const classNames = swiper.getSlideClasses(slideEl);
4032
- updates.push({
4033
- slideEl,
4034
- classNames
4035
- });
4036
- swiper.emit('_slideClass', slideEl, classNames);
4037
- });
4038
- swiper.emit('_slideClasses', updates);
4039
- }
4040
- slidesPerViewDynamic(view, exact) {
4041
- if (view === void 0) {
4042
- view = 'current';
4043
- }
4044
- if (exact === void 0) {
4045
- exact = false;
4046
- }
4047
- const swiper = this;
4048
- const {
4049
- params,
4050
- slides,
4051
- slidesGrid,
4052
- slidesSizesGrid,
4053
- size: swiperSize,
4054
- activeIndex
4055
- } = swiper;
4056
- let spv = 1;
4057
- if (typeof params.slidesPerView === 'number') return params.slidesPerView;
4058
- if (params.centeredSlides) {
4059
- let slideSize = slides[activeIndex] ? Math.ceil(slides[activeIndex].swiperSlideSize) : 0;
4060
- let breakLoop;
4061
- for (let i = activeIndex + 1; i < slides.length; i += 1) {
4062
- if (slides[i] && !breakLoop) {
4063
- slideSize += Math.ceil(slides[i].swiperSlideSize);
4064
- spv += 1;
4065
- if (slideSize > swiperSize) breakLoop = true;
4066
- }
4067
- }
4068
- for (let i = activeIndex - 1; i >= 0; i -= 1) {
4069
- if (slides[i] && !breakLoop) {
4070
- slideSize += slides[i].swiperSlideSize;
4071
- spv += 1;
4072
- if (slideSize > swiperSize) breakLoop = true;
4073
- }
4074
- }
4075
- } else {
4076
- // eslint-disable-next-line
4077
- if (view === 'current') {
4078
- for (let i = activeIndex + 1; i < slides.length; i += 1) {
4079
- const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
4080
- if (slideInView) {
4081
- spv += 1;
4082
- }
4083
- }
4084
- } else {
4085
- // previous
4086
- for (let i = activeIndex - 1; i >= 0; i -= 1) {
4087
- const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
4088
- if (slideInView) {
4089
- spv += 1;
4090
- }
4091
- }
4092
- }
4093
- }
4094
- return spv;
4095
- }
4096
- update() {
4097
- const swiper = this;
4098
- if (!swiper || swiper.destroyed) return;
4099
- const {
4100
- snapGrid,
4101
- params
4102
- } = swiper;
4103
- // Breakpoints
4104
- if (params.breakpoints) {
4105
- swiper.setBreakpoint();
4106
- }
4107
- [...swiper.el.querySelectorAll('[loading="lazy"]')].forEach(imageEl => {
4108
- if (imageEl.complete) {
4109
- processLazyPreloader(swiper, imageEl);
4110
- }
4111
- });
4112
- swiper.updateSize();
4113
- swiper.updateSlides();
4114
- swiper.updateProgress();
4115
- swiper.updateSlidesClasses();
4116
- function setTranslate() {
4117
- const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
4118
- const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
4119
- swiper.setTranslate(newTranslate);
4120
- swiper.updateActiveIndex();
4121
- swiper.updateSlidesClasses();
4122
- }
4123
- let translated;
4124
- if (params.freeMode && params.freeMode.enabled && !params.cssMode) {
4125
- setTranslate();
4126
- if (params.autoHeight) {
4127
- swiper.updateAutoHeight();
4128
- }
4129
- } else {
4130
- if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !params.centeredSlides) {
4131
- const slides = swiper.virtual && params.virtual.enabled ? swiper.virtual.slides : swiper.slides;
4132
- translated = swiper.slideTo(slides.length - 1, 0, false, true);
4133
- } else {
4134
- translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
4135
- }
4136
- if (!translated) {
4137
- setTranslate();
4138
- }
4139
- }
4140
- if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
4141
- swiper.checkOverflow();
4142
- }
4143
- swiper.emit('update');
4144
- }
4145
- changeDirection(newDirection, needUpdate) {
4146
- if (needUpdate === void 0) {
4147
- needUpdate = true;
4148
- }
4149
- const swiper = this;
4150
- const currentDirection = swiper.params.direction;
4151
- if (!newDirection) {
4152
- // eslint-disable-next-line
4153
- newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
4154
- }
4155
- if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
4156
- return swiper;
4157
- }
4158
- swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`);
4159
- swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`);
4160
- swiper.emitContainerClasses();
4161
- swiper.params.direction = newDirection;
4162
- swiper.slides.forEach(slideEl => {
4163
- if (newDirection === 'vertical') {
4164
- slideEl.style.width = '';
4165
- } else {
4166
- slideEl.style.height = '';
4167
- }
4168
- });
4169
- swiper.emit('changeDirection');
4170
- if (needUpdate) swiper.update();
4171
- return swiper;
4172
- }
4173
- changeLanguageDirection(direction) {
4174
- const swiper = this;
4175
- if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;
4176
- swiper.rtl = direction === 'rtl';
4177
- swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;
4178
- if (swiper.rtl) {
4179
- swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`);
4180
- swiper.el.dir = 'rtl';
4181
- } else {
4182
- swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`);
4183
- swiper.el.dir = 'ltr';
4184
- }
4185
- swiper.update();
4186
- }
4187
- mount(element) {
4188
- const swiper = this;
4189
- if (swiper.mounted) return true;
4190
-
4191
- // Find el
4192
- let el = element || swiper.params.el;
4193
- if (typeof el === 'string') {
4194
- el = document.querySelector(el);
4195
- }
4196
- if (!el) {
4197
- return false;
4198
- }
4199
- el.swiper = swiper;
4200
- if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === swiper.params.swiperElementNodeName.toUpperCase()) {
4201
- swiper.isElement = true;
4202
- }
4203
- const getWrapperSelector = () => {
4204
- return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;
4205
- };
4206
- const getWrapper = () => {
4207
- if (el && el.shadowRoot && el.shadowRoot.querySelector) {
4208
- const res = el.shadowRoot.querySelector(getWrapperSelector());
4209
- // Children needs to return slot items
4210
- return res;
4211
- }
4212
- return elementChildren(el, getWrapperSelector())[0];
4213
- };
4214
- // Find Wrapper
4215
- let wrapperEl = getWrapper();
4216
- if (!wrapperEl && swiper.params.createElements) {
4217
- wrapperEl = createElement('div', swiper.params.wrapperClass);
4218
- el.append(wrapperEl);
4219
- elementChildren(el, `.${swiper.params.slideClass}`).forEach(slideEl => {
4220
- wrapperEl.append(slideEl);
4221
- });
4222
- }
4223
- Object.assign(swiper, {
4224
- el,
4225
- wrapperEl,
4226
- slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl,
4227
- hostEl: swiper.isElement ? el.parentNode.host : el,
4228
- mounted: true,
4229
- // RTL
4230
- rtl: el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl',
4231
- rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl'),
4232
- wrongRTL: elementStyle(wrapperEl, 'display') === '-webkit-box'
4233
- });
4234
- return true;
4235
- }
4236
- init(el) {
4237
- const swiper = this;
4238
- if (swiper.initialized) return swiper;
4239
- const mounted = swiper.mount(el);
4240
- if (mounted === false) return swiper;
4241
- swiper.emit('beforeInit');
4242
-
4243
- // Set breakpoint
4244
- if (swiper.params.breakpoints) {
4245
- swiper.setBreakpoint();
4246
- }
4247
-
4248
- // Add Classes
4249
- swiper.addClasses();
4250
-
4251
- // Update size
4252
- swiper.updateSize();
4253
-
4254
- // Update slides
4255
- swiper.updateSlides();
4256
- if (swiper.params.watchOverflow) {
4257
- swiper.checkOverflow();
4258
- }
4259
-
4260
- // Set Grab Cursor
4261
- if (swiper.params.grabCursor && swiper.enabled) {
4262
- swiper.setGrabCursor();
4263
- }
4264
-
4265
- // Slide To Initial Slide
4266
- if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
4267
- swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true);
4268
- } else {
4269
- swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
4270
- }
4271
-
4272
- // Create loop
4273
- if (swiper.params.loop) {
4274
- swiper.loopCreate(undefined, true);
4275
- }
4276
-
4277
- // Attach events
4278
- swiper.attachEvents();
4279
- const lazyElements = [...swiper.el.querySelectorAll('[loading="lazy"]')];
4280
- if (swiper.isElement) {
4281
- lazyElements.push(...swiper.hostEl.querySelectorAll('[loading="lazy"]'));
4282
- }
4283
- lazyElements.forEach(imageEl => {
4284
- if (imageEl.complete) {
4285
- processLazyPreloader(swiper, imageEl);
4286
- } else {
4287
- imageEl.addEventListener('load', e => {
4288
- processLazyPreloader(swiper, e.target);
4289
- });
4290
- }
4291
- });
4292
- preload(swiper);
4293
-
4294
- // Init Flag
4295
- swiper.initialized = true;
4296
- preload(swiper);
4297
-
4298
- // Emit
4299
- swiper.emit('init');
4300
- swiper.emit('afterInit');
4301
- return swiper;
4302
- }
4303
- destroy(deleteInstance, cleanStyles) {
4304
- if (deleteInstance === void 0) {
4305
- deleteInstance = true;
4306
- }
4307
- if (cleanStyles === void 0) {
4308
- cleanStyles = true;
4309
- }
4310
- const swiper = this;
4311
- const {
4312
- params,
4313
- el,
4314
- wrapperEl,
4315
- slides
4316
- } = swiper;
4317
- if (typeof swiper.params === 'undefined' || swiper.destroyed) {
4318
- return null;
4319
- }
4320
- swiper.emit('beforeDestroy');
4321
-
4322
- // Init Flag
4323
- swiper.initialized = false;
4324
-
4325
- // Detach events
4326
- swiper.detachEvents();
4327
-
4328
- // Destroy loop
4329
- if (params.loop) {
4330
- swiper.loopDestroy();
4331
- }
4332
-
4333
- // Cleanup styles
4334
- if (cleanStyles) {
4335
- swiper.removeClasses();
4336
- if (el && typeof el !== 'string') {
4337
- el.removeAttribute('style');
4338
- }
4339
- if (wrapperEl) {
4340
- wrapperEl.removeAttribute('style');
4341
- }
4342
- if (slides && slides.length) {
4343
- slides.forEach(slideEl => {
4344
- slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
4345
- slideEl.removeAttribute('style');
4346
- slideEl.removeAttribute('data-swiper-slide-index');
4347
- });
4348
- }
4349
- }
4350
- swiper.emit('destroy');
4351
-
4352
- // Detach emitter events
4353
- Object.keys(swiper.eventsListeners).forEach(eventName => {
4354
- swiper.off(eventName);
4355
- });
4356
- if (deleteInstance !== false) {
4357
- if (swiper.el && typeof swiper.el !== 'string') {
4358
- swiper.el.swiper = null;
4359
- }
4360
- deleteProps(swiper);
4361
- }
4362
- swiper.destroyed = true;
4363
- return null;
4364
- }
4365
- static extendDefaults(newDefaults) {
4366
- extend(extendedDefaults, newDefaults);
4367
- }
4368
- static get extendedDefaults() {
4369
- return extendedDefaults;
4370
- }
4371
- static get defaults() {
4372
- return defaults;
4373
- }
4374
- static installModule(mod) {
4375
- if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];
4376
- const modules = Swiper.prototype.__modules__;
4377
- if (typeof mod === 'function' && modules.indexOf(mod) < 0) {
4378
- modules.push(mod);
4379
- }
4380
- }
4381
- static use(module) {
4382
- if (Array.isArray(module)) {
4383
- module.forEach(m => Swiper.installModule(m));
4384
- return Swiper;
4385
- }
4386
- Swiper.installModule(module);
4387
- return Swiper;
4388
- }
4389
- }
4390
- Object.keys(prototypes).forEach(prototypeGroup => {
4391
- Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {
4392
- Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
4393
- });
4394
- });
4395
- Swiper.use([Resize, Observer]);
4396
-
4397
- var styleCss$3 = i$3`:focus:not(:focus-visible){outline:3px solid transparent}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}:host([fluid]) .auro-button,:host([fluid=true]) .auro-button{min-width:auto;width:100%}:host([variant=flat]){display:inline-block;height:var(--ds-size-300, 1.5rem);width:var(--ds-size-300, 1.5rem)}:host([variant=flat]) .auro-button{height:100%;width:100%}::slotted(svg){vertical-align:middle}slot{pointer-events:none}.auro-button{position:relative;padding:0 var(--ds-size-300, 1.5rem);cursor:pointer;border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, 0.375rem);font-family:var(--ds-basic-text-body-default-font-family, "AS Circular");font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);line-height:var(--ds-basic-text-body-default-line-height, 24px);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);overflow:hidden;text-overflow:ellipsis;user-select:none;white-space:nowrap;min-height:var(--ds-size-600, 3rem);max-height:var(--ds-size-600, 3rem);display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ds-size-100, 0.5rem);margin:0;-webkit-touch-callout:none;-webkit-user-select:none}.auro-button:active{transform:scale(0.95)}.auro-button:focus-visible{outline:none}.auro-button:focus-visible:not([variant=flat]){outline-style:solid;outline-width:var(--ds-size-50, 0.25rem);outline-offset:calc(var(--ds-size-50, 0.25rem)*-1)}.auro-button:focus-visible:not([variant=flat]):not([variant=secondary]):not([variant=tertiary]){outline-width:calc(var(--ds-size-50, 0.25rem) - 1px)}.auro-button.loading{cursor:not-allowed}.auro-button.loading *:not([auro-loader]){visibility:hidden}@media screen and (min-width: 576px){.auro-button{min-width:8.75rem;width:auto}}.auro-button:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=secondary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=flat]{height:unset;width:unset;min-height:unset;max-height:unset;min-width:unset;max-width:unset;border:0;border-radius:unset;gap:unset;padding:unset}.auro-button[onDark]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark][variant=secondary]:disabled{cursor:not-allowed;transform:unset}@media(hover: hover){.auro-button[onDark][variant=tertiary]:active,.auro-button[onDark][variant=tertiary]:hover{box-shadow:none}}.auro-button[onDark][variant=tertiary]:active{box-shadow:none}.auro-button[onDark][variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button--slim{padding:var(--ds-size-100, 0.5rem) var(--ds-size-200, 1rem);font-family:var(--ds-basic-text-body-sm-font-family, "AS Circular");font-size:var(--ds-basic-text-body-sm-font-size, 14px);font-weight:var(--ds-basic-text-body-sm-font-weight, 450);line-height:var(--ds-basic-text-body-sm-line-height, 20px);letter-spacing:var(--ds-basic-text-body-sm-letter-spacing, 0);min-width:unset;min-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem));max-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem))}.auro-button--iconOnly{padding:0 var(--ds-size-100, 0.5rem);border-radius:100px;min-width:unset;height:var(--ds-size-600, 3rem);width:var(--ds-size-500, 2.5rem)}.auro-button--iconOnly ::slotted(auro-icon),.auro-button--iconOnly ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--iconOnly:not(.auro-button--rounded):focus-visible:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]){outline-width:1px;outline-offset:-2px}.auro-button--iconOnlySlim{padding:0 var(--ds-size-50, 0.25rem);height:calc(var(--ds-size-400, 2rem) + var(--ds-size-50, 0.25rem));width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-50, 0.25rem))}.auro-button--iconOnlySlim ::slotted(auro-icon),.auro-button--iconOnlySlim ::slotted([auro-icon]){--ds-auro-icon-size:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem))}.auro-button--rounded{border-radius:100px;box-shadow:var(--ds-elevation-300, 0px 0px 15px rgba(0, 0, 0, 0.2));height:var(--ds-size-500, 2.5rem);min-width:unset;transition:all 300ms ease-out,outline 0ms,outline-offset 0ms}.auro-button--rounded ::slotted(auro-icon),.auro-button--rounded ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--rounded:focus-visible:not([variant=flat]):after{border-radius:100px}:host([rounded]) .textSlot{transition:opacity 300ms ease-in;opacity:1}:host([rounded][iconOnly]) .textSlot{opacity:0}:host([rounded][iconOnly]) .textWrapper{display:none}:host([rounded][iconOnly]) .auro-button{min-width:unset;padding:unset;width:var(--ds-size-600, 3rem)}[auro-loader]{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}`;
4398
-
4399
- var colorCss$2 = i$3`[auro-loader]{color:var(--ds-auro-button-loader-color)}.auro-button{-webkit-tap-highlight-color:var(--ds-auro-button-tap-color);color:var(--ds-auro-button-text-color);background-color:var(--ds-auro-button-container-color);background-image:linear-gradient(var(--ds-auro-button-container-image), var(--ds-auro-button-container-image));border-color:var(--ds-auro-button-border-color)}.auro-button:not([variant=secondary]):not([variant=tertiary]):focus-visible{outline-color:var(--ds-auro-button-border-inset-color)}.auro-button:not([ondark]):active:not(:disabled),.auro-button:not([ondark]):hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-hover, #00274a)}.auro-button:not([ondark]):disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-disabled, #acc9e2)}.auro-button:not([ondark])[variant=secondary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text, #01426a)}.auro-button:not([ondark])[variant=secondary]:active:not(:disabled),.auro-button:not([ondark])[variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-hover, #00274a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-hover, #00274a)}.auro-button:not([ondark])[variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=secondary]:disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-disabled, #cfe0ef);--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text, #01426a)}.auro-button:not([ondark])[variant=tertiary]:active:not(:disabled),.auro-button:not([ondark])[variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=tertiary]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=flat]{color:var(--ds-advanced-color-button-flat-text, #676767);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:active:not(:disabled),.auro-button:not([ondark])[variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-hover, #525252);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-disabled, #d0d0d0);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark]{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a)}.auro-button[ondark]:active:not(:disabled),.auro-button[ondark]:hover:not(:disabled){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-hover, #ebf3f9);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9)}.auro-button[ondark]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]:disabled{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=secondary]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:active:not(:disabled),.auro-button[ondark][variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse-disabled, #dddddd)}.auro-button[ondark][variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:active:not(:disabled),.auro-button[ondark][variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=flat]{color:var(--ds-advanced-color-button-flat-text-inverse, #ffffff);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:active:not(:disabled),.auro-button[ondark][variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-inverse-hover, #adadad);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-inverse-disabled, #7e8894);background-color:transparent;background-image:none;border-color:transparent}`;
4400
-
4401
- var tokensCss$2 = i$3`:host{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-tap-color:transparent}`;
4402
-
4403
- var styleCss$2 = i$3`:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin:0.375rem;--margin-xs:0.2rem;--margin-sm:0.5rem;--margin-md:0.75rem;--margin-lg:1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin)*6);height:1.5rem}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(2.55rem + var(--margin-xs)*6);height:1.55rem}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm)*6);height:2.5rem}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md)*6);height:3.5rem}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg)*6);height:5.5rem}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-400ms}:host([pulse])>span:nth-child(2){animation-delay:-200ms}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,100%{opacity:.1;transform:scale(0.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}100%{left:110%}}:host>.no-animation{display:none}@media(prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center;font-size:1rem}:host>span{opacity:1}:host>.loader{display:none}:host>.no-animation{display:block}}`;
4404
-
4405
- var colorCss$1 = i$3`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]){--ds-auro-loader-color:var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]){--ds-auro-loader-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color:transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color:currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color:currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}`;
4406
-
4407
- var tokensCss$1 = i$3`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
4408
-
4409
- var styleCss$1 = i$3`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
4410
-
4411
- var tokensCss = i$3`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
4412
-
4413
- var colorCss = i$3`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}`;
4414
-
4415
- var styleCss = i$3`:focus:not(:focus-visible){outline:3px solid transparent}@font-face{font-family:swiper-icons;src:url(data:application/font-woff;charset=utf-8;base64,\\ d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA) format("woff");font-weight:400;font-style:normal}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translateZ(0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;transform:translate3d(0,-50%,0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translate(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, .25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}:root{--swiper-navigation-size: 44px}.swiper-button-prev,.swiper-button-next{position:absolute;top:var(--swiper-navigation-top-offset, 50%);width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - var(--swiper-navigation-size) / 2);z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none!important}.swiper-button-prev svg,.swiper-button-next svg{width:100%;height:100%;object-fit:contain;transform-origin:center}.swiper-rtl .swiper-button-prev svg,.swiper-rtl .swiper-button-next svg{transform:rotate(180deg)}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:var(--swiper-navigation-sides-offset, 10px);right:auto}.swiper-button-lock{display:none}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:var(--swiper-navigation-sides-offset, 10px);left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}:host{display:block;width:100%}.container{display:flex;width:100%;flex-direction:column;align-items:flex-start}slot[name=header]{display:block;line-height:44px;font-size:36px;font-weight:300}slot[name=subheader]{display:block;line-height:26px;font-size:18px;color:var(--ds-basic-color-texticon-muted, #676767);font-weight:450}.container.has-both-headers slot[name=subheader]{margin-top:12px;margin-bottom:40px}.container.has-header-only slot[name=header]{margin-bottom:40px}.container.has-subheader-only slot[name=subheader]{margin-bottom:40px}.slideshow-wrapper{position:relative;width:100%;display:flex;justify-content:center;align-items:center}.swiper{width:100%;margin-left:0;height:auto;max-width:100%}.swiper-wrapper{display:flex;height:auto}.swiper-wrapper>*{border-radius:15px}.play-pause{--ds-auro-button-border-color: var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-container-color: var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-container-image: var(--ds-advanced-color-button-primary-background, #01426a)}.pagination-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100%;margin-top:40px}.swiper-pagination{display:flex;box-sizing:border-box;justify-content:flex-start;align-items:center;flex-direction:row;padding-left:58px;width:unset;--swiper-pagination-bottom: none}.swiper-pagination-bullet{width:12px;height:12px;border-radius:50%;background-color:none;position:relative;--swiper-pagination-bullet-horizontal-gap: 10px;--swiper-pagination-bullet-inactive-color: #CFE0EF;--swiper-pagination-bullet-inactive-opacity: none}.swiper-pagination-bullet:focus,.swiper-pagination-bullet:focus-visible{outline:2px solid var(--ds-advanced-color-state-focused, #01426a);outline-offset:2px}.swiper-pagination-bullet:hover{--swiper-pagination-bullet-inactive-color: #89B2D4}.swiper-pagination-bullet:before{content:"";position:absolute;width:24px;height:24px;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:50%;background-color:transparent}.swiper-pagination-bullet-active{background-color:transparent;width:52px;height:12px;position:relative;border-radius:12px;overflow:hidden}.pagination-swiper-up__progress-bar-container{width:100%;height:100%;overflow:hidden;position:absolute;top:0;left:0;background:#cfe0ef;border-radius:12px}.pagination-swiper-up__progress-bar-container:hover{background:#89b2d4}.pagination-swiper-up__progress{width:0%;height:100%;background:var(--ds-advanced-color-button-primary-background, #01426a);border-radius:12px}:host([variant=slideshow]) .swiper{width:calc(100% + 64px);padding-left:64px;margin-left:-64px}:host([variant=slider]) .slideshow-wrapper{width:calc(100% + 64px);padding-left:64px;padding-right:64px;margin-left:-64px;margin-right:-64px}:host([variant=slider]) .swiper-pagination{display:none}:host([variant=slider]) .swiper{width:calc(100% - 64px)}:host([variant=slider]) .chevron-left,:host([variant=slider]) .chevron-right{position:absolute;display:none;top:50%;transform:translateY(-50%);z-index:10;--ds-auro-button-border-color: var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-container-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-container-image: var(--ds-advanced-color-state-focused, #01426a);opacity:.4;color:var(--ds-advanced-color-shared-background, #ffffff)}:host([variant=slider]) .chevron-left{left:8px}:host([variant=slider]) .chevron-right{right:72px}:host([variant=slider]) .slideshow-wrapper:hover .chevron-left,:host([variant=slider]) .slideshow-wrapper:hover .chevron-right{display:block}
4416
- `;
4417
-
4418
- export { E, Swiper as S, T, elementParents as a, elementOuterSize as b, createElement as c, elementIndex as d, elementChildren as e, i$3 as f, getDocument as g, colorCss$1 as h, i, tokensCss$2 as j, styleCss$3 as k, colorCss$2 as l, makeElementsArray as m, styleCss$1 as n, tokensCss as o, colorCss as p, styleCss as q, styleCss$2 as s, tokensCss$1 as t, x };
3
+ AuroSlideshow.register();