@20minutes/hela 2.7.5 → 2.8.1
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/dist/index.es.js +2767 -2646
- package/dist/index.umd.js +2 -2
- package/dist/js/scripts.es.js +412 -345
- package/dist/js/scripts.umd.js +3 -3
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/scss/abstracts/variables/_variables.scss +1 -1
- package/dist/src/assets/scripts/timeline.d.ts +1 -0
- package/dist/src/components/atoms/Icon/Icon.d.ts +0 -1
- package/dist/src/components/molecules/Carousel/Carousel.d.ts +3 -1
- package/dist/src/components/molecules/Carousel/Carousel.stories.d.ts +2 -0
- package/dist/src/components/molecules/SearchBanner/SearchBanner.stories.d.ts +1 -0
- package/dist/src/components/molecules/SearchForm/SearchForm.d.ts +1 -0
- package/dist/src/components/molecules/SocialBar/SocialBar.stories.d.ts +1 -0
- package/dist/src/components/molecules/Timeline/Timeline.d.ts +11 -0
- package/dist/src/components/molecules/Timeline/Timeline.stories.d.ts +22 -0
- package/dist/src/components/molecules/Timeline/index.d.ts +1 -0
- package/dist/src/components/molecules/index.d.ts +1 -0
- package/dist/src/constants/tokenVariables.d.ts +3 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/js/scripts.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var T = (s, t, e) =>
|
|
4
|
-
const
|
|
1
|
+
var Pt = Object.defineProperty;
|
|
2
|
+
var At = (s, t, e) => t in s ? Pt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var T = (s, t, e) => At(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const xt = () => /Android/i.test(navigator.userAgent), It = typeof window < "u" && navigator.userAgent.toLowerCase().includes("firefox"), Ct = () => {
|
|
5
5
|
const s = document.getElementById("js-download-band");
|
|
6
|
-
s &&
|
|
6
|
+
s && xt() && s.setAttribute(
|
|
7
7
|
"href",
|
|
8
8
|
"https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome"
|
|
9
9
|
);
|
|
10
|
-
},
|
|
10
|
+
}, Tt = () => {
|
|
11
11
|
const s = document.querySelector("#js-election-selector");
|
|
12
12
|
s && s.addEventListener("change", (t) => {
|
|
13
13
|
window.location.replace(t.target.value);
|
|
14
14
|
});
|
|
15
|
-
},
|
|
15
|
+
}, zt = () => {
|
|
16
16
|
const s = document.querySelector(".c-search-banner");
|
|
17
17
|
if (s) {
|
|
18
18
|
const t = document.querySelector("#js-search-banner-to-hide"), e = s.querySelector("#js-search-banner-dropdown-btn");
|
|
@@ -28,7 +28,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, Ot = [
|
|
32
32
|
{
|
|
33
33
|
text: "Paris",
|
|
34
34
|
_index: "town_1717424751904",
|
|
@@ -59,21 +59,21 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
59
59
|
url: "/elections/resultats/paris/paris-75011"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
],
|
|
62
|
+
], Dt = (s, t, e, i, n, o) => {
|
|
63
63
|
const r = document.getElementById(s);
|
|
64
64
|
if (!r)
|
|
65
65
|
return;
|
|
66
66
|
const a = r.dataset.storybook, l = r.querySelector(`#${s}-search`), h = l == null ? void 0 : l.getAttribute("data-api-url"), c = r.querySelector(".c-autocomplete__menu");
|
|
67
67
|
if (!l || !c || !h)
|
|
68
68
|
return;
|
|
69
|
-
const d = r.querySelector(".c-autocomplete__input-spinner"),
|
|
69
|
+
const d = r.querySelector(".c-autocomplete__input-spinner"), p = l.getAttribute("data-trigger-message"), g = async (L) => {
|
|
70
70
|
try {
|
|
71
71
|
let y;
|
|
72
|
-
return a && t.includes("20minutes.fr") ? y =
|
|
72
|
+
return a && t.includes("20minutes.fr") ? y = Ot : y = await (await fetch(`${h}${e}${encodeURIComponent(L)}`)).json(), o ? y[o] : y;
|
|
73
73
|
} catch (y) {
|
|
74
74
|
return console.error("Error fetching autocomplete results:", y), [];
|
|
75
75
|
}
|
|
76
|
-
},
|
|
76
|
+
}, u = (L, y) => {
|
|
77
77
|
const A = document.createElement("li");
|
|
78
78
|
A.id = `/${L}`, A.textContent = y, A.addEventListener("click", () => {
|
|
79
79
|
l instanceof HTMLInputElement && (l.value = y, c.classList.add("u-hidden"));
|
|
@@ -82,12 +82,12 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
82
82
|
d == null || d.classList.toggle("u-hidden");
|
|
83
83
|
}, v = () => {
|
|
84
84
|
const L = document.createElement("li");
|
|
85
|
-
L.textContent =
|
|
85
|
+
L.textContent = p, c.appendChild(L);
|
|
86
86
|
}, E = async (L) => {
|
|
87
87
|
m(), c.classList.remove("u-hidden");
|
|
88
88
|
const y = await g(L);
|
|
89
89
|
c.innerHTML = "", y.length === 0 && c.classList.add("u-hidden"), y.forEach((A) => {
|
|
90
|
-
|
|
90
|
+
u(A[i], A[n]);
|
|
91
91
|
}), m();
|
|
92
92
|
}, P = (L) => {
|
|
93
93
|
if (!(L.target instanceof HTMLInputElement))
|
|
@@ -100,7 +100,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
100
100
|
}), l.addEventListener("focusin", () => {
|
|
101
101
|
c.childElementCount > 0 && c.classList.remove("u-hidden");
|
|
102
102
|
});
|
|
103
|
-
},
|
|
103
|
+
}, Mt = () => {
|
|
104
104
|
const s = document.querySelector("header"), t = document.querySelector(".js-limit-scroll-close-article-btn"), e = document.querySelector(".js-close-article-btn"), i = document.querySelector(".c-header-mobile"), n = i instanceof HTMLElement ? i.offsetHeight : 0;
|
|
105
105
|
if (s && t && e) {
|
|
106
106
|
const o = new IntersectionObserver(
|
|
@@ -113,7 +113,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
113
113
|
);
|
|
114
114
|
o.observe(s), o.observe(t);
|
|
115
115
|
}
|
|
116
|
-
},
|
|
116
|
+
}, $t = (s) => {
|
|
117
117
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
118
118
|
const t = s.currentTarget;
|
|
119
119
|
if (t instanceof HTMLButtonElement) {
|
|
@@ -122,15 +122,15 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
122
122
|
);
|
|
123
123
|
t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), i == null || i.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), i == null || i.setAttribute("aria-hidden", "false"));
|
|
124
124
|
}
|
|
125
|
-
},
|
|
125
|
+
}, Zt = (s = document.querySelector(
|
|
126
126
|
".js-collapse__button"
|
|
127
127
|
)) => {
|
|
128
128
|
s && document.querySelectorAll(".c-collapse__button").forEach((e) => {
|
|
129
129
|
e.addEventListener("click", (i) => {
|
|
130
|
-
|
|
130
|
+
$t(i);
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
-
},
|
|
133
|
+
}, Rt = (s, t) => {
|
|
134
134
|
const e = document.querySelector(
|
|
135
135
|
`#${t}`
|
|
136
136
|
);
|
|
@@ -146,17 +146,17 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
146
146
|
if (d <= 0)
|
|
147
147
|
clearInterval(h);
|
|
148
148
|
else {
|
|
149
|
-
const
|
|
150
|
-
i.innerHTML =
|
|
149
|
+
const p = Math.floor(d / 864e5), g = Math.floor(d % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), u = Math.floor(d % (1e3 * 60 * 60) / (1e3 * 60)), m = Math.floor(d % (1e3 * 60) / 1e3);
|
|
150
|
+
i.innerHTML = p.toString(), n.innerHTML = g.toString(), o.innerHTML = u.toString(), r.innerHTML = m.toString();
|
|
151
151
|
}
|
|
152
152
|
}, 1e3);
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, Ft = (s) => {
|
|
155
155
|
const t = s.getBBox(), e = t.width / 20;
|
|
156
156
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
157
157
|
" "
|
|
158
158
|
);
|
|
159
|
-
},
|
|
159
|
+
}, kt = () => {
|
|
160
160
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
161
161
|
if (!s || !t)
|
|
162
162
|
return;
|
|
@@ -168,39 +168,39 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
168
168
|
".c-map-districts-container__unzoom-button"
|
|
169
169
|
);
|
|
170
170
|
let o = t;
|
|
171
|
-
const r = t.getAttribute("viewBox"), a = (
|
|
171
|
+
const r = t.getAttribute("viewBox"), a = (u, m) => {
|
|
172
172
|
var v;
|
|
173
|
-
return (v =
|
|
174
|
-
}, l = (
|
|
175
|
-
if (!
|
|
173
|
+
return (v = u.matches) == null ? void 0 : v.call(u, m);
|
|
174
|
+
}, l = (u, m, v = ".c-map-districts__zoomable:not(.js-selected-area)") => {
|
|
175
|
+
if (!u)
|
|
176
176
|
return;
|
|
177
|
-
let E, P =
|
|
177
|
+
let E, P = u.parentElement;
|
|
178
178
|
for (; P instanceof SVGGraphicsElement && P !== m; )
|
|
179
179
|
a(P, v) && (E = P), P = P.parentElement;
|
|
180
180
|
return E;
|
|
181
|
-
}, h = (
|
|
182
|
-
if (!
|
|
181
|
+
}, h = (u, m, v) => {
|
|
182
|
+
if (!u)
|
|
183
183
|
return;
|
|
184
|
-
let E =
|
|
184
|
+
let E = u.parentElement;
|
|
185
185
|
for (; E instanceof SVGGraphicsElement && E !== v; ) {
|
|
186
186
|
if (m === E)
|
|
187
187
|
return !0;
|
|
188
188
|
E = E.parentElement;
|
|
189
189
|
}
|
|
190
190
|
return v === m;
|
|
191
|
-
}, c = (
|
|
191
|
+
}, c = (u, m) => {
|
|
192
192
|
if (m && n && e) {
|
|
193
|
-
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i == null || i.classList.add("u-hidden"), n.classList.add("u-hidden"), m !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o =
|
|
193
|
+
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i == null || i.classList.add("u-hidden"), n.classList.add("u-hidden"), m !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o = u;
|
|
194
194
|
const v = o.getAttribute("data-info");
|
|
195
195
|
i && v && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = v), o.classList.add("js-selected-area"), t.setAttribute("viewBox", m);
|
|
196
196
|
}
|
|
197
|
-
}, d = (
|
|
198
|
-
|
|
199
|
-
const m =
|
|
197
|
+
}, d = (u) => {
|
|
198
|
+
u.stopPropagation();
|
|
199
|
+
const m = u.currentTarget;
|
|
200
200
|
if (o && t && m instanceof SVGGraphicsElement) {
|
|
201
201
|
if (m === o)
|
|
202
202
|
return;
|
|
203
|
-
if (
|
|
203
|
+
if (u.preventDefault(), o !== t && !h(m, o, t)) {
|
|
204
204
|
c(t, r);
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
@@ -210,16 +210,16 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
210
210
|
);
|
|
211
211
|
c(
|
|
212
212
|
v || m,
|
|
213
|
-
|
|
213
|
+
Ft(v || m)
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, p = () => {
|
|
217
217
|
t && o !== t && c(t, r);
|
|
218
218
|
};
|
|
219
|
-
t.addEventListener("click",
|
|
220
|
-
|
|
219
|
+
t.addEventListener("click", p), n && n.addEventListener("click", p), document.querySelectorAll(".c-map-districts__zoomable").forEach((u) => {
|
|
220
|
+
u.addEventListener("click", (m) => d(m));
|
|
221
221
|
});
|
|
222
|
-
},
|
|
222
|
+
}, qt = () => {
|
|
223
223
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
224
224
|
if (!s || !t)
|
|
225
225
|
return;
|
|
@@ -248,57 +248,57 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
248
248
|
}), s.addEventListener("focusin", () => {
|
|
249
249
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
250
250
|
});
|
|
251
|
-
},
|
|
251
|
+
}, Nt = (s, t) => {
|
|
252
252
|
var n;
|
|
253
253
|
s.setAttribute("aria-expanded", "true");
|
|
254
254
|
const e = (n = s.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
|
|
255
255
|
e == null || e.forEach((o) => o.classList.remove(t));
|
|
256
256
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
257
257
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
258
|
-
},
|
|
258
|
+
}, Bt = (s, t) => {
|
|
259
259
|
var n;
|
|
260
260
|
const e = (n = s.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
|
|
261
261
|
e == null || e.forEach((o) => o.classList.add(t)), s.setAttribute("aria-expanded", "false");
|
|
262
262
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
263
263
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir plus");
|
|
264
|
-
},
|
|
264
|
+
}, Ht = (s, t) => {
|
|
265
265
|
const e = s.currentTarget;
|
|
266
266
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
267
267
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
268
|
-
return e.getAttribute("aria-expanded") === "true" ?
|
|
268
|
+
return e.getAttribute("aria-expanded") === "true" ? Bt(e, i) : Nt(e, i);
|
|
269
269
|
}
|
|
270
270
|
return null;
|
|
271
|
-
},
|
|
271
|
+
}, Wt = (s = document.querySelector(
|
|
272
272
|
".js-ellipsis-button"
|
|
273
273
|
)) => {
|
|
274
274
|
s && document.querySelectorAll(".js-ellipsis-button").forEach((e) => {
|
|
275
275
|
const i = e.getAttribute("data-multiple") === "true";
|
|
276
|
-
e.addEventListener("click", (n) =>
|
|
276
|
+
e.addEventListener("click", (n) => Ht(n, i));
|
|
277
277
|
});
|
|
278
|
-
},
|
|
278
|
+
}, Vt = (s) => {
|
|
279
279
|
var i;
|
|
280
280
|
s.setAttribute("aria-expanded", "true");
|
|
281
281
|
const t = (i = s.parentNode) == null ? void 0 : i.querySelectorAll(".js-expand-target");
|
|
282
282
|
t == null || t.forEach((n) => n.setAttribute("aria-hidden", "false"));
|
|
283
283
|
const e = s.querySelector(".js-expand-button__label");
|
|
284
284
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir moins");
|
|
285
|
-
},
|
|
285
|
+
}, jt = (s) => {
|
|
286
286
|
var i;
|
|
287
287
|
const t = (i = s.parentNode) == null ? void 0 : i.querySelectorAll(".js-expand-target");
|
|
288
288
|
t == null || t.forEach((n) => n.setAttribute("aria-hidden", "true")), s.setAttribute("aria-expanded", "false");
|
|
289
289
|
const e = s.querySelector(".js-expand-button__label");
|
|
290
290
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir plus");
|
|
291
|
-
},
|
|
291
|
+
}, Gt = (s) => {
|
|
292
292
|
const t = s.currentTarget;
|
|
293
|
-
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ?
|
|
294
|
-
},
|
|
293
|
+
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? jt(t) : Vt(t) : null;
|
|
294
|
+
}, Ut = (s = document.querySelector(
|
|
295
295
|
".js-expand-button"
|
|
296
296
|
)) => {
|
|
297
|
-
s && document.querySelectorAll(".js-expand-button").forEach((e) => e.addEventListener("click",
|
|
298
|
-
},
|
|
297
|
+
s && document.querySelectorAll(".js-expand-button").forEach((e) => e.addEventListener("click", Gt));
|
|
298
|
+
}, Kt = () => {
|
|
299
299
|
const s = document.querySelector(".js-game-alert");
|
|
300
|
-
|
|
301
|
-
},
|
|
300
|
+
It && s && s.classList.remove("u-hidden");
|
|
301
|
+
}, Xt = () => {
|
|
302
302
|
const s = document.querySelectorAll(".js-half-donut-result");
|
|
303
303
|
for (const t of Array.from(s)) {
|
|
304
304
|
const e = t.querySelector(".c-half-donut"), i = t.querySelector(".c-legend");
|
|
@@ -317,7 +317,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
317
317
|
});
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
},
|
|
320
|
+
}, Yt = () => {
|
|
321
321
|
const s = document.querySelector(".c-image-slider__container");
|
|
322
322
|
if (!s)
|
|
323
323
|
return;
|
|
@@ -351,7 +351,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
351
351
|
negTabIndex: ':not([tabindex^="-"])',
|
|
352
352
|
disabled: ":not(:disabled)"
|
|
353
353
|
};
|
|
354
|
-
var
|
|
354
|
+
var Qt = [
|
|
355
355
|
`a[href]${f.inert}${f.negTabIndex}`,
|
|
356
356
|
`area[href]${f.inert}${f.negTabIndex}`,
|
|
357
357
|
`input:not([type="hidden"]):not([type="radio"])${f.inert}${f.negTabIndex}${f.disabled}`,
|
|
@@ -369,24 +369,24 @@ var Xt = [
|
|
|
369
369
|
`[contenteditable]${f.inert}${f.negTabIndex}`,
|
|
370
370
|
`[tabindex]${f.inert}${f.negTabIndex}`
|
|
371
371
|
];
|
|
372
|
-
function
|
|
372
|
+
function X(s) {
|
|
373
373
|
(s.querySelector("[autofocus]") || s).focus();
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
const t =
|
|
375
|
+
function Jt(s) {
|
|
376
|
+
const t = Z(s, !0), e = t ? Z(s, !1) || t : null;
|
|
377
377
|
return [t, e];
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
if (t &&
|
|
379
|
+
function Z(s, t) {
|
|
380
|
+
if (t && J(s))
|
|
381
381
|
return s;
|
|
382
|
-
if (
|
|
382
|
+
if (ee(s))
|
|
383
383
|
if (s.shadowRoot) {
|
|
384
|
-
let e =
|
|
384
|
+
let e = Y(s.shadowRoot, t);
|
|
385
385
|
for (; e; ) {
|
|
386
|
-
const i =
|
|
386
|
+
const i = Z(e, t);
|
|
387
387
|
if (i)
|
|
388
388
|
return i;
|
|
389
|
-
e =
|
|
389
|
+
e = Q(e, t);
|
|
390
390
|
}
|
|
391
391
|
} else if (s.localName === "slot") {
|
|
392
392
|
const e = s.assignedElements({
|
|
@@ -394,56 +394,56 @@ function $(s, t) {
|
|
|
394
394
|
});
|
|
395
395
|
t || e.reverse();
|
|
396
396
|
for (const i of e) {
|
|
397
|
-
const n =
|
|
397
|
+
const n = Z(i, t);
|
|
398
398
|
if (n)
|
|
399
399
|
return n;
|
|
400
400
|
}
|
|
401
401
|
} else {
|
|
402
|
-
let e =
|
|
402
|
+
let e = Y(s, t);
|
|
403
403
|
for (; e; ) {
|
|
404
|
-
const i =
|
|
404
|
+
const i = Z(e, t);
|
|
405
405
|
if (i)
|
|
406
406
|
return i;
|
|
407
|
-
e =
|
|
407
|
+
e = Q(e, t);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
return !t &&
|
|
410
|
+
return !t && J(s) ? s : null;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Y(s, t) {
|
|
413
413
|
return t ? s.firstElementChild : s.lastElementChild;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Q(s, t) {
|
|
416
416
|
return t ? s.nextElementSibling : s.previousElementSibling;
|
|
417
417
|
}
|
|
418
|
-
const
|
|
418
|
+
const te = (s) => s.matches("details:not([open]) *") && !s.matches("details>summary:first-of-type") ? !0 : !(s.offsetWidth || s.offsetHeight || s.getClientRects().length), J = (s) => {
|
|
419
419
|
var t;
|
|
420
|
-
return (t = s.shadowRoot) != null && t.delegatesFocus ? !1 : s.matches(
|
|
420
|
+
return (t = s.shadowRoot) != null && t.delegatesFocus ? !1 : s.matches(Qt.join(",")) && !te(s);
|
|
421
421
|
};
|
|
422
|
-
function
|
|
422
|
+
function ee(s) {
|
|
423
423
|
return s.shadowRoot && s.getAttribute("tabindex") === "-1" ? !1 : !s.matches(":disabled,[hidden],[inert]");
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function R(s = document) {
|
|
426
426
|
const t = s.activeElement;
|
|
427
|
-
return t ? t.shadowRoot ?
|
|
427
|
+
return t ? t.shadowRoot ? R(t.shadowRoot) || document.activeElement : t : null;
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
const [e, i] =
|
|
429
|
+
function ie(s, t) {
|
|
430
|
+
const [e, i] = Jt(s);
|
|
431
431
|
if (!e)
|
|
432
432
|
return t.preventDefault();
|
|
433
|
-
const n =
|
|
433
|
+
const n = R();
|
|
434
434
|
t.shiftKey && n === e ? (i.focus(), t.preventDefault()) : !t.shiftKey && n === i && (e.focus(), t.preventDefault());
|
|
435
435
|
}
|
|
436
436
|
function C(s, t) {
|
|
437
437
|
function e(i) {
|
|
438
438
|
if (!i || i === document || i === window)
|
|
439
439
|
return null;
|
|
440
|
-
const n =
|
|
440
|
+
const n = ut(i);
|
|
441
441
|
return n && (i = n), i.closest(s) || e(i.getRootNode().host);
|
|
442
442
|
}
|
|
443
443
|
return e(t);
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
return s.assignedSlot || (s.parentNode ?
|
|
445
|
+
function ut(s) {
|
|
446
|
+
return s.assignedSlot || (s.parentNode ? ut(s.parentNode) : null);
|
|
447
447
|
}
|
|
448
448
|
const z = "data-a11y-dialog";
|
|
449
449
|
class pt {
|
|
@@ -467,7 +467,7 @@ class pt {
|
|
|
467
467
|
*/
|
|
468
468
|
show(t) {
|
|
469
469
|
var i;
|
|
470
|
-
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused =
|
|
470
|
+
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = R(), ((i = this.previouslyFocused) == null ? void 0 : i.tagName) === "BODY" && (t != null && t.target) && (this.previouslyFocused = t.target), (t == null ? void 0 : t.type) === "focus" ? this.maintainFocus() : X(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this);
|
|
471
471
|
}
|
|
472
472
|
/**
|
|
473
473
|
* Hide the dialog element, restore the focus to the previously active
|
|
@@ -515,14 +515,14 @@ class pt {
|
|
|
515
515
|
* (namely ESC and TAB)
|
|
516
516
|
*/
|
|
517
517
|
bindKeypress(t) {
|
|
518
|
-
if (C('[aria-modal="true"]',
|
|
518
|
+
if (C('[aria-modal="true"]', R()) !== this.$el)
|
|
519
519
|
return;
|
|
520
520
|
let e = !1;
|
|
521
521
|
try {
|
|
522
522
|
e = !!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open');
|
|
523
523
|
} catch {
|
|
524
524
|
}
|
|
525
|
-
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" &&
|
|
525
|
+
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" && ie(this.$el, t);
|
|
526
526
|
}
|
|
527
527
|
/**
|
|
528
528
|
* If the dialog is shown and the focus is not within a dialog element (either
|
|
@@ -531,16 +531,16 @@ class pt {
|
|
|
531
531
|
* See: https://github.com/KittyGiraudel/a11y-dialog/issues/177
|
|
532
532
|
*/
|
|
533
533
|
maintainFocus() {
|
|
534
|
-
const t =
|
|
535
|
-
C(`[aria-modal="true"], [${z}-ignore-focus-trap]`, t) ||
|
|
534
|
+
const t = R();
|
|
535
|
+
C(`[aria-modal="true"], [${z}-ignore-focus-trap]`, t) || X(this.$el);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function tt() {
|
|
539
539
|
for (const s of document.querySelectorAll("[data-a11y-dialog]"))
|
|
540
540
|
new pt(s);
|
|
541
541
|
}
|
|
542
|
-
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
543
|
-
const
|
|
542
|
+
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", tt) : tt());
|
|
543
|
+
const se = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
544
544
|
if (!(s instanceof HTMLElement))
|
|
545
545
|
return;
|
|
546
546
|
const t = new pt(s);
|
|
@@ -557,11 +557,11 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
557
557
|
}).on("hide", () => {
|
|
558
558
|
document.body.classList.remove("noscroll");
|
|
559
559
|
});
|
|
560
|
-
}),
|
|
561
|
-
var o, r, a, l, h, c, d,
|
|
560
|
+
}), ne = ({ navigatedList: s, nextBtn: t, prevBtn: e }) => {
|
|
561
|
+
var o, r, a, l, h, c, d, p;
|
|
562
562
|
const i = s.scrollLeft > 0, n = s.scrollLeft + s.clientWidth < s.scrollWidth;
|
|
563
|
-
i && n ? ((o = t.classList) == null || o.add("o-nav-button--visible"), (r = e.classList) == null || r.add("o-nav-button--visible")) : i ? ((a = t.classList) == null || a.remove("o-nav-button--visible"), (l = e.classList) == null || l.add("o-nav-button--visible")) : n ? ((h = t.classList) == null || h.add("o-nav-button--visible"), (c = e.classList) == null || c.remove("o-nav-button--visible")) : ((d = t.classList) == null || d.remove("o-nav-button--visible"), (
|
|
564
|
-
},
|
|
563
|
+
i && n ? ((o = t.classList) == null || o.add("o-nav-button--visible"), (r = e.classList) == null || r.add("o-nav-button--visible")) : i ? ((a = t.classList) == null || a.remove("o-nav-button--visible"), (l = e.classList) == null || l.add("o-nav-button--visible")) : n ? ((h = t.classList) == null || h.add("o-nav-button--visible"), (c = e.classList) == null || c.remove("o-nav-button--visible")) : ((d = t.classList) == null || d.remove("o-nav-button--visible"), (p = e.classList) == null || p.remove("o-nav-button--visible"));
|
|
564
|
+
}, oe = ({
|
|
565
565
|
navigatedList: s,
|
|
566
566
|
nextBtn: t,
|
|
567
567
|
prevBtn: e,
|
|
@@ -606,7 +606,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
606
606
|
}), t.classList.remove("o-nav-button--visible"), e.classList.add("o-nav-button--visible");
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
},
|
|
609
|
+
}, re = ({
|
|
610
610
|
navigatedList: s,
|
|
611
611
|
nextBtn: t,
|
|
612
612
|
prevBtn: e,
|
|
@@ -647,13 +647,13 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
647
647
|
behavior: "smooth"
|
|
648
648
|
}), e.classList.remove("o-nav-button--visible"), s.clientWidth < s.scrollWidth && t.classList.add("o-nav-button--visible");
|
|
649
649
|
}
|
|
650
|
-
},
|
|
651
|
-
|
|
650
|
+
}, ae = ({ navigatedList: s, nextBtn: t, prevBtn: e }) => {
|
|
651
|
+
ne({
|
|
652
652
|
navigatedList: s,
|
|
653
653
|
nextBtn: t,
|
|
654
654
|
prevBtn: e
|
|
655
655
|
});
|
|
656
|
-
},
|
|
656
|
+
}, le = () => {
|
|
657
657
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
658
658
|
for (const t of Array.from(s)) {
|
|
659
659
|
const { sliderVariant: e } = t.dataset, { sliderAuto: i } = t.dataset, { sliderDelay: n } = t.dataset, o = n ? parseInt(n, 10) : 3e3, r = t.closest(".js-overview-bar-container"), a = r == null ? void 0 : r.querySelector(".c-stepper"), l = a == null ? void 0 : a.querySelectorAll(".c-stepper__item");
|
|
@@ -667,7 +667,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
667
667
|
);
|
|
668
668
|
if (h && h.clientWidth < h.scrollWidth && (c == null || c.classList.add("o-nav-button--visible")), h && c && d && (c == null || c.addEventListener(
|
|
669
669
|
"click",
|
|
670
|
-
|
|
670
|
+
oe.bind(!1, {
|
|
671
671
|
navigatedList: h,
|
|
672
672
|
nextBtn: c,
|
|
673
673
|
prevBtn: d,
|
|
@@ -675,7 +675,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
675
675
|
})
|
|
676
676
|
), d == null || d.addEventListener(
|
|
677
677
|
"click",
|
|
678
|
-
|
|
678
|
+
re.bind(!1, {
|
|
679
679
|
navigatedList: h,
|
|
680
680
|
nextBtn: c,
|
|
681
681
|
prevBtn: d,
|
|
@@ -683,15 +683,15 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
683
683
|
delay: o
|
|
684
684
|
})
|
|
685
685
|
)), i === "true" && c) {
|
|
686
|
-
const
|
|
686
|
+
const p = a ? a.querySelector(".c-stepper__item--loading") : null;
|
|
687
687
|
l && (l.forEach((g) => {
|
|
688
|
-
const
|
|
689
|
-
|
|
690
|
-
}),
|
|
688
|
+
const u = g.querySelector(".c-stepper__loader");
|
|
689
|
+
u && u instanceof HTMLElement && (u.style.transition = `width ${o / 1e3}s linear`);
|
|
690
|
+
}), p || l[0].classList.add("c-stepper__item--loading")), setInterval(() => {
|
|
691
691
|
c.classList.contains("o-nav-button--visible") ? c.click() : h && d && (h.scrollLeft = 0, l && (l.forEach((g) => {
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
|
|
692
|
+
const u = g.querySelector(".c-stepper__loader");
|
|
693
|
+
u && u instanceof HTMLElement && (u.style.transition = "width 0s linear"), g.classList.remove("c-stepper__item--loading"), g.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
|
|
694
|
+
u && u instanceof HTMLElement && (u.style.transition = `width ${o / 1e3}s linear`);
|
|
695
695
|
}, 0);
|
|
696
696
|
}), setTimeout(() => {
|
|
697
697
|
l[0].classList.add("c-stepper__item--loading");
|
|
@@ -700,7 +700,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
},
|
|
703
|
+
}, he = () => {
|
|
704
704
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
705
705
|
for (const t of Array.from(s))
|
|
706
706
|
if (t) {
|
|
@@ -713,7 +713,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
713
713
|
);
|
|
714
714
|
e && i && n && window.addEventListener(
|
|
715
715
|
"resize",
|
|
716
|
-
|
|
716
|
+
ae.bind(!1, {
|
|
717
717
|
navigatedList: e,
|
|
718
718
|
nextBtn: i,
|
|
719
719
|
prevBtn: n
|
|
@@ -732,14 +732,14 @@ function w(s, t, e) {
|
|
|
732
732
|
function _(s, t) {
|
|
733
733
|
return s.x = t.x, s.y = t.y, t.id !== void 0 && (s.id = t.id), s;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function mt(s) {
|
|
736
736
|
s.x = Math.round(s.x), s.y = Math.round(s.y);
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function V(s, t) {
|
|
739
739
|
const e = Math.abs(s.x - t.x), i = Math.abs(s.y - t.y);
|
|
740
740
|
return Math.sqrt(e * e + i * i);
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function F(s, t) {
|
|
743
743
|
return s.x === t.x && s.y === t.y;
|
|
744
744
|
}
|
|
745
745
|
function q(s, t, e) {
|
|
@@ -752,17 +752,17 @@ function k(s, t, e) {
|
|
|
752
752
|
function I(s, t, e, i) {
|
|
753
753
|
s.style.transform = k(t, e, i);
|
|
754
754
|
}
|
|
755
|
-
const
|
|
756
|
-
function
|
|
757
|
-
s.style.transition = t ? `${t} ${e}ms ${i ||
|
|
755
|
+
const ce = "cubic-bezier(.4,0,.22,1)";
|
|
756
|
+
function ft(s, t, e, i) {
|
|
757
|
+
s.style.transition = t ? `${t} ${e}ms ${i || ce}` : "none";
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function j(s, t, e) {
|
|
760
760
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
|
|
762
|
+
function de(s) {
|
|
763
|
+
ft(s);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function ue(s) {
|
|
766
766
|
return "decode" in s ? s.decode().catch(() => {
|
|
767
767
|
}) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
|
|
768
768
|
s.onload = () => t(s), s.onerror = e;
|
|
@@ -774,10 +774,10 @@ const S = {
|
|
|
774
774
|
LOADED: "loaded",
|
|
775
775
|
ERROR: "error"
|
|
776
776
|
};
|
|
777
|
-
function
|
|
777
|
+
function pe(s) {
|
|
778
778
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function me(s, t, e = document) {
|
|
781
781
|
let i = [];
|
|
782
782
|
if (s instanceof Element)
|
|
783
783
|
i = [s];
|
|
@@ -789,19 +789,19 @@ function pe(s, t, e = document) {
|
|
|
789
789
|
}
|
|
790
790
|
return i;
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function et() {
|
|
793
793
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
794
794
|
}
|
|
795
|
-
let
|
|
795
|
+
let gt = !1;
|
|
796
796
|
try {
|
|
797
797
|
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
798
798
|
get: () => {
|
|
799
|
-
|
|
799
|
+
gt = !0;
|
|
800
800
|
}
|
|
801
801
|
}));
|
|
802
802
|
} catch {
|
|
803
803
|
}
|
|
804
|
-
class
|
|
804
|
+
class fe {
|
|
805
805
|
constructor() {
|
|
806
806
|
this._pool = [];
|
|
807
807
|
}
|
|
@@ -858,7 +858,7 @@ class ue {
|
|
|
858
858
|
listener: i,
|
|
859
859
|
passive: n
|
|
860
860
|
}));
|
|
861
|
-
const c =
|
|
861
|
+
const c = gt ? {
|
|
862
862
|
passive: n || !1
|
|
863
863
|
} : !1;
|
|
864
864
|
t[a](h, i, c);
|
|
@@ -866,7 +866,7 @@ class ue {
|
|
|
866
866
|
});
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function _t(s, t) {
|
|
870
870
|
if (s.getViewportSizeFn) {
|
|
871
871
|
const e = s.getViewportSizeFn(s, t);
|
|
872
872
|
if (e)
|
|
@@ -893,13 +893,13 @@ function D(s, t, e, i, n) {
|
|
|
893
893
|
}
|
|
894
894
|
return Number(o) || 0;
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function vt(s, t, e, i) {
|
|
897
897
|
return {
|
|
898
898
|
x: t.x - D("left", s, t, e, i) - D("right", s, t, e, i),
|
|
899
899
|
y: t.y - D("top", s, t, e, i) - D("bottom", s, t, e, i)
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
|
-
class
|
|
902
|
+
class ge {
|
|
903
903
|
/**
|
|
904
904
|
* @param {Slide} slide
|
|
905
905
|
*/
|
|
@@ -954,8 +954,8 @@ class me {
|
|
|
954
954
|
return q(e, this.max[t], this.min[t]);
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
let
|
|
957
|
+
const it = 4e3;
|
|
958
|
+
let yt = class {
|
|
959
959
|
/**
|
|
960
960
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
961
961
|
* @param {SlideData} itemData Slide data
|
|
@@ -1012,7 +1012,7 @@ let vt = class {
|
|
|
1012
1012
|
*/
|
|
1013
1013
|
_getSecondary() {
|
|
1014
1014
|
let t = this._parseZoomLevelOption("secondary");
|
|
1015
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
1015
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > it && (t = it / this.elementSize.x), t);
|
|
1016
1016
|
}
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Get initial image zoom level.
|
|
@@ -1035,7 +1035,7 @@ let vt = class {
|
|
|
1035
1035
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1036
1036
|
}
|
|
1037
1037
|
};
|
|
1038
|
-
class
|
|
1038
|
+
class _e {
|
|
1039
1039
|
/**
|
|
1040
1040
|
* @param {SlideData} data
|
|
1041
1041
|
* @param {number} index
|
|
@@ -1048,11 +1048,11 @@ class fe {
|
|
|
1048
1048
|
}, this.pan = {
|
|
1049
1049
|
x: 0,
|
|
1050
1050
|
y: 0
|
|
1051
|
-
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new
|
|
1051
|
+
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new yt(i.options, t, e, i), this.pswp.dispatch("gettingData", {
|
|
1052
1052
|
slide: this,
|
|
1053
1053
|
data: this.data,
|
|
1054
1054
|
index: e
|
|
1055
|
-
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = w("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new
|
|
1055
|
+
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = w("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new ge(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1056
1056
|
slide: this
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
@@ -1176,7 +1176,7 @@ class fe {
|
|
|
1176
1176
|
transitionDuration: i
|
|
1177
1177
|
}), o.animations.stopAllPan();
|
|
1178
1178
|
const r = this.currZoomLevel;
|
|
1179
|
-
n || (t = q(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", e, r), this.pan.y = this.calculateZoomToPanOffset("y", e, r),
|
|
1179
|
+
n || (t = q(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", e, r), this.pan.y = this.calculateZoomToPanOffset("y", e, r), mt(this.pan);
|
|
1180
1180
|
const a = () => {
|
|
1181
1181
|
this._setResolution(t), this.applyCurrentZoomPan();
|
|
1182
1182
|
};
|
|
@@ -1277,7 +1277,7 @@ class fe {
|
|
|
1277
1277
|
const {
|
|
1278
1278
|
pswp: t
|
|
1279
1279
|
} = this;
|
|
1280
|
-
_(this.panAreaSize,
|
|
1280
|
+
_(this.panAreaSize, vt(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {
|
|
1281
1281
|
slide: this
|
|
1282
1282
|
});
|
|
1283
1283
|
}
|
|
@@ -1305,11 +1305,11 @@ class fe {
|
|
|
1305
1305
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
|
-
const
|
|
1309
|
-
function
|
|
1308
|
+
const ve = 0.35, ye = 0.6, we = 0.4, Se = 0.5;
|
|
1309
|
+
function be(s, t) {
|
|
1310
1310
|
return s * t / (1 - t);
|
|
1311
1311
|
}
|
|
1312
|
-
class
|
|
1312
|
+
class Le {
|
|
1313
1313
|
/**
|
|
1314
1314
|
* @param {Gestures} gestures
|
|
1315
1315
|
*/
|
|
@@ -1335,12 +1335,12 @@ class Se {
|
|
|
1335
1335
|
if (!this.pswp.dispatch("verticalDrag", {
|
|
1336
1336
|
panY: o
|
|
1337
1337
|
}).defaultPrevented) {
|
|
1338
|
-
this._setPanWithFriction("y", o,
|
|
1338
|
+
this._setPanWithFriction("y", o, ye);
|
|
1339
1339
|
const r = 1 - Math.abs(this._getVerticalDragRatio(n.pan.y));
|
|
1340
1340
|
this.pswp.applyBgOpacity(r), n.applyCurrentZoomPan();
|
|
1341
1341
|
}
|
|
1342
1342
|
} else
|
|
1343
|
-
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (
|
|
1343
|
+
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (mt(n.pan), n.applyCurrentZoomPan()));
|
|
1344
1344
|
}
|
|
1345
1345
|
end() {
|
|
1346
1346
|
const {
|
|
@@ -1352,7 +1352,7 @@ class Se {
|
|
|
1352
1352
|
let n = 0;
|
|
1353
1353
|
if (this.pswp.animations.stopAll(), e.isShifted()) {
|
|
1354
1354
|
const r = (e.x - e.getCurrSlideX()) / this.pswp.viewportSize.x;
|
|
1355
|
-
t.x < -0.5 && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x >
|
|
1355
|
+
t.x < -0.5 && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x > Se && r > 0 || t.x > -0.1 && r > 0.5) && (n = -1, t.x = Math.max(t.x, 0)), e.moveIndexBy(n, !0, t.x);
|
|
1356
1356
|
}
|
|
1357
1357
|
i && i.currZoomLevel > i.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this._finishPanGestureForAxis("x"), this._finishPanGestureForAxis("y"));
|
|
1358
1358
|
}
|
|
@@ -1371,10 +1371,10 @@ class Se {
|
|
|
1371
1371
|
const {
|
|
1372
1372
|
pan: n,
|
|
1373
1373
|
bounds: o
|
|
1374
|
-
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", h = r +
|
|
1374
|
+
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", h = r + be(e[t], 0.995);
|
|
1375
1375
|
if (a) {
|
|
1376
|
-
const
|
|
1377
|
-
if (
|
|
1376
|
+
const u = this._getVerticalDragRatio(r), m = this._getVerticalDragRatio(h);
|
|
1377
|
+
if (u < 0 && m < -0.4 || u > 0 && m > we) {
|
|
1378
1378
|
this.pswp.close();
|
|
1379
1379
|
return;
|
|
1380
1380
|
}
|
|
@@ -1382,7 +1382,7 @@ class Se {
|
|
|
1382
1382
|
const c = o.correctPan(t, h);
|
|
1383
1383
|
if (r === c)
|
|
1384
1384
|
return;
|
|
1385
|
-
const d = c === h ? 1 : 0.82,
|
|
1385
|
+
const d = c === h ? 1 : 0.82, p = this.pswp.bgOpacity, g = c - r;
|
|
1386
1386
|
this.pswp.animations.startSpring({
|
|
1387
1387
|
name: "panGesture" + t,
|
|
1388
1388
|
isPan: !0,
|
|
@@ -1390,12 +1390,12 @@ class Se {
|
|
|
1390
1390
|
end: c,
|
|
1391
1391
|
velocity: e[t],
|
|
1392
1392
|
dampingRatio: d,
|
|
1393
|
-
onUpdate: (
|
|
1393
|
+
onUpdate: (u) => {
|
|
1394
1394
|
if (a && this.pswp.bgOpacity < 1) {
|
|
1395
|
-
const m = 1 - (c -
|
|
1396
|
-
this.pswp.applyBgOpacity(q(
|
|
1395
|
+
const m = 1 - (c - u) / g;
|
|
1396
|
+
this.pswp.applyBgOpacity(q(p + (1 - p) * m, 0, 1));
|
|
1397
1397
|
}
|
|
1398
|
-
n[t] = Math.floor(
|
|
1398
|
+
n[t] = Math.floor(u), i.applyCurrentZoomPan();
|
|
1399
1399
|
}
|
|
1400
1400
|
});
|
|
1401
1401
|
}
|
|
@@ -1427,8 +1427,8 @@ class Se {
|
|
|
1427
1427
|
bounds: c
|
|
1428
1428
|
} = r, d = r.pan[t] + l;
|
|
1429
1429
|
if (this.pswp.options.allowPanToNext && i === "x" && t === "x" && !o) {
|
|
1430
|
-
const
|
|
1431
|
-
if (d > c.min[t] &&
|
|
1430
|
+
const p = a.getCurrSlideX(), g = a.x - p, u = l > 0, m = !u;
|
|
1431
|
+
if (d > c.min[t] && u) {
|
|
1432
1432
|
if (c.min[t] <= this.startPan[t])
|
|
1433
1433
|
return a.moveTo(h, !0), !0;
|
|
1434
1434
|
this._setPanWithFriction(t, d);
|
|
@@ -1438,9 +1438,9 @@ class Se {
|
|
|
1438
1438
|
this._setPanWithFriction(t, d);
|
|
1439
1439
|
} else if (g !== 0) {
|
|
1440
1440
|
if (g > 0)
|
|
1441
|
-
return a.moveTo(Math.max(h,
|
|
1441
|
+
return a.moveTo(Math.max(h, p), !0), !0;
|
|
1442
1442
|
if (g < 0)
|
|
1443
|
-
return a.moveTo(Math.min(h,
|
|
1443
|
+
return a.moveTo(Math.min(h, p), !0), !0;
|
|
1444
1444
|
} else
|
|
1445
1445
|
this._setPanWithFriction(t, d);
|
|
1446
1446
|
} else
|
|
@@ -1486,16 +1486,16 @@ class Se {
|
|
|
1486
1486
|
} = n;
|
|
1487
1487
|
if (r.correctPan(t, e) !== e || i) {
|
|
1488
1488
|
const l = Math.round(e - o[t]);
|
|
1489
|
-
o[t] += l * (i ||
|
|
1489
|
+
o[t] += l * (i || ve);
|
|
1490
1490
|
} else
|
|
1491
1491
|
o[t] = e;
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
|
-
const
|
|
1495
|
-
function
|
|
1494
|
+
const Ee = 0.05, Pe = 0.15;
|
|
1495
|
+
function st(s, t, e) {
|
|
1496
1496
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1497
1497
|
}
|
|
1498
|
-
class
|
|
1498
|
+
class Ae {
|
|
1499
1499
|
/**
|
|
1500
1500
|
* @param {Gestures} gestures
|
|
1501
1501
|
*/
|
|
@@ -1532,8 +1532,8 @@ class Ee {
|
|
|
1532
1532
|
const a = r.zoomLevels.min, l = r.zoomLevels.max;
|
|
1533
1533
|
if (!r.isZoomable() || o.mainScroll.isShifted())
|
|
1534
1534
|
return;
|
|
1535
|
-
|
|
1536
|
-
let h = 1 /
|
|
1535
|
+
st(this._startZoomPoint, e, n), st(this._zoomPoint, t, i);
|
|
1536
|
+
let h = 1 / V(e, n) * V(t, i) * this._startZoomLevel;
|
|
1537
1537
|
if (h > r.zoomLevels.initial + r.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), h < a)
|
|
1538
1538
|
if (o.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= r.zoomLevels.initial) {
|
|
1539
1539
|
const c = 1 - (a - h) / (a / 1.2);
|
|
@@ -1541,8 +1541,8 @@ class Ee {
|
|
|
1541
1541
|
bgOpacity: c
|
|
1542
1542
|
}).defaultPrevented || o.applyBgOpacity(c);
|
|
1543
1543
|
} else
|
|
1544
|
-
h = a - (a - h) *
|
|
1545
|
-
else h > l && (h = l + (h - l) *
|
|
1544
|
+
h = a - (a - h) * Pe;
|
|
1545
|
+
else h > l && (h = l + (h - l) * Ee);
|
|
1546
1546
|
r.pan.x = this._calculatePanForZoomLevel("x", h), r.pan.y = this._calculatePanForZoomLevel("y", h), r.setZoomLevel(h), r.applyCurrentZoomPan();
|
|
1547
1547
|
}
|
|
1548
1548
|
end() {
|
|
@@ -1598,7 +1598,7 @@ class Ee {
|
|
|
1598
1598
|
x: i.bounds.correctPan("x", c.x),
|
|
1599
1599
|
y: i.bounds.correctPan("y", c.y)
|
|
1600
1600
|
}, i.setZoomLevel(n);
|
|
1601
|
-
const d = !
|
|
1601
|
+
const d = !F(c, h);
|
|
1602
1602
|
if (!d && !r && !l) {
|
|
1603
1603
|
i._setResolution(o), i.applyCurrentZoomPan();
|
|
1604
1604
|
return;
|
|
@@ -1610,15 +1610,15 @@ class Ee {
|
|
|
1610
1610
|
velocity: 0,
|
|
1611
1611
|
dampingRatio: 1,
|
|
1612
1612
|
naturalFrequency: 40,
|
|
1613
|
-
onUpdate: (
|
|
1614
|
-
if (
|
|
1615
|
-
if (d && (i.pan.x = h.x + (c.x - h.x) *
|
|
1616
|
-
const g = n + (o - n) *
|
|
1613
|
+
onUpdate: (p) => {
|
|
1614
|
+
if (p /= 1e3, d || r) {
|
|
1615
|
+
if (d && (i.pan.x = h.x + (c.x - h.x) * p, i.pan.y = h.y + (c.y - h.y) * p), r) {
|
|
1616
|
+
const g = n + (o - n) * p;
|
|
1617
1617
|
i.setZoomLevel(g);
|
|
1618
1618
|
}
|
|
1619
1619
|
i.applyCurrentZoomPan();
|
|
1620
1620
|
}
|
|
1621
|
-
l && e.bgOpacity < 1 && e.applyBgOpacity(q(a + (1 - a) *
|
|
1621
|
+
l && e.bgOpacity < 1 && e.applyBgOpacity(q(a + (1 - a) * p, 0, 1));
|
|
1622
1622
|
},
|
|
1623
1623
|
onComplete: () => {
|
|
1624
1624
|
i._setResolution(o), i.applyCurrentZoomPan();
|
|
@@ -1626,11 +1626,11 @@ class Ee {
|
|
|
1626
1626
|
});
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1629
|
+
function nt(s) {
|
|
1630
1630
|
return !!/** @type {HTMLElement} */
|
|
1631
1631
|
s.target.closest(".pswp__container");
|
|
1632
1632
|
}
|
|
1633
|
-
class
|
|
1633
|
+
class xe {
|
|
1634
1634
|
/**
|
|
1635
1635
|
* @param {Gestures} gestures
|
|
1636
1636
|
*/
|
|
@@ -1653,14 +1653,14 @@ class Pe {
|
|
|
1653
1653
|
* @param {PointerEvent} originalEvent
|
|
1654
1654
|
*/
|
|
1655
1655
|
tap(t, e) {
|
|
1656
|
-
|
|
1656
|
+
nt(e) && this._doClickOrTapAction("tap", t, e);
|
|
1657
1657
|
}
|
|
1658
1658
|
/**
|
|
1659
1659
|
* @param {Point} point
|
|
1660
1660
|
* @param {PointerEvent} originalEvent
|
|
1661
1661
|
*/
|
|
1662
1662
|
doubleTap(t, e) {
|
|
1663
|
-
|
|
1663
|
+
nt(e) && this._doClickOrTapAction("doubleTap", t, e);
|
|
1664
1664
|
}
|
|
1665
1665
|
/**
|
|
1666
1666
|
* @private
|
|
@@ -1704,8 +1704,8 @@ class Pe {
|
|
|
1704
1704
|
}
|
|
1705
1705
|
}
|
|
1706
1706
|
}
|
|
1707
|
-
const
|
|
1708
|
-
class
|
|
1707
|
+
const Ie = 10, Ce = 300, Te = 25;
|
|
1708
|
+
class ze {
|
|
1709
1709
|
/**
|
|
1710
1710
|
* @param {PhotoSwipe} pswp
|
|
1711
1711
|
*/
|
|
@@ -1737,7 +1737,7 @@ class Ce {
|
|
|
1737
1737
|
}, this._intervalP1 = {
|
|
1738
1738
|
x: 0,
|
|
1739
1739
|
y: 0
|
|
1740
|
-
}, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new
|
|
1740
|
+
}, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new Le(this), this.zoomLevels = new Ae(this), this.tapHandler = new xe(this), t.on("bindEvents", () => {
|
|
1741
1741
|
t.events.add(
|
|
1742
1742
|
t.scrollWrap,
|
|
1743
1743
|
"click",
|
|
@@ -1827,7 +1827,7 @@ class Ce {
|
|
|
1827
1827
|
* @private
|
|
1828
1828
|
*/
|
|
1829
1829
|
_rafRenderLoop() {
|
|
1830
|
-
(this.isDragging || this.isZooming) && (this._updateVelocity(), this.isDragging ?
|
|
1830
|
+
(this.isDragging || this.isZooming) && (this._updateVelocity(), this.isDragging ? F(this.p1, this.prevP1) || this.drag.change() : (!F(this.p1, this.prevP1) || !F(this.p2, this.prevP2)) && this.zoomLevels.change(), this._updatePrevPoints(), this.raf = requestAnimationFrame(this._rafRenderLoop.bind(this)));
|
|
1831
1831
|
}
|
|
1832
1832
|
/**
|
|
1833
1833
|
* Update velocity at 50ms interval
|
|
@@ -1857,8 +1857,8 @@ class Ce {
|
|
|
1857
1857
|
this.tapHandler.click(this.startP1, t);
|
|
1858
1858
|
return;
|
|
1859
1859
|
}
|
|
1860
|
-
const i = this.pswp.options.doubleTapAction ?
|
|
1861
|
-
this._tapTimer ? (this._clearTapTimer(),
|
|
1860
|
+
const i = this.pswp.options.doubleTapAction ? Ce : 0;
|
|
1861
|
+
this._tapTimer ? (this._clearTapTimer(), V(this._lastStartP1, this.startP1) < Te && this.tapHandler.doubleTap(this.startP1, t)) : (_(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1862
1862
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1863
1863
|
}, i));
|
|
1864
1864
|
}
|
|
@@ -1944,7 +1944,7 @@ class Ce {
|
|
|
1944
1944
|
const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
|
|
1945
1945
|
if (t !== 0) {
|
|
1946
1946
|
const e = t > 0 ? "x" : "y";
|
|
1947
|
-
Math.abs(this.p1[e] - this.startP1[e]) >=
|
|
1947
|
+
Math.abs(this.p1[e] - this.startP1[e]) >= Ie && (this.dragAxis = e);
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
1950
|
}
|
|
@@ -1968,8 +1968,8 @@ class Ce {
|
|
|
1968
1968
|
this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
|
|
1969
1969
|
}
|
|
1970
1970
|
}
|
|
1971
|
-
const
|
|
1972
|
-
class
|
|
1971
|
+
const Oe = 0.35;
|
|
1972
|
+
class De {
|
|
1973
1973
|
/**
|
|
1974
1974
|
* @param {PhotoSwipe} pswp
|
|
1975
1975
|
*/
|
|
@@ -2122,7 +2122,7 @@ class ze {
|
|
|
2122
2122
|
let i = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
|
|
2123
2123
|
i += this.pswp.currIndex;
|
|
2124
2124
|
const n = Math.round(t - this.x);
|
|
2125
|
-
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n *
|
|
2125
|
+
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n * Oe);
|
|
2126
2126
|
}
|
|
2127
2127
|
this.x = t, this.pswp.container && I(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
|
|
2128
2128
|
x: t,
|
|
@@ -2130,7 +2130,7 @@ class ze {
|
|
|
2130
2130
|
});
|
|
2131
2131
|
}
|
|
2132
2132
|
}
|
|
2133
|
-
const
|
|
2133
|
+
const Me = {
|
|
2134
2134
|
Escape: 27,
|
|
2135
2135
|
z: 90,
|
|
2136
2136
|
ArrowLeft: 37,
|
|
@@ -2138,8 +2138,8 @@ const Oe = {
|
|
|
2138
2138
|
ArrowRight: 39,
|
|
2139
2139
|
ArrowDown: 40,
|
|
2140
2140
|
Tab: 9
|
|
2141
|
-
}, x = (s, t) => t ? s :
|
|
2142
|
-
class
|
|
2141
|
+
}, x = (s, t) => t ? s : Me[s];
|
|
2142
|
+
class $e {
|
|
2143
2143
|
/**
|
|
2144
2144
|
* @param {PhotoSwipe} pswp
|
|
2145
2145
|
*/
|
|
@@ -2179,7 +2179,7 @@ class De {
|
|
|
2179
2179
|
} = this;
|
|
2180
2180
|
if (e.dispatch("keydown", {
|
|
2181
2181
|
originalEvent: t
|
|
2182
|
-
}).defaultPrevented ||
|
|
2182
|
+
}).defaultPrevented || pe(t))
|
|
2183
2183
|
return;
|
|
2184
2184
|
let i, n, o = !1;
|
|
2185
2185
|
const r = "key" in t;
|
|
@@ -2231,8 +2231,8 @@ class De {
|
|
|
2231
2231
|
) && e.focus();
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
2234
|
-
const
|
|
2235
|
-
class
|
|
2234
|
+
const Ze = "cubic-bezier(.4,0,.22,1)";
|
|
2235
|
+
class Re {
|
|
2236
2236
|
/**
|
|
2237
2237
|
* onComplete can be unpredictable, be careful about current state
|
|
2238
2238
|
*
|
|
@@ -2248,12 +2248,12 @@ class Ze {
|
|
|
2248
2248
|
onFinish: r = () => {
|
|
2249
2249
|
},
|
|
2250
2250
|
duration: a = 333,
|
|
2251
|
-
easing: l =
|
|
2251
|
+
easing: l = Ze
|
|
2252
2252
|
} = t;
|
|
2253
2253
|
this.onFinish = r;
|
|
2254
2254
|
const h = o ? "transform" : "opacity", c = (e = t[h]) !== null && e !== void 0 ? e : "";
|
|
2255
2255
|
this._target = i, this._onComplete = n, this._finished = !1, this._onTransitionEnd = this._onTransitionEnd.bind(this), this._helperTimeout = setTimeout(() => {
|
|
2256
|
-
|
|
2256
|
+
ft(i, h, a, l), this._helperTimeout = setTimeout(() => {
|
|
2257
2257
|
i.addEventListener("transitionend", this._onTransitionEnd, !1), i.addEventListener("transitioncancel", this._onTransitionEnd, !1), this._helperTimeout = setTimeout(() => {
|
|
2258
2258
|
this._finalizeAnimation();
|
|
2259
2259
|
}, a + 500), i.style[h] = c;
|
|
@@ -2275,11 +2275,11 @@ class Ze {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
// Destroy is called automatically onFinish
|
|
2277
2277
|
destroy() {
|
|
2278
|
-
this._helperTimeout && clearTimeout(this._helperTimeout),
|
|
2278
|
+
this._helperTimeout && clearTimeout(this._helperTimeout), de(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2279
2279
|
}
|
|
2280
2280
|
}
|
|
2281
|
-
const
|
|
2282
|
-
class
|
|
2281
|
+
const Fe = 12, ke = 0.75;
|
|
2282
|
+
class qe {
|
|
2283
2283
|
/**
|
|
2284
2284
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2285
2285
|
*
|
|
@@ -2296,7 +2296,7 @@ class Re {
|
|
|
2296
2296
|
* Recommended value from 10 to 50
|
|
2297
2297
|
*/
|
|
2298
2298
|
constructor(t, e, i) {
|
|
2299
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2299
|
+
this.velocity = t * 1e3, this._dampingRatio = e || ke, this._naturalFrequency = i || Fe, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2300
2300
|
}
|
|
2301
2301
|
/**
|
|
2302
2302
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2318,7 +2318,7 @@ class Re {
|
|
|
2318
2318
|
return i;
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
|
-
class
|
|
2321
|
+
class Ne {
|
|
2322
2322
|
/**
|
|
2323
2323
|
* @param {SpringAnimationProps} props
|
|
2324
2324
|
*/
|
|
@@ -2336,10 +2336,10 @@ class ke {
|
|
|
2336
2336
|
naturalFrequency: h
|
|
2337
2337
|
} = t;
|
|
2338
2338
|
this.onFinish = a;
|
|
2339
|
-
const c = new
|
|
2340
|
-
let d = Date.now(),
|
|
2339
|
+
const c = new qe(n, l, h);
|
|
2340
|
+
let d = Date.now(), p = e - i;
|
|
2341
2341
|
const g = () => {
|
|
2342
|
-
this._raf && (
|
|
2342
|
+
this._raf && (p = c.easeFrame(p, Date.now() - d), Math.abs(p) < 1 && Math.abs(c.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (d = Date.now(), o(p + i), this._raf = requestAnimationFrame(g)));
|
|
2343
2343
|
};
|
|
2344
2344
|
this._raf = requestAnimationFrame(g);
|
|
2345
2345
|
}
|
|
@@ -2348,7 +2348,7 @@ class ke {
|
|
|
2348
2348
|
this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
|
|
2349
2349
|
}
|
|
2350
2350
|
}
|
|
2351
|
-
class
|
|
2351
|
+
class Be {
|
|
2352
2352
|
constructor() {
|
|
2353
2353
|
this.activeAnimations = [];
|
|
2354
2354
|
}
|
|
@@ -2371,10 +2371,10 @@ class qe {
|
|
|
2371
2371
|
* @returns {Animation}
|
|
2372
2372
|
*/
|
|
2373
2373
|
_start(t, e) {
|
|
2374
|
-
const i = e ? new
|
|
2374
|
+
const i = e ? new Ne(
|
|
2375
2375
|
/** @type SpringAnimationProps */
|
|
2376
2376
|
t
|
|
2377
|
-
) : new
|
|
2377
|
+
) : new Re(
|
|
2378
2378
|
/** @type CssAnimationProps */
|
|
2379
2379
|
t
|
|
2380
2380
|
);
|
|
@@ -2417,7 +2417,7 @@ class qe {
|
|
|
2417
2417
|
return this.activeAnimations.some((t) => t.props.isPan);
|
|
2418
2418
|
}
|
|
2419
2419
|
}
|
|
2420
|
-
class
|
|
2420
|
+
class He {
|
|
2421
2421
|
/**
|
|
2422
2422
|
* @param {PhotoSwipe} pswp
|
|
2423
2423
|
*/
|
|
@@ -2459,7 +2459,7 @@ class Ne {
|
|
|
2459
2459
|
e.isPannable() && (t.deltaMode === 1 && (i *= 18, n *= 18), e.panTo(e.pan.x - i, e.pan.y - n));
|
|
2460
2460
|
}
|
|
2461
2461
|
}
|
|
2462
|
-
function
|
|
2462
|
+
function We(s) {
|
|
2463
2463
|
if (typeof s == "string")
|
|
2464
2464
|
return s;
|
|
2465
2465
|
if (!s || !s.isCustomSVG)
|
|
@@ -2471,7 +2471,7 @@ function Be(s) {
|
|
|
2471
2471
|
t.size || 32
|
|
2472
2472
|
), t.outlineID && (e += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), e += t.inner, e += "</svg>", e;
|
|
2473
2473
|
}
|
|
2474
|
-
class
|
|
2474
|
+
class Ve {
|
|
2475
2475
|
/**
|
|
2476
2476
|
* @param {PhotoSwipe} pswp
|
|
2477
2477
|
* @param {UIElementData} data
|
|
@@ -2497,13 +2497,13 @@ class He {
|
|
|
2497
2497
|
title: d
|
|
2498
2498
|
} = e;
|
|
2499
2499
|
const {
|
|
2500
|
-
ariaLabel:
|
|
2500
|
+
ariaLabel: p
|
|
2501
2501
|
} = e;
|
|
2502
2502
|
typeof t.options[n + "Title"] == "string" && (d = t.options[n + "Title"]), d && (l.title = d);
|
|
2503
|
-
const g =
|
|
2503
|
+
const g = p || d;
|
|
2504
2504
|
g && l.setAttribute("aria-label", g);
|
|
2505
2505
|
}
|
|
2506
|
-
l.innerHTML =
|
|
2506
|
+
l.innerHTML = We(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (d) => {
|
|
2507
2507
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(d, l, t);
|
|
2508
2508
|
});
|
|
2509
2509
|
const h = e.appendTo || "bar";
|
|
@@ -2511,12 +2511,12 @@ class He {
|
|
|
2511
2511
|
h === "bar" ? (t.topBar || (t.topBar = w("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), c = t.topBar) : (l.classList.add("pswp__hide-on-close"), h === "wrapper" && (c = t.scrollWrap)), (i = c) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
|
|
2512
2512
|
}
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2514
|
+
function wt(s, t, e) {
|
|
2515
2515
|
s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
|
|
2516
2516
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2517
2517
|
});
|
|
2518
2518
|
}
|
|
2519
|
-
const
|
|
2519
|
+
const je = {
|
|
2520
2520
|
name: "arrowPrev",
|
|
2521
2521
|
className: "pswp__button--arrow--prev",
|
|
2522
2522
|
title: "Previous",
|
|
@@ -2530,8 +2530,8 @@ const We = {
|
|
|
2530
2530
|
outlineID: "pswp__icn-arrow"
|
|
2531
2531
|
},
|
|
2532
2532
|
onClick: "prev",
|
|
2533
|
-
onInit:
|
|
2534
|
-
},
|
|
2533
|
+
onInit: wt
|
|
2534
|
+
}, Ge = {
|
|
2535
2535
|
name: "arrowNext",
|
|
2536
2536
|
className: "pswp__button--arrow--next",
|
|
2537
2537
|
title: "Next",
|
|
@@ -2546,9 +2546,9 @@ const We = {
|
|
|
2546
2546
|
},
|
|
2547
2547
|
onClick: "next",
|
|
2548
2548
|
onInit: (s, t) => {
|
|
2549
|
-
|
|
2549
|
+
wt(s, t, !0);
|
|
2550
2550
|
}
|
|
2551
|
-
},
|
|
2551
|
+
}, Ue = {
|
|
2552
2552
|
name: "close",
|
|
2553
2553
|
title: "Close",
|
|
2554
2554
|
order: 20,
|
|
@@ -2559,7 +2559,7 @@ const We = {
|
|
|
2559
2559
|
outlineID: "pswp__icn-close"
|
|
2560
2560
|
},
|
|
2561
2561
|
onClick: "close"
|
|
2562
|
-
},
|
|
2562
|
+
}, Ke = {
|
|
2563
2563
|
name: "zoom",
|
|
2564
2564
|
title: "Zoom",
|
|
2565
2565
|
order: 10,
|
|
@@ -2571,7 +2571,7 @@ const We = {
|
|
|
2571
2571
|
outlineID: "pswp__icn-zoom"
|
|
2572
2572
|
},
|
|
2573
2573
|
onClick: "toggleZoom"
|
|
2574
|
-
},
|
|
2574
|
+
}, Xe = {
|
|
2575
2575
|
name: "preloader",
|
|
2576
2576
|
appendTo: "bar",
|
|
2577
2577
|
order: 7,
|
|
@@ -2602,7 +2602,7 @@ const We = {
|
|
|
2602
2602
|
t.currSlide === a.slide && r();
|
|
2603
2603
|
}), t.ui && (t.ui.updatePreloaderVisibility = r);
|
|
2604
2604
|
}
|
|
2605
|
-
},
|
|
2605
|
+
}, Ye = {
|
|
2606
2606
|
name: "counter",
|
|
2607
2607
|
order: 5,
|
|
2608
2608
|
onInit: (s, t) => {
|
|
@@ -2611,10 +2611,10 @@ const We = {
|
|
|
2611
2611
|
});
|
|
2612
2612
|
}
|
|
2613
2613
|
};
|
|
2614
|
-
function
|
|
2614
|
+
function ot(s, t) {
|
|
2615
2615
|
s.classList.toggle("pswp--zoomed-in", t);
|
|
2616
2616
|
}
|
|
2617
|
-
class
|
|
2617
|
+
class Qe {
|
|
2618
2618
|
/**
|
|
2619
2619
|
* @param {PhotoSwipe} pswp
|
|
2620
2620
|
*/
|
|
@@ -2626,7 +2626,7 @@ class Xe {
|
|
|
2626
2626
|
const {
|
|
2627
2627
|
pswp: t
|
|
2628
2628
|
} = this;
|
|
2629
|
-
this.isRegistered = !1, this.uiElementsData = [
|
|
2629
|
+
this.isRegistered = !1, this.uiElementsData = [Ue, je, Ge, Ke, Xe, Ye], t.dispatch("uiRegister"), this.uiElementsData.sort((e, i) => (e.order || 0) - (i.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((e) => {
|
|
2630
2630
|
this.registerElement(e);
|
|
2631
2631
|
}), t.on("change", () => {
|
|
2632
2632
|
var e;
|
|
@@ -2637,7 +2637,7 @@ class Xe {
|
|
|
2637
2637
|
* @param {UIElementData} elementData
|
|
2638
2638
|
*/
|
|
2639
2639
|
registerElement(t) {
|
|
2640
|
-
this.isRegistered ? this.items.push(new
|
|
2640
|
+
this.isRegistered ? this.items.push(new Ve(this.pswp, t)) : this.uiElementsData.push(t);
|
|
2641
2641
|
}
|
|
2642
2642
|
/**
|
|
2643
2643
|
* Fired each time zoom or pan position is changed.
|
|
@@ -2661,15 +2661,15 @@ class Xe {
|
|
|
2661
2661
|
this._lastUpdatedZoomLevel = n;
|
|
2662
2662
|
const o = e.zoomLevels.initial - e.zoomLevels.secondary;
|
|
2663
2663
|
if (Math.abs(o) < 0.01 || !e.isZoomable()) {
|
|
2664
|
-
|
|
2664
|
+
ot(t, !1), t.classList.remove("pswp--zoom-allowed");
|
|
2665
2665
|
return;
|
|
2666
2666
|
}
|
|
2667
2667
|
t.classList.add("pswp--zoom-allowed");
|
|
2668
2668
|
const r = n === e.zoomLevels.initial ? e.zoomLevels.secondary : e.zoomLevels.initial;
|
|
2669
|
-
|
|
2669
|
+
ot(t, r <= n), (i.imageClickAction === "zoom" || i.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
|
|
2670
2670
|
}
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2672
|
+
function Je(s) {
|
|
2673
2673
|
const t = s.getBoundingClientRect();
|
|
2674
2674
|
return {
|
|
2675
2675
|
x: t.left,
|
|
@@ -2677,7 +2677,7 @@ function Ye(s) {
|
|
|
2677
2677
|
w: t.width
|
|
2678
2678
|
};
|
|
2679
2679
|
}
|
|
2680
|
-
function
|
|
2680
|
+
function ti(s, t, e) {
|
|
2681
2681
|
const i = s.getBoundingClientRect(), n = i.width / t, o = i.height / e, r = n > o ? n : o, a = (i.width - t * r) / 2, l = (i.height - e * r) / 2, h = {
|
|
2682
2682
|
x: i.left + a,
|
|
2683
2683
|
y: i.top + l,
|
|
@@ -2690,7 +2690,7 @@ function Qe(s, t, e) {
|
|
|
2690
2690
|
y: l
|
|
2691
2691
|
}, h;
|
|
2692
2692
|
}
|
|
2693
|
-
function
|
|
2693
|
+
function ei(s, t, e) {
|
|
2694
2694
|
const i = e.dispatch("thumbBounds", {
|
|
2695
2695
|
index: s,
|
|
2696
2696
|
itemData: t,
|
|
@@ -2709,9 +2709,9 @@ function Je(s, t, e) {
|
|
|
2709
2709
|
n.querySelector(a)
|
|
2710
2710
|
);
|
|
2711
2711
|
}
|
|
2712
|
-
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o =
|
|
2712
|
+
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o = ti(r, t.width || t.w || 0, t.height || t.h || 0) : o = Je(r)), e.applyFilters("thumbBounds", o, t, s);
|
|
2713
2713
|
}
|
|
2714
|
-
let
|
|
2714
|
+
let ii = class {
|
|
2715
2715
|
/**
|
|
2716
2716
|
* @param {T} type
|
|
2717
2717
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -2722,7 +2722,7 @@ let ti = class {
|
|
|
2722
2722
|
preventDefault() {
|
|
2723
2723
|
this.defaultPrevented = !0;
|
|
2724
2724
|
}
|
|
2725
|
-
},
|
|
2725
|
+
}, si = class {
|
|
2726
2726
|
constructor() {
|
|
2727
2727
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
2728
2728
|
}
|
|
@@ -2789,13 +2789,13 @@ let ti = class {
|
|
|
2789
2789
|
return this.pswp.dispatch(t, e);
|
|
2790
2790
|
const n = (
|
|
2791
2791
|
/** @type {AugmentedEvent<T>} */
|
|
2792
|
-
new
|
|
2792
|
+
new ii(t, e)
|
|
2793
2793
|
);
|
|
2794
2794
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
2795
2795
|
o.call(this, n);
|
|
2796
2796
|
}), n;
|
|
2797
2797
|
}
|
|
2798
|
-
},
|
|
2798
|
+
}, ni = class {
|
|
2799
2799
|
/**
|
|
2800
2800
|
* @param {string | false} imageSrc
|
|
2801
2801
|
* @param {HTMLElement} container
|
|
@@ -2815,13 +2815,13 @@ let ti = class {
|
|
|
2815
2815
|
* @param {number} height
|
|
2816
2816
|
*/
|
|
2817
2817
|
setDisplayedSize(t, e) {
|
|
2818
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
2818
|
+
this.element && (this.element.tagName === "IMG" ? (j(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = k(0, 0, t / 250)) : j(this.element, t, e));
|
|
2819
2819
|
}
|
|
2820
2820
|
destroy() {
|
|
2821
2821
|
var t;
|
|
2822
2822
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
2823
2823
|
}
|
|
2824
|
-
},
|
|
2824
|
+
}, oi = class {
|
|
2825
2825
|
/**
|
|
2826
2826
|
* @param {SlideData} itemData Slide data
|
|
2827
2827
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -2856,7 +2856,7 @@ let ti = class {
|
|
|
2856
2856
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
2857
2857
|
this
|
|
2858
2858
|
);
|
|
2859
|
-
this.placeholder = new
|
|
2859
|
+
this.placeholder = new ni(i, this.slide.container);
|
|
2860
2860
|
}
|
|
2861
2861
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2862
2862
|
content: this,
|
|
@@ -2944,7 +2944,7 @@ let ti = class {
|
|
|
2944
2944
|
content: this,
|
|
2945
2945
|
width: t,
|
|
2946
2946
|
height: e
|
|
2947
|
-
}).defaultPrevented && (
|
|
2947
|
+
}).defaultPrevented && (j(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
2948
2948
|
const i = !this.displayedImageWidth && t;
|
|
2949
2949
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
2950
2950
|
slide: this.slide,
|
|
@@ -3026,7 +3026,7 @@ let ti = class {
|
|
|
3026
3026
|
}).defaultPrevented)
|
|
3027
3027
|
return;
|
|
3028
3028
|
const t = "decode" in this.element;
|
|
3029
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
3029
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || et()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
3030
3030
|
}).finally(() => {
|
|
3031
3031
|
this.isDecoding = !1, this.appendImage();
|
|
3032
3032
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -3039,7 +3039,7 @@ let ti = class {
|
|
|
3039
3039
|
activate() {
|
|
3040
3040
|
this.instance.dispatch("contentActivate", {
|
|
3041
3041
|
content: this
|
|
3042
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
3042
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !et() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
3043
3043
|
}
|
|
3044
3044
|
/**
|
|
3045
3045
|
* Deactivate the content
|
|
@@ -3066,36 +3066,36 @@ let ti = class {
|
|
|
3066
3066
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === S.LOADED || this.state === S.ERROR) && this.removePlaceholder()));
|
|
3067
3067
|
}
|
|
3068
3068
|
};
|
|
3069
|
-
const
|
|
3070
|
-
function
|
|
3069
|
+
const ri = 5;
|
|
3070
|
+
function St(s, t, e) {
|
|
3071
3071
|
const i = t.createContentFromData(s, e);
|
|
3072
3072
|
let n;
|
|
3073
3073
|
const {
|
|
3074
3074
|
options: o
|
|
3075
3075
|
} = t;
|
|
3076
3076
|
if (o) {
|
|
3077
|
-
n = new
|
|
3077
|
+
n = new yt(o, s, -1);
|
|
3078
3078
|
let r;
|
|
3079
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
3080
|
-
const a =
|
|
3079
|
+
t.pswp ? r = t.pswp.viewportSize : r = _t(o, t);
|
|
3080
|
+
const a = vt(o, r, s, e);
|
|
3081
3081
|
n.update(i.width, i.height, a);
|
|
3082
3082
|
}
|
|
3083
3083
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
3084
3084
|
}
|
|
3085
|
-
function
|
|
3085
|
+
function ai(s, t) {
|
|
3086
3086
|
const e = t.getItemData(s);
|
|
3087
3087
|
if (!t.dispatch("lazyLoadSlide", {
|
|
3088
3088
|
index: s,
|
|
3089
3089
|
itemData: e
|
|
3090
3090
|
}).defaultPrevented)
|
|
3091
|
-
return
|
|
3091
|
+
return St(e, t, s);
|
|
3092
3092
|
}
|
|
3093
|
-
class
|
|
3093
|
+
class li {
|
|
3094
3094
|
/**
|
|
3095
3095
|
* @param {PhotoSwipe} pswp
|
|
3096
3096
|
*/
|
|
3097
3097
|
constructor(t) {
|
|
3098
|
-
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1,
|
|
3098
|
+
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, ri), this._cachedItems = [];
|
|
3099
3099
|
}
|
|
3100
3100
|
/**
|
|
3101
3101
|
* Lazy load nearby slides based on `preload` option.
|
|
@@ -3123,7 +3123,7 @@ class ri {
|
|
|
3123
3123
|
loadSlideByIndex(t) {
|
|
3124
3124
|
const e = this.pswp.getLoopedIndex(t);
|
|
3125
3125
|
let i = this.getContentByIndex(e);
|
|
3126
|
-
i || (i =
|
|
3126
|
+
i || (i = ai(e, this.pswp), i && this.addToCache(i));
|
|
3127
3127
|
}
|
|
3128
3128
|
/**
|
|
3129
3129
|
* @param {Slide} slide
|
|
@@ -3162,7 +3162,7 @@ class ri {
|
|
|
3162
3162
|
this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
|
|
3163
3163
|
}
|
|
3164
3164
|
}
|
|
3165
|
-
let
|
|
3165
|
+
let hi = class extends si {
|
|
3166
3166
|
/**
|
|
3167
3167
|
* Get total number of slides
|
|
3168
3168
|
*
|
|
@@ -3185,7 +3185,7 @@ let ai = class extends ei {
|
|
|
3185
3185
|
* @returns {Content}
|
|
3186
3186
|
*/
|
|
3187
3187
|
createContentFromData(t, e) {
|
|
3188
|
-
return new
|
|
3188
|
+
return new oi(t, this, e);
|
|
3189
3189
|
}
|
|
3190
3190
|
/**
|
|
3191
3191
|
* Get item data by index.
|
|
@@ -3219,7 +3219,7 @@ let ai = class extends ei {
|
|
|
3219
3219
|
*/
|
|
3220
3220
|
_getGalleryDOMElements(t) {
|
|
3221
3221
|
var e, i;
|
|
3222
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
3222
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? me(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
3223
3223
|
}
|
|
3224
3224
|
/**
|
|
3225
3225
|
* Converts DOM element to item data object.
|
|
@@ -3253,11 +3253,11 @@ let ai = class extends ei {
|
|
|
3253
3253
|
* @returns {Content} Image that is being decoded or false.
|
|
3254
3254
|
*/
|
|
3255
3255
|
lazyLoadData(t, e) {
|
|
3256
|
-
return
|
|
3256
|
+
return St(t, this, e);
|
|
3257
3257
|
}
|
|
3258
3258
|
};
|
|
3259
3259
|
const O = 3e-3;
|
|
3260
|
-
class
|
|
3260
|
+
class ci {
|
|
3261
3261
|
/**
|
|
3262
3262
|
* @param {PhotoSwipe} pswp
|
|
3263
3263
|
*/
|
|
@@ -3310,7 +3310,7 @@ class li {
|
|
|
3310
3310
|
_start() {
|
|
3311
3311
|
this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
|
|
3312
3312
|
let e = !1, i = !0;
|
|
3313
|
-
|
|
3313
|
+
ue(
|
|
3314
3314
|
/** @type {HTMLImageElement} */
|
|
3315
3315
|
this._placeholder
|
|
3316
3316
|
).finally(() => {
|
|
@@ -3401,7 +3401,7 @@ class li {
|
|
|
3401
3401
|
o[e] = i, n.startTransition(o);
|
|
3402
3402
|
}
|
|
3403
3403
|
}
|
|
3404
|
-
const
|
|
3404
|
+
const di = {
|
|
3405
3405
|
allowPanToNext: !0,
|
|
3406
3406
|
spacing: 0.1,
|
|
3407
3407
|
loop: !0,
|
|
@@ -3428,7 +3428,7 @@ const hi = {
|
|
|
3428
3428
|
preload: [1, 2],
|
|
3429
3429
|
easing: "cubic-bezier(.4,0,.22,1)"
|
|
3430
3430
|
};
|
|
3431
|
-
class
|
|
3431
|
+
class ui extends hi {
|
|
3432
3432
|
/**
|
|
3433
3433
|
* @param {PhotoSwipeOptions} [options]
|
|
3434
3434
|
*/
|
|
@@ -3442,7 +3442,7 @@ class ci extends ai {
|
|
|
3442
3442
|
}, this.viewportSize = {
|
|
3443
3443
|
x: 0,
|
|
3444
3444
|
y: 0
|
|
3445
|
-
}, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new
|
|
3445
|
+
}, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new fe(), this.animations = new Be(), this.mainScroll = new De(this), this.gestures = new ze(this), this.opener = new ci(this), this.keyboard = new $e(this), this.contentLoader = new li(this);
|
|
3446
3446
|
}
|
|
3447
3447
|
/** @returns {boolean} */
|
|
3448
3448
|
init() {
|
|
@@ -3450,7 +3450,7 @@ class ci extends ai {
|
|
|
3450
3450
|
return !1;
|
|
3451
3451
|
this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
|
|
3452
3452
|
let t = "pswp--open";
|
|
3453
|
-
return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new
|
|
3453
|
+
return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new He(this), (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) && (this.currIndex = 0), this.gestures.supportsTouch || this.mouseDetected(), this.updateSize(), this.offset.y = window.pageYOffset, this._initialItemData = this.getItemData(this.currIndex), this.dispatch("gettingData", {
|
|
3454
3454
|
index: this.currIndex,
|
|
3455
3455
|
data: this._initialItemData,
|
|
3456
3456
|
slide: void 0
|
|
@@ -3569,7 +3569,7 @@ class ci extends ai {
|
|
|
3569
3569
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3570
3570
|
return;
|
|
3571
3571
|
const n = this.getItemData(e);
|
|
3572
|
-
t.slide = new
|
|
3572
|
+
t.slide = new _e(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3573
3573
|
}
|
|
3574
3574
|
/** @returns {Point} */
|
|
3575
3575
|
getViewportCenterPoint() {
|
|
@@ -3587,8 +3587,8 @@ class ci extends ai {
|
|
|
3587
3587
|
updateSize(t) {
|
|
3588
3588
|
if (this.isDestroying)
|
|
3589
3589
|
return;
|
|
3590
|
-
const e =
|
|
3591
|
-
!t &&
|
|
3590
|
+
const e = _t(this.options, this);
|
|
3591
|
+
!t && F(e, this._prevViewportSize) || (_(this._prevViewportSize, e), this.dispatch("beforeResize"), _(this.viewportSize, this._prevViewportSize), this._updatePageScrollOffset(), this.dispatch("viewportSize"), this.mainScroll.resize(this.opener.isOpen), !this.hasMouse && window.matchMedia("(any-hover: hover)").matches && this.mouseDetected(), this.dispatch("resize"));
|
|
3592
3592
|
}
|
|
3593
3593
|
/**
|
|
3594
3594
|
* @param {number} opacity
|
|
@@ -3639,7 +3639,7 @@ class ci extends ai {
|
|
|
3639
3639
|
* @private
|
|
3640
3640
|
*/
|
|
3641
3641
|
_createMainStructure() {
|
|
3642
|
-
this.element = w("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = w("pswp__bg", "div", this.element), this.scrollWrap = w("pswp__scroll-wrap", "section", this.element), this.container = w("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new
|
|
3642
|
+
this.element = w("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = w("pswp__bg", "div", this.element), this.scrollWrap = w("pswp__scroll-wrap", "section", this.element), this.container = w("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new Qe(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3643
3643
|
}
|
|
3644
3644
|
/**
|
|
3645
3645
|
* Get position and dimensions of small thumbnail
|
|
@@ -3650,7 +3650,7 @@ class ci extends ai {
|
|
|
3650
3650
|
* @returns {Bounds | undefined}
|
|
3651
3651
|
*/
|
|
3652
3652
|
getThumbBounds() {
|
|
3653
|
-
return
|
|
3653
|
+
return ei(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
|
|
3654
3654
|
}
|
|
3655
3655
|
/**
|
|
3656
3656
|
* If the PhotoSwipe can have continuous loop
|
|
@@ -3666,7 +3666,7 @@ class ci extends ai {
|
|
|
3666
3666
|
*/
|
|
3667
3667
|
_prepareOptions(t) {
|
|
3668
3668
|
return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
|
|
3669
|
-
...
|
|
3669
|
+
...di,
|
|
3670
3670
|
...t
|
|
3671
3671
|
};
|
|
3672
3672
|
}
|
|
@@ -3679,11 +3679,11 @@ function M(s, t, e) {
|
|
|
3679
3679
|
const i = document.createElement(t);
|
|
3680
3680
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3681
3681
|
}
|
|
3682
|
-
function
|
|
3682
|
+
function pi(s, t, e) {
|
|
3683
3683
|
let i = `translate3d(${s}px,0px,0)`;
|
|
3684
3684
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
3685
3685
|
}
|
|
3686
|
-
function
|
|
3686
|
+
function G(s, t, e) {
|
|
3687
3687
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
3688
3688
|
}
|
|
3689
3689
|
const b = {
|
|
@@ -3692,10 +3692,10 @@ const b = {
|
|
|
3692
3692
|
LOADED: "loaded",
|
|
3693
3693
|
ERROR: "error"
|
|
3694
3694
|
};
|
|
3695
|
-
function
|
|
3695
|
+
function mi(s) {
|
|
3696
3696
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3697
3697
|
}
|
|
3698
|
-
function
|
|
3698
|
+
function $(s, t, e = document) {
|
|
3699
3699
|
let i = [];
|
|
3700
3700
|
if (s instanceof Element)
|
|
3701
3701
|
i = [s];
|
|
@@ -3707,13 +3707,13 @@ function Z(s, t, e = document) {
|
|
|
3707
3707
|
}
|
|
3708
3708
|
return i;
|
|
3709
3709
|
}
|
|
3710
|
-
function
|
|
3710
|
+
function fi(s) {
|
|
3711
3711
|
return typeof s == "function" && s.prototype && s.prototype.goTo;
|
|
3712
3712
|
}
|
|
3713
|
-
function
|
|
3713
|
+
function rt() {
|
|
3714
3714
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
3715
3715
|
}
|
|
3716
|
-
class
|
|
3716
|
+
class gi {
|
|
3717
3717
|
/**
|
|
3718
3718
|
* @param {T} type
|
|
3719
3719
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -3725,7 +3725,7 @@ class mi {
|
|
|
3725
3725
|
this.defaultPrevented = !0;
|
|
3726
3726
|
}
|
|
3727
3727
|
}
|
|
3728
|
-
class
|
|
3728
|
+
class _i {
|
|
3729
3729
|
constructor() {
|
|
3730
3730
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
3731
3731
|
}
|
|
@@ -3792,14 +3792,14 @@ class fi {
|
|
|
3792
3792
|
return this.pswp.dispatch(t, e);
|
|
3793
3793
|
const n = (
|
|
3794
3794
|
/** @type {AugmentedEvent<T>} */
|
|
3795
|
-
new
|
|
3795
|
+
new gi(t, e)
|
|
3796
3796
|
);
|
|
3797
3797
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
3798
3798
|
o.call(this, n);
|
|
3799
3799
|
}), n;
|
|
3800
3800
|
}
|
|
3801
3801
|
}
|
|
3802
|
-
class
|
|
3802
|
+
class vi {
|
|
3803
3803
|
/**
|
|
3804
3804
|
* @param {string | false} imageSrc
|
|
3805
3805
|
* @param {HTMLElement} container
|
|
@@ -3819,14 +3819,14 @@ class gi {
|
|
|
3819
3819
|
* @param {number} height
|
|
3820
3820
|
*/
|
|
3821
3821
|
setDisplayedSize(t, e) {
|
|
3822
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
3822
|
+
this.element && (this.element.tagName === "IMG" ? (G(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = pi(0, 0, t / 250)) : G(this.element, t, e));
|
|
3823
3823
|
}
|
|
3824
3824
|
destroy() {
|
|
3825
3825
|
var t;
|
|
3826
3826
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3827
3827
|
}
|
|
3828
3828
|
}
|
|
3829
|
-
class
|
|
3829
|
+
class yi {
|
|
3830
3830
|
/**
|
|
3831
3831
|
* @param {SlideData} itemData Slide data
|
|
3832
3832
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -3861,7 +3861,7 @@ class _i {
|
|
|
3861
3861
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
3862
3862
|
this
|
|
3863
3863
|
);
|
|
3864
|
-
this.placeholder = new
|
|
3864
|
+
this.placeholder = new vi(i, this.slide.container);
|
|
3865
3865
|
}
|
|
3866
3866
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3867
3867
|
content: this,
|
|
@@ -3949,7 +3949,7 @@ class _i {
|
|
|
3949
3949
|
content: this,
|
|
3950
3950
|
width: t,
|
|
3951
3951
|
height: e
|
|
3952
|
-
}).defaultPrevented && (
|
|
3952
|
+
}).defaultPrevented && (G(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
3953
3953
|
const i = !this.displayedImageWidth && t;
|
|
3954
3954
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
3955
3955
|
slide: this.slide,
|
|
@@ -4031,7 +4031,7 @@ class _i {
|
|
|
4031
4031
|
}).defaultPrevented)
|
|
4032
4032
|
return;
|
|
4033
4033
|
const t = "decode" in this.element;
|
|
4034
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
4034
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || rt()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
4035
4035
|
}).finally(() => {
|
|
4036
4036
|
this.isDecoding = !1, this.appendImage();
|
|
4037
4037
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -4044,7 +4044,7 @@ class _i {
|
|
|
4044
4044
|
activate() {
|
|
4045
4045
|
this.instance.dispatch("contentActivate", {
|
|
4046
4046
|
content: this
|
|
4047
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
4047
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !rt() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
4048
4048
|
}
|
|
4049
4049
|
/**
|
|
4050
4050
|
* Deactivate the content
|
|
@@ -4071,7 +4071,7 @@ class _i {
|
|
|
4071
4071
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === b.LOADED || this.state === b.ERROR) && this.removePlaceholder()));
|
|
4072
4072
|
}
|
|
4073
4073
|
}
|
|
4074
|
-
function
|
|
4074
|
+
function wi(s, t) {
|
|
4075
4075
|
if (s.getViewportSizeFn) {
|
|
4076
4076
|
const e = s.getViewportSizeFn(s, t);
|
|
4077
4077
|
if (e)
|
|
@@ -4098,14 +4098,14 @@ function N(s, t, e, i, n) {
|
|
|
4098
4098
|
}
|
|
4099
4099
|
return Number(o) || 0;
|
|
4100
4100
|
}
|
|
4101
|
-
function
|
|
4101
|
+
function Si(s, t, e, i) {
|
|
4102
4102
|
return {
|
|
4103
4103
|
x: t.x - N("left", s, t, e, i) - N("right", s, t, e, i),
|
|
4104
4104
|
y: t.y - N("top", s, t, e, i) - N("bottom", s, t, e, i)
|
|
4105
4105
|
};
|
|
4106
4106
|
}
|
|
4107
|
-
const
|
|
4108
|
-
class
|
|
4107
|
+
const at = 4e3;
|
|
4108
|
+
class bi {
|
|
4109
4109
|
/**
|
|
4110
4110
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
4111
4111
|
* @param {SlideData} itemData Slide data
|
|
@@ -4162,7 +4162,7 @@ class wi {
|
|
|
4162
4162
|
*/
|
|
4163
4163
|
_getSecondary() {
|
|
4164
4164
|
let t = this._parseZoomLevelOption("secondary");
|
|
4165
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
4165
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > at && (t = at / this.elementSize.x), t);
|
|
4166
4166
|
}
|
|
4167
4167
|
/**
|
|
4168
4168
|
* Get initial image zoom level.
|
|
@@ -4185,30 +4185,30 @@ class wi {
|
|
|
4185
4185
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4186
4186
|
}
|
|
4187
4187
|
}
|
|
4188
|
-
function
|
|
4188
|
+
function bt(s, t, e) {
|
|
4189
4189
|
const i = t.createContentFromData(s, e);
|
|
4190
4190
|
let n;
|
|
4191
4191
|
const {
|
|
4192
4192
|
options: o
|
|
4193
4193
|
} = t;
|
|
4194
4194
|
if (o) {
|
|
4195
|
-
n = new
|
|
4195
|
+
n = new bi(o, s, -1);
|
|
4196
4196
|
let r;
|
|
4197
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4198
|
-
const a =
|
|
4197
|
+
t.pswp ? r = t.pswp.viewportSize : r = wi(o, t);
|
|
4198
|
+
const a = Si(o, r, s, e);
|
|
4199
4199
|
n.update(i.width, i.height, a);
|
|
4200
4200
|
}
|
|
4201
4201
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4202
4202
|
}
|
|
4203
|
-
function
|
|
4203
|
+
function Li(s, t) {
|
|
4204
4204
|
const e = t.getItemData(s);
|
|
4205
4205
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4206
4206
|
index: s,
|
|
4207
4207
|
itemData: e
|
|
4208
4208
|
}).defaultPrevented)
|
|
4209
|
-
return
|
|
4209
|
+
return bt(e, t, s);
|
|
4210
4210
|
}
|
|
4211
|
-
class
|
|
4211
|
+
class Ei extends _i {
|
|
4212
4212
|
/**
|
|
4213
4213
|
* Get total number of slides
|
|
4214
4214
|
*
|
|
@@ -4231,7 +4231,7 @@ class bi extends fi {
|
|
|
4231
4231
|
* @returns {Content}
|
|
4232
4232
|
*/
|
|
4233
4233
|
createContentFromData(t, e) {
|
|
4234
|
-
return new
|
|
4234
|
+
return new yi(t, this, e);
|
|
4235
4235
|
}
|
|
4236
4236
|
/**
|
|
4237
4237
|
* Get item data by index.
|
|
@@ -4265,7 +4265,7 @@ class bi extends fi {
|
|
|
4265
4265
|
*/
|
|
4266
4266
|
_getGalleryDOMElements(t) {
|
|
4267
4267
|
var e, i;
|
|
4268
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
4268
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? $(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
4269
4269
|
}
|
|
4270
4270
|
/**
|
|
4271
4271
|
* Converts DOM element to item data object.
|
|
@@ -4299,10 +4299,10 @@ class bi extends fi {
|
|
|
4299
4299
|
* @returns {Content} Image that is being decoded or false.
|
|
4300
4300
|
*/
|
|
4301
4301
|
lazyLoadData(t, e) {
|
|
4302
|
-
return
|
|
4302
|
+
return bt(t, this, e);
|
|
4303
4303
|
}
|
|
4304
4304
|
}
|
|
4305
|
-
class
|
|
4305
|
+
class Pi extends Ei {
|
|
4306
4306
|
/**
|
|
4307
4307
|
* @param {PhotoSwipeOptions} [options]
|
|
4308
4308
|
*/
|
|
@@ -4314,7 +4314,7 @@ class Li extends bi {
|
|
|
4314
4314
|
* It's not included in the main constructor, so you may bind events before it.
|
|
4315
4315
|
*/
|
|
4316
4316
|
init() {
|
|
4317
|
-
|
|
4317
|
+
$(this.options.gallery, this.options.gallerySelector).forEach((t) => {
|
|
4318
4318
|
t.addEventListener("click", this.onThumbnailsClick, !1);
|
|
4319
4319
|
});
|
|
4320
4320
|
}
|
|
@@ -4322,7 +4322,7 @@ class Li extends bi {
|
|
|
4322
4322
|
* @param {MouseEvent} e
|
|
4323
4323
|
*/
|
|
4324
4324
|
onThumbnailsClick(t) {
|
|
4325
|
-
if (
|
|
4325
|
+
if (mi(t) || window.pswp)
|
|
4326
4326
|
return;
|
|
4327
4327
|
let e = {
|
|
4328
4328
|
x: t.clientX,
|
|
@@ -4351,7 +4351,7 @@ class Li extends bi {
|
|
|
4351
4351
|
const e = (
|
|
4352
4352
|
/** @type {HTMLElement} */
|
|
4353
4353
|
t.target
|
|
4354
|
-
), n =
|
|
4354
|
+
), n = $(
|
|
4355
4355
|
this.options.children,
|
|
4356
4356
|
this.options.childSelector,
|
|
4357
4357
|
/** @type {HTMLElement} */
|
|
@@ -4371,7 +4371,7 @@ class Li extends bi {
|
|
|
4371
4371
|
if (window.pswp || !this.options)
|
|
4372
4372
|
return !1;
|
|
4373
4373
|
if (!e && this.options.gallery && this.options.children) {
|
|
4374
|
-
const n =
|
|
4374
|
+
const n = $(this.options.gallery);
|
|
4375
4375
|
n[0] && (e = {
|
|
4376
4376
|
gallery: n[0]
|
|
4377
4377
|
});
|
|
@@ -4390,7 +4390,7 @@ class Li extends bi {
|
|
|
4390
4390
|
} = this;
|
|
4391
4391
|
e && (i.dataSource = e);
|
|
4392
4392
|
const n = [], o = typeof i.pswpModule;
|
|
4393
|
-
if (
|
|
4393
|
+
if (fi(i.pswpModule))
|
|
4394
4394
|
n.push(Promise.resolve(
|
|
4395
4395
|
/** @type {Type<PhotoSwipe>} */
|
|
4396
4396
|
i.pswpModule
|
|
@@ -4406,7 +4406,7 @@ class Li extends bi {
|
|
|
4406
4406
|
else
|
|
4407
4407
|
throw new Error("pswpModule is not valid");
|
|
4408
4408
|
}
|
|
4409
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4409
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = Li(t, this));
|
|
4410
4410
|
const r = ++this._uid;
|
|
4411
4411
|
Promise.all(n).then((a) => {
|
|
4412
4412
|
if (this.shouldOpen) {
|
|
@@ -4447,17 +4447,17 @@ class Li extends bi {
|
|
|
4447
4447
|
*/
|
|
4448
4448
|
destroy() {
|
|
4449
4449
|
var t;
|
|
4450
|
-
(t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {},
|
|
4450
|
+
(t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {}, $(this.options.gallery, this.options.gallerySelector).forEach((e) => {
|
|
4451
4451
|
e.removeEventListener("click", this.onThumbnailsClick, !1);
|
|
4452
4452
|
});
|
|
4453
4453
|
}
|
|
4454
4454
|
}
|
|
4455
|
-
const
|
|
4455
|
+
const Ai = () => {
|
|
4456
4456
|
let s = null;
|
|
4457
|
-
return s = new
|
|
4457
|
+
return s = new Pi({
|
|
4458
4458
|
gallery: "#photoswipe-gallery",
|
|
4459
4459
|
children: "a",
|
|
4460
|
-
pswpModule:
|
|
4460
|
+
pswpModule: ui,
|
|
4461
4461
|
zoom: !1,
|
|
4462
4462
|
imageClickAction: "next",
|
|
4463
4463
|
tapAction: "next"
|
|
@@ -4481,7 +4481,7 @@ const Ei = () => {
|
|
|
4481
4481
|
}), s.init(), () => {
|
|
4482
4482
|
s && (s.destroy(), s = null);
|
|
4483
4483
|
};
|
|
4484
|
-
},
|
|
4484
|
+
}, xi = () => {
|
|
4485
4485
|
const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar");
|
|
4486
4486
|
if (!t)
|
|
4487
4487
|
return;
|
|
@@ -4493,9 +4493,9 @@ const Ei = () => {
|
|
|
4493
4493
|
s && (i = s.scrollHeight - e.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top));
|
|
4494
4494
|
const o = Math.round(n / i * 100);
|
|
4495
4495
|
t.style.width = `${o}%`, o >= 100 && (t.style.width = "100%");
|
|
4496
|
-
},
|
|
4497
|
-
document.querySelector(".c-progress") && window.addEventListener("scroll",
|
|
4498
|
-
},
|
|
4496
|
+
}, Ii = () => {
|
|
4497
|
+
document.querySelector(".c-progress") && window.addEventListener("scroll", xi);
|
|
4498
|
+
}, W = "#page-content", U = "#text-tooltip", Ci = ".tooltip-btn", Lt = "c-text-tooltip--show", Ti = [
|
|
4499
4499
|
"#page-content .c-content p",
|
|
4500
4500
|
"#page-content .c-content h2",
|
|
4501
4501
|
"#page-content .c-content h3",
|
|
@@ -4507,18 +4507,18 @@ const Ei = () => {
|
|
|
4507
4507
|
"#page-content header span",
|
|
4508
4508
|
"#page-content header h1",
|
|
4509
4509
|
"#page-content header h2"
|
|
4510
|
-
],
|
|
4510
|
+
], lt = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1, zi = (s, t) => {
|
|
4511
4511
|
const e = s.startContainer.nodeType === Node.ELEMENT_NODE ? s.startContainer : s.startContainer.parentElement, i = s.endContainer.nodeType === Node.ELEMENT_NODE ? s.endContainer : s.endContainer.parentElement;
|
|
4512
|
-
return !!e &&
|
|
4513
|
-
},
|
|
4512
|
+
return !!e && lt(e, t) || !!i && lt(i, t);
|
|
4513
|
+
}, Oi = (s) => {
|
|
4514
4514
|
var e;
|
|
4515
4515
|
if (!s.focusNode)
|
|
4516
4516
|
return null;
|
|
4517
4517
|
const t = (e = s.anchorNode) == null ? void 0 : e.compareDocumentPosition(s.focusNode);
|
|
4518
4518
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4519
|
-
},
|
|
4520
|
-
const i = document.querySelector(`${
|
|
4521
|
-
`${
|
|
4519
|
+
}, Di = (s, t, e) => {
|
|
4520
|
+
const i = document.querySelector(`${W} ${U}`), n = document.querySelector(`${W}`), o = document.querySelectorAll(
|
|
4521
|
+
`${W} ${U} ${Ci}`
|
|
4522
4522
|
);
|
|
4523
4523
|
if (!i || !n) {
|
|
4524
4524
|
console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");
|
|
@@ -4526,44 +4526,44 @@ const Ei = () => {
|
|
|
4526
4526
|
}
|
|
4527
4527
|
Array.from(o).forEach((l) => l.setAttribute("data-selected-text", e));
|
|
4528
4528
|
const r = s.getClientRects(), a = r[t ? r.length - 1 : 0];
|
|
4529
|
-
i.style.top = `${a.top - n.getBoundingClientRect().top - (i.offsetHeight + 10)}px`, a.width < i.offsetWidth ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width / 2 - i.offsetWidth / 2}px` : t ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width - i.offsetWidth}px` : i.style.left = `${a.left - n.getBoundingClientRect().left}px`, i.classList.add(
|
|
4530
|
-
},
|
|
4531
|
-
const s = document.querySelector(`${
|
|
4532
|
-
s && s.classList.remove(
|
|
4529
|
+
i.style.top = `${a.top - n.getBoundingClientRect().top - (i.offsetHeight + 10)}px`, a.width < i.offsetWidth ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width / 2 - i.offsetWidth / 2}px` : t ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width - i.offsetWidth}px` : i.style.left = `${a.left - n.getBoundingClientRect().left}px`, i.classList.add(Lt);
|
|
4530
|
+
}, ht = () => {
|
|
4531
|
+
const s = document.querySelector(`${U}`);
|
|
4532
|
+
s && s.classList.remove(Lt);
|
|
4533
4533
|
}, B = ({ type: s }) => {
|
|
4534
4534
|
const t = window.getSelection();
|
|
4535
4535
|
if (s === "selectionchange") {
|
|
4536
|
-
|
|
4536
|
+
ht();
|
|
4537
4537
|
return;
|
|
4538
4538
|
}
|
|
4539
4539
|
if (!t || !t.rangeCount)
|
|
4540
4540
|
return;
|
|
4541
4541
|
const e = t.getRangeAt(0), i = t.toString().trim();
|
|
4542
4542
|
if (i.length) {
|
|
4543
|
-
const n =
|
|
4544
|
-
n &&
|
|
4543
|
+
const n = zi(e, Ti), o = Oi(t) || !1;
|
|
4544
|
+
n && Di(e, o, i);
|
|
4545
4545
|
return;
|
|
4546
4546
|
}
|
|
4547
|
-
|
|
4548
|
-
},
|
|
4547
|
+
ht();
|
|
4548
|
+
}, Mi = () => {
|
|
4549
4549
|
if (!(window != null && window.getSelection)) {
|
|
4550
4550
|
console.warn("Selection API isn't supported");
|
|
4551
4551
|
return;
|
|
4552
4552
|
}
|
|
4553
4553
|
document.addEventListener("mouseup", B), document.addEventListener("selectionchange", B), document.addEventListener("touchend", B), document.addEventListener("touchcancel", B);
|
|
4554
|
-
},
|
|
4554
|
+
}, $i = (s) => {
|
|
4555
4555
|
const { target: t } = s;
|
|
4556
4556
|
if (t instanceof Element) {
|
|
4557
4557
|
const e = t.closest(".c-search-form--button");
|
|
4558
4558
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4559
4559
|
}
|
|
4560
|
-
},
|
|
4560
|
+
}, Zi = (s = document.querySelector(
|
|
4561
4561
|
".c-search-form--button"
|
|
4562
4562
|
)) => {
|
|
4563
4563
|
s && s.addEventListener("click", (t) => {
|
|
4564
|
-
|
|
4564
|
+
$i(t);
|
|
4565
4565
|
});
|
|
4566
|
-
},
|
|
4566
|
+
}, Ri = ({
|
|
4567
4567
|
tabsContainerElement: s,
|
|
4568
4568
|
event: t
|
|
4569
4569
|
}) => {
|
|
@@ -4579,51 +4579,118 @@ const Ei = () => {
|
|
|
4579
4579
|
}), n.forEach((a) => {
|
|
4580
4580
|
a.setAttribute("aria-hidden", "true");
|
|
4581
4581
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4582
|
-
},
|
|
4582
|
+
}, ct = (s) => s.code === "ArrowLeft" || s.keyCode === 39, dt = (s) => s.code === "ArrowRight" || s.keyCode === 37, Fi = (s = document.querySelectorAll(
|
|
4583
4583
|
".js-tabs"
|
|
4584
4584
|
)) => {
|
|
4585
4585
|
s.length > 0 && s.forEach((t) => {
|
|
4586
4586
|
const e = t.querySelectorAll('[role="tab"]');
|
|
4587
4587
|
e.forEach((n) => {
|
|
4588
4588
|
n.addEventListener("click", (o) => {
|
|
4589
|
-
|
|
4589
|
+
Ri({ tabsContainerElement: t, event: o });
|
|
4590
4590
|
});
|
|
4591
4591
|
});
|
|
4592
4592
|
const i = t.querySelector('[role="tablist"]');
|
|
4593
4593
|
if (i && e.length > 0) {
|
|
4594
4594
|
let n = 0;
|
|
4595
4595
|
i.addEventListener("keydown", (o) => {
|
|
4596
|
-
o instanceof KeyboardEvent && (
|
|
4596
|
+
o instanceof KeyboardEvent && (ct(o) || dt(o)) && (e[n].setAttribute("tabindex", "-1"), ct(o) ? (n += 1, n >= e.length && (n = 0)) : dt(o) && (n -= 1, n < 0 && (n = e.length - 1)), e[n].setAttribute("tabindex", "0"), e[n].focus());
|
|
4597
4597
|
});
|
|
4598
4598
|
}
|
|
4599
4599
|
});
|
|
4600
|
-
},
|
|
4600
|
+
}, H = (s) => {
|
|
4601
|
+
const [t, e] = s.split("h").map(Number);
|
|
4602
|
+
return t * 60 + e;
|
|
4603
|
+
}, Et = () => {
|
|
4604
|
+
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4605
|
+
return t * 60 + e;
|
|
4606
|
+
}, ki = (s, t) => {
|
|
4607
|
+
const e = Et();
|
|
4608
|
+
if (e < s || e > t)
|
|
4609
|
+
return 0;
|
|
4610
|
+
const i = t - s;
|
|
4611
|
+
return (e - s) / i;
|
|
4612
|
+
}, qi = (s) => {
|
|
4613
|
+
const t = Et();
|
|
4614
|
+
let e = null, i = null, n = -1;
|
|
4615
|
+
return Array.from(s).find((o, r, a) => {
|
|
4616
|
+
if (r === a.length - 1)
|
|
4617
|
+
return !1;
|
|
4618
|
+
const l = H(o.textContent), h = H(a[r + 1].textContent);
|
|
4619
|
+
return t >= l && t < h ? (e = o.textContent, i = a[r + 1].textContent, n = r, !0) : !1;
|
|
4620
|
+
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4621
|
+
}, Ni = () => {
|
|
4622
|
+
const s = document.querySelectorAll(".c-timeline__time");
|
|
4623
|
+
if (!s || s.length < 2)
|
|
4624
|
+
return;
|
|
4625
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = qi(s);
|
|
4626
|
+
if (!e || !i)
|
|
4627
|
+
return;
|
|
4628
|
+
const o = H(e), r = H(i), a = ki(o, r);
|
|
4629
|
+
if (t instanceof HTMLElement) {
|
|
4630
|
+
if (t.classList.contains("c-timeline__progress-bar--is-desktop") && s.length >= 5) {
|
|
4631
|
+
const l = "172px / 2";
|
|
4632
|
+
switch (n) {
|
|
4633
|
+
case 0:
|
|
4634
|
+
t.style.width = `calc(${l} + (((${l} + 25% - ${l} / 2) - ${l}) * ${a})`;
|
|
4635
|
+
break;
|
|
4636
|
+
case 1:
|
|
4637
|
+
t.style.width = `calc((${l} + 25% - ${l} / 2) + (((50%) - (${l} + 25% - ${l} / 2)) * ${a})`;
|
|
4638
|
+
break;
|
|
4639
|
+
case 2:
|
|
4640
|
+
t.style.width = `calc((50%) + (((75% - ${l} / 2) - (50%)) * ${a})`;
|
|
4641
|
+
break;
|
|
4642
|
+
case 3:
|
|
4643
|
+
t.style.width = `calc((75% - ${l} / 2) + (((100% - ${l}) - (75% - ${l} / 2)) * ${a}`;
|
|
4644
|
+
break;
|
|
4645
|
+
default:
|
|
4646
|
+
t.style.width = "0%";
|
|
4647
|
+
}
|
|
4648
|
+
}
|
|
4649
|
+
if (t.classList.contains("c-timeline__progress-bar--is-mobile")) {
|
|
4650
|
+
const l = "45px / 2", h = "20px";
|
|
4651
|
+
switch (n) {
|
|
4652
|
+
case 0:
|
|
4653
|
+
case 1:
|
|
4654
|
+
case 2:
|
|
4655
|
+
case 3:
|
|
4656
|
+
t.style.width = `calc((${h} + ${l}) + (((60% + ${l}) - (${h} + ${l})) * ${a})`;
|
|
4657
|
+
break;
|
|
4658
|
+
default:
|
|
4659
|
+
t.style.width = "0%";
|
|
4660
|
+
}
|
|
4661
|
+
if (n === 1 || n === 2 || n === 3) {
|
|
4662
|
+
const c = document.querySelectorAll(".c-timeline__time"), d = document.querySelectorAll(".c-timeline__event");
|
|
4663
|
+
c.length > 0 && d.length > 0 && (c[0].textContent = e, c[1].textContent = i, d[0].textContent = d[n].textContent, d[1].textContent = d[n + 1].textContent);
|
|
4664
|
+
}
|
|
4665
|
+
}
|
|
4666
|
+
}
|
|
4667
|
+
}, K = "c-icon-item__container--is-highlighted", Bi = (s) => {
|
|
4601
4668
|
const t = s.find(
|
|
4602
|
-
(e) => e.classList.contains(
|
|
4669
|
+
(e) => e.classList.contains(K)
|
|
4603
4670
|
);
|
|
4604
|
-
t == null || t.classList.remove(
|
|
4605
|
-
},
|
|
4671
|
+
t == null || t.classList.remove(K);
|
|
4672
|
+
}, Hi = () => {
|
|
4606
4673
|
const s = document.querySelector(".c-toolbar");
|
|
4607
4674
|
if (s) {
|
|
4608
4675
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4609
|
-
|
|
4676
|
+
Bi(e);
|
|
4610
4677
|
const i = e.find(
|
|
4611
4678
|
(n) => {
|
|
4612
4679
|
var o;
|
|
4613
4680
|
return ((o = n.querySelector("a")) == null ? void 0 : o.getAttribute("href")) === t;
|
|
4614
4681
|
}
|
|
4615
4682
|
);
|
|
4616
|
-
i == null || i.classList.add(
|
|
4683
|
+
i == null || i.classList.add(K);
|
|
4617
4684
|
}
|
|
4618
|
-
},
|
|
4619
|
-
|
|
4685
|
+
}, Yi = () => {
|
|
4686
|
+
Ut(), Fi(), Zt(), Wt(), Ii(), Ai(), se(), Zi(), Rt("paralympicsGames", "countdown-paralympics-games"), Mi(), Mt(), Xt(), qt(), Dt(
|
|
4620
4687
|
"localisation-input",
|
|
4621
4688
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
4622
4689
|
"?searchValue=",
|
|
4623
4690
|
"text",
|
|
4624
4691
|
"text"
|
|
4625
|
-
),
|
|
4692
|
+
), kt(), Hi(), Tt(), zt(), Yt(), le(), he(), Kt(), Ct(), Ni();
|
|
4626
4693
|
};
|
|
4627
4694
|
export {
|
|
4628
|
-
|
|
4695
|
+
Yi as initScripts
|
|
4629
4696
|
};
|