@glasshome/widget-sdk 1.20.0 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { deprecate as e, deprecations as t, formatDeprecation as n } from "./deprecations.js";
|
|
2
2
|
import { WidgetManifestSchema as r, formatSchemaError as i } from "./schemas.js";
|
|
3
3
|
import { z as a, z as o } from "zod";
|
|
4
|
-
import { getForecasts as s, getStream as c, getWebRtcClientConfig as l, hassMediaUrl as u, sendWebRtcCandidate as d, startWebRtcSession as f, state as p, trackEntityHistory as m, untrackEntityHistory as
|
|
5
|
-
import { byDomain as
|
|
4
|
+
import { getForecasts as s, getStream as c, getWebRtcClientConfig as l, hassMediaUrl as u, sendWebRtcCandidate as d, startWebRtcSession as f, state as p, trackEntityHistory as m, untrackEntityHistory as ee } from "@glasshome/sync-layer";
|
|
5
|
+
import { byDomain as h, useArea as g, useCalendarEvents as _, useCamera as v, useConnection as y, useCurrency as b, useEntities as x, useEntity as S, useEntity as te, useEntityHistory as ne, useEntityStatistics as re, useForecast as ie, useHassConfig as ae, useLocale as oe, useService as se, useStore as ce, useTemperatureUnit as le, useToggle as ue, useTurnOff as de, useTurnOn as fe, useUnitSystem as pe } from "@glasshome/sync-layer/solid";
|
|
6
6
|
import { For as C, Show as w, children as T, createContext as me, createEffect as E, createMemo as D, createSignal as O, on as he, onCleanup as k, onMount as ge, splitProps as _e, useContext as A } from "solid-js";
|
|
7
7
|
import { addEventListener as j, className as M, createComponent as N, delegateEvents as ve, effect as P, insert as F, memo as I, setAttribute as L, setStyleProperty as R, style as z, template as B, use as V } from "solid-js/web";
|
|
8
|
-
import { Accordion as ye, AccordionContent as be, AccordionItem as xe, AccordionTrigger as Se, Badge as Ce, Badge as we, Button as Te, Button as Ee, ButtonGroup as De, ButtonGroup as Oe, Carousel as ke, CarouselContent as Ae, CarouselDots as je, CarouselItem as Me, CarouselNext as Ne, CarouselPrevious as Pe, ColorDisc as Fe, ColorSlider as Ie, ColorWheel as Le, CountPill as Re, CountPill as ze, Empty as Be, EmptyDescription as Ve, EmptyHeader as He, EmptyTitle as Ue, FactRow as H, FieldGroup as We, FieldTitle as Ge,
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
8
|
+
import { Accordion as ye, AccordionContent as be, AccordionItem as xe, AccordionTrigger as Se, Badge as Ce, Badge as we, Button as Te, Button as Ee, ButtonGroup as De, ButtonGroup as Oe, Carousel as ke, CarouselContent as Ae, CarouselDots as je, CarouselItem as Me, CarouselNext as Ne, CarouselPrevious as Pe, ColorDisc as Fe, ColorSlider as Ie, ColorWheel as Le, CountPill as Re, CountPill as ze, Empty as Be, EmptyDescription as Ve, EmptyHeader as He, EmptyTitle as Ue, FactRow as H, FieldGroup as We, FieldTitle as Ge, HOLD_GRACE_MS as Ke, HOLD_MS as qe, Icon as Je, Icon as U, Input as Ye, Label as Xe, Popover as Ze, PopoverContent as Qe, Progress as $e, ResponsiveDialog as et, ResponsiveDialogBody as tt, ResponsiveDialogBody as nt, ResponsiveDialogClose as rt, ResponsiveDialogContent as it, ResponsiveDialogDescription as at, ResponsiveDialogFooter as ot, ResponsiveDialogFooter as st, ResponsiveDialogHeader as ct, ResponsiveDialogTitle as lt, SchemaForm as ut, SectionIcon as dt, SectionIcon as ft, SectionMeta as pt, SectionRow as mt, SectionTitle as ht, Select as gt, SelectContent as _t, SelectItem as vt, SelectTrigger as yt, SelectValue as bt, Slider as xt, SwatchPicker as St, Switch as Ct, Tabs as wt, Tabs as Tt, TabsContent as Et, TabsContent as Dt, TabsList as Ot, TabsList as kt, TabsTrigger as At, TabsTrigger as jt, TemperatureBar as Mt, Toggle as Nt, ToggleGroup as Pt, ToggleGroup as Ft, ToggleGroupItem as It, ToggleGroupItem as Lt, buttonVariants as Rt, imagePreset as zt, imagePreset as Bt, imageUrl as Vt, imageUrl as Ht, mediaUrl as Ut, parseColor as Wt, presetValue as Gt } from "@glasshome/ui/solid";
|
|
9
|
+
import { clsx as Kt } from "clsx";
|
|
10
|
+
import { twMerge as qt } from "tailwind-merge";
|
|
11
11
|
//#region src/framework/to-form-schema.ts
|
|
12
|
-
function
|
|
12
|
+
function Jt(e) {
|
|
13
13
|
return o.toJSONSchema(e, { override: (e) => {
|
|
14
14
|
let t = o.globalRegistry.get(e.zodSchema);
|
|
15
15
|
return t && typeof t == "object" && Object.keys(t).length > 0 ? {
|
|
@@ -18,7 +18,7 @@ function Wt(e) {
|
|
|
18
18
|
} : e.jsonSchema;
|
|
19
19
|
} });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Yt(e) {
|
|
22
22
|
try {
|
|
23
23
|
return e.parse({});
|
|
24
24
|
} catch {
|
|
@@ -27,30 +27,30 @@ function Gt(e) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/define-widget.ts
|
|
30
|
-
function
|
|
31
|
-
return e.configSchema && (e.manifest.schema || (e.manifest.schema =
|
|
30
|
+
function Xt(e) {
|
|
31
|
+
return e.configSchema && (e.manifest.schema || (e.manifest.schema = Jt(e.configSchema)), e.manifest.defaultConfig || (e.manifest.defaultConfig = Yt(e.configSchema))), e;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/framework/hooks/use-widget-context.ts
|
|
35
35
|
var W = me();
|
|
36
|
-
function
|
|
36
|
+
function Zt() {
|
|
37
37
|
let e = A(W);
|
|
38
38
|
if (!e) throw Error("useWidgetContext must be used within a Widget component");
|
|
39
39
|
return e;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/framework/hooks/use-service.ts
|
|
43
|
-
function
|
|
43
|
+
function Qt(e) {
|
|
44
44
|
let t = Array.isArray(e) ? e[0] : e, n = t?.split(".")[0];
|
|
45
45
|
if (!n) throw Error(`Invalid entity ID: ${String(t)}`);
|
|
46
46
|
return n;
|
|
47
47
|
}
|
|
48
48
|
function G(e, t) {
|
|
49
49
|
return async (n, r = {}) => {
|
|
50
|
-
await e(
|
|
50
|
+
await e(Qt(n), t, r, { entity_id: n });
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function $t() {
|
|
54
54
|
let e = A(W)?.callService;
|
|
55
55
|
return e ? {
|
|
56
56
|
callService: e,
|
|
@@ -59,15 +59,15 @@ function Yt() {
|
|
|
59
59
|
toggle: G(e, "toggle")
|
|
60
60
|
} : se();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function en() {
|
|
63
63
|
let e = A(W)?.callService;
|
|
64
64
|
return e ? G(e, "turn_on") : fe();
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function tn() {
|
|
67
67
|
let e = A(W)?.callService;
|
|
68
68
|
return e ? G(e, "turn_off") : de();
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function nn() {
|
|
71
71
|
let e = A(W)?.callService;
|
|
72
72
|
return e ? G(e, "toggle") : ue();
|
|
73
73
|
}
|
|
@@ -79,7 +79,7 @@ var K = {
|
|
|
79
79
|
OVERLAY: 20,
|
|
80
80
|
ACTIONS: 30
|
|
81
81
|
}, q = /* @__PURE__ */ new WeakMap();
|
|
82
|
-
function
|
|
82
|
+
function rn(e = "controls") {
|
|
83
83
|
let [t, n] = O(!1), [r, i] = O(e), a = (t) => {
|
|
84
84
|
i(t ?? e), n(!0);
|
|
85
85
|
}, o = A(W);
|
|
@@ -106,15 +106,15 @@ function $t(e = "controls") {
|
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/framework/hooks/widget-registry.ts
|
|
109
|
-
var
|
|
110
|
-
function
|
|
111
|
-
return e[
|
|
109
|
+
var an = /* @__PURE__ */ new WeakMap(), on = Symbol("glasshome.widget.registry");
|
|
110
|
+
function sn(e) {
|
|
111
|
+
return e[on] ?? e;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function cn(e) {
|
|
114
114
|
if (!e) return;
|
|
115
|
-
let t =
|
|
115
|
+
let t = sn(e), n = an.get(t);
|
|
116
116
|
if (!n) {
|
|
117
|
-
let [e, r] = O(!1), [i, a] = O(), [o, s] = O(), [c, l] = O();
|
|
117
|
+
let [e, r] = O(!1), [i, a] = O(), [o, s] = O(), [c, l] = O(), [u, d] = O(!1);
|
|
118
118
|
n = {
|
|
119
119
|
hasSheet: e,
|
|
120
120
|
setHasSheet: r,
|
|
@@ -123,47 +123,49 @@ function rn(e) {
|
|
|
123
123
|
accent: o,
|
|
124
124
|
setAccent: s,
|
|
125
125
|
icon: c,
|
|
126
|
-
setIcon: l
|
|
127
|
-
|
|
126
|
+
setIcon: l,
|
|
127
|
+
nothingMore: u,
|
|
128
|
+
setNothingMore: d
|
|
129
|
+
}, an.set(t, n);
|
|
128
130
|
}
|
|
129
131
|
return n;
|
|
130
132
|
}
|
|
131
133
|
//#endregion
|
|
132
134
|
//#region src/framework/gestures/cursors.ts
|
|
133
|
-
var
|
|
134
|
-
function
|
|
135
|
+
var ln = 32, J = ln / 2, Y = "white", un = "rgba(0,0,0,0.4)", dn = 2, fn = 3;
|
|
136
|
+
function pn(e) {
|
|
135
137
|
return `url("data:image/svg+xml,${encodeURIComponent(e)}")`;
|
|
136
138
|
}
|
|
137
|
-
function
|
|
138
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
139
|
+
function mn(e) {
|
|
140
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${ln}" height="${ln}" viewBox="0 0 ${ln} ${ln}">${e}</svg>`;
|
|
139
141
|
}
|
|
140
|
-
var
|
|
142
|
+
var hn = mn(`
|
|
141
143
|
<g transform="translate(6, 2)">
|
|
142
144
|
<!-- shadow -->
|
|
143
|
-
<g stroke="${
|
|
145
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
144
146
|
<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"/>
|
|
145
147
|
</g>
|
|
146
148
|
<!-- main -->
|
|
147
|
-
<g stroke="${Y}" stroke-width="${
|
|
149
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
148
150
|
<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"/>
|
|
149
151
|
</g>
|
|
150
152
|
</g>
|
|
151
|
-
`),
|
|
153
|
+
`), gn = mn(`
|
|
152
154
|
<g>
|
|
153
|
-
<circle cx="${J}" cy="${J}" r="8" stroke="${
|
|
155
|
+
<circle cx="${J}" cy="${J}" r="8" stroke="${un}" stroke-width="${fn}" fill="none"/>
|
|
154
156
|
<circle cx="${J}" cy="${J}" r="8" stroke="${Y}" stroke-width="1.5" fill="none"/>
|
|
155
157
|
<circle cx="${J}" cy="${J}" r="1.5" fill="${Y}"/>
|
|
156
158
|
</g>
|
|
157
|
-
`),
|
|
159
|
+
`), _n = mn(`
|
|
158
160
|
<g>
|
|
159
161
|
<!-- shadow -->
|
|
160
|
-
<g stroke="${
|
|
162
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
161
163
|
<line x1="6" y1="${J}" x2="26" y2="${J}"/>
|
|
162
164
|
<polyline points="10,12 6,${J} 10,20"/>
|
|
163
165
|
<polyline points="22,12 26,${J} 22,20"/>
|
|
164
166
|
</g>
|
|
165
167
|
<!-- main -->
|
|
166
|
-
<g stroke="${Y}" stroke-width="${
|
|
168
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
167
169
|
<line x1="6" y1="${J}" x2="26" y2="${J}"/>
|
|
168
170
|
<polyline points="10,12 6,${J} 10,20"/>
|
|
169
171
|
<polyline points="22,12 26,${J} 22,20"/>
|
|
@@ -173,16 +175,16 @@ var dn = un(`
|
|
|
173
175
|
<circle cx="11" cy="${J}" r="1" fill="${Y}" opacity="0.6"/>
|
|
174
176
|
<circle cx="21" cy="${J}" r="1" fill="${Y}" opacity="0.6"/>
|
|
175
177
|
</g>
|
|
176
|
-
`),
|
|
178
|
+
`), vn = mn(`
|
|
177
179
|
<g>
|
|
178
180
|
<!-- shadow -->
|
|
179
|
-
<g stroke="${
|
|
181
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
180
182
|
<line x1="${J}" y1="6" x2="${J}" y2="26"/>
|
|
181
183
|
<polyline points="12,10 ${J},6 20,10"/>
|
|
182
184
|
<polyline points="12,22 ${J},26 20,22"/>
|
|
183
185
|
</g>
|
|
184
186
|
<!-- main -->
|
|
185
|
-
<g stroke="${Y}" stroke-width="${
|
|
187
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
186
188
|
<line x1="${J}" y1="6" x2="${J}" y2="26"/>
|
|
187
189
|
<polyline points="12,10 ${J},6 20,10"/>
|
|
188
190
|
<polyline points="12,22 ${J},26 20,22"/>
|
|
@@ -192,10 +194,10 @@ var dn = un(`
|
|
|
192
194
|
<circle cx="${J}" cy="11" r="1" fill="${Y}" opacity="0.6"/>
|
|
193
195
|
<circle cx="${J}" cy="21" r="1" fill="${Y}" opacity="0.6"/>
|
|
194
196
|
</g>
|
|
195
|
-
`),
|
|
197
|
+
`), yn = mn(`
|
|
196
198
|
<g>
|
|
197
199
|
<!-- shadow -->
|
|
198
|
-
<g stroke="${
|
|
200
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
199
201
|
<line x1="7" y1="${J}" x2="25" y2="${J}"/>
|
|
200
202
|
<line x1="${J}" y1="7" x2="${J}" y2="25"/>
|
|
201
203
|
<polyline points="11,13 7,${J} 11,19"/>
|
|
@@ -204,7 +206,7 @@ var dn = un(`
|
|
|
204
206
|
<polyline points="13,21 ${J},25 19,21"/>
|
|
205
207
|
</g>
|
|
206
208
|
<!-- main -->
|
|
207
|
-
<g stroke="${Y}" stroke-width="${
|
|
209
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
208
210
|
<line x1="7" y1="${J}" x2="25" y2="${J}"/>
|
|
209
211
|
<line x1="${J}" y1="7" x2="${J}" y2="25"/>
|
|
210
212
|
<polyline points="11,13 7,${J} 11,19"/>
|
|
@@ -216,71 +218,69 @@ var dn = un(`
|
|
|
216
218
|
<circle cx="${J}" cy="${J}" r="2" fill="${Y}"/>
|
|
217
219
|
</g>
|
|
218
220
|
`);
|
|
219
|
-
function
|
|
221
|
+
function bn(e, t, n) {
|
|
220
222
|
return {
|
|
221
|
-
css: `${
|
|
223
|
+
css: `${pn(e)} ${t} ${n}, auto`,
|
|
222
224
|
hotspotX: t,
|
|
223
225
|
hotspotY: n
|
|
224
226
|
};
|
|
225
227
|
}
|
|
226
|
-
var
|
|
227
|
-
tap:
|
|
228
|
-
hold: gn
|
|
229
|
-
slideHorizontal:
|
|
230
|
-
slideVertical:
|
|
231
|
-
slideAuto:
|
|
228
|
+
var xn = {
|
|
229
|
+
tap: bn(hn, 12, 4),
|
|
230
|
+
hold: bn(gn, 16, 16),
|
|
231
|
+
slideHorizontal: bn(_n, J, J),
|
|
232
|
+
slideVertical: bn(vn, J, J),
|
|
233
|
+
slideAuto: bn(yn, J, J)
|
|
232
234
|
};
|
|
233
235
|
//#endregion
|
|
234
236
|
//#region src/framework/gestures/haptics.ts
|
|
235
|
-
function
|
|
237
|
+
function Sn() {
|
|
236
238
|
if (typeof window > "u") return null;
|
|
237
239
|
let e = window;
|
|
238
240
|
return e.Capacitor?.isNativePlatform?.() ? e.Capacitor.Plugins?.Haptics ?? null : null;
|
|
239
241
|
}
|
|
240
|
-
function
|
|
242
|
+
function Cn(e) {
|
|
241
243
|
if (typeof navigator < "u" && typeof navigator.vibrate == "function") try {
|
|
242
244
|
navigator.vibrate(e);
|
|
243
245
|
} catch {}
|
|
244
246
|
}
|
|
245
|
-
var
|
|
247
|
+
var wn = {
|
|
246
248
|
tick() {
|
|
247
|
-
let e =
|
|
249
|
+
let e = Sn();
|
|
248
250
|
if (e) {
|
|
249
251
|
e.impact({ style: "Light" }).catch(() => {});
|
|
250
252
|
return;
|
|
251
253
|
}
|
|
252
|
-
|
|
254
|
+
Cn(8);
|
|
253
255
|
},
|
|
254
256
|
bump() {
|
|
255
|
-
let e =
|
|
257
|
+
let e = Sn();
|
|
256
258
|
if (e) {
|
|
257
259
|
e.impact({ style: "Medium" }).catch(() => {});
|
|
258
260
|
return;
|
|
259
261
|
}
|
|
260
|
-
|
|
262
|
+
Cn(20);
|
|
261
263
|
},
|
|
262
264
|
pulse() {
|
|
263
|
-
let e =
|
|
265
|
+
let e = Sn();
|
|
264
266
|
if (e) {
|
|
265
267
|
e.impact({ style: "Heavy" }).catch(() => {});
|
|
266
268
|
return;
|
|
267
269
|
}
|
|
268
|
-
|
|
270
|
+
Cn([
|
|
269
271
|
0,
|
|
270
272
|
15,
|
|
271
273
|
40,
|
|
272
274
|
15
|
|
273
275
|
]);
|
|
274
276
|
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
function xn(e, t) {
|
|
279
|
-
let n = A(W), r = rn(n), i = () => {
|
|
277
|
+
}, Tn = "button, a, input, select, textarea, [role=\"slider\"], [role=\"radio\"], [role=\"switch\"]";
|
|
278
|
+
function En(e, t) {
|
|
279
|
+
let n = A(W), r = cn(n), i = () => {
|
|
280
280
|
let t = e();
|
|
281
|
-
return t.hold || !n
|
|
281
|
+
return t.hold || !n ? t : {
|
|
282
282
|
...t,
|
|
283
|
-
hold: { action: () => q.get(n)?.() }
|
|
283
|
+
hold: { action: () => r?.hasSheet() ? q.get(n)?.() : r?.setNothingMore(!0) }
|
|
284
284
|
};
|
|
285
285
|
}, a = {
|
|
286
286
|
isDown: !1,
|
|
@@ -290,6 +290,7 @@ function xn(e, t) {
|
|
|
290
290
|
startTime: 0,
|
|
291
291
|
hasMoved: !1,
|
|
292
292
|
sliding: !1,
|
|
293
|
+
holdOnly: !1,
|
|
293
294
|
holdTimer: null,
|
|
294
295
|
graceTimer: null,
|
|
295
296
|
element: null
|
|
@@ -314,7 +315,7 @@ function xn(e, t) {
|
|
|
314
315
|
}
|
|
315
316
|
let m = () => {
|
|
316
317
|
a.holdTimer &&= (clearTimeout(a.holdTimer), null), a.graceTimer &&= (clearTimeout(a.graceTimer), null), s(null);
|
|
317
|
-
},
|
|
318
|
+
}, ee = (e) => {
|
|
318
319
|
let t = (e) => {
|
|
319
320
|
e.stopPropagation(), e.preventDefault();
|
|
320
321
|
}, n = () => e.removeEventListener("click", t, !0);
|
|
@@ -322,16 +323,16 @@ function xn(e, t) {
|
|
|
322
323
|
capture: !0,
|
|
323
324
|
once: !0
|
|
324
325
|
});
|
|
325
|
-
},
|
|
326
|
-
a.isDown = !1, a.hasMoved = !1, a.sliding = !1;
|
|
327
|
-
},
|
|
326
|
+
}, h = () => {
|
|
327
|
+
a.isDown = !1, a.hasMoved = !1, a.sliding = !1, a.holdOnly = !1;
|
|
328
|
+
}, g = (e) => {
|
|
328
329
|
let n = i().slide;
|
|
329
330
|
return n?.orientation === "horizontal" ? "horizontal" : n?.orientation === "vertical" ? "vertical" : e && (c || p(e), c) ? c.height > c.width ? "vertical" : "horizontal" : (t?.() ?? "horizontal") === "horizontal" ? "horizontal" : "vertical";
|
|
330
|
-
},
|
|
331
|
-
let t = i();
|
|
332
|
-
if (t.tap
|
|
333
|
-
if (a.isDown = !0, a.isTouch = e.pointerType === "touch", a.element = e.currentTarget, p(a.element), a.startX = e.clientX, a.startY = e.clientY, a.startTime = Date.now(), a.hasMoved = !1, a.sliding = !1, t.hold) {
|
|
334
|
-
let r = t.hold.delay ??
|
|
331
|
+
}, _ = (e) => {
|
|
332
|
+
let t = i(), r = e.target instanceof Element ? e.target.closest(`${Tn}, .glasshome-widget-controls`) : null, o = r !== null && r !== e.currentTarget;
|
|
333
|
+
if (!(o ? !t.hold : !t.tap && !t.hold && !t.slide)) {
|
|
334
|
+
if (a.isDown = !0, a.holdOnly = o, a.isTouch = e.pointerType === "touch", a.element = e.currentTarget, p(a.element), a.startX = e.clientX, a.startY = e.clientY, a.startTime = Date.now(), a.hasMoved = !1, a.sliding = !1, t.hold) {
|
|
335
|
+
let r = t.hold.delay ?? qe, i = a.element.getBoundingClientRect(), o = e.clientX - i.left, c = e.clientY - i.top, l = Math.hypot(Math.max(o, i.width - o), Math.max(c, i.height - c));
|
|
335
336
|
a.graceTimer = setTimeout(() => {
|
|
336
337
|
a.graceTimer = null, s({
|
|
337
338
|
x: o,
|
|
@@ -339,22 +340,22 @@ function xn(e, t) {
|
|
|
339
340
|
r: l,
|
|
340
341
|
fired: !1
|
|
341
342
|
});
|
|
342
|
-
}, Math.min(
|
|
343
|
+
}, Math.min(Ke, r)), a.holdTimer = setTimeout(() => {
|
|
343
344
|
a.holdTimer = null, a.isDown && !a.hasMoved && (s((e) => e && {
|
|
344
345
|
...e,
|
|
345
346
|
fired: !0
|
|
346
|
-
}),
|
|
347
|
+
}), wn.bump(), a.element && ee(a.element), t.hold?.action(), n?.onHeld?.(), a.isDown = !1);
|
|
347
348
|
}, r);
|
|
348
349
|
}
|
|
349
|
-
if (!a.isTouch && t.slide) try {
|
|
350
|
+
if (!a.isTouch && t.slide && !o) try {
|
|
350
351
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
351
352
|
} catch {}
|
|
352
353
|
}
|
|
353
|
-
},
|
|
354
|
+
}, v = (e) => {
|
|
354
355
|
if (!a.isDown) return;
|
|
355
356
|
let t = i(), n = e.clientX - a.startX, r = e.clientY - a.startY;
|
|
356
|
-
if (Math.sqrt(n * n + r * r) > 10 && (m(), a.hasMoved = !0), t.slide && a.hasMoved) {
|
|
357
|
-
let i = e.currentTarget, o =
|
|
357
|
+
if (Math.sqrt(n * n + r * r) > 10 && (m(), a.hasMoved = !0), t.slide && a.hasMoved && !a.holdOnly) {
|
|
358
|
+
let i = e.currentTarget, o = g(i);
|
|
358
359
|
if (a.isTouch && !a.sliding && Math.abs(o === "vertical" ? r : n) < Math.abs(o === "vertical" ? n : r)) return;
|
|
359
360
|
a.sliding = !0;
|
|
360
361
|
let s = t.slide.min ?? 0, l = t.slide.max ?? 100, u = l - s, d = o === "vertical" ? -r : n, f = c ?? {
|
|
@@ -363,26 +364,26 @@ function xn(e, t) {
|
|
|
363
364
|
}, p = d / (o === "vertical" ? f.height : f.width) * u, m = Math.max(s, Math.min(l, t.slide.value + p));
|
|
364
365
|
t.slide.onChange(Math.round(m)), a.startX = e.clientX, a.startY = e.clientY, e.preventDefault();
|
|
365
366
|
}
|
|
366
|
-
},
|
|
367
|
-
let t = i(), n = a.isDown, r = Date.now() - a.startTime, o = t.hold?.delay ??
|
|
368
|
-
m(), n && t.tap && !a.hasMoved && r < o && t.tap();
|
|
367
|
+
}, y = (e) => {
|
|
368
|
+
let t = i(), n = a.isDown, r = Date.now() - a.startTime, o = t.hold?.delay ?? qe;
|
|
369
|
+
m(), n && t.tap && !a.hasMoved && !a.holdOnly && r < o && t.tap();
|
|
369
370
|
try {
|
|
370
371
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
371
372
|
} catch {}
|
|
372
|
-
|
|
373
|
-
},
|
|
373
|
+
h();
|
|
374
|
+
}, b = (e) => {
|
|
374
375
|
m();
|
|
375
376
|
try {
|
|
376
377
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
377
378
|
} catch {}
|
|
378
|
-
|
|
379
|
-
},
|
|
379
|
+
h();
|
|
380
|
+
}, x = (e) => {
|
|
380
381
|
let t = i();
|
|
381
382
|
if (t.slide) {
|
|
382
383
|
let n = t.slide.orientation;
|
|
383
|
-
return n === "horizontal" ?
|
|
384
|
+
return n === "horizontal" ? xn.slideHorizontal.css : n === "vertical" ? xn.slideVertical.css : (c || p(e), c && c.height > c.width ? xn.slideVertical.css : xn.slideHorizontal.css);
|
|
384
385
|
}
|
|
385
|
-
return t.tap ?
|
|
386
|
+
return t.tap ? xn.tap.css : t.hold ? xn.hold.css : "";
|
|
386
387
|
};
|
|
387
388
|
return {
|
|
388
389
|
onKeyDown: (e) => {
|
|
@@ -390,13 +391,13 @@ function xn(e, t) {
|
|
|
390
391
|
let t = i();
|
|
391
392
|
(e.key === "Enter" || e.key === " ") && t.tap ? (e.preventDefault(), t.tap()) : (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") && t.hold && (e.preventDefault(), t.hold.action(), n?.onHeld?.());
|
|
392
393
|
},
|
|
393
|
-
onPointerDown:
|
|
394
|
-
onPointerMove:
|
|
395
|
-
onPointerUp:
|
|
396
|
-
onPointerCancel:
|
|
394
|
+
onPointerDown: _,
|
|
395
|
+
onPointerMove: v,
|
|
396
|
+
onPointerUp: y,
|
|
397
|
+
onPointerCancel: b,
|
|
397
398
|
onPointerEnter: (e) => {
|
|
398
399
|
let t = e.currentTarget;
|
|
399
|
-
a.element = t, t.style.cursor =
|
|
400
|
+
a.element = t, t.style.cursor = x(t);
|
|
400
401
|
},
|
|
401
402
|
bindElement: (e) => {
|
|
402
403
|
e && (a.element = e, p(e));
|
|
@@ -410,7 +411,7 @@ function xn(e, t) {
|
|
|
410
411
|
return e.tap || e.hold ? "manipulation" : "auto";
|
|
411
412
|
},
|
|
412
413
|
hold: o,
|
|
413
|
-
holds: () => !!
|
|
414
|
+
holds: () => !!e().hold || !!r?.hasSheet(),
|
|
414
415
|
dispose: () => {
|
|
415
416
|
m(), u &&= (u.disconnect(), null), l = null, c = null;
|
|
416
417
|
}
|
|
@@ -418,16 +419,16 @@ function xn(e, t) {
|
|
|
418
419
|
}
|
|
419
420
|
//#endregion
|
|
420
421
|
//#region src/framework/hooks/use-widget-dimensions.ts
|
|
421
|
-
var
|
|
422
|
-
function
|
|
423
|
-
let e = A(
|
|
422
|
+
var Dn = me();
|
|
423
|
+
function On() {
|
|
424
|
+
let e = A(Dn);
|
|
424
425
|
if (!e) throw Error("useWidgetDimensions must be called inside <Widget>: move the call into a component rendered within <Widget> (the top-level widget scope only sees the host stub).");
|
|
425
426
|
return e;
|
|
426
427
|
}
|
|
427
428
|
//#endregion
|
|
428
429
|
//#region src/framework/hooks/use-confirm.ts
|
|
429
|
-
var
|
|
430
|
-
function
|
|
430
|
+
var kn = 1600;
|
|
431
|
+
function An() {
|
|
431
432
|
let [e, t] = O(/* @__PURE__ */ new Set()), n;
|
|
432
433
|
return k(() => clearTimeout(n)), {
|
|
433
434
|
has: (t) => e().has(t),
|
|
@@ -438,35 +439,35 @@ function Tn() {
|
|
|
438
439
|
} catch {
|
|
439
440
|
return !1;
|
|
440
441
|
}
|
|
441
|
-
return t(new Set(e)), clearTimeout(n), n = setTimeout(() => t(/* @__PURE__ */ new Set()),
|
|
442
|
+
return t(new Set(e)), clearTimeout(n), n = setTimeout(() => t(/* @__PURE__ */ new Set()), kn), !0;
|
|
442
443
|
}
|
|
443
444
|
};
|
|
444
445
|
}
|
|
445
446
|
//#endregion
|
|
446
447
|
//#region src/framework/utils/cn.ts
|
|
447
448
|
function X(...e) {
|
|
448
|
-
return
|
|
449
|
+
return qt(Kt(e));
|
|
449
450
|
}
|
|
450
451
|
//#endregion
|
|
451
452
|
//#region src/framework/components/WidgetIcon.tsx
|
|
452
|
-
var
|
|
453
|
-
function
|
|
453
|
+
var jn = /*#__PURE__*/ B("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-2 glass glass-tint\">"), Mn = /*#__PURE__*/ B("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-3 glass glass-tint\">"), Nn = /*#__PURE__*/ B("<div><div class=\"glasshome-widget-icon-glyph flex items-center justify-center\">");
|
|
454
|
+
function Pn(e) {
|
|
454
455
|
let t = () => e.entityCount ?? 1;
|
|
455
456
|
return (() => {
|
|
456
|
-
var n =
|
|
457
|
+
var n = Nn(), r = n.firstChild;
|
|
457
458
|
return F(n, N(w, {
|
|
458
459
|
get when() {
|
|
459
460
|
return t() >= 2;
|
|
460
461
|
},
|
|
461
462
|
get children() {
|
|
462
|
-
return
|
|
463
|
+
return jn();
|
|
463
464
|
}
|
|
464
465
|
}), r), F(n, N(w, {
|
|
465
466
|
get when() {
|
|
466
467
|
return t() >= 3;
|
|
467
468
|
},
|
|
468
469
|
get children() {
|
|
469
|
-
return
|
|
470
|
+
return Mn();
|
|
470
471
|
}
|
|
471
472
|
}), r), F(r, () => e.icon), P((t) => {
|
|
472
473
|
var r = X("glasshome-widget-icon glass glass-tint", "pointer-events-none relative flex shrink-0 items-center justify-center transition-all", e.dimmed && "opacity-50", e.class), i = e.color ? { "--widget-icon-color": e.color } : void 0;
|
|
@@ -479,9 +480,9 @@ function kn(e) {
|
|
|
479
480
|
}
|
|
480
481
|
//#endregion
|
|
481
482
|
//#region src/framework/components/anatomy.tsx
|
|
482
|
-
var
|
|
483
|
-
function
|
|
484
|
-
let t = A(
|
|
483
|
+
var Fn = /*#__PURE__*/ B("<span class=glasshome-widget-eyebrow>"), In = /*#__PURE__*/ B("<div class=glasshome-widget-head-aside>"), Ln = /*#__PURE__*/ B("<div class=glasshome-widget-head><div class=glasshome-widget-head-text><span class=glasshome-widget-name>"), Rn = /*#__PURE__*/ B("<span class=glasshome-widget-sub>"), zn = /*#__PURE__*/ B("<span class=glasshome-widget-unit>"), Bn = /*#__PURE__*/ B("<div class=glasshome-widget-art>"), Vn = /*#__PURE__*/ B("<div><div class=glasshome-widget-reading><span class=glasshome-widget-reading-value>"), Hn = /*#__PURE__*/ B("<div class=glasshome-widget-controls>"), Un = /*#__PURE__*/ B("<div>"), Wn = /*#__PURE__*/ B("<div class=glasshome-widget-backdrop>"), Gn = /*#__PURE__*/ B("<div class=glasshome-widget-glyph aria-hidden=true>"), Kn = me(() => !1), qn = "mdi:check";
|
|
484
|
+
function Jn(e) {
|
|
485
|
+
let t = A(Kn), n = cn(A(W));
|
|
485
486
|
E(() => n?.setIcon(e.icon)), k(() => {
|
|
486
487
|
n?.icon() === e.icon && n?.setIcon(void 0);
|
|
487
488
|
});
|
|
@@ -490,15 +491,15 @@ function Un(e) {
|
|
|
490
491
|
return typeof t == "string" && typeof e.name == "string" && t.trim().toLowerCase() === e.name.trim().toLowerCase();
|
|
491
492
|
};
|
|
492
493
|
return (() => {
|
|
493
|
-
var n =
|
|
494
|
+
var n = Ln(), o = n.firstChild, s = o.firstChild;
|
|
494
495
|
return F(n, N(w, {
|
|
495
496
|
get when() {
|
|
496
497
|
return e.icon;
|
|
497
498
|
},
|
|
498
|
-
children: (n) => N(
|
|
499
|
+
children: (n) => N(Pn, {
|
|
499
500
|
get icon() {
|
|
500
501
|
return N(U, { get icon() {
|
|
501
|
-
return I(() => !!t())() ?
|
|
502
|
+
return I(() => !!t())() ? qn : n();
|
|
502
503
|
} });
|
|
503
504
|
},
|
|
504
505
|
get entityCount() {
|
|
@@ -514,7 +515,7 @@ function Un(e) {
|
|
|
514
515
|
return I(() => !!r())() && !a();
|
|
515
516
|
},
|
|
516
517
|
get children() {
|
|
517
|
-
var e =
|
|
518
|
+
var e = Fn();
|
|
518
519
|
return F(e, r), e;
|
|
519
520
|
}
|
|
520
521
|
}), s), F(s, () => e.name), F(n, N(w, {
|
|
@@ -522,22 +523,22 @@ function Un(e) {
|
|
|
522
523
|
return i();
|
|
523
524
|
},
|
|
524
525
|
get children() {
|
|
525
|
-
var e =
|
|
526
|
+
var e = In();
|
|
526
527
|
return F(e, i), e;
|
|
527
528
|
}
|
|
528
529
|
}), null), n;
|
|
529
530
|
})();
|
|
530
531
|
}
|
|
531
|
-
function
|
|
532
|
+
function Yn(e) {
|
|
532
533
|
let t = T(() => e.sub), n = T(() => e.art), r = D(() => typeof e.value == "string" ? e.value.replace(/[\d\s.,:/%°+\-−]/g, "") : void 0), i = () => typeof e.value == "string" || typeof e.value == "number" ? String(e.value).length + (e.unit ? .5 : 0) : void 0, [a, o] = O();
|
|
533
534
|
return E(he(r, () => o((e) => e === "a" ? "b" : "a"), { defer: !0 })), (() => {
|
|
534
|
-
var r =
|
|
535
|
+
var r = Vn(), o = r.firstChild, s = o.firstChild;
|
|
535
536
|
return F(o, N(w, {
|
|
536
537
|
get when() {
|
|
537
538
|
return t();
|
|
538
539
|
},
|
|
539
540
|
get children() {
|
|
540
|
-
var e =
|
|
541
|
+
var e = Rn();
|
|
541
542
|
return F(e, t), e;
|
|
542
543
|
}
|
|
543
544
|
}), s), F(s, () => e.value, null), F(s, N(w, {
|
|
@@ -545,7 +546,7 @@ function Wn(e) {
|
|
|
545
546
|
return e.unit;
|
|
546
547
|
},
|
|
547
548
|
get children() {
|
|
548
|
-
var t =
|
|
549
|
+
var t = zn();
|
|
549
550
|
return F(t, () => e.unit), P(() => L(t, "data-degree", e.unit === "°" || void 0)), t;
|
|
550
551
|
}
|
|
551
552
|
}), null), F(r, N(w, {
|
|
@@ -553,7 +554,7 @@ function Wn(e) {
|
|
|
553
554
|
return n();
|
|
554
555
|
},
|
|
555
556
|
get children() {
|
|
556
|
-
var e =
|
|
557
|
+
var e = Bn();
|
|
557
558
|
return F(e, n), e;
|
|
558
559
|
}
|
|
559
560
|
}), null), P((o) => {
|
|
@@ -568,13 +569,13 @@ function Wn(e) {
|
|
|
568
569
|
}), r;
|
|
569
570
|
})();
|
|
570
571
|
}
|
|
571
|
-
function
|
|
572
|
+
function Xn(e) {
|
|
572
573
|
return (() => {
|
|
573
|
-
var t =
|
|
574
|
-
return
|
|
574
|
+
var t = Hn();
|
|
575
|
+
return F(t, () => e.children), t;
|
|
575
576
|
})();
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
+
function Zn(e) {
|
|
578
579
|
return N(Oe, {
|
|
579
580
|
get "aria-label"() {
|
|
580
581
|
return e.label;
|
|
@@ -603,8 +604,8 @@ function Kn(e) {
|
|
|
603
604
|
}
|
|
604
605
|
});
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
-
return N(
|
|
607
|
+
function Qn(e) {
|
|
608
|
+
return N(Ft, {
|
|
608
609
|
get "aria-label"() {
|
|
609
610
|
return e.label;
|
|
610
611
|
},
|
|
@@ -621,7 +622,7 @@ function qn(e) {
|
|
|
621
622
|
get each() {
|
|
622
623
|
return e.options;
|
|
623
624
|
},
|
|
624
|
-
children: (t) => N(
|
|
625
|
+
children: (t) => N(Lt, {
|
|
625
626
|
get value() {
|
|
626
627
|
return t.value;
|
|
627
628
|
},
|
|
@@ -642,8 +643,8 @@ function qn(e) {
|
|
|
642
643
|
}
|
|
643
644
|
});
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
-
let t =
|
|
646
|
+
function $n(e) {
|
|
647
|
+
let t = An(), n = () => e.confirm ?? t, r = () => e.id ?? e["aria-label"] ?? e.icon, i = () => n().has(r());
|
|
647
648
|
return N(Ee, {
|
|
648
649
|
variant: "outline",
|
|
649
650
|
get size() {
|
|
@@ -661,12 +662,12 @@ function Jn(e) {
|
|
|
661
662
|
onClick: () => void n().run([r()], e.run),
|
|
662
663
|
get children() {
|
|
663
664
|
return [N(U, { get icon() {
|
|
664
|
-
return I(() => !!i())() ?
|
|
665
|
+
return I(() => !!i())() ? qn : e.icon;
|
|
665
666
|
} }), I(() => e.children)];
|
|
666
667
|
}
|
|
667
668
|
});
|
|
668
669
|
}
|
|
669
|
-
function
|
|
670
|
+
function er(e) {
|
|
670
671
|
return N(we, {
|
|
671
672
|
get tone() {
|
|
672
673
|
return e.tone ?? "var(--muted-foreground)";
|
|
@@ -684,53 +685,53 @@ function Yn(e) {
|
|
|
684
685
|
}
|
|
685
686
|
});
|
|
686
687
|
}
|
|
687
|
-
function
|
|
688
|
+
function tr(e) {
|
|
688
689
|
return (() => {
|
|
689
|
-
var t =
|
|
690
|
+
var t = Un();
|
|
690
691
|
return F(t, () => e.children), P(() => M(t, X("glasshome-widget-layer", e.class))), t;
|
|
691
692
|
})();
|
|
692
693
|
}
|
|
693
|
-
function
|
|
694
|
+
function nr(e) {
|
|
694
695
|
return (() => {
|
|
695
|
-
var t =
|
|
696
|
+
var t = Wn();
|
|
696
697
|
return F(t, () => e.children), t;
|
|
697
698
|
})();
|
|
698
699
|
}
|
|
699
|
-
function
|
|
700
|
-
let t = A(
|
|
700
|
+
function rr(e) {
|
|
701
|
+
let t = A(Kn);
|
|
701
702
|
return (() => {
|
|
702
|
-
var n =
|
|
703
|
+
var n = Gn();
|
|
703
704
|
return F(n, N(U, { get icon() {
|
|
704
|
-
return I(() => !!t())() ?
|
|
705
|
+
return I(() => !!t())() ? qn : e.icon;
|
|
705
706
|
} })), n;
|
|
706
707
|
})();
|
|
707
708
|
}
|
|
708
709
|
//#endregion
|
|
709
710
|
//#region src/framework/theming/tokens.css?raw
|
|
710
|
-
var $n = "/* Authoritative SDK CSS contract. Injected once on first Widget mount\n * via framework/theming/tokens.ts.\n *\n * All widget-internal visual scale is driven from CSS custom properties +\n * container queries on the `.glasshome-widget` shell (`container-type: size`).\n * No JS classifier, no size tier enum.\n */\n\n:root {\n --tone-success: oklch(0.7 0.18 145);\n --tone-warning: oklch(0.8 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.2 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-glow-default: 0.4;\n}\n\n.dark {\n --tone-success: oklch(0.74 0.18 145);\n --tone-warning: oklch(0.82 0.17 75);\n --tone-danger: oklch(0.68 0.22 27);\n --tone-info: oklch(0.7 0.2 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-glow-default: 0.5;\n}\n\n@property --widget-color {\n syntax: \"<color>\";\n inherits: true;\n initial-value: oklch(0.65 0.02 250);\n}\n\n/* === Widget shell ===\n * One scale: --widget-unit is 1% of the shell's short side. Each size is a floor,\n * a line through the designed 2x2 and 4x4 sizes, and past 4x4 the share it has\n * at 4x4. A widget sizes its own text with these tokens and scales with every tile. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n --widget-radius: var(--radius-xl, 12px);\n\n --widget-unit: 1cqmin;\n --widget-text-value: max(\n 22px,\n calc(8.5px + 13.4 * var(--widget-unit)),\n calc(16 * var(--widget-unit))\n );\n --widget-text-name: max(\n 14px,\n calc(8.9px + 4.37 * var(--widget-unit)),\n calc(7.07 * var(--widget-unit))\n );\n --widget-text-meta: max(\n 11px,\n calc(8px + 2.44 * var(--widget-unit)),\n calc(4.88 * var(--widget-unit))\n );\n --widget-text-sub: max(\n 12px,\n calc(10.1px + 1.22 * var(--widget-unit)),\n calc(4.3 * var(--widget-unit))\n );\n --widget-text-caption: max(11px, calc(3.6 * var(--widget-unit)));\n --widget-control-h: max(36px, calc(30px + 3.84 * var(--widget-unit)));\n --widget-grid-pad: max(\n 10px,\n calc(1.2px + 5.64 * var(--widget-unit)),\n calc(6 * var(--widget-unit))\n );\n --widget-grid-gap: max(6px, calc(2.5px + 2.23 * var(--widget-unit)));\n --widget-icon-box: max(\n 44px,\n calc(31.3px + 8.14 * var(--widget-unit)),\n calc(17.7 * var(--widget-unit))\n );\n --widget-icon-glyph: max(\n 24px,\n calc(16px + 5.12 * var(--widget-unit)),\n calc(10 * var(--widget-unit))\n );\n --widget-pad: clamp(8px, 3.5cqb, 22px);\n --widget-gap: clamp(6px, 2cqb, 14px);\n --widget-title-size: clamp(12px, 2cqi, 18px);\n --widget-subtitle: clamp(12px, 2.5cqi, 20px);\n --widget-status-size: clamp(14px, 5cqi, 36px);\n --widget-value-size: clamp(18px, 7cqi, 48px);\n --widget-badge-size: clamp(11px, 1.6cqi, 14px);\n}\n\n/* Shell material: ui's .glass, worn through the class Widget.tsx carries.\n * Unlayered and class-specific, so these beat the formula's :where() defaults\n * (wash-2 is re-declared there and cannot be set from a utility). The tone\n * stays the formula's transparent default until Widget.tsx sets one inline:\n * a widget without a tone is the plain card, never a neutral-grey wash. */\n.glasshome-widget {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --glass-wash: var(--widget-wash);\n --glass-wash-2: var(--widget-wash-2);\n --glass-wash-angle: 135deg;\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n --glass-rim: 0.3;\n --glass-lift: 0.45;\n --glass-shade: 0.05;\n backdrop-filter: var(--widget-backdrop, none);\n -webkit-backdrop-filter: var(--widget-backdrop, none);\n}\n/* A fill widget keeps a neutral card; the fill carries the tone, so a full fill is the toned card. */\n.glasshome-widget:has(.glasshome-widget-slider-fill) {\n --glass-wash: 0%;\n --glass-wash-2: 0%;\n}\n.dark .glasshome-widget {\n --glass-shade: 0;\n}\n\n/* === Slot: content layout === */\n/* Default: column. Flip to row only on wide-and-short widgets (matches the\n * old contentLayout heuristic: aspect > 1 AND height < 150px). */\n.glasshome-widget-content {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: var(--widget-pad);\n gap: var(--widget-gap);\n overflow: hidden;\n border-radius: var(--widget-radius);\n}\n@container widget (min-aspect-ratio: 1) and (max-height: 149px) {\n .glasshome-widget-content {\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n }\n}\n\n/* === Compact 1×1 ===\n * Small in BOTH axes → stack the tile: icon on top, label + status centered\n * under it. Icon stays moderate (not a hero) so the text keeps room. Wide\n * tiles (2×1) fail the width test and keep the row layout above. Placed after\n * the row-flip so it wins. */\n@container widget (max-width: 189px) and (max-height: 189px) {\n .glasshome-widget-content {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: clamp(4px, 2.5cqmin, 8px);\n }\n .glasshome-widget-content > * {\n align-items: center;\n text-align: center;\n }\n .glasshome-widget-icon {\n --widget-icon-box: clamp(36px, 30cqmin, 56px);\n --widget-icon-glyph: clamp(20px, 17cqmin, 32px);\n }\n .glasshome-widget-title {\n font-size: clamp(11px, 6cqmin, 14px);\n max-width: 100%;\n }\n .glasshome-widget-status,\n .glasshome-widget-value {\n font-size: clamp(13px, 7cqmin, 17px);\n }\n .glasshome-widget-content [class*=\"ml-auto\"] {\n margin-left: 0 !important;\n }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon ===\n * ui's tinted icon pill (ICON_PILL_TINT): the disc is .glass, so the material shapes it. */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n --glass-tone: var(--widget-icon-color, var(--widget-color));\n --glass-rim: 0.4;\n --glass-wash: 18%;\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n --stack-step: calc(var(--widget-icon-box) * 0.12);\n position: absolute;\n /* The pill's border would otherwise shrink each plate and widen the first step. */\n inset: -1px;\n width: auto;\n height: auto;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 {\n translate: var(--stack-step) var(--stack-step);\n opacity: 0.45;\n z-index: -2;\n}\n.glasshome-widget-icon-stack-3 {\n translate: calc(2 * var(--stack-step)) calc(2 * var(--stack-step));\n opacity: 0.2;\n z-index: -3;\n}\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: var(--color-muted-foreground, currentColor);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: var(--color-muted-foreground, currentColor);\n}\n.glasshome-widget-status {\n font-size: var(--widget-status-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.1;\n}\n.glasshome-widget-value {\n font-size: var(--widget-value-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.05;\n}\n.glasshome-widget-badge {\n font-size: var(--widget-badge-size);\n font-weight: 500;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--color-foreground, currentColor) 20%, transparent);\n color: var(--color-foreground, currentColor);\n}\n\n.glasshome-widget-loading {\n background: color-mix(in oklch, var(--widget-color) 20%, transparent);\n}\n\n/* === Slider fill ===\n * Value flows in via --widget-fill-value (0-100). Vertical orientation auto-\n * detected via container query. */\n.glasshome-widget-slider-fill {\n --widget-fill-value: 0;\n background: linear-gradient(\n 135deg,\n color-mix(\n in srgb,\n var(--widget-color) calc(var(--widget-wash) * var(--material-tint, 1)),\n transparent\n ),\n color-mix(\n in srgb,\n var(--widget-color-to, var(--widget-color))\n calc(var(--widget-wash-2) * var(--material-tint, 1)),\n transparent\n )\n );\n /* Inset: the clip-path cuts any outer shadow. */\n box-shadow: inset 0 0 calc(var(--material-glow, 0px) * 1.2)\n oklch(from var(--widget-color) l c h / 0.55);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0 round var(--widget-radius));\n}\n@container widget (max-aspect-ratio: 1) {\n .glasshome-widget-slider-fill {\n clip-path: inset(calc((100 - var(--widget-fill-value)) * 1%) 0 0 0 round var(--widget-radius));\n }\n}\n\n/* === Anatomy: Widget.Content with a Widget.Head lays its parts out as a tile === */\n.glasshome-widget-grid {\n position: relative;\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr) auto;\n gap: var(--widget-grid-gap);\n height: 100%;\n padding: var(--widget-grid-pad);\n overflow: hidden;\n isolation: isolate;\n color: var(--foreground);\n}\n\n/* In-flow content spans the tile (the max-content first column would collapse it); absolute parts keep the padding box. */\n.glasshome-widget-grid\n > :where(:not(.glasshome-widget-backdrop, .glasshome-widget-layer, .glasshome-widget-glyph)) {\n grid-column: 1 / -1;\n}\n.glasshome-widget-layer {\n position: absolute;\n inset: 0;\n z-index: -1;\n overflow: hidden;\n}\n.glasshome-widget-head {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n}\n.glasshome-widget-head-text {\n min-height: var(--widget-icon-box);\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n}\n.glasshome-widget-head-aside {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 6px;\n max-height: 26px;\n overflow: hidden;\n flex-shrink: 1;\n}\n.glasshome-widget-eyebrow {\n font-size: var(--widget-text-meta);\n font-weight: 500;\n line-height: 1.25;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.glasshome-widget-name {\n font-size: var(--widget-text-name);\n font-weight: 650;\n line-height: 1.2;\n letter-spacing: -0.01em;\n color: var(--foreground);\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n overflow-wrap: break-word;\n}\n\n.glasshome-widget-hero {\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n min-height: 0;\n min-width: 0;\n}\n.glasshome-widget-reading {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n z-index: 1;\n}\n.glasshome-widget-reading-value {\n font-size: var(--widget-text-value);\n font-weight: 650;\n line-height: 1;\n letter-spacing: -0.03em;\n font-variant-numeric: tabular-nums;\n color: var(--foreground);\n white-space: nowrap;\n}\n/* Alternating names restart the rise on each change without rebuilding the text. */\n.glasshome-widget-reading-value[data-turn=\"a\"] {\n animation: tile-value-in-a var(--duration-morph) var(--ease-morph);\n}\n.glasshome-widget-reading-value[data-turn=\"b\"] {\n animation: tile-value-in-b var(--duration-morph) var(--ease-morph);\n}\n@keyframes tile-value-in-a {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n@keyframes tile-value-in-b {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n.glasshome-widget-unit {\n font-size: 0.5em;\n font-weight: 550;\n letter-spacing: 0;\n margin-left: 0.08em;\n color: var(--muted-foreground);\n}\n.glasshome-widget-sub {\n font-size: var(--widget-text-sub);\n font-weight: 500;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Placed on the tile, not the hero, so a control row never moves or shrinks it. */\n.glasshome-widget-art {\n position: absolute;\n right: var(--widget-grid-pad);\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n pointer-events: none;\n}\n/* Beside art a long word (\"Unlocked\") shrinks to end where the art starts, at about 50cqi; short values keep full size. */\n@container widget (min-width: 180px) and (min-height: 130px) {\n .glasshome-widget-hero[data-art] .glasshome-widget-reading-value {\n font-size: max(18px, min(var(--widget-text-value), calc(50cqi / (var(--value-len, 1) * 0.56))));\n }\n}\n.glasshome-widget-backdrop > img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n/* Art keeps its shape and clears a state word at its largest (15cqi, about 3.4em); each art sets --art-aspect. */\n.glasshome-widget-grid .glasshome-widget-art > * {\n height: min(\n 100%,\n calc((52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap)) / var(--art-aspect, 1))\n );\n flex-shrink: 0;\n}\n.glasshome-widget-grid .glasshome-widget-art > img {\n width: auto;\n height: auto;\n max-height: 100%;\n max-width: calc(52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap));\n}\n\n.glasshome-widget-controls {\n display: flex;\n gap: 8px;\n min-width: 0;\n}\n\n.glasshome-widget-glyph {\n display: none;\n position: absolute;\n right: -8%;\n bottom: -22%;\n font-size: min(130cqb, 80cqi);\n line-height: 1;\n color: var(--widget-color);\n opacity: 0.16;\n pointer-events: none;\n z-index: -1;\n}\n\n/* Controls sit on the bottom row beside the value, or under it on a narrow tile; the art lifts above them. */\n.glasshome-widget-head {\n grid-column: 1 / -1;\n}\n.glasshome-widget-hero {\n grid-row: 3;\n grid-column: 1 / -1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1;\n}\n.glasshome-widget-controls {\n grid-row: 3;\n grid-column: 2;\n align-self: end;\n position: relative;\n z-index: 1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-hero[data-empty]) > .glasshome-widget-controls {\n grid-column: 1 / -1;\n}\n@container widget (max-width: 519px) {\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1 / -1;\n }\n .glasshome-widget-controls {\n grid-row: 4;\n grid-column: 1 / -1;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: calc(var(--widget-grid-pad) + var(--widget-control-h) + var(--widget-grid-gap));\n height: min(\n calc(\n 100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - 2 * var(--widget-grid-gap) -\n var(--widget-control-h)\n ),\n 48cqi\n );\n }\n}\n@container widget (max-height: 229px) {\n .glasshome-widget-controls {\n display: none;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n }\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-art {\n display: none;\n }\n}\n@container widget (max-height: 169px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget ((max-height: 129px) or (max-width: 139px)) {\n .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-name {\n -webkit-line-clamp: 1;\n }\n .glasshome-widget-grid {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n gap: 2px;\n }\n .glasshome-widget-head-icon,\n .glasshome-widget-art,\n .glasshome-widget-eyebrow,\n .glasshome-widget-sub {\n display: none;\n }\n .glasshome-widget-glyph {\n display: block;\n }\n .glasshome-widget-reading-value {\n font-size: clamp(18px, min(34cqb, 20cqi), 30px);\n }\n .glasshome-widget-name {\n font-size: clamp(12px, min(18cqb, 11cqi), 15px);\n font-weight: 550;\n color: var(--muted-foreground);\n }\n}\n@container widget (max-height: 129px) and (min-width: 260px) {\n .glasshome-widget-grid {\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n }\n .glasshome-widget-name {\n font-size: clamp(14px, 22cqb, 18px);\n font-weight: 650;\n color: var(--foreground);\n }\n .glasshome-widget-eyebrow {\n display: block;\n }\n}\n\n.glasshome-widget-backdrop {\n position: absolute;\n inset: 0;\n z-index: -2;\n overflow: hidden;\n}\n.glasshome-widget-backdrop > img.area-night {\n opacity: 0;\n transition: opacity 700ms ease;\n}\n.glasshome-widget-backdrop > img.area-night[data-visible] {\n opacity: 1;\n}\n.glasshome-widget-backdrop > .glasshome-widget-backdrop-light {\n position: absolute;\n inset: 0;\n background: radial-gradient(90% 80% at 25% 30%, oklch(0.8 0.14 70), transparent 70%);\n mix-blend-mode: soft-light;\n opacity: var(--backdrop-light, 0);\n transition: opacity 500ms ease;\n}\n.glasshome-widget-backdrop::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(\n to bottom,\n color-mix(in oklch, var(--card) 82%, transparent) 0%,\n color-mix(in oklch, var(--card) 40%, transparent) 22%,\n transparent 42%,\n transparent 62%,\n color-mix(in oklch, var(--card) 45%, transparent) 82%,\n color-mix(in oklch, var(--card) 80%, transparent) 100%\n );\n}\n\n@container widget (max-width: 239px) {\n .glasshome-widget-choice [data-optional] {\n display: none;\n }\n}\n@container widget (max-width: 259px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget (max-width: 139px) {\n .glasshome-widget-controls {\n display: none;\n }\n}\n\n.glasshome-widget-controls {\n justify-content: flex-start;\n align-items: center;\n}\n.glasshome-widget-control.glasshome-widget-control {\n width: var(--widget-control-h);\n height: var(--widget-control-h);\n}\n.glasshome-widget-choice .glasshome-widget-control.glasshome-widget-control {\n width: calc(var(--widget-control-h) - 8px);\n height: calc(var(--widget-control-h) - 8px);\n}\n@container widget (max-width: 179px) and (min-height: 130px) {\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head {\n flex-direction: column;\n gap: 6px;\n }\n}\n.glasshome-widget-unit[data-degree] {\n vertical-align: top;\n margin-left: 0.02em;\n color: var(--foreground);\n}\n.glasshome-widget-control-wide.glasshome-widget-control-wide {\n height: var(--widget-control-h);\n gap: 6px;\n padding: 0 14px;\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-grid:has(> .glasshome-widget-backdrop) .glasshome-widget-head-icon {\n display: none;\n }\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(\n .glasshome-widget-reading-value,\n .glasshome-widget-sub,\n .glasshome-widget-name,\n .glasshome-widget-eyebrow\n ) {\n text-shadow: 0 1px 8px color-mix(in oklch, var(--card) 75%, transparent);\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(.glasshome-widget-sub, .glasshome-widget-eyebrow) {\n color: color-mix(in oklch, var(--foreground) 82%, transparent);\n}\n/* Control glyphs and words keep their share of a control as it grows past 4x4. */\n.glasshome-widget-grid\n :is(.glasshome-widget-control, .glasshome-widget-control-wide)\n :is(iconify-icon, svg) {\n font-size: calc(var(--widget-control-h) * 0.43);\n width: 1em;\n height: 1em;\n}\n:is(.glasshome-widget-controls, .glasshome-widget-control-wide) {\n font-size: max(13px, calc(var(--widget-control-h) * 0.3));\n}\n/* A big tile with no art of its own carries its icon large and faint, so the glass is not an empty box. */\n@container widget (min-width: 300px) and (min-height: 260px) {\n .glasshome-widget-grid:not(\n :has(> .glasshome-widget-backdrop),\n :has(> .glasshome-widget-hero[data-art], > .glasshome-widget-art, > .glasshome-widget-layer)\n )\n > .glasshome-widget-glyph {\n display: block;\n right: -3%;\n bottom: -12%;\n font-size: min(78cqb, 52cqi);\n opacity: 0.1;\n }\n}\n/* A one-shot action confirms on its control and on the glyph, the one thing a compact tile shows. */\n.glasshome-widget-grid > .glasshome-widget-glyph {\n transition: opacity var(--duration-state) var(--ease-morph);\n}\n.glasshome-widget[data-confirmed] .glasshome-widget-glyph {\n opacity: 0.5;\n}\n.glasshome-widget-grid\n [data-confirmed]:is(.glasshome-widget-control, .glasshome-widget-control-wide) {\n --glass-base: color-mix(in srgb, var(--widget-color) 35%, transparent);\n transition: background-color var(--duration-state) var(--ease-morph);\n}\n\n/* === Sheet: what a held tile opens (framework/panel) ===\n * Rendered in a popover or dialog outside the widget's shadow root, so every rule\n * the sheet needs lives here, never in a widget's own utilities. */\n.glasshome-sheet {\n display: flex;\n flex-direction: column;\n gap: 18px;\n color: var(--foreground);\n}\n.glasshome-sheet [data-slot=\"swatch-picker\"] {\n max-width: 360px;\n}\n.glasshome-panel-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.glasshome-panel-label {\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--muted-foreground);\n}\n.glasshome-panel-rows {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\n gap: 8px;\n}\n.glasshome-panel-row-wrap {\n position: relative;\n min-width: 0;\n}\n.glasshome-panel-row {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --widget-radius: var(--radius-lg, 16px);\n --widget-icon-box: 34px;\n --widget-icon-glyph: 19px;\n position: relative;\n width: 100%;\n height: 56px;\n justify-content: flex-start;\n gap: 10px;\n padding: 0 12px 0 10px;\n overflow: hidden;\n text-align: left;\n touch-action: pan-y;\n}\n.glasshome-panel-row-static {\n cursor: default;\n scale: none;\n}\n.glasshome-panel-row-fill {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.glasshome-panel-row-icon {\n position: relative;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n}\n.glasshome-panel-row-icon-off {\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-text {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n/* A reading may take a second line rather than lose its end (\"3 Moderate\"). */\n.glasshome-panel-fact-value {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-fact-value {\n font-size: 14px;\n font-weight: 500;\n color: var(--foreground);\n}\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n font-size: 12px;\n font-weight: 400;\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-trailing {\n position: absolute;\n top: 50%;\n right: 10px;\n translate: 0 -50%;\n}\n.glasshome-panel-facts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));\n row-gap: 10px;\n padding: 10px 4px 10px 0;\n overflow: hidden;\n border-radius: var(--radius-lg, 16px);\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n -webkit-backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n}\n/* Without blur a see-through strip is just see-through: it takes the card fill. */\n.reduce-blur .glasshome-panel-facts {\n --glass-base: var(--card);\n}\n.glasshome-panel-fact {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n box-shadow: -1px 0 0 color-mix(in oklch, var(--foreground) 10%, transparent);\n}\n.glasshome-panel-fact-icon {\n flex-shrink: 0;\n font-size: 18px;\n color: var(--muted-foreground);\n}\n\n/* Inset: the grid cell clips anything drawn outside the tile. */\n.glasshome-widget:focus-visible {\n outline: 2px solid var(--ring);\n outline-offset: -2px;\n}\n\n/* === Hold flood: the dock's hold fill (ui HOLD_MOTION), grown from the finger === */\n.glasshome-widget-hold-flood {\n position: absolute;\n translate: -50% -50%;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--primary) 45%, transparent);\n pointer-events: none;\n scale: 0;\n opacity: 0;\n transition:\n scale var(--duration-state, 200ms) var(--ease-contract, ease-in),\n opacity var(--duration-state, 200ms) var(--ease-contract, ease-in);\n}\n.glasshome-widget-hold-flood[data-hold] {\n scale: 1;\n opacity: 1;\n transition-duration: var(--duration-morph, 400ms);\n transition-timing-function: linear;\n}\n.glasshome-widget-hold-flood[data-fired] {\n scale: 1;\n opacity: 0;\n}\n/* A row of ui buttons in a sheet (scenes, one-tap actions). */\n.glasshome-sheet-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n/* The sheet wears its tile: the tile's tone washed into the glass, its picture as a band behind\n the head that fades into the glass, so the tile reads as having grown open. */\n.glasshome-sheet-surface {\n --glass-wash: 20%;\n --glass-wash-2: 7%;\n --widget-icon-box: 48px;\n --widget-icon-glyph: 26px;\n}\n.glasshome-sheet-band {\n position: absolute;\n inset: 0 0 auto;\n height: 150px;\n overflow: hidden;\n pointer-events: none;\n mask-image: linear-gradient(180deg, #000 30%, transparent);\n}\n.glasshome-sheet-band > img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: 0.55;\n}\n.glasshome-sheet-surface > [data-slot$=\"-header\"],\n.glasshome-sheet-surface > [data-slot$=\"-body\"] {\n position: relative;\n}\n.glasshome-sheet-icon {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", er = !1, tr, nr = /* @__PURE__ */ new WeakSet();
|
|
711
|
-
function
|
|
712
|
-
return
|
|
711
|
+
var ir = "/* Authoritative SDK CSS contract. Injected once on first Widget mount\n * via framework/theming/tokens.ts.\n *\n * All widget-internal visual scale is driven from CSS custom properties +\n * container queries on the `.glasshome-widget` shell (`container-type: size`).\n * No JS classifier, no size tier enum.\n */\n\n:root {\n --tone-success: oklch(0.7 0.18 145);\n --tone-warning: oklch(0.8 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.2 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-glow-default: 0.4;\n}\n\n.dark {\n --tone-success: oklch(0.74 0.18 145);\n --tone-warning: oklch(0.82 0.17 75);\n --tone-danger: oklch(0.68 0.22 27);\n --tone-info: oklch(0.7 0.2 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-glow-default: 0.5;\n}\n\n@property --widget-color {\n syntax: \"<color>\";\n inherits: true;\n initial-value: oklch(0.65 0.02 250);\n}\n\n/* === Widget shell ===\n * One scale: --widget-unit is 1% of the shell's short side. Each size is a floor,\n * a line through the designed 2x2 and 4x4 sizes, and past 4x4 the share it has\n * at 4x4. A widget sizes its own text with these tokens and scales with every tile. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n --widget-radius: var(--radius-xl, 12px);\n\n --widget-unit: 1cqmin;\n --widget-text-value: max(\n 22px,\n calc(8.5px + 13.4 * var(--widget-unit)),\n calc(16 * var(--widget-unit))\n );\n --widget-text-name: max(\n 14px,\n calc(8.9px + 4.37 * var(--widget-unit)),\n calc(7.07 * var(--widget-unit))\n );\n --widget-text-meta: max(\n 11px,\n calc(8px + 2.44 * var(--widget-unit)),\n calc(4.88 * var(--widget-unit))\n );\n --widget-text-sub: max(\n 12px,\n calc(10.1px + 1.22 * var(--widget-unit)),\n calc(4.3 * var(--widget-unit))\n );\n --widget-text-caption: max(11px, calc(3.6 * var(--widget-unit)));\n --widget-control-h: max(36px, calc(30px + 3.84 * var(--widget-unit)));\n --widget-grid-pad: max(\n 10px,\n calc(1.2px + 5.64 * var(--widget-unit)),\n calc(6 * var(--widget-unit))\n );\n --widget-grid-gap: max(6px, calc(2.5px + 2.23 * var(--widget-unit)));\n --widget-icon-box: max(\n 44px,\n calc(31.3px + 8.14 * var(--widget-unit)),\n calc(17.7 * var(--widget-unit))\n );\n --widget-icon-glyph: max(\n 24px,\n calc(16px + 5.12 * var(--widget-unit)),\n calc(10 * var(--widget-unit))\n );\n --widget-pad: clamp(8px, 3.5cqb, 22px);\n --widget-gap: clamp(6px, 2cqb, 14px);\n --widget-title-size: clamp(12px, 2cqi, 18px);\n --widget-subtitle: clamp(12px, 2.5cqi, 20px);\n --widget-status-size: clamp(14px, 5cqi, 36px);\n --widget-value-size: clamp(18px, 7cqi, 48px);\n --widget-badge-size: clamp(11px, 1.6cqi, 14px);\n}\n\n/* Shell material: ui's .glass, worn through the class Widget.tsx carries.\n * Unlayered and class-specific, so these beat the formula's :where() defaults\n * (wash-2 is re-declared there and cannot be set from a utility). The tone\n * stays the formula's transparent default until Widget.tsx sets one inline:\n * a widget without a tone is the plain card, never a neutral-grey wash. */\n.glasshome-widget {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --glass-wash: var(--widget-wash);\n --glass-wash-2: var(--widget-wash-2);\n --glass-wash-angle: 135deg;\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n --glass-rim: 0.3;\n --glass-lift: 0.45;\n --glass-shade: 0.05;\n backdrop-filter: var(--widget-backdrop, none);\n -webkit-backdrop-filter: var(--widget-backdrop, none);\n}\n/* A fill widget keeps a neutral card; the fill carries the tone, so a full fill is the toned card. */\n.glasshome-widget:has(.glasshome-widget-slider-fill) {\n --glass-wash: 0%;\n --glass-wash-2: 0%;\n}\n.dark .glasshome-widget {\n --glass-shade: 0;\n}\n\n/* === Slot: content layout === */\n/* Default: column. Flip to row only on wide-and-short widgets (matches the\n * old contentLayout heuristic: aspect > 1 AND height < 150px). */\n.glasshome-widget-content {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: var(--widget-pad);\n gap: var(--widget-gap);\n overflow: hidden;\n border-radius: var(--widget-radius);\n}\n@container widget (min-aspect-ratio: 1) and (max-height: 149px) {\n .glasshome-widget-content {\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n }\n}\n\n/* === Compact 1×1 ===\n * Small in BOTH axes → stack the tile: icon on top, label + status centered\n * under it. Icon stays moderate (not a hero) so the text keeps room. Wide\n * tiles (2×1) fail the width test and keep the row layout above. Placed after\n * the row-flip so it wins. */\n@container widget (max-width: 189px) and (max-height: 189px) {\n .glasshome-widget-content {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: clamp(4px, 2.5cqmin, 8px);\n }\n .glasshome-widget-content > * {\n align-items: center;\n text-align: center;\n }\n .glasshome-widget-icon {\n --widget-icon-box: clamp(36px, 30cqmin, 56px);\n --widget-icon-glyph: clamp(20px, 17cqmin, 32px);\n }\n .glasshome-widget-title {\n font-size: clamp(11px, 6cqmin, 14px);\n max-width: 100%;\n }\n .glasshome-widget-status,\n .glasshome-widget-value {\n font-size: clamp(13px, 7cqmin, 17px);\n }\n .glasshome-widget-content [class*=\"ml-auto\"] {\n margin-left: 0 !important;\n }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon ===\n * ui's tinted icon pill (ICON_PILL_TINT): the disc is .glass, so the material shapes it. */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n --glass-tone: var(--widget-icon-color, var(--widget-color));\n --glass-rim: 0.4;\n --glass-wash: 18%;\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n --stack-step: calc(var(--widget-icon-box) * 0.12);\n position: absolute;\n /* The pill's border would otherwise shrink each plate and widen the first step. */\n inset: -1px;\n width: auto;\n height: auto;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 {\n translate: var(--stack-step) var(--stack-step);\n opacity: 0.45;\n z-index: -2;\n}\n.glasshome-widget-icon-stack-3 {\n translate: calc(2 * var(--stack-step)) calc(2 * var(--stack-step));\n opacity: 0.2;\n z-index: -3;\n}\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: var(--color-muted-foreground, currentColor);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: var(--color-muted-foreground, currentColor);\n}\n.glasshome-widget-status {\n font-size: var(--widget-status-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.1;\n}\n.glasshome-widget-value {\n font-size: var(--widget-value-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.05;\n}\n.glasshome-widget-badge {\n font-size: var(--widget-badge-size);\n font-weight: 500;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--color-foreground, currentColor) 20%, transparent);\n color: var(--color-foreground, currentColor);\n}\n\n.glasshome-widget-loading {\n background: color-mix(in oklch, var(--widget-color) 20%, transparent);\n}\n\n/* === Slider fill ===\n * Value flows in via --widget-fill-value (0-100). Vertical orientation auto-\n * detected via container query. */\n.glasshome-widget-slider-fill {\n --widget-fill-value: 0;\n background: linear-gradient(\n 135deg,\n color-mix(\n in srgb,\n var(--widget-color) calc(var(--widget-wash) * var(--material-tint, 1)),\n transparent\n ),\n color-mix(\n in srgb,\n var(--widget-color-to, var(--widget-color))\n calc(var(--widget-wash-2) * var(--material-tint, 1)),\n transparent\n )\n );\n /* Inset: the clip-path cuts any outer shadow. */\n box-shadow: inset 0 0 calc(var(--material-glow, 0px) * 1.2)\n oklch(from var(--widget-color) l c h / 0.55);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0 round var(--widget-radius));\n}\n@container widget (max-aspect-ratio: 1) {\n .glasshome-widget-slider-fill {\n clip-path: inset(calc((100 - var(--widget-fill-value)) * 1%) 0 0 0 round var(--widget-radius));\n }\n}\n\n/* === Anatomy: Widget.Content with a Widget.Head lays its parts out as a tile === */\n.glasshome-widget-grid {\n position: relative;\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr) auto;\n gap: var(--widget-grid-gap);\n height: 100%;\n padding: var(--widget-grid-pad);\n overflow: hidden;\n isolation: isolate;\n color: var(--foreground);\n}\n\n/* In-flow content spans the tile (the max-content first column would collapse it); absolute parts keep the padding box. */\n.glasshome-widget-grid\n > :where(:not(.glasshome-widget-backdrop, .glasshome-widget-layer, .glasshome-widget-glyph)) {\n grid-column: 1 / -1;\n}\n.glasshome-widget-layer {\n position: absolute;\n inset: 0;\n z-index: -1;\n overflow: hidden;\n}\n.glasshome-widget-head {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n}\n.glasshome-widget-head-text {\n min-height: var(--widget-icon-box);\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n}\n.glasshome-widget-head-aside {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 6px;\n max-height: 26px;\n overflow: hidden;\n flex-shrink: 1;\n}\n.glasshome-widget-eyebrow {\n font-size: var(--widget-text-meta);\n font-weight: 500;\n line-height: 1.25;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.glasshome-widget-name {\n font-size: var(--widget-text-name);\n font-weight: 650;\n line-height: 1.2;\n letter-spacing: -0.01em;\n color: var(--foreground);\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n overflow-wrap: break-word;\n}\n\n.glasshome-widget-hero {\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n min-height: 0;\n min-width: 0;\n}\n.glasshome-widget-reading {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n z-index: 1;\n}\n.glasshome-widget-reading-value {\n font-size: var(--widget-text-value);\n font-weight: 650;\n line-height: 1;\n letter-spacing: -0.03em;\n font-variant-numeric: tabular-nums;\n color: var(--foreground);\n white-space: nowrap;\n}\n/* Alternating names restart the rise on each change without rebuilding the text. */\n.glasshome-widget-reading-value[data-turn=\"a\"] {\n animation: tile-value-in-a var(--duration-morph) var(--ease-morph);\n}\n.glasshome-widget-reading-value[data-turn=\"b\"] {\n animation: tile-value-in-b var(--duration-morph) var(--ease-morph);\n}\n@keyframes tile-value-in-a {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n@keyframes tile-value-in-b {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n.glasshome-widget-unit {\n font-size: 0.5em;\n font-weight: 550;\n letter-spacing: 0;\n margin-left: 0.08em;\n color: var(--muted-foreground);\n}\n.glasshome-widget-sub {\n font-size: var(--widget-text-sub);\n font-weight: 500;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Placed on the tile, not the hero, so a control row never moves or shrinks it. */\n.glasshome-widget-art {\n position: absolute;\n right: var(--widget-grid-pad);\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n pointer-events: none;\n}\n/* Beside art a long word (\"Unlocked\") shrinks to end where the art starts, at about 50cqi; short values keep full size. */\n@container widget (min-width: 180px) and (min-height: 130px) {\n .glasshome-widget-hero[data-art] .glasshome-widget-reading-value {\n font-size: max(18px, min(var(--widget-text-value), calc(50cqi / (var(--value-len, 1) * 0.56))));\n }\n}\n.glasshome-widget-backdrop > img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n/* Art keeps its shape and clears a state word at its largest (15cqi, about 3.4em); each art sets --art-aspect. */\n.glasshome-widget-grid .glasshome-widget-art > * {\n height: min(\n 100%,\n calc((52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap)) / var(--art-aspect, 1))\n );\n flex-shrink: 0;\n}\n.glasshome-widget-grid .glasshome-widget-art > img {\n width: auto;\n height: auto;\n max-height: 100%;\n max-width: calc(52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap));\n}\n\n.glasshome-widget-controls {\n display: flex;\n gap: 8px;\n min-width: 0;\n}\n\n.glasshome-widget-glyph {\n display: none;\n position: absolute;\n right: -8%;\n bottom: -22%;\n font-size: min(130cqb, 80cqi);\n line-height: 1;\n color: var(--widget-color);\n opacity: 0.16;\n pointer-events: none;\n z-index: -1;\n}\n\n/* Controls sit on the bottom row beside the value, or under it on a narrow tile; the art lifts above them. */\n.glasshome-widget-head {\n grid-column: 1 / -1;\n}\n.glasshome-widget-hero {\n grid-row: 3;\n grid-column: 1 / -1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1;\n}\n.glasshome-widget-controls {\n grid-row: 3;\n grid-column: 2;\n align-self: end;\n position: relative;\n z-index: 1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-hero[data-empty]) > .glasshome-widget-controls {\n grid-column: 1 / -1;\n}\n@container widget (max-width: 519px) {\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1 / -1;\n }\n .glasshome-widget-controls {\n grid-row: 4;\n grid-column: 1 / -1;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: calc(var(--widget-grid-pad) + var(--widget-control-h) + var(--widget-grid-gap));\n height: min(\n calc(\n 100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - 2 * var(--widget-grid-gap) -\n var(--widget-control-h)\n ),\n 48cqi\n );\n }\n}\n@container widget (max-height: 229px) {\n .glasshome-widget-controls {\n display: none;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n }\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-art {\n display: none;\n }\n}\n@container widget (max-height: 169px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget ((max-height: 129px) or (max-width: 139px)) {\n .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-name {\n -webkit-line-clamp: 1;\n }\n .glasshome-widget-grid {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n gap: 2px;\n }\n .glasshome-widget-head-icon,\n .glasshome-widget-art,\n .glasshome-widget-eyebrow,\n .glasshome-widget-sub {\n display: none;\n }\n .glasshome-widget-glyph {\n display: block;\n }\n .glasshome-widget-reading-value {\n font-size: clamp(18px, min(34cqb, 20cqi), 30px);\n }\n .glasshome-widget-name {\n font-size: clamp(12px, min(18cqb, 11cqi), 15px);\n font-weight: 550;\n color: var(--muted-foreground);\n }\n}\n@container widget (max-height: 129px) and (min-width: 260px) {\n .glasshome-widget-grid {\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n }\n .glasshome-widget-name {\n font-size: clamp(14px, 22cqb, 18px);\n font-weight: 650;\n color: var(--foreground);\n }\n .glasshome-widget-eyebrow {\n display: block;\n }\n}\n\n.glasshome-widget-backdrop {\n position: absolute;\n inset: 0;\n z-index: -2;\n overflow: hidden;\n}\n.glasshome-widget-backdrop > img.area-night {\n opacity: 0;\n transition: opacity 700ms ease;\n}\n.glasshome-widget-backdrop > img.area-night[data-visible] {\n opacity: 1;\n}\n.glasshome-widget-backdrop > .glasshome-widget-backdrop-light {\n position: absolute;\n inset: 0;\n background: radial-gradient(90% 80% at 25% 30%, oklch(0.8 0.14 70), transparent 70%);\n mix-blend-mode: soft-light;\n opacity: var(--backdrop-light, 0);\n transition: opacity 500ms ease;\n}\n.glasshome-widget-backdrop::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(\n to bottom,\n color-mix(in oklch, var(--card) 82%, transparent) 0%,\n color-mix(in oklch, var(--card) 40%, transparent) 22%,\n transparent 42%,\n transparent 62%,\n color-mix(in oklch, var(--card) 45%, transparent) 82%,\n color-mix(in oklch, var(--card) 80%, transparent) 100%\n );\n}\n\n@container widget (max-width: 239px) {\n .glasshome-widget-choice [data-optional] {\n display: none;\n }\n}\n@container widget (max-width: 259px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget (max-width: 139px) {\n .glasshome-widget-controls {\n display: none;\n }\n}\n\n.glasshome-widget-controls {\n justify-content: flex-start;\n align-items: center;\n}\n.glasshome-widget-control.glasshome-widget-control {\n width: var(--widget-control-h);\n height: var(--widget-control-h);\n}\n.glasshome-widget-choice .glasshome-widget-control.glasshome-widget-control {\n width: calc(var(--widget-control-h) - 8px);\n height: calc(var(--widget-control-h) - 8px);\n}\n@container widget (max-width: 179px) and (min-height: 130px) {\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head {\n flex-direction: column;\n gap: 6px;\n }\n}\n.glasshome-widget-unit[data-degree] {\n vertical-align: top;\n margin-left: 0.02em;\n color: var(--foreground);\n}\n.glasshome-widget-control-wide.glasshome-widget-control-wide {\n height: var(--widget-control-h);\n gap: 6px;\n padding: 0 14px;\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-grid:has(> .glasshome-widget-backdrop) .glasshome-widget-head-icon {\n display: none;\n }\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(\n .glasshome-widget-reading-value,\n .glasshome-widget-sub,\n .glasshome-widget-name,\n .glasshome-widget-eyebrow\n ) {\n text-shadow: 0 1px 8px color-mix(in oklch, var(--card) 75%, transparent);\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(.glasshome-widget-sub, .glasshome-widget-eyebrow) {\n color: color-mix(in oklch, var(--foreground) 82%, transparent);\n}\n/* Control glyphs and words keep their share of a control as it grows past 4x4. */\n.glasshome-widget-grid\n :is(.glasshome-widget-control, .glasshome-widget-control-wide)\n :is(iconify-icon, svg) {\n font-size: calc(var(--widget-control-h) * 0.43);\n width: 1em;\n height: 1em;\n}\n:is(.glasshome-widget-controls, .glasshome-widget-control-wide) {\n font-size: max(13px, calc(var(--widget-control-h) * 0.3));\n}\n/* A big tile with no art of its own carries its icon large and faint, so the glass is not an empty box. */\n@container widget (min-width: 300px) and (min-height: 260px) {\n .glasshome-widget-grid:not(\n :has(> .glasshome-widget-backdrop),\n :has(> .glasshome-widget-hero[data-art], > .glasshome-widget-art, > .glasshome-widget-layer)\n )\n > .glasshome-widget-glyph {\n display: block;\n right: -3%;\n bottom: -12%;\n font-size: min(78cqb, 52cqi);\n opacity: 0.1;\n }\n}\n/* A one-shot action confirms on its control and on the glyph, the one thing a compact tile shows. */\n.glasshome-widget-grid > .glasshome-widget-glyph {\n transition: opacity var(--duration-state) var(--ease-morph);\n}\n.glasshome-widget[data-confirmed] .glasshome-widget-glyph {\n opacity: 0.5;\n}\n.glasshome-widget-grid\n [data-confirmed]:is(.glasshome-widget-control, .glasshome-widget-control-wide) {\n --glass-base: color-mix(in srgb, var(--widget-color) 35%, transparent);\n transition: background-color var(--duration-state) var(--ease-morph);\n}\n\n/* === Sheet: what a held tile opens (framework/panel) ===\n * Rendered in a popover or dialog outside the widget's shadow root, so every rule\n * the sheet needs lives here, never in a widget's own utilities. */\n.glasshome-sheet {\n display: flex;\n flex-direction: column;\n gap: 18px;\n color: var(--foreground);\n}\n.glasshome-sheet [data-slot=\"swatch-picker\"] {\n max-width: 360px;\n}\n.glasshome-panel-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.glasshome-panel-label {\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--muted-foreground);\n}\n.glasshome-panel-rows {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\n gap: 8px;\n}\n.glasshome-panel-row-wrap {\n position: relative;\n min-width: 0;\n}\n.glasshome-panel-row {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --widget-radius: var(--radius-lg, 16px);\n --widget-icon-box: 34px;\n --widget-icon-glyph: 19px;\n position: relative;\n width: 100%;\n height: 56px;\n justify-content: flex-start;\n gap: 10px;\n padding: 0 12px 0 10px;\n overflow: hidden;\n text-align: left;\n touch-action: pan-y;\n}\n.glasshome-panel-row-static {\n cursor: default;\n scale: none;\n}\n.glasshome-panel-row-fill {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.glasshome-panel-row-icon {\n position: relative;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n}\n.glasshome-panel-row-icon-off {\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-text {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n/* A reading may take a second line rather than lose its end (\"3 Moderate\"). */\n.glasshome-panel-fact-value {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-fact-value {\n font-size: 14px;\n font-weight: 500;\n color: var(--foreground);\n}\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n font-size: 12px;\n font-weight: 400;\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-trailing {\n position: absolute;\n top: 50%;\n right: 10px;\n translate: 0 -50%;\n}\n.glasshome-panel-facts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));\n row-gap: 10px;\n padding: 10px 4px 10px 0;\n overflow: hidden;\n border-radius: var(--radius-lg, 16px);\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n -webkit-backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n}\n/* Without blur a see-through strip is just see-through: it takes the card fill. */\n.reduce-blur .glasshome-panel-facts {\n --glass-base: var(--card);\n}\n.glasshome-panel-fact {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n box-shadow: -1px 0 0 color-mix(in oklch, var(--foreground) 10%, transparent);\n}\n.glasshome-panel-fact-icon {\n flex-shrink: 0;\n font-size: 18px;\n color: var(--muted-foreground);\n}\n\n/* Inset: the grid cell clips anything drawn outside the tile. */\n.glasshome-widget:focus-visible {\n outline: 2px solid var(--ring);\n outline-offset: -2px;\n}\n\n/* === Hold flood: the dock's hold fill (ui HOLD_MOTION), grown from the finger === */\n.glasshome-widget-hold-flood {\n position: absolute;\n translate: -50% -50%;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--primary) 45%, transparent);\n pointer-events: none;\n scale: 0;\n opacity: 0;\n transition:\n scale var(--duration-state, 200ms) var(--ease-contract, ease-in),\n opacity var(--duration-state, 200ms) var(--ease-contract, ease-in);\n}\n.glasshome-widget-hold-flood[data-hold] {\n scale: 1;\n opacity: 1;\n transition-duration: var(--duration-hold, 250ms);\n transition-timing-function: linear;\n}\n.glasshome-widget-hold-flood[data-fired] {\n scale: 1;\n opacity: 0;\n}\n/* A row of ui buttons in a sheet (scenes, one-tap actions). */\n.glasshome-sheet-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n/* The sheet wears its tile: the tile's tone washed into the glass, its picture as a band behind\n the head that fades into the glass, so the tile reads as having grown open. */\n.glasshome-sheet-surface {\n --glass-wash: 20%;\n --glass-wash-2: 7%;\n --widget-icon-box: 48px;\n --widget-icon-glyph: 26px;\n}\n.glasshome-sheet-band {\n position: absolute;\n inset: 0 0 auto;\n height: 150px;\n overflow: hidden;\n pointer-events: none;\n mask-image: linear-gradient(180deg, #000 30%, transparent);\n}\n.glasshome-sheet-band > img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: 0.55;\n}\n.glasshome-sheet-surface > [data-slot$=\"-header\"],\n.glasshome-sheet-surface > [data-slot$=\"-body\"] {\n position: relative;\n}\n.glasshome-sheet-icon {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", ar = !1, or, sr = /* @__PURE__ */ new WeakSet();
|
|
712
|
+
function cr() {
|
|
713
|
+
return or || (or = new CSSStyleSheet(), or.replaceSync(ir.replace(/:root\b/g, ":host").replace(/^\.dark\b/gm, ":host(.dark)"))), or;
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function lr(e) {
|
|
715
716
|
if (typeof ShadowRoot < "u" && e instanceof ShadowRoot) {
|
|
716
|
-
if (
|
|
717
|
-
let t =
|
|
718
|
-
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]),
|
|
717
|
+
if (sr.has(e)) return;
|
|
718
|
+
let t = cr();
|
|
719
|
+
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]), sr.add(e);
|
|
719
720
|
return;
|
|
720
721
|
}
|
|
721
|
-
if (
|
|
722
|
+
if (ar) return;
|
|
722
723
|
let t = e ?? (typeof document > "u" ? void 0 : document);
|
|
723
724
|
if (!t) return;
|
|
724
725
|
if (t.head.querySelector?.("style[data-glasshome-tokens]")) {
|
|
725
|
-
|
|
726
|
+
ar = !0;
|
|
726
727
|
return;
|
|
727
728
|
}
|
|
728
729
|
let n = t.createElement("style");
|
|
729
|
-
n.setAttribute("data-glasshome-tokens", ""), n.textContent =
|
|
730
|
+
n.setAttribute("data-glasshome-tokens", ""), n.textContent = ir, t.head.appendChild(n), ar = !0;
|
|
730
731
|
}
|
|
731
732
|
//#endregion
|
|
732
733
|
//#region src/framework/variants/built-in-variants.ts
|
|
733
|
-
var
|
|
734
|
+
var ur = {
|
|
734
735
|
"classic-glass": { cssVars: {
|
|
735
736
|
"--widget-padding": "1.5rem",
|
|
736
737
|
"--widget-backdrop": "blur(var(--glass-blur, var(--material-blur, 24px))) saturate(1.8)"
|
|
@@ -750,15 +751,15 @@ var ar = {
|
|
|
750
751
|
"--widget-backdrop": "blur(16px) saturate(1.8)"
|
|
751
752
|
} }
|
|
752
753
|
};
|
|
753
|
-
function
|
|
754
|
-
return Object.hasOwn(
|
|
754
|
+
function dr(e) {
|
|
755
|
+
return Object.hasOwn(ur, e) ? ur[e] : void 0;
|
|
755
756
|
}
|
|
756
757
|
//#endregion
|
|
757
758
|
//#region src/framework/backgrounds/WidgetSliderFill.tsx
|
|
758
|
-
var
|
|
759
|
-
function
|
|
760
|
-
return e.color !== void 0 &&
|
|
761
|
-
var t =
|
|
759
|
+
var fr = /*#__PURE__*/ B("<div>"), pr = e(() => void 0, "sliderFill.color");
|
|
760
|
+
function mr(e) {
|
|
761
|
+
return e.color !== void 0 && pr(), (() => {
|
|
762
|
+
var t = fr();
|
|
762
763
|
return P((n) => {
|
|
763
764
|
var r = X("glasshome-widget-slider-fill pointer-events-none absolute inset-0", e.isDragging ? "duration-0" : "transition-all duration-300 ease-out", e.class), i = {
|
|
764
765
|
"--widget-fill-value": e.value,
|
|
@@ -773,13 +774,13 @@ function lr(e) {
|
|
|
773
774
|
}
|
|
774
775
|
//#endregion
|
|
775
776
|
//#region src/framework/components/WidgetContent.tsx
|
|
776
|
-
var
|
|
777
|
-
function
|
|
778
|
-
let t =
|
|
777
|
+
var hr = /*#__PURE__*/ B("<div>"), gr = /\bglasshome-widget-(head|hero|controls|backdrop|glyph|layer)\b/;
|
|
778
|
+
function _r(e) {
|
|
779
|
+
let t = cn(A(W));
|
|
779
780
|
E(() => t?.setAccent(e.accent)), k(() => t?.setAccent(void 0));
|
|
780
|
-
let n = T(() => e.children), r = D(() => n.toArray().some((e) => e instanceof Element &&
|
|
781
|
+
let n = T(() => e.children), r = D(() => n.toArray().some((e) => e instanceof Element && gr.test(e.className)));
|
|
781
782
|
return (() => {
|
|
782
|
-
var t =
|
|
783
|
+
var t = hr();
|
|
783
784
|
return F(t, n), P((n) => {
|
|
784
785
|
var i = X(r() ? "glasshome-widget-grid" : "glasshome-widget-content", e.class), a = e.accent ? { "--widget-color": e.accent } : void 0;
|
|
785
786
|
return i !== n.e && M(t, n.e = i), n.t = z(t, a, n.t), n;
|
|
@@ -791,10 +792,10 @@ function fr(e) {
|
|
|
791
792
|
}
|
|
792
793
|
//#endregion
|
|
793
794
|
//#region src/framework/components/WidgetStatus.tsx
|
|
794
|
-
var
|
|
795
|
-
function
|
|
795
|
+
var vr = /*#__PURE__*/ B("<p>");
|
|
796
|
+
function yr(e) {
|
|
796
797
|
return (() => {
|
|
797
|
-
var t =
|
|
798
|
+
var t = vr();
|
|
798
799
|
return F(t, (() => {
|
|
799
800
|
var t = I(() => !!e.isUnavailable);
|
|
800
801
|
return () => t() ? "Unavailable" : e.children;
|
|
@@ -809,16 +810,16 @@ function mr(e) {
|
|
|
809
810
|
}
|
|
810
811
|
//#endregion
|
|
811
812
|
//#region src/framework/components/WidgetTitle.tsx
|
|
812
|
-
var
|
|
813
|
-
function
|
|
813
|
+
var br = /*#__PURE__*/ B("<span class=\"glasshome-widget-badge shrink-0\">"), xr = /*#__PURE__*/ B("<div><h3 class=glasshome-widget-title>");
|
|
814
|
+
function Sr(e) {
|
|
814
815
|
return (() => {
|
|
815
|
-
var t =
|
|
816
|
+
var t = xr(), n = t.firstChild;
|
|
816
817
|
return F(n, () => e.children), F(t, N(w, {
|
|
817
818
|
get when() {
|
|
818
819
|
return I(() => e.badge !== void 0)() && e.badge > 0;
|
|
819
820
|
},
|
|
820
821
|
get children() {
|
|
821
|
-
var t =
|
|
822
|
+
var t = br();
|
|
822
823
|
return F(t, () => e.badge), t;
|
|
823
824
|
}
|
|
824
825
|
}), null), P((n) => {
|
|
@@ -832,14 +833,14 @@ function _r(e) {
|
|
|
832
833
|
}
|
|
833
834
|
//#endregion
|
|
834
835
|
//#region src/framework/utils/clipboard.ts
|
|
835
|
-
async function
|
|
836
|
+
async function Cr(e) {
|
|
836
837
|
if (navigator.clipboard?.writeText) try {
|
|
837
838
|
return await navigator.clipboard.writeText(e), !0;
|
|
838
839
|
} catch {}
|
|
839
|
-
return
|
|
840
|
+
return wr(e);
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
-
let t =
|
|
842
|
+
function wr(e) {
|
|
843
|
+
let t = Tr(), n = document.createElement("textarea");
|
|
843
844
|
n.value = e, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.opacity = "0", (t?.parentElement ?? document.body).append(n);
|
|
844
845
|
try {
|
|
845
846
|
return n.focus(), n.select(), n.setSelectionRange(0, e.length), n.getRootNode().activeElement === n && document.execCommand("copy");
|
|
@@ -849,23 +850,23 @@ function yr(e) {
|
|
|
849
850
|
n.remove(), t?.focus();
|
|
850
851
|
}
|
|
851
852
|
}
|
|
852
|
-
function
|
|
853
|
+
function Tr() {
|
|
853
854
|
let e = document.activeElement;
|
|
854
855
|
for (; e?.shadowRoot?.activeElement;) e = e.shadowRoot.activeElement;
|
|
855
856
|
return e instanceof HTMLElement ? e : null;
|
|
856
857
|
}
|
|
857
|
-
function
|
|
858
|
+
function Er(e = 2e3) {
|
|
858
859
|
let [t, n] = O("idle"), r;
|
|
859
860
|
return k(() => clearTimeout(r)), {
|
|
860
861
|
state: t,
|
|
861
862
|
copy: async (t) => {
|
|
862
|
-
n(await
|
|
863
|
+
n(await Cr(t) ? "copied" : "failed"), clearTimeout(r), r = setTimeout(() => n("idle"), e);
|
|
863
864
|
}
|
|
864
865
|
};
|
|
865
866
|
}
|
|
866
867
|
//#endregion
|
|
867
868
|
//#region src/framework/utils/entity-aggregation.ts
|
|
868
|
-
function
|
|
869
|
+
function Dr(e, t = !1) {
|
|
869
870
|
let n = e[0];
|
|
870
871
|
if (!n) return {
|
|
871
872
|
isGroup: !1,
|
|
@@ -889,7 +890,7 @@ function Sr(e, t = !1) {
|
|
|
889
890
|
isUnavailable: e.state === "unavailable",
|
|
890
891
|
brightness: r,
|
|
891
892
|
brightnessPercent: i,
|
|
892
|
-
color:
|
|
893
|
+
color: Ar(e),
|
|
893
894
|
onCount: +!!t,
|
|
894
895
|
totalCount: 1,
|
|
895
896
|
description: t ? "On" : "Off"
|
|
@@ -901,7 +902,7 @@ function Sr(e, t = !1) {
|
|
|
901
902
|
if (i++, t.attributes?.brightness !== void 0 && (c += t.attributes.brightness, l++), t.attributes?.rgb_color) u.push(t.attributes.rgb_color);
|
|
902
903
|
else if (t.attributes?.hs_color) {
|
|
903
904
|
let [e, n] = t.attributes.hs_color;
|
|
904
|
-
u.push(
|
|
905
|
+
u.push(kr(e, n));
|
|
905
906
|
}
|
|
906
907
|
break;
|
|
907
908
|
case "off":
|
|
@@ -912,28 +913,28 @@ function Sr(e, t = !1) {
|
|
|
912
913
|
break;
|
|
913
914
|
case "unavailable": s++;
|
|
914
915
|
}
|
|
915
|
-
let d = e.length, f = s === d, p = o + s === d, m = i > 0,
|
|
916
|
-
t ? f ? (
|
|
917
|
-
let
|
|
916
|
+
let d = e.length, f = s === d, p = o + s === d, m = i > 0, ee = i === d, h = a === d, g, _;
|
|
917
|
+
t ? f ? (g = "unavailable", _ = !1) : o > 0 || s > 0 ? (g = "unknown", _ = !1) : a > 0 ? (g = "off", _ = !1) : (g = "on", _ = !0) : f ? (g = "unavailable", _ = !1) : p ? (g = "unknown", _ = !1) : m ? (g = "on", _ = !0) : (g = "off", _ = !1);
|
|
918
|
+
let v = l > 0 ? Math.round(c / l) : 0, y = Math.round(v / 255 * 100), b;
|
|
918
919
|
if (u.length > 0) {
|
|
919
|
-
let e = Math.round(u.reduce((e, t) => e + t[0], 0) / u.length), t = Math.round(u.reduce((e, t) => e + t[1], 0) / u.length), n = Math.round(u.reduce((e, t) => e + t[2], 0) / u.length), r =
|
|
920
|
-
|
|
921
|
-
} else
|
|
922
|
-
let
|
|
923
|
-
return
|
|
920
|
+
let e = Math.round(u.reduce((e, t) => e + t[0], 0) / u.length), t = Math.round(u.reduce((e, t) => e + t[1], 0) / u.length), n = Math.round(u.reduce((e, t) => e + t[2], 0) / u.length), r = v / 255;
|
|
921
|
+
b = `rgb(${Math.round(e * r)}, ${Math.round(t * r)}, ${Math.round(n * r)})`;
|
|
922
|
+
} else b = Ar(n);
|
|
923
|
+
let x;
|
|
924
|
+
return x = ee ? "All on" : h ? "All off" : i > 0 ? `${i} of ${d} on` : "Off", {
|
|
924
925
|
isGroup: r,
|
|
925
|
-
state:
|
|
926
|
-
isOn:
|
|
927
|
-
isUnavailable:
|
|
928
|
-
brightness:
|
|
929
|
-
brightnessPercent:
|
|
930
|
-
color:
|
|
926
|
+
state: g,
|
|
927
|
+
isOn: _,
|
|
928
|
+
isUnavailable: g === "unavailable",
|
|
929
|
+
brightness: v,
|
|
930
|
+
brightnessPercent: y,
|
|
931
|
+
color: b,
|
|
931
932
|
onCount: i,
|
|
932
933
|
totalCount: d,
|
|
933
|
-
description:
|
|
934
|
+
description: x
|
|
934
935
|
};
|
|
935
936
|
}
|
|
936
|
-
function
|
|
937
|
+
function Or(e, t = "mean", n = !0) {
|
|
937
938
|
let r = e[0];
|
|
938
939
|
if (!r) return {
|
|
939
940
|
isGroup: !1,
|
|
@@ -1030,7 +1031,7 @@ function Cr(e, t = "mean", n = !0) {
|
|
|
1030
1031
|
memberValues: o
|
|
1031
1032
|
};
|
|
1032
1033
|
}
|
|
1033
|
-
function
|
|
1034
|
+
function kr(e, t) {
|
|
1034
1035
|
let n = t / 100, r = n * (1 - Math.abs(e / 60 % 2 - 1)), i = 1 - n, a = 0, o = 0, s = 0;
|
|
1035
1036
|
return e < 60 ? [a, o] = [n, r] : e < 120 ? [a, o] = [r, n] : e < 180 ? [o, s] = [n, r] : e < 240 ? [o, s] = [r, n] : e < 300 ? [a, s] = [r, n] : [a, s] = [n, r], [
|
|
1036
1037
|
(a + i) * 255,
|
|
@@ -1038,7 +1039,7 @@ function wr(e, t) {
|
|
|
1038
1039
|
(s + i) * 255
|
|
1039
1040
|
];
|
|
1040
1041
|
}
|
|
1041
|
-
function
|
|
1042
|
+
function Ar(e) {
|
|
1042
1043
|
if (e.state !== "on") return "rgb(100, 100, 100)";
|
|
1043
1044
|
let t = (e.attributes?.brightness ?? 255) / 255;
|
|
1044
1045
|
if (e.attributes?.rgb_color) {
|
|
@@ -1046,7 +1047,7 @@ function Tr(e) {
|
|
|
1046
1047
|
return `rgb(${Math.round(n * t)}, ${Math.round(r * t)}, ${Math.round(i * t)})`;
|
|
1047
1048
|
}
|
|
1048
1049
|
if (e.attributes?.hs_color) {
|
|
1049
|
-
let [n, r] = e.attributes.hs_color, [i, a, o] =
|
|
1050
|
+
let [n, r] = e.attributes.hs_color, [i, a, o] = kr(n, r);
|
|
1050
1051
|
return `rgb(${Math.round(i * t)}, ${Math.round(a * t)}, ${Math.round(o * t)})`;
|
|
1051
1052
|
}
|
|
1052
1053
|
if (e.attributes?.color_temp) {
|
|
@@ -1057,7 +1058,7 @@ function Tr(e) {
|
|
|
1057
1058
|
}
|
|
1058
1059
|
//#endregion
|
|
1059
1060
|
//#region src/framework/utils/entity-state.ts
|
|
1060
|
-
function
|
|
1061
|
+
function jr(e) {
|
|
1061
1062
|
if (!e) return !1;
|
|
1062
1063
|
if ([
|
|
1063
1064
|
"on",
|
|
@@ -1073,15 +1074,15 @@ function Er(e) {
|
|
|
1073
1074
|
}
|
|
1074
1075
|
return !1;
|
|
1075
1076
|
}
|
|
1076
|
-
function
|
|
1077
|
+
function Mr(e, t, n) {
|
|
1077
1078
|
return e?.attributes ? e.attributes[t] ?? n : n;
|
|
1078
1079
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return e.filter(
|
|
1080
|
+
function Nr(e) {
|
|
1081
|
+
return e.filter(jr).length;
|
|
1081
1082
|
}
|
|
1082
1083
|
//#endregion
|
|
1083
1084
|
//#region src/framework/utils/format-value.ts
|
|
1084
|
-
function
|
|
1085
|
+
function Pr(e, t, n) {
|
|
1085
1086
|
let { decimals: r, scale: i = !0 } = n || {};
|
|
1086
1087
|
if (typeof e == "string") return t ? `${e}${t}` : e;
|
|
1087
1088
|
if (e == null || Number.isNaN(e)) return t ? `--${t}` : "--";
|
|
@@ -1092,47 +1093,51 @@ function kr(e, t, n) {
|
|
|
1092
1093
|
}
|
|
1093
1094
|
//#endregion
|
|
1094
1095
|
//#region src/framework/utils/interpret-value.ts
|
|
1095
|
-
function
|
|
1096
|
+
function Fr(e, t) {
|
|
1096
1097
|
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;
|
|
1097
1098
|
}
|
|
1098
1099
|
//#endregion
|
|
1099
1100
|
//#region src/framework/components/WidgetValue.tsx
|
|
1100
|
-
var
|
|
1101
|
-
function
|
|
1101
|
+
var Ir = /*#__PURE__*/ B("<div class=glasshome-widget-subtitle>"), Lr = /*#__PURE__*/ B("<div><div class=glasshome-widget-value>");
|
|
1102
|
+
function Rr(e) {
|
|
1102
1103
|
return (() => {
|
|
1103
|
-
var t =
|
|
1104
|
-
return F(n, () =>
|
|
1104
|
+
var t = Lr(), n = t.firstChild;
|
|
1105
|
+
return F(n, () => Pr(e.value, e.unit)), F(t, N(w, {
|
|
1105
1106
|
get when() {
|
|
1106
1107
|
return I(() => !!e.interpret)() && typeof e.value == "number";
|
|
1107
1108
|
},
|
|
1108
1109
|
get children() {
|
|
1109
|
-
var t =
|
|
1110
|
-
return F(t, () =>
|
|
1110
|
+
var t = Ir();
|
|
1111
|
+
return F(t, () => Fr(e.value, e.unit)), t;
|
|
1111
1112
|
}
|
|
1112
1113
|
}), null), P(() => M(t, X("flex flex-col", e.class))), t;
|
|
1113
1114
|
})();
|
|
1114
1115
|
}
|
|
1115
1116
|
//#endregion
|
|
1116
1117
|
//#region src/framework/core/Widget.tsx
|
|
1117
|
-
var
|
|
1118
|
-
function
|
|
1119
|
-
let n = A(W), r =
|
|
1118
|
+
var zr = /*#__PURE__*/ B("<span class=glasshome-widget-hold-flood aria-hidden=true>"), Br = /*#__PURE__*/ B("<div><div class=\"relative h-full w-full\">"), Vr = /*#__PURE__*/ B("<div class=\"glasshome-widget-loading pointer-events-none absolute inset-0 animate-pulse\">"), Hr = /*#__PURE__*/ B("<div class=\"flex h-full w-full flex-col items-center justify-center gap-2 text-center\">"), Ur = /*#__PURE__*/ B("<div class=\"text-muted-foreground flex items-center justify-center\">"), Wr = /*#__PURE__*/ B("<h3 class=\"text-foreground text-sm font-semibold\">"), Gr = /*#__PURE__*/ B("<p class=\"text-muted-foreground text-xs\">"), Kr = 2e3;
|
|
1119
|
+
function qr(t) {
|
|
1120
|
+
let n = A(W), r = En(() => ({ hold: { action: () => (q.get(n ?? {}) ?? q.get(f))?.("edit") } }));
|
|
1120
1121
|
k(r.dispose);
|
|
1121
|
-
let i =
|
|
1122
|
-
k(
|
|
1123
|
-
let
|
|
1124
|
-
|
|
1125
|
-
|
|
1122
|
+
let i = cn(n), a = !!n && !(on in n), o = En(() => ({ hold: i?.hasSheet() ? { action: () => (q.get(n ?? {}) ?? q.get(f))?.() } : void 0 }));
|
|
1123
|
+
k(o.dispose);
|
|
1124
|
+
let s = () => t.emptyState && n ? r : t.gestures ?? (a ? o : void 0);
|
|
1125
|
+
a && (E(() => n?.onHoldable?.(!t.emptyState && !!s()?.holds?.())), k(() => n?.onHoldable?.(!1))), E(() => {
|
|
1126
|
+
if (!a || !i?.nothingMore()) return;
|
|
1127
|
+
let e = setTimeout(() => i.setNothingMore(!1), Kr);
|
|
1128
|
+
k(() => clearTimeout(e));
|
|
1129
|
+
}), E(() => i?.setTone(t.color ?? (t.tone ? `var(--tone-${t.tone})` : void 0)));
|
|
1130
|
+
let [c, l] = O(), [u, d] = O({
|
|
1126
1131
|
width: 0,
|
|
1127
1132
|
height: 0
|
|
1128
1133
|
});
|
|
1129
1134
|
E(() => {
|
|
1130
|
-
let e =
|
|
1135
|
+
let e = c();
|
|
1131
1136
|
if (!e) return;
|
|
1132
1137
|
let t = new ResizeObserver(([e]) => {
|
|
1133
1138
|
if (!e) return;
|
|
1134
1139
|
let t = e.borderBoxSize?.[0];
|
|
1135
|
-
|
|
1140
|
+
d(t ? {
|
|
1136
1141
|
width: t.inlineSize,
|
|
1137
1142
|
height: t.blockSize
|
|
1138
1143
|
} : {
|
|
@@ -1142,23 +1147,23 @@ function Vr(t) {
|
|
|
1142
1147
|
});
|
|
1143
1148
|
t.observe(e), k(() => t.disconnect());
|
|
1144
1149
|
}), ge(() => {
|
|
1145
|
-
let e =
|
|
1146
|
-
|
|
1150
|
+
let e = c()?.getRootNode();
|
|
1151
|
+
lr(typeof ShadowRoot < "u" && e instanceof ShadowRoot || typeof Document < "u" && e instanceof Document ? e : void 0);
|
|
1147
1152
|
});
|
|
1148
|
-
let
|
|
1153
|
+
let f = {
|
|
1149
1154
|
...n,
|
|
1150
1155
|
updateConfig: n?.updateConfig ?? (() => {}),
|
|
1151
|
-
dimensions: e(() =>
|
|
1156
|
+
dimensions: e(() => u(), "ctx.dimensions")
|
|
1152
1157
|
};
|
|
1153
|
-
n && Object.defineProperty(
|
|
1154
|
-
let
|
|
1155
|
-
if (t.variant) return typeof t.variant == "string" ?
|
|
1156
|
-
}),
|
|
1158
|
+
n && Object.defineProperty(f, on, { value: n });
|
|
1159
|
+
let p = D(() => {
|
|
1160
|
+
if (t.variant) return typeof t.variant == "string" ? dr(t.variant) : t.variant.styles;
|
|
1161
|
+
}), m = e(() => t.gradient, "widget.gradient"), ee = D(() => ({
|
|
1157
1162
|
"container-type": "size",
|
|
1158
1163
|
"container-name": "widget",
|
|
1159
|
-
"touch-action":
|
|
1160
|
-
...
|
|
1161
|
-
...
|
|
1164
|
+
"touch-action": s() && !t.isEditMode ? s()?.touchAction() : void 0,
|
|
1165
|
+
...p()?.container,
|
|
1166
|
+
...p()?.cssVars || {},
|
|
1162
1167
|
...t.tone ? { "--widget-color": `var(--tone-${t.tone})` } : {},
|
|
1163
1168
|
...t.color ? { "--widget-color": t.color } : {},
|
|
1164
1169
|
...t.tone && t.tone !== "neutral" || t.color ? { "--glass-tone": "var(--widget-color)" } : {},
|
|
@@ -1166,22 +1171,22 @@ function Vr(t) {
|
|
|
1166
1171
|
"--widget-color-to": t.colorTo,
|
|
1167
1172
|
"--glass-tone-2": t.colorTo
|
|
1168
1173
|
} : {},
|
|
1169
|
-
...t.gradient ? { "background-image":
|
|
1170
|
-
})), h = () => !!
|
|
1171
|
-
h() &&
|
|
1174
|
+
...t.gradient ? { "background-image": m() } : {}
|
|
1175
|
+
})), h = () => !!s() && !t.isEditMode, g = (e) => {
|
|
1176
|
+
h() && s()?.onPointerEnter(e);
|
|
1172
1177
|
}, _ = (e) => {
|
|
1173
|
-
h() &&
|
|
1178
|
+
h() && s()?.onPointerDown(e);
|
|
1174
1179
|
}, v = (e) => {
|
|
1175
|
-
h() &&
|
|
1180
|
+
h() && s()?.onPointerMove(e);
|
|
1176
1181
|
}, y = (e) => {
|
|
1177
|
-
h() &&
|
|
1182
|
+
h() && s()?.onPointerUp(e);
|
|
1178
1183
|
}, b = (e) => {
|
|
1179
|
-
h() &&
|
|
1180
|
-
}, x = () =>
|
|
1184
|
+
h() && s()?.onPointerCancel(e);
|
|
1185
|
+
}, x = () => s()?.hold?.() ?? null, S = {
|
|
1181
1186
|
x: 0,
|
|
1182
1187
|
y: 0,
|
|
1183
1188
|
r: 0
|
|
1184
|
-
},
|
|
1189
|
+
}, te = (e) => (e && Object.assign(S, {
|
|
1185
1190
|
x: e.x,
|
|
1186
1191
|
y: e.y,
|
|
1187
1192
|
r: e.r
|
|
@@ -1193,63 +1198,86 @@ function Vr(t) {
|
|
|
1193
1198
|
"z-index": K.BACKGROUND
|
|
1194
1199
|
});
|
|
1195
1200
|
return N(W.Provider, {
|
|
1196
|
-
value:
|
|
1201
|
+
value: f,
|
|
1197
1202
|
get children() {
|
|
1198
|
-
return N(
|
|
1203
|
+
return N(Kn.Provider, {
|
|
1199
1204
|
value: () => t.confirmed === !0,
|
|
1200
1205
|
get children() {
|
|
1201
|
-
return N(
|
|
1202
|
-
value:
|
|
1206
|
+
return N(Dn.Provider, {
|
|
1207
|
+
value: u,
|
|
1203
1208
|
get children() {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
get children() {
|
|
1214
|
-
var e = Pr();
|
|
1215
|
-
return P((t) => {
|
|
1216
|
-
var n = x() && !x()?.fired ? "" : void 0, r = x()?.fired ? "" : void 0, i = ee(x());
|
|
1217
|
-
return n !== t.e && L(e, "data-hold", t.e = n), r !== t.t && L(e, "data-fired", t.t = r), t.a = z(e, i, t.a), t;
|
|
1218
|
-
}, {
|
|
1219
|
-
e: void 0,
|
|
1220
|
-
t: void 0,
|
|
1221
|
-
a: void 0
|
|
1222
|
-
}), e;
|
|
1223
|
-
}
|
|
1224
|
-
}), n), F(n, (() => {
|
|
1225
|
-
var e = I(() => !!t.emptyState);
|
|
1226
|
-
return () => e() ? N(Hr, {
|
|
1227
|
-
get icon() {
|
|
1228
|
-
return t.emptyState.icon;
|
|
1229
|
-
},
|
|
1230
|
-
get title() {
|
|
1231
|
-
return t.emptyState.title;
|
|
1209
|
+
return [(() => {
|
|
1210
|
+
var e = Br(), n = e.firstChild;
|
|
1211
|
+
return e.$$keydown = (e) => {
|
|
1212
|
+
h() && s()?.onKeyDown?.(e);
|
|
1213
|
+
}, j(e, "pointercancel", b), j(e, "pointerup", y), j(e, "pointermove", v), j(e, "pointerdown", _), j(e, "pointerenter", g), V((e) => {
|
|
1214
|
+
l(e), t.gestures?.bindElement(e), r.bindElement(e);
|
|
1215
|
+
}, e), F(e, N(w, {
|
|
1216
|
+
get when() {
|
|
1217
|
+
return s()?.hold;
|
|
1232
1218
|
},
|
|
1233
|
-
get
|
|
1234
|
-
|
|
1219
|
+
get children() {
|
|
1220
|
+
var e = zr();
|
|
1221
|
+
return P((t) => {
|
|
1222
|
+
var n = x() && !x()?.fired ? "" : void 0, r = x()?.fired ? "" : void 0, i = te(x());
|
|
1223
|
+
return n !== t.e && L(e, "data-hold", t.e = n), r !== t.t && L(e, "data-fired", t.t = r), t.a = z(e, i, t.a), t;
|
|
1224
|
+
}, {
|
|
1225
|
+
e: void 0,
|
|
1226
|
+
t: void 0,
|
|
1227
|
+
a: void 0
|
|
1228
|
+
}), e;
|
|
1235
1229
|
}
|
|
1236
|
-
})
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1230
|
+
}), n), F(n, (() => {
|
|
1231
|
+
var e = I(() => !!t.emptyState);
|
|
1232
|
+
return () => e() ? N(Jr, {
|
|
1233
|
+
get icon() {
|
|
1234
|
+
return t.emptyState.icon;
|
|
1235
|
+
},
|
|
1236
|
+
get title() {
|
|
1237
|
+
return t.emptyState.title;
|
|
1238
|
+
},
|
|
1239
|
+
get message() {
|
|
1240
|
+
return t.emptyState.message;
|
|
1241
|
+
}
|
|
1242
|
+
}) : t.children;
|
|
1243
|
+
})()), F(e, (() => {
|
|
1244
|
+
var e = I(() => !!t.loading);
|
|
1245
|
+
return () => e() && (() => {
|
|
1246
|
+
var e = Vr();
|
|
1247
|
+
return P((t) => R(e, "z-index", K.OVERLAY)), e;
|
|
1248
|
+
})();
|
|
1249
|
+
})(), null), P((r) => {
|
|
1250
|
+
var i = X("glasshome-widget glass", "relative h-full w-full overflow-hidden rounded-xl select-none", p()?.class, t.class), a = ee(), o = t.confirmed || void 0, s = h() ? 0 : void 0, c = K.CONTENT;
|
|
1251
|
+
return i !== r.e && M(e, r.e = i), r.t = z(e, a, r.t), o !== r.a && L(e, "data-confirmed", r.a = o), s !== r.o && L(e, "tabindex", r.o = s), c !== r.i && R(n, "z-index", r.i = c), r;
|
|
1252
|
+
}, {
|
|
1253
|
+
e: void 0,
|
|
1254
|
+
t: void 0,
|
|
1255
|
+
a: void 0,
|
|
1256
|
+
o: void 0,
|
|
1257
|
+
i: void 0
|
|
1258
|
+
}), e;
|
|
1259
|
+
})(), N(w, {
|
|
1260
|
+
when: a,
|
|
1261
|
+
get children() {
|
|
1262
|
+
return N(Ze, {
|
|
1263
|
+
get open() {
|
|
1264
|
+
return i?.nothingMore() ?? !1;
|
|
1265
|
+
},
|
|
1266
|
+
onOpenChange: (e) => {
|
|
1267
|
+
e || i?.setNothingMore(!1);
|
|
1268
|
+
},
|
|
1269
|
+
anchorRef: c,
|
|
1270
|
+
get children() {
|
|
1271
|
+
return N(Qe, {
|
|
1272
|
+
class: "flex w-auto items-center gap-2 p-3 text-sm",
|
|
1273
|
+
get children() {
|
|
1274
|
+
return [N(U, { icon: "mdi:information-outline" }), "No more controls for this widget"];
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
})];
|
|
1253
1281
|
}
|
|
1254
1282
|
});
|
|
1255
1283
|
}
|
|
@@ -1257,60 +1285,60 @@ function Vr(t) {
|
|
|
1257
1285
|
}
|
|
1258
1286
|
});
|
|
1259
1287
|
}
|
|
1260
|
-
function
|
|
1288
|
+
function Jr(e) {
|
|
1261
1289
|
return (() => {
|
|
1262
|
-
var t =
|
|
1290
|
+
var t = Hr();
|
|
1263
1291
|
return F(t, (() => {
|
|
1264
1292
|
var t = I(() => !!e.icon);
|
|
1265
1293
|
return () => t() && (() => {
|
|
1266
|
-
var t =
|
|
1294
|
+
var t = Ur();
|
|
1267
1295
|
return F(t, () => e.icon), t;
|
|
1268
1296
|
})();
|
|
1269
1297
|
})(), null), F(t, (() => {
|
|
1270
1298
|
var t = I(() => !!e.title);
|
|
1271
1299
|
return () => t() && (() => {
|
|
1272
|
-
var t =
|
|
1300
|
+
var t = Wr();
|
|
1273
1301
|
return F(t, () => e.title), t;
|
|
1274
1302
|
})();
|
|
1275
1303
|
})(), null), F(t, (() => {
|
|
1276
1304
|
var t = I(() => !!e.message);
|
|
1277
1305
|
return () => t() && (() => {
|
|
1278
|
-
var t =
|
|
1306
|
+
var t = Gr();
|
|
1279
1307
|
return F(t, () => e.message), t;
|
|
1280
1308
|
})();
|
|
1281
1309
|
})(), null), t;
|
|
1282
1310
|
})();
|
|
1283
1311
|
}
|
|
1284
|
-
var Z =
|
|
1285
|
-
Z.Content =
|
|
1312
|
+
var Z = qr;
|
|
1313
|
+
Z.Content = _r, Z.Icon = Pn, Z.Title = Sr, Z.Status = yr, Z.Value = Rr, Z.SliderFill = mr, Z.Head = Jn, Z.Hero = Yn, Z.Controls = Xn, Z.Stepper = Zn, Z.Choice = Qn, Z.Action = $n, Z.Chip = er, Z.Backdrop = nr, Z.Layer = tr, Z.Glyph = rr, ve(["keydown"]);
|
|
1286
1314
|
//#endregion
|
|
1287
1315
|
//#region src/framework/panel/panel.tsx
|
|
1288
|
-
var
|
|
1289
|
-
function
|
|
1316
|
+
var Yr = /*#__PURE__*/ B("<section class=glasshome-panel-section><h3 class=glasshome-panel-label>"), Xr = /*#__PURE__*/ B("<div class=glasshome-panel-rows>"), Zr = /*#__PURE__*/ B("<span class=\"glasshome-widget-slider-fill glasshome-panel-row-fill\">"), Qr = /*#__PURE__*/ B("<span class=\"glasshome-widget-icon glass glasshome-panel-row-icon\">"), $r = /*#__PURE__*/ B("<span class=glasshome-panel-row-state>"), ei = /*#__PURE__*/ B("<span class=glasshome-panel-row-text><span class=glasshome-panel-row-name>"), ti = /*#__PURE__*/ B("<span class=glasshome-panel-row-trailing>"), ni = /*#__PURE__*/ B("<div class=glasshome-panel-row-wrap>"), ri = /*#__PURE__*/ B("<div>"), ii = /*#__PURE__*/ B("<div class=\"glasshome-panel-facts glass\">"), ai = /*#__PURE__*/ B("<div class=glasshome-panel-fact><span class=glasshome-panel-row-text><span class=glasshome-panel-fact-label></span><span class=glasshome-panel-fact-value>"), oi = 8, si = (e, t, n) => Math.min(n, Math.max(t, e));
|
|
1317
|
+
function ci(e) {
|
|
1290
1318
|
let t = A(W), n, r = !1, i = !1, a, o = 0, s = (t, n) => {
|
|
1291
1319
|
let r = e.slide?.();
|
|
1292
1320
|
if (!r) return 0;
|
|
1293
1321
|
let i = t.getBoundingClientRect(), a = e.axis === "x" ? (n.clientX - i.left) / i.width : 1 - (n.clientY - i.top) / i.height, o = r.min ?? 0, s = r.max ?? 100;
|
|
1294
|
-
return Math.round(
|
|
1322
|
+
return Math.round(si(o + a * (s - o), o, s));
|
|
1295
1323
|
}, c = () => {
|
|
1296
1324
|
clearTimeout(a), n = void 0;
|
|
1297
1325
|
};
|
|
1298
1326
|
return k(() => clearTimeout(a)), {
|
|
1299
1327
|
onPointerDown: (o) => {
|
|
1300
1328
|
if (o.button !== 0 || n) return;
|
|
1301
|
-
let s = o.target instanceof Element ? o.target.closest(
|
|
1329
|
+
let s = o.target instanceof Element ? o.target.closest(Tn) : null;
|
|
1302
1330
|
s && s !== o.currentTarget || (n = {
|
|
1303
1331
|
x: o.clientX,
|
|
1304
1332
|
y: o.clientY,
|
|
1305
1333
|
id: o.pointerId
|
|
1306
1334
|
}, o.currentTarget.setPointerCapture?.(o.pointerId), r = !1, i = !1, e.onHold && (a = setTimeout(() => {
|
|
1307
1335
|
i = !0, e.onHold?.(), t?.onHeld?.();
|
|
1308
|
-
},
|
|
1336
|
+
}, qe)));
|
|
1309
1337
|
},
|
|
1310
1338
|
onPointerMove: (t) => {
|
|
1311
1339
|
if (!n || t.pointerId !== n.id || i) return;
|
|
1312
1340
|
let c = t.currentTarget, l = e.axis === "x" ? Math.abs(t.clientX - n.x) : Math.abs(t.clientY - n.y);
|
|
1313
|
-
!r && e.slide?.() && l >
|
|
1341
|
+
!r && e.slide?.() && l > oi && (r = !0, clearTimeout(a)), r ? (o = s(c, t), e.slide?.()?.onChange(o)) : Math.hypot(t.clientX - n.x, t.clientY - n.y) > oi && clearTimeout(a);
|
|
1314
1342
|
},
|
|
1315
1343
|
onPointerUp: (t) => {
|
|
1316
1344
|
n && t.pointerId === n.id && (r ? e.slide?.()?.onCommit?.(o) : i || e.onTap?.(), c());
|
|
@@ -1318,20 +1346,20 @@ function ii(e) {
|
|
|
1318
1346
|
onPointerCancel: c
|
|
1319
1347
|
};
|
|
1320
1348
|
}
|
|
1321
|
-
function
|
|
1349
|
+
function li(e) {
|
|
1322
1350
|
return (() => {
|
|
1323
|
-
var t =
|
|
1351
|
+
var t = Yr(), n = t.firstChild;
|
|
1324
1352
|
return F(n, () => e.label), F(t, () => e.children, null), t;
|
|
1325
1353
|
})();
|
|
1326
1354
|
}
|
|
1327
|
-
function
|
|
1355
|
+
function ui(e) {
|
|
1328
1356
|
return (() => {
|
|
1329
|
-
var t =
|
|
1357
|
+
var t = Xr();
|
|
1330
1358
|
return F(t, () => e.children), t;
|
|
1331
1359
|
})();
|
|
1332
1360
|
}
|
|
1333
|
-
function
|
|
1334
|
-
let t = () => !!(e.onTap || e.slide || e.onHold), n =
|
|
1361
|
+
function di(e) {
|
|
1362
|
+
let t = () => !!(e.onTap || e.slide || e.onHold), n = ci({
|
|
1335
1363
|
axis: "x",
|
|
1336
1364
|
slide: () => e.slide,
|
|
1337
1365
|
onTap: () => e.onTap?.(),
|
|
@@ -1348,7 +1376,7 @@ function si(e) {
|
|
|
1348
1376
|
let r = t.key === "ArrowRight" || t.key === "ArrowUp" ? 5 : t.key === "ArrowLeft" || t.key === "ArrowDown" ? -5 : 0;
|
|
1349
1377
|
if (!r) return;
|
|
1350
1378
|
t.preventDefault();
|
|
1351
|
-
let i =
|
|
1379
|
+
let i = si(n.value + r, n.min ?? 0, n.max ?? 100);
|
|
1352
1380
|
n.onChange(i), n.onCommit?.(i);
|
|
1353
1381
|
}, a = () => [
|
|
1354
1382
|
N(w, {
|
|
@@ -1356,12 +1384,12 @@ function si(e) {
|
|
|
1356
1384
|
return r() !== void 0;
|
|
1357
1385
|
},
|
|
1358
1386
|
get children() {
|
|
1359
|
-
var e =
|
|
1387
|
+
var e = Zr();
|
|
1360
1388
|
return P((t) => z(e, { "--widget-fill-value": r() }, t)), e;
|
|
1361
1389
|
}
|
|
1362
1390
|
}),
|
|
1363
1391
|
(() => {
|
|
1364
|
-
var t =
|
|
1392
|
+
var t = Qr();
|
|
1365
1393
|
return F(t, N(U, {
|
|
1366
1394
|
get icon() {
|
|
1367
1395
|
return e.icon;
|
|
@@ -1376,29 +1404,29 @@ function si(e) {
|
|
|
1376
1404
|
}), t;
|
|
1377
1405
|
})(),
|
|
1378
1406
|
(() => {
|
|
1379
|
-
var t =
|
|
1407
|
+
var t = ei(), n = t.firstChild;
|
|
1380
1408
|
return F(n, () => e.name), F(t, N(w, {
|
|
1381
1409
|
get when() {
|
|
1382
1410
|
return e.state !== void 0;
|
|
1383
1411
|
},
|
|
1384
1412
|
get children() {
|
|
1385
|
-
var t =
|
|
1413
|
+
var t = $r();
|
|
1386
1414
|
return F(t, () => e.state), t;
|
|
1387
1415
|
}
|
|
1388
1416
|
}), null), t;
|
|
1389
1417
|
})()
|
|
1390
1418
|
], o = () => ({ "--widget-color": e.tone ?? "var(--tone-neutral)" });
|
|
1391
1419
|
return (() => {
|
|
1392
|
-
var r =
|
|
1420
|
+
var r = ni();
|
|
1393
1421
|
return F(r, N(w, {
|
|
1394
1422
|
get when() {
|
|
1395
1423
|
return t();
|
|
1396
1424
|
},
|
|
1397
1425
|
get fallback() {
|
|
1398
1426
|
return (() => {
|
|
1399
|
-
var e =
|
|
1427
|
+
var e = ri();
|
|
1400
1428
|
return F(e, a), P((t) => {
|
|
1401
|
-
var n = `${
|
|
1429
|
+
var n = `${Rt({
|
|
1402
1430
|
variant: "outline",
|
|
1403
1431
|
size: "none"
|
|
1404
1432
|
})} glasshome-panel-row glasshome-panel-row-static`, r = o();
|
|
@@ -1449,21 +1477,21 @@ function si(e) {
|
|
|
1449
1477
|
return e.trailing;
|
|
1450
1478
|
},
|
|
1451
1479
|
get children() {
|
|
1452
|
-
var t =
|
|
1480
|
+
var t = ti();
|
|
1453
1481
|
return F(t, () => e.trailing), t;
|
|
1454
1482
|
}
|
|
1455
1483
|
}), null), r;
|
|
1456
1484
|
})();
|
|
1457
1485
|
}
|
|
1458
|
-
function
|
|
1486
|
+
function fi(e) {
|
|
1459
1487
|
return (() => {
|
|
1460
|
-
var t =
|
|
1488
|
+
var t = ii();
|
|
1461
1489
|
return F(t, N(C, {
|
|
1462
1490
|
get each() {
|
|
1463
1491
|
return e.items;
|
|
1464
1492
|
},
|
|
1465
1493
|
children: (e) => (() => {
|
|
1466
|
-
var t =
|
|
1494
|
+
var t = ai(), n = t.firstChild, r = n.firstChild, i = r.nextSibling;
|
|
1467
1495
|
return F(t, N(U, {
|
|
1468
1496
|
get icon() {
|
|
1469
1497
|
return e.icon;
|
|
@@ -1476,7 +1504,7 @@ function ci(e) {
|
|
|
1476
1504
|
}
|
|
1477
1505
|
//#endregion
|
|
1478
1506
|
//#region src/framework/panel/panel-entity.tsx
|
|
1479
|
-
var
|
|
1507
|
+
var pi = (e) => typeof e == "number" ? Math.round(e) : void 0, mi = (e) => e.charAt(0).toUpperCase() + e.slice(1).replaceAll("_", " "), Q = (e) => ({ entity_id: e.id }), hi = {
|
|
1480
1508
|
light: {
|
|
1481
1509
|
icon: "mdi:lightbulb",
|
|
1482
1510
|
tone: (e) => {
|
|
@@ -1516,10 +1544,10 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1516
1544
|
on: (e) => e.state === "on",
|
|
1517
1545
|
state: (e) => {
|
|
1518
1546
|
if (e.state !== "on") return "Off";
|
|
1519
|
-
let t =
|
|
1547
|
+
let t = pi(e.attributes.percentage);
|
|
1520
1548
|
return t === void 0 ? "On" : `${t}%`;
|
|
1521
1549
|
},
|
|
1522
|
-
level: (e) => e.state === "on" ?
|
|
1550
|
+
level: (e) => e.state === "on" ? pi(e.attributes.percentage) ?? 100 : 0,
|
|
1523
1551
|
setLevel: (e, t, n) => e("fan", "set_percentage", { percentage: n }, Q(t)),
|
|
1524
1552
|
tap: (e, t) => e("fan", "toggle", {}, Q(t))
|
|
1525
1553
|
},
|
|
@@ -1528,10 +1556,10 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1528
1556
|
tone: "var(--tone-info)",
|
|
1529
1557
|
on: (e) => e.state !== "closed",
|
|
1530
1558
|
state: (e) => {
|
|
1531
|
-
let t =
|
|
1559
|
+
let t = pi(e.attributes.current_position), n = mi(e.state);
|
|
1532
1560
|
return t !== void 0 && e.state === "open" ? `${n} · ${t}%` : n;
|
|
1533
1561
|
},
|
|
1534
|
-
level: (e) =>
|
|
1562
|
+
level: (e) => pi(e.attributes.current_position),
|
|
1535
1563
|
setLevel: (e, t, n) => e("cover", "set_cover_position", { position: n }, Q(t)),
|
|
1536
1564
|
tap: (e, t) => e("cover", t.state === "closed" ? "open_cover" : "close_cover", {}, Q(t))
|
|
1537
1565
|
},
|
|
@@ -1539,7 +1567,7 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1539
1567
|
icon: (e) => e.state === "locked" ? "mdi:lock" : "mdi:lock-open-variant",
|
|
1540
1568
|
tone: "var(--tone-success)",
|
|
1541
1569
|
on: (e) => e.state === "locked",
|
|
1542
|
-
state: (e) =>
|
|
1570
|
+
state: (e) => mi(e.state),
|
|
1543
1571
|
tap: (e, t) => e("lock", t.state === "locked" ? "unlock" : "lock", {}, Q(t))
|
|
1544
1572
|
},
|
|
1545
1573
|
climate: {
|
|
@@ -1549,14 +1577,14 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1549
1577
|
state: (e) => {
|
|
1550
1578
|
if (e.state === "off") return "Off";
|
|
1551
1579
|
let t = e.attributes.temperature;
|
|
1552
|
-
return typeof t == "number" ? `${
|
|
1580
|
+
return typeof t == "number" ? `${mi(e.state)} · ${t}°` : mi(e.state);
|
|
1553
1581
|
}
|
|
1554
1582
|
},
|
|
1555
1583
|
media_player: {
|
|
1556
1584
|
icon: "mdi:speaker",
|
|
1557
1585
|
tone: "var(--tone-accent)",
|
|
1558
1586
|
on: (e) => e.state === "playing",
|
|
1559
|
-
state: (e) => typeof e.attributes.media_title == "string" && e.state !== "off" ? e.attributes.media_title :
|
|
1587
|
+
state: (e) => typeof e.attributes.media_title == "string" && e.state !== "off" ? e.attributes.media_title : mi(e.state),
|
|
1560
1588
|
level: (e) => typeof e.attributes.volume_level == "number" ? Math.round(e.attributes.volume_level * 100) : void 0,
|
|
1561
1589
|
setLevel: (e, t, n) => e("media_player", "volume_set", { volume_level: n / 100 }, Q(t)),
|
|
1562
1590
|
tap: (e, t) => e("media_player", "media_play_pause", {}, Q(t))
|
|
@@ -1566,7 +1594,7 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1566
1594
|
tone: "var(--tone-info)",
|
|
1567
1595
|
on: (e) => e.state === "on",
|
|
1568
1596
|
state: (e) => {
|
|
1569
|
-
let t =
|
|
1597
|
+
let t = _i[e.deviceClass ?? ""] ?? ["On", "Off"];
|
|
1570
1598
|
return e.state === "on" ? t[0] : t[1];
|
|
1571
1599
|
}
|
|
1572
1600
|
},
|
|
@@ -1574,14 +1602,14 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1574
1602
|
icon: "mdi:gesture-tap-button",
|
|
1575
1603
|
tone: "var(--tone-accent)",
|
|
1576
1604
|
on: () => !1,
|
|
1577
|
-
state: (e) =>
|
|
1605
|
+
state: (e) => vi(e.state),
|
|
1578
1606
|
tap: (e, t) => e("button", "press", {}, Q(t))
|
|
1579
1607
|
},
|
|
1580
1608
|
input_button: {
|
|
1581
1609
|
icon: "mdi:gesture-tap-button",
|
|
1582
1610
|
tone: "var(--tone-accent)",
|
|
1583
1611
|
on: () => !1,
|
|
1584
|
-
state: (e) =>
|
|
1612
|
+
state: (e) => vi(e.state),
|
|
1585
1613
|
tap: (e, t) => e("input_button", "press", {}, Q(t))
|
|
1586
1614
|
},
|
|
1587
1615
|
scene: {
|
|
@@ -1598,14 +1626,14 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1598
1626
|
state: (e) => e.state === "on" ? "Running" : "Tap to run",
|
|
1599
1627
|
tap: (e, t) => e("script", "turn_on", {}, Q(t))
|
|
1600
1628
|
}
|
|
1601
|
-
},
|
|
1629
|
+
}, gi = {
|
|
1602
1630
|
garage: "mdi:garage",
|
|
1603
1631
|
gate: "mdi:gate",
|
|
1604
1632
|
door: "mdi:door",
|
|
1605
1633
|
curtain: "mdi:curtains",
|
|
1606
1634
|
shutter: "mdi:window-shutter",
|
|
1607
1635
|
awning: "mdi:awning"
|
|
1608
|
-
},
|
|
1636
|
+
}, _i = {
|
|
1609
1637
|
door: ["Open", "Closed"],
|
|
1610
1638
|
window: ["Open", "Closed"],
|
|
1611
1639
|
garage_door: ["Open", "Closed"],
|
|
@@ -1619,29 +1647,29 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1619
1647
|
battery: ["Low", "Normal"],
|
|
1620
1648
|
connectivity: ["Connected", "Disconnected"]
|
|
1621
1649
|
};
|
|
1622
|
-
function
|
|
1650
|
+
function vi(e) {
|
|
1623
1651
|
let t = Date.parse(e);
|
|
1624
1652
|
return Number.isNaN(t) ? "Never pressed" : new Date(t).toLocaleTimeString([], {
|
|
1625
1653
|
hour: "2-digit",
|
|
1626
1654
|
minute: "2-digit"
|
|
1627
1655
|
});
|
|
1628
1656
|
}
|
|
1629
|
-
var
|
|
1657
|
+
var yi = {
|
|
1630
1658
|
icon: "mdi:circle-medium",
|
|
1631
1659
|
tone: "var(--tone-neutral)",
|
|
1632
1660
|
on: (e) => e.state === "on",
|
|
1633
|
-
state: (e) =>
|
|
1661
|
+
state: (e) => mi(e.state)
|
|
1634
1662
|
};
|
|
1635
|
-
function
|
|
1663
|
+
function bi(e, t) {
|
|
1636
1664
|
if (!t || e.length <= t.length || !e.toLowerCase().startsWith(t.toLowerCase())) return e;
|
|
1637
1665
|
let n = e.slice(t.length).trim();
|
|
1638
1666
|
return n ? n.charAt(0).toUpperCase() + n.slice(1) : e;
|
|
1639
1667
|
}
|
|
1640
|
-
function
|
|
1641
|
-
return !!
|
|
1668
|
+
function xi(e) {
|
|
1669
|
+
return !!hi[e]?.tap || !!hi[e]?.setLevel;
|
|
1642
1670
|
}
|
|
1643
|
-
function
|
|
1644
|
-
let t = te(() => e.entityId), { callService: n } =
|
|
1671
|
+
function Si(e) {
|
|
1672
|
+
let t = te(() => e.entityId), { callService: n } = $t(), [r, i] = O();
|
|
1645
1673
|
return E(() => {
|
|
1646
1674
|
t(), i(void 0);
|
|
1647
1675
|
}), N(w, {
|
|
@@ -1649,14 +1677,14 @@ function vi(e) {
|
|
|
1649
1677
|
return t();
|
|
1650
1678
|
},
|
|
1651
1679
|
children: (t) => {
|
|
1652
|
-
let a = () =>
|
|
1653
|
-
return N(
|
|
1680
|
+
let a = () => hi[t().domain] ?? yi, o = () => r() ?? a().level?.(t()), s = () => a().setLevel;
|
|
1681
|
+
return N(di, {
|
|
1654
1682
|
get icon() {
|
|
1655
1683
|
let n = a().icon;
|
|
1656
|
-
return typeof n == "function" ? e.icon ?? n(t()) : e.icon ?? t().icon ??
|
|
1684
|
+
return typeof n == "function" ? e.icon ?? n(t()) : e.icon ?? t().icon ?? gi[t().domain === "cover" ? t().deviceClass ?? "" : ""] ?? n;
|
|
1657
1685
|
},
|
|
1658
1686
|
get name() {
|
|
1659
|
-
return e.name ??
|
|
1687
|
+
return e.name ?? bi(t().friendlyName ?? t().id, e.within);
|
|
1660
1688
|
},
|
|
1661
1689
|
get state() {
|
|
1662
1690
|
return a().state(t());
|
|
@@ -1688,8 +1716,8 @@ function vi(e) {
|
|
|
1688
1716
|
}
|
|
1689
1717
|
//#endregion
|
|
1690
1718
|
//#region src/framework/dialogs/debug-view.tsx
|
|
1691
|
-
var
|
|
1692
|
-
function
|
|
1719
|
+
var Ci = /*#__PURE__*/ B("<pre class=\"text-muted-foreground max-h-64 overflow-auto p-3 font-mono text-xs leading-relaxed\">"), wi = /*#__PURE__*/ B("<span class=\"flex items-center gap-2\">"), Ti = /*#__PURE__*/ B("<section class=\"flex min-w-0 flex-col gap-2\"><header class=\"flex items-center gap-3\"><div class=\"flex min-w-0 flex-1 flex-col\"></div></header><div class=\"flex flex-col gap-2\">"), Ei = /*#__PURE__*/ B("<div class=\"flex flex-col\">"), Di = /*#__PURE__*/ B("<pre class=\"text-muted-foreground max-h-96 overflow-auto p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap\">");
|
|
1720
|
+
function Oi(e, t, n) {
|
|
1693
1721
|
return {
|
|
1694
1722
|
widgetConfig: e,
|
|
1695
1723
|
entities: t.map((e) => ({
|
|
@@ -1706,17 +1734,17 @@ function wi(e, t, n) {
|
|
|
1706
1734
|
...n
|
|
1707
1735
|
};
|
|
1708
1736
|
}
|
|
1709
|
-
var
|
|
1737
|
+
var ki = (e) => JSON.stringify(e, null, 2), Ai = {
|
|
1710
1738
|
idle: "lucide:copy",
|
|
1711
1739
|
copied: "lucide:check",
|
|
1712
1740
|
failed: "lucide:triangle-alert"
|
|
1713
|
-
},
|
|
1741
|
+
}, ji = {
|
|
1714
1742
|
idle: "text-muted-foreground",
|
|
1715
1743
|
copied: "text-success",
|
|
1716
1744
|
failed: "text-destructive"
|
|
1717
1745
|
};
|
|
1718
|
-
function
|
|
1719
|
-
let { state: t, copy: n } =
|
|
1746
|
+
function Mi(e) {
|
|
1747
|
+
let { state: t, copy: n } = Er();
|
|
1720
1748
|
return N(Ee, {
|
|
1721
1749
|
variant: "ghost",
|
|
1722
1750
|
size: "icon",
|
|
@@ -1728,42 +1756,42 @@ function Oi(e) {
|
|
|
1728
1756
|
get children() {
|
|
1729
1757
|
return N(U, {
|
|
1730
1758
|
get icon() {
|
|
1731
|
-
return
|
|
1759
|
+
return Ai[t()];
|
|
1732
1760
|
},
|
|
1733
1761
|
width: 16,
|
|
1734
1762
|
height: 16,
|
|
1735
1763
|
get class() {
|
|
1736
|
-
return
|
|
1764
|
+
return ji[t()];
|
|
1737
1765
|
}
|
|
1738
1766
|
});
|
|
1739
1767
|
}
|
|
1740
1768
|
});
|
|
1741
1769
|
}
|
|
1742
|
-
function
|
|
1770
|
+
function Ni(e) {
|
|
1743
1771
|
let t = e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ");
|
|
1744
1772
|
return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
1745
1773
|
}
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1774
|
+
var Pi = (e) => e === null || typeof e != "object" && typeof e != "function";
|
|
1775
|
+
function Fi(e) {
|
|
1748
1776
|
return e == null ? "None" : String(e);
|
|
1749
1777
|
}
|
|
1750
|
-
function
|
|
1778
|
+
function Ii(e) {
|
|
1751
1779
|
return Array.isArray(e) ? e.length : typeof e == "object" && e ? Object.keys(e).length : 0;
|
|
1752
1780
|
}
|
|
1753
|
-
function
|
|
1781
|
+
function Li(e) {
|
|
1754
1782
|
let t = new Date(e);
|
|
1755
1783
|
return Number.isNaN(t.getTime()) ? e : t.toLocaleString();
|
|
1756
1784
|
}
|
|
1757
|
-
function
|
|
1758
|
-
return N(
|
|
1785
|
+
function Ri(e) {
|
|
1786
|
+
return N(mt, {
|
|
1759
1787
|
class: "overflow-hidden p-0",
|
|
1760
1788
|
get children() {
|
|
1761
|
-
var t =
|
|
1762
|
-
return F(t, () =>
|
|
1789
|
+
var t = Ci();
|
|
1790
|
+
return F(t, () => ki(e.value)), t;
|
|
1763
1791
|
}
|
|
1764
1792
|
});
|
|
1765
1793
|
}
|
|
1766
|
-
function
|
|
1794
|
+
function zi(e) {
|
|
1767
1795
|
return N(ye, {
|
|
1768
1796
|
collapsible: !0,
|
|
1769
1797
|
class: "border-border/50 border-t",
|
|
@@ -1776,7 +1804,7 @@ function Fi(e) {
|
|
|
1776
1804
|
return [N(Se, {
|
|
1777
1805
|
class: "text-muted-foreground py-3 text-xs",
|
|
1778
1806
|
get children() {
|
|
1779
|
-
var t =
|
|
1807
|
+
var t = wi();
|
|
1780
1808
|
return F(t, () => e.label, null), F(t, N(w, {
|
|
1781
1809
|
get when() {
|
|
1782
1810
|
return e.count !== void 0;
|
|
@@ -1789,7 +1817,7 @@ function Fi(e) {
|
|
|
1789
1817
|
}), null), t;
|
|
1790
1818
|
}
|
|
1791
1819
|
}), N(be, { get children() {
|
|
1792
|
-
return N(
|
|
1820
|
+
return N(Ri, { get value() {
|
|
1793
1821
|
return e.value;
|
|
1794
1822
|
} });
|
|
1795
1823
|
} })];
|
|
@@ -1798,10 +1826,10 @@ function Fi(e) {
|
|
|
1798
1826
|
}
|
|
1799
1827
|
});
|
|
1800
1828
|
}
|
|
1801
|
-
function
|
|
1829
|
+
function Bi(e) {
|
|
1802
1830
|
return (() => {
|
|
1803
|
-
var t =
|
|
1804
|
-
return F(n, N(
|
|
1831
|
+
var t = Ti(), n = t.firstChild, r = n.firstChild, i = n.nextSibling;
|
|
1832
|
+
return F(n, N(ft, {
|
|
1805
1833
|
get icon() {
|
|
1806
1834
|
return e.icon;
|
|
1807
1835
|
},
|
|
@@ -1815,28 +1843,28 @@ function Ii(e) {
|
|
|
1815
1843
|
get when() {
|
|
1816
1844
|
return e.subtitle;
|
|
1817
1845
|
},
|
|
1818
|
-
children: (e) => N(
|
|
1846
|
+
children: (e) => N(pt, {
|
|
1819
1847
|
class: "truncate font-mono",
|
|
1820
1848
|
get children() {
|
|
1821
1849
|
return e();
|
|
1822
1850
|
}
|
|
1823
1851
|
})
|
|
1824
|
-
}), null), F(n, () => e.badge, null), F(n, N(
|
|
1852
|
+
}), null), F(n, () => e.badge, null), F(n, N(Mi, {
|
|
1825
1853
|
get label() {
|
|
1826
1854
|
return `Copy ${e.title}`;
|
|
1827
1855
|
},
|
|
1828
|
-
text: () =>
|
|
1856
|
+
text: () => ki(e.source)
|
|
1829
1857
|
}), null), F(i, () => e.children), t;
|
|
1830
1858
|
})();
|
|
1831
1859
|
}
|
|
1832
|
-
function
|
|
1833
|
-
let t = D(() => Object.entries(e.record)), n = D(() => t().flatMap(([e, t]) =>
|
|
1860
|
+
function Vi(e) {
|
|
1861
|
+
let t = D(() => Object.entries(e.record)), n = D(() => t().flatMap(([e, t]) => Pi(t) ? [[e, t]] : [])), r = D(() => t().filter(([, e]) => !Pi(e)));
|
|
1834
1862
|
return N(w, {
|
|
1835
1863
|
get when() {
|
|
1836
1864
|
return t().length > 0;
|
|
1837
1865
|
},
|
|
1838
1866
|
get fallback() {
|
|
1839
|
-
return N(
|
|
1867
|
+
return N(pt, { children: "Nothing set" });
|
|
1840
1868
|
},
|
|
1841
1869
|
get children() {
|
|
1842
1870
|
return [N(w, {
|
|
@@ -1844,17 +1872,17 @@ function Li(e) {
|
|
|
1844
1872
|
return n().length > 0;
|
|
1845
1873
|
},
|
|
1846
1874
|
get children() {
|
|
1847
|
-
var e =
|
|
1875
|
+
var e = Ei();
|
|
1848
1876
|
return F(e, N(C, {
|
|
1849
1877
|
get each() {
|
|
1850
1878
|
return n();
|
|
1851
1879
|
},
|
|
1852
1880
|
children: ([e, t]) => N(H, {
|
|
1853
1881
|
get label() {
|
|
1854
|
-
return
|
|
1882
|
+
return Ni(e);
|
|
1855
1883
|
},
|
|
1856
1884
|
get children() {
|
|
1857
|
-
return
|
|
1885
|
+
return Fi(t);
|
|
1858
1886
|
}
|
|
1859
1887
|
})
|
|
1860
1888
|
})), e;
|
|
@@ -1863,12 +1891,12 @@ function Li(e) {
|
|
|
1863
1891
|
get each() {
|
|
1864
1892
|
return r();
|
|
1865
1893
|
},
|
|
1866
|
-
children: ([e, t]) => N(
|
|
1894
|
+
children: ([e, t]) => N(zi, {
|
|
1867
1895
|
get label() {
|
|
1868
|
-
return
|
|
1896
|
+
return Ni(e);
|
|
1869
1897
|
},
|
|
1870
1898
|
get count() {
|
|
1871
|
-
return
|
|
1899
|
+
return Ii(t);
|
|
1872
1900
|
},
|
|
1873
1901
|
value: t
|
|
1874
1902
|
})
|
|
@@ -1876,9 +1904,9 @@ function Li(e) {
|
|
|
1876
1904
|
}
|
|
1877
1905
|
});
|
|
1878
1906
|
}
|
|
1879
|
-
function
|
|
1907
|
+
function Hi(e) {
|
|
1880
1908
|
let t = () => e.entity.attributes ?? {};
|
|
1881
|
-
return N(
|
|
1909
|
+
return N(Bi, {
|
|
1882
1910
|
icon: "lucide:activity",
|
|
1883
1911
|
get title() {
|
|
1884
1912
|
return e.entity.friendly_name ?? e.entity.entity_id;
|
|
@@ -1896,7 +1924,7 @@ function Ri(e) {
|
|
|
1896
1924
|
},
|
|
1897
1925
|
get children() {
|
|
1898
1926
|
return [(() => {
|
|
1899
|
-
var t =
|
|
1927
|
+
var t = Ei();
|
|
1900
1928
|
return F(t, N(H, {
|
|
1901
1929
|
label: "Domain",
|
|
1902
1930
|
get children() {
|
|
@@ -1925,23 +1953,23 @@ function Ri(e) {
|
|
|
1925
1953
|
}), null), F(t, N(H, {
|
|
1926
1954
|
label: "Changed",
|
|
1927
1955
|
get children() {
|
|
1928
|
-
return
|
|
1956
|
+
return Li(e.entity.last_changed);
|
|
1929
1957
|
}
|
|
1930
1958
|
}), null), F(t, N(H, {
|
|
1931
1959
|
label: "Updated",
|
|
1932
1960
|
get children() {
|
|
1933
|
-
return
|
|
1961
|
+
return Li(e.entity.last_updated);
|
|
1934
1962
|
}
|
|
1935
1963
|
}), null), t;
|
|
1936
1964
|
})(), N(w, {
|
|
1937
1965
|
get when() {
|
|
1938
|
-
return
|
|
1966
|
+
return Ii(t()) > 0;
|
|
1939
1967
|
},
|
|
1940
1968
|
get children() {
|
|
1941
|
-
return N(
|
|
1969
|
+
return N(zi, {
|
|
1942
1970
|
label: "Attributes",
|
|
1943
1971
|
get count() {
|
|
1944
|
-
return
|
|
1972
|
+
return Ii(t());
|
|
1945
1973
|
},
|
|
1946
1974
|
get value() {
|
|
1947
1975
|
return t();
|
|
@@ -1952,18 +1980,18 @@ function Ri(e) {
|
|
|
1952
1980
|
}
|
|
1953
1981
|
});
|
|
1954
1982
|
}
|
|
1955
|
-
function
|
|
1983
|
+
function Ui(e) {
|
|
1956
1984
|
let t = D(() => Object.keys(e.data).filter((e) => e !== "widgetConfig" && e !== "entities"));
|
|
1957
1985
|
return N(We, { get children() {
|
|
1958
1986
|
return [
|
|
1959
|
-
N(
|
|
1987
|
+
N(Bi, {
|
|
1960
1988
|
icon: "lucide:sliders-horizontal",
|
|
1961
1989
|
title: "Configuration",
|
|
1962
1990
|
get source() {
|
|
1963
1991
|
return e.data.widgetConfig;
|
|
1964
1992
|
},
|
|
1965
1993
|
get children() {
|
|
1966
|
-
return N(
|
|
1994
|
+
return N(Vi, { get record() {
|
|
1967
1995
|
return e.data.widgetConfig;
|
|
1968
1996
|
} });
|
|
1969
1997
|
}
|
|
@@ -1972,22 +2000,22 @@ function zi(e) {
|
|
|
1972
2000
|
get each() {
|
|
1973
2001
|
return e.data.entities;
|
|
1974
2002
|
},
|
|
1975
|
-
children: (e) => N(
|
|
2003
|
+
children: (e) => N(Hi, { entity: e })
|
|
1976
2004
|
}),
|
|
1977
2005
|
N(C, {
|
|
1978
2006
|
get each() {
|
|
1979
2007
|
return t();
|
|
1980
2008
|
},
|
|
1981
|
-
children: (t) => N(
|
|
2009
|
+
children: (t) => N(Bi, {
|
|
1982
2010
|
icon: "lucide:braces",
|
|
1983
2011
|
get title() {
|
|
1984
|
-
return
|
|
2012
|
+
return Ni(t);
|
|
1985
2013
|
},
|
|
1986
2014
|
get source() {
|
|
1987
2015
|
return e.data[t];
|
|
1988
2016
|
},
|
|
1989
2017
|
get children() {
|
|
1990
|
-
return N(
|
|
2018
|
+
return N(Ri, { get value() {
|
|
1991
2019
|
return e.data[t];
|
|
1992
2020
|
} });
|
|
1993
2021
|
}
|
|
@@ -1996,13 +2024,13 @@ function zi(e) {
|
|
|
1996
2024
|
];
|
|
1997
2025
|
} });
|
|
1998
2026
|
}
|
|
1999
|
-
function
|
|
2027
|
+
function Wi(e) {
|
|
2000
2028
|
if (typeof e != "object" || !e) return;
|
|
2001
2029
|
let t = e;
|
|
2002
2030
|
return Array.isArray(t.entities) && typeof t.widgetConfig == "object" ? t : void 0;
|
|
2003
2031
|
}
|
|
2004
|
-
function
|
|
2005
|
-
let t = D(() =>
|
|
2032
|
+
function Gi(e) {
|
|
2033
|
+
let t = D(() => Wi(e.data));
|
|
2006
2034
|
return N(w, {
|
|
2007
2035
|
get when() {
|
|
2008
2036
|
return e.data !== void 0;
|
|
@@ -2020,7 +2048,7 @@ function Vi(e) {
|
|
|
2020
2048
|
return t();
|
|
2021
2049
|
},
|
|
2022
2050
|
get fallback() {
|
|
2023
|
-
return N(
|
|
2051
|
+
return N(Bi, {
|
|
2024
2052
|
icon: "lucide:braces",
|
|
2025
2053
|
title: "Debug data",
|
|
2026
2054
|
get source() {
|
|
@@ -2032,15 +2060,15 @@ function Vi(e) {
|
|
|
2032
2060
|
return typeof e.data == "string";
|
|
2033
2061
|
},
|
|
2034
2062
|
get fallback() {
|
|
2035
|
-
return N(
|
|
2063
|
+
return N(Ri, { get value() {
|
|
2036
2064
|
return e.data;
|
|
2037
2065
|
} });
|
|
2038
2066
|
},
|
|
2039
2067
|
get children() {
|
|
2040
|
-
return N(
|
|
2068
|
+
return N(mt, {
|
|
2041
2069
|
class: "overflow-hidden p-0",
|
|
2042
2070
|
get children() {
|
|
2043
|
-
var t =
|
|
2071
|
+
var t = Di();
|
|
2044
2072
|
return F(t, () => e.data), t;
|
|
2045
2073
|
}
|
|
2046
2074
|
});
|
|
@@ -2049,7 +2077,7 @@ function Vi(e) {
|
|
|
2049
2077
|
}
|
|
2050
2078
|
});
|
|
2051
2079
|
},
|
|
2052
|
-
children: (e) => N(
|
|
2080
|
+
children: (e) => N(Ui, { get data() {
|
|
2053
2081
|
return e();
|
|
2054
2082
|
} })
|
|
2055
2083
|
});
|
|
@@ -2058,21 +2086,21 @@ function Vi(e) {
|
|
|
2058
2086
|
}
|
|
2059
2087
|
//#endregion
|
|
2060
2088
|
//#region src/framework/dialogs/validate-config.ts
|
|
2061
|
-
function
|
|
2089
|
+
function Ki(e) {
|
|
2062
2090
|
let t = "";
|
|
2063
2091
|
for (let n of e) t += typeof n == "number" ? `[${n}]` : t ? `.${String(n)}` : String(n);
|
|
2064
2092
|
return t;
|
|
2065
2093
|
}
|
|
2066
|
-
function
|
|
2094
|
+
function qi(e, t) {
|
|
2067
2095
|
let n = e.safeParse(t);
|
|
2068
2096
|
return n.success ? null : n.error.issues.map((e) => {
|
|
2069
|
-
let t =
|
|
2097
|
+
let t = Ki(e.path);
|
|
2070
2098
|
return t ? `${t}: ${e.message}` : e.message;
|
|
2071
2099
|
});
|
|
2072
2100
|
}
|
|
2073
2101
|
//#endregion
|
|
2074
2102
|
//#region src/framework/dialogs/WidgetDialog.tsx
|
|
2075
|
-
var
|
|
2103
|
+
var Ji = /*#__PURE__*/ B("<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\">"), Yi = /*#__PURE__*/ B("<div class=\"bg-muted/30 rounded-lg p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No edit options available"), Xi = /*#__PURE__*/ B("<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>"), Zi = /*#__PURE__*/ B("<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\">"), Qi = /*#__PURE__*/ B("<div class=glasshome-sheet>"), $i = /*#__PURE__*/ B("<div class=glasshome-sheet-band aria-hidden=true><img alt>"), ea = /*#__PURE__*/ B("<span class=\"glasshome-widget-icon glass glass-tint glasshome-sheet-icon\">"), ta = /*#__PURE__*/ B("<span class=\"inline-flex size-3.5 shrink-0 items-center\">"), na = (e) => Jt(e), ra = {
|
|
2076
2104
|
sm: "sm",
|
|
2077
2105
|
md: "md",
|
|
2078
2106
|
lg: "lg",
|
|
@@ -2081,33 +2109,33 @@ var Wi = /*#__PURE__*/ B("<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 f
|
|
|
2081
2109
|
"2xl": "xl",
|
|
2082
2110
|
"3xl": "xl",
|
|
2083
2111
|
"4xl": "full"
|
|
2084
|
-
},
|
|
2112
|
+
}, ia = {
|
|
2085
2113
|
idle: "Copy all",
|
|
2086
2114
|
copied: "Copied",
|
|
2087
2115
|
failed: "Copy failed"
|
|
2088
2116
|
};
|
|
2089
|
-
function
|
|
2117
|
+
function aa(e) {
|
|
2090
2118
|
let [t] = _e(e, /* @__PURE__ */ "open.onOpenChange.title.description.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.sheet.tile.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.ResponsiveDialogBody.ResponsiveDialogFooter.Button.SchemaForm.Tabs.TabsList.TabsTrigger.TabsContent".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] = O({}), [a, o] = O(null), [s, c] = O([]);
|
|
2091
2119
|
E(he(() => t.config, (e) => {
|
|
2092
2120
|
e && i({ ...e });
|
|
2093
2121
|
})), E(he(() => t.configSchema, (e) => {
|
|
2094
|
-
e && o(
|
|
2122
|
+
e && o(na(e));
|
|
2095
2123
|
}));
|
|
2096
2124
|
let l = () => n() && JSON.stringify(r()) !== JSON.stringify(t.config), u = (e) => {
|
|
2097
2125
|
!e && t.config && (i({ ...t.config }), c([])), t.onOpenChange(e);
|
|
2098
2126
|
}, d = () => {
|
|
2099
2127
|
let e = t.configSchema;
|
|
2100
2128
|
if (e) {
|
|
2101
|
-
let t =
|
|
2129
|
+
let t = qi(e, r());
|
|
2102
2130
|
if (t) {
|
|
2103
2131
|
c(t);
|
|
2104
2132
|
return;
|
|
2105
2133
|
}
|
|
2106
2134
|
}
|
|
2107
2135
|
c([]), t.onConfigSave?.(r());
|
|
2108
|
-
}, [f, p] = O(t.defaultTab ?? "controls"), m = () => t.activeTab ?? f(),
|
|
2136
|
+
}, [f, p] = O(t.defaultTab ?? "controls"), m = () => t.activeTab ?? f(), ee = (e) => {
|
|
2109
2137
|
t.onActiveTabChange ? t.onActiveTabChange(e) : p(e);
|
|
2110
|
-
},
|
|
2138
|
+
}, h = () => ra[t.maxWidth ?? "xl"], g = () => {
|
|
2111
2139
|
if (t.tabs) return t.tabs.map((e) => ({
|
|
2112
2140
|
...e,
|
|
2113
2141
|
icon: () => e.icon,
|
|
@@ -2117,10 +2145,10 @@ function ta(e) {
|
|
|
2117
2145
|
return e.push({
|
|
2118
2146
|
id: "edit",
|
|
2119
2147
|
label: "Edit",
|
|
2120
|
-
icon: () =>
|
|
2148
|
+
icon: () => Ji(),
|
|
2121
2149
|
content: () => t.editContent ?? (() => {
|
|
2122
2150
|
let e = t.SchemaForm, o = n() ? a() : void 0;
|
|
2123
|
-
return !o || !e ?
|
|
2151
|
+
return !o || !e ? Yi() : N(e, {
|
|
2124
2152
|
schema: o,
|
|
2125
2153
|
get data() {
|
|
2126
2154
|
return r();
|
|
@@ -2134,7 +2162,7 @@ function ta(e) {
|
|
|
2134
2162
|
}), e.push({
|
|
2135
2163
|
id: "controls",
|
|
2136
2164
|
label: "Controls",
|
|
2137
|
-
icon: () =>
|
|
2165
|
+
icon: () => Xi(),
|
|
2138
2166
|
content: () => t.controlsContent ?? N(Be, { get children() {
|
|
2139
2167
|
return N(He, { get children() {
|
|
2140
2168
|
return [N(Ue, { children: "No controls" }), N(Ve, { children: "This widget is shown as is." })];
|
|
@@ -2143,27 +2171,27 @@ function ta(e) {
|
|
|
2143
2171
|
}), e.push({
|
|
2144
2172
|
id: "debug",
|
|
2145
2173
|
label: "Debug",
|
|
2146
|
-
icon: () =>
|
|
2147
|
-
content: () => t.debugContent ?? N(
|
|
2174
|
+
icon: () => Zi(),
|
|
2175
|
+
content: () => t.debugContent ?? N(Gi, { get data() {
|
|
2148
2176
|
return t.debugData;
|
|
2149
2177
|
} })
|
|
2150
2178
|
}), e;
|
|
2151
|
-
},
|
|
2152
|
-
E(() =>
|
|
2153
|
-
let
|
|
2154
|
-
icon: t.tile?.icon ??
|
|
2155
|
-
tone: t.tile?.tone ??
|
|
2179
|
+
}, _ = A(W), v = cn(_);
|
|
2180
|
+
E(() => v?.setHasSheet(t.sheet !== void 0)), k(() => v?.setHasSheet(!1));
|
|
2181
|
+
let y = () => ({
|
|
2182
|
+
icon: t.tile?.icon ?? v?.icon(),
|
|
2183
|
+
tone: t.tile?.tone ?? v?.accent() ?? v?.tone(),
|
|
2156
2184
|
backdrop: t.tile?.backdrop
|
|
2157
|
-
}),
|
|
2185
|
+
}), b = () => _?.developer?.() ?? !1, x = () => V() === "controls" && t.sheet !== void 0, S = oa(), te = () => _?.anchor?.(), ne = () => x() && !S() && te() !== void 0, re = Er(), ie = () => {
|
|
2158
2186
|
if (t.debugData === void 0) return;
|
|
2159
2187
|
let e = typeof t.debugData == "string" ? t.debugData : JSON.stringify(t.debugData, null, 2);
|
|
2160
2188
|
re.copy(e);
|
|
2161
|
-
}, ae = t.ResponsiveDialog, oe = t.ResponsiveDialogContent, se = t.ResponsiveDialogHeader, ce = t.ResponsiveDialogTitle, le = t.ResponsiveDialogDescription, ue = t.ResponsiveDialogBody ??
|
|
2189
|
+
}, ae = t.ResponsiveDialog, oe = t.ResponsiveDialogContent, se = t.ResponsiveDialogHeader, ce = t.ResponsiveDialogTitle, le = t.ResponsiveDialogDescription, ue = t.ResponsiveDialogBody ?? nt, de = t.ResponsiveDialogFooter ?? st, fe = t.Tabs ?? Tt, pe = t.TabsList ?? kt, T = t.TabsTrigger ?? jt, me = t.TabsContent ?? Dt, ge = t.Button, j = D(he([
|
|
2162
2190
|
() => t.open,
|
|
2163
2191
|
a,
|
|
2164
2192
|
() => t.config,
|
|
2165
2193
|
() => t.tabs
|
|
2166
|
-
], () =>
|
|
2194
|
+
], () => g())), M = (e) => n() ? u(e) : t.onOpenChange(e), ve = () => n() ? l() : t.hasUnsavedChanges, R = () => n() ? d : t.onSave, z = () => j().filter((e) => e.id !== "debug" || b()), B = () => z().filter((e) => e.id !== "controls" || t.sheet === void 0), V = () => {
|
|
2167
2195
|
let e = z(), n = m() === "controls" && t.sheet === void 0 && !("controlsContent" in t) && !t.tabs ? "edit" : m();
|
|
2168
2196
|
return e.some((e) => e.id === n) ? n : e[0]?.id ?? n;
|
|
2169
2197
|
}, ye = () => V() === "edit" && (R() || t.onDelete) || V() === "debug" && t.debugData !== void 0;
|
|
@@ -2175,7 +2203,7 @@ function ta(e) {
|
|
|
2175
2203
|
get children() {
|
|
2176
2204
|
return N(w, {
|
|
2177
2205
|
get when() {
|
|
2178
|
-
return !
|
|
2206
|
+
return !x();
|
|
2179
2207
|
},
|
|
2180
2208
|
get fallback() {
|
|
2181
2209
|
return N(oe, {
|
|
@@ -2188,19 +2216,19 @@ function ta(e) {
|
|
|
2188
2216
|
},
|
|
2189
2217
|
class: "glasshome-sheet-surface",
|
|
2190
2218
|
get style() {
|
|
2191
|
-
return I(() => !!
|
|
2192
|
-
"--glass-tone":
|
|
2193
|
-
"--widget-color":
|
|
2219
|
+
return I(() => !!y().tone)() ? {
|
|
2220
|
+
"--glass-tone": y().tone,
|
|
2221
|
+
"--widget-color": y().tone
|
|
2194
2222
|
} : void 0;
|
|
2195
2223
|
},
|
|
2196
2224
|
get children() {
|
|
2197
2225
|
return [
|
|
2198
2226
|
N(w, {
|
|
2199
2227
|
get when() {
|
|
2200
|
-
return
|
|
2228
|
+
return y().backdrop;
|
|
2201
2229
|
},
|
|
2202
2230
|
children: (e) => (() => {
|
|
2203
|
-
var t =
|
|
2231
|
+
var t = $i(), n = t.firstChild;
|
|
2204
2232
|
return P(() => L(n, "src", e())), t;
|
|
2205
2233
|
})()
|
|
2206
2234
|
}),
|
|
@@ -2209,10 +2237,10 @@ function ta(e) {
|
|
|
2209
2237
|
get media() {
|
|
2210
2238
|
return N(w, {
|
|
2211
2239
|
get when() {
|
|
2212
|
-
return
|
|
2240
|
+
return y().icon;
|
|
2213
2241
|
},
|
|
2214
2242
|
children: (e) => (() => {
|
|
2215
|
-
var t =
|
|
2243
|
+
var t = ea();
|
|
2216
2244
|
return F(t, N(U, {
|
|
2217
2245
|
get icon() {
|
|
2218
2246
|
return e();
|
|
@@ -2232,7 +2260,7 @@ function ta(e) {
|
|
|
2232
2260
|
}
|
|
2233
2261
|
}),
|
|
2234
2262
|
N(ue, { get children() {
|
|
2235
|
-
var e =
|
|
2263
|
+
var e = Qi();
|
|
2236
2264
|
return F(e, () => t.sheet?.()), e;
|
|
2237
2265
|
} })
|
|
2238
2266
|
];
|
|
@@ -2242,7 +2270,7 @@ function ta(e) {
|
|
|
2242
2270
|
get children() {
|
|
2243
2271
|
return N(oe, {
|
|
2244
2272
|
get size() {
|
|
2245
|
-
return
|
|
2273
|
+
return h();
|
|
2246
2274
|
},
|
|
2247
2275
|
get class() {
|
|
2248
2276
|
return t.class;
|
|
@@ -2252,7 +2280,7 @@ function ta(e) {
|
|
|
2252
2280
|
get value() {
|
|
2253
2281
|
return V();
|
|
2254
2282
|
},
|
|
2255
|
-
onChange:
|
|
2283
|
+
onChange: ee,
|
|
2256
2284
|
layout: "split",
|
|
2257
2285
|
get children() {
|
|
2258
2286
|
return [
|
|
@@ -2261,7 +2289,7 @@ function ta(e) {
|
|
|
2261
2289
|
get action() {
|
|
2262
2290
|
return [N(w, {
|
|
2263
2291
|
get when() {
|
|
2264
|
-
return
|
|
2292
|
+
return b() || t.tabs !== void 0;
|
|
2265
2293
|
},
|
|
2266
2294
|
get children() {
|
|
2267
2295
|
return N(pe, {
|
|
@@ -2277,7 +2305,7 @@ function ta(e) {
|
|
|
2277
2305
|
},
|
|
2278
2306
|
get children() {
|
|
2279
2307
|
return [(() => {
|
|
2280
|
-
var t =
|
|
2308
|
+
var t = ta();
|
|
2281
2309
|
return F(t, () => e.icon()), t;
|
|
2282
2310
|
})(), I(() => e.label)];
|
|
2283
2311
|
}
|
|
@@ -2366,7 +2394,7 @@ function ta(e) {
|
|
|
2366
2394
|
variant: "outline",
|
|
2367
2395
|
onClick: ie,
|
|
2368
2396
|
get children() {
|
|
2369
|
-
return
|
|
2397
|
+
return ia[re.state()];
|
|
2370
2398
|
}
|
|
2371
2399
|
});
|
|
2372
2400
|
}
|
|
@@ -2385,7 +2413,7 @@ function ta(e) {
|
|
|
2385
2413
|
}
|
|
2386
2414
|
});
|
|
2387
2415
|
}
|
|
2388
|
-
function
|
|
2416
|
+
function oa() {
|
|
2389
2417
|
let e = "(max-width: 639px)", [t, n] = O(typeof window < "u" && window.matchMedia(e).matches);
|
|
2390
2418
|
return ge(() => {
|
|
2391
2419
|
let t = window.matchMedia(e), r = () => n(t.matches);
|
|
@@ -2394,25 +2422,25 @@ function na() {
|
|
|
2394
2422
|
}
|
|
2395
2423
|
//#endregion
|
|
2396
2424
|
//#region src/framework/hooks/use-widget-dashboard.ts
|
|
2397
|
-
var
|
|
2425
|
+
var sa = {
|
|
2398
2426
|
name: "",
|
|
2399
2427
|
icon: "",
|
|
2400
2428
|
areaId: null
|
|
2401
2429
|
};
|
|
2402
|
-
function
|
|
2430
|
+
function ca() {
|
|
2403
2431
|
let e = A(W);
|
|
2404
|
-
return () => e?.dashboard?.() ??
|
|
2432
|
+
return () => e?.dashboard?.() ?? sa;
|
|
2405
2433
|
}
|
|
2406
2434
|
//#endregion
|
|
2407
2435
|
//#region src/framework/hooks/use-widget-viewer.ts
|
|
2408
|
-
var
|
|
2409
|
-
function
|
|
2436
|
+
var la = { name: null };
|
|
2437
|
+
function ua() {
|
|
2410
2438
|
let e = A(W);
|
|
2411
|
-
return () => e?.viewer?.() ??
|
|
2439
|
+
return () => e?.viewer?.() ?? la;
|
|
2412
2440
|
}
|
|
2413
2441
|
//#endregion
|
|
2414
2442
|
//#region src/framework/hooks/use-intersection-pause.ts
|
|
2415
|
-
function
|
|
2443
|
+
function da(e) {
|
|
2416
2444
|
if (typeof IntersectionObserver > "u") return () => !1;
|
|
2417
2445
|
let [t, n] = O(!1), r = new IntersectionObserver((e) => {
|
|
2418
2446
|
let t = e[0];
|
|
@@ -2425,40 +2453,40 @@ function sa(e) {
|
|
|
2425
2453
|
}
|
|
2426
2454
|
//#endregion
|
|
2427
2455
|
//#region src/framework/hooks/use-daylight.ts
|
|
2428
|
-
var
|
|
2429
|
-
function
|
|
2456
|
+
var fa = -6, pa = 864e5;
|
|
2457
|
+
function ma(e, t) {
|
|
2430
2458
|
let n = e.next_rising ? Date.parse(e.next_rising) : NaN, r = e.next_setting ? Date.parse(e.next_setting) : NaN;
|
|
2431
2459
|
if (!Number.isFinite(n) || !Number.isFinite(r)) return;
|
|
2432
|
-
let [i, a] = e.state === "above_horizon" ? [n -
|
|
2460
|
+
let [i, a] = e.state === "above_horizon" ? [n - pa, r] : [r - pa, n], o = a - i;
|
|
2433
2461
|
if (!(o <= 0)) return Math.min(1, Math.max(0, (t.getTime() - i) / o));
|
|
2434
2462
|
}
|
|
2435
|
-
var
|
|
2436
|
-
function
|
|
2463
|
+
var ha = 20, ga = 7;
|
|
2464
|
+
function _a(e, t) {
|
|
2437
2465
|
if (e && (e.state === "above_horizon" || e.state === "below_horizon")) {
|
|
2438
|
-
let n = e.elevation, r = e.state === "above_horizon" ? "day" : n !== void 0 && n >
|
|
2466
|
+
let n = e.elevation, r = e.state === "above_horizon" ? "day" : n !== void 0 && n > fa ? e.rising ? "dawn" : "dusk" : "night";
|
|
2439
2467
|
return {
|
|
2440
2468
|
phase: r,
|
|
2441
2469
|
isNight: r === "night",
|
|
2442
2470
|
elevation: n,
|
|
2443
|
-
progress:
|
|
2471
|
+
progress: ma(e, t)
|
|
2444
2472
|
};
|
|
2445
2473
|
}
|
|
2446
|
-
let n = t.getHours(), r = n >=
|
|
2474
|
+
let n = t.getHours(), r = n >= ha || n < ga ? "night" : "day";
|
|
2447
2475
|
return {
|
|
2448
2476
|
phase: r,
|
|
2449
2477
|
isNight: r === "night"
|
|
2450
2478
|
};
|
|
2451
2479
|
}
|
|
2452
|
-
var [
|
|
2453
|
-
function
|
|
2454
|
-
return
|
|
2455
|
-
|
|
2480
|
+
var [va, ya] = O(/* @__PURE__ */ new Date()), ba = 0, xa;
|
|
2481
|
+
function Sa() {
|
|
2482
|
+
return ba++, xa ||= (ya(/* @__PURE__ */ new Date()), setInterval(() => ya(/* @__PURE__ */ new Date()), 6e4)), () => {
|
|
2483
|
+
ba--, ba === 0 && xa && (clearInterval(xa), xa = void 0);
|
|
2456
2484
|
};
|
|
2457
2485
|
}
|
|
2458
|
-
function
|
|
2486
|
+
function Ca() {
|
|
2459
2487
|
let e = te("sun.sun");
|
|
2460
2488
|
return E(() => {
|
|
2461
|
-
e() || k(
|
|
2489
|
+
e() || k(Sa());
|
|
2462
2490
|
}), D(() => {
|
|
2463
2491
|
let t = e(), n = t ? {
|
|
2464
2492
|
state: t.state,
|
|
@@ -2467,26 +2495,26 @@ function ya() {
|
|
|
2467
2495
|
next_rising: t.attributes?.next_rising,
|
|
2468
2496
|
next_setting: t.attributes?.next_setting
|
|
2469
2497
|
} : void 0;
|
|
2470
|
-
return
|
|
2498
|
+
return _a(n, n ? /* @__PURE__ */ new Date() : va());
|
|
2471
2499
|
});
|
|
2472
2500
|
}
|
|
2473
2501
|
//#endregion
|
|
2474
2502
|
//#region src/framework/hooks/use-reduced-motion.ts
|
|
2475
|
-
function
|
|
2503
|
+
function wa() {
|
|
2476
2504
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => !1;
|
|
2477
2505
|
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] = O(e.matches), r = (e) => n(e.matches);
|
|
2478
2506
|
return e.addEventListener("change", r), k(() => e.removeEventListener("change", r)), t;
|
|
2479
2507
|
}
|
|
2480
2508
|
//#endregion
|
|
2481
2509
|
//#region src/framework/hooks/use-widget-entity-group.ts
|
|
2482
|
-
function
|
|
2510
|
+
function Ta(e) {
|
|
2483
2511
|
let t = e.minEntities ?? 1, n = D(() => e.entities().length), r = D(() => n() >= t), i = D(() => !r() || !e.calculateGroupData ? null : e.calculateGroupData(e.entities())), a = D(() => {
|
|
2484
2512
|
if (!r()) return;
|
|
2485
2513
|
let t = e.aggregationMode?.();
|
|
2486
2514
|
if (!t || t === "none") return;
|
|
2487
2515
|
let n = e.entities();
|
|
2488
|
-
if (t === "light" || t === "binary-sensor" || t === "switch") return
|
|
2489
|
-
if (t === "sensor") return
|
|
2516
|
+
if (t === "light" || t === "binary-sensor" || t === "switch") return Dr(n, e.allEntitiesMode);
|
|
2517
|
+
if (t === "sensor") return Or(n, e.sensorGroupType?.() ?? "mean", !0);
|
|
2490
2518
|
}), o = D(() => r() ? void 0 : e.emptyStateConfig);
|
|
2491
2519
|
return {
|
|
2492
2520
|
entities: e.entities,
|
|
@@ -2499,7 +2527,7 @@ function xa(e) {
|
|
|
2499
2527
|
}
|
|
2500
2528
|
//#endregion
|
|
2501
2529
|
//#region src/framework/theming/svg-colors.ts
|
|
2502
|
-
var
|
|
2530
|
+
var Ea = {
|
|
2503
2531
|
solar: "oklch(0.74 0.18 60)",
|
|
2504
2532
|
grid: "oklch(0.62 0.12 245)",
|
|
2505
2533
|
battery: "oklch(0.70 0.18 145)",
|
|
@@ -2508,21 +2536,21 @@ var Sa = {
|
|
|
2508
2536
|
positive: "oklch(0.70 0.14 160)",
|
|
2509
2537
|
negative: "oklch(0.64 0.22 27)"
|
|
2510
2538
|
};
|
|
2511
|
-
function
|
|
2539
|
+
function Da(e) {
|
|
2512
2540
|
return {
|
|
2513
2541
|
fill: `color-mix(in oklch, ${e} 20%, transparent)`,
|
|
2514
2542
|
stroke: e,
|
|
2515
2543
|
solid: e
|
|
2516
2544
|
};
|
|
2517
2545
|
}
|
|
2518
|
-
var
|
|
2546
|
+
var Oa = Object.fromEntries(Object.entries(Ea).map(([e, t]) => [e, Da(t)])), ka = o.enum([
|
|
2519
2547
|
"success",
|
|
2520
2548
|
"warning",
|
|
2521
2549
|
"danger",
|
|
2522
2550
|
"info",
|
|
2523
2551
|
"neutral",
|
|
2524
2552
|
"accent"
|
|
2525
|
-
]),
|
|
2553
|
+
]), Aa = {
|
|
2526
2554
|
title: e(() => o.string().optional().meta({
|
|
2527
2555
|
title: "Title",
|
|
2528
2556
|
description: "Optional display name override"
|
|
@@ -2542,38 +2570,38 @@ var wa = Object.fromEntries(Object.entries(Sa).map(([e, t]) => [e, Ca(t)])), Ta
|
|
|
2542
2570
|
formType: "area-picker",
|
|
2543
2571
|
title: "Area"
|
|
2544
2572
|
}), "widgetFields.areaId")
|
|
2545
|
-
},
|
|
2573
|
+
}, ja = 24;
|
|
2546
2574
|
function $(e) {
|
|
2547
2575
|
let t = {};
|
|
2548
2576
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
2549
2577
|
return t;
|
|
2550
2578
|
}
|
|
2551
|
-
function
|
|
2579
|
+
function Ma() {
|
|
2552
2580
|
return o.string().optional().meta({
|
|
2553
2581
|
title: "Title",
|
|
2554
2582
|
description: "Optional display name override"
|
|
2555
2583
|
});
|
|
2556
2584
|
}
|
|
2557
|
-
function
|
|
2585
|
+
function Na(e) {
|
|
2558
2586
|
return (e.default === void 0 ? o.string().optional() : o.string().default(e.default)).meta($({
|
|
2559
2587
|
title: e.title,
|
|
2560
2588
|
description: e.description
|
|
2561
2589
|
}));
|
|
2562
2590
|
}
|
|
2563
|
-
function
|
|
2591
|
+
function Pa(e) {
|
|
2564
2592
|
let t = o.number();
|
|
2565
2593
|
return e.min !== void 0 && (t = t.min(e.min)), e.max !== void 0 && (t = t.max(e.max)), (e.default === void 0 ? t.optional() : t.default(e.default)).meta($({
|
|
2566
2594
|
title: e.title,
|
|
2567
2595
|
description: e.description
|
|
2568
2596
|
}));
|
|
2569
2597
|
}
|
|
2570
|
-
function
|
|
2598
|
+
function Fa(e) {
|
|
2571
2599
|
return o.boolean().default(e.default ?? !1).meta($({
|
|
2572
2600
|
title: e.title,
|
|
2573
2601
|
description: e.description
|
|
2574
2602
|
}));
|
|
2575
2603
|
}
|
|
2576
|
-
function
|
|
2604
|
+
function Ia(e, t) {
|
|
2577
2605
|
let n = o.enum(e);
|
|
2578
2606
|
return (t.default === void 0 ? n.optional() : n.default(t.default)).meta($({
|
|
2579
2607
|
title: t.title,
|
|
@@ -2582,14 +2610,14 @@ function Ma(e, t) {
|
|
|
2582
2610
|
icons: t.icons
|
|
2583
2611
|
}));
|
|
2584
2612
|
}
|
|
2585
|
-
function
|
|
2613
|
+
function La(e, t) {
|
|
2586
2614
|
return o.array(o.enum(e)).default([...t.default ?? []]).meta($({
|
|
2587
2615
|
title: t.title,
|
|
2588
2616
|
description: t.description,
|
|
2589
2617
|
labels: t.labels
|
|
2590
2618
|
}));
|
|
2591
2619
|
}
|
|
2592
|
-
function
|
|
2620
|
+
function Ra(e, t) {
|
|
2593
2621
|
return o.array(o.string()).default([]).meta($({
|
|
2594
2622
|
domain: e,
|
|
2595
2623
|
title: t?.title ?? "Entities",
|
|
@@ -2597,7 +2625,7 @@ function Pa(e, t) {
|
|
|
2597
2625
|
deviceClass: t?.deviceClass
|
|
2598
2626
|
}));
|
|
2599
2627
|
}
|
|
2600
|
-
function
|
|
2628
|
+
function za(e, t) {
|
|
2601
2629
|
return o.array(o.string()).default([]).meta($({
|
|
2602
2630
|
domain: e,
|
|
2603
2631
|
title: t?.title ?? "Entity",
|
|
@@ -2606,13 +2634,13 @@ function Fa(e, t) {
|
|
|
2606
2634
|
singleSelect: !0
|
|
2607
2635
|
}));
|
|
2608
2636
|
}
|
|
2609
|
-
function
|
|
2637
|
+
function Ba(e) {
|
|
2610
2638
|
return o.string().optional().meta({
|
|
2611
2639
|
formType: "area-picker",
|
|
2612
2640
|
title: e?.title ?? "Area"
|
|
2613
2641
|
});
|
|
2614
2642
|
}
|
|
2615
|
-
function
|
|
2643
|
+
function Va(e) {
|
|
2616
2644
|
let t = o.string().meta($({
|
|
2617
2645
|
formType: "icon-picker",
|
|
2618
2646
|
title: e?.title ?? "Icon",
|
|
@@ -2620,7 +2648,7 @@ function La(e) {
|
|
|
2620
2648
|
}));
|
|
2621
2649
|
return e?.default === void 0 ? t.optional() : t.default(e.default);
|
|
2622
2650
|
}
|
|
2623
|
-
function
|
|
2651
|
+
function Ha(e) {
|
|
2624
2652
|
let t = e?.presets && Object.fromEntries(Object.entries(e.presets).map(([e, t]) => [e, {
|
|
2625
2653
|
label: t.label,
|
|
2626
2654
|
thumb: t.thumb
|
|
@@ -2632,36 +2660,36 @@ function Ra(e) {
|
|
|
2632
2660
|
}));
|
|
2633
2661
|
return e?.default === void 0 ? n.optional() : n.default(e.default);
|
|
2634
2662
|
}
|
|
2635
|
-
function
|
|
2663
|
+
function Ua(e) {
|
|
2636
2664
|
return o.array(o.string()).default([]).meta($({
|
|
2637
2665
|
title: e.title,
|
|
2638
2666
|
description: e.description
|
|
2639
2667
|
}));
|
|
2640
2668
|
}
|
|
2641
|
-
function
|
|
2669
|
+
function Wa(e, t) {
|
|
2642
2670
|
let n = o.object(e);
|
|
2643
|
-
return n.default(
|
|
2671
|
+
return n.default(Yt(n)).meta({ title: t.title });
|
|
2644
2672
|
}
|
|
2645
|
-
function
|
|
2673
|
+
function Ga(e) {
|
|
2646
2674
|
return e.def;
|
|
2647
2675
|
}
|
|
2648
|
-
function
|
|
2676
|
+
function Ka(e) {
|
|
2649
2677
|
if (o.globalRegistry.get(e)?.formType === "list") return !0;
|
|
2650
|
-
let t =
|
|
2651
|
-
return t.shape ? Object.values(t.shape).some(
|
|
2678
|
+
let t = Ga(e);
|
|
2679
|
+
return t.shape ? Object.values(t.shape).some(Ka) : t.options ? t.options.some(Ka) : t.element ? Ka(t.element) : t.innerType ? Ka(t.innerType) : !1;
|
|
2652
2680
|
}
|
|
2653
|
-
function
|
|
2654
|
-
let t = e, n =
|
|
2655
|
-
for (; n;) t = n, n =
|
|
2681
|
+
function qa(e) {
|
|
2682
|
+
let t = e, n = Ga(t).innerType;
|
|
2683
|
+
for (; n;) t = n, n = Ga(t).innerType;
|
|
2656
2684
|
return t;
|
|
2657
2685
|
}
|
|
2658
|
-
function
|
|
2659
|
-
let t =
|
|
2686
|
+
function Ja(e) {
|
|
2687
|
+
let t = Ga(qa(e));
|
|
2660
2688
|
if (t.shape) return new Set(Object.keys(t.shape));
|
|
2661
2689
|
if (t.options) {
|
|
2662
2690
|
let e = [];
|
|
2663
2691
|
for (let n of t.options) {
|
|
2664
|
-
let t =
|
|
2692
|
+
let t = Ja(n);
|
|
2665
2693
|
if (!t) return null;
|
|
2666
2694
|
e.push(t);
|
|
2667
2695
|
}
|
|
@@ -2673,7 +2701,7 @@ function Wa(e) {
|
|
|
2673
2701
|
}
|
|
2674
2702
|
return null;
|
|
2675
2703
|
}
|
|
2676
|
-
function
|
|
2704
|
+
function Ya(e, t, n) {
|
|
2677
2705
|
let r = { [t]: n };
|
|
2678
2706
|
try {
|
|
2679
2707
|
return e.parse(r);
|
|
@@ -2681,12 +2709,12 @@ function Ga(e, t, n) {
|
|
|
2681
2709
|
return r;
|
|
2682
2710
|
}
|
|
2683
2711
|
}
|
|
2684
|
-
function
|
|
2712
|
+
function Xa(e, t) {
|
|
2685
2713
|
if (!Number.isInteger(t.max) || t.max < 1) throw Error(`field.list: max must be a positive integer, got ${t.max}`);
|
|
2686
|
-
if (t.max >
|
|
2714
|
+
if (t.max > ja) throw Error(`field.list: max ${t.max} exceeds the ceiling of ${ja}`);
|
|
2687
2715
|
if (t.min !== void 0 && (!Number.isInteger(t.min) || t.min < 0 || t.min > t.max)) throw Error(`field.list: min must be an integer between 0 and max, got ${t.min}`);
|
|
2688
|
-
if (
|
|
2689
|
-
if (t.labelField !== void 0 && !
|
|
2716
|
+
if (Ka(e)) throw Error("field.list: a list item cannot contain another field.list (depth 1 only)");
|
|
2717
|
+
if (t.labelField !== void 0 && !Ja(e)?.has(t.labelField)) throw Error(`field.list: labelField "${t.labelField}" must name a field present in every item`);
|
|
2690
2718
|
let n = o.array(e);
|
|
2691
2719
|
return t.min !== void 0 && (n = n.min(t.min)), n = n.max(t.max), n.default([]).meta($({
|
|
2692
2720
|
formType: "list",
|
|
@@ -2696,7 +2724,7 @@ function Ka(e, t) {
|
|
|
2696
2724
|
labelField: t.labelField
|
|
2697
2725
|
}));
|
|
2698
2726
|
}
|
|
2699
|
-
function
|
|
2727
|
+
function Za(e, t, n) {
|
|
2700
2728
|
let r = Object.keys(t)[0];
|
|
2701
2729
|
if (r === void 0) throw Error("field.variants: at least one variant is required");
|
|
2702
2730
|
if (n.shared && e in n.shared) throw Error(`field.variants: shared fields cannot redefine the discriminator "${e}"`);
|
|
@@ -2709,7 +2737,7 @@ function qa(e, t, n) {
|
|
|
2709
2737
|
...r,
|
|
2710
2738
|
[e]: o.literal(t)
|
|
2711
2739
|
})), a = o.discriminatedUnion(e, i), s = i[0];
|
|
2712
|
-
return a.default(s ?
|
|
2740
|
+
return a.default(s ? Ya(s, e, r) : {}).meta($({
|
|
2713
2741
|
formType: "variants",
|
|
2714
2742
|
discriminator: e,
|
|
2715
2743
|
title: n.title,
|
|
@@ -2717,35 +2745,35 @@ function qa(e, t, n) {
|
|
|
2717
2745
|
labels: n.labels
|
|
2718
2746
|
}));
|
|
2719
2747
|
}
|
|
2720
|
-
var
|
|
2721
|
-
title:
|
|
2722
|
-
text:
|
|
2723
|
-
number:
|
|
2724
|
-
toggle:
|
|
2725
|
-
choice:
|
|
2726
|
-
choices:
|
|
2727
|
-
entities:
|
|
2728
|
-
entity:
|
|
2729
|
-
area:
|
|
2730
|
-
icon:
|
|
2731
|
-
image:
|
|
2732
|
-
stringList:
|
|
2733
|
-
group:
|
|
2734
|
-
list:
|
|
2735
|
-
variants:
|
|
2748
|
+
var Qa = {
|
|
2749
|
+
title: Ma,
|
|
2750
|
+
text: Na,
|
|
2751
|
+
number: Pa,
|
|
2752
|
+
toggle: Fa,
|
|
2753
|
+
choice: Ia,
|
|
2754
|
+
choices: La,
|
|
2755
|
+
entities: Ra,
|
|
2756
|
+
entity: za,
|
|
2757
|
+
area: Ba,
|
|
2758
|
+
icon: Va,
|
|
2759
|
+
image: Ha,
|
|
2760
|
+
stringList: Ua,
|
|
2761
|
+
group: Wa,
|
|
2762
|
+
list: Xa,
|
|
2763
|
+
variants: Za
|
|
2736
2764
|
};
|
|
2737
|
-
function
|
|
2765
|
+
function $a(e) {
|
|
2738
2766
|
return o.object(e);
|
|
2739
2767
|
}
|
|
2740
2768
|
//#endregion
|
|
2741
2769
|
//#region src/framework/image-src.ts
|
|
2742
|
-
function
|
|
2743
|
-
let n =
|
|
2744
|
-
return n === void 0 ?
|
|
2770
|
+
function eo(e, t) {
|
|
2771
|
+
let n = Bt(e);
|
|
2772
|
+
return n === void 0 ? Ht(e) : t?.[n]?.src;
|
|
2745
2773
|
}
|
|
2746
2774
|
//#endregion
|
|
2747
2775
|
//#region src/shared/spline.ts
|
|
2748
|
-
function
|
|
2776
|
+
function to(e) {
|
|
2749
2777
|
if (e.length < 2) return "";
|
|
2750
2778
|
let t = e[0], n = e[1];
|
|
2751
2779
|
if (!t || !n) return "";
|
|
@@ -2772,14 +2800,14 @@ function Za(e) {
|
|
|
2772
2800
|
}
|
|
2773
2801
|
//#endregion
|
|
2774
2802
|
//#region src/theme.ts
|
|
2775
|
-
function
|
|
2803
|
+
function no() {
|
|
2776
2804
|
return document.documentElement.classList.contains("dark");
|
|
2777
2805
|
}
|
|
2778
2806
|
//#endregion
|
|
2779
2807
|
//#region src/version.ts
|
|
2780
|
-
var
|
|
2808
|
+
var ro = {
|
|
2781
2809
|
name: "@glasshome/widget-sdk",
|
|
2782
|
-
version: "1.20.
|
|
2810
|
+
version: "1.20.1",
|
|
2783
2811
|
description: "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
2784
2812
|
keywords: [
|
|
2785
2813
|
"dashboard",
|
|
@@ -2860,7 +2888,7 @@ var $a = {
|
|
|
2860
2888
|
zod: "^4.1.13"
|
|
2861
2889
|
},
|
|
2862
2890
|
devDependencies: {
|
|
2863
|
-
"@glasshome/ui": "1.
|
|
2891
|
+
"@glasshome/ui": "1.24.0",
|
|
2864
2892
|
"@solidjs/testing-library": "^0.8.10",
|
|
2865
2893
|
"@types/bun": "^1.4.0",
|
|
2866
2894
|
"@types/node": "^25.2.2",
|
|
@@ -2875,10 +2903,10 @@ var $a = {
|
|
|
2875
2903
|
},
|
|
2876
2904
|
peerDependencies: {
|
|
2877
2905
|
"@glasshome/sync-layer": "0.9.1",
|
|
2878
|
-
"@glasshome/ui": "1.
|
|
2906
|
+
"@glasshome/ui": "1.24.0",
|
|
2879
2907
|
"solid-js": "^1.9.11"
|
|
2880
2908
|
},
|
|
2881
2909
|
engines: { node: ">=18" }
|
|
2882
2910
|
}.version;
|
|
2883
2911
|
//#endregion
|
|
2884
|
-
export { Ce as Badge, Te as Button, De as ButtonGroup, ke as Carousel, Ae as CarouselContent, je as CarouselDots, Me as CarouselItem, Ne as CarouselNext, Pe as CarouselPrevious, Fe as ColorDisc, Ie as ColorSlider, Le as ColorWheel, Re as CountPill,
|
|
2912
|
+
export { Ce as Badge, Te as Button, De as ButtonGroup, ke as Carousel, Ae as CarouselContent, je as CarouselDots, Me as CarouselItem, Ne as CarouselNext, Pe as CarouselPrevious, Fe as ColorDisc, Ie as ColorSlider, Le as ColorWheel, Re as CountPill, Je as Icon, Ye as Input, Xe as Label, Si as PanelEntityRow, fi as PanelFacts, di as PanelRow, ui as PanelRows, li as PanelSection, $e as Progress, et as ResponsiveDialog, tt as ResponsiveDialogBody, rt as ResponsiveDialogClose, it as ResponsiveDialogContent, at as ResponsiveDialogDescription, ot as ResponsiveDialogFooter, ct as ResponsiveDialogHeader, lt as ResponsiveDialogTitle, ro as SDK_VERSION, ut as SchemaForm, dt as SectionIcon, ht as SectionTitle, gt as Select, _t as SelectContent, vt as SelectItem, yt as SelectTrigger, bt as SelectValue, xt as Slider, St as SwatchPicker, Ct as Switch, wt as Tabs, Et as TabsContent, Ot as TabsList, At as TabsTrigger, Mt as TemperatureBar, Nt as Toggle, Pt as ToggleGroup, It as ToggleGroupItem, ka as ToneSchema, Z as Widget, $n as WidgetAction, nr as WidgetBackdrop, er as WidgetChip, Qn as WidgetChoice, _r as WidgetContent, Xn as WidgetControls, W as WidgetCtx, Gi as WidgetDebugTab, Ui as WidgetDebugView, aa as WidgetDialog, rr as WidgetGlyph, Jn as WidgetHead, Yn as WidgetHero, Pn as WidgetIcon, tr as WidgetLayer, r as WidgetManifestSchema, Dn as WidgetSizeCtx, mr as WidgetSliderFill, yr as WidgetStatus, Zn as WidgetStepper, Sr as WidgetTitle, Rr as WidgetValue, Oi as buildDebugData, h as byDomain, Dr as calculateLightGroup, Or as calculateSensorGroup, Cr as copyText, Nr as countActiveEntities, $a as defineConfig, Xt as defineWidget, t as deprecations, Qa as field, n as formatDeprecation, i as formatSchemaError, Mr as getEntityAttribute, s as getForecasts, c as getStream, l as getWebRtcClientConfig, u as hassMediaUrl, zt as imagePreset, eo as imageSrc, Vt as imageUrl, lr as injectTokens, no as isDark, jr as isEntityActive, xi as isPanelControllable, Ut as mediaUrl, to as monotoneCubicPath, Wt as parseColor, Gt as presetValue, d as sendWebRtcCandidate, f as startWebRtcSession, p as state, Oa as svgColors, m as trackEntityHistory, ee as untrackEntityHistory, g as useArea, _ as useCalendarEvents, v as useCamera, An as useConfirm, y as useConnection, Er as useCopyText, b as useCurrency, Ca as useDaylight, x as useEntities, S as useEntity, ne as useEntityHistory, re as useEntityStatistics, ie as useForecast, ae as useHassConfig, da as useIntersectionPause, oe as useLocale, wa as useReducedMotion, $t as useService, ce as useStore, le as useTemperatureUnit, nn as useToggle, tn as useTurnOff, en as useTurnOn, pe as useUnitSystem, Zt as useWidgetContext, ca as useWidgetDashboard, rn as useWidgetDialog, On as useWidgetDimensions, Ta as useWidgetEntityGroup, En as useWidgetGestures, ua as useWidgetViewer, Aa as widgetFields, a as z };
|