@manyducks.co/dolla 2.0.0-alpha.1 → 2.0.0-alpha.2

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,63 +1,63 @@
1
- var ie = Object.defineProperty;
2
- var ce = (t, e, n) => e in t ? ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var d = (t, e, n) => ce(t, typeof e != "symbol" ? e + "" : e, n);
1
+ var ue = Object.defineProperty;
2
+ var ce = (t, e, n) => e in t ? ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var f = (t, e, n) => ce(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  function le(t) {
5
5
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
6
6
  }
7
- var I = { exports: {} }, K;
7
+ var j = { exports: {} }, W;
8
8
  function ae() {
9
- return K || (K = 1, function(t, e) {
9
+ return W || (W = 1, function(t, e) {
10
10
  Object.defineProperty(e, "__esModule", { value: !0 });
11
11
  var n = /* @__PURE__ */ function() {
12
- function c(a, h) {
13
- var g = [], C = !0, b = !1, k = void 0;
12
+ function u(l, d) {
13
+ var h = [], C = !0, w = !1, k = void 0;
14
14
  try {
15
- for (var v, $ = a[Symbol.iterator](); !(C = (v = $.next()).done) && (g.push(v.value), !(h && g.length === h)); C = !0) ;
15
+ for (var $, v = l[Symbol.iterator](); !(C = ($ = v.next()).done) && (h.push($.value), !(d && h.length === d)); C = !0) ;
16
16
  } catch (m) {
17
- b = !0, k = m;
17
+ w = !0, k = m;
18
18
  } finally {
19
19
  try {
20
- !C && $.return && $.return();
20
+ !C && v.return && v.return();
21
21
  } finally {
22
- if (b) throw k;
22
+ if (w) throw k;
23
23
  }
24
24
  }
25
- return g;
25
+ return h;
26
26
  }
27
- return function(a, h) {
28
- if (Array.isArray(a)) return a;
29
- if (Symbol.iterator in Object(a)) return c(a, h);
27
+ return function(l, d) {
28
+ if (Array.isArray(l)) return l;
29
+ if (Symbol.iterator in Object(l)) return u(l, d);
30
30
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
31
31
  };
32
- }(), o = function(c) {
33
- return c.reduce(function(a, h) {
34
- return 16 > h ? a + "0" + h.toString(16) : a + h.toString(16);
32
+ }(), o = function(u) {
33
+ return u.reduce(function(l, d) {
34
+ return 16 > d ? l + "0" + d.toString(16) : l + d.toString(16);
35
35
  }, "#");
36
- }, r = function(c, a, h) {
37
- var g = 0.5 > h ? h * (1 + a) : h + a - h * a, C = 2 * h - g, b = function(m, p, f) {
38
- var u = Math.round, y = 0 > f ? f + 1 : 1 < f ? f - 1 : f;
39
- return y = y < 1 / 6 ? m + 6 * (p - m) * y : y < 1 / 2 ? p : y < 2 / 3 ? m + 6 * (p - m) * (2 / 3 - y) : m, u(255 * y);
40
- }, k = b(C, g, c + 1 / 3), v = b(C, g, c), $ = b(C, g, c - 1 / 3);
41
- return [k, v, $];
42
- }, s = function(c, a, h, g) {
43
- var C = c % 1007 / 1007, b = function(m, p, f) {
44
- return m * (f - p) + p;
45
- }, k = b(C, a.min, a.max), v = b(C, h.min, h.max), $ = b(C, g.max, g.min);
46
- return [k, v, $];
47
- }, i = function(c) {
48
- return c.split("").reduce(function(a, h, g) {
49
- return a * h.charCodeAt(0) * g + 1;
36
+ }, r = function(u, l, d) {
37
+ var h = 0.5 > d ? d * (1 + l) : d + l - d * l, C = 2 * d - h, w = function(m, p, a) {
38
+ var y = Math.round, g = 0 > a ? a + 1 : 1 < a ? a - 1 : a;
39
+ return g = g < 1 / 6 ? m + 6 * (p - m) * g : g < 1 / 2 ? p : g < 2 / 3 ? m + 6 * (p - m) * (2 / 3 - g) : m, y(255 * g);
40
+ }, k = w(C, h, u + 1 / 3), $ = w(C, h, u), v = w(C, h, u - 1 / 3);
41
+ return [k, $, v];
42
+ }, s = function(u, l, d, h) {
43
+ var C = u % 1007 / 1007, w = function(m, p, a) {
44
+ return m * (a - p) + p;
45
+ }, k = w(C, l.min, l.max), $ = w(C, d.min, d.max), v = w(C, h.max, h.min);
46
+ return [k, $, v];
47
+ }, i = function(u) {
48
+ return u.split("").reduce(function(l, d, h) {
49
+ return l * d.charCodeAt(0) * h + 1;
50
50
  }, 1);
51
- }, l = function(c) {
52
- var a = c.str, h = c.hue, g = h === void 0 ? { min: 0, max: 360 } : h, C = c.sat, b = C === void 0 ? { min: 0.35, max: 0.65 } : C, k = c.light, v = k === void 0 ? { min: 0.3, max: 0.7 } : k, $ = c.hashFunction, m = $ === void 0 ? i : $, p = c.scheme, f = p === void 0 ? "hex" : p, u = s(m(a), g, b, v), y = n(u, 3), N = y[0], A = y[1], U = y[2], H = r(N / 360, A, U), se = o(H);
53
- return f === "hsl" ? [N, A, U] : f === "rgb" ? H : se;
51
+ }, c = function(u) {
52
+ var l = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, C = u.sat, w = C === void 0 ? { min: 0.35, max: 0.65 } : C, k = u.light, $ = k === void 0 ? { min: 0.3, max: 0.7 } : k, v = u.hashFunction, m = v === void 0 ? i : v, p = u.scheme, a = p === void 0 ? "hex" : p, y = s(m(l), h, w, $), g = n(y, 3), S = g[0], F = g[1], B = g[2], K = r(S / 360, F, B), ie = o(K);
53
+ return a === "hsl" ? [S, F, B] : a === "rgb" ? K : ie;
54
54
  };
55
- e.default = l, t.exports = e.default;
56
- }(I, I.exports)), I.exports;
55
+ e.default = c, t.exports = e.default;
56
+ }(j, j.exports)), j.exports;
57
57
  }
58
58
  var de = ae();
59
- const ue = /* @__PURE__ */ le(de);
60
- function R(t) {
59
+ const fe = /* @__PURE__ */ le(de);
60
+ function q(t) {
61
61
  if (t === void 0)
62
62
  return "undefined";
63
63
  if (t === null)
@@ -69,38 +69,38 @@ function R(t) {
69
69
  case "function":
70
70
  return Y(t) ? "class" : e;
71
71
  case "object":
72
- return j(t) ? "array" : he(t) ? "promise" : e;
72
+ return P(t) ? "array" : he(t) ? "promise" : e;
73
73
  default:
74
74
  return e;
75
75
  }
76
76
  }
77
- function j(t) {
77
+ function P(t) {
78
78
  return Array.isArray(t);
79
79
  }
80
- function D(...t) {
81
- const e = t[0], n = (o) => j(o) && o.every((r) => e(r));
80
+ function z(...t) {
81
+ const e = t[0], n = (o) => P(o) && o.every((r) => e(r));
82
82
  return t.length < 2 ? n : n(t[1]);
83
83
  }
84
- function Ve(...t) {
85
- const e = t[0], n = O(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
86
- if (j(r) && r.every((s) => e(s)))
84
+ function Oe(...t) {
85
+ const e = t[0], n = A(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
86
+ if (P(r) && r.every((s) => e(s)))
87
87
  return !0;
88
88
  throw new TypeError(_(r, n));
89
89
  };
90
90
  return t.length < 2 ? o : o(t[1]);
91
91
  }
92
- function O(t) {
92
+ function A(t) {
93
93
  return typeof t == "string";
94
94
  }
95
- function Fe(t, e) {
96
- if (O(t))
95
+ function Ve(t, e) {
96
+ if (A(t))
97
97
  return !0;
98
98
  throw new TypeError(_(t, e ?? "Expected a string. Got type: %t, value: %v"));
99
99
  }
100
100
  function E(t) {
101
101
  return typeof t == "function" && !Y(t);
102
102
  }
103
- function z(t) {
103
+ function D(t) {
104
104
  return typeof t == "number" && !isNaN(t);
105
105
  }
106
106
  function he(t) {
@@ -112,37 +112,37 @@ function Y(t) {
112
112
  return typeof t == "function" && /^\s*class\s+/.test(t.toString());
113
113
  }
114
114
  function Pe(...t) {
115
- const e = t[0], n = O(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, o = (r) => {
115
+ const e = t[0], n = A(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, o = (r) => {
116
116
  if (r instanceof e)
117
117
  return !0;
118
118
  throw new TypeError(_(r, n));
119
119
  };
120
120
  return t.length < 2 ? o : o(t[1]);
121
121
  }
122
- function G(t) {
123
- return t != null && typeof t == "object" && !j(t);
122
+ function L(t) {
123
+ return t != null && typeof t == "object" && !P(t);
124
124
  }
125
125
  function _(t, e) {
126
126
  var r;
127
- const n = R(t), o = ((r = t == null ? void 0 : t.toString) == null ? void 0 : r.call(t)) || String(t);
127
+ const n = q(t), o = ((r = t == null ? void 0 : t.toString) == null ? void 0 : r.call(t)) || String(t);
128
128
  return e.replaceAll("%t", n).replaceAll("%v", o);
129
129
  }
130
- const je = () => {
130
+ const Fe = () => {
131
131
  };
132
- function W(t) {
132
+ function H(t) {
133
133
  return t != null && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) === Object.getPrototypeOf({});
134
134
  }
135
- function L(t, e) {
135
+ function I(t, e) {
136
136
  if (t === e)
137
137
  return !0;
138
- if (w(t) || w(e))
138
+ if (b(t) || b(e))
139
139
  return !1;
140
- if (W(t) && W(e)) {
140
+ if (H(t) && H(e)) {
141
141
  const n = Object.keys(t), o = Object.keys(e);
142
142
  if (n.length !== o.length)
143
143
  return !1;
144
144
  for (const r in t)
145
- if (!L(t[r], e[r]))
145
+ if (!I(t[r], e[r]))
146
146
  return !1;
147
147
  return !0;
148
148
  }
@@ -150,13 +150,13 @@ function L(t, e) {
150
150
  if (t.length !== e.length)
151
151
  return !1;
152
152
  for (const n in t)
153
- if (!L(t[n], e[n]))
153
+ if (!I(t[n], e[n]))
154
154
  return !1;
155
155
  return !0;
156
156
  }
157
157
  return t === e;
158
158
  }
159
- function fe(t, e) {
159
+ function pe(t, e) {
160
160
  const n = (o) => {
161
161
  const r = {};
162
162
  for (const s in o)
@@ -171,8 +171,8 @@ function Ue() {
171
171
  if (typeof global < "u" && global.console)
172
172
  return global.console;
173
173
  }
174
- function Me(t) {
175
- return ue({
174
+ function je(t) {
175
+ return fe({
176
176
  str: t,
177
177
  sat: { min: 0.35, max: 0.55 },
178
178
  light: { min: 0.6, max: 0.6 }
@@ -200,20 +200,20 @@ function Ie(t) {
200
200
  return !(s.some((i) => i(o)) || r.length > 0 && !r.some((i) => i(o)));
201
201
  };
202
202
  }
203
- function w(t) {
203
+ function b(t) {
204
204
  return !(t == null || typeof t != "object" || typeof t.get != "function" || typeof t.watch != "function");
205
205
  }
206
206
  function Z(t) {
207
207
  return !(t == null || typeof t != "object" || typeof t.set != "function" || typeof t.get != "function" || typeof t.watch != "function");
208
208
  }
209
- function V(t) {
210
- return w(t) ? t.get() : t;
209
+ function T(t) {
210
+ return b(t) ? t.get() : t;
211
211
  }
212
212
  function J(t) {
213
- return w(t) ? t : B(t);
213
+ return b(t) ? t : R(t);
214
214
  }
215
215
  function Le(t, e) {
216
- const [n, o] = F(t, e);
216
+ const [n, o] = O(t, e);
217
217
  return {
218
218
  get: n.get,
219
219
  watch: n.watch,
@@ -227,14 +227,14 @@ function Ge(t, e) {
227
227
  set: e
228
228
  };
229
229
  }
230
- function pe(t, e) {
230
+ function qe(t, e) {
231
231
  return function(o) {
232
232
  const r = t.get();
233
233
  let s;
234
234
  typeof o == "function" ? s = o(r) : s = o, e(s, r);
235
235
  };
236
236
  }
237
- function B(t) {
237
+ function R(t) {
238
238
  return {
239
239
  get() {
240
240
  return t;
@@ -245,207 +245,210 @@ function B(t) {
245
245
  }
246
246
  };
247
247
  }
248
- function F(t, e) {
248
+ function O(t, e) {
249
249
  let n = t, o = [];
250
250
  function r() {
251
- for (const c of o)
252
- c(n);
251
+ for (const u of o)
252
+ u(n);
253
253
  }
254
- function s(c, a) {
255
- return e != null && e.equality ? e.equality(c, a) : L(c, a);
254
+ function s(u, l) {
255
+ return e != null && e.equality ? e.equality(u, l) : I(u, l);
256
256
  }
257
257
  const i = {
258
258
  get() {
259
- return V(n);
259
+ return T(n);
260
260
  },
261
- watch(c, a) {
262
- return o.push(c), a != null && a.lazy || c(i.get()), function() {
263
- o.splice(o.indexOf(c), 1);
261
+ watch(u, l) {
262
+ return o.push(u), l != null && l.lazy || u(i.get()), function() {
263
+ o.splice(o.indexOf(u), 1);
264
264
  };
265
265
  }
266
- }, l = pe(i, (c, a) => {
267
- s(c, a) || (n = c, r());
268
- });
269
- return [i, l];
266
+ };
267
+ function c(u) {
268
+ let l;
269
+ typeof u == "function" ? l = u(n) : l = u, s(l, n) || (n = l, r());
270
+ }
271
+ return [i, c];
270
272
  }
271
- const ye = Symbol("EMPTY");
272
- function ge(t, e, n) {
273
- t = t.map((p) => w(p) ? p : B(p));
274
- let o = new Array(t.length).fill(ye, 0, t.length), r, s = [], i = !1, l = [], c, a;
275
- function h(p = b()) {
276
- for (const f of s)
277
- f(p);
273
+ const me = Symbol("EMPTY");
274
+ function ye(t, e, n) {
275
+ t = t.map((p) => b(p) ? p : R(p));
276
+ let o = new Array(t.length).fill(me, 0, t.length), r, s = [], i = !1, c = [], u, l;
277
+ function d(p = w()) {
278
+ for (const a of s)
279
+ a(p);
278
280
  }
279
- function g(p, f) {
280
- return n != null && n.equality ? n.equality(p, f) : L(p, f);
281
+ function h(p, a) {
282
+ return n != null && n.equality ? n.equality(p, a) : I(p, a);
281
283
  }
282
284
  function C() {
283
- const p = t.map((f) => f.get());
284
- for (let f = 0; f < t.length; f++)
285
- if (!g(p[f], o[f])) {
285
+ const p = t.map((a) => a.get());
286
+ for (let a = 0; a < t.length; a++)
287
+ if (!h(p[a], o[a])) {
286
288
  k(e(...p)), o = p;
287
289
  break;
288
290
  }
289
291
  }
290
- function b() {
291
- return i || C(), a = V(r), a;
292
+ function w() {
293
+ return i || C(), l = T(r), l;
292
294
  }
293
295
  function k(p) {
294
- p !== r && (c && (c(), c = void 0), r = p, a = V(p), w(p) && i && (c = p.watch((f) => {
295
- const u = V(f);
296
- g(u, a) || (a = u, h(u));
296
+ p !== r && (u && (u(), u = void 0), r = p, l = T(p), b(p) && i && (u = p.watch((a) => {
297
+ const y = T(a);
298
+ h(y, l) || (l = y, d(y));
297
299
  })));
298
300
  }
299
- function v() {
301
+ function $() {
300
302
  let p = [...o];
301
- for (let f = 0; f < t.length; f++) {
302
- const u = t[f];
303
- l.push(
304
- u.watch((y) => {
305
- const N = o[f];
306
- o[f] = y, i && !g(y, N) && (k(e(...o)), h(V(r)));
303
+ for (let a = 0; a < t.length; a++) {
304
+ const y = t[a];
305
+ c.push(
306
+ y.watch((g) => {
307
+ const S = o[a];
308
+ o[a] = g, i && !h(g, S) && (k(e(...o)), d(T(r)));
307
309
  })
308
310
  );
309
311
  }
310
312
  i = !0;
311
- for (let f = 0; f < t.length; f++)
312
- if (!g(o[f], p[f])) {
313
- k(e(...o)), h(V(r));
313
+ for (let a = 0; a < t.length; a++)
314
+ if (!h(o[a], p[a])) {
315
+ k(e(...o)), d(T(r));
314
316
  break;
315
317
  }
316
318
  }
317
- function $() {
318
- for (const p of l)
319
+ function v() {
320
+ for (const p of c)
319
321
  p();
320
- l = [], c && (c(), c = void 0), i = !1;
322
+ c = [], u && (u(), u = void 0), i = !1;
321
323
  }
322
324
  return {
323
325
  get() {
324
- return b();
326
+ return w();
325
327
  },
326
- watch(p, f) {
327
- return i || v(), s.push(p), f != null && f.lazy || p(b()), function() {
328
- s.splice(s.indexOf(p), 1), i && s.length === 0 && $();
328
+ watch(p, a) {
329
+ return i || $(), s.push(p), a != null && a.lazy || p(w()), function() {
330
+ s.splice(s.indexOf(p), 1), i && s.length === 0 && v();
329
331
  };
330
332
  }
331
333
  };
332
334
  }
333
- function q(t, e) {
335
+ function G(t, e) {
334
336
  if (t.length === 0)
335
337
  throw new TypeError("Expected at least one signal.");
336
- if (t.some((n) => !w(n)))
338
+ if (t.some((n) => !b(n)))
337
339
  throw new TypeError("All values must be signals");
338
- return t = t.map((n) => w(n) ? n : B(n)), t.length > 1 ? ge(t, e).watch(() => null) : t[0].watch(e);
340
+ return t = t.map((n) => b(n) ? n : R(n)), t.length > 1 ? ye(t, e).watch(() => null) : t[0].watch(e);
339
341
  }
340
- class me {
342
+ function ge(t) {
343
+ for (var e, n, o = arguments, r = 1, s = "", i = "", c = [0], u = function(h) {
344
+ r === 1 && (h || (s = s.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(h ? o[h] : s) : r === 3 && (h || s) ? (c[1] = h ? o[h] : s, r = 2) : r === 2 && s === "..." && h ? c[2] = Object.assign(c[2] || {}, o[h]) : r === 2 && s && !h ? (c[2] = c[2] || {})[s] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = h ? s ? s + o[h] : o[h] : s, r = 6) : (h || s) && (c[2][n] += h ? s + o[h] : s)), s = "";
345
+ }, l = 0; l < t.length; l++) {
346
+ l && (r === 1 && u(), u(l));
347
+ for (var d = 0; d < t[l].length; d++) e = t[l][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : s += e : r === 4 ? s === "--" && e === ">" ? (r = 1, s = "") : s = e + s[0] : i ? e === i ? i = "" : s += e : e === '"' || e === "'" ? i = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = s, s = "") : e === "/" && (r < 5 || t[l][d + 1] === ">") ? (u(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : e === " " || e === " " || e === `
348
+ ` || e === "\r" ? (u(), r = 2) : s += e), r === 3 && s === "!--" && (r = 4, c = c[0]);
349
+ }
350
+ return u(), c.length > 2 ? c.slice(1) : c[1];
351
+ }
352
+ class Ce {
341
353
  constructor(e) {
342
- d(this, "node");
343
- d(this, "endNode");
344
- d(this, "$predicate");
345
- d(this, "stopCallback");
346
- d(this, "thenContent");
347
- d(this, "elseContent");
348
- d(this, "connectedContent", []);
349
- d(this, "elementContext");
350
- d(this, "initialUpdateHappened", !1);
351
- d(this, "previousValue");
352
- this.$predicate = e.$predicate, this.thenContent = e.thenContent ? M(e.thenContent) : void 0, this.elseContent = e.elseContent ? M(e.elseContent) : void 0, this.elementContext = e.elementContext, this.elementContext.root.env === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
353
- }
354
- get connected() {
354
+ f(this, "node");
355
+ f(this, "endNode");
356
+ f(this, "$predicate");
357
+ f(this, "stopCallback");
358
+ f(this, "thenContent");
359
+ f(this, "elseContent");
360
+ f(this, "connectedContent", []);
361
+ f(this, "elementContext");
362
+ f(this, "initialUpdateHappened", !1);
363
+ f(this, "previousValue");
364
+ this.$predicate = e.$predicate, this.thenContent = e.thenContent ? U(e.thenContent) : void 0, this.elseContent = e.elseContent ? U(e.elseContent) : void 0, this.elementContext = e.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
365
+ }
366
+ get isMounted() {
355
367
  return this.node.parentNode != null;
356
368
  }
357
- connect(e, n) {
358
- this.connected || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.elementContext.root.env === "development" && e.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((o) => {
369
+ mount(e, n) {
370
+ this.isMounted || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.elementContext.root.getEnv() === "development" && e.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((o) => {
359
371
  (!this.initialUpdateHappened || o && !this.previousValue || !o && this.previousValue) && (this.update(o), this.initialUpdateHappened = !0, this.previousValue = o);
360
372
  }));
361
373
  }
362
- disconnect() {
374
+ unmount() {
363
375
  var e, n;
364
376
  this.stopCallback && (this.stopCallback(), this.stopCallback = void 0);
365
377
  for (const o of this.connectedContent)
366
- o.disconnect();
367
- this.connectedContent = [], this.connected && ((e = this.node.parentNode) == null || e.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
378
+ o.unmount();
379
+ this.connectedContent = [], this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
368
380
  }
369
381
  update(e) {
370
382
  var n;
371
383
  for (const o of this.connectedContent)
372
- o.disconnect();
384
+ o.unmount();
373
385
  if (this.connectedContent = [], this.node.parentNode != null) {
374
- e && this.thenContent ? this.connectedContent = S(this.thenContent, this.elementContext) : !e && this.elseContent && (this.connectedContent = S(this.elseContent, this.elementContext));
386
+ e && this.thenContent ? this.connectedContent = x(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = x(this.elementContext, this.elseContent));
375
387
  for (let o = 0; o < this.connectedContent.length; o++) {
376
388
  const r = this.connectedContent[o], s = ((n = this.connectedContent[o - 1]) == null ? void 0 : n.node) ?? this.node;
377
- r.connect(this.node.parentNode, s);
389
+ r.mount(this.node.parentNode, s);
378
390
  }
379
- this.elementContext.root.env === "development" && (this.node.textContent = `Conditional (${e ? "truthy" : "falsy"})`);
391
+ this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${e ? "truthy" : "falsy"})`);
380
392
  }
381
393
  }
382
- async setChildren(e) {
383
- }
384
394
  }
385
395
  let Q = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
386
- const Ce = (t) => /^on[A-Z]/.test(t);
396
+ const be = (t) => /^on[A-Z]/.test(t);
387
397
  class we {
388
398
  constructor({ tag: e, props: n, children: o, elementContext: r }) {
389
- d(this, "node");
390
- d(this, "props");
391
- d(this, "children");
392
- d(this, "stopCallbacks", []);
393
- d(this, "elementContext");
394
- d(this, "uniqueId", Q());
399
+ f(this, "node");
400
+ f(this, "props");
401
+ f(this, "children");
402
+ f(this, "stopCallbacks", []);
403
+ f(this, "elementContext");
404
+ f(this, "uniqueId", Q());
395
405
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
396
- d(this, "canClickAway", !1);
397
- if (r = { ...r }, e.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), r.root.env === "development" && (this.node.dataset.uniqueId = this.uniqueId), n.ref)
406
+ f(this, "canClickAway", !1);
407
+ if (r = { ...r }, e.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), n.ref)
398
408
  if (oe(n.ref))
399
409
  n.ref.node = this.node;
400
410
  else
401
411
  throw new Error("Expected ref to be a Ref object. Got: " + n.ref);
402
412
  this.props = {
403
- ...fe(["ref", "class", "className"], n),
413
+ ...pe(["ref", "class", "className"], n),
404
414
  class: n.className ?? n.class
405
- }, this.children = o ? S(o, r) : [], this.elementContext = r;
415
+ }, this.children = o ? x(r, o) : [], this.elementContext = r;
406
416
  }
407
- get connected() {
417
+ get isMounted() {
408
418
  return this.node.parentNode != null;
409
419
  }
410
- connect(e, n) {
420
+ mount(e, n) {
411
421
  if (e == null)
412
422
  throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
413
- if (!this.connected) {
423
+ if (!this.isMounted) {
414
424
  for (const o of this.children)
415
- o.connect(this.node);
425
+ o.mount(this.node);
416
426
  this.applyProps(this.node, this.props), this.props.style && this.applyStyles(this.node, this.props.style, this.stopCallbacks), this.props.class && this.applyClasses(this.node, this.props.class, this.stopCallbacks);
417
427
  }
418
428
  e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), setTimeout(() => {
419
429
  this.canClickAway = !0;
420
430
  }, 0);
421
431
  }
422
- disconnect() {
432
+ unmount() {
423
433
  var e;
424
- if (this.connected) {
434
+ if (this.isMounted) {
425
435
  for (const n of this.children)
426
- n.disconnect();
436
+ n.unmount();
427
437
  (e = this.node.parentNode) == null || e.removeChild(this.node), this.canClickAway = !1;
428
438
  for (const n of this.stopCallbacks)
429
439
  n();
430
440
  this.stopCallbacks = [];
431
441
  }
432
442
  }
433
- setChildren(e) {
434
- var s, i;
435
- const n = this.children, o = [], r = Math.max(n.length, e.length);
436
- for (let l = 0; l < r; l++)
437
- !n[l] && e[l] ? (o[l] = e[l], o[l].connect(this.node, (s = o[l - 1]) == null ? void 0 : s.node)) : n[l] && !e[l] ? n[l].disconnect() : n[l] != e[l] && (o[l] = e[l], n[l].disconnect(), o[l].connect(this.node, (i = o[l - 1]) == null ? void 0 : i.node));
438
- this.children = o;
439
- }
440
443
  getUpdateKey(e, n) {
441
444
  return `${this.uniqueId}:${e}:${n}`;
442
445
  }
443
446
  applyProps(e, n) {
444
447
  const o = (r, s, i) => {
445
- w(r) ? this.stopCallbacks.push(
446
- r.watch((l) => {
448
+ b(r) ? this.stopCallbacks.push(
449
+ r.watch((c) => {
447
450
  this.elementContext.root.render.update(() => {
448
- s(l);
451
+ s(c);
449
452
  }, i);
450
453
  })
451
454
  ) : this.elementContext.root.render.update(() => {
@@ -456,50 +459,50 @@ class we {
456
459
  const s = n[r];
457
460
  if (r === "attributes") {
458
461
  const i = s;
459
- for (const l in i)
462
+ for (const c in i)
460
463
  o(
461
- i[l],
462
- (c) => {
463
- c == null ? e.removeAttribute(l) : e.setAttribute(l, String(c));
464
+ i[c],
465
+ (u) => {
466
+ u == null ? e.removeAttribute(c) : e.setAttribute(c, String(u));
464
467
  },
465
- this.getUpdateKey("attr", l)
468
+ this.getUpdateKey("attr", c)
466
469
  );
467
470
  } else if (r === "eventListeners") {
468
471
  const i = s;
469
- for (const l in i) {
470
- const c = w(s) ? (a) => s.get()(a) : s;
471
- e.addEventListener(l, c), this.stopCallbacks.push(() => {
472
- e.removeEventListener(l, c);
472
+ for (const c in i) {
473
+ const u = b(s) ? (l) => s.get()(l) : s;
474
+ e.addEventListener(c, u), this.stopCallbacks.push(() => {
475
+ e.removeEventListener(c, u);
473
476
  });
474
477
  }
475
478
  } else if (r === "onClickOutside" || r === "onclickoutside") {
476
- const i = (c) => {
477
- this.canClickAway && !e.contains(c.target) && (w(s) ? s.get()(c) : s(c));
478
- }, l = { capture: !0 };
479
- window.addEventListener("click", i, l), this.stopCallbacks.push(() => {
480
- window.removeEventListener("click", i, l);
479
+ const i = (u) => {
480
+ this.canClickAway && !e.contains(u.target) && (b(s) ? s.get()(u) : s(u));
481
+ }, c = { capture: !0 };
482
+ window.addEventListener("click", i, c), this.stopCallbacks.push(() => {
483
+ window.removeEventListener("click", i, c);
481
484
  });
482
485
  } else if (r === "$$value") {
483
486
  if (!Z(s))
484
487
  throw new TypeError(`$$value attribute must be a settable signal. Got: ${s}`);
485
488
  o(
486
489
  s,
487
- (l) => {
488
- e.value = String(l);
490
+ (c) => {
491
+ e.value = String(c);
489
492
  },
490
493
  this.getUpdateKey("attr", "value")
491
494
  );
492
- const i = (l) => {
493
- const c = be(s.get(), l.currentTarget.value);
494
- s.set(c);
495
+ const i = (c) => {
496
+ const u = ke(s.get(), c.currentTarget.value);
497
+ s.set(u);
495
498
  };
496
499
  e.addEventListener("input", i), this.stopCallbacks.push(() => {
497
500
  e.removeEventListener("input", i);
498
501
  });
499
- } else if (Ce(r)) {
500
- const i = r.slice(2).toLowerCase(), l = w(s) ? (c) => s.get()(c) : s;
501
- e.addEventListener(i, l), this.stopCallbacks.push(() => {
502
- e.removeEventListener(i, l);
502
+ } else if (be(r)) {
503
+ const i = r.slice(2).toLowerCase(), c = b(s) ? (u) => s.get()(u) : s;
504
+ e.addEventListener(i, c), this.stopCallbacks.push(() => {
505
+ e.removeEventListener(i, c);
503
506
  });
504
507
  } else if (r.includes("-"))
505
508
  o(
@@ -509,7 +512,7 @@ class we {
509
512
  },
510
513
  this.getUpdateKey("attr", r)
511
514
  );
512
- else if (!ke.includes(r))
515
+ else if (!ve.includes(r))
513
516
  if (this.elementContext.isSVG)
514
517
  o(
515
518
  s,
@@ -556,8 +559,8 @@ class we {
556
559
  const i = r.toLowerCase();
557
560
  o(
558
561
  s,
559
- (l) => {
560
- l == null ? e.removeAttribute(i) : e.setAttribute(i, String(l));
562
+ (c) => {
563
+ c == null ? e.removeAttribute(i) : e.setAttribute(i, String(c));
561
564
  },
562
565
  this.getUpdateKey("attr", i)
563
566
  );
@@ -592,35 +595,35 @@ class we {
592
595
  e.style.cssText = "";
593
596
  else if (typeof n == "string")
594
597
  e.style.cssText = n;
595
- else if (w(n)) {
598
+ else if (b(n)) {
596
599
  let s;
597
- const i = n.watch((l) => {
600
+ const i = n.watch((c) => {
598
601
  this.elementContext.root.render.update(
599
602
  () => {
600
- E(s) && s(), e.style.cssText = "", s = this.applyStyles(e, l, o);
603
+ E(s) && s(), e.style.cssText = "", s = this.applyStyles(e, c, o);
601
604
  },
602
605
  this.getUpdateKey("styles", "*")
603
606
  );
604
607
  });
605
608
  o.push(i), r.push(i);
606
- } else if (G(n)) {
609
+ } else if (L(n)) {
607
610
  n = n;
608
611
  for (const s in n) {
609
- const i = n[s], l = s.startsWith("--") ? (c, a) => a == null ? e.style.removeProperty(c) : e.style.setProperty(c, a) : (c, a) => e.style[c] = a ?? "";
610
- if (w(i)) {
611
- const c = i.watch((a) => {
612
+ const i = n[s], c = s.startsWith("--") ? (u, l) => l == null ? e.style.removeProperty(u) : e.style.setProperty(u, l) : (u, l) => e.style[u] = l ?? "";
613
+ if (b(i)) {
614
+ const u = i.watch((l) => {
612
615
  this.elementContext.root.render.update(
613
616
  () => {
614
- a != null ? l(s, a) : e.style.removeProperty(s);
617
+ l != null ? c(s, l) : e.style.removeProperty(s);
615
618
  },
616
619
  this.getUpdateKey("style", s)
617
620
  );
618
621
  });
619
- o.push(c), r.push(c);
620
- } else if (O(i))
621
- l(s, i);
622
- else if (z(i))
623
- l(s, String(i));
622
+ o.push(u), r.push(u);
623
+ } else if (A(i))
624
+ c(s, i);
625
+ else if (D(i))
626
+ c(s, String(i));
624
627
  else
625
628
  throw new TypeError(`Style properties should be strings, $states or numbers. Got (${s}: ${i})`);
626
629
  }
@@ -633,12 +636,12 @@ class we {
633
636
  }
634
637
  applyClasses(e, n, o) {
635
638
  const r = [];
636
- if (w(n)) {
639
+ if (b(n)) {
637
640
  let s;
638
- const i = n.watch((l) => {
641
+ const i = n.watch((c) => {
639
642
  this.elementContext.root.render.update(
640
643
  () => {
641
- E(s) && s(), e.removeAttribute("class"), s = this.applyClasses(e, l, o);
644
+ E(s) && s(), e.removeAttribute("class"), s = this.applyClasses(e, c, o);
642
645
  },
643
646
  this.getUpdateKey("attr", "class")
644
647
  );
@@ -647,15 +650,15 @@ class we {
647
650
  } else {
648
651
  const s = X(n);
649
652
  for (const i in s) {
650
- const l = s[i];
651
- if (w(l)) {
652
- const c = l.watch((a) => {
653
+ const c = s[i];
654
+ if (b(c)) {
655
+ const u = c.watch((l) => {
653
656
  this.elementContext.root.render.update(() => {
654
- a ? e.classList.add(i) : e.classList.remove(i);
657
+ l ? e.classList.add(i) : e.classList.remove(i);
655
658
  });
656
659
  });
657
- o.push(c), r.push(c);
658
- } else l && e.classList.add(i);
660
+ o.push(u), r.push(u);
661
+ } else c && e.classList.add(i);
659
662
  }
660
663
  }
661
664
  return function() {
@@ -666,37 +669,37 @@ class we {
666
669
  }
667
670
  function X(t) {
668
671
  let e = {};
669
- if (O(t)) {
672
+ if (A(t)) {
670
673
  const n = t.split(" ");
671
674
  for (const o of n)
672
675
  e[o] = !0;
673
- } else G(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
676
+ } else L(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
674
677
  Object.assign(e, X(n));
675
678
  });
676
679
  return e;
677
680
  }
678
- function be(t, e) {
681
+ function ke(t, e) {
679
682
  const n = typeof t;
680
683
  return n === "string" ? String(e) : n === "number" ? Number(e) : n === "boolean" ? !!e : e;
681
684
  }
682
- const ke = ["ref", "children", "class", "style", "data"];
685
+ const ve = ["ref", "children", "class", "style", "data"];
683
686
  class $e {
684
687
  constructor({ signals: e, renderFn: n, elementContext: o }) {
685
- d(this, "node");
686
- d(this, "endNode");
687
- d(this, "connectedViews", []);
688
- d(this, "renderFn");
689
- d(this, "elementContext");
690
- d(this, "observerControls");
688
+ f(this, "node");
689
+ f(this, "endNode");
690
+ f(this, "connectedViews", []);
691
+ f(this, "renderFn");
692
+ f(this, "elementContext");
693
+ f(this, "observerControls");
691
694
  this.elementContext = o, this.renderFn = n, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
692
695
  let r;
693
696
  this.observerControls = {
694
697
  start: () => {
695
- r == null && (r = q(e, (...s) => {
698
+ r == null && (r = G(e, (...s) => {
696
699
  const i = this.renderFn(...s);
697
- if (!re(i))
700
+ if (!se(i))
698
701
  throw console.error(i), new TypeError(
699
- `Observer received invalid value to render. Got type: ${R(i)}, value: ${i}`
702
+ `Observer received invalid value to render. Got type: ${q(i)}, value: ${i}`
700
703
  );
701
704
  Array.isArray(i) ? this.update(...i) : this.update(i);
702
705
  }));
@@ -706,335 +709,322 @@ class $e {
706
709
  }
707
710
  };
708
711
  }
709
- get connected() {
712
+ get isMounted() {
710
713
  return this.node.parentNode != null;
711
714
  }
712
- connect(e, n) {
713
- this.connected || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.observerControls.start());
715
+ mount(e, n) {
716
+ this.isMounted || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.observerControls.start());
714
717
  }
715
- disconnect() {
718
+ unmount() {
716
719
  var e;
717
- this.observerControls.stop(), this.connected && (this.cleanup(), (e = this.node.parentNode) == null || e.removeChild(this.node));
718
- }
719
- async setChildren() {
720
- console.warn("setChildren is not implemented for Dynamic");
720
+ this.observerControls.stop(), this.isMounted && (this.cleanup(), (e = this.node.parentNode) == null || e.removeChild(this.node));
721
721
  }
722
722
  cleanup() {
723
723
  var e;
724
724
  for (; this.connectedViews.length > 0; )
725
- (e = this.connectedViews.pop()) == null || e.disconnect();
725
+ (e = this.connectedViews.pop()) == null || e.unmount();
726
726
  }
727
727
  update(...e) {
728
728
  var o, r;
729
- if (this.cleanup(), e == null || !this.connected)
729
+ if (this.cleanup(), e == null || !this.isMounted)
730
730
  return;
731
- const n = e.map((s) => ne(s) ? s : P(s) ? T(S(s, this.elementContext)) : T(S(M(s), this.elementContext)));
731
+ const n = e.map((s) => ne(s) ? s : V(s) ? M(x(this.elementContext, s)) : M(x(this.elementContext, U(s))));
732
732
  for (const s of n) {
733
733
  const i = ((o = this.connectedViews.at(-1)) == null ? void 0 : o.node) || this.node;
734
- s.connect(this.node.parentNode, i), this.connectedViews.push(s);
734
+ s.mount(this.node.parentNode, i), this.connectedViews.push(s);
735
735
  }
736
- if (this.elementContext.root.env === "development") {
736
+ if (this.elementContext.root.getEnv() === "development") {
737
737
  const s = (r = this.connectedViews.at(-1)) == null ? void 0 : r.node;
738
738
  this.endNode.previousSibling !== s && this.node.parentNode.insertBefore(this.endNode, (s == null ? void 0 : s.nextSibling) ?? null);
739
739
  }
740
740
  }
741
741
  }
742
- class ve {
742
+ class Ne {
743
743
  constructor(e) {
744
- d(this, "node");
745
- d(this, "endNode");
746
- d(this, "$children");
747
- d(this, "stopCallback");
748
- d(this, "connectedChildren", []);
749
- d(this, "elementContext");
750
- this.$children = e.$children, this.elementContext = e.elementContext, this.elementContext.root.env === "development" ? (this.node = document.createComment("Outlet"), this.endNode = document.createComment("/Outlet")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
751
- }
752
- get connected() {
744
+ f(this, "node");
745
+ f(this, "endNode");
746
+ f(this, "$children");
747
+ f(this, "stopCallback");
748
+ f(this, "connectedChildren", []);
749
+ f(this, "elementContext");
750
+ this.$children = e.$children, this.elementContext = e.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Outlet"), this.endNode = document.createComment("/Outlet")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
751
+ }
752
+ get isMounted() {
753
753
  var e;
754
754
  return ((e = this.node) == null ? void 0 : e.parentNode) != null;
755
755
  }
756
- connect(e, n) {
757
- this.connected || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.stopCallback = this.$children.watch((o) => {
756
+ mount(e, n) {
757
+ this.isMounted || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.stopCallback = this.$children.watch((o) => {
758
758
  this.update(o);
759
759
  }));
760
760
  }
761
- disconnect() {
761
+ unmount() {
762
762
  var e;
763
- if (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.connected) {
763
+ if (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted) {
764
764
  for (const n of this.connectedChildren)
765
- n.disconnect();
765
+ n.unmount();
766
766
  this.connectedChildren = [], (e = this.endNode.parentNode) == null || e.removeChild(this.endNode);
767
767
  }
768
768
  }
769
769
  update(e) {
770
770
  var n, o, r;
771
771
  for (const s of this.connectedChildren)
772
- s.disconnect();
772
+ s.unmount();
773
773
  for (let s = 0; s < e.length; s++) {
774
- const i = e[s], l = s > 0 ? e[s] : void 0;
775
- i.connect(this.node.parentElement, l == null ? void 0 : l.node);
774
+ const i = e[s], c = s > 0 ? e[s] : void 0;
775
+ i.mount(this.node.parentElement, c == null ? void 0 : c.node);
776
776
  }
777
- this.connectedChildren = e, this.elementContext.root.env === "development" && (this.node.textContent = `Outlet (${e.length} ${e.length === 1 ? "child" : "children"})`, (r = this.node.parentElement) == null || r.insertBefore(
777
+ this.connectedChildren = e, this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Outlet (${e.length} ${e.length === 1 ? "child" : "children"})`, (r = this.node.parentElement) == null || r.insertBefore(
778
778
  this.endNode,
779
779
  ((o = (n = this.connectedChildren[this.connectedChildren.length - 1]) == null ? void 0 : n.node) == null ? void 0 : o.nextSibling) ?? null
780
780
  ));
781
781
  }
782
- setChildren(e) {
783
- throw new Error("setChildren is not supported on Outlet");
784
- }
785
782
  }
786
- class Ne {
783
+ class xe {
787
784
  constructor(e) {
788
- d(this, "config");
789
- d(this, "handle");
785
+ f(this, "config");
786
+ f(this, "handle");
790
787
  this.config = e;
791
788
  }
792
- get connected() {
793
- return this.handle ? this.handle.connected : !1;
789
+ get isMounted() {
790
+ return this.handle ? this.handle.isMounted : !1;
794
791
  }
795
- connect(e, n) {
792
+ mount(e, n) {
796
793
  const { content: o, parent: r } = this.config;
797
- ne(o) ? this.handle = o : P(o) ? this.handle = T(S(o, this.config.elementContext)) : this.handle = T(S(M(o), this.config.elementContext)), this.handle.connect(r);
794
+ ne(o) ? this.handle = o : V(o) ? this.handle = M(x(this.config.elementContext, o)) : this.handle = M(x(this.config.elementContext, U(o))), this.handle.mount(r);
798
795
  }
799
- disconnect() {
796
+ unmount() {
800
797
  var e;
801
- (e = this.handle) != null && e.connected && this.handle.disconnect();
802
- }
803
- setChildren(e) {
804
- var n;
805
- (n = this.handle) == null || n.setChildren(e);
798
+ (e = this.handle) != null && e.isMounted && this.handle.unmount();
806
799
  }
807
800
  }
808
801
  function ee(t, e, n, o = []) {
809
802
  t = { ...t };
810
- const [r, s] = F(S(o, t));
803
+ const [r, s] = O(x(t, o));
811
804
  let i = !1;
812
- const l = [], c = [], a = [], h = [], g = [], C = Q(), [b, k] = F(e.name), v = t.root.createLogger(b, { uid: C }), $ = {
805
+ const c = [], u = [], l = [], d = [], h = [], C = Q(), [w, k] = O(e.name), $ = t.root.createLogger(w, { uid: C }), v = {
813
806
  get uid() {
814
807
  return C;
815
808
  },
816
- setName(u) {
817
- k(u);
809
+ setName(a) {
810
+ k(a);
818
811
  },
819
- beforeMount(u) {
820
- h.push(u);
812
+ beforeMount(a) {
813
+ u.push(a);
821
814
  },
822
- onMount(u) {
823
- c.push(u);
815
+ onMount(a) {
816
+ l.push(a);
824
817
  },
825
- beforeUnmount(u) {
826
- g.push(u);
818
+ beforeUnmount(a) {
819
+ d.push(a);
827
820
  },
828
- onUnmount(u) {
829
- a.push(u);
821
+ onUnmount(a) {
822
+ h.push(a);
830
823
  },
831
- watch(u, y) {
824
+ watch(a, y) {
832
825
  if (i) {
833
- const N = q(u, y);
834
- return l.push(N), N;
826
+ const g = G(a, y);
827
+ return c.push(g), g;
835
828
  } else {
836
- let N, A = !1;
837
- return c.push(() => {
838
- A || (N = q(u, y), l.push(N));
839
- }), function U() {
840
- U != null && (A = !0, U());
829
+ let g, S = !1;
830
+ return l.push(() => {
831
+ S || (g = G(a, y), c.push(g));
832
+ }), function F() {
833
+ F != null && (S = !0, F());
841
834
  };
842
835
  }
843
836
  },
844
837
  outlet() {
845
- return x("$outlet", { $children: r });
838
+ return N("$outlet", { $children: r });
846
839
  }
847
840
  };
848
- Object.assign($, v);
841
+ Object.assign(v, $);
849
842
  let m;
850
843
  function p() {
851
- let u;
844
+ let a;
852
845
  try {
853
- u = e(n, $);
846
+ a = e(n, v);
854
847
  } catch (y) {
855
- throw y instanceof Error && v.crash(y), y;
848
+ throw y instanceof Error && $.crash(y), y;
856
849
  }
857
- if (u instanceof Promise)
850
+ if (a instanceof Promise)
858
851
  throw new TypeError("View function cannot return a Promise.");
859
- if (u !== null) if (u instanceof Node)
860
- m = T(S(x("$node", { value: u }), t));
861
- else if (P(u) || D(P, u))
862
- m = T(S(u, t));
863
- else if (w(u))
864
- m = T(
865
- S(x("$observer", { signals: [u], renderFn: (y) => y }), t)
852
+ if (a !== null) if (a instanceof Node)
853
+ m = M(x(t, N("$node", { value: a })));
854
+ else if (V(a) || z(V, a))
855
+ m = M(x(t, a));
856
+ else if (b(a))
857
+ m = M(
858
+ x(t, N("$observer", { signals: [a], renderFn: (y) => y }))
866
859
  );
867
860
  else {
868
861
  const y = new TypeError(
869
- `Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${R(u)}`
862
+ `Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${q(a)}`
870
863
  );
871
- v.crash(y);
864
+ $.crash(y);
872
865
  }
873
866
  }
874
867
  return {
875
868
  get node() {
876
869
  return m == null ? void 0 : m.node;
877
870
  },
878
- get connected() {
871
+ get isMounted() {
879
872
  return i;
880
873
  },
881
- connect(u, y) {
882
- const N = i;
883
- if (!N)
884
- for (p(); h.length > 0; )
885
- h.shift()();
886
- m && m.connect(u, y), N || (i = !0, requestAnimationFrame(() => {
887
- for (; c.length > 0; )
888
- c.shift()();
874
+ mount(a, y) {
875
+ const g = i;
876
+ if (!g)
877
+ for (p(); u.length > 0; )
878
+ u.shift()();
879
+ m && m.mount(a, y), g || (i = !0, requestAnimationFrame(() => {
880
+ for (; l.length > 0; )
881
+ l.shift()();
889
882
  }));
890
883
  },
891
- disconnect() {
892
- for (; g.length > 0; )
893
- g.shift()();
894
- for (m && m.disconnect(), i = !1; a.length > 0; )
895
- a.shift()();
896
- for (; l.length > 0; )
897
- l.shift()();
884
+ unmount() {
885
+ for (; d.length > 0; )
886
+ d.shift()();
887
+ for (m && m.unmount(), i = !1; h.length > 0; )
888
+ h.shift()();
889
+ for (; c.length > 0; )
890
+ c.shift()();
898
891
  },
899
- async setChildren(u) {
900
- s(u);
892
+ setChildren(a) {
893
+ s(a);
901
894
  }
902
895
  };
903
896
  }
904
897
  class Se {
905
898
  constructor({ elementContext: e, $items: n, renderFn: o, keyFn: r }) {
906
- d(this, "node");
907
- d(this, "endNode");
908
- d(this, "$items");
909
- d(this, "stopCallback");
910
- d(this, "connectedItems", []);
911
- d(this, "elementContext");
912
- d(this, "renderFn");
913
- d(this, "keyFn");
914
- this.elementContext = e, this.$items = n, this.renderFn = o, this.keyFn = r, this.elementContext.root.env === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
915
- }
916
- get connected() {
899
+ f(this, "node");
900
+ f(this, "endNode");
901
+ f(this, "$items");
902
+ f(this, "stopCallback");
903
+ f(this, "connectedItems", []);
904
+ f(this, "elementContext");
905
+ f(this, "renderFn");
906
+ f(this, "keyFn");
907
+ this.elementContext = e, this.$items = n, this.renderFn = o, this.keyFn = r, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
908
+ }
909
+ get isMounted() {
917
910
  return this.node.parentNode != null;
918
911
  }
919
- connect(e, n) {
920
- this.connected || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.stopCallback = this.$items.watch((o) => {
912
+ mount(e, n) {
913
+ this.isMounted || (e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.stopCallback = this.$items.watch((o) => {
921
914
  this._update(Array.from(o));
922
915
  }));
923
916
  }
924
- disconnect() {
917
+ unmount() {
925
918
  var e, n;
926
- this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.connected && ((e = this.node.parentNode) == null || e.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode)), this._cleanup();
927
- }
928
- setChildren() {
929
- console.warn("setChildren is not implemented for repeat()");
919
+ this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode)), this._cleanup();
930
920
  }
931
921
  _cleanup() {
932
922
  for (const e of this.connectedItems)
933
- e.handle.disconnect();
923
+ e.handle.unmount();
934
924
  this.connectedItems = [];
935
925
  }
936
926
  _update(e) {
937
- var s, i, l;
938
- if (e.length === 0 || !this.connected)
927
+ var s, i, c;
928
+ if (e.length === 0 || !this.isMounted)
939
929
  return this._cleanup();
940
930
  const n = [];
941
931
  let o = 0;
942
- for (const c of e)
932
+ for (const u of e)
943
933
  n.push({
944
- key: this.keyFn(c, o),
945
- value: c,
934
+ key: this.keyFn(u, o),
935
+ value: u,
946
936
  index: o++
947
937
  });
948
938
  const r = [];
949
- for (const c of this.connectedItems)
950
- n.find((h) => h.key === c.key) || c.handle.disconnect();
951
- for (const c of n) {
952
- const a = this.connectedItems.find((h) => h.key === c.key);
953
- if (a)
954
- a.setValue(c.value), a.setIndex(c.index), r[c.index] = a;
939
+ for (const u of this.connectedItems)
940
+ n.find((d) => d.key === u.key) || u.handle.unmount();
941
+ for (const u of n) {
942
+ const l = this.connectedItems.find((d) => d.key === u.key);
943
+ if (l)
944
+ l.setValue(u.value), l.setIndex(u.index), r[u.index] = l;
955
945
  else {
956
- const [h, g] = F(c.value), [C, b] = F(c.index);
957
- r[c.index] = {
958
- key: c.key,
959
- $value: h,
960
- setValue: g,
946
+ const [d, h] = O(u.value), [C, w] = O(u.index);
947
+ r[u.index] = {
948
+ key: u.key,
949
+ $value: d,
950
+ setValue: h,
961
951
  $index: C,
962
- setIndex: b,
963
- handle: ee(this.elementContext, xe, {
964
- $value: h,
952
+ setIndex: w,
953
+ handle: ee(this.elementContext, Ee, {
954
+ $value: d,
965
955
  $index: C,
966
956
  renderFn: this.renderFn
967
957
  })
968
958
  };
969
959
  }
970
960
  }
971
- for (let c = 0; c < r.length; c++) {
972
- const a = r[c], h = ((s = r[c - 1]) == null ? void 0 : s.handle.node) ?? this.node;
973
- a.handle.connect(this.node.parentNode, h);
961
+ for (let u = 0; u < r.length; u++) {
962
+ const l = r[u], d = ((s = r[u - 1]) == null ? void 0 : s.handle.node) ?? this.node;
963
+ l.handle.mount(this.node.parentNode, d);
974
964
  }
975
- if (this.connectedItems = r, this.elementContext.root.env === "development") {
965
+ if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
976
966
  this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
977
- const c = ((i = r.at(-1)) == null ? void 0 : i.handle.node) ?? this.node;
978
- (l = this.node.parentNode) == null || l.insertBefore(this.endNode, c.nextSibling);
967
+ const u = ((i = r.at(-1)) == null ? void 0 : i.handle.node) ?? this.node;
968
+ (c = this.node.parentNode) == null || c.insertBefore(this.endNode, u.nextSibling);
979
969
  }
980
970
  }
981
971
  }
982
- function xe({ $value: t, $index: e, renderFn: n }, o) {
972
+ function Ee({ $value: t, $index: e, renderFn: n }, o) {
983
973
  return n(t, e, o);
984
974
  }
985
- class Ee {
975
+ class Me {
986
976
  constructor({ value: e }) {
987
- d(this, "node", document.createTextNode(""));
988
- d(this, "value", "");
989
- d(this, "stopCallback");
977
+ f(this, "node", document.createTextNode(""));
978
+ f(this, "value", "");
979
+ f(this, "stopCallback");
990
980
  this.value = e;
991
981
  }
992
- get connected() {
982
+ get isMounted() {
993
983
  return this.node.parentNode != null;
994
984
  }
995
- async connect(e, n = null) {
996
- this.connected || (w(this.value) ? this.stopCallback = this.value.watch((o) => {
985
+ async mount(e, n = null) {
986
+ this.isMounted || (b(this.value) ? this.stopCallback = this.value.watch((o) => {
997
987
  this.update(o);
998
988
  }) : this.update(this.value)), e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null);
999
989
  }
1000
- async disconnect() {
1001
- this.connected && (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.node.parentNode.removeChild(this.node));
990
+ async unmount() {
991
+ this.isMounted && (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.node.parentNode.removeChild(this.node));
1002
992
  }
1003
993
  update(e) {
1004
994
  e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
1005
995
  }
1006
- async setChildren() {
1007
- }
1008
996
  }
1009
997
  const te = Symbol("Markup");
1010
- function P(t) {
1011
- return G(t) && t[te] === !0;
998
+ function V(t) {
999
+ return L(t) && t[te] === !0;
1012
1000
  }
1013
1001
  function ne(t) {
1014
- return G(t) && E(t.connect) && E(t.disconnect);
1002
+ return L(t) && E(t.connect) && E(t.disconnect);
1015
1003
  }
1016
- function M(t) {
1017
- return j(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1004
+ function U(t) {
1005
+ return P(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1018
1006
  if (e instanceof Node)
1019
- return x("$node", { value: e });
1020
- if (P(e))
1007
+ return N("$node", { value: e });
1008
+ if (e instanceof re)
1009
+ return N("$node", { value: e.node });
1010
+ if (V(e))
1021
1011
  return e;
1022
- if (O(e) || z(e))
1023
- return x("$text", { value: e });
1024
- if (w(e))
1025
- return x("$observer", {
1012
+ if (A(e) || D(e))
1013
+ return N("$text", { value: e });
1014
+ if (b(e))
1015
+ return N("$observer", {
1026
1016
  signals: [e],
1027
1017
  renderFn: (n) => n
1028
1018
  });
1029
1019
  throw console.error(e), new TypeError(`Unexpected child type. Got: ${e}`);
1030
1020
  });
1031
1021
  }
1032
- function x(t, e, ...n) {
1022
+ function N(t, e, ...n) {
1033
1023
  return e != null && Ae(e), {
1034
1024
  [te]: !0,
1035
1025
  type: t,
1036
1026
  props: e,
1037
- children: M(n)
1027
+ children: U(n)
1038
1028
  };
1039
1029
  }
1040
1030
  function Ae(t) {
@@ -1044,26 +1034,27 @@ function Ae(t) {
1044
1034
  if (e.startsWith("$$") && t[e] !== void 0) {
1045
1035
  if (!Z(t[e]))
1046
1036
  throw new TypeError(`Prop '${e}' is named as a SettableSignal but value is not. Got: ${t[e]}`);
1047
- } else if (e.startsWith("$") && t[e] !== void 0 && !w(t[e]))
1037
+ } else if (e.startsWith("$") && t[e] !== void 0 && !b(t[e]))
1048
1038
  throw new TypeError(`Prop '${e}' is named as a Signal but value is not. Got: ${t[e]}`);
1049
1039
  }
1050
- function qe(t, e, n) {
1040
+ const _e = ge.bind(N);
1041
+ function Re(t, e, n) {
1051
1042
  const o = J(t);
1052
- return x("$cond", {
1043
+ return N("$cond", {
1053
1044
  $predicate: o,
1054
1045
  thenContent: e,
1055
1046
  elseContent: n
1056
1047
  });
1057
1048
  }
1058
- function Re(t, e, n) {
1049
+ function Be(t, e, n) {
1059
1050
  const o = J(t);
1060
- return x("$repeat", { $items: o, keyFn: e, renderFn: n });
1051
+ return N("$repeat", { $items: o, keyFn: e, renderFn: n });
1061
1052
  }
1062
- function _e(t, e) {
1063
- return x("$portal", { content: t, parent: e });
1053
+ function Ke(t, e) {
1054
+ return N("$portal", { parent: t, content: e });
1064
1055
  }
1065
- function Be() {
1066
- const [t, e] = F();
1056
+ function We() {
1057
+ const [t, e] = O();
1067
1058
  return {
1068
1059
  get: t.get,
1069
1060
  watch: t.watch,
@@ -1078,46 +1069,44 @@ function Be() {
1078
1069
  function oe(t) {
1079
1070
  return !(t == null || typeof t != "object" || !t.hasOwnProperty("node"));
1080
1071
  }
1081
- class Te {
1072
+ class re {
1082
1073
  constructor(e) {
1083
- d(this, "node");
1074
+ f(this, "node");
1084
1075
  this.node = e;
1085
1076
  }
1086
- get connected() {
1077
+ get isMounted() {
1087
1078
  return this.node.parentNode != null;
1088
1079
  }
1089
- async connect(e, n) {
1080
+ async mount(e, n) {
1090
1081
  e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null);
1091
1082
  }
1092
- async disconnect() {
1083
+ async unmount() {
1093
1084
  this.node.parentNode && this.node.parentNode.removeChild(this.node);
1094
1085
  }
1095
- async setChildren(e) {
1096
- }
1097
1086
  }
1098
- function S(t, e) {
1099
- return (j(t) ? t : [t]).map((o) => {
1087
+ function x(t, e) {
1088
+ return (P(e) ? e : [e]).map((o) => {
1100
1089
  if (E(o.type))
1101
- return ee(e, o.type, o.props, o.children);
1102
- if (O(o.type))
1090
+ return ee(t, o.type, o.props, o.children);
1091
+ if (A(o.type))
1103
1092
  switch (o.type) {
1104
1093
  case "$node": {
1105
1094
  const r = o.props;
1106
- return new Te(r.value);
1095
+ return new re(r.value);
1107
1096
  }
1108
1097
  case "$text": {
1109
1098
  const r = o.props;
1110
- return new Ee({
1099
+ return new Me({
1111
1100
  value: r.value
1112
1101
  });
1113
1102
  }
1114
1103
  case "$cond": {
1115
1104
  const r = o.props;
1116
- return new me({
1105
+ return new Ce({
1117
1106
  $predicate: r.$predicate,
1118
1107
  thenContent: r.thenContent,
1119
1108
  elseContent: r.elseContent,
1120
- elementContext: e
1109
+ elementContext: t
1121
1110
  });
1122
1111
  }
1123
1112
  case "$repeat": {
@@ -1126,7 +1115,7 @@ function S(t, e) {
1126
1115
  $items: r.$items,
1127
1116
  keyFn: r.keyFn,
1128
1117
  renderFn: r.renderFn,
1129
- elementContext: e
1118
+ elementContext: t
1130
1119
  });
1131
1120
  }
1132
1121
  case "$observer": {
@@ -1134,22 +1123,22 @@ function S(t, e) {
1134
1123
  return new $e({
1135
1124
  signals: r.signals,
1136
1125
  renderFn: r.renderFn,
1137
- elementContext: e
1126
+ elementContext: t
1138
1127
  });
1139
1128
  }
1140
1129
  case "$outlet": {
1141
1130
  const r = o.props;
1142
- return new ve({
1131
+ return new Ne({
1143
1132
  $children: r.$children,
1144
- elementContext: e
1133
+ elementContext: t
1145
1134
  });
1146
1135
  }
1147
1136
  case "$portal": {
1148
1137
  const r = o.props;
1149
- return new Ne({
1138
+ return new xe({
1150
1139
  content: r.content,
1151
1140
  parent: r.parent,
1152
- elementContext: e
1141
+ elementContext: t
1153
1142
  });
1154
1143
  }
1155
1144
  default:
@@ -1157,85 +1146,83 @@ function S(t, e) {
1157
1146
  throw new Error(`Unknown markup type: ${o.type}`);
1158
1147
  return new we({
1159
1148
  tag: o.type,
1160
- props: o.props,
1149
+ props: o.props ?? {},
1161
1150
  children: o.children,
1162
- elementContext: e
1151
+ elementContext: t
1163
1152
  });
1164
1153
  }
1165
1154
  else
1166
1155
  throw new TypeError(`Expected a string or view function. Got: ${o.type}`);
1167
1156
  });
1168
1157
  }
1169
- function T(t) {
1158
+ function M(t) {
1170
1159
  if (t.length === 1)
1171
1160
  return t[0];
1172
- const e = document.createComment("renderHandle");
1161
+ const e = document.createComment("Fragment");
1173
1162
  let n = !1;
1174
1163
  return {
1175
1164
  get node() {
1176
1165
  return e;
1177
1166
  },
1178
- get connected() {
1167
+ get isMounted() {
1179
1168
  return n;
1180
1169
  },
1181
- connect(o, r) {
1170
+ mount(o, r) {
1182
1171
  var s;
1183
1172
  o.insertBefore(e, r || null);
1184
1173
  for (const i of t) {
1185
- const l = ((s = t[t.length - 1]) == null ? void 0 : s.node) ?? e;
1186
- i.connect(o, l);
1174
+ const c = ((s = t[t.length - 1]) == null ? void 0 : s.node) ?? e;
1175
+ i.mount(o, c);
1187
1176
  }
1188
1177
  n = !0;
1189
1178
  },
1190
- disconnect() {
1179
+ unmount() {
1191
1180
  if (n) {
1192
1181
  for (const o of t)
1193
- o.disconnect();
1182
+ o.unmount();
1194
1183
  e.remove();
1195
1184
  }
1196
1185
  n = !1;
1197
- },
1198
- setChildren() {
1199
- throw new Error("setChildren not supported on renderHandle");
1200
1186
  }
1201
1187
  };
1202
1188
  }
1203
- function re(t) {
1204
- return t == null || t === !1 || typeof t == "string" || typeof t == "number" || P(t) || w(t) || D(re, t);
1189
+ function se(t) {
1190
+ return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) || b(t) || z(se, t);
1205
1191
  }
1206
1192
  function He(t, e) {
1207
1193
  return e.outlet();
1208
1194
  }
1209
1195
  export {
1210
- qe as A,
1211
- _e as B,
1212
- Re as C,
1213
- He as F,
1214
- w as a,
1215
- L as b,
1216
- E as c,
1217
- ge as d,
1218
- O as e,
1219
- F as f,
1220
- Fe as g,
1221
- Ve as h,
1222
- G as i,
1223
- x as j,
1224
- T as k,
1196
+ x as A,
1197
+ qe as B,
1198
+ Ke as C,
1199
+ Be as D,
1200
+ He as P,
1201
+ b as a,
1202
+ I as b,
1203
+ Re as c,
1204
+ ye as d,
1205
+ E as e,
1206
+ A as f,
1207
+ O as g,
1208
+ _e as h,
1209
+ L as i,
1210
+ Ve as j,
1211
+ Oe as k,
1225
1212
  Ie as l,
1226
1213
  Le as m,
1227
- V as n,
1228
- Be as o,
1214
+ T as n,
1215
+ We as o,
1229
1216
  oe as p,
1230
1217
  Pe as q,
1231
- S as r,
1218
+ N as r,
1232
1219
  J as s,
1233
1220
  Ge as t,
1234
- ee as u,
1235
- Ue as v,
1236
- q as w,
1221
+ Ue as u,
1222
+ Fe as v,
1223
+ G as w,
1237
1224
  je as x,
1238
- Me as y,
1239
- pe as z
1225
+ ee as y,
1226
+ M as z
1240
1227
  };
1241
- //# sourceMappingURL=fragment-DHJiX0-a.js.map
1228
+ //# sourceMappingURL=passthrough-DrtCifRF.js.map