@tempots/beatui 0.29.0 → 0.30.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/dist/{2019-DWRjZU7G.cjs → 2019-Bl1mhxeM.cjs} +1 -1
- package/dist/{2019-CQWyTvCk.js → 2019-Cd9nHhvg.js} +2 -2
- package/dist/{2020-B5opG6JJ.cjs → 2020-BKqFJLj6.cjs} +1 -1
- package/dist/{2020-Dv6iZ0kg.js → 2020-CyKJpuK6.js} +2 -2
- package/dist/{ar-Xt0B1GBx.cjs → ar-CbsALGhG.cjs} +1 -1
- package/dist/{ar-L29B4drg.js → ar-Dz8Mg5la.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +3 -3
- package/dist/beatui.css +2 -1
- package/dist/beatui.tailwind.css +2 -1
- package/dist/{de-BBH6Q1uM.cjs → de-MO-u5hoD.cjs} +1 -1
- package/dist/{de-BL9YMCWJ.js → de-ToWTQGEo.js} +1 -1
- package/dist/{es-3mljmytv.cjs → es-CqkWVfis.cjs} +1 -1
- package/dist/{es-CS4u7MZp.js → es-CruxS0Tz.js} +1 -1
- package/dist/{fa-_5IxCXGI.js → fa-Cf0NZLWA.js} +1 -1
- package/dist/{fa-C06uowfA.cjs → fa-DR8j7v-l.cjs} +1 -1
- package/dist/{fr-ZoJsA1s0.cjs → fr-ClK0mWTO.cjs} +1 -1
- package/dist/{fr-B-ZWm43Y.js → fr-YKXmqMGr.js} +1 -1
- package/dist/{he-J-Bcrgy9.js → he-D8ZOduPw.js} +1 -1
- package/dist/{he-D-_HCjOB.cjs → he-DeJMBRTP.cjs} +1 -1
- package/dist/{hi-B9yNE6-J.cjs → hi-C9Anq8Ae.cjs} +1 -1
- package/dist/{hi-ClGaIH71.js → hi-CIamzVEf.js} +1 -1
- package/dist/{index-B8jOeOOB.js → index-0dpJGQbC.js} +2 -2
- package/dist/{index-zvVNcjMi.cjs → index-52kzSRNb.cjs} +1 -1
- package/dist/{index-CflXJ8xJ.cjs → index-5a6_6F3Z.cjs} +1 -1
- package/dist/{index-BCaOVY88.js → index-BGHGZg_7.js} +2 -2
- package/dist/{index-BICIDfB6.js → index-BMn-7Ble.js} +1 -1
- package/dist/{index-BSfK-Qwf.cjs → index-BR0F2BVZ.cjs} +1 -1
- package/dist/{index-DXB8LND-.cjs → index-BlCmv2EJ.cjs} +1 -1
- package/dist/{index-CiwYKSUt.js → index-BlamLFdS.js} +2 -2
- package/dist/{index-Cwsc5H7D.js → index-C0sjoDdy.js} +2 -2
- package/dist/{index-Bk0BtvLD.cjs → index-C9RMQY3t.cjs} +1 -1
- package/dist/{index-CN4vYjXL.js → index-CDBeAhhM.js} +2 -2
- package/dist/{index-ZuS9yWom.cjs → index-CH2HgQJF.cjs} +1 -1
- package/dist/{index-SPJ46EtH.js → index-CT9YDHSn.js} +4 -4
- package/dist/{index-BzaR8uM1.cjs → index-CUZnWZnQ.cjs} +1 -1
- package/dist/{index-DAdi5JJz.js → index-CVNvgkJN.js} +2 -2
- package/dist/{index-uOI0LXHI.cjs → index-C_NT6gCL.cjs} +1 -1
- package/dist/{index-4MNPHZD0.cjs → index-CafCsH0Z.cjs} +1 -1
- package/dist/{index-C7gZW1I3.cjs → index-Cei6J0b_.cjs} +6 -6
- package/dist/{index-C5uZbosj.js → index-CmcOKNW2.js} +3 -3
- package/dist/{index-C7NeFFtL.js → index-CvpdOKX2.js} +3 -3
- package/dist/{index-DKyf2VGu.cjs → index-CxE1PN5L.cjs} +1 -1
- package/dist/{index-CGAE3ijj.cjs → index-D2BpI4Zz.cjs} +1 -1
- package/dist/{index-DrNo6z9a.cjs → index-D40RPDMJ.cjs} +1 -1
- package/dist/{index-Dsgj-jNd.cjs → index-D5iq4kyE.cjs} +1 -1
- package/dist/{index-CcPQViQa.js → index-DDpjzV7E.js} +137 -134
- package/dist/{index-BJfkb8o6.js → index-DFJed4ks.js} +1 -1
- package/dist/{index-BvXl7BJD.cjs → index-DFzKuRY8.cjs} +1 -1
- package/dist/{index-ljok1ep6.cjs → index-DIO9qaw5.cjs} +1 -1
- package/dist/{index-CPUSDEhf.cjs → index-DIR2rO5B.cjs} +1 -1
- package/dist/{index-BKHqr1z2.js → index-DPnQDm6f.js} +2 -2
- package/dist/{index-C7L2gKXf.cjs → index-DU0jpFGR.cjs} +1 -1
- package/dist/{index-Bc-5l3Cz.cjs → index-DUvVsNDG.cjs} +1 -1
- package/dist/{index-Dr0vUVGJ.js → index-DVZnPL32.js} +4 -4
- package/dist/{index-CJIznGSs.js → index-DiYfLAVQ.js} +2 -2
- package/dist/{index-5kvan4pZ.js → index-DnIheaHS.js} +3 -3
- package/dist/{index-CTiwmXQv.cjs → index-Dp2K8q6O.cjs} +1 -1
- package/dist/{index-CEvEqrWz.js → index-DrlNzz-e.js} +2 -2
- package/dist/{index-0nXL1jt0.cjs → index-Dx9UDsJi.cjs} +1 -1
- package/dist/{index-8xL7lFvb.js → index-DxY-AOQA.js} +2 -2
- package/dist/{index-DZRUtuQ1.js → index-Mmd0YHPJ.js} +2 -2
- package/dist/{index-CKRtOTlW.js → index-NyiYUSW3.js} +4 -4
- package/dist/{index-BbKQCvSw.cjs → index-O9BwR_8P.cjs} +1 -1
- package/dist/{index-D6aavhaa.js → index-alBMysbQ.js} +2 -2
- package/dist/{index-DqP1O6vK.js → index-lEkIbMCl.js} +2 -2
- package/dist/{index-BSaEXg56.js → index-qwDdlmIi.js} +3 -3
- package/dist/{index-4pbqdHdu.cjs → index-x3mhc_C_.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +196 -187
- package/dist/{it-D-bh7RoG.cjs → it-5n3LuTHe.cjs} +1 -1
- package/dist/{it-Dv8tmKm5.js → it-Bn7tG_KC.js} +1 -1
- package/dist/{ja-B4rdImcD.cjs → ja-Bdp4_B8-.cjs} +1 -1
- package/dist/{ja-BpqiZN5f.js → ja-i1ULXeiu.js} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-C43-vhJF.cjs → ko-B5SwKB-j.cjs} +1 -1
- package/dist/{ko-Bpa6y038.js → ko-BpKDmtvY.js} +1 -1
- package/dist/milkdown/index.cjs.js +1 -1
- package/dist/milkdown/index.es.js +1 -1
- package/dist/milkdown-input-Bkgdi-Bv.cjs +944 -0
- package/dist/{milkdown-input-BI5TwGax.js → milkdown-input-CciSI_a5.js} +14905 -13249
- package/dist/milkdown.css +1 -1
- package/dist/{modal-DKWKUrDF.cjs → modal-CAKAT7wv.cjs} +1 -1
- package/dist/{modal-Fect9dc4.js → modal-DvGSDVSv.js} +1 -1
- package/dist/{nl-DDjoZpiU.cjs → nl-Cenl4nr6.cjs} +1 -1
- package/dist/{nl-B5HYWGRz.js → nl-Cs4PDWCJ.js} +1 -1
- package/dist/{notice-DrmHRjLV.cjs → notice-DBME6bFw.cjs} +2 -2
- package/dist/{notice-DKO4C8y2.js → notice-DVEacWKt.js} +2 -1
- package/dist/{pl-CXYiY-nR.cjs → pl-7xYNCk-v.cjs} +1 -1
- package/dist/{pl-DksXqLHk.js → pl-BFLNf991.js} +1 -1
- package/dist/{pt-7-6UhRtW.js → pt-BRZeOkcE.js} +1 -1
- package/dist/{pt-CnC1YN5K.cjs → pt-DOLL0Jpj.cjs} +1 -1
- package/dist/{ru-_1DUTMUW.cjs → ru-DoS9XuqG.cjs} +1 -1
- package/dist/{ru-I676X0Bt.js → ru-KI7Gowz-.js} +1 -1
- package/dist/{tr-DA-8X7MK.cjs → tr-BVmoz40w.cjs} +1 -1
- package/dist/{tr-CssmRZfH.js → tr-CYk8Fua5.js} +1 -1
- package/dist/{translations-BBguPjg9.js → translations-DdNHXAWr.js} +1 -1
- package/dist/{translations-CrqWcCGM.cjs → translations-Dv56lQia.cjs} +1 -1
- package/dist/{ur-BCWL2ev1.js → ur-BIcZGLWt.js} +1 -1
- package/dist/{ur-B1YkWWDx.cjs → ur-orNTOdMP.cjs} +1 -1
- package/dist/{utils-BvhSkzHe.js → utils-D1op9R8_.js} +720 -714
- package/dist/utils-Dobqjl2y.cjs +1 -0
- package/dist/{vi-DA-qqgHJ.cjs → vi-BWyUDP07.cjs} +1 -1
- package/dist/{vi-D5K4x_hN.js → vi-BeK62QeB.js} +1 -1
- package/dist/{zh-HUwi9F-w.js → zh-Dt6yWDu2.js} +1 -1
- package/dist/{zh-B4HcAg-5.cjs → zh-RVJj1NQq.cjs} +1 -1
- package/package.json +18 -18
- package/dist/milkdown-input-CdJ7N_YZ.cjs +0 -941
- package/dist/utils-Bc6SKJnK.cjs +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Use as H, Value as u, prop as
|
|
2
|
-
import { f as
|
|
3
|
-
import { g as
|
|
4
|
-
import { ElementRect as
|
|
5
|
-
import { B as X, e as O, f as
|
|
6
|
-
class
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
1
|
+
import { Use as H, Value as u, prop as et, html as I, attr as a, on as C, WithElement as it, OnDispose as W, aria as N, bind as _t, computedOf as V, style as dt, When as E, NotEmpty as Gt, Fragment as L, ForEach as ft, svg as At, svgAttr as ht, Empty as T, emitValue as P, coalesce as Qt, Ensure as Jt, OneOfType as Kt, Repeat as Pt, signal as Ft, input as K, emitValueAsNullableDate as te, emitValueAsNullableDateTime as ee, emitValueAsNumber as G, emit as ne, Task as Bt } from "@tempots/dom";
|
|
2
|
+
import { f as se } from "./colors-WfmhQ5e1.js";
|
|
3
|
+
import { g as re } from "./timer-CQlK5LhW.js";
|
|
4
|
+
import { ElementRect as jt, AutoSelect as le } from "@tempots/ui";
|
|
5
|
+
import { B as X, e as O, f as ae, C as yt, I as z, g as j, h as oe, i as ce, j as Ht, k as $t, T as ie, E as ue, P as pe, S as ct, s as de, L as fe, l as me, n as Lt, o as he, a as gt, p as bt, O as lt, q as Vt } from "./notice-DVEacWKt.js";
|
|
6
|
+
class ge extends Error {
|
|
7
|
+
constructor(e = "Missing implementation") {
|
|
8
|
+
super(e), this.name = "MissingImplementationError";
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const un = (
|
|
11
|
+
const un = (t) => be(t).split("_").join(" "), be = (t) => (t = t.replace(/::/g, "/"), t = t.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"), t = t.replace(/([a-z\d])([A-Z])/g, "$1_$2"), t = t.replace(/-/g, "_"), t.toLowerCase()), pn = (t) => t.substring(0, 1).toUpperCase() + t.substring(1), ve = (t) => {
|
|
12
12
|
if (typeof Buffer < "u")
|
|
13
|
-
return Buffer.from(
|
|
13
|
+
return Buffer.from(t, "base64").toString("utf8");
|
|
14
14
|
if (typeof atob < "u")
|
|
15
|
-
return atob(
|
|
16
|
-
throw new
|
|
15
|
+
return atob(t);
|
|
16
|
+
throw new ge(
|
|
17
17
|
"No implementation found for base64 decoding"
|
|
18
18
|
);
|
|
19
19
|
};
|
|
20
|
-
function
|
|
21
|
-
onChange:
|
|
22
|
-
value:
|
|
20
|
+
function Et({
|
|
21
|
+
onChange: t,
|
|
22
|
+
value: e,
|
|
23
23
|
accept: r = "*/*",
|
|
24
24
|
enableClick: n = !0,
|
|
25
25
|
content: s,
|
|
@@ -27,14 +27,14 @@ function Ee({
|
|
|
27
27
|
allowMultiple: l
|
|
28
28
|
}) {
|
|
29
29
|
return H(X, (i) => {
|
|
30
|
-
const c = u.deriveProp(
|
|
30
|
+
const c = u.deriveProp(e ?? []), p = et(!1), m = (g) => {
|
|
31
31
|
g.preventDefault(), g.stopPropagation(), p.value = !0;
|
|
32
32
|
}, f = (g) => {
|
|
33
33
|
g.preventDefault(), g.stopPropagation(), (!g.currentTarget || !g.currentTarget.contains(g.relatedTarget)) && (p.value = !1);
|
|
34
34
|
}, v = (g) => {
|
|
35
35
|
g.preventDefault(), g.stopPropagation(), p.value = !1;
|
|
36
36
|
const b = Array.from(g.dataTransfer?.files || []);
|
|
37
|
-
b.length > 0 && (c.value = b,
|
|
37
|
+
b.length > 0 && (c.value = b, t(b));
|
|
38
38
|
}, d = (g) => {
|
|
39
39
|
u.get(n) && g.currentTarget.querySelector(
|
|
40
40
|
'input[type="file"]'
|
|
@@ -44,8 +44,8 @@ function Ee({
|
|
|
44
44
|
const h = () => {
|
|
45
45
|
if (x == null) return;
|
|
46
46
|
const g = Array.from(x.files ?? []);
|
|
47
|
-
g.length > 0 && (c.value = g,
|
|
48
|
-
},
|
|
47
|
+
g.length > 0 && (c.value = g, t(g)), x.value = "";
|
|
48
|
+
}, y = (g) => {
|
|
49
49
|
u.get(n) && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), d(g));
|
|
50
50
|
};
|
|
51
51
|
return I.div(
|
|
@@ -58,7 +58,7 @@ function Ee({
|
|
|
58
58
|
C.dragleave(f),
|
|
59
59
|
C.drop(v),
|
|
60
60
|
C.click(d),
|
|
61
|
-
C.keydown(
|
|
61
|
+
C.keydown(y),
|
|
62
62
|
// Hidden file input
|
|
63
63
|
I.input(
|
|
64
64
|
a.type("file"),
|
|
@@ -69,47 +69,47 @@ function Ee({
|
|
|
69
69
|
"position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
|
|
70
70
|
),
|
|
71
71
|
C.change(h),
|
|
72
|
-
|
|
72
|
+
it((g) => (x = g, W(
|
|
73
73
|
c.on((b) => {
|
|
74
74
|
const D = globalThis.DataTransfer;
|
|
75
75
|
if (D != null) {
|
|
76
|
-
const
|
|
77
|
-
b.forEach((_) =>
|
|
76
|
+
const k = new D();
|
|
77
|
+
b.forEach((_) => k.items.add(_)), g.files = k.files;
|
|
78
78
|
}
|
|
79
79
|
})
|
|
80
80
|
)))
|
|
81
81
|
),
|
|
82
82
|
// Screen reader instructions
|
|
83
|
-
N.label(
|
|
83
|
+
N.label(_t(i.$.dropZoneInstructions)(n)),
|
|
84
84
|
// Content
|
|
85
85
|
s({ files: c, clear: () => c.value = [], change: c.set })
|
|
86
86
|
);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function xe(t, e) {
|
|
90
|
+
return t.length === e.length && t.every((r, n) => r === e[n]);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
const r = ["bc-segmented-control", `bc-segmented-control--size-${
|
|
94
|
-
return
|
|
92
|
+
function we(t, e) {
|
|
93
|
+
const r = ["bc-segmented-control", `bc-segmented-control--size-${t}`];
|
|
94
|
+
return e && r.push("bc-segmented-control--disabled"), r.join(" ");
|
|
95
95
|
}
|
|
96
96
|
function dn({
|
|
97
|
-
options:
|
|
98
|
-
value:
|
|
97
|
+
options: t,
|
|
98
|
+
value: e,
|
|
99
99
|
onChange: r,
|
|
100
100
|
size: n = "md",
|
|
101
101
|
disabled: s = !1
|
|
102
102
|
}, ...o) {
|
|
103
|
-
const l =
|
|
103
|
+
const l = se(t).map(([i, c]) => ({
|
|
104
104
|
key: i,
|
|
105
105
|
label: c
|
|
106
106
|
}));
|
|
107
|
-
return
|
|
107
|
+
return it(() => {
|
|
108
108
|
const i = Object.fromEntries(
|
|
109
109
|
l.map((p, m) => [p.key, m])
|
|
110
|
-
), c =
|
|
110
|
+
), c = et(
|
|
111
111
|
l.map(() => ({ left: 0, width: 0 })),
|
|
112
|
-
|
|
112
|
+
xe
|
|
113
113
|
);
|
|
114
114
|
return I.div(
|
|
115
115
|
a.class(
|
|
@@ -117,25 +117,25 @@ function dn({
|
|
|
117
117
|
n,
|
|
118
118
|
s
|
|
119
119
|
)(
|
|
120
|
-
(p, m) =>
|
|
120
|
+
(p, m) => we(p ?? "md", m ?? !1)
|
|
121
121
|
)
|
|
122
122
|
),
|
|
123
123
|
I.div(
|
|
124
124
|
a.class("bc-segmented-control__container"),
|
|
125
125
|
I.div(
|
|
126
126
|
a.class("bc-segmented-control__indicator"),
|
|
127
|
-
|
|
127
|
+
dt.width(
|
|
128
128
|
V(
|
|
129
|
-
|
|
129
|
+
e,
|
|
130
130
|
c
|
|
131
131
|
)((p, m) => {
|
|
132
132
|
const { width: f } = m[i[p] ?? 0];
|
|
133
133
|
return `${f}px`;
|
|
134
134
|
})
|
|
135
135
|
),
|
|
136
|
-
|
|
136
|
+
dt.left(
|
|
137
137
|
V(
|
|
138
|
-
|
|
138
|
+
e,
|
|
139
139
|
c
|
|
140
140
|
)((p, m) => {
|
|
141
141
|
const { left: f } = m[i[p] ?? 0];
|
|
@@ -145,25 +145,26 @@ function dn({
|
|
|
145
145
|
),
|
|
146
146
|
// clickable buttons
|
|
147
147
|
l.map(({ label: p, key: m }, f) => I.button(
|
|
148
|
+
a.type("button"),
|
|
148
149
|
C.click((v) => {
|
|
149
150
|
v.preventDefault(), u.get(s) || r?.(m);
|
|
150
151
|
}),
|
|
151
152
|
a.disabled(s),
|
|
152
153
|
a.class("bc-segmented-control__segment"),
|
|
153
154
|
a.class(
|
|
154
|
-
u.map(
|
|
155
|
+
u.map(e, (v) => v === m ? "bc-segmented-control__segment--active" : "bc-segmented-control__segment--inactive")
|
|
155
156
|
),
|
|
156
|
-
|
|
157
|
+
jt((v) => {
|
|
157
158
|
function d() {
|
|
158
159
|
c.update((h) => {
|
|
159
|
-
const
|
|
160
|
-
return
|
|
160
|
+
const y = [...h];
|
|
161
|
+
return y[f] = {
|
|
161
162
|
width: v.value.width,
|
|
162
163
|
left: v.value.localLeft
|
|
163
|
-
},
|
|
164
|
+
}, y;
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
|
-
const x =
|
|
167
|
+
const x = re(d);
|
|
167
168
|
return W(x, v.on(d));
|
|
168
169
|
}),
|
|
169
170
|
p
|
|
@@ -173,41 +174,41 @@ function dn({
|
|
|
173
174
|
);
|
|
174
175
|
});
|
|
175
176
|
}
|
|
176
|
-
function
|
|
177
|
-
const
|
|
178
|
-
return
|
|
177
|
+
function _e(t) {
|
|
178
|
+
const e = t.type.toLowerCase();
|
|
179
|
+
return e.startsWith("image/") && (e.includes("jpeg") || e.includes("jpg") || e.includes("png") || e.includes("gif") || e.includes("webp") || e.includes("svg"));
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
const
|
|
182
|
-
return
|
|
181
|
+
function ye(t) {
|
|
182
|
+
const e = t.type.toLowerCase();
|
|
183
|
+
return e.startsWith("image/") ? "vscode-icons:file-type-image" : e.startsWith("video/") ? "vscode-icons:file-type-video" : e.startsWith("audio/") ? "vscode-icons:file-type-audio" : e.includes("pdf") ? "vscode-icons:file-type-pdf2" : e.includes("word") || e.includes("document") ? "vscode-icons:file-type-word" : e.includes("excel") || e.includes("spreadsheet") ? "vscode-icons:file-type-excel" : e.includes("powerpoint") || e.includes("presentation") ? "vscode-icons:file-type-powerpoint" : e.includes("zip") || e.includes("archive") ? "vscode-icons:file-type-zip" : e.includes("text") ? "vscode-icons:file-type-text" : e.includes("json") ? "vscode-icons:file-type-json-official" : e.includes("csv") ? "vscode-icons:file-type-csv" : e.includes("xml") ? "vscode-icons:file-type-xml" : e.includes("yaml") ? "vscode-icons:file-type-yaml-official" : "vscode-icons:file-type-binary";
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
+
function Ut(t) {
|
|
185
186
|
return E(
|
|
186
|
-
|
|
187
|
+
t.map(_e),
|
|
187
188
|
() => {
|
|
188
|
-
const
|
|
189
|
-
return
|
|
190
|
-
|
|
189
|
+
const e = et(null);
|
|
190
|
+
return t.on((r) => {
|
|
191
|
+
e.value && URL.revokeObjectURL(e.value);
|
|
191
192
|
const n = URL.createObjectURL(r);
|
|
192
|
-
|
|
193
|
+
e.value = n;
|
|
193
194
|
}), I.div(
|
|
194
195
|
a.class("bc-file-input__thumbnail-container"),
|
|
195
196
|
I.img(
|
|
196
|
-
a.src(
|
|
197
|
-
a.alt(
|
|
197
|
+
a.src(e),
|
|
198
|
+
a.alt(t.map((r) => r.name)),
|
|
198
199
|
a.class("bc-file-input__thumbnail"),
|
|
199
200
|
W(() => {
|
|
200
|
-
|
|
201
|
+
e.value && URL.revokeObjectURL(e.value);
|
|
201
202
|
})
|
|
202
203
|
)
|
|
203
204
|
);
|
|
204
205
|
},
|
|
205
|
-
() => z({ icon:
|
|
206
|
+
() => z({ icon: t.map(ye) })
|
|
206
207
|
);
|
|
207
208
|
}
|
|
208
|
-
const
|
|
209
|
+
const $e = (t, ...e) => {
|
|
209
210
|
const {
|
|
210
|
-
value: r =
|
|
211
|
+
value: r = et([]),
|
|
211
212
|
accept: n = "*/*",
|
|
212
213
|
maxFiles: s,
|
|
213
214
|
maxFileSize: o,
|
|
@@ -218,29 +219,29 @@ const kt = (e, ...t) => {
|
|
|
218
219
|
mode: m = "default",
|
|
219
220
|
showFileList: f = !0,
|
|
220
221
|
...v
|
|
221
|
-
} =
|
|
222
|
-
let _ =
|
|
222
|
+
} = t, d = r, x = u.map(m, (k) => k === "compact"), h = (k) => {
|
|
223
|
+
let _ = k;
|
|
223
224
|
if (s != null) {
|
|
224
225
|
const w = u.get(s);
|
|
225
226
|
_ = _.slice(0, w);
|
|
226
227
|
}
|
|
227
228
|
if (o) {
|
|
228
229
|
const w = u.get(o);
|
|
229
|
-
_ = _.filter((
|
|
230
|
+
_ = _.filter(($) => $.size <= w);
|
|
230
231
|
}
|
|
231
232
|
l?.(_);
|
|
232
|
-
},
|
|
233
|
-
const w = d.value.filter((
|
|
233
|
+
}, y = (k) => {
|
|
234
|
+
const w = d.value.filter(($, M) => M !== k);
|
|
234
235
|
l?.(w);
|
|
235
236
|
}, g = () => {
|
|
236
237
|
l?.([]);
|
|
237
238
|
}, b = ({
|
|
238
|
-
files:
|
|
239
|
+
files: k,
|
|
239
240
|
clear: _,
|
|
240
241
|
change: w
|
|
241
242
|
}) => H(
|
|
242
243
|
X,
|
|
243
|
-
(
|
|
244
|
+
($) => I.div(
|
|
244
245
|
a.class("bc-file-input__drop-zone"),
|
|
245
246
|
I.div(
|
|
246
247
|
a.class(
|
|
@@ -249,29 +250,29 @@ const kt = (e, ...t) => {
|
|
|
249
250
|
z({ icon: "mdi:cloud-upload-outline", size: "xl" }),
|
|
250
251
|
I.div(
|
|
251
252
|
a.class("bc-file-input__drop-zone-text"),
|
|
252
|
-
|
|
253
|
+
_t($.$.filesInputInstructions)(
|
|
253
254
|
s,
|
|
254
255
|
o,
|
|
255
|
-
|
|
256
|
+
$.$.fileSizeUnits.value
|
|
256
257
|
)
|
|
257
258
|
)
|
|
258
259
|
)
|
|
259
260
|
)
|
|
260
261
|
), D = ({
|
|
261
|
-
files:
|
|
262
|
+
files: k
|
|
262
263
|
}) => H(
|
|
263
264
|
X,
|
|
264
265
|
(_) => I.div(
|
|
265
266
|
a.class("bc-file-input__compact-input"),
|
|
266
267
|
E(
|
|
267
|
-
|
|
268
|
+
k.map((w) => w.length > 0),
|
|
268
269
|
() => I.span(
|
|
269
270
|
a.class("bc-file-input__compact-value"),
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
ft(
|
|
272
|
+
k,
|
|
272
273
|
(w) => I.span(
|
|
273
274
|
a.class("bc-file-input__compact-value-item"),
|
|
274
|
-
|
|
275
|
+
Ut(w),
|
|
275
276
|
I.span(
|
|
276
277
|
a.class("bc-file-input__compact-value-item-name"),
|
|
277
278
|
w.$.name
|
|
@@ -283,7 +284,7 @@ const kt = (e, ...t) => {
|
|
|
283
284
|
a.class("bc-file-input__compact-placeholder"),
|
|
284
285
|
z({ icon: "mdi:cloud-upload-outline", size: "sm" }),
|
|
285
286
|
" ",
|
|
286
|
-
|
|
287
|
+
_t(_.$.filesInputInstructions)(
|
|
287
288
|
s,
|
|
288
289
|
o,
|
|
289
290
|
_.$.fileSizeUnits.value
|
|
@@ -294,7 +295,7 @@ const kt = (e, ...t) => {
|
|
|
294
295
|
);
|
|
295
296
|
return H(
|
|
296
297
|
X,
|
|
297
|
-
(
|
|
298
|
+
(k) => O(
|
|
298
299
|
{
|
|
299
300
|
baseContainer: u.map(x, (_) => !_),
|
|
300
301
|
disabled: c,
|
|
@@ -303,10 +304,10 @@ const kt = (e, ...t) => {
|
|
|
303
304
|
x,
|
|
304
305
|
() => E(
|
|
305
306
|
d.map(({ length: _ }) => _ > 0),
|
|
306
|
-
() =>
|
|
307
|
+
() => yt(
|
|
307
308
|
{
|
|
308
309
|
size: "sm",
|
|
309
|
-
label:
|
|
310
|
+
label: k.$.clearAllFiles,
|
|
310
311
|
disabled: c,
|
|
311
312
|
onClick: g
|
|
312
313
|
},
|
|
@@ -319,7 +320,7 @@ const kt = (e, ...t) => {
|
|
|
319
320
|
x,
|
|
320
321
|
() => I.div(
|
|
321
322
|
a.class("bc-file-input bc-file-input--compact"),
|
|
322
|
-
|
|
323
|
+
Et({
|
|
323
324
|
value: d,
|
|
324
325
|
accept: n,
|
|
325
326
|
enableClick: !0,
|
|
@@ -331,7 +332,7 @@ const kt = (e, ...t) => {
|
|
|
331
332
|
),
|
|
332
333
|
() => I.div(
|
|
333
334
|
a.class("bc-file-input"),
|
|
334
|
-
|
|
335
|
+
Et({
|
|
335
336
|
value: d,
|
|
336
337
|
accept: n,
|
|
337
338
|
enableClick: !0,
|
|
@@ -342,18 +343,18 @@ const kt = (e, ...t) => {
|
|
|
342
343
|
}),
|
|
343
344
|
E(
|
|
344
345
|
f,
|
|
345
|
-
() =>
|
|
346
|
+
() => Gt(
|
|
346
347
|
d,
|
|
347
348
|
() => L(
|
|
348
349
|
I.div(
|
|
349
350
|
a.class("bc-file-input__file-list"),
|
|
350
|
-
|
|
351
|
-
const
|
|
351
|
+
ft(d, (_, w) => {
|
|
352
|
+
const $ = w.index;
|
|
352
353
|
return I.div(
|
|
353
354
|
a.class("bc-file-input__file-item"),
|
|
354
355
|
I.div(
|
|
355
356
|
a.class("bc-file-input__file-icon"),
|
|
356
|
-
|
|
357
|
+
Ut(_)
|
|
357
358
|
),
|
|
358
359
|
I.div(
|
|
359
360
|
a.class("bc-file-input__file-info"),
|
|
@@ -366,23 +367,23 @@ const kt = (e, ...t) => {
|
|
|
366
367
|
a.class("bc-file-input__file-meta"),
|
|
367
368
|
V(
|
|
368
369
|
_.$.size,
|
|
369
|
-
|
|
370
|
+
k.$.fileSizeUnits
|
|
370
371
|
)(
|
|
371
|
-
(M, A) =>
|
|
372
|
+
(M, A) => ae(M, { units: A })
|
|
372
373
|
),
|
|
373
374
|
" • ",
|
|
374
375
|
V(
|
|
375
376
|
_.$.type,
|
|
376
|
-
|
|
377
|
+
k.$.unknownType
|
|
377
378
|
)((M, A) => M || A)
|
|
378
379
|
)
|
|
379
380
|
),
|
|
380
|
-
|
|
381
|
+
yt(
|
|
381
382
|
{
|
|
382
383
|
size: "sm",
|
|
383
|
-
label:
|
|
384
|
+
label: k.$.removeFile,
|
|
384
385
|
disabled: c,
|
|
385
|
-
onClick: () => $
|
|
386
|
+
onClick: () => y($)
|
|
386
387
|
},
|
|
387
388
|
a.class("bc-file-input__remove-button")
|
|
388
389
|
)
|
|
@@ -399,7 +400,7 @@ const kt = (e, ...t) => {
|
|
|
399
400
|
a.type("button"),
|
|
400
401
|
a.class("bc-file-input__clear-all-button"),
|
|
401
402
|
a.disabled(c),
|
|
402
|
-
|
|
403
|
+
k.$.clearAllFiles,
|
|
403
404
|
C.click((_) => {
|
|
404
405
|
_.preventDefault(), _.stopPropagation(), g();
|
|
405
406
|
})
|
|
@@ -412,80 +413,80 @@ const kt = (e, ...t) => {
|
|
|
412
413
|
)
|
|
413
414
|
)
|
|
414
415
|
},
|
|
415
|
-
...
|
|
416
|
+
...e
|
|
416
417
|
)
|
|
417
418
|
);
|
|
418
419
|
};
|
|
419
|
-
async function
|
|
420
|
-
return new Promise((
|
|
420
|
+
async function ke(t) {
|
|
421
|
+
return new Promise((e, r) => {
|
|
421
422
|
const n = new FileReader();
|
|
422
|
-
n.readAsDataURL(
|
|
423
|
+
n.readAsDataURL(t), n.onload = () => {
|
|
423
424
|
const s = n.result;
|
|
424
|
-
|
|
425
|
+
e(s.split(",")[1]);
|
|
425
426
|
}, n.onerror = (s) => r(s);
|
|
426
427
|
});
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
-
return Promise.all(
|
|
429
|
+
function Ie(t) {
|
|
430
|
+
return Promise.all(t.map(ke));
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
-
if (
|
|
433
|
-
if (
|
|
432
|
+
function Ce(t) {
|
|
433
|
+
if (t.length >= 4) {
|
|
434
|
+
if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
|
|
434
435
|
return "image/png";
|
|
435
|
-
if (
|
|
436
|
-
if (
|
|
436
|
+
if (t[0] === 255 && t[1] === 216) return "image/jpeg";
|
|
437
|
+
if (t[0] === 71 && t[1] === 73 && t[2] === 70)
|
|
437
438
|
return "image/gif";
|
|
438
|
-
if (
|
|
439
|
+
if (t[0] === 82 && t[1] === 73 && t[2] === 70 && t[3] === 70 && t.length >= 12 && t[8] === 87 && t[9] === 69 && t[10] === 66 && t[11] === 80)
|
|
439
440
|
return "image/webp";
|
|
440
441
|
}
|
|
441
442
|
try {
|
|
442
|
-
if (new TextDecoder("utf-8").decode(
|
|
443
|
+
if (new TextDecoder("utf-8").decode(t.slice(0, 256)).includes("<svg")) return "image/svg+xml";
|
|
443
444
|
} catch {
|
|
444
445
|
}
|
|
445
446
|
return "application/octet-stream";
|
|
446
447
|
}
|
|
447
|
-
function
|
|
448
|
-
const
|
|
449
|
-
for (let s = 0; s < r; s++) n[s] =
|
|
448
|
+
function Me(t) {
|
|
449
|
+
const e = ve(t ?? ""), r = e.length, n = new Uint8Array(r);
|
|
450
|
+
for (let s = 0; s < r; s++) n[s] = e.charCodeAt(s);
|
|
450
451
|
return n;
|
|
451
452
|
}
|
|
452
|
-
function
|
|
453
|
+
function De(t) {
|
|
453
454
|
const {
|
|
454
|
-
value:
|
|
455
|
+
value: e,
|
|
455
456
|
onChange: r,
|
|
456
457
|
onInput: n,
|
|
457
458
|
...s
|
|
458
|
-
} =
|
|
459
|
-
const d = o.get(f), x =
|
|
459
|
+
} = t, o = /* @__PURE__ */ new Map(), l = u.toSignal(e).map((m) => m.map((f, v) => {
|
|
460
|
+
const d = o.get(f), x = Me(f ?? ""), h = d?.type || Ce(x), y = d?.name ?? `file-${v}`, g = x.buffer.slice(
|
|
460
461
|
x.byteOffset,
|
|
461
462
|
x.byteOffset + x.byteLength
|
|
462
463
|
), b = new Blob([g], { type: h });
|
|
463
|
-
return new File([b],
|
|
464
|
+
return new File([b], y, { type: h });
|
|
464
465
|
})), i = (m) => (f) => {
|
|
465
|
-
m &&
|
|
466
|
+
m && Ie(f).then((v) => {
|
|
466
467
|
for (const [d, x] of v.entries())
|
|
467
468
|
o.set(x, { name: f[d].name, type: f[d].type });
|
|
468
469
|
m(v);
|
|
469
470
|
});
|
|
470
471
|
}, c = i(r), p = i(n);
|
|
471
|
-
return
|
|
472
|
+
return $e({
|
|
472
473
|
...s,
|
|
473
474
|
value: l,
|
|
474
475
|
onChange: c,
|
|
475
476
|
onInput: p
|
|
476
477
|
});
|
|
477
478
|
}
|
|
478
|
-
function fn(
|
|
479
|
+
function fn(t) {
|
|
479
480
|
const {
|
|
480
|
-
value:
|
|
481
|
+
value: e,
|
|
481
482
|
onInput: r,
|
|
482
483
|
onChange: n,
|
|
483
484
|
...s
|
|
484
|
-
} =
|
|
485
|
-
return
|
|
485
|
+
} = t;
|
|
486
|
+
return De({
|
|
486
487
|
...s,
|
|
487
488
|
maxFiles: 1,
|
|
488
|
-
value: u.map(
|
|
489
|
+
value: u.map(e, (o) => o == null ? [] : [o]),
|
|
489
490
|
onChange: (o) => {
|
|
490
491
|
n?.(o[0]);
|
|
491
492
|
},
|
|
@@ -494,19 +495,19 @@ function fn(e) {
|
|
|
494
495
|
}
|
|
495
496
|
});
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
-
const
|
|
499
|
-
return
|
|
498
|
+
function kt(t) {
|
|
499
|
+
const e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
500
|
+
return e ? [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)] : [0, 0, 0];
|
|
500
501
|
}
|
|
501
|
-
function
|
|
502
|
+
function It(t, e, r) {
|
|
502
503
|
const n = (s) => s.toString(16).padStart(2, "0");
|
|
503
|
-
return `#${n(Math.max(0, Math.min(255,
|
|
504
|
-
Math.max(0, Math.min(255,
|
|
504
|
+
return `#${n(Math.max(0, Math.min(255, t)))}${n(
|
|
505
|
+
Math.max(0, Math.min(255, e))
|
|
505
506
|
)}${n(Math.max(0, Math.min(255, r)))}`;
|
|
506
507
|
}
|
|
507
|
-
function
|
|
508
|
-
if (!
|
|
509
|
-
const r =
|
|
508
|
+
function Se(t) {
|
|
509
|
+
if (!t) return [0, 0, 0, 1];
|
|
510
|
+
const r = t.trim().match(
|
|
510
511
|
/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
|
|
511
512
|
);
|
|
512
513
|
if (r) {
|
|
@@ -531,7 +532,7 @@ function St(e) {
|
|
|
531
532
|
return [v, d, x, 1];
|
|
532
533
|
}
|
|
533
534
|
}
|
|
534
|
-
const n =
|
|
535
|
+
const n = t.match(
|
|
535
536
|
/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i
|
|
536
537
|
);
|
|
537
538
|
if (n)
|
|
@@ -541,156 +542,156 @@ function St(e) {
|
|
|
541
542
|
parseInt(n[3], 10),
|
|
542
543
|
parseFloat(n[4])
|
|
543
544
|
];
|
|
544
|
-
const s =
|
|
545
|
+
const s = t.match(
|
|
545
546
|
/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i
|
|
546
547
|
);
|
|
547
548
|
if (s)
|
|
548
549
|
return [parseInt(s[1], 10), parseInt(s[2], 10), parseInt(s[3], 10), 1];
|
|
549
|
-
const o =
|
|
550
|
+
const o = t.match(
|
|
550
551
|
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
551
552
|
);
|
|
552
553
|
if (o) {
|
|
553
|
-
const f = parseFloat(o[1]), v = parseFloat(o[2]), d = parseFloat(o[3]), x = o[4] != null ? parseFloat(o[4]) : 1, [h,
|
|
554
|
-
return [h,
|
|
554
|
+
const f = parseFloat(o[1]), v = parseFloat(o[2]), d = parseFloat(o[3]), x = o[4] != null ? parseFloat(o[4]) : 1, [h, y, g] = Wt(f, v / 100, d / 100);
|
|
555
|
+
return [h, y, g, x];
|
|
555
556
|
}
|
|
556
|
-
const l =
|
|
557
|
+
const l = t.match(
|
|
557
558
|
/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
558
559
|
);
|
|
559
560
|
if (l) {
|
|
560
|
-
const f = parseFloat(l[1]), v = parseFloat(l[2]) / 100, d = parseFloat(l[3]) / 100, x = l[4] != null ? parseFloat(l[4]) : 1, [h,
|
|
561
|
-
return [h,
|
|
561
|
+
const f = parseFloat(l[1]), v = parseFloat(l[2]) / 100, d = parseFloat(l[3]) / 100, x = l[4] != null ? parseFloat(l[4]) : 1, [h, y, g] = Fe(f, v, d);
|
|
562
|
+
return [h, y, g, x];
|
|
562
563
|
}
|
|
563
|
-
const i =
|
|
564
|
+
const i = t.match(
|
|
564
565
|
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
565
566
|
);
|
|
566
567
|
if (i) {
|
|
567
|
-
const f = i[1], v = parseFloat(i[2]), d = parseFloat(i[3]), x = i[4] != null ? parseFloat(i[4]) : 1, h = f.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(f) / 100)) : Math.max(0, Math.min(1, parseFloat(f))), [
|
|
568
|
-
return [
|
|
568
|
+
const f = i[1], v = parseFloat(i[2]), d = parseFloat(i[3]), x = i[4] != null ? parseFloat(i[4]) : 1, h = f.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(f) / 100)) : Math.max(0, Math.min(1, parseFloat(f))), [y, g, b] = Le(h, v, d);
|
|
569
|
+
return [y, g, b, x];
|
|
569
570
|
}
|
|
570
|
-
const [c, p, m] =
|
|
571
|
+
const [c, p, m] = kt(t);
|
|
571
572
|
return [c, p, m, 1];
|
|
572
573
|
}
|
|
573
|
-
const
|
|
574
|
+
const Te = (t, e, r, n) => `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(r)}, ${Math.max(
|
|
574
575
|
0,
|
|
575
576
|
Math.min(1, Math.round(n * 100) / 100)
|
|
576
577
|
)})`;
|
|
577
|
-
function
|
|
578
|
-
let
|
|
578
|
+
function Ae(t) {
|
|
579
|
+
let e = t + 1831565813;
|
|
579
580
|
return function() {
|
|
580
|
-
return
|
|
581
|
+
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
581
582
|
};
|
|
582
583
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
585
|
-
const n = (1 - Math.abs(2 * r - 1)) *
|
|
584
|
+
function Wt(t, e, r) {
|
|
585
|
+
t = (t % 360 + 360) % 360;
|
|
586
|
+
const n = (1 - Math.abs(2 * r - 1)) * e, s = n * (1 - Math.abs(t / 60 % 2 - 1)), o = r - n / 2;
|
|
586
587
|
let l = 0, i = 0, c = 0;
|
|
587
|
-
return 0 <=
|
|
588
|
+
return 0 <= t && t < 60 ? [l, i, c] = [n, s, 0] : 60 <= t && t < 120 ? [l, i, c] = [s, n, 0] : 120 <= t && t < 180 ? [l, i, c] = [0, n, s] : 180 <= t && t < 240 ? [l, i, c] = [0, s, n] : 240 <= t && t < 300 ? [l, i, c] = [s, 0, n] : [l, i, c] = [n, 0, s], [
|
|
588
589
|
Math.round((l + o) * 255),
|
|
589
590
|
Math.round((i + o) * 255),
|
|
590
591
|
Math.round((c + o) * 255)
|
|
591
592
|
];
|
|
592
593
|
}
|
|
593
|
-
function
|
|
594
|
-
|
|
595
|
-
const n =
|
|
596
|
-
n > 1 && (
|
|
597
|
-
const [s, o, l] =
|
|
594
|
+
function Fe(t, e, r) {
|
|
595
|
+
t = (t % 360 + 360) % 360;
|
|
596
|
+
const n = e + r;
|
|
597
|
+
n > 1 && (e /= n, r /= n);
|
|
598
|
+
const [s, o, l] = Wt(t, 1, 0.5).map((f) => f / 255), i = 1 - e - r, c = s * i + e, p = o * i + e, m = l * i + e;
|
|
598
599
|
return [Math.round(c * 255), Math.round(p * 255), Math.round(m * 255)];
|
|
599
600
|
}
|
|
600
|
-
function
|
|
601
|
-
|
|
602
|
-
const n = Math.max(
|
|
601
|
+
function Ct(t, e, r) {
|
|
602
|
+
t /= 255, e /= 255, r /= 255;
|
|
603
|
+
const n = Math.max(t, e, r), s = Math.min(t, e, r);
|
|
603
604
|
let o = 0, l = 0;
|
|
604
605
|
const i = (n + s) / 2, c = n - s;
|
|
605
606
|
if (c !== 0) {
|
|
606
607
|
switch (l = i > 0.5 ? c / (2 - n - s) : c / (n + s), n) {
|
|
607
|
-
case e:
|
|
608
|
-
o = (t - r) / c + (t < r ? 6 : 0);
|
|
609
|
-
break;
|
|
610
608
|
case t:
|
|
611
|
-
o = (
|
|
609
|
+
o = (e - r) / c + (e < r ? 6 : 0);
|
|
610
|
+
break;
|
|
611
|
+
case e:
|
|
612
|
+
o = (r - t) / c + 2;
|
|
612
613
|
break;
|
|
613
614
|
default:
|
|
614
|
-
o = (
|
|
615
|
+
o = (t - e) / c + 4;
|
|
615
616
|
}
|
|
616
617
|
o *= 60;
|
|
617
618
|
}
|
|
618
619
|
return [Math.round(o), Math.round(l * 100), Math.round(i * 100)];
|
|
619
620
|
}
|
|
620
|
-
function
|
|
621
|
-
const [n] =
|
|
621
|
+
function Be(t, e, r) {
|
|
622
|
+
const [n] = Ct(t, e, r), s = t / 255, o = e / 255, l = r / 255, i = Math.min(s, o, l), c = 1 - Math.max(s, o, l);
|
|
622
623
|
return [n, Math.round(i * 100), Math.round(c * 100)];
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
-
const
|
|
626
|
-
return
|
|
625
|
+
function vt(t) {
|
|
626
|
+
const e = t / 255;
|
|
627
|
+
return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
-
const
|
|
630
|
-
return Math.round(Math.max(0, Math.min(1,
|
|
629
|
+
function xt(t) {
|
|
630
|
+
const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
|
|
631
|
+
return Math.round(Math.max(0, Math.min(1, e)) * 255);
|
|
631
632
|
}
|
|
632
|
-
function
|
|
633
|
-
const n = r * Math.PI / 180, s = Math.cos(n) *
|
|
634
|
-
return [
|
|
633
|
+
function Le(t, e, r) {
|
|
634
|
+
const n = r * Math.PI / 180, s = Math.cos(n) * e, o = Math.sin(n) * e, l = t + 0.3963377774 * s + 0.2158037573 * o, i = t - 0.1055613458 * s - 0.0638541728 * o, c = t - 0.0894841775 * s - 1.291485548 * o, p = l * l * l, m = i * i * i, f = c * c * c, v = 4.0767416621 * p - 3.3077115913 * m + 0.2309699292 * f, d = -1.2684380046 * p + 2.6097574011 * m - 0.3413193965 * f, x = -0.0041960863 * p - 0.7034186147 * m + 1.707614701 * f;
|
|
635
|
+
return [xt(v), xt(d), xt(x)];
|
|
635
636
|
}
|
|
636
|
-
function
|
|
637
|
-
const n =
|
|
638
|
-
let
|
|
639
|
-
return
|
|
637
|
+
function Ve(t, e, r) {
|
|
638
|
+
const n = vt(t), s = vt(e), o = vt(r), l = 0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * o, i = 0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * o, c = 0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * o, p = Math.cbrt(l), m = Math.cbrt(i), f = Math.cbrt(c), v = 0.2104542553 * p + 0.793617785 * m - 0.0040720468 * f, d = 1.9779984951 * p - 2.428592205 * m + 0.4505937099 * f, x = 0.0259040371 * p + 0.7827717662 * m - 0.808675766 * f, h = Math.sqrt(d * d + x * x);
|
|
639
|
+
let y = Math.atan2(x, d) * 180 / Math.PI;
|
|
640
|
+
return y < 0 && (y += 360), [v, h, y];
|
|
640
641
|
}
|
|
641
|
-
function
|
|
642
|
+
function at(t, e, r, n, s, o) {
|
|
642
643
|
switch (s) {
|
|
643
644
|
case "hex":
|
|
644
645
|
if (o) {
|
|
645
646
|
const l = (c) => c.toString(16).padStart(2, "0"), i = Math.max(0, Math.min(255, Math.round(n * 255)));
|
|
646
|
-
return `#${l(
|
|
647
|
+
return `#${l(t)}${l(e)}${l(r)}${l(i)}`;
|
|
647
648
|
}
|
|
648
|
-
return
|
|
649
|
+
return It(t, e, r);
|
|
649
650
|
case "rgb":
|
|
650
|
-
return `rgb(${
|
|
651
|
+
return `rgb(${t}, ${e}, ${r})`;
|
|
651
652
|
case "rgba":
|
|
652
|
-
return `rgba(${
|
|
653
|
+
return `rgba(${t}, ${e}, ${r}, ${Math.round(n * 100) / 100})`;
|
|
653
654
|
case "hsl": {
|
|
654
|
-
const [l, i, c] =
|
|
655
|
+
const [l, i, c] = Ct(t, e, r);
|
|
655
656
|
return `hsl(${l}, ${i}%, ${c}%)`;
|
|
656
657
|
}
|
|
657
658
|
case "hsla": {
|
|
658
|
-
const [l, i, c] =
|
|
659
|
+
const [l, i, c] = Ct(t, e, r);
|
|
659
660
|
return `hsla(${l}, ${i}%, ${c}%, ${Math.round(n * 100) / 100})`;
|
|
660
661
|
}
|
|
661
662
|
case "hwb": {
|
|
662
|
-
const [l, i, c] =
|
|
663
|
+
const [l, i, c] = Be(t, e, r);
|
|
663
664
|
return n < 1 ? `hwb(${l} ${i}% ${c}% / ${Math.round(n * 100) / 100})` : `hwb(${l} ${i}% ${c}%)`;
|
|
664
665
|
}
|
|
665
666
|
case "oklch": {
|
|
666
|
-
const [l, i, c] =
|
|
667
|
+
const [l, i, c] = Ve(t, e, r), p = (Math.round(l * 1e3) / 1e3).toFixed(3), m = (Math.round(i * 1e3) / 1e3).toFixed(3), f = (Math.round(c * 10) / 10).toFixed(1), v = Math.round(n * 100) / 100;
|
|
667
668
|
return o || n < 1 ? `oklch(${p} ${m} ${f} / ${v})` : `oklch(${p} ${m} ${f})`;
|
|
668
669
|
}
|
|
669
670
|
}
|
|
670
671
|
}
|
|
671
|
-
function
|
|
672
|
-
return
|
|
672
|
+
function ot(t, e) {
|
|
673
|
+
return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
|
|
673
674
|
}
|
|
674
|
-
function
|
|
675
|
-
const [r, n, s] =
|
|
675
|
+
function Ee(t, e) {
|
|
676
|
+
const [r, n, s] = t, o = r << 16 ^ n << 8 ^ s, l = Ae(o), i = 6 + Math.floor(l() * 5), c = 0.18 + l() * 0.06, p = [];
|
|
676
677
|
for (let d = 0; d < i; d++) {
|
|
677
|
-
const x = d / i * Math.PI * 2, h =
|
|
678
|
-
p.push({ x:
|
|
678
|
+
const x = d / i * Math.PI * 2, h = e * (1 + (l() * 2 - 1) * c), y = Math.cos(x) * h, g = Math.sin(x) * h;
|
|
679
|
+
p.push({ x: y, y: g });
|
|
679
680
|
}
|
|
680
681
|
const m = (p[0].x + p[i - 1].x) / 2, f = (p[0].y + p[i - 1].y) / 2;
|
|
681
682
|
let v = `M ${m.toFixed(3)} ${f.toFixed(3)}`;
|
|
682
683
|
for (let d = 0; d < i; d++) {
|
|
683
|
-
const x = p[d], h = p[(d + 1) % i],
|
|
684
|
-
v += ` Q ${x.x.toFixed(3)} ${x.y.toFixed(3)} ${
|
|
684
|
+
const x = p[d], h = p[(d + 1) % i], y = (x.x + h.x) / 2, g = (x.y + h.y) / 2;
|
|
685
|
+
v += ` Q ${x.x.toFixed(3)} ${x.y.toFixed(3)} ${y.toFixed(3)} ${g.toFixed(3)}`;
|
|
685
686
|
}
|
|
686
687
|
return v += " Z", v;
|
|
687
688
|
}
|
|
688
|
-
const mn = (
|
|
689
|
-
const { value:
|
|
689
|
+
const mn = (t) => {
|
|
690
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, displayValue: o, size: l, withAlpha: i } = t, c = u.map(l ?? 32, (w) => w), p = u.map(e, (w) => Se(w ?? "#000000")), m = u.map(
|
|
690
691
|
p,
|
|
691
|
-
([w,
|
|
692
|
-
), f = u.map(p, ([, , , w]) => w), v =
|
|
693
|
-
|
|
692
|
+
([w, $, M]) => [w, $, M]
|
|
693
|
+
), f = u.map(p, ([, , , w]) => w), v = et(u.get(f) ?? 1), d = u.map(i ?? !1, (w) => w), x = u.map(
|
|
694
|
+
t.colorTextFormat ?? "rgb",
|
|
694
695
|
(w) => w
|
|
695
696
|
), h = V(
|
|
696
697
|
m,
|
|
@@ -698,20 +699,20 @@ const mn = (e) => {
|
|
|
698
699
|
x,
|
|
699
700
|
d
|
|
700
701
|
)(
|
|
701
|
-
([w,
|
|
702
|
-
),
|
|
703
|
-
|
|
702
|
+
([w, $, M], A, F, S) => at(w, $, M, A ?? 1, ot(F, S), S)
|
|
703
|
+
), y = u.map(
|
|
704
|
+
t.colorTextFormat ?? "hex",
|
|
704
705
|
(w) => w
|
|
705
706
|
), g = u.map(c, (w) => `${-w / 2} ${-w / 2} ${w} ${w}`), b = V(
|
|
706
707
|
m,
|
|
707
708
|
c
|
|
708
|
-
)((w,
|
|
709
|
+
)((w, $) => Ee(w, $ / 2)), D = V(
|
|
709
710
|
m,
|
|
710
711
|
v,
|
|
711
712
|
d
|
|
712
713
|
)(
|
|
713
|
-
([w,
|
|
714
|
-
),
|
|
714
|
+
([w, $, M], A, F) => F || A < 1 ? Te(w, $, M, A) : It(w, $, M)
|
|
715
|
+
), k = I.div(
|
|
715
716
|
a.class("bc-color-input__control"),
|
|
716
717
|
a.class(
|
|
717
718
|
u.map(
|
|
@@ -723,35 +724,35 @@ const mn = (e) => {
|
|
|
723
724
|
V(c)((w) => `min-width:${w + 2}px;height:${w + 2}px`)
|
|
724
725
|
),
|
|
725
726
|
// The SVG blob preview
|
|
726
|
-
|
|
727
|
+
At.svg(
|
|
727
728
|
a.class("bc-color-input__svg"),
|
|
728
|
-
|
|
729
|
-
|
|
729
|
+
ht.viewBox(g),
|
|
730
|
+
At.path(ht.d(b), ht.fill(D))
|
|
730
731
|
),
|
|
731
732
|
// Invisible native input overlays the blob for picker and accessibility
|
|
732
733
|
I.input(
|
|
733
734
|
a.type("color"),
|
|
734
|
-
j(
|
|
735
|
+
j(t),
|
|
735
736
|
// Native color input needs hex without alpha
|
|
736
|
-
a.value(u.map(m, ([w,
|
|
737
|
+
a.value(u.map(m, ([w, $, M]) => It(w, $, M))),
|
|
737
738
|
a.class("bc-input bc-color-input bc-color-input__native"),
|
|
738
739
|
r != null ? C.blur(r) : T,
|
|
739
740
|
n != null ? C.change((w) => {
|
|
740
|
-
const
|
|
741
|
+
const $ = w.target.value;
|
|
741
742
|
if (!n) return;
|
|
742
|
-
const [M, A, F] =
|
|
743
|
-
u.get(
|
|
743
|
+
const [M, A, F] = kt($), S = u.get(v) ?? 1, B = ot(
|
|
744
|
+
u.get(y),
|
|
744
745
|
u.get(d)
|
|
745
|
-
), R =
|
|
746
|
+
), R = at(M, A, F, S, B, u.get(d));
|
|
746
747
|
n(R);
|
|
747
748
|
}) : T,
|
|
748
749
|
s != null ? C.input((w) => {
|
|
749
|
-
const
|
|
750
|
+
const $ = w.target.value;
|
|
750
751
|
if (!s) return;
|
|
751
|
-
const [M, A, F] =
|
|
752
|
-
u.get(
|
|
752
|
+
const [M, A, F] = kt($), S = u.get(v) ?? 1, B = ot(
|
|
753
|
+
u.get(y),
|
|
753
754
|
u.get(d)
|
|
754
|
-
), R =
|
|
755
|
+
), R = at(M, A, F, S, B, u.get(d));
|
|
755
756
|
s(R);
|
|
756
757
|
}) : T
|
|
757
758
|
)
|
|
@@ -764,33 +765,33 @@ const mn = (e) => {
|
|
|
764
765
|
a.max(1),
|
|
765
766
|
a.step(0.01),
|
|
766
767
|
a.value(u.map(v, (w) => String(w ?? 1))),
|
|
767
|
-
a.disabled(
|
|
768
|
+
a.disabled(t.disabled),
|
|
768
769
|
C.input((w) => {
|
|
769
|
-
const
|
|
770
|
-
v.set(
|
|
771
|
-
const [M, A, F] = u.get(m), S =
|
|
772
|
-
u.get(
|
|
770
|
+
const $ = parseFloat(w.target.value);
|
|
771
|
+
v.set($);
|
|
772
|
+
const [M, A, F] = u.get(m), S = ot(
|
|
773
|
+
u.get(y),
|
|
773
774
|
u.get(d)
|
|
774
|
-
), B =
|
|
775
|
+
), B = at(M, A, F, $, S, u.get(d));
|
|
775
776
|
s?.(B);
|
|
776
777
|
}),
|
|
777
778
|
C.change((w) => {
|
|
778
|
-
const
|
|
779
|
-
v.set(
|
|
780
|
-
const [M, A, F] = u.get(m), S =
|
|
781
|
-
u.get(
|
|
779
|
+
const $ = parseFloat(w.target.value);
|
|
780
|
+
v.set($);
|
|
781
|
+
const [M, A, F] = u.get(m), S = ot(
|
|
782
|
+
u.get(y),
|
|
782
783
|
u.get(d)
|
|
783
|
-
), B =
|
|
784
|
+
), B = at(M, A, F, $, S, u.get(d));
|
|
784
785
|
n?.(B);
|
|
785
786
|
})
|
|
786
787
|
)
|
|
787
788
|
);
|
|
788
789
|
return O({
|
|
789
790
|
baseContainer: !0,
|
|
790
|
-
...
|
|
791
|
+
...t,
|
|
791
792
|
// ensure our control does not try to grow
|
|
792
793
|
growInput: !1,
|
|
793
|
-
input:
|
|
794
|
+
input: k,
|
|
794
795
|
// If caller provided an `after`, append RGB before it
|
|
795
796
|
after: L(
|
|
796
797
|
E(
|
|
@@ -798,37 +799,37 @@ const mn = (e) => {
|
|
|
798
799
|
() => I.span(a.class("bc-color-input__rgb"), h)
|
|
799
800
|
),
|
|
800
801
|
_,
|
|
801
|
-
|
|
802
|
+
t.after
|
|
802
803
|
)
|
|
803
804
|
});
|
|
804
|
-
},
|
|
805
|
-
const n = `${
|
|
806
|
-
return W(u.on(
|
|
807
|
-
}), hn = (
|
|
808
|
-
const r = `${
|
|
805
|
+
}, Dt = "$$tts-exp-", Ue = (t, e) => it((r) => {
|
|
806
|
+
const n = `${Dt}${t}`;
|
|
807
|
+
return W(u.on(e, (s) => Reflect.set(r, n, s)));
|
|
808
|
+
}), hn = (t, e) => {
|
|
809
|
+
const r = `${Dt}${t}`;
|
|
809
810
|
return (n) => {
|
|
810
|
-
|
|
811
|
+
e(Reflect.get(n.target, r));
|
|
811
812
|
};
|
|
812
|
-
},
|
|
813
|
-
const r = `${
|
|
813
|
+
}, Ne = (t, e) => {
|
|
814
|
+
const r = `${Dt}${t}`;
|
|
814
815
|
return (n) => {
|
|
815
816
|
const s = n.target, o = s.selectedIndex, l = s.options[o];
|
|
816
|
-
|
|
817
|
+
e(Reflect.get(l, r));
|
|
817
818
|
};
|
|
818
819
|
};
|
|
819
|
-
function
|
|
820
|
+
function ze(t, e, r) {
|
|
820
821
|
const n = ["bc-card"];
|
|
821
|
-
return
|
|
822
|
+
return t !== "default" && n.push(`bc-card--${t}`), e !== "md" && n.push(`bc-card--padding-${e}`), r !== "lg" && n.push(`bc-card--rounded-${r}`), n.join(" ");
|
|
822
823
|
}
|
|
823
|
-
function gn({ variant:
|
|
824
|
+
function gn({ variant: t = "default", size: e = "md", roundedness: r = "lg" } = {}, ...n) {
|
|
824
825
|
return I.div(
|
|
825
826
|
a.class(
|
|
826
827
|
V(
|
|
827
|
-
e,
|
|
828
828
|
t,
|
|
829
|
+
e,
|
|
829
830
|
r
|
|
830
831
|
)(
|
|
831
|
-
(s, o, l) =>
|
|
832
|
+
(s, o, l) => ze(
|
|
832
833
|
s ?? "default",
|
|
833
834
|
o ?? "md",
|
|
834
835
|
l ?? "lg"
|
|
@@ -838,17 +839,17 @@ function gn({ variant: e = "default", size: t = "md", roundedness: r = "lg" } =
|
|
|
838
839
|
...n
|
|
839
840
|
);
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
-
return I.div(a.class("bc-group"), ...
|
|
842
|
+
function pt(...t) {
|
|
843
|
+
return I.div(a.class("bc-group"), ...t);
|
|
843
844
|
}
|
|
844
845
|
const bn = ({
|
|
845
|
-
startEditing:
|
|
846
|
-
value:
|
|
846
|
+
startEditing: t,
|
|
847
|
+
value: e,
|
|
847
848
|
onChange: r,
|
|
848
849
|
placeholder: n,
|
|
849
850
|
disabled: s
|
|
850
851
|
}) => {
|
|
851
|
-
const o = u.deriveProp(
|
|
852
|
+
const o = u.deriveProp(t ?? !1), l = et(!1), i = u.map(s ?? !1, (c) => c);
|
|
852
853
|
return I.div(
|
|
853
854
|
a.class("bc-editable-text"),
|
|
854
855
|
a.class(
|
|
@@ -862,9 +863,9 @@ const bn = ({
|
|
|
862
863
|
o,
|
|
863
864
|
() => I.input(
|
|
864
865
|
a.placeholder(n),
|
|
865
|
-
a.value(
|
|
866
|
+
a.value(e),
|
|
866
867
|
a.class("bc-editable-text__input"),
|
|
867
|
-
|
|
868
|
+
le(),
|
|
868
869
|
C.keydown((c) => {
|
|
869
870
|
c.key === "Enter" ? o.set(!1) : c.key === "Escape" && (l.set(!0), o.set(!1));
|
|
870
871
|
}),
|
|
@@ -884,8 +885,8 @@ const bn = ({
|
|
|
884
885
|
}),
|
|
885
886
|
a.class("bc-editable-text__display"),
|
|
886
887
|
E(
|
|
887
|
-
u.map(
|
|
888
|
-
() => I.span(a.class("bc-editable-text__text"),
|
|
888
|
+
u.map(e, (c) => c != null && c.trim() !== ""),
|
|
889
|
+
() => I.span(a.class("bc-editable-text__text"), e),
|
|
889
890
|
() => I.span(
|
|
890
891
|
a.class("bc-editable-text__placeholder"),
|
|
891
892
|
n
|
|
@@ -894,6 +895,7 @@ const bn = ({
|
|
|
894
895
|
E(
|
|
895
896
|
u.map(i, (c) => !c),
|
|
896
897
|
() => I.button(
|
|
898
|
+
a.type("button"),
|
|
897
899
|
a.class("bc-editable-text__edit-button"),
|
|
898
900
|
H(X, (c) => N.label(c.$.editLabel)),
|
|
899
901
|
C.click(() => o.set(!0)),
|
|
@@ -903,48 +905,48 @@ const bn = ({
|
|
|
903
905
|
)
|
|
904
906
|
)
|
|
905
907
|
);
|
|
906
|
-
},
|
|
907
|
-
|
|
908
|
-
(n) =>
|
|
908
|
+
}, Zt = (t, e, r) => Jt(
|
|
909
|
+
t,
|
|
910
|
+
(n) => Kt(n, {
|
|
909
911
|
value: (s) => {
|
|
910
912
|
const o = V(
|
|
911
913
|
s,
|
|
912
914
|
r
|
|
913
|
-
)((l, i) =>
|
|
915
|
+
)((l, i) => e(l.value, i));
|
|
914
916
|
return I.option(
|
|
915
917
|
W(o.dispose),
|
|
916
918
|
a.selected(o),
|
|
917
|
-
|
|
919
|
+
Ue("value", s.$.value),
|
|
918
920
|
s.$.label
|
|
919
921
|
);
|
|
920
922
|
},
|
|
921
923
|
group: (s) => I.optgroup(
|
|
922
924
|
a.label(s.$.group),
|
|
923
|
-
|
|
925
|
+
ft(
|
|
924
926
|
s.$.options,
|
|
925
|
-
(o) =>
|
|
927
|
+
(o) => Zt(
|
|
926
928
|
o,
|
|
927
|
-
|
|
929
|
+
e,
|
|
928
930
|
r
|
|
929
931
|
)
|
|
930
932
|
)
|
|
931
933
|
),
|
|
932
934
|
break: () => I.hr()
|
|
933
935
|
})
|
|
934
|
-
),
|
|
936
|
+
), Re = (t) => {
|
|
935
937
|
const {
|
|
936
|
-
value:
|
|
938
|
+
value: e,
|
|
937
939
|
onBlur: r,
|
|
938
940
|
onChange: n,
|
|
939
941
|
options: s,
|
|
940
942
|
unselectedLabel: o,
|
|
941
943
|
equality: l = (p, m) => p === m,
|
|
942
944
|
after: i
|
|
943
|
-
} =
|
|
945
|
+
} = t;
|
|
944
946
|
let c;
|
|
945
947
|
return O(
|
|
946
948
|
{
|
|
947
|
-
...
|
|
949
|
+
...t,
|
|
948
950
|
after: L(
|
|
949
951
|
z({
|
|
950
952
|
icon: "ph:caret-down-bold",
|
|
@@ -954,7 +956,7 @@ const bn = ({
|
|
|
954
956
|
i
|
|
955
957
|
),
|
|
956
958
|
input: I.select(
|
|
957
|
-
|
|
959
|
+
it((p) => {
|
|
958
960
|
c = p;
|
|
959
961
|
const m = new MutationObserver((f) => {
|
|
960
962
|
const { removedNodes: v } = f[0];
|
|
@@ -962,18 +964,18 @@ const bn = ({
|
|
|
962
964
|
});
|
|
963
965
|
return m.observe(p, { childList: !0 }), W(() => m.disconnect());
|
|
964
966
|
}),
|
|
965
|
-
j(
|
|
967
|
+
j(t),
|
|
966
968
|
a.class("bc-native-select bc-input"),
|
|
967
969
|
H(
|
|
968
970
|
X,
|
|
969
971
|
(p) => I.option(
|
|
970
972
|
a.hidden("hidden"),
|
|
971
|
-
|
|
973
|
+
Qt(o, p.$.selectOne)
|
|
972
974
|
)
|
|
973
975
|
),
|
|
974
|
-
|
|
976
|
+
ft(s, (p) => Zt(p, l, e)),
|
|
975
977
|
r != null ? C.blur(r) : T,
|
|
976
|
-
n != null ? C.change(
|
|
978
|
+
n != null ? C.change(Ne("value", (p) => n(p))) : T
|
|
977
979
|
)
|
|
978
980
|
},
|
|
979
981
|
C.click(() => {
|
|
@@ -981,62 +983,62 @@ const bn = ({
|
|
|
981
983
|
})
|
|
982
984
|
);
|
|
983
985
|
};
|
|
984
|
-
function
|
|
985
|
-
const { controller:
|
|
986
|
-
return
|
|
986
|
+
function Oe(t) {
|
|
987
|
+
const { controller: e, onChange: r, onBlur: n, ...s } = t;
|
|
988
|
+
return Re({
|
|
987
989
|
...s,
|
|
988
|
-
value:
|
|
989
|
-
onChange:
|
|
990
|
-
onBlur:
|
|
990
|
+
value: e.value,
|
|
991
|
+
onChange: ce(e, r),
|
|
992
|
+
onBlur: oe(e, n)
|
|
991
993
|
});
|
|
992
994
|
}
|
|
993
|
-
function vn(
|
|
994
|
-
return
|
|
995
|
-
...
|
|
996
|
-
content:
|
|
995
|
+
function vn(t) {
|
|
996
|
+
return Ht({
|
|
997
|
+
...t,
|
|
998
|
+
content: Oe(t)
|
|
997
999
|
});
|
|
998
1000
|
}
|
|
999
|
-
function
|
|
1000
|
-
const n =
|
|
1001
|
+
function Pe(t, e, r) {
|
|
1002
|
+
const n = t.length.map((s) => s);
|
|
1001
1003
|
return L(
|
|
1002
1004
|
W(() => n.dispose()),
|
|
1003
|
-
|
|
1005
|
+
Pt(
|
|
1004
1006
|
n,
|
|
1005
1007
|
(s) => {
|
|
1006
|
-
const o =
|
|
1008
|
+
const o = t.item(s.index), l = [];
|
|
1007
1009
|
return L(
|
|
1008
1010
|
W(() => {
|
|
1009
1011
|
o.dispose(), l.forEach((i) => i());
|
|
1010
1012
|
}),
|
|
1011
|
-
|
|
1012
|
-
list:
|
|
1013
|
+
e({
|
|
1014
|
+
list: t,
|
|
1013
1015
|
item: o,
|
|
1014
1016
|
position: s,
|
|
1015
|
-
remove: () =>
|
|
1017
|
+
remove: () => t.removeAt(s.index),
|
|
1016
1018
|
move: (i) => {
|
|
1017
1019
|
switch (i) {
|
|
1018
1020
|
case "up":
|
|
1019
1021
|
if (s.index === 0) return;
|
|
1020
|
-
|
|
1022
|
+
t.move(s.index, s.index - 1);
|
|
1021
1023
|
break;
|
|
1022
1024
|
case "down":
|
|
1023
|
-
if (s.index ===
|
|
1024
|
-
|
|
1025
|
+
if (s.index === t.length.value - 1) return;
|
|
1026
|
+
t.move(s.index, s.index + 1);
|
|
1025
1027
|
break;
|
|
1026
1028
|
case "first":
|
|
1027
|
-
|
|
1029
|
+
t.move(s.index, 0);
|
|
1028
1030
|
break;
|
|
1029
1031
|
case "last":
|
|
1030
|
-
|
|
1032
|
+
t.move(s.index, t.length.value - 1);
|
|
1031
1033
|
}
|
|
1032
1034
|
},
|
|
1033
1035
|
canMove: (i) => {
|
|
1034
1036
|
const c = (() => {
|
|
1035
1037
|
switch (i) {
|
|
1036
1038
|
case "up":
|
|
1037
|
-
return
|
|
1039
|
+
return Ft(s.index > 0);
|
|
1038
1040
|
case "down":
|
|
1039
|
-
return
|
|
1041
|
+
return t.length.map((p) => s.index < p - 1);
|
|
1040
1042
|
}
|
|
1041
1043
|
})();
|
|
1042
1044
|
return l.push(() => c.dispose()), c;
|
|
@@ -1045,9 +1047,9 @@ function Pt(e, t, r) {
|
|
|
1045
1047
|
const c = (() => {
|
|
1046
1048
|
switch (i) {
|
|
1047
1049
|
case "up":
|
|
1048
|
-
return
|
|
1050
|
+
return Ft(s.index === 0);
|
|
1049
1051
|
case "down":
|
|
1050
|
-
return
|
|
1052
|
+
return t.length.map((p) => s.index === p - 1);
|
|
1051
1053
|
}
|
|
1052
1054
|
})();
|
|
1053
1055
|
return l.push(() => c.dispose()), c;
|
|
@@ -1059,31 +1061,31 @@ function Pt(e, t, r) {
|
|
|
1059
1061
|
)
|
|
1060
1062
|
);
|
|
1061
1063
|
}
|
|
1062
|
-
const
|
|
1064
|
+
const Nt = {
|
|
1063
1065
|
9: { pattern: /^[0-9]$/ },
|
|
1064
|
-
A: { pattern: /^[A-Za-z]$/, transform: (
|
|
1066
|
+
A: { pattern: /^[A-Za-z]$/, transform: (t) => t.toUpperCase() },
|
|
1065
1067
|
"*": { pattern: /^.$/ }
|
|
1066
|
-
},
|
|
1067
|
-
function
|
|
1068
|
-
if (
|
|
1069
|
-
const n = r ? { ...
|
|
1068
|
+
}, je = (t) => t instanceof RegExp;
|
|
1069
|
+
function Yt(t, e, r) {
|
|
1070
|
+
if (t == null) return [];
|
|
1071
|
+
const n = r ? { ...Nt, ...e } : e ?? Nt, s = (l, i) => {
|
|
1070
1072
|
const c = n[i];
|
|
1071
1073
|
c ? l.push({ type: "pattern", name: i, ...c }) : l.push({ type: "literal", char: i });
|
|
1072
1074
|
}, o = [];
|
|
1073
|
-
if (typeof
|
|
1074
|
-
for (const l of
|
|
1075
|
+
if (typeof t == "string") {
|
|
1076
|
+
for (const l of t) s(o, l);
|
|
1075
1077
|
return o;
|
|
1076
1078
|
}
|
|
1077
|
-
for (const l of
|
|
1079
|
+
for (const l of t)
|
|
1078
1080
|
if (typeof l == "string")
|
|
1079
1081
|
if (l.length <= 1) s(o, l);
|
|
1080
1082
|
else for (const i of l) s(o, i);
|
|
1081
|
-
else
|
|
1083
|
+
else je(l) ? o.push({ type: "pattern", pattern: l }) : typeof l == "object" && l && o.push(l);
|
|
1082
1084
|
return o;
|
|
1083
1085
|
}
|
|
1084
|
-
function
|
|
1086
|
+
function He(t, e) {
|
|
1085
1087
|
return (r) => {
|
|
1086
|
-
switch (
|
|
1088
|
+
switch (t) {
|
|
1087
1089
|
case "digits":
|
|
1088
1090
|
return /[0-9]/.test(r);
|
|
1089
1091
|
case "letters":
|
|
@@ -1091,36 +1093,36 @@ function Ht(e, t) {
|
|
|
1091
1093
|
case "alphanumeric":
|
|
1092
1094
|
return /[A-Za-z0-9]/.test(r);
|
|
1093
1095
|
case "custom":
|
|
1094
|
-
return
|
|
1096
|
+
return e?.(r) ?? !0;
|
|
1095
1097
|
default:
|
|
1096
1098
|
return !0;
|
|
1097
1099
|
}
|
|
1098
1100
|
};
|
|
1099
1101
|
}
|
|
1100
|
-
function
|
|
1102
|
+
function zt(t, e, r, n, s, o) {
|
|
1101
1103
|
const l = {
|
|
1102
|
-
raw:
|
|
1103
|
-
previousConformed:
|
|
1104
|
-
cursor: s ??
|
|
1104
|
+
raw: t,
|
|
1105
|
+
previousConformed: e,
|
|
1106
|
+
cursor: s ?? t.length,
|
|
1105
1107
|
completed: !1
|
|
1106
|
-
}, i = n.definitions ?? {}, c = typeof r == "function" ? r(
|
|
1108
|
+
}, i = n.definitions ?? {}, c = typeof r == "function" ? r(t, l) : r, p = Yt(
|
|
1107
1109
|
c,
|
|
1108
1110
|
i,
|
|
1109
1111
|
n.useDefaultDefinitions ?? !0
|
|
1110
|
-
), m =
|
|
1112
|
+
), m = He(n.allowMode, n.allow), f = /* @__PURE__ */ new Set();
|
|
1111
1113
|
for (const S of p) S.type === "literal" && f.add(S.char);
|
|
1112
1114
|
if (n.prefix) for (const S of n.prefix) f.add(S);
|
|
1113
1115
|
if (n.suffix) for (const S of n.suffix) f.add(S);
|
|
1114
|
-
const v = Array.from(
|
|
1116
|
+
const v = Array.from(t).filter((S) => m(S) && !f.has(S));
|
|
1115
1117
|
if (v.length === 0) return { value: "", cursor: 0, completed: !1 };
|
|
1116
1118
|
const d = [], x = [];
|
|
1117
|
-
let h = 0,
|
|
1119
|
+
let h = 0, y = 0, g = 0, b = -1;
|
|
1118
1120
|
for (const S of p) {
|
|
1119
1121
|
if (S.type === "literal") {
|
|
1120
1122
|
d.push(S.char), x.push({ kind: "literal", filled: !0 });
|
|
1121
1123
|
continue;
|
|
1122
1124
|
}
|
|
1123
|
-
|
|
1125
|
+
y += S.optional ? 0 : 1;
|
|
1124
1126
|
const B = v[h];
|
|
1125
1127
|
if (B == null)
|
|
1126
1128
|
break;
|
|
@@ -1138,7 +1140,7 @@ function ze(e, t, r, n, s, o) {
|
|
|
1138
1140
|
continue;
|
|
1139
1141
|
}
|
|
1140
1142
|
}
|
|
1141
|
-
const D = d.join(""),
|
|
1143
|
+
const D = d.join(""), k = (n.prefix ?? "") + D + (n.suffix ?? "");
|
|
1142
1144
|
let w = (n.prefix ?? "").length;
|
|
1143
1145
|
if (b >= 0) {
|
|
1144
1146
|
let S = b + 1;
|
|
@@ -1146,17 +1148,17 @@ function ze(e, t, r, n, s, o) {
|
|
|
1146
1148
|
for (; S < x.length && x[S].kind === "literal"; ) S++;
|
|
1147
1149
|
w += S;
|
|
1148
1150
|
}
|
|
1149
|
-
const
|
|
1151
|
+
const $ = n.completion?.mode === "min" ? (n.completion.minChars ?? 0) <= g : n.completion?.mode === "custom" ? !!n.completion.isComplete?.(k) : y > 0 && g >= y, M = n.pipe?.(k, { ...l, completed: $ });
|
|
1150
1152
|
let A, F = w;
|
|
1151
|
-
return M === !1 ? (A =
|
|
1153
|
+
return M === !1 ? (A = e, F = e.length) : typeof M == "string" ? (A = M, F = M.length) : typeof M == "object" && M ? (A = M.value, F = M.cursor ?? M.value.length) : A = k, { value: A, cursor: F, completed: $ };
|
|
1152
1154
|
}
|
|
1153
|
-
function
|
|
1154
|
-
const r =
|
|
1155
|
-
return r === "custom" &&
|
|
1155
|
+
function We(t, e) {
|
|
1156
|
+
const r = e?.strategy ?? "none";
|
|
1157
|
+
return r === "custom" && e?.unmask ? e.unmask(t) : r === "strip" ? t.replace(/[^A-Za-z0-9]/g, "") : t;
|
|
1156
1158
|
}
|
|
1157
|
-
const
|
|
1159
|
+
const Xt = (t) => {
|
|
1158
1160
|
const {
|
|
1159
|
-
value:
|
|
1161
|
+
value: e,
|
|
1160
1162
|
onBlur: r,
|
|
1161
1163
|
onChange: n,
|
|
1162
1164
|
onInput: s,
|
|
@@ -1171,13 +1173,13 @@ const Xe = (e) => {
|
|
|
1171
1173
|
autofix: d,
|
|
1172
1174
|
pipe: x,
|
|
1173
1175
|
completion: h,
|
|
1174
|
-
unmask:
|
|
1176
|
+
unmask: y,
|
|
1175
1177
|
allowMode: g,
|
|
1176
1178
|
allow: b,
|
|
1177
1179
|
placeholder: D,
|
|
1178
|
-
placeholderOptions:
|
|
1179
|
-
} =
|
|
1180
|
-
|
|
1180
|
+
placeholderOptions: k
|
|
1181
|
+
} = t, _ = V(
|
|
1182
|
+
e,
|
|
1181
1183
|
i,
|
|
1182
1184
|
c,
|
|
1183
1185
|
p,
|
|
@@ -1186,97 +1188,97 @@ const Xe = (e) => {
|
|
|
1186
1188
|
v,
|
|
1187
1189
|
d,
|
|
1188
1190
|
h,
|
|
1189
|
-
|
|
1191
|
+
y,
|
|
1190
1192
|
g,
|
|
1191
1193
|
D,
|
|
1192
|
-
|
|
1193
|
-
)((
|
|
1194
|
+
k
|
|
1195
|
+
)(($, M, A, F, S, B, R, st, rt, tt, Q, ut, q) => M ? zt($ ?? "", "", M, {
|
|
1194
1196
|
definitions: A ?? {},
|
|
1195
1197
|
useDefaultDefinitions: F ?? !0,
|
|
1196
1198
|
extraLiterals: S ?? [],
|
|
1197
|
-
autofix:
|
|
1198
|
-
completion:
|
|
1199
|
+
autofix: st ?? "none",
|
|
1200
|
+
completion: rt ?? { mode: "mask" },
|
|
1199
1201
|
pipe: x ?? ((U) => U),
|
|
1200
|
-
unmask:
|
|
1202
|
+
unmask: tt ?? { strategy: "none" },
|
|
1201
1203
|
allowMode: Q ?? "all",
|
|
1202
1204
|
allow: b,
|
|
1203
1205
|
prefix: B,
|
|
1204
1206
|
suffix: R
|
|
1205
|
-
}).value :
|
|
1206
|
-
const A =
|
|
1207
|
+
}).value : $ ?? ""), w = ($, M) => {
|
|
1208
|
+
const A = $.value ?? "", F = u.get(e) ?? "", S = i != null ? u.get(i) : null, B = c != null ? u.get(c) : void 0, R = p != null ? u.get(p) : void 0, st = m != null ? u.get(m) : void 0, rt = d != null ? u.get(d) : void 0, tt = h != null ? u.get(h) : void 0, Q = y != null ? u.get(y) : void 0, ut = g != null ? u.get(g) : void 0, q = f != null ? u.get(f) : void 0, U = v != null ? u.get(v) : void 0, {
|
|
1207
1209
|
value: J,
|
|
1208
|
-
cursor:
|
|
1209
|
-
completed:
|
|
1210
|
-
} = S ?
|
|
1210
|
+
cursor: mt,
|
|
1211
|
+
completed: St
|
|
1212
|
+
} = S ? zt(
|
|
1211
1213
|
A,
|
|
1212
1214
|
F,
|
|
1213
1215
|
S,
|
|
1214
1216
|
{
|
|
1215
1217
|
definitions: B ?? {},
|
|
1216
1218
|
useDefaultDefinitions: R ?? !0,
|
|
1217
|
-
extraLiterals:
|
|
1218
|
-
autofix:
|
|
1219
|
-
completion:
|
|
1220
|
-
pipe: x ?? ((
|
|
1219
|
+
extraLiterals: st ?? [],
|
|
1220
|
+
autofix: rt ?? "none",
|
|
1221
|
+
completion: tt ?? { mode: "mask" },
|
|
1222
|
+
pipe: x ?? ((qt) => qt),
|
|
1221
1223
|
unmask: Q ?? { strategy: "none" },
|
|
1222
|
-
allowMode:
|
|
1224
|
+
allowMode: ut ?? "all",
|
|
1223
1225
|
allow: b,
|
|
1224
1226
|
prefix: q,
|
|
1225
1227
|
suffix: U
|
|
1226
1228
|
},
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
+
$.selectionStart ?? A.length,
|
|
1230
|
+
t.cursor ? u.get(t.cursor) : void 0
|
|
1229
1231
|
) : { value: A, cursor: A.length, completed: !0 };
|
|
1230
1232
|
if (J !== A) {
|
|
1231
|
-
|
|
1233
|
+
$.value = J;
|
|
1232
1234
|
try {
|
|
1233
|
-
|
|
1235
|
+
$.setSelectionRange(mt, mt);
|
|
1234
1236
|
} catch {
|
|
1235
1237
|
}
|
|
1236
1238
|
}
|
|
1237
|
-
const
|
|
1239
|
+
const Tt = We(J, Q);
|
|
1238
1240
|
o?.({
|
|
1239
|
-
raw:
|
|
1241
|
+
raw: Tt,
|
|
1240
1242
|
conformed: J,
|
|
1241
|
-
completed:
|
|
1242
|
-
cursor:
|
|
1243
|
-
}), M === "input" ? s?.(J) : (n?.(J),
|
|
1243
|
+
completed: St,
|
|
1244
|
+
cursor: mt
|
|
1245
|
+
}), M === "input" ? s?.(J) : (n?.(J), St && l?.({ raw: Tt, conformed: J }));
|
|
1244
1246
|
};
|
|
1245
1247
|
return O({
|
|
1246
|
-
...
|
|
1248
|
+
...t,
|
|
1247
1249
|
input: K.text(
|
|
1248
|
-
j(
|
|
1250
|
+
j(t),
|
|
1249
1251
|
a.value(_),
|
|
1250
1252
|
a.class("bc-input"),
|
|
1251
1253
|
r != null ? C.blur(r) : T,
|
|
1252
|
-
|
|
1253
|
-
(
|
|
1254
|
-
C.input(() => w(
|
|
1255
|
-
C.change(() => w(
|
|
1254
|
+
it(
|
|
1255
|
+
($) => $ instanceof HTMLInputElement ? L(
|
|
1256
|
+
C.input(() => w($, "input")),
|
|
1257
|
+
C.change(() => w($, "change")),
|
|
1256
1258
|
C.keydown((M) => {
|
|
1257
|
-
if (M.key !== "Backspace" || !(
|
|
1258
|
-
const F =
|
|
1259
|
+
if (M.key !== "Backspace" || !(t.cursor ? u.get(t.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
|
|
1260
|
+
const F = $.selectionStart ?? 0, S = $.selectionEnd ?? F;
|
|
1259
1261
|
if (F !== S || F <= 0) return;
|
|
1260
|
-
const B =
|
|
1262
|
+
const B = $.value ?? "", R = i != null ? u.get(i) : null;
|
|
1261
1263
|
if (!R) return;
|
|
1262
|
-
const
|
|
1264
|
+
const st = c != null ? u.get(c) : void 0, rt = p != null ? u.get(p) : !0, tt = f != null ? u.get(f) : void 0, Q = v != null ? u.get(v) : void 0, ut = Yt(
|
|
1263
1265
|
typeof R == "function" ? R(B, {
|
|
1264
1266
|
raw: B,
|
|
1265
1267
|
previousConformed: B,
|
|
1266
1268
|
cursor: F,
|
|
1267
1269
|
completed: !1
|
|
1268
1270
|
}) : R,
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
+
st ?? {},
|
|
1272
|
+
rt ?? !0
|
|
1271
1273
|
), q = /* @__PURE__ */ new Set();
|
|
1272
|
-
for (const U of
|
|
1274
|
+
for (const U of ut)
|
|
1273
1275
|
U.type === "literal" && q.add(U.char);
|
|
1274
|
-
if (
|
|
1276
|
+
if (tt) for (const U of tt) q.add(U);
|
|
1275
1277
|
if (Q) for (const U of Q) q.add(U);
|
|
1276
1278
|
if (q.has(B[F - 1])) {
|
|
1277
1279
|
let U = F - 1;
|
|
1278
1280
|
for (; U >= 0 && q.has(B[U]); ) U--;
|
|
1279
|
-
U >= 0 && (M.preventDefault(), M.stopPropagation(),
|
|
1281
|
+
U >= 0 && (M.preventDefault(), M.stopPropagation(), $.value = B.slice(0, U) + B.slice(U + 1), w($, "input"));
|
|
1280
1282
|
}
|
|
1281
1283
|
})
|
|
1282
1284
|
) : T
|
|
@@ -1284,8 +1286,8 @@ const Xe = (e) => {
|
|
|
1284
1286
|
)
|
|
1285
1287
|
});
|
|
1286
1288
|
};
|
|
1287
|
-
function Y(
|
|
1288
|
-
const n = u.map(
|
|
1289
|
+
function Y(t, e, r) {
|
|
1290
|
+
const n = u.map(t, (o) => o != null), s = $t.clearValue;
|
|
1289
1291
|
return E(
|
|
1290
1292
|
n,
|
|
1291
1293
|
() => I.button(
|
|
@@ -1293,7 +1295,7 @@ function Y(e, t, r) {
|
|
|
1293
1295
|
a.class("bc-input-container__reset"),
|
|
1294
1296
|
N.label(s),
|
|
1295
1297
|
a.title(s),
|
|
1296
|
-
a.disabled(
|
|
1298
|
+
a.disabled(e ?? !1),
|
|
1297
1299
|
z({ icon: "mdi:close", size: "sm" }),
|
|
1298
1300
|
C.click((o) => {
|
|
1299
1301
|
o.preventDefault(), o.stopPropagation(), r?.(null);
|
|
@@ -1301,139 +1303,141 @@ function Y(e, t, r) {
|
|
|
1301
1303
|
)
|
|
1302
1304
|
);
|
|
1303
1305
|
}
|
|
1304
|
-
const xn = (
|
|
1305
|
-
const { value:
|
|
1306
|
+
const xn = (t) => {
|
|
1307
|
+
const { value: e, onBlur: r, onChange: n, after: s, disabled: o } = t, l = Y(e, o, n);
|
|
1306
1308
|
return O({
|
|
1307
|
-
...
|
|
1309
|
+
...t,
|
|
1308
1310
|
input: K.date(
|
|
1309
|
-
j(
|
|
1310
|
-
a.valueAsDate(
|
|
1311
|
+
j(t),
|
|
1312
|
+
a.valueAsDate(e),
|
|
1311
1313
|
a.class("bc-input"),
|
|
1312
1314
|
r != null ? C.blur(P(r)) : T,
|
|
1313
|
-
n != null ? C.change(
|
|
1315
|
+
n != null ? C.change(te(n)) : T
|
|
1314
1316
|
),
|
|
1315
1317
|
after: s != null ? L(l, s) : l
|
|
1316
1318
|
});
|
|
1317
|
-
},
|
|
1318
|
-
const
|
|
1319
|
-
return `${
|
|
1320
|
-
}, wn = (
|
|
1321
|
-
const { value:
|
|
1319
|
+
}, Ze = (t) => {
|
|
1320
|
+
const e = t.getFullYear(), r = t.getMonth() + 1, n = t.getDate(), s = t.getHours(), o = t.getMinutes(), l = t.getSeconds();
|
|
1321
|
+
return `${e}-${r.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}:${l.toString().padStart(2, "0")}`;
|
|
1322
|
+
}, wn = (t) => {
|
|
1323
|
+
const { value: e, onBlur: r, onChange: n, after: s, disabled: o } = t, l = u.map(e, (c) => c != null ? Ze(c) : null), i = Y(e, o, n);
|
|
1322
1324
|
return O({
|
|
1323
|
-
...
|
|
1325
|
+
...t,
|
|
1324
1326
|
input: K["datetime-local"](
|
|
1325
|
-
j(
|
|
1327
|
+
j(t),
|
|
1326
1328
|
a.value(u.map(l, (c) => c ?? null)),
|
|
1327
1329
|
a.class("bc-input"),
|
|
1328
1330
|
r != null ? C.blur(P(r)) : T,
|
|
1329
|
-
n != null ? C.change(
|
|
1331
|
+
n != null ? C.change(ee(n)) : T
|
|
1330
1332
|
),
|
|
1331
1333
|
after: s != null ? L(i, s) : i
|
|
1332
1334
|
});
|
|
1333
|
-
}, Z = (
|
|
1334
|
-
const { value:
|
|
1335
|
-
return
|
|
1335
|
+
}, Z = (t) => typeof t == "string" && t.trim() === "" ? null : t, nt = (t) => t ?? "", _n = (t) => {
|
|
1336
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = t, c = Y(e, l, n);
|
|
1337
|
+
return ie({
|
|
1336
1338
|
...i,
|
|
1337
|
-
value: u.map(
|
|
1339
|
+
value: u.map(e, nt),
|
|
1338
1340
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1339
1341
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1340
1342
|
onBlur: r,
|
|
1341
1343
|
after: o != null ? L(c, o) : c
|
|
1342
1344
|
});
|
|
1343
|
-
},
|
|
1344
|
-
const { value:
|
|
1345
|
-
return
|
|
1345
|
+
}, yn = (t) => {
|
|
1346
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = t, c = Y(e, l, n);
|
|
1347
|
+
return ue({
|
|
1346
1348
|
...i,
|
|
1347
|
-
value: u.map(
|
|
1349
|
+
value: u.map(e, nt),
|
|
1348
1350
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1349
1351
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1350
1352
|
onBlur: r,
|
|
1351
1353
|
after: o != null ? L(c, o) : c
|
|
1352
1354
|
});
|
|
1353
|
-
},
|
|
1354
|
-
const { value:
|
|
1355
|
-
return
|
|
1355
|
+
}, $n = (t) => {
|
|
1356
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = t, c = Y(e, l, n);
|
|
1357
|
+
return pe({
|
|
1356
1358
|
...i,
|
|
1357
|
-
value: u.map(
|
|
1359
|
+
value: u.map(e, nt),
|
|
1358
1360
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1359
1361
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1360
1362
|
onBlur: r,
|
|
1361
1363
|
after: o != null ? L(c, o) : c
|
|
1362
1364
|
});
|
|
1363
|
-
},
|
|
1364
|
-
const { value:
|
|
1365
|
+
}, Ye = (t) => {
|
|
1366
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, rows: o } = t;
|
|
1365
1367
|
return O({
|
|
1366
|
-
...
|
|
1368
|
+
...t,
|
|
1367
1369
|
input: I.textarea(
|
|
1368
|
-
j(
|
|
1370
|
+
j(t),
|
|
1369
1371
|
a.rows(o ?? 3),
|
|
1370
|
-
a.value(
|
|
1372
|
+
a.value(e),
|
|
1371
1373
|
a.class("bc-input"),
|
|
1372
1374
|
r != null ? C.blur(P(r)) : T,
|
|
1373
1375
|
n != null ? C.change(P(n)) : T,
|
|
1374
1376
|
s != null ? C.input(P(s)) : T
|
|
1375
1377
|
)
|
|
1376
1378
|
});
|
|
1377
|
-
},
|
|
1378
|
-
const { value:
|
|
1379
|
-
return
|
|
1379
|
+
}, kn = (t) => {
|
|
1380
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = t, c = Y(e, l, n);
|
|
1381
|
+
return Ye({
|
|
1380
1382
|
...i,
|
|
1381
|
-
value: u.map(
|
|
1383
|
+
value: u.map(e, nt),
|
|
1382
1384
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1383
1385
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1384
1386
|
onBlur: r,
|
|
1385
1387
|
after: o != null ? L(c, o) : c
|
|
1386
1388
|
});
|
|
1387
|
-
}, In = (
|
|
1388
|
-
const { value:
|
|
1389
|
+
}, In = (t) => {
|
|
1390
|
+
const { value: e, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i, after: c } = t, p = (v) => {
|
|
1389
1391
|
const d = n != null ? u.get(n) : void 0, x = s != null ? u.get(s) : void 0;
|
|
1390
1392
|
return d != null && v < d ? d : x != null && v > x ? x : v;
|
|
1391
1393
|
}, m = r != null ? H(X, (v) => {
|
|
1392
1394
|
const d = V(
|
|
1393
|
-
|
|
1395
|
+
e,
|
|
1394
1396
|
n
|
|
1395
1397
|
)((g, b) => b == null ? !0 : (g ?? 0) > b), x = V(
|
|
1396
|
-
|
|
1398
|
+
e,
|
|
1397
1399
|
s
|
|
1398
1400
|
)((g, b) => b == null ? !0 : (g ?? 0) < b), h = (g) => {
|
|
1399
|
-
const b = u.get(
|
|
1401
|
+
const b = u.get(e) ?? 0, D = u.get(r), k = g?.shiftKey ? 10 : 1, _ = b - D * k, w = n != null ? u.get(n) : void 0;
|
|
1400
1402
|
if (w != null && _ < w)
|
|
1401
1403
|
return;
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1405
|
-
const b = u.get(
|
|
1404
|
+
const $ = p(_);
|
|
1405
|
+
$ !== b && l && l($);
|
|
1406
|
+
}, y = (g) => {
|
|
1407
|
+
const b = u.get(e) ?? 0, D = u.get(r), k = g?.shiftKey ? 10 : 1, _ = b + D * k, w = s != null ? u.get(s) : void 0;
|
|
1406
1408
|
if (w != null && _ > w)
|
|
1407
1409
|
return;
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1410
|
+
const $ = p(_);
|
|
1411
|
+
$ !== b && l && l($);
|
|
1410
1412
|
};
|
|
1411
|
-
return
|
|
1413
|
+
return ct(
|
|
1412
1414
|
a.class("bc-number-input-steppers"),
|
|
1413
1415
|
// Increment second
|
|
1414
1416
|
I.button(
|
|
1417
|
+
a.type("button"),
|
|
1415
1418
|
a.class(
|
|
1416
1419
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1417
1420
|
),
|
|
1418
1421
|
a.disabled(
|
|
1419
1422
|
V(
|
|
1420
1423
|
x,
|
|
1421
|
-
|
|
1424
|
+
t.disabled ?? !1
|
|
1422
1425
|
)((g, b) => !g || b)
|
|
1423
1426
|
),
|
|
1424
|
-
C.click((g) =>
|
|
1427
|
+
C.click((g) => y(g)),
|
|
1425
1428
|
N.label(v.$.incrementValue),
|
|
1426
1429
|
z({ icon: "line-md:plus", size: "xs" })
|
|
1427
1430
|
),
|
|
1428
1431
|
// Decrement first (matches tests expecting first button to be decrement)
|
|
1429
1432
|
I.button(
|
|
1433
|
+
a.type("button"),
|
|
1430
1434
|
a.class(
|
|
1431
1435
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1432
1436
|
),
|
|
1433
1437
|
a.disabled(
|
|
1434
1438
|
V(
|
|
1435
1439
|
d,
|
|
1436
|
-
|
|
1440
|
+
t.disabled ?? !1
|
|
1437
1441
|
)((g, b) => !g || b)
|
|
1438
1442
|
),
|
|
1439
1443
|
C.click((g) => h(g)),
|
|
@@ -1443,13 +1447,13 @@ const xn = (e) => {
|
|
|
1443
1447
|
);
|
|
1444
1448
|
}) : null, f = c != null && m != null ? L(m, c) : c ?? m;
|
|
1445
1449
|
return O({
|
|
1446
|
-
...
|
|
1450
|
+
...t,
|
|
1447
1451
|
input: K.number(
|
|
1448
1452
|
n != null ? L(
|
|
1449
1453
|
a.min(n),
|
|
1450
1454
|
W(
|
|
1451
1455
|
u.on(n, (v) => {
|
|
1452
|
-
v < u.get(
|
|
1456
|
+
v < u.get(e);
|
|
1453
1457
|
})
|
|
1454
1458
|
)
|
|
1455
1459
|
) : T,
|
|
@@ -1457,12 +1461,12 @@ const xn = (e) => {
|
|
|
1457
1461
|
a.max(s),
|
|
1458
1462
|
W(
|
|
1459
1463
|
u.on(s, (v) => {
|
|
1460
|
-
v > u.get(
|
|
1464
|
+
v > u.get(e);
|
|
1461
1465
|
})
|
|
1462
1466
|
)
|
|
1463
1467
|
) : T,
|
|
1464
|
-
j(
|
|
1465
|
-
a.valueAsNumber(
|
|
1468
|
+
j(t),
|
|
1469
|
+
a.valueAsNumber(e),
|
|
1466
1470
|
a.step(r),
|
|
1467
1471
|
a.class("bc-input bc-number-input"),
|
|
1468
1472
|
o != null ? C.blur(P(o)) : T,
|
|
@@ -1471,82 +1475,84 @@ const xn = (e) => {
|
|
|
1471
1475
|
// Add wheel event support when step is defined
|
|
1472
1476
|
r != null ? C.wheel((v) => {
|
|
1473
1477
|
v.preventDefault();
|
|
1474
|
-
const d = u.get(
|
|
1478
|
+
const d = u.get(e) ?? 0, x = u.get(r), h = v.shiftKey ? 10 : 1, y = v.deltaY < 0 ? x * h : -x * h, g = p(d + y);
|
|
1475
1479
|
g !== d && l && l(g);
|
|
1476
1480
|
}) : T
|
|
1477
1481
|
),
|
|
1478
1482
|
after: f
|
|
1479
1483
|
});
|
|
1480
|
-
},
|
|
1481
|
-
if (
|
|
1482
|
-
const
|
|
1483
|
-
return Number.isNaN(
|
|
1484
|
-
}, Cn = (
|
|
1485
|
-
const { value:
|
|
1484
|
+
}, Rt = (t) => {
|
|
1485
|
+
if (t == null || t === "") return null;
|
|
1486
|
+
const e = Number(t);
|
|
1487
|
+
return Number.isNaN(e) ? null : e;
|
|
1488
|
+
}, Cn = (t) => {
|
|
1489
|
+
const { value: e, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i, after: c } = t, p = (d) => {
|
|
1486
1490
|
const x = n != null ? u.get(n) : void 0, h = s != null ? u.get(s) : void 0;
|
|
1487
1491
|
return x != null && d < x ? x : h != null && d > h ? h : d;
|
|
1488
1492
|
}, m = (() => {
|
|
1489
1493
|
if (r == null) return null;
|
|
1490
1494
|
const d = V(
|
|
1491
|
-
|
|
1495
|
+
e,
|
|
1492
1496
|
n
|
|
1493
1497
|
)((b, D) => {
|
|
1494
|
-
const
|
|
1495
|
-
return D == null ? !0 :
|
|
1498
|
+
const k = b ?? 0;
|
|
1499
|
+
return D == null ? !0 : k > D;
|
|
1496
1500
|
}), x = V(
|
|
1497
|
-
|
|
1501
|
+
e,
|
|
1498
1502
|
s
|
|
1499
1503
|
)((b, D) => {
|
|
1500
|
-
const
|
|
1501
|
-
return D == null ? !0 :
|
|
1504
|
+
const k = b ?? 0;
|
|
1505
|
+
return D == null ? !0 : k < D;
|
|
1502
1506
|
}), h = (b) => {
|
|
1503
|
-
const D = u.get(
|
|
1504
|
-
if (
|
|
1507
|
+
const D = u.get(e) ?? 0, k = u.get(r), _ = b?.shiftKey ? 10 : 1, w = D - k * _, $ = n != null ? u.get(n) : void 0;
|
|
1508
|
+
if ($ != null && w < $) return;
|
|
1505
1509
|
const M = p(w);
|
|
1506
1510
|
M !== D && l && l(M);
|
|
1507
|
-
},
|
|
1508
|
-
const D = u.get(
|
|
1509
|
-
if (
|
|
1511
|
+
}, y = (b) => {
|
|
1512
|
+
const D = u.get(e) ?? 0, k = u.get(r), _ = b?.shiftKey ? 10 : 1, w = D + k * _, $ = s != null ? u.get(s) : void 0;
|
|
1513
|
+
if ($ != null && w > $) return;
|
|
1510
1514
|
const M = p(w);
|
|
1511
1515
|
M !== D && l && l(M);
|
|
1512
1516
|
};
|
|
1513
|
-
return ((b, D) =>
|
|
1517
|
+
return ((b, D) => ct(
|
|
1514
1518
|
a.class("bc-number-input-steppers"),
|
|
1515
1519
|
I.button(
|
|
1520
|
+
a.type("button"),
|
|
1516
1521
|
a.class(
|
|
1517
1522
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1518
1523
|
),
|
|
1519
1524
|
a.disabled(
|
|
1520
1525
|
V(
|
|
1521
1526
|
x,
|
|
1522
|
-
|
|
1523
|
-
)((
|
|
1527
|
+
t.disabled ?? !1
|
|
1528
|
+
)((k, _) => !k || _)
|
|
1524
1529
|
),
|
|
1525
|
-
C.click((
|
|
1530
|
+
C.click((k) => y(k)),
|
|
1526
1531
|
N.label(b),
|
|
1527
1532
|
z({ icon: "line-md:plus", size: "xs" })
|
|
1528
1533
|
),
|
|
1529
1534
|
I.button(
|
|
1535
|
+
a.type("button"),
|
|
1530
1536
|
a.class(
|
|
1531
1537
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1532
1538
|
),
|
|
1533
1539
|
a.disabled(
|
|
1534
1540
|
V(
|
|
1535
1541
|
d,
|
|
1536
|
-
|
|
1537
|
-
)((
|
|
1542
|
+
t.disabled ?? !1
|
|
1543
|
+
)((k, _) => !k || _)
|
|
1538
1544
|
),
|
|
1539
|
-
C.click((
|
|
1545
|
+
C.click((k) => h(k)),
|
|
1540
1546
|
N.label(D),
|
|
1541
1547
|
z({ icon: "line-md:minus", size: "xs" })
|
|
1542
1548
|
)
|
|
1543
1549
|
))(
|
|
1544
|
-
|
|
1545
|
-
|
|
1550
|
+
$t.incrementValue,
|
|
1551
|
+
$t.decrementValue
|
|
1546
1552
|
);
|
|
1547
|
-
})(), f = Y(
|
|
1553
|
+
})(), f = Y(e, t.disabled, l), v = c != null && m != null ? L(m, f, c) : c != null ? L(f, c) : m != null ? L(m, f) : f;
|
|
1548
1554
|
return O({
|
|
1549
|
-
...
|
|
1555
|
+
...t,
|
|
1550
1556
|
input: K.number(
|
|
1551
1557
|
// min/max attributes and reactive watchers (no forced correction)
|
|
1552
1558
|
n != null ? L(
|
|
@@ -1563,36 +1569,36 @@ const xn = (e) => {
|
|
|
1563
1569
|
})
|
|
1564
1570
|
)
|
|
1565
1571
|
) : T,
|
|
1566
|
-
j(
|
|
1572
|
+
j(t),
|
|
1567
1573
|
// Represent null as empty string so the field can be cleared
|
|
1568
|
-
a.value(u.map(
|
|
1574
|
+
a.value(u.map(e, (d) => d == null ? "" : String(d))),
|
|
1569
1575
|
a.step(r),
|
|
1570
1576
|
a.class("bc-input bc-number-input"),
|
|
1571
1577
|
o != null ? C.blur(P(o)) : T,
|
|
1572
1578
|
l != null ? C.change(
|
|
1573
1579
|
P((d) => {
|
|
1574
|
-
const x =
|
|
1580
|
+
const x = Rt(d);
|
|
1575
1581
|
l(x);
|
|
1576
1582
|
})
|
|
1577
1583
|
) : T,
|
|
1578
1584
|
i != null ? C.input(
|
|
1579
1585
|
P((d) => {
|
|
1580
|
-
const x =
|
|
1586
|
+
const x = Rt(d);
|
|
1581
1587
|
i(x);
|
|
1582
1588
|
})
|
|
1583
1589
|
) : T,
|
|
1584
1590
|
// Wheel support when step is defined
|
|
1585
1591
|
r != null ? C.wheel((d) => {
|
|
1586
1592
|
d.preventDefault();
|
|
1587
|
-
const x = u.get(
|
|
1593
|
+
const x = u.get(e) ?? 0, h = u.get(r), y = d.shiftKey ? 10 : 1, g = d.deltaY < 0 ? h * y : -h * y, b = p(x + g);
|
|
1588
1594
|
b !== x && l && l(b);
|
|
1589
1595
|
}) : T
|
|
1590
1596
|
),
|
|
1591
1597
|
after: v
|
|
1592
1598
|
});
|
|
1593
1599
|
}, Mn = ({
|
|
1594
|
-
value:
|
|
1595
|
-
onChange:
|
|
1600
|
+
value: t,
|
|
1601
|
+
onChange: e,
|
|
1596
1602
|
offLabel: r,
|
|
1597
1603
|
onLabel: n,
|
|
1598
1604
|
label: s,
|
|
@@ -1601,24 +1607,24 @@ const xn = (e) => {
|
|
|
1601
1607
|
id: i,
|
|
1602
1608
|
color: c = "primary"
|
|
1603
1609
|
}) => {
|
|
1604
|
-
const p = i ??
|
|
1605
|
-
function f(h,
|
|
1610
|
+
const p = i ?? de("switch"), m = `${p}-label`;
|
|
1611
|
+
function f(h, y) {
|
|
1606
1612
|
const g = [
|
|
1607
1613
|
"bc-switch",
|
|
1608
|
-
`bc-switch--size-${
|
|
1609
|
-
`bc-switch--${
|
|
1614
|
+
`bc-switch--size-${y}`,
|
|
1615
|
+
`bc-switch--${y}`
|
|
1610
1616
|
];
|
|
1611
1617
|
return h && g.push("bc-switch--disabled"), g.join(" ");
|
|
1612
1618
|
}
|
|
1613
1619
|
function v(h) {
|
|
1614
|
-
const
|
|
1620
|
+
const y = h ?? "primary", g = /* @__PURE__ */ new Map(), b = Lt(y, "solid", "light"), D = Lt(y, "solid", "dark");
|
|
1615
1621
|
return g.set("--switch-track-on-bg", b.backgroundColor), g.set("--switch-track-on-label", b.textColor), g.set("--switch-track-on-bg-dark", D.backgroundColor), g.set("--switch-track-on-label-dark", D.textColor), g.set(
|
|
1616
1622
|
"--switch-track-on-border-dark",
|
|
1617
|
-
|
|
1618
|
-
), Array.from(g.entries()).map(([
|
|
1623
|
+
he(y, "dark")
|
|
1624
|
+
), Array.from(g.entries()).map(([k, _]) => `${k}: ${_}`).join("; ");
|
|
1619
1625
|
}
|
|
1620
1626
|
const d = () => {
|
|
1621
|
-
u.get(o) ||
|
|
1627
|
+
u.get(o) || e(!u.get(t));
|
|
1622
1628
|
}, x = (h) => {
|
|
1623
1629
|
u.get(o) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), d());
|
|
1624
1630
|
};
|
|
@@ -1628,7 +1634,7 @@ const xn = (e) => {
|
|
|
1628
1634
|
o ?? !1,
|
|
1629
1635
|
l
|
|
1630
1636
|
)(
|
|
1631
|
-
(h,
|
|
1637
|
+
(h, y) => f(h ?? !1, y ?? "md")
|
|
1632
1638
|
)
|
|
1633
1639
|
),
|
|
1634
1640
|
a.style(
|
|
@@ -1641,12 +1647,12 @@ const xn = (e) => {
|
|
|
1641
1647
|
a.tabindex(
|
|
1642
1648
|
u.map(o, (h) => h ? -1 : 0)
|
|
1643
1649
|
),
|
|
1644
|
-
N.checked(
|
|
1650
|
+
N.checked(t),
|
|
1645
1651
|
N.disabled(o),
|
|
1646
1652
|
N.labelledby(s != null ? m : void 0),
|
|
1647
1653
|
C.click(d),
|
|
1648
1654
|
C.keydown(x),
|
|
1649
|
-
s != null ?
|
|
1655
|
+
s != null ? fe(
|
|
1650
1656
|
a.id(m),
|
|
1651
1657
|
a.class(
|
|
1652
1658
|
`bc-switch__label bc-switch__label--size-${l} bc-switch__label--nowrap`
|
|
@@ -1657,7 +1663,7 @@ const xn = (e) => {
|
|
|
1657
1663
|
a.class("bc-switch__track"),
|
|
1658
1664
|
a.class(
|
|
1659
1665
|
u.map(
|
|
1660
|
-
|
|
1666
|
+
t,
|
|
1661
1667
|
(h) => h ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
1662
1668
|
)
|
|
1663
1669
|
),
|
|
@@ -1666,7 +1672,7 @@ const xn = (e) => {
|
|
|
1666
1672
|
a.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
1667
1673
|
a.class(
|
|
1668
1674
|
u.map(
|
|
1669
|
-
|
|
1675
|
+
t,
|
|
1670
1676
|
(h) => h ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
|
|
1671
1677
|
)
|
|
1672
1678
|
),
|
|
@@ -1676,30 +1682,30 @@ const xn = (e) => {
|
|
|
1676
1682
|
a.class("bc-switch__track-label bc-switch__track-label--on"),
|
|
1677
1683
|
a.class(
|
|
1678
1684
|
u.map(
|
|
1679
|
-
|
|
1685
|
+
t,
|
|
1680
1686
|
(h) => h ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
|
|
1681
1687
|
)
|
|
1682
1688
|
),
|
|
1683
1689
|
n
|
|
1684
1690
|
) : null,
|
|
1685
|
-
|
|
1691
|
+
jt(
|
|
1686
1692
|
(h) => H(
|
|
1687
|
-
|
|
1688
|
-
({ direction:
|
|
1693
|
+
me,
|
|
1694
|
+
({ direction: y }) => I.div(
|
|
1689
1695
|
a.class("bc-switch__thumb"),
|
|
1690
1696
|
a.class(
|
|
1691
1697
|
u.map(
|
|
1692
|
-
|
|
1698
|
+
t,
|
|
1693
1699
|
(g) => g ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
1694
1700
|
)
|
|
1695
1701
|
),
|
|
1696
|
-
|
|
1702
|
+
dt.transform(
|
|
1697
1703
|
V(
|
|
1698
|
-
|
|
1704
|
+
t,
|
|
1699
1705
|
h,
|
|
1700
1706
|
l,
|
|
1701
|
-
|
|
1702
|
-
)((g, { width: b }, D,
|
|
1707
|
+
y
|
|
1708
|
+
)((g, { width: b }, D, k) => {
|
|
1703
1709
|
const _ = (() => {
|
|
1704
1710
|
switch (D) {
|
|
1705
1711
|
case "xs":
|
|
@@ -1713,7 +1719,7 @@ const xn = (e) => {
|
|
|
1713
1719
|
case "xl":
|
|
1714
1720
|
return 8;
|
|
1715
1721
|
}
|
|
1716
|
-
})(), w =
|
|
1722
|
+
})(), w = k === "rtl" ? `calc((var(--spacing-base) * ${_}) - ${b}px)` : `calc(${b}px - (var(--spacing-base) * ${_}))`;
|
|
1717
1723
|
return g ? `translateX(${w})` : "translateX(0)";
|
|
1718
1724
|
})
|
|
1719
1725
|
)
|
|
@@ -1722,97 +1728,97 @@ const xn = (e) => {
|
|
|
1722
1728
|
)
|
|
1723
1729
|
)
|
|
1724
1730
|
);
|
|
1725
|
-
},
|
|
1726
|
-
const
|
|
1731
|
+
}, Xe = (t) => {
|
|
1732
|
+
const e = {
|
|
1727
1733
|
type: "pattern",
|
|
1728
1734
|
pattern: /[0-9A-Fa-f]/,
|
|
1729
1735
|
transform: (n) => n.toLowerCase()
|
|
1730
1736
|
};
|
|
1731
|
-
return
|
|
1732
|
-
...
|
|
1737
|
+
return Xt({
|
|
1738
|
+
...t,
|
|
1733
1739
|
mask: [
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1740
|
+
e,
|
|
1741
|
+
e,
|
|
1742
|
+
e,
|
|
1743
|
+
e,
|
|
1744
|
+
e,
|
|
1745
|
+
e,
|
|
1746
|
+
e,
|
|
1747
|
+
e,
|
|
1742
1748
|
"-",
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1749
|
+
e,
|
|
1750
|
+
e,
|
|
1751
|
+
e,
|
|
1752
|
+
e,
|
|
1747
1753
|
"-",
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1754
|
+
e,
|
|
1755
|
+
e,
|
|
1756
|
+
e,
|
|
1757
|
+
e,
|
|
1752
1758
|
"-",
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1759
|
+
e,
|
|
1760
|
+
e,
|
|
1761
|
+
e,
|
|
1762
|
+
e,
|
|
1757
1763
|
"-",
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1764
|
+
e,
|
|
1765
|
+
e,
|
|
1766
|
+
e,
|
|
1767
|
+
e,
|
|
1768
|
+
e,
|
|
1769
|
+
e,
|
|
1770
|
+
e,
|
|
1771
|
+
e,
|
|
1772
|
+
e,
|
|
1773
|
+
e,
|
|
1774
|
+
e,
|
|
1775
|
+
e
|
|
1770
1776
|
],
|
|
1771
1777
|
// Sensible default placeholder; can be overridden via options.placeholder
|
|
1772
|
-
placeholder:
|
|
1778
|
+
placeholder: t.placeholder ?? "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
1773
1779
|
});
|
|
1774
|
-
}, Dn = (
|
|
1775
|
-
const { value:
|
|
1776
|
-
return
|
|
1780
|
+
}, Dn = (t) => {
|
|
1781
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = t, c = Y(e, l, n);
|
|
1782
|
+
return Xe({
|
|
1777
1783
|
...i,
|
|
1778
|
-
value: u.map(
|
|
1784
|
+
value: u.map(e, nt),
|
|
1779
1785
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1780
1786
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1781
1787
|
onBlur: r,
|
|
1782
1788
|
after: o != null ? L(c, o) : c
|
|
1783
1789
|
});
|
|
1784
|
-
},
|
|
1790
|
+
}, qe = "line-md:star-alt-filled", Ge = "line-md:star-alt", Qe = (t) => {
|
|
1785
1791
|
const {
|
|
1786
|
-
value:
|
|
1792
|
+
value: e,
|
|
1787
1793
|
onChange: r,
|
|
1788
1794
|
disabled: n,
|
|
1789
1795
|
max: s = 5,
|
|
1790
1796
|
fullColor: o = "yellow",
|
|
1791
1797
|
emptyColor: l = "neutral",
|
|
1792
|
-
fullIcon: i =
|
|
1793
|
-
emptyIcon: c =
|
|
1798
|
+
fullIcon: i = qe,
|
|
1799
|
+
emptyIcon: c = Ge,
|
|
1794
1800
|
size: p = "md",
|
|
1795
1801
|
onBlur: m,
|
|
1796
1802
|
rounding: f = 1
|
|
1797
|
-
} =
|
|
1803
|
+
} = t, v = () => {
|
|
1798
1804
|
const b = u.get(f);
|
|
1799
1805
|
return b > 0 ? b : 1;
|
|
1800
1806
|
}, d = (b) => Math.min(Math.max(b, 0), u.get(s)), x = (b, D) => {
|
|
1801
1807
|
if (u.get(n ?? !1)) return;
|
|
1802
|
-
const _ = b.currentTarget.getBoundingClientRect(), w = (b.clientX - _.left) / _.width,
|
|
1808
|
+
const _ = b.currentTarget.getBoundingClientRect(), w = (b.clientX - _.left) / _.width, $ = D - 1 + w, M = v(), A = Math.ceil($ / M) * M, F = d(A);
|
|
1803
1809
|
r?.(F);
|
|
1804
1810
|
}, h = (b) => {
|
|
1805
1811
|
if (u.get(n ?? !1)) return;
|
|
1806
|
-
const D = v(),
|
|
1812
|
+
const D = v(), k = u.get(e) ?? 0;
|
|
1807
1813
|
let _;
|
|
1808
1814
|
switch (b.key) {
|
|
1809
1815
|
case "ArrowRight":
|
|
1810
1816
|
case "ArrowUp":
|
|
1811
|
-
_ = d(
|
|
1817
|
+
_ = d(k + D);
|
|
1812
1818
|
break;
|
|
1813
1819
|
case "ArrowLeft":
|
|
1814
1820
|
case "ArrowDown":
|
|
1815
|
-
_ = d(
|
|
1821
|
+
_ = d(k - D);
|
|
1816
1822
|
break;
|
|
1817
1823
|
case "Home":
|
|
1818
1824
|
_ = 0;
|
|
@@ -1824,20 +1830,20 @@ const xn = (e) => {
|
|
|
1824
1830
|
return;
|
|
1825
1831
|
}
|
|
1826
1832
|
b.preventDefault(), r?.(_);
|
|
1827
|
-
},
|
|
1833
|
+
}, y = u.map(p, (b) => `bc-icon--${b}`), g = ({ index: b, counter: D }) => I.span(
|
|
1828
1834
|
a.class("bc-rating-input__icon-container"),
|
|
1829
|
-
a.class(
|
|
1835
|
+
a.class(y),
|
|
1830
1836
|
z(
|
|
1831
1837
|
{ icon: c, size: p, color: l, tone: "soft" },
|
|
1832
1838
|
a.class("bc-rating-input__icon-empty")
|
|
1833
1839
|
),
|
|
1834
1840
|
I.span(
|
|
1835
1841
|
a.class("bc-rating-input__icon-clipper"),
|
|
1836
|
-
a.class(
|
|
1837
|
-
|
|
1838
|
-
u.map(
|
|
1839
|
-
const _ = Math.floor(
|
|
1840
|
-
return _ > b ? "100%" : _ < b ? "0%" : `${(
|
|
1842
|
+
a.class(y),
|
|
1843
|
+
dt.width(
|
|
1844
|
+
u.map(e, (k) => {
|
|
1845
|
+
const _ = Math.floor(k);
|
|
1846
|
+
return _ > b ? "100%" : _ < b ? "0%" : `${(k - b) * 100}%`;
|
|
1841
1847
|
})
|
|
1842
1848
|
),
|
|
1843
1849
|
z(
|
|
@@ -1846,7 +1852,7 @@ const xn = (e) => {
|
|
|
1846
1852
|
)
|
|
1847
1853
|
),
|
|
1848
1854
|
C.click(
|
|
1849
|
-
|
|
1855
|
+
ne((k) => x(k, D), {
|
|
1850
1856
|
preventDefault: !0,
|
|
1851
1857
|
stopPropagation: !0
|
|
1852
1858
|
})
|
|
@@ -1856,10 +1862,10 @@ const xn = (e) => {
|
|
|
1856
1862
|
baseContainer: !0,
|
|
1857
1863
|
growInput: !1,
|
|
1858
1864
|
focusableSelector: '[role="slider"]',
|
|
1859
|
-
...
|
|
1865
|
+
...t,
|
|
1860
1866
|
input: I.div(
|
|
1861
1867
|
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
1862
|
-
j(
|
|
1868
|
+
j(t),
|
|
1863
1869
|
a.class("bc-rating-input"),
|
|
1864
1870
|
// ARIA slider semantics
|
|
1865
1871
|
a.role("slider"),
|
|
@@ -1867,69 +1873,69 @@ const xn = (e) => {
|
|
|
1867
1873
|
N.disabled(n ?? !1),
|
|
1868
1874
|
N.valuemin(0),
|
|
1869
1875
|
N.valuemax(u.map(s, (b) => b ?? 0)),
|
|
1870
|
-
N.valuenow(u.map(
|
|
1876
|
+
N.valuenow(u.map(e, (b) => b ?? 0)),
|
|
1871
1877
|
N.valuetext(
|
|
1872
1878
|
V(
|
|
1873
|
-
|
|
1879
|
+
e,
|
|
1874
1880
|
s
|
|
1875
1881
|
)((b, D) => {
|
|
1876
|
-
const
|
|
1877
|
-
return `${String(
|
|
1882
|
+
const k = b ?? 0, _ = D ?? 0;
|
|
1883
|
+
return `${String(k)} / ${String(_)}`;
|
|
1878
1884
|
})
|
|
1879
1885
|
),
|
|
1880
1886
|
// Keyboard & focus handlers
|
|
1881
1887
|
C.keydown(h),
|
|
1882
1888
|
m != null ? C.blur(m) : null,
|
|
1883
|
-
|
|
1889
|
+
Pt(s, g)
|
|
1884
1890
|
)
|
|
1885
1891
|
});
|
|
1886
|
-
}, Sn = (
|
|
1887
|
-
const { value:
|
|
1888
|
-
return
|
|
1892
|
+
}, Sn = (t) => {
|
|
1893
|
+
const { value: e, onChange: r, onBlur: n, after: s, disabled: o, ...l } = t, i = Y(e, o, r);
|
|
1894
|
+
return Qe({
|
|
1889
1895
|
...l,
|
|
1890
1896
|
// Map null -> 0 for display so the control shows as empty when null
|
|
1891
|
-
value: u.map(
|
|
1897
|
+
value: u.map(e, (c) => c ?? 0),
|
|
1892
1898
|
// Pass through numeric changes; clear button will call onChange(null)
|
|
1893
1899
|
onChange: r,
|
|
1894
1900
|
onBlur: n,
|
|
1895
1901
|
after: s != null ? L(i, s) : i
|
|
1896
1902
|
});
|
|
1897
|
-
}, Tn = (
|
|
1898
|
-
const { value:
|
|
1903
|
+
}, Tn = (t) => {
|
|
1904
|
+
const { value: e, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i } = t;
|
|
1899
1905
|
return O({
|
|
1900
|
-
...
|
|
1906
|
+
...t,
|
|
1901
1907
|
// Make sure clicks anywhere focus the range input
|
|
1902
1908
|
focusableSelector: 'input[type="range"]',
|
|
1903
1909
|
input: I.input(
|
|
1904
1910
|
a.type("range"),
|
|
1905
|
-
j(
|
|
1911
|
+
j(t),
|
|
1906
1912
|
a.min(n),
|
|
1907
1913
|
a.max(s),
|
|
1908
1914
|
a.step(r),
|
|
1909
1915
|
// Using value as number to keep it in sync
|
|
1910
|
-
a.valueAsNumber(
|
|
1916
|
+
a.valueAsNumber(e),
|
|
1911
1917
|
a.class("bc-input bc-slider-input"),
|
|
1912
1918
|
o != null ? C.blur(G(o)) : T,
|
|
1913
1919
|
l != null ? C.change(G(l)) : T,
|
|
1914
1920
|
i != null ? C.input(G(i)) : T
|
|
1915
1921
|
)
|
|
1916
1922
|
});
|
|
1917
|
-
}, An = (
|
|
1918
|
-
const { value:
|
|
1923
|
+
}, An = (t) => {
|
|
1924
|
+
const { value: e, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i } = t, c = u.map(e, (m) => {
|
|
1919
1925
|
if (m != null) return m;
|
|
1920
1926
|
const f = n != null ? u.get(n) : void 0;
|
|
1921
1927
|
return typeof f == "number" ? f : 0;
|
|
1922
|
-
}), p = Y(
|
|
1928
|
+
}), p = Y(e, t.disabled, (m) => {
|
|
1923
1929
|
l?.(m);
|
|
1924
1930
|
});
|
|
1925
1931
|
return O(
|
|
1926
1932
|
{
|
|
1927
|
-
...
|
|
1933
|
+
...t,
|
|
1928
1934
|
focusableSelector: 'input[type="range"]',
|
|
1929
1935
|
after: p,
|
|
1930
1936
|
input: I.input(
|
|
1931
1937
|
a.type("range"),
|
|
1932
|
-
j(
|
|
1938
|
+
j(t),
|
|
1933
1939
|
a.min(n),
|
|
1934
1940
|
a.max(s),
|
|
1935
1941
|
a.step(r),
|
|
@@ -1952,35 +1958,35 @@ const xn = (e) => {
|
|
|
1952
1958
|
L()
|
|
1953
1959
|
);
|
|
1954
1960
|
};
|
|
1955
|
-
let
|
|
1956
|
-
async function
|
|
1957
|
-
const
|
|
1958
|
-
return
|
|
1959
|
-
const r =
|
|
1960
|
-
return
|
|
1961
|
-
})),
|
|
1961
|
+
let wt = null;
|
|
1962
|
+
async function Mt() {
|
|
1963
|
+
const t = globalThis;
|
|
1964
|
+
return t.Temporal ? t.Temporal : (wt || (wt = import("./index.esm-DPNh6inz.js").then((e) => {
|
|
1965
|
+
const r = e.Temporal;
|
|
1966
|
+
return t.Temporal || (t.Temporal = r), r;
|
|
1967
|
+
})), wt);
|
|
1962
1968
|
}
|
|
1963
|
-
const
|
|
1964
|
-
then:
|
|
1965
|
-
pending:
|
|
1966
|
-
error:
|
|
1967
|
-
}) :
|
|
1968
|
-
function
|
|
1969
|
+
const Je = (t, e) => e ? Bt(Mt, {
|
|
1970
|
+
then: t,
|
|
1971
|
+
pending: e.pending,
|
|
1972
|
+
error: e.error
|
|
1973
|
+
}) : Bt(Mt, t), Ke = /^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i, tn = /^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;
|
|
1974
|
+
function en(t) {
|
|
1969
1975
|
return {
|
|
1970
1976
|
mask: null,
|
|
1971
1977
|
allowMode: "custom",
|
|
1972
|
-
allow: (
|
|
1973
|
-
pipe: (
|
|
1974
|
-
const r =
|
|
1975
|
-
return r.length === 0 ? r : !r.startsWith("P") || !
|
|
1978
|
+
allow: (e) => /[0-9ptwdhms]/i.test(e),
|
|
1979
|
+
pipe: (e) => {
|
|
1980
|
+
const r = e.toUpperCase();
|
|
1981
|
+
return r.length === 0 ? r : !r.startsWith("P") || !Ke.test(r) ? !1 : r;
|
|
1976
1982
|
},
|
|
1977
1983
|
completion: {
|
|
1978
1984
|
mode: "custom",
|
|
1979
|
-
isComplete: (
|
|
1980
|
-
const r =
|
|
1981
|
-
if (!
|
|
1985
|
+
isComplete: (e) => {
|
|
1986
|
+
const r = e.toUpperCase();
|
|
1987
|
+
if (!tn.test(r)) return !1;
|
|
1982
1988
|
try {
|
|
1983
|
-
return
|
|
1989
|
+
return t(r), !0;
|
|
1984
1990
|
} catch {
|
|
1985
1991
|
return !1;
|
|
1986
1992
|
}
|
|
@@ -1988,33 +1994,33 @@ function tn(e) {
|
|
|
1988
1994
|
}
|
|
1989
1995
|
};
|
|
1990
1996
|
}
|
|
1991
|
-
const
|
|
1992
|
-
if (
|
|
1997
|
+
const Ot = (t, e) => {
|
|
1998
|
+
if (t == null) return null;
|
|
1993
1999
|
try {
|
|
1994
|
-
return
|
|
2000
|
+
return t.Duration.from(e);
|
|
1995
2001
|
} catch {
|
|
1996
2002
|
return null;
|
|
1997
2003
|
}
|
|
1998
|
-
}, Fn = (
|
|
1999
|
-
const { value:
|
|
2000
|
-
const p = Y(
|
|
2004
|
+
}, Fn = (t) => {
|
|
2005
|
+
const { value: e, onChange: r, after: n, disabled: s, onBlur: o } = t, l = () => {
|
|
2006
|
+
const p = Y(e, s, r);
|
|
2001
2007
|
return n != null ? L(p, n) : p;
|
|
2002
|
-
}, i =
|
|
2003
|
-
return
|
|
2004
|
-
(p) =>
|
|
2005
|
-
...
|
|
2006
|
-
value: u.map(
|
|
2008
|
+
}, i = t.placeholder != null ? T : a.placeholder("P0DT0H0M0S");
|
|
2009
|
+
return Je(
|
|
2010
|
+
(p) => Xt({
|
|
2011
|
+
...t,
|
|
2012
|
+
value: u.map(e, (m) => m?.toString() ?? ""),
|
|
2007
2013
|
onChange: r ? (m) => r(m === "" ? null : p.Duration.from(m)) : void 0,
|
|
2008
2014
|
onInput: void 0,
|
|
2009
|
-
...
|
|
2015
|
+
...en(p.Duration.from),
|
|
2010
2016
|
placeholder: "P0DT0H0M0S",
|
|
2011
2017
|
after: l()
|
|
2012
2018
|
}),
|
|
2013
2019
|
{ pending: () => O({
|
|
2014
|
-
...
|
|
2020
|
+
...t,
|
|
2015
2021
|
input: K.text(
|
|
2016
|
-
j(
|
|
2017
|
-
a.value(u.map(
|
|
2022
|
+
j(t),
|
|
2023
|
+
a.value(u.map(e, (p) => p?.toString() ?? "")),
|
|
2018
2024
|
a.class("bc-input"),
|
|
2019
2025
|
i,
|
|
2020
2026
|
o != null ? C.blur(() => o()) : T,
|
|
@@ -2024,13 +2030,13 @@ const Oe = (e, t) => {
|
|
|
2024
2030
|
r(null);
|
|
2025
2031
|
return;
|
|
2026
2032
|
}
|
|
2027
|
-
const v = globalThis.Temporal, d =
|
|
2033
|
+
const v = globalThis.Temporal, d = Ot(v, f);
|
|
2028
2034
|
if (d != null) {
|
|
2029
2035
|
r(d);
|
|
2030
2036
|
return;
|
|
2031
2037
|
}
|
|
2032
|
-
|
|
2033
|
-
const h =
|
|
2038
|
+
Mt().then((x) => {
|
|
2039
|
+
const h = Ot(x, f);
|
|
2034
2040
|
h != null && r(h);
|
|
2035
2041
|
}).catch(() => {
|
|
2036
2042
|
});
|
|
@@ -2039,32 +2045,32 @@ const Oe = (e, t) => {
|
|
|
2039
2045
|
after: l()
|
|
2040
2046
|
}) }
|
|
2041
2047
|
);
|
|
2042
|
-
}, nn = (
|
|
2043
|
-
const { value:
|
|
2048
|
+
}, nn = (t) => {
|
|
2049
|
+
const { value: e, onBlur: r, onChange: n, onInput: s } = t;
|
|
2044
2050
|
return O({
|
|
2045
|
-
...
|
|
2051
|
+
...t,
|
|
2046
2052
|
input: K.url(
|
|
2047
|
-
j(
|
|
2048
|
-
a.value(
|
|
2053
|
+
j(t),
|
|
2054
|
+
a.value(e),
|
|
2049
2055
|
a.class("bc-input"),
|
|
2050
2056
|
r != null ? C.blur(P(r)) : T,
|
|
2051
2057
|
n != null ? C.change(P(n)) : T,
|
|
2052
2058
|
s != null ? C.input(P(s)) : T
|
|
2053
2059
|
)
|
|
2054
2060
|
});
|
|
2055
|
-
}, Bn = (
|
|
2056
|
-
const { value:
|
|
2061
|
+
}, Bn = (t) => {
|
|
2062
|
+
const { value: e, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = t, c = Y(e, l, n);
|
|
2057
2063
|
return nn({
|
|
2058
2064
|
...i,
|
|
2059
|
-
value: u.map(
|
|
2065
|
+
value: u.map(e, nt),
|
|
2060
2066
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
2061
2067
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
2062
2068
|
onBlur: r,
|
|
2063
2069
|
after: o != null ? L(c, o) : c
|
|
2064
2070
|
});
|
|
2065
|
-
}, sn = (
|
|
2071
|
+
}, sn = (t) => {
|
|
2066
2072
|
const {
|
|
2067
|
-
controller:
|
|
2073
|
+
controller: e,
|
|
2068
2074
|
element: r,
|
|
2069
2075
|
separator: n,
|
|
2070
2076
|
showMove: s = !0,
|
|
@@ -2075,8 +2081,8 @@ const Oe = (e, t) => {
|
|
|
2075
2081
|
controlsLayout: p = "aside",
|
|
2076
2082
|
removeDisabled: m,
|
|
2077
2083
|
addDisabled: f
|
|
2078
|
-
} =
|
|
2079
|
-
const
|
|
2084
|
+
} = t, v = u.toSignal(p).map((h) => h === "aside"), d = (h) => {
|
|
2085
|
+
const y = E(
|
|
2080
2086
|
s ?? !1,
|
|
2081
2087
|
() => I.div(
|
|
2082
2088
|
a.class("bc-group--align-center"),
|
|
@@ -2085,7 +2091,7 @@ const Oe = (e, t) => {
|
|
|
2085
2091
|
(b) => b ? "bc-group--direction-column bc-group--gap-1" : "bc-group--direction-row bc-group--gap-1"
|
|
2086
2092
|
)
|
|
2087
2093
|
),
|
|
2088
|
-
|
|
2094
|
+
gt(
|
|
2089
2095
|
{
|
|
2090
2096
|
size: "xs",
|
|
2091
2097
|
roundedness: "full",
|
|
@@ -2102,7 +2108,7 @@ const Oe = (e, t) => {
|
|
|
2102
2108
|
})
|
|
2103
2109
|
)
|
|
2104
2110
|
),
|
|
2105
|
-
|
|
2111
|
+
gt(
|
|
2106
2112
|
{
|
|
2107
2113
|
size: "xs",
|
|
2108
2114
|
roundedness: "full",
|
|
@@ -2124,7 +2130,7 @@ const Oe = (e, t) => {
|
|
|
2124
2130
|
o,
|
|
2125
2131
|
() => H(
|
|
2126
2132
|
X,
|
|
2127
|
-
(b) =>
|
|
2133
|
+
(b) => yt({
|
|
2128
2134
|
size: "xs",
|
|
2129
2135
|
// Use a lowercase label to satisfy tests that query with [aria-label*="remove"]
|
|
2130
2136
|
label: u.map(b.$.removeItem, (D) => D.toLowerCase()),
|
|
@@ -2136,26 +2142,26 @@ const Oe = (e, t) => {
|
|
|
2136
2142
|
);
|
|
2137
2143
|
return (b) => E(
|
|
2138
2144
|
v,
|
|
2139
|
-
() =>
|
|
2145
|
+
() => pt(
|
|
2140
2146
|
a.class("bc-group--gap-1 bc-group--align-center"),
|
|
2141
|
-
|
|
2142
|
-
|
|
2147
|
+
ct(a.class("bc-stack--grow"), b),
|
|
2148
|
+
ct(
|
|
2143
2149
|
a.class("bc-stack--align-center"),
|
|
2144
2150
|
E(
|
|
2145
|
-
|
|
2146
|
-
() =>
|
|
2151
|
+
e.value.map((D) => D.length > 1),
|
|
2152
|
+
() => y
|
|
2147
2153
|
),
|
|
2148
2154
|
g
|
|
2149
2155
|
)
|
|
2150
2156
|
),
|
|
2151
|
-
() =>
|
|
2157
|
+
() => ct(
|
|
2152
2158
|
a.class("bc-stack--gap-2"),
|
|
2153
2159
|
b,
|
|
2154
|
-
|
|
2160
|
+
pt(
|
|
2155
2161
|
a.class("bc-group--gap-2 bc-group--justify-between"),
|
|
2156
2162
|
E(
|
|
2157
|
-
|
|
2158
|
-
() =>
|
|
2163
|
+
e.value.map((D) => D.length > 1),
|
|
2164
|
+
() => y,
|
|
2159
2165
|
() => I.div()
|
|
2160
2166
|
),
|
|
2161
2167
|
g
|
|
@@ -2163,26 +2169,26 @@ const Oe = (e, t) => {
|
|
|
2163
2169
|
)
|
|
2164
2170
|
);
|
|
2165
2171
|
}, x = E(
|
|
2166
|
-
V(l, i)((h,
|
|
2167
|
-
() =>
|
|
2172
|
+
V(l, i)((h, y) => h && y != null),
|
|
2173
|
+
() => pt(
|
|
2168
2174
|
a.class(
|
|
2169
2175
|
"bc-group--gap-2 bc-group--align-center bc-group--justify-center"
|
|
2170
2176
|
),
|
|
2171
|
-
|
|
2177
|
+
gt(
|
|
2172
2178
|
{
|
|
2173
2179
|
size: "sm",
|
|
2174
2180
|
variant: "filled",
|
|
2175
|
-
onClick: () =>
|
|
2181
|
+
onClick: () => e.push(i()),
|
|
2176
2182
|
disabled: V(
|
|
2177
|
-
|
|
2183
|
+
e.disabled,
|
|
2178
2184
|
f ?? !1
|
|
2179
2185
|
)(
|
|
2180
|
-
(h,
|
|
2186
|
+
(h, y) => h || y
|
|
2181
2187
|
)
|
|
2182
2188
|
},
|
|
2183
2189
|
H(
|
|
2184
2190
|
X,
|
|
2185
|
-
(h) =>
|
|
2191
|
+
(h) => pt(
|
|
2186
2192
|
a.class("bc-group--gap-2"),
|
|
2187
2193
|
z({ icon: "line-md:plus" }),
|
|
2188
2194
|
c ?? h.$.addLabel
|
|
@@ -2192,14 +2198,14 @@ const Oe = (e, t) => {
|
|
|
2192
2198
|
)
|
|
2193
2199
|
);
|
|
2194
2200
|
return L(
|
|
2195
|
-
|
|
2196
|
-
|
|
2201
|
+
Pe(
|
|
2202
|
+
e,
|
|
2197
2203
|
(h) => d(h)(r(h)),
|
|
2198
2204
|
n
|
|
2199
2205
|
),
|
|
2200
2206
|
x
|
|
2201
2207
|
);
|
|
2202
|
-
}, Ln = (
|
|
2208
|
+
}, Ln = (t, ...e) => {
|
|
2203
2209
|
const {
|
|
2204
2210
|
controller: r,
|
|
2205
2211
|
element: n,
|
|
@@ -2213,8 +2219,8 @@ const Oe = (e, t) => {
|
|
|
2213
2219
|
removeDisabled: f,
|
|
2214
2220
|
addDisabled: v,
|
|
2215
2221
|
...d
|
|
2216
|
-
} =
|
|
2217
|
-
return
|
|
2222
|
+
} = t;
|
|
2223
|
+
return Ht(
|
|
2218
2224
|
{
|
|
2219
2225
|
...d,
|
|
2220
2226
|
content: sn({
|
|
@@ -2231,31 +2237,31 @@ const Oe = (e, t) => {
|
|
|
2231
2237
|
addDisabled: v
|
|
2232
2238
|
})
|
|
2233
2239
|
},
|
|
2234
|
-
...
|
|
2240
|
+
...e
|
|
2235
2241
|
);
|
|
2236
2242
|
};
|
|
2237
|
-
class Vn extends
|
|
2243
|
+
class Vn extends bt {
|
|
2238
2244
|
branches;
|
|
2239
2245
|
activeBranch;
|
|
2240
|
-
#
|
|
2241
|
-
#
|
|
2242
|
-
constructor(
|
|
2243
|
-
super(
|
|
2246
|
+
#e;
|
|
2247
|
+
#t = /* @__PURE__ */ new Map();
|
|
2248
|
+
constructor(e, r, n, s, o, l, i = lt) {
|
|
2249
|
+
super(e, r, n, s, o, i), this.branches = l;
|
|
2244
2250
|
const c = (m) => {
|
|
2245
2251
|
for (const f of l)
|
|
2246
2252
|
if (f.detect(m))
|
|
2247
2253
|
return f.key;
|
|
2248
2254
|
return l[0]?.key ?? "unknown";
|
|
2249
2255
|
};
|
|
2250
|
-
this.activeBranch = n.map(c,
|
|
2256
|
+
this.activeBranch = n.map(c, lt);
|
|
2251
2257
|
const p = (m) => {
|
|
2252
|
-
if (this.#
|
|
2253
|
-
return this.#
|
|
2258
|
+
if (this.#t.has(m))
|
|
2259
|
+
return this.#t.get(m);
|
|
2254
2260
|
const f = l.find((d) => d.key === m);
|
|
2255
2261
|
if (!f)
|
|
2256
2262
|
throw new Error(`Unknown branch: ${m}`);
|
|
2257
|
-
const v = new
|
|
2258
|
-
[...
|
|
2263
|
+
const v = new bt(
|
|
2264
|
+
[...e, m],
|
|
2259
2265
|
(d) => {
|
|
2260
2266
|
this.change(d);
|
|
2261
2267
|
},
|
|
@@ -2263,64 +2269,64 @@ class Vn extends be {
|
|
|
2263
2269
|
(d) => f.detect(d) ? d : f.defaultValue(),
|
|
2264
2270
|
i
|
|
2265
2271
|
),
|
|
2266
|
-
s.map(
|
|
2272
|
+
s.map(Vt([m])),
|
|
2267
2273
|
{
|
|
2268
2274
|
disabled: this.disabled,
|
|
2269
2275
|
validationMode: this.parent.validationMode
|
|
2270
2276
|
},
|
|
2271
2277
|
i
|
|
2272
2278
|
);
|
|
2273
|
-
return this.#
|
|
2279
|
+
return this.#t.set(m, v), v;
|
|
2274
2280
|
};
|
|
2275
|
-
this.#
|
|
2281
|
+
this.#e = this.activeBranch.map(
|
|
2276
2282
|
(m) => p(m),
|
|
2277
|
-
|
|
2283
|
+
lt
|
|
2278
2284
|
), this.onDispose(() => {
|
|
2279
|
-
for (const m of this.#
|
|
2285
|
+
for (const m of this.#t.values())
|
|
2280
2286
|
m.dispose();
|
|
2281
|
-
this.#
|
|
2287
|
+
this.#t.clear(), this.activeBranch.dispose(), this.#e.dispose();
|
|
2282
2288
|
});
|
|
2283
2289
|
}
|
|
2284
2290
|
/**
|
|
2285
2291
|
* Get the controller for the currently active branch
|
|
2286
2292
|
*/
|
|
2287
2293
|
get activeController() {
|
|
2288
|
-
return u.get(this.#
|
|
2294
|
+
return u.get(this.#e);
|
|
2289
2295
|
}
|
|
2290
2296
|
/**
|
|
2291
2297
|
* Get a controller for a specific branch
|
|
2292
2298
|
*/
|
|
2293
|
-
getBranchController(
|
|
2294
|
-
const r = this.branches.find((s) => s.key ===
|
|
2299
|
+
getBranchController(e) {
|
|
2300
|
+
const r = this.branches.find((s) => s.key === e);
|
|
2295
2301
|
if (!r)
|
|
2296
|
-
throw new Error(`Unknown branch: ${
|
|
2297
|
-
if (this.#
|
|
2298
|
-
return this.#
|
|
2299
|
-
const n = new
|
|
2300
|
-
[...this.path,
|
|
2302
|
+
throw new Error(`Unknown branch: ${e}`);
|
|
2303
|
+
if (this.#t.has(e))
|
|
2304
|
+
return this.#t.get(e);
|
|
2305
|
+
const n = new bt(
|
|
2306
|
+
[...this.path, e],
|
|
2301
2307
|
(s) => {
|
|
2302
2308
|
this.change(s);
|
|
2303
2309
|
},
|
|
2304
2310
|
this.value.map(
|
|
2305
2311
|
(s) => r.detect(s) ? s : r.defaultValue(),
|
|
2306
|
-
|
|
2312
|
+
lt
|
|
2307
2313
|
),
|
|
2308
|
-
this.status.map(
|
|
2314
|
+
this.status.map(Vt([e])),
|
|
2309
2315
|
{
|
|
2310
2316
|
disabled: this.disabled,
|
|
2311
2317
|
validationMode: this.parent.validationMode
|
|
2312
2318
|
},
|
|
2313
|
-
|
|
2319
|
+
lt
|
|
2314
2320
|
);
|
|
2315
|
-
return this.#
|
|
2321
|
+
return this.#t.set(e, n), n;
|
|
2316
2322
|
}
|
|
2317
2323
|
/**
|
|
2318
2324
|
* Switch to a different branch
|
|
2319
2325
|
*/
|
|
2320
|
-
switchToBranch(
|
|
2321
|
-
const n = this.branches.find((l) => l.key ===
|
|
2326
|
+
switchToBranch(e, r = !1) {
|
|
2327
|
+
const n = this.branches.find((l) => l.key === e);
|
|
2322
2328
|
if (!n)
|
|
2323
|
-
throw new Error(`Unknown branch: ${
|
|
2329
|
+
throw new Error(`Unknown branch: ${e}`);
|
|
2324
2330
|
const s = u.get(this.value);
|
|
2325
2331
|
if (n.detect(s))
|
|
2326
2332
|
return !0;
|
|
@@ -2340,26 +2346,26 @@ class Vn extends be {
|
|
|
2340
2346
|
* Get the current active branch definition
|
|
2341
2347
|
*/
|
|
2342
2348
|
get activeBranchDefinition() {
|
|
2343
|
-
const
|
|
2344
|
-
return this.branches.find((r) => r.key ===
|
|
2349
|
+
const e = u.get(this.activeBranch);
|
|
2350
|
+
return this.branches.find((r) => r.key === e);
|
|
2345
2351
|
}
|
|
2346
2352
|
}
|
|
2347
|
-
function En(
|
|
2348
|
-
return
|
|
2349
|
-
(
|
|
2350
|
-
(
|
|
2353
|
+
function En(t) {
|
|
2354
|
+
return t.transform(
|
|
2355
|
+
(e) => e ?? null,
|
|
2356
|
+
(e) => e ?? void 0
|
|
2351
2357
|
);
|
|
2352
2358
|
}
|
|
2353
|
-
function Un(
|
|
2354
|
-
return
|
|
2355
|
-
(
|
|
2356
|
-
(
|
|
2359
|
+
function Un(t) {
|
|
2360
|
+
return t.transform(
|
|
2361
|
+
(e) => e ?? "",
|
|
2362
|
+
(e) => e === "" ? void 0 : e
|
|
2357
2363
|
);
|
|
2358
2364
|
}
|
|
2359
|
-
function Nn(
|
|
2360
|
-
return
|
|
2361
|
-
(
|
|
2362
|
-
(
|
|
2365
|
+
function Nn(t) {
|
|
2366
|
+
return t.transform(
|
|
2367
|
+
(e) => e ?? void 0,
|
|
2368
|
+
(e) => e ?? null
|
|
2363
2369
|
);
|
|
2364
2370
|
}
|
|
2365
2371
|
export {
|
|
@@ -2367,51 +2373,51 @@ export {
|
|
|
2367
2373
|
sn as B,
|
|
2368
2374
|
mn as C,
|
|
2369
2375
|
Tn as D,
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2376
|
+
Ue as E,
|
|
2377
|
+
$e as F,
|
|
2378
|
+
pt as G,
|
|
2373
2379
|
An as H,
|
|
2374
2380
|
Fn as I,
|
|
2375
2381
|
nn as J,
|
|
2376
2382
|
Bn as K,
|
|
2377
2383
|
Ln as L,
|
|
2378
|
-
|
|
2379
|
-
|
|
2384
|
+
Xt as M,
|
|
2385
|
+
Re as N,
|
|
2380
2386
|
gn as O,
|
|
2381
2387
|
hn as P,
|
|
2382
|
-
|
|
2383
|
-
|
|
2388
|
+
Ne as Q,
|
|
2389
|
+
Qe as R,
|
|
2384
2390
|
dn as S,
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2391
|
+
Ye as T,
|
|
2392
|
+
Et as U,
|
|
2393
|
+
Mt as V,
|
|
2394
|
+
Je as W,
|
|
2389
2395
|
un as X,
|
|
2390
2396
|
pn as _,
|
|
2391
2397
|
Y as a,
|
|
2392
2398
|
Vn as b,
|
|
2393
2399
|
Un as c,
|
|
2394
|
-
|
|
2400
|
+
en as d,
|
|
2395
2401
|
Z as e,
|
|
2396
2402
|
Nn as f,
|
|
2397
2403
|
fn as g,
|
|
2398
|
-
|
|
2399
|
-
|
|
2404
|
+
ke as h,
|
|
2405
|
+
De as i,
|
|
2400
2406
|
bn as j,
|
|
2401
|
-
|
|
2402
|
-
|
|
2407
|
+
Pe as k,
|
|
2408
|
+
Oe as l,
|
|
2403
2409
|
vn as m,
|
|
2404
|
-
|
|
2410
|
+
nt as n,
|
|
2405
2411
|
xn as o,
|
|
2406
2412
|
wn as p,
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2413
|
+
yn as q,
|
|
2414
|
+
$n as r,
|
|
2415
|
+
kn as s,
|
|
2410
2416
|
En as t,
|
|
2411
2417
|
_n as u,
|
|
2412
2418
|
In as v,
|
|
2413
2419
|
Cn as w,
|
|
2414
2420
|
Mn as x,
|
|
2415
|
-
|
|
2421
|
+
Xe as y,
|
|
2416
2422
|
Dn as z
|
|
2417
2423
|
};
|