keits 0.0.3 → 0.0.4

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.
Files changed (37) hide show
  1. package/dist/dev/api.js +270 -0
  2. package/dist/dev/forms.js +328 -0
  3. package/dist/dev/index.js +8 -299
  4. package/dist/dev/router.js +3 -1
  5. package/dist/dev/shared/computed-3UO-KiH1.js +40 -0
  6. package/dist/dev/shared/{element-C4DfKtZW.js → element-CQPqagu1.js} +5 -38
  7. package/dist/dev/shared/owner-Dmge21OW.js +62 -0
  8. package/dist/dev/shared/render-effect-kOGnLNbL.js +26 -0
  9. package/dist/dev/shared/resource-CbXVATvq.js +154 -0
  10. package/dist/dev/shared/signal-BOXkY-Iv.js +24 -0
  11. package/dist/dev/shared/store-BzUN1qE5.js +148 -0
  12. package/dist/dev/svg.js +1 -1
  13. package/dist/prod/api.js +210 -0
  14. package/dist/prod/forms.js +237 -0
  15. package/dist/prod/index.js +107 -316
  16. package/dist/prod/router.js +24 -22
  17. package/dist/prod/shared/computed-CAPpOLCY.js +33 -0
  18. package/dist/prod/shared/element-DGyQ01Vs.js +164 -0
  19. package/dist/prod/shared/owner-6BFHIPR9.js +59 -0
  20. package/dist/prod/shared/render-effect-DjaUT3Cn.js +23 -0
  21. package/dist/prod/shared/resource-CNC2DBO3.js +109 -0
  22. package/dist/prod/shared/signal-DGrl3r9T.js +16 -0
  23. package/dist/prod/shared/store-Dcscpk_h.js +109 -0
  24. package/dist/prod/svg.js +1 -1
  25. package/dist/types/api/cache.d.ts +16 -0
  26. package/dist/types/api/client.d.ts +42 -0
  27. package/dist/types/api/error.d.ts +16 -0
  28. package/dist/types/api/index.d.ts +3 -0
  29. package/dist/types/api/url.d.ts +5 -0
  30. package/dist/types/forms/form.d.ts +55 -0
  31. package/dist/types/forms/index.d.ts +2 -0
  32. package/dist/types/forms/paths.d.ts +6 -0
  33. package/dist/types/forms/types.d.ts +38 -0
  34. package/package.json +16 -2
  35. package/dist/dev/shared/owner-DlUsXKXE.js +0 -122
  36. package/dist/prod/shared/element-DUtXb3px.js +0 -187
  37. package/dist/prod/shared/owner-DgJNPM0P.js +0 -104
@@ -1,148 +1,21 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./shared/owner-DgJNPM0P.js";
2
- import { a as l, i as u, n as d, o as f, s as p } from "./shared/element-DUtXb3px.js";
3
- import { a as m, c as h, d as g, h as _, i as v, l as y, m as b, p as x, r as S, s as C, t as w, u as T } from "./shared/graph-C_aA46c6.js";
1
+ import { t as e } from "./shared/signal-DGrl3r9T.js";
2
+ import { n as t, t as n } from "./shared/render-effect-DjaUT3Cn.js";
3
+ import { t as r } from "./shared/computed-CAPpOLCY.js";
4
+ import { a as i, h as a, i as o, l as s, t as c } from "./shared/graph-C_aA46c6.js";
5
+ import { a as l, i as u, n as d, o as f, r as p, s as m, t as h } from "./shared/owner-6BFHIPR9.js";
6
+ import { a as g, i as _, n as ee, r as v, t as y } from "./shared/resource-CNC2DBO3.js";
7
+ import { n as te, r as ne, t as re } from "./shared/store-Dcscpk_h.js";
8
+ import { a as b, i as x, n as S } from "./shared/element-DGyQ01Vs.js";
4
9
  // src/core/env.ts
5
- var E = typeof window > "u";
6
- // src/core/context.ts
7
- function D(e, t) {
8
- return { defaultValue: e };
9
- }
10
- function O(e, t, n) {
11
- let r = {
12
- kind: 3,
13
- owner: null,
14
- children: null,
15
- cleanups: null,
16
- disposed: !1,
17
- handler: null,
18
- context: {
19
- key: e,
20
- value: t
21
- }
22
- };
23
- return S(r), x(r, n);
24
- }
25
- function k(e) {
26
- for (let t = C(); t !== null; t = t.owner) if (t.kind === 3 && t.context?.key === e) return t.context.value;
27
- return e.defaultValue;
28
- }
29
- // src/core/store.ts
30
- var A = Symbol("raw"), j = Symbol("shape"), M = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), P = 0;
31
- function ee(e, t) {
32
- let n = L(e);
33
- return [n, (e) => {
34
- P++;
35
- try {
36
- _(() => v(() => e(n)));
37
- } finally {
38
- P--;
39
- }
40
- }];
41
- }
42
- function F(e) {
43
- if (typeof e == "object" && e) {
44
- let t = e[A];
45
- if (t !== void 0) return t;
46
- }
47
- return e;
48
- }
49
- function I(e) {
50
- if (typeof e != "object" || !e) return !1;
51
- if (Array.isArray(e)) return !0;
52
- let t = Object.getPrototypeOf(e);
53
- return t === Object.prototype || t === null;
54
- }
55
- function L(e) {
56
- if (!I(e)) return e;
57
- let t = M.get(e);
58
- return t === void 0 && (t = new Proxy(e, te), M.set(e, t)), t;
59
- }
60
- function R(e, t) {
61
- let n = N.get(e);
62
- n === void 0 && N.set(e, n = /* @__PURE__ */ new Map());
63
- let r = n.get(t);
64
- return r === void 0 && n.set(t, r = {
65
- kind: 0,
66
- observers: [],
67
- seenBy: 0
68
- }), r;
69
- }
70
- function z(e, t) {
71
- let n = N.get(e)?.get(t);
72
- n !== void 0 && g(n);
73
- }
74
- function B(e) {
75
- return !1;
76
- }
77
- var te = {
78
- get(e, t) {
79
- if (t === A) return e;
80
- let n = e[t];
81
- return T() && (Object.hasOwn(e, t) || !(t in e)) && b(R(e, t)), L(n);
82
- },
83
- has(e, t) {
84
- return T() && b(R(e, t)), t in e;
85
- },
86
- ownKeys(e) {
87
- return T() && b(R(e, j)), Reflect.ownKeys(e);
88
- },
89
- set(e, t, n) {
90
- if (P === 0) {
91
- let t = B(e);
92
- if (t) throw t;
93
- return !1;
94
- }
95
- let r = e, i = F(n), a = Object.hasOwn(e, t), o = r[t], s = Array.isArray(e), c = s ? e.length : 0;
96
- if (a && Object.is(o, i)) return !0;
97
- if (r[t] = i, z(e, t), a || z(e, j), s) {
98
- let n = e.length;
99
- if (n !== c) {
100
- t !== "length" && z(e, "length"), z(e, j);
101
- for (let t = n; t < c; t++) z(e, String(t));
102
- }
103
- }
104
- return !0;
105
- },
106
- deleteProperty(e, t) {
107
- if (P === 0) {
108
- let t = B(e);
109
- if (t) throw t;
110
- return !1;
111
- }
112
- return Object.hasOwn(e, t) && (delete e[t], z(e, t), z(e, j)), !0;
113
- }
114
- };
115
- function ne(e, t, n = {}) {
116
- V(L(F(e)), F(t), n.key);
117
- }
118
- function V(e, t, n) {
119
- let r = F(e), i = e;
120
- if (Array.isArray(r) && Array.isArray(t)) {
121
- let e = /* @__PURE__ */ new Map();
122
- if (n !== void 0) for (let t of r) I(t) && e.set(t[n], t);
123
- for (let a = 0; a < t.length; a++) {
124
- let o = t[a], s = n !== void 0 && I(o) ? e.get(o[n]) : r[a];
125
- i[a] = H(s, o, n);
126
- }
127
- r.length !== t.length && (i.length = t.length);
128
- } else {
129
- for (let e of Object.keys(t)) i[e] = H(r[e], t[e], n);
130
- for (let e of Object.keys(r)) Object.hasOwn(t, e) || delete i[e];
131
- }
132
- }
133
- function H(e, t, n) {
134
- return I(e) && I(t) && Array.isArray(e) === Array.isArray(t) ? (V(L(e), t, n), e) : t;
135
- }
136
- // src/dom/tags.ts
137
- var re = /* @__PURE__ */ d("a"), ie = /* @__PURE__ */ d("abbr"), ae = /* @__PURE__ */ d("address"), oe = /* @__PURE__ */ d("area"), U = /* @__PURE__ */ d("article"), W = /* @__PURE__ */ d("aside"), G = /* @__PURE__ */ d("audio"), K = /* @__PURE__ */ d("b"), q = /* @__PURE__ */ d("base"), se = /* @__PURE__ */ d("bdi"), ce = /* @__PURE__ */ d("bdo"), le = /* @__PURE__ */ d("blockquote"), ue = /* @__PURE__ */ d("body"), de = /* @__PURE__ */ d("br"), fe = /* @__PURE__ */ d("button"), pe = /* @__PURE__ */ d("canvas"), me = /* @__PURE__ */ d("caption"), he = /* @__PURE__ */ d("cite"), ge = /* @__PURE__ */ d("code"), _e = /* @__PURE__ */ d("col"), ve = /* @__PURE__ */ d("colgroup"), ye = /* @__PURE__ */ d("data"), be = /* @__PURE__ */ d("datalist"), xe = /* @__PURE__ */ d("dd"), Se = /* @__PURE__ */ d("del"), Ce = /* @__PURE__ */ d("details"), we = /* @__PURE__ */ d("dfn"), Te = /* @__PURE__ */ d("dialog"), Ee = /* @__PURE__ */ d("div"), De = /* @__PURE__ */ d("dl"), Oe = /* @__PURE__ */ d("dt"), ke = /* @__PURE__ */ d("em"), Ae = /* @__PURE__ */ d("embed"), je = /* @__PURE__ */ d("fieldset"), Me = /* @__PURE__ */ d("figcaption"), Ne = /* @__PURE__ */ d("figure"), Pe = /* @__PURE__ */ d("footer"), Fe = /* @__PURE__ */ d("form"), Ie = /* @__PURE__ */ d("h1"), Le = /* @__PURE__ */ d("h2"), Re = /* @__PURE__ */ d("h3"), ze = /* @__PURE__ */ d("h4"), Be = /* @__PURE__ */ d("h5"), Ve = /* @__PURE__ */ d("h6"), He = /* @__PURE__ */ d("head"), Ue = /* @__PURE__ */ d("header"), We = /* @__PURE__ */ d("hgroup"), Ge = /* @__PURE__ */ d("hr"), Ke = /* @__PURE__ */ d("html"), qe = /* @__PURE__ */ d("i"), Je = /* @__PURE__ */ d("iframe"), Ye = /* @__PURE__ */ d("img"), Xe = /* @__PURE__ */ d("input"), Ze = /* @__PURE__ */ d("ins"), Qe = /* @__PURE__ */ d("kbd"), $e = /* @__PURE__ */ d("label"), et = /* @__PURE__ */ d("legend"), tt = /* @__PURE__ */ d("li"), nt = /* @__PURE__ */ d("link"), rt = /* @__PURE__ */ d("main"), it = /* @__PURE__ */ d("map"), at = /* @__PURE__ */ d("mark"), ot = /* @__PURE__ */ d("menu"), st = /* @__PURE__ */ d("meta"), ct = /* @__PURE__ */ d("meter"), lt = /* @__PURE__ */ d("nav"), ut = /* @__PURE__ */ d("noscript"), dt = /* @__PURE__ */ d("object"), ft = /* @__PURE__ */ d("ol"), pt = /* @__PURE__ */ d("optgroup"), mt = /* @__PURE__ */ d("option"), ht = /* @__PURE__ */ d("output"), gt = /* @__PURE__ */ d("p"), _t = /* @__PURE__ */ d("picture"), vt = /* @__PURE__ */ d("pre"), yt = /* @__PURE__ */ d("progress"), bt = /* @__PURE__ */ d("q"), xt = /* @__PURE__ */ d("rp"), St = /* @__PURE__ */ d("rt"), Ct = /* @__PURE__ */ d("ruby"), wt = /* @__PURE__ */ d("s"), Tt = /* @__PURE__ */ d("samp"), Et = /* @__PURE__ */ d("script"), Dt = /* @__PURE__ */ d("search"), Ot = /* @__PURE__ */ d("section"), kt = /* @__PURE__ */ d("select"), At = /* @__PURE__ */ d("slot"), jt = /* @__PURE__ */ d("small"), Mt = /* @__PURE__ */ d("source"), Nt = /* @__PURE__ */ d("span"), Pt = /* @__PURE__ */ d("strong"), Ft = /* @__PURE__ */ d("style"), It = /* @__PURE__ */ d("sub"), Lt = /* @__PURE__ */ d("summary"), Rt = /* @__PURE__ */ d("sup"), zt = /* @__PURE__ */ d("table"), Bt = /* @__PURE__ */ d("tbody"), Vt = /* @__PURE__ */ d("td"), Ht = /* @__PURE__ */ d("template"), Ut = /* @__PURE__ */ d("textarea"), Wt = /* @__PURE__ */ d("tfoot"), Gt = /* @__PURE__ */ d("th"), Kt = /* @__PURE__ */ d("thead"), qt = /* @__PURE__ */ d("time"), Jt = /* @__PURE__ */ d("title"), Yt = /* @__PURE__ */ d("tr"), Xt = /* @__PURE__ */ d("track"), Zt = /* @__PURE__ */ d("u"), Qt = /* @__PURE__ */ d("ul"), $t = /* @__PURE__ */ d("var"), en = /* @__PURE__ */ d("video"), tn = /* @__PURE__ */ d("wbr");
10
+ var ie = typeof window > "u", C = /* @__PURE__ */ S("a"), w = /* @__PURE__ */ S("abbr"), T = /* @__PURE__ */ S("address"), E = /* @__PURE__ */ S("area"), D = /* @__PURE__ */ S("article"), O = /* @__PURE__ */ S("aside"), k = /* @__PURE__ */ S("audio"), A = /* @__PURE__ */ S("b"), j = /* @__PURE__ */ S("base"), M = /* @__PURE__ */ S("bdi"), N = /* @__PURE__ */ S("bdo"), P = /* @__PURE__ */ S("blockquote"), F = /* @__PURE__ */ S("body"), I = /* @__PURE__ */ S("br"), L = /* @__PURE__ */ S("button"), R = /* @__PURE__ */ S("canvas"), z = /* @__PURE__ */ S("caption"), B = /* @__PURE__ */ S("cite"), V = /* @__PURE__ */ S("code"), H = /* @__PURE__ */ S("col"), U = /* @__PURE__ */ S("colgroup"), W = /* @__PURE__ */ S("data"), G = /* @__PURE__ */ S("datalist"), K = /* @__PURE__ */ S("dd"), q = /* @__PURE__ */ S("del"), J = /* @__PURE__ */ S("details"), Y = /* @__PURE__ */ S("dfn"), ae = /* @__PURE__ */ S("dialog"), oe = /* @__PURE__ */ S("div"), se = /* @__PURE__ */ S("dl"), ce = /* @__PURE__ */ S("dt"), le = /* @__PURE__ */ S("em"), ue = /* @__PURE__ */ S("embed"), de = /* @__PURE__ */ S("fieldset"), fe = /* @__PURE__ */ S("figcaption"), pe = /* @__PURE__ */ S("figure"), me = /* @__PURE__ */ S("footer"), he = /* @__PURE__ */ S("form"), ge = /* @__PURE__ */ S("h1"), _e = /* @__PURE__ */ S("h2"), ve = /* @__PURE__ */ S("h3"), ye = /* @__PURE__ */ S("h4"), be = /* @__PURE__ */ S("h5"), xe = /* @__PURE__ */ S("h6"), Se = /* @__PURE__ */ S("head"), Ce = /* @__PURE__ */ S("header"), we = /* @__PURE__ */ S("hgroup"), Te = /* @__PURE__ */ S("hr"), Ee = /* @__PURE__ */ S("html"), De = /* @__PURE__ */ S("i"), Oe = /* @__PURE__ */ S("iframe"), ke = /* @__PURE__ */ S("img"), Ae = /* @__PURE__ */ S("input"), je = /* @__PURE__ */ S("ins"), Me = /* @__PURE__ */ S("kbd"), Ne = /* @__PURE__ */ S("label"), Pe = /* @__PURE__ */ S("legend"), Fe = /* @__PURE__ */ S("li"), Ie = /* @__PURE__ */ S("link"), Le = /* @__PURE__ */ S("main"), Re = /* @__PURE__ */ S("map"), ze = /* @__PURE__ */ S("mark"), Be = /* @__PURE__ */ S("menu"), Ve = /* @__PURE__ */ S("meta"), He = /* @__PURE__ */ S("meter"), Ue = /* @__PURE__ */ S("nav"), We = /* @__PURE__ */ S("noscript"), Ge = /* @__PURE__ */ S("object"), Ke = /* @__PURE__ */ S("ol"), qe = /* @__PURE__ */ S("optgroup"), Je = /* @__PURE__ */ S("option"), Ye = /* @__PURE__ */ S("output"), Xe = /* @__PURE__ */ S("p"), Ze = /* @__PURE__ */ S("picture"), Qe = /* @__PURE__ */ S("pre"), $e = /* @__PURE__ */ S("progress"), et = /* @__PURE__ */ S("q"), tt = /* @__PURE__ */ S("rp"), nt = /* @__PURE__ */ S("rt"), rt = /* @__PURE__ */ S("ruby"), it = /* @__PURE__ */ S("s"), at = /* @__PURE__ */ S("samp"), ot = /* @__PURE__ */ S("script"), st = /* @__PURE__ */ S("search"), ct = /* @__PURE__ */ S("section"), lt = /* @__PURE__ */ S("select"), ut = /* @__PURE__ */ S("slot"), dt = /* @__PURE__ */ S("small"), ft = /* @__PURE__ */ S("source"), pt = /* @__PURE__ */ S("span"), mt = /* @__PURE__ */ S("strong"), ht = /* @__PURE__ */ S("style"), gt = /* @__PURE__ */ S("sub"), _t = /* @__PURE__ */ S("summary"), vt = /* @__PURE__ */ S("sup"), yt = /* @__PURE__ */ S("table"), bt = /* @__PURE__ */ S("tbody"), xt = /* @__PURE__ */ S("td"), St = /* @__PURE__ */ S("template"), Ct = /* @__PURE__ */ S("textarea"), wt = /* @__PURE__ */ S("tfoot"), Tt = /* @__PURE__ */ S("th"), Et = /* @__PURE__ */ S("thead"), Dt = /* @__PURE__ */ S("time"), Ot = /* @__PURE__ */ S("title"), kt = /* @__PURE__ */ S("tr"), At = /* @__PURE__ */ S("track"), jt = /* @__PURE__ */ S("u"), Mt = /* @__PURE__ */ S("ul"), Nt = /* @__PURE__ */ S("var"), Pt = /* @__PURE__ */ S("video"), Ft = /* @__PURE__ */ S("wbr");
138
11
  // src/dom/mount.ts
139
- function nn(e, t) {
12
+ function It(e, t) {
140
13
  if (t === null) throw Error("[keits] no target");
141
- let n = f.marker(), r = f.marker();
14
+ let n = b.marker(), r = b.marker();
142
15
  t.append(n, r);
143
- let a = i((n) => (u(t, e(), r), n));
16
+ let i = d((n) => (x(t, e(), r), n));
144
17
  return () => {
145
- a();
18
+ i();
146
19
  let e = n;
147
20
  for (; e !== null;) {
148
21
  let t = e === r ? null : e.nextSibling;
@@ -151,23 +24,23 @@ function nn(e, t) {
151
24
  };
152
25
  }
153
26
  // src/dom/unsafe.ts
154
- function rn(e) {
27
+ function X(e) {
155
28
  let t = document.createElement("template");
156
29
  return t.innerHTML = e, t.content;
157
30
  }
158
31
  // src/flow/range.ts
159
- function J(e, t) {
160
- return i((n) => {
32
+ function Z(e, t) {
33
+ return d((n) => {
161
34
  let r = e();
162
- if (an(r)) return {
35
+ if (Lt(r)) return {
163
36
  item: t,
164
37
  index: null,
165
38
  dispose: n,
166
39
  first: r,
167
40
  last: r
168
41
  };
169
- let i = document.createDocumentFragment(), a = f.marker(), o = f.marker();
170
- return i.append(a, o), u(i, r, o), {
42
+ let i = document.createDocumentFragment(), a = b.marker(), o = b.marker();
43
+ return i.append(a, o), x(i, r, o), {
171
44
  item: t,
172
45
  index: null,
173
46
  dispose: n,
@@ -176,10 +49,10 @@ function J(e, t) {
176
49
  };
177
50
  });
178
51
  }
179
- function an(e) {
52
+ function Lt(e) {
180
53
  return typeof e == "object" && !!e && e.nodeType === 1;
181
54
  }
182
- function Y(e, t, n) {
55
+ function Q(e, t, n) {
183
56
  if (t.first === t.last) {
184
57
  e.insertBefore(t.first, n);
185
58
  return;
@@ -190,7 +63,7 @@ function Y(e, t, n) {
190
63
  e.insertBefore(r, n), r = i;
191
64
  }
192
65
  }
193
- function X(e) {
66
+ function $(e) {
194
67
  e.dispose();
195
68
  let t = e.first;
196
69
  for (; t !== null;) {
@@ -199,57 +72,57 @@ function X(e) {
199
72
  }
200
73
  }
201
74
  // src/flow/for.ts
202
- function on(e, t, n) {
203
- let i = f.marker(), a = document.createDocumentFragment();
204
- a.append(i);
205
- let o = [], s = null;
206
- w(() => {
207
- for (let e of o) e.dispose();
208
- s?.dispose();
209
- }), l(() => {
210
- let t = e();
211
- c(t ? Array.from(t) : []);
75
+ function Rt(t, r, i) {
76
+ let a = b.marker(), o = document.createDocumentFragment();
77
+ o.append(a);
78
+ let s = [], l = null;
79
+ c(() => {
80
+ for (let e of s) e.dispose();
81
+ l?.dispose();
82
+ }), n(() => {
83
+ let e = t();
84
+ u(e ? Array.from(e) : []);
212
85
  });
213
- function c(e) {
214
- let t = i.parentNode;
86
+ function u(e) {
87
+ let t = a.parentNode;
215
88
  if (e.length === 0) {
216
- for (let e of o) X(e);
217
- o = [], s === null && n?.fallback && (s = J(n.fallback, null), Y(t, s, i));
89
+ for (let e of s) $(e);
90
+ s = [], l === null && i?.fallback && (l = Z(i.fallback, null), Q(t, l, a));
218
91
  return;
219
92
  }
220
- s !== null && (X(s), s = null);
221
- let r = /* @__PURE__ */ new Map();
222
- o.forEach((e, t) => {
223
- let n = r.get(e.item);
224
- n ? n.push(t) : r.set(e.item, [t]);
93
+ l !== null && ($(l), l = null);
94
+ let n = /* @__PURE__ */ new Map();
95
+ s.forEach((e, t) => {
96
+ let r = n.get(e.item);
97
+ r ? r.push(t) : n.set(e.item, [t]);
225
98
  });
226
- let a = Array(o.length).fill(!1), c = Array(e.length), l = Array(e.length);
99
+ let r = Array(s.length).fill(!1), o = Array(e.length), c = Array(e.length);
227
100
  for (let t = 0; t < e.length; t++) {
228
- let n = e[t], i = r.get(n), s = i !== void 0 && i.length > 0 ? i.shift() : -1;
229
- if (s >= 0) {
230
- let e = o[s];
231
- e.index(t), a[s] = !0, c[t] = e;
232
- } else c[t] = u(n, t);
233
- l[t] = s;
101
+ let i = e[t], a = n.get(i), l = a !== void 0 && a.length > 0 ? a.shift() : -1;
102
+ if (l >= 0) {
103
+ let e = s[l];
104
+ e.index(t), r[l] = !0, o[t] = e;
105
+ } else o[t] = d(i, t);
106
+ c[t] = l;
234
107
  }
235
- for (let e = 0; e < o.length; e++) a[e] || X(o[e]);
236
- let d = sn(l), f = i;
237
- for (let e = c.length - 1; e >= 0; e--) {
238
- let n = c[e];
239
- d.has(e) || Y(t, n, f), f = n.first;
108
+ for (let e = 0; e < s.length; e++) r[e] || $(s[e]);
109
+ let u = zt(c), f = a;
110
+ for (let e = o.length - 1; e >= 0; e--) {
111
+ let n = o[e];
112
+ u.has(e) || Q(t, n, f), f = n.first;
240
113
  }
241
- o = c;
114
+ s = o;
242
115
  }
243
- function u(e, n) {
244
- let i = () => {}, a = J(() => {
245
- let a = r(n);
246
- return i = a.set, t(e, a);
247
- }, e);
116
+ function d(t, n) {
117
+ let i = () => {}, a = Z(() => {
118
+ let a = e(n);
119
+ return i = a.set, r(t, a);
120
+ }, t);
248
121
  return a.index = i, a;
249
122
  }
250
- return a;
123
+ return o;
251
124
  }
252
- function sn(e) {
125
+ function zt(e) {
253
126
  let t = [], n = Array(e.length);
254
127
  for (let r = 0; r < e.length; r++) {
255
128
  let i = e[r];
@@ -266,51 +139,51 @@ function sn(e) {
266
139
  return r;
267
140
  }
268
141
  // src/flow/if.ts
269
- function cn(e, n, r) {
270
- let i = t(e), a = t(() => !!i()), o = i;
271
- return () => a() ? _(() => n(o)) : r ? _(r) : null;
142
+ function Bt(e, t, n) {
143
+ let i = r(e), o = r(() => !!i()), s = i;
144
+ return () => o() ? a(() => t(s)) : n ? a(n) : null;
272
145
  }
273
146
  // src/flow/show.ts
274
- function ln(e, t) {
275
- let n = t.style.display;
276
- return l(() => {
277
- e() ? t.style.display = n : t.style.display = "none";
147
+ function Vt(e, t) {
148
+ let r = t.style.display;
149
+ return n(() => {
150
+ e() ? t.style.display = r : t.style.display = "none";
278
151
  }), t;
279
152
  }
280
153
  // src/flow/switch.ts
281
- function Z(e, n, r) {
282
- let i = t(e);
154
+ function Ht(e, t, n) {
155
+ let i = r(e);
283
156
  return () => {
284
- let e = n[i()] ?? r;
285
- return e ? _(e) : null;
157
+ let e = t[i()] ?? n;
158
+ return e ? a(e) : null;
286
159
  };
287
160
  }
288
161
  // src/flow/dynamic.ts
289
- function un(e, n) {
290
- let r = t(e);
162
+ function Ut(e, t) {
163
+ let n = r(e);
291
164
  return () => {
292
- let e = r();
293
- return e ? _(() => e(n)) : null;
165
+ let e = n();
166
+ return e ? a(() => e(t)) : null;
294
167
  };
295
168
  }
296
169
  // src/flow/catch.ts
297
- function dn(e, t) {
298
- let n = r(null), i = () => n.set(null);
170
+ function Wt(t, n) {
171
+ let r = e(null), i = () => r.set(null);
299
172
  return () => {
300
- let r = n();
301
- return _(r === null ? () => c(() => {
302
- let t = document.createDocumentFragment();
303
- return u(t, e()), t;
304
- }, (e) => n.set({ error: e })) : () => t(r.error, i));
173
+ let e = r();
174
+ return a(e === null ? () => h(() => {
175
+ let e = document.createDocumentFragment();
176
+ return x(e, t()), e;
177
+ }, (e) => r.set({ error: e })) : () => n(e.error, i));
305
178
  };
306
179
  }
307
180
  // src/flow/portal.ts
308
- function fn(e, t) {
309
- if (y()) return null;
181
+ function Gt(e, t) {
182
+ if (s()) return null;
310
183
  let n = t === void 0 ? document.body : t;
311
184
  if (n === null) throw Error("[keits] no target");
312
- let r = f.marker(), i = f.marker();
313
- return n.append(r, i), u(n, _(e), i), w(() => {
185
+ let r = b.marker(), i = b.marker();
186
+ return n.append(r, i), x(n, a(e), i), c(() => {
314
187
  let e = r;
315
188
  for (; e !== null;) {
316
189
  let t = e === i ? null : e.nextSibling;
@@ -318,125 +191,43 @@ function fn(e, t) {
318
191
  }
319
192
  }), null;
320
193
  }
321
- // src/async/suspense-context.ts
322
- var Q = D(null);
323
194
  // src/flow/suspense.ts
324
- function pn(e, t) {
325
- let n = r(0), i = /* @__PURE__ */ new Set(), a = { wait(e, t) {
326
- i.has(e) || (i.add(e), n.set((e) => e + 1), t(() => {
327
- i.delete(e), n.set((e) => e - 1);
195
+ function Kt(t, r) {
196
+ let o = e(0), s = /* @__PURE__ */ new Set(), l = { wait(e, t) {
197
+ s.has(e) || (s.add(e), o.set((e) => e + 1), t(() => {
198
+ s.delete(e), o.set((e) => e - 1);
328
199
  }));
329
- } }, o = document.createDocumentFragment(), s = f.marker(), c = f.marker();
330
- o.append(s, c);
331
- let { release: d } = m(() => O(Q, a, () => u(o, _(e), c))), p = {
200
+ } }, u = document.createDocumentFragment(), d = b.marker(), f = b.marker();
201
+ u.append(d, f);
202
+ let { release: p } = i(() => _(ee, l, () => x(u, a(t), f))), m = {
332
203
  item: null,
333
204
  index: null,
334
205
  dispose: () => {},
335
- first: s,
336
- last: c
337
- }, h = f.marker(), g = document.createDocumentFragment();
206
+ first: d,
207
+ last: f
208
+ }, h = b.marker(), g = document.createDocumentFragment();
338
209
  g.append(h);
339
210
  let v = null;
340
- return w(() => v?.dispose()), l(() => {
341
- let e = n() > 0;
342
- _(() => {
343
- let n = h.parentNode;
344
- e ? (Y(o, p, null), v === null && (v = J(t, null), Y(n, v, h))) : (v !== null && (X(v), v = null), Y(n, p, h), d());
211
+ return c(() => v?.dispose()), n(() => {
212
+ let e = o() > 0;
213
+ a(() => {
214
+ let t = h.parentNode;
215
+ e ? (Q(u, m, null), v === null && (v = Z(r, null), Q(t, v, h))) : (v !== null && ($(v), v = null), Q(t, m, h), p());
345
216
  });
346
217
  }), g;
347
218
  }
348
- // src/async/resource.ts
349
- function $(e, t, n) {
350
- let i = typeof t == "function", a = i ? e : () => !0, o = i ? t : (t, n) => e(n), s = i ? n : t, c = C(), u = s !== void 0 && "initialValue" in s, d = r(s?.initialValue), f = r(u ? "ready" : "unresolved"), p = r(null), m = null, g = 0, y = [], b = null, x = () => {
351
- let e = y;
352
- y = [];
353
- for (let t of e) t();
354
- };
355
- function S(e, t) {
356
- m?.abort(), m = null;
357
- let n = ++g;
358
- if (e == null || e === !1) return b = null, f.set(_(d) === void 0 ? "unresolved" : "ready"), x(), Promise.resolve();
359
- b = e;
360
- let r = new AbortController();
361
- m = r;
362
- let i;
363
- try {
364
- i = o(e, {
365
- signal: r.signal,
366
- refetching: t,
367
- value: _(d)
368
- });
369
- } catch (e) {
370
- return E(e), Promise.resolve();
371
- }
372
- return mn(i) ? (f.set(_(d) === void 0 && _(f) !== "ready" ? "pending" : "refreshing"), Promise.resolve(i).then((e) => {
373
- n === g && T(e);
374
- }, (e) => {
375
- n === g && E(e);
376
- })) : (T(i), Promise.resolve());
377
- }
378
- function T(e) {
379
- m = null, v(() => {
380
- d.set(() => e), p.set(null), f.set("ready");
381
- }), x();
382
- }
383
- function E(e) {
384
- m = null, v(() => {
385
- p.set({ error: e }), f.set("errored");
386
- }), x();
387
- }
388
- l(() => {
389
- let e = a();
390
- _(() => S(e, !1));
391
- }), w(() => {
392
- g++, m?.abort(), m = null;
393
- });
394
- let D = Object.assign(() => {
395
- let e = f();
396
- if (e === "errored") throw p().error;
397
- if (e === "pending") {
398
- let e = k(Q);
399
- e !== null && e.wait(D, (e) => y.push(e));
400
- }
401
- return d();
402
- }, {
403
- state: () => f(),
404
- loading: () => {
405
- let e = f();
406
- return e === "pending" || e === "refreshing";
407
- },
408
- error: () => p()?.error,
409
- refetch: () => _(() => S(b ?? a(), !0)),
410
- mutate: (e) => v(() => {
411
- d.set(() => e), p.set(null), f.set(e === void 0 ? "unresolved" : "ready");
412
- }),
413
- optimistic: async (e, t) => {
414
- let n = _(d), r = e(n);
415
- d.set(() => r);
416
- try {
417
- return await t(), !0;
418
- } catch (e) {
419
- return _(d) === r && d.set(() => n), v(() => h(e, c)), !1;
420
- }
421
- }
422
- });
423
- return D;
424
- }
425
- function mn(e) {
426
- return typeof e?.then == "function";
427
- }
428
219
  // src/async/lazy.ts
429
- function hn(e) {
220
+ function qt(e) {
430
221
  let t, n, r = () => n ??= Promise.resolve(e()).then((e) => t = e.default, (e) => {
431
222
  throw n = void 0, e;
432
223
  });
433
224
  return Object.assign((e) => {
434
- if (t !== void 0) return _(() => t(e));
435
- let n = $(() => t ?? r());
225
+ if (t !== void 0) return a(() => t(e));
226
+ let n = y(() => t ?? r());
436
227
  return () => {
437
228
  let t = n();
438
- return t ? _(() => t(e)) : null;
229
+ return t ? a(() => t(e)) : null;
439
230
  };
440
231
  }, { preload: r });
441
232
  }
442
- export { re as $a, ie as $abbr, ae as $address, oe as $area, U as $article, W as $aside, G as $audio, K as $b, q as $base, se as $bdi, ce as $bdo, le as $blockquote, ue as $body, de as $br, fe as $button, pe as $canvas, me as $caption, dn as $catch, he as $cite, ge as $code, _e as $col, ve as $colgroup, ye as $data, be as $datalist, xe as $dd, Se as $del, Ce as $details, we as $dfn, Te as $dialog, Ee as $div, De as $dl, Oe as $dt, un as $dynamic, ke as $em, Ae as $embed, je as $fieldset, Me as $figcaption, Ne as $figure, Pe as $footer, on as $for, Fe as $form, Ie as $h1, Le as $h2, Re as $h3, ze as $h4, Be as $h5, Ve as $h6, He as $head, Ue as $header, We as $hgroup, Ge as $hr, Ke as $html, qe as $i, cn as $if, Je as $iframe, Ye as $img, Xe as $input, Ze as $ins, Qe as $kbd, $e as $label, et as $legend, tt as $li, nt as $link, rt as $main, it as $map, at as $mark, ot as $menu, st as $meta, ct as $meter, lt as $nav, ut as $noscript, dt as $object, ft as $ol, pt as $optgroup, mt as $option, ht as $output, gt as $p, _t as $picture, fn as $portal, vt as $pre, yt as $progress, bt as $q, xt as $rp, St as $rt, Ct as $ruby, wt as $s, Tt as $samp, Et as $script, Dt as $search, Ot as $section, kt as $select, ln as $show, At as $slot, jt as $small, Mt as $source, Nt as $span, Pt as $strong, Ft as $style, It as $sub, Lt as $summary, Rt as $sup, pn as $suspense, Z as $switch, zt as $table, Bt as $tbody, Vt as $td, Ht as $template, Ut as $textarea, Wt as $tfoot, Gt as $th, Kt as $thead, qt as $time, Jt as $title, Yt as $tr, Xt as $track, Zt as $u, Qt as $ul, $t as $var, en as $video, tn as $wbr, v as batch, c as catchError, t as computed, D as createContext, i as createRoot, p as effect, o as getOwner, d as html, u as insert, E as isServer, y as isStaticRender, hn as lazy, nn as mount, n as onCleanup, e as onMount, O as provide, ne as reconcile, a as renderStatic, $ as resource, s as runWithOwner, r as signal, ee as store, rn as unsafeHTML, _ as untrack, F as unwrap, k as useContext };
233
+ export { C as $a, w as $abbr, T as $address, E as $area, D as $article, O as $aside, k as $audio, A as $b, j as $base, M as $bdi, N as $bdo, P as $blockquote, F as $body, I as $br, L as $button, R as $canvas, z as $caption, Wt as $catch, B as $cite, V as $code, H as $col, U as $colgroup, W as $data, G as $datalist, K as $dd, q as $del, J as $details, Y as $dfn, ae as $dialog, oe as $div, se as $dl, ce as $dt, Ut as $dynamic, le as $em, ue as $embed, de as $fieldset, fe as $figcaption, pe as $figure, me as $footer, Rt as $for, he as $form, ge as $h1, _e as $h2, ve as $h3, ye as $h4, be as $h5, xe as $h6, Se as $head, Ce as $header, we as $hgroup, Te as $hr, Ee as $html, De as $i, Bt as $if, Oe as $iframe, ke as $img, Ae as $input, je as $ins, Me as $kbd, Ne as $label, Pe as $legend, Fe as $li, Ie as $link, Le as $main, Re as $map, ze as $mark, Be as $menu, Ve as $meta, He as $meter, Ue as $nav, We as $noscript, Ge as $object, Ke as $ol, qe as $optgroup, Je as $option, Ye as $output, Xe as $p, Ze as $picture, Gt as $portal, Qe as $pre, $e as $progress, et as $q, tt as $rp, nt as $rt, rt as $ruby, it as $s, at as $samp, ot as $script, st as $search, ct as $section, lt as $select, Vt as $show, ut as $slot, dt as $small, ft as $source, pt as $span, mt as $strong, ht as $style, gt as $sub, _t as $summary, vt as $sup, Kt as $suspense, Ht as $switch, yt as $table, bt as $tbody, xt as $td, St as $template, Ct as $textarea, wt as $tfoot, Tt as $th, Et as $thead, Dt as $time, Ot as $title, kt as $tr, At as $track, jt as $u, Mt as $ul, Nt as $var, Pt as $video, Ft as $wbr, o as batch, h as catchError, r as computed, v as createContext, d as createRoot, t as effect, p as getOwner, S as html, x as insert, ie as isServer, s as isStaticRender, qt as lazy, It as mount, u as onCleanup, l as onMount, _ as provide, re as reconcile, f as renderStatic, y as resource, m as runWithOwner, e as signal, te as store, X as unsafeHTML, a as untrack, ne as unwrap, g as useContext };
@@ -1,5 +1,7 @@
1
- import { c as e, i as t, l as n } from "./shared/owner-DgJNPM0P.js";
2
- import { c as r, h as i, i as a, n as o, p as s, s as c } from "./shared/graph-C_aA46c6.js";
1
+ import { t as e } from "./shared/computed-CAPpOLCY.js";
2
+ import { t } from "./shared/signal-DGrl3r9T.js";
3
+ import { c as n, h as r, i, n as a, p as o, s } from "./shared/graph-C_aA46c6.js";
4
+ import { i as c } from "./shared/owner-6BFHIPR9.js";
3
5
  // src/router/history.ts
4
6
  var l = () => Math.random().toString(36).slice(2, 10), u = () => window.history.state?.keitsKey ?? "start";
5
7
  function d(e = "") {
@@ -215,18 +217,18 @@ function E(e) {
215
217
  }
216
218
  // src/router/router.ts
217
219
  function D(l) {
218
- let u = typeof l.history == "object" ? l.history : l.history === "hash" ? f() : d(l.base), p = c(), g = _(l.routes), v = n(u.read(), { equals: (e, t) => e.path === t.path && e.search === t.search && e.hash === t.hash }), b = n(!1), E = n(!1), D = /* @__PURE__ */ new Set(), j = 0, M = l.scroll ?? typeof window < "u" ? T() : null, N = u.key(), P = e(() => b() ? y(g, v().path) : null), F = e(() => P()?.params ?? {}, { equals: A }), I = e(() => S(x(P()), v().search), { equals: A }), L = (e, t) => {
220
+ let u = typeof l.history == "object" ? l.history : l.history === "hash" ? f() : d(l.base), p = s(), g = _(l.routes), v = t(u.read(), { equals: (e, t) => e.path === t.path && e.search === t.search && e.hash === t.hash }), b = t(!1), E = t(!1), D = /* @__PURE__ */ new Set(), j = 0, M = l.scroll ?? typeof window < "u" ? T() : null, N = u.key(), P = e(() => b() ? y(g, v().path) : null), F = e(() => P()?.params ?? {}, { equals: A }), I = e(() => S(x(P()), v().search), { equals: A }), L = (e, t) => {
219
221
  let n = w(e, t?.params), r = t?.query ? C(t.query) : "", i = t?.hash ? `#${t.hash.replace(/^#/, "")}` : "";
220
222
  return n + r + i;
221
223
  };
222
- function R(e, t, n = 0) {
223
- let c = ++j, l = m(e), d = i(b) ? i(v) : null, f = () => {
224
- d !== null && M?.save(N), t === "push" ? u.push(e) : (t === "replace" || n > 0) && u.replace(e), N = u.key();
225
- let r = N;
226
- return a(() => {
224
+ function R(e, t, s = 0) {
225
+ let c = ++j, l = m(e), d = r(b) ? r(v) : null, f = () => {
226
+ d !== null && M?.save(N), t === "push" ? u.push(e) : (t === "replace" || s > 0) && u.replace(e), N = u.key();
227
+ let n = N;
228
+ return i(() => {
227
229
  if (E.set(!1), b.set(!0), v.set(u.read()), M !== null && d !== null) {
228
- let e = d.path !== l.path, n = d.hash !== l.hash;
229
- s(null, () => o(() => M.restore(r, t === "pop", e, l.hash, n)));
230
+ let e = d.path !== l.path, r = d.hash !== l.hash;
231
+ o(null, () => a(() => M.restore(n, t === "pop", e, l.hash, r)));
230
232
  }
231
233
  }), !0;
232
234
  };
@@ -247,14 +249,14 @@ function D(l) {
247
249
  if (c !== j) return !1;
248
250
  if (e === !0) return f();
249
251
  if (E.set(!1), typeof e == "string") {
250
- if (n >= 10) throw Error("[keits/router] redirect loop");
251
- return R(e, t === "pop" ? "replace" : t, n + 1);
252
+ if (s >= 10) throw Error("[keits/router] redirect loop");
253
+ return R(e, t === "pop" ? "replace" : t, s + 1);
252
254
  }
253
255
  return t === "pop" && d !== null && (u.push(d.path + d.search + d.hash), N = u.key()), !1;
254
256
  }, C = (e) => {
255
257
  c === j && E.set(!1);
256
258
  try {
257
- return r(e, p), Promise.resolve(!1);
259
+ return n(e, p), Promise.resolve(!1);
258
260
  } catch (e) {
259
261
  return Promise.reject(e);
260
262
  }
@@ -281,7 +283,7 @@ function D(l) {
281
283
  let t = h(e, (e) => u.toAppUrl(e));
282
284
  if (t === null) return;
283
285
  e.preventDefault();
284
- let n = i(v);
286
+ let n = r(v);
285
287
  R(t, t === n.path + n.search + n.hash ? "replace" : "push");
286
288
  }, H = l.links !== !1 && typeof document < "u";
287
289
  return H && document.addEventListener("click", V), {
@@ -293,24 +295,24 @@ function D(l) {
293
295
  navigate: (e, t) => R(e.includes(":") || t?.query || t?.hash ? L(e, t) : e, t?.replace ? "replace" : "push"),
294
296
  href: (e, t) => u.href(L(e, t)),
295
297
  setQuery(e, t) {
296
- let n = i(v), r = {
298
+ let n = r(v), i = {
297
299
  ...Object.fromEntries(new URLSearchParams(n.search)),
298
300
  ...e
299
301
  };
300
- R(n.path + C(r) + n.hash, t?.push ? "push" : "replace");
302
+ R(n.path + C(i) + n.hash, t?.push ? "push" : "replace");
301
303
  },
302
304
  onLeave(e) {
303
- D.add(e), t(() => D.delete(e));
305
+ D.add(e), c(() => D.delete(e));
304
306
  },
305
307
  view() {
306
- let t = (n, r) => {
308
+ let t = (n, i) => {
307
309
  let a = e(() => P()?.routes[n] ?? null);
308
310
  return () => {
309
311
  let e = a();
310
- return i(() => {
311
- if (e === null) return r?.component ? r.component() : null;
312
- let i = t(n + 1, e);
313
- return e.layout ? e.layout({ children: i }) : i;
312
+ return r(() => {
313
+ if (e === null) return i?.component ? i.component() : null;
314
+ let r = t(n + 1, e);
315
+ return e.layout ? e.layout({ children: r }) : r;
314
316
  });
315
317
  };
316
318
  };