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