@20minutes/hela 2.16.6 → 2.16.8
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 +2444 -2293
- package/dist/index.umd.js +1 -1
- package/dist/js/scripts.es.js +538 -453
- package/dist/js/scripts.umd.js +1 -1
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/scss/abstracts/variables/_variables.scss +1 -1
- package/dist/src/assets/scripts/zoomOverlayMap.d.ts +1 -0
- package/dist/src/components/atoms/Label/Label.d.ts +0 -1
- package/dist/src/components/molecules/Maps/MapTownsByDepartments/MapTownsByDepartments.d.ts +2 -0
- package/dist/src/components/molecules/StreakBlock/StreakBlock.stories.d.ts +4 -4
- package/dist/src/components/organisms/Elections/ElectionsResult.d.ts +2 -1
- package/dist/src/components/organisms/Elections/ElectionsResult.stories.d.ts +8 -3
- package/dist/src/constants/mapTownsByDepartmentsConfig.d.ts +4 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Dt = () => /Android/i.test(navigator.userAgent), Mt = typeof window < "u" && navigator.userAgent.toLowerCase().includes("firefox"), $t = () => {
|
|
2
2
|
const s = document.getElementById("js-download-band");
|
|
3
|
-
s &&
|
|
3
|
+
s && Dt() && s.setAttribute(
|
|
4
4
|
"href",
|
|
5
5
|
"https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome"
|
|
6
6
|
);
|
|
7
|
-
},
|
|
7
|
+
}, Rt = () => {
|
|
8
8
|
const s = document.querySelector("#js-election-selector");
|
|
9
9
|
s && s.addEventListener("change", (t) => {
|
|
10
10
|
window.location.replace(t.target.value);
|
|
11
11
|
});
|
|
12
|
-
},
|
|
12
|
+
}, Zt = () => {
|
|
13
13
|
const s = document.querySelector(".c-search-banner");
|
|
14
14
|
if (!s)
|
|
15
15
|
return;
|
|
@@ -22,7 +22,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
22
22
|
e.getAttribute("aria-expanded") === "true" ? (e.setAttribute("aria-expanded", "false"), i.setAttribute("aria-hidden", "true")) : (e.setAttribute("aria-expanded", "true"), i.setAttribute("aria-hidden", "false"));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, Ft = [
|
|
26
26
|
{
|
|
27
27
|
text: "Paris",
|
|
28
28
|
_index: "town_1717424751904",
|
|
@@ -53,48 +53,48 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
53
53
|
url: "/elections/resultats/paris/paris-75011"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
],
|
|
56
|
+
], qt = (s, t, e, i, n, o) => {
|
|
57
57
|
const r = document.getElementById(s);
|
|
58
58
|
if (!r)
|
|
59
59
|
return;
|
|
60
60
|
const a = r.dataset.storybook, l = r.querySelector(`#${s}-search`), c = l?.getAttribute("data-api-url"), h = r.querySelector(".c-autocomplete__menu");
|
|
61
61
|
if (!l || !h || !c)
|
|
62
62
|
return;
|
|
63
|
-
const d = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"),
|
|
63
|
+
const d = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"), m = async (g) => {
|
|
64
64
|
try {
|
|
65
|
-
let
|
|
66
|
-
return a && t.includes("20minutes.fr") ?
|
|
67
|
-
} catch (
|
|
68
|
-
return console.error("Error fetching autocomplete results:",
|
|
65
|
+
let y;
|
|
66
|
+
return a && t.includes("20minutes.fr") ? y = Ft : y = await (await fetch(`${c}${e}${encodeURIComponent(g)}`)).json(), o ? y[o] : y;
|
|
67
|
+
} catch (y) {
|
|
68
|
+
return console.error("Error fetching autocomplete results:", y), [];
|
|
69
69
|
}
|
|
70
|
-
}, f = (g,
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
l instanceof HTMLInputElement && (l.value =
|
|
74
|
-
}), h.appendChild(
|
|
75
|
-
},
|
|
70
|
+
}, f = (g, y) => {
|
|
71
|
+
const x = document.createElement("li");
|
|
72
|
+
x.id = `/${g}`, x.textContent = y, x.addEventListener("click", () => {
|
|
73
|
+
l instanceof HTMLInputElement && (l.value = y, h.classList.add("u-hidden"));
|
|
74
|
+
}), h.appendChild(x);
|
|
75
|
+
}, p = () => {
|
|
76
76
|
d?.classList.toggle("u-hidden");
|
|
77
|
-
},
|
|
77
|
+
}, _ = () => {
|
|
78
78
|
const g = document.createElement("li");
|
|
79
79
|
g.textContent = u, h.appendChild(g);
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
h.innerHTML = "",
|
|
84
|
-
f(
|
|
85
|
-
}),
|
|
86
|
-
},
|
|
80
|
+
}, w = async (g) => {
|
|
81
|
+
p(), h.classList.remove("u-hidden");
|
|
82
|
+
const y = await m(g);
|
|
83
|
+
h.innerHTML = "", y.length === 0 && h.classList.add("u-hidden"), y.forEach((x) => {
|
|
84
|
+
f(x[i], x[n]);
|
|
85
|
+
}), p();
|
|
86
|
+
}, S = (g) => {
|
|
87
87
|
if (!(g.target instanceof HTMLInputElement))
|
|
88
88
|
return;
|
|
89
|
-
const
|
|
90
|
-
h.classList.remove("u-hidden"),
|
|
89
|
+
const y = g.target.value;
|
|
90
|
+
h.classList.remove("u-hidden"), y.length >= 3 ? w(y) : (h.innerHTML = "", _());
|
|
91
91
|
};
|
|
92
|
-
l.addEventListener("input",
|
|
92
|
+
l.addEventListener("input", S), l.addEventListener("focusout", () => {
|
|
93
93
|
setTimeout(() => h.classList.add("u-hidden"), 300);
|
|
94
94
|
}), l.addEventListener("focusin", () => {
|
|
95
95
|
h.childElementCount > 0 && h.classList.remove("u-hidden");
|
|
96
96
|
});
|
|
97
|
-
},
|
|
97
|
+
}, kt = () => {
|
|
98
98
|
const s = document.querySelector(".js-content-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;
|
|
99
99
|
if (s && t && e) {
|
|
100
100
|
const o = new IntersectionObserver(
|
|
@@ -107,7 +107,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
107
107
|
);
|
|
108
108
|
o.observe(s), o.observe(t);
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, Bt = (s) => {
|
|
111
111
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
112
112
|
const t = s.currentTarget;
|
|
113
113
|
if (t instanceof HTMLButtonElement) {
|
|
@@ -116,15 +116,15 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
116
116
|
);
|
|
117
117
|
t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), i?.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), i?.setAttribute("aria-hidden", "false"));
|
|
118
118
|
}
|
|
119
|
-
},
|
|
119
|
+
}, Nt = (s = document.querySelector(
|
|
120
120
|
".js-collapse__button"
|
|
121
121
|
)) => {
|
|
122
122
|
s && document.querySelectorAll(".c-collapse__button").forEach((e) => {
|
|
123
123
|
e.addEventListener("click", (i) => {
|
|
124
|
-
|
|
124
|
+
Bt(i);
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
|
-
},
|
|
127
|
+
}, H = (s, t) => {
|
|
128
128
|
const e = document.querySelector(
|
|
129
129
|
`#${t}`
|
|
130
130
|
);
|
|
@@ -143,17 +143,17 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
143
143
|
if (d <= 0)
|
|
144
144
|
clearInterval(c);
|
|
145
145
|
else {
|
|
146
|
-
const u = Math.floor(d / 864e5),
|
|
147
|
-
i.innerHTML = u.toString(), n.innerHTML =
|
|
146
|
+
const u = Math.floor(d / 864e5), m = Math.floor(d % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), f = Math.floor(d % (1e3 * 60 * 60) / (1e3 * 60)), p = Math.floor(d % (1e3 * 60) / 1e3);
|
|
147
|
+
i.innerHTML = u.toString(), n.innerHTML = m.toString(), o.innerHTML = f.toString(), r.innerHTML = p.toString();
|
|
148
148
|
}
|
|
149
149
|
}, 1e3);
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, Ht = (s) => {
|
|
152
152
|
const t = s.getBBox(), e = t.width / 20;
|
|
153
153
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
154
154
|
" "
|
|
155
155
|
);
|
|
156
|
-
},
|
|
156
|
+
}, Wt = () => {
|
|
157
157
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
158
158
|
if (!s || !t)
|
|
159
159
|
return;
|
|
@@ -165,55 +165,55 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
165
165
|
".c-map-districts-container__unzoom-button"
|
|
166
166
|
);
|
|
167
167
|
let o = t;
|
|
168
|
-
const r = t.getAttribute("viewBox"), a = (f,
|
|
168
|
+
const r = t.getAttribute("viewBox"), a = (f, p) => f.matches?.call(f, p), l = (f, p, _ = ".c-map-districts__zoomable:not(.js-selected-area)") => {
|
|
169
169
|
if (!f)
|
|
170
170
|
return;
|
|
171
|
-
let
|
|
172
|
-
for (;
|
|
173
|
-
a(
|
|
174
|
-
return
|
|
175
|
-
}, c = (f,
|
|
171
|
+
let w, S = f.parentElement;
|
|
172
|
+
for (; S instanceof SVGGraphicsElement && S !== p; )
|
|
173
|
+
a(S, _) && (w = S), S = S.parentElement;
|
|
174
|
+
return w;
|
|
175
|
+
}, c = (f, p, _) => {
|
|
176
176
|
if (!f)
|
|
177
177
|
return;
|
|
178
|
-
let
|
|
179
|
-
for (;
|
|
180
|
-
if (
|
|
178
|
+
let w = f.parentElement;
|
|
179
|
+
for (; w instanceof SVGGraphicsElement && w !== _; ) {
|
|
180
|
+
if (p === w)
|
|
181
181
|
return !0;
|
|
182
|
-
|
|
182
|
+
w = w.parentElement;
|
|
183
183
|
}
|
|
184
|
-
return
|
|
185
|
-
}, h = (f,
|
|
186
|
-
if (
|
|
187
|
-
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i?.classList.add("u-hidden"), n.classList.add("u-hidden"),
|
|
188
|
-
const
|
|
189
|
-
i &&
|
|
184
|
+
return _ === p;
|
|
185
|
+
}, h = (f, p) => {
|
|
186
|
+
if (p && n && e) {
|
|
187
|
+
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i?.classList.add("u-hidden"), n.classList.add("u-hidden"), p !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o = f;
|
|
188
|
+
const _ = o.getAttribute("data-info");
|
|
189
|
+
i && _ && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = _), o.classList.add("js-selected-area"), t.setAttribute("viewBox", p);
|
|
190
190
|
}
|
|
191
191
|
}, d = (f) => {
|
|
192
192
|
f.stopPropagation();
|
|
193
|
-
const
|
|
194
|
-
if (o && t &&
|
|
195
|
-
if (
|
|
193
|
+
const p = f.currentTarget;
|
|
194
|
+
if (o && t && p instanceof SVGGraphicsElement) {
|
|
195
|
+
if (p === o)
|
|
196
196
|
return;
|
|
197
|
-
if (f.preventDefault(), o !== t && !c(
|
|
197
|
+
if (f.preventDefault(), o !== t && !c(p, o, t)) {
|
|
198
198
|
h(t, r);
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
const
|
|
202
|
-
|
|
201
|
+
const _ = l(
|
|
202
|
+
p,
|
|
203
203
|
o
|
|
204
204
|
);
|
|
205
205
|
h(
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
_ || p,
|
|
207
|
+
Ht(_ || p)
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
}, u = () => {
|
|
211
211
|
t && o !== t && h(t, r);
|
|
212
212
|
};
|
|
213
213
|
t.addEventListener("click", u), n && n.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((f) => {
|
|
214
|
-
f.addEventListener("click", (
|
|
214
|
+
f.addEventListener("click", (p) => d(p));
|
|
215
215
|
});
|
|
216
|
-
},
|
|
216
|
+
}, Vt = () => {
|
|
217
217
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
218
218
|
if (!s || !t)
|
|
219
219
|
return;
|
|
@@ -242,52 +242,52 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
242
242
|
}), s.addEventListener("focusin", () => {
|
|
243
243
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
244
244
|
});
|
|
245
|
-
},
|
|
245
|
+
}, jt = (s, t) => {
|
|
246
246
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => n.classList.remove(t));
|
|
247
247
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
248
248
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
249
|
-
},
|
|
249
|
+
}, Gt = (s, t) => {
|
|
250
250
|
s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => n.classList.add(t)), s.setAttribute("aria-expanded", "false");
|
|
251
251
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
252
252
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir plus");
|
|
253
|
-
},
|
|
253
|
+
}, Ut = (s, t) => {
|
|
254
254
|
const e = s.currentTarget;
|
|
255
255
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
256
256
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
257
|
-
return e.getAttribute("aria-expanded") === "true" ?
|
|
257
|
+
return e.getAttribute("aria-expanded") === "true" ? Gt(e, i) : jt(e, i);
|
|
258
258
|
}
|
|
259
259
|
return null;
|
|
260
|
-
},
|
|
260
|
+
}, Kt = (s = document.querySelector(
|
|
261
261
|
".js-ellipsis-button"
|
|
262
262
|
)) => {
|
|
263
263
|
s && document.querySelectorAll(".js-ellipsis-button").forEach((e) => {
|
|
264
264
|
const i = e.getAttribute("data-multiple") === "true";
|
|
265
|
-
e.addEventListener("click", (n) =>
|
|
265
|
+
e.addEventListener("click", (n) => Ut(n, i));
|
|
266
266
|
});
|
|
267
|
-
},
|
|
267
|
+
}, Xt = (s) => {
|
|
268
268
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => i.setAttribute("aria-hidden", "false"));
|
|
269
269
|
const e = s.querySelector(".js-expand-button__label");
|
|
270
270
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir moins");
|
|
271
|
-
},
|
|
271
|
+
}, Yt = (s) => {
|
|
272
272
|
s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => i.setAttribute("aria-hidden", "true")), s.setAttribute("aria-expanded", "false");
|
|
273
273
|
const e = s.querySelector(".js-expand-button__label");
|
|
274
274
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir plus");
|
|
275
|
-
},
|
|
275
|
+
}, Qt = (s) => {
|
|
276
276
|
const t = s.currentTarget;
|
|
277
|
-
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ?
|
|
278
|
-
},
|
|
277
|
+
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? Yt(t) : Xt(t) : null;
|
|
278
|
+
}, Jt = (s) => {
|
|
279
279
|
const t = s.parentNode?.querySelector(".js-expand-target");
|
|
280
|
-
return t ? (t.textContent?.trim().length ?? 0) < 120
|
|
281
|
-
},
|
|
280
|
+
return !t || t.classList.contains("c-elections-result__members") ? !1 : (t.textContent?.trim().length ?? 0) < 120;
|
|
281
|
+
}, te = (s = document.querySelector(
|
|
282
282
|
".js-expand-button"
|
|
283
283
|
)) => {
|
|
284
284
|
s && document.querySelectorAll(".js-expand-button").forEach((e) => {
|
|
285
|
-
|
|
285
|
+
Jt(e) ? (e.style.display = "none", e.parentNode?.querySelectorAll(".js-expand-target")?.forEach((n) => n.setAttribute("aria-hidden", "false"))) : e.addEventListener("click", Qt);
|
|
286
286
|
});
|
|
287
|
-
},
|
|
287
|
+
}, ee = () => {
|
|
288
288
|
const s = document.querySelector(".js-game-alert");
|
|
289
|
-
|
|
290
|
-
},
|
|
289
|
+
Mt && s && s.classList.remove("u-hidden");
|
|
290
|
+
}, ie = () => {
|
|
291
291
|
const s = document.querySelectorAll(".js-half-donut-result");
|
|
292
292
|
for (const t of Array.from(s)) {
|
|
293
293
|
const e = t.querySelector(".c-half-donut"), i = t.querySelector(".c-legend");
|
|
@@ -306,7 +306,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
|
-
},
|
|
309
|
+
}, se = () => {
|
|
310
310
|
const s = document.querySelector(".c-image-slider__container");
|
|
311
311
|
if (!s)
|
|
312
312
|
return () => {
|
|
@@ -314,15 +314,15 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
314
314
|
const t = document.querySelectorAll(".c-image-slider__slide"), e = document.querySelector(".c-image-slider__button-container--previous"), i = document.querySelector(".c-image-slider__button-container--next"), n = document.querySelectorAll(".c-image-slider__indicator");
|
|
315
315
|
let o = 0, r = null, a = !1;
|
|
316
316
|
const l = () => {
|
|
317
|
-
n.forEach((g,
|
|
318
|
-
g.classList.toggle("c-image-slider__indicator--is-active",
|
|
317
|
+
n.forEach((g, y) => {
|
|
318
|
+
g.classList.toggle("c-image-slider__indicator--is-active", y === o);
|
|
319
319
|
});
|
|
320
320
|
}, c = (g = !0) => {
|
|
321
321
|
if (!(s instanceof HTMLElement))
|
|
322
322
|
return;
|
|
323
323
|
s.style.transition = g ? "transform 0.3s ease" : "none";
|
|
324
|
-
const
|
|
325
|
-
s.style.transform = `translateX(${
|
|
324
|
+
const y = -o * 100;
|
|
325
|
+
s.style.transform = `translateX(${y}%)`, l();
|
|
326
326
|
}, h = (g) => {
|
|
327
327
|
o = g, c(!0);
|
|
328
328
|
}, d = () => {
|
|
@@ -334,55 +334,55 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
334
334
|
}, 4e3);
|
|
335
335
|
}, u = () => {
|
|
336
336
|
r && (clearInterval(r), r = null);
|
|
337
|
-
},
|
|
337
|
+
}, m = () => {
|
|
338
338
|
a = !0, u();
|
|
339
339
|
}, f = () => {
|
|
340
340
|
a = !1, d();
|
|
341
341
|
};
|
|
342
342
|
e?.addEventListener("click", () => {
|
|
343
|
-
|
|
343
|
+
m();
|
|
344
344
|
const g = (o - 1 + t.length) % t.length;
|
|
345
345
|
h(g), setTimeout(f, 5e3);
|
|
346
346
|
}), i?.addEventListener("click", () => {
|
|
347
|
-
|
|
347
|
+
m();
|
|
348
348
|
const g = (o + 1) % t.length;
|
|
349
349
|
h(g), setTimeout(f, 5e3);
|
|
350
|
-
}), n.forEach((g,
|
|
350
|
+
}), n.forEach((g, y) => {
|
|
351
351
|
g.addEventListener("click", () => {
|
|
352
|
-
|
|
352
|
+
m(), h(y), setTimeout(f, 5e3);
|
|
353
353
|
});
|
|
354
354
|
});
|
|
355
|
-
let
|
|
355
|
+
let p = 0, _ = 0, w = !1;
|
|
356
356
|
return s.addEventListener("touchstart", (g) => {
|
|
357
|
-
s instanceof HTMLElement && (
|
|
357
|
+
s instanceof HTMLElement && (m(), p = g.touches[0].clientX, _ = p, w = !0, s.style.transition = "none");
|
|
358
358
|
}), s.addEventListener("touchmove", (g) => {
|
|
359
359
|
if (!(s instanceof HTMLElement))
|
|
360
360
|
return;
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
s.style.transform = `translateX(${
|
|
361
|
+
_ = g.touches[0].clientX;
|
|
362
|
+
const y = _ - p, x = -o * window.innerWidth + y;
|
|
363
|
+
s.style.transform = `translateX(${x}px)`;
|
|
364
364
|
}), s.addEventListener("touchend", () => {
|
|
365
|
-
if (!
|
|
365
|
+
if (!w)
|
|
366
366
|
return;
|
|
367
|
-
|
|
368
|
-
const g =
|
|
367
|
+
w = !1;
|
|
368
|
+
const g = _ - p;
|
|
369
369
|
Math.abs(g) > 75 && (g < 0 ? o = Math.min(o + 1, t.length - 1) : g > 0 && (o = Math.max(o - 1, 0))), c(!0), setTimeout(f, 5e3);
|
|
370
370
|
}), c(!0), d(), () => {
|
|
371
371
|
u();
|
|
372
372
|
};
|
|
373
|
-
},
|
|
373
|
+
}, ne = (s) => {
|
|
374
374
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
375
375
|
const t = s.currentTarget, e = document.getElementById("info-button-content");
|
|
376
376
|
!(t instanceof HTMLButtonElement) || !e || (t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), e.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), e.setAttribute("aria-hidden", "false")));
|
|
377
|
-
},
|
|
377
|
+
}, oe = () => {
|
|
378
378
|
const s = document.querySelector(".js-info-banner__button");
|
|
379
|
-
s instanceof HTMLButtonElement && s.addEventListener("click",
|
|
379
|
+
s instanceof HTMLButtonElement && s.addEventListener("click", ne);
|
|
380
380
|
}, v = {
|
|
381
381
|
inert: ":not([inert]):not([inert] *)",
|
|
382
382
|
negTabIndex: ':not([tabindex^="-"])',
|
|
383
383
|
disabled: ":not(:disabled)"
|
|
384
384
|
};
|
|
385
|
-
var
|
|
385
|
+
var re = [
|
|
386
386
|
`a[href]${v.inert}${v.negTabIndex}`,
|
|
387
387
|
`area[href]${v.inert}${v.negTabIndex}`,
|
|
388
388
|
`input:not([type="hidden"]):not([type="radio"])${v.inert}${v.negTabIndex}${v.disabled}`,
|
|
@@ -400,24 +400,24 @@ var se = [
|
|
|
400
400
|
`[contenteditable]${v.inert}${v.negTabIndex}`,
|
|
401
401
|
`[tabindex]${v.inert}${v.negTabIndex}`
|
|
402
402
|
];
|
|
403
|
-
function
|
|
403
|
+
function Q(s) {
|
|
404
404
|
(s.querySelector("[autofocus]") || s).focus();
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function ae(s) {
|
|
407
407
|
const t = $(s, !0), e = t ? $(s, !1) || t : null;
|
|
408
408
|
return [t, e];
|
|
409
409
|
}
|
|
410
410
|
function $(s, t) {
|
|
411
|
-
if (t &&
|
|
411
|
+
if (t && et(s))
|
|
412
412
|
return s;
|
|
413
|
-
if (
|
|
413
|
+
if (ce(s))
|
|
414
414
|
if (s.shadowRoot) {
|
|
415
|
-
let e =
|
|
415
|
+
let e = J(s.shadowRoot, t);
|
|
416
416
|
for (; e; ) {
|
|
417
417
|
const i = $(e, t);
|
|
418
418
|
if (i)
|
|
419
419
|
return i;
|
|
420
|
-
e =
|
|
420
|
+
e = tt(e, t);
|
|
421
421
|
}
|
|
422
422
|
} else if (s.localName === "slot") {
|
|
423
423
|
const e = s.assignedElements({
|
|
@@ -430,32 +430,32 @@ function $(s, t) {
|
|
|
430
430
|
return n;
|
|
431
431
|
}
|
|
432
432
|
} else {
|
|
433
|
-
let e =
|
|
433
|
+
let e = J(s, t);
|
|
434
434
|
for (; e; ) {
|
|
435
435
|
const i = $(e, t);
|
|
436
436
|
if (i)
|
|
437
437
|
return i;
|
|
438
|
-
e =
|
|
438
|
+
e = tt(e, t);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
return !t &&
|
|
441
|
+
return !t && et(s) ? s : null;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function J(s, t) {
|
|
444
444
|
return t ? s.firstElementChild : s.lastElementChild;
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function tt(s, t) {
|
|
447
447
|
return t ? s.nextElementSibling : s.previousElementSibling;
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
function
|
|
449
|
+
const le = (s) => s.matches("details:not([open]) *") && !s.matches("details>summary:first-of-type") ? !0 : !(s.offsetWidth || s.offsetHeight || s.getClientRects().length), et = (s) => s.shadowRoot?.delegatesFocus ? !1 : s.matches(re.join(",")) && !le(s);
|
|
450
|
+
function ce(s) {
|
|
451
451
|
return s.shadowRoot && s.getAttribute("tabindex") === "-1" ? !1 : !s.matches(":disabled,[hidden],[inert]");
|
|
452
452
|
}
|
|
453
453
|
function R(s = document) {
|
|
454
454
|
const t = s.activeElement;
|
|
455
455
|
return t ? t.shadowRoot ? R(t.shadowRoot) || document.activeElement : t : null;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
const [e, i] =
|
|
457
|
+
function he(s, t) {
|
|
458
|
+
const [e, i] = ae(s);
|
|
459
459
|
if (!e)
|
|
460
460
|
return t.preventDefault();
|
|
461
461
|
const n = R();
|
|
@@ -465,16 +465,16 @@ function T(s, t) {
|
|
|
465
465
|
function e(i) {
|
|
466
466
|
if (!i || i === document || i === window)
|
|
467
467
|
return null;
|
|
468
|
-
const n =
|
|
468
|
+
const n = vt(i);
|
|
469
469
|
return n && (i = n), i.closest(s) || e(i.getRootNode().host);
|
|
470
470
|
}
|
|
471
471
|
return e(t);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
return s.assignedSlot || (s.parentNode ?
|
|
473
|
+
function vt(s) {
|
|
474
|
+
return s.assignedSlot || (s.parentNode ? vt(s.parentNode) : null);
|
|
475
475
|
}
|
|
476
476
|
const C = "data-a11y-dialog";
|
|
477
|
-
class
|
|
477
|
+
class _t {
|
|
478
478
|
$el;
|
|
479
479
|
id;
|
|
480
480
|
previouslyFocused;
|
|
@@ -523,7 +523,7 @@ class gt {
|
|
|
523
523
|
* Returns the instance to allow method chaining.
|
|
524
524
|
*/
|
|
525
525
|
show(t) {
|
|
526
|
-
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = R(), this.previouslyFocused?.tagName === "BODY" && t?.target && (this.previouslyFocused = t.target), t?.type === "focus" ? this.maintainFocus() :
|
|
526
|
+
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = R(), this.previouslyFocused?.tagName === "BODY" && t?.target && (this.previouslyFocused = t.target), t?.type === "focus" ? this.maintainFocus() : Q(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this);
|
|
527
527
|
}
|
|
528
528
|
/**
|
|
529
529
|
* Hide the dialog.
|
|
@@ -586,7 +586,7 @@ class gt {
|
|
|
586
586
|
e = !!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open');
|
|
587
587
|
} catch {
|
|
588
588
|
}
|
|
589
|
-
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" &&
|
|
589
|
+
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" && he(this.$el, t);
|
|
590
590
|
}
|
|
591
591
|
/**
|
|
592
592
|
* If the dialog is shown and the focus is not within a dialog element (either
|
|
@@ -596,18 +596,18 @@ class gt {
|
|
|
596
596
|
*/
|
|
597
597
|
maintainFocus() {
|
|
598
598
|
const t = R();
|
|
599
|
-
T(`[aria-modal="true"], [${C}-ignore-focus-trap]`, t) ||
|
|
599
|
+
T(`[aria-modal="true"], [${C}-ignore-focus-trap]`, t) || Q(this.$el);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function it() {
|
|
603
603
|
for (const s of document.querySelectorAll("[data-a11y-dialog]"))
|
|
604
|
-
new
|
|
604
|
+
new _t(s);
|
|
605
605
|
}
|
|
606
|
-
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
607
|
-
const
|
|
606
|
+
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", it) : it());
|
|
607
|
+
const de = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
608
608
|
if (!(s instanceof HTMLElement))
|
|
609
609
|
return;
|
|
610
|
-
const t = new
|
|
610
|
+
const t = new _t(s);
|
|
611
611
|
if (s.id === "dialog-menu") {
|
|
612
612
|
const e = document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"), i = document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");
|
|
613
613
|
e.length > 0 && i.length > 0 && (t.on("show", () => {
|
|
@@ -621,28 +621,28 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
621
621
|
}).on("hide", () => {
|
|
622
622
|
document.body.classList.remove("noscroll");
|
|
623
623
|
});
|
|
624
|
-
}),
|
|
624
|
+
}), yt = "68px", wt = "50px", Y = ({
|
|
625
625
|
navigationContainer: s,
|
|
626
626
|
navigatedList: t,
|
|
627
627
|
nextBtn: e,
|
|
628
628
|
prevBtn: i
|
|
629
629
|
}) => {
|
|
630
|
-
const n = s.classList.contains("c-breadcrumb--is-small") ?
|
|
630
|
+
const n = s.classList.contains("c-breadcrumb--is-small") ? wt : yt;
|
|
631
631
|
e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (s.style.paddingRight = n, s.style.paddingLeft = ""), i.classList.contains("o-nav-button--visible") && (s.style.paddingLeft = n, e.classList.contains("o-nav-button--visible") && (s.style.paddingRight = n), e.classList.contains("o-nav-button--visible") || (s.style.paddingRight = "")), !e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (t.style.width = "", s.style.paddingRight = "");
|
|
632
|
-
},
|
|
632
|
+
}, ue = ({
|
|
633
633
|
navigationContainer: s,
|
|
634
634
|
navigatedList: t,
|
|
635
635
|
nextBtn: e,
|
|
636
636
|
prevBtn: i
|
|
637
637
|
}) => {
|
|
638
638
|
const n = t.scrollLeft > 0, o = t.scrollLeft + (t.clientWidth + 0.5) < t.scrollWidth;
|
|
639
|
-
n && o ? (e.classList?.add("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : n ? (e.classList?.remove("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : o ? (e.classList?.add("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")) : (e.classList?.remove("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")), e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
639
|
+
n && o ? (e.classList?.add("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : n ? (e.classList?.remove("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : o ? (e.classList?.add("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")) : (e.classList?.remove("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")), e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && Y({
|
|
640
640
|
navigationContainer: s,
|
|
641
641
|
navigatedList: t,
|
|
642
642
|
nextBtn: e,
|
|
643
643
|
prevBtn: i
|
|
644
644
|
});
|
|
645
|
-
},
|
|
645
|
+
}, pe = ({
|
|
646
646
|
navigationContainer: s,
|
|
647
647
|
navigatedList: t,
|
|
648
648
|
nextBtn: e,
|
|
@@ -687,14 +687,14 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
687
687
|
behavior: "smooth"
|
|
688
688
|
}), e.classList.remove("o-nav-button--visible"), i.classList.add("o-nav-button--visible");
|
|
689
689
|
}
|
|
690
|
-
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
690
|
+
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && Y({
|
|
691
691
|
navigationContainer: s,
|
|
692
692
|
navigatedList: t,
|
|
693
693
|
nextBtn: e,
|
|
694
694
|
prevBtn: i
|
|
695
695
|
});
|
|
696
696
|
}
|
|
697
|
-
},
|
|
697
|
+
}, me = ({
|
|
698
698
|
navigationContainer: s,
|
|
699
699
|
navigatedList: t,
|
|
700
700
|
nextBtn: e,
|
|
@@ -735,26 +735,26 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
735
735
|
left: 0,
|
|
736
736
|
behavior: "smooth"
|
|
737
737
|
}), i.classList.remove("o-nav-button--visible"), t.clientWidth < t.scrollWidth && e.classList.add("o-nav-button--visible");
|
|
738
|
-
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
738
|
+
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && Y({
|
|
739
739
|
navigationContainer: s,
|
|
740
740
|
navigatedList: t,
|
|
741
741
|
nextBtn: e,
|
|
742
742
|
prevBtn: i
|
|
743
743
|
});
|
|
744
744
|
}
|
|
745
|
-
},
|
|
745
|
+
}, fe = ({
|
|
746
746
|
navigationContainer: s,
|
|
747
747
|
navigatedList: t,
|
|
748
748
|
nextBtn: e,
|
|
749
749
|
prevBtn: i
|
|
750
750
|
}) => {
|
|
751
|
-
|
|
751
|
+
ue({
|
|
752
752
|
navigationContainer: s,
|
|
753
753
|
navigatedList: t,
|
|
754
754
|
nextBtn: e,
|
|
755
755
|
prevBtn: i
|
|
756
756
|
});
|
|
757
|
-
},
|
|
757
|
+
}, ge = (s) => {
|
|
758
758
|
const { sliderVariant: t } = s.dataset, { sliderAuto: e } = s.dataset, { sliderDelay: i } = s.dataset, n = i ? parseInt(i, 10) : 3e3, r = s.closest(".js-overview-bar-container")?.querySelector(".c-stepper"), a = r?.querySelectorAll(".c-stepper__item"), l = s.querySelector(
|
|
759
759
|
".js-navigation-container__list"
|
|
760
760
|
), c = s.querySelector(".o-nav-button--next-button"), h = s.querySelector(
|
|
@@ -762,12 +762,12 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
762
762
|
);
|
|
763
763
|
if (!(!l || !c || !h)) {
|
|
764
764
|
if (l.clientWidth < l.scrollWidth && (c.classList.add("o-nav-button--visible"), c.classList.contains("c-slider__button-container--has-space-around"))) {
|
|
765
|
-
const d = s.classList.contains("c-breadcrumb--is-small") ?
|
|
765
|
+
const d = s.classList.contains("c-breadcrumb--is-small") ? wt : yt;
|
|
766
766
|
s.style.paddingRight = d;
|
|
767
767
|
}
|
|
768
768
|
if (c.addEventListener(
|
|
769
769
|
"click",
|
|
770
|
-
|
|
770
|
+
pe.bind(!1, {
|
|
771
771
|
navigationContainer: s,
|
|
772
772
|
navigatedList: l,
|
|
773
773
|
nextBtn: c,
|
|
@@ -776,7 +776,7 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
776
776
|
})
|
|
777
777
|
), h.addEventListener(
|
|
778
778
|
"click",
|
|
779
|
-
|
|
779
|
+
me.bind(!1, {
|
|
780
780
|
navigationContainer: s,
|
|
781
781
|
navigatedList: l,
|
|
782
782
|
nextBtn: c,
|
|
@@ -787,13 +787,13 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
787
787
|
), e === "true") {
|
|
788
788
|
const d = r ? r.querySelector(".c-stepper__item--loading") : null;
|
|
789
789
|
a && (a.forEach((u) => {
|
|
790
|
-
const
|
|
791
|
-
|
|
790
|
+
const m = u.querySelector(".c-stepper__loader");
|
|
791
|
+
m && m instanceof HTMLElement && (m.style.transition = `width ${n / 1e3}s linear`);
|
|
792
792
|
}), d || a[0].classList.add("c-stepper__item--loading")), setInterval(() => {
|
|
793
793
|
c.classList.contains("o-nav-button--visible") ? c.click() : l && h && (l.scrollLeft = 0, a && (a.forEach((u) => {
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
794
|
+
const m = u.querySelector(".c-stepper__loader");
|
|
795
|
+
m && m instanceof HTMLElement && (m.style.transition = "width 0s linear"), u.classList.remove("c-stepper__item--loading"), u.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
|
|
796
|
+
m && m instanceof HTMLElement && (m.style.transition = `width ${n / 1e3}s linear`);
|
|
797
797
|
}, 0);
|
|
798
798
|
}), setTimeout(() => {
|
|
799
799
|
a[0].classList.add("c-stepper__item--loading");
|
|
@@ -801,7 +801,7 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
801
801
|
}, n);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
},
|
|
804
|
+
}, ve = () => {
|
|
805
805
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
806
806
|
Array.from(s).forEach((t) => {
|
|
807
807
|
const e = t.querySelector(
|
|
@@ -811,13 +811,13 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
811
811
|
const i = new ResizeObserver((n) => {
|
|
812
812
|
n.forEach((o) => {
|
|
813
813
|
const { width: r } = o.contentRect;
|
|
814
|
-
r > 0 && (
|
|
814
|
+
r > 0 && (ge(t), i.disconnect());
|
|
815
815
|
});
|
|
816
816
|
});
|
|
817
817
|
i.observe(e);
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
|
-
},
|
|
820
|
+
}, _e = () => {
|
|
821
821
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
822
822
|
for (const t of Array.from(s))
|
|
823
823
|
if (t) {
|
|
@@ -830,7 +830,7 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
830
830
|
);
|
|
831
831
|
e && i && n && window.addEventListener(
|
|
832
832
|
"resize",
|
|
833
|
-
|
|
833
|
+
fe.bind(!1, {
|
|
834
834
|
navigationContainer: t,
|
|
835
835
|
navigatedList: e,
|
|
836
836
|
nextBtn: i,
|
|
@@ -839,59 +839,59 @@ const le = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
841
|
};
|
|
842
|
-
function
|
|
842
|
+
function L(s, t, e) {
|
|
843
843
|
const i = document.createElement(t);
|
|
844
844
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function b(s, t) {
|
|
847
847
|
return s.x = t.x, s.y = t.y, t.id !== void 0 && (s.id = t.id), s;
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function bt(s) {
|
|
850
850
|
s.x = Math.round(s.x), s.y = Math.round(s.y);
|
|
851
851
|
}
|
|
852
852
|
function V(s, t) {
|
|
853
853
|
const e = Math.abs(s.x - t.x), i = Math.abs(s.y - t.y);
|
|
854
854
|
return Math.sqrt(e * e + i * i);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function Z(s, t) {
|
|
857
857
|
return s.x === t.x && s.y === t.y;
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function q(s, t, e) {
|
|
860
860
|
return Math.min(Math.max(s, t), e);
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function F(s, t, e) {
|
|
863
863
|
let i = `translate3d(${s}px,${t || 0}px,0)`;
|
|
864
864
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
865
865
|
}
|
|
866
866
|
function I(s, t, e, i) {
|
|
867
|
-
s.style.transform =
|
|
867
|
+
s.style.transform = F(t, e, i);
|
|
868
868
|
}
|
|
869
|
-
const
|
|
870
|
-
function
|
|
871
|
-
s.style.transition = t ? `${t} ${e}ms ${i ||
|
|
869
|
+
const ye = "cubic-bezier(.4,0,.22,1)";
|
|
870
|
+
function St(s, t, e, i) {
|
|
871
|
+
s.style.transition = t ? `${t} ${e}ms ${i || ye}` : "none";
|
|
872
872
|
}
|
|
873
873
|
function j(s, t, e) {
|
|
874
874
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
877
|
-
|
|
876
|
+
function we(s) {
|
|
877
|
+
St(s);
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function be(s) {
|
|
880
880
|
return "decode" in s ? s.decode().catch(() => {
|
|
881
881
|
}) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
|
|
882
882
|
s.onload = () => t(s), s.onerror = e;
|
|
883
883
|
});
|
|
884
884
|
}
|
|
885
|
-
const
|
|
885
|
+
const E = {
|
|
886
886
|
IDLE: "idle",
|
|
887
887
|
LOADING: "loading",
|
|
888
888
|
LOADED: "loaded",
|
|
889
889
|
ERROR: "error"
|
|
890
890
|
};
|
|
891
|
-
function
|
|
891
|
+
function Se(s) {
|
|
892
892
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function Le(s, t, e = document) {
|
|
895
895
|
let i = [];
|
|
896
896
|
if (s instanceof Element)
|
|
897
897
|
i = [s];
|
|
@@ -903,19 +903,19 @@ function we(s, t, e = document) {
|
|
|
903
903
|
}
|
|
904
904
|
return i;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function st() {
|
|
907
907
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
908
908
|
}
|
|
909
|
-
let
|
|
909
|
+
let Lt = !1;
|
|
910
910
|
try {
|
|
911
911
|
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
912
912
|
get: () => {
|
|
913
|
-
|
|
913
|
+
Lt = !0;
|
|
914
914
|
}
|
|
915
915
|
}));
|
|
916
916
|
} catch {
|
|
917
917
|
}
|
|
918
|
-
class
|
|
918
|
+
class Ee {
|
|
919
919
|
constructor() {
|
|
920
920
|
this._pool = [];
|
|
921
921
|
}
|
|
@@ -972,7 +972,7 @@ class be {
|
|
|
972
972
|
listener: i,
|
|
973
973
|
passive: n
|
|
974
974
|
}));
|
|
975
|
-
const h =
|
|
975
|
+
const h = Lt ? {
|
|
976
976
|
passive: n || !1
|
|
977
977
|
} : !1;
|
|
978
978
|
t[a](c, i, h);
|
|
@@ -980,7 +980,7 @@ class be {
|
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Et(s, t) {
|
|
984
984
|
if (s.getViewportSizeFn) {
|
|
985
985
|
const e = s.getViewportSizeFn(s, t);
|
|
986
986
|
if (e)
|
|
@@ -1007,13 +1007,13 @@ function O(s, t, e, i, n) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
return Number(o) || 0;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function At(s, t, e, i) {
|
|
1011
1011
|
return {
|
|
1012
1012
|
x: t.x - O("left", s, t, e, i) - O("right", s, t, e, i),
|
|
1013
1013
|
y: t.y - O("top", s, t, e, i) - O("bottom", s, t, e, i)
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
|
-
class
|
|
1016
|
+
class Ae {
|
|
1017
1017
|
/**
|
|
1018
1018
|
* @param {Slide} slide
|
|
1019
1019
|
*/
|
|
@@ -1065,11 +1065,11 @@ class Se {
|
|
|
1065
1065
|
* @returns {number}
|
|
1066
1066
|
*/
|
|
1067
1067
|
correctPan(t, e) {
|
|
1068
|
-
return
|
|
1068
|
+
return q(e, this.max[t], this.min[t]);
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
const
|
|
1072
|
-
let
|
|
1071
|
+
const nt = 4e3;
|
|
1072
|
+
let xt = class {
|
|
1073
1073
|
/**
|
|
1074
1074
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
1075
1075
|
* @param {SlideData} itemData Slide data
|
|
@@ -1126,7 +1126,7 @@ let Et = class {
|
|
|
1126
1126
|
*/
|
|
1127
1127
|
_getSecondary() {
|
|
1128
1128
|
let t = this._parseZoomLevelOption("secondary");
|
|
1129
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
1129
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > nt && (t = nt / this.elementSize.x), t);
|
|
1130
1130
|
}
|
|
1131
1131
|
/**
|
|
1132
1132
|
* Get initial image zoom level.
|
|
@@ -1149,7 +1149,7 @@ let Et = class {
|
|
|
1149
1149
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
|
-
class
|
|
1152
|
+
class xe {
|
|
1153
1153
|
/**
|
|
1154
1154
|
* @param {SlideData} data
|
|
1155
1155
|
* @param {number} index
|
|
@@ -1162,11 +1162,11 @@ class Le {
|
|
|
1162
1162
|
}, this.pan = {
|
|
1163
1163
|
x: 0,
|
|
1164
1164
|
y: 0
|
|
1165
|
-
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new
|
|
1165
|
+
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new xt(i.options, t, e, i), this.pswp.dispatch("gettingData", {
|
|
1166
1166
|
slide: this,
|
|
1167
1167
|
data: this.data,
|
|
1168
1168
|
index: e
|
|
1169
|
-
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container =
|
|
1169
|
+
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = L("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 Ae(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1170
1170
|
slide: this
|
|
1171
1171
|
});
|
|
1172
1172
|
}
|
|
@@ -1290,7 +1290,7 @@ class Le {
|
|
|
1290
1290
|
transitionDuration: i
|
|
1291
1291
|
}), o.animations.stopAllPan();
|
|
1292
1292
|
const r = this.currZoomLevel;
|
|
1293
|
-
n || (t =
|
|
1293
|
+
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), bt(this.pan);
|
|
1294
1294
|
const a = () => {
|
|
1295
1295
|
this._setResolution(t), this.applyCurrentZoomPan();
|
|
1296
1296
|
};
|
|
@@ -1372,7 +1372,7 @@ class Le {
|
|
|
1372
1372
|
});
|
|
1373
1373
|
}
|
|
1374
1374
|
zoomAndPanToInitial() {
|
|
1375
|
-
this.currZoomLevel = this.zoomLevels.initial, this.bounds.update(this.currZoomLevel),
|
|
1375
|
+
this.currZoomLevel = this.zoomLevels.initial, this.bounds.update(this.currZoomLevel), b(this.pan, this.bounds.center), this.pswp.dispatch("initialZoomPan", {
|
|
1376
1376
|
slide: this
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
@@ -1391,14 +1391,14 @@ class Le {
|
|
|
1391
1391
|
const {
|
|
1392
1392
|
pswp: t
|
|
1393
1393
|
} = this;
|
|
1394
|
-
|
|
1394
|
+
b(this.panAreaSize, At(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {
|
|
1395
1395
|
slide: this
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
1398
|
/** @returns {string} */
|
|
1399
1399
|
getCurrentTransform() {
|
|
1400
1400
|
const t = this.currZoomLevel / (this.currentResolution || this.zoomLevels.initial);
|
|
1401
|
-
return
|
|
1401
|
+
return F(this.pan.x, this.pan.y, t);
|
|
1402
1402
|
}
|
|
1403
1403
|
/**
|
|
1404
1404
|
* Set resolution and re-render the image.
|
|
@@ -1419,11 +1419,11 @@ class Le {
|
|
|
1419
1419
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1420
1420
|
}
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1423
|
-
function
|
|
1422
|
+
const Pe = 0.35, Ie = 0.6, ot = 0.4, rt = 0.5;
|
|
1423
|
+
function Te(s, t) {
|
|
1424
1424
|
return s * t / (1 - t);
|
|
1425
1425
|
}
|
|
1426
|
-
class
|
|
1426
|
+
class Ce {
|
|
1427
1427
|
/**
|
|
1428
1428
|
* @param {Gestures} gestures
|
|
1429
1429
|
*/
|
|
@@ -1434,7 +1434,7 @@ class Pe {
|
|
|
1434
1434
|
};
|
|
1435
1435
|
}
|
|
1436
1436
|
start() {
|
|
1437
|
-
this.pswp.currSlide &&
|
|
1437
|
+
this.pswp.currSlide && b(this.startPan, this.pswp.currSlide.pan), this.pswp.animations.stopAll();
|
|
1438
1438
|
}
|
|
1439
1439
|
change() {
|
|
1440
1440
|
const {
|
|
@@ -1449,12 +1449,12 @@ class Pe {
|
|
|
1449
1449
|
if (!this.pswp.dispatch("verticalDrag", {
|
|
1450
1450
|
panY: o
|
|
1451
1451
|
}).defaultPrevented) {
|
|
1452
|
-
this._setPanWithFriction("y", o,
|
|
1452
|
+
this._setPanWithFriction("y", o, Ie);
|
|
1453
1453
|
const r = 1 - Math.abs(this._getVerticalDragRatio(n.pan.y));
|
|
1454
1454
|
this.pswp.applyBgOpacity(r), n.applyCurrentZoomPan();
|
|
1455
1455
|
}
|
|
1456
1456
|
} else
|
|
1457
|
-
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (
|
|
1457
|
+
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (bt(n.pan), n.applyCurrentZoomPan()));
|
|
1458
1458
|
}
|
|
1459
1459
|
end() {
|
|
1460
1460
|
const {
|
|
@@ -1466,7 +1466,7 @@ class Pe {
|
|
|
1466
1466
|
let n = 0;
|
|
1467
1467
|
if (this.pswp.animations.stopAll(), e.isShifted()) {
|
|
1468
1468
|
const r = (e.x - e.getCurrSlideX()) / this.pswp.viewportSize.x;
|
|
1469
|
-
t.x < -
|
|
1469
|
+
t.x < -rt && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x > rt && r > 0 || t.x > -0.1 && r > 0.5) && (n = -1, t.x = Math.max(t.x, 0)), e.moveIndexBy(n, !0, t.x);
|
|
1470
1470
|
}
|
|
1471
1471
|
i && i.currZoomLevel > i.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this._finishPanGestureForAxis("x"), this._finishPanGestureForAxis("y"));
|
|
1472
1472
|
}
|
|
@@ -1485,10 +1485,10 @@ class Pe {
|
|
|
1485
1485
|
const {
|
|
1486
1486
|
pan: n,
|
|
1487
1487
|
bounds: o
|
|
1488
|
-
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r +
|
|
1488
|
+
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r + Te(e[t], 0.995);
|
|
1489
1489
|
if (a) {
|
|
1490
|
-
const f = this._getVerticalDragRatio(r),
|
|
1491
|
-
if (f < 0 &&
|
|
1490
|
+
const f = this._getVerticalDragRatio(r), p = this._getVerticalDragRatio(c);
|
|
1491
|
+
if (f < 0 && p < -ot || f > 0 && p > ot) {
|
|
1492
1492
|
this.pswp.close();
|
|
1493
1493
|
return;
|
|
1494
1494
|
}
|
|
@@ -1496,7 +1496,7 @@ class Pe {
|
|
|
1496
1496
|
const h = o.correctPan(t, c);
|
|
1497
1497
|
if (r === h)
|
|
1498
1498
|
return;
|
|
1499
|
-
const d = h === c ? 1 : 0.82, u = this.pswp.bgOpacity,
|
|
1499
|
+
const d = h === c ? 1 : 0.82, u = this.pswp.bgOpacity, m = h - r;
|
|
1500
1500
|
this.pswp.animations.startSpring({
|
|
1501
1501
|
name: "panGesture" + t,
|
|
1502
1502
|
isPan: !0,
|
|
@@ -1506,8 +1506,8 @@ class Pe {
|
|
|
1506
1506
|
dampingRatio: d,
|
|
1507
1507
|
onUpdate: (f) => {
|
|
1508
1508
|
if (a && this.pswp.bgOpacity < 1) {
|
|
1509
|
-
const
|
|
1510
|
-
this.pswp.applyBgOpacity(
|
|
1509
|
+
const p = 1 - (h - f) / m;
|
|
1510
|
+
this.pswp.applyBgOpacity(q(u + (1 - u) * p, 0, 1));
|
|
1511
1511
|
}
|
|
1512
1512
|
n[t] = Math.floor(f), i.applyCurrentZoomPan();
|
|
1513
1513
|
}
|
|
@@ -1541,19 +1541,19 @@ class Pe {
|
|
|
1541
1541
|
bounds: h
|
|
1542
1542
|
} = r, d = r.pan[t] + l;
|
|
1543
1543
|
if (this.pswp.options.allowPanToNext && i === "x" && t === "x" && !o) {
|
|
1544
|
-
const u = a.getCurrSlideX(),
|
|
1544
|
+
const u = a.getCurrSlideX(), m = a.x - u, f = l > 0, p = !f;
|
|
1545
1545
|
if (d > h.min[t] && f) {
|
|
1546
1546
|
if (h.min[t] <= this.startPan[t])
|
|
1547
1547
|
return a.moveTo(c, !0), !0;
|
|
1548
1548
|
this._setPanWithFriction(t, d);
|
|
1549
|
-
} else if (d < h.max[t] &&
|
|
1549
|
+
} else if (d < h.max[t] && p) {
|
|
1550
1550
|
if (this.startPan[t] <= h.max[t])
|
|
1551
1551
|
return a.moveTo(c, !0), !0;
|
|
1552
1552
|
this._setPanWithFriction(t, d);
|
|
1553
|
-
} else if (
|
|
1554
|
-
if (
|
|
1553
|
+
} else if (m !== 0) {
|
|
1554
|
+
if (m > 0)
|
|
1555
1555
|
return a.moveTo(Math.max(c, u), !0), !0;
|
|
1556
|
-
if (
|
|
1556
|
+
if (m < 0)
|
|
1557
1557
|
return a.moveTo(Math.min(c, u), !0), !0;
|
|
1558
1558
|
} else
|
|
1559
1559
|
this._setPanWithFriction(t, d);
|
|
@@ -1600,16 +1600,16 @@ class Pe {
|
|
|
1600
1600
|
} = n;
|
|
1601
1601
|
if (r.correctPan(t, e) !== e || i) {
|
|
1602
1602
|
const l = Math.round(e - o[t]);
|
|
1603
|
-
o[t] += l * (i ||
|
|
1603
|
+
o[t] += l * (i || Pe);
|
|
1604
1604
|
} else
|
|
1605
1605
|
o[t] = e;
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
|
-
const
|
|
1609
|
-
function
|
|
1608
|
+
const ze = 0.05, Oe = 0.15;
|
|
1609
|
+
function at(s, t, e) {
|
|
1610
1610
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1611
1611
|
}
|
|
1612
|
-
class
|
|
1612
|
+
class De {
|
|
1613
1613
|
/**
|
|
1614
1614
|
* @param {Gestures} gestures
|
|
1615
1615
|
*/
|
|
@@ -1629,7 +1629,7 @@ class Ce {
|
|
|
1629
1629
|
const {
|
|
1630
1630
|
currSlide: t
|
|
1631
1631
|
} = this.gestures.pswp;
|
|
1632
|
-
t && (this._startZoomLevel = t.currZoomLevel,
|
|
1632
|
+
t && (this._startZoomLevel = t.currZoomLevel, b(this._startPan, t.pan)), this.gestures.pswp.animations.stopAllPan(), this._wasOverFitZoomLevel = !1;
|
|
1633
1633
|
}
|
|
1634
1634
|
change() {
|
|
1635
1635
|
const {
|
|
@@ -1646,7 +1646,7 @@ class Ce {
|
|
|
1646
1646
|
const a = r.zoomLevels.min, l = r.zoomLevels.max;
|
|
1647
1647
|
if (!r.isZoomable() || o.mainScroll.isShifted())
|
|
1648
1648
|
return;
|
|
1649
|
-
|
|
1649
|
+
at(this._startZoomPoint, e, n), at(this._zoomPoint, t, i);
|
|
1650
1650
|
let c = 1 / V(e, n) * V(t, i) * this._startZoomLevel;
|
|
1651
1651
|
if (c > r.zoomLevels.initial + r.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), c < a)
|
|
1652
1652
|
if (o.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= r.zoomLevels.initial) {
|
|
@@ -1655,8 +1655,8 @@ class Ce {
|
|
|
1655
1655
|
bgOpacity: h
|
|
1656
1656
|
}).defaultPrevented || o.applyBgOpacity(h);
|
|
1657
1657
|
} else
|
|
1658
|
-
c = a - (a - c) *
|
|
1659
|
-
else c > l && (c = l + (c - l) *
|
|
1658
|
+
c = a - (a - c) * Oe;
|
|
1659
|
+
else c > l && (c = l + (c - l) * ze);
|
|
1660
1660
|
r.pan.x = this._calculatePanForZoomLevel("x", c), r.pan.y = this._calculatePanForZoomLevel("y", c), r.setZoomLevel(c), r.applyCurrentZoomPan();
|
|
1661
1661
|
}
|
|
1662
1662
|
end() {
|
|
@@ -1697,22 +1697,22 @@ class Ce {
|
|
|
1697
1697
|
const n = i.currZoomLevel;
|
|
1698
1698
|
let o, r = !0;
|
|
1699
1699
|
n < i.zoomLevels.initial ? o = i.zoomLevels.initial : n > i.zoomLevels.max ? o = i.zoomLevels.max : (r = !1, o = n);
|
|
1700
|
-
const a = e.bgOpacity, l = e.bgOpacity < 1, c =
|
|
1700
|
+
const a = e.bgOpacity, l = e.bgOpacity < 1, c = b({
|
|
1701
1701
|
x: 0,
|
|
1702
1702
|
y: 0
|
|
1703
1703
|
}, i.pan);
|
|
1704
|
-
let h =
|
|
1704
|
+
let h = b({
|
|
1705
1705
|
x: 0,
|
|
1706
1706
|
y: 0
|
|
1707
1707
|
}, c);
|
|
1708
|
-
t && (this._zoomPoint.x = 0, this._zoomPoint.y = 0, this._startZoomPoint.x = 0, this._startZoomPoint.y = 0, this._startZoomLevel = n,
|
|
1708
|
+
t && (this._zoomPoint.x = 0, this._zoomPoint.y = 0, this._startZoomPoint.x = 0, this._startZoomPoint.y = 0, this._startZoomLevel = n, b(this._startPan, c)), r && (h = {
|
|
1709
1709
|
x: this._calculatePanForZoomLevel("x", o),
|
|
1710
1710
|
y: this._calculatePanForZoomLevel("y", o)
|
|
1711
1711
|
}), i.setZoomLevel(o), h = {
|
|
1712
1712
|
x: i.bounds.correctPan("x", h.x),
|
|
1713
1713
|
y: i.bounds.correctPan("y", h.y)
|
|
1714
1714
|
}, i.setZoomLevel(n);
|
|
1715
|
-
const d = !
|
|
1715
|
+
const d = !Z(h, c);
|
|
1716
1716
|
if (!d && !r && !l) {
|
|
1717
1717
|
i._setResolution(o), i.applyCurrentZoomPan();
|
|
1718
1718
|
return;
|
|
@@ -1727,12 +1727,12 @@ class Ce {
|
|
|
1727
1727
|
onUpdate: (u) => {
|
|
1728
1728
|
if (u /= 1e3, d || r) {
|
|
1729
1729
|
if (d && (i.pan.x = c.x + (h.x - c.x) * u, i.pan.y = c.y + (h.y - c.y) * u), r) {
|
|
1730
|
-
const
|
|
1731
|
-
i.setZoomLevel(
|
|
1730
|
+
const m = n + (o - n) * u;
|
|
1731
|
+
i.setZoomLevel(m);
|
|
1732
1732
|
}
|
|
1733
1733
|
i.applyCurrentZoomPan();
|
|
1734
1734
|
}
|
|
1735
|
-
l && e.bgOpacity < 1 && e.applyBgOpacity(
|
|
1735
|
+
l && e.bgOpacity < 1 && e.applyBgOpacity(q(a + (1 - a) * u, 0, 1));
|
|
1736
1736
|
},
|
|
1737
1737
|
onComplete: () => {
|
|
1738
1738
|
i._setResolution(o), i.applyCurrentZoomPan();
|
|
@@ -1740,11 +1740,11 @@ class Ce {
|
|
|
1740
1740
|
});
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function lt(s) {
|
|
1744
1744
|
return !!/** @type {HTMLElement} */
|
|
1745
1745
|
s.target.closest(".pswp__container");
|
|
1746
1746
|
}
|
|
1747
|
-
class
|
|
1747
|
+
class Me {
|
|
1748
1748
|
/**
|
|
1749
1749
|
* @param {Gestures} gestures
|
|
1750
1750
|
*/
|
|
@@ -1767,14 +1767,14 @@ class ze {
|
|
|
1767
1767
|
* @param {PointerEvent} originalEvent
|
|
1768
1768
|
*/
|
|
1769
1769
|
tap(t, e) {
|
|
1770
|
-
|
|
1770
|
+
lt(e) && this._doClickOrTapAction("tap", t, e);
|
|
1771
1771
|
}
|
|
1772
1772
|
/**
|
|
1773
1773
|
* @param {Point} point
|
|
1774
1774
|
* @param {PointerEvent} originalEvent
|
|
1775
1775
|
*/
|
|
1776
1776
|
doubleTap(t, e) {
|
|
1777
|
-
|
|
1777
|
+
lt(e) && this._doClickOrTapAction("doubleTap", t, e);
|
|
1778
1778
|
}
|
|
1779
1779
|
/**
|
|
1780
1780
|
* @private
|
|
@@ -1818,8 +1818,8 @@ class ze {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
1821
|
-
const
|
|
1822
|
-
class
|
|
1821
|
+
const $e = 10, Re = 300, Ze = 25;
|
|
1822
|
+
class Fe {
|
|
1823
1823
|
/**
|
|
1824
1824
|
* @param {PhotoSwipe} pswp
|
|
1825
1825
|
*/
|
|
@@ -1851,7 +1851,7 @@ class $e {
|
|
|
1851
1851
|
}, this._intervalP1 = {
|
|
1852
1852
|
x: 0,
|
|
1853
1853
|
y: 0
|
|
1854
|
-
}, 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
|
|
1854
|
+
}, 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 Ce(this), this.zoomLevels = new De(this), this.tapHandler = new Me(this), t.on("bindEvents", () => {
|
|
1855
1855
|
t.events.add(
|
|
1856
1856
|
t.scrollWrap,
|
|
1857
1857
|
"click",
|
|
@@ -1913,7 +1913,7 @@ class $e {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
i.dispatch("pointerDown", {
|
|
1915
1915
|
originalEvent: t
|
|
1916
|
-
}).defaultPrevented || (e && (i.mouseDetected(), this._preventPointerEventBehaviour(t, "down")), i.animations.stopAll(), this._updatePoints(t, "down"), this._numActivePoints === 1 && (this.dragAxis = null,
|
|
1916
|
+
}).defaultPrevented || (e && (i.mouseDetected(), this._preventPointerEventBehaviour(t, "down")), i.animations.stopAll(), this._updatePoints(t, "down"), this._numActivePoints === 1 && (this.dragAxis = null, b(this.startP1, this.p1)), this._numActivePoints > 1 ? (this._clearTapTimer(), this.isMultitouch = !0) : this.isMultitouch = !1);
|
|
1917
1917
|
}
|
|
1918
1918
|
/**
|
|
1919
1919
|
* @param {PointerEvent} e
|
|
@@ -1921,7 +1921,7 @@ class $e {
|
|
|
1921
1921
|
onPointerMove(t) {
|
|
1922
1922
|
this._preventPointerEventBehaviour(t, "move"), this._numActivePoints && (this._updatePoints(t, "move"), !this.pswp.dispatch("pointerMove", {
|
|
1923
1923
|
originalEvent: t
|
|
1924
|
-
}).defaultPrevented && (this._numActivePoints === 1 && !this.isDragging ? (this.dragAxis || this._calculateDragDirection(), this.dragAxis && !this.isDragging && (this.isZooming && (this.isZooming = !1, this.zoomLevels.end()), this.isDragging = !0, this._clearTapTimer(), this._updateStartPoints(), this._intervalTime = Date.now(), this._velocityCalculated = !1,
|
|
1924
|
+
}).defaultPrevented && (this._numActivePoints === 1 && !this.isDragging ? (this.dragAxis || this._calculateDragDirection(), this.dragAxis && !this.isDragging && (this.isZooming && (this.isZooming = !1, this.zoomLevels.end()), this.isDragging = !0, this._clearTapTimer(), this._updateStartPoints(), this._intervalTime = Date.now(), this._velocityCalculated = !1, b(this._intervalP1, this.p1), this.velocity.x = 0, this.velocity.y = 0, this.drag.start(), this._rafStopLoop(), this._rafRenderLoop())) : this._numActivePoints > 1 && !this.isZooming && (this._finishDrag(), this.isZooming = !0, this._updateStartPoints(), this.zoomLevels.start(), this._rafStopLoop(), this._rafRenderLoop())));
|
|
1925
1925
|
}
|
|
1926
1926
|
/**
|
|
1927
1927
|
* @private
|
|
@@ -1941,7 +1941,7 @@ class $e {
|
|
|
1941
1941
|
* @private
|
|
1942
1942
|
*/
|
|
1943
1943
|
_rafRenderLoop() {
|
|
1944
|
-
(this.isDragging || this.isZooming) && (this._updateVelocity(), this.isDragging ?
|
|
1944
|
+
(this.isDragging || this.isZooming) && (this._updateVelocity(), this.isDragging ? Z(this.p1, this.prevP1) || this.drag.change() : (!Z(this.p1, this.prevP1) || !Z(this.p2, this.prevP2)) && this.zoomLevels.change(), this._updatePrevPoints(), this.raf = requestAnimationFrame(this._rafRenderLoop.bind(this)));
|
|
1945
1945
|
}
|
|
1946
1946
|
/**
|
|
1947
1947
|
* Update velocity at 50ms interval
|
|
@@ -1951,7 +1951,7 @@ class $e {
|
|
|
1951
1951
|
*/
|
|
1952
1952
|
_updateVelocity(t) {
|
|
1953
1953
|
const e = Date.now(), i = e - this._intervalTime;
|
|
1954
|
-
i < 50 && !t || (this.velocity.x = this._getVelocity("x", i), this.velocity.y = this._getVelocity("y", i), this._intervalTime = e,
|
|
1954
|
+
i < 50 && !t || (this.velocity.x = this._getVelocity("x", i), this.velocity.y = this._getVelocity("y", i), this._intervalTime = e, b(this._intervalP1, this.p1), this._velocityCalculated = !0);
|
|
1955
1955
|
}
|
|
1956
1956
|
/**
|
|
1957
1957
|
* @private
|
|
@@ -1971,8 +1971,8 @@ class $e {
|
|
|
1971
1971
|
this.tapHandler.click(this.startP1, t);
|
|
1972
1972
|
return;
|
|
1973
1973
|
}
|
|
1974
|
-
const i = this.pswp.options.doubleTapAction ?
|
|
1975
|
-
this._tapTimer ? (this._clearTapTimer(), V(this._lastStartP1, this.startP1) <
|
|
1974
|
+
const i = this.pswp.options.doubleTapAction ? Re : 0;
|
|
1975
|
+
this._tapTimer ? (this._clearTapTimer(), V(this._lastStartP1, this.startP1) < Ze && this.tapHandler.doubleTap(this.startP1, t)) : (b(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1976
1976
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1977
1977
|
}, i));
|
|
1978
1978
|
}
|
|
@@ -2025,7 +2025,7 @@ class $e {
|
|
|
2025
2025
|
e === "up" && n > -1 ? this._ongoingPointers.splice(n, 1) : e === "down" && n === -1 ? this._ongoingPointers.push(this._convertEventPosToPoint(i, {
|
|
2026
2026
|
x: 0,
|
|
2027
2027
|
y: 0
|
|
2028
|
-
})) : n > -1 && this._convertEventPosToPoint(i, this._ongoingPointers[n]), this._numActivePoints = this._ongoingPointers.length, this._numActivePoints > 0 &&
|
|
2028
|
+
})) : n > -1 && this._convertEventPosToPoint(i, this._ongoingPointers[n]), this._numActivePoints = this._ongoingPointers.length, this._numActivePoints > 0 && b(this.p1, this._ongoingPointers[0]), this._numActivePoints > 1 && b(this.p2, this._ongoingPointers[1]);
|
|
2029
2029
|
} else {
|
|
2030
2030
|
const i = (
|
|
2031
2031
|
/** @type {TouchEvent} */
|
|
@@ -2042,13 +2042,13 @@ class $e {
|
|
|
2042
2042
|
* @private
|
|
2043
2043
|
*/
|
|
2044
2044
|
_updatePrevPoints() {
|
|
2045
|
-
|
|
2045
|
+
b(this.prevP1, this.p1), b(this.prevP2, this.p2);
|
|
2046
2046
|
}
|
|
2047
2047
|
/** update points at the start of gesture
|
|
2048
2048
|
* @private
|
|
2049
2049
|
*/
|
|
2050
2050
|
_updateStartPoints() {
|
|
2051
|
-
|
|
2051
|
+
b(this.startP1, this.p1), b(this.startP2, this.p2), this._updatePrevPoints();
|
|
2052
2052
|
}
|
|
2053
2053
|
/** @private */
|
|
2054
2054
|
_calculateDragDirection() {
|
|
@@ -2058,7 +2058,7 @@ class $e {
|
|
|
2058
2058
|
const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
|
|
2059
2059
|
if (t !== 0) {
|
|
2060
2060
|
const e = t > 0 ? "x" : "y";
|
|
2061
|
-
Math.abs(this.p1[e] - this.startP1[e]) >=
|
|
2061
|
+
Math.abs(this.p1[e] - this.startP1[e]) >= $e && (this.dragAxis = e);
|
|
2062
2062
|
}
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
@@ -2082,8 +2082,8 @@ class $e {
|
|
|
2082
2082
|
this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
|
|
2083
2083
|
}
|
|
2084
2084
|
}
|
|
2085
|
-
const
|
|
2086
|
-
class
|
|
2085
|
+
const qe = 0.35;
|
|
2086
|
+
class ke {
|
|
2087
2087
|
/**
|
|
2088
2088
|
* @param {PhotoSwipe} pswp
|
|
2089
2089
|
*/
|
|
@@ -2117,7 +2117,7 @@ class Fe {
|
|
|
2117
2117
|
appendHolders() {
|
|
2118
2118
|
this.itemHolders = [];
|
|
2119
2119
|
for (let t = 0; t < 3; t++) {
|
|
2120
|
-
const e =
|
|
2120
|
+
const e = L("pswp__item", "div", this.pswp.container);
|
|
2121
2121
|
e.setAttribute("role", "group"), e.setAttribute("aria-roledescription", "slide"), e.setAttribute("aria-hidden", "true"), e.style.display = t === 1 ? "block" : "none", this.itemHolders.push({
|
|
2122
2122
|
el: e
|
|
2123
2123
|
//index: -1
|
|
@@ -2236,7 +2236,7 @@ class Fe {
|
|
|
2236
2236
|
let i = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
|
|
2237
2237
|
i += this.pswp.currIndex;
|
|
2238
2238
|
const n = Math.round(t - this.x);
|
|
2239
|
-
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n *
|
|
2239
|
+
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n * qe);
|
|
2240
2240
|
}
|
|
2241
2241
|
this.x = t, this.pswp.container && I(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
|
|
2242
2242
|
x: t,
|
|
@@ -2244,7 +2244,7 @@ class Fe {
|
|
|
2244
2244
|
});
|
|
2245
2245
|
}
|
|
2246
2246
|
}
|
|
2247
|
-
const
|
|
2247
|
+
const Be = {
|
|
2248
2248
|
Escape: 27,
|
|
2249
2249
|
z: 90,
|
|
2250
2250
|
ArrowLeft: 37,
|
|
@@ -2252,8 +2252,8 @@ const Ze = {
|
|
|
2252
2252
|
ArrowRight: 39,
|
|
2253
2253
|
ArrowDown: 40,
|
|
2254
2254
|
Tab: 9
|
|
2255
|
-
}, P = (s, t) => t ? s :
|
|
2256
|
-
class
|
|
2255
|
+
}, P = (s, t) => t ? s : Be[s];
|
|
2256
|
+
class Ne {
|
|
2257
2257
|
/**
|
|
2258
2258
|
* @param {PhotoSwipe} pswp
|
|
2259
2259
|
*/
|
|
@@ -2293,7 +2293,7 @@ class ke {
|
|
|
2293
2293
|
} = this;
|
|
2294
2294
|
if (e.dispatch("keydown", {
|
|
2295
2295
|
originalEvent: t
|
|
2296
|
-
}).defaultPrevented ||
|
|
2296
|
+
}).defaultPrevented || Se(t))
|
|
2297
2297
|
return;
|
|
2298
2298
|
let i, n, o = !1;
|
|
2299
2299
|
const r = "key" in t;
|
|
@@ -2345,8 +2345,8 @@ class ke {
|
|
|
2345
2345
|
) && e.focus();
|
|
2346
2346
|
}
|
|
2347
2347
|
}
|
|
2348
|
-
const
|
|
2349
|
-
class
|
|
2348
|
+
const He = "cubic-bezier(.4,0,.22,1)";
|
|
2349
|
+
class We {
|
|
2350
2350
|
/**
|
|
2351
2351
|
* onComplete can be unpredictable, be careful about current state
|
|
2352
2352
|
*
|
|
@@ -2362,12 +2362,12 @@ class Be {
|
|
|
2362
2362
|
onFinish: r = () => {
|
|
2363
2363
|
},
|
|
2364
2364
|
duration: a = 333,
|
|
2365
|
-
easing: l =
|
|
2365
|
+
easing: l = He
|
|
2366
2366
|
} = t;
|
|
2367
2367
|
this.onFinish = r;
|
|
2368
2368
|
const c = o ? "transform" : "opacity", h = (e = t[c]) !== null && e !== void 0 ? e : "";
|
|
2369
2369
|
this._target = i, this._onComplete = n, this._finished = !1, this._onTransitionEnd = this._onTransitionEnd.bind(this), this._helperTimeout = setTimeout(() => {
|
|
2370
|
-
|
|
2370
|
+
St(i, c, a, l), this._helperTimeout = setTimeout(() => {
|
|
2371
2371
|
i.addEventListener("transitionend", this._onTransitionEnd, !1), i.addEventListener("transitioncancel", this._onTransitionEnd, !1), this._helperTimeout = setTimeout(() => {
|
|
2372
2372
|
this._finalizeAnimation();
|
|
2373
2373
|
}, a + 500), i.style[c] = h;
|
|
@@ -2389,11 +2389,11 @@ class Be {
|
|
|
2389
2389
|
}
|
|
2390
2390
|
// Destroy is called automatically onFinish
|
|
2391
2391
|
destroy() {
|
|
2392
|
-
this._helperTimeout && clearTimeout(this._helperTimeout),
|
|
2392
|
+
this._helperTimeout && clearTimeout(this._helperTimeout), we(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2393
2393
|
}
|
|
2394
2394
|
}
|
|
2395
|
-
const
|
|
2396
|
-
class
|
|
2395
|
+
const Ve = 12, je = 0.75;
|
|
2396
|
+
class Ge {
|
|
2397
2397
|
/**
|
|
2398
2398
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2399
2399
|
*
|
|
@@ -2410,7 +2410,7 @@ class We {
|
|
|
2410
2410
|
* Recommended value from 10 to 50
|
|
2411
2411
|
*/
|
|
2412
2412
|
constructor(t, e, i) {
|
|
2413
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2413
|
+
this.velocity = t * 1e3, this._dampingRatio = e || je, this._naturalFrequency = i || Ve, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2414
2414
|
}
|
|
2415
2415
|
/**
|
|
2416
2416
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2432,7 +2432,7 @@ class We {
|
|
|
2432
2432
|
return i;
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
|
-
class
|
|
2435
|
+
class Ue {
|
|
2436
2436
|
/**
|
|
2437
2437
|
* @param {SpringAnimationProps} props
|
|
2438
2438
|
*/
|
|
@@ -2450,19 +2450,19 @@ class Ve {
|
|
|
2450
2450
|
naturalFrequency: c
|
|
2451
2451
|
} = t;
|
|
2452
2452
|
this.onFinish = a;
|
|
2453
|
-
const h = new
|
|
2453
|
+
const h = new Ge(n, l, c);
|
|
2454
2454
|
let d = Date.now(), u = e - i;
|
|
2455
|
-
const
|
|
2456
|
-
this._raf && (u = h.easeFrame(u, Date.now() - d), Math.abs(u) < 1 && Math.abs(h.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (d = Date.now(), o(u + i), this._raf = requestAnimationFrame(
|
|
2455
|
+
const m = () => {
|
|
2456
|
+
this._raf && (u = h.easeFrame(u, Date.now() - d), Math.abs(u) < 1 && Math.abs(h.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (d = Date.now(), o(u + i), this._raf = requestAnimationFrame(m)));
|
|
2457
2457
|
};
|
|
2458
|
-
this._raf = requestAnimationFrame(
|
|
2458
|
+
this._raf = requestAnimationFrame(m);
|
|
2459
2459
|
}
|
|
2460
2460
|
// Destroy is called automatically onFinish
|
|
2461
2461
|
destroy() {
|
|
2462
2462
|
this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
|
-
class
|
|
2465
|
+
class Ke {
|
|
2466
2466
|
constructor() {
|
|
2467
2467
|
this.activeAnimations = [];
|
|
2468
2468
|
}
|
|
@@ -2485,10 +2485,10 @@ class je {
|
|
|
2485
2485
|
* @returns {Animation}
|
|
2486
2486
|
*/
|
|
2487
2487
|
_start(t, e) {
|
|
2488
|
-
const i = e ? new
|
|
2488
|
+
const i = e ? new Ue(
|
|
2489
2489
|
/** @type SpringAnimationProps */
|
|
2490
2490
|
t
|
|
2491
|
-
) : new
|
|
2491
|
+
) : new We(
|
|
2492
2492
|
/** @type CssAnimationProps */
|
|
2493
2493
|
t
|
|
2494
2494
|
);
|
|
@@ -2531,7 +2531,7 @@ class je {
|
|
|
2531
2531
|
return this.activeAnimations.some((t) => t.props.isPan);
|
|
2532
2532
|
}
|
|
2533
2533
|
}
|
|
2534
|
-
class
|
|
2534
|
+
class Xe {
|
|
2535
2535
|
/**
|
|
2536
2536
|
* @param {PhotoSwipe} pswp
|
|
2537
2537
|
*/
|
|
@@ -2573,7 +2573,7 @@ class Ue {
|
|
|
2573
2573
|
e.isPannable() && (t.deltaMode === 1 && (i *= 18, n *= 18), e.panTo(e.pan.x - i, e.pan.y - n));
|
|
2574
2574
|
}
|
|
2575
2575
|
}
|
|
2576
|
-
function
|
|
2576
|
+
function Ye(s) {
|
|
2577
2577
|
if (typeof s == "string")
|
|
2578
2578
|
return s;
|
|
2579
2579
|
if (!s || !s.isCustomSVG)
|
|
@@ -2585,7 +2585,7 @@ function Ge(s) {
|
|
|
2585
2585
|
t.size || 32
|
|
2586
2586
|
), t.outlineID && (e += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), e += t.inner, e += "</svg>", e;
|
|
2587
2587
|
}
|
|
2588
|
-
class
|
|
2588
|
+
class Qe {
|
|
2589
2589
|
/**
|
|
2590
2590
|
* @param {PhotoSwipe} pswp
|
|
2591
2591
|
* @param {UIElementData} data
|
|
@@ -2604,7 +2604,7 @@ class Ke {
|
|
|
2604
2604
|
let a = e.isButton ? e.tagName || "button" : e.tagName || "div";
|
|
2605
2605
|
a = /** @type {keyof HTMLElementTagNameMap} */
|
|
2606
2606
|
a.toLowerCase();
|
|
2607
|
-
const l =
|
|
2607
|
+
const l = L(r, a);
|
|
2608
2608
|
if (e.isButton) {
|
|
2609
2609
|
a === "button" && (l.type = "button");
|
|
2610
2610
|
let {
|
|
@@ -2614,23 +2614,23 @@ class Ke {
|
|
|
2614
2614
|
ariaLabel: u
|
|
2615
2615
|
} = e;
|
|
2616
2616
|
typeof t.options[n + "Title"] == "string" && (d = t.options[n + "Title"]), d && (l.title = d);
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2617
|
+
const m = u || d;
|
|
2618
|
+
m && l.setAttribute("aria-label", m);
|
|
2619
2619
|
}
|
|
2620
|
-
l.innerHTML =
|
|
2620
|
+
l.innerHTML = Ye(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (d) => {
|
|
2621
2621
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(d, l, t);
|
|
2622
2622
|
});
|
|
2623
2623
|
const c = e.appendTo || "bar";
|
|
2624
2624
|
let h = t.element;
|
|
2625
|
-
c === "bar" ? (t.topBar || (t.topBar =
|
|
2625
|
+
c === "bar" ? (t.topBar || (t.topBar = L("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), h = t.topBar) : (l.classList.add("pswp__hide-on-close"), c === "wrapper" && (h = t.scrollWrap)), (i = h) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
|
|
2626
2626
|
}
|
|
2627
2627
|
}
|
|
2628
|
-
function
|
|
2628
|
+
function Pt(s, t, e) {
|
|
2629
2629
|
s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
|
|
2630
2630
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2631
2631
|
});
|
|
2632
2632
|
}
|
|
2633
|
-
const
|
|
2633
|
+
const Je = {
|
|
2634
2634
|
name: "arrowPrev",
|
|
2635
2635
|
className: "pswp__button--arrow--prev",
|
|
2636
2636
|
title: "Previous",
|
|
@@ -2644,8 +2644,8 @@ const Xe = {
|
|
|
2644
2644
|
outlineID: "pswp__icn-arrow"
|
|
2645
2645
|
},
|
|
2646
2646
|
onClick: "prev",
|
|
2647
|
-
onInit:
|
|
2648
|
-
},
|
|
2647
|
+
onInit: Pt
|
|
2648
|
+
}, ti = {
|
|
2649
2649
|
name: "arrowNext",
|
|
2650
2650
|
className: "pswp__button--arrow--next",
|
|
2651
2651
|
title: "Next",
|
|
@@ -2660,9 +2660,9 @@ const Xe = {
|
|
|
2660
2660
|
},
|
|
2661
2661
|
onClick: "next",
|
|
2662
2662
|
onInit: (s, t) => {
|
|
2663
|
-
|
|
2663
|
+
Pt(s, t, !0);
|
|
2664
2664
|
}
|
|
2665
|
-
},
|
|
2665
|
+
}, ei = {
|
|
2666
2666
|
name: "close",
|
|
2667
2667
|
title: "Close",
|
|
2668
2668
|
order: 20,
|
|
@@ -2673,7 +2673,7 @@ const Xe = {
|
|
|
2673
2673
|
outlineID: "pswp__icn-close"
|
|
2674
2674
|
},
|
|
2675
2675
|
onClick: "close"
|
|
2676
|
-
},
|
|
2676
|
+
}, ii = {
|
|
2677
2677
|
name: "zoom",
|
|
2678
2678
|
title: "Zoom",
|
|
2679
2679
|
order: 10,
|
|
@@ -2685,7 +2685,7 @@ const Xe = {
|
|
|
2685
2685
|
outlineID: "pswp__icn-zoom"
|
|
2686
2686
|
},
|
|
2687
2687
|
onClick: "toggleZoom"
|
|
2688
|
-
},
|
|
2688
|
+
}, si = {
|
|
2689
2689
|
name: "preloader",
|
|
2690
2690
|
appendTo: "bar",
|
|
2691
2691
|
order: 7,
|
|
@@ -2716,7 +2716,7 @@ const Xe = {
|
|
|
2716
2716
|
t.currSlide === a.slide && r();
|
|
2717
2717
|
}), t.ui && (t.ui.updatePreloaderVisibility = r);
|
|
2718
2718
|
}
|
|
2719
|
-
},
|
|
2719
|
+
}, ni = {
|
|
2720
2720
|
name: "counter",
|
|
2721
2721
|
order: 5,
|
|
2722
2722
|
onInit: (s, t) => {
|
|
@@ -2725,10 +2725,10 @@ const Xe = {
|
|
|
2725
2725
|
});
|
|
2726
2726
|
}
|
|
2727
2727
|
};
|
|
2728
|
-
function
|
|
2728
|
+
function ct(s, t) {
|
|
2729
2729
|
s.classList.toggle("pswp--zoomed-in", t);
|
|
2730
2730
|
}
|
|
2731
|
-
class
|
|
2731
|
+
class oi {
|
|
2732
2732
|
/**
|
|
2733
2733
|
* @param {PhotoSwipe} pswp
|
|
2734
2734
|
*/
|
|
@@ -2740,7 +2740,7 @@ class ii {
|
|
|
2740
2740
|
const {
|
|
2741
2741
|
pswp: t
|
|
2742
2742
|
} = this;
|
|
2743
|
-
this.isRegistered = !1, this.uiElementsData = [
|
|
2743
|
+
this.isRegistered = !1, this.uiElementsData = [ei, Je, ti, ii, si, ni], t.dispatch("uiRegister"), this.uiElementsData.sort((e, i) => (e.order || 0) - (i.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((e) => {
|
|
2744
2744
|
this.registerElement(e);
|
|
2745
2745
|
}), t.on("change", () => {
|
|
2746
2746
|
var e;
|
|
@@ -2751,7 +2751,7 @@ class ii {
|
|
|
2751
2751
|
* @param {UIElementData} elementData
|
|
2752
2752
|
*/
|
|
2753
2753
|
registerElement(t) {
|
|
2754
|
-
this.isRegistered ? this.items.push(new
|
|
2754
|
+
this.isRegistered ? this.items.push(new Qe(this.pswp, t)) : this.uiElementsData.push(t);
|
|
2755
2755
|
}
|
|
2756
2756
|
/**
|
|
2757
2757
|
* Fired each time zoom or pan position is changed.
|
|
@@ -2775,15 +2775,15 @@ class ii {
|
|
|
2775
2775
|
this._lastUpdatedZoomLevel = n;
|
|
2776
2776
|
const o = e.zoomLevels.initial - e.zoomLevels.secondary;
|
|
2777
2777
|
if (Math.abs(o) < 0.01 || !e.isZoomable()) {
|
|
2778
|
-
|
|
2778
|
+
ct(t, !1), t.classList.remove("pswp--zoom-allowed");
|
|
2779
2779
|
return;
|
|
2780
2780
|
}
|
|
2781
2781
|
t.classList.add("pswp--zoom-allowed");
|
|
2782
2782
|
const r = n === e.zoomLevels.initial ? e.zoomLevels.secondary : e.zoomLevels.initial;
|
|
2783
|
-
|
|
2783
|
+
ct(t, r <= n), (i.imageClickAction === "zoom" || i.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
2786
|
-
function
|
|
2786
|
+
function ri(s) {
|
|
2787
2787
|
const t = s.getBoundingClientRect();
|
|
2788
2788
|
return {
|
|
2789
2789
|
x: t.left,
|
|
@@ -2791,7 +2791,7 @@ function si(s) {
|
|
|
2791
2791
|
w: t.width
|
|
2792
2792
|
};
|
|
2793
2793
|
}
|
|
2794
|
-
function
|
|
2794
|
+
function ai(s, t, e) {
|
|
2795
2795
|
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, c = {
|
|
2796
2796
|
x: i.left + a,
|
|
2797
2797
|
y: i.top + l,
|
|
@@ -2804,7 +2804,7 @@ function ni(s, t, e) {
|
|
|
2804
2804
|
y: l
|
|
2805
2805
|
}, c;
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2807
|
+
function li(s, t, e) {
|
|
2808
2808
|
const i = e.dispatch("thumbBounds", {
|
|
2809
2809
|
index: s,
|
|
2810
2810
|
itemData: t,
|
|
@@ -2823,9 +2823,9 @@ function oi(s, t, e) {
|
|
|
2823
2823
|
n.querySelector(a)
|
|
2824
2824
|
);
|
|
2825
2825
|
}
|
|
2826
|
-
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o =
|
|
2826
|
+
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o = ai(r, t.width || t.w || 0, t.height || t.h || 0) : o = ri(r)), e.applyFilters("thumbBounds", o, t, s);
|
|
2827
2827
|
}
|
|
2828
|
-
let
|
|
2828
|
+
let ci = class {
|
|
2829
2829
|
/**
|
|
2830
2830
|
* @param {T} type
|
|
2831
2831
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -2836,7 +2836,7 @@ let ri = class {
|
|
|
2836
2836
|
preventDefault() {
|
|
2837
2837
|
this.defaultPrevented = !0;
|
|
2838
2838
|
}
|
|
2839
|
-
},
|
|
2839
|
+
}, hi = class {
|
|
2840
2840
|
constructor() {
|
|
2841
2841
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
2842
2842
|
}
|
|
@@ -2903,19 +2903,19 @@ let ri = class {
|
|
|
2903
2903
|
return this.pswp.dispatch(t, e);
|
|
2904
2904
|
const n = (
|
|
2905
2905
|
/** @type {AugmentedEvent<T>} */
|
|
2906
|
-
new
|
|
2906
|
+
new ci(t, e)
|
|
2907
2907
|
);
|
|
2908
2908
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
2909
2909
|
o.call(this, n);
|
|
2910
2910
|
}), n;
|
|
2911
2911
|
}
|
|
2912
|
-
},
|
|
2912
|
+
}, di = class {
|
|
2913
2913
|
/**
|
|
2914
2914
|
* @param {string | false} imageSrc
|
|
2915
2915
|
* @param {HTMLElement} container
|
|
2916
2916
|
*/
|
|
2917
2917
|
constructor(t, e) {
|
|
2918
|
-
if (this.element =
|
|
2918
|
+
if (this.element = L("pswp__img pswp__img--placeholder", t ? "img" : "div", e), t) {
|
|
2919
2919
|
const i = (
|
|
2920
2920
|
/** @type {HTMLImageElement} */
|
|
2921
2921
|
this.element
|
|
@@ -2929,20 +2929,20 @@ let ri = class {
|
|
|
2929
2929
|
* @param {number} height
|
|
2930
2930
|
*/
|
|
2931
2931
|
setDisplayedSize(t, e) {
|
|
2932
|
-
this.element && (this.element.tagName === "IMG" ? (j(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform =
|
|
2932
|
+
this.element && (this.element.tagName === "IMG" ? (j(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = F(0, 0, t / 250)) : j(this.element, t, e));
|
|
2933
2933
|
}
|
|
2934
2934
|
destroy() {
|
|
2935
2935
|
var t;
|
|
2936
2936
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
2937
2937
|
}
|
|
2938
|
-
},
|
|
2938
|
+
}, ui = class {
|
|
2939
2939
|
/**
|
|
2940
2940
|
* @param {SlideData} itemData Slide data
|
|
2941
2941
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
2942
2942
|
* @param {number} index
|
|
2943
2943
|
*/
|
|
2944
2944
|
constructor(t, e, i) {
|
|
2945
|
-
this.instance = e, this.data = t, this.index = i, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state =
|
|
2945
|
+
this.instance = e, this.data = t, this.index = i, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state = E.IDLE, this.data.type ? this.type = this.data.type : this.data.src ? this.type = "image" : this.type = "html", this.instance.dispatch("contentInit", {
|
|
2946
2946
|
content: this
|
|
2947
2947
|
});
|
|
2948
2948
|
}
|
|
@@ -2970,12 +2970,12 @@ let ri = class {
|
|
|
2970
2970
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
2971
2971
|
this
|
|
2972
2972
|
);
|
|
2973
|
-
this.placeholder = new
|
|
2973
|
+
this.placeholder = new di(i, this.slide.container);
|
|
2974
2974
|
}
|
|
2975
2975
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2976
2976
|
content: this,
|
|
2977
2977
|
isLazy: t
|
|
2978
|
-
}).defaultPrevented || (this.isImageContent() ? (this.element =
|
|
2978
|
+
}).defaultPrevented || (this.isImageContent() ? (this.element = L("pswp__img", "img"), this.displayedImageWidth && this.loadImage(t)) : (this.element = L("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), e && this.slide && this.slide.updateContentSize(!0));
|
|
2979
2979
|
}
|
|
2980
2980
|
/**
|
|
2981
2981
|
* Preload image
|
|
@@ -2993,7 +2993,7 @@ let ri = class {
|
|
|
2993
2993
|
/** @type HTMLImageElement */
|
|
2994
2994
|
this.element
|
|
2995
2995
|
);
|
|
2996
|
-
this.updateSrcsetSizes(), this.data.srcset && (n.srcset = this.data.srcset), n.src = (e = this.data.src) !== null && e !== void 0 ? e : "", n.alt = (i = this.data.alt) !== null && i !== void 0 ? i : "", this.state =
|
|
2996
|
+
this.updateSrcsetSizes(), this.data.srcset && (n.srcset = this.data.srcset), n.src = (e = this.data.src) !== null && e !== void 0 ? e : "", n.alt = (i = this.data.alt) !== null && i !== void 0 ? i : "", this.state = E.LOADING, n.complete ? this.onLoaded() : (n.onload = () => {
|
|
2997
2997
|
this.onLoaded();
|
|
2998
2998
|
}, n.onerror = () => {
|
|
2999
2999
|
this.onError();
|
|
@@ -3011,16 +3011,16 @@ let ri = class {
|
|
|
3011
3011
|
* Content load success handler
|
|
3012
3012
|
*/
|
|
3013
3013
|
onLoaded() {
|
|
3014
|
-
this.state =
|
|
3014
|
+
this.state = E.LOADED, this.slide && this.element && (this.instance.dispatch("loadComplete", {
|
|
3015
3015
|
slide: this.slide,
|
|
3016
3016
|
content: this
|
|
3017
|
-
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state ===
|
|
3017
|
+
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state === E.LOADED || this.state === E.ERROR) && this.removePlaceholder());
|
|
3018
3018
|
}
|
|
3019
3019
|
/**
|
|
3020
3020
|
* Content load error handler
|
|
3021
3021
|
*/
|
|
3022
3022
|
onError() {
|
|
3023
|
-
this.state =
|
|
3023
|
+
this.state = E.ERROR, this.slide && (this.displayError(), this.instance.dispatch("loadComplete", {
|
|
3024
3024
|
slide: this.slide,
|
|
3025
3025
|
isError: !0,
|
|
3026
3026
|
content: this
|
|
@@ -3033,13 +3033,13 @@ let ri = class {
|
|
|
3033
3033
|
* @returns {Boolean} If the content is currently loading
|
|
3034
3034
|
*/
|
|
3035
3035
|
isLoading() {
|
|
3036
|
-
return this.instance.applyFilters("isContentLoading", this.state ===
|
|
3036
|
+
return this.instance.applyFilters("isContentLoading", this.state === E.LOADING, this);
|
|
3037
3037
|
}
|
|
3038
3038
|
/**
|
|
3039
3039
|
* @returns {Boolean} If the content is in error state
|
|
3040
3040
|
*/
|
|
3041
3041
|
isError() {
|
|
3042
|
-
return this.state ===
|
|
3042
|
+
return this.state === E.ERROR;
|
|
3043
3043
|
}
|
|
3044
3044
|
/**
|
|
3045
3045
|
* @returns {boolean} If the content is image
|
|
@@ -3072,7 +3072,7 @@ let ri = class {
|
|
|
3072
3072
|
* @returns {boolean} If the content can be zoomed
|
|
3073
3073
|
*/
|
|
3074
3074
|
isZoomable() {
|
|
3075
|
-
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !==
|
|
3075
|
+
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !== E.ERROR, this);
|
|
3076
3076
|
}
|
|
3077
3077
|
/**
|
|
3078
3078
|
* Update image srcset sizes attribute based on width and height
|
|
@@ -3120,9 +3120,9 @@ let ri = class {
|
|
|
3120
3120
|
displayError() {
|
|
3121
3121
|
if (this.slide) {
|
|
3122
3122
|
var t, e;
|
|
3123
|
-
let i =
|
|
3123
|
+
let i = L("pswp__error-msg", "div");
|
|
3124
3124
|
i.innerText = (t = (e = this.instance.options) === null || e === void 0 ? void 0 : e.errorMsg) !== null && t !== void 0 ? t : "", i = /** @type {HTMLDivElement} */
|
|
3125
|
-
this.instance.applyFilters("contentErrorElement", i, this), this.element =
|
|
3125
|
+
this.instance.applyFilters("contentErrorElement", i, this), this.element = L("pswp__content pswp__error-msg-container", "div"), this.element.appendChild(i), this.slide.container.innerText = "", this.slide.container.appendChild(this.element), this.slide.updateContentSize(!0), this.removePlaceholder();
|
|
3126
3126
|
}
|
|
3127
3127
|
}
|
|
3128
3128
|
/**
|
|
@@ -3131,7 +3131,7 @@ let ri = class {
|
|
|
3131
3131
|
append() {
|
|
3132
3132
|
if (this.isAttached || !this.element)
|
|
3133
3133
|
return;
|
|
3134
|
-
if (this.isAttached = !0, this.state ===
|
|
3134
|
+
if (this.isAttached = !0, this.state === E.ERROR) {
|
|
3135
3135
|
this.displayError();
|
|
3136
3136
|
return;
|
|
3137
3137
|
}
|
|
@@ -3140,7 +3140,7 @@ let ri = class {
|
|
|
3140
3140
|
}).defaultPrevented)
|
|
3141
3141
|
return;
|
|
3142
3142
|
const t = "decode" in this.element;
|
|
3143
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
3143
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || st()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
3144
3144
|
}).finally(() => {
|
|
3145
3145
|
this.isDecoding = !1, this.appendImage();
|
|
3146
3146
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -3153,7 +3153,7 @@ let ri = class {
|
|
|
3153
3153
|
activate() {
|
|
3154
3154
|
this.instance.dispatch("contentActivate", {
|
|
3155
3155
|
content: this
|
|
3156
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
3156
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !st() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
3157
3157
|
}
|
|
3158
3158
|
/**
|
|
3159
3159
|
* Deactivate the content
|
|
@@ -3177,39 +3177,39 @@ let ri = class {
|
|
|
3177
3177
|
appendImage() {
|
|
3178
3178
|
this.isAttached && (this.instance.dispatch("contentAppendImage", {
|
|
3179
3179
|
content: this
|
|
3180
|
-
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state ===
|
|
3180
|
+
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === E.LOADED || this.state === E.ERROR) && this.removePlaceholder()));
|
|
3181
3181
|
}
|
|
3182
3182
|
};
|
|
3183
|
-
const
|
|
3184
|
-
function
|
|
3183
|
+
const pi = 5;
|
|
3184
|
+
function It(s, t, e) {
|
|
3185
3185
|
const i = t.createContentFromData(s, e);
|
|
3186
3186
|
let n;
|
|
3187
3187
|
const {
|
|
3188
3188
|
options: o
|
|
3189
3189
|
} = t;
|
|
3190
3190
|
if (o) {
|
|
3191
|
-
n = new
|
|
3191
|
+
n = new xt(o, s, -1);
|
|
3192
3192
|
let r;
|
|
3193
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
3194
|
-
const a =
|
|
3193
|
+
t.pswp ? r = t.pswp.viewportSize : r = Et(o, t);
|
|
3194
|
+
const a = At(o, r, s, e);
|
|
3195
3195
|
n.update(i.width, i.height, a);
|
|
3196
3196
|
}
|
|
3197
3197
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
3198
3198
|
}
|
|
3199
|
-
function
|
|
3199
|
+
function mi(s, t) {
|
|
3200
3200
|
const e = t.getItemData(s);
|
|
3201
3201
|
if (!t.dispatch("lazyLoadSlide", {
|
|
3202
3202
|
index: s,
|
|
3203
3203
|
itemData: e
|
|
3204
3204
|
}).defaultPrevented)
|
|
3205
|
-
return
|
|
3205
|
+
return It(e, t, s);
|
|
3206
3206
|
}
|
|
3207
|
-
class
|
|
3207
|
+
class fi {
|
|
3208
3208
|
/**
|
|
3209
3209
|
* @param {PhotoSwipe} pswp
|
|
3210
3210
|
*/
|
|
3211
3211
|
constructor(t) {
|
|
3212
|
-
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1,
|
|
3212
|
+
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, pi), this._cachedItems = [];
|
|
3213
3213
|
}
|
|
3214
3214
|
/**
|
|
3215
3215
|
* Lazy load nearby slides based on `preload` option.
|
|
@@ -3237,7 +3237,7 @@ class ui {
|
|
|
3237
3237
|
loadSlideByIndex(t) {
|
|
3238
3238
|
const e = this.pswp.getLoopedIndex(t);
|
|
3239
3239
|
let i = this.getContentByIndex(e);
|
|
3240
|
-
i || (i =
|
|
3240
|
+
i || (i = mi(e, this.pswp), i && this.addToCache(i));
|
|
3241
3241
|
}
|
|
3242
3242
|
/**
|
|
3243
3243
|
* @param {Slide} slide
|
|
@@ -3276,7 +3276,7 @@ class ui {
|
|
|
3276
3276
|
this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
|
|
3277
3277
|
}
|
|
3278
3278
|
}
|
|
3279
|
-
let
|
|
3279
|
+
let gi = class extends hi {
|
|
3280
3280
|
/**
|
|
3281
3281
|
* Get total number of slides
|
|
3282
3282
|
*
|
|
@@ -3299,7 +3299,7 @@ let pi = class extends ai {
|
|
|
3299
3299
|
* @returns {Content}
|
|
3300
3300
|
*/
|
|
3301
3301
|
createContentFromData(t, e) {
|
|
3302
|
-
return new
|
|
3302
|
+
return new ui(t, this, e);
|
|
3303
3303
|
}
|
|
3304
3304
|
/**
|
|
3305
3305
|
* Get item data by index.
|
|
@@ -3333,7 +3333,7 @@ let pi = class extends ai {
|
|
|
3333
3333
|
*/
|
|
3334
3334
|
_getGalleryDOMElements(t) {
|
|
3335
3335
|
var e, i;
|
|
3336
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
3336
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? Le(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
3337
3337
|
}
|
|
3338
3338
|
/**
|
|
3339
3339
|
* Converts DOM element to item data object.
|
|
@@ -3367,11 +3367,11 @@ let pi = class extends ai {
|
|
|
3367
3367
|
* @returns {Content} Image that is being decoded or false.
|
|
3368
3368
|
*/
|
|
3369
3369
|
lazyLoadData(t, e) {
|
|
3370
|
-
return
|
|
3370
|
+
return It(t, this, e);
|
|
3371
3371
|
}
|
|
3372
3372
|
};
|
|
3373
3373
|
const z = 3e-3;
|
|
3374
|
-
class
|
|
3374
|
+
class vi {
|
|
3375
3375
|
/**
|
|
3376
3376
|
* @param {PhotoSwipe} pswp
|
|
3377
3377
|
*/
|
|
@@ -3424,7 +3424,7 @@ class mi {
|
|
|
3424
3424
|
_start() {
|
|
3425
3425
|
this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
|
|
3426
3426
|
let e = !1, i = !0;
|
|
3427
|
-
|
|
3427
|
+
be(
|
|
3428
3428
|
/** @type {HTMLImageElement} */
|
|
3429
3429
|
this._placeholder
|
|
3430
3430
|
).finally(() => {
|
|
@@ -3487,9 +3487,9 @@ class mi {
|
|
|
3487
3487
|
} = e;
|
|
3488
3488
|
if (this._croppedZoom && i && this._cropContainer1 && this._cropContainer2) {
|
|
3489
3489
|
const r = -o.x + (this._thumbBounds.x - i.x) + i.w, a = -o.y + (this._thumbBounds.y - i.y) + i.h, l = o.x - i.w, c = o.y - i.h;
|
|
3490
|
-
t ? (this._animateTo(this._cropContainer1, "transform",
|
|
3490
|
+
t ? (this._animateTo(this._cropContainer1, "transform", F(r, a)), this._animateTo(this._cropContainer2, "transform", F(l, c))) : (I(this._cropContainer1, r, a), I(this._cropContainer2, l, c));
|
|
3491
3491
|
}
|
|
3492
|
-
n && (
|
|
3492
|
+
n && (b(n.pan, i || this._thumbBounds), n.currZoomLevel = this._thumbBounds.w / n.width, t ? this._animateTo(n.container, "transform", n.getCurrentTransform()) : n.applyCurrentZoomPan());
|
|
3493
3493
|
}
|
|
3494
3494
|
/**
|
|
3495
3495
|
* @private
|
|
@@ -3515,7 +3515,7 @@ class mi {
|
|
|
3515
3515
|
o[e] = i, n.startTransition(o);
|
|
3516
3516
|
}
|
|
3517
3517
|
}
|
|
3518
|
-
const
|
|
3518
|
+
const _i = {
|
|
3519
3519
|
allowPanToNext: !0,
|
|
3520
3520
|
spacing: 0.1,
|
|
3521
3521
|
loop: !0,
|
|
@@ -3542,7 +3542,7 @@ const fi = {
|
|
|
3542
3542
|
preload: [1, 2],
|
|
3543
3543
|
easing: "cubic-bezier(.4,0,.22,1)"
|
|
3544
3544
|
};
|
|
3545
|
-
class
|
|
3545
|
+
class yi extends gi {
|
|
3546
3546
|
/**
|
|
3547
3547
|
* @param {PhotoSwipeOptions} [options]
|
|
3548
3548
|
*/
|
|
@@ -3556,7 +3556,7 @@ class gi extends pi {
|
|
|
3556
3556
|
}, this.viewportSize = {
|
|
3557
3557
|
x: 0,
|
|
3558
3558
|
y: 0
|
|
3559
|
-
}, 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
|
|
3559
|
+
}, 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 Ee(), this.animations = new Ke(), this.mainScroll = new ke(this), this.gestures = new Fe(this), this.opener = new vi(this), this.keyboard = new Ne(this), this.contentLoader = new fi(this);
|
|
3560
3560
|
}
|
|
3561
3561
|
/** @returns {boolean} */
|
|
3562
3562
|
init() {
|
|
@@ -3564,7 +3564,7 @@ class gi extends pi {
|
|
|
3564
3564
|
return !1;
|
|
3565
3565
|
this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
|
|
3566
3566
|
let t = "pswp--open";
|
|
3567
|
-
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
|
|
3567
|
+
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 Xe(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", {
|
|
3568
3568
|
index: this.currIndex,
|
|
3569
3569
|
data: this._initialItemData,
|
|
3570
3570
|
slide: void 0
|
|
@@ -3584,7 +3584,7 @@ class gi extends pi {
|
|
|
3584
3584
|
*/
|
|
3585
3585
|
getLoopedIndex(t) {
|
|
3586
3586
|
const e = this.getNumItems();
|
|
3587
|
-
return this.options.loop && (t > e - 1 && (t -= e), t < 0 && (t += e)),
|
|
3587
|
+
return this.options.loop && (t > e - 1 && (t -= e), t < 0 && (t += e)), q(t, 0, e - 1);
|
|
3588
3588
|
}
|
|
3589
3589
|
appendHeavy() {
|
|
3590
3590
|
this.mainScroll.itemHolders.forEach((t) => {
|
|
@@ -3683,7 +3683,7 @@ class gi extends pi {
|
|
|
3683
3683
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3684
3684
|
return;
|
|
3685
3685
|
const n = this.getItemData(e);
|
|
3686
|
-
t.slide = new
|
|
3686
|
+
t.slide = new xe(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3687
3687
|
}
|
|
3688
3688
|
/** @returns {Point} */
|
|
3689
3689
|
getViewportCenterPoint() {
|
|
@@ -3701,8 +3701,8 @@ class gi extends pi {
|
|
|
3701
3701
|
updateSize(t) {
|
|
3702
3702
|
if (this.isDestroying)
|
|
3703
3703
|
return;
|
|
3704
|
-
const e =
|
|
3705
|
-
!t &&
|
|
3704
|
+
const e = Et(this.options, this);
|
|
3705
|
+
!t && Z(e, this._prevViewportSize) || (b(this._prevViewportSize, e), this.dispatch("beforeResize"), b(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"));
|
|
3706
3706
|
}
|
|
3707
3707
|
/**
|
|
3708
3708
|
* @param {number} opacity
|
|
@@ -3753,7 +3753,7 @@ class gi extends pi {
|
|
|
3753
3753
|
* @private
|
|
3754
3754
|
*/
|
|
3755
3755
|
_createMainStructure() {
|
|
3756
|
-
this.element =
|
|
3756
|
+
this.element = L("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = L("pswp__bg", "div", this.element), this.scrollWrap = L("pswp__scroll-wrap", "section", this.element), this.container = L("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 oi(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3757
3757
|
}
|
|
3758
3758
|
/**
|
|
3759
3759
|
* Get position and dimensions of small thumbnail
|
|
@@ -3764,7 +3764,7 @@ class gi extends pi {
|
|
|
3764
3764
|
* @returns {Bounds | undefined}
|
|
3765
3765
|
*/
|
|
3766
3766
|
getThumbBounds() {
|
|
3767
|
-
return
|
|
3767
|
+
return li(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
|
|
3768
3768
|
}
|
|
3769
3769
|
/**
|
|
3770
3770
|
* If the PhotoSwipe can have continuous loop
|
|
@@ -3780,7 +3780,7 @@ class gi extends pi {
|
|
|
3780
3780
|
*/
|
|
3781
3781
|
_prepareOptions(t) {
|
|
3782
3782
|
return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
|
|
3783
|
-
...
|
|
3783
|
+
..._i,
|
|
3784
3784
|
...t
|
|
3785
3785
|
};
|
|
3786
3786
|
}
|
|
@@ -3789,20 +3789,20 @@ function D(s, t, e) {
|
|
|
3789
3789
|
const i = document.createElement(t);
|
|
3790
3790
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3791
3791
|
}
|
|
3792
|
-
function
|
|
3792
|
+
function wi(s, t, e) {
|
|
3793
3793
|
let i = `translate3d(${s}px,0px,0)`;
|
|
3794
3794
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
3795
3795
|
}
|
|
3796
|
-
function
|
|
3796
|
+
function G(s, t, e) {
|
|
3797
3797
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
3798
3798
|
}
|
|
3799
|
-
const
|
|
3799
|
+
const A = {
|
|
3800
3800
|
IDLE: "idle",
|
|
3801
3801
|
LOADING: "loading",
|
|
3802
3802
|
LOADED: "loaded",
|
|
3803
3803
|
ERROR: "error"
|
|
3804
3804
|
};
|
|
3805
|
-
function
|
|
3805
|
+
function bi(s) {
|
|
3806
3806
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3807
3807
|
}
|
|
3808
3808
|
function M(s, t, e = document) {
|
|
@@ -3817,13 +3817,13 @@ function M(s, t, e = document) {
|
|
|
3817
3817
|
}
|
|
3818
3818
|
return i;
|
|
3819
3819
|
}
|
|
3820
|
-
function
|
|
3820
|
+
function Si(s) {
|
|
3821
3821
|
return typeof s == "function" && s.prototype && s.prototype.goTo;
|
|
3822
3822
|
}
|
|
3823
|
-
function
|
|
3823
|
+
function ht() {
|
|
3824
3824
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
3825
3825
|
}
|
|
3826
|
-
class
|
|
3826
|
+
class Li {
|
|
3827
3827
|
/**
|
|
3828
3828
|
* @param {T} type
|
|
3829
3829
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -3835,7 +3835,7 @@ class wi {
|
|
|
3835
3835
|
this.defaultPrevented = !0;
|
|
3836
3836
|
}
|
|
3837
3837
|
}
|
|
3838
|
-
class
|
|
3838
|
+
class Ei {
|
|
3839
3839
|
constructor() {
|
|
3840
3840
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
3841
3841
|
}
|
|
@@ -3902,14 +3902,14 @@ class bi {
|
|
|
3902
3902
|
return this.pswp.dispatch(t, e);
|
|
3903
3903
|
const n = (
|
|
3904
3904
|
/** @type {AugmentedEvent<T>} */
|
|
3905
|
-
new
|
|
3905
|
+
new Li(t, e)
|
|
3906
3906
|
);
|
|
3907
3907
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
3908
3908
|
o.call(this, n);
|
|
3909
3909
|
}), n;
|
|
3910
3910
|
}
|
|
3911
3911
|
}
|
|
3912
|
-
class
|
|
3912
|
+
class Ai {
|
|
3913
3913
|
/**
|
|
3914
3914
|
* @param {string | false} imageSrc
|
|
3915
3915
|
* @param {HTMLElement} container
|
|
@@ -3929,21 +3929,21 @@ class Si {
|
|
|
3929
3929
|
* @param {number} height
|
|
3930
3930
|
*/
|
|
3931
3931
|
setDisplayedSize(t, e) {
|
|
3932
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
3932
|
+
this.element && (this.element.tagName === "IMG" ? (G(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = wi(0, 0, t / 250)) : G(this.element, t, e));
|
|
3933
3933
|
}
|
|
3934
3934
|
destroy() {
|
|
3935
3935
|
var t;
|
|
3936
3936
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3937
3937
|
}
|
|
3938
3938
|
}
|
|
3939
|
-
class
|
|
3939
|
+
class xi {
|
|
3940
3940
|
/**
|
|
3941
3941
|
* @param {SlideData} itemData Slide data
|
|
3942
3942
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
3943
3943
|
* @param {number} index
|
|
3944
3944
|
*/
|
|
3945
3945
|
constructor(t, e, i) {
|
|
3946
|
-
this.instance = e, this.data = t, this.index = i, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state =
|
|
3946
|
+
this.instance = e, this.data = t, this.index = i, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state = A.IDLE, this.data.type ? this.type = this.data.type : this.data.src ? this.type = "image" : this.type = "html", this.instance.dispatch("contentInit", {
|
|
3947
3947
|
content: this
|
|
3948
3948
|
});
|
|
3949
3949
|
}
|
|
@@ -3971,7 +3971,7 @@ class Li {
|
|
|
3971
3971
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
3972
3972
|
this
|
|
3973
3973
|
);
|
|
3974
|
-
this.placeholder = new
|
|
3974
|
+
this.placeholder = new Ai(i, this.slide.container);
|
|
3975
3975
|
}
|
|
3976
3976
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3977
3977
|
content: this,
|
|
@@ -3994,7 +3994,7 @@ class Li {
|
|
|
3994
3994
|
/** @type HTMLImageElement */
|
|
3995
3995
|
this.element
|
|
3996
3996
|
);
|
|
3997
|
-
this.updateSrcsetSizes(), this.data.srcset && (n.srcset = this.data.srcset), n.src = (e = this.data.src) !== null && e !== void 0 ? e : "", n.alt = (i = this.data.alt) !== null && i !== void 0 ? i : "", this.state =
|
|
3997
|
+
this.updateSrcsetSizes(), this.data.srcset && (n.srcset = this.data.srcset), n.src = (e = this.data.src) !== null && e !== void 0 ? e : "", n.alt = (i = this.data.alt) !== null && i !== void 0 ? i : "", this.state = A.LOADING, n.complete ? this.onLoaded() : (n.onload = () => {
|
|
3998
3998
|
this.onLoaded();
|
|
3999
3999
|
}, n.onerror = () => {
|
|
4000
4000
|
this.onError();
|
|
@@ -4012,16 +4012,16 @@ class Li {
|
|
|
4012
4012
|
* Content load success handler
|
|
4013
4013
|
*/
|
|
4014
4014
|
onLoaded() {
|
|
4015
|
-
this.state =
|
|
4015
|
+
this.state = A.LOADED, this.slide && this.element && (this.instance.dispatch("loadComplete", {
|
|
4016
4016
|
slide: this.slide,
|
|
4017
4017
|
content: this
|
|
4018
|
-
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state ===
|
|
4018
|
+
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state === A.LOADED || this.state === A.ERROR) && this.removePlaceholder());
|
|
4019
4019
|
}
|
|
4020
4020
|
/**
|
|
4021
4021
|
* Content load error handler
|
|
4022
4022
|
*/
|
|
4023
4023
|
onError() {
|
|
4024
|
-
this.state =
|
|
4024
|
+
this.state = A.ERROR, this.slide && (this.displayError(), this.instance.dispatch("loadComplete", {
|
|
4025
4025
|
slide: this.slide,
|
|
4026
4026
|
isError: !0,
|
|
4027
4027
|
content: this
|
|
@@ -4034,13 +4034,13 @@ class Li {
|
|
|
4034
4034
|
* @returns {Boolean} If the content is currently loading
|
|
4035
4035
|
*/
|
|
4036
4036
|
isLoading() {
|
|
4037
|
-
return this.instance.applyFilters("isContentLoading", this.state ===
|
|
4037
|
+
return this.instance.applyFilters("isContentLoading", this.state === A.LOADING, this);
|
|
4038
4038
|
}
|
|
4039
4039
|
/**
|
|
4040
4040
|
* @returns {Boolean} If the content is in error state
|
|
4041
4041
|
*/
|
|
4042
4042
|
isError() {
|
|
4043
|
-
return this.state ===
|
|
4043
|
+
return this.state === A.ERROR;
|
|
4044
4044
|
}
|
|
4045
4045
|
/**
|
|
4046
4046
|
* @returns {boolean} If the content is image
|
|
@@ -4059,7 +4059,7 @@ class Li {
|
|
|
4059
4059
|
content: this,
|
|
4060
4060
|
width: t,
|
|
4061
4061
|
height: e
|
|
4062
|
-
}).defaultPrevented && (
|
|
4062
|
+
}).defaultPrevented && (G(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
4063
4063
|
const i = !this.displayedImageWidth && t;
|
|
4064
4064
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
4065
4065
|
slide: this.slide,
|
|
@@ -4073,7 +4073,7 @@ class Li {
|
|
|
4073
4073
|
* @returns {boolean} If the content can be zoomed
|
|
4074
4074
|
*/
|
|
4075
4075
|
isZoomable() {
|
|
4076
|
-
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !==
|
|
4076
|
+
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !== A.ERROR, this);
|
|
4077
4077
|
}
|
|
4078
4078
|
/**
|
|
4079
4079
|
* Update image srcset sizes attribute based on width and height
|
|
@@ -4132,7 +4132,7 @@ class Li {
|
|
|
4132
4132
|
append() {
|
|
4133
4133
|
if (this.isAttached || !this.element)
|
|
4134
4134
|
return;
|
|
4135
|
-
if (this.isAttached = !0, this.state ===
|
|
4135
|
+
if (this.isAttached = !0, this.state === A.ERROR) {
|
|
4136
4136
|
this.displayError();
|
|
4137
4137
|
return;
|
|
4138
4138
|
}
|
|
@@ -4141,7 +4141,7 @@ class Li {
|
|
|
4141
4141
|
}).defaultPrevented)
|
|
4142
4142
|
return;
|
|
4143
4143
|
const t = "decode" in this.element;
|
|
4144
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
4144
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || ht()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
4145
4145
|
}).finally(() => {
|
|
4146
4146
|
this.isDecoding = !1, this.appendImage();
|
|
4147
4147
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -4154,7 +4154,7 @@ class Li {
|
|
|
4154
4154
|
activate() {
|
|
4155
4155
|
this.instance.dispatch("contentActivate", {
|
|
4156
4156
|
content: this
|
|
4157
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
4157
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !ht() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
4158
4158
|
}
|
|
4159
4159
|
/**
|
|
4160
4160
|
* Deactivate the content
|
|
@@ -4178,10 +4178,10 @@ class Li {
|
|
|
4178
4178
|
appendImage() {
|
|
4179
4179
|
this.isAttached && (this.instance.dispatch("contentAppendImage", {
|
|
4180
4180
|
content: this
|
|
4181
|
-
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state ===
|
|
4181
|
+
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === A.LOADED || this.state === A.ERROR) && this.removePlaceholder()));
|
|
4182
4182
|
}
|
|
4183
4183
|
}
|
|
4184
|
-
function
|
|
4184
|
+
function Pi(s, t) {
|
|
4185
4185
|
if (s.getViewportSizeFn) {
|
|
4186
4186
|
const e = s.getViewportSizeFn(s, t);
|
|
4187
4187
|
if (e)
|
|
@@ -4196,7 +4196,7 @@ function Ei(s, t) {
|
|
|
4196
4196
|
y: window.innerHeight
|
|
4197
4197
|
};
|
|
4198
4198
|
}
|
|
4199
|
-
function
|
|
4199
|
+
function k(s, t, e, i, n) {
|
|
4200
4200
|
let o = 0;
|
|
4201
4201
|
if (t.paddingFn)
|
|
4202
4202
|
o = t.paddingFn(e, i, n)[s];
|
|
@@ -4208,14 +4208,14 @@ function q(s, t, e, i, n) {
|
|
|
4208
4208
|
}
|
|
4209
4209
|
return Number(o) || 0;
|
|
4210
4210
|
}
|
|
4211
|
-
function
|
|
4211
|
+
function Ii(s, t, e, i) {
|
|
4212
4212
|
return {
|
|
4213
|
-
x: t.x -
|
|
4214
|
-
y: t.y -
|
|
4213
|
+
x: t.x - k("left", s, t, e, i) - k("right", s, t, e, i),
|
|
4214
|
+
y: t.y - k("top", s, t, e, i) - k("bottom", s, t, e, i)
|
|
4215
4215
|
};
|
|
4216
4216
|
}
|
|
4217
|
-
const
|
|
4218
|
-
class
|
|
4217
|
+
const dt = 4e3;
|
|
4218
|
+
class Ti {
|
|
4219
4219
|
/**
|
|
4220
4220
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
4221
4221
|
* @param {SlideData} itemData Slide data
|
|
@@ -4272,7 +4272,7 @@ class xi {
|
|
|
4272
4272
|
*/
|
|
4273
4273
|
_getSecondary() {
|
|
4274
4274
|
let t = this._parseZoomLevelOption("secondary");
|
|
4275
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
4275
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > dt && (t = dt / this.elementSize.x), t);
|
|
4276
4276
|
}
|
|
4277
4277
|
/**
|
|
4278
4278
|
* Get initial image zoom level.
|
|
@@ -4295,30 +4295,30 @@ class xi {
|
|
|
4295
4295
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4296
4296
|
}
|
|
4297
4297
|
}
|
|
4298
|
-
function
|
|
4298
|
+
function Tt(s, t, e) {
|
|
4299
4299
|
const i = t.createContentFromData(s, e);
|
|
4300
4300
|
let n;
|
|
4301
4301
|
const {
|
|
4302
4302
|
options: o
|
|
4303
4303
|
} = t;
|
|
4304
4304
|
if (o) {
|
|
4305
|
-
n = new
|
|
4305
|
+
n = new Ti(o, s, -1);
|
|
4306
4306
|
let r;
|
|
4307
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4308
|
-
const a =
|
|
4307
|
+
t.pswp ? r = t.pswp.viewportSize : r = Pi(o, t);
|
|
4308
|
+
const a = Ii(o, r, s, e);
|
|
4309
4309
|
n.update(i.width, i.height, a);
|
|
4310
4310
|
}
|
|
4311
4311
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4312
4312
|
}
|
|
4313
|
-
function
|
|
4313
|
+
function Ci(s, t) {
|
|
4314
4314
|
const e = t.getItemData(s);
|
|
4315
4315
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4316
4316
|
index: s,
|
|
4317
4317
|
itemData: e
|
|
4318
4318
|
}).defaultPrevented)
|
|
4319
|
-
return
|
|
4319
|
+
return Tt(e, t, s);
|
|
4320
4320
|
}
|
|
4321
|
-
class
|
|
4321
|
+
class zi extends Ei {
|
|
4322
4322
|
/**
|
|
4323
4323
|
* Get total number of slides
|
|
4324
4324
|
*
|
|
@@ -4341,7 +4341,7 @@ class Ii extends bi {
|
|
|
4341
4341
|
* @returns {Content}
|
|
4342
4342
|
*/
|
|
4343
4343
|
createContentFromData(t, e) {
|
|
4344
|
-
return new
|
|
4344
|
+
return new xi(t, this, e);
|
|
4345
4345
|
}
|
|
4346
4346
|
/**
|
|
4347
4347
|
* Get item data by index.
|
|
@@ -4409,10 +4409,10 @@ class Ii extends bi {
|
|
|
4409
4409
|
* @returns {Content} Image that is being decoded or false.
|
|
4410
4410
|
*/
|
|
4411
4411
|
lazyLoadData(t, e) {
|
|
4412
|
-
return
|
|
4412
|
+
return Tt(t, this, e);
|
|
4413
4413
|
}
|
|
4414
4414
|
}
|
|
4415
|
-
class
|
|
4415
|
+
class Oi extends zi {
|
|
4416
4416
|
/**
|
|
4417
4417
|
* @param {PhotoSwipeOptions} [options]
|
|
4418
4418
|
*/
|
|
@@ -4432,7 +4432,7 @@ class Ti extends Ii {
|
|
|
4432
4432
|
* @param {MouseEvent} e
|
|
4433
4433
|
*/
|
|
4434
4434
|
onThumbnailsClick(t) {
|
|
4435
|
-
if (
|
|
4435
|
+
if (bi(t) || window.pswp)
|
|
4436
4436
|
return;
|
|
4437
4437
|
let e = {
|
|
4438
4438
|
x: t.clientX,
|
|
@@ -4500,7 +4500,7 @@ class Ti extends Ii {
|
|
|
4500
4500
|
} = this;
|
|
4501
4501
|
e && (i.dataSource = e);
|
|
4502
4502
|
const n = [], o = typeof i.pswpModule;
|
|
4503
|
-
if (
|
|
4503
|
+
if (Si(i.pswpModule))
|
|
4504
4504
|
n.push(Promise.resolve(
|
|
4505
4505
|
/** @type {Type<PhotoSwipe>} */
|
|
4506
4506
|
i.pswpModule
|
|
@@ -4516,7 +4516,7 @@ class Ti extends Ii {
|
|
|
4516
4516
|
else
|
|
4517
4517
|
throw new Error("pswpModule is not valid");
|
|
4518
4518
|
}
|
|
4519
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4519
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = Ci(t, this));
|
|
4520
4520
|
const r = ++this._uid;
|
|
4521
4521
|
Promise.all(n).then((a) => {
|
|
4522
4522
|
if (this.shouldOpen) {
|
|
@@ -4562,12 +4562,12 @@ class Ti extends Ii {
|
|
|
4562
4562
|
});
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
4565
|
-
const
|
|
4565
|
+
const Di = () => {
|
|
4566
4566
|
let s = null;
|
|
4567
|
-
return s = new
|
|
4567
|
+
return s = new Oi({
|
|
4568
4568
|
gallery: "#photoswipe-gallery",
|
|
4569
4569
|
children: "a",
|
|
4570
|
-
pswpModule:
|
|
4570
|
+
pswpModule: yi,
|
|
4571
4571
|
zoom: !1,
|
|
4572
4572
|
imageClickAction: "next",
|
|
4573
4573
|
tapAction: "next"
|
|
@@ -4588,7 +4588,7 @@ const Ci = () => {
|
|
|
4588
4588
|
}), s.init(), () => {
|
|
4589
4589
|
s && (s.destroy(), s = null);
|
|
4590
4590
|
};
|
|
4591
|
-
},
|
|
4591
|
+
}, Mi = () => {
|
|
4592
4592
|
const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar");
|
|
4593
4593
|
if (!t)
|
|
4594
4594
|
return;
|
|
@@ -4600,9 +4600,9 @@ const Ci = () => {
|
|
|
4600
4600
|
s && (i = s.scrollHeight - e.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top));
|
|
4601
4601
|
const o = Math.round(n / i * 100);
|
|
4602
4602
|
t.style.width = `${o}%`, o >= 100 && (t.style.width = "100%");
|
|
4603
|
-
},
|
|
4604
|
-
document.querySelector(".c-progress") && window.addEventListener("scroll",
|
|
4605
|
-
},
|
|
4603
|
+
}, $i = () => {
|
|
4604
|
+
document.querySelector(".c-progress") && window.addEventListener("scroll", Mi);
|
|
4605
|
+
}, Ri = (s = {}) => {
|
|
4606
4606
|
const { buttonSelector: t = ".c-scroll-to-top" } = s, e = document.querySelector(t), i = e?.querySelector("button");
|
|
4607
4607
|
if (!e || !i)
|
|
4608
4608
|
return;
|
|
@@ -4624,7 +4624,7 @@ const Ci = () => {
|
|
|
4624
4624
|
});
|
|
4625
4625
|
};
|
|
4626
4626
|
window.addEventListener("scroll", r), i.addEventListener("click", a), r();
|
|
4627
|
-
}, W = "#page-content",
|
|
4627
|
+
}, W = "#page-content", U = "#text-tooltip", Zi = ".tooltip-btn", Ct = "c-text-tooltip--show", Fi = [
|
|
4628
4628
|
"#page-content .c-content p",
|
|
4629
4629
|
"#page-content .c-content h2",
|
|
4630
4630
|
"#page-content .c-content h3",
|
|
@@ -4636,17 +4636,17 @@ const Ci = () => {
|
|
|
4636
4636
|
"#page-content header span",
|
|
4637
4637
|
"#page-content header h1",
|
|
4638
4638
|
"#page-content header h2"
|
|
4639
|
-
],
|
|
4639
|
+
], ut = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1, qi = (s, t) => {
|
|
4640
4640
|
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;
|
|
4641
|
-
return !!e &&
|
|
4642
|
-
},
|
|
4641
|
+
return !!e && ut(e, t) || !!i && ut(i, t);
|
|
4642
|
+
}, ki = (s) => {
|
|
4643
4643
|
if (!s.focusNode)
|
|
4644
4644
|
return null;
|
|
4645
4645
|
const t = s.anchorNode?.compareDocumentPosition(s.focusNode);
|
|
4646
4646
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4647
|
-
},
|
|
4648
|
-
const i = document.querySelector(`${W} ${
|
|
4649
|
-
`${W} ${
|
|
4647
|
+
}, Bi = (s, t, e) => {
|
|
4648
|
+
const i = document.querySelector(`${W} ${U}`), n = document.querySelector(`${W}`), o = document.querySelectorAll(
|
|
4649
|
+
`${W} ${U} ${Zi}`
|
|
4650
4650
|
);
|
|
4651
4651
|
if (!i || !n) {
|
|
4652
4652
|
console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");
|
|
@@ -4654,44 +4654,44 @@ const Ci = () => {
|
|
|
4654
4654
|
}
|
|
4655
4655
|
Array.from(o).forEach((l) => l.setAttribute("data-selected-text", e));
|
|
4656
4656
|
const r = s.getClientRects(), a = r[t ? r.length - 1 : 0];
|
|
4657
|
-
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(
|
|
4658
|
-
},
|
|
4659
|
-
const s = document.querySelector(`${
|
|
4660
|
-
s && s.classList.remove(
|
|
4657
|
+
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(Ct);
|
|
4658
|
+
}, pt = () => {
|
|
4659
|
+
const s = document.querySelector(`${U}`);
|
|
4660
|
+
s && s.classList.remove(Ct);
|
|
4661
4661
|
}, B = ({ type: s }) => {
|
|
4662
4662
|
const t = window.getSelection();
|
|
4663
4663
|
if (s === "selectionchange") {
|
|
4664
|
-
|
|
4664
|
+
pt();
|
|
4665
4665
|
return;
|
|
4666
4666
|
}
|
|
4667
4667
|
if (!t || !t.rangeCount)
|
|
4668
4668
|
return;
|
|
4669
4669
|
const e = t.getRangeAt(0), i = t.toString().trim();
|
|
4670
4670
|
if (i.length) {
|
|
4671
|
-
const n =
|
|
4672
|
-
n &&
|
|
4671
|
+
const n = qi(e, Fi), o = ki(t) || !1;
|
|
4672
|
+
n && Bi(e, o, i);
|
|
4673
4673
|
return;
|
|
4674
4674
|
}
|
|
4675
|
-
|
|
4676
|
-
},
|
|
4675
|
+
pt();
|
|
4676
|
+
}, Ni = () => {
|
|
4677
4677
|
if (!window?.getSelection) {
|
|
4678
4678
|
console.warn("Selection API isn't supported");
|
|
4679
4679
|
return;
|
|
4680
4680
|
}
|
|
4681
4681
|
document.addEventListener("mouseup", B), document.addEventListener("selectionchange", B), document.addEventListener("touchend", B), document.addEventListener("touchcancel", B);
|
|
4682
|
-
},
|
|
4682
|
+
}, Hi = (s) => {
|
|
4683
4683
|
const { target: t } = s;
|
|
4684
4684
|
if (t instanceof Element) {
|
|
4685
4685
|
const e = t.closest(".c-search-form--button");
|
|
4686
4686
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4687
4687
|
}
|
|
4688
|
-
},
|
|
4688
|
+
}, Wi = (s = document.querySelector(
|
|
4689
4689
|
".c-search-form--button"
|
|
4690
4690
|
)) => {
|
|
4691
4691
|
s && s.addEventListener("click", (t) => {
|
|
4692
|
-
|
|
4692
|
+
Hi(t);
|
|
4693
4693
|
});
|
|
4694
|
-
},
|
|
4694
|
+
}, Vi = ({
|
|
4695
4695
|
tabsContainerElement: s,
|
|
4696
4696
|
event: t
|
|
4697
4697
|
}) => {
|
|
@@ -4707,53 +4707,53 @@ const Ci = () => {
|
|
|
4707
4707
|
}), n.forEach((a) => {
|
|
4708
4708
|
a.setAttribute("aria-hidden", "true");
|
|
4709
4709
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4710
|
-
},
|
|
4710
|
+
}, mt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, ft = (s) => s.code === "ArrowRight" || s.keyCode === 37, ji = (s = document.querySelectorAll(
|
|
4711
4711
|
".js-tabs"
|
|
4712
4712
|
)) => {
|
|
4713
4713
|
s.length > 0 && s.forEach((t) => {
|
|
4714
4714
|
const e = t.querySelectorAll('[role="tab"]');
|
|
4715
4715
|
e.forEach((n) => {
|
|
4716
4716
|
n.addEventListener("click", (o) => {
|
|
4717
|
-
|
|
4717
|
+
Vi({ tabsContainerElement: t, event: o });
|
|
4718
4718
|
});
|
|
4719
4719
|
});
|
|
4720
4720
|
const i = t.querySelector('[role="tablist"]');
|
|
4721
4721
|
if (i && e.length > 0) {
|
|
4722
4722
|
let n = 0;
|
|
4723
4723
|
i.addEventListener("keydown", (o) => {
|
|
4724
|
-
o instanceof KeyboardEvent && (
|
|
4724
|
+
o instanceof KeyboardEvent && (mt(o) || ft(o)) && (e[n].setAttribute("tabindex", "-1"), mt(o) ? (n += 1, n >= e.length && (n = 0)) : ft(o) && (n -= 1, n < 0 && (n = e.length - 1)), e[n].setAttribute("tabindex", "0"), e[n].focus());
|
|
4725
4725
|
});
|
|
4726
4726
|
}
|
|
4727
4727
|
});
|
|
4728
|
-
},
|
|
4728
|
+
}, N = (s) => {
|
|
4729
4729
|
const [t, e] = s.split("h").map(Number);
|
|
4730
4730
|
return t * 60 + e;
|
|
4731
|
-
},
|
|
4731
|
+
}, zt = () => {
|
|
4732
4732
|
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4733
4733
|
return t * 60 + e;
|
|
4734
|
-
},
|
|
4735
|
-
const e =
|
|
4734
|
+
}, Gi = (s, t) => {
|
|
4735
|
+
const e = zt();
|
|
4736
4736
|
if (e < s || e > t)
|
|
4737
4737
|
return 0;
|
|
4738
4738
|
const i = t - s;
|
|
4739
4739
|
return (e - s) / i;
|
|
4740
|
-
},
|
|
4741
|
-
const t =
|
|
4740
|
+
}, Ui = (s) => {
|
|
4741
|
+
const t = zt();
|
|
4742
4742
|
let e = null, i = null, n = -1;
|
|
4743
4743
|
return Array.from(s).find((o, r, a) => {
|
|
4744
4744
|
if (r === a.length - 1)
|
|
4745
4745
|
return !1;
|
|
4746
|
-
const l =
|
|
4746
|
+
const l = N(o.textContent), c = N(a[r + 1].textContent);
|
|
4747
4747
|
return t >= l && t < c ? (e = o.textContent, i = a[r + 1].textContent, n = r, !0) : !1;
|
|
4748
4748
|
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4749
|
-
},
|
|
4749
|
+
}, Ki = () => {
|
|
4750
4750
|
const s = document.querySelectorAll(".c-timeline__time");
|
|
4751
4751
|
if (!s || s.length < 2)
|
|
4752
4752
|
return;
|
|
4753
|
-
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } =
|
|
4753
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = Ui(s);
|
|
4754
4754
|
if (!e || !i)
|
|
4755
4755
|
return;
|
|
4756
|
-
const o =
|
|
4756
|
+
const o = N(e), r = N(i), a = Gi(o, r);
|
|
4757
4757
|
if (t instanceof HTMLElement) {
|
|
4758
4758
|
if (t.classList.contains("c-timeline__progress-bar--is-desktop") && s.length >= 5) {
|
|
4759
4759
|
const l = "172px / 2";
|
|
@@ -4792,49 +4792,134 @@ const Ci = () => {
|
|
|
4792
4792
|
}
|
|
4793
4793
|
}
|
|
4794
4794
|
}
|
|
4795
|
-
}, K = "c-icon-item__container--is-highlighted",
|
|
4795
|
+
}, K = "c-icon-item__container--is-highlighted", Xi = (s) => {
|
|
4796
4796
|
s.find(
|
|
4797
4797
|
(e) => e.classList.contains(K)
|
|
4798
4798
|
)?.classList.remove(K);
|
|
4799
|
-
},
|
|
4799
|
+
}, Yi = () => {
|
|
4800
4800
|
const s = document.querySelector(".c-toolbar");
|
|
4801
4801
|
if (s) {
|
|
4802
4802
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4803
|
-
|
|
4803
|
+
Xi(e), e.find(
|
|
4804
4804
|
(n) => n.querySelector("a")?.getAttribute("href") === t
|
|
4805
4805
|
)?.classList.add(K);
|
|
4806
4806
|
}
|
|
4807
|
-
},
|
|
4808
|
-
const s = document.
|
|
4809
|
-
if (!s
|
|
4807
|
+
}, Ot = () => {
|
|
4808
|
+
const s = document.querySelector(".c-map-towns");
|
|
4809
|
+
if (!s) {
|
|
4810
|
+
new MutationObserver((n, o) => {
|
|
4811
|
+
document.querySelector(".c-map-towns") && (o.disconnect(), Ot());
|
|
4812
|
+
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
4810
4813
|
return;
|
|
4814
|
+
}
|
|
4811
4815
|
const t = () => {
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4816
|
+
const i = document.querySelectorAll(".js-city-marker");
|
|
4817
|
+
if (i.length === 0)
|
|
4818
|
+
return !1;
|
|
4819
|
+
const n = () => {
|
|
4820
|
+
let o = !0;
|
|
4821
|
+
i.forEach((r) => {
|
|
4822
|
+
if (!r.classList.contains("c-map-towns__city-marker--is-hidden"))
|
|
4823
|
+
return;
|
|
4824
|
+
const a = r.querySelector(".js-city-anchor"), l = r.querySelector(".js-city-text"), c = r.querySelector(".js-city-bg");
|
|
4825
|
+
if (!(a instanceof SVGGraphicsElement) || !(l instanceof SVGTextElement) || !(c instanceof SVGRectElement))
|
|
4826
|
+
return;
|
|
4827
|
+
const h = a.getBBox();
|
|
4828
|
+
if (h.width > 0) {
|
|
4829
|
+
const { x: d, y: u, width: m, height: f } = h;
|
|
4830
|
+
r.setAttribute("transform", `translate(${d + m / 2}, ${u + f / 2})`);
|
|
4831
|
+
const p = l.getBBox(), _ = p.width + 8, w = p.height + 4;
|
|
4832
|
+
c.setAttribute("width", `${_}`), c.setAttribute("height", `${w}`), c.setAttribute("x", `${-_ / 2}`), c.setAttribute("y", `${-w - 8}`), l.setAttribute("y", `${-w / 2 - 5}`), r.classList.remove("c-map-towns__city-marker--is-hidden");
|
|
4833
|
+
} else
|
|
4834
|
+
o = !1;
|
|
4835
|
+
}), o || requestAnimationFrame(n);
|
|
4836
|
+
};
|
|
4837
|
+
return requestAnimationFrame(n), !0;
|
|
4827
4838
|
};
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4839
|
+
if (t())
|
|
4840
|
+
return;
|
|
4841
|
+
new MutationObserver((i, n) => {
|
|
4842
|
+
t() && n.disconnect();
|
|
4843
|
+
}).observe(s, {
|
|
4844
|
+
childList: !0,
|
|
4845
|
+
subtree: !0
|
|
4846
|
+
});
|
|
4847
|
+
}, Qi = (s, t) => {
|
|
4848
|
+
if (s.startsWith("97"))
|
|
4849
|
+
return Array.from(
|
|
4850
|
+
document.querySelectorAll(`path[id^="town-${s}"][id$="-drom"]`)
|
|
4851
|
+
);
|
|
4852
|
+
const e = `[id^="town-${s}"]`;
|
|
4853
|
+
return t ? Array.from(t.querySelectorAll(e)) : [];
|
|
4854
|
+
}, Ji = (s, t, e, i) => {
|
|
4855
|
+
(i.startsWith("97") ? s : document.querySelector(
|
|
4856
|
+
`.c-map-towns__layer-towns [href="#${e}"], .c-map-towns__layer-towns [xlink\\:href="#${e}"]`
|
|
4857
|
+
))?.classList.forEach((o) => {
|
|
4858
|
+
o.includes("--") && t.classList.add(o);
|
|
4859
|
+
});
|
|
4860
|
+
}, ts = (s, t) => {
|
|
4861
|
+
const e = s.getAttribute("id"), i = s.getAttribute("data-url"), n = s.getAttribute("data-name");
|
|
4862
|
+
if (!e || !i)
|
|
4863
|
+
return null;
|
|
4864
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
4865
|
+
o.setAttribute("href", i), n && o.setAttribute("title", n);
|
|
4866
|
+
let r;
|
|
4867
|
+
if (t.startsWith("97")) {
|
|
4868
|
+
const a = s.cloneNode(!0);
|
|
4869
|
+
if (!(a instanceof SVGElement))
|
|
4870
|
+
return null;
|
|
4871
|
+
r = a, r.removeAttribute("id");
|
|
4872
|
+
} else
|
|
4873
|
+
r = document.createElementNS("http://www.w3.org/2000/svg", "use"), r.setAttribute("href", `#${e}`);
|
|
4874
|
+
return r.classList.add("c-map-towns__path"), Ji(s, r, e, t), o.appendChild(r), o;
|
|
4875
|
+
}, es = (s, t, e) => {
|
|
4876
|
+
s.innerHTML = "", e.forEach((o) => s.appendChild(o));
|
|
4877
|
+
const i = s.getBBox(), n = 5;
|
|
4878
|
+
t.setAttribute(
|
|
4879
|
+
"viewBox",
|
|
4880
|
+
`${i.x - n} ${i.y - n} ${i.width + n * 2} ${i.height + n * 2}`
|
|
4881
|
+
);
|
|
4882
|
+
};
|
|
4883
|
+
let gt = !1;
|
|
4884
|
+
const X = () => {
|
|
4885
|
+
if (gt)
|
|
4886
|
+
return;
|
|
4887
|
+
if (!document.querySelector(".c-map-towns")) {
|
|
4888
|
+
new MutationObserver((d, u) => {
|
|
4889
|
+
document.querySelector(".c-map-towns") && (u.disconnect(), X());
|
|
4890
|
+
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
4891
|
+
return;
|
|
4892
|
+
}
|
|
4893
|
+
const t = document.getElementById("js-zoom-overlay"), e = document.getElementById("js-zoom-svg"), i = document.getElementById("js-zoom-group"), n = document.getElementById("js-zoom-close");
|
|
4894
|
+
if (!(t instanceof HTMLElement) || !(e instanceof SVGSVGElement) || !(i instanceof SVGGElement) || !(n instanceof HTMLElement)) {
|
|
4895
|
+
requestAnimationFrame(X);
|
|
4896
|
+
return;
|
|
4897
|
+
}
|
|
4898
|
+
gt = !0;
|
|
4899
|
+
const o = document.querySelector(".c-map-towns__map"), r = document.querySelector(".c-map-towns__droms"), a = document.getElementById("js-zoom-label"), l = (h) => {
|
|
4900
|
+
const { target: d } = h;
|
|
4901
|
+
if (!(d instanceof Element))
|
|
4902
|
+
return;
|
|
4903
|
+
const u = d?.closest(".c-map-towns__dept-trigger");
|
|
4904
|
+
if (!u)
|
|
4905
|
+
return;
|
|
4906
|
+
const m = u.getAttribute("id")?.replace("out-", "") || "", f = u.getAttribute("data-name"), p = document.querySelector(".c-map-towns__sprite"), w = Qi(m, p).map((S) => ts(S, m)).filter((S) => S !== null);
|
|
4907
|
+
a && f && (a.textContent = f), es(i, e, w), t.setAttribute("aria-hidden", "false");
|
|
4908
|
+
};
|
|
4909
|
+
o?.addEventListener("click", l), r?.addEventListener("click", l), n.addEventListener("click", () => {
|
|
4910
|
+
t.setAttribute("aria-hidden", "true");
|
|
4911
|
+
}), t.addEventListener("click", (h) => {
|
|
4912
|
+
h.target === t && t.setAttribute("aria-hidden", "true");
|
|
4913
|
+
});
|
|
4914
|
+
}, ls = () => {
|
|
4915
|
+
te(), ji(), Nt(), oe(), Kt(), $i(), Di(), de(), Wi(), H("winterOlympicsGames", "countdown-winter-olympics-games"), H("eurovision", "countdown-eurovision"), H("worldFoot2026", "countdown-world-foot-2026"), Ni(), kt(), ie(), Vt(), qt(
|
|
4831
4916
|
"localisation-input",
|
|
4832
4917
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
4833
4918
|
"?searchValue=",
|
|
4834
4919
|
"text",
|
|
4835
4920
|
"text"
|
|
4836
|
-
),
|
|
4921
|
+
), Wt(), Ot(), Yi(), Rt(), Zt(), se(), X(), ve(), _e(), ee(), $t(), Ki(), Ri();
|
|
4837
4922
|
};
|
|
4838
4923
|
export {
|
|
4839
|
-
|
|
4924
|
+
ls as initScripts
|
|
4840
4925
|
};
|