@inertiaui/modal-react 0.19.4 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- var fn = Object.defineProperty;
2
- var mn = (e, t, n) => t in e ? fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var q = (e, t, n) => mn(e, typeof t != "symbol" ? t + "" : t, n);
4
- import * as Ee from "react";
5
- import E, { createContext as H, useContext as R, useEffect as M, useRef as O, useState as S, createElement as Re, useMemo as C, forwardRef as ct, useImperativeHandle as St, useLayoutEffect as pn, useCallback as Y, Fragment as G, isValidElement as hn, cloneElement as vn, useId as Pe, useSyncExternalStore as gn, useReducer as wn, createRef as yn } from "react";
6
- import { jsxs as se, Fragment as dt, jsx as T } from "react/jsx-runtime";
7
- import De from "axios";
8
- import { router as xe, usePage as xn } from "@inertiajs/react";
9
- import { mergeDataIntoQueryString as bn } from "@inertiajs/core";
10
- import { createPortal as En } from "react-dom";
11
- const ge = {
1
+ var mn = Object.defineProperty;
2
+ var pn = (e, t, n) => t in e ? mn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var q = (e, t, n) => pn(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import * as $e from "react";
5
+ import E, { createContext as H, useContext as R, useEffect as M, useRef as O, useState as S, createElement as De, useMemo as C, forwardRef as dt, useImperativeHandle as Ft, useLayoutEffect as hn, useCallback as Y, Fragment as G, isValidElement as vn, cloneElement as gn, useId as Me, useSyncExternalStore as wn, useReducer as xn, createRef as yn } from "react";
6
+ import { jsxs as se, Fragment as ft, jsx as T } from "react/jsx-runtime";
7
+ import je from "axios";
8
+ import { router as be, usePage as bn } from "@inertiajs/react";
9
+ import { mergeDataIntoQueryString as En } from "@inertiajs/core";
10
+ import { createPortal as $n } from "react-dom";
11
+ const we = {
12
12
  type: "modal",
13
13
  navigate: !1,
14
14
  modal: {
@@ -28,20 +28,20 @@ const ge = {
28
28
  position: "right"
29
29
  }
30
30
  };
31
- class $n {
31
+ class Tn {
32
32
  constructor() {
33
33
  this.config = {}, this.reset();
34
34
  }
35
35
  reset() {
36
- this.config = JSON.parse(JSON.stringify(ge));
36
+ this.config = JSON.parse(JSON.stringify(we));
37
37
  }
38
38
  put(t, n) {
39
39
  if (typeof t == "object") {
40
40
  this.config = {
41
- type: t.type ?? ge.type,
42
- navigate: t.navigate ?? ge.navigate,
43
- modal: { ...ge.modal, ...t.modal ?? {} },
44
- slideover: { ...ge.slideover, ...t.slideover ?? {} }
41
+ type: t.type ?? we.type,
42
+ navigate: t.navigate ?? we.navigate,
43
+ modal: { ...we.modal, ...t.modal ?? {} },
44
+ slideover: { ...we.slideover, ...t.slideover ?? {} }
45
45
  };
46
46
  return;
47
47
  }
@@ -64,23 +64,26 @@ class $n {
64
64
  return r;
65
65
  }
66
66
  }
67
- const _e = new $n(), Ll = () => _e.reset(), Sl = (e, t) => _e.put(e, t), ft = (e) => _e.get(e), ce = (e, t) => _e.get(e ? `slideover.${t}` : `modal.${t}`);
68
- function Tn(e, t) {
67
+ const Be = new Tn(), Sl = () => Be.reset(), Fl = (e, t) => Be.put(e, t), mt = (e) => Be.get(e), ce = (e, t) => Be.get(e ? `slideover.${t}` : `modal.${t}`);
68
+ function On(e, t) {
69
69
  return e = typeof e == "string" ? new URL(e, window.location.origin) : e, t = typeof t == "string" ? new URL(t, window.location.origin) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
70
70
  }
71
- function et(e = "inertiaui_modal_") {
71
+ function tt(e = "inertiaui_modal_") {
72
72
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}${crypto.randomUUID()}` : `${e}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
73
73
  }
74
- function On(e, t) {
75
- return Array.isArray(e) ? e.filter((n) => !t.includes(n)) : Object.keys(e).reduce((n, r) => (t.includes(r) || (n[r] = e[r]), n), {});
74
+ function fe(e) {
75
+ return typeof e == "string" ? e.toLowerCase() : e;
76
+ }
77
+ function Pn(e, t, n = !1) {
78
+ return n && (t = t.map(fe)), Array.isArray(e) ? e.filter((r) => !t.includes(n ? fe(r) : r)) : Object.keys(e).reduce((r, l) => (t.includes(n ? fe(l) : l) || (r[l] = e[l]), r), {});
76
79
  }
77
- function Ft(e, t) {
78
- return Array.isArray(e) ? e.filter((n) => t.includes(n)) : t.reduce((n, r) => (r in e && (n[r] = e[r]), n), {});
80
+ function Ct(e, t, n = !1) {
81
+ return n && (t = t.map(fe)), Array.isArray(e) ? e.filter((r) => t.includes(n ? fe(r) : r)) : Object.keys(e).reduce((r, l) => (t.includes(n ? fe(l) : l) && (r[l] = e[l]), r), {});
79
82
  }
80
- function Pn(e) {
83
+ function Mn(e) {
81
84
  return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, n) => (n in e && e[n] !== null && (t[n] = e[n]), t), {});
82
85
  }
83
- function Mn(e, t = 3, n = 10) {
86
+ function Ln(e, t = 3, n = 10) {
84
87
  return new Promise((r, l) => {
85
88
  const o = e();
86
89
  if (o) {
@@ -94,29 +97,29 @@ function Mn(e, t = 3, n = 10) {
94
97
  }, n);
95
98
  });
96
99
  }
97
- function we(e) {
100
+ function xe(e) {
98
101
  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, n) => n.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : "";
99
102
  }
100
- const Be = H(null);
101
- Be.displayName = "ModalStackContext";
102
- let Ct = null, kt = null, $e = null, rt = null, Ie = [], de = {};
103
- const Ln = ({ children: e }) => {
104
- const [t, n] = S([]), [r, l] = S({}), o = (v) => {
103
+ const Xe = H(null);
104
+ Xe.displayName = "ModalStackContext";
105
+ let Nt = null, At = null, Te = null, lt = null, Re = [], de = {};
106
+ const Sn = ({ children: e }) => {
107
+ const [t, n] = S([]), [r, l] = S({}), o = (g) => {
105
108
  n((u) => {
106
- const m = v([...u]), p = (g) => {
107
- var x;
108
- return m.length < 2 ? !0 : ((x = m.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : x.id) === g;
109
+ const m = g([...u]), p = (v) => {
110
+ var y;
111
+ return m.length < 2 ? !0 : ((y = m.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : y.id) === v;
109
112
  };
110
- return m.forEach((g, x) => {
111
- m[x].onTopOfStack = p(g.id), m[x].getParentModal = () => x < 1 ? null : m.slice(0, x).reverse().find((h) => h.isOpen), m[x].getChildModal = () => x === m.length - 1 ? null : m.slice(x + 1).find((h) => h.isOpen);
113
+ return m.forEach((v, y) => {
114
+ m[y].onTopOfStack = p(v.id), m[y].getParentModal = () => y < 1 ? null : m.slice(0, y).reverse().find((h) => h.isOpen), m[y].getChildModal = () => y === m.length - 1 ? null : m.slice(y + 1).find((h) => h.isOpen);
112
115
  }), m;
113
116
  });
114
117
  };
115
118
  M(() => {
116
- Ie = t;
119
+ Re = t;
117
120
  }, [t]);
118
121
  class a {
119
- constructor(u, m, p, g, x) {
122
+ constructor(u, m, p, v, y) {
120
123
  q(this, "show", () => {
121
124
  o(
122
125
  (u) => u.map((m) => (m.id === this.id && !m.isOpen && (m.isOpen = !0, m.shouldRender = !0), m))
@@ -129,8 +132,8 @@ const Ln = ({ children: e }) => {
129
132
  o(
130
133
  (u) => u.map((m) => {
131
134
  var p;
132
- return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((g) => {
133
- m.off(g);
135
+ return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((v) => {
136
+ m.off(v);
134
137
  }), m.isOpen = !1, (p = m.onCloseCallback) == null || p.call(m)), m;
135
138
  })
136
139
  );
@@ -138,61 +141,69 @@ const Ln = ({ children: e }) => {
138
141
  q(this, "afterLeave", () => {
139
142
  this.isOpen || o((u) => {
140
143
  const m = u.map((p) => {
141
- var g;
142
- return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (g = p.afterLeaveCallback) == null || g.call(p), p.afterLeaveCallback = null), p;
144
+ var v;
145
+ return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (v = p.afterLeaveCallback) == null || v.call(p), p.afterLeaveCallback = null), p;
143
146
  });
144
147
  return this.index === 0 ? [] : m;
145
148
  });
146
149
  });
147
150
  q(this, "on", (u, m) => {
148
- u = we(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(m);
151
+ u = xe(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(m);
149
152
  });
150
153
  q(this, "off", (u, m) => {
151
154
  var p;
152
- u = we(u), m ? this.listeners[u] = ((p = this.listeners[u]) == null ? void 0 : p.filter((g) => g !== m)) ?? [] : delete this.listeners[u];
155
+ u = xe(u), m ? this.listeners[u] = ((p = this.listeners[u]) == null ? void 0 : p.filter((v) => v !== m)) ?? [] : delete this.listeners[u];
153
156
  });
154
157
  q(this, "emit", (u, ...m) => {
155
158
  var p;
156
- (p = this.listeners[we(u)]) == null || p.forEach((g) => g(...m));
159
+ (p = this.listeners[xe(u)]) == null || p.forEach((v) => v(...m));
157
160
  });
158
161
  q(this, "registerEventListenersFromProps", (u) => {
159
162
  const m = [];
160
163
  return Object.keys(u).filter((p) => p.startsWith("on")).forEach((p) => {
161
- const g = we(p).replace(/^on-/, "");
162
- this.on(g, u[p]), m.push(() => this.off(g, u[p]));
164
+ const v = xe(p).replace(/^on-/, "");
165
+ this.on(v, u[p]), m.push(() => this.off(v, u[p]));
163
166
  }), () => m.forEach((p) => p());
164
167
  });
165
168
  q(this, "reload", (u = {}) => {
166
- var p;
169
+ var y;
167
170
  let m = Object.keys(this.response.props);
168
- u.only && (m = Ft(m, u.only)), u.except && (m = On(m, u.except)), (p = this.response) != null && p.url && De.get(this.response.url, {
171
+ if (u.only && (m = Ct(m, u.only)), u.except && (m = Pn(m, u.except)), !((y = this.response) != null && y.url))
172
+ return;
173
+ const p = (u.method ?? "get").toLowerCase(), v = u.data ?? {};
174
+ je({
175
+ url: this.response.url,
176
+ method: p,
177
+ data: p === "get" ? {} : v,
178
+ params: p === "get" ? v : {},
169
179
  headers: {
180
+ ...u.headers ?? {},
170
181
  Accept: "text/html, application/xhtml+xml",
171
182
  "X-Inertia": !0,
172
183
  "X-Inertia-Partial-Component": this.response.component,
173
184
  "X-Inertia-Version": this.response.version,
174
185
  "X-Inertia-Partial-Data": m.join(","),
175
- "X-InertiaUI-Modal": et(),
186
+ "X-InertiaUI-Modal": tt(),
176
187
  "X-InertiaUI-Modal-Use-Router": 0,
177
- "X-InertiaUI-Modal-Base-Url": $e
188
+ "X-InertiaUI-Modal-Base-Url": Te
178
189
  }
179
- }).then((g) => {
180
- this.updateProps(g.data.props);
190
+ }).then((h) => {
191
+ this.updateProps(h.data.props);
181
192
  });
182
193
  });
183
194
  q(this, "updateProps", (u) => {
184
195
  Object.assign(this.props, u), o((m) => m);
185
196
  });
186
- if (this.id = m.id ?? et(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = m.props, this.response = m, this.config = p ?? {}, this.onCloseCallback = g, this.afterLeaveCallback = x, de[this.id]) {
197
+ if (this.id = m.id ?? tt(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = m.props, this.response = m, this.config = p ?? {}, this.onCloseCallback = v, this.afterLeaveCallback = y, de[this.id]) {
187
198
  this.config = {
188
199
  ...this.config,
189
200
  ...de[this.id].config ?? {}
190
201
  };
191
202
  const h = de[this.id].onClose, $ = de[this.id].onAfterLeave;
192
- h && (this.onCloseCallback = g ? () => {
193
- g(), h();
194
- } : h), $ && (this.afterLeaveCallback = x ? () => {
195
- x(), $();
203
+ h && (this.onCloseCallback = v ? () => {
204
+ v(), h();
205
+ } : h), $ && (this.afterLeaveCallback = y ? () => {
206
+ y(), $();
196
207
  } : $), delete de[this.id];
197
208
  }
198
209
  this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
@@ -201,18 +212,18 @@ const Ln = ({ children: e }) => {
201
212
  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)}`;
202
213
  }
203
214
  }
204
- const s = (v, u = {}, m = null, p = null) => kt(v.component).then((g) => i(g, v, u, m, p)), i = (v, u, m, p, g) => {
205
- const x = new a(v, u, m, p, g);
206
- return x.index = t.length, o((h) => [...h, x]), x.show(), x;
215
+ const s = (g, u = {}, m = null, p = null) => At(g.component).then((v) => i(v, g, u, m, p)), i = (g, u, m, p, v) => {
216
+ const y = new a(g, u, m, p, v);
217
+ return y.index = t.length, o((h) => [...h, y]), y.show(), y;
207
218
  };
208
- function c(v, u, m, p) {
209
- if (!r[v])
210
- throw new Error(`The local modal "${v}" has not been registered.`);
211
- const g = i(null, {}, u, m, p);
212
- return g.name = v, r[v].callback(g), g;
219
+ function c(g, u, m, p) {
220
+ if (!r[g])
221
+ throw new Error(`The local modal "${g}" has not been registered.`);
222
+ const v = i(null, {}, u, m, p);
223
+ return v.name = g, r[g].callback(v), v;
213
224
  }
214
- const f = (v, u = {}) => y(
215
- v,
225
+ const f = (g, u = {}) => x(
226
+ g,
216
227
  u.method ?? "get",
217
228
  u.data ?? {},
218
229
  u.headers ?? {},
@@ -220,54 +231,54 @@ const Ln = ({ children: e }) => {
220
231
  u.onClose,
221
232
  u.onAfterLeave,
222
233
  u.queryStringArrayFormat ?? "brackets",
223
- u.navigate ?? ft("navigate")
234
+ u.navigate ?? mt("navigate")
224
235
  ).then((m) => {
225
236
  const p = u.listeners ?? {};
226
- return Object.keys(p).forEach((g) => {
227
- const x = we(g);
228
- m.on(x, p[g]);
237
+ return Object.keys(p).forEach((v) => {
238
+ const y = xe(v);
239
+ m.on(y, p[v]);
229
240
  }), m;
230
- }), y = (v, u, m = {}, p = {}, g = {}, x = null, h = null, $ = "brackets", F = !1) => {
231
- const j = et();
232
- return new Promise((_, N) => {
233
- if (v.startsWith("#")) {
234
- _(c(v.substring(1), g, x, h));
241
+ }), x = (g, u, m = {}, p = {}, v = {}, y = null, h = null, $ = "brackets", F = !1) => {
242
+ const j = tt();
243
+ return new Promise((_, A) => {
244
+ if (g.startsWith("#")) {
245
+ _(c(g.substring(1), v, y, h));
235
246
  return;
236
247
  }
237
- const [U, B] = bn(u, v || "", m, $);
248
+ const [U, B] = En(u, g || "", m, $);
238
249
  let X = F && t.length === 0;
239
- if (t.length === 0 && ($e = typeof window < "u" ? window.location.href : ""), p = {
250
+ if (t.length === 0 && (Te = typeof window < "u" ? window.location.href : ""), p = {
240
251
  ...p,
241
252
  Accept: "text/html, application/xhtml+xml",
242
253
  "X-Requested-With": "XMLHttpRequest",
243
254
  "X-Inertia": !0,
244
- "X-Inertia-Version": Ct,
255
+ "X-Inertia-Version": Nt,
245
256
  "X-InertiaUI-Modal": j,
246
257
  "X-InertiaUI-Modal-Use-Router": X ? 1 : 0,
247
- "X-InertiaUI-Modal-Base-Url": $e
258
+ "X-InertiaUI-Modal-Base-Url": Te
248
259
  }, X)
249
- return rt = null, de[j] = {
250
- config: g,
251
- onClose: x,
260
+ return lt = null, de[j] = {
261
+ config: v,
262
+ onClose: y,
252
263
  onAfterLeave: h
253
- }, xe.visit(U, {
264
+ }, be.visit(U, {
254
265
  method: u,
255
266
  data: B,
256
267
  headers: p,
257
268
  preserveScroll: !0,
258
269
  preserveState: !0,
259
- onError: N,
270
+ onError: A,
260
271
  onFinish: () => {
261
- Mn(() => rt).then(_);
272
+ Ln(() => lt).then(_);
262
273
  }
263
274
  });
264
- De({
275
+ je({
265
276
  url: U,
266
277
  method: u,
267
278
  data: B,
268
279
  headers: p
269
- }).then((P) => _(s(P.data, g, x, h))).catch((P) => {
270
- N(P);
280
+ }).then((P) => _(s(P.data, v, y, h))).catch((P) => {
281
+ A(P);
271
282
  });
272
283
  });
273
284
  }, d = {
@@ -275,98 +286,98 @@ const Ln = ({ children: e }) => {
275
286
  localModals: r,
276
287
  push: i,
277
288
  pushFromResponseData: s,
278
- length: () => Ie.length,
289
+ length: () => Re.length,
279
290
  closeAll: () => {
280
- Ie.reverse().forEach((v) => v.close());
291
+ Re.reverse().forEach((g) => g.close());
281
292
  },
282
293
  reset: () => o(() => []),
283
- visit: y,
294
+ visit: x,
284
295
  visitModal: f,
285
- registerLocalModal: (v, u) => {
296
+ registerLocalModal: (g, u) => {
286
297
  l((m) => ({
287
298
  ...m,
288
- [v]: { name: v, callback: u }
299
+ [g]: { name: g, callback: u }
289
300
  }));
290
301
  },
291
- removeLocalModal: (v) => {
302
+ removeLocalModal: (g) => {
292
303
  l((u) => {
293
304
  const m = { ...u };
294
- return delete m[v], m;
305
+ return delete m[g], m;
295
306
  });
296
307
  }
297
308
  };
298
- return /* @__PURE__ */ T(Be.Provider, { value: d, children: e });
299
- }, Xe = () => {
300
- const e = R(Be);
309
+ return /* @__PURE__ */ T(Xe.Provider, { value: d, children: e });
310
+ }, Ve = () => {
311
+ const e = R(Xe);
301
312
  if (e === null)
302
313
  throw new Error("useModalStack must be used within a ModalStackProvider");
303
314
  return e;
304
- }, xt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Sn = (e) => {
305
- e.initialPage && (Ct = e.initialPage.version), e.resolveComponent && (kt = e.resolveComponent);
306
- }, Fl = (e, t) => (Sn(t), /* @__PURE__ */ T(Ln, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key: o }) => /* @__PURE__ */ se(dt, { children: [
315
+ }, bt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Fn = (e) => {
316
+ e.initialPage && (Nt = e.initialPage.version), e.resolveComponent && (At = e.resolveComponent);
317
+ }, Cl = (e, t) => (Fn(t), /* @__PURE__ */ T(Sn, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key: o }) => /* @__PURE__ */ se(ft, { children: [
307
318
  (() => {
308
- const s = Re(r, { key: o, ...l });
309
- return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((c, f) => Re(f, l, c)) : s;
319
+ const s = De(r, { key: o, ...l });
320
+ return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((c, f) => De(f, l, c)) : s;
310
321
  })(),
311
- /* @__PURE__ */ T(Fn, {})
312
- ] }) }) })), Fn = ({ children: e }) => {
322
+ /* @__PURE__ */ T(Cn, {})
323
+ ] }) }) })), Cn = ({ children: e }) => {
313
324
  var s;
314
- const t = R(Be);
325
+ const t = R(Xe);
315
326
  let n = !1, r = !1;
316
- M(() => xe.on("start", () => n = !0), []), M(() => xe.on("finish", () => n = !1), []), M(
317
- () => xe.on("navigate", function(i) {
327
+ M(() => be.on("start", () => n = !0), []), M(() => be.on("finish", () => n = !1), []), M(
328
+ () => be.on("navigate", function(i) {
318
329
  const c = i.detail.page.props._inertiaui_modal;
319
330
  if (!c) {
320
331
  r && t.closeAll();
321
332
  return;
322
333
  }
323
- r = c, $e = c.baseUrl, t.pushFromResponseData(c, {}, () => {
334
+ r = c, Te = c.baseUrl, t.pushFromResponseData(c, {}, () => {
324
335
  if (!c.baseUrl) {
325
336
  console.error("No base url in modal response data so cannot navigate back");
326
337
  return;
327
338
  }
328
- !n && window.location.href !== c.baseUrl && xe.visit(c.baseUrl, {
339
+ !n && window.location.href !== c.baseUrl && be.visit(c.baseUrl, {
329
340
  preserveScroll: !0,
330
341
  preserveState: !0
331
342
  });
332
343
  }).then((f) => {
333
- rt = f;
344
+ lt = f;
334
345
  });
335
346
  }),
336
347
  []
337
348
  );
338
- const l = (i) => (Ie.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = $e), i);
339
- M(() => (De.interceptors.request.use(l), () => De.interceptors.request.eject(l)), []);
340
- const o = xn(), a = O();
349
+ const l = (i) => (Re.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = Te), i);
350
+ M(() => (je.interceptors.request.use(l), () => je.interceptors.request.eject(l)), []);
351
+ const o = bn(), a = O();
341
352
  return M(() => {
342
- var f, y;
353
+ var f, x;
343
354
  const i = (f = o.props) == null ? void 0 : f._inertiaui_modal, c = a.current;
344
- a.current = i, i && c && i.component === c.component && Tn(i.url, c.url) && ((y = t.stack[0]) == null || y.updateProps(i.props ?? {}));
345
- }, [(s = o.props) == null ? void 0 : s._inertiaui_modal]), /* @__PURE__ */ se(dt, { children: [
355
+ a.current = i, i && c && i.component === c.component && On(i.url, c.url) && ((x = t.stack[0]) == null || x.updateProps(i.props ?? {}));
356
+ }, [(s = o.props) == null ? void 0 : s._inertiaui_modal]), /* @__PURE__ */ se(ft, { children: [
346
357
  e,
347
- t.stack.length > 0 && /* @__PURE__ */ T(At, { index: 0 })
358
+ t.stack.length > 0 && /* @__PURE__ */ T(It, { index: 0 })
348
359
  ] });
349
- }, mt = E.createContext(null);
350
- mt.displayName = "ModalIndexContext";
351
- const Nt = () => {
352
- const e = E.useContext(mt);
360
+ }, pt = E.createContext(null);
361
+ pt.displayName = "ModalIndexContext";
362
+ const kt = () => {
363
+ const e = E.useContext(pt);
353
364
  if (e === void 0)
354
365
  throw new Error("useModalIndex must be used within a ModalIndexProvider");
355
366
  return e;
356
- }, At = ({ index: e }) => {
357
- const { stack: t } = Xe(), n = C(() => t[e], [t, e]);
358
- return (n == null ? void 0 : n.component) && /* @__PURE__ */ T(mt.Provider, { value: e, children: /* @__PURE__ */ T(
367
+ }, It = ({ index: e }) => {
368
+ const { stack: t } = Ve(), n = C(() => t[e], [t, e]);
369
+ return (n == null ? void 0 : n.component) && /* @__PURE__ */ T(pt.Provider, { value: e, children: /* @__PURE__ */ T(
359
370
  n.component,
360
371
  {
361
372
  ...n.props,
362
373
  onModalEvent: (...r) => n.emit(...r)
363
374
  }
364
375
  ) });
365
- }, It = ct(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, ...a }, s) => {
366
- const i = Nt(), { stack: c, registerLocalModal: f, removeLocalModal: y } = Xe(), [b, w] = S(null), d = C(() => e ? b : c[i], [e, b, i, c]), v = C(() => {
376
+ }, Rt = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, ...a }, s) => {
377
+ const i = kt(), { stack: c, registerLocalModal: f, removeLocalModal: x } = Ve(), [b, w] = S(null), d = C(() => e ? b : c[i], [e, b, i, c]), g = C(() => {
367
378
  var h;
368
379
  return (h = c.find(($) => $.shouldRender && $.index > (d == null ? void 0 : d.index))) == null ? void 0 : h.index;
369
- }, [i, c]), u = C(() => (d == null ? void 0 : d.config.slideover) ?? a.slideover ?? ft("type") === "slideover", [a.slideover]), m = C(
380
+ }, [i, c]), u = C(() => (d == null ? void 0 : d.config.slideover) ?? a.slideover ?? mt("type") === "slideover", [a.slideover]), m = C(
370
381
  () => ({
371
382
  slideover: u,
372
383
  closeButton: a.closeButton ?? ce(u, "closeButton"),
@@ -385,7 +396,7 @@ const Nt = () => {
385
396
  return f(e, ($) => {
386
397
  h = $.registerEventListenersFromProps(a), w($);
387
398
  }), () => {
388
- h == null || h(), h = null, y(e);
399
+ h == null || h(), h = null, x(e);
389
400
  };
390
401
  }
391
402
  return d.registerEventListenersFromProps(a);
@@ -396,10 +407,10 @@ const Nt = () => {
396
407
  }, [d]), M(() => {
397
408
  d !== null && (d.isOpen ? o == null || o() : l == null || l());
398
409
  }, [d == null ? void 0 : d.isOpen]);
399
- const [g, x] = S(!1);
410
+ const [v, y] = S(!1);
400
411
  return M(() => {
401
- g && d !== null && d.isOpen && (d.onTopOfStack ? n == null || n() : r == null || r()), x(!0);
402
- }, [d == null ? void 0 : d.onTopOfStack]), St(
412
+ v && d !== null && d.isOpen && (d.onTopOfStack ? n == null || n() : r == null || r()), y(!0);
413
+ }, [d == null ? void 0 : d.onTopOfStack]), Ft(
403
414
  s,
404
415
  () => ({
405
416
  afterLeave: () => {
@@ -459,7 +470,7 @@ const Nt = () => {
459
470
  }
460
471
  }),
461
472
  [d]
462
- ), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ se(dt, { children: [
473
+ ), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ se(ft, { children: [
463
474
  typeof t == "function" ? t({
464
475
  afterLeave: d.afterLeave,
465
476
  close: d.close,
@@ -476,27 +487,27 @@ const Nt = () => {
476
487
  setOpen: d.setOpen,
477
488
  shouldRender: d.shouldRender
478
489
  }) : t,
479
- v && /* @__PURE__ */ T(At, { index: v })
490
+ g && /* @__PURE__ */ T(It, { index: g })
480
491
  ] });
481
492
  });
482
- It.displayName = "HeadlessModal";
483
- function Rt(e) {
493
+ Rt.displayName = "HeadlessModal";
494
+ function Dt(e) {
484
495
  var t, n, r = "";
485
496
  if (typeof e == "string" || typeof e == "number") r += e;
486
497
  else if (typeof e == "object") if (Array.isArray(e)) {
487
498
  var l = e.length;
488
- for (t = 0; t < l; t++) e[t] && (n = Rt(e[t])) && (r && (r += " "), r += n);
499
+ for (t = 0; t < l; t++) e[t] && (n = Dt(e[t])) && (r && (r += " "), r += n);
489
500
  } else for (n in e) e[n] && (r && (r += " "), r += n);
490
501
  return r;
491
502
  }
492
- function je() {
493
- for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = Rt(e)) && (r && (r += " "), r += t);
503
+ function Ue() {
504
+ for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = Dt(e)) && (r && (r += " "), r += t);
494
505
  return r;
495
506
  }
496
- var Cn = Object.defineProperty, kn = (e, t, n) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, tt = (e, t, n) => (kn(e, typeof t != "symbol" ? t + "" : t, n), n);
497
- let Nn = class {
507
+ var Nn = Object.defineProperty, An = (e, t, n) => t in e ? Nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, nt = (e, t, n) => (An(e, typeof t != "symbol" ? t + "" : t, n), n);
508
+ let kn = class {
498
509
  constructor() {
499
- tt(this, "current", this.detect()), tt(this, "handoffState", "pending"), tt(this, "currentId", 0);
510
+ nt(this, "current", this.detect()), nt(this, "handoffState", "pending"), nt(this, "currentId", 0);
500
511
  }
501
512
  set(t) {
502
513
  this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
@@ -522,11 +533,11 @@ let Nn = class {
522
533
  get isHandoffComplete() {
523
534
  return this.handoffState === "complete";
524
535
  }
525
- }, ae = new Nn();
526
- function Ve(e) {
536
+ }, ae = new kn();
537
+ function qe(e) {
527
538
  return ae.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
528
539
  }
529
- function qe(e) {
540
+ function Ye(e) {
530
541
  typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
531
542
  throw t;
532
543
  }));
@@ -544,7 +555,7 @@ function re() {
544
555
  return t.add(() => clearTimeout(r));
545
556
  }, microTask(...n) {
546
557
  let r = { current: !0 };
547
- return qe(() => {
558
+ return Ye(() => {
548
559
  r.current && n[0]();
549
560
  }), t.add(() => {
550
561
  r.current = !1;
@@ -567,27 +578,27 @@ function re() {
567
578
  } };
568
579
  return t;
569
580
  }
570
- function pt() {
581
+ function ht() {
571
582
  let [e] = S(re);
572
583
  return M(() => () => e.dispose(), [e]), e;
573
584
  }
574
- let A = (e, t) => {
575
- ae.isServer ? M(e, t) : pn(e, t);
585
+ let k = (e, t) => {
586
+ ae.isServer ? M(e, t) : hn(e, t);
576
587
  };
577
588
  function ue(e) {
578
589
  let t = O(e);
579
- return A(() => {
590
+ return k(() => {
580
591
  t.current = e;
581
592
  }, [e]), t;
582
593
  }
583
594
  let L = function(e) {
584
595
  let t = ue(e);
585
596
  return E.useCallback((...n) => t.current(...n), [t]);
586
- }, An = H(void 0);
587
- function In() {
588
- return R(An);
597
+ }, In = H(void 0);
598
+ function Rn() {
599
+ return R(In);
589
600
  }
590
- function lt(...e) {
601
+ function it(...e) {
591
602
  return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
592
603
  }
593
604
  function ne(e, t, ...n) {
@@ -598,55 +609,55 @@ function ne(e, t, ...n) {
598
609
  let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
599
610
  throw Error.captureStackTrace && Error.captureStackTrace(r, ne), r;
600
611
  }
601
- var Ue = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Ue || {}), te = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(te || {});
612
+ var He = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(He || {}), te = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(te || {});
602
613
  function W() {
603
- let e = Dn();
604
- return Y((t) => Rn({ mergeRefs: e, ...t }), [e]);
614
+ let e = jn();
615
+ return Y((t) => Dn({ mergeRefs: e, ...t }), [e]);
605
616
  }
606
- function Rn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: o = !0, name: a, mergeRefs: s }) {
607
- s = s ?? jn;
608
- let i = Dt(t, e);
609
- if (o) return Ae(i, n, r, a, s);
617
+ function Dn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: o = !0, name: a, mergeRefs: s }) {
618
+ s = s ?? Un;
619
+ let i = jt(t, e);
620
+ if (o) return Ie(i, n, r, a, s);
610
621
  let c = l ?? 0;
611
622
  if (c & 2) {
612
- let { static: f = !1, ...y } = i;
613
- if (f) return Ae(y, n, r, a, s);
623
+ let { static: f = !1, ...x } = i;
624
+ if (f) return Ie(x, n, r, a, s);
614
625
  }
615
626
  if (c & 1) {
616
- let { unmount: f = !0, ...y } = i;
627
+ let { unmount: f = !0, ...x } = i;
617
628
  return ne(f ? 0 : 1, { 0() {
618
629
  return null;
619
630
  }, 1() {
620
- return Ae({ ...y, hidden: !0, style: { display: "none" } }, n, r, a, s);
631
+ return Ie({ ...x, hidden: !0, style: { display: "none" } }, n, r, a, s);
621
632
  } });
622
633
  }
623
- return Ae(i, n, r, a, s);
634
+ return Ie(i, n, r, a, s);
624
635
  }
625
- function Ae(e, t = {}, n, r, l) {
626
- let { as: o = n, children: a, refName: s = "ref", ...i } = nt(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [s]: e.ref } : {}, f = typeof a == "function" ? a(t) : a;
636
+ function Ie(e, t = {}, n, r, l) {
637
+ let { as: o = n, children: a, refName: s = "ref", ...i } = rt(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [s]: e.ref } : {}, f = typeof a == "function" ? a(t) : a;
627
638
  "className" in i && i.className && typeof i.className == "function" && (i.className = i.className(t)), i["aria-labelledby"] && i["aria-labelledby"] === i.id && (i["aria-labelledby"] = void 0);
628
- let y = {};
639
+ let x = {};
629
640
  if (t) {
630
641
  let b = !1, w = [];
631
- for (let [d, v] of Object.entries(t)) typeof v == "boolean" && (b = !0), v === !0 && w.push(d.replace(/([A-Z])/g, (u) => `-${u.toLowerCase()}`));
642
+ for (let [d, g] of Object.entries(t)) typeof g == "boolean" && (b = !0), g === !0 && w.push(d.replace(/([A-Z])/g, (u) => `-${u.toLowerCase()}`));
632
643
  if (b) {
633
- y["data-headlessui-state"] = w.join(" ");
634
- for (let d of w) y[`data-${d}`] = "";
644
+ x["data-headlessui-state"] = w.join(" ");
645
+ for (let d of w) x[`data-${d}`] = "";
635
646
  }
636
647
  }
637
- if (o === G && (Object.keys(le(i)).length > 0 || Object.keys(le(y)).length > 0)) if (!hn(f) || Array.isArray(f) && f.length > 1) {
638
- if (Object.keys(le(i)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(le(i)).concat(Object.keys(le(y))).map((b) => ` - ${b}`).join(`
648
+ if (o === G && (Object.keys(le(i)).length > 0 || Object.keys(le(x)).length > 0)) if (!vn(f) || Array.isArray(f) && f.length > 1) {
649
+ if (Object.keys(le(i)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(le(i)).concat(Object.keys(le(x))).map((b) => ` - ${b}`).join(`
639
650
  `), "", "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(`
640
651
  `)].join(`
641
652
  `));
642
653
  } else {
643
- let b = f.props, w = b == null ? void 0 : b.className, d = typeof w == "function" ? (...m) => lt(w(...m), i.className) : lt(w, i.className), v = d ? { className: d } : {}, u = Dt(f.props, le(nt(i, ["ref"])));
644
- for (let m in y) m in u && delete y[m];
645
- return vn(f, Object.assign({}, u, y, c, { ref: l(Un(f), c.ref) }, v));
654
+ let b = f.props, w = b == null ? void 0 : b.className, d = typeof w == "function" ? (...m) => it(w(...m), i.className) : it(w, i.className), g = d ? { className: d } : {}, u = jt(f.props, le(rt(i, ["ref"])));
655
+ for (let m in x) m in u && delete x[m];
656
+ return gn(f, Object.assign({}, u, x, c, { ref: l(Hn(f), c.ref) }, g));
646
657
  }
647
- return Re(o, Object.assign({}, nt(i, ["ref"]), o !== G && c, o !== G && y), f);
658
+ return De(o, Object.assign({}, rt(i, ["ref"]), o !== G && c, o !== G && x), f);
648
659
  }
649
- function Dn() {
660
+ function jn() {
650
661
  let e = O([]), t = Y((n) => {
651
662
  for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n);
652
663
  }, []);
@@ -654,12 +665,12 @@ function Dn() {
654
665
  if (!n.every((r) => r == null)) return e.current = n, t;
655
666
  };
656
667
  }
657
- function jn(...e) {
668
+ function Un(...e) {
658
669
  return e.every((t) => t == null) ? void 0 : (t) => {
659
670
  for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t);
660
671
  };
661
672
  }
662
- function Dt(...e) {
673
+ function jt(...e) {
663
674
  if (e.length === 0) return {};
664
675
  if (e.length === 1) return e[0];
665
676
  let t = {}, n = {};
@@ -679,31 +690,31 @@ function Dt(...e) {
679
690
  }
680
691
  function D(e) {
681
692
  var t;
682
- return Object.assign(ct(e), { displayName: (t = e.displayName) != null ? t : e.name });
693
+ return Object.assign(dt(e), { displayName: (t = e.displayName) != null ? t : e.name });
683
694
  }
684
695
  function le(e) {
685
696
  let t = Object.assign({}, e);
686
697
  for (let n in t) t[n] === void 0 && delete t[n];
687
698
  return t;
688
699
  }
689
- function nt(e, t = []) {
700
+ function rt(e, t = []) {
690
701
  let n = Object.assign({}, e);
691
702
  for (let r of t) r in n && delete n[r];
692
703
  return n;
693
704
  }
694
- function Un(e) {
705
+ function Hn(e) {
695
706
  return E.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
696
707
  }
697
- let Hn = "span";
698
- var He = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(He || {});
699
- function Wn(e, t) {
708
+ let Wn = "span";
709
+ var We = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(We || {});
710
+ function _n(e, t) {
700
711
  var n;
701
712
  let { features: r = 1, ...l } = e, o = { ref: t, "aria-hidden": (r & 2) === 2 ? !0 : (n = l["aria-hidden"]) != null ? n : void 0, hidden: (r & 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", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } };
702
- return W()({ ourProps: o, theirProps: l, slot: {}, defaultTag: Hn, name: "Hidden" });
713
+ return W()({ ourProps: o, theirProps: l, slot: {}, defaultTag: Wn, name: "Hidden" });
703
714
  }
704
- let it = D(Wn), jt = Symbol();
705
- function _n(e, t = !0) {
706
- return Object.assign(e, { [jt]: t });
715
+ let ot = D(_n), Ut = Symbol();
716
+ function Bn(e, t = !0) {
717
+ return Object.assign(e, { [Ut]: t });
707
718
  }
708
719
  function Z(...e) {
709
720
  let t = O(e);
@@ -713,43 +724,43 @@ function Z(...e) {
713
724
  let n = L((r) => {
714
725
  for (let l of t.current) l != null && (typeof l == "function" ? l(r) : l.current = r);
715
726
  });
716
- return e.every((r) => r == null || (r == null ? void 0 : r[jt])) ? void 0 : n;
727
+ return e.every((r) => r == null || (r == null ? void 0 : r[Ut])) ? void 0 : n;
717
728
  }
718
- let ht = H(null);
719
- ht.displayName = "DescriptionContext";
720
- function Ut() {
721
- let e = R(ht);
729
+ let vt = H(null);
730
+ vt.displayName = "DescriptionContext";
731
+ function Ht() {
732
+ let e = R(vt);
722
733
  if (e === null) {
723
734
  let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
724
- throw Error.captureStackTrace && Error.captureStackTrace(t, Ut), t;
735
+ throw Error.captureStackTrace && Error.captureStackTrace(t, Ht), t;
725
736
  }
726
737
  return e;
727
738
  }
728
- function Bn() {
739
+ function Xn() {
729
740
  let [e, t] = S([]);
730
741
  return [e.length > 0 ? e.join(" ") : void 0, C(() => function(n) {
731
742
  let r = L((o) => (t((a) => [...a, o]), () => t((a) => {
732
743
  let s = a.slice(), i = s.indexOf(o);
733
744
  return i !== -1 && s.splice(i, 1), s;
734
745
  }))), l = C(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
735
- return E.createElement(ht.Provider, { value: l }, n.children);
746
+ return E.createElement(vt.Provider, { value: l }, n.children);
736
747
  }, [t])];
737
748
  }
738
- let Xn = "p";
739
- function Vn(e, t) {
740
- let n = Pe(), r = In(), { id: l = `headlessui-description-${n}`, ...o } = e, a = Ut(), s = Z(t);
741
- A(() => a.register(l), [l, a.register]);
749
+ let Vn = "p";
750
+ function qn(e, t) {
751
+ let n = Me(), r = Rn(), { id: l = `headlessui-description-${n}`, ...o } = e, a = Ht(), s = Z(t);
752
+ k(() => a.register(l), [l, a.register]);
742
753
  let i = r || !1, c = C(() => ({ ...a.slot, disabled: i }), [a.slot, i]), f = { ref: s, ...a.props, id: l };
743
- return W()({ ourProps: f, theirProps: o, slot: c, defaultTag: Xn, name: a.name || "Description" });
754
+ return W()({ ourProps: f, theirProps: o, slot: c, defaultTag: Vn, name: a.name || "Description" });
744
755
  }
745
- let qn = D(Vn), Yn = Object.assign(qn, {});
746
- var Ht = ((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))(Ht || {});
747
- let zn = H(() => {
756
+ let Yn = D(qn), zn = Object.assign(Yn, {});
757
+ var Wt = ((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))(Wt || {});
758
+ let Gn = H(() => {
748
759
  });
749
- function Gn({ value: e, children: t }) {
750
- return E.createElement(zn.Provider, { value: e }, t);
760
+ function Kn({ value: e, children: t }) {
761
+ return E.createElement(Gn.Provider, { value: e }, t);
751
762
  }
752
- let Kn = class extends Map {
763
+ let Zn = class extends Map {
753
764
  constructor(t) {
754
765
  super(), this.factory = t;
755
766
  }
@@ -758,7 +769,7 @@ let Kn = class extends Map {
758
769
  return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
759
770
  }
760
771
  };
761
- function Wt(e, t) {
772
+ function _t(e, t) {
762
773
  let n = e(), r = /* @__PURE__ */ new Set();
763
774
  return { getSnapshot() {
764
775
  return n;
@@ -769,10 +780,10 @@ function Wt(e, t) {
769
780
  a && (n = a, r.forEach((s) => s()));
770
781
  } };
771
782
  }
772
- function _t(e) {
773
- return gn(e.subscribe, e.getSnapshot, e.getSnapshot);
783
+ function Bt(e) {
784
+ return wn(e.subscribe, e.getSnapshot, e.getSnapshot);
774
785
  }
775
- let Zn = new Kn(() => Wt(() => [], { ADD(e) {
786
+ let Jn = new Zn(() => _t(() => [], { ADD(e) {
776
787
  return this.includes(e) ? this : [...this, e];
777
788
  }, REMOVE(e) {
778
789
  let t = this.indexOf(e);
@@ -780,49 +791,49 @@ let Zn = new Kn(() => Wt(() => [], { ADD(e) {
780
791
  let n = this.slice();
781
792
  return n.splice(t, 1), n;
782
793
  } }));
783
- function fe(e, t) {
784
- let n = Zn.get(t), r = Pe(), l = _t(n);
785
- if (A(() => {
794
+ function me(e, t) {
795
+ let n = Jn.get(t), r = Me(), l = Bt(n);
796
+ if (k(() => {
786
797
  if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
787
798
  }, [n, e]), !e) return !1;
788
799
  let o = l.indexOf(r), a = l.length;
789
800
  return o === -1 && (o = a, a += 1), o === a - 1;
790
801
  }
791
- let ot = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map();
792
- function bt(e) {
802
+ let at = /* @__PURE__ */ new Map(), Oe = /* @__PURE__ */ new Map();
803
+ function Et(e) {
793
804
  var t;
794
- let n = (t = Te.get(e)) != null ? t : 0;
795
- return Te.set(e, n + 1), n !== 0 ? () => Et(e) : (ot.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Et(e));
805
+ let n = (t = Oe.get(e)) != null ? t : 0;
806
+ return Oe.set(e, n + 1), n !== 0 ? () => $t(e) : (at.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => $t(e));
796
807
  }
797
- function Et(e) {
808
+ function $t(e) {
798
809
  var t;
799
- let n = (t = Te.get(e)) != null ? t : 1;
800
- if (n === 1 ? Te.delete(e) : Te.set(e, n - 1), n !== 1) return;
801
- let r = ot.get(e);
802
- r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, ot.delete(e));
803
- }
804
- function Jn(e, { allowed: t, disallowed: n } = {}) {
805
- let r = fe(e, "inert-others");
806
- A(() => {
810
+ let n = (t = Oe.get(e)) != null ? t : 1;
811
+ if (n === 1 ? Oe.delete(e) : Oe.set(e, n - 1), n !== 1) return;
812
+ let r = at.get(e);
813
+ r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, at.delete(e));
814
+ }
815
+ function Qn(e, { allowed: t, disallowed: n } = {}) {
816
+ let r = me(e, "inert-others");
817
+ k(() => {
807
818
  var l, o;
808
819
  if (!r) return;
809
820
  let a = re();
810
- for (let i of (l = n == null ? void 0 : n()) != null ? l : []) i && a.add(bt(i));
821
+ for (let i of (l = n == null ? void 0 : n()) != null ? l : []) i && a.add(Et(i));
811
822
  let s = (o = t == null ? void 0 : t()) != null ? o : [];
812
823
  for (let i of s) {
813
824
  if (!i) continue;
814
- let c = Ve(i);
825
+ let c = qe(i);
815
826
  if (!c) continue;
816
827
  let f = i.parentElement;
817
828
  for (; f && f !== c.body; ) {
818
- for (let y of f.children) s.some((b) => y.contains(b)) || a.add(bt(y));
829
+ for (let x of f.children) s.some((b) => x.contains(b)) || a.add(Et(x));
819
830
  f = f.parentElement;
820
831
  }
821
832
  }
822
833
  return a.dispose;
823
834
  }, [r, t, n]);
824
835
  }
825
- function Qn(e, t, n) {
836
+ function er(e, t, n) {
826
837
  let r = ue((l) => {
827
838
  let o = l.getBoundingClientRect();
828
839
  o.x === 0 && o.y === 0 && o.width === 0 && o.height === 0 && n();
@@ -843,29 +854,29 @@ function Qn(e, t, n) {
843
854
  return () => o.dispose();
844
855
  }, [t, r, e]);
845
856
  }
846
- let We = ["[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(","), er = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
847
- var J = ((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))(J || {}), at = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(at || {}), tr = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(tr || {});
848
- function nr(e = document.body) {
849
- return e == null ? [] : Array.from(e.querySelectorAll(We)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
850
- }
857
+ let _e = ["[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(","), tr = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
858
+ var J = ((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))(J || {}), st = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(st || {}), nr = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(nr || {});
851
859
  function rr(e = document.body) {
852
- return e == null ? [] : Array.from(e.querySelectorAll(er)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
860
+ return e == null ? [] : Array.from(e.querySelectorAll(_e)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
861
+ }
862
+ function lr(e = document.body) {
863
+ return e == null ? [] : Array.from(e.querySelectorAll(tr)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
853
864
  }
854
- var Bt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Bt || {});
855
- function lr(e, t = 0) {
865
+ var Xt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Xt || {});
866
+ function ir(e, t = 0) {
856
867
  var n;
857
- return e === ((n = Ve(e)) == null ? void 0 : n.body) ? !1 : ne(t, { 0() {
858
- return e.matches(We);
868
+ return e === ((n = qe(e)) == null ? void 0 : n.body) ? !1 : ne(t, { 0() {
869
+ return e.matches(_e);
859
870
  }, 1() {
860
871
  let r = e;
861
872
  for (; r !== null; ) {
862
- if (r.matches(We)) return !0;
873
+ if (r.matches(_e)) return !0;
863
874
  r = r.parentElement;
864
875
  }
865
876
  return !1;
866
877
  } });
867
878
  }
868
- var ir = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(ir || {});
879
+ var or = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(or || {});
869
880
  typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
870
881
  e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
871
882
  }, !0), document.addEventListener("click", (e) => {
@@ -874,12 +885,12 @@ typeof window < "u" && typeof document < "u" && (document.addEventListener("keyd
874
885
  function Q(e) {
875
886
  e == null || e.focus({ preventScroll: !0 });
876
887
  }
877
- let or = ["textarea", "input"].join(",");
878
- function ar(e) {
888
+ let ar = ["textarea", "input"].join(",");
889
+ function sr(e) {
879
890
  var t, n;
880
- return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, or)) != null ? n : !1;
891
+ return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, ar)) != null ? n : !1;
881
892
  }
882
- function sr(e, t = (n) => n) {
893
+ function ur(e, t = (n) => n) {
883
894
  return e.slice().sort((n, r) => {
884
895
  let l = t(n), o = t(r);
885
896
  if (l === null || o === null) return 0;
@@ -887,8 +898,8 @@ function sr(e, t = (n) => n) {
887
898
  return a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
888
899
  });
889
900
  }
890
- function Oe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
891
- let o = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, a = Array.isArray(e) ? n ? sr(e) : e : t & 64 ? rr(e) : nr(e);
901
+ function Pe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
902
+ let o = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, a = Array.isArray(e) ? n ? ur(e) : e : t & 64 ? lr(e) : rr(e);
892
903
  l.length > 0 && a.length > 1 && (a = a.filter((w) => !l.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === w : d === w))), r = r ?? o.activeElement;
893
904
  let s = (() => {
894
905
  if (t & 5) return 1;
@@ -900,27 +911,27 @@ function Oe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] }
900
911
  if (t & 4) return Math.max(0, a.indexOf(r)) + 1;
901
912
  if (t & 8) return a.length - 1;
902
913
  throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
903
- })(), c = t & 32 ? { preventScroll: !0 } : {}, f = 0, y = a.length, b;
914
+ })(), c = t & 32 ? { preventScroll: !0 } : {}, f = 0, x = a.length, b;
904
915
  do {
905
- if (f >= y || f + y <= 0) return 0;
916
+ if (f >= x || f + x <= 0) return 0;
906
917
  let w = i + f;
907
- if (t & 16) w = (w + y) % y;
918
+ if (t & 16) w = (w + x) % x;
908
919
  else {
909
920
  if (w < 0) return 3;
910
- if (w >= y) return 1;
921
+ if (w >= x) return 1;
911
922
  }
912
923
  b = a[w], b == null || b.focus(c), f += s;
913
924
  } while (b !== o.activeElement);
914
- return t & 6 && ar(b) && b.select(), 2;
925
+ return t & 6 && sr(b) && b.select(), 2;
915
926
  }
916
- function Xt() {
927
+ function Vt() {
917
928
  return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
918
929
  }
919
- function ur() {
930
+ function cr() {
920
931
  return /Android/gi.test(window.navigator.userAgent);
921
932
  }
922
- function cr() {
923
- return Xt() || ur();
933
+ function dr() {
934
+ return Vt() || cr();
924
935
  }
925
936
  function ye(e, t, n, r) {
926
937
  let l = ue(n);
@@ -932,7 +943,7 @@ function ye(e, t, n, r) {
932
943
  return document.addEventListener(t, o, r), () => document.removeEventListener(t, o, r);
933
944
  }, [e, t, r]);
934
945
  }
935
- function Vt(e, t, n, r) {
946
+ function qt(e, t, n, r) {
936
947
  let l = ue(n);
937
948
  M(() => {
938
949
  if (!e) return;
@@ -942,17 +953,17 @@ function Vt(e, t, n, r) {
942
953
  return window.addEventListener(t, o, r), () => window.removeEventListener(t, o, r);
943
954
  }, [e, t, r]);
944
955
  }
945
- const $t = 30;
946
- function dr(e, t, n) {
947
- let r = fe(e, "outside-click"), l = ue(n), o = Y(function(i, c) {
956
+ const Tt = 30;
957
+ function fr(e, t, n) {
958
+ let r = me(e, "outside-click"), l = ue(n), o = Y(function(i, c) {
948
959
  if (i.defaultPrevented) return;
949
960
  let f = c(i);
950
961
  if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
951
- let y = function b(w) {
962
+ let x = function b(w) {
952
963
  return typeof w == "function" ? b(w()) : Array.isArray(w) || w instanceof Set ? w : [w];
953
964
  }(t);
954
- for (let b of y) if (b !== null && (b.contains(f) || i.composed && i.composedPath().includes(b))) return;
955
- return !lr(f, Bt.Loose) && f.tabIndex !== -1 && i.preventDefault(), l.current(i, f);
965
+ for (let b of x) if (b !== null && (b.contains(f) || i.composed && i.composedPath().includes(b))) return;
966
+ return !ir(f, Xt.Loose) && f.tabIndex !== -1 && i.preventDefault(), l.current(i, f);
956
967
  }, [l, t]), a = O(null);
957
968
  ye(r, "pointerdown", (i) => {
958
969
  var c, f;
@@ -961,20 +972,20 @@ function dr(e, t, n) {
961
972
  var c, f;
962
973
  a.current = ((f = (c = i.composedPath) == null ? void 0 : c.call(i)) == null ? void 0 : f[0]) || i.target;
963
974
  }, !0), ye(r, "click", (i) => {
964
- cr() || a.current && (o(i, () => a.current), a.current = null);
975
+ dr() || a.current && (o(i, () => a.current), a.current = null);
965
976
  }, !0);
966
977
  let s = O({ x: 0, y: 0 });
967
978
  ye(r, "touchstart", (i) => {
968
979
  s.current.x = i.touches[0].clientX, s.current.y = i.touches[0].clientY;
969
980
  }, !0), ye(r, "touchend", (i) => {
970
981
  let c = { x: i.changedTouches[0].clientX, y: i.changedTouches[0].clientY };
971
- if (!(Math.abs(c.x - s.current.x) >= $t || Math.abs(c.y - s.current.y) >= $t)) return o(i, () => i.target instanceof HTMLElement ? i.target : null);
972
- }, !0), Vt(r, "blur", (i) => o(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
982
+ if (!(Math.abs(c.x - s.current.x) >= Tt || Math.abs(c.y - s.current.y) >= Tt)) return o(i, () => i.target instanceof HTMLElement ? i.target : null);
983
+ }, !0), qt(r, "blur", (i) => o(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
973
984
  }
974
- function Me(...e) {
975
- return C(() => Ve(...e), [...e]);
985
+ function Le(...e) {
986
+ return C(() => qe(...e), [...e]);
976
987
  }
977
- function qt(e, t, n, r) {
988
+ function Yt(e, t, n, r) {
978
989
  let l = ue(n);
979
990
  M(() => {
980
991
  e = e ?? window;
@@ -984,7 +995,7 @@ function qt(e, t, n, r) {
984
995
  return e.addEventListener(t, o, r), () => e.removeEventListener(t, o, r);
985
996
  }, [e, t, r]);
986
997
  }
987
- function fr() {
998
+ function mr() {
988
999
  let e;
989
1000
  return { before({ doc: t }) {
990
1001
  var n;
@@ -995,8 +1006,8 @@ function fr() {
995
1006
  n.style(r, "paddingRight", `${o}px`);
996
1007
  } };
997
1008
  }
998
- function mr() {
999
- return Xt() ? { before({ doc: e, d: t, meta: n }) {
1009
+ function pr() {
1010
+ return Vt() ? { before({ doc: e, d: t, meta: n }) {
1000
1011
  function r(l) {
1001
1012
  return n.containers.flatMap((o) => o()).some((o) => o.contains(l));
1002
1013
  }
@@ -1038,17 +1049,17 @@ function mr() {
1038
1049
  });
1039
1050
  } } : {};
1040
1051
  }
1041
- function pr() {
1052
+ function hr() {
1042
1053
  return { before({ doc: e, d: t }) {
1043
1054
  t.style(e.documentElement, "overflow", "hidden");
1044
1055
  } };
1045
1056
  }
1046
- function hr(e) {
1057
+ function vr(e) {
1047
1058
  let t = {};
1048
1059
  for (let n of e) Object.assign(t, n(t));
1049
1060
  return t;
1050
1061
  }
1051
- let oe = Wt(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
1062
+ let oe = _t(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
1052
1063
  var n;
1053
1064
  let r = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: re(), meta: /* @__PURE__ */ new Set() };
1054
1065
  return r.count++, r.meta.add(t), this.set(e, r), this;
@@ -1056,7 +1067,7 @@ let oe = Wt(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
1056
1067
  let n = this.get(e);
1057
1068
  return n && (n.count--, n.meta.delete(t)), this;
1058
1069
  }, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
1059
- let r = { doc: e, d: t, meta: hr(n) }, l = [mr(), fr(), pr()];
1070
+ let r = { doc: e, d: t, meta: vr(n) }, l = [pr(), mr(), hr()];
1060
1071
  l.forEach(({ before: o }) => o == null ? void 0 : o(r)), l.forEach(({ after: o }) => o == null ? void 0 : o(r));
1061
1072
  }, SCROLL_ALLOW({ d: e }) {
1062
1073
  e.dispose();
@@ -1071,44 +1082,44 @@ oe.subscribe(() => {
1071
1082
  (l && !r || !l && r) && oe.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && oe.dispatch("TEARDOWN", n);
1072
1083
  }
1073
1084
  });
1074
- function vr(e, t, n = () => ({ containers: [] })) {
1075
- let r = _t(oe), l = t ? r.get(t) : void 0, o = l ? l.count > 0 : !1;
1076
- return A(() => {
1085
+ function gr(e, t, n = () => ({ containers: [] })) {
1086
+ let r = Bt(oe), l = t ? r.get(t) : void 0, o = l ? l.count > 0 : !1;
1087
+ return k(() => {
1077
1088
  if (!(!t || !e)) return oe.dispatch("PUSH", t, n), () => oe.dispatch("POP", t, n);
1078
1089
  }, [e, t]), o;
1079
1090
  }
1080
- function gr(e, t, n = () => [document.body]) {
1081
- let r = fe(e, "scroll-lock");
1082
- vr(r, t, (l) => {
1091
+ function wr(e, t, n = () => [document.body]) {
1092
+ let r = me(e, "scroll-lock");
1093
+ gr(r, t, (l) => {
1083
1094
  var o;
1084
1095
  return { containers: [...(o = l.containers) != null ? o : [], n] };
1085
1096
  });
1086
1097
  }
1087
- function wr(e = 0) {
1098
+ function xr(e = 0) {
1088
1099
  let [t, n] = S(e), r = Y((i) => n(i), [t]), l = Y((i) => n((c) => c | i), [t]), o = Y((i) => (t & i) === i, [t]), a = Y((i) => n((c) => c & ~i), [n]), s = Y((i) => n((c) => c ^ i), [n]);
1089
1100
  return { flags: t, setFlag: r, addFlag: l, hasFlag: o, removeFlag: a, toggleFlag: s };
1090
1101
  }
1091
- var Tt, Ot;
1092
- typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Tt = process == null ? void 0 : process.env) == null ? void 0 : Tt.NODE_ENV) === "test" && typeof ((Ot = Element == null ? void 0 : Element.prototype) == null ? void 0 : Ot.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
1102
+ var Ot, Pt;
1103
+ typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Ot = process == null ? void 0 : process.env) == null ? void 0 : Ot.NODE_ENV) === "test" && typeof ((Pt = Element == null ? void 0 : Element.prototype) == null ? void 0 : Pt.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
1093
1104
  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(`
1094
1105
  `)), [];
1095
1106
  });
1096
1107
  var yr = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(yr || {});
1097
- function xr(e) {
1108
+ function br(e) {
1098
1109
  let t = {};
1099
1110
  for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
1100
1111
  return t;
1101
1112
  }
1102
- function br(e, t, n, r) {
1103
- let [l, o] = S(n), { hasFlag: a, addFlag: s, removeFlag: i } = wr(e && l ? 3 : 0), c = O(!1), f = O(!1), y = pt();
1104
- return A(() => {
1113
+ function Er(e, t, n, r) {
1114
+ let [l, o] = S(n), { hasFlag: a, addFlag: s, removeFlag: i } = xr(e && l ? 3 : 0), c = O(!1), f = O(!1), x = ht();
1115
+ return k(() => {
1105
1116
  var b;
1106
1117
  if (e) {
1107
1118
  if (n && o(!0), !t) {
1108
1119
  n && s(3);
1109
1120
  return;
1110
1121
  }
1111
- return (b = r == null ? void 0 : r.start) == null || b.call(r, n), Er(t, { inFlight: c, prepare() {
1122
+ return (b = r == null ? void 0 : r.start) == null || b.call(r, n), $r(t, { inFlight: c, prepare() {
1112
1123
  f.current ? f.current = !1 : f.current = c.current, c.current = !0, !f.current && (n ? (s(3), i(4)) : (s(4), i(2)));
1113
1124
  }, run() {
1114
1125
  f.current ? n ? (i(3), s(4)) : (i(4), s(3)) : n ? i(1) : s(1);
@@ -1117,17 +1128,17 @@ function br(e, t, n, r) {
1117
1128
  f.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (c.current = !1, i(7), n || o(!1), (w = r == null ? void 0 : r.end) == null || w.call(r, n));
1118
1129
  } });
1119
1130
  }
1120
- }, [e, n, t, y]), e ? [l, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
1131
+ }, [e, n, t, x]), e ? [l, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
1121
1132
  }
1122
- function Er(e, { prepare: t, run: n, done: r, inFlight: l }) {
1133
+ function $r(e, { prepare: t, run: n, done: r, inFlight: l }) {
1123
1134
  let o = re();
1124
- return Tr(e, { prepare: t, inFlight: l }), o.nextFrame(() => {
1135
+ return Or(e, { prepare: t, inFlight: l }), o.nextFrame(() => {
1125
1136
  n(), o.requestAnimationFrame(() => {
1126
- o.add($r(e, r));
1137
+ o.add(Tr(e, r));
1127
1138
  });
1128
1139
  }), o.dispose;
1129
1140
  }
1130
- function $r(e, t) {
1141
+ function Tr(e, t) {
1131
1142
  var n, r;
1132
1143
  let l = re();
1133
1144
  if (!e) return l.dispose;
@@ -1140,7 +1151,7 @@ function $r(e, t) {
1140
1151
  o || t();
1141
1152
  }), l.dispose);
1142
1153
  }
1143
- function Tr(e, { inFlight: t, prepare: n }) {
1154
+ function Or(e, { inFlight: t, prepare: n }) {
1144
1155
  if (t != null && t.current) {
1145
1156
  n();
1146
1157
  return;
@@ -1148,7 +1159,7 @@ function Tr(e, { inFlight: t, prepare: n }) {
1148
1159
  let r = e.style.transition;
1149
1160
  e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
1150
1161
  }
1151
- function vt(e, t) {
1162
+ function gt(e, t) {
1152
1163
  let n = O([]), r = L(e);
1153
1164
  M(() => {
1154
1165
  let l = [...n.current];
@@ -1158,61 +1169,61 @@ function vt(e, t) {
1158
1169
  }
1159
1170
  }, [r, ...t]);
1160
1171
  }
1161
- let Ye = H(null);
1162
- Ye.displayName = "OpenClosedContext";
1172
+ let ze = H(null);
1173
+ ze.displayName = "OpenClosedContext";
1163
1174
  var z = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(z || {});
1164
- function ze() {
1165
- return R(Ye);
1175
+ function Ge() {
1176
+ return R(ze);
1166
1177
  }
1167
- function Or({ value: e, children: t }) {
1168
- return E.createElement(Ye.Provider, { value: e }, t);
1178
+ function Pr({ value: e, children: t }) {
1179
+ return E.createElement(ze.Provider, { value: e }, t);
1169
1180
  }
1170
- function Pr({ children: e }) {
1171
- return E.createElement(Ye.Provider, { value: null }, e);
1181
+ function Mr({ children: e }) {
1182
+ return E.createElement(ze.Provider, { value: null }, e);
1172
1183
  }
1173
- function Mr(e) {
1184
+ function Lr(e) {
1174
1185
  function t() {
1175
1186
  document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
1176
1187
  }
1177
1188
  typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
1178
1189
  }
1179
1190
  let ee = [];
1180
- Mr(() => {
1191
+ Lr(() => {
1181
1192
  function e(t) {
1182
1193
  if (!(t.target instanceof HTMLElement) || t.target === document.body || ee[0] === t.target) return;
1183
1194
  let n = t.target;
1184
- n = n.closest(We), ee.unshift(n ?? t.target), ee = ee.filter((r) => r != null && r.isConnected), ee.splice(10);
1195
+ n = n.closest(_e), ee.unshift(n ?? t.target), ee = ee.filter((r) => r != null && r.isConnected), ee.splice(10);
1185
1196
  }
1186
1197
  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 });
1187
1198
  });
1188
- function Yt(e) {
1199
+ function zt(e) {
1189
1200
  let t = L(e), n = O(!1);
1190
1201
  M(() => (n.current = !1, () => {
1191
- n.current = !0, qe(() => {
1202
+ n.current = !0, Ye(() => {
1192
1203
  n.current && t();
1193
1204
  });
1194
1205
  }), [t]);
1195
1206
  }
1196
- function Lr() {
1207
+ function Sr() {
1197
1208
  let e = typeof document > "u";
1198
- return "useSyncExternalStore" in Ee ? ((t) => t.useSyncExternalStore)(Ee)(() => () => {
1209
+ return "useSyncExternalStore" in $e ? ((t) => t.useSyncExternalStore)($e)(() => () => {
1199
1210
  }, () => !1, () => !e) : !1;
1200
1211
  }
1201
- function Le() {
1202
- let e = Lr(), [t, n] = Ee.useState(ae.isHandoffComplete);
1203
- return t && ae.isHandoffComplete === !1 && n(!1), Ee.useEffect(() => {
1212
+ function Se() {
1213
+ let e = Sr(), [t, n] = $e.useState(ae.isHandoffComplete);
1214
+ return t && ae.isHandoffComplete === !1 && n(!1), $e.useEffect(() => {
1204
1215
  t !== !0 && n(!0);
1205
- }, [t]), Ee.useEffect(() => ae.handoff(), []), e ? !1 : t;
1216
+ }, [t]), $e.useEffect(() => ae.handoff(), []), e ? !1 : t;
1206
1217
  }
1207
- let zt = H(!1);
1208
- function Sr() {
1209
- return R(zt);
1218
+ let Gt = H(!1);
1219
+ function Fr() {
1220
+ return R(Gt);
1210
1221
  }
1211
- function Pt(e) {
1212
- return E.createElement(zt.Provider, { value: e.force }, e.children);
1222
+ function Mt(e) {
1223
+ return E.createElement(Gt.Provider, { value: e.force }, e.children);
1213
1224
  }
1214
- function Fr(e) {
1215
- let t = Sr(), n = R(Kt), r = Me(e), [l, o] = S(() => {
1225
+ function Cr(e) {
1226
+ let t = Fr(), n = R(Zt), r = Le(e), [l, o] = S(() => {
1216
1227
  var a;
1217
1228
  if (!t && n !== null) return (a = n.current) != null ? a : null;
1218
1229
  if (ae.isServer) return null;
@@ -1228,54 +1239,54 @@ function Fr(e) {
1228
1239
  t || n !== null && o(n.current);
1229
1240
  }, [n, o, t]), l;
1230
1241
  }
1231
- let Gt = G, Cr = D(function(e, t) {
1232
- let n = e, r = O(null), l = Z(_n((y) => {
1233
- r.current = y;
1234
- }), t), o = Me(r), a = Fr(r), [s] = S(() => {
1235
- var y;
1236
- return ae.isServer ? null : (y = o == null ? void 0 : o.createElement("div")) != null ? y : null;
1237
- }), i = R(st), c = Le();
1238
- A(() => {
1242
+ let Kt = G, Nr = D(function(e, t) {
1243
+ let n = e, r = O(null), l = Z(Bn((x) => {
1244
+ r.current = x;
1245
+ }), t), o = Le(r), a = Cr(r), [s] = S(() => {
1246
+ var x;
1247
+ return ae.isServer ? null : (x = o == null ? void 0 : o.createElement("div")) != null ? x : null;
1248
+ }), i = R(ut), c = Se();
1249
+ k(() => {
1239
1250
  !a || !s || a.contains(s) || (s.setAttribute("data-headlessui-portal", ""), a.appendChild(s));
1240
- }, [a, s]), A(() => {
1251
+ }, [a, s]), k(() => {
1241
1252
  if (s && i) return i.register(s);
1242
- }, [i, s]), Yt(() => {
1243
- var y;
1244
- !a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((y = a.parentElement) == null || y.removeChild(a)));
1253
+ }, [i, s]), zt(() => {
1254
+ var x;
1255
+ !a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((x = a.parentElement) == null || x.removeChild(a)));
1245
1256
  });
1246
1257
  let f = W();
1247
- return c ? !a || !s ? null : En(f({ ourProps: { ref: l }, theirProps: n, slot: {}, defaultTag: Gt, name: "Portal" }), s) : null;
1258
+ return c ? !a || !s ? null : $n(f({ ourProps: { ref: l }, theirProps: n, slot: {}, defaultTag: Kt, name: "Portal" }), s) : null;
1248
1259
  });
1249
- function kr(e, t) {
1260
+ function Ar(e, t) {
1250
1261
  let n = Z(t), { enabled: r = !0, ...l } = e, o = W();
1251
- return r ? E.createElement(Cr, { ...l, ref: n }) : o({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag: Gt, name: "Portal" });
1262
+ return r ? E.createElement(Nr, { ...l, ref: n }) : o({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag: Kt, name: "Portal" });
1252
1263
  }
1253
- let Nr = G, Kt = H(null);
1254
- function Ar(e, t) {
1264
+ let kr = G, Zt = H(null);
1265
+ function Ir(e, t) {
1255
1266
  let { target: n, ...r } = e, l = { ref: Z(t) }, o = W();
1256
- return E.createElement(Kt.Provider, { value: n }, o({ ourProps: l, theirProps: r, defaultTag: Nr, name: "Popover.Group" }));
1267
+ return E.createElement(Zt.Provider, { value: n }, o({ ourProps: l, theirProps: r, defaultTag: kr, name: "Popover.Group" }));
1257
1268
  }
1258
- let st = H(null);
1259
- function Ir() {
1260
- let e = R(st), t = O([]), n = L((o) => (t.current.push(o), e && e.register(o), () => r(o))), r = L((o) => {
1269
+ let ut = H(null);
1270
+ function Rr() {
1271
+ let e = R(ut), t = O([]), n = L((o) => (t.current.push(o), e && e.register(o), () => r(o))), r = L((o) => {
1261
1272
  let a = t.current.indexOf(o);
1262
1273
  a !== -1 && t.current.splice(a, 1), e && e.unregister(o);
1263
1274
  }), l = C(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
1264
1275
  return [t, C(() => function({ children: o }) {
1265
- return E.createElement(st.Provider, { value: l }, o);
1276
+ return E.createElement(ut.Provider, { value: l }, o);
1266
1277
  }, [l])];
1267
1278
  }
1268
- let Rr = D(kr), Zt = D(Ar), Dr = Object.assign(Rr, { Group: Zt });
1269
- function jr(e, t = typeof document < "u" ? document.defaultView : null, n) {
1270
- let r = fe(e, "escape");
1271
- qt(t, "keydown", (l) => {
1272
- r && (l.defaultPrevented || l.key === Ht.Escape && n(l));
1279
+ let Dr = D(Ar), Jt = D(Ir), jr = Object.assign(Dr, { Group: Jt });
1280
+ function Ur(e, t = typeof document < "u" ? document.defaultView : null, n) {
1281
+ let r = me(e, "escape");
1282
+ Yt(t, "keydown", (l) => {
1283
+ r && (l.defaultPrevented || l.key === Wt.Escape && n(l));
1273
1284
  });
1274
1285
  }
1275
- function Ur() {
1286
+ function Hr() {
1276
1287
  var e;
1277
1288
  let [t] = S(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [n, r] = S((e = t == null ? void 0 : t.matches) != null ? e : !1);
1278
- return A(() => {
1289
+ return k(() => {
1279
1290
  if (!t) return;
1280
1291
  function l(o) {
1281
1292
  r(o.matches);
@@ -1283,8 +1294,8 @@ function Ur() {
1283
1294
  return t.addEventListener("change", l), () => t.removeEventListener("change", l);
1284
1295
  }, [t]), n;
1285
1296
  }
1286
- function Hr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
1287
- let r = Me(n), l = L(() => {
1297
+ function Wr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
1298
+ let r = Le(n), l = L(() => {
1288
1299
  var o, a;
1289
1300
  let s = [];
1290
1301
  for (let i of e) i !== null && (i instanceof HTMLElement ? s.push(i) : "current" in i && i.current instanceof HTMLElement && s.push(i.current));
@@ -1294,79 +1305,79 @@ function Hr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
1294
1305
  });
1295
1306
  return { resolveContainers: l, contains: L((o) => l().some((a) => a.contains(o))) };
1296
1307
  }
1297
- let Jt = H(null);
1298
- function Mt({ children: e, node: t }) {
1299
- let [n, r] = S(null), l = Qt(t ?? n);
1300
- return E.createElement(Jt.Provider, { value: l }, e, l === null && E.createElement(it, { features: He.Hidden, ref: (o) => {
1308
+ let Qt = H(null);
1309
+ function Lt({ children: e, node: t }) {
1310
+ let [n, r] = S(null), l = en(t ?? n);
1311
+ return E.createElement(Qt.Provider, { value: l }, e, l === null && E.createElement(ot, { features: We.Hidden, ref: (o) => {
1301
1312
  var a, s;
1302
1313
  if (o) {
1303
- for (let i of (s = (a = Ve(o)) == null ? void 0 : a.querySelectorAll("html > *, body > *")) != null ? s : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(o)) {
1314
+ for (let i of (s = (a = qe(o)) == null ? void 0 : a.querySelectorAll("html > *, body > *")) != null ? s : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(o)) {
1304
1315
  r(i);
1305
1316
  break;
1306
1317
  }
1307
1318
  }
1308
1319
  } }));
1309
1320
  }
1310
- function Qt(e = null) {
1321
+ function en(e = null) {
1311
1322
  var t;
1312
- return (t = R(Jt)) != null ? t : e;
1323
+ return (t = R(Qt)) != null ? t : e;
1313
1324
  }
1314
- function gt() {
1325
+ function wt() {
1315
1326
  let e = O(!1);
1316
- return A(() => (e.current = !0, () => {
1327
+ return k(() => (e.current = !0, () => {
1317
1328
  e.current = !1;
1318
1329
  }), []), e;
1319
1330
  }
1320
- var be = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(be || {});
1321
- function Wr() {
1331
+ var Ee = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ee || {});
1332
+ function _r() {
1322
1333
  let e = O(0);
1323
- return Vt(!0, "keydown", (t) => {
1334
+ return qt(!0, "keydown", (t) => {
1324
1335
  t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
1325
1336
  }, !0), e;
1326
1337
  }
1327
- function en(e) {
1338
+ function tn(e) {
1328
1339
  if (!e) return /* @__PURE__ */ new Set();
1329
1340
  if (typeof e == "function") return new Set(e());
1330
1341
  let t = /* @__PURE__ */ new Set();
1331
1342
  for (let n of e.current) n.current instanceof HTMLElement && t.add(n.current);
1332
1343
  return t;
1333
1344
  }
1334
- let _r = "div";
1345
+ let Br = "div";
1335
1346
  var ie = ((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))(ie || {});
1336
- function Br(e, t) {
1347
+ function Xr(e, t) {
1337
1348
  let n = O(null), r = Z(n, t), { initialFocus: l, initialFocusFallback: o, containers: a, features: s = 15, ...i } = e;
1338
- Le() || (s = 0);
1339
- let c = Me(n);
1340
- Yr(s, { ownerDocument: c });
1341
- let f = zr(s, { ownerDocument: c, container: n, initialFocus: l, initialFocusFallback: o });
1342
- Gr(s, { ownerDocument: c, container: n, containers: a, previousActiveElement: f });
1343
- let y = Wr(), b = L((p) => {
1344
- let g = n.current;
1345
- g && ((x) => x())(() => {
1346
- ne(y.current, { [be.Forwards]: () => {
1347
- Oe(g, J.First, { skipElements: [p.relatedTarget, o] });
1348
- }, [be.Backwards]: () => {
1349
- Oe(g, J.Last, { skipElements: [p.relatedTarget, o] });
1349
+ Se() || (s = 0);
1350
+ let c = Le(n);
1351
+ zr(s, { ownerDocument: c });
1352
+ let f = Gr(s, { ownerDocument: c, container: n, initialFocus: l, initialFocusFallback: o });
1353
+ Kr(s, { ownerDocument: c, container: n, containers: a, previousActiveElement: f });
1354
+ let x = _r(), b = L((p) => {
1355
+ let v = n.current;
1356
+ v && ((y) => y())(() => {
1357
+ ne(x.current, { [Ee.Forwards]: () => {
1358
+ Pe(v, J.First, { skipElements: [p.relatedTarget, o] });
1359
+ }, [Ee.Backwards]: () => {
1360
+ Pe(v, J.Last, { skipElements: [p.relatedTarget, o] });
1350
1361
  } });
1351
1362
  });
1352
- }), w = fe(!!(s & 2), "focus-trap#tab-lock"), d = pt(), v = O(!1), u = { ref: r, onKeyDown(p) {
1353
- p.key == "Tab" && (v.current = !0, d.requestAnimationFrame(() => {
1354
- v.current = !1;
1363
+ }), w = me(!!(s & 2), "focus-trap#tab-lock"), d = ht(), g = O(!1), u = { ref: r, onKeyDown(p) {
1364
+ p.key == "Tab" && (g.current = !0, d.requestAnimationFrame(() => {
1365
+ g.current = !1;
1355
1366
  }));
1356
1367
  }, onBlur(p) {
1357
1368
  if (!(s & 4)) return;
1358
- let g = en(a);
1359
- n.current instanceof HTMLElement && g.add(n.current);
1360
- let x = p.relatedTarget;
1361
- x instanceof HTMLElement && x.dataset.headlessuiFocusGuard !== "true" && (tn(g, x) || (v.current ? Oe(n.current, ne(y.current, { [be.Forwards]: () => J.Next, [be.Backwards]: () => J.Previous }) | J.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && Q(p.target)));
1369
+ let v = tn(a);
1370
+ n.current instanceof HTMLElement && v.add(n.current);
1371
+ let y = p.relatedTarget;
1372
+ y instanceof HTMLElement && y.dataset.headlessuiFocusGuard !== "true" && (nn(v, y) || (g.current ? Pe(n.current, ne(x.current, { [Ee.Forwards]: () => J.Next, [Ee.Backwards]: () => J.Previous }) | J.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && Q(p.target)));
1362
1373
  } }, m = W();
1363
- return E.createElement(E.Fragment, null, w && E.createElement(it, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: He.Focusable }), m({ ourProps: u, theirProps: i, defaultTag: _r, name: "FocusTrap" }), w && E.createElement(it, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: He.Focusable }));
1374
+ return E.createElement(E.Fragment, null, w && E.createElement(ot, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: We.Focusable }), m({ ourProps: u, theirProps: i, defaultTag: Br, name: "FocusTrap" }), w && E.createElement(ot, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: We.Focusable }));
1364
1375
  }
1365
- let Xr = D(Br), Vr = Object.assign(Xr, { features: ie });
1366
- function qr(e = !0) {
1376
+ let Vr = D(Xr), qr = Object.assign(Vr, { features: ie });
1377
+ function Yr(e = !0) {
1367
1378
  let t = O(ee.slice());
1368
- return vt(([n], [r]) => {
1369
- r === !0 && n === !1 && qe(() => {
1379
+ return gt(([n], [r]) => {
1380
+ r === !0 && n === !1 && Ye(() => {
1370
1381
  t.current.splice(0);
1371
1382
  }), r === !1 && n === !0 && (t.current = ee.slice());
1372
1383
  }, [e, ee, t]), L(() => {
@@ -1374,24 +1385,24 @@ function qr(e = !0) {
1374
1385
  return (n = t.current.find((r) => r != null && r.isConnected)) != null ? n : null;
1375
1386
  });
1376
1387
  }
1377
- function Yr(e, { ownerDocument: t }) {
1378
- let n = !!(e & 8), r = qr(n);
1379
- vt(() => {
1388
+ function zr(e, { ownerDocument: t }) {
1389
+ let n = !!(e & 8), r = Yr(n);
1390
+ gt(() => {
1380
1391
  n || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && Q(r());
1381
- }, [n]), Yt(() => {
1392
+ }, [n]), zt(() => {
1382
1393
  n && Q(r());
1383
1394
  });
1384
1395
  }
1385
- function zr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFallback: l }) {
1386
- let o = O(null), a = fe(!!(e & 1), "focus-trap#initial-focus"), s = gt();
1387
- return vt(() => {
1396
+ function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFallback: l }) {
1397
+ let o = O(null), a = me(!!(e & 1), "focus-trap#initial-focus"), s = wt();
1398
+ return gt(() => {
1388
1399
  if (e === 0) return;
1389
1400
  if (!a) {
1390
1401
  l != null && l.current && Q(l.current);
1391
1402
  return;
1392
1403
  }
1393
1404
  let i = n.current;
1394
- i && qe(() => {
1405
+ i && Ye(() => {
1395
1406
  if (!s.current) return;
1396
1407
  let c = t == null ? void 0 : t.activeElement;
1397
1408
  if (r != null && r.current) {
@@ -1406,8 +1417,8 @@ function zr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
1406
1417
  if (r != null && r.current) Q(r.current);
1407
1418
  else {
1408
1419
  if (e & 16) {
1409
- if (Oe(i, J.First | J.AutoFocus) !== at.Error) return;
1410
- } else if (Oe(i, J.First) !== at.Error) return;
1420
+ if (Pe(i, J.First | J.AutoFocus) !== st.Error) return;
1421
+ } else if (Pe(i, J.First) !== st.Error) return;
1411
1422
  if (l != null && l.current && (Q(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
1412
1423
  console.warn("There are no focusable elements inside the <FocusTrap />");
1413
1424
  }
@@ -1415,215 +1426,215 @@ function zr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
1415
1426
  });
1416
1427
  }, [l, a, e]), o;
1417
1428
  }
1418
- function Gr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
1419
- let o = gt(), a = !!(e & 4);
1420
- qt(t == null ? void 0 : t.defaultView, "focus", (s) => {
1429
+ function Kr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
1430
+ let o = wt(), a = !!(e & 4);
1431
+ Yt(t == null ? void 0 : t.defaultView, "focus", (s) => {
1421
1432
  if (!a || !o.current) return;
1422
- let i = en(r);
1433
+ let i = tn(r);
1423
1434
  n.current instanceof HTMLElement && i.add(n.current);
1424
1435
  let c = l.current;
1425
1436
  if (!c) return;
1426
1437
  let f = s.target;
1427
- f && f instanceof HTMLElement ? tn(i, f) ? (l.current = f, Q(f)) : (s.preventDefault(), s.stopPropagation(), Q(c)) : Q(l.current);
1438
+ f && f instanceof HTMLElement ? nn(i, f) ? (l.current = f, Q(f)) : (s.preventDefault(), s.stopPropagation(), Q(c)) : Q(l.current);
1428
1439
  }, !0);
1429
1440
  }
1430
- function tn(e, t) {
1441
+ function nn(e, t) {
1431
1442
  for (let n of e) if (n.contains(t)) return !0;
1432
1443
  return !1;
1433
1444
  }
1434
- function nn(e) {
1445
+ function rn(e) {
1435
1446
  var t;
1436
- return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : ln) !== G || E.Children.count(e.children) === 1;
1447
+ return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : on) !== G || E.Children.count(e.children) === 1;
1437
1448
  }
1438
- let Ge = H(null);
1439
- Ge.displayName = "TransitionContext";
1440
- var Kr = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Kr || {});
1441
- function Zr() {
1442
- let e = R(Ge);
1449
+ let Ke = H(null);
1450
+ Ke.displayName = "TransitionContext";
1451
+ var Zr = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Zr || {});
1452
+ function Jr() {
1453
+ let e = R(Ke);
1443
1454
  if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
1444
1455
  return e;
1445
1456
  }
1446
- function Jr() {
1447
- let e = R(Ke);
1457
+ function Qr() {
1458
+ let e = R(Ze);
1448
1459
  if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
1449
1460
  return e;
1450
1461
  }
1451
- let Ke = H(null);
1452
- Ke.displayName = "NestingContext";
1453
- function Ze(e) {
1454
- return "children" in e ? Ze(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
1455
- }
1456
- function rn(e, t) {
1457
- let n = ue(e), r = O([]), l = gt(), o = pt(), a = L((w, d = te.Hidden) => {
1458
- let v = r.current.findIndex(({ el: u }) => u === w);
1459
- v !== -1 && (ne(d, { [te.Unmount]() {
1460
- r.current.splice(v, 1);
1462
+ let Ze = H(null);
1463
+ Ze.displayName = "NestingContext";
1464
+ function Je(e) {
1465
+ return "children" in e ? Je(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
1466
+ }
1467
+ function ln(e, t) {
1468
+ let n = ue(e), r = O([]), l = wt(), o = ht(), a = L((w, d = te.Hidden) => {
1469
+ let g = r.current.findIndex(({ el: u }) => u === w);
1470
+ g !== -1 && (ne(d, { [te.Unmount]() {
1471
+ r.current.splice(g, 1);
1461
1472
  }, [te.Hidden]() {
1462
- r.current[v].state = "hidden";
1473
+ r.current[g].state = "hidden";
1463
1474
  } }), o.microTask(() => {
1464
1475
  var u;
1465
- !Ze(r) && l.current && ((u = n.current) == null || u.call(n));
1476
+ !Je(r) && l.current && ((u = n.current) == null || u.call(n));
1466
1477
  }));
1467
1478
  }), s = L((w) => {
1468
- let d = r.current.find(({ el: v }) => v === w);
1479
+ let d = r.current.find(({ el: g }) => g === w);
1469
1480
  return d ? d.state !== "visible" && (d.state = "visible") : r.current.push({ el: w, state: "visible" }), () => a(w, te.Unmount);
1470
- }), i = O([]), c = O(Promise.resolve()), f = O({ enter: [], leave: [] }), y = L((w, d, v) => {
1481
+ }), i = O([]), c = O(Promise.resolve()), f = O({ enter: [], leave: [] }), x = L((w, d, g) => {
1471
1482
  i.current.splice(0), t && (t.chains.current[d] = t.chains.current[d].filter(([u]) => u !== w)), t == null || t.chains.current[d].push([w, new Promise((u) => {
1472
1483
  i.current.push(u);
1473
1484
  })]), t == null || t.chains.current[d].push([w, new Promise((u) => {
1474
1485
  Promise.all(f.current[d].map(([m, p]) => p)).then(() => u());
1475
- })]), d === "enter" ? c.current = c.current.then(() => t == null ? void 0 : t.wait.current).then(() => v(d)) : v(d);
1476
- }), b = L((w, d, v) => {
1486
+ })]), d === "enter" ? c.current = c.current.then(() => t == null ? void 0 : t.wait.current).then(() => g(d)) : g(d);
1487
+ }), b = L((w, d, g) => {
1477
1488
  Promise.all(f.current[d].splice(0).map(([u, m]) => m)).then(() => {
1478
1489
  var u;
1479
1490
  (u = i.current.shift()) == null || u();
1480
- }).then(() => v(d));
1491
+ }).then(() => g(d));
1481
1492
  });
1482
- return C(() => ({ children: r, register: s, unregister: a, onStart: y, onStop: b, wait: c, chains: f }), [s, a, r, y, b, f, c]);
1493
+ return C(() => ({ children: r, register: s, unregister: a, onStart: x, onStop: b, wait: c, chains: f }), [s, a, r, x, b, f, c]);
1483
1494
  }
1484
- let ln = G, on = Ue.RenderStrategy;
1485
- function Qr(e, t) {
1495
+ let on = G, an = He.RenderStrategy;
1496
+ function el(e, t) {
1486
1497
  var n, r;
1487
- let { transition: l = !0, beforeEnter: o, afterEnter: a, beforeLeave: s, afterLeave: i, enter: c, enterFrom: f, enterTo: y, entered: b, leave: w, leaveFrom: d, leaveTo: v, ...u } = e, [m, p] = S(null), g = O(null), x = nn(e), h = Z(...x ? [g, t, p] : t === null ? [] : [t]), $ = (n = u.unmount) == null || n ? te.Unmount : te.Hidden, { show: F, appear: j, initial: _ } = Zr(), [N, U] = S(F ? "visible" : "hidden"), B = Jr(), { register: X, unregister: P } = B;
1488
- A(() => X(g), [X, g]), A(() => {
1489
- if ($ === te.Hidden && g.current) {
1490
- if (F && N !== "visible") {
1498
+ let { transition: l = !0, beforeEnter: o, afterEnter: a, beforeLeave: s, afterLeave: i, enter: c, enterFrom: f, enterTo: x, entered: b, leave: w, leaveFrom: d, leaveTo: g, ...u } = e, [m, p] = S(null), v = O(null), y = rn(e), h = Z(...y ? [v, t, p] : t === null ? [] : [t]), $ = (n = u.unmount) == null || n ? te.Unmount : te.Hidden, { show: F, appear: j, initial: _ } = Jr(), [A, U] = S(F ? "visible" : "hidden"), B = Qr(), { register: X, unregister: P } = B;
1499
+ k(() => X(v), [X, v]), k(() => {
1500
+ if ($ === te.Hidden && v.current) {
1501
+ if (F && A !== "visible") {
1491
1502
  U("visible");
1492
1503
  return;
1493
1504
  }
1494
- return ne(N, { hidden: () => P(g), visible: () => X(g) });
1505
+ return ne(A, { hidden: () => P(v), visible: () => X(v) });
1495
1506
  }
1496
- }, [N, g, X, P, F, $]);
1497
- let V = Le();
1498
- A(() => {
1499
- if (x && V && N === "visible" && g.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1500
- }, [g, N, V, x]);
1501
- let Se = _ && !j, Fe = j && F && _, pe = O(!1), K = rn(() => {
1502
- pe.current || (U("hidden"), P(g));
1503
- }, B), Ce = L((Qe) => {
1504
- pe.current = !0;
1505
- let Ne = Qe ? "enter" : "leave";
1506
- K.onStart(g, Ne, (ve) => {
1507
- ve === "enter" ? o == null || o() : ve === "leave" && (s == null || s());
1507
+ }, [A, v, X, P, F, $]);
1508
+ let V = Se();
1509
+ k(() => {
1510
+ if (y && V && A === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1511
+ }, [v, A, V, y]);
1512
+ let Fe = _ && !j, Ce = j && F && _, he = O(!1), K = ln(() => {
1513
+ he.current || (U("hidden"), P(v));
1514
+ }, B), Ne = L((et) => {
1515
+ he.current = !0;
1516
+ let ke = et ? "enter" : "leave";
1517
+ K.onStart(v, ke, (ge) => {
1518
+ ge === "enter" ? o == null || o() : ge === "leave" && (s == null || s());
1508
1519
  });
1509
- }), k = L((Qe) => {
1510
- let Ne = Qe ? "enter" : "leave";
1511
- pe.current = !1, K.onStop(g, Ne, (ve) => {
1512
- ve === "enter" ? a == null || a() : ve === "leave" && (i == null || i());
1513
- }), Ne === "leave" && !Ze(K) && (U("hidden"), P(g));
1520
+ }), N = L((et) => {
1521
+ let ke = et ? "enter" : "leave";
1522
+ he.current = !1, K.onStop(v, ke, (ge) => {
1523
+ ge === "enter" ? a == null || a() : ge === "leave" && (i == null || i());
1524
+ }), ke === "leave" && !Je(K) && (U("hidden"), P(v));
1514
1525
  });
1515
1526
  M(() => {
1516
- x && l || (Ce(F), k(F));
1517
- }, [F, x, l]);
1518
- let ke = !(!l || !x || !V || Se), [, I] = br(ke, m, F, { start: Ce, end: k }), cn = le({ ref: h, className: ((r = lt(u.className, Fe && c, Fe && f, I.enter && c, I.enter && I.closed && f, I.enter && !I.closed && y, I.leave && w, I.leave && !I.closed && d, I.leave && I.closed && v, !I.transition && F && b)) == null ? void 0 : r.trim()) || void 0, ...xr(I) }), he = 0;
1519
- N === "visible" && (he |= z.Open), N === "hidden" && (he |= z.Closed), I.enter && (he |= z.Opening), I.leave && (he |= z.Closing);
1520
- let dn = W();
1521
- return E.createElement(Ke.Provider, { value: K }, E.createElement(Or, { value: he }, dn({ ourProps: cn, theirProps: u, defaultTag: ln, features: on, visible: N === "visible", name: "Transition.Child" })));
1527
+ y && l || (Ne(F), N(F));
1528
+ }, [F, y, l]);
1529
+ let Ae = !(!l || !y || !V || Fe), [, I] = Er(Ae, m, F, { start: Ne, end: N }), dn = le({ ref: h, className: ((r = it(u.className, Ce && c, Ce && f, I.enter && c, I.enter && I.closed && f, I.enter && !I.closed && x, I.leave && w, I.leave && !I.closed && d, I.leave && I.closed && g, !I.transition && F && b)) == null ? void 0 : r.trim()) || void 0, ...br(I) }), ve = 0;
1530
+ A === "visible" && (ve |= z.Open), A === "hidden" && (ve |= z.Closed), I.enter && (ve |= z.Opening), I.leave && (ve |= z.Closing);
1531
+ let fn = W();
1532
+ return E.createElement(Ze.Provider, { value: K }, E.createElement(Pr, { value: ve }, fn({ ourProps: dn, theirProps: u, defaultTag: on, features: an, visible: A === "visible", name: "Transition.Child" })));
1522
1533
  }
1523
- function el(e, t) {
1524
- let { show: n, appear: r = !1, unmount: l = !0, ...o } = e, a = O(null), s = nn(e), i = Z(...s ? [a, t] : t === null ? [] : [t]);
1525
- Le();
1526
- let c = ze();
1534
+ function tl(e, t) {
1535
+ let { show: n, appear: r = !1, unmount: l = !0, ...o } = e, a = O(null), s = rn(e), i = Z(...s ? [a, t] : t === null ? [] : [t]);
1536
+ Se();
1537
+ let c = Ge();
1527
1538
  if (n === void 0 && c !== null && (n = (c & z.Open) === z.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
1528
- let [f, y] = S(n ? "visible" : "hidden"), b = rn(() => {
1529
- n || y("hidden");
1530
- }), [w, d] = S(!0), v = O([n]);
1531
- A(() => {
1532
- w !== !1 && v.current[v.current.length - 1] !== n && (v.current.push(n), d(!1));
1533
- }, [v, n]);
1539
+ let [f, x] = S(n ? "visible" : "hidden"), b = ln(() => {
1540
+ n || x("hidden");
1541
+ }), [w, d] = S(!0), g = O([n]);
1542
+ k(() => {
1543
+ w !== !1 && g.current[g.current.length - 1] !== n && (g.current.push(n), d(!1));
1544
+ }, [g, n]);
1534
1545
  let u = C(() => ({ show: n, appear: r, initial: w }), [n, r, w]);
1535
- A(() => {
1536
- n ? y("visible") : !Ze(b) && a.current !== null && y("hidden");
1546
+ k(() => {
1547
+ n ? x("visible") : !Je(b) && a.current !== null && x("hidden");
1537
1548
  }, [n, b]);
1538
1549
  let m = { unmount: l }, p = L(() => {
1539
1550
  var h;
1540
1551
  w && d(!1), (h = e.beforeEnter) == null || h.call(e);
1541
- }), g = L(() => {
1552
+ }), v = L(() => {
1542
1553
  var h;
1543
1554
  w && d(!1), (h = e.beforeLeave) == null || h.call(e);
1544
- }), x = W();
1545
- return E.createElement(Ke.Provider, { value: b }, E.createElement(Ge.Provider, { value: u }, x({ ourProps: { ...m, as: G, children: E.createElement(an, { ref: i, ...m, ...o, beforeEnter: p, beforeLeave: g }) }, theirProps: {}, defaultTag: G, features: on, visible: f === "visible", name: "Transition" })));
1555
+ }), y = W();
1556
+ return E.createElement(Ze.Provider, { value: b }, E.createElement(Ke.Provider, { value: u }, y({ ourProps: { ...m, as: G, children: E.createElement(sn, { ref: i, ...m, ...o, beforeEnter: p, beforeLeave: v }) }, theirProps: {}, defaultTag: G, features: an, visible: f === "visible", name: "Transition" })));
1546
1557
  }
1547
- function tl(e, t) {
1548
- let n = R(Ge) !== null, r = ze() !== null;
1549
- return E.createElement(E.Fragment, null, !n && r ? E.createElement(ut, { ref: t, ...e }) : E.createElement(an, { ref: t, ...e }));
1558
+ function nl(e, t) {
1559
+ let n = R(Ke) !== null, r = Ge() !== null;
1560
+ return E.createElement(E.Fragment, null, !n && r ? E.createElement(ct, { ref: t, ...e }) : E.createElement(sn, { ref: t, ...e }));
1550
1561
  }
1551
- let ut = D(el), an = D(Qr), me = D(tl), sn = Object.assign(ut, { Child: me, Root: ut });
1552
- var nl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(nl || {}), rl = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(rl || {});
1553
- let ll = { 0(e, t) {
1562
+ let ct = D(tl), sn = D(el), pe = D(nl), un = Object.assign(ct, { Child: pe, Root: ct });
1563
+ var rl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(rl || {}), ll = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(ll || {});
1564
+ let il = { 0(e, t) {
1554
1565
  return e.titleId === t.id ? e : { ...e, titleId: t.id };
1555
- } }, wt = H(null);
1556
- wt.displayName = "DialogContext";
1557
- function Je(e) {
1558
- let t = R(wt);
1566
+ } }, xt = H(null);
1567
+ xt.displayName = "DialogContext";
1568
+ function Qe(e) {
1569
+ let t = R(xt);
1559
1570
  if (t === null) {
1560
1571
  let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
1561
- throw Error.captureStackTrace && Error.captureStackTrace(n, Je), n;
1572
+ throw Error.captureStackTrace && Error.captureStackTrace(n, Qe), n;
1562
1573
  }
1563
1574
  return t;
1564
1575
  }
1565
- function il(e, t) {
1566
- return ne(t.type, ll, e, t);
1576
+ function ol(e, t) {
1577
+ return ne(t.type, il, e, t);
1567
1578
  }
1568
- let Lt = D(function(e, t) {
1569
- let n = Pe(), { id: r = `headlessui-dialog-${n}`, open: l, onClose: o, initialFocus: a, role: s = "dialog", autoFocus: i = !0, __demoMode: c = !1, unmount: f = !1, ...y } = e, b = O(!1);
1579
+ let St = D(function(e, t) {
1580
+ let n = Me(), { id: r = `headlessui-dialog-${n}`, open: l, onClose: o, initialFocus: a, role: s = "dialog", autoFocus: i = !0, __demoMode: c = !1, unmount: f = !1, ...x } = e, b = O(!1);
1570
1581
  s = function() {
1571
1582
  return s === "dialog" || s === "alertdialog" ? s : (b.current || (b.current = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
1572
1583
  }();
1573
- let w = ze();
1584
+ let w = Ge();
1574
1585
  l === void 0 && w !== null && (l = (w & z.Open) === z.Open);
1575
- let d = O(null), v = Z(d, t), u = Me(d), m = l ? 0 : 1, [p, g] = wn(il, { titleId: null, descriptionId: null, panelRef: yn() }), x = L(() => o(!1)), h = L((k) => g({ type: 0, id: k })), $ = Le() ? m === 0 : !1, [F, j] = Ir(), _ = { get current() {
1576
- var k;
1577
- return (k = p.panelRef.current) != null ? k : d.current;
1578
- } }, N = Qt(), { resolveContainers: U } = Hr({ mainTreeNode: N, portals: F, defaultContainers: [_] }), B = w !== null ? (w & z.Closing) === z.Closing : !1;
1579
- Jn(c || B ? !1 : $, { allowed: L(() => {
1580
- var k, ke;
1581
- return [(ke = (k = d.current) == null ? void 0 : k.closest("[data-headlessui-portal]")) != null ? ke : null];
1586
+ let d = O(null), g = Z(d, t), u = Le(d), m = l ? 0 : 1, [p, v] = xn(ol, { titleId: null, descriptionId: null, panelRef: yn() }), y = L(() => o(!1)), h = L((N) => v({ type: 0, id: N })), $ = Se() ? m === 0 : !1, [F, j] = Rr(), _ = { get current() {
1587
+ var N;
1588
+ return (N = p.panelRef.current) != null ? N : d.current;
1589
+ } }, A = en(), { resolveContainers: U } = Wr({ mainTreeNode: A, portals: F, defaultContainers: [_] }), B = w !== null ? (w & z.Closing) === z.Closing : !1;
1590
+ Qn(c || B ? !1 : $, { allowed: L(() => {
1591
+ var N, Ae;
1592
+ return [(Ae = (N = d.current) == null ? void 0 : N.closest("[data-headlessui-portal]")) != null ? Ae : null];
1582
1593
  }), disallowed: L(() => {
1583
- var k;
1584
- return [(k = N == null ? void 0 : N.closest("body > *:not(#headlessui-portal-root)")) != null ? k : null];
1585
- }) }), dr($, U, (k) => {
1586
- k.preventDefault(), x();
1587
- }), jr($, u == null ? void 0 : u.defaultView, (k) => {
1588
- k.preventDefault(), k.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), x();
1589
- }), gr(c || B ? !1 : $, u, U), Qn($, d, x);
1590
- let [X, P] = Bn(), V = C(() => [{ dialogState: m, close: x, setTitleId: h, unmount: f }, p], [m, p, x, h, f]), Se = C(() => ({ open: m === 0 }), [m]), Fe = { ref: v, id: r, role: s, tabIndex: -1, "aria-modal": c ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": p.titleId, "aria-describedby": X, unmount: f }, pe = !Ur(), K = ie.None;
1591
- $ && !c && (K |= ie.RestoreFocus, K |= ie.TabLock, i && (K |= ie.AutoFocus), pe && (K |= ie.InitialFocus));
1592
- let Ce = W();
1593
- return E.createElement(Pr, null, E.createElement(Pt, { force: !0 }, E.createElement(Dr, null, E.createElement(wt.Provider, { value: V }, E.createElement(Zt, { target: d }, E.createElement(Pt, { force: !1 }, E.createElement(P, { slot: Se }, E.createElement(j, null, E.createElement(Vr, { initialFocus: a, initialFocusFallback: d, containers: U, features: K }, E.createElement(Gn, { value: x }, Ce({ ourProps: Fe, theirProps: y, slot: Se, defaultTag: ol, features: al, visible: m === 0, name: "Dialog" })))))))))));
1594
- }), ol = "div", al = Ue.RenderStrategy | Ue.Static;
1595
- function sl(e, t) {
1596
- let { transition: n = !1, open: r, ...l } = e, o = ze(), a = e.hasOwnProperty("open") || o !== null, s = e.hasOwnProperty("onClose");
1594
+ var N;
1595
+ return [(N = A == null ? void 0 : A.closest("body > *:not(#headlessui-portal-root)")) != null ? N : null];
1596
+ }) }), fr($, U, (N) => {
1597
+ N.preventDefault(), y();
1598
+ }), Ur($, u == null ? void 0 : u.defaultView, (N) => {
1599
+ N.preventDefault(), N.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), y();
1600
+ }), wr(c || B ? !1 : $, u, U), er($, d, y);
1601
+ let [X, P] = Xn(), V = C(() => [{ dialogState: m, close: y, setTitleId: h, unmount: f }, p], [m, p, y, h, f]), Fe = C(() => ({ open: m === 0 }), [m]), Ce = { ref: g, id: r, role: s, tabIndex: -1, "aria-modal": c ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": p.titleId, "aria-describedby": X, unmount: f }, he = !Hr(), K = ie.None;
1602
+ $ && !c && (K |= ie.RestoreFocus, K |= ie.TabLock, i && (K |= ie.AutoFocus), he && (K |= ie.InitialFocus));
1603
+ let Ne = W();
1604
+ return E.createElement(Mr, null, E.createElement(Mt, { force: !0 }, E.createElement(jr, null, E.createElement(xt.Provider, { value: V }, E.createElement(Jt, { target: d }, E.createElement(Mt, { force: !1 }, E.createElement(P, { slot: Fe }, E.createElement(j, null, E.createElement(qr, { initialFocus: a, initialFocusFallback: d, containers: U, features: K }, E.createElement(Kn, { value: y }, Ne({ ourProps: Ce, theirProps: x, slot: Fe, defaultTag: al, features: sl, visible: m === 0, name: "Dialog" })))))))))));
1605
+ }), al = "div", sl = He.RenderStrategy | He.Static;
1606
+ function ul(e, t) {
1607
+ let { transition: n = !1, open: r, ...l } = e, o = Ge(), a = e.hasOwnProperty("open") || o !== null, s = e.hasOwnProperty("onClose");
1597
1608
  if (!a && !s) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
1598
1609
  if (!a) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
1599
1610
  if (!s) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
1600
1611
  if (!o && 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}`);
1601
1612
  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}`);
1602
- return (r !== void 0 || n) && !l.static ? E.createElement(Mt, null, E.createElement(sn, { show: r, transition: n, unmount: l.unmount }, E.createElement(Lt, { ref: t, ...l }))) : E.createElement(Mt, null, E.createElement(Lt, { ref: t, open: r, ...l }));
1613
+ return (r !== void 0 || n) && !l.static ? E.createElement(Lt, null, E.createElement(un, { show: r, transition: n, unmount: l.unmount }, E.createElement(St, { ref: t, ...l }))) : E.createElement(Lt, null, E.createElement(St, { ref: t, open: r, ...l }));
1603
1614
  }
1604
- let ul = "div";
1605
- function cl(e, t) {
1606
- let n = Pe(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...o } = e, [{ dialogState: a, unmount: s }, i] = Je("Dialog.Panel"), c = Z(t, i.panelRef), f = C(() => ({ open: a === 0 }), [a]), y = L((u) => {
1615
+ let cl = "div";
1616
+ function dl(e, t) {
1617
+ let n = Me(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...o } = e, [{ dialogState: a, unmount: s }, i] = Qe("Dialog.Panel"), c = Z(t, i.panelRef), f = C(() => ({ open: a === 0 }), [a]), x = L((u) => {
1607
1618
  u.stopPropagation();
1608
- }), b = { ref: c, id: r, onClick: y }, w = l ? me : G, d = l ? { unmount: s } : {}, v = W();
1609
- return E.createElement(w, { ...d }, v({ ourProps: b, theirProps: o, slot: f, defaultTag: ul, name: "Dialog.Panel" }));
1619
+ }), b = { ref: c, id: r, onClick: x }, w = l ? pe : G, d = l ? { unmount: s } : {}, g = W();
1620
+ return E.createElement(w, { ...d }, g({ ourProps: b, theirProps: o, slot: f, defaultTag: cl, name: "Dialog.Panel" }));
1610
1621
  }
1611
- let dl = "div";
1612
- function fl(e, t) {
1613
- let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount: o }] = Je("Dialog.Backdrop"), a = C(() => ({ open: l === 0 }), [l]), s = { ref: t, "aria-hidden": !0 }, i = n ? me : G, c = n ? { unmount: o } : {}, f = W();
1614
- return E.createElement(i, { ...c }, f({ ourProps: s, theirProps: r, slot: a, defaultTag: dl, name: "Dialog.Backdrop" }));
1622
+ let fl = "div";
1623
+ function ml(e, t) {
1624
+ let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount: o }] = Qe("Dialog.Backdrop"), a = C(() => ({ open: l === 0 }), [l]), s = { ref: t, "aria-hidden": !0 }, i = n ? pe : G, c = n ? { unmount: o } : {}, f = W();
1625
+ return E.createElement(i, { ...c }, f({ ourProps: s, theirProps: r, slot: a, defaultTag: fl, name: "Dialog.Backdrop" }));
1615
1626
  }
1616
- let ml = "h2";
1617
- function pl(e, t) {
1618
- let n = Pe(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState: o, setTitleId: a }] = Je("Dialog.Title"), s = Z(t);
1627
+ let pl = "h2";
1628
+ function hl(e, t) {
1629
+ let n = Me(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState: o, setTitleId: a }] = Qe("Dialog.Title"), s = Z(t);
1619
1630
  M(() => (a(r), () => a(null)), [r, a]);
1620
1631
  let i = C(() => ({ open: o === 0 }), [o]), c = { ref: s, id: r };
1621
- return W()({ ourProps: c, theirProps: l, slot: i, defaultTag: ml, name: "Dialog.Title" });
1632
+ return W()({ ourProps: c, theirProps: l, slot: i, defaultTag: pl, name: "Dialog.Title" });
1622
1633
  }
1623
- let hl = D(sl), yt = D(cl);
1624
- D(fl);
1625
- let vl = D(pl), gl = Object.assign(hl, { Panel: yt, Title: vl, Description: Yn });
1626
- function un({ onClick: e }) {
1634
+ let vl = D(ul), yt = D(dl);
1635
+ D(ml);
1636
+ let gl = D(hl), wl = Object.assign(vl, { Panel: yt, Title: gl, Description: zn });
1637
+ function cn({ onClick: e }) {
1627
1638
  return /* @__PURE__ */ se(
1628
1639
  "button",
1629
1640
  {
@@ -1656,18 +1667,18 @@ function un({ onClick: e }) {
1656
1667
  }
1657
1668
  );
1658
1669
  }
1659
- const wl = ({ modalContext: e, config: t, children: n }) => {
1670
+ const xl = ({ modalContext: e, config: t, children: n }) => {
1660
1671
  const [r, l] = S(!1);
1661
1672
  return /* @__PURE__ */ T("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ T(
1662
1673
  "div",
1663
1674
  {
1664
- className: je("im-modal-positioner flex min-h-full justify-center", {
1675
+ className: Ue("im-modal-positioner flex min-h-full justify-center", {
1665
1676
  "items-start": t.position === "top",
1666
1677
  "items-center": t.position === "center",
1667
1678
  "items-end": t.position === "bottom"
1668
1679
  }),
1669
1680
  children: /* @__PURE__ */ T(
1670
- me,
1681
+ pe,
1671
1682
  {
1672
1683
  as: "div",
1673
1684
  enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
@@ -1676,7 +1687,7 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1676
1687
  leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
1677
1688
  afterEnter: () => l(!0),
1678
1689
  afterLeave: e.afterLeave,
1679
- className: je("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
1690
+ className: Ue("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
1680
1691
  "sm:max-w-sm": t.maxWidth === "sm",
1681
1692
  "sm:max-w-md": t.maxWidth === "md",
1682
1693
  "sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
@@ -1694,7 +1705,7 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1694
1705
  className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
1695
1706
  "data-inertiaui-modal-entered": r,
1696
1707
  children: [
1697
- t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(un, { onClick: e.close }) }),
1708
+ t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(cn, { onClick: e.close }) }),
1698
1709
  typeof n == "function" ? n({ modalContext: e, config: t }) : n
1699
1710
  ]
1700
1711
  }
@@ -1708,12 +1719,12 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1708
1719
  return /* @__PURE__ */ T("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ T(
1709
1720
  "div",
1710
1721
  {
1711
- className: je("im-slideover-positioner flex min-h-full items-center", {
1722
+ className: Ue("im-slideover-positioner flex min-h-full items-center", {
1712
1723
  "justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
1713
1724
  "justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
1714
1725
  }),
1715
1726
  children: /* @__PURE__ */ T(
1716
- me,
1727
+ pe,
1717
1728
  {
1718
1729
  as: "div",
1719
1730
  enterFrom: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
@@ -1722,7 +1733,7 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1722
1733
  leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
1723
1734
  afterEnter: () => l(!0),
1724
1735
  afterLeave: e.afterLeave,
1725
- className: je("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
1736
+ className: Ue("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
1726
1737
  "sm:max-w-sm": t.maxWidth === "sm",
1727
1738
  "sm:max-w-md": t.maxWidth === "md",
1728
1739
  "sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
@@ -1740,7 +1751,7 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1740
1751
  className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
1741
1752
  "data-inertiaui-modal-entered": r,
1742
1753
  children: [
1743
- t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(un, { onClick: e.close }) }),
1754
+ t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(cn, { onClick: e.close }) }),
1744
1755
  typeof n == "function" ? n({ modalContext: e, config: t }) : n
1745
1756
  ]
1746
1757
  }
@@ -1749,10 +1760,10 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1749
1760
  )
1750
1761
  }
1751
1762
  ) });
1752
- }, xl = ct(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, onAfterLeave: a = null, ...s }, i) => {
1753
- const c = (y) => typeof t == "function" ? t(y) : t, f = O(null);
1754
- return St(i, () => f.current, [f]), /* @__PURE__ */ T(
1755
- It,
1763
+ }, bl = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, onAfterLeave: a = null, ...s }, i) => {
1764
+ const c = (x) => typeof t == "function" ? t(x) : t, f = O(null);
1765
+ return Ft(i, () => f.current, [f]), /* @__PURE__ */ T(
1766
+ Rt,
1756
1767
  {
1757
1768
  ref: f,
1758
1769
  name: e,
@@ -1762,28 +1773,28 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1762
1773
  onSuccess: o,
1763
1774
  ...s,
1764
1775
  children: ({
1765
- afterLeave: y,
1776
+ afterLeave: x,
1766
1777
  close: b,
1767
1778
  config: w,
1768
1779
  emit: d,
1769
- getChildModal: v,
1780
+ getChildModal: g,
1770
1781
  getParentModal: u,
1771
1782
  id: m,
1772
1783
  index: p,
1773
- isOpen: g,
1774
- modalContext: x,
1784
+ isOpen: v,
1785
+ modalContext: y,
1775
1786
  onTopOfStack: h,
1776
1787
  reload: $,
1777
1788
  setOpen: F,
1778
1789
  shouldRender: j
1779
1790
  }) => /* @__PURE__ */ T(
1780
- sn,
1791
+ un,
1781
1792
  {
1782
1793
  appear: !0,
1783
- show: g ?? !1,
1794
+ show: v ?? !1,
1784
1795
  afterLeave: a,
1785
1796
  children: /* @__PURE__ */ se(
1786
- gl,
1797
+ wl,
1787
1798
  {
1788
1799
  as: "div",
1789
1800
  className: "im-dialog relative z-20",
@@ -1792,7 +1803,7 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1792
1803
  "data-inertiaui-modal-index": p,
1793
1804
  children: [
1794
1805
  p === 0 ? /* @__PURE__ */ T(
1795
- me,
1806
+ pe,
1796
1807
  {
1797
1808
  enter: "transition transform ease-in-out duration-300",
1798
1809
  enterFrom: "opacity-0",
@@ -1813,19 +1824,19 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1813
1824
  w.slideover ? /* @__PURE__ */ T(
1814
1825
  yl,
1815
1826
  {
1816
- modalContext: x,
1827
+ modalContext: y,
1817
1828
  config: w,
1818
1829
  children: c({
1819
- afterLeave: y,
1830
+ afterLeave: x,
1820
1831
  close: b,
1821
1832
  config: w,
1822
1833
  emit: d,
1823
- getChildModal: v,
1834
+ getChildModal: g,
1824
1835
  getParentModal: u,
1825
1836
  id: m,
1826
1837
  index: p,
1827
- isOpen: g,
1828
- modalContext: x,
1838
+ isOpen: v,
1839
+ modalContext: y,
1829
1840
  onTopOfStack: h,
1830
1841
  reload: $,
1831
1842
  setOpen: F,
@@ -1833,21 +1844,21 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1833
1844
  })
1834
1845
  }
1835
1846
  ) : /* @__PURE__ */ T(
1836
- wl,
1847
+ xl,
1837
1848
  {
1838
- modalContext: x,
1849
+ modalContext: y,
1839
1850
  config: w,
1840
1851
  children: c({
1841
- afterLeave: y,
1852
+ afterLeave: x,
1842
1853
  close: b,
1843
1854
  config: w,
1844
1855
  emit: d,
1845
- getChildModal: v,
1856
+ getChildModal: g,
1846
1857
  getParentModal: u,
1847
1858
  id: m,
1848
1859
  index: p,
1849
- isOpen: g,
1850
- modalContext: x,
1860
+ isOpen: v,
1861
+ modalContext: y,
1851
1862
  onTopOfStack: h,
1852
1863
  reload: $,
1853
1864
  setOpen: F,
@@ -1863,8 +1874,8 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
1863
1874
  }
1864
1875
  );
1865
1876
  });
1866
- xl.displayName = "Modal";
1867
- const Nl = ({
1877
+ bl.displayName = "Modal";
1878
+ const kl = ({
1868
1879
  href: e,
1869
1880
  method: t = "get",
1870
1881
  data: n = {},
@@ -1876,43 +1887,43 @@ const Nl = ({
1876
1887
  onClose: i = null,
1877
1888
  onError: c = null,
1878
1889
  onFocus: f = null,
1879
- onStart: y = null,
1890
+ onStart: x = null,
1880
1891
  onSuccess: b = null,
1881
1892
  navigate: w = null,
1882
1893
  children: d,
1883
- ...v
1894
+ ...g
1884
1895
  }) => {
1885
- const [u, m] = S(!1), [p, g] = S(null), { stack: x, visit: h } = Xe(), $ = C(() => w ?? ft("navigate"), [w]), F = {}, j = {};
1886
- Object.keys(v).forEach((P) => {
1887
- xt.includes(P) || (P.startsWith("on") && typeof v[P] == "function" ? P.toLowerCase() in window ? F[P] = v[P] : j[P] = v[P] : F[P] = v[P]);
1896
+ const [u, m] = S(!1), [p, v] = S(null), { stack: y, visit: h } = Ve(), $ = C(() => w ?? mt("navigate"), [w]), F = {}, j = {};
1897
+ Object.keys(g).forEach((P) => {
1898
+ bt.includes(P) || (P.startsWith("on") && typeof g[P] == "function" ? P.toLowerCase() in window ? F[P] = g[P] : j[P] = g[P] : F[P] = g[P]);
1888
1899
  });
1889
- const [_, N] = S(!1);
1900
+ const [_, A] = S(!1);
1890
1901
  M(() => {
1891
- p && (p.onTopOfStack && _ ? f == null || f() : !p.onTopOfStack && !_ && (s == null || s()), N(!p.onTopOfStack));
1892
- }, [x]);
1902
+ p && (p.onTopOfStack && _ ? f == null || f() : !p.onTopOfStack && !_ && (s == null || s()), A(!p.onTopOfStack));
1903
+ }, [y]);
1893
1904
  const U = Y(() => {
1894
1905
  i == null || i();
1895
1906
  }, [i]), B = Y(() => {
1896
- g(null), a == null || a();
1907
+ v(null), a == null || a();
1897
1908
  }, [a]), X = Y(
1898
1909
  (P) => {
1899
- P == null || P.preventDefault(), !u && (e.startsWith("#") || (m(!0), y == null || y()), h(
1910
+ P == null || P.preventDefault(), !u && (e.startsWith("#") || (m(!0), x == null || x()), h(
1900
1911
  e,
1901
1912
  t,
1902
1913
  n,
1903
1914
  l,
1904
- Pn(Ft(v, xt)),
1905
- () => U(x.length),
1915
+ Mn(Ct(g, bt)),
1916
+ () => U(y.length),
1906
1917
  B,
1907
1918
  o,
1908
1919
  $
1909
1920
  ).then((V) => {
1910
- g(V), V.registerEventListenersFromProps(j), b == null || b();
1921
+ v(V), V.registerEventListenersFromProps(j), b == null || b();
1911
1922
  }).catch((V) => {
1912
1923
  console.error(V), c == null || c(V);
1913
1924
  }).finally(() => m(!1)));
1914
1925
  },
1915
- [e, t, n, l, o, v, U, B]
1926
+ [e, t, n, l, o, g, U, B]
1916
1927
  );
1917
1928
  return /* @__PURE__ */ T(
1918
1929
  r,
@@ -1924,23 +1935,23 @@ const Nl = ({
1924
1935
  }
1925
1936
  );
1926
1937
  };
1927
- function Al() {
1928
- return Xe().stack[Nt()] ?? null;
1938
+ function Il() {
1939
+ return Ve().stack[kt()] ?? null;
1929
1940
  }
1930
- const Il = (e) => (t) => (t.default.layout = (n) => Re(e, {}, n), t);
1941
+ const Rl = (e) => (t) => (t.default.layout = (n) => De(e, {}, n), t);
1931
1942
  export {
1932
- It as HeadlessModal,
1933
- xl as Modal,
1934
- Nl as ModalLink,
1935
- Fn as ModalRoot,
1936
- Ln as ModalStackProvider,
1937
- ft as getConfig,
1938
- Sn as initFromPageProps,
1939
- Sl as putConfig,
1940
- Fl as renderApp,
1941
- Ll as resetConfig,
1942
- Il as setPageLayout,
1943
- Al as useModal,
1944
- Nt as useModalIndex,
1945
- Xe as useModalStack
1943
+ Rt as HeadlessModal,
1944
+ bl as Modal,
1945
+ kl as ModalLink,
1946
+ Cn as ModalRoot,
1947
+ Sn as ModalStackProvider,
1948
+ mt as getConfig,
1949
+ Fn as initFromPageProps,
1950
+ Fl as putConfig,
1951
+ Cl as renderApp,
1952
+ Sl as resetConfig,
1953
+ Rl as setPageLayout,
1954
+ Il as useModal,
1955
+ kt as useModalIndex,
1956
+ Ve as useModalStack
1946
1957
  };