@sigx/terminal 0.3.1 → 0.4.1
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/LICENSE +21 -21
- package/README.md +61 -61
- package/dist/index.js +3 -1915
- package/package.json +14 -9
- package/dist/index.js.map +0 -1
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,1915 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
n = e;
|
|
5
|
-
}
|
|
6
|
-
function o() {
|
|
7
|
-
return n;
|
|
8
|
-
}
|
|
9
|
-
function s(e) {
|
|
10
|
-
r++;
|
|
11
|
-
try {
|
|
12
|
-
e();
|
|
13
|
-
} finally {
|
|
14
|
-
if (r--, r === 0) {
|
|
15
|
-
let e = Array.from(i);
|
|
16
|
-
i.clear();
|
|
17
|
-
for (let t of e) t();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function c(e) {
|
|
22
|
-
if (e.deps) {
|
|
23
|
-
for (let t of e.deps) t.delete(e);
|
|
24
|
-
e.deps.length = 0;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function l(e) {
|
|
28
|
-
n && (e.add(n), n.deps.push(e));
|
|
29
|
-
}
|
|
30
|
-
function u(e) {
|
|
31
|
-
let t = Array.from(e);
|
|
32
|
-
for (let e of t) r > 0 ? i.add(e) : e();
|
|
33
|
-
}
|
|
34
|
-
function d(e) {
|
|
35
|
-
let t = !1, r = function() {
|
|
36
|
-
if (t) return;
|
|
37
|
-
c(r);
|
|
38
|
-
let i = n;
|
|
39
|
-
n = r;
|
|
40
|
-
try {
|
|
41
|
-
e();
|
|
42
|
-
} finally {
|
|
43
|
-
n = i;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
r.deps = [], r();
|
|
47
|
-
let i = (() => r());
|
|
48
|
-
return i.stop = () => {
|
|
49
|
-
t = !0, c(r);
|
|
50
|
-
}, i;
|
|
51
|
-
}
|
|
52
|
-
function f(e) {
|
|
53
|
-
return d(e);
|
|
54
|
-
}
|
|
55
|
-
function p(e) {
|
|
56
|
-
let t = n;
|
|
57
|
-
n = null;
|
|
58
|
-
try {
|
|
59
|
-
return e();
|
|
60
|
-
} finally {
|
|
61
|
-
n = t;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function m(e) {
|
|
65
|
-
let t = [], n = !0;
|
|
66
|
-
return {
|
|
67
|
-
run(e) {
|
|
68
|
-
if (n) return e();
|
|
69
|
-
},
|
|
70
|
-
stop() {
|
|
71
|
-
n = !1, t.forEach((e) => e());
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region ../reactivity/src/collections.ts
|
|
77
|
-
var h = Symbol("iterate"), g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap();
|
|
78
|
-
function v(e) {
|
|
79
|
-
let t = g.get(e);
|
|
80
|
-
return t ? v(t) : e;
|
|
81
|
-
}
|
|
82
|
-
function ee(e) {
|
|
83
|
-
return g.has(e);
|
|
84
|
-
}
|
|
85
|
-
function y(e) {
|
|
86
|
-
if (!e || typeof e != "object") return !1;
|
|
87
|
-
let t = e.constructor;
|
|
88
|
-
return t === Set || t === Map || t === WeakSet || t === WeakMap;
|
|
89
|
-
}
|
|
90
|
-
function te(e) {
|
|
91
|
-
if (!e || typeof e != "object") return !1;
|
|
92
|
-
let t = e.constructor;
|
|
93
|
-
return t === Set || t === Map;
|
|
94
|
-
}
|
|
95
|
-
function b(e) {
|
|
96
|
-
if (!e || typeof e != "object") return !1;
|
|
97
|
-
let t = Object.prototype.toString.call(e);
|
|
98
|
-
return [
|
|
99
|
-
"[object Date]",
|
|
100
|
-
"[object RegExp]",
|
|
101
|
-
"[object Error]",
|
|
102
|
-
"[object Promise]",
|
|
103
|
-
"[object ArrayBuffer]",
|
|
104
|
-
"[object DataView]",
|
|
105
|
-
"[object Int8Array]",
|
|
106
|
-
"[object Uint8Array]",
|
|
107
|
-
"[object Uint8ClampedArray]",
|
|
108
|
-
"[object Int16Array]",
|
|
109
|
-
"[object Uint16Array]",
|
|
110
|
-
"[object Int32Array]",
|
|
111
|
-
"[object Uint32Array]",
|
|
112
|
-
"[object Float32Array]",
|
|
113
|
-
"[object Float64Array]",
|
|
114
|
-
"[object BigInt64Array]",
|
|
115
|
-
"[object BigUint64Array]"
|
|
116
|
-
].includes(t);
|
|
117
|
-
}
|
|
118
|
-
function ne(e, t) {
|
|
119
|
-
let n = {};
|
|
120
|
-
return n.has = function(e) {
|
|
121
|
-
let n = v(this), r = v(e);
|
|
122
|
-
return l(t(r)), n.has(r);
|
|
123
|
-
}, n.get = function(e) {
|
|
124
|
-
let n = v(this), r = v(e);
|
|
125
|
-
l(t(r));
|
|
126
|
-
let i = n.get(r);
|
|
127
|
-
return i && typeof i == "object" && _.get(i) || i;
|
|
128
|
-
}, Object.defineProperty(n, "size", { get() {
|
|
129
|
-
let e = v(this);
|
|
130
|
-
return l(t(h)), e.size;
|
|
131
|
-
} }), n.forEach = function(e, n) {
|
|
132
|
-
let r = v(this);
|
|
133
|
-
l(t(h)), r.forEach((t, r) => {
|
|
134
|
-
let i = t && typeof t == "object" && _.get(t) || t, a = r && typeof r == "object" && _.get(r) || r;
|
|
135
|
-
e.call(n, i, a, this);
|
|
136
|
-
});
|
|
137
|
-
}, n.keys = function() {
|
|
138
|
-
let e = v(this);
|
|
139
|
-
return l(t(h)), x(e.keys(), !1);
|
|
140
|
-
}, n.values = function() {
|
|
141
|
-
let e = v(this);
|
|
142
|
-
return l(t(h)), x(e.values(), !0);
|
|
143
|
-
}, n.entries = function() {
|
|
144
|
-
let e = v(this);
|
|
145
|
-
return l(t(h)), S(e.entries());
|
|
146
|
-
}, n[Symbol.iterator] = function() {
|
|
147
|
-
let e = v(this);
|
|
148
|
-
return l(t(h)), e instanceof Set ? x(e.values(), !0) : S(e.entries());
|
|
149
|
-
}, n.add = function(t) {
|
|
150
|
-
let n = v(this), r = v(t), i = n.has(r);
|
|
151
|
-
if (n.add(r), !i) {
|
|
152
|
-
let t = e.get(r);
|
|
153
|
-
t && u(t);
|
|
154
|
-
let n = e.get(h);
|
|
155
|
-
n && u(n);
|
|
156
|
-
}
|
|
157
|
-
return this;
|
|
158
|
-
}, n.set = function(t, n) {
|
|
159
|
-
let r = v(this), i = v(t), a = v(n), o = r.has(i), s = r.get(i);
|
|
160
|
-
if (r.set(i, a), !o) {
|
|
161
|
-
let t = e.get(h);
|
|
162
|
-
t && u(t);
|
|
163
|
-
}
|
|
164
|
-
if (!o || !Object.is(s, a)) {
|
|
165
|
-
let t = e.get(i);
|
|
166
|
-
t && u(t);
|
|
167
|
-
}
|
|
168
|
-
return this;
|
|
169
|
-
}, n.delete = function(t) {
|
|
170
|
-
let n = v(this), r = v(t), i = n.has(r), a = n.delete(r);
|
|
171
|
-
if (i) {
|
|
172
|
-
let t = e.get(r);
|
|
173
|
-
t && u(t);
|
|
174
|
-
let n = e.get(h);
|
|
175
|
-
n && u(n);
|
|
176
|
-
}
|
|
177
|
-
return a;
|
|
178
|
-
}, n.clear = function() {
|
|
179
|
-
let t = v(this), n = t.size > 0;
|
|
180
|
-
if (t.clear(), n) for (let t of e.values()) u(t);
|
|
181
|
-
}, n;
|
|
182
|
-
}
|
|
183
|
-
function x(e, t) {
|
|
184
|
-
return {
|
|
185
|
-
next() {
|
|
186
|
-
let { value: n, done: r } = e.next();
|
|
187
|
-
return r ? {
|
|
188
|
-
value: void 0,
|
|
189
|
-
done: !0
|
|
190
|
-
} : {
|
|
191
|
-
value: t && n && typeof n == "object" && _.get(n) || n,
|
|
192
|
-
done: !1
|
|
193
|
-
};
|
|
194
|
-
},
|
|
195
|
-
[Symbol.iterator]() {
|
|
196
|
-
return this;
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function S(e) {
|
|
201
|
-
return {
|
|
202
|
-
next() {
|
|
203
|
-
let { value: t, done: n } = e.next();
|
|
204
|
-
if (n) return {
|
|
205
|
-
value: void 0,
|
|
206
|
-
done: !0
|
|
207
|
-
};
|
|
208
|
-
let [r, i] = t;
|
|
209
|
-
return {
|
|
210
|
-
value: [r && typeof r == "object" && _.get(r) || r, i && typeof i == "object" && _.get(i) || i],
|
|
211
|
-
done: !1
|
|
212
|
-
};
|
|
213
|
-
},
|
|
214
|
-
[Symbol.iterator]() {
|
|
215
|
-
return this;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
//#endregion
|
|
220
|
-
//#region ../reactivity/src/signal.ts
|
|
221
|
-
function C(e) {
|
|
222
|
-
if (e == null) return !0;
|
|
223
|
-
let t = typeof e;
|
|
224
|
-
return t === "string" || t === "number" || t === "boolean" || t === "symbol" || t === "bigint";
|
|
225
|
-
}
|
|
226
|
-
var w = null;
|
|
227
|
-
function T() {
|
|
228
|
-
return w;
|
|
229
|
-
}
|
|
230
|
-
function E(e) {
|
|
231
|
-
w = e;
|
|
232
|
-
}
|
|
233
|
-
function D(e) {
|
|
234
|
-
let t = null, n = w;
|
|
235
|
-
w = (e, n) => {
|
|
236
|
-
t = [e, n];
|
|
237
|
-
};
|
|
238
|
-
try {
|
|
239
|
-
e();
|
|
240
|
-
} finally {
|
|
241
|
-
w = n;
|
|
242
|
-
}
|
|
243
|
-
return t;
|
|
244
|
-
}
|
|
245
|
-
var O = {};
|
|
246
|
-
[
|
|
247
|
-
"push",
|
|
248
|
-
"pop",
|
|
249
|
-
"shift",
|
|
250
|
-
"unshift",
|
|
251
|
-
"splice",
|
|
252
|
-
"sort",
|
|
253
|
-
"reverse"
|
|
254
|
-
].forEach((e) => {
|
|
255
|
-
O[e] = function(...t) {
|
|
256
|
-
let n;
|
|
257
|
-
return s(() => {
|
|
258
|
-
n = Array.prototype[e].apply(this, t);
|
|
259
|
-
}), n;
|
|
260
|
-
};
|
|
261
|
-
}), [
|
|
262
|
-
"includes",
|
|
263
|
-
"indexOf",
|
|
264
|
-
"lastIndexOf"
|
|
265
|
-
].forEach((e) => {
|
|
266
|
-
O[e] = function(...t) {
|
|
267
|
-
let n = v(this), r = Array.prototype[e].apply(this, t);
|
|
268
|
-
return r !== -1 && r !== !1 ? r : Array.prototype[e].apply(n, t);
|
|
269
|
-
};
|
|
270
|
-
});
|
|
271
|
-
function k(e) {
|
|
272
|
-
if (C(e)) return k({ value: e });
|
|
273
|
-
let t = e;
|
|
274
|
-
if (b(t) || ee(t)) return t;
|
|
275
|
-
let r = _.get(t);
|
|
276
|
-
if (r) return r;
|
|
277
|
-
let i = y(t), a = i ? /* @__PURE__ */ new Map() : null, o = /* @__PURE__ */ new WeakMap(), c = (e) => {
|
|
278
|
-
a ||= /* @__PURE__ */ new Map();
|
|
279
|
-
let t = a.get(e);
|
|
280
|
-
return t || (t = /* @__PURE__ */ new Set(), a.set(e, t)), t;
|
|
281
|
-
}, d = i ? ne(a, c) : null, f = new Proxy(t, {
|
|
282
|
-
get(e, t, r) {
|
|
283
|
-
if (t === "$set") return (t) => {
|
|
284
|
-
s(() => {
|
|
285
|
-
if (Array.isArray(e) && Array.isArray(t)) {
|
|
286
|
-
let e = t.length;
|
|
287
|
-
for (let n = 0; n < e; n++) Reflect.set(r, String(n), t[n]);
|
|
288
|
-
Reflect.set(r, "length", e);
|
|
289
|
-
} else {
|
|
290
|
-
let n = Object.keys(t), i = Object.keys(e);
|
|
291
|
-
for (let e of n) Reflect.set(r, e, t[e]);
|
|
292
|
-
for (let e of i) e in t || Reflect.deleteProperty(r, e);
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
};
|
|
296
|
-
if (d) {
|
|
297
|
-
if (t === "size" && te(e)) return n && l(c(h)), e.size;
|
|
298
|
-
if (t in d) {
|
|
299
|
-
let e = d[t];
|
|
300
|
-
return typeof e == "function" ? e.bind(r) : e;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (Array.isArray(e) && typeof t == "string" && O.hasOwnProperty(t)) return O[t];
|
|
304
|
-
let i = Reflect.get(e, t);
|
|
305
|
-
if (w && w(r, t), !d && n && l(c(t)), i && typeof i == "object" && !b(i)) {
|
|
306
|
-
let e = o.get(i);
|
|
307
|
-
return e || (e = k(i), o.set(i, e)), e;
|
|
308
|
-
}
|
|
309
|
-
return i;
|
|
310
|
-
},
|
|
311
|
-
set(e, t, n) {
|
|
312
|
-
let r = Array.isArray(e) ? e.length : 0, i = Reflect.get(e, t), o = Reflect.set(e, t, n);
|
|
313
|
-
if (!Object.is(i, n) && a) {
|
|
314
|
-
let i = a.get(t);
|
|
315
|
-
if (i && u(i), Array.isArray(e)) {
|
|
316
|
-
if (t !== "length" && e.length !== r) {
|
|
317
|
-
let e = a.get("length");
|
|
318
|
-
e && u(e);
|
|
319
|
-
}
|
|
320
|
-
if (t === "length" && typeof n == "number" && n < r) for (let e = n; e < r; e++) {
|
|
321
|
-
let t = a.get(String(e));
|
|
322
|
-
t && u(t);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
return o;
|
|
327
|
-
},
|
|
328
|
-
deleteProperty(e, t) {
|
|
329
|
-
let n = Object.prototype.hasOwnProperty.call(e, t), r = Reflect.deleteProperty(e, t);
|
|
330
|
-
if (r && n && a) {
|
|
331
|
-
let e = a.get(t);
|
|
332
|
-
e && u(e);
|
|
333
|
-
}
|
|
334
|
-
return r;
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
return g.set(f, t), _.set(t, f), f;
|
|
338
|
-
}
|
|
339
|
-
//#endregion
|
|
340
|
-
//#region ../reactivity/src/watch.ts
|
|
341
|
-
function A(e, t = Infinity, n = /* @__PURE__ */ new Set()) {
|
|
342
|
-
if (t <= 0 || typeof e != "object" || !e || n.has(e)) return e;
|
|
343
|
-
if (n.add(e), Array.isArray(e)) for (let r = 0; r < e.length; r++) A(e[r], t - 1, n);
|
|
344
|
-
else if (e instanceof Map) e.forEach((e, r) => {
|
|
345
|
-
A(r, t - 1, n), A(e, t - 1, n);
|
|
346
|
-
});
|
|
347
|
-
else if (e instanceof Set) e.forEach((e) => {
|
|
348
|
-
A(e, t - 1, n);
|
|
349
|
-
});
|
|
350
|
-
else for (let r of Object.keys(e)) A(e[r], t - 1, n);
|
|
351
|
-
return e;
|
|
352
|
-
}
|
|
353
|
-
function re(e, t, n) {
|
|
354
|
-
let r, i = !0, a = null, o = !1, s, c = !1, l = !1, u = n?.deep, d = u === !0 ? Infinity : typeof u == "number" ? u : 0, p = f(() => {
|
|
355
|
-
if (l) return;
|
|
356
|
-
let u = typeof e == "function" ? e() : e;
|
|
357
|
-
if (d > 0 && A(u, d), o) {
|
|
358
|
-
s = u, c = !0;
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
i ? (n?.immediate && (a && a(), t(u, r, (e) => a = e), n?.once && (l = !0, queueMicrotask(() => m()))), i = !1) : (a && a(), t(u, r, (e) => a = e), n?.once && (l = !0, queueMicrotask(() => m()))), r = u;
|
|
362
|
-
}), m = () => {
|
|
363
|
-
l = !0, p.stop(), a && a();
|
|
364
|
-
};
|
|
365
|
-
return Object.assign(m, {
|
|
366
|
-
stop: m,
|
|
367
|
-
pause: () => {
|
|
368
|
-
o = !0;
|
|
369
|
-
},
|
|
370
|
-
resume: () => {
|
|
371
|
-
o && (o = !1, c && !Object.is(s, r) && (a && a(), t(s, r, (e) => a = e), r = s), c = !1, s = void 0);
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
//#endregion
|
|
376
|
-
//#region ../reactivity/src/computed.ts
|
|
377
|
-
function ie(e) {
|
|
378
|
-
let n, r;
|
|
379
|
-
typeof e == "function" ? n = e : (n = e.get, r = e.set);
|
|
380
|
-
let i = /* @__PURE__ */ new Set(), s, d = !0, f = function() {
|
|
381
|
-
d || (d = !0, u(i));
|
|
382
|
-
};
|
|
383
|
-
f.deps = [];
|
|
384
|
-
let p = () => {
|
|
385
|
-
c(f);
|
|
386
|
-
let e = o();
|
|
387
|
-
a(f);
|
|
388
|
-
try {
|
|
389
|
-
return s = n(), d = !1, s;
|
|
390
|
-
} finally {
|
|
391
|
-
a(e);
|
|
392
|
-
}
|
|
393
|
-
}, m = {
|
|
394
|
-
[t]: !0,
|
|
395
|
-
get value() {
|
|
396
|
-
let e = T();
|
|
397
|
-
e && (e(m, "value"), E(null)), l(i);
|
|
398
|
-
let t = d ? p() : s;
|
|
399
|
-
return e && E(e), t;
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
return r && Object.defineProperty(m, "value", {
|
|
403
|
-
get() {
|
|
404
|
-
let e = T();
|
|
405
|
-
e && (e(m, "value"), E(null)), l(i);
|
|
406
|
-
let t = d ? p() : s;
|
|
407
|
-
return e && E(e), t;
|
|
408
|
-
},
|
|
409
|
-
set(e) {
|
|
410
|
-
r(e);
|
|
411
|
-
},
|
|
412
|
-
enumerable: !0,
|
|
413
|
-
configurable: !1
|
|
414
|
-
}), m;
|
|
415
|
-
}
|
|
416
|
-
function j(e) {
|
|
417
|
-
return typeof e == "object" && !!e && t in e;
|
|
418
|
-
}
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region ../runtime-core/src/plugins.ts
|
|
421
|
-
var ae = [];
|
|
422
|
-
function oe() {
|
|
423
|
-
return ae;
|
|
424
|
-
}
|
|
425
|
-
var se = [];
|
|
426
|
-
function ce(e) {
|
|
427
|
-
for (let t of se) t(e);
|
|
428
|
-
}
|
|
429
|
-
//#endregion
|
|
430
|
-
//#region __vite-browser-external
|
|
431
|
-
var le = /* @__PURE__ */ e(((e, t) => {
|
|
432
|
-
t.exports = {};
|
|
433
|
-
})), ue = null;
|
|
434
|
-
try {
|
|
435
|
-
if (typeof globalThis < "u" && globalThis.process !== void 0) {
|
|
436
|
-
let e = globalThis.process?.versions?.node ? le() : null;
|
|
437
|
-
e?.AsyncLocalStorage && (ue = new e.AsyncLocalStorage());
|
|
438
|
-
}
|
|
439
|
-
} catch {}
|
|
440
|
-
var de = {
|
|
441
|
-
currentComponentContext: null,
|
|
442
|
-
currentSuspenseBoundary: null
|
|
443
|
-
};
|
|
444
|
-
function fe() {
|
|
445
|
-
if (ue) {
|
|
446
|
-
let e = ue.getStore();
|
|
447
|
-
if (e) return e;
|
|
448
|
-
}
|
|
449
|
-
return de;
|
|
450
|
-
}
|
|
451
|
-
function pe() {
|
|
452
|
-
return fe().currentComponentContext;
|
|
453
|
-
}
|
|
454
|
-
function me(e) {
|
|
455
|
-
let t = fe(), n = t.currentComponentContext;
|
|
456
|
-
return t.currentComponentContext = e, n;
|
|
457
|
-
}
|
|
458
|
-
function he() {
|
|
459
|
-
return fe().currentSuspenseBoundary;
|
|
460
|
-
}
|
|
461
|
-
function ge(e) {
|
|
462
|
-
let t = fe(), n = t.currentSuspenseBoundary;
|
|
463
|
-
return t.currentSuspenseBoundary = e, n;
|
|
464
|
-
}
|
|
465
|
-
//#endregion
|
|
466
|
-
//#region ../runtime-core/src/component-lifecycle.ts
|
|
467
|
-
var M = null;
|
|
468
|
-
function _e() {
|
|
469
|
-
return pe() ?? M;
|
|
470
|
-
}
|
|
471
|
-
function ve(e) {
|
|
472
|
-
let t = me(e), n = M;
|
|
473
|
-
return M = e, t ?? n;
|
|
474
|
-
}
|
|
475
|
-
function N(e) {
|
|
476
|
-
M ? M.onMounted(e) : console.warn("onMounted called outside of component setup");
|
|
477
|
-
}
|
|
478
|
-
function P(e) {
|
|
479
|
-
M ? M.onUnmounted(e) : console.warn("onUnmounted called outside of component setup");
|
|
480
|
-
}
|
|
481
|
-
function ye(e) {
|
|
482
|
-
M ? M.onCreated(e) : console.warn("onCreated called outside of component setup");
|
|
483
|
-
}
|
|
484
|
-
function be(e) {
|
|
485
|
-
M ? M.onUpdated(e) : console.warn("onUpdated called outside of component setup");
|
|
486
|
-
}
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region ../runtime-core/src/component.ts
|
|
489
|
-
var xe = /* @__PURE__ */ new Map();
|
|
490
|
-
function Se(e) {
|
|
491
|
-
return xe.get(e);
|
|
492
|
-
}
|
|
493
|
-
function F(e, t) {
|
|
494
|
-
let n = function(e) {
|
|
495
|
-
return {
|
|
496
|
-
type: n,
|
|
497
|
-
props: e || {},
|
|
498
|
-
key: e?.key || null,
|
|
499
|
-
children: [],
|
|
500
|
-
dom: null
|
|
501
|
-
};
|
|
502
|
-
};
|
|
503
|
-
return n.__setup = e, n.__name = t?.name, n.__props = null, n.__events = null, n.__ref = null, n.__slots = null, xe.set(n, {
|
|
504
|
-
name: t?.name,
|
|
505
|
-
setup: e
|
|
506
|
-
}), oe().forEach((r) => r.onDefine?.(t?.name, n, e)), n;
|
|
507
|
-
}
|
|
508
|
-
//#endregion
|
|
509
|
-
//#region ../runtime-core/src/errors.ts
|
|
510
|
-
var I = class extends Error {
|
|
511
|
-
constructor(e, t) {
|
|
512
|
-
super(e), this.name = "SigxError", this.code = t.code, this.suggestion = t.suggestion, t.cause && (this.cause = t.cause);
|
|
513
|
-
}
|
|
514
|
-
}, L = {
|
|
515
|
-
NO_MOUNT_FUNCTION: "SIGX001",
|
|
516
|
-
RENDER_TARGET_NOT_FOUND: "SIGX100",
|
|
517
|
-
MOUNT_TARGET_NOT_FOUND: "SIGX101",
|
|
518
|
-
ASYNC_SETUP_CLIENT: "SIGX102",
|
|
519
|
-
PROVIDE_OUTSIDE_SETUP: "SIGX200",
|
|
520
|
-
PROVIDE_INVALID_INJECTABLE: "SIGX201"
|
|
521
|
-
};
|
|
522
|
-
function Ce() {
|
|
523
|
-
return new I("No mount function provided and no default mount function set.", {
|
|
524
|
-
code: L.NO_MOUNT_FUNCTION,
|
|
525
|
-
suggestion: "Either pass a mount function to app.mount(), or import a platform package (e.g., @sigx/runtime-dom or @sigx/runtime-terminal) that sets the default."
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
function we(e) {
|
|
529
|
-
return new I(`Render target "${e}" not found.`, {
|
|
530
|
-
code: L.RENDER_TARGET_NOT_FOUND,
|
|
531
|
-
suggestion: `Make sure the element exists in your HTML: <div id="${e.replace(/^#/, "")}"></div>`
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
function Te(e) {
|
|
535
|
-
return new I(`Mount target "${e}" not found.`, {
|
|
536
|
-
code: L.MOUNT_TARGET_NOT_FOUND,
|
|
537
|
-
suggestion: `Make sure the element exists in your HTML: <div id="${e.replace(/^#/, "")}"></div>`
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
function Ee(e) {
|
|
541
|
-
return new I(`Async setup in component "${e}" is only supported during SSR.`, {
|
|
542
|
-
code: L.ASYNC_SETUP_CLIENT,
|
|
543
|
-
suggestion: "On the client, use pre-loaded data from hydration or fetch in onMounted."
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
function De() {
|
|
547
|
-
return new I("defineProvide must be called inside a component setup function.", {
|
|
548
|
-
code: L.PROVIDE_OUTSIDE_SETUP,
|
|
549
|
-
suggestion: "Move the defineProvide() call inside your component's setup function, or use app.defineProvide() at the app level."
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
function Oe() {
|
|
553
|
-
return new I("defineProvide must be called with a function created by defineInjectable.", {
|
|
554
|
-
code: L.PROVIDE_INVALID_INJECTABLE,
|
|
555
|
-
suggestion: "Create an injectable first:\n const useMyService = defineInjectable(() => new MyService());\n defineProvide(useMyService);"
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
//#endregion
|
|
559
|
-
//#region ../runtime-core/src/di/injectable.ts
|
|
560
|
-
var ke = /* @__PURE__ */ new Map(), Ae = Symbol("sigx:appContext");
|
|
561
|
-
function je(e) {
|
|
562
|
-
let t = _e();
|
|
563
|
-
if (!t) return;
|
|
564
|
-
let n = t;
|
|
565
|
-
for (; n;) {
|
|
566
|
-
if (n.provides && n.provides.has(e)) return n.provides.get(e);
|
|
567
|
-
n = n.parent;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
function Me(e, t) {
|
|
571
|
-
let n = _e();
|
|
572
|
-
if (!n) throw De();
|
|
573
|
-
let r = n;
|
|
574
|
-
r.provides ||= /* @__PURE__ */ new Map(), r.provides.set(e, t);
|
|
575
|
-
}
|
|
576
|
-
function Ne(e) {
|
|
577
|
-
let t = Symbol(), n = (() => {
|
|
578
|
-
let n = je(t);
|
|
579
|
-
return n === void 0 ? (ke.has(t) || ke.set(t, e()), ke.get(t)) : n;
|
|
580
|
-
});
|
|
581
|
-
return n._factory = e, n._token = t, n;
|
|
582
|
-
}
|
|
583
|
-
function Pe(e, t) {
|
|
584
|
-
let n = t ?? e._factory, r = e._token;
|
|
585
|
-
if (!n || !r) throw Oe();
|
|
586
|
-
let i = n();
|
|
587
|
-
return Me(r, i), i;
|
|
588
|
-
}
|
|
589
|
-
function Fe() {
|
|
590
|
-
return je(Ae) ?? null;
|
|
591
|
-
}
|
|
592
|
-
function Ie() {
|
|
593
|
-
return Ae;
|
|
594
|
-
}
|
|
595
|
-
function Le(e, t) {
|
|
596
|
-
let n = e;
|
|
597
|
-
if (n.provides ||= /* @__PURE__ */ new Map(), n.provides.set(Ae, t), t.provides) for (let [e, r] of t.provides) n.provides.set(e, r);
|
|
598
|
-
}
|
|
599
|
-
//#endregion
|
|
600
|
-
//#region ../runtime-core/src/directives.ts
|
|
601
|
-
var Re = Symbol.for("sigx.directive");
|
|
602
|
-
function ze(e) {
|
|
603
|
-
return e[Re] = !0, e;
|
|
604
|
-
}
|
|
605
|
-
function Be(e) {
|
|
606
|
-
return typeof e == "object" && !!e && e[Re] === !0;
|
|
607
|
-
}
|
|
608
|
-
//#endregion
|
|
609
|
-
//#region ../runtime-core/src/app.ts
|
|
610
|
-
var R = typeof process < "u" && process.env.NODE_ENV !== "production" || !0, Ve = null;
|
|
611
|
-
function He(e) {
|
|
612
|
-
Ve = e;
|
|
613
|
-
}
|
|
614
|
-
function Ue(e) {
|
|
615
|
-
let t = /* @__PURE__ */ new Set(), n = {
|
|
616
|
-
app: null,
|
|
617
|
-
provides: /* @__PURE__ */ new Map(),
|
|
618
|
-
config: {},
|
|
619
|
-
hooks: [],
|
|
620
|
-
directives: /* @__PURE__ */ new Map()
|
|
621
|
-
}, r = !1, i = null, a = null, o = {
|
|
622
|
-
config: n.config,
|
|
623
|
-
use(e, n) {
|
|
624
|
-
return t.has(e) ? (R && console.warn(`Plugin ${e.name || "anonymous"} is already installed.`), o) : (t.add(e), typeof e == "function" ? e(o, n) : e && typeof e.install == "function" ? e.install(o, n) : R && console.warn("Invalid plugin: must be a function or have an install() method."), o);
|
|
625
|
-
},
|
|
626
|
-
defineProvide(e, t) {
|
|
627
|
-
let r = t ?? e._factory, i = e._token;
|
|
628
|
-
if (!r || !i) throw Oe();
|
|
629
|
-
let a = r();
|
|
630
|
-
return n.provides.set(i, a), a;
|
|
631
|
-
},
|
|
632
|
-
hook(e) {
|
|
633
|
-
return n.hooks.push(e), o;
|
|
634
|
-
},
|
|
635
|
-
directive(e, t) {
|
|
636
|
-
return t === void 0 ? n.directives.get(e) : (R && !Be(t) && console.warn(`[sigx] app.directive('${e}', ...) received a value that is not a valid directive definition. Use defineDirective() to create directive definitions.`), n.directives.set(e, t), o);
|
|
637
|
-
},
|
|
638
|
-
mount(t, s) {
|
|
639
|
-
if (r) return R && console.warn("App is already mounted. Call app.unmount() first."), o;
|
|
640
|
-
let c = s ?? Ve;
|
|
641
|
-
if (!c) throw Ce();
|
|
642
|
-
i = t, r = !0;
|
|
643
|
-
let l = c(e, t, n);
|
|
644
|
-
return typeof l == "function" && (a = l), o;
|
|
645
|
-
},
|
|
646
|
-
unmount() {
|
|
647
|
-
if (!r) {
|
|
648
|
-
R && console.warn("App is not mounted.");
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
a && a(), n.provides.clear(), r = !1, i = null;
|
|
652
|
-
},
|
|
653
|
-
get _context() {
|
|
654
|
-
return n;
|
|
655
|
-
},
|
|
656
|
-
get _isMounted() {
|
|
657
|
-
return r;
|
|
658
|
-
},
|
|
659
|
-
get _container() {
|
|
660
|
-
return i;
|
|
661
|
-
},
|
|
662
|
-
get _rootComponent() {
|
|
663
|
-
return e;
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
n.app = o;
|
|
667
|
-
let s = Ie();
|
|
668
|
-
return n.provides.set(s, n), o;
|
|
669
|
-
}
|
|
670
|
-
function We(e, t) {
|
|
671
|
-
if (e) for (let n of e.hooks) try {
|
|
672
|
-
n.onComponentCreated?.(t);
|
|
673
|
-
} catch (n) {
|
|
674
|
-
Ye(e, n, t, "onComponentCreated");
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
function Ge(e, t) {
|
|
678
|
-
if (e) for (let n of e.hooks) try {
|
|
679
|
-
n.onComponentMounted?.(t);
|
|
680
|
-
} catch (n) {
|
|
681
|
-
Ye(e, n, t, "onComponentMounted");
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
function Ke(e, t) {
|
|
685
|
-
if (e) for (let n of e.hooks) try {
|
|
686
|
-
n.onComponentUnmounted?.(t);
|
|
687
|
-
} catch (n) {
|
|
688
|
-
Ye(e, n, t, "onComponentUnmounted");
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
function qe(e, t) {
|
|
692
|
-
if (e) for (let n of e.hooks) try {
|
|
693
|
-
n.onComponentUpdated?.(t);
|
|
694
|
-
} catch (n) {
|
|
695
|
-
Ye(e, n, t, "onComponentUpdated");
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
function Je(e, t, n, r) {
|
|
699
|
-
if (!e) return !1;
|
|
700
|
-
for (let i of e.hooks) try {
|
|
701
|
-
if (i.onComponentError?.(t, n, r) === !0) return !0;
|
|
702
|
-
} catch (e) {
|
|
703
|
-
console.error("Error in onComponentError hook:", e);
|
|
704
|
-
}
|
|
705
|
-
if (e.config.errorHandler) try {
|
|
706
|
-
if (e.config.errorHandler(t, n, r) === !0) return !0;
|
|
707
|
-
} catch (e) {
|
|
708
|
-
console.error("Error in app.config.errorHandler:", e);
|
|
709
|
-
}
|
|
710
|
-
return !1;
|
|
711
|
-
}
|
|
712
|
-
function Ye(e, t, n, r) {
|
|
713
|
-
if (console.error(`Error in ${r} hook:`, t), e.config.errorHandler) try {
|
|
714
|
-
e.config.errorHandler(t, n, `plugin hook: ${r}`);
|
|
715
|
-
} catch {}
|
|
716
|
-
}
|
|
717
|
-
//#endregion
|
|
718
|
-
//#region ../runtime-core/src/compound.ts
|
|
719
|
-
function Xe(e, t) {
|
|
720
|
-
return Object.assign(e, t);
|
|
721
|
-
}
|
|
722
|
-
//#endregion
|
|
723
|
-
//#region ../runtime-core/src/model.ts
|
|
724
|
-
var Ze = Symbol.for("sigx.model");
|
|
725
|
-
function Qe(e, t) {
|
|
726
|
-
let [n, r] = e;
|
|
727
|
-
return {
|
|
728
|
-
get value() {
|
|
729
|
-
return n[r];
|
|
730
|
-
},
|
|
731
|
-
set value(e) {
|
|
732
|
-
t(e);
|
|
733
|
-
},
|
|
734
|
-
get binding() {
|
|
735
|
-
return [
|
|
736
|
-
n,
|
|
737
|
-
r,
|
|
738
|
-
t
|
|
739
|
-
];
|
|
740
|
-
},
|
|
741
|
-
[Ze]: !0
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
function $e(e) {
|
|
745
|
-
let [t, n, r] = e;
|
|
746
|
-
return Qe([t, n], r);
|
|
747
|
-
}
|
|
748
|
-
function z(e) {
|
|
749
|
-
return typeof e == "object" && !!e && Ze in e && e[Ze] === !0;
|
|
750
|
-
}
|
|
751
|
-
//#endregion
|
|
752
|
-
//#region ../runtime-core/src/platform.ts
|
|
753
|
-
var et = null;
|
|
754
|
-
function tt() {
|
|
755
|
-
return et;
|
|
756
|
-
}
|
|
757
|
-
//#endregion
|
|
758
|
-
//#region ../runtime-core/src/utils/is-component.ts
|
|
759
|
-
function B(e) {
|
|
760
|
-
return typeof e == "function" && "__setup" in e;
|
|
761
|
-
}
|
|
762
|
-
//#endregion
|
|
763
|
-
//#region ../runtime-core/src/jsx-runtime.ts
|
|
764
|
-
var V = Symbol.for("sigx.Fragment"), H = Symbol.for("sigx.Text"), U = Symbol.for("sigx.Comment"), nt = {}, rt = [];
|
|
765
|
-
function it() {
|
|
766
|
-
return {
|
|
767
|
-
type: U,
|
|
768
|
-
props: nt,
|
|
769
|
-
key: null,
|
|
770
|
-
children: rt,
|
|
771
|
-
dom: null
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
function at(e) {
|
|
775
|
-
return {
|
|
776
|
-
type: H,
|
|
777
|
-
props: nt,
|
|
778
|
-
key: null,
|
|
779
|
-
children: rt,
|
|
780
|
-
dom: null,
|
|
781
|
-
text: e
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
function W(e) {
|
|
785
|
-
return e == null || e === !1 || e === !0 ? [] : j(e) ? W(e.value) : typeof e == "string" || typeof e == "number" ? [at(e)] : e.type ? [e] : Array.isArray(e) ? e.map(ot) : [];
|
|
786
|
-
}
|
|
787
|
-
function ot(e) {
|
|
788
|
-
if (e == null || e === !1 || e === !0) return it();
|
|
789
|
-
if (typeof e == "string" || typeof e == "number") return at(e);
|
|
790
|
-
if (j(e)) return W(e.value)[0] ?? it();
|
|
791
|
-
if (Array.isArray(e)) {
|
|
792
|
-
let t = W(e);
|
|
793
|
-
return t.length === 0 ? it() : t.length === 1 ? t[0] : {
|
|
794
|
-
type: V,
|
|
795
|
-
props: nt,
|
|
796
|
-
key: null,
|
|
797
|
-
children: t,
|
|
798
|
-
dom: null
|
|
799
|
-
};
|
|
800
|
-
}
|
|
801
|
-
return e.type ? e : it();
|
|
802
|
-
}
|
|
803
|
-
function G(e, t, n) {
|
|
804
|
-
let r = B(e), i = !1;
|
|
805
|
-
if (t) {
|
|
806
|
-
for (let e in t) if (e === "model" || e.startsWith("model:")) {
|
|
807
|
-
i = !0;
|
|
808
|
-
break;
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
if (!i) {
|
|
812
|
-
if (r) {
|
|
813
|
-
let { children: r, ...i } = t || {};
|
|
814
|
-
return {
|
|
815
|
-
type: e,
|
|
816
|
-
props: {
|
|
817
|
-
...i,
|
|
818
|
-
children: r
|
|
819
|
-
},
|
|
820
|
-
key: n || i.key || null,
|
|
821
|
-
children: rt,
|
|
822
|
-
dom: null
|
|
823
|
-
};
|
|
824
|
-
}
|
|
825
|
-
if (typeof e == "function" && e !== V) return e(t);
|
|
826
|
-
let { children: i, ...a } = t || {};
|
|
827
|
-
return {
|
|
828
|
-
type: e,
|
|
829
|
-
props: a,
|
|
830
|
-
key: n || a.key || null,
|
|
831
|
-
children: W(i),
|
|
832
|
-
dom: null
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
let a = { ...t }, o = {};
|
|
836
|
-
if (t) {
|
|
837
|
-
for (let n in t) if (n === "model") {
|
|
838
|
-
let i = t[n], s = null, c = null;
|
|
839
|
-
if (z(i)) {
|
|
840
|
-
let [e, t, n] = i.binding;
|
|
841
|
-
s = [e, t], c = n;
|
|
842
|
-
} else if (typeof i == "function") {
|
|
843
|
-
let e = D(i);
|
|
844
|
-
e && typeof e[1] == "string" && (s = e);
|
|
845
|
-
} else Array.isArray(i) && i.length === 2 && typeof i[1] == "string" && (s = i);
|
|
846
|
-
if (s) {
|
|
847
|
-
let [n, i] = s, l = !1;
|
|
848
|
-
if (!c) {
|
|
849
|
-
let e = a["onUpdate:modelValue"];
|
|
850
|
-
c = (t) => {
|
|
851
|
-
let r = n[`onUpdate:${i}`];
|
|
852
|
-
typeof r == "function" ? r(t) : n[i] = t, e && e(t);
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
let u = tt();
|
|
856
|
-
typeof e == "string" && u && (l = u(e, a, s, t)), r ? (o.model = Qe(s, c), a["onUpdate:modelValue"] = c) : l || (a.modelValue = n[i], a["onUpdate:modelValue"] = c), delete a.model;
|
|
857
|
-
}
|
|
858
|
-
} else if (n.startsWith("model:")) {
|
|
859
|
-
let e = t[n], i = n.slice(6), s = null, c = null;
|
|
860
|
-
if (z(e)) {
|
|
861
|
-
let [t, n, r] = e.binding;
|
|
862
|
-
s = [t, n], c = r;
|
|
863
|
-
} else if (typeof e == "function") {
|
|
864
|
-
let t = D(e);
|
|
865
|
-
t && typeof t[1] == "string" && (s = t);
|
|
866
|
-
} else Array.isArray(e) && e.length === 2 && typeof e[1] == "string" && (s = e);
|
|
867
|
-
if (s) {
|
|
868
|
-
let [e, t] = s, l = `onUpdate:${i}`;
|
|
869
|
-
if (!c) {
|
|
870
|
-
let n = a[l];
|
|
871
|
-
c = (r) => {
|
|
872
|
-
let i = e[`onUpdate:${t}`];
|
|
873
|
-
typeof i == "function" ? i(r) : e[t] = r, n && n(r);
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
r ? (o[i] = Qe(s, c), a[l] = c) : (a[i] = e[t], a[l] = c), delete a[n];
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
if (Object.keys(o).length > 0 && (a.$models = o), B(e)) {
|
|
881
|
-
let { children: t, ...r } = a;
|
|
882
|
-
return {
|
|
883
|
-
type: e,
|
|
884
|
-
props: {
|
|
885
|
-
...r,
|
|
886
|
-
children: t
|
|
887
|
-
},
|
|
888
|
-
key: n || r.key || null,
|
|
889
|
-
children: [],
|
|
890
|
-
dom: null
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
if (typeof e == "function" && e !== V) return e(a);
|
|
894
|
-
let { children: s, ...c } = a;
|
|
895
|
-
return {
|
|
896
|
-
type: e,
|
|
897
|
-
props: c,
|
|
898
|
-
key: n || c.key || null,
|
|
899
|
-
children: W(s),
|
|
900
|
-
dom: null
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
function K(e, t, n) {
|
|
904
|
-
return G(e, t, n);
|
|
905
|
-
}
|
|
906
|
-
var st = G, ct = null;
|
|
907
|
-
function lt(e) {
|
|
908
|
-
let t = he() ?? ct;
|
|
909
|
-
return t ? (t.pending.add(e), e.finally(() => {
|
|
910
|
-
t.pending.delete(e), t.pending.size === 0 && t.onResolve();
|
|
911
|
-
}), !0) : !1;
|
|
912
|
-
}
|
|
913
|
-
function ut(e) {
|
|
914
|
-
let t = null, n = null, r = null, i = "pending", a = F((a) => {
|
|
915
|
-
let o = a.signal({
|
|
916
|
-
state: i,
|
|
917
|
-
tick: 0
|
|
918
|
-
});
|
|
919
|
-
function c(e) {
|
|
920
|
-
let t = { ...a.props }, n = a.slots.default();
|
|
921
|
-
n.length > 0 && (t.children = n);
|
|
922
|
-
let r = a.slots._slotsFromProps;
|
|
923
|
-
if (r) {
|
|
924
|
-
let e = {}, n = !1;
|
|
925
|
-
for (let t of Object.keys(r)) e[t] = r[t], n = !0;
|
|
926
|
-
n && (t.slots = e);
|
|
927
|
-
}
|
|
928
|
-
return G(e, t);
|
|
929
|
-
}
|
|
930
|
-
if (n ? i === "pending" && n.then(() => {
|
|
931
|
-
o.state === "pending" && s(() => {
|
|
932
|
-
o.state = "resolved", o.tick++;
|
|
933
|
-
});
|
|
934
|
-
}).catch(() => {
|
|
935
|
-
o.state === "pending" && s(() => {
|
|
936
|
-
o.state = "rejected", o.tick++;
|
|
937
|
-
});
|
|
938
|
-
}) : n = e().then((e) => (t = "default" in e ? e.default : e, i = "resolved", s(() => {
|
|
939
|
-
o.state = "resolved", o.tick++;
|
|
940
|
-
}), t)).catch((e) => {
|
|
941
|
-
throw r = e instanceof Error ? e : Error(String(e)), i = "rejected", s(() => {
|
|
942
|
-
o.state = "rejected", o.tick++;
|
|
943
|
-
}), r;
|
|
944
|
-
}), i === "resolved" && t) return () => c(t);
|
|
945
|
-
if (i === "rejected" && r) throw r;
|
|
946
|
-
return lt(n) || n.catch(() => {}), () => {
|
|
947
|
-
let e = o.state;
|
|
948
|
-
if (o.tick, e === "resolved" && t) return c(t);
|
|
949
|
-
if (e === "rejected" && r) throw r;
|
|
950
|
-
return null;
|
|
951
|
-
};
|
|
952
|
-
}, { name: "LazyComponent" });
|
|
953
|
-
return a.__lazy = !0, a.preload = () => (n ||= e().then((e) => (t = "default" in e ? e.default : e, i = "resolved", t)).catch((e) => {
|
|
954
|
-
throw r = e instanceof Error ? e : Error(String(e)), i = "rejected", r;
|
|
955
|
-
}), n), a.isLoaded = () => i === "resolved", a;
|
|
956
|
-
}
|
|
957
|
-
var dt = F((e) => {
|
|
958
|
-
let { props: t, slots: n } = e, r = e.signal({
|
|
959
|
-
isReady: !1,
|
|
960
|
-
pendingCount: 0
|
|
961
|
-
}), i = {
|
|
962
|
-
pending: /* @__PURE__ */ new Set(),
|
|
963
|
-
onResolve: () => {
|
|
964
|
-
r.pendingCount = i.pending.size, i.pending.size === 0 && (r.isReady = !0);
|
|
965
|
-
}
|
|
966
|
-
};
|
|
967
|
-
return e.onMounted(() => {
|
|
968
|
-
i.pending.size === 0 && (r.isReady = !0);
|
|
969
|
-
}), () => {
|
|
970
|
-
r.isReady, r.pendingCount;
|
|
971
|
-
let e = he() ?? ct;
|
|
972
|
-
ct = i, ge(i);
|
|
973
|
-
try {
|
|
974
|
-
let e = n.default();
|
|
975
|
-
if (i.pending.size > 0) {
|
|
976
|
-
let e = t.fallback;
|
|
977
|
-
return typeof e == "function" ? e() : e ?? null;
|
|
978
|
-
}
|
|
979
|
-
if (Array.isArray(e)) {
|
|
980
|
-
let t = e.filter((e) => e != null && e !== !1 && e !== !0);
|
|
981
|
-
return t.length === 0 ? null : t.length === 1 ? t[0] : t;
|
|
982
|
-
}
|
|
983
|
-
return e;
|
|
984
|
-
} catch (e) {
|
|
985
|
-
if (e instanceof Promise) {
|
|
986
|
-
lt(e);
|
|
987
|
-
let n = t.fallback;
|
|
988
|
-
return typeof n == "function" ? n() : n ?? null;
|
|
989
|
-
}
|
|
990
|
-
throw e;
|
|
991
|
-
} finally {
|
|
992
|
-
ct = e, ge(e);
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
}, { name: "Suspense" });
|
|
996
|
-
function ft(e) {
|
|
997
|
-
return e && e.__lazy === !0;
|
|
998
|
-
}
|
|
999
|
-
//#endregion
|
|
1000
|
-
//#region ../runtime-core/src/use-async.ts
|
|
1001
|
-
function pt(e) {
|
|
1002
|
-
let t = k({
|
|
1003
|
-
value: null,
|
|
1004
|
-
loading: !0,
|
|
1005
|
-
error: null
|
|
1006
|
-
});
|
|
1007
|
-
return e().then((e) => {
|
|
1008
|
-
s(() => {
|
|
1009
|
-
t.value = e, t.loading = !1;
|
|
1010
|
-
});
|
|
1011
|
-
}).catch((e) => {
|
|
1012
|
-
s(() => {
|
|
1013
|
-
t.error = e instanceof Error ? e : Error(String(e)), t.loading = !1;
|
|
1014
|
-
});
|
|
1015
|
-
}), t;
|
|
1016
|
-
}
|
|
1017
|
-
//#endregion
|
|
1018
|
-
//#region ../runtime-core/src/error-boundary.ts
|
|
1019
|
-
var mt = F((e) => {
|
|
1020
|
-
let { fallback: t } = e.props, { slots: n } = e, r = e.signal({
|
|
1021
|
-
hasError: !1,
|
|
1022
|
-
error: null
|
|
1023
|
-
}), i = () => {
|
|
1024
|
-
r.hasError = !1, r.error = null;
|
|
1025
|
-
};
|
|
1026
|
-
return () => {
|
|
1027
|
-
if (r.hasError && r.error) return typeof t == "function" ? t(r.error, i) : t ?? null;
|
|
1028
|
-
try {
|
|
1029
|
-
return n.default();
|
|
1030
|
-
} catch (e) {
|
|
1031
|
-
let n = e instanceof Error ? e : Error(String(e));
|
|
1032
|
-
return r.hasError = !0, r.error = n, process.env.NODE_ENV !== "production" && console.error("[ErrorBoundary] Caught error during render:", n), typeof t == "function" ? t(n, i) : t ?? null;
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
}, { name: "ErrorBoundary" }), ht = class {
|
|
1036
|
-
static isPromise(e) {
|
|
1037
|
-
return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
function gt() {
|
|
1041
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1042
|
-
var t = Math.random() * 16 | 0;
|
|
1043
|
-
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
//#endregion
|
|
1047
|
-
//#region ../runtime-core/src/models/index.ts
|
|
1048
|
-
var _t = gt, vt = /* @__PURE__ */ function(e) {
|
|
1049
|
-
return e[e.Transient = 0] = "Transient", e[e.Scoped = 1] = "Scoped", e[e.Singleton = 2] = "Singleton", e;
|
|
1050
|
-
}({});
|
|
1051
|
-
//#endregion
|
|
1052
|
-
//#region ../runtime-core/src/messaging/index.ts
|
|
1053
|
-
function yt(e) {
|
|
1054
|
-
let t = [];
|
|
1055
|
-
return {
|
|
1056
|
-
publish: (e) => {
|
|
1057
|
-
t.forEach((t) => t(e));
|
|
1058
|
-
},
|
|
1059
|
-
subscribe: (e) => {
|
|
1060
|
-
t.push(e);
|
|
1061
|
-
let n = () => {
|
|
1062
|
-
let n = t.indexOf(e);
|
|
1063
|
-
n > -1 && t.splice(n, 1);
|
|
1064
|
-
};
|
|
1065
|
-
try {
|
|
1066
|
-
P(n);
|
|
1067
|
-
} catch {}
|
|
1068
|
-
return { unsubscribe: n };
|
|
1069
|
-
},
|
|
1070
|
-
destroy: () => {
|
|
1071
|
-
t = [];
|
|
1072
|
-
}
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
function bt(e) {
|
|
1076
|
-
return { subscribe: (t) => e.subscribe(t) };
|
|
1077
|
-
}
|
|
1078
|
-
//#endregion
|
|
1079
|
-
//#region ../runtime-core/src/di/factory.ts
|
|
1080
|
-
var xt = class {
|
|
1081
|
-
constructor() {
|
|
1082
|
-
this.unsubs = [];
|
|
1083
|
-
}
|
|
1084
|
-
add(e) {
|
|
1085
|
-
this.unsubs.push(e);
|
|
1086
|
-
}
|
|
1087
|
-
unsubscribe() {
|
|
1088
|
-
this.unsubs.forEach((e) => e()), this.unsubs = [];
|
|
1089
|
-
}
|
|
1090
|
-
};
|
|
1091
|
-
function St(e, t, n) {
|
|
1092
|
-
let r = (...t) => {
|
|
1093
|
-
let n = new xt(), r = /* @__PURE__ */ new Set(), i = null, a = e({
|
|
1094
|
-
onDeactivated: (e) => r.add(e),
|
|
1095
|
-
subscriptions: n,
|
|
1096
|
-
overrideDispose: (e) => i = e
|
|
1097
|
-
}, ...t), o = () => {
|
|
1098
|
-
r.forEach((e) => e()), n.unsubscribe(), a && typeof a == "object" && "dispose" in a && typeof a.dispose == "function" && a.dispose();
|
|
1099
|
-
};
|
|
1100
|
-
if (i) i(o);
|
|
1101
|
-
else try {
|
|
1102
|
-
P(() => o());
|
|
1103
|
-
} catch {}
|
|
1104
|
-
return {
|
|
1105
|
-
...a,
|
|
1106
|
-
dispose: o
|
|
1107
|
-
};
|
|
1108
|
-
};
|
|
1109
|
-
return e.length <= 1 ? Ne(() => r()) : r;
|
|
1110
|
-
}
|
|
1111
|
-
//#endregion
|
|
1112
|
-
//#region ../runtime-core/src/utils/props-accessor.ts
|
|
1113
|
-
function Ct(e) {
|
|
1114
|
-
return new Proxy(e, {
|
|
1115
|
-
get(e, t) {
|
|
1116
|
-
if (typeof t != "symbol") return e[t];
|
|
1117
|
-
},
|
|
1118
|
-
has(e, t) {
|
|
1119
|
-
return typeof t == "symbol" ? !1 : t in e;
|
|
1120
|
-
},
|
|
1121
|
-
ownKeys(e) {
|
|
1122
|
-
return Object.keys(e);
|
|
1123
|
-
},
|
|
1124
|
-
getOwnPropertyDescriptor(e, t) {
|
|
1125
|
-
if (typeof t != "symbol" && t in e) return {
|
|
1126
|
-
enumerable: !0,
|
|
1127
|
-
configurable: !0,
|
|
1128
|
-
writable: !1
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
//#endregion
|
|
1134
|
-
//#region ../runtime-core/src/utils/slots.ts
|
|
1135
|
-
function wt(e, t) {
|
|
1136
|
-
let n = k({ v: 0 });
|
|
1137
|
-
function r(e) {
|
|
1138
|
-
let t = [], n = {};
|
|
1139
|
-
if (e == null) return {
|
|
1140
|
-
defaultChildren: t,
|
|
1141
|
-
namedSlots: n
|
|
1142
|
-
};
|
|
1143
|
-
let r = Array.isArray(e) ? e : [e];
|
|
1144
|
-
for (let e of r) if (e && typeof e == "object" && e.props && e.props.slot) {
|
|
1145
|
-
let t = e.props.slot;
|
|
1146
|
-
n[t] || (n[t] = []), n[t].push(e);
|
|
1147
|
-
} else t.push(e);
|
|
1148
|
-
return {
|
|
1149
|
-
defaultChildren: t,
|
|
1150
|
-
namedSlots: n
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
return new Proxy({
|
|
1154
|
-
_children: e,
|
|
1155
|
-
_slotsFromProps: t || {},
|
|
1156
|
-
_version: n,
|
|
1157
|
-
_isPatching: !1,
|
|
1158
|
-
default: function() {
|
|
1159
|
-
this._version.v;
|
|
1160
|
-
let e = this._children, { defaultChildren: t } = r(e);
|
|
1161
|
-
return t.filter((e) => e != null && e !== !1 && e !== !0);
|
|
1162
|
-
}
|
|
1163
|
-
}, { get(e, t) {
|
|
1164
|
-
if (t in e) return e[t];
|
|
1165
|
-
if (typeof t == "string") return function(n) {
|
|
1166
|
-
if (e._version.v, e._slotsFromProps && typeof e._slotsFromProps[t] == "function") {
|
|
1167
|
-
let r = e._slotsFromProps[t](n);
|
|
1168
|
-
return r == null ? [] : Array.isArray(r) ? r : [r];
|
|
1169
|
-
}
|
|
1170
|
-
let { namedSlots: i } = r(e._children);
|
|
1171
|
-
return i[t] || [];
|
|
1172
|
-
};
|
|
1173
|
-
} });
|
|
1174
|
-
}
|
|
1175
|
-
//#endregion
|
|
1176
|
-
//#region ../runtime-core/src/utils/normalize.ts
|
|
1177
|
-
function Tt(e) {
|
|
1178
|
-
return e == null || e === !1 || e === !0 ? {
|
|
1179
|
-
type: H,
|
|
1180
|
-
props: {},
|
|
1181
|
-
key: null,
|
|
1182
|
-
children: [],
|
|
1183
|
-
dom: null,
|
|
1184
|
-
text: ""
|
|
1185
|
-
} : j(e) ? Tt(e.value) : Array.isArray(e) ? {
|
|
1186
|
-
type: V,
|
|
1187
|
-
props: {},
|
|
1188
|
-
key: null,
|
|
1189
|
-
children: e,
|
|
1190
|
-
dom: null
|
|
1191
|
-
} : typeof e == "string" || typeof e == "number" ? {
|
|
1192
|
-
type: H,
|
|
1193
|
-
props: {},
|
|
1194
|
-
key: null,
|
|
1195
|
-
children: [],
|
|
1196
|
-
dom: null,
|
|
1197
|
-
text: e
|
|
1198
|
-
} : e;
|
|
1199
|
-
}
|
|
1200
|
-
//#endregion
|
|
1201
|
-
//#region ../runtime-core/src/hydration/index.ts
|
|
1202
|
-
var Et = "client:", Dt = [
|
|
1203
|
-
"client:load",
|
|
1204
|
-
"client:idle",
|
|
1205
|
-
"client:visible",
|
|
1206
|
-
"client:media",
|
|
1207
|
-
"client:only"
|
|
1208
|
-
];
|
|
1209
|
-
function Ot(e) {
|
|
1210
|
-
return (t, ...n) => {
|
|
1211
|
-
let r = `on${t[0].toUpperCase() + t.slice(1)}`, i = ("value" in e ? e.value : e)?.[r];
|
|
1212
|
-
i && typeof i == "function" && i(...n);
|
|
1213
|
-
};
|
|
1214
|
-
}
|
|
1215
|
-
//#endregion
|
|
1216
|
-
//#region ../runtime-core/src/renderer.ts
|
|
1217
|
-
function q(e, t) {
|
|
1218
|
-
let n = e.key == null ? null : e.key, r = t.key == null ? null : t.key;
|
|
1219
|
-
return e.type === t.type ? n === r ? !0 : String(n) === String(r) : !1;
|
|
1220
|
-
}
|
|
1221
|
-
function kt(e, t, n) {
|
|
1222
|
-
let r = /* @__PURE__ */ new Map();
|
|
1223
|
-
for (let i = t; i <= n; i++) {
|
|
1224
|
-
let t = e[i]?.key;
|
|
1225
|
-
if (t != null) {
|
|
1226
|
-
let e = String(t);
|
|
1227
|
-
process.env.NODE_ENV !== "production" && r.has(e) && console.warn(`[SignalX] Duplicate key "${t}" detected in list. Keys should be unique among siblings to ensure correct reconciliation. This may cause unexpected behavior when items are reordered, added, or removed.`), r.set(e, i);
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
return r;
|
|
1231
|
-
}
|
|
1232
|
-
function At(e, t, n, r) {
|
|
1233
|
-
for (let i = n; i <= r; i++) if (e[i] && q(e[i], t)) return i;
|
|
1234
|
-
return null;
|
|
1235
|
-
}
|
|
1236
|
-
function jt(e) {
|
|
1237
|
-
if (process.env.NODE_ENV === "production") return;
|
|
1238
|
-
let t = /* @__PURE__ */ new Set();
|
|
1239
|
-
for (let n of e) if (n?.key != null) {
|
|
1240
|
-
let e = String(n.key);
|
|
1241
|
-
t.has(e) && console.warn(`[SignalX] Duplicate key "${n.key}" detected in list. Keys should be unique among siblings to ensure correct reconciliation. This may cause unexpected behavior when items are reordered, added, or removed.`), t.add(e);
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
function Mt(e) {
|
|
1245
|
-
let { insert: t, remove: n, patchProp: r, createElement: i, createText: a, createComment: o, setText: s, setElementText: c, parentNode: l, nextSibling: u, cloneNode: d, insertStaticContent: m, patchDirective: h, onElementMounted: g, onElementUnmounted: _, getActiveElement: v, restoreFocus: ee } = e, y = null;
|
|
1246
|
-
function te(e, t, n) {
|
|
1247
|
-
n && (y = n);
|
|
1248
|
-
let r = t._vnode, i = null;
|
|
1249
|
-
e != null && e !== !1 && e !== !0 && (i = typeof e == "string" || typeof e == "number" ? {
|
|
1250
|
-
type: H,
|
|
1251
|
-
props: {},
|
|
1252
|
-
key: null,
|
|
1253
|
-
children: [],
|
|
1254
|
-
dom: null,
|
|
1255
|
-
text: e
|
|
1256
|
-
} : B(e) ? {
|
|
1257
|
-
type: e,
|
|
1258
|
-
props: {},
|
|
1259
|
-
key: null,
|
|
1260
|
-
children: [],
|
|
1261
|
-
dom: null
|
|
1262
|
-
} : e), i ? (r ? C(r, i, t) : x(i, t), t._vnode = i) : r && (S(r, t), t._vnode = null);
|
|
1263
|
-
}
|
|
1264
|
-
let b = new Set(/* @__PURE__ */ "svg.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.switch.symbol.text.textPath.title.tspan.use.view".split("."));
|
|
1265
|
-
function ne(e) {
|
|
1266
|
-
return b.has(e);
|
|
1267
|
-
}
|
|
1268
|
-
function x(e, n, s = null, c = !1) {
|
|
1269
|
-
if (e == null || e === !1 || e === !0) return;
|
|
1270
|
-
if (e.type === H) {
|
|
1271
|
-
let r = a(String(e.text));
|
|
1272
|
-
e.dom = r, r.__vnode = e, t(r, n, s);
|
|
1273
|
-
return;
|
|
1274
|
-
}
|
|
1275
|
-
if (e.type === U) {
|
|
1276
|
-
let r = o("");
|
|
1277
|
-
e.dom = r, t(r, n, s);
|
|
1278
|
-
return;
|
|
1279
|
-
}
|
|
1280
|
-
if (e.type === V) {
|
|
1281
|
-
let r = o("");
|
|
1282
|
-
e.dom = r, t(r, n, s), e.children && e.children.forEach((e) => x(e, n, r, c));
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
if (B(e.type)) {
|
|
1286
|
-
E(e, n, s, e.type.__setup);
|
|
1287
|
-
return;
|
|
1288
|
-
}
|
|
1289
|
-
let l = e.type, u = l === "svg" || c && l !== "foreignObject", d = i(l, u);
|
|
1290
|
-
if (e.dom = d, d.__vnode = e, e.props) {
|
|
1291
|
-
for (let t in e.props) t !== "children" && t !== "key" && t !== "ref" && (t.charCodeAt(0) === 117 && t.startsWith("use:") ? h && h(d, t.slice(4), null, e.props[t], y) : r(d, t, null, e.props[t], u));
|
|
1292
|
-
e.props.ref && p(() => {
|
|
1293
|
-
typeof e.props.ref == "function" ? e.props.ref(d) : typeof e.props.ref == "object" && (e.props.ref.current = d);
|
|
1294
|
-
});
|
|
1295
|
-
}
|
|
1296
|
-
let f = u && l !== "foreignObject";
|
|
1297
|
-
e.children && e.children.forEach((t) => {
|
|
1298
|
-
t.parent = e, x(t, d, null, f);
|
|
1299
|
-
}), t(d, n, s), g && g(d);
|
|
1300
|
-
}
|
|
1301
|
-
function S(e, t) {
|
|
1302
|
-
let r = e;
|
|
1303
|
-
if (r._effect && r._effect.stop(), e.cleanup && e.cleanup(), B(e.type)) {
|
|
1304
|
-
let i = r._subTreeRef?.current ?? r._subTree;
|
|
1305
|
-
i && S(i, t), e.dom && n(e.dom), e.props?.ref && p(() => {
|
|
1306
|
-
typeof e.props.ref == "function" ? e.props.ref(null) : typeof e.props.ref == "object" && (e.props.ref.current = null);
|
|
1307
|
-
});
|
|
1308
|
-
return;
|
|
1309
|
-
}
|
|
1310
|
-
if (e.type === V) {
|
|
1311
|
-
e.children && e.children.forEach((e) => S(e, t)), e.dom && n(e.dom);
|
|
1312
|
-
return;
|
|
1313
|
-
}
|
|
1314
|
-
if (e.type === U) {
|
|
1315
|
-
e.dom && n(e.dom);
|
|
1316
|
-
return;
|
|
1317
|
-
}
|
|
1318
|
-
e.props?.ref && p(() => {
|
|
1319
|
-
typeof e.props.ref == "function" ? e.props.ref(null) : e.props.ref && typeof e.props.ref == "object" && (e.props.ref.current = null);
|
|
1320
|
-
}), _ && e.dom && _(e.dom), e.children && e.children.length > 0 && e.children.forEach((t) => S(t, e.dom)), e.dom && n(e.dom);
|
|
1321
|
-
}
|
|
1322
|
-
function C(e, n, i) {
|
|
1323
|
-
if (e === n) return;
|
|
1324
|
-
if (!q(e, n)) {
|
|
1325
|
-
let t = l(e.dom) || i, r = e.dom ? u(e.dom) : null;
|
|
1326
|
-
S(e, t), x(n, t, r);
|
|
1327
|
-
return;
|
|
1328
|
-
}
|
|
1329
|
-
let o = e, c = n;
|
|
1330
|
-
if (o._effect) {
|
|
1331
|
-
n.dom = e.dom, c._effect = o._effect, c._subTree = o._subTree, c._subTreeRef = o._subTreeRef, c._slots = o._slots;
|
|
1332
|
-
let t = o._componentProps;
|
|
1333
|
-
if (c._componentProps = t, t) {
|
|
1334
|
-
let e = n.props || {}, r = n.props?.$models || {};
|
|
1335
|
-
p(() => {
|
|
1336
|
-
for (let n in e) n !== "children" && n !== "key" && n !== "ref" && n !== "$models" && t[n] !== e[n] && (t[n] = e[n]);
|
|
1337
|
-
for (let e in r) {
|
|
1338
|
-
let n = r[e], i = t[e];
|
|
1339
|
-
if (z(n)) {
|
|
1340
|
-
if (z(i)) {
|
|
1341
|
-
let [e, t] = n.binding, [r, a] = i.binding;
|
|
1342
|
-
if (e === r && t === a) continue;
|
|
1343
|
-
}
|
|
1344
|
-
t[e] = n;
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
for (let n in t) !(n in e) && !(n in r) && n !== "children" && n !== "key" && n !== "ref" && n !== "$models" && delete t[n];
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
let r = o._slots, i = n.props?.children, a = n.props?.slots;
|
|
1351
|
-
if (r && (i !== void 0 && (r._children = i), a !== void 0 && (r._slotsFromProps = a), !r._isPatching)) {
|
|
1352
|
-
r._isPatching = !0;
|
|
1353
|
-
try {
|
|
1354
|
-
p(() => {
|
|
1355
|
-
r._version.v++;
|
|
1356
|
-
});
|
|
1357
|
-
} finally {
|
|
1358
|
-
r._isPatching = !1;
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
return;
|
|
1362
|
-
}
|
|
1363
|
-
if (n.type === H) {
|
|
1364
|
-
if (n.dom = e.dom, !n.dom) {
|
|
1365
|
-
let r = a(String(n.text));
|
|
1366
|
-
n.dom = r, i && t(r, i, e.dom || null);
|
|
1367
|
-
return;
|
|
1368
|
-
}
|
|
1369
|
-
e.text !== n.text && s(n.dom, String(n.text));
|
|
1370
|
-
return;
|
|
1371
|
-
}
|
|
1372
|
-
if (n.type === U) {
|
|
1373
|
-
n.dom = e.dom;
|
|
1374
|
-
return;
|
|
1375
|
-
}
|
|
1376
|
-
if (n.type === V) {
|
|
1377
|
-
w(e, n, i, !1);
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
let d = n.dom = e.dom;
|
|
1381
|
-
if (!d) {
|
|
1382
|
-
x(n, i);
|
|
1383
|
-
return;
|
|
1384
|
-
}
|
|
1385
|
-
let f = n.type, m = f === "svg" || ne(f), g = e.props || {}, _ = n.props || {};
|
|
1386
|
-
for (let e in g) !(e in _) && e !== "children" && e !== "key" && e !== "ref" && (e.charCodeAt(0) === 117 && e.startsWith("use:") ? h && h(d, e.slice(4), g[e], null, y) : r(d, e, g[e], null, m));
|
|
1387
|
-
for (let e in _) {
|
|
1388
|
-
let t = g[e], n = _[e];
|
|
1389
|
-
e !== "children" && e !== "key" && e !== "ref" && t !== n && (e.charCodeAt(0) === 117 && e.startsWith("use:") ? h && h(d, e.slice(4), t, n, y) : r(d, e, t, n, m));
|
|
1390
|
-
}
|
|
1391
|
-
w(e, n, d, m && f !== "foreignObject");
|
|
1392
|
-
}
|
|
1393
|
-
function w(e, t, n, r = !1) {
|
|
1394
|
-
let i = e.children, a = t.children;
|
|
1395
|
-
a.forEach((e) => e.parent = t), T(n, i, a, r);
|
|
1396
|
-
}
|
|
1397
|
-
function T(e, n, r, i = !1) {
|
|
1398
|
-
process.env.NODE_ENV !== "production" && jt(r);
|
|
1399
|
-
let a = 0, o = n.length - 1, s = n[0], c = n[o], l = 0, d = r.length - 1, f = r[0], p = r[d], m;
|
|
1400
|
-
for (; a <= o && l <= d;) if (s == null) s = n[++a];
|
|
1401
|
-
else if (c == null) c = n[--o];
|
|
1402
|
-
else if (q(s, f)) C(s, f, e), s = n[++a], f = r[++l];
|
|
1403
|
-
else if (q(c, p)) C(c, p, e), c = n[--o], p = r[--d];
|
|
1404
|
-
else if (q(s, p)) {
|
|
1405
|
-
C(s, p, e);
|
|
1406
|
-
let i = s.dom, o = c.dom ? u(c.dom) : null;
|
|
1407
|
-
i && t(i, e, o), s = n[++a], p = r[--d];
|
|
1408
|
-
} else if (q(c, f)) {
|
|
1409
|
-
C(c, f, e);
|
|
1410
|
-
let i = c.dom, a = s.dom ?? null;
|
|
1411
|
-
i && t(i, e, a), c = n[--o], f = r[++l];
|
|
1412
|
-
} else {
|
|
1413
|
-
m ||= kt(n, a, o);
|
|
1414
|
-
let c = f.key == null ? At(n, f, a, o) : m.get(String(f.key));
|
|
1415
|
-
if (c != null) {
|
|
1416
|
-
let r = n[c];
|
|
1417
|
-
C(r, f, e), n[c] = void 0, r.dom && s.dom && t(r.dom, e, s.dom);
|
|
1418
|
-
} else x(f, e, s.dom ?? null, i);
|
|
1419
|
-
f = r[++l];
|
|
1420
|
-
}
|
|
1421
|
-
if (a > o) {
|
|
1422
|
-
if (l <= d) {
|
|
1423
|
-
let t = r[d + 1] == null ? null : r[d + 1].dom ?? null;
|
|
1424
|
-
for (let n = l; n <= d; n++) x(r[n], e, t, i);
|
|
1425
|
-
}
|
|
1426
|
-
} else if (l > d) for (let t = a; t <= o; t++) n[t] && S(n[t], e);
|
|
1427
|
-
}
|
|
1428
|
-
function E(e, n, r, i) {
|
|
1429
|
-
let a = o("");
|
|
1430
|
-
e.dom = a, a.__vnode = e, t(a, n, r);
|
|
1431
|
-
let s = null, c = !1, { children: l, slots: u, $models: d, ...m } = e.props || {}, h = { ...m };
|
|
1432
|
-
if (d) for (let e in d) {
|
|
1433
|
-
let t = d[e];
|
|
1434
|
-
z(t) && (h[e] = t);
|
|
1435
|
-
}
|
|
1436
|
-
let g = k(h), _ = e;
|
|
1437
|
-
_._componentProps = g;
|
|
1438
|
-
let te = wt(l, u);
|
|
1439
|
-
_._slots = te;
|
|
1440
|
-
let b = [], ne = [], w = [], T = [], E = _e(), D = e.type.__name, O = {
|
|
1441
|
-
el: n,
|
|
1442
|
-
signal: k,
|
|
1443
|
-
props: Ct(g),
|
|
1444
|
-
slots: te,
|
|
1445
|
-
emit: Ot(g),
|
|
1446
|
-
parent: E,
|
|
1447
|
-
onMounted: (e) => {
|
|
1448
|
-
ne.push(e);
|
|
1449
|
-
},
|
|
1450
|
-
onUnmounted: (e) => {
|
|
1451
|
-
T.push(e);
|
|
1452
|
-
},
|
|
1453
|
-
onCreated: (e) => {
|
|
1454
|
-
b.push(e);
|
|
1455
|
-
},
|
|
1456
|
-
onUpdated: (e) => {
|
|
1457
|
-
w.push(e);
|
|
1458
|
-
},
|
|
1459
|
-
expose: (e) => {
|
|
1460
|
-
s = e, c = !0;
|
|
1461
|
-
},
|
|
1462
|
-
renderFn: null,
|
|
1463
|
-
update: () => {}
|
|
1464
|
-
};
|
|
1465
|
-
ce(O), O.__name = D, !E && y && Le(O, y);
|
|
1466
|
-
let A = {
|
|
1467
|
-
name: D,
|
|
1468
|
-
ctx: O,
|
|
1469
|
-
vnode: e
|
|
1470
|
-
}, re = ve(O), ie;
|
|
1471
|
-
try {
|
|
1472
|
-
let e = i(O);
|
|
1473
|
-
if (e && typeof e.then == "function") throw Ee(D ?? "anonymous");
|
|
1474
|
-
ie = e, We(y, A), b.forEach((e) => e());
|
|
1475
|
-
} catch (e) {
|
|
1476
|
-
if (!Je(y, e, A, "setup")) throw e;
|
|
1477
|
-
} finally {
|
|
1478
|
-
ve(re);
|
|
1479
|
-
}
|
|
1480
|
-
if (e.props?.ref) {
|
|
1481
|
-
let t = c ? s : null;
|
|
1482
|
-
p(() => {
|
|
1483
|
-
typeof e.props.ref == "function" ? e.props.ref(t) : e.props.ref && typeof e.props.ref == "object" && (e.props.ref.current = t);
|
|
1484
|
-
});
|
|
1485
|
-
}
|
|
1486
|
-
if (ie) {
|
|
1487
|
-
O.renderFn = ie;
|
|
1488
|
-
let e = { current: null };
|
|
1489
|
-
_._subTreeRef = e;
|
|
1490
|
-
let t = f(() => {
|
|
1491
|
-
let t = ve(O);
|
|
1492
|
-
try {
|
|
1493
|
-
let t = O.renderFn();
|
|
1494
|
-
if (t == null) {
|
|
1495
|
-
e.current && (S(e.current, n), e.current = null, _._subTree = null);
|
|
1496
|
-
return;
|
|
1497
|
-
}
|
|
1498
|
-
let r = Tt(t), i = e.current;
|
|
1499
|
-
if (i) {
|
|
1500
|
-
let e = v ? v() : null;
|
|
1501
|
-
C(i, r, n), e && ee && v() !== e && ee(e), qe(y, A), w.forEach((e) => e());
|
|
1502
|
-
} else x(r, n, a);
|
|
1503
|
-
e.current = r, _._subTree = r;
|
|
1504
|
-
} catch (e) {
|
|
1505
|
-
if (!Je(y, e, A, "render")) throw e;
|
|
1506
|
-
} finally {
|
|
1507
|
-
ve(t);
|
|
1508
|
-
}
|
|
1509
|
-
});
|
|
1510
|
-
_._effect = t, O.update = () => {
|
|
1511
|
-
t();
|
|
1512
|
-
};
|
|
1513
|
-
}
|
|
1514
|
-
let j = { el: n };
|
|
1515
|
-
p(() => ne.forEach((e) => e(j))), Ge(y, A), e.cleanup = () => {
|
|
1516
|
-
Ke(y, A), T.forEach((e) => e(j));
|
|
1517
|
-
};
|
|
1518
|
-
}
|
|
1519
|
-
return {
|
|
1520
|
-
render: te,
|
|
1521
|
-
patch: C,
|
|
1522
|
-
mount: x,
|
|
1523
|
-
unmount: S,
|
|
1524
|
-
mountComponent: E
|
|
1525
|
-
};
|
|
1526
|
-
}
|
|
1527
|
-
//#endregion
|
|
1528
|
-
//#region ../runtime-terminal/src/focus.ts
|
|
1529
|
-
var J = /* @__PURE__ */ new Set(), Y = k({ activeId: null });
|
|
1530
|
-
function X(e) {
|
|
1531
|
-
J.add(e), Y.activeId === null && (Y.activeId = e);
|
|
1532
|
-
}
|
|
1533
|
-
function Z(e) {
|
|
1534
|
-
J.delete(e), Y.activeId === e && (Y.activeId = null, J.size > 0 && (Y.activeId = J.values().next().value || null));
|
|
1535
|
-
}
|
|
1536
|
-
function Nt(e) {
|
|
1537
|
-
J.has(e) && (Y.activeId = e);
|
|
1538
|
-
}
|
|
1539
|
-
function Pt() {
|
|
1540
|
-
if (J.size === 0) return;
|
|
1541
|
-
let e = Array.from(J);
|
|
1542
|
-
Y.activeId = e[((Y.activeId ? e.indexOf(Y.activeId) : -1) + 1) % e.length];
|
|
1543
|
-
}
|
|
1544
|
-
function Ft() {
|
|
1545
|
-
if (J.size === 0) return;
|
|
1546
|
-
let e = Array.from(J);
|
|
1547
|
-
Y.activeId = e[((Y.activeId ? e.indexOf(Y.activeId) : -1) - 1 + e.length) % e.length];
|
|
1548
|
-
}
|
|
1549
|
-
//#endregion
|
|
1550
|
-
//#region ../runtime-terminal/src/utils.ts
|
|
1551
|
-
function It(e) {
|
|
1552
|
-
switch (e) {
|
|
1553
|
-
case "red": return "\x1B[31m";
|
|
1554
|
-
case "green": return "\x1B[32m";
|
|
1555
|
-
case "blue": return "\x1B[34m";
|
|
1556
|
-
case "yellow": return "\x1B[33m";
|
|
1557
|
-
case "cyan": return "\x1B[36m";
|
|
1558
|
-
case "white": return "\x1B[37m";
|
|
1559
|
-
case "black": return "\x1B[30m";
|
|
1560
|
-
default: return "";
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
function Lt(e) {
|
|
1564
|
-
switch (e) {
|
|
1565
|
-
case "red": return "\x1B[41m";
|
|
1566
|
-
case "green": return "\x1B[42m";
|
|
1567
|
-
case "blue": return "\x1B[44m";
|
|
1568
|
-
case "yellow": return "\x1B[43m";
|
|
1569
|
-
case "cyan": return "\x1B[46m";
|
|
1570
|
-
case "white": return "\x1B[47m";
|
|
1571
|
-
case "black": return "\x1B[40m";
|
|
1572
|
-
default: return "";
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
function Rt(e) {
|
|
1576
|
-
return e.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "");
|
|
1577
|
-
}
|
|
1578
|
-
//#endregion
|
|
1579
|
-
//#region ../runtime-terminal/src/components/Input.tsx
|
|
1580
|
-
var zt = F(({ props: e, emit: t }) => {
|
|
1581
|
-
let n = Math.random().toString(36).slice(2), r = !1, i = () => Y.activeId === n, a = () => e.model?.value || "", o = (n) => {
|
|
1582
|
-
if (!i() || !r) return;
|
|
1583
|
-
if (n === "\r") {
|
|
1584
|
-
t("submit", a());
|
|
1585
|
-
return;
|
|
1586
|
-
}
|
|
1587
|
-
if (n === "\n") return;
|
|
1588
|
-
if (n === "" || n === "\b") {
|
|
1589
|
-
let n = a();
|
|
1590
|
-
if (n.length > 0) {
|
|
1591
|
-
let r = n.slice(0, -1);
|
|
1592
|
-
e.model && (e.model.value = r), t("input", r);
|
|
1593
|
-
}
|
|
1594
|
-
return;
|
|
1595
|
-
}
|
|
1596
|
-
if (n.length > 1) return;
|
|
1597
|
-
let o = a() + n;
|
|
1598
|
-
e.model && (e.model.value = o), t("input", o);
|
|
1599
|
-
}, s = null;
|
|
1600
|
-
return N(() => {
|
|
1601
|
-
X(n), e.autofocus && Nt(n), s = $(o), setTimeout(() => {
|
|
1602
|
-
r = !0;
|
|
1603
|
-
}, 50);
|
|
1604
|
-
}), P(() => {
|
|
1605
|
-
s && s(), Z(n);
|
|
1606
|
-
}), () => {
|
|
1607
|
-
let t = a().replace(/[\r\n]+/g, " "), n = (e.placeholder || "").replace(/[\r\n]+/g, " "), r = i();
|
|
1608
|
-
return /* @__PURE__ */ K("box", {
|
|
1609
|
-
border: "single",
|
|
1610
|
-
borderColor: r ? "green" : "white",
|
|
1611
|
-
label: e.label,
|
|
1612
|
-
children: [/* @__PURE__ */ G("text", { children: t || n }), r && /* @__PURE__ */ G("text", {
|
|
1613
|
-
color: "cyan",
|
|
1614
|
-
children: "_"
|
|
1615
|
-
})]
|
|
1616
|
-
});
|
|
1617
|
-
};
|
|
1618
|
-
}, { name: "Input" }), Bt = F(({ props: e }) => () => {
|
|
1619
|
-
let t = e.value || 0, n = e.max || 100, r = e.width || 20, i = e.char || "█", a = e.emptyChar || "░", o = e.color, s = o ? It(o) : "", c = o ? "\x1B[0m" : "", l = Math.min(Math.max(t / n, 0), 1), u = Math.round(r * l), d = r - u;
|
|
1620
|
-
return /* @__PURE__ */ G("box", { children: /* @__PURE__ */ G("text", { children: s + i.repeat(u) + a.repeat(d) + c + ` ${Math.round(l * 100)}%` }) });
|
|
1621
|
-
}, { name: "ProgressBar" }), Vt = F(({ props: e, emit: t }) => {
|
|
1622
|
-
let n = Math.random().toString(36).slice(2), r = () => Y.activeId === n, i = k({ value: !1 }), a = (e) => {
|
|
1623
|
-
r() && (e === "\r" || e === " ") && (i.value = !0, s && clearTimeout(s), s = setTimeout(() => {
|
|
1624
|
-
i.value = !1, s = null;
|
|
1625
|
-
}, 120), t("click"));
|
|
1626
|
-
}, o = null, s = null;
|
|
1627
|
-
return N(() => {
|
|
1628
|
-
X(n), o = $(a);
|
|
1629
|
-
}), P(() => {
|
|
1630
|
-
o && o(), Z(n), s && clearTimeout(s);
|
|
1631
|
-
}), () => {
|
|
1632
|
-
let t = r(), n = e.label || "Button", a = i.value;
|
|
1633
|
-
return /* @__PURE__ */ G("box", {
|
|
1634
|
-
border: "single",
|
|
1635
|
-
borderColor: a ? "yellow" : t ? "green" : "white",
|
|
1636
|
-
backgroundColor: a ? "red" : t ? "blue" : void 0,
|
|
1637
|
-
dropShadow: e.dropShadow,
|
|
1638
|
-
children: /* @__PURE__ */ G("text", {
|
|
1639
|
-
color: t ? "white" : void 0,
|
|
1640
|
-
children: n
|
|
1641
|
-
})
|
|
1642
|
-
});
|
|
1643
|
-
};
|
|
1644
|
-
}, { name: "Button" }), Ht = F(({ props: e, emit: t }) => {
|
|
1645
|
-
let n = Math.random().toString(36).slice(2), r = () => Y.activeId === n, i = () => !!e.model?.value, a = (n) => {
|
|
1646
|
-
if (r() && !e.disabled && (n === "\r" || n === " ")) {
|
|
1647
|
-
let n = !i();
|
|
1648
|
-
e.model && (e.model.value = n), t("change", n);
|
|
1649
|
-
}
|
|
1650
|
-
}, o = null;
|
|
1651
|
-
return N(() => {
|
|
1652
|
-
X(n), e.autofocus && Nt(n), o = $(a);
|
|
1653
|
-
}), P(() => {
|
|
1654
|
-
o && o(), Z(n);
|
|
1655
|
-
}), () => {
|
|
1656
|
-
let t = e.label || "", n = r(), a = i(), o = !!e.disabled;
|
|
1657
|
-
return /* @__PURE__ */ K("box", { children: [
|
|
1658
|
-
/* @__PURE__ */ G("text", {
|
|
1659
|
-
color: n ? "cyan" : "white",
|
|
1660
|
-
children: n ? ">" : " "
|
|
1661
|
-
}),
|
|
1662
|
-
/* @__PURE__ */ K("text", {
|
|
1663
|
-
color: o ? "white" : a ? "green" : n ? "cyan" : "white",
|
|
1664
|
-
children: [
|
|
1665
|
-
"[",
|
|
1666
|
-
a ? "x" : " ",
|
|
1667
|
-
"]"
|
|
1668
|
-
]
|
|
1669
|
-
}),
|
|
1670
|
-
t && /* @__PURE__ */ K("text", {
|
|
1671
|
-
color: o ? "white" : n ? "cyan" : void 0,
|
|
1672
|
-
children: [" ", t]
|
|
1673
|
-
})
|
|
1674
|
-
] });
|
|
1675
|
-
};
|
|
1676
|
-
}, { name: "Checkbox" }), Ut = F(({ props: e, emit: t }) => {
|
|
1677
|
-
let n = Math.random().toString(36).slice(2), r = !1, i = () => Y.activeId === n, a = () => {
|
|
1678
|
-
let t = (e.options || []).findIndex((t) => t.value === e.model?.value);
|
|
1679
|
-
return t >= 0 ? t : 0;
|
|
1680
|
-
}, o = (n) => {
|
|
1681
|
-
if (!i() || !r) return;
|
|
1682
|
-
let o = e.options || [];
|
|
1683
|
-
if (o.length === 0) return;
|
|
1684
|
-
let s = a();
|
|
1685
|
-
if (n === "\x1B[A" || n === "k") {
|
|
1686
|
-
let n = o[s > 0 ? s - 1 : o.length - 1].value;
|
|
1687
|
-
e.model && (e.model.value = n), t("change", n);
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
if (n === "\x1B[B" || n === "j") {
|
|
1691
|
-
let n = o[s < o.length - 1 ? s + 1 : 0].value;
|
|
1692
|
-
e.model && (e.model.value = n), t("change", n);
|
|
1693
|
-
return;
|
|
1694
|
-
}
|
|
1695
|
-
if (n === "\r") {
|
|
1696
|
-
t("submit", e.model?.value || o[0]?.value || "");
|
|
1697
|
-
return;
|
|
1698
|
-
}
|
|
1699
|
-
}, s = null;
|
|
1700
|
-
return N(() => {
|
|
1701
|
-
X(n), e.autofocus && Nt(n), s = $(o), setTimeout(() => {
|
|
1702
|
-
r = !0;
|
|
1703
|
-
}, 50);
|
|
1704
|
-
}), P(() => {
|
|
1705
|
-
s && s(), Z(n);
|
|
1706
|
-
}), () => {
|
|
1707
|
-
let t = e.options || [], n = i(), r = e.model?.value || t[0]?.value || "", a = e.label, o = t.find((e) => e.value === r), s = t.map((e) => {
|
|
1708
|
-
let t = e.value === r;
|
|
1709
|
-
return /* @__PURE__ */ G("box", { children: /* @__PURE__ */ K("text", {
|
|
1710
|
-
color: t ? "cyan" : "white",
|
|
1711
|
-
children: [
|
|
1712
|
-
t ? "❯" : " ",
|
|
1713
|
-
" ",
|
|
1714
|
-
e.label
|
|
1715
|
-
]
|
|
1716
|
-
}) });
|
|
1717
|
-
}), c = e.showDescription && o?.description ? /* @__PURE__ */ G("box", { children: /* @__PURE__ */ K("text", {
|
|
1718
|
-
color: "#666666",
|
|
1719
|
-
children: [" ↳ ", o.description]
|
|
1720
|
-
}) }) : null;
|
|
1721
|
-
return /* @__PURE__ */ K("box", { children: [/* @__PURE__ */ G("box", {
|
|
1722
|
-
border: "single",
|
|
1723
|
-
borderColor: n ? "green" : "white",
|
|
1724
|
-
label: a,
|
|
1725
|
-
children: s
|
|
1726
|
-
}), c] });
|
|
1727
|
-
};
|
|
1728
|
-
}, { name: "Select" }), { render: Wt } = Mt({
|
|
1729
|
-
patchProp: (e, t, n, r) => {
|
|
1730
|
-
e.props[t] = r, Kt();
|
|
1731
|
-
},
|
|
1732
|
-
insert: (e, t, n) => {
|
|
1733
|
-
e.parentNode = t;
|
|
1734
|
-
let r = n ? t.children.indexOf(n) : -1;
|
|
1735
|
-
r > -1 ? t.children.splice(r, 0, e) : t.children.push(e), Kt();
|
|
1736
|
-
},
|
|
1737
|
-
remove: (e) => {
|
|
1738
|
-
if (e.parentNode) {
|
|
1739
|
-
let t = e.parentNode.children.indexOf(e);
|
|
1740
|
-
t > -1 && e.parentNode.children.splice(t, 1), e.parentNode = null;
|
|
1741
|
-
}
|
|
1742
|
-
Kt();
|
|
1743
|
-
},
|
|
1744
|
-
createElement: (e) => ({
|
|
1745
|
-
type: "element",
|
|
1746
|
-
tag: e,
|
|
1747
|
-
props: {},
|
|
1748
|
-
children: []
|
|
1749
|
-
}),
|
|
1750
|
-
createText: (e) => ({
|
|
1751
|
-
type: "text",
|
|
1752
|
-
text: e,
|
|
1753
|
-
props: {},
|
|
1754
|
-
children: []
|
|
1755
|
-
}),
|
|
1756
|
-
createComment: (e) => ({
|
|
1757
|
-
type: "comment",
|
|
1758
|
-
text: e,
|
|
1759
|
-
props: {},
|
|
1760
|
-
children: []
|
|
1761
|
-
}),
|
|
1762
|
-
setText: (e, t) => {
|
|
1763
|
-
e.text = t, Kt();
|
|
1764
|
-
},
|
|
1765
|
-
setElementText: (e, t) => {
|
|
1766
|
-
e.children = [{
|
|
1767
|
-
type: "text",
|
|
1768
|
-
text: t,
|
|
1769
|
-
props: {},
|
|
1770
|
-
children: [],
|
|
1771
|
-
parentNode: e
|
|
1772
|
-
}], Kt();
|
|
1773
|
-
},
|
|
1774
|
-
parentNode: (e) => e.parentNode || null,
|
|
1775
|
-
nextSibling: (e) => {
|
|
1776
|
-
if (!e.parentNode) return null;
|
|
1777
|
-
let t = e.parentNode.children.indexOf(e);
|
|
1778
|
-
return e.parentNode.children[t + 1] || null;
|
|
1779
|
-
},
|
|
1780
|
-
cloneNode: (e) => ({
|
|
1781
|
-
...e,
|
|
1782
|
-
children: []
|
|
1783
|
-
})
|
|
1784
|
-
}), Q = null, Gt = !1;
|
|
1785
|
-
function Kt() {
|
|
1786
|
-
Gt || (Gt = !0, setTimeout(() => {
|
|
1787
|
-
qt(), Gt = !1;
|
|
1788
|
-
}, 10));
|
|
1789
|
-
}
|
|
1790
|
-
function qt() {
|
|
1791
|
-
if (!Q) return;
|
|
1792
|
-
process.stdout.write("\x1B[H");
|
|
1793
|
-
let e = Yt(Q);
|
|
1794
|
-
process.stdout.write(e.join("\x1B[K\n") + "\x1B[K"), process.stdout.write("\x1B[J");
|
|
1795
|
-
}
|
|
1796
|
-
function Jt(e) {
|
|
1797
|
-
for (let t of e.children) if (t.tag === "box") return !0;
|
|
1798
|
-
return !1;
|
|
1799
|
-
}
|
|
1800
|
-
function Yt(e) {
|
|
1801
|
-
if (e.type === "text") return [e.text || ""];
|
|
1802
|
-
if (e.type === "comment") return [];
|
|
1803
|
-
let t = [""], n = e.props.color, r = n ? "\x1B[0m" : "", i = It(n);
|
|
1804
|
-
for (let n of e.children) if (n.type === "text") t[t.length - 1] += i + (n.text || "") + r;
|
|
1805
|
-
else if (n.tag === "br") t.push("");
|
|
1806
|
-
else {
|
|
1807
|
-
let e = Yt(n);
|
|
1808
|
-
if (n.tag === "box" || Jt(n)) t.length === 1 && t[0] === "" ? t = e : t.push(...e);
|
|
1809
|
-
else if (e.length > 0) if (e.length > 1) t.length === 1 && t[0] === "" ? t = e : t.push(...e);
|
|
1810
|
-
else {
|
|
1811
|
-
t[t.length - 1] += e[0];
|
|
1812
|
-
for (let n = 1; n < e.length; n++) t.push(e[n]);
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
return e.tag === "box" && e.props.border ? Xt(t, e.props.border, e.props.borderColor, e.props.backgroundColor, e.props.dropShadow, e.props.label) : t;
|
|
1816
|
-
}
|
|
1817
|
-
function Xt(e, t, n, r, i, a) {
|
|
1818
|
-
let o = Zt(t), s = n ? It(n) : "", c = r ? Lt(r) : "", l = n || r ? "\x1B[0m" : "", u = e.reduce((e, t) => Math.max(e, Rt(t).length), 0), d = a || "", f = Rt(d).length, p = Math.max(u, f + 2), m = "";
|
|
1819
|
-
if (d) {
|
|
1820
|
-
let e = p - f - 2, t = Math.floor(e / 2), n = e - t;
|
|
1821
|
-
m = o.h.repeat(t) + " " + d + " " + o.h.repeat(n);
|
|
1822
|
-
} else m = o.h.repeat(p);
|
|
1823
|
-
let h = c + s + o.tl + m + o.tr + l, g = c + s + o.bl + o.h.repeat(p) + o.br + l, _ = [];
|
|
1824
|
-
_.push(h);
|
|
1825
|
-
for (let t of e) {
|
|
1826
|
-
let e = Rt(t).length, n = " ".repeat(p - e), r = c + t.replace(/\x1b\[0m/g, `\x1b[0m${c}`);
|
|
1827
|
-
_.push(c + s + o.v + l + r + c + n + s + o.v + l);
|
|
1828
|
-
}
|
|
1829
|
-
if (_.push(g), i) {
|
|
1830
|
-
let e = "\x1B[90m▒\x1B[0m";
|
|
1831
|
-
for (let t = 1; t < _.length; t++) _[t] += e;
|
|
1832
|
-
let t = " " + e.repeat(u + 2);
|
|
1833
|
-
_.push(t);
|
|
1834
|
-
}
|
|
1835
|
-
return _;
|
|
1836
|
-
}
|
|
1837
|
-
function Zt(e) {
|
|
1838
|
-
return e === "double" ? {
|
|
1839
|
-
tl: "╔",
|
|
1840
|
-
tr: "╗",
|
|
1841
|
-
bl: "╚",
|
|
1842
|
-
br: "╝",
|
|
1843
|
-
h: "═",
|
|
1844
|
-
v: "║"
|
|
1845
|
-
} : e === "rounded" ? {
|
|
1846
|
-
tl: "╭",
|
|
1847
|
-
tr: "╮",
|
|
1848
|
-
bl: "╰",
|
|
1849
|
-
br: "╯",
|
|
1850
|
-
h: "─",
|
|
1851
|
-
v: "│"
|
|
1852
|
-
} : {
|
|
1853
|
-
tl: "┌",
|
|
1854
|
-
tr: "┐",
|
|
1855
|
-
bl: "└",
|
|
1856
|
-
br: "┘",
|
|
1857
|
-
h: "─",
|
|
1858
|
-
v: "│"
|
|
1859
|
-
};
|
|
1860
|
-
}
|
|
1861
|
-
var Qt = /* @__PURE__ */ new Set();
|
|
1862
|
-
function $(e) {
|
|
1863
|
-
return Qt.add(e), () => Qt.delete(e);
|
|
1864
|
-
}
|
|
1865
|
-
function $t(e) {
|
|
1866
|
-
if (e === "" && (process.stdout.write("\x1B[?25h"), process.exit()), e === " ") {
|
|
1867
|
-
Pt();
|
|
1868
|
-
return;
|
|
1869
|
-
}
|
|
1870
|
-
if (e === "\x1B[Z") {
|
|
1871
|
-
Ft();
|
|
1872
|
-
return;
|
|
1873
|
-
}
|
|
1874
|
-
for (let t of Qt) t(e);
|
|
1875
|
-
}
|
|
1876
|
-
function en(e, t = {}) {
|
|
1877
|
-
Q = {
|
|
1878
|
-
type: "root",
|
|
1879
|
-
props: {},
|
|
1880
|
-
children: []
|
|
1881
|
-
};
|
|
1882
|
-
let n = Q;
|
|
1883
|
-
return process.stdin.isTTY && (process.stdin.setRawMode(!0), process.stdin.resume(), process.stdin.setEncoding("utf8"), process.stdin.on("data", $t)), t.clearConsole && process.stdout.write("\x1B[2J\x1B[3J\x1B[H"), process.stdout.write("\x1B[?25l"), Wt(e, n), qt(), { unmount: () => {
|
|
1884
|
-
Wt(null, n), process.stdout.write("\x1B[?25h"), process.stdin.isTTY && (process.stdin.setRawMode(!1), process.stdin.pause(), process.stdin.off("data", $t));
|
|
1885
|
-
} };
|
|
1886
|
-
}
|
|
1887
|
-
var tn = null;
|
|
1888
|
-
function nn(e = { clearConsole: !0 }) {
|
|
1889
|
-
return {
|
|
1890
|
-
mount: an,
|
|
1891
|
-
options: e,
|
|
1892
|
-
onMount: (e) => {
|
|
1893
|
-
tn = e;
|
|
1894
|
-
}
|
|
1895
|
-
};
|
|
1896
|
-
}
|
|
1897
|
-
function rn() {
|
|
1898
|
-
tn &&= (tn(), null), process.stdout.write("\x1B[?25h"), process.stdout.write("\x1B[2J\x1B[H");
|
|
1899
|
-
}
|
|
1900
|
-
var an = (e, t, n) => {
|
|
1901
|
-
Q = {
|
|
1902
|
-
type: "root",
|
|
1903
|
-
props: {},
|
|
1904
|
-
children: []
|
|
1905
|
-
};
|
|
1906
|
-
let r = Q;
|
|
1907
|
-
return process.stdin.isTTY && (process.stdin.setRawMode(!0), process.stdin.resume(), process.stdin.setEncoding("utf8"), process.stdin.on("data", $t)), t?.clearConsole && process.stdout.write("\x1B[2J\x1B[3J\x1B[H"), process.stdout.write("\x1B[?25l"), Wt(e, r, n), qt(), () => {
|
|
1908
|
-
Wt(null, r), process.stdout.write("\x1B[?25h"), process.stdin.isTTY && (process.stdin.setRawMode(!1), process.stdin.pause(), process.stdin.off("data", $t));
|
|
1909
|
-
};
|
|
1910
|
-
};
|
|
1911
|
-
He(an);
|
|
1912
|
-
//#endregion
|
|
1913
|
-
export { Vt as Button, Dt as CLIENT_DIRECTIVES, Et as CLIENT_DIRECTIVE_PREFIX, Ht as Checkbox, U as Comment, t as ComputedSymbol, mt as ErrorBoundary, V as Fragment, zt as Input, vt as InstanceLifetimes, Bt as ProgressBar, Ut as Select, I as SigxError, L as SigxErrorCode, xt as SubscriptionHandler, dt as Suspense, H as Text, ht as Utils, Ee as asyncSetupClientError, s as batch, F as component, Xe as compound, ie as computed, Qe as createModel, $e as createModelFromBinding, yt as createTopic, Ue as defineApp, ze as defineDirective, St as defineFactory, Ne as defineInjectable, Pe as defineProvide, D as detectAccess, f as effect, m as effectScope, rn as exitTerminal, Nt as focus, Pt as focusNext, Ft as focusPrev, Y as focusState, Se as getComponentMeta, _e as getCurrentInstance, _t as guid, B as isComponent, j as isComputed, Be as isDirective, ft as isLazyComponent, z as isModel, ee as isReactive, G as jsx, st as jsxDEV, K as jsxs, ut as lazy, Te as mountTargetNotFoundError, nn as mountTerminal, Ce as noMountFunctionError, ye as onCreated, $ as onKey, N as onMounted, P as onUnmounted, be as onUpdated, Oe as provideInvalidInjectableError, De as provideOutsideSetupError, X as registerFocusable, Wt as render, Yt as renderNodeToLines, we as renderTargetNotFoundError, en as renderTerminal, k as signal, an as terminalMount, v as toRaw, bt as toSubscriber, Z as unregisterFocusable, p as untrack, Fe as useAppContext, pt as useAsync, re as watch };
|
|
1914
|
-
|
|
1915
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "@sigx/reactivity";
|
|
2
|
+
export * from "@sigx/runtime-core";
|
|
3
|
+
export * from "@sigx/runtime-terminal";
|