@cloudlet/toast 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/README.md +27 -1
  3. package/dist/agent.d.ts +334 -0
  4. package/dist/agent.d.ts.map +1 -0
  5. package/dist/agent.js +494 -0
  6. package/dist/agent.js.map +1 -0
  7. package/dist/contracts/events.d.ts +14 -0
  8. package/dist/contracts/events.d.ts.map +1 -1
  9. package/dist/contracts/internal.d.ts +16 -2
  10. package/dist/contracts/internal.d.ts.map +1 -1
  11. package/dist/contracts/notifications.d.ts +16 -0
  12. package/dist/contracts/notifications.d.ts.map +1 -1
  13. package/dist/contracts/snapshots.d.ts +8 -0
  14. package/dist/contracts/snapshots.d.ts.map +1 -1
  15. package/dist/core/actions.d.ts +69 -0
  16. package/dist/core/actions.d.ts.map +1 -0
  17. package/dist/core/actions.js +160 -0
  18. package/dist/core/actions.js.map +1 -0
  19. package/dist/core/agent-port.d.ts +116 -0
  20. package/dist/core/agent-port.d.ts.map +1 -0
  21. package/dist/core/agent-port.js +138 -0
  22. package/dist/core/agent-port.js.map +1 -0
  23. package/dist/core/bridge.d.ts.map +1 -1
  24. package/dist/core/bridge.js +120 -231
  25. package/dist/core/bridge.js.map +1 -1
  26. package/dist/core/controller.d.ts +44 -9
  27. package/dist/core/controller.d.ts.map +1 -1
  28. package/dist/core/controller.js +367 -292
  29. package/dist/core/controller.js.map +1 -1
  30. package/dist/core/validation.d.ts.map +1 -1
  31. package/dist/core/validation.js +103 -94
  32. package/dist/core/validation.js.map +1 -1
  33. package/dist/react/card.d.ts.map +1 -1
  34. package/dist/react/card.js +3 -3
  35. package/dist/react/card.js.map +1 -1
  36. package/dist/react/host.d.ts.map +1 -1
  37. package/dist/react/host.js +257 -246
  38. package/dist/react/host.js.map +1 -1
  39. package/dist/react.d.ts +7 -0
  40. package/dist/react.d.ts.map +1 -1
  41. package/package.json +2 -1
  42. package/src/agent.ts +879 -0
  43. package/src/contracts/events.ts +15 -0
  44. package/src/contracts/internal.ts +14 -1
  45. package/src/contracts/notifications.ts +16 -0
  46. package/src/contracts/snapshots.ts +8 -0
  47. package/src/core/actions.ts +149 -0
  48. package/src/core/agent-port.ts +237 -0
  49. package/src/core/bridge.ts +19 -105
  50. package/src/core/controller.ts +183 -56
  51. package/src/core/validation.ts +6 -3
  52. package/src/react/card.tsx +4 -3
  53. package/src/react/host.tsx +26 -3
  54. package/src/react.ts +7 -0
@@ -52,29 +52,29 @@ function ae(e, t, n) {
52
52
  return Number.isFinite(r) ? r : n;
53
53
  }
54
54
  function A(y) {
55
- let { bridge: x, lease: S, document: E } = y.props, D = E.defaultView, A = b(), se = b(), ce = b(), M = b(), N = b(), le = b(), ue = b(), P = b(), de = b(), fe = b(), pe = s(x, S, E, () => y.props.options.announcements), F = null, I = null, me = null, he = !1, ge = null, L = {}, _e = !1, R = null, ve = !1, z = null, ye = y.props.options.motion?.overrides, B = u(ye), be = () => {
55
+ let { bridge: x, lease: S, document: E } = y.props, D = E.defaultView, A = b(), se = b(), ce = b(), M = b(), N = b(), le = b(), ue = b(), de = b(), fe = b(), pe = b(), me = s(x, S, E, () => y.props.options.announcements), he = null, P = null, ge = null, _e = !1, ve = null, F = {}, ye = !1, I = null, be = !1, L = null, xe = y.props.options.motion?.overrides, R = u(xe), Se = () => {
56
56
  let e = y.props.options.motion?.overrides;
57
- e !== ye && (ye = e, B = u(e), z?.setConstants(B));
58
- }, V = !1, xe = !1, H = null, U = {
57
+ e !== xe && (xe = e, R = u(e), L?.setConstants(R));
58
+ }, z = !1, Ce = null, we = !1, B = null, V = {
59
59
  width: 0,
60
60
  height: 0,
61
61
  bodyTop: 0
62
- }, Se = 0, Ce = -Infinity, W = {
62
+ }, Te = 0, Ee = -Infinity, H = {
63
63
  tailOffset: 4,
64
64
  tailScale: .9,
65
65
  pillHeight: 44
66
- }, G = !1, we = "instant", Te = /* @__PURE__ */ new Set(), K = 0, Ee = 2, De = null, Oe = null, ke = !1, Ae = null, q = null, je = !1, J = null, Me = null, Y = null, X = !1, Ne, Pe = /* @__PURE__ */ new WeakSet(), Fe = [];
67
- function Ie(e, t, ...n) {
66
+ }, U = !1, De = "instant", Oe = /* @__PURE__ */ new Set(), W = 0, ke = 2, G = null, Ae = null, je = !1, Me = null, K = null, Ne = !1, q = null, Pe = null, J = null, Y = !1, Fe, Ie = /* @__PURE__ */ new WeakSet(), Le = [];
67
+ function X(e, t, ...n) {
68
68
  try {
69
69
  let t = e(...n);
70
70
  if (typeof t != "string") throw TypeError("Label formatter must return a string");
71
71
  return t;
72
72
  } catch (r) {
73
- return Pe.has(e) || (Pe.add(e), Fe.push(r)), t(...n);
73
+ return Ie.has(e) || (Ie.add(e), Le.push(r)), t(...n);
74
74
  }
75
75
  }
76
- function Le() {
77
- for (let e of Fe.splice(0)) x.reportDiagnostic(S, {
76
+ function Re() {
77
+ for (let e of Le.splice(0)) x.reportDiagnostic(S, {
78
78
  code: "formatter-error",
79
79
  source: "Toaster.labels",
80
80
  message: "A label formatter failed",
@@ -85,16 +85,16 @@ function A(y) {
85
85
  scope: "host",
86
86
  reason: e,
87
87
  active: t
88
- }), Re = (e) => {
89
- xe !== e && (xe = e, Z("hover", e), z?.setHover(e));
90
- }, ze = (e) => {
91
- if (Be(e), !(D && e instanceof D.HTMLElement && !e.closest(".cloudlet-slot") && Q(e)) && !Q(F)) {
88
+ }), ze = (e) => {
89
+ we !== e && (we = e, Z("hover", e), L?.setHover(e));
90
+ }, Be = (e) => {
91
+ if (Ve(e), !(D && e instanceof D.HTMLElement && !e.closest(".cloudlet-slot") && Q(e)) && !Q(he)) {
92
92
  let e = E.activeElement;
93
93
  D && e instanceof D.HTMLElement && e.blur(), A.current?.focus({ preventScroll: !0 });
94
94
  }
95
95
  };
96
- function Be(e) {
97
- D && e instanceof D.HTMLElement && e !== E.body && !A.current?.contains(e) && (F = e);
96
+ function Ve(e) {
97
+ D && e instanceof D.HTMLElement && e !== E.body && !A.current?.contains(e) && (he = e);
98
98
  }
99
99
  function Q(e) {
100
100
  if (!e?.isConnected || e.closest("[hidden],[inert],[aria-hidden=\"true\"]") || e.matches(":disabled")) return !1;
@@ -104,20 +104,20 @@ function A(y) {
104
104
  }
105
105
  return e.focus({ preventScroll: !0 }), E.activeElement === e;
106
106
  }
107
- function Ve() {
108
- if (Q(F)) return !0;
107
+ function He() {
108
+ if (Q(he)) return !0;
109
109
  for (let e of E.querySelectorAll("button,a[href],input,select,textarea,summary,[tabindex]")) if (e.tabIndex >= 0 && !e.closest(".cloudlet-host") && Q(e)) return !0;
110
110
  let e = E.body.getAttribute("tabindex");
111
111
  E.body.setAttribute("tabindex", "-1");
112
112
  let t = Q(E.body);
113
113
  return e === null ? E.body.removeAttribute("tabindex") : E.body.setAttribute("tabindex", e), t;
114
114
  }
115
- let He = (e) => {
115
+ let Ue = (e) => {
116
116
  let t = !!e && !!A.current?.contains(e);
117
117
  Z("focus", t), x.setFocused(S, t ? x.getSnapshot().presentation?.handle ?? null : null);
118
118
  };
119
- function Ue() {
120
- if (!_e || !D) return;
119
+ function We() {
120
+ if (!ye || !D) return;
121
121
  let e = E.documentElement.clientWidth || D.innerWidth, t = E.documentElement.clientHeight || D.innerHeight, n = v(e, t, D.visualViewport);
122
122
  for (let e of [
123
123
  "top",
@@ -126,18 +126,18 @@ function A(y) {
126
126
  "left",
127
127
  "width",
128
128
  "height"
129
- ]) L.viewport?.setProperty(`--cloudlet-viewport-${e}`, `${n[e]}px`);
129
+ ]) F.viewport?.setProperty(`--cloudlet-viewport-${e}`, `${n[e]}px`);
130
130
  }
131
- let We = () => A.current?.dataset.edge === "bottom", Ge = () => We() ? 1 : -1, Ke = () => {
131
+ let Ge = () => A.current?.dataset.edge === "bottom", Ke = () => Ge() ? 1 : -1, qe = () => {
132
132
  let e = A.current?.dataset.align;
133
133
  return e === "left" ? 0 : e === "right" ? 1 : .5;
134
134
  };
135
- function qe(e) {
136
- let t = L, { reduced: n } = e, r = Math.max(0, e.width), i = Math.max(0, e.height), a = Math.min(Math.max(0, e.radius), r / 2, i / 2), o = We(), s = o ? U.height - i : 0, c = Ke(), l = `translateX(${-c * 100}%)`, u = (U.width - r) * c;
135
+ function Je(e) {
136
+ let t = F, { reduced: n } = e, r = Math.max(0, e.width), i = Math.max(0, e.height), a = Math.min(Math.max(0, e.radius), r / 2, i / 2), o = Ge(), s = o ? V.height - i : 0, c = qe(), l = `translateX(${-c * 100}%)`, u = (V.width - r) * c;
137
137
  t.shell && (t.shell.opacity = String(O(e.opacity)), t.shell.transform = n ? "none" : `translate(${k(e.dragX)}, ${k(e.y + e.dragY)}) scale(${e.scale})`);
138
138
  let d = le.current;
139
139
  if (d && (d.setAttribute("width", String(r)), d.setAttribute("height", String(i)), ue.current?.setAttribute("d", m(r, i, a))), t.bg && (t.bg.borderRadius = k(a), t.bg.top = "0px", t.bg.bottom = "auto", t.bg.transform = `${l} translateY(${k(s)})`), t.clip && (t.clip.clipPath = `path("${m(r, i, a, u, s)}")`), t.badge) {
140
- let i = n ? 1 : B.badge.scale + (1 - B.badge.scale) * e.badge, a = (je ? u + 10 : u + r - 10) - U.width / 2;
140
+ let i = n ? 1 : R.badge.scale + (1 - R.badge.scale) * e.badge, a = (Ne ? u + 10 : u + r - 10) - V.width / 2;
141
141
  t.badge.opacity = String(O(e.badge)), t.badge.transform = `translate(calc(${k(a)} - 50%), ${o ? "6px" : "-6px"}) scale(${i})`;
142
142
  }
143
143
  let f = o ? -1 : 1;
@@ -145,9 +145,9 @@ function A(y) {
145
145
  let a = t[`tail${n}`];
146
146
  if (!a) continue;
147
147
  let o = e[`tail${n}`];
148
- a.width = k(r), a.height = k(Math.min(i, W.pillHeight)), a.opacity = String(O(e[`tail${n}Opacity`])), a.transform = `${l} translateY(${k(f * o * (W.tailOffset + B.hoverLift * e.lift))}) scale(${W.tailScale ** +o})`;
148
+ a.width = k(r), a.height = k(Math.min(i, H.pillHeight)), a.opacity = String(O(e[`tail${n}Opacity`])), a.transform = `${l} translateY(${k(f * o * (H.tailOffset + R.hoverLift * e.lift))}) scale(${H.tailScale ** +o})`;
149
149
  }
150
- t.slideOut && (t.slideOut.transform = n ? "none" : `translateX(${k(e.slide - e.slideDirection * e.slideWidth)})`, t.slideOut.opacity = String(O(e.slideOut))), t.peek && (t.peek.width = k(U.width), t.peek.top = k(U.bodyTop), t.peek.transform = `translateX(${k(e.slide + (J?.side ?? 0) * U.width)})`);
150
+ t.slideOut && (t.slideOut.transform = n ? "none" : `translateX(${k(e.slide - e.slideDirection * e.slideWidth)})`, t.slideOut.opacity = String(O(e.slideOut))), t.peek && (t.peek.width = k(V.width), t.peek.top = k(V.bodyTop), t.peek.transform = `translateX(${k(e.slide + (q?.side ?? 0) * V.width)})`);
151
151
  let p = n ? "none" : `translate(${k(e.headX)}, ${k(e.headY)})`;
152
152
  t.headerIn && (t.headerIn.transform = p), t.headerOut && (t.headerOut.transform = p);
153
153
  for (let [r, i] of [
@@ -157,38 +157,38 @@ function A(y) {
157
157
  [t.badgeOut, e.badgeOut],
158
158
  [t.pageIn, e.pageIn],
159
159
  [t.pageOut, e.pageOut]
160
- ]) r && (r.opacity = String(O(i)), r.filter = ie((1 - O(i)) * B.blur, n));
161
- t.chrome && (t.chrome.opacity = String(O(e.chrome)), t.chrome.transform = n ? "none" : `translateY(${k((1 - O(e.chrome)) * B.chromeOffset)})`), t.chromeOut && (t.chromeOut.opacity = String(O(e.chromeOut))), t.body && (t.body.opacity = String(O(e.chrome) * O(e.bodyIn) * O(e.slideIn)), t.body.transform = n ? "none" : `translateX(${k(e.slide)}) translateY(${k((1 - O(e.chrome)) * B.chromeOffset + (1 - O(e.bodyIn)) * B.bodyOffset)})`), t.bodyOut && (t.bodyOut.opacity = String(O(e.bodyOut))), t.exit && (t.exit.opacity = String(O(e.exitOpacity)), t.exit.transform = n ? l : `${l} translate(${k(e.exitX)}, ${k(e.exitY)}) scale(${e.exitScale})`), ke && De?.isConnected && De.setAttribute("stroke-dasharray", `${Math.round(e.progress * 1e4) / 100} 100`);
160
+ ]) r && (r.opacity = String(O(i)), r.filter = ie((1 - O(i)) * R.blur, n));
161
+ t.chrome && (t.chrome.opacity = String(O(e.chrome)), t.chrome.transform = n ? "none" : `translateY(${k((1 - O(e.chrome)) * R.chromeOffset)})`), t.chromeOut && (t.chromeOut.opacity = String(O(e.chromeOut))), t.body && (t.body.opacity = String(O(e.chrome) * O(e.bodyIn) * O(e.slideIn)), t.body.transform = n ? "none" : `translateX(${k(e.slide)}) translateY(${k((1 - O(e.chrome)) * R.chromeOffset + (1 - O(e.bodyIn)) * R.bodyOffset)})`), t.bodyOut && (t.bodyOut.opacity = String(O(e.bodyOut))), t.exit && (t.exit.opacity = String(O(e.exitOpacity)), t.exit.transform = n ? l : `${l} translate(${k(e.exitX)}, ${k(e.exitY)}) scale(${e.exitScale})`), je && G?.isConnected && G.setAttribute("stroke-dasharray", `${Math.round(e.progress * 1e4) / 100} 100`);
162
162
  }
163
- function Je() {
163
+ function Ye() {
164
164
  let e = ce.current, t = N.current, n = _(y.props.snapshot).presented;
165
- if (!e || !t || !D || !z || !n) {
166
- G = !1;
165
+ if (!e || !t || !D || !L || !n) {
166
+ U = !1;
167
167
  return;
168
168
  }
169
169
  let r = e.getBoundingClientRect();
170
- if (G = r.width > 0 && r.height > 0, Xe(n), !G) return;
170
+ if (U = r.width > 0 && r.height > 0, Ze(n), !U) return;
171
171
  let i = D.getComputedStyle(A.current);
172
- W = {
172
+ H = {
173
173
  tailOffset: ae(i, "--cloudlet-tail-offset", 4),
174
174
  tailScale: ae(i, "--cloudlet-tail-scale", .9),
175
175
  pillHeight: ae(i, "--cloudlet-pill-height", 44)
176
176
  };
177
177
  let a = y.props.snapshot.island.open, o = parseFloat(D.getComputedStyle(t).borderTopLeftRadius), s = Math.min(Number.isFinite(o) ? o : a ? 24 : r.height / 2, r.height / 2, r.width / 2);
178
- U = {
178
+ V = {
179
179
  width: r.width,
180
180
  height: r.height,
181
181
  bodyTop: $()?.offsetTop ?? 0
182
- }, z.setShape({
182
+ }, L.setShape({
183
183
  width: r.width,
184
184
  height: r.height,
185
185
  radius: s
186
- }, we), we = "close", Ye();
186
+ }, De), De = "close", Xe();
187
187
  }
188
- function Ye() {
188
+ function Xe() {
189
189
  let e = $();
190
190
  if (!e) return;
191
- let t = rt()?.querySelector("[data-cloudlet-title]")?.id;
191
+ let t = it()?.querySelector("[data-cloudlet-title]")?.id;
192
192
  if (e.scrollHeight - e.clientHeight > 1 && t) e.tabIndex = 0, e.setAttribute("role", "group"), e.setAttribute("aria-labelledby", t);
193
193
  else for (let t of [
194
194
  "tabindex",
@@ -196,185 +196,185 @@ function A(y) {
196
196
  "aria-labelledby"
197
197
  ]) e.removeAttribute(t);
198
198
  }
199
- function Xe(e) {
200
- let t = e && !G && x.getSnapshot().presentation?.readable ? e.handle : null;
201
- t !== Ae && (Ae && x.setPause(S, {
199
+ function Ze(e) {
200
+ let t = e && !U && x.getSnapshot().presentation?.readable ? e.handle : null;
201
+ t !== Me && (Me && x.setPause(S, {
202
202
  scope: "notification",
203
- handle: Ae,
203
+ handle: Me,
204
204
  reason: "content-transition",
205
205
  active: !1
206
- }), Ae = t, t && x.setPause(S, {
206
+ }), Me = t, t && x.setPause(S, {
207
207
  scope: "notification",
208
208
  handle: t,
209
209
  reason: "content-transition",
210
210
  active: !0
211
211
  }));
212
212
  }
213
- function Ze() {
213
+ function Qe() {
214
214
  let e = x.getSnapshot().presentation;
215
- if (!e?.token || e.readable || Te.size) return;
215
+ if (!e?.token || e.readable || Oe.size) return;
216
216
  let t = M.current?.querySelector(`[data-cloudlet-presented="${e.handle.generation}"]`), n = t?.getBoundingClientRect();
217
- t && G && n?.width && n.height && D?.getComputedStyle(t).visibility !== "hidden" && x.acknowledgePresentation(S, e.handle, e.token);
217
+ t && U && n?.width && n.height && D?.getComputedStyle(t).visibility !== "hidden" && x.acknowledgePresentation(S, e.handle, e.token);
218
218
  }
219
- let Qe = (e) => (Te.add(e), () => {
220
- Te.delete(e), Ze();
221
- }), $e = () => {
222
- Ue(), Je(), Ze();
219
+ let $e = (e) => (Oe.add(e), () => {
220
+ Oe.delete(e), Qe();
221
+ }), et = () => {
222
+ We(), Ye(), Qe();
223
223
  };
224
- function et() {
224
+ function tt() {
225
225
  let e = A.current;
226
226
  return (y.props.snapshot.island.open ? e?.querySelector(".cloudlet-slide [data-cloudlet-title]") : null) ?? e?.querySelector("[data-cloudlet-pill]") ?? null;
227
227
  }
228
- function tt() {
228
+ function nt() {
229
229
  let e = y.props.snapshot.focusRequest;
230
230
  if (!e || x.getSnapshot().focusRequest?.token !== e.token) return;
231
231
  let t = A.current, n = e.target, r = null;
232
- n.kind === "anchor" ? r = t : n.kind === "overflow" ? r = t?.querySelector("[data-cloudlet-overflow]") ?? t?.querySelector("[data-cloudlet-pill]") ?? null : n.kind === "notification" && (r = M.current?.querySelector(`[data-cloudlet-presented="${n.handle.generation}"]`) ? n.control ? M.current.querySelector(`[data-cloudlet-control="${n.control}"]`) : et() : null), Be(E.activeElement);
232
+ n.kind === "anchor" ? r = t : n.kind === "overflow" ? r = t?.querySelector("[data-cloudlet-overflow]") ?? t?.querySelector("[data-cloudlet-pill]") ?? null : n.kind === "notification" && (r = M.current?.querySelector(`[data-cloudlet-presented="${n.handle.generation}"]`) ? n.control ? M.current.querySelector(`[data-cloudlet-control="${n.control}"]`) : tt() : null), Ve(E.activeElement);
233
233
  let i = Q(r);
234
234
  x.acknowledgeFocus(S, e.token, i ? "focused" : "unavailable");
235
235
  }
236
- function nt(e) {
236
+ function rt(e) {
237
237
  e?.replaceChildren();
238
238
  }
239
- function rt() {
239
+ function it() {
240
240
  return M.current?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading") ?? null;
241
241
  }
242
242
  function $() {
243
243
  return M.current?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body") ?? null;
244
244
  }
245
- function it(e) {
245
+ function at(e) {
246
246
  let t = M.current, n = N.current;
247
- if (!t || !n || !G) return {};
247
+ if (!t || !n || !U) return {};
248
248
  let r = {};
249
- (e.presence === "exit" || e.presence === "rise" || e.presence === "replace") && (r.exit = T(t), L.exitClip && (L.exitClip.clipPath = L.clip?.clipPath ?? ""), L.exitBg && (L.exitBg.borderRadius = L.bg?.borderRadius ?? ""), L.exitBadge && (L.exitBadge.opacity = L.badge?.opacity ?? "", L.exitBadge.transform = L.badge?.transform ?? ""), L.exit && (L.exit.width = k(U.width)));
249
+ (e.presence === "exit" || e.presence === "rise" || e.presence === "replace") && (r.exit = T(t), F.exitClip && (F.exitClip.clipPath = F.clip?.clipPath ?? ""), F.exitBg && (F.exitBg.borderRadius = F.bg?.borderRadius ?? ""), F.exitBadge && (F.exitBadge.opacity = F.badge?.opacity ?? "", F.exitBadge.transform = F.badge?.transform ?? ""), F.exit && (F.exit.width = k(V.width)));
250
250
  let i = $();
251
- if (e.slide && i && (r.slide = T(i), Se = i.offsetTop, L.slideOut && (L.slideOut.width = k(U.width))), e.morph === "close") {
251
+ if (e.slide && i && (r.slide = T(i), Te = i.offsetTop, F.slideOut && (F.slideOut.width = k(V.width))), e.morph === "close") {
252
252
  let e = T(n);
253
- e.querySelector(".cloudlet-header")?.classList.add("cloudlet-ghost"), r.chrome = e, L.chromeOut && (L.chromeOut.width = k(U.width));
253
+ e.querySelector(".cloudlet-header")?.classList.add("cloudlet-ghost"), r.chrome = e, F.chromeOut && (F.chromeOut.width = k(V.width));
254
254
  }
255
- let a = rt();
255
+ let a = it();
256
256
  e.header && a && (r.header = T(a));
257
- let o = $(), s = z?.now() ?? 0, c = e.body && s - Ce < (z?.constants.bodyQuiet ?? 0);
258
- e.body && (Ce = s), e.body && !e.slide && o && !c && !z?.swapping("body") && (r.body = T(o), L.bodyOut && (L.bodyOut.top = k(o.offsetTop)));
257
+ let o = $(), s = L?.now() ?? 0, c = e.body && s - Ee < (L?.constants.bodyQuiet ?? 0);
258
+ e.body && (Ee = s), e.body && !e.slide && o && !c && !L?.swapping("body") && (r.body = T(o), F.bodyOut && (F.bodyOut.top = k(o.offsetTop)));
259
259
  let l = t.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-value");
260
260
  e.badge && l && (r.badge = T(l));
261
261
  let u = n.querySelector(":scope > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-value");
262
262
  return e.page && u && (r.page = T(u)), r;
263
263
  }
264
- function at(e, t) {
265
- let n = M.current, r = e === "exit" ? P.current : e === "slide" ? de.current : e === "chrome" ? fe.current : e === "header" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading-out") : e === "body" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body-out") : e === "badge" ? n?.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-out") : n?.querySelector(":scope > .cloudlet-clip > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-out");
264
+ function ot(e, t) {
265
+ let n = M.current, r = e === "exit" ? de.current : e === "slide" ? fe.current : e === "chrome" ? pe.current : e === "header" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading-out") : e === "body" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body-out") : e === "badge" ? n?.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-out") : n?.querySelector(":scope > .cloudlet-clip > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-out");
266
266
  return r ? (r.setAttribute("inert", ""), r.replaceChildren(t), r) : null;
267
267
  }
268
- function ot(e, t, n) {
269
- if (!z) return;
268
+ function st(e, t, n) {
269
+ if (!L) return;
270
270
  let r = n?.plan ?? g(e, t);
271
- st(t);
271
+ ct(t);
272
272
  let i = {};
273
- for (let [e, t] of Object.entries(n?.clones ?? {})) i[e] = at(e, t);
274
- let a = (e) => () => nt(i[e]), o = () => {
275
- K && (K = 0, y.forceUpdate());
276
- }, s = () => nt(P.current);
277
- r.presence === "enter" ? we = "instant" : r.morph === "open" && (we = "open"), Je();
278
- let c = n?.heading, l = c && r.morph !== "none" ? rt()?.getBoundingClientRect() : null;
279
- c && l && z.shiftHeading(c.left - l.left, c.top - l.top, r.morph === "open" ? "open" : "close");
280
- let u = Ge(), d = Y && e.presented?.handle === Y.handle && !t.stack.includes(Y.handle) ? Y : void 0;
281
- Y && !t.stack.includes(Y.handle) && (Y = null), (r.presence === "exit" || r.presence === "rise" || r.presence === "replace") && (i.exit ? z.exit(u, s, d) : d && z.release("dragX", 0), r.presence === "exit" && z.hide()), (r.presence === "enter" || r.presence === "replace") && (z.enter(u, Qe("presence")), r.presence === "enter" && (z.setTails(t.depth, "settle", 0, o), t.open ? z.open() : z.setBadge(t.badge))), r.presence === "rise" && (z.rise(-u * W.tailOffset, W.tailScale, Qe("presence")), z.swap("header", Qe("header"), !0)), (r.tails === "arrival" || r.tails === "rise" || r.tails === "settle") && (t.depth < e.depth && (K = Math.max(K, e.depth)), z.setTails(t.depth, r.tails, e.depth, o)), r.morph === "open" ? (K = Math.max(K, e.depth), z.open(o)) : r.morph === "close" && z.collapse(t.depth, t.badge, {
273
+ for (let [e, t] of Object.entries(n?.clones ?? {})) i[e] = ot(e, t);
274
+ let a = (e) => () => rt(i[e]), o = () => {
275
+ W && (W = 0, y.forceUpdate());
276
+ }, s = () => rt(de.current);
277
+ r.presence === "enter" ? De = "instant" : r.morph === "open" && (De = "open"), Ye();
278
+ let c = n?.heading, l = c && r.morph !== "none" ? it()?.getBoundingClientRect() : null;
279
+ c && l && L.shiftHeading(c.left - l.left, c.top - l.top, r.morph === "open" ? "open" : "close");
280
+ let u = Ke(), d = J && e.presented?.handle === J.handle && !t.stack.includes(J.handle) ? J : void 0;
281
+ J && !t.stack.includes(J.handle) && (J = null), (r.presence === "exit" || r.presence === "rise" || r.presence === "replace") && (i.exit ? L.exit(u, s, d) : d && L.release("dragX", 0), r.presence === "exit" && L.hide()), (r.presence === "enter" || r.presence === "replace") && (L.enter(u, $e("presence")), r.presence === "enter" && (L.setTails(t.depth, "settle", 0, o), t.open ? L.open() : L.setBadge(t.badge))), r.presence === "rise" && (L.rise(-u * H.tailOffset, H.tailScale, $e("presence")), L.swap("header", $e("header"), !0)), (r.tails === "arrival" || r.tails === "rise" || r.tails === "settle") && (t.depth < e.depth && (W = Math.max(W, e.depth)), L.setTails(t.depth, r.tails, e.depth, o)), r.morph === "open" ? (W = Math.max(W, e.depth), L.open(o)) : r.morph === "close" && L.collapse(t.depth, t.badge, {
282
282
  chrome: a("chrome"),
283
283
  tails: o
284
284
  });
285
- let f = We() && n ? U.height - n.height : 0;
286
- if (L.slideOut && (L.slideOut.top = k(f + Se)), L.chromeOut && i.chrome && (L.chromeOut.top = k(f)), r.slide) {
287
- let e = Qe("slide");
288
- z.slide(je ? -r.slide : r.slide, U.width, () => {
289
- nt(i.slide), e();
285
+ let f = Ge() && n ? V.height - n.height : 0;
286
+ if (F.slideOut && (F.slideOut.top = k(f + Te)), F.chromeOut && i.chrome && (F.chromeOut.top = k(f)), r.slide) {
287
+ let e = $e("slide");
288
+ L.slide(Ne ? -r.slide : r.slide, V.width, () => {
289
+ rt(i.slide), e();
290
290
  });
291
291
  }
292
292
  if (i.header) {
293
- let e = Qe("header");
294
- z.swap("header", () => {
295
- nt(i.header), e();
293
+ let e = $e("header");
294
+ L.swap("header", () => {
295
+ rt(i.header), e();
296
296
  });
297
297
  }
298
- i.body && z.swap("body", a("body")), i.badge && z.swap("badge", a("badge")), i.page && z.swap("page", a("page")), !t.open && e.presented && t.presented && r.morph === "none" && z.setBadge(t.badge);
298
+ i.body && L.swap("body", a("body")), i.badge && L.swap("badge", a("badge")), i.page && L.swap("page", a("page")), !t.open && e.presented && t.presented && r.morph === "none" && L.setBadge(t.badge);
299
299
  let p = x.getSnapshot().presentation;
300
300
  r.begin && r.header && t.presented && p?.token && p.readable && p.handle === t.presented.handle && x.beginPresentation(S, t.presented.handle, p.token);
301
301
  }
302
- function st(e) {
303
- let t = e.presented, n = t?.content.progress, r = rt()?.querySelector(":scope > .cloudlet-icon > .cloudlet-ring > .cloudlet-progress-fill") ?? null, i = n?.kind === "determinate", a = r !== De || t?.handle !== Oe || !ke;
304
- De = r, Oe = t?.handle ?? null, ke = i && !!r, z?.setProgress(i ? n.value : null, a);
305
- }
306
302
  function ct(e) {
307
- (J?.handle !== e?.handle || J?.side !== e?.side) && (J = e, y.forceUpdate());
303
+ let t = e.presented, n = t?.content.progress, r = it()?.querySelector(":scope > .cloudlet-icon > .cloudlet-ring > .cloudlet-progress-fill") ?? null, i = n?.kind === "determinate", a = r !== G || t?.handle !== Ae || !je;
304
+ G = r, Ae = t?.handle ?? null, je = i && !!r, L?.setProgress(i ? n.value : null, a);
308
305
  }
309
306
  function lt(e) {
307
+ (q?.handle !== e?.handle || q?.side !== e?.side) && (q = e, y.forceUpdate());
308
+ }
309
+ function ut(e) {
310
310
  return {
311
- move: (e) => z?.drag("dragX", e),
311
+ move: (e) => L?.drag("dragX", e),
312
312
  end: (t, n) => {
313
- let r = f(t, n, U.width, {
313
+ let r = f(t, n, V.width, {
314
314
  negative: !0,
315
315
  positive: !0
316
316
  });
317
317
  if (r) {
318
- if (Y = {
318
+ if (J = {
319
319
  handle: e,
320
320
  direction: r,
321
- distance: U.width,
321
+ distance: V.width,
322
322
  velocity: n * 1e3
323
323
  }, x.dismiss(S, e, "swipe").status === "applied") return;
324
- Y = null;
324
+ J = null;
325
325
  }
326
- z?.release("dragX", n * 1e3);
326
+ L?.release("dragX", n * 1e3);
327
327
  },
328
- cancel: () => z?.release("dragX", 0)
328
+ cancel: () => L?.release("dragX", 0)
329
329
  };
330
330
  }
331
- function ut(e, t) {
331
+ function dt(e, t) {
332
332
  let n = y.props.snapshot.stack, r = n.indexOf(e);
333
- return r < 0 ? null : n[r + t * (je ? -1 : 1)] ?? null;
333
+ return r < 0 ? null : n[r + t * (Ne ? -1 : 1)] ?? null;
334
334
  }
335
- function dt(e) {
335
+ function ft(e) {
336
336
  let t = (t) => {
337
- let n = t < 0 ? 1 : -1, r = t ? ut(e, n) : null;
338
- return ct(r ? {
337
+ let n = t < 0 ? 1 : -1, r = t ? dt(e, n) : null;
338
+ return lt(r ? {
339
339
  handle: r,
340
340
  side: n
341
- } : null), r ? Math.max(-U.width, Math.min(U.width, t)) : p(t, U.width);
342
- }, n = (e) => z?.release("slide", e, () => ct(null));
341
+ } : null), r ? Math.max(-V.width, Math.min(V.width, t)) : p(t, V.width);
342
+ }, n = (e) => L?.release("slide", e, () => lt(null));
343
343
  return {
344
- move: (e) => z?.drag("slide", t(e)),
344
+ move: (e) => L?.drag("slide", t(e)),
345
345
  end: (t, r) => {
346
- let i = f(t, r, U.width, {
347
- negative: !!ut(e, 1),
348
- positive: !!ut(e, -1)
349
- }), a = i ? ut(e, i < 0 ? 1 : -1) : null;
346
+ let i = f(t, r, V.width, {
347
+ negative: !!dt(e, 1),
348
+ positive: !!dt(e, -1)
349
+ }), a = i ? dt(e, i < 0 ? 1 : -1) : null;
350
350
  if (a) {
351
- let e = J;
352
- if (J = null, z?.fling("slide", r * 1e3), x.navigate(S, a).status === "applied") return;
353
- J = e;
351
+ let e = q;
352
+ if (q = null, L?.fling("slide", r * 1e3), x.navigate(S, a).status === "applied") return;
353
+ q = e;
354
354
  }
355
- n(J ? r * 1e3 : 0);
355
+ n(q ? r * 1e3 : 0);
356
356
  },
357
357
  cancel: () => n(0)
358
358
  };
359
359
  }
360
- function ft() {
361
- let e = We() ? 1 : -1, t = (t) => p(t, t * e > 0 ? U.height : c.swipe.minDistance);
360
+ function pt() {
361
+ let e = Ge() ? 1 : -1, t = (t) => p(t, t * e > 0 ? V.height : c.swipe.minDistance);
362
362
  return {
363
- move: (e) => z?.drag("dragY", t(e)),
363
+ move: (e) => L?.drag("dragY", t(e)),
364
364
  end: (t, n) => {
365
- z?.release("dragY", 0);
366
- let r = Math.min(U.height, c.swipe.edge / c.swipe.distance);
365
+ L?.release("dragY", 0);
366
+ let r = Math.min(V.height, c.swipe.edge / c.swipe.distance);
367
367
  f(t, n, r, {
368
368
  negative: e < 0,
369
369
  positive: e > 0
370
370
  }) && x.collapseIsland(S);
371
371
  },
372
- cancel: () => z?.release("dragY", 0)
372
+ cancel: () => L?.release("dragY", 0)
373
373
  };
374
374
  }
375
- function pt(e, t) {
375
+ function mt(e, t) {
376
376
  let n = M.current, r = N.current, { presented: i, open: a } = _(y.props.snapshot);
377
- if (V || !z || !G || !n || !r || !i || !n.contains(e)) return null;
377
+ if (z || !L || !U || !n || !r || !i || !n.contains(e)) return null;
378
378
  let o, s = !1;
379
379
  if (a ? (o = r.contains(e), s = o && t === "pointer" && !!e.closest(".cloudlet-clip > .cloudlet-slide > .cloudlet-header")) : o = t === "pointer" && !!e.closest("[data-cloudlet-pill]"), !o && !s) return null;
380
380
  let { handle: c } = i;
@@ -384,7 +384,7 @@ function A(y) {
384
384
  reason: "gesture",
385
385
  active: !0
386
386
  }).status === "rejected") return null;
387
- Me = {
387
+ Pe = {
388
388
  handle: c,
389
389
  open: a
390
390
  };
@@ -392,9 +392,9 @@ function A(y) {
392
392
  return {
393
393
  x: o,
394
394
  y: s,
395
- start: (e) => a ? e === "x" ? dt(c) : ft() : lt(c),
395
+ start: (e) => a ? e === "x" ? ft(c) : pt() : ut(c),
396
396
  release() {
397
- l || (l = !0, Me = null, x.setPause(S, {
397
+ l || (l = !0, Pe = null, x.setPause(S, {
398
398
  scope: "notification",
399
399
  handle: c,
400
400
  reason: "gesture",
@@ -403,50 +403,60 @@ function A(y) {
403
403
  }
404
404
  };
405
405
  }
406
- function mt(e) {
406
+ function ht(e) {
407
407
  let t = M.current;
408
408
  return !!t && _(y.props.snapshot).open && t.contains(e);
409
409
  }
410
- function ht() {
410
+ function gt() {
411
411
  let e = A.current, t = M.current;
412
412
  if (!e || !D || !t) return;
413
- _e = !0;
413
+ ye = !0;
414
414
  let n = se.current?.sheet, r = `[data-cloudlet-instance="${y.props.snapshot.controller}"]`;
415
415
  if (n) for (let [e, t] of Object.entries(te)) {
416
416
  let i = n.insertRule(`${r}${t} {}`, n.cssRules.length);
417
- L[e] = n.cssRules[i].style;
417
+ F[e] = n.cssRules[i].style;
418
418
  }
419
419
  for (let e of [
420
- P.current,
421
420
  de.current,
422
- fe.current
421
+ fe.current,
422
+ pe.current
423
423
  ]) e?.setAttribute("inert", "");
424
- pe.mount(e), q = d(e, {
425
- begin: pt,
426
- claimsWheel: mt,
424
+ me.mount(e), K = d(e, {
425
+ begin: mt,
426
+ claimsWheel: ht,
427
427
  now: () => D.performance.now()
428
428
  });
429
- let i = D.matchMedia?.("(prefers-reduced-motion: reduce)");
430
- V = i?.matches ?? !1, e.dataset.reducedMotion = String(V), z = l({
429
+ let i = D.matchMedia?.("(prefers-reduced-motion: reduce)"), a = !!e.parentElement?.closest("[data-reduced-motion]"), o = () => (i?.matches ?? !1) || y.props.options.reducedMotion === !0 || a;
430
+ z = o(), e.dataset.reducedMotion = String(z), L = l({
431
431
  now: () => D.performance.now(),
432
432
  requestFrame: (e) => D.requestAnimationFrame(e),
433
433
  cancelFrame: (e) => D.cancelAnimationFrame(e),
434
- write: qe,
435
- reducedMotion: V,
434
+ write: Je,
435
+ reducedMotion: z,
436
436
  timeScale: y.props.options.motion?.timeScale,
437
- constants: B
437
+ constants: R
438
+ });
439
+ let s = () => {
440
+ let t = o();
441
+ t !== z && (z = t, e.dataset.reducedMotion = String(z), z && K?.cancel(), L?.setReducedMotion(z));
442
+ };
443
+ Ce = s;
444
+ let c = D.MutationObserver ? new D.MutationObserver(() => {
445
+ a = !!e.parentElement?.closest("[data-reduced-motion]"), s();
446
+ }) : null;
447
+ for (let t = e.parentElement; t && c; t = t.parentElement) c.observe(t, {
448
+ attributes: !0,
449
+ attributeFilter: ["data-reduced-motion"]
438
450
  });
439
- let a = () => {
440
- V = i?.matches ?? !1, e.dataset.reducedMotion = String(V), V && q?.cancel(), z?.setReducedMotion(V);
441
- }, o = D.matchMedia?.("(min-width: 48rem)"), s = D.matchMedia?.("(prefers-color-scheme: dark)"), c = () => {
451
+ let u = D.matchMedia?.("(min-width: 48rem)"), f = D.matchMedia?.("(prefers-color-scheme: dark)"), p = () => {
442
452
  (y.props.options.theme ?? "system") === "system" && y.forceUpdate();
443
- }, u = () => {
444
- (y.props.options.position ?? "auto") === "auto" && (q?.cancel(), y.forceUpdate());
445
- }, f = () => Z("document-hidden", E.visibilityState === "hidden"), p = [
453
+ }, m = () => {
454
+ (y.props.options.position ?? "auto") === "auto" && (K?.cancel(), y.forceUpdate());
455
+ }, g = () => Z("document-hidden", E.visibilityState === "hidden"), v = [
446
456
  [
447
457
  E,
448
458
  "visibilitychange",
449
- f
459
+ g
450
460
  ],
451
461
  [
452
462
  E,
@@ -461,7 +471,7 @@ function A(y) {
461
471
  E,
462
472
  "pointerover",
463
473
  (t) => {
464
- xe && !(t.target instanceof D.Node && e.contains(t.target)) && Re(!1);
474
+ we && !(t.target instanceof D.Node && e.contains(t.target)) && ze(!1);
465
475
  },
466
476
  !0
467
477
  ],
@@ -478,81 +488,82 @@ function A(y) {
478
488
  [
479
489
  D,
480
490
  "resize",
481
- $e
491
+ et
482
492
  ]
483
493
  ];
484
- i && p.push([
494
+ i && v.push([
485
495
  i,
486
496
  "change",
487
- a
488
- ]), o && p.push([
489
- o,
497
+ s
498
+ ]), u && v.push([
499
+ u,
490
500
  "change",
491
- u
492
- ]), s && p.push([
493
- s,
501
+ m
502
+ ]), f && v.push([
503
+ f,
494
504
  "change",
495
- c
496
- ]), D.visualViewport && p.push([
505
+ p
506
+ ]), D.visualViewport && v.push([
497
507
  D.visualViewport,
498
508
  "resize",
499
- $e
509
+ et
500
510
  ], [
501
511
  D.visualViewport,
502
512
  "scroll",
503
- Ue
513
+ We
504
514
  ]);
505
- for (let [e, t, n, r] of p) e.addEventListener(t, n, r);
506
- ge = () => {
507
- for (let [e, t, n, r] of p) e.removeEventListener(t, n, r);
508
- }, H = D.ResizeObserver ? new D.ResizeObserver(() => {
509
- Je(), Ze();
510
- }) : null, N.current && H?.observe(N.current), H?.observe(e), f(), Z("window-blur", !E.hasFocus()), He(E.activeElement), Ue(), Le(), ot(h, _(y.props.snapshot), null), Ze(), tt();
511
- }
512
- function gt(e) {
515
+ for (let [e, t, n, r] of v) e.addEventListener(t, n, r);
516
+ ve = () => {
517
+ for (let [e, t, n, r] of v) e.removeEventListener(t, n, r);
518
+ c?.disconnect(), Ce = null;
519
+ }, B = D.ResizeObserver ? new D.ResizeObserver(() => {
520
+ Ye(), Qe();
521
+ }) : null, N.current && B?.observe(N.current), B?.observe(e), g(), Z("window-blur", !E.hasFocus()), Ue(E.activeElement), We(), Re(), st(h, _(y.props.snapshot), null), Qe(), nt();
522
+ }
523
+ function _t(e) {
513
524
  let t = _(e.snapshot), n = _(y.props.snapshot), r = g(t, n), i = {
514
525
  plan: r,
515
- clones: it(r),
516
- heading: r.morph !== "none" && G ? rt()?.getBoundingClientRect() ?? null : null,
517
- height: U.height
518
- }, a = I;
519
- if (I = null, me = null, a && e.snapshot.notifications.some((e) => e.handle === a) && !y.props.snapshot.notifications.some((e) => e.handle === a)) return i;
526
+ clones: at(r),
527
+ heading: r.morph !== "none" && U ? it()?.getBoundingClientRect() ?? null : null,
528
+ height: V.height
529
+ }, a = P;
530
+ if (P = null, ge = null, a && e.snapshot.notifications.some((e) => e.handle === a) && !y.props.snapshot.notifications.some((e) => e.handle === a)) return i;
520
531
  let o = A.current, s = E.activeElement;
521
- if (!o || !D || !(s instanceof D.HTMLElement) || s === o || !o.contains(s) || j(e.snapshot) === j(y.props.snapshot) && xt(e) === xt(y.props)) return i;
522
- me = s;
532
+ if (!o || !D || !(s instanceof D.HTMLElement) || s === o || !o.contains(s) || j(e.snapshot) === j(y.props.snapshot) && St(e) === St(y.props)) return i;
533
+ ge = s;
523
534
  let c = y.props.snapshot;
524
- return he = !c.notifications.length && !c.overflow.pending, (!he || !Ve()) && o.focus({ preventScroll: !0 }), i;
535
+ return _e = !c.notifications.length && !c.overflow.pending, (!_e || !He()) && o.focus({ preventScroll: !0 }), i;
525
536
  }
526
- function _t(e, t, n) {
527
- let r = me;
528
- me = null, he ? (he = !1, Ve()) : r && !Q(r) && (Q(et() ?? A.current?.querySelector("[data-cloudlet-overflow]") ?? null) || A.current?.focus({ preventScroll: !0 })), X && !xt(y.props) && yt(!1), z?.setTimeScale(y.props.options.motion?.timeScale), be();
537
+ function vt(e, t, n) {
538
+ let r = ge;
539
+ ge = null, _e ? (_e = !1, He()) : r && !Q(r) && (Q(tt() ?? A.current?.querySelector("[data-cloudlet-overflow]") ?? null) || A.current?.focus({ preventScroll: !0 })), Y && !St(y.props) && bt(!1), L?.setTimeScale(y.props.options.motion?.timeScale), Se(), Ce?.();
529
540
  let i = _(y.props.snapshot);
530
- Me && (Me.handle !== i.presented?.handle || Me.open !== i.open) && q?.cancel(), J && (!i.open || !i.stack.includes(J.handle)) && (q?.cancel(), ct(null)), e.snapshot === y.props.snapshot ? Je() : ot(_(e.snapshot), i, n), Le(), Ze(), tt(), He(E.activeElement);
541
+ Pe && (Pe.handle !== i.presented?.handle || Pe.open !== i.open) && K?.cancel(), q && (!i.open || !i.stack.includes(q.handle)) && (K?.cancel(), lt(null)), e.snapshot === y.props.snapshot ? Ye() : st(_(e.snapshot), i, n), Re(), Qe(), nt(), Ue(E.activeElement);
531
542
  }
532
- function vt() {
533
- q?.dispose(), q = null, J = null, Y = null, yt(!1), pe.dispose(), _e = !1, ge?.(), ge = null, H?.disconnect(), H = null, z?.dispose(), z = null, Te.clear();
543
+ function yt() {
544
+ K?.dispose(), K = null, q = null, J = null, bt(!1), me.dispose(), ye = !1, ve?.(), ve = null, B?.disconnect(), B = null, L?.dispose(), L = null, Oe.clear();
534
545
  let e = se.current?.sheet;
535
546
  if (e) for (; e.cssRules.length;) e.deleteRule(0);
536
- L = {};
547
+ F = {};
537
548
  for (let e of [
538
- P.current,
539
549
  de.current,
540
- fe.current
541
- ]) nt(e);
542
- De = null;
550
+ fe.current,
551
+ pe.current
552
+ ]) rt(e);
553
+ G = null;
543
554
  let t = E.activeElement;
544
- A.current?.contains(t) && !Ve() && t?.blur();
555
+ A.current?.contains(t) && !He() && t?.blur();
545
556
  }
546
- function yt(e = !0) {
547
- D?.clearTimeout(Ne), Ne = void 0, X && (X = !1, e && _e && y.forceUpdate());
557
+ function bt(e = !0) {
558
+ D?.clearTimeout(Fe), Fe = void 0, Y && (Y = !1, e && ye && y.forceUpdate());
548
559
  }
549
- function bt() {
550
- X ? (yt(), x.clearAll(S)) : (X = !0, Ne = D?.setTimeout(yt, ne), y.forceUpdate());
560
+ function xt() {
561
+ Y ? (bt(), x.clearAll(S)) : (Y = !0, Fe = D?.setTimeout(bt, ne), y.forceUpdate());
551
562
  }
552
- let xt = (e) => e.options.clearAll !== !1 && _(e.snapshot).open && e.snapshot.stack.length > 1, St = (e) => {
553
- I = e, x.dismiss(S, e, "navigation").status !== "applied" && (I = null);
563
+ let St = (e) => e.options.clearAll !== !1 && _(e.snapshot).open && e.snapshot.stack.length > 1, Ct = (e) => {
564
+ P = e, x.dismiss(S, e, "navigation").status !== "applied" && (P = null);
554
565
  };
555
- function Ct(e, t, n, r) {
566
+ function wt(e, t, n, r) {
556
567
  if (e.defaultPrevented) return;
557
568
  let i = null;
558
569
  if (e.nativeEvent.isComposing) return;
@@ -565,22 +576,22 @@ function A(y) {
565
576
  let a = i === null ? void 0 : t[i];
566
577
  a && (e.preventDefault(), x.navigate(S, a));
567
578
  }
568
- function wt() {
579
+ function Tt() {
569
580
  let { snapshot: s, options: c } = y.props, l = {
570
581
  ...i,
571
582
  ...c.labels
572
583
  }, u = s.controller ?? "cloudlet", d = c.dir ?? (E.documentElement.dir === "rtl" ? "rtl" : "ltr"), f = c.theme ?? "system";
573
- je = d === "rtl";
584
+ Ne = d === "rtl";
574
585
  let p = `${u}-island`, m = _(s), { presented: h, open: g, total: v, index: b, missed: T } = m;
575
- m.badge && (Ee = m.count);
576
- let te = g && J ? s.notifications.find((e) => e.handle === J.handle) : void 0, ne = c.position ?? "auto", O = String(ne), k = O.startsWith("bottom-") || ne === "auto" && D?.matchMedia?.("(min-width: 48rem)").matches === !1, ie = O.endsWith("-left") ? "left" : O.endsWith("-right") ? "right" : "center", ae = Math.min(2, Math.max(m.depth, K)), j = h ? o(x, S, h.handle, ze) : null, pe = Ie(l.page, i.page, b + 1, v), F = Ie(l.clearAllConfirm, i.clearAllConfirm, v), I = a(c.classNames);
586
+ m.badge && (ke = m.count);
587
+ let te = g && q ? s.notifications.find((e) => e.handle === q.handle) : void 0, ne = c.position ?? "auto", O = String(ne), k = O.startsWith("bottom-") || ne === "auto" && D?.matchMedia?.("(min-width: 48rem)").matches === !1, ie = O.endsWith("-left") ? "left" : O.endsWith("-right") ? "right" : "center", ae = Math.min(2, Math.max(m.depth, W)), j = h ? o(x, S, h.handle, Be) : null, me = X(l.page, i.page, b + 1, v), he = X(l.clearAllConfirm, i.clearAllConfirm, v), P = a(c.classNames);
577
588
  return /* @__PURE__ */ w(ee, { children: [c.offsets && /* @__PURE__ */ C(oe, {
578
589
  instance: u,
579
590
  offsets: c.offsets,
580
591
  nonce: c.nonce
581
592
  }, c.nonce ?? ""), /* @__PURE__ */ w("div", {
582
593
  ref: A,
583
- className: I("host", "cloudlet-host"),
594
+ className: P("host", "cloudlet-host"),
584
595
  role: "region",
585
596
  "aria-label": l.region,
586
597
  tabIndex: -1,
@@ -596,45 +607,45 @@ function A(y) {
596
607
  "data-overflow": s.overflow.pending,
597
608
  dir: d,
598
609
  onPointerDownCapture: (e) => {
599
- R = e.target.closest("button");
610
+ I = e.target.closest("button");
600
611
  },
601
612
  onPointerCancelCapture: () => {
602
- R = null;
613
+ I = null;
603
614
  },
604
615
  onKeyDownCapture: (e) => {
605
- (e.key === "Enter" || e.key === " ") && e.target.closest("button") && (ve = e.repeat, e.repeat ? e.preventDefault() : R = e.target.closest("button"));
616
+ (e.key === "Enter" || e.key === " ") && e.target.closest("button") && (be = e.repeat, e.repeat ? e.preventDefault() : I = e.target.closest("button"));
606
617
  },
607
618
  onKeyUpCapture: () => {
608
- ve = !1;
619
+ be = !1;
609
620
  },
610
621
  onClickCapture: (e) => {
611
622
  let t = e.target.closest("button"), n = !!t?.matches("[data-cloudlet-control=\"action\"], [data-cloudlet-control=\"retry\"], [data-cloudlet-control=\"cancel\"], [data-cloudlet-control=\"clear\"]");
612
- t && (ve || n && e.detail > 1 || R && R !== t) && (e.preventDefault(), e.stopPropagation()), R = null;
623
+ t && (be || n && e.detail > 1 || I && I !== t) && (e.preventDefault(), e.stopPropagation()), I = null;
613
624
  },
614
625
  onFocus: (e) => {
615
- Be(e.relatedTarget), He(E.activeElement);
626
+ Ve(e.relatedTarget), Ue(E.activeElement);
616
627
  },
617
- onBlur: (e) => He(D && e.relatedTarget instanceof D.Element ? e.relatedTarget : null),
618
- onMouseEnter: () => Re(!0),
619
- onMouseLeave: () => Re(!1),
628
+ onBlur: (e) => Ue(D && e.relatedTarget instanceof D.Element ? e.relatedTarget : null),
629
+ onMouseEnter: () => ze(!0),
630
+ onMouseLeave: () => ze(!1),
620
631
  children: [/* @__PURE__ */ C("style", {
621
632
  ref: se,
622
633
  nonce: c.nonce,
623
634
  "data-cloudlet-motion": ""
624
635
  }), /* @__PURE__ */ w("div", {
625
636
  ref: ce,
626
- className: I("stack", "cloudlet-stack"),
637
+ className: P("stack", "cloudlet-stack"),
627
638
  "data-empty": !h,
628
639
  children: [
629
640
  [1, 2].filter((e) => e <= ae).map((e) => /* @__PURE__ */ C("div", {
630
- className: I("tail", "cloudlet-tail"),
641
+ className: P("tail", "cloudlet-tail"),
631
642
  "data-cloudlet-tail": e,
632
643
  "aria-hidden": "true"
633
644
  }, e)),
634
645
  /* @__PURE__ */ w("div", {
635
646
  ref: M,
636
647
  id: p,
637
- className: I("island", "cloudlet-shell"),
648
+ className: P("island", "cloudlet-shell"),
638
649
  hidden: !h,
639
650
  "data-state": g ? "island" : "stack",
640
651
  "data-kind": h?.kind,
@@ -644,7 +655,7 @@ function A(y) {
644
655
  "aria-label": l.island,
645
656
  "aria-describedby": `${p}-hint`
646
657
  } : {},
647
- onKeyDown: g ? (e) => Ct(e, s.stack, b, d === "rtl") : void 0,
658
+ onKeyDown: g ? (e) => wt(e, s.stack, b, d === "rtl") : void 0,
648
659
  children: [
649
660
  /* @__PURE__ */ C("svg", {
650
661
  ref: le,
@@ -658,7 +669,7 @@ function A(y) {
658
669
  className: "cloudlet-clip",
659
670
  children: [
660
671
  /* @__PURE__ */ C("div", {
661
- ref: de,
672
+ ref: fe,
662
673
  className: "cloudlet-slide-out",
663
674
  "aria-hidden": "true"
664
675
  }),
@@ -670,16 +681,16 @@ function A(y) {
670
681
  ...g ? {
671
682
  role: "group",
672
683
  "aria-roledescription": l.slide,
673
- "aria-label": pe
684
+ "aria-label": me
674
685
  } : {},
675
686
  children: [
676
687
  /* @__PURE__ */ w("div", {
677
- className: I("header", "cloudlet-header"),
688
+ className: P("header", "cloudlet-header"),
678
689
  "aria-hidden": g ? void 0 : "true",
679
690
  children: [/* @__PURE__ */ C(t, {
680
691
  notification: h,
681
692
  slot: j,
682
- part: I,
693
+ part: P,
683
694
  titleId: `${p}-title`
684
695
  }), /* @__PURE__ */ C("div", {
685
696
  className: "cloudlet-heading-out",
@@ -692,9 +703,9 @@ function A(y) {
692
703
  bridge: x,
693
704
  lease: S,
694
705
  labels: l,
695
- navigate: St,
706
+ navigate: Ct,
696
707
  slot: j,
697
- part: I,
708
+ part: P,
698
709
  titleId: `${p}-title`
699
710
  }),
700
711
  /* @__PURE__ */ C("div", {
@@ -710,19 +721,19 @@ function A(y) {
710
721
  children: /* @__PURE__ */ C(n, {
711
722
  notification: te,
712
723
  labels: l,
713
- part: I
724
+ part: P
714
725
  })
715
726
  }),
716
- h && g && r(l, I, () => x.dismiss(S, h.handle, "close-button")),
727
+ h && g && r(l, P, () => x.dismiss(S, h.handle, "close-button")),
717
728
  g && (v > 1 || T > 0) && /* @__PURE__ */ w("div", {
718
- className: I("indicator", "cloudlet-indicator"),
729
+ className: P("indicator", "cloudlet-indicator"),
719
730
  children: [
720
731
  v > 5 ? /* @__PURE__ */ w("p", {
721
732
  className: "cloudlet-page",
722
733
  "aria-hidden": "true",
723
734
  children: [/* @__PURE__ */ C("span", {
724
735
  className: "cloudlet-page-value",
725
- children: pe
736
+ children: me
726
737
  }), /* @__PURE__ */ C("span", { className: "cloudlet-page-out" })]
727
738
  }) : v > 1 && /* @__PURE__ */ C("div", {
728
739
  className: "cloudlet-dots",
@@ -730,7 +741,7 @@ function A(y) {
730
741
  type: "button",
731
742
  className: "cloudlet-dot-button",
732
743
  "aria-current": t === b ? "true" : void 0,
733
- "aria-label": Ie(l.page, i.page, t + 1, v),
744
+ "aria-label": X(l.page, i.page, t + 1, v),
734
745
  onClick: () => x.navigate(S, e),
735
746
  children: /* @__PURE__ */ C("span", {
736
747
  className: "cloudlet-dot",
@@ -738,28 +749,28 @@ function A(y) {
738
749
  })
739
750
  }, e.generation))
740
751
  }),
741
- xt(y.props) && /* @__PURE__ */ w(ee, { children: [/* @__PURE__ */ w("button", {
752
+ St(y.props) && /* @__PURE__ */ w(ee, { children: [/* @__PURE__ */ w("button", {
742
753
  type: "button",
743
- className: I("clear", "cloudlet-clear"),
754
+ className: P("clear", "cloudlet-clear"),
744
755
  "data-cloudlet-control": "clear",
745
- "data-armed": X,
746
- onClick: bt,
747
- onBlur: () => yt(),
756
+ "data-armed": Y,
757
+ onClick: xt,
758
+ onBlur: () => bt(),
748
759
  children: [/* @__PURE__ */ C("span", {
749
- "aria-hidden": X || void 0,
760
+ "aria-hidden": Y || void 0,
750
761
  children: l.clearAll
751
762
  }), /* @__PURE__ */ C("span", {
752
- "aria-hidden": !X || void 0,
753
- children: F
763
+ "aria-hidden": !Y || void 0,
764
+ children: he
754
765
  })]
755
766
  }), /* @__PURE__ */ C("span", {
756
767
  role: "status",
757
768
  className: "cloudlet-live",
758
- children: X ? F : ""
769
+ children: Y ? he : ""
759
770
  })] }),
760
771
  T > 0 && /* @__PURE__ */ w("div", {
761
- className: I("overflow", "cloudlet-overflow"),
762
- children: [/* @__PURE__ */ C("p", { children: Ie(l.overflowCount, i.overflowCount, T) }), /* @__PURE__ */ C("button", {
772
+ className: P("overflow", "cloudlet-overflow"),
773
+ children: [/* @__PURE__ */ C("p", { children: X(l.overflowCount, i.overflowCount, T) }), /* @__PURE__ */ C("button", {
763
774
  type: "button",
764
775
  "data-cloudlet-overflow": "",
765
776
  onClick: () => x.acknowledgeOverflow(S),
@@ -774,7 +785,7 @@ function A(y) {
774
785
  children: l.collapse
775
786
  }),
776
787
  /* @__PURE__ */ C("div", {
777
- ref: fe,
788
+ ref: pe,
778
789
  className: "cloudlet-chrome-out",
779
790
  "aria-hidden": "true"
780
791
  })
@@ -782,25 +793,25 @@ function A(y) {
782
793
  }),
783
794
  h && !g && /* @__PURE__ */ C("button", {
784
795
  type: "button",
785
- className: I("pill", "cloudlet-pill"),
796
+ className: P("pill", "cloudlet-pill"),
786
797
  "data-cloudlet-pill": "",
787
798
  "aria-expanded": "false",
788
799
  "aria-controls": p,
789
800
  onClick: () => x.openIsland(S, "user"),
790
- "aria-label": [Ie(l.stackSummary, i.stackSummary, h.content.title, v, T), ...h.draft ? [l.draft] : []].join(", ")
801
+ "aria-label": [X(l.stackSummary, i.stackSummary, h.content.title, v, T), ...h.draft ? [l.draft] : []].join(", ")
791
802
  }),
792
803
  /* @__PURE__ */ w("span", {
793
- className: I("badge", "cloudlet-badge"),
804
+ className: P("badge", "cloudlet-badge"),
794
805
  "aria-hidden": "true",
795
806
  children: [/* @__PURE__ */ C("span", {
796
807
  className: "cloudlet-badge-value",
797
- children: Ee
808
+ children: ke
798
809
  }), /* @__PURE__ */ C("span", { className: "cloudlet-badge-out" })]
799
810
  })
800
811
  ]
801
812
  }),
802
813
  /* @__PURE__ */ C("div", {
803
- ref: P,
814
+ ref: de,
804
815
  className: "cloudlet-exit",
805
816
  "aria-hidden": "true"
806
817
  })
@@ -809,11 +820,11 @@ function A(y) {
809
820
  })] });
810
821
  }
811
822
  return {
812
- componentDidMount: ht,
813
- getSnapshotBeforeUpdate: gt,
814
- componentDidUpdate: _t,
815
- componentWillUnmount: vt,
816
- render: wt
823
+ componentDidMount: gt,
824
+ getSnapshotBeforeUpdate: _t,
825
+ componentDidUpdate: vt,
826
+ componentWillUnmount: yt,
827
+ render: Tt
817
828
  };
818
829
  }
819
830
  function j(e) {