@tempots/beatui 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-MMhfmLBu.cjs → auth-divider-3t_-R0sL.cjs} +1 -1
- package/dist/{auth-divider-CbME_yVQ.js → auth-divider-Cp3xGpHr.js} +2 -2
- package/dist/beatui.css +32 -7
- package/dist/beatui.tailwind.css +32 -7
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +3 -3
- package/dist/{deep-merge-EkjEgK0N.cjs → deep-merge-Bz9HHpRt.cjs} +1 -1
- package/dist/{deep-merge-BzIheQtH.js → deep-merge-Da602mAN.js} +1 -1
- package/dist/{duration-input-DGzmIImj.js → duration-input-HM1i6RRY.js} +2 -2
- package/dist/{duration-input-ClgYjeBa.cjs → duration-input-g-cQ3cs1.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +5397 -5251
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +5 -5
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +3 -3
- package/dist/notice-BNghd0oS.cjs +1 -0
- package/dist/notice-Dtz7ADVH.js +211 -0
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/text-input-DL9FvpTZ.cjs +1 -0
- package/dist/text-input-dDUEUmlC.js +57 -0
- package/dist/types/components/data/data-table-context.d.ts +4 -3
- package/dist/types/components/data/data-table-types.d.ts +31 -17
- package/dist/types/components/data/data-table.d.ts +3 -3
- package/dist/types/components/data/sortable-header.d.ts +4 -2
- package/dist/types/components/form/input/color-input.d.ts +3 -1
- package/dist/types/components/form/input/input-options.d.ts +3 -1
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +1 -0
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +1 -0
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +1 -0
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-date-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-date-time-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-time-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-year-month-input.d.ts +1 -0
- package/dist/types/components/form/input/slider-input.d.ts +24 -6
- package/dist/types/components/form/input/switch.d.ts +3 -1
- package/dist/types/components/overlay/dialogs.d.ts +10 -2
- package/dist/widget-customization-DOWmUuPU.cjs +1 -0
- package/dist/{widget-customization-DEiQ_31d.js → widget-customization-YhVcA-KM.js} +210 -207
- package/package.json +1 -1
- package/dist/notice-B5wTXoTq.cjs +0 -1
- package/dist/notice-BKcyJD5w.js +0 -209
- package/dist/text-input-DfqXolVe.js +0 -55
- package/dist/text-input-X_q01NsY.cjs +0 -1
- package/dist/widget-customization-B49MeU4E.cjs +0 -1
package/package.json
CHANGED
package/dist/notice-B5wTXoTq.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const v=require("./text-input-X_q01NsY.cjs"),t=require("@tempots/dom"),V=require("./input-container-Di1YvVB_.cjs"),f=require("./translations-Dbx7L7Q1.cjs"),_=require("./use-form-CaW192gw.cjs"),O=n=>{const l={name:"email",autocomplete:"email",...n},{value:r,before:s,onBlur:o,onChange:p,onInput:c,placeholder:h}=l,m=s??V.InputIcon({icon:"line-md:email",size:n.size,color:"neutral"});return t.Use(f.BeatUII18n,d=>V.InputContainer({...n,before:m,input:t.input.email(v.CommonInputAttributes(l),t.attr.placeholder(t.coalesce(h,d.$.emailPlaceholderText)),t.attr.value(r),t.attr.class("bc-input"),o!=null?t.on.blur(t.emitValue(o)):t.Empty,p!=null?t.on.change(t.emitValue(p)):t.Empty,c!=null?t.on.input(t.emitValue(c)):t.Empty)}))},B=n=>{const{value:l,onBlur:r,onChange:s,onInput:o,before:p,after:c,hasError:h,disabled:m,autocomplete:d,placeholder:g,...b}=n,y={name:"password",disabled:m,...b},i=t.prop(!0),a=t.computedOf(i,d)((e,u)=>e?u??"current-password":"off");return t.Use(f.BeatUII18n,e=>{const u=t.computedOf(e.$.passwordPlaceholderText,i,g)((I,C,E)=>C?"•••••••••••••••":E??I),w=t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__password-toggle"),t.aria.label(e.$.togglePasswordVisibility),t.on.click(()=>i.update(I=>!I)),t.When(i,()=>f.Icon({icon:"line-md:watch"}),()=>f.Icon({icon:"line-md:watch-off"})));return V.InputContainer({before:p,disabled:m,hasError:h,input:t.html.input(v.CommonInputAttributes({...y,autocomplete:a,placeholder:u}),t.When(i,()=>t.attr.type("password"),()=>t.attr.type("text")),t.attr.class("bc-input"),t.attr.value(l),r!=null?t.on.blur(t.emitValue(r)):t.Empty,s!=null?t.on.change(t.emitValue(s)):t.Empty,o!=null?t.on.input(t.emitValue(o)):t.Empty),after:c!=null?t.Fragment(w,c):w})})};function U(n){switch(n){case"success":return"material-symbols:check-circle-outline";case"warning":return"material-symbols:warning-outline";case"danger":return"material-symbols:error-outline";default:return"material-symbols:info-outline"}}function P(n){switch(n){case"success":return"success";case"warning":return"warning";case"danger":return"danger";default:return"info"}}function T(n,l,r,s){const o=["bc-notice",`bc-notice--${n}`,`bc-notice--tone-${l}`];return r&&o.push("bc-notice--dismissible"),s&&s.length>0&&o.push(s),o.join(" ")}function $({variant:n="info",tone:l="subtle",role:r,title:s,icon:o,closable:p=!1,onClose:c,class:h},...m){const d=t.prop(!0);return t.When(d,()=>{const g=t.Value.map(p,a=>!!a||c!=null),b=t.Value.map(n,a=>a??"info"),y=t.Value.map(l,a=>a??"subtle"),i=t.computedOf(r,b)((a,e)=>a??(e==="danger"?"alert":"status"));return t.Use(f.BeatUII18n,a=>t.html.div(t.attr.class(t.computedOf(b,y,g,h)((e,u,w,I)=>T(e,u,w,I))),t.attr.role(t.Value.map(i,e=>e)),t.Unless(t.Value.map(o,e=>e===!1),()=>t.html.div(t.attr.class("bc-notice__icon"),f.Icon({icon:t.computedOf(o,b)((e,u)=>e===void 0?U(u):String(e)),size:"md",color:t.Value.map(b,P)}))),t.html.div(t.attr.class("bc-notice__body"),t.Ensure(s,e=>t.html.div(t.attr.class("bc-notice__title"),e)),t.html.div(t.attr.class("bc-notice__content"),...m)),t.When(g,()=>_.CloseButton({size:"xs",label:a.$.closeModal,onClick:()=>{d.set(!1),c?.()}}))))})}exports.EmailInput=O;exports.Notice=$;exports.PasswordInput=B;
|
package/dist/notice-BKcyJD5w.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { C as x } from "./text-input-DfqXolVe.js";
|
|
2
|
-
import { Use as E, input as U, attr as t, coalesce as j, Empty as w, on as m, emitValue as I, prop as z, computedOf as _, html as p, aria as A, When as P, Fragment as D, Value as g, Unless as F, Ensure as M } from "@tempots/dom";
|
|
3
|
-
import { a as R, I as O } from "./input-container-BvEcp7FU.js";
|
|
4
|
-
import { B as V, I as $ } from "./translations-B1_yyDUK.js";
|
|
5
|
-
import { C as S } from "./use-form-Dn6v2tEh.js";
|
|
6
|
-
const X = (n) => {
|
|
7
|
-
const l = {
|
|
8
|
-
name: "email",
|
|
9
|
-
autocomplete: "email",
|
|
10
|
-
...n
|
|
11
|
-
}, {
|
|
12
|
-
value: r,
|
|
13
|
-
before: a,
|
|
14
|
-
onBlur: o,
|
|
15
|
-
onChange: d,
|
|
16
|
-
onInput: c,
|
|
17
|
-
placeholder: v
|
|
18
|
-
} = l, b = a ?? R({
|
|
19
|
-
icon: "line-md:email",
|
|
20
|
-
size: n.size,
|
|
21
|
-
color: "neutral"
|
|
22
|
-
});
|
|
23
|
-
return E(
|
|
24
|
-
V,
|
|
25
|
-
(f) => O({
|
|
26
|
-
...n,
|
|
27
|
-
before: b,
|
|
28
|
-
input: U.email(
|
|
29
|
-
x(l),
|
|
30
|
-
t.placeholder(j(v, f.$.emailPlaceholderText)),
|
|
31
|
-
t.value(r),
|
|
32
|
-
t.class("bc-input"),
|
|
33
|
-
o != null ? m.blur(I(o)) : w,
|
|
34
|
-
d != null ? m.change(I(d)) : w,
|
|
35
|
-
c != null ? m.input(I(c)) : w
|
|
36
|
-
)
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
}, Y = (n) => {
|
|
40
|
-
const {
|
|
41
|
-
value: l,
|
|
42
|
-
onBlur: r,
|
|
43
|
-
onChange: a,
|
|
44
|
-
onInput: o,
|
|
45
|
-
before: d,
|
|
46
|
-
after: c,
|
|
47
|
-
hasError: v,
|
|
48
|
-
disabled: b,
|
|
49
|
-
autocomplete: f,
|
|
50
|
-
placeholder: C,
|
|
51
|
-
...h
|
|
52
|
-
} = n, T = {
|
|
53
|
-
name: "password",
|
|
54
|
-
disabled: b,
|
|
55
|
-
...h
|
|
56
|
-
}, i = z(!0), s = _(
|
|
57
|
-
i,
|
|
58
|
-
f
|
|
59
|
-
)((e, u) => e ? u ?? "current-password" : "off");
|
|
60
|
-
return E(V, (e) => {
|
|
61
|
-
const u = _(
|
|
62
|
-
e.$.passwordPlaceholderText,
|
|
63
|
-
i,
|
|
64
|
-
C
|
|
65
|
-
)((y, k, N) => k ? "•••••••••••••••" : N ?? y), B = p.button(
|
|
66
|
-
t.type("button"),
|
|
67
|
-
t.class("bc-input-container__password-toggle"),
|
|
68
|
-
A.label(e.$.togglePasswordVisibility),
|
|
69
|
-
m.click(() => i.update((y) => !y)),
|
|
70
|
-
P(
|
|
71
|
-
i,
|
|
72
|
-
() => $({ icon: "line-md:watch" }),
|
|
73
|
-
() => $({ icon: "line-md:watch-off" })
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
return O({
|
|
77
|
-
before: d,
|
|
78
|
-
disabled: b,
|
|
79
|
-
hasError: v,
|
|
80
|
-
input: p.input(
|
|
81
|
-
x({
|
|
82
|
-
...T,
|
|
83
|
-
autocomplete: s,
|
|
84
|
-
placeholder: u
|
|
85
|
-
}),
|
|
86
|
-
P(
|
|
87
|
-
i,
|
|
88
|
-
() => t.type("password"),
|
|
89
|
-
() => t.type("text")
|
|
90
|
-
),
|
|
91
|
-
t.class("bc-input"),
|
|
92
|
-
t.value(l),
|
|
93
|
-
r != null ? m.blur(I(r)) : w,
|
|
94
|
-
a != null ? m.change(I(a)) : w,
|
|
95
|
-
o != null ? m.input(I(o)) : w
|
|
96
|
-
),
|
|
97
|
-
after: c != null ? D(B, c) : B
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
function W(n) {
|
|
102
|
-
switch (n) {
|
|
103
|
-
case "success":
|
|
104
|
-
return "material-symbols:check-circle-outline";
|
|
105
|
-
case "warning":
|
|
106
|
-
return "material-symbols:warning-outline";
|
|
107
|
-
case "danger":
|
|
108
|
-
return "material-symbols:error-outline";
|
|
109
|
-
default:
|
|
110
|
-
return "material-symbols:info-outline";
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function q(n) {
|
|
114
|
-
switch (n) {
|
|
115
|
-
case "success":
|
|
116
|
-
return "success";
|
|
117
|
-
case "warning":
|
|
118
|
-
return "warning";
|
|
119
|
-
case "danger":
|
|
120
|
-
return "danger";
|
|
121
|
-
default:
|
|
122
|
-
return "info";
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function G(n, l, r, a) {
|
|
126
|
-
const o = [
|
|
127
|
-
"bc-notice",
|
|
128
|
-
`bc-notice--${n}`,
|
|
129
|
-
`bc-notice--tone-${l}`
|
|
130
|
-
];
|
|
131
|
-
return r && o.push("bc-notice--dismissible"), a && a.length > 0 && o.push(a), o.join(" ");
|
|
132
|
-
}
|
|
133
|
-
function Z({
|
|
134
|
-
variant: n = "info",
|
|
135
|
-
tone: l = "subtle",
|
|
136
|
-
role: r,
|
|
137
|
-
title: a,
|
|
138
|
-
icon: o,
|
|
139
|
-
closable: d = !1,
|
|
140
|
-
onClose: c,
|
|
141
|
-
class: v
|
|
142
|
-
}, ...b) {
|
|
143
|
-
const f = z(!0);
|
|
144
|
-
return P(f, () => {
|
|
145
|
-
const C = g.map(
|
|
146
|
-
d,
|
|
147
|
-
(s) => !!s || c != null
|
|
148
|
-
), h = g.map(n, (s) => s ?? "info"), T = g.map(l, (s) => s ?? "subtle"), i = _(
|
|
149
|
-
r,
|
|
150
|
-
h
|
|
151
|
-
)(
|
|
152
|
-
(s, e) => s ?? (e === "danger" ? "alert" : "status")
|
|
153
|
-
);
|
|
154
|
-
return E(
|
|
155
|
-
V,
|
|
156
|
-
(s) => p.div(
|
|
157
|
-
t.class(
|
|
158
|
-
_(
|
|
159
|
-
h,
|
|
160
|
-
T,
|
|
161
|
-
C,
|
|
162
|
-
v
|
|
163
|
-
)((e, u, B, y) => G(e, u, B, y))
|
|
164
|
-
),
|
|
165
|
-
// Accessibility role mapping (always defined)
|
|
166
|
-
t.role(g.map(i, (e) => e)),
|
|
167
|
-
F(
|
|
168
|
-
g.map(o, (e) => e === !1),
|
|
169
|
-
() => p.div(
|
|
170
|
-
t.class("bc-notice__icon"),
|
|
171
|
-
$({
|
|
172
|
-
icon: _(
|
|
173
|
-
o,
|
|
174
|
-
h
|
|
175
|
-
)(
|
|
176
|
-
(e, u) => e === void 0 ? W(u) : String(e)
|
|
177
|
-
),
|
|
178
|
-
size: "md",
|
|
179
|
-
color: g.map(h, q)
|
|
180
|
-
})
|
|
181
|
-
)
|
|
182
|
-
),
|
|
183
|
-
p.div(
|
|
184
|
-
t.class("bc-notice__body"),
|
|
185
|
-
M(
|
|
186
|
-
a,
|
|
187
|
-
(e) => p.div(t.class("bc-notice__title"), e)
|
|
188
|
-
),
|
|
189
|
-
p.div(t.class("bc-notice__content"), ...b)
|
|
190
|
-
),
|
|
191
|
-
P(
|
|
192
|
-
C,
|
|
193
|
-
() => S({
|
|
194
|
-
size: "xs",
|
|
195
|
-
label: s.$.closeModal,
|
|
196
|
-
onClick: () => {
|
|
197
|
-
f.set(!1), c?.();
|
|
198
|
-
}
|
|
199
|
-
})
|
|
200
|
-
)
|
|
201
|
-
)
|
|
202
|
-
);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
export {
|
|
206
|
-
X as E,
|
|
207
|
-
Z as N,
|
|
208
|
-
Y as P
|
|
209
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Fragment as v, attr as n, aria as d, Value as C, html as b, Empty as r, on as m, emitValue as s } from "@tempots/dom";
|
|
2
|
-
import { I as f } from "./input-container-BvEcp7FU.js";
|
|
3
|
-
function y(t, o, u) {
|
|
4
|
-
const { value: l, onChange: e, onInput: a, ...i } = t;
|
|
5
|
-
return {
|
|
6
|
-
...i,
|
|
7
|
-
value: C.map(l, o),
|
|
8
|
-
onChange: e != null ? (p) => e(u(p)) : void 0,
|
|
9
|
-
onInput: a != null ? (p) => a(u(p)) : void 0
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
const g = ({
|
|
13
|
-
autocomplete: t,
|
|
14
|
-
autofocus: o,
|
|
15
|
-
classes: u,
|
|
16
|
-
disabled: l,
|
|
17
|
-
name: e,
|
|
18
|
-
placeholder: a,
|
|
19
|
-
id: i,
|
|
20
|
-
required: p,
|
|
21
|
-
tabIndex: I,
|
|
22
|
-
hasError: c
|
|
23
|
-
}) => v(
|
|
24
|
-
n.autocomplete(t),
|
|
25
|
-
n.autofocus(o),
|
|
26
|
-
n.class(u?.input),
|
|
27
|
-
n.disabled(l),
|
|
28
|
-
n.name(e ?? i),
|
|
29
|
-
n.placeholder(a),
|
|
30
|
-
n.id(i),
|
|
31
|
-
d.required(p),
|
|
32
|
-
n.tabindex(I),
|
|
33
|
-
c != null ? d.invalid(
|
|
34
|
-
c ?? !1
|
|
35
|
-
) : null
|
|
36
|
-
), T = (t) => {
|
|
37
|
-
const { value: o, onBlur: u, onChange: l, onInput: e, type: a } = t;
|
|
38
|
-
return f({
|
|
39
|
-
...t,
|
|
40
|
-
input: b.input(
|
|
41
|
-
n.type(a ?? "text"),
|
|
42
|
-
g(t),
|
|
43
|
-
n.value(o),
|
|
44
|
-
n.class("bc-input"),
|
|
45
|
-
u != null ? m.blur(s(u)) : r,
|
|
46
|
-
l != null ? m.change(s(l)) : r,
|
|
47
|
-
e != null ? m.input(s(e)) : r
|
|
48
|
-
)
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
g as C,
|
|
53
|
-
T,
|
|
54
|
-
y as m
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),c=require("./input-container-Di1YvVB_.cjs");function I(n,r,u){const{value:a,onChange:e,onInput:l,...i}=n;return{...i,value:t.Value.map(a,r),onChange:e!=null?o=>e(u(o)):void 0,onInput:l!=null?o=>l(u(o)):void 0}}const m=({autocomplete:n,autofocus:r,classes:u,disabled:a,name:e,placeholder:l,id:i,required:o,tabIndex:s,hasError:p})=>t.Fragment(t.attr.autocomplete(n),t.attr.autofocus(r),t.attr.class(u?.input),t.attr.disabled(a),t.attr.name(e??i),t.attr.placeholder(l),t.attr.id(i),t.aria.required(o),t.attr.tabindex(s),p!=null?t.aria.invalid(p??!1):null),d=n=>{const{value:r,onBlur:u,onChange:a,onInput:e,type:l}=n;return c.InputContainer({...n,input:t.html.input(t.attr.type(l??"text"),m(n),t.attr.value(r),t.attr.class("bc-input"),u!=null?t.on.blur(t.emitValue(u)):t.Empty,a!=null?t.on.change(t.emitValue(a)):t.Empty,e!=null?t.on.input(t.emitValue(e)):t.Empty)})};exports.CommonInputAttributes=m;exports.TextInput=d;exports.mapInputOptions=I;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),k=require("./deep-merge-EkjEgK0N.cjs"),mt=require("@tempots/std"),B=require("./input-container-Di1YvVB_.cjs"),N=require("./text-input-X_q01NsY.cjs"),v=require("./translations-Dbx7L7Q1.cjs"),ft=require("@tempots/ui"),Q=require("./notice-B5wTXoTq.cjs"),bt=require("./session-id-B5lJMzbB.cjs"),yt=require("./utils-DmEuG3Np.cjs");function X(e){if(typeof e!="string")return!1;const n=e.startsWith("#")?e.slice(1):e;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function Z(e){if(typeof e!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=255&&i>=0&&i<=255&&c>=0&&c<=255}function J(e){if(typeof e!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r,l]=s,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(r,10),p=parseFloat(l);return i>=0&&i<=255&&c>=0&&c<=255&&u>=0&&u<=255&&p>=0&&p<=1}function tt(e){if(typeof e!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=360&&i>=0&&i<=100&&c>=0&&c<=100}function wt(e){return X(e)||Z(e)||J(e)||tt(e)}function et(e){if(!X(e))return null;let n=e.startsWith("#")?e.slice(1):e;return n.length===3&&(n=n.split("").map(s=>s+s).join("")),`#${n.toLowerCase()}`}function U(e,n,s){const a=o=>{const r=Math.round(Math.max(0,Math.min(255,o))).toString(16);return r.length===1?"0"+r:r};return`#${a(e)}${a(n)}${a(s)}`}function D(e){const n=et(e);if(!n)return null;const s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:null}function It(e,n){const s=D(e),a=D(n);if(!s||!a)return null;const o=(u,p,d)=>{const[y,g,h]=[u,p,d].map(w=>(w=w/255,w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4)));return .2126*y+.7152*g+.0722*h},r=o(s.r,s.g,s.b),l=o(a.r,a.g,a.b),i=Math.max(r,l),c=Math.min(r,l);return(i+.05)/(c+.05)}function nt(e){if(!e)return[0,0,0,1];const s=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(s){const u=s[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),d=parseInt(u.slice(2,4),16),y=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,d,y,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),y=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,d,y,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),y=parseInt(u[2]+u[2],16);return[p,d,y,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const o=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const r=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(r){const u=parseFloat(r[1]),p=parseFloat(r[2]),d=parseFloat(r[3]),y=r[4]!=null?parseFloat(r[4]):1,[g,h,w]=Y(u,p/100,d/100);return[g,h,w,y]}const l=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,d=parseFloat(l[3])/100,y=l[4]!=null?parseFloat(l[4]):1,[g,h,w]=st(u,p,d);return[g,h,w,y]}const i=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(i){const u=i[1],p=parseFloat(i[2]),d=parseFloat(i[3]),y=i[4]!=null?parseFloat(i[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[h,w,x]=lt(g,p,d);return[h,w,x,y]}const c=D(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function at(e,n,s,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(s)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`}function rt(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function Y(e,n,s){e=(e%360+360)%360;const a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(e/60%2-1)),r=s-a/2;let l,i,c;return 0<=e&&e<60?[l,i,c]=[a,o,0]:60<=e&&e<120?[l,i,c]=[o,a,0]:120<=e&&e<180?[l,i,c]=[0,a,o]:180<=e&&e<240?[l,i,c]=[0,o,a]:240<=e&&e<300?[l,i,c]=[o,0,a]:[l,i,c]=[a,0,o],[Math.round((l+r)*255),Math.round((i+r)*255),Math.round((c+r)*255)]}function st(e,n,s){e=(e%360+360)%360;const a=n+s;a>1&&(n/=a,s/=a);const[o,r,l]=Y(e,1,.5).map(d=>d/255),i=1-n-s,c=o*i+n,u=r*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function q(e,n,s){e/=255,n/=255,s/=255;const a=Math.max(e,n,s),o=Math.min(e,n,s);let r=0,l=0;const i=(a+o)/2,c=a-o;if(c!==0){switch(l=i>.5?c/(2-a-o):c/(a+o),a){case e:r=(n-s)/c+(n<s?6:0);break;case n:r=(s-e)/c+2;break;default:r=(e-n)/c+4}r*=60}return[Math.round(r),Math.round(l*100),Math.round(i*100)]}function ot(e,n,s){const[a]=q(e,n,s),o=e/255,r=n/255,l=s/255,i=Math.min(o,r,l),c=1-Math.max(o,r,l);return[a,Math.round(i*100),Math.round(c*100)]}function L(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function P(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function lt(e,n,s){const a=s*Math.PI/180,o=Math.cos(a)*n,r=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*r,i=e-.1055613458*o-.0638541728*r,c=e-.0894841775*o-1.291485548*r,u=l*l*l,p=i*i*i,d=c*c*c,y=4.0767416621*u-3.3077115913*p+.2309699292*d,g=-1.2684380046*u+2.6097574011*p-.3413193965*d,h=-.0041960863*u-.7034186147*p+1.707614701*d;return[P(y),P(g),P(h)]}function it(e,n,s){const a=L(e),o=L(n),r=L(s),l=.4122214708*a+.5363325363*o+.0514459929*r,i=.2119034982*a+.6806995451*o+.1073969566*r,c=.0883024619*a+.2817188376*o+.6299787005*r,u=Math.cbrt(l),p=Math.cbrt(i),d=Math.cbrt(c),y=.2104542553*u+.793617785*p-.0040720468*d,g=1.9779984951*u-2.428592205*p+.4505937099*d,h=.0259040371*u+.7827717662*p-.808675766*d,w=Math.sqrt(g*g+h*h);let x=Math.atan2(h,g)*180/Math.PI;return x<0&&(x+=360),[y,w,x]}function R(e,n,s,a,o,r){switch(o){case"hex":if(r){const l=c=>c.toString(16).padStart(2,"0"),i=Math.max(0,Math.min(255,Math.round(a*255)));return`#${l(e)}${l(n)}${l(s)}${l(i)}`}return U(e,n,s);case"rgb":return`rgb(${e}, ${n}, ${s})`;case"rgba":return`rgba(${e}, ${n}, ${s}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=q(e,n,s);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=q(e,n,s);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=ot(e,n,s);return a<1?`hwb(${l} ${i}% ${c}% / ${Math.round(a*100)/100})`:`hwb(${l} ${i}% ${c}%)`}case"oklch":{const[l,i,c]=it(e,n,s),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(i*1e3)/1e3).toFixed(3),d=(Math.round(c*10)/10).toFixed(1),y=Math.round(a*100)/100;return r||a<1?`oklch(${u} ${p} ${d} / ${y})`:`oklch(${u} ${p} ${d})`}}}function E(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}async function ct(e){return new Promise((n,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>s(o)})}function Vt(e){return Promise.all(e.map(ct))}function xt(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function Mt(e){const n=mt.decodeBase64(e??""),s=n.length,a=new Uint8Array(s);for(let o=0;o<s;o++)a[o]=n.charCodeAt(o);return a}function ut(e){const{value:n,onChange:s,onInput:a,...o}=e,r=new Map,l=t.Value.toSignal(n).map(p=>p.map((d,y)=>{const g=r.get(d),h=Mt(d??""),w=g?.type||xt(h),x=g?.name??`file-${y}`,b=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),M=new Blob([b],{type:w});return new File([M],x,{type:w})})),i=p=>d=>{p&&Vt(d).then(y=>{for(const[g,h]of y.entries())r.set(h,{name:d[g].name,type:d[g].type});p(y)})},c=i(s),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function $t(e){const{value:n,onInput:s,onChange:a,...o}=e;return ut({...o,maxFiles:1,value:t.Value.map(n,r=>r==null?[]:[r]),onChange:r=>{a?.(r[0])},onInput:r=>{s?.(r[0])}})}function _t(e,n){const[s,a,o]=e,r=s<<16^a<<8^o,l=rt(r),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let g=0;g<i;g++){const h=g/i*Math.PI*2,w=n*(1+(l()*2-1)*c),x=Math.cos(h)*w,b=Math.sin(h)*w;u.push({x,y:b})}const p=(u[0].x+u[i-1].x)/2,d=(u[0].y+u[i-1].y)/2;let y=`M ${p.toFixed(3)} ${d.toFixed(3)}`;for(let g=0;g<i;g++){const h=u[g],w=u[(g+1)%i],x=(h.x+w.x)/2,b=(h.y+w.y)/2;y+=` Q ${h.x.toFixed(3)} ${h.y.toFixed(3)} ${x.toFixed(3)} ${b.toFixed(3)}`}return y+=" Z",y}const Ct=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,displayValue:r,swatchSize:l,withAlpha:i}=e,c={xs:20,sm:26,md:32,lg:40,xl:52},u=l!=null?t.Value.map(l,m=>Number(m)):t.Value.map(e.size??"md",m=>c[m]??32),p=t.Value.map(n,m=>nt(m??"#000000")),d=t.Value.map(p,([m,I,$])=>[m,I,$]),y=t.Value.map(p,([,,,m])=>m),g=t.prop(t.Value.get(y)??1),h=t.Value.map(i??!1,m=>m),w=t.Value.map(e.colorTextFormat??"rgb",m=>m),x=t.computedOf(d,g,w,h)(([m,I,$],T,A,F)=>R(m,I,$,T??1,E(A,F),F)),b=t.Value.map(e.colorTextFormat??"hex",m=>m),M=t.Value.map(u,m=>`${-m/2} ${-m/2} ${m} ${m}`),f=t.computedOf(d,u)((m,I)=>_t(m,I/2)),C=t.computedOf(d,g,h)(([m,I,$],T,A)=>A||T<1?at(m,I,$,T):U(m,I,$)),_=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(h,m=>m?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(u)(m=>`width:${m+2}px;height:${m+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(M),t.svg.path(t.svgAttr.d(f),t.svgAttr.fill(C))),t.html.input(t.attr.type("color"),N.CommonInputAttributes(e),t.attr.value(t.Value.map(d,([m,I,$])=>U(m,I,$))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),s!=null?t.on.blur(s):t.Empty,a!=null?t.on.change(m=>{const I=m.target.value;if(!a)return;const{r:$,g:T,b:A}=D(I)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(b),t.Value.get(h)),j=R($,T,A,F,S,t.Value.get(h));a(j)}):t.Empty,o!=null?t.on.input(m=>{const I=m.target.value;if(!o)return;const{r:$,g:T,b:A}=D(I)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(b),t.Value.get(h)),j=R($,T,A,F,S,t.Value.get(h));o(j)}):t.Empty)),V=t.When(h,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-swatch-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(g,m=>String(m??1))),t.attr.disabled(e.disabled),t.on.input(m=>{const I=parseFloat(m.target.value);g.set(I);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(b),t.Value.get(h)),S=R($,T,A,I,F,t.Value.get(h));o?.(S)}),t.on.change(m=>{const I=parseFloat(m.target.value);g.set(I);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(b),t.Value.get(h)),S=R($,T,A,I,F,t.Value.get(h));a?.(S)}))),{swatchSize:W,displayValue:G,withAlpha:z,colorTextFormat:K,...H}=e;return B.InputContainer({baseContainer:!0,...H,growInput:!1,input:_,after:t.Fragment(t.When(r??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),x)),V,e.after)})},pt=e=>typeof e=="string"&&e.trim()===""?null:e,dt=e=>e??"";function O(e){return n=>{const{after:s,disabled:a}=n,o=N.mapInputOptions(n,dt,pt),r=k.NullableResetAfter(n.value,a,n.onChange??n.onInput);return e({...o,after:s!=null?t.Fragment(r,s):r})}}const Tt=({startEditing:e,value:n,onChange:s,placeholder:a,disabled:o})=>{const r=t.Value.deriveProp(e??!1),l=t.prop(!1),i=t.Value.map(o??!1,c=>c);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(i,c=>c?"bc-editable-text--disabled":"")),t.aria.disabled(i),t.When(r,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),ft.AutoSelect(),t.on.keydown(c=>{c.key==="Enter"?r.set(!1):c.key==="Escape"&&(l.set(!0),r.set(!1))}),t.on.blur(t.emitValue(c=>{if(r.set(!1),l.value){l.set(!1);return}s(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||r.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,c=>c!=null&&c.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(i,c=>!c),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(v.BeatUII18n,c=>t.aria.label(c.$.editLabel)),t.on.click(()=>r.set(!0)),v.Icon({icon:"line-md/pencil",color:"neutral"}))))))},At=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input.date(N.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:r!=null?t.Fragment(i,r):i})},Ft=e=>{const n=e.getFullYear(),s=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),l=e.getSeconds();return`${n}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},kt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=t.Value.map(n,u=>u!=null?Ft(u):null),c=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input["datetime-local"](N.CommonInputAttributes(e),t.attr.value(t.Value.map(i,u=>u??null)),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:r!=null?t.Fragment(c,r):c})},Nt=O(Q.EmailInput),St=O(N.TextInput),vt=O(Q.PasswordInput),Rt=O(k.TextArea),Et=({value:e,onChange:n,onInput:s,onBlur:a,offLabel:o,onLabel:r,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:d=!0})=>{const y=c??bt.sessionId("switch");function g(b,M){const f=["bc-switch",`bc-switch--size-${M}`,`bc-switch--${M}`];return d&&f.push("bc-switch--match-input"),b&&f.push("bc-switch--disabled"),f.join(" ")}function h(b){const M=b??"primary",f=new Map,C=v.backgroundValue(M,"solid","light"),_=v.backgroundValue(M,"solid","dark");return f.set("--switch-track-on-bg",C.backgroundColor),f.set("--switch-track-on-label",C.textColor),f.set("--switch-track-on-bg-dark",_.backgroundColor),f.set("--switch-track-on-label-dark",_.textColor),f.set("--switch-track-on-border-dark",v.borderColorValue(M,"dark")),Array.from(f.entries()).map(([V,W])=>`${V}: ${W}`).join("; ")}const w=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),s?.(!t.Value.get(e)))},x=b=>{t.Value.get(l)||(b.key===" "||b.key==="Enter")&&(b.preventDefault(),w())};return t.html.div(t.attr.class(t.computedOf(l??!1,i)((b,M)=>g(b??!1,M??"md"))),t.attr.style(t.computedOf(u)(b=>h(b))),t.attr.id(y),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((b,M)=>b?-1:M??0)),t.aria.checked(e),t.aria.disabled(l),t.on.click(w),t.on.keydown(x),a!=null?t.on.blur(a):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,b=>b?"bc-switch__track--on":"bc-switch__track--off")),o!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,b=>b?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,r!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,b=>b?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),r):null,t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,b=>b?"bc-switch__thumb--on":"bc-switch__thumb--off")))))},Dt=O(k.UuidInput),Bt="line-md:star-alt-filled",Ot="line-md:star-alt",ht=e=>{const{value:n,onChange:s,onInput:a,disabled:o,max:r=5,fullColor:l="yellow",emptyColor:i="neutral",activeIcon:c=Bt,inactiveIcon:u=Ot,size:p="md",onBlur:d,rounding:y=1}=e,g=()=>{const f=t.Value.get(y);return f>0?f:1},h=f=>Math.min(Math.max(f,0),t.Value.get(r)),w=(f,C)=>{if(t.Value.get(o??!1))return;const V=f.currentTarget.getBoundingClientRect(),W=(f.clientX-V.left)/V.width,G=C-1+W,z=g(),K=Math.ceil(G/z)*z,H=h(K);s?.(H),a?.(H)},x=f=>{if(t.Value.get(o??!1))return;const C=g(),_=t.Value.get(n)??0;let V;switch(f.key){case"ArrowRight":case"ArrowUp":V=h(_+C);break;case"ArrowLeft":case"ArrowDown":V=h(_-C);break;case"Home":V=0;break;case"End":V=t.Value.get(r);break;default:return}f.preventDefault(),s?.(V),a?.(V)},b=t.Value.map(p,f=>`bc-icon--${f}`),M=({index:f,counter:C})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(b),t.on.click(t.emit(_=>w(_,C),{preventDefault:!0,stopPropagation:!0})),v.Icon({icon:u,size:p,color:i,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(b),t.style.width(t.Value.map(n,_=>{const V=Math.floor(_);return V>f?"100%":V<f?"0%":`${(_-f)*100}%`})),v.Icon({icon:c,size:p,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))));return B.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(N.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(o??!1,f=>f?-1:0)),t.aria.disabled(o??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,f=>f??0)),t.aria.valuenow(t.Value.map(n,f=>f??0)),t.aria.valuetext(t.computedOf(n,r)((f,C)=>{const _=f??0,V=C??0;return`${String(_)} / ${String(V)}`})),t.on.keydown(x),d!=null?t.on.blur(d):null,t.Repeat(r,M))})},Wt=e=>{const{after:n,disabled:s}=e,a=N.mapInputOptions(e,r=>r??0,r=>r),o=k.NullableResetAfter(e.value,s,e.onChange??e.onInput);return ht({...a,after:n!=null?t.Fragment(o,n):o})},Ht=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e;return B.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(l)):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(i)):t.Empty)})},Lt=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e,c=t.Value.map(n,p=>{if(p!=null)return p;const d=a!=null?t.Value.get(a):void 0;return typeof d=="number"?d:0}),u=k.NullableResetAfter(n,e.disabled,l??i);return B.InputContainer({...e,focusableSelector:'input[type="range"]',after:u,input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(p=>{l(p)})):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(p=>{i(p)})):t.Empty)})},Pt=O(k.UrlInput);class gt{widgets=new Map;typeMapping=new Map;register(n,s){if(this.widgets.set(n,s),s.supportedTypes)for(const a of s.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,r)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(r)?.priority||0)-l})}unregister(n){const s=this.widgets.get(n);if(s&&(this.widgets.delete(n),s.supportedTypes))for(const a of s.supportedTypes){const o=this.typeMapping.get(a);if(o){const r=o.indexOf(n);r>=0&&o.splice(r,1),o.length===0&&this.typeMapping.delete(a)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(a=>this.widgets.get(a)).filter(Boolean)}findBestWidget(n){const s=yt.resolveWidget(n.definition,n.name);if(s?.widget){const o=this.widgets.get(s.widget);if(o)return{name:s.widget,registration:o,resolved:s}}const a=[];for(const[o,r]of this.widgets.entries())if(r.matcher)try{r.matcher(n)&&a.push({name:o,registration:r,priority:r.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((r,l)=>l.priority-r.priority);const o=a[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,r=this.getForType(o);if(r.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:r[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Ut=new gt;function qt(e,n,s){return{factory:n,matcher:a=>{const r=a.definition["x:ui"];return r===e||typeof r=="object"&&r!==null&&r.widget===e},displayName:s?.displayName??e,priority:s?.priority??100,...s}}function zt(e,n,s){return{factory:n,matcher:a=>a.definition.format===e,displayName:s?.displayName??`${e} widget`,priority:s?.priority??75,...s}}function jt(e,n,s,a){return{factory:s,matcher:o=>{const r=o.definition;return r.type===e&&r.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Xt(e){const n=e?.logPrefix??"WIDGET_DIAG",s=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!s(a))return!1;const o=a.definition,r={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${r.name??"ROOT"}" path=[${r.path.join(", ")}] type="${r.type??"unknown"}" hasRegistry=${r.hasRegistry}`),e?.onProcess?.(r),!1}}}exports.Base64Input=$t;exports.Base64sInput=ut;exports.ColorSwatchInput=Ct;exports.EditableText=Tt;exports.NativeNullableDateInput=At;exports.NativeNullableDateTimeInput=kt;exports.NullableEmailInput=Nt;exports.NullablePasswordInput=vt;exports.NullableRatingInput=Wt;exports.NullableSliderInput=Lt;exports.NullableTextArea=Rt;exports.NullableTextInput=St;exports.NullableUrlInput=Pt;exports.NullableUuidInput=Dt;exports.RatingInput=ht;exports.SliderInput=Ht;exports.Switch=Et;exports.WidgetRegistry=gt;exports.createDiagnosticWidget=Xt;exports.emptyToNull=pt;exports.fileToBase64=ct;exports.forFormat=zt;exports.forTypeAndFormat=jt;exports.forXUI=qt;exports.formatColor=R;exports.getContrastRatio=It;exports.globalWidgetRegistry=Ut;exports.hexToRgb=D;exports.hslToRgb=Y;exports.hwbToRgb=st;exports.isValidColor=wt;exports.isValidHexColor=X;exports.isValidHslColor=tt;exports.isValidRgbColor=Z;exports.isValidRgbaColor=J;exports.linearToSrgb=P;exports.mulberry32=rt;exports.normalizeHexColor=et;exports.nullToEmpty=dt;exports.oklchToRgb=lt;exports.parseAnyColor=nt;exports.resolveEffectiveFormat=E;exports.rgbToHex=U;exports.rgbToHsl=q;exports.rgbToHwb=ot;exports.rgbToOklch=it;exports.srgbToLinear=L;exports.toRgbaString=at;
|