@glasshome/widget-sdk 0.3.6 → 0.3.7
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/framework/gestures/haptics.d.ts +19 -0
- package/dist/framework/gestures/use-widget-gestures.d.ts +19 -41
- package/dist/index.js +1052 -1013
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { createSignal as j, createContext as
|
|
2
|
-
import { z as
|
|
3
|
-
import { GridSizeSchema as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { createElementSize as
|
|
8
|
-
import { createForm as
|
|
9
|
-
function
|
|
10
|
-
const [
|
|
11
|
-
return
|
|
1
|
+
import { createSignal as j, createContext as Ot, useContext as Ct, createEffect as q, untrack as yt, createMemo as N, splitProps as Tt, on as wt, Show as et } from "solid-js";
|
|
2
|
+
import { z as X } from "zod";
|
|
3
|
+
import { GridSizeSchema as vr, PublishBodySchema as yr, PublishConfirmSchema as wr, PublishRequestSchema as $r, WidgetManifestSchema as pr, formatSchemaError as kr, parseGridSize as Sr, serializeGridSize as Cr } from "./schemas.js";
|
|
4
|
+
import { memo as _, effect as z, setStyleProperty as M, className as S, template as w, insert as b, style as ot, createComponent as T, addEventListener as nt, use as Vt, delegateEvents as At } from "solid-js/web";
|
|
5
|
+
import { clsx as Wt } from "clsx";
|
|
6
|
+
import { twMerge as Rt } from "tailwind-merge";
|
|
7
|
+
import { createElementSize as It } from "@solid-primitives/resize-observer";
|
|
8
|
+
import { createForm as Ht, zodForm as Gt, reset as Pt, setValue as Lt, getValue as Bt } from "@modular-forms/solid";
|
|
9
|
+
function Tn(t) {
|
|
10
|
+
const [e] = j(t);
|
|
11
|
+
return e;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
override: (
|
|
16
|
-
const
|
|
17
|
-
return
|
|
13
|
+
function Mt(t) {
|
|
14
|
+
return X.toJSONSchema(t, {
|
|
15
|
+
override: (e) => {
|
|
16
|
+
const r = X.globalRegistry.get(e.zodSchema);
|
|
17
|
+
return r && typeof r == "object" && Object.keys(r).length > 0 ? { ...e.jsonSchema, ...r } : e.jsonSchema;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function jt(t) {
|
|
22
22
|
try {
|
|
23
|
-
return
|
|
23
|
+
return t.parse({});
|
|
24
24
|
} catch {
|
|
25
25
|
return {};
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function Vn(t) {
|
|
29
|
+
return t.configSchema && (t.manifest.schema || (t.manifest.schema = Mt(t.configSchema)), t.manifest.defaultConfig || (t.manifest.defaultConfig = jt(t.configSchema))), t;
|
|
30
30
|
}
|
|
31
31
|
const U = {
|
|
32
32
|
/** Background layer (gradients, images, glows) */
|
|
@@ -38,19 +38,19 @@ const U = {
|
|
|
38
38
|
/** Action layer (buttons, edit controls) */
|
|
39
39
|
ACTIONS: 30
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
function An(t) {
|
|
42
42
|
}
|
|
43
|
-
const
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
43
|
+
const ht = Ot();
|
|
44
|
+
function I() {
|
|
45
|
+
const t = Ct(ht);
|
|
46
|
+
if (!t)
|
|
47
47
|
throw new Error("useWidgetContext must be used within a Widget component");
|
|
48
|
-
return
|
|
48
|
+
return t;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
50
|
+
function k(...t) {
|
|
51
|
+
return Rt(Wt(t));
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const Ft = {
|
|
54
54
|
id: "classic-glass",
|
|
55
55
|
name: "Classic Glass",
|
|
56
56
|
description: "Default glassmorphism design with blur background and gradient",
|
|
@@ -78,7 +78,7 @@ const Le = {
|
|
|
78
78
|
hoverScale: 1.02,
|
|
79
79
|
activeScale: 0.98
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, Ut = {
|
|
82
82
|
id: "minimal",
|
|
83
83
|
name: "Minimal",
|
|
84
84
|
description: "Clean, minimal design with no background effects",
|
|
@@ -107,7 +107,7 @@ const Le = {
|
|
|
107
107
|
active: !1,
|
|
108
108
|
focus: !0
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, Yt = {
|
|
111
111
|
id: "compact-horizontal",
|
|
112
112
|
name: "Compact Horizontal",
|
|
113
113
|
description: "Horizontal layout for compact widgets",
|
|
@@ -135,160 +135,160 @@ const Le = {
|
|
|
135
135
|
hoverScale: 1.02,
|
|
136
136
|
activeScale: 0.98
|
|
137
137
|
}
|
|
138
|
-
},
|
|
139
|
-
"classic-glass":
|
|
140
|
-
minimal:
|
|
141
|
-
"compact-horizontal":
|
|
138
|
+
}, bt = {
|
|
139
|
+
"classic-glass": Ft,
|
|
140
|
+
minimal: Ut,
|
|
141
|
+
"compact-horizontal": Yt
|
|
142
142
|
};
|
|
143
|
-
function
|
|
144
|
-
return
|
|
143
|
+
function Kt(t) {
|
|
144
|
+
return bt[t];
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
146
|
+
function Wn(t) {
|
|
147
|
+
return t in bt;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return Object.keys(
|
|
149
|
+
function Rn() {
|
|
150
|
+
return Object.keys(bt);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
if (typeof
|
|
154
|
-
return
|
|
155
|
-
const
|
|
156
|
-
for (const
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
if (Array.isArray(
|
|
160
|
-
|
|
152
|
+
function zt(t, e) {
|
|
153
|
+
if (typeof t != "object" || t === null)
|
|
154
|
+
return e;
|
|
155
|
+
const r = { ...t };
|
|
156
|
+
for (const i in e) {
|
|
157
|
+
const n = e[i], a = t[i];
|
|
158
|
+
if (n !== void 0) {
|
|
159
|
+
if (Array.isArray(n)) {
|
|
160
|
+
r[i] = n;
|
|
161
161
|
continue;
|
|
162
162
|
}
|
|
163
|
-
if (typeof
|
|
164
|
-
typeof a == "object" && a !== null ?
|
|
163
|
+
if (typeof n == "object" && n !== null && !Array.isArray(n)) {
|
|
164
|
+
typeof a == "object" && a !== null ? r[i] = zt(a, n) : r[i] = n;
|
|
165
165
|
continue;
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
r[i] = n;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
function
|
|
173
|
-
if (!(!
|
|
174
|
-
return
|
|
175
|
-
container: { ...
|
|
176
|
-
class:
|
|
177
|
-
cssVars: { ...
|
|
178
|
-
} :
|
|
179
|
-
}
|
|
180
|
-
function
|
|
181
|
-
return
|
|
182
|
-
}
|
|
183
|
-
function
|
|
184
|
-
if (!(!
|
|
185
|
-
return
|
|
186
|
-
visible: { ...
|
|
187
|
-
styles:
|
|
188
|
-
classNames: { ...
|
|
189
|
-
} :
|
|
190
|
-
}
|
|
191
|
-
function
|
|
192
|
-
if (!(!
|
|
193
|
-
return
|
|
194
|
-
background:
|
|
195
|
-
overlay:
|
|
196
|
-
decorations:
|
|
197
|
-
} :
|
|
198
|
-
}
|
|
199
|
-
function
|
|
200
|
-
if (!(!
|
|
201
|
-
return
|
|
202
|
-
hover:
|
|
203
|
-
active:
|
|
204
|
-
focus:
|
|
205
|
-
hoverScale:
|
|
206
|
-
activeScale:
|
|
207
|
-
} :
|
|
208
|
-
}
|
|
209
|
-
function
|
|
170
|
+
return r;
|
|
171
|
+
}
|
|
172
|
+
function qt(t, e) {
|
|
173
|
+
if (!(!t && !e))
|
|
174
|
+
return t ? e ? {
|
|
175
|
+
container: { ...t.container, ...e.container },
|
|
176
|
+
class: e.class ?? t.class,
|
|
177
|
+
cssVars: { ...t.cssVars, ...e.cssVars }
|
|
178
|
+
} : t : e;
|
|
179
|
+
}
|
|
180
|
+
function Xt(t, e) {
|
|
181
|
+
return e ?? t;
|
|
182
|
+
}
|
|
183
|
+
function Jt(t, e) {
|
|
184
|
+
if (!(!t && !e))
|
|
185
|
+
return t ? e ? {
|
|
186
|
+
visible: { ...t.visible, ...e.visible },
|
|
187
|
+
styles: zt(t.styles ?? {}, e.styles ?? {}),
|
|
188
|
+
classNames: { ...t.classNames, ...e.classNames }
|
|
189
|
+
} : t : e;
|
|
190
|
+
}
|
|
191
|
+
function Zt(t, e) {
|
|
192
|
+
if (!(!t && !e))
|
|
193
|
+
return t ? e ? {
|
|
194
|
+
background: e.background ?? t.background,
|
|
195
|
+
overlay: e.overlay ?? t.overlay,
|
|
196
|
+
decorations: e.decorations ?? t.decorations
|
|
197
|
+
} : t : e;
|
|
198
|
+
}
|
|
199
|
+
function Qt(t, e) {
|
|
200
|
+
if (!(!t && !e))
|
|
201
|
+
return t ? e ? {
|
|
202
|
+
hover: e.hover ?? t.hover,
|
|
203
|
+
active: e.active ?? t.active,
|
|
204
|
+
focus: e.focus ?? t.focus,
|
|
205
|
+
hoverScale: e.hoverScale ?? t.hoverScale,
|
|
206
|
+
activeScale: e.activeScale ?? t.activeScale
|
|
207
|
+
} : t : e;
|
|
208
|
+
}
|
|
209
|
+
function xt(t, e) {
|
|
210
210
|
return {
|
|
211
|
-
id:
|
|
212
|
-
name:
|
|
213
|
-
description:
|
|
214
|
-
styles:
|
|
215
|
-
layout:
|
|
216
|
-
elements:
|
|
217
|
-
plugins:
|
|
218
|
-
interactions:
|
|
219
|
-
extends:
|
|
211
|
+
id: e.id ?? t.id,
|
|
212
|
+
name: e.name ?? t.name,
|
|
213
|
+
description: e.description ?? t.description,
|
|
214
|
+
styles: qt(t.styles, e.styles),
|
|
215
|
+
layout: Xt(t.layout, e.layout),
|
|
216
|
+
elements: Jt(t.elements, e.elements),
|
|
217
|
+
plugins: Zt(t.plugins, e.plugins),
|
|
218
|
+
interactions: Qt(t.interactions, e.interactions),
|
|
219
|
+
extends: e.extends ?? t.extends
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function In(t, e) {
|
|
223
223
|
return {
|
|
224
|
-
...
|
|
225
|
-
extends:
|
|
224
|
+
...e,
|
|
225
|
+
extends: t
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
if (
|
|
228
|
+
function Hn(...t) {
|
|
229
|
+
if (t.length === 0)
|
|
230
230
|
throw new Error("composeVariants requires at least one variant");
|
|
231
|
-
return
|
|
231
|
+
return t.length === 1 ? t[0] : t.reduce((e, r) => xt(e, r));
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
233
|
+
function Gn(t, e) {
|
|
234
|
+
return xt(t, { layout: e });
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
238
|
-
styles: { cssVars:
|
|
236
|
+
function Pn(t, e) {
|
|
237
|
+
return xt(t, {
|
|
238
|
+
styles: { cssVars: e }
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Ln(t = "column", e = "start", r = "start", i) {
|
|
242
242
|
return {
|
|
243
243
|
type: "flex",
|
|
244
|
-
direction:
|
|
245
|
-
align:
|
|
246
|
-
justify:
|
|
247
|
-
...
|
|
244
|
+
direction: t,
|
|
245
|
+
align: e,
|
|
246
|
+
justify: r,
|
|
247
|
+
...i
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var
|
|
251
|
-
function
|
|
252
|
-
const
|
|
253
|
-
return [
|
|
254
|
-
var
|
|
255
|
-
return
|
|
256
|
-
var o =
|
|
257
|
-
return o !== a.e &&
|
|
250
|
+
var te = /* @__PURE__ */ w("<div>"), ee = /* @__PURE__ */ w('<div class="pointer-events-none absolute inset-0 opacity-40 blur-2xl">');
|
|
251
|
+
function ne(t) {
|
|
252
|
+
const e = I(), r = () => e.orientation() === "vertical" ? `inset(${100 - t.value}% 0 0 0)` : `inset(0 ${100 - t.value}% 0 0)`, i = () => t.color ?? "rgb(59, 130, 246)";
|
|
253
|
+
return [_(() => _(() => !!((t.glow ?? !1) && t.value > 0))() && (() => {
|
|
254
|
+
var n = ee();
|
|
255
|
+
return z((a) => {
|
|
256
|
+
var o = i(), s = U.BACKGROUND;
|
|
257
|
+
return o !== a.e && M(n, "background", a.e = o), s !== a.t && M(n, "z-index", a.t = s), a;
|
|
258
258
|
}, {
|
|
259
259
|
e: void 0,
|
|
260
260
|
t: void 0
|
|
261
|
-
}),
|
|
261
|
+
}), n;
|
|
262
262
|
})()), (() => {
|
|
263
|
-
var
|
|
264
|
-
return
|
|
265
|
-
var o =
|
|
266
|
-
return o !== a.e &&
|
|
263
|
+
var n = te();
|
|
264
|
+
return z((a) => {
|
|
265
|
+
var o = k("pointer-events-none absolute inset-0", t.isDragging ? "duration-0" : "transition-all duration-300 ease-out", t.class), s = i(), l = r(), d = t.opacity ?? 0.3, c = U.BACKGROUND;
|
|
266
|
+
return o !== a.e && S(n, a.e = o), s !== a.t && M(n, "background", a.t = s), l !== a.a && M(n, "clip-path", a.a = l), d !== a.o && M(n, "opacity", a.o = d), c !== a.i && M(n, "z-index", a.i = c), a;
|
|
267
267
|
}, {
|
|
268
268
|
e: void 0,
|
|
269
269
|
t: void 0,
|
|
270
270
|
a: void 0,
|
|
271
271
|
o: void 0,
|
|
272
272
|
i: void 0
|
|
273
|
-
}),
|
|
273
|
+
}), n;
|
|
274
274
|
})()];
|
|
275
275
|
}
|
|
276
|
-
const
|
|
276
|
+
const rt = {
|
|
277
277
|
S1: { xs: 4, sm: 4, md: 6, lg: 6, xl: 8 },
|
|
278
278
|
S2: { xs: 6, sm: 8, md: 10, lg: 12, xl: 14 },
|
|
279
279
|
S3: { xs: 8, sm: 10, md: 12, lg: 14, xl: 16 },
|
|
280
280
|
S4: { xs: 12, sm: 14, md: 16, lg: 18, xl: 20 }
|
|
281
281
|
}, W = {
|
|
282
282
|
/** Extra small spacing (4-8px) */
|
|
283
|
-
S1: (
|
|
283
|
+
S1: (t) => `${rt.S1[t]}px`,
|
|
284
284
|
/** Small spacing (6-14px) - default for most layouts */
|
|
285
|
-
S2: (
|
|
285
|
+
S2: (t) => `${rt.S2[t]}px`,
|
|
286
286
|
/** Medium spacing (8-16px) */
|
|
287
|
-
S3: (
|
|
287
|
+
S3: (t) => `${rt.S3[t]}px`,
|
|
288
288
|
/** Large spacing (12-20px) */
|
|
289
|
-
S4: (
|
|
289
|
+
S4: (t) => `${rt.S4[t]}px`,
|
|
290
290
|
/** Icon container size in pixels */
|
|
291
|
-
icon: (
|
|
291
|
+
icon: (t) => ({
|
|
292
292
|
xs: 32,
|
|
293
293
|
// 1x1, 1x2 widgets
|
|
294
294
|
sm: 40,
|
|
@@ -299,9 +299,9 @@ const re = {
|
|
|
299
299
|
// 2x6, 3x6, 4x2 widgets
|
|
300
300
|
xl: 56
|
|
301
301
|
// 4x4 widgets
|
|
302
|
-
})[
|
|
302
|
+
})[t],
|
|
303
303
|
/** Icon stroke size for lucide icons */
|
|
304
|
-
iconSize: (
|
|
304
|
+
iconSize: (t) => ({
|
|
305
305
|
xs: 18,
|
|
306
306
|
// Smaller stroke for tiny widgets
|
|
307
307
|
sm: 20,
|
|
@@ -312,9 +312,9 @@ const re = {
|
|
|
312
312
|
// Large widgets
|
|
313
313
|
xl: 28
|
|
314
314
|
// Extra large widgets
|
|
315
|
-
})[
|
|
315
|
+
})[t],
|
|
316
316
|
/** Spacing between icon and title */
|
|
317
|
-
iconToTitle: (
|
|
317
|
+
iconToTitle: (t) => ({
|
|
318
318
|
xs: "8px",
|
|
319
319
|
// Tight spacing for small widgets
|
|
320
320
|
sm: "10px",
|
|
@@ -325,9 +325,9 @@ const re = {
|
|
|
325
325
|
// More breathing room
|
|
326
326
|
xl: "16px"
|
|
327
327
|
// Maximum spacing (@[400px]:mt-4 = 16px)
|
|
328
|
-
})[
|
|
328
|
+
})[t],
|
|
329
329
|
/** Container padding */
|
|
330
|
-
container: (
|
|
330
|
+
container: (t) => ({
|
|
331
331
|
xs: "8px",
|
|
332
332
|
// Minimal padding for tiny widgets
|
|
333
333
|
sm: "16px",
|
|
@@ -336,8 +336,8 @@ const re = {
|
|
|
336
336
|
lg: "20px",
|
|
337
337
|
// More padding for larger widgets
|
|
338
338
|
xl: "20px"
|
|
339
|
-
})[
|
|
340
|
-
},
|
|
339
|
+
})[t]
|
|
340
|
+
}, re = {
|
|
341
341
|
4: "gap-1",
|
|
342
342
|
6: "gap-1.5",
|
|
343
343
|
8: "gap-2",
|
|
@@ -348,35 +348,35 @@ const re = {
|
|
|
348
348
|
18: "gap-[18px]",
|
|
349
349
|
20: "gap-5"
|
|
350
350
|
};
|
|
351
|
-
function
|
|
352
|
-
const
|
|
353
|
-
return
|
|
351
|
+
function ie(t, e) {
|
|
352
|
+
const r = rt[t][e];
|
|
353
|
+
return re[r] || `gap-[${r}px]`;
|
|
354
354
|
}
|
|
355
|
-
var
|
|
356
|
-
function
|
|
357
|
-
const
|
|
355
|
+
var ae = /* @__PURE__ */ w("<div>");
|
|
356
|
+
function oe(t) {
|
|
357
|
+
const e = I();
|
|
358
358
|
return (() => {
|
|
359
|
-
var
|
|
360
|
-
return
|
|
361
|
-
var
|
|
359
|
+
var r = ae();
|
|
360
|
+
return b(r, () => t.children), z((i) => {
|
|
361
|
+
var n = k(
|
|
362
362
|
"relative flex h-full w-full overflow-hidden",
|
|
363
363
|
// Ensure controls (ml-auto divs) are above other content
|
|
364
364
|
"[&_div.ml-auto]:relative [&_div.ml-auto]:z-30",
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
), a = W.container(
|
|
369
|
-
return
|
|
365
|
+
e.contentLayout() === "horizontal" ? "flex-row items-center" : "flex-col justify-between",
|
|
366
|
+
ie("S3", e.size()),
|
|
367
|
+
t.class
|
|
368
|
+
), a = W.container(e.size()), o = U.CONTENT;
|
|
369
|
+
return n !== i.e && S(r, i.e = n), a !== i.t && M(r, "padding", i.t = a), o !== i.a && M(r, "z-index", i.a = o), i;
|
|
370
370
|
}, {
|
|
371
371
|
e: void 0,
|
|
372
372
|
t: void 0,
|
|
373
373
|
a: void 0
|
|
374
|
-
}),
|
|
374
|
+
}), r;
|
|
375
375
|
})();
|
|
376
376
|
}
|
|
377
377
|
const F = {
|
|
378
378
|
/** Container base text sizing */
|
|
379
|
-
container: (
|
|
379
|
+
container: (t) => ({
|
|
380
380
|
xs: "text-xs",
|
|
381
381
|
// Smallest widgets
|
|
382
382
|
sm: "text-sm",
|
|
@@ -387,9 +387,9 @@ const F = {
|
|
|
387
387
|
// Large widgets
|
|
388
388
|
xl: "text-lg"
|
|
389
389
|
// Extra large widgets
|
|
390
|
-
})[
|
|
390
|
+
})[t],
|
|
391
391
|
/** Title text sizing (main heading) */
|
|
392
|
-
title: (
|
|
392
|
+
title: (t) => ({
|
|
393
393
|
xs: "text-xs",
|
|
394
394
|
// 12px - Very compact
|
|
395
395
|
sm: "text-xs",
|
|
@@ -400,9 +400,9 @@ const F = {
|
|
|
400
400
|
// 14px - Maintain size
|
|
401
401
|
xl: "text-sm"
|
|
402
402
|
// 14px - Don't go too large for secondary text
|
|
403
|
-
})[
|
|
403
|
+
})[t],
|
|
404
404
|
/** Subtitle/secondary text sizing */
|
|
405
|
-
subtitle: (
|
|
405
|
+
subtitle: (t) => ({
|
|
406
406
|
xs: "text-xs",
|
|
407
407
|
// 12px - Very compact
|
|
408
408
|
sm: "text-sm",
|
|
@@ -413,9 +413,9 @@ const F = {
|
|
|
413
413
|
// 14px - Maintain size
|
|
414
414
|
xl: "text-base"
|
|
415
415
|
// 14px - Don't go too large for secondary text
|
|
416
|
-
})[
|
|
416
|
+
})[t],
|
|
417
417
|
/** Value display text sizing (large numbers) */
|
|
418
|
-
value: (
|
|
418
|
+
value: (t) => ({
|
|
419
419
|
xs: "text-lg",
|
|
420
420
|
// 18px - Still readable on small widgets
|
|
421
421
|
sm: "text-xl",
|
|
@@ -426,9 +426,9 @@ const F = {
|
|
|
426
426
|
// 30px - Very prominent
|
|
427
427
|
xl: "text-4xl"
|
|
428
428
|
// 36px - Maximum impact
|
|
429
|
-
})[
|
|
429
|
+
})[t],
|
|
430
430
|
/** Badge text sizing (entity count badges) */
|
|
431
|
-
badge: (
|
|
431
|
+
badge: (t) => ({
|
|
432
432
|
xs: "text-xs",
|
|
433
433
|
// 12px - Compact badge
|
|
434
434
|
sm: "text-xs",
|
|
@@ -439,9 +439,9 @@ const F = {
|
|
|
439
439
|
// 14px - Slightly larger for readability
|
|
440
440
|
xl: "text-sm"
|
|
441
441
|
// 14px - Maximum badge size
|
|
442
|
-
})[
|
|
442
|
+
})[t],
|
|
443
443
|
/** Metric label text sizing */
|
|
444
|
-
metricLabel: (
|
|
444
|
+
metricLabel: (t) => ({
|
|
445
445
|
xs: "text-xs",
|
|
446
446
|
// 12px - Compact labels
|
|
447
447
|
sm: "text-xs",
|
|
@@ -452,9 +452,9 @@ const F = {
|
|
|
452
452
|
// 14px - More readable on large widgets
|
|
453
453
|
xl: "text-sm"
|
|
454
454
|
// 14px
|
|
455
|
-
})[
|
|
455
|
+
})[t],
|
|
456
456
|
/** Metric value text sizing */
|
|
457
|
-
metricValue: (
|
|
457
|
+
metricValue: (t) => ({
|
|
458
458
|
xs: "text-sm",
|
|
459
459
|
// 14px - Readable metric values
|
|
460
460
|
sm: "text-sm",
|
|
@@ -465,17 +465,17 @@ const F = {
|
|
|
465
465
|
// 16px - Slightly larger
|
|
466
466
|
xl: "text-base"
|
|
467
467
|
// 16px
|
|
468
|
-
})[
|
|
468
|
+
})[t],
|
|
469
469
|
/** Status text (same as subtitle but semantic) */
|
|
470
|
-
status: (
|
|
470
|
+
status: (t) => ({
|
|
471
471
|
xs: "text-md",
|
|
472
472
|
sm: "text-xl",
|
|
473
473
|
md: "text-2xl",
|
|
474
474
|
lg: "text-3xl",
|
|
475
475
|
xl: "text-3xl"
|
|
476
|
-
})[
|
|
476
|
+
})[t],
|
|
477
477
|
/** Empty state message text */
|
|
478
|
-
emptyState: (
|
|
478
|
+
emptyState: (t) => ({
|
|
479
479
|
xs: "text-xs",
|
|
480
480
|
// 12px
|
|
481
481
|
sm: "text-sm",
|
|
@@ -486,179 +486,179 @@ const F = {
|
|
|
486
486
|
// 16px
|
|
487
487
|
xl: "text-base"
|
|
488
488
|
// 16px
|
|
489
|
-
})[
|
|
489
|
+
})[t]
|
|
490
490
|
};
|
|
491
|
-
var
|
|
492
|
-
function
|
|
493
|
-
const
|
|
491
|
+
var se = /* @__PURE__ */ w("<div><div>"), le = /* @__PURE__ */ w("<div>"), ce = /* @__PURE__ */ w("<h3>"), ue = /* @__PURE__ */ w("<p>"), de = /* @__PURE__ */ w("<div class=mt-2>");
|
|
492
|
+
function ge(t) {
|
|
493
|
+
const e = I(), r = () => e.contentLayout() === "horizontal";
|
|
494
494
|
return (() => {
|
|
495
|
-
var
|
|
496
|
-
return
|
|
497
|
-
var a =
|
|
495
|
+
var i = se(), n = i.firstChild;
|
|
496
|
+
return b(i, (() => {
|
|
497
|
+
var a = _(() => !!t.icon);
|
|
498
498
|
return () => a() && (() => {
|
|
499
|
-
var o =
|
|
500
|
-
return
|
|
501
|
-
var l =
|
|
502
|
-
return l !== s.e &&
|
|
499
|
+
var o = le();
|
|
500
|
+
return b(o, () => t.icon), z((s) => {
|
|
501
|
+
var l = k("flex items-center justify-center text-foreground/30", r() ? "shrink-0" : ""), d = `${W.icon(e.size())}px`, c = `${W.icon(e.size())}px`;
|
|
502
|
+
return l !== s.e && S(o, s.e = l), d !== s.t && M(o, "width", s.t = d), c !== s.a && M(o, "height", s.a = c), s;
|
|
503
503
|
}, {
|
|
504
504
|
e: void 0,
|
|
505
505
|
t: void 0,
|
|
506
506
|
a: void 0
|
|
507
507
|
}), o;
|
|
508
508
|
})();
|
|
509
|
-
})(),
|
|
510
|
-
var a =
|
|
509
|
+
})(), n), b(n, (() => {
|
|
510
|
+
var a = _(() => !!(t.title ?? "No data"));
|
|
511
511
|
return () => a() && (() => {
|
|
512
|
-
var o =
|
|
513
|
-
return
|
|
514
|
-
var l =
|
|
515
|
-
return l !== s.e &&
|
|
512
|
+
var o = ce();
|
|
513
|
+
return b(o, () => t.title ?? "No data"), z((s) => {
|
|
514
|
+
var l = k("font-semibold text-foreground/60", F.subtitle(e.size())), d = r() ? "100%" : "80%";
|
|
515
|
+
return l !== s.e && S(o, s.e = l), d !== s.t && M(o, "max-width", s.t = d), s;
|
|
516
516
|
}, {
|
|
517
517
|
e: void 0,
|
|
518
518
|
t: void 0
|
|
519
519
|
}), o;
|
|
520
520
|
})();
|
|
521
|
-
})(), null),
|
|
522
|
-
var a =
|
|
521
|
+
})(), null), b(n, (() => {
|
|
522
|
+
var a = _(() => !!t.message);
|
|
523
523
|
return () => a() && (() => {
|
|
524
|
-
var o =
|
|
525
|
-
return
|
|
526
|
-
var l =
|
|
527
|
-
return l !== s.e &&
|
|
524
|
+
var o = ue();
|
|
525
|
+
return b(o, () => t.message), z((s) => {
|
|
526
|
+
var l = k("text-foreground/50", F.emptyState(e.size())), d = r() ? "100%" : "85%";
|
|
527
|
+
return l !== s.e && S(o, s.e = l), d !== s.t && M(o, "max-width", s.t = d), s;
|
|
528
528
|
}, {
|
|
529
529
|
e: void 0,
|
|
530
530
|
t: void 0
|
|
531
531
|
}), o;
|
|
532
532
|
})();
|
|
533
|
-
})(), null),
|
|
534
|
-
var a =
|
|
533
|
+
})(), null), b(n, (() => {
|
|
534
|
+
var a = _(() => !!t.action);
|
|
535
535
|
return () => a() && (() => {
|
|
536
|
-
var o =
|
|
537
|
-
return
|
|
536
|
+
var o = de();
|
|
537
|
+
return b(o, () => t.action), o;
|
|
538
538
|
})();
|
|
539
|
-
})(), null),
|
|
540
|
-
var o =
|
|
541
|
-
return o !== a.e &&
|
|
539
|
+
})(), null), z((a) => {
|
|
540
|
+
var o = k("flex h-full w-full", r() ? "flex-row items-center justify-start" : "flex-col items-center justify-center text-center", t.class), s = W.S2(e.size()), l = W.container(e.size()), d = k("flex flex-col", r() ? "items-start text-left" : "items-center text-center"), c = W.S1(e.size());
|
|
541
|
+
return o !== a.e && S(i, a.e = o), s !== a.t && M(i, "gap", a.t = s), l !== a.a && M(i, "padding", a.a = l), d !== a.o && S(n, a.o = d), c !== a.i && M(n, "gap", a.i = c), a;
|
|
542
542
|
}, {
|
|
543
543
|
e: void 0,
|
|
544
544
|
t: void 0,
|
|
545
545
|
a: void 0,
|
|
546
546
|
o: void 0,
|
|
547
547
|
i: void 0
|
|
548
|
-
}),
|
|
548
|
+
}), i;
|
|
549
549
|
})();
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
const
|
|
553
|
-
return
|
|
554
|
-
}
|
|
555
|
-
function
|
|
556
|
-
const
|
|
557
|
-
return
|
|
558
|
-
}
|
|
559
|
-
function
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
562
|
-
let
|
|
563
|
-
|
|
564
|
-
const
|
|
565
|
-
return
|
|
566
|
-
}
|
|
567
|
-
function
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
const o =
|
|
551
|
+
function me(t) {
|
|
552
|
+
const e = t.match(/hsl\(\s*([\d.]+)\s*,\s*([\d.]+)%?\s*,\s*([\d.]+)%?\s*\)/);
|
|
553
|
+
return e ? { h: Number(e[1]), s: Number(e[2]), l: Number(e[3]) } : null;
|
|
554
|
+
}
|
|
555
|
+
function fe(t) {
|
|
556
|
+
const e = t.match(/rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)/);
|
|
557
|
+
return e ? Dt(Number(e[1]), Number(e[2]), Number(e[3])) : null;
|
|
558
|
+
}
|
|
559
|
+
function he(t) {
|
|
560
|
+
const e = t.match(/^#([0-9a-f]{3,8})$/i);
|
|
561
|
+
if (!e) return null;
|
|
562
|
+
let r = e[1];
|
|
563
|
+
r.length === 3 && (r = r[0] + r[0] + r[1] + r[1] + r[2] + r[2]);
|
|
564
|
+
const i = Number.parseInt(r.slice(0, 2), 16), n = Number.parseInt(r.slice(2, 4), 16), a = Number.parseInt(r.slice(4, 6), 16);
|
|
565
|
+
return Dt(i, n, a);
|
|
566
|
+
}
|
|
567
|
+
function Dt(t, e, r) {
|
|
568
|
+
t /= 255, e /= 255, r /= 255;
|
|
569
|
+
const i = Math.max(t, e, r), n = Math.min(t, e, r), a = (i + n) / 2;
|
|
570
|
+
if (i === n) return { h: 0, s: 0, l: a * 100 };
|
|
571
|
+
const o = i - n, s = a > 0.5 ? o / (2 - i - n) : o / (i + n);
|
|
572
572
|
let l = 0;
|
|
573
|
-
return
|
|
574
|
-
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
577
|
-
}
|
|
578
|
-
function
|
|
579
|
-
const
|
|
580
|
-
return
|
|
581
|
-
}
|
|
582
|
-
function
|
|
583
|
-
const
|
|
584
|
-
if (!
|
|
585
|
-
const { h:
|
|
586
|
-
let a, o = Math.min(
|
|
587
|
-
|
|
588
|
-
const s =
|
|
573
|
+
return i === t ? l = ((e - r) / o + (e < r ? 6 : 0)) / 6 : i === e ? l = ((r - t) / o + 2) / 6 : l = ((t - e) / o + 4) / 6, { h: l * 360, s: s * 100, l: a * 100 };
|
|
574
|
+
}
|
|
575
|
+
function be(t) {
|
|
576
|
+
return me(t) ?? fe(t) ?? he(t);
|
|
577
|
+
}
|
|
578
|
+
function $t(t, e, r, i) {
|
|
579
|
+
const n = Math.round(t), a = Math.round(Math.min(100, Math.max(0, e))), o = Math.round(Math.min(100, Math.max(0, r)));
|
|
580
|
+
return i !== void 0 && i < 1 ? `hsla(${n}, ${a}%, ${o}%, ${i})` : `hsl(${n}, ${a}%, ${o}%)`;
|
|
581
|
+
}
|
|
582
|
+
function xe(t) {
|
|
583
|
+
const e = be(t);
|
|
584
|
+
if (!e) return null;
|
|
585
|
+
const { h: r, s: i, l: n } = e;
|
|
586
|
+
let a, o = Math.min(i + 10, 100);
|
|
587
|
+
n < 25 ? (a = n + 12, o = Math.min(i + 15, 100)) : n < 40 ? a = Math.max(n - 8, 15) : a = Math.max(18, n * 0.3), i < 15 && (o = 10, a = Math.max(a, 20));
|
|
588
|
+
const s = $t(r, o, a, 0.85), l = $t(r, Math.min(i, 90), Math.min(n, 55), 0.5);
|
|
589
589
|
return { background: s, glow: l };
|
|
590
590
|
}
|
|
591
|
-
var
|
|
592
|
-
function
|
|
593
|
-
const
|
|
594
|
-
const l =
|
|
591
|
+
var ve = /* @__PURE__ */ w('<div><div class="flex items-center justify-center text-foreground">'), pt = /* @__PURE__ */ w("<div>");
|
|
592
|
+
function ye(t) {
|
|
593
|
+
const e = I(), r = () => t.dynamicColor ? xe(t.dynamicColor) : null, i = () => !!r(), n = () => {
|
|
594
|
+
const l = r();
|
|
595
595
|
if (l)
|
|
596
596
|
return {
|
|
597
597
|
"background-color": l.background
|
|
598
598
|
};
|
|
599
599
|
}, a = () => {
|
|
600
|
-
const l =
|
|
600
|
+
const l = r();
|
|
601
601
|
if (l)
|
|
602
602
|
return {
|
|
603
603
|
"box-shadow": `0 0 25px ${l.glow}`
|
|
604
604
|
};
|
|
605
605
|
}, o = () => {
|
|
606
606
|
const l = {
|
|
607
|
-
width: `${W.icon(
|
|
608
|
-
height: `${W.icon(
|
|
607
|
+
width: `${W.icon(e.size())}px`,
|
|
608
|
+
height: `${W.icon(e.size())}px`,
|
|
609
609
|
"border-radius": "var(--radius-sm, 12px)"
|
|
610
|
-
}, d =
|
|
610
|
+
}, d = n(), c = a();
|
|
611
611
|
return d && Object.assign(l, d), c && Object.assign(l, c), l;
|
|
612
612
|
}, s = (l, d, c) => {
|
|
613
|
-
const
|
|
614
|
-
width: `${W.icon(
|
|
615
|
-
height: `${W.icon(
|
|
613
|
+
const v = {
|
|
614
|
+
width: `${W.icon(e.size()) * 1.02}px`,
|
|
615
|
+
height: `${W.icon(e.size()) * 1.02}px`,
|
|
616
616
|
"border-radius": "var(--radius-sm, 12px)",
|
|
617
|
-
bottom: `${-W.icon(
|
|
618
|
-
right: `${-W.icon(
|
|
617
|
+
bottom: `${-W.icon(e.size()) * l}px`,
|
|
618
|
+
right: `${-W.icon(e.size()) * (l * 0.71)}px`,
|
|
619
619
|
"z-index": d,
|
|
620
620
|
opacity: c
|
|
621
|
-
},
|
|
622
|
-
return
|
|
621
|
+
}, C = n();
|
|
622
|
+
return C && Object.assign(v, C), v;
|
|
623
623
|
};
|
|
624
624
|
return (() => {
|
|
625
|
-
var l =
|
|
626
|
-
return
|
|
627
|
-
var c =
|
|
625
|
+
var l = ve(), d = l.firstChild;
|
|
626
|
+
return b(l, (() => {
|
|
627
|
+
var c = _(() => (t.entityCount ?? 1) >= 2);
|
|
628
628
|
return () => c() && (() => {
|
|
629
|
-
var
|
|
630
|
-
return
|
|
631
|
-
var
|
|
632
|
-
return
|
|
629
|
+
var v = pt();
|
|
630
|
+
return z((C) => {
|
|
631
|
+
var m = k("absolute", !i() && (t.color ?? "bg-foreground/10")), x = s(0.14, -2, 0.45);
|
|
632
|
+
return m !== C.e && S(v, C.e = m), C.t = ot(v, x, C.t), C;
|
|
633
633
|
}, {
|
|
634
634
|
e: void 0,
|
|
635
635
|
t: void 0
|
|
636
|
-
}),
|
|
636
|
+
}), v;
|
|
637
637
|
})();
|
|
638
|
-
})(), d),
|
|
639
|
-
var c =
|
|
638
|
+
})(), d), b(l, (() => {
|
|
639
|
+
var c = _(() => (t.entityCount ?? 1) >= 3);
|
|
640
640
|
return () => c() && (() => {
|
|
641
|
-
var
|
|
642
|
-
return
|
|
643
|
-
var
|
|
644
|
-
return
|
|
641
|
+
var v = pt();
|
|
642
|
+
return z((C) => {
|
|
643
|
+
var m = k("absolute", !i() && (t.color ?? "bg-foreground/10")), x = s(0.28, -3, 0.2);
|
|
644
|
+
return m !== C.e && S(v, C.e = m), C.t = ot(v, x, C.t), C;
|
|
645
645
|
}, {
|
|
646
646
|
e: void 0,
|
|
647
647
|
t: void 0
|
|
648
|
-
}),
|
|
648
|
+
}), v;
|
|
649
649
|
})();
|
|
650
|
-
})(), d),
|
|
651
|
-
var
|
|
650
|
+
})(), d), b(d, () => t.icon), z((c) => {
|
|
651
|
+
var v = k(
|
|
652
652
|
"relative flex shrink-0 items-center justify-center transition-all",
|
|
653
653
|
"pointer-events-none",
|
|
654
|
-
|
|
654
|
+
t.dimmed && "opacity-50",
|
|
655
655
|
// Only apply Tailwind classes when not using dynamic colors
|
|
656
|
-
!
|
|
657
|
-
!
|
|
658
|
-
!
|
|
659
|
-
|
|
660
|
-
),
|
|
661
|
-
return
|
|
656
|
+
!i() && t.glow && "shadow-[0_0_25px_var(--tw-shadow-color,transparent)]",
|
|
657
|
+
!i() && (t.color ?? "bg-foreground/10"),
|
|
658
|
+
!i() && t.glow,
|
|
659
|
+
t.class
|
|
660
|
+
), C = o(), m = `${W.iconSize(e.size())}px`;
|
|
661
|
+
return v !== c.e && S(l, c.e = v), c.t = ot(l, C, c.t), m !== c.a && M(d, "font-size", c.a = m), c;
|
|
662
662
|
}, {
|
|
663
663
|
e: void 0,
|
|
664
664
|
t: void 0,
|
|
@@ -666,102 +666,102 @@ function vt(e) {
|
|
|
666
666
|
}), l;
|
|
667
667
|
})();
|
|
668
668
|
}
|
|
669
|
-
var
|
|
670
|
-
function
|
|
671
|
-
const
|
|
672
|
-
const
|
|
673
|
-
return
|
|
669
|
+
var we = /* @__PURE__ */ w("<div>"), $e = /* @__PURE__ */ w("<div><div><span></span></div><div>"), pe = /* @__PURE__ */ w("<span class=shrink-0>"), ke = /* @__PURE__ */ w('<span class="ml-1 text-foreground/70">');
|
|
670
|
+
function Se(t) {
|
|
671
|
+
const e = I(), r = () => {
|
|
672
|
+
const i = t.direction ?? "auto";
|
|
673
|
+
return i === "auto" ? e.orientation() === "horizontal" ? "horizontal" : "vertical" : i;
|
|
674
674
|
};
|
|
675
675
|
return (() => {
|
|
676
|
-
var
|
|
677
|
-
return
|
|
676
|
+
var i = we();
|
|
677
|
+
return b(i, () => t.children), z(() => S(i, k("flex", r() === "horizontal" ? "flex-row gap-4" : "flex-col gap-2", t.class))), i;
|
|
678
678
|
})();
|
|
679
679
|
}
|
|
680
|
-
function
|
|
681
|
-
const
|
|
680
|
+
function Ce(t) {
|
|
681
|
+
const e = I();
|
|
682
682
|
return (() => {
|
|
683
|
-
var
|
|
684
|
-
return
|
|
685
|
-
var o =
|
|
683
|
+
var r = $e(), i = r.firstChild, n = i.firstChild, a = i.nextSibling;
|
|
684
|
+
return b(i, (() => {
|
|
685
|
+
var o = _(() => !!t.icon);
|
|
686
686
|
return () => o() && (() => {
|
|
687
|
-
var s =
|
|
688
|
-
return
|
|
687
|
+
var s = pe();
|
|
688
|
+
return b(s, () => t.icon), s;
|
|
689
689
|
})();
|
|
690
|
-
})(),
|
|
691
|
-
var o =
|
|
690
|
+
})(), n), b(n, () => t.label), b(a, () => t.value, null), b(a, (() => {
|
|
691
|
+
var o = _(() => !!t.unit);
|
|
692
692
|
return () => o() && (() => {
|
|
693
|
-
var s =
|
|
694
|
-
return
|
|
693
|
+
var s = ke();
|
|
694
|
+
return b(s, () => t.unit), s;
|
|
695
695
|
})();
|
|
696
|
-
})(), null),
|
|
697
|
-
var s =
|
|
698
|
-
return s !== o.e &&
|
|
696
|
+
})(), null), z((o) => {
|
|
697
|
+
var s = k("flex flex-col", t.dimmed && "opacity-50", t.class), l = W.S1(e.size()), d = k("flex items-center gap-1 text-foreground/60", F.metricLabel(e.size())), c = k("font-semibold text-foreground", F.metricValue(e.size()));
|
|
698
|
+
return s !== o.e && S(r, o.e = s), l !== o.t && M(r, "gap", o.t = l), d !== o.a && S(i, o.a = d), c !== o.o && S(a, o.o = c), o;
|
|
699
699
|
}, {
|
|
700
700
|
e: void 0,
|
|
701
701
|
t: void 0,
|
|
702
702
|
a: void 0,
|
|
703
703
|
o: void 0
|
|
704
|
-
}),
|
|
704
|
+
}), r;
|
|
705
705
|
})();
|
|
706
706
|
}
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
var
|
|
710
|
-
function
|
|
711
|
-
const
|
|
707
|
+
const _t = Se;
|
|
708
|
+
_t.Item = Ce;
|
|
709
|
+
var Me = /* @__PURE__ */ w("<p>");
|
|
710
|
+
function ze(t) {
|
|
711
|
+
const e = I();
|
|
712
712
|
return (() => {
|
|
713
|
-
var
|
|
714
|
-
return
|
|
715
|
-
var
|
|
716
|
-
return () =>
|
|
717
|
-
})()),
|
|
718
|
-
var
|
|
719
|
-
return
|
|
713
|
+
var r = Me();
|
|
714
|
+
return b(r, (() => {
|
|
715
|
+
var i = _(() => !!t.isUnavailable);
|
|
716
|
+
return () => i() ? "Unavailable" : t.children;
|
|
717
|
+
})()), z((i) => {
|
|
718
|
+
var n = k("relative font-bold text-foreground", t.dimmed && "opacity-40", F.status(e.size()), t.class), a = U.ACTIONS;
|
|
719
|
+
return n !== i.e && S(r, i.e = n), a !== i.t && M(r, "z-index", i.t = a), i;
|
|
720
720
|
}, {
|
|
721
721
|
e: void 0,
|
|
722
722
|
t: void 0
|
|
723
|
-
}),
|
|
723
|
+
}), r;
|
|
724
724
|
})();
|
|
725
725
|
}
|
|
726
|
-
var
|
|
727
|
-
function
|
|
728
|
-
const
|
|
726
|
+
var De = /* @__PURE__ */ w("<p>");
|
|
727
|
+
function _e(t) {
|
|
728
|
+
const e = I();
|
|
729
729
|
return (() => {
|
|
730
|
-
var
|
|
731
|
-
return
|
|
730
|
+
var r = De();
|
|
731
|
+
return b(r, () => t.children), z(() => S(r, k("truncate font-medium text-foreground/80", t.dimmed && "text-foreground/50", F.subtitle(e.size()), t.class))), r;
|
|
732
732
|
})();
|
|
733
733
|
}
|
|
734
|
-
var
|
|
735
|
-
function
|
|
736
|
-
const
|
|
734
|
+
var Ee = /* @__PURE__ */ w("<div><h3>"), Ne = /* @__PURE__ */ w("<span>");
|
|
735
|
+
function Oe(t) {
|
|
736
|
+
const e = I();
|
|
737
737
|
return (() => {
|
|
738
|
-
var
|
|
739
|
-
return
|
|
740
|
-
var
|
|
741
|
-
return () =>
|
|
742
|
-
var a =
|
|
743
|
-
return
|
|
738
|
+
var r = Ee(), i = r.firstChild;
|
|
739
|
+
return b(i, () => t.children), b(r, (() => {
|
|
740
|
+
var n = _(() => t.badge !== void 0 && t.badge > 0);
|
|
741
|
+
return () => n() && (() => {
|
|
742
|
+
var a = Ne();
|
|
743
|
+
return b(a, () => t.badge), z(() => S(a, k("shrink-0 rounded-full bg-foreground/20 px-2 py-0.5 font-medium text-foreground", F.badge(e.size())))), a;
|
|
744
744
|
})();
|
|
745
|
-
})(), null),
|
|
746
|
-
var a =
|
|
747
|
-
return a !==
|
|
745
|
+
})(), null), z((n) => {
|
|
746
|
+
var a = k("relative flex items-center", t.class), o = W.S1(e.size()), s = U.ACTIONS, l = k("truncate text-foreground/60", F.title(e.size()));
|
|
747
|
+
return a !== n.e && S(r, n.e = a), o !== n.t && M(r, "gap", n.t = o), s !== n.a && M(r, "z-index", n.a = s), l !== n.o && S(i, n.o = l), n;
|
|
748
748
|
}, {
|
|
749
749
|
e: void 0,
|
|
750
750
|
t: void 0,
|
|
751
751
|
a: void 0,
|
|
752
752
|
o: void 0
|
|
753
|
-
}),
|
|
753
|
+
}), r;
|
|
754
754
|
})();
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function Bn(t) {
|
|
757
757
|
return {
|
|
758
|
-
icon:
|
|
759
|
-
title:
|
|
760
|
-
message:
|
|
758
|
+
icon: t.icon,
|
|
759
|
+
title: t.title,
|
|
760
|
+
message: t.message || `Configure this widget to add ${t.entityType || "an entity"}`
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
if (
|
|
763
|
+
function Te(t, e = !1) {
|
|
764
|
+
if (t.length === 0)
|
|
765
765
|
return {
|
|
766
766
|
isGroup: !1,
|
|
767
767
|
state: "unknown",
|
|
@@ -774,31 +774,31 @@ function At(e, t = !1) {
|
|
|
774
774
|
totalCount: 0,
|
|
775
775
|
description: "No entities"
|
|
776
776
|
};
|
|
777
|
-
const
|
|
778
|
-
if (!
|
|
779
|
-
const
|
|
777
|
+
const r = t.length > 1;
|
|
778
|
+
if (!r) {
|
|
779
|
+
const $ = t[0], O = $.state === "on", H = $.attributes?.brightness || 0, f = Math.round(H / 255 * 100);
|
|
780
780
|
return {
|
|
781
781
|
isGroup: !1,
|
|
782
|
-
state:
|
|
783
|
-
isOn:
|
|
784
|
-
isUnavailable:
|
|
785
|
-
brightness:
|
|
786
|
-
brightnessPercent:
|
|
787
|
-
color: $
|
|
788
|
-
onCount:
|
|
782
|
+
state: $.state,
|
|
783
|
+
isOn: O,
|
|
784
|
+
isUnavailable: $.state === "unavailable",
|
|
785
|
+
brightness: H,
|
|
786
|
+
brightnessPercent: f,
|
|
787
|
+
color: kt($),
|
|
788
|
+
onCount: O ? 1 : 0,
|
|
789
789
|
totalCount: 1,
|
|
790
|
-
description:
|
|
790
|
+
description: O ? "On" : "Off"
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
|
-
let
|
|
793
|
+
let i = 0, n = 0, a = 0, o = 0, s = 0, l = 0;
|
|
794
794
|
const d = [];
|
|
795
|
-
for (const
|
|
796
|
-
switch (
|
|
795
|
+
for (const $ of t)
|
|
796
|
+
switch ($.state) {
|
|
797
797
|
case "on":
|
|
798
|
-
|
|
798
|
+
i++, $.attributes?.brightness !== void 0 && (s += $.attributes.brightness, l++), $.attributes?.rgb_color && d.push($.attributes.rgb_color);
|
|
799
799
|
break;
|
|
800
800
|
case "off":
|
|
801
|
-
|
|
801
|
+
n++;
|
|
802
802
|
break;
|
|
803
803
|
case "unknown":
|
|
804
804
|
a++;
|
|
@@ -807,32 +807,32 @@ function At(e, t = !1) {
|
|
|
807
807
|
o++;
|
|
808
808
|
break;
|
|
809
809
|
}
|
|
810
|
-
const c =
|
|
811
|
-
let
|
|
812
|
-
|
|
813
|
-
const
|
|
814
|
-
let
|
|
810
|
+
const c = t.length, v = o === c, C = a + o === c, m = i > 0, x = i === c, V = n === c;
|
|
811
|
+
let E, R;
|
|
812
|
+
e ? v ? (E = "unavailable", R = !1) : a > 0 || o > 0 ? (E = "unknown", R = !1) : n > 0 ? (E = "off", R = !1) : (E = "on", R = !0) : v ? (E = "unavailable", R = !1) : C ? (E = "unknown", R = !1) : m ? (E = "on", R = !0) : (E = "off", R = !1);
|
|
813
|
+
const K = l > 0 ? Math.round(s / l) : 0, B = Math.round(K / 255 * 100);
|
|
814
|
+
let h;
|
|
815
815
|
if (d.length > 0) {
|
|
816
|
-
const
|
|
817
|
-
|
|
816
|
+
const $ = Math.round(d.reduce((u, A) => u + A[0], 0) / d.length), O = Math.round(d.reduce((u, A) => u + A[1], 0) / d.length), H = Math.round(d.reduce((u, A) => u + A[2], 0) / d.length), f = K / 255;
|
|
817
|
+
h = `rgb(${Math.round($ * f)}, ${Math.round(O * f)}, ${Math.round(H * f)})`;
|
|
818
818
|
} else
|
|
819
|
-
|
|
820
|
-
let
|
|
821
|
-
return
|
|
822
|
-
isGroup:
|
|
823
|
-
state:
|
|
824
|
-
isOn:
|
|
825
|
-
isUnavailable:
|
|
826
|
-
brightness:
|
|
827
|
-
brightnessPercent:
|
|
828
|
-
color:
|
|
829
|
-
onCount:
|
|
819
|
+
h = kt(t[0]);
|
|
820
|
+
let y;
|
|
821
|
+
return x ? y = "All on" : V ? y = "All off" : i > 0 ? y = `${i} of ${c} on` : y = "Off", {
|
|
822
|
+
isGroup: r,
|
|
823
|
+
state: E,
|
|
824
|
+
isOn: R,
|
|
825
|
+
isUnavailable: E === "unavailable",
|
|
826
|
+
brightness: K,
|
|
827
|
+
brightnessPercent: B,
|
|
828
|
+
color: h,
|
|
829
|
+
onCount: i,
|
|
830
830
|
totalCount: c,
|
|
831
|
-
description:
|
|
831
|
+
description: y
|
|
832
832
|
};
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
if (
|
|
834
|
+
function Ve(t, e = "mean", r = !0) {
|
|
835
|
+
if (t.length === 0)
|
|
836
836
|
return {
|
|
837
837
|
isGroup: !1,
|
|
838
838
|
state: "unknown",
|
|
@@ -840,45 +840,45 @@ function Nt(e, t = "mean", n = !0) {
|
|
|
840
840
|
isUnavailable: !0,
|
|
841
841
|
description: "No entities"
|
|
842
842
|
};
|
|
843
|
-
const
|
|
844
|
-
if (!
|
|
845
|
-
const
|
|
846
|
-
let V =
|
|
847
|
-
return Number.isNaN(
|
|
843
|
+
const i = t.length > 1;
|
|
844
|
+
if (!i) {
|
|
845
|
+
const m = t[0], x = Number.parseFloat(m.state);
|
|
846
|
+
let V = m.state;
|
|
847
|
+
return Number.isNaN(x) || (V = Number.isInteger(x) ? x.toString() : x.toFixed(1)), {
|
|
848
848
|
isGroup: !1,
|
|
849
849
|
state: V,
|
|
850
|
-
numericValue: Number.isNaN(
|
|
851
|
-
isUnavailable:
|
|
852
|
-
unit:
|
|
850
|
+
numericValue: Number.isNaN(x) ? null : x,
|
|
851
|
+
isUnavailable: m.state === "unavailable",
|
|
852
|
+
unit: m.unitOfMeasurement ?? void 0,
|
|
853
853
|
description: V
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
|
-
const
|
|
856
|
+
const n = [], a = [];
|
|
857
857
|
let o = 0, s;
|
|
858
|
-
for (const
|
|
859
|
-
if (!s &&
|
|
858
|
+
for (const m of t) {
|
|
859
|
+
if (!s && m.unitOfMeasurement && (s = m.unitOfMeasurement), m.state === "unavailable") {
|
|
860
860
|
o++, a.push({
|
|
861
|
-
entityId:
|
|
861
|
+
entityId: m.id,
|
|
862
862
|
value: "unavailable",
|
|
863
|
-
friendly_name:
|
|
863
|
+
friendly_name: m.friendlyName
|
|
864
864
|
});
|
|
865
865
|
continue;
|
|
866
866
|
}
|
|
867
|
-
const
|
|
868
|
-
isNaN(
|
|
869
|
-
entityId:
|
|
870
|
-
value:
|
|
871
|
-
friendly_name:
|
|
872
|
-
}) : (
|
|
873
|
-
entityId:
|
|
874
|
-
value:
|
|
875
|
-
friendly_name:
|
|
867
|
+
const x = Number.parseFloat(m.state);
|
|
868
|
+
isNaN(x) ? r || a.push({
|
|
869
|
+
entityId: m.id,
|
|
870
|
+
value: m.state,
|
|
871
|
+
friendly_name: m.friendlyName
|
|
872
|
+
}) : (n.push(x), a.push({
|
|
873
|
+
entityId: m.id,
|
|
874
|
+
value: x,
|
|
875
|
+
friendly_name: m.friendlyName
|
|
876
876
|
}));
|
|
877
877
|
}
|
|
878
|
-
const l = o ===
|
|
878
|
+
const l = o === t.length, d = n.length === 0;
|
|
879
879
|
if (l || d)
|
|
880
880
|
return {
|
|
881
|
-
isGroup:
|
|
881
|
+
isGroup: i,
|
|
882
882
|
state: l ? "unavailable" : "unknown",
|
|
883
883
|
numericValue: null,
|
|
884
884
|
isUnavailable: l,
|
|
@@ -886,310 +886,310 @@ function Nt(e, t = "mean", n = !0) {
|
|
|
886
886
|
description: l ? "Unavailable" : "No numeric values",
|
|
887
887
|
memberValues: a
|
|
888
888
|
};
|
|
889
|
-
let c,
|
|
890
|
-
switch (
|
|
889
|
+
let c, v;
|
|
890
|
+
switch (e) {
|
|
891
891
|
case "min":
|
|
892
|
-
c = Math.min(...
|
|
892
|
+
c = Math.min(...n), v = "Minimum";
|
|
893
893
|
break;
|
|
894
894
|
case "max":
|
|
895
|
-
c = Math.max(...
|
|
895
|
+
c = Math.max(...n), v = "Maximum";
|
|
896
896
|
break;
|
|
897
897
|
case "mean":
|
|
898
|
-
c =
|
|
898
|
+
c = n.reduce((m, x) => m + x, 0) / n.length, v = "Average";
|
|
899
899
|
break;
|
|
900
900
|
case "median": {
|
|
901
|
-
const
|
|
902
|
-
c =
|
|
901
|
+
const m = [...n].sort((V, E) => V - E), x = Math.floor(m.length / 2);
|
|
902
|
+
c = m.length % 2 === 0 ? (m[x - 1] + m[x]) / 2 : m[x], v = "Median";
|
|
903
903
|
break;
|
|
904
904
|
}
|
|
905
905
|
case "sum":
|
|
906
|
-
c =
|
|
906
|
+
c = n.reduce((m, x) => m + x, 0), v = "Sum";
|
|
907
907
|
break;
|
|
908
908
|
case "last":
|
|
909
|
-
c =
|
|
909
|
+
c = n[n.length - 1], v = "Latest";
|
|
910
910
|
break;
|
|
911
911
|
case "range":
|
|
912
|
-
c = Math.max(...
|
|
912
|
+
c = Math.max(...n) - Math.min(...n), v = "Range";
|
|
913
913
|
break;
|
|
914
914
|
case "product":
|
|
915
|
-
c =
|
|
915
|
+
c = n.reduce((m, x) => m * x, 1), v = "Product";
|
|
916
916
|
break;
|
|
917
917
|
case "std_dev": {
|
|
918
|
-
const
|
|
919
|
-
c = Math.sqrt(
|
|
918
|
+
const m = n.reduce((V, E) => V + E, 0) / n.length, x = n.reduce((V, E) => V + (E - m) ** 2, 0) / n.length;
|
|
919
|
+
c = Math.sqrt(x), v = "Std Dev";
|
|
920
920
|
break;
|
|
921
921
|
}
|
|
922
922
|
default:
|
|
923
|
-
c =
|
|
923
|
+
c = n.reduce((m, x) => m + x, 0) / n.length, v = "Average";
|
|
924
924
|
}
|
|
925
|
-
const
|
|
925
|
+
const C = Number.isInteger(c) ? c.toString() : c.toFixed(1);
|
|
926
926
|
return {
|
|
927
|
-
isGroup:
|
|
928
|
-
state:
|
|
927
|
+
isGroup: i,
|
|
928
|
+
state: C,
|
|
929
929
|
numericValue: c,
|
|
930
930
|
isUnavailable: !1,
|
|
931
931
|
unit: s,
|
|
932
|
-
description: `${
|
|
932
|
+
description: `${v} of ${n.length}`,
|
|
933
933
|
memberValues: a
|
|
934
934
|
};
|
|
935
935
|
}
|
|
936
|
-
function
|
|
937
|
-
if (
|
|
938
|
-
const
|
|
939
|
-
if (
|
|
940
|
-
const [
|
|
941
|
-
return `rgb(${Math.round(
|
|
936
|
+
function kt(t) {
|
|
937
|
+
if (t.state !== "on") return "rgb(100, 100, 100)";
|
|
938
|
+
const r = (t.attributes?.brightness ?? 255) / 255;
|
|
939
|
+
if (t.attributes?.rgb_color) {
|
|
940
|
+
const [i, n, a] = t.attributes.rgb_color;
|
|
941
|
+
return `rgb(${Math.round(i * r)}, ${Math.round(n * r)}, ${Math.round(a * r)})`;
|
|
942
942
|
}
|
|
943
|
-
if (
|
|
944
|
-
const
|
|
943
|
+
if (t.attributes?.color_temp) {
|
|
944
|
+
const n = 1e6 / t.attributes.color_temp / 100;
|
|
945
945
|
let a, o, s;
|
|
946
|
-
return
|
|
946
|
+
return n <= 66 ? (a = 255, o = n <= 19 ? 0 : 99.4708025861 * Math.log(n - 10) - 161.1195681661, s = n <= 19 ? 0 : n <= 66 ? 138.5177312231 * Math.log(n - 10) - 305.0447927307 : 255) : (a = 329.698727446 * (n - 60) ** -0.1332047592, o = 288.1221695283 * (n - 60) ** -0.0755148492, s = 255), a = Math.max(0, Math.min(255, a)) * r, o = Math.max(0, Math.min(255, o)) * r, s = Math.max(0, Math.min(255, s)) * r, `rgb(${Math.round(a)}, ${Math.round(o)}, ${Math.round(s)})`;
|
|
947
947
|
}
|
|
948
|
-
return `rgb(${Math.round(255 *
|
|
948
|
+
return `rgb(${Math.round(255 * r)}, ${Math.round(220 * r)}, ${Math.round(180 * r)})`;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
return
|
|
950
|
+
function Ae(t) {
|
|
951
|
+
return t ? t.state !== "unavailable" && t.state !== "unknown" : !1;
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
if (!
|
|
955
|
-
if (["on", "open", "locked", "home", "playing", "active"].includes(
|
|
953
|
+
function We(t) {
|
|
954
|
+
if (!t) return !1;
|
|
955
|
+
if (["on", "open", "locked", "home", "playing", "active"].includes(t.state))
|
|
956
956
|
return !0;
|
|
957
|
-
if (
|
|
958
|
-
const
|
|
959
|
-
return !isNaN(
|
|
957
|
+
if (t.domain === "sensor") {
|
|
958
|
+
const e = Number.parseFloat(t.state);
|
|
959
|
+
return !isNaN(e) && e > 0;
|
|
960
960
|
}
|
|
961
961
|
return !1;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
964
|
-
return
|
|
963
|
+
function jn(t, e = "unknown") {
|
|
964
|
+
return t?.state ?? e;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
return
|
|
966
|
+
function Fn(t, e, r) {
|
|
967
|
+
return t?.attributes ? t.attributes[e] ?? r : r;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
970
|
-
return
|
|
969
|
+
function Un(t, e) {
|
|
970
|
+
return t.filter((r) => r.state === e).length;
|
|
971
971
|
}
|
|
972
|
-
function
|
|
973
|
-
return
|
|
972
|
+
function Yn(t) {
|
|
973
|
+
return t.filter(Ae).length;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
return
|
|
975
|
+
function Kn(t) {
|
|
976
|
+
return t.filter(We).length;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
return
|
|
978
|
+
function qn(t, e) {
|
|
979
|
+
return t.length > 0 && t.every((r) => r.state === e);
|
|
980
980
|
}
|
|
981
|
-
function Xn(
|
|
982
|
-
return
|
|
981
|
+
function Xn(t, e) {
|
|
982
|
+
return t.some((r) => r.state === e);
|
|
983
983
|
}
|
|
984
|
-
function
|
|
985
|
-
const { decimals:
|
|
986
|
-
if (typeof
|
|
987
|
-
return
|
|
988
|
-
if (
|
|
989
|
-
return
|
|
990
|
-
let a =
|
|
991
|
-
|
|
984
|
+
function Re(t, e, r) {
|
|
985
|
+
const { decimals: i, scale: n = !0 } = r || {};
|
|
986
|
+
if (typeof t == "string")
|
|
987
|
+
return e ? `${t}${e}` : t;
|
|
988
|
+
if (t == null || Number.isNaN(t))
|
|
989
|
+
return e ? `--${e}` : "--";
|
|
990
|
+
let a = t, o = e || "";
|
|
991
|
+
n && e && (e === "W" || e === "kW" || e === "MW") && (t >= 1e6 ? (a = t / 1e6, o = "MW") : t >= 1e3 ? (a = t / 1e3, o = "kW") : o = "W"), n && e && (e === "B" || e === "KB" || e === "MB" || e === "GB") && (t >= 1073741824 ? (a = t / 1073741824, o = "GB") : t >= 1048576 ? (a = t / 1048576, o = "MB") : t >= 1024 ? (a = t / 1024, o = "KB") : o = "B");
|
|
992
992
|
let s;
|
|
993
|
-
return
|
|
993
|
+
return i !== void 0 ? s = a.toFixed(i) : a !== t ? s = a.toFixed(1) : Number.isInteger(t) ? s = t.toString() : s = Number.parseFloat(t.toFixed(2)).toString(), o ? `${s}${o}` : s;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
996
|
-
return
|
|
995
|
+
function Ie(t, e) {
|
|
996
|
+
return t == null || isNaN(t) ? null : e === "°C" ? t < 10 ? "Cold" : t < 18 ? "Cool" : t < 24 ? "Comfortable" : t < 28 ? "Warm" : "Hot" : e === "°F" ? t < 50 ? "Cold" : t < 64 ? "Cool" : t < 75 ? "Comfortable" : t < 82 ? "Warm" : "Hot" : e === "%" ? t < 20 ? "Very Low" : t < 40 ? "Low" : t < 60 ? "Medium" : t < 80 ? "High" : "Very High" : e === "ppm" ? t < 400 ? "Excellent" : t < 600 ? "Good" : t < 1e3 ? "Acceptable" : t < 1500 ? "Mediocre" : "Poor" : e === "lx" ? t < 50 ? "Dark" : t < 200 ? "Dim" : t < 500 ? "Moderate" : t < 1e3 ? "Bright" : "Very Bright" : e === "AQI" ? t <= 50 ? "Good" : t <= 100 ? "Moderate" : t <= 150 ? "Unhealthy for Sensitive" : t <= 200 ? "Unhealthy" : t <= 300 ? "Very Unhealthy" : "Hazardous" : e === "dB" ? t < 30 ? "Very Quiet" : t < 50 ? "Quiet" : t < 70 ? "Moderate" : t < 85 ? "Loud" : "Very Loud" : null;
|
|
997
997
|
}
|
|
998
|
-
var
|
|
999
|
-
function
|
|
1000
|
-
const
|
|
998
|
+
var He = /* @__PURE__ */ w("<div><div>"), Ge = /* @__PURE__ */ w("<div>");
|
|
999
|
+
function Pe(t) {
|
|
1000
|
+
const e = I();
|
|
1001
1001
|
return (() => {
|
|
1002
|
-
var
|
|
1003
|
-
return
|
|
1004
|
-
var
|
|
1005
|
-
return () =>
|
|
1006
|
-
var a =
|
|
1007
|
-
return
|
|
1008
|
-
var s =
|
|
1009
|
-
return s !== o.e &&
|
|
1002
|
+
var r = He(), i = r.firstChild;
|
|
1003
|
+
return b(i, () => Re(t.value, t.unit)), b(r, (() => {
|
|
1004
|
+
var n = _(() => !!(t.interpret && typeof t.value == "number"));
|
|
1005
|
+
return () => n() && (() => {
|
|
1006
|
+
var a = Ge();
|
|
1007
|
+
return b(a, () => Ie(t.value, t.unit)), z((o) => {
|
|
1008
|
+
var s = k("text-foreground/60", F.subtitle(e.size())), l = W.S1(e.size());
|
|
1009
|
+
return s !== o.e && S(a, o.e = s), l !== o.t && M(a, "margin-top", o.t = l), o;
|
|
1010
1010
|
}, {
|
|
1011
1011
|
e: void 0,
|
|
1012
1012
|
t: void 0
|
|
1013
1013
|
}), a;
|
|
1014
1014
|
})();
|
|
1015
|
-
})(), null),
|
|
1016
|
-
var a =
|
|
1017
|
-
return a !==
|
|
1015
|
+
})(), null), z((n) => {
|
|
1016
|
+
var a = k("flex flex-col", t.class), o = k("font-bold text-foreground", F.value(e.size()));
|
|
1017
|
+
return a !== n.e && S(r, n.e = a), o !== n.t && S(i, n.t = o), n;
|
|
1018
1018
|
}, {
|
|
1019
1019
|
e: void 0,
|
|
1020
1020
|
t: void 0
|
|
1021
|
-
}),
|
|
1021
|
+
}), r;
|
|
1022
1022
|
})();
|
|
1023
1023
|
}
|
|
1024
|
-
var
|
|
1025
|
-
function
|
|
1026
|
-
const
|
|
1027
|
-
return
|
|
1024
|
+
var Le = /* @__PURE__ */ w('<div><div><div class="relative h-full w-full">'), Be = /* @__PURE__ */ w('<div class="pointer-events-none absolute inset-0"><div>'), je = /* @__PURE__ */ w('<div class="pointer-events-none absolute inset-0 animate-pulse bg-blue-500/20">'), Fe = /* @__PURE__ */ w('<div class="flex h-full w-full flex-col items-center justify-center gap-2 text-center">'), Ue = /* @__PURE__ */ w('<div class="flex items-center justify-center text-white/30">'), Ye = /* @__PURE__ */ w('<h3 class="font-semibold text-sm text-white/60">'), Ke = /* @__PURE__ */ w('<p class="text-white/50 text-xs">');
|
|
1025
|
+
function qe(t, e) {
|
|
1026
|
+
const r = t * e;
|
|
1027
|
+
return r <= 2 ? "xs" : r <= 4 ? "sm" : r <= 8 ? "md" : r <= 18 ? "lg" : "xl";
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1029
|
+
function Xe(t, e) {
|
|
1030
|
+
return t > e ? "horizontal" : e > t ? "vertical" : "square";
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return
|
|
1032
|
+
function Je(t, e) {
|
|
1033
|
+
return e >= 150 ? "vertical" : t > e ? "horizontal" : e > t ? "vertical" : "square";
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let
|
|
1037
|
-
const
|
|
1035
|
+
function Ze(t) {
|
|
1036
|
+
let e;
|
|
1037
|
+
const r = It(() => e), i = 2, [n, a] = j(0), [o, s] = j(0);
|
|
1038
1038
|
q(() => {
|
|
1039
|
-
const
|
|
1040
|
-
(Math.abs(
|
|
1039
|
+
const f = Math.round(r.width ?? 0), u = Math.round(r.height ?? 0), A = yt(n), p = yt(o);
|
|
1040
|
+
(Math.abs(f - A) > i || Math.abs(u - p) > i) && (a(f), s(u));
|
|
1041
1041
|
});
|
|
1042
|
-
const l =
|
|
1043
|
-
if (
|
|
1044
|
-
return typeof
|
|
1045
|
-
}), d =
|
|
1046
|
-
width:
|
|
1042
|
+
const l = N(() => {
|
|
1043
|
+
if (t.variant)
|
|
1044
|
+
return typeof t.variant == "string" ? Kt(t.variant) : t.variant;
|
|
1045
|
+
}), d = N(() => ({
|
|
1046
|
+
width: n(),
|
|
1047
1047
|
height: o(),
|
|
1048
|
-
gridWidth: Math.max(1, Math.round(
|
|
1048
|
+
gridWidth: Math.max(1, Math.round(n() / 150)),
|
|
1049
1049
|
gridHeight: Math.max(1, Math.round(o() / 75))
|
|
1050
1050
|
}), void 0, {
|
|
1051
|
-
equals: (
|
|
1052
|
-
}), c =
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1055
|
-
}),
|
|
1056
|
-
const
|
|
1057
|
-
return
|
|
1058
|
-
}),
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1061
|
-
}),
|
|
1062
|
-
|
|
1063
|
-
|
|
1051
|
+
equals: (f, u) => f.width === u.width && f.height === u.height && f.gridWidth === u.gridWidth && f.gridHeight === u.gridHeight
|
|
1052
|
+
}), c = N(() => {
|
|
1053
|
+
const f = d();
|
|
1054
|
+
return qe(f.gridWidth, f.gridHeight);
|
|
1055
|
+
}), v = N(() => {
|
|
1056
|
+
const f = d();
|
|
1057
|
+
return Xe(f.width, f.height);
|
|
1058
|
+
}), C = N(() => {
|
|
1059
|
+
const f = d();
|
|
1060
|
+
return Je(f.width, f.height);
|
|
1061
|
+
}), m = Ct(ht), x = m;
|
|
1062
|
+
x?._isStub?.() && x._bridge && (q(() => {
|
|
1063
|
+
x._bridge.setSize(c());
|
|
1064
1064
|
}), q(() => {
|
|
1065
|
-
|
|
1065
|
+
x._bridge.setOrientation(v());
|
|
1066
1066
|
}), q(() => {
|
|
1067
|
-
|
|
1067
|
+
x._bridge.setContentLayout(C());
|
|
1068
1068
|
}), q(() => {
|
|
1069
|
-
|
|
1069
|
+
x._bridge.setDimensions(d());
|
|
1070
1070
|
}), q(() => {
|
|
1071
|
-
|
|
1071
|
+
x._bridge.setIsStub(!1);
|
|
1072
1072
|
}));
|
|
1073
1073
|
const V = {
|
|
1074
1074
|
size: c,
|
|
1075
|
-
orientation:
|
|
1076
|
-
contentLayout:
|
|
1075
|
+
orientation: v,
|
|
1076
|
+
contentLayout: C,
|
|
1077
1077
|
dimensions: d,
|
|
1078
|
-
isEditMode: () =>
|
|
1079
|
-
updateConfig:
|
|
1078
|
+
isEditMode: () => t.isEditMode ?? !1,
|
|
1079
|
+
updateConfig: m?.updateConfig ?? (() => {
|
|
1080
1080
|
})
|
|
1081
|
-
},
|
|
1081
|
+
}, E = "bg-gradient-to-br from-gray-500/20 to-gray-600/20", R = N(() => t.emptyState && !t.gradient ? E : t.gradient), K = N(() => ({
|
|
1082
1082
|
"container-type": "size",
|
|
1083
1083
|
"container-name": "widget",
|
|
1084
|
-
"touch-action":
|
|
1084
|
+
"touch-action": t.gestures && !t.isEditMode ? t.gestures.touchAction() : void 0,
|
|
1085
1085
|
...l()?.styles?.container,
|
|
1086
1086
|
...l()?.styles?.cssVars || {}
|
|
1087
|
-
})),
|
|
1088
|
-
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
},
|
|
1094
|
-
|
|
1095
|
-
},
|
|
1096
|
-
|
|
1087
|
+
})), B = () => !!t.gestures && !t.isEditMode, h = (f) => {
|
|
1088
|
+
B() && t.gestures?.onPointerEnter(f);
|
|
1089
|
+
}, y = (f) => {
|
|
1090
|
+
B() && t.gestures?.onPointerDown(f);
|
|
1091
|
+
}, $ = (f) => {
|
|
1092
|
+
B() && t.gestures?.onPointerMove(f);
|
|
1093
|
+
}, O = (f) => {
|
|
1094
|
+
B() && t.gestures?.onPointerUp(f);
|
|
1095
|
+
}, H = (f) => {
|
|
1096
|
+
B() && t.gestures?.onPointerCancel(f);
|
|
1097
1097
|
};
|
|
1098
|
-
return T(
|
|
1098
|
+
return T(ht.Provider, {
|
|
1099
1099
|
value: V,
|
|
1100
1100
|
get children() {
|
|
1101
|
-
var
|
|
1102
|
-
return
|
|
1103
|
-
|
|
1104
|
-
},
|
|
1105
|
-
var
|
|
1106
|
-
return () =>
|
|
1107
|
-
var
|
|
1108
|
-
return
|
|
1109
|
-
var
|
|
1110
|
-
return
|
|
1101
|
+
var f = Le(), u = f.firstChild, A = u.firstChild;
|
|
1102
|
+
return nt(f, "pointercancel", H), nt(f, "pointerup", O), nt(f, "pointermove", $), nt(f, "pointerdown", y), nt(f, "pointerenter", h), Vt((p) => {
|
|
1103
|
+
e = p, t.gestures?.bindElement(p);
|
|
1104
|
+
}, f), b(u, (() => {
|
|
1105
|
+
var p = _(() => !!t.backgroundGlow);
|
|
1106
|
+
return () => p() && (() => {
|
|
1107
|
+
var G = Be(), Q = G.firstChild;
|
|
1108
|
+
return z((P) => {
|
|
1109
|
+
var J = U.BACKGROUND, ut = k("absolute inset-0 opacity-20 blur-2xl", t.backgroundGlow);
|
|
1110
|
+
return J !== P.e && M(G, "z-index", P.e = J), ut !== P.t && S(Q, P.t = ut), P;
|
|
1111
1111
|
}, {
|
|
1112
1112
|
e: void 0,
|
|
1113
1113
|
t: void 0
|
|
1114
|
-
}),
|
|
1114
|
+
}), G;
|
|
1115
1115
|
})();
|
|
1116
|
-
})(),
|
|
1117
|
-
var
|
|
1118
|
-
return () =>
|
|
1116
|
+
})(), A), b(A, (() => {
|
|
1117
|
+
var p = _(() => !!t.emptyState);
|
|
1118
|
+
return () => p() ? T(Qe, {
|
|
1119
1119
|
get icon() {
|
|
1120
|
-
return
|
|
1120
|
+
return t.emptyState.icon;
|
|
1121
1121
|
},
|
|
1122
1122
|
get title() {
|
|
1123
|
-
return
|
|
1123
|
+
return t.emptyState.title;
|
|
1124
1124
|
},
|
|
1125
1125
|
get message() {
|
|
1126
|
-
return
|
|
1126
|
+
return t.emptyState.message;
|
|
1127
1127
|
}
|
|
1128
|
-
}) :
|
|
1129
|
-
})()),
|
|
1130
|
-
var
|
|
1131
|
-
return () =>
|
|
1132
|
-
var
|
|
1133
|
-
return
|
|
1128
|
+
}) : t.children;
|
|
1129
|
+
})()), b(u, (() => {
|
|
1130
|
+
var p = _(() => !!t.loading);
|
|
1131
|
+
return () => p() && (() => {
|
|
1132
|
+
var G = je();
|
|
1133
|
+
return z((Q) => M(G, "z-index", U.OVERLAY)), G;
|
|
1134
1134
|
})();
|
|
1135
|
-
})(), null),
|
|
1136
|
-
var
|
|
1135
|
+
})(), null), z((p) => {
|
|
1136
|
+
var G = k(
|
|
1137
1137
|
"relative h-full w-full select-none rounded-xl border border-border/50",
|
|
1138
1138
|
// Variant styles (lowest priority)
|
|
1139
1139
|
l()?.styles?.class,
|
|
1140
1140
|
// Custom class (highest priority)
|
|
1141
|
-
|
|
1142
|
-
), Q =
|
|
1141
|
+
t.class
|
|
1142
|
+
), Q = K(), P = k(
|
|
1143
1143
|
"relative h-full w-full overflow-hidden rounded-xl",
|
|
1144
1144
|
// Gradient prop (overrides variant, auto-applied for empty state)
|
|
1145
|
-
|
|
1146
|
-
),
|
|
1147
|
-
return
|
|
1145
|
+
R()
|
|
1146
|
+
), J = U.CONTENT;
|
|
1147
|
+
return G !== p.e && S(f, p.e = G), p.t = ot(f, Q, p.t), P !== p.a && S(u, p.a = P), J !== p.o && M(A, "z-index", p.o = J), p;
|
|
1148
1148
|
}, {
|
|
1149
1149
|
e: void 0,
|
|
1150
1150
|
t: void 0,
|
|
1151
1151
|
a: void 0,
|
|
1152
1152
|
o: void 0
|
|
1153
|
-
}),
|
|
1153
|
+
}), f;
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function Qe(t) {
|
|
1158
1158
|
return (() => {
|
|
1159
|
-
var
|
|
1160
|
-
return
|
|
1161
|
-
var
|
|
1162
|
-
return () =>
|
|
1163
|
-
var
|
|
1164
|
-
return
|
|
1159
|
+
var e = Fe();
|
|
1160
|
+
return b(e, (() => {
|
|
1161
|
+
var r = _(() => !!t.icon);
|
|
1162
|
+
return () => r() && (() => {
|
|
1163
|
+
var i = Ue();
|
|
1164
|
+
return b(i, () => t.icon), i;
|
|
1165
1165
|
})();
|
|
1166
|
-
})(), null),
|
|
1167
|
-
var
|
|
1168
|
-
return () =>
|
|
1169
|
-
var
|
|
1170
|
-
return
|
|
1166
|
+
})(), null), b(e, (() => {
|
|
1167
|
+
var r = _(() => !!t.title);
|
|
1168
|
+
return () => r() && (() => {
|
|
1169
|
+
var i = Ye();
|
|
1170
|
+
return b(i, () => t.title), i;
|
|
1171
1171
|
})();
|
|
1172
|
-
})(), null),
|
|
1173
|
-
var
|
|
1174
|
-
return () =>
|
|
1175
|
-
var
|
|
1176
|
-
return
|
|
1172
|
+
})(), null), b(e, (() => {
|
|
1173
|
+
var r = _(() => !!t.message);
|
|
1174
|
+
return () => r() && (() => {
|
|
1175
|
+
var i = Ke();
|
|
1176
|
+
return b(i, () => t.message), i;
|
|
1177
1177
|
})();
|
|
1178
|
-
})(), null),
|
|
1178
|
+
})(), null), e;
|
|
1179
1179
|
})();
|
|
1180
1180
|
}
|
|
1181
|
-
const Y =
|
|
1182
|
-
Y.Content =
|
|
1183
|
-
Y.Icon =
|
|
1184
|
-
Y.Title =
|
|
1185
|
-
Y.Subtitle =
|
|
1186
|
-
Y.Status =
|
|
1187
|
-
Y.Value =
|
|
1188
|
-
Y.Metrics =
|
|
1189
|
-
Y.EmptyState =
|
|
1190
|
-
Y.SliderFill =
|
|
1191
|
-
var
|
|
1192
|
-
const
|
|
1181
|
+
const Y = Ze;
|
|
1182
|
+
Y.Content = oe;
|
|
1183
|
+
Y.Icon = ye;
|
|
1184
|
+
Y.Title = Oe;
|
|
1185
|
+
Y.Subtitle = _e;
|
|
1186
|
+
Y.Status = ze;
|
|
1187
|
+
Y.Value = Pe;
|
|
1188
|
+
Y.Metrics = _t;
|
|
1189
|
+
Y.EmptyState = ge;
|
|
1190
|
+
Y.SliderFill = ne;
|
|
1191
|
+
var tn = /* @__PURE__ */ w("<div><div>");
|
|
1192
|
+
const en = {
|
|
1193
1193
|
blue: "bg-blue-500/30",
|
|
1194
1194
|
green: "bg-green-500/30",
|
|
1195
1195
|
red: "bg-red-500/30",
|
|
@@ -1197,69 +1197,69 @@ const Qt = {
|
|
|
1197
1197
|
purple: "bg-purple-500/30",
|
|
1198
1198
|
gray: "bg-gray-500/30"
|
|
1199
1199
|
};
|
|
1200
|
-
function
|
|
1201
|
-
const
|
|
1200
|
+
function Jn(t) {
|
|
1201
|
+
const e = () => en[t.color] ?? t.color;
|
|
1202
1202
|
return (() => {
|
|
1203
|
-
var
|
|
1204
|
-
return
|
|
1205
|
-
var a =
|
|
1206
|
-
return a !==
|
|
1203
|
+
var r = tn(), i = r.firstChild;
|
|
1204
|
+
return z((n) => {
|
|
1205
|
+
var a = k("pointer-events-none absolute inset-0", t.class), o = U.BACKGROUND, s = k("absolute inset-0 opacity-40 blur-3xl", e());
|
|
1206
|
+
return a !== n.e && S(r, n.e = a), o !== n.t && M(r, "z-index", n.t = o), s !== n.a && S(i, n.a = s), n;
|
|
1207
1207
|
}, {
|
|
1208
1208
|
e: void 0,
|
|
1209
1209
|
t: void 0,
|
|
1210
1210
|
a: void 0
|
|
1211
|
-
}),
|
|
1211
|
+
}), r;
|
|
1212
1212
|
})();
|
|
1213
1213
|
}
|
|
1214
|
-
var
|
|
1215
|
-
function
|
|
1216
|
-
const
|
|
1217
|
-
const
|
|
1218
|
-
return W[
|
|
1214
|
+
var nn = /* @__PURE__ */ w("<div>");
|
|
1215
|
+
function Zn(t) {
|
|
1216
|
+
const e = I(), r = () => {
|
|
1217
|
+
const i = t.spacing ?? "S2";
|
|
1218
|
+
return W[i](e.size());
|
|
1219
1219
|
};
|
|
1220
1220
|
return (() => {
|
|
1221
|
-
var
|
|
1222
|
-
return
|
|
1223
|
-
var a =
|
|
1224
|
-
return a !==
|
|
1221
|
+
var i = nn();
|
|
1222
|
+
return b(i, () => t.children), z((n) => {
|
|
1223
|
+
var a = k("flex flex-col", t.class), o = r();
|
|
1224
|
+
return a !== n.e && S(i, n.e = a), o !== n.t && M(i, "gap", n.t = o), n;
|
|
1225
1225
|
}, {
|
|
1226
1226
|
e: void 0,
|
|
1227
1227
|
t: void 0
|
|
1228
|
-
}),
|
|
1228
|
+
}), i;
|
|
1229
1229
|
})();
|
|
1230
1230
|
}
|
|
1231
|
-
var
|
|
1232
|
-
function
|
|
1231
|
+
var rn = /* @__PURE__ */ w('<span class="inline-flex size-3.5 shrink-0 items-center">'), an = /* @__PURE__ */ w("<button type=button>"), on = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z">'), sn = /* @__PURE__ */ w('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No edit options available'), ln = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><line x1=4 y1=21 x2=4 y2=14></line><line x1=4 y1=10 x2=4 y2=3></line><line x1=12 y1=21 x2=12 y2=12></line><line x1=12 y1=8 x2=12 y2=3></line><line x1=20 y1=21 x2=20 y2=16></line><line x1=20 y1=12 x2=20 y2=3></line><line x1=1 y1=14 x2=7 y2=14></line><line x1=9 y1=8 x2=15 y2=8></line><line x1=17 y1=16 x2=23 y2=16>'), cn = /* @__PURE__ */ w('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No additional controls'), un = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4">'), dn = /* @__PURE__ */ w('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No debug information available'), gn = /* @__PURE__ */ w('<div class="min-w-0 shrink-0">'), mn = /* @__PURE__ */ w('<div class="flex items-center gap-2"><div class="flex h-8 items-center rounded-lg border border-border/50 bg-muted/30 p-0.5">'), fn = /* @__PURE__ */ w('<div class="min-h-0 flex-1 overflow-y-auto [scrollbar-gutter:stable]">'), hn = /* @__PURE__ */ w('<div class="flex shrink-0 items-center justify-end gap-2 border-border/50 border-t pt-3">');
|
|
1232
|
+
function bn(t) {
|
|
1233
1233
|
return (() => {
|
|
1234
|
-
var
|
|
1235
|
-
return
|
|
1234
|
+
var e = an();
|
|
1235
|
+
return e.$$click = () => t.onClick(), b(e, T(et, {
|
|
1236
1236
|
get when() {
|
|
1237
|
-
return
|
|
1237
|
+
return t.isActive;
|
|
1238
1238
|
},
|
|
1239
1239
|
get children() {
|
|
1240
|
-
var
|
|
1241
|
-
return
|
|
1240
|
+
var r = rn();
|
|
1241
|
+
return b(r, () => t.icon), r;
|
|
1242
1242
|
}
|
|
1243
|
-
}), null),
|
|
1243
|
+
}), null), b(e, () => t.label, null), z(() => S(e, k("flex cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-xs transition-all duration-300 ease-in-out", t.isActive ? "gap-1.5 bg-foreground/10 font-semibold text-foreground shadow-sm" : "gap-0 text-muted-foreground hover:bg-foreground/5 hover:text-foreground"))), e;
|
|
1244
1244
|
})();
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const [
|
|
1248
|
-
q(
|
|
1249
|
-
u &&
|
|
1246
|
+
function Qn(t) {
|
|
1247
|
+
const [e] = Tt(t, ["open", "onOpenChange", "title", "onSave", "hasUnsavedChanges", "onDelete", "editContent", "controlsContent", "debugContent", "debugData", "tabs", "class", "maxWidth", "defaultTab", "headerActions", "configSchema", "config", "onConfigSave", "ResponsiveDialog", "ResponsiveDialogContent", "ResponsiveDialogHeader", "ResponsiveDialogTitle", "ResponsiveDialogDescription", "Button", "SchemaForm"]), r = () => !!e.configSchema && !!e.config && !!e.onConfigSave && !!e.SchemaForm, [i, n] = j({}), [a, o] = j(null);
|
|
1248
|
+
q(wt(() => e.config, (u) => {
|
|
1249
|
+
u && n({
|
|
1250
1250
|
...u
|
|
1251
1251
|
});
|
|
1252
|
-
})), q(
|
|
1253
|
-
u && o(
|
|
1252
|
+
})), q(wt(() => e.configSchema, (u) => {
|
|
1253
|
+
u && o(Mt(u));
|
|
1254
1254
|
}));
|
|
1255
|
-
const s = () =>
|
|
1256
|
-
!u &&
|
|
1257
|
-
...
|
|
1258
|
-
}),
|
|
1255
|
+
const s = () => r() && JSON.stringify(i()) !== JSON.stringify(e.config), l = (u) => {
|
|
1256
|
+
!u && e.config && n({
|
|
1257
|
+
...e.config
|
|
1258
|
+
}), e.onOpenChange(u);
|
|
1259
1259
|
}, d = () => {
|
|
1260
|
-
|
|
1261
|
-
}, [c,
|
|
1262
|
-
const u =
|
|
1260
|
+
e.onConfigSave?.(i());
|
|
1261
|
+
}, [c, v] = j(e.defaultTab ?? "controls"), C = () => {
|
|
1262
|
+
const u = e.maxWidth ?? "3xl";
|
|
1263
1263
|
return {
|
|
1264
1264
|
sm: "max-w-sm",
|
|
1265
1265
|
md: "max-w-md",
|
|
@@ -1269,136 +1269,136 @@ function Jn(e) {
|
|
|
1269
1269
|
"3xl": "max-w-3xl",
|
|
1270
1270
|
"4xl": "max-w-4xl"
|
|
1271
1271
|
}[u];
|
|
1272
|
-
},
|
|
1273
|
-
if (
|
|
1272
|
+
}, m = () => {
|
|
1273
|
+
if (e.tabs) return e.tabs;
|
|
1274
1274
|
const u = [];
|
|
1275
1275
|
return u.push({
|
|
1276
1276
|
id: "edit",
|
|
1277
1277
|
label: "Edit",
|
|
1278
|
-
icon:
|
|
1279
|
-
content:
|
|
1278
|
+
icon: on(),
|
|
1279
|
+
content: e.editContent ?? (r() && a() ? T($, {
|
|
1280
1280
|
get schema() {
|
|
1281
1281
|
return a();
|
|
1282
1282
|
},
|
|
1283
1283
|
get data() {
|
|
1284
|
-
return
|
|
1284
|
+
return i();
|
|
1285
1285
|
},
|
|
1286
|
-
onChange:
|
|
1287
|
-
}) :
|
|
1286
|
+
onChange: n
|
|
1287
|
+
}) : sn())
|
|
1288
1288
|
}), u.push({
|
|
1289
1289
|
id: "controls",
|
|
1290
1290
|
label: "Controls",
|
|
1291
|
-
icon:
|
|
1292
|
-
content:
|
|
1291
|
+
icon: ln(),
|
|
1292
|
+
content: e.controlsContent ?? cn()
|
|
1293
1293
|
}), u.push({
|
|
1294
1294
|
id: "debug",
|
|
1295
1295
|
label: "Debug",
|
|
1296
|
-
icon:
|
|
1297
|
-
content:
|
|
1296
|
+
icon: un(),
|
|
1297
|
+
content: e.debugContent ?? dn()
|
|
1298
1298
|
}), u;
|
|
1299
|
-
},
|
|
1300
|
-
if (
|
|
1299
|
+
}, x = async () => {
|
|
1300
|
+
if (e.debugData !== void 0)
|
|
1301
1301
|
try {
|
|
1302
|
-
const u = typeof
|
|
1302
|
+
const u = typeof e.debugData == "string" ? e.debugData : JSON.stringify(e.debugData, null, 2);
|
|
1303
1303
|
await navigator.clipboard.writeText(u);
|
|
1304
1304
|
} catch {
|
|
1305
1305
|
}
|
|
1306
1306
|
}, V = () => {
|
|
1307
|
-
const u =
|
|
1308
|
-
return u.find((
|
|
1309
|
-
},
|
|
1310
|
-
return T(
|
|
1307
|
+
const u = m();
|
|
1308
|
+
return u.find((p) => p.id === c())?.content ?? u[0]?.content;
|
|
1309
|
+
}, E = e.ResponsiveDialog, R = e.ResponsiveDialogContent, K = e.ResponsiveDialogHeader, B = e.ResponsiveDialogTitle, h = e.ResponsiveDialogDescription, y = e.Button, $ = e.SchemaForm, O = (u) => r() ? l(u) : e.onOpenChange(u), H = () => r() ? s() : e.hasUnsavedChanges, f = () => r() ? d : e.onSave;
|
|
1310
|
+
return T(E, {
|
|
1311
1311
|
get open() {
|
|
1312
|
-
return
|
|
1312
|
+
return e.open;
|
|
1313
1313
|
},
|
|
1314
|
-
onOpenChange: (u) =>
|
|
1314
|
+
onOpenChange: (u) => O(u),
|
|
1315
1315
|
get children() {
|
|
1316
|
-
return T(
|
|
1316
|
+
return T(R, {
|
|
1317
1317
|
get class() {
|
|
1318
|
-
return
|
|
1318
|
+
return k(C(), e.class);
|
|
1319
1319
|
},
|
|
1320
1320
|
get children() {
|
|
1321
|
-
return [T(
|
|
1321
|
+
return [T(K, {
|
|
1322
1322
|
class: "flex flex-row items-center justify-between gap-3",
|
|
1323
1323
|
get children() {
|
|
1324
1324
|
return [(() => {
|
|
1325
|
-
var u =
|
|
1326
|
-
return
|
|
1325
|
+
var u = gn();
|
|
1326
|
+
return b(u, T(B, {
|
|
1327
1327
|
class: "truncate leading-tight",
|
|
1328
1328
|
get children() {
|
|
1329
|
-
return
|
|
1329
|
+
return e.title;
|
|
1330
1330
|
}
|
|
1331
|
-
}), null),
|
|
1331
|
+
}), null), b(u, T(h, {
|
|
1332
1332
|
class: "sr-only",
|
|
1333
1333
|
children: "Widget configuration dialog"
|
|
1334
1334
|
}), null), u;
|
|
1335
1335
|
})(), (() => {
|
|
1336
|
-
var u =
|
|
1337
|
-
return
|
|
1336
|
+
var u = mn(), A = u.firstChild;
|
|
1337
|
+
return b(A, () => m().map((p) => T(bn, {
|
|
1338
1338
|
get icon() {
|
|
1339
|
-
return
|
|
1339
|
+
return p.icon;
|
|
1340
1340
|
},
|
|
1341
1341
|
get label() {
|
|
1342
|
-
return
|
|
1342
|
+
return p.label;
|
|
1343
1343
|
},
|
|
1344
1344
|
get isActive() {
|
|
1345
|
-
return c() ===
|
|
1345
|
+
return c() === p.id;
|
|
1346
1346
|
},
|
|
1347
|
-
onClick: () =>
|
|
1348
|
-
}))),
|
|
1347
|
+
onClick: () => v(p.id)
|
|
1348
|
+
}))), b(u, T(et, {
|
|
1349
1349
|
get when() {
|
|
1350
|
-
return
|
|
1350
|
+
return e.headerActions;
|
|
1351
1351
|
},
|
|
1352
1352
|
get children() {
|
|
1353
|
-
return
|
|
1353
|
+
return e.headerActions;
|
|
1354
1354
|
}
|
|
1355
1355
|
}), null), u;
|
|
1356
1356
|
})()];
|
|
1357
1357
|
}
|
|
1358
1358
|
}), (() => {
|
|
1359
|
-
var u =
|
|
1360
|
-
return
|
|
1361
|
-
})(), T(
|
|
1359
|
+
var u = fn();
|
|
1360
|
+
return b(u, V), u;
|
|
1361
|
+
})(), T(et, {
|
|
1362
1362
|
get when() {
|
|
1363
|
-
return
|
|
1363
|
+
return _(() => c() === "edit")() && (f() || e.onDelete) || c() === "debug" && e.debugData !== void 0;
|
|
1364
1364
|
},
|
|
1365
1365
|
get children() {
|
|
1366
|
-
var u =
|
|
1367
|
-
return
|
|
1366
|
+
var u = hn();
|
|
1367
|
+
return b(u, T(et, {
|
|
1368
1368
|
get when() {
|
|
1369
|
-
return
|
|
1369
|
+
return _(() => c() === "edit")() && e.onDelete;
|
|
1370
1370
|
},
|
|
1371
1371
|
get children() {
|
|
1372
|
-
return T(
|
|
1372
|
+
return T(y, {
|
|
1373
1373
|
size: "sm",
|
|
1374
1374
|
variant: "destructive",
|
|
1375
|
-
onClick: () =>
|
|
1375
|
+
onClick: () => e.onDelete?.(),
|
|
1376
1376
|
children: "Delete"
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
|
-
}), null),
|
|
1379
|
+
}), null), b(u, T(et, {
|
|
1380
1380
|
get when() {
|
|
1381
|
-
return
|
|
1381
|
+
return _(() => c() === "edit")() && f();
|
|
1382
1382
|
},
|
|
1383
1383
|
get children() {
|
|
1384
|
-
return T(
|
|
1384
|
+
return T(y, {
|
|
1385
1385
|
size: "sm",
|
|
1386
1386
|
get disabled() {
|
|
1387
|
-
return !
|
|
1387
|
+
return !H();
|
|
1388
1388
|
},
|
|
1389
|
-
onClick: () =>
|
|
1389
|
+
onClick: () => f()?.(),
|
|
1390
1390
|
children: "Save"
|
|
1391
1391
|
});
|
|
1392
1392
|
}
|
|
1393
|
-
}), null),
|
|
1393
|
+
}), null), b(u, T(et, {
|
|
1394
1394
|
get when() {
|
|
1395
|
-
return
|
|
1395
|
+
return _(() => c() === "debug")() && e.debugData !== void 0;
|
|
1396
1396
|
},
|
|
1397
1397
|
get children() {
|
|
1398
|
-
return T(
|
|
1398
|
+
return T(y, {
|
|
1399
1399
|
size: "sm",
|
|
1400
1400
|
variant: "outline",
|
|
1401
|
-
onClick:
|
|
1401
|
+
onClick: x,
|
|
1402
1402
|
children: "Copy"
|
|
1403
1403
|
});
|
|
1404
1404
|
}
|
|
@@ -1410,322 +1410,361 @@ function Jn(e) {
|
|
|
1410
1410
|
}
|
|
1411
1411
|
});
|
|
1412
1412
|
}
|
|
1413
|
-
|
|
1414
|
-
const
|
|
1415
|
-
function
|
|
1416
|
-
return `url("data:image/svg+xml,${encodeURIComponent(
|
|
1413
|
+
At(["click"]);
|
|
1414
|
+
const it = 32, g = it / 2, L = "white", st = "rgba(0,0,0,0.4)", vt = 2, lt = 3;
|
|
1415
|
+
function xn(t) {
|
|
1416
|
+
return `url("data:image/svg+xml,${encodeURIComponent(t)}")`;
|
|
1417
1417
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
1418
|
+
function ct(t) {
|
|
1419
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${it}" height="${it}" viewBox="0 0 ${it} ${it}">${t}</svg>`;
|
|
1420
1420
|
}
|
|
1421
|
-
const
|
|
1421
|
+
const vn = ct(`
|
|
1422
1422
|
<g transform="translate(6, 2)">
|
|
1423
1423
|
<!-- shadow -->
|
|
1424
|
-
<g stroke="${
|
|
1424
|
+
<g stroke="${st}" stroke-width="${lt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1425
1425
|
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
1426
1426
|
</g>
|
|
1427
1427
|
<!-- main -->
|
|
1428
|
-
<g stroke="${
|
|
1428
|
+
<g stroke="${L}" stroke-width="${vt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1429
1429
|
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
1430
1430
|
</g>
|
|
1431
1431
|
</g>
|
|
1432
|
-
`),
|
|
1432
|
+
`), yn = ct(`
|
|
1433
1433
|
<g>
|
|
1434
|
-
<circle cx="${g}" cy="${g}" r="8" stroke="${
|
|
1435
|
-
<circle cx="${g}" cy="${g}" r="8" stroke="${
|
|
1436
|
-
<circle cx="${g}" cy="${g}" r="1.5" fill="${
|
|
1434
|
+
<circle cx="${g}" cy="${g}" r="8" stroke="${st}" stroke-width="${lt}" fill="none"/>
|
|
1435
|
+
<circle cx="${g}" cy="${g}" r="8" stroke="${L}" stroke-width="1.5" fill="none"/>
|
|
1436
|
+
<circle cx="${g}" cy="${g}" r="1.5" fill="${L}"/>
|
|
1437
1437
|
</g>
|
|
1438
|
-
`),
|
|
1438
|
+
`), wn = ct(`
|
|
1439
1439
|
<g>
|
|
1440
1440
|
<!-- shadow -->
|
|
1441
|
-
<g stroke="${
|
|
1441
|
+
<g stroke="${st}" stroke-width="${lt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1442
1442
|
<line x1="6" y1="${g}" x2="26" y2="${g}"/>
|
|
1443
1443
|
<polyline points="10,${g - 4} 6,${g} 10,${g + 4}"/>
|
|
1444
1444
|
<polyline points="22,${g - 4} 26,${g} 22,${g + 4}"/>
|
|
1445
1445
|
</g>
|
|
1446
1446
|
<!-- main -->
|
|
1447
|
-
<g stroke="${
|
|
1447
|
+
<g stroke="${L}" stroke-width="${vt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1448
1448
|
<line x1="6" y1="${g}" x2="26" y2="${g}"/>
|
|
1449
1449
|
<polyline points="10,${g - 4} 6,${g} 10,${g + 4}"/>
|
|
1450
1450
|
<polyline points="22,${g - 4} 26,${g} 22,${g + 4}"/>
|
|
1451
1451
|
</g>
|
|
1452
1452
|
<!-- center grip dots -->
|
|
1453
|
-
<circle cx="${g}" cy="${g}" r="1.5" fill="${
|
|
1454
|
-
<circle cx="${g - 5}" cy="${g}" r="1" fill="${
|
|
1455
|
-
<circle cx="${g + 5}" cy="${g}" r="1" fill="${
|
|
1453
|
+
<circle cx="${g}" cy="${g}" r="1.5" fill="${L}"/>
|
|
1454
|
+
<circle cx="${g - 5}" cy="${g}" r="1" fill="${L}" opacity="0.6"/>
|
|
1455
|
+
<circle cx="${g + 5}" cy="${g}" r="1" fill="${L}" opacity="0.6"/>
|
|
1456
1456
|
</g>
|
|
1457
|
-
`),
|
|
1457
|
+
`), $n = ct(`
|
|
1458
1458
|
<g>
|
|
1459
1459
|
<!-- shadow -->
|
|
1460
|
-
<g stroke="${
|
|
1460
|
+
<g stroke="${st}" stroke-width="${lt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1461
1461
|
<line x1="${g}" y1="6" x2="${g}" y2="26"/>
|
|
1462
1462
|
<polyline points="${g - 4},10 ${g},6 ${g + 4},10"/>
|
|
1463
1463
|
<polyline points="${g - 4},22 ${g},26 ${g + 4},22"/>
|
|
1464
1464
|
</g>
|
|
1465
1465
|
<!-- main -->
|
|
1466
|
-
<g stroke="${
|
|
1466
|
+
<g stroke="${L}" stroke-width="${vt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1467
1467
|
<line x1="${g}" y1="6" x2="${g}" y2="26"/>
|
|
1468
1468
|
<polyline points="${g - 4},10 ${g},6 ${g + 4},10"/>
|
|
1469
1469
|
<polyline points="${g - 4},22 ${g},26 ${g + 4},22"/>
|
|
1470
1470
|
</g>
|
|
1471
1471
|
<!-- center grip dots -->
|
|
1472
|
-
<circle cx="${g}" cy="${g}" r="1.5" fill="${
|
|
1473
|
-
<circle cx="${g}" cy="${g - 5}" r="1" fill="${
|
|
1474
|
-
<circle cx="${g}" cy="${g + 5}" r="1" fill="${
|
|
1472
|
+
<circle cx="${g}" cy="${g}" r="1.5" fill="${L}"/>
|
|
1473
|
+
<circle cx="${g}" cy="${g - 5}" r="1" fill="${L}" opacity="0.6"/>
|
|
1474
|
+
<circle cx="${g}" cy="${g + 5}" r="1" fill="${L}" opacity="0.6"/>
|
|
1475
1475
|
</g>
|
|
1476
1476
|
`);
|
|
1477
|
-
function
|
|
1478
|
-
return { css: `${
|
|
1477
|
+
function at(t, e, r) {
|
|
1478
|
+
return { css: `${xn(t)} ${e} ${r}, auto`, hotspotX: e, hotspotY: r };
|
|
1479
1479
|
}
|
|
1480
1480
|
const Z = {
|
|
1481
|
-
tap:
|
|
1482
|
-
hold:
|
|
1483
|
-
slideHorizontal:
|
|
1484
|
-
slideVertical:
|
|
1481
|
+
tap: at(vn, 12, 4),
|
|
1482
|
+
hold: at(yn, 16, 16),
|
|
1483
|
+
slideHorizontal: at(wn, g, g),
|
|
1484
|
+
slideVertical: at($n, g, g)
|
|
1485
1485
|
};
|
|
1486
|
-
function
|
|
1486
|
+
function dt() {
|
|
1487
|
+
if (typeof window > "u") return null;
|
|
1488
|
+
const t = window;
|
|
1489
|
+
return t.Capacitor?.isNativePlatform?.() ? t.Capacitor.Plugins?.Haptics ?? null : null;
|
|
1490
|
+
}
|
|
1491
|
+
function gt(t) {
|
|
1492
|
+
if (!(typeof navigator > "u" || typeof navigator.vibrate != "function"))
|
|
1493
|
+
try {
|
|
1494
|
+
navigator.vibrate(t);
|
|
1495
|
+
} catch {
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
const pn = {
|
|
1499
|
+
/** Light confirmation — fires when slide gesture arms after user holds still. */
|
|
1500
|
+
tick() {
|
|
1501
|
+
const t = dt();
|
|
1502
|
+
if (t) {
|
|
1503
|
+
t.impact({ style: "Light" }).catch(() => {
|
|
1504
|
+
});
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
gt(8);
|
|
1508
|
+
},
|
|
1509
|
+
/** Medium bump — fires when hold gesture commits (detail opening). */
|
|
1510
|
+
bump() {
|
|
1511
|
+
const t = dt();
|
|
1512
|
+
if (t) {
|
|
1513
|
+
t.impact({ style: "Medium" }).catch(() => {
|
|
1514
|
+
});
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
gt(20);
|
|
1518
|
+
},
|
|
1519
|
+
/** Stronger pulse — reserved for edit-mode pickup (future use). */
|
|
1520
|
+
pulse() {
|
|
1521
|
+
const t = dt();
|
|
1522
|
+
if (t) {
|
|
1523
|
+
t.impact({ style: "Heavy" }).catch(() => {
|
|
1524
|
+
});
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
gt([0, 15, 40, 15]);
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
function tr(t, e) {
|
|
1487
1531
|
const n = {
|
|
1488
1532
|
isDown: !1,
|
|
1533
|
+
isTouch: !1,
|
|
1489
1534
|
startX: 0,
|
|
1490
1535
|
startY: 0,
|
|
1491
|
-
currentX: 0,
|
|
1492
|
-
currentY: 0,
|
|
1493
1536
|
startTime: 0,
|
|
1494
1537
|
hasMoved: !1,
|
|
1538
|
+
sliding: !1,
|
|
1495
1539
|
holdTimer: null,
|
|
1496
|
-
slideActive: !1,
|
|
1497
|
-
slideActivationTimer: null,
|
|
1498
|
-
lockedAxis: null,
|
|
1499
1540
|
element: null
|
|
1500
1541
|
};
|
|
1501
|
-
let
|
|
1502
|
-
function
|
|
1503
|
-
|
|
1504
|
-
const $ =
|
|
1542
|
+
let a = null, o = null, s = null;
|
|
1543
|
+
function l(h) {
|
|
1544
|
+
h !== o && (s && s.disconnect(), s = new ResizeObserver((y) => {
|
|
1545
|
+
const $ = y[0];
|
|
1505
1546
|
if ($) {
|
|
1506
|
-
const
|
|
1507
|
-
|
|
1547
|
+
const O = $.borderBoxSize?.[0];
|
|
1548
|
+
O ? a = { width: O.inlineSize, height: O.blockSize } : a = { width: $.contentRect.width, height: $.contentRect.height };
|
|
1508
1549
|
}
|
|
1509
|
-
}),
|
|
1550
|
+
}), o = h, s.observe(h), a = { width: h.clientWidth, height: h.clientHeight });
|
|
1510
1551
|
}
|
|
1511
|
-
const
|
|
1512
|
-
n.holdTimer && (clearTimeout(n.holdTimer), n.holdTimer = null)
|
|
1513
|
-
}, c = (
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1552
|
+
const d = () => {
|
|
1553
|
+
n.holdTimer && (clearTimeout(n.holdTimer), n.holdTimer = null);
|
|
1554
|
+
}, c = () => {
|
|
1555
|
+
n.isDown = !1, n.hasMoved = !1, n.sliding = !1;
|
|
1556
|
+
}, v = (h) => {
|
|
1557
|
+
const $ = t().slide;
|
|
1558
|
+
return $?.orientation === "horizontal" ? "horizontal" : $?.orientation === "vertical" ? "vertical" : h && (a || l(h), a) ? a.height > a.width ? "vertical" : "horizontal" : (e?.() ?? "horizontal") === "horizontal" ? "horizontal" : "vertical";
|
|
1559
|
+
}, C = (h) => {
|
|
1560
|
+
const y = t();
|
|
1561
|
+
if (!(!y.tap && !y.hold && !y.slide)) {
|
|
1562
|
+
if (n.isDown = !0, n.isTouch = h.pointerType === "touch", n.element = h.currentTarget, l(n.element), n.startX = h.clientX, n.startY = h.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.sliding = !1, y.hold) {
|
|
1563
|
+
const $ = y.hold.delay ?? 500;
|
|
1521
1564
|
n.holdTimer = setTimeout(() => {
|
|
1522
|
-
n.
|
|
1565
|
+
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (pn.bump(), y.hold?.action(), n.isDown = !1);
|
|
1523
1566
|
}, $);
|
|
1524
1567
|
}
|
|
1525
|
-
if (
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1568
|
+
if (!n.isTouch && y.slide)
|
|
1569
|
+
try {
|
|
1570
|
+
h.currentTarget.setPointerCapture(h.pointerId);
|
|
1571
|
+
} catch {
|
|
1572
|
+
}
|
|
1531
1573
|
}
|
|
1532
|
-
},
|
|
1574
|
+
}, m = (h) => {
|
|
1533
1575
|
if (!n.isDown) return;
|
|
1534
|
-
const
|
|
1535
|
-
n.
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1576
|
+
const y = t(), $ = h.clientX - n.startX, O = h.clientY - n.startY;
|
|
1577
|
+
if (Math.sqrt($ * $ + O * O) > 10 && (d(), n.hasMoved = !0), !n.isTouch && y.slide && n.hasMoved) {
|
|
1578
|
+
const f = h.currentTarget, u = v(f);
|
|
1579
|
+
n.sliding = !0;
|
|
1580
|
+
const A = y.slide.min ?? 0, p = y.slide.max ?? 100, G = p - A, Q = u === "vertical" ? -O : $, P = a ?? { width: f.clientWidth, height: f.clientHeight }, J = u === "vertical" ? P.height : P.width, Et = Q / J * G, Nt = Math.max(A, Math.min(p, y.slide.value + Et));
|
|
1581
|
+
y.slide.onChange(Math.round(Nt)), n.startX = h.clientX, n.startY = h.clientY, h.preventDefault();
|
|
1540
1582
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1583
|
+
}, x = (h) => {
|
|
1584
|
+
const y = t(), $ = n.isDown, O = Date.now() - n.startTime, H = y.hold?.delay ?? 500;
|
|
1585
|
+
d(), $ && y.tap && !n.hasMoved && O < H && y.tap();
|
|
1586
|
+
try {
|
|
1587
|
+
h.currentTarget.releasePointerCapture(h.pointerId);
|
|
1588
|
+
} catch {
|
|
1544
1589
|
}
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1590
|
+
c();
|
|
1591
|
+
}, V = (h) => {
|
|
1592
|
+
d();
|
|
1593
|
+
try {
|
|
1594
|
+
h.currentTarget.releasePointerCapture(h.pointerId);
|
|
1595
|
+
} catch {
|
|
1551
1596
|
}
|
|
1552
|
-
|
|
1553
|
-
},
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
const $ = b.slide.orientation;
|
|
1559
|
-
return $ === "horizontal" ? Z.slideHorizontal.css : $ === "vertical" ? Z.slideVertical.css : (r || o(m), r && r.height > r.width ? Z.slideVertical.css : Z.slideHorizontal.css);
|
|
1597
|
+
c();
|
|
1598
|
+
}, E = (h) => {
|
|
1599
|
+
const y = t();
|
|
1600
|
+
if (y.slide) {
|
|
1601
|
+
const $ = y.slide.orientation;
|
|
1602
|
+
return $ === "horizontal" ? Z.slideHorizontal.css : $ === "vertical" ? Z.slideVertical.css : (a || l(h), a && a.height > a.width ? Z.slideVertical.css : Z.slideHorizontal.css);
|
|
1560
1603
|
}
|
|
1561
|
-
return
|
|
1604
|
+
return y.tap ? Z.tap.css : y.hold ? Z.hold.css : "";
|
|
1562
1605
|
};
|
|
1563
1606
|
return {
|
|
1564
|
-
onPointerDown:
|
|
1565
|
-
onPointerMove:
|
|
1566
|
-
onPointerUp:
|
|
1567
|
-
onPointerCancel:
|
|
1568
|
-
onPointerEnter: (
|
|
1569
|
-
const
|
|
1570
|
-
n.element =
|
|
1607
|
+
onPointerDown: C,
|
|
1608
|
+
onPointerMove: m,
|
|
1609
|
+
onPointerUp: x,
|
|
1610
|
+
onPointerCancel: V,
|
|
1611
|
+
onPointerEnter: (h) => {
|
|
1612
|
+
const y = h.currentTarget;
|
|
1613
|
+
n.element = y, y.style.cursor = E(y);
|
|
1571
1614
|
},
|
|
1572
|
-
bindElement: (
|
|
1573
|
-
|
|
1615
|
+
bindElement: (h) => {
|
|
1616
|
+
h && (n.element = h, l(h));
|
|
1574
1617
|
},
|
|
1575
1618
|
touchAction: () => {
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1578
|
-
const b = m.slide.orientation;
|
|
1579
|
-
return b === "horizontal" ? "pan-y" : b === "vertical" || r && r.height > r.width ? "pan-x" : "pan-y";
|
|
1580
|
-
}
|
|
1581
|
-
return m.tap || m.hold ? "manipulation" : "auto";
|
|
1619
|
+
const h = t();
|
|
1620
|
+
return h.tap || h.hold || h.slide ? "manipulation" : "auto";
|
|
1582
1621
|
},
|
|
1583
1622
|
dispose: () => {
|
|
1584
|
-
d(),
|
|
1623
|
+
d(), s && (s.disconnect(), s = null), o = null, a = null;
|
|
1585
1624
|
}
|
|
1586
1625
|
};
|
|
1587
1626
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return
|
|
1590
|
-
const
|
|
1591
|
-
if (
|
|
1592
|
-
const
|
|
1593
|
-
widgetConfig:
|
|
1594
|
-
entities:
|
|
1595
|
-
const
|
|
1596
|
-
entity_id:
|
|
1597
|
-
state:
|
|
1598
|
-
domain:
|
|
1599
|
-
friendly_name:
|
|
1627
|
+
function er(t) {
|
|
1628
|
+
return N(() => {
|
|
1629
|
+
const e = t.entities();
|
|
1630
|
+
if (e.length === 0) return;
|
|
1631
|
+
const r = {
|
|
1632
|
+
widgetConfig: t.widgetConfig,
|
|
1633
|
+
entities: e.map((i) => {
|
|
1634
|
+
const n = {
|
|
1635
|
+
entity_id: i.id,
|
|
1636
|
+
state: i.state,
|
|
1637
|
+
domain: i.domain,
|
|
1638
|
+
friendly_name: i.friendlyName
|
|
1600
1639
|
};
|
|
1601
|
-
return
|
|
1602
|
-
...
|
|
1603
|
-
...
|
|
1604
|
-
} :
|
|
1640
|
+
return t.customEntityFields ? {
|
|
1641
|
+
...n,
|
|
1642
|
+
...t.customEntityFields(i)
|
|
1643
|
+
} : n;
|
|
1605
1644
|
})
|
|
1606
1645
|
};
|
|
1607
|
-
return
|
|
1646
|
+
return t.additionalData && Object.assign(r, t.additionalData), r;
|
|
1608
1647
|
});
|
|
1609
1648
|
}
|
|
1610
|
-
function
|
|
1611
|
-
const [
|
|
1649
|
+
function nr(t = {}) {
|
|
1650
|
+
const [e, r] = j(!1), [i, n] = j(!1);
|
|
1612
1651
|
return {
|
|
1613
1652
|
save: async (s) => {
|
|
1614
|
-
if (
|
|
1615
|
-
|
|
1653
|
+
if (t.onSave) {
|
|
1654
|
+
r(!0);
|
|
1616
1655
|
try {
|
|
1617
|
-
await
|
|
1656
|
+
await t.onSave(s), t.onSaveSuccess?.();
|
|
1618
1657
|
} finally {
|
|
1619
|
-
|
|
1658
|
+
r(!1);
|
|
1620
1659
|
}
|
|
1621
1660
|
}
|
|
1622
1661
|
},
|
|
1623
1662
|
remove: async () => {
|
|
1624
|
-
if (
|
|
1625
|
-
|
|
1663
|
+
if (t.onDelete) {
|
|
1664
|
+
n(!0);
|
|
1626
1665
|
try {
|
|
1627
|
-
await
|
|
1666
|
+
await t.onDelete(), t.onDeleteSuccess?.();
|
|
1628
1667
|
} finally {
|
|
1629
|
-
|
|
1668
|
+
n(!1);
|
|
1630
1669
|
}
|
|
1631
1670
|
}
|
|
1632
1671
|
},
|
|
1633
|
-
isSaving:
|
|
1634
|
-
isDeleting:
|
|
1672
|
+
isSaving: e,
|
|
1673
|
+
isDeleting: i
|
|
1635
1674
|
};
|
|
1636
1675
|
}
|
|
1637
|
-
function
|
|
1638
|
-
const [
|
|
1676
|
+
function rr(t = "edit") {
|
|
1677
|
+
const [e, r] = j(!1), [i, n] = j(t);
|
|
1639
1678
|
return {
|
|
1640
|
-
showDialog:
|
|
1641
|
-
setShowDialog:
|
|
1642
|
-
openDialog: () =>
|
|
1643
|
-
closeDialog: () =>
|
|
1644
|
-
activeTab:
|
|
1645
|
-
setActiveTab:
|
|
1679
|
+
showDialog: e,
|
|
1680
|
+
setShowDialog: r,
|
|
1681
|
+
openDialog: () => r(!0),
|
|
1682
|
+
closeDialog: () => r(!1),
|
|
1683
|
+
activeTab: i,
|
|
1684
|
+
setActiveTab: n
|
|
1646
1685
|
};
|
|
1647
1686
|
}
|
|
1648
|
-
function
|
|
1649
|
-
const
|
|
1650
|
-
const
|
|
1651
|
-
return
|
|
1652
|
-
}),
|
|
1687
|
+
function ir(t) {
|
|
1688
|
+
const e = N(() => t.entity() !== null), r = N(() => {
|
|
1689
|
+
const n = t.entity();
|
|
1690
|
+
return n ? t.calculateData(n) : null;
|
|
1691
|
+
}), i = N(() => e() ? void 0 : t.emptyStateConfig);
|
|
1653
1692
|
return {
|
|
1654
|
-
entity:
|
|
1655
|
-
data:
|
|
1656
|
-
emptyState:
|
|
1657
|
-
hasEntity:
|
|
1693
|
+
entity: t.entity,
|
|
1694
|
+
data: r,
|
|
1695
|
+
emptyState: i,
|
|
1696
|
+
hasEntity: e
|
|
1658
1697
|
};
|
|
1659
1698
|
}
|
|
1660
|
-
function
|
|
1661
|
-
const
|
|
1662
|
-
if (!
|
|
1663
|
-
const s =
|
|
1699
|
+
function ar(t) {
|
|
1700
|
+
const e = t.minEntities ?? 1, r = N(() => t.entities().length), i = N(() => r() >= e), n = N(() => !i() || !t.calculateGroupData ? null : t.calculateGroupData(t.entities())), a = N(() => {
|
|
1701
|
+
if (!i()) return;
|
|
1702
|
+
const s = t.aggregationMode?.();
|
|
1664
1703
|
if (!s || s === "none") return;
|
|
1665
|
-
const l =
|
|
1704
|
+
const l = t.entities();
|
|
1666
1705
|
if (s === "light" || s === "binary-sensor" || s === "switch")
|
|
1667
|
-
return
|
|
1706
|
+
return Te(l, t.allEntitiesMode);
|
|
1668
1707
|
if (s === "sensor") {
|
|
1669
|
-
const d =
|
|
1670
|
-
return
|
|
1708
|
+
const d = t.sensorGroupType?.() ?? "mean";
|
|
1709
|
+
return Ve(l, d, !0);
|
|
1671
1710
|
}
|
|
1672
|
-
}), o =
|
|
1711
|
+
}), o = N(() => i() ? void 0 : t.emptyStateConfig);
|
|
1673
1712
|
return {
|
|
1674
|
-
entities:
|
|
1675
|
-
groupData:
|
|
1713
|
+
entities: t.entities,
|
|
1714
|
+
groupData: n,
|
|
1676
1715
|
aggregatedData: a,
|
|
1677
1716
|
emptyState: o,
|
|
1678
|
-
hasEntities:
|
|
1679
|
-
count:
|
|
1717
|
+
hasEntities: i,
|
|
1718
|
+
count: r
|
|
1680
1719
|
};
|
|
1681
1720
|
}
|
|
1682
|
-
function
|
|
1683
|
-
const [
|
|
1684
|
-
validate:
|
|
1685
|
-
initialValues:
|
|
1686
|
-
}),
|
|
1721
|
+
function or(t) {
|
|
1722
|
+
const [e] = Ht({
|
|
1723
|
+
validate: Gt(t.schema),
|
|
1724
|
+
initialValues: t.initialValues
|
|
1725
|
+
}), r = N(() => e.dirty), i = N(() => e.submitting);
|
|
1687
1726
|
return {
|
|
1688
|
-
form:
|
|
1689
|
-
isDirty:
|
|
1690
|
-
isSubmitting:
|
|
1727
|
+
form: e,
|
|
1728
|
+
isDirty: r,
|
|
1729
|
+
isSubmitting: i,
|
|
1691
1730
|
handleSubmit: (a) => {
|
|
1692
|
-
|
|
1731
|
+
t.onSubmit?.(a);
|
|
1693
1732
|
},
|
|
1694
|
-
getValue:
|
|
1695
|
-
setValue:
|
|
1696
|
-
reset:
|
|
1733
|
+
getValue: Bt,
|
|
1734
|
+
setValue: Lt,
|
|
1735
|
+
reset: Pt
|
|
1697
1736
|
};
|
|
1698
1737
|
}
|
|
1699
|
-
const
|
|
1700
|
-
function
|
|
1701
|
-
const
|
|
1702
|
-
const l =
|
|
1738
|
+
const mt = ["xs", "sm", "md", "lg", "xl"];
|
|
1739
|
+
function sr() {
|
|
1740
|
+
const t = I(), e = N(() => mt.indexOf(t.size())), r = N(() => {
|
|
1741
|
+
const l = t.size();
|
|
1703
1742
|
return l === "xs" || l === "sm";
|
|
1704
|
-
}),
|
|
1705
|
-
const l =
|
|
1743
|
+
}), i = N(() => {
|
|
1744
|
+
const l = t.size();
|
|
1706
1745
|
return l === "lg" || l === "xl";
|
|
1707
|
-
}),
|
|
1746
|
+
}), n = N(() => e() >= 2);
|
|
1708
1747
|
return {
|
|
1709
|
-
isCompact:
|
|
1710
|
-
isLarge:
|
|
1711
|
-
showDetail:
|
|
1712
|
-
showOn: (l) => l.includes(
|
|
1713
|
-
hideOn: (l) => !l.includes(
|
|
1748
|
+
isCompact: r,
|
|
1749
|
+
isLarge: i,
|
|
1750
|
+
showDetail: n,
|
|
1751
|
+
showOn: (l) => l.includes(t.size()),
|
|
1752
|
+
hideOn: (l) => !l.includes(t.size()),
|
|
1714
1753
|
matches: (l) => {
|
|
1715
1754
|
const d = l.trim();
|
|
1716
1755
|
if (d.endsWith("+")) {
|
|
1717
|
-
const c = d.slice(0, -1),
|
|
1718
|
-
return
|
|
1756
|
+
const c = d.slice(0, -1), v = mt.indexOf(c);
|
|
1757
|
+
return v >= 0 && e() >= v;
|
|
1719
1758
|
}
|
|
1720
1759
|
if (d.endsWith("-")) {
|
|
1721
|
-
const c = d.slice(0, -1),
|
|
1722
|
-
return
|
|
1760
|
+
const c = d.slice(0, -1), v = mt.indexOf(c);
|
|
1761
|
+
return v >= 0 && e() <= v;
|
|
1723
1762
|
}
|
|
1724
|
-
return
|
|
1763
|
+
return t.size() === d;
|
|
1725
1764
|
}
|
|
1726
1765
|
};
|
|
1727
1766
|
}
|
|
1728
|
-
const
|
|
1767
|
+
const D = {
|
|
1729
1768
|
ocean: "bg-gradient-to-br from-cyan-600/20 to-blue-700/20",
|
|
1730
1769
|
sunset: "bg-gradient-to-br from-orange-500/20 to-purple-700/20",
|
|
1731
1770
|
forest: "bg-gradient-to-br from-emerald-600/20 to-teal-700/20",
|
|
@@ -1743,7 +1782,7 @@ const _ = {
|
|
|
1743
1782
|
sage: "bg-gradient-to-br from-lime-600/20 to-green-600/20",
|
|
1744
1783
|
copper: "bg-gradient-to-br from-amber-600/20 to-amber-800/20",
|
|
1745
1784
|
dusk: "bg-gradient-to-br from-blue-500/20 to-purple-600/20"
|
|
1746
|
-
},
|
|
1785
|
+
}, lr = {
|
|
1747
1786
|
ocean: "Ocean Breeze",
|
|
1748
1787
|
sunset: "Sunset Glow",
|
|
1749
1788
|
forest: "Forest Dawn",
|
|
@@ -1761,30 +1800,30 @@ const _ = {
|
|
|
1761
1800
|
sage: "Sage",
|
|
1762
1801
|
copper: "Copper",
|
|
1763
1802
|
dusk: "Dusk"
|
|
1764
|
-
},
|
|
1765
|
-
function
|
|
1766
|
-
const
|
|
1767
|
-
let
|
|
1768
|
-
for (const
|
|
1769
|
-
|
|
1770
|
-
const
|
|
1771
|
-
return
|
|
1772
|
-
}
|
|
1773
|
-
function
|
|
1774
|
-
if (!
|
|
1775
|
-
const
|
|
1776
|
-
return
|
|
1803
|
+
}, cr = Object.keys(D);
|
|
1804
|
+
function St(t) {
|
|
1805
|
+
const e = Object.keys(D);
|
|
1806
|
+
let r = 0;
|
|
1807
|
+
for (const n of t)
|
|
1808
|
+
r = (r << 5) - r + n.charCodeAt(0), r = r & r;
|
|
1809
|
+
const i = Math.abs(r) % e.length;
|
|
1810
|
+
return e[i];
|
|
1811
|
+
}
|
|
1812
|
+
function ur(t, e) {
|
|
1813
|
+
if (!t) {
|
|
1814
|
+
const i = St(e);
|
|
1815
|
+
return D[i];
|
|
1777
1816
|
}
|
|
1778
|
-
if (typeof
|
|
1779
|
-
return
|
|
1780
|
-
if (typeof
|
|
1781
|
-
return
|
|
1782
|
-
const
|
|
1783
|
-
return
|
|
1817
|
+
if (typeof t == "string" && t in D)
|
|
1818
|
+
return D[t];
|
|
1819
|
+
if (typeof t == "string")
|
|
1820
|
+
return t;
|
|
1821
|
+
const r = St(e);
|
|
1822
|
+
return D[r];
|
|
1784
1823
|
}
|
|
1785
|
-
const
|
|
1824
|
+
const tt = {
|
|
1786
1825
|
ocean: {
|
|
1787
|
-
gradient:
|
|
1826
|
+
gradient: D.ocean,
|
|
1788
1827
|
bg: "bg-cyan-600/20",
|
|
1789
1828
|
icon: "bg-cyan-500 dark:bg-cyan-400",
|
|
1790
1829
|
glow: "shadow-cyan-500/50 dark:shadow-cyan-400/50",
|
|
@@ -1794,7 +1833,7 @@ const ee = {
|
|
|
1794
1833
|
}
|
|
1795
1834
|
},
|
|
1796
1835
|
sunset: {
|
|
1797
|
-
gradient:
|
|
1836
|
+
gradient: D.sunset,
|
|
1798
1837
|
bg: "bg-orange-500/20",
|
|
1799
1838
|
icon: "bg-orange-500 dark:bg-orange-400",
|
|
1800
1839
|
glow: "shadow-orange-500/50 dark:shadow-orange-400/50",
|
|
@@ -1804,7 +1843,7 @@ const ee = {
|
|
|
1804
1843
|
}
|
|
1805
1844
|
},
|
|
1806
1845
|
forest: {
|
|
1807
|
-
gradient:
|
|
1846
|
+
gradient: D.forest,
|
|
1808
1847
|
bg: "bg-emerald-600/20",
|
|
1809
1848
|
icon: "bg-emerald-500 dark:bg-emerald-400",
|
|
1810
1849
|
glow: "shadow-emerald-500/50 dark:shadow-emerald-400/50",
|
|
@@ -1814,7 +1853,7 @@ const ee = {
|
|
|
1814
1853
|
}
|
|
1815
1854
|
},
|
|
1816
1855
|
lavender: {
|
|
1817
|
-
gradient:
|
|
1856
|
+
gradient: D.lavender,
|
|
1818
1857
|
bg: "bg-purple-500/20",
|
|
1819
1858
|
icon: "bg-purple-500 dark:bg-purple-400",
|
|
1820
1859
|
glow: "shadow-purple-500/50 dark:shadow-purple-400/50",
|
|
@@ -1824,7 +1863,7 @@ const ee = {
|
|
|
1824
1863
|
}
|
|
1825
1864
|
},
|
|
1826
1865
|
golden: {
|
|
1827
|
-
gradient:
|
|
1866
|
+
gradient: D.golden,
|
|
1828
1867
|
bg: "bg-yellow-500/20",
|
|
1829
1868
|
icon: "bg-yellow-500 dark:bg-yellow-400",
|
|
1830
1869
|
glow: "shadow-yellow-500/50 dark:shadow-yellow-400/50",
|
|
@@ -1834,7 +1873,7 @@ const ee = {
|
|
|
1834
1873
|
}
|
|
1835
1874
|
},
|
|
1836
1875
|
midnight: {
|
|
1837
|
-
gradient:
|
|
1876
|
+
gradient: D.midnight,
|
|
1838
1877
|
bg: "bg-blue-700/20",
|
|
1839
1878
|
icon: "bg-blue-700 dark:bg-blue-600",
|
|
1840
1879
|
glow: "shadow-blue-700/50 dark:shadow-blue-600/50",
|
|
@@ -1844,7 +1883,7 @@ const ee = {
|
|
|
1844
1883
|
}
|
|
1845
1884
|
},
|
|
1846
1885
|
rose: {
|
|
1847
|
-
gradient:
|
|
1886
|
+
gradient: D.rose,
|
|
1848
1887
|
bg: "bg-pink-400/20",
|
|
1849
1888
|
icon: "bg-pink-500 dark:bg-pink-400",
|
|
1850
1889
|
glow: "shadow-pink-500/50 dark:shadow-pink-400/50",
|
|
@@ -1854,7 +1893,7 @@ const ee = {
|
|
|
1854
1893
|
}
|
|
1855
1894
|
},
|
|
1856
1895
|
mint: {
|
|
1857
|
-
gradient:
|
|
1896
|
+
gradient: D.mint,
|
|
1858
1897
|
bg: "bg-green-400/20",
|
|
1859
1898
|
icon: "bg-green-500 dark:bg-green-400",
|
|
1860
1899
|
glow: "shadow-green-500/50 dark:shadow-green-400/50",
|
|
@@ -1864,7 +1903,7 @@ const ee = {
|
|
|
1864
1903
|
}
|
|
1865
1904
|
},
|
|
1866
1905
|
slate: {
|
|
1867
|
-
gradient:
|
|
1906
|
+
gradient: D.slate,
|
|
1868
1907
|
bg: "bg-slate-600/20",
|
|
1869
1908
|
icon: "bg-slate-600 dark:bg-slate-500",
|
|
1870
1909
|
glow: "shadow-slate-600/50 dark:shadow-slate-500/50",
|
|
@@ -1874,7 +1913,7 @@ const ee = {
|
|
|
1874
1913
|
}
|
|
1875
1914
|
},
|
|
1876
1915
|
coral: {
|
|
1877
|
-
gradient:
|
|
1916
|
+
gradient: D.coral,
|
|
1878
1917
|
bg: "bg-pink-300/20",
|
|
1879
1918
|
icon: "bg-pink-400 dark:bg-pink-300",
|
|
1880
1919
|
glow: "shadow-pink-400/50 dark:shadow-pink-300/50",
|
|
@@ -1884,7 +1923,7 @@ const ee = {
|
|
|
1884
1923
|
}
|
|
1885
1924
|
},
|
|
1886
1925
|
aurora: {
|
|
1887
|
-
gradient:
|
|
1926
|
+
gradient: D.aurora,
|
|
1888
1927
|
bg: "bg-blue-500/20",
|
|
1889
1928
|
icon: "bg-blue-500 dark:bg-blue-400",
|
|
1890
1929
|
glow: "shadow-blue-500/50 dark:shadow-blue-400/50",
|
|
@@ -1894,7 +1933,7 @@ const ee = {
|
|
|
1894
1933
|
}
|
|
1895
1934
|
},
|
|
1896
1935
|
ember: {
|
|
1897
|
-
gradient:
|
|
1936
|
+
gradient: D.ember,
|
|
1898
1937
|
bg: "bg-red-500/20",
|
|
1899
1938
|
icon: "bg-red-500 dark:bg-red-400",
|
|
1900
1939
|
glow: "shadow-red-500/50 dark:shadow-red-400/50",
|
|
@@ -1904,7 +1943,7 @@ const ee = {
|
|
|
1904
1943
|
}
|
|
1905
1944
|
},
|
|
1906
1945
|
steel: {
|
|
1907
|
-
gradient:
|
|
1946
|
+
gradient: D.steel,
|
|
1908
1947
|
bg: "bg-gray-500/20",
|
|
1909
1948
|
icon: "bg-gray-500 dark:bg-gray-400",
|
|
1910
1949
|
glow: void 0,
|
|
@@ -1914,7 +1953,7 @@ const ee = {
|
|
|
1914
1953
|
}
|
|
1915
1954
|
},
|
|
1916
1955
|
twilight: {
|
|
1917
|
-
gradient:
|
|
1956
|
+
gradient: D.twilight,
|
|
1918
1957
|
bg: "bg-violet-600/20",
|
|
1919
1958
|
icon: "bg-violet-500 dark:bg-violet-400",
|
|
1920
1959
|
glow: "shadow-violet-500/50 dark:shadow-violet-400/50",
|
|
@@ -1924,7 +1963,7 @@ const ee = {
|
|
|
1924
1963
|
}
|
|
1925
1964
|
},
|
|
1926
1965
|
sage: {
|
|
1927
|
-
gradient:
|
|
1966
|
+
gradient: D.sage,
|
|
1928
1967
|
bg: "bg-lime-600/20",
|
|
1929
1968
|
icon: "bg-lime-500 dark:bg-lime-400",
|
|
1930
1969
|
glow: "shadow-lime-500/50 dark:shadow-lime-400/50",
|
|
@@ -1934,7 +1973,7 @@ const ee = {
|
|
|
1934
1973
|
}
|
|
1935
1974
|
},
|
|
1936
1975
|
copper: {
|
|
1937
|
-
gradient:
|
|
1976
|
+
gradient: D.copper,
|
|
1938
1977
|
bg: "bg-amber-600/20",
|
|
1939
1978
|
icon: "bg-amber-600 dark:bg-amber-500",
|
|
1940
1979
|
glow: "shadow-amber-600/50 dark:shadow-amber-500/50",
|
|
@@ -1944,7 +1983,7 @@ const ee = {
|
|
|
1944
1983
|
}
|
|
1945
1984
|
},
|
|
1946
1985
|
dusk: {
|
|
1947
|
-
gradient:
|
|
1986
|
+
gradient: D.dusk,
|
|
1948
1987
|
bg: "bg-blue-500/20",
|
|
1949
1988
|
icon: "bg-blue-500 dark:bg-blue-400",
|
|
1950
1989
|
glow: "shadow-blue-500/50 dark:shadow-blue-400/50",
|
|
@@ -1953,116 +1992,116 @@ const ee = {
|
|
|
1953
1992
|
muted: "text-blue-400/60 dark:text-blue-300/60"
|
|
1954
1993
|
}
|
|
1955
1994
|
}
|
|
1956
|
-
},
|
|
1957
|
-
unavailable:
|
|
1958
|
-
active:
|
|
1959
|
-
inactive:
|
|
1960
|
-
success:
|
|
1961
|
-
warning:
|
|
1962
|
-
error:
|
|
1963
|
-
},
|
|
1995
|
+
}, dr = {
|
|
1996
|
+
unavailable: tt.steel,
|
|
1997
|
+
active: tt.ocean,
|
|
1998
|
+
inactive: tt.steel,
|
|
1999
|
+
success: tt.forest,
|
|
2000
|
+
warning: tt.ember,
|
|
2001
|
+
error: tt.rose
|
|
2002
|
+
}, gr = {
|
|
1964
2003
|
/** Optional display name override (renders as text input) */
|
|
1965
|
-
title: () =>
|
|
2004
|
+
title: () => X.string().optional().meta({ title: "Title", description: "Optional display name override" }),
|
|
1966
2005
|
/** Multi-select entity picker for a HA domain */
|
|
1967
|
-
entityIds: (
|
|
2006
|
+
entityIds: (t) => X.array(X.string()).default([]).meta({ domain: t, title: "Entities" }),
|
|
1968
2007
|
/** Single-select entity picker for a HA domain */
|
|
1969
|
-
singleEntity: (
|
|
2008
|
+
singleEntity: (t) => X.array(X.string()).default([]).meta({ domain: t, title: "Entity", singleSelect: !0 }),
|
|
1970
2009
|
/** Area picker dropdown */
|
|
1971
|
-
areaId: () =>
|
|
2010
|
+
areaId: () => X.string().optional().meta({ formType: "area-picker", title: "Area" })
|
|
1972
2011
|
};
|
|
1973
|
-
let
|
|
1974
|
-
function
|
|
1975
|
-
return
|
|
2012
|
+
let ft = null;
|
|
2013
|
+
function kn() {
|
|
2014
|
+
return ft || (ft = getComputedStyle(document.documentElement)), ft;
|
|
1976
2015
|
}
|
|
1977
|
-
function
|
|
1978
|
-
const
|
|
1979
|
-
return
|
|
2016
|
+
function mr(t) {
|
|
2017
|
+
const e = t.startsWith("--") ? t : `--${t}`;
|
|
2018
|
+
return kn().getPropertyValue(e).trim();
|
|
1980
2019
|
}
|
|
1981
|
-
function
|
|
2020
|
+
function fr() {
|
|
1982
2021
|
return document.documentElement.classList.contains("dark");
|
|
1983
2022
|
}
|
|
1984
|
-
const
|
|
1985
|
-
version:
|
|
1986
|
-
},
|
|
2023
|
+
const Sn = "0.3.7", Cn = {
|
|
2024
|
+
version: Sn
|
|
2025
|
+
}, hr = Cn.version;
|
|
1987
2026
|
export {
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2027
|
+
lr as GRADIENT_NAMES,
|
|
2028
|
+
D as GRADIENT_PRESETS,
|
|
2029
|
+
cr as GRADIENT_PRESET_KEYS,
|
|
2030
|
+
Jn as Glow,
|
|
2031
|
+
vr as GridSizeSchema,
|
|
2032
|
+
yr as PublishBodySchema,
|
|
2033
|
+
wr as PublishConfirmSchema,
|
|
2034
|
+
$r as PublishRequestSchema,
|
|
2035
|
+
hr as SDK_VERSION,
|
|
1997
2036
|
U as WIDGET_Z,
|
|
1998
2037
|
Y as Widget,
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2038
|
+
oe as WidgetContent,
|
|
2039
|
+
ht as WidgetCtx,
|
|
2040
|
+
Qn as WidgetDialog,
|
|
2041
|
+
ge as WidgetEmptyState,
|
|
2042
|
+
ye as WidgetIcon,
|
|
2043
|
+
pr as WidgetManifestSchema,
|
|
2044
|
+
_t as WidgetMetrics,
|
|
2045
|
+
ne as WidgetSliderFill,
|
|
2046
|
+
Zn as WidgetStack,
|
|
2047
|
+
ze as WidgetStatus,
|
|
2048
|
+
_e as WidgetSubtitle,
|
|
2049
|
+
Oe as WidgetTitle,
|
|
2050
|
+
Pe as WidgetValue,
|
|
2051
|
+
qn as allEntitiesInState,
|
|
2013
2052
|
Xn as anyEntityInState,
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
+
Pn as applyCssVars,
|
|
2054
|
+
Gn as applyLayout,
|
|
2055
|
+
bt as builtInVariants,
|
|
2056
|
+
Te as calculateLightGroup,
|
|
2057
|
+
Ve as calculateSensorGroup,
|
|
2058
|
+
Ft as classicGlass,
|
|
2059
|
+
k as cn,
|
|
2060
|
+
Yt as compactHorizontal,
|
|
2061
|
+
Hn as composeVariants,
|
|
2062
|
+
Kn as countActiveEntities,
|
|
2063
|
+
Yn as countAvailableEntities,
|
|
2064
|
+
Un as countEntitiesByState,
|
|
2065
|
+
Bn as createEmptyStateConfig,
|
|
2066
|
+
Tn as createEntity,
|
|
2067
|
+
Ln as createFlexLayout,
|
|
2068
|
+
Vn as defineWidget,
|
|
2069
|
+
xe as deriveAdaptiveIconColors,
|
|
2070
|
+
In as extendVariant,
|
|
2071
|
+
jt as extractDefaults,
|
|
2072
|
+
kr as formatSchemaError,
|
|
2073
|
+
Re as formatValue,
|
|
2074
|
+
Kt as getBuiltInVariant,
|
|
2075
|
+
Rn as getBuiltInVariantIds,
|
|
2076
|
+
Fn as getEntityAttribute,
|
|
2077
|
+
jn as getEntityState,
|
|
2078
|
+
ur as getGradient,
|
|
2079
|
+
St as getGradientFromString,
|
|
2080
|
+
ie as getSpacingClass,
|
|
2081
|
+
mr as getThemeToken,
|
|
2082
|
+
tt as gradientColorPresets,
|
|
2083
|
+
Ie as interpretValue,
|
|
2084
|
+
Wn as isBuiltInVariant,
|
|
2085
|
+
fr as isDark,
|
|
2086
|
+
We as isEntityActive,
|
|
2087
|
+
Ae as isEntityAvailable,
|
|
2088
|
+
xt as mergeVariants,
|
|
2089
|
+
Ut as minimal,
|
|
2090
|
+
Sr as parseGridSize,
|
|
2091
|
+
Cr as serializeGridSize,
|
|
2053
2092
|
W as spacing,
|
|
2054
|
-
|
|
2055
|
-
|
|
2093
|
+
dr as stateColors,
|
|
2094
|
+
Mt as toFormSchema,
|
|
2056
2095
|
F as typography,
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2096
|
+
er as useDebugData,
|
|
2097
|
+
nr as useWidgetConfig,
|
|
2098
|
+
I as useWidgetContext,
|
|
2099
|
+
rr as useWidgetDialog,
|
|
2100
|
+
ir as useWidgetEntity,
|
|
2101
|
+
ar as useWidgetEntityGroup,
|
|
2102
|
+
or as useWidgetForm,
|
|
2103
|
+
tr as useWidgetGestures,
|
|
2104
|
+
sr as useWidgetResponsive,
|
|
2105
|
+
An as warnIfStub,
|
|
2106
|
+
gr as widgetFields
|
|
2068
2107
|
};
|