@manyducks.co/dolla 2.0.0-alpha.17 → 2.0.0-alpha.19

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,11 +1,11 @@
1
- var pe = Object.defineProperty;
2
- var me = (n, e, t) => e in n ? pe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var r = (n, e, t) => me(n, typeof e != "symbol" ? e + "" : e, t);
4
- function ge(n) {
1
+ var me = Object.defineProperty;
2
+ var ge = (n, e, t) => e in n ? me(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var r = (n, e, t) => ge(n, typeof e != "symbol" ? e + "" : e, t);
4
+ function we(n) {
5
5
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
6
6
  }
7
- var T = { exports: {} }, Z;
8
- function we() {
7
+ var O = { exports: {} }, Z;
8
+ function ye() {
9
9
  return Z || (Z = 1, function(n, e) {
10
10
  Object.defineProperty(e, "__esModule", { value: !0 });
11
11
  var t = /* @__PURE__ */ function() {
@@ -49,14 +49,14 @@ function we() {
49
49
  return c * h.charCodeAt(0) * d + 1;
50
50
  }, 1);
51
51
  }, a = function(l) {
52
- var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), fe = s(Y);
53
- return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y : fe;
52
+ var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), pe = s(Y);
53
+ return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y : pe;
54
54
  };
55
55
  e.default = a, n.exports = e.default;
56
- }(T, T.exports)), T.exports;
56
+ }(O, O.exports)), O.exports;
57
57
  }
58
- var ye = we();
59
- const Ce = /* @__PURE__ */ ge(ye);
58
+ var Ce = ye();
59
+ const be = /* @__PURE__ */ we(Ce);
60
60
  function G(n) {
61
61
  if (n === void 0)
62
62
  return "undefined";
@@ -67,9 +67,9 @@ function G(n) {
67
67
  case "number":
68
68
  return isNaN(n) ? "NaN" : "number";
69
69
  case "function":
70
- return ie(n) ? "class" : e;
70
+ return oe(n) ? "class" : e;
71
71
  case "object":
72
- return M(n) ? "array" : _e(n) ? "promise" : e;
72
+ return M(n) ? "array" : ve(n) ? "promise" : e;
73
73
  default:
74
74
  return e;
75
75
  }
@@ -77,11 +77,11 @@ function G(n) {
77
77
  function M(n) {
78
78
  return Array.isArray(n);
79
79
  }
80
- function se(...n) {
80
+ function ie(...n) {
81
81
  const e = n[0], t = (s) => M(s) && s.every((i) => e(i));
82
82
  return n.length < 2 ? t : t(n[1]);
83
83
  }
84
- function De(...n) {
84
+ function He(...n) {
85
85
  const e = n[0], t = $(n[2]) ? n[2] : "Expected an array of valid items. Got type: %t, value: %v", s = (i) => {
86
86
  if (M(i) && i.every((o) => e(o)))
87
87
  return !0;
@@ -92,26 +92,26 @@ function De(...n) {
92
92
  function $(n) {
93
93
  return typeof n == "string";
94
94
  }
95
- function He(n, e) {
95
+ function ze(n, e) {
96
96
  if ($(n))
97
97
  return !0;
98
98
  throw new TypeError(j(n, e ?? "Expected a string. Got type: %t, value: %v"));
99
99
  }
100
100
  function x(n) {
101
- return typeof n == "function" && !ie(n);
101
+ return typeof n == "function" && !oe(n);
102
102
  }
103
- function be(n) {
103
+ function _e(n) {
104
104
  return typeof n == "number" && !isNaN(n);
105
105
  }
106
- function _e(n) {
106
+ function ve(n) {
107
107
  if (n == null) return !1;
108
108
  const e = n;
109
109
  return e instanceof Promise || x(e.then) && x(e.catch) && x(e.finally);
110
110
  }
111
- function ie(n) {
111
+ function oe(n) {
112
112
  return typeof n == "function" && /^\s*class\s+/.test(n.toString());
113
113
  }
114
- function ze(...n) {
114
+ function Ye(...n) {
115
115
  const e = n[0], t = $(n[2]) ? n[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, s = (i) => {
116
116
  if (i instanceof e)
117
117
  return !0;
@@ -119,7 +119,7 @@ function ze(...n) {
119
119
  };
120
120
  return n.length < 2 ? s : s(n[1]);
121
121
  }
122
- function U(n) {
122
+ function W(n) {
123
123
  return n != null && typeof n == "object" && !M(n);
124
124
  }
125
125
  function j(n, e) {
@@ -127,9 +127,9 @@ function j(n, e) {
127
127
  const t = G(n), s = ((i = n == null ? void 0 : n.toString) == null ? void 0 : i.call(n)) || String(n);
128
128
  return e.replaceAll("%t", t).replaceAll("%v", s);
129
129
  }
130
- const ve = () => {
130
+ const ke = () => {
131
131
  };
132
- function ke(n, e) {
132
+ function Se(n, e) {
133
133
  const t = (s) => {
134
134
  const i = {};
135
135
  for (const o in s)
@@ -138,20 +138,20 @@ function ke(n, e) {
138
138
  };
139
139
  return e == null ? t : t(e);
140
140
  }
141
- function Ye() {
141
+ function Ze() {
142
142
  if (typeof window < "u" && window.console)
143
143
  return window.console;
144
144
  if (typeof global < "u" && global.console)
145
145
  return global.console;
146
146
  }
147
- function Se(n) {
148
- return Ce({
147
+ function xe(n) {
148
+ return be({
149
149
  str: n,
150
150
  sat: { min: 0.35, max: 0.55 },
151
151
  light: { min: 0.6, max: 0.6 }
152
152
  });
153
153
  }
154
- function Ze(n) {
154
+ function Je(n) {
155
155
  if (n instanceof RegExp)
156
156
  return (s) => n.test(s);
157
157
  const e = {
@@ -173,7 +173,7 @@ function Ze(n) {
173
173
  return !(o.some((u) => u(s)) || i.length > 0 && !i.some((u) => u(s)));
174
174
  };
175
175
  }
176
- const O = {
176
+ const P = {
177
177
  watcherCount: 0,
178
178
  increment() {
179
179
  this.watcherCount++, this._log();
@@ -188,7 +188,7 @@ const O = {
188
188
  console.log(
189
189
  `%c[DOLLA_DEV_DEBUG] %c${this._label}%c%c%c`,
190
190
  "color:#e44c4c;font-weight:bold",
191
- `color:${Se(this._label)};font-weight:bold`,
191
+ `color:${xe(this._label)};font-weight:bold`,
192
192
  "color:#777",
193
193
  "color:#aaa",
194
194
  "color:#777",
@@ -196,26 +196,26 @@ const O = {
196
196
  ), this._timeout = null;
197
197
  }, 200));
198
198
  }
199
- }, W = Symbol("State"), B = Symbol("SettableState"), oe = Symbol("Ref");
199
+ }, T = Symbol("State"), B = Symbol("SettableState"), re = Symbol("Ref");
200
200
  function p(n) {
201
- return (n == null ? void 0 : n[W]) === !0;
201
+ return (n == null ? void 0 : n[T]) === !0;
202
202
  }
203
203
  function R(n) {
204
204
  return (n == null ? void 0 : n[B]) === !0;
205
205
  }
206
- function re(n) {
207
- return (n == null ? void 0 : n[oe]) === !0;
206
+ function ue(n) {
207
+ return (n == null ? void 0 : n[re]) === !0;
208
208
  }
209
- function xe(n) {
209
+ function Ee(n) {
210
210
  return p(n) ? n.get() : n;
211
211
  }
212
212
  function F(n) {
213
- return R(n) ? new P(n) : p(n) ? n : new P({
213
+ return R(n) ? new U(n) : p(n) ? n : new U({
214
214
  get() {
215
215
  return n;
216
216
  },
217
217
  watch(e, t = {}) {
218
- return t != null && t.lazy || e(n), ve;
218
+ return t != null && t.lazy || e(n), ke;
219
219
  }
220
220
  });
221
221
  }
@@ -244,15 +244,15 @@ class A {
244
244
  }
245
245
  }
246
246
  watch(e, t) {
247
- return this.watchers.push(e), t != null && t.lazy || e(this.value), O.increment(), () => {
247
+ return this.watchers.push(e), t != null && t.lazy || e(this.value), P.increment(), () => {
248
248
  const s = this.watchers.indexOf(e);
249
- s > -1 && this.watchers.splice(s, 1), O.decrement();
249
+ s > -1 && this.watchers.splice(s, 1), P.decrement();
250
250
  };
251
251
  }
252
252
  }
253
253
  var X;
254
- X = W;
255
- class P {
254
+ X = T;
255
+ class U {
256
256
  constructor(e) {
257
257
  // Instances will pass isState() with this symbol
258
258
  r(this, X, !0);
@@ -270,11 +270,11 @@ class P {
270
270
  }
271
271
  function I(n, e) {
272
272
  const t = new A(n, e);
273
- return [new P(t), (i) => t.set(i)];
273
+ return [new U(t), (i) => t.set(i)];
274
274
  }
275
275
  var ee, te;
276
- te = W, ee = B;
277
- class Ee {
276
+ te = T, ee = B;
277
+ class $e {
278
278
  constructor(e) {
279
279
  // Instances will pass isState() and isSettableState() with these symbols
280
280
  r(this, te, !0);
@@ -294,19 +294,19 @@ class Ee {
294
294
  return this.__value.watch(e, t);
295
295
  }
296
296
  }
297
- function Je(n, e) {
298
- return new Ee(new A(n, e));
299
- }
300
297
  function Qe(n, e) {
298
+ return new $e(new A(n, e));
299
+ }
300
+ function Xe(n, e) {
301
301
  return {
302
- [W]: !0,
302
+ [T]: !0,
303
303
  [B]: !0,
304
304
  get: n.get.bind(n),
305
305
  watch: n.watch.bind(n),
306
306
  set: e
307
307
  };
308
308
  }
309
- function Xe(n, e) {
309
+ function et(n, e) {
310
310
  return function(s) {
311
311
  const i = n.get();
312
312
  let o;
@@ -314,7 +314,7 @@ function Xe(n, e) {
314
314
  };
315
315
  }
316
316
  const J = Symbol("EMPTY");
317
- class $e {
317
+ class Ne {
318
318
  constructor(e, t, s) {
319
319
  r(this, "equals", A.defaultEquals);
320
320
  /**
@@ -364,8 +364,8 @@ class $e {
364
364
  watch(e, t) {
365
365
  this.isWatchingSources || this.startWatchingSources();
366
366
  const s = this.watchers;
367
- return s.push(e), t != null && t.lazy || e(this.rawValue), O.increment(), () => {
368
- s.splice(s.indexOf(e), 1), this.isWatchingSources && s.length === 0 && this.stopWatchingSources(), O.decrement();
367
+ return s.push(e), t != null && t.lazy || e(this.rawValue), P.increment(), () => {
368
+ s.splice(s.indexOf(e), 1), this.isWatchingSources && s.length === 0 && this.stopWatchingSources(), P.decrement();
369
369
  };
370
370
  }
371
371
  /*==========================*\
@@ -386,7 +386,7 @@ class $e {
386
386
  return this.isWatchingSources || this.update(), this.rawValue;
387
387
  }
388
388
  setValue(e) {
389
- this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = e, this.rawValue = xe(e), this.isWatchingSources && p(e) ? this.stopWatchingCurrentValue = e.watch((t) => {
389
+ this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = e, this.rawValue = Ee(e), this.isWatchingSources && p(e) ? this.stopWatchingCurrentValue = e.watch((t) => {
390
390
  this.rawValue = t, this.notify(t);
391
391
  }) : this.notify(this.rawValue);
392
392
  }
@@ -407,15 +407,16 @@ class $e {
407
407
  this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
408
408
  }
409
409
  }
410
- function Ne(n, e, t) {
411
- const s = new $e(n, e, t);
412
- return new P(s);
410
+ function Me(n, e, t) {
411
+ const s = new Ne(n, e, t);
412
+ return new U(s);
413
413
  }
414
- var ne;
415
- ne = oe;
416
- class Me {
414
+ var ne, se;
415
+ se = re, ne = T;
416
+ class Ae {
417
417
  constructor(e) {
418
- // Instances will pass isRef() with this symbol
418
+ // Instances will pass isRef() and isState() with these symbols
419
+ r(this, se, !0);
419
420
  r(this, ne, !0);
420
421
  r(this, "__value");
421
422
  this.__value = e;
@@ -433,8 +434,8 @@ class Me {
433
434
  this.__value.set(e);
434
435
  }
435
436
  }
436
- function et() {
437
- return new Me(new A(void 0));
437
+ function tt() {
438
+ return new Ae(new A(void 0));
438
439
  }
439
440
  function K() {
440
441
  const n = [];
@@ -444,7 +445,7 @@ function K() {
444
445
  throw new TypeError("Expected at least one state to watch.");
445
446
  e = e.map(F);
446
447
  let s;
447
- return e.length > 1 ? s = Ne(e, t).watch(() => null) : s = e[0].watch(t), n.push(s), () => {
448
+ return e.length > 1 ? s = Me(e, t).watch(() => null) : s = e[0].watch(t), n.push(s), () => {
448
449
  let i = n.indexOf(s);
449
450
  i > -1 && n.splice(i, 1), s();
450
451
  };
@@ -455,7 +456,7 @@ function K() {
455
456
  }
456
457
  };
457
458
  }
458
- function Ae(n) {
459
+ function Ve(n) {
459
460
  for (var e, t, s = arguments, i = 1, o = "", u = "", a = [0], l = function(d) {
460
461
  i === 1 && (d || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ? s[d] : o) : i === 3 && (d || o) ? (a[1] = d ? s[d] : o, i = 2) : i === 2 && o === "..." && d ? a[2] = Object.assign(a[2] || {}, s[d]) : i === 2 && o && !d ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[t] = d ? o ? o + s[d] : s[d] : o, i = 6) : (d || o) && (a[2][t] += d ? o + s[d] : o)), o = "";
461
462
  }, c = 0; c < n.length; c++) {
@@ -465,7 +466,7 @@ function Ae(n) {
465
466
  }
466
467
  return l(), a.length > 2 ? a.slice(1) : a[1];
467
468
  }
468
- class Ve {
469
+ class Te {
469
470
  constructor(e) {
470
471
  r(this, "node");
471
472
  r(this, "endNode");
@@ -508,33 +509,33 @@ class Ve {
508
509
  }
509
510
  }
510
511
  }
511
- const Te = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
512
- let ue = (n = 21) => {
512
+ const Oe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
513
+ let ae = (n = 21) => {
513
514
  let e = "", t = crypto.getRandomValues(new Uint8Array(n |= 0));
514
515
  for (; n--; )
515
- e += Te[t[n] & 63];
516
+ e += Oe[t[n] & 63];
516
517
  return e;
517
518
  };
518
- const Oe = (n) => /^on[A-Z]/.test(n);
519
- class Pe {
519
+ const Pe = (n) => /^on[A-Z]/.test(n);
520
+ class Ue {
520
521
  constructor({ tag: e, props: t, children: s, elementContext: i }) {
521
522
  r(this, "node");
522
523
  r(this, "props");
523
524
  r(this, "children");
524
525
  r(this, "stopCallbacks", []);
525
526
  r(this, "elementContext");
526
- r(this, "uniqueId", ue());
527
+ r(this, "uniqueId", ae());
527
528
  // Track the ref so we can nullify it on unmount.
528
529
  r(this, "ref");
529
530
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
530
531
  r(this, "canClickAway", !1);
531
532
  if (i = { ...i }, e.toLowerCase() === "svg" && (i.isSVG = !0), i.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), i.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), t.ref)
532
- if (re(t.ref))
533
+ if (ue(t.ref))
533
534
  this.ref = t.ref;
534
535
  else
535
536
  throw new Error("Expected ref to be a Ref object. Got: " + t.ref);
536
537
  this.props = {
537
- ...ke(["ref", "class", "className"], t),
538
+ ...Se(["ref", "class", "className"], t),
538
539
  class: t.className ?? t.class
539
540
  }, this.children = s ? C(i, s) : [], this.elementContext = i;
540
541
  }
@@ -570,11 +571,11 @@ class Pe {
570
571
  attachProp(e, t, s) {
571
572
  p(e) ? this.stopCallbacks.push(
572
573
  e.watch((i) => {
573
- this.elementContext.root.render.update(() => {
574
+ this.elementContext.root.render.write(() => {
574
575
  t(i);
575
576
  }, s);
576
577
  })
577
- ) : this.elementContext.root.render.update(() => {
578
+ ) : this.elementContext.root.render.write(() => {
578
579
  t(e);
579
580
  }, s);
580
581
  }
@@ -617,13 +618,13 @@ class Pe {
617
618
  this.getUpdateKey("attr", "value")
618
619
  );
619
620
  const o = (u) => {
620
- const a = Ue(i.get(), u.currentTarget.value);
621
+ const a = We(i.get(), u.currentTarget.value);
621
622
  i.set(a);
622
623
  };
623
624
  e.addEventListener("input", o), this.stopCallbacks.push(() => {
624
625
  e.removeEventListener("input", o);
625
626
  });
626
- } else if (Oe(s)) {
627
+ } else if (Pe(s)) {
627
628
  const o = s.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
628
629
  e.addEventListener(o, u), this.stopCallbacks.push(() => {
629
630
  e.removeEventListener(o, u);
@@ -636,7 +637,7 @@ class Pe {
636
637
  },
637
638
  this.getUpdateKey("attr", s)
638
639
  );
639
- else if (!We.includes(s))
640
+ else if (!Fe.includes(s))
640
641
  if (this.elementContext.isSVG)
641
642
  this.attachProp(
642
643
  i,
@@ -719,7 +720,7 @@ class Pe {
719
720
  if (p(t)) {
720
721
  let o;
721
722
  const u = t.watch((a) => {
722
- this.elementContext.root.render.update(
723
+ this.elementContext.root.render.write(
723
724
  () => {
724
725
  x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a, s);
725
726
  },
@@ -728,12 +729,12 @@ class Pe {
728
729
  });
729
730
  s.push(u), i.push(u);
730
731
  } else {
731
- const o = le(t);
732
+ const o = ce(t);
732
733
  for (const u in o) {
733
734
  const { value: a, priority: l } = o[u];
734
735
  if (p(a)) {
735
736
  const c = a.watch((h) => {
736
- this.elementContext.root.render.update(() => {
737
+ this.elementContext.root.render.write(() => {
737
738
  h ? e.style.setProperty(u, String(h), l) : e.style.removeProperty(u);
738
739
  });
739
740
  });
@@ -751,7 +752,7 @@ class Pe {
751
752
  if (p(t)) {
752
753
  let o;
753
754
  const u = t.watch((a) => {
754
- this.elementContext.root.render.update(
755
+ this.elementContext.root.render.write(
755
756
  () => {
756
757
  x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a, s);
757
758
  },
@@ -760,12 +761,12 @@ class Pe {
760
761
  });
761
762
  s.push(u), i.push(u);
762
763
  } else {
763
- const o = ae(t);
764
+ const o = le(t);
764
765
  for (const u in o) {
765
766
  const a = o[u];
766
767
  if (p(a)) {
767
768
  const l = a.watch((c) => {
768
- this.elementContext.root.render.update(() => {
769
+ this.elementContext.root.render.write(() => {
769
770
  c ? e.classList.add(u) : e.classList.remove(u);
770
771
  });
771
772
  });
@@ -779,18 +780,18 @@ class Pe {
779
780
  };
780
781
  }
781
782
  }
782
- function ae(n) {
783
+ function le(n) {
783
784
  let e = {};
784
785
  if ($(n)) {
785
786
  const t = n.split(" ");
786
787
  for (const s of t)
787
788
  e[s] = !0;
788
- } else U(n) ? Object.assign(e, n) : Array.isArray(n) && Array.from(n).filter(Boolean).forEach((t) => {
789
- Object.assign(e, ae(t));
789
+ } else W(n) ? Object.assign(e, n) : Array.isArray(n) && Array.from(n).filter(Boolean).forEach((t) => {
790
+ Object.assign(e, le(t));
790
791
  });
791
792
  return delete e.undefined, e;
792
793
  }
793
- function le(n) {
794
+ function ce(n) {
794
795
  let e = {};
795
796
  if ($(n)) {
796
797
  const t = n.split(";").filter((s) => s.trim() !== "");
@@ -801,23 +802,23 @@ function le(n) {
801
802
  o.includes("!important") ? (u.priority = "important", u.value = o.replace("!important", "").trim()) : u.value = o.trim(), e[Q(i.trim())] = u;
802
803
  }
803
804
  }
804
- if (U(n))
805
+ if (W(n))
805
806
  for (const t in n)
806
807
  t.startsWith("--") ? e[t] = { value: n[t] } : e[Q(t)] = { value: n[t] };
807
808
  else Array.isArray(n) && Array.from(n).filter((t) => t != null).forEach((t) => {
808
- Object.assign(e, le(t));
809
+ Object.assign(e, ce(t));
809
810
  });
810
811
  return e;
811
812
  }
812
813
  function Q(n) {
813
814
  return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
814
815
  }
815
- function Ue(n, e) {
816
+ function We(n, e) {
816
817
  const t = typeof n;
817
818
  return t === "string" ? String(e) : t === "number" ? Number(e) : t === "boolean" ? !!e : e;
818
819
  }
819
- const We = ["ref", "children", "class", "style", "data"];
820
- class Fe {
820
+ const Fe = ["ref", "children", "class", "style", "data"];
821
+ class qe {
821
822
  constructor({ states: e, renderFn: t, elementContext: s }) {
822
823
  r(this, "node");
823
824
  r(this, "endNode");
@@ -832,7 +833,7 @@ class Fe {
832
833
  start: () => {
833
834
  i == null && (i = this.watcher.watch(e, (...o) => {
834
835
  const u = this.renderFn(...o);
835
- if (!de(u))
836
+ if (!fe(u))
836
837
  throw console.error(u), new TypeError(
837
838
  `Observer received invalid value to render. Got type: ${G(u)}, value: ${u}`
838
839
  );
@@ -863,7 +864,7 @@ class Fe {
863
864
  var s, i;
864
865
  if (this.cleanup(), e == null || !this.isMounted)
865
866
  return;
866
- const t = e.map((o) => ce(o) ? o : N(o) ? E(C(this.elementContext, o)) : E(C(this.elementContext, V(o))));
867
+ const t = e.map((o) => he(o) ? o : N(o) ? E(C(this.elementContext, o)) : E(C(this.elementContext, V(o))));
867
868
  for (const o of t) {
868
869
  const u = ((s = this.connectedViews.at(-1)) == null ? void 0 : s.node) || this.node;
869
870
  o.mount(this.node.parentNode, u), this.connectedViews.push(o);
@@ -874,7 +875,7 @@ class Fe {
874
875
  }
875
876
  }
876
877
  }
877
- class qe {
878
+ class Le {
878
879
  constructor(e) {
879
880
  r(this, "node");
880
881
  r(this, "endNode");
@@ -915,7 +916,7 @@ class qe {
915
916
  ));
916
917
  }
917
918
  }
918
- class Le {
919
+ class Ie {
919
920
  constructor(e) {
920
921
  r(this, "config");
921
922
  r(this, "element");
@@ -926,14 +927,14 @@ class Le {
926
927
  }
927
928
  mount(e, t) {
928
929
  const { content: s, parent: i } = this.config;
929
- ce(s) ? this.element = s : N(s) ? this.element = E(C(this.config.elementContext, s)) : this.element = E(C(this.config.elementContext, V(s))), this.element.mount(i);
930
+ he(s) ? this.element = s : N(s) ? this.element = E(C(this.config.elementContext, s)) : this.element = E(C(this.config.elementContext, V(s))), this.element.mount(i);
930
931
  }
931
932
  unmount() {
932
933
  var e;
933
934
  (e = this.element) != null && e.isMounted && this.element.unmount();
934
935
  }
935
936
  }
936
- class Ie {
937
+ class Ge {
937
938
  constructor(e) {
938
939
  r(this, "__view");
939
940
  this.__view = e;
@@ -1003,7 +1004,7 @@ class Ie {
1003
1004
  }
1004
1005
  class q {
1005
1006
  constructor(e, t, s, i = []) {
1006
- r(this, "uniqueId", ue());
1007
+ r(this, "uniqueId", ae());
1007
1008
  r(this, "_elementContext");
1008
1009
  r(this, "_logger");
1009
1010
  r(this, "_view");
@@ -1025,7 +1026,8 @@ class q {
1025
1026
  || "Public" API ||
1026
1027
  \*===============================*/
1027
1028
  get node() {
1028
- return this._element.node;
1029
+ var e;
1030
+ return (e = this._element) == null ? void 0 : e.node;
1029
1031
  }
1030
1032
  mount(e, t) {
1031
1033
  const s = this.isMounted;
@@ -1052,7 +1054,7 @@ class q {
1052
1054
  || Internal ||
1053
1055
  \*===============================*/
1054
1056
  initialize() {
1055
- const e = new Ie(this);
1057
+ const e = new Ge(this);
1056
1058
  let t;
1057
1059
  try {
1058
1060
  t = this._view(this._props, e);
@@ -1061,7 +1063,7 @@ class q {
1061
1063
  }
1062
1064
  if (t !== null) if (t instanceof Node)
1063
1065
  this._element = E(C(this._elementContext, y("$node", { value: t })));
1064
- else if (N(t) || se(N, t))
1066
+ else if (N(t) || ie(N, t))
1065
1067
  this._element = E(C(this._elementContext, t));
1066
1068
  else if (p(t))
1067
1069
  this._element = E(
@@ -1075,7 +1077,7 @@ class q {
1075
1077
  }
1076
1078
  }
1077
1079
  }
1078
- class Ge {
1080
+ class je {
1079
1081
  constructor({ elementContext: e, $items: t, renderFn: s, keyFn: i }) {
1080
1082
  r(this, "node");
1081
1083
  r(this, "endNode");
@@ -1131,7 +1133,7 @@ class Ge {
1131
1133
  setValue: d,
1132
1134
  $index: f,
1133
1135
  setIndex: m,
1134
- element: new q(this.elementContext, je, {
1136
+ element: new q(this.elementContext, Be, {
1135
1137
  $value: h,
1136
1138
  $index: f,
1137
1139
  renderFn: this.renderFn
@@ -1150,10 +1152,10 @@ class Ge {
1150
1152
  }
1151
1153
  }
1152
1154
  }
1153
- function je({ $value: n, $index: e, renderFn: t }, s) {
1155
+ function Be({ $value: n, $index: e, renderFn: t }, s) {
1154
1156
  return t(n, e, s);
1155
1157
  }
1156
- class Be {
1158
+ class Re {
1157
1159
  constructor({ value: e }) {
1158
1160
  r(this, "node", document.createTextNode(""));
1159
1161
  r(this, "value", "");
@@ -1176,20 +1178,20 @@ class Be {
1176
1178
  }
1177
1179
  }
1178
1180
  function N(n) {
1179
- return U(n) && (typeof n.type == "string" || typeof n.type == "function") && Array.isArray(n.children);
1181
+ return W(n) && (typeof n.type == "string" || typeof n.type == "function") && Array.isArray(n.children);
1180
1182
  }
1181
- function ce(n) {
1182
- return U(n) && x(n.connect) && x(n.disconnect);
1183
+ function he(n) {
1184
+ return W(n) && x(n.connect) && x(n.disconnect);
1183
1185
  }
1184
1186
  function V(n) {
1185
1187
  return M(n) || (n = [n]), n.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1186
1188
  if (e instanceof Node)
1187
1189
  return y("$node", { value: e });
1188
- if (e instanceof he)
1190
+ if (e instanceof de)
1189
1191
  return y("$node", { value: e.node });
1190
1192
  if (N(e))
1191
1193
  return e;
1192
- if ($(e) || be(e))
1194
+ if ($(e) || _e(e))
1193
1195
  return y("$text", { value: e });
1194
1196
  if (p(e))
1195
1197
  return y("$observer", {
@@ -1200,14 +1202,14 @@ function V(n) {
1200
1202
  });
1201
1203
  }
1202
1204
  function y(n, e, ...t) {
1203
- return e != null && Re(e), {
1205
+ return e != null && Ke(e), {
1204
1206
  type: n,
1205
1207
  props: e,
1206
1208
  children: V(t)
1207
1209
  };
1208
1210
  }
1209
- function Re(n) {
1210
- if (n.ref && !re(n.ref))
1211
+ function Ke(n) {
1212
+ if (n.ref && !ue(n.ref))
1211
1213
  throw console.warn(n.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${n.ref}`);
1212
1214
  for (const e in n)
1213
1215
  if (e.startsWith("$$") && n[e] !== void 0) {
@@ -1216,8 +1218,8 @@ function Re(n) {
1216
1218
  } else if (e.startsWith("$") && n[e] !== void 0 && !p(n[e]))
1217
1219
  throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${n[e]}`);
1218
1220
  }
1219
- const tt = Ae.bind(y);
1220
- function nt(n, e, t) {
1221
+ const nt = Ve.bind(y);
1222
+ function st(n, e, t) {
1221
1223
  const s = F(n);
1222
1224
  return y("$cond", {
1223
1225
  $predicate: s,
@@ -1225,14 +1227,14 @@ function nt(n, e, t) {
1225
1227
  elseContent: t
1226
1228
  });
1227
1229
  }
1228
- function st(n, e, t) {
1230
+ function it(n, e, t) {
1229
1231
  const s = F(n);
1230
1232
  return y("$repeat", { $items: s, keyFn: e, renderFn: t });
1231
1233
  }
1232
- function it(n, e) {
1234
+ function ot(n, e) {
1233
1235
  return y("$portal", { parent: n, content: e });
1234
1236
  }
1235
- class he {
1237
+ class de {
1236
1238
  constructor(e) {
1237
1239
  r(this, "node");
1238
1240
  this.node = e;
@@ -1255,17 +1257,17 @@ function C(n, e) {
1255
1257
  switch (s.type) {
1256
1258
  case "$node": {
1257
1259
  const i = s.props;
1258
- return new he(i.value);
1260
+ return new de(i.value);
1259
1261
  }
1260
1262
  case "$text": {
1261
1263
  const i = s.props;
1262
- return new Be({
1264
+ return new Re({
1263
1265
  value: i.value
1264
1266
  });
1265
1267
  }
1266
1268
  case "$cond": {
1267
1269
  const i = s.props;
1268
- return new Ve({
1270
+ return new Te({
1269
1271
  $predicate: i.$predicate,
1270
1272
  thenContent: i.thenContent,
1271
1273
  elseContent: i.elseContent,
@@ -1274,7 +1276,7 @@ function C(n, e) {
1274
1276
  }
1275
1277
  case "$repeat": {
1276
1278
  const i = s.props;
1277
- return new Ge({
1279
+ return new je({
1278
1280
  $items: i.$items,
1279
1281
  keyFn: i.keyFn,
1280
1282
  renderFn: i.renderFn,
@@ -1283,7 +1285,7 @@ function C(n, e) {
1283
1285
  }
1284
1286
  case "$observer": {
1285
1287
  const i = s.props;
1286
- return new Fe({
1288
+ return new qe({
1287
1289
  states: i.states,
1288
1290
  renderFn: i.renderFn,
1289
1291
  elementContext: n
@@ -1291,14 +1293,14 @@ function C(n, e) {
1291
1293
  }
1292
1294
  case "$outlet": {
1293
1295
  const i = s.props;
1294
- return new qe({
1296
+ return new Le({
1295
1297
  $children: i.$children,
1296
1298
  elementContext: n
1297
1299
  });
1298
1300
  }
1299
1301
  case "$portal": {
1300
1302
  const i = s.props;
1301
- return new Le({
1303
+ return new Ie({
1302
1304
  content: i.content,
1303
1305
  parent: i.parent,
1304
1306
  elementContext: n
@@ -1307,7 +1309,7 @@ function C(n, e) {
1307
1309
  default:
1308
1310
  if (s.type.startsWith("$"))
1309
1311
  throw new Error(`Unknown markup type: ${s.type}`);
1310
- return new Pe({
1312
+ return new Ue({
1311
1313
  tag: s.type,
1312
1314
  props: s.props ?? {},
1313
1315
  children: s.children,
@@ -1349,43 +1351,43 @@ function E(n) {
1349
1351
  }
1350
1352
  };
1351
1353
  }
1352
- function de(n) {
1353
- return n == null || n === !1 || typeof n == "string" || typeof n == "number" || N(n) || p(n) || se(de, n);
1354
+ function fe(n) {
1355
+ return n == null || n === !1 || typeof n == "string" || typeof n == "number" || N(n) || p(n) || ie(fe, n);
1354
1356
  }
1355
- function ot(n, e) {
1357
+ function rt(n, e) {
1356
1358
  return e.outlet();
1357
1359
  }
1358
1360
  export {
1359
- Xe as A,
1360
- it as B,
1361
- st as C,
1362
- ot as P,
1361
+ et as A,
1362
+ ot as B,
1363
+ it as C,
1364
+ rt as P,
1363
1365
  q as V,
1364
1366
  I as a,
1365
1367
  x as b,
1366
- nt as c,
1367
- Ne as d,
1368
+ st as c,
1369
+ Me as d,
1368
1370
  $ as e,
1369
- He as f,
1370
- ge as g,
1371
- tt as h,
1372
- U as i,
1373
- De as j,
1371
+ ze as f,
1372
+ we as g,
1373
+ nt as h,
1374
+ W as i,
1375
+ He as j,
1374
1376
  K as k,
1375
- Ze as l,
1376
- Je as m,
1377
- Qe as n,
1377
+ Je as l,
1378
+ Qe as m,
1379
+ Xe as n,
1378
1380
  F as o,
1379
- et as p,
1380
- re as q,
1381
- ze as r,
1381
+ tt as p,
1382
+ ue as q,
1383
+ Ye as r,
1382
1384
  y as s,
1383
1385
  G as t,
1384
- Ye as u,
1385
- xe as v,
1386
- ve as w,
1387
- Se as x,
1386
+ Ze as u,
1387
+ Ee as v,
1388
+ ke as w,
1389
+ xe as x,
1388
1390
  E as y,
1389
1391
  C as z
1390
1392
  };
1391
- //# sourceMappingURL=passthrough-J9nMzwTV.js.map
1393
+ //# sourceMappingURL=passthrough-DcOD0Wf3.js.map