@textadventures/squiffy-packager 7.0.0-beta.6 → 7.0.0-beta.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/dist/packager.js CHANGED
@@ -1,4 +1,4 @@
1
- var P = Uint8Array, q = Uint16Array, ge = Int32Array, me = new P([
1
+ var E = Uint8Array, R = Uint16Array, ye = Int32Array, ve = new E([
2
2
  0,
3
3
  0,
4
4
  0,
@@ -31,7 +31,7 @@ var P = Uint8Array, q = Uint16Array, ge = Int32Array, me = new P([
31
31
  0,
32
32
  0,
33
33
  0
34
- ]), ye = new P([
34
+ ]), be = new E([
35
35
  0,
36
36
  0,
37
37
  0,
@@ -64,7 +64,7 @@ var P = Uint8Array, q = Uint16Array, ge = Int32Array, me = new P([
64
64
  13,
65
65
  0,
66
66
  0
67
- ]), we = new P([
67
+ ]), Se = new E([
68
68
  16,
69
69
  17,
70
70
  18,
@@ -84,45 +84,45 @@ var P = Uint8Array, q = Uint16Array, ge = Int32Array, me = new P([
84
84
  14,
85
85
  1,
86
86
  15
87
- ]), Le = function(s, e) {
88
- for (var t = new q(31), n = 0; n < 31; ++n) t[n] = e += 1 << s[n - 1];
89
- for (var r = new ge(t[30]), n = 1; n < 30; ++n) for (var i = t[n]; i < t[n + 1]; ++i) r[i] = i - t[n] << 5 | n;
87
+ ]), Re = function(s, e) {
88
+ for (var t = new R(31), n = 0; n < 31; ++n) t[n] = e += 1 << s[n - 1];
89
+ for (var r = new ye(t[30]), n = 1; n < 30; ++n) for (var i = t[n]; i < t[n + 1]; ++i) r[i] = i - t[n] << 5 | n;
90
90
  return {
91
91
  b: t,
92
92
  r
93
93
  };
94
- }, Re = Le(me, 2), He = Re.b, ce = Re.r;
95
- He[28] = 258, ce[258] = 28;
96
- var qe = Le(ye, 0), Dt = qe.b, xe = qe.r, ue = new q(32768);
97
- for (var _ = 0; _ < 32768; ++_) {
98
- var j = (_ & 43690) >> 1 | (_ & 21845) << 1;
99
- j = (j & 52428) >> 2 | (j & 13107) << 2, j = (j & 61680) >> 4 | (j & 3855) << 4, ue[_] = ((j & 65280) >> 8 | (j & 255) << 8) >> 1;
94
+ }, qe = Re(ve, 2), ze = qe.b, he = qe.r;
95
+ ze[28] = 258, he[258] = 28;
96
+ var Ie = Re(be, 0), jt = Ie.b, Te = Ie.r, pe = new R(32768);
97
+ for (var x = 0; x < 32768; ++x) {
98
+ var j = (x & 43690) >> 1 | (x & 21845) << 1;
99
+ j = (j & 52428) >> 2 | (j & 13107) << 2, j = (j & 61680) >> 4 | (j & 3855) << 4, pe[x] = ((j & 65280) >> 8 | (j & 255) << 8) >> 1;
100
100
  }
101
101
  var K = (function(s, e, t) {
102
- for (var n = s.length, r = 0, i = new q(e); r < n; ++r) s[r] && ++i[s[r] - 1];
103
- var l = new q(e);
104
- for (r = 1; r < e; ++r) l[r] = l[r - 1] + i[r - 1] << 1;
102
+ for (var n = s.length, r = 0, i = new R(e); r < n; ++r) s[r] && ++i[s[r] - 1];
103
+ var a = new R(e);
104
+ for (r = 1; r < e; ++r) a[r] = a[r - 1] + i[r - 1] << 1;
105
105
  var c;
106
106
  if (t) {
107
- c = new q(1 << e);
107
+ c = new R(1 << e);
108
108
  var p = 15 - e;
109
109
  for (r = 0; r < n; ++r) if (s[r])
110
- for (var u = r << 4 | s[r], o = e - s[r], a = l[s[r] - 1]++ << o, f = a | (1 << o) - 1; a <= f; ++a) c[ue[a] >> p] = u;
110
+ for (var u = r << 4 | s[r], o = e - s[r], l = a[s[r] - 1]++ << o, d = l | (1 << o) - 1; l <= d; ++l) c[pe[l] >> p] = u;
111
111
  } else
112
- for (c = new q(n), r = 0; r < n; ++r) s[r] && (c[r] = ue[l[s[r] - 1]++] >> 15 - s[r]);
112
+ for (c = new R(n), r = 0; r < n; ++r) s[r] && (c[r] = pe[a[s[r] - 1]++] >> 15 - s[r]);
113
113
  return c;
114
- }), V = new P(288);
115
- for (var _ = 0; _ < 144; ++_) V[_] = 8;
116
- for (var _ = 144; _ < 256; ++_) V[_] = 9;
117
- for (var _ = 256; _ < 280; ++_) V[_] = 7;
118
- for (var _ = 280; _ < 288; ++_) V[_] = 8;
119
- var ee = new P(32);
120
- for (var _ = 0; _ < 32; ++_) ee[_] = 5;
121
- var Fe = /* @__PURE__ */ K(V, 9, 0), ze = /* @__PURE__ */ K(ee, 5, 0), Oe = function(s) {
114
+ }), U = new E(288);
115
+ for (var x = 0; x < 144; ++x) U[x] = 8;
116
+ for (var x = 144; x < 256; ++x) U[x] = 9;
117
+ for (var x = 256; x < 280; ++x) U[x] = 7;
118
+ for (var x = 280; x < 288; ++x) U[x] = 8;
119
+ var ee = new E(32);
120
+ for (var x = 0; x < 32; ++x) ee[x] = 5;
121
+ var je = /* @__PURE__ */ K(U, 9, 0), Ue = /* @__PURE__ */ K(ee, 5, 0), Me = function(s) {
122
122
  return (s + 7) / 8 | 0;
123
- }, Ie = function(s, e, t) {
124
- return (e == null || e < 0) && (e = 0), (t == null || t > s.length) && (t = s.length), new P(s.subarray(e, t));
125
- }, je = [
123
+ }, Ne = function(s, e, t) {
124
+ return (e == null || e < 0) && (e = 0), (t == null || t > s.length) && (t = s.length), new E(s.subarray(e, t));
125
+ }, Ve = [
126
126
  "unexpected EOF",
127
127
  "invalid block type",
128
128
  "invalid length/literal",
@@ -138,7 +138,7 @@ var Fe = /* @__PURE__ */ K(V, 9, 0), ze = /* @__PURE__ */ K(ee, 5, 0), Oe = func
138
138
  "stream finishing",
139
139
  "invalid zip data"
140
140
  ], te = function(s, e, t) {
141
- var n = new Error(e || je[s]);
141
+ var n = new Error(e || Ve[s]);
142
142
  if (n.code = s, Error.captureStackTrace && Error.captureStackTrace(n, te), !t) throw n;
143
143
  return n;
144
144
  }, F = function(s, e, t) {
@@ -156,77 +156,77 @@ var Fe = /* @__PURE__ */ K(V, 9, 0), ze = /* @__PURE__ */ K(ee, 5, 0), Oe = func
156
156
  });
157
157
  var r = t.length, i = t.slice();
158
158
  if (!r) return {
159
- t: Me,
159
+ t: De,
160
160
  l: 0
161
161
  };
162
162
  if (r == 1) {
163
- var l = new P(t[0].s + 1);
164
- return l[t[0].s] = 1, {
165
- t: l,
163
+ var a = new E(t[0].s + 1);
164
+ return a[t[0].s] = 1, {
165
+ t: a,
166
166
  l: 1
167
167
  };
168
168
  }
169
- t.sort(function(x, $) {
170
- return x.f - $.f;
169
+ t.sort(function(h, _) {
170
+ return h.f - _.f;
171
171
  }), t.push({
172
172
  s: -1,
173
173
  f: 25001
174
174
  });
175
- var c = t[0], p = t[1], u = 0, o = 1, a = 2;
175
+ var c = t[0], p = t[1], u = 0, o = 1, l = 2;
176
176
  for (t[0] = {
177
177
  s: -1,
178
178
  f: c.f + p.f,
179
179
  l: c,
180
180
  r: p
181
181
  }; o != r - 1; )
182
- c = t[t[u].f < t[a].f ? u++ : a++], p = t[u != o && t[u].f < t[a].f ? u++ : a++], t[o++] = {
182
+ c = t[t[u].f < t[l].f ? u++ : l++], p = t[u != o && t[u].f < t[l].f ? u++ : l++], t[o++] = {
183
183
  s: -1,
184
184
  f: c.f + p.f,
185
185
  l: c,
186
186
  r: p
187
187
  };
188
- for (var f = i[0].s, n = 1; n < r; ++n) i[n].s > f && (f = i[n].s);
189
- var d = new q(f + 1), k = he(t[o - 1], d, 0);
190
- if (k > e) {
191
- var n = 0, b = 0, w = k - e, g = 1 << w;
192
- for (i.sort(function($, S) {
193
- return d[S.s] - d[$.s] || $.f - S.f;
188
+ for (var d = i[0].s, n = 1; n < r; ++n) i[n].s > d && (d = i[n].s);
189
+ var m = new R(d + 1), w = de(t[o - 1], m, 0);
190
+ if (w > e) {
191
+ var n = 0, k = 0, S = w - e, P = 1 << S;
192
+ for (i.sort(function(_, b) {
193
+ return m[b.s] - m[_.s] || _.f - b.f;
194
194
  }); n < r; ++n) {
195
- var A = i[n].s;
196
- if (d[A] > e)
197
- b += g - (1 << k - d[A]), d[A] = e;
195
+ var f = i[n].s;
196
+ if (m[f] > e)
197
+ k += P - (1 << w - m[f]), m[f] = e;
198
198
  else break;
199
199
  }
200
- for (b >>= w; b > 0; ) {
201
- var y = i[n].s;
202
- d[y] < e ? b -= 1 << e - d[y]++ - 1 : ++n;
200
+ for (k >>= S; k > 0; ) {
201
+ var $ = i[n].s;
202
+ m[$] < e ? k -= 1 << e - m[$]++ - 1 : ++n;
203
203
  }
204
- for (; n >= 0 && b; --n) {
205
- var h = i[n].s;
206
- d[h] == e && (--d[h], ++b);
204
+ for (; n >= 0 && k; --n) {
205
+ var g = i[n].s;
206
+ m[g] == e && (--m[g], ++k);
207
207
  }
208
- k = e;
208
+ w = e;
209
209
  }
210
210
  return {
211
- t: new P(d),
212
- l: k
211
+ t: new E(m),
212
+ l: w
213
213
  };
214
- }, he = function(s, e, t) {
215
- return s.s == -1 ? Math.max(he(s.l, e, t + 1), he(s.r, e, t + 1)) : e[s.s] = t;
216
- }, Se = function(s) {
214
+ }, de = function(s, e, t) {
215
+ return s.s == -1 ? Math.max(de(s.l, e, t + 1), de(s.r, e, t + 1)) : e[s.s] = t;
216
+ }, Ae = function(s) {
217
217
  for (var e = s.length; e && !s[--e]; ) ;
218
- for (var t = new q(++e), n = 0, r = s[0], i = 1, l = function(p) {
218
+ for (var t = new R(++e), n = 0, r = s[0], i = 1, a = function(p) {
219
219
  t[n++] = p;
220
220
  }, c = 1; c <= e; ++c) if (s[c] == r && c != e) ++i;
221
221
  else {
222
222
  if (!r && i > 2) {
223
- for (; i > 138; i -= 138) l(32754);
224
- i > 2 && (l(i > 10 ? i - 11 << 5 | 28690 : i - 3 << 5 | 12305), i = 0);
223
+ for (; i > 138; i -= 138) a(32754);
224
+ i > 2 && (a(i > 10 ? i - 11 << 5 | 28690 : i - 3 << 5 | 12305), i = 0);
225
225
  } else if (i > 3) {
226
- for (l(r), --i; i > 6; i -= 6) l(8304);
227
- i > 2 && (l(i - 3 << 5 | 8208), i = 0);
226
+ for (a(r), --i; i > 6; i -= 6) a(8304);
227
+ i > 2 && (a(i - 3 << 5 | 8208), i = 0);
228
228
  }
229
- for (; i--; ) l(r);
229
+ for (; i--; ) a(r);
230
230
  i = 1, r = s[c];
231
231
  }
232
232
  return {
@@ -236,42 +236,42 @@ var Fe = /* @__PURE__ */ K(V, 9, 0), ze = /* @__PURE__ */ K(ee, 5, 0), Oe = func
236
236
  }, J = function(s, e) {
237
237
  for (var t = 0, n = 0; n < e.length; ++n) t += s[n] * e[n];
238
238
  return t;
239
- }, Ne = function(s, e, t) {
240
- var n = t.length, r = Oe(e + 2);
239
+ }, Be = function(s, e, t) {
240
+ var n = t.length, r = Me(e + 2);
241
241
  s[r] = n & 255, s[r + 1] = n >> 8, s[r + 2] = s[r] ^ 255, s[r + 3] = s[r + 1] ^ 255;
242
242
  for (var i = 0; i < n; ++i) s[r + i + 4] = t[i];
243
243
  return (r + 4 + n) * 8;
244
- }, Te = function(s, e, t, n, r, i, l, c, p, u, o) {
244
+ }, Ce = function(s, e, t, n, r, i, a, c, p, u, o) {
245
245
  F(e, o++, t), ++r[256];
246
- for (var a = oe(r, 15), f = a.t, d = a.l, k = oe(i, 15), b = k.t, w = k.l, g = Se(f), A = g.c, y = g.n, h = Se(b), x = h.c, $ = h.n, S = new q(19), v = 0; v < A.length; ++v) ++S[A[v] & 31];
247
- for (var v = 0; v < x.length; ++v) ++S[x[v] & 31];
248
- for (var m = oe(S, 7), L = m.t, U = m.l, R = 19; R > 4 && !L[we[R - 1]]; --R) ;
249
- var W = u + 5 << 3, O = J(r, V) + J(i, ee) + l, I = J(r, f) + J(i, b) + l + 14 + 3 * R + J(S, L) + 2 * S[16] + 3 * S[17] + 7 * S[18];
250
- if (p >= 0 && W <= O && W <= I) return Ne(e, o, s.subarray(p, p + u));
251
- var B, T, N, z;
252
- if (F(e, o, 1 + (I < O)), o += 2, I < O) {
253
- B = K(f, d, 0), T = f, N = K(b, w, 0), z = b;
254
- var se = K(L, U, 0);
255
- F(e, o, y - 257), F(e, o + 5, $ - 1), F(e, o + 10, R - 4), o += 14;
256
- for (var v = 0; v < R; ++v) F(e, o + 3 * v, L[we[v]]);
257
- o += 3 * R;
258
- for (var D = [A, x], G = 0; G < 2; ++G)
259
- for (var Y = D[G], v = 0; v < Y.length; ++v) {
260
- var H = Y[v] & 31;
261
- F(e, o, se[H]), o += L[H], H > 15 && (F(e, o, Y[v] >> 5 & 127), o += Y[v] >> 12);
246
+ for (var l = oe(r, 15), d = l.t, m = l.l, w = oe(i, 15), k = w.t, S = w.l, P = Ae(d), f = P.c, $ = P.n, g = Ae(k), h = g.c, _ = g.n, b = new R(19), v = 0; v < f.length; ++v) ++b[f[v] & 31];
247
+ for (var v = 0; v < h.length; ++v) ++b[h[v] & 31];
248
+ for (var y = oe(b, 7), L = y.t, V = y.l, O = 19; O > 4 && !L[Se[O - 1]]; --O) ;
249
+ var W = u + 5 << 3, q = J(r, U) + J(i, ee) + a, I = J(r, d) + J(i, k) + a + 14 + 3 * O + J(b, L) + 2 * b[16] + 3 * b[17] + 7 * b[18];
250
+ if (p >= 0 && W <= q && W <= I) return Be(e, o, s.subarray(p, p + u));
251
+ var B, T, M, z;
252
+ if (F(e, o, 1 + (I < q)), o += 2, I < q) {
253
+ B = K(d, m, 0), T = d, M = K(k, S, 0), z = k;
254
+ var se = K(L, V, 0);
255
+ F(e, o, $ - 257), F(e, o + 5, _ - 1), F(e, o + 10, O - 4), o += 14;
256
+ for (var v = 0; v < O; ++v) F(e, o + 3 * v, L[Se[v]]);
257
+ o += 3 * O;
258
+ for (var D = [f, h], X = 0; X < 2; ++X)
259
+ for (var G = D[X], v = 0; v < G.length; ++v) {
260
+ var H = G[v] & 31;
261
+ F(e, o, se[H]), o += L[H], H > 15 && (F(e, o, G[v] >> 5 & 127), o += G[v] >> 12);
262
262
  }
263
- } else B = Fe, T = V, N = ze, z = ee;
263
+ } else B = je, T = U, M = Ue, z = ee;
264
264
  for (var v = 0; v < c; ++v) {
265
- var E = n[v];
266
- if (E > 255) {
267
- var H = E >> 18 & 31;
268
- Z(e, o, B[H + 257]), o += T[H + 257], H > 7 && (F(e, o, E >> 23 & 31), o += me[H]);
269
- var X = E & 31;
270
- Z(e, o, N[X]), o += z[X], X > 3 && (Z(e, o, E >> 5 & 8191), o += ye[X]);
271
- } else Z(e, o, B[E]), o += T[E];
265
+ var C = n[v];
266
+ if (C > 255) {
267
+ var H = C >> 18 & 31;
268
+ Z(e, o, B[H + 257]), o += T[H + 257], H > 7 && (F(e, o, C >> 23 & 31), o += ve[H]);
269
+ var Y = C & 31;
270
+ Z(e, o, M[Y]), o += z[Y], Y > 3 && (Z(e, o, C >> 5 & 8191), o += be[Y]);
271
+ } else Z(e, o, B[C]), o += T[C];
272
272
  }
273
273
  return Z(e, o, B[256]), o + T[256];
274
- }, Ve = /* @__PURE__ */ new ge([
274
+ }, We = /* @__PURE__ */ new ye([
275
275
  65540,
276
276
  131080,
277
277
  131088,
@@ -281,170 +281,172 @@ var Fe = /* @__PURE__ */ K(V, 9, 0), ze = /* @__PURE__ */ K(ee, 5, 0), Oe = func
281
281
  1048832,
282
282
  2114560,
283
283
  2117632
284
- ]), Me = /* @__PURE__ */ new P(0), Ue = function(s, e, t, n, r, i) {
285
- var l = i.z || s.length, c = new P(n + l + 5 * (1 + Math.ceil(l / 7e3)) + r), p = c.subarray(n, c.length - r), u = i.l, o = (i.r || 0) & 7;
284
+ ]), De = /* @__PURE__ */ new E(0), Ge = function(s, e, t, n, r, i) {
285
+ var a = i.z || s.length, c = new E(n + a + 5 * (1 + Math.ceil(a / 7e3)) + r), p = c.subarray(n, c.length - r), u = i.l, o = (i.r || 0) & 7;
286
286
  if (e) {
287
287
  o && (p[0] = i.r >> 3);
288
- for (var a = Ve[e - 1], f = a >> 13, d = a & 8191, k = (1 << t) - 1, b = i.p || new q(32768), w = i.h || new q(k + 1), g = Math.ceil(t / 3), A = 2 * g, y = function(ie) {
289
- return (s[ie] ^ s[ie + 1] << g ^ s[ie + 2] << A) & k;
290
- }, h = new ge(25e3), x = new q(288), $ = new q(32), S = 0, v = 0, m = i.i || 0, L = 0, U = i.w || 0, R = 0; m + 2 < l; ++m) {
291
- var W = y(m), O = m & 32767, I = w[W];
292
- if (b[O] = I, w[W] = O, U <= m) {
293
- var B = l - m;
294
- if ((S > 7e3 || L > 24576) && (B > 423 || !u)) {
295
- o = Te(s, p, 0, h, x, $, v, L, R, m - R, o), L = S = v = 0, R = m;
296
- for (var T = 0; T < 286; ++T) x[T] = 0;
297
- for (var T = 0; T < 30; ++T) $[T] = 0;
288
+ for (var l = We[e - 1], d = l >> 13, m = l & 8191, w = (1 << t) - 1, k = i.p || new R(32768), S = i.h || new R(w + 1), P = Math.ceil(t / 3), f = 2 * P, $ = function(ie) {
289
+ return (s[ie] ^ s[ie + 1] << P ^ s[ie + 2] << f) & w;
290
+ }, g = new ye(25e3), h = new R(288), _ = new R(32), b = 0, v = 0, y = i.i || 0, L = 0, V = i.w || 0, O = 0; y + 2 < a; ++y) {
291
+ var W = $(y), q = y & 32767, I = S[W];
292
+ if (k[q] = I, S[W] = q, V <= y) {
293
+ var B = a - y;
294
+ if ((b > 7e3 || L > 24576) && (B > 423 || !u)) {
295
+ o = Ce(s, p, 0, g, h, _, v, L, O, y - O, o), L = b = v = 0, O = y;
296
+ for (var T = 0; T < 286; ++T) h[T] = 0;
297
+ for (var T = 0; T < 30; ++T) _[T] = 0;
298
298
  }
299
- var N = 2, z = 0, se = d, D = O - I & 32767;
300
- if (B > 2 && W == y(m - D))
301
- for (var G = Math.min(f, B) - 1, Y = Math.min(32767, m), H = Math.min(258, B); D <= Y && --se && O != I; ) {
302
- if (s[m + N] == s[m + N - D]) {
303
- for (var E = 0; E < H && s[m + E] == s[m + E - D]; ++E) ;
304
- if (E > N) {
305
- if (N = E, z = D, E > G) break;
306
- for (var X = Math.min(D, E - 2), ve = 0, T = 0; T < X; ++T) {
307
- var ne = m - D + T & 32767, be = ne - b[ne] & 32767;
308
- be > ve && (ve = be, I = ne);
299
+ var M = 2, z = 0, se = m, D = q - I & 32767;
300
+ if (B > 2 && W == $(y - D))
301
+ for (var X = Math.min(d, B) - 1, G = Math.min(32767, y), H = Math.min(258, B); D <= G && --se && q != I; ) {
302
+ if (s[y + M] == s[y + M - D]) {
303
+ for (var C = 0; C < H && s[y + C] == s[y + C - D]; ++C) ;
304
+ if (C > M) {
305
+ if (M = C, z = D, C > X) break;
306
+ for (var Y = Math.min(D, C - 2), ke = 0, T = 0; T < Y; ++T) {
307
+ var ne = y - D + T & 32767, we = ne - k[ne] & 32767;
308
+ we > ke && (ke = we, I = ne);
309
309
  }
310
310
  }
311
311
  }
312
- O = I, I = b[O], D += O - I & 32767;
312
+ q = I, I = k[q], D += q - I & 32767;
313
313
  }
314
314
  if (z) {
315
- h[L++] = 268435456 | ce[N] << 18 | xe[z];
316
- var ke = ce[N] & 31, _e = xe[z] & 31;
317
- v += me[ke] + ye[_e], ++x[257 + ke], ++$[_e], U = m + N, ++S;
315
+ g[L++] = 268435456 | he[M] << 18 | Te[z];
316
+ var xe = he[M] & 31, _e = Te[z] & 31;
317
+ v += ve[xe] + be[_e], ++h[257 + xe], ++_[_e], V = y + M, ++b;
318
318
  } else
319
- h[L++] = s[m], ++x[s[m]];
319
+ g[L++] = s[y], ++h[s[y]];
320
320
  }
321
321
  }
322
- for (m = Math.max(m, U); m < l; ++m)
323
- h[L++] = s[m], ++x[s[m]];
324
- o = Te(s, p, u, h, x, $, v, L, R, m - R, o), u || (i.r = o & 7 | p[o / 8 | 0] << 3, o -= 7, i.h = w, i.p = b, i.i = m, i.w = U);
322
+ for (y = Math.max(y, V); y < a; ++y)
323
+ g[L++] = s[y], ++h[s[y]];
324
+ o = Ce(s, p, u, g, h, _, v, L, O, y - O, o), u || (i.r = o & 7 | p[o / 8 | 0] << 3, o -= 7, i.h = S, i.p = k, i.i = y, i.w = V);
325
325
  } else {
326
- for (var m = i.w || 0; m < l + u; m += 65535) {
327
- var re = m + 65535;
328
- re >= l && (p[o / 8 | 0] = u, re = l), o = Ne(p, o + 1, s.subarray(m, re));
326
+ for (var y = i.w || 0; y < a + u; y += 65535) {
327
+ var re = y + 65535;
328
+ re >= a && (p[o / 8 | 0] = u, re = a), o = Be(p, o + 1, s.subarray(y, re));
329
329
  }
330
- i.i = l;
330
+ i.i = a;
331
331
  }
332
- return Ie(c, 0, n + Oe(o) + r);
333
- }, We = /* @__PURE__ */ (function() {
332
+ return Ne(c, 0, n + Me(o) + r);
333
+ }, Ye = /* @__PURE__ */ (function() {
334
334
  for (var s = /* @__PURE__ */ new Int32Array(256), e = 0; e < 256; ++e) {
335
335
  for (var t = e, n = 9; --n; ) t = (t & 1 && -306674912) ^ t >>> 1;
336
336
  s[e] = t;
337
337
  }
338
338
  return s;
339
- })(), Ye = function() {
339
+ })(), Xe = function() {
340
340
  var s = -1;
341
341
  return {
342
342
  p: function(e) {
343
- for (var t = s, n = 0; n < e.length; ++n) t = We[t & 255 ^ e[n]] ^ t >>> 8;
343
+ for (var t = s, n = 0; n < e.length; ++n) t = Ye[t & 255 ^ e[n]] ^ t >>> 8;
344
344
  s = t;
345
345
  },
346
346
  d: function() {
347
347
  return ~s;
348
348
  }
349
349
  };
350
- }, Xe = function(s, e, t, n, r) {
350
+ }, Ze = function(s, e, t, n, r) {
351
351
  if (!r && (r = { l: 1 }, e.dictionary)) {
352
- var i = e.dictionary.subarray(-32768), l = new P(i.length + s.length);
353
- l.set(i), l.set(s, i.length), s = l, r.w = i.length;
352
+ var i = e.dictionary.subarray(-32768), a = new E(i.length + s.length);
353
+ a.set(i), a.set(s, i.length), s = a, r.w = i.length;
354
354
  }
355
- return Ue(s, e.level == null ? 6 : e.level, e.mem == null ? r.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(s.length))) * 1.5) : 20 : 12 + e.mem, t, n, r);
356
- }, Be = function(s, e) {
355
+ return Ge(s, e.level == null ? 6 : e.level, e.mem == null ? r.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(s.length))) * 1.5) : 20 : 12 + e.mem, t, n, r);
356
+ }, He = function(s, e) {
357
357
  var t = {};
358
358
  for (var n in s) t[n] = s[n];
359
359
  for (var n in e) t[n] = e[n];
360
360
  return t;
361
- }, C = function(s, e, t) {
361
+ }, A = function(s, e, t) {
362
362
  for (; t; ++e) s[e] = t, t >>>= 8;
363
363
  };
364
- function Ge(s, e) {
365
- return Xe(s, e || {}, 0, 0);
364
+ function Je(s, e) {
365
+ return Ze(s, e || {}, 0, 0);
366
366
  }
367
- var De = function(s, e, t, n) {
367
+ var Fe = function(s, e, t, n) {
368
368
  for (var r in s) {
369
- var i = s[r], l = e + r, c = n;
370
- Array.isArray(i) && (c = Be(n, i[1]), i = i[0]), ArrayBuffer.isView(i) ? t[l] = [i, c] : (t[l += "/"] = [new P(0), c], De(i, l, t, n));
369
+ var i = s[r], a = e + r, c = n;
370
+ Array.isArray(i) && (c = He(n, i[1]), i = i[0]), ArrayBuffer.isView(i) ? t[a] = [i, c] : (t[a += "/"] = [new E(0), c], Fe(i, a, t, n));
371
371
  }
372
- }, Ce = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), Ze = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Je = 0;
372
+ }, Ee = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), Ke = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Qe = 0;
373
373
  try {
374
- Ze.decode(Me, { stream: !0 }), Je = 1;
374
+ Ke.decode(De, { stream: !0 }), Qe = 1;
375
375
  } catch {
376
376
  }
377
- function pe(s, e) {
377
+ function fe(s, e) {
378
378
  if (e) {
379
- for (var t = new P(s.length), n = 0; n < s.length; ++n) t[n] = s.charCodeAt(n);
379
+ for (var t = new E(s.length), n = 0; n < s.length; ++n) t[n] = s.charCodeAt(n);
380
380
  return t;
381
381
  }
382
- if (Ce) return Ce.encode(s);
383
- for (var r = s.length, i = new P(s.length + (s.length >> 1)), l = 0, c = function(o) {
384
- i[l++] = o;
382
+ if (Ee) return Ee.encode(s);
383
+ for (var r = s.length, i = new E(s.length + (s.length >> 1)), a = 0, c = function(o) {
384
+ i[a++] = o;
385
385
  }, n = 0; n < r; ++n) {
386
- if (l + 5 > i.length) {
387
- var p = new P(l + 8 + (r - n << 1));
386
+ if (a + 5 > i.length) {
387
+ var p = new E(a + 8 + (r - n << 1));
388
388
  p.set(i), i = p;
389
389
  }
390
390
  var u = s.charCodeAt(n);
391
391
  u < 128 || e ? c(u) : u < 2048 ? (c(192 | u >> 6), c(128 | u & 63)) : u > 55295 && u < 57344 ? (u = 65536 + (u & 1047552) | s.charCodeAt(++n) & 1023, c(240 | u >> 18), c(128 | u >> 12 & 63), c(128 | u >> 6 & 63), c(128 | u & 63)) : (c(224 | u >> 12), c(128 | u >> 6 & 63), c(128 | u & 63));
392
392
  }
393
- return Ie(i, 0, l);
393
+ return Ne(i, 0, a);
394
394
  }
395
- var de = function(s) {
395
+ var ge = function(s) {
396
396
  var e = 0;
397
397
  if (s) for (var t in s) {
398
398
  var n = s[t].length;
399
399
  n > 65535 && te(9), e += n + 4;
400
400
  }
401
401
  return e;
402
- }, Ae = function(s, e, t, n, r, i, l, c) {
403
- var p = n.length, u = t.extra, o = c && c.length, a = de(u);
404
- C(s, e, l != null ? 33639248 : 67324752), e += 4, l != null && (s[e++] = 20, s[e++] = t.os), s[e] = 20, e += 2, s[e++] = t.flag << 1 | (i < 0 && 8), s[e++] = r && 8, s[e++] = t.compression & 255, s[e++] = t.compression >> 8;
405
- var f = new Date(t.mtime == null ? Date.now() : t.mtime), d = f.getFullYear() - 1980;
406
- if ((d < 0 || d > 119) && te(10), C(s, e, d << 25 | f.getMonth() + 1 << 21 | f.getDate() << 16 | f.getHours() << 11 | f.getMinutes() << 5 | f.getSeconds() >> 1), e += 4, i != -1 && (C(s, e, t.crc), C(s, e + 4, i < 0 ? -i - 2 : i), C(s, e + 8, t.size)), C(s, e + 12, p), C(s, e + 14, a), e += 16, l != null && (C(s, e, o), C(s, e + 6, t.attrs), C(s, e + 10, l), e += 14), s.set(n, e), e += p, a) for (var k in u) {
407
- var b = u[k], w = b.length;
408
- C(s, e, +k), C(s, e + 2, w), s.set(b, e + 4), e += 4 + w;
402
+ }, Pe = function(s, e, t, n, r, i, a, c) {
403
+ var p = n.length, u = t.extra, o = c && c.length, l = ge(u);
404
+ A(s, e, a != null ? 33639248 : 67324752), e += 4, a != null && (s[e++] = 20, s[e++] = t.os), s[e] = 20, e += 2, s[e++] = t.flag << 1 | (i < 0 && 8), s[e++] = r && 8, s[e++] = t.compression & 255, s[e++] = t.compression >> 8;
405
+ var d = new Date(t.mtime == null ? Date.now() : t.mtime), m = d.getFullYear() - 1980;
406
+ if ((m < 0 || m > 119) && te(10), A(s, e, m << 25 | d.getMonth() + 1 << 21 | d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 | d.getSeconds() >> 1), e += 4, i != -1 && (A(s, e, t.crc), A(s, e + 4, i < 0 ? -i - 2 : i), A(s, e + 8, t.size)), A(s, e + 12, p), A(s, e + 14, l), e += 16, a != null && (A(s, e, o), A(s, e + 6, t.attrs), A(s, e + 10, a), e += 14), s.set(n, e), e += p, l) for (var w in u) {
407
+ var k = u[w], S = k.length;
408
+ A(s, e, +w), A(s, e + 2, S), s.set(k, e + 4), e += 4 + S;
409
409
  }
410
410
  return o && (s.set(c, e), e += o), e;
411
- }, Ke = function(s, e, t, n, r) {
412
- C(s, e, 101010256), C(s, e + 8, t), C(s, e + 10, t), C(s, e + 12, n), C(s, e + 16, r);
411
+ }, et = function(s, e, t, n, r) {
412
+ A(s, e, 101010256), A(s, e + 8, t), A(s, e + 10, t), A(s, e + 12, n), A(s, e + 16, r);
413
413
  };
414
- function Qe(s, e) {
414
+ function tt(s, e) {
415
415
  e || (e = {});
416
416
  var t = {}, n = [];
417
- De(s, "", t, e);
417
+ Fe(s, "", t, e);
418
418
  var r = 0, i = 0;
419
- for (var l in t) {
420
- var c = t[l], p = c[0], u = c[1], o = u.level == 0 ? 0 : 8, a = pe(l), f = a.length, d = u.comment, k = d && pe(d), b = k && k.length, w = de(u.extra);
421
- f > 65535 && te(11);
422
- var g = o ? Ge(p, u) : p, A = g.length, y = Ye();
423
- y.p(p), n.push(Be(u, {
419
+ for (var a in t) {
420
+ var c = t[a], p = c[0], u = c[1], o = u.level == 0 ? 0 : 8, l = fe(a), d = l.length, m = u.comment, w = m && fe(m), k = w && w.length, S = ge(u.extra);
421
+ d > 65535 && te(11);
422
+ var P = o ? Je(p, u) : p, f = P.length, $ = Xe();
423
+ $.p(p), n.push(He(u, {
424
424
  size: p.length,
425
- crc: y.d(),
426
- c: g,
427
- f: a,
428
- m: k,
429
- u: f != l.length || k && d.length != b,
425
+ crc: $.d(),
426
+ c: P,
427
+ f: l,
428
+ m: w,
429
+ u: d != a.length || w && m.length != k,
430
430
  o: r,
431
431
  compression: o
432
- })), r += 30 + f + w + A, i += 76 + 2 * (f + w) + (b || 0) + A;
432
+ })), r += 30 + d + S + f, i += 76 + 2 * (d + S) + (k || 0) + f;
433
433
  }
434
- for (var h = new P(i + 22), x = r, $ = i - r, S = 0; S < n.length; ++S) {
435
- var a = n[S];
436
- Ae(h, a.o, a, a.f, a.u, a.c.length);
437
- var v = 30 + a.f.length + de(a.extra);
438
- h.set(a.c, a.o + v), Ae(h, r, a, a.f, a.u, a.c.length, a.o, a.m), r += 16 + v + (a.m ? a.m.length : 0);
434
+ for (var g = new E(i + 22), h = r, _ = i - r, b = 0; b < n.length; ++b) {
435
+ var l = n[b];
436
+ Pe(g, l.o, l, l.f, l.u, l.c.length);
437
+ var v = 30 + l.f.length + ge(l.extra);
438
+ g.set(l.c, l.o + v), Pe(g, r, l, l.f, l.u, l.c.length, l.o, l.m), r += 16 + v + (l.m ? l.m.length : 0);
439
439
  }
440
- return Ke(h, r, n.length, $, x), h;
440
+ return et(g, r, n.length, _, h), g;
441
441
  }
442
- var fe = "[^()]", ae = (s) => `\\((?:${fe}|${s})*\\)`, Ht = `(?:${fe}|${ae(ae(ae(fe)))})*?`, et = {
442
+ var me = "[^()]", ae = (s) => `\\((?:${me}|${s})*\\)`, Ut = `(?:${me}|${ae(ae(ae(me)))})*?`, st = {
443
443
  back: "Back",
444
444
  restart: "Restart",
445
445
  restartConfirm: "Are you sure you want to restart?",
446
446
  switchToDark: "Switch to dark mode",
447
447
  switchToLight: "Switch to light mode",
448
+ mute: "Mute",
449
+ unmute: "Unmute",
448
450
  saves: "Saved games",
449
451
  saveName: "Name (optional)",
450
452
  save: "Save",
@@ -468,27 +470,27 @@ var fe = "[^()]", ae = (s) => `\\((?:${fe}|${s})*\\)`, Ht = `(?:${fe}|${ae(ae(ae
468
470
  wrongStory: "This saved game is for a different story.",
469
471
  notASave: "This file isn't a saved game.",
470
472
  cantSave: "The game couldn't be saved. Try Save to file instead."
471
- }, tt = "squiffy-compiler", st = "7.0.0-beta.6", nt = "A tool for creating multiple-choice interactive stories", rt = "Alex Warren", it = [
473
+ }, nt = "squiffy-compiler", rt = "7.0.0-beta.7", it = "A tool for creating multiple-choice interactive stories", ot = "Alex Warren", at = [
472
474
  "CrisisSDK",
473
475
  "mrangel",
474
476
  "Luis Felipe Morales"
475
- ], ot = {
477
+ ], lt = {
476
478
  type: "git",
477
479
  url: "git+https://github.com/textadventures/squiffy.git",
478
480
  directory: "compiler"
479
481
  };
480
- var at = {
482
+ var ct = {
481
483
  "@types/node": "^26.6.6",
482
484
  glob: "^14.0.6",
483
485
  shiki: "^4.6.0",
484
486
  typescript: "^6.0.3",
485
487
  vitest: "^5.1.0"
486
- }, lt = {
488
+ }, ut = {
487
489
  dev: "vitest",
488
490
  test: "vitest --run",
489
491
  build: "tsc",
490
492
  prepublishOnly: "npm run build && npm run test"
491
- }, ct = "dist/compiler.js", ut = "dist/compiler.d.ts", ht = {
493
+ }, ht = "dist/compiler.js", pt = "dist/compiler.d.ts", dt = {
492
494
  ".": {
493
495
  types: "./dist/compiler.d.ts",
494
496
  default: "./dist/compiler.js"
@@ -503,25 +505,25 @@ var at = {
503
505
  },
504
506
  "./squiffy.tmLanguage.json": "./syntaxes/squiffy.tmLanguage.json",
505
507
  "./package.json": "./package.json"
506
- }, pt = ["dist", "syntaxes/squiffy.tmLanguage.json"], dt = "module", ft = {
507
- name: tt,
508
- version: st,
509
- description: nt,
510
- author: rt,
511
- contributors: it,
512
- repository: ot,
508
+ }, ft = ["dist", "syntaxes/squiffy.tmLanguage.json"], gt = "module", mt = {
509
+ name: nt,
510
+ version: rt,
511
+ description: it,
512
+ author: ot,
513
+ contributors: at,
514
+ repository: lt,
513
515
  license: "MIT",
514
516
  preferGlobal: !0,
515
- devDependencies: at,
516
- scripts: lt,
517
- main: ct,
518
- types: ut,
519
- exports: ht,
520
- files: pt,
521
- type: dt
522
- }, Ft = ft.version, M = class extends Error {
517
+ devDependencies: ct,
518
+ scripts: ut,
519
+ main: ht,
520
+ types: pt,
521
+ exports: dt,
522
+ files: ft,
523
+ type: gt
524
+ }, Vt = mt.version, N = class extends Error {
523
525
  };
524
- function gt(s) {
526
+ function yt(s) {
525
527
  const e = [];
526
528
  let t = 0;
527
529
  for (; t < s.length; ) {
@@ -599,7 +601,7 @@ var le = /* @__PURE__ */ new Set([
599
601
  "switch",
600
602
  "case",
601
603
  "default"
602
- ]), mt = class Q {
604
+ ]), vt = class Q {
603
605
  constructor(e, t) {
604
606
  Object.defineProperty(this, "source", {
605
607
  enumerable: !0,
@@ -621,7 +623,7 @@ var le = /* @__PURE__ */ new Set([
621
623
  configurable: !0,
622
624
  writable: !0,
623
625
  value: 0
624
- }), this.tokens = gt(e);
626
+ }), this.tokens = yt(e);
625
627
  }
626
628
  static parse(e, t) {
627
629
  return new Q(e, t).statements(!1);
@@ -635,7 +637,7 @@ var le = /* @__PURE__ */ new Set([
635
637
  }
636
638
  expect(e) {
637
639
  const t = this.peek();
638
- if (!t || t.type == "str" || t.text != e) throw new M(`expected "${e}"`);
640
+ if (!t || t.type == "str" || t.text != e) throw new N(`expected "${e}"`);
639
641
  return this.pos++, t;
640
642
  }
641
643
  skipNewlines() {
@@ -645,7 +647,7 @@ var le = /* @__PURE__ */ new Set([
645
647
  const t = [];
646
648
  for (; ; ) {
647
649
  if (this.skipNewlines(), !this.peek()) {
648
- if (e) throw new M("a block with no }");
650
+ if (e) throw new N("a block with no }");
649
651
  return t;
650
652
  }
651
653
  if (e && this.is("}")) return t;
@@ -663,7 +665,7 @@ var le = /* @__PURE__ */ new Set([
663
665
  const t = this.statementOrThrow();
664
666
  return this.endOfStatement(), t;
665
667
  } catch (t) {
666
- if (!(t instanceof M)) throw t;
668
+ if (!(t instanceof N)) throw t;
667
669
  return this.pos = e, this.skipRawStatement(), {
668
670
  k: "raw",
669
671
  src: this.sourceFrom(e)
@@ -672,7 +674,7 @@ var le = /* @__PURE__ */ new Set([
672
674
  }
673
675
  endOfStatement() {
674
676
  const e = this.peek();
675
- if (e && e.type != "nl" && !this.is("}")) throw new M("more after the end of a statement");
677
+ if (e && e.type != "nl" && !this.is("}")) throw new N("more after the end of a statement");
676
678
  }
677
679
  skipRawStatement() {
678
680
  let e = 0;
@@ -697,69 +699,69 @@ var le = /* @__PURE__ */ new Set([
697
699
  }
698
700
  statementOrThrow() {
699
701
  const e = this.pos, t = this.peek(), n = () => this.sourceFrom(e);
700
- if (t.type != "word") throw new M("a statement that doesn't start with a name");
702
+ if (t.type != "word") throw new N("a statement that doesn't start with a name");
701
703
  if (t.text == "if") {
702
- const a = [];
703
- let f;
704
- for (this.pos++, a.push({
704
+ const l = [];
705
+ let d;
706
+ for (this.pos++, l.push({
705
707
  cond: this.condition(),
706
708
  body: this.block()
707
709
  }); ; ) {
708
- let d = 0;
709
- for (; this.peek(d)?.type == "nl"; ) d++;
710
- if (!this.is("else", d)) break;
711
- if (this.pos += d + 1, this.is("if"))
712
- this.pos++, a.push({
710
+ let m = 0;
711
+ for (; this.peek(m)?.type == "nl"; ) m++;
712
+ if (!this.is("else", m)) break;
713
+ if (this.pos += m + 1, this.is("if"))
714
+ this.pos++, l.push({
713
715
  cond: this.condition(),
714
716
  body: this.block()
715
717
  });
716
718
  else {
717
- f = this.block();
719
+ d = this.block();
718
720
  break;
719
721
  }
720
722
  }
721
723
  return {
722
724
  k: "if",
723
- branches: a,
724
- otherwise: f,
725
+ branches: l,
726
+ otherwise: d,
725
727
  src: n()
726
728
  };
727
729
  }
728
730
  if (t.text == "firsttime") {
729
731
  this.pos++;
730
- const a = this.block();
731
- let f = 0;
732
- for (; this.peek(f)?.type == "nl"; ) f++;
733
- let d;
734
- return this.is("otherwise", f) && (this.pos += f + 1, d = this.block()), {
732
+ const l = this.block();
733
+ let d = 0;
734
+ for (; this.peek(d)?.type == "nl"; ) d++;
735
+ let m;
736
+ return this.is("otherwise", d) && (this.pos += d + 1, m = this.block()), {
735
737
  k: "firsttime",
736
- body: a,
737
- otherwise: d,
738
+ body: l,
739
+ otherwise: m,
738
740
  src: n()
739
741
  };
740
742
  }
741
743
  if (t.text == "switch") {
742
744
  this.pos++;
743
- const a = this.condition();
745
+ const l = this.condition();
744
746
  this.skipNewlines(), this.expect("{");
745
- const f = [];
746
- let d;
747
+ const d = [];
748
+ let m;
747
749
  for (; this.skipNewlines(), !this.is("}"); )
748
750
  if (this.is("case")) {
749
751
  this.pos++, this.expect("(");
750
- const k = this.expressionList(")");
751
- this.expect(")"), f.push({
752
- values: k,
752
+ const w = this.expressionList(")");
753
+ this.expect(")"), d.push({
754
+ values: w,
753
755
  body: this.block()
754
756
  });
755
757
  } else if (this.is("default"))
756
- this.pos++, d = this.block();
757
- else throw new M("expected case or default");
758
+ this.pos++, m = this.block();
759
+ else throw new N("expected case or default");
758
760
  return this.expect("}"), {
759
761
  k: "switch",
760
- value: a,
761
- cases: f,
762
- otherwise: d,
762
+ value: l,
763
+ cases: d,
764
+ otherwise: m,
763
765
  src: n()
764
766
  };
765
767
  }
@@ -780,28 +782,28 @@ var le = /* @__PURE__ */ new Set([
780
782
  };
781
783
  if (i) {
782
784
  this.pos += 2;
783
- const a = this.is("(") ? this.arguments() : [];
785
+ const l = this.is("(") ? this.arguments() : [];
784
786
  return {
785
787
  k: "call",
786
788
  fn: `${t.text} ${r.text}`,
787
- args: a,
789
+ args: l,
788
790
  src: n()
789
791
  };
790
792
  }
791
- const l = this.pos;
793
+ const a = this.pos;
792
794
  if (!le.has(t.text)) try {
793
- const a = this.path();
795
+ const l = this.path();
794
796
  if (this.is("="))
795
797
  return this.pos++, {
796
798
  k: "assign",
797
- target: a,
799
+ target: l,
798
800
  value: this.expression(),
799
801
  src: n()
800
802
  };
801
- } catch (a) {
802
- if (!(a instanceof M)) throw a;
803
+ } catch (l) {
804
+ if (!(l instanceof N)) throw l;
803
805
  }
804
- this.pos = l;
806
+ this.pos = a;
805
807
  let c = t.text;
806
808
  for (this.pos++; this.is(".") && this.peek(1)?.type == "word"; )
807
809
  c += "." + this.peek(1).text, this.pos += 2;
@@ -862,7 +864,7 @@ var le = /* @__PURE__ */ new Set([
862
864
  }
863
865
  primary() {
864
866
  const e = this.peek();
865
- if (!e) throw new M("an expression that ends too soon");
867
+ if (!e) throw new N("an expression that ends too soon");
866
868
  if (e.type == "str")
867
869
  return this.pos++, {
868
870
  k: "str",
@@ -897,7 +899,7 @@ var le = /* @__PURE__ */ new Set([
897
899
  }
898
900
  return this.path();
899
901
  }
900
- throw new M(`unexpected "${e.text}"`);
902
+ throw new N(`unexpected "${e.text}"`);
901
903
  }
902
904
  objectName() {
903
905
  let e = 0, t = "";
@@ -913,12 +915,12 @@ var le = /* @__PURE__ */ new Set([
913
915
  const e = [];
914
916
  for (; ; ) {
915
917
  const t = this.peek();
916
- if (!t || t.type != "word" && t.type != "num" || le.has(t.text)) throw new M("expected a name");
918
+ if (!t || t.type != "word" && t.type != "num" || le.has(t.text)) throw new N("expected a name");
917
919
  const n = this.objectName();
918
920
  if (n > 1)
919
921
  e.push(this.tokens.slice(this.pos, this.pos + n).map((r) => r.text).join(" ")), this.pos += n;
920
922
  else {
921
- if (t.type == "num" && e.length == 0 && n == 0) throw new M("expected a name");
923
+ if (t.type == "num" && e.length == 0 && n == 0) throw new N("expected a name");
922
924
  e.push(t.text), this.pos++;
923
925
  }
924
926
  if (!this.is(".")) return {
@@ -929,7 +931,7 @@ var le = /* @__PURE__ */ new Set([
929
931
  }
930
932
  }
931
933
  };
932
- Object.defineProperty(mt, "levels", {
934
+ Object.defineProperty(vt, "levels", {
933
935
  enumerable: !0,
934
936
  configurable: !0,
935
937
  writable: !0,
@@ -954,7 +956,37 @@ Object.defineProperty(mt, "levels", {
954
956
  ]
955
957
  ]
956
958
  });
957
- var Ee = 'var squiffyRuntime=(function(_t){Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"});var xa=Object.create,Qs=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ca=Object.getOwnPropertyNames,Pa=Object.getPrototypeOf,Qi=Object.prototype.hasOwnProperty,he=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),ds=(e,t)=>{let s={};for(var r in e)Qs(s,r,{get:e[r],enumerable:!0});return t||Qs(s,Symbol.toStringTag,{value:"Module"}),s},Ea=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Ca(t),n=0,o=i.length,c;n<o;n++)c=i[n],!Qi.call(e,c)&&c!==s&&Qs(e,c,{get:(f=>t[f]).bind(null,c),enumerable:!(r=Ta(t,c))||r.enumerable});return e},Aa=(e,t,s)=>(s=e!=null?xa(Pa(e)):{},Ea(t||!e||!e.__esModule||!Qi.call(e,"default")?Qs(s,"default",{value:e,enumerable:!0}):s,e));function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function La(e,t){if(Ps(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(Ps(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ra(e){var t=La(e,"string");return Ps(t)=="symbol"?t:t+""}function Ie(e,t,s){return(t=Ra(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Ia(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oa(e,t){Ia(e,t),t.add(e)}function Ks(e,t,s){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:s;throw new TypeError("Private element is not present on this object")}var fs,er;function Ur(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Jt=Ur();function Ki(e){Jt=e}var Qt={exec:()=>null};function Kt(e){let t=[];return s=>{let r=Math.max(0,Math.min(3,s-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function ce(e,t=""){let s=typeof e=="string"?e:e.source,r={replace:(i,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(Ge.caret,"$1"),s=s.replace(i,o),r},getRegex:()=>new RegExp(s,t)};return r}var en=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Ge={codeRemoveIndent:/^(?: {0,3}\\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \\t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,leadingSpaceTab:/^[ \\t]+/,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+)[ \\t]*)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \\t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\][ \\t]+\\S/,listReplaceTask:/^\\[[ xX]\\][ \\t]+/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^\'"]*[^\\s])\\s+([\'"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,numericCharacterReference:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,escapeTest:/[&<>"\']/,escapeReplace:/[&<>"\']/g,escapeTestNoEncode:/[<>"\']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>"\']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:Kt(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ ][^\\\\n]*)?(?:\\\\n|$))`)),hrRegex:Kt(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\\\*[ ]*){3,})(?:\\\\n+|$)`)),fencesBeginRegex:Kt(e=>new RegExp(`^ {0,${e}}(?:\\`\\`\\`|~~~)`)),headingBeginRegex:Kt(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\\\s|$)`)),pedanticHeadingBeginRegex:Kt(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Kt(e=>new RegExp(`^ {0,${e}}(?:</?(?:${As})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`,"i")),blockquoteBeginRegex:Kt(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\\d{1,9}[.)])[ \\t]+|>[ \\t]?))+/},Ma=/^(?:[ \\t]*(?:\\n|$))+/,Na=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,Da=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}(?:(?=`)\\1`*|(?=~)\\1~*) *(?=\\n|$)|$)/,Es=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,Ba=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,Wr=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,tn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |fences|blockquote|heading|hr|html|table))+?)\\n {0,3}(=+|-+)[ \\t]*(?:\\n+|$)/,sn=ce(tn).replace(/bull/g,Wr).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,"").getRegex(),$a=ce(tn).replace(/bull/g,Wr).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),Xr=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\t]+\\n)[^\\n]+)*)/,qa=/^[^\\n]+/,Gr=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\\\n]|\\n(?![ \\t]*\\n))+/,Ha=ce(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace("label",Gr).replace("title",/(?:"(?:\\\\[\\s\\S]|[^"\\\\])*"|\'(?:\\\\[\\s\\S]|[^\'\\\\\\n]|\\n(?!\\n))*\'|\\((?:\\\\[\\s\\S]|[^()\\\\])*\\))/).getRegex(),Fa=ce(/^(bull)([ \\t][^\\n]*?)?(?:\\n|$)/).replace(/bull/g,Wr).getRegex(),As="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yr=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,Va=ce("^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n*|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>[^\\\\n]*\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>[^\\\\n]*\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>[^\\\\n]*\\\\n*|$)|</?(tag)(?:[ \\\\t]+|\\\\n|/?>|$)[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$)|</[a-z][a-z0-9-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$))","i").replace("comment",Yr).replace("tag",As).replace("attribute",/ +[a-zA-Z:_][\\w.:-]*(?: *= *"[^"\\n]*"| *= *\'[^\'\\n]*\'| *= *[^\\s"\'=<>`]+)?/).getRegex(),rn=e=>ce(Xr).replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)").replace("tag",As).getRegex(),za=rn(/ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/),Ua=rn(/ {0,3}(?:[*+-]|\\d{1,9}[.)])(?:[ \\t]|\\n|$)/),Zr={blockquote:ce(/^( {0,3}> ?(?:(?![ \\t]*(?:\\n|$))(paragraph)|[^\\n]*)(?:\\n|$))+/).replace("paragraph",Ua).getRegex(),code:Na,def:Ha,fences:Da,heading:Ba,hr:Es,html:Va,lheading:sn,list:Fa,newline:Ma,paragraph:za,table:Qt,text:qa},nn=ce("^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)").replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\\\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)").replace("tag",As).getRegex(),Wa={...Zr,lheading:$a,table:nn,paragraph:ce(Xr).replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\\\s|$)").replace("|lheading","").replace("table",nn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)").replace("tag",As).getRegex()},Xa={...Zr,html:ce(`^ *(?:comment(?: *\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1>(?: *\\\\n{2,}|\\\\s*$)|<tag(?:"[^"]*"|\'[^\']*\'|\\\\s[^\'"/>\\\\s]*)*?/?>(?: *\\\\n{2,}|\\\\s*$))`).replace("comment",Yr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b").getRegex(),def:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +(["(][^\\n]+[")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:Qt,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:ce(Xr).replace("hr",Es).replace("heading",` *#{1,6} *[^\n]`).replace("lheading",sn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ga=/^\\\\([!"#$%&\'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,Ya=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,on=/^( {2,}|\\\\)\\n(?!\\s*$)[ \\t]*/,Za=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,Lt=/[\\p{P}\\p{S}]/u,ps=/[\\s\\p{P}\\p{S}]/u,Ls=/[^\\s\\p{P}\\p{S}]/u,ja=ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ps).getRegex(),Ja=/[\\p{Pi}\\p{Ps}"\']/u,an=/(?!~)[\\p{P}\\p{S}]/u,Qa=/(?!~)[\\s\\p{P}\\p{S}]/u,Ka=/(?:[^\\s\\p{P}\\p{S}]|~)/u,el=ce(/link|precode-code|html/,"g").replace("link",/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace("precode-",en?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ln=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,tl=ce(ln,"u").replace(/punct/g,Lt).getRegex(),sl=ce(ln,"u").replace(/punct/g,an).getRegex(),rl=ce(/^(?:\\*+(?:((?!\\*)(?!openQuote)punct)|([^\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\s_]))?/,"u").replace(/openQuote/g,Ja).replace(/punct/g,Lt).getRegex(),cn="^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)",il=ce(cn,"gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,ps).replace(/punct/g,Lt).getRegex(),nl=ce(cn,"gu").replace(/notPunctSpace/g,Ka).replace(/punctSpace/g,Qa).replace(/punct/g,an).getRegex(),ol=ce("^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)[\\\\s](\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|(?:(?!\\\\*)punct|notPunctSpace)(\\\\*+)(?!\\\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,ps).replace(/punct/g,Lt).getRegex(),al=ce("^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,ps).replace(/punct/g,Lt).getRegex(),ll=ce("^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\\\s](_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,ps).replace(/punct/g,Lt).getRegex(),cl=ce(/^~~?(?:((?!~)punct)|[^\\s~])/,"u").replace(/punct/g,Lt).getRegex(),ul=ce("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,ps).replace(/punct/g,Lt).getRegex(),hl=ce(/\\\\(punct)/,"gu").replace(/punct/g,Lt).getRegex(),dl=ce(/(`+)(?:[^`]|[^`][\\s\\S]*?[^`])\\1(?!`)|`+|\\\\(punct)/,"gu").replace(/punct/g,Lt).getRegex(),fl=ce(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&\'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pl=ce(Yr).replace("(?:-->|$)","-->").getRegex(),gl=ce("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>").replace("comment",pl).replace("attribute",/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*"[^"]*"|\\s*=\\s*\'[^\']*\'|\\s*=\\s*[^\\s"\'=<>`]+)?/).getRegex(),un=/\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]/,tr=ce(/(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/).replace("brackets",un).getRegex(),ml=ce(/^!?\\[(label)\\]\\([ \\t\\n]*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?[ \\t\\n]*\\)/).replace("label",tr).replace("href",/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]+|(?=\\))/).replace("title",/"(?:\\\\[\\s\\S]|[^"\\\\])*"|\'(?:\\\\[\\s\\S]|[^\'\\\\])*\'|\\((?:\\\\[\\s\\S]|[^)\\\\])*\\)/).getRegex(),vl=ce(/^!?\\[(label)\\]\\[(ref)\\]/).replace("label",tr).replace("ref",Gr).getRegex(),yl=ce(/^!?\\[(ref)\\](?:\\[\\])?/).replace("ref",Gr).getRegex(),hn=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\]){1,999}/,bl=ce(/(?:[^\\[\\]\\\\`]*(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\]))){0,999}?[^\\[\\]\\\\`]*?/).replace("brackets",un).getRegex(),_l=ce("reflink|nolink(?!\\\\()","g").replace("reflink",ce(/^!?\\[(label)\\]\\[(ref)\\]/).replace("label",bl).replace("ref",hn).getRegex()).replace("nolink",ce(/^!?\\[(ref)\\](?:\\[\\])?/).replace("ref",hn).getRegex()).getRegex(),dn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Sl=ce(/(?:mailto:email|xmpp:email(?:\\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),jr={_backpedal:Qt,anyPunctuation:hl,anyPunctuationOutsideCode:dl,autolink:fl,blockSkip:el,br:on,code:Ya,del:Qt,delLDelim:Qt,delRDelim:Qt,emStrongLDelim:tl,emStrongRDelimAst:il,emStrongRDelimUnd:al,escape:Ga,link:ml,nolink:yl,punctuation:ja,reflink:vl,reflinkSearch:_l,tag:gl,text:Za,url:Qt},kl={...jr,emStrongLDelim:rl,emStrongRDelimAst:ol,emStrongRDelimUnd:ll,link:ce(/^!?\\[(label)\\]\\((.*?)\\)/).replace("label",tr).getRegex(),reflink:ce(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace("label",tr).getRegex()},Jr={...jr,emStrongRDelimAst:nl,emStrongLDelim:sl,delLDelim:cl,delRDelim:ul,url:ce(/^emailProtocol|^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace("emailProtocol",Sl).replace("protocol",dn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_\'"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_\'"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:ce(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&\'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|wwwStart|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&\'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&\'*+\\/=?_`{\\|}~-]+@))))/).replace("protocol",dn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",en?"(?<![^\\\\s*_~(])www\\\\.":"www\\\\.").getRegex()},wl={...Jr,br:ce(on).replace("{2,}","*").getRegex(),text:ce(Jr.text).replace("\\\\b_","\\\\b_| {2,}\\\\n").replace(/\\{2,\\}/g,"*").getRegex()},sr={normal:Zr,gfm:Wa,pedantic:Xa},Rs={normal:jr,gfm:Jr,breaks:wl,pedantic:kl},xl={"&":"&amp;","<":"&lt;",">":"&gt;",\'"\':"&quot;","\'":"&#39;"},fn=e=>xl[e];function lt(e,t){if(t){if(Ge.escapeTest.test(e))return e.replace(Ge.escapeReplace,fn)}else if(Ge.escapeTestNoEncode.test(e))return e.replace(Ge.escapeReplaceNoEncode,fn);return e}function Tl(e){return Ge.numericCharacterReference.test(e)?e.replace(Ge.numericCharacterReferenceOrAmpersand,(t,s,r)=>{if(s===void 0&&r===void 0)return"&amp;";let i=s===void 0?Number.parseInt(r,16):Number.parseInt(s,10);return i===0||i>1114111||i>=55296&&i<=57343?"�":i===38?"&amp;":String.fromCodePoint(i)}):e}function pn(e){try{e=encodeURI(e).replace(Ge.percentDecode,"%")}catch{return null}return e}function gn(e,t){let s=e.replace(Ge.findPipe,(i,n,o)=>{let c=!1,f=n;for(;--f>=0&&o[f]==="\\\\";)c=!c;return c?"|":" |"}).split(Ge.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Ge.slashPipe,"|");return s}function Nt(e,t,s){let r=e.length;if(r===0)return"";let i=0;for(;i<r;){let n=e.charAt(r-i-1);if(n===t&&!s)i++;else if(n!==t&&s)i++;else break}return e.slice(0,r-i)}function mn(e){let t=e.split(`\n`),s=t.length-1;for(;s>=0&&Ge.blankLine.test(t[s]);)s--;return t.length-s<=2?e:t.slice(0,s+1).join(`\n`)}function rr(e){return e.trim().replace(Ge.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function vn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let s=0;for(let r=0;r<e.length;r++)if(e[r]==="\\\\")r++;else if(e[r]===t[0])s++;else if(e[r]===t[1]&&(s--,s<0))return r;return s>0?-2:-1}var gs=new WeakMap;function Qr(e){let t={"*":-1,_:-1},s=-1,r=e.length;for(let i=0;i<r;i++){let n=e[i];if(n!=="*"&&n!=="_"&&n!=="~")continue;let o=i===0?`\n`:e[i-1],c=i+1;for(;c<r&&e[c]===n;)c++;o!==" "&&o!==" "&&o!==`\n`&&o!=="\\r"&&o!=="\\f"&&(n==="~"?s=i:t[n]=i),i=c-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:s}}function Cl(e,t){let s=Qr(t),r=gs.get(e);r?r.push(s):gs.set(e,[s])}function Pl(e){let t=gs.get(e);t&&(t.pop(),t.length===0&&gs.delete(e))}function El(e,t,s){let r=gs.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[s]:Qr(t).lastPossibleEmStrongCloserIndex[s]}function Al(e,t){let s=gs.get(e)?.at(-1);return s&&s.maskedSrc===t?s.lastPossibleDelCloserIndex:Qr(t).lastPossibleDelCloserIndex}function ir(e,t=0){let s=t,r="";for(let i of e)if(i===" "){let n=4-s%4;r+=" ".repeat(n),s+=n}else r+=i,s++;return r}function yn(e,t,s,r,i){let n=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1"),f=e[0].charAt(0)==="!",d=r.state.inLink,u=r.state.linkEmitted,a=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let h=r.inlineTokens(c),l=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=d,!f){if(l){r.state.inRawBlock=a;return}r.state.linkEmitted=!0}return{type:f?"image":"link",raw:s,href:n,title:o,text:c,tokens:h}}function Ll(e,t,s){let r=e.match(s.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`\n`).map(n=>{let o=n.match(s.other.beginningSpace);if(o===null)return n;let[c]=o;return n.slice(Math.min(c.length,i.length))}).join(`\n`)}function bn(e,t,s,r){if(!t.includes("<"))return!1;for(let i=0;i<t.length;i++){if(t[i]==="\\\\"){i++;continue}if(t[i]==="`"){let c=r.inline.code.exec(t.slice(i));if(c){i+=c[0].length-1;continue}}if(t[i]!=="<")continue;let n=e.slice(s+i),o=r.inline.tag.exec(n)||r.inline.autolink.exec(n);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var ms=class{constructor(e){Ie(this,"options",void 0),Ie(this,"rules",void 0),Ie(this,"lexer",void 0),this.options=e||Jt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=this.options.pedantic?t[0]:mn(t[0]);return{type:"code",raw:s,codeBlockStyle:"indented",text:s.replace(this.rules.other.codeRemoveIndent,"")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],r=Ll(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let r=Nt(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(s=r.trim())}return{type:"heading",raw:Nt(t[0],`\n`),depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Nt(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=Nt(t[0],`\n`).split(`\n`),r="",i="",n=[];for(;s.length>0;){let o=!1,c=[],f=0;for(;f<s.length;f++)if(this.rules.other.blockquoteStart.test(s[f]))c.push(s[f]),o=!0;else if(!o)c.push(s[f]);else break;s=s.slice(f);let d=c.join(`\n`),u=d.replace(this.rules.other.blockquoteMarkerWhitespace,(l,p,g)=>p+ir(g,p.length)).replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${d}`:d,i=i?`${i}\n${u}`:u;let a=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,n,!0),this.lexer.state.top=a,s.length===0)break;let h=n.at(-1);if(h?.type==="code"||h?.type==="heading"||h?.type==="hr"||h?.type==="html"||h?.type==="table")break;if(h?.type==="blockquote"){let l=h,p=s.join(`\n`),g=l.raw+`\n`+p.replace(this.rules.other.blockquoteSetextReplace2,""),v=this.blockquote(g);n[n.length-1]=v;let _=g.substring(v.raw.length).replace(/^\\n/,""),S=_?_.split(`\n`).length:0,y=S?s.slice(0,-S):s;if(y.length>0&&(r=`${r}\n${y.join(`\n`)}`),i=i.substring(0,i.length-l.text.length)+v.text,s=s.slice(y.length),s.length>0&&this.rules.other.blockquoteStart.test(s[0]))continue;break}else if(h?.type==="list"){let l=h,p=l.raw+`\n`+s.join(`\n`),g=this.list(p);n[n.length-1]=g;let v=g.raw.length>l.raw.length?p.slice(l.raw.length+1,g.raw.length).split(`\n`).length:0;if(v>0){let _=s.slice(0,v).join(`\n`);r=`${r}\n${_}`,i=`${i}\n${_}`}s=s.slice(v);continue}}return{type:"blockquote",raw:r,tokens:n,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(e))return;let s=e,r=()=>s.length-e.length,i=t[1].trim(),n=i.length>1,o={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\\\d{1,9}\\\\${i.slice(-1)}`:`\\\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let c=this.rules.other.listItemRegex(i),f=!1;for(;e;){let u=!1,a="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;let h=r();e=e.substring(t[0].length);let l=t[2].split(`\n`,1)[0],p=t[1].length,g=this.options.pedantic?ir(l,p):l.replace(this.rules.other.leadingSpaceTab,m=>ir(m,p)),v=e.split(`\n`,1)[0],_=!g.trim(),S=0;if(this.options.pedantic?(S=2,a=g.trimStart()):_?S=p+1:(S=g.search(this.rules.other.nonSpaceChar),S=S>4?1:S,a=g.slice(S),S+=p),_&&this.rules.other.blankLine.test(v)&&(e=e.substring(v.length+1),u=!0),!u){let m=this.rules.other.nextBulletRegex(S),b=this.rules.other.hrRegex(S),k=this.rules.other.fencesBeginRegex(S),w=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(S):this.rules.other.headingBeginRegex(S),A=this.rules.other.htmlBeginRegex(S),M=this.rules.other.blockquoteBeginRegex(S),L=!1;for(;e;){let R=e.split(`\n`,1)[0],E;if(v=R,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),E=v):E=v.replace(this.rules.other.leadingSpaceTab,q=>ir(q)),k.test(v)||w.test(v)||A.test(v)||M.test(v)||m.test(v)||b.test(v))break;if(E.search(this.rules.other.nonSpaceChar)>=S||!v.trim())a+=`\n`+E.slice(S),L=!1;else{if(_||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(g)||w.test(g)||A.test(g)||b.test(g))break;if(!this.options.pedantic&&!L){let z=g.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(z)||this.rules.block.heading.test(z)||this.rules.block.hr.test(z))break}let q=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(v)&&this.rules.block.lheading.test(`${g}\n${v}`)?` ${E.replace(/^ {0,3}/,"")}`:v;a+=`\n`+q,L=!0}_=!v.trim(),e=e.substring(R.length+1),g=E.slice(S)}}let y=s.slice(h,r());o.loose||(f?o.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(f=!0)),o.items.push({type:"list_item",raw:y,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let d=o.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;o.raw=s.slice(0,r()).trimEnd();for(let u of o.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!o.loose){let a=u.tokens.filter(h=>h.type==="space");o.loose=a.length>0&&a.some(h=>this.rules.other.anyLine.test(h.raw))}for(let u of o.items){let a=u.tokens[0];if(u.task&&(a?.type==="text"||a?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),a.raw=a.raw.replace(this.rules.other.listReplaceTask,""),a.text=a.text.replace(this.rules.other.listReplaceTask,"");for(let l=this.lexer.inlineQueue.length-1;l>=0;l--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[l].src)){this.lexer.inlineQueue[l].src=this.lexer.inlineQueue[l].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let l={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=l.checked,o.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=l.raw+u.tokens[0].raw,u.tokens[0].text=l.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(l)):u.tokens.unshift({type:"paragraph",raw:l.raw,text:l.raw,tokens:[l]}):u.tokens.unshift(l)}}else u.task&&(u.task=!1)}if(o.loose)for(let u of o.items){u.loose=!0;for(let a of u.tokens)a.type==="text"&&(a.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let s=mn(t[0]);return{type:"html",block:!0,raw:s,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:s}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&vn(t[2],"()")!==-1)return;let s=rr(t[1]),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:Nt(t[0],`\n`),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=gn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`\n`):[],n={type:"table",raw:Nt(t[0],`\n`),header:[],align:[],rows:[]};if(s.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<s.length;o++)n.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(gn(o,n.header.length).map((c,f)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:n.align[f]})));return n}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let s=t[1].trim();return{type:"heading",raw:Nt(t[0],`\n`),depth:t[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let s=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&bn(e,t[1],s,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let c=Nt(r.slice(0,-1),"\\\\");if((r.length-c.length)%2===0)return}else{let c=vn(t[2],"()");if(c===-2)return;if(c>-1){let f=(t[0].indexOf("!")===0?5:4)+t[1].length+c;t[2]=t[2].substring(0,c),t[0]=t[0].substring(0,f).trim(),t[3]=""}}let i=Nt(t[0].slice(0,-1),"\\\\");if((t[0].length-i.length)%2===0)return;let n=t[2],o="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(n);c&&(n=c[1],o=c[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),yn(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let r=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&bn(e,s[1],r,this.rules))return;let i=t[rr(s[2]||s[1])];if(!i){let n=s[0].charAt(0);return{type:"text",raw:n,text:n}}return yn(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],n=s===i,o=t.length-e.length,c=o;for(;!this.options.pedantic&&c>0&&t[c-1]===i;)c--;let f=[...t.slice(Math.max(0,c-2),c)].at(-1)??"",d=f==="*"||f==="_"||!!this.rules.inline.punctuation.exec(f);c<o&&(s=f);let u=c<o?d:s==="*"||s==="_"||!!this.rules.inline.punctuation.exec(s);if(r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))return;let a=r[1]||r[3]||"";if(!a||!s||u){let h=[...r[0]].length-1,l,p,g=h,v=0,_=o-c+h,S=!this.options.pedantic&&!!f.trim()&&(!!a||i==="*"&&!d);if(i!=="*"&&i!=="_")return;let y=i==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,m=El(this,t,i),b=t.length-e.length+h;if(m<b)return;t=t.slice(-1*e.length+h);let k=m-b;for(y.lastIndex=0;(r=y.exec(t))!==null&&!(r.index>k);){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(p=[...l].length,r[3]||r[4]){g+=p;continue}else if(r[5]||r[6]||S){if(n&&(r[5]||r[6]))break;if(_%3&&!((_+p)%3)){v+=p;continue}}if(g-=p,g>0)continue;p=Math.min(p,p+g+v);let w=[...r[0]][0].length,A=e.slice(0,h+r.index+w+p);if(Math.min(h,p)%2){let L=A.slice(1,-1);return{type:"em",raw:A,text:L,tokens:this.lexer.inlineTokens(L)}}let M=A.slice(2,-2);return{type:"strong",raw:A,text:M,tokens:this.lexer.inlineTokens(M)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,s=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let i=[...r[0]].length-1,n,o,c=i,f=this.rules.inline.delRDelim,d=Al(this,t),u=t.length-e.length+i;if(d<u)return;t=t.slice(-1*e.length+i);let a=d-u;for(f.lastIndex=0;(r=f.exec(t))!==null&&!(r.index>a);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let h=[...r[0]][0].length,l=e.slice(0,i+r.index+h+o),p=l.slice(i,-i);return{type:"del",raw:l,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=t[1],r="mailto:"+s):(s=t[1],r=s),{type:"link",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]==="@")s=t[0],r="mailto:"+s;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);s=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:s?t[0]:Tl(t[0]),escaped:s}}}},St=(fs=new WeakSet,class ji{constructor(t){Oa(this,fs),Ie(this,"tokens",void 0),Ie(this,"options",void 0),Ie(this,"state",void 0),Ie(this,"inlineQueue",void 0),Ie(this,"tokenizer",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jt,this.options.tokenizer=this.options.tokenizer||new ms,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:Ge,block:sr.normal,inline:Rs.normal};this.options.pedantic?(s.block=sr.pedantic,s.inline=Rs.pedantic):this.options.gfm&&(s.block=sr.gfm,this.options.breaks?s.inline=Rs.breaks:s.inline=Rs.gfm),this.tokenizer.rules=s}static get rules(){return{block:sr,inline:Rs}}static lex(t,s){return new ji(s).lex(t)}static lexInline(t,s){return new ji(s).inlineTokens(t)}lex(t){t=t.replace(Ge.carriageReturn,`\n`),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let r=this.inlineQueue[s];this.state.inRawBlock=!1,this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],r=!1){this.tokenizer.lexer=this;let i=this.state.lastToken;this.options.pedantic&&(t=t.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}this.state.lastToken=s.at(-1);let o;if(this.options.extensions?.block?.some(f=>(o=f.call({lexer:this},t,s))?(t=t.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let f=s.at(-1);o.raw.length===1&&f!==void 0?f.raw+=`\n`:s.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let f=s.at(-1);f?.type==="paragraph"||f?.type==="text"?(f.raw+=(f.raw.endsWith(`\n`)?"":`\n`)+o.raw,f.text+=`\n`+o.text,this.inlineQueue.at(-1).src=f.text):s.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let f=s.at(-1);f?.type==="paragraph"||f?.type==="text"?(f.raw+=(f.raw.endsWith(`\n`)?"":`\n`)+o.raw,f.text+=`\n`+o.raw,this.inlineQueue.at(-1).src=f.text):(this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title}),s.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),s.push(o);continue}let c=t;if(this.options.extensions?.startBlock){let f=1/0,d=t.slice(1),u;this.options.extensions.startBlock.forEach(a=>{u=a.call({lexer:this},d),typeof u=="number"&&u>=0&&(f=Math.min(f,u))}),f<1/0&&f>=0&&(c=t.substring(0,f+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){let f=s.at(-1);r&&f?.type==="paragraph"?(f.raw+=(f.raw.endsWith(`\n`)?"":`\n`)+o.raw,f.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):s.push(o),r=c.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let f=s.at(-1);f?.type==="text"?(f.raw+=(f.raw.endsWith(`\n`)?"":`\n`)+o.raw,f.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):s.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=i,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}linkInText(t){if(!t.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(r[0])&&t.charAt(r.index-1)!=="!")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],n=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,rr(i.slice(n+1,-1))))&&!(n>1&&this.linkInText(i.slice(1,n-1))))return!0}return!1}inlineTokens(t,s=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(")");try{return Ks(fs,this,Rl).call(this,t,s)}finally{this.state.linkParenPossible=r}}infiniteLoopError(t){let s="Infinite loop on byte: "+t;if(this.options.silent)console.error(s);else throw new Error(s)}});function Rl(e,t){let s=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==ms.prototype.emStrong||this.tokenizer.del!==ms.prototype.del?Ks(fs,this,Ml).call(this,e):e;Cl(this.tokenizer,s);try{return Ks(fs,this,Il).call(this,e,s,t)}finally{Pl(this.tokenizer)}}function Il(e,t,s){let r=!1,i="",n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let o;if(this.options.extensions?.inline?.some(f=>(o=f.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let f=s.at(-1);o.type==="text"&&f?.type==="text"?(f.raw+=o.raw,f.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let c=e;if(this.options.extensions?.startInline){let f=1/0,d=e.slice(1),u;this.options.extensions.startInline.forEach(a=>{u=a.call({lexer:this},d),typeof u=="number"&&u>=0&&(f=Math.min(f,u))}),f<1/0&&f>=0&&(c=e.substring(0,f+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),r=!0;let f=s.at(-1);f?.type==="text"?(f.raw+=o.raw,f.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}function Ol(e){let{blockSkip:t,tag:s,autolink:r}=this.tokenizer.rules.inline,i="",n=0,o;for(t.lastIndex=0;o=t.exec(e);){let c=o.index+(o[2]?o[2].length:0),f=o.index+o[0].length;if(e.charAt(c)==="<"){let d=e.slice(c),u=s.exec(d)||r.exec(d);if(!u){t.lastIndex=c+1;continue}f=c+u[0].length,t.lastIndex=f}i+=e.slice(n,c)+"["+"a".repeat(f-c-2)+"]",n=f}return i+e.slice(n)}function Ml(e){let t=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,r=i=>{let n=i.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,rr(i.slice(n+1,-1))))return i;if(n>1&&i.charAt(0)!=="!"){let o=i.slice(1,n-1);if(this.linkInText(o))return"["+o.replace(s,r)+"]["+"a".repeat(i.length-n-2)+"]"}return"["+"a".repeat(i.length-2)+"]"};t=t.replace(s,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,r,i)=>i?"+".repeat(s.length):r?r+s.slice(r.length,-r.length).replace(/`/g,"+")+r:s),t=Ks(fs,this,Ol).call(this,t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}var nr=class{constructor(e){Ie(this,"options",void 0),Ie(this,"parser",void 0),this.options=e||Jt}space(e){return""}code({text:e,lang:t,escaped:s}){let r=(t||"").match(Ge.notSpaceStart)?.[0],i=e?e.replace(Ge.endingNewline,"")+`\n`:"";return r?\'<pre><code class="language-\'+lt(r)+\'">\'+(s?i:lt(i,!0))+`</code></pre>\n`:"<pre><code>"+(s?i:lt(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,s=e.start,r="";for(let o=0;o<e.items.length;o++){let c=e.items[o];r+=this.listitem(c)}let i=t?"ol":"ul",n=t&&s!==1?\' start="\'+s+\'"\':"";return"<"+i+n+`>\n`+r+"</"+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?\'checked="" \':"")+\'disabled="" type="checkbox"> \'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",s="";for(let i=0;i<e.header.length;i++)s+=this.tablecell(e.header[i]);t+=this.tablerow({text:s});let r="";for(let i=0;i<e.rows.length;i++){let n=e.rows[i];s="";for(let o=0;o<n.length;o++)s+=this.tablecell(n[o]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${lt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:s,tokens:r,autolink:i}){let n=i?lt(s,!0):this.parser.parseInline(r),o=pn(e);if(o===null)return n;e=lt(o,i);let c=\'<a href="\'+e+\'"\';return t&&(c+=\' title="\'+lt(t)+\'"\'),c+=">"+n+"</a>",c}image({href:e,title:t,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let i=pn(e);if(i===null)return lt(s);e=i;let n=`<img src="${lt(e)}" alt="${lt(s)}"`;return t&&(n+=` title="${lt(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:lt(e.text)}},Kr=class{constructor(){Ie(this,"parser",void 0)}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`\n`}checkbox({raw:e}){return e}},kt=class Ji{constructor(t){Ie(this,"options",void 0),Ie(this,"renderer",void 0),Ie(this,"textRenderer",void 0),this.options=t||Jt,this.options.renderer=this.options.renderer||new nr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kr,this.textRenderer.parser=this}static parse(t,s){return new Ji(s).parse(t)}static parseInline(t,s){return new Ji(s).parseInline(t)}parse(t){this.renderer.parser=this;let s="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){s+=c===!1?"":c??"";continue}}let n=i;switch(n.type){case"space":s+=this.renderer.space(n);break;case"hr":s+=this.renderer.hr(n);break;case"heading":s+=this.renderer.heading(n);break;case"code":s+=this.renderer.code(n);break;case"table":s+=this.renderer.table(n);break;case"blockquote":s+=this.renderer.blockquote(n);break;case"list":s+=this.renderer.list(n);break;case"checkbox":s+=this.renderer.checkbox(n);break;case"html":s+=this.renderer.html(n);break;case"def":s+=this.renderer.def(n);break;case"paragraph":s+=this.renderer.paragraph(n);break;case"text":s+=this.renderer.text(n);break;default:{let o=\'Token with "\'+n.type+\'" type was not found.\';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(t,s=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){r+=c===!1?"":c??"";continue}}let o=n;switch(o.type){case"escape":r+=s.text(o);break;case"html":r+=s.html(o);break;case"link":r+=s.link(o);break;case"image":r+=s.image(o);break;case"checkbox":r+=s.checkbox(o);break;case"strong":r+=s.strong(o);break;case"em":r+=s.em(o);break;case"codespan":r+=s.codespan(o);break;case"br":r+=s.br(o);break;case"del":r+=s.del(o);break;case"text":r+=s.text(o);break;default:{let c=\'Token with "\'+o.type+\'" type was not found.\';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},Is=(er=class{constructor(e){Ie(this,"options",void 0),Ie(this,"block",void 0),this.options=e||Jt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?St.lex:St.lexInline}provideParser(e=this.block){return e?kt.parse:kt.parseInline}},Ie(er,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ie(er,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),er);function Vt(e,t){if(Array.isArray(t))for(let s=0;s<t.length;s++)e.push(t[s]);else e.push(t)}var Nl=class{constructor(...e){Ie(this,"defaults",Ur()),Ie(this,"options",this.setOptions),Ie(this,"parse",this.parseMarkdown(!0)),Ie(this,"parseInline",this.parseMarkdown(!1)),Ie(this,"Parser",kt),Ie(this,"Renderer",nr),Ie(this,"TextRenderer",Kr),Ie(this,"Lexer",St),Ie(this,"Tokenizer",ms),Ie(this,"Hooks",Is),this.use(...e)}walkTokens(e,t){let s=[];for(let r of e)switch(Vt(s,t.call(this,r)),r.type){case"table":{let i=r;for(let n of i.header)Vt(s,this.walkTokens(n.tokens,t));for(let n of i.rows)for(let o of n)Vt(s,this.walkTokens(o.tokens,t));break}case"list":{let i=r;Vt(s,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);Vt(s,this.walkTokens(o,t))}):i.tokens&&Vt(s,this.walkTokens(i.tokens,t))}}return s}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=t.renderers[i.name];n?t.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=n.apply(this,o)),c}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be \'block\' or \'inline\'");let n=t[i.level];n?n.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){let i=this.defaults.renderer||new nr(this.defaults);for(let n in s.renderer){if(!(n in i))throw new Error(`renderer \'${n}\' does not exist`);if(["options","parser"].includes(n))continue;let o=n,c=s.renderer[o],f=i[o];i[o]=(...d)=>{let u=c.apply(i,d);return u===!1&&(u=f.apply(i,d)),u===!1?"":u??""}}r.renderer=i}if(s.tokenizer){let i=this.defaults.tokenizer||new ms(this.defaults);for(let n in s.tokenizer){if(!(n in i))throw new Error(`tokenizer \'${n}\' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,c=s.tokenizer[o],f=i[o];i[o]=(...d)=>{let u=c.apply(i,d);return u===!1&&(u=f.apply(i,d)),u}}r.tokenizer=i}if(s.hooks){let i=this.defaults.hooks||new Is;for(let n in s.hooks){if(!(n in i))throw new Error(`hook \'${n}\' does not exist`);if(["options","block"].includes(n))continue;let o=n,c=s.hooks[o],f=i[o];Is.passThroughHooks.has(n)?i[o]=d=>{if(i.options.async&&Is.passThroughHooksRespectAsync.has(n))return(async()=>{let a=await c.call(i,d);return f.call(i,a)})();let u=c.call(i,d);return f.call(i,u)}:i[o]=(...d)=>{if(i.options.async)return(async()=>{let a=await c.apply(i,d);return a===!1&&(a=await f.apply(i,d)),a})();let u=c.apply(i,d);return u===!1&&(u=f.apply(i,d)),u}}r.hooks=i}if(s.walkTokens){let i=this.defaults.walkTokens,n=s.walkTokens;r.walkTokens=function(o){let c=[];return Vt(c,n.call(this,o)),i&&Vt(c,i.call(this,o)),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return St.lex(e,t??this.defaults)}parser(e,t){return kt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,s)=>{let r={...s},i={...this.defaults,...r},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,c=await(i.hooks?await i.hooks.provideLexer(e):e?St.lex:St.lexInline)(o,i),f=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(f,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(e):e?kt.parse:kt.parseInline)(f,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(n);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer(e):e?St.lex:St.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(e):e?kt.parse:kt.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return n(o)}}}onError(e,t){return s=>{if(s.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+lt(s.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}},es=new Nl;function Oe(e,t){return es.parse(e,t)}Oe.options=Oe.setOptions=function(e){return es.setOptions(e),Oe.defaults=es.defaults,Ki(Oe.defaults),Oe},Oe.getDefaults=Ur,Oe.defaults=Jt;function Dl(...e){return es.use(...e),Oe.defaults=es.defaults,Ki(Oe.defaults),Oe}Oe.use=Dl,Oe.walkTokens=function(e,t){return es.walkTokens(e,t)},Oe.parseInline=es.parseInline,Oe.Parser=kt,Oe.parser=kt.parse,Oe.Renderer=nr,Oe.TextRenderer=Kr,Oe.Lexer=St,Oe.lexer=St.lex,Oe.Tokenizer=ms,Oe.Hooks=Is,Oe.parse=Oe;var Sh=Oe.options,kh=Oe.setOptions,wh=Oe.walkTokens,ei=Oe.parseInline,ti=Oe,xh=kt.parse,Th=St.lex,st=he((e=>{e.__esModule=!0,e.extend=n,e.indexOf=d,e.escapeExpression=u,e.isEmpty=a,e.createFrame=h,e.blockParams=l,e.appendContextPath=p;var t={"&":"&amp;","<":"&lt;",">":"&gt;",\'"\':"&quot;","\'":"&#x27;","`":"&#x60;","=":"&#x3D;"},s=/[&<>"\'`=]/g,r=/[&<>"\'`=]/;function i(g){return t[g]}function n(g){for(var v=1;v<arguments.length;v++)for(var _ in arguments[v])Object.prototype.hasOwnProperty.call(arguments[v],_)&&(g[_]=arguments[v][_]);return g}var o=Object.prototype.toString;e.toString=o;var c=function(v){return typeof v=="function"};c(/x/)&&(e.isFunction=c=function(g){return typeof g=="function"&&o.call(g)==="[object Function]"}),e.isFunction=c;var f=Array.isArray||function(g){return g&&typeof g=="object"?o.call(g)==="[object Array]":!1};e.isArray=f;function d(g,v){for(var _=0,S=g.length;_<S;_++)if(g[_]===v)return _;return-1}function u(g){if(typeof g!="string"){if(g&&typeof g.toHTML=="function")return g.toHTML();if(g==null)return"";if(!g)return g+"";g=""+g}return r.test(g)?g.replace(s,i):g}function a(g){return!g&&g!==0?!0:!!(f(g)&&g.length===0)}function h(g){var v=n({},g);return v._parent=g,v}function l(g,v){return g.path=v,g}function p(g,v){return(g?g+".":"")+v}})),wt=he(((e,t)=>{e.__esModule=!0;var s=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function r(i,n){var o=n&&n.loc,c=void 0,f=void 0,d=void 0,u=void 0;o&&o.start&&(c=o.start.line,d=o.start.column,o.end&&(f=o.end.line,u=o.end.column),i+=" - "+c+":"+d);for(var a=Error.prototype.constructor.call(this,i),h=0;h<s.length;h++)this[s[h]]=a[s[h]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=c,this.endLineNumber=f,Object.defineProperty?(Object.defineProperty(this,"column",{value:d,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:u,enumerable:!0})):(this.column=d,this.endColumn=u))}catch{}}r.prototype=new Error,e.default=r,t.exports=e.default})),Bl=he(((e,t)=>{e.__esModule=!0;var s=st();e.default=function(r){r.registerHelper("blockHelperMissing",function(i,n){var o=n.inverse,c=n.fn;if(i===!0)return c(this);if(i===!1||i==null)return o(this);if(s.isArray(i))return i.length>0?(n.ids&&(n.ids=[n.name]),r.helpers.each(i,n)):o(this);if(n.data&&n.ids){var f=s.createFrame(n.data);f.contextPath=s.appendContextPath(n.data.contextPath,n.name),n={data:f}}return c(i,n)})},t.exports=e.default})),$l=he(((e,t)=>{e.__esModule=!0;function s(o){return o&&o.__esModule?o:{default:o}}var r=st(),i=s(wt());function n(o){try{var c=o.return;r.isFunction(c)&&c.call(o)}catch{}}e.default=function(o){o.registerHelper("each",function(c,f){if(!f)throw new i.default("Must pass iterator to #each");var d=f.fn,u=f.inverse,a=0,h="",l=void 0,p=void 0;f.data&&f.ids&&(p=r.appendContextPath(f.data.contextPath,f.ids[0])+"."),r.isFunction(c)&&(c=c.call(this)),f.data&&(l=r.createFrame(f.data));function g(m,b,k,w){l&&(l.key=m,l.index=b,l.first=b===0,l.last=!!k,p&&(l.contextPath=p+m)),h=h+d(w,{data:l,blockParams:r.blockParams([w,m],[p+m,null])})}if(c&&typeof c=="object")if(r.isArray(c))for(var v=c.length;a<v;a++)a in c&&g(a,a,a===c.length-1,c[a]);else if(typeof Symbol=="function"&&c[Symbol.iterator])for(var _=c[Symbol.iterator](),S=_.next();!S.done;){var y=_.next();try{g(a,a,y.done,S.value)}catch(m){throw y.done||n(_),m}S=y,a++}else(function(){var m=void 0;Object.keys(c).forEach(function(b){m!==void 0&&g(m,a-1,!1,c[m]),m=b,a++}),m!==void 0&&g(m,a-1,!0,c[m])})();return a===0&&(h=u(this)),h})},t.exports=e.default})),ql=he(((e,t)=>{e.__esModule=!0;function s(i){return i&&i.__esModule?i:{default:i}}var r=s(wt());e.default=function(i){i.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new r.default(\'Missing helper: "\'+arguments[arguments.length-1].name+\'"\')})},t.exports=e.default})),Hl=he(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=st(),i=s(wt());e.default=function(n){n.registerHelper("if",function(o,c){if(arguments.length!=2)throw new i.default("#if requires exactly one argument");return r.isFunction(o)&&(o=o.call(this)),!c.hash.includeZero&&!o||r.isEmpty(o)?c.inverse(this):c.fn(this)}),n.registerHelper("unless",function(o,c){if(arguments.length!=2)throw new i.default("#unless requires exactly one argument");return n.helpers.if.call(this,o,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},t.exports=e.default})),Fl=he(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper("log",function(){for(var r=[void 0],i=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)r.push(arguments[n]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),r[0]=o,s.log.apply(s,r)})},t.exports=e.default})),Vl=he(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper("lookup",function(r,i,n){return r&&n.lookupProperty(r,i)})},t.exports=e.default})),zl=he(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=st(),i=s(wt());e.default=function(n){n.registerHelper("with",function(o,c){if(arguments.length!=2)throw new i.default("#with requires exactly one argument");r.isFunction(o)&&(o=o.call(this));var f=c.fn;if(r.isEmpty(o))return c.inverse(this);var d=c.data;return c.data&&c.ids&&(d=r.createFrame(c.data),d.contextPath=r.appendContextPath(c.data.contextPath,c.ids[0])),f(o,{data:d,blockParams:r.blockParams([o],[d&&d.contextPath])})})},t.exports=e.default})),_n=he((e=>{e.__esModule=!0,e.registerDefaultHelpers=d,e.moveHelperToHooks=u;function t(a){return a&&a.__esModule?a:{default:a}}var s=t(Bl()),r=t($l()),i=t(ql()),n=t(Hl()),o=t(Fl()),c=t(Vl()),f=t(zl());function d(a){s.default(a),r.default(a),i.default(a),n.default(a),o.default(a),c.default(a),f.default(a)}function u(a,h,l){a.helpers[h]&&(a.hooks[h]=a.helpers[h],l||(a.helpers[h]=void 0))}})),Ul=he(((e,t)=>{e.__esModule=!0;var s=st();e.default=function(r){r.registerDecorator("inline",function(i,n,o,c){var f=i;return n.partials||(n.partials={},f=function(d,u){var a=o.partials;o.partials=s.extend({},a,n.partials);var h=i(d,u);return o.partials=a,h}),n.partials[c.args[0]]=c.fn,f})},t.exports=e.default})),Wl=he((e=>{e.__esModule=!0,e.registerDefaultDecorators=r;function t(i){return i&&i.__esModule?i:{default:i}}var s=t(Ul());function r(i){s.default(i)}})),Sn=he(((e,t)=>{e.__esModule=!0;var s=st(),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(n){if(typeof n=="string"){var o=s.indexOf(r.methodMap,n.toLowerCase());o>=0?n=o:n=parseInt(n,10)}return n},log:function(n){if(n=r.lookupLevel(n),typeof console<"u"&&r.lookupLevel(r.level)<=n){var o=r.methodMap[n];console[o]||(o="log");for(var c=arguments.length,f=Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];console[o].apply(console,f)}}};e.default=r,t.exports=e.default})),kn=he((e=>{e.__esModule=!0,e.createProtoAccessControl=n,e.resultIsAllowed=o,e.isPrototypeConstructor=c,e.resetLoggedProperties=u;function t(a){return a&&a.__esModule?a:{default:a}}var s=st(),r=t(Sn()),i=Object.create(null);function n(a){var h=Object.create(null);h.__proto__=!1,s.extend(h,a.allowedProtoProperties);var l=Object.create(null);return l.constructor=!1,l.__defineGetter__=!1,l.__defineSetter__=!1,l.__lookupGetter__=!1,l.__lookupSetter__=!1,s.extend(l,a.allowedProtoMethods),{properties:{whitelist:h,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l,defaultValue:a.allowProtoMethodsByDefault}}}function o(a,h,l){return f(typeof a=="function"?h.methods:h.properties,l)}function c(a,h,l){return h==="constructor"&&typeof l=="function"&&a===l.prototype}function f(a,h){return a.whitelist[h]!==void 0?a.whitelist[h]===!0:a.defaultValue!==void 0?a.defaultValue:(d(h),!1)}function d(a){i[a]!==!0&&(i[a]=!0,r.default.log("error",\'Handlebars: Access has been denied to resolve the property "\'+a+`" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function u(){Object.keys(i).forEach(function(a){delete i[a]})}})),si=he((e=>{e.__esModule=!0,e.HandlebarsEnvironment=l;function t(g){return g&&g.__esModule?g:{default:g}}var s=st(),r=t(wt()),i=_n(),n=Wl(),o=t(Sn()),c=kn(),f="4.7.10";e.VERSION=f;var d=8;e.COMPILER_REVISION=d;var u=7;e.LAST_COMPATIBLE_COMPILER_REVISION=u;var a={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};e.REVISION_CHANGES=a;var h="[object Object]";function l(g,v,_){this.helpers=g||{},this.partials=v||{},this.decorators=_||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:o.default,log:o.default.log,registerHelper:function(v,_){if(s.toString.call(v)===h){if(_)throw new r.default("Arg not supported with multiple helpers");s.extend(this.helpers,v)}else this.helpers[v]=_},unregisterHelper:function(v){delete this.helpers[v]},registerPartial:function(v,_){if(s.toString.call(v)===h)s.extend(this.partials,v);else{if(typeof _>"u")throw new r.default(\'Attempting to register a partial called "\'+v+\'" as undefined\');this.partials[v]=_}},unregisterPartial:function(v){delete this.partials[v]},registerDecorator:function(v,_){if(s.toString.call(v)===h){if(_)throw new r.default("Arg not supported with multiple decorators");s.extend(this.decorators,v)}else this.decorators[v]=_},unregisterDecorator:function(v){delete this.decorators[v]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var p=o.default.log;e.log=p,e.createFrame=s.createFrame,e.logger=o.default})),Xl=he(((e,t)=>{e.__esModule=!0;function s(r){this.string=r}s.prototype.toString=s.prototype.toHTML=function(){return""+this.string},e.default=s,t.exports=e.default})),Gl=he((e=>{e.__esModule=!0,e.wrapHelper=t;function t(s,r){return typeof s!="function"?s:function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=r(n),s.apply(this,arguments)}}})),Yl=he((e=>{e.__esModule=!0,e.checkRevision=d,e.template=u,e.wrapProgram=a,e.resolvePartial=h,e.invokePartial=l,e.noop=p;function t(m){return m&&m.__esModule?m:{default:m}}function s(m){if(m&&m.__esModule)return m;var b={};if(m!=null)for(var k in m)Object.prototype.hasOwnProperty.call(m,k)&&(b[k]=m[k]);return b.default=m,b}var r=s(st()),i=t(wt()),n=si(),o=_n(),c=Gl(),f=kn();function d(m){var b=m&&m[0]||1,k=n.COMPILER_REVISION;if(!(b>=n.LAST_COMPATIBLE_COMPILER_REVISION&&b<=n.COMPILER_REVISION))if(b<n.LAST_COMPATIBLE_COMPILER_REVISION){var w=n.REVISION_CHANGES[k],A=n.REVISION_CHANGES[b];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+w+") or downgrade your runtime to an older version ("+A+").")}else throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+m[1]+").")}function u(m,b){if(!b)throw new i.default("No environment passed to template");if(!m||!m.main)throw new i.default("Unknown template object: "+typeof m);m.main.decorator=m.main_d,b.VM.checkRevision(m.compiler);var k=m.compiler&&m.compiler[0]===7;function w(L,R,E){E.hash&&(R=r.extend({},R,E.hash),E.ids&&(E.ids[0]=!0)),L=b.VM.resolvePartial.call(this,L,R,E),E.hooks=this.hooks,E.protoAccessControl=this.protoAccessControl;var q=b.VM.invokePartial.call(this,L,R,E);if(q==null&&r.isFunction(L))throw new i.default("The partial "+E.name+" returned no output: partials must return a string");if(q==null&&b.compile){if(typeof L!="string")throw new i.default("The partial "+E.name+" could not be compiled: partials must be strings or functions returning strings");E.partials[E.name]=b.compile(L,m.compilerOptions,b),q=E.partials[E.name](R,E)}if(q!=null){if(E.indent){for(var z=q.split(`\n`),X=0,C=z.length;X<C&&!(!z[X]&&X+1===C);X++)z[X]=E.indent+z[X];q=z.join(`\n`)}return q}else throw new i.default("The partial "+E.name+" could not be compiled when running in runtime-only mode")}var A={strict:function(R,E,q){if(!R||!(E in R))throw new i.default(\'"\'+E+\'" not defined in \'+R,{loc:q});return A.lookupProperty(R,E)},lookupProperty:function(R,E){var q=R[E];if(q==null||Object.prototype.hasOwnProperty.call(R,E)&&!f.isPrototypeConstructor(R,E,q)||f.resultIsAllowed(q,A.protoAccessControl,E))return q},lookup:function(R,E){for(var q=R.length,z=0;z<q;z++){var X=R[z]&&A.lookupProperty(R[z],E);if(X!=null)return X}},lambda:function(R,E){return typeof R=="function"?R.call(E):R},escapeExpression:r.escapeExpression,invokePartial:w,fn:function(R){var E=m[R];return E.decorator=m[R+"_d"],E},programs:[],program:function(R,E,q,z,X){var C=this.programs[R],D=this.fn(R);return E||X||z||q?C=a(this,R,D,E,q,z,X):C||(C=this.programs[R]=a(this,R,D)),C},data:function(R,E){for(;R&&E--;)R=R._parent;return R},mergeIfNeeded:function(R,E){var q=R||E;return R&&E&&R!==E&&(q=r.extend({},E,R)),q},nullContext:Object.seal({}),noop:b.VM.noop,compilerInfo:m.compiler};function M(L){var R=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],E=R.data;M._setup(R),!R.partial&&m.useData&&(E=v(L,E));var q=void 0,z=m.useBlockParams?[]:void 0;m.useDepths&&(R.depths?q=L!=R.depths[0]?[L].concat(R.depths):R.depths:q=[L]);function X(C){return""+m.main(A,C,A.helpers,A.partials,E,z,q)}return X=_(m.main,X,A,R.depths||[],E,z),X(L,R)}return M.isTop=!0,M._setup=function(L){if(L.partial)A.protoAccessControl=L.protoAccessControl,A.helpers=L.helpers,A.partials=L.partials,A.decorators=L.decorators,A.hooks=L.hooks;else{var R={};S(R,b.helpers,A),S(R,L.helpers,A),A.helpers=R,m.usePartial&&(A.partials=A.mergeIfNeeded(L.partials,b.partials)),(m.usePartial||m.useDecorators)&&(A.decorators=r.extend({},b.decorators,L.decorators)),A.hooks={},A.protoAccessControl=f.createProtoAccessControl(L);var E=L.allowCallsToHelperMissing||k;o.moveHelperToHooks(A,"helperMissing",E),o.moveHelperToHooks(A,"blockHelperMissing",E)}},M._child=function(L,R,E,q){if(m.useBlockParams&&!E)throw new i.default("must pass block params");if(m.useDepths&&!q)throw new i.default("must pass parent depths");return a(A,L,m[L],R,0,E,q)},M}function a(m,b,k,w,A,M,L){function R(E){var q=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],z=L;return L&&E!=L[0]&&!(E===m.nullContext&&L[0]===null)&&(z=[E].concat(L)),k(m,E,m.helpers,m.partials,q.data||w,M&&[q.blockParams].concat(M),z)}return R=_(k,R,m,L,w,M),R.program=b,R.depth=L?L.length:0,R.blockParams=A||0,R}function h(m,b,k){return m?typeof m!="function"&&!k.name&&(k.name=m,m=g(k.partials,m)):k.name==="@partial-block"?m=g(k.data,"partial-block"):m=g(k.partials,k.name),m}function l(m,b,k){var w=g(k.data,"partial-block");k.partial=!0,k.ids&&(k.data.contextPath=k.ids[0]||k.data.contextPath);var A=void 0;if(k.fn&&k.fn!==p&&(function(){k.data=n.createFrame(k.data);var M=k.fn;A=k.data["partial-block"]=function(R){var E=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return E.data=n.createFrame(E.data),E.data["partial-block"]=w,M(R,E)},M.partials&&(k.partials=r.extend({},k.partials,M.partials))})(),m===void 0&&A&&(m=A),m===void 0)throw new i.default("The partial "+k.name+" could not be found");if(m instanceof Function)return m(b,k)}function p(){return""}function g(m,b){if(m&&Object.prototype.hasOwnProperty.call(m,b))return m[b]}function v(m,b){return(!b||!("root"in b))&&(b=b?n.createFrame(b):{},b.root=m),b}function _(m,b,k,w,A,M){if(m.decorator){var L={};b=m.decorator(b,L,k,w&&w[0],A,M,w),r.extend(b,L)}return b}function S(m,b,k){b&&Object.keys(b).forEach(function(w){var A=b[w];m[w]=y(A,k)})}function y(m,b){var k=b.lookupProperty;return c.wrapHelper(m,function(w){return w.lookupProperty=k,w})}})),wn=he(((e,t)=>{e.__esModule=!0,e.default=function(s){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var r=globalThis.Handlebars;s.noConflict=function(){return globalThis.Handlebars===s&&(globalThis.Handlebars=r),s}},t.exports=e.default})),Zl=he(((e,t)=>{e.__esModule=!0;function s(h){return h&&h.__esModule?h:{default:h}}function r(h){if(h&&h.__esModule)return h;var l={};if(h!=null)for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(l[p]=h[p]);return l.default=h,l}var i=r(si()),n=s(Xl()),o=s(wt()),c=r(st()),f=r(Yl()),d=s(wn());function u(){var h=new i.HandlebarsEnvironment;return c.extend(h,i),h.SafeString=n.default,h.Exception=o.default,h.Utils=c,h.escapeExpression=c.escapeExpression,h.VM=f,h.template=function(l){return f.template(l,h)},h}var a=u();a.create=u,d.default(a),a.default=a,e.default=a,t.exports=e.default})),xn=he(((e,t)=>{e.__esModule=!0;var s={helpers:{helperExpression:function(i){return i.type==="SubExpression"||(i.type==="MustacheStatement"||i.type==="BlockStatement")&&!!(i.params&&i.params.length||i.hash)},scopedId:function(i){return/^\\.|this\\b/.test(i.original)},simpleId:function(i){return i.parts.length===1&&!s.helpers.scopedId(i)&&!i.depth}}};e.default=s,t.exports=e.default})),jl=he(((e,t)=>{e.__esModule=!0;var s=(function(){var r={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,c,f,d,u,a,h){var l=a.length-1;switch(u){case 1:return a[l-1];case 2:this.$=d.prepareProgram(a[l]);break;case 3:this.$=a[l];break;case 4:this.$=a[l];break;case 5:this.$=a[l];break;case 6:this.$=a[l];break;case 7:this.$=a[l];break;case 8:this.$=a[l];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(a[l]),strip:d.stripFlags(a[l],a[l]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:a[l],value:a[l],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(a[l-2],a[l-1],a[l],this._$);break;case 12:this.$={path:a[l-3],params:a[l-2],hash:a[l-1]};break;case 13:this.$=d.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!1,this._$);break;case 14:this.$=d.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!0,this._$);break;case 15:this.$={open:a[l-5],path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:d.stripFlags(a[l-5],a[l])};break;case 16:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:d.stripFlags(a[l-5],a[l])};break;case 17:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:d.stripFlags(a[l-5],a[l])};break;case 18:this.$={strip:d.stripFlags(a[l-1],a[l-1]),program:a[l]};break;case 19:var p=d.prepareBlock(a[l-2],a[l-1],a[l],a[l],!1,this._$),g=d.prepareProgram([p],a[l-1].loc);g.chained=!0,this.$={strip:a[l-2].strip,program:g,chain:!0};break;case 20:this.$=a[l];break;case 21:this.$={path:a[l-1],strip:d.stripFlags(a[l-2],a[l])};break;case 22:this.$=d.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],d.stripFlags(a[l-4],a[l]),this._$);break;case 23:this.$=d.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],d.stripFlags(a[l-4],a[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:a[l-3],params:a[l-2],hash:a[l-1],indent:"",strip:d.stripFlags(a[l-4],a[l]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(a[l-2],a[l-1],a[l],this._$);break;case 26:this.$={path:a[l-3],params:a[l-2],hash:a[l-1],strip:d.stripFlags(a[l-4],a[l])};break;case 27:this.$=a[l];break;case 28:this.$=a[l];break;case 29:this.$={type:"SubExpression",path:a[l-3],params:a[l-2],hash:a[l-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:a[l],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(a[l-2]),value:a[l],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(a[l-1]);break;case 33:this.$=a[l];break;case 34:this.$=a[l];break;case 35:this.$={type:"StringLiteral",value:a[l],original:a[l],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(a[l]),original:Number(a[l]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:a[l]==="true",original:a[l]==="true",loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=a[l];break;case 41:this.$=a[l];break;case 42:this.$=d.preparePath(!0,a[l],this._$);break;case 43:this.$=d.preparePath(!1,a[l],this._$);break;case 44:a[l-2].push({part:d.id(a[l]),original:a[l],separator:a[l-1]}),this.$=a[l-2];break;case 45:this.$=[{part:d.id(a[l]),original:a[l]}];break;case 46:this.$=[];break;case 47:a[l-1].push(a[l]);break;case 48:this.$=[];break;case 49:a[l-1].push(a[l]);break;case 50:this.$=[];break;case 51:a[l-1].push(a[l]);break;case 58:this.$=[];break;case 59:a[l-1].push(a[l]);break;case 64:this.$=[];break;case 65:a[l-1].push(a[l]);break;case 70:this.$=[];break;case 71:a[l-1].push(a[l]);break;case 78:this.$=[];break;case 79:a[l-1].push(a[l]);break;case 82:this.$=[];break;case 83:a[l-1].push(a[l]);break;case 86:this.$=[];break;case 87:a[l-1].push(a[l]);break;case 90:this.$=[];break;case 91:a[l-1].push(a[l]);break;case 94:this.$=[];break;case 95:a[l-1].push(a[l]);break;case 98:this.$=[a[l]];break;case 99:a[l-1].push(a[l]);break;case 100:this.$=[a[l]];break;case 101:a[l-1].push(a[l])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,c){throw new Error(o)},parse:function(o){var c=this,f=[0],d=[null],u=[],a=this.table,h="",l=0,p=0,g=0;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var v=this.lexer.yylloc;u.push(v);var _=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function S(){var z=c.lexer.lex()||1;return typeof z!="number"&&(z=c.symbols_[z]||z),z}for(var y,m,b,k,w,A={},M,L,R,E;;){if(b=f[f.length-1],this.defaultActions[b]?k=this.defaultActions[b]:((y===null||typeof y>"u")&&(y=S()),k=a[b]&&a[b][y]),typeof k>"u"||!k.length||!k[0]){var q="";if(!g){E=[];for(M in a[b])this.terminals_[M]&&M>2&&E.push("\'"+this.terminals_[M]+"\'");this.lexer.showPosition?q="Parse error on line "+(l+1)+`:\n`+this.lexer.showPosition()+`\nExpecting `+E.join(", ")+", got \'"+(this.terminals_[y]||y)+"\'":q="Parse error on line "+(l+1)+": Unexpected "+(y==1?"end of input":"\'"+(this.terminals_[y]||y)+"\'"),this.parseError(q,{text:this.lexer.match,token:this.terminals_[y]||y,line:this.lexer.yylineno,loc:v,expected:E})}}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+y);switch(k[0]){case 1:f.push(y),d.push(this.lexer.yytext),u.push(this.lexer.yylloc),f.push(k[1]),y=null,m?(y=m,m=null):(p=this.lexer.yyleng,h=this.lexer.yytext,l=this.lexer.yylineno,v=this.lexer.yylloc,g>0&&g--);break;case 2:if(L=this.productions_[k[1]][1],A.$=d[d.length-L],A._$={first_line:u[u.length-(L||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(L||1)].first_column,last_column:u[u.length-1].last_column},_&&(A._$.range=[u[u.length-(L||1)].range[0],u[u.length-1].range[1]]),w=this.performAction.call(A,h,p,l,this.yy,k[1],d,u),typeof w<"u")return w;L&&(f=f.slice(0,-1*L*2),d=d.slice(0,-1*L),u=u.slice(0,-1*L)),f.push(this.productions_[k[1]][0]),d.push(A.$),u.push(A._$),R=a[f[f.length-2]][f[f.length-1]],f.push(R);break;case 3:return!0}}return!0}};r.lexer=(function(){var n={EOF:1,parseError:function(c,f){if(this.yy.parser)this.yy.parser.parseError(c,f);else throw new Error(c)},setInput:function(c){return this._input=c,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var c=this._input[0];return this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c,c.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},unput:function(c){var f=c.length,d=c.split(/(?:\\r\\n?|\\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f-1),this.offset-=f;var u=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===u.length?this.yylloc.first_column:0)+u[u.length-d.length].length-d[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-f]),this},more:function(){return this._more=!0,this},less:function(c){this.unput(this.match.slice(c))},pastInput:function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\\n/g,"")},upcomingInput:function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\\n/g,"")},showPosition:function(){var c=this.pastInput(),f=new Array(c.length+1).join("-");return c+this.upcomingInput()+`\n`+f+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,f,d,u,a;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),l=0;l<h.length&&(d=this._input.match(this.rules[h[l]]),!(d&&(!f||d[0].length>f[0].length)&&(f=d,u=l,!this.options.flex)));l++);return f?(a=f[0].match(/(?:\\r\\n?|\\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],c=this.performAction.call(this,this.yy,this,h[u],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.\n`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var c=this.next();return typeof c<"u"?c:this.lex()},begin:function(c){this.conditionStack.push(c)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(c){this.begin(c)}};return n.options={},n.performAction=function(c,f,d,u){function a(h,l){return f.yytext=f.yytext.substring(h,f.yyleng-l+h)}switch(d){case 0:if(f.yytext.slice(-2)==="\\\\\\\\"?(a(0,1),this.begin("mu")):f.yytext.slice(-1)==="\\\\"?(a(0,1),this.begin("emu")):this.begin("mu"),f.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(a(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(f.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return f.yytext=a(1,2).replace(/\\\\"/g,\'"\'),80;case 32:return f.yytext=a(1,2).replace(/\\\\\'/g,"\'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return f.yytext=f.yytext.replace(/\\\\([\\\\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{|\\\\\\{\\{|\\\\\\\\\\{\\{|$)))/,/^(?:\\{\\{\\{\\{(?=[^\\/]))/,/^(?:\\{\\{\\{\\{\\/[^\\s!"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=[=}\\s\\/.])\\}\\}\\}\\})/,/^(?:[^\\x00]+?(?=(\\{\\{\\{\\{)))/,/^(?:[\\s\\S]*?--(~)?\\}\\})/,/^(?:\\()/,/^(?:\\))/,/^(?:\\{\\{\\{\\{)/,/^(?:\\}\\}\\}\\})/,/^(?:\\{\\{(~)?>)/,/^(?:\\{\\{(~)?#>)/,/^(?:\\{\\{(~)?#\\*?)/,/^(?:\\{\\{(~)?\\/)/,/^(?:\\{\\{(~)?\\^\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\s*else\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\^)/,/^(?:\\{\\{(~)?\\s*else\\b)/,/^(?:\\{\\{(~)?\\{)/,/^(?:\\{\\{(~)?&)/,/^(?:\\{\\{(~)?!--)/,/^(?:\\{\\{(~)?![\\s\\S]*?\\}\\})/,/^(?:\\{\\{(~)?\\*?)/,/^(?:=)/,/^(?:\\.\\.)/,/^(?:\\.(?=([=~}\\s\\/.)|])))/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}(~)?\\}\\})/,/^(?:(~)?\\}\\})/,/^(?:"(\\\\["]|[^"])*")/,/^(?:\'(\\\\[\']|[^\'])*\')/,/^(?:@)/,/^(?:true(?=([~}\\s)])))/,/^(?:false(?=([~}\\s)])))/,/^(?:undefined(?=([~}\\s)])))/,/^(?:null(?=([~}\\s)])))/,/^(?:-?[0-9]+(?:\\.[0-9]+)?(?=([~}\\s)])))/,/^(?:as\\s+\\|)/,/^(?:\\|)/,/^(?:([^\\s!"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=([=~}\\s\\/.)|]))))/,/^(?:\\[(\\\\\\]|[^\\]])*\\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();function i(){this.yy={}}return i.prototype=r,r.Parser=i,new i})();e.default=s,t.exports=e.default})),Tn=he((e=>{e.__esModule=!0;var t=["Program","BlockStatement","DecoratorBlock","PartialStatement","PartialBlockStatement","Decorator","MustacheStatement","ContentStatement","CommentStatement","SubExpression","PathExpression","StringLiteral","NumberLiteral","BooleanLiteral","UndefinedLiteral","NullLiteral","Hash","HashPair"];e.NODE_TYPES=t})),Cn=he(((e,t)=>{e.__esModule=!0;function s(a){return a&&a.__esModule?a:{default:a}}var r=s(wt()),i=st(),n=Tn();function o(){this.parents=[]}function c(a,h){return i.indexOf(n.NODE_TYPES,h)!==-1||!(h in o.prototype)&&typeof a[h]=="function"}o.prototype={constructor:o,mutating:!1,acceptKey:function(h,l){var p=this.accept(h[l]);if(this.mutating){if(p&&!c(this,p.type))throw new r.default(\'Unexpected node type "\'+p.type+\'" found when accepting \'+l+" on "+h.type);h[l]=p}},acceptRequired:function(h,l){if(this.acceptKey(h,l),!h[l])throw new r.default(h.type+" requires "+l)},acceptArray:function(h){for(var l=0,p=h.length;l<p;l++)this.acceptKey(h,l),h[l]||(h.splice(l,1),l--,p--)},accept:function(h){if(h){if(!c(this,h.type)||!this[h.type])throw new r.default("Unknown type: "+h.type,h);this.current&&this.parents.unshift(this.current),this.current=h;var l=this[h.type](h);if(this.current=this.parents.shift(),!this.mutating||l)return l;if(l!==!1)return h}},Program:function(h){this.acceptArray(h.body)},MustacheStatement:f,Decorator:f,BlockStatement:d,DecoratorBlock:d,PartialStatement:u,PartialBlockStatement:function(h){u.call(this,h),this.acceptKey(h,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:f,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(h){this.acceptArray(h.pairs)},HashPair:function(h){this.acceptRequired(h,"value")}};function f(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function d(a){f.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function u(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}e.default=o,t.exports=e.default})),Jl=he(((e,t)=>{e.__esModule=!0;function s(d){return d&&d.__esModule?d:{default:d}}var r=s(Cn());function i(){var d=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=d}i.prototype=new r.default,i.prototype.Program=function(d){var u=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var h=d.body,l=0,p=h.length;l<p;l++){var g=h[l],v=this.accept(g);if(v){var _=n(h,l,a),S=o(h,l,a),y=v.openStandalone&&_,m=v.closeStandalone&&S,b=v.inlineStandalone&&_&&S;v.close&&c(h,l,!0),v.open&&f(h,l,!0),u&&b&&(c(h,l),f(h,l)&&g.type==="PartialStatement"&&(g.indent=/(?:^|[^ \\t])([ \\t]+)$/.exec(h[l-1].original)[1])),u&&y&&(c((g.program||g.inverse).body),f(h,l)),u&&m&&(c(h,l),f((g.inverse||g.program).body))}}return d},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(d){this.accept(d.program),this.accept(d.inverse);var u=d.program||d.inverse,a=d.program&&d.inverse,h=a,l=a;if(a&&a.chained)for(h=a.body[0].program;l.chained;)l=l.body[l.body.length-1].program;var p={open:d.openStrip.open,close:d.closeStrip.close,openStandalone:o(u.body),closeStandalone:n((h||u).body)};if(d.openStrip.close&&c(u.body,null,!0),a){var g=d.inverseStrip;g.open&&f(u.body,null,!0),g.close&&c(h.body,null,!0),d.closeStrip.open&&f(l.body,null,!0),!this.options.ignoreStandalone&&n(u.body)&&o(h.body)&&(f(u.body),c(h.body))}else d.closeStrip.open&&f(u.body,null,!0);return p},i.prototype.Decorator=i.prototype.MustacheStatement=function(d){return d.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(d){var u=d.strip||{};return{inlineStandalone:!0,open:u.open,close:u.close}};function n(d,u,a){u===void 0&&(u=d.length);var h=d[u-1],l=d[u-2];if(!h)return a;if(h.type==="ContentStatement")return(l||!a?/(?:^|\\S)[^\\S\\n]*\\n\\s*$/:/^\\s*$|(?:^|\\S)[^\\S\\n]*\\n\\s*$/).test(h.original)}function o(d,u,a){u===void 0&&(u=-1);var h=d[u+1],l=d[u+2];if(!h)return a;if(h.type==="ContentStatement")return(l||!a?/^\\s*?\\r?\\n/:/^\\s*?(\\r?\\n|$)/).test(h.original)}function c(d,u,a){var h=d[u==null?0:u+1];if(!(!h||h.type!=="ContentStatement"||!a&&h.rightStripped)){var l=h.value;h.value=h.value.replace(a?/^\\s+/:/^[ \\t]*\\r?\\n?/,""),h.rightStripped=h.value!==l}}function f(d,u,a){var h=d[u==null?d.length-1:u-1];if(!(!h||h.type!=="ContentStatement"||!a&&h.leftStripped)){var l=h.value;return h.value=h.value.replace(a?/(^|\\S)\\s+$/:/(^|[^ \\t])[ \\t]+$/,"$1"),h.leftStripped=h.value!==l,h.leftStripped}}e.default=i,t.exports=e.default})),Ql=he((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=n,e.stripFlags=o,e.stripComment=c,e.preparePath=f,e.prepareMustache=d,e.prepareRawBlock=u,e.prepareBlock=a,e.prepareProgram=h,e.preparePartialBlock=l;function t(p){return p&&p.__esModule?p:{default:p}}var s=t(wt());function r(p,g){if(g=g.path?g.path.original:g,p.path.original!==g){var v={loc:p.path.loc};throw new s.default(p.path.original+" doesn\'t match "+g,v)}}function i(p,g){this.source=p,this.start={line:g.first_line,column:g.first_column},this.end={line:g.last_line,column:g.last_column}}function n(p){return/^\\[.*\\]$/.test(p)?p.substring(1,p.length-1):p}function o(p,g){return{open:p.charAt(2)==="~",close:g.charAt(g.length-3)==="~"}}function c(p){return p.replace(/^\\{\\{~?!-?-?/,"").replace(/-?-?~?\\}\\}$/,"")}function f(p,g,v){v=this.locInfo(v);for(var _=p?"@":"",S=[],y=0,m=0,b=g.length;m<b;m++){var k=g[m].part,w=g[m].original!==k;if(_+=(g[m].separator||"")+k,!w&&(k===".."||k==="."||k==="this")){if(S.length>0)throw new s.default("Invalid path: "+_,{loc:v});k===".."&&y++}else S.push(k)}return{type:"PathExpression",data:p,depth:y,parts:S,original:_,loc:v}}function d(p,g,v,_,S,y){var m=_.charAt(3)||_.charAt(2),b=m!=="{"&&m!=="&";return{type:/\\*/.test(_)?"Decorator":"MustacheStatement",path:p,params:g,hash:v,escaped:b,strip:S,loc:this.locInfo(y)}}function u(p,g,v,_){r(p,v),_=this.locInfo(_);var S={type:"Program",body:g,strip:{},loc:_};return{type:"BlockStatement",path:p.path,params:p.params,hash:p.hash,program:S,openStrip:{},inverseStrip:{},closeStrip:{},loc:_}}function a(p,g,v,_,S,y){_&&_.path&&r(p,_);var m=/\\*/.test(p.open);g.blockParams=p.blockParams;var b=void 0,k=void 0;if(v){if(m)throw new s.default("Unexpected inverse block on decorator",v);v.chain&&(v.program.body[0].closeStrip=_.strip),k=v.strip,b=v.program}return S&&(S=b,b=g,g=S),{type:m?"DecoratorBlock":"BlockStatement",path:p.path,params:p.params,hash:p.hash,program:g,inverse:b,openStrip:p.strip,inverseStrip:k,closeStrip:_&&_.strip,loc:this.locInfo(y)}}function h(p,g){if(!g&&p.length){var v=p[0].loc,_=p[p.length-1].loc;v&&_&&(g={source:v.source,start:{line:v.start.line,column:v.start.column},end:{line:_.end.line,column:_.end.column}})}return{type:"Program",body:p,strip:{},loc:g}}function l(p,g,v,_){return r(p,v),{type:"PartialBlockStatement",name:p.path,params:p.params,hash:p.hash,program:g,openStrip:p.strip,closeStrip:v&&v.strip,loc:this.locInfo(_)}}})),Kl=he((e=>{e.__esModule=!0,e.parseWithoutProcessing=f,e.parse=d;function t(u){if(u&&u.__esModule)return u;var a={};if(u!=null)for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(a[h]=u[h]);return a.default=u,a}function s(u){return u&&u.__esModule?u:{default:u}}var r=s(jl()),i=s(Jl()),n=t(Ql()),o=st();e.parser=r.default;var c={};o.extend(c,n);function f(u,a){return u.type==="Program"?u:(r.default.yy=c,c.locInfo=function(h){return new c.SourceLocation(a&&a.srcName,h)},r.default.parse(u))}function d(u,a){var h=f(u,a);return new i.default(a).accept(h)}})),ec=he((e=>{e.__esModule=!0,e.Compiler=c,e.precompile=f,e.compile=d;function t(S){return S&&S.__esModule?S:{default:S}}var s=t(wt()),r=st(),i=t(xn()),n=Tn(),o=[].slice;function c(){}c.prototype={compiler:c,equals:function(y){var m=this.opcodes.length;if(y.opcodes.length!==m)return!1;for(var b=0;b<m;b++){var k=this.opcodes[b],w=y.opcodes[b];if(k.opcode!==w.opcode||!v(k.args,w.args))return!1}m=this.children.length;for(var b=0;b<m;b++)if(!this.children[b].equals(y.children[b]))return!1;return!0},guid:0,compile:function(y,m){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=m,this.stringParams=m.stringParams,this.trackIds=m.trackIds,m.blockParams=m.blockParams||[],m.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},m.knownHelpers),this.accept(y)},compileProgram:function(y){var m=new this.compiler().compile(y,this.options),b=this.guid++;return this.usePartial=this.usePartial||m.usePartial,this.children[b]=m,this.useDepths=this.useDepths||m.useDepths,b},accept:function(y){if(r.indexOf(n.NODE_TYPES,y.type)===-1||!this[y.type])throw new s.default("Unknown type: "+y.type,y);this.sourceNode.unshift(y);var m=this[y.type](y);return this.sourceNode.shift(),m},Program:function(y){g(y),this.options.blockParams.unshift(y.blockParams);for(var m=y.body,b=m.length,k=0;k<b;k++)this.accept(m[k]);return this.options.blockParams.shift(),this.isSimple=b===1,this.blockParams=y.blockParams?y.blockParams.length:0,this},BlockStatement:function(y){_(y);var m=y.program,b=y.inverse;m=m&&this.compileProgram(m),b=b&&this.compileProgram(b);var k=this.classifySexpr(y);k==="helper"?this.helperSexpr(y,m,b):k==="simple"?(this.simpleSexpr(y),this.opcode("pushProgram",m),this.opcode("pushProgram",b),this.opcode("emptyHash"),this.opcode("blockValue",y.path.original)):(this.ambiguousSexpr(y,m,b),this.opcode("pushProgram",m),this.opcode("pushProgram",b),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(y){var m=y.program&&this.compileProgram(y.program),b=this.setupFullMustacheParams(y,m,void 0),k=y.path;this.useDecorators=!0,this.opcode("registerDecorator",b.length,k.original)},PartialStatement:function(y){this.usePartial=!0;var m=y.program;m&&(m=this.compileProgram(y.program));var b=y.params;if(b.length>1)throw new s.default("Unsupported number of partial arguments: "+b.length,y);b.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):b.push({type:"PathExpression",parts:[],depth:0}));var k=y.name.original,w=y.name.type==="SubExpression";w&&this.accept(y.name),this.setupFullMustacheParams(y,m,void 0,!0);var A=y.indent||"";this.options.preventIndent&&A&&(this.opcode("appendContent",A),A=""),this.opcode("invokePartial",w,k,A),this.opcode("append")},PartialBlockStatement:function(y){this.PartialStatement(y)},MustacheStatement:function(y){this.SubExpression(y),y.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(y){this.DecoratorBlock(y)},ContentStatement:function(y){if(y.value!=null&&typeof y.value!="string")throw u(y,"value must be a string");y.value&&this.opcode("appendContent",y.value)},CommentStatement:function(){},SubExpression:function(y){_(y);var m=this.classifySexpr(y);m==="simple"?this.simpleSexpr(y):m==="helper"?this.helperSexpr(y):this.ambiguousSexpr(y)},ambiguousSexpr:function(y,m,b){var k=y.path,w=k.parts[0],A=m!=null||b!=null;this.opcode("getContext",a(k)),this.opcode("pushProgram",m),this.opcode("pushProgram",b),k.strict=!0,this.accept(k),this.opcode("invokeAmbiguous",w,A)},simpleSexpr:function(y){var m=y.path;m.strict=!0,this.accept(m),this.opcode("resolvePossibleLambda")},helperSexpr:function(y,m,b){var k=this.setupFullMustacheParams(y,m,b),w=y.path,A=w.parts[0];if(this.options.knownHelpers[A])this.opcode("invokeKnownHelper",k.length,A);else{if(this.options.knownHelpersOnly)throw new s.default("You specified knownHelpersOnly, but used the unknown helper "+A,y);w.strict=!0,w.falsy=!0,this.accept(w),this.opcode("invokeHelper",k.length,w.original,i.default.helpers.simpleId(w))}},PathExpression:function(y){var m=a(y),b=p(y);this.addDepth(m),this.opcode("getContext",m);var k=b[0],w=i.default.helpers.scopedId(y),A=!m&&!w&&this.blockParamIndex(k);A?this.opcode("lookupBlockParam",A,b):k?y.data?(this.options.data=!0,this.opcode("lookupData",m,b,y.strict)):this.opcode("lookupOnContext",b,y.falsy,y.strict,w):this.opcode("pushContext")},StringLiteral:function(y){h(y),this.opcode("pushString",y.value)},NumberLiteral:function(y){h(y),this.opcode("pushLiteral",y.value)},BooleanLiteral:function(y){h(y),this.opcode("pushLiteral",y.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(y){var m=y.pairs,b=0,k=void 0;if(!r.isArray(m))throw u(y,"pairs must be an array");k=m.length;for(var w=0;w<k;w++)if(!m[w]||typeof m[w].key!="string")throw u(y,"pair keys must be strings");for(this.opcode("pushHash");b<k;b++)this.pushParam(m[b].value);for(;b--;)this.opcode("assignToHash",m[b].key);this.opcode("popHash")},opcode:function(y){this.opcodes.push({opcode:y,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(y){y&&(this.useDepths=!0)},classifySexpr:function(y){p(y.path);var m=i.default.helpers.simpleId(y.path),b=m&&!!this.blockParamIndex(y.path.parts[0]),k=!b&&i.default.helpers.helperExpression(y),w=!b&&(k||m);if(w&&!k){var A=y.path.parts[0],M=this.options;M.knownHelpers[A]?k=!0:M.knownHelpersOnly&&(w=!1)}return k?"helper":w?"ambiguous":"simple"},pushParams:function(y){for(var m=0,b=y.length;m<b;m++)this.pushParam(y[m])},pushParam:function(y){h(y);var m=y.value!=null?y.value:y.original||"",b=a(y);if(this.stringParams)typeof m!="number"&&typeof m!="boolean"&&(m=String(m)),m.replace&&(m=m.replace(/^(\\.?\\.\\/)*/g,"").replace(/\\//g,".")),b&&this.addDepth(b),this.opcode("getContext",b),this.opcode("pushStringParam",m,y.type),y.type==="SubExpression"&&this.accept(y);else{if(this.trackIds){var k=void 0;if(y.parts&&!i.default.helpers.scopedId(y)&&!b&&(k=this.blockParamIndex(p(y)[0])),k){var w=y.parts.slice(1).join(".");this.opcode("pushId","BlockParam",k,w)}else m=y.original||m,m.replace&&(m=m.replace(/^this(?:\\.|$)/,"").replace(/^\\.\\//,"").replace(/^\\.$/,"")),this.opcode("pushId",y.type,m)}this.accept(y)}},setupFullMustacheParams:function(y,m,b,k){var w=y.params;return this.pushParams(w),this.opcode("pushProgram",m),this.opcode("pushProgram",b),y.hash?this.accept(y.hash):this.opcode("emptyHash",k),w},blockParamIndex:function(y){for(var m=0,b=this.options.blockParams.length;m<b;m++){var k=this.options.blockParams[m],w=k&&r.indexOf(k,y);if(k&&w>=0)return[m,w]}}};function f(S,y,m){if(S==null||typeof S!="string"&&S.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+S);y=y||{},"data"in y||(y.data=!0),y.compat&&(y.useDepths=!0);var b=m.parse(S,y),k=new m.Compiler().compile(b,y);return new m.JavaScriptCompiler().compile(k,y)}function d(S,y,m){if(y===void 0&&(y={}),S==null||typeof S!="string"&&S.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+S);y=r.extend({},y),"data"in y||(y.data=!0),y.compat&&(y.useDepths=!0);var b=void 0;function k(){var A=m.parse(S,y),M=new m.Compiler().compile(A,y),L=new m.JavaScriptCompiler().compile(M,y,void 0,!0);return m.template(L)}function w(A,M){return b||(b=k()),b.call(this,A,M)}return w._setup=function(A){return b||(b=k()),b._setup(A)},w._child=function(A,M,L,R){return b||(b=k()),b._child(A,M,L,R)},w}function u(S,y){return new s.default("Invalid AST: "+S.type+" "+y,S)}function a(S){var y=S.depth;if(y==null)return 0;if(typeof y!="number"||!isFinite(y)||Math.floor(y)!==y||y<0)throw u(S,"depth must be a non-negative integer");return y}function h(S){var y=S.value;if(S.type==="StringLiteral"&&typeof y!="string")throw u(S,"value must be a string");if(S.type==="NumberLiteral"&&typeof y!="number")throw u(S,"value must be a number");if(S.type==="BooleanLiteral"&&typeof y!="boolean")throw u(S,"value must be a boolean")}function l(S,y,m){if(!r.isArray(y))throw u(S,m+" must be an array");for(var b=0;b<y.length;b++)if(typeof y[b]!="string")throw u(S,m+" must only contain strings");return y}function p(S){return l(S,S.parts,"parts")}function g(S){S.blockParams!=null&&l(S,S.blockParams,"blockParams")}function v(S,y){if(S===y)return!0;if(r.isArray(S)&&r.isArray(y)&&S.length===y.length){for(var m=0;m<S.length;m++)if(!v(S[m],y[m]))return!1;return!0}}function _(S){if(!S.path.parts){var y=S.path;S.path={type:"PathExpression",data:!1,depth:0,parts:[y.original+""],original:y.original+"",loc:y.loc}}}})),tc=he((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(s){if(0<=s&&s<t.length)return t[s];throw new TypeError("Must be between 0 and 63: "+s)},e.decode=function(s){var r=65,i=90,n=97,o=122,c=48,f=57,d=43,u=47,a=26,h=52;return r<=s&&s<=i?s-r:n<=s&&s<=o?s-n+a:c<=s&&s<=f?s-c+h:s==d?62:s==u?63:-1}})),Pn=he((e=>{var t=tc(),s=5,r=1<<s,i=r-1,n=r;function o(f){return f<0?(-f<<1)+1:(f<<1)+0}function c(f){var d=(f&1)===1,u=f>>1;return d?-u:u}e.encode=function(d){var u="",a,h=o(d);do a=h&i,h>>>=s,h>0&&(a|=n),u+=t.encode(a);while(h>0);return u},e.decode=function(d,u,a){var h=d.length,l=0,p=0,g,v;do{if(u>=h)throw new Error("Expected more digits in base 64 VLQ value.");if(v=t.decode(d.charCodeAt(u++)),v===-1)throw new Error("Invalid base64 digit: "+d.charAt(u-1));g=!!(v&n),v&=i,l=l+(v<<p),p+=s}while(g);a.value=c(l),a.rest=u}})),Os=he((e=>{function t(m,b,k){if(b in m)return m[b];if(arguments.length===3)return k;throw new Error(\'"\'+b+\'" is a required argument.\')}e.getArg=t;var s=/^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/,r=/^data:.+\\,.+$/;function i(m){var b=m.match(s);return b?{scheme:b[1],auth:b[2],host:b[3],port:b[4],path:b[5]}:null}e.urlParse=i;function n(m){var b="";return m.scheme&&(b+=m.scheme+":"),b+="//",m.auth&&(b+=m.auth+"@"),m.host&&(b+=m.host),m.port&&(b+=":"+m.port),m.path&&(b+=m.path),b}e.urlGenerate=n;function o(m){var b=m,k=i(m);if(k){if(!k.path)return m;b=k.path}for(var w=e.isAbsolute(b),A=b.split(/\\/+/),M,L=0,R=A.length-1;R>=0;R--)M=A[R],M==="."?A.splice(R,1):M===".."?L++:L>0&&(M===""?(A.splice(R+1,L),L=0):(A.splice(R,2),L--));return b=A.join("/"),b===""&&(b=w?"/":"."),k?(k.path=b,n(k)):b}e.normalize=o;function c(m,b){m===""&&(m="."),b===""&&(b=".");var k=i(b),w=i(m);if(w&&(m=w.path||"/"),k&&!k.scheme)return w&&(k.scheme=w.scheme),n(k);if(k||b.match(r))return b;if(w&&!w.host&&!w.path)return w.host=b,n(w);var A=b.charAt(0)==="/"?b:o(m.replace(/\\/+$/,"")+"/"+b);return w?(w.path=A,n(w)):A}e.join=c,e.isAbsolute=function(m){return m.charAt(0)==="/"||s.test(m)};function f(m,b){m===""&&(m="."),m=m.replace(/\\/$/,"");for(var k=0;b.indexOf(m+"/")!==0;){var w=m.lastIndexOf("/");if(w<0||(m=m.slice(0,w),m.match(/^([^\\/]+:\\/)?\\/*$/)))return b;++k}return Array(k+1).join("../")+b.substr(m.length+1)}e.relative=f;var d=(function(){return!("__proto__"in Object.create(null))})();function u(m){return m}function a(m){return l(m)?"$"+m:m}e.toSetString=d?u:a;function h(m){return l(m)?m.slice(1):m}e.fromSetString=d?u:h;function l(m){if(!m)return!1;var b=m.length;if(b<9||m.charCodeAt(b-1)!==95||m.charCodeAt(b-2)!==95||m.charCodeAt(b-3)!==111||m.charCodeAt(b-4)!==116||m.charCodeAt(b-5)!==111||m.charCodeAt(b-6)!==114||m.charCodeAt(b-7)!==112||m.charCodeAt(b-8)!==95||m.charCodeAt(b-9)!==95)return!1;for(var k=b-10;k>=0;k--)if(m.charCodeAt(k)!==36)return!1;return!0}function p(m,b,k){var w=v(m.source,b.source);return w!==0||(w=m.originalLine-b.originalLine,w!==0)||(w=m.originalColumn-b.originalColumn,w!==0||k)||(w=m.generatedColumn-b.generatedColumn,w!==0)||(w=m.generatedLine-b.generatedLine,w!==0)?w:v(m.name,b.name)}e.compareByOriginalPositions=p;function g(m,b,k){var w=m.generatedLine-b.generatedLine;return w!==0||(w=m.generatedColumn-b.generatedColumn,w!==0||k)||(w=v(m.source,b.source),w!==0)||(w=m.originalLine-b.originalLine,w!==0)||(w=m.originalColumn-b.originalColumn,w!==0)?w:v(m.name,b.name)}e.compareByGeneratedPositionsDeflated=g;function v(m,b){return m===b?0:m===null?1:b===null?-1:m>b?1:-1}function _(m,b){var k=m.generatedLine-b.generatedLine;return k!==0||(k=m.generatedColumn-b.generatedColumn,k!==0)||(k=v(m.source,b.source),k!==0)||(k=m.originalLine-b.originalLine,k!==0)||(k=m.originalColumn-b.originalColumn,k!==0)?k:v(m.name,b.name)}e.compareByGeneratedPositionsInflated=_;function S(m){return JSON.parse(m.replace(/^\\)]}\'[^\\n]*\\n/,""))}e.parseSourceMapInput=S;function y(m,b,k){if(b=b||"",m&&(m[m.length-1]!=="/"&&b[0]!=="/"&&(m+="/"),b=m+b),k){var w=i(k);if(!w)throw new Error("sourceMapURL could not be parsed");if(w.path){var A=w.path.lastIndexOf("/");A>=0&&(w.path=w.path.substring(0,A+1))}b=c(n(w),b)}return o(b)}e.computeSourceURL=y})),En=he((e=>{var t=Os(),s=Object.prototype.hasOwnProperty,r=typeof Map<"u";function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(o,c){for(var f=new i,d=0,u=o.length;d<u;d++)f.add(o[d],c);return f},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(o,c){var f=r?o:t.toSetString(o),d=r?this.has(o):s.call(this._set,f),u=this._array.length;(!d||c)&&this._array.push(o),d||(r?this._set.set(o,u):this._set[f]=u)},i.prototype.has=function(o){if(r)return this._set.has(o);var c=t.toSetString(o);return s.call(this._set,c)},i.prototype.indexOf=function(o){if(r){var c=this._set.get(o);if(c>=0)return c}else{var f=t.toSetString(o);if(s.call(this._set,f))return this._set[f]}throw new Error(\'"\'+o+\'" is not in the set.\')},i.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),sc=he((e=>{var t=Os();function s(i,n){var o=i.generatedLine,c=n.generatedLine,f=i.generatedColumn,d=n.generatedColumn;return c>o||c==o&&d>=f||t.compareByGeneratedPositionsInflated(i,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(n,o){this._array.forEach(n,o)},r.prototype.add=function(n){s(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),An=he((e=>{var t=Pn(),s=Os(),r=En().ArraySet,i=sc().MappingList;function n(o){o||(o={}),this._file=s.getArg(o,"file",null),this._sourceRoot=s.getArg(o,"sourceRoot",null),this._skipValidation=s.getArg(o,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(c){var f=c.sourceRoot,d=new n({file:c.file,sourceRoot:f});return c.eachMapping(function(u){var a={generated:{line:u.generatedLine,column:u.generatedColumn}};u.source!=null&&(a.source=u.source,f!=null&&(a.source=s.relative(f,a.source)),a.original={line:u.originalLine,column:u.originalColumn},u.name!=null&&(a.name=u.name)),d.addMapping(a)}),c.sources.forEach(function(u){var a=u;f!==null&&(a=s.relative(f,u)),d._sources.has(a)||d._sources.add(a);var h=c.sourceContentFor(u);h!=null&&d.setSourceContent(u,h)}),d},n.prototype.addMapping=function(c){var f=s.getArg(c,"generated"),d=s.getArg(c,"original",null),u=s.getArg(c,"source",null),a=s.getArg(c,"name",null);this._skipValidation||this._validateMapping(f,d,u,a),u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:f.line,generatedColumn:f.column,originalLine:d!=null&&d.line,originalColumn:d!=null&&d.column,source:u,name:a})},n.prototype.setSourceContent=function(c,f){var d=c;this._sourceRoot!=null&&(d=s.relative(this._sourceRoot,d)),f!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(d)]=f):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(d)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(c,f,d){var u=f;if(f==null){if(c.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.`);u=c.file}var a=this._sourceRoot;a!=null&&(u=s.relative(a,u));var h=new r,l=new r;this._mappings.unsortedForEach(function(p){if(p.source===u&&p.originalLine!=null){var g=c.originalPositionFor({line:p.originalLine,column:p.originalColumn});g.source!=null&&(p.source=g.source,d!=null&&(p.source=s.join(d,p.source)),a!=null&&(p.source=s.relative(a,p.source)),p.originalLine=g.line,p.originalColumn=g.column,g.name!=null&&(p.name=g.name))}var v=p.source;v!=null&&!h.has(v)&&h.add(v);var _=p.name;_!=null&&!l.has(_)&&l.add(_)},this),this._sources=h,this._names=l,c.sources.forEach(function(p){var g=c.sourceContentFor(p);g!=null&&(d!=null&&(p=s.join(d,p)),a!=null&&(p=s.relative(a,p)),this.setSourceContent(p,g))},this)},n.prototype._validateMapping=function(c,f,d,u){if(f&&typeof f.line!="number"&&typeof f.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(c&&"line"in c&&"column"in c&&c.line>0&&c.column>=0&&!f&&!d&&!u)){if(c&&"line"in c&&"column"in c&&f&&"line"in f&&"column"in f&&c.line>0&&c.column>=0&&f.line>0&&f.column>=0&&d)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:c,source:d,original:f,name:u}))}},n.prototype._serializeMappings=function(){for(var c=0,f=1,d=0,u=0,a=0,h=0,l="",p,g,v,_,S=this._mappings.toArray(),y=0,m=S.length;y<m;y++){if(g=S[y],p="",g.generatedLine!==f)for(c=0;g.generatedLine!==f;)p+=";",f++;else if(y>0){if(!s.compareByGeneratedPositionsInflated(g,S[y-1]))continue;p+=","}p+=t.encode(g.generatedColumn-c),c=g.generatedColumn,g.source!=null&&(_=this._sources.indexOf(g.source),p+=t.encode(_-h),h=_,p+=t.encode(g.originalLine-1-u),u=g.originalLine-1,p+=t.encode(g.originalColumn-d),d=g.originalColumn,g.name!=null&&(v=this._names.indexOf(g.name),p+=t.encode(v-a),a=v)),l+=p}return l},n.prototype._generateSourcesContent=function(c,f){return c.map(function(d){if(!this._sourcesContents)return null;f!=null&&(d=s.relative(f,d));var u=s.toSetString(d);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},n.prototype.toJSON=function(){var c={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(c.file=this._file),this._sourceRoot!=null&&(c.sourceRoot=this._sourceRoot),this._sourcesContents&&(c.sourcesContent=this._generateSourcesContent(c.sources,c.sourceRoot)),c},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=n})),rc=he((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(s,r,i,n,o,c){var f=Math.floor((r-s)/2)+s,d=o(i,n[f],!0);return d===0?f:d>0?r-f>1?t(f,r,i,n,o,c):c==e.LEAST_UPPER_BOUND?r<n.length?r:-1:f:f-s>1?t(s,f,i,n,o,c):c==e.LEAST_UPPER_BOUND?f:s<0?-1:s}e.search=function(r,i,n,o){if(i.length===0)return-1;var c=t(-1,i.length,r,i,n,o||e.GREATEST_LOWER_BOUND);if(c<0)return-1;for(;c-1>=0&&n(i[c],i[c-1],!0)===0;)--c;return c}})),ic=he((e=>{function t(i,n,o){var c=i[n];i[n]=i[o],i[o]=c}function s(i,n){return Math.round(i+Math.random()*(n-i))}function r(i,n,o,c){if(o<c){var f=s(o,c),d=o-1;t(i,f,c);for(var u=i[c],a=o;a<c;a++)n(i[a],u)<=0&&(d+=1,t(i,d,a));t(i,d+1,a);var h=d+1;r(i,n,o,h-1),r(i,n,h+1,c)}}e.quickSort=function(i,n){r(i,n,0,i.length-1)}})),nc=he((e=>{var t=Os(),s=rc(),r=En().ArraySet,i=Pn(),n=ic().quickSort;function o(u,a){var h=u;return typeof u=="string"&&(h=t.parseSourceMapInput(u)),h.sections!=null?new d(h,a):new c(h,a)}o.fromSourceMap=function(u,a){return c.fromSourceMap(u,a)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,h){var l=a.charAt(h);return l===";"||l===","},o.prototype._parseMappings=function(a,h){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,h,l){var p=h||null,g=l||o.GENERATED_ORDER,v;switch(g){case o.GENERATED_ORDER:v=this._generatedMappings;break;case o.ORIGINAL_ORDER:v=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var _=this.sourceRoot;v.map(function(S){var y=S.source===null?null:this._sources.at(S.source);return y=t.computeSourceURL(_,y,this._sourceMapURL),{source:y,generatedLine:S.generatedLine,generatedColumn:S.generatedColumn,originalLine:S.originalLine,originalColumn:S.originalColumn,name:S.name===null?null:this._names.at(S.name)}},this).forEach(a,p)},o.prototype.allGeneratedPositionsFor=function(a){var h=t.getArg(a,"line"),l={source:t.getArg(a,"source"),originalLine:h,originalColumn:t.getArg(a,"column",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var p=[],g=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(g>=0){var v=this._originalMappings[g];if(a.column===void 0)for(var _=v.originalLine;v&&v.originalLine===_;)p.push({line:t.getArg(v,"generatedLine",null),column:t.getArg(v,"generatedColumn",null),lastColumn:t.getArg(v,"lastGeneratedColumn",null)}),v=this._originalMappings[++g];else for(var S=v.originalColumn;v&&v.originalLine===h&&v.originalColumn==S;)p.push({line:t.getArg(v,"generatedLine",null),column:t.getArg(v,"generatedColumn",null),lastColumn:t.getArg(v,"lastGeneratedColumn",null)}),v=this._originalMappings[++g]}return p},e.SourceMapConsumer=o;function c(u,a){var h=u;typeof u=="string"&&(h=t.parseSourceMapInput(u));var l=t.getArg(h,"version"),p=t.getArg(h,"sources"),g=t.getArg(h,"names",[]),v=t.getArg(h,"sourceRoot",null),_=t.getArg(h,"sourcesContent",null),S=t.getArg(h,"mappings"),y=t.getArg(h,"file",null);if(l!=this._version)throw new Error("Unsupported version: "+l);v&&(v=t.normalize(v)),p=p.map(String).map(t.normalize).map(function(m){return v&&t.isAbsolute(v)&&t.isAbsolute(m)?t.relative(v,m):m}),this._names=r.fromArray(g.map(String),!0),this._sources=r.fromArray(p,!0),this._absoluteSources=this._sources.toArray().map(function(m){return t.computeSourceURL(v,m,a)}),this.sourceRoot=v,this.sourcesContent=_,this._mappings=S,this._sourceMapURL=a,this.file=y}c.prototype=Object.create(o.prototype),c.prototype.consumer=o,c.prototype._findSourceIndex=function(u){var a=u;if(this.sourceRoot!=null&&(a=t.relative(this.sourceRoot,a)),this._sources.has(a))return this._sources.indexOf(a);for(var h=0;h<this._absoluteSources.length;++h)if(this._absoluteSources[h]==u)return h;return-1},c.fromSourceMap=function(a,h){var l=Object.create(c.prototype),p=l._names=r.fromArray(a._names.toArray(),!0),g=l._sources=r.fromArray(a._sources.toArray(),!0);l.sourceRoot=a._sourceRoot,l.sourcesContent=a._generateSourcesContent(l._sources.toArray(),l.sourceRoot),l.file=a._file,l._sourceMapURL=h,l._absoluteSources=l._sources.toArray().map(function(w){return t.computeSourceURL(l.sourceRoot,w,h)});for(var v=a._mappings.toArray().slice(),_=l.__generatedMappings=[],S=l.__originalMappings=[],y=0,m=v.length;y<m;y++){var b=v[y],k=new f;k.generatedLine=b.generatedLine,k.generatedColumn=b.generatedColumn,b.source&&(k.source=g.indexOf(b.source),k.originalLine=b.originalLine,k.originalColumn=b.originalColumn,b.name&&(k.name=p.indexOf(b.name)),S.push(k)),_.push(k)}return n(l.__originalMappings,t.compareByOriginalPositions),l},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function f(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}c.prototype._parseMappings=function(a,h){for(var l=1,p=0,g=0,v=0,_=0,S=0,y=a.length,m=0,b={},k={},w=[],A=[],M,L,R,E,q;m<y;)if(a.charAt(m)===";")l++,m++,p=0;else if(a.charAt(m)===",")m++;else{for(M=new f,M.generatedLine=l,E=m;E<y&&!this._charIsMappingSeparator(a,E);E++);if(L=a.slice(m,E),R=b[L],R)m+=L.length;else{for(R=[];m<E;)i.decode(a,m,k),q=k.value,m=k.rest,R.push(q);if(R.length===2)throw new Error("Found a source, but no line and column");if(R.length===3)throw new Error("Found a source and line, but no column");b[L]=R}M.generatedColumn=p+R[0],p=M.generatedColumn,R.length>1&&(M.source=_+R[1],_+=R[1],M.originalLine=g+R[2],g=M.originalLine,M.originalLine+=1,M.originalColumn=v+R[3],v=M.originalColumn,R.length>4&&(M.name=S+R[4],S+=R[4])),A.push(M),typeof M.originalLine=="number"&&w.push(M)}n(A,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,n(w,t.compareByOriginalPositions),this.__originalMappings=w},c.prototype._findMapping=function(a,h,l,p,g,v){if(a[l]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[l]);if(a[p]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[p]);return s.search(a,h,g,v)},c.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var h=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var l=this._generatedMappings[a+1];if(h.generatedLine===l.generatedLine){h.lastGeneratedColumn=l.generatedColumn-1;continue}}h.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(a){var h={generatedLine:t.getArg(a,"line"),generatedColumn:t.getArg(a,"column")},l=this._findMapping(h,this._generatedMappings,"generatedLine","generatedColumn",t.compareByGeneratedPositionsDeflated,t.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(l>=0){var p=this._generatedMappings[l];if(p.generatedLine===h.generatedLine){var g=t.getArg(p,"source",null);g!==null&&(g=this._sources.at(g),g=t.computeSourceURL(this.sourceRoot,g,this._sourceMapURL));var v=t.getArg(p,"name",null);return v!==null&&(v=this._names.at(v)),{source:g,line:t.getArg(p,"originalLine",null),column:t.getArg(p,"originalColumn",null),name:v}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},c.prototype.sourceContentFor=function(a,h){if(!this.sourcesContent)return null;var l=this._findSourceIndex(a);if(l>=0)return this.sourcesContent[l];var p=a;this.sourceRoot!=null&&(p=t.relative(this.sourceRoot,p));var g;if(this.sourceRoot!=null&&(g=t.urlParse(this.sourceRoot))){var v=p.replace(/^file:\\/\\//,"");if(g.scheme=="file"&&this._sources.has(v))return this.sourcesContent[this._sources.indexOf(v)];if((!g.path||g.path=="/")&&this._sources.has("/"+p))return this.sourcesContent[this._sources.indexOf("/"+p)]}if(h)return null;throw new Error(\'"\'+p+\'" is not in the SourceMap.\')},c.prototype.generatedPositionFor=function(a){var h=t.getArg(a,"source");if(h=this._findSourceIndex(h),h<0)return{line:null,column:null,lastColumn:null};var l={source:h,originalLine:t.getArg(a,"line"),originalColumn:t.getArg(a,"column")},p=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,t.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(p>=0){var g=this._originalMappings[p];if(g.source===l.source)return{line:t.getArg(g,"generatedLine",null),column:t.getArg(g,"generatedColumn",null),lastColumn:t.getArg(g,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=c;function d(u,a){var h=u;typeof u=="string"&&(h=t.parseSourceMapInput(u));var l=t.getArg(h,"version"),p=t.getArg(h,"sections");if(l!=this._version)throw new Error("Unsupported version: "+l);this._sources=new r,this._names=new r;var g={line:-1,column:0};this._sections=p.map(function(v){if(v.url)throw new Error("Support for url field in sections not implemented.");var _=t.getArg(v,"offset"),S=t.getArg(_,"line"),y=t.getArg(_,"column");if(S<g.line||S===g.line&&y<g.column)throw new Error("Section offsets must be ordered and non-overlapping.");return g=_,{generatedOffset:{generatedLine:S+1,generatedColumn:y+1},consumer:new o(t.getArg(v,"map"),a)}})}d.prototype=Object.create(o.prototype),d.prototype.constructor=o,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var u=[],a=0;a<this._sections.length;a++)for(var h=0;h<this._sections[a].consumer.sources.length;h++)u.push(this._sections[a].consumer.sources[h]);return u}}),d.prototype.originalPositionFor=function(a){var h={generatedLine:t.getArg(a,"line"),generatedColumn:t.getArg(a,"column")},l=s.search(h,this._sections,function(g,v){var _=g.generatedLine-v.generatedOffset.generatedLine;return _||g.generatedColumn-v.generatedOffset.generatedColumn}),p=this._sections[l];return p?p.consumer.originalPositionFor({line:h.generatedLine-(p.generatedOffset.generatedLine-1),column:h.generatedColumn-(p.generatedOffset.generatedLine===h.generatedLine?p.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},d.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},d.prototype.sourceContentFor=function(a,h){for(var l=0;l<this._sections.length;l++){var p=this._sections[l].consumer.sourceContentFor(a,!0);if(p)return p}if(h)return null;throw new Error(\'"\'+a+\'" is not in the SourceMap.\')},d.prototype.generatedPositionFor=function(a){for(var h=0;h<this._sections.length;h++){var l=this._sections[h];if(l.consumer._findSourceIndex(t.getArg(a,"source"))!==-1){var p=l.consumer.generatedPositionFor(a);if(p)return{line:p.line+(l.generatedOffset.generatedLine-1),column:p.column+(l.generatedOffset.generatedLine===p.line?l.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},d.prototype._parseMappings=function(a,h){this.__generatedMappings=[],this.__originalMappings=[];for(var l=0;l<this._sections.length;l++)for(var p=this._sections[l],g=p.consumer._generatedMappings,v=0;v<g.length;v++){var _=g[v],S=p.consumer._sources.at(_.source);S=t.computeSourceURL(p.consumer.sourceRoot,S,this._sourceMapURL),this._sources.add(S),S=this._sources.indexOf(S);var y=null;_.name&&(y=p.consumer._names.at(_.name),this._names.add(y),y=this._names.indexOf(y));var m={source:S,generatedLine:_.generatedLine+(p.generatedOffset.generatedLine-1),generatedColumn:_.generatedColumn+(p.generatedOffset.generatedLine===_.generatedLine?p.generatedOffset.generatedColumn-1:0),originalLine:_.originalLine,originalColumn:_.originalColumn,name:y};this.__generatedMappings.push(m),typeof m.originalLine=="number"&&this.__originalMappings.push(m)}n(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),n(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=d})),oc=he((e=>{var t=An().SourceMapGenerator,s=Os(),r=/(\\r?\\n)/,i=10,n="$$$isSourceNode$$$";function o(c,f,d,u,a){this.children=[],this.sourceContents={},this.line=c??null,this.column=f??null,this.source=d??null,this.name=a??null,this[n]=!0,u!=null&&this.add(u)}o.fromStringWithSourceMap=function(f,d,u){var a=new o,h=f.split(r),l=0,p=function(){return y()+(y()||"");function y(){return l<h.length?h[l++]:void 0}},g=1,v=0,_=null;return d.eachMapping(function(y){if(_!==null)if(g<y.generatedLine)S(_,p()),g++,v=0;else{var m=h[l]||"",b=m.substr(0,y.generatedColumn-v);h[l]=m.substr(y.generatedColumn-v),v=y.generatedColumn,S(_,b),_=y;return}for(;g<y.generatedLine;)a.add(p()),g++;if(v<y.generatedColumn){var m=h[l]||"";a.add(m.substr(0,y.generatedColumn)),h[l]=m.substr(y.generatedColumn),v=y.generatedColumn}_=y},this),l<h.length&&(_&&S(_,p()),a.add(h.splice(l).join(""))),d.sources.forEach(function(y){var m=d.sourceContentFor(y);m!=null&&(u!=null&&(y=s.join(u,y)),a.setSourceContent(y,m))}),a;function S(y,m){if(y===null||y.source===void 0)a.add(m);else{var b=u?s.join(u,y.source):y.source;a.add(new o(y.originalLine,y.originalColumn,b,m,y.name))}}},o.prototype.add=function(f){if(Array.isArray(f))f.forEach(function(d){this.add(d)},this);else if(f[n]||typeof f=="string")f&&this.children.push(f);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+f);return this},o.prototype.prepend=function(f){if(Array.isArray(f))for(var d=f.length-1;d>=0;d--)this.prepend(f[d]);else if(f[n]||typeof f=="string")this.children.unshift(f);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+f);return this},o.prototype.walk=function(f){for(var d,u=0,a=this.children.length;u<a;u++)d=this.children[u],d[n]?d.walk(f):d!==""&&f(d,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(f){var d,u,a=this.children.length;if(a>0){for(d=[],u=0;u<a-1;u++)d.push(this.children[u]),d.push(f);d.push(this.children[u]),this.children=d}return this},o.prototype.replaceRight=function(f,d){var u=this.children[this.children.length-1];return u[n]?u.replaceRight(f,d):typeof u=="string"?this.children[this.children.length-1]=u.replace(f,d):this.children.push("".replace(f,d)),this},o.prototype.setSourceContent=function(f,d){this.sourceContents[s.toSetString(f)]=d},o.prototype.walkSourceContents=function(f){for(var d=0,u=this.children.length;d<u;d++)this.children[d][n]&&this.children[d].walkSourceContents(f);for(var a=Object.keys(this.sourceContents),d=0,u=a.length;d<u;d++)f(s.fromSetString(a[d]),this.sourceContents[a[d]])},o.prototype.toString=function(){var f="";return this.walk(function(d){f+=d}),f},o.prototype.toStringWithSourceMap=function(f){var d={code:"",line:1,column:0},u=new t(f),a=!1,h=null,l=null,p=null,g=null;return this.walk(function(v,_){d.code+=v,_.source!==null&&_.line!==null&&_.column!==null?((h!==_.source||l!==_.line||p!==_.column||g!==_.name)&&u.addMapping({source:_.source,original:{line:_.line,column:_.column},generated:{line:d.line,column:d.column},name:_.name}),h=_.source,l=_.line,p=_.column,g=_.name,a=!0):a&&(u.addMapping({generated:{line:d.line,column:d.column}}),h=null,a=!1);for(var S=0,y=v.length;S<y;S++)v.charCodeAt(S)===i?(d.line++,d.column=0,S+1===y?(h=null,a=!1):a&&u.addMapping({source:_.source,original:{line:_.line,column:_.column},generated:{line:d.line,column:d.column},name:_.name})):d.column++}),this.walkSourceContents(function(v,_){u.setSourceContent(v,_)}),{code:d.code,map:u}},e.SourceNode=o})),ac=he((e=>{e.SourceMapGenerator=An().SourceMapGenerator,e.SourceMapConsumer=nc().SourceMapConsumer,e.SourceNode=oc().SourceNode})),lc=he((e=>{e.__esModule=!0,e.safeJsonLiteral=o;var t=st(),s=/[\\x00-\\x1f\\\\"\\u2028\\u2029<\\ud800-\\udfff]/,r=/<(?=!--|\\/?script)/gi;function i(u){return u.replace(r,"\\\\u003C")}function n(u){return"\\\\u"+u.charCodeAt(0).toString(16)}function o(u){return i(JSON.stringify(u).replace(/\\u2028/g,"\\\\u2028").replace(/\\u2029/g,"\\\\u2029").replace(/[\\ud800-\\udfff]/g,n))}var c=void 0;try{(typeof define!="function"||!define.amd)&&(c=ac().SourceNode)}catch{}c||(c=function(u,a,h,l){this.src="",l&&this.add(l)},c.prototype={add:function(a){t.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){t.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function f(u,a,h){if(t.isArray(u)){for(var l=[],p=0,g=u.length;p<g;p++)l.push(a.wrap(u[p],h));return l}else if(typeof u=="boolean"||typeof u=="number")return u+"";return u}function d(u){this.srcFile=u,this.source=[]}d.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,h){this.source.unshift(this.wrap(a,h))},push:function(a,h){this.source.push(this.wrap(a,h))},merge:function(){var a=this.empty();return this.each(function(h){a.add([" ",h,`\n`])}),a},each:function(a){for(var h=0,l=this.source.length;h<l;h++)a(this.source[h])},empty:function(){var a=this.currentLocation||{start:{}};return new c(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var h=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return a instanceof c?a:(a=f(a,this,h),new c(h.start.line,h.start.column,this.srcFile,a))},functionCall:function(a,h,l){return l=this.generateList(l),this.wrap([a,h?"."+h+"(":"(",l,")"])},quotedString:function(a){return a=a+"",s.test(a)?o(a):\'"\'+a+\'"\'},objectLiteral:function(a){var h=this,l=[];Object.keys(a).forEach(function(g){var v=f(a[g],h);v!=="undefined"&&l.push([h.quotedString(g),":",v])});var p=this.generateList(l);return p.prepend("{"),p.add("}"),p},generateList:function(a){for(var h=this.empty(),l=0,p=a.length;l<p;l++)l&&h.add(","),h.add(f(a[l],this));return h},generateArray:function(a){var h=this.generateList(a);return h.prepend("["),h.add("]"),h}},e.default=d})),cc=he(((e,t)=>{e.__esModule=!0;function s(h){return h&&h.__esModule?h:{default:h}}var r=si(),i=s(wt()),n=st(),o=lc(),c=s(o);function f(h){this.value=h}function d(){}d.prototype={nameLookup:function(l,p){return this.internalNameLookup(l,p)},depthedLookup:function(l){return[this.aliasable("container.lookup"),"(depths, ",this.quotedString(l),")"]},compilerInfo:function(){var l=r.COMPILER_REVISION;return[l,r.REVISION_CHANGES[l]]},appendToBuffer:function(l,p,g){return n.isArray(l)||(l=[l]),l=this.source.wrap(l,p),this.environment.isSimple?["return ",l,";"]:g?["buffer += ",l,";"]:(l.appendToBuffer=!0,l)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(l,p){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",l,",",this.quotedString(p),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(l,p,g,v){this.environment=l,this.options=p,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!v,this.name=this.environment.name,this.isChild=!!g,this.context=g||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(l,p),this.useDepths=this.useDepths||l.useDepths||l.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||l.useBlockParams;var _=l.opcodes,S=void 0,y=void 0,m=void 0,b=void 0;for(m=0,b=_.length;m<b;m++)S=_[m],this.source.currentLocation=S.loc,y=y||S.loc,this[S.opcode].apply(this,S.args);if(this.source.currentLocation=y,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;\n`]),this.decorators.push("return fn;"),v?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {\n`),this.decorators.push(`}\n`),this.decorators=this.decorators.merge()));var k=this.createFunctionContext(v);if(this.isChild)return k;var w={compiler:this.compilerInfo(),main:k};this.decorators&&(w.main_d=this.decorators,w.useDecorators=!0);var A=this.context,M=A.programs,L=A.decorators;for(m=0,b=M.length;m<b;m++)w[m]=M[m],L[m]&&(w[m+"_d"]=L[m],w.useDecorators=!0);return this.environment.usePartial&&(w.usePartial=!0),this.options.data&&(w.useData=!0),this.useDepths&&(w.useDepths=!0),this.useBlockParams&&(w.useBlockParams=!0),this.options.compat&&(w.compat=!0),v?w.compilerOptions=this.options:(w.compiler=JSON.stringify(w.compiler),this.source.currentLocation={start:{line:1,column:0}},w=this.objectLiteral(w),p.srcName?(w=w.toStringWithSourceMap({file:p.destName}),w.map=w.map&&w.map.toString()):w=w.toString()),w},preamble:function(){this.lastContext=0,this.source=new c.default(this.options.srcName),this.decorators=new c.default(this.options.srcName)},createFunctionContext:function(l){var p=this,g="",v=this.stackVars.concat(this.registers.list);v.length>0&&(g+=", "+v.join(", "));var _=0;Object.keys(this.aliases).forEach(function(m){var b=p.aliases[m];b.children&&b.referenceCount>1&&(g+=", alias"+ ++_+"="+m,b.children[0]="alias"+_)}),this.lookupPropertyFunctionIsUsed&&(g+=", "+this.lookupPropertyFunctionVarDeclaration());var S=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&S.push("blockParams"),this.useDepths&&S.push("depths");var y=this.mergeSource(g);return l?(S.push(y),Function.apply(this,S)):this.source.wrap(["function(",S.join(","),`) {\n `,y,"}"])},mergeSource:function(l){var p=this.environment.isSimple,g=!this.forceBuffer,v=void 0,_=void 0,S=void 0,y=void 0;return this.source.each(function(m){m.appendToBuffer?(S?m.prepend(" + "):S=m,y=m):(S&&(_?S.prepend("buffer += "):v=!0,y.add(";"),S=y=void 0),_=!0,p||(g=!1))}),g?S?(S.prepend("return "),y.add(";")):_||this.source.push(\'return "";\'):(l+=", buffer = "+(v?"":this.initializeBuffer()),S?(S.prepend("return buffer + "),y.add(";")):this.source.push("return buffer;")),l&&this.source.prepend("var "+l.substring(2)+(v?"":`;\n`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n `.trim()},blockValue:function(l){var p=this.aliasable("container.hooks.blockHelperMissing"),g=[this.contextName(0)];this.setupHelperArgs(l,0,g);var v=this.popStack();g.splice(1,0,v),this.push(this.source.functionCall(p,"call",g))},ambiguousBlockValue:function(){var l=this.aliasable("container.hooks.blockHelperMissing"),p=[this.contextName(0)];this.setupHelperArgs("",0,p,!0),this.flushInline();var g=this.topStack();p.splice(1,0,g),this.pushSource(["if (!",this.lastHelper,") { ",g," = ",this.source.functionCall(l,"call",p),"}"])},appendContent:function(l){this.pendingContent?l=this.pendingContent+l:this.pendingLocation=this.source.currentLocation,this.pendingContent=l},append:function(){if(this.isInline())this.replaceStack(function(p){return[" != null ? ",p,\' : ""\']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var l=this.popStack();this.pushSource(["if (",l," != null) { ",this.appendToBuffer(l,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("\'\'",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(l){this.lastContext=l},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(l,p,g,v){var _=0;!v&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(l[_++])):this.pushContext(),this.resolvePath("context",l,_,p,g)},lookupBlockParam:function(l,p){this.useBlockParams=!0,this.push(["blockParams[",l[0],"][",l[1],"]"]),this.resolvePath("context",p,1)},lookupData:function(l,p,g){l?this.pushStackLiteral("container.data(data, "+l+")"):this.pushStackLiteral("data"),this.resolvePath("data",p,0,!0,g)},resolvePath:function(l,p,g,v,_){var S=this;if(this.options.strict||this.options.assumeObjects){this.push(a(this.options.strict&&_,this,p,g,l));return}for(var y=p.length,m=function(k){S.replaceStack(function(w){var A=S.nameLookup(w,p[k],l);return v?[" && ",A]:[" != null ? ",A," : ",w]})},b=g;b<y;b++)m(b)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(l,p){this.pushContext(),this.pushString(p),p!=="SubExpression"&&(typeof l=="string"?this.pushString(l):this.pushStackLiteral(l))},emptyHash:function(l){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(l?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var l=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(l.ids)),this.stringParams&&(this.push(this.objectLiteral(l.contexts)),this.push(this.objectLiteral(l.types))),this.push(this.objectLiteral(l.values))},pushString:function(l){this.pushStackLiteral(this.quotedString(l))},pushLiteral:function(l){this.pushStackLiteral(l)},pushProgram:function(l){l!=null?this.pushStackLiteral(this.programExpression(l)):this.pushStackLiteral(null)},registerDecorator:function(l,p){var g=this.nameLookup("decorators",p,"decorator"),v=this.setupHelperArgs(p,l);this.decorators.push(["var decorator = ",g,";"]),this.decorators.push([\'if (typeof decorator !== "function") { throw new Error(\',this.quotedString(\'Missing decorator: "\'+p+\'"\'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",v])," || fn;"])},invokeHelper:function(l,p,g){var v=this.popStack(),_=this.setupHelper(l,p),S=[];g&&S.push(_.name),S.push(v),this.options.strict||S.push(this.aliasable("container.hooks.helperMissing"));var y=["(",this.itemsSeparatedBy(S,"||"),")"],m=this.source.functionCall(y,"call",_.callParams);this.push(m)},itemsSeparatedBy:function(l,p){var g=[];g.push(l[0]);for(var v=1;v<l.length;v++)g.push(p,l[v]);return g},invokeKnownHelper:function(l,p){var g=this.setupHelper(l,p);this.push(this.source.functionCall(g.name,"call",g.callParams))},invokeAmbiguous:function(l,p){this.useRegister("helper");var g=this.popStack();this.emptyHash();var v=this.setupHelper(0,l,p),_=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",l,"helper")," || ",g,")"];this.options.strict||(_[0]="(helper = ",_.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",_,v.paramsInit?["),(",v.paramsInit]:[],"),","(typeof helper === ",this.aliasable(\'"function"\')," ? ",this.source.functionCall("helper","call",v.callParams)," : helper))"])},invokePartial:function(l,p,g){var v=[],_=this.setupParams(p,1,v);l&&(p=this.popStack(),delete _.name),g&&(_.indent=this.quotedString(g)),_.helpers="helpers",_.partials="partials",_.decorators="container.decorators",l?v.unshift(p):v.unshift(this.nameLookup("partials",p,"partial")),this.options.compat&&(_.depths="depths"),_=this.objectLiteral(_),v.push(_),this.push(this.source.functionCall("container.invokePartial","",v))},assignToHash:function(l){var p=this.popStack(),g=void 0,v=void 0,_=void 0;this.trackIds&&(_=this.popStack()),this.stringParams&&(v=this.popStack(),g=this.popStack());var S=this.hash;g&&(S.contexts[l]=g),v&&(S.types[l]=v),_&&(S.ids[l]=_),S.values[l]=p},pushId:function(l,p,g){l==="BlockParam"?this.pushStackLiteral("blockParams["+p[0]+"].path["+p[1]+"]"+(g?" + "+this.quotedString("."+g):"")):l==="PathExpression"?this.pushString(p):l==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:d,compileChildren:function(l,p){for(var g=l.children,v=void 0,_=void 0,S=0,y=g.length;S<y;S++){v=g[S],_=new this.compiler;var m=this.matchExistingProgram(v);if(m==null){var b=this.context.programs.push("")-1;v.index=b,v.name="program"+b,this.context.programs[b]=_.compile(v,p,this.context,!this.precompile),this.context.decorators[b]=_.decorators,this.context.environments[b]=v,this.useDepths=this.useDepths||_.useDepths,this.useBlockParams=this.useBlockParams||_.useBlockParams,v.useDepths=this.useDepths,v.useBlockParams=this.useBlockParams}else v.index=m.index,v.name="program"+m.index,this.useDepths=this.useDepths||m.useDepths,this.useBlockParams=this.useBlockParams||m.useBlockParams}},matchExistingProgram:function(l){for(var p=0,g=this.context.environments.length;p<g;p++){var v=this.context.environments[p];if(v&&v.equals(l))return v}},programExpression:function(l){var p=this.environment.children[l],g=[p.index,"data",p.blockParams];return(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths"),"container.program("+g.join(", ")+")"},useRegister:function(l){this.registers[l]||(this.registers[l]=!0,this.registers.list.push(l))},push:function(l){return l instanceof f||(l=this.source.wrap(l)),this.inlineStack.push(l),l},pushStackLiteral:function(l){this.push(new f(l))},pushSource:function(l){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),l&&this.source.push(l)},replaceStack:function(l){var p=["("],g=void 0,v=void 0,_=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var S=this.popStack(!0);if(S instanceof f)g=[S.value],p=["(",g],_=!0;else{v=!0;var y=this.incrStack();p=["((",this.push(y)," = ",S,")"],g=this.topStack()}var m=l.call(this,g);_||this.popStack(),v&&this.stackSlot--,this.push(p.concat(m,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var l=this.inlineStack;this.inlineStack=[];for(var p=0,g=l.length;p<g;p++){var v=l[p];if(v instanceof f)this.compileStack.push(v);else{var _=this.incrStack();this.pushSource([_," = ",v,";"]),this.compileStack.push(_)}}},isInline:function(){return this.inlineStack.length},popStack:function(l){var p=this.isInline(),g=(p?this.inlineStack:this.compileStack).pop();if(!l&&g instanceof f)return g.value;if(!p){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return g},topStack:function(){var l=this.isInline()?this.inlineStack:this.compileStack,p=l[l.length-1];return p instanceof f?p.value:p},contextName:function(l){return this.useDepths&&l?"depths["+l+"]":"depth"+l},quotedString:function(l){return this.source.quotedString(l)},objectLiteral:function(l){return this.source.objectLiteral(l)},aliasable:function(l){var p=this.aliases[l];return p?(p.referenceCount++,p):(p=this.aliases[l]=this.source.wrap(l),p.aliasable=!0,p.referenceCount=1,p)},setupHelper:function(l,p,g){var v=[];return{params:v,paramsInit:this.setupHelperArgs(p,l,v,g),name:this.nameLookup("helpers",p,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(v)}},setupParams:function(l,p,g){var v={},_=[],S=[],y=[],m=!g,b=void 0;m&&(g=[]),v.name=this.quotedString(l),v.hash=this.popStack(),this.trackIds&&(v.hashIds=this.popStack()),this.stringParams&&(v.hashTypes=this.popStack(),v.hashContexts=this.popStack());var k=this.popStack(),w=this.popStack();(w||k)&&(v.fn=w||"container.noop",v.inverse=k||"container.noop");for(var A=p;A--;)b=this.popStack(),g[A]=b,this.trackIds&&(y[A]=this.popStack()),this.stringParams&&(S[A]=this.popStack(),_[A]=this.popStack());return m&&(v.args=this.source.generateArray(g)),this.trackIds&&(v.ids=this.source.generateArray(y)),this.stringParams&&(v.types=this.source.generateArray(S),v.contexts=this.source.generateArray(_)),this.options.data&&(v.data="data"),this.useBlockParams&&(v.blockParams="blockParams"),v},setupHelperArgs:function(l,p,g,v){var _=this.setupParams(l,p,g);return _.loc=u(this),_=this.objectLiteral(_),v?(this.useRegister("options"),g.push("options"),["options=",_]):g?(g.push(_),""):_}},(function(){for(var h="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),l=d.RESERVED_WORDS={},p=0,g=h.length;p<g;p++)l[h[p]]=!0})(),d.isValidJavaScriptVariableName=function(h){return!d.RESERVED_WORDS[h]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(h)};function u(h){var l=h.source.currentLocation;return l?o.safeJsonLiteral(l):"undefined"}function a(h,l,p,g,v){var _=l.popStack(),S=p.length;h&&S--;for(var y=g;y<S;y++)_=l.nameLookup(_,p[y],v);return h?[l.aliasable("container.strict"),"(",_,", ",l.quotedString(p[S]),", ",u(l)," )"]:_}e.default=d,t.exports=e.default})),uc=he(((e,t)=>{e.__esModule=!0;function s(l){return l&&l.__esModule?l:{default:l}}var r=s(Zl()),i=s(xn()),n=Kl(),o=ec(),c=s(cc()),f=s(Cn()),d=s(wn()),u=r.default.create;function a(){var l=u();return l.compile=function(p,g){return o.compile(p,g,l)},l.precompile=function(p,g){return o.precompile(p,g,l)},l.AST=i.default,l.Compiler=o.Compiler,l.JavaScriptCompiler=c.default,l.Parser=n.parser,l.parse=n.parse,l.parseWithoutProcessing=n.parseWithoutProcessing,l}var h=a();h.create=a,d.default(h),h.Visitor=f.default,h.default=h,e.default=h,t.exports=e.default})),je=Aa(uc(),1),ri={"=":"eq","==":"eq","!=":"ne",">":"gt","<":"lt",">=":"gte","<=":"lte"},hc={"+":"add","-":"sub","*":"mul","/":"div","%":"mod"},dc=["==","!=",">=","<=","&&","||","=",">","<","!","+","*","%","-","/"],fc=["and","or","not"],Ln=["true","false","null","undefined"],pc=new Set([...` \\r\n!"\'()<>=&|{}~+*%`]),ii=/^-?\\d+(\\.\\d+)?$/,Je=class extends Error{};function gc(e){const t=[];let s=0;for(;s<e.length;){const r=e[s];if(/\\s/.test(r)){s++;continue}if(r==="("||r===")"){t.push({type:r,text:r}),s++;continue}if(r===\'"\'||r==="\'"){let c=s+1;for(;c<e.length&&e[c]!==r;)e[c]==="\\\\"&&c++,c++;if(c>=e.length)throw new Je("unterminated string");t.push({type:"value",text:e.slice(s,c+1)}),s=c+1;continue}const i=dc.find(c=>e.startsWith(c,s)&&!(c==="-"&&/\\d/.test(e[s+1]??"")));if(i){t.push({type:"op",text:i}),s+=i.length;continue}let n=s;for(;n<e.length&&!pc.has(e[n]);){if(e[n]==="["){const c=e.indexOf("]",n);if(c===-1)throw new Je("missing \']\'");n=c}n++}if(n===s)throw new Je(`unexpected \'${r}\'`);const o=e.slice(s,n);fc.includes(o)?t.push({type:"op",text:o}):Ln.includes(o)||ii.test(o)?t.push({type:"value",text:o}):t.push({type:"ident",text:o}),s=n}return t}var mc=class{constructor(e){this.tokens=e,this.pos=0,this.usedInfix=!1}peek(e=0){return this.tokens[this.pos+e]}next(){return this.tokens[this.pos++]}isOp(e,...t){return e?.type==="op"&&t.includes(e.text)}startsPrimary(e){return e?.type==="ident"||e?.type==="value"||e?.type==="("}describe(e){return e?`\'${e.text}\'`:"end of expression"}parseExpression(){const e=this.parseOr();if(this.peek())throw new Je(`unexpected ${this.describe(this.peek())}`);return e}parseArguments(e){const t=[];for(let s=0;s<e;s++)t.push(this.parsePrimary());if(!this.peek())throw new Je("expected a value");return t.push(this.parseExpression()),t}parseCondition(){const e=[this.parseOr()];for(;this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=");)e.push(this.parseHashPair());if(this.peek())throw new Je(`unexpected ${this.describe(this.peek())}`);return e}parseHashPair(){const e=this.next().text;return this.next(),{kind:"raw",text:`${e}=${vs(this.parsePrimary())}`}}parseOr(){return this.parseChain(["or","||"],"or",()=>this.parseAnd())}parseAnd(){return this.parseChain(["and","&&"],"and",()=>this.parseNot())}parseChain(e,t,s){const r=[s()];for(;this.isOp(this.peek(),...e);){const i=this.next().text;if(!this.peek())throw new Je(`expected a value after \'${i}\'`);r.push(s())}return r.length===1?r[0]:(this.usedInfix=!0,{kind:"call",name:t,args:r})}parseNot(){if(this.isOp(this.peek(),"not","!")){const e=this.next().text;if(!this.peek())throw new Je(`expected a value after \'${e}\'`);return this.usedInfix=!0,{kind:"call",name:"not",args:[this.parseNot()]}}return this.parseComparison()}parseComparison(){const e=this.parseAdditive(),t=this.peek();if(t?.type!=="op"||!(t.text in ri))return e;if(this.next(),!this.peek())throw new Je(`expected a value after \'${t.text}\'`);const s=this.parseAdditive(),r=this.peek();if(r?.type==="op"&&r.text in ri)throw new Je(`comparisons can\'t be chained (at \'${r.text}\'), use "and" to combine them`);return this.usedInfix=!0,{kind:"call",name:ri[t.text],args:[e,s]}}parseAdditive(){return this.parseArithmetic(["+","-"],()=>this.parseMultiplicative())}parseMultiplicative(){return this.parseArithmetic(["*","/","%"],()=>this.parseUnary())}parseArithmetic(e,t){let s=t();for(;;){let r;const i=this.peek();if(this.isOp(i,...e)){if(r=this.next().text,!this.peek())throw new Je(`expected a value after \'${r}\'`)}else if(e.includes("-")&&i?.type==="value"&&i.text.startsWith("-")&&ii.test(i.text))r="-",this.tokens[this.pos]={type:"value",text:i.text.slice(1)};else return s;this.usedInfix=!0,s={kind:"call",name:hc[r],args:[s,t()]}}}parseUnary(){if(this.isOp(this.peek(),"-")){if(this.next(),!this.peek())throw new Je("expected a value after \'-\'");return this.usedInfix=!0,{kind:"call",name:"sub",args:[{kind:"raw",text:"0"},this.parseUnary()]}}return this.parsePrimary()}parsePrimary(){const e=this.peek();if(e?.type==="ident"||e?.type==="value")return this.next(),{kind:"raw",text:e.text};if(e?.type==="("){this.next();const t=this.isHelperCall()?this.parseHelperCall():this.parseOr();if(this.peek()?.type!==")")throw new Je(`expected \')\' but found ${this.describe(this.peek())}`);return this.next(),t}if(this.isOp(e,"not","!")){const t=e?.text==="!"?"!value":"not value";throw new Je(`\'${e?.text}\' must be inside parentheses here, e.g. (${t})`)}throw e?.type==="op"?new Je(`expected a value before \'${e.text}\'`):new Je(e?`unexpected ${this.describe(e)}`:"expected a value")}isHelperCall(){const e=this.peek(),t=this.peek(1);return this.isOp(e,"and","or")?!0:e?.type==="ident"&&this.startsPrimary(t)}parseHelperCall(){const e=this.next().text,t=[];for(;this.peek()&&this.peek()?.type!==")";)this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=")?t.push(this.parseHashPair()):t.push(this.parsePrimary());return{kind:"call",name:e,args:t}}};function vs(e){return e.kind==="raw"?e.text:`(${e.name} ${e.args.map(vs).join(" ")})`}function or(e,t,s){const r=t==="display"||t==="value";let i=null,n=[];try{n=gc(e)}catch(d){if(!r||!(d instanceof Je))return null;i=d}const o=n.some(d=>d.type==="op"),c=new mc(n);let f=[];if(!i)try{f=t==="condition"?c.parseCondition():t==="arguments"?c.parseArguments(1):[c.parseExpression()]}catch(d){if(!(d instanceof Je)||!o&&!r)return null;i=d}if(i)throw new Error(`Invalid ${s} "${e.trim()}": ${i.message}`);return!c.usedInfix&&!r?null:f}function vc(e){const t=or(e,"condition","condition");return t&&t.map(vs).join(" ")}function yc(e){const t=or(e,"arguments","expression");return t&&t.map(vs).join(" ")}function bc(e){const t=or(e,"display","expression")[0];if(t.kind==="call")return`${t.name} ${t.args.map(vs).join(" ")}`;if(Ln.includes(t.text)||ii.test(t.text)||/^["\']/.test(t.text))throw new Error(`Invalid expression "${e.trim()}": expected an attribute or a calculation`);return t.text}function _c(e){return vs(or(e,"value","expression")[0])}function Sc(e){const t=[];let s=0,r=null,i=0;for(let n=0;n<e.length;n++){const o=e[n];r?o==="\\\\"?n++:o===r&&(r=null):o===\'"\'||o==="\'"?r=o:o==="("?s++:o===")"?s=Math.max(0,s-1):o===","&&s===0&&(t.push(e.slice(i,n)),i=n+1)}return t.push(e.slice(i)),t.map(n=>n.trim()).filter(n=>n!=="")}var ni=/(\\\\*)\\{\\{(~?\\s*)(?:(#if|#unless|else\\s+if|else\\s+unless)(?=[\\s(!])|(set|inc|dec)(?=\\s)|(=))/g;function kc(e,t){let s=null;for(let r=t;r<e.length;r++){const i=e[r];if(s)i==="\\\\"?r++:i===s&&(s=null);else if(i===\'"\'||i==="\'")s=i;else{if(e.startsWith("~}}",r))return r;if(e.startsWith("}}",r))return r}}return-1}function Rn(e){if(!e.includes("{{"))return e;let t="",s=0;ni.lastIndex=0;let r;for(;(r=ni.exec(e))!==null;){if(r[1].length%2===1)continue;const i=r.index+r[0].length,n=kc(e,i);if(n===-1)break;const o=e.slice(i,n);if(r[5]){const c=r.index+r[1].length;t+=e.slice(s,c)+"{{"+r[2]+bc(o),s=n}else{const c=r[3]?vc(o):yc(o);c!==null&&(t+=e.slice(s,i)+" "+c,s=n)}ni.lastIndex=n}return t+e.slice(s)}var oi=e=>e==null||e===!1||e==="",ai=e=>typeof e=="number"||oi(e)||typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e));function zt(e,t){if(!ai(t))throw new Error(`"${e}" needs numbers, but was given ${JSON.stringify(t)}`);return oi(t)?0:Number(t)}var wc=class{constructor(e,t,s){this.goto=null,this.deactivate=new Set,this.expressionCache=new Map,this.getStory=e,this.state=t,this.getCurrentSection=s,this.handlebars=je.default.create(),this.handlebars.registerHelper("embed",u=>{const a=this.getCurrentSection();if(a.passages&&u in a.passages)return new je.default.SafeString(this.process(a.passages[u].text||"",!0));const h=this.getStory();if(u in h.sections)return new je.default.SafeString(this.process(h.sections[u].text||"",!0))}),this.handlebars.registerHelper("seen",u=>this.state.getSeen(u)),this.handlebars.registerHelper("visits",u=>this.state.getVisits(u)),this.handlebars.registerHelper("get",u=>this.state.get(u)),this.handlebars.registerHelper("at",u=>{const a=this.state.get("_section");return Array.isArray(u)?u.includes(a):a===u});const r=u=>u&&typeof u=="object"&&typeof u.toString=="function"&&!Array.isArray(u)?u.toString():u;this.handlebars.registerHelper("goto",(...u)=>{const a=u.pop(),h=u.length?r(u[0]):void 0;if(typeof h!="string"||!h||!(h in this.getStory().sections))return new je.default.SafeString(Ut("Error in {{goto}}:",h===void 0?\'expected a section name, e.g. {{goto "cave"}}\':`there is no section called "${h}"`));let l=0;return a.hash.after!==void 0&&(l=Number(r(a.hash.after)),!Number.isFinite(l)||l<0)?new je.default.SafeString(Ut("Error in {{goto}}:",`after= should be a number of milliseconds, e.g. after=3000, not "${a.hash.after}"`)):(this.goto??(this.goto={section:h,after:l}),"")}),this.handlebars.registerHelper("deactivate",(...u)=>{u.pop();const a=u.length?u.map(r):[this.state.get("_passage")];for(const h of a){if(typeof h!="string"||!h)return new je.default.SafeString(Ut("Error in {{deactivate}}:",u.length?\'expected a passage name, e.g. {{deactivate "door"}}\':"{{deactivate}} with no passage name only works in a passage"));const l=this.getCurrentSection()?.passages,p=this.getStory().sections[""]?.passages;if(!(l&&h in l)&&!(p&&h in p))return new je.default.SafeString(Ut("Error in {{deactivate}}:",`there is no passage called "${h}" in this section`));this.deactivate.add(h)}return""}),this.handlebars.registerHelper("set",(u,a)=>(this.state.set(u,r(a)),"")),this.handlebars.registerHelper("__value",u=>(this.evaluated=r(u),"")),this.handlebars.registerHelper("unset",u=>(this.state.set(u,!1),""));const i=(u,a)=>{this.handlebars.registerHelper(u,(h,...l)=>{const p=l.length>1?zt(u,r(l[0])):1,g=zt(u,this.state.get(h));return this.state.set(h,g+a*p),""})};i("inc",1),i("dec",-1),this.handlebars.registerHelper("and",(...u)=>u.slice(0,-1).every(Boolean)),this.handlebars.registerHelper("or",(...u)=>u.slice(0,-1).some(Boolean)),this.handlebars.registerHelper("not",u=>!u),this.handlebars.registerHelper("eq",(u,a)=>u==a),this.handlebars.registerHelper("ne",(u,a)=>u!=a),this.handlebars.registerHelper("gt",(u,a)=>u>a),this.handlebars.registerHelper("lt",(u,a)=>u<a),this.handlebars.registerHelper("gte",(u,a)=>u>=a),this.handlebars.registerHelper("lte",(u,a)=>u<=a);const n=(u,a)=>{this.handlebars.registerHelper(u,(...h)=>{const l=h.slice(0,-1).map(r);if(l.length!==2)throw new Error(`"${u}" needs two values, but was given ${l.length}`);return a(zt(u,l[0]),zt(u,l[1]))})};this.handlebars.registerHelper("add",(...u)=>{const a=u.slice(0,-1).map(r);if(a.length!==2)throw new Error(`"add" needs two values, but was given ${a.length}`);const[h,l]=a;if(ai(h)&&ai(l))return zt("add",h)+zt("add",l);const p=g=>{if(oi(g))return"";if(typeof g=="object")throw new Error(`"add" can\'t add ${Array.isArray(g)?"a list":"an object"}`);return String(g)};return p(h)+p(l)}),n("sub",(u,a)=>u-a),n("mul",(u,a)=>u*a),n("div",(u,a)=>{if(a===0)throw new Error("division by zero");return u/a}),n("mod",(u,a)=>{if(a===0)throw new Error("division by zero");return u%a}),this.handlebars.registerHelper("array",function(...u){return u.pop(),u}),this.handlebars.registerHelper("append",(u,a)=>{const h=this.state.get(u)||[],l=Array.isArray(h)?[...h]:[h],p=r(a);return Array.isArray(p)?l.push(...p.map(r)):l.push(p),this.state.set(u,l),""}),this.handlebars.registerHelper("prepend",(u,a)=>{const h=this.state.get(u)||[],l=Array.isArray(h)?[...h]:[h],p=r(a);return Array.isArray(p)?l.unshift(...p.map(r)):l.unshift(p),this.state.set(u,l),""}),this.handlebars.registerHelper("pop",u=>{const a=this.state.get(u)||[];if(!Array.isArray(a)||a.length===0)return"";const h=[...a],l=h.shift();return this.state.set(u,h),l}),this.handlebars.registerHelper("remove",(u,a)=>{const h=this.state.get(u)||[];if(!Array.isArray(h))return"";const l=r(a),p=h.findIndex(g=>r(g)===l);if(p!==-1){const g=[...h];g.splice(p,1),this.state.set(u,g)}return""}),this.handlebars.registerHelper("contains",(u,a)=>{let h;if(typeof u=="string"){const p=this.state.get(u);h=Array.isArray(p)?p:[]}else if(Array.isArray(u))h=u;else return!1;const l=r(a);return h.some(p=>r(p)===l)}),this.handlebars.registerHelper("length",u=>{let a;if(typeof u=="string"){const h=this.state.get(u);a=Array.isArray(h)?h:[]}else if(Array.isArray(u))a=u;else return 0;return a.length});const o=u=>String(u).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),c=new Map,f=(u,a,h,l)=>{if(typeof u!="string"||!u.includes("{{"))return u;const p=(l?"h:":"t:")+u;let g=c.get(p);return g||(g=this.handlebars.compile(Rn(u),{compat:!0,noEscape:!l}),c.set(p,g)),g(a,{data:h.data})},d=(u,a)=>{let h="";const l=f(a.hash.set||"",u,a,!1);if(l){const p=this.getStory().expressions?Sc(l):l.split(",").map(g=>g.trim());h+=` data-set="${o(JSON.stringify(p))}"`}return h};this.handlebars.registerHelper("section",function(u,a){const h=f(a.hash.text||u,this,a,!0);return new je.default.SafeString(`<a class="squiffy-link link-section" data-section="${o(u)}"${d(this,a)} role="link" tabindex="0">${h}</a>`)}),this.handlebars.registerHelper("passage",function(u,a){const h=f(a.hash.text||u,this,a,!0);return new je.default.SafeString(`<a class="squiffy-link link-passage" data-passage="${o(u)}"${d(this,a)} role="link" tabindex="0">${h}</a>`)})}evaluate(e){let t=this.expressionCache.get(e);return t||(t=this.handlebars.compile(`{{__value ${_c(e)}}}`),this.expressionCache.set(e,t)),this.evaluated=void 0,t(this.state.getStore()),this.evaluated}process(e,t){try{return e=this.handlebars.compile(Rn(e),{compat:!0})(this.state.getStore()),t?ei(e,{async:!1}).trim():ti(e,{async:!1}).trim()}catch(s){const r=s instanceof Error?s.message:String(s);return console.error("Squiffy template error:",r),Ut("Template error:",r)}}};function Ut(e,t){const s=r=>r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return`<div class="squiffy-error" style="color: red; background: #ffe0e0; padding: 8px; border: 1px solid red; margin: 4px 0; font-family: monospace; white-space: pre-wrap;"><strong>${s(e)}</strong> ${s(t)}</div>`}var xc=class{constructor(){this.listeners=new Map}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){this.listeners.get(e)?.delete(t)}once(e,t){const s=this.on(e,r=>{s(),t(r)});return s}emit(e,t){this.listeners.get(e)?.forEach(s=>{try{s(t)}catch(r){console.error(`[Squiffy] handler for "${String(e)}" failed`,r)}})}},Tc=class{constructor(e,t,s,r,i){this.store={},this.readOnly=!1,this.persist=e,this.storyId=t,this.onSet=s,this.emitter=r,this.onSetInternal=i}usePersistentStorage(){return this.persist&&window.localStorage&&this.storyId}set(e,t){this.readOnly||this.setInternal(e,t,!0)}setInternal(e,t,s){typeof t>"u"&&(t=!0),s&&this.onSetInternal&&this.onSetInternal(e,this.get(e),structuredClone(t)),this.store[e]=structuredClone(t),this.usePersistentStorage()&&(localStorage[this.storyId+"-"+e]=JSON.stringify(t)),s&&this.emitter.emit("set",{attribute:e,value:t}),this.onSet(e,t)}has(e){return Object.prototype.hasOwnProperty.call(this.store,e)}get(e){return this.has(e)?structuredClone(this.store[e]):null}getStore(){return new Proxy({},{get:(e,t)=>typeof t=="string"&&(this.has(t)||!(t in e))?this.get(t):Reflect.get(e,t),has:(e,t)=>this.has(String(t)),ownKeys:()=>Object.keys(this.store),getOwnPropertyDescriptor:(e,t)=>{const s=String(t);if(this.has(s))return{enumerable:!0,configurable:!0,value:this.get(s)}}})}load(){if(!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)if(t.startsWith(this.storyId+"-")){const s=t.substring(this.storyId.length+1);this.store[s]=JSON.parse(localStorage[t])}}reset(){if(this.store={},!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)t.startsWith(this.storyId)&&localStorage.removeItem(t)}setSeen(e){let t=this.get("_seen_sections");t||(t=[]);const s=this.get("_visits")||{};s[e]=this.getVisitsFrom(s,t,e)+1,this.set("_visits",s),t.indexOf(e)==-1&&(t.push(e),this.set("_seen_sections",t))}getSeen(e){const t=this.get("_seen_sections");return t?t.indexOf(e)>-1:!1}getVisits(e){return this.getVisitsFrom(this.get("_visits")||{},this.get("_seen_sections")||[],e)}getVisitsFrom(e,t,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:t.indexOf(s)>-1?1:0}};function In(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((s,r)=>s===t[r])}function Cc(e,t,s,r,i,n){function o(u){return u.replace(/\'/g,"\\\\\'")}function c(u){return s.querySelectorAll(`[data-source=\'[[${o(u)}]]\']`)}function f(u,a){return s.querySelectorAll(`[data-source=\'[[${o(u)}]][${o(a)}]\']`)}function d(u,a){const h=Array.from(u.querySelectorAll("a.link-passage.disabled")).map(l=>l.getAttribute("data-passage"));u.innerHTML=a;for(const l of h){const p=u.querySelector(`a.link-passage[data-passage="${l}"]`);p&&i(p)}}for(const u of Object.keys(e.sections)){const a=c(u);if(a.length){const h=t.sections[u];if(h){const l=e.sections[u],p=!In(l.attributes,h.attributes),g=h.text!=l.text;if(p&&n(h.attributes||[]),g||p)for(const v of a)d(v,r(h.text||"",h))}else for(const l of a)l.closest(".squiffy-output-section")?.remove()}if(e.sections[u].passages)for(const h of Object.keys(e.sections[u].passages)){const l=f(u,h);if(!l.length)continue;const p=t.sections[u]?.passages&&t.sections[u]?.passages[h];if(p){const g=e.sections[u].passages[h],v=!In(g.attributes,p.attributes),_=p.text!=g.text;if(v&&n(p.attributes||[]),_||v)for(const S of l)d(S,r(p.text||"",t.sections[u]))}else for(const g of l)g.closest(".squiffy-output-passage")?.remove()}}}var Pc=class{constructor(e,t,s,r,i,n,o,c,f,d,u){this.plugins=[],this.outputElement=e,this.textProcessor=t,this.state=s,this.linkHandler=r,this.getSectionText=i,this.getPassageText=n,this.processText=o,this.addTransition=c,this.animation=f,this.emitter=d,this.resolveAssetsInHtml=u}add(e){const t=e.init({outputElement:this.outputElement,registerHelper:(s,r)=>{this.textProcessor.handlebars.registerHelper(s,r)},registerLinkHandler:(s,r)=>{this.linkHandler.registerLinkHandler(s,r)},get:s=>this.state.get(s),set:(s,r)=>this.state.set(s,r),getSectionText:this.getSectionText,getPassageText:this.getPassageText,processText:this.processText,resolveAssetsInHtml:this.resolveAssetsInHtml,addTransition:this.addTransition,animation:this.animation,on:(s,r)=>this.emitter.on(s,r),off:(s,r)=>this.emitter.off(s,r),once:(s,r)=>this.emitter.once(s,r)});return this.plugins.push(e),t}onWrite(e){this.plugins.forEach(t=>t.onWrite?.(e))}onLoad(){this.plugins.forEach(e=>e.onLoad?.())}};function On(e,t){return new Promise(s=>{e.addEventListener("transitionend",function(){e.innerHTML=t,e.addEventListener("transitionend",function(){e.classList.remove("fade-in"),s()},{once:!0}),e.classList.remove("fade-out"),e.classList.add("fade-in")},{once:!0}),e.classList.add("fade-out")})}function Ec(){return{name:"replaceLabel",init(e){e.registerHelper("label",function(t,s){return new je.default.SafeString(`<span class="squiffy-label-${t}">${s.fn(this)}</span>`)}),e.registerHelper("replace",function(t,s){const r=String(s.fn(this)),i=e.outputElement.querySelectorAll(`.squiffy-label-${t}`),n=i[i.length-1];if(n){const o=r.includes(`\n\n`)?ti(r,{async:!1}).trim():ei(r,{async:!1}).trim();e.addTransition(()=>On(n,o))}return""})}}}function Ac(){const e=i=>i.replace(/&/g,"&amp;").replace(/\'/g,"&#39;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=(i,n,o,c)=>{const f=o.map(l=>l.toString()),d=r(f,null),u=c.hash.set||"";u&&i.set(u,d[0]);const a=e(JSON.stringify(d.slice(1))||""),h=c.hash.show=="next"?d[1]:d[0];return new je.default.SafeString(`<a class="squiffy-link" data-handler="${n}" data-value="${e(d[0])}" data-show="${c.hash.show||""}" data-options=\'${a}\' data-attribute="${u}" role="link">${h}</a>`)},s=(i,n,o)=>{const c={},f=JSON.parse(n.getAttribute("data-options")??"[]")||[],d=r(f,o?n.getAttribute("data-value"):"");n.innerHTML=n.getAttribute("data-show")=="next"?d[1]:d[0],n.setAttribute("data-value",d[0]),n.setAttribute("data-options",JSON.stringify(d.slice(1))||""),d[1]||(c.disableLink=!0);const u=n.getAttribute("data-attribute");return u&&i.set(u,n.getAttribute("data-value")),window.getSelection()?.removeAllRanges(),c},r=(i,n)=>{const o=i[0],c=i.slice(1);return n&&c.push(n),[o,...c]};return{name:"rotateSequence",init(i){i.registerHelper("rotate",(n,o)=>t(i,"rotate",n,o)),i.registerHelper("sequence",(n,o)=>t(i,"sequence",n,o)),i.registerLinkHandler("rotate",n=>s(i,n,!0)),i.registerLinkHandler("sequence",n=>s(i,n,!1))}}}function Lc(){return{name:"random",init(e){e.registerHelper("random",(t,s)=>{const r=t.map(o=>o.toString()),i=r[Math.floor(Math.random()*r.length)],n=s.hash.set||"";return n&&e.set(n,i),new je.default.SafeString(i)})}}}function Rc(){let e;return{name:"live",init(t){e=t,e.registerHelper("live",(r,i)=>{const n=i.hash.section||"";if(n)return new je.default.SafeString(`<span class="squiffy-live" data-attribute="${r}" data-section="${n}"></span>`);const o=i.hash.passage||"";return o?new je.default.SafeString(`<span class="squiffy-live" data-attribute="${r}" data-passage="${o}"></span>`):new je.default.SafeString(`<span class="squiffy-live" data-attribute="${r}"></span>`)});const s=async r=>{const i=[],n=`.squiffy-live[data-attribute="${CSS.escape(r.attribute)}"]`;for(const o of e.outputElement.querySelectorAll(n)){const c=o.innerHTML;let f="";if(o.dataset.section){const d=e.getSectionText(o.dataset.section);d&&(f=e.processText(d,!0))}else if(o.dataset.passage){const d=e.getPassageText(o.dataset.passage);d&&(f=e.processText(d,!0))}else f=r.value;c!==f&&i.push(On(o,f))}await Promise.all(i)};e.on("set",async r=>{await s(r)})},onWrite(t){e&&t.querySelectorAll(".squiffy-live").forEach(s=>{if(s.dataset.section){const r=e.getSectionText(s.dataset.section);r&&(s.innerHTML=e.processText(r,!0))}else if(s.dataset.passage){const r=e.getPassageText(s.dataset.passage);r&&(s.innerHTML=e.processText(r,!0))}else{const r=s.dataset.attribute;s.textContent=r?e.get(r):""}})}}}function Ic(){let e;const t=r=>{const i={};for(const[n,o]of Object.entries(r)){if(o==null){i[n]=o;continue}try{i[n]=JSON.parse(o)}catch{i[n]=o}}return i},s=r=>{for(const i of r.querySelectorAll(".squiffy-animate")){const n=t(i.dataset);if(!n.content)continue;const o=n.content.includes(`\n\n`)?ti(n.content,{async:!1}):ei(n.content,{async:!1});if(i.innerHTML=e.resolveAssetsInHtml(o.trim()),!n.name)continue;const c=i.innerHTML;let f=[];const d=()=>{for(const h of f)e.animation.removeLinkAnimation(h);f=[...i.querySelectorAll("a")];for(const h of f)e.animation.addLinkAnimation(h,a)},u=()=>{if(n.trigger!=="link"){i.innerHTML=c;return}const h=f;i.innerHTML=c,d(),f.forEach((l,p)=>{const g=h[p];if(!g)return;g.classList.contains("disabled")&&l.classList.add("disabled");const v=g.getAttribute("tabindex");v!==null&&l.setAttribute("tabindex",v)})},a=()=>{n.loop?e.animation.runAnimation(n.name,i,n,()=>{},!0):(e.animation.isInitiallyHidden(n.name)&&(i.style.opacity="0"),e.addTransition(()=>new Promise(h=>{i.style.opacity="",e.animation.runAnimation(n.name,i,n,()=>{i.classList.remove("squiffy-animate"),u(),h()},!1)})))};n.trigger==="link"?d():a()}};return{name:"animate",init(r){e=r,e.registerHelper("animate",function(i,n){const o=n.fn(this),c={name:i,content:o,...n.hash},f=Object.entries(c).map(([u,a])=>` data-${je.default.escapeExpression(u)}="${je.default.escapeExpression(JSON.stringify(a))}"`).join(""),d=o.includes(`\n\n`)?"div":"span";return new je.default.SafeString(`<${d} class="squiffy-animate"${f}></${d}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var Ms={ReplaceLabel:Ec,RotateSequencePlugin:Ac,RandomPlugin:Lc,LivePlugin:Rc,AnimatePlugin:Ic},Oc=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute("data-handler")||"",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},Rt=typeof window<"u",rt=Rt?window:null,J=Rt?document:null,$e={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},ye={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},ct={NONE:0,AUTO:1,FORCE:2},Ye={replace:0,none:1,blend:2},Mn=Symbol(),ts=Symbol(),li=Symbol(),Ns=Symbol(),Nn=Symbol(),qe=1e-11,xt=1e12,it=1e3,Ch="var(",ar=[],ci=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),ss=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],Dn=ss.reduce((e,t)=>({...e,[t]:t+"("}),{}),oe=()=>{},Mc=e=>e,Nc=/\\)\\s*[-.\\d]/,Dc=/(^#([\\da-f]{3}){1,2}$)|(^#([\\da-f]{4}){1,2}$)/i,Bc=/rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/i,$c=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,qc=/hsl\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*\\)/i,Hc=/hsla\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,Bn=/[-+]?\\d*\\.?\\d+(?:e[-+]?\\d)?/gi,$n=/^([-+]?\\d*\\.?\\d+(?:e[-+]?\\d+)?)([a-z]+|%)$/i,Fc=/([a-z])([A-Z])/g,qn=/(\\*=|\\+=|-=)/,Vc=/var\\(\\s*(--[\\w-]+)(?:\\s*,\\s*([^)]+))?\\s*\\)/,Ds={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:it,delay:0,loopDelay:0,ease:"out(2)",composition:Ye.replace,modifier:Mc,onBegin:oe,onBeforeUpdate:oe,onUpdate:oe,onLoop:oe,onPause:oe,onComplete:oe,onRender:oe},He={current:null,root:J},G={defaults:Ds,precision:4,timeScale:1,tickThreshold:200,editor:null},Hn={version:"4.5.0",engine:null};Rt&&(rt.AnimeJS||(rt.AnimeJS=[]),rt.AnimeJS.push(Hn));var lr=e=>e.replace(Fc,"$1-$2").toLowerCase(),ze=(e,t)=>e.indexOf(t)===0,Wt=Date.now,Ze=Array.isArray,We=e=>e&&e.constructor===Object,Qe=e=>typeof e=="number"&&!isNaN(e),Xe=e=>typeof e=="string",De=e=>typeof e=="function",V=e=>typeof e>"u",rs=e=>V(e)||e===null,cr=e=>Rt&&e instanceof SVGElement,Fn=e=>Dc.test(e),Vn=e=>ze(e,"rgb"),zn=e=>ze(e,"hsl"),zc=e=>Fn(e)||(Vn(e)||zn(e))&&(e[e.length-1]===")"||!Nc.test(e)),ys=e=>!G.defaults.hasOwnProperty(e),Uc=["opacity","rotate","overflow","color"],Wc=(e,t)=>{if(Uc.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const s=e.parentNode;return s&&s.tagName==="filter"}return!0}},is=e=>Xe(e)?parseFloat(e):e,ns=Math.pow,gt=Math.sqrt,ui=Math.sin,hi=Math.cos,mt=Math.abs,ur=Math.exp,Xc=Math.ceil,bs=Math.floor,Gc=Math.asin,Un=Math.max,hr=Math.atan2,It=Math.PI,di=Math.round,j=(e,t,s)=>e<t?t:e>s?s:e,W=(e,t)=>{if(t<0)return e;if(!t)return di(e);const s=10**t;return di(e*s)/s},os=(e,t)=>Ze(t)?t.reduce((s,r)=>mt(r-e)<mt(s-e)?r:s):t?di(e/t)*t:e,Xt=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,dr=e=>e===1/0?xt:e===-1/0?-xt:e,_s=e=>e<=1e-11?qe:dr(W(e,11)),tt=e=>Ze(e)?[...e]:e,vt=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=V(i)?t[r]:i}return s},Ce=(e,t,s,r="_prev",i="_next")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const c=n[o];t(n),n=c}},Tt=(e,t,s="_prev",r="_next")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},Ct=(e,t,s,r="_prev",i="_next")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},Yc=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[Ns];let n=0;const o=r.length;let c;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const d=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const u=r.substring(d,n);let a=1;const h=n+1;let l=-1,p=-1;for(n++;n<o&&a>0;){const v=r.charCodeAt(n);v===40?a++:v===41?a--:v===44&&a===1&&(l===-1?l=n:p===-1&&(p=n)),n++}const g=n-1;u==="translate"||u==="translate3d"?(l===-1?i.translateX=r.substring(h,g).trim():(i.translateX=r.substring(h,l).trim(),p===-1?i.translateY=r.substring(l+1,g).trim():(i.translateY=r.substring(l+1,p).trim(),i.translateZ=r.substring(p+1,g).trim())),c=r.substring(h,g)):u==="scale"||u==="scale3d"?l===-1?i.scale=r.substring(h,g).trim():(i.scaleX=r.substring(h,l).trim(),p===-1?i.scaleY=r.substring(l+1,g).trim():(i.scaleY=r.substring(l+1,p).trim(),i.scaleZ=r.substring(p+1,g).trim())):i[u]=r.substring(h,g)}if(t==="translate3d"&&c)return s&&(s[t]=c),c;const f=i[t];if(!V(f))return s&&(s[t]=f),f}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":ze(t,"scale")?"1":ze(t,"rotate")||ze(t,"skew")?"0deg":"0px"},Wn=e=>{let t="";for(let s=0,r=ss.length;s<r;s++){const i=ss[s],n=e[i];if(n!==void 0){if(i==="translateX"){const o=e.translateY;if(o!==void 0){const c=e.translateZ;c!==void 0?(t+=`translate3d(${n},${o},${c}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i==="scaleX"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const c=e.scaleZ;c!==void 0?(t+=`scale3d(${n},${o},${c}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${Dn[i]}${n}) `}i==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},fi=[];function Xn(e,t){if(!e)return null;const s=fi.length;e:for(let r=0;r<s;r++){const i=fi[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,c=n.length;o<c;o++){const f=n[o];if(f.detect(e)){const d=f.props[t];if(d&&(!d.gate||d.gate(e)))return d;break e}}}for(let r=0;r<s;r++){const i=fi[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,c=n.length;o<c;o++){const f=n[o](e,t);if(f)return f}}return null}var Zc=e=>{const t=Bc.exec(e)||$c.exec(e),s=V(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},jc=e=>{const t=e.length,s=t===4||t===5;return[+("0x"+e[1]+e[s?1:2]),+("0x"+e[s?2:3]+e[s?2:4]),+("0x"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+("0x"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},pi=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),Jc=e=>{const t=qc.exec(e)||Hc.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=V(t[4])?1:+t[4];let o,c,f;if(r===0)o=c=f=i;else{const d=i<.5?i*(1+r):i+r-i*r,u=2*i-d;o=W(pi(u,d,s+1/3)*255,0),c=W(pi(u,d,s)*255,0),f=W(pi(u,d,s-1/3)*255,0)}return[o,c,f,n]},Qc=e=>Vn(e)?Zc(e):Fn(e)?jc(e):zn(e)?Jc(e):[0,0,0,1],Y=(e,t)=>V(e)?t:e,Gn=(e,t)=>{const s=e.match(Vc),r=t[ts]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()==="")&&s[2]&&(i=s[2].trim()),i||0},Ve=(e,t,s,r,i,n)=>{if(De(e)){if(!i){const c=e(t,s,r,n);return isNaN(+c)?c||0:+c}const o=()=>{const c=e(t,s,r,n);return isNaN(+c)?c||0:+c};return i.func=o,o()}if(Xe(e)&&ze(e,"var(")){if(!i)return Gn(e,t);const o=()=>Gn(e,t);return i.func=o,o()}return e},gi=(e,t)=>e[ts]?e[li]&&Wc(e,t)?$e.ATTRIBUTE:ss.includes(t)||ci.get(t)?$e.TRANSFORM:ze(t,"--")?$e.CSS_VAR:t in e.style?$e.CSS:t in e?$e.OBJECT:$e.ATTRIBUTE:$e.OBJECT,Yn=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[Nn]||e).getPropertyValue(t);return i==="auto"?"0":i},as=(e,t,s,r)=>{const i=V(s)?gi(e,t):s,n=Xn(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===$e.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===$e.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===$e.TRANSFORM?Yc(e,t,r):i===$e.CSS_VAR?Yn(e,t,r).trimStart():Yn(e,t,r)},ls=(e,t,s)=>s==="-"?e-t:s==="+"?e+t:e*t,mi=()=>({t:ye.NUMBER,n:0,u:null,o:null,d:null,s:null}),ot=(e,t)=>{if(t.t=ye.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]==="="&&(t.o=r[0],r=r.slice(2));const i=r.includes(" ")?!1:$n.exec(r);if(i)return t.t=ye.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(zc(r))return t.t=ye.COLOR,t.d=Qc(r),t;{const n=r.match(Bn);return t.t=ye.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(Bn)||[],t}},Zn=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=tt(e._toNumbers),t.s=tt(e._strings),t),Ke=mi(),jn=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let c=o[0];for(let f=0,d=n.length;f<d;f++){const u=r(W(Xt(i[f],n[f],t),s)),a=o[f+1];c+=`${a?u+a:u}`,e._numbers[f]=u}return c},fr=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,c=e.completed,f=e.iterationDuration,d=e.iterationCount,u=e._currentIteration,a=e._loopDelay,h=e._reversed,l=e._alternate,p=e._hasChildren,g=e._delay,v=e._currentTime,_=g+f,S=t-g,y=j(v,-g,o),m=j(S,-g,o),b=S-v,k=m>0,w=m>=o,A=o<=qe,M=i===ct.FORCE;let L=0,R=S,E=0;if(d>1){const D=f+(w?0:a),T=~~(m/D);e._currentIteration=j(T,0,d),w&&e._currentIteration--,L=e._currentIteration%2,R=m-T*D||0}const q=h^(l&&L),z=e._ease;let X=w?q?0:o:q?f-R:R;z&&(X=f*z(X/f)||0);const C=(n?n.backwards:S<v)?!q:!!q;if(e._currentTime=S,e._iterationTime=X,e.backwards=C,k&&!e.began?(e.began=!0,!s&&!(n&&(C||!n.began))&&e.onBegin(e)):S<=0&&(e.began=!1),!s&&!p&&k&&e._currentIteration!==u&&e.onLoop(e),M||i===ct.AUTO&&(t>=(n&&g>0?0:g)&&t<=_||t<=g&&y>g||t>=_&&y!==o)||X>=_&&y!==o||X<=g&&y>0&&!w||t<=y&&y===o&&c||w&&!c&&A){if(k&&(e.computeDeltaTime(y),s||e.onBeforeUpdate(e)),!p){const D=M||(C?b*-1:b)>=G.tickThreshold,T=W(e._offset+(n?n._offset:0)+g+X,12);let P=e._head,N,H,F,$,Z=0;for(;P;){const K=P._composition,ee=P._currentTime,me=P._changeDuration,ve=P._absoluteStartTime+P._changeDuration,re=P._nextRep,Q=P._prevRep,ue=K!==Ye.none,Pe=Q?Q._absoluteStartTime+Q._changeDuration:0,Ee=Q&&Q.parent!==P.parent,xe=!re||re._isOverridden?ve:re.parent===P.parent?ve+re._delay:re._absoluteStartTime<re._absoluteUpdateStartTime?re._absoluteStartTime:re._absoluteUpdateStartTime;if((D||(ee!==me||T<=xe||Q&&!Ee&&(!re||re.parent!==P.parent))&&(ee!==0||T>=P._absoluteStartTime||Ee&&!P._hasFromValue&&!Q._isOverridden&&T>=Pe||re&&!re._isOverridden&&re.parent===P.parent&&re._currentTime!==0&&X<re._startTime))&&(!Q||Ee||X>=P._startTime)&&(!ue||!P._isOverridden&&(!P._isOverlapped||T<=ve)&&(!re||re._isOverridden||T<=xe)&&(!Q||Q._isOverridden||(Ee?T>=P._absoluteStartTime||!P._hasFromValue&&T>=Pe:T>=Pe+P._delay)))){const Ae=P._currentTime=j(X-P._startTime,0,me),be=P._ease(Ae/P._updateDuration),Te=P._modifier,ge=P._valueType,Le=P._tweenType,ke=Le===$e.OBJECT,ie=ge===ye.NUMBER,_e=ie&&ke||be===0||be===1?-1:G.precision;let we,Me;if(ie)we=Me=Te(W(Xt(P._fromNumber,P._toNumber,be),_e));else if(ge===ye.UNIT)Me=Te(W(Xt(P._fromNumber,P._toNumber,be),_e)),we=`${Me}${P._unit}`;else if(ge===ye.COLOR){const B=P._numbers,ae=P._fromNumbers,fe=P._toNumbers,le=1-be,te=ae[0],Ne=ae[1],Ue=ae[2],ft=fe[0],Pt=fe[1],Mt=fe[2];B[0]=Te(Math.sqrt(te*te*le+ft*ft*be)),B[1]=Te(Math.sqrt(Ne*Ne*le+Pt*Pt*be)),B[2]=Te(Math.sqrt(Ue*Ue*le+Mt*Mt*be)),B[3]=Te(Xt(ae[3],fe[3],be)),(!P._setter||r)&&(we=`rgba(${W(B[0],0)},${W(B[1],0)},${W(B[2],0)},${B[3]})`)}else ge===ye.COMPLEX&&(we=jn(P,be,_e));if(ue&&(P._number=Me),!r&&K!==Ye.blend){const B=P.property;N=P.target,P._setter?P._setter(N,Me,P):ke?N[B]=we:Le===$e.ATTRIBUTE?N.setAttribute(B,we):(H=N.style,Le===$e.TRANSFORM?(N!==F&&(F=N,$=N[Ns]),$[B]=we,Z=1):Le===$e.CSS?H[B]=we:Le===$e.CSS_VAR&&H.setProperty(B,we)),k&&(E=1)}else P._value=we}else ee&&Q&&!Ee&&X<P._startTime&&(P._currentTime=0);Z&&P._renderTransforms&&(H.transform=Wn($),Z=0),P=P._next}!s&&E&&e.onRender(e)}!s&&k&&e.onUpdate(e)}return n&&A?!s&&(n.began&&!C&&S>0&&!c||C&&S<=1e-11&&c)&&(e.onComplete(e),e.completed=!C):k&&w?d===1/0?e._startTime+=e.duration:e._currentIteration>=d-1&&(e.paused=!0,!c&&!p&&(e.completed=!0,!s&&!(n&&(C||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,E},cs=(e,t,s,r,i)=>{const n=e._currentIteration;if(fr(e,t,s,r,i),e._hasChildren){const o=e,c=o.backwards,f=r?t:o._iterationTime,d=Wt();let u=0,a=!0;if(!r&&o._currentIteration!==n){const h=o.iterationDuration;Ce(o,l=>{if(!c)!l.completed&&!l.backwards&&l._currentTime<l.iterationDuration&&fr(l,h,s,1,ct.FORCE),l.began=!1,l.completed=!1;else{const p=l.duration,g=l._offset+l._delay,v=g+p;!s&&p<=1e-11&&(!g||v===h)&&l.onComplete(l)}}),s||o.onLoop(o)}Ce(o,h=>{const l=W((f-h._offset)*h._speed,12);if(c&&l>h._delay+h.duration)return;const p=h._fps<o._fps?h.requestTick(d):i;u+=fr(h,l,s,r,p),!h.completed&&a&&(a=!1)},c),!s&&u&&o.onRender(o),(a||c)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},Jn={},vi=(e,t,s)=>{if(s===$e.TRANSFORM){const r=ci.get(e);return r||e}else if(s===$e.CSS||s===$e.ATTRIBUTE&&cr(t)&&e in t.style){const r=Jn[e];if(r)return r;{const i=e&&lr(e);return Jn[e]=i,i}}else return e},pr=(e,t=!1)=>{if(e._hasChildren)Ce(e,s=>pr(s,t),!0);else{const s=e;s.pause(),Ce(s,r=>{const i=r.property,n=r.target,o=r._tweenType,c=r._inlineValue,f=rs(c)||c==="";if(r._setter){if(!t&&!f){if(ot(c,Ke),Ke.d){const d=Ke.d,u=r._numbers;for(let a=0,h=d.length;a<h;a++)u[a]=d[a]}else r._number=Ke.n;r._setter(r.target,r._number,r)}}else if(o===$e.OBJECT)!t&&!f&&(n[i]=c);else if(n[ts])if(o===$e.ATTRIBUTE)t||(f?n.removeAttribute(i):n.setAttribute(i,c));else{const d=n.style;if(o===$e.TRANSFORM){const u=n[Ns];f?delete u[i]:u[i]=c,r._renderTransforms&&(Object.keys(u).length?d.transform=Wn(u):d.removeProperty("transform"))}else f?d.removeProperty(lr(i)):d[i]=c}n[ts]&&s._tail===r&&s.targets.forEach(d=>{d.getAttribute&&d.getAttribute("style")===""&&d.removeAttribute("style")})})}return e},Qn=e=>pr(e,!0),Kn=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=it/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?qe:t,r=it/s;s>Ds.frameRate&&(Ds.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?qe:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?ct.NONE:(this._lastTickTime=s>=t?e-s%t:e,ct.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Ss={animation:null,update:oe},Kc=e=>{let t=Ss.animation;return t||(t={duration:qe,computeDeltaTime:oe,_offset:0,_delay:0,_head:null,_tail:null},Ss.animation=t,Ss.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,c=o===ye.COMPLEX||o===ye.COLOR?tt(n._fromNumbers):null;let f=n._fromNumber,d=i._tail;for(;d&&d!==n;){if(c)for(let u=0,a=d._numbers.length;u<a;u++)c[u]+=d._numbers[u];else f+=d._number;d=d._prevAdd}n._toNumber=f,n._toNumbers=c}}}),fr(t,1,1,0,ct.FORCE)}),t},eo=Rt?requestAnimationFrame:setImmediate,eu=Rt?cancelAnimationFrame:clearImmediate,tu=class extends Kn{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Ds,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=Wt();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(Tt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):cs(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):ct.AUTO),r=i}Ss.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Wt()),this.reqId=eo(to)),this}pause(){if(this.reqId)return this.paused=!0,su()}resume(){if(this.paused)return this.paused=!1,Ce(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(G.timeScale===1?1:it)}set speed(e){const t=e*G.timeScale;this._speed!==t&&(this._speed=t,Ce(this,s=>s.speed=s._speed))}get timeUnit(){return G.timeScale===1?"ms":"s"}set timeUnit(e){const s=e==="s",r=s?.001:1;if(G.timeScale!==r){G.timeScale=r,G.tickThreshold=200*r;const i=s?.001:it;this.defaults.duration*=i,this._speed*=i}}get precision(){return G.precision}set precision(e){G.precision=e}},et=(()=>{const e=new tu(Wt());return Rt&&(Hn.engine=e,J.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(J.hidden?e.pause():e.resume())})),e})(),to=()=>{et._head?(et.reqId=eo(to),et.update()):et.reqId=0},su=()=>(eu(et.reqId),et.reqId=0,et),gr={_rep:new WeakMap,_add:new Map},yi=(e,t,s="_rep")=>{const r=gr[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},ru=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,mr=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=qe,e._currentTime=qe},so=(e,t)=>{const s=e._composition;if(s===Ye.replace){const r=e._absoluteStartTime;Ct(t,e,ru,"_prevRep","_nextRep");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){mr(i);let d=i._prevRep;for(;d&&d.parent.id===n.id;)mr(d),d=d._prevRep}const c=e._absoluteUpdateStartTime;if(o>c){const d=i._startTime,u=o-(d+i._updateDuration),a=W(c-u-d,12);i._changeDuration=a,i._currentTime=a,i._isOverlapped=1,a<1e-11&&mr(i)}const f=e.parent.parent;if(!f||f!==n.parent){let d=!0;if(Ce(n,u=>{u._isOverlapped||(d=!1)}),d){const u=n.parent;if(u){let a=!0;Ce(u,h=>{h!==n&&Ce(h,l=>{l._isOverlapped||(a=!1)})}),a&&u.cancel()}else n.cancel()}}}}else if(s===Ye.blend){const r=yi(e.target,e.property,"_add"),i=Kc(gr._add);let n=r._head;n||(n={...e},n._composition=Ye.replace,n._updateDuration=qe,n._startTime=0,n._numbers=tt(e._fromNumbers),n._number=0,n._next=null,n._prev=null,Ct(r,n),Ct(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=tt(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const c=tt(e._toNumbers);c.forEach((f,d)=>{e._fromNumbers[d]=n._fromNumbers[d]-f,e._toNumbers[d]=0}),n._fromNumbers=c}Ct(r,e,null,"_prevAdd","_nextAdd")}return e},ro=e=>{const t=e._composition;if(t!==Ye.none){const s=e.target,r=e.property,i=gr._rep.get(s)[r];if(Tt(i,e,"_prevRep","_nextRep"),t===Ye.blend){const n=gr._add,o=n.get(s);if(!o)return;const c=o[r],f=Ss.animation;Tt(c,e,"_prevAdd","_nextAdd");const d=c._head;if(d&&d===c._tail){Tt(c,d,"_prevAdd","_nextAdd"),Tt(f,d);let u=!0;for(let a in o)if(o[a]._head){u=!1;break}u&&n.delete(s)}}}return e},io=(e,t,s)=>{let r=!1;return Ce(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,c=i._tweenType,f=vi(s,n,c);(!f||f&&f===o)&&(i.parent._tail===i&&i._tweenType===$e.TRANSFORM&&i._prev&&i._prev._tweenType===$e.TRANSFORM&&(i._prev._renderTransforms=1),Tt(t,i),ro(i),r=!0)}},!0),r},Dt=(e,t,s)=>{const r=t||et;let i;if(r._hasChildren){let n=0;Ce(r,o=>{if(!o._hasChildren)if(i=io(e,o,s),i&&!o._head)o.cancel(),Tt(r,o);else{const c=o._offset+o._delay+o.duration;c>n&&(n=c)}o._head?Dt(e,o,s):o._hasChildren=!1},!0),V(r.iterationDuration)||(r.iterationDuration=n)}else i=io(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},no=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),bi=e=>(e._cancelled&&(e._hasChildren?Ce(e,bi):Ce(e,t=>{t._composition!==Ye.none&&so(t,yi(t.target,t.property))}),e._cancelled=0),e),oo=0,iu=(e,t)=>e._priority>t._priority,ut=class extends Kn{constructor(e={},t=null,s=0){super(0),++oo;const{id:r,delay:i,duration:n,reversed:o,alternate:c,loop:f,loopDelay:d,autoplay:u,frameRate:a,playbackRate:h,priority:l,onComplete:p,onLoop:g,onPause:v,onBegin:_,onBeforeUpdate:S,onUpdate:y}=e;He.current&&He.current.register(this);const m=t?0:et._lastTickTime,b=t?t.defaults:G.defaults,k=De(i)||V(i)?b.delay:+i,w=De(n)||V(n)?1/0:+n,A=Y(f,b.loop),M=Y(d,b.loopDelay);let L=A===!0||A===1/0||A<0?1/0:A+1,R=0;t?R=s:(et.reqId||et.requestTick(Wt()),R=(et._lastTickTime-et._startTime)*G.timeScale),this.id=V(r)?oo:r,this.parent=t,this.duration=dr((w+M)*L-M)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||b.onBegin,this.onBeforeUpdate=S||b.onBeforeUpdate,this.onUpdate=y||b.onUpdate,this.onLoop=g||b.onLoop,this.onPause=v||b.onPause,this.onComplete=p||b.onComplete,this.iterationDuration=w,this.iterationCount=L,this._autoplay=t?!1:Y(u,b.autoplay),this._offset=R,this._delay=k,this._loopDelay=M,this._iterationTime=0,this._currentIteration=0,this._resolve=oe,this._running=!1,this._reversed=+Y(o,b.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Y(c,b.alternate),this._prev=null,this._next=null,this._lastTickTime=m,this._startTime=m,this._lastTime=m,this._fps=Y(a,b.frameRate),this._speed=Y(h,b.playbackRate),this._priority=+Y(l,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return j(W(this._currentTime,G.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return j(W(this._iterationTime,G.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return j(W(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return j(W(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*j(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return bi(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,cs(this,0,1,~~e,ct.FORCE),no(this),this._hasChildren&&Ce(this,no),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&cs(this,this.duration,1,~~e,ct.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!V(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*et._speed);return this._startTime=Wt()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?cs(this,qe,0,0,ct.FORCE):(this._running||(Ct(et,this,iu),et._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,et.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){bi(this),this.completed=!1;const r=this.paused;return this.paused=!0,cs(this,e+this._delay,~~t,~~s,ct.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?bs(xt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Ce(this,e=>e.cancel(),!0):Ce(this,ro),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=_s(e);if(t===s)return this;const r=e/t,i=e<=qe;return this.duration=i?qe:s,this.iterationDuration=i?qe:_s(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){cs(this,0,1,0,ct.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},nu=e=>new ut(e,null,0).init();function _i(e){const t=Xe(e)?He.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function ht(e){if(rs(e))return[];if(!Rt)return Ze(e)&&e.flat(1/0)||[e];if(Ze(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!rs(o)){const c=_i(o);if(c)for(let f=0,d=c.length;f<d;f++){const u=c[f];if(!rs(u)){let a=!1;for(let h=0,l=r.length;h<l;h++)if(r[h]===u){a=!0;break}a||r.push(u)}}else{let f=!1;for(let d=0,u=r.length;d<u;d++)if(r[d]===o){f=!0;break}f||r.push(o)}}}return r}const t=_i(e);return t?Array.from(t):[e]}function Gt(e){const t=ht(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[Mn]){i[Mn]=!0;const n=cr(i);(i.nodeType||n)&&(i[ts]=!0,i[li]=n,i[Ns]={})}}return t}var Si={deg:1,rad:180/It,turn:360},ao={},vr=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===ye.UNIT&&i===s)return t;const o=n+i+s,c=ao[o];if(!V(c)&&!r)t.n=c;else{let f;if(i in Si)f=n*Si[i]/Si[s];else{const u=e.cloneNode(),a=e.parentNode,h=a&&a!==J?a:J.body;h.appendChild(u);const l=u.style;l.width=100+i;const p=u.offsetWidth||100;l.width=100+s;const g=p/(u.offsetWidth||100);h.removeChild(u),f=g*n}t.n=f,ao[o]=f}return t.t,ye.UNIT,t.u=s,t},dt=e=>e,Bs=(e=1.68)=>t=>ns(t,+e),ki={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},ou=It/2,lo=It*2,co={"":Bs,Quad:Bs(2),Cubic:Bs(3),Quart:Bs(4),Quint:Bs(5),Sine:e=>1-hi(e*ou),Circ:e=>1-gt(1-e*e),Expo:e=>e?ns(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=ns(2,--s))-1)/11;);return 1/ns(4,3-s)-7.5625*ns((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=j(+e,1,10),r=j(+t,qe,2),i=r/lo*Gc(1/s),n=lo/r;return o=>o===0||o===1?o:-s*ns(2,-10*(1-o))*ui((1-o-i)*n)}},Bt=(()=>{const e={linear:dt,none:dt};for(let t in ki)for(let s in co){const r=co[s],i=ki[t];e[t+s]=s===""||s==="Back"||s==="Elastic"?(n,o)=>i(r(n,o)):i(r)}return e})(),yr={linear:dt,none:dt},uo=e=>{if(yr[e])return yr[e];if(e.indexOf("(")<=-1){const t=ki[e]||e.includes("Back")||e.includes("Elastic")?Bt[e]():Bt[e];return t?yr[e]=t:dt}else{const t=e.slice(0,-1).split("("),s=Bt[t[0]];return s?yr[e]=s(...t[1].split(",")):dt}},ho=["steps(","irregular(","linear(","cubicBezier("],$t=e=>{if(Xe(e)){for(let t=0,s=ho.length;t<s;t++)if(ze(e,ho[t]))return console.warn(`String syntax for \\`ease: "${e}"\\` has been removed from the core and replaced by importing and passing the easing function directly: \\`ease: ${e}\\``),dt}return De(e)?e:Xe(e)?uo(e):dt},ne=mi(),de=mi(),ks={},br={func:null},_r={func:null},Sr=[null],ws=[null,null],kr={to:null},au=0,fo=0,Yt,Ot,lu=(e,t)=>{const s={};if(Ze(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(ys);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(c=>{const f={};for(let d in c){const u=c[d];ys(d)?d===o&&(f.to=u):f[d]=u}return f})}}else{const r=Y(t.duration,G.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let c in o)if(ys(c)){let f=s[c];f||(f=s[c]=[]);const d=n*r;let u=f.length,a=f[u-1];const h={to:o[c]};let l=0;for(let p=0;p<u;p++)l+=f[p].duration;u===1&&(h.from=a.to),o.ease&&(h.ease=o.ease),h.duration=d-(u?l:0),f.push(h)}return i});for(let i in s){const n=s[i];let o;for(let c=0,f=n.length;c<f;c++){const d=n[c],u=d.ease;d.ease=o||void 0,o=u}n[0].duration||n.shift()}}return s},qt=class extends ut{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++fo;const c=Gt(e),f=c.length,d=t.keyframes,u=d?vt(lu(d,t),t):t,{id:a,delay:h,duration:l,ease:p,playbackEase:g,modifier:v,composition:_,onRender:S}=u,y=s?s.defaults:G.defaults,m=Y(p,y.ease),b=Y(g,y.playbackEase),k=b?$t(b):null,w=!V(m.ease),A=w?m.ease:Y(p,k?"linear":y.ease),M=w?m.settlingDuration:Y(l,y.duration),L=Y(h,y.delay),R=v||y.modifier,E=V(_)&&f>=1e3?Ye.none:V(_)?y.composition:_,q=this._offset+(s?s._offset:0);w&&(m.parent=this);let z=NaN,X=NaN,C=0,D=0;for(let T=0;T<f;T++){const P=c[T],N=n||T,H=o||c;let F=NaN,$=NaN;for(let Z in u)if(ys(Z)){const K=gi(P,Z),ee=Xn(P,Z),me=vi(Z,P,K);let ve=u[Z];const re=Ze(ve);if(i&&!re&&(ws[0]=ve,ws[1]=ve,ve=ws),re){const Ae=ve.length,be=!We(ve[0]);Ae===2&&be?(kr.to=ve,Sr[0]=kr,Yt=Sr):Ae>2&&be?(Yt=[],ve.forEach((Te,ge)=>{ge?ge===1?(ws[1]=Te,Yt.push(ws)):Yt.push(Te):ws[0]=Te})):Yt=ve}else Sr[0]=ve,Yt=Sr;let Q=null,ue=null,Pe=NaN,Ee=0,xe=0;for(let Ae=Yt.length;xe<Ae;xe++){const be=Yt[xe];We(be)?Ot=be:(kr.to=be,Ot=kr),br.func=null,_r.func=null;const Te=Ve(Y(Ot.composition,E),P,N,H,null,null),ge=Qe(Te)?Te:Ye[Te];!Q&&ge!==Ye.none&&(Q=yi(P,me));const Le=Q?Q._tail:null,ke=s&&Le&&Le.parent.parent===s?Le:ue,ie=Ve(Ot.to,P,N,H,br,ke);let _e;We(ie)&&!V(ie.to)?(Ot=ie,_e=ie.to):_e=ie;const we=Ve(Ot.from,P,N,H,_r,ke),Me=Ot.ease||A,B=Ve(Me,P,N,H,null,ke),ae=De(B)||Xe(B)?B:Me,fe=!V(ae)&&!V(ae.ease),le=fe?ae.ease:ae,te=fe?ae.settlingDuration:Ve(Y(Ot.duration,Ae>1?Ve(M,P,N,H,null,ke)/Ae:M),P,N,H,null,ke),Ne=Ve(Y(Ot.delay,xe?0:L),P,N,H,null,ke),Ue=Ot.modifier||R,ft=!V(we),Pt=!V(_e),Mt=Ze(_e),Fr=Mt||ft&&Pt,Vr=ue?Ee:0,Fe=ue?Ee+Ne:Ne,pe=W(q+Fe,12),Be=W(q+Vr,12);!D&&(ft||Mt)&&(D=1);let Re=ue;if(ge!==Ye.none){let O=Q._head;for(;O&&O._absoluteStartTime<=pe;)if(O._isOverridden||(Re=O),O=O._nextRep,O&&O._absoluteStartTime>=pe)for(;O;)mr(O),O=O._nextRep}if(Fr){ot(Mt?Ve(_e[0],P,N,H,_r,ke):we,ne),ot(Mt?Ve(_e[1],P,N,H,br,ke):_e,de);const O=as(P,me,K,ks);ne.t===ye.NUMBER&&(Re?Re._valueType===ye.UNIT&&(ne.t=ye.UNIT,ne.u=Re._unit):(ot(O,Ke),Ke.t===ye.UNIT&&(ne.t=ye.UNIT,ne.u=Ke.u)))}else Pt?ot(_e,de):ue?Zn(ue,de):ot(s&&Re&&Re.parent.parent===s?Re._value:as(P,me,K,ks),de),ft?ot(we,ne):ue?Zn(ue,ne):ot(s&&Re&&Re.parent.parent===s?Re._value:as(P,me,K,ks),ne);if(ne.o&&(ne.n=ls(Re?Re._toNumber:ot(as(P,me,K,ks),Ke).n,ne.n,ne.o)),de.o&&(de.n=ls(ne.n,de.n,de.o)),ne.t!==de.t){if(ne.t===ye.COMPLEX||de.t===ye.COMPLEX){const O=ne.t===ye.COMPLEX?ne:de,U=ne.t===ye.COMPLEX?de:ne;U.t=ye.COMPLEX,U.s=tt(O.s),U.d=O.d.map(()=>U.n)}else if(ne.t===ye.UNIT||de.t===ye.UNIT){const O=ne.t===ye.UNIT?ne:de,U=ne.t===ye.UNIT?de:ne;U.t=ye.UNIT,U.u=O.u}else if(ne.t===ye.COLOR||de.t===ye.COLOR){const O=ne.t===ye.COLOR?ne:de,U=ne.t===ye.COLOR?de:ne;U.t=ye.COLOR,U.d=O.d.map(()=>0)}}if(ne.u!==de.u){let O=de.u?ne:de;O=vr(P,O,de.u?de.u:ne.u,!1)}if(de.d&&ne.d&&de.d.length!==ne.d.length){const O=ne.d.length>de.d.length?ne:de,U=O===ne?de:ne;U.d=O.d.map((se,Se)=>V(U.d[Se])?0:U.d[Se]),U.s=tt(O.s)}const Cs=W(+te||1e-11,12);let zr=ks[me];rs(zr)||(ks[me]=null);const Zi=ee?ee.set:null;Ee=W(Fe+Cs,12);const us=ne.d,hs=de.d,Et=de.s,x={parent:this,id:au++,property:me,target:P,_value:null,_toFunc:br.func,_fromFunc:_r.func,_ease:$t(le),_fromNumbers:us?tt(us):ar,_toNumbers:hs?tt(hs):ar,_strings:Et?tt(Et):ar,_fromNumber:ne.n,_toNumber:de.n,_numbers:us?tt(us):ar,_number:ne.n,_unit:de.u,_modifier:Ue,_currentTime:0,_startTime:Fe,_delay:+Ne,_updateDuration:Cs,_changeDuration:Cs,_absoluteStartTime:pe,_absoluteUpdateStartTime:Be,_absoluteEndTime:W(q+Ee,12),_hasFromValue:ft||Mt?1:0,_tweenType:K,_setter:Zi,_valueType:de.t,_composition:ge,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:zr,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};ge!==Ye.none&&so(x,Q);const I=x._valueType;if(I===ye.COMPLEX)x._value=jn(x,1,-1);else if(I===ye.UNIT)x._value=`${Ue(x._toNumber)}${x._unit}`;else if(I===ye.COLOR){const O=de.d;x._value=`rgba(${W(O[0],0)},${W(O[1],0)},${W(O[2],0)},${O[3]})`}else x._value=Ue(x._toNumber);isNaN(Pe)&&(Pe=x._startTime),ue=x,C++,Ct(this,x)}(isNaN(X)||Pe<X)&&(X=Pe),(isNaN(z)||Ee>z)&&(z=Ee),K===$e.TRANSFORM&&(F=C-xe,$=C)}if(!isNaN(F)){let Z=0;Ce(this,K=>{Z>=F&&Z<$&&(K._renderTransforms=1,K._composition===Ye.blend&&Ce(Ss.animation,ee=>{ee.id===K.id&&(ee._renderTransforms=1)})),Z++})}}f||console.warn("No target found. Make sure the element you\'re trying to animate is accessible before creating your animation."),X?(Ce(this,T=>{T._startTime-T._delay||(T._delay-=X),T._startTime-=X}),z-=X):X=0,z||(z=qe,this.iterationCount=0),this.targets=c,this.id=V(a)?fo:a,this.duration=z===1e-11?qe:dr((z+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=S||y.onRender,this._ease=k,this._delay=X,this.iterationDuration=z,!this._autoplay&&D&&this.onRender(this)}stretch(e){const t=this.duration;if(t===_s(e))return this;const s=e/t;return Ce(this,r=>{r._updateDuration=_s(r._updateDuration*s),r._changeDuration=_s(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Ce(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(ot(s(),ne),ne.u!==e._unit&&e.target[ts]&&vr(e.target,ne,e._unit,!0),e._fromNumbers=tt(ne.d),e._fromNumber=ne.n):t&&(ot(as(e.target,e.property,e._tweenType),Ke),e._fromNumbers=tt(Ke.d),e._fromNumber=Ke.n),t&&(ot(t(),de),e._toNumbers=tt(de.d),e._strings=tt(de.s),e._toNumber=de.o?ls(e._fromNumber,de.n,de.o):de.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),pr(this)}then(e){return super.then(e)}},$s=(e,t)=>G.editor?G.editor.addAnimation(e,t):new qt(e,t,null,0,!1).init(),cu=(e,t)=>{if(ze(t,"<")){const s=t[1]==="<",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},qs=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),V(t))return s;if(Qe(+t))return+t;const r=t,i=e?e.labels:null,n=!rs(i),o=cu(e,r),c=!V(o),f=qn.exec(r);if(f){const d=f[0],u=r.split(d),a=n&&u[0]?i[u[0]]:s,h=c?o:n?a:s,l=+u[1];return ls(h,l,d[0])}else return c?o:n?V(i[r])?s:i[r]:s};function uu(e){return dr((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function wi(e,t,s,r,i,n){const o=Qe(e.duration)&&e.duration<=1e-11?s-qe:s;t.composition&&cs(t,o,1,1,ct.AUTO);const c=r?new qt(r,e,t,o,!1,i,n):new ut(e,t,o);return t.composition&&c.init(!0),Ct(t,c),Ce(t,f=>{const d=f._offset+f._delay+f.duration;d>t.iterationDuration&&(t.iterationDuration=d)}),t.duration=uu(t),t}var po=0,go=class extends ut{constructor(e={}){super(e,null,0),++po,this.id=V(e.id)?po:e.id,this.duration=0,this.labels={};const t=e.defaults,s=G.defaults;this.defaults=t?vt(t,s):s,this.composition=Y(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=Y(e.playbackEase,s.playbackEase);this._ease=r?$t(r):null,this.iterationDuration=0}add(e,t,s){const r=We(t),i=We(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=G.editor&&G.editor.addTimelineChild,c=s&&s.type==="Stagger"&&G.editor,f=De(s)?s:null;if(f||c){const d=ht(e),u=this.duration,a=this.iterationDuration,h=n.id;let l=0;const p=d.length,g=o?o(e,n,this.id,s,p):null,v=f||G.editor.resolveStagger(s.defaultValue);d.forEach(_=>{const S={...g||n};this.duration=u,this.iterationDuration=a,V(h)||(S.id=h+"-"+l);const y=qs(this,v(_,l,d,null,this));wi(S,this,y,_,l,d),l++})}else{const d=o?o(e,n,this.id,s):n,u=s&&s.type?s.defaultValue:s;wi(d,this,qs(this,u),e)}}else wi(e,this,qs(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(V(e)||e&&V(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!V(e)&&!V(e.persist)&&(e.persist=!0);const r=G.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return V(t)?this:(t.duration=qe,t.composition=Ye.replace,this.add(e,t,s))}call(e,t){return V(e)||e&&!De(e)?this:(G.editor&&G.editor.addTimelineCall&&(t=G.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return V(e)||e&&!Xe(e)?this:(G.editor&&G.editor.addTimelineLabel&&(t=G.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=qs(this,t),this)}remove(e,t){return Dt(ht(e),this,t),this}stretch(e){const t=this.duration;if(t===_s(e))return this;const s=e/t,r=this.labels;Ce(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Ce(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Ce(this,e=>e.revert,!0),pr(this)}then(e){return super.then(e)}},mo=e=>G.editor?G.editor.addTimeline(e):new go(e).init(),xi=class{constructor(e,t){He.current&&He.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let c=!0;for(let f in this.animations)if(!this.animations[f].paused&&c){c=!1;break}c&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(V(e)||V(t))){for(let c in t){const f=t[c];ys(c)?o[c]=f:ze(c,"on")?n[c]=f:i[c]=f}this.callbacks=new qt({v:0},n);for(let c in o){const f=o[c],d=We(f);let u={},a="+=0";if(d){const p=f.unit;Xe(p)&&(a+=p)}else u.duration=f;u[c]=d?vt({to:a},f):a;const h=vt(i,u);h.composition=Ye.replace,h.autoplay=!1;const l=this.animations[c]=new qt(e,h,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[c]=(p,g,v)=>{const _=l._head;if(V(p)&&_){const S=_._numbers;return S&&S.length?S:_._modifier(_._number)}else return Ce(l,S=>{if(Ze(p))for(let y=0,m=p.length;y<m;y++)V(S._numbers[y])||(S._fromNumbers[y]=S._modifier(S._numbers[y]),S._toNumbers[y]=p[y]);else S._fromNumber=S._modifier(S._number),S._toNumber=p;V(v)||(S._ease=$t(v)),S._currentTime=0}),V(g)||l.stretch(g),l.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=oe,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},hu=(e,t)=>new xi(e,t),du=ds({clamp:()=>j,damp:()=>bu,degToRad:()=>vu,lerp:()=>Xt,mapRange:()=>Hs,padEnd:()=>gu,padStart:()=>pu,radToDeg:()=>yu,round:()=>W,roundPad:()=>fu,snap:()=>os,wrap:()=>mu}),fu=(e,t)=>(+e).toFixed(t),pu=(e,t,s)=>`${e}`.padStart(t,s),gu=(e,t,s)=>`${e}`.padEnd(t,s),mu=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,Hs=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),vu=e=>e*Math.PI/180,yu=e=>e*180/Math.PI,bu=(e,t,s,r)=>r?r===1?t:Xt(e,t,1-Math.exp(-r*s*.1)):e,at=it*10,wr=class{constructor(e={}){const t=!V(e.bounce)||!V(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/it,this.maxIterations=this.maxDuration/this.timeStep/it,this.bn=j(Y(e.bounce,.5),-1,1),this.pd=j(Y(e.duration,628),10*G.timeScale,at*G.timeScale),this.m=j(Y(e.mass,1),1,at),this.s=j(Y(e.stiffness,100),qe,at),this.d=j(Y(e.damping,10),qe,at),this.v=j(Y(e.velocity,0),-at,at),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||oe,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=ur(-n*t*s)*(1*hi(r*n)+i*ui(r*n)):t===1?n=(1+i*n)*ur(-n*s):n=((1+i)*ur((-t*s+r)*n)+(1-i)*ur((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=G.timeScale===1?this.pd/it:this.pd;this.m=1,this.v=0,this.s=ns(2*It/e,2),this.bn>=0?this.d=(1-this.bn)*4*It/e:this.d=4*It/(e*(1+this.bn)),this.s=W(j(this.s,qe,at),3),this.d=W(j(this.d,qe,300),3)}calculateBDFromSD(){const e=2*It/gt(this.s);this.pd=e*(G.timeScale===1?it:1),this.d/(2*gt(this.s))<=1?this.bn=1-this.d*e/(4*It):this.bn=4*It/(this.d*e)-1,this.bn=W(j(this.bn,-1,1),3),this.pd=W(j(this.pd,10*G.timeScale,at*G.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:c}=this,f=this.w0=j(gt(o/i),qe,it),d=this.zeta=n/(2*gt(o*i));d<1?(this.wd=f*gt(1-d*d),this.b=(d*f+-c)/this.wd):d===1?(this.wd=0,this.b=-c+f):(this.wd=f*gt(d*d-1),this.b=(d*f+-c)/this.wd);let u=0,a=0,h=0;for(;a<=e&&h<=t;)mt(1-this.solve(u))<s?a++:a=0,this.solverDuration=u,u+=r,h++;this.settlingDuration=W(this.solverDuration*it,0)*G.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=j(Y(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=j(Y(e,1),10*G.timeScale,at*G.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=j(Y(e,100),qe,at),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=j(Y(e,10),qe,at),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=j(Y(e,1),1,at),this.compute()}get velocity(){return this.v}set velocity(e){this.v=j(Y(e,0),-at,at),this.compute()}},xr=e=>new wr(e),vo=e=>(console.warn("createSpring() is deprecated use spring() instead"),new wr(e)),Ti={_head:null,_tail:null},Ci=(e,t,s)=>{let r=Ti._head,i;for(;r;){const n=r._next,o=r.$el===e,c=!t||r.property===t,f=!s||r.parent===s;if(o&&c&&f){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),Tt(Ti,r);const d=r.parent;d&&(d._completed++,d.animations.length===d._completed&&(d.completed=!0,d.paused=!0,d.muteCallbacks||(d.onComplete(d),d._resolve(d))))}r=n}return i},yo=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),Ci(t,s),Ct(Ti,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const c=()=>Ci(t,s,e);return n.oncancel=c,n.onremove=c,e.persist||(n.onfinish=c),n};function Zt(e,t,s){const r=Gt(e);if(!r.length)return;const[i]=r,n=gi(i,t),o=vi(t,i,n);let c=as(i,o);if(V(s))return c;if(ot(c,Ke),Ke.t===ye.NUMBER||Ke.t===ye.UNIT){if(s===!1)return Ke.n;{const f=vr(i,Ke,s,!1);return`${W(f.n,G.precision)}${f.u}`}}}var Ht=(e,t)=>{if(!V(t))return G.editor&&G.editor.addSet?G.editor.addSet(e,t):(t.duration=qe,t.composition=Y(t.composition,Ye.none),new qt(e,t,null,0,!0).resume())},bo=(e,t,s)=>{const r=ht(e);for(let i=0,n=r.length;i<n;i++)Ci(r[i],s,t&&t.controlAnimation&&t);return Dt(r,t,s),r},jt=e=>{e.cancelable&&e.preventDefault()},_u=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:oe,remove:oe}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},Su=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==J;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform="none"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===""?e.style.removeProperty("transform"):e.style.transform=s})}},nt=(e,t)=>e&&De(e)?e(t):e,Tr=0,_o=class{constructor(e,t={}){if(!e)return;He.current&&He.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,c=o&&$t(o),f=!V(o)&&!V(o.ease),d=We(s)&&!V(s.mapTo)?s.mapTo:"translateX",u=We(r)&&!V(r.mapTo)?r.mapTo:"translateY",a=nt(t.container,this);this.containerArray=Ze(a)?a:null,this.$container=a&&!this.containerArray?ht(a)[0]:J.body,this.useWin=this.$container===J.body,this.$scrollContainer=this.useWin?rt:this.$container,this.$target=We(e)?new _u(e):ht(e)[0],this.$trigger=ht(i||e)[0],this.fixed=Zt(this.$target,"position")==="fixed",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=f?o:xr({mass:Y(t.releaseMass,1),stiffness:Y(t.releaseStiffness,80),damping:Y(t.releaseDamping,20)}),this.releaseYSpring=f?o:xr({mass:Y(t.releaseMass,1),stiffness:Y(t.releaseStiffness,80),damping:Y(t.releaseDamping,20)}),this.releaseEase=c||Bt.outQuint,this.hasReleaseSpring=f,this.onGrab=t.onGrab||oe,this.onDrag=t.onDrag||oe,this.onRelease=t.onRelease||oe,this.onUpdate=t.onUpdate||oe,this.onSettle=t.onSettle||oe,this.onSnap=t.onSnap||oe,this.onResize=t.onResize||oe,this.onAfterResize=t.onAfterResize||oe,this.disabled=[0,0];const h={};if(n&&(h.modifier=n),V(s)||s===!0)h[d]=0;else if(We(s)){const l=s,p={};l.modifier&&(p.modifier=l.modifier),l.composition&&(p.composition=l.composition),h[d]=p}else s===!1&&(h[d]=0,this.disabled[0]=1);if(V(r)||r===!0)h[u]=0;else if(We(r)){const l=r,p={};l.modifier&&(p.modifier=l.modifier),l.composition&&(p.composition=l.composition),h[u]=p}else r===!1&&(h[u]=0,this.disabled[1]=1);this.animate=new xi(this.$target,h),this.xProp=d,this.yProp=u,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-xt,xt,xt,-xt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=Wt(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Su(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new ut({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new ut({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!V(a),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?d:u,this.animate.callbacks.onRender=()=>{const l=this.updated,p=!(this.grabbed&&l)&&this.released,g=this.x,v=this.y,_=g-this.coords[2],S=v-this.coords[3];this.deltaX=_,this.deltaY=S,this.coords[2]=g,this.coords[3]=v,l&&(_||S)&&this.onUpdate(this),p?(this.computeVelocity(_,S),this.angle=hr(S,_)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new ut({autoplay:!1,duration:150*G.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),We(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=Wt(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,c=this.minVelocity,f=this.maxVelocity,d=this.velocityStackIndex;n[d]=W(j(gt(e*e+t*t)/i*o,c,f),5);const u=Un(n[0],n[1],n[2]);return this.velocity=u,this.velocityStackIndex=(d+1)%3,u}setX(e,t=!1){if(this.disabled[0])return;const s=W(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=os(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=W(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=os(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return W(this.animate[this.xProp](),G.precision)}set x(e){this.setX(e,!1)}get y(){return W(this.animate[this.yProp](),G.precision)}set y(e){this.setY(e,!1)}get progressX(){return Hs(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(Hs(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return Hs(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(Hs(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=W(this.useWin?rt.scrollX:this.$container.scrollLeft,0),t=W(this.useWin?rt.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=rt.innerWidth,o=this.window[1]=rt.innerHeight,c=this.useWin,f=e.scrollWidth,d=e.scrollHeight,u=this.fixed,a=e.getBoundingClientRect(),[h,l,p,g]=this.containerPadding;this.dragArea[0]=c?0:a.left,this.dragArea[1]=c?0:a.top,this.scrollView[0]=c?j(f,n,f):f,this.scrollView[1]=c?j(d,o,d):d,this.updateScrollCoords();const{width:v,height:_,left:S,top:y,right:m,bottom:b}=e.getBoundingClientRect();this.dragArea[2]=W(c?j(v,n,n):v,0),this.dragArea[3]=W(c?j(_,o,o):_,0);const k=Zt(e,"overflow"),w=k==="visible",A=k==="hidden";if(this.canScroll=u?!1:this.contained&&(e===J.body&&w||!A&&!w)&&(f>this.dragArea[2]+g-l||d>this.dragArea[3]+h-p)&&(!this.containerArray||this.containerArray&&!Ze(this.containerArray)),this.contained){const M=this.scroll.x,L=this.scroll.y,R=this.canScroll,E=this.$target.getBoundingClientRect(),q=R?c?0:e.scrollLeft:0,z=R?c?0:e.scrollTop:0,X=R?this.scrollView[0]-q-v:0,C=R?this.scrollView[1]-z-_:0;this.targetBounds[0]=W(E.top+L-(c?0:y),0),this.targetBounds[1]=W(E.right+M-(c?n:m),0),this.targetBounds[2]=W(E.bottom+L-(c?o:b),0),this.targetBounds[3]=W(E.left+M-(c?0:S),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+h,this.containerBounds[1]=this.containerArray[1]-l,this.containerBounds[2]=this.containerArray[2]-p,this.containerBounds[3]=this.containerArray[3]+g):(this.containerBounds[0]=-W(E.top-(u?j(y,0,o):y)+z-h,0),this.containerBounds[1]=-W(E.right-(u?j(m,0,n):m)-X+l,0),this.containerBounds[2]=-W(E.bottom-(u?j(b,0,o):b)-C+p,0),this.containerBounds[3]=-W(E.left-(u?j(S,0,n):S)+q-g,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[c,f]=this.disabled,d=!c&&t<o||!c&&t>i,u=!f&&s<r||!f&&s>n;return d&&!u?1:!d&&u?2:d&&u?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=nt(e.container,this),i=nt(e.containerPadding,this)||0,n=Ze(i)?i:[i,i,i,i],o=this.x,c=this.y,f=nt(e.cursor,this),d={onHover:"grab",onGrab:"grabbing"};if(f){const{onHover:v,onGrab:_}=f;v&&(d.onHover=v),_&&(d.onGrab=_)}const u=nt(e.dragThreshold,this),a={mouse:3,touch:7};if(Qe(u))a.mouse=u,a.touch=u;else if(u){const{mouse:v,touch:_}=u;V(v)||(a.mouse=v),V(_)||(a.touch=_)}this.containerArray=Ze(r)?r:null,this.$container=r&&!this.containerArray?ht(r)[0]:J.body,this.useWin=this.$container===J.body,this.$scrollContainer=this.useWin?rt:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=Y(n,[0,0,0,0]),this.containerFriction=j(Y(nt(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=j(Y(nt(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=nt(We(t)&&!V(t.snap)?t.snap:e.snap,this),this.snapY=nt(We(s)&&!V(s.snap)?s.snap:e.snap,this),this.scrollSpeed=Y(nt(e.scrollSpeed,this),1.5),this.scrollThreshold=Y(nt(e.scrollThreshold,this),20),this.dragSpeed=Y(nt(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?a.mouse:a.touch,this.minVelocity=Y(nt(e.minVelocity,this),0),this.maxVelocity=Y(nt(e.maxVelocity,this),50),this.velocityMultiplier=Y(nt(e.velocityMultiplier,this),1),this.cursor=f===!1?!1:d,this.updateBoundingValues();const[h,l,p,g]=this.containerBounds;this.setX(j(o,g,l),!0),this.setY(j(c,h,p),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[_,S,y,m]=this.containerPadding,[b,k]=this.scrollView,w=this.dragArea[2],A=this.dragArea[3],M=this.scroll.x,L=this.scroll.y,R=this.$container.scrollWidth,E=this.$container.scrollHeight,q=this.useWin?j(R,this.window[0],R):R,z=this.useWin?j(E,this.window[1],E):E,X=b-q,C=k-z;this.dragged&&X>0&&(this.coords[0]-=X,this.scrollView[0]=q),this.dragged&&C>0&&(this.coords[1]-=C,this.scrollView[1]=z);const D=this.scrollSpeed*10,T=this.scrollThreshold,[P,N]=this.coords,[H,F,$,Z]=this.scrollBounds,K=W(j((N-H+_)/T,-1,0)*D,0),ee=W(j((P-F-S)/T,0,1)*D,0),me=W(j((N-$-y)/T,0,1)*D,0),ve=W(j((P-Z+m)/T,-1,0)*D,0);if(K||me||ve||ee){const[re,Q]=this.disabled;let ue=M,Pe=L;re||(ue=W(j(M+(ve||ee),0,b-w),0),this.coords[0]-=M-ue),Q||(Pe=W(j(L+(K||me),0,k-A),0),this.coords[1]-=L-Pe),this.useWin?this.$scrollContainer.scrollBy(-(M-ue),-(L-Pe)):this.$scrollContainer.scrollTo(ue,Pe)}}const[e,t,s,r]=this.containerBounds,[i,n,o,c,f,d]=this.pointer;this.coords[0]+=(i-f)*this.dragSpeed,this.coords[1]+=(n-d)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[u,a]=this.coords,[h,l]=this.snapped,p=(1-this.containerFriction)*this.dragSpeed;this.setX(u>t?t+(u-t)*p:u<r?r+(u-r)*p:u,!1),this.setY(a>s?s+(a-s)*p:a<e?e+(a-e)*p:a,!1),this.computeVelocity(i-f,n-d),this.angle=hr(n-c,i-o);const[g,v]=this.snapped;(g!==h&&this.snapX||v!==l&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return Dt([this],null,"x"),Dt([this],null,"y"),Dt([this],null,"progressX"),Dt([this],null,"progressY"),Dt([this.scroll]),Dt([this.overshootCoords]),this}scrollInView(e,t=0,s=Bt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,c=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[f,d,u,a]=o,h=W(j(i-f,-xt,0),0),l=W(j(r-d,0,xt),0),p=W(j(i-u,0,xt),0),g=W(j(r-a,-xt,0),0);new qt(n,{x:W(n.x+(g?g-t:l?l+t:0),0),y:W(n.y+(h?h-t:p?p+t:0),0),duration:V(e)?350*G.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=c})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=Ht(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=Bt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,c,f]=this.containerPadding,d=this.scroll.y-this.targetBounds[0]+n+t,u=this.scroll.x-this.targetBounds[1]-o-t,a=this.scroll.y-this.targetBounds[2]-c-t,h=this.scroll.x-this.targetBounds[3]+f+t,l=this.isOutOfBounds([d,u,a,h],r,i);if(l){const[p,g]=this.disabled,v=j(os(r,this.snapX),h,u),_=j(os(i,this.snapY),d,a),S=V(e)?350*G.timeScale:e;!p&&(l===1||l===3)&&this.animate[this.xProp](v,S,s),!g&&(l===2||l===3)&&this.animate[this.yProp](_,S,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type==="range")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[c,f,d,u]=this.containerBounds,a=(1-this.containerFriction)*this.dragSpeed,h=this.x,l=this.y;this.coords[0]=this.coords[2]=a?h>f?f+(h-f)/a:h<u?u+(h-u)/a:h:h,this.coords[1]=this.coords[3]=a?l>d?d+(l-d)/a:l<c?c+(l-c)/a:l:l,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const p=Zt(this.$target,"zIndex",!1);Tr=(p>Tr?p:Tr)+1,this.targetStyles=Ht(this.$target,{zIndex:Tr}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=Ht(J.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,Bt.out(3)),this.onGrab(this),J.addEventListener("touchmove",this),J.addEventListener("touchend",this),J.addEventListener("touchcancel",this),J.addEventListener("mousemove",this),J.addEventListener("mouseup",this),J.addEventListener("selectstart",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],c=n-this.pointer[7];let f=e.target,d=!1,u=!1,a=!1;for(;t&&f&&f!==this.$trigger;){const h=Zt(f,"overflow-y");if(h!=="hidden"&&h!=="visible"){const{scrollTop:l,scrollHeight:p,clientHeight:g}=f;if(p>g){a=!0,d=l<=3,u=l>=p-g-3;break}}f=f.parentElement}a&&(!d&&!u||d&&c<0||u&&c>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(jt(e),this.triggerStyles||(this.triggerStyles=Ht(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",jt,{passive:!1}),this.$trigger.addEventListener("touchmove",jt,{passive:!1}),this.$trigger.addEventListener("touchend",jt),(this.dragged||!this.disabled[0]&&mt(o)>this.dragThreshold||!this.disabled[1]&&mt(c)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,c]=this.pointer,[f,d,u,a]=this.containerBounds,[h,l]=this.snapped,p=this.releaseXSpring,g=this.releaseYSpring,v=this.releaseEase,_=this.hasReleaseSpring,S=this.overshootCoords,y=this.x,m=this.y,b=this.computeVelocity(s-o,r-c),k=this.angle=hr(r-n,s-i),w=b*150,A=(1-this.releaseContainerFriction)*this.dragSpeed,M=y+hi(k)*w,L=m+ui(k)*w,R=M>d?d+(M-d)*A:M<a?a+(M-a)*A:M,E=L>u?u+(L-u)*A:L<f?f+(L-f)*A:L,q=this.destX=j(W(os(R,this.snapX),5),a,d),z=this.destY=j(W(os(E,this.snapY),5),f,u),X=this.isOutOfBounds(this.containerBounds,M,L);let C=0,D=0,T=v,P=v,N=0;if(S.x=y,S.y=m,!e){const F=q===d?y>d?-1:1:y<a?-1:1,$=W(y-q,0);p.velocity=t&&_?$?w*F/mt($):0:b;const{ease:Z,settlingDuration:K,restDuration:ee}=p;C=y===q?0:_?K:K-ee*G.timeScale,_&&(T=Z),C>N&&(N=C)}if(!t){const F=z===u?m>u?-1:1:m<f?-1:1,$=W(m-z,0);g.velocity=e&&_?$?w*F/mt($):0:b;const{ease:Z,settlingDuration:K,restDuration:ee}=g;D=m===z?0:_?K:K-ee*G.timeScale,_&&(P=Z),D>N&&(N=D)}if(!_&&X&&A&&(C||D)){const F=Ye.blend;new qt(S,{x:{to:R,duration:C*.65},y:{to:E,duration:D*.65},ease:v,composition:F}).init(),new qt(S,{x:{to:q,duration:C},y:{to:z,duration:D},ease:v,composition:F}).init(),this.overshootTicker.stretch(Un(C,D)).restart()}else e||this.animate[this.xProp](q,C,T),t||this.animate[this.yProp](z,D,P);this.scrollInView(N,this.scrollThreshold,v);let H=!1;q!==h&&(this.snapped[0]=q,this.snapX&&(H=!0)),z!==l&&this.snapY&&(this.snapped[1]=z,this.snapY&&(H=!0)),H&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",jt),this.$trigger.removeEventListener("touchmove",jt),this.$trigger.removeEventListener("touchend",jt),J.removeEventListener("touchmove",this),J.removeEventListener("touchend",this),J.removeEventListener("touchcancel",this),J.removeEventListener("mousemove",this),J.removeEventListener("mouseup",this),J.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=Ht(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),J.removeEventListener("touchmove",this),J.removeEventListener("touchend",this),J.removeEventListener("touchcancel",this),J.removeEventListener("mousemove",this),J.removeEventListener("mouseup",this),J.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case"mousedown":this.handleDown(e);break;case"touchstart":this.handleDown(e);break;case"mousemove":this.handleMove(e);break;case"touchmove":this.handleMove(e);break;case"mouseup":this.handleUp();break;case"touchend":this.handleUp();break;case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":jt(e)}}},ku=(e,t)=>new _o(e,t),Pi=(e=oe)=>new ut({duration:1*G.timeScale,onComplete:e},null,0).resume(),Cr=e=>{let t;return((...s)=>{let r,i,n,o,c;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,c=t._startTime,t.revert());const f=e(...s);return f&&!De(f)&&f.revert&&(t=f),V(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=c),f||oe})},So=class{constructor(e={}){He.current&&He.current.register(this);const t=e.root;let s=J;t&&(s=t.current||t.nativeElement||ht(t)[0]||J);const r=e.defaults,i=G.defaults,n=e.mediaQueries;if(this.defaults=r?vt(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const c=rt.matchMedia(n[o]);this.mediaQueryLists[o]=c,c.addEventListener("change",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=He.current,s=He.root,r=G.defaults;He.current=this,He.root=this.root,G.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return He.current=t,He.root=s,G.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);De(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,De(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);De(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,De(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);De(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(De(s))return s(this);const r=Cr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type==="change"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,c=s.length,f=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;c--;)s[c].revert();for(;f--;)r[f](this);for(let d in i)i[d].removeEventListener("change",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},wu=e=>new So(e),xu=()=>{const e=J.createElement("div");J.body.appendChild(e),e.style.height="100lvh";const t=e.offsetHeight;return J.body.removeChild(e),t},Pr=(e,t)=>e&&De(e)?e(t):e,Er=new Map,Tu=class{constructor(e){this.element=e,this.useWin=this.element===J.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new ut({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Ce(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new ut({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,c=r-n,f=i-o;this.prevScrollX=n,this.prevScrollY=o,c&&(this.backwardX=r>n),f&&(this.backwardY=i>o),this.velocity=W(s>0?Math.sqrt(c*c+f*f)/s:0,5)}}).init(),this.resizeTicker=new ut({autoplay:!1,duration:250*G.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new ut({autoplay:!1,duration:500*G.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?rt:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=W(e?rt.scrollX:t.scrollLeft,0),this.scrollY=W(e?rt.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=rt.innerWidth,this.winHeight=xu()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Ce(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Ce(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type==="scroll"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?rt:this.element).removeEventListener("scroll",this),Er.delete(this.element)}},Cu=e=>{const t=e&&ht(e)[0]||J.body;let s=Er.get(t);return s||(s=new Tu(t),Er.set(t,s)),s},Fs=(e,t,s,r,i)=>{const n=t==="min",o=t==="max",{n:c,u:f}=ot(t==="top"||t==="left"||t==="start"||n?0:t==="bottom"||t==="right"||t==="end"||o?"100%":t==="center"?"50%":t,Ke);let d=c;return f==="%"?d=c/100*s:f&&(d=vr(e,Ke,"px",!0).n),o&&r<0&&(d+=r),n&&i>0&&(d+=i),d},Ar=(e,t,s,r,i)=>{let n;if(Xe(t)){const o=qn.exec(t);if(o){const c=o[0],f=c[0],d=t.split(c),u=d[0]==="min",a=d[0]==="max",h=Fs(e,d[0],s,r,i),l=Fs(e,d[1],s,r,i);if(u){const p=ls(Fs(e,"min",s),l,f);n=p<h?h:p}else if(a){const p=ls(Fs(e,"max",s),l,f);n=p>h?h:p}else n=ls(h,l,f)}else n=Fs(e,t,s,r,i)}else n=t;return W(n,0)},ko=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[ts]){t=n;break}}return t},Pu=0,wo=["#FF4B4B","#FF971B","#FFC730","#F9F640","#7AFF5A","#18FF74","#17E09B","#3CFFEC","#05DBE9","#33B3F1","#638CF9","#C563FE","#FF4FCF","#F93F8A"],xo=class{constructor(e={}){He.current&&He.current.register(this);const t=Y(e.sync,"play pause"),s=t?$t(t):null,r=t&&(t==="linear"||t===dt),i=t&&!(s===dt&&!r),n=t&&(Qe(t)||t===!0||r),o=t&&Xe(t)&&!i&&!n,c=o?t.split(" ").map(d=>()=>{const u=this.linked;return u&&u[d]?u[d]():null}):null,f=o&&c.length>2;this.index=Pu++,this.id=V(e.id)?this.index:e.id,this.container=Cu(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!c,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=c&&!f&&c[0]?c[0]:oe,this.onSyncLeave=c&&!f&&c[1]?c[1]:oe,this.onSyncEnterForward=c&&f&&c[0]?c[0]:oe,this.onSyncLeaveForward=c&&f&&c[1]?c[1]:oe,this.onSyncEnterBackward=c&&f&&c[2]?c[2]:oe,this.onSyncLeaveBackward=c&&f&&c[3]?c[3]:oe,this.onEnter=e.onEnter||oe,this.onLeave=e.onLeave||oe,this.onEnterForward=e.onEnterForward||oe,this.onLeaveForward=e.onLeaveForward||oe,this.onEnterBackward=e.onEnterBackward||oe,this.onLeaveBackward=e.onLeaveBackward||oe,this.onUpdate=e.onUpdate||oe,this.onResize=e.onResize||oe,this.onSyncComplete=e.onSyncComplete||oe,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=Y(e.debug,!1),this._next=null,this._prev=null,Ct(this.container,this),Pi(()=>{if(!this.reverted){if(!this.target){const d=ht(e.target)[0];this.target=d||J.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!V(e)&&!V(e.persist)&&(e.persist=!0),!this._params.target)){let t;V(e.targets)?Ce(e,s=>{s.targets&&!t&&(t=ko(s))}):t=ko(e),this.target=t||J.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:W(j(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=Y(Pr(e.repeat,this),!0),this.horizontal=Y(Pr(e.axis,this),"y")==="x",this.enter=Y(Pr(e.enter,this),"end start"),this.leave=Y(Pr(e.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(":scope > .animejs-onscroll-debug"),r=J.createElement("div"),i=J.createElement("div"),n=J.createElement("div"),o=wo[this.index%wo.length],c=e.useWin,f=c?e.winWidth:e.width,d=c?e.winHeight:e.height,u=e.scrollWidth,a=e.scrollHeight,h=this.container.width>360?320:260,l=t?0:10,p=t?10:0,g=t?24:h/2,v=t?g:15,_=t?60:g,S=t?_:v,y=t?"repeat-x":"repeat-y",m=A=>t?"0px "+A+"px":A+"px 2px",b=A=>`linear-gradient(${t?90:0}deg, ${A} 2px, transparent 1px)`,k=(A,M,L,R,E)=>`position:${A};left:${M}px;top:${L}px;width:${R}px;height:${E}px;`;r.style.cssText=`${k("absolute",l,p,t?u:h,t?h:a)}\n pointer-events: none;\n z-index: ${this.container.zIndex++};\n display: flex;\n flex-direction: ${t?"column":"row"};\n filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));\n `,i.style.cssText=`${k("sticky",0,0,t?f:g,t?g:d)}`,s||(i.style.cssText+=`background:\n ${b("#FFFF")}${m(g-10)} / 100px 100px ${y},\n ${b("#FFF8")}${m(g-10)} / 10px 10px ${y};\n `),n.style.cssText=`${k("relative",0,0,t?u:g,t?g:a)}`,s||(n.style.cssText+=`background:\n ${b("#FFFF")}${m(0)} / ${t?"100px 10px":"10px 100px"} ${y},\n ${b("#FFF8")}${m(0)} / ${t?"10px 0px":"0px 10px"} ${y};\n `);const w=[" enter: "," leave: "];this.coords.forEach((A,M)=>{const L=M>1,R=(L?0:this.offset)+A,E=M%2,q=R<S,z=R>(L?t?f:d:t?u:a)-S,X=(L?E&&!q:!E&&!q)||z,C=J.createElement("div"),D=J.createElement("div"),T=t?X?"right":"left":X?"bottom":"top",P=X?(t?_:v)+(L?t?-1:z?0:-2:t?-1:-2):t?1:0;D.innerHTML=`${this.id}${w[E]}${this.thresholds[M]}`,C.style.cssText=`${k("absolute",0,0,_,v)}\n display: flex;\n flex-direction: ${t?"column":"row"};\n justify-content: flex-${L?"start":"end"};\n align-items: flex-${X?"end":"start"};\n border-${T}: 2px solid ${o};\n `,D.style.cssText=`\n overflow: hidden;\n max-width: ${h/2-10}px;\n height: ${v};\n margin-${t?X?"right":"left":X?"bottom":"top"}: -2px;\n padding: 1px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n letter-spacing: -.025em;\n line-height: 9px;\n font-weight: 600;\n text-align: ${t&&X||!t&&!L?"right":"left"};\n white-space: pre;\n text-overflow: ellipsis;\n color: ${E?o:"rgba(0,0,0,.75)"};\n background-color: ${E?"rgba(0,0,0,.65)":o};\n border: 2px solid ${E?o:"transparent"};\n border-${t?X?"top-left":"top-right":X?"top-left":"bottom-left"}-radius: 5px;\n border-${t?X?"bottom-left":"bottom-right":X?"top-right":"bottom-right"}-radius: 5px;\n `,C.appendChild(D);let N=R-P+(t?1:0);C.style[t?"left":"top"]=`${N}px`,(L?i:n).appendChild(C)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add("animejs-onscroll-debug"),this.$debug=r,Zt(e.element,"position")==="static"&&(this.debugStyles=Ht(e.element,{position:"relative "}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==J.body;){const E=Zt(o,"position")==="sticky"?Ht(o,{position:"static"}):!1;o=o.parentElement,E&&(e||(e=[]),e.push(E))}const c=t.getBoundingClientRect(),f=s.scale,d=(r?c.left+s.scrollX-s.left:c.top+s.scrollY-s.top)*f,u=(r?c.width:c.height)*f,a=r?s.width:s.height,h=(r?s.scrollWidth:s.scrollHeight)-a,l=this.enter,p=this.leave;let g="start",v="end",_="end",S="start";if(Xe(l)){const E=l.split(" ");_=E[0],g=E.length>1?E[1]:g}else if(We(l)){const E=l;V(E.container)||(_=E.container),V(E.target)||(g=E.target)}else Qe(l)&&(_=l);if(Xe(p)){const E=p.split(" ");S=E[0],v=E.length>1?E[1]:v}else if(We(p)){const E=p;V(E.container)||(S=E.container),V(E.target)||(v=E.target)}else Qe(p)&&(S=p);const y=Ar(t,g,u),m=Ar(t,v,u),b=y+d-a,k=m+d-h,w=Ar(t,_,a,b,k),A=Ar(t,S,a,b,k),M=y+d-w,L=m+d-A,R=L-M;this.offset=d,this.offsetStart=M,this.offsetEnd=L,this.distance=R<=0?0:R,this.thresholds=[g,v,_,S],this.coords=[y,m,w,A],e&&e.forEach(E=>E.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,c=this.scroll,f=c<=this.offsetStart,d=c>=this.offsetEnd,u=!f&&!d,a=c===this.offsetStart||c===this.offsetEnd,h=!this.hasEntered&&a,l=this._debug&&this.$debug;let p=!1,g=!1,v=this.progress;if(f&&this.began&&(this.began=!1),v>0&&!this.began&&(this.began=!0),i){const _=e.progress;if(r&&Qe(r)){if(r<1){const S=_<v&&v===1?1e-4:_>v&&!v?-1e-4:0;v=W(Xt(_,v,Xt(.01,.2,r))+S,6)}}else s&&(v=s(v));p=v!==this.prevProgress,g=_===1,p&&!g&&r&&_&&o.wakeTicker.restart()}if(l){const _=n?o.scrollY:o.scrollX;l.style[n?"top":"left"]=_+10+"px"}(u&&!this.isInView||h&&!this.forceEnter&&!this.hasEntered)&&(u&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(l&&u&&(l.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,h&&(this.forceEnter=!0)):u&&(this.forceEnter=!1)),(u||!u&&this.isInView)&&(p=!0),p&&(i&&e.seek(e.duration*v),this.onUpdate(this)),!u&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(g=!0)),v>=1&&this.began&&!this.completed&&(t&&g||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),v<1&&this.completed&&(this.completed=!1),this.prevProgress=v}revert(){if(this.reverted)return;const e=this.container;return Tt(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},Eu=(e={})=>new xo(e),To=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Au=(e,t,s)=>{let r=0,i=1,n,o,c=0;do o=r+(i-r)/2,n=To(o,t,s)-e,n>0?i=o:r=o;while(mt(n)>1e-7&&++c<100);return o},Co=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?dt:i=>i===0||i===1?i:To(Au(i,e,s),t,r),Po=(e=10,t)=>{const s=t?Xc:bs;return r=>s(j(r,0,1)*e)*(1/e)},Ei=(...e)=>{const t=e.length;if(!t)return dt;const s=t-1,r=e[0],i=e[s],n=[0],o=[is(r)];for(let c=1;c<s;c++){const f=e[c],d=Xe(f)?f.trim().split(" "):[f],u=d[0],a=d[1];n.push(V(a)?c/s:is(a)/100),o.push(is(u))}return o.push(is(i)),n.push(1),function(f){for(let d=1,u=n.length;d<u;d++){const a=n[d];if(f<=a){const h=n[d-1],l=o[d-1];return l+(o[d]-l)*(f-h)/(a-h)}}return o[o.length-1]}},Eo=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,c=o+((i+1)/r-o)*Math.random(),f=o*(1-t)+c*t;s.push(j(f,n,1))}return s.push(1),Ei(...s)},Lu=ds({Spring:()=>wr,createSpring:()=>vo,cubicBezier:()=>Co,eases:()=>Bt,irregular:()=>Eo,linear:()=>Ei,spring:()=>xr,steps:()=>Po}),Lr=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(W(e(r/t),4));return`linear(${s.join(", ")})`},Ao={},Lo=e=>{let t=Ao[e];if(t)return t;if(t="linear",Xe(e)){if(ze(e,"linear")||ze(e,"cubic-")||ze(e,"steps")||ze(e,"ease"))t=e;else if(ze(e,"cubicB"))t=lr(e);else{const s=uo(e);De(s)&&(t=s===dt?"linear":Lr(s))}Ao[e]=t}else if(De(e)){const s=Lr(e);s&&(t=s)}else e.ease&&(t=Lr(e.ease));return t},Ro=["x","y","z"],Ru=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...Ro],Iu=[...Ro,...ss.filter(e=>["X","Y","Z"].some(t=>e.endsWith(t)))],Ai=null,Vs=(e,t,s,r,i)=>{let n=Xe(t)?t:Ve(t,s,r,i,null,null);return Qe(n)?Ru.includes(e)||ze(e,"translate")?`${n}px`:ze(e,"rotate")||ze(e,"skew")?`${n}deg`:`${n}`:n},Io=(e,t,s,r,i,n)=>{let o="0";const c=V(r)?getComputedStyle(e)[t]:Vs(t,r,e,i,n);return V(s)?o=Ze(r)?r.map(f=>Vs(t,f,e,i,n)):c:o=[Vs(t,s,e,i,n),c],o},Oo=class{constructor(e,t){He.current&&He.current.register(this),rs(Ai)&&(Rt&&(V(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"))?Ai=!1:(ss.forEach(h=>{const l=ze(h,"skew"),p=ze(h,"scale"),g=ze(h,"rotate"),v=ze(h,"translate"),_=g||l,S=_?"<angle>":p?"<number>":v?"<length-percentage>":"*";try{CSS.registerProperty({name:"--"+h,syntax:S,inherits:!1,initialValue:v?"0px":_?"0deg":p?"1":"0"})}catch{}}),Ai=!0));const s=Gt(e);s.length||console.warn("No target found. Make sure the element you\'re trying to animate is accessible before creating your animation.");const r=Y(t.autoplay,G.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,c=Y(t.loop,G.defaults.loop),f=c===!0||c===1/0?1/0:Qe(c)?c+1:1,d=n?o?"alternate-reverse":"alternate":o?"reverse":"normal",u="both",a=G.timeScale===1?1:it;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||G.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=Y(t.persist,G.defaults.persist),this.autoplay=r,this._speed=Y(t.playbackRate,G.defaults.playbackRate),this._resolve=oe,this._completed=0,this._inlineStyles=[],s.forEach((h,l)=>{const p=h[Ns],g=Iu.some(L=>t.hasOwnProperty(L)),v=h.style,_=this._inlineStyles[l]={},S=Y(t.ease,G.defaults.ease),y=Ve(S,h,l,s,null,null),m=De(y)||Xe(y)?y:S,b=S.ease&&S,k=Lo(m),w=(b?b.settlingDuration:Ve(Y(t.duration,G.defaults.duration),h,l,s,null,null))*a,A=Ve(Y(t.delay,G.defaults.delay),h,l,s,null,null)*a,M=Y(t.composition,"replace");for(let L in t){if(!ys(L))continue;const R={},E={iterations:f,direction:d,fill:u,easing:k,duration:w,delay:A,composite:M},q=t[L],z=g?ss.includes(L)?L:ci.get(L):!1,X=z?"transform":L;_[X]||(_[X]=v[X]);let C;if(We(q)){const D=q,T=Y(D.ease,k),P=T.ease&&T,N=D.to,H=D.from;if(E.duration=(P?P.settlingDuration:Ve(Y(D.duration,w),h,l,s,null,null))*a,E.delay=Ve(Y(D.delay,A),h,l,s,null,null)*a,E.composite=Y(D.composition,M),E.easing=Lo(T),C=Io(h,L,H,N,l,s),z?(R[`--${z}`]=C,p[z]=C):R[L]=Io(h,L,H,N,l,s),yo(this,h,L,R,E),!V(H))if(!z)v[L]=R[L][0];else{const F=`--${z}`;v.setProperty(F,R[F][0])}}else C=Ze(q)?q.map(D=>Vs(L,D,h,l,s)):Vs(L,q,h,l,s),z?(R[`--${z}`]=C,p[z]=C):R[L]=C,yo(this,h,L,R,E)}if(g){let L="";for(let R in p)L+=`${Dn[R]}var(--${R})) `;v.transform=L}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Xe(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=G.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(G.timeScale===1?1:it);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach("commitStyles")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach("cancel"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform==="none"&&e.style.removeProperty("transform")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];V(n)||n===""?s.removeProperty(lr(i)):e.style[i]=n}e.getAttribute("style")===""&&e.removeAttribute("style")}),this}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Mo={animate:(e,t)=>new Oo(e,t),convertEase:Lr},Ou=0,Mu=0,Rr=(e,t)=>!e||!t?!1:e===t||e.contains(t),xs=e=>{if(!e)return null;const t=e.style,s=t.transition||"";return t.setProperty("transition","none","important"),s},Ir=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty("transition")},Nu=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,xs(s)),r&&!t.has(r)&&t.set(r,xs(r))},Or=e=>{e.forEach((t,s)=>Ir(s,t)),e.clear()},Du={display:"none",visibility:"hidden",opacity:"0",transform:"none",position:"static"},Bu=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},No=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${Mu++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:"none",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},Do=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,c=e.properties,f=e.state.rootNode,d=e.parentNode,u=s.transform,a=i.style.transform,h=d?d.measuredIsRemoved:!1,l=s.position;o&&(e.layout.absoluteCoords=l==="fixed"||l==="absolute"),e.$measure=t,e.inlineTransforms=a,e.hasTransform=u&&u!=="none",e.measuredIsInsideRoot=Rr(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=l,e.measuredHasDisplayNone=s.display==="none",e.measuredHasVisibilityHidden=s.visibility==="hidden",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||h;let p=!1,g=i.previousSibling;for(;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.previousSibling;if(g&&g.nodeType===Node.TEXT_NODE)p=!0;else{for(g=i.nextSibling;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.nextSibling;p=g!==null&&g.nodeType===Node.TEXT_NODE}if(e.isInlined=p,e.hasTransform&&!r){const k=e.layout.transitionMuteStore;k.get(i)||(e.inlineTransition=xs(i)),t===i?i.style.transform="none":(k.get(t)||(e.measuredInlineTransition=xs(t)),e.measuredInlineTransform=t.style.transform,t.style.transform="none")}let v=0,_=0,S=0,y=0;if(!r){const k=t.getBoundingClientRect();v=k.left,_=k.top,S=k.width,y=k.height}for(let k in c){const w=k==="transform"?u:s[k]||s.getPropertyValue&&s.getPropertyValue(k);V(w)||(c[k]=w)}c.left=v,c.top=_,c.clientLeft=r?0:t.clientLeft,c.clientTop=r?0:t.clientTop;let m,b;if(o)e.layout.absoluteCoords?(m=v,b=_):(m=0,b=0);else{const k=d||f,w=k.properties.left,A=k.properties.top,M=k.properties.clientLeft,L=k.properties.clientTop;if(e.layout.absoluteCoords)m=v-w-M,b=_-A-L;else if(k===f){const R=f.properties.left,E=f.properties.top,q=f.properties.clientLeft,z=f.properties.clientTop;m=v-R-q,b=_-E-z}else m=v-w-M,b=_-A-L}return c.x=m,c.y=b,c.width=S,c.height=y,e},Bo=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},zs=(e,t)=>{const s=Ve(t.ease,e.$el,e.index,e.targets,null,null),r=De(s)?s:t.ease,i=!V(r)&&!V(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Ve(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Ve(t.delay,e.$el,e.index,e.targets,null,null)},$u=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||"")})},$o=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==""?t[n]=o:(t[n]="",t.removeProperty(n))}},qu=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform==="none"||t&&t==="none"?s.removeProperty("transform"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==""?i.transform=n:i.removeProperty("transform")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(Ir(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(Ir(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},qo=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty("display"),e.$el.style.removeProperty("visibility"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty("display"),e.$measure.style.removeProperty("visibility"))),e.layout.pendingRemoval.delete(e.$el)},Li=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),Ho=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute("data-layout-id"),e.$measure.removeAttribute("data-layout-id")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,xs(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||cr(o))continue;const c=n?n.measuredIsRemoved:!1,f=c?Du:getComputedStyle(o),d=c?!0:f.display==="none",u=c?!0:f.visibility==="hidden",a=!d&&!u,h=o.dataset.layoutId,l=Rr(r,o);let p=h?this.nodes.get(h):null;if(p&&p.$el!==o){const v=Rr(r,p.$el),_=p.measuredIsVisible,S=!v&&(l||!l&&!_&&a),y=v&&!_&&a;if(S)Bu(p),p=No(o,n,this,p);else if(y){Do(p,o,f,c);let m=o.lastElementChild;for(;m;)s.push(m,p),m=m.previousElementSibling;i||(i=p);continue}else{let m=o.lastElementChild;for(;m;)s.push(m,n),m=m.previousElementSibling;i||(i=p);continue}}else p=No(o,n,this,p);p.branchAdded=!1,p.branchRemoved=!1,p.branchNotRendered=!1,p.isTarget=!1,p.sizeChanged=!1,p.hasVisibilityHidden=u,p.hasDisplayNone=d,p.hasVisibilitySwap=u&&!p.measuredHasVisibilityHidden||d&&!p.measuredHasDisplayNone,this.nodes.set(p.id,p),p.parentNode=n||null,p._prev=null,p._next=null,n?(this.rootNodes.delete(p),n._head?(n._tail._next=p,p._prev=n._tail,n._tail=p):(n._head=p,n._tail=p)):this.rootNodes.add(p),Do(p,p.$el,f,c);let g=o.lastElementChild;for(;g;)s.push(g,p),g=g.previousElementSibling;i||(i=p)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=Ze(t)?t:[t],i=[],n=t==="*"?s:He.root,o=[];let c=s.parentElement;for(;c&&c.nodeType===1;){const g=getComputedStyle(c);if(g.transform&&g.transform!=="none"){const v=c.style.transform||"",_=xs(c);o.push(c,v,_),c.style.transform="none"}c=c.parentElement}for(let g=0,v=r.length;g<v;g++){const _=r[g];i[g]=Xe(_)?n.querySelectorAll(_):_}const f=Gt(i);this.nodes.clear(),this.rootNodes.clear();const d=this.registerElement(s,null);d.isTarget=!0,this.rootNode=d;const u=new Set;let a=0;const h=[];this.nodes.forEach(g=>{h.push(g.$el)}),this.nodes.forEach((g,v)=>{g.index=a++,g.targets=h,g&&g.measuredIsInsideRoot&&u.add(v)});const l=new Set,p=[];for(let g=0,v=f.length;g<v;g++){const _=f[g];if(!(!_||_.nodeType!==1||_===s)){if(!Rr(s,_)){const S=_.dataset.layoutId;if(!S||!u.has(S))continue}l.has(_)||(l.add(_),p.push(_))}}for(let g=0,v=p.length;g<v;g++)this.ensureDetachedNode(p[g],l);for(let g=0,v=f.length;g<v;g++){const _=f[g],S=this.getNode(_);if(S){let y=S;for(;y&&!y.isTarget;)y.isTarget=!0,y=y.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(qu);for(let g=0,v=o.length;g<v;g+=3){const _=o[g],S=o[g+1],y=o[g+2];S&&S!==""?_.style.transform=S:_.style.removeProperty("transform"),Ir(_,y)}return this}};function Ts(e){const t={},s={};for(let r in e){const i=e[r],n=r==="ease";r==="duration"||r==="delay"||n?s[r]=i:t[r]=i}return[t,s]}var Fo=class{constructor(e,t={}){He.current&&He.current.register(this);const s=Ts(t.swapAt),r=Ts(t.enterFrom),i=Ts(t.leaveTo),n=t.properties;if(t.duration=Y(t.duration,350),t.delay=Y(t.delay,0),t.ease=Y(t.ease,"inOut(3.5)"),this.params=t,this.root=Gt(e)[0],this.id=t.id||Ou++,this.children=t.children||"*",this.absoluteCoords=!1,this.swapAtParams=vt(t.swapAt||{opacity:0},{ease:"inOut(1.75)"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set(["opacity","fontSize","color","backgroundColor","borderRadius","border","filter","clipPath"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,c=n.length;o<c;o++)this.properties.add(n[o]);this.recordedProperties=new Set(["display","visibility","translate","position","left","top","marginLeft","marginTop","width","height","maxWidth","maxHeight","minWidth","minHeight"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new Ho(this),this.newState=new Ho(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),Or(this.transitionMuteStore)}revert(){return this.root.classList.remove("is-animated"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>Or(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode($o),this}animate(e={}){const t={ease:Y(e.ease,this.params.ease),delay:Y(e.delay,this.params.delay),duration:Y(e.duration,this.params.duration)},s={id:this.id},r=Y(e.onComplete,this.params.onComplete),i=Y(e.onPause,this.params.onPause);for(let C in Ds)C!=="ease"&&C!=="duration"&&C!=="delay"&&(V(e[C])?V(this.params[C])||(s[C]=this.params[C]):s[C]=e[C]);s.onComplete=()=>{const C=e.autoplay,D=G.editor;if(C&&C.linked||D&&D.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(T=>{qo(T),$o(T)});for(let T=0,P=w.length;T<P;T++){const N=w[T];N.style.transform=g.getComputedValue(N,"transform")}this.root.classList.contains("is-animated")&&(this.root.classList.remove("is-animated"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains("is-animated")||Or(this.transitionMuteStore)})},s.onPause=()=>{const C=e.autoplay;if(C&&C.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains("is-animated")&&(this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(qo),this.root.classList.remove("is-animated"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=vt(vt(e.swapAt||{},this.swapAtParams),t),o=vt(vt(e.enterFrom||{},this.enterFromParams),t),c=vt(vt(e.leaveTo||{},this.leaveToParams),t),[f,d]=Ts(n),[u,a]=Ts(o),[h,l]=Ts(c),p=this.oldState,g=this.newState,v=this.animating,_=this.swapping,S=this.entering,y=this.leaving,m=this.pendingRemoval;v.length=_.length=S.length=y.length=0,p.forEachRootNode(Nu),g.record(),g.forEachRootNode($u);const b=[],k=[],w=[],A=[],M=g.rootNode,L=M.$el;g.forEachRootNode(C=>{const D=C.$el,T=C.id,P=C.parentNode,N=P?P.branchAdded:!1,H=P?P.branchRemoved:!1,F=P?P.branchNotRendered:!1;let $=p.nodes.get(T);const Z=!$;Z?($=Li(C,{},p),p.nodes.set(T,$),$.measuredIsRemoved=!0):$.measuredIsRemoved&&!C.measuredIsRemoved&&(Li(C,$,p),$.measuredIsRemoved=!0);const K=$.parentNode,ee=(K?K.id:null)!==(P?P.id:null),me=$.$el!==C.$el,ve=$.measuredIsRemoved,re=C.measuredIsRemoved;if(!$.measuredIsRemoved&&!re&&!Z&&(ee||me)){const Te=$.properties.left,ge=$.properties.top,Le=P||g.rootNode,ke=Le.id?p.nodes.get(Le.id):null,ie=ke?ke.properties.left:Le.properties.left,_e=ke?ke.properties.top:Le.properties.top,we=ke?ke.properties.clientLeft:Le.properties.clientLeft,Me=ke?ke.properties.clientTop:Le.properties.clientTop;$.properties.x=Te-ie-we,$.properties.y=ge-_e-Me}C.hasVisibilitySwap&&(C.hasVisibilityHidden&&(C.$el.style.visibility="visible",C.$measure.style.visibility="hidden"),C.hasDisplayNone&&(C.$el.style.display=$.measuredDisplay||C.measuredDisplay||"",C.$measure.style.visibility="hidden"));const Q=m.has(D),ue=$.measuredIsVisible,Pe=C.measuredIsVisible,Ee=!ue&&Pe&&!F,xe=!re&&(ve||Q)&&!N,Ae=re&&!ve&&!H,be=Ae||re&&Q&&!H;C.branchAdded=N||xe,C.branchRemoved=H||be,C.branchNotRendered=F||re,re&&ue&&(C.$el.style.display=$.measuredDisplay,C.$el.style.visibility="visible",Li($,C,g)),Ae?(C.isTarget&&(y.push(D),C.isLeaving=!0),m.add(D)):!re&&Q&&m.delete(D),xe&&!F||Ee?(Bo($,u),C.isTarget&&(S.push(D),C.isEntering=!0)):be&&!F&&Bo(C,h),C!==M&&C.isTarget&&!C.isEntering&&!C.isLeaving&&v.push(D),b.push(D)});let R=0,E=0,q=0;g.forEachRootNode(C=>{const D=C.$el,T=C.parentNode,P=p.nodes.get(C.id),N=C.properties,H=P.properties;let F=T!==M&&T;for(;F&&!F.isTarget&&F!==M;)F=F.parentNode;C===M?(C.index=0,C.targets=v,zs(C,t)):C.isEntering?(C.index=F?F.index:R,C.targets=F?v:S,zs(C,a),R++):C.isLeaving?(C.index=F?F.index:E,C.targets=F?v:y,E++,zs(C,l)):C.isTarget?(C.index=q++,C.targets=v,zs(C,t)):(C.index=F?F.index:0,C.targets=v,zs(C,d)),P.index=C.index,P.targets=C.targets;for(let ee in N)N[ee]=Ve(N[ee],D,C.index,C.targets,null,null),H[ee]=Ve(H[ee],D,P.index,P.targets,null,null);const $=1,Z=Math.abs(N.width-H.width)>$,K=Math.abs(N.height-H.height)>$;if(C.sizeChanged=Z||K,C.isTarget&&(!C.measuredIsRemoved&&P.measuredIsVisible||C.measuredIsRemoved&&C.measuredIsVisible)){(N.transform!=="none"||H.transform!=="none")&&(C.hasTransform=!0,w.push(D));for(let ee in N)if(ee!=="transform"&&N[ee]!==H[ee]){k.push(D);break}}C.isTarget||(_.push(D),C.sizeChanged&&T&&T.isTarget&&T.sizeChanged&&(f.transform&&(C.hasTransform=!0,w.push(D)),A.push(D)))});const z={delay:C=>g.getNode(C).delay,duration:C=>g.getNode(C).duration,ease:C=>g.getNode(C).ease};if(s.defaults=z,this.timeline=mo(s),!k.length&&!w.length&&!_.length)return Or(this.transitionMuteStore),this.timeline.complete();if(b.length){this.root.classList.add("is-animated");for(let C=0,D=b.length;C<D;C++){const T=b[C],P=T.dataset.layoutId,N=p.nodes.get(P),H=g.nodes.get(P),F=N.properties;H.isInlined||((N.measuredDisplay==="grid"||H.measuredDisplay==="grid")&&T.style.setProperty("display","block","important"),(T!==L||this.absoluteCoords)&&(T.style.position=this.absoluteCoords?"fixed":"absolute",T.style.left="0px",T.style.top="0px",T.style.marginLeft="0px",T.style.marginTop="0px",T.style.translate=`${F.x}px ${F.y}px`),T===L&&H.measuredPosition==="static"&&(T.style.position="relative",T.style.left="0px",T.style.top="0px")),T.style.width=`${F.width}px`,T.style.height=`${F.height}px`,T.style.minWidth="auto",T.style.minHeight="auto",T.style.maxWidth="none",T.style.maxHeight="none"}(p.scrollX!==window.scrollX||p.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(p.scrollX,p.scrollY));for(let C=0,D=k.length;C<D;C++){const T=k[C],P=T.dataset.layoutId,N=p.nodes.get(P),H=g.nodes.get(P),F=N.properties,$=H.properties;let Z=!1;const K={composition:"none"};F.width!==$.width&&(K.width=[F.width,$.width],Z=!0),F.height!==$.height&&(K.height=[F.height,$.height],Z=!0),!H.hasTransform&&!H.isInlined&&(K.translate=[`${F.x}px ${F.y}px`,`${$.x}px ${$.y}px`],Z=!0),this.properties.forEach(ee=>{const me=F[ee],ve=$[ee];ee!=="transform"&&me!==ve&&(K[ee]=[me,ve],Z=!0)}),Z&&this.timeline.add(T,K,0)}}if(_.length){for(let C=0,D=_.length;C<D;C++){const T=_[C],P=p.getNode(T),N=P.properties;T.style.width=`${N.width}px`,T.style.height=`${N.height}px`,T.style.minWidth="auto",T.style.minHeight="auto",T.style.maxWidth="none",T.style.maxHeight="none",P.isInlined||(T.style.translate=`${N.x}px ${N.y}px`),this.properties.forEach(H=>{H!=="transform"&&(T.style[H]=`${p.getComputedValue(T,H)}`)})}for(let C=0,D=_.length;C<D;C++){const T=_[C],P=g.getNode(T),N=P.properties;this.timeline.call(()=>{T.style.width=`${N.width}px`,T.style.height=`${N.height}px`,T.style.minWidth="auto",T.style.minHeight="auto",T.style.maxWidth="none",T.style.maxHeight="none",P.isInlined||(T.style.translate=`${N.x}px ${N.y}px`),this.properties.forEach(H=>{H!=="transform"&&(T.style[H]=`${g.getComputedValue(T,H)}`)})},P.delay+P.duration/2)}if(A.length){const C=$t(g.nodes.get(A[0].dataset.layoutId).ease),D=P=>1-C(1-P),T={};if(f)for(let P in f)P!=="transform"&&(T[P]=[{from:N=>p.getComputedValue(N,P),to:f[P]},{from:f[P],to:N=>g.getComputedValue(N,P),ease:D}]);this.timeline.add(A,T,0)}}const X=w.length;if(X){for(let C=0;C<X;C++){const D=w[C],T=g.getNode(D);T.isInlined||(D.style.translate=`${p.getComputedValue(D,"x")}px ${p.getComputedValue(D,"y")}px`),D.style.transform=p.getComputedValue(D,"transform"),A.includes(D)&&(T.ease=Ve(n.ease,D,T.index,T.targets,null,null),T.duration=Ve(n.duration,D,T.index,T.targets,null,null))}this.transformAnimation=Mo.animate(w,{translate:C=>g.getNode(C).isInlined?"0px 0px":`${g.getComputedValue(C,"x")}px ${g.getComputedValue(C,"y")}px`,transform:C=>{const D=g.getComputedValue(C,"transform");if(!A.includes(C))return D;const T=p.getComputedValue(C,"transform"),P=g.getNode(C);return[T,Ve(f.transform,C,P.index,P.targets,null,null),D]},autoplay:!1,...z}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},Hu=(e,t)=>new Fo(e,t),yt=du,Mr={},Fu=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),Vo=e=>(...t)=>{const s=e(...t);return new Proxy(oe,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(Mr[i])return Vo((...n)=>{const o=Mr[i](...n);return c=>o(s(c))})}})},bt=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?Vo(Fu(t,s)):t)(...i);return Mr[e]||(Mr[e]=r),r},zo=bt("roundPad",yt.roundPad),Uo=bt("padStart",yt.padStart),Wo=bt("padEnd",yt.padEnd),Xo=bt("wrap",yt.wrap),Go=bt("mapRange",yt.mapRange),Yo=bt("degToRad",yt.degToRad),Zo=bt("radToDeg",yt.radToDeg),jo=bt("snap",yt.snap),Jo=bt("clamp",yt.clamp),Qo=bt("round",yt.round),Ko=bt("lerp",yt.lerp,1),ea=bt("damp",yt.damp,1),Us=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Vu=0,Ws=(e,t=0,s=1,r=0)=>{let i=e===void 0?Vu++:e;return(n=t,o=s,c=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const f=10**c;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/f)+n)*f)/f}},ta=e=>e[Us(0,e.length-1)],Ri=(e,t=Us)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},Xs=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,c=t.reversed,f=t.ease,d=!V(f),u=d&&!V(f.ease)?f.ease:d?$t(f):null,a=t.grid,h=a===!0,l=t.axis,p=t.total,g=V(o)||o===0||o==="first",v=o==="center",_=o==="last",S=o==="random",y=Ze(o),m=Ze(e),b=t.use,k=is(m?e[0]:e),w=m?is(e[1]):0,A=$n.exec((m?e[1]:e)+""),M=t.start||0+(m?k:0),L=t.seed,R=!V(L)&&L!==!1?Ws(L===!0?0:L):Us,E=t.jitter,q=!V(E),z=Ze(E),X=z?E[0]:E||0,C=z?E[1]:E||0;let D=g?0:Qe(o)?o:0;return(T,P,N,H,F)=>{const[$]=Gt(T),Z=V(p)?N.length:p,K=V(b)?!1:De(b)?b($,P,Z):as($,b),ee=Qe(K)||Xe(K)&&Qe(+K)?+K:P,me=ee>=0&&ee<Z?ee:P;if(v&&(D=(Z-1)/2),_&&(D=Z-1),!s.length){if(h){let Q=!0,ue=!1,Pe=1/0,Ee=1/0,xe=1/0,Ae=-1/0,be=-1/0,Te=-1/0;const ge=[],Le=[],ke=[];for(let ie=0;ie<Z;ie++){const _e=N[ie];let we=0,Me=0,B=0,ae=!1;if(_e&&De(_e.getBoundingClientRect)){const fe=_e.getBoundingClientRect();we=fe.left+fe.width/2,Me=fe.top+fe.height/2,ae=!0}else{const fe=_e;fe&&Qe(fe.x)&&Qe(fe.y)&&(we=fe.x,Me=fe.y,Qe(fe.z)&&(B=fe.z,ue=!0),ae=!0)}if(!ae){Q=!1;break}ge.push(we),Le.push(Me),ke.push(B),we<Pe&&(Pe=we),Me<Ee&&(Ee=Me),B<xe&&(xe=B),we>Ae&&(Ae=we),Me>be&&(be=Me),B>Te&&(Te=B)}if(Q){let ie=ge[0],_e=Le[0],we=ke[0];y?(ie=Pe+o[0]*(Ae-Pe),_e=Ee+o[1]*(be-Ee),we=ue?xe+(o.length>=3?o[2]:.5)*(Te-xe):0):v?(ie=(Pe+Ae)/2,_e=(Ee+be)/2,we=(xe+Te)/2):_?(ie=ge[Z-1],_e=Le[Z-1],we=ke[Z-1]):Qe(o)&&(ie=ge[o],_e=Le[o],we=ke[o]);for(let B=0;B<Z;B++){const ae=ie-ge[B],fe=_e-Le[B],le=we-ke[B];let te=gt(ae*ae+fe*fe+(ue?le*le:0));l==="x"&&(te=-ae),l==="y"&&(te=-fe),l==="z"&&(te=-le),s.push(te)}let Me=1/0;for(let B=0;B<Z;B++){const ae=mt(s[B]);ae>0&&ae<Me&&(Me=ae)}if(Me>0&&Me<1/0)for(let B=0;B<Z;B++)s[B]=s[B]/Me}else for(let ie=0;ie<Z;ie++)s.push(mt(D-ie))}else for(let Q=0;Q<Z;Q++)if(!a)s.push(mt(D-Q));else{const ue=a.length,Pe=a[0]*a[1];let Ee,xe,Ae;y?(Ee=o[0]*(a[0]-1),xe=o[1]*(a[1]-1),Ae=ue===3?(o.length>=3?o[2]:.5)*(a[2]-1):0):v?(Ee=(a[0]-1)/2,xe=(a[1]-1)/2,Ae=ue===3?(a[2]-1)/2:0):(Ee=D%a[0],xe=bs(D/a[0])%a[1],Ae=ue===3?bs(D/Pe):0);const be=Q%a[0],Te=bs(Q/a[0])%a[1],ge=ue===3?bs(Q/Pe):0,Le=Ee-be,ke=xe-Te,ie=Ae-ge;let _e=gt(Le*Le+ke*ke+(ue===3?ie*ie:0));l==="x"&&(_e=-Le),l==="y"&&(_e=-ke),l==="z"&&(_e=-ie),s.push(_e)}r=s[0];for(let Q=1;Q<Z;Q++)s[Q]>r&&(r=s[Q]);if(u||c)for(let Q=0;Q<Z;Q++){let ue=s[Q];u&&(ue=u(ue/r)*r),c&&(ue=l?-ue:mt(r-ue)),s[Q]=ue}if(q){n=new Array(Z);for(let Q=0;Q<Z;Q++)n[Q]=R(-1,1,4)}S&&(s=Ri(s,R))}const ve=m?(w-k)/r:k;V(i)&&(i=F?qs(F,V(t.start)?F.iterationDuration:M):M);let re=i+(ve*W(s[me],2)||0);if(q){const Q=r?s[me]/r:0,ue=X+(C-X)*Q;re=re+n[me]*ue}return t.modifier&&(re=t.modifier(re)),A&&(re=`${re}${A[2]}`),re}},zu=ds({$:()=>Gt,addChild:()=>Ct,clamp:()=>Jo,cleanInlineStyles:()=>Qn,createSeededRandom:()=>Ws,damp:()=>ea,degToRad:()=>Yo,forEachChildren:()=>Ce,get:()=>Zt,keepTime:()=>Cr,lerp:()=>Ko,mapRange:()=>Go,padEnd:()=>Wo,padStart:()=>Uo,radToDeg:()=>Zo,random:()=>Us,randomPick:()=>ta,remove:()=>bo,removeChild:()=>Tt,round:()=>Qo,roundPad:()=>zo,set:()=>Ht,shuffle:()=>Ri,snap:()=>jo,stagger:()=>Xs,sync:()=>Pi,wrap:()=>Xo}),sa=e=>{const t=ht(e)[0];return!t||!cr(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},Ii=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},Oi=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[li],o=e.getCTM(),c=s===0;return{from:0,to:i,modifier:f=>{const d=f+s*i;if(t==="a"){const u=Ii(e,i,d,-1,c),a=Ii(e,i,d,1,c);return hr(a.y-u.y,a.x-u.x)*180/It}else{const u=Ii(e,i,d,0,c);return t==="x"?n||!o?u.x:u.x*o.a+u.y*o.c+o.e:n||!o?u.y:u.x*o.b+u.y*o.d+o.f}}}},ra=(e,t=0)=>{const s=sa(e);if(s)return{translateX:Oi(s,"x",t),translateY:Oi(s,"y",t),rotate:Oi(s,"a",t)}},Uu=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(gt(s.a*s.a+s.b*s.b)+gt(s.c*s.c+s.d*s.d))/2)}return t},Wu=(e,t,s)=>{const r=it,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect==="non-scaling-stroke"?e:null;let c=n;const f=new Proxy(e,{get(d,u){const a=d[u];return u===Nn?d:u==="setAttribute"?(...h)=>{if(h[0]==="draw"){const l=h[1].split(" "),p=+l[0],g=+l[1],v=Uu(o),_=p*-r*v,S=g*r*v+_,y=r*v+(p===0&&g===1||p===1&&g===0?0:10*v)-S;if(n!=="butt"){const m=p===g?"butt":n;c!==m&&(d.style.strokeLinecap=`${m}`,c=m)}d.setAttribute("stroke-dashoffset",`${_}`),d.setAttribute("stroke-dasharray",`${S} ${y}`)}return Reflect.apply(a,d,h)}:De(a)?(...h)=>Reflect.apply(a,d,h):a}});return e.getAttribute("pathLength")!==`${r}`&&(e.setAttribute("pathLength",`${r}`),f.setAttribute("draw",`${t} ${s}`)),f},ia=(e,t=0,s=0)=>ht(e).map(r=>Wu(r,t,s)),na=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can\'t morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=sa(e);if(!o)throw new Error("Can\'t morph to an invalid target. \'path2\' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");if(!(o.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can\'t morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const c=s.tagName==="path",f=c?" ":",",d=n?n._value:null;d&&s.setAttribute(c?"d":"points",d);let u="",a="";if(!t)u=s.getAttribute(c?"d":"points"),a=o.getAttribute(c?"d":"points");else{const h=s.getTotalLength(),l=o.getTotalLength(),p=Math.max(Math.ceil(h*t),Math.ceil(l*t));for(let g=0;g<p;g++){const v=g/(p-1),_=s.getPointAtLength(h*v),S=o.getPointAtLength(l*v),y=c?g===0?"M":"L":"";u+=y+W(_.x,3)+f+_.y+" ",a+=y+W(S.x,3)+f+S.y+" "}}return[u,a]},Xu=ds({createDrawable:()=>ia,createMotionPath:()=>ra,morphTo:()=>na}),Nr=typeof Intl<"u"&&Intl.Segmenter,Gu=/\\{value\\}/g,Yu=/\\{i\\}/g,Mi=/(\\s+)/,Ni=/^\\s+$/,Di="line",Gs="word",Ys="char",Zs="data-line",Bi=null,$i=null,Dr=null,oa=e=>e.isWordLike||e.segment===" "||Qe(+e.segment),qi=e=>e.setAttribute("aria-hidden","true"),Br=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],Zu={line:"#00D672",word:"#FF4B4B",char:"#5A87FF"},aa=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&aa(t)}},la=(e,t,s)=>{const r=e.getAttribute(Zs);if(r!==null&&+r!==t||e.tagName==="BR"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&Ni.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&Ni.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)la(e.children[i],t,s);return s},Hi=(e,t={})=>{let s="";t||(t={});const r=Xe(t.class)?` class="${t.class}"`:"",i=Y(t.clone,!1),n=Y(t.wrap,!1),o=n?n===!0?"clip":n:i?"clip":!1;if(n&&(s+=`<span${o?` style="overflow:${o};"`:""}>`),s+=`<span${r}${i?\' style="position:relative;"\':""} data-${e}="{i}">`,i){const c=i==="left"?"-100%":i==="right"?"100%":"0",f=i==="top"?"-100%":i==="bottom"?"100%":"0";s+="<span>{value}</span>",s+=`<span inert style="position:absolute;top:${f};left:${c};white-space:nowrap;">{value}</span>`}else s+="{value}";return s+="</span>",n&&(s+="</span>"),s},Fi=(e,t,s,r,i,n,o,c,f)=>{const d=i===Di,u=i===Ys,a=`_${i}_`,h=De(e)?e(s):e,l=d?"block":"inline-block";Dr.innerHTML=h.replace(Gu,`<i class="${a}"></i>`).replace(Yu,`${u?f:d?o:c}`);const p=Dr.content,g=p.firstElementChild,v=p.querySelector(`[data-${i}]`)||g,_=p.querySelectorAll(`i.${a}`),S=_.length;if(S){g.style.display=l,v.style.display=l,v.setAttribute(Zs,`${o}`),d||(v.setAttribute("data-word",`${c}`),u&&v.setAttribute("data-char",`${f}`));let y=S;for(;y--;){const m=_[y],b=m.parentElement;b.style.display=l,d?b.innerHTML=s.innerHTML:b.replaceChild(s.cloneNode(!0),m)}t.push(v),r.appendChild(p)}else console.warn(\'The expression "{value}" is missing from the provided template.\');return n&&(g.style.outline=`1px dotted ${Zu[i]}`),g},$r=class{constructor(e,t={}){Bi||(Bi=Nr?new Nr([],{granularity:Gs}):{segment:l=>{const p=[],g=l.split(Mi);for(let v=0,_=g.length;v<_;v++){const S=g[v];p.push({segment:S,isWordLike:!Ni.test(S)})}return p}}),$i||($i=Nr?new Nr([],{granularity:"grapheme"}):{segment:l=>[...l].map(p=>({segment:p}))}),!Dr&&Rt&&(Dr=J.createElement("template")),He.current&&He.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:c}=t,f=(e=Ze(e)?e[0]:e)&&e.nodeType?e:(_i(e)||[])[0],d=i===!0?{}:i,u=s===!0||V(s)?{}:s,a=r===!0?{}:r;this.debug=Y(c,!1),this.includeSpaces=Y(o,!1),this.accessible=Y(n,!0),this.linesOnly=d&&!u&&!a,this.lineTemplate=We(d)?Hi(Di,d):d,this.wordTemplate=We(u)||this.linesOnly?Hi(Gs,u):u,this.charTemplate=We(a)?Hi(Ys,a):a,this.$target=f,this.html=f&&f.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const h=()=>this.html&&(d||u||a)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const l=f.offsetWidth;l!==this.width&&(this.width=l,h())},150)}),this.lineTemplate&&!this.ready?J.fonts.ready.then(h):h(),f?this.resizeObserver.observe(f):console.warn("No Text Splitter target found.")}addEffect(e){if(!De(e))return console.warn("Effect must return a function."),this;const t=Cr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>De(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const c=[],f=this.words,d=this.chars,u=Bi.segment(o),a=J.createDocumentFragment();let h=null;for(const l of u){const p=l.segment,g=oa(l);if(!h||g&&h&&oa(h))c.push(p);else{const v=c.length-1,_=c[v];!Mi.test(_)&&!Mi.test(p)?c[v]+=p:c.push(p)}h=l}for(let l=0,p=c.length;l<p;l++){const g=c[l];if(g.trim()){const v=c[l+1],_=r&&v&&!v.trim(),S=g,y=s?$i.segment(S):null,m=s?J.createDocumentFragment():J.createTextNode(_?g+" ":g);if(s){const b=[...y];for(let k=0,w=b.length;k<w;k++){const A=b[k],M=k===w-1&&_?A.segment+" ":A.segment,L=J.createTextNode(M);Fi(s,d,L,m,Ys,i,-1,f.length,d.length)}}t?Fi(t,f,m,a,Gs,i,-1,f.length,d.length):s?a.appendChild(m):a.appendChild(J.createTextNode(g)),_&&l++}else{if(l&&r)continue;a.appendChild(J.createTextNode(g))}}e.parentNode.replaceChild(a,e)}}else if(n===1){const o=[...e.childNodes];for(let c=0,f=o.length;c<f;c++)this.splitNode(o[c])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=J.fonts.status!=="loading",c=r&&o;this.ready=!r||o,(c||e)&&this.effectsCleanups.forEach(a=>De(a)&&a(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),c&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=Br(t,Gs))),n&&(c||i)&&(this.chars=Br(t,Ys));const f=this.words.length?this.words:this.chars;let d,u=0;for(let a=0,h=f.length;a<h;a++){const l=f[a],{top:p,height:g}=l.getBoundingClientRect();!V(d)&&p-d>g*.5&&u++,l.setAttribute(Zs,`${u}`);const v=l.querySelectorAll(`[${Zs}]`);let _=v.length;for(;_--;)v[_].setAttribute(Zs,`${u}`);d=p}if(c){const a=J.createDocumentFragment(),h=new Set,l=[];for(let p=0;p<u+1;p++){const g=t.cloneNode(!0);la(g,p,new Set).forEach(v=>{const _=v.parentNode;_&&(v.nodeType===1&&h.add(_),_.removeChild(v))}),l.push(g)}h.forEach(aa);for(let p=0,g=l.length;p<g;p++)Fi(r,this.lines,l[p],a,Di,this.debug,p);t.innerHTML="",t.appendChild(a),i&&(this.words=Br(t,Gs)),n&&(this.chars=Br(t,Ys))}if(this.linesOnly){const a=this.words;let h=a.length;for(;h--;){const l=a[h];l.replaceWith(l.textContent)}a.length=0}if(this.accessible&&(c||!s)){const a=J.createElement("span");a.style.cssText="position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;",a.innerHTML=this.html,t.insertBefore(a,t.firstChild),this.lines.forEach(qi),this.words.forEach(qi),this.chars.forEach(qi)}return this.width=t.offsetWidth,(c||e)&&this.effects.forEach((a,h)=>this.effectsCleanups[h]=a(this)),this}refresh(){this.split(!0)}},ca=(e,t)=>new $r(e,t),js=(e,t)=>(console.warn("text.split() is deprecated, import splitText() directly, or text.splitText()"),new $r(e,t)),ua=e=>{let t="";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]==="-"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},ha={lowercase:"a-z",uppercase:"A-Z",numbers:"0-9",symbols:"!%#_|*+=",braille:"⠀-⣿",blocks:"▀-▟",shades:"░-▓"},Vi=new WeakMap,da=(e={})=>{e||(e={});const t=e.chars,s=$t(e.ease||"linear"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,c=e.cursor,f=c===!0?"_":typeof c=="number"?String.fromCharCode(c):typeof c=="string"?c:"",d=f.length,u=e.seed||0,a=e.override!==void 0?e.override:!0,h=e.revealRate||60,l=1e3*G.timeScale/h,p=e.settleDuration||300*G.timeScale,g=e.settleRate||30,v=e.duration,_=e.revealDelay,S=e.delay,y=e.onChange||oe;return(m,b,k,w)=>{const A=typeof t=="function"?t(m,b,k):t||"a-zA-Z0-9!%#_",M=ua(ha[A]||A),L=M.length-1,R=typeof v=="function"?v(m,b,k):v,E=typeof _=="function"?_(m,b,k):_||0,q=typeof S=="function"?S(m,b,k):S||0,z=u?Ws(u):Ws();Vi.has(m)||Vi.set(m,m.textContent);const X=w?w._value:m.textContent,C=r!==void 0?typeof r=="function"?r(m,b,k):r:w?w._value:Vi.get(m),D=C===" "||C==="&nbsp;"?" ":C,T=X===" "?0:X.length,P=D.length,N=a===!0?M:typeof a=="string"&&a.length>0?ua(ha[a]||a):null,H=N?N.length-1:0,F=a===" "?" ":null,$=a===""?P:Math.max(T,P),Z=R>0?R:($-1)*l+p,K=W((Z+E)/G.timeScale,0)*G.timeScale,ee=E>0?W(E/K,12):0,me=i===void 0||i==="auto"?P<T?"right":"left":i,ve=new Int32Array($);if(me==="random"){for(let B=0;B<$;B++)ve[B]=B;for(let B=$-1;B>0;B--){const ae=z(0,B),fe=ve[B];ve[B]=ve[ae],ve[ae]=fe}}else{const B=me==="right"?(a===""||!T?$:T)-1:me==="center"?((a===""||!T?$:T)-1)/2:typeof me=="number"?me:0,ae=Math.abs,fe=new Array($);for(let le=0;le<$;le++)fe[le]=le;fe.sort((le,te)=>ae(le-B)-ae(te-B));for(let le=0;le<$;le++)ve[fe[le]]=le}if(n){const B=$-1;for(let ae=0;ae<$;ae++)ve[ae]=B-ve[ae]}const re=W(p/Z,12),Q=W((1-re)/$,12),ue=d*Q,Pe=W(1e3*G.timeScale/(g*K),12),Ee=new Float32Array($),xe=new Float32Array($),Ae=o>0?o*re:0;for(let B=0;B<$;B++){const ae=Ae>0?(z(0,2e3)-1e3)/1e3*Ae:0,fe=Ae>0?(z(0,2e3)-1e3)/1e3*Ae:0;Ee[B]=ve[B]*Q+ae,xe[B]=Math.ceil((Ee[B]+re+fe)/Pe)*Pe}if(P<$&&me!=="left"&&me!=="right"&&me!=="random"){let B=0;for(let le=P;le<$;le++)xe[le]>B&&(B=xe[le]);const ae=new Array(P);for(let le=0;le<P;le++)ae[le]=le;ae.sort((le,te)=>ve[le]-ve[te]);const fe=(1-B)/P;for(let le=0;le<P;le++){const te=B+le*fe;te>xe[ae[le]]&&(xe[ae[le]]=te)}}const be=new Array($);for(let B=0;B<$;B++)be[B]=M[z(0,L)];const Te=N?N===M?be:new Array($):null;if(Te&&Te!==be)for(let B=0;B<$;B++)Te[B]=F||N[z(0,N.length-1)];let ge=X;if(!w){if(a==="")ge="";else if(N){ge="";for(let B=0;B<T;B++)ge+=X[B]===" "?" ":Te[B]}}let Le=-1,ke=-1,ie="";const _e=a!=="",we=!!N,Me=d>0;return{from:0,to:1,duration:K,delay:q,ease:"linear",modifier:B=>{if(B===Le)return ie;if(Le=B,q>0&&B<=0)return ie=X,X;if(B<=0)return ie=ge,ge;if(B>=1)return ie=D,D;ie="";const ae=B/Pe|0,fe=ae!==ke;fe&&(ke=ae);const le=ee>0?(B-ee)/(1-ee):B,te=le>0?s(le):0;for(let Ne=0;Ne<$;Ne++){const Ue=Ee[Ne];if(te>=xe[Ne]){Ne<P&&(ie+=D[Ne]);continue}if(te<=0||te<Ue){_e&&Ne<T&&(we?X[Ne]===" "?ie+=" ":(fe&&(Te[Ne]=F||N[z(0,H)]),ie+=Te[Ne]):ie+=X[Ne]);continue}Ne<P&&D[Ne]===" "||Ne<T&&X[Ne]===" "?ie+=" ":Me&&te-Ue<ue?ie+=f[d-1-((te-Ue)/Q|0)]:(fe&&(be[Ne]=M[z(0,L)]),ie+=be[Ne])}return fe&&y(ie,te),ie}}}},ju=ds({TextSplitter:()=>$r,scrambleText:()=>da,split:()=>js,splitText:()=>ca}),Ju=ds({$:()=>Gt,Animatable:()=>xi,AutoLayout:()=>Fo,Draggable:()=>_o,JSAnimation:()=>qt,Scope:()=>So,ScrollObserver:()=>xo,Spring:()=>wr,TextSplitter:()=>$r,Timeline:()=>go,Timer:()=>ut,WAAPIAnimation:()=>Oo,addChild:()=>Ct,animate:()=>$s,clamp:()=>Jo,cleanInlineStyles:()=>Qn,createAnimatable:()=>hu,createDraggable:()=>ku,createDrawable:()=>ia,createLayout:()=>Hu,createMotionPath:()=>ra,createScope:()=>wu,createSeededRandom:()=>Ws,createSpring:()=>vo,createTimeline:()=>mo,createTimer:()=>nu,cubicBezier:()=>Co,damp:()=>ea,degToRad:()=>Yo,eases:()=>Bt,easings:()=>Lu,engine:()=>et,forEachChildren:()=>Ce,get:()=>Zt,globals:()=>G,irregular:()=>Eo,keepTime:()=>Cr,lerp:()=>Ko,linear:()=>Ei,mapRange:()=>Go,morphTo:()=>na,onScroll:()=>Eu,padEnd:()=>Wo,padStart:()=>Uo,radToDeg:()=>Zo,random:()=>Us,randomPick:()=>ta,remove:()=>bo,removeChild:()=>Tt,round:()=>Qo,roundPad:()=>zo,scrambleText:()=>da,scrollContainers:()=>Er,set:()=>Ht,shuffle:()=>Ri,snap:()=>jo,split:()=>js,splitText:()=>ca,spring:()=>xr,stagger:()=>Xs,steps:()=>Po,svg:()=>Xu,sync:()=>Pi,text:()=>ju,utils:()=>zu,waapi:()=>Mo,wrap:()=>Xo}),Qu=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation("typewriter",function(e,t,s,r){const{chars:i}=js(e,{words:!1,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;$s(i,{opacity:[0,1],easing:"linear",duration:n,delay:Xs(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("toast",function(e,t,s,r){const{words:i}=js(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;$s(i,{opacity:[0,1],y:[{to:["100%","0%"]}],easing:"linear",duration:n,delay:Xs(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("fadeIn",function(e,t,s,r){const i=t.duration||500;$s(e,{opacity:[0,1],easing:t.easing||"easeOutQuad",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("continue",function(e,t,s){e.classList.add("squiffy-continue");const r=t.style||"pulse";let i=null,n=null;r==="wave"?(e.classList.add("squiffy-continue-wave"),n=js(e,{words:!1,chars:!0}).chars,i=$s(n,{opacity:[1,.3,1],easing:"easeInOutSine",duration:1200,delay:Xs(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove("squiffy-continue","squiffy-continue-wave",`squiffy-continue-${r}`),e.removeEventListener("click",o),i&&(i.pause(),n))for(const c of n)c.style.opacity="1";s()};e.addEventListener("click",o)})}},Ku={animejs:Ju},fa="input:not([disabled]), textarea:not([disabled]), select:not([disabled])",eh="a.squiffy-link[data-section], a.squiffy-link[data-passage]";function pa(e){if(!e)return!0;const t=e.querySelectorAll(fa);for(const s of t)if(!s.checkValidity())return!1;return!0}function zi(e){if(!e)return;const t=pa(e),s=e.querySelectorAll(eh);for(const r of s)t?(r.classList.remove("validation-disabled"),r.removeAttribute("aria-disabled")):(r.classList.add("validation-disabled"),r.setAttribute("aria-disabled","true"))}function Js(e){if(!e)return;const t=e.querySelectorAll(fa);for(const s of t)s.addEventListener("input",()=>zi(e)),s.addEventListener("change",()=>zi(e)),s.addEventListener("invalid",r=>{r.preventDefault(),s.classList.add("squiffy-invalid")}),s.addEventListener("input",()=>{s.checkValidity()&&s.classList.remove("squiffy-invalid")});zi(e)}var ga=["src","poster"],th="data-squiffy-asset-",sh=[...ga,"srcset","style"].map(e=>`[${e}]`).join(","),rh=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.startsWith("#"),Ui=(e,t)=>{const s=e.trim();if(!s||rh(s))return e;let r=s;try{r=decodeURI(s)}catch{}return t(r)},ih=(e,t)=>e.split(",").map(s=>{const r=s.match(/^(\\s*)(\\S+)(.*)$/s);return r?r[1]+Ui(r[2],t)+r[3]:s}).join(","),nh=(e,t)=>e.replace(/url\\(\\s*([\'"]?)(.*?)\\1\\s*\\)/gi,(s,r,i)=>{const n=Ui(i,t);return n===i?s:`url("${n.replace(/["\\\\\\n]/g,o=>"\\\\"+(o===`\n`?"a ":o))}")`}),oh=(e,t,s)=>{const r=th+t,i=e.getAttribute(r)??e.getAttribute(t);if(i===null)return;let n;t==="srcset"?n=ih(i,s):t==="style"?n=nh(i,s):n=Ui(i,s),n===i?e.removeAttribute(r):e.setAttribute(r,i),e.setAttribute(t,n)},ah=e=>t=>{if(!e||!/\\b(src|srcset|poster|style)\\s*=/i.test(t))return t;const s=document.createElement("template");s.innerHTML=t;for(const r of s.content.querySelectorAll(sh))for(const i of[...ga,"srcset","style"])r.hasAttribute(i)&&oh(r,i,e);return s.innerHTML},lh="squiffy-saves",Wi="saves",ma=(e,t)=>t.save.savedAt.localeCompare(e.save.savedAt)||t.id-e.id,Xi=e=>({id:e.id,name:e.name,save:e.save}),qr=e=>e?.trim()||null;function Gi(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}function va(e){return new Promise((t,s)=>{e.oncomplete=()=>t(),e.onerror=()=>s(e.error),e.onabort=()=>s(e.error)})}function ya(e){let t;const s=()=>t??(t=new Promise((d,u)=>{const a=indexedDB.open(lh,1);a.onupgradeneeded=()=>{a.result.createObjectStore(Wi,{keyPath:["key","id"]})},a.onsuccess=()=>d(a.result),a.onerror=()=>{t=void 0,u(a.error)}})),r=()=>IDBKeyRange.bound([e,-1/0],[e,1/0]),i=async d=>(await s()).transaction(Wi,d).objectStore(Wi),n=async d=>Gi((await i("readonly")).get([e,d])),o=async d=>{const u=await i("readwrite");u.put(d),await va(u.transaction)};let c=!1;const f=()=>{c||(c=!0,navigator.storage?.persist?.().catch(()=>{}))};return{async list(){return(await Gi((await i("readonly")).getAll(r()))).map(Xi).sort(ma)},async get(d){const u=await n(d);return u?Xi(u):null},async add(d,u){const a={key:e,id:(await Gi((await i("readonly")).getAllKeys(r()))).reduce((h,l)=>Math.max(h,l[1]),0)+1,name:qr(u),save:d};return await o(a),f(),Xi(a)},async overwrite(d,u){const a=await n(d);await o({key:e,id:d,name:a?.name??null,save:u})},async rename(d,u){const a=await n(d);a&&await o({...a,name:qr(u)})},async delete(d){const u=await i("readwrite");u.delete([e,d]),await va(u.transaction)}}}function ba(){const e=new Map;let t=1;const s=r=>structuredClone(r);return{async list(){return[...e.values()].map(s).sort(ma)},async get(r){const i=e.get(r);return i?s(i):null},async add(r,i){const n={id:t++,name:qr(i),save:structuredClone(r)};return e.set(n.id,n),s(n)},async overwrite(r,i){e.set(r,{id:r,name:e.get(r)?.name??null,save:structuredClone(i)})},async rename(r,i){const n=e.get(r);n&&(n.name=qr(i))},async delete(r){e.delete(r)}}}var Hr={saves:"Saved games",saveName:"Name (optional)",save:"Save",noSaves:"No saved games yet.",savedGame:"Saved game",savedToday:"Today, [time]",savedYesterday:"Yesterday, [time]",load:"Load",loadConfirm:`Load "[name]"? You\'ll lose anything you\'ve done since you last saved.`,saveOptions:"Options for [name]",overwrite:"Overwrite",overwriteConfirm:\'Overwrite "[name]"?\',rename:"Rename",newName:"New name",saveToFile:"Save to file",loadFromFile:"Load from file",delete:"Delete",deleteConfirm:`Delete "[name]"? This can\'t be undone.`,cancel:"Cancel",close:"Close",wrongStory:"This saved game is for a different story.",notASave:"This file isn\'t a saved game.",cantSave:"The game couldn\'t be saved. Try Save to file instead."},Yi=".squiffy-save",ch=\'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>\',uh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg>\',hh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>\',dh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"/></svg>\',fh=0;function _a(e,t=Hr,s=new Date){const r=new Date(e);if(isNaN(r.getTime()))return"";const i=r.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),n=c=>new Date(c.getFullYear(),c.getMonth(),c.getDate()).getTime(),o=Math.round((n(s)-n(r))/864e5);return o===0?t.savedToday.replace("[time]",i):o===1?t.savedYesterday.replace("[time]",i):`${r.toLocaleDateString(void 0,{day:"numeric",month:"short",...r.getFullYear()!==s.getFullYear()?{year:"numeric"}:{}})}, ${i}`}function ph(e,t={}){const s={...Hr};for(const T of Object.keys(Hr)){const P=t.strings?.[T];typeof P=="string"&&(s[T]=P)}const r=t.slots??(typeof indexedDB<"u"?ya(t.key??window.location.pathname):ba()),i=`squiffy-saves-${++fh}`,n=document.createElement("dialog");n.className="squiffy-saves",n.setAttribute("aria-labelledby",`${i}-heading`),n.innerHTML=`\n <div class="squiffy-saves-header">\n <h2 id="${i}-heading"></h2>\n <button type="button" class="squiffy-saves-icon-button" data-close>${ch}</button>\n </div>\n <p class="squiffy-saves-error" role="alert" hidden></p>\n <form class="squiffy-saves-new">\n <input type="text" autocomplete="off">\n <button type="submit" class="squiffy-saves-button squiffy-saves-primary"></button>\n </form>\n <ul class="squiffy-saves-list"></ul>\n <div class="squiffy-saves-footer">\n <button type="button" class="squiffy-saves-link" data-save-to-file>${hh}<span></span></button>\n <button type="button" class="squiffy-saves-link" data-load-from-file>${dh}<span></span></button>\n <input type="file" accept="${Yi},.json,application/json" hidden>\n </div>\n <div class="squiffy-saves-footer-confirm"></div>`;const o=T=>n.querySelector(T);o("h2").textContent=s.saves;const c=o("[data-close]");c.title=s.close,c.setAttribute("aria-label",s.close);const f=o(".squiffy-saves-error"),d=o("form"),u=o("form input");u.placeholder=s.saveName,u.setAttribute("aria-label",s.saveName),o("form button").textContent=s.save;const a=o(".squiffy-saves-list");o("[data-save-to-file] span").textContent=s.saveToFile,o("[data-load-from-file] span").textContent=s.loadFromFile;const h=o("input[type=file]"),l=o(".squiffy-saves-footer-confirm");(t.container??document.body).appendChild(n);let p=!1;e.on("navigated",()=>{p=!1});const g=()=>!p&&e.canGoBack();let v=[],_=null;const S=T=>{f.textContent=T,f.hidden=!1},y=()=>{f.hidden=!0},m=T=>T.name||T.save.summary||s.savedGame,b=T=>[_a(T.save.savedAt,s),T.name&&T.save.summary].filter(Boolean).join(" · "),k=T=>a.querySelector(`[data-slot="${T}"]`);function w(){if(a.replaceChildren(),!v.length){const T=document.createElement("li");T.className="squiffy-saves-empty",T.textContent=s.noSaves,a.appendChild(T);return}for(const T of v){const P=m(T),N=document.createElement("li");N.className="squiffy-saves-row",N.dataset.slot=String(T.id),N.innerHTML=`\n <div class="squiffy-saves-line">\n <div class="squiffy-saves-info">\n <div class="squiffy-saves-title" id="${i}-title-${T.id}"></div>\n <div class="squiffy-saves-meta"></div>\n </div>\n <button type="button" class="squiffy-saves-button" data-action="load" aria-describedby="${i}-title-${T.id}"></button>\n <div class="squiffy-saves-options">\n <button type="button" class="squiffy-saves-icon-button" data-action="options" aria-haspopup="menu" aria-expanded="false" aria-controls="${i}-menu-${T.id}">${uh}</button>\n <div class="squiffy-saves-menu" id="${i}-menu-${T.id}" role="menu" hidden>\n <button type="button" role="menuitem" data-action="overwrite"></button>\n <button type="button" role="menuitem" data-action="rename"></button>\n <button type="button" role="menuitem" data-action="download"></button>\n <button type="button" role="menuitem" data-action="delete" class="squiffy-saves-danger"></button>\n </div>\n </div>\n </div>`;const H=Z=>N.querySelector(Z);H(".squiffy-saves-title").textContent=P;const F=b(T);F?H(".squiffy-saves-meta").textContent=F:H(".squiffy-saves-meta").remove(),H("[data-action=load]").textContent=s.load;const $=H("[data-action=options]");$.title=s.saveOptions.replace("[name]",P),$.setAttribute("aria-label",$.title),H("[data-action=overwrite]").textContent=s.overwrite,H("[data-action=rename]").textContent=s.rename,H("[data-action=download]").textContent=s.saveToFile,H("[data-action=delete]").textContent=s.delete,a.appendChild(N)}}async function A(){try{v=await r.list()}catch{v=[],S(s.cantSave)}w()}function M(T,P,N,H=!1){_?.();const F=document.createElement("div");F.className="squiffy-saves-confirm",F.setAttribute("role","group"),F.innerHTML=`<p id="${i}-confirm"></p>\n <div class="squiffy-saves-confirm-buttons">\n <button type="button" class="squiffy-saves-button" data-answer="no"></button>\n <button type="button" class="squiffy-saves-button ${H?"squiffy-saves-danger-button":"squiffy-saves-primary"}" data-answer="yes" aria-describedby="${i}-confirm"></button>\n </div>`,F.setAttribute("aria-labelledby",`${i}-confirm`),F.querySelector("p").textContent=P;const $=F.querySelector("[data-answer=no]"),Z=F.querySelector("[data-answer=yes]");return $.textContent=s.cancel,Z.textContent=N,T.appendChild(F),new Promise(K=>{const ee=me=>{_=null,F.remove(),K(me)};_=()=>ee(!1),$.addEventListener("click",()=>ee(!1)),Z.addEventListener("click",()=>ee(!0)),Z.focus()})}const L=typeof HTMLElement.prototype.showPopover=="function";function R(T,P){if(!L){T.hidden=!1;return}T.hidden=!1,T.popover="manual",T.showPopover();const N=P.getBoundingClientRect(),{width:H,height:F}=T.getBoundingClientRect(),$=N.bottom+4;T.style.top=`${$+F>window.innerHeight-8?Math.max(8,N.top-4-F):$}px`,T.style.left=`${Math.max(8,Math.min(N.right-H,window.innerWidth-8-H))}px`}function E(T){L&&T.matches(":popover-open")&&T.hidePopover(),T.hidden=!0}function q(T){const P=document.getElementById(T.getAttribute("aria-controls")),N=T.getAttribute("aria-expanded")=="true";if(_?.(),N)return;R(P,T),T.setAttribute("aria-expanded","true");const H=[...P.querySelectorAll("[role=menuitem]")];H[0].focus();const F=K=>{_=null,E(P),T.setAttribute("aria-expanded","false"),P.removeEventListener("keydown",$),n.removeEventListener("pointerdown",Z),K&&T.focus()},$=K=>{const ee=H.indexOf(document.activeElement),me={ArrowDown:ee+1,ArrowUp:ee-1,Home:0,End:H.length-1}[K.key];me!==void 0?(K.preventDefault(),H[(me+H.length)%H.length].focus()):K.key=="Tab"&&F(!1)},Z=K=>{const ee=K.target;!P.contains(ee)&&!T.contains(ee)&&F(!1)};P.addEventListener("keydown",$),n.addEventListener("pointerdown",Z),_=()=>F(!0)}function z(T){const P=k(T.id)?.querySelector(".squiffy-saves-title");if(!P)return;const N=document.createElement("input");N.type="text",N.className="squiffy-saves-rename",N.autocomplete="off",N.value=T.name??"",N.placeholder=m(T),N.setAttribute("aria-label",s.newName),P.replaceWith(N),N.focus(),N.select();let H=!1;const F=async $=>{if(H)return;H=!0,_=null;const Z=N.value.trim()||null;$&&Z!==T.name&&await r.rename(T.id,Z).catch(()=>S(s.cantSave)),await A(),k(T.id)?.querySelector("[data-action=load]")?.focus()};_=()=>{F(!1)},N.addEventListener("keydown",$=>{$.key=="Enter"&&($.preventDefault(),F(!0))}),N.addEventListener("blur",()=>F(!0))}function X(){return((t.fileName??document.title).replace(/[\\\\/:*?"<>|]+/g,"").replace(/\\s+/g," ").trim()||"story")+Yi}function C(T){const P=URL.createObjectURL(new Blob([JSON.stringify(T)],{type:"application/json"})),N=document.createElement("a");N.href=P,N.download=X(),n.appendChild(N),N.click(),N.remove(),setTimeout(()=>URL.revokeObjectURL(P),0)}async function D(T){const P=await e.loadSave(T);if(!P.success){S(s[P.error]);return}p=!0,n.close()}return n.addEventListener("cancel",T=>{_&&(T.preventDefault(),_())}),c.addEventListener("click",()=>n.close()),d.addEventListener("submit",async T=>{T.preventDefault(),y(),_?.();try{await r.add(e.getSave(),u.value),p=!0,u.value=""}catch{S(s.cantSave)}await A(),u.focus()}),a.addEventListener("click",async T=>{const P=T.target.closest("[data-action]"),N=P?.closest("[data-slot]");if(!P||!N)return;const H=v.find(Z=>Z.id===Number(N.dataset.slot));if(!H)return;const F=P.dataset.action;if(F=="options"){q(P);return}P.getAttribute("role")=="menuitem"&&_?.(),y();const $=m(H);if(F=="load"){if(g()&&!await M(N,s.loadConfirm.replace("[name]",$),s.load)){P.focus();return}const Z=await r.get(H.id).catch(()=>null);Z&&await D(Z.save)}else if(F=="overwrite"){if(!await M(N,s.overwriteConfirm.replace("[name]",$),s.overwrite))return;try{await r.overwrite(H.id,e.getSave()),p=!0}catch{S(s.cantSave)}await A(),k(H.id)?.querySelector("[data-action=load]")?.focus()}else if(F=="rename")z(H);else if(F=="download")C(H.save);else if(F=="delete"){if(!await M(N,s.deleteConfirm.replace("[name]",$),s.delete,!0))return;await r.delete(H.id).catch(()=>S(s.cantSave)),await A(),u.focus()}}),o("[data-save-to-file]").addEventListener("click",()=>{y(),C(e.getSave()),p=!0}),o("[data-load-from-file]").addEventListener("click",()=>{y(),h.click()}),h.addEventListener("change",async()=>{const T=h.files?.[0];if(h.value="",!T)return;let P;try{P=JSON.parse(await T.text())}catch{S(s.notASave);return}g()&&!await M(l,s.loadConfirm.replace("[name]",T.name),s.load)||await D(P)}),{element:n,async open(){y(),_?.(),u.value="",n.open||n.showModal(),u.focus(),await A()},close(){_?.(),n.close()}}}var Sa=["bag","person","map","help","info","list","book","star","heart"],gh=\'<path d="M18 6 6 18M6 6l12 12"/>\',mh={bag:\'<path d="M4 10a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"/><path d="M8 10h8"/><path d="M8 18h8"/><path d="M8 22v-6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v6"/><path d="M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"/>\',person:\'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>\',map:\'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>\',help:\'<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>\',info:\'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>\',list:\'<path d="M3 6h.01M3 12h.01M3 18h.01M8 6h13M8 12h13M8 18h13"/>\',book:\'<path d="M12 7v14"/><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"/>\',star:\'<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>\',heart:\'<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>\'},ka=e=>`<svg viewBox="0 0 24 24" aria-hidden="true">${e}</svg>`,vh=0;function yh(e,t){const s=typeof t.strings?.close=="string"?t.strings.close:"Close",r=`squiffy-panel-${++vh}`,i=[],n=document.createElement("dialog");n.className="squiffy-panel-dialog",n.setAttribute("aria-labelledby",`${r}-heading`),n.innerHTML=`\n <div class="squiffy-panel-dialog-header">\n <h2 id="${r}-heading"></h2>\n <button type="button" class="squiffy-panel-dialog-close">${ka(gh)}</button>\n </div>\n <div class="squiffy-panel squiffy-panel-dialog-content"></div>`;const o=n.querySelector("h2"),c=n.querySelector(".squiffy-panel-dialog-close");c.title=s,c.setAttribute("aria-label",s),c.addEventListener("click",()=>n.close());const f=n.querySelector(".squiffy-panel-dialog-content");n.addEventListener("click",m=>{m.target===n&&n.close()}),(t.container??document.body).appendChild(n),i.push(()=>n.remove());let d=null;const u=t.panels.filter(m=>m&&typeof m.passage=="string"),a=t.side?u.filter(m=>m.position=="side"):[],h=new Map;let l=null;if(a.length&&t.side){l=document.createElement("aside"),l.className="squiffy-panels-side";for(const b of a){const k=document.createElement("section");k.className="squiffy-panel",k.dataset.passage=b.passage,k.setAttribute("aria-label",b.label||b.passage),l.appendChild(k),h.set(b,k)}const m=t.side;m.appendChild(l),m.classList.add("squiffy-has-side"),i.push(()=>{l.remove(),m.classList.remove("squiffy-has-side")})}const p=t.buttons.firstChild;for(const m of u){const b=m.label||m.passage,k=document.createElement("button");k.type="button",k.className="squiffy-header-button squiffy-panel-button",m.position=="side"&&h.has(m)&&k.classList.add("squiffy-panel-side-button"),k.dataset.passage=m.passage,k.setAttribute("aria-haspopup","dialog");const w=m.icon&&Sa.includes(m.icon)?mh[m.icon]:null;w?(k.innerHTML=ka(w),k.title=b,k.setAttribute("aria-label",b)):(k.classList.add("squiffy-panel-text-button"),k.textContent=b),k.addEventListener("click",()=>g(m)),t.buttons.insertBefore(k,p),i.push(()=>k.remove())}function g(m){d=m,o.textContent=m.label||m.passage,f.innerHTML=e.renderPassage(m.passage),n.open||n.showModal()}function v(){for(const[m,b]of h)b.innerHTML=e.renderPassage(m.passage),b.hidden=!b.textContent?.trim()&&!b.querySelector("img, svg, video, canvas, iframe");l&&(l.hidden=[...h.values()].every(m=>m.hidden)),n.open&&d&&(f.innerHTML=e.renderPassage(d.passage))}let _=!1;const S=()=>{_||(_=!0,queueMicrotask(()=>{_=!1,y||v()}))};for(const m of["set","navigated","storyUpdated"])i.push(e.on(m,S));n.addEventListener("close",()=>{d=null});let y=!1;return v(),{refresh:v,open(m){const b=u.find(k=>k.passage==m);b&&g(b)},dispose(){y=!0,n.open&&n.close();for(const m of i.splice(0))m()}}}var bh=async e=>{let t,s,r,i,n,o=0,c=!1;const f=[],d=new xc,u=[];let a=!1,h,l=0;const p=100;async function g(x){if(a||x.closest(".squiffy-output-section")!==r||x.classList.contains("disabled")||!pa(r))return!1;const I=x.getAttribute("data-passage"),O=x.getAttribute("data-section");if((I!==null||O!==null)&&(l=0,Be("turns",(pe("turns")||0)+1)),I!==null)return _(I)||(S(x),Be("_turncount",pe("_turncount")+1)),await R(x),I&&(n=null,await H(I)),d.emit("linkClick",{linkType:"passage"}),!0;if(O!==null)return await R(x),O&&await C(O),d.emit("linkClick",{linkType:"section"}),!0;const[U,se,Se]=Cs.handleLink(x);return U?(Se?.disableLink&&S(x),Z(),d.emit("linkClick",{linkType:se}),!0):!1}async function v(x){const I=x.target;I.classList.contains("squiffy-link")&&await g(I)}function _(x){if(!x)return!1;const I=s?.passages;if(I&&x in I)return!!I[x].repeat;const O=t.sections[""]?.passages;return!!(O&&x in O&&O[x].repeat)}function S(x){x.classList.add("disabled"),x.setAttribute("tabindex","-1")}function y(x){x.classList.remove("disabled"),x.removeAttribute("tabindex")}async function m(x){if(x&&x.section in t.sections){await C(x.section),x.passage!==void 0&&pe("_section")==x.section&&await H(x.passage);return}if(!K()){await C(t.start);return}await b()}async function b(){const x=i??r,I=x?.getAttribute("data-goto");I&&I in t.sections&&await L({section:I,after:Number(x.getAttribute("data-goto-after")||0)})}function k(){clearTimeout(h),h=void 0,Re.goto=null,Re.deactivate.clear()}function w(x){const I=Re.deactivate;if(I.size==0)return;const O=String((pe("_deactivations")||0)+1);Be("_deactivations",Number(O)),x.setAttribute("data-deactivates",O);for(const U of r.querySelectorAll("a.squiffy-link[data-passage]"))I.has(U.getAttribute("data-passage"))&&!U.classList.contains("disabled")&&(S(U),U.setAttribute("data-deactivated-by",O));I.clear()}function A(x){const I=x.getAttribute("data-deactivates");if(I)for(const O of r.querySelectorAll(`a.squiffy-link[data-deactivated-by="${I}"]`))y(O),O.removeAttribute("data-deactivated-by")}function M(x){const I=Re.goto;return Re.goto=null,I&&(x.setAttribute("data-goto",I.section),I.after&&x.setAttribute("data-goto-after",String(I.after))),I}async function L(x){if(x){if(x.after>0){h=setTimeout(()=>{h=void 0,l=0,C(x.section)},x.after);return}if(++l>p){l=0;const I=i??r;I.removeAttribute("data-goto");const O=`stopped after ${p} in a row without the player clicking anything, going to "${x.section}". Is there a loop?`;console.error("Squiffy error in {{goto}}:",O),I.insertAdjacentHTML("beforeend",Ut("Error in {{goto}}:",O)),Z();return}await C(x.section)}}async function R(x){hs.runLinkAnimation(x),await N();const I=x.getAttribute("data-set");if(I){const O=JSON.parse(I);for(const U of O)E(U)}}function E(x){try{t.expressions?z(x):X(x)}catch(I){const O=I instanceof Error?I.message:String(I);console.error(`Squiffy error in "${x}":`,O),f.push(Ut(`Error in "${x}":`,O))}}function q(x,I,O){const U=I+"=",se=zt(U,O);let Se=zt(U,pe(x));I=="+"&&(Se+=se),I=="-"&&(Se-=se),I=="*"&&(Se*=se),I=="/"&&(Se/=se),Be(x,Se)}function z(x){const I=/^(\\w+)\\s*:=(.*)$/.exec(x);if(I){Be(I[1],ge.processText(I[2],!0));return}const O=/^(\\w+)\\s*([+\\-*/]?)=(?!=)(.*)$/.exec(x);if(O){const[,se,Se,At]=O,Ft=Re.evaluate(At);Se?q(se,Se,Ft):Be(se,Ft);return}const U=/^(not\\s+)?(\\w+)$/.exec(x.trim());if(!U)throw new Error("expected an attribute name, e.g. gold = 10, gold += 5, has_key or not has_key");Be(U[2],!U[1])}function X(x){x=x.replace(/^(\\w*\\s*):=(.*)$/,(O,U,se)=>U+"="+ge.processText(se,!0));const I=/^([\\w]*)\\s*=\\s*(.*)$/.exec(x);if(I){const O=I[1];let U=I[2];U==="true"?Be(O,!0):U==="false"?Be(O,!1):isNaN(U)?(U.startsWith("@")&&(U=pe(U.substring(1))),Be(O,U)):Be(O,parseFloat(U))}else{const O=/^([\\w]*)\\s*([+\\-*/])=\\s*(.*)$/.exec(x);if(O){const U=O[1],se=O[2],Se=O[3].trim();q(U,se,Se.startsWith("@")?pe(Se.substring(1)):Se)}else{let U=!0;x.startsWith("not ")&&(x=x.substring(4),U=!1),Be(x,U)}}}async function C(x){k();const I=B();if(s=t.sections[x],!s)return;const O=pe("_section");O!==null&&(Be("previous",pe("_passage")??O),Be("previous_section",O)),pe("_passage")!==null&&Be("_passage",null),Be("_section",x),pe("turns")===null&&Fe.setInternal("turns",0,!1),Fe.setSeen(x);const U=t.sections[""];(U?.clear||s.clear)&&be(),Ee(x);const se=r;if(U&&(await P(U,"[[]]"),pe("_section")!==x)){se.remove();return}if(await P(s,`[[${x}]]`),pe("_section")!==x){se.remove();return}Js(r),Be("_turncount",0),w(r);const Se=M(r);Fr(),Z();const At=B();At!=I&&d.emit("canGoBackChanged",{canGoBack:At}),d.emit("navigated",{section:x}),await L(Se)}let D=!1;function T(x,I=null,O){const U={get:pe,set:Be,ui:{transition:us,write:ge.write,scrollToEnd:ge.scrollToEnd,afterWrite:se=>{if(!O)throw new Error("squiffy.ui.afterWrite can only be used in a section or passage\'s JavaScript");O.push(se)}},story:{go:se=>D?(Re.goto??(Re.goto={section:se,after:0}),Promise.resolve()):C(se),seen:se=>Fe.getSeen(se),visits:se=>Fe.getVisits(se)},element:le,import:Ku,...I};t.js[x](U,pe,Be)}async function P(x,I){x.attributes&&await F(x.attributes);const O=[];if(x.jsIndex!==void 0){const U=pe("_section");if(T(x.jsIndex,null,O),pe("_section")!==U)return}ge.write(x.text||"",I),D=!0;try{for(const U of O)U()}finally{D=!1}await N()}async function N(){a=!0,r.classList.add("links-disabled");for(const x of u)await x();u.length=0,a=!1,r.classList.remove("links-disabled")}async function H(x){k();const I=B();let O=s.passages&&s.passages[x];const U=t.sections[""];if(!O&&U&&U.passages&&(O=U.passages[x]),!O)throw`No passage named ${x} in the current section or master section`;Be("previous",pe("_passage")??pe("_section")),Be("_passage",x),Fe.setSeen(x);const se=[],Se=[];if(U&&U.passages){const pt=U.passages[""];pt&&(se.push(pt),Se.push(()=>P(pt,"[[]][]")))}const At=s.passages&&s.passages[""];At&&(se.push(At),Se.push(()=>P(At,`[[${pe("_section")}]][]`))),se.push(O),Se.push(()=>P(O,`[[${pe("_section")}]][${x}]`));const Ft="@"+pe("_turncount");if(s.passages&&!O.repeat){if(Ft in s.passages){const pt=s.passages[Ft];se.push(pt),Se.push(()=>P(pt,`[[${pe("_section")}]][${Ft}]`))}if("@last"in s.passages&&pe("_turncount")>=(s.passageCount||0)){const pt=s.passages["@last"];se.push(pt),Se.push(()=>P(pt,`[[${pe("_section")}]][${Ft}]`))}}se.some(pt=>pt.clear)&&(be(),xe()),i=document.createElement("div"),i.classList.add("squiffy-output-passage"),i.setAttribute("data-passage",`${x}`),r.appendChild(i);for(const pt of Se)await pt();Js(r),w(i);const _h=M(i);Fr(),Z();const wa=B();wa!=I&&d.emit("canGoBackChanged",{canGoBack:wa}),d.emit("navigated",{section:pe("_section"),passage:x}),await L(_h)}async function F(x){for(const I of x)E(I)}function $(){k(),Fe.reset(),Ue.scroll==="element"||Ue.scroll==="none"?(te.innerHTML="",m()):location.reload()}function Z(){Be("_output",te.innerHTML)}function K(){const x=()=>{t.uiJsIndex!==void 0&&T(t.uiJsIndex,{registerAnimation:hs.registerAnimation.bind(hs),registerHelper:Re.handlebars.registerHelper.bind(Re.handlebars),SafeString:Re.handlebars.SafeString})};Fe.load();const I=pe("_output");return I?(ee(I),x(),Et.onLoad(),Js(r),!0):(x(),!1)}function ee(x){te.innerHTML=Ne(x),ie(),_e(),n=te.querySelector(".squiffy-output-block:last-child"),s=t.sections[pe("_section")]}function me(){return{format:"squiffy-save",version:1,storyId:t.projectId??null,section:pe("_section"),passage:pe("_passage"),summary:ve(),savedAt:new Date().toISOString(),state:structuredClone(Fe.store)}}function ve(){const I=r?.querySelectorAll(".squiffy-output-block")??[];for(const O of I){const U=re(O);if(!U)continue;const se=[...O.querySelectorAll("h1, h2, h3, h4, h5, h6, p, li")].find(Ft=>re(Ft));if(se&&/^H[1-6]$/.test(se.tagName)&&re(O).startsWith(re(se)))return re(se).substring(0,100);if(U.length<=100)return U;const Se=U.substring(0,100),At=Se.lastIndexOf(" ");return(At>100/2?Se.substring(0,At):Se)+"…"}return""}function re(x){const I=x.cloneNode(!0);return I.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, div, br, tr, blockquote").forEach(O=>O.after(" ")),(I.textContent??"").replace(/\\s+/g," ").trim()}function Q(x){if(!x||typeof x!="object")return!1;const I=x;return I.format==="squiffy-save"&&I.version===1&&!!I.state&&typeof I.state=="object"&&!Array.isArray(I.state)&&typeof I.state._output=="string"}async function ue(x){if(!Q(x))return{success:!1,error:"notASave"};if(x.storyId&&t.projectId&&x.storyId!==t.projectId)return{success:!1,error:"wrongStory"};for(;a;)await new Promise(O=>setTimeout(O,50));k(),f.length=0,Fe.reset();for(const[O,U]of Object.entries(x.state))Fe.setInternal(O,U,!1);if(Pt={},o=0,c=!1,ee(x.state._output),!s)return te.innerHTML="",await C(t.start),d.emit("canGoBackChanged",{canGoBack:B()}),{success:!0};Et.onLoad(),Js(r),d.emit("canGoBackChanged",{canGoBack:B()});const I=pe("_passage");return d.emit("navigated",I?{section:pe("_section"),passage:I}:{section:pe("_section")}),await b(),{success:!0}}function Pe(){n=document.createElement("div"),n.classList.add("squiffy-output-block"),(i||r)?.appendChild(n)}function Ee(x){r&&(r.querySelectorAll("input, textarea, select").forEach(I=>{const O=I,U=O.getAttribute("data-attribute")||O.id;U&&Be(U,O.value),O.disabled||(O.disabled=!0,O.setAttribute("data-squiffy-disabled",""))}),r.querySelectorAll("[contenteditable]").forEach(I=>{const O=I.getAttribute("data-attribute")||I.id;O&&Be(O,I.innerHTML),I.getAttribute("contenteditable")!=="false"&&(I.setAttribute("contenteditable","false"),I.setAttribute("data-squiffy-disabled",""))})),i=null,xe(x),Pe()}function xe(x){r=document.createElement("div"),r.classList.add("squiffy-output-section"),r.setAttribute("data-section",x??pe("_section")),x||r.setAttribute("data-clear","true"),te.appendChild(r)}function Ae(){return te.querySelector(".squiffy-clear-stack")}function be(){let x=Ae();x||(x=document.createElement("div"),x.classList.add("squiffy-clear-stack"),x.style.display="none",te.prepend(x));const I=document.createElement("div");x.appendChild(I),c=!0;for(const O of[...te.children])O!==x&&I.appendChild(O)}function Te(){const x=Ae();if(!x)return;for(const O of[...te.children])O!==x&&O.remove();const I=x.children[x.children.length-1];for(const O of[...I.children])te.appendChild(O);I.remove()}const ge={write:(x,I)=>{o=te.scrollHeight;const O=f.splice(0).join("")+ge.renderHtml(x,!1).trim();n||Pe();const U=document.createElement("div");I&&U.setAttribute("data-source",I),U.innerHTML=O,Et.onWrite(U),n.appendChild(U),Js(r),ge.scrollToEnd()},clearScreen:()=>{be(),xe()},scrollToEnd:()=>{if(Ue.scroll!=="none")if(c)if(c=!1,Ue.scroll==="element")r.scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"});else{const x=Math.max(document.body.scrollTop,document.documentElement.scrollTop),I=te.getBoundingClientRect().top+x;I<x&&window.scrollTo({top:I,behavior:"smooth"})}else if(Ue.scroll==="element")te.lastElementChild?.scrollIntoView({block:"end",inline:"nearest",behavior:"smooth"});else{let x=o;const I=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(x>I){const O=document.documentElement.scrollHeight-window.innerHeight;x>O&&(x=O),window.scrollTo({top:x,behavior:"smooth"})}}},processText:(x,I)=>Re.process(x,I),renderHtml:(x,I)=>Ne(ge.processText(x,I))};function Le(x){if(x.start!=t.start){t=x,Fe.reset(),te.innerHTML="",C(t.start);return}const I=t;t=x,Cc(I,x,te,(U,se)=>{const Se=s;s=se;try{return ge.renderHtml(U,!1)}finally{s=Se}},S,U=>F(U)),ie(),_e(),d.emit("storyUpdated",{})}function ke(x){const I=t.sections[""]?.passages?.[x];if(!I)return Ut("Error in panel:",`there is no passage called "${x}" in the master section [[]]`);const O=Re.goto,U=[...Re.deactivate];Fe.readOnly=!0;let se;try{se=ge.renderHtml(I.text||"",!1)}finally{Fe.readOnly=!1,Re.goto=O,Re.deactivate=new Set(U)}const Se=document.createElement("template");return Se.innerHTML=se,Se.content.querySelectorAll("a.squiffy-link").forEach(S),Se.innerHTML}function ie(){const x=te.querySelectorAll(".squiffy-output-section:last-child");r=x[x.length-1];const I=r.getAttribute("data-section");s=t.sections[I]}function _e(){i=r.querySelector(".squiffy-output-passage:last-child")}function we(){const x=Ae(),I=te.querySelectorAll(".squiffy-output-section").length+te.querySelectorAll(".squiffy-output-passage").length;return x?I+x.children.length:I}function Me(x){x.querySelectorAll("[data-squiffy-disabled]").forEach(I=>{I.hasAttribute("contenteditable")?I.setAttribute("contenteditable","true"):I.disabled=!1,I.removeAttribute("data-squiffy-disabled")})}function B(){const x=i??r,I=[...te.querySelectorAll("[data-goto]")].filter(O=>O!==x).length;return we()-I>1}function ae(){if(a||!B())return;k();do fe();while((i??r).hasAttribute("data-goto")&&we()>1);Z(),B()||d.emit("canGoBackChanged",{canGoBack:!1});const x=i?.getAttribute("data-passage");d.emit("navigated",x?{section:pe("_section"),passage:x}:{section:pe("_section")})}function fe(){const x=Ae();if(i){const I=i.getAttribute("data-passage");Vr(i.getAttribute("data-undo")),A(i),i.remove();let O=!1,U=!1;for(const se of te.children)if(se!==x){if(se.getAttribute("data-clear")=="true"&&se.children.length==0){O=!0;continue}U=!0;break}O&&!U&&(Te(),ie());for(const se of r.querySelectorAll("a.squiffy-link[data-passage]"))se.getAttribute("data-passage")==I&&y(se);_e()}else{Vr(r.getAttribute("data-undo")),r.remove();let I=!1;for(const O of[...te.children])if(O!==x){I=!0;break}I||Te(),ie(),_e(),Me(r)}}const le=e.element,te=document.createElement("div");le.appendChild(te),t=e.story;const Ne=ah(e.resolveAssetUrl),Ue={scroll:e.scroll||"body",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let ft="";Ue.persist&&(e.storyId!==void 0?ft=e.storyId:window.location.protocol==="file:"?ft=t.id||"":ft=window.location.pathname,ft||(console.warn("Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled."),Ue.persist=!1)),Ue.scroll==="element"&&(te.style.overflowY="auto"),te.addEventListener("click",v),te.addEventListener("keypress",async function(x){x.key==="Enter"&&await v(x)});let Pt={};const Mt=function(x,I){x!="_output"&&(x in Pt||(Pt[x]=I))},Fr=function(){(i??r).setAttribute("data-undo",JSON.stringify(Pt)),Pt={}},Vr=function(x){if(!x)return;const I=JSON.parse(x);if(I)for(const O of Object.keys(I))Fe.setInternal(O,I[O],!1)},Fe=new Tc(Ue.persist,ft,Ue.onSet,d,Mt),pe=Fe.get.bind(Fe),Be=Fe.set.bind(Fe),Re=new wc(()=>t,Fe,()=>s),Cs=new Oc,zr=x=>x in t.sections&&t.sections[x].text||null,Zi=x=>s.passages&&x in s.passages?s.passages[x].text||null:"passages"in t.sections[""]&&t.sections[""].passages&&x in t.sections[""].passages&&t.sections[""].passages[x].text||null,us=x=>{u.push(x)},hs=new Qu,Et=new Pc(te,Re,Fe,Cs,zr,Zi,ge.renderHtml,us,hs,d,Ne);return Et.add(Ms.ReplaceLabel()),Et.add(Ms.RotateSequencePlugin()),Et.add(Ms.RandomPlugin()),Et.add(Ms.LivePlugin()),Et.add(Ms.AnimatePlugin()),{begin:m,restart:$,get:pe,set:Be,clickLink:g,update:Le,goBack:ae,canGoBack:B,getSave:me,loadSave:ue,renderPassage:ke,on:(x,I)=>d.on(x,I),off:(x,I)=>d.off(x,I),once:(x,I)=>d.once(x,I)}};return _t.PANEL_ICONS=Sa,_t.SAVES_STRINGS=Hr,_t.SAVE_FILE_EXTENSION=Yi,_t.createPanels=yh,_t.createSavesDialog=ph,_t.formatSaveTime=_a,_t.indexedDbSaveSlots=ya,_t.init=bh,_t.memorySaveSlots=ba,_t})({});\n\n//# sourceMappingURL=squiffy.runtime.global.js.map', yt = `/* Core Squiffy Runtime Styles. See https://squiffystory.com/styling/ for how to customise these. */
959
+ var bt = /url\(\s*(?:"((?:[^"\\\n]|\\.)*)"|'((?:[^'\\\n]|\\.)*)'|([^)"'\s]*))\s*\)/gi;
960
+ function kt(s) {
961
+ return s != "" && !/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(s);
962
+ }
963
+ function wt(s, e) {
964
+ return s.replace(bt, (t, n, r, i) => {
965
+ const a = (n ?? r ?? i ?? "").trim();
966
+ if (!kt(a)) return t;
967
+ const c = e(a);
968
+ return c === void 0 ? t : `url("${c.replace(/["\\\n]/g, (p) => p == `
969
+ ` ? "\\a " : `\\${p}`)}")`;
970
+ });
971
+ }
972
+ function xt(s, e) {
973
+ let t = e.replace(/[?#].*$/, "");
974
+ try {
975
+ t = decodeURI(t);
976
+ } catch {
977
+ }
978
+ const n = s.replace(/\\/g, "/").split("/");
979
+ n.pop();
980
+ const r = n.filter((i) => i != "" && i != ".");
981
+ for (const i of t.replace(/\\/g, "/").split("/"))
982
+ if (!(i == "" || i == "."))
983
+ if (i == "..") {
984
+ if (!r.length || r[r.length - 1] == "..") return null;
985
+ r.pop();
986
+ } else r.push(i);
987
+ return r.length ? r.join("/") : null;
988
+ }
989
+ var $e = 'var squiffyRuntime=(function(At){Object.defineProperty(At,Symbol.toStringTag,{value:"Module"});var Za=Object.create,dr=Object.defineProperty,Ka=Object.getOwnPropertyDescriptor,Ja=Object.getOwnPropertyNames,Qa=Object.getPrototypeOf,gn=Object.prototype.hasOwnProperty,fe=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Ss=(e,t)=>{let s={};for(var r in e)dr(s,r,{get:e[r],enumerable:!0});return t||dr(s,Symbol.toStringTag,{value:"Module"}),s},el=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Ja(t),n=0,o=i.length,c;n<o;n++)c=i[n],!gn.call(e,c)&&c!==s&&dr(e,c,{get:(d=>t[d]).bind(null,c),enumerable:!(r=Ka(t,c))||r.enumerable});return e},tl=(e,t,s)=>(s=e!=null?Za(Qa(e)):{},el(t||!e||!e.__esModule||!gn.call(e,"default")?dr(s,"default",{value:e,enumerable:!0}):s,e));function Hs(e){"@babel/helpers - typeof";return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hs(e)}function sl(e,t){if(Hs(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(Hs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rl(e){var t=sl(e,"string");return Hs(t)=="symbol"?t:t+""}function De(e,t,s){return(t=rl(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function il(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nl(e,t){il(e,t),t.add(e)}function fr(e,t,s){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:s;throw new TypeError("Private element is not present on this object")}var ws,pr;function ni(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var is=ni();function mn(e){is=e}var ns={exec:()=>null};function os(e){let t=[];return s=>{let r=Math.max(0,Math.min(3,s-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function de(e,t=""){let s=typeof e=="string"?e:e.source,r={replace:(i,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(Ke.caret,"$1"),s=s.replace(i,o),r},getRegex:()=>new RegExp(s,t)};return r}var vn=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Ke={codeRemoveIndent:/^(?: {0,3}\\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \\t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,leadingSpaceTab:/^[ \\t]+/,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+)[ \\t]*)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \\t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\][ \\t]+\\S/,listReplaceTask:/^\\[[ xX]\\][ \\t]+/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^\'"]*[^\\s])\\s+([\'"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,numericCharacterReference:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,escapeTest:/[&<>"\']/,escapeReplace:/[&<>"\']/g,escapeTestNoEncode:/[<>"\']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>"\']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:os(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ ][^\\\\n]*)?(?:\\\\n|$))`)),hrRegex:os(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\\\*[ ]*){3,})(?:\\\\n+|$)`)),fencesBeginRegex:os(e=>new RegExp(`^ {0,${e}}(?:\\`\\`\\`|~~~)`)),headingBeginRegex:os(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\\\s|$)`)),pedanticHeadingBeginRegex:os(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:os(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Fs})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`,"i")),blockquoteBeginRegex:os(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\\d{1,9}[.)])[ \\t]+|>[ \\t]?))+/},ol=/^(?:[ \\t]*(?:\\n|$))+/,al=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,ll=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}(?:(?=`)\\1`*|(?=~)\\1~*) *(?=\\n|$)|$)/,qs=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,cl=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,oi=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,yn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |fences|blockquote|heading|hr|html|table))+?)\\n {0,3}(=+|-+)[ \\t]*(?:\\n+|$)/,bn=de(yn).replace(/bull/g,oi).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,"").getRegex(),ul=de(yn).replace(/bull/g,oi).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),ai=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\t]+\\n)[^\\n]+)*)/,hl=/^[^\\n]+/,li=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\\\n]|\\n(?![ \\t]*\\n))+/,dl=de(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace("label",li).replace("title",/(?:"(?:\\\\[\\s\\S]|[^"\\\\])*"|\'(?:\\\\[\\s\\S]|[^\'\\\\\\n]|\\n(?!\\n))*\'|\\((?:\\\\[\\s\\S]|[^()\\\\])*\\))/).getRegex(),fl=de(/^(bull)([ \\t][^\\n]*?)?(?:\\n|$)/).replace(/bull/g,oi).getRegex(),Fs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ci=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,pl=de("^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n*|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>[^\\\\n]*\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>[^\\\\n]*\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>[^\\\\n]*\\\\n*|$)|</?(tag)(?:[ \\\\t]+|\\\\n|/?>|$)[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$)|</[a-z][a-z0-9-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$))","i").replace("comment",ci).replace("tag",Fs).replace("attribute",/ +[a-zA-Z:_][\\w.:-]*(?: *= *"[^"\\n]*"| *= *\'[^\'\\n]*\'| *= *[^\\s"\'=<>`]+)?/).getRegex(),_n=e=>de(ai).replace("hr",qs).replace("heading"," {0,3}#{1,6}(?:\\\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)").replace("tag",Fs).getRegex(),gl=_n(/ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/),ml=_n(/ {0,3}(?:[*+-]|\\d{1,9}[.)])(?:[ \\t]|\\n|$)/),ui={blockquote:de(/^( {0,3}> ?(?:(?![ \\t]*(?:\\n|$))(paragraph)|[^\\n]*)(?:\\n|$))+/).replace("paragraph",ml).getRegex(),code:al,def:dl,fences:ll,heading:cl,hr:qs,html:pl,lheading:bn,list:fl,newline:ol,paragraph:gl,table:ns,text:hl},Sn=de("^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)").replace("hr",qs).replace("heading"," {0,3}#{1,6}(?:\\\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\\\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)").replace("tag",Fs).getRegex(),vl={...ui,lheading:ul,table:Sn,paragraph:de(ai).replace("hr",qs).replace("heading"," {0,3}#{1,6}(?:\\\\s|$)").replace("|lheading","").replace("table",Sn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)").replace("tag",Fs).getRegex()},yl={...ui,html:de(`^ *(?:comment(?: *\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1>(?: *\\\\n{2,}|\\\\s*$)|<tag(?:"[^"]*"|\'[^\']*\'|\\\\s[^\'"/>\\\\s]*)*?/?>(?: *\\\\n{2,}|\\\\s*$))`).replace("comment",ci).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b").getRegex(),def:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +(["(][^\\n]+[")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:ns,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:de(ai).replace("hr",qs).replace("heading",` *#{1,6} *[^\n]`).replace("lheading",bn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bl=/^\\\\([!"#$%&\'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,_l=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,wn=/^( {2,}|\\\\)\\n(?!\\s*$)[ \\t]*/,Sl=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,Nt=/[\\p{P}\\p{S}]/u,ks=/[\\s\\p{P}\\p{S}]/u,Vs=/[^\\s\\p{P}\\p{S}]/u,wl=de(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ks).getRegex(),kl=/[\\p{Pi}\\p{Ps}"\']/u,kn=/(?!~)[\\p{P}\\p{S}]/u,xl=/(?!~)[\\s\\p{P}\\p{S}]/u,Tl=/(?:[^\\s\\p{P}\\p{S}]|~)/u,Cl=de(/link|precode-code|html/,"g").replace("link",/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace("precode-",vn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xn=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,Al=de(xn,"u").replace(/punct/g,Nt).getRegex(),El=de(xn,"u").replace(/punct/g,kn).getRegex(),Pl=de(/^(?:\\*+(?:((?!\\*)(?!openQuote)punct)|([^\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\s_]))?/,"u").replace(/openQuote/g,kl).replace(/punct/g,Nt).getRegex(),Tn="^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)",Ll=de(Tn,"gu").replace(/notPunctSpace/g,Vs).replace(/punctSpace/g,ks).replace(/punct/g,Nt).getRegex(),Il=de(Tn,"gu").replace(/notPunctSpace/g,Tl).replace(/punctSpace/g,xl).replace(/punct/g,kn).getRegex(),Rl=de("^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)[\\\\s](\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|(?:(?!\\\\*)punct|notPunctSpace)(\\\\*+)(?!\\\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Vs).replace(/punctSpace/g,ks).replace(/punct/g,Nt).getRegex(),Ol=de("^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Vs).replace(/punctSpace/g,ks).replace(/punct/g,Nt).getRegex(),Ml=de("^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\\\s](_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Vs).replace(/punctSpace/g,ks).replace(/punct/g,Nt).getRegex(),Nl=de(/^~~?(?:((?!~)punct)|[^\\s~])/,"u").replace(/punct/g,Nt).getRegex(),Dl=de("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Vs).replace(/punctSpace/g,ks).replace(/punct/g,Nt).getRegex(),$l=de(/\\\\(punct)/,"gu").replace(/punct/g,Nt).getRegex(),Bl=de(/(`+)(?:[^`]|[^`][\\s\\S]*?[^`])\\1(?!`)|`+|\\\\(punct)/,"gu").replace(/punct/g,Nt).getRegex(),Hl=de(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&\'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ql=de(ci).replace("(?:-->|$)","-->").getRegex(),Fl=de("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>").replace("comment",ql).replace("attribute",/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*"[^"]*"|\\s*=\\s*\'[^\']*\'|\\s*=\\s*[^\\s"\'=<>`]+)?/).getRegex(),Cn=/\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]/,gr=de(/(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/).replace("brackets",Cn).getRegex(),Vl=de(/^!?\\[(label)\\]\\([ \\t\\n]*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?[ \\t\\n]*\\)/).replace("label",gr).replace("href",/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]+|(?=\\))/).replace("title",/"(?:\\\\[\\s\\S]|[^"\\\\])*"|\'(?:\\\\[\\s\\S]|[^\'\\\\])*\'|\\((?:\\\\[\\s\\S]|[^)\\\\])*\\)/).getRegex(),zl=de(/^!?\\[(label)\\]\\[(ref)\\]/).replace("label",gr).replace("ref",li).getRegex(),Ul=de(/^!?\\[(ref)\\](?:\\[\\])?/).replace("ref",li).getRegex(),An=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\]){1,999}/,Wl=de(/(?:[^\\[\\]\\\\`]*(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\]))){0,999}?[^\\[\\]\\\\`]*?/).replace("brackets",Cn).getRegex(),Gl=de("reflink|nolink(?!\\\\()","g").replace("reflink",de(/^!?\\[(label)\\]\\[(ref)\\]/).replace("label",Wl).replace("ref",An).getRegex()).replace("nolink",de(/^!?\\[(ref)\\](?:\\[\\])?/).replace("ref",An).getRegex()).getRegex(),En=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xl=de(/(?:mailto:email|xmpp:email(?:\\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),hi={_backpedal:ns,anyPunctuation:$l,anyPunctuationOutsideCode:Bl,autolink:Hl,blockSkip:Cl,br:wn,code:_l,del:ns,delLDelim:ns,delRDelim:ns,emStrongLDelim:Al,emStrongRDelimAst:Ll,emStrongRDelimUnd:Ol,escape:bl,link:Vl,nolink:Ul,punctuation:wl,reflink:zl,reflinkSearch:Gl,tag:Fl,text:Sl,url:ns},Yl={...hi,emStrongLDelim:Pl,emStrongRDelimAst:Rl,emStrongRDelimUnd:Ml,link:de(/^!?\\[(label)\\]\\((.*?)\\)/).replace("label",gr).getRegex(),reflink:de(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace("label",gr).getRegex()},di={...hi,emStrongRDelimAst:Il,emStrongLDelim:El,delLDelim:Nl,delRDelim:Dl,url:de(/^emailProtocol|^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace("emailProtocol",Xl).replace("protocol",En).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_\'"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_\'"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:de(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&\'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|wwwStart|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&\'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&\'*+\\/=?_`{\\|}~-]+@))))/).replace("protocol",En).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",vn?"(?<![^\\\\s*_~(])www\\\\.":"www\\\\.").getRegex()},jl={...di,br:de(wn).replace("{2,}","*").getRegex(),text:de(di.text).replace("\\\\b_","\\\\b_| {2,}\\\\n").replace(/\\{2,\\}/g,"*").getRegex()},mr={normal:ui,gfm:vl,pedantic:yl},zs={normal:hi,gfm:di,breaks:jl,pedantic:Yl},Zl={"&":"&amp;","<":"&lt;",">":"&gt;",\'"\':"&quot;","\'":"&#39;"},Pn=e=>Zl[e];function mt(e,t){if(t){if(Ke.escapeTest.test(e))return e.replace(Ke.escapeReplace,Pn)}else if(Ke.escapeTestNoEncode.test(e))return e.replace(Ke.escapeReplaceNoEncode,Pn);return e}function Kl(e){return Ke.numericCharacterReference.test(e)?e.replace(Ke.numericCharacterReferenceOrAmpersand,(t,s,r)=>{if(s===void 0&&r===void 0)return"&amp;";let i=s===void 0?Number.parseInt(r,16):Number.parseInt(s,10);return i===0||i>1114111||i>=55296&&i<=57343?"�":i===38?"&amp;":String.fromCodePoint(i)}):e}function Ln(e){try{e=encodeURI(e).replace(Ke.percentDecode,"%")}catch{return null}return e}function In(e,t){let s=e.replace(Ke.findPipe,(i,n,o)=>{let c=!1,d=n;for(;--d>=0&&o[d]==="\\\\";)c=!c;return c?"|":" |"}).split(Ke.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Ke.slashPipe,"|");return s}function Ht(e,t,s){let r=e.length;if(r===0)return"";let i=0;for(;i<r;){let n=e.charAt(r-i-1);if(n===t&&!s)i++;else if(n!==t&&s)i++;else break}return e.slice(0,r-i)}function Rn(e){let t=e.split(`\n`),s=t.length-1;for(;s>=0&&Ke.blankLine.test(t[s]);)s--;return t.length-s<=2?e:t.slice(0,s+1).join(`\n`)}function vr(e){return e.trim().replace(Ke.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function On(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let s=0;for(let r=0;r<e.length;r++)if(e[r]==="\\\\")r++;else if(e[r]===t[0])s++;else if(e[r]===t[1]&&(s--,s<0))return r;return s>0?-2:-1}var xs=new WeakMap;function fi(e){let t={"*":-1,_:-1},s=-1,r=e.length;for(let i=0;i<r;i++){let n=e[i];if(n!=="*"&&n!=="_"&&n!=="~")continue;let o=i===0?`\n`:e[i-1],c=i+1;for(;c<r&&e[c]===n;)c++;o!==" "&&o!==" "&&o!==`\n`&&o!=="\\r"&&o!=="\\f"&&(n==="~"?s=i:t[n]=i),i=c-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:s}}function Jl(e,t){let s=fi(t),r=xs.get(e);r?r.push(s):xs.set(e,[s])}function Ql(e){let t=xs.get(e);t&&(t.pop(),t.length===0&&xs.delete(e))}function ec(e,t,s){let r=xs.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[s]:fi(t).lastPossibleEmStrongCloserIndex[s]}function tc(e,t){let s=xs.get(e)?.at(-1);return s&&s.maskedSrc===t?s.lastPossibleDelCloserIndex:fi(t).lastPossibleDelCloserIndex}function yr(e,t=0){let s=t,r="";for(let i of e)if(i===" "){let n=4-s%4;r+=" ".repeat(n),s+=n}else r+=i,s++;return r}function Mn(e,t,s,r,i){let n=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1"),d=e[0].charAt(0)==="!",h=r.state.inLink,p=r.state.linkEmitted,a=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(c),l=r.state.linkEmitted;if(r.state.linkEmitted=p,r.state.inLink=h,!d){if(l){r.state.inRawBlock=a;return}r.state.linkEmitted=!0}return{type:d?"image":"link",raw:s,href:n,title:o,text:c,tokens:f}}function sc(e,t,s){let r=e.match(s.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`\n`).map(n=>{let o=n.match(s.other.beginningSpace);if(o===null)return n;let[c]=o;return n.slice(Math.min(c.length,i.length))}).join(`\n`)}function Nn(e,t,s,r){if(!t.includes("<"))return!1;for(let i=0;i<t.length;i++){if(t[i]==="\\\\"){i++;continue}if(t[i]==="`"){let c=r.inline.code.exec(t.slice(i));if(c){i+=c[0].length-1;continue}}if(t[i]!=="<")continue;let n=e.slice(s+i),o=r.inline.tag.exec(n)||r.inline.autolink.exec(n);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var Ts=class{constructor(e){De(this,"options",void 0),De(this,"rules",void 0),De(this,"lexer",void 0),this.options=e||is}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=this.options.pedantic?t[0]:Rn(t[0]);return{type:"code",raw:s,codeBlockStyle:"indented",text:s.replace(this.rules.other.codeRemoveIndent,"")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],r=sc(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let r=Ht(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(s=r.trim())}return{type:"heading",raw:Ht(t[0],`\n`),depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ht(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=Ht(t[0],`\n`).split(`\n`),r="",i="",n=[];for(;s.length>0;){let o=!1,c=[],d=0;for(;d<s.length;d++)if(this.rules.other.blockquoteStart.test(s[d]))c.push(s[d]),o=!0;else if(!o)c.push(s[d]);else break;s=s.slice(d);let h=c.join(`\n`),p=h.replace(this.rules.other.blockquoteMarkerWhitespace,(l,g,m)=>g+yr(m,g.length)).replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${h}`:h,i=i?`${i}\n${p}`:p;let a=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,n,!0),this.lexer.state.top=a,s.length===0)break;let f=n.at(-1);if(f?.type==="code"||f?.type==="heading"||f?.type==="hr"||f?.type==="html"||f?.type==="table")break;if(f?.type==="blockquote"){let l=f,g=s.join(`\n`),m=l.raw+`\n`+g.replace(this.rules.other.blockquoteSetextReplace2,""),y=this.blockquote(m);n[n.length-1]=y;let S=m.substring(y.raw.length).replace(/^\\n/,""),w=S?S.split(`\n`).length:0,b=w?s.slice(0,-w):s;if(b.length>0&&(r=`${r}\n${b.join(`\n`)}`),i=i.substring(0,i.length-l.text.length)+y.text,s=s.slice(b.length),s.length>0&&this.rules.other.blockquoteStart.test(s[0]))continue;break}else if(f?.type==="list"){let l=f,g=l.raw+`\n`+s.join(`\n`),m=this.list(g);n[n.length-1]=m;let y=m.raw.length>l.raw.length?g.slice(l.raw.length+1,m.raw.length).split(`\n`).length:0;if(y>0){let S=s.slice(0,y).join(`\n`);r=`${r}\n${S}`,i=`${i}\n${S}`}s=s.slice(y);continue}}return{type:"blockquote",raw:r,tokens:n,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(e))return;let s=e,r=()=>s.length-e.length,i=t[1].trim(),n=i.length>1,o={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\\\d{1,9}\\\\${i.slice(-1)}`:`\\\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let c=this.rules.other.listItemRegex(i),d=!1;for(;e;){let p=!1,a="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;let f=r();e=e.substring(t[0].length);let l=t[2].split(`\n`,1)[0],g=t[1].length,m=this.options.pedantic?yr(l,g):l.replace(this.rules.other.leadingSpaceTab,u=>yr(u,g)),y=e.split(`\n`,1)[0],S=!m.trim(),w=0;if(this.options.pedantic?(w=2,a=m.trimStart()):S?w=g+1:(w=m.search(this.rules.other.nonSpaceChar),w=w>4?1:w,a=m.slice(w),w+=g),S&&this.rules.other.blankLine.test(y)&&(e=e.substring(y.length+1),p=!0),!p){let u=this.rules.other.nextBulletRegex(w),v=this.rules.other.hrRegex(w),_=this.rules.other.fencesBeginRegex(w),k=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(w):this.rules.other.headingBeginRegex(w),T=this.rules.other.htmlBeginRegex(w),O=this.rules.other.blockquoteBeginRegex(w),L=!1;for(;e;){let R=e.split(`\n`,1)[0],I;if(y=R,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),I=y):I=y.replace(this.rules.other.leadingSpaceTab,q=>yr(q)),_.test(y)||k.test(y)||T.test(y)||O.test(y)||u.test(y)||v.test(y))break;if(I.search(this.rules.other.nonSpaceChar)>=w||!y.trim())a+=`\n`+I.slice(w),L=!1;else{if(S||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(m)||k.test(m)||T.test(m)||v.test(m))break;if(!this.options.pedantic&&!L){let z=m.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(z)||this.rules.block.heading.test(z)||this.rules.block.hr.test(z))break}let q=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(y)&&this.rules.block.lheading.test(`${m}\n${y}`)?` ${I.replace(/^ {0,3}/,"")}`:y;a+=`\n`+q,L=!0}S=!y.trim(),e=e.substring(R.length+1),m=I.slice(w)}}let b=s.slice(f,r());o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(d=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=s.slice(0,r()).trimEnd();for(let p of o.items)if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),!o.loose){let a=p.tokens.filter(f=>f.type==="space");o.loose=a.length>0&&a.some(f=>this.rules.other.anyLine.test(f.raw))}for(let p of o.items){let a=p.tokens[0];if(p.task&&(a?.type==="text"||a?.type==="paragraph")){p.text=p.text.replace(this.rules.other.listReplaceTask,""),a.raw=a.raw.replace(this.rules.other.listReplaceTask,""),a.text=a.text.replace(this.rules.other.listReplaceTask,"");for(let l=this.lexer.inlineQueue.length-1;l>=0;l--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[l].src)){this.lexer.inlineQueue[l].src=this.lexer.inlineQueue[l].src.replace(this.rules.other.listReplaceTask,"");break}let f=this.rules.other.listTaskCheckbox.exec(p.raw);if(f){let l={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};p.checked=l.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=l.raw+p.tokens[0].raw,p.tokens[0].text=l.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(l)):p.tokens.unshift({type:"paragraph",raw:l.raw,text:l.raw,tokens:[l]}):p.tokens.unshift(l)}}else p.task&&(p.task=!1)}if(o.loose)for(let p of o.items){p.loose=!0;for(let a of p.tokens)a.type==="text"&&(a.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let s=Rn(t[0]);return{type:"html",block:!0,raw:s,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:s}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&On(t[2],"()")!==-1)return;let s=vr(t[1]),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:Ht(t[0],`\n`),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=In(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`\n`):[],n={type:"table",raw:Ht(t[0],`\n`),header:[],align:[],rows:[]};if(s.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<s.length;o++)n.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(In(o,n.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:n.align[d]})));return n}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let s=t[1].trim();return{type:"heading",raw:Ht(t[0],`\n`),depth:t[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let s=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Nn(e,t[1],s,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let c=Ht(r.slice(0,-1),"\\\\");if((r.length-c.length)%2===0)return}else{let c=On(t[2],"()");if(c===-2)return;if(c>-1){let d=(t[0].indexOf("!")===0?5:4)+t[1].length+c;t[2]=t[2].substring(0,c),t[0]=t[0].substring(0,d).trim(),t[3]=""}}let i=Ht(t[0].slice(0,-1),"\\\\");if((t[0].length-i.length)%2===0)return;let n=t[2],o="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(n);c&&(n=c[1],o=c[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Mn(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let r=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Nn(e,s[1],r,this.rules))return;let i=t[vr(s[2]||s[1])];if(!i){let n=s[0].charAt(0);return{type:"text",raw:n,text:n}}return Mn(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],n=s===i,o=t.length-e.length,c=o;for(;!this.options.pedantic&&c>0&&t[c-1]===i;)c--;let d=[...t.slice(Math.max(0,c-2),c)].at(-1)??"",h=d==="*"||d==="_"||!!this.rules.inline.punctuation.exec(d);c<o&&(s=d);let p=c<o?h:s==="*"||s==="_"||!!this.rules.inline.punctuation.exec(s);if(r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))return;let a=r[1]||r[3]||"";if(!a||!s||p){let f=[...r[0]].length-1,l,g,m=f,y=0,S=o-c+f,w=!this.options.pedantic&&!!d.trim()&&(!!a||i==="*"&&!h);if(i!=="*"&&i!=="_")return;let b=i==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,u=ec(this,t,i),v=t.length-e.length+f;if(u<v)return;t=t.slice(-1*e.length+f);let _=u-v;for(b.lastIndex=0;(r=b.exec(t))!==null&&!(r.index>_);){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(g=[...l].length,r[3]||r[4]){m+=g;continue}else if(r[5]||r[6]||w){if(n&&(r[5]||r[6]))break;if(S%3&&!((S+g)%3)){y+=g;continue}}if(m-=g,m>0)continue;g=Math.min(g,g+m+y);let k=[...r[0]][0].length,T=e.slice(0,f+r.index+k+g);if(Math.min(f,g)%2){let L=T.slice(1,-1);return{type:"em",raw:T,text:L,tokens:this.lexer.inlineTokens(L)}}let O=T.slice(2,-2);return{type:"strong",raw:T,text:O,tokens:this.lexer.inlineTokens(O)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,s=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let i=[...r[0]].length-1,n,o,c=i,d=this.rules.inline.delRDelim,h=tc(this,t),p=t.length-e.length+i;if(h<p)return;t=t.slice(-1*e.length+i);let a=h-p;for(d.lastIndex=0;(r=d.exec(t))!==null&&!(r.index>a);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let f=[...r[0]][0].length,l=e.slice(0,i+r.index+f+o),g=l.slice(i,-i);return{type:"del",raw:l,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=t[1],r="mailto:"+s):(s=t[1],r=s),{type:"link",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]==="@")s=t[0],r="mailto:"+s;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);s=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:s?t[0]:Kl(t[0]),escaped:s}}}},Et=(ws=new WeakSet,class fn{constructor(t){nl(this,ws),De(this,"tokens",void 0),De(this,"options",void 0),De(this,"state",void 0),De(this,"inlineQueue",void 0),De(this,"tokenizer",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||is,this.options.tokenizer=this.options.tokenizer||new Ts,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:Ke,block:mr.normal,inline:zs.normal};this.options.pedantic?(s.block=mr.pedantic,s.inline=zs.pedantic):this.options.gfm&&(s.block=mr.gfm,this.options.breaks?s.inline=zs.breaks:s.inline=zs.gfm),this.tokenizer.rules=s}static get rules(){return{block:mr,inline:zs}}static lex(t,s){return new fn(s).lex(t)}static lexInline(t,s){return new fn(s).inlineTokens(t)}lex(t){t=t.replace(Ke.carriageReturn,`\n`),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let r=this.inlineQueue[s];this.state.inRawBlock=!1,this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],r=!1){this.tokenizer.lexer=this;let i=this.state.lastToken;this.options.pedantic&&(t=t.replace(Ke.tabCharGlobal," ").replace(Ke.spaceLine,""));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}this.state.lastToken=s.at(-1);let o;if(this.options.extensions?.block?.some(d=>(o=d.call({lexer:this},t,s))?(t=t.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let d=s.at(-1);o.raw.length===1&&d!==void 0?d.raw+=`\n`:s.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let d=s.at(-1);d?.type==="paragraph"||d?.type==="text"?(d.raw+=(d.raw.endsWith(`\n`)?"":`\n`)+o.raw,d.text+=`\n`+o.text,this.inlineQueue.at(-1).src=d.text):s.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let d=s.at(-1);d?.type==="paragraph"||d?.type==="text"?(d.raw+=(d.raw.endsWith(`\n`)?"":`\n`)+o.raw,d.text+=`\n`+o.raw,this.inlineQueue.at(-1).src=d.text):(this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title}),s.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),s.push(o);continue}let c=t;if(this.options.extensions?.startBlock){let d=1/0,h=t.slice(1),p;this.options.extensions.startBlock.forEach(a=>{p=a.call({lexer:this},h),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(c=t.substring(0,d+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){let d=s.at(-1);r&&d?.type==="paragraph"?(d.raw+=(d.raw.endsWith(`\n`)?"":`\n`)+o.raw,d.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):s.push(o),r=c.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let d=s.at(-1);d?.type==="text"?(d.raw+=(d.raw.endsWith(`\n`)?"":`\n`)+o.raw,d.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):s.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=i,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}linkInText(t){if(!t.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(r[0])&&t.charAt(r.index-1)!=="!")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],n=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,vr(i.slice(n+1,-1))))&&!(n>1&&this.linkInText(i.slice(1,n-1))))return!0}return!1}inlineTokens(t,s=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(")");try{return fr(ws,this,rc).call(this,t,s)}finally{this.state.linkParenPossible=r}}infiniteLoopError(t){let s="Infinite loop on byte: "+t;if(this.options.silent)console.error(s);else throw new Error(s)}});function rc(e,t){let s=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==Ts.prototype.emStrong||this.tokenizer.del!==Ts.prototype.del?fr(ws,this,oc).call(this,e):e;Jl(this.tokenizer,s);try{return fr(ws,this,ic).call(this,e,s,t)}finally{Ql(this.tokenizer)}}function ic(e,t,s){let r=!1,i="",n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let o;if(this.options.extensions?.inline?.some(d=>(o=d.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let d=s.at(-1);o.type==="text"&&d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let c=e;if(this.options.extensions?.startInline){let d=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(a=>{p=a.call({lexer:this},h),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(c=e.substring(0,d+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),r=!0;let d=s.at(-1);d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}function nc(e){let{blockSkip:t,tag:s,autolink:r}=this.tokenizer.rules.inline,i="",n=0,o;for(t.lastIndex=0;o=t.exec(e);){let c=o.index+(o[2]?o[2].length:0),d=o.index+o[0].length;if(e.charAt(c)==="<"){let h=e.slice(c),p=s.exec(h)||r.exec(h);if(!p){t.lastIndex=c+1;continue}d=c+p[0].length,t.lastIndex=d}i+=e.slice(n,c)+"["+"a".repeat(d-c-2)+"]",n=d}return i+e.slice(n)}function oc(e){let t=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,r=i=>{let n=i.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,vr(i.slice(n+1,-1))))return i;if(n>1&&i.charAt(0)!=="!"){let o=i.slice(1,n-1);if(this.linkInText(o))return"["+o.replace(s,r)+"]["+"a".repeat(i.length-n-2)+"]"}return"["+"a".repeat(i.length-2)+"]"};t=t.replace(s,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,r,i)=>i?"+".repeat(s.length):r?r+s.slice(r.length,-r.length).replace(/`/g,"+")+r:s),t=fr(ws,this,nc).call(this,t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}var br=class{constructor(e){De(this,"options",void 0),De(this,"parser",void 0),this.options=e||is}space(e){return""}code({text:e,lang:t,escaped:s}){let r=(t||"").match(Ke.notSpaceStart)?.[0],i=e?e.replace(Ke.endingNewline,"")+`\n`:"";return r?\'<pre><code class="language-\'+mt(r)+\'">\'+(s?i:mt(i,!0))+`</code></pre>\n`:"<pre><code>"+(s?i:mt(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,s=e.start,r="";for(let o=0;o<e.items.length;o++){let c=e.items[o];r+=this.listitem(c)}let i=t?"ol":"ul",n=t&&s!==1?\' start="\'+s+\'"\':"";return"<"+i+n+`>\n`+r+"</"+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?\'checked="" \':"")+\'disabled="" type="checkbox"> \'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",s="";for(let i=0;i<e.header.length;i++)s+=this.tablecell(e.header[i]);t+=this.tablerow({text:s});let r="";for(let i=0;i<e.rows.length;i++){let n=e.rows[i];s="";for(let o=0;o<n.length;o++)s+=this.tablecell(n[o]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${mt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:s,tokens:r,autolink:i}){let n=i?mt(s,!0):this.parser.parseInline(r),o=Ln(e);if(o===null)return n;e=mt(o,i);let c=\'<a href="\'+e+\'"\';return t&&(c+=\' title="\'+mt(t)+\'"\'),c+=">"+n+"</a>",c}image({href:e,title:t,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let i=Ln(e);if(i===null)return mt(s);e=i;let n=`<img src="${mt(e)}" alt="${mt(s)}"`;return t&&(n+=` title="${mt(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:mt(e.text)}},pi=class{constructor(){De(this,"parser",void 0)}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`\n`}checkbox({raw:e}){return e}},Pt=class pn{constructor(t){De(this,"options",void 0),De(this,"renderer",void 0),De(this,"textRenderer",void 0),this.options=t||is,this.options.renderer=this.options.renderer||new br,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new pi,this.textRenderer.parser=this}static parse(t,s){return new pn(s).parse(t)}static parseInline(t,s){return new pn(s).parseInline(t)}parse(t){this.renderer.parser=this;let s="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){s+=c===!1?"":c??"";continue}}let n=i;switch(n.type){case"space":s+=this.renderer.space(n);break;case"hr":s+=this.renderer.hr(n);break;case"heading":s+=this.renderer.heading(n);break;case"code":s+=this.renderer.code(n);break;case"table":s+=this.renderer.table(n);break;case"blockquote":s+=this.renderer.blockquote(n);break;case"list":s+=this.renderer.list(n);break;case"checkbox":s+=this.renderer.checkbox(n);break;case"html":s+=this.renderer.html(n);break;case"def":s+=this.renderer.def(n);break;case"paragraph":s+=this.renderer.paragraph(n);break;case"text":s+=this.renderer.text(n);break;default:{let o=\'Token with "\'+n.type+\'" type was not found.\';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(t,s=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){r+=c===!1?"":c??"";continue}}let o=n;switch(o.type){case"escape":r+=s.text(o);break;case"html":r+=s.html(o);break;case"link":r+=s.link(o);break;case"image":r+=s.image(o);break;case"checkbox":r+=s.checkbox(o);break;case"strong":r+=s.strong(o);break;case"em":r+=s.em(o);break;case"codespan":r+=s.codespan(o);break;case"br":r+=s.br(o);break;case"del":r+=s.del(o);break;case"text":r+=s.text(o);break;default:{let c=\'Token with "\'+o.type+\'" type was not found.\';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},Us=(pr=class{constructor(e){De(this,"options",void 0),De(this,"block",void 0),this.options=e||is}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Et.lex:Et.lexInline}provideParser(e=this.block){return e?Pt.parse:Pt.parseInline}},De(pr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),De(pr,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),pr);function Yt(e,t){if(Array.isArray(t))for(let s=0;s<t.length;s++)e.push(t[s]);else e.push(t)}var ac=class{constructor(...e){De(this,"defaults",ni()),De(this,"options",this.setOptions),De(this,"parse",this.parseMarkdown(!0)),De(this,"parseInline",this.parseMarkdown(!1)),De(this,"Parser",Pt),De(this,"Renderer",br),De(this,"TextRenderer",pi),De(this,"Lexer",Et),De(this,"Tokenizer",Ts),De(this,"Hooks",Us),this.use(...e)}walkTokens(e,t){let s=[];for(let r of e)switch(Yt(s,t.call(this,r)),r.type){case"table":{let i=r;for(let n of i.header)Yt(s,this.walkTokens(n.tokens,t));for(let n of i.rows)for(let o of n)Yt(s,this.walkTokens(o.tokens,t));break}case"list":{let i=r;Yt(s,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);Yt(s,this.walkTokens(o,t))}):i.tokens&&Yt(s,this.walkTokens(i.tokens,t))}}return s}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=t.renderers[i.name];n?t.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=n.apply(this,o)),c}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be \'block\' or \'inline\'");let n=t[i.level];n?n.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){let i=this.defaults.renderer||new br(this.defaults);for(let n in s.renderer){if(!(n in i))throw new Error(`renderer \'${n}\' does not exist`);if(["options","parser"].includes(n))continue;let o=n,c=s.renderer[o],d=i[o];i[o]=(...h)=>{let p=c.apply(i,h);return p===!1&&(p=d.apply(i,h)),p===!1?"":p??""}}r.renderer=i}if(s.tokenizer){let i=this.defaults.tokenizer||new Ts(this.defaults);for(let n in s.tokenizer){if(!(n in i))throw new Error(`tokenizer \'${n}\' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,c=s.tokenizer[o],d=i[o];i[o]=(...h)=>{let p=c.apply(i,h);return p===!1&&(p=d.apply(i,h)),p}}r.tokenizer=i}if(s.hooks){let i=this.defaults.hooks||new Us;for(let n in s.hooks){if(!(n in i))throw new Error(`hook \'${n}\' does not exist`);if(["options","block"].includes(n))continue;let o=n,c=s.hooks[o],d=i[o];Us.passThroughHooks.has(n)?i[o]=h=>{if(i.options.async&&Us.passThroughHooksRespectAsync.has(n))return(async()=>{let a=await c.call(i,h);return d.call(i,a)})();let p=c.call(i,h);return d.call(i,p)}:i[o]=(...h)=>{if(i.options.async)return(async()=>{let a=await c.apply(i,h);return a===!1&&(a=await d.apply(i,h)),a})();let p=c.apply(i,h);return p===!1&&(p=d.apply(i,h)),p}}r.hooks=i}if(s.walkTokens){let i=this.defaults.walkTokens,n=s.walkTokens;r.walkTokens=function(o){let c=[];return Yt(c,n.call(this,o)),i&&Yt(c,i.call(this,o)),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Et.lex(e,t??this.defaults)}parser(e,t){return Pt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,s)=>{let r={...s},i={...this.defaults,...r},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,c=await(i.hooks?await i.hooks.provideLexer(e):e?Et.lex:Et.lexInline)(o,i),d=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(d,i.walkTokens));let h=await(i.hooks?await i.hooks.provideParser(e):e?Pt.parse:Pt.parseInline)(d,i);return i.hooks?await i.hooks.postprocess(h):h})().catch(n);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer(e):e?Et.lex:Et.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(e):e?Pt.parse:Pt.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return n(o)}}}onError(e,t){return s=>{if(s.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+mt(s.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}},as=new ac;function $e(e,t){return as.parse(e,t)}$e.options=$e.setOptions=function(e){return as.setOptions(e),$e.defaults=as.defaults,mn($e.defaults),$e},$e.getDefaults=ni,$e.defaults=is;function lc(...e){return as.use(...e),$e.defaults=as.defaults,mn($e.defaults),$e}$e.use=lc,$e.walkTokens=function(e,t){return as.walkTokens(e,t)},$e.parseInline=as.parseInline,$e.Parser=Pt,$e.parser=Pt.parse,$e.Renderer=br,$e.TextRenderer=pi,$e.Lexer=Et,$e.lexer=Et.lex,$e.Tokenizer=Ts,$e.Hooks=Us,$e.parse=$e;var td=$e.options,sd=$e.setOptions,rd=$e.walkTokens,gi=$e.parseInline,mi=$e,id=Pt.parse,nd=Et.lex,lt=fe((e=>{e.__esModule=!0,e.extend=n,e.indexOf=h,e.escapeExpression=p,e.isEmpty=a,e.createFrame=f,e.blockParams=l,e.appendContextPath=g;var t={"&":"&amp;","<":"&lt;",">":"&gt;",\'"\':"&quot;","\'":"&#x27;","`":"&#x60;","=":"&#x3D;"},s=/[&<>"\'`=]/g,r=/[&<>"\'`=]/;function i(m){return t[m]}function n(m){for(var y=1;y<arguments.length;y++)for(var S in arguments[y])Object.prototype.hasOwnProperty.call(arguments[y],S)&&(m[S]=arguments[y][S]);return m}var o=Object.prototype.toString;e.toString=o;var c=function(y){return typeof y=="function"};c(/x/)&&(e.isFunction=c=function(m){return typeof m=="function"&&o.call(m)==="[object Function]"}),e.isFunction=c;var d=Array.isArray||function(m){return m&&typeof m=="object"?o.call(m)==="[object Array]":!1};e.isArray=d;function h(m,y){for(var S=0,w=m.length;S<w;S++)if(m[S]===y)return S;return-1}function p(m){if(typeof m!="string"){if(m&&typeof m.toHTML=="function")return m.toHTML();if(m==null)return"";if(!m)return m+"";m=""+m}return r.test(m)?m.replace(s,i):m}function a(m){return!m&&m!==0?!0:!!(d(m)&&m.length===0)}function f(m){var y=n({},m);return y._parent=m,y}function l(m,y){return m.path=y,m}function g(m,y){return(m?m+".":"")+y}})),Lt=fe(((e,t)=>{e.__esModule=!0;var s=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function r(i,n){var o=n&&n.loc,c=void 0,d=void 0,h=void 0,p=void 0;o&&o.start&&(c=o.start.line,h=o.start.column,o.end&&(d=o.end.line,p=o.end.column),i+=" - "+c+":"+h);for(var a=Error.prototype.constructor.call(this,i),f=0;f<s.length;f++)this[s[f]]=a[s[f]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=c,this.endLineNumber=d,Object.defineProperty?(Object.defineProperty(this,"column",{value:h,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:p,enumerable:!0})):(this.column=h,this.endColumn=p))}catch{}}r.prototype=new Error,e.default=r,t.exports=e.default})),cc=fe(((e,t)=>{e.__esModule=!0;var s=lt();e.default=function(r){r.registerHelper("blockHelperMissing",function(i,n){var o=n.inverse,c=n.fn;if(i===!0)return c(this);if(i===!1||i==null)return o(this);if(s.isArray(i))return i.length>0?(n.ids&&(n.ids=[n.name]),r.helpers.each(i,n)):o(this);if(n.data&&n.ids){var d=s.createFrame(n.data);d.contextPath=s.appendContextPath(n.data.contextPath,n.name),n={data:d}}return c(i,n)})},t.exports=e.default})),uc=fe(((e,t)=>{e.__esModule=!0;function s(o){return o&&o.__esModule?o:{default:o}}var r=lt(),i=s(Lt());function n(o){try{var c=o.return;r.isFunction(c)&&c.call(o)}catch{}}e.default=function(o){o.registerHelper("each",function(c,d){if(!d)throw new i.default("Must pass iterator to #each");var h=d.fn,p=d.inverse,a=0,f="",l=void 0,g=void 0;d.data&&d.ids&&(g=r.appendContextPath(d.data.contextPath,d.ids[0])+"."),r.isFunction(c)&&(c=c.call(this)),d.data&&(l=r.createFrame(d.data));function m(u,v,_,k){l&&(l.key=u,l.index=v,l.first=v===0,l.last=!!_,g&&(l.contextPath=g+u)),f=f+h(k,{data:l,blockParams:r.blockParams([k,u],[g+u,null])})}if(c&&typeof c=="object")if(r.isArray(c))for(var y=c.length;a<y;a++)a in c&&m(a,a,a===c.length-1,c[a]);else if(typeof Symbol=="function"&&c[Symbol.iterator])for(var S=c[Symbol.iterator](),w=S.next();!w.done;){var b=S.next();try{m(a,a,b.done,w.value)}catch(u){throw b.done||n(S),u}w=b,a++}else(function(){var u=void 0;Object.keys(c).forEach(function(v){u!==void 0&&m(u,a-1,!1,c[u]),u=v,a++}),u!==void 0&&m(u,a-1,!0,c[u])})();return a===0&&(f=p(this)),f})},t.exports=e.default})),hc=fe(((e,t)=>{e.__esModule=!0;function s(i){return i&&i.__esModule?i:{default:i}}var r=s(Lt());e.default=function(i){i.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new r.default(\'Missing helper: "\'+arguments[arguments.length-1].name+\'"\')})},t.exports=e.default})),dc=fe(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=lt(),i=s(Lt());e.default=function(n){n.registerHelper("if",function(o,c){if(arguments.length!=2)throw new i.default("#if requires exactly one argument");return r.isFunction(o)&&(o=o.call(this)),!c.hash.includeZero&&!o||r.isEmpty(o)?c.inverse(this):c.fn(this)}),n.registerHelper("unless",function(o,c){if(arguments.length!=2)throw new i.default("#unless requires exactly one argument");return n.helpers.if.call(this,o,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},t.exports=e.default})),fc=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper("log",function(){for(var r=[void 0],i=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)r.push(arguments[n]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),r[0]=o,s.log.apply(s,r)})},t.exports=e.default})),pc=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper("lookup",function(r,i,n){return r&&n.lookupProperty(r,i)})},t.exports=e.default})),gc=fe(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=lt(),i=s(Lt());e.default=function(n){n.registerHelper("with",function(o,c){if(arguments.length!=2)throw new i.default("#with requires exactly one argument");r.isFunction(o)&&(o=o.call(this));var d=c.fn;if(r.isEmpty(o))return c.inverse(this);var h=c.data;return c.data&&c.ids&&(h=r.createFrame(c.data),h.contextPath=r.appendContextPath(c.data.contextPath,c.ids[0])),d(o,{data:h,blockParams:r.blockParams([o],[h&&h.contextPath])})})},t.exports=e.default})),Dn=fe((e=>{e.__esModule=!0,e.registerDefaultHelpers=h,e.moveHelperToHooks=p;function t(a){return a&&a.__esModule?a:{default:a}}var s=t(cc()),r=t(uc()),i=t(hc()),n=t(dc()),o=t(fc()),c=t(pc()),d=t(gc());function h(a){s.default(a),r.default(a),i.default(a),n.default(a),o.default(a),c.default(a),d.default(a)}function p(a,f,l){a.helpers[f]&&(a.hooks[f]=a.helpers[f],l||(a.helpers[f]=void 0))}})),mc=fe(((e,t)=>{e.__esModule=!0;var s=lt();e.default=function(r){r.registerDecorator("inline",function(i,n,o,c){var d=i;return n.partials||(n.partials={},d=function(h,p){var a=o.partials;o.partials=s.extend({},a,n.partials);var f=i(h,p);return o.partials=a,f}),n.partials[c.args[0]]=c.fn,d})},t.exports=e.default})),vc=fe((e=>{e.__esModule=!0,e.registerDefaultDecorators=r;function t(i){return i&&i.__esModule?i:{default:i}}var s=t(mc());function r(i){s.default(i)}})),$n=fe(((e,t)=>{e.__esModule=!0;var s=lt(),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(n){if(typeof n=="string"){var o=s.indexOf(r.methodMap,n.toLowerCase());o>=0?n=o:n=parseInt(n,10)}return n},log:function(n){if(n=r.lookupLevel(n),typeof console<"u"&&r.lookupLevel(r.level)<=n){var o=r.methodMap[n];console[o]||(o="log");for(var c=arguments.length,d=Array(c>1?c-1:0),h=1;h<c;h++)d[h-1]=arguments[h];console[o].apply(console,d)}}};e.default=r,t.exports=e.default})),Bn=fe((e=>{e.__esModule=!0,e.createProtoAccessControl=n,e.resultIsAllowed=o,e.isPrototypeConstructor=c,e.resetLoggedProperties=p;function t(a){return a&&a.__esModule?a:{default:a}}var s=lt(),r=t($n()),i=Object.create(null);function n(a){var f=Object.create(null);f.__proto__=!1,s.extend(f,a.allowedProtoProperties);var l=Object.create(null);return l.constructor=!1,l.__defineGetter__=!1,l.__defineSetter__=!1,l.__lookupGetter__=!1,l.__lookupSetter__=!1,s.extend(l,a.allowedProtoMethods),{properties:{whitelist:f,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l,defaultValue:a.allowProtoMethodsByDefault}}}function o(a,f,l){return d(typeof a=="function"?f.methods:f.properties,l)}function c(a,f,l){return f==="constructor"&&typeof l=="function"&&a===l.prototype}function d(a,f){return a.whitelist[f]!==void 0?a.whitelist[f]===!0:a.defaultValue!==void 0?a.defaultValue:(h(f),!1)}function h(a){i[a]!==!0&&(i[a]=!0,r.default.log("error",\'Handlebars: Access has been denied to resolve the property "\'+a+`" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function p(){Object.keys(i).forEach(function(a){delete i[a]})}})),vi=fe((e=>{e.__esModule=!0,e.HandlebarsEnvironment=l;function t(m){return m&&m.__esModule?m:{default:m}}var s=lt(),r=t(Lt()),i=Dn(),n=vc(),o=t($n()),c=Bn(),d="4.7.10";e.VERSION=d;var h=8;e.COMPILER_REVISION=h;var p=7;e.LAST_COMPATIBLE_COMPILER_REVISION=p;var a={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};e.REVISION_CHANGES=a;var f="[object Object]";function l(m,y,S){this.helpers=m||{},this.partials=y||{},this.decorators=S||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:o.default,log:o.default.log,registerHelper:function(y,S){if(s.toString.call(y)===f){if(S)throw new r.default("Arg not supported with multiple helpers");s.extend(this.helpers,y)}else this.helpers[y]=S},unregisterHelper:function(y){delete this.helpers[y]},registerPartial:function(y,S){if(s.toString.call(y)===f)s.extend(this.partials,y);else{if(typeof S>"u")throw new r.default(\'Attempting to register a partial called "\'+y+\'" as undefined\');this.partials[y]=S}},unregisterPartial:function(y){delete this.partials[y]},registerDecorator:function(y,S){if(s.toString.call(y)===f){if(S)throw new r.default("Arg not supported with multiple decorators");s.extend(this.decorators,y)}else this.decorators[y]=S},unregisterDecorator:function(y){delete this.decorators[y]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var g=o.default.log;e.log=g,e.createFrame=s.createFrame,e.logger=o.default})),yc=fe(((e,t)=>{e.__esModule=!0;function s(r){this.string=r}s.prototype.toString=s.prototype.toHTML=function(){return""+this.string},e.default=s,t.exports=e.default})),bc=fe((e=>{e.__esModule=!0,e.wrapHelper=t;function t(s,r){return typeof s!="function"?s:function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=r(n),s.apply(this,arguments)}}})),_c=fe((e=>{e.__esModule=!0,e.checkRevision=h,e.template=p,e.wrapProgram=a,e.resolvePartial=f,e.invokePartial=l,e.noop=g;function t(u){return u&&u.__esModule?u:{default:u}}function s(u){if(u&&u.__esModule)return u;var v={};if(u!=null)for(var _ in u)Object.prototype.hasOwnProperty.call(u,_)&&(v[_]=u[_]);return v.default=u,v}var r=s(lt()),i=t(Lt()),n=vi(),o=Dn(),c=bc(),d=Bn();function h(u){var v=u&&u[0]||1,_=n.COMPILER_REVISION;if(!(v>=n.LAST_COMPATIBLE_COMPILER_REVISION&&v<=n.COMPILER_REVISION))if(v<n.LAST_COMPATIBLE_COMPILER_REVISION){var k=n.REVISION_CHANGES[_],T=n.REVISION_CHANGES[v];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+k+") or downgrade your runtime to an older version ("+T+").")}else throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+u[1]+").")}function p(u,v){if(!v)throw new i.default("No environment passed to template");if(!u||!u.main)throw new i.default("Unknown template object: "+typeof u);u.main.decorator=u.main_d,v.VM.checkRevision(u.compiler);var _=u.compiler&&u.compiler[0]===7;function k(L,R,I){I.hash&&(R=r.extend({},R,I.hash),I.ids&&(I.ids[0]=!0)),L=v.VM.resolvePartial.call(this,L,R,I),I.hooks=this.hooks,I.protoAccessControl=this.protoAccessControl;var q=v.VM.invokePartial.call(this,L,R,I);if(q==null&&r.isFunction(L))throw new i.default("The partial "+I.name+" returned no output: partials must return a string");if(q==null&&v.compile){if(typeof L!="string")throw new i.default("The partial "+I.name+" could not be compiled: partials must be strings or functions returning strings");I.partials[I.name]=v.compile(L,u.compilerOptions,v),q=I.partials[I.name](R,I)}if(q!=null){if(I.indent){for(var z=q.split(`\n`),W=0,E=z.length;W<E&&!(!z[W]&&W+1===E);W++)z[W]=I.indent+z[W];q=z.join(`\n`)}return q}else throw new i.default("The partial "+I.name+" could not be compiled when running in runtime-only mode")}var T={strict:function(R,I,q){if(!R||!(I in R))throw new i.default(\'"\'+I+\'" not defined in \'+R,{loc:q});return T.lookupProperty(R,I)},lookupProperty:function(R,I){var q=R[I];if(q==null||Object.prototype.hasOwnProperty.call(R,I)&&!d.isPrototypeConstructor(R,I,q)||d.resultIsAllowed(q,T.protoAccessControl,I))return q},lookup:function(R,I){for(var q=R.length,z=0;z<q;z++){var W=R[z]&&T.lookupProperty(R[z],I);if(W!=null)return W}},lambda:function(R,I){return typeof R=="function"?R.call(I):R},escapeExpression:r.escapeExpression,invokePartial:k,fn:function(R){var I=u[R];return I.decorator=u[R+"_d"],I},programs:[],program:function(R,I,q,z,W){var E=this.programs[R],D=this.fn(R);return I||W||z||q?E=a(this,R,D,I,q,z,W):E||(E=this.programs[R]=a(this,R,D)),E},data:function(R,I){for(;R&&I--;)R=R._parent;return R},mergeIfNeeded:function(R,I){var q=R||I;return R&&I&&R!==I&&(q=r.extend({},I,R)),q},nullContext:Object.seal({}),noop:v.VM.noop,compilerInfo:u.compiler};function O(L){var R=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],I=R.data;O._setup(R),!R.partial&&u.useData&&(I=y(L,I));var q=void 0,z=u.useBlockParams?[]:void 0;u.useDepths&&(R.depths?q=L!=R.depths[0]?[L].concat(R.depths):R.depths:q=[L]);function W(E){return""+u.main(T,E,T.helpers,T.partials,I,z,q)}return W=S(u.main,W,T,R.depths||[],I,z),W(L,R)}return O.isTop=!0,O._setup=function(L){if(L.partial)T.protoAccessControl=L.protoAccessControl,T.helpers=L.helpers,T.partials=L.partials,T.decorators=L.decorators,T.hooks=L.hooks;else{var R={};w(R,v.helpers,T),w(R,L.helpers,T),T.helpers=R,u.usePartial&&(T.partials=T.mergeIfNeeded(L.partials,v.partials)),(u.usePartial||u.useDecorators)&&(T.decorators=r.extend({},v.decorators,L.decorators)),T.hooks={},T.protoAccessControl=d.createProtoAccessControl(L);var I=L.allowCallsToHelperMissing||_;o.moveHelperToHooks(T,"helperMissing",I),o.moveHelperToHooks(T,"blockHelperMissing",I)}},O._child=function(L,R,I,q){if(u.useBlockParams&&!I)throw new i.default("must pass block params");if(u.useDepths&&!q)throw new i.default("must pass parent depths");return a(T,L,u[L],R,0,I,q)},O}function a(u,v,_,k,T,O,L){function R(I){var q=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],z=L;return L&&I!=L[0]&&!(I===u.nullContext&&L[0]===null)&&(z=[I].concat(L)),_(u,I,u.helpers,u.partials,q.data||k,O&&[q.blockParams].concat(O),z)}return R=S(_,R,u,L,k,O),R.program=v,R.depth=L?L.length:0,R.blockParams=T||0,R}function f(u,v,_){return u?typeof u!="function"&&!_.name&&(_.name=u,u=m(_.partials,u)):_.name==="@partial-block"?u=m(_.data,"partial-block"):u=m(_.partials,_.name),u}function l(u,v,_){var k=m(_.data,"partial-block");_.partial=!0,_.ids&&(_.data.contextPath=_.ids[0]||_.data.contextPath);var T=void 0;if(_.fn&&_.fn!==g&&(function(){_.data=n.createFrame(_.data);var O=_.fn;T=_.data["partial-block"]=function(R){var I=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return I.data=n.createFrame(I.data),I.data["partial-block"]=k,O(R,I)},O.partials&&(_.partials=r.extend({},_.partials,O.partials))})(),u===void 0&&T&&(u=T),u===void 0)throw new i.default("The partial "+_.name+" could not be found");if(u instanceof Function)return u(v,_)}function g(){return""}function m(u,v){if(u&&Object.prototype.hasOwnProperty.call(u,v))return u[v]}function y(u,v){return(!v||!("root"in v))&&(v=v?n.createFrame(v):{},v.root=u),v}function S(u,v,_,k,T,O){if(u.decorator){var L={};v=u.decorator(v,L,_,k&&k[0],T,O,k),r.extend(v,L)}return v}function w(u,v,_){v&&Object.keys(v).forEach(function(k){var T=v[k];u[k]=b(T,_)})}function b(u,v){var _=v.lookupProperty;return c.wrapHelper(u,function(k){return k.lookupProperty=_,k})}})),Hn=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var r=globalThis.Handlebars;s.noConflict=function(){return globalThis.Handlebars===s&&(globalThis.Handlebars=r),s}},t.exports=e.default})),Sc=fe(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}function r(f){if(f&&f.__esModule)return f;var l={};if(f!=null)for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(l[g]=f[g]);return l.default=f,l}var i=r(vi()),n=s(yc()),o=s(Lt()),c=r(lt()),d=r(_c()),h=s(Hn());function p(){var f=new i.HandlebarsEnvironment;return c.extend(f,i),f.SafeString=n.default,f.Exception=o.default,f.Utils=c,f.escapeExpression=c.escapeExpression,f.VM=d,f.template=function(l){return d.template(l,f)},f}var a=p();a.create=p,h.default(a),a.default=a,e.default=a,t.exports=e.default})),qn=fe(((e,t)=>{e.__esModule=!0;var s={helpers:{helperExpression:function(i){return i.type==="SubExpression"||(i.type==="MustacheStatement"||i.type==="BlockStatement")&&!!(i.params&&i.params.length||i.hash)},scopedId:function(i){return/^\\.|this\\b/.test(i.original)},simpleId:function(i){return i.parts.length===1&&!s.helpers.scopedId(i)&&!i.depth}}};e.default=s,t.exports=e.default})),wc=fe(((e,t)=>{e.__esModule=!0;var s=(function(){var r={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,c,d,h,p,a,f){var l=a.length-1;switch(p){case 1:return a[l-1];case 2:this.$=h.prepareProgram(a[l]);break;case 3:this.$=a[l];break;case 4:this.$=a[l];break;case 5:this.$=a[l];break;case 6:this.$=a[l];break;case 7:this.$=a[l];break;case 8:this.$=a[l];break;case 9:this.$={type:"CommentStatement",value:h.stripComment(a[l]),strip:h.stripFlags(a[l],a[l]),loc:h.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:a[l],value:a[l],loc:h.locInfo(this._$)};break;case 11:this.$=h.prepareRawBlock(a[l-2],a[l-1],a[l],this._$);break;case 12:this.$={path:a[l-3],params:a[l-2],hash:a[l-1]};break;case 13:this.$=h.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!1,this._$);break;case 14:this.$=h.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!0,this._$);break;case 15:this.$={open:a[l-5],path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 16:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 17:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 18:this.$={strip:h.stripFlags(a[l-1],a[l-1]),program:a[l]};break;case 19:var g=h.prepareBlock(a[l-2],a[l-1],a[l],a[l],!1,this._$),m=h.prepareProgram([g],a[l-1].loc);m.chained=!0,this.$={strip:a[l-2].strip,program:m,chain:!0};break;case 20:this.$=a[l];break;case 21:this.$={path:a[l-1],strip:h.stripFlags(a[l-2],a[l])};break;case 22:this.$=h.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],h.stripFlags(a[l-4],a[l]),this._$);break;case 23:this.$=h.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],h.stripFlags(a[l-4],a[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:a[l-3],params:a[l-2],hash:a[l-1],indent:"",strip:h.stripFlags(a[l-4],a[l]),loc:h.locInfo(this._$)};break;case 25:this.$=h.preparePartialBlock(a[l-2],a[l-1],a[l],this._$);break;case 26:this.$={path:a[l-3],params:a[l-2],hash:a[l-1],strip:h.stripFlags(a[l-4],a[l])};break;case 27:this.$=a[l];break;case 28:this.$=a[l];break;case 29:this.$={type:"SubExpression",path:a[l-3],params:a[l-2],hash:a[l-1],loc:h.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:a[l],loc:h.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:h.id(a[l-2]),value:a[l],loc:h.locInfo(this._$)};break;case 32:this.$=h.id(a[l-1]);break;case 33:this.$=a[l];break;case 34:this.$=a[l];break;case 35:this.$={type:"StringLiteral",value:a[l],original:a[l],loc:h.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(a[l]),original:Number(a[l]),loc:h.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:a[l]==="true",original:a[l]==="true",loc:h.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:h.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:h.locInfo(this._$)};break;case 40:this.$=a[l];break;case 41:this.$=a[l];break;case 42:this.$=h.preparePath(!0,a[l],this._$);break;case 43:this.$=h.preparePath(!1,a[l],this._$);break;case 44:a[l-2].push({part:h.id(a[l]),original:a[l],separator:a[l-1]}),this.$=a[l-2];break;case 45:this.$=[{part:h.id(a[l]),original:a[l]}];break;case 46:this.$=[];break;case 47:a[l-1].push(a[l]);break;case 48:this.$=[];break;case 49:a[l-1].push(a[l]);break;case 50:this.$=[];break;case 51:a[l-1].push(a[l]);break;case 58:this.$=[];break;case 59:a[l-1].push(a[l]);break;case 64:this.$=[];break;case 65:a[l-1].push(a[l]);break;case 70:this.$=[];break;case 71:a[l-1].push(a[l]);break;case 78:this.$=[];break;case 79:a[l-1].push(a[l]);break;case 82:this.$=[];break;case 83:a[l-1].push(a[l]);break;case 86:this.$=[];break;case 87:a[l-1].push(a[l]);break;case 90:this.$=[];break;case 91:a[l-1].push(a[l]);break;case 94:this.$=[];break;case 95:a[l-1].push(a[l]);break;case 98:this.$=[a[l]];break;case 99:a[l-1].push(a[l]);break;case 100:this.$=[a[l]];break;case 101:a[l-1].push(a[l])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,c){throw new Error(o)},parse:function(o){var c=this,d=[0],h=[null],p=[],a=this.table,f="",l=0,g=0,m=0;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;p.push(y);var S=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(){var z=c.lexer.lex()||1;return typeof z!="number"&&(z=c.symbols_[z]||z),z}for(var b,u,v,_,k,T={},O,L,R,I;;){if(v=d[d.length-1],this.defaultActions[v]?_=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=w()),_=a[v]&&a[v][b]),typeof _>"u"||!_.length||!_[0]){var q="";if(!m){I=[];for(O in a[v])this.terminals_[O]&&O>2&&I.push("\'"+this.terminals_[O]+"\'");this.lexer.showPosition?q="Parse error on line "+(l+1)+`:\n`+this.lexer.showPosition()+`\nExpecting `+I.join(", ")+", got \'"+(this.terminals_[b]||b)+"\'":q="Parse error on line "+(l+1)+": Unexpected "+(b==1?"end of input":"\'"+(this.terminals_[b]||b)+"\'"),this.parseError(q,{text:this.lexer.match,token:this.terminals_[b]||b,line:this.lexer.yylineno,loc:y,expected:I})}}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(_[0]){case 1:d.push(b),h.push(this.lexer.yytext),p.push(this.lexer.yylloc),d.push(_[1]),b=null,u?(b=u,u=null):(g=this.lexer.yyleng,f=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,m>0&&m--);break;case 2:if(L=this.productions_[_[1]][1],T.$=h[h.length-L],T._$={first_line:p[p.length-(L||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(L||1)].first_column,last_column:p[p.length-1].last_column},S&&(T._$.range=[p[p.length-(L||1)].range[0],p[p.length-1].range[1]]),k=this.performAction.call(T,f,g,l,this.yy,_[1],h,p),typeof k<"u")return k;L&&(d=d.slice(0,-1*L*2),h=h.slice(0,-1*L),p=p.slice(0,-1*L)),d.push(this.productions_[_[1]][0]),h.push(T.$),p.push(T._$),R=a[d[d.length-2]][d[d.length-1]],d.push(R);break;case 3:return!0}}return!0}};r.lexer=(function(){var n={EOF:1,parseError:function(c,d){if(this.yy.parser)this.yy.parser.parseError(c,d);else throw new Error(c)},setInput:function(c){return this._input=c,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var c=this._input[0];return this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c,c.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},unput:function(c){var d=c.length,h=c.split(/(?:\\r\\n?|\\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d-1),this.offset-=d;var p=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===p.length?this.yylloc.first_column:0)+p[p.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-d]),this},more:function(){return this._more=!0,this},less:function(c){this.unput(this.match.slice(c))},pastInput:function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\\n/g,"")},upcomingInput:function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\\n/g,"")},showPosition:function(){var c=this.pastInput(),d=new Array(c.length+1).join("-");return c+this.upcomingInput()+`\n`+d+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,d,h,p,a;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),l=0;l<f.length&&(h=this._input.match(this.rules[f[l]]),!(h&&(!d||h[0].length>d[0].length)&&(d=h,p=l,!this.options.flex)));l++);return d?(a=d[0].match(/(?:\\r\\n?|\\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],c=this.performAction.call(this,this.yy,this,f[p],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.\n`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var c=this.next();return typeof c<"u"?c:this.lex()},begin:function(c){this.conditionStack.push(c)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(c){this.begin(c)}};return n.options={},n.performAction=function(c,d,h,p){function a(f,l){return d.yytext=d.yytext.substring(f,d.yyleng-l+f)}switch(h){case 0:if(d.yytext.slice(-2)==="\\\\\\\\"?(a(0,1),this.begin("mu")):d.yytext.slice(-1)==="\\\\"?(a(0,1),this.begin("emu")):this.begin("mu"),d.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(a(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(d.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return d.yytext=a(1,2).replace(/\\\\"/g,\'"\'),80;case 32:return d.yytext=a(1,2).replace(/\\\\\'/g,"\'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return d.yytext=d.yytext.replace(/\\\\([\\\\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{|\\\\\\{\\{|\\\\\\\\\\{\\{|$)))/,/^(?:\\{\\{\\{\\{(?=[^\\/]))/,/^(?:\\{\\{\\{\\{\\/[^\\s!"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=[=}\\s\\/.])\\}\\}\\}\\})/,/^(?:[^\\x00]+?(?=(\\{\\{\\{\\{)))/,/^(?:[\\s\\S]*?--(~)?\\}\\})/,/^(?:\\()/,/^(?:\\))/,/^(?:\\{\\{\\{\\{)/,/^(?:\\}\\}\\}\\})/,/^(?:\\{\\{(~)?>)/,/^(?:\\{\\{(~)?#>)/,/^(?:\\{\\{(~)?#\\*?)/,/^(?:\\{\\{(~)?\\/)/,/^(?:\\{\\{(~)?\\^\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\s*else\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\^)/,/^(?:\\{\\{(~)?\\s*else\\b)/,/^(?:\\{\\{(~)?\\{)/,/^(?:\\{\\{(~)?&)/,/^(?:\\{\\{(~)?!--)/,/^(?:\\{\\{(~)?![\\s\\S]*?\\}\\})/,/^(?:\\{\\{(~)?\\*?)/,/^(?:=)/,/^(?:\\.\\.)/,/^(?:\\.(?=([=~}\\s\\/.)|])))/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}(~)?\\}\\})/,/^(?:(~)?\\}\\})/,/^(?:"(\\\\["]|[^"])*")/,/^(?:\'(\\\\[\']|[^\'])*\')/,/^(?:@)/,/^(?:true(?=([~}\\s)])))/,/^(?:false(?=([~}\\s)])))/,/^(?:undefined(?=([~}\\s)])))/,/^(?:null(?=([~}\\s)])))/,/^(?:-?[0-9]+(?:\\.[0-9]+)?(?=([~}\\s)])))/,/^(?:as\\s+\\|)/,/^(?:\\|)/,/^(?:([^\\s!"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=([=~}\\s\\/.)|]))))/,/^(?:\\[(\\\\\\]|[^\\]])*\\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();function i(){this.yy={}}return i.prototype=r,r.Parser=i,new i})();e.default=s,t.exports=e.default})),Fn=fe((e=>{e.__esModule=!0;var t=["Program","BlockStatement","DecoratorBlock","PartialStatement","PartialBlockStatement","Decorator","MustacheStatement","ContentStatement","CommentStatement","SubExpression","PathExpression","StringLiteral","NumberLiteral","BooleanLiteral","UndefinedLiteral","NullLiteral","Hash","HashPair"];e.NODE_TYPES=t})),Vn=fe(((e,t)=>{e.__esModule=!0;function s(a){return a&&a.__esModule?a:{default:a}}var r=s(Lt()),i=lt(),n=Fn();function o(){this.parents=[]}function c(a,f){return i.indexOf(n.NODE_TYPES,f)!==-1||!(f in o.prototype)&&typeof a[f]=="function"}o.prototype={constructor:o,mutating:!1,acceptKey:function(f,l){var g=this.accept(f[l]);if(this.mutating){if(g&&!c(this,g.type))throw new r.default(\'Unexpected node type "\'+g.type+\'" found when accepting \'+l+" on "+f.type);f[l]=g}},acceptRequired:function(f,l){if(this.acceptKey(f,l),!f[l])throw new r.default(f.type+" requires "+l)},acceptArray:function(f){for(var l=0,g=f.length;l<g;l++)this.acceptKey(f,l),f[l]||(f.splice(l,1),l--,g--)},accept:function(f){if(f){if(!c(this,f.type)||!this[f.type])throw new r.default("Unknown type: "+f.type,f);this.current&&this.parents.unshift(this.current),this.current=f;var l=this[f.type](f);if(this.current=this.parents.shift(),!this.mutating||l)return l;if(l!==!1)return f}},Program:function(f){this.acceptArray(f.body)},MustacheStatement:d,Decorator:d,BlockStatement:h,DecoratorBlock:h,PartialStatement:p,PartialBlockStatement:function(f){p.call(this,f),this.acceptKey(f,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:d,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(f){this.acceptArray(f.pairs)},HashPair:function(f){this.acceptRequired(f,"value")}};function d(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function h(a){d.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function p(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}e.default=o,t.exports=e.default})),kc=fe(((e,t)=>{e.__esModule=!0;function s(h){return h&&h.__esModule?h:{default:h}}var r=s(Vn());function i(){var h=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=h}i.prototype=new r.default,i.prototype.Program=function(h){var p=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var f=h.body,l=0,g=f.length;l<g;l++){var m=f[l],y=this.accept(m);if(y){var S=n(f,l,a),w=o(f,l,a),b=y.openStandalone&&S,u=y.closeStandalone&&w,v=y.inlineStandalone&&S&&w;y.close&&c(f,l,!0),y.open&&d(f,l,!0),p&&v&&(c(f,l),d(f,l)&&m.type==="PartialStatement"&&(m.indent=/(?:^|[^ \\t])([ \\t]+)$/.exec(f[l-1].original)[1])),p&&b&&(c((m.program||m.inverse).body),d(f,l)),p&&u&&(c(f,l),d((m.inverse||m.program).body))}}return h},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(h){this.accept(h.program),this.accept(h.inverse);var p=h.program||h.inverse,a=h.program&&h.inverse,f=a,l=a;if(a&&a.chained)for(f=a.body[0].program;l.chained;)l=l.body[l.body.length-1].program;var g={open:h.openStrip.open,close:h.closeStrip.close,openStandalone:o(p.body),closeStandalone:n((f||p).body)};if(h.openStrip.close&&c(p.body,null,!0),a){var m=h.inverseStrip;m.open&&d(p.body,null,!0),m.close&&c(f.body,null,!0),h.closeStrip.open&&d(l.body,null,!0),!this.options.ignoreStandalone&&n(p.body)&&o(f.body)&&(d(p.body),c(f.body))}else h.closeStrip.open&&d(p.body,null,!0);return g},i.prototype.Decorator=i.prototype.MustacheStatement=function(h){return h.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(h){var p=h.strip||{};return{inlineStandalone:!0,open:p.open,close:p.close}};function n(h,p,a){p===void 0&&(p=h.length);var f=h[p-1],l=h[p-2];if(!f)return a;if(f.type==="ContentStatement")return(l||!a?/(?:^|\\S)[^\\S\\n]*\\n\\s*$/:/^\\s*$|(?:^|\\S)[^\\S\\n]*\\n\\s*$/).test(f.original)}function o(h,p,a){p===void 0&&(p=-1);var f=h[p+1],l=h[p+2];if(!f)return a;if(f.type==="ContentStatement")return(l||!a?/^\\s*?\\r?\\n/:/^\\s*?(\\r?\\n|$)/).test(f.original)}function c(h,p,a){var f=h[p==null?0:p+1];if(!(!f||f.type!=="ContentStatement"||!a&&f.rightStripped)){var l=f.value;f.value=f.value.replace(a?/^\\s+/:/^[ \\t]*\\r?\\n?/,""),f.rightStripped=f.value!==l}}function d(h,p,a){var f=h[p==null?h.length-1:p-1];if(!(!f||f.type!=="ContentStatement"||!a&&f.leftStripped)){var l=f.value;return f.value=f.value.replace(a?/(^|\\S)\\s+$/:/(^|[^ \\t])[ \\t]+$/,"$1"),f.leftStripped=f.value!==l,f.leftStripped}}e.default=i,t.exports=e.default})),xc=fe((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=n,e.stripFlags=o,e.stripComment=c,e.preparePath=d,e.prepareMustache=h,e.prepareRawBlock=p,e.prepareBlock=a,e.prepareProgram=f,e.preparePartialBlock=l;function t(g){return g&&g.__esModule?g:{default:g}}var s=t(Lt());function r(g,m){if(m=m.path?m.path.original:m,g.path.original!==m){var y={loc:g.path.loc};throw new s.default(g.path.original+" doesn\'t match "+m,y)}}function i(g,m){this.source=g,this.start={line:m.first_line,column:m.first_column},this.end={line:m.last_line,column:m.last_column}}function n(g){return/^\\[.*\\]$/.test(g)?g.substring(1,g.length-1):g}function o(g,m){return{open:g.charAt(2)==="~",close:m.charAt(m.length-3)==="~"}}function c(g){return g.replace(/^\\{\\{~?!-?-?/,"").replace(/-?-?~?\\}\\}$/,"")}function d(g,m,y){y=this.locInfo(y);for(var S=g?"@":"",w=[],b=0,u=0,v=m.length;u<v;u++){var _=m[u].part,k=m[u].original!==_;if(S+=(m[u].separator||"")+_,!k&&(_===".."||_==="."||_==="this")){if(w.length>0)throw new s.default("Invalid path: "+S,{loc:y});_===".."&&b++}else w.push(_)}return{type:"PathExpression",data:g,depth:b,parts:w,original:S,loc:y}}function h(g,m,y,S,w,b){var u=S.charAt(3)||S.charAt(2),v=u!=="{"&&u!=="&";return{type:/\\*/.test(S)?"Decorator":"MustacheStatement",path:g,params:m,hash:y,escaped:v,strip:w,loc:this.locInfo(b)}}function p(g,m,y,S){r(g,y),S=this.locInfo(S);var w={type:"Program",body:m,strip:{},loc:S};return{type:"BlockStatement",path:g.path,params:g.params,hash:g.hash,program:w,openStrip:{},inverseStrip:{},closeStrip:{},loc:S}}function a(g,m,y,S,w,b){S&&S.path&&r(g,S);var u=/\\*/.test(g.open);m.blockParams=g.blockParams;var v=void 0,_=void 0;if(y){if(u)throw new s.default("Unexpected inverse block on decorator",y);y.chain&&(y.program.body[0].closeStrip=S.strip),_=y.strip,v=y.program}return w&&(w=v,v=m,m=w),{type:u?"DecoratorBlock":"BlockStatement",path:g.path,params:g.params,hash:g.hash,program:m,inverse:v,openStrip:g.strip,inverseStrip:_,closeStrip:S&&S.strip,loc:this.locInfo(b)}}function f(g,m){if(!m&&g.length){var y=g[0].loc,S=g[g.length-1].loc;y&&S&&(m={source:y.source,start:{line:y.start.line,column:y.start.column},end:{line:S.end.line,column:S.end.column}})}return{type:"Program",body:g,strip:{},loc:m}}function l(g,m,y,S){return r(g,y),{type:"PartialBlockStatement",name:g.path,params:g.params,hash:g.hash,program:m,openStrip:g.strip,closeStrip:y&&y.strip,loc:this.locInfo(S)}}})),Tc=fe((e=>{e.__esModule=!0,e.parseWithoutProcessing=d,e.parse=h;function t(p){if(p&&p.__esModule)return p;var a={};if(p!=null)for(var f in p)Object.prototype.hasOwnProperty.call(p,f)&&(a[f]=p[f]);return a.default=p,a}function s(p){return p&&p.__esModule?p:{default:p}}var r=s(wc()),i=s(kc()),n=t(xc()),o=lt();e.parser=r.default;var c={};o.extend(c,n);function d(p,a){return p.type==="Program"?p:(r.default.yy=c,c.locInfo=function(f){return new c.SourceLocation(a&&a.srcName,f)},r.default.parse(p))}function h(p,a){var f=d(p,a);return new i.default(a).accept(f)}})),Cc=fe((e=>{e.__esModule=!0,e.Compiler=c,e.precompile=d,e.compile=h;function t(w){return w&&w.__esModule?w:{default:w}}var s=t(Lt()),r=lt(),i=t(qn()),n=Fn(),o=[].slice;function c(){}c.prototype={compiler:c,equals:function(b){var u=this.opcodes.length;if(b.opcodes.length!==u)return!1;for(var v=0;v<u;v++){var _=this.opcodes[v],k=b.opcodes[v];if(_.opcode!==k.opcode||!y(_.args,k.args))return!1}u=this.children.length;for(var v=0;v<u;v++)if(!this.children[v].equals(b.children[v]))return!1;return!0},guid:0,compile:function(b,u){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=u,this.stringParams=u.stringParams,this.trackIds=u.trackIds,u.blockParams=u.blockParams||[],u.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},u.knownHelpers),this.accept(b)},compileProgram:function(b){var u=new this.compiler().compile(b,this.options),v=this.guid++;return this.usePartial=this.usePartial||u.usePartial,this.children[v]=u,this.useDepths=this.useDepths||u.useDepths,v},accept:function(b){if(r.indexOf(n.NODE_TYPES,b.type)===-1||!this[b.type])throw new s.default("Unknown type: "+b.type,b);this.sourceNode.unshift(b);var u=this[b.type](b);return this.sourceNode.shift(),u},Program:function(b){m(b),this.options.blockParams.unshift(b.blockParams);for(var u=b.body,v=u.length,_=0;_<v;_++)this.accept(u[_]);return this.options.blockParams.shift(),this.isSimple=v===1,this.blockParams=b.blockParams?b.blockParams.length:0,this},BlockStatement:function(b){S(b);var u=b.program,v=b.inverse;u=u&&this.compileProgram(u),v=v&&this.compileProgram(v);var _=this.classifySexpr(b);_==="helper"?this.helperSexpr(b,u,v):_==="simple"?(this.simpleSexpr(b),this.opcode("pushProgram",u),this.opcode("pushProgram",v),this.opcode("emptyHash"),this.opcode("blockValue",b.path.original)):(this.ambiguousSexpr(b,u,v),this.opcode("pushProgram",u),this.opcode("pushProgram",v),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(b){var u=b.program&&this.compileProgram(b.program),v=this.setupFullMustacheParams(b,u,void 0),_=b.path;this.useDecorators=!0,this.opcode("registerDecorator",v.length,_.original)},PartialStatement:function(b){this.usePartial=!0;var u=b.program;u&&(u=this.compileProgram(b.program));var v=b.params;if(v.length>1)throw new s.default("Unsupported number of partial arguments: "+v.length,b);v.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):v.push({type:"PathExpression",parts:[],depth:0}));var _=b.name.original,k=b.name.type==="SubExpression";k&&this.accept(b.name),this.setupFullMustacheParams(b,u,void 0,!0);var T=b.indent||"";this.options.preventIndent&&T&&(this.opcode("appendContent",T),T=""),this.opcode("invokePartial",k,_,T),this.opcode("append")},PartialBlockStatement:function(b){this.PartialStatement(b)},MustacheStatement:function(b){this.SubExpression(b),b.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(b){this.DecoratorBlock(b)},ContentStatement:function(b){if(b.value!=null&&typeof b.value!="string")throw p(b,"value must be a string");b.value&&this.opcode("appendContent",b.value)},CommentStatement:function(){},SubExpression:function(b){S(b);var u=this.classifySexpr(b);u==="simple"?this.simpleSexpr(b):u==="helper"?this.helperSexpr(b):this.ambiguousSexpr(b)},ambiguousSexpr:function(b,u,v){var _=b.path,k=_.parts[0],T=u!=null||v!=null;this.opcode("getContext",a(_)),this.opcode("pushProgram",u),this.opcode("pushProgram",v),_.strict=!0,this.accept(_),this.opcode("invokeAmbiguous",k,T)},simpleSexpr:function(b){var u=b.path;u.strict=!0,this.accept(u),this.opcode("resolvePossibleLambda")},helperSexpr:function(b,u,v){var _=this.setupFullMustacheParams(b,u,v),k=b.path,T=k.parts[0];if(this.options.knownHelpers[T])this.opcode("invokeKnownHelper",_.length,T);else{if(this.options.knownHelpersOnly)throw new s.default("You specified knownHelpersOnly, but used the unknown helper "+T,b);k.strict=!0,k.falsy=!0,this.accept(k),this.opcode("invokeHelper",_.length,k.original,i.default.helpers.simpleId(k))}},PathExpression:function(b){var u=a(b),v=g(b);this.addDepth(u),this.opcode("getContext",u);var _=v[0],k=i.default.helpers.scopedId(b),T=!u&&!k&&this.blockParamIndex(_);T?this.opcode("lookupBlockParam",T,v):_?b.data?(this.options.data=!0,this.opcode("lookupData",u,v,b.strict)):this.opcode("lookupOnContext",v,b.falsy,b.strict,k):this.opcode("pushContext")},StringLiteral:function(b){f(b),this.opcode("pushString",b.value)},NumberLiteral:function(b){f(b),this.opcode("pushLiteral",b.value)},BooleanLiteral:function(b){f(b),this.opcode("pushLiteral",b.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(b){var u=b.pairs,v=0,_=void 0;if(!r.isArray(u))throw p(b,"pairs must be an array");_=u.length;for(var k=0;k<_;k++)if(!u[k]||typeof u[k].key!="string")throw p(b,"pair keys must be strings");for(this.opcode("pushHash");v<_;v++)this.pushParam(u[v].value);for(;v--;)this.opcode("assignToHash",u[v].key);this.opcode("popHash")},opcode:function(b){this.opcodes.push({opcode:b,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(b){b&&(this.useDepths=!0)},classifySexpr:function(b){g(b.path);var u=i.default.helpers.simpleId(b.path),v=u&&!!this.blockParamIndex(b.path.parts[0]),_=!v&&i.default.helpers.helperExpression(b),k=!v&&(_||u);if(k&&!_){var T=b.path.parts[0],O=this.options;O.knownHelpers[T]?_=!0:O.knownHelpersOnly&&(k=!1)}return _?"helper":k?"ambiguous":"simple"},pushParams:function(b){for(var u=0,v=b.length;u<v;u++)this.pushParam(b[u])},pushParam:function(b){f(b);var u=b.value!=null?b.value:b.original||"",v=a(b);if(this.stringParams)typeof u!="number"&&typeof u!="boolean"&&(u=String(u)),u.replace&&(u=u.replace(/^(\\.?\\.\\/)*/g,"").replace(/\\//g,".")),v&&this.addDepth(v),this.opcode("getContext",v),this.opcode("pushStringParam",u,b.type),b.type==="SubExpression"&&this.accept(b);else{if(this.trackIds){var _=void 0;if(b.parts&&!i.default.helpers.scopedId(b)&&!v&&(_=this.blockParamIndex(g(b)[0])),_){var k=b.parts.slice(1).join(".");this.opcode("pushId","BlockParam",_,k)}else u=b.original||u,u.replace&&(u=u.replace(/^this(?:\\.|$)/,"").replace(/^\\.\\//,"").replace(/^\\.$/,"")),this.opcode("pushId",b.type,u)}this.accept(b)}},setupFullMustacheParams:function(b,u,v,_){var k=b.params;return this.pushParams(k),this.opcode("pushProgram",u),this.opcode("pushProgram",v),b.hash?this.accept(b.hash):this.opcode("emptyHash",_),k},blockParamIndex:function(b){for(var u=0,v=this.options.blockParams.length;u<v;u++){var _=this.options.blockParams[u],k=_&&r.indexOf(_,b);if(_&&k>=0)return[u,k]}}};function d(w,b,u){if(w==null||typeof w!="string"&&w.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+w);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var v=u.parse(w,b),_=new u.Compiler().compile(v,b);return new u.JavaScriptCompiler().compile(_,b)}function h(w,b,u){if(b===void 0&&(b={}),w==null||typeof w!="string"&&w.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+w);b=r.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var v=void 0;function _(){var T=u.parse(w,b),O=new u.Compiler().compile(T,b),L=new u.JavaScriptCompiler().compile(O,b,void 0,!0);return u.template(L)}function k(T,O){return v||(v=_()),v.call(this,T,O)}return k._setup=function(T){return v||(v=_()),v._setup(T)},k._child=function(T,O,L,R){return v||(v=_()),v._child(T,O,L,R)},k}function p(w,b){return new s.default("Invalid AST: "+w.type+" "+b,w)}function a(w){var b=w.depth;if(b==null)return 0;if(typeof b!="number"||!isFinite(b)||Math.floor(b)!==b||b<0)throw p(w,"depth must be a non-negative integer");return b}function f(w){var b=w.value;if(w.type==="StringLiteral"&&typeof b!="string")throw p(w,"value must be a string");if(w.type==="NumberLiteral"&&typeof b!="number")throw p(w,"value must be a number");if(w.type==="BooleanLiteral"&&typeof b!="boolean")throw p(w,"value must be a boolean")}function l(w,b,u){if(!r.isArray(b))throw p(w,u+" must be an array");for(var v=0;v<b.length;v++)if(typeof b[v]!="string")throw p(w,u+" must only contain strings");return b}function g(w){return l(w,w.parts,"parts")}function m(w){w.blockParams!=null&&l(w,w.blockParams,"blockParams")}function y(w,b){if(w===b)return!0;if(r.isArray(w)&&r.isArray(b)&&w.length===b.length){for(var u=0;u<w.length;u++)if(!y(w[u],b[u]))return!1;return!0}}function S(w){if(!w.path.parts){var b=w.path;w.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}})),Ac=fe((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(s){if(0<=s&&s<t.length)return t[s];throw new TypeError("Must be between 0 and 63: "+s)},e.decode=function(s){var r=65,i=90,n=97,o=122,c=48,d=57,h=43,p=47,a=26,f=52;return r<=s&&s<=i?s-r:n<=s&&s<=o?s-n+a:c<=s&&s<=d?s-c+f:s==h?62:s==p?63:-1}})),zn=fe((e=>{var t=Ac(),s=5,r=1<<s,i=r-1,n=r;function o(d){return d<0?(-d<<1)+1:(d<<1)+0}function c(d){var h=(d&1)===1,p=d>>1;return h?-p:p}e.encode=function(h){var p="",a,f=o(h);do a=f&i,f>>>=s,f>0&&(a|=n),p+=t.encode(a);while(f>0);return p},e.decode=function(h,p,a){var f=h.length,l=0,g=0,m,y;do{if(p>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(y=t.decode(h.charCodeAt(p++)),y===-1)throw new Error("Invalid base64 digit: "+h.charAt(p-1));m=!!(y&n),y&=i,l=l+(y<<g),g+=s}while(m);a.value=c(l),a.rest=p}})),Ws=fe((e=>{function t(u,v,_){if(v in u)return u[v];if(arguments.length===3)return _;throw new Error(\'"\'+v+\'" is a required argument.\')}e.getArg=t;var s=/^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/,r=/^data:.+\\,.+$/;function i(u){var v=u.match(s);return v?{scheme:v[1],auth:v[2],host:v[3],port:v[4],path:v[5]}:null}e.urlParse=i;function n(u){var v="";return u.scheme&&(v+=u.scheme+":"),v+="//",u.auth&&(v+=u.auth+"@"),u.host&&(v+=u.host),u.port&&(v+=":"+u.port),u.path&&(v+=u.path),v}e.urlGenerate=n;function o(u){var v=u,_=i(u);if(_){if(!_.path)return u;v=_.path}for(var k=e.isAbsolute(v),T=v.split(/\\/+/),O,L=0,R=T.length-1;R>=0;R--)O=T[R],O==="."?T.splice(R,1):O===".."?L++:L>0&&(O===""?(T.splice(R+1,L),L=0):(T.splice(R,2),L--));return v=T.join("/"),v===""&&(v=k?"/":"."),_?(_.path=v,n(_)):v}e.normalize=o;function c(u,v){u===""&&(u="."),v===""&&(v=".");var _=i(v),k=i(u);if(k&&(u=k.path||"/"),_&&!_.scheme)return k&&(_.scheme=k.scheme),n(_);if(_||v.match(r))return v;if(k&&!k.host&&!k.path)return k.host=v,n(k);var T=v.charAt(0)==="/"?v:o(u.replace(/\\/+$/,"")+"/"+v);return k?(k.path=T,n(k)):T}e.join=c,e.isAbsolute=function(u){return u.charAt(0)==="/"||s.test(u)};function d(u,v){u===""&&(u="."),u=u.replace(/\\/$/,"");for(var _=0;v.indexOf(u+"/")!==0;){var k=u.lastIndexOf("/");if(k<0||(u=u.slice(0,k),u.match(/^([^\\/]+:\\/)?\\/*$/)))return v;++_}return Array(_+1).join("../")+v.substr(u.length+1)}e.relative=d;var h=(function(){return!("__proto__"in Object.create(null))})();function p(u){return u}function a(u){return l(u)?"$"+u:u}e.toSetString=h?p:a;function f(u){return l(u)?u.slice(1):u}e.fromSetString=h?p:f;function l(u){if(!u)return!1;var v=u.length;if(v<9||u.charCodeAt(v-1)!==95||u.charCodeAt(v-2)!==95||u.charCodeAt(v-3)!==111||u.charCodeAt(v-4)!==116||u.charCodeAt(v-5)!==111||u.charCodeAt(v-6)!==114||u.charCodeAt(v-7)!==112||u.charCodeAt(v-8)!==95||u.charCodeAt(v-9)!==95)return!1;for(var _=v-10;_>=0;_--)if(u.charCodeAt(_)!==36)return!1;return!0}function g(u,v,_){var k=y(u.source,v.source);return k!==0||(k=u.originalLine-v.originalLine,k!==0)||(k=u.originalColumn-v.originalColumn,k!==0||_)||(k=u.generatedColumn-v.generatedColumn,k!==0)||(k=u.generatedLine-v.generatedLine,k!==0)?k:y(u.name,v.name)}e.compareByOriginalPositions=g;function m(u,v,_){var k=u.generatedLine-v.generatedLine;return k!==0||(k=u.generatedColumn-v.generatedColumn,k!==0||_)||(k=y(u.source,v.source),k!==0)||(k=u.originalLine-v.originalLine,k!==0)||(k=u.originalColumn-v.originalColumn,k!==0)?k:y(u.name,v.name)}e.compareByGeneratedPositionsDeflated=m;function y(u,v){return u===v?0:u===null?1:v===null?-1:u>v?1:-1}function S(u,v){var _=u.generatedLine-v.generatedLine;return _!==0||(_=u.generatedColumn-v.generatedColumn,_!==0)||(_=y(u.source,v.source),_!==0)||(_=u.originalLine-v.originalLine,_!==0)||(_=u.originalColumn-v.originalColumn,_!==0)?_:y(u.name,v.name)}e.compareByGeneratedPositionsInflated=S;function w(u){return JSON.parse(u.replace(/^\\)]}\'[^\\n]*\\n/,""))}e.parseSourceMapInput=w;function b(u,v,_){if(v=v||"",u&&(u[u.length-1]!=="/"&&v[0]!=="/"&&(u+="/"),v=u+v),_){var k=i(_);if(!k)throw new Error("sourceMapURL could not be parsed");if(k.path){var T=k.path.lastIndexOf("/");T>=0&&(k.path=k.path.substring(0,T+1))}v=c(n(k),v)}return o(v)}e.computeSourceURL=b})),Un=fe((e=>{var t=Ws(),s=Object.prototype.hasOwnProperty,r=typeof Map<"u";function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(o,c){for(var d=new i,h=0,p=o.length;h<p;h++)d.add(o[h],c);return d},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(o,c){var d=r?o:t.toSetString(o),h=r?this.has(o):s.call(this._set,d),p=this._array.length;(!h||c)&&this._array.push(o),h||(r?this._set.set(o,p):this._set[d]=p)},i.prototype.has=function(o){if(r)return this._set.has(o);var c=t.toSetString(o);return s.call(this._set,c)},i.prototype.indexOf=function(o){if(r){var c=this._set.get(o);if(c>=0)return c}else{var d=t.toSetString(o);if(s.call(this._set,d))return this._set[d]}throw new Error(\'"\'+o+\'" is not in the set.\')},i.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),Ec=fe((e=>{var t=Ws();function s(i,n){var o=i.generatedLine,c=n.generatedLine,d=i.generatedColumn,h=n.generatedColumn;return c>o||c==o&&h>=d||t.compareByGeneratedPositionsInflated(i,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(n,o){this._array.forEach(n,o)},r.prototype.add=function(n){s(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),Wn=fe((e=>{var t=zn(),s=Ws(),r=Un().ArraySet,i=Ec().MappingList;function n(o){o||(o={}),this._file=s.getArg(o,"file",null),this._sourceRoot=s.getArg(o,"sourceRoot",null),this._skipValidation=s.getArg(o,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(c){var d=c.sourceRoot,h=new n({file:c.file,sourceRoot:d});return c.eachMapping(function(p){var a={generated:{line:p.generatedLine,column:p.generatedColumn}};p.source!=null&&(a.source=p.source,d!=null&&(a.source=s.relative(d,a.source)),a.original={line:p.originalLine,column:p.originalColumn},p.name!=null&&(a.name=p.name)),h.addMapping(a)}),c.sources.forEach(function(p){var a=p;d!==null&&(a=s.relative(d,p)),h._sources.has(a)||h._sources.add(a);var f=c.sourceContentFor(p);f!=null&&h.setSourceContent(p,f)}),h},n.prototype.addMapping=function(c){var d=s.getArg(c,"generated"),h=s.getArg(c,"original",null),p=s.getArg(c,"source",null),a=s.getArg(c,"name",null);this._skipValidation||this._validateMapping(d,h,p,a),p!=null&&(p=String(p),this._sources.has(p)||this._sources.add(p)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:d.line,generatedColumn:d.column,originalLine:h!=null&&h.line,originalColumn:h!=null&&h.column,source:p,name:a})},n.prototype.setSourceContent=function(c,d){var h=c;this._sourceRoot!=null&&(h=s.relative(this._sourceRoot,h)),d!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(h)]=d):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(h)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(c,d,h){var p=d;if(d==null){if(c.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.`);p=c.file}var a=this._sourceRoot;a!=null&&(p=s.relative(a,p));var f=new r,l=new r;this._mappings.unsortedForEach(function(g){if(g.source===p&&g.originalLine!=null){var m=c.originalPositionFor({line:g.originalLine,column:g.originalColumn});m.source!=null&&(g.source=m.source,h!=null&&(g.source=s.join(h,g.source)),a!=null&&(g.source=s.relative(a,g.source)),g.originalLine=m.line,g.originalColumn=m.column,m.name!=null&&(g.name=m.name))}var y=g.source;y!=null&&!f.has(y)&&f.add(y);var S=g.name;S!=null&&!l.has(S)&&l.add(S)},this),this._sources=f,this._names=l,c.sources.forEach(function(g){var m=c.sourceContentFor(g);m!=null&&(h!=null&&(g=s.join(h,g)),a!=null&&(g=s.relative(a,g)),this.setSourceContent(g,m))},this)},n.prototype._validateMapping=function(c,d,h,p){if(d&&typeof d.line!="number"&&typeof d.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(c&&"line"in c&&"column"in c&&c.line>0&&c.column>=0&&!d&&!h&&!p)){if(c&&"line"in c&&"column"in c&&d&&"line"in d&&"column"in d&&c.line>0&&c.column>=0&&d.line>0&&d.column>=0&&h)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:c,source:h,original:d,name:p}))}},n.prototype._serializeMappings=function(){for(var c=0,d=1,h=0,p=0,a=0,f=0,l="",g,m,y,S,w=this._mappings.toArray(),b=0,u=w.length;b<u;b++){if(m=w[b],g="",m.generatedLine!==d)for(c=0;m.generatedLine!==d;)g+=";",d++;else if(b>0){if(!s.compareByGeneratedPositionsInflated(m,w[b-1]))continue;g+=","}g+=t.encode(m.generatedColumn-c),c=m.generatedColumn,m.source!=null&&(S=this._sources.indexOf(m.source),g+=t.encode(S-f),f=S,g+=t.encode(m.originalLine-1-p),p=m.originalLine-1,g+=t.encode(m.originalColumn-h),h=m.originalColumn,m.name!=null&&(y=this._names.indexOf(m.name),g+=t.encode(y-a),a=y)),l+=g}return l},n.prototype._generateSourcesContent=function(c,d){return c.map(function(h){if(!this._sourcesContents)return null;d!=null&&(h=s.relative(d,h));var p=s.toSetString(h);return Object.prototype.hasOwnProperty.call(this._sourcesContents,p)?this._sourcesContents[p]:null},this)},n.prototype.toJSON=function(){var c={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(c.file=this._file),this._sourceRoot!=null&&(c.sourceRoot=this._sourceRoot),this._sourcesContents&&(c.sourcesContent=this._generateSourcesContent(c.sources,c.sourceRoot)),c},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=n})),Pc=fe((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(s,r,i,n,o,c){var d=Math.floor((r-s)/2)+s,h=o(i,n[d],!0);return h===0?d:h>0?r-d>1?t(d,r,i,n,o,c):c==e.LEAST_UPPER_BOUND?r<n.length?r:-1:d:d-s>1?t(s,d,i,n,o,c):c==e.LEAST_UPPER_BOUND?d:s<0?-1:s}e.search=function(r,i,n,o){if(i.length===0)return-1;var c=t(-1,i.length,r,i,n,o||e.GREATEST_LOWER_BOUND);if(c<0)return-1;for(;c-1>=0&&n(i[c],i[c-1],!0)===0;)--c;return c}})),Lc=fe((e=>{function t(i,n,o){var c=i[n];i[n]=i[o],i[o]=c}function s(i,n){return Math.round(i+Math.random()*(n-i))}function r(i,n,o,c){if(o<c){var d=s(o,c),h=o-1;t(i,d,c);for(var p=i[c],a=o;a<c;a++)n(i[a],p)<=0&&(h+=1,t(i,h,a));t(i,h+1,a);var f=h+1;r(i,n,o,f-1),r(i,n,f+1,c)}}e.quickSort=function(i,n){r(i,n,0,i.length-1)}})),Ic=fe((e=>{var t=Ws(),s=Pc(),r=Un().ArraySet,i=zn(),n=Lc().quickSort;function o(p,a){var f=p;return typeof p=="string"&&(f=t.parseSourceMapInput(p)),f.sections!=null?new h(f,a):new c(f,a)}o.fromSourceMap=function(p,a){return c.fromSourceMap(p,a)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,f){var l=a.charAt(f);return l===";"||l===","},o.prototype._parseMappings=function(a,f){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,f,l){var g=f||null,m=l||o.GENERATED_ORDER,y;switch(m){case o.GENERATED_ORDER:y=this._generatedMappings;break;case o.ORIGINAL_ORDER:y=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var S=this.sourceRoot;y.map(function(w){var b=w.source===null?null:this._sources.at(w.source);return b=t.computeSourceURL(S,b,this._sourceMapURL),{source:b,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(a,g)},o.prototype.allGeneratedPositionsFor=function(a){var f=t.getArg(a,"line"),l={source:t.getArg(a,"source"),originalLine:f,originalColumn:t.getArg(a,"column",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var g=[],m=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(m>=0){var y=this._originalMappings[m];if(a.column===void 0)for(var S=y.originalLine;y&&y.originalLine===S;)g.push({line:t.getArg(y,"generatedLine",null),column:t.getArg(y,"generatedColumn",null),lastColumn:t.getArg(y,"lastGeneratedColumn",null)}),y=this._originalMappings[++m];else for(var w=y.originalColumn;y&&y.originalLine===f&&y.originalColumn==w;)g.push({line:t.getArg(y,"generatedLine",null),column:t.getArg(y,"generatedColumn",null),lastColumn:t.getArg(y,"lastGeneratedColumn",null)}),y=this._originalMappings[++m]}return g},e.SourceMapConsumer=o;function c(p,a){var f=p;typeof p=="string"&&(f=t.parseSourceMapInput(p));var l=t.getArg(f,"version"),g=t.getArg(f,"sources"),m=t.getArg(f,"names",[]),y=t.getArg(f,"sourceRoot",null),S=t.getArg(f,"sourcesContent",null),w=t.getArg(f,"mappings"),b=t.getArg(f,"file",null);if(l!=this._version)throw new Error("Unsupported version: "+l);y&&(y=t.normalize(y)),g=g.map(String).map(t.normalize).map(function(u){return y&&t.isAbsolute(y)&&t.isAbsolute(u)?t.relative(y,u):u}),this._names=r.fromArray(m.map(String),!0),this._sources=r.fromArray(g,!0),this._absoluteSources=this._sources.toArray().map(function(u){return t.computeSourceURL(y,u,a)}),this.sourceRoot=y,this.sourcesContent=S,this._mappings=w,this._sourceMapURL=a,this.file=b}c.prototype=Object.create(o.prototype),c.prototype.consumer=o,c.prototype._findSourceIndex=function(p){var a=p;if(this.sourceRoot!=null&&(a=t.relative(this.sourceRoot,a)),this._sources.has(a))return this._sources.indexOf(a);for(var f=0;f<this._absoluteSources.length;++f)if(this._absoluteSources[f]==p)return f;return-1},c.fromSourceMap=function(a,f){var l=Object.create(c.prototype),g=l._names=r.fromArray(a._names.toArray(),!0),m=l._sources=r.fromArray(a._sources.toArray(),!0);l.sourceRoot=a._sourceRoot,l.sourcesContent=a._generateSourcesContent(l._sources.toArray(),l.sourceRoot),l.file=a._file,l._sourceMapURL=f,l._absoluteSources=l._sources.toArray().map(function(k){return t.computeSourceURL(l.sourceRoot,k,f)});for(var y=a._mappings.toArray().slice(),S=l.__generatedMappings=[],w=l.__originalMappings=[],b=0,u=y.length;b<u;b++){var v=y[b],_=new d;_.generatedLine=v.generatedLine,_.generatedColumn=v.generatedColumn,v.source&&(_.source=m.indexOf(v.source),_.originalLine=v.originalLine,_.originalColumn=v.originalColumn,v.name&&(_.name=g.indexOf(v.name)),w.push(_)),S.push(_)}return n(l.__originalMappings,t.compareByOriginalPositions),l},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function d(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}c.prototype._parseMappings=function(a,f){for(var l=1,g=0,m=0,y=0,S=0,w=0,b=a.length,u=0,v={},_={},k=[],T=[],O,L,R,I,q;u<b;)if(a.charAt(u)===";")l++,u++,g=0;else if(a.charAt(u)===",")u++;else{for(O=new d,O.generatedLine=l,I=u;I<b&&!this._charIsMappingSeparator(a,I);I++);if(L=a.slice(u,I),R=v[L],R)u+=L.length;else{for(R=[];u<I;)i.decode(a,u,_),q=_.value,u=_.rest,R.push(q);if(R.length===2)throw new Error("Found a source, but no line and column");if(R.length===3)throw new Error("Found a source and line, but no column");v[L]=R}O.generatedColumn=g+R[0],g=O.generatedColumn,R.length>1&&(O.source=S+R[1],S+=R[1],O.originalLine=m+R[2],m=O.originalLine,O.originalLine+=1,O.originalColumn=y+R[3],y=O.originalColumn,R.length>4&&(O.name=w+R[4],w+=R[4])),T.push(O),typeof O.originalLine=="number"&&k.push(O)}n(T,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,n(k,t.compareByOriginalPositions),this.__originalMappings=k},c.prototype._findMapping=function(a,f,l,g,m,y){if(a[l]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[l]);if(a[g]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[g]);return s.search(a,f,m,y)},c.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var f=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var l=this._generatedMappings[a+1];if(f.generatedLine===l.generatedLine){f.lastGeneratedColumn=l.generatedColumn-1;continue}}f.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(a){var f={generatedLine:t.getArg(a,"line"),generatedColumn:t.getArg(a,"column")},l=this._findMapping(f,this._generatedMappings,"generatedLine","generatedColumn",t.compareByGeneratedPositionsDeflated,t.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(l>=0){var g=this._generatedMappings[l];if(g.generatedLine===f.generatedLine){var m=t.getArg(g,"source",null);m!==null&&(m=this._sources.at(m),m=t.computeSourceURL(this.sourceRoot,m,this._sourceMapURL));var y=t.getArg(g,"name",null);return y!==null&&(y=this._names.at(y)),{source:m,line:t.getArg(g,"originalLine",null),column:t.getArg(g,"originalColumn",null),name:y}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},c.prototype.sourceContentFor=function(a,f){if(!this.sourcesContent)return null;var l=this._findSourceIndex(a);if(l>=0)return this.sourcesContent[l];var g=a;this.sourceRoot!=null&&(g=t.relative(this.sourceRoot,g));var m;if(this.sourceRoot!=null&&(m=t.urlParse(this.sourceRoot))){var y=g.replace(/^file:\\/\\//,"");if(m.scheme=="file"&&this._sources.has(y))return this.sourcesContent[this._sources.indexOf(y)];if((!m.path||m.path=="/")&&this._sources.has("/"+g))return this.sourcesContent[this._sources.indexOf("/"+g)]}if(f)return null;throw new Error(\'"\'+g+\'" is not in the SourceMap.\')},c.prototype.generatedPositionFor=function(a){var f=t.getArg(a,"source");if(f=this._findSourceIndex(f),f<0)return{line:null,column:null,lastColumn:null};var l={source:f,originalLine:t.getArg(a,"line"),originalColumn:t.getArg(a,"column")},g=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,t.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(g>=0){var m=this._originalMappings[g];if(m.source===l.source)return{line:t.getArg(m,"generatedLine",null),column:t.getArg(m,"generatedColumn",null),lastColumn:t.getArg(m,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=c;function h(p,a){var f=p;typeof p=="string"&&(f=t.parseSourceMapInput(p));var l=t.getArg(f,"version"),g=t.getArg(f,"sections");if(l!=this._version)throw new Error("Unsupported version: "+l);this._sources=new r,this._names=new r;var m={line:-1,column:0};this._sections=g.map(function(y){if(y.url)throw new Error("Support for url field in sections not implemented.");var S=t.getArg(y,"offset"),w=t.getArg(S,"line"),b=t.getArg(S,"column");if(w<m.line||w===m.line&&b<m.column)throw new Error("Section offsets must be ordered and non-overlapping.");return m=S,{generatedOffset:{generatedLine:w+1,generatedColumn:b+1},consumer:new o(t.getArg(y,"map"),a)}})}h.prototype=Object.create(o.prototype),h.prototype.constructor=o,h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){for(var p=[],a=0;a<this._sections.length;a++)for(var f=0;f<this._sections[a].consumer.sources.length;f++)p.push(this._sections[a].consumer.sources[f]);return p}}),h.prototype.originalPositionFor=function(a){var f={generatedLine:t.getArg(a,"line"),generatedColumn:t.getArg(a,"column")},l=s.search(f,this._sections,function(m,y){var S=m.generatedLine-y.generatedOffset.generatedLine;return S||m.generatedColumn-y.generatedOffset.generatedColumn}),g=this._sections[l];return g?g.consumer.originalPositionFor({line:f.generatedLine-(g.generatedOffset.generatedLine-1),column:f.generatedColumn-(g.generatedOffset.generatedLine===f.generatedLine?g.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(a,f){for(var l=0;l<this._sections.length;l++){var g=this._sections[l].consumer.sourceContentFor(a,!0);if(g)return g}if(f)return null;throw new Error(\'"\'+a+\'" is not in the SourceMap.\')},h.prototype.generatedPositionFor=function(a){for(var f=0;f<this._sections.length;f++){var l=this._sections[f];if(l.consumer._findSourceIndex(t.getArg(a,"source"))!==-1){var g=l.consumer.generatedPositionFor(a);if(g)return{line:g.line+(l.generatedOffset.generatedLine-1),column:g.column+(l.generatedOffset.generatedLine===g.line?l.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(a,f){this.__generatedMappings=[],this.__originalMappings=[];for(var l=0;l<this._sections.length;l++)for(var g=this._sections[l],m=g.consumer._generatedMappings,y=0;y<m.length;y++){var S=m[y],w=g.consumer._sources.at(S.source);w=t.computeSourceURL(g.consumer.sourceRoot,w,this._sourceMapURL),this._sources.add(w),w=this._sources.indexOf(w);var b=null;S.name&&(b=g.consumer._names.at(S.name),this._names.add(b),b=this._names.indexOf(b));var u={source:w,generatedLine:S.generatedLine+(g.generatedOffset.generatedLine-1),generatedColumn:S.generatedColumn+(g.generatedOffset.generatedLine===S.generatedLine?g.generatedOffset.generatedColumn-1:0),originalLine:S.originalLine,originalColumn:S.originalColumn,name:b};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}n(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),n(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=h})),Rc=fe((e=>{var t=Wn().SourceMapGenerator,s=Ws(),r=/(\\r?\\n)/,i=10,n="$$$isSourceNode$$$";function o(c,d,h,p,a){this.children=[],this.sourceContents={},this.line=c??null,this.column=d??null,this.source=h??null,this.name=a??null,this[n]=!0,p!=null&&this.add(p)}o.fromStringWithSourceMap=function(d,h,p){var a=new o,f=d.split(r),l=0,g=function(){return b()+(b()||"");function b(){return l<f.length?f[l++]:void 0}},m=1,y=0,S=null;return h.eachMapping(function(b){if(S!==null)if(m<b.generatedLine)w(S,g()),m++,y=0;else{var u=f[l]||"",v=u.substr(0,b.generatedColumn-y);f[l]=u.substr(b.generatedColumn-y),y=b.generatedColumn,w(S,v),S=b;return}for(;m<b.generatedLine;)a.add(g()),m++;if(y<b.generatedColumn){var u=f[l]||"";a.add(u.substr(0,b.generatedColumn)),f[l]=u.substr(b.generatedColumn),y=b.generatedColumn}S=b},this),l<f.length&&(S&&w(S,g()),a.add(f.splice(l).join(""))),h.sources.forEach(function(b){var u=h.sourceContentFor(b);u!=null&&(p!=null&&(b=s.join(p,b)),a.setSourceContent(b,u))}),a;function w(b,u){if(b===null||b.source===void 0)a.add(u);else{var v=p?s.join(p,b.source):b.source;a.add(new o(b.originalLine,b.originalColumn,v,u,b.name))}}},o.prototype.add=function(d){if(Array.isArray(d))d.forEach(function(h){this.add(h)},this);else if(d[n]||typeof d=="string")d&&this.children.push(d);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+d);return this},o.prototype.prepend=function(d){if(Array.isArray(d))for(var h=d.length-1;h>=0;h--)this.prepend(d[h]);else if(d[n]||typeof d=="string")this.children.unshift(d);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+d);return this},o.prototype.walk=function(d){for(var h,p=0,a=this.children.length;p<a;p++)h=this.children[p],h[n]?h.walk(d):h!==""&&d(h,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(d){var h,p,a=this.children.length;if(a>0){for(h=[],p=0;p<a-1;p++)h.push(this.children[p]),h.push(d);h.push(this.children[p]),this.children=h}return this},o.prototype.replaceRight=function(d,h){var p=this.children[this.children.length-1];return p[n]?p.replaceRight(d,h):typeof p=="string"?this.children[this.children.length-1]=p.replace(d,h):this.children.push("".replace(d,h)),this},o.prototype.setSourceContent=function(d,h){this.sourceContents[s.toSetString(d)]=h},o.prototype.walkSourceContents=function(d){for(var h=0,p=this.children.length;h<p;h++)this.children[h][n]&&this.children[h].walkSourceContents(d);for(var a=Object.keys(this.sourceContents),h=0,p=a.length;h<p;h++)d(s.fromSetString(a[h]),this.sourceContents[a[h]])},o.prototype.toString=function(){var d="";return this.walk(function(h){d+=h}),d},o.prototype.toStringWithSourceMap=function(d){var h={code:"",line:1,column:0},p=new t(d),a=!1,f=null,l=null,g=null,m=null;return this.walk(function(y,S){h.code+=y,S.source!==null&&S.line!==null&&S.column!==null?((f!==S.source||l!==S.line||g!==S.column||m!==S.name)&&p.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:h.line,column:h.column},name:S.name}),f=S.source,l=S.line,g=S.column,m=S.name,a=!0):a&&(p.addMapping({generated:{line:h.line,column:h.column}}),f=null,a=!1);for(var w=0,b=y.length;w<b;w++)y.charCodeAt(w)===i?(h.line++,h.column=0,w+1===b?(f=null,a=!1):a&&p.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:h.line,column:h.column},name:S.name})):h.column++}),this.walkSourceContents(function(y,S){p.setSourceContent(y,S)}),{code:h.code,map:p}},e.SourceNode=o})),Oc=fe((e=>{e.SourceMapGenerator=Wn().SourceMapGenerator,e.SourceMapConsumer=Ic().SourceMapConsumer,e.SourceNode=Rc().SourceNode})),Mc=fe((e=>{e.__esModule=!0,e.safeJsonLiteral=o;var t=lt(),s=/[\\x00-\\x1f\\\\"\\u2028\\u2029<\\ud800-\\udfff]/,r=/<(?=!--|\\/?script)/gi;function i(p){return p.replace(r,"\\\\u003C")}function n(p){return"\\\\u"+p.charCodeAt(0).toString(16)}function o(p){return i(JSON.stringify(p).replace(/\\u2028/g,"\\\\u2028").replace(/\\u2029/g,"\\\\u2029").replace(/[\\ud800-\\udfff]/g,n))}var c=void 0;try{(typeof define!="function"||!define.amd)&&(c=Oc().SourceNode)}catch{}c||(c=function(p,a,f,l){this.src="",l&&this.add(l)},c.prototype={add:function(a){t.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){t.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function d(p,a,f){if(t.isArray(p)){for(var l=[],g=0,m=p.length;g<m;g++)l.push(a.wrap(p[g],f));return l}else if(typeof p=="boolean"||typeof p=="number")return p+"";return p}function h(p){this.srcFile=p,this.source=[]}h.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,f){this.source.unshift(this.wrap(a,f))},push:function(a,f){this.source.push(this.wrap(a,f))},merge:function(){var a=this.empty();return this.each(function(f){a.add([" ",f,`\n`])}),a},each:function(a){for(var f=0,l=this.source.length;f<l;f++)a(this.source[f])},empty:function(){var a=this.currentLocation||{start:{}};return new c(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var f=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return a instanceof c?a:(a=d(a,this,f),new c(f.start.line,f.start.column,this.srcFile,a))},functionCall:function(a,f,l){return l=this.generateList(l),this.wrap([a,f?"."+f+"(":"(",l,")"])},quotedString:function(a){return a=a+"",s.test(a)?o(a):\'"\'+a+\'"\'},objectLiteral:function(a){var f=this,l=[];Object.keys(a).forEach(function(m){var y=d(a[m],f);y!=="undefined"&&l.push([f.quotedString(m),":",y])});var g=this.generateList(l);return g.prepend("{"),g.add("}"),g},generateList:function(a){for(var f=this.empty(),l=0,g=a.length;l<g;l++)l&&f.add(","),f.add(d(a[l],this));return f},generateArray:function(a){var f=this.generateList(a);return f.prepend("["),f.add("]"),f}},e.default=h})),Nc=fe(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}var r=vi(),i=s(Lt()),n=lt(),o=Mc(),c=s(o);function d(f){this.value=f}function h(){}h.prototype={nameLookup:function(l,g){return this.internalNameLookup(l,g)},depthedLookup:function(l){return[this.aliasable("container.lookup"),"(depths, ",this.quotedString(l),")"]},compilerInfo:function(){var l=r.COMPILER_REVISION;return[l,r.REVISION_CHANGES[l]]},appendToBuffer:function(l,g,m){return n.isArray(l)||(l=[l]),l=this.source.wrap(l,g),this.environment.isSimple?["return ",l,";"]:m?["buffer += ",l,";"]:(l.appendToBuffer=!0,l)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(l,g){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",l,",",this.quotedString(g),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(l,g,m,y){this.environment=l,this.options=g,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!y,this.name=this.environment.name,this.isChild=!!m,this.context=m||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(l,g),this.useDepths=this.useDepths||l.useDepths||l.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||l.useBlockParams;var S=l.opcodes,w=void 0,b=void 0,u=void 0,v=void 0;for(u=0,v=S.length;u<v;u++)w=S[u],this.source.currentLocation=w.loc,b=b||w.loc,this[w.opcode].apply(this,w.args);if(this.source.currentLocation=b,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;\n`]),this.decorators.push("return fn;"),y?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {\n`),this.decorators.push(`}\n`),this.decorators=this.decorators.merge()));var _=this.createFunctionContext(y);if(this.isChild)return _;var k={compiler:this.compilerInfo(),main:_};this.decorators&&(k.main_d=this.decorators,k.useDecorators=!0);var T=this.context,O=T.programs,L=T.decorators;for(u=0,v=O.length;u<v;u++)k[u]=O[u],L[u]&&(k[u+"_d"]=L[u],k.useDecorators=!0);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.useBlockParams&&(k.useBlockParams=!0),this.options.compat&&(k.compat=!0),y?k.compilerOptions=this.options:(k.compiler=JSON.stringify(k.compiler),this.source.currentLocation={start:{line:1,column:0}},k=this.objectLiteral(k),g.srcName?(k=k.toStringWithSourceMap({file:g.destName}),k.map=k.map&&k.map.toString()):k=k.toString()),k},preamble:function(){this.lastContext=0,this.source=new c.default(this.options.srcName),this.decorators=new c.default(this.options.srcName)},createFunctionContext:function(l){var g=this,m="",y=this.stackVars.concat(this.registers.list);y.length>0&&(m+=", "+y.join(", "));var S=0;Object.keys(this.aliases).forEach(function(u){var v=g.aliases[u];v.children&&v.referenceCount>1&&(m+=", alias"+ ++S+"="+u,v.children[0]="alias"+S)}),this.lookupPropertyFunctionIsUsed&&(m+=", "+this.lookupPropertyFunctionVarDeclaration());var w=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&w.push("blockParams"),this.useDepths&&w.push("depths");var b=this.mergeSource(m);return l?(w.push(b),Function.apply(this,w)):this.source.wrap(["function(",w.join(","),`) {\n `,b,"}"])},mergeSource:function(l){var g=this.environment.isSimple,m=!this.forceBuffer,y=void 0,S=void 0,w=void 0,b=void 0;return this.source.each(function(u){u.appendToBuffer?(w?u.prepend(" + "):w=u,b=u):(w&&(S?w.prepend("buffer += "):y=!0,b.add(";"),w=b=void 0),S=!0,g||(m=!1))}),m?w?(w.prepend("return "),b.add(";")):S||this.source.push(\'return "";\'):(l+=", buffer = "+(y?"":this.initializeBuffer()),w?(w.prepend("return buffer + "),b.add(";")):this.source.push("return buffer;")),l&&this.source.prepend("var "+l.substring(2)+(y?"":`;\n`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n `.trim()},blockValue:function(l){var g=this.aliasable("container.hooks.blockHelperMissing"),m=[this.contextName(0)];this.setupHelperArgs(l,0,m);var y=this.popStack();m.splice(1,0,y),this.push(this.source.functionCall(g,"call",m))},ambiguousBlockValue:function(){var l=this.aliasable("container.hooks.blockHelperMissing"),g=[this.contextName(0)];this.setupHelperArgs("",0,g,!0),this.flushInline();var m=this.topStack();g.splice(1,0,m),this.pushSource(["if (!",this.lastHelper,") { ",m," = ",this.source.functionCall(l,"call",g),"}"])},appendContent:function(l){this.pendingContent?l=this.pendingContent+l:this.pendingLocation=this.source.currentLocation,this.pendingContent=l},append:function(){if(this.isInline())this.replaceStack(function(g){return[" != null ? ",g,\' : ""\']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var l=this.popStack();this.pushSource(["if (",l," != null) { ",this.appendToBuffer(l,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("\'\'",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(l){this.lastContext=l},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(l,g,m,y){var S=0;!y&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(l[S++])):this.pushContext(),this.resolvePath("context",l,S,g,m)},lookupBlockParam:function(l,g){this.useBlockParams=!0,this.push(["blockParams[",l[0],"][",l[1],"]"]),this.resolvePath("context",g,1)},lookupData:function(l,g,m){l?this.pushStackLiteral("container.data(data, "+l+")"):this.pushStackLiteral("data"),this.resolvePath("data",g,0,!0,m)},resolvePath:function(l,g,m,y,S){var w=this;if(this.options.strict||this.options.assumeObjects){this.push(a(this.options.strict&&S,this,g,m,l));return}for(var b=g.length,u=function(_){w.replaceStack(function(k){var T=w.nameLookup(k,g[_],l);return y?[" && ",T]:[" != null ? ",T," : ",k]})},v=m;v<b;v++)u(v)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(l,g){this.pushContext(),this.pushString(g),g!=="SubExpression"&&(typeof l=="string"?this.pushString(l):this.pushStackLiteral(l))},emptyHash:function(l){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(l?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var l=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(l.ids)),this.stringParams&&(this.push(this.objectLiteral(l.contexts)),this.push(this.objectLiteral(l.types))),this.push(this.objectLiteral(l.values))},pushString:function(l){this.pushStackLiteral(this.quotedString(l))},pushLiteral:function(l){this.pushStackLiteral(l)},pushProgram:function(l){l!=null?this.pushStackLiteral(this.programExpression(l)):this.pushStackLiteral(null)},registerDecorator:function(l,g){var m=this.nameLookup("decorators",g,"decorator"),y=this.setupHelperArgs(g,l);this.decorators.push(["var decorator = ",m,";"]),this.decorators.push([\'if (typeof decorator !== "function") { throw new Error(\',this.quotedString(\'Missing decorator: "\'+g+\'"\'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",y])," || fn;"])},invokeHelper:function(l,g,m){var y=this.popStack(),S=this.setupHelper(l,g),w=[];m&&w.push(S.name),w.push(y),this.options.strict||w.push(this.aliasable("container.hooks.helperMissing"));var b=["(",this.itemsSeparatedBy(w,"||"),")"],u=this.source.functionCall(b,"call",S.callParams);this.push(u)},itemsSeparatedBy:function(l,g){var m=[];m.push(l[0]);for(var y=1;y<l.length;y++)m.push(g,l[y]);return m},invokeKnownHelper:function(l,g){var m=this.setupHelper(l,g);this.push(this.source.functionCall(m.name,"call",m.callParams))},invokeAmbiguous:function(l,g){this.useRegister("helper");var m=this.popStack();this.emptyHash();var y=this.setupHelper(0,l,g),S=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",l,"helper")," || ",m,")"];this.options.strict||(S[0]="(helper = ",S.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",S,y.paramsInit?["),(",y.paramsInit]:[],"),","(typeof helper === ",this.aliasable(\'"function"\')," ? ",this.source.functionCall("helper","call",y.callParams)," : helper))"])},invokePartial:function(l,g,m){var y=[],S=this.setupParams(g,1,y);l&&(g=this.popStack(),delete S.name),m&&(S.indent=this.quotedString(m)),S.helpers="helpers",S.partials="partials",S.decorators="container.decorators",l?y.unshift(g):y.unshift(this.nameLookup("partials",g,"partial")),this.options.compat&&(S.depths="depths"),S=this.objectLiteral(S),y.push(S),this.push(this.source.functionCall("container.invokePartial","",y))},assignToHash:function(l){var g=this.popStack(),m=void 0,y=void 0,S=void 0;this.trackIds&&(S=this.popStack()),this.stringParams&&(y=this.popStack(),m=this.popStack());var w=this.hash;m&&(w.contexts[l]=m),y&&(w.types[l]=y),S&&(w.ids[l]=S),w.values[l]=g},pushId:function(l,g,m){l==="BlockParam"?this.pushStackLiteral("blockParams["+g[0]+"].path["+g[1]+"]"+(m?" + "+this.quotedString("."+m):"")):l==="PathExpression"?this.pushString(g):l==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:h,compileChildren:function(l,g){for(var m=l.children,y=void 0,S=void 0,w=0,b=m.length;w<b;w++){y=m[w],S=new this.compiler;var u=this.matchExistingProgram(y);if(u==null){var v=this.context.programs.push("")-1;y.index=v,y.name="program"+v,this.context.programs[v]=S.compile(y,g,this.context,!this.precompile),this.context.decorators[v]=S.decorators,this.context.environments[v]=y,this.useDepths=this.useDepths||S.useDepths,this.useBlockParams=this.useBlockParams||S.useBlockParams,y.useDepths=this.useDepths,y.useBlockParams=this.useBlockParams}else y.index=u.index,y.name="program"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},matchExistingProgram:function(l){for(var g=0,m=this.context.environments.length;g<m;g++){var y=this.context.environments[g];if(y&&y.equals(l))return y}},programExpression:function(l){var g=this.environment.children[l],m=[g.index,"data",g.blockParams];return(this.useBlockParams||this.useDepths)&&m.push("blockParams"),this.useDepths&&m.push("depths"),"container.program("+m.join(", ")+")"},useRegister:function(l){this.registers[l]||(this.registers[l]=!0,this.registers.list.push(l))},push:function(l){return l instanceof d||(l=this.source.wrap(l)),this.inlineStack.push(l),l},pushStackLiteral:function(l){this.push(new d(l))},pushSource:function(l){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),l&&this.source.push(l)},replaceStack:function(l){var g=["("],m=void 0,y=void 0,S=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var w=this.popStack(!0);if(w instanceof d)m=[w.value],g=["(",m],S=!0;else{y=!0;var b=this.incrStack();g=["((",this.push(b)," = ",w,")"],m=this.topStack()}var u=l.call(this,m);S||this.popStack(),y&&this.stackSlot--,this.push(g.concat(u,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var l=this.inlineStack;this.inlineStack=[];for(var g=0,m=l.length;g<m;g++){var y=l[g];if(y instanceof d)this.compileStack.push(y);else{var S=this.incrStack();this.pushSource([S," = ",y,";"]),this.compileStack.push(S)}}},isInline:function(){return this.inlineStack.length},popStack:function(l){var g=this.isInline(),m=(g?this.inlineStack:this.compileStack).pop();if(!l&&m instanceof d)return m.value;if(!g){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return m},topStack:function(){var l=this.isInline()?this.inlineStack:this.compileStack,g=l[l.length-1];return g instanceof d?g.value:g},contextName:function(l){return this.useDepths&&l?"depths["+l+"]":"depth"+l},quotedString:function(l){return this.source.quotedString(l)},objectLiteral:function(l){return this.source.objectLiteral(l)},aliasable:function(l){var g=this.aliases[l];return g?(g.referenceCount++,g):(g=this.aliases[l]=this.source.wrap(l),g.aliasable=!0,g.referenceCount=1,g)},setupHelper:function(l,g,m){var y=[];return{params:y,paramsInit:this.setupHelperArgs(g,l,y,m),name:this.nameLookup("helpers",g,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(y)}},setupParams:function(l,g,m){var y={},S=[],w=[],b=[],u=!m,v=void 0;u&&(m=[]),y.name=this.quotedString(l),y.hash=this.popStack(),this.trackIds&&(y.hashIds=this.popStack()),this.stringParams&&(y.hashTypes=this.popStack(),y.hashContexts=this.popStack());var _=this.popStack(),k=this.popStack();(k||_)&&(y.fn=k||"container.noop",y.inverse=_||"container.noop");for(var T=g;T--;)v=this.popStack(),m[T]=v,this.trackIds&&(b[T]=this.popStack()),this.stringParams&&(w[T]=this.popStack(),S[T]=this.popStack());return u&&(y.args=this.source.generateArray(m)),this.trackIds&&(y.ids=this.source.generateArray(b)),this.stringParams&&(y.types=this.source.generateArray(w),y.contexts=this.source.generateArray(S)),this.options.data&&(y.data="data"),this.useBlockParams&&(y.blockParams="blockParams"),y},setupHelperArgs:function(l,g,m,y){var S=this.setupParams(l,g,m);return S.loc=p(this),S=this.objectLiteral(S),y?(this.useRegister("options"),m.push("options"),["options=",S]):m?(m.push(S),""):S}},(function(){for(var f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),l=h.RESERVED_WORDS={},g=0,m=f.length;g<m;g++)l[f[g]]=!0})(),h.isValidJavaScriptVariableName=function(f){return!h.RESERVED_WORDS[f]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(f)};function p(f){var l=f.source.currentLocation;return l?o.safeJsonLiteral(l):"undefined"}function a(f,l,g,m,y){var S=l.popStack(),w=g.length;f&&w--;for(var b=m;b<w;b++)S=l.nameLookup(S,g[b],y);return f?[l.aliasable("container.strict"),"(",S,", ",l.quotedString(g[w]),", ",p(l)," )"]:S}e.default=h,t.exports=e.default})),Dc=fe(((e,t)=>{e.__esModule=!0;function s(l){return l&&l.__esModule?l:{default:l}}var r=s(Sc()),i=s(qn()),n=Tc(),o=Cc(),c=s(Nc()),d=s(Vn()),h=s(Hn()),p=r.default.create;function a(){var l=p();return l.compile=function(g,m){return o.compile(g,m,l)},l.precompile=function(g,m){return o.precompile(g,m,l)},l.AST=i.default,l.Compiler=o.Compiler,l.JavaScriptCompiler=c.default,l.Parser=n.parser,l.parse=n.parse,l.parseWithoutProcessing=n.parseWithoutProcessing,l}var f=a();f.create=a,h.default(f),f.Visitor=d.default,f.default=f,e.default=f,t.exports=e.default})),tt=tl(Dc(),1),$c=new Set(["{","}",":",",","]"]),yi={"=":"eq","==":"eq","!=":"ne",">":"gt","<":"lt",">=":"gte","<=":"lte",contains:"__contains"},Bc={"+":"add","-":"sub","*":"mul","/":"div","%":"mod"},Hc=["==","!=",">=","<=","&&","||","=",">","<","!","+","*","%","-","/","?"],qc=["and","or","not"],Gn=["true","false","null","undefined"],Fc=new Set([...` \\r\n!"\'()<>=&|{}~+*%:,]?`]),bi=/^-?\\d+(\\.\\d+)?$/,He=class extends Error{};function Vc(e,t){const s=e.substring(t+1).trimStart();if(/^[\\]"\'{[(\\d-]/.test(s))return!0;const r=e.indexOf("]",t);return r!==-1&&e.substring(t,r).includes(",")}function zc(e){return e?.type==="ident"||e?.type==="value"||e?.type===")"||e?.type==="]"||e?.type==="}"}function Uc(e){const t=[];let s=0;for(;s<e.length;){const r=e[s];if(/\\s/.test(r)){s++;continue}if(r==="("||r===")"||$c.has(r)){t.push({type:r,text:r}),s++;continue}if(r===\'"\'||r==="\'"){let c=s+1;for(;c<e.length&&e[c]!==r;)e[c]==="\\\\"&&c++,c++;if(c>=e.length)throw new He("unterminated string");t.push({type:"value",text:e.slice(s,c+1)}),s=c+1;continue}if(r==="["&&/[\\w\\])]/.test(e[s-1]??"")){t.push({type:"index",text:r}),s++;continue}if(r==="["&&Vc(e,s)){t.push({type:"[",text:r}),s++;continue}const i=Hc.find(c=>e.startsWith(c,s)&&!(c==="-"&&/\\d/.test(e[s+1]??"")));if(i){t.push({type:"op",text:i}),s+=i.length;continue}let n=s;for(;n<e.length&&!Fc.has(e[n])&&!(e[n]==="["&&n>s&&e[n-1]!=="."&&e[n-1]!=="/");){if(e[n]==="["){const c=e.indexOf("]",n);if(c===-1)throw new He("missing \']\'");n=c}n++}if(n===s)throw new He(`unexpected \'${r}\'`);const o=e.slice(s,n);qc.includes(o)||o==="contains"&&zc(t[t.length-1])?t.push({type:"op",text:o}):Gn.includes(o)||bi.test(o)?t.push({type:"value",text:o}):t.push({type:"ident",text:o}),s=n}return t}var Wc=class{constructor(e){this.tokens=e,this.pos=0,this.usedInfix=!1}peek(e=0){return this.tokens[this.pos+e]}next(){return this.tokens[this.pos++]}isOp(e,...t){return e?.type==="op"&&t.includes(e.text)}startsPrimary(e){return e?.type==="ident"||e?.type==="value"||e?.type==="("||e?.type==="["||e?.type==="{"}describe(e){return e?`\'${e.text}\'`:"end of expression"}parseExpression(){const e=this.parseConditional();if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseArguments(e){const t=[];for(let s=0;s<e;s++)t.push(this.parsePrimary());if(!this.peek())throw new He("expected a value");return t.push(this.parseExpression()),t}parseEmbed(){const e=[this.parsePrimary()];for(;this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=");){const t=this.next().text;if(this.next(),!this.peek())throw new He(`expected a value after \'${t}=\'`);e.push({kind:"raw",text:`${t}=${jt(this.parseConditional())}`})}if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseCondition(){const e=[this.parseConditional()];for(;this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=");)e.push(this.parseHashPair());if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseHashPair(){const e=this.next().text;return this.next(),{kind:"raw",text:`${e}=${jt(this.parsePrimary())}`}}parseConditional(){const e=this.parseOr();if(!this.isOp(this.peek(),"?"))return e;if(this.next(),!this.peek())throw new He("expected a value after \'?\'");const t=this.parseConditional();if(this.expect(":"),!this.peek())throw new He("expected a value after \':\'");const s=this.parseConditional();return this.usedInfix=!0,{kind:"call",name:"cond",args:[e,t,s]}}parseOr(){return this.parseChain(["or","||"],"or",()=>this.parseAnd())}parseAnd(){return this.parseChain(["and","&&"],"and",()=>this.parseNot())}parseChain(e,t,s){const r=[s()];for(;this.isOp(this.peek(),...e);){const i=this.next().text;if(!this.peek())throw new He(`expected a value after \'${i}\'`);r.push(s())}return r.length===1?r[0]:(this.usedInfix=!0,{kind:"call",name:t,args:r})}parseNot(){if(this.isOp(this.peek(),"not","!")){const e=this.next().text;if(!this.peek())throw new He(`expected a value after \'${e}\'`);return this.usedInfix=!0,{kind:"call",name:"not",args:[this.parseNot()]}}return this.parseComparison()}parseComparison(){const e=this.parseAdditive(),t=this.peek();if(t?.type!=="op"||!(t.text in yi))return e;if(this.next(),!this.peek())throw new He(`expected a value after \'${t.text}\'`);const s=this.parseAdditive(),r=this.peek();if(r?.type==="op"&&r.text in yi)throw new He(`comparisons can\'t be chained (at \'${r.text}\'), use "and" to combine them`);return this.usedInfix=!0,{kind:"call",name:yi[t.text],args:[e,s]}}parseAdditive(){return this.parseArithmetic(["+","-"],()=>this.parseMultiplicative())}parseMultiplicative(){return this.parseArithmetic(["*","/","%"],()=>this.parseUnary())}parseArithmetic(e,t){let s=t();for(;;){let r;const i=this.peek();if(this.isOp(i,...e)){if(r=this.next().text,!this.peek())throw new He(`expected a value after \'${r}\'`)}else if(e.includes("-")&&i?.type==="value"&&i.text.startsWith("-")&&bi.test(i.text))r="-",this.tokens[this.pos]={type:"value",text:i.text.slice(1)};else return s;this.usedInfix=!0,s={kind:"call",name:Bc[r],args:[s,t()]}}}parseUnary(){if(this.isOp(this.peek(),"-")){if(this.next(),!this.peek())throw new He("expected a value after \'-\'");return this.usedInfix=!0,{kind:"call",name:"sub",args:[{kind:"raw",text:"0"},this.parseUnary()]}}return this.parsePrimary()}parsePrimary(){let e=this.parseAtom();for(;;){const t=this.peek();if(t?.type==="index"){this.next();const s=this.parseConditional();this.expect("]"),this.usedInfix=!0,e={kind:"call",name:"lookup",args:[e,s]}}else if(t?.type==="ident"&&t.text.startsWith(".")&&this.tokens[this.pos-1]?.type==="]"){this.next();for(const s of t.text.substring(1).split(".")){const r=/^\\[(.*)\\]$/.exec(s)?.[1]??s;if(!r)throw new He(`unexpected \'${t.text}\'`);e={kind:"call",name:"lookup",args:[e,{kind:"raw",text:JSON.stringify(r)}]}}}else return e}}expect(e){if(this.peek()?.type!==e)throw new He(`expected \'${e}\' but found ${this.describe(this.peek())}`);this.next()}parseObject(){const e=[];for(;this.peek()?.type!=="}";){const t=this.next();if(!t)throw new He("expected \'}\' but found end of expression");if((t.type==="ident"||t.type==="value")&&/^\\w+$/.test(t.text))e.push({kind:"raw",text:`"${t.text}"`});else if(t.type==="value"&&/^["\']/.test(t.text))e.push({kind:"raw",text:t.text});else throw new He(`expected a name in the object, e.g. { hp: 10 }, but found \'${t.text}\'`);if(this.expect(":"),e.push(this.parseConditional()),this.peek()?.type!==",")break;this.next()}return this.expect("}"),this.usedInfix=!0,{kind:"call",name:"__object",args:e}}parseList(){const e=[];for(;this.peek()?.type!=="]";){if(!this.peek())throw new He("expected \']\' but found end of expression");if(e.push(this.parseConditional()),this.peek()?.type!==",")break;this.next()}return this.expect("]"),this.usedInfix=!0,{kind:"call",name:"array",args:e}}parseAtom(){const e=this.peek();if(e?.type==="{")return this.next(),this.parseObject();if(e?.type==="[")return this.next(),this.parseList();if(e?.type==="ident"||e?.type==="value")return this.next(),{kind:"raw",text:e.text};if(e?.type==="("){this.next();const t=this.isHelperCall()?this.parseHelperCall():this.parseConditional();if(this.peek()?.type!==")")throw new He(`expected \')\' but found ${this.describe(this.peek())}`);return this.next(),t}if(this.isOp(e,"not","!")){const t=e?.text==="!"?"!value":"not value";throw new He(`\'${e?.text}\' must be inside parentheses here, e.g. (${t})`)}throw e?.type==="op"?new He(`expected a value before \'${e.text}\'`):new He(e?`unexpected ${this.describe(e)}`:"expected a value")}isHelperCall(){const e=this.peek(),t=this.peek(1);return this.isOp(e,"and","or")?!0:e?.type==="ident"&&this.startsPrimary(t)}parseHelperCall(){const e=this.next().text,t=[];for(;this.peek()&&this.peek()?.type!==")";)this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=")?t.push(this.parseHashPair()):t.push(this.parsePrimary());return{kind:"call",name:e,args:t}}};function jt(e){return e.kind==="raw"?e.text:`(${e.name} ${e.args.map(jt).join(" ")})`}function Gs(e,t,s){const r=t==="display"||t==="value";let i=null,n=[];try{n=Uc(e)}catch(h){if(!r||!(h instanceof He))return null;i=h}const o=n.some(h=>h.type==="op"||h.type==="index"||h.type==="["||h.type==="{"),c=new Wc(n);let d=[];if(!i)try{d=t==="condition"?c.parseCondition():t==="arguments"?c.parseArguments(1):t==="embed"?c.parseEmbed():[c.parseExpression()]}catch(h){if(!(h instanceof He)||!o&&!r)return null;i=h}if(i)throw new Error(`Invalid ${s} "${e.trim()}": ${i.message}`);return!c.usedInfix&&!r?null:d}function Gc(e){const t=Gs(e,"condition","condition");return t&&t.map(jt).join(" ")}function Xc(e){const t=Gs(e,"arguments","expression");return t&&t.map(jt).join(" ")}function Yc(e){const t=Gs(e,"embed","embed");return t&&t.map(jt).join(" ")}function jc(e){const t=Gs(e,"display","expression")[0];if(t.kind==="call")return`${t.name} ${t.args.map(jt).join(" ")}`;if(Gn.includes(t.text)||bi.test(t.text)||/^["\']/.test(t.text))throw new Error(`Invalid expression "${e.trim()}": expected an attribute or a calculation`);return t.text}function Zc(e){return jt(Gs(e,"value","expression")[0])}function Kc(e){const t=[];let s=0,r=null,i=0;for(let n=0;n<e.length;n++){const o=e[n];r?o==="\\\\"?n++:o===r&&(r=null):o===\'"\'||o==="\'"?r=o:o==="("||o==="["||o==="{"?s++:o===")"||o==="]"||o==="}"?s=Math.max(0,s-1):o===","&&s===0&&(t.push(e.slice(i,n)),i=n+1)}return t.push(e.slice(i)),t.map(n=>n.trim()).filter(n=>n!=="")}var _i=/(\\\\*)\\{\\{(~?\\s*)(?:(#if|#unless|#each|#with|else\\s+if|else\\s+unless)(?=[\\s(!])|(set|inc|dec|append|prepend|remove)(?=\\s)|(=)|(#?embed)(?=\\s))/g;function Jc(e,t){let s=null,r=0;for(let i=t;i<e.length;i++){const n=e[i];if(s)n==="\\\\"?i++:n===s&&(s=null);else if(n===\'"\'||n==="\'")s=n;else if(n==="{")r++;else if(n==="}"&&r>0)r--;else{if(e.startsWith("~}}",i))return i;if(e.startsWith("}}",i))return i}}return-1}function Xn(e){if(!e.includes("{{"))return e;let t="",s=0;_i.lastIndex=0;let r;for(;(r=_i.exec(e))!==null;){if(r[1].length%2===1)continue;const i=r.index+r[0].length,n=Jc(e,i);if(n===-1)break;const o=e.slice(i,n);if(r[5]){const c=r.index+r[1].length;t+=e.slice(s,c)+"{{"+r[2]+jc(o),s=n}else{const c=r[3]?Gc(o):r[6]?Yc(o):Xc(o);c!==null&&(t+=e.slice(s,i)+" "+c,s=n)}_i.lastIndex=n}return t+e.slice(s)}var Cs=e=>e==null||e===!1||e==="",Si=e=>typeof e=="number"||Cs(e)||typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e));function St(e,t){if(!Si(t))throw new Error(`"${e}" needs numbers, but was given ${JSON.stringify(t)}`);return Cs(t)?0:Number(t)}var Qc=new Set(["__proto__","prototype","constructor"]);function _r(e){if(Qc.has(e))throw new Error(`"${e}" can\'t be used as a name inside an object`)}function As(e){if(!e.includes(".")&&!e.includes("["))return[e];const t=/^[^.[\\]]+/.exec(e);if(!t)return[e];const s=[t[0]];let r=t[0].length;for(;r<e.length;)if(e[r]==="."){if(e[r+1]==="["){r++;continue}const i=/^[^.[\\]]+/.exec(e.substring(r+1));if(!i)return[e];s.push(i[0]),r+=1+i[0].length}else if(e[r]==="["){const i=e.indexOf("]",r);if(i===-1)return[e];let n=e.substring(r+1,i).trim();const o=/^(["\'])(.*)\\1$/.exec(n);o&&(n=o[2]),s.push(n),r=i+1}else return[e];return s.forEach(_r),s}var wi=e=>typeof e=="object"&&e!==null;function Yn(e,t){for(const s of t){if(!wi(e)||!Object.prototype.hasOwnProperty.call(e,s))return null;e=e[s]}return e??null}function jn(e,t,s,r){const i=wi(e)?structuredClone(e):e==null?{}:null;if(i===null)throw new Error(`${s} isn\'t an object, so it has no ${t[0]}`);let n=i,o=s;return t.forEach((c,d)=>{if(_r(c),d===t.length-1){n[c]=r;return}o+="."+c;let h=Object.prototype.hasOwnProperty.call(n,c)?n[c]:void 0;if(h==null&&(h={},n[c]=h),!wi(h))throw new Error(`${o} isn\'t an object, so it has no ${t[d+1]}`);n=h}),i}function Zn(e){const t=/^\\s*(\\w+)/.exec(e);if(!t)return null;const s=[];let r=t[0].length;for(;;){const i=/^\\.(\\w+)/.exec(e.substring(r));if(i){s.push({name:i[1]}),r+=i[0].length;continue}if(e[r]!=="[")break;const n=eu(e,r);if(n===-1)return null;s.push({index:e.substring(r+1,n)}),r=n+1}return{attribute:t[1],segments:s,rest:e.substring(r)}}function eu(e,t){let s=0,r=null;for(let i=t;i<e.length;i++){const n=e[i];if(r)n==="\\\\"?i++:n===r&&(r=null);else if(n===\'"\'||n==="\'")r=n;else if(n==="["||n==="("||n==="{")s++;else if((n==="]"||n===")"||n==="}")&&(s--,s===0))return n==="]"?i:-1}return-1}var tu=class{constructor(e,t,s){this.goto=null,this.deactivate=new Set,this.scopes=[],this.expressionCache=new Map,this.getStory=e,this.state=t,this.getCurrentSection=s,this.handlebars=tt.default.create();const r=this;this.handlebars.registerHelper("embed",function(...u){const v=u.pop(),_=i(u[0]),k=r.embeddedText(_);if(k===void 0)return;const T=Object.create(null);for(const[R,I]of Object.entries(v.hash??{}))T[R]=i(I);const O=r.scopes,L=v.fn?()=>{const R=r.scopes;r.scopes=O;try{return v.fn(this,{data:v.data})}finally{r.scopes=R}}:void 0;r.scopes=[...O,{params:T,content:L}];try{return new tt.default.SafeString(r.process(k,!0))}finally{r.scopes=O}}),this.handlebars.registerHelper("content",()=>{const u=this.scopes[this.scopes.length-1];return u?.content?new tt.default.SafeString(u.content()):this.hasAttribute("content")?this.getAttribute("content"):""}),this.handlebars.registerHelper("seen",u=>this.state.getSeen(u)),this.handlebars.registerHelper("visits",u=>this.state.getVisits(u)),this.handlebars.registerHelper("get",u=>this.getAttribute(u)),this.handlebars.registerHelper("at",u=>{const v=this.getAttribute("_section");return Array.isArray(u)?u.includes(v):v===u});const i=u=>u&&typeof u=="object"&&typeof u.toHTML=="function"?u.toString():u;this.handlebars.registerHelper("goto",(...u)=>{const v=u.pop(),_=u.length?i(u[0]):void 0;if(typeof _!="string"||!_||!(_ in this.getStory().sections))return new tt.default.SafeString(Zt("Error in {{goto}}:",_===void 0?\'expected a section name, e.g. {{goto "cave"}}\':`there is no section called "${_}"`));let k=0;return v.hash.after!==void 0&&(k=Number(i(v.hash.after)),!Number.isFinite(k)||k<0)?new tt.default.SafeString(Zt("Error in {{goto}}:",`after= should be a number of milliseconds, e.g. after=3000, not "${v.hash.after}"`)):(this.goto??(this.goto={section:_,after:k}),"")}),this.handlebars.registerHelper("deactivate",(...u)=>{u.pop();const v=u.length?u.map(i):[this.getAttribute("_passage")];for(const _ of v){if(typeof _!="string"||!_)return new tt.default.SafeString(Zt("Error in {{deactivate}}:",u.length?\'expected a passage name, e.g. {{deactivate "door"}}\':"{{deactivate}} with no passage name only works in a passage"));const k=this.getCurrentSection()?.passages,T=this.getStory().sections[""]?.passages;if(!(k&&_ in k)&&!(T&&_ in T))return new tt.default.SafeString(Zt("Error in {{deactivate}}:",`there is no passage called "${_}" in this section`));this.deactivate.add(_)}return""}),this.handlebars.registerHelper("set",(u,v)=>(this.setAttribute(u,i(v)),"")),this.handlebars.registerHelper("__value",u=>(this.evaluated=i(u),"")),this.handlebars.registerHelper("unset",u=>(this.setAttribute(u,!1),""));const n=(u,v)=>{this.handlebars.registerHelper(u,(_,...k)=>{const T=k.length>1?St(u,i(k[0])):1,O=St(u,this.getAttribute(_));return this.setAttribute(_,O+v*T),""})};n("inc",1),n("dec",-1),this.handlebars.registerHelper("and",(...u)=>u.slice(0,-1).every(Boolean)),this.handlebars.registerHelper("or",(...u)=>u.slice(0,-1).some(Boolean)),this.handlebars.registerHelper("not",u=>!u),this.handlebars.registerHelper("eq",(u,v)=>u==v),this.handlebars.registerHelper("ne",(u,v)=>u!=v),this.handlebars.registerHelper("gt",(u,v)=>u>v),this.handlebars.registerHelper("lt",(u,v)=>u<v),this.handlebars.registerHelper("gte",(u,v)=>u>=v),this.handlebars.registerHelper("lte",(u,v)=>u<=v);const o=(u,v)=>{this.handlebars.registerHelper(u,(..._)=>{const k=_.slice(0,-1).map(i);if(k.length!==2)throw new Error(`"${u}" needs two values, but was given ${k.length}`);return v(St(u,k[0]),St(u,k[1]))})};this.handlebars.registerHelper("add",(...u)=>{const v=u.slice(0,-1).map(i);if(v.length!==2)throw new Error(`"add" needs two values, but was given ${v.length}`);const[_,k]=v;if(Si(_)&&Si(k))return St("add",_)+St("add",k);const T=O=>{if(Cs(O))return"";if(typeof O=="object")throw new Error(`"add" can\'t add ${Array.isArray(O)?"a list":"an object"}`);return String(O)};return T(_)+T(k)}),o("sub",(u,v)=>u-v),o("mul",(u,v)=>u*v),o("div",(u,v)=>{if(v===0)throw new Error("division by zero");return u/v}),o("mod",(u,v)=>{if(v===0)throw new Error("division by zero");return u%v});const c=(u,v,_)=>{this.handlebars.registerHelper(u,(...k)=>{const T=k.slice(0,-1).map(i);if(T.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(T.length!==1&&!(_&&T.length===2))throw new Error(`"${u}" needs ${_?"one or two values":"one value"}, but was given ${T.length}`);const O=St(u,T[0]);if(T.length===1)return v(O);const L=10**St(u,T[1]);return v(Number((O*L).toPrecision(15)))/L})};c("round",Math.round,!0),c("floor",Math.floor,!1),c("ceil",Math.ceil,!1),c("abs",Math.abs,!1);const d=(u,v)=>{this.handlebars.registerHelper(u,(..._)=>{let k=_.slice(0,-1).map(i);if(k.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(k.length===1&&Array.isArray(k[0])&&(k=k[0].map(i)),k.length===0)throw new Error(`"${u}" needs at least one value`);return v(...k.map(T=>St(u,T)))})};d("min",Math.min),d("max",Math.max);const h=(u,v)=>{if(Cs(v))return"";if(typeof v=="object")throw new Error(`"${u}" needs text, but was given ${Array.isArray(v)?"a list":"an object"}`);return String(v)},p=(u,v)=>{this.handlebars.registerHelper(u,(..._)=>{const k=_.slice(0,-1).map(i);if(k.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(k.length!==1)throw new Error(`"${u}" needs one value, but was given ${k.length}`);return v(h(u,k[0]))})};p("upper",u=>u.toUpperCase()),p("lower",u=>u.toLowerCase());const a=u=>u.charAt(0).toUpperCase()+u.substring(1);p("capitalise",a),p("capitalize",a),this.handlebars.registerHelper("cond",(...u)=>{const v=u.slice(0,-1).map(i);if(v.length===0&&this.hasAttribute("cond"))return this.getAttribute("cond");if(v.length!==3)throw new Error(`"cond" needs three values, but was given ${v.length}`);return v[0]?v[1]:v[2]}),this.handlebars.registerHelper("__contains",(u,v)=>(u=i(u),v=i(v),Array.isArray(u)?u.some(_=>i(_)===v):Cs(u)?!1:typeof u=="object"?Object.prototype.hasOwnProperty.call(u,String(v)):String(u).includes(h("contains",v)))),this.handlebars.registerHelper("array",function(...u){return u.pop(),u.map(i)}),this.handlebars.registerHelper("__object",(...u)=>{u.pop();const v={};for(let _=0;_<u.length;_+=2){const k=String(i(u[_]));_r(k),v[k]=i(u[_+1])}return v}),this.handlebars.registerHelper("append",(u,v)=>{const _=this.getAttribute(u)||[],k=Array.isArray(_)?[..._]:[_],T=i(v);return Array.isArray(T)?k.push(...T.map(i)):k.push(T),this.setAttribute(u,k),""}),this.handlebars.registerHelper("prepend",(u,v)=>{const _=this.getAttribute(u)||[],k=Array.isArray(_)?[..._]:[_],T=i(v);return Array.isArray(T)?k.unshift(...T.map(i)):k.unshift(T),this.setAttribute(u,k),""}),this.handlebars.registerHelper("pop",u=>{const v=this.getAttribute(u)||[];if(!Array.isArray(v)||v.length===0)return"";const _=[...v],k=_.shift();return this.setAttribute(u,_),k}),this.handlebars.registerHelper("remove",(u,v)=>{const _=this.getAttribute(u)||[];if(!Array.isArray(_))return"";const k=i(v),T=_.findIndex(O=>i(O)===k);if(T!==-1){const O=[..._];O.splice(T,1),this.setAttribute(u,O)}return""}),this.handlebars.registerHelper("contains",(u,v)=>{let _;if(typeof u=="string"){const T=this.getAttribute(u);_=Array.isArray(T)?T:[]}else if(Array.isArray(u))_=u;else return!1;const k=i(v);return _.some(T=>i(T)===k)}),this.handlebars.registerHelper("length",u=>{let v;if(typeof u=="string"){const _=this.getAttribute(u);v=Array.isArray(_)?_:[]}else if(Array.isArray(u))v=u;else return 0;return v.length});const f=(u,v)=>{if(v=i(v),Array.isArray(v))return v.map(i);if(Cs(v))return[];throw typeof v=="string"?new Error(`"${u}" needs a list, but was given the text "${v}". To use an attribute\'s list, leave out the quotes: (${u} bag), not (${u} "bag")`):new Error(`"${u}" needs a list, but was given ${typeof v=="object"?"an object":String(v)}`)},l=(u,v,_,k)=>{this.handlebars.registerHelper(u,(...T)=>{const O=T.slice(0,-1).map(i);if(O.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(O.length<v||O.length>_){const L=v===_?`${v} value${v===1?"":"s"}`:`${v} to ${_} values`;throw new Error(`"${u}" needs ${L}, but was given ${O.length}`)}return k(O)})},g=(u,v)=>Math.trunc(St(u,v));l("join",1,3,([u,v,_])=>{const k=f("join",u).map(O=>h("join",O)),T=v===void 0?", ":h("join",v);return _===void 0||k.length<2?k.join(T):k.slice(0,-1).join(T)+h("join",_)+k[k.length-1]});const m=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});l("sort",1,1,([u])=>f("sort",u).sort((v,_)=>{const k=typeof v=="number",T=typeof _=="number";return k&&T?v-_:k!==T?k?-1:1:m.compare(h("sort",v),h("sort",_))})),l("shuffle",1,1,([u])=>{const v=f("shuffle",u);for(let _=v.length-1;_>0;_--){const k=Math.floor(Math.random()*(_+1));[v[_],v[k]]=[v[k],v[_]]}return v}),l("slice",2,3,([u,v,_])=>{const k=g("slice",v),T=_===void 0?void 0:g("slice",_);return typeof u=="string"?u.slice(k,T):f("slice",u).slice(k,T)}),l("first",1,1,([u])=>f("first",u)[0]??""),l("last",1,1,([u])=>f("last",u).slice(-1)[0]??""),l("indexof",2,2,([u,v])=>typeof u=="string"?u.indexOf(h("indexof",v)):f("indexof",u).indexOf(v)),l("count",2,2,([u,v])=>{if(typeof u=="string"){const _=h("count",v);return _===""?0:u.split(_).length-1}return f("count",u).filter(_=>_===v).length}),l("range",2,2,([u,v])=>{const _=g("range",u),k=g("range",v);if(Math.abs(k-_)>=1e4)throw new Error(`"range" can make a list of up to 10,000 numbers, but was asked for ${Math.abs(k-_)+1}`);const T=k>=_?1:-1,O=[];for(let L=_;L!==k+T;L+=T)O.push(L);return O});const y=u=>String(u).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),S=new Map,w=(u,v,_,k)=>{if(typeof u!="string"||!u.includes("{{"))return u;const T=(k?"h:":"t:")+u;let O=S.get(T);return O||(O=this.handlebars.compile(Xn(u),{compat:!0,noEscape:!k}),S.set(T,O)),O(v,{data:_.data})},b=(u,v)=>{let _="";const k=w(v.hash.set||"",u,v,!1);if(k){const T=this.getStory().expressions?Kc(k):k.split(",").map(O=>O.trim());_+=` data-set="${y(JSON.stringify(T))}"`}return _};this.handlebars.registerHelper("section",function(u,v){const _=w(v.hash.text||u,this,v,!0);return new tt.default.SafeString(`<a class="squiffy-link link-section" data-section="${y(u)}"${b(this,v)} role="link" tabindex="0">${_}</a>`)}),this.handlebars.registerHelper("passage",function(u,v){const _=w(v.hash.text||u,this,v,!0);return new tt.default.SafeString(`<a class="squiffy-link link-passage" data-passage="${y(u)}"${b(this,v)} role="link" tabindex="0">${_}</a>`)})}evaluate(e){let t=this.expressionCache.get(e);return t||(t=this.handlebars.compile(`{{__value ${Zc(e)}}}`),this.expressionCache.set(e,t)),this.evaluated=void 0,t(this.context()),this.evaluated}embeddedText(e){if(typeof e!="string")return;const t=this.getCurrentSection();if(t.passages&&Object.prototype.hasOwnProperty.call(t.passages,e))return t.passages[e].text||"";const s=this.getStory();if(Object.prototype.hasOwnProperty.call(s.sections,e))return s.sections[e].text||""}get params(){return this.scopes[this.scopes.length-1]?.params}isParam(e){const t=this.params;return!!t&&Object.prototype.hasOwnProperty.call(t,As(e)[0])}hasAttribute(e){return this.isParam(e)||this.state.has(e)}getAttribute(e){if(this.isParam(e)){const[t,...s]=As(e);return structuredClone(Yn(this.params[t],s))}return this.state.get(e)}setAttribute(e,t){if(this.isParam(e)){const[s,...r]=As(e);typeof t>"u"&&(t=!0),this.params[s]=r.length?jn(this.params[s],r,s,t):structuredClone(t);return}this.state.set(e,t)}context(){const e=this.state.getStore(),t=this.params;if(!t||!Object.keys(t).length)return e;const s=r=>typeof r=="string"&&Object.prototype.hasOwnProperty.call(t,r);return new Proxy({},{get:(r,i)=>s(i)?structuredClone(t[i]):Reflect.get(e,i),has:(r,i)=>s(i)||Reflect.has(e,i),ownKeys:()=>[...new Set([...Object.keys(t),...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:(r,i)=>s(i)?{enumerable:!0,configurable:!0,value:structuredClone(t[i])}:Reflect.getOwnPropertyDescriptor(e,i)})}process(e,t){try{return e=this.handlebars.compile(Xn(e),{compat:!0})(this.context()),t?gi(e,{async:!1}).trim():mi(e,{async:!1}).trim()}catch(s){const r=s instanceof Error?s.message:String(s);return console.error("Squiffy template error:",r),Zt("Template error:",r)}}};function Zt(e,t){const s=r=>r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return`<div class="squiffy-error" style="color: red; background: #ffe0e0; padding: 8px; border: 1px solid red; margin: 4px 0; font-family: monospace; white-space: pre-wrap;"><strong>${s(e)}</strong> ${s(t)}</div>`}var su=class{constructor(){this.listeners=new Map}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){this.listeners.get(e)?.delete(t)}once(e,t){const s=this.on(e,r=>{s(),t(r)});return s}emit(e,t){this.listeners.get(e)?.forEach(s=>{try{s(t)}catch(r){console.error(`[Squiffy] handler for "${String(e)}" failed`,r)}})}},ru=class{constructor(e,t,s,r,i){this.store={},this.readOnly=!1,this.persist=e,this.storyId=t,this.onSet=s,this.emitter=r,this.onSetInternal=i}usePersistentStorage(){return this.persist&&window.localStorage&&this.storyId}set(e,t){this.setAt(As(e),t)}setAt(e,t){if(this.readOnly)return;const[s,...r]=e;if(!r.length){this.setInternal(s,t,!0);return}typeof t>"u"&&(t=!0);const i=this.has(s)?this.store[s]:null;this.setInternal(s,jn(i,r,s,t),!0)}setInternal(e,t,s){typeof t>"u"&&(t=!0),s&&this.onSetInternal&&this.onSetInternal(e,this.getAt([e]),structuredClone(t)),this.store[e]=structuredClone(t),this.usePersistentStorage()&&(localStorage[this.storyId+"-"+e]=JSON.stringify(t)),s&&this.emitter.emit("set",{attribute:e,value:t}),this.onSet(e,t)}has(e){return Object.prototype.hasOwnProperty.call(this.store,e)}get(e){return this.getAt(As(e))}getAt(e){const[t,...s]=e;if(!this.has(t))return null;const r=s.length?Yn(this.store[t],s):this.store[t];return structuredClone(r)}getStore(){return new Proxy({},{get:(e,t)=>typeof t=="string"&&(this.has(t)||!(t in e))?this.getAt([t]):Reflect.get(e,t),has:(e,t)=>this.has(String(t)),ownKeys:()=>Object.keys(this.store),getOwnPropertyDescriptor:(e,t)=>{const s=String(t);if(this.has(s))return{enumerable:!0,configurable:!0,value:this.getAt([s])}}})}load(){if(!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)if(t.startsWith(this.storyId+"-")){const s=t.substring(this.storyId.length+1);this.store[s]=JSON.parse(localStorage[t])}}reset(){if(this.store={},!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)t.startsWith(this.storyId)&&localStorage.removeItem(t)}setSeen(e){let t=this.get("_seen_sections");t||(t=[]);const s=this.get("_visits")||{};s[e]=this.getVisitsFrom(s,t,e)+1,this.set("_visits",s),t.indexOf(e)==-1&&(t.push(e),this.set("_seen_sections",t))}getSeen(e){const t=this.get("_seen_sections");return t?t.indexOf(e)>-1:!1}getVisits(e){return this.getVisitsFrom(this.get("_visits")||{},this.get("_seen_sections")||[],e)}getVisitsFrom(e,t,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:t.indexOf(s)>-1?1:0}};function Kn(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((s,r)=>s===t[r])}function iu(e,t,s,r,i,n){function o(a){return a.replace(/\'/g,"\\\\\'")}function c(a){return s.querySelectorAll(`[data-source=\'[[${o(a)}]]\']`)}function d(a,f){return s.querySelectorAll(`[data-source=\'[[${o(a)}]][${o(f)}]\']`)}function h(a){const f=new Map;for(const l of a.querySelectorAll("a.link-passage[data-passage]")){const g=l.getAttribute("data-passage");f.has(g)||f.set(g,[]),f.get(g).push(l)}return f}function p(a,f){const l=h(a);a.innerHTML=f;const g=h(a);for(const[m,y]of l)y.forEach((S,w)=>{const b=g.get(m)?.[w];if(!(!b||!S.classList.contains("disabled"))){i(b);for(const u of["data-clicked","data-deactivated-by"]){const v=S.getAttribute(u);v!==null&&b.setAttribute(u,v)}}})}for(const a of Object.keys(e.sections)){const f=c(a);if(f.length){const l=t.sections[a];if(l){const g=e.sections[a],m=!Kn(g.attributes,l.attributes),y=l.text!=g.text;if(m&&n(l.attributes||[]),y||m)for(const S of f)p(S,r(l.text||"",l))}else for(const g of f)g.closest(".squiffy-output-section")?.remove()}if(e.sections[a].passages)for(const l of Object.keys(e.sections[a].passages)){const g=d(a,l);if(!g.length)continue;const m=t.sections[a]?.passages&&t.sections[a]?.passages[l];if(m){const y=e.sections[a].passages[l],S=!Kn(y.attributes,m.attributes),w=m.text!=y.text;if(S&&n(m.attributes||[]),w||S)for(const b of g)p(b,r(m.text||"",t.sections[a]))}else for(const y of g)y.closest(".squiffy-output-passage")?.remove()}}}var nu=class{constructor(e,t,s,r,i,n,o,c,d,h,p){this.plugins=[],this.outputElement=e,this.textProcessor=t,this.state=s,this.linkHandler=r,this.getSectionText=i,this.getPassageText=n,this.processText=o,this.addTransition=c,this.animation=d,this.emitter=h,this.resolveAssetsInHtml=p}add(e){const t=e.init({outputElement:this.outputElement,registerHelper:(s,r)=>{this.textProcessor.handlebars.registerHelper(s,r)},registerLinkHandler:(s,r)=>{this.linkHandler.registerLinkHandler(s,r)},get:s=>this.state.get(s),set:(s,r)=>this.state.set(s,r),getSectionText:this.getSectionText,getPassageText:this.getPassageText,processText:this.processText,resolveAssetsInHtml:this.resolveAssetsInHtml,addTransition:this.addTransition,animation:this.animation,on:(s,r)=>this.emitter.on(s,r),off:(s,r)=>this.emitter.off(s,r),once:(s,r)=>this.emitter.once(s,r)});return this.plugins.push(e),t}onWrite(e){this.plugins.forEach(t=>t.onWrite?.(e))}onLoad(){this.plugins.forEach(e=>e.onLoad?.())}};function Jn(e,t){return new Promise(s=>{e.addEventListener("transitionend",function(){e.innerHTML=t,e.addEventListener("transitionend",function(){e.classList.remove("fade-in"),s()},{once:!0}),e.classList.remove("fade-out"),e.classList.add("fade-in")},{once:!0}),e.classList.add("fade-out")})}function ou(){return{name:"replaceLabel",init(e){e.registerHelper("label",function(t,s){return new tt.default.SafeString(`<span class="squiffy-label-${t}">${s.fn(this)}</span>`)}),e.registerHelper("replace",function(t,s){const r=String(s.fn(this)),i=e.outputElement.querySelectorAll(`.squiffy-label-${t}`),n=i[i.length-1];if(n){const o=r.includes(`\n\n`)?mi(r,{async:!1}).trim():gi(r,{async:!1}).trim();e.addTransition(()=>Jn(n,o))}return""})}}}function au(){const e=i=>i.replace(/&/g,"&amp;").replace(/\'/g,"&#39;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=(i,n,o,c)=>{const d=o.map(l=>l.toString()),h=r(d,null),p=c.hash.set||"";p&&i.set(p,h[0]);const a=e(JSON.stringify(h.slice(1))||""),f=c.hash.show=="next"?h[1]:h[0];return new tt.default.SafeString(`<a class="squiffy-link" data-handler="${n}" data-value="${e(h[0])}" data-show="${c.hash.show||""}" data-options=\'${a}\' data-attribute="${p}" role="link">${f}</a>`)},s=(i,n,o)=>{const c={},d=JSON.parse(n.getAttribute("data-options")??"[]")||[],h=r(d,o?n.getAttribute("data-value"):"");n.innerHTML=n.getAttribute("data-show")=="next"?h[1]:h[0],n.setAttribute("data-value",h[0]),n.setAttribute("data-options",JSON.stringify(h.slice(1))||""),h[1]||(c.disableLink=!0);const p=n.getAttribute("data-attribute");return p&&i.set(p,n.getAttribute("data-value")),window.getSelection()?.removeAllRanges(),c},r=(i,n)=>{const o=i[0],c=i.slice(1);return n&&c.push(n),[o,...c]};return{name:"rotateSequence",init(i){i.registerHelper("rotate",(n,o)=>t(i,"rotate",n,o)),i.registerHelper("sequence",(n,o)=>t(i,"sequence",n,o)),i.registerLinkHandler("rotate",n=>s(i,n,!0)),i.registerLinkHandler("sequence",n=>s(i,n,!1))}}}function lu(){return{name:"random",init(e){e.registerHelper("random",(t,s)=>{const r=t.map(o=>o.toString()),i=r[Math.floor(Math.random()*r.length)],n=s.hash.set||"";return n&&e.set(n,i),new tt.default.SafeString(i)})}}}function cu(){let e;return{name:"live",init(t){e=t,e.registerHelper("live",(r,i)=>{const n=i.hash.section||"";if(n)return new tt.default.SafeString(`<span class="squiffy-live" data-attribute="${r}" data-section="${n}"></span>`);const o=i.hash.passage||"";return o?new tt.default.SafeString(`<span class="squiffy-live" data-attribute="${r}" data-passage="${o}"></span>`):new tt.default.SafeString(`<span class="squiffy-live" data-attribute="${r}"></span>`)});const s=async r=>{const i=[],n=[...e.outputElement.querySelectorAll(".squiffy-live[data-attribute]")].filter(o=>As(o.dataset.attribute)[0]===r.attribute);for(const o of n){const c=o.innerHTML;let d="";if(o.dataset.section){const h=e.getSectionText(o.dataset.section);h&&(d=e.processText(h,!0))}else if(o.dataset.passage){const h=e.getPassageText(o.dataset.passage);h&&(d=e.processText(h,!0))}else d=o.dataset.attribute==r.attribute?r.value:e.get(o.dataset.attribute);c!==d&&i.push(Jn(o,d))}await Promise.all(i)};e.on("set",async r=>{await s(r)})},onWrite(t){e&&t.querySelectorAll(".squiffy-live").forEach(s=>{if(s.dataset.section){const r=e.getSectionText(s.dataset.section);r&&(s.innerHTML=e.processText(r,!0))}else if(s.dataset.passage){const r=e.getPassageText(s.dataset.passage);r&&(s.innerHTML=e.processText(r,!0))}else{const r=s.dataset.attribute;s.textContent=r?e.get(r):""}})}}}function uu(){let e;const t=r=>{const i={};for(const[n,o]of Object.entries(r)){if(o==null){i[n]=o;continue}try{i[n]=JSON.parse(o)}catch{i[n]=o}}return i},s=r=>{for(const i of r.querySelectorAll(".squiffy-animate")){const n=t(i.dataset);if(!n.content)continue;const o=n.content.includes(`\n\n`)?mi(n.content,{async:!1}):gi(n.content,{async:!1});if(i.innerHTML=e.resolveAssetsInHtml(o.trim()),!n.name)continue;const c=i.innerHTML;let d=[];const h=()=>{for(const f of d)e.animation.removeLinkAnimation(f);d=[...i.querySelectorAll("a")];for(const f of d)e.animation.addLinkAnimation(f,a)},p=()=>{if(n.trigger!=="link"){i.innerHTML=c;return}const f=d;i.innerHTML=c,h(),d.forEach((l,g)=>{const m=f[g];if(m){m.classList.contains("disabled")&&l.classList.add("disabled");for(const y of["tabindex","data-clicked","data-deactivated-by"]){const S=m.getAttribute(y);S!==null&&l.setAttribute(y,S)}}})},a=()=>{n.loop?e.animation.runAnimation(n.name,i,n,()=>{},!0):(e.animation.isInitiallyHidden(n.name)&&(i.style.opacity="0"),e.addTransition(()=>new Promise(f=>{i.style.opacity="",e.animation.runAnimation(n.name,i,n,()=>{i.classList.remove("squiffy-animate"),p(),f()},!1)})))};n.trigger==="link"?h():a()}};return{name:"animate",init(r){e=r,e.registerHelper("animate",function(i,n){const o=n.fn(this),c={name:i,content:o,...n.hash},d=Object.entries(c).map(([p,a])=>` data-${tt.default.escapeExpression(p)}="${tt.default.escapeExpression(JSON.stringify(a))}"`).join(""),h=o.includes(`\n\n`)?"div":"span";return new tt.default.SafeString(`<${h} class="squiffy-animate"${d}></${h}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var Xs={ReplaceLabel:ou,RotateSequencePlugin:au,RandomPlugin:lu,LivePlugin:cu,AnimatePlugin:uu},hu=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute("data-handler")||"",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},Dt=typeof window<"u",ct=Dt?window:null,K=Dt?document:null,Fe={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},be={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},vt={NONE:0,AUTO:1,FORCE:2},Je={replace:0,none:1,blend:2},Qn=Symbol(),ls=Symbol(),ki=Symbol(),Ys=Symbol(),eo=Symbol(),Ve=1e-11,It=1e12,ut=1e3,od="var(",Sr=[],xi=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),cs=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],to=cs.reduce((e,t)=>({...e,[t]:t+"("}),{}),oe=()=>{},du=e=>e,fu=/\\)\\s*[-.\\d]/,pu=/(^#([\\da-f]{3}){1,2}$)|(^#([\\da-f]{4}){1,2}$)/i,gu=/rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/i,mu=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,vu=/hsl\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*\\)/i,yu=/hsla\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,so=/[-+]?\\d*\\.?\\d+(?:e[-+]?\\d)?/gi,ro=/^([-+]?\\d*\\.?\\d+(?:e[-+]?\\d+)?)([a-z]+|%)$/i,bu=/([a-z])([A-Z])/g,io=/(\\*=|\\+=|-=)/,_u=/var\\(\\s*(--[\\w-]+)(?:\\s*,\\s*([^)]+))?\\s*\\)/,js={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ut,delay:0,loopDelay:0,ease:"out(2)",composition:Je.replace,modifier:du,onBegin:oe,onBeforeUpdate:oe,onUpdate:oe,onLoop:oe,onPause:oe,onComplete:oe,onRender:oe},We={current:null,root:K},X={defaults:js,precision:4,timeScale:1,tickThreshold:200,editor:null},no={version:"4.5.0",engine:null};Dt&&(ct.AnimeJS||(ct.AnimeJS=[]),ct.AnimeJS.push(no));var wr=e=>e.replace(bu,"$1-$2").toLowerCase(),Ye=(e,t)=>e.indexOf(t)===0,Kt=Date.now,Qe=Array.isArray,je=e=>e&&e.constructor===Object,st=e=>typeof e=="number"&&!isNaN(e),Ze=e=>typeof e=="string",qe=e=>typeof e=="function",U=e=>typeof e>"u",us=e=>U(e)||e===null,kr=e=>Dt&&e instanceof SVGElement,oo=e=>pu.test(e),ao=e=>Ye(e,"rgb"),lo=e=>Ye(e,"hsl"),Su=e=>oo(e)||(ao(e)||lo(e))&&(e[e.length-1]===")"||!fu.test(e)),Es=e=>!X.defaults.hasOwnProperty(e),wu=["opacity","rotate","overflow","color"],ku=(e,t)=>{if(wu.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const s=e.parentNode;return s&&s.tagName==="filter"}return!0}},hs=e=>Ze(e)?parseFloat(e):e,ds=Math.pow,wt=Math.sqrt,Ti=Math.sin,Ci=Math.cos,kt=Math.abs,xr=Math.exp,xu=Math.ceil,Ps=Math.floor,Tu=Math.asin,co=Math.max,Tr=Math.atan2,$t=Math.PI,Ai=Math.round,Z=(e,t,s)=>e<t?t:e>s?s:e,G=(e,t)=>{if(t<0)return e;if(!t)return Ai(e);const s=10**t;return Ai(e*s)/s},fs=(e,t)=>Qe(t)?t.reduce((s,r)=>kt(r-e)<kt(s-e)?r:s):t?Ai(e/t)*t:e,Jt=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,Cr=e=>e===1/0?It:e===-1/0?-It:e,Ls=e=>e<=1e-11?Ve:Cr(G(e,11)),ot=e=>Qe(e)?[...e]:e,xt=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=U(i)?t[r]:i}return s},Ce=(e,t,s,r="_prev",i="_next")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const c=n[o];t(n),n=c}},Rt=(e,t,s="_prev",r="_next")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},Ot=(e,t,s,r="_prev",i="_next")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},Cu=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[Ys];let n=0;const o=r.length;let c;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const h=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const p=r.substring(h,n);let a=1;const f=n+1;let l=-1,g=-1;for(n++;n<o&&a>0;){const y=r.charCodeAt(n);y===40?a++:y===41?a--:y===44&&a===1&&(l===-1?l=n:g===-1&&(g=n)),n++}const m=n-1;p==="translate"||p==="translate3d"?(l===-1?i.translateX=r.substring(f,m).trim():(i.translateX=r.substring(f,l).trim(),g===-1?i.translateY=r.substring(l+1,m).trim():(i.translateY=r.substring(l+1,g).trim(),i.translateZ=r.substring(g+1,m).trim())),c=r.substring(f,m)):p==="scale"||p==="scale3d"?l===-1?i.scale=r.substring(f,m).trim():(i.scaleX=r.substring(f,l).trim(),g===-1?i.scaleY=r.substring(l+1,m).trim():(i.scaleY=r.substring(l+1,g).trim(),i.scaleZ=r.substring(g+1,m).trim())):i[p]=r.substring(f,m)}if(t==="translate3d"&&c)return s&&(s[t]=c),c;const d=i[t];if(!U(d))return s&&(s[t]=d),d}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":Ye(t,"scale")?"1":Ye(t,"rotate")||Ye(t,"skew")?"0deg":"0px"},uo=e=>{let t="";for(let s=0,r=cs.length;s<r;s++){const i=cs[s],n=e[i];if(n!==void 0){if(i==="translateX"){const o=e.translateY;if(o!==void 0){const c=e.translateZ;c!==void 0?(t+=`translate3d(${n},${o},${c}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i==="scaleX"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const c=e.scaleZ;c!==void 0?(t+=`scale3d(${n},${o},${c}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${to[i]}${n}) `}i==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Ei=[];function ho(e,t){if(!e)return null;const s=Ei.length;e:for(let r=0;r<s;r++){const i=Ei[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,c=n.length;o<c;o++){const d=n[o];if(d.detect(e)){const h=d.props[t];if(h&&(!h.gate||h.gate(e)))return h;break e}}}for(let r=0;r<s;r++){const i=Ei[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,c=n.length;o<c;o++){const d=n[o](e,t);if(d)return d}}return null}var Au=e=>{const t=gu.exec(e)||mu.exec(e),s=U(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},Eu=e=>{const t=e.length,s=t===4||t===5;return[+("0x"+e[1]+e[s?1:2]),+("0x"+e[s?2:3]+e[s?2:4]),+("0x"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+("0x"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Pi=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),Pu=e=>{const t=vu.exec(e)||yu.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=U(t[4])?1:+t[4];let o,c,d;if(r===0)o=c=d=i;else{const h=i<.5?i*(1+r):i+r-i*r,p=2*i-h;o=G(Pi(p,h,s+1/3)*255,0),c=G(Pi(p,h,s)*255,0),d=G(Pi(p,h,s-1/3)*255,0)}return[o,c,d,n]},Lu=e=>ao(e)?Au(e):oo(e)?Eu(e):lo(e)?Pu(e):[0,0,0,1],Y=(e,t)=>U(e)?t:e,fo=(e,t)=>{const s=e.match(_u),r=t[ls]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()==="")&&s[2]&&(i=s[2].trim()),i||0},Xe=(e,t,s,r,i,n)=>{if(qe(e)){if(!i){const c=e(t,s,r,n);return isNaN(+c)?c||0:+c}const o=()=>{const c=e(t,s,r,n);return isNaN(+c)?c||0:+c};return i.func=o,o()}if(Ze(e)&&Ye(e,"var(")){if(!i)return fo(e,t);const o=()=>fo(e,t);return i.func=o,o()}return e},Li=(e,t)=>e[ls]?e[ki]&&ku(e,t)?Fe.ATTRIBUTE:cs.includes(t)||xi.get(t)?Fe.TRANSFORM:Ye(t,"--")?Fe.CSS_VAR:t in e.style?Fe.CSS:t in e?Fe.OBJECT:Fe.ATTRIBUTE:Fe.OBJECT,po=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[eo]||e).getPropertyValue(t);return i==="auto"?"0":i},ps=(e,t,s,r)=>{const i=U(s)?Li(e,t):s,n=ho(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===Fe.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===Fe.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===Fe.TRANSFORM?Cu(e,t,r):i===Fe.CSS_VAR?po(e,t,r).trimStart():po(e,t,r)},gs=(e,t,s)=>s==="-"?e-t:s==="+"?e+t:e*t,Ii=()=>({t:be.NUMBER,n:0,u:null,o:null,d:null,s:null}),pt=(e,t)=>{if(t.t=be.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]==="="&&(t.o=r[0],r=r.slice(2));const i=r.includes(" ")?!1:ro.exec(r);if(i)return t.t=be.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Su(r))return t.t=be.COLOR,t.d=Lu(r),t;{const n=r.match(so);return t.t=be.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(so)||[],t}},go=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=ot(e._toNumbers),t.s=ot(e._strings),t),rt=Ii(),mo=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let c=o[0];for(let d=0,h=n.length;d<h;d++){const p=r(G(Jt(i[d],n[d],t),s)),a=o[d+1];c+=`${a?p+a:p}`,e._numbers[d]=p}return c},Ar=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,c=e.completed,d=e.iterationDuration,h=e.iterationCount,p=e._currentIteration,a=e._loopDelay,f=e._reversed,l=e._alternate,g=e._hasChildren,m=e._delay,y=e._currentTime,S=m+d,w=t-m,b=Z(y,-m,o),u=Z(w,-m,o),v=w-y,_=u>0,k=u>=o,T=o<=Ve,O=i===vt.FORCE;let L=0,R=w,I=0;if(h>1){const D=d+(k?0:a),A=~~(u/D);e._currentIteration=Z(A,0,h),k&&e._currentIteration--,L=e._currentIteration%2,R=u-A*D||0}const q=f^(l&&L),z=e._ease;let W=k?q?0:o:q?d-R:R;z&&(W=d*z(W/d)||0);const E=(n?n.backwards:w<y)?!q:!!q;if(e._currentTime=w,e._iterationTime=W,e.backwards=E,_&&!e.began?(e.began=!0,!s&&!(n&&(E||!n.began))&&e.onBegin(e)):w<=0&&(e.began=!1),!s&&!g&&_&&e._currentIteration!==p&&e.onLoop(e),O||i===vt.AUTO&&(t>=(n&&m>0?0:m)&&t<=S||t<=m&&b>m||t>=S&&b!==o)||W>=S&&b!==o||W<=m&&b>0&&!k||t<=b&&b===o&&c||k&&!c&&T){if(_&&(e.computeDeltaTime(b),s||e.onBeforeUpdate(e)),!g){const D=O||(E?v*-1:v)>=X.tickThreshold,A=G(e._offset+(n?n._offset:0)+m+W,12);let P=e._head,N,B,V,$,j=0;for(;P;){const ee=P._composition,J=P._currentTime,ve=P._changeDuration,me=P._absoluteStartTime+P._changeDuration,ue=P._nextRep,Q=P._prevRep,ne=ee!==Je.none,Oe=Q?Q._absoluteStartTime+Q._changeDuration:0,Ie=Q&&Q.parent!==P.parent,Ae=!ue||ue._isOverridden?me:ue.parent===P.parent?me+ue._delay:ue._absoluteStartTime<ue._absoluteUpdateStartTime?ue._absoluteStartTime:ue._absoluteUpdateStartTime;if((D||(J!==ve||A<=Ae||Q&&!Ie&&(!ue||ue.parent!==P.parent))&&(J!==0||A>=P._absoluteStartTime||Ie&&!P._hasFromValue&&!Q._isOverridden&&A>=Oe||ue&&!ue._isOverridden&&ue.parent===P.parent&&ue._currentTime!==0&&W<ue._startTime))&&(!Q||Ie||W>=P._startTime)&&(!ne||!P._isOverridden&&(!P._isOverlapped||A<=me)&&(!ue||ue._isOverridden||A<=Ae)&&(!Q||Q._isOverridden||(Ie?A>=P._absoluteStartTime||!P._hasFromValue&&A>=Oe:A>=Oe+P._delay)))){const Be=P._currentTime=Z(W-P._startTime,0,ve),_e=P._ease(Be/P._updateDuration),ke=P._modifier,Ee=P._valueType,Pe=P._tweenType,ae=Pe===Fe.OBJECT,le=Ee===be.NUMBER,xe=le&&ae||_e===0||_e===1?-1:X.precision;let Se,Re;if(le)Se=Re=ke(G(Jt(P._fromNumber,P._toNumber,_e),xe));else if(Ee===be.UNIT)Re=ke(G(Jt(P._fromNumber,P._toNumber,_e),xe)),Se=`${Re}${P._unit}`;else if(Ee===be.COLOR){const H=P._numbers,ce=P._fromNumbers,se=P._toNumbers,he=1-_e,ze=ce[0],Me=ce[1],ye=ce[2],Mt=se[0],nt=se[1],dt=se[2];H[0]=ke(Math.sqrt(ze*ze*he+Mt*Mt*_e)),H[1]=ke(Math.sqrt(Me*Me*he+nt*nt*_e)),H[2]=ke(Math.sqrt(ye*ye*he+dt*dt*_e)),H[3]=ke(Jt(ce[3],se[3],_e)),(!P._setter||r)&&(Se=`rgba(${G(H[0],0)},${G(H[1],0)},${G(H[2],0)},${H[3]})`)}else Ee===be.COMPLEX&&(Se=mo(P,_e,xe));if(ne&&(P._number=Re),!r&&ee!==Je.blend){const H=P.property;N=P.target,P._setter?P._setter(N,Re,P):ae?N[H]=Se:Pe===Fe.ATTRIBUTE?N.setAttribute(H,Se):(B=N.style,Pe===Fe.TRANSFORM?(N!==V&&(V=N,$=N[Ys]),$[H]=Se,j=1):Pe===Fe.CSS?B[H]=Se:Pe===Fe.CSS_VAR&&B.setProperty(H,Se)),_&&(I=1)}else P._value=Se}else J&&Q&&!Ie&&W<P._startTime&&(P._currentTime=0);j&&P._renderTransforms&&(B.transform=uo($),j=0),P=P._next}!s&&I&&e.onRender(e)}!s&&_&&e.onUpdate(e)}return n&&T?!s&&(n.began&&!E&&w>0&&!c||E&&w<=1e-11&&c)&&(e.onComplete(e),e.completed=!E):_&&k?h===1/0?e._startTime+=e.duration:e._currentIteration>=h-1&&(e.paused=!0,!c&&!g&&(e.completed=!0,!s&&!(n&&(E||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,I},ms=(e,t,s,r,i)=>{const n=e._currentIteration;if(Ar(e,t,s,r,i),e._hasChildren){const o=e,c=o.backwards,d=r?t:o._iterationTime,h=Kt();let p=0,a=!0;if(!r&&o._currentIteration!==n){const f=o.iterationDuration;Ce(o,l=>{if(!c)!l.completed&&!l.backwards&&l._currentTime<l.iterationDuration&&Ar(l,f,s,1,vt.FORCE),l.began=!1,l.completed=!1;else{const g=l.duration,m=l._offset+l._delay,y=m+g;!s&&g<=1e-11&&(!m||y===f)&&l.onComplete(l)}}),s||o.onLoop(o)}Ce(o,f=>{const l=G((d-f._offset)*f._speed,12);if(c&&l>f._delay+f.duration)return;const g=f._fps<o._fps?f.requestTick(h):i;p+=Ar(f,l,s,r,g),!f.completed&&a&&(a=!1)},c),!s&&p&&o.onRender(o),(a||c)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},vo={},Ri=(e,t,s)=>{if(s===Fe.TRANSFORM){const r=xi.get(e);return r||e}else if(s===Fe.CSS||s===Fe.ATTRIBUTE&&kr(t)&&e in t.style){const r=vo[e];if(r)return r;{const i=e&&wr(e);return vo[e]=i,i}}else return e},Er=(e,t=!1)=>{if(e._hasChildren)Ce(e,s=>Er(s,t),!0);else{const s=e;s.pause(),Ce(s,r=>{const i=r.property,n=r.target,o=r._tweenType,c=r._inlineValue,d=us(c)||c==="";if(r._setter){if(!t&&!d){if(pt(c,rt),rt.d){const h=rt.d,p=r._numbers;for(let a=0,f=h.length;a<f;a++)p[a]=h[a]}else r._number=rt.n;r._setter(r.target,r._number,r)}}else if(o===Fe.OBJECT)!t&&!d&&(n[i]=c);else if(n[ls])if(o===Fe.ATTRIBUTE)t||(d?n.removeAttribute(i):n.setAttribute(i,c));else{const h=n.style;if(o===Fe.TRANSFORM){const p=n[Ys];d?delete p[i]:p[i]=c,r._renderTransforms&&(Object.keys(p).length?h.transform=uo(p):h.removeProperty("transform"))}else d?h.removeProperty(wr(i)):h[i]=c}n[ls]&&s._tail===r&&s.targets.forEach(h=>{h.getAttribute&&h.getAttribute("style")===""&&h.removeAttribute("style")})})}return e},yo=e=>Er(e,!0),bo=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ut/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?Ve:t,r=ut/s;s>js.frameRate&&(js.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?Ve:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?vt.NONE:(this._lastTickTime=s>=t?e-s%t:e,vt.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Is={animation:null,update:oe},Iu=e=>{let t=Is.animation;return t||(t={duration:Ve,computeDeltaTime:oe,_offset:0,_delay:0,_head:null,_tail:null},Is.animation=t,Is.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,c=o===be.COMPLEX||o===be.COLOR?ot(n._fromNumbers):null;let d=n._fromNumber,h=i._tail;for(;h&&h!==n;){if(c)for(let p=0,a=h._numbers.length;p<a;p++)c[p]+=h._numbers[p];else d+=h._number;h=h._prevAdd}n._toNumber=d,n._toNumbers=c}}}),Ar(t,1,1,0,vt.FORCE)}),t},_o=Dt?requestAnimationFrame:setImmediate,Ru=Dt?cancelAnimationFrame:clearImmediate,Ou=class extends bo{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=js,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=Kt();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(Rt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):ms(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):vt.AUTO),r=i}Is.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Kt()),this.reqId=_o(So)),this}pause(){if(this.reqId)return this.paused=!0,Mu()}resume(){if(this.paused)return this.paused=!1,Ce(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(X.timeScale===1?1:ut)}set speed(e){const t=e*X.timeScale;this._speed!==t&&(this._speed=t,Ce(this,s=>s.speed=s._speed))}get timeUnit(){return X.timeScale===1?"ms":"s"}set timeUnit(e){const s=e==="s",r=s?.001:1;if(X.timeScale!==r){X.timeScale=r,X.tickThreshold=200*r;const i=s?.001:ut;this.defaults.duration*=i,this._speed*=i}}get precision(){return X.precision}set precision(e){X.precision=e}},it=(()=>{const e=new Ou(Kt());return Dt&&(no.engine=e,K.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(K.hidden?e.pause():e.resume())})),e})(),So=()=>{it._head?(it.reqId=_o(So),it.update()):it.reqId=0},Mu=()=>(Ru(it.reqId),it.reqId=0,it),Pr={_rep:new WeakMap,_add:new Map},Oi=(e,t,s="_rep")=>{const r=Pr[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Nu=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Lr=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Ve,e._currentTime=Ve},wo=(e,t)=>{const s=e._composition;if(s===Je.replace){const r=e._absoluteStartTime;Ot(t,e,Nu,"_prevRep","_nextRep");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){Lr(i);let h=i._prevRep;for(;h&&h.parent.id===n.id;)Lr(h),h=h._prevRep}const c=e._absoluteUpdateStartTime;if(o>c){const h=i._startTime,p=o-(h+i._updateDuration),a=G(c-p-h,12);i._changeDuration=a,i._currentTime=a,i._isOverlapped=1,a<1e-11&&Lr(i)}const d=e.parent.parent;if(!d||d!==n.parent){let h=!0;if(Ce(n,p=>{p._isOverlapped||(h=!1)}),h){const p=n.parent;if(p){let a=!0;Ce(p,f=>{f!==n&&Ce(f,l=>{l._isOverlapped||(a=!1)})}),a&&p.cancel()}else n.cancel()}}}}else if(s===Je.blend){const r=Oi(e.target,e.property,"_add"),i=Iu(Pr._add);let n=r._head;n||(n={...e},n._composition=Je.replace,n._updateDuration=Ve,n._startTime=0,n._numbers=ot(e._fromNumbers),n._number=0,n._next=null,n._prev=null,Ot(r,n),Ot(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=ot(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const c=ot(e._toNumbers);c.forEach((d,h)=>{e._fromNumbers[h]=n._fromNumbers[h]-d,e._toNumbers[h]=0}),n._fromNumbers=c}Ot(r,e,null,"_prevAdd","_nextAdd")}return e},ko=e=>{const t=e._composition;if(t!==Je.none){const s=e.target,r=e.property,i=Pr._rep.get(s)[r];if(Rt(i,e,"_prevRep","_nextRep"),t===Je.blend){const n=Pr._add,o=n.get(s);if(!o)return;const c=o[r],d=Is.animation;Rt(c,e,"_prevAdd","_nextAdd");const h=c._head;if(h&&h===c._tail){Rt(c,h,"_prevAdd","_nextAdd"),Rt(d,h);let p=!0;for(let a in o)if(o[a]._head){p=!1;break}p&&n.delete(s)}}}return e},xo=(e,t,s)=>{let r=!1;return Ce(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,c=i._tweenType,d=Ri(s,n,c);(!d||d&&d===o)&&(i.parent._tail===i&&i._tweenType===Fe.TRANSFORM&&i._prev&&i._prev._tweenType===Fe.TRANSFORM&&(i._prev._renderTransforms=1),Rt(t,i),ko(i),r=!0)}},!0),r},qt=(e,t,s)=>{const r=t||it;let i;if(r._hasChildren){let n=0;Ce(r,o=>{if(!o._hasChildren)if(i=xo(e,o,s),i&&!o._head)o.cancel(),Rt(r,o);else{const c=o._offset+o._delay+o.duration;c>n&&(n=c)}o._head?qt(e,o,s):o._hasChildren=!1},!0),U(r.iterationDuration)||(r.iterationDuration=n)}else i=xo(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},To=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Mi=e=>(e._cancelled&&(e._hasChildren?Ce(e,Mi):Ce(e,t=>{t._composition!==Je.none&&wo(t,Oi(t.target,t.property))}),e._cancelled=0),e),Co=0,Du=(e,t)=>e._priority>t._priority,yt=class extends bo{constructor(e={},t=null,s=0){super(0),++Co;const{id:r,delay:i,duration:n,reversed:o,alternate:c,loop:d,loopDelay:h,autoplay:p,frameRate:a,playbackRate:f,priority:l,onComplete:g,onLoop:m,onPause:y,onBegin:S,onBeforeUpdate:w,onUpdate:b}=e;We.current&&We.current.register(this);const u=t?0:it._lastTickTime,v=t?t.defaults:X.defaults,_=qe(i)||U(i)?v.delay:+i,k=qe(n)||U(n)?1/0:+n,T=Y(d,v.loop),O=Y(h,v.loopDelay);let L=T===!0||T===1/0||T<0?1/0:T+1,R=0;t?R=s:(it.reqId||it.requestTick(Kt()),R=(it._lastTickTime-it._startTime)*X.timeScale),this.id=U(r)?Co:r,this.parent=t,this.duration=Cr((k+O)*L-O)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=S||v.onBegin,this.onBeforeUpdate=w||v.onBeforeUpdate,this.onUpdate=b||v.onUpdate,this.onLoop=m||v.onLoop,this.onPause=y||v.onPause,this.onComplete=g||v.onComplete,this.iterationDuration=k,this.iterationCount=L,this._autoplay=t?!1:Y(p,v.autoplay),this._offset=R,this._delay=_,this._loopDelay=O,this._iterationTime=0,this._currentIteration=0,this._resolve=oe,this._running=!1,this._reversed=+Y(o,v.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Y(c,v.alternate),this._prev=null,this._next=null,this._lastTickTime=u,this._startTime=u,this._lastTime=u,this._fps=Y(a,v.frameRate),this._speed=Y(f,v.playbackRate),this._priority=+Y(l,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return Z(G(this._currentTime,X.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return Z(G(this._iterationTime,X.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return Z(G(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return Z(G(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*Z(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Mi(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,ms(this,0,1,~~e,vt.FORCE),To(this),this._hasChildren&&Ce(this,To),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&ms(this,this.duration,1,~~e,vt.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!U(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*it._speed);return this._startTime=Kt()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?ms(this,Ve,0,0,vt.FORCE):(this._running||(Ot(it,this,Du),it._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,it.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){Mi(this),this.completed=!1;const r=this.paused;return this.paused=!0,ms(this,e+this._delay,~~t,~~s,vt.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?Ps(It/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Ce(this,e=>e.cancel(),!0):Ce(this,ko),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=Ls(e);if(t===s)return this;const r=e/t,i=e<=Ve;return this.duration=i?Ve:s,this.iterationDuration=i?Ve:Ls(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){ms(this,0,1,0,vt.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},$u=e=>new yt(e,null,0).init();function Ni(e){const t=Ze(e)?We.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function bt(e){if(us(e))return[];if(!Dt)return Qe(e)&&e.flat(1/0)||[e];if(Qe(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!us(o)){const c=Ni(o);if(c)for(let d=0,h=c.length;d<h;d++){const p=c[d];if(!us(p)){let a=!1;for(let f=0,l=r.length;f<l;f++)if(r[f]===p){a=!0;break}a||r.push(p)}}else{let d=!1;for(let h=0,p=r.length;h<p;h++)if(r[h]===o){d=!0;break}d||r.push(o)}}}return r}const t=Ni(e);return t?Array.from(t):[e]}function Qt(e){const t=bt(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[Qn]){i[Qn]=!0;const n=kr(i);(i.nodeType||n)&&(i[ls]=!0,i[ki]=n,i[Ys]={})}}return t}var Di={deg:1,rad:180/$t,turn:360},Ao={},Ir=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===be.UNIT&&i===s)return t;const o=n+i+s,c=Ao[o];if(!U(c)&&!r)t.n=c;else{let d;if(i in Di)d=n*Di[i]/Di[s];else{const p=e.cloneNode(),a=e.parentNode,f=a&&a!==K?a:K.body;f.appendChild(p);const l=p.style;l.width=100+i;const g=p.offsetWidth||100;l.width=100+s;const m=g/(p.offsetWidth||100);f.removeChild(p),d=m*n}t.n=d,Ao[o]=d}return t.t,be.UNIT,t.u=s,t},_t=e=>e,Zs=(e=1.68)=>t=>ds(t,+e),$i={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},Bu=$t/2,Eo=$t*2,Po={"":Zs,Quad:Zs(2),Cubic:Zs(3),Quart:Zs(4),Quint:Zs(5),Sine:e=>1-Ci(e*Bu),Circ:e=>1-wt(1-e*e),Expo:e=>e?ds(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=ds(2,--s))-1)/11;);return 1/ds(4,3-s)-7.5625*ds((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=Z(+e,1,10),r=Z(+t,Ve,2),i=r/Eo*Tu(1/s),n=Eo/r;return o=>o===0||o===1?o:-s*ds(2,-10*(1-o))*Ti((1-o-i)*n)}},Ft=(()=>{const e={linear:_t,none:_t};for(let t in $i)for(let s in Po){const r=Po[s],i=$i[t];e[t+s]=s===""||s==="Back"||s==="Elastic"?(n,o)=>i(r(n,o)):i(r)}return e})(),Rr={linear:_t,none:_t},Lo=e=>{if(Rr[e])return Rr[e];if(e.indexOf("(")<=-1){const t=$i[e]||e.includes("Back")||e.includes("Elastic")?Ft[e]():Ft[e];return t?Rr[e]=t:_t}else{const t=e.slice(0,-1).split("("),s=Ft[t[0]];return s?Rr[e]=s(...t[1].split(",")):_t}},Io=["steps(","irregular(","linear(","cubicBezier("],Vt=e=>{if(Ze(e)){for(let t=0,s=Io.length;t<s;t++)if(Ye(e,Io[t]))return console.warn(`String syntax for \\`ease: "${e}"\\` has been removed from the core and replaced by importing and passing the easing function directly: \\`ease: ${e}\\``),_t}return qe(e)?e:Ze(e)?Lo(e):_t},ie=Ii(),ge=Ii(),Rs={},Or={func:null},Mr={func:null},Nr=[null],Os=[null,null],Dr={to:null},Hu=0,Ro=0,es,Bt,qu=(e,t)=>{const s={};if(Qe(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(Es);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(c=>{const d={};for(let h in c){const p=c[h];Es(h)?h===o&&(d.to=p):d[h]=p}return d})}}else{const r=Y(t.duration,X.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let c in o)if(Es(c)){let d=s[c];d||(d=s[c]=[]);const h=n*r;let p=d.length,a=d[p-1];const f={to:o[c]};let l=0;for(let g=0;g<p;g++)l+=d[g].duration;p===1&&(f.from=a.to),o.ease&&(f.ease=o.ease),f.duration=h-(p?l:0),d.push(f)}return i});for(let i in s){const n=s[i];let o;for(let c=0,d=n.length;c<d;c++){const h=n[c],p=h.ease;h.ease=o||void 0,o=p}n[0].duration||n.shift()}}return s},zt=class extends yt{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++Ro;const c=Qt(e),d=c.length,h=t.keyframes,p=h?xt(qu(h,t),t):t,{id:a,delay:f,duration:l,ease:g,playbackEase:m,modifier:y,composition:S,onRender:w}=p,b=s?s.defaults:X.defaults,u=Y(g,b.ease),v=Y(m,b.playbackEase),_=v?Vt(v):null,k=!U(u.ease),T=k?u.ease:Y(g,_?"linear":b.ease),O=k?u.settlingDuration:Y(l,b.duration),L=Y(f,b.delay),R=y||b.modifier,I=U(S)&&d>=1e3?Je.none:U(S)?b.composition:S,q=this._offset+(s?s._offset:0);k&&(u.parent=this);let z=NaN,W=NaN,E=0,D=0;for(let A=0;A<d;A++){const P=c[A],N=n||A,B=o||c;let V=NaN,$=NaN;for(let j in p)if(Es(j)){const ee=Li(P,j),J=ho(P,j),ve=Ri(j,P,ee);let me=p[j];const ue=Qe(me);if(i&&!ue&&(Os[0]=me,Os[1]=me,me=Os),ue){const Be=me.length,_e=!je(me[0]);Be===2&&_e?(Dr.to=me,Nr[0]=Dr,es=Nr):Be>2&&_e?(es=[],me.forEach((ke,Ee)=>{Ee?Ee===1?(Os[1]=ke,es.push(Os)):es.push(ke):Os[0]=ke})):es=me}else Nr[0]=me,es=Nr;let Q=null,ne=null,Oe=NaN,Ie=0,Ae=0;for(let Be=es.length;Ae<Be;Ae++){const _e=es[Ae];je(_e)?Bt=_e:(Dr.to=_e,Bt=Dr),Or.func=null,Mr.func=null;const ke=Xe(Y(Bt.composition,I),P,N,B,null,null),Ee=st(ke)?ke:Je[ke];!Q&&Ee!==Je.none&&(Q=Oi(P,ve));const Pe=Q?Q._tail:null,ae=s&&Pe&&Pe.parent.parent===s?Pe:ne,le=Xe(Bt.to,P,N,B,Or,ae);let xe;je(le)&&!U(le.to)?(Bt=le,xe=le.to):xe=le;const Se=Xe(Bt.from,P,N,B,Mr,ae),Re=Bt.ease||T,H=Xe(Re,P,N,B,null,ae),ce=qe(H)||Ze(H)?H:Re,se=!U(ce)&&!U(ce.ease),he=se?ce.ease:ce,ze=se?ce.settlingDuration:Xe(Y(Bt.duration,Be>1?Xe(O,P,N,B,null,ae)/Be:O),P,N,B,null,ae),Me=Xe(Y(Bt.delay,Ae?0:L),P,N,B,null,ae),ye=Bt.modifier||R,Mt=!U(Se),nt=!U(xe),dt=Qe(xe),vs=dt||Mt&&nt,hn=ne?Ie:0,Ds=ne?Ie+Me:Me,$s=G(q+Ds,12),Te=G(q+hn,12);!D&&(Mt||dt)&&(D=1);let te=ne;if(Ee!==Je.none){let we=Q._head;for(;we&&we._absoluteStartTime<=$s;)if(we._isOverridden||(te=we),we=we._nextRep,we&&we._absoluteStartTime>=$s)for(;we;)Lr(we),we=we._nextRep}if(vs){pt(dt?Xe(xe[0],P,N,B,Mr,ae):Se,ie),pt(dt?Xe(xe[1],P,N,B,Or,ae):xe,ge);const we=ps(P,ve,ee,Rs);ie.t===be.NUMBER&&(te?te._valueType===be.UNIT&&(ie.t=be.UNIT,ie.u=te._unit):(pt(we,rt),rt.t===be.UNIT&&(ie.t=be.UNIT,ie.u=rt.u)))}else nt?pt(xe,ge):ne?go(ne,ge):pt(s&&te&&te.parent.parent===s?te._value:ps(P,ve,ee,Rs),ge),Mt?pt(Se,ie):ne?go(ne,ie):pt(s&&te&&te.parent.parent===s?te._value:ps(P,ve,ee,Rs),ie);if(ie.o&&(ie.n=gs(te?te._toNumber:pt(ps(P,ve,ee,Rs),rt).n,ie.n,ie.o)),ge.o&&(ge.n=gs(ie.n,ge.n,ge.o)),ie.t!==ge.t){if(ie.t===be.COMPLEX||ge.t===be.COMPLEX){const we=ie.t===be.COMPLEX?ie:ge,Ue=ie.t===be.COMPLEX?ge:ie;Ue.t=be.COMPLEX,Ue.s=ot(we.s),Ue.d=we.d.map(()=>Ue.n)}else if(ie.t===be.UNIT||ge.t===be.UNIT){const we=ie.t===be.UNIT?ie:ge,Ue=ie.t===be.UNIT?ge:ie;Ue.t=be.UNIT,Ue.u=we.u}else if(ie.t===be.COLOR||ge.t===be.COLOR){const we=ie.t===be.COLOR?ie:ge,Ue=ie.t===be.COLOR?ge:ie;Ue.t=be.COLOR,Ue.d=we.d.map(()=>0)}}if(ie.u!==ge.u){let we=ge.u?ie:ge;we=Ir(P,we,ge.u?ge.u:ie.u,!1)}if(ge.d&&ie.d&&ge.d.length!==ie.d.length){const we=ie.d.length>ge.d.length?ie:ge,Ue=we===ie?ge:ie;Ue.d=we.d.map((dn,Xt)=>U(Ue.d[Xt])?0:Ue.d[Xt]),Ue.s=ot(we.s)}const Le=G(+ze||1e-11,12);let Ne=Rs[ve];us(Ne)||(Rs[ve]=null);const ti=J?J.set:null;Ie=G(Ds+Le,12);const Wt=ie.d,Gt=ge.d,et=ge.s,at={parent:this,id:Hu++,property:ve,target:P,_value:null,_toFunc:Or.func,_fromFunc:Mr.func,_ease:Vt(he),_fromNumbers:Wt?ot(Wt):Sr,_toNumbers:Gt?ot(Gt):Sr,_strings:et?ot(et):Sr,_fromNumber:ie.n,_toNumber:ge.n,_numbers:Wt?ot(Wt):Sr,_number:ie.n,_unit:ge.u,_modifier:ye,_currentTime:0,_startTime:Ds,_delay:+Me,_updateDuration:Le,_changeDuration:Le,_absoluteStartTime:$s,_absoluteUpdateStartTime:Te,_absoluteEndTime:G(q+Ie,12),_hasFromValue:Mt||dt?1:0,_tweenType:ee,_setter:ti,_valueType:ge.t,_composition:Ee,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Ne,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Ee!==Je.none&&wo(at,Q);const ys=at._valueType;if(ys===be.COMPLEX)at._value=mo(at,1,-1);else if(ys===be.UNIT)at._value=`${ye(at._toNumber)}${at._unit}`;else if(ys===be.COLOR){const we=ge.d;at._value=`rgba(${G(we[0],0)},${G(we[1],0)},${G(we[2],0)},${we[3]})`}else at._value=ye(at._toNumber);isNaN(Oe)&&(Oe=at._startTime),ne=at,E++,Ot(this,at)}(isNaN(W)||Oe<W)&&(W=Oe),(isNaN(z)||Ie>z)&&(z=Ie),ee===Fe.TRANSFORM&&(V=E-Ae,$=E)}if(!isNaN(V)){let j=0;Ce(this,ee=>{j>=V&&j<$&&(ee._renderTransforms=1,ee._composition===Je.blend&&Ce(Is.animation,J=>{J.id===ee.id&&(J._renderTransforms=1)})),j++})}}d||console.warn("No target found. Make sure the element you\'re trying to animate is accessible before creating your animation."),W?(Ce(this,A=>{A._startTime-A._delay||(A._delay-=W),A._startTime-=W}),z-=W):W=0,z||(z=Ve,this.iterationCount=0),this.targets=c,this.id=U(a)?Ro:a,this.duration=z===1e-11?Ve:Cr((z+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=w||b.onRender,this._ease=_,this._delay=W,this.iterationDuration=z,!this._autoplay&&D&&this.onRender(this)}stretch(e){const t=this.duration;if(t===Ls(e))return this;const s=e/t;return Ce(this,r=>{r._updateDuration=Ls(r._updateDuration*s),r._changeDuration=Ls(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Ce(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(pt(s(),ie),ie.u!==e._unit&&e.target[ls]&&Ir(e.target,ie,e._unit,!0),e._fromNumbers=ot(ie.d),e._fromNumber=ie.n):t&&(pt(ps(e.target,e.property,e._tweenType),rt),e._fromNumbers=ot(rt.d),e._fromNumber=rt.n),t&&(pt(t(),ge),e._toNumbers=ot(ge.d),e._strings=ot(ge.s),e._toNumber=ge.o?gs(e._fromNumber,ge.n,ge.o):ge.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Er(this)}then(e){return super.then(e)}},Ks=(e,t)=>X.editor?X.editor.addAnimation(e,t):new zt(e,t,null,0,!1).init(),Fu=(e,t)=>{if(Ye(t,"<")){const s=t[1]==="<",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},Js=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),U(t))return s;if(st(+t))return+t;const r=t,i=e?e.labels:null,n=!us(i),o=Fu(e,r),c=!U(o),d=io.exec(r);if(d){const h=d[0],p=r.split(h),a=n&&p[0]?i[p[0]]:s,f=c?o:n?a:s,l=+p[1];return gs(f,l,h[0])}else return c?o:n?U(i[r])?s:i[r]:s};function Vu(e){return Cr((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Bi(e,t,s,r,i,n){const o=st(e.duration)&&e.duration<=1e-11?s-Ve:s;t.composition&&ms(t,o,1,1,vt.AUTO);const c=r?new zt(r,e,t,o,!1,i,n):new yt(e,t,o);return t.composition&&c.init(!0),Ot(t,c),Ce(t,d=>{const h=d._offset+d._delay+d.duration;h>t.iterationDuration&&(t.iterationDuration=h)}),t.duration=Vu(t),t}var Oo=0,Mo=class extends yt{constructor(e={}){super(e,null,0),++Oo,this.id=U(e.id)?Oo:e.id,this.duration=0,this.labels={};const t=e.defaults,s=X.defaults;this.defaults=t?xt(t,s):s,this.composition=Y(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=Y(e.playbackEase,s.playbackEase);this._ease=r?Vt(r):null,this.iterationDuration=0}add(e,t,s){const r=je(t),i=je(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=X.editor&&X.editor.addTimelineChild,c=s&&s.type==="Stagger"&&X.editor,d=qe(s)?s:null;if(d||c){const h=bt(e),p=this.duration,a=this.iterationDuration,f=n.id;let l=0;const g=h.length,m=o?o(e,n,this.id,s,g):null,y=d||X.editor.resolveStagger(s.defaultValue);h.forEach(S=>{const w={...m||n};this.duration=p,this.iterationDuration=a,U(f)||(w.id=f+"-"+l);const b=Js(this,y(S,l,h,null,this));Bi(w,this,b,S,l,h),l++})}else{const h=o?o(e,n,this.id,s):n,p=s&&s.type?s.defaultValue:s;Bi(h,this,Js(this,p),e)}}else Bi(e,this,Js(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(U(e)||e&&U(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!U(e)&&!U(e.persist)&&(e.persist=!0);const r=X.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return U(t)?this:(t.duration=Ve,t.composition=Je.replace,this.add(e,t,s))}call(e,t){return U(e)||e&&!qe(e)?this:(X.editor&&X.editor.addTimelineCall&&(t=X.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return U(e)||e&&!Ze(e)?this:(X.editor&&X.editor.addTimelineLabel&&(t=X.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=Js(this,t),this)}remove(e,t){return qt(bt(e),this,t),this}stretch(e){const t=this.duration;if(t===Ls(e))return this;const s=e/t,r=this.labels;Ce(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Ce(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Ce(this,e=>e.revert,!0),Er(this)}then(e){return super.then(e)}},No=e=>X.editor?X.editor.addTimeline(e):new Mo(e).init(),Hi=class{constructor(e,t){We.current&&We.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let c=!0;for(let d in this.animations)if(!this.animations[d].paused&&c){c=!1;break}c&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(U(e)||U(t))){for(let c in t){const d=t[c];Es(c)?o[c]=d:Ye(c,"on")?n[c]=d:i[c]=d}this.callbacks=new zt({v:0},n);for(let c in o){const d=o[c],h=je(d);let p={},a="+=0";if(h){const g=d.unit;Ze(g)&&(a+=g)}else p.duration=d;p[c]=h?xt({to:a},d):a;const f=xt(i,p);f.composition=Je.replace,f.autoplay=!1;const l=this.animations[c]=new zt(e,f,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[c]=(g,m,y)=>{const S=l._head;if(U(g)&&S){const w=S._numbers;return w&&w.length?w:S._modifier(S._number)}else return Ce(l,w=>{if(Qe(g))for(let b=0,u=g.length;b<u;b++)U(w._numbers[b])||(w._fromNumbers[b]=w._modifier(w._numbers[b]),w._toNumbers[b]=g[b]);else w._fromNumber=w._modifier(w._number),w._toNumber=g;U(y)||(w._ease=Vt(y)),w._currentTime=0}),U(m)||l.stretch(m),l.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=oe,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},zu=(e,t)=>new Hi(e,t),Uu=Ss({clamp:()=>Z,damp:()=>Ku,degToRad:()=>ju,lerp:()=>Jt,mapRange:()=>Qs,padEnd:()=>Xu,padStart:()=>Gu,radToDeg:()=>Zu,round:()=>G,roundPad:()=>Wu,snap:()=>fs,wrap:()=>Yu}),Wu=(e,t)=>(+e).toFixed(t),Gu=(e,t,s)=>`${e}`.padStart(t,s),Xu=(e,t,s)=>`${e}`.padEnd(t,s),Yu=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,Qs=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),ju=e=>e*Math.PI/180,Zu=e=>e*180/Math.PI,Ku=(e,t,s,r)=>r?r===1?t:Jt(e,t,1-Math.exp(-r*s*.1)):e,gt=ut*10,$r=class{constructor(e={}){const t=!U(e.bounce)||!U(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/ut,this.maxIterations=this.maxDuration/this.timeStep/ut,this.bn=Z(Y(e.bounce,.5),-1,1),this.pd=Z(Y(e.duration,628),10*X.timeScale,gt*X.timeScale),this.m=Z(Y(e.mass,1),1,gt),this.s=Z(Y(e.stiffness,100),Ve,gt),this.d=Z(Y(e.damping,10),Ve,gt),this.v=Z(Y(e.velocity,0),-gt,gt),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||oe,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=xr(-n*t*s)*(1*Ci(r*n)+i*Ti(r*n)):t===1?n=(1+i*n)*xr(-n*s):n=((1+i)*xr((-t*s+r)*n)+(1-i)*xr((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=X.timeScale===1?this.pd/ut:this.pd;this.m=1,this.v=0,this.s=ds(2*$t/e,2),this.bn>=0?this.d=(1-this.bn)*4*$t/e:this.d=4*$t/(e*(1+this.bn)),this.s=G(Z(this.s,Ve,gt),3),this.d=G(Z(this.d,Ve,300),3)}calculateBDFromSD(){const e=2*$t/wt(this.s);this.pd=e*(X.timeScale===1?ut:1),this.d/(2*wt(this.s))<=1?this.bn=1-this.d*e/(4*$t):this.bn=4*$t/(this.d*e)-1,this.bn=G(Z(this.bn,-1,1),3),this.pd=G(Z(this.pd,10*X.timeScale,gt*X.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:c}=this,d=this.w0=Z(wt(o/i),Ve,ut),h=this.zeta=n/(2*wt(o*i));h<1?(this.wd=d*wt(1-h*h),this.b=(h*d+-c)/this.wd):h===1?(this.wd=0,this.b=-c+d):(this.wd=d*wt(h*h-1),this.b=(h*d+-c)/this.wd);let p=0,a=0,f=0;for(;a<=e&&f<=t;)kt(1-this.solve(p))<s?a++:a=0,this.solverDuration=p,p+=r,f++;this.settlingDuration=G(this.solverDuration*ut,0)*X.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=Z(Y(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=Z(Y(e,1),10*X.timeScale,gt*X.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=Z(Y(e,100),Ve,gt),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=Z(Y(e,10),Ve,gt),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=Z(Y(e,1),1,gt),this.compute()}get velocity(){return this.v}set velocity(e){this.v=Z(Y(e,0),-gt,gt),this.compute()}},Br=e=>new $r(e),Do=e=>(console.warn("createSpring() is deprecated use spring() instead"),new $r(e)),qi={_head:null,_tail:null},Fi=(e,t,s)=>{let r=qi._head,i;for(;r;){const n=r._next,o=r.$el===e,c=!t||r.property===t,d=!s||r.parent===s;if(o&&c&&d){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),Rt(qi,r);const h=r.parent;h&&(h._completed++,h.animations.length===h._completed&&(h.completed=!0,h.paused=!0,h.muteCallbacks||(h.onComplete(h),h._resolve(h))))}r=n}return i},$o=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),Fi(t,s),Ot(qi,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const c=()=>Fi(t,s,e);return n.oncancel=c,n.onremove=c,e.persist||(n.onfinish=c),n};function ts(e,t,s){const r=Qt(e);if(!r.length)return;const[i]=r,n=Li(i,t),o=Ri(t,i,n);let c=ps(i,o);if(U(s))return c;if(pt(c,rt),rt.t===be.NUMBER||rt.t===be.UNIT){if(s===!1)return rt.n;{const d=Ir(i,rt,s,!1);return`${G(d.n,X.precision)}${d.u}`}}}var Ut=(e,t)=>{if(!U(t))return X.editor&&X.editor.addSet?X.editor.addSet(e,t):(t.duration=Ve,t.composition=Y(t.composition,Je.none),new zt(e,t,null,0,!0).resume())},Bo=(e,t,s)=>{const r=bt(e);for(let i=0,n=r.length;i<n;i++)Fi(r[i],s,t&&t.controlAnimation&&t);return qt(r,t,s),r},ss=e=>{e.cancelable&&e.preventDefault()},Ju=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:oe,remove:oe}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},Qu=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==K;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform="none"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===""?e.style.removeProperty("transform"):e.style.transform=s})}},ht=(e,t)=>e&&qe(e)?e(t):e,Hr=0,Ho=class{constructor(e,t={}){if(!e)return;We.current&&We.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,c=o&&Vt(o),d=!U(o)&&!U(o.ease),h=je(s)&&!U(s.mapTo)?s.mapTo:"translateX",p=je(r)&&!U(r.mapTo)?r.mapTo:"translateY",a=ht(t.container,this);this.containerArray=Qe(a)?a:null,this.$container=a&&!this.containerArray?bt(a)[0]:K.body,this.useWin=this.$container===K.body,this.$scrollContainer=this.useWin?ct:this.$container,this.$target=je(e)?new Ju(e):bt(e)[0],this.$trigger=bt(i||e)[0],this.fixed=ts(this.$target,"position")==="fixed",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=d?o:Br({mass:Y(t.releaseMass,1),stiffness:Y(t.releaseStiffness,80),damping:Y(t.releaseDamping,20)}),this.releaseYSpring=d?o:Br({mass:Y(t.releaseMass,1),stiffness:Y(t.releaseStiffness,80),damping:Y(t.releaseDamping,20)}),this.releaseEase=c||Ft.outQuint,this.hasReleaseSpring=d,this.onGrab=t.onGrab||oe,this.onDrag=t.onDrag||oe,this.onRelease=t.onRelease||oe,this.onUpdate=t.onUpdate||oe,this.onSettle=t.onSettle||oe,this.onSnap=t.onSnap||oe,this.onResize=t.onResize||oe,this.onAfterResize=t.onAfterResize||oe,this.disabled=[0,0];const f={};if(n&&(f.modifier=n),U(s)||s===!0)f[h]=0;else if(je(s)){const l=s,g={};l.modifier&&(g.modifier=l.modifier),l.composition&&(g.composition=l.composition),f[h]=g}else s===!1&&(f[h]=0,this.disabled[0]=1);if(U(r)||r===!0)f[p]=0;else if(je(r)){const l=r,g={};l.modifier&&(g.modifier=l.modifier),l.composition&&(g.composition=l.composition),f[p]=g}else r===!1&&(f[p]=0,this.disabled[1]=1);this.animate=new Hi(this.$target,f),this.xProp=h,this.yProp=p,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-It,It,It,-It],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=Kt(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Qu(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new yt({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new yt({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!U(a),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?h:p,this.animate.callbacks.onRender=()=>{const l=this.updated,g=!(this.grabbed&&l)&&this.released,m=this.x,y=this.y,S=m-this.coords[2],w=y-this.coords[3];this.deltaX=S,this.deltaY=w,this.coords[2]=m,this.coords[3]=y,l&&(S||w)&&this.onUpdate(this),g?(this.computeVelocity(S,w),this.angle=Tr(w,S)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new yt({autoplay:!1,duration:150*X.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),je(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=Kt(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,c=this.minVelocity,d=this.maxVelocity,h=this.velocityStackIndex;n[h]=G(Z(wt(e*e+t*t)/i*o,c,d),5);const p=co(n[0],n[1],n[2]);return this.velocity=p,this.velocityStackIndex=(h+1)%3,p}setX(e,t=!1){if(this.disabled[0])return;const s=G(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=fs(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=G(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=fs(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return G(this.animate[this.xProp](),X.precision)}set x(e){this.setX(e,!1)}get y(){return G(this.animate[this.yProp](),X.precision)}set y(e){this.setY(e,!1)}get progressX(){return Qs(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(Qs(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return Qs(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(Qs(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=G(this.useWin?ct.scrollX:this.$container.scrollLeft,0),t=G(this.useWin?ct.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=ct.innerWidth,o=this.window[1]=ct.innerHeight,c=this.useWin,d=e.scrollWidth,h=e.scrollHeight,p=this.fixed,a=e.getBoundingClientRect(),[f,l,g,m]=this.containerPadding;this.dragArea[0]=c?0:a.left,this.dragArea[1]=c?0:a.top,this.scrollView[0]=c?Z(d,n,d):d,this.scrollView[1]=c?Z(h,o,h):h,this.updateScrollCoords();const{width:y,height:S,left:w,top:b,right:u,bottom:v}=e.getBoundingClientRect();this.dragArea[2]=G(c?Z(y,n,n):y,0),this.dragArea[3]=G(c?Z(S,o,o):S,0);const _=ts(e,"overflow"),k=_==="visible",T=_==="hidden";if(this.canScroll=p?!1:this.contained&&(e===K.body&&k||!T&&!k)&&(d>this.dragArea[2]+m-l||h>this.dragArea[3]+f-g)&&(!this.containerArray||this.containerArray&&!Qe(this.containerArray)),this.contained){const O=this.scroll.x,L=this.scroll.y,R=this.canScroll,I=this.$target.getBoundingClientRect(),q=R?c?0:e.scrollLeft:0,z=R?c?0:e.scrollTop:0,W=R?this.scrollView[0]-q-y:0,E=R?this.scrollView[1]-z-S:0;this.targetBounds[0]=G(I.top+L-(c?0:b),0),this.targetBounds[1]=G(I.right+O-(c?n:u),0),this.targetBounds[2]=G(I.bottom+L-(c?o:v),0),this.targetBounds[3]=G(I.left+O-(c?0:w),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+f,this.containerBounds[1]=this.containerArray[1]-l,this.containerBounds[2]=this.containerArray[2]-g,this.containerBounds[3]=this.containerArray[3]+m):(this.containerBounds[0]=-G(I.top-(p?Z(b,0,o):b)+z-f,0),this.containerBounds[1]=-G(I.right-(p?Z(u,0,n):u)-W+l,0),this.containerBounds[2]=-G(I.bottom-(p?Z(v,0,o):v)-E+g,0),this.containerBounds[3]=-G(I.left-(p?Z(w,0,n):w)+q-m,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[c,d]=this.disabled,h=!c&&t<o||!c&&t>i,p=!d&&s<r||!d&&s>n;return h&&!p?1:!h&&p?2:h&&p?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=ht(e.container,this),i=ht(e.containerPadding,this)||0,n=Qe(i)?i:[i,i,i,i],o=this.x,c=this.y,d=ht(e.cursor,this),h={onHover:"grab",onGrab:"grabbing"};if(d){const{onHover:y,onGrab:S}=d;y&&(h.onHover=y),S&&(h.onGrab=S)}const p=ht(e.dragThreshold,this),a={mouse:3,touch:7};if(st(p))a.mouse=p,a.touch=p;else if(p){const{mouse:y,touch:S}=p;U(y)||(a.mouse=y),U(S)||(a.touch=S)}this.containerArray=Qe(r)?r:null,this.$container=r&&!this.containerArray?bt(r)[0]:K.body,this.useWin=this.$container===K.body,this.$scrollContainer=this.useWin?ct:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=Y(n,[0,0,0,0]),this.containerFriction=Z(Y(ht(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=Z(Y(ht(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=ht(je(t)&&!U(t.snap)?t.snap:e.snap,this),this.snapY=ht(je(s)&&!U(s.snap)?s.snap:e.snap,this),this.scrollSpeed=Y(ht(e.scrollSpeed,this),1.5),this.scrollThreshold=Y(ht(e.scrollThreshold,this),20),this.dragSpeed=Y(ht(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?a.mouse:a.touch,this.minVelocity=Y(ht(e.minVelocity,this),0),this.maxVelocity=Y(ht(e.maxVelocity,this),50),this.velocityMultiplier=Y(ht(e.velocityMultiplier,this),1),this.cursor=d===!1?!1:h,this.updateBoundingValues();const[f,l,g,m]=this.containerBounds;this.setX(Z(o,m,l),!0),this.setY(Z(c,f,g),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[S,w,b,u]=this.containerPadding,[v,_]=this.scrollView,k=this.dragArea[2],T=this.dragArea[3],O=this.scroll.x,L=this.scroll.y,R=this.$container.scrollWidth,I=this.$container.scrollHeight,q=this.useWin?Z(R,this.window[0],R):R,z=this.useWin?Z(I,this.window[1],I):I,W=v-q,E=_-z;this.dragged&&W>0&&(this.coords[0]-=W,this.scrollView[0]=q),this.dragged&&E>0&&(this.coords[1]-=E,this.scrollView[1]=z);const D=this.scrollSpeed*10,A=this.scrollThreshold,[P,N]=this.coords,[B,V,$,j]=this.scrollBounds,ee=G(Z((N-B+S)/A,-1,0)*D,0),J=G(Z((P-V-w)/A,0,1)*D,0),ve=G(Z((N-$-b)/A,0,1)*D,0),me=G(Z((P-j+u)/A,-1,0)*D,0);if(ee||ve||me||J){const[ue,Q]=this.disabled;let ne=O,Oe=L;ue||(ne=G(Z(O+(me||J),0,v-k),0),this.coords[0]-=O-ne),Q||(Oe=G(Z(L+(ee||ve),0,_-T),0),this.coords[1]-=L-Oe),this.useWin?this.$scrollContainer.scrollBy(-(O-ne),-(L-Oe)):this.$scrollContainer.scrollTo(ne,Oe)}}const[e,t,s,r]=this.containerBounds,[i,n,o,c,d,h]=this.pointer;this.coords[0]+=(i-d)*this.dragSpeed,this.coords[1]+=(n-h)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[p,a]=this.coords,[f,l]=this.snapped,g=(1-this.containerFriction)*this.dragSpeed;this.setX(p>t?t+(p-t)*g:p<r?r+(p-r)*g:p,!1),this.setY(a>s?s+(a-s)*g:a<e?e+(a-e)*g:a,!1),this.computeVelocity(i-d,n-h),this.angle=Tr(n-c,i-o);const[m,y]=this.snapped;(m!==f&&this.snapX||y!==l&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return qt([this],null,"x"),qt([this],null,"y"),qt([this],null,"progressX"),qt([this],null,"progressY"),qt([this.scroll]),qt([this.overshootCoords]),this}scrollInView(e,t=0,s=Ft.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,c=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[d,h,p,a]=o,f=G(Z(i-d,-It,0),0),l=G(Z(r-h,0,It),0),g=G(Z(i-p,0,It),0),m=G(Z(r-a,-It,0),0);new zt(n,{x:G(n.x+(m?m-t:l?l+t:0),0),y:G(n.y+(f?f-t:g?g+t:0),0),duration:U(e)?350*X.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=c})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=Ut(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=Ft.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,c,d]=this.containerPadding,h=this.scroll.y-this.targetBounds[0]+n+t,p=this.scroll.x-this.targetBounds[1]-o-t,a=this.scroll.y-this.targetBounds[2]-c-t,f=this.scroll.x-this.targetBounds[3]+d+t,l=this.isOutOfBounds([h,p,a,f],r,i);if(l){const[g,m]=this.disabled,y=Z(fs(r,this.snapX),f,p),S=Z(fs(i,this.snapY),h,a),w=U(e)?350*X.timeScale:e;!g&&(l===1||l===3)&&this.animate[this.xProp](y,w,s),!m&&(l===2||l===3)&&this.animate[this.yProp](S,w,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type==="range")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[c,d,h,p]=this.containerBounds,a=(1-this.containerFriction)*this.dragSpeed,f=this.x,l=this.y;this.coords[0]=this.coords[2]=a?f>d?d+(f-d)/a:f<p?p+(f-p)/a:f:f,this.coords[1]=this.coords[3]=a?l>h?h+(l-h)/a:l<c?c+(l-c)/a:l:l,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const g=ts(this.$target,"zIndex",!1);Hr=(g>Hr?g:Hr)+1,this.targetStyles=Ut(this.$target,{zIndex:Hr}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=Ut(K.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,Ft.out(3)),this.onGrab(this),K.addEventListener("touchmove",this),K.addEventListener("touchend",this),K.addEventListener("touchcancel",this),K.addEventListener("mousemove",this),K.addEventListener("mouseup",this),K.addEventListener("selectstart",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],c=n-this.pointer[7];let d=e.target,h=!1,p=!1,a=!1;for(;t&&d&&d!==this.$trigger;){const f=ts(d,"overflow-y");if(f!=="hidden"&&f!=="visible"){const{scrollTop:l,scrollHeight:g,clientHeight:m}=d;if(g>m){a=!0,h=l<=3,p=l>=g-m-3;break}}d=d.parentElement}a&&(!h&&!p||h&&c<0||p&&c>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(ss(e),this.triggerStyles||(this.triggerStyles=Ut(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",ss,{passive:!1}),this.$trigger.addEventListener("touchmove",ss,{passive:!1}),this.$trigger.addEventListener("touchend",ss),(this.dragged||!this.disabled[0]&&kt(o)>this.dragThreshold||!this.disabled[1]&&kt(c)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,c]=this.pointer,[d,h,p,a]=this.containerBounds,[f,l]=this.snapped,g=this.releaseXSpring,m=this.releaseYSpring,y=this.releaseEase,S=this.hasReleaseSpring,w=this.overshootCoords,b=this.x,u=this.y,v=this.computeVelocity(s-o,r-c),_=this.angle=Tr(r-n,s-i),k=v*150,T=(1-this.releaseContainerFriction)*this.dragSpeed,O=b+Ci(_)*k,L=u+Ti(_)*k,R=O>h?h+(O-h)*T:O<a?a+(O-a)*T:O,I=L>p?p+(L-p)*T:L<d?d+(L-d)*T:L,q=this.destX=Z(G(fs(R,this.snapX),5),a,h),z=this.destY=Z(G(fs(I,this.snapY),5),d,p),W=this.isOutOfBounds(this.containerBounds,O,L);let E=0,D=0,A=y,P=y,N=0;if(w.x=b,w.y=u,!e){const V=q===h?b>h?-1:1:b<a?-1:1,$=G(b-q,0);g.velocity=t&&S?$?k*V/kt($):0:v;const{ease:j,settlingDuration:ee,restDuration:J}=g;E=b===q?0:S?ee:ee-J*X.timeScale,S&&(A=j),E>N&&(N=E)}if(!t){const V=z===p?u>p?-1:1:u<d?-1:1,$=G(u-z,0);m.velocity=e&&S?$?k*V/kt($):0:v;const{ease:j,settlingDuration:ee,restDuration:J}=m;D=u===z?0:S?ee:ee-J*X.timeScale,S&&(P=j),D>N&&(N=D)}if(!S&&W&&T&&(E||D)){const V=Je.blend;new zt(w,{x:{to:R,duration:E*.65},y:{to:I,duration:D*.65},ease:y,composition:V}).init(),new zt(w,{x:{to:q,duration:E},y:{to:z,duration:D},ease:y,composition:V}).init(),this.overshootTicker.stretch(co(E,D)).restart()}else e||this.animate[this.xProp](q,E,A),t||this.animate[this.yProp](z,D,P);this.scrollInView(N,this.scrollThreshold,y);let B=!1;q!==f&&(this.snapped[0]=q,this.snapX&&(B=!0)),z!==l&&this.snapY&&(this.snapped[1]=z,this.snapY&&(B=!0)),B&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",ss),this.$trigger.removeEventListener("touchmove",ss),this.$trigger.removeEventListener("touchend",ss),K.removeEventListener("touchmove",this),K.removeEventListener("touchend",this),K.removeEventListener("touchcancel",this),K.removeEventListener("mousemove",this),K.removeEventListener("mouseup",this),K.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=Ut(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),K.removeEventListener("touchmove",this),K.removeEventListener("touchend",this),K.removeEventListener("touchcancel",this),K.removeEventListener("mousemove",this),K.removeEventListener("mouseup",this),K.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case"mousedown":this.handleDown(e);break;case"touchstart":this.handleDown(e);break;case"mousemove":this.handleMove(e);break;case"touchmove":this.handleMove(e);break;case"mouseup":this.handleUp();break;case"touchend":this.handleUp();break;case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":ss(e)}}},eh=(e,t)=>new Ho(e,t),Vi=(e=oe)=>new yt({duration:1*X.timeScale,onComplete:e},null,0).resume(),qr=e=>{let t;return((...s)=>{let r,i,n,o,c;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,c=t._startTime,t.revert());const d=e(...s);return d&&!qe(d)&&d.revert&&(t=d),U(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=c),d||oe})},qo=class{constructor(e={}){We.current&&We.current.register(this);const t=e.root;let s=K;t&&(s=t.current||t.nativeElement||bt(t)[0]||K);const r=e.defaults,i=X.defaults,n=e.mediaQueries;if(this.defaults=r?xt(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const c=ct.matchMedia(n[o]);this.mediaQueryLists[o]=c,c.addEventListener("change",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=We.current,s=We.root,r=X.defaults;We.current=this,We.root=this.root,X.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return We.current=t,We.root=s,X.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);qe(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,qe(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);qe(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,qe(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);qe(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(qe(s))return s(this);const r=qr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type==="change"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,c=s.length,d=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;c--;)s[c].revert();for(;d--;)r[d](this);for(let h in i)i[h].removeEventListener("change",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},th=e=>new qo(e),sh=()=>{const e=K.createElement("div");K.body.appendChild(e),e.style.height="100lvh";const t=e.offsetHeight;return K.body.removeChild(e),t},Fr=(e,t)=>e&&qe(e)?e(t):e,Vr=new Map,rh=class{constructor(e){this.element=e,this.useWin=this.element===K.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new yt({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Ce(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new yt({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,c=r-n,d=i-o;this.prevScrollX=n,this.prevScrollY=o,c&&(this.backwardX=r>n),d&&(this.backwardY=i>o),this.velocity=G(s>0?Math.sqrt(c*c+d*d)/s:0,5)}}).init(),this.resizeTicker=new yt({autoplay:!1,duration:250*X.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new yt({autoplay:!1,duration:500*X.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?ct:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=G(e?ct.scrollX:t.scrollLeft,0),this.scrollY=G(e?ct.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=ct.innerWidth,this.winHeight=sh()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Ce(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Ce(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type==="scroll"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?ct:this.element).removeEventListener("scroll",this),Vr.delete(this.element)}},ih=e=>{const t=e&&bt(e)[0]||K.body;let s=Vr.get(t);return s||(s=new rh(t),Vr.set(t,s)),s},er=(e,t,s,r,i)=>{const n=t==="min",o=t==="max",{n:c,u:d}=pt(t==="top"||t==="left"||t==="start"||n?0:t==="bottom"||t==="right"||t==="end"||o?"100%":t==="center"?"50%":t,rt);let h=c;return d==="%"?h=c/100*s:d&&(h=Ir(e,rt,"px",!0).n),o&&r<0&&(h+=r),n&&i>0&&(h+=i),h},zr=(e,t,s,r,i)=>{let n;if(Ze(t)){const o=io.exec(t);if(o){const c=o[0],d=c[0],h=t.split(c),p=h[0]==="min",a=h[0]==="max",f=er(e,h[0],s,r,i),l=er(e,h[1],s,r,i);if(p){const g=gs(er(e,"min",s),l,d);n=g<f?f:g}else if(a){const g=gs(er(e,"max",s),l,d);n=g>f?f:g}else n=gs(f,l,d)}else n=er(e,t,s,r,i)}else n=t;return G(n,0)},Fo=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[ls]){t=n;break}}return t},nh=0,Vo=["#FF4B4B","#FF971B","#FFC730","#F9F640","#7AFF5A","#18FF74","#17E09B","#3CFFEC","#05DBE9","#33B3F1","#638CF9","#C563FE","#FF4FCF","#F93F8A"],zo=class{constructor(e={}){We.current&&We.current.register(this);const t=Y(e.sync,"play pause"),s=t?Vt(t):null,r=t&&(t==="linear"||t===_t),i=t&&!(s===_t&&!r),n=t&&(st(t)||t===!0||r),o=t&&Ze(t)&&!i&&!n,c=o?t.split(" ").map(h=>()=>{const p=this.linked;return p&&p[h]?p[h]():null}):null,d=o&&c.length>2;this.index=nh++,this.id=U(e.id)?this.index:e.id,this.container=ih(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!c,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=c&&!d&&c[0]?c[0]:oe,this.onSyncLeave=c&&!d&&c[1]?c[1]:oe,this.onSyncEnterForward=c&&d&&c[0]?c[0]:oe,this.onSyncLeaveForward=c&&d&&c[1]?c[1]:oe,this.onSyncEnterBackward=c&&d&&c[2]?c[2]:oe,this.onSyncLeaveBackward=c&&d&&c[3]?c[3]:oe,this.onEnter=e.onEnter||oe,this.onLeave=e.onLeave||oe,this.onEnterForward=e.onEnterForward||oe,this.onLeaveForward=e.onLeaveForward||oe,this.onEnterBackward=e.onEnterBackward||oe,this.onLeaveBackward=e.onLeaveBackward||oe,this.onUpdate=e.onUpdate||oe,this.onResize=e.onResize||oe,this.onSyncComplete=e.onSyncComplete||oe,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=Y(e.debug,!1),this._next=null,this._prev=null,Ot(this.container,this),Vi(()=>{if(!this.reverted){if(!this.target){const h=bt(e.target)[0];this.target=h||K.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!U(e)&&!U(e.persist)&&(e.persist=!0),!this._params.target)){let t;U(e.targets)?Ce(e,s=>{s.targets&&!t&&(t=Fo(s))}):t=Fo(e),this.target=t||K.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:G(Z(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=Y(Fr(e.repeat,this),!0),this.horizontal=Y(Fr(e.axis,this),"y")==="x",this.enter=Y(Fr(e.enter,this),"end start"),this.leave=Y(Fr(e.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(":scope > .animejs-onscroll-debug"),r=K.createElement("div"),i=K.createElement("div"),n=K.createElement("div"),o=Vo[this.index%Vo.length],c=e.useWin,d=c?e.winWidth:e.width,h=c?e.winHeight:e.height,p=e.scrollWidth,a=e.scrollHeight,f=this.container.width>360?320:260,l=t?0:10,g=t?10:0,m=t?24:f/2,y=t?m:15,S=t?60:m,w=t?S:y,b=t?"repeat-x":"repeat-y",u=T=>t?"0px "+T+"px":T+"px 2px",v=T=>`linear-gradient(${t?90:0}deg, ${T} 2px, transparent 1px)`,_=(T,O,L,R,I)=>`position:${T};left:${O}px;top:${L}px;width:${R}px;height:${I}px;`;r.style.cssText=`${_("absolute",l,g,t?p:f,t?f:a)}\n pointer-events: none;\n z-index: ${this.container.zIndex++};\n display: flex;\n flex-direction: ${t?"column":"row"};\n filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));\n `,i.style.cssText=`${_("sticky",0,0,t?d:m,t?m:h)}`,s||(i.style.cssText+=`background:\n ${v("#FFFF")}${u(m-10)} / 100px 100px ${b},\n ${v("#FFF8")}${u(m-10)} / 10px 10px ${b};\n `),n.style.cssText=`${_("relative",0,0,t?p:m,t?m:a)}`,s||(n.style.cssText+=`background:\n ${v("#FFFF")}${u(0)} / ${t?"100px 10px":"10px 100px"} ${b},\n ${v("#FFF8")}${u(0)} / ${t?"10px 0px":"0px 10px"} ${b};\n `);const k=[" enter: "," leave: "];this.coords.forEach((T,O)=>{const L=O>1,R=(L?0:this.offset)+T,I=O%2,q=R<w,z=R>(L?t?d:h:t?p:a)-w,W=(L?I&&!q:!I&&!q)||z,E=K.createElement("div"),D=K.createElement("div"),A=t?W?"right":"left":W?"bottom":"top",P=W?(t?S:y)+(L?t?-1:z?0:-2:t?-1:-2):t?1:0;D.innerHTML=`${this.id}${k[I]}${this.thresholds[O]}`,E.style.cssText=`${_("absolute",0,0,S,y)}\n display: flex;\n flex-direction: ${t?"column":"row"};\n justify-content: flex-${L?"start":"end"};\n align-items: flex-${W?"end":"start"};\n border-${A}: 2px solid ${o};\n `,D.style.cssText=`\n overflow: hidden;\n max-width: ${f/2-10}px;\n height: ${y};\n margin-${t?W?"right":"left":W?"bottom":"top"}: -2px;\n padding: 1px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n letter-spacing: -.025em;\n line-height: 9px;\n font-weight: 600;\n text-align: ${t&&W||!t&&!L?"right":"left"};\n white-space: pre;\n text-overflow: ellipsis;\n color: ${I?o:"rgba(0,0,0,.75)"};\n background-color: ${I?"rgba(0,0,0,.65)":o};\n border: 2px solid ${I?o:"transparent"};\n border-${t?W?"top-left":"top-right":W?"top-left":"bottom-left"}-radius: 5px;\n border-${t?W?"bottom-left":"bottom-right":W?"top-right":"bottom-right"}-radius: 5px;\n `,E.appendChild(D);let N=R-P+(t?1:0);E.style[t?"left":"top"]=`${N}px`,(L?i:n).appendChild(E)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add("animejs-onscroll-debug"),this.$debug=r,ts(e.element,"position")==="static"&&(this.debugStyles=Ut(e.element,{position:"relative "}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==K.body;){const I=ts(o,"position")==="sticky"?Ut(o,{position:"static"}):!1;o=o.parentElement,I&&(e||(e=[]),e.push(I))}const c=t.getBoundingClientRect(),d=s.scale,h=(r?c.left+s.scrollX-s.left:c.top+s.scrollY-s.top)*d,p=(r?c.width:c.height)*d,a=r?s.width:s.height,f=(r?s.scrollWidth:s.scrollHeight)-a,l=this.enter,g=this.leave;let m="start",y="end",S="end",w="start";if(Ze(l)){const I=l.split(" ");S=I[0],m=I.length>1?I[1]:m}else if(je(l)){const I=l;U(I.container)||(S=I.container),U(I.target)||(m=I.target)}else st(l)&&(S=l);if(Ze(g)){const I=g.split(" ");w=I[0],y=I.length>1?I[1]:y}else if(je(g)){const I=g;U(I.container)||(w=I.container),U(I.target)||(y=I.target)}else st(g)&&(w=g);const b=zr(t,m,p),u=zr(t,y,p),v=b+h-a,_=u+h-f,k=zr(t,S,a,v,_),T=zr(t,w,a,v,_),O=b+h-k,L=u+h-T,R=L-O;this.offset=h,this.offsetStart=O,this.offsetEnd=L,this.distance=R<=0?0:R,this.thresholds=[m,y,S,w],this.coords=[b,u,k,T],e&&e.forEach(I=>I.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,c=this.scroll,d=c<=this.offsetStart,h=c>=this.offsetEnd,p=!d&&!h,a=c===this.offsetStart||c===this.offsetEnd,f=!this.hasEntered&&a,l=this._debug&&this.$debug;let g=!1,m=!1,y=this.progress;if(d&&this.began&&(this.began=!1),y>0&&!this.began&&(this.began=!0),i){const S=e.progress;if(r&&st(r)){if(r<1){const w=S<y&&y===1?1e-4:S>y&&!y?-1e-4:0;y=G(Jt(S,y,Jt(.01,.2,r))+w,6)}}else s&&(y=s(y));g=y!==this.prevProgress,m=S===1,g&&!m&&r&&S&&o.wakeTicker.restart()}if(l){const S=n?o.scrollY:o.scrollX;l.style[n?"top":"left"]=S+10+"px"}(p&&!this.isInView||f&&!this.forceEnter&&!this.hasEntered)&&(p&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(l&&p&&(l.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,f&&(this.forceEnter=!0)):p&&(this.forceEnter=!1)),(p||!p&&this.isInView)&&(g=!0),g&&(i&&e.seek(e.duration*y),this.onUpdate(this)),!p&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(m=!0)),y>=1&&this.began&&!this.completed&&(t&&m||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),y<1&&this.completed&&(this.completed=!1),this.prevProgress=y}revert(){if(this.reverted)return;const e=this.container;return Rt(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},oh=(e={})=>new zo(e),Uo=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,ah=(e,t,s)=>{let r=0,i=1,n,o,c=0;do o=r+(i-r)/2,n=Uo(o,t,s)-e,n>0?i=o:r=o;while(kt(n)>1e-7&&++c<100);return o},Wo=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?_t:i=>i===0||i===1?i:Uo(ah(i,e,s),t,r),Go=(e=10,t)=>{const s=t?xu:Ps;return r=>s(Z(r,0,1)*e)*(1/e)},zi=(...e)=>{const t=e.length;if(!t)return _t;const s=t-1,r=e[0],i=e[s],n=[0],o=[hs(r)];for(let c=1;c<s;c++){const d=e[c],h=Ze(d)?d.trim().split(" "):[d],p=h[0],a=h[1];n.push(U(a)?c/s:hs(a)/100),o.push(hs(p))}return o.push(hs(i)),n.push(1),function(d){for(let h=1,p=n.length;h<p;h++){const a=n[h];if(d<=a){const f=n[h-1],l=o[h-1];return l+(o[h]-l)*(d-f)/(a-f)}}return o[o.length-1]}},Xo=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,c=o+((i+1)/r-o)*Math.random(),d=o*(1-t)+c*t;s.push(Z(d,n,1))}return s.push(1),zi(...s)},lh=Ss({Spring:()=>$r,createSpring:()=>Do,cubicBezier:()=>Wo,eases:()=>Ft,irregular:()=>Xo,linear:()=>zi,spring:()=>Br,steps:()=>Go}),Ur=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(G(e(r/t),4));return`linear(${s.join(", ")})`},Yo={},jo=e=>{let t=Yo[e];if(t)return t;if(t="linear",Ze(e)){if(Ye(e,"linear")||Ye(e,"cubic-")||Ye(e,"steps")||Ye(e,"ease"))t=e;else if(Ye(e,"cubicB"))t=wr(e);else{const s=Lo(e);qe(s)&&(t=s===_t?"linear":Ur(s))}Yo[e]=t}else if(qe(e)){const s=Ur(e);s&&(t=s)}else e.ease&&(t=Ur(e.ease));return t},Zo=["x","y","z"],ch=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...Zo],uh=[...Zo,...cs.filter(e=>["X","Y","Z"].some(t=>e.endsWith(t)))],Ui=null,tr=(e,t,s,r,i)=>{let n=Ze(t)?t:Xe(t,s,r,i,null,null);return st(n)?ch.includes(e)||Ye(e,"translate")?`${n}px`:Ye(e,"rotate")||Ye(e,"skew")?`${n}deg`:`${n}`:n},Ko=(e,t,s,r,i,n)=>{let o="0";const c=U(r)?getComputedStyle(e)[t]:tr(t,r,e,i,n);return U(s)?o=Qe(r)?r.map(d=>tr(t,d,e,i,n)):c:o=[tr(t,s,e,i,n),c],o},Jo=class{constructor(e,t){We.current&&We.current.register(this),us(Ui)&&(Dt&&(U(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"))?Ui=!1:(cs.forEach(f=>{const l=Ye(f,"skew"),g=Ye(f,"scale"),m=Ye(f,"rotate"),y=Ye(f,"translate"),S=m||l,w=S?"<angle>":g?"<number>":y?"<length-percentage>":"*";try{CSS.registerProperty({name:"--"+f,syntax:w,inherits:!1,initialValue:y?"0px":S?"0deg":g?"1":"0"})}catch{}}),Ui=!0));const s=Qt(e);s.length||console.warn("No target found. Make sure the element you\'re trying to animate is accessible before creating your animation.");const r=Y(t.autoplay,X.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,c=Y(t.loop,X.defaults.loop),d=c===!0||c===1/0?1/0:st(c)?c+1:1,h=n?o?"alternate-reverse":"alternate":o?"reverse":"normal",p="both",a=X.timeScale===1?1:ut;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||X.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=Y(t.persist,X.defaults.persist),this.autoplay=r,this._speed=Y(t.playbackRate,X.defaults.playbackRate),this._resolve=oe,this._completed=0,this._inlineStyles=[],s.forEach((f,l)=>{const g=f[Ys],m=uh.some(L=>t.hasOwnProperty(L)),y=f.style,S=this._inlineStyles[l]={},w=Y(t.ease,X.defaults.ease),b=Xe(w,f,l,s,null,null),u=qe(b)||Ze(b)?b:w,v=w.ease&&w,_=jo(u),k=(v?v.settlingDuration:Xe(Y(t.duration,X.defaults.duration),f,l,s,null,null))*a,T=Xe(Y(t.delay,X.defaults.delay),f,l,s,null,null)*a,O=Y(t.composition,"replace");for(let L in t){if(!Es(L))continue;const R={},I={iterations:d,direction:h,fill:p,easing:_,duration:k,delay:T,composite:O},q=t[L],z=m?cs.includes(L)?L:xi.get(L):!1,W=z?"transform":L;S[W]||(S[W]=y[W]);let E;if(je(q)){const D=q,A=Y(D.ease,_),P=A.ease&&A,N=D.to,B=D.from;if(I.duration=(P?P.settlingDuration:Xe(Y(D.duration,k),f,l,s,null,null))*a,I.delay=Xe(Y(D.delay,T),f,l,s,null,null)*a,I.composite=Y(D.composition,O),I.easing=jo(A),E=Ko(f,L,B,N,l,s),z?(R[`--${z}`]=E,g[z]=E):R[L]=Ko(f,L,B,N,l,s),$o(this,f,L,R,I),!U(B))if(!z)y[L]=R[L][0];else{const V=`--${z}`;y.setProperty(V,R[V][0])}}else E=Qe(q)?q.map(D=>tr(L,D,f,l,s)):tr(L,q,f,l,s),z?(R[`--${z}`]=E,g[z]=E):R[L]=E,$o(this,f,L,R,I)}if(m){let L="";for(let R in g)L+=`${to[R]}var(--${R})) `;y.transform=L}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Ze(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=X.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(X.timeScale===1?1:ut);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach("commitStyles")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach("cancel"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform==="none"&&e.style.removeProperty("transform")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];U(n)||n===""?s.removeProperty(wr(i)):e.style[i]=n}e.getAttribute("style")===""&&e.removeAttribute("style")}),this}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Qo={animate:(e,t)=>new Jo(e,t),convertEase:Ur},hh=0,dh=0,Wr=(e,t)=>!e||!t?!1:e===t||e.contains(t),Ms=e=>{if(!e)return null;const t=e.style,s=t.transition||"";return t.setProperty("transition","none","important"),s},Gr=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty("transition")},fh=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,Ms(s)),r&&!t.has(r)&&t.set(r,Ms(r))},Xr=e=>{e.forEach((t,s)=>Gr(s,t)),e.clear()},ph={display:"none",visibility:"hidden",opacity:"0",transform:"none",position:"static"},gh=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},ea=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${dh++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:"none",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},ta=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,c=e.properties,d=e.state.rootNode,h=e.parentNode,p=s.transform,a=i.style.transform,f=h?h.measuredIsRemoved:!1,l=s.position;o&&(e.layout.absoluteCoords=l==="fixed"||l==="absolute"),e.$measure=t,e.inlineTransforms=a,e.hasTransform=p&&p!=="none",e.measuredIsInsideRoot=Wr(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=l,e.measuredHasDisplayNone=s.display==="none",e.measuredHasVisibilityHidden=s.visibility==="hidden",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||f;let g=!1,m=i.previousSibling;for(;m&&(m.nodeType===Node.COMMENT_NODE||m.nodeType===Node.TEXT_NODE&&!m.textContent.trim());)m=m.previousSibling;if(m&&m.nodeType===Node.TEXT_NODE)g=!0;else{for(m=i.nextSibling;m&&(m.nodeType===Node.COMMENT_NODE||m.nodeType===Node.TEXT_NODE&&!m.textContent.trim());)m=m.nextSibling;g=m!==null&&m.nodeType===Node.TEXT_NODE}if(e.isInlined=g,e.hasTransform&&!r){const _=e.layout.transitionMuteStore;_.get(i)||(e.inlineTransition=Ms(i)),t===i?i.style.transform="none":(_.get(t)||(e.measuredInlineTransition=Ms(t)),e.measuredInlineTransform=t.style.transform,t.style.transform="none")}let y=0,S=0,w=0,b=0;if(!r){const _=t.getBoundingClientRect();y=_.left,S=_.top,w=_.width,b=_.height}for(let _ in c){const k=_==="transform"?p:s[_]||s.getPropertyValue&&s.getPropertyValue(_);U(k)||(c[_]=k)}c.left=y,c.top=S,c.clientLeft=r?0:t.clientLeft,c.clientTop=r?0:t.clientTop;let u,v;if(o)e.layout.absoluteCoords?(u=y,v=S):(u=0,v=0);else{const _=h||d,k=_.properties.left,T=_.properties.top,O=_.properties.clientLeft,L=_.properties.clientTop;if(e.layout.absoluteCoords)u=y-k-O,v=S-T-L;else if(_===d){const R=d.properties.left,I=d.properties.top,q=d.properties.clientLeft,z=d.properties.clientTop;u=y-R-q,v=S-I-z}else u=y-k-O,v=S-T-L}return c.x=u,c.y=v,c.width=w,c.height=b,e},sa=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},sr=(e,t)=>{const s=Xe(t.ease,e.$el,e.index,e.targets,null,null),r=qe(s)?s:t.ease,i=!U(r)&&!U(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Xe(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Xe(t.delay,e.$el,e.index,e.targets,null,null)},mh=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||"")})},ra=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==""?t[n]=o:(t[n]="",t.removeProperty(n))}},vh=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform==="none"||t&&t==="none"?s.removeProperty("transform"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==""?i.transform=n:i.removeProperty("transform")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(Gr(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(Gr(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},ia=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty("display"),e.$el.style.removeProperty("visibility"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty("display"),e.$measure.style.removeProperty("visibility"))),e.layout.pendingRemoval.delete(e.$el)},Wi=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),na=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute("data-layout-id"),e.$measure.removeAttribute("data-layout-id")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,Ms(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||kr(o))continue;const c=n?n.measuredIsRemoved:!1,d=c?ph:getComputedStyle(o),h=c?!0:d.display==="none",p=c?!0:d.visibility==="hidden",a=!h&&!p,f=o.dataset.layoutId,l=Wr(r,o);let g=f?this.nodes.get(f):null;if(g&&g.$el!==o){const y=Wr(r,g.$el),S=g.measuredIsVisible,w=!y&&(l||!l&&!S&&a),b=y&&!S&&a;if(w)gh(g),g=ea(o,n,this,g);else if(b){ta(g,o,d,c);let u=o.lastElementChild;for(;u;)s.push(u,g),u=u.previousElementSibling;i||(i=g);continue}else{let u=o.lastElementChild;for(;u;)s.push(u,n),u=u.previousElementSibling;i||(i=g);continue}}else g=ea(o,n,this,g);g.branchAdded=!1,g.branchRemoved=!1,g.branchNotRendered=!1,g.isTarget=!1,g.sizeChanged=!1,g.hasVisibilityHidden=p,g.hasDisplayNone=h,g.hasVisibilitySwap=p&&!g.measuredHasVisibilityHidden||h&&!g.measuredHasDisplayNone,this.nodes.set(g.id,g),g.parentNode=n||null,g._prev=null,g._next=null,n?(this.rootNodes.delete(g),n._head?(n._tail._next=g,g._prev=n._tail,n._tail=g):(n._head=g,n._tail=g)):this.rootNodes.add(g),ta(g,g.$el,d,c);let m=o.lastElementChild;for(;m;)s.push(m,g),m=m.previousElementSibling;i||(i=g)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=Qe(t)?t:[t],i=[],n=t==="*"?s:We.root,o=[];let c=s.parentElement;for(;c&&c.nodeType===1;){const m=getComputedStyle(c);if(m.transform&&m.transform!=="none"){const y=c.style.transform||"",S=Ms(c);o.push(c,y,S),c.style.transform="none"}c=c.parentElement}for(let m=0,y=r.length;m<y;m++){const S=r[m];i[m]=Ze(S)?n.querySelectorAll(S):S}const d=Qt(i);this.nodes.clear(),this.rootNodes.clear();const h=this.registerElement(s,null);h.isTarget=!0,this.rootNode=h;const p=new Set;let a=0;const f=[];this.nodes.forEach(m=>{f.push(m.$el)}),this.nodes.forEach((m,y)=>{m.index=a++,m.targets=f,m&&m.measuredIsInsideRoot&&p.add(y)});const l=new Set,g=[];for(let m=0,y=d.length;m<y;m++){const S=d[m];if(!(!S||S.nodeType!==1||S===s)){if(!Wr(s,S)){const w=S.dataset.layoutId;if(!w||!p.has(w))continue}l.has(S)||(l.add(S),g.push(S))}}for(let m=0,y=g.length;m<y;m++)this.ensureDetachedNode(g[m],l);for(let m=0,y=d.length;m<y;m++){const S=d[m],w=this.getNode(S);if(w){let b=w;for(;b&&!b.isTarget;)b.isTarget=!0,b=b.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(vh);for(let m=0,y=o.length;m<y;m+=3){const S=o[m],w=o[m+1],b=o[m+2];w&&w!==""?S.style.transform=w:S.style.removeProperty("transform"),Gr(S,b)}return this}};function Ns(e){const t={},s={};for(let r in e){const i=e[r],n=r==="ease";r==="duration"||r==="delay"||n?s[r]=i:t[r]=i}return[t,s]}var oa=class{constructor(e,t={}){We.current&&We.current.register(this);const s=Ns(t.swapAt),r=Ns(t.enterFrom),i=Ns(t.leaveTo),n=t.properties;if(t.duration=Y(t.duration,350),t.delay=Y(t.delay,0),t.ease=Y(t.ease,"inOut(3.5)"),this.params=t,this.root=Qt(e)[0],this.id=t.id||hh++,this.children=t.children||"*",this.absoluteCoords=!1,this.swapAtParams=xt(t.swapAt||{opacity:0},{ease:"inOut(1.75)"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set(["opacity","fontSize","color","backgroundColor","borderRadius","border","filter","clipPath"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,c=n.length;o<c;o++)this.properties.add(n[o]);this.recordedProperties=new Set(["display","visibility","translate","position","left","top","marginLeft","marginTop","width","height","maxWidth","maxHeight","minWidth","minHeight"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new na(this),this.newState=new na(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),Xr(this.transitionMuteStore)}revert(){return this.root.classList.remove("is-animated"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>Xr(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(ra),this}animate(e={}){const t={ease:Y(e.ease,this.params.ease),delay:Y(e.delay,this.params.delay),duration:Y(e.duration,this.params.duration)},s={id:this.id},r=Y(e.onComplete,this.params.onComplete),i=Y(e.onPause,this.params.onPause);for(let E in js)E!=="ease"&&E!=="duration"&&E!=="delay"&&(U(e[E])?U(this.params[E])||(s[E]=this.params[E]):s[E]=e[E]);s.onComplete=()=>{const E=e.autoplay,D=X.editor;if(E&&E.linked||D&&D.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),m.forEachRootNode(A=>{ia(A),ra(A)});for(let A=0,P=k.length;A<P;A++){const N=k[A];N.style.transform=m.getComputedValue(N,"transform")}this.root.classList.contains("is-animated")&&(this.root.classList.remove("is-animated"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains("is-animated")||Xr(this.transitionMuteStore)})},s.onPause=()=>{const E=e.autoplay;if(E&&E.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains("is-animated")&&(this.transformAnimation&&this.transformAnimation.cancel(),m.forEachRootNode(ia),this.root.classList.remove("is-animated"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=xt(xt(e.swapAt||{},this.swapAtParams),t),o=xt(xt(e.enterFrom||{},this.enterFromParams),t),c=xt(xt(e.leaveTo||{},this.leaveToParams),t),[d,h]=Ns(n),[p,a]=Ns(o),[f,l]=Ns(c),g=this.oldState,m=this.newState,y=this.animating,S=this.swapping,w=this.entering,b=this.leaving,u=this.pendingRemoval;y.length=S.length=w.length=b.length=0,g.forEachRootNode(fh),m.record(),m.forEachRootNode(mh);const v=[],_=[],k=[],T=[],O=m.rootNode,L=O.$el;m.forEachRootNode(E=>{const D=E.$el,A=E.id,P=E.parentNode,N=P?P.branchAdded:!1,B=P?P.branchRemoved:!1,V=P?P.branchNotRendered:!1;let $=g.nodes.get(A);const j=!$;j?($=Wi(E,{},g),g.nodes.set(A,$),$.measuredIsRemoved=!0):$.measuredIsRemoved&&!E.measuredIsRemoved&&(Wi(E,$,g),$.measuredIsRemoved=!0);const ee=$.parentNode,J=(ee?ee.id:null)!==(P?P.id:null),ve=$.$el!==E.$el,me=$.measuredIsRemoved,ue=E.measuredIsRemoved;if(!$.measuredIsRemoved&&!ue&&!j&&(J||ve)){const ke=$.properties.left,Ee=$.properties.top,Pe=P||m.rootNode,ae=Pe.id?g.nodes.get(Pe.id):null,le=ae?ae.properties.left:Pe.properties.left,xe=ae?ae.properties.top:Pe.properties.top,Se=ae?ae.properties.clientLeft:Pe.properties.clientLeft,Re=ae?ae.properties.clientTop:Pe.properties.clientTop;$.properties.x=ke-le-Se,$.properties.y=Ee-xe-Re}E.hasVisibilitySwap&&(E.hasVisibilityHidden&&(E.$el.style.visibility="visible",E.$measure.style.visibility="hidden"),E.hasDisplayNone&&(E.$el.style.display=$.measuredDisplay||E.measuredDisplay||"",E.$measure.style.visibility="hidden"));const Q=u.has(D),ne=$.measuredIsVisible,Oe=E.measuredIsVisible,Ie=!ne&&Oe&&!V,Ae=!ue&&(me||Q)&&!N,Be=ue&&!me&&!B,_e=Be||ue&&Q&&!B;E.branchAdded=N||Ae,E.branchRemoved=B||_e,E.branchNotRendered=V||ue,ue&&ne&&(E.$el.style.display=$.measuredDisplay,E.$el.style.visibility="visible",Wi($,E,m)),Be?(E.isTarget&&(b.push(D),E.isLeaving=!0),u.add(D)):!ue&&Q&&u.delete(D),Ae&&!V||Ie?(sa($,p),E.isTarget&&(w.push(D),E.isEntering=!0)):_e&&!V&&sa(E,f),E!==O&&E.isTarget&&!E.isEntering&&!E.isLeaving&&y.push(D),v.push(D)});let R=0,I=0,q=0;m.forEachRootNode(E=>{const D=E.$el,A=E.parentNode,P=g.nodes.get(E.id),N=E.properties,B=P.properties;let V=A!==O&&A;for(;V&&!V.isTarget&&V!==O;)V=V.parentNode;E===O?(E.index=0,E.targets=y,sr(E,t)):E.isEntering?(E.index=V?V.index:R,E.targets=V?y:w,sr(E,a),R++):E.isLeaving?(E.index=V?V.index:I,E.targets=V?y:b,I++,sr(E,l)):E.isTarget?(E.index=q++,E.targets=y,sr(E,t)):(E.index=V?V.index:0,E.targets=y,sr(E,h)),P.index=E.index,P.targets=E.targets;for(let J in N)N[J]=Xe(N[J],D,E.index,E.targets,null,null),B[J]=Xe(B[J],D,P.index,P.targets,null,null);const $=1,j=Math.abs(N.width-B.width)>$,ee=Math.abs(N.height-B.height)>$;if(E.sizeChanged=j||ee,E.isTarget&&(!E.measuredIsRemoved&&P.measuredIsVisible||E.measuredIsRemoved&&E.measuredIsVisible)){(N.transform!=="none"||B.transform!=="none")&&(E.hasTransform=!0,k.push(D));for(let J in N)if(J!=="transform"&&N[J]!==B[J]){_.push(D);break}}E.isTarget||(S.push(D),E.sizeChanged&&A&&A.isTarget&&A.sizeChanged&&(d.transform&&(E.hasTransform=!0,k.push(D)),T.push(D)))});const z={delay:E=>m.getNode(E).delay,duration:E=>m.getNode(E).duration,ease:E=>m.getNode(E).ease};if(s.defaults=z,this.timeline=No(s),!_.length&&!k.length&&!S.length)return Xr(this.transitionMuteStore),this.timeline.complete();if(v.length){this.root.classList.add("is-animated");for(let E=0,D=v.length;E<D;E++){const A=v[E],P=A.dataset.layoutId,N=g.nodes.get(P),B=m.nodes.get(P),V=N.properties;B.isInlined||((N.measuredDisplay==="grid"||B.measuredDisplay==="grid")&&A.style.setProperty("display","block","important"),(A!==L||this.absoluteCoords)&&(A.style.position=this.absoluteCoords?"fixed":"absolute",A.style.left="0px",A.style.top="0px",A.style.marginLeft="0px",A.style.marginTop="0px",A.style.translate=`${V.x}px ${V.y}px`),A===L&&B.measuredPosition==="static"&&(A.style.position="relative",A.style.left="0px",A.style.top="0px")),A.style.width=`${V.width}px`,A.style.height=`${V.height}px`,A.style.minWidth="auto",A.style.minHeight="auto",A.style.maxWidth="none",A.style.maxHeight="none"}(g.scrollX!==window.scrollX||g.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(g.scrollX,g.scrollY));for(let E=0,D=_.length;E<D;E++){const A=_[E],P=A.dataset.layoutId,N=g.nodes.get(P),B=m.nodes.get(P),V=N.properties,$=B.properties;let j=!1;const ee={composition:"none"};V.width!==$.width&&(ee.width=[V.width,$.width],j=!0),V.height!==$.height&&(ee.height=[V.height,$.height],j=!0),!B.hasTransform&&!B.isInlined&&(ee.translate=[`${V.x}px ${V.y}px`,`${$.x}px ${$.y}px`],j=!0),this.properties.forEach(J=>{const ve=V[J],me=$[J];J!=="transform"&&ve!==me&&(ee[J]=[ve,me],j=!0)}),j&&this.timeline.add(A,ee,0)}}if(S.length){for(let E=0,D=S.length;E<D;E++){const A=S[E],P=g.getNode(A),N=P.properties;A.style.width=`${N.width}px`,A.style.height=`${N.height}px`,A.style.minWidth="auto",A.style.minHeight="auto",A.style.maxWidth="none",A.style.maxHeight="none",P.isInlined||(A.style.translate=`${N.x}px ${N.y}px`),this.properties.forEach(B=>{B!=="transform"&&(A.style[B]=`${g.getComputedValue(A,B)}`)})}for(let E=0,D=S.length;E<D;E++){const A=S[E],P=m.getNode(A),N=P.properties;this.timeline.call(()=>{A.style.width=`${N.width}px`,A.style.height=`${N.height}px`,A.style.minWidth="auto",A.style.minHeight="auto",A.style.maxWidth="none",A.style.maxHeight="none",P.isInlined||(A.style.translate=`${N.x}px ${N.y}px`),this.properties.forEach(B=>{B!=="transform"&&(A.style[B]=`${m.getComputedValue(A,B)}`)})},P.delay+P.duration/2)}if(T.length){const E=Vt(m.nodes.get(T[0].dataset.layoutId).ease),D=P=>1-E(1-P),A={};if(d)for(let P in d)P!=="transform"&&(A[P]=[{from:N=>g.getComputedValue(N,P),to:d[P]},{from:d[P],to:N=>m.getComputedValue(N,P),ease:D}]);this.timeline.add(T,A,0)}}const W=k.length;if(W){for(let E=0;E<W;E++){const D=k[E],A=m.getNode(D);A.isInlined||(D.style.translate=`${g.getComputedValue(D,"x")}px ${g.getComputedValue(D,"y")}px`),D.style.transform=g.getComputedValue(D,"transform"),T.includes(D)&&(A.ease=Xe(n.ease,D,A.index,A.targets,null,null),A.duration=Xe(n.duration,D,A.index,A.targets,null,null))}this.transformAnimation=Qo.animate(k,{translate:E=>m.getNode(E).isInlined?"0px 0px":`${m.getComputedValue(E,"x")}px ${m.getComputedValue(E,"y")}px`,transform:E=>{const D=m.getComputedValue(E,"transform");if(!T.includes(E))return D;const A=g.getComputedValue(E,"transform"),P=m.getNode(E);return[A,Xe(d.transform,E,P.index,P.targets,null,null),D]},autoplay:!1,...z}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},yh=(e,t)=>new oa(e,t),Tt=Uu,Yr={},bh=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),aa=e=>(...t)=>{const s=e(...t);return new Proxy(oe,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(Yr[i])return aa((...n)=>{const o=Yr[i](...n);return c=>o(s(c))})}})},Ct=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?aa(bh(t,s)):t)(...i);return Yr[e]||(Yr[e]=r),r},la=Ct("roundPad",Tt.roundPad),ca=Ct("padStart",Tt.padStart),ua=Ct("padEnd",Tt.padEnd),ha=Ct("wrap",Tt.wrap),da=Ct("mapRange",Tt.mapRange),fa=Ct("degToRad",Tt.degToRad),pa=Ct("radToDeg",Tt.radToDeg),ga=Ct("snap",Tt.snap),ma=Ct("clamp",Tt.clamp),va=Ct("round",Tt.round),ya=Ct("lerp",Tt.lerp,1),ba=Ct("damp",Tt.damp,1),rr=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},_h=0,ir=(e,t=0,s=1,r=0)=>{let i=e===void 0?_h++:e;return(n=t,o=s,c=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const d=10**c;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/d)+n)*d)/d}},_a=e=>e[rr(0,e.length-1)],Gi=(e,t=rr)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},nr=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,c=t.reversed,d=t.ease,h=!U(d),p=h&&!U(d.ease)?d.ease:h?Vt(d):null,a=t.grid,f=a===!0,l=t.axis,g=t.total,m=U(o)||o===0||o==="first",y=o==="center",S=o==="last",w=o==="random",b=Qe(o),u=Qe(e),v=t.use,_=hs(u?e[0]:e),k=u?hs(e[1]):0,T=ro.exec((u?e[1]:e)+""),O=t.start||0+(u?_:0),L=t.seed,R=!U(L)&&L!==!1?ir(L===!0?0:L):rr,I=t.jitter,q=!U(I),z=Qe(I),W=z?I[0]:I||0,E=z?I[1]:I||0;let D=m?0:st(o)?o:0;return(A,P,N,B,V)=>{const[$]=Qt(A),j=U(g)?N.length:g,ee=U(v)?!1:qe(v)?v($,P,j):ps($,v),J=st(ee)||Ze(ee)&&st(+ee)?+ee:P,ve=J>=0&&J<j?J:P;if(y&&(D=(j-1)/2),S&&(D=j-1),!s.length){if(f){let Q=!0,ne=!1,Oe=1/0,Ie=1/0,Ae=1/0,Be=-1/0,_e=-1/0,ke=-1/0;const Ee=[],Pe=[],ae=[];for(let le=0;le<j;le++){const xe=N[le];let Se=0,Re=0,H=0,ce=!1;if(xe&&qe(xe.getBoundingClientRect)){const se=xe.getBoundingClientRect();Se=se.left+se.width/2,Re=se.top+se.height/2,ce=!0}else{const se=xe;se&&st(se.x)&&st(se.y)&&(Se=se.x,Re=se.y,st(se.z)&&(H=se.z,ne=!0),ce=!0)}if(!ce){Q=!1;break}Ee.push(Se),Pe.push(Re),ae.push(H),Se<Oe&&(Oe=Se),Re<Ie&&(Ie=Re),H<Ae&&(Ae=H),Se>Be&&(Be=Se),Re>_e&&(_e=Re),H>ke&&(ke=H)}if(Q){let le=Ee[0],xe=Pe[0],Se=ae[0];b?(le=Oe+o[0]*(Be-Oe),xe=Ie+o[1]*(_e-Ie),Se=ne?Ae+(o.length>=3?o[2]:.5)*(ke-Ae):0):y?(le=(Oe+Be)/2,xe=(Ie+_e)/2,Se=(Ae+ke)/2):S?(le=Ee[j-1],xe=Pe[j-1],Se=ae[j-1]):st(o)&&(le=Ee[o],xe=Pe[o],Se=ae[o]);for(let H=0;H<j;H++){const ce=le-Ee[H],se=xe-Pe[H],he=Se-ae[H];let ze=wt(ce*ce+se*se+(ne?he*he:0));l==="x"&&(ze=-ce),l==="y"&&(ze=-se),l==="z"&&(ze=-he),s.push(ze)}let Re=1/0;for(let H=0;H<j;H++){const ce=kt(s[H]);ce>0&&ce<Re&&(Re=ce)}if(Re>0&&Re<1/0)for(let H=0;H<j;H++)s[H]=s[H]/Re}else for(let le=0;le<j;le++)s.push(kt(D-le))}else for(let Q=0;Q<j;Q++)if(!a)s.push(kt(D-Q));else{const ne=a.length,Oe=a[0]*a[1];let Ie,Ae,Be;b?(Ie=o[0]*(a[0]-1),Ae=o[1]*(a[1]-1),Be=ne===3?(o.length>=3?o[2]:.5)*(a[2]-1):0):y?(Ie=(a[0]-1)/2,Ae=(a[1]-1)/2,Be=ne===3?(a[2]-1)/2:0):(Ie=D%a[0],Ae=Ps(D/a[0])%a[1],Be=ne===3?Ps(D/Oe):0);const _e=Q%a[0],ke=Ps(Q/a[0])%a[1],Ee=ne===3?Ps(Q/Oe):0,Pe=Ie-_e,ae=Ae-ke,le=Be-Ee;let xe=wt(Pe*Pe+ae*ae+(ne===3?le*le:0));l==="x"&&(xe=-Pe),l==="y"&&(xe=-ae),l==="z"&&(xe=-le),s.push(xe)}r=s[0];for(let Q=1;Q<j;Q++)s[Q]>r&&(r=s[Q]);if(p||c)for(let Q=0;Q<j;Q++){let ne=s[Q];p&&(ne=p(ne/r)*r),c&&(ne=l?-ne:kt(r-ne)),s[Q]=ne}if(q){n=new Array(j);for(let Q=0;Q<j;Q++)n[Q]=R(-1,1,4)}w&&(s=Gi(s,R))}const me=u?(k-_)/r:_;U(i)&&(i=V?Js(V,U(t.start)?V.iterationDuration:O):O);let ue=i+(me*G(s[ve],2)||0);if(q){const Q=r?s[ve]/r:0,ne=W+(E-W)*Q;ue=ue+n[ve]*ne}return t.modifier&&(ue=t.modifier(ue)),T&&(ue=`${ue}${T[2]}`),ue}},Sh=Ss({$:()=>Qt,addChild:()=>Ot,clamp:()=>ma,cleanInlineStyles:()=>yo,createSeededRandom:()=>ir,damp:()=>ba,degToRad:()=>fa,forEachChildren:()=>Ce,get:()=>ts,keepTime:()=>qr,lerp:()=>ya,mapRange:()=>da,padEnd:()=>ua,padStart:()=>ca,radToDeg:()=>pa,random:()=>rr,randomPick:()=>_a,remove:()=>Bo,removeChild:()=>Rt,round:()=>va,roundPad:()=>la,set:()=>Ut,shuffle:()=>Gi,snap:()=>ga,stagger:()=>nr,sync:()=>Vi,wrap:()=>ha}),Sa=e=>{const t=bt(e)[0];return!t||!kr(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},Xi=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},Yi=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[ki],o=e.getCTM(),c=s===0;return{from:0,to:i,modifier:d=>{const h=d+s*i;if(t==="a"){const p=Xi(e,i,h,-1,c),a=Xi(e,i,h,1,c);return Tr(a.y-p.y,a.x-p.x)*180/$t}else{const p=Xi(e,i,h,0,c);return t==="x"?n||!o?p.x:p.x*o.a+p.y*o.c+o.e:n||!o?p.y:p.x*o.b+p.y*o.d+o.f}}}},wa=(e,t=0)=>{const s=Sa(e);if(s)return{translateX:Yi(s,"x",t),translateY:Yi(s,"y",t),rotate:Yi(s,"a",t)}},wh=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(wt(s.a*s.a+s.b*s.b)+wt(s.c*s.c+s.d*s.d))/2)}return t},kh=(e,t,s)=>{const r=ut,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect==="non-scaling-stroke"?e:null;let c=n;const d=new Proxy(e,{get(h,p){const a=h[p];return p===eo?h:p==="setAttribute"?(...f)=>{if(f[0]==="draw"){const l=f[1].split(" "),g=+l[0],m=+l[1],y=wh(o),S=g*-r*y,w=m*r*y+S,b=r*y+(g===0&&m===1||g===1&&m===0?0:10*y)-w;if(n!=="butt"){const u=g===m?"butt":n;c!==u&&(h.style.strokeLinecap=`${u}`,c=u)}h.setAttribute("stroke-dashoffset",`${S}`),h.setAttribute("stroke-dasharray",`${w} ${b}`)}return Reflect.apply(a,h,f)}:qe(a)?(...f)=>Reflect.apply(a,h,f):a}});return e.getAttribute("pathLength")!==`${r}`&&(e.setAttribute("pathLength",`${r}`),d.setAttribute("draw",`${t} ${s}`)),d},ka=(e,t=0,s=0)=>bt(e).map(r=>kh(r,t,s)),xa=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can\'t morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=Sa(e);if(!o)throw new Error("Can\'t morph to an invalid target. \'path2\' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");if(!(o.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can\'t morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const c=s.tagName==="path",d=c?" ":",",h=n?n._value:null;h&&s.setAttribute(c?"d":"points",h);let p="",a="";if(!t)p=s.getAttribute(c?"d":"points"),a=o.getAttribute(c?"d":"points");else{const f=s.getTotalLength(),l=o.getTotalLength(),g=Math.max(Math.ceil(f*t),Math.ceil(l*t));for(let m=0;m<g;m++){const y=m/(g-1),S=s.getPointAtLength(f*y),w=o.getPointAtLength(l*y),b=c?m===0?"M":"L":"";p+=b+G(S.x,3)+d+S.y+" ",a+=b+G(w.x,3)+d+w.y+" "}}return[p,a]},xh=Ss({createDrawable:()=>ka,createMotionPath:()=>wa,morphTo:()=>xa}),jr=typeof Intl<"u"&&Intl.Segmenter,Th=/\\{value\\}/g,Ch=/\\{i\\}/g,ji=/(\\s+)/,Zi=/^\\s+$/,Ki="line",or="word",ar="char",lr="data-line",Ji=null,Qi=null,Zr=null,Ta=e=>e.isWordLike||e.segment===" "||st(+e.segment),en=e=>e.setAttribute("aria-hidden","true"),Kr=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],Ah={line:"#00D672",word:"#FF4B4B",char:"#5A87FF"},Ca=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&Ca(t)}},Aa=(e,t,s)=>{const r=e.getAttribute(lr);if(r!==null&&+r!==t||e.tagName==="BR"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&Zi.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&Zi.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)Aa(e.children[i],t,s);return s},tn=(e,t={})=>{let s="";t||(t={});const r=Ze(t.class)?` class="${t.class}"`:"",i=Y(t.clone,!1),n=Y(t.wrap,!1),o=n?n===!0?"clip":n:i?"clip":!1;if(n&&(s+=`<span${o?` style="overflow:${o};"`:""}>`),s+=`<span${r}${i?\' style="position:relative;"\':""} data-${e}="{i}">`,i){const c=i==="left"?"-100%":i==="right"?"100%":"0",d=i==="top"?"-100%":i==="bottom"?"100%":"0";s+="<span>{value}</span>",s+=`<span inert style="position:absolute;top:${d};left:${c};white-space:nowrap;">{value}</span>`}else s+="{value}";return s+="</span>",n&&(s+="</span>"),s},sn=(e,t,s,r,i,n,o,c,d)=>{const h=i===Ki,p=i===ar,a=`_${i}_`,f=qe(e)?e(s):e,l=h?"block":"inline-block";Zr.innerHTML=f.replace(Th,`<i class="${a}"></i>`).replace(Ch,`${p?d:h?o:c}`);const g=Zr.content,m=g.firstElementChild,y=g.querySelector(`[data-${i}]`)||m,S=g.querySelectorAll(`i.${a}`),w=S.length;if(w){m.style.display=l,y.style.display=l,y.setAttribute(lr,`${o}`),h||(y.setAttribute("data-word",`${c}`),p&&y.setAttribute("data-char",`${d}`));let b=w;for(;b--;){const u=S[b],v=u.parentElement;v.style.display=l,h?v.innerHTML=s.innerHTML:v.replaceChild(s.cloneNode(!0),u)}t.push(y),r.appendChild(g)}else console.warn(\'The expression "{value}" is missing from the provided template.\');return n&&(m.style.outline=`1px dotted ${Ah[i]}`),m},Jr=class{constructor(e,t={}){Ji||(Ji=jr?new jr([],{granularity:or}):{segment:l=>{const g=[],m=l.split(ji);for(let y=0,S=m.length;y<S;y++){const w=m[y];g.push({segment:w,isWordLike:!Zi.test(w)})}return g}}),Qi||(Qi=jr?new jr([],{granularity:"grapheme"}):{segment:l=>[...l].map(g=>({segment:g}))}),!Zr&&Dt&&(Zr=K.createElement("template")),We.current&&We.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:c}=t,d=(e=Qe(e)?e[0]:e)&&e.nodeType?e:(Ni(e)||[])[0],h=i===!0?{}:i,p=s===!0||U(s)?{}:s,a=r===!0?{}:r;this.debug=Y(c,!1),this.includeSpaces=Y(o,!1),this.accessible=Y(n,!0),this.linesOnly=h&&!p&&!a,this.lineTemplate=je(h)?tn(Ki,h):h,this.wordTemplate=je(p)||this.linesOnly?tn(or,p):p,this.charTemplate=je(a)?tn(ar,a):a,this.$target=d,this.html=d&&d.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const f=()=>this.html&&(h||p||a)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const l=d.offsetWidth;l!==this.width&&(this.width=l,f())},150)}),this.lineTemplate&&!this.ready?K.fonts.ready.then(f):f(),d?this.resizeObserver.observe(d):console.warn("No Text Splitter target found.")}addEffect(e){if(!qe(e))return console.warn("Effect must return a function."),this;const t=qr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>qe(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const c=[],d=this.words,h=this.chars,p=Ji.segment(o),a=K.createDocumentFragment();let f=null;for(const l of p){const g=l.segment,m=Ta(l);if(!f||m&&f&&Ta(f))c.push(g);else{const y=c.length-1,S=c[y];!ji.test(S)&&!ji.test(g)?c[y]+=g:c.push(g)}f=l}for(let l=0,g=c.length;l<g;l++){const m=c[l];if(m.trim()){const y=c[l+1],S=r&&y&&!y.trim(),w=m,b=s?Qi.segment(w):null,u=s?K.createDocumentFragment():K.createTextNode(S?m+" ":m);if(s){const v=[...b];for(let _=0,k=v.length;_<k;_++){const T=v[_],O=_===k-1&&S?T.segment+" ":T.segment,L=K.createTextNode(O);sn(s,h,L,u,ar,i,-1,d.length,h.length)}}t?sn(t,d,u,a,or,i,-1,d.length,h.length):s?a.appendChild(u):a.appendChild(K.createTextNode(m)),S&&l++}else{if(l&&r)continue;a.appendChild(K.createTextNode(m))}}e.parentNode.replaceChild(a,e)}}else if(n===1){const o=[...e.childNodes];for(let c=0,d=o.length;c<d;c++)this.splitNode(o[c])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=K.fonts.status!=="loading",c=r&&o;this.ready=!r||o,(c||e)&&this.effectsCleanups.forEach(a=>qe(a)&&a(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),c&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=Kr(t,or))),n&&(c||i)&&(this.chars=Kr(t,ar));const d=this.words.length?this.words:this.chars;let h,p=0;for(let a=0,f=d.length;a<f;a++){const l=d[a],{top:g,height:m}=l.getBoundingClientRect();!U(h)&&g-h>m*.5&&p++,l.setAttribute(lr,`${p}`);const y=l.querySelectorAll(`[${lr}]`);let S=y.length;for(;S--;)y[S].setAttribute(lr,`${p}`);h=g}if(c){const a=K.createDocumentFragment(),f=new Set,l=[];for(let g=0;g<p+1;g++){const m=t.cloneNode(!0);Aa(m,g,new Set).forEach(y=>{const S=y.parentNode;S&&(y.nodeType===1&&f.add(S),S.removeChild(y))}),l.push(m)}f.forEach(Ca);for(let g=0,m=l.length;g<m;g++)sn(r,this.lines,l[g],a,Ki,this.debug,g);t.innerHTML="",t.appendChild(a),i&&(this.words=Kr(t,or)),n&&(this.chars=Kr(t,ar))}if(this.linesOnly){const a=this.words;let f=a.length;for(;f--;){const l=a[f];l.replaceWith(l.textContent)}a.length=0}if(this.accessible&&(c||!s)){const a=K.createElement("span");a.style.cssText="position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;",a.innerHTML=this.html,t.insertBefore(a,t.firstChild),this.lines.forEach(en),this.words.forEach(en),this.chars.forEach(en)}return this.width=t.offsetWidth,(c||e)&&this.effects.forEach((a,f)=>this.effectsCleanups[f]=a(this)),this}refresh(){this.split(!0)}},cr=(e,t)=>new Jr(e,t),Ea=(e,t)=>(console.warn("text.split() is deprecated, import splitText() directly, or text.splitText()"),new Jr(e,t)),Pa=e=>{let t="";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]==="-"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},La={lowercase:"a-z",uppercase:"A-Z",numbers:"0-9",symbols:"!%#_|*+=",braille:"⠀-⣿",blocks:"▀-▟",shades:"░-▓"},rn=new WeakMap,Ia=(e={})=>{e||(e={});const t=e.chars,s=Vt(e.ease||"linear"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,c=e.cursor,d=c===!0?"_":typeof c=="number"?String.fromCharCode(c):typeof c=="string"?c:"",h=d.length,p=e.seed||0,a=e.override!==void 0?e.override:!0,f=e.revealRate||60,l=1e3*X.timeScale/f,g=e.settleDuration||300*X.timeScale,m=e.settleRate||30,y=e.duration,S=e.revealDelay,w=e.delay,b=e.onChange||oe;return(u,v,_,k)=>{const T=typeof t=="function"?t(u,v,_):t||"a-zA-Z0-9!%#_",O=Pa(La[T]||T),L=O.length-1,R=typeof y=="function"?y(u,v,_):y,I=typeof S=="function"?S(u,v,_):S||0,q=typeof w=="function"?w(u,v,_):w||0,z=p?ir(p):ir();rn.has(u)||rn.set(u,u.textContent);const W=k?k._value:u.textContent,E=r!==void 0?typeof r=="function"?r(u,v,_):r:k?k._value:rn.get(u),D=E===" "||E==="&nbsp;"?" ":E,A=W===" "?0:W.length,P=D.length,N=a===!0?O:typeof a=="string"&&a.length>0?Pa(La[a]||a):null,B=N?N.length-1:0,V=a===" "?" ":null,$=a===""?P:Math.max(A,P),j=R>0?R:($-1)*l+g,ee=G((j+I)/X.timeScale,0)*X.timeScale,J=I>0?G(I/ee,12):0,ve=i===void 0||i==="auto"?P<A?"right":"left":i,me=new Int32Array($);if(ve==="random"){for(let H=0;H<$;H++)me[H]=H;for(let H=$-1;H>0;H--){const ce=z(0,H),se=me[H];me[H]=me[ce],me[ce]=se}}else{const H=ve==="right"?(a===""||!A?$:A)-1:ve==="center"?((a===""||!A?$:A)-1)/2:typeof ve=="number"?ve:0,ce=Math.abs,se=new Array($);for(let he=0;he<$;he++)se[he]=he;se.sort((he,ze)=>ce(he-H)-ce(ze-H));for(let he=0;he<$;he++)me[se[he]]=he}if(n){const H=$-1;for(let ce=0;ce<$;ce++)me[ce]=H-me[ce]}const ue=G(g/j,12),Q=G((1-ue)/$,12),ne=h*Q,Oe=G(1e3*X.timeScale/(m*ee),12),Ie=new Float32Array($),Ae=new Float32Array($),Be=o>0?o*ue:0;for(let H=0;H<$;H++){const ce=Be>0?(z(0,2e3)-1e3)/1e3*Be:0,se=Be>0?(z(0,2e3)-1e3)/1e3*Be:0;Ie[H]=me[H]*Q+ce,Ae[H]=Math.ceil((Ie[H]+ue+se)/Oe)*Oe}if(P<$&&ve!=="left"&&ve!=="right"&&ve!=="random"){let H=0;for(let he=P;he<$;he++)Ae[he]>H&&(H=Ae[he]);const ce=new Array(P);for(let he=0;he<P;he++)ce[he]=he;ce.sort((he,ze)=>me[he]-me[ze]);const se=(1-H)/P;for(let he=0;he<P;he++){const ze=H+he*se;ze>Ae[ce[he]]&&(Ae[ce[he]]=ze)}}const _e=new Array($);for(let H=0;H<$;H++)_e[H]=O[z(0,L)];const ke=N?N===O?_e:new Array($):null;if(ke&&ke!==_e)for(let H=0;H<$;H++)ke[H]=V||N[z(0,N.length-1)];let Ee=W;if(!k){if(a==="")Ee="";else if(N){Ee="";for(let H=0;H<A;H++)Ee+=W[H]===" "?" ":ke[H]}}let Pe=-1,ae=-1,le="";const xe=a!=="",Se=!!N,Re=h>0;return{from:0,to:1,duration:ee,delay:q,ease:"linear",modifier:H=>{if(H===Pe)return le;if(Pe=H,q>0&&H<=0)return le=W,W;if(H<=0)return le=Ee,Ee;if(H>=1)return le=D,D;le="";const ce=H/Oe|0,se=ce!==ae;se&&(ae=ce);const he=J>0?(H-J)/(1-J):H,ze=he>0?s(he):0;for(let Me=0;Me<$;Me++){const ye=Ie[Me];if(ze>=Ae[Me]){Me<P&&(le+=D[Me]);continue}if(ze<=0||ze<ye){xe&&Me<A&&(Se?W[Me]===" "?le+=" ":(se&&(ke[Me]=V||N[z(0,B)]),le+=ke[Me]):le+=W[Me]);continue}Me<P&&D[Me]===" "||Me<A&&W[Me]===" "?le+=" ":Re&&ze-ye<ne?le+=d[h-1-((ze-ye)/Q|0)]:(se&&(_e[Me]=O[z(0,L)]),le+=_e[Me])}return se&&b(le,ze),le}}}},Eh=Ss({TextSplitter:()=>Jr,scrambleText:()=>Ia,split:()=>Ea,splitText:()=>cr}),Ph=Ss({$:()=>Qt,Animatable:()=>Hi,AutoLayout:()=>oa,Draggable:()=>Ho,JSAnimation:()=>zt,Scope:()=>qo,ScrollObserver:()=>zo,Spring:()=>$r,TextSplitter:()=>Jr,Timeline:()=>Mo,Timer:()=>yt,WAAPIAnimation:()=>Jo,addChild:()=>Ot,animate:()=>Ks,clamp:()=>ma,cleanInlineStyles:()=>yo,createAnimatable:()=>zu,createDraggable:()=>eh,createDrawable:()=>ka,createLayout:()=>yh,createMotionPath:()=>wa,createScope:()=>th,createSeededRandom:()=>ir,createSpring:()=>Do,createTimeline:()=>No,createTimer:()=>$u,cubicBezier:()=>Wo,damp:()=>ba,degToRad:()=>fa,eases:()=>Ft,easings:()=>lh,engine:()=>it,forEachChildren:()=>Ce,get:()=>ts,globals:()=>X,irregular:()=>Xo,keepTime:()=>qr,lerp:()=>ya,linear:()=>zi,mapRange:()=>da,morphTo:()=>xa,onScroll:()=>oh,padEnd:()=>ua,padStart:()=>ca,radToDeg:()=>pa,random:()=>rr,randomPick:()=>_a,remove:()=>Bo,removeChild:()=>Rt,round:()=>va,roundPad:()=>la,scrambleText:()=>Ia,scrollContainers:()=>Vr,set:()=>Ut,shuffle:()=>Gi,snap:()=>ga,split:()=>Ea,splitText:()=>cr,spring:()=>Br,stagger:()=>nr,steps:()=>Go,svg:()=>xh,sync:()=>Vi,text:()=>Eh,utils:()=>Sh,waapi:()=>Qo,wrap:()=>ha}),Lh=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation("typewriter",function(e,t,s,r){const{chars:i}=cr(e,{words:!1,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;Ks(i,{opacity:[0,1],easing:"linear",duration:n,delay:nr(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("toast",function(e,t,s,r){const{words:i}=cr(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;Ks(i,{opacity:[0,1],y:[{to:["100%","0%"]}],easing:"linear",duration:n,delay:nr(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("fadeIn",function(e,t,s,r){const i=t.duration||500;Ks(e,{opacity:[0,1],easing:t.easing||"easeOutQuad",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("continue",function(e,t,s){e.classList.add("squiffy-continue");const r=t.style||"pulse";let i=null,n=null;r==="wave"?(e.classList.add("squiffy-continue-wave"),n=cr(e,{words:!1,chars:!0}).chars,i=Ks(n,{opacity:[1,.3,1],easing:"easeInOutSine",duration:1200,delay:nr(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove("squiffy-continue","squiffy-continue-wave",`squiffy-continue-${r}`),e.removeEventListener("click",o),i&&(i.pause(),n))for(const c of n)c.style.opacity="1";s()};e.addEventListener("click",o)})}},Ih={animejs:Ph},Ra="input:not([disabled]), textarea:not([disabled]), select:not([disabled])",Rh="a.squiffy-link[data-section], a.squiffy-link[data-passage]";function Oa(e){if(!e)return!0;const t=e.querySelectorAll(Ra);for(const s of t)if(!s.checkValidity())return!1;return!0}function nn(e){if(!e)return;const t=Oa(e),s=e.querySelectorAll(Rh);for(const r of s)t?(r.classList.remove("validation-disabled"),r.removeAttribute("aria-disabled")):(r.classList.add("validation-disabled"),r.setAttribute("aria-disabled","true"))}function ur(e){if(!e)return;const t=e.querySelectorAll(Ra);for(const s of t)s.addEventListener("input",()=>nn(e)),s.addEventListener("change",()=>nn(e)),s.addEventListener("invalid",r=>{r.preventDefault(),s.classList.add("squiffy-invalid")}),s.addEventListener("input",()=>{s.checkValidity()&&s.classList.remove("squiffy-invalid")});nn(e)}var Ma=["src","poster"],Oh="data-squiffy-asset-",Mh=[...Ma,"srcset","style"].map(e=>`[${e}]`).join(","),Na=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.startsWith("#"),on=(e,t)=>{const s=e.trim();if(!s||Na(s))return e;let r=s;try{r=decodeURI(s)}catch{}return t(r)},Nh=(e,t)=>e.split(",").map(s=>{const r=s.match(/^(\\s*)(\\S+)(.*)$/s);return r?r[1]+on(r[2],t)+r[3]:s}).join(","),Dh=(e,t)=>e.replace(/url\\(\\s*([\'"]?)(.*?)\\1\\s*\\)/gi,(s,r,i)=>{const n=on(i,t);return n===i?s:`url("${n.replace(/["\\\\\\n]/g,o=>"\\\\"+(o===`\n`?"a ":o))}")`}),$h=(e,t,s)=>{const r=Oh+t,i=e.getAttribute(r)??e.getAttribute(t);if(i===null)return;let n;t==="srcset"?n=Nh(i,s):t==="style"?n=Dh(i,s):n=on(i,s),n===i?e.removeAttribute(r):e.setAttribute(r,i),e.setAttribute(t,n)},Bh=e=>t=>{if(!e||!/\\b(src|srcset|poster|style)\\s*=/i.test(t))return t;const s=document.createElement("template");s.innerHTML=t;for(const r of s.content.querySelectorAll(Mh))for(const i of[...Ma,"srcset","style"])r.hasAttribute(i)&&$h(r,i,e);return s.innerHTML},ad=1,Da=50,Hh=class{constructor(e){this.options=e,this.music=null,this.effects=new Set,this.preloaded=new Map,this.muted=!1,this.waitingForGesture=!1,this.disposed=!1,this.onGesture=()=>{this.removeGestureListeners();const t=this.music;t&&t.audio.paused&&(t.audio.volume=1,this.playTrack(t,0))},this.muted=this.readMuted()}preload(e){if(!(typeof Audio>"u"))for(const t of e){if(this.preloaded.has(t))continue;const s=new Audio;s.preload="auto",s.src=this.options.resolveUrl(t),this.preloaded.set(t,s)}}sync(e=1){if(this.disposed)return;const t=this.options.getMusic()||null;t!==(this.music?.file??null)&&(this.stopMusic(e),t&&this.startMusic(t,e))}play(e,t=1){if(this.disposed||typeof Audio>"u")return;const s=this.newAudio(e);s.volume=$a(t),this.effects.add(s);const r=()=>this.effects.delete(s);s.addEventListener("ended",r),s.addEventListener("error",r),this.options.onPlay?.(),s.play()?.catch(r)}stopSounds(){for(const e of this.effects)e.pause();this.effects.clear()}isMuted(){return this.muted}setMuted(e){this.muted=e,this.music&&(this.music.audio.muted=e);for(const t of this.effects)t.muted=e;this.writeMuted()}dispose(){this.disposed=!0,this.stopMusic(0),this.stopSounds(),this.removeGestureListeners()}newAudio(e){const t=new Audio(this.options.resolveUrl(e));return t.muted=this.muted,t}startMusic(e,t){if(typeof Audio>"u")return;const s=this.newAudio(e);s.loop=!0;const r={file:e,audio:s};this.music=r,this.options.onPlay?.(),s.volume=t>0?0:1,this.playTrack(r,t)}playTrack(e,t){const s=e.audio.play();t>0&&this.fade(e,1,t),s?.catch(r=>{e===this.music&&r?.name=="NotAllowedError"&&this.waitForGesture()})}stopMusic(e){const t=this.music;t&&(this.music=null,e>0&&!t.audio.paused?this.fade(t,0,e,()=>t.audio.pause()):(clearInterval(t.fadeTimer),t.audio.pause()))}fade(e,t,s,r){clearInterval(e.fadeTimer);const i=e.audio.volume,n=Math.max(1,Math.round(s*1e3/Da));let o=0;e.fadeTimer=setInterval(()=>{o++,e.audio.volume=$a(i+(t-i)*o/n),o>=n&&(clearInterval(e.fadeTimer),e.fadeTimer=void 0,r?.())},Da)}waitForGesture(){this.waitingForGesture||typeof document>"u"||(this.waitingForGesture=!0,document.addEventListener("pointerdown",this.onGesture,!0),document.addEventListener("keydown",this.onGesture,!0))}removeGestureListeners(){this.waitingForGesture&&(this.waitingForGesture=!1,document.removeEventListener("pointerdown",this.onGesture,!0),document.removeEventListener("keydown",this.onGesture,!0))}readMuted(){if(!this.options.mutedKey)return!1;try{return localStorage.getItem(this.options.mutedKey)=="true"}catch{return!1}}writeMuted(){if(this.options.mutedKey)try{this.muted?localStorage.setItem(this.options.mutedKey,"true"):localStorage.removeItem(this.options.mutedKey)}catch{}}},$a=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:1)),qh="squiffy-saves",an="saves",Ba=(e,t)=>t.save.savedAt.localeCompare(e.save.savedAt)||t.id-e.id,ln=e=>({id:e.id,name:e.name,save:e.save}),Qr=e=>e?.trim()||null;function cn(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}function Ha(e){return new Promise((t,s)=>{e.oncomplete=()=>t(),e.onerror=()=>s(e.error),e.onabort=()=>s(e.error)})}function qa(e){let t;const s=()=>t??(t=new Promise((h,p)=>{const a=indexedDB.open(qh,1);a.onupgradeneeded=()=>{a.result.createObjectStore(an,{keyPath:["key","id"]})},a.onsuccess=()=>h(a.result),a.onerror=()=>{t=void 0,p(a.error)}})),r=()=>IDBKeyRange.bound([e,-1/0],[e,1/0]),i=async h=>(await s()).transaction(an,h).objectStore(an),n=async h=>cn((await i("readonly")).get([e,h])),o=async h=>{const p=await i("readwrite");p.put(h),await Ha(p.transaction)};let c=!1;const d=()=>{c||(c=!0,navigator.storage?.persist?.().catch(()=>{}))};return{async list(){return(await cn((await i("readonly")).getAll(r()))).map(ln).sort(Ba)},async get(h){const p=await n(h);return p?ln(p):null},async add(h,p){const a={key:e,id:(await cn((await i("readonly")).getAllKeys(r()))).reduce((f,l)=>Math.max(f,l[1]),0)+1,name:Qr(p),save:h};return await o(a),d(),ln(a)},async overwrite(h,p){const a=await n(h);await o({key:e,id:h,name:a?.name??null,save:p})},async rename(h,p){const a=await n(h);a&&await o({...a,name:Qr(p)})},async delete(h){const p=await i("readwrite");p.delete([e,h]),await Ha(p.transaction)}}}function Fa(){const e=new Map;let t=1;const s=r=>structuredClone(r);return{async list(){return[...e.values()].map(s).sort(Ba)},async get(r){const i=e.get(r);return i?s(i):null},async add(r,i){const n={id:t++,name:Qr(i),save:structuredClone(r)};return e.set(n.id,n),s(n)},async overwrite(r,i){e.set(r,{id:r,name:e.get(r)?.name??null,save:structuredClone(i)})},async rename(r,i){const n=e.get(r);n&&(n.name=Qr(i))},async delete(r){e.delete(r)}}}var ei={saves:"Saved games",saveName:"Name (optional)",save:"Save",noSaves:"No saved games yet.",savedGame:"Saved game",savedToday:"Today, [time]",savedYesterday:"Yesterday, [time]",load:"Load",loadConfirm:`Load "[name]"? You\'ll lose anything you\'ve done since you last saved.`,saveOptions:"Options for [name]",overwrite:"Overwrite",overwriteConfirm:\'Overwrite "[name]"?\',rename:"Rename",newName:"New name",saveToFile:"Save to file",loadFromFile:"Load from file",delete:"Delete",deleteConfirm:`Delete "[name]"? This can\'t be undone.`,cancel:"Cancel",close:"Close",wrongStory:"This saved game is for a different story.",notASave:"This file isn\'t a saved game.",cantSave:"The game couldn\'t be saved. Try Save to file instead."},un=".squiffy-save",Fh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>\',Vh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg>\',zh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>\',Uh=\'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"/></svg>\',Wh=0;function Va(e,t=ei,s=new Date){const r=new Date(e);if(isNaN(r.getTime()))return"";const i=r.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),n=c=>new Date(c.getFullYear(),c.getMonth(),c.getDate()).getTime(),o=Math.round((n(s)-n(r))/864e5);return o===0?t.savedToday.replace("[time]",i):o===1?t.savedYesterday.replace("[time]",i):`${r.toLocaleDateString(void 0,{day:"numeric",month:"short",...r.getFullYear()!==s.getFullYear()?{year:"numeric"}:{}})}, ${i}`}function Gh(e,t={}){const s={...ei};for(const A of Object.keys(ei)){const P=t.strings?.[A];typeof P=="string"&&(s[A]=P)}const r=t.slots??(typeof indexedDB<"u"?qa(t.key??window.location.pathname):Fa()),i=`squiffy-saves-${++Wh}`,n=document.createElement("dialog");n.className="squiffy-saves",n.setAttribute("aria-labelledby",`${i}-heading`),n.innerHTML=`\n <div class="squiffy-saves-header">\n <h2 id="${i}-heading"></h2>\n <button type="button" class="squiffy-saves-icon-button" data-close>${Fh}</button>\n </div>\n <p class="squiffy-saves-error" role="alert" hidden></p>\n <form class="squiffy-saves-new">\n <input type="text" autocomplete="off">\n <button type="submit" class="squiffy-saves-button squiffy-saves-primary"></button>\n </form>\n <ul class="squiffy-saves-list"></ul>\n <div class="squiffy-saves-footer">\n <button type="button" class="squiffy-saves-link" data-save-to-file>${zh}<span></span></button>\n <button type="button" class="squiffy-saves-link" data-load-from-file>${Uh}<span></span></button>\n <input type="file" accept="${un},.json,application/json" hidden>\n </div>\n <div class="squiffy-saves-footer-confirm"></div>`;const o=A=>n.querySelector(A);o("h2").textContent=s.saves;const c=o("[data-close]");c.title=s.close,c.setAttribute("aria-label",s.close);const d=o(".squiffy-saves-error"),h=o("form"),p=o("form input");p.placeholder=s.saveName,p.setAttribute("aria-label",s.saveName),o("form button").textContent=s.save;const a=o(".squiffy-saves-list");o("[data-save-to-file] span").textContent=s.saveToFile,o("[data-load-from-file] span").textContent=s.loadFromFile;const f=o("input[type=file]"),l=o(".squiffy-saves-footer-confirm");(t.container??document.body).appendChild(n);let g=!1;e.on("navigated",()=>{g=!1});const m=()=>!g&&e.canGoBack();let y=[],S=null;const w=A=>{d.textContent=A,d.hidden=!1},b=()=>{d.hidden=!0},u=A=>A.name||A.save.summary||s.savedGame,v=A=>[Va(A.save.savedAt,s),A.name&&A.save.summary].filter(Boolean).join(" · "),_=A=>a.querySelector(`[data-slot="${A}"]`);function k(){if(a.replaceChildren(),!y.length){const A=document.createElement("li");A.className="squiffy-saves-empty",A.textContent=s.noSaves,a.appendChild(A);return}for(const A of y){const P=u(A),N=document.createElement("li");N.className="squiffy-saves-row",N.dataset.slot=String(A.id),N.innerHTML=`\n <div class="squiffy-saves-line">\n <div class="squiffy-saves-info">\n <div class="squiffy-saves-title" id="${i}-title-${A.id}"></div>\n <div class="squiffy-saves-meta"></div>\n </div>\n <button type="button" class="squiffy-saves-button" data-action="load" aria-describedby="${i}-title-${A.id}"></button>\n <div class="squiffy-saves-options">\n <button type="button" class="squiffy-saves-icon-button" data-action="options" aria-haspopup="menu" aria-expanded="false" aria-controls="${i}-menu-${A.id}">${Vh}</button>\n <div class="squiffy-saves-menu" id="${i}-menu-${A.id}" role="menu" hidden>\n <button type="button" role="menuitem" data-action="overwrite"></button>\n <button type="button" role="menuitem" data-action="rename"></button>\n <button type="button" role="menuitem" data-action="download"></button>\n <button type="button" role="menuitem" data-action="delete" class="squiffy-saves-danger"></button>\n </div>\n </div>\n </div>`;const B=j=>N.querySelector(j);B(".squiffy-saves-title").textContent=P;const V=v(A);V?B(".squiffy-saves-meta").textContent=V:B(".squiffy-saves-meta").remove(),B("[data-action=load]").textContent=s.load;const $=B("[data-action=options]");$.title=s.saveOptions.replace("[name]",P),$.setAttribute("aria-label",$.title),B("[data-action=overwrite]").textContent=s.overwrite,B("[data-action=rename]").textContent=s.rename,B("[data-action=download]").textContent=s.saveToFile,B("[data-action=delete]").textContent=s.delete,a.appendChild(N)}}async function T(){try{y=await r.list()}catch{y=[],w(s.cantSave)}k()}function O(A,P,N,B=!1){S?.();const V=document.createElement("div");V.className="squiffy-saves-confirm",V.setAttribute("role","group"),V.innerHTML=`<p id="${i}-confirm"></p>\n <div class="squiffy-saves-confirm-buttons">\n <button type="button" class="squiffy-saves-button" data-answer="no"></button>\n <button type="button" class="squiffy-saves-button ${B?"squiffy-saves-danger-button":"squiffy-saves-primary"}" data-answer="yes" aria-describedby="${i}-confirm"></button>\n </div>`,V.setAttribute("aria-labelledby",`${i}-confirm`),V.querySelector("p").textContent=P;const $=V.querySelector("[data-answer=no]"),j=V.querySelector("[data-answer=yes]");return $.textContent=s.cancel,j.textContent=N,A.appendChild(V),new Promise(ee=>{const J=ve=>{S=null,V.remove(),ee(ve)};S=()=>J(!1),$.addEventListener("click",()=>J(!1)),j.addEventListener("click",()=>J(!0)),j.focus()})}const L=typeof HTMLElement.prototype.showPopover=="function";function R(A,P){if(!L){A.hidden=!1;return}A.hidden=!1,A.popover="manual",A.showPopover();const N=P.getBoundingClientRect(),{width:B,height:V}=A.getBoundingClientRect(),$=N.bottom+4;A.style.top=`${$+V>window.innerHeight-8?Math.max(8,N.top-4-V):$}px`,A.style.left=`${Math.max(8,Math.min(N.right-B,window.innerWidth-8-B))}px`}function I(A){L&&A.matches(":popover-open")&&A.hidePopover(),A.hidden=!0}function q(A){const P=document.getElementById(A.getAttribute("aria-controls")),N=A.getAttribute("aria-expanded")=="true";if(S?.(),N)return;R(P,A),A.setAttribute("aria-expanded","true");const B=[...P.querySelectorAll("[role=menuitem]")];B[0].focus();const V=ee=>{S=null,I(P),A.setAttribute("aria-expanded","false"),P.removeEventListener("keydown",$),n.removeEventListener("pointerdown",j),ee&&A.focus()},$=ee=>{const J=B.indexOf(document.activeElement),ve={ArrowDown:J+1,ArrowUp:J-1,Home:0,End:B.length-1}[ee.key];ve!==void 0?(ee.preventDefault(),B[(ve+B.length)%B.length].focus()):ee.key=="Tab"&&V(!1)},j=ee=>{const J=ee.target;!P.contains(J)&&!A.contains(J)&&V(!1)};P.addEventListener("keydown",$),n.addEventListener("pointerdown",j),S=()=>V(!0)}function z(A){const P=_(A.id)?.querySelector(".squiffy-saves-title");if(!P)return;const N=document.createElement("input");N.type="text",N.className="squiffy-saves-rename",N.autocomplete="off",N.value=A.name??"",N.placeholder=u(A),N.setAttribute("aria-label",s.newName),P.replaceWith(N),N.focus(),N.select();let B=!1;const V=async $=>{if(B)return;B=!0,S=null;const j=N.value.trim()||null;$&&j!==A.name&&await r.rename(A.id,j).catch(()=>w(s.cantSave)),await T(),_(A.id)?.querySelector("[data-action=load]")?.focus()};S=()=>{V(!1)},N.addEventListener("keydown",$=>{$.key=="Enter"&&($.preventDefault(),V(!0))}),N.addEventListener("blur",()=>V(!0))}function W(){return((t.fileName??document.title).replace(/[\\\\/:*?"<>|]+/g,"").replace(/\\s+/g," ").trim()||"story")+un}function E(A){const P=URL.createObjectURL(new Blob([JSON.stringify(A)],{type:"application/json"})),N=document.createElement("a");N.href=P,N.download=W(),n.appendChild(N),N.click(),N.remove(),setTimeout(()=>URL.revokeObjectURL(P),0)}async function D(A){const P=await e.loadSave(A);if(!P.success){w(s[P.error]);return}g=!0,n.close()}return n.addEventListener("cancel",A=>{S&&(A.preventDefault(),S())}),c.addEventListener("click",()=>n.close()),h.addEventListener("submit",async A=>{A.preventDefault(),b(),S?.();try{await r.add(e.getSave(),p.value),g=!0,p.value=""}catch{w(s.cantSave)}await T(),p.focus()}),a.addEventListener("click",async A=>{const P=A.target.closest("[data-action]"),N=P?.closest("[data-slot]");if(!P||!N)return;const B=y.find(j=>j.id===Number(N.dataset.slot));if(!B)return;const V=P.dataset.action;if(V=="options"){q(P);return}P.getAttribute("role")=="menuitem"&&S?.(),b();const $=u(B);if(V=="load"){if(m()&&!await O(N,s.loadConfirm.replace("[name]",$),s.load)){P.focus();return}const j=await r.get(B.id).catch(()=>null);j&&await D(j.save)}else if(V=="overwrite"){if(!await O(N,s.overwriteConfirm.replace("[name]",$),s.overwrite))return;try{await r.overwrite(B.id,e.getSave()),g=!0}catch{w(s.cantSave)}await T(),_(B.id)?.querySelector("[data-action=load]")?.focus()}else if(V=="rename")z(B);else if(V=="download")E(B.save);else if(V=="delete"){if(!await O(N,s.deleteConfirm.replace("[name]",$),s.delete,!0))return;await r.delete(B.id).catch(()=>w(s.cantSave)),await T(),p.focus()}}),o("[data-save-to-file]").addEventListener("click",()=>{b(),E(e.getSave()),g=!0}),o("[data-load-from-file]").addEventListener("click",()=>{b(),f.click()}),f.addEventListener("change",async()=>{const A=f.files?.[0];if(f.value="",!A)return;let P;try{P=JSON.parse(await A.text())}catch{w(s.notASave);return}m()&&!await O(l,s.loadConfirm.replace("[name]",A.name),s.load)||await D(P)}),{element:n,async open(){b(),S?.(),p.value="",n.open||n.showModal(),p.focus(),await T()},close(){S?.(),n.close()}}}var za=["bag","person","map","help","info","list","book","star","heart"],Xh=\'<path d="M18 6 6 18M6 6l12 12"/>\',Yh={bag:\'<path d="M4 10a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"/><path d="M8 10h8"/><path d="M8 18h8"/><path d="M8 22v-6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v6"/><path d="M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"/>\',person:\'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>\',map:\'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>\',help:\'<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>\',info:\'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>\',list:\'<path d="M3 6h.01M3 12h.01M3 18h.01M8 6h13M8 12h13M8 18h13"/>\',book:\'<path d="M12 7v14"/><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"/>\',star:\'<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>\',heart:\'<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>\'},Ua=e=>`<svg viewBox="0 0 24 24" aria-hidden="true">${e}</svg>`,jh=0;function Zh(e,t){const s=typeof t.strings?.close=="string"?t.strings.close:"Close",r=`squiffy-panel-${++jh}`,i=[],n=document.createElement("dialog");n.className="squiffy-panel-dialog",n.setAttribute("aria-labelledby",`${r}-heading`),n.innerHTML=`\n <div class="squiffy-panel-dialog-header">\n <h2 id="${r}-heading"></h2>\n <button type="button" class="squiffy-panel-dialog-close">${Ua(Xh)}</button>\n </div>\n <div class="squiffy-panel squiffy-panel-dialog-content"></div>`;const o=n.querySelector("h2"),c=n.querySelector(".squiffy-panel-dialog-close");c.title=s,c.setAttribute("aria-label",s),c.addEventListener("click",()=>n.close());const d=n.querySelector(".squiffy-panel-dialog-content");n.addEventListener("click",u=>{u.target===n&&n.close()}),(t.container??document.body).appendChild(n),i.push(()=>n.remove());let h=null;const p=t.panels.filter(u=>u&&typeof u.passage=="string"),a=t.side?p.filter(u=>u.position=="side"):[],f=new Map;let l=null;if(a.length&&t.side){l=document.createElement("aside"),l.className="squiffy-panels-side";for(const v of a){const _=document.createElement("section");_.className="squiffy-panel",_.dataset.passage=v.passage,_.setAttribute("aria-label",v.label||v.passage),l.appendChild(_),f.set(v,_)}const u=t.side;u.appendChild(l),u.classList.add("squiffy-has-side"),i.push(()=>{l.remove(),u.classList.remove("squiffy-has-side")})}const g=t.buttons.firstChild;for(const u of p){const v=u.label||u.passage,_=document.createElement("button");_.type="button",_.className="squiffy-header-button squiffy-panel-button",u.position=="side"&&f.has(u)&&_.classList.add("squiffy-panel-side-button"),_.dataset.passage=u.passage,_.setAttribute("aria-haspopup","dialog");const k=u.icon&&za.includes(u.icon)?Yh[u.icon]:null;k?(_.innerHTML=Ua(k),_.title=v,_.setAttribute("aria-label",v)):(_.classList.add("squiffy-panel-text-button"),_.textContent=v),_.addEventListener("click",()=>m(u)),t.buttons.insertBefore(_,g),i.push(()=>_.remove())}function m(u){h=u,o.textContent=u.label||u.passage,d.innerHTML=e.renderPassage(u.passage),n.open||n.showModal()}function y(){for(const[u,v]of f)v.innerHTML=e.renderPassage(u.passage),v.hidden=!v.textContent?.trim()&&!v.querySelector("img, svg, video, canvas, iframe");l&&(l.hidden=[...f.values()].every(u=>u.hidden)),n.open&&h&&(d.innerHTML=e.renderPassage(h.passage))}let S=!1;const w=()=>{S||(S=!0,queueMicrotask(()=>{S=!1,b||y()}))};for(const u of["set","navigated","storyUpdated"])i.push(e.on(u,w));n.addEventListener("close",()=>{h=null});let b=!1;return y(),{refresh:y,open(u){const v=p.find(_=>_.passage==u);v&&m(v)},dispose(){b=!0,n.open&&n.close();for(const u of i.splice(0))u()}}}var Kh=async e=>{let t,s,r,i,n,o=0,c=!1;const d=[],h=new su,p=[];let a=!1,f,l=0;const g=100;async function m(x){if(a||x.closest(".squiffy-output-section")!==r||x.classList.contains("disabled")||!Oa(r))return!1;const C=x.getAttribute("data-passage"),M=x.getAttribute("data-section");if((C!==null||M!==null)&&(l=0,Le("turns",(te("turns")||0)+1)),C!==null){let Ge;return S(C)||(w(x),Ge=u(x),Le("_turncount",te("_turncount")+1)),await I(x),C&&(n=null,await $(C,Ge)),h.emit("linkClick",{linkType:"passage"}),!0}if(M!==null)return await I(x),M&&await A(M),h.emit("linkClick",{linkType:"section"}),!0;const[F,re,pe]=Xa.handleLink(x);return F?(pe?.disableLink&&w(x),J(),h.emit("linkClick",{linkType:re}),!0):!1}async function y(x){const C=x.target;C.classList.contains("squiffy-link")&&await m(C)}function S(x){if(!x)return!1;const C=s?.passages;if(C&&x in C)return!!C[x].repeat;const M=t.sections[""]?.passages;return!!(M&&x in M&&M[x].repeat)}function w(x){x.classList.add("disabled"),x.setAttribute("tabindex","-1")}function b(x){x.classList.remove("disabled"),x.removeAttribute("tabindex")}function u(x){let C=0;for(const F of ye.querySelectorAll("[data-clicked]"))C=Math.max(C,Number(F.getAttribute("data-clicked"))||0);const M=String(C+1);return x.setAttribute("data-clicked",M),M}async function v(x){if(x&&x.section in t.sections){await A(x.section),x.passage!==void 0&&te("_section")==x.section&&await $(x.passage);return}if(!ve()){await A(t.start);return}await _()}async function _(){const x=i??r,C=x?.getAttribute("data-goto");C&&C in t.sections&&await R({section:C,after:Number(x.getAttribute("data-goto-after")||0)})}function k(){clearTimeout(f),f=void 0,Ne.goto=null,Ne.deactivate.clear()}function T(x){const C=Ne.deactivate;if(C.size==0)return;const M=String((te("_deactivations")||0)+1);Le("_deactivations",Number(M)),x.setAttribute("data-deactivates",M);for(const F of r.querySelectorAll("a.squiffy-link[data-passage]"))C.has(F.getAttribute("data-passage"))&&!F.classList.contains("disabled")&&(w(F),F.setAttribute("data-deactivated-by",M));C.clear()}function O(x){const C=x.getAttribute("data-deactivates");if(C)for(const M of r.querySelectorAll(`a.squiffy-link[data-deactivated-by="${C}"]`))b(M),M.removeAttribute("data-deactivated-by")}function L(x){const C=Ne.goto;return Ne.goto=null,C&&(x.setAttribute("data-goto",C.section),C.after&&x.setAttribute("data-goto-after",String(C.after))),C}async function R(x){if(x){if(x.after>0){f=setTimeout(()=>{f=void 0,l=0,A(x.section)},x.after);return}if(++l>g){l=0;const C=i??r;C.removeAttribute("data-goto");const M=`stopped after ${g} in a row without the player clicking anything, going to "${x.section}". Is there a loop?`;console.error("Squiffy error in {{goto}}:",M),C.insertAdjacentHTML("beforeend",Zt("Error in {{goto}}:",M)),J();return}await A(x.section)}}async function I(x){ii.runLinkAnimation(x),await V();const C=x.getAttribute("data-set");if(C){const M=JSON.parse(C);for(const F of M)q(F)}}function q(x){try{t.expressions?E(x):D(x)}catch(C){const M=C instanceof Error?C.message:String(C);console.error(`Squiffy error in "${x}":`,M),d.push(Zt(`Error in "${x}":`,M))}}function z(x,C,M){const F=C+"=",re=St(F,M),pe=typeof x=="string"?[x]:x;let Ge=St(F,Te.getAt(pe));C=="+"&&(Ge+=re),C=="-"&&(Ge-=re),C=="*"&&(Ge*=re),C=="/"&&(Ge/=re),Te.setAt(pe,Ge)}function W(x){return[x.attribute,...x.segments.map(C=>{if("name"in C)return C.name;const M=Ne.evaluate(C.index);if(typeof M!="string"&&typeof M!="number")throw new Error(`[${C.index.trim()}] should be a number or text, to say which value to set`);const F=String(M);return _r(F),F})]}function E(x){const C=Zn(x),M=C&&/^\\s*:=(.*)$/.exec(C.rest);if(C&&M){Te.setAt(W(C),ae.processText(M[1],!0));return}const F=C&&/^\\s*([+\\-*/]?)=(?!=)(.*)$/.exec(C.rest);if(C&&F){const[,Ge,bs]=F,_s=W(C),hr=Ne.evaluate(bs);Ge?z(_s,Ge,hr):Te.setAt(_s,hr);return}const re=/^\\s*not\\s+/.exec(x),pe=Zn(re?x.substring(re[0].length):x);if(!pe||pe.rest.trim())throw new Error("expected an attribute name, e.g. gold = 10, gold += 5, has_key or not has_key");Te.setAt(W(pe),!re)}function D(x){x=x.replace(/^(\\w*\\s*):=(.*)$/,(M,F,re)=>F+"="+ae.processText(re,!0));const C=/^([\\w]*)\\s*=\\s*(.*)$/.exec(x);if(C){const M=C[1];let F=C[2];F==="true"?Le(M,!0):F==="false"?Le(M,!1):isNaN(F)?(F.startsWith("@")&&(F=te(F.substring(1))),Le(M,F)):Le(M,parseFloat(F))}else{const M=/^([\\w]*)\\s*([+\\-*/])=\\s*(.*)$/.exec(x);if(M){const F=M[1],re=M[2],pe=M[3].trim();z(F,re,pe.startsWith("@")?te(pe.substring(1)):pe)}else{let F=!0;x.startsWith("not ")&&(x=x.substring(4),F=!1),Le(x,F)}}}async function A(x){k();const C=se();if(s=t.sections[x],!s)return;const M=te("_section");M!==null&&(Le("previous",te("_passage")??M),Le("previous_section",M)),te("_passage")!==null&&Le("_passage",null),Le("_section",x),te("turns")===null&&Te.setInternal("turns",0,!1),Te.setSeen(x);const F=t.sections[""];Wa([...F?.classes??[],...s.classes??[]]),(F?.clear||s.clear)&&Ee(),Be(x);const re=r;if(F&&(await B(F,"[[]]"),te("_section")!==x)){re.remove();return}if(await B(s,`[[${x}]]`),te("_section")!==x){re.remove();return}ur(r),Le("_turncount",0),T(r);const pe=L(r);Ds(),J();const Ge=se();Ge!=C&&h.emit("canGoBackChanged",{canGoBack:Ge}),h.emit("navigated",{section:x}),await R(pe)}let P=!1;function N(x,C=null,M){const F={get:te,set:Le,ui:{transition:Ya,write:ae.write,scrollToEnd:ae.scrollToEnd,afterWrite:re=>{if(!M)throw new Error("squiffy.ui.afterWrite can only be used in a section or passage\'s JavaScript");M.push(re)}},story:{go:re=>P?(Ne.goto??(Ne.goto={section:re,after:0}),Promise.resolve()):A(re),seen:re=>Te.getSeen(re),visits:re=>Te.getVisits(re)},element:Me,import:Ih,...C};t.js[x](F,te,Le)}async function B(x,C){x.attributes&&await j(x.attributes),x.music!==void 0&&Le("_music",x.music);for(const F of x.sounds??[])F=="stop"?et.stopSounds():et.play(F);const M=[];if(x.jsIndex!==void 0){const F=te("_section");if(N(x.jsIndex,null,M),te("_section")!==F)return}ae.write(x.text||"",C),P=!0;try{for(const F of M)F()}finally{P=!1}await V()}async function V(){a=!0,r.classList.add("links-disabled");for(const x of p)await x();p.length=0,a=!1,r.classList.remove("links-disabled")}async function $(x,C){k();const M=se();let F=s.passages&&s.passages[x];const re=t.sections[""];if(!F&&re&&re.passages&&(F=re.passages[x]),!F)throw`No passage named ${x} in the current section or master section`;Le("previous",te("_passage")??te("_section")),Le("_passage",x),Te.setSeen(x);const pe=[],Ge=[];if(re&&re.passages){const ft=re.passages[""];ft&&(pe.push(ft),Ge.push(()=>B(ft,"[[]][]")))}const bs=s.passages&&s.passages[""];bs&&(pe.push(bs),Ge.push(()=>B(bs,`[[${te("_section")}]][]`))),pe.push(F),Ge.push(()=>B(F,`[[${te("_section")}]][${x}]`));const _s="@"+te("_turncount");if(s.passages&&!F.repeat){if(_s in s.passages){const ft=s.passages[_s];pe.push(ft),Ge.push(()=>B(ft,`[[${te("_section")}]][${_s}]`))}if("@last"in s.passages&&te("_turncount")>=(s.passageCount||0)){const ft=s.passages["@last"];pe.push(ft),Ge.push(()=>B(ft,`[[${te("_section")}]][${_s}]`))}}const hr=pe.flatMap(ft=>ft.classes??[]);hr.length&&Wa([...si(),...hr]),pe.some(ft=>ft.clear)&&(Ee(),_e()),i=document.createElement("div"),i.classList.add("squiffy-output-passage"),i.setAttribute("data-passage",`${x}`),C&&i.setAttribute("data-clicked-link",C),r.appendChild(i);for(const ft of Ge)await ft();ur(r),T(i);const ed=L(i);Ds(),J();const ja=se();ja!=M&&h.emit("canGoBackChanged",{canGoBack:ja}),h.emit("navigated",{section:te("_section"),passage:x}),await R(ed)}async function j(x){for(const C of x)q(C)}function ee(){k(),Te.reset(),et.sync(),Bs(),nt.scroll==="element"||nt.scroll==="none"?(ye.innerHTML="",v()):location.reload()}function J(){Le("_output",ye.innerHTML)}function ve(){const x=()=>{t.uiJsIndex!==void 0&&N(t.uiJsIndex,{registerAnimation:ii.registerAnimation.bind(ii),registerHelper:Ne.handlebars.registerHelper.bind(Ne.handlebars),SafeString:Ne.handlebars.SafeString})};Te.load(),et.sync(),Bs();const C=te("_output");return C?(me(C),x(),rs.onLoad(),ur(r),!0):(x(),!1)}function me(x){ye.innerHTML=Mt(x),Se(),Re(),n=ye.querySelector(".squiffy-output-block:last-child"),s=t.sections[te("_section")]}function ue(){return{format:"squiffy-save",version:1,storyId:t.projectId??null,section:te("_section"),passage:te("_passage"),summary:Q(),savedAt:new Date().toISOString(),state:structuredClone(Te.store)}}function Q(){const C=r?.querySelectorAll(".squiffy-output-block")??[];for(const M of C){const F=ne(M);if(!F)continue;const re=[...M.querySelectorAll("h1, h2, h3, h4, h5, h6, p, li")].find(bs=>ne(bs));if(re&&/^H[1-6]$/.test(re.tagName)&&ne(M).startsWith(ne(re)))return ne(re).substring(0,100);if(F.length<=100)return F;const pe=F.substring(0,100),Ge=pe.lastIndexOf(" ");return(Ge>100/2?pe.substring(0,Ge):pe)+"…"}return""}function ne(x){const C=x.cloneNode(!0);return C.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, div, br, tr, blockquote").forEach(M=>M.after(" ")),(C.textContent??"").replace(/\\s+/g," ").trim()}function Oe(x){if(!x||typeof x!="object")return!1;const C=x;return C.format==="squiffy-save"&&C.version===1&&!!C.state&&typeof C.state=="object"&&!Array.isArray(C.state)&&typeof C.state._output=="string"}async function Ie(x){if(!Oe(x))return{success:!1,error:"notASave"};if(x.storyId&&t.projectId&&x.storyId!==t.projectId)return{success:!1,error:"wrongStory"};for(;a;)await new Promise(M=>setTimeout(M,50));k(),d.length=0,Te.reset();for(const[M,F]of Object.entries(x.state))Te.setInternal(M,F,!1);if(et.sync(),Bs(),vs={},o=0,c=!1,me(x.state._output),!s)return ye.innerHTML="",await A(t.start),h.emit("canGoBackChanged",{canGoBack:se()}),{success:!0};rs.onLoad(),ur(r),h.emit("canGoBackChanged",{canGoBack:se()});const C=te("_passage");return h.emit("navigated",C?{section:te("_section"),passage:C}:{section:te("_section")}),await _(),{success:!0}}function Ae(){n=document.createElement("div"),n.classList.add("squiffy-output-block"),(i||r)?.appendChild(n)}function Be(x){r&&(r.querySelectorAll("input, textarea, select").forEach(C=>{const M=C,F=M.getAttribute("data-attribute")||M.id;F&&Le(F,M.value),M.disabled||(M.disabled=!0,M.setAttribute("data-squiffy-disabled",""))}),r.querySelectorAll("[contenteditable]").forEach(C=>{const M=C.getAttribute("data-attribute")||C.id;M&&Le(M,C.innerHTML),C.getAttribute("contenteditable")!=="false"&&(C.setAttribute("contenteditable","false"),C.setAttribute("data-squiffy-disabled",""))})),i=null,_e(x),Ae()}function _e(x){r=document.createElement("div"),r.classList.add("squiffy-output-section"),r.setAttribute("data-section",x??te("_section")),x||r.setAttribute("data-clear","true"),ye.appendChild(r)}function ke(){return ye.querySelector(".squiffy-clear-stack")}function Ee(){let x=ke();x||(x=document.createElement("div"),x.classList.add("squiffy-clear-stack"),x.style.display="none",ye.prepend(x));const C=document.createElement("div");x.appendChild(C),c=!0;for(const M of[...ye.children])M!==x&&C.appendChild(M)}function Pe(){const x=ke();if(!x)return;for(const M of[...ye.children])M!==x&&M.remove();const C=x.children[x.children.length-1];for(const M of[...C.children])ye.appendChild(M);C.remove()}const ae={write:(x,C)=>{o=ye.scrollHeight;const M=d.splice(0).join("")+ae.renderHtml(x,!1).trim();n||Ae();const F=document.createElement("div");C&&F.setAttribute("data-source",C),F.innerHTML=M,rs.onWrite(F),n.appendChild(F),ur(r),ae.scrollToEnd()},clearScreen:()=>{Ee(),_e()},scrollToEnd:()=>{if(nt.scroll!=="none")if(c)if(c=!1,nt.scroll==="element")r.scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"});else{const x=Math.max(document.body.scrollTop,document.documentElement.scrollTop),C=ye.getBoundingClientRect().top+x;C<x&&window.scrollTo({top:C,behavior:"smooth"})}else if(nt.scroll==="element")ye.lastElementChild?.scrollIntoView({block:"end",inline:"nearest",behavior:"smooth"});else{let x=o;const C=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(x>C){const M=document.documentElement.scrollHeight-window.innerHeight;x>M&&(x=M),window.scrollTo({top:x,behavior:"smooth"})}}},processText:(x,C)=>Ne.process(x,C),renderHtml:(x,C)=>Mt(ae.processText(x,C))};function le(x){if(x.start!=t.start){t=x,Te.reset(),et.sync(),Bs(),et.preload(t.audio??[]),ye.innerHTML="",A(t.start);return}const C=t;t=x,et.preload(t.audio??[]),iu(C,x,ye,(F,re)=>{const pe=s;s=re,Wt=!0;try{return ae.renderHtml(F,!1)}finally{s=pe,Wt=!1}},w,F=>j(F)),Se(),Re(),h.emit("storyUpdated",{})}function xe(x){const C=t.sections[""]?.passages?.[x];if(!C)return Zt("Error in panel:",`there is no passage called "${x}" in the master section [[]]`);const M=Ne.goto,F=[...Ne.deactivate];Te.readOnly=!0;let re;try{re=ae.renderHtml(C.text||"",!1)}finally{Te.readOnly=!1,Ne.goto=M,Ne.deactivate=new Set(F)}const pe=document.createElement("template");return pe.innerHTML=re,pe.content.querySelectorAll("a.squiffy-link").forEach(w),pe.innerHTML}function Se(){const x=ye.querySelectorAll(".squiffy-output-section:last-child");r=x[x.length-1];const C=r.getAttribute("data-section");s=t.sections[C]}function Re(){i=r.querySelector(".squiffy-output-passage:last-child")}function H(){const x=ke(),C=ye.querySelectorAll(".squiffy-output-section").length+ye.querySelectorAll(".squiffy-output-passage").length;return x?C+x.children.length:C}function ce(x){x.querySelectorAll("[data-squiffy-disabled]").forEach(C=>{C.hasAttribute("contenteditable")?C.setAttribute("contenteditable","true"):C.disabled=!1,C.removeAttribute("data-squiffy-disabled")})}function se(){const x=i??r,C=[...ye.querySelectorAll("[data-goto]")].filter(M=>M!==x).length;return H()-C>1}function he(){if(a||!se())return;k();do ze();while((i??r).hasAttribute("data-goto")&&H()>1);et.sync(),Bs(),J(),se()||h.emit("canGoBackChanged",{canGoBack:!1});const x=i?.getAttribute("data-passage");h.emit("navigated",x?{section:te("_section"),passage:x}:{section:te("_section")})}function ze(){const x=ke();if(i){const C=i.getAttribute("data-passage"),M=i.getAttribute("data-clicked-link");$s(i.getAttribute("data-undo")),O(i),i.remove();let F=!1,re=!1;for(const pe of ye.children)if(pe!==x){if(pe.getAttribute("data-clear")=="true"&&pe.children.length==0){F=!0;continue}re=!0;break}if(F&&!re&&(Pe(),Se()),M)for(const pe of r.querySelectorAll(`a.squiffy-link[data-clicked="${M}"]`))b(pe),pe.removeAttribute("data-clicked");else if(C&&!S(C))for(const pe of r.querySelectorAll("a.squiffy-link[data-passage]"))pe.getAttribute("data-passage")==C&&b(pe);Re()}else{$s(r.getAttribute("data-undo")),r.remove();let C=!1;for(const M of[...ye.children])if(M!==x){C=!0;break}C||Pe(),Se(),Re(),ce(r)}}const Me=e.element,ye=document.createElement("div");Me.appendChild(ye),t=e.story;const Mt=Bh(e.resolveAssetUrl),nt={scroll:e.scroll||"body",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let dt="";nt.persist&&(e.storyId!==void 0?dt=e.storyId:window.location.protocol==="file:"?dt=t.id||"":dt=window.location.pathname,dt||(console.warn("Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled."),nt.persist=!1)),nt.scroll==="element"&&(ye.style.overflowY="auto"),ye.addEventListener("click",y),ye.addEventListener("keypress",async function(x){x.key==="Enter"&&await y(x)});let vs={};const hn=function(x,C){x!="_output"&&(x in vs||(vs[x]=C))},Ds=function(){(i??r).setAttribute("data-undo",JSON.stringify(vs)),vs={}},$s=function(x){if(!x)return;const C=JSON.parse(x);if(C)for(const M of Object.keys(C))Te.setInternal(M,C[M],!1)},Te=new ru(nt.persist,dt,nt.onSet,h,hn),te=Te.get.bind(Te),Le=Te.set.bind(Te),Ne=new tu(()=>t,Te,()=>s);let ti=!1,Wt=!1,Gt=1;const et=new Hh({resolveUrl:x=>Na(x)||!e.resolveAssetUrl?x:e.resolveAssetUrl(x.replace(/^(\\.\\/)+/,"")),getMusic:()=>te("_music"),mutedKey:nt.persist?"squiffy-muted:"+dt:void 0,onPlay:()=>{ti=!0,h.emit("sound",{})}});et.preload(t.audio??[]),h.on("set",({attribute:x})=>{if(x!="_music")return;const C=Gt;Gt=1,et.sync(C)});const at=x=>{const C=Number(x?.hash?.fade);return x?.hash&&"fade"in x.hash&&Number.isFinite(C)&&C>=0?C:1},ys=x=>typeof x=="object"&&x!==null&&"hash"in x;Ne.handlebars.registerHelper("music",(x,C)=>ys(x)?te("music"):(Te.readOnly||typeof x!="string"||(Gt=at(C),Le("_music",x||null),Gt=1),"")),Ne.handlebars.registerHelper("stopmusic",x=>(Te.readOnly||(Gt=at(x),Le("_music",null),Gt=1),"")),Ne.handlebars.registerHelper("sound",(x,C)=>{if(ys(x))return te("sound");if(Te.readOnly||Wt||typeof x!="string"||!x)return"";const M=Number(C?.hash?.volume??1);return et.play(x,M),""}),Ne.handlebars.registerHelper("stopsounds",()=>(!Te.readOnly&&!Wt&&et.stopSounds(),""));const we="_sectionclasses",Ue="_classes";let dn=[];const Xt=x=>{const C=te(x);return Array.isArray(C)?C.filter(M=>typeof M=="string"&&M.length>0):[]},si=()=>Xt(we),ri=x=>x.filter(C=>!ys(C)).flatMap(C=>String(C??"").split(/\\s+/)).filter(C=>C.length>0);function Wa(x){const C=[...new Set(x)],M=si();C.length==M.length&&C.every((F,re)=>F==M[re])||Le(we,C)}function Ga(x){for(const C of dn)x.includes(C)||Me.classList.remove(C);for(const C of x)Me.classList.add(C);dn=x}function Bs(){Ga([...new Set([...si(),...Xt(Ue)])])}h.on("set",({attribute:x})=>{(x==we||x==Ue)&&Bs()}),Ne.handlebars.registerHelper("addclass",(...x)=>{if(Te.readOnly)return"";const C=Xt(Ue),M=ri(x).filter(F=>!C.includes(F));return M.length&&Le(Ue,[...C,...M]),""}),Ne.handlebars.registerHelper("removeclass",(...x)=>{if(Te.readOnly)return"";const C=ri(x),M=Xt(Ue);return M.some(F=>C.includes(F))&&Le(Ue,M.filter(F=>!C.includes(F))),""}),Ne.handlebars.registerHelper("toggleclass",(...x)=>{if(Te.readOnly)return"";let C=Xt(Ue);for(const M of new Set(ri(x)))C=C.includes(M)?C.filter(F=>F!=M):[...C,M];return Le(Ue,C),""}),Ne.handlebars.registerHelper("hasclass",(...x)=>{const C=ri(x),M=[...si(),...Xt(Ue)];return C.length>0&&C.every(F=>M.includes(F))});const Xa=new hu,Jh=x=>x in t.sections&&t.sections[x].text||null,Qh=x=>s.passages&&x in s.passages?s.passages[x].text||null:"passages"in t.sections[""]&&t.sections[""].passages&&x in t.sections[""].passages&&t.sections[""].passages[x].text||null,Ya=x=>{p.push(x)},ii=new Lh,rs=new nu(ye,Ne,Te,Xa,Jh,Qh,ae.renderHtml,Ya,ii,h,Mt);return rs.add(Xs.ReplaceLabel()),rs.add(Xs.RotateSequencePlugin()),rs.add(Xs.RandomPlugin()),rs.add(Xs.LivePlugin()),rs.add(Xs.AnimatePlugin()),{begin:v,restart:ee,get:te,set:Le,clickLink:m,update:le,goBack:he,canGoBack:se,getSave:ue,loadSave:Ie,renderPassage:xe,isMuted:()=>et.isMuted(),setMuted:x=>et.setMuted(x),usesSound:()=>ti||!!t.audio?.length,dispose:()=>{k(),et.dispose(),Ga([])},on:(x,C)=>h.on(x,C),off:(x,C)=>h.off(x,C),once:(x,C)=>h.once(x,C)}};return At.PANEL_ICONS=za,At.SAVES_STRINGS=ei,At.SAVE_FILE_EXTENSION=un,At.createPanels=Zh,At.createSavesDialog=Gh,At.formatSaveTime=Va,At.indexedDbSaveSlots=qa,At.init=Kh,At.memorySaveSlots=Fa,At})({});\n\n//# sourceMappingURL=squiffy.runtime.global.js.map', _t = `/* Core Squiffy Runtime Styles. See https://squiffystory.com/styling/ for how to customise these. */
958
990
 
959
991
  /* Colours. Each has a light and a dark value, and light-dark() picks one from the page's
960
992
  color-scheme. This file doesn't set color-scheme itself, so a story embedded in a page stays
@@ -1620,7 +1652,7 @@ button.squiffy-panel-dialog-close svg
1620
1652
  stroke-linecap: round;
1621
1653
  stroke-linejoin: round;
1622
1654
  }
1623
- `, vt = `<!DOCTYPE html>
1655
+ `, St = `<!DOCTYPE html>
1624
1656
  <html>
1625
1657
  <!-- INFO -->
1626
1658
  <head>
@@ -1692,6 +1724,23 @@ button.squiffy-panel-dialog-close svg
1692
1724
  });
1693
1725
  }
1694
1726
 
1727
+ // The mute button (#444), shown if the story has music or sounds. Whether it's muted
1728
+ // is remembered for the story.
1729
+ const muteButton = document.getElementById('squiffy-mute');
1730
+ const updateMute = function () {
1731
+ const muted = squiffyApi.isMuted();
1732
+ muteButton.hidden = !squiffyApi.usesSound();
1733
+ muteButton.title = muted ? muteButton.dataset.unmute : muteButton.dataset.mute;
1734
+ muteButton.setAttribute('aria-label', muteButton.title);
1735
+ muteButton.classList.toggle('squiffy-muted', muted);
1736
+ };
1737
+ muteButton.addEventListener('click', function () {
1738
+ squiffyApi.setMuted(!squiffyApi.isMuted());
1739
+ updateMute();
1740
+ });
1741
+ squiffyApi.on('sound', updateMute);
1742
+ updateMute();
1743
+
1695
1744
  await squiffyApi.begin();
1696
1745
  // A saved game may have somewhere to go back to
1697
1746
  if (backButton) backButton.disabled = !squiffyApi.canGoBack();
@@ -1715,6 +1764,10 @@ button.squiffy-panel-dialog-close svg
1715
1764
  <button class="squiffy-header-button" id="restart" type="button" title="{{restart}}" aria-label="{{restart}}" data-confirm="{{restartConfirm}}">
1716
1765
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>
1717
1766
  </button>
1767
+ <button class="squiffy-header-button" id="squiffy-mute" type="button" data-mute="{{mute}}" data-unmute="{{unmute}}" hidden>
1768
+ <svg class="squiffy-icon-sound" viewBox="0 0 24 24" aria-hidden="true"><path d="M11 5 6 9H2v6h4l5 4V5z"/><path d="M15.5 8.5a5 5 0 0 1 0 7"/><path d="M19 5a10 10 0 0 1 0 14"/></svg>
1769
+ <svg class="squiffy-icon-muted" viewBox="0 0 24 24" aria-hidden="true"><path d="M11 5 6 9H2v6h4l5 4V5z"/><path d="m22 9-6 6M16 9l6 6"/></svg>
1770
+ </button>
1718
1771
  <button class="squiffy-header-button" id="squiffy-theme" type="button" data-switch-to-dark="{{switchToDark}}" data-switch-to-light="{{switchToLight}}">
1719
1772
  <svg class="squiffy-icon-dark" viewBox="0 0 24 24" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
1720
1773
  <svg class="squiffy-icon-light" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
@@ -1773,14 +1826,14 @@ button.squiffy-panel-dialog-close svg
1773
1826
  <\/script>
1774
1827
  </body>
1775
1828
  </html>
1776
- `, bt = `/* Page layout styles for an exported story. See https://squiffystory.com/styling/ for how to customise these. */
1829
+ `, Tt = `/* Page layout styles for an exported story. See https://squiffystory.com/styling/ for how to customise these. */
1777
1830
 
1778
1831
  :root
1779
1832
  {
1780
1833
  /* The width of the story text */
1781
1834
  --squiffy-max-width: 42rem;
1782
- /* The story's font. Charter, Sitka Text, Cambria or Georgia, whichever the reader has */
1783
- --squiffy-font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
1835
+ /* The story's font. Charter, or Georgia if the reader doesn't have it */
1836
+ --squiffy-font-family: Charter, "Bitstream Charter", Georgia, serif;
1784
1837
  /* The size of the story text. The header's buttons are smaller, and don't change with it */
1785
1838
  --squiffy-font-size: 1.125rem;
1786
1839
  /* The space between lines of text */
@@ -1865,6 +1918,14 @@ button#squiffy-theme[data-next="light"] .squiffy-icon-dark
1865
1918
  display: none;
1866
1919
  }
1867
1920
 
1921
+ /* The mute button (#444), for a story with music or sounds. It shows a speaker, crossed out
1922
+ when the story is muted. */
1923
+ button#squiffy-mute.squiffy-muted .squiffy-icon-sound,
1924
+ button#squiffy-mute:not(.squiffy-muted) .squiffy-icon-muted
1925
+ {
1926
+ display: none;
1927
+ }
1928
+
1868
1929
  /* With a side panel (squiffy.json's "panels"), the page is wider, with the panel to the right of
1869
1930
  the story. It stays in view as the story scrolls, under the header. On a narrower screen, it's a
1870
1931
  button in the header instead. */
@@ -1917,47 +1978,47 @@ div#squiffy img
1917
1978
  max-width: 100%;
1918
1979
  height: auto;
1919
1980
  }
1920
- `, kt = "@textadventures/squiffy-packager", _t = "7.0.0-beta.6", wt = {
1981
+ `, At = "@textadventures/squiffy-packager", Ct = "7.0.0-beta.7", Et = {
1921
1982
  type: "git",
1922
1983
  url: "git+https://github.com/textadventures/squiffy.git",
1923
1984
  directory: "packager"
1924
- }, xt = { access: "public" }, St = "dist/packager.js", Tt = "dist/packager.d.ts", Ct = {
1985
+ }, Pt = { access: "public" }, $t = "dist/packager.js", Lt = "dist/packager.d.ts", Ot = {
1925
1986
  build: "vite build",
1926
1987
  test: "vitest --run",
1927
1988
  dev: "vitest"
1928
- }, At = "Alex Warren", Et = [
1989
+ }, Rt = "Alex Warren", qt = [
1929
1990
  "CrisisSDK",
1930
1991
  "mrangel",
1931
1992
  "Luis Felipe Morales"
1932
1993
  ];
1933
- var Pt = {
1994
+ var It = {
1934
1995
  fflate: "^0.8.3",
1935
- "squiffy-compiler": "^7.0.0-beta.6",
1936
- "squiffy-runtime": "^7.0.0-beta.6"
1937
- }, $t = {
1996
+ "squiffy-compiler": "^7.0.0-beta.7",
1997
+ "squiffy-runtime": "^7.0.0-beta.7"
1998
+ }, Mt = {
1938
1999
  esbuild: "^0.28.2",
1939
2000
  tsx: "^4.23.15",
1940
2001
  typescript: "^6.0.3",
1941
2002
  vite: "^8.3.8",
1942
2003
  "vite-plugin-dts": "^5.1.2",
1943
2004
  vitest: "^5.1.0"
1944
- }, Lt = ["dist"], Rt = "module", qt = {
1945
- name: kt,
1946
- version: _t,
1947
- repository: wt,
1948
- publishConfig: xt,
1949
- main: St,
1950
- types: Tt,
1951
- scripts: Ct,
1952
- author: At,
1953
- contributors: Et,
2005
+ }, Nt = ["dist"], Bt = "module", Dt = {
2006
+ name: At,
2007
+ version: Ct,
2008
+ repository: Et,
2009
+ publishConfig: Pt,
2010
+ main: $t,
2011
+ types: Lt,
2012
+ scripts: Ot,
2013
+ author: Rt,
2014
+ contributors: qt,
1954
2015
  license: "MIT",
1955
2016
  description: "",
1956
- dependencies: Pt,
1957
- devDependencies: $t,
1958
- files: Lt,
1959
- type: Rt
1960
- }, Ot = qt.version, It = {
2017
+ dependencies: It,
2018
+ devDependencies: Mt,
2019
+ files: Nt,
2020
+ type: Bt
2021
+ }, Ht = Dt.version, Ft = {
1961
2022
  apng: "image/apng",
1962
2023
  avif: "image/avif",
1963
2024
  bmp: "image/bmp",
@@ -1989,86 +2050,92 @@ var Pt = {
1989
2050
  pdf: "application/pdf",
1990
2051
  json: "application/json",
1991
2052
  txt: "text/plain"
1992
- }, Nt = (s) => It[s.split(".").pop()?.toLowerCase() ?? ""] ?? "application/octet-stream", Pe = (s) => {
2053
+ }, ce = (s) => Ft[s.split(".").pop()?.toLowerCase() ?? ""] ?? "application/octet-stream", ue = (s) => {
1993
2054
  const e = s.replace(/\\/g, "/").replace(/^(\.\/)+/, "");
1994
2055
  if (!e || e.startsWith("/") || /^[a-z]:/i.test(e) || e.split("/").includes("..")) throw new Error(`Invalid asset path: ${s}`);
1995
2056
  return e;
1996
- }, Mt = (s) => {
2057
+ }, Le = (s) => {
1997
2058
  let e = "";
1998
2059
  for (let n = 0; n < s.length; n += 32768) e += String.fromCharCode(...s.subarray(n, n + 32768));
1999
2060
  return btoa(e);
2000
- }, Bt = (s) => s.replace(/[&<>"']/g, (e) => `&#${e.charCodeAt(0)};`), $e = (s) => JSON.stringify(s).replace(/</g, "\\u003c"), zt = async (s, e = !1) => {
2061
+ }, zt = (s) => s.replace(/[&<>"']/g, (e) => `&#${e.charCodeAt(0)};`), Oe = (s) => JSON.stringify(s).replace(/</g, "\\u003c"), Wt = async (s, e = !1) => {
2001
2062
  const t = typeof e == "boolean" ? { createZip: e } : e, n = {}, r = s.getUiInfo(), i = `<!--
2002
2063
 
2003
- Created with Squiffy ${Ot}
2064
+ Created with Squiffy ${Ht}
2004
2065
 
2005
2066
  https://squiffystory.com
2006
2067
  https://github.com/textadventures/squiffy
2007
2068
 
2008
- -->`, l = yt.toString() + `
2069
+ -->`, a = _t.toString() + `
2009
2070
 
2010
- ` + bt.toString(), c = await s.getJs(), p = {};
2011
- for (const [y, h] of Object.entries(t.assets ?? {})) p[Pe(y)] = h;
2012
- const u = /* @__PURE__ */ new Set(), o = (y) => {
2071
+ ` + Tt.toString(), c = await s.getJs(), p = {};
2072
+ for (const [g, h] of Object.entries(t.assets ?? {})) p[ue(g)] = h;
2073
+ const u = /* @__PURE__ */ new Set(), o = (g) => {
2013
2074
  if (!t.inlineHtml) return;
2014
2075
  let h;
2015
2076
  try {
2016
- h = Pe(y);
2077
+ h = ue(g);
2017
2078
  } catch {
2018
2079
  return;
2019
2080
  }
2020
- const x = p[h];
2021
- if (x)
2022
- return u.add(h), new TextDecoder().decode(x);
2023
- }, a = r.externalScripts.map((y) => {
2024
- const h = o(y);
2025
- return h === void 0 ? `<script src="${y}"><\/script>` : `<script>
2081
+ const _ = p[h];
2082
+ if (_)
2083
+ return u.add(h), new TextDecoder().decode(_);
2084
+ }, l = r.externalScripts.map((g) => {
2085
+ const h = o(g);
2086
+ return h === void 0 ? `<script src="${g}"><\/script>` : `<script>
2026
2087
  ` + h.replace(/<\/(script)/gi, "<\\/$1") + `
2027
2088
  <\/script>`;
2028
2089
  }).join(`
2029
- `), f = r.externalStylesheets.map((y) => {
2030
- const h = o(y);
2031
- return h === void 0 ? `<link rel="stylesheet" href="${y}"/>` : `<style>
2090
+ `), d = /* @__PURE__ */ new Set(), m = r.externalStylesheets.map((g) => {
2091
+ let h = o(g);
2092
+ return h === void 0 ? `<link rel="stylesheet" href="${g}"/>` : (h = wt(h, (_) => {
2093
+ const b = xt(ue(g), _), v = b === null ? void 0 : p[b];
2094
+ if (!(b === null || !v))
2095
+ return ce(b).startsWith("font/") && d.add(b), `data:${ce(b)};base64,${Le(v)}`;
2096
+ }), `<style>
2032
2097
  ` + h.replace(/<\/(style)/gi, "<\\/$1") + `
2033
- </style>`;
2098
+ </style>`);
2034
2099
  }).join(`
2035
2100
  `);
2036
- let d = "", k, b, w;
2101
+ let w = "", k, S, P;
2037
2102
  if (t.inlineHtml) {
2038
- if (k = `<style>
2039
- ` + l + `
2040
- </style>`, b = `<script>
2041
- ` + Ee + `
2042
- <\/script>`, w = `<script>
2103
+ k = `<style>
2104
+ ` + a + `
2105
+ </style>`, S = `<script>
2106
+ ` + $e + `
2107
+ <\/script>`, P = `<script>
2043
2108
  ` + c + `
2044
- <\/script>`, Object.keys(p).some((y) => !u.has(y))) {
2045
- const y = Object.fromEntries(Object.entries(p).filter(([h]) => !u.has(h)).map(([h, x]) => [h, `data:${Nt(h)};base64,${Mt(x)}`]));
2046
- w += `
2109
+ <\/script>`;
2110
+ const g = (h) => !u.has(h) && !d.has(h);
2111
+ if (Object.keys(p).some(g)) {
2112
+ const h = Object.fromEntries(Object.entries(p).filter(([_]) => g(_)).map(([_, b]) => [_, `data:${ce(_)};base64,${Le(b)}`]));
2113
+ P += `
2047
2114
  <script>
2048
- var squiffyAssetUrls = ` + $e(y) + `;
2049
- <\/script>`, d = 'resolveAssetUrl: function (path) { return squiffyAssetUrls[path.replace(/^(\\.\\/)+/, "")] || path; },';
2115
+ var squiffyAssetUrls = ` + Oe(h) + `;
2116
+ <\/script>`, w = 'resolveAssetUrl: function (path) { return squiffyAssetUrls[path.replace(/^(\\.\\/)+/, "")] || path; },';
2050
2117
  }
2051
2118
  } else
2052
- k = '<link rel="stylesheet" href="style.css"/>', b = '<script src="squiffy.runtime.global.js"><\/script>', w = '<script src="story.js"><\/script>', n["story.js"] = c, n["squiffy.runtime.global.js"] = Ee, n["style.css"] = l;
2053
- let g = vt.toString();
2054
- g = g.replace(/[ \t]*<!-- BACK_BUTTON -->\n([^]*?)[ \t]*<!-- \/BACK_BUTTON -->\n/, (y, h) => t.backButton === !1 ? "" : h), g = g.replace(/[ \t]*<!-- SAVE_BUTTON -->\n([^]*?)[ \t]*<!-- \/SAVE_BUTTON -->\n/, (y, h) => t.saveButton === !1 ? "" : h);
2055
- const A = {
2056
- ...et,
2119
+ k = '<link rel="stylesheet" href="style.css"/>', S = '<script src="squiffy.runtime.global.js"><\/script>', P = '<script src="story.js"><\/script>', n["story.js"] = c, n["squiffy.runtime.global.js"] = $e, n["style.css"] = a;
2120
+ let f = St.toString();
2121
+ f = f.replace(/[ \t]*<!-- BACK_BUTTON -->\n([^]*?)[ \t]*<!-- \/BACK_BUTTON -->\n/, (g, h) => t.backButton === !1 ? "" : h), f = f.replace(/[ \t]*<!-- SAVE_BUTTON -->\n([^]*?)[ \t]*<!-- \/SAVE_BUTTON -->\n/, (g, h) => t.saveButton === !1 ? "" : h);
2122
+ const $ = {
2123
+ ...st,
2057
2124
  ...t.strings
2058
2125
  };
2059
- return g = g.replace(/\{\{(\w+)\}\}/g, (y, h) => Object.prototype.hasOwnProperty.call(A, h) ? Bt(A[h]) : y), g = g.replace("/* PAGE_STRINGS */", () => $e(A)), g = g.replace("<!-- INFO -->", () => i), g = g.replace("<!-- TITLE -->", () => r.title), g = g.replace("<!-- SCRIPTS -->", () => a), g = g.replace("<!-- STYLESHEETS -->", () => f), g = g.replace("<!-- STYLE_CONTENT -->", () => k), g = g.replace("<!-- RUNTIME_CONTENT -->", () => b), g = g.replace("<!-- STORY_CONTENT -->", () => w), g = g.replace(/\n([ \t]*)\/\* ASSET_OPTIONS \*\//, (y, h) => d ? `
2060
- ` + h + d : ""), n["index.html"] = g, {
2126
+ return f = f.replace(/\{\{(\w+)\}\}/g, (g, h) => Object.prototype.hasOwnProperty.call($, h) ? zt($[h]) : g), f = f.replace("/* PAGE_STRINGS */", () => Oe($)), f = f.replace("<!-- INFO -->", () => i), f = f.replace("<!-- TITLE -->", () => r.title), f = f.replace("<!-- SCRIPTS -->", () => l), f = f.replace("<!-- STYLESHEETS -->", () => m), f = f.replace("<!-- STYLE_CONTENT -->", () => k), f = f.replace("<!-- RUNTIME_CONTENT -->", () => S), f = f.replace("<!-- STORY_CONTENT -->", () => P), f = f.replace(/\n([ \t]*)\/\* ASSET_OPTIONS \*\//, (g, h) => w ? `
2127
+ ` + h + w : ""), n["index.html"] = f, {
2061
2128
  files: n,
2062
- zip: t.createZip ? Qe({
2129
+ zip: t.createZip ? tt({
2063
2130
  ...t.inlineHtml ? {} : p,
2064
- ...Object.fromEntries(Object.entries(n).map(([y, h]) => [y, pe(h)]))
2131
+ ...Object.fromEntries(Object.entries(n).map(([g, h]) => [g, fe(h)]))
2065
2132
  }) : void 0
2066
2133
  };
2067
2134
  };
2068
2135
  export {
2069
- zt as createPackage,
2070
- Nt as getMimeType,
2071
- Pe as normaliseAssetPath
2136
+ Wt as createPackage,
2137
+ ce as getMimeType,
2138
+ ue as normaliseAssetPath
2072
2139
  };
2073
2140
 
2074
2141
  //# sourceMappingURL=packager.js.map