@glasshome/widget-sdk 0.3.6 → 0.4.0

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