keits 0.0.2 → 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.
- package/dist/dev/api.js +270 -0
- package/dist/dev/forms.js +328 -0
- package/dist/dev/index.js +290 -294
- package/dist/dev/router.js +445 -0
- package/dist/dev/shared/computed-3UO-KiH1.js +40 -0
- package/dist/dev/shared/element-CQPqagu1.js +222 -0
- package/dist/dev/shared/graph-D6-x_CWC.js +324 -0
- package/dist/dev/shared/owner-Dmge21OW.js +62 -0
- package/dist/dev/shared/render-effect-kOGnLNbL.js +26 -0
- package/dist/dev/shared/resource-CbXVATvq.js +154 -0
- package/dist/dev/shared/signal-BOXkY-Iv.js +24 -0
- package/dist/dev/shared/store-BzUN1qE5.js +148 -0
- package/dist/dev/svg.js +1 -1
- package/dist/prod/api.js +210 -0
- package/dist/prod/forms.js +237 -0
- package/dist/prod/index.js +209 -234
- package/dist/prod/router.js +345 -0
- package/dist/prod/shared/computed-CAPpOLCY.js +33 -0
- package/dist/prod/shared/element-DGyQ01Vs.js +164 -0
- package/dist/prod/shared/graph-C_aA46c6.js +240 -0
- package/dist/prod/shared/owner-6BFHIPR9.js +59 -0
- package/dist/prod/shared/render-effect-DjaUT3Cn.js +23 -0
- package/dist/prod/shared/resource-CNC2DBO3.js +109 -0
- package/dist/prod/shared/signal-DGrl3r9T.js +16 -0
- package/dist/prod/shared/store-Dcscpk_h.js +109 -0
- package/dist/prod/svg.js +1 -1
- package/dist/types/api/cache.d.ts +16 -0
- package/dist/types/api/client.d.ts +42 -0
- package/dist/types/api/error.d.ts +16 -0
- package/dist/types/api/index.d.ts +3 -0
- package/dist/types/api/url.d.ts +5 -0
- package/dist/types/async/index.d.ts +2 -0
- package/dist/types/async/lazy.d.ts +7 -0
- package/dist/types/async/resource.d.ts +23 -0
- package/dist/types/async/suspense-context.d.ts +4 -0
- package/dist/types/core/graph.d.ts +8 -0
- package/dist/types/dom/types.d.ts +1 -1
- package/dist/types/flow/catch.d.ts +2 -0
- package/dist/types/flow/dynamic.d.ts +6 -0
- package/dist/types/flow/for.d.ts +7 -0
- package/dist/types/flow/if.d.ts +4 -0
- package/dist/types/flow/index.d.ts +8 -0
- package/dist/types/flow/portal.d.ts +2 -0
- package/dist/types/flow/range.d.ts +11 -0
- package/dist/types/flow/show.d.ts +1 -0
- package/dist/types/flow/suspense.d.ts +2 -0
- package/dist/types/flow/switch.d.ts +9 -0
- package/dist/types/forms/form.d.ts +55 -0
- package/dist/types/forms/index.d.ts +2 -0
- package/dist/types/forms/paths.d.ts +6 -0
- package/dist/types/forms/types.d.ts +38 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/router/history.d.ts +21 -0
- package/dist/types/router/index.d.ts +3 -0
- package/dist/types/router/links.d.ts +1 -0
- package/dist/types/router/match.d.ts +15 -0
- package/dist/types/router/router.d.ts +10 -0
- package/dist/types/router/scroll.d.ts +5 -0
- package/dist/types/router/types.d.ts +87 -0
- package/dist/types/svg/types.d.ts +1 -1
- package/package.json +37 -6
- package/dist/dev/shared/element-By0uLZli.js +0 -544
- package/dist/prod/shared/element-C8c5hIhH.js +0 -394
package/dist/prod/index.js
CHANGED
|
@@ -1,258 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
seenBy: 0
|
|
10
|
-
};
|
|
11
|
-
return Object.assign(() => (g(n), n.value), { set: (e) => {
|
|
12
|
-
let t = typeof e == "function" ? e(n.value) : e;
|
|
13
|
-
n.equals !== !1 && n.equals(n.value, t) || (n.value = t, o(n));
|
|
14
|
-
} });
|
|
15
|
-
}
|
|
16
|
-
// src/core/computed.ts
|
|
17
|
-
function b(e, t) {
|
|
18
|
-
let r = {
|
|
19
|
-
kind: 2,
|
|
20
|
-
fn: e,
|
|
21
|
-
value: void 0,
|
|
22
|
-
equals: t?.equals ?? Object.is,
|
|
23
|
-
hasValue: !1,
|
|
24
|
-
hasError: !1,
|
|
25
|
-
error: void 0,
|
|
26
|
-
computing: !1,
|
|
27
|
-
state: 2,
|
|
28
|
-
sources: [],
|
|
29
|
-
observers: [],
|
|
30
|
-
seenBy: 0,
|
|
31
|
-
flushId: 0,
|
|
32
|
-
flushRuns: 0,
|
|
33
|
-
owner: null,
|
|
34
|
-
children: null,
|
|
35
|
-
cleanups: null,
|
|
36
|
-
disposed: !1
|
|
37
|
-
};
|
|
38
|
-
return l(r), () => {
|
|
39
|
-
if (r.computing) throw x(r);
|
|
40
|
-
if (r.state !== 0 && n(r), g(r), r.hasError) throw r.error;
|
|
41
|
-
return r.value;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function x(e) {
|
|
45
|
-
return /* @__PURE__ */ Error("[keits] cycle detected");
|
|
46
|
-
}
|
|
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";
|
|
47
9
|
// src/core/env.ts
|
|
48
|
-
var
|
|
49
|
-
// src/
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
cleanups: null,
|
|
62
|
-
disposed: !1,
|
|
63
|
-
handler: null
|
|
64
|
-
}, r = () => h(() => i(n));
|
|
65
|
-
return h(() => {
|
|
66
|
-
try {
|
|
67
|
-
return e(n, () => t(r));
|
|
68
|
-
} catch (e) {
|
|
69
|
-
throw i(n), e;
|
|
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");
|
|
11
|
+
// src/dom/mount.ts
|
|
12
|
+
function It(e, t) {
|
|
13
|
+
if (t === null) throw Error("[keits] no target");
|
|
14
|
+
let n = b.marker(), r = b.marker();
|
|
15
|
+
t.append(n, r);
|
|
16
|
+
let i = d((n) => (x(t, e(), r), n));
|
|
17
|
+
return () => {
|
|
18
|
+
i();
|
|
19
|
+
let e = n;
|
|
20
|
+
for (; e !== null;) {
|
|
21
|
+
let t = e === r ? null : e.nextSibling;
|
|
22
|
+
e.remove(), e = t;
|
|
70
23
|
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function E(e) {
|
|
74
|
-
m(e);
|
|
75
|
-
}
|
|
76
|
-
function D(e) {
|
|
77
|
-
r(e);
|
|
78
|
-
}
|
|
79
|
-
function ee(t, n) {
|
|
80
|
-
let r = {
|
|
81
|
-
kind: 3,
|
|
82
|
-
owner: null,
|
|
83
|
-
children: null,
|
|
84
|
-
cleanups: null,
|
|
85
|
-
disposed: !1,
|
|
86
|
-
handler: n
|
|
87
24
|
};
|
|
88
|
-
return l(r), h(() => {
|
|
89
|
-
try {
|
|
90
|
-
return e(r, t);
|
|
91
|
-
} catch (e) {
|
|
92
|
-
p(e, r);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function te(e) {
|
|
98
|
-
return _(() => T((t) => {
|
|
99
|
-
try {
|
|
100
|
-
return e();
|
|
101
|
-
} finally {
|
|
102
|
-
t();
|
|
103
|
-
}
|
|
104
|
-
}));
|
|
105
25
|
}
|
|
106
|
-
// src/
|
|
107
|
-
function
|
|
108
|
-
|
|
26
|
+
// src/dom/unsafe.ts
|
|
27
|
+
function X(e) {
|
|
28
|
+
let t = document.createElement("template");
|
|
29
|
+
return t.innerHTML = e, t.content;
|
|
109
30
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
31
|
+
// src/flow/range.ts
|
|
32
|
+
function Z(e, t) {
|
|
33
|
+
return d((n) => {
|
|
34
|
+
let r = e();
|
|
35
|
+
if (Lt(r)) return {
|
|
36
|
+
item: t,
|
|
37
|
+
index: null,
|
|
38
|
+
dispose: n,
|
|
39
|
+
first: r,
|
|
40
|
+
last: r
|
|
41
|
+
};
|
|
42
|
+
let i = document.createDocumentFragment(), a = b.marker(), o = b.marker();
|
|
43
|
+
return i.append(a, o), x(i, r, o), {
|
|
44
|
+
item: t,
|
|
45
|
+
index: null,
|
|
46
|
+
dispose: n,
|
|
47
|
+
first: a,
|
|
48
|
+
last: o
|
|
49
|
+
};
|
|
50
|
+
});
|
|
124
51
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
return e.defaultValue;
|
|
52
|
+
function Lt(e) {
|
|
53
|
+
return typeof e == "object" && !!e && e.nodeType === 1;
|
|
128
54
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
F--;
|
|
139
|
-
}
|
|
140
|
-
}];
|
|
141
|
-
}
|
|
142
|
-
function L(e) {
|
|
143
|
-
if (typeof e == "object" && e) {
|
|
144
|
-
let t = e[j];
|
|
145
|
-
if (t !== void 0) return t;
|
|
55
|
+
function Q(e, t, n) {
|
|
56
|
+
if (t.first === t.last) {
|
|
57
|
+
e.insertBefore(t.first, n);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
let r = t.first;
|
|
61
|
+
for (; r !== null;) {
|
|
62
|
+
let i = r === t.last ? null : r.nextSibling;
|
|
63
|
+
e.insertBefore(r, n), r = i;
|
|
146
64
|
}
|
|
147
|
-
return e;
|
|
148
|
-
}
|
|
149
|
-
function R(e) {
|
|
150
|
-
if (typeof e != "object" || !e) return !1;
|
|
151
|
-
if (Array.isArray(e)) return !0;
|
|
152
|
-
let t = Object.getPrototypeOf(e);
|
|
153
|
-
return t === Object.prototype || t === null;
|
|
154
|
-
}
|
|
155
|
-
function z(e) {
|
|
156
|
-
if (!R(e)) return e;
|
|
157
|
-
let t = N.get(e);
|
|
158
|
-
return t === void 0 && (t = new Proxy(e, U), N.set(e, t)), t;
|
|
159
|
-
}
|
|
160
|
-
function B(e, t) {
|
|
161
|
-
let n = P.get(e);
|
|
162
|
-
n === void 0 && P.set(e, n = /* @__PURE__ */ new Map());
|
|
163
|
-
let r = n.get(t);
|
|
164
|
-
return r === void 0 && n.set(t, r = {
|
|
165
|
-
kind: 0,
|
|
166
|
-
observers: [],
|
|
167
|
-
seenBy: 0
|
|
168
|
-
}), r;
|
|
169
|
-
}
|
|
170
|
-
function V(e, t) {
|
|
171
|
-
let n = P.get(e)?.get(t);
|
|
172
|
-
n !== void 0 && o(n);
|
|
173
65
|
}
|
|
174
|
-
function
|
|
175
|
-
|
|
66
|
+
function $(e) {
|
|
67
|
+
e.dispose();
|
|
68
|
+
let t = e.first;
|
|
69
|
+
for (; t !== null;) {
|
|
70
|
+
let n = t === e.last ? null : t.nextSibling;
|
|
71
|
+
t.remove(), t = n;
|
|
72
|
+
}
|
|
176
73
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
74
|
+
// src/flow/for.ts
|
|
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) : []);
|
|
85
|
+
});
|
|
86
|
+
function u(e) {
|
|
87
|
+
let t = a.parentNode;
|
|
88
|
+
if (e.length === 0) {
|
|
89
|
+
for (let e of s) $(e);
|
|
90
|
+
s = [], l === null && i?.fallback && (l = Z(i.fallback, null), Q(t, l, a));
|
|
91
|
+
return;
|
|
194
92
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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]);
|
|
98
|
+
});
|
|
99
|
+
let r = Array(s.length).fill(!1), o = Array(e.length), c = Array(e.length);
|
|
100
|
+
for (let t = 0; t < e.length; t++) {
|
|
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;
|
|
203
107
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (t) throw t;
|
|
210
|
-
return !1;
|
|
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;
|
|
211
113
|
}
|
|
212
|
-
|
|
114
|
+
s = o;
|
|
213
115
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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);
|
|
121
|
+
return a.index = i, a;
|
|
122
|
+
}
|
|
123
|
+
return o;
|
|
124
|
+
}
|
|
125
|
+
function zt(e) {
|
|
126
|
+
let t = [], n = Array(e.length);
|
|
127
|
+
for (let r = 0; r < e.length; r++) {
|
|
128
|
+
let i = e[r];
|
|
129
|
+
if (i < 0) continue;
|
|
130
|
+
let a = 0, o = t.length;
|
|
131
|
+
for (; a < o;) {
|
|
132
|
+
let n = a + o >> 1;
|
|
133
|
+
e[t[n]] < i ? a = n + 1 : o = n;
|
|
226
134
|
}
|
|
227
|
-
r
|
|
228
|
-
} else {
|
|
229
|
-
for (let e of Object.keys(t)) i[e] = K(r[e], t[e], n);
|
|
230
|
-
for (let e of Object.keys(r)) Object.hasOwn(t, e) || delete i[e];
|
|
135
|
+
n[r] = a > 0 ? t[a - 1] : -1, t[a] = r;
|
|
231
136
|
}
|
|
137
|
+
let r = /* @__PURE__ */ new Set(), i = t.length > 0 ? t[t.length - 1] : -1;
|
|
138
|
+
for (; i >= 0;) r.add(i), i = n[i];
|
|
139
|
+
return r;
|
|
140
|
+
}
|
|
141
|
+
// src/flow/if.ts
|
|
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;
|
|
145
|
+
}
|
|
146
|
+
// src/flow/show.ts
|
|
147
|
+
function Vt(e, t) {
|
|
148
|
+
let r = t.style.display;
|
|
149
|
+
return n(() => {
|
|
150
|
+
e() ? t.style.display = r : t.style.display = "none";
|
|
151
|
+
}), t;
|
|
152
|
+
}
|
|
153
|
+
// src/flow/switch.ts
|
|
154
|
+
function Ht(e, t, n) {
|
|
155
|
+
let i = r(e);
|
|
156
|
+
return () => {
|
|
157
|
+
let e = t[i()] ?? n;
|
|
158
|
+
return e ? a(e) : null;
|
|
159
|
+
};
|
|
232
160
|
}
|
|
233
|
-
|
|
234
|
-
|
|
161
|
+
// src/flow/dynamic.ts
|
|
162
|
+
function Ut(e, t) {
|
|
163
|
+
let n = r(e);
|
|
164
|
+
return () => {
|
|
165
|
+
let e = n();
|
|
166
|
+
return e ? a(() => e(t)) : null;
|
|
167
|
+
};
|
|
235
168
|
}
|
|
236
|
-
// src/
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
function $t(e, n) {
|
|
240
|
-
if (n === null) throw Error("[keits] no target");
|
|
241
|
-
let r = t.marker(), i = t.marker();
|
|
242
|
-
n.append(r, i);
|
|
243
|
-
let a = T((t) => (c(n, e(), i), t));
|
|
169
|
+
// src/flow/catch.ts
|
|
170
|
+
function Wt(t, n) {
|
|
171
|
+
let r = e(null), i = () => r.set(null);
|
|
244
172
|
return () => {
|
|
245
|
-
|
|
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));
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
// src/flow/portal.ts
|
|
181
|
+
function Gt(e, t) {
|
|
182
|
+
if (s()) return null;
|
|
183
|
+
let n = t === void 0 ? document.body : t;
|
|
184
|
+
if (n === null) throw Error("[keits] no target");
|
|
185
|
+
let r = b.marker(), i = b.marker();
|
|
186
|
+
return n.append(r, i), x(n, a(e), i), c(() => {
|
|
246
187
|
let e = r;
|
|
247
188
|
for (; e !== null;) {
|
|
248
189
|
let t = e === i ? null : e.nextSibling;
|
|
249
190
|
e.remove(), e = t;
|
|
250
191
|
}
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
// src/
|
|
254
|
-
function
|
|
255
|
-
let
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
192
|
+
}), null;
|
|
193
|
+
}
|
|
194
|
+
// src/flow/suspense.ts
|
|
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);
|
|
199
|
+
}));
|
|
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 = {
|
|
203
|
+
item: null,
|
|
204
|
+
index: null,
|
|
205
|
+
dispose: () => {},
|
|
206
|
+
first: d,
|
|
207
|
+
last: f
|
|
208
|
+
}, h = b.marker(), g = document.createDocumentFragment();
|
|
209
|
+
g.append(h);
|
|
210
|
+
let v = null;
|
|
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());
|
|
216
|
+
});
|
|
217
|
+
}), g;
|
|
218
|
+
}
|
|
219
|
+
// src/async/lazy.ts
|
|
220
|
+
function qt(e) {
|
|
221
|
+
let t, n, r = () => n ??= Promise.resolve(e()).then((e) => t = e.default, (e) => {
|
|
222
|
+
throw n = void 0, e;
|
|
223
|
+
});
|
|
224
|
+
return Object.assign((e) => {
|
|
225
|
+
if (t !== void 0) return a(() => t(e));
|
|
226
|
+
let n = y(() => t ?? r());
|
|
227
|
+
return () => {
|
|
228
|
+
let t = n();
|
|
229
|
+
return t ? a(() => t(e)) : null;
|
|
230
|
+
};
|
|
231
|
+
}, { preload: r });
|
|
232
|
+
}
|
|
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 };
|