aptechka 0.78.5 → 0.78.7
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/lib/SourceElement-BnMxiOqY.js +265 -0
- package/lib/SourceElement-VVdVc1d-.cjs +5 -0
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +1 -1
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +28 -28
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/{url-CBKXmNOi.js → url-Ddgqz4Q_.js} +15 -15
- package/lib/url-VIZgwj_h.cjs +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +26 -22
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +1 -1
- package/package.json +2 -1
- package/lib/SourceElement-DE6khDs3.cjs +0 -5
- package/lib/SourceElement-DJxX7uN5.js +0 -260
- package/lib/url-Dns-01WU.cjs +0 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
var X = (l) => {
|
|
2
|
+
throw TypeError(l);
|
|
3
|
+
};
|
|
4
|
+
var Z = (l, a, e) => a.has(l) || X("Cannot " + e);
|
|
5
|
+
var t = (l, a, e) => (Z(l, a, "read from private field"), e ? e.call(l) : a.get(l)), i = (l, a, e) => a.has(l) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(l) : a.set(l, e), s = (l, a, e, h) => (Z(l, a, "write to private field"), h ? h.call(l, e) : a.set(l, e), e), F = (l, a, e) => (Z(l, a, "access private method"), e);
|
|
6
|
+
import { ElementLinkedStore as st } from "./element-linked-store/index.js";
|
|
7
|
+
import { i as it } from "./index-Bv9zgfdb.js";
|
|
8
|
+
import { d as w } from "./events-CsVF98U6.js";
|
|
9
|
+
import { k as Y } from "./string-BlMQbe8b.js";
|
|
10
|
+
import "construct-style-sheets-polyfill";
|
|
11
|
+
import { loading as J } from "./loading/index.js";
|
|
12
|
+
import { RESIZE_ORDER as rt } from "./order/index.js";
|
|
13
|
+
import { windowResizer as tt } from "./window-resizer/index.js";
|
|
14
|
+
import { S as at } from "./Store-0BVty6AZ.js";
|
|
15
|
+
var C, S, z, x, m, p, q;
|
|
16
|
+
class nt {
|
|
17
|
+
constructor(a) {
|
|
18
|
+
i(this, C);
|
|
19
|
+
i(this, S);
|
|
20
|
+
i(this, z);
|
|
21
|
+
i(this, x);
|
|
22
|
+
i(this, m);
|
|
23
|
+
i(this, p);
|
|
24
|
+
i(this, q);
|
|
25
|
+
s(this, C, a);
|
|
26
|
+
let e = a.split(".");
|
|
27
|
+
const h = /\b\d{1,2}x\b/g, n = e.find((y) => y.match(h) && parseInt(y));
|
|
28
|
+
s(this, z, n ? parseInt(n) : 1), n && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
+
const o = /\d+max/g, d = /\d+min/g, N = /\d+mar/g, U = /\d+mir/g, W = e.find((y) => y.match(o)), u = e.find((y) => y.match(d)), L = e.find((y) => y.match(N)), Q = e.find((y) => y.match(U));
|
|
30
|
+
L ? (s(this, m, parseInt(L)), s(this, p, "max"), s(this, x, `(max-aspect-ratio: ${t(this, m)})`)) : Q ? (s(this, m, parseInt(Q)), s(this, p, "max"), s(this, x, `(min-aspect-ratio: ${t(this, m)})`)) : W ? (s(this, m, parseInt(W)), s(this, p, "max"), s(this, x, `(max-width: ${t(this, m)}px)`)) : u ? (s(this, m, parseInt(u)), s(this, x, `(min-width: ${t(this, m)}px)`), s(this, p, "min")) : (s(this, m, 0), s(this, x, `(min-width: ${t(this, m)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
|
|
31
|
+
`.${t(this, m)}${t(this, p)}`,
|
|
32
|
+
""
|
|
33
|
+
)), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
|
|
34
|
+
`.${t(this, m)}${t(this, p)}`,
|
|
35
|
+
""
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
get url() {
|
|
39
|
+
return t(this, C);
|
|
40
|
+
}
|
|
41
|
+
get name() {
|
|
42
|
+
return t(this, S);
|
|
43
|
+
}
|
|
44
|
+
get density() {
|
|
45
|
+
return t(this, z);
|
|
46
|
+
}
|
|
47
|
+
get query() {
|
|
48
|
+
return t(this, x);
|
|
49
|
+
}
|
|
50
|
+
get extension() {
|
|
51
|
+
return t(this, q);
|
|
52
|
+
}
|
|
53
|
+
get queryType() {
|
|
54
|
+
return t(this, p);
|
|
55
|
+
}
|
|
56
|
+
get queryValue() {
|
|
57
|
+
return t(this, m);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), x = new WeakMap(), m = new WeakMap(), p = new WeakMap(), q = new WeakMap();
|
|
61
|
+
var v;
|
|
62
|
+
class et {
|
|
63
|
+
constructor(a, e) {
|
|
64
|
+
i(this, v);
|
|
65
|
+
s(this, v, /* @__PURE__ */ new Map());
|
|
66
|
+
const h = (e == null ? void 0 : e.mediaBuckets) !== !1, n = typeof a == "string" ? h ? a.trim().split(",").map((u) => u.trim()).filter((u) => !!u) : [a] : a, o = [];
|
|
67
|
+
n.forEach((u) => {
|
|
68
|
+
const L = new nt(u);
|
|
69
|
+
o.push([L.query, L]);
|
|
70
|
+
});
|
|
71
|
+
const d = o.filter((u) => u[1].queryType.includes("max")).sort((u, L) => L[1].queryValue - u[1].queryValue), N = o.filter((u) => u[1].queryType.includes("min") && u[1].queryValue !== 0).sort((u, L) => u[1].queryValue - L[1].queryValue), U = o.filter((u) => u[0] === "(min-width: 0px)");
|
|
72
|
+
(U ? [...U, ...d, ...N] : [...d, ...N]).forEach((u) => {
|
|
73
|
+
t(this, v).has(u[0]) || t(this, v).set(u[0], []), t(this, v).get(u[0]).push(u[1]);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
get mediaBuckets() {
|
|
77
|
+
return t(this, v);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
v = new WeakMap();
|
|
81
|
+
var k, $;
|
|
82
|
+
class ht extends at {
|
|
83
|
+
constructor(e) {
|
|
84
|
+
super(void 0);
|
|
85
|
+
i(this, k);
|
|
86
|
+
i(this, $, () => {
|
|
87
|
+
let e;
|
|
88
|
+
t(this, k).mediaBuckets.forEach((o, d) => {
|
|
89
|
+
matchMedia(d).matches && (e = o);
|
|
90
|
+
});
|
|
91
|
+
let h, n = 0;
|
|
92
|
+
e == null || e.forEach((o) => {
|
|
93
|
+
o.density > n && o.density <= Math.max(devicePixelRatio, 1) && (n = o.density, h = o);
|
|
94
|
+
}), e != null && e.length && !h && (h = e[0]), this.current = h;
|
|
95
|
+
});
|
|
96
|
+
s(this, k, new et(e.srcset, e.sourceSetOptions));
|
|
97
|
+
}
|
|
98
|
+
updateSource(e) {
|
|
99
|
+
s(this, k, new et(e.srcset, e.sourceSetOptions)), t(this, $).call(this);
|
|
100
|
+
}
|
|
101
|
+
close() {
|
|
102
|
+
super.close(), this.disconnect();
|
|
103
|
+
}
|
|
104
|
+
connect() {
|
|
105
|
+
tt.subscribe(t(this, $), rt.SOURCE_MANAGER), t(this, $).call(this);
|
|
106
|
+
}
|
|
107
|
+
disconnect() {
|
|
108
|
+
tt.unsubscribe(t(this, $));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
k = new WeakMap(), $ = new WeakMap();
|
|
112
|
+
function ot(l) {
|
|
113
|
+
if (isNaN(l)) return "0:00";
|
|
114
|
+
const a = Math.floor(Math.max(0, l)), e = Math.floor(a / 3600), h = Math.floor(a % 3600 / 60), o = (a % 60).toString().padStart(2, "0");
|
|
115
|
+
if (e > 0) {
|
|
116
|
+
const d = h.toString().padStart(2, "0");
|
|
117
|
+
return `${e}:${d}:${o}`;
|
|
118
|
+
} else
|
|
119
|
+
return `${h}:${o}`;
|
|
120
|
+
}
|
|
121
|
+
let ct = 0;
|
|
122
|
+
var f, r, I, E, b, g, B, A, c, O, R, M, P, T, j, G, D, K, _, H, V;
|
|
123
|
+
class xt extends HTMLElement {
|
|
124
|
+
constructor(e) {
|
|
125
|
+
super();
|
|
126
|
+
i(this, T);
|
|
127
|
+
i(this, f, null);
|
|
128
|
+
i(this, r, null);
|
|
129
|
+
i(this, I, this);
|
|
130
|
+
i(this, E, !1);
|
|
131
|
+
i(this, b, !1);
|
|
132
|
+
i(this, g, !1);
|
|
133
|
+
i(this, B, "");
|
|
134
|
+
i(this, A, "");
|
|
135
|
+
i(this, c, new st(this, {
|
|
136
|
+
loading: !1,
|
|
137
|
+
loaded: !1,
|
|
138
|
+
error: !1,
|
|
139
|
+
clear: !1,
|
|
140
|
+
playing: !1,
|
|
141
|
+
metadata: !1
|
|
142
|
+
}));
|
|
143
|
+
i(this, O, null);
|
|
144
|
+
i(this, R);
|
|
145
|
+
i(this, M, null);
|
|
146
|
+
i(this, P);
|
|
147
|
+
i(this, G, (e) => {
|
|
148
|
+
const h = e[0];
|
|
149
|
+
t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && h.isIntersecting && this.triggerLazyLoad(), h.isIntersecting ? w(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (F(this, T, j).call(this, void 0), s(this, b, !1)), w(this, "sourceRelease", { custom: !0 }));
|
|
150
|
+
});
|
|
151
|
+
i(this, D, () => {
|
|
152
|
+
t(this, c).set("loaded", !0), t(this, c).set("error", !1), t(this, c).set("loading", !1), !t(this, g) && !t(this, E) && J.complete(t(this, A)), w(this, "sourceLoaded", { custom: !0 });
|
|
153
|
+
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
154
|
+
e ? s(this, R, setTimeout(() => {
|
|
155
|
+
t(this, c).set("clear", !0);
|
|
156
|
+
}, parseFloat(e) * 1e3)) : t(this, c).set("clear", !0), s(this, E, !0);
|
|
157
|
+
});
|
|
158
|
+
i(this, K, (e) => {
|
|
159
|
+
t(this, c).set("loaded", !1), t(this, c).set("error", !0), t(this, c).set("loading", !1), !t(this, g) && !t(this, E) && J.error(t(this, A)), w(this, "sourceError", { custom: !0 }), s(this, E, !0);
|
|
160
|
+
});
|
|
161
|
+
i(this, _, () => {
|
|
162
|
+
t(this, c).set("playing", !0), w(this, "sourcePlay", { custom: !0 });
|
|
163
|
+
});
|
|
164
|
+
i(this, H, () => {
|
|
165
|
+
t(this, c).set("playing", !1), w(this, "sourcePause", { custom: !0 });
|
|
166
|
+
});
|
|
167
|
+
i(this, V, () => {
|
|
168
|
+
const e = t(this, r);
|
|
169
|
+
(e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, c).set("metadata", !0), w(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((h) => {
|
|
170
|
+
h.textContent = ot(e.duration);
|
|
171
|
+
}));
|
|
172
|
+
});
|
|
173
|
+
s(this, P, e == null ? void 0 : e.sourceSetOptions), it && window.IntersectionObserver && s(this, O, new IntersectionObserver(
|
|
174
|
+
t(this, G)
|
|
175
|
+
)), t(this, c).subscribe((h) => {
|
|
176
|
+
var o;
|
|
177
|
+
const n = (o = this.getAttribute("data-global-play-class")) == null ? void 0 : o.split(
|
|
178
|
+
","
|
|
179
|
+
);
|
|
180
|
+
n != null && n.length && (h.current.playing ? n.forEach((d) => {
|
|
181
|
+
document.documentElement.classList.add(d.trim());
|
|
182
|
+
}) : n.forEach((d) => {
|
|
183
|
+
document.documentElement.classList.remove(d.trim());
|
|
184
|
+
}));
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
get consumerElement() {
|
|
188
|
+
return t(this, r);
|
|
189
|
+
}
|
|
190
|
+
get consumerHolderElement() {
|
|
191
|
+
return t(this, I);
|
|
192
|
+
}
|
|
193
|
+
get sourceManager() {
|
|
194
|
+
return t(this, f);
|
|
195
|
+
}
|
|
196
|
+
get status() {
|
|
197
|
+
return t(this, c);
|
|
198
|
+
}
|
|
199
|
+
get isLazy() {
|
|
200
|
+
return t(this, g);
|
|
201
|
+
}
|
|
202
|
+
get currentURL() {
|
|
203
|
+
return t(this, M);
|
|
204
|
+
}
|
|
205
|
+
get isFirstLoadHappened() {
|
|
206
|
+
return t(this, E);
|
|
207
|
+
}
|
|
208
|
+
triggerLazyLoad() {
|
|
209
|
+
!t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), F(this, T, j).call(this, t(this, f).current));
|
|
210
|
+
}
|
|
211
|
+
connectedCallback() {
|
|
212
|
+
s(this, B, `source-consumer-${++ct}`);
|
|
213
|
+
const e = this.getAttribute("srcset") || "", h = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
214
|
+
h && t(this, c).addElement(h), s(this, I, this.querySelector("[data-consumer-holder]") || this), this.querySelectorAll(".source-consumer").forEach((n) => n == null ? void 0 : n.remove()), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
215
|
+
display: block;
|
|
216
|
+
width: 100%;
|
|
217
|
+
height: 100%;
|
|
218
|
+
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, _)), t(this, r).addEventListener("pause", t(this, H)), t(this, r).addEventListener(
|
|
219
|
+
"loadedmetadata",
|
|
220
|
+
t(this, V)
|
|
221
|
+
), t(this, V).call(this), this.classList.contains("MaskedVideo__video__element") && console.log(), Array.from(this.attributes).forEach((n) => {
|
|
222
|
+
if (n.name !== "srcset") {
|
|
223
|
+
const o = n.nodeValue || "", d = Y(n.name);
|
|
224
|
+
d in t(this, r) && (t(this, r)[d] = o || !0);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
for (const n in this.dataset) {
|
|
228
|
+
const o = this.dataset[n], d = Y(n);
|
|
229
|
+
d in t(this, r) && (t(this, r)[d] = o ? o === "false" ? !1 : o : !0);
|
|
230
|
+
}
|
|
231
|
+
t(this, I).appendChild(t(this, r)), s(this, f, new ht({
|
|
232
|
+
srcset: e,
|
|
233
|
+
sourceSetOptions: t(this, P)
|
|
234
|
+
})), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((n) => {
|
|
235
|
+
(!t(this, g) || t(this, g) && t(this, b)) && F(this, T, j).call(this, n.current);
|
|
236
|
+
}), t(this, f).connect(), t(this, O).observe(this);
|
|
237
|
+
}
|
|
238
|
+
disconnectedCallback() {
|
|
239
|
+
var e;
|
|
240
|
+
clearTimeout(t(this, R)), t(this, O).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, _)), t(this, r).removeEventListener("pause", t(this, H)), t(this, r).removeEventListener(
|
|
241
|
+
"loadedmetadata",
|
|
242
|
+
t(this, V)
|
|
243
|
+
), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, E, !1), s(this, b, !1), t(this, c).reset();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
f = new WeakMap(), r = new WeakMap(), I = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), B = new WeakMap(), A = new WeakMap(), c = new WeakMap(), O = new WeakMap(), R = new WeakMap(), M = new WeakMap(), P = new WeakMap(), T = new WeakSet(), j = function(e) {
|
|
247
|
+
if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, c).set("loaded", !1), t(this, c).set("error", !1), t(this, c).set("loading", !1), t(this, c).set("clear", !1), t(this, c).set("playing", !1), t(this, c).set("metadata", !1), e) {
|
|
248
|
+
s(this, A, `${t(this, B)}-${e.url}`);
|
|
249
|
+
const h = this.hasAttribute("keep-source-parameters");
|
|
250
|
+
t(this, c).set("loading", !0), s(this, M, h ? e.url : e.name + e.extension), this.consumeSource(t(this, M)), !t(this, g) && !t(this, E) && J.add(t(this, A)), t(this, r).onloadeddata = () => {
|
|
251
|
+
t(this, D).call(this);
|
|
252
|
+
}, t(this, r).onload = () => {
|
|
253
|
+
t(this, D).call(this);
|
|
254
|
+
}, t(this, r).onerror = () => {
|
|
255
|
+
t(this, K).call(this, t(this, M));
|
|
256
|
+
};
|
|
257
|
+
} else
|
|
258
|
+
s(this, M, null), this.consumeSource(null);
|
|
259
|
+
}, G = new WeakMap(), D = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), H = new WeakMap(), V = new WeakMap();
|
|
260
|
+
export {
|
|
261
|
+
nt as S,
|
|
262
|
+
xt as a,
|
|
263
|
+
et as b,
|
|
264
|
+
ht as c
|
|
265
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var Y=l=>{throw TypeError(l)};var Z=(l,n,e)=>n.has(l)||Y("Cannot "+e);var t=(l,n,e)=>(Z(l,n,"read from private field"),e?e.call(l):n.get(l)),i=(l,n,e)=>n.has(l)?Y("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,e),s=(l,n,e,h)=>(Z(l,n,"write to private field"),h?h.call(l,e):n.set(l,e),e),F=(l,n,e)=>(Z(l,n,"access private method"),e);const rt=require("./element-linked-store/index.cjs"),nt=require("./index-DekP7OZe.cjs"),w=require("./events-KVanG9sR.cjs"),tt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const J=require("./loading/index.cjs"),at=require("./order/index.cjs"),et=require("./window-resizer/index.cjs"),ht=require("./Store-Cd1GlEmZ.cjs");var V,b,_,L,m,p,M;class st{constructor(n){i(this,V);i(this,b);i(this,_);i(this,L);i(this,m);i(this,p);i(this,M);s(this,V,n);let e=n.split(".");const h=/\b\d{1,2}x\b/g,a=e.find(y=>y.match(h)&&parseInt(y));s(this,_,a?parseInt(a):1),a&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const o=/\d+max/g,d=/\d+min/g,N=/\d+mar/g,U=/\d+mir/g,W=e.find(y=>y.match(o)),u=e.find(y=>y.match(d)),x=e.find(y=>y.match(N)),X=e.find(y=>y.match(U));x?(s(this,m,parseInt(x)),s(this,p,"max"),s(this,L,`(max-aspect-ratio: ${t(this,m)})`)):X?(s(this,m,parseInt(X)),s(this,p,"max"),s(this,L,`(min-aspect-ratio: ${t(this,m)})`)):W?(s(this,m,parseInt(W)),s(this,p,"max"),s(this,L,`(max-width: ${t(this,m)}px)`)):u?(s(this,m,parseInt(u)),s(this,L,`(min-width: ${t(this,m)}px)`),s(this,p,"min")):(s(this,m,0),s(this,L,`(min-width: ${t(this,m)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,m)}${t(this,p)}`,"")),s(this,M,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,m)}${t(this,p)}`,""))}get url(){return t(this,V)}get name(){return t(this,b)}get density(){return t(this,_)}get query(){return t(this,L)}get extension(){return t(this,M)}get queryType(){return t(this,p)}get queryValue(){return t(this,m)}}V=new WeakMap,b=new WeakMap,_=new WeakMap,L=new WeakMap,m=new WeakMap,p=new WeakMap,M=new WeakMap;var v;class Q{constructor(n,e){i(this,v);s(this,v,new Map);const h=(e==null?void 0:e.mediaBuckets)!==!1,a=typeof n=="string"?h?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,o=[];a.forEach(u=>{const x=new st(u);o.push([x.query,x])});const d=o.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),N=o.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=o.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...d,...N]:[...d,...N]).forEach(u=>{t(this,v).has(u[0])||t(this,v).set(u[0],[]),t(this,v).get(u[0]).push(u[1])})}get mediaBuckets(){return t(this,v)}}v=new WeakMap;var A,$;class it extends ht.Store{constructor(e){super(void 0);i(this,A);i(this,$,()=>{let e;t(this,A).mediaBuckets.forEach((o,d)=>{matchMedia(d).matches&&(e=o)});let h,a=0;e==null||e.forEach(o=>{o.density>a&&o.density<=Math.max(devicePixelRatio,1)&&(a=o.density,h=o)}),e!=null&&e.length&&!h&&(h=e[0]),this.current=h});s(this,A,new Q(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,A,new Q(e.srcset,e.sourceSetOptions)),t(this,$).call(this)}close(){super.close(),this.disconnect()}connect(){et.windowResizer.subscribe(t(this,$),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,$).call(this)}disconnect(){et.windowResizer.unsubscribe(t(this,$))}}A=new WeakMap,$=new WeakMap;function ot(l){if(isNaN(l))return"0:00";const n=Math.floor(Math.max(0,l)),e=Math.floor(n/3600),h=Math.floor(n%3600/60),o=(n%60).toString().padStart(2,"0");if(e>0){const d=h.toString().padStart(2,"0");return`${e}:${d}:${o}`}else return`${h}:${o}`}let ct=0;var f,r,I,E,S,g,z,k,c,R,O,q,B,T,j,G,P,K,D,H,C;class lt extends HTMLElement{constructor(e){super();i(this,T);i(this,f,null);i(this,r,null);i(this,I,this);i(this,E,!1);i(this,S,!1);i(this,g,!1);i(this,z,"");i(this,k,"");i(this,c,new rt.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,R,null);i(this,O);i(this,q,null);i(this,B);i(this,G,e=>{const h=e[0];t(this,g)&&(!t(this,S)||this.hasAttribute("reload-source"))&&h.isIntersecting&&this.triggerLazyLoad(),h.isIntersecting?w.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,T,j).call(this,void 0),s(this,S,!1)),w.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,P,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.complete(t(this,k)),w.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,O,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,E,!0)});i(this,K,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.error(t(this,k)),w.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,D,()=>{t(this,c).set("playing",!0),w.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,H,()=>{t(this,c).set("playing",!1),w.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,C,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,c).set("metadata",!0),w.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(h=>{h.textContent=ot(e.duration)}))});s(this,B,e==null?void 0:e.sourceSetOptions),nt.isBrowser&&window.IntersectionObserver&&s(this,R,new IntersectionObserver(t(this,G))),t(this,c).subscribe(h=>{var o;const a=(o=this.getAttribute("data-global-play-class"))==null?void 0:o.split(",");a!=null&&a.length&&(h.current.playing?a.forEach(d=>{document.documentElement.classList.add(d.trim())}):a.forEach(d=>{document.documentElement.classList.remove(d.trim())}))})}get consumerElement(){return t(this,r)}get consumerHolderElement(){return t(this,I)}get sourceManager(){return t(this,f)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,q)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,S)&&t(this,f).current&&t(this,f).current!==t(this,f).previous&&(s(this,S,!0),F(this,T,j).call(this,t(this,f).current))}connectedCallback(){s(this,z,`source-consumer-${++ct}`);const e=this.getAttribute("srcset")||"",h=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;h&&t(this,c).addElement(h),s(this,I,this.querySelector("[data-consumer-holder]")||this),this.querySelectorAll(".source-consumer").forEach(a=>a==null?void 0:a.remove()),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,D)),t(this,r).addEventListener("pause",t(this,H)),t(this,r).addEventListener("loadedmetadata",t(this,C)),t(this,C).call(this),this.classList.contains("MaskedVideo__video__element")&&console.log(),Array.from(this.attributes).forEach(a=>{if(a.name!=="srcset"){const o=a.nodeValue||"",d=tt.kebabToCamel(a.name);d in t(this,r)&&(t(this,r)[d]=o||!0)}});for(const a in this.dataset){const o=this.dataset[a],d=tt.kebabToCamel(a);d in t(this,r)&&(t(this,r)[d]=o?o==="false"?!1:o:!0)}t(this,I).appendChild(t(this,r)),s(this,f,new it({srcset:e,sourceSetOptions:t(this,B)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(a=>{(!t(this,g)||t(this,g)&&t(this,S))&&F(this,T,j).call(this,a.current)}),t(this,f).connect(),t(this,R).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,O)),t(this,R).disconnect(),(e=t(this,f))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,D)),t(this,r).removeEventListener("pause",t(this,H)),t(this,r).removeEventListener("loadedmetadata",t(this,C)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,S,!1),t(this,c).reset()}}f=new WeakMap,r=new WeakMap,I=new WeakMap,E=new WeakMap,S=new WeakMap,g=new WeakMap,z=new WeakMap,k=new WeakMap,c=new WeakMap,R=new WeakMap,O=new WeakMap,q=new WeakMap,B=new WeakMap,T=new WeakSet,j=function(e){if(clearTimeout(t(this,O)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),t(this,c).set("playing",!1),t(this,c).set("metadata",!1),e){s(this,k,`${t(this,z)}-${e.url}`);const h=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,q,h?e.url:e.name+e.extension),this.consumeSource(t(this,q)),!t(this,g)&&!t(this,E)&&J.loading.add(t(this,k)),t(this,r).onloadeddata=()=>{t(this,P).call(this)},t(this,r).onload=()=>{t(this,P).call(this)},t(this,r).onerror=()=>{t(this,K).call(this,t(this,q))}}else s(this,q,null),this.consumeSource(null)},G=new WeakMap,P=new WeakMap,K=new WeakMap,D=new WeakMap,H=new WeakMap,C=new WeakMap;exports.Source=st;exports.SourceElement=lt;exports.SourceManager=it;exports.SourceSet=Q;
|
package/lib/iframe/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-
|
|
1
|
+
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
|
package/lib/iframe/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var a = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var u = (r, t, e) => t.has(r) || a("Cannot " + e);
|
|
5
5
|
var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
|
|
6
|
-
import { a as E } from "../SourceElement-
|
|
6
|
+
import { a as E } from "../SourceElement-BnMxiOqY.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as f } from "../index-Bv9zgfdb.js";
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
|
package/lib/image/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as m } from "../Viewport-DA10iWAO.js";
|
|
2
|
-
import { a as s } from "../SourceElement-
|
|
2
|
+
import { a as s } from "../SourceElement-BnMxiOqY.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
4
|
import "../Store-0BVty6AZ.js";
|
|
5
5
|
import { i } from "../index-Bv9zgfdb.js";
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var fe=Object.defineProperty,ge=Object.defineProperties;var Ee=Object.getOwnPropertyDescriptors;var Zt=Object.getOwnPropertySymbols;var be=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var _t=(h,e)=>(e=Symbol[h])?e:Symbol.for("Symbol."+h),ee=h=>{throw TypeError(h)};var te=(h,e,s)=>e in h?fe(h,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):h[e]=s,Rt=(h,e)=>{for(var s in e||(e={}))be.call(e,s)&&te(h,s,e[s]);if(Zt)for(var s of Zt(e))ve.call(e,s)&&te(h,s,e[s]);return h},qt=(h,e)=>ge(h,Ee(e));var Dt=(h,e,s)=>e.has(h)||ee("Cannot "+s);var t=(h,e,s)=>(Dt(h,e,"read from private field"),s?s.call(h):e.get(h)),l=(h,e,s)=>e.has(h)?ee("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,s),o=(h,e,s,a)=>(Dt(h,e,"write to private field"),a?a.call(h,s):e.set(h,s),s),E=(h,e,s)=>(Dt(h,e,"access private method"),s);var G=(h,e,s)=>new Promise((a,n)=>{var b=d=>{try{u(s.next(d))}catch(v){n(v)}},f=d=>{try{u(s.throw(d))}catch(v){n(v)}},u=d=>d.done?a(d.value):Promise.resolve(d.value).then(b,f);u((s=s.apply(h,e)).next())});var se=(h,e,s)=>(e=h[_t("asyncIterator")])?e.call(h):(h=h[_t("iterator")](),e={},s=(a,n)=>(n=h[a])&&(e[a]=b=>new Promise((f,u,d)=>(b=n.call(h,b),d=b.done,Promise.resolve(b.value).then(v=>f({value:v,done:d}),u)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("../index-DekP7OZe.cjs"),D=require("../events-KVanG9sR.cjs"),ie=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const mt=require("../url-Dns-01WU.cjs"),re=require("../string-DUXXtU8v.cjs"),Le=require("../math-GDWEqu7y.cjs"),Se=require("../css-value-parser/index.cjs");class oe extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,a]of Object.entries(e))this.setAttribute(s,a)}}ne.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",oe);var R,i,x,at,xt,he,ft,nt;class zt{constructor(e,s){l(this,x);l(this,R);l(this,i);l(this,ft,e=>{e.preventDefault(),E(this,x,he).call(this)});l(this,nt,()=>{const e=t(this,i).hasAttribute("data-revalidate");t(this,R).prefetch(t(this,x,at),e),t(this,i).removeEventListener("pointerenter",t(this,nt))});o(this,R,s),o(this,i,e),t(this,i).addEventListener("click",t(this,ft)),this.checkCurrent(location.href.replace(location.origin,""));const a=E(this,x,xt).call(this,t(this,i).getAttribute("data-pagination-set-link")||t(this,i).getAttribute("data-pagination-more-link")||t(this,i).getAttribute("data-pagination-next-link")||t(this,i).getAttribute("data-pagination-prev-link"));a&&this.updatePagination(a.currentPage,a.selector),t(this,i).hasAttribute("data-prefetch")&&t(this,i).addEventListener("pointerenter",t(this,nt))}get element(){return t(this,i)}checkCurrent(e){var v,et;const s=t(this,R).normalizePath(e),a=t(this,R).normalizePath(t(this,x,at));t(this,i).hasAttribute("data-include")&&s.pathname.includes(a.pathname)?t(this,i).classList.add("current"):a.pathname===s.pathname?t(this,i).classList.add("current"):(v=t(this,i).getAttribute("data-associated-paths"))!=null&&v.split(",").find(w=>s.pathname.includes(w))?t(this,i).classList.add("current"):t(this,i).classList.remove("current"),s.path===a.path?t(this,i).classList.add("exact"):t(this,i).classList.remove("exact");const[n,b]=(et=t(this,x,at).split("#")[0])==null?void 0:et.split("?"),f=new URLSearchParams(b),u=new URLSearchParams(location.search);let d=0;for(const[w]of u)f.has(w)&&u.get(w)===f.get(w)&&d++;d?(t(this,i).classList.toggle("all-params-matched",u.size===d),t(this,i).classList.toggle("some-params-matched",u.size!==d)):!u.size&&t(this,i).hasAttribute("data-match-no-params")?t(this,i).classList.add("all-params-matched"):(t(this,i).classList.remove("all-params-matched"),t(this,i).classList.remove("some-params-matched"));for(const w in t(this,i).dataset){const st=re.camelToKebab(w);if(st.startsWith("match-param-")){const $=st.split("match-param-")[1],y=t(this,i).dataset[w],c=`param-${$}-matched`;u.has($)&&u.get($)===y||!u.has($)&&(y===""||y==="*"||y==="all"||y==="any"||y==="vse")?t(this,i).classList.add(c):t(this,i).classList.remove(c)}}}updatePagination(e,s){const a=E(this,x,xt).call(this,s);if(a)if(a.element.setAttribute("data-current-page",e.toString()),t(this,i).hasAttribute("data-pagination-more-link"))if(e<a.totalPages){t(this,i).style.display="";const n=t(this,i).querySelector("[data-pagination-more-link-counter]");n&&(n.textContent=(a.totalPages-e).toString());const b=t(this,i).getAttribute("href"),f=new URL(b,window.location.origin);f.searchParams.set("page",(e+1).toString());const u=f.href.replace(f.origin,"").toString();t(this,i).setAttribute("href",u),this.checkCurrent(u)}else t(this,i).style.display="none";else if(t(this,i).hasAttribute("data-pagination-prev-link")||t(this,i).hasAttribute("data-pagination-next-link")){const n=t(this,i).hasAttribute("data-pagination-prev-link"),b=t(this,i).getAttribute("href"),f=new URL(b,window.location.origin),u=e+(n?-1:1);f.searchParams.set("page",Le.clamp(u,1,a.totalPages).toString());const d=f.href.replace(f.origin,"").toString();t(this,i).setAttribute("href",d),n?u<1?(t(this,i).classList.add("pagination-disabled"),t(this,i).setAttribute("tabindex","-1")):(t(this,i).classList.remove("pagination-disabled"),t(this,i).removeAttribute("tabindex")):u>a.totalPages?(t(this,i).classList.add("pagination-disabled"),t(this,i).setAttribute("tabindex","-1")):(t(this,i).classList.remove("pagination-disabled"),t(this,i).removeAttribute("tabindex"))}else t(this,i).hasAttribute("data-pagination-set-link")&&(t(this,i).getAttribute("data-value")===e.toString()?t(this,i).classList.add("pagination-current"):t(this,i).classList.remove("pagination-current"))}destroy(){t(this,i).removeEventListener("click",t(this,ft)),t(this,i).removeEventListener("pointerenter",t(this,nt)),t(this,i).classList.remove("current","exact","pagination-current")}}R=new WeakMap,i=new WeakMap,x=new WeakSet,at=function(){const e=new URL(t(this,i).href);return t(this,R).normalizePath(e.pathname+e.search+e.hash).path},xt=function(e){if(!e)return;const s=document.querySelector(e);if(s){const a=parseInt(s.getAttribute("data-current-page")||"1"),n=parseInt(s.getAttribute("data-total-pages")||"1");return{element:s,currentPage:a,totalPages:n,selector:e}}},he=function(){var s;if(document.documentElement.classList.contains("click-disabled"))return;if(t(this,i).hasAttribute("data-back")&&t(this,R).previousURL)history.back();else{const a=t(this,i).getAttribute("data-history-action")||"push",n=t(this,i).hasAttribute("data-center-scroll"),b=getComputedStyle(t(this,i)).getPropertyValue("--offset-scroll").trim(),f=b?Se.cssValueParser.parse(b):void 0,u=t(this,i).hasAttribute("data-revalidate")||t(this,i).hasAttribute("data-pagination-more-link")||t(this,i).hasAttribute("data-pagination-set-link")||t(this,i).hasAttribute("data-pagination-next-link")||t(this,i).hasAttribute("data-pagination-prev-link"),d=t(this,i).hasAttribute("data-keep-search-parameters"),v=t(this,i).hasAttribute("data-keep-scroll-position")||t(this,i).hasAttribute("data-pagination-more-link"),et=t(this,i).getAttribute("data-scroll-behaviour"),w=((s=t(this,i).getAttribute("data-submorph"))==null?void 0:s.split(",").map(c=>c.trim()))||t(this,i).hasAttribute("data-pagination-more-link")&&[t(this,i).getAttribute("data-pagination-more-link")]||t(this,i).hasAttribute("data-pagination-set-link")&&[t(this,i).getAttribute("data-pagination-set-link")]||t(this,i).hasAttribute("data-pagination-next-link")&&[t(this,i).getAttribute("data-pagination-next-link")]||t(this,i).hasAttribute("data-pagination-prev-link")&&[t(this,i).getAttribute("data-pagination-prev-link")]||void 0,st=t(this,i).hasAttribute("data-clear-state");let $=t(this,x,at);if(t(this,i).hasAttribute("data-toggle-params")){const[c,Pt]=t(this,x,at).split("?"),j=new URLSearchParams(Pt),V=new URLSearchParams(location.search),it=new URLSearchParams;for(const[S]of j)(!V.has(S)||V.has(S)&&V.get(S)!==j.get(S))&&it.append(S,j.get(S));if(t(this,i).hasAttribute("data-merge-params"))for(const[S]of V)j.has(S)||it.append(S,V.get(S));$=`${c}?${it.toString()}`}const y=E(this,x,xt).call(this,t(this,i).getAttribute("data-pagination-set-link")||t(this,i).getAttribute("data-pagination-more-link")||t(this,i).getAttribute("data-pagination-next-link")||t(this,i).getAttribute("data-pagination-prev-link"));y&&(t(this,i).hasAttribute("data-pagination-set-link")?t(this,R).links.forEach(c=>{c.updatePagination(parseInt(t(this,i).getAttribute("data-value")||"1"),y.selector)}):t(this,i).hasAttribute("data-pagination-prev-link")?t(this,R).links.forEach(c=>{c.updatePagination(y.currentPage-1,y.selector)}):t(this,i).hasAttribute("data-pagination-next-link")?t(this,R).links.forEach(c=>{c.updatePagination(y.currentPage+1,y.selector)}):t(this,i).hasAttribute("data-pagination-more-link")&&t(this,R).links.forEach(c=>{c.updatePagination(y.currentPage+1,y.selector)})),t(this,R).navigate($,{historyAction:a,centerScroll:n,offsetScroll:f,revalidate:u,keepSearchParameters:d,submorph:w,clearState:st,keepScrollPosition:v,scrollBehaviour:et,submorphAppend:t(this,i).hasAttribute("data-pagination-more-link"),mergeParams:t(this,i).hasAttribute("data-merge-params")&&!t(this,i).hasAttribute("data-toggle-params")})}},ft=new WeakMap,nt=new WeakMap;const ye=new DOMParser;var z,J,H,I,Q,F,rt,Z,B,gt;class ae{constructor(e,s){l(this,z);l(this,J);l(this,H,{x:0,y:0});l(this,I,null);l(this,Q,null);l(this,F,null);l(this,rt,null);l(this,Z,null);l(this,B,null);l(this,gt);o(this,z,e),o(this,J,s)}get pathname(){return t(this,J)}get scrollState(){return t(this,H)}get document(){return t(this,F)}setHeaders(e){o(this,gt,e)}setInitialDocument(e){o(this,I,e.cloneNode(!0))}abort(){var e;return(e=t(this,Z))==null?void 0:e.abort(`[${t(this,J)}] page loading cancelled`)}fetch(e,s,a){return G(this,null,function*(){var n;if(!a){const u=((n=t(this,I))==null?void 0:n.documentElement.getAttribute("data-cache"))&&s!==e,d=t(this,I)&&t(this,z).isPopstateNavigation;if(t(this,B)||u||d)return t(this,B)}return o(this,B,new Promise(b=>G(this,null,function*(){try{o(this,Z,new AbortController);const u=yield(yield fetch(e,{signal:t(this,Z).signal,headers:Rt({"X-MORPH":"true","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,gt))})).text(),d=ye.parseFromString(u,"text/html");this.setInitialDocument(d)}catch(f){console.warn(f)}finally{o(this,Z,null),o(this,B,null),b()}}))),t(this,B)})}cloneDocument(){o(this,F,(t(this,Q)||t(this,I)).cloneNode(!0))}get title(){let e="";if(t(this,F).title)e=t(this,F).title;else{const s=t(this,F).querySelector("h1");e=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||t(this,J)}return e}clearScrollState(){t(this,H).x=0,t(this,H).y=0}clearDocumentState(){o(this,Q,null)}saveScrollState(){t(this,I).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,H).x=0,t(this,H).y=0):(t(this,H).x=t(this,z).scrollValue.left,t(this,H).y=t(this,z).scrollValue.top)}restoreScrollPosition(){t(this,z).scrollElement.scroll({top:t(this,H).y,left:t(this,H).x,behavior:"instant"})}saveDocumentState(){t(this,I).documentElement.hasAttribute("data-no-page-restoration")?o(this,Q,null):o(this,Q,document.cloneNode(!0))}renewScrollPosition(){t(this,z).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){o(this,rt,e)}clearState(){const e=t(this,rt);return o(this,rt,null),e}}z=new WeakMap,J=new WeakMap,H=new WeakMap,I=new WeakMap,Q=new WeakMap,F=new WeakMap,rt=new WeakMap,Z=new WeakMap,B=new WeakMap,gt=new WeakMap;var T,ot,Et,It,bt;class Ae{constructor(e){l(this,Et);l(this,T);l(this,ot,[]);l(this,bt,()=>{E(this,Et,It).call(this)});o(this,T,e);for(const s in t(this,T).dataset){const a=re.camelToKebab(s);if(a.startsWith("param-")){const n=a.split("param-")[1],b=t(this,T).dataset[s];t(this,ot).push({name:n,value:b})}}document.addEventListener("morphURLParametersChange",t(this,bt)),E(this,Et,It).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",t(this,bt))}}T=new WeakMap,ot=new WeakMap,Et=new WeakSet,It=function(){const e=new URLSearchParams(location.search);let s=!!t(this,ot).find(n=>e.has(n.name)&&(e.get(n.name)===n.value||n.value==="*"||n.value==="all"||n.value==="any"||n.value==="vse"||e.get(n.name)==="*"||e.get(n.name)==="all"||e.get(n.name)==="any"||e.get(n.name)==="vse"));!s&&t(this,T).hasAttribute("data-match-no-params")&&(s=!t(this,ot).filter(n=>e.has(n.name)).length);const a=t(this,T).getAttribute("data-hide-class");s?a?t(this,T).classList.remove(a):t(this,T).style.display="":a?t(this,T).classList.add(a):t(this,T).style.display="none"},bt=new WeakMap;var q,ht,P,K,g,_,X,Y,U,vt,W,Lt,tt,lt,ct,St,dt,yt,p,Vt,At,Ht,Ot,le,Ft,Bt,Kt,Xt,Tt,ut;const pt=class pt{constructor(e){l(this,p);l(this,q,null);l(this,ht,null);l(this,P,[]);l(this,K);l(this,g,null);l(this,_);l(this,X,[]);l(this,Y,!1);l(this,U,null);l(this,vt,!1);l(this,W,new Map);l(this,Lt,[]);l(this,tt,null);l(this,lt,0);l(this,ct,0);l(this,St);l(this,dt);l(this,yt);l(this,At,e=>{var s,a;return(((s=e.getAttribute("href"))==null?void 0:s.startsWith("/"))||((a=e.getAttribute("href"))==null?void 0:a.startsWith("?")))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});l(this,Tt,e=>G(this,null,function*(){e.preventDefault(),o(this,Y,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,dt)?void 0:t(this,St),revalidate:t(this,dt),keepScrollPosition:t(this,yt)}),o(this,Y,!1)}));l(this,ut,()=>{const{left:e,top:s}=this.scrollValue,a=s-t(this,ct),n=e-t(this,lt);o(this,ct,s),o(this,lt,e),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",a>0),document.documentElement.classList.toggle("scroll-y-backward",a<0),document.documentElement.classList.toggle("scroll-x-forward",n>0),document.documentElement.classList.toggle("scroll-x-backward",n<0),D.dispatchEvent(document,"morphScroll",{detail:{left:e,top:s}})});if(ne.isBrowser&&!pt.instance){pt.instance=this,o(this,q,{base:mt.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),o(this,ht,E(this,p,Ot).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);o(this,g,s);const a=new ae(this,t(this,g).pathname);a.setInitialDocument(document),t(this,W).set(t(this,g).pathname,a),document.documentElement.setAttribute("data-current-pathname",t(this,g).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),this.findParamsDependent(),history.scrollRestoration="manual",addEventListener("popstate",t(this,Tt)),mt.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),o(this,tt,new oe),E(this,p,Kt).call(this,document)}}get currentURL(){return t(this,g)}get previousURL(){return t(this,_)}get links(){return t(this,P)}get scrollElement(){return t(this,U)}get isPopstateNavigation(){return t(this,Y)}get scrollValue(){let e=0,s=0;return t(this,vt)?(e=window.scrollY,s=window.scrollX):(e=t(this,U).scrollTop,s=t(this,U).scrollLeft),{top:e,left:s}}saveState(e){const s=t(this,W).get(t(this,g).path);s&&s.saveState(e)}getState(){const e=t(this,W).get(t(this,g).path);return e==null?void 0:e.clearState()}normalizePath(e,s){return mt.splitPath(e,{base:t(this,q).base,trailingSlash:t(this,q).trailingSlash,mergeParams:s!=null&&s.mergeParams?location.search:""})}prefetch(e,s){return G(this,null,function*(){var n;if(t(this,X).length)return;e=((n=this.pathnameModifier)==null?void 0:n.call(this,e))||e;const a=E(this,p,Ht).call(this,e);a==null||a.fetch(e,t(this,g).path,s)})}excludeHeadChild(e){return!1}setHeaders(e){}navigate($){return G(this,arguments,function*(e,{historyAction:s="push",centerScroll:a,offsetScroll:n,scrollBehaviour:b,revalidate:f,keepSearchParameters:u,submorph:d,submorphAppend:v,clearState:et,keepScrollPosition:w,mergeParams:st}={}){var Pt,j,V,it;if(t(this,X).length)return;o(this,St,d),o(this,dt,f),o(this,yt,w);const y=((Pt=this.pathnameModifier)==null?void 0:Pt.call(this,e))||e,c=this.normalizePath(y,{mergeParams:st});if(!f&&(((j=t(this,K))==null?void 0:j.pathname)===c.pathname||t(this,g).pathname===c.pathname)){w||E(this,p,Xt).call(this,c.hash||0,{centerScroll:a,offsetScroll:n,behavior:"smooth"}),D.dispatchEvent(document,"morphSamePath",{custom:!0}),((V=t(this,g))==null?void 0:V.parameters)!==c.parameters&&(o(this,_,t(this,g)),o(this,g,c),mt.changeHistory({action:((it=t(this,g))==null?void 0:it.hash)!==c.hash?"replace":s,pathname:c.pathname,searchParameters:c.parameters,hash:c.hash}),D.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,g),previousURL:t(this,_)}})),t(this,P).forEach(S=>{S.checkCurrent(c.path)});return}else t(this,P).forEach(S=>{S.checkCurrent(c.path)});o(this,K,c);try{let S=!0;if(this.preprocessor)try{yield new Promise((r,k)=>{var M;(M=this.preprocessor)==null||M.call(this,{url:c,resolve:r,reject:k,submorph:d})})}catch(r){r?console.error(r):console.log("Route change canceled"),S=!1}if(!S||t(this,K).pathname!==c.pathname){t(this,P).forEach(r=>{r.checkCurrent(t(this,g).path)});return}const Yt={url:c,submorph:d};d?v||d.forEach(r=>{document.querySelectorAll(r).forEach(k=>{k.classList.add("out"),k.setAttribute("data-morph-out","")})}):t(this,ht).forEach(r=>{var k,M;(k=r.firstElementChild)==null||k.classList.add("out"),(M=r.firstElementChild)==null||M.setAttribute("data-morph-out","")}),D.dispatchEvent(document,"morphNavigation",{detail:Yt});const Mt=E(this,p,Ht).call(this,t(this,g).pathname),A=E(this,p,Ht).call(this,c.pathname);if(t(this,W).forEach(r=>{r.pathname!==c.pathname&&r.abort()}),yield A==null?void 0:A.fetch(y,t(this,g).path,f),t(this,K).pathname!==c.pathname){t(this,P).forEach(r=>{r.checkCurrent(t(this,g).path)});return}Mt.clearState(),Mt.saveScrollState(),Mt.saveDocumentState(),(!t(this,Y)||f)&&(A.clearScrollState(),A.clearDocumentState()),et&&A.clearState(),A.cloneDocument(),t(this,tt).textContent=A.title,document.body.appendChild(t(this,tt));const kt=qt(Rt({},Yt),{document:A.document});v||kt.document.querySelectorAll("[data-morph-out]").forEach(r=>{r.classList.remove("out")}),D.dispatchEvent(document,"morphStart",{detail:kt});const $t=Array.from(document.head.children),jt=Array.from(A.document.head.children),Gt=E(this,p,le).call(this,$t,jt),ce=E(this,p,Ft).call(this,$t,Gt),wt=E(this,p,Ft).call(this,jt,Gt).filter(r=>!this.excludeHeadChild(r));wt.forEach((r,k)=>{r.tagName==="SCRIPT"&&(wt[k]=E(this,p,Vt).call(this,r))}),wt.forEach(r=>{document.head.appendChild(r)});const Ut=wt.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(E(this,p,Bt).call(this,r))return!0});t(this,q).waitForHeadToLoad&&Ut.length&&(yield new Promise(r=>G(this,null,function*(){let k=0;try{for(var M=se(Ut),ue,O,N;ue=!(O=yield M.next()).done;ue=!1){const Ct=O.value;Ct.onload=()=>{k++,k===Ut.length&&r()}}}catch(O){N=[O]}finally{try{ue&&(O=M.return)&&(yield O.call(M))}finally{if(N)throw N[0]}}}))),yield ie.wait(10);const Jt=[];v||ce.forEach(r=>{r.hasAttribute("data-permanent")||(E(this,p,Bt).call(this,r)?Jt.push(r):r.remove())});const de=E(this,p,Ot).call(this,A.document.body);!t(this,q).morphInsideScrollContainer&&!d&&E(this,p,Kt).call(this,A.document),document.documentElement.setAttribute("data-current-pathname",c.pathname),document.documentElement.setAttribute("data-current-leaf",c.leaf),mt.changeHistory({action:s,pathname:c.pathname,searchParameters:c.parameters||(u?location.search:""),hash:c.hash}),t(this,tt).remove(),o(this,_,t(this,g)),o(this,g,c);const Nt=[];t(this,ht).forEach((r,k)=>{const M=de[k],ue=getComputedStyle(r).getPropertyValue("--morph-duration");let O=[],N=[];d?(d.forEach(m=>{const L=r.querySelector(m),C=M.querySelector(m);L&&C&&(N.push(L),O.push(C))}),N.forEach(m=>{m.parentElement&&Nt.push(m.parentElement)})):(O.push(...M.childNodes),N.push(...r.childNodes),Nt.push(r));const Ct=[];v||N.forEach(m=>{m instanceof HTMLElement&&(this.destroyOldLinks(m),m.classList.add("old"),m.querySelectorAll("[data-morph-transfer]").forEach(C=>{const pe=C.getAttribute("data-morph-transfer");Ct.push({element:C,selector:pe})}))}),O.forEach(m=>{m instanceof HTMLElement&&(Ct.forEach(L=>{const C=m.querySelector(L.selector);C&&C.replaceWith(A.document.importNode(L.element,!0))}),this.findNewLinks(m),m.classList.add("new"))}),d?v?O.forEach((m,L)=>{N[L]instanceof HTMLElement&&N[L].append(...m.childNodes)}):O.forEach((m,L)=>{var C;(C=N[L].parentElement)==null||C.insertBefore(m,N[L])}):r.prepend(...O),setTimeout(()=>{v||N.forEach(m=>{m instanceof HTMLElement&&m.classList.add("old-idle")}),O.forEach(m=>{var L;m instanceof HTMLElement&&((L=m.parentElement)==null||L.style.setProperty("--new-content-height",m.offsetHeight+"px"),m.classList.add("new-idle"))})},0);const Qt=qt(Rt({},kt),{morphElement:r});D.dispatchEvent(document,"morphNewChildrenAdded",{detail:Qt});const me=new Promise(m=>{setTimeout(()=>{v||N.forEach(L=>{L.remove()}),O.forEach(L=>{var C;L instanceof HTMLElement&&((C=L.parentElement)==null||C.style.removeProperty("--new-content-height"),L.classList.remove("new-idle","new"))}),v||D.dispatchEvent(document,"morphOldChildrenRemoved",{detail:Qt}),m()},(parseFloat(ue)||0)*1e3+10)});t(this,X).push(me)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-A.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),D.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:A.scrollState}),c.hash?(A.clearScrollState(),E(this,p,Xt).call(this,c.hash,{centerScroll:a,offsetScroll:n,behavior:b})):t(this,Y)?A.restoreScrollPosition():w||A.renewScrollPosition(),yield Promise.all(t(this,X)),v||Jt.forEach(r=>r.remove()),o(this,X,[]),Nt.forEach(r=>{r.querySelectorAll("script").forEach(M=>{M.replaceWith(E(this,p,Vt).call(this,M))})}),t(this,P).forEach(r=>{r.checkCurrent(t(this,g).path)}),this.findParamsDependent(),D.dispatchEvent(document,"morphComplete",{detail:kt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(S){console.error(S)}o(this,K,void 0)})}addLink(e){t(this,P).push(new zt(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){o(this,P,t(this,P).filter(s=>s.element===e?(s.destroy(),!1):!0))}destroyOldLinks(e){o(this,P,t(this,P).filter(s=>e.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(e){const s=[...e.querySelectorAll("a")].filter(t(this,At));t(this,P).push(...s.map(a=>new zt(a,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,At));t(this,P).forEach(s=>s.destroy()),o(this,P,e.map(s=>new zt(s,this)))}findParamsDependent(){const e=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];t(this,Lt).forEach(s=>s.destroy()),o(this,Lt,e.map(s=>new Ae(s)))}};q=new WeakMap,ht=new WeakMap,P=new WeakMap,K=new WeakMap,g=new WeakMap,_=new WeakMap,X=new WeakMap,Y=new WeakMap,U=new WeakMap,vt=new WeakMap,W=new WeakMap,Lt=new WeakMap,tt=new WeakMap,lt=new WeakMap,ct=new WeakMap,St=new WeakMap,dt=new WeakMap,yt=new WeakMap,p=new WeakSet,Vt=function(e){const s=document.createElement("script");for(let a=0;a<e.attributes.length;a++){const n=e.attributes[a];s.setAttribute(n.name,n.value)}return e.hasAttribute("src")||(s.innerHTML=e.innerHTML),s},At=new WeakMap,Ht=function(e){const s=this.normalizePath(e);let a=t(this,W).get(s.pathname);return a||(a=new ae(this,s.pathname),t(this,W).set(s.pathname,a)),a},Ot=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},le=function(e,s){return e.filter(a=>s.find(n=>n.outerHTML===a.outerHTML))},Ft=function(e,s){return e.filter(a=>!s.find(n=>n.outerHTML===a.outerHTML))},Bt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},Kt=function(e){var s,a;(s=t(this,U))==null||s.removeEventListener("scroll",t(this,ut)),o(this,ct,0),o(this,lt,0),o(this,U,t(this,q).scrollSelector&&e.querySelector(t(this,q).scrollSelector)||window),o(this,vt,t(this,U)===window),(a=t(this,U))==null||a.addEventListener("scroll",t(this,ut)),t(this,ut).call(this)},Xt=function(e,s){const a=typeof e=="string"?document.getElementById(e):e;(typeof a=="number"||a)&&ie.scrollToElement(a,{scrollElement:t(this,U),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Tt=new WeakMap,ut=new WeakMap,pt.instance=null;let Wt=pt;exports.Morph=Wt;
|
|
1
|
+
"use strict";var fe=Object.defineProperty,ge=Object.defineProperties;var Ee=Object.getOwnPropertyDescriptors;var Zt=Object.getOwnPropertySymbols;var be=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var _t=(h,e)=>(e=Symbol[h])?e:Symbol.for("Symbol."+h),ee=h=>{throw TypeError(h)};var te=(h,e,s)=>e in h?fe(h,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):h[e]=s,Rt=(h,e)=>{for(var s in e||(e={}))be.call(e,s)&&te(h,s,e[s]);if(Zt)for(var s of Zt(e))ve.call(e,s)&&te(h,s,e[s]);return h},qt=(h,e)=>ge(h,Ee(e));var Dt=(h,e,s)=>e.has(h)||ee("Cannot "+s);var t=(h,e,s)=>(Dt(h,e,"read from private field"),s?s.call(h):e.get(h)),l=(h,e,s)=>e.has(h)?ee("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,s),o=(h,e,s,a)=>(Dt(h,e,"write to private field"),a?a.call(h,s):e.set(h,s),s),E=(h,e,s)=>(Dt(h,e,"access private method"),s);var G=(h,e,s)=>new Promise((a,n)=>{var b=d=>{try{u(s.next(d))}catch(v){n(v)}},f=d=>{try{u(s.throw(d))}catch(v){n(v)}},u=d=>d.done?a(d.value):Promise.resolve(d.value).then(b,f);u((s=s.apply(h,e)).next())});var se=(h,e,s)=>(e=h[_t("asyncIterator")])?e.call(h):(h=h[_t("iterator")](),e={},s=(a,n)=>(n=h[a])&&(e[a]=b=>new Promise((f,u,d)=>(b=n.call(h,b),d=b.done,Promise.resolve(b.value).then(v=>f({value:v,done:d}),u)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("../index-DekP7OZe.cjs"),D=require("../events-KVanG9sR.cjs"),ie=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const mt=require("../url-VIZgwj_h.cjs"),re=require("../string-DUXXtU8v.cjs"),Le=require("../math-GDWEqu7y.cjs"),Se=require("../css-value-parser/index.cjs");class oe extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,a]of Object.entries(e))this.setAttribute(s,a)}}ne.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",oe);var R,i,x,at,xt,he,ft,nt;class zt{constructor(e,s){l(this,x);l(this,R);l(this,i);l(this,ft,e=>{e.preventDefault(),E(this,x,he).call(this)});l(this,nt,()=>{const e=t(this,i).hasAttribute("data-revalidate");t(this,R).prefetch(t(this,x,at),e),t(this,i).removeEventListener("pointerenter",t(this,nt))});o(this,R,s),o(this,i,e),t(this,i).addEventListener("click",t(this,ft)),this.checkCurrent(location.href.replace(location.origin,""));const a=E(this,x,xt).call(this,t(this,i).getAttribute("data-pagination-set-link")||t(this,i).getAttribute("data-pagination-more-link")||t(this,i).getAttribute("data-pagination-next-link")||t(this,i).getAttribute("data-pagination-prev-link"));a&&this.updatePagination(a.currentPage,a.selector),t(this,i).hasAttribute("data-prefetch")&&t(this,i).addEventListener("pointerenter",t(this,nt))}get element(){return t(this,i)}checkCurrent(e){var v,et;const s=t(this,R).normalizePath(e),a=t(this,R).normalizePath(t(this,x,at));t(this,i).hasAttribute("data-include")&&s.pathname.includes(a.pathname)?t(this,i).classList.add("current"):a.pathname===s.pathname?t(this,i).classList.add("current"):(v=t(this,i).getAttribute("data-associated-paths"))!=null&&v.split(",").find(w=>s.pathname.includes(w))?t(this,i).classList.add("current"):t(this,i).classList.remove("current"),s.path===a.path?t(this,i).classList.add("exact"):t(this,i).classList.remove("exact");const[n,b]=(et=t(this,x,at).split("#")[0])==null?void 0:et.split("?"),f=new URLSearchParams(b),u=new URLSearchParams(location.search);let d=0;for(const[w]of u)f.has(w)&&u.get(w)===f.get(w)&&d++;d?(t(this,i).classList.toggle("all-params-matched",u.size===d),t(this,i).classList.toggle("some-params-matched",u.size!==d)):!u.size&&t(this,i).hasAttribute("data-match-no-params")?t(this,i).classList.add("all-params-matched"):(t(this,i).classList.remove("all-params-matched"),t(this,i).classList.remove("some-params-matched"));for(const w in t(this,i).dataset){const st=re.camelToKebab(w);if(st.startsWith("match-param-")){const $=st.split("match-param-")[1],S=t(this,i).dataset[w],c=`param-${$}-matched`;u.has($)&&u.get($)===S||!u.has($)&&(S===""||S==="*"||S==="all"||S==="any"||S==="vse")?t(this,i).classList.add(c):t(this,i).classList.remove(c)}}}updatePagination(e,s){const a=E(this,x,xt).call(this,s);if(a)if(a.element.setAttribute("data-current-page",e.toString()),t(this,i).hasAttribute("data-pagination-more-link"))if(e<a.totalPages){t(this,i).style.display="";const n=t(this,i).querySelector("[data-pagination-more-link-counter]");n&&(n.textContent=(a.totalPages-e).toString());const b=t(this,i).getAttribute("href"),f=new URL(b,window.location.origin);f.searchParams.set("page",(e+1).toString());const u=f.href.replace(f.origin,"").toString();t(this,i).setAttribute("href",u),this.checkCurrent(u)}else t(this,i).style.display="none";else if(t(this,i).hasAttribute("data-pagination-prev-link")||t(this,i).hasAttribute("data-pagination-next-link")){const n=t(this,i).hasAttribute("data-pagination-prev-link"),b=t(this,i).getAttribute("href"),f=new URL(b,window.location.origin),u=e+(n?-1:1);f.searchParams.set("page",Le.clamp(u,1,a.totalPages).toString());const d=f.href.replace(f.origin,"").toString();t(this,i).setAttribute("href",d),n?u<1?(t(this,i).classList.add("pagination-disabled"),t(this,i).setAttribute("tabindex","-1")):(t(this,i).classList.remove("pagination-disabled"),t(this,i).removeAttribute("tabindex")):u>a.totalPages?(t(this,i).classList.add("pagination-disabled"),t(this,i).setAttribute("tabindex","-1")):(t(this,i).classList.remove("pagination-disabled"),t(this,i).removeAttribute("tabindex"))}else t(this,i).hasAttribute("data-pagination-set-link")&&(t(this,i).getAttribute("data-value")===e.toString()?t(this,i).classList.add("pagination-current"):t(this,i).classList.remove("pagination-current"))}destroy(){t(this,i).removeEventListener("click",t(this,ft)),t(this,i).removeEventListener("pointerenter",t(this,nt)),t(this,i).classList.remove("current","exact","pagination-current")}}R=new WeakMap,i=new WeakMap,x=new WeakSet,at=function(){const e=new URL(t(this,i).href);return t(this,R).normalizePath(e.pathname+e.search+e.hash).path},xt=function(e){if(!e)return;const s=document.querySelector(e);if(s){const a=parseInt(s.getAttribute("data-current-page")||"1"),n=parseInt(s.getAttribute("data-total-pages")||"1");return{element:s,currentPage:a,totalPages:n,selector:e}}},he=function(){var s;if(document.documentElement.classList.contains("click-disabled"))return;if(t(this,i).hasAttribute("data-back")&&t(this,R).previousURL)history.back();else{const a=t(this,i).getAttribute("data-history-action")||"push",n=t(this,i).hasAttribute("data-center-scroll"),b=getComputedStyle(t(this,i)).getPropertyValue("--offset-scroll").trim(),f=b?Se.cssValueParser.parse(b):void 0,u=t(this,i).hasAttribute("data-revalidate")||t(this,i).hasAttribute("data-pagination-more-link")||t(this,i).hasAttribute("data-pagination-set-link")||t(this,i).hasAttribute("data-pagination-next-link")||t(this,i).hasAttribute("data-pagination-prev-link"),d=t(this,i).hasAttribute("data-keep-search-parameters"),v=t(this,i).hasAttribute("data-keep-scroll-position")||t(this,i).hasAttribute("data-pagination-more-link"),et=t(this,i).getAttribute("data-scroll-behaviour"),w=((s=t(this,i).getAttribute("data-submorph"))==null?void 0:s.split(",").map(c=>c.trim()))||t(this,i).hasAttribute("data-pagination-more-link")&&[t(this,i).getAttribute("data-pagination-more-link")]||t(this,i).hasAttribute("data-pagination-set-link")&&[t(this,i).getAttribute("data-pagination-set-link")]||t(this,i).hasAttribute("data-pagination-next-link")&&[t(this,i).getAttribute("data-pagination-next-link")]||t(this,i).hasAttribute("data-pagination-prev-link")&&[t(this,i).getAttribute("data-pagination-prev-link")]||void 0,st=t(this,i).hasAttribute("data-clear-state");let $=t(this,x,at);if(t(this,i).hasAttribute("data-toggle-params")){const[c,Pt]=t(this,x,at).split("?"),j=new URLSearchParams(Pt),V=new URLSearchParams(location.search),it=new URLSearchParams;for(const[y]of j)(!V.has(y)||V.has(y)&&V.get(y)!==j.get(y))&&it.append(y,j.get(y));if(t(this,i).hasAttribute("data-merge-params"))for(const[y]of V)j.has(y)||it.append(y,V.get(y));$=`${c}?${it.toString()}`}const S=E(this,x,xt).call(this,t(this,i).getAttribute("data-pagination-set-link")||t(this,i).getAttribute("data-pagination-more-link")||t(this,i).getAttribute("data-pagination-next-link")||t(this,i).getAttribute("data-pagination-prev-link"));S&&(t(this,i).hasAttribute("data-pagination-set-link")?t(this,R).links.forEach(c=>{c.updatePagination(parseInt(t(this,i).getAttribute("data-value")||"1"),S.selector)}):t(this,i).hasAttribute("data-pagination-prev-link")?t(this,R).links.forEach(c=>{c.updatePagination(S.currentPage-1,S.selector)}):t(this,i).hasAttribute("data-pagination-next-link")?t(this,R).links.forEach(c=>{c.updatePagination(S.currentPage+1,S.selector)}):t(this,i).hasAttribute("data-pagination-more-link")&&t(this,R).links.forEach(c=>{c.updatePagination(S.currentPage+1,S.selector)})),t(this,R).navigate($,{historyAction:a,centerScroll:n,offsetScroll:f,revalidate:u,keepSearchParameters:d,submorph:w,clearState:st,keepScrollPosition:v,scrollBehaviour:et,submorphAppend:t(this,i).hasAttribute("data-pagination-more-link"),mergeParams:!!S||t(this,i).hasAttribute("data-merge-params")&&!t(this,i).hasAttribute("data-toggle-params")})}},ft=new WeakMap,nt=new WeakMap;const ye=new DOMParser;var z,J,H,I,Q,F,rt,Z,B,gt;class ae{constructor(e,s){l(this,z);l(this,J);l(this,H,{x:0,y:0});l(this,I,null);l(this,Q,null);l(this,F,null);l(this,rt,null);l(this,Z,null);l(this,B,null);l(this,gt);o(this,z,e),o(this,J,s)}get pathname(){return t(this,J)}get scrollState(){return t(this,H)}get document(){return t(this,F)}setHeaders(e){o(this,gt,e)}setInitialDocument(e){o(this,I,e.cloneNode(!0))}abort(){var e;return(e=t(this,Z))==null?void 0:e.abort(`[${t(this,J)}] page loading cancelled`)}fetch(e,s,a){return G(this,null,function*(){var n;if(!a){const u=((n=t(this,I))==null?void 0:n.documentElement.getAttribute("data-cache"))&&s!==e,d=t(this,I)&&t(this,z).isPopstateNavigation;if(t(this,B)||u||d)return t(this,B)}return o(this,B,new Promise(b=>G(this,null,function*(){try{o(this,Z,new AbortController);const u=yield(yield fetch(e,{signal:t(this,Z).signal,headers:Rt({"X-MORPH":"true","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,gt))})).text(),d=ye.parseFromString(u,"text/html");this.setInitialDocument(d)}catch(f){console.warn(f)}finally{o(this,Z,null),o(this,B,null),b()}}))),t(this,B)})}cloneDocument(){o(this,F,(t(this,Q)||t(this,I)).cloneNode(!0))}get title(){let e="";if(t(this,F).title)e=t(this,F).title;else{const s=t(this,F).querySelector("h1");e=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||t(this,J)}return e}clearScrollState(){t(this,H).x=0,t(this,H).y=0}clearDocumentState(){o(this,Q,null)}saveScrollState(){t(this,I).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,H).x=0,t(this,H).y=0):(t(this,H).x=t(this,z).scrollValue.left,t(this,H).y=t(this,z).scrollValue.top)}restoreScrollPosition(){t(this,z).scrollElement.scroll({top:t(this,H).y,left:t(this,H).x,behavior:"instant"})}saveDocumentState(){t(this,I).documentElement.hasAttribute("data-no-page-restoration")?o(this,Q,null):o(this,Q,document.cloneNode(!0))}renewScrollPosition(){t(this,z).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){o(this,rt,e)}clearState(){const e=t(this,rt);return o(this,rt,null),e}}z=new WeakMap,J=new WeakMap,H=new WeakMap,I=new WeakMap,Q=new WeakMap,F=new WeakMap,rt=new WeakMap,Z=new WeakMap,B=new WeakMap,gt=new WeakMap;var T,ot,Et,It,bt;class Ae{constructor(e){l(this,Et);l(this,T);l(this,ot,[]);l(this,bt,()=>{E(this,Et,It).call(this)});o(this,T,e);for(const s in t(this,T).dataset){const a=re.camelToKebab(s);if(a.startsWith("param-")){const n=a.split("param-")[1],b=t(this,T).dataset[s];t(this,ot).push({name:n,value:b})}}document.addEventListener("morphURLParametersChange",t(this,bt)),E(this,Et,It).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",t(this,bt))}}T=new WeakMap,ot=new WeakMap,Et=new WeakSet,It=function(){const e=new URLSearchParams(location.search);let s=!!t(this,ot).find(n=>e.has(n.name)&&(e.get(n.name)===n.value||n.value==="*"||n.value==="all"||n.value==="any"||n.value==="vse"||e.get(n.name)==="*"||e.get(n.name)==="all"||e.get(n.name)==="any"||e.get(n.name)==="vse"));!s&&t(this,T).hasAttribute("data-match-no-params")&&(s=!t(this,ot).filter(n=>e.has(n.name)).length);const a=t(this,T).getAttribute("data-hide-class");s?a?t(this,T).classList.remove(a):t(this,T).style.display="":a?t(this,T).classList.add(a):t(this,T).style.display="none"},bt=new WeakMap;var q,ht,P,K,g,_,X,Y,U,vt,W,Lt,tt,lt,ct,St,dt,yt,p,Vt,At,Ht,Ot,le,Ft,Bt,Kt,Xt,Tt,ut;const pt=class pt{constructor(e){l(this,p);l(this,q,null);l(this,ht,null);l(this,P,[]);l(this,K);l(this,g,null);l(this,_);l(this,X,[]);l(this,Y,!1);l(this,U,null);l(this,vt,!1);l(this,W,new Map);l(this,Lt,[]);l(this,tt,null);l(this,lt,0);l(this,ct,0);l(this,St);l(this,dt);l(this,yt);l(this,At,e=>{var s,a;return(((s=e.getAttribute("href"))==null?void 0:s.startsWith("/"))||((a=e.getAttribute("href"))==null?void 0:a.startsWith("?")))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});l(this,Tt,e=>G(this,null,function*(){e.preventDefault(),o(this,Y,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,dt)?void 0:t(this,St),revalidate:t(this,dt),keepScrollPosition:t(this,yt)}),o(this,Y,!1)}));l(this,ut,()=>{const{left:e,top:s}=this.scrollValue,a=s-t(this,ct),n=e-t(this,lt);o(this,ct,s),o(this,lt,e),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",a>0),document.documentElement.classList.toggle("scroll-y-backward",a<0),document.documentElement.classList.toggle("scroll-x-forward",n>0),document.documentElement.classList.toggle("scroll-x-backward",n<0),D.dispatchEvent(document,"morphScroll",{detail:{left:e,top:s}})});if(ne.isBrowser&&!pt.instance){pt.instance=this,o(this,q,{base:mt.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),o(this,ht,E(this,p,Ot).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);o(this,g,s);const a=new ae(this,t(this,g).pathname);a.setInitialDocument(document),t(this,W).set(t(this,g).pathname,a),document.documentElement.setAttribute("data-current-pathname",t(this,g).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),this.findParamsDependent(),history.scrollRestoration="manual",addEventListener("popstate",t(this,Tt)),mt.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),o(this,tt,new oe),E(this,p,Kt).call(this,document)}}get currentURL(){return t(this,g)}get previousURL(){return t(this,_)}get links(){return t(this,P)}get scrollElement(){return t(this,U)}get isPopstateNavigation(){return t(this,Y)}get scrollValue(){let e=0,s=0;return t(this,vt)?(e=window.scrollY,s=window.scrollX):(e=t(this,U).scrollTop,s=t(this,U).scrollLeft),{top:e,left:s}}saveState(e){const s=t(this,W).get(t(this,g).path);s&&s.saveState(e)}getState(){const e=t(this,W).get(t(this,g).path);return e==null?void 0:e.clearState()}normalizePath(e,s){return mt.splitPath(e,{base:t(this,q).base,trailingSlash:t(this,q).trailingSlash,mergeParams:s!=null&&s.mergeParams?location.search:""})}prefetch(e,s){return G(this,null,function*(){var n;if(t(this,X).length)return;e=((n=this.pathnameModifier)==null?void 0:n.call(this,e))||e;const a=E(this,p,Ht).call(this,e);a==null||a.fetch(e,t(this,g).path,s)})}excludeHeadChild(e){return!1}setHeaders(e){}navigate($){return G(this,arguments,function*(e,{historyAction:s="push",centerScroll:a,offsetScroll:n,scrollBehaviour:b,revalidate:f,keepSearchParameters:u,submorph:d,submorphAppend:v,clearState:et,keepScrollPosition:w,mergeParams:st}={}){var Pt,j,V,it;if(t(this,X).length)return;o(this,St,d),o(this,dt,f),o(this,yt,w);const S=((Pt=this.pathnameModifier)==null?void 0:Pt.call(this,e))||e,c=this.normalizePath(S,{mergeParams:st});if(!f&&(((j=t(this,K))==null?void 0:j.pathname)===c.pathname||t(this,g).pathname===c.pathname)){w||E(this,p,Xt).call(this,c.hash||0,{centerScroll:a,offsetScroll:n,behavior:"smooth"}),D.dispatchEvent(document,"morphSamePath",{custom:!0}),((V=t(this,g))==null?void 0:V.parameters)!==c.parameters&&(o(this,_,t(this,g)),o(this,g,c),mt.changeHistory({action:((it=t(this,g))==null?void 0:it.hash)!==c.hash?"replace":s,pathname:c.pathname,searchParameters:c.parameters,hash:c.hash}),D.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,g),previousURL:t(this,_)}})),t(this,P).forEach(y=>{y.checkCurrent(c.path)});return}else t(this,P).forEach(y=>{y.checkCurrent(c.path)});o(this,K,c);try{let y=!0;if(this.preprocessor)try{yield new Promise((r,k)=>{var M;(M=this.preprocessor)==null||M.call(this,{url:c,resolve:r,reject:k,submorph:d})})}catch(r){r?console.error(r):console.log("Route change canceled"),y=!1}if(!y||t(this,K).pathname!==c.pathname){t(this,P).forEach(r=>{r.checkCurrent(t(this,g).path)});return}const Yt={url:c,submorph:d};d?v||d.forEach(r=>{document.querySelectorAll(r).forEach(k=>{k.classList.add("out"),k.setAttribute("data-morph-out","")})}):t(this,ht).forEach(r=>{var k,M;(k=r.firstElementChild)==null||k.classList.add("out"),(M=r.firstElementChild)==null||M.setAttribute("data-morph-out","")}),D.dispatchEvent(document,"morphNavigation",{detail:Yt});const Mt=E(this,p,Ht).call(this,t(this,g).pathname),A=E(this,p,Ht).call(this,c.pathname);if(t(this,W).forEach(r=>{r.pathname!==c.pathname&&r.abort()}),yield A==null?void 0:A.fetch(S,t(this,g).path,f),t(this,K).pathname!==c.pathname){t(this,P).forEach(r=>{r.checkCurrent(t(this,g).path)});return}Mt.clearState(),Mt.saveScrollState(),Mt.saveDocumentState(),(!t(this,Y)||f)&&(A.clearScrollState(),A.clearDocumentState()),et&&A.clearState(),A.cloneDocument(),t(this,tt).textContent=A.title,document.body.appendChild(t(this,tt));const kt=qt(Rt({},Yt),{document:A.document});v||kt.document.querySelectorAll("[data-morph-out]").forEach(r=>{r.classList.remove("out")}),D.dispatchEvent(document,"morphStart",{detail:kt});const $t=Array.from(document.head.children),jt=Array.from(A.document.head.children),Gt=E(this,p,le).call(this,$t,jt),ce=E(this,p,Ft).call(this,$t,Gt),wt=E(this,p,Ft).call(this,jt,Gt).filter(r=>!this.excludeHeadChild(r));wt.forEach((r,k)=>{r.tagName==="SCRIPT"&&(wt[k]=E(this,p,Vt).call(this,r))}),wt.forEach(r=>{document.head.appendChild(r)});const Ut=wt.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(E(this,p,Bt).call(this,r))return!0});t(this,q).waitForHeadToLoad&&Ut.length&&(yield new Promise(r=>G(this,null,function*(){let k=0;try{for(var M=se(Ut),ue,O,N;ue=!(O=yield M.next()).done;ue=!1){const Ct=O.value;Ct.onload=()=>{k++,k===Ut.length&&r()}}}catch(O){N=[O]}finally{try{ue&&(O=M.return)&&(yield O.call(M))}finally{if(N)throw N[0]}}}))),yield ie.wait(10);const Jt=[];v||ce.forEach(r=>{r.hasAttribute("data-permanent")||(E(this,p,Bt).call(this,r)?Jt.push(r):r.remove())});const de=E(this,p,Ot).call(this,A.document.body);!t(this,q).morphInsideScrollContainer&&!d&&E(this,p,Kt).call(this,A.document),document.documentElement.setAttribute("data-current-pathname",c.pathname),document.documentElement.setAttribute("data-current-leaf",c.leaf),mt.changeHistory({action:s,pathname:c.pathname,searchParameters:c.parameters||(u?location.search:""),hash:c.hash}),t(this,tt).remove(),o(this,_,t(this,g)),o(this,g,c);const Nt=[];t(this,ht).forEach((r,k)=>{const M=de[k],ue=getComputedStyle(r).getPropertyValue("--morph-duration");let O=[],N=[];d?(d.forEach(m=>{const L=r.querySelector(m),C=M.querySelector(m);L&&C&&(N.push(L),O.push(C))}),N.forEach(m=>{m.parentElement&&Nt.push(m.parentElement)})):(O.push(...M.childNodes),N.push(...r.childNodes),Nt.push(r));const Ct=[];v||N.forEach(m=>{m instanceof HTMLElement&&(this.destroyOldLinks(m),m.classList.add("old"),m.querySelectorAll("[data-morph-transfer]").forEach(C=>{const pe=C.getAttribute("data-morph-transfer");Ct.push({element:C,selector:pe})}))}),O.forEach(m=>{m instanceof HTMLElement&&(Ct.forEach(L=>{const C=m.querySelector(L.selector);C&&C.replaceWith(A.document.importNode(L.element,!0))}),this.findNewLinks(m),m.classList.add("new"))}),d?v?O.forEach((m,L)=>{N[L]instanceof HTMLElement&&N[L].append(...m.childNodes)}):O.forEach((m,L)=>{var C;(C=N[L].parentElement)==null||C.insertBefore(m,N[L])}):r.prepend(...O),setTimeout(()=>{v||N.forEach(m=>{m instanceof HTMLElement&&m.classList.add("old-idle")}),O.forEach(m=>{var L;m instanceof HTMLElement&&((L=m.parentElement)==null||L.style.setProperty("--new-content-height",m.offsetHeight+"px"),m.classList.add("new-idle"))})},0);const Qt=qt(Rt({},kt),{morphElement:r});D.dispatchEvent(document,"morphNewChildrenAdded",{detail:Qt});const me=new Promise(m=>{setTimeout(()=>{v||N.forEach(L=>{L.remove()}),O.forEach(L=>{var C;L instanceof HTMLElement&&((C=L.parentElement)==null||C.style.removeProperty("--new-content-height"),L.classList.remove("new-idle","new"))}),v||D.dispatchEvent(document,"morphOldChildrenRemoved",{detail:Qt}),m()},(parseFloat(ue)||0)*1e3+10)});t(this,X).push(me)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-A.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),D.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:A.scrollState}),c.hash?(A.clearScrollState(),E(this,p,Xt).call(this,c.hash,{centerScroll:a,offsetScroll:n,behavior:b})):t(this,Y)?A.restoreScrollPosition():w||A.renewScrollPosition(),yield Promise.all(t(this,X)),v||Jt.forEach(r=>r.remove()),o(this,X,[]),Nt.forEach(r=>{r.querySelectorAll("script").forEach(M=>{M.replaceWith(E(this,p,Vt).call(this,M))})}),t(this,P).forEach(r=>{r.checkCurrent(t(this,g).path)}),this.findParamsDependent(),D.dispatchEvent(document,"morphComplete",{detail:kt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(y){console.error(y)}o(this,K,void 0)})}addLink(e){t(this,P).push(new zt(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){o(this,P,t(this,P).filter(s=>s.element===e?(s.destroy(),!1):!0))}destroyOldLinks(e){o(this,P,t(this,P).filter(s=>e.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(e){const s=[...e.querySelectorAll("a")].filter(t(this,At));t(this,P).push(...s.map(a=>new zt(a,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,At));t(this,P).forEach(s=>s.destroy()),o(this,P,e.map(s=>new zt(s,this)))}findParamsDependent(){const e=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];t(this,Lt).forEach(s=>s.destroy()),o(this,Lt,e.map(s=>new Ae(s)))}};q=new WeakMap,ht=new WeakMap,P=new WeakMap,K=new WeakMap,g=new WeakMap,_=new WeakMap,X=new WeakMap,Y=new WeakMap,U=new WeakMap,vt=new WeakMap,W=new WeakMap,Lt=new WeakMap,tt=new WeakMap,lt=new WeakMap,ct=new WeakMap,St=new WeakMap,dt=new WeakMap,yt=new WeakMap,p=new WeakSet,Vt=function(e){const s=document.createElement("script");for(let a=0;a<e.attributes.length;a++){const n=e.attributes[a];s.setAttribute(n.name,n.value)}return e.hasAttribute("src")||(s.innerHTML=e.innerHTML),s},At=new WeakMap,Ht=function(e){const s=this.normalizePath(e);let a=t(this,W).get(s.pathname);return a||(a=new ae(this,s.pathname),t(this,W).set(s.pathname,a)),a},Ot=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},le=function(e,s){return e.filter(a=>s.find(n=>n.outerHTML===a.outerHTML))},Ft=function(e,s){return e.filter(a=>!s.find(n=>n.outerHTML===a.outerHTML))},Bt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},Kt=function(e){var s,a;(s=t(this,U))==null||s.removeEventListener("scroll",t(this,ut)),o(this,ct,0),o(this,lt,0),o(this,U,t(this,q).scrollSelector&&e.querySelector(t(this,q).scrollSelector)||window),o(this,vt,t(this,U)===window),(a=t(this,U))==null||a.addEventListener("scroll",t(this,ut)),t(this,ut).call(this)},Xt=function(e,s){const a=typeof e=="string"?document.getElementById(e):e;(typeof a=="number"||a)&&ie.scrollToElement(a,{scrollElement:t(this,U),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Tt=new WeakMap,ut=new WeakMap,pt.instance=null;let Wt=pt;exports.Morph=Wt;
|
package/lib/morph/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import { i as ae } from "../index-Bv9zgfdb.js";
|
|
|
36
36
|
import { d as z } from "../events-CsVF98U6.js";
|
|
37
37
|
import { w as ve, s as Le } from "../scroll-DNGJVxa2.js";
|
|
38
38
|
import "construct-style-sheets-polyfill";
|
|
39
|
-
import { n as Se, c as zt, s as ye } from "../url-
|
|
39
|
+
import { n as Se, c as zt, s as ye } from "../url-Ddgqz4Q_.js";
|
|
40
40
|
import { c as ne } from "../string-BlMQbe8b.js";
|
|
41
41
|
import { c as Ae } from "../math-BOBiC4TN.js";
|
|
42
42
|
import { cssValueParser as Pe } from "../css-value-parser/index.js";
|
|
@@ -93,8 +93,8 @@ class qt {
|
|
|
93
93
|
for (const w in t(this, i).dataset) {
|
|
94
94
|
const st = ne(w);
|
|
95
95
|
if (st.startsWith("match-param-")) {
|
|
96
|
-
const $ = st.split("match-param-")[1],
|
|
97
|
-
u.has($) && u.get($) ===
|
|
96
|
+
const $ = st.split("match-param-")[1], S = t(this, i).dataset[w], c = `param-${$}-matched`;
|
|
97
|
+
u.has($) && u.get($) === S || !u.has($) && (S === "" || S === "*" || S === "all" || S === "any" || S === "vse") ? t(this, i).classList.add(c) : t(this, i).classList.remove(c);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -178,33 +178,33 @@ R = new WeakMap(), i = new WeakMap(), x = new WeakSet(), at = function() {
|
|
|
178
178
|
let $ = t(this, x, at);
|
|
179
179
|
if (t(this, i).hasAttribute("data-toggle-params")) {
|
|
180
180
|
const [c, At] = t(this, x, at).split("?"), j = new URLSearchParams(At), V = new URLSearchParams(location.search), it = new URLSearchParams();
|
|
181
|
-
for (const [
|
|
182
|
-
(!V.has(
|
|
181
|
+
for (const [y] of j)
|
|
182
|
+
(!V.has(y) || V.has(y) && V.get(y) !== j.get(y)) && it.append(y, j.get(y));
|
|
183
183
|
if (t(this, i).hasAttribute("data-merge-params"))
|
|
184
|
-
for (const [
|
|
185
|
-
j.has(
|
|
184
|
+
for (const [y] of V)
|
|
185
|
+
j.has(y) || it.append(y, V.get(y));
|
|
186
186
|
$ = `${c}?${it.toString()}`;
|
|
187
187
|
}
|
|
188
|
-
const
|
|
189
|
-
|
|
188
|
+
const S = b(this, x, Rt).call(this, t(this, i).getAttribute("data-pagination-set-link") || t(this, i).getAttribute("data-pagination-more-link") || t(this, i).getAttribute("data-pagination-next-link") || t(this, i).getAttribute("data-pagination-prev-link"));
|
|
189
|
+
S && (t(this, i).hasAttribute("data-pagination-set-link") ? t(this, R).links.forEach((c) => {
|
|
190
190
|
c.updatePagination(
|
|
191
191
|
parseInt(t(this, i).getAttribute("data-value") || "1"),
|
|
192
|
-
|
|
192
|
+
S.selector
|
|
193
193
|
);
|
|
194
194
|
}) : t(this, i).hasAttribute("data-pagination-prev-link") ? t(this, R).links.forEach((c) => {
|
|
195
195
|
c.updatePagination(
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
S.currentPage - 1,
|
|
197
|
+
S.selector
|
|
198
198
|
);
|
|
199
199
|
}) : t(this, i).hasAttribute("data-pagination-next-link") ? t(this, R).links.forEach((c) => {
|
|
200
200
|
c.updatePagination(
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
S.currentPage + 1,
|
|
202
|
+
S.selector
|
|
203
203
|
);
|
|
204
204
|
}) : t(this, i).hasAttribute("data-pagination-more-link") && t(this, R).links.forEach((c) => {
|
|
205
205
|
c.updatePagination(
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
S.currentPage + 1,
|
|
207
|
+
S.selector
|
|
208
208
|
);
|
|
209
209
|
})), t(this, R).navigate($, {
|
|
210
210
|
historyAction: a,
|
|
@@ -217,7 +217,7 @@ R = new WeakMap(), i = new WeakMap(), x = new WeakSet(), at = function() {
|
|
|
217
217
|
keepScrollPosition: v,
|
|
218
218
|
scrollBehaviour: et,
|
|
219
219
|
submorphAppend: t(this, i).hasAttribute("data-pagination-more-link"),
|
|
220
|
-
mergeParams: t(this, i).hasAttribute("data-merge-params") && !t(this, i).hasAttribute("data-toggle-params")
|
|
220
|
+
mergeParams: !!S || t(this, i).hasAttribute("data-merge-params") && !t(this, i).hasAttribute("data-toggle-params")
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
}, pt = new WeakMap(), nt = new WeakMap();
|
|
@@ -526,7 +526,7 @@ const mt = class mt {
|
|
|
526
526
|
if (t(this, K).length)
|
|
527
527
|
return;
|
|
528
528
|
o(this, Lt, d), o(this, dt, f), o(this, St, w);
|
|
529
|
-
const
|
|
529
|
+
const S = ((At = this.pathnameModifier) == null ? void 0 : At.call(this, e)) || e, c = this.normalizePath(S, {
|
|
530
530
|
mergeParams: st
|
|
531
531
|
});
|
|
532
532
|
if (!f && (((j = t(this, X)) == null ? void 0 : j.pathname) === c.pathname || t(this, g).pathname === c.pathname)) {
|
|
@@ -546,17 +546,17 @@ const mt = class mt {
|
|
|
546
546
|
newURL: t(this, g),
|
|
547
547
|
previousURL: t(this, _)
|
|
548
548
|
}
|
|
549
|
-
})), t(this, P).forEach((
|
|
550
|
-
|
|
549
|
+
})), t(this, P).forEach((y) => {
|
|
550
|
+
y.checkCurrent(c.path);
|
|
551
551
|
});
|
|
552
552
|
return;
|
|
553
553
|
} else
|
|
554
|
-
t(this, P).forEach((
|
|
555
|
-
|
|
554
|
+
t(this, P).forEach((y) => {
|
|
555
|
+
y.checkCurrent(c.path);
|
|
556
556
|
});
|
|
557
557
|
o(this, X, c);
|
|
558
558
|
try {
|
|
559
|
-
let
|
|
559
|
+
let y = !0;
|
|
560
560
|
if (this.preprocessor)
|
|
561
561
|
try {
|
|
562
562
|
yield new Promise((r, k) => {
|
|
@@ -569,9 +569,9 @@ const mt = class mt {
|
|
|
569
569
|
});
|
|
570
570
|
});
|
|
571
571
|
} catch (r) {
|
|
572
|
-
r ? console.error(r) : console.log("Route change canceled"),
|
|
572
|
+
r ? console.error(r) : console.log("Route change canceled"), y = !1;
|
|
573
573
|
}
|
|
574
|
-
if (!
|
|
574
|
+
if (!y || t(this, X).pathname !== c.pathname) {
|
|
575
575
|
t(this, P).forEach((r) => {
|
|
576
576
|
r.checkCurrent(t(this, g).path);
|
|
577
577
|
});
|
|
@@ -594,7 +594,7 @@ const mt = class mt {
|
|
|
594
594
|
const Ut = b(this, p, xt).call(this, t(this, g).pathname), A = b(this, p, xt).call(this, c.pathname);
|
|
595
595
|
if (t(this, W).forEach((r) => {
|
|
596
596
|
r.pathname !== c.pathname && r.abort();
|
|
597
|
-
}), yield A == null ? void 0 : A.fetch(
|
|
597
|
+
}), yield A == null ? void 0 : A.fetch(S, t(this, g).path, f), t(this, X).pathname !== c.pathname) {
|
|
598
598
|
t(this, P).forEach((r) => {
|
|
599
599
|
r.checkCurrent(t(this, g).path);
|
|
600
600
|
});
|
|
@@ -749,8 +749,8 @@ const mt = class mt {
|
|
|
749
749
|
}), document.documentElement.style.removeProperty(
|
|
750
750
|
"--new-document-scroll-position"
|
|
751
751
|
), window.dispatchEvent(new Event("resize"));
|
|
752
|
-
} catch (
|
|
753
|
-
console.error(
|
|
752
|
+
} catch (y) {
|
|
753
|
+
console.error(y);
|
|
754
754
|
}
|
|
755
755
|
o(this, X, void 0);
|
|
756
756
|
});
|