@camstack/addon-import-alexa 0.2.153 → 0.2.154

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.
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.335",
84
+ version: "1.2.336",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_import_alexa_page__remoteEntry_js-OqMWqeF3.mjs";
1
+ import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_import_alexa_page__remoteEntry_js-BIrnyj0g.mjs";
2
2
  export { t as get, e as init };
@@ -1,7 +1,8 @@
1
- import { S as e, g as t, l as n, v as r } from "./_virtual_mf___mfe_internal__addon_import_alexa_page__loadShare__react__loadShare__.js-DwXXYAlk.mjs";
2
- import { n as i } from "./ui-text-B5YO4hoJ.mjs";
3
- import { h as a } from "./responsive-CLpz8rKp.mjs";
4
- var o = a("camera", [["path", {
1
+ import { S as e, g as t, l as n, u as r, v as i } from "./_virtual_mf___mfe_internal__addon_import_alexa_page__loadShare__react__loadShare__.js-DwXXYAlk.mjs";
2
+ import "./_virtual_mf___mfe_internal__addon_import_alexa_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-CUiVYNMY.mjs";
3
+ import { n as a } from "./ui-text-B5YO4hoJ.mjs";
4
+ import { h as o, m as s } from "./responsive-CLpz8rKp.mjs";
5
+ var c = o("camera", [["path", {
5
6
  d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
6
7
  key: "18u6gg"
7
8
  }], ["circle", {
@@ -9,7 +10,7 @@ var o = a("camera", [["path", {
9
10
  cy: "13",
10
11
  r: "3",
11
12
  key: "1vg3eu"
12
- }]]), s = a("image-off", [
13
+ }]]), l = o("image-off", [
13
14
  ["line", {
14
15
  x1: "2",
15
16
  x2: "22",
@@ -43,7 +44,7 @@ var o = a("camera", [["path", {
43
44
  d: "M21 15V5a2 2 0 0 0-2-2H9",
44
45
  key: "43el77"
45
46
  }]
46
- ]), c = a("rotate-ccw", [["path", {
47
+ ]), u = o("rotate-ccw", [["path", {
47
48
  d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
48
49
  key: "1357e3"
49
50
  }], ["path", {
@@ -51,53 +52,65 @@ var o = a("camera", [["path", {
51
52
  key: "1xhq8a"
52
53
  }]]);
53
54
  //#endregion
54
- //#region ../ui-library/src/lib/hub-mount.ts
55
+ //#region ../ui-library/src/composites/confirm-dialog.tsx
55
56
  e();
56
- var l = "camstack-mount", u = /^\/(?:[A-Za-z0-9_\-.]+\/)*$/, d = null;
57
- function f(e) {
57
+ var d = s("camstack:confirm-dialog", null);
58
+ function f() {
59
+ let e = r(d);
60
+ if (!e) throw Error("useConfirm must be used within ConfirmDialogProvider");
61
+ return e;
62
+ }
63
+ function p() {
64
+ return f().confirm;
65
+ }
66
+ //#endregion
67
+ //#region ../ui-library/src/lib/hub-mount.ts
68
+ var m = "camstack-mount", h = /^\/(?:[A-Za-z0-9_\-.]+\/)*$/, g = null;
69
+ function _(e) {
58
70
  if (e == null || e === "") return null;
59
71
  let t = e.endsWith("/") ? e : `${e}/`;
60
- return !u.test(t) || t.includes("/../") || t.includes("/./") ? null : t;
72
+ return !h.test(t) || t.includes("/../") || t.includes("/./") ? null : t;
61
73
  }
62
- function p() {
74
+ function v() {
63
75
  if (typeof document > "u") return "/";
64
- let e = f(document.querySelector(`meta[name="${l}"]`)?.getAttribute("content"));
76
+ let e = _(document.querySelector(`meta[name="${m}"]`)?.getAttribute("content"));
65
77
  if (e !== null) return e;
66
78
  if (document.querySelector("base[href]") !== null) try {
67
79
  let e = new URL(document.baseURI);
68
80
  if (e.origin === window.location.origin) {
69
- let t = f(e.pathname);
81
+ let t = _(e.pathname);
70
82
  if (t !== null) return t;
71
83
  }
72
84
  } catch {}
73
85
  return "/";
74
86
  }
75
- function m() {
76
- return d === null && (d = p()), d;
87
+ function y() {
88
+ return g === null && (g = v()), g;
77
89
  }
78
- function h() {
79
- return m().replace(/\/$/, "");
90
+ function b() {
91
+ return y().replace(/\/$/, "");
80
92
  }
81
- function g(e) {
93
+ function x(e) {
82
94
  return /^[a-z][a-z0-9+.-]*:/i.test(e) || e.startsWith("//");
83
95
  }
84
- function _(e) {
85
- if (g(e)) return e;
86
- let t = m(), n = e.replace(/^\/+/, "");
87
- return t !== "/" && (e === h() || e.startsWith(t)) ? e : `${t}${n}`;
96
+ function S(e) {
97
+ if (x(e)) return e;
98
+ let t = y(), n = e.replace(/^\/+/, "");
99
+ return t !== "/" && (e === b() || e.startsWith(t)) ? e : `${t}${n}`;
88
100
  }
89
101
  //#endregion
90
102
  //#region ../ui-library/src/hooks/use-device-snapshot.ts
91
- var v = "/addon/snapshot/media";
92
- function y(e, i = {}) {
93
- let { width: a, baseUrl: o } = i, [s, c] = r(0);
103
+ e();
104
+ var C = "/addon/snapshot/media";
105
+ function w(e, r = {}) {
106
+ let { width: a, baseUrl: o } = r, [s, c] = i(0);
94
107
  return {
95
108
  src: t(() => {
96
109
  if (e === null || e <= 0) return null;
97
- let t = o === void 0 ? h() : o.replace(/\/+$/, ""), n = new URLSearchParams();
110
+ let t = o === void 0 ? b() : o.replace(/\/+$/, ""), n = new URLSearchParams();
98
111
  a !== void 0 && Number.isInteger(a) && a > 0 && n.set("w", String(a)), s > 0 && (n.set("force", "1"), n.set("r", String(s)));
99
112
  let r = n.toString();
100
- return `${t}${v}/${String(e)}.jpg${r.length > 0 ? `?${r}` : ""}`;
113
+ return `${t}${C}/${String(e)}.jpg${r.length > 0 ? `?${r}` : ""}`;
101
114
  }, [
102
115
  e,
103
116
  a,
@@ -112,7 +125,7 @@ function y(e, i = {}) {
112
125
  }
113
126
  //#endregion
114
127
  //#region ../ui-library/src/composites/cap-settings/scene-monitor-copy.ts
115
- var b = ["day", "ir"], x = {
128
+ var T = ["day", "ir"], E = {
116
129
  day: {
117
130
  labelKey: "uiLibrary.sceneMonitor.variant.day",
118
131
  labelFallback: "Daylight"
@@ -134,17 +147,17 @@ var b = ["day", "ir"], x = {
134
147
  labelFallback: "Dusk"
135
148
  }
136
149
  };
137
- function S(e, t = i) {
138
- let n = x[e];
150
+ function D(e, t = a) {
151
+ let n = E[e];
139
152
  return n === void 0 ? e : t(n.labelKey, n.labelFallback);
140
153
  }
141
- function C(e, t = i) {
142
- let n = new Set(e.coveredConditions), r = b.map((e) => `${S(e, t)} ${n.has(e) ? "✓" : "✗"}`), a = [...n].filter((e) => !b.some((t) => t === e));
143
- for (let e of a) r.push(`${S(e, t)} ✓`);
144
- let o = b.filter((e) => !n.has(e));
154
+ function O(e, t = a) {
155
+ let n = new Set(e.coveredConditions), r = T.map((e) => `${D(e, t)} ${n.has(e) ? "✓" : "✗"}`), i = [...n].filter((e) => !T.some((t) => t === e));
156
+ for (let e of i) r.push(`${D(e, t)} ✓`);
157
+ let o = T.filter((e) => !n.has(e));
145
158
  if (o.length === 0) return r.join(" · ");
146
159
  if (n.size === 0) return t("uiLibrary.sceneMonitor.coverage.empty", "{{parts}} — nothing captured yet, so this scene is not watching.", { parts: r.join(" · ") });
147
- let [s = "", c] = o.map((e) => S(e, t).toLowerCase()), l = c === void 0 ? s : t("uiLibrary.sceneMonitor.coverage.namesJoin", "{{first}} and {{second}}", {
160
+ let [s = "", c] = o.map((e) => D(e, t).toLowerCase()), l = c === void 0 ? s : t("uiLibrary.sceneMonitor.coverage.namesJoin", "{{first}} and {{second}}", {
148
161
  first: s,
149
162
  second: c
150
163
  }), u = {
@@ -153,10 +166,10 @@ function C(e, t = i) {
153
166
  };
154
167
  return e.onUncoveredCondition === "judge-anyway" ? t("uiLibrary.sceneMonitor.coverage.judgeAnyway", "{{parts}} — {{names}} judged against the references you do have.", u) : t("uiLibrary.sceneMonitor.coverage.skip", "{{parts}} — optional; checks in {{names}} are skipped.", u);
155
168
  }
156
- function w(e, t = i) {
157
- return e.suspendedCondition === null ? null : t("uiLibrary.sceneMonitor.suspension", "Paused — nothing was captured in {{light}}, so checks are on hold until the light changes back. Capture {{light}} if you want it watched around the clock.", { light: S(e.suspendedCondition, t).toLowerCase() });
169
+ function k(e, t = a) {
170
+ return e.suspendedCondition === null ? null : t("uiLibrary.sceneMonitor.suspension", "Paused — nothing was captured in {{light}}, so checks are on hold until the light changes back. Capture {{light}} if you want it watched around the clock.", { light: D(e.suspendedCondition, t).toLowerCase() });
158
171
  }
159
- var T = {
172
+ var A = {
160
173
  "no-reference-for-condition": {
161
174
  key: "uiLibrary.sceneMonitor.unavailable.no_reference_for_condition",
162
175
  fallback: "can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like."
@@ -178,19 +191,19 @@ var T = {
178
191
  fallback: "can’t tell — this camera did not return a frame."
179
192
  }
180
193
  };
181
- function E(e, t, n = i) {
194
+ function j(e, t, n = a) {
182
195
  if (e.states.length === 0) return n("uiLibrary.sceneMonitor.status.notArmed", "Not armed yet — capture the initial state to start watching.");
183
196
  if (e.verdict === "unknown") {
184
197
  if (e.unavailable === null) return n("uiLibrary.sceneMonitor.status.cantTellNow", "can’t tell right now.");
185
- let t = T[e.unavailable];
198
+ let t = A[e.unavailable];
186
199
  return n(t.key, t.fallback);
187
200
  }
188
- let r = e.verdict === "diverged" ? e.divergedAt : e.armedAt, a = r === null ? "" : ` ${n("uiLibrary.sceneMonitor.status.heldFor", "for {{duration}}", { duration: A(Math.max(0, t - r)) })}`;
189
- if (e.latched) return e.verdict === "diverged" ? n("uiLibrary.sceneMonitor.status.changedLatched", "CHANGED{{held}} — press Reset when you have dealt with it.", { held: a }) : n("uiLibrary.sceneMonitor.status.backToNormal", "Back to normal, but still flagged as changed{{held}}. Press Reset to clear it.", { held: a });
190
- let o = w(e, n);
191
- return o === null ? e.verdict === "diverged" ? n("uiLibrary.sceneMonitor.status.changed", "CHANGED{{held}}", { held: a }) : n("uiLibrary.sceneMonitor.status.normal", "Normal{{held}}", { held: a }) : o;
201
+ let r = e.verdict === "diverged" ? e.divergedAt : e.armedAt, i = r === null ? "" : ` ${n("uiLibrary.sceneMonitor.status.heldFor", "for {{duration}}", { duration: F(Math.max(0, t - r)) })}`;
202
+ if (e.latched) return e.verdict === "diverged" ? n("uiLibrary.sceneMonitor.status.changedLatched", "CHANGED{{held}} — press Reset when you have dealt with it.", { held: i }) : n("uiLibrary.sceneMonitor.status.backToNormal", "Back to normal, but still flagged as changed{{held}}. Press Reset to clear it.", { held: i });
203
+ let o = k(e, n);
204
+ return o === null ? e.verdict === "diverged" ? n("uiLibrary.sceneMonitor.status.changed", "CHANGED{{held}}", { held: i }) : n("uiLibrary.sceneMonitor.status.normal", "Normal{{held}}", { held: i }) : o;
192
205
  }
193
- function D(e, t = i) {
206
+ function M(e, t = a) {
194
207
  return e.states.length === 0 ? {
195
208
  text: t("uiLibrary.sceneMonitor.badge.notArmed", "Not armed"),
196
209
  tone: "unknown"
@@ -211,11 +224,11 @@ function D(e, t = i) {
211
224
  tone: "unknown"
212
225
  };
213
226
  }
214
- var O = .4;
215
- function k(e) {
216
- return e.width * e.height > O;
227
+ var N = .4;
228
+ function P(e) {
229
+ return e.width * e.height > N;
217
230
  }
218
- function A(e) {
231
+ function F(e) {
219
232
  let t = Math.floor(e / 1e3);
220
233
  if (t < 60) return `${t}s`;
221
234
  let n = Math.floor(t / 60);
@@ -224,4 +237,4 @@ function A(e) {
224
237
  return r < 48 ? `${r}h` : `${Math.floor(r / 24)}d`;
225
238
  }
226
239
  //#endregion
227
- export { E as a, _ as c, o as d, k as i, c as l, D as n, S as o, C as r, y as s, b as t, s as u };
240
+ export { j as a, S as c, l as d, c as f, P as i, p as l, M as n, D as o, O as r, w as s, T as t, u };
@@ -2753,7 +2753,7 @@ async function rr(e) {
2753
2753
  }
2754
2754
  }
2755
2755
  async function ir() {
2756
- return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_import_alexa_page-Yxzd8sJD.mjs")).catch((e) => {
2756
+ return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_import_alexa_page-AUGtjsp9.mjs")).catch((e) => {
2757
2757
  throw tr = void 0, e;
2758
2758
  }), tr;
2759
2759
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.153",
3
+ "version": "0.2.154",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",