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