@manyducks.co/dolla 2.0.0-alpha.49 → 2.0.0-alpha.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  var Ne = Object.defineProperty;
2
- var xe = (t, e, s) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var f = (t, e, s) => xe(t, typeof e != "symbol" ? e + "" : e, s);
2
+ var xe = (t, e, n) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var c = (t, e, n) => xe(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  var E = /* @__PURE__ */ ((t) => (t[t.Computed = 1] = "Computed", t[t.Effect = 2] = "Effect", t[t.Tracking = 4] = "Tracking", t[t.Notified = 8] = "Notified", t[t.Recursed = 16] = "Recursed", t[t.Dirty = 32] = "Dirty", t[t.PendingComputed = 64] = "PendingComputed", t[t.PendingEffect = 128] = "PendingEffect", t[t.Propagated = 224] = "Propagated", t))(E || {});
5
- function oe({
5
+ function re({
6
6
  updateComputed: t,
7
7
  notifyEffect: e
8
8
  }) {
9
- let s, n;
9
+ let n, s;
10
10
  return {
11
11
  /**
12
12
  * Links a given dependency and subscriber if they are not already linked.
@@ -15,18 +15,18 @@ function oe({
15
15
  * @param sub - The subscriber that depends on this dependency.
16
16
  * @returns The newly created link object if the two are not already linked; otherwise `undefined`.
17
17
  */
18
- link(o, u) {
18
+ link(r, u) {
19
19
  const l = u.depsTail;
20
- if (l !== void 0 && l.dep === o)
20
+ if (l !== void 0 && l.dep === r)
21
21
  return;
22
22
  const d = l !== void 0 ? l.nextDep : u.deps;
23
- if (d !== void 0 && d.dep === o) {
23
+ if (d !== void 0 && d.dep === r) {
24
24
  u.depsTail = d;
25
25
  return;
26
26
  }
27
- const a = o.subsTail;
27
+ const a = r.subsTail;
28
28
  if (!(a !== void 0 && a.sub === u && p(a, u)))
29
- return i(o, u, d, l);
29
+ return i(r, u, d, l);
30
30
  },
31
31
  /**
32
32
  * Traverses and marks subscribers starting from the provided link.
@@ -37,27 +37,27 @@ function oe({
37
37
  *
38
38
  * @param link - The starting link from which propagation begins.
39
39
  */
40
- propagate(o) {
41
- let u = 32, l = o, d = 0;
40
+ propagate(r) {
41
+ let u = 32, l = r, d = 0;
42
42
  e: do {
43
- const a = o.sub, h = a.flags;
44
- if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(o, a) && (a.flags = h | 16 | u | 8, a.subs !== void 0)) {
45
- const w = a.subs;
46
- if (w !== void 0) {
47
- w.nextSub !== void 0 ? (w.prevSub = l, o = l = w, u = 64, ++d) : (o = w, u = h & 2 ? 128 : 64);
43
+ const a = r.sub, h = a.flags;
44
+ if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(r, a) && (a.flags = h | 16 | u | 8, a.subs !== void 0)) {
45
+ const b = a.subs;
46
+ if (b !== void 0) {
47
+ b.nextSub !== void 0 ? (b.prevSub = l, r = l = b, u = 64, ++d) : (r = b, u = h & 2 ? 128 : 64);
48
48
  continue;
49
49
  }
50
- h & 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a);
51
- } else h & (4 | u) ? !(h & u) && h & 224 && p(o, a) && (a.flags = h | u) : (a.flags = h | u | 8, (h & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a));
52
- if ((o = l.nextSub) !== void 0) {
53
- l = o, u = d ? 64 : 32;
50
+ h & 2 && (s !== void 0 ? s.depsTail.nextDep = a.deps : n = a, s = a);
51
+ } else h & (4 | u) ? !(h & u) && h & 224 && p(r, a) && (a.flags = h | u) : (a.flags = h | u | 8, (h & 10) === 2 && (s !== void 0 ? s.depsTail.nextDep = a.deps : n = a, s = a));
52
+ if ((r = l.nextSub) !== void 0) {
53
+ l = r, u = d ? 64 : 32;
54
54
  continue;
55
55
  }
56
56
  for (; d; ) {
57
57
  --d;
58
58
  const W = l.dep.subs;
59
- if (l = W.prevSub, W.prevSub = void 0, (o = l.nextSub) !== void 0) {
60
- l = o, u = d ? 64 : 32;
59
+ if (l = W.prevSub, W.prevSub = void 0, (r = l.nextSub) !== void 0) {
60
+ l = r, u = d ? 64 : 32;
61
61
  continue e;
62
62
  }
63
63
  }
@@ -72,8 +72,8 @@ function oe({
72
72
  *
73
73
  * @param sub - The subscriber to start tracking.
74
74
  */
75
- startTracking(o) {
76
- o.depsTail = void 0, o.flags = o.flags & -249 | 4;
75
+ startTracking(r) {
76
+ r.depsTail = void 0, r.flags = r.flags & -249 | 4;
77
77
  },
78
78
  /**
79
79
  * Concludes tracking of dependencies for the specified subscriber.
@@ -83,13 +83,13 @@ function oe({
83
83
  *
84
84
  * @param sub - The subscriber whose tracking is ending.
85
85
  */
86
- endTracking(o) {
87
- const u = o.depsTail;
86
+ endTracking(r) {
87
+ const u = r.depsTail;
88
88
  if (u !== void 0) {
89
89
  const l = u.nextDep;
90
90
  l !== void 0 && (g(l), u.nextDep = void 0);
91
- } else o.deps !== void 0 && (g(o.deps), o.deps = void 0);
92
- o.flags &= -5;
91
+ } else r.deps !== void 0 && (g(r.deps), r.deps = void 0);
92
+ r.flags &= -5;
93
93
  },
94
94
  /**
95
95
  * Updates the dirty flag for the given subscriber based on its dependencies.
@@ -101,8 +101,8 @@ function oe({
101
101
  * @param flags - The current flag set for this subscriber.
102
102
  * @returns `true` if the subscriber is marked as Dirty; otherwise `false`.
103
103
  */
104
- updateDirtyFlag(o, u) {
105
- return r(o.deps) ? (o.flags = u | 32, !0) : (o.flags = u & -65, !1);
104
+ updateDirtyFlag(r, u) {
105
+ return o(r.deps) ? (r.flags = u | 32, !0) : (r.flags = u & -65, !1);
106
106
  },
107
107
  /**
108
108
  * Updates the computed subscriber if necessary before its value is accessed.
@@ -114,10 +114,10 @@ function oe({
114
114
  * @param computed - The computed subscriber to update.
115
115
  * @param flags - The current flag set for this subscriber.
116
116
  */
117
- processComputedUpdate(o, u) {
118
- if ((u & 32 || (r(o.deps) || (o.flags = u & -65, !1))) && t(o)) {
119
- const l = o.subs;
120
- l !== void 0 && c(l);
117
+ processComputedUpdate(r, u) {
118
+ if ((u & 32 || (o(r.deps) || (r.flags = u & -65, !1))) && t(r)) {
119
+ const l = r.subs;
120
+ l !== void 0 && f(l);
121
121
  }
122
122
  },
123
123
  /**
@@ -131,10 +131,10 @@ function oe({
131
131
  * @param sub - The subscriber which may have pending effects.
132
132
  * @param flags - The current flags on the subscriber to check.
133
133
  */
134
- processPendingInnerEffects(o, u) {
134
+ processPendingInnerEffects(r, u) {
135
135
  if (u & 128) {
136
- o.flags = u & -129;
137
- let l = o.deps;
136
+ r.flags = u & -129;
137
+ let l = r.deps;
138
138
  do {
139
139
  const d = l.dep;
140
140
  "flags" in d && d.flags & 2 && d.flags & 224 && e(d), l = l.nextDep;
@@ -149,70 +149,70 @@ function oe({
149
149
  * notifications may be triggered until fully handled.
150
150
  */
151
151
  processEffectNotifications() {
152
- for (; s !== void 0; ) {
153
- const o = s, u = o.depsTail, l = u.nextDep;
154
- l !== void 0 ? (u.nextDep = void 0, s = l.sub) : (s = void 0, n = void 0), e(o) || (o.flags &= -9);
152
+ for (; n !== void 0; ) {
153
+ const r = n, u = r.depsTail, l = u.nextDep;
154
+ l !== void 0 ? (u.nextDep = void 0, n = l.sub) : (n = void 0, s = void 0), e(r) || (r.flags &= -9);
155
155
  }
156
156
  }
157
157
  };
158
- function i(o, u, l, d) {
158
+ function i(r, u, l, d) {
159
159
  const a = {
160
- dep: o,
160
+ dep: r,
161
161
  sub: u,
162
162
  nextDep: l,
163
163
  prevSub: void 0,
164
164
  nextSub: void 0
165
165
  };
166
- if (d === void 0 ? u.deps = a : d.nextDep = a, o.subs === void 0)
167
- o.subs = a;
166
+ if (d === void 0 ? u.deps = a : d.nextDep = a, r.subs === void 0)
167
+ r.subs = a;
168
168
  else {
169
- const h = o.subsTail;
169
+ const h = r.subsTail;
170
170
  a.prevSub = h, h.nextSub = a;
171
171
  }
172
- return u.depsTail = a, o.subsTail = a, a;
172
+ return u.depsTail = a, r.subsTail = a, a;
173
173
  }
174
- function r(o) {
174
+ function o(r) {
175
175
  let u = 0, l;
176
176
  e: do {
177
177
  l = !1;
178
- const d = o.dep;
178
+ const d = r.dep;
179
179
  if ("flags" in d) {
180
180
  const a = d.flags;
181
181
  if ((a & 33) === 33) {
182
182
  if (t(d)) {
183
183
  const h = d.subs;
184
- h.nextSub !== void 0 && c(h), l = !0;
184
+ h.nextSub !== void 0 && f(h), l = !0;
185
185
  }
186
186
  } else if ((a & 65) === 65) {
187
187
  const h = d.subs;
188
- h.nextSub !== void 0 && (h.prevSub = o), o = d.deps, ++u;
188
+ h.nextSub !== void 0 && (h.prevSub = r), r = d.deps, ++u;
189
189
  continue;
190
190
  }
191
191
  }
192
- if (!l && o.nextDep !== void 0) {
193
- o = o.nextDep;
192
+ if (!l && r.nextDep !== void 0) {
193
+ r = r.nextDep;
194
194
  continue;
195
195
  }
196
196
  if (u) {
197
- let a = o.sub;
197
+ let a = r.sub;
198
198
  do {
199
199
  --u;
200
200
  const h = a.subs;
201
201
  if (l) {
202
202
  if (t(a)) {
203
- (o = h.prevSub) !== void 0 ? (h.prevSub = void 0, c(a.subs), a = o.sub) : a = h.sub;
203
+ (r = h.prevSub) !== void 0 ? (h.prevSub = void 0, f(a.subs), a = r.sub) : a = h.sub;
204
204
  continue;
205
205
  }
206
206
  } else
207
207
  a.flags &= -65;
208
- if ((o = h.prevSub) !== void 0) {
209
- if (h.prevSub = void 0, o.nextDep !== void 0) {
210
- o = o.nextDep;
208
+ if ((r = h.prevSub) !== void 0) {
209
+ if (h.prevSub = void 0, r.nextDep !== void 0) {
210
+ r = r.nextDep;
211
211
  continue e;
212
212
  }
213
- a = o.sub;
213
+ a = r.sub;
214
214
  } else {
215
- if ((o = h.nextDep) !== void 0)
215
+ if ((r = h.nextDep) !== void 0)
216
216
  continue e;
217
217
  a = h.sub;
218
218
  }
@@ -222,18 +222,18 @@ function oe({
222
222
  return l;
223
223
  } while (!0);
224
224
  }
225
- function c(o) {
225
+ function f(r) {
226
226
  do {
227
- const u = o.sub, l = u.flags;
228
- (l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = u.deps : s = u, n = u)), o = o.nextSub;
229
- } while (o !== void 0);
227
+ const u = r.sub, l = u.flags;
228
+ (l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (s !== void 0 ? s.depsTail.nextDep = u.deps : n = u, s = u)), r = r.nextSub;
229
+ } while (r !== void 0);
230
230
  }
231
- function p(o, u) {
231
+ function p(r, u) {
232
232
  const l = u.depsTail;
233
233
  if (l !== void 0) {
234
234
  let d = u.deps;
235
235
  do {
236
- if (d === o)
236
+ if (d === r)
237
237
  return !0;
238
238
  if (d === l)
239
239
  break;
@@ -242,47 +242,47 @@ function oe({
242
242
  }
243
243
  return !1;
244
244
  }
245
- function g(o) {
245
+ function g(r) {
246
246
  do {
247
- const u = o.dep, l = o.nextDep, d = o.nextSub, a = o.prevSub;
247
+ const u = r.dep, l = r.nextDep, d = r.nextSub, a = r.prevSub;
248
248
  if (d !== void 0 ? d.prevSub = a : u.subsTail = a, a !== void 0 ? a.nextSub = d : u.subs = d, u.subs === void 0 && "deps" in u) {
249
249
  const h = u.flags;
250
250
  h & 32 || (u.flags = h | 32);
251
- const w = u.deps;
252
- if (w !== void 0) {
253
- o = w, u.depsTail.nextDep = l, u.deps = void 0, u.depsTail = void 0;
251
+ const b = u.deps;
252
+ if (b !== void 0) {
253
+ r = b, u.depsTail.nextDep = l, u.deps = void 0, u.depsTail = void 0;
254
254
  continue;
255
255
  }
256
256
  }
257
- o = l;
258
- } while (o !== void 0);
257
+ r = l;
258
+ } while (r !== void 0);
259
259
  }
260
260
  }
261
261
  var {
262
262
  link: Je,
263
263
  propagate: Qe,
264
264
  updateDirtyFlag: Ee,
265
- startTracking: re,
265
+ startTracking: oe,
266
266
  endTracking: ue,
267
267
  processEffectNotifications: Ye,
268
268
  processComputedUpdate: et,
269
269
  processPendingInnerEffects: ce
270
- } = oe({
270
+ } = re({
271
271
  updateComputed(t) {
272
- re(t);
272
+ oe(t);
273
273
  try {
274
- const e = t.currentValue, s = t.getter(e);
275
- return e !== s ? (t.currentValue = s, !0) : !1;
274
+ const e = t.currentValue, n = t.getter(e);
275
+ return e !== n ? (t.currentValue = n, !0) : !1;
276
276
  } finally {
277
277
  ue(t);
278
278
  }
279
279
  },
280
280
  notifyEffect(t) {
281
- return "isScope" in t ? Te(t) : Me(t);
281
+ return "isScope" in t ? ke(t) : Me(t);
282
282
  }
283
283
  });
284
284
  function Se(t) {
285
- re(t);
285
+ oe(t);
286
286
  try {
287
287
  t.fn();
288
288
  } finally {
@@ -293,10 +293,10 @@ function Me(t) {
293
293
  const e = t.flags;
294
294
  return e & 32 || e & 64 && Ee(t, e) ? Se(t) : ce(t, t.flags), !0;
295
295
  }
296
- function Te(t) {
296
+ function ke(t) {
297
297
  return t.flags & 128 ? (ce(t, t.flags), !0) : !1;
298
298
  }
299
- function T(t) {
299
+ function k(t) {
300
300
  const e = typeof t;
301
301
  switch (e) {
302
302
  case "undefined":
@@ -311,41 +311,41 @@ function T(t) {
311
311
  return e;
312
312
  }
313
313
  }
314
- function L(t) {
314
+ function T(t) {
315
315
  return Array.isArray(t);
316
316
  }
317
317
  function V(t, e) {
318
- return L(e) && e.every((s) => t(s));
318
+ return T(e) && e.every((n) => t(n));
319
319
  }
320
- function tt(t, e, s) {
320
+ function tt(t, e, n) {
321
321
  if (V(t, e))
322
322
  return !0;
323
- throw new TypeError(I(e, s));
323
+ throw new TypeError(I(e, n));
324
324
  }
325
- function k(t) {
325
+ function L(t) {
326
326
  return typeof t == "string";
327
327
  }
328
328
  function st(t, e) {
329
- if (k(t))
329
+ if (L(t))
330
330
  return !0;
331
331
  throw new TypeError(I(t, e ?? "Expected a string. Got type: %t, value: %v"));
332
332
  }
333
333
  function m(t) {
334
- return T(t) === "function";
334
+ return k(t) === "function";
335
335
  }
336
- function Le(t) {
336
+ function Te(t) {
337
337
  return typeof t == "number" && !isNaN(t);
338
338
  }
339
339
  function nt(...t) {
340
- const e = t[0], s = k(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
340
+ const e = t[0], n = L(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, s = (i) => {
341
341
  if (i instanceof e)
342
342
  return !0;
343
- throw new TypeError(I(i, s));
343
+ throw new TypeError(I(i, n));
344
344
  };
345
- return t.length < 2 ? n : n(t[1]);
345
+ return t.length < 2 ? s : s(t[1]);
346
346
  }
347
347
  function R(t) {
348
- return t != null && typeof t == "object" && !L(t);
348
+ return t != null && typeof t == "object" && !T(t);
349
349
  }
350
350
  function it(t, e) {
351
351
  if (R(t))
@@ -354,27 +354,27 @@ function it(t, e) {
354
354
  }
355
355
  function I(t, e) {
356
356
  var i;
357
- const s = T(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
358
- return e.replaceAll("%t", s).replaceAll("%v", n);
357
+ const n = k(t), s = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
358
+ return e.replaceAll("%t", n).replaceAll("%v", s);
359
359
  }
360
360
  const {
361
361
  link: B,
362
- propagate: ke,
362
+ propagate: Le,
363
363
  updateDirtyFlag: Ce,
364
364
  startTracking: G,
365
365
  endTracking: z,
366
366
  processEffectNotifications: Ae,
367
367
  processComputedUpdate: De,
368
368
  processPendingInnerEffects: Oe
369
- } = oe({
369
+ } = re({
370
370
  updateComputed(t) {
371
- const e = v;
372
- v = t, G(t);
371
+ const e = y;
372
+ y = t, G(t);
373
373
  try {
374
- const s = t.current, n = t.getter(s);
375
- return t.equals(s, n) ? !1 : (t.current = n, !0);
374
+ const n = t.current, s = t.getter(n);
375
+ return t.equals(n, s) ? !1 : (t.current = s, !0);
376
376
  } finally {
377
- v = e, z(t);
377
+ y = e, z(t);
378
378
  }
379
379
  },
380
380
  notifyEffect(t) {
@@ -382,19 +382,19 @@ const {
382
382
  return e & E.Dirty || e & E.PendingComputed && Ce(t, e) ? fe(t) : Oe(t, t.flags), !0;
383
383
  }
384
384
  });
385
- let v;
385
+ let y;
386
386
  const S = [];
387
387
  let q = !1;
388
388
  function Pe() {
389
389
  q || (q = !0, queueMicrotask(() => {
390
390
  q = !1;
391
391
  for (let t = 0; t < S.length; t++) {
392
- const e = S[t], s = v;
393
- v = e, G(e);
392
+ const e = S[t], n = y;
393
+ y = e, G(e);
394
394
  try {
395
395
  e.cleanup && (ae(), e.cleanup(), de()), e.cleanup = e.fn() ?? void 0;
396
396
  } finally {
397
- v = s, z(e);
397
+ y = n, z(e);
398
398
  }
399
399
  }
400
400
  S.length = 0;
@@ -410,20 +410,20 @@ function $e() {
410
410
  }
411
411
  const le = [];
412
412
  function ae() {
413
- le.push(v), v = void 0;
413
+ le.push(y), y = void 0;
414
414
  }
415
415
  function de() {
416
- v = le.pop();
416
+ y = le.pop();
417
417
  }
418
418
  const Z = Symbol("SIGNAL"), he = Symbol("SOURCE");
419
419
  function _(t) {
420
420
  let e;
421
- return ae(), e = b(t), de(), e;
421
+ return ae(), e = w(t), de(), e;
422
422
  }
423
- function b(t) {
423
+ function w(t) {
424
424
  return m(t) ? t() : t;
425
425
  }
426
- function y(t) {
426
+ function v(t) {
427
427
  const e = {
428
428
  fn: t,
429
429
  subs: void 0,
@@ -432,33 +432,33 @@ function y(t) {
432
432
  depsTail: void 0,
433
433
  flags: E.Effect
434
434
  };
435
- return v !== void 0 && B(e, v), fe(e), $e.bind(e);
435
+ return y !== void 0 && B(e, y), fe(e), $e.bind(e);
436
436
  }
437
437
  function D(t, e) {
438
438
  return m(t) ? Ie(t, e) : H(t === void 0 ? void 0 : t, e);
439
439
  }
440
440
  function H(t, e) {
441
- const s = {
441
+ const n = {
442
442
  current: t,
443
443
  subs: void 0,
444
444
  subsTail: void 0
445
- }, n = (e == null ? void 0 : e.equals) ?? Object.is, i = function() {
445
+ }, s = (e == null ? void 0 : e.equals) ?? Object.is, i = function() {
446
446
  if (arguments.length > 0) {
447
- let r = arguments[0];
448
- if (typeof r == "function" && (r = r(s.current)), !n(s.current, r)) {
449
- s.current = r;
450
- const c = s.subs;
451
- c !== void 0 && (ke(c), Ae());
447
+ let o = arguments[0];
448
+ if (typeof o == "function" && (o = o(n.current)), !s(n.current, o)) {
449
+ n.current = o;
450
+ const f = n.subs;
451
+ f !== void 0 && (Le(f), Ae());
452
452
  }
453
453
  } else
454
- return v !== void 0 && B(s, v), s.current;
454
+ return y !== void 0 && B(n, y), n.current;
455
455
  };
456
456
  return i._type = he, i;
457
457
  }
458
458
  function Ie(t, e) {
459
459
  if (m(t) && t._type === Z)
460
460
  return t._type === he ? () => t() : t;
461
- const s = {
461
+ const n = {
462
462
  current: void 0,
463
463
  equals: (e == null ? void 0 : e.equals) ?? Object.is,
464
464
  subs: void 0,
@@ -467,40 +467,40 @@ function Ie(t, e) {
467
467
  depsTail: void 0,
468
468
  flags: E.Computed | E.Dirty,
469
469
  getter: (i) => {
470
- const r = t(i);
471
- return b(r);
470
+ const o = t(i);
471
+ return w(o);
472
472
  }
473
- }, n = function() {
473
+ }, s = function() {
474
474
  if (arguments.length > 0)
475
475
  throw new Error("Signals cannot be set as their values are derived from the sources they depend on.");
476
- v !== void 0 && B(s, v);
477
- const i = s.flags;
478
- return i & (E.Dirty | E.PendingComputed) && De(s, i), s.current;
476
+ y !== void 0 && B(n, y);
477
+ const i = n.flags;
478
+ return i & (E.Dirty | E.PendingComputed) && De(n, i), n.current;
479
479
  };
480
- return n._type = Z, n;
480
+ return s._type = Z, s;
481
481
  }
482
- const ot = () => {
482
+ const rt = () => {
483
483
  };
484
484
  let U = 1;
485
485
  function pe() {
486
486
  return U = U % Number.MAX_SAFE_INTEGER + 1, U.toString(36) + Date.now().toString(36);
487
487
  }
488
- function rt(t, e) {
488
+ function ot(t, e) {
489
489
  return Object.is(t, e);
490
490
  }
491
491
  function ut(t, e) {
492
492
  if (Object.is(t, e)) return !0;
493
- const s = T(t);
494
- if (s !== T(e))
493
+ const n = k(t);
494
+ if (n !== k(e))
495
495
  return !1;
496
- switch (s) {
496
+ switch (n) {
497
497
  case "object":
498
- let n = 0;
498
+ let s = 0;
499
499
  for (const i in t) {
500
500
  if (t[i] !== e[i]) return !1;
501
- n++;
501
+ s++;
502
502
  }
503
- return Object.keys(e).length === n;
503
+ return Object.keys(e).length === s;
504
504
  case "array":
505
505
  if (t.length !== e.length) return !1;
506
506
  for (let i = 0; i < t.length; i++)
@@ -524,73 +524,73 @@ function C(t, e) {
524
524
  if (t === e) return !0;
525
525
  if (t && e && typeof t == "object" && typeof e == "object") {
526
526
  if (t.constructor !== e.constructor) return !1;
527
- var s, n, i;
527
+ var n, s, i;
528
528
  if (Array.isArray(t)) {
529
- if (s = t.length, s != e.length) return !1;
530
- for (n = s; n-- !== 0; ) if (!C(t[n], e[n])) return !1;
529
+ if (n = t.length, n != e.length) return !1;
530
+ for (s = n; s-- !== 0; ) if (!C(t[s], e[s])) return !1;
531
531
  return !0;
532
532
  }
533
533
  if (t instanceof Map && e instanceof Map) {
534
534
  if (t.size !== e.size) return !1;
535
- for (n of t.entries()) if (!e.has(n[0])) return !1;
536
- for (n of t.entries()) if (!C(n[1], e.get(n[0]))) return !1;
535
+ for (s of t.entries()) if (!e.has(s[0])) return !1;
536
+ for (s of t.entries()) if (!C(s[1], e.get(s[0]))) return !1;
537
537
  return !0;
538
538
  }
539
539
  if (t instanceof Set && e instanceof Set) {
540
540
  if (t.size !== e.size) return !1;
541
- for (n of t.entries()) if (!e.has(n[0])) return !1;
541
+ for (s of t.entries()) if (!e.has(s[0])) return !1;
542
542
  return !0;
543
543
  }
544
544
  if (ArrayBuffer.isView(t) && ArrayBuffer.isView(e)) {
545
- if (s = t.length, s != e.length) return !1;
546
- for (n = s; n-- !== 0; ) if (t[n] !== e[n]) return !1;
545
+ if (n = t.length, n != e.length) return !1;
546
+ for (s = n; s-- !== 0; ) if (t[s] !== e[s]) return !1;
547
547
  return !0;
548
548
  }
549
549
  if (t.constructor === RegExp) return t.source === e.source && t.flags === e.flags;
550
550
  if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === e.valueOf();
551
551
  if (t.toString !== Object.prototype.toString) return t.toString() === e.toString();
552
- if (i = Object.keys(t), s = i.length, s !== Object.keys(e).length) return !1;
553
- for (n = s; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[n])) return !1;
554
- for (n = s; n-- !== 0; ) {
555
- var r = i[n];
556
- if (!C(t[r], e[r])) return !1;
552
+ if (i = Object.keys(t), n = i.length, n !== Object.keys(e).length) return !1;
553
+ for (s = n; s-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[s])) return !1;
554
+ for (s = n; s-- !== 0; ) {
555
+ var o = i[s];
556
+ if (!C(t[o], e[o])) return !1;
557
557
  }
558
558
  return !0;
559
559
  }
560
560
  return t !== t && e !== e;
561
561
  }
562
562
  function _e(t, e) {
563
- const s = {};
564
- for (const n in e)
565
- t.includes(n) || (s[n] = e[n]);
566
- return s;
563
+ const n = {};
564
+ for (const s in e)
565
+ t.includes(s) || (n[s] = e[s]);
566
+ return n;
567
567
  }
568
568
  function ct(t) {
569
569
  let e = 0;
570
- for (let s = 0; s < t.length; s++)
571
- e = (e + t.charCodeAt(s) * 10) % 360;
570
+ for (let n = 0; n < t.length; n++)
571
+ e = (e + t.charCodeAt(n) * 10) % 360;
572
572
  return `oklch(0.68 0.15 ${e}deg)`;
573
573
  }
574
574
  function ft(t) {
575
575
  if (t instanceof RegExp)
576
- return (n) => t.test(n);
576
+ return (s) => t.test(s);
577
577
  const e = {
578
578
  positive: [],
579
579
  negative: []
580
- }, s = t.split(",").map((n) => n.trim()).filter((n) => n !== "");
581
- for (let n of s) {
580
+ }, n = t.split(",").map((s) => s.trim()).filter((s) => s !== "");
581
+ for (let s of n) {
582
582
  let i = "positive";
583
- n.startsWith("-") && (i = "negative", n = n.slice(1)), n === "*" ? e[i].push(function() {
583
+ s.startsWith("-") && (i = "negative", s = s.slice(1)), s === "*" ? e[i].push(function() {
584
584
  return !0;
585
- }) : n.endsWith("*") ? e[i].push(function(r) {
586
- return r.startsWith(n.slice(0, n.length - 1));
587
- }) : e[i].push(function(r) {
588
- return r === n;
585
+ }) : s.endsWith("*") ? e[i].push(function(o) {
586
+ return o.startsWith(s.slice(0, s.length - 1));
587
+ }) : e[i].push(function(o) {
588
+ return o === s;
589
589
  });
590
590
  }
591
- return function(n) {
592
- const { positive: i, negative: r } = e;
593
- return !(r.some((c) => c(n)) || i.length > 0 && !i.some((c) => c(n)));
591
+ return function(s) {
592
+ const { positive: i, negative: o } = e;
593
+ return !(o.some((f) => f(s)) || i.length > 0 && !i.some((f) => f(s)));
594
594
  };
595
595
  }
596
596
  const x = Symbol.for("DollaMarkupElement"), lt = Symbol.for("DollaRouter");
@@ -598,15 +598,15 @@ var J;
598
598
  J = x;
599
599
  class K {
600
600
  constructor(e) {
601
- f(this, J, !0);
602
- f(this, "domNode");
601
+ c(this, J, !0);
602
+ c(this, "domNode");
603
603
  this.domNode = e;
604
604
  }
605
605
  get isMounted() {
606
606
  return this.domNode.parentNode != null;
607
607
  }
608
- mount(e, s) {
609
- e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null);
608
+ mount(e, n) {
609
+ e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null);
610
610
  }
611
611
  unmount(e = !1) {
612
612
  this.domNode.parentNode && !e && this.domNode.parentNode.removeChild(this.domNode);
@@ -616,68 +616,73 @@ var Q;
616
616
  Q = x;
617
617
  class je {
618
618
  constructor(e) {
619
- f(this, Q, !0);
620
- f(this, "domNode", document.createTextNode(""));
621
- f(this, "children", []);
622
- f(this, "elementContext");
623
- f(this, "source");
624
- f(this, "unsubscribe");
619
+ c(this, Q, !0);
620
+ c(this, "domNode", document.createTextNode(""));
621
+ c(this, "children", []);
622
+ c(this, "elementContext");
623
+ c(this, "source");
624
+ c(this, "unsubscribe");
625
625
  this.source = e.source, this.elementContext = e.elementContext;
626
626
  }
627
627
  get isMounted() {
628
628
  return this.domNode.parentNode != null;
629
629
  }
630
- mount(e, s) {
631
- this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = y(() => {
632
- const n = this.source();
633
- if (!we(n))
634
- throw console.error(n), new TypeError(
635
- `Dynamic received invalid value to render. Got type: ${T(n)}, value: ${n}`
636
- );
637
- _(() => {
638
- this.update(L(n) ? n : [n]);
639
- });
630
+ mount(e, n) {
631
+ this.isMounted || (e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), this.unsubscribe = v(() => {
632
+ try {
633
+ const s = this.source();
634
+ if (!be(s))
635
+ throw console.error(s), new TypeError(
636
+ `Dynamic received invalid value to render. Got type: ${k(s)}, value: ${s}`
637
+ );
638
+ _(() => {
639
+ this.update(T(s) ? s : [s]);
640
+ });
641
+ } catch (s) {
642
+ const i = this.elementContext.view.logger;
643
+ i.error(s), i.crash(s);
644
+ }
640
645
  }));
641
646
  }
642
647
  unmount(e = !1) {
643
- var s, n;
644
- (s = this.unsubscribe) == null || s.call(this), this.isMounted && (this.cleanup(e), (n = this.domNode.parentNode) == null || n.removeChild(this.domNode));
648
+ var n, s;
649
+ (n = this.unsubscribe) == null || n.call(this), this.isMounted && (this.cleanup(e), (s = this.domNode.parentNode) == null || s.removeChild(this.domNode));
645
650
  }
646
651
  cleanup(e) {
647
- for (const s of this.children)
648
- s.unmount(e);
652
+ for (const n of this.children)
653
+ n.unmount(e);
649
654
  this.children = [];
650
655
  }
651
656
  update(e) {
652
- var r, c, p;
657
+ var o, f, p;
653
658
  if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
654
659
  return;
655
- const s = e.flatMap((g) => ye(g) ? g : M(this.elementContext, j(g)));
656
- for (const g of s) {
657
- const o = ((r = this.children.at(-1)) == null ? void 0 : r.domNode) || this.domNode;
658
- g.mount(this.domNode.parentNode, o), this.children.push(g);
660
+ const n = e.flatMap((g) => ve(g) ? g : M(this.elementContext, j(g)));
661
+ for (const g of n) {
662
+ const r = ((o = this.children.at(-1)) == null ? void 0 : o.domNode) || this.domNode;
663
+ g.mount(this.domNode.parentNode, r), this.children.push(g);
659
664
  }
660
- const n = this.domNode.parentNode, i = ((p = (c = this.children.at(-1)) == null ? void 0 : c.domNode) == null ? void 0 : p.nextSibling) ?? null;
661
- "moveBefore" in n ? n.moveBefore(this.domNode, i) : n.insertBefore(this.domNode, i);
665
+ const s = this.domNode.parentNode, i = ((p = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : p.nextSibling) ?? null;
666
+ "moveBefore" in s ? s.moveBefore(this.domNode, i) : s.insertBefore(this.domNode, i);
662
667
  }
663
668
  }
664
669
  var Y;
665
670
  Y = x;
666
671
  class me {
667
672
  constructor(e) {
668
- f(this, Y, !0);
669
- f(this, "domNode", document.createTextNode(""));
670
- f(this, "isMounted", !1);
671
- f(this, "source");
672
- f(this, "elements", []);
673
- f(this, "unsubscribe");
673
+ c(this, Y, !0);
674
+ c(this, "domNode", document.createTextNode(""));
675
+ c(this, "isMounted", !1);
676
+ c(this, "source");
677
+ c(this, "elements", []);
678
+ c(this, "unsubscribe");
674
679
  this.source = e;
675
680
  }
676
- mount(e, s) {
677
- this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), m(this.source) ? this.unsubscribe = y(() => {
678
- const n = b(this.source);
681
+ mount(e, n) {
682
+ this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), m(this.source) ? this.unsubscribe = v(() => {
683
+ const s = w(this.source);
679
684
  _(() => {
680
- this.update(n);
685
+ this.update(s);
681
686
  });
682
687
  }) : this.update(this.elements));
683
688
  }
@@ -685,18 +690,18 @@ class me {
685
690
  this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
686
691
  }
687
692
  cleanup(e) {
688
- for (const s of this.elements)
689
- s.unmount(e);
693
+ for (const n of this.elements)
694
+ n.unmount(e);
690
695
  this.elements = [];
691
696
  }
692
697
  update(e) {
693
- var s, n;
698
+ var n, s;
694
699
  if (this.cleanup(!1), e.length > 0) {
695
700
  for (let i = 0; i < e.length; i++) {
696
- const r = e[i], c = i > 0 ? this.elements[i - 1] : void 0;
697
- r.mount(this.domNode.parentElement, c == null ? void 0 : c.domNode), this.elements.push(r);
701
+ const o = e[i], f = i > 0 ? this.elements[i - 1] : void 0;
702
+ o.mount(this.domNode.parentElement, f == null ? void 0 : f.domNode), this.elements.push(o);
698
703
  }
699
- (n = this.domNode.parentNode) == null || n.insertBefore(this.domNode, ((s = this.elements.at(-1)) == null ? void 0 : s.domNode) ?? null);
704
+ (s = this.domNode.parentNode) == null || s.insertBefore(this.domNode, ((n = this.elements.at(-1)) == null ? void 0 : n.domNode) ?? null);
700
705
  }
701
706
  }
702
707
  }
@@ -704,255 +709,260 @@ const qe = (t) => /^on[A-Z]/.test(t);
704
709
  var ee;
705
710
  ee = x;
706
711
  class Ue {
707
- constructor({ tag: e, props: s, children: n, elementContext: i }) {
708
- f(this, ee, !0);
709
- f(this, "domNode");
710
- f(this, "props");
711
- f(this, "childMarkup", []);
712
- f(this, "children", []);
713
- f(this, "unsubscribers", []);
714
- f(this, "elementContext");
712
+ constructor({ tag: e, props: n, children: s, elementContext: i }) {
713
+ c(this, ee, !0);
714
+ c(this, "domNode");
715
+ c(this, "props");
716
+ c(this, "childMarkup", []);
717
+ c(this, "children", []);
718
+ c(this, "unsubscribers", []);
719
+ c(this, "elementContext");
720
+ c(this, "logger");
715
721
  // Track the ref so we can nullify it on unmount.
716
- f(this, "ref");
722
+ c(this, "ref");
717
723
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
718
- f(this, "canClickAway", !1);
724
+ c(this, "canClickAway", !1);
719
725
  if (e.toLowerCase() === "svg" && (i = {
720
726
  ...i,
721
727
  isSVG: !0
722
- }), i.isSVG ? this.domNode = document.createElementNS("http://www.w3.org/2000/svg", e) : this.domNode = document.createElement(e), i.root.getEnv() === "development" && i.viewName && (this.domNode.dataset.view = i.viewName), s.ref)
723
- if (m(s.ref))
724
- this.ref = s.ref, this.ref(this.domNode);
728
+ }), this.logger = i.view.logger, i.isSVG ? this.domNode = document.createElementNS("http://www.w3.org/2000/svg", e) : this.domNode = document.createElement(e), i.root.getEnv() === "development" && i.view.name && (this.domNode.dataset.view = i.view.name), n.ref)
729
+ if (m(n.ref))
730
+ this.ref = n.ref, this.ref(this.domNode);
725
731
  else
726
- throw new Error("Expected ref to be a function. Got: " + s.ref);
732
+ throw new Error("Expected ref to be a function. Got: " + n.ref);
727
733
  this.props = {
728
- ..._e(["ref", "class", "className"], s),
729
- class: s.className ?? s.class
730
- }, n && (this.childMarkup = j(n)), this.elementContext = i;
734
+ ..._e(["ref", "class", "className"], n),
735
+ class: n.className ?? n.class
736
+ }, s && (this.childMarkup = j(s)), this.elementContext = i;
731
737
  }
732
738
  get isMounted() {
733
739
  return this.domNode.parentNode != null;
734
740
  }
735
- mount(e, s) {
741
+ mount(e, n) {
736
742
  if (e == null)
737
743
  throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
738
744
  if (!this.isMounted) {
739
745
  this.childMarkup.length > 0 && (this.children = M(this.elementContext, this.childMarkup));
740
- for (let n = 0; n < this.children.length; n++) {
741
- const i = this.children[n], r = n > 0 ? this.children[n - 1].domNode : void 0;
742
- i.mount(this.domNode, r);
746
+ for (let s = 0; s < this.children.length; s++) {
747
+ const i = this.children[s], o = s > 0 ? this.children[s - 1].domNode : void 0;
748
+ i.mount(this.domNode, o);
743
749
  }
744
750
  this.applyProps(this.domNode, this.props), this.props.style && this.applyStyles(this.domNode, this.props.style, this.unsubscribers), this.props.class && this.applyClasses(this.domNode, this.props.class, this.unsubscribers);
745
751
  }
746
- e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), setTimeout(() => {
752
+ e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), setTimeout(() => {
747
753
  this.canClickAway = !0;
748
754
  }, 0);
749
755
  }
750
756
  unmount(e = !1) {
751
- var s;
757
+ var n;
752
758
  if (this.isMounted) {
753
- e || (s = this.domNode.parentNode) == null || s.removeChild(this.domNode);
754
- for (const n of this.children)
755
- n.unmount(!0);
759
+ e || (n = this.domNode.parentNode) == null || n.removeChild(this.domNode);
760
+ for (const s of this.children)
761
+ s.unmount(!0);
756
762
  this.ref && this.ref(void 0), this.canClickAway = !1;
757
- for (const n of this.unsubscribers)
758
- n();
763
+ for (const s of this.unsubscribers)
764
+ s();
759
765
  this.unsubscribers.length = 0;
760
766
  }
761
767
  }
762
- attachProp(e, s) {
768
+ attachProp(e, n) {
763
769
  m(e) ? this.unsubscribers.push(
764
- y(() => {
765
- s(e());
770
+ v(() => {
771
+ try {
772
+ n(e());
773
+ } catch (s) {
774
+ this.logger.error(s), this.logger.crash(s);
775
+ }
766
776
  })
767
- ) : s(e);
777
+ ) : n(e);
768
778
  }
769
- applyProps(e, s) {
770
- for (const n in s) {
771
- const i = s[n];
772
- if (n === "on:clickoutside" || n === "onClickOutside" || n === "onclickoutside") {
773
- const r = (p) => {
779
+ applyProps(e, n) {
780
+ for (const s in n) {
781
+ const i = n[s];
782
+ if (s === "on:clickoutside" || s === "onClickOutside" || s === "onclickoutside") {
783
+ const o = (p) => {
774
784
  this.canClickAway && !e.contains(p.target) && i(p);
775
- }, c = { capture: !0 };
776
- window.addEventListener("click", r, c), this.unsubscribers.push(() => {
777
- window.removeEventListener("click", r, c);
785
+ }, f = { capture: !0 };
786
+ window.addEventListener("click", o, f), this.unsubscribers.push(() => {
787
+ window.removeEventListener("click", o, f);
778
788
  });
779
- } else if (m(i) && qe(n)) {
780
- const r = n.slice(2).toLowerCase(), c = i;
781
- e.addEventListener(r, c), this.unsubscribers.push(() => {
782
- e.removeEventListener(r, c);
789
+ } else if (m(i) && qe(s)) {
790
+ const o = s.slice(2).toLowerCase(), f = i;
791
+ e.addEventListener(o, f), this.unsubscribers.push(() => {
792
+ e.removeEventListener(o, f);
783
793
  });
784
- } else if (m(i) && Re.includes(n)) {
785
- const r = n.substring(2);
786
- e.addEventListener(r, i), this.unsubscribers.push(() => {
787
- e.removeEventListener(r, i);
794
+ } else if (m(i) && Re.includes(s)) {
795
+ const o = s.substring(2);
796
+ e.addEventListener(o, i), this.unsubscribers.push(() => {
797
+ e.removeEventListener(o, i);
788
798
  });
789
- } else if (n.includes("-"))
790
- this.attachProp(i, (r) => {
791
- r == null ? e.removeAttribute(n) : e.setAttribute(n, String(r));
799
+ } else if (s.includes("-"))
800
+ this.attachProp(i, (o) => {
801
+ o == null ? e.removeAttribute(s) : e.setAttribute(s, String(o));
792
802
  });
793
- else if (!Ve.includes(n))
803
+ else if (!Ve.includes(s))
794
804
  if (this.elementContext.isSVG)
795
- this.attachProp(i, (r) => {
796
- r != null ? e.setAttribute(n, String(s[n])) : e.removeAttribute(n);
805
+ this.attachProp(i, (o) => {
806
+ o != null ? e.setAttribute(s, String(n[s])) : e.removeAttribute(s);
797
807
  });
798
808
  else
799
- switch (n) {
809
+ switch (s) {
800
810
  case "contentEditable":
801
811
  case "value":
802
- this.attachProp(i, (r) => {
803
- e[n] = String(r);
812
+ this.attachProp(i, (o) => {
813
+ e[s] = String(o);
804
814
  });
805
815
  break;
806
816
  case "for":
807
- this.attachProp(i, (r) => {
808
- e.htmlFor = r;
817
+ this.attachProp(i, (o) => {
818
+ e.htmlFor = o;
809
819
  });
810
820
  break;
811
821
  case "title":
812
- this.attachProp(i, (r) => {
813
- r == null ? e.removeAttribute(n) : e.setAttribute(n, String(r));
822
+ this.attachProp(i, (o) => {
823
+ o == null ? e.removeAttribute(s) : e.setAttribute(s, String(o));
814
824
  });
815
825
  case "checked":
816
- this.attachProp(i, (r) => {
817
- e.checked = r, r ? e.setAttribute("checked", "") : e.removeAttribute("checked");
826
+ this.attachProp(i, (o) => {
827
+ e.checked = o, o ? e.setAttribute("checked", "") : e.removeAttribute("checked");
818
828
  });
819
829
  break;
820
830
  case "autocomplete":
821
831
  case "autocapitalize":
822
- this.attachProp(i, (r) => {
823
- typeof r == "string" ? e[n] = r : r ? e[n] = "on" : e[n] = "off";
832
+ this.attachProp(i, (o) => {
833
+ typeof o == "string" ? e[s] = o : o ? e[s] = "on" : e[s] = "off";
824
834
  });
825
835
  break;
826
836
  default: {
827
- if (n.startsWith("prop:")) {
828
- const r = n.substring(5);
829
- this.attachProp(i, (c) => {
830
- e[r] = c;
837
+ if (s.startsWith("prop:")) {
838
+ const o = s.substring(5);
839
+ this.attachProp(i, (f) => {
840
+ e[o] = f;
831
841
  });
832
- } else if (n.startsWith("on:")) {
833
- const r = n.substring(3);
834
- let c;
835
- m(i) ? (e.addEventListener(r, i), this.unsubscribers.push(() => {
836
- e.removeEventListener(r, i);
842
+ } else if (s.startsWith("on:")) {
843
+ const o = s.substring(3);
844
+ let f;
845
+ m(i) ? (e.addEventListener(o, i), this.unsubscribers.push(() => {
846
+ e.removeEventListener(o, i);
837
847
  })) : this.attachProp(i, (p) => {
838
- !p && c ? e.removeEventListener(r, c) : p != null && (c && c !== p && e.removeEventListener(r, c), e.addEventListener(r, p)), c = p;
848
+ !p && f ? e.removeEventListener(o, f) : p != null && (f && f !== p && e.removeEventListener(o, f), e.addEventListener(o, p)), f = p;
839
849
  });
840
- } else if (n.startsWith("attr:")) {
841
- const r = n.substring(5).toLowerCase();
842
- this.attachProp(i, (c) => {
843
- c != null ? e.setAttribute(r, String(c)) : e.removeAttribute(r);
850
+ } else if (s.startsWith("attr:")) {
851
+ const o = s.substring(5).toLowerCase();
852
+ this.attachProp(i, (f) => {
853
+ f != null ? e.setAttribute(o, String(f)) : e.removeAttribute(o);
844
854
  });
845
855
  } else
846
- this.attachProp(i, (r) => {
847
- e[n] = r;
856
+ this.attachProp(i, (o) => {
857
+ e[s] = o;
848
858
  });
849
859
  break;
850
860
  }
851
861
  }
852
862
  }
853
863
  }
854
- applyStyles(e, s, n) {
864
+ applyStyles(e, n, s) {
855
865
  const i = [];
856
- if (m(s)) {
857
- let r;
858
- const c = y(() => {
859
- m(r) && r(), e.style.cssText = "", r = this.applyStyles(e, b(s), n);
866
+ if (m(n)) {
867
+ let o;
868
+ const f = v(() => {
869
+ m(o) && o(), e.style.cssText = "", o = this.applyStyles(e, w(n), s);
860
870
  });
861
- n.push(c), i.push(c);
871
+ s.push(f), i.push(f);
862
872
  } else {
863
- const r = ve(s);
864
- for (const c in r) {
865
- const { value: p, priority: g } = r[c];
873
+ const o = ye(n);
874
+ for (const f in o) {
875
+ const { value: p, priority: g } = o[f];
866
876
  if (m(p)) {
867
- const o = y(() => {
868
- b(p) ? e.style.setProperty(c, String(b(p)), g) : e.style.removeProperty(c);
877
+ const r = v(() => {
878
+ w(p) ? e.style.setProperty(f, String(w(p)), g) : e.style.removeProperty(f);
869
879
  });
870
- n.push(o), i.push(o);
871
- } else p != null && e.style.setProperty(c, String(p));
880
+ s.push(r), i.push(r);
881
+ } else p != null && e.style.setProperty(f, String(p));
872
882
  }
873
883
  }
874
884
  return function() {
875
- for (const c of i)
876
- c(), n.splice(n.indexOf(c), 1);
885
+ for (const f of i)
886
+ f(), s.splice(s.indexOf(f), 1);
877
887
  };
878
888
  }
879
- applyClasses(e, s, n) {
889
+ applyClasses(e, n, s) {
880
890
  const i = [];
881
- if (m(s)) {
882
- let r;
883
- const c = y(() => {
884
- m(r) && r(), e.removeAttribute("class"), r = this.applyClasses(e, b(s), n);
891
+ if (m(n)) {
892
+ let o;
893
+ const f = v(() => {
894
+ m(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, w(n), s);
885
895
  });
886
- n.push(c), i.push(c);
896
+ s.push(f), i.push(f);
887
897
  } else {
888
- const r = ge(s);
889
- for (const c in r) {
890
- const p = r[c];
898
+ const o = ge(n);
899
+ for (const f in o) {
900
+ const p = o[f];
891
901
  if (m(p)) {
892
- const g = y(() => {
893
- b(p) ? e.classList.add(c) : e.classList.remove(c);
902
+ const g = v(() => {
903
+ w(p) ? e.classList.add(f) : e.classList.remove(f);
894
904
  });
895
- n.push(g), i.push(g);
896
- } else p && e.classList.add(c);
905
+ s.push(g), i.push(g);
906
+ } else p && e.classList.add(f);
897
907
  }
898
908
  }
899
909
  return function() {
900
- for (const c of i)
901
- c(), n.splice(n.indexOf(c), 1);
910
+ for (const f of i)
911
+ f(), s.splice(s.indexOf(f), 1);
902
912
  };
903
913
  }
904
914
  }
905
915
  function ge(t) {
906
916
  let e = {};
907
- if (k(t)) {
908
- const s = t.split(" ");
909
- for (const n of s)
910
- e[n] = !0;
911
- } else R(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
912
- Object.assign(e, ge(s));
917
+ if (L(t)) {
918
+ const n = t.split(" ");
919
+ for (const s of n)
920
+ e[s] = !0;
921
+ } else R(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((n) => {
922
+ Object.assign(e, ge(n));
913
923
  });
914
924
  return delete e.undefined, e;
915
925
  }
916
- function ve(t) {
926
+ function ye(t) {
917
927
  let e = {};
918
- if (k(t)) {
919
- const s = t.split(";").filter((n) => n.trim() !== "");
920
- for (const n of s) {
921
- const [i, r] = n.split(":"), c = {
922
- value: r
928
+ if (L(t)) {
929
+ const n = t.split(";").filter((s) => s.trim() !== "");
930
+ for (const s of n) {
931
+ const [i, o] = s.split(":"), f = {
932
+ value: o
923
933
  };
924
- r.includes("!important") ? (c.priority = "important", c.value = r.replace("!important", "").trim()) : c.value = r.trim(), e[X(i.trim())] = c;
934
+ o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[X(i.trim())] = f;
925
935
  }
926
936
  }
927
937
  if (R(t))
928
- for (const s in t)
929
- s.startsWith("--") ? e[s] = { value: t[s] } : e[X(s)] = { value: t[s] };
930
- else Array.isArray(t) && Array.from(t).filter((s) => s != null).forEach((s) => {
931
- Object.assign(e, ve(s));
938
+ for (const n in t)
939
+ n.startsWith("--") ? e[n] = { value: t[n] } : e[X(n)] = { value: t[n] };
940
+ else Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
941
+ Object.assign(e, ye(n));
932
942
  });
933
943
  return e;
934
944
  }
935
945
  function X(t) {
936
- return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s ? "-" : "") + e.toLowerCase());
946
+ return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, n) => (n ? "-" : "") + e.toLowerCase());
937
947
  }
938
948
  const Ve = ["ref", "children", "class", "style", "data"], Re = ["onsubmit", "onclick", "ontransitionend"];
939
949
  var te;
940
950
  te = x;
941
951
  class Be {
942
952
  constructor(e) {
943
- f(this, te, !0);
944
- f(this, "domNode", document.createTextNode(""));
945
- f(this, "isMounted", !1);
946
- f(this, "view");
947
- f(this, "mountedView");
948
- f(this, "unsubscribe");
953
+ c(this, te, !0);
954
+ c(this, "domNode", document.createTextNode(""));
955
+ c(this, "isMounted", !1);
956
+ c(this, "view");
957
+ c(this, "mountedView");
958
+ c(this, "unsubscribe");
949
959
  this.view = e;
950
960
  }
951
- mount(e, s) {
952
- this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = y(() => {
953
- const n = this.view();
961
+ mount(e, n) {
962
+ this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), this.unsubscribe = v(() => {
963
+ const s = this.view();
954
964
  _(() => {
955
- this.update(n);
965
+ this.update(s);
956
966
  });
957
967
  }));
958
968
  }
@@ -970,30 +980,30 @@ var se;
970
980
  se = x;
971
981
  class Ge {
972
982
  constructor(e) {
973
- f(this, se, !0);
974
- f(this, "config");
975
- f(this, "element");
983
+ c(this, se, !0);
984
+ c(this, "config");
985
+ c(this, "element");
976
986
  this.config = e;
977
987
  }
978
988
  get isMounted() {
979
989
  return this.element ? this.element.isMounted : !1;
980
990
  }
981
- mount(e, s) {
982
- const { content: n, parent: i } = this.config;
983
- ye(n) ? this.element = n : this.element = A(M(this.config.elementContext, j(n))), this.element.mount(i);
991
+ mount(e, n) {
992
+ const { content: s, parent: i } = this.config;
993
+ ve(s) ? this.element = s : this.element = A(M(this.config.elementContext, j(s))), this.element.mount(i);
984
994
  }
985
995
  unmount(e = !1) {
986
- var s;
987
- (s = this.element) != null && s.isMounted && this.element.unmount(!1);
996
+ var n;
997
+ (n = this.element) != null && n.isMounted && this.element.unmount(!1);
988
998
  }
989
999
  }
990
1000
  let ze = class {
991
1001
  constructor(e) {
992
- f(this, "store");
1002
+ c(this, "store");
993
1003
  this.store = e;
994
- const s = Object.getOwnPropertyDescriptors(this.store.logger);
995
- for (const n in s)
996
- n !== "setName" && Object.defineProperty(this, n, s[n]);
1004
+ const n = Object.getOwnPropertyDescriptors(this.store.logger);
1005
+ for (const s in n)
1006
+ s !== "setName" && Object.defineProperty(this, s, n[s]);
997
1007
  }
998
1008
  get isMounted() {
999
1009
  return this.store.isMounted;
@@ -1006,12 +1016,12 @@ let ze = class {
1006
1016
  }
1007
1017
  get(e) {
1008
1018
  if (m(e)) {
1009
- let s = this.store.elementContext, n;
1010
- for (; n = s.stores.get(e), n == null && s.parent != null; )
1011
- s = s.parent;
1012
- if (n == null)
1019
+ let n = this.store.elementContext, s;
1020
+ for (; s = n.stores.get(e), s == null && n.parent != null; )
1021
+ n = n.parent;
1022
+ if (s == null)
1013
1023
  throw new O(`Store '${e.name}' is not provided on this context.`);
1014
- return n.value;
1024
+ return s.value;
1015
1025
  } else
1016
1026
  throw new O("Invalid store.");
1017
1027
  }
@@ -1022,35 +1032,41 @@ let ze = class {
1022
1032
  this.store.lifecycleListeners.unmount.push(e);
1023
1033
  }
1024
1034
  effect(e) {
1025
- const s = this.store;
1026
- if (s.isMounted) {
1027
- const n = y(e);
1028
- return s.lifecycleListeners.unmount.push(n), n;
1035
+ const n = this.store, s = () => {
1036
+ try {
1037
+ e();
1038
+ } catch (i) {
1039
+ i instanceof Error ? this.crash(i) : typeof i == "string" ? this.crash(new Error(i)) : (this.error(i), this.crash(new Error("Unknown error thrown in effect callback")));
1040
+ }
1041
+ };
1042
+ if (n.isMounted) {
1043
+ const i = v(s);
1044
+ return n.lifecycleListeners.unmount.push(i), i;
1029
1045
  } else {
1030
- let n, i = !1;
1031
- return s.lifecycleListeners.mount.push(() => {
1032
- i || (n = y(e), s.lifecycleListeners.unmount.push(n));
1046
+ let i, o = !1;
1047
+ return n.lifecycleListeners.mount.push(() => {
1048
+ o || (i = v(s), n.lifecycleListeners.unmount.push(i));
1033
1049
  }), () => {
1034
- n != null && (i = !0, n());
1050
+ i != null && (o = !0, i());
1035
1051
  };
1036
1052
  }
1037
1053
  }
1038
1054
  };
1039
1055
  class Fe {
1040
- constructor(e, s) {
1041
- f(this, "fn");
1042
- f(this, "_options");
1056
+ constructor(e, n) {
1057
+ c(this, "fn");
1058
+ c(this, "_options");
1043
1059
  /**
1044
1060
  * Value is guaranteed to be set after `attach` is called.
1045
1061
  */
1046
- f(this, "value");
1047
- f(this, "isMounted", !1);
1048
- f(this, "elementContext");
1049
- f(this, "lifecycleListeners", { mount: [], unmount: [] });
1050
- f(this, "logger");
1051
- f(this, "id", pe());
1052
- f(this, "name");
1053
- this.fn = e, this.name = e.name, this._options = s;
1062
+ c(this, "value");
1063
+ c(this, "isMounted", !1);
1064
+ c(this, "elementContext");
1065
+ c(this, "lifecycleListeners", { mount: [], unmount: [] });
1066
+ c(this, "logger");
1067
+ c(this, "id", pe());
1068
+ c(this, "name");
1069
+ this.fn = e, this.name = e.name, this._options = n;
1054
1070
  }
1055
1071
  /**
1056
1072
  * Attaches this Store to the elementContext.
@@ -1060,11 +1076,11 @@ class Fe {
1060
1076
  if (e.stores.has(this.fn))
1061
1077
  return !1;
1062
1078
  this.elementContext = e, this.logger = e.root.createLogger(this.name);
1063
- const s = new ze(this);
1079
+ const n = new ze(this);
1064
1080
  try {
1065
- this.value = this.fn.call(s, this._options, s);
1066
- } catch (n) {
1067
- throw this.logger.crash(n), n;
1081
+ this.value = this.fn.call(n, this._options, n);
1082
+ } catch (s) {
1083
+ throw this.logger.crash(s), s;
1068
1084
  }
1069
1085
  return e.stores.set(this.fn, this), !0;
1070
1086
  }
@@ -1085,11 +1101,11 @@ class O extends Error {
1085
1101
  }
1086
1102
  class We {
1087
1103
  constructor(e) {
1088
- f(this, "view");
1104
+ c(this, "view");
1089
1105
  this.view = e;
1090
- const s = Object.getOwnPropertyDescriptors(this.view.logger);
1091
- for (const n in s)
1092
- n !== "setName" && Object.defineProperty(this, n, s[n]);
1106
+ const n = Object.getOwnPropertyDescriptors(this.view.logger);
1107
+ for (const s in n)
1108
+ s !== "setName" && Object.defineProperty(this, s, n[s]);
1093
1109
  }
1094
1110
  get uid() {
1095
1111
  return this.view.uniqueId;
@@ -1098,32 +1114,32 @@ class We {
1098
1114
  return this.view.isMounted;
1099
1115
  }
1100
1116
  get name() {
1101
- return this.view.elementContext.viewName || this.uid;
1117
+ return this.view.name || this.uid;
1102
1118
  }
1103
1119
  set name(e) {
1104
- this.view.elementContext.viewName = e, this.view.logger.setName(e);
1120
+ this.view.name = e, this.view.logger.setName(e);
1105
1121
  }
1106
- provide(e, s) {
1107
- const n = new Fe(e, s);
1108
- if (n.attach(this.view.elementContext))
1122
+ provide(e, n) {
1123
+ const s = new Fe(e, n);
1124
+ if (s.attach(this.view.elementContext))
1109
1125
  return this.view.lifecycleListeners.mount.push(() => {
1110
- n.handleMount();
1126
+ s.handleMount();
1111
1127
  }), this.view.lifecycleListeners.unmount.push(() => {
1112
- n.handleUnmount();
1113
- }), n.value;
1128
+ s.handleUnmount();
1129
+ }), s.value;
1114
1130
  {
1115
- let r = e.name ? `'${e.name}'` : "this store";
1116
- return this.view.logger.warn(`An instance of ${r} was already attached to this context.`), this.get(e);
1131
+ let o = e.name ? `'${e.name}'` : "this store";
1132
+ return this.view.logger.warn(`An instance of ${o} was already attached to this context.`), this.get(e);
1117
1133
  }
1118
1134
  }
1119
1135
  get(e) {
1120
1136
  if (m(e)) {
1121
- let s = this.view.elementContext, n;
1122
- for (; n = s.stores.get(e), n == null && s.parent != null; )
1123
- s = s.parent;
1124
- if (n == null)
1137
+ let n = this.view.elementContext, s;
1138
+ for (; s = n.stores.get(e), s == null && n.parent != null; )
1139
+ n = n.parent;
1140
+ if (s == null)
1125
1141
  throw new O(`Store '${e.name}' is not provided on this context.`);
1126
- return n.value;
1142
+ return s.value;
1127
1143
  } else
1128
1144
  throw new O("Invalid store.");
1129
1145
  }
@@ -1140,15 +1156,22 @@ class We {
1140
1156
  this.view.lifecycleListeners.unmount.push(e);
1141
1157
  }
1142
1158
  effect(e) {
1159
+ const n = () => {
1160
+ try {
1161
+ e();
1162
+ } catch (s) {
1163
+ this.error(s), s instanceof Error ? this.crash(s) : typeof s == "string" ? this.crash(new Error(s)) : this.crash(new Error("Unknown error thrown in effect callback"));
1164
+ }
1165
+ };
1143
1166
  if (this.view.isMounted) {
1144
- const s = y(e);
1167
+ const s = v(n);
1145
1168
  return this.view.lifecycleListeners.unmount.push(s), s;
1146
1169
  } else {
1147
- let s, n = !1;
1170
+ let s, i = !1;
1148
1171
  return this.view.lifecycleListeners.mount.push(() => {
1149
- n || (s = y(e), this.view.lifecycleListeners.unmount.push(s));
1172
+ i || (s = v(n), this.view.lifecycleListeners.unmount.push(s));
1150
1173
  }), () => {
1151
- s != null && (n = !0, s());
1174
+ s != null && (i = !0, s());
1152
1175
  };
1153
1176
  }
1154
1177
  }
@@ -1159,26 +1182,28 @@ class We {
1159
1182
  var ne;
1160
1183
  ne = x;
1161
1184
  const F = class F {
1162
- constructor(e, s, n, i) {
1163
- f(this, ne, !0);
1164
- f(this, "uniqueId", pe());
1165
- f(this, "elementContext");
1166
- f(this, "logger");
1167
- f(this, "props");
1168
- f(this, "fn");
1169
- f(this, "element");
1170
- f(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
1171
- f(this, "isMounted", !1);
1172
- this.elementContext = {
1185
+ constructor(e, n, s, i) {
1186
+ c(this, ne, !0);
1187
+ c(this, "uniqueId", pe());
1188
+ c(this, "elementContext");
1189
+ c(this, "logger");
1190
+ c(this, "props");
1191
+ c(this, "fn");
1192
+ c(this, "element");
1193
+ c(this, "name");
1194
+ c(this, "context");
1195
+ c(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
1196
+ c(this, "isMounted", !1);
1197
+ this.name = n.name || "🌇 anonymous view", this.elementContext = {
1173
1198
  ...e,
1174
1199
  parent: e,
1175
- viewName: s.name,
1200
+ view: this,
1176
1201
  stores: /* @__PURE__ */ new Map(),
1177
1202
  route: D()
1178
- }, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = {
1179
- ...n,
1203
+ }, this.logger = e.root.createLogger(this.name, { uid: this.uniqueId }), this.props = {
1204
+ ...s,
1180
1205
  children: i
1181
- }, this.fn = s;
1206
+ }, this.fn = n, this.context = new We(this);
1182
1207
  }
1183
1208
  /*===============================*\
1184
1209
  || "Public" API ||
@@ -1187,54 +1212,54 @@ const F = class F {
1187
1212
  var e;
1188
1213
  return (e = this.element) == null ? void 0 : e.domNode;
1189
1214
  }
1190
- mount(e, s) {
1191
- const n = this.isMounted;
1192
- if (!n) {
1215
+ mount(e, n) {
1216
+ const s = this.isMounted;
1217
+ if (!s) {
1193
1218
  this._initialize();
1194
1219
  for (const i of this.lifecycleListeners.beforeMount)
1195
1220
  i();
1196
1221
  }
1197
- this.element && this.element.mount(e, s), n || (this.isMounted = !0, requestAnimationFrame(() => {
1222
+ this.element && this.element.mount(e, n), s || (this.isMounted = !0, requestAnimationFrame(() => {
1198
1223
  for (const i of this.lifecycleListeners.mount)
1199
1224
  i();
1200
1225
  }));
1201
1226
  }
1202
1227
  unmount(e = !1) {
1203
- for (const s of this.lifecycleListeners.beforeUnmount)
1204
- s();
1228
+ for (const n of this.lifecycleListeners.beforeUnmount)
1229
+ n();
1205
1230
  this.element && this.element.unmount(e), this.isMounted = !1;
1206
- for (const s of this.lifecycleListeners.unmount)
1207
- s();
1231
+ for (const n of this.lifecycleListeners.unmount)
1232
+ n();
1208
1233
  this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
1209
1234
  }
1210
1235
  setRouteView(e) {
1211
- const s = new F(this.elementContext, e, {});
1212
- return this.elementContext.route(s), s;
1236
+ const n = new F(this.elementContext, e, {});
1237
+ return this.elementContext.route(n), n;
1213
1238
  }
1214
1239
  /*===============================*\
1215
1240
  || Internal ||
1216
1241
  \*===============================*/
1217
1242
  _initialize() {
1218
- const e = new We(this);
1219
- let s;
1243
+ const { context: e } = this;
1244
+ let n;
1220
1245
  try {
1221
- s = this.fn.call(e, this.props, e);
1222
- } catch (n) {
1223
- throw n instanceof Error && this.logger.crash(n), n;
1246
+ n = this.fn.call(e, this.props, e);
1247
+ } catch (s) {
1248
+ throw s instanceof Error && this.logger.crash(s), s;
1224
1249
  }
1225
- if (s !== null) if (s instanceof Node)
1226
- this.element = A(M(this.elementContext, N("$node", { value: s })));
1227
- else if (m(s))
1250
+ if (n !== null) if (n instanceof Node)
1251
+ this.element = A(M(this.elementContext, N("$node", { value: n })));
1252
+ else if (m(n))
1228
1253
  this.element = A(
1229
- M(this.elementContext, N("$dynamic", { source: s }))
1254
+ M(this.elementContext, N("$dynamic", { source: n }))
1230
1255
  );
1231
- else if ($(s) || V($, s))
1232
- this.element = A(M(this.elementContext, s));
1256
+ else if ($(n) || V($, n))
1257
+ this.element = A(M(this.elementContext, n));
1233
1258
  else {
1234
- const n = new TypeError(
1235
- `Expected '${this.fn.name}' function to return a DOM node, Markup element, Signal or null. Got: ${T(s)}`
1259
+ const s = new TypeError(
1260
+ `Expected '${this.fn.name}' function to return a DOM node, Markup element, Signal or null. Got: ${k(n)}`
1236
1261
  );
1237
- this.logger.crash(n);
1262
+ this.logger.crash(s);
1238
1263
  }
1239
1264
  }
1240
1265
  };
@@ -1242,60 +1267,60 @@ let P = F;
1242
1267
  var ie;
1243
1268
  ie = x;
1244
1269
  class Ze {
1245
- constructor({ elementContext: e, items: s, renderFn: n, keyFn: i }) {
1246
- f(this, ie, !0);
1247
- f(this, "domNode", document.createTextNode(""));
1248
- f(this, "items");
1249
- f(this, "unsubscribe", null);
1250
- f(this, "connectedItems", []);
1251
- f(this, "elementContext");
1252
- f(this, "renderFn");
1253
- f(this, "keyFn");
1254
- this.elementContext = e, this.items = s, this.renderFn = n, this.keyFn = i;
1270
+ constructor({ elementContext: e, items: n, renderFn: s, keyFn: i }) {
1271
+ c(this, ie, !0);
1272
+ c(this, "domNode", document.createTextNode(""));
1273
+ c(this, "items");
1274
+ c(this, "unsubscribe", null);
1275
+ c(this, "connectedItems", []);
1276
+ c(this, "elementContext");
1277
+ c(this, "renderFn");
1278
+ c(this, "keyFn");
1279
+ this.elementContext = e, this.items = n, this.renderFn = s, this.keyFn = i;
1255
1280
  }
1256
1281
  get isMounted() {
1257
1282
  return this.domNode.parentNode != null;
1258
1283
  }
1259
- mount(e, s) {
1260
- this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = y(() => {
1261
- let n = this.items();
1262
- n == null && (n = [], console.log("repeat received empty value", n, this)), _(() => {
1263
- this._update(Array.from(n));
1284
+ mount(e, n) {
1285
+ this.isMounted || (e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), this.unsubscribe = v(() => {
1286
+ let s = this.items();
1287
+ s == null && (s = [], console.log("repeat received empty value", s, this)), _(() => {
1288
+ this._update(Array.from(s));
1264
1289
  });
1265
1290
  }));
1266
1291
  }
1267
1292
  unmount(e = !1) {
1268
- var s;
1269
- this.unsubscribe && (this.unsubscribe(), this.unsubscribe = null), !e && this.isMounted && ((s = this.domNode.parentNode) == null || s.removeChild(this.domNode)), this._cleanup(e);
1293
+ var n;
1294
+ this.unsubscribe && (this.unsubscribe(), this.unsubscribe = null), !e && this.isMounted && ((n = this.domNode.parentNode) == null || n.removeChild(this.domNode)), this._cleanup(e);
1270
1295
  }
1271
1296
  _cleanup(e) {
1272
- for (const s of this.connectedItems)
1273
- s.element.unmount(e);
1297
+ for (const n of this.connectedItems)
1298
+ n.element.unmount(e);
1274
1299
  this.connectedItems = [];
1275
1300
  }
1276
1301
  _update(e) {
1277
- var c, p, g;
1302
+ var f, p, g;
1278
1303
  if (e.length === 0 || !this.isMounted)
1279
1304
  return this._cleanup(!1);
1280
- const s = [];
1281
- let n = 0;
1282
- for (const o of e)
1283
- s.push({
1284
- key: this.keyFn(o, n),
1285
- value: o,
1286
- index: n++
1305
+ const n = [];
1306
+ let s = 0;
1307
+ for (const r of e)
1308
+ n.push({
1309
+ key: this.keyFn(r, s),
1310
+ value: r,
1311
+ index: s++
1287
1312
  });
1288
1313
  const i = [];
1289
- for (const o of this.connectedItems)
1290
- s.find((l) => l.key === o.key) || o.element.unmount(!1);
1291
- for (const o of s) {
1292
- const u = this.connectedItems.find((l) => l.key === o.key);
1314
+ for (const r of this.connectedItems)
1315
+ n.find((l) => l.key === r.key) || r.element.unmount(!1);
1316
+ for (const r of n) {
1317
+ const u = this.connectedItems.find((l) => l.key === r.key);
1293
1318
  if (u)
1294
- u.item(o.value), u.index(o.index), i[o.index] = u;
1319
+ u.item(r.value), u.index(r.index), i[r.index] = u;
1295
1320
  else {
1296
- const l = D(o.value, { equals: C }), d = D(o.index);
1297
- i[o.index] = {
1298
- key: o.key,
1321
+ const l = D(r.value, { equals: C }), d = D(r.index);
1322
+ i[r.index] = {
1323
+ key: r.key,
1299
1324
  item: l,
1300
1325
  index: d,
1301
1326
  element: new P(this.elementContext, He, {
@@ -1306,93 +1331,93 @@ class Ze {
1306
1331
  };
1307
1332
  }
1308
1333
  }
1309
- for (let o = 0; o < i.length; o++) {
1310
- const u = i[o], l = ((c = i[o - 1]) == null ? void 0 : c.element.domNode) ?? this.domNode;
1334
+ for (let r = 0; r < i.length; r++) {
1335
+ const u = i[r], l = ((f = i[r - 1]) == null ? void 0 : f.element.domNode) ?? this.domNode;
1311
1336
  u.element.mount(this.domNode.parentNode, l);
1312
1337
  }
1313
1338
  this.connectedItems = i;
1314
- const r = ((p = i.at(-1)) == null ? void 0 : p.element.domNode) ?? this.domNode;
1315
- (g = this.domNode.parentNode) == null || g.insertBefore(this.domNode, r.nextSibling);
1339
+ const o = ((p = i.at(-1)) == null ? void 0 : p.element.domNode) ?? this.domNode;
1340
+ (g = this.domNode.parentNode) == null || g.insertBefore(this.domNode, o.nextSibling);
1316
1341
  }
1317
1342
  }
1318
1343
  function He(t, e) {
1319
1344
  return e.name = "@RepeatItem", t.renderFn.call(e, t.item, t.index, e);
1320
1345
  }
1321
1346
  function $(t) {
1322
- return t instanceof be;
1347
+ return t instanceof we;
1323
1348
  }
1324
- function ye(t) {
1349
+ function ve(t) {
1325
1350
  return (t == null ? void 0 : t[x]) === !0;
1326
1351
  }
1327
1352
  function j(t) {
1328
- L(t) || (t = [t]);
1353
+ T(t) || (t = [t]);
1329
1354
  const e = [];
1330
- for (const s of t)
1331
- if (!(s == null || s === !1)) {
1332
- if (s instanceof Node) {
1333
- e.push(N("$node", { value: s }));
1355
+ for (const n of t)
1356
+ if (!(n == null || n === !1)) {
1357
+ if (n instanceof Node) {
1358
+ e.push(N("$node", { value: n }));
1334
1359
  continue;
1335
1360
  }
1336
- if ($(s)) {
1337
- e.push(s);
1361
+ if ($(n)) {
1362
+ e.push(n);
1338
1363
  continue;
1339
1364
  }
1340
- if (m(s)) {
1341
- e.push(N("$dynamic", { source: s }));
1365
+ if (m(n)) {
1366
+ e.push(N("$dynamic", { source: n }));
1342
1367
  continue;
1343
1368
  }
1344
- if (L(s)) {
1345
- e.push(...j(s));
1369
+ if (T(n)) {
1370
+ e.push(...j(n));
1346
1371
  continue;
1347
1372
  }
1348
- e.push(N("$text", { value: s }));
1373
+ e.push(N("$text", { value: n }));
1349
1374
  }
1350
1375
  return e;
1351
1376
  }
1352
- function N(t, e, ...s) {
1353
- return new be(t, e, ...s);
1377
+ function N(t, e, ...n) {
1378
+ return new we(t, e, ...n);
1354
1379
  }
1355
- class be {
1356
- constructor(e, s, ...n) {
1357
- f(this, "type");
1358
- f(this, "props");
1359
- f(this, "children");
1360
- this.type = e, this.props = s, this.children = n;
1380
+ class we {
1381
+ constructor(e, n, ...s) {
1382
+ c(this, "type");
1383
+ c(this, "props");
1384
+ c(this, "children");
1385
+ this.type = e, this.props = n, this.children = s;
1361
1386
  }
1362
1387
  }
1363
- function Ke(t, e, s) {
1388
+ function Ke(t, e, n) {
1364
1389
  return N("$dynamic", {
1365
1390
  source: D(() => {
1366
- const n = b(t);
1367
- return n && e ? e : !n && s ? s : null;
1391
+ const s = w(t);
1392
+ return s && e ? e : !s && n ? n : null;
1368
1393
  })
1369
1394
  });
1370
1395
  }
1371
- function dt(t, e, s) {
1372
- return Ke(t, s, e);
1396
+ function dt(t, e, n) {
1397
+ return Ke(t, n, e);
1373
1398
  }
1374
- function ht(t, e, s) {
1375
- return N("$repeat", { items: () => b(t), keyFn: e, renderFn: s });
1399
+ function ht(t, e, n) {
1400
+ return N("$repeat", { items: () => w(t), keyFn: e, renderFn: n });
1376
1401
  }
1377
1402
  function pt(t, e) {
1378
1403
  return N("$portal", { parent: t, content: e });
1379
1404
  }
1380
1405
  function M(t, e) {
1381
- return (L(e) ? e : [e]).map((n) => {
1382
- if (m(n.type))
1383
- return new P(t, n.type, n.props, n.children);
1384
- if (k(n.type))
1385
- switch (n.type) {
1406
+ return (T(e) ? e : [e]).map((s) => {
1407
+ if (m(s.type))
1408
+ return new P(t, s.type, s.props, s.children);
1409
+ if (L(s.type))
1410
+ switch (s.type) {
1386
1411
  case "$node": {
1387
- const i = n.props;
1412
+ const i = s.props;
1388
1413
  return new K(i.value);
1389
1414
  }
1390
1415
  case "$text": {
1391
- const i = n.props;
1416
+ const i = s.props;
1392
1417
  return new K(document.createTextNode(String(i.value)));
1393
1418
  }
1394
1419
  case "$repeat": {
1395
- const i = n.props;
1420
+ const i = s.props;
1396
1421
  return new Ze({
1397
1422
  items: i.items,
1398
1423
  keyFn: i.keyFn,
@@ -1401,22 +1426,22 @@ function M(t, e) {
1401
1426
  });
1402
1427
  }
1403
1428
  case "$dynamic": {
1404
- const i = n.props;
1429
+ const i = s.props;
1405
1430
  return new je({
1406
1431
  source: i.source,
1407
1432
  elementContext: t
1408
1433
  });
1409
1434
  }
1410
1435
  case "$fragment": {
1411
- const i = n.props;
1436
+ const i = s.props;
1412
1437
  return new me(i.children);
1413
1438
  }
1414
1439
  case "$outlet": {
1415
- const i = n.props;
1440
+ const i = s.props;
1416
1441
  return new Be(i.view);
1417
1442
  }
1418
1443
  case "$portal": {
1419
- const i = n.props;
1444
+ const i = s.props;
1420
1445
  return new Ge({
1421
1446
  content: i.content,
1422
1447
  parent: i.parent,
@@ -1425,21 +1450,21 @@ function M(t, e) {
1425
1450
  }
1426
1451
  default:
1427
1452
  return new Ue({
1428
- tag: n.type,
1429
- props: n.props ?? {},
1430
- children: n.children,
1453
+ tag: s.type,
1454
+ props: s.props ?? {},
1455
+ children: s.children,
1431
1456
  elementContext: t
1432
1457
  });
1433
1458
  }
1434
1459
  else
1435
- throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
1460
+ throw new TypeError(`Expected a string or view function. Got: ${s.type}`);
1436
1461
  });
1437
1462
  }
1438
1463
  function A(t) {
1439
1464
  return t.length === 1 ? t[0] : new me(t);
1440
1465
  }
1441
- function we(t) {
1442
- return t == null || t === !1 || m(t) || k(t) || Le(t) || $(t) || V(we, t);
1466
+ function be(t) {
1467
+ return t == null || t === !1 || m(t) || L(t) || Te(t) || $(t) || V(be, t);
1443
1468
  }
1444
1469
  export {
1445
1470
  D as $,
@@ -1449,11 +1474,11 @@ export {
1449
1474
  tt as a,
1450
1475
  st as b,
1451
1476
  it as c,
1452
- L as d,
1477
+ T as d,
1453
1478
  R as e,
1454
- k as f,
1479
+ L as f,
1455
1480
  C as g,
1456
- b as h,
1481
+ w as h,
1457
1482
  m as i,
1458
1483
  ft as j,
1459
1484
  O as k,
@@ -1462,15 +1487,15 @@ export {
1462
1487
  A as n,
1463
1488
  M as o,
1464
1489
  _ as p,
1465
- ot as q,
1490
+ rt as q,
1466
1491
  ct as r,
1467
1492
  ut as s,
1468
- T as t,
1469
- y as u,
1470
- rt as v,
1493
+ k as t,
1494
+ v as u,
1495
+ ot as v,
1471
1496
  Ke as w,
1472
1497
  pt as x,
1473
1498
  ht as y,
1474
1499
  dt as z
1475
1500
  };
1476
- //# sourceMappingURL=markup-D67RWnAp.js.map
1501
+ //# sourceMappingURL=markup-DZdmoqTk.js.map