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