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