aptechka 0.72.7 → 0.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,642 +1,706 @@
1
- var _t = Object.defineProperty, te = Object.defineProperties;
2
- var ee = Object.getOwnPropertyDescriptors;
3
- var zt = Object.getOwnPropertySymbols;
4
- var se = Object.prototype.hasOwnProperty, ie = Object.prototype.propertyIsEnumerable;
5
- var Vt = (a, t) => (t = Symbol[a]) ? t : Symbol.for("Symbol." + a), Ft = (a) => {
6
- throw TypeError(a);
1
+ var se = Object.defineProperty, ae = Object.defineProperties;
2
+ var ne = Object.getOwnPropertyDescriptors;
3
+ var Wt = Object.getOwnPropertySymbols;
4
+ var re = Object.prototype.hasOwnProperty, oe = Object.prototype.propertyIsEnumerable;
5
+ var Xt = (o, e) => (e = Symbol[o]) ? e : Symbol.for("Symbol." + o), jt = (o) => {
6
+ throw TypeError(o);
7
7
  };
8
- var Ot = (a, t, s) => t in a ? _t(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s, mt = (a, t) => {
9
- for (var s in t || (t = {}))
10
- se.call(t, s) && Ot(a, s, t[s]);
11
- if (zt)
12
- for (var s of zt(t))
13
- ie.call(t, s) && Ot(a, s, t[s]);
14
- return a;
15
- }, vt = (a, t) => te(a, ee(t));
16
- var wt = (a, t, s) => t.has(a) || Ft("Cannot " + s);
17
- var e = (a, t, s) => (wt(a, t, "read from private field"), s ? s.call(a) : t.get(a)), o = (a, t, s) => t.has(a) ? Ft("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s), n = (a, t, s, i) => (wt(a, t, "write to private field"), i ? i.call(a, s) : t.set(a, s), s), E = (a, t, s) => (wt(a, t, "access private method"), s);
18
- var B = (a, t, s) => new Promise((i, h) => {
19
- var S = (f) => {
8
+ var Yt = (o, e, i) => e in o ? se(o, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[e] = i, gt = (o, e) => {
9
+ for (var i in e || (e = {}))
10
+ re.call(e, i) && Yt(o, i, e[i]);
11
+ if (Wt)
12
+ for (var i of Wt(e))
13
+ oe.call(e, i) && Yt(o, i, e[i]);
14
+ return o;
15
+ }, kt = (o, e) => ae(o, ne(e));
16
+ var Pt = (o, e, i) => e.has(o) || jt("Cannot " + i);
17
+ var t = (o, e, i) => (Pt(o, e, "read from private field"), i ? i.call(o) : e.get(o)), l = (o, e, i) => e.has(o) ? jt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, i), r = (o, e, i, s) => (Pt(o, e, "write to private field"), s ? s.call(o, i) : e.set(o, i), i), p = (o, e, i) => (Pt(o, e, "access private method"), i);
18
+ var W = (o, e, i) => new Promise((s, h) => {
19
+ var g = (f) => {
20
20
  try {
21
- b(s.next(f));
22
- } catch (H) {
23
- h(H);
21
+ w(i.next(f));
22
+ } catch (S) {
23
+ h(S);
24
24
  }
25
- }, y = (f) => {
25
+ }, E = (f) => {
26
26
  try {
27
- b(s.throw(f));
28
- } catch (H) {
29
- h(H);
27
+ w(i.throw(f));
28
+ } catch (S) {
29
+ h(S);
30
30
  }
31
- }, b = (f) => f.done ? i(f.value) : Promise.resolve(f.value).then(S, y);
32
- b((s = s.apply(a, t)).next());
31
+ }, w = (f) => f.done ? s(f.value) : Promise.resolve(f.value).then(g, E);
32
+ w((i = i.apply(o, e)).next());
33
33
  });
34
- var Bt = (a, t, s) => (t = a[Vt("asyncIterator")]) ? t.call(a) : (a = a[Vt("iterator")](), t = {}, s = (i, h) => (h = a[i]) && (t[i] = (S) => new Promise((y, b, f) => (S = h.call(a, S), f = S.done, Promise.resolve(S.value).then((H) => y({ value: H, done: f }), b)))), s("next"), s("return"), t);
35
- import { i as Yt } from "../index-Bv9zgfdb.js";
36
- import { d as R } from "../events-CsVF98U6.js";
37
- import { r as re } from "../polyfills-DJrTJQky.js";
38
- import { w as ne, s as ae } from "../scroll-DPkCFTxg.js";
34
+ var Kt = (o, e, i) => (e = o[Xt("asyncIterator")]) ? e.call(o) : (o = o[Xt("iterator")](), e = {}, i = (s, h) => (h = o[s]) && (e[s] = (g) => new Promise((E, w, f) => (g = h.call(o, g), f = g.done, Promise.resolve(g.value).then((S) => E({ value: S, done: f }), w)))), i("next"), i("return"), e);
35
+ import { i as Jt } from "../index-Bv9zgfdb.js";
36
+ import { d as T } from "../events-CsVF98U6.js";
37
+ import { r as le } from "../polyfills-DJrTJQky.js";
38
+ import { w as he, s as ce } from "../scroll-DPkCFTxg.js";
39
39
  import "construct-style-sheets-polyfill";
40
- import { n as oe, c as yt, s as le } from "../url-UL9zSCHb.js";
41
- import { cssValueParser as he } from "../css-value-parser/index.js";
42
- class jt extends HTMLElement {
40
+ import { n as ue, c as Ct, s as de } from "../url-CFnGU6md.js";
41
+ import { cssValueParser as me } from "../css-value-parser/index.js";
42
+ class Qt extends HTMLElement {
43
43
  connectedCallback() {
44
- const t = {
44
+ const e = {
45
45
  "aria-live": "assertive",
46
46
  "aria-atomic": "true",
47
47
  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"
48
48
  };
49
- for (const [s, i] of Object.entries(t))
50
- this.setAttribute(s, i);
49
+ for (const [i, s] of Object.entries(e))
50
+ this.setAttribute(i, s);
51
51
  }
52
52
  }
53
- Yt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", jt);
54
- var M, l, D, it, G;
55
- class bt {
56
- constructor(t, s) {
57
- o(this, M);
58
- o(this, l);
59
- o(this, D);
60
- o(this, it, (t) => {
61
- var i;
62
- if (t.preventDefault(), document.documentElement.classList.contains("click-disabled"))
53
+ Jt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Qt);
54
+ var P, a, q, J, Et, rt, Q;
55
+ class Ht {
56
+ constructor(e, i) {
57
+ l(this, J);
58
+ l(this, P);
59
+ l(this, a);
60
+ l(this, q);
61
+ l(this, rt, (e) => {
62
+ var s;
63
+ if (e.preventDefault(), document.documentElement.classList.contains("click-disabled"))
63
64
  return;
64
- if (e(this, l).hasAttribute("data-back") && e(this, M).previousURL)
65
+ if (t(this, a).hasAttribute("data-back") && t(this, P).previousURL)
65
66
  history.back();
66
67
  else {
67
- n(this, D, e(this, l).getAttribute("href") || "/");
68
- const h = e(this, l).getAttribute(
68
+ r(this, q, t(this, a).getAttribute("href") || "/");
69
+ const h = t(this, a).getAttribute(
69
70
  "data-history-action"
70
- ) || "push", S = e(this, l).hasAttribute("data-center-scroll"), y = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), b = y ? he.parse(y) : void 0, f = e(this, l).hasAttribute("data-revalidate"), H = e(this, l).hasAttribute(
71
+ ) || "push", g = t(this, a).hasAttribute("data-center-scroll"), E = getComputedStyle(t(this, a)).getPropertyValue("--offset-scroll").trim(), w = E ? me.parse(E) : void 0, f = t(this, a).hasAttribute("data-revalidate") || t(this, a).hasAttribute("data-pagination-more-link") || t(this, a).hasAttribute("data-pagination-set-link"), S = t(this, a).hasAttribute(
71
72
  "data-keep-search-parameters"
72
- ), Et = e(this, l).hasAttribute(
73
- "data-keep-scroll-position"
74
- ), $t = e(this, l).getAttribute(
73
+ ), Lt = t(this, a).hasAttribute("data-keep-scroll-position") || t(this, a).hasAttribute("data-pagination-more-link"), bt = t(this, a).getAttribute(
75
74
  "data-scroll-behaviour"
76
- ), lt = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((ht) => ht.trim()), c = e(this, l).hasAttribute("data-clear-state");
77
- e(this, M).navigate(e(this, D), {
75
+ ), ut = p(this, J, Et).call(this, t(this, a).getAttribute("data-pagination-set-link") || t(this, a).getAttribute("data-pagination-more-link"));
76
+ ut && (t(this, a).hasAttribute("data-pagination-set-link") ? t(this, P).links.forEach((U) => {
77
+ U.updatePagination(
78
+ parseInt(t(this, a).getAttribute("data-value") || "1"),
79
+ ut.selector
80
+ );
81
+ }) : t(this, a).hasAttribute("data-pagination-more-link") && t(this, P).links.forEach((U) => {
82
+ U.updatePagination(
83
+ ut.currentPage + 1,
84
+ ut.selector
85
+ );
86
+ }));
87
+ const dt = ((s = t(this, a).getAttribute("data-submorph")) == null ? void 0 : s.split(",").map((U) => U.trim())) || t(this, a).hasAttribute("data-pagination-more-link") && [
88
+ t(this, a).getAttribute("data-pagination-more-link")
89
+ ] || t(this, a).hasAttribute("data-pagination-set-link") && [
90
+ t(this, a).getAttribute("data-pagination-set-link")
91
+ ] || void 0, c = t(this, a).hasAttribute("data-clear-state");
92
+ t(this, P).navigate(t(this, q), {
78
93
  historyAction: h,
79
- centerScroll: S,
80
- offsetScroll: b,
94
+ centerScroll: g,
95
+ offsetScroll: w,
81
96
  revalidate: f,
82
- keepSearchParameters: H,
83
- submorph: lt,
97
+ keepSearchParameters: S,
98
+ submorph: dt,
84
99
  clearState: c,
85
- keepScrollPosition: Et,
86
- scrollBehaviour: $t
100
+ keepScrollPosition: Lt,
101
+ scrollBehaviour: bt,
102
+ submorphAppend: t(this, a).hasAttribute("data-pagination-more-link")
87
103
  });
88
104
  }
89
105
  });
90
- o(this, G, () => {
91
- const t = e(this, l).hasAttribute("data-revalidate");
92
- e(this, M).prefetch(e(this, D), t), e(this, l).removeEventListener("pointerenter", e(this, G));
106
+ l(this, Q, () => {
107
+ const e = t(this, a).hasAttribute("data-revalidate");
108
+ t(this, P).prefetch(t(this, q), e), t(this, a).removeEventListener("pointerenter", t(this, Q));
93
109
  });
94
- n(this, M, s), n(this, l, t), n(this, D, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, it)), this.checkCurrent(location.href.replace(location.origin, "")), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, G));
110
+ r(this, P, i), r(this, a, e), t(this, a).addEventListener("click", t(this, rt)), r(this, q, t(this, a).getAttribute("href") || "/"), this.checkCurrent(location.href.replace(location.origin, ""));
111
+ const s = p(this, J, Et).call(this, t(this, a).getAttribute("data-pagination-set-link") || t(this, a).getAttribute("data-pagination-more-link"));
112
+ s && this.updatePagination(
113
+ s.currentPage,
114
+ s.selector
115
+ ), t(this, a).hasAttribute("data-prefetch") && t(this, a).addEventListener("pointerenter", t(this, Q));
95
116
  }
96
117
  get element() {
97
- return e(this, l);
118
+ return t(this, a);
98
119
  }
99
- checkCurrent(t) {
120
+ checkCurrent(e) {
100
121
  var h;
101
- const s = e(this, M).normalizePath(t), i = e(this, M).normalizePath(e(this, D));
102
- e(this, l).hasAttribute("data-include") && s.pathname.includes(i.pathname) ? e(this, l).classList.add("current") : i.pathname === s.pathname ? e(this, l).classList.add("current") : (h = e(this, l).getAttribute("data-associated-paths")) != null && h.split(",").find((S) => s.pathname.includes(S)) ? e(this, l).classList.add("current") : e(this, l).classList.remove("current"), s.path === i.path ? e(this, l).classList.add("exact") : e(this, l).classList.remove("exact");
122
+ const i = t(this, P).normalizePath(e), s = t(this, P).normalizePath(t(this, q));
123
+ t(this, a).hasAttribute("data-include") && i.pathname.includes(s.pathname) ? t(this, a).classList.add("current") : s.pathname === i.pathname ? t(this, a).classList.add("current") : (h = t(this, a).getAttribute("data-associated-paths")) != null && h.split(",").find((g) => i.pathname.includes(g)) ? t(this, a).classList.add("current") : t(this, a).classList.remove("current"), i.path === s.path ? t(this, a).classList.add("exact") : t(this, a).classList.remove("exact");
124
+ }
125
+ updatePagination(e, i) {
126
+ const s = p(this, J, Et).call(this, i);
127
+ if (s)
128
+ if (s.element.setAttribute(
129
+ "data-current-page",
130
+ e.toString()
131
+ ), t(this, a).hasAttribute("data-pagination-more-link"))
132
+ if (e < s.totalPages) {
133
+ t(this, a).style.display = "";
134
+ const h = t(this, a).querySelector(
135
+ "[data-pagination-more-link-counter]"
136
+ );
137
+ h && (h.textContent = (s.totalPages - e).toString());
138
+ const g = t(this, a).getAttribute("href"), E = new URL(g, window.location.origin);
139
+ E.searchParams.set("page", (e + 1).toString());
140
+ const w = E.href.replace(E.origin, "").toString();
141
+ t(this, a).setAttribute("href", w), this.checkCurrent(w);
142
+ } else
143
+ t(this, a).style.display = "none";
144
+ else t(this, a).hasAttribute("data-pagination-set-link") && (t(this, a).getAttribute("data-value") === e.toString() ? t(this, a).classList.add("pagination-current") : t(this, a).classList.remove("pagination-current"));
103
145
  }
104
146
  destroy() {
105
- e(this, l).removeEventListener("click", e(this, it)), e(this, l).removeEventListener("pointerenter", e(this, G)), e(this, l).classList.remove("current");
147
+ t(this, a).removeEventListener("click", t(this, rt)), t(this, a).removeEventListener("pointerenter", t(this, Q)), t(this, a).classList.remove("current", "exact", "pagination-current");
106
148
  }
107
149
  }
108
- M = new WeakMap(), l = new WeakMap(), D = new WeakMap(), it = new WeakMap(), G = new WeakMap();
109
- const ce = new DOMParser();
110
- var T, W, w, k, X, I, J, Y, q, Q, rt;
111
- class Wt {
112
- constructor(t, s) {
113
- o(this, T);
114
- o(this, W);
115
- o(this, w, { x: 0, y: 0 });
116
- o(this, k, null);
117
- o(this, X, null);
118
- o(this, I, null);
119
- o(this, J, null);
120
- o(this, Y, null);
121
- o(this, q, null);
122
- o(this, Q);
123
- o(this, rt);
124
- n(this, T, t), n(this, W, s), n(this, Q, s);
150
+ P = new WeakMap(), a = new WeakMap(), q = new WeakMap(), J = new WeakSet(), Et = function(e) {
151
+ if (!e)
152
+ return;
153
+ const i = document.querySelector(e);
154
+ if (i) {
155
+ const s = parseInt(
156
+ i.getAttribute("data-current-page") || "1"
157
+ ), h = parseInt(
158
+ i.getAttribute("data-total-pages") || "1"
159
+ );
160
+ return {
161
+ element: i,
162
+ currentPage: s,
163
+ totalPages: h,
164
+ selector: e
165
+ };
166
+ }
167
+ }, rt = new WeakMap(), Q = new WeakMap();
168
+ const fe = new DOMParser();
169
+ var x, X, A, R, Y, z, Z, j, V, _, ot;
170
+ class $t {
171
+ constructor(e, i) {
172
+ l(this, x);
173
+ l(this, X);
174
+ l(this, A, { x: 0, y: 0 });
175
+ l(this, R, null);
176
+ l(this, Y, null);
177
+ l(this, z, null);
178
+ l(this, Z, null);
179
+ l(this, j, null);
180
+ l(this, V, null);
181
+ l(this, _);
182
+ l(this, ot);
183
+ r(this, x, e), r(this, X, i), r(this, _, i);
125
184
  }
126
185
  get pathname() {
127
- return e(this, W);
186
+ return t(this, X);
128
187
  }
129
188
  get scrollState() {
130
- return e(this, w);
189
+ return t(this, A);
131
190
  }
132
191
  get document() {
133
- return e(this, I);
192
+ return t(this, z);
134
193
  }
135
- setHeaders(t) {
136
- n(this, rt, t);
194
+ setHeaders(e) {
195
+ r(this, ot, e);
137
196
  }
138
- setInitialDocument(t) {
139
- n(this, k, t.cloneNode(!0));
197
+ setInitialDocument(e) {
198
+ r(this, R, e.cloneNode(!0));
140
199
  }
141
200
  abort() {
142
- var t;
143
- return (t = e(this, Y)) == null ? void 0 : t.abort(
144
- `[${e(this, W)}] page loading cancelled`
201
+ var e;
202
+ return (e = t(this, j)) == null ? void 0 : e.abort(
203
+ `[${t(this, X)}] page loading cancelled`
145
204
  );
146
205
  }
147
- fetch(t, s, i) {
148
- return B(this, null, function* () {
149
- return !i && (e(this, q) || e(this, k) && e(this, k).documentElement.hasAttribute("data-cache") && e(this, Q) !== t || e(this, k) && e(this, T).isPopstateNavigation) ? e(this, q) : (n(this, Q, t), n(this, q, new Promise((h) => B(this, null, function* () {
206
+ fetch(e, i, s) {
207
+ return W(this, null, function* () {
208
+ return !s && (t(this, V) || t(this, R) && t(this, R).documentElement.hasAttribute("data-cache") && t(this, _) !== e || t(this, R) && t(this, x).isPopstateNavigation) ? t(this, V) : (r(this, _, e), r(this, V, new Promise((h) => W(this, null, function* () {
150
209
  try {
151
- n(this, Y, new AbortController());
152
- const y = yield (yield fetch(t, {
153
- signal: e(this, Y).signal,
154
- headers: mt({
210
+ r(this, j, new AbortController());
211
+ const E = yield (yield fetch(e, {
212
+ signal: t(this, j).signal,
213
+ headers: gt({
155
214
  "X-MORPH": "true",
156
- "X-MORPH-CURRENT-PATH": encodeURIComponent(s),
157
- "X-MORPH-NEW-PATH": encodeURIComponent(t)
158
- }, e(this, rt))
159
- })).text(), b = ce.parseFromString(y, "text/html");
160
- this.setInitialDocument(b);
161
- } catch (S) {
162
- console.warn(S);
215
+ "X-MORPH-CURRENT-PATH": encodeURIComponent(i),
216
+ "X-MORPH-NEW-PATH": encodeURIComponent(e)
217
+ }, t(this, ot))
218
+ })).text(), w = fe.parseFromString(E, "text/html");
219
+ this.setInitialDocument(w);
220
+ } catch (g) {
221
+ console.warn(g);
163
222
  } finally {
164
- n(this, Y, null), n(this, q, null), h();
223
+ r(this, j, null), r(this, V, null), h();
165
224
  }
166
- }))), e(this, q));
225
+ }))), t(this, V));
167
226
  });
168
227
  }
169
228
  cloneDocument() {
170
- n(this, I, (e(this, X) || e(this, k)).cloneNode(!0));
229
+ r(this, z, (t(this, Y) || t(this, R)).cloneNode(!0));
171
230
  }
172
231
  get title() {
173
- let t = "";
174
- if (e(this, I).title)
175
- t = e(this, I).title;
232
+ let e = "";
233
+ if (t(this, z).title)
234
+ e = t(this, z).title;
176
235
  else {
177
- const s = e(this, I).querySelector("h1");
178
- t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, W);
236
+ const i = t(this, z).querySelector("h1");
237
+ e = (i == null ? void 0 : i.innerText) || (i == null ? void 0 : i.textContent) || t(this, X);
179
238
  }
180
- return t;
239
+ return e;
181
240
  }
182
241
  clearScrollState() {
183
- e(this, w).x = 0, e(this, w).y = 0;
242
+ t(this, A).x = 0, t(this, A).y = 0;
184
243
  }
185
244
  clearDocumentState() {
186
- n(this, X, null);
245
+ r(this, Y, null);
187
246
  }
188
247
  saveScrollState() {
189
- e(this, k).documentElement.hasAttribute(
248
+ t(this, R).documentElement.hasAttribute(
190
249
  "data-no-scroll-restoration"
191
- ) ? (e(this, w).x = 0, e(this, w).y = 0) : (e(this, w).x = e(this, T).scrollValue.left, e(this, w).y = e(this, T).scrollValue.top);
250
+ ) ? (t(this, A).x = 0, t(this, A).y = 0) : (t(this, A).x = t(this, x).scrollValue.left, t(this, A).y = t(this, x).scrollValue.top);
192
251
  }
193
252
  restoreScrollPosition() {
194
- e(this, T).scrollElement.scroll({
195
- top: e(this, w).y,
196
- left: e(this, w).x,
253
+ t(this, x).scrollElement.scroll({
254
+ top: t(this, A).y,
255
+ left: t(this, A).x,
197
256
  behavior: "instant"
198
257
  });
199
258
  }
200
259
  saveDocumentState() {
201
- e(this, k).documentElement.hasAttribute(
260
+ t(this, R).documentElement.hasAttribute(
202
261
  "data-no-page-restoration"
203
- ) ? n(this, X, null) : n(this, X, document.cloneNode(!0));
262
+ ) ? r(this, Y, null) : r(this, Y, document.cloneNode(!0));
204
263
  }
205
264
  renewScrollPosition() {
206
- e(this, T).scrollElement.scroll({
265
+ t(this, x).scrollElement.scroll({
207
266
  top: 0,
208
267
  left: 0,
209
268
  behavior: "instant"
210
269
  });
211
270
  }
212
- saveState(t) {
213
- n(this, J, t);
271
+ saveState(e) {
272
+ r(this, Z, e);
214
273
  }
215
274
  clearState() {
216
- const t = e(this, J);
217
- return n(this, J, null), t;
275
+ const e = t(this, Z);
276
+ return r(this, Z, null), e;
218
277
  }
219
278
  }
220
- T = new WeakMap(), W = new WeakMap(), w = new WeakMap(), k = new WeakMap(), X = new WeakMap(), I = new WeakMap(), J = new WeakMap(), Y = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), rt = new WeakMap();
221
- var C, Z, g, z, m, j, V, O, P, nt, x, K, _, tt, at, u, At, ot, ft, Pt, Kt, kt, Ct, Ht, Rt, pt, et;
222
- const st = class st {
223
- constructor(t) {
224
- o(this, u);
225
- o(this, C, null);
226
- o(this, Z, null);
227
- o(this, g, []);
228
- o(this, z);
229
- o(this, m, null);
230
- o(this, j);
231
- o(this, V, []);
232
- o(this, O, !1);
233
- o(this, P, null);
234
- o(this, nt, !1);
235
- o(this, x, /* @__PURE__ */ new Map());
236
- o(this, K, null);
237
- o(this, _, 0);
238
- o(this, tt, 0);
239
- o(this, at, null);
240
- o(this, ot, (t) => {
241
- var s;
242
- return ((s = t.getAttribute("href")) == null ? void 0 : s.startsWith("/")) && !t.hasAttribute("download") && !t.hasAttribute("data-morph-skip") && !t.closest("[data-morph-skip]") && t.getAttribute("target") !== "_blank";
279
+ x = new WeakMap(), X = new WeakMap(), A = new WeakMap(), R = new WeakMap(), Y = new WeakMap(), z = new WeakMap(), Z = new WeakMap(), j = new WeakMap(), V = new WeakMap(), _ = new WeakMap(), ot = new WeakMap();
280
+ var M, tt, b, O, m, K, F, B, C, lt, N, $, et, it, ht, st, d, Rt, ct, St, Mt, Zt, Tt, xt, Nt, Ut, vt, at;
281
+ const nt = class nt {
282
+ constructor(e) {
283
+ l(this, d);
284
+ l(this, M, null);
285
+ l(this, tt, null);
286
+ l(this, b, []);
287
+ l(this, O);
288
+ l(this, m, null);
289
+ l(this, K);
290
+ l(this, F, []);
291
+ l(this, B, !1);
292
+ l(this, C, null);
293
+ l(this, lt, !1);
294
+ l(this, N, /* @__PURE__ */ new Map());
295
+ l(this, $, null);
296
+ l(this, et, 0);
297
+ l(this, it, 0);
298
+ l(this, ht);
299
+ l(this, st);
300
+ l(this, ct, (e) => {
301
+ var i;
302
+ return ((i = e.getAttribute("href")) == null ? void 0 : i.startsWith("/")) && !e.hasAttribute("download") && !e.hasAttribute("data-morph-skip") && !e.closest("[data-morph-skip]") && e.getAttribute("target") !== "_blank";
243
303
  });
244
- o(this, pt, (t) => B(this, null, function* () {
245
- t.preventDefault(), n(this, O, !0), yield this.navigate(location.href.replace(location.origin, ""), {
304
+ l(this, vt, (e) => W(this, null, function* () {
305
+ e.preventDefault(), r(this, B, !0), yield this.navigate(location.href.replace(location.origin, ""), {
246
306
  historyAction: "none",
247
- submorph: e(this, at) || void 0
248
- }), n(this, O, !1);
307
+ submorph: t(this, st) ? void 0 : t(this, ht),
308
+ revalidate: t(this, st)
309
+ }), r(this, B, !1);
249
310
  }));
250
- o(this, et, () => {
251
- const { left: t, top: s } = this.scrollValue, i = s - e(this, tt), h = t - e(this, _);
252
- n(this, tt, s), n(this, _, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
311
+ l(this, at, () => {
312
+ const { left: e, top: i } = this.scrollValue, s = i - t(this, it), h = e - t(this, et);
313
+ r(this, it, i), r(this, et, e), document.documentElement.classList.toggle("scroll-y", i > 0), document.documentElement.classList.toggle("scroll-x", e > 0), document.documentElement.classList.toggle(
253
314
  "scroll-y-forward",
254
- i > 0
315
+ s > 0
255
316
  ), document.documentElement.classList.toggle(
256
317
  "scroll-y-backward",
257
- i < 0
318
+ s < 0
258
319
  ), document.documentElement.classList.toggle(
259
320
  "scroll-x-forward",
260
321
  h > 0
261
322
  ), document.documentElement.classList.toggle(
262
323
  "scroll-x-backward",
263
324
  h < 0
264
- ), R(document, "morphScroll", {
325
+ ), T(document, "morphScroll", {
265
326
  detail: {
266
- left: t,
267
- top: s
327
+ left: e,
328
+ top: i
268
329
  }
269
330
  });
270
331
  });
271
- if (Yt && !st.instance) {
272
- st.instance = this, n(this, C, {
273
- base: oe(t == null ? void 0 : t.base),
274
- waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
275
- trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
276
- scrollSelector: t == null ? void 0 : t.scrollSelector,
277
- morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
278
- }), n(this, Z, E(this, u, Pt).call(this, document.body));
279
- const s = this.normalizePath(
280
- location.pathname + location.hash + location.search
332
+ if (Jt && !nt.instance) {
333
+ nt.instance = this, r(this, M, {
334
+ base: ue(e == null ? void 0 : e.base),
335
+ waitForHeadToLoad: (e == null ? void 0 : e.waitForHeadToLoad) !== !1,
336
+ trailingSlash: (e == null ? void 0 : e.trailingSlash) || !1,
337
+ scrollSelector: e == null ? void 0 : e.scrollSelector,
338
+ morphInsideScrollContainer: (e == null ? void 0 : e.morphInsideScrollContainer) || !1
339
+ }), r(this, tt, p(this, d, Mt).call(this, document.body));
340
+ const i = this.normalizePath(
341
+ location.pathname + location.search + location.hash
281
342
  );
282
- n(this, m, s);
283
- const i = new Wt(this, e(this, m).pathname);
284
- i.setInitialDocument(document), e(this, x).set(e(this, m).pathname, i), document.documentElement.setAttribute(
343
+ r(this, m, i);
344
+ const s = new $t(this, t(this, m).pathname);
345
+ s.setInitialDocument(document), t(this, N).set(t(this, m).pathname, s), document.documentElement.setAttribute(
285
346
  "data-current-pathname",
286
- e(this, m).pathname
347
+ t(this, m).pathname
287
348
  ), document.documentElement.setAttribute(
288
349
  "data-current-leaf",
289
- s.leaf
290
- ), this.findLinks(), history.scrollRestoration = "manual", addEventListener("popstate", e(this, pt)), yt({
350
+ i.leaf
351
+ ), this.findLinks(), history.scrollRestoration = "manual", addEventListener("popstate", t(this, vt)), Ct({
291
352
  action: "replace",
292
- pathname: s.pathname,
293
- searchParameters: s.parameters,
294
- hash: s.hash
295
- }), n(this, K, new jt()), E(this, u, Ht).call(this, document);
353
+ pathname: i.pathname,
354
+ searchParameters: i.parameters,
355
+ hash: i.hash
356
+ }), r(this, $, new Qt()), p(this, d, Nt).call(this, document);
296
357
  }
297
358
  }
298
359
  get currentURL() {
299
- return e(this, m);
360
+ return t(this, m);
300
361
  }
301
362
  get previousURL() {
302
- return e(this, j);
363
+ return t(this, K);
303
364
  }
304
365
  get links() {
305
- return e(this, g);
366
+ return t(this, b);
306
367
  }
307
368
  get scrollElement() {
308
- return e(this, P);
369
+ return t(this, C);
309
370
  }
310
371
  get isPopstateNavigation() {
311
- return e(this, O);
372
+ return t(this, B);
312
373
  }
313
374
  get scrollValue() {
314
- let t = 0, s = 0;
315
- return e(this, nt) ? (t = window.scrollY, s = window.scrollX) : (t = e(this, P).scrollTop, s = e(this, P).scrollLeft), { top: t, left: s };
375
+ let e = 0, i = 0;
376
+ return t(this, lt) ? (e = window.scrollY, i = window.scrollX) : (e = t(this, C).scrollTop, i = t(this, C).scrollLeft), { top: e, left: i };
316
377
  }
317
- saveState(t) {
318
- const s = e(this, x).get(e(this, m).path);
319
- s && s.saveState(t);
378
+ saveState(e) {
379
+ const i = t(this, N).get(t(this, m).path);
380
+ i && i.saveState(e);
320
381
  }
321
382
  getState() {
322
- const t = e(this, x).get(e(this, m).path);
323
- return t == null ? void 0 : t.clearState();
383
+ const e = t(this, N).get(t(this, m).path);
384
+ return e == null ? void 0 : e.clearState();
324
385
  }
325
- normalizePath(t) {
326
- return le(t, {
327
- base: e(this, C).base,
328
- trailingSlash: e(this, C).trailingSlash
386
+ normalizePath(e) {
387
+ return de(e, {
388
+ base: t(this, M).base,
389
+ trailingSlash: t(this, M).trailingSlash
329
390
  });
330
391
  }
331
- prefetch(t, s) {
332
- return B(this, null, function* () {
392
+ prefetch(e, i) {
393
+ return W(this, null, function* () {
333
394
  var h;
334
- if (e(this, V).length)
395
+ if (t(this, F).length)
335
396
  return;
336
- t = ((h = this.pathnameModifier) == null ? void 0 : h.call(this, t)) || t;
337
- const i = E(this, u, ft).call(this, t);
338
- i == null || i.fetch(t, e(this, m).path, s);
397
+ e = ((h = this.pathnameModifier) == null ? void 0 : h.call(this, e)) || e;
398
+ const s = p(this, d, St).call(this, e);
399
+ s == null || s.fetch(e, t(this, m).path, i);
339
400
  });
340
401
  }
341
- excludeHeadChild(t) {
402
+ excludeHeadChild(e) {
342
403
  return !1;
343
404
  }
344
- setHeaders(t) {
405
+ setHeaders(e) {
345
406
  }
346
- navigate($t) {
347
- return B(this, arguments, function* (t, {
348
- historyAction: s = "push",
349
- centerScroll: i,
407
+ navigate(ut) {
408
+ return W(this, arguments, function* (e, {
409
+ historyAction: i = "push",
410
+ centerScroll: s,
350
411
  offsetScroll: h,
351
- scrollBehaviour: S,
352
- revalidate: y,
353
- keepSearchParameters: b,
412
+ scrollBehaviour: g,
413
+ revalidate: E,
414
+ keepSearchParameters: w,
354
415
  submorph: f,
355
- clearState: H,
356
- keepScrollPosition: Et
416
+ submorphAppend: S,
417
+ clearState: Lt,
418
+ keepScrollPosition: bt
357
419
  } = {}) {
358
- var ht, Mt, Tt, xt;
359
- if (e(this, V).length)
420
+ var U, It, Dt, qt;
421
+ if (t(this, F).length)
360
422
  return;
361
- n(this, at, f || null);
362
- const lt = ((ht = this.pathnameModifier) == null ? void 0 : ht.call(this, t)) || t, c = this.normalizePath(lt);
363
- if (e(this, g).forEach(($) => {
364
- $.checkCurrent(c.path);
365
- }), !y && (((Mt = e(this, z)) == null ? void 0 : Mt.pathname) === c.pathname || e(this, m).pathname === c.pathname)) {
366
- E(this, u, Rt).call(this, c.hash || 0, {
367
- centerScroll: i,
423
+ r(this, ht, f), r(this, st, E);
424
+ const dt = ((U = this.pathnameModifier) == null ? void 0 : U.call(this, e)) || e, c = this.normalizePath(dt);
425
+ if (t(this, b).forEach((G) => {
426
+ G.checkCurrent(c.path);
427
+ }), !E && (((It = t(this, O)) == null ? void 0 : It.pathname) === c.pathname || t(this, m).pathname === c.pathname)) {
428
+ p(this, d, Ut).call(this, c.hash || 0, {
429
+ centerScroll: s,
368
430
  offsetScroll: h,
369
431
  behavior: "smooth"
370
- }), R(document, "morphSamePath", {
432
+ }), T(document, "morphSamePath", {
371
433
  custom: !0
372
- }), ((Tt = e(this, m)) == null ? void 0 : Tt.parameters) !== c.parameters && (n(this, j, e(this, m)), n(this, m, c), yt({
373
- action: ((xt = e(this, m)) == null ? void 0 : xt.hash) !== c.hash ? "replace" : s,
434
+ }), ((Dt = t(this, m)) == null ? void 0 : Dt.parameters) !== c.parameters && (r(this, K, t(this, m)), r(this, m, c), Ct({
435
+ action: ((qt = t(this, m)) == null ? void 0 : qt.hash) !== c.hash ? "replace" : i,
374
436
  pathname: c.pathname,
375
437
  searchParameters: c.parameters,
376
438
  hash: c.hash
377
- }), R(document, "morphURLParametersChange", {
439
+ }), T(document, "morphURLParametersChange", {
378
440
  detail: {
379
- newURL: e(this, m),
380
- previousURL: e(this, j)
441
+ newURL: t(this, m),
442
+ previousURL: t(this, K)
381
443
  }
382
444
  }));
383
445
  return;
384
446
  }
385
- n(this, z, c);
447
+ r(this, O, c);
386
448
  try {
387
- let $ = !0;
449
+ let G = !0;
388
450
  if (this.preprocessor)
389
451
  try {
390
- yield new Promise((r, L) => {
391
- var A;
392
- (A = this.preprocessor) == null || A.call(this, {
452
+ yield new Promise((n, y) => {
453
+ var k;
454
+ (k = this.preprocessor) == null || k.call(this, {
393
455
  url: c,
394
- resolve: r,
395
- reject: L,
456
+ resolve: n,
457
+ reject: y,
396
458
  submorph: f
397
459
  });
398
460
  });
399
- } catch (r) {
400
- r ? console.error(r) : console.log("Route change canceled"), $ = !1;
461
+ } catch (n) {
462
+ n ? console.error(n) : console.log("Route change canceled"), G = !1;
401
463
  }
402
- if (!$ || e(this, z).pathname !== c.pathname) {
403
- e(this, g).forEach((r) => {
404
- r.checkCurrent(e(this, m).path);
464
+ if (!G || t(this, O).pathname !== c.pathname) {
465
+ t(this, b).forEach((n) => {
466
+ n.checkCurrent(t(this, m).path);
405
467
  });
406
468
  return;
407
469
  }
408
- const Nt = {
470
+ const zt = {
409
471
  url: c,
410
472
  submorph: f
411
473
  };
412
- f ? f.forEach((r) => {
413
- document.querySelectorAll(r).forEach((L) => {
414
- L.classList.add("out"), L.setAttribute("data-morph-out", "");
474
+ f ? S || f.forEach((n) => {
475
+ document.querySelectorAll(n).forEach((y) => {
476
+ y.classList.add("out"), y.setAttribute("data-morph-out", "");
415
477
  });
416
- }) : e(this, Z).forEach((r) => {
417
- var L, A;
418
- (L = r.firstElementChild) == null || L.classList.add("out"), (A = r.firstElementChild) == null || A.setAttribute("data-morph-out", "");
419
- }), R(document, "morphNavigation", {
420
- detail: Nt
478
+ }) : t(this, tt).forEach((n) => {
479
+ var y, k;
480
+ (y = n.firstElementChild) == null || y.classList.add("out"), (k = n.firstElementChild) == null || k.setAttribute("data-morph-out", "");
481
+ }), T(document, "morphNavigation", {
482
+ detail: zt
421
483
  });
422
- const gt = E(this, u, ft).call(this, e(this, m).pathname), p = E(this, u, ft).call(this, c.pathname);
423
- if (e(this, x).forEach((r) => {
424
- r.pathname !== c.pathname && r.abort();
425
- }), yield p == null ? void 0 : p.fetch(lt, e(this, m).path, y), e(this, z).pathname !== c.pathname) {
426
- e(this, g).forEach((r) => {
427
- r.checkCurrent(e(this, m).path);
484
+ const yt = p(this, d, St).call(this, t(this, m).pathname), v = p(this, d, St).call(this, c.pathname);
485
+ if (t(this, N).forEach((n) => {
486
+ n.pathname !== c.pathname && n.abort();
487
+ }), yield v == null ? void 0 : v.fetch(dt, t(this, m).path, E), t(this, O).pathname !== c.pathname) {
488
+ t(this, b).forEach((n) => {
489
+ n.checkCurrent(t(this, m).path);
428
490
  });
429
491
  return;
430
492
  }
431
- gt.clearState(), gt.saveScrollState(), gt.saveDocumentState(), e(this, O) || (p.clearScrollState(), p.clearDocumentState()), H && p.clearState(), p.cloneDocument(), e(this, K).textContent = p.title, document.body.appendChild(e(this, K));
432
- const ct = vt(mt({}, Nt), {
433
- document: p.document
493
+ yt.clearState(), yt.saveScrollState(), yt.saveDocumentState(), (!t(this, B) || E) && (v.clearScrollState(), v.clearDocumentState()), Lt && v.clearState(), v.cloneDocument(), t(this, $).textContent = v.title, document.body.appendChild(t(this, $));
494
+ const mt = kt(gt({}, zt), {
495
+ document: v.document
434
496
  });
435
- ct.document.querySelectorAll("[data-morph-out]").forEach((r) => {
436
- r.classList.remove("out");
437
- }), R(document, "morphStart", {
438
- detail: ct
497
+ S || mt.document.querySelectorAll("[data-morph-out]").forEach((n) => {
498
+ n.classList.remove("out");
499
+ }), T(document, "morphStart", {
500
+ detail: mt
439
501
  });
440
- const Ut = Array.from(document.head.children), Dt = Array.from(p.document.head.children), It = E(this, u, Kt).call(this, Ut, Dt), Gt = E(this, u, kt).call(this, Ut, It), ut = E(this, u, kt).call(this, Dt, It).filter((r) => !this.excludeHeadChild(r));
441
- ut.forEach((r, L) => {
442
- r.tagName === "SCRIPT" && (ut[L] = E(this, u, At).call(this, r));
443
- }), ut.forEach((r) => {
444
- document.head.appendChild(r);
502
+ const Vt = Array.from(document.head.children), Ot = Array.from(v.document.head.children), Ft = p(this, d, Zt).call(this, Vt, Ot), _t = p(this, d, Tt).call(this, Vt, Ft), ft = p(this, d, Tt).call(this, Ot, Ft).filter((n) => !this.excludeHeadChild(n));
503
+ ft.forEach((n, y) => {
504
+ n.tagName === "SCRIPT" && (ft[y] = p(this, d, Rt).call(this, n));
505
+ }), ft.forEach((n) => {
506
+ document.head.appendChild(n);
445
507
  });
446
- const St = ut.filter((r) => {
447
- if (r.hasAttribute("data-no-waiting"))
508
+ const wt = ft.filter((n) => {
509
+ if (n.hasAttribute("data-no-waiting"))
448
510
  return !1;
449
- if (E(this, u, Ct).call(this, r))
511
+ if (p(this, d, xt).call(this, n))
450
512
  return !0;
451
513
  });
452
- e(this, C).waitForHeadToLoad && St.length && (yield new Promise((r) => B(this, null, function* () {
453
- let L = 0;
514
+ t(this, M).waitForHeadToLoad && wt.length && (yield new Promise((n) => W(this, null, function* () {
515
+ let y = 0;
454
516
  try {
455
- for (var A = Bt(St), Qt, F, N; Qt = !(F = yield A.next()).done; Qt = !1) {
456
- const dt = F.value;
457
- dt.onload = () => {
458
- L++, L === St.length && r();
517
+ for (var k = Kt(wt), ee, I, H; ee = !(I = yield k.next()).done; ee = !1) {
518
+ const pt = I.value;
519
+ pt.onload = () => {
520
+ y++, y === wt.length && n();
459
521
  };
460
522
  }
461
- } catch (F) {
462
- N = [F];
523
+ } catch (I) {
524
+ H = [I];
463
525
  } finally {
464
526
  try {
465
- Qt && (F = A.return) && (yield F.call(A));
527
+ ee && (I = k.return) && (yield I.call(k));
466
528
  } finally {
467
- if (N)
468
- throw N[0];
529
+ if (H)
530
+ throw H[0];
469
531
  }
470
532
  }
471
- }))), yield ne(10);
472
- const qt = [];
473
- Gt.forEach((r) => {
474
- r.hasAttribute("data-permanent") || (E(this, u, Ct).call(this, r) ? qt.push(r) : r.remove());
533
+ }))), yield he(10);
534
+ const Bt = [];
535
+ S || _t.forEach((n) => {
536
+ n.hasAttribute("data-permanent") || (p(this, d, xt).call(this, n) ? Bt.push(n) : n.remove());
475
537
  });
476
- const Jt = E(this, u, Pt).call(this, p.document.body);
477
- !e(this, C).morphInsideScrollContainer && !f && E(this, u, Ht).call(this, p.document), document.documentElement.setAttribute(
538
+ const te = p(this, d, Mt).call(this, v.document.body);
539
+ !t(this, M).morphInsideScrollContainer && !f && p(this, d, Nt).call(this, v.document), document.documentElement.setAttribute(
478
540
  "data-current-pathname",
479
541
  c.pathname
480
542
  ), document.documentElement.setAttribute(
481
543
  "data-current-leaf",
482
544
  c.leaf
483
- ), yt({
484
- action: s,
545
+ ), Ct({
546
+ action: i,
485
547
  pathname: c.pathname,
486
- searchParameters: c.parameters || (b ? location.search : ""),
548
+ searchParameters: c.parameters || (w ? location.search : ""),
487
549
  hash: c.hash
488
- }), e(this, K).remove(), n(this, j, e(this, m)), n(this, m, c);
489
- const Lt = [];
490
- e(this, Z).forEach((r, L) => {
491
- const A = Jt[L], Qt = getComputedStyle(r).getPropertyValue("--morph-duration");
492
- let F = [], N = [];
493
- f ? (f.forEach((d) => {
494
- const v = r.querySelector(d), U = A.querySelector(d);
495
- v && U && (N.push(v), F.push(U));
496
- }), N.forEach((d) => {
497
- d.parentElement && Lt.push(d.parentElement);
498
- })) : (F.push(...A.childNodes), N.push(...r.childNodes), Lt.push(r)), N.forEach((d) => {
499
- d instanceof HTMLElement && (this.destroyOldLinks(d), d.classList.add("old"));
500
- }), F.forEach((d) => {
501
- d instanceof HTMLElement && (this.findNewLinks(d), d.classList.add("new"));
502
- }), f ? F.forEach((d, v) => {
503
- var U;
504
- (U = N[v].parentElement) == null || U.insertBefore(
505
- d,
506
- N[v]
550
+ }), t(this, $).remove(), r(this, K, t(this, m)), r(this, m, c);
551
+ const At = [];
552
+ t(this, tt).forEach((n, y) => {
553
+ const k = te[y], ee = getComputedStyle(n).getPropertyValue("--morph-duration");
554
+ let I = [], H = [];
555
+ f ? (f.forEach((u) => {
556
+ const L = n.querySelector(u), D = k.querySelector(u);
557
+ L && D && (H.push(L), I.push(D));
558
+ }), H.forEach((u) => {
559
+ u.parentElement && At.push(u.parentElement);
560
+ })) : (I.push(...k.childNodes), H.push(...n.childNodes), At.push(n)), S || H.forEach((u) => {
561
+ u instanceof HTMLElement && (this.destroyOldLinks(u), u.classList.add("old"));
562
+ }), I.forEach((u) => {
563
+ u instanceof HTMLElement && (this.findNewLinks(u), u.classList.add("new"));
564
+ }), f ? S ? I.forEach((u, L) => {
565
+ H[L] instanceof HTMLElement && H[L].append(...u.childNodes);
566
+ }) : I.forEach((u, L) => {
567
+ var D;
568
+ (D = H[L].parentElement) == null || D.insertBefore(
569
+ u,
570
+ H[L]
507
571
  );
508
- }) : r.prepend(...F), re(() => {
509
- N.forEach((d) => {
510
- d instanceof HTMLElement && d.classList.add("old-idle");
511
- }), F.forEach((d) => {
512
- var v;
513
- d instanceof HTMLElement && ((v = d.parentElement) == null || v.style.setProperty(
572
+ }) : n.prepend(...I), le(() => {
573
+ S || H.forEach((u) => {
574
+ u instanceof HTMLElement && u.classList.add("old-idle");
575
+ }), I.forEach((u) => {
576
+ var L;
577
+ u instanceof HTMLElement && ((L = u.parentElement) == null || L.style.setProperty(
514
578
  "--new-content-height",
515
- d.offsetHeight + "px"
516
- ), d.classList.add("new-idle"));
579
+ u.offsetHeight + "px"
580
+ ), u.classList.add("new-idle"));
517
581
  });
518
582
  });
519
- const dt = vt(mt({}, ct), {
520
- morphElement: r
583
+ const pt = kt(gt({}, mt), {
584
+ morphElement: n
521
585
  });
522
- R(document, "morphNewChildrenAdded", {
523
- detail: dt
586
+ T(document, "morphNewChildrenAdded", {
587
+ detail: pt
524
588
  });
525
- const Zt = new Promise((d) => {
589
+ const ie = new Promise((u) => {
526
590
  setTimeout(() => {
527
- N.forEach((v) => v.remove()), F.forEach((v) => {
528
- var U;
529
- v instanceof HTMLElement && ((U = v.parentElement) == null || U.style.removeProperty(
591
+ S || H.forEach((L) => L.remove()), I.forEach((L) => {
592
+ var D;
593
+ L instanceof HTMLElement && ((D = L.parentElement) == null || D.style.removeProperty(
530
594
  "--new-content-height"
531
- ), v.classList.remove("new-idle", "new"));
532
- }), R(document, "morphOldChildrenRemoved", {
533
- detail: dt
534
- }), d();
535
- }, (parseFloat(Qt) || 0) * 1e3 + 10);
595
+ ), L.classList.remove("new-idle", "new"));
596
+ }), S || T(document, "morphOldChildrenRemoved", {
597
+ detail: pt
598
+ }), u();
599
+ }, (parseFloat(ee) || 0) * 1e3 + 10);
536
600
  });
537
- e(this, V).push(Zt);
601
+ t(this, F).push(ie);
538
602
  }), this.isPopstateNavigation ? document.documentElement.style.setProperty(
539
603
  "--new-document-scroll-position",
540
- (this.scrollValue.top - p.scrollState.y) * 1 + "px"
604
+ (this.scrollValue.top - v.scrollState.y) * 1 + "px"
541
605
  ) : document.documentElement.style.setProperty(
542
606
  "--new-document-scroll-position",
543
607
  this.scrollValue.top + "px"
544
- ), R(document, "morphBeforeNavigationScroll", {
545
- detail: p.scrollState
546
- }), c.hash ? (p.clearScrollState(), E(this, u, Rt).call(this, c.hash, {
547
- centerScroll: i,
608
+ ), T(document, "morphBeforeNavigationScroll", {
609
+ detail: v.scrollState
610
+ }), c.hash ? (v.clearScrollState(), p(this, d, Ut).call(this, c.hash, {
611
+ centerScroll: s,
548
612
  offsetScroll: h,
549
- behavior: S
550
- })) : e(this, O) ? p.restoreScrollPosition() : Et || p.renewScrollPosition(), yield Promise.all(e(this, V)), qt.forEach((r) => r.remove()), n(this, V, []), Lt.forEach((r) => {
551
- r.querySelectorAll("script").forEach((A) => {
552
- A.replaceWith(E(this, u, At).call(this, A));
613
+ behavior: g
614
+ })) : t(this, B) ? v.restoreScrollPosition() : bt || v.renewScrollPosition(), yield Promise.all(t(this, F)), S || Bt.forEach((n) => n.remove()), r(this, F, []), At.forEach((n) => {
615
+ n.querySelectorAll("script").forEach((k) => {
616
+ k.replaceWith(p(this, d, Rt).call(this, k));
553
617
  });
554
- }), e(this, g).forEach((r) => {
555
- r.checkCurrent(e(this, m).path);
556
- }), R(document, "morphComplete", {
557
- detail: ct
618
+ }), t(this, b).forEach((n) => {
619
+ n.checkCurrent(t(this, m).path);
620
+ }), T(document, "morphComplete", {
621
+ detail: mt
558
622
  }), document.documentElement.style.removeProperty(
559
623
  "--new-document-scroll-position"
560
624
  ), window.dispatchEvent(new Event("resize"));
561
- } catch ($) {
562
- console.error($);
625
+ } catch (G) {
626
+ console.error(G);
563
627
  }
564
- n(this, z, void 0);
628
+ r(this, O, void 0);
565
629
  });
566
630
  }
567
- addLink(t) {
568
- e(this, g).push(new bt(t, this));
631
+ addLink(e) {
632
+ t(this, b).push(new Ht(e, this));
569
633
  }
570
- addLinks(t) {
571
- t.forEach((s) => {
572
- this.addLink(s);
634
+ addLinks(e) {
635
+ e.forEach((i) => {
636
+ this.addLink(i);
573
637
  });
574
638
  }
575
- removeLink(t) {
576
- n(this, g, e(this, g).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
639
+ removeLink(e) {
640
+ r(this, b, t(this, b).filter((i) => i.element === e ? (i.destroy(), !1) : !0));
577
641
  }
578
- destroyOldLinks(t) {
579
- n(this, g, e(this, g).filter((s) => t.contains(s.element) ? (s.destroy(), !1) : !0));
642
+ destroyOldLinks(e) {
643
+ r(this, b, t(this, b).filter((i) => e.contains(i.element) ? (i.destroy(), !1) : !0));
580
644
  }
581
- findNewLinks(t) {
582
- const s = [...t.querySelectorAll("a")].filter(
583
- e(this, ot)
645
+ findNewLinks(e) {
646
+ const i = [...e.querySelectorAll("a")].filter(
647
+ t(this, ct)
584
648
  );
585
- e(this, g).push(
586
- ...s.map((i) => new bt(i, this))
649
+ t(this, b).push(
650
+ ...i.map((s) => new Ht(s, this))
587
651
  );
588
652
  }
589
653
  findLinks() {
590
- const t = [
654
+ const e = [
591
655
  ...document.documentElement.querySelectorAll("a")
592
- ].filter(e(this, ot));
593
- e(this, g).forEach((s) => s.destroy()), n(this, g, t.map((s) => new bt(s, this)));
656
+ ].filter(t(this, ct));
657
+ t(this, b).forEach((i) => i.destroy()), r(this, b, e.map((i) => new Ht(i, this)));
594
658
  }
595
659
  };
596
- C = new WeakMap(), Z = new WeakMap(), g = new WeakMap(), z = new WeakMap(), m = new WeakMap(), j = new WeakMap(), V = new WeakMap(), O = new WeakMap(), P = new WeakMap(), nt = new WeakMap(), x = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), tt = new WeakMap(), at = new WeakMap(), u = new WeakSet(), At = function(t) {
597
- const s = document.createElement("script");
598
- for (let i = 0; i < t.attributes.length; i++) {
599
- const h = t.attributes[i];
600
- s.setAttribute(h.name, h.value);
601
- }
602
- return t.hasAttribute("src") || (s.innerHTML = t.innerHTML), s;
603
- }, ot = new WeakMap(), ft = function(t) {
604
- const s = this.normalizePath(t);
605
- let i = e(this, x).get(s.pathname);
606
- return i || (i = new Wt(this, s.pathname), e(this, x).set(s.pathname, i)), i;
607
- }, Pt = function(t) {
608
- const s = [...t.querySelectorAll("[data-morph]")];
609
- return s.length ? s : [t];
610
- }, Kt = function(t, s) {
611
- return t.filter(
612
- (i) => s.find(
613
- (h) => h.outerHTML === i.outerHTML
660
+ M = new WeakMap(), tt = new WeakMap(), b = new WeakMap(), O = new WeakMap(), m = new WeakMap(), K = new WeakMap(), F = new WeakMap(), B = new WeakMap(), C = new WeakMap(), lt = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), et = new WeakMap(), it = new WeakMap(), ht = new WeakMap(), st = new WeakMap(), d = new WeakSet(), Rt = function(e) {
661
+ const i = document.createElement("script");
662
+ for (let s = 0; s < e.attributes.length; s++) {
663
+ const h = e.attributes[s];
664
+ i.setAttribute(h.name, h.value);
665
+ }
666
+ return e.hasAttribute("src") || (i.innerHTML = e.innerHTML), i;
667
+ }, ct = new WeakMap(), St = function(e) {
668
+ const i = this.normalizePath(e);
669
+ let s = t(this, N).get(i.pathname);
670
+ return s || (s = new $t(this, i.pathname), t(this, N).set(i.pathname, s)), s;
671
+ }, Mt = function(e) {
672
+ const i = [...e.querySelectorAll("[data-morph]")];
673
+ return i.length ? i : [e];
674
+ }, Zt = function(e, i) {
675
+ return e.filter(
676
+ (s) => i.find(
677
+ (h) => h.outerHTML === s.outerHTML
614
678
  )
615
679
  );
616
- }, kt = function(t, s) {
617
- return t.filter(
618
- (i) => !s.find(
619
- (h) => h.outerHTML === i.outerHTML
680
+ }, Tt = function(e, i) {
681
+ return e.filter(
682
+ (s) => !i.find(
683
+ (h) => h.outerHTML === s.outerHTML
620
684
  )
621
685
  );
622
- }, Ct = function(t) {
623
- return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
624
- }, Ht = function(t) {
625
- var s, i;
626
- (s = e(this, P)) == null || s.removeEventListener(
686
+ }, xt = function(e) {
687
+ return e.tagName === "SCRIPT" || e.tagName === "STYLE" || e.tagName === "LINK" && e.getAttribute("rel") === "stylesheet";
688
+ }, Nt = function(e) {
689
+ var i, s;
690
+ (i = t(this, C)) == null || i.removeEventListener(
627
691
  "scroll",
628
- e(this, et)
629
- ), n(this, tt, 0), n(this, _, 0), n(this, P, e(this, C).scrollSelector && t.querySelector(e(this, C).scrollSelector) || window), n(this, nt, e(this, P) === window), (i = e(this, P)) == null || i.addEventListener("scroll", e(this, et)), e(this, et).call(this);
630
- }, Rt = function(t, s) {
631
- const i = typeof t == "string" ? document.getElementById(t) : t;
632
- (typeof i == "number" || i) && ae(i, {
633
- scrollElement: e(this, P),
634
- behavior: (s == null ? void 0 : s.behavior) || "instant",
635
- center: s == null ? void 0 : s.centerScroll,
636
- offset: s == null ? void 0 : s.offsetScroll
692
+ t(this, at)
693
+ ), r(this, it, 0), r(this, et, 0), r(this, C, t(this, M).scrollSelector && e.querySelector(t(this, M).scrollSelector) || window), r(this, lt, t(this, C) === window), (s = t(this, C)) == null || s.addEventListener("scroll", t(this, at)), t(this, at).call(this);
694
+ }, Ut = function(e, i) {
695
+ const s = typeof e == "string" ? document.getElementById(e) : e;
696
+ (typeof s == "number" || s) && ce(s, {
697
+ scrollElement: t(this, C),
698
+ behavior: (i == null ? void 0 : i.behavior) || "instant",
699
+ center: i == null ? void 0 : i.centerScroll,
700
+ offset: i == null ? void 0 : i.offsetScroll
637
701
  });
638
- }, pt = new WeakMap(), et = new WeakMap(), st.instance = null;
639
- let Xt = st;
702
+ }, vt = new WeakMap(), at = new WeakMap(), nt.instance = null;
703
+ let Gt = nt;
640
704
  export {
641
- Xt as Morph
705
+ Gt as Morph
642
706
  };