@manyducks.co/dolla 2.0.0-alpha.6 → 2.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,62 +1,62 @@
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
- function le(t) {
1
+ var se = Object.defineProperty;
2
+ var ue = (t, e, n) => e in t ? se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var f = (t, e, n) => ue(t, typeof e != "symbol" ? e + "" : e, n);
4
+ function ce(t) {
5
5
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
6
6
  }
7
- var U = { exports: {} }, H;
7
+ var U = { exports: {} }, z;
8
8
  function ae() {
9
- return H || (H = 1, function(t, e) {
9
+ return z || (z = 1, function(t, e) {
10
10
  Object.defineProperty(e, "__esModule", { value: !0 });
11
11
  var n = /* @__PURE__ */ function() {
12
- function u(a, d) {
13
- var h = [], b = !0, C = !1, v = void 0;
12
+ function u(l, d) {
13
+ var h = [], b = !0, C = !1, k = void 0;
14
14
  try {
15
- for (var $, k = a[Symbol.iterator](); !(b = ($ = k.next()).done) && (h.push($.value), !(d && h.length === d)); b = !0) ;
16
- } catch (m) {
17
- C = !0, v = m;
15
+ for (var $, v = l[Symbol.iterator](); !(b = ($ = v.next()).done) && (h.push($.value), !(d && h.length === d)); b = !0) ;
16
+ } catch (g) {
17
+ C = !0, k = g;
18
18
  } finally {
19
19
  try {
20
- !b && k.return && k.return();
20
+ !b && v.return && v.return();
21
21
  } finally {
22
- if (C) throw v;
22
+ if (C) throw k;
23
23
  }
24
24
  }
25
25
  return h;
26
26
  }
27
- return function(a, d) {
28
- if (Array.isArray(a)) return a;
29
- if (Symbol.iterator in Object(a)) return u(a, d);
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
32
  }(), o = function(u) {
33
- return u.reduce(function(a, d) {
34
- return 16 > d ? a + "0" + d.toString(16) : a + d.toString(16);
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(u, a, d) {
37
- var h = 0.5 > d ? d * (1 + a) : d + a - d * a, b = 2 * d - h, C = function(m, p, l) {
38
- var y = Math.round, g = 0 > l ? l + 1 : 1 < l ? l - 1 : l;
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
- }, v = C(b, h, u + 1 / 3), $ = C(b, h, u), k = C(b, h, u - 1 / 3);
41
- return [v, $, k];
42
- }, i = function(u, a, d, h) {
43
- var b = u % 1007 / 1007, C = function(m, p, l) {
44
- return m * (l - p) + p;
45
- }, v = C(b, a.min, a.max), $ = C(b, d.min, d.max), k = C(b, h.max, h.min);
46
- return [v, $, k];
36
+ }, r = function(u, l, d) {
37
+ var h = 0.5 > d ? d * (1 + l) : d + l - d * l, b = 2 * d - h, C = function(g, m, a) {
38
+ var p = Math.round, y = 0 > a ? a + 1 : 1 < a ? a - 1 : a;
39
+ return y = y < 1 / 6 ? g + 6 * (m - g) * y : y < 1 / 2 ? m : y < 2 / 3 ? g + 6 * (m - g) * (2 / 3 - y) : g, p(255 * y);
40
+ }, k = C(b, h, u + 1 / 3), $ = C(b, h, u), v = C(b, h, u - 1 / 3);
41
+ return [k, $, v];
42
+ }, i = function(u, l, d, h) {
43
+ var b = u % 1007 / 1007, C = function(g, m, a) {
44
+ return g * (a - m) + m;
45
+ }, k = C(b, l.min, l.max), $ = C(b, d.min, d.max), v = C(b, h.max, h.min);
46
+ return [k, $, v];
47
47
  }, s = function(u) {
48
- return u.split("").reduce(function(a, d, h) {
49
- return a * d.charCodeAt(0) * h + 1;
48
+ return u.split("").reduce(function(l, d, h) {
49
+ return l * d.charCodeAt(0) * h + 1;
50
50
  }, 1);
51
51
  }, c = function(u) {
52
- var a = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, b = u.sat, C = b === void 0 ? { min: 0.35, max: 0.65 } : b, v = u.light, $ = v === void 0 ? { min: 0.3, max: 0.7 } : v, k = u.hashFunction, m = k === void 0 ? s : k, p = u.scheme, l = p === void 0 ? "hex" : p, y = i(m(a), h, C, $), g = n(y, 3), S = g[0], F = g[1], K = g[2], W = r(S / 360, F, K), se = o(W);
53
- return l === "hsl" ? [S, F, K] : l === "rgb" ? W : se;
52
+ var l = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, b = u.sat, C = b === void 0 ? { min: 0.35, max: 0.65 } : b, k = u.light, $ = k === void 0 ? { min: 0.3, max: 0.7 } : k, v = u.hashFunction, g = v === void 0 ? s : v, m = u.scheme, a = m === void 0 ? "hex" : m, p = i(g(l), h, C, $), y = n(p, 3), N = y[0], P = y[1], W = y[2], H = r(N / 360, P, W), ie = o(H);
53
+ return a === "hsl" ? [N, P, W] : a === "rgb" ? H : ie;
54
54
  };
55
55
  e.default = c, t.exports = e.default;
56
56
  }(U, U.exports)), U.exports;
57
57
  }
58
- var de = ae();
59
- const fe = /* @__PURE__ */ le(de);
58
+ var le = ae();
59
+ const de = /* @__PURE__ */ ce(le);
60
60
  function _(t) {
61
61
  if (t === void 0)
62
62
  return "undefined";
@@ -67,23 +67,23 @@ function _(t) {
67
67
  case "number":
68
68
  return isNaN(t) ? "NaN" : "number";
69
69
  case "function":
70
- return Y(t) ? "class" : e;
70
+ return J(t) ? "class" : e;
71
71
  case "object":
72
- return P(t) ? "array" : pe(t) ? "promise" : e;
72
+ return F(t) ? "array" : he(t) ? "promise" : e;
73
73
  default:
74
74
  return e;
75
75
  }
76
76
  }
77
- function P(t) {
77
+ function F(t) {
78
78
  return Array.isArray(t);
79
79
  }
80
- function Z(...t) {
81
- const e = t[0], n = (o) => P(o) && o.every((r) => e(r));
80
+ function Y(...t) {
81
+ const e = t[0], n = (o) => F(o) && o.every((r) => e(r));
82
82
  return t.length < 2 ? n : n(t[1]);
83
83
  }
84
84
  function Fe(...t) {
85
85
  const e = t[0], n = M(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
86
- if (P(r) && r.every((i) => e(i)))
86
+ if (F(r) && r.every((i) => e(i)))
87
87
  return !0;
88
88
  throw new TypeError(R(r, n));
89
89
  };
@@ -92,26 +92,26 @@ function Fe(...t) {
92
92
  function M(t) {
93
93
  return typeof t == "string";
94
94
  }
95
- function je(t, e) {
95
+ function Pe(t, e) {
96
96
  if (M(t))
97
97
  return !0;
98
98
  throw new TypeError(R(t, e ?? "Expected a string. Got type: %t, value: %v"));
99
99
  }
100
100
  function E(t) {
101
- return typeof t == "function" && !Y(t);
101
+ return typeof t == "function" && !J(t);
102
102
  }
103
- function he(t) {
103
+ function fe(t) {
104
104
  return typeof t == "number" && !isNaN(t);
105
105
  }
106
- function pe(t) {
106
+ function he(t) {
107
107
  if (t == null) return !1;
108
108
  const e = t;
109
109
  return e instanceof Promise || E(e.then) && E(e.catch) && E(e.finally);
110
110
  }
111
- function Y(t) {
111
+ function J(t) {
112
112
  return typeof t == "function" && /^\s*class\s+/.test(t.toString());
113
113
  }
114
- function Ue(...t) {
114
+ function je(...t) {
115
115
  const e = t[0], n = M(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;
@@ -120,16 +120,16 @@ function Ue(...t) {
120
120
  return t.length < 2 ? o : o(t[1]);
121
121
  }
122
122
  function L(t) {
123
- return t != null && typeof t == "object" && !P(t);
123
+ return t != null && typeof t == "object" && !F(t);
124
124
  }
125
125
  function R(t, e) {
126
126
  var r;
127
127
  const n = _(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 me = () => {
130
+ const pe = () => {
131
131
  };
132
- function z(t) {
132
+ function D(t) {
133
133
  return t != null && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) === Object.getPrototypeOf({});
134
134
  }
135
135
  function I(t, e) {
@@ -137,7 +137,7 @@ function I(t, e) {
137
137
  return !0;
138
138
  if (w(t) || w(e))
139
139
  return !1;
140
- if (z(t) && z(e)) {
140
+ if (D(t) && D(e)) {
141
141
  const n = Object.keys(t), o = Object.keys(e);
142
142
  if (n.length !== o.length)
143
143
  return !1;
@@ -156,7 +156,7 @@ function I(t, e) {
156
156
  }
157
157
  return t === e;
158
158
  }
159
- function ye(t, e) {
159
+ function me(t, e) {
160
160
  const n = (o) => {
161
161
  const r = {};
162
162
  for (const i in o)
@@ -165,20 +165,20 @@ function ye(t, e) {
165
165
  };
166
166
  return e == null ? n : n(e);
167
167
  }
168
- function Ie() {
168
+ function Ue() {
169
169
  if (typeof window < "u" && window.console)
170
170
  return window.console;
171
171
  if (typeof global < "u" && global.console)
172
172
  return global.console;
173
173
  }
174
- function Le(t) {
175
- return fe({
174
+ function Ie(t) {
175
+ return de({
176
176
  str: t,
177
177
  sat: { min: 0.35, max: 0.55 },
178
178
  light: { min: 0.6, max: 0.6 }
179
179
  });
180
180
  }
181
- function qe(t) {
181
+ function Le(t) {
182
182
  if (t instanceof RegExp)
183
183
  return (o) => t.test(o);
184
184
  const e = {
@@ -218,11 +218,11 @@ function q(t) {
218
218
  return t;
219
219
  },
220
220
  watch(e, n = {}) {
221
- return n != null && n.lazy || e(t), me;
221
+ return n != null && n.lazy || e(t), pe;
222
222
  }
223
223
  };
224
224
  }
225
- function Ge(t, e) {
225
+ function qe(t, e) {
226
226
  const [n, o] = T(t, e);
227
227
  return {
228
228
  get: n.get,
@@ -230,14 +230,14 @@ function Ge(t, e) {
230
230
  set: o
231
231
  };
232
232
  }
233
- function _e(t, e) {
233
+ function Ge(t, e) {
234
234
  return {
235
235
  get: t.get,
236
236
  watch: t.watch,
237
237
  set: e
238
238
  };
239
239
  }
240
- function Re(t, e) {
240
+ function _e(t, e) {
241
241
  return function(o) {
242
242
  const r = t.get();
243
243
  let i;
@@ -250,105 +250,103 @@ function T(t, e) {
250
250
  for (const u of o)
251
251
  u(n);
252
252
  }
253
- function i(u, a) {
254
- return e != null && e.equality ? e.equality(u, a) : I(u, a);
253
+ function i(u, l) {
254
+ return e != null && e.equality ? e.equality(u, l) : I(u, l);
255
255
  }
256
256
  const s = {
257
257
  get() {
258
258
  return O(n);
259
259
  },
260
- watch(u, a) {
261
- return o.push(u), a != null && a.lazy || u(s.get()), function() {
260
+ watch(u, l) {
261
+ return o.push(u), l != null && l.lazy || u(s.get()), function() {
262
262
  o.splice(o.indexOf(u), 1);
263
263
  };
264
264
  }
265
265
  };
266
266
  function c(u) {
267
- let a;
268
- typeof u == "function" ? a = u(n) : a = u, i(a, n) || (n = a, r());
267
+ let l;
268
+ typeof u == "function" ? l = u(n) : l = u, i(l, n) || (n = l, r());
269
269
  }
270
270
  return [s, c];
271
271
  }
272
- const ge = Symbol("EMPTY");
273
- function be(t, e, n) {
272
+ const ye = Symbol("EMPTY");
273
+ function ge(t, e, n) {
274
274
  t = t.map(q);
275
- let o = new Array(t.length).fill(ge, 0, t.length), r, i = [], s = !1, c = [], u, a;
276
- function d(p = C()) {
277
- for (const l of i)
278
- l(p);
275
+ let o = new Array(t.length).fill(ye, 0, t.length), r, i = [], s = !1, c = [], u, l;
276
+ function d(m = C()) {
277
+ for (const a of i)
278
+ a(m);
279
279
  }
280
- function h(p, l) {
281
- return n != null && n.equality ? n.equality(p, l) : I(p, l);
280
+ function h(m, a) {
281
+ return n != null && n.equality ? n.equality(m, a) : I(m, a);
282
282
  }
283
283
  function b() {
284
- const p = t.map((l) => l.get());
285
- for (let l = 0; l < t.length; l++)
286
- if (!h(p[l], o[l])) {
287
- v(e(...p)), o = p;
284
+ const m = t.map((a) => a.get());
285
+ for (let a = 0; a < t.length; a++)
286
+ if (!h(m[a], o[a])) {
287
+ k(e(...m)), o = m;
288
288
  break;
289
289
  }
290
290
  }
291
291
  function C() {
292
- return s || b(), a = O(r), a;
292
+ return s || b(), l = O(r), l;
293
293
  }
294
- function v(p) {
295
- p !== r && (u && (u(), u = void 0), r = p, a = O(p), w(p) && s && (u = p.watch((l) => {
296
- const y = O(l);
297
- h(y, a) || (a = y, d(y));
294
+ function k(m) {
295
+ m !== r && (u && (u(), u = void 0), r = m, l = O(m), w(m) && s && (u = m.watch((a) => {
296
+ const p = O(a);
297
+ h(p, l) || (l = p, d(p));
298
298
  })));
299
299
  }
300
300
  function $() {
301
- let p = [...o];
302
- for (let l = 0; l < t.length; l++) {
303
- const y = t[l];
301
+ let m = [...o];
302
+ for (let a = 0; a < t.length; a++) {
303
+ const p = t[a];
304
304
  c.push(
305
- y.watch((g) => {
306
- const S = o[l];
307
- o[l] = g, s && !h(g, S) && (v(e(...o)), d(O(r)));
305
+ p.watch((y) => {
306
+ const N = o[a];
307
+ o[a] = y, s && !h(y, N) && (k(e(...o)), d(O(r)));
308
308
  })
309
309
  );
310
310
  }
311
311
  s = !0;
312
- for (let l = 0; l < t.length; l++)
313
- if (!h(o[l], p[l])) {
314
- v(e(...o)), d(O(r));
312
+ for (let a = 0; a < t.length; a++)
313
+ if (!h(o[a], m[a])) {
314
+ k(e(...o)), d(O(r));
315
315
  break;
316
316
  }
317
317
  }
318
- function k() {
319
- for (const p of c)
320
- p();
318
+ function v() {
319
+ for (const m of c)
320
+ m();
321
321
  c = [], u && (u(), u = void 0), s = !1;
322
322
  }
323
323
  return {
324
324
  get() {
325
325
  return C();
326
326
  },
327
- watch(p, l) {
328
- return s || $(), i.push(p), l != null && l.lazy || p(C()), function() {
329
- i.splice(i.indexOf(p), 1), s && i.length === 0 && k();
327
+ watch(m, a) {
328
+ return s || $(), i.push(m), a != null && a.lazy || m(C()), function() {
329
+ i.splice(i.indexOf(m), 1), s && i.length === 0 && v();
330
330
  };
331
331
  }
332
332
  };
333
333
  }
334
334
  function G(t, e) {
335
335
  if (t.length === 0)
336
- throw new TypeError("Expected at least one state.");
337
- if (t.some((n) => !w(n)))
338
- throw new TypeError("All values must be states");
339
- return t = t.map(q), t.length > 1 ? be(t, e).watch(() => null) : t[0].watch(e);
336
+ throw new TypeError("Expected at least one state to watch.");
337
+ return t = t.map(q), t.length > 1 ? ge(t, e).watch(() => null) : t[0].watch(e);
340
338
  }
341
- function Ce(t) {
339
+ function be(t) {
342
340
  for (var e, n, o = arguments, r = 1, i = "", s = "", c = [0], u = function(h) {
343
341
  r === 1 && (h || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(h ? o[h] : i) : r === 3 && (h || i) ? (c[1] = h ? o[h] : i, r = 2) : r === 2 && i === "..." && h ? c[2] = Object.assign(c[2] || {}, o[h]) : r === 2 && i && !h ? (c[2] = c[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = h ? i ? i + o[h] : o[h] : i, r = 6) : (h || i) && (c[2][n] += h ? i + o[h] : i)), i = "";
344
- }, a = 0; a < t.length; a++) {
345
- a && (r === 1 && u(), u(a));
346
- for (var d = 0; d < t[a].length; d++) e = t[a][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : i += e : r === 4 ? i === "--" && e === ">" ? (r = 1, i = "") : i = e + i[0] : s ? e === s ? s = "" : i += e : e === '"' || e === "'" ? s = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = i, i = "") : e === "/" && (r < 5 || t[a][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 === `
342
+ }, l = 0; l < t.length; l++) {
343
+ l && (r === 1 && u(), u(l));
344
+ for (var d = 0; d < t[l].length; d++) e = t[l][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : i += e : r === 4 ? i === "--" && e === ">" ? (r = 1, i = "") : i = e + i[0] : s ? e === s ? s = "" : i += e : e === '"' || e === "'" ? s = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = i, i = "") : 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 === `
347
345
  ` || e === "\r" ? (u(), r = 2) : i += e), r === 3 && i === "!--" && (r = 4, c = c[0]);
348
346
  }
349
347
  return u(), c.length > 2 ? c.slice(1) : c[1];
350
348
  }
351
- class we {
349
+ class Ce {
352
350
  constructor(e) {
353
351
  f(this, "node");
354
352
  f(this, "endNode");
@@ -382,7 +380,7 @@ class we {
382
380
  for (const o of this.connectedContent)
383
381
  o.unmount();
384
382
  if (this.connectedContent = [], this.node.parentNode != null) {
385
- e && this.thenContent ? this.connectedContent = x(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = x(this.elementContext, this.elseContent));
383
+ e && this.thenContent ? this.connectedContent = S(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = S(this.elementContext, this.elseContent));
386
384
  for (let o = 0; o < this.connectedContent.length; o++) {
387
385
  const r = this.connectedContent[o], i = ((n = this.connectedContent[o - 1]) == null ? void 0 : n.node) ?? this.node;
388
386
  r.mount(this.node.parentNode, i);
@@ -391,35 +389,35 @@ class we {
391
389
  }
392
390
  }
393
391
  }
394
- const ve = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
395
- let J = (t = 21) => {
392
+ const we = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
393
+ let Q = (t = 21) => {
396
394
  let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
397
395
  for (; t--; )
398
- e += ve[n[t] & 63];
396
+ e += we[n[t] & 63];
399
397
  return e;
400
398
  };
401
399
  const ke = (t) => /^on[A-Z]/.test(t);
402
- class $e {
400
+ class ve {
403
401
  constructor({ tag: e, props: n, children: o, elementContext: r }) {
404
402
  f(this, "node");
405
403
  f(this, "props");
406
404
  f(this, "children");
407
405
  f(this, "stopCallbacks", []);
408
406
  f(this, "elementContext");
409
- f(this, "uniqueId", J());
407
+ f(this, "uniqueId", Q());
410
408
  // Track the ref so we can nullify it on unmount.
411
409
  f(this, "ref");
412
410
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
413
411
  f(this, "canClickAway", !1);
414
412
  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)
415
- if (oe(n.ref))
413
+ if (ne(n.ref))
416
414
  this.ref = n.ref;
417
415
  else
418
416
  throw new Error("Expected ref to be a Ref object. Got: " + n.ref);
419
417
  this.props = {
420
- ...ye(["ref", "class", "className"], n),
418
+ ...me(["ref", "class", "className"], n),
421
419
  class: n.className ?? n.class
422
- }, this.children = o ? x(r, o) : [], this.elementContext = r;
420
+ }, this.children = o ? S(r, o) : [], this.elementContext = r;
423
421
  }
424
422
  get isMounted() {
425
423
  return this.node.parentNode != null;
@@ -477,7 +475,7 @@ class $e {
477
475
  } else if (r === "eventListeners") {
478
476
  const s = i;
479
477
  for (const c in s) {
480
- const u = w(i) ? (a) => i.get()(a) : i;
478
+ const u = w(i) ? (l) => i.get()(l) : i;
481
479
  e.addEventListener(c, u), this.stopCallbacks.push(() => {
482
480
  e.removeEventListener(c, u);
483
481
  });
@@ -500,7 +498,7 @@ class $e {
500
498
  this.getUpdateKey("attr", "value")
501
499
  );
502
500
  const s = (c) => {
503
- const u = Ne(i.get(), c.currentTarget.value);
501
+ const u = $e(i.get(), c.currentTarget.value);
504
502
  i.set(u);
505
503
  };
506
504
  e.addEventListener("input", s), this.stopCallbacks.push(() => {
@@ -519,7 +517,7 @@ class $e {
519
517
  },
520
518
  this.getUpdateKey("attr", r)
521
519
  );
522
- else if (!xe.includes(r))
520
+ else if (!Ne.includes(r))
523
521
  if (this.elementContext.isSVG)
524
522
  o(
525
523
  i,
@@ -610,16 +608,16 @@ class $e {
610
608
  });
611
609
  o.push(s), r.push(s);
612
610
  } else {
613
- const i = X(n);
611
+ const i = ee(n);
614
612
  for (const s in i) {
615
613
  const { value: c, priority: u } = i[s];
616
614
  if (w(c)) {
617
- const a = c.watch((d) => {
615
+ const l = c.watch((d) => {
618
616
  this.elementContext.root.render.update(() => {
619
617
  d ? e.style.setProperty(s, String(d), u) : e.style.removeProperty(s);
620
618
  });
621
619
  });
622
- o.push(a), r.push(a);
620
+ o.push(l), r.push(l);
623
621
  } else c != null && e.style.setProperty(s, String(c));
624
622
  }
625
623
  }
@@ -642,13 +640,13 @@ class $e {
642
640
  });
643
641
  o.push(s), r.push(s);
644
642
  } else {
645
- const i = Q(n);
643
+ const i = X(n);
646
644
  for (const s in i) {
647
645
  const c = i[s];
648
646
  if (w(c)) {
649
- const u = c.watch((a) => {
647
+ const u = c.watch((l) => {
650
648
  this.elementContext.root.render.update(() => {
651
- a ? e.classList.add(s) : e.classList.remove(s);
649
+ l ? e.classList.add(s) : e.classList.remove(s);
652
650
  });
653
651
  });
654
652
  o.push(u), r.push(u);
@@ -661,18 +659,18 @@ class $e {
661
659
  };
662
660
  }
663
661
  }
664
- function Q(t) {
662
+ function X(t) {
665
663
  let e = {};
666
664
  if (M(t)) {
667
665
  const n = t.split(" ");
668
666
  for (const o of n)
669
667
  e[o] = !0;
670
668
  } else L(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
671
- Object.assign(e, Q(n));
669
+ Object.assign(e, X(n));
672
670
  });
673
671
  return e;
674
672
  }
675
- function X(t) {
673
+ function ee(t) {
676
674
  let e = {};
677
675
  if (M(t)) {
678
676
  const n = t.split(";").filter((o) => o.trim() !== "");
@@ -680,26 +678,26 @@ function X(t) {
680
678
  const [r, i] = o.split(":"), s = {
681
679
  value: i
682
680
  };
683
- i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[D(r.trim())] = s;
681
+ i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[Z(r.trim())] = s;
684
682
  }
685
683
  }
686
684
  if (L(t))
687
685
  for (const n in t)
688
- n.startsWith("--") ? e[n] = { value: t[n] } : e[D(n)] = { value: t[n] };
686
+ n.startsWith("--") ? e[n] = { value: t[n] } : e[Z(n)] = { value: t[n] };
689
687
  else Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
690
- Object.assign(e, X(n));
688
+ Object.assign(e, ee(n));
691
689
  });
692
690
  return e;
693
691
  }
694
- function D(t) {
692
+ function Z(t) {
695
693
  return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, n) => (n ? "-" : "") + e.toLowerCase());
696
694
  }
697
- function Ne(t, e) {
695
+ function $e(t, e) {
698
696
  const n = typeof t;
699
697
  return n === "string" ? String(e) : n === "number" ? Number(e) : n === "boolean" ? !!e : e;
700
698
  }
701
- const xe = ["ref", "children", "class", "style", "data"];
702
- class Se {
699
+ const Ne = ["ref", "children", "class", "style", "data"];
700
+ class xe {
703
701
  constructor({ states: e, renderFn: n, elementContext: o }) {
704
702
  f(this, "node");
705
703
  f(this, "endNode");
@@ -713,7 +711,7 @@ class Se {
713
711
  start: () => {
714
712
  r == null && (r = G(e, (...i) => {
715
713
  const s = this.renderFn(...i);
716
- if (!ie(s))
714
+ if (!re(s))
717
715
  throw console.error(s), new TypeError(
718
716
  `Observer received invalid value to render. Got type: ${_(s)}, value: ${s}`
719
717
  );
@@ -744,7 +742,7 @@ class Se {
744
742
  var o, r;
745
743
  if (this.cleanup(), e == null || !this.isMounted)
746
744
  return;
747
- const n = e.map((i) => ne(i) ? i : V(i) ? A(x(this.elementContext, i)) : A(x(this.elementContext, j(i))));
745
+ const n = e.map((i) => te(i) ? i : V(i) ? A(S(this.elementContext, i)) : A(S(this.elementContext, j(i))));
748
746
  for (const i of n) {
749
747
  const s = ((o = this.connectedViews.at(-1)) == null ? void 0 : o.node) || this.node;
750
748
  i.mount(this.node.parentNode, s), this.connectedViews.push(i);
@@ -755,7 +753,7 @@ class Se {
755
753
  }
756
754
  }
757
755
  }
758
- class Ee {
756
+ class Se {
759
757
  constructor(e) {
760
758
  f(this, "node");
761
759
  f(this, "endNode");
@@ -796,7 +794,7 @@ class Ee {
796
794
  ));
797
795
  }
798
796
  }
799
- class Ae {
797
+ class Ee {
800
798
  constructor(e) {
801
799
  f(this, "config");
802
800
  f(this, "handle");
@@ -807,110 +805,136 @@ class Ae {
807
805
  }
808
806
  mount(e, n) {
809
807
  const { content: o, parent: r } = this.config;
810
- ne(o) ? this.handle = o : V(o) ? this.handle = A(x(this.config.elementContext, o)) : this.handle = A(x(this.config.elementContext, j(o))), this.handle.mount(r);
808
+ te(o) ? this.handle = o : V(o) ? this.handle = A(S(this.config.elementContext, o)) : this.handle = A(S(this.config.elementContext, j(o))), this.handle.mount(r);
811
809
  }
812
810
  unmount() {
813
811
  var e;
814
812
  (e = this.handle) != null && e.isMounted && this.handle.unmount();
815
813
  }
816
814
  }
817
- function ee(t, e, n, o = []) {
818
- t = { ...t };
819
- const [r, i] = T(x(t, o));
815
+ function K(t, e, n, o = []) {
816
+ t = { ...t, data: {}, parent: t };
817
+ const [r, i] = T(S(t, o));
820
818
  let s = !1;
821
- const c = [], u = [], a = [], d = [], h = [], b = J(), [C, v] = T(e.name), $ = t.root.createLogger(C, { uid: b }), k = {
819
+ const c = [], u = [], l = [], d = [], h = [], b = Q(), [C, k] = T(e.name), $ = t.root.createLogger(C, { uid: b }), v = {
822
820
  get uid() {
823
821
  return b;
824
822
  },
825
- setName(l) {
826
- v(l);
823
+ set(a, p) {
824
+ t.data[a] = p;
825
+ },
826
+ get(a) {
827
+ let p = t;
828
+ for (; ; ) {
829
+ if (a in p.data)
830
+ return p.data[a];
831
+ if (p.parent)
832
+ p = p.parent;
833
+ else
834
+ break;
835
+ }
836
+ return null;
837
+ },
838
+ getAll() {
839
+ const a = [];
840
+ let p = t;
841
+ for (; a.push(p.data), p.parent; )
842
+ p = p.parent;
843
+ const y = {};
844
+ for (const N of a.reverse())
845
+ Object.assign(y, N);
846
+ return y;
847
+ },
848
+ setName(a) {
849
+ k(a);
827
850
  },
828
- beforeMount(l) {
829
- u.push(l);
851
+ beforeMount(a) {
852
+ u.push(a);
830
853
  },
831
- onMount(l) {
832
- a.push(l);
854
+ onMount(a) {
855
+ l.push(a);
833
856
  },
834
- beforeUnmount(l) {
835
- d.push(l);
857
+ beforeUnmount(a) {
858
+ d.push(a);
836
859
  },
837
- onUnmount(l) {
838
- h.push(l);
860
+ onUnmount(a) {
861
+ h.push(a);
839
862
  },
840
- watch(l, y) {
863
+ watch(a, p) {
841
864
  if (s) {
842
- const g = G(l, y);
843
- return c.push(g), g;
865
+ const y = G(a, p);
866
+ return c.push(y), y;
844
867
  } else {
845
- let g, S = !1;
846
- return a.push(() => {
847
- S || (g = G(l, y), c.push(g));
848
- }), function F() {
849
- F != null && (S = !0, F());
868
+ let y, N = !1;
869
+ return l.push(() => {
870
+ N || (y = G(a, p), c.push(y));
871
+ }), function P() {
872
+ P != null && (N = !0, P());
850
873
  };
851
874
  }
852
875
  },
853
876
  outlet() {
854
- return N("$outlet", { $children: r });
877
+ return x("$outlet", { $children: r });
855
878
  }
856
879
  };
857
- Object.assign(k, $);
858
- let m;
859
- function p() {
860
- let l;
880
+ Object.assign(v, $);
881
+ let g;
882
+ function m() {
883
+ let a;
861
884
  try {
862
- l = e(n, k);
863
- } catch (y) {
864
- throw y instanceof Error && $.crash(y), y;
885
+ a = e(n, v);
886
+ } catch (p) {
887
+ throw p instanceof Error && $.crash(p), p;
865
888
  }
866
- if (l instanceof Promise)
889
+ if (a instanceof Promise)
867
890
  throw new TypeError("View function cannot return a Promise.");
868
- if (l !== null) if (l instanceof Node)
869
- m = A(x(t, N("$node", { value: l })));
870
- else if (V(l) || Z(V, l))
871
- m = A(x(t, l));
872
- else if (w(l))
873
- m = A(
874
- x(t, N("$observer", { states: [l], renderFn: (y) => y }))
891
+ if (a !== null) if (a instanceof Node)
892
+ g = A(S(t, x("$node", { value: a })));
893
+ else if (V(a) || Y(V, a))
894
+ g = A(S(t, a));
895
+ else if (w(a))
896
+ g = A(
897
+ S(t, x("$observer", { states: [a], renderFn: (p) => p }))
875
898
  );
876
899
  else {
877
- const y = new TypeError(
878
- `Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${_(l)}`
900
+ const p = new TypeError(
901
+ `Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${_(a)}`
879
902
  );
880
- $.crash(y);
903
+ $.crash(p);
881
904
  }
882
905
  }
883
906
  return {
884
907
  get node() {
885
- return m == null ? void 0 : m.node;
908
+ return g == null ? void 0 : g.node;
886
909
  },
887
910
  get isMounted() {
888
911
  return s;
889
912
  },
890
- mount(l, y) {
891
- const g = s;
892
- if (!g)
893
- for (p(); u.length > 0; )
913
+ mount(a, p) {
914
+ const y = s;
915
+ if (!y)
916
+ for (m(); u.length > 0; )
894
917
  u.shift()();
895
- m && m.mount(l, y), g || (s = !0, requestAnimationFrame(() => {
896
- for (; a.length > 0; )
897
- a.shift()();
918
+ g && g.mount(a, p), y || (s = !0, requestAnimationFrame(() => {
919
+ for (; l.length > 0; )
920
+ l.shift()();
898
921
  }));
899
922
  },
900
923
  unmount() {
901
924
  for (; d.length > 0; )
902
925
  d.shift()();
903
- for (m && m.unmount(), s = !1; h.length > 0; )
926
+ for (g && g.unmount(), s = !1; h.length > 0; )
904
927
  h.shift()();
905
928
  for (; c.length > 0; )
906
929
  c.shift()();
907
930
  },
908
- setChildren(l) {
909
- i(l);
931
+ setChildView(a) {
932
+ const p = K(t, a, {});
933
+ return i([p]), p;
910
934
  }
911
935
  };
912
936
  }
913
- class Me {
937
+ class Ae {
914
938
  constructor({ elementContext: e, $items: n, renderFn: o, keyFn: r }) {
915
939
  f(this, "node");
916
940
  f(this, "endNode");
@@ -955,9 +979,9 @@ class Me {
955
979
  for (const u of this.connectedItems)
956
980
  n.find((d) => d.key === u.key) || u.handle.unmount();
957
981
  for (const u of n) {
958
- const a = this.connectedItems.find((d) => d.key === u.key);
959
- if (a)
960
- a.setValue(u.value), a.setIndex(u.index), r[u.index] = a;
982
+ const l = this.connectedItems.find((d) => d.key === u.key);
983
+ if (l)
984
+ l.setValue(u.value), l.setIndex(u.index), r[u.index] = l;
961
985
  else {
962
986
  const [d, h] = T(u.value), [b, C] = T(u.index);
963
987
  r[u.index] = {
@@ -966,7 +990,7 @@ class Me {
966
990
  setValue: h,
967
991
  $index: b,
968
992
  setIndex: C,
969
- handle: ee(this.elementContext, Oe, {
993
+ handle: K(this.elementContext, Me, {
970
994
  $value: d,
971
995
  $index: b,
972
996
  renderFn: this.renderFn
@@ -975,8 +999,8 @@ class Me {
975
999
  }
976
1000
  }
977
1001
  for (let u = 0; u < r.length; u++) {
978
- const a = r[u], d = ((i = r[u - 1]) == null ? void 0 : i.handle.node) ?? this.node;
979
- a.handle.mount(this.node.parentNode, d);
1002
+ const l = r[u], d = ((i = r[u - 1]) == null ? void 0 : i.handle.node) ?? this.node;
1003
+ l.handle.mount(this.node.parentNode, d);
980
1004
  }
981
1005
  if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
982
1006
  this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
@@ -985,10 +1009,10 @@ class Me {
985
1009
  }
986
1010
  }
987
1011
  }
988
- function Oe({ $value: t, $index: e, renderFn: n }, o) {
1012
+ function Me({ $value: t, $index: e, renderFn: n }, o) {
989
1013
  return n(t, e, o);
990
1014
  }
991
- class Te {
1015
+ class Oe {
992
1016
  constructor({ value: e }) {
993
1017
  f(this, "node", document.createTextNode(""));
994
1018
  f(this, "value", "");
@@ -1010,41 +1034,39 @@ class Te {
1010
1034
  e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
1011
1035
  }
1012
1036
  }
1013
- const te = Symbol("Markup");
1014
1037
  function V(t) {
1015
- return L(t) && t[te] === !0;
1038
+ return L(t) && (typeof t.type == "string" || typeof t.type == "function") && Array.isArray(t.children);
1016
1039
  }
1017
- function ne(t) {
1040
+ function te(t) {
1018
1041
  return L(t) && E(t.connect) && E(t.disconnect);
1019
1042
  }
1020
1043
  function j(t) {
1021
- return P(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1044
+ return F(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1022
1045
  if (e instanceof Node)
1023
- return N("$node", { value: e });
1024
- if (e instanceof re)
1025
- return N("$node", { value: e.node });
1046
+ return x("$node", { value: e });
1047
+ if (e instanceof oe)
1048
+ return x("$node", { value: e.node });
1026
1049
  if (V(e))
1027
1050
  return e;
1028
- if (M(e) || he(e))
1029
- return N("$text", { value: e });
1051
+ if (M(e) || fe(e))
1052
+ return x("$text", { value: e });
1030
1053
  if (w(e))
1031
- return N("$observer", {
1054
+ return x("$observer", {
1032
1055
  states: [e],
1033
1056
  renderFn: (n) => n
1034
1057
  });
1035
1058
  throw console.error(e), new TypeError(`Unexpected child type. Got: ${e}`);
1036
1059
  });
1037
1060
  }
1038
- function N(t, e, ...n) {
1039
- return e != null && Ve(e), {
1040
- [te]: !0,
1061
+ function x(t, e, ...n) {
1062
+ return e != null && Te(e), {
1041
1063
  type: t,
1042
1064
  props: e,
1043
1065
  children: j(n)
1044
1066
  };
1045
1067
  }
1046
- function Ve(t) {
1047
- if (t.ref && !oe(t.ref))
1068
+ function Te(t) {
1069
+ if (t.ref && !ne(t.ref))
1048
1070
  throw console.warn(t.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${t.ref}`);
1049
1071
  for (const e in t)
1050
1072
  if (e.startsWith("$$") && t[e] !== void 0) {
@@ -1053,23 +1075,23 @@ function Ve(t) {
1053
1075
  } else if (e.startsWith("$") && t[e] !== void 0 && !w(t[e]))
1054
1076
  throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${t[e]}`);
1055
1077
  }
1056
- const Be = Ce.bind(N);
1057
- function Ke(t, e, n) {
1078
+ const Re = be.bind(x);
1079
+ function Be(t, e, n) {
1058
1080
  const o = q(t);
1059
- return N("$cond", {
1081
+ return x("$cond", {
1060
1082
  $predicate: o,
1061
1083
  thenContent: e,
1062
1084
  elseContent: n
1063
1085
  });
1064
1086
  }
1065
- function We(t, e, n) {
1087
+ function Ke(t, e, n) {
1066
1088
  const o = q(t);
1067
- return N("$repeat", { $items: o, keyFn: e, renderFn: n });
1089
+ return x("$repeat", { $items: o, keyFn: e, renderFn: n });
1068
1090
  }
1069
- function He(t, e) {
1070
- return N("$portal", { parent: t, content: e });
1091
+ function We(t, e) {
1092
+ return x("$portal", { parent: t, content: e });
1071
1093
  }
1072
- function ze() {
1094
+ function He() {
1073
1095
  const [t, e] = T();
1074
1096
  return {
1075
1097
  get: t.get,
@@ -1082,10 +1104,10 @@ function ze() {
1082
1104
  }
1083
1105
  };
1084
1106
  }
1085
- function oe(t) {
1107
+ function ne(t) {
1086
1108
  return !(t == null || typeof t != "object" || !t.hasOwnProperty("node"));
1087
1109
  }
1088
- class re {
1110
+ class oe {
1089
1111
  constructor(e) {
1090
1112
  f(this, "node");
1091
1113
  this.node = e;
@@ -1100,25 +1122,25 @@ class re {
1100
1122
  this.node.parentNode && this.node.parentNode.removeChild(this.node);
1101
1123
  }
1102
1124
  }
1103
- function x(t, e) {
1104
- return (P(e) ? e : [e]).map((o) => {
1125
+ function S(t, e) {
1126
+ return (F(e) ? e : [e]).map((o) => {
1105
1127
  if (E(o.type))
1106
- return ee(t, o.type, o.props, o.children);
1128
+ return K(t, o.type, o.props, o.children);
1107
1129
  if (M(o.type))
1108
1130
  switch (o.type) {
1109
1131
  case "$node": {
1110
1132
  const r = o.props;
1111
- return new re(r.value);
1133
+ return new oe(r.value);
1112
1134
  }
1113
1135
  case "$text": {
1114
1136
  const r = o.props;
1115
- return new Te({
1137
+ return new Oe({
1116
1138
  value: r.value
1117
1139
  });
1118
1140
  }
1119
1141
  case "$cond": {
1120
1142
  const r = o.props;
1121
- return new we({
1143
+ return new Ce({
1122
1144
  $predicate: r.$predicate,
1123
1145
  thenContent: r.thenContent,
1124
1146
  elseContent: r.elseContent,
@@ -1127,7 +1149,7 @@ function x(t, e) {
1127
1149
  }
1128
1150
  case "$repeat": {
1129
1151
  const r = o.props;
1130
- return new Me({
1152
+ return new Ae({
1131
1153
  $items: r.$items,
1132
1154
  keyFn: r.keyFn,
1133
1155
  renderFn: r.renderFn,
@@ -1136,7 +1158,7 @@ function x(t, e) {
1136
1158
  }
1137
1159
  case "$observer": {
1138
1160
  const r = o.props;
1139
- return new Se({
1161
+ return new xe({
1140
1162
  states: r.states,
1141
1163
  renderFn: r.renderFn,
1142
1164
  elementContext: t
@@ -1144,14 +1166,14 @@ function x(t, e) {
1144
1166
  }
1145
1167
  case "$outlet": {
1146
1168
  const r = o.props;
1147
- return new Ee({
1169
+ return new Se({
1148
1170
  $children: r.$children,
1149
1171
  elementContext: t
1150
1172
  });
1151
1173
  }
1152
1174
  case "$portal": {
1153
1175
  const r = o.props;
1154
- return new Ae({
1176
+ return new Ee({
1155
1177
  content: r.content,
1156
1178
  parent: r.parent,
1157
1179
  elementContext: t
@@ -1160,7 +1182,7 @@ function x(t, e) {
1160
1182
  default:
1161
1183
  if (o.type.startsWith("$"))
1162
1184
  throw new Error(`Unknown markup type: ${o.type}`);
1163
- return new $e({
1185
+ return new ve({
1164
1186
  tag: o.type,
1165
1187
  props: o.props ?? {},
1166
1188
  children: o.children,
@@ -1202,43 +1224,43 @@ function A(t) {
1202
1224
  }
1203
1225
  };
1204
1226
  }
1205
- function ie(t) {
1206
- return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) || w(t) || Z(ie, t);
1227
+ function re(t) {
1228
+ return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) || w(t) || Y(re, t);
1207
1229
  }
1208
- function De(t, e) {
1230
+ function ze(t, e) {
1209
1231
  return e.outlet();
1210
1232
  }
1211
1233
  export {
1212
- x as A,
1213
- Re as B,
1214
- He as C,
1215
- We as D,
1216
- De as P,
1234
+ S as A,
1235
+ _e as B,
1236
+ We as C,
1237
+ Ke as D,
1238
+ ze as P,
1217
1239
  w as a,
1218
1240
  I as b,
1219
- Ke as c,
1220
- be as d,
1241
+ Be as c,
1242
+ ge as d,
1221
1243
  E as e,
1222
1244
  M as f,
1223
1245
  T as g,
1224
- Be as h,
1246
+ Re as h,
1225
1247
  L as i,
1226
- je as j,
1248
+ Pe as j,
1227
1249
  Fe as k,
1228
- qe as l,
1229
- Ge as m,
1230
- _e as n,
1231
- ze as o,
1232
- oe as p,
1233
- Ue as q,
1234
- N as r,
1235
- Ie as s,
1250
+ Le as l,
1251
+ qe as m,
1252
+ Ge as n,
1253
+ He as o,
1254
+ ne as p,
1255
+ je as q,
1256
+ x as r,
1257
+ Ue as s,
1236
1258
  q as t,
1237
- me as u,
1259
+ pe as u,
1238
1260
  O as v,
1239
1261
  G as w,
1240
- Le as x,
1241
- ee as y,
1262
+ Ie as x,
1263
+ K as y,
1242
1264
  A as z
1243
1265
  };
1244
- //# sourceMappingURL=passthrough-CW8Ezjg-.js.map
1266
+ //# sourceMappingURL=passthrough-BVaqqjam.js.map