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