@manyducks.co/dolla 2.0.0-alpha.45 → 2.0.0-alpha.46

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
- var $e = Object.defineProperty;
2
- var oe = (t) => {
1
+ var je = Object.defineProperty;
2
+ var ce = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var Ie = (t, e, s) => e in t ? $e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
- var c = (t, e, s) => Ie(t, typeof e != "symbol" ? e + "" : e, s), W = (t, e, s) => e.has(t) || oe("Cannot " + s);
7
- var w = (t, e, s) => (W(t, e, "read from private field"), s ? s.call(t) : e.get(t)), T = (t, e, s) => e.has(t) ? oe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), $ = (t, e, s, n) => (W(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s), ue = (t, e, s) => (W(t, e, "access private method"), s);
5
+ var _e = (t, e, s) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
+ var c = (t, e, s) => _e(t, typeof e != "symbol" ? e + "" : e, s), H = (t, e, s) => e.has(t) || ce("Cannot " + s);
7
+ var g = (t, e, s) => (H(t, e, "read from private field"), s ? s.call(t) : e.get(t)), E = (t, e, s) => e.has(t) ? ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), L = (t, e, s, n) => (H(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s), fe = (t, e, s) => (H(t, e, "access private method"), s);
8
8
  var M = /* @__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))(M || {});
9
- function ve({
9
+ function be({
10
10
  updateComputed: t,
11
11
  notifyEffect: e
12
12
  }) {
@@ -59,8 +59,8 @@ function ve({
59
59
  }
60
60
  for (; d; ) {
61
61
  --d;
62
- const re = l.dep.subs;
63
- if (l = re.prevSub, re.prevSub = void 0, (r = l.nextSub) !== void 0) {
62
+ const ue = l.dep.subs;
63
+ if (l = ue.prevSub, ue.prevSub = void 0, (r = l.nextSub) !== void 0) {
64
64
  l = r, u = d ? 64 : 32;
65
65
  continue e;
66
66
  }
@@ -263,44 +263,44 @@ function ve({
263
263
  }
264
264
  }
265
265
  var {
266
- link: lt,
267
- propagate: at,
268
- updateDirtyFlag: Ve,
269
- startTracking: we,
270
- endTracking: be,
271
- processEffectNotifications: dt,
272
- processComputedUpdate: ht,
273
- processPendingInnerEffects: Ne
274
- } = ve({
266
+ link: ht,
267
+ propagate: pt,
268
+ updateDirtyFlag: qe,
269
+ startTracking: Ne,
270
+ endTracking: xe,
271
+ processEffectNotifications: mt,
272
+ processComputedUpdate: gt,
273
+ processPendingInnerEffects: Se
274
+ } = be({
275
275
  updateComputed(t) {
276
- we(t);
276
+ Ne(t);
277
277
  try {
278
278
  const e = t.currentValue, s = t.getter(e);
279
279
  return e !== s ? (t.currentValue = s, !0) : !1;
280
280
  } finally {
281
- be(t);
281
+ xe(t);
282
282
  }
283
283
  },
284
284
  notifyEffect(t) {
285
- return "isScope" in t ? qe(t) : _e(t);
285
+ return "isScope" in t ? Re(t) : Be(t);
286
286
  }
287
287
  });
288
- function je(t) {
289
- we(t);
288
+ function Ue(t) {
289
+ Ne(t);
290
290
  try {
291
291
  t.fn();
292
292
  } finally {
293
- be(t);
293
+ xe(t);
294
294
  }
295
295
  }
296
- function _e(t) {
296
+ function Be(t) {
297
297
  const e = t.flags;
298
- return e & 32 || e & 64 && Ve(t, e) ? je(t) : Ne(t, t.flags), !0;
298
+ return e & 32 || e & 64 && qe(t, e) ? Ue(t) : Se(t, t.flags), !0;
299
299
  }
300
- function qe(t) {
301
- return t.flags & 128 ? (Ne(t, t.flags), !0) : !1;
300
+ function Re(t) {
301
+ return t.flags & 128 ? (Se(t, t.flags), !0) : !1;
302
302
  }
303
- function D(t) {
303
+ function T(t) {
304
304
  const e = typeof t;
305
305
  switch (e) {
306
306
  case "undefined":
@@ -315,134 +315,140 @@ function D(t) {
315
315
  return e;
316
316
  }
317
317
  }
318
- function _(t) {
318
+ function U(t) {
319
319
  return Array.isArray(t);
320
320
  }
321
- function J(t, e) {
322
- return _(e) && e.every((s) => t(s));
321
+ function Y(t, e) {
322
+ return U(e) && e.every((s) => t(s));
323
323
  }
324
- function pt(t, e, s) {
325
- if (J(t, e))
324
+ function yt(t, e, s) {
325
+ if (Y(t, e))
326
326
  return !0;
327
- throw new TypeError(F(e, s));
327
+ throw new TypeError(W(e, s));
328
328
  }
329
329
  function O(t) {
330
330
  return typeof t == "string";
331
331
  }
332
- function mt(t, e) {
332
+ function vt(t, e) {
333
333
  if (O(t))
334
334
  return !0;
335
- throw new TypeError(F(t, e ?? "Expected a string. Got type: %t, value: %v"));
335
+ throw new TypeError(W(t, e ?? "Expected a string. Got type: %t, value: %v"));
336
336
  }
337
- function S(t) {
338
- return D(t) === "function";
337
+ function k(t) {
338
+ return T(t) === "function";
339
339
  }
340
- function Ue(t) {
340
+ function ze(t) {
341
341
  return typeof t == "number" && !isNaN(t);
342
342
  }
343
- function gt(...t) {
343
+ function wt(...t) {
344
344
  const e = t[0], s = O(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
345
345
  if (i instanceof e)
346
346
  return !0;
347
- throw new TypeError(F(i, s));
347
+ throw new TypeError(W(i, s));
348
348
  };
349
349
  return t.length < 2 ? n : n(t[1]);
350
350
  }
351
- function Q(t) {
352
- return t != null && typeof t == "object" && !_(t);
351
+ function ee(t) {
352
+ return t != null && typeof t == "object" && !U(t);
353
353
  }
354
- function yt(t, e) {
355
- if (Q(t))
354
+ function bt(t, e) {
355
+ if (ee(t))
356
356
  return !0;
357
- throw new TypeError(F(t, e));
357
+ throw new TypeError(W(t, e));
358
358
  }
359
- function F(t, e) {
359
+ function W(t, e) {
360
360
  var i;
361
- const s = D(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
361
+ const s = T(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
362
362
  return e.replaceAll("%t", s).replaceAll("%v", n);
363
363
  }
364
- let k, P = [];
364
+ let A, P = [];
365
365
  const {
366
- link: Y,
367
- propagate: Re,
368
- updateDirtyFlag: ze,
369
- startTracking: ee,
370
- endTracking: te,
371
- processEffectNotifications: Be,
372
- processComputedUpdate: Fe,
373
- processPendingInnerEffects: Ge
374
- } = ve({
366
+ link: te,
367
+ propagate: Fe,
368
+ updateDirtyFlag: Ge,
369
+ startTracking: se,
370
+ endTracking: ne,
371
+ processEffectNotifications: We,
372
+ processComputedUpdate: Ze,
373
+ processPendingInnerEffects: He
374
+ } = be({
375
375
  updateComputed(t) {
376
- const e = g;
377
- g = t, P.length = 0, ee(t);
376
+ const e = y;
377
+ y = t, P.length = 0, se(t);
378
378
  try {
379
379
  const s = t.currentValue, n = t.getter(s);
380
380
  return t.equals(s, n) ? !1 : (t.currentValue = n, !0);
381
381
  } finally {
382
- g = e, k !== void 0 && (k(P), k = void 0), te(t);
382
+ y = e, A !== void 0 && (A(P), A = void 0), ne(t);
383
383
  }
384
384
  },
385
385
  notifyEffect(t) {
386
386
  const e = t.flags;
387
- return e & M.Dirty || e & M.PendingComputed && ze(t, e) ? xe(t) : Ge(t, t.flags), !0;
387
+ return e & M.Dirty || e & M.PendingComputed && Ge(t, e) ? Ee(t) : He(t, t.flags), !0;
388
388
  }
389
389
  });
390
- let g;
391
- const L = [];
392
- let Z = !1;
393
- function We() {
394
- Z || (Z = !0, queueMicrotask(() => {
395
- Z = !1;
396
- for (let t = 0; t < L.length; t++) {
397
- const e = L[t], s = g;
398
- g = e, P.length = 0, ee(e);
390
+ let y;
391
+ const D = [];
392
+ let K = !1;
393
+ function Ke() {
394
+ K || (K = !0, queueMicrotask(() => {
395
+ K = !1;
396
+ for (let t = 0; t < D.length; t++) {
397
+ const e = D[t], s = y;
398
+ y = e, P.length = 0, se(e);
399
399
  try {
400
400
  e.fn();
401
401
  } finally {
402
- g = s, te(e), k !== void 0 && (k(P), k = void 0);
402
+ y = s, ne(e), A !== void 0 && (A(P), A = void 0);
403
403
  }
404
404
  }
405
- L.length = 0;
405
+ D.length = 0;
406
406
  }));
407
407
  }
408
- function xe(t) {
409
- L.push(t), We();
408
+ function Ee(t) {
409
+ D.push(t), Ke();
410
410
  }
411
- function Ze() {
412
- ee(this), te(this), queueMicrotask(() => {
413
- L.splice(L.indexOf(this), 1);
411
+ function Xe() {
412
+ se(this), ne(this), queueMicrotask(() => {
413
+ D.splice(D.indexOf(this), 1);
414
414
  });
415
415
  }
416
- const Ee = [];
417
- function He() {
418
- Ee.push(g), g = void 0;
416
+ const Me = [];
417
+ function Je() {
418
+ Me.push(y), y = void 0;
419
419
  }
420
- function Ke() {
421
- g = Ee.pop();
420
+ function Qe() {
421
+ y = Me.pop();
422
422
  }
423
- var b, V;
424
- class Me {
423
+ var b, V, j;
424
+ class ke {
425
425
  constructor(e, s) {
426
- T(this, b);
427
- T(this, V);
428
- c(this, "name");
429
- $(this, b, {
426
+ E(this, b);
427
+ E(this, V);
428
+ E(this, j);
429
+ L(this, b, {
430
430
  currentValue: e,
431
431
  subs: void 0,
432
432
  subsTail: void 0
433
- }), $(this, V, (s == null ? void 0 : s.equals) ?? Object.is), s != null && s.name && (this.name = s.name);
433
+ }), L(this, V, (s == null ? void 0 : s.equals) ?? Object.is), s != null && s.name && L(this, j, s.name);
434
+ }
435
+ get name() {
436
+ return g(this, j) || `anonymous ${this[Symbol.toStringTag]}`;
437
+ }
438
+ get [Symbol.toStringTag]() {
439
+ return `Atom<${T(g(this, b).currentValue)}>`;
434
440
  }
435
441
  /**
436
442
  * Returns the latest value. The signal is tracked as a dependency if called within `effect` or `compose`.
437
443
  */
438
444
  get() {
439
- return g !== void 0 && (Y(w(this, b), g), P.push(this)), w(this, b).currentValue;
445
+ return y !== void 0 && (te(g(this, b), y), P.push(this)), g(this, b).currentValue;
440
446
  }
441
447
  /**
442
448
  * Returns the latest value. The signal is NOT tracked if called within `effect` or `compose`.
443
449
  */
444
450
  peek() {
445
- return w(this, b).currentValue;
451
+ return g(this, b).currentValue;
446
452
  }
447
453
  /**
448
454
  * Replaces the current value with `next`.
@@ -453,10 +459,10 @@ class Me {
453
459
  * count.set(count.get() + 1);
454
460
  */
455
461
  set(e) {
456
- if (!w(this, V).call(this, w(this, b).currentValue, e)) {
457
- w(this, b).currentValue = e;
458
- const s = w(this, b).subs;
459
- s !== void 0 && (Re(s), Be());
462
+ if (!g(this, V).call(this, g(this, b).currentValue, e)) {
463
+ g(this, b).currentValue = e;
464
+ const s = g(this, b).subs;
465
+ s !== void 0 && (Fe(s), We());
460
466
  }
461
467
  }
462
468
  /**
@@ -506,15 +512,15 @@ class Me {
506
512
  this.set(e);
507
513
  }
508
514
  }
509
- b = new WeakMap(), V = new WeakMap();
510
- var A, j, B, ke;
511
- class Se {
515
+ b = new WeakMap(), V = new WeakMap(), j = new WeakMap();
516
+ var C, _, q, G, Le;
517
+ class Te {
512
518
  constructor(e, s) {
513
- T(this, B);
514
- T(this, A);
515
- T(this, j);
516
- c(this, "name");
517
- $(this, j, e), $(this, A, {
519
+ E(this, G);
520
+ E(this, C);
521
+ E(this, _);
522
+ E(this, q);
523
+ L(this, _, e), L(this, C, {
518
524
  currentValue: void 0,
519
525
  equals: (s == null ? void 0 : s.equals) ?? Object.is,
520
526
  subs: void 0,
@@ -522,15 +528,21 @@ class Se {
522
528
  deps: void 0,
523
529
  depsTail: void 0,
524
530
  flags: M.Computed | M.Dirty,
525
- getter: ue(this, B, ke).bind(this)
526
- }), s != null && s.name && (this.name = s.name);
531
+ getter: fe(this, G, Le).bind(this)
532
+ }), s != null && s.name && L(this, q, s.name);
533
+ }
534
+ get name() {
535
+ return g(this, q) || `anonymous ${this[Symbol.toStringTag]}`;
536
+ }
537
+ get [Symbol.toStringTag]() {
538
+ return `Composed<${T(g(this, C).currentValue)}>`;
527
539
  }
528
540
  get() {
529
- return g !== void 0 && (Y(w(this, A), g), P.push(this)), this.peek();
541
+ return y !== void 0 && (te(g(this, C), y), P.push(this)), this.peek();
530
542
  }
531
543
  peek() {
532
- const e = w(this, A), s = e.flags;
533
- return s & (M.Dirty | M.PendingComputed) && Fe(e, s), e.currentValue;
544
+ const e = g(this, C), s = e.flags;
545
+ return s & (M.Dirty | M.PendingComputed) && Ze(e, s), e.currentValue;
534
546
  }
535
547
  /**
536
548
  * @deprecated use `get()`
@@ -539,41 +551,41 @@ class Se {
539
551
  return this.peek();
540
552
  }
541
553
  }
542
- A = new WeakMap(), j = new WeakMap(), B = new WeakSet(), ke = function(e) {
543
- let s = w(this, j).call(this, e);
544
- return y(s) && (s = s.get()), s;
554
+ C = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), G = new WeakSet(), Le = function(e) {
555
+ let s = g(this, _).call(this, e);
556
+ return v(s) && (s = s.get()), s;
545
557
  };
546
- function y(t) {
547
- return t instanceof Me || t instanceof Se;
558
+ function v(t) {
559
+ return t instanceof ke || t instanceof Te;
548
560
  }
549
- function X(t, e) {
550
- return new Me(t, e);
561
+ function Q(t, e) {
562
+ return new ke(t, e);
551
563
  }
552
- function se(t, e) {
553
- return new Se(t, e);
564
+ function ie(t, e) {
565
+ return new Te(t, e);
554
566
  }
555
- function Xe(t, e) {
556
- if (S(e))
567
+ function Ye(t, e) {
568
+ if (k(e))
557
569
  t.update(e);
558
570
  else if (arguments.length > 1)
559
571
  t.set(e);
560
572
  else
561
- return (s) => Xe(t, s);
573
+ return (s) => Ye(t, s);
562
574
  }
563
575
  function I(t) {
564
- return y(t) ? t.get() : t;
576
+ return v(t) ? t.get() : t;
565
577
  }
566
- function vt(t) {
567
- return y(t) ? t.peek() : t;
578
+ function Nt(t) {
579
+ return v(t) ? t.peek() : t;
568
580
  }
569
- function G(t) {
570
- He(), t(), Ke();
581
+ function Z(t) {
582
+ Je(), t(), Qe();
571
583
  }
572
- function wt(t) {
573
- k = t;
584
+ function xt(t) {
585
+ A = t;
574
586
  }
575
- function v(t) {
576
- const e = {
587
+ function w(t, e) {
588
+ const s = {
577
589
  fn: t,
578
590
  subs: void 0,
579
591
  subsTail: void 0,
@@ -581,21 +593,21 @@ function v(t) {
581
593
  depsTail: void 0,
582
594
  flags: M.Effect
583
595
  };
584
- return g !== void 0 && Y(e, g), xe(e), Ze.bind(e);
596
+ return y !== void 0 && te(s, y), Ee(s), Xe.bind(s);
585
597
  }
586
- const bt = () => {
598
+ const St = () => {
587
599
  };
588
- let H = 1;
589
- function Te() {
590
- return H = H % Number.MAX_SAFE_INTEGER + 1, H.toString(36) + Date.now().toString(36);
600
+ let X = 1;
601
+ function Ce() {
602
+ return X = X % Number.MAX_SAFE_INTEGER + 1, X.toString(36) + Date.now().toString(36);
591
603
  }
592
- function Nt(t, e) {
604
+ function Et(t, e) {
593
605
  return Object.is(t, e);
594
606
  }
595
- function xt(t, e) {
607
+ function Mt(t, e) {
596
608
  if (Object.is(t, e)) return !0;
597
- const s = D(t);
598
- if (s !== D(e))
609
+ const s = T(t);
610
+ if (s !== T(e))
599
611
  return !1;
600
612
  switch (s) {
601
613
  case "object":
@@ -616,7 +628,7 @@ function xt(t, e) {
616
628
  if (t[i] !== e[i]) return !1;
617
629
  return !0;
618
630
  case "set":
619
- if (S(t.symmetricDifference))
631
+ if (k(t.symmetricDifference))
620
632
  return t.symmetricDifference(e).size === 0;
621
633
  for (const i of t.keys())
622
634
  if (t[i] !== e.get(i)) return !1;
@@ -624,20 +636,20 @@ function xt(t, e) {
624
636
  }
625
637
  return !1;
626
638
  }
627
- function K(t, e) {
639
+ function J(t, e) {
628
640
  if (t === e) return !0;
629
641
  if (t && e && typeof t == "object" && typeof e == "object") {
630
642
  if (t.constructor !== e.constructor) return !1;
631
643
  var s, n, i;
632
644
  if (Array.isArray(t)) {
633
645
  if (s = t.length, s != e.length) return !1;
634
- for (n = s; n-- !== 0; ) if (!K(t[n], e[n])) return !1;
646
+ for (n = s; n-- !== 0; ) if (!J(t[n], e[n])) return !1;
635
647
  return !0;
636
648
  }
637
649
  if (t instanceof Map && e instanceof Map) {
638
650
  if (t.size !== e.size) return !1;
639
651
  for (n of t.entries()) if (!e.has(n[0])) return !1;
640
- for (n of t.entries()) if (!K(n[1], e.get(n[0]))) return !1;
652
+ for (n of t.entries()) if (!J(n[1], e.get(n[0]))) return !1;
641
653
  return !0;
642
654
  }
643
655
  if (t instanceof Set && e instanceof Set) {
@@ -657,25 +669,25 @@ function K(t, e) {
657
669
  for (n = s; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[n])) return !1;
658
670
  for (n = s; n-- !== 0; ) {
659
671
  var o = i[n];
660
- if (!K(t[o], e[o])) return !1;
672
+ if (!J(t[o], e[o])) return !1;
661
673
  }
662
674
  return !0;
663
675
  }
664
676
  return t !== t && e !== e;
665
677
  }
666
- function Je(t, e) {
678
+ function et(t, e) {
667
679
  const s = {};
668
680
  for (const n in e)
669
681
  t.includes(n) || (s[n] = e[n]);
670
682
  return s;
671
683
  }
672
- function Et(t) {
684
+ function kt(t) {
673
685
  let e = 0;
674
686
  for (let s = 0; s < t.length; s++)
675
687
  e = (e + t.charCodeAt(s) * 10) % 360;
676
688
  return `oklch(0.68 0.15 ${e}deg)`;
677
689
  }
678
- function Mt(t) {
690
+ function Tt(t) {
679
691
  if (t instanceof RegExp)
680
692
  return (n) => t.test(n);
681
693
  const e = {
@@ -697,12 +709,12 @@ function Mt(t) {
697
709
  return !(o.some((f) => f(n)) || i.length > 0 && !i.some((f) => f(n)));
698
710
  };
699
711
  }
700
- const E = Symbol.for("DollaMarkupElement"), St = Symbol.for("DollaRouter");
701
- var le;
702
- le = E;
703
- class ce {
712
+ const S = Symbol.for("DollaMarkupElement"), Lt = Symbol.for("DollaRouter");
713
+ var de;
714
+ de = S;
715
+ class le {
704
716
  constructor(e) {
705
- c(this, le, !0);
717
+ c(this, de, !0);
706
718
  c(this, "domNode");
707
719
  this.domNode = e;
708
720
  }
@@ -716,11 +728,11 @@ class ce {
716
728
  this.domNode.parentNode && !e && this.domNode.parentNode.removeChild(this.domNode);
717
729
  }
718
730
  }
719
- var ae;
720
- ae = E;
721
- class Qe {
731
+ var he;
732
+ he = S;
733
+ class tt {
722
734
  constructor(e) {
723
- c(this, ae, !0);
735
+ c(this, he, !0);
724
736
  c(this, "domNode", document.createTextNode(""));
725
737
  c(this, "children", []);
726
738
  c(this, "elementContext");
@@ -732,14 +744,14 @@ class Qe {
732
744
  return this.domNode.parentNode != null;
733
745
  }
734
746
  mount(e, s) {
735
- this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = v(() => {
747
+ this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
736
748
  const n = this.source.get();
737
- if (!Oe(n))
749
+ if (!Ve(n))
738
750
  throw console.error(n), new TypeError(
739
- `Dynamic received invalid value to render. Got type: ${D(n)}, value: ${n}`
751
+ `Dynamic received invalid value to render. Got type: ${T(n)}, value: ${n}`
740
752
  );
741
- G(() => {
742
- this.update(_(n) ? n : [n]);
753
+ Z(() => {
754
+ this.update(U(n) ? n : [n]);
743
755
  });
744
756
  }));
745
757
  }
@@ -756,21 +768,21 @@ class Qe {
756
768
  var o, f, p;
757
769
  if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
758
770
  return;
759
- const s = e.flatMap((m) => De(m) ? m : C(this.elementContext, ne(m)));
771
+ const s = e.flatMap((m) => Pe(m) ? m : $(this.elementContext, re(m)));
760
772
  for (const m of s) {
761
773
  const r = ((o = this.children.at(-1)) == null ? void 0 : o.domNode) || this.domNode;
762
774
  m.mount(this.domNode.parentNode, r), this.children.push(m);
763
775
  }
764
776
  const n = this.domNode.parentNode, i = ((p = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : p.nextSibling) ?? null;
765
- n.insertBefore(this.domNode, i);
777
+ "moveBefore" in n ? n.moveBefore(this.domNode, i) : n.insertBefore(this.domNode, i);
766
778
  }
767
779
  }
768
- const Ye = (t) => /^on[A-Z]/.test(t);
769
- var de;
770
- de = E;
771
- class et {
780
+ const st = (t) => /^on[A-Z]/.test(t);
781
+ var pe;
782
+ pe = S;
783
+ class nt {
772
784
  constructor({ tag: e, props: s, children: n, elementContext: i }) {
773
- c(this, de, !0);
785
+ c(this, pe, !0);
774
786
  c(this, "domNode");
775
787
  c(this, "props");
776
788
  c(this, "childMarkup", []);
@@ -785,14 +797,14 @@ class et {
785
797
  ...i,
786
798
  isSVG: !0
787
799
  }), 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)
788
- if (S(s.ref))
800
+ if (k(s.ref))
789
801
  this.ref = s.ref, this.ref(this.domNode);
790
802
  else
791
803
  throw new Error("Expected ref to be a function. Got: " + s.ref);
792
804
  this.props = {
793
- ...Je(["ref", "class", "className"], s),
805
+ ...et(["ref", "class", "className"], s),
794
806
  class: s.className ?? s.class
795
- }, n && (this.childMarkup = ne(n)), this.elementContext = i;
807
+ }, n && (this.childMarkup = re(n)), this.elementContext = i;
796
808
  }
797
809
  get isMounted() {
798
810
  return this.domNode.parentNode != null;
@@ -801,7 +813,7 @@ class et {
801
813
  if (e == null)
802
814
  throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
803
815
  if (!this.isMounted) {
804
- this.childMarkup.length > 0 && (this.children = C(this.elementContext, this.childMarkup));
816
+ this.childMarkup.length > 0 && (this.children = $(this.elementContext, this.childMarkup));
805
817
  for (let n = 0; n < this.children.length; n++) {
806
818
  const i = this.children[n], o = n > 0 ? this.children[n - 1].domNode : void 0;
807
819
  i.mount(this.domNode, o);
@@ -825,8 +837,8 @@ class et {
825
837
  }
826
838
  }
827
839
  attachProp(e, s) {
828
- y(e) ? this.unsubscribers.push(
829
- v(() => {
840
+ v(e) ? this.unsubscribers.push(
841
+ w(() => {
830
842
  s(e.get());
831
843
  })
832
844
  ) : s(e);
@@ -836,13 +848,13 @@ class et {
836
848
  const i = s[n];
837
849
  if (n === "on:clickoutside" || n === "onClickOutside" || n === "onclickoutside") {
838
850
  const o = (p) => {
839
- this.canClickAway && !e.contains(p.target) && (y(i) ? i.peek()(p) : i(p));
851
+ this.canClickAway && !e.contains(p.target) && (v(i) ? i.peek()(p) : i(p));
840
852
  }, f = { capture: !0 };
841
853
  window.addEventListener("click", o, f), this.unsubscribers.push(() => {
842
854
  window.removeEventListener("click", o, f);
843
855
  });
844
- } else if (Ye(n)) {
845
- const o = n.slice(2).toLowerCase(), f = y(i) ? (p) => i.peek()(p) : i;
856
+ } else if (st(n)) {
857
+ const o = n.slice(2).toLowerCase(), f = v(i) ? (p) => i.peek()(p) : i;
846
858
  e.addEventListener(o, f), this.unsubscribers.push(() => {
847
859
  e.removeEventListener(o, f);
848
860
  });
@@ -850,7 +862,7 @@ class et {
850
862
  this.attachProp(i, (o) => {
851
863
  o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
852
864
  });
853
- else if (!tt.includes(n))
865
+ else if (!it.includes(n))
854
866
  if (this.elementContext.isSVG)
855
867
  this.attachProp(i, (o) => {
856
868
  o != null ? e.setAttribute(n, String(s[n])) : e.removeAttribute(n);
@@ -911,18 +923,18 @@ class et {
911
923
  }
912
924
  applyStyles(e, s, n) {
913
925
  const i = [];
914
- if (y(s)) {
926
+ if (v(s)) {
915
927
  let o;
916
- const f = v(() => {
917
- S(o) && o(), e.style.cssText = "", o = this.applyStyles(e, I(s), n);
928
+ const f = w(() => {
929
+ k(o) && o(), e.style.cssText = "", o = this.applyStyles(e, I(s), n);
918
930
  });
919
931
  n.push(f), i.push(f);
920
932
  } else {
921
- const o = Ce(s);
933
+ const o = De(s);
922
934
  for (const f in o) {
923
935
  const { value: p, priority: m } = o[f];
924
- if (y(p)) {
925
- const r = v(() => {
936
+ if (v(p)) {
937
+ const r = w(() => {
926
938
  p.get() ? e.style.setProperty(f, String(p.get()), m) : e.style.removeProperty(f);
927
939
  });
928
940
  n.push(r), i.push(r);
@@ -936,18 +948,18 @@ class et {
936
948
  }
937
949
  applyClasses(e, s, n) {
938
950
  const i = [];
939
- if (y(s)) {
951
+ if (v(s)) {
940
952
  let o;
941
- const f = v(() => {
942
- S(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, I(s), n);
953
+ const f = w(() => {
954
+ k(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, I(s), n);
943
955
  });
944
956
  n.push(f), i.push(f);
945
957
  } else {
946
- const o = Le(s);
958
+ const o = Ae(s);
947
959
  for (const f in o) {
948
960
  const p = o[f];
949
- if (y(p)) {
950
- const m = v(() => {
961
+ if (v(p)) {
962
+ const m = w(() => {
951
963
  I(p) ? e.classList.add(f) : e.classList.remove(f);
952
964
  });
953
965
  n.push(m), i.push(m);
@@ -960,18 +972,18 @@ class et {
960
972
  };
961
973
  }
962
974
  }
963
- function Le(t) {
975
+ function Ae(t) {
964
976
  let e = {};
965
977
  if (O(t)) {
966
978
  const s = t.split(" ");
967
979
  for (const n of s)
968
980
  e[n] = !0;
969
- } else Q(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
970
- Object.assign(e, Le(s));
981
+ } else ee(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
982
+ Object.assign(e, Ae(s));
971
983
  });
972
984
  return delete e.undefined, e;
973
985
  }
974
- function Ce(t) {
986
+ function De(t) {
975
987
  let e = {};
976
988
  if (O(t)) {
977
989
  const s = t.split(";").filter((n) => n.trim() !== "");
@@ -979,22 +991,22 @@ function Ce(t) {
979
991
  const [i, o] = n.split(":"), f = {
980
992
  value: o
981
993
  };
982
- o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[fe(i.trim())] = f;
994
+ o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[ae(i.trim())] = f;
983
995
  }
984
996
  }
985
- if (Q(t))
997
+ if (ee(t))
986
998
  for (const s in t)
987
- s.startsWith("--") ? e[s] = { value: t[s] } : e[fe(s)] = { value: t[s] };
999
+ s.startsWith("--") ? e[s] = { value: t[s] } : e[ae(s)] = { value: t[s] };
988
1000
  else Array.isArray(t) && Array.from(t).filter((s) => s != null).forEach((s) => {
989
- Object.assign(e, Ce(s));
1001
+ Object.assign(e, De(s));
990
1002
  });
991
1003
  return e;
992
1004
  }
993
- function fe(t) {
1005
+ function ae(t) {
994
1006
  return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s ? "-" : "") + e.toLowerCase());
995
1007
  }
996
- const tt = ["ref", "children", "class", "style", "data"];
997
- let st = class {
1008
+ const it = ["ref", "children", "class", "style", "data"];
1009
+ let rt = class {
998
1010
  constructor(e) {
999
1011
  c(this, "store");
1000
1012
  this.store = e;
@@ -1012,15 +1024,15 @@ let st = class {
1012
1024
  this.store.name = e, this.store.logger.setName(e);
1013
1025
  }
1014
1026
  get(e) {
1015
- if (S(e)) {
1027
+ if (k(e)) {
1016
1028
  let s = this.store.elementContext, n;
1017
1029
  for (; n = s.stores.get(e), n == null && s.parent != null; )
1018
1030
  s = s.parent;
1019
1031
  if (n == null)
1020
- throw new U(`Store '${e.name}' is not provided on this context.`);
1032
+ throw new R(`Store '${e.name}' is not provided on this context.`);
1021
1033
  return n.value;
1022
1034
  } else
1023
- throw new U("Invalid store.");
1035
+ throw new R("Invalid store.");
1024
1036
  }
1025
1037
  onMount(e) {
1026
1038
  this.store.lifecycleListeners.mount.push(e);
@@ -1028,22 +1040,22 @@ let st = class {
1028
1040
  onUnmount(e) {
1029
1041
  this.store.lifecycleListeners.unmount.push(e);
1030
1042
  }
1031
- effect(e) {
1032
- const s = this.store;
1033
- if (s.isMounted) {
1034
- const n = v(e);
1035
- return s.lifecycleListeners.unmount.push(n), n;
1043
+ effect(e, s) {
1044
+ const n = this.store;
1045
+ if (n.isMounted) {
1046
+ const i = w(e);
1047
+ return n.lifecycleListeners.unmount.push(i), i;
1036
1048
  } else {
1037
- let n, i = !1;
1038
- return s.lifecycleListeners.mount.push(() => {
1039
- i || (n = v(e), s.lifecycleListeners.unmount.push(n));
1049
+ let i, o = !1;
1050
+ return n.lifecycleListeners.mount.push(() => {
1051
+ o || (i = w(e), n.lifecycleListeners.unmount.push(i));
1040
1052
  }), () => {
1041
- n != null && (i = !0, n());
1053
+ i != null && (o = !0, i());
1042
1054
  };
1043
1055
  }
1044
1056
  }
1045
1057
  };
1046
- class nt {
1058
+ class ot {
1047
1059
  constructor(e, s) {
1048
1060
  c(this, "fn");
1049
1061
  c(this, "_options");
@@ -1055,7 +1067,7 @@ class nt {
1055
1067
  c(this, "elementContext");
1056
1068
  c(this, "lifecycleListeners", { mount: [], unmount: [] });
1057
1069
  c(this, "logger");
1058
- c(this, "id", Te());
1070
+ c(this, "id", Ce());
1059
1071
  c(this, "name");
1060
1072
  this.fn = e, this.name = e.name, this._options = s;
1061
1073
  }
@@ -1067,7 +1079,7 @@ class nt {
1067
1079
  if (e.stores.has(this.fn))
1068
1080
  return !1;
1069
1081
  this.elementContext = e, this.logger = e.root.createLogger(this.name);
1070
- const s = new st(this);
1082
+ const s = new rt(this);
1071
1083
  try {
1072
1084
  this.value = this.fn.call(s, this._options, s);
1073
1085
  } catch (n) {
@@ -1088,9 +1100,9 @@ class nt {
1088
1100
  this.lifecycleListeners.unmount.length = 0;
1089
1101
  }
1090
1102
  }
1091
- class U extends Error {
1103
+ class R extends Error {
1092
1104
  }
1093
- class it {
1105
+ class ut {
1094
1106
  constructor(e) {
1095
1107
  c(this, "view");
1096
1108
  this.view = e;
@@ -1111,7 +1123,7 @@ class it {
1111
1123
  this.view.elementContext.viewName = e, this.view.logger.setName(e);
1112
1124
  }
1113
1125
  provide(e, s) {
1114
- const n = new nt(e, s);
1126
+ const n = new ot(e, s);
1115
1127
  if (n.attach(this.view.elementContext))
1116
1128
  return this.view.lifecycleListeners.mount.push(() => {
1117
1129
  n.handleMount();
@@ -1124,15 +1136,15 @@ class it {
1124
1136
  }
1125
1137
  }
1126
1138
  get(e) {
1127
- if (S(e)) {
1139
+ if (k(e)) {
1128
1140
  let s = this.view.elementContext, n;
1129
1141
  for (; n = s.stores.get(e), n == null && s.parent != null; )
1130
1142
  s = s.parent;
1131
1143
  if (n == null)
1132
- throw new U(`Store '${e.name}' is not provided on this context.`);
1144
+ throw new R(`Store '${e.name}' is not provided on this context.`);
1133
1145
  return n.value;
1134
1146
  } else
1135
- throw new U("Invalid store.");
1147
+ throw new R("Invalid store.");
1136
1148
  }
1137
1149
  beforeMount(e) {
1138
1150
  this.view.lifecycleListeners.beforeMount.push(e);
@@ -1146,16 +1158,16 @@ class it {
1146
1158
  onUnmount(e) {
1147
1159
  this.view.lifecycleListeners.unmount.push(e);
1148
1160
  }
1149
- effect(e) {
1161
+ effect(e, s) {
1150
1162
  if (this.view.isMounted) {
1151
- const s = v(e);
1152
- return this.view.lifecycleListeners.unmount.push(s), s;
1163
+ const n = w(e);
1164
+ return this.view.lifecycleListeners.unmount.push(n), n;
1153
1165
  } else {
1154
- let s, n = !1;
1166
+ let n, i = !1;
1155
1167
  return this.view.lifecycleListeners.mount.push(() => {
1156
- n || (s = v(e), this.view.lifecycleListeners.unmount.push(s));
1168
+ i || (n = w(e), this.view.lifecycleListeners.unmount.push(n));
1157
1169
  }), () => {
1158
- s != null && (n = !0, s());
1170
+ n != null && (i = !0, n());
1159
1171
  };
1160
1172
  }
1161
1173
  }
@@ -1163,12 +1175,12 @@ class it {
1163
1175
  return x("$outlet", { view: this.view.elementContext.route });
1164
1176
  }
1165
1177
  }
1166
- var he;
1167
- he = E;
1168
- const ie = class ie {
1178
+ var me;
1179
+ me = S;
1180
+ const oe = class oe {
1169
1181
  constructor(e, s, n, i) {
1170
- c(this, he, !0);
1171
- c(this, "uniqueId", Te());
1182
+ c(this, me, !0);
1183
+ c(this, "uniqueId", Ce());
1172
1184
  c(this, "elementContext");
1173
1185
  c(this, "logger");
1174
1186
  c(this, "props");
@@ -1181,7 +1193,7 @@ const ie = class ie {
1181
1193
  parent: e,
1182
1194
  viewName: s.name,
1183
1195
  stores: /* @__PURE__ */ new Map(),
1184
- route: X()
1196
+ route: Q()
1185
1197
  }, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = {
1186
1198
  ...n,
1187
1199
  children: i
@@ -1215,14 +1227,14 @@ const ie = class ie {
1215
1227
  this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
1216
1228
  }
1217
1229
  setRouteView(e) {
1218
- const s = new ie(this.elementContext, e, {});
1230
+ const s = new oe(this.elementContext, e, {});
1219
1231
  return this.elementContext.route.set(s), s;
1220
1232
  }
1221
1233
  /*===============================*\
1222
1234
  || Internal ||
1223
1235
  \*===============================*/
1224
1236
  _initialize() {
1225
- const e = new it(this);
1237
+ const e = new ut(this);
1226
1238
  let s;
1227
1239
  try {
1228
1240
  s = this.fn.call(e, this.props, e);
@@ -1230,27 +1242,27 @@ const ie = class ie {
1230
1242
  throw n instanceof Error && this.logger.crash(n), n;
1231
1243
  }
1232
1244
  if (s !== null) if (s instanceof Node)
1233
- this.element = q(C(this.elementContext, x("$node", { value: s })));
1234
- else if (y(s))
1235
- this.element = q(
1236
- C(this.elementContext, x("$dynamic", { source: s }))
1245
+ this.element = B($(this.elementContext, x("$node", { value: s })));
1246
+ else if (v(s))
1247
+ this.element = B(
1248
+ $(this.elementContext, x("$dynamic", { source: s }))
1237
1249
  );
1238
- else if (z(s) || J(z, s))
1239
- this.element = q(C(this.elementContext, s));
1250
+ else if (F(s) || Y(F, s))
1251
+ this.element = B($(this.elementContext, s));
1240
1252
  else {
1241
1253
  const n = new TypeError(
1242
- `Expected '${this.fn.name}' function to return a DOM node, Markup element, Readable or null. Got: ${D(s)}`
1254
+ `Expected '${this.fn.name}' function to return a DOM node, Markup element, Readable or null. Got: ${T(s)}`
1243
1255
  );
1244
1256
  this.logger.crash(n);
1245
1257
  }
1246
1258
  }
1247
1259
  };
1248
- let R = ie;
1249
- var pe;
1250
- pe = E;
1251
- class rt {
1260
+ let z = oe;
1261
+ var ge;
1262
+ ge = S;
1263
+ class ct {
1252
1264
  constructor({ elementContext: e, items: s, renderFn: n, keyFn: i }) {
1253
- c(this, pe, !0);
1265
+ c(this, ge, !0);
1254
1266
  c(this, "domNode", document.createTextNode(""));
1255
1267
  c(this, "items");
1256
1268
  c(this, "unsubscribe", null);
@@ -1264,9 +1276,9 @@ class rt {
1264
1276
  return this.domNode.parentNode != null;
1265
1277
  }
1266
1278
  mount(e, s) {
1267
- this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = v(() => {
1279
+ this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
1268
1280
  let n = this.items.get();
1269
- n == null && (n = [], console.log("list received empty value", n, this)), G(() => {
1281
+ n == null && (n = [], console.log("list received empty value", n, this)), Z(() => {
1270
1282
  this._update(Array.from(n));
1271
1283
  });
1272
1284
  }));
@@ -1300,13 +1312,13 @@ class rt {
1300
1312
  if (u)
1301
1313
  u.item.set(r.value), u.index.set(r.index), i[r.index] = u;
1302
1314
  else {
1303
- const l = X(r.value), d = X(r.index);
1315
+ const l = Q(r.value), d = Q(r.index);
1304
1316
  i[r.index] = {
1305
1317
  key: r.key,
1306
1318
  item: l,
1307
1319
  index: d,
1308
- element: new R(this.elementContext, ot, {
1309
- item: se(() => l.get()),
1320
+ element: new z(this.elementContext, ft, {
1321
+ item: ie(() => l.get()),
1310
1322
  index: d,
1311
1323
  renderFn: this.renderFn
1312
1324
  })
@@ -1322,14 +1334,14 @@ class rt {
1322
1334
  (m = this.domNode.parentNode) == null || m.insertBefore(this.domNode, o.nextSibling);
1323
1335
  }
1324
1336
  }
1325
- function ot(t, e) {
1337
+ function ft(t, e) {
1326
1338
  return e.name = "@ListItem", t.renderFn.call(e, t.item, t.index, e);
1327
1339
  }
1328
- var me;
1329
- me = E;
1330
- class Ae {
1340
+ var ye;
1341
+ ye = S;
1342
+ class $e {
1331
1343
  constructor(e) {
1332
- c(this, me, !0);
1344
+ c(this, ye, !0);
1333
1345
  c(this, "domNode", document.createTextNode(""));
1334
1346
  c(this, "isMounted", !1);
1335
1347
  c(this, "source");
@@ -1338,9 +1350,9 @@ class Ae {
1338
1350
  this.source = e;
1339
1351
  }
1340
1352
  mount(e, s) {
1341
- this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), y(this.source) ? this.unsubscribe = v(() => {
1353
+ this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), v(this.source) ? this.unsubscribe = w(() => {
1342
1354
  const n = I(this.source);
1343
- G(() => {
1355
+ Z(() => {
1344
1356
  this.update(n);
1345
1357
  });
1346
1358
  }) : this.update(this.elements));
@@ -1364,11 +1376,11 @@ class Ae {
1364
1376
  }
1365
1377
  }
1366
1378
  }
1367
- var ge;
1368
- ge = E;
1369
- class ut {
1379
+ var ve;
1380
+ ve = S;
1381
+ class lt {
1370
1382
  constructor(e) {
1371
- c(this, ge, !0);
1383
+ c(this, ve, !0);
1372
1384
  c(this, "config");
1373
1385
  c(this, "element");
1374
1386
  this.config = e;
@@ -1378,18 +1390,18 @@ class ut {
1378
1390
  }
1379
1391
  mount(e, s) {
1380
1392
  const { content: n, parent: i } = this.config;
1381
- De(n) ? this.element = n : this.element = q(C(this.config.elementContext, ne(n))), this.element.mount(i);
1393
+ Pe(n) ? this.element = n : this.element = B($(this.config.elementContext, re(n))), this.element.mount(i);
1382
1394
  }
1383
1395
  unmount(e = !1) {
1384
1396
  var s;
1385
1397
  (s = this.element) != null && s.isMounted && this.element.unmount(!1);
1386
1398
  }
1387
1399
  }
1388
- var ye;
1389
- ye = E;
1390
- class ct {
1400
+ var we;
1401
+ we = S;
1402
+ class at {
1391
1403
  constructor(e) {
1392
- c(this, ye, !0);
1404
+ c(this, we, !0);
1393
1405
  c(this, "domNode", document.createTextNode(""));
1394
1406
  c(this, "isMounted", !1);
1395
1407
  c(this, "view");
@@ -1398,9 +1410,9 @@ class ct {
1398
1410
  this.view = e;
1399
1411
  }
1400
1412
  mount(e, s) {
1401
- this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = v(() => {
1413
+ this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
1402
1414
  const n = this.view.get();
1403
- G(() => {
1415
+ Z(() => {
1404
1416
  this.update(n);
1405
1417
  });
1406
1418
  }));
@@ -1415,19 +1427,19 @@ class ct {
1415
1427
  this.cleanup(!1), e && (e.mount(this.domNode.parentElement, this.domNode), this.mountedView = e);
1416
1428
  }
1417
1429
  }
1418
- function z(t) {
1419
- return t instanceof Pe;
1430
+ function F(t) {
1431
+ return t instanceof Oe;
1420
1432
  }
1421
- function De(t) {
1422
- return (t == null ? void 0 : t[E]) === !0;
1433
+ function Pe(t) {
1434
+ return (t == null ? void 0 : t[S]) === !0;
1423
1435
  }
1424
- function ne(t) {
1425
- return _(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => z(e) ? e : e instanceof Node ? x("$node", { value: e }) : y(e) ? x("$dynamic", { source: e }) : x("$text", { value: e }));
1436
+ function re(t) {
1437
+ return U(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => F(e) ? e : e instanceof Node ? x("$node", { value: e }) : v(e) ? x("$dynamic", { source: e }) : x("$text", { value: e }));
1426
1438
  }
1427
1439
  function x(t, e, ...s) {
1428
- return new Pe(t, e, ...s);
1440
+ return new Oe(t, e, ...s);
1429
1441
  }
1430
- class Pe {
1442
+ class Oe {
1431
1443
  constructor(e, s, ...n) {
1432
1444
  c(this, "type");
1433
1445
  c(this, "props");
@@ -1435,37 +1447,43 @@ class Pe {
1435
1447
  this.type = e, this.props = s, this.children = n;
1436
1448
  }
1437
1449
  }
1438
- function Tt(t, e, s) {
1450
+ function Ie(t, e, s) {
1439
1451
  return x("$dynamic", {
1440
- source: se(() => {
1452
+ source: ie(() => {
1441
1453
  const n = I(t);
1442
1454
  return n && e ? e : !n && s ? s : null;
1443
1455
  })
1444
1456
  });
1445
1457
  }
1446
- function Lt(t, e, s) {
1447
- return x("$list", { items: se(() => t), keyFn: e, renderFn: s });
1458
+ function At(t, e, s) {
1459
+ return Ie(t, e, s);
1460
+ }
1461
+ function Dt(t, e, s) {
1462
+ return Ie(t, s, e);
1463
+ }
1464
+ function $t(t, e, s) {
1465
+ return x("$list", { items: ie(() => t), keyFn: e, renderFn: s });
1448
1466
  }
1449
- function Ct(t, e) {
1467
+ function Pt(t, e) {
1450
1468
  return x("$portal", { parent: t, content: e });
1451
1469
  }
1452
- function C(t, e) {
1453
- return (_(e) ? e : [e]).map((n) => {
1454
- if (S(n.type))
1455
- return new R(t, n.type, n.props, n.children);
1470
+ function $(t, e) {
1471
+ return (U(e) ? e : [e]).map((n) => {
1472
+ if (k(n.type))
1473
+ return new z(t, n.type, n.props, n.children);
1456
1474
  if (O(n.type))
1457
1475
  switch (n.type) {
1458
1476
  case "$node": {
1459
1477
  const i = n.props;
1460
- return new ce(i.value);
1478
+ return new le(i.value);
1461
1479
  }
1462
1480
  case "$text": {
1463
1481
  const i = n.props;
1464
- return new ce(document.createTextNode(String(i.value)));
1482
+ return new le(document.createTextNode(String(i.value)));
1465
1483
  }
1466
1484
  case "$list": {
1467
1485
  const i = n.props;
1468
- return new rt({
1486
+ return new ct({
1469
1487
  items: i.items,
1470
1488
  keyFn: i.keyFn,
1471
1489
  renderFn: i.renderFn,
@@ -1474,22 +1492,22 @@ function C(t, e) {
1474
1492
  }
1475
1493
  case "$dynamic": {
1476
1494
  const i = n.props;
1477
- return new Qe({
1495
+ return new tt({
1478
1496
  source: i.source,
1479
1497
  elementContext: t
1480
1498
  });
1481
1499
  }
1482
1500
  case "$fragment": {
1483
1501
  const i = n.props;
1484
- return new Ae(i.children);
1502
+ return new $e(i.children);
1485
1503
  }
1486
1504
  case "$outlet": {
1487
1505
  const i = n.props;
1488
- return new ct(i.view);
1506
+ return new at(i.view);
1489
1507
  }
1490
1508
  case "$portal": {
1491
1509
  const i = n.props;
1492
- return new ut({
1510
+ return new lt({
1493
1511
  content: i.content,
1494
1512
  parent: i.parent,
1495
1513
  elementContext: t
@@ -1498,7 +1516,7 @@ function C(t, e) {
1498
1516
  default:
1499
1517
  if (n.type.startsWith("$"))
1500
1518
  throw new Error(`Unknown markup type: ${n.type}`);
1501
- return new et({
1519
+ return new nt({
1502
1520
  tag: n.type,
1503
1521
  props: n.props ?? {},
1504
1522
  children: n.children,
@@ -1509,44 +1527,46 @@ function C(t, e) {
1509
1527
  throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
1510
1528
  });
1511
1529
  }
1512
- function q(t) {
1513
- return t.length === 1 ? t[0] : new Ae(t);
1530
+ function B(t) {
1531
+ return t.length === 1 ? t[0] : new $e(t);
1514
1532
  }
1515
- function Oe(t) {
1516
- return t == null || t === !1 || O(t) || Ue(t) || z(t) || y(t) || J(Oe, t);
1533
+ function Ve(t) {
1534
+ return t == null || t === !1 || O(t) || ze(t) || F(t) || v(t) || Y(Ve, t);
1517
1535
  }
1518
1536
  export {
1519
- Nt as A,
1520
- Lt as B,
1521
- Ct as C,
1522
- St as I,
1523
- nt as S,
1524
- R as V,
1525
- pt as a,
1526
- mt as b,
1527
- X as c,
1528
- se as d,
1529
- yt as e,
1537
+ Et as A,
1538
+ $t as B,
1539
+ Pt as C,
1540
+ Dt as D,
1541
+ At as E,
1542
+ Lt as I,
1543
+ ot as S,
1544
+ z as V,
1545
+ yt as a,
1546
+ vt as b,
1547
+ Q as c,
1548
+ ie as d,
1549
+ bt as e,
1530
1550
  O as f,
1531
- Q as g,
1532
- K as h,
1533
- S as i,
1551
+ ee as g,
1552
+ J as h,
1553
+ k as i,
1534
1554
  I as j,
1535
- Tt as k,
1536
- Mt as l,
1555
+ Ie as k,
1556
+ Tt as l,
1537
1557
  x as m,
1538
- U as n,
1539
- gt as o,
1540
- q as p,
1541
- C as q,
1542
- bt as r,
1543
- xt as s,
1544
- D as t,
1545
- Et as u,
1546
- v,
1547
- wt as w,
1548
- vt as x,
1549
- Xe as y,
1550
- G as z
1558
+ R as n,
1559
+ wt as o,
1560
+ B as p,
1561
+ $ as q,
1562
+ St as r,
1563
+ Mt as s,
1564
+ T as t,
1565
+ kt as u,
1566
+ w as v,
1567
+ xt as w,
1568
+ Nt as x,
1569
+ Ye as y,
1570
+ Z as z
1551
1571
  };
1552
- //# sourceMappingURL=markup-DZcvFR50.js.map
1572
+ //# sourceMappingURL=markup-BJffA2Ls.js.map