@inertiaui/modal-react 1.0.0-beta-2 → 1.0.0-beta-4

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.
@@ -1,14 +1,15 @@
1
- var Rr = Object.defineProperty;
2
- var _r = (e, t, r) => t in e ? Rr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var q = (e, t, r) => _r(e, typeof t != "symbol" ? t + "" : t, r);
1
+ var _r = Object.defineProperty;
2
+ var jr = (e, t, r) => t in e ? _r(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var K = (e, t, r) => jr(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import * as Ce from "react";
5
- import $, { createContext as z, useContext as H, useEffect as L, useRef as S, useState as C, createElement as Ne, useMemo as N, forwardRef as Ot, useImperativeHandle as Yt, useLayoutEffect as Dr, useCallback as U, Fragment as Y, isValidElement as jr, cloneElement as Wr, useId as Ie, useSyncExternalStore as Ur, useReducer as Hr, createRef as Vr } from "react";
6
- import { jsxs as pe, Fragment as St, jsx as P } from "react/jsx-runtime";
7
- import Xe from "axios";
8
- import { usePage as Br, router as Pe } from "@inertiajs/react";
9
- import { mergeDataIntoQueryString as Xr } from "@inertiajs/core";
10
- import { createPortal as zr } from "react-dom";
11
- const Se = {
5
+ import $, { createContext as z, useContext as H, useEffect as L, useRef as S, useState as F, createElement as Re, useMemo as D, forwardRef as Tt, useImperativeHandle as Qt, useLayoutEffect as Wr, useCallback as W, Fragment as ue, isValidElement as Ur, cloneElement as Hr, useId as De, useSyncExternalStore as Vr, useReducer as Br, createRef as Xr } from "react";
6
+ import { jsxs as he, Fragment as Mt, jsx as T } from "react/jsx-runtime";
7
+ import ze from "axios";
8
+ import * as Rt from "@inertiajs/react";
9
+ import { usePage as zr, router as Me } from "@inertiajs/react";
10
+ import { mergeDataIntoQueryString as Gr } from "@inertiajs/core";
11
+ import { createPortal as Kr } from "react-dom";
12
+ const Pe = {
12
13
  type: "modal",
13
14
  navigate: !1,
14
15
  modal: {
@@ -28,20 +29,20 @@ const Se = {
28
29
  position: "right"
29
30
  }
30
31
  };
31
- class Gr {
32
+ class qr {
32
33
  constructor() {
33
34
  this.config = {}, this.reset();
34
35
  }
35
36
  reset() {
36
- this.config = JSON.parse(JSON.stringify(Se));
37
+ this.config = JSON.parse(JSON.stringify(Pe));
37
38
  }
38
39
  put(t, r) {
39
40
  if (typeof t == "object") {
40
41
  this.config = {
41
- type: t.type ?? Se.type,
42
- navigate: t.navigate ?? Se.navigate,
43
- modal: { ...Se.modal, ...t.modal ?? {} },
44
- slideover: { ...Se.slideover, ...t.slideover ?? {} }
42
+ type: t.type ?? Pe.type,
43
+ navigate: t.navigate ?? Pe.navigate,
44
+ modal: { ...Pe.modal, ...t.modal ?? {} },
45
+ slideover: { ...Pe.slideover, ...t.slideover ?? {} }
45
46
  };
46
47
  return;
47
48
  }
@@ -64,142 +65,163 @@ class Gr {
64
65
  return n;
65
66
  }
66
67
  }
67
- const Ye = new Gr(), gi = () => Ye.reset(), wi = (e, t) => Ye.put(e, t), Tt = (e) => Ye.get(e), we = (e, t) => Ye.get(e ? `slideover.${t}` : `modal.${t}`);
68
- function qr(e, t) {
69
- return e = typeof e == "string" ? new URL(e, window.location.origin) : e, t = typeof t == "string" ? new URL(t, window.location.origin) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
68
+ const Ze = new qr(), Ei = () => Ze.reset(), $i = (e, t) => Ze.put(e, t), Lt = (e) => Ze.get(e), we = (e, t) => Ze.get(e ? `slideover.${t}` : `modal.${t}`);
69
+ function Yr(e, t) {
70
+ const r = typeof window < "u" ? window.location.origin : "http://localhost";
71
+ return e = typeof e == "string" ? new URL(e, r) : e, t = typeof t == "string" ? new URL(t, r) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
70
72
  }
71
- function ct(e = "inertiaui_modal_") {
73
+ function mt(e = "inertiaui_modal_") {
72
74
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}${crypto.randomUUID()}` : `${e}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
73
75
  }
74
- function ye(e) {
76
+ function be(e) {
75
77
  return typeof e == "string" ? e.toLowerCase() : e;
76
78
  }
77
- function Kr(e, t, r = !1) {
78
- return r && (t = t.map(ye)), Array.isArray(e) ? e.filter((n) => !t.includes(r ? ye(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? ye(l) : l) || (n[l] = e[l]), n), {});
79
+ function Zr(e, t, r = !1) {
80
+ return r && (t = t.map(be)), Array.isArray(e) ? e.filter((n) => !t.includes(r ? be(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? be(l) : l) || (n[l] = e[l]), n), {});
79
81
  }
80
- function Yr(e, t, r = !1) {
81
- return r && (t = t.map(ye)), Array.isArray(e) ? e.filter((n) => t.includes(r ? ye(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? ye(l) : l) && (n[l] = e[l]), n), {});
82
+ function Jr(e, t, r = !1) {
83
+ return r && (t = t.map(be)), Array.isArray(e) ? e.filter((n) => t.includes(r ? be(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? be(l) : l) && (n[l] = e[l]), n), {});
82
84
  }
83
- function Zr(e) {
85
+ function Qr(e) {
84
86
  return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, r) => (r in e && e[r] !== null && (t[r] = e[r]), t), {});
85
87
  }
86
88
  function Te(e) {
87
89
  return e ? (e = e.replace(/_/g, "-"), e = e.replace(/-+/g, "-"), /[A-Z]/.test(e) ? (e = e.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (t, r) => r.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : "";
88
90
  }
89
- const Ze = z(null);
90
- Ze.displayName = "ModalStackContext";
91
- let Zt = null, Jt = null, xe = null, Ue = {}, dt = [], be = {};
92
- const Jr = ({ children: e }) => {
93
- const [t, r] = C([]), [n, l] = C({}), i = (h) => {
94
- r((c) => {
95
- const d = h([...c]), v = (b) => {
91
+ function en(e) {
92
+ if (typeof window < "u")
93
+ return e.toLowerCase() in window;
94
+ if (typeof document < "u") {
95
+ const n = document.createElement("div");
96
+ return e.toLowerCase() in n;
97
+ }
98
+ const t = e.toLowerCase();
99
+ return [
100
+ /^on(click|dblclick|mousedown|mouseup|mouseover|mouseout|mousemove|mouseenter|mouseleave)$/,
101
+ /^on(keydown|keyup|keypress)$/,
102
+ /^on(focus|blur|change|input|submit|reset)$/,
103
+ /^on(load|unload|error|resize|scroll)$/,
104
+ /^on(touchstart|touchend|touchmove|touchcancel)$/,
105
+ /^on(pointerdown|pointerup|pointermove|pointerenter|pointerleave|pointercancel)$/,
106
+ /^on(drag|dragstart|dragend|dragenter|dragleave|dragover|drop)$/,
107
+ /^on(animationstart|animationend|animationiteration)$/,
108
+ /^on(transitionstart|transitionend|transitionrun|transitioncancel)$/
109
+ ].some((n) => n.test(t));
110
+ }
111
+ const Je = z(null);
112
+ Je.displayName = "ModalStackContext";
113
+ let er = null, tr = null, xe = null, He = {}, pt = [], ye = {};
114
+ const tn = ({ children: e }) => {
115
+ const [t, r] = F([]), [n, l] = F({}), i = (h) => {
116
+ r((u) => {
117
+ const c = h([...u]), v = (w) => {
96
118
  var m;
97
- return d.length < 2 ? !0 : ((m = d.map((x) => ({ id: x.id, shouldRender: x.shouldRender })).reverse().find((x) => x.shouldRender)) == null ? void 0 : m.id) === b;
119
+ return c.length < 2 ? !0 : ((m = c.map((x) => ({ id: x.id, shouldRender: x.shouldRender })).reverse().find((x) => x.shouldRender)) == null ? void 0 : m.id) === w;
98
120
  };
99
- return d.forEach((b, m) => {
100
- d[m].onTopOfStack = v(b.id), d[m].getParentModal = () => m < 1 ? null : d.slice(0, m).reverse().find((x) => x.isOpen), d[m].getChildModal = () => m === d.length - 1 ? null : d.slice(m + 1).find((x) => x.isOpen);
101
- }), d;
121
+ return c.forEach((w, m) => {
122
+ c[m].onTopOfStack = v(w.id), c[m].getParentModal = () => m < 1 ? null : c.slice(0, m).reverse().find((x) => x.isOpen), c[m].getChildModal = () => m === c.length - 1 ? null : c.slice(m + 1).find((x) => x.isOpen);
123
+ }), c;
102
124
  });
103
125
  };
104
126
  L(() => {
105
- dt = t;
127
+ pt = t;
106
128
  }, [t]);
107
129
  class s {
108
- constructor(c, d, v, b, m) {
109
- q(this, "show", () => {
130
+ constructor(u, c, v, w, m) {
131
+ K(this, "show", () => {
110
132
  i(
111
- (c) => c.map((d) => (d.id === this.id && !d.isOpen && (d.isOpen = !0, d.shouldRender = !0), d))
133
+ (u) => u.map((c) => (c.id === this.id && !c.isOpen && (c.isOpen = !0, c.shouldRender = !0), c))
112
134
  );
113
135
  });
114
- q(this, "setOpen", (c) => {
115
- c ? this.show() : this.close();
136
+ K(this, "setOpen", (u) => {
137
+ u ? this.show() : this.close();
116
138
  });
117
- q(this, "close", () => {
118
- i((c) => {
119
- let d = !1;
120
- const v = c.map((b) => {
139
+ K(this, "close", () => {
140
+ i((u) => {
141
+ let c = !1;
142
+ const v = u.map((w) => {
121
143
  var m;
122
- return b.id === this.id && b.isOpen && (Object.keys(b.listeners).forEach((x) => {
123
- b.off(x);
124
- }), b.isOpen = !1, (m = b.onCloseCallback) == null || m.call(b), d = !0), b;
144
+ return w.id === this.id && w.isOpen && (Object.keys(w.listeners).forEach((x) => {
145
+ w.off(x);
146
+ }), w.isOpen = !1, (m = w.onCloseCallback) == null || m.call(w), c = !0), w;
125
147
  });
126
- return d ? v : c;
148
+ return c ? v : u;
127
149
  });
128
150
  });
129
- q(this, "afterLeave", () => {
130
- this.isOpen || i((c) => {
131
- const d = c.map((v) => {
132
- var b;
133
- return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (b = v.afterLeaveCallback) == null || b.call(v), v.afterLeaveCallback = null), v;
151
+ K(this, "afterLeave", () => {
152
+ this.isOpen || i((u) => {
153
+ const c = u.map((v) => {
154
+ var w;
155
+ return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (w = v.afterLeaveCallback) == null || w.call(v), v.afterLeaveCallback = null), v;
134
156
  });
135
- return this.index === 0 ? [] : d;
157
+ return this.index === 0 ? [] : c;
136
158
  });
137
159
  });
138
- q(this, "on", (c, d) => {
139
- c = Te(c), this.listeners[c] = this.listeners[c] ?? [], this.listeners[c].push(d);
160
+ K(this, "on", (u, c) => {
161
+ u = Te(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(c);
140
162
  });
141
- q(this, "off", (c, d) => {
163
+ K(this, "off", (u, c) => {
142
164
  var v;
143
- c = Te(c), d ? this.listeners[c] = ((v = this.listeners[c]) == null ? void 0 : v.filter((b) => b !== d)) ?? [] : delete this.listeners[c];
165
+ u = Te(u), c ? this.listeners[u] = ((v = this.listeners[u]) == null ? void 0 : v.filter((w) => w !== c)) ?? [] : delete this.listeners[u];
144
166
  });
145
- q(this, "emit", (c, ...d) => {
167
+ K(this, "emit", (u, ...c) => {
146
168
  var v;
147
- (v = this.listeners[Te(c)]) == null || v.forEach((b) => b(...d));
169
+ (v = this.listeners[Te(u)]) == null || v.forEach((w) => w(...c));
148
170
  });
149
- q(this, "registerEventListenersFromProps", (c) => {
150
- const d = [];
151
- return Object.keys(c).filter((v) => v.startsWith("on")).forEach((v) => {
152
- const b = Te(v).replace(/^on-/, "");
153
- this.on(b, c[v]), d.push(() => this.off(b, c[v]));
154
- }), () => d.forEach((v) => v());
171
+ K(this, "registerEventListenersFromProps", (u) => {
172
+ const c = [];
173
+ return Object.keys(u).filter((v) => v.startsWith("on")).forEach((v) => {
174
+ const w = Te(v).replace(/^on-/, "");
175
+ this.on(w, u[v]), c.push(() => this.off(w, u[v]));
176
+ }), () => c.forEach((v) => v());
155
177
  });
156
- q(this, "reload", (c = {}) => {
178
+ K(this, "reload", (u = {}) => {
157
179
  var m, x;
158
- let d = Object.keys(this.response.props);
159
- if (c.only && (d = c.only), c.except && (d = Kr(d, c.except)), !((m = this.response) != null && m.url))
180
+ let c = Object.keys(this.response.props);
181
+ if (u.only && (c = u.only), u.except && (c = Zr(c, u.except)), !((m = this.response) != null && m.url))
160
182
  return;
161
- const v = (c.method ?? "get").toLowerCase(), b = c.data ?? {};
162
- (x = c.onStart) == null || x.call(c), Xe({
183
+ const v = (u.method ?? "get").toLowerCase(), w = u.data ?? {};
184
+ (x = u.onStart) == null || x.call(u), ze({
163
185
  url: this.response.url,
164
186
  method: v,
165
- data: v === "get" ? {} : b,
166
- params: v === "get" ? b : {},
187
+ data: v === "get" ? {} : w,
188
+ params: v === "get" ? w : {},
167
189
  headers: {
168
- ...c.headers ?? {},
190
+ ...u.headers ?? {},
169
191
  Accept: "text/html, application/xhtml+xml",
170
192
  "X-Inertia": !0,
171
193
  "X-Inertia-Partial-Component": this.response.component,
172
194
  "X-Inertia-Version": this.response.version,
173
- "X-Inertia-Partial-Data": d.join(","),
174
- "X-InertiaUI-Modal": ct(),
195
+ "X-Inertia-Partial-Data": c.join(","),
196
+ "X-InertiaUI-Modal": mt(),
175
197
  "X-InertiaUI-Modal-Use-Router": 0,
176
198
  "X-InertiaUI-Modal-Base-Url": xe
177
199
  }
178
200
  }).then((O) => {
179
- var I;
180
- this.updateProps(O.data.props), (I = c.onSuccess) == null || I.call(c, O);
201
+ var N;
202
+ this.updateProps(O.data.props), (N = u.onSuccess) == null || N.call(u, O);
181
203
  }).catch((O) => {
182
- var I;
183
- (I = c.onError) == null || I.call(c, O);
204
+ var N;
205
+ (N = u.onError) == null || N.call(u, O);
184
206
  }).finally(() => {
185
207
  var O;
186
- (O = c.onFinish) == null || O.call(c);
208
+ (O = u.onFinish) == null || O.call(u);
187
209
  });
188
210
  });
189
- q(this, "updateProps", (c) => {
190
- Object.assign(this.props, c), i((d) => d);
211
+ K(this, "updateProps", (u) => {
212
+ Object.assign(this.props, u), i((c) => c);
191
213
  });
192
- if (this.id = d.id ?? ct(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = c, this.props = d.props, this.response = d, this.config = v ?? {}, this.onCloseCallback = b, this.afterLeaveCallback = m, be[this.id]) {
214
+ if (this.id = c.id ?? mt(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = c.props, this.response = c, this.config = v ?? {}, this.onCloseCallback = w, this.afterLeaveCallback = m, ye[this.id]) {
193
215
  this.config = {
194
216
  ...this.config,
195
- ...be[this.id].config ?? {}
217
+ ...ye[this.id].config ?? {}
196
218
  };
197
- const x = be[this.id].onClose, O = be[this.id].onAfterLeave;
198
- x && (this.onCloseCallback = b ? () => {
199
- b(), x();
219
+ const x = ye[this.id].onClose, O = ye[this.id].onAfterLeave;
220
+ x && (this.onCloseCallback = w ? () => {
221
+ w(), x();
200
222
  } : x), O && (this.afterLeaveCallback = m ? () => {
201
223
  m(), O();
202
- } : O), delete be[this.id];
224
+ } : O), delete ye[this.id];
203
225
  }
204
226
  this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
205
227
  }
@@ -207,154 +229,163 @@ const Jr = ({ children: e }) => {
207
229
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `inertiaui_modal_${crypto.randomUUID()}` : `inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
208
230
  }
209
231
  }
210
- const a = (h, c = {}, d = null, v = null) => Jt(h.component).then((b) => u(b, h, c, d, v)), o = (h) => {
211
- var d, v;
212
- const c = (v = (d = h.response) == null ? void 0 : d.meta) == null ? void 0 : v.deferredProps;
213
- c && Object.keys(c).forEach((b) => {
214
- h.reload({ only: c[b] });
232
+ const a = (h, u = {}, c = null, v = null) => tr(h.component).then((w) => f(w, h, u, c, v)), o = (h) => {
233
+ var c, v;
234
+ const u = (v = (c = h.response) == null ? void 0 : c.meta) == null ? void 0 : v.deferredProps;
235
+ u && Object.keys(u).forEach((w) => {
236
+ h.reload({ only: u[w] });
215
237
  });
216
- }, u = (h, c, d, v, b) => {
217
- const m = new s(h, c, d, v, b);
238
+ }, f = (h, u, c, v, w) => {
239
+ const m = new s(h, u, c, v, w);
218
240
  return m.index = t.length, i((x) => [...x, m]), o(m), m.show(), m;
219
241
  };
220
- function p(h, c, d, v) {
242
+ function p(h, u, c, v) {
221
243
  if (!n[h])
222
244
  throw new Error(`The local modal "${h}" has not been registered.`);
223
- const b = u(null, {}, c, d, v);
224
- return b.name = h, n[h].callback(b), b;
245
+ const w = f(null, {}, u, c, v);
246
+ return w.name = h, n[h].callback(w), w;
225
247
  }
226
- const w = (h, c = {}) => y(
248
+ const g = (h, u = {}) => y(
227
249
  h,
228
- c.method ?? "get",
229
- c.data ?? {},
230
- c.headers ?? {},
231
- c.config ?? {},
232
- c.onClose,
233
- c.onAfterLeave,
234
- c.queryStringArrayFormat ?? "brackets",
235
- c.navigate ?? Tt("navigate"),
236
- c.onStart,
237
- c.onSuccess,
238
- c.onError
239
- ).then((d) => {
240
- const v = c.listeners ?? {};
241
- return Object.keys(v).forEach((b) => {
242
- const m = Te(b);
243
- d.on(m, v[b]);
244
- }), d;
245
- }), y = (h, c, d = {}, v = {}, b = {}, m = null, x = null, O = "brackets", I = !1, j = null, F = null, R = null) => {
246
- const B = ct();
247
- return new Promise((_, A) => {
250
+ u.method ?? "get",
251
+ u.data ?? {},
252
+ u.headers ?? {},
253
+ u.config ?? {},
254
+ u.onClose,
255
+ u.onAfterLeave,
256
+ u.queryStringArrayFormat ?? "brackets",
257
+ u.navigate ?? Lt("navigate"),
258
+ u.onStart,
259
+ u.onSuccess,
260
+ u.onError
261
+ ).then((c) => {
262
+ const v = u.listeners ?? {};
263
+ return Object.keys(v).forEach((w) => {
264
+ const m = Te(w);
265
+ c.on(m, v[w]);
266
+ }), c;
267
+ }), y = (h, u, c = {}, v = {}, w = {}, m = null, x = null, O = "brackets", N = !1, _ = null, C = null, I = null) => {
268
+ const B = mt();
269
+ return new Promise((R, k) => {
248
270
  if (h.startsWith("#")) {
249
- _(p(h.substring(1), b, m, x));
271
+ R(p(h.substring(1), w, m, x));
250
272
  return;
251
273
  }
252
- const [W, ve] = Xr(c, h || "", d, O);
253
- let se = I && t.length === 0;
274
+ const [j, ge] = Gr(u, h || "", c, O);
275
+ let ce = N && t.length === 0;
254
276
  if (t.length === 0 && (xe = typeof window < "u" ? window.location.href : ""), v = {
255
277
  ...v,
256
278
  Accept: "text/html, application/xhtml+xml",
257
279
  "X-Requested-With": "XMLHttpRequest",
258
280
  "X-Inertia": !0,
259
- "X-Inertia-Version": Zt,
281
+ "X-Inertia-Version": er,
260
282
  "X-InertiaUI-Modal": B,
261
- "X-InertiaUI-Modal-Use-Router": se ? 1 : 0,
283
+ "X-InertiaUI-Modal-Use-Router": ce ? 1 : 0,
262
284
  "X-InertiaUI-Modal-Base-Url": xe
263
- }, se)
264
- return Ue = {}, be[B] = {
265
- config: b,
285
+ }, ce)
286
+ return He = {}, ye[B] = {
287
+ config: w,
266
288
  onClose: m,
267
289
  onAfterLeave: x
268
- }, Pe.visit(W, {
269
- method: c,
270
- data: ve,
290
+ }, Me.visit(j, {
291
+ method: u,
292
+ data: ge,
271
293
  headers: v,
272
294
  preserveScroll: !0,
273
295
  preserveState: !0,
274
- onError(...k) {
275
- R == null || R(...k), A(...k);
296
+ onError(...A) {
297
+ I == null || I(...A), k(...A);
276
298
  },
277
- onStart(...k) {
278
- j == null || j(...k);
299
+ onStart(...A) {
300
+ _ == null || _(...A);
279
301
  },
280
- onSuccess(...k) {
281
- F == null || F(...k);
302
+ onSuccess(...A) {
303
+ C == null || C(...A);
282
304
  },
283
305
  onBefore: () => {
284
- Ue[B] = _;
306
+ He[B] = R;
285
307
  }
286
308
  });
287
- j == null || j(), Xe({
288
- url: W,
289
- method: c,
290
- data: ve,
309
+ _ == null || _();
310
+ const J = (A) => {
311
+ try {
312
+ Rt.progress && A(Rt.progress);
313
+ } catch {
314
+ }
315
+ };
316
+ J((A) => A.start()), ze({
317
+ url: j,
318
+ method: u,
319
+ data: ge,
291
320
  headers: v
292
- }).then((k) => {
293
- F == null || F(k), _(a(k.data, b, m, x));
294
- }).catch((...k) => {
295
- R == null || R(...k), A(...k);
321
+ }).then((A) => {
322
+ C == null || C(A), R(a(A.data, w, m, x));
323
+ }).catch((...A) => {
324
+ I == null || I(...A), k(...A);
325
+ }).finally(() => {
326
+ J((A) => A.finish());
296
327
  });
297
328
  });
298
329
  }, E = {
299
330
  stack: t,
300
331
  localModals: n,
301
- push: u,
332
+ push: f,
302
333
  pushFromResponseData: a,
303
- length: () => dt.length,
334
+ length: () => pt.length,
304
335
  closeAll: () => {
305
- dt.reverse().forEach((h) => h.close());
336
+ pt.reverse().forEach((h) => h.close());
306
337
  },
307
338
  reset: () => i(() => []),
308
339
  visit: y,
309
- visitModal: w,
310
- registerLocalModal: (h, c) => {
311
- l((d) => ({
312
- ...d,
313
- [h]: { name: h, callback: c }
340
+ visitModal: g,
341
+ registerLocalModal: (h, u) => {
342
+ l((c) => ({
343
+ ...c,
344
+ [h]: { name: h, callback: u }
314
345
  }));
315
346
  },
316
347
  removeLocalModal: (h) => {
317
- l((c) => {
318
- const d = { ...c };
319
- return delete d[h], d;
348
+ l((u) => {
349
+ const c = { ...u };
350
+ return delete c[h], c;
320
351
  });
321
352
  },
322
353
  onModalOnBase: (h) => {
323
- const c = Ue[h.id];
324
- c && (c(h), delete Ue[h.id]);
354
+ const u = He[h.id];
355
+ u && (u(h), delete He[h.id]);
325
356
  }
326
357
  };
327
- return /* @__PURE__ */ P(Ze.Provider, { value: E, children: e });
328
- }, Je = () => {
329
- const e = H(Ze);
358
+ return /* @__PURE__ */ T(Je.Provider, { value: E, children: e });
359
+ }, Qe = () => {
360
+ const e = H(Je);
330
361
  if (e === null)
331
362
  throw new Error("useModalStack must be used within a ModalStackProvider");
332
363
  return e;
333
- }, Nt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Qr = (e) => {
334
- e.initialPage && (Zt = e.initialPage.version), e.resolveComponent && (Jt = e.resolveComponent);
335
- }, bi = (e, t) => (Qr(t), /* @__PURE__ */ P(Jr, { children: /* @__PURE__ */ P(e, { ...t, children: ({ Component: n, props: l, key: i }) => /* @__PURE__ */ pe(St, { children: [
364
+ }, Dt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], rn = (e) => {
365
+ e.initialPage && (er = e.initialPage.version), e.resolveComponent && (tr = e.resolveComponent);
366
+ }, Oi = (e, t) => (rn(t), /* @__PURE__ */ T(tn, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: n, props: l, key: i }) => /* @__PURE__ */ he(Mt, { children: [
336
367
  (() => {
337
- const a = Ne(n, { key: i, ...l });
338
- return typeof n.layout == "function" ? n.layout(a) : Array.isArray(n.layout) ? n.layout.concat(a).reverse().reduce((u, p) => Ne(p, l, u)) : a;
368
+ const a = Re(n, { key: i, ...l });
369
+ return typeof n.layout == "function" ? n.layout(a) : Array.isArray(n.layout) ? n.layout.concat(a).reverse().reduce((f, p) => Re(p, l, f)) : a;
339
370
  })(),
340
- /* @__PURE__ */ P(en, {})
341
- ] }) }) })), en = ({ children: e }) => {
342
- var o, u;
343
- const t = H(Ze), r = Br();
371
+ /* @__PURE__ */ T(nn, {})
372
+ ] }) }) })), nn = ({ children: e }) => {
373
+ var o, f;
374
+ const t = H(Je), r = zr();
344
375
  let n = !1, l = !1, i = !!((o = r.props) != null && o._inertiaui_modal);
345
- L(() => Pe.on("start", () => n = !0), []), L(() => Pe.on("finish", () => n = !1), []), L(
346
- () => Pe.on("navigate", function(p) {
347
- const w = p.detail.page.props._inertiaui_modal;
348
- if (!w) {
376
+ L(() => Me.on("start", () => n = !0), []), L(() => Me.on("finish", () => n = !1), []), L(
377
+ () => Me.on("navigate", function(p) {
378
+ const g = p.detail.page.props._inertiaui_modal;
379
+ if (!g) {
349
380
  l && t.closeAll(), xe = null, i = !1;
350
381
  return;
351
382
  }
352
- l = w, xe = w.baseUrl, t.pushFromResponseData(w, {}, () => {
353
- if (!w.baseUrl) {
383
+ l = g, xe = g.baseUrl, t.pushFromResponseData(g, {}, () => {
384
+ if (!g.baseUrl) {
354
385
  console.error("No base url in modal response data so cannot navigate back");
355
386
  return;
356
387
  }
357
- !n && window.location.href !== w.baseUrl && Pe.visit(w.baseUrl, {
388
+ !n && typeof window < "u" && window.location.href !== g.baseUrl && Me.visit(g.baseUrl, {
358
389
  preserveScroll: !0,
359
390
  preserveState: !0
360
391
  });
@@ -363,29 +394,29 @@ const Jr = ({ children: e }) => {
363
394
  []
364
395
  );
365
396
  const s = (p) => {
366
- var w;
367
- return p.headers["X-InertiaUI-Modal-Base-Url"] = xe ?? (i ? (w = r.props._inertiaui_modal) == null ? void 0 : w.baseUrl : null), p;
397
+ var g;
398
+ return p.headers["X-InertiaUI-Modal-Base-Url"] = xe ?? (i ? (g = r.props._inertiaui_modal) == null ? void 0 : g.baseUrl : null), p;
368
399
  };
369
- L(() => (Xe.interceptors.request.use(s), () => Xe.interceptors.request.eject(s)), []);
400
+ L(() => (ze.interceptors.request.use(s), () => ze.interceptors.request.eject(s)), []);
370
401
  const a = S();
371
402
  return L(() => {
372
- var y, g;
373
- const p = (y = r.props) == null ? void 0 : y._inertiaui_modal, w = a.current;
374
- a.current = p, p && w && p.component === w.component && qr(p.url, w.url) && ((g = t.stack[0]) == null || g.updateProps(p.props ?? {}));
375
- }, [(u = r.props) == null ? void 0 : u._inertiaui_modal]), /* @__PURE__ */ pe(St, { children: [
403
+ var y, b;
404
+ const p = (y = r.props) == null ? void 0 : y._inertiaui_modal, g = a.current;
405
+ a.current = p, p && g && p.component === g.component && Yr(p.url, g.url) && ((b = t.stack[0]) == null || b.updateProps(p.props ?? {}));
406
+ }, [(f = r.props) == null ? void 0 : f._inertiaui_modal]), /* @__PURE__ */ he(Mt, { children: [
376
407
  e,
377
- t.stack.length > 0 && /* @__PURE__ */ P(er, { index: 0 })
408
+ t.stack.length > 0 && /* @__PURE__ */ T(nr, { index: 0 })
378
409
  ] });
379
- }, Pt = $.createContext(null);
380
- Pt.displayName = "ModalIndexContext";
381
- const Qt = () => {
382
- const e = $.useContext(Pt);
410
+ }, kt = $.createContext(null);
411
+ kt.displayName = "ModalIndexContext";
412
+ const rr = () => {
413
+ const e = $.useContext(kt);
383
414
  if (e === void 0)
384
415
  throw new Error("useModalIndex must be used within a ModalIndexProvider");
385
416
  return e;
386
- }, er = ({ index: e }) => {
387
- const { stack: t } = Je(), r = N(() => t[e], [t, e]);
388
- return (r == null ? void 0 : r.component) && /* @__PURE__ */ P(Pt.Provider, { value: e, children: /* @__PURE__ */ P(
417
+ }, nr = ({ index: e }) => {
418
+ const { stack: t } = Qe(), r = D(() => t[e], [t, e]);
419
+ return (r == null ? void 0 : r.component) && /* @__PURE__ */ T(kt.Provider, { value: e, children: /* @__PURE__ */ T(
389
420
  r.component,
390
421
  {
391
422
  ...r.props,
@@ -393,23 +424,23 @@ const Qt = () => {
393
424
  }
394
425
  ) });
395
426
  };
396
- function tr() {
397
- return Je().stack[Qt()] ?? null;
427
+ function lr() {
428
+ return Qe().stack[rr()] ?? null;
398
429
  }
399
- const tn = ({ children: e, data: t, fallback: r }) => {
430
+ const ln = ({ children: e, data: t, fallback: r }) => {
400
431
  if (!t)
401
432
  throw new Error("`<Deferred>` requires a `data` prop to be a string or array of strings");
402
- const [n, l] = C(!1), i = Array.isArray(t) ? t : [t], s = tr().props;
433
+ const [n, l] = F(!1), i = Array.isArray(t) ? t : [t], s = lr().props;
403
434
  return L(() => {
404
435
  l(i.every((a) => s[a] !== void 0));
405
436
  }, [s, i]), n ? e : r;
406
437
  };
407
- tn.displayName = "InertiaModalDeferred";
408
- const rr = Ot(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, ...s }, a) => {
409
- const o = Qt(), { stack: u, registerLocalModal: p, removeLocalModal: w } = Je(), [y, g] = C(null), f = N(() => e ? y : u[o], [e, y, o, u]), E = N(() => {
438
+ ln.displayName = "InertiaModalDeferred";
439
+ const ir = Tt(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, ...s }, a) => {
440
+ const o = rr(), { stack: f, registerLocalModal: p, removeLocalModal: g } = Qe(), [y, b] = F(null), d = D(() => e ? y : f[o], [e, y, o, f]), E = D(() => {
410
441
  var m;
411
- return (m = u.find((x) => x.shouldRender && x.index > (f == null ? void 0 : f.index))) == null ? void 0 : m.index;
412
- }, [o, u]), h = N(() => (f == null ? void 0 : f.config.slideover) ?? s.slideover ?? Tt("type") === "slideover", [s.slideover]), c = N(
442
+ return (m = f.find((x) => x.shouldRender && x.index > (d == null ? void 0 : d.index))) == null ? void 0 : m.index;
443
+ }, [o, f]), h = D(() => (d == null ? void 0 : d.config.slideover) ?? s.slideover ?? Lt("type") === "slideover", [s.slideover]), u = D(
413
444
  () => ({
414
445
  slideover: h,
415
446
  closeButton: s.closeButton ?? we(h, "closeButton"),
@@ -418,128 +449,128 @@ const rr = Ot(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onCl
418
449
  paddingClasses: s.paddingClasses ?? we(h, "paddingClasses"),
419
450
  panelClasses: s.panelClasses ?? we(h, "panelClasses"),
420
451
  position: s.position ?? we(h, "position"),
421
- ...f == null ? void 0 : f.config
452
+ ...d == null ? void 0 : d.config
422
453
  }),
423
- [s, f == null ? void 0 : f.config]
454
+ [s, d == null ? void 0 : d.config]
424
455
  );
425
456
  L(() => {
426
457
  if (e) {
427
458
  let m = null;
428
459
  return p(e, (x) => {
429
- m = x.registerEventListenersFromProps(s), g(x);
460
+ m = x.registerEventListenersFromProps(s), b(x);
430
461
  }), () => {
431
- m == null || m(), m = null, w(e);
462
+ m == null || m(), m = null, g(e);
432
463
  };
433
464
  }
434
- return f.registerEventListenersFromProps(s);
465
+ return d.registerEventListenersFromProps(s);
435
466
  }, [e]);
436
- const d = S(f);
467
+ const c = S(d);
437
468
  L(() => {
438
- d.current = f;
439
- }, [f]), L(() => {
440
- f !== null && (f.isOpen ? i == null || i() : l == null || l());
441
- }, [f == null ? void 0 : f.isOpen]);
442
- const [v, b] = C(!1);
469
+ c.current = d;
470
+ }, [d]), L(() => {
471
+ d !== null && (d.isOpen ? i == null || i() : l == null || l());
472
+ }, [d == null ? void 0 : d.isOpen]);
473
+ const [v, w] = F(!1);
443
474
  return L(() => {
444
- v && f !== null && f.isOpen && (f.onTopOfStack ? r == null || r() : n == null || n()), b(!0);
445
- }, [f == null ? void 0 : f.onTopOfStack]), Yt(
475
+ v && d !== null && d.isOpen && (d.onTopOfStack ? r == null || r() : n == null || n()), w(!0);
476
+ }, [d == null ? void 0 : d.onTopOfStack]), Qt(
446
477
  a,
447
478
  () => ({
448
479
  afterLeave: () => {
449
480
  var m;
450
- return (m = d.current) == null ? void 0 : m.afterLeave();
481
+ return (m = c.current) == null ? void 0 : m.afterLeave();
451
482
  },
452
483
  close: () => {
453
484
  var m;
454
- return (m = d.current) == null ? void 0 : m.close();
485
+ return (m = c.current) == null ? void 0 : m.close();
455
486
  },
456
487
  emit: (...m) => {
457
488
  var x;
458
- return (x = d.current) == null ? void 0 : x.emit(...m);
489
+ return (x = c.current) == null ? void 0 : x.emit(...m);
459
490
  },
460
491
  getChildModal: () => {
461
492
  var m;
462
- return (m = d.current) == null ? void 0 : m.getChildModal();
493
+ return (m = c.current) == null ? void 0 : m.getChildModal();
463
494
  },
464
495
  getParentModal: () => {
465
496
  var m;
466
- return (m = d.current) == null ? void 0 : m.getParentModal();
497
+ return (m = c.current) == null ? void 0 : m.getParentModal();
467
498
  },
468
499
  reload: (...m) => {
469
500
  var x;
470
- return (x = d.current) == null ? void 0 : x.reload(...m);
501
+ return (x = c.current) == null ? void 0 : x.reload(...m);
471
502
  },
472
503
  setOpen: () => {
473
504
  var m;
474
- return (m = d.current) == null ? void 0 : m.setOpen();
505
+ return (m = c.current) == null ? void 0 : m.setOpen();
475
506
  },
476
507
  get id() {
477
508
  var m;
478
- return (m = d.current) == null ? void 0 : m.id;
509
+ return (m = c.current) == null ? void 0 : m.id;
479
510
  },
480
511
  get index() {
481
512
  var m;
482
- return (m = d.current) == null ? void 0 : m.index;
513
+ return (m = c.current) == null ? void 0 : m.index;
483
514
  },
484
515
  get isOpen() {
485
516
  var m;
486
- return (m = d.current) == null ? void 0 : m.isOpen;
517
+ return (m = c.current) == null ? void 0 : m.isOpen;
487
518
  },
488
519
  get config() {
489
520
  var m;
490
- return (m = d.current) == null ? void 0 : m.config;
521
+ return (m = c.current) == null ? void 0 : m.config;
491
522
  },
492
523
  get modalContext() {
493
- return d.current;
524
+ return c.current;
494
525
  },
495
526
  get onTopOfStack() {
496
527
  var m;
497
- return (m = d.current) == null ? void 0 : m.onTopOfStack;
528
+ return (m = c.current) == null ? void 0 : m.onTopOfStack;
498
529
  },
499
530
  get shouldRender() {
500
531
  var m;
501
- return (m = d.current) == null ? void 0 : m.shouldRender;
532
+ return (m = c.current) == null ? void 0 : m.shouldRender;
502
533
  }
503
534
  }),
504
- [f]
505
- ), (f == null ? void 0 : f.shouldRender) && /* @__PURE__ */ pe(St, { children: [
535
+ [d]
536
+ ), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ he(Mt, { children: [
506
537
  typeof t == "function" ? t({
507
- afterLeave: f.afterLeave,
508
- close: f.close,
509
- config: c,
510
- emit: f.emit,
511
- getChildModal: f.getChildModal,
512
- getParentModal: f.getParentModal,
513
- id: f.id,
514
- index: f.index,
515
- isOpen: f.isOpen,
516
- modalContext: f,
517
- onTopOfStack: f.onTopOfStack,
518
- reload: f.reload,
519
- setOpen: f.setOpen,
520
- shouldRender: f.shouldRender
538
+ afterLeave: d.afterLeave,
539
+ close: d.close,
540
+ config: u,
541
+ emit: d.emit,
542
+ getChildModal: d.getChildModal,
543
+ getParentModal: d.getParentModal,
544
+ id: d.id,
545
+ index: d.index,
546
+ isOpen: d.isOpen,
547
+ modalContext: d,
548
+ onTopOfStack: d.onTopOfStack,
549
+ reload: d.reload,
550
+ setOpen: d.setOpen,
551
+ shouldRender: d.shouldRender
521
552
  }) : t,
522
- E && /* @__PURE__ */ P(er, { index: E })
553
+ E && /* @__PURE__ */ T(nr, { index: E })
523
554
  ] });
524
555
  });
525
- rr.displayName = "HeadlessModal";
526
- function nr(e) {
556
+ ir.displayName = "HeadlessModal";
557
+ function or(e) {
527
558
  var t, r, n = "";
528
559
  if (typeof e == "string" || typeof e == "number") n += e;
529
560
  else if (typeof e == "object") if (Array.isArray(e)) {
530
561
  var l = e.length;
531
- for (t = 0; t < l; t++) e[t] && (r = nr(e[t])) && (n && (n += " "), n += r);
562
+ for (t = 0; t < l; t++) e[t] && (r = or(e[t])) && (n && (n += " "), n += r);
532
563
  } else for (r in e) e[r] && (n && (n += " "), n += r);
533
564
  return n;
534
565
  }
535
- function ze() {
536
- for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = nr(e)) && (n && (n += " "), n += t);
566
+ function Ge() {
567
+ for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = or(e)) && (n && (n += " "), n += t);
537
568
  return n;
538
569
  }
539
- var rn = Object.defineProperty, nn = (e, t, r) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ft = (e, t, r) => (nn(e, typeof t != "symbol" ? t + "" : t, r), r);
540
- let ln = class {
570
+ var on = Object.defineProperty, an = (e, t, r) => t in e ? on(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ht = (e, t, r) => (an(e, typeof t != "symbol" ? t + "" : t, r), r);
571
+ let sn = class {
541
572
  constructor() {
542
- ft(this, "current", this.detect()), ft(this, "handoffState", "pending"), ft(this, "currentId", 0);
573
+ ht(this, "current", this.detect()), ht(this, "handoffState", "pending"), ht(this, "currentId", 0);
543
574
  }
544
575
  set(t) {
545
576
  this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
@@ -565,17 +596,17 @@ let ln = class {
565
596
  get isHandoffComplete() {
566
597
  return this.handoffState === "complete";
567
598
  }
568
- }, fe = new ln();
569
- function Qe(e) {
599
+ }, ee = new sn();
600
+ function et(e) {
570
601
  var t, r;
571
- return fe.isServer ? null : e ? "ownerDocument" in e ? e.ownerDocument : "current" in e ? (r = (t = e.current) == null ? void 0 : t.ownerDocument) != null ? r : document : null : document;
602
+ return ee.isServer ? null : e ? "ownerDocument" in e ? e.ownerDocument : "current" in e ? (r = (t = e.current) == null ? void 0 : t.ownerDocument) != null ? r : document : null : document;
572
603
  }
573
- function et(e) {
604
+ function tt(e) {
574
605
  typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
575
606
  throw t;
576
607
  }));
577
608
  }
578
- function re() {
609
+ function ne() {
579
610
  let e = [], t = { addEventListener(r, n, l, i) {
580
611
  return r.addEventListener(n, l, i), t.add(() => r.removeEventListener(n, l, i));
581
612
  }, requestAnimationFrame(...r) {
@@ -588,7 +619,7 @@ function re() {
588
619
  return t.add(() => clearTimeout(n));
589
620
  }, microTask(...r) {
590
621
  let n = { current: !0 };
591
- return et(() => {
622
+ return tt(() => {
592
623
  n.current && r[0]();
593
624
  }), t.add(() => {
594
625
  n.current = !1;
@@ -599,7 +630,7 @@ function re() {
599
630
  Object.assign(r.style, { [n]: i });
600
631
  });
601
632
  }, group(r) {
602
- let n = re();
633
+ let n = ne();
603
634
  return r(n), this.add(() => n.dispose());
604
635
  }, add(r) {
605
636
  return e.includes(r) || e.push(r), () => {
@@ -611,99 +642,103 @@ function re() {
611
642
  } };
612
643
  return t;
613
644
  }
614
- function Mt() {
615
- let [e] = C(re);
645
+ function rt() {
646
+ let [e] = F(ne);
616
647
  return L(() => () => e.dispose(), [e]), e;
617
648
  }
618
- let D = (e, t) => {
619
- fe.isServer ? L(e, t) : Dr(e, t);
649
+ let U = (e, t) => {
650
+ ee.isServer ? L(e, t) : Wr(e, t);
620
651
  };
621
- function he(e) {
652
+ function ve(e) {
622
653
  let t = S(e);
623
- return D(() => {
654
+ return U(() => {
624
655
  t.current = e;
625
656
  }, [e]), t;
626
657
  }
627
658
  let M = function(e) {
628
- let t = he(e);
659
+ let t = ve(e);
629
660
  return $.useCallback((...r) => t.current(...r), [t]);
630
- }, on = z(void 0);
631
- function an() {
632
- return H(on);
661
+ };
662
+ function _e(e) {
663
+ return D(() => e, Object.values(e));
664
+ }
665
+ let un = z(void 0);
666
+ function cn() {
667
+ return H(un);
633
668
  }
634
- function wt(...e) {
669
+ function xt(...e) {
635
670
  return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
636
671
  }
637
- function te(e, t, ...r) {
672
+ function re(e, t, ...r) {
638
673
  if (e in t) {
639
674
  let l = t[e];
640
675
  return typeof l == "function" ? l(...r) : l;
641
676
  }
642
677
  let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
643
- throw Error.captureStackTrace && Error.captureStackTrace(n, te), n;
678
+ throw Error.captureStackTrace && Error.captureStackTrace(n, re), n;
644
679
  }
645
- var Ge = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Ge || {}), ie = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(ie || {});
680
+ var Ke = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Ke || {}), oe = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(oe || {});
646
681
  function G() {
647
- let e = un();
648
- return U((t) => sn({ mergeRefs: e, ...t }), [e]);
649
- }
650
- function sn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible: i = !0, name: s, mergeRefs: a }) {
651
- a = a ?? cn;
652
- let o = lr(t, e);
653
- if (i) return He(o, r, n, s, a);
654
- let u = l ?? 0;
655
- if (u & 2) {
656
- let { static: p = !1, ...w } = o;
657
- if (p) return He(w, r, n, s, a);
682
+ let e = fn();
683
+ return W((t) => dn({ mergeRefs: e, ...t }), [e]);
684
+ }
685
+ function dn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible: i = !0, name: s, mergeRefs: a }) {
686
+ a = a ?? mn;
687
+ let o = ar(t, e);
688
+ if (i) return Ve(o, r, n, s, a);
689
+ let f = l ?? 0;
690
+ if (f & 2) {
691
+ let { static: p = !1, ...g } = o;
692
+ if (p) return Ve(g, r, n, s, a);
658
693
  }
659
- if (u & 1) {
660
- let { unmount: p = !0, ...w } = o;
661
- return te(p ? 0 : 1, { 0() {
694
+ if (f & 1) {
695
+ let { unmount: p = !0, ...g } = o;
696
+ return re(p ? 0 : 1, { 0() {
662
697
  return null;
663
698
  }, 1() {
664
- return He({ ...w, hidden: !0, style: { display: "none" } }, r, n, s, a);
699
+ return Ve({ ...g, hidden: !0, style: { display: "none" } }, r, n, s, a);
665
700
  } });
666
701
  }
667
- return He(o, r, n, s, a);
702
+ return Ve(o, r, n, s, a);
668
703
  }
669
- function He(e, t = {}, r, n, l) {
670
- let { as: i = r, children: s, refName: a = "ref", ...o } = mt(e, ["unmount", "static"]), u = e.ref !== void 0 ? { [a]: e.ref } : {}, p = typeof s == "function" ? s(t) : s;
704
+ function Ve(e, t = {}, r, n, l) {
705
+ let { as: i = r, children: s, refName: a = "ref", ...o } = vt(e, ["unmount", "static"]), f = e.ref !== void 0 ? { [a]: e.ref } : {}, p = typeof s == "function" ? s(t) : s;
671
706
  "className" in o && o.className && typeof o.className == "function" && (o.className = o.className(t)), o["aria-labelledby"] && o["aria-labelledby"] === o.id && (o["aria-labelledby"] = void 0);
672
- let w = {};
707
+ let g = {};
673
708
  if (t) {
674
- let y = !1, g = [];
675
- for (let [f, E] of Object.entries(t)) typeof E == "boolean" && (y = !0), E === !0 && g.push(f.replace(/([A-Z])/g, (h) => `-${h.toLowerCase()}`));
709
+ let y = !1, b = [];
710
+ for (let [d, E] of Object.entries(t)) typeof E == "boolean" && (y = !0), E === !0 && b.push(d.replace(/([A-Z])/g, (h) => `-${h.toLowerCase()}`));
676
711
  if (y) {
677
- w["data-headlessui-state"] = g.join(" ");
678
- for (let f of g) w[`data-${f}`] = "";
712
+ g["data-headlessui-state"] = b.join(" ");
713
+ for (let d of b) g[`data-${d}`] = "";
679
714
  }
680
715
  }
681
- if (i === Y && (Object.keys(ue(o)).length > 0 || Object.keys(ue(w)).length > 0)) if (!jr(p) || Array.isArray(p) && p.length > 1) {
682
- if (Object.keys(ue(o)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(ue(o)).concat(Object.keys(ue(w))).map((y) => ` - ${y}`).join(`
716
+ if (Fe(i) && (Object.keys(de(o)).length > 0 || Object.keys(de(g)).length > 0)) if (!Ur(p) || Array.isArray(p) && p.length > 1 || hn(p)) {
717
+ if (Object.keys(de(o)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(de(o)).concat(Object.keys(de(g))).map((y) => ` - ${y}`).join(`
683
718
  `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((y) => ` - ${y}`).join(`
684
719
  `)].join(`
685
720
  `));
686
721
  } else {
687
- let y = p.props, g = y == null ? void 0 : y.className, f = typeof g == "function" ? (...c) => wt(g(...c), o.className) : wt(g, o.className), E = f ? { className: f } : {}, h = lr(p.props, ue(mt(o, ["ref"])));
688
- for (let c in w) c in h && delete w[c];
689
- return Wr(p, Object.assign({}, h, w, u, { ref: l(dn(p), u.ref) }, E));
722
+ let y = p.props, b = y == null ? void 0 : y.className, d = typeof b == "function" ? (...u) => xt(b(...u), o.className) : xt(b, o.className), E = d ? { className: d } : {}, h = ar(p.props, de(vt(o, ["ref"])));
723
+ for (let u in g) u in h && delete g[u];
724
+ return Hr(p, Object.assign({}, h, g, f, { ref: l(pn(p), f.ref) }, E));
690
725
  }
691
- return Ne(i, Object.assign({}, mt(o, ["ref"]), i !== Y && u, i !== Y && w), p);
726
+ return Re(i, Object.assign({}, vt(o, ["ref"]), !Fe(i) && f, !Fe(i) && g), p);
692
727
  }
693
- function un() {
694
- let e = S([]), t = U((r) => {
728
+ function fn() {
729
+ let e = S([]), t = W((r) => {
695
730
  for (let n of e.current) n != null && (typeof n == "function" ? n(r) : n.current = r);
696
731
  }, []);
697
732
  return (...r) => {
698
733
  if (!r.every((n) => n == null)) return e.current = r, t;
699
734
  };
700
735
  }
701
- function cn(...e) {
736
+ function mn(...e) {
702
737
  return e.every((t) => t == null) ? void 0 : (t) => {
703
738
  for (let r of e) r != null && (typeof r == "function" ? r(t) : r.current = t);
704
739
  };
705
740
  }
706
- function lr(...e) {
741
+ function ar(...e) {
707
742
  if (e.length === 0) return {};
708
743
  if (e.length === 1) return e[0];
709
744
  let t = {}, r = {};
@@ -723,55 +758,61 @@ function lr(...e) {
723
758
  }
724
759
  function V(e) {
725
760
  var t;
726
- return Object.assign(Ot(e), { displayName: (t = e.displayName) != null ? t : e.name });
761
+ return Object.assign(Tt(e), { displayName: (t = e.displayName) != null ? t : e.name });
727
762
  }
728
- function ue(e) {
763
+ function de(e) {
729
764
  let t = Object.assign({}, e);
730
765
  for (let r in t) t[r] === void 0 && delete t[r];
731
766
  return t;
732
767
  }
733
- function mt(e, t = []) {
768
+ function vt(e, t = []) {
734
769
  let r = Object.assign({}, e);
735
770
  for (let n of t) n in r && delete r[n];
736
771
  return r;
737
772
  }
738
- function dn(e) {
773
+ function pn(e) {
739
774
  return $.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
740
775
  }
741
- let fn = "span";
776
+ function Fe(e) {
777
+ return e === ue || e === Symbol.for("react.fragment");
778
+ }
779
+ function hn(e) {
780
+ return Fe(e.type);
781
+ }
782
+ let vn = "span";
742
783
  var qe = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(qe || {});
743
- function mn(e, t) {
784
+ function gn(e, t) {
744
785
  var r;
745
786
  let { features: n = 1, ...l } = e, i = { ref: t, "aria-hidden": (n & 2) === 2 ? !0 : (r = l["aria-hidden"]) != null ? r : void 0, hidden: (n & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } };
746
- return G()({ ourProps: i, theirProps: l, slot: {}, defaultTag: fn, name: "Hidden" });
787
+ return G()({ ourProps: i, theirProps: l, slot: {}, defaultTag: vn, name: "Hidden" });
747
788
  }
748
- let bt = V(mn);
749
- function ir(e) {
789
+ let Et = V(gn);
790
+ function wn(e) {
750
791
  return typeof e != "object" || e === null ? !1 : "nodeType" in e;
751
792
  }
752
- function ae(e) {
753
- return ir(e) && "tagName" in e;
793
+ function se(e) {
794
+ return wn(e) && "tagName" in e;
754
795
  }
755
- function me(e) {
756
- return ae(e) && "accessKey" in e;
796
+ function pe(e) {
797
+ return se(e) && "accessKey" in e;
757
798
  }
758
- function oe(e) {
759
- return ae(e) && "tabIndex" in e;
799
+ function ae(e) {
800
+ return se(e) && "tabIndex" in e;
760
801
  }
761
- function pn(e) {
762
- return ae(e) && "style" in e;
802
+ function yn(e) {
803
+ return se(e) && "style" in e;
763
804
  }
764
- function hn(e) {
765
- return me(e) && e.nodeName === "IFRAME";
805
+ function bn(e) {
806
+ return pe(e) && e.nodeName === "IFRAME";
766
807
  }
767
- function vn(e) {
768
- return me(e) && e.nodeName === "INPUT";
808
+ function xn(e) {
809
+ return pe(e) && e.nodeName === "INPUT";
769
810
  }
770
- let or = Symbol();
771
- function gn(e, t = !0) {
772
- return Object.assign(e, { [or]: t });
811
+ let sr = Symbol();
812
+ function En(e, t = !0) {
813
+ return Object.assign(e, { [sr]: t });
773
814
  }
774
- function J(...e) {
815
+ function Z(...e) {
775
816
  let t = S(e);
776
817
  L(() => {
777
818
  t.current = e;
@@ -779,43 +820,43 @@ function J(...e) {
779
820
  let r = M((n) => {
780
821
  for (let l of t.current) l != null && (typeof l == "function" ? l(n) : l.current = n);
781
822
  });
782
- return e.every((n) => n == null || (n == null ? void 0 : n[or])) ? void 0 : r;
823
+ return e.every((n) => n == null || (n == null ? void 0 : n[sr])) ? void 0 : r;
783
824
  }
784
- let Lt = z(null);
785
- Lt.displayName = "DescriptionContext";
786
- function ar() {
787
- let e = H(Lt);
825
+ let At = z(null);
826
+ At.displayName = "DescriptionContext";
827
+ function ur() {
828
+ let e = H(At);
788
829
  if (e === null) {
789
830
  let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
790
- throw Error.captureStackTrace && Error.captureStackTrace(t, ar), t;
831
+ throw Error.captureStackTrace && Error.captureStackTrace(t, ur), t;
791
832
  }
792
833
  return e;
793
834
  }
794
- function wn() {
795
- let [e, t] = C([]);
796
- return [e.length > 0 ? e.join(" ") : void 0, N(() => function(r) {
835
+ function $n() {
836
+ let [e, t] = F([]);
837
+ return [e.length > 0 ? e.join(" ") : void 0, D(() => function(r) {
797
838
  let n = M((i) => (t((s) => [...s, i]), () => t((s) => {
798
839
  let a = s.slice(), o = a.indexOf(i);
799
840
  return o !== -1 && a.splice(o, 1), a;
800
- }))), l = N(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]);
801
- return $.createElement(Lt.Provider, { value: l }, r.children);
841
+ }))), l = D(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]);
842
+ return $.createElement(At.Provider, { value: l }, r.children);
802
843
  }, [t])];
803
844
  }
804
- let bn = "p";
805
- function yn(e, t) {
806
- let r = Ie(), n = an(), { id: l = `headlessui-description-${r}`, ...i } = e, s = ar(), a = J(t);
807
- D(() => s.register(l), [l, s.register]);
808
- let o = n || !1, u = N(() => ({ ...s.slot, disabled: o }), [s.slot, o]), p = { ref: a, ...s.props, id: l };
809
- return G()({ ourProps: p, theirProps: i, slot: u, defaultTag: bn, name: s.name || "Description" });
845
+ let On = "p";
846
+ function Sn(e, t) {
847
+ let r = De(), n = cn(), { id: l = `headlessui-description-${r}`, ...i } = e, s = ur(), a = Z(t);
848
+ U(() => s.register(l), [l, s.register]);
849
+ let o = _e({ ...s.slot, disabled: n || !1 }), f = { ref: a, ...s.props, id: l };
850
+ return G()({ ourProps: f, theirProps: i, slot: o, defaultTag: On, name: s.name || "Description" });
810
851
  }
811
- let xn = V(yn), En = Object.assign(xn, {});
812
- var sr = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(sr || {});
813
- let $n = z(() => {
852
+ let Pn = V(Sn), Tn = Object.assign(Pn, {});
853
+ var cr = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(cr || {});
854
+ let Mn = z(() => {
814
855
  });
815
- function On({ value: e, children: t }) {
816
- return $.createElement($n.Provider, { value: e }, t);
856
+ function Ln({ value: e, children: t }) {
857
+ return $.createElement(Mn.Provider, { value: e }, t);
817
858
  }
818
- let ur = class extends Map {
859
+ let dr = class extends Map {
819
860
  constructor(t) {
820
861
  super(), this.factory = t;
821
862
  }
@@ -824,63 +865,68 @@ let ur = class extends Map {
824
865
  return r === void 0 && (r = this.factory(t), this.set(t, r)), r;
825
866
  }
826
867
  };
827
- var Sn = Object.defineProperty, Tn = (e, t, r) => t in e ? Sn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Pn = (e, t, r) => (Tn(e, t + "", r), r), cr = (e, t, r) => {
868
+ var kn = Object.defineProperty, An = (e, t, r) => t in e ? kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Cn = (e, t, r) => (An(e, t + "", r), r), fr = (e, t, r) => {
828
869
  if (!t.has(e)) throw TypeError("Cannot " + r);
829
- }, X = (e, t, r) => (cr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), pt = (e, t, r) => {
870
+ }, X = (e, t, r) => (fr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), gt = (e, t, r) => {
830
871
  if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
831
872
  t instanceof WeakSet ? t.add(e) : t.set(e, r);
832
- }, It = (e, t, r, n) => (cr(e, t, "write to private field"), t.set(e, r), r), Z, Me, Le;
833
- let Mn = class {
873
+ }, _t = (e, t, r, n) => (fr(e, t, "write to private field"), t.set(e, r), r), Y, Le, ke;
874
+ let Fn = class {
834
875
  constructor(t) {
835
- pt(this, Z, {}), pt(this, Me, new ur(() => /* @__PURE__ */ new Set())), pt(this, Le, /* @__PURE__ */ new Set()), Pn(this, "disposables", re()), It(this, Z, t);
876
+ gt(this, Y, {}), gt(this, Le, new dr(() => /* @__PURE__ */ new Set())), gt(this, ke, /* @__PURE__ */ new Set()), Cn(this, "disposables", ne()), _t(this, Y, t), ee.isServer && this.disposables.microTask(() => {
877
+ this.dispose();
878
+ });
836
879
  }
837
880
  dispose() {
838
881
  this.disposables.dispose();
839
882
  }
840
883
  get state() {
841
- return X(this, Z);
884
+ return X(this, Y);
842
885
  }
843
886
  subscribe(t, r) {
844
- let n = { selector: t, callback: r, current: t(X(this, Z)) };
845
- return X(this, Le).add(n), this.disposables.add(() => {
846
- X(this, Le).delete(n);
887
+ if (ee.isServer) return () => {
888
+ };
889
+ let n = { selector: t, callback: r, current: t(X(this, Y)) };
890
+ return X(this, ke).add(n), this.disposables.add(() => {
891
+ X(this, ke).delete(n);
847
892
  });
848
893
  }
849
894
  on(t, r) {
850
- return X(this, Me).get(t).add(r), this.disposables.add(() => {
851
- X(this, Me).get(t).delete(r);
852
- });
895
+ return ee.isServer ? () => {
896
+ } : (X(this, Le).get(t).add(r), this.disposables.add(() => {
897
+ X(this, Le).get(t).delete(r);
898
+ }));
853
899
  }
854
900
  send(t) {
855
- let r = this.reduce(X(this, Z), t);
856
- if (r !== X(this, Z)) {
857
- It(this, Z, r);
858
- for (let n of X(this, Le)) {
859
- let l = n.selector(X(this, Z));
860
- dr(n.current, l) || (n.current = l, n.callback(l));
901
+ let r = this.reduce(X(this, Y), t);
902
+ if (r !== X(this, Y)) {
903
+ _t(this, Y, r);
904
+ for (let n of X(this, ke)) {
905
+ let l = n.selector(X(this, Y));
906
+ mr(n.current, l) || (n.current = l, n.callback(l));
861
907
  }
862
- for (let n of X(this, Me).get(t.type)) n(X(this, Z), t);
908
+ for (let n of X(this, Le).get(t.type)) n(X(this, Y), t);
863
909
  }
864
910
  }
865
911
  };
866
- Z = /* @__PURE__ */ new WeakMap(), Me = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap();
867
- function dr(e, t) {
868
- return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length !== t.length ? !1 : ht(e[Symbol.iterator](), t[Symbol.iterator]()) : e instanceof Map && t instanceof Map || e instanceof Set && t instanceof Set ? e.size !== t.size ? !1 : ht(e.entries(), t.entries()) : Rt(e) && Rt(t) ? ht(Object.entries(e)[Symbol.iterator](), Object.entries(t)[Symbol.iterator]()) : !1;
912
+ Y = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap();
913
+ function mr(e, t) {
914
+ return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length !== t.length ? !1 : wt(e[Symbol.iterator](), t[Symbol.iterator]()) : e instanceof Map && t instanceof Map || e instanceof Set && t instanceof Set ? e.size !== t.size ? !1 : wt(e.entries(), t.entries()) : jt(e) && jt(t) ? wt(Object.entries(e)[Symbol.iterator](), Object.entries(t)[Symbol.iterator]()) : !1;
869
915
  }
870
- function ht(e, t) {
916
+ function wt(e, t) {
871
917
  do {
872
918
  let r = e.next(), n = t.next();
873
919
  if (r.done && n.done) return !0;
874
920
  if (r.done || n.done || !Object.is(r.value, n.value)) return !1;
875
921
  } while (!0);
876
922
  }
877
- function Rt(e) {
923
+ function jt(e) {
878
924
  if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
879
925
  let t = Object.getPrototypeOf(e);
880
926
  return t === null || Object.getPrototypeOf(t) === null;
881
927
  }
882
- var Ln = Object.defineProperty, An = (e, t, r) => t in e ? Ln(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, _t = (e, t, r) => (An(e, typeof t != "symbol" ? t + "" : t, r), r), Cn = ((e) => (e[e.Push = 0] = "Push", e[e.Pop = 1] = "Pop", e))(Cn || {});
883
- let Fn = { 0(e, t) {
928
+ var Nn = Object.defineProperty, In = (e, t, r) => t in e ? Nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Wt = (e, t, r) => (In(e, typeof t != "symbol" ? t + "" : t, r), r), Rn = ((e) => (e[e.Push = 0] = "Push", e[e.Pop = 1] = "Pop", e))(Rn || {});
929
+ let Dn = { 0(e, t) {
884
930
  let r = t.id, n = e.stack, l = e.stack.indexOf(r);
885
931
  if (l !== -1) {
886
932
  let i = e.stack.slice();
@@ -892,19 +938,19 @@ let Fn = { 0(e, t) {
892
938
  if (n === -1) return e;
893
939
  let l = e.stack.slice();
894
940
  return l.splice(n, 1), { ...e, stack: l };
895
- } }, kn = class fr extends Mn {
941
+ } }, _n = class pr extends Fn {
896
942
  constructor() {
897
- super(...arguments), _t(this, "actions", { push: (t) => this.send({ type: 0, id: t }), pop: (t) => this.send({ type: 1, id: t }) }), _t(this, "selectors", { isTop: (t, r) => t.stack[t.stack.length - 1] === r, inStack: (t, r) => t.stack.includes(r) });
943
+ super(...arguments), Wt(this, "actions", { push: (t) => this.send({ type: 0, id: t }), pop: (t) => this.send({ type: 1, id: t }) }), Wt(this, "selectors", { isTop: (t, r) => t.stack[t.stack.length - 1] === r, inStack: (t, r) => t.stack.includes(r) });
898
944
  }
899
945
  static new() {
900
- return new fr({ stack: [] });
946
+ return new pr({ stack: [] });
901
947
  }
902
948
  reduce(t, r) {
903
- return te(r.type, Fn, t, r);
949
+ return re(r.type, Dn, t, r);
904
950
  }
905
951
  };
906
- const mr = new ur(() => kn.new());
907
- var Ve = { exports: {} }, vt = {};
952
+ const hr = new dr(() => _n.new());
953
+ var Be = { exports: {} }, yt = {};
908
954
  /**
909
955
  * @license React
910
956
  * use-sync-external-store-with-selector.production.js
@@ -914,58 +960,58 @@ var Ve = { exports: {} }, vt = {};
914
960
  * This source code is licensed under the MIT license found in the
915
961
  * LICENSE file in the root directory of this source tree.
916
962
  */
917
- var Dt;
918
- function Nn() {
919
- if (Dt) return vt;
920
- Dt = 1;
963
+ var Ut;
964
+ function jn() {
965
+ if (Ut) return yt;
966
+ Ut = 1;
921
967
  var e = $;
922
- function t(o, u) {
923
- return o === u && (o !== 0 || 1 / o === 1 / u) || o !== o && u !== u;
968
+ function t(o, f) {
969
+ return o === f && (o !== 0 || 1 / o === 1 / f) || o !== o && f !== f;
924
970
  }
925
971
  var r = typeof Object.is == "function" ? Object.is : t, n = e.useSyncExternalStore, l = e.useRef, i = e.useEffect, s = e.useMemo, a = e.useDebugValue;
926
- return vt.useSyncExternalStoreWithSelector = function(o, u, p, w, y) {
927
- var g = l(null);
928
- if (g.current === null) {
929
- var f = { hasValue: !1, value: null };
930
- g.current = f;
931
- } else f = g.current;
932
- g = s(
972
+ return yt.useSyncExternalStoreWithSelector = function(o, f, p, g, y) {
973
+ var b = l(null);
974
+ if (b.current === null) {
975
+ var d = { hasValue: !1, value: null };
976
+ b.current = d;
977
+ } else d = b.current;
978
+ b = s(
933
979
  function() {
934
980
  function h(m) {
935
- if (!c) {
936
- if (c = !0, d = m, m = w(m), y !== void 0 && f.hasValue) {
937
- var x = f.value;
981
+ if (!u) {
982
+ if (u = !0, c = m, m = g(m), y !== void 0 && d.hasValue) {
983
+ var x = d.value;
938
984
  if (y(x, m))
939
985
  return v = x;
940
986
  }
941
987
  return v = m;
942
988
  }
943
- if (x = v, r(d, m)) return x;
944
- var O = w(m);
945
- return y !== void 0 && y(x, O) ? (d = m, x) : (d = m, v = O);
989
+ if (x = v, r(c, m)) return x;
990
+ var O = g(m);
991
+ return y !== void 0 && y(x, O) ? (c = m, x) : (c = m, v = O);
946
992
  }
947
- var c = !1, d, v, b = p === void 0 ? null : p;
993
+ var u = !1, c, v, w = p === void 0 ? null : p;
948
994
  return [
949
995
  function() {
950
- return h(u());
996
+ return h(f());
951
997
  },
952
- b === null ? void 0 : function() {
953
- return h(b());
998
+ w === null ? void 0 : function() {
999
+ return h(w());
954
1000
  }
955
1001
  ];
956
1002
  },
957
- [u, p, w, y]
1003
+ [f, p, g, y]
958
1004
  );
959
- var E = n(o, g[0], g[1]);
1005
+ var E = n(o, b[0], b[1]);
960
1006
  return i(
961
1007
  function() {
962
- f.hasValue = !0, f.value = E;
1008
+ d.hasValue = !0, d.value = E;
963
1009
  },
964
1010
  [E]
965
1011
  ), a(E), E;
966
- }, vt;
1012
+ }, yt;
967
1013
  }
968
- var gt = {};
1014
+ var bt = {};
969
1015
  /**
970
1016
  * @license React
971
1017
  * use-sync-external-store-with-selector.development.js
@@ -975,119 +1021,119 @@ var gt = {};
975
1021
  * This source code is licensed under the MIT license found in the
976
1022
  * LICENSE file in the root directory of this source tree.
977
1023
  */
978
- var jt;
979
- function In() {
980
- return jt || (jt = 1, process.env.NODE_ENV !== "production" && function() {
981
- function e(o, u) {
982
- return o === u && (o !== 0 || 1 / o === 1 / u) || o !== o && u !== u;
1024
+ var Ht;
1025
+ function Wn() {
1026
+ return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && (function() {
1027
+ function e(o, f) {
1028
+ return o === f && (o !== 0 || 1 / o === 1 / f) || o !== o && f !== f;
983
1029
  }
984
1030
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
985
1031
  var t = $, r = typeof Object.is == "function" ? Object.is : e, n = t.useSyncExternalStore, l = t.useRef, i = t.useEffect, s = t.useMemo, a = t.useDebugValue;
986
- gt.useSyncExternalStoreWithSelector = function(o, u, p, w, y) {
987
- var g = l(null);
988
- if (g.current === null) {
989
- var f = { hasValue: !1, value: null };
990
- g.current = f;
991
- } else f = g.current;
992
- g = s(
1032
+ bt.useSyncExternalStoreWithSelector = function(o, f, p, g, y) {
1033
+ var b = l(null);
1034
+ if (b.current === null) {
1035
+ var d = { hasValue: !1, value: null };
1036
+ b.current = d;
1037
+ } else d = b.current;
1038
+ b = s(
993
1039
  function() {
994
1040
  function h(m) {
995
- if (!c) {
996
- if (c = !0, d = m, m = w(m), y !== void 0 && f.hasValue) {
997
- var x = f.value;
1041
+ if (!u) {
1042
+ if (u = !0, c = m, m = g(m), y !== void 0 && d.hasValue) {
1043
+ var x = d.value;
998
1044
  if (y(x, m))
999
1045
  return v = x;
1000
1046
  }
1001
1047
  return v = m;
1002
1048
  }
1003
- if (x = v, r(d, m))
1049
+ if (x = v, r(c, m))
1004
1050
  return x;
1005
- var O = w(m);
1006
- return y !== void 0 && y(x, O) ? (d = m, x) : (d = m, v = O);
1051
+ var O = g(m);
1052
+ return y !== void 0 && y(x, O) ? (c = m, x) : (c = m, v = O);
1007
1053
  }
1008
- var c = !1, d, v, b = p === void 0 ? null : p;
1054
+ var u = !1, c, v, w = p === void 0 ? null : p;
1009
1055
  return [
1010
1056
  function() {
1011
- return h(u());
1057
+ return h(f());
1012
1058
  },
1013
- b === null ? void 0 : function() {
1014
- return h(b());
1059
+ w === null ? void 0 : function() {
1060
+ return h(w());
1015
1061
  }
1016
1062
  ];
1017
1063
  },
1018
- [u, p, w, y]
1064
+ [f, p, g, y]
1019
1065
  );
1020
- var E = n(o, g[0], g[1]);
1066
+ var E = n(o, b[0], b[1]);
1021
1067
  return i(
1022
1068
  function() {
1023
- f.hasValue = !0, f.value = E;
1069
+ d.hasValue = !0, d.value = E;
1024
1070
  },
1025
1071
  [E]
1026
1072
  ), a(E), E;
1027
1073
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1028
- }()), gt;
1074
+ })()), bt;
1029
1075
  }
1030
- var Wt;
1031
- function Rn() {
1032
- return Wt || (Wt = 1, process.env.NODE_ENV === "production" ? Ve.exports = Nn() : Ve.exports = In()), Ve.exports;
1076
+ var Vt;
1077
+ function Un() {
1078
+ return Vt || (Vt = 1, process.env.NODE_ENV === "production" ? Be.exports = jn() : Be.exports = Wn()), Be.exports;
1033
1079
  }
1034
- var _n = Rn();
1035
- function pr(e, t, r = dr) {
1036
- return _n.useSyncExternalStoreWithSelector(M((n) => e.subscribe(Dn, n)), M(() => e.state), M(() => e.state), M(t), r);
1080
+ var Hn = Un();
1081
+ function vr(e, t, r = mr) {
1082
+ return Hn.useSyncExternalStoreWithSelector(M((n) => e.subscribe(Vn, n)), M(() => e.state), M(() => e.state), M(t), r);
1037
1083
  }
1038
- function Dn(e) {
1084
+ function Vn(e) {
1039
1085
  return e;
1040
1086
  }
1041
- function Re(e, t) {
1042
- let r = Ie(), n = mr.get(t), [l, i] = pr(n, U((s) => [n.selectors.isTop(s, r), n.selectors.inStack(s, r)], [n, r]));
1043
- return D(() => {
1087
+ function je(e, t) {
1088
+ let r = De(), n = hr.get(t), [l, i] = vr(n, W((s) => [n.selectors.isTop(s, r), n.selectors.inStack(s, r)], [n, r]));
1089
+ return U(() => {
1044
1090
  if (e) return n.actions.push(r), () => n.actions.pop(r);
1045
1091
  }, [n, e, r]), e ? i ? l : !0 : !1;
1046
1092
  }
1047
- let yt = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Map();
1048
- function Ut(e) {
1093
+ let $t = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ new Map();
1094
+ function Bt(e) {
1049
1095
  var t;
1050
- let r = (t = Fe.get(e)) != null ? t : 0;
1051
- return Fe.set(e, r + 1), r !== 0 ? () => Ht(e) : (yt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Ht(e));
1096
+ let r = (t = Ne.get(e)) != null ? t : 0;
1097
+ return Ne.set(e, r + 1), r !== 0 ? () => Xt(e) : ($t.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Xt(e));
1052
1098
  }
1053
- function Ht(e) {
1099
+ function Xt(e) {
1054
1100
  var t;
1055
- let r = (t = Fe.get(e)) != null ? t : 1;
1056
- if (r === 1 ? Fe.delete(e) : Fe.set(e, r - 1), r !== 1) return;
1057
- let n = yt.get(e);
1058
- n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert, yt.delete(e));
1059
- }
1060
- function jn(e, { allowed: t, disallowed: r } = {}) {
1061
- let n = Re(e, "inert-others");
1062
- D(() => {
1101
+ let r = (t = Ne.get(e)) != null ? t : 1;
1102
+ if (r === 1 ? Ne.delete(e) : Ne.set(e, r - 1), r !== 1) return;
1103
+ let n = $t.get(e);
1104
+ n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert, $t.delete(e));
1105
+ }
1106
+ function Bn(e, { allowed: t, disallowed: r } = {}) {
1107
+ let n = je(e, "inert-others");
1108
+ U(() => {
1063
1109
  var l, i;
1064
1110
  if (!n) return;
1065
- let s = re();
1066
- for (let o of (l = r == null ? void 0 : r()) != null ? l : []) o && s.add(Ut(o));
1111
+ let s = ne();
1112
+ for (let o of (l = r == null ? void 0 : r()) != null ? l : []) o && s.add(Bt(o));
1067
1113
  let a = (i = t == null ? void 0 : t()) != null ? i : [];
1068
1114
  for (let o of a) {
1069
1115
  if (!o) continue;
1070
- let u = Qe(o);
1071
- if (!u) continue;
1116
+ let f = et(o);
1117
+ if (!f) continue;
1072
1118
  let p = o.parentElement;
1073
- for (; p && p !== u.body; ) {
1074
- for (let w of p.children) a.some((y) => w.contains(y)) || s.add(Ut(w));
1119
+ for (; p && p !== f.body; ) {
1120
+ for (let g of p.children) a.some((y) => g.contains(y)) || s.add(Bt(g));
1075
1121
  p = p.parentElement;
1076
1122
  }
1077
1123
  }
1078
1124
  return s.dispose;
1079
1125
  }, [n, t, r]);
1080
1126
  }
1081
- function Wn(e, t, r) {
1082
- let n = he((l) => {
1127
+ function Xn(e, t, r) {
1128
+ let n = ve((l) => {
1083
1129
  let i = l.getBoundingClientRect();
1084
1130
  i.x === 0 && i.y === 0 && i.width === 0 && i.height === 0 && r();
1085
1131
  });
1086
1132
  L(() => {
1087
1133
  if (!e) return;
1088
- let l = t === null ? null : me(t) ? t : t.current;
1134
+ let l = t === null ? null : pe(t) ? t : t.current;
1089
1135
  if (!l) return;
1090
- let i = re();
1136
+ let i = ne();
1091
1137
  if (typeof ResizeObserver < "u") {
1092
1138
  let s = new ResizeObserver(() => n.current(l));
1093
1139
  s.observe(l), i.add(() => s.disconnect());
@@ -1099,43 +1145,43 @@ function Wn(e, t, r) {
1099
1145
  return () => i.dispose();
1100
1146
  }, [t, n, e]);
1101
1147
  }
1102
- let Ke = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), Un = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
1103
- var Q = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(Q || {}), xt = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(xt || {}), Hn = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Hn || {});
1104
- function Vn(e = document.body) {
1105
- return e == null ? [] : Array.from(e.querySelectorAll(Ke)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
1148
+ let Ye = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "details>summary", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), zn = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
1149
+ var Q = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(Q || {}), Ot = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(Ot || {}), Gn = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Gn || {});
1150
+ function Kn(e = document.body) {
1151
+ return e == null ? [] : Array.from(e.querySelectorAll(Ye)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
1106
1152
  }
1107
- function Bn(e = document.body) {
1108
- return e == null ? [] : Array.from(e.querySelectorAll(Un)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
1153
+ function qn(e = document.body) {
1154
+ return e == null ? [] : Array.from(e.querySelectorAll(zn)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
1109
1155
  }
1110
- var hr = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(hr || {});
1111
- function Xn(e, t = 0) {
1156
+ var gr = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(gr || {});
1157
+ function Yn(e, t = 0) {
1112
1158
  var r;
1113
- return e === ((r = Qe(e)) == null ? void 0 : r.body) ? !1 : te(t, { 0() {
1114
- return e.matches(Ke);
1159
+ return e === ((r = et(e)) == null ? void 0 : r.body) ? !1 : re(t, { 0() {
1160
+ return e.matches(Ye);
1115
1161
  }, 1() {
1116
1162
  let n = e;
1117
1163
  for (; n !== null; ) {
1118
- if (n.matches(Ke)) return !0;
1164
+ if (n.matches(Ye)) return !0;
1119
1165
  n = n.parentElement;
1120
1166
  }
1121
1167
  return !1;
1122
1168
  } });
1123
1169
  }
1124
- var zn = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(zn || {});
1170
+ var Zn = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(Zn || {});
1125
1171
  typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
1126
1172
  e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
1127
1173
  }, !0), document.addEventListener("click", (e) => {
1128
1174
  e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
1129
1175
  }, !0));
1130
- function ee(e) {
1176
+ function te(e) {
1131
1177
  e == null || e.focus({ preventScroll: !0 });
1132
1178
  }
1133
- let Gn = ["textarea", "input"].join(",");
1134
- function qn(e) {
1179
+ let Jn = ["textarea", "input"].join(",");
1180
+ function Qn(e) {
1135
1181
  var t, r;
1136
- return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Gn)) != null ? r : !1;
1182
+ return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Jn)) != null ? r : !1;
1137
1183
  }
1138
- function Kn(e, t = (r) => r) {
1184
+ function el(e, t = (r) => r) {
1139
1185
  return e.slice().sort((r, n) => {
1140
1186
  let l = t(r), i = t(n);
1141
1187
  if (l === null || i === null) return 0;
@@ -1143,9 +1189,9 @@ function Kn(e, t = (r) => r) {
1143
1189
  return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
1144
1190
  });
1145
1191
  }
1146
- function ke(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] } = {}) {
1147
- let i = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, s = Array.isArray(e) ? r ? Kn(e) : e : t & 64 ? Bn(e) : Vn(e);
1148
- l.length > 0 && s.length > 1 && (s = s.filter((g) => !l.some((f) => f != null && "current" in f ? (f == null ? void 0 : f.current) === g : f === g))), n = n ?? i.activeElement;
1192
+ function Ie(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] } = {}) {
1193
+ let i = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, s = Array.isArray(e) ? r ? el(e) : e : t & 64 ? qn(e) : Kn(e);
1194
+ l.length > 0 && s.length > 1 && (s = s.filter((b) => !l.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === b : d === b))), n = n ?? i.activeElement;
1149
1195
  let a = (() => {
1150
1196
  if (t & 5) return 1;
1151
1197
  if (t & 10) return -1;
@@ -1156,30 +1202,30 @@ function ke(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] }
1156
1202
  if (t & 4) return Math.max(0, s.indexOf(n)) + 1;
1157
1203
  if (t & 8) return s.length - 1;
1158
1204
  throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
1159
- })(), u = t & 32 ? { preventScroll: !0 } : {}, p = 0, w = s.length, y;
1205
+ })(), f = t & 32 ? { preventScroll: !0 } : {}, p = 0, g = s.length, y;
1160
1206
  do {
1161
- if (p >= w || p + w <= 0) return 0;
1162
- let g = o + p;
1163
- if (t & 16) g = (g + w) % w;
1207
+ if (p >= g || p + g <= 0) return 0;
1208
+ let b = o + p;
1209
+ if (t & 16) b = (b + g) % g;
1164
1210
  else {
1165
- if (g < 0) return 3;
1166
- if (g >= w) return 1;
1211
+ if (b < 0) return 3;
1212
+ if (b >= g) return 1;
1167
1213
  }
1168
- y = s[g], y == null || y.focus(u), p += a;
1214
+ y = s[b], y == null || y.focus(f), p += a;
1169
1215
  } while (y !== i.activeElement);
1170
- return t & 6 && qn(y) && y.select(), 2;
1216
+ return t & 6 && Qn(y) && y.select(), 2;
1171
1217
  }
1172
- function vr() {
1218
+ function wr() {
1173
1219
  return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
1174
1220
  }
1175
- function Yn() {
1221
+ function tl() {
1176
1222
  return /Android/gi.test(window.navigator.userAgent);
1177
1223
  }
1178
- function Vt() {
1179
- return vr() || Yn();
1224
+ function zt() {
1225
+ return wr() || tl();
1180
1226
  }
1181
- function Be(e, t, r, n) {
1182
- let l = he(r);
1227
+ function Xe(e, t, r, n) {
1228
+ let l = ve(r);
1183
1229
  L(() => {
1184
1230
  if (!e) return;
1185
1231
  function i(s) {
@@ -1188,8 +1234,8 @@ function Be(e, t, r, n) {
1188
1234
  return document.addEventListener(t, i, n), () => document.removeEventListener(t, i, n);
1189
1235
  }, [e, t, n]);
1190
1236
  }
1191
- function gr(e, t, r, n) {
1192
- let l = he(r);
1237
+ function yr(e, t, r, n) {
1238
+ let l = ve(r);
1193
1239
  L(() => {
1194
1240
  if (!e) return;
1195
1241
  function i(s) {
@@ -1198,39 +1244,39 @@ function gr(e, t, r, n) {
1198
1244
  return window.addEventListener(t, i, n), () => window.removeEventListener(t, i, n);
1199
1245
  }, [e, t, n]);
1200
1246
  }
1201
- const Bt = 30;
1202
- function Zn(e, t, r) {
1203
- let n = he(r), l = U(function(a, o) {
1247
+ const Gt = 30;
1248
+ function rl(e, t, r) {
1249
+ let n = ve(r), l = W(function(a, o) {
1204
1250
  if (a.defaultPrevented) return;
1205
- let u = o(a);
1206
- if (u === null || !u.getRootNode().contains(u) || !u.isConnected) return;
1207
- let p = function w(y) {
1208
- return typeof y == "function" ? w(y()) : Array.isArray(y) || y instanceof Set ? y : [y];
1209
- }(t);
1210
- for (let w of p) if (w !== null && (w.contains(u) || a.composed && a.composedPath().includes(w))) return;
1211
- return !Xn(u, hr.Loose) && u.tabIndex !== -1 && a.preventDefault(), n.current(a, u);
1251
+ let f = o(a);
1252
+ if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
1253
+ let p = (function g(y) {
1254
+ return typeof y == "function" ? g(y()) : Array.isArray(y) || y instanceof Set ? y : [y];
1255
+ })(t);
1256
+ for (let g of p) if (g !== null && (g.contains(f) || a.composed && a.composedPath().includes(g))) return;
1257
+ return !Yn(f, gr.Loose) && f.tabIndex !== -1 && a.preventDefault(), n.current(a, f);
1212
1258
  }, [n, t]), i = S(null);
1213
- Be(e, "pointerdown", (a) => {
1214
- var o, u;
1215
- Vt() || (i.current = ((u = (o = a.composedPath) == null ? void 0 : o.call(a)) == null ? void 0 : u[0]) || a.target);
1216
- }, !0), Be(e, "pointerup", (a) => {
1217
- if (Vt() || !i.current) return;
1259
+ Xe(e, "pointerdown", (a) => {
1260
+ var o, f;
1261
+ zt() || (i.current = ((f = (o = a.composedPath) == null ? void 0 : o.call(a)) == null ? void 0 : f[0]) || a.target);
1262
+ }, !0), Xe(e, "pointerup", (a) => {
1263
+ if (zt() || !i.current) return;
1218
1264
  let o = i.current;
1219
1265
  return i.current = null, l(a, () => o);
1220
1266
  }, !0);
1221
1267
  let s = S({ x: 0, y: 0 });
1222
- Be(e, "touchstart", (a) => {
1268
+ Xe(e, "touchstart", (a) => {
1223
1269
  s.current.x = a.touches[0].clientX, s.current.y = a.touches[0].clientY;
1224
- }, !0), Be(e, "touchend", (a) => {
1270
+ }, !0), Xe(e, "touchend", (a) => {
1225
1271
  let o = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
1226
- if (!(Math.abs(o.x - s.current.x) >= Bt || Math.abs(o.y - s.current.y) >= Bt)) return l(a, () => oe(a.target) ? a.target : null);
1227
- }, !0), gr(e, "blur", (a) => l(a, () => hn(window.document.activeElement) ? window.document.activeElement : null), !0);
1272
+ if (!(Math.abs(o.x - s.current.x) >= Gt || Math.abs(o.y - s.current.y) >= Gt)) return l(a, () => ae(a.target) ? a.target : null);
1273
+ }, !0), yr(e, "blur", (a) => l(a, () => bn(window.document.activeElement) ? window.document.activeElement : null), !0);
1228
1274
  }
1229
- function tt(...e) {
1230
- return N(() => Qe(...e), [...e]);
1275
+ function nt(...e) {
1276
+ return D(() => et(...e), [...e]);
1231
1277
  }
1232
- function wr(e, t, r, n) {
1233
- let l = he(r);
1278
+ function br(e, t, r, n) {
1279
+ let l = ve(r);
1234
1280
  L(() => {
1235
1281
  e = e ?? window;
1236
1282
  function i(s) {
@@ -1239,10 +1285,10 @@ function wr(e, t, r, n) {
1239
1285
  return e.addEventListener(t, i, n), () => e.removeEventListener(t, i, n);
1240
1286
  }, [e, t, n]);
1241
1287
  }
1242
- function Jn(e) {
1243
- return Ur(e.subscribe, e.getSnapshot, e.getSnapshot);
1288
+ function nl(e) {
1289
+ return Vr(e.subscribe, e.getSnapshot, e.getSnapshot);
1244
1290
  }
1245
- function Qn(e, t) {
1291
+ function ll(e, t) {
1246
1292
  let r = e(), n = /* @__PURE__ */ new Set();
1247
1293
  return { getSnapshot() {
1248
1294
  return r;
@@ -1253,7 +1299,7 @@ function Qn(e, t) {
1253
1299
  s && (r = s, n.forEach((a) => a()));
1254
1300
  } };
1255
1301
  }
1256
- function el() {
1302
+ function il() {
1257
1303
  let e;
1258
1304
  return { before({ doc: t }) {
1259
1305
  var r;
@@ -1264,35 +1310,35 @@ function el() {
1264
1310
  r.style(n, "paddingRight", `${i}px`);
1265
1311
  } };
1266
1312
  }
1267
- function tl() {
1268
- return vr() ? { before({ doc: e, d: t, meta: r }) {
1313
+ function ol() {
1314
+ return wr() ? { before({ doc: e, d: t, meta: r }) {
1269
1315
  function n(l) {
1270
1316
  return r.containers.flatMap((i) => i()).some((i) => i.contains(l));
1271
1317
  }
1272
1318
  t.microTask(() => {
1273
1319
  var l;
1274
1320
  if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
1275
- let a = re();
1321
+ let a = ne();
1276
1322
  a.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => a.dispose()));
1277
1323
  }
1278
1324
  let i = (l = window.scrollY) != null ? l : window.pageYOffset, s = null;
1279
1325
  t.addEventListener(e, "click", (a) => {
1280
- if (oe(a.target)) try {
1326
+ if (ae(a.target)) try {
1281
1327
  let o = a.target.closest("a");
1282
1328
  if (!o) return;
1283
- let { hash: u } = new URL(o.href), p = e.querySelector(u);
1284
- oe(p) && !n(p) && (s = p);
1329
+ let { hash: f } = new URL(o.href), p = e.querySelector(f);
1330
+ ae(p) && !n(p) && (s = p);
1285
1331
  } catch {
1286
1332
  }
1287
1333
  }, !0), t.addEventListener(e, "touchstart", (a) => {
1288
- if (oe(a.target) && pn(a.target)) if (n(a.target)) {
1334
+ if (ae(a.target) && yn(a.target)) if (n(a.target)) {
1289
1335
  let o = a.target;
1290
1336
  for (; o.parentElement && n(o.parentElement); ) o = o.parentElement;
1291
1337
  t.style(o, "overscrollBehavior", "contain");
1292
1338
  } else t.style(a.target, "touchAction", "none");
1293
1339
  }), t.addEventListener(e, "touchmove", (a) => {
1294
- if (oe(a.target)) {
1295
- if (vn(a.target)) return;
1340
+ if (ae(a.target)) {
1341
+ if (xn(a.target)) return;
1296
1342
  if (n(a.target)) {
1297
1343
  let o = a.target;
1298
1344
  for (; o.parentElement && o.dataset.headlessuiPortal !== "" && !(o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth); ) o = o.parentElement;
@@ -1307,98 +1353,98 @@ function tl() {
1307
1353
  });
1308
1354
  } } : {};
1309
1355
  }
1310
- function rl() {
1356
+ function al() {
1311
1357
  return { before({ doc: e, d: t }) {
1312
1358
  t.style(e.documentElement, "overflow", "hidden");
1313
1359
  } };
1314
1360
  }
1315
- function nl(e) {
1361
+ function sl(e) {
1316
1362
  let t = {};
1317
1363
  for (let r of e) Object.assign(t, r(t));
1318
1364
  return t;
1319
1365
  }
1320
- let de = Qn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
1366
+ let me = ll(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
1321
1367
  var r;
1322
- let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: re(), meta: /* @__PURE__ */ new Set() };
1368
+ let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: ne(), meta: /* @__PURE__ */ new Set() };
1323
1369
  return n.count++, n.meta.add(t), this.set(e, n), this;
1324
1370
  }, POP(e, t) {
1325
1371
  let r = this.get(e);
1326
1372
  return r && (r.count--, r.meta.delete(t)), this;
1327
1373
  }, SCROLL_PREVENT({ doc: e, d: t, meta: r }) {
1328
- let n = { doc: e, d: t, meta: nl(r) }, l = [tl(), el(), rl()];
1374
+ let n = { doc: e, d: t, meta: sl(r) }, l = [ol(), il(), al()];
1329
1375
  l.forEach(({ before: i }) => i == null ? void 0 : i(n)), l.forEach(({ after: i }) => i == null ? void 0 : i(n));
1330
1376
  }, SCROLL_ALLOW({ d: e }) {
1331
1377
  e.dispose();
1332
1378
  }, TEARDOWN({ doc: e }) {
1333
1379
  this.delete(e);
1334
1380
  } });
1335
- de.subscribe(() => {
1336
- let e = de.getSnapshot(), t = /* @__PURE__ */ new Map();
1381
+ me.subscribe(() => {
1382
+ let e = me.getSnapshot(), t = /* @__PURE__ */ new Map();
1337
1383
  for (let [r] of e) t.set(r, r.documentElement.style.overflow);
1338
1384
  for (let r of e.values()) {
1339
1385
  let n = t.get(r.doc) === "hidden", l = r.count !== 0;
1340
- (l && !n || !l && n) && de.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && de.dispatch("TEARDOWN", r);
1386
+ (l && !n || !l && n) && me.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && me.dispatch("TEARDOWN", r);
1341
1387
  }
1342
1388
  });
1343
- function ll(e, t, r = () => ({ containers: [] })) {
1344
- let n = Jn(de), l = t ? n.get(t) : void 0, i = l ? l.count > 0 : !1;
1345
- return D(() => {
1346
- if (!(!t || !e)) return de.dispatch("PUSH", t, r), () => de.dispatch("POP", t, r);
1389
+ function ul(e, t, r = () => ({ containers: [] })) {
1390
+ let n = nl(me), l = t ? n.get(t) : void 0, i = l ? l.count > 0 : !1;
1391
+ return U(() => {
1392
+ if (!(!t || !e)) return me.dispatch("PUSH", t, r), () => me.dispatch("POP", t, r);
1347
1393
  }, [e, t]), i;
1348
1394
  }
1349
- function il(e, t, r = () => [document.body]) {
1350
- let n = Re(e, "scroll-lock");
1351
- ll(n, t, (l) => {
1395
+ function cl(e, t, r = () => [document.body]) {
1396
+ let n = je(e, "scroll-lock");
1397
+ ul(n, t, (l) => {
1352
1398
  var i;
1353
1399
  return { containers: [...(i = l.containers) != null ? i : [], r] };
1354
1400
  });
1355
1401
  }
1356
- function ol(e = 0) {
1357
- let [t, r] = C(e), n = U((o) => r(o), [t]), l = U((o) => r((u) => u | o), [t]), i = U((o) => (t & o) === o, [t]), s = U((o) => r((u) => u & ~o), [r]), a = U((o) => r((u) => u ^ o), [r]);
1402
+ function dl(e = 0) {
1403
+ let [t, r] = F(e), n = W((o) => r(o), []), l = W((o) => r((f) => f | o), []), i = W((o) => (t & o) === o, [t]), s = W((o) => r((f) => f & ~o), []), a = W((o) => r((f) => f ^ o), []);
1358
1404
  return { flags: t, setFlag: n, addFlag: l, hasFlag: i, removeFlag: s, toggleFlag: a };
1359
1405
  }
1360
- var Xt, zt;
1361
- typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Xt = process == null ? void 0 : process.env) == null ? void 0 : Xt.NODE_ENV) === "test" && typeof ((zt = Element == null ? void 0 : Element.prototype) == null ? void 0 : zt.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
1406
+ var Kt, qt;
1407
+ typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Kt = process == null ? void 0 : process.env) == null ? void 0 : Kt.NODE_ENV) === "test" && typeof ((qt = Element == null ? void 0 : Element.prototype) == null ? void 0 : qt.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
1362
1408
  return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
1363
1409
  `)), [];
1364
1410
  });
1365
- var al = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(al || {});
1366
- function sl(e) {
1411
+ var fl = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(fl || {});
1412
+ function ml(e) {
1367
1413
  let t = {};
1368
1414
  for (let r in e) e[r] === !0 && (t[`data-${r}`] = "");
1369
1415
  return t;
1370
1416
  }
1371
- function ul(e, t, r, n) {
1372
- let [l, i] = C(r), { hasFlag: s, addFlag: a, removeFlag: o } = ol(e && l ? 3 : 0), u = S(!1), p = S(!1), w = Mt();
1373
- return D(() => {
1417
+ function pl(e, t, r, n) {
1418
+ let [l, i] = F(r), { hasFlag: s, addFlag: a, removeFlag: o } = dl(e && l ? 3 : 0), f = S(!1), p = S(!1), g = rt();
1419
+ return U(() => {
1374
1420
  var y;
1375
1421
  if (e) {
1376
1422
  if (r && i(!0), !t) {
1377
1423
  r && a(3);
1378
1424
  return;
1379
1425
  }
1380
- return (y = n == null ? void 0 : n.start) == null || y.call(n, r), cl(t, { inFlight: u, prepare() {
1381
- p.current ? p.current = !1 : p.current = u.current, u.current = !0, !p.current && (r ? (a(3), o(4)) : (a(4), o(2)));
1426
+ return (y = n == null ? void 0 : n.start) == null || y.call(n, r), hl(t, { inFlight: f, prepare() {
1427
+ p.current ? p.current = !1 : p.current = f.current, f.current = !0, !p.current && (r ? (a(3), o(4)) : (a(4), o(2)));
1382
1428
  }, run() {
1383
1429
  p.current ? r ? (o(3), a(4)) : (o(4), a(3)) : r ? o(1) : a(1);
1384
1430
  }, done() {
1385
- var g;
1386
- p.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (u.current = !1, o(7), r || i(!1), (g = n == null ? void 0 : n.end) == null || g.call(n, r));
1431
+ var b;
1432
+ p.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (f.current = !1, o(7), r || i(!1), (b = n == null ? void 0 : n.end) == null || b.call(n, r));
1387
1433
  } });
1388
1434
  }
1389
- }, [e, r, t, w]), e ? [l, { closed: s(1), enter: s(2), leave: s(4), transition: s(2) || s(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
1435
+ }, [e, r, t, g]), e ? [l, { closed: s(1), enter: s(2), leave: s(4), transition: s(2) || s(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
1390
1436
  }
1391
- function cl(e, { prepare: t, run: r, done: n, inFlight: l }) {
1392
- let i = re();
1393
- return fl(e, { prepare: t, inFlight: l }), i.nextFrame(() => {
1437
+ function hl(e, { prepare: t, run: r, done: n, inFlight: l }) {
1438
+ let i = ne();
1439
+ return gl(e, { prepare: t, inFlight: l }), i.nextFrame(() => {
1394
1440
  r(), i.requestAnimationFrame(() => {
1395
- i.add(dl(e, n));
1441
+ i.add(vl(e, n));
1396
1442
  });
1397
1443
  }), i.dispose;
1398
1444
  }
1399
- function dl(e, t) {
1445
+ function vl(e, t) {
1400
1446
  var r, n;
1401
- let l = re();
1447
+ let l = ne();
1402
1448
  if (!e) return l.dispose;
1403
1449
  let i = !1;
1404
1450
  l.add(() => {
@@ -1409,7 +1455,7 @@ function dl(e, t) {
1409
1455
  i || t();
1410
1456
  }), l.dispose);
1411
1457
  }
1412
- function fl(e, { inFlight: t, prepare: r }) {
1458
+ function gl(e, { inFlight: t, prepare: r }) {
1413
1459
  if (t != null && t.current) {
1414
1460
  r();
1415
1461
  return;
@@ -1417,7 +1463,7 @@ function fl(e, { inFlight: t, prepare: r }) {
1417
1463
  let n = e.style.transition;
1418
1464
  e.style.transition = "none", r(), e.offsetHeight, e.style.transition = n;
1419
1465
  }
1420
- function At(e, t) {
1466
+ function Ct(e, t) {
1421
1467
  let r = S([]), n = M(e);
1422
1468
  L(() => {
1423
1469
  let l = [...r.current];
@@ -1427,64 +1473,53 @@ function At(e, t) {
1427
1473
  }
1428
1474
  }, [n, ...t]);
1429
1475
  }
1430
- let rt = z(null);
1431
- rt.displayName = "OpenClosedContext";
1432
- var K = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(K || {});
1433
- function nt() {
1434
- return H(rt);
1476
+ let lt = z(null);
1477
+ lt.displayName = "OpenClosedContext";
1478
+ var q = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(q || {});
1479
+ function it() {
1480
+ return H(lt);
1435
1481
  }
1436
- function ml({ value: e, children: t }) {
1437
- return $.createElement(rt.Provider, { value: e }, t);
1482
+ function wl({ value: e, children: t }) {
1483
+ return $.createElement(lt.Provider, { value: e }, t);
1438
1484
  }
1439
- function pl({ children: e }) {
1440
- return $.createElement(rt.Provider, { value: null }, e);
1485
+ function yl({ children: e }) {
1486
+ return $.createElement(lt.Provider, { value: null }, e);
1441
1487
  }
1442
- function hl(e) {
1488
+ function bl(e) {
1443
1489
  function t() {
1444
1490
  document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
1445
1491
  }
1446
1492
  typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
1447
1493
  }
1448
- let le = [];
1449
- hl(() => {
1494
+ let ie = [];
1495
+ bl(() => {
1450
1496
  function e(t) {
1451
- if (!oe(t.target) || t.target === document.body || le[0] === t.target) return;
1497
+ if (!ae(t.target) || t.target === document.body || ie[0] === t.target) return;
1452
1498
  let r = t.target;
1453
- r = r.closest(Ke), le.unshift(r ?? t.target), le = le.filter((n) => n != null && n.isConnected), le.splice(10);
1499
+ r = r.closest(Ye), ie.unshift(r ?? t.target), ie = ie.filter((n) => n != null && n.isConnected), ie.splice(10);
1454
1500
  }
1455
1501
  window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
1456
1502
  });
1457
- function br(e) {
1503
+ function xr(e) {
1458
1504
  let t = M(e), r = S(!1);
1459
1505
  L(() => (r.current = !1, () => {
1460
- r.current = !0, et(() => {
1506
+ r.current = !0, tt(() => {
1461
1507
  r.current && t();
1462
1508
  });
1463
1509
  }), [t]);
1464
1510
  }
1465
- function vl() {
1466
- let e = typeof document > "u";
1467
- return "useSyncExternalStore" in Ce ? ((t) => t.useSyncExternalStore)(Ce)(() => () => {
1468
- }, () => !1, () => !e) : !1;
1469
- }
1470
- function _e() {
1471
- let e = vl(), [t, r] = Ce.useState(fe.isHandoffComplete);
1472
- return t && fe.isHandoffComplete === !1 && r(!1), Ce.useEffect(() => {
1473
- t !== !0 && r(!0);
1474
- }, [t]), Ce.useEffect(() => fe.handoff(), []), e ? !1 : t;
1475
- }
1476
- let yr = z(!1);
1477
- function gl() {
1478
- return H(yr);
1511
+ let Er = z(!1);
1512
+ function xl() {
1513
+ return H(Er);
1479
1514
  }
1480
- function Gt(e) {
1481
- return $.createElement(yr.Provider, { value: e.force }, e.children);
1515
+ function Yt(e) {
1516
+ return $.createElement(Er.Provider, { value: e.force }, e.children);
1482
1517
  }
1483
- function wl(e) {
1484
- let t = gl(), r = H(Er), [n, l] = C(() => {
1518
+ function El(e) {
1519
+ let t = xl(), r = H(Or), [n, l] = F(() => {
1485
1520
  var i;
1486
1521
  if (!t && r !== null) return (i = r.current) != null ? i : null;
1487
- if (fe.isServer) return null;
1522
+ if (ee.isServer) return null;
1488
1523
  let s = e == null ? void 0 : e.getElementById("headlessui-portal-root");
1489
1524
  if (s) return s;
1490
1525
  if (e === null) return null;
@@ -1497,54 +1532,47 @@ function wl(e) {
1497
1532
  t || r !== null && l(r.current);
1498
1533
  }, [r, l, t]), n;
1499
1534
  }
1500
- let xr = Y, bl = V(function(e, t) {
1501
- let { ownerDocument: r = null, ...n } = e, l = S(null), i = J(gn((g) => {
1502
- l.current = g;
1503
- }), t), s = tt(l), a = r ?? s, o = wl(a), [u] = C(() => {
1504
- var g;
1505
- return fe.isServer ? null : (g = a == null ? void 0 : a.createElement("div")) != null ? g : null;
1506
- }), p = H(Et), w = _e();
1507
- D(() => {
1508
- !o || !u || o.contains(u) || (u.setAttribute("data-headlessui-portal", ""), o.appendChild(u));
1509
- }, [o, u]), D(() => {
1510
- if (u && p) return p.register(u);
1511
- }, [p, u]), br(() => {
1512
- var g;
1513
- !o || !u || (ir(u) && o.contains(u) && o.removeChild(u), o.childNodes.length <= 0 && ((g = o.parentElement) == null || g.removeChild(o)));
1514
- });
1515
- let y = G();
1516
- return w ? !o || !u ? null : zr(y({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: xr, name: "Portal" }), u) : null;
1535
+ let $r = ue, $l = V(function(e, t) {
1536
+ let { ownerDocument: r = null, ...n } = e, l = S(null), i = Z(En((y) => {
1537
+ l.current = y;
1538
+ }), t), s = nt(l), a = r ?? s, o = El(a), f = H(St), p = rt(), g = G();
1539
+ return xr(() => {
1540
+ var y;
1541
+ o && o.childNodes.length <= 0 && ((y = o.parentElement) == null || y.removeChild(o));
1542
+ }), o ? Kr($.createElement("div", { "data-headlessui-portal": "", ref: (y) => {
1543
+ p.dispose(), f && y && p.add(f.register(y));
1544
+ } }, g({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: $r, name: "Portal" })), o) : null;
1517
1545
  });
1518
- function yl(e, t) {
1519
- let r = J(t), { enabled: n = !0, ownerDocument: l, ...i } = e, s = G();
1520
- return n ? $.createElement(bl, { ...i, ownerDocument: l, ref: r }) : s({ ourProps: { ref: r }, theirProps: i, slot: {}, defaultTag: xr, name: "Portal" });
1521
- }
1522
- let xl = Y, Er = z(null);
1523
- function El(e, t) {
1524
- let { target: r, ...n } = e, l = { ref: J(t) }, i = G();
1525
- return $.createElement(Er.Provider, { value: r }, i({ ourProps: l, theirProps: n, defaultTag: xl, name: "Popover.Group" }));
1526
- }
1527
- let Et = z(null);
1528
- function $l() {
1529
- let e = H(Et), t = S([]), r = M((i) => (t.current.push(i), e && e.register(i), () => n(i))), n = M((i) => {
1546
+ function Ol(e, t) {
1547
+ let r = Z(t), { enabled: n = !0, ownerDocument: l, ...i } = e, s = G();
1548
+ return n ? $.createElement($l, { ...i, ownerDocument: l, ref: r }) : s({ ourProps: { ref: r }, theirProps: i, slot: {}, defaultTag: $r, name: "Portal" });
1549
+ }
1550
+ let Sl = ue, Or = z(null);
1551
+ function Pl(e, t) {
1552
+ let { target: r, ...n } = e, l = { ref: Z(t) }, i = G();
1553
+ return $.createElement(Or.Provider, { value: r }, i({ ourProps: l, theirProps: n, defaultTag: Sl, name: "Popover.Group" }));
1554
+ }
1555
+ let St = z(null);
1556
+ function Tl() {
1557
+ let e = H(St), t = S([]), r = M((i) => (t.current.push(i), e && e.register(i), () => n(i))), n = M((i) => {
1530
1558
  let s = t.current.indexOf(i);
1531
1559
  s !== -1 && t.current.splice(s, 1), e && e.unregister(i);
1532
- }), l = N(() => ({ register: r, unregister: n, portals: t }), [r, n, t]);
1533
- return [t, N(() => function({ children: i }) {
1534
- return $.createElement(Et.Provider, { value: l }, i);
1560
+ }), l = D(() => ({ register: r, unregister: n, portals: t }), [r, n, t]);
1561
+ return [t, D(() => function({ children: i }) {
1562
+ return $.createElement(St.Provider, { value: l }, i);
1535
1563
  }, [l])];
1536
1564
  }
1537
- let Ol = V(yl), $r = V(El), Sl = Object.assign(Ol, { Group: $r });
1538
- function Tl(e, t = typeof document < "u" ? document.defaultView : null, r) {
1539
- let n = Re(e, "escape");
1540
- wr(t, "keydown", (l) => {
1541
- n && (l.defaultPrevented || l.key === sr.Escape && r(l));
1565
+ let Ml = V(Ol), Sr = V(Pl), Ll = Object.assign(Ml, { Group: Sr });
1566
+ function kl(e, t = typeof document < "u" ? document.defaultView : null, r) {
1567
+ let n = je(e, "escape");
1568
+ br(t, "keydown", (l) => {
1569
+ n && (l.defaultPrevented || l.key === cr.Escape && r(l));
1542
1570
  });
1543
1571
  }
1544
- function Pl() {
1572
+ function Al() {
1545
1573
  var e;
1546
- let [t] = C(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = C((e = t == null ? void 0 : t.matches) != null ? e : !1);
1547
- return D(() => {
1574
+ let [t] = F(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = F((e = t == null ? void 0 : t.matches) != null ? e : !1);
1575
+ return U(() => {
1548
1576
  if (!t) return;
1549
1577
  function l(i) {
1550
1578
  n(i.matches);
@@ -1552,363 +1580,374 @@ function Pl() {
1552
1580
  return t.addEventListener("change", l), () => t.removeEventListener("change", l);
1553
1581
  }, [t]), r;
1554
1582
  }
1555
- function Ml({ defaultContainers: e = [], portals: t, mainTreeNode: r } = {}) {
1556
- let n = tt(r), l = M(() => {
1583
+ function Cl({ defaultContainers: e = [], portals: t, mainTreeNode: r } = {}) {
1584
+ let n = nt(r), l = M(() => {
1557
1585
  var i, s;
1558
1586
  let a = [];
1559
- for (let o of e) o !== null && (ae(o) ? a.push(o) : "current" in o && ae(o.current) && a.push(o.current));
1587
+ for (let o of e) o !== null && (se(o) ? a.push(o) : "current" in o && se(o.current) && a.push(o.current));
1560
1588
  if (t != null && t.current) for (let o of t.current) a.push(o);
1561
- for (let o of (i = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? i : []) o !== document.body && o !== document.head && ae(o) && o.id !== "headlessui-portal-root" && (r && (o.contains(r) || o.contains((s = r == null ? void 0 : r.getRootNode()) == null ? void 0 : s.host)) || a.some((u) => o.contains(u)) || a.push(o));
1589
+ for (let o of (i = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? i : []) o !== document.body && o !== document.head && se(o) && o.id !== "headlessui-portal-root" && (r && (o.contains(r) || o.contains((s = r == null ? void 0 : r.getRootNode()) == null ? void 0 : s.host)) || a.some((f) => o.contains(f)) || a.push(o));
1562
1590
  return a;
1563
1591
  });
1564
1592
  return { resolveContainers: l, contains: M((i) => l().some((s) => s.contains(i))) };
1565
1593
  }
1566
- let Or = z(null);
1567
- function qt({ children: e, node: t }) {
1568
- let [r, n] = C(null), l = Sr(t ?? r);
1569
- return $.createElement(Or.Provider, { value: l }, e, l === null && $.createElement(bt, { features: qe.Hidden, ref: (i) => {
1594
+ let Pr = z(null);
1595
+ function Zt({ children: e, node: t }) {
1596
+ let [r, n] = F(null), l = Tr(t ?? r);
1597
+ return $.createElement(Pr.Provider, { value: l }, e, l === null && $.createElement(Et, { features: qe.Hidden, ref: (i) => {
1570
1598
  var s, a;
1571
1599
  if (i) {
1572
- for (let o of (a = (s = Qe(i)) == null ? void 0 : s.querySelectorAll("html > *, body > *")) != null ? a : []) if (o !== document.body && o !== document.head && ae(o) && o != null && o.contains(i)) {
1600
+ for (let o of (a = (s = et(i)) == null ? void 0 : s.querySelectorAll("html > *, body > *")) != null ? a : []) if (o !== document.body && o !== document.head && se(o) && o != null && o.contains(i)) {
1573
1601
  n(o);
1574
1602
  break;
1575
1603
  }
1576
1604
  }
1577
1605
  } }));
1578
1606
  }
1579
- function Sr(e = null) {
1607
+ function Tr(e = null) {
1580
1608
  var t;
1581
- return (t = H(Or)) != null ? t : e;
1609
+ return (t = H(Pr)) != null ? t : e;
1582
1610
  }
1583
- function Ct() {
1611
+ function Fl() {
1612
+ let e = typeof document > "u";
1613
+ return "useSyncExternalStore" in Ce ? ((t) => t.useSyncExternalStore)(Ce)(() => () => {
1614
+ }, () => !1, () => !e) : !1;
1615
+ }
1616
+ function ot() {
1617
+ let e = Fl(), [t, r] = Ce.useState(ee.isHandoffComplete);
1618
+ return t && ee.isHandoffComplete === !1 && r(!1), Ce.useEffect(() => {
1619
+ t !== !0 && r(!0);
1620
+ }, [t]), Ce.useEffect(() => ee.handoff(), []), e ? !1 : t;
1621
+ }
1622
+ function Ft() {
1584
1623
  let e = S(!1);
1585
- return D(() => (e.current = !0, () => {
1624
+ return U(() => (e.current = !0, () => {
1586
1625
  e.current = !1;
1587
1626
  }), []), e;
1588
1627
  }
1589
1628
  var Ae = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ae || {});
1590
- function Ll() {
1629
+ function Nl() {
1591
1630
  let e = S(0);
1592
- return gr(!0, "keydown", (t) => {
1631
+ return yr(!0, "keydown", (t) => {
1593
1632
  t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
1594
1633
  }, !0), e;
1595
1634
  }
1596
- function Tr(e) {
1635
+ function Mr(e) {
1597
1636
  if (!e) return /* @__PURE__ */ new Set();
1598
1637
  if (typeof e == "function") return new Set(e());
1599
1638
  let t = /* @__PURE__ */ new Set();
1600
- for (let r of e.current) ae(r.current) && t.add(r.current);
1639
+ for (let r of e.current) se(r.current) && t.add(r.current);
1601
1640
  return t;
1602
1641
  }
1603
- let Al = "div";
1604
- var ce = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))(ce || {});
1605
- function Cl(e, t) {
1606
- let r = S(null), n = J(r, t), { initialFocus: l, initialFocusFallback: i, containers: s, features: a = 15, ...o } = e;
1607
- _e() || (a = 0);
1608
- let u = tt(r);
1609
- Il(a, { ownerDocument: u });
1610
- let p = Rl(a, { ownerDocument: u, container: r, initialFocus: l, initialFocusFallback: i });
1611
- _l(a, { ownerDocument: u, container: r, containers: s, previousActiveElement: p });
1612
- let w = Ll(), y = M((d) => {
1613
- if (!me(r.current)) return;
1642
+ let Il = "div";
1643
+ var fe = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))(fe || {});
1644
+ function Rl(e, t) {
1645
+ let r = S(null), n = Z(r, t), { initialFocus: l, initialFocusFallback: i, containers: s, features: a = 15, ...o } = e;
1646
+ ot() || (a = 0);
1647
+ let f = nt(r);
1648
+ Wl(a, { ownerDocument: f });
1649
+ let p = Ul(a, { ownerDocument: f, container: r, initialFocus: l, initialFocusFallback: i });
1650
+ Hl(a, { ownerDocument: f, container: r, containers: s, previousActiveElement: p });
1651
+ let g = Nl(), y = M((c) => {
1652
+ if (!pe(r.current)) return;
1614
1653
  let v = r.current;
1615
- ((b) => b())(() => {
1616
- te(w.current, { [Ae.Forwards]: () => {
1617
- ke(v, Q.First, { skipElements: [d.relatedTarget, i] });
1654
+ ((w) => w())(() => {
1655
+ re(g.current, { [Ae.Forwards]: () => {
1656
+ Ie(v, Q.First, { skipElements: [c.relatedTarget, i] });
1618
1657
  }, [Ae.Backwards]: () => {
1619
- ke(v, Q.Last, { skipElements: [d.relatedTarget, i] });
1658
+ Ie(v, Q.Last, { skipElements: [c.relatedTarget, i] });
1620
1659
  } });
1621
1660
  });
1622
- }), g = Re(!!(a & 2), "focus-trap#tab-lock"), f = Mt(), E = S(!1), h = { ref: n, onKeyDown(d) {
1623
- d.key == "Tab" && (E.current = !0, f.requestAnimationFrame(() => {
1661
+ }), b = je(!!(a & 2), "focus-trap#tab-lock"), d = rt(), E = S(!1), h = { ref: n, onKeyDown(c) {
1662
+ c.key == "Tab" && (E.current = !0, d.requestAnimationFrame(() => {
1624
1663
  E.current = !1;
1625
1664
  }));
1626
- }, onBlur(d) {
1665
+ }, onBlur(c) {
1627
1666
  if (!(a & 4)) return;
1628
- let v = Tr(s);
1629
- me(r.current) && v.add(r.current);
1630
- let b = d.relatedTarget;
1631
- oe(b) && b.dataset.headlessuiFocusGuard !== "true" && (Pr(v, b) || (E.current ? ke(r.current, te(w.current, { [Ae.Forwards]: () => Q.Next, [Ae.Backwards]: () => Q.Previous }) | Q.WrapAround, { relativeTo: d.target }) : oe(d.target) && ee(d.target)));
1632
- } }, c = G();
1633
- return $.createElement($.Fragment, null, g && $.createElement(bt, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: qe.Focusable }), c({ ourProps: h, theirProps: o, defaultTag: Al, name: "FocusTrap" }), g && $.createElement(bt, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: qe.Focusable }));
1634
- }
1635
- let Fl = V(Cl), kl = Object.assign(Fl, { features: ce });
1636
- function Nl(e = !0) {
1637
- let t = S(le.slice());
1638
- return At(([r], [n]) => {
1639
- n === !0 && r === !1 && et(() => {
1667
+ let v = Mr(s);
1668
+ pe(r.current) && v.add(r.current);
1669
+ let w = c.relatedTarget;
1670
+ ae(w) && w.dataset.headlessuiFocusGuard !== "true" && (Lr(v, w) || (E.current ? Ie(r.current, re(g.current, { [Ae.Forwards]: () => Q.Next, [Ae.Backwards]: () => Q.Previous }) | Q.WrapAround, { relativeTo: c.target }) : ae(c.target) && te(c.target)));
1671
+ } }, u = G();
1672
+ return $.createElement($.Fragment, null, b && $.createElement(Et, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: qe.Focusable }), u({ ourProps: h, theirProps: o, defaultTag: Il, name: "FocusTrap" }), b && $.createElement(Et, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: qe.Focusable }));
1673
+ }
1674
+ let Dl = V(Rl), _l = Object.assign(Dl, { features: fe });
1675
+ function jl(e = !0) {
1676
+ let t = S(ie.slice());
1677
+ return Ct(([r], [n]) => {
1678
+ n === !0 && r === !1 && tt(() => {
1640
1679
  t.current.splice(0);
1641
- }), n === !1 && r === !0 && (t.current = le.slice());
1642
- }, [e, le, t]), M(() => {
1680
+ }), n === !1 && r === !0 && (t.current = ie.slice());
1681
+ }, [e, ie, t]), M(() => {
1643
1682
  var r;
1644
1683
  return (r = t.current.find((n) => n != null && n.isConnected)) != null ? r : null;
1645
1684
  });
1646
1685
  }
1647
- function Il(e, { ownerDocument: t }) {
1648
- let r = !!(e & 8), n = Nl(r);
1649
- At(() => {
1650
- r || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && ee(n());
1651
- }, [r]), br(() => {
1652
- r && ee(n());
1686
+ function Wl(e, { ownerDocument: t }) {
1687
+ let r = !!(e & 8), n = jl(r);
1688
+ Ct(() => {
1689
+ r || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && te(n());
1690
+ }, [r]), xr(() => {
1691
+ r && te(n());
1653
1692
  });
1654
1693
  }
1655
- function Rl(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFallback: l }) {
1656
- let i = S(null), s = Re(!!(e & 1), "focus-trap#initial-focus"), a = Ct();
1657
- return At(() => {
1694
+ function Ul(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFallback: l }) {
1695
+ let i = S(null), s = je(!!(e & 1), "focus-trap#initial-focus"), a = Ft();
1696
+ return Ct(() => {
1658
1697
  if (e === 0) return;
1659
1698
  if (!s) {
1660
- l != null && l.current && ee(l.current);
1699
+ l != null && l.current && te(l.current);
1661
1700
  return;
1662
1701
  }
1663
1702
  let o = r.current;
1664
- o && et(() => {
1703
+ o && tt(() => {
1665
1704
  if (!a.current) return;
1666
- let u = t == null ? void 0 : t.activeElement;
1705
+ let f = t == null ? void 0 : t.activeElement;
1667
1706
  if (n != null && n.current) {
1668
- if ((n == null ? void 0 : n.current) === u) {
1669
- i.current = u;
1707
+ if ((n == null ? void 0 : n.current) === f) {
1708
+ i.current = f;
1670
1709
  return;
1671
1710
  }
1672
- } else if (o.contains(u)) {
1673
- i.current = u;
1711
+ } else if (o.contains(f)) {
1712
+ i.current = f;
1674
1713
  return;
1675
1714
  }
1676
- if (n != null && n.current) ee(n.current);
1715
+ if (n != null && n.current) te(n.current);
1677
1716
  else {
1678
1717
  if (e & 16) {
1679
- if (ke(o, Q.First | Q.AutoFocus) !== xt.Error) return;
1680
- } else if (ke(o, Q.First) !== xt.Error) return;
1681
- if (l != null && l.current && (ee(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
1718
+ if (Ie(o, Q.First | Q.AutoFocus) !== Ot.Error) return;
1719
+ } else if (Ie(o, Q.First) !== Ot.Error) return;
1720
+ if (l != null && l.current && (te(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
1682
1721
  console.warn("There are no focusable elements inside the <FocusTrap />");
1683
1722
  }
1684
1723
  i.current = t == null ? void 0 : t.activeElement;
1685
1724
  });
1686
1725
  }, [l, s, e]), i;
1687
1726
  }
1688
- function _l(e, { ownerDocument: t, container: r, containers: n, previousActiveElement: l }) {
1689
- let i = Ct(), s = !!(e & 4);
1690
- wr(t == null ? void 0 : t.defaultView, "focus", (a) => {
1727
+ function Hl(e, { ownerDocument: t, container: r, containers: n, previousActiveElement: l }) {
1728
+ let i = Ft(), s = !!(e & 4);
1729
+ br(t == null ? void 0 : t.defaultView, "focus", (a) => {
1691
1730
  if (!s || !i.current) return;
1692
- let o = Tr(n);
1693
- me(r.current) && o.add(r.current);
1694
- let u = l.current;
1695
- if (!u) return;
1731
+ let o = Mr(n);
1732
+ pe(r.current) && o.add(r.current);
1733
+ let f = l.current;
1734
+ if (!f) return;
1696
1735
  let p = a.target;
1697
- me(p) ? Pr(o, p) ? (l.current = p, ee(p)) : (a.preventDefault(), a.stopPropagation(), ee(u)) : ee(l.current);
1736
+ pe(p) ? Lr(o, p) ? (l.current = p, te(p)) : (a.preventDefault(), a.stopPropagation(), te(f)) : te(l.current);
1698
1737
  }, !0);
1699
1738
  }
1700
- function Pr(e, t) {
1739
+ function Lr(e, t) {
1701
1740
  for (let r of e) if (r.contains(t)) return !0;
1702
1741
  return !1;
1703
1742
  }
1704
- function Mr(e) {
1743
+ function kr(e) {
1705
1744
  var t;
1706
- return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : Ar) !== Y || $.Children.count(e.children) === 1;
1745
+ return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || !Fe((t = e.as) != null ? t : Cr) || $.Children.count(e.children) === 1;
1707
1746
  }
1708
- let lt = z(null);
1709
- lt.displayName = "TransitionContext";
1710
- var Dl = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Dl || {});
1711
- function jl() {
1712
- let e = H(lt);
1747
+ let at = z(null);
1748
+ at.displayName = "TransitionContext";
1749
+ var Vl = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Vl || {});
1750
+ function Bl() {
1751
+ let e = H(at);
1713
1752
  if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
1714
1753
  return e;
1715
1754
  }
1716
- function Wl() {
1717
- let e = H(it);
1755
+ function Xl() {
1756
+ let e = H(st);
1718
1757
  if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
1719
1758
  return e;
1720
1759
  }
1721
- let it = z(null);
1722
- it.displayName = "NestingContext";
1723
- function ot(e) {
1724
- return "children" in e ? ot(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
1760
+ let st = z(null);
1761
+ st.displayName = "NestingContext";
1762
+ function ut(e) {
1763
+ return "children" in e ? ut(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
1725
1764
  }
1726
- function Lr(e, t) {
1727
- let r = he(e), n = S([]), l = Ct(), i = Mt(), s = M((g, f = ie.Hidden) => {
1728
- let E = n.current.findIndex(({ el: h }) => h === g);
1729
- E !== -1 && (te(f, { [ie.Unmount]() {
1765
+ function Ar(e, t) {
1766
+ let r = ve(e), n = S([]), l = Ft(), i = rt(), s = M((b, d = oe.Hidden) => {
1767
+ let E = n.current.findIndex(({ el: h }) => h === b);
1768
+ E !== -1 && (re(d, { [oe.Unmount]() {
1730
1769
  n.current.splice(E, 1);
1731
- }, [ie.Hidden]() {
1770
+ }, [oe.Hidden]() {
1732
1771
  n.current[E].state = "hidden";
1733
1772
  } }), i.microTask(() => {
1734
1773
  var h;
1735
- !ot(n) && l.current && ((h = r.current) == null || h.call(r));
1774
+ !ut(n) && l.current && ((h = r.current) == null || h.call(r));
1736
1775
  }));
1737
- }), a = M((g) => {
1738
- let f = n.current.find(({ el: E }) => E === g);
1739
- return f ? f.state !== "visible" && (f.state = "visible") : n.current.push({ el: g, state: "visible" }), () => s(g, ie.Unmount);
1740
- }), o = S([]), u = S(Promise.resolve()), p = S({ enter: [], leave: [] }), w = M((g, f, E) => {
1741
- o.current.splice(0), t && (t.chains.current[f] = t.chains.current[f].filter(([h]) => h !== g)), t == null || t.chains.current[f].push([g, new Promise((h) => {
1776
+ }), a = M((b) => {
1777
+ let d = n.current.find(({ el: E }) => E === b);
1778
+ return d ? d.state !== "visible" && (d.state = "visible") : n.current.push({ el: b, state: "visible" }), () => s(b, oe.Unmount);
1779
+ }), o = S([]), f = S(Promise.resolve()), p = S({ enter: [], leave: [] }), g = M((b, d, E) => {
1780
+ o.current.splice(0), t && (t.chains.current[d] = t.chains.current[d].filter(([h]) => h !== b)), t == null || t.chains.current[d].push([b, new Promise((h) => {
1742
1781
  o.current.push(h);
1743
- })]), t == null || t.chains.current[f].push([g, new Promise((h) => {
1744
- Promise.all(p.current[f].map(([c, d]) => d)).then(() => h());
1745
- })]), f === "enter" ? u.current = u.current.then(() => t == null ? void 0 : t.wait.current).then(() => E(f)) : E(f);
1746
- }), y = M((g, f, E) => {
1747
- Promise.all(p.current[f].splice(0).map(([h, c]) => c)).then(() => {
1782
+ })]), t == null || t.chains.current[d].push([b, new Promise((h) => {
1783
+ Promise.all(p.current[d].map(([u, c]) => c)).then(() => h());
1784
+ })]), d === "enter" ? f.current = f.current.then(() => t == null ? void 0 : t.wait.current).then(() => E(d)) : E(d);
1785
+ }), y = M((b, d, E) => {
1786
+ Promise.all(p.current[d].splice(0).map(([h, u]) => u)).then(() => {
1748
1787
  var h;
1749
1788
  (h = o.current.shift()) == null || h();
1750
- }).then(() => E(f));
1789
+ }).then(() => E(d));
1751
1790
  });
1752
- return N(() => ({ children: n, register: a, unregister: s, onStart: w, onStop: y, wait: u, chains: p }), [a, s, n, w, y, p, u]);
1791
+ return D(() => ({ children: n, register: a, unregister: s, onStart: g, onStop: y, wait: f, chains: p }), [a, s, n, g, y, p, f]);
1753
1792
  }
1754
- let Ar = Y, Cr = Ge.RenderStrategy;
1755
- function Ul(e, t) {
1793
+ let Cr = ue, Fr = Ke.RenderStrategy;
1794
+ function zl(e, t) {
1756
1795
  var r, n;
1757
- let { transition: l = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: o, enter: u, enterFrom: p, enterTo: w, entered: y, leave: g, leaveFrom: f, leaveTo: E, ...h } = e, [c, d] = C(null), v = S(null), b = Mr(e), m = J(...b ? [v, t, d] : t === null ? [] : [t]), x = (r = h.unmount) == null || r ? ie.Unmount : ie.Hidden, { show: O, appear: I, initial: j } = jl(), [F, R] = C(O ? "visible" : "hidden"), B = Wl(), { register: _, unregister: A } = B;
1758
- D(() => _(v), [_, v]), D(() => {
1759
- if (x === ie.Hidden && v.current) {
1760
- if (O && F !== "visible") {
1761
- R("visible");
1796
+ let { transition: l = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: o, enter: f, enterFrom: p, enterTo: g, entered: y, leave: b, leaveFrom: d, leaveTo: E, ...h } = e, [u, c] = F(null), v = S(null), w = kr(e), m = Z(...w ? [v, t, c] : t === null ? [] : [t]), x = (r = h.unmount) == null || r ? oe.Unmount : oe.Hidden, { show: O, appear: N, initial: _ } = Bl(), [C, I] = F(O ? "visible" : "hidden"), B = Xl(), { register: R, unregister: k } = B;
1797
+ U(() => R(v), [R, v]), U(() => {
1798
+ if (x === oe.Hidden && v.current) {
1799
+ if (O && C !== "visible") {
1800
+ I("visible");
1762
1801
  return;
1763
1802
  }
1764
- return te(F, { hidden: () => A(v), visible: () => _(v) });
1803
+ return re(C, { hidden: () => k(v), visible: () => R(v) });
1765
1804
  }
1766
- }, [F, v, _, A, O, x]);
1767
- let W = _e();
1768
- D(() => {
1769
- if (b && W && F === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1770
- }, [v, F, W, b]);
1771
- let ve = j && !I, se = I && O && j, k = S(!1), ge = Lr(() => {
1772
- k.current || (R("hidden"), A(v));
1773
- }, B), De = M((ut) => {
1774
- k.current = !0;
1775
- let We = ut ? "enter" : "leave";
1776
- ge.onStart(v, We, (Oe) => {
1777
- Oe === "enter" ? i == null || i() : Oe === "leave" && (a == null || a());
1805
+ }, [C, v, R, k, O, x]);
1806
+ let j = ot();
1807
+ U(() => {
1808
+ if (w && j && C === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1809
+ }, [v, C, j, w]);
1810
+ let ge = _ && !N, ce = N && O && _, J = S(!1), A = Ar(() => {
1811
+ J.current || (I("hidden"), k(v));
1812
+ }, B), $e = M((ft) => {
1813
+ J.current = !0;
1814
+ let Ue = ft ? "enter" : "leave";
1815
+ A.onStart(v, Ue, (Se) => {
1816
+ Se === "enter" ? i == null || i() : Se === "leave" && (a == null || a());
1778
1817
  });
1779
- }), ne = M((ut) => {
1780
- let We = ut ? "enter" : "leave";
1781
- k.current = !1, ge.onStop(v, We, (Oe) => {
1782
- Oe === "enter" ? s == null || s() : Oe === "leave" && (o == null || o());
1783
- }), We === "leave" && !ot(ge) && (R("hidden"), A(v));
1818
+ }), le = M((ft) => {
1819
+ let Ue = ft ? "enter" : "leave";
1820
+ J.current = !1, A.onStop(v, Ue, (Se) => {
1821
+ Se === "enter" ? s == null || s() : Se === "leave" && (o == null || o());
1822
+ }), Ue === "leave" && !ut(A) && (I("hidden"), k(v));
1784
1823
  });
1785
1824
  L(() => {
1786
- b && l || (De(O), ne(O));
1787
- }, [O, b, l]);
1788
- let st = !(!l || !b || !W || ve), [, T] = ul(st, c, O, { start: De, end: ne }), je = ue({ ref: m, className: ((n = wt(h.className, se && u, se && p, T.enter && u, T.enter && T.closed && p, T.enter && !T.closed && w, T.leave && g, T.leave && !T.closed && f, T.leave && T.closed && E, !T.transition && O && y)) == null ? void 0 : n.trim()) || void 0, ...sl(T) }), $e = 0;
1789
- F === "visible" && ($e |= K.Open), F === "hidden" && ($e |= K.Closed), O && F === "hidden" && ($e |= K.Opening), !O && F === "visible" && ($e |= K.Closing);
1790
- let Ir = G();
1791
- return $.createElement(it.Provider, { value: ge }, $.createElement(ml, { value: $e }, Ir({ ourProps: je, theirProps: h, defaultTag: Ar, features: Cr, visible: F === "visible", name: "Transition.Child" })));
1792
- }
1793
- function Hl(e, t) {
1794
- let { show: r, appear: n = !1, unmount: l = !0, ...i } = e, s = S(null), a = Mr(e), o = J(...a ? [s, t] : t === null ? [] : [t]);
1795
- _e();
1796
- let u = nt();
1797
- if (r === void 0 && u !== null && (r = (u & K.Open) === K.Open), r === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
1798
- let [p, w] = C(r ? "visible" : "hidden"), y = Lr(() => {
1799
- r || w("hidden");
1800
- }), [g, f] = C(!0), E = S([r]);
1801
- D(() => {
1802
- g !== !1 && E.current[E.current.length - 1] !== r && (E.current.push(r), f(!1));
1825
+ w && l || ($e(O), le(O));
1826
+ }, [O, w, l]);
1827
+ let dt = !(!l || !w || !j || ge), [, P] = pl(dt, u, O, { start: $e, end: le }), We = de({ ref: m, className: ((n = xt(h.className, ce && f, ce && p, P.enter && f, P.enter && P.closed && p, P.enter && !P.closed && g, P.leave && b, P.leave && !P.closed && d, P.leave && P.closed && E, !P.transition && O && y)) == null ? void 0 : n.trim()) || void 0, ...ml(P) }), Oe = 0;
1828
+ C === "visible" && (Oe |= q.Open), C === "hidden" && (Oe |= q.Closed), O && C === "hidden" && (Oe |= q.Opening), !O && C === "visible" && (Oe |= q.Closing);
1829
+ let Dr = G();
1830
+ return $.createElement(st.Provider, { value: A }, $.createElement(wl, { value: Oe }, Dr({ ourProps: We, theirProps: h, defaultTag: Cr, features: Fr, visible: C === "visible", name: "Transition.Child" })));
1831
+ }
1832
+ function Gl(e, t) {
1833
+ let { show: r, appear: n = !1, unmount: l = !0, ...i } = e, s = S(null), a = kr(e), o = Z(...a ? [s, t] : t === null ? [] : [t]);
1834
+ ot();
1835
+ let f = it();
1836
+ if (r === void 0 && f !== null && (r = (f & q.Open) === q.Open), r === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
1837
+ let [p, g] = F(r ? "visible" : "hidden"), y = Ar(() => {
1838
+ r || g("hidden");
1839
+ }), [b, d] = F(!0), E = S([r]);
1840
+ U(() => {
1841
+ b !== !1 && E.current[E.current.length - 1] !== r && (E.current.push(r), d(!1));
1803
1842
  }, [E, r]);
1804
- let h = N(() => ({ show: r, appear: n, initial: g }), [r, n, g]);
1805
- D(() => {
1806
- r ? w("visible") : !ot(y) && s.current !== null && w("hidden");
1843
+ let h = D(() => ({ show: r, appear: n, initial: b }), [r, n, b]);
1844
+ U(() => {
1845
+ r ? g("visible") : !ut(y) && s.current !== null && g("hidden");
1807
1846
  }, [r, y]);
1808
- let c = { unmount: l }, d = M(() => {
1847
+ let u = { unmount: l }, c = M(() => {
1809
1848
  var m;
1810
- g && f(!1), (m = e.beforeEnter) == null || m.call(e);
1849
+ b && d(!1), (m = e.beforeEnter) == null || m.call(e);
1811
1850
  }), v = M(() => {
1812
1851
  var m;
1813
- g && f(!1), (m = e.beforeLeave) == null || m.call(e);
1814
- }), b = G();
1815
- return $.createElement(it.Provider, { value: y }, $.createElement(lt.Provider, { value: h }, b({ ourProps: { ...c, as: Y, children: $.createElement(Fr, { ref: o, ...c, ...i, beforeEnter: d, beforeLeave: v }) }, theirProps: {}, defaultTag: Y, features: Cr, visible: p === "visible", name: "Transition" })));
1852
+ b && d(!1), (m = e.beforeLeave) == null || m.call(e);
1853
+ }), w = G();
1854
+ return $.createElement(st.Provider, { value: y }, $.createElement(at.Provider, { value: h }, w({ ourProps: { ...u, as: ue, children: $.createElement(Nr, { ref: o, ...u, ...i, beforeEnter: c, beforeLeave: v }) }, theirProps: {}, defaultTag: ue, features: Fr, visible: p === "visible", name: "Transition" })));
1816
1855
  }
1817
- function Vl(e, t) {
1818
- let r = H(lt) !== null, n = nt() !== null;
1819
- return $.createElement($.Fragment, null, !r && n ? $.createElement($t, { ref: t, ...e }) : $.createElement(Fr, { ref: t, ...e }));
1856
+ function Kl(e, t) {
1857
+ let r = H(at) !== null, n = it() !== null;
1858
+ return $.createElement($.Fragment, null, !r && n ? $.createElement(Pt, { ref: t, ...e }) : $.createElement(Nr, { ref: t, ...e }));
1820
1859
  }
1821
- let $t = V(Hl), Fr = V(Ul), Ee = V(Vl), kr = Object.assign($t, { Child: Ee, Root: $t });
1822
- var Bl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Bl || {}), Xl = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(Xl || {});
1823
- let zl = { 0(e, t) {
1860
+ let Pt = V(Gl), Nr = V(zl), Ee = V(Kl), Ir = Object.assign(Pt, { Child: Ee, Root: Pt });
1861
+ var ql = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(ql || {}), Yl = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(Yl || {});
1862
+ let Zl = { 0(e, t) {
1824
1863
  return e.titleId === t.id ? e : { ...e, titleId: t.id };
1825
- } }, Ft = z(null);
1826
- Ft.displayName = "DialogContext";
1827
- function at(e) {
1828
- let t = H(Ft);
1864
+ } }, Nt = z(null);
1865
+ Nt.displayName = "DialogContext";
1866
+ function ct(e) {
1867
+ let t = H(Nt);
1829
1868
  if (t === null) {
1830
1869
  let r = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
1831
- throw Error.captureStackTrace && Error.captureStackTrace(r, at), r;
1870
+ throw Error.captureStackTrace && Error.captureStackTrace(r, ct), r;
1832
1871
  }
1833
1872
  return t;
1834
1873
  }
1835
- function Gl(e, t) {
1836
- return te(t.type, zl, e, t);
1874
+ function Jl(e, t) {
1875
+ return re(t.type, Zl, e, t);
1837
1876
  }
1838
- let Kt = V(function(e, t) {
1839
- let r = Ie(), { id: n = `headlessui-dialog-${r}`, open: l, onClose: i, initialFocus: s, role: a = "dialog", autoFocus: o = !0, __demoMode: u = !1, unmount: p = !1, ...w } = e, y = S(!1);
1840
- a = function() {
1877
+ let Jt = V(function(e, t) {
1878
+ let r = De(), { id: n = `headlessui-dialog-${r}`, open: l, onClose: i, initialFocus: s, role: a = "dialog", autoFocus: o = !0, __demoMode: f = !1, unmount: p = !1, ...g } = e, y = S(!1);
1879
+ a = (function() {
1841
1880
  return a === "dialog" || a === "alertdialog" ? a : (y.current || (y.current = !0, console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
1842
- }();
1843
- let g = nt();
1844
- l === void 0 && g !== null && (l = (g & K.Open) === K.Open);
1845
- let f = S(null), E = J(f, t), h = tt(f), c = l ? 0 : 1, [d, v] = Hr(Gl, { titleId: null, descriptionId: null, panelRef: Vr() }), b = M(() => i(!1)), m = M((T) => v({ type: 0, id: T })), x = _e() ? c === 0 : !1, [O, I] = $l(), j = { get current() {
1846
- var T;
1847
- return (T = d.panelRef.current) != null ? T : f.current;
1848
- } }, F = Sr(), { resolveContainers: R } = Ml({ mainTreeNode: F, portals: O, defaultContainers: [j] }), B = g !== null ? (g & K.Closing) === K.Closing : !1;
1849
- jn(u || B ? !1 : x, { allowed: M(() => {
1850
- var T, je;
1851
- return [(je = (T = f.current) == null ? void 0 : T.closest("[data-headlessui-portal]")) != null ? je : null];
1881
+ })();
1882
+ let b = it();
1883
+ l === void 0 && b !== null && (l = (b & q.Open) === q.Open);
1884
+ let d = S(null), E = Z(d, t), h = nt(d), u = l ? 0 : 1, [c, v] = Br(Jl, { titleId: null, descriptionId: null, panelRef: Xr() }), w = M(() => i(!1)), m = M((P) => v({ type: 0, id: P })), x = ot() ? u === 0 : !1, [O, N] = Tl(), _ = { get current() {
1885
+ var P;
1886
+ return (P = c.panelRef.current) != null ? P : d.current;
1887
+ } }, C = Tr(), { resolveContainers: I } = Cl({ mainTreeNode: C, portals: O, defaultContainers: [_] }), B = b !== null ? (b & q.Closing) === q.Closing : !1;
1888
+ Bn(f || B ? !1 : x, { allowed: M(() => {
1889
+ var P, We;
1890
+ return [(We = (P = d.current) == null ? void 0 : P.closest("[data-headlessui-portal]")) != null ? We : null];
1852
1891
  }), disallowed: M(() => {
1853
- var T;
1854
- return [(T = F == null ? void 0 : F.closest("body > *:not(#headlessui-portal-root)")) != null ? T : null];
1892
+ var P;
1893
+ return [(P = C == null ? void 0 : C.closest("body > *:not(#headlessui-portal-root)")) != null ? P : null];
1855
1894
  }) });
1856
- let _ = mr.get(null);
1857
- D(() => {
1858
- if (x) return _.actions.push(n), () => _.actions.pop(n);
1859
- }, [_, n, x]);
1860
- let A = pr(_, U((T) => _.selectors.isTop(T, n), [_, n]));
1861
- Zn(A, R, (T) => {
1862
- T.preventDefault(), b();
1863
- }), Tl(A, h == null ? void 0 : h.defaultView, (T) => {
1864
- T.preventDefault(), T.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), b();
1865
- }), il(u || B ? !1 : x, h, R), Wn(x, f, b);
1866
- let [W, ve] = wn(), se = N(() => [{ dialogState: c, close: b, setTitleId: m, unmount: p }, d], [c, d, b, m, p]), k = N(() => ({ open: c === 0 }), [c]), ge = { ref: E, id: n, role: a, tabIndex: -1, "aria-modal": u ? void 0 : c === 0 ? !0 : void 0, "aria-labelledby": d.titleId, "aria-describedby": W, unmount: p }, De = !Pl(), ne = ce.None;
1867
- x && !u && (ne |= ce.RestoreFocus, ne |= ce.TabLock, o && (ne |= ce.AutoFocus), De && (ne |= ce.InitialFocus));
1868
- let st = G();
1869
- return $.createElement(pl, null, $.createElement(Gt, { force: !0 }, $.createElement(Sl, null, $.createElement(Ft.Provider, { value: se }, $.createElement($r, { target: f }, $.createElement(Gt, { force: !1 }, $.createElement(ve, { slot: k }, $.createElement(I, null, $.createElement(kl, { initialFocus: s, initialFocusFallback: f, containers: R, features: ne }, $.createElement(On, { value: b }, st({ ourProps: ge, theirProps: w, slot: k, defaultTag: ql, features: Kl, visible: c === 0, name: "Dialog" })))))))))));
1870
- }), ql = "div", Kl = Ge.RenderStrategy | Ge.Static;
1871
- function Yl(e, t) {
1872
- let { transition: r = !1, open: n, ...l } = e, i = nt(), s = e.hasOwnProperty("open") || i !== null, a = e.hasOwnProperty("onClose");
1895
+ let R = hr.get(null);
1896
+ U(() => {
1897
+ if (x) return R.actions.push(n), () => R.actions.pop(n);
1898
+ }, [R, n, x]);
1899
+ let k = vr(R, W((P) => R.selectors.isTop(P, n), [R, n]));
1900
+ rl(k, I, (P) => {
1901
+ P.preventDefault(), w();
1902
+ }), kl(k, h == null ? void 0 : h.defaultView, (P) => {
1903
+ P.preventDefault(), P.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), w();
1904
+ }), cl(f || B ? !1 : x, h, I), Xn(x, d, w);
1905
+ let [j, ge] = $n(), ce = D(() => [{ dialogState: u, close: w, setTitleId: m, unmount: p }, c], [u, w, m, p, c]), J = _e({ open: u === 0 }), A = { ref: E, id: n, role: a, tabIndex: -1, "aria-modal": f ? void 0 : u === 0 ? !0 : void 0, "aria-labelledby": c.titleId, "aria-describedby": j, unmount: p }, $e = !Al(), le = fe.None;
1906
+ x && !f && (le |= fe.RestoreFocus, le |= fe.TabLock, o && (le |= fe.AutoFocus), $e && (le |= fe.InitialFocus));
1907
+ let dt = G();
1908
+ return $.createElement(yl, null, $.createElement(Yt, { force: !0 }, $.createElement(Ll, null, $.createElement(Nt.Provider, { value: ce }, $.createElement(Sr, { target: d }, $.createElement(Yt, { force: !1 }, $.createElement(ge, { slot: J }, $.createElement(N, null, $.createElement(_l, { initialFocus: s, initialFocusFallback: d, containers: I, features: le }, $.createElement(Ln, { value: w }, dt({ ourProps: A, theirProps: g, slot: J, defaultTag: Ql, features: ei, visible: u === 0, name: "Dialog" })))))))))));
1909
+ }), Ql = "div", ei = Ke.RenderStrategy | Ke.Static;
1910
+ function ti(e, t) {
1911
+ let { transition: r = !1, open: n, ...l } = e, i = it(), s = e.hasOwnProperty("open") || i !== null, a = e.hasOwnProperty("onClose");
1873
1912
  if (!s && !a) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
1874
1913
  if (!s) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
1875
1914
  if (!a) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
1876
1915
  if (!i && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
1877
1916
  if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);
1878
- return (n !== void 0 || r) && !l.static ? $.createElement(qt, null, $.createElement(kr, { show: n, transition: r, unmount: l.unmount }, $.createElement(Kt, { ref: t, ...l }))) : $.createElement(qt, null, $.createElement(Kt, { ref: t, open: n, ...l }));
1917
+ return (n !== void 0 || r) && !l.static ? $.createElement(Zt, null, $.createElement(Ir, { show: n, transition: r, unmount: l.unmount }, $.createElement(Jt, { ref: t, ...l }))) : $.createElement(Zt, null, $.createElement(Jt, { ref: t, open: n, ...l }));
1879
1918
  }
1880
- let Zl = "div";
1881
- function Jl(e, t) {
1882
- let r = Ie(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...i } = e, [{ dialogState: s, unmount: a }, o] = at("Dialog.Panel"), u = J(t, o.panelRef), p = N(() => ({ open: s === 0 }), [s]), w = M((h) => {
1919
+ let ri = "div";
1920
+ function ni(e, t) {
1921
+ let r = De(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...i } = e, [{ dialogState: s, unmount: a }, o] = ct("Dialog.Panel"), f = Z(t, o.panelRef), p = _e({ open: s === 0 }), g = M((h) => {
1883
1922
  h.stopPropagation();
1884
- }), y = { ref: u, id: n, onClick: w }, g = l ? Ee : Y, f = l ? { unmount: a } : {}, E = G();
1885
- return $.createElement(g, { ...f }, E({ ourProps: y, theirProps: i, slot: p, defaultTag: Zl, name: "Dialog.Panel" }));
1923
+ }), y = { ref: f, id: n, onClick: g }, b = l ? Ee : ue, d = l ? { unmount: a } : {}, E = G();
1924
+ return $.createElement(b, { ...d }, E({ ourProps: y, theirProps: i, slot: p, defaultTag: ri, name: "Dialog.Panel" }));
1886
1925
  }
1887
- let Ql = "div";
1888
- function ei(e, t) {
1889
- let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: i }] = at("Dialog.Backdrop"), s = N(() => ({ open: l === 0 }), [l]), a = { ref: t, "aria-hidden": !0 }, o = r ? Ee : Y, u = r ? { unmount: i } : {}, p = G();
1890
- return $.createElement(o, { ...u }, p({ ourProps: a, theirProps: n, slot: s, defaultTag: Ql, name: "Dialog.Backdrop" }));
1926
+ let li = "div";
1927
+ function ii(e, t) {
1928
+ let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: i }] = ct("Dialog.Backdrop"), s = _e({ open: l === 0 }), a = { ref: t, "aria-hidden": !0 }, o = r ? Ee : ue, f = r ? { unmount: i } : {}, p = G();
1929
+ return $.createElement(o, { ...f }, p({ ourProps: a, theirProps: n, slot: s, defaultTag: li, name: "Dialog.Backdrop" }));
1891
1930
  }
1892
- let ti = "h2";
1893
- function ri(e, t) {
1894
- let r = Ie(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState: i, setTitleId: s }] = at("Dialog.Title"), a = J(t);
1931
+ let oi = "h2";
1932
+ function ai(e, t) {
1933
+ let r = De(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState: i, setTitleId: s }] = ct("Dialog.Title"), a = Z(t);
1895
1934
  L(() => (s(n), () => s(null)), [n, s]);
1896
- let o = N(() => ({ open: i === 0 }), [i]), u = { ref: a, id: n };
1897
- return G()({ ourProps: u, theirProps: l, slot: o, defaultTag: ti, name: "Dialog.Title" });
1898
- }
1899
- let ni = V(Yl), kt = V(Jl);
1900
- V(ei);
1901
- let li = V(ri), ii = Object.assign(ni, { Panel: kt, Title: li, Description: En });
1902
- function Nr({ onClick: e }) {
1903
- return /* @__PURE__ */ pe(
1935
+ let o = _e({ open: i === 0 }), f = { ref: a, id: n };
1936
+ return G()({ ourProps: f, theirProps: l, slot: o, defaultTag: oi, name: "Dialog.Title" });
1937
+ }
1938
+ let si = V(ti), It = V(ni);
1939
+ V(ii);
1940
+ let ui = V(ai), ci = Object.assign(si, { Panel: It, Title: ui, Description: Tn });
1941
+ function Rr({ onClick: e }) {
1942
+ return /* @__PURE__ */ he(
1904
1943
  "button",
1905
1944
  {
1906
1945
  type: "button",
1907
1946
  className: "im-close-button text-gray-400 hover:text-gray-500",
1908
1947
  onClick: e,
1909
1948
  children: [
1910
- /* @__PURE__ */ P("span", { className: "sr-only", children: "Close" }),
1911
- /* @__PURE__ */ P(
1949
+ /* @__PURE__ */ T("span", { className: "sr-only", children: "Close" }),
1950
+ /* @__PURE__ */ T(
1912
1951
  "svg",
1913
1952
  {
1914
1953
  className: "size-6",
@@ -1918,7 +1957,7 @@ function Nr({ onClick: e }) {
1918
1957
  strokeWidth: "2",
1919
1958
  stroke: "currentColor",
1920
1959
  "aria-hidden": "true",
1921
- children: /* @__PURE__ */ P(
1960
+ children: /* @__PURE__ */ T(
1922
1961
  "path",
1923
1962
  {
1924
1963
  strokeLinecap: "round",
@@ -1932,17 +1971,17 @@ function Nr({ onClick: e }) {
1932
1971
  }
1933
1972
  );
1934
1973
  }
1935
- const oi = ({ modalContext: e, config: t, children: r }) => {
1936
- const [n, l] = C(!1);
1937
- return /* @__PURE__ */ P("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ P(
1974
+ const di = ({ modalContext: e, config: t, children: r }) => {
1975
+ const [n, l] = F(!1);
1976
+ return /* @__PURE__ */ T("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ T(
1938
1977
  "div",
1939
1978
  {
1940
- className: ze("im-modal-positioner flex min-h-full justify-center", {
1979
+ className: Ge("im-modal-positioner flex min-h-full justify-center", {
1941
1980
  "items-start": t.position === "top",
1942
1981
  "items-center": t.position === "center",
1943
1982
  "items-end": t.position === "bottom"
1944
1983
  }),
1945
- children: /* @__PURE__ */ P(
1984
+ children: /* @__PURE__ */ T(
1946
1985
  Ee,
1947
1986
  {
1948
1987
  as: "div",
@@ -1952,7 +1991,7 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
1952
1991
  leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
1953
1992
  afterEnter: () => l(!0),
1954
1993
  afterLeave: e.afterLeave,
1955
- className: ze("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
1994
+ className: Ge("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
1956
1995
  "sm:max-w-sm": t.maxWidth === "sm",
1957
1996
  "sm:max-w-md": t.maxWidth === "md",
1958
1997
  "sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
@@ -1964,13 +2003,13 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
1964
2003
  "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
1965
2004
  "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
1966
2005
  }),
1967
- children: /* @__PURE__ */ pe(
1968
- kt,
2006
+ children: /* @__PURE__ */ he(
2007
+ It,
1969
2008
  {
1970
2009
  className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
1971
2010
  "data-inertiaui-modal-entered": n,
1972
2011
  children: [
1973
- t.closeButton && /* @__PURE__ */ P("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ P(Nr, { onClick: e.close }) }),
2012
+ t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(Rr, { onClick: e.close }) }),
1974
2013
  typeof r == "function" ? r({ modalContext: e, config: t }) : r
1975
2014
  ]
1976
2015
  }
@@ -1979,16 +2018,16 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
1979
2018
  )
1980
2019
  }
1981
2020
  ) });
1982
- }, ai = ({ modalContext: e, config: t, children: r }) => {
1983
- const [n, l] = C(!1);
1984
- return /* @__PURE__ */ P("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ P(
2021
+ }, fi = ({ modalContext: e, config: t, children: r }) => {
2022
+ const [n, l] = F(!1);
2023
+ return /* @__PURE__ */ T("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ T(
1985
2024
  "div",
1986
2025
  {
1987
- className: ze("im-slideover-positioner flex min-h-full items-center", {
2026
+ className: Ge("im-slideover-positioner flex min-h-full items-center", {
1988
2027
  "justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
1989
2028
  "justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
1990
2029
  }),
1991
- children: /* @__PURE__ */ P(
2030
+ children: /* @__PURE__ */ T(
1992
2031
  Ee,
1993
2032
  {
1994
2033
  as: "div",
@@ -1998,7 +2037,7 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
1998
2037
  leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
1999
2038
  afterEnter: () => l(!0),
2000
2039
  afterLeave: e.afterLeave,
2001
- className: ze("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
2040
+ className: Ge("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
2002
2041
  "sm:max-w-sm": t.maxWidth === "sm",
2003
2042
  "sm:max-w-md": t.maxWidth === "md",
2004
2043
  "sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
@@ -2010,13 +2049,13 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
2010
2049
  "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
2011
2050
  "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
2012
2051
  }),
2013
- children: /* @__PURE__ */ pe(
2014
- kt,
2052
+ children: /* @__PURE__ */ he(
2053
+ It,
2015
2054
  {
2016
2055
  className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
2017
2056
  "data-inertiaui-modal-entered": n,
2018
2057
  children: [
2019
- t.closeButton && /* @__PURE__ */ P("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ P(Nr, { onClick: e.close }) }),
2058
+ t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(Rr, { onClick: e.close }) }),
2020
2059
  typeof r == "function" ? r({ modalContext: e, config: t }) : r
2021
2060
  ]
2022
2061
  }
@@ -2025,10 +2064,10 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
2025
2064
  )
2026
2065
  }
2027
2066
  ) });
2028
- }, si = Ot(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, onAfterLeave: s = null, ...a }, o) => {
2029
- const u = (w) => typeof t == "function" ? t(w) : t, p = S(null);
2030
- return Yt(o, () => p.current, [p]), /* @__PURE__ */ P(
2031
- rr,
2067
+ }, mi = Tt(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, onAfterLeave: s = null, ...a }, o) => {
2068
+ const f = (g) => typeof t == "function" ? t(g) : t, p = S(null);
2069
+ return Qt(o, () => p.current, [p]), /* @__PURE__ */ T(
2070
+ ir,
2032
2071
  {
2033
2072
  ref: p,
2034
2073
  name: e,
@@ -2038,36 +2077,36 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
2038
2077
  onSuccess: i,
2039
2078
  ...a,
2040
2079
  children: ({
2041
- afterLeave: w,
2080
+ afterLeave: g,
2042
2081
  close: y,
2043
- config: g,
2044
- emit: f,
2082
+ config: b,
2083
+ emit: d,
2045
2084
  getChildModal: E,
2046
2085
  getParentModal: h,
2047
- id: c,
2048
- index: d,
2086
+ id: u,
2087
+ index: c,
2049
2088
  isOpen: v,
2050
- modalContext: b,
2089
+ modalContext: w,
2051
2090
  onTopOfStack: m,
2052
2091
  reload: x,
2053
2092
  setOpen: O,
2054
- shouldRender: I
2055
- }) => /* @__PURE__ */ P(
2056
- kr,
2093
+ shouldRender: N
2094
+ }) => /* @__PURE__ */ T(
2095
+ Ir,
2057
2096
  {
2058
2097
  appear: !0,
2059
2098
  show: v ?? !1,
2060
2099
  afterLeave: s,
2061
- children: /* @__PURE__ */ pe(
2062
- ii,
2100
+ children: /* @__PURE__ */ he(
2101
+ ci,
2063
2102
  {
2064
2103
  as: "div",
2065
2104
  className: "im-dialog relative z-20",
2066
- onClose: () => g.closeExplicitly ? null : y(),
2067
- "data-inertiaui-modal-id": c,
2068
- "data-inertiaui-modal-index": d,
2105
+ onClose: () => b.closeExplicitly ? null : y(),
2106
+ "data-inertiaui-modal-id": u,
2107
+ "data-inertiaui-modal-index": c,
2069
2108
  children: [
2070
- d === 0 ? /* @__PURE__ */ P(
2109
+ c === 0 ? /* @__PURE__ */ T(
2071
2110
  Ee,
2072
2111
  {
2073
2112
  enter: "transition transform ease-in-out duration-300",
@@ -2076,58 +2115,58 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
2076
2115
  leave: "transition transform ease-in-out duration-300",
2077
2116
  leaveFrom: "opacity-100",
2078
2117
  leaveTo: "opacity-0",
2079
- children: m ? /* @__PURE__ */ P(
2118
+ children: m ? /* @__PURE__ */ T(
2080
2119
  "div",
2081
2120
  {
2082
2121
  className: "im-backdrop fixed inset-0 z-30 bg-black/75",
2083
2122
  "aria-hidden": "true"
2084
2123
  }
2085
- ) : /* @__PURE__ */ P("div", {})
2124
+ ) : /* @__PURE__ */ T("div", {})
2086
2125
  }
2087
2126
  ) : null,
2088
- d > 0 && m ? /* @__PURE__ */ P("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
2089
- g.slideover ? /* @__PURE__ */ P(
2090
- ai,
2127
+ c > 0 && m ? /* @__PURE__ */ T("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
2128
+ b.slideover ? /* @__PURE__ */ T(
2129
+ fi,
2091
2130
  {
2092
- modalContext: b,
2093
- config: g,
2094
- children: u({
2095
- afterLeave: w,
2131
+ modalContext: w,
2132
+ config: b,
2133
+ children: f({
2134
+ afterLeave: g,
2096
2135
  close: y,
2097
- config: g,
2098
- emit: f,
2136
+ config: b,
2137
+ emit: d,
2099
2138
  getChildModal: E,
2100
2139
  getParentModal: h,
2101
- id: c,
2102
- index: d,
2140
+ id: u,
2141
+ index: c,
2103
2142
  isOpen: v,
2104
- modalContext: b,
2143
+ modalContext: w,
2105
2144
  onTopOfStack: m,
2106
2145
  reload: x,
2107
2146
  setOpen: O,
2108
- shouldRender: I
2147
+ shouldRender: N
2109
2148
  })
2110
2149
  }
2111
- ) : /* @__PURE__ */ P(
2112
- oi,
2150
+ ) : /* @__PURE__ */ T(
2151
+ di,
2113
2152
  {
2114
- modalContext: b,
2115
- config: g,
2116
- children: u({
2117
- afterLeave: w,
2153
+ modalContext: w,
2154
+ config: b,
2155
+ children: f({
2156
+ afterLeave: g,
2118
2157
  close: y,
2119
- config: g,
2120
- emit: f,
2158
+ config: b,
2159
+ emit: d,
2121
2160
  getChildModal: E,
2122
2161
  getParentModal: h,
2123
- id: c,
2124
- index: d,
2162
+ id: u,
2163
+ index: c,
2125
2164
  isOpen: v,
2126
- modalContext: b,
2165
+ modalContext: w,
2127
2166
  onTopOfStack: m,
2128
2167
  reload: x,
2129
2168
  setOpen: O,
2130
- shouldRender: I
2169
+ shouldRender: N
2131
2170
  })
2132
2171
  }
2133
2172
  )
@@ -2139,8 +2178,8 @@ const oi = ({ modalContext: e, config: t, children: r }) => {
2139
2178
  }
2140
2179
  );
2141
2180
  });
2142
- si.displayName = "Modal";
2143
- const $i = ({
2181
+ mi.displayName = "Modal";
2182
+ const Mi = ({
2144
2183
  href: e,
2145
2184
  method: t = "get",
2146
2185
  data: r = {},
@@ -2150,58 +2189,58 @@ const $i = ({
2150
2189
  onAfterLeave: s = null,
2151
2190
  onBlur: a = null,
2152
2191
  onClose: o = null,
2153
- onError: u = null,
2192
+ onError: f = null,
2154
2193
  onFocus: p = null,
2155
- onStart: w = null,
2194
+ onStart: g = null,
2156
2195
  onSuccess: y = null,
2157
- navigate: g = null,
2158
- children: f,
2196
+ navigate: b = null,
2197
+ children: d,
2159
2198
  ...E
2160
2199
  }) => {
2161
- const [h, c] = C(!1), [d, v] = C(null), { stack: b, visit: m } = Je(), x = N(() => g ?? Tt("navigate"), [g]), O = {}, I = {};
2162
- Object.keys(E).forEach((A) => {
2163
- Nt.includes(A) || (A.startsWith("on") && typeof E[A] == "function" ? A.toLowerCase() in window ? O[A] = E[A] : I[A] = E[A] : O[A] = E[A]);
2200
+ const [h, u] = F(!1), [c, v] = F(null), { stack: w, visit: m } = Qe(), x = D(() => b ?? Lt("navigate"), [b]), O = {}, N = {};
2201
+ Object.keys(E).forEach((k) => {
2202
+ Dt.includes(k) || (k.startsWith("on") && typeof E[k] == "function" ? en(k) ? O[k] = E[k] : N[k] = E[k] : O[k] = E[k]);
2164
2203
  });
2165
- const [j, F] = C(!1);
2204
+ const [_, C] = F(!1);
2166
2205
  L(() => {
2167
- d && (d.onTopOfStack && j ? p == null || p() : !d.onTopOfStack && !j && (a == null || a()), F(!d.onTopOfStack));
2168
- }, [b]);
2169
- const R = U(() => {
2206
+ c && (c.onTopOfStack && _ ? p == null || p() : !c.onTopOfStack && !_ && (a == null || a()), C(!c.onTopOfStack));
2207
+ }, [w]);
2208
+ const I = W(() => {
2170
2209
  o == null || o();
2171
- }, [o]), B = U(() => {
2210
+ }, [o]), B = W(() => {
2172
2211
  v(null), s == null || s();
2173
- }, [s]), _ = U(
2174
- (A) => {
2175
- A == null || A.preventDefault(), !h && (e.startsWith("#") || (c(!0), w == null || w()), m(
2212
+ }, [s]), R = W(
2213
+ (k) => {
2214
+ k == null || k.preventDefault(), !h && (e.startsWith("#") || (u(!0), g == null || g()), m(
2176
2215
  e,
2177
2216
  t,
2178
2217
  r,
2179
2218
  l,
2180
- Zr(Yr(E, Nt)),
2181
- () => R(b.length),
2219
+ Qr(Jr(E, Dt)),
2220
+ () => I(w.length),
2182
2221
  B,
2183
2222
  i,
2184
2223
  x
2185
- ).then((W) => {
2186
- v(W), W.registerEventListenersFromProps(I), y == null || y();
2187
- }).catch((W) => {
2188
- console.error(W), u == null || u(W);
2189
- }).finally(() => c(!1)));
2224
+ ).then((j) => {
2225
+ v(j), j.registerEventListenersFromProps(N), y == null || y();
2226
+ }).catch((j) => {
2227
+ console.error(j), f == null || f(j);
2228
+ }).finally(() => u(!1)));
2190
2229
  },
2191
- [e, t, r, l, i, E, R, B]
2230
+ [e, t, r, l, i, E, I, B]
2192
2231
  );
2193
- return /* @__PURE__ */ P(
2232
+ return /* @__PURE__ */ T(
2194
2233
  n,
2195
2234
  {
2196
2235
  ...O,
2197
2236
  href: e,
2198
- onClick: _,
2199
- children: typeof f == "function" ? f({ loading: h }) : f
2237
+ onClick: R,
2238
+ children: typeof d == "function" ? d({ loading: h }) : d
2200
2239
  }
2201
2240
  );
2202
- }, ui = ({ children: e, data: t, params: r, buffer: n, as: l, always: i, fallback: s }) => {
2241
+ }, pi = ({ children: e, data: t, params: r, buffer: n, as: l, always: i, fallback: s }) => {
2203
2242
  i = i ?? !1, l = l ?? "div", s = s ?? null;
2204
- const [a, o] = C(!1), u = S(!1), p = S(!1), w = S(null), y = tr(), g = U(() => {
2243
+ const [a, o] = F(!1), f = S(!1), p = S(!1), g = S(null), y = lr(), b = W(() => {
2205
2244
  if (t)
2206
2245
  return {
2207
2246
  only: Array.isArray(t) ? t : [t]
@@ -2211,23 +2250,23 @@ const $i = ({
2211
2250
  return r;
2212
2251
  }, [r, t]);
2213
2252
  return L(() => {
2214
- if (!w.current)
2253
+ if (!g.current)
2215
2254
  return;
2216
- const f = new IntersectionObserver(
2255
+ const d = new IntersectionObserver(
2217
2256
  (E) => {
2218
- if (!E[0].isIntersecting || (!i && u.current && f.disconnect(), p.current))
2257
+ if (!E[0].isIntersecting || (!i && f.current && d.disconnect(), p.current))
2219
2258
  return;
2220
- u.current = !0, p.current = !0;
2221
- const h = g();
2259
+ f.current = !0, p.current = !0;
2260
+ const h = b();
2222
2261
  y.reload({
2223
2262
  ...h,
2224
- onStart: (c) => {
2225
- var d;
2226
- p.current = !0, (d = h.onStart) == null || d.call(h, c);
2263
+ onStart: (u) => {
2264
+ var c;
2265
+ p.current = !0, (c = h.onStart) == null || c.call(h, u);
2227
2266
  },
2228
- onFinish: (c) => {
2229
- var d;
2230
- o(!0), p.current = !1, (d = h.onFinish) == null || d.call(h, c), i || f.disconnect();
2267
+ onFinish: (u) => {
2268
+ var c;
2269
+ o(!0), p.current = !1, (c = h.onFinish) == null || c.call(h, u), i || d.disconnect();
2231
2270
  }
2232
2271
  });
2233
2272
  },
@@ -2235,35 +2274,35 @@ const $i = ({
2235
2274
  rootMargin: `${n || 0}px`
2236
2275
  }
2237
2276
  );
2238
- return f.observe(w.current), () => {
2239
- f.disconnect();
2277
+ return d.observe(g.current), () => {
2278
+ d.disconnect();
2240
2279
  };
2241
- }, [w, g, n]), i || !a ? Ne(
2280
+ }, [g, b, n]), i || !a ? Re(
2242
2281
  l,
2243
2282
  {
2244
2283
  props: null,
2245
- ref: w
2284
+ ref: g
2246
2285
  },
2247
2286
  a ? e : s
2248
2287
  ) : a ? e : null;
2249
2288
  };
2250
- ui.displayName = "InertiaWhenVisible";
2251
- const Oi = (e) => (t) => (t.default.layout = (r) => Ne(e, {}, r), t);
2289
+ pi.displayName = "InertiaWhenVisible";
2290
+ const Li = (e) => (t) => (t.default.layout = (r) => Re(e, {}, r), t);
2252
2291
  export {
2253
- tn as Deferred,
2254
- rr as HeadlessModal,
2255
- si as Modal,
2256
- $i as ModalLink,
2257
- en as ModalRoot,
2258
- Jr as ModalStackProvider,
2259
- ui as WhenVisible,
2260
- Tt as getConfig,
2261
- Qr as initFromPageProps,
2262
- wi as putConfig,
2263
- bi as renderApp,
2264
- gi as resetConfig,
2265
- Oi as setPageLayout,
2266
- tr as useModal,
2267
- Qt as useModalIndex,
2268
- Je as useModalStack
2292
+ ln as Deferred,
2293
+ ir as HeadlessModal,
2294
+ mi as Modal,
2295
+ Mi as ModalLink,
2296
+ nn as ModalRoot,
2297
+ tn as ModalStackProvider,
2298
+ pi as WhenVisible,
2299
+ Lt as getConfig,
2300
+ rn as initFromPageProps,
2301
+ $i as putConfig,
2302
+ Oi as renderApp,
2303
+ Ei as resetConfig,
2304
+ Li as setPageLayout,
2305
+ lr as useModal,
2306
+ rr as useModalIndex,
2307
+ Qe as useModalStack
2269
2308
  };