@inertiaui/modal-react 0.20.5 → 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 +851 -778
- package/dist/inertiaui-modal.umd.cjs +3 -3
- package/package.json +2 -2
- package/src/Deferred.jsx +23 -0
- package/src/ModalRoot.jsx +28 -4
- package/src/WhenVisible.jsx +100 -0
- package/src/inertiauiModal.js +12 -8
package/dist/inertiaui-modal.js
CHANGED
|
@@ -2,13 +2,13 @@ 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
4
|
import * as Oe from "react";
|
|
5
|
-
import
|
|
6
|
-
import { jsxs as se, Fragment as ft, jsx as
|
|
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
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: {
|
|
@@ -33,15 +33,15 @@ class On {
|
|
|
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
|
}
|
|
@@ -64,7 +64,7 @@ class On {
|
|
|
64
64
|
return r;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const _e = new On(),
|
|
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
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
|
}
|
|
@@ -77,13 +77,13 @@ 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
88
|
const i = e();
|
|
89
89
|
if (i) {
|
|
@@ -97,114 +97,121 @@ function Ln(e, t = 3, n = 10) {
|
|
|
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({}), i = (
|
|
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
124
|
i(
|
|
125
|
-
(
|
|
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
132
|
i(
|
|
133
|
-
(
|
|
134
|
-
var
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
}),
|
|
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 || i((
|
|
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,285 +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
|
-
}),
|
|
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
306
|
reset: () => i(() => []),
|
|
294
|
-
visit:
|
|
295
|
-
visitModal:
|
|
296
|
-
registerLocalModal: (
|
|
297
|
-
l((
|
|
298
|
-
...
|
|
299
|
-
[
|
|
307
|
+
visit: x,
|
|
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 o,
|
|
325
|
-
const t =
|
|
335
|
+
/* @__PURE__ */ P(An, {})
|
|
336
|
+
] }) }) })), An = ({ children: e }) => {
|
|
337
|
+
var o, m;
|
|
338
|
+
const t = j(Be), n = bn();
|
|
326
339
|
let r = !1, l = !1, i = !!((o = n.props) != null && o._inertiaui_modal);
|
|
327
340
|
M(() => Ee.on("start", () => r = !0), []), M(() => Ee.on("finish", () => r = !1), []), M(
|
|
328
|
-
() => Ee.on("navigate", function(
|
|
329
|
-
const
|
|
330
|
-
if (!
|
|
341
|
+
() => Ee.on("navigate", function(d) {
|
|
342
|
+
const g = d.detail.page.props._inertiaui_modal;
|
|
343
|
+
if (!g) {
|
|
331
344
|
l && t.closeAll(), me = null, i = !1;
|
|
332
345
|
return;
|
|
333
346
|
}
|
|
334
|
-
l =
|
|
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
|
-
!r && window.location.href !==
|
|
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 a = (
|
|
350
|
-
var
|
|
351
|
-
return
|
|
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;
|
|
352
365
|
};
|
|
353
366
|
M(() => (De.interceptors.request.use(a), () => De.interceptors.request.eject(a)), []);
|
|
354
|
-
const s =
|
|
367
|
+
const s = O();
|
|
355
368
|
return M(() => {
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
s.current =
|
|
359
|
-
}, [(
|
|
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: [
|
|
360
373
|
e,
|
|
361
|
-
t.stack.length > 0 && /* @__PURE__ */
|
|
374
|
+
t.stack.length > 0 && /* @__PURE__ */ P(It, { index: 0 })
|
|
362
375
|
] });
|
|
363
|
-
}, pt =
|
|
376
|
+
}, pt = $.createContext(null);
|
|
364
377
|
pt.displayName = "ModalIndexContext";
|
|
365
|
-
const
|
|
366
|
-
const e =
|
|
378
|
+
const Nt = () => {
|
|
379
|
+
const e = $.useContext(pt);
|
|
367
380
|
if (e === void 0)
|
|
368
381
|
throw new Error("useModalIndex must be used within a ModalIndexProvider");
|
|
369
382
|
return e;
|
|
370
383
|
}, It = ({ index: e }) => {
|
|
371
|
-
const { stack: t } =
|
|
372
|
-
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(
|
|
373
386
|
n.component,
|
|
374
387
|
{
|
|
375
388
|
...n.props,
|
|
376
389
|
onModalEvent: (...r) => n.emit(...r)
|
|
377
390
|
}
|
|
378
391
|
) });
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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(
|
|
384
410
|
() => ({
|
|
385
|
-
slideover:
|
|
386
|
-
closeButton: a.closeButton ?? ce(
|
|
387
|
-
closeExplicitly: a.closeExplicitly ?? ce(
|
|
388
|
-
maxWidth: a.maxWidth ?? ce(
|
|
389
|
-
paddingClasses: a.paddingClasses ?? ce(
|
|
390
|
-
panelClasses: a.panelClasses ?? ce(
|
|
391
|
-
position: a.position ?? ce(
|
|
392
|
-
...
|
|
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
|
|
393
419
|
}),
|
|
394
|
-
[a,
|
|
420
|
+
[a, f == null ? void 0 : f.config]
|
|
395
421
|
);
|
|
396
422
|
M(() => {
|
|
397
423
|
if (e) {
|
|
398
|
-
let
|
|
399
|
-
return
|
|
400
|
-
|
|
424
|
+
let p = null;
|
|
425
|
+
return d(e, (E) => {
|
|
426
|
+
p = E.registerEventListenersFromProps(a), w(E);
|
|
401
427
|
}), () => {
|
|
402
|
-
|
|
428
|
+
p == null || p(), p = null, g(e);
|
|
403
429
|
};
|
|
404
430
|
}
|
|
405
|
-
return
|
|
431
|
+
return f.registerEventListenersFromProps(a);
|
|
406
432
|
}, [e]);
|
|
407
|
-
const
|
|
433
|
+
const u = O(f);
|
|
408
434
|
M(() => {
|
|
409
|
-
|
|
410
|
-
}, [
|
|
411
|
-
|
|
412
|
-
}, [
|
|
413
|
-
const [
|
|
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]);
|
|
439
|
+
const [v, y] = S(!1);
|
|
414
440
|
return M(() => {
|
|
415
|
-
|
|
416
|
-
}, [
|
|
441
|
+
v && f !== null && f.isOpen && (f.onTopOfStack ? n == null || n() : r == null || r()), y(!0);
|
|
442
|
+
}, [f == null ? void 0 : f.onTopOfStack]), Ft(
|
|
417
443
|
s,
|
|
418
444
|
() => ({
|
|
419
445
|
afterLeave: () => {
|
|
420
|
-
var
|
|
421
|
-
return (
|
|
446
|
+
var p;
|
|
447
|
+
return (p = u.current) == null ? void 0 : p.afterLeave();
|
|
422
448
|
},
|
|
423
449
|
close: () => {
|
|
424
|
-
var
|
|
425
|
-
return (
|
|
450
|
+
var p;
|
|
451
|
+
return (p = u.current) == null ? void 0 : p.close();
|
|
426
452
|
},
|
|
427
|
-
emit: (...
|
|
428
|
-
var
|
|
429
|
-
return (
|
|
453
|
+
emit: (...p) => {
|
|
454
|
+
var E;
|
|
455
|
+
return (E = u.current) == null ? void 0 : E.emit(...p);
|
|
430
456
|
},
|
|
431
457
|
getChildModal: () => {
|
|
432
|
-
var
|
|
433
|
-
return (
|
|
458
|
+
var p;
|
|
459
|
+
return (p = u.current) == null ? void 0 : p.getChildModal();
|
|
434
460
|
},
|
|
435
461
|
getParentModal: () => {
|
|
436
|
-
var
|
|
437
|
-
return (
|
|
462
|
+
var p;
|
|
463
|
+
return (p = u.current) == null ? void 0 : p.getParentModal();
|
|
438
464
|
},
|
|
439
|
-
reload: (...
|
|
440
|
-
var
|
|
441
|
-
return (
|
|
465
|
+
reload: (...p) => {
|
|
466
|
+
var E;
|
|
467
|
+
return (E = u.current) == null ? void 0 : E.reload(...p);
|
|
442
468
|
},
|
|
443
469
|
setOpen: () => {
|
|
444
|
-
var
|
|
445
|
-
return (
|
|
470
|
+
var p;
|
|
471
|
+
return (p = u.current) == null ? void 0 : p.setOpen();
|
|
446
472
|
},
|
|
447
473
|
get id() {
|
|
448
|
-
var
|
|
449
|
-
return (
|
|
474
|
+
var p;
|
|
475
|
+
return (p = u.current) == null ? void 0 : p.id;
|
|
450
476
|
},
|
|
451
477
|
get index() {
|
|
452
|
-
var
|
|
453
|
-
return (
|
|
478
|
+
var p;
|
|
479
|
+
return (p = u.current) == null ? void 0 : p.index;
|
|
454
480
|
},
|
|
455
481
|
get isOpen() {
|
|
456
|
-
var
|
|
457
|
-
return (
|
|
482
|
+
var p;
|
|
483
|
+
return (p = u.current) == null ? void 0 : p.isOpen;
|
|
458
484
|
},
|
|
459
485
|
get config() {
|
|
460
|
-
var
|
|
461
|
-
return (
|
|
486
|
+
var p;
|
|
487
|
+
return (p = u.current) == null ? void 0 : p.config;
|
|
462
488
|
},
|
|
463
489
|
get modalContext() {
|
|
464
|
-
return
|
|
490
|
+
return u.current;
|
|
465
491
|
},
|
|
466
492
|
get onTopOfStack() {
|
|
467
|
-
var
|
|
468
|
-
return (
|
|
493
|
+
var p;
|
|
494
|
+
return (p = u.current) == null ? void 0 : p.onTopOfStack;
|
|
469
495
|
},
|
|
470
496
|
get shouldRender() {
|
|
471
|
-
var
|
|
472
|
-
return (
|
|
497
|
+
var p;
|
|
498
|
+
return (p = u.current) == null ? void 0 : p.shouldRender;
|
|
473
499
|
}
|
|
474
500
|
}),
|
|
475
|
-
[
|
|
476
|
-
), (
|
|
501
|
+
[f]
|
|
502
|
+
), (f == null ? void 0 : f.shouldRender) && /* @__PURE__ */ se(ft, { children: [
|
|
477
503
|
typeof t == "function" ? t({
|
|
478
|
-
afterLeave:
|
|
479
|
-
close:
|
|
480
|
-
config:
|
|
481
|
-
emit:
|
|
482
|
-
getChildModal:
|
|
483
|
-
getParentModal:
|
|
484
|
-
id:
|
|
485
|
-
index:
|
|
486
|
-
isOpen:
|
|
487
|
-
modalContext:
|
|
488
|
-
onTopOfStack:
|
|
489
|
-
reload:
|
|
490
|
-
setOpen:
|
|
491
|
-
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
|
|
492
518
|
}) : t,
|
|
493
|
-
|
|
519
|
+
b && /* @__PURE__ */ P(It, { index: b })
|
|
494
520
|
] });
|
|
495
521
|
});
|
|
496
522
|
Rt.displayName = "HeadlessModal";
|
|
@@ -507,8 +533,8 @@ function je() {
|
|
|
507
533
|
for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = Dt(e)) && (r && (r += " "), r += t);
|
|
508
534
|
return r;
|
|
509
535
|
}
|
|
510
|
-
var
|
|
511
|
-
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 {
|
|
512
538
|
constructor() {
|
|
513
539
|
nt(this, "current", this.detect()), nt(this, "handoffState", "pending"), nt(this, "currentId", 0);
|
|
514
540
|
}
|
|
@@ -536,8 +562,8 @@ let kn = class {
|
|
|
536
562
|
get isHandoffComplete() {
|
|
537
563
|
return this.handoffState === "complete";
|
|
538
564
|
}
|
|
539
|
-
}, ae = new
|
|
540
|
-
function
|
|
565
|
+
}, ae = new Rn();
|
|
566
|
+
function Xe(e) {
|
|
541
567
|
return ae.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
|
542
568
|
}
|
|
543
569
|
function qe(e) {
|
|
@@ -585,21 +611,21 @@ function ht() {
|
|
|
585
611
|
let [e] = S(re);
|
|
586
612
|
return M(() => () => e.dispose(), [e]), e;
|
|
587
613
|
}
|
|
588
|
-
let
|
|
614
|
+
let R = (e, t) => {
|
|
589
615
|
ae.isServer ? M(e, t) : hn(e, t);
|
|
590
616
|
};
|
|
591
617
|
function ue(e) {
|
|
592
|
-
let t =
|
|
593
|
-
return
|
|
618
|
+
let t = O(e);
|
|
619
|
+
return R(() => {
|
|
594
620
|
t.current = e;
|
|
595
621
|
}, [e]), t;
|
|
596
622
|
}
|
|
597
|
-
let
|
|
623
|
+
let F = function(e) {
|
|
598
624
|
let t = ue(e);
|
|
599
|
-
return
|
|
600
|
-
},
|
|
601
|
-
function
|
|
602
|
-
return
|
|
625
|
+
return $.useCallback((...n) => t.current(...n), [t]);
|
|
626
|
+
}, Dn = _(void 0);
|
|
627
|
+
function jn() {
|
|
628
|
+
return j(Dn);
|
|
603
629
|
}
|
|
604
630
|
function it(...e) {
|
|
605
631
|
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
|
|
@@ -613,62 +639,62 @@ function ne(e, t, ...n) {
|
|
|
613
639
|
throw Error.captureStackTrace && Error.captureStackTrace(r, ne), r;
|
|
614
640
|
}
|
|
615
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 || {});
|
|
616
|
-
function
|
|
617
|
-
let e =
|
|
618
|
-
return
|
|
642
|
+
function B() {
|
|
643
|
+
let e = Hn();
|
|
644
|
+
return W((t) => Un({ mergeRefs: e, ...t }), [e]);
|
|
619
645
|
}
|
|
620
|
-
function
|
|
621
|
-
s = s ??
|
|
646
|
+
function Un({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: i = !0, name: a, mergeRefs: s }) {
|
|
647
|
+
s = s ?? Wn;
|
|
622
648
|
let o = jt(t, e);
|
|
623
|
-
if (i) return
|
|
624
|
-
let
|
|
625
|
-
if (
|
|
626
|
-
let { static:
|
|
627
|
-
if (
|
|
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);
|
|
628
654
|
}
|
|
629
|
-
if (
|
|
630
|
-
let { unmount:
|
|
631
|
-
return ne(
|
|
655
|
+
if (m & 1) {
|
|
656
|
+
let { unmount: d = !0, ...g } = o;
|
|
657
|
+
return ne(d ? 0 : 1, { 0() {
|
|
632
658
|
return null;
|
|
633
659
|
}, 1() {
|
|
634
|
-
return
|
|
660
|
+
return Re({ ...g, hidden: !0, style: { display: "none" } }, n, r, a, s);
|
|
635
661
|
} });
|
|
636
662
|
}
|
|
637
|
-
return
|
|
663
|
+
return Re(o, n, r, a, s);
|
|
638
664
|
}
|
|
639
|
-
function
|
|
640
|
-
let { as: i = n, children: a, refName: s = "ref", ...o } = rt(e, ["unmount", "static"]),
|
|
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;
|
|
641
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);
|
|
642
|
-
let
|
|
668
|
+
let g = {};
|
|
643
669
|
if (t) {
|
|
644
|
-
let
|
|
645
|
-
for (let [
|
|
646
|
-
if (
|
|
647
|
-
|
|
648
|
-
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}`] = "";
|
|
649
675
|
}
|
|
650
676
|
}
|
|
651
|
-
if (i ===
|
|
652
|
-
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(
|
|
653
|
-
`), "", "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(`
|
|
654
680
|
`)].join(`
|
|
655
681
|
`));
|
|
656
682
|
} else {
|
|
657
|
-
let
|
|
658
|
-
for (let
|
|
659
|
-
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));
|
|
660
686
|
}
|
|
661
|
-
return
|
|
687
|
+
return Me(i, Object.assign({}, rt(o, ["ref"]), i !== z && m, i !== z && g), d);
|
|
662
688
|
}
|
|
663
|
-
function
|
|
664
|
-
let e =
|
|
689
|
+
function Hn() {
|
|
690
|
+
let e = O([]), t = W((n) => {
|
|
665
691
|
for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n);
|
|
666
692
|
}, []);
|
|
667
693
|
return (...n) => {
|
|
668
694
|
if (!n.every((r) => r == null)) return e.current = n, t;
|
|
669
695
|
};
|
|
670
696
|
}
|
|
671
|
-
function
|
|
697
|
+
function Wn(...e) {
|
|
672
698
|
return e.every((t) => t == null) ? void 0 : (t) => {
|
|
673
699
|
for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t);
|
|
674
700
|
};
|
|
@@ -691,7 +717,7 @@ function jt(...e) {
|
|
|
691
717
|
} });
|
|
692
718
|
return t;
|
|
693
719
|
}
|
|
694
|
-
function
|
|
720
|
+
function U(e) {
|
|
695
721
|
var t;
|
|
696
722
|
return Object.assign(dt(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
697
723
|
}
|
|
@@ -705,65 +731,65 @@ function rt(e, t = []) {
|
|
|
705
731
|
for (let r of t) r in n && delete n[r];
|
|
706
732
|
return n;
|
|
707
733
|
}
|
|
708
|
-
function
|
|
709
|
-
return
|
|
734
|
+
function _n(e) {
|
|
735
|
+
return $.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
|
|
710
736
|
}
|
|
711
|
-
let
|
|
737
|
+
let Bn = "span";
|
|
712
738
|
var He = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(He || {});
|
|
713
|
-
function
|
|
739
|
+
function Vn(e, t) {
|
|
714
740
|
var n;
|
|
715
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" } } };
|
|
716
|
-
return
|
|
742
|
+
return B()({ ourProps: i, theirProps: l, slot: {}, defaultTag: Bn, name: "Hidden" });
|
|
717
743
|
}
|
|
718
|
-
let ot =
|
|
719
|
-
function
|
|
744
|
+
let ot = U(Vn), Ut = Symbol();
|
|
745
|
+
function Xn(e, t = !0) {
|
|
720
746
|
return Object.assign(e, { [Ut]: t });
|
|
721
747
|
}
|
|
722
748
|
function Z(...e) {
|
|
723
|
-
let t =
|
|
749
|
+
let t = O(e);
|
|
724
750
|
M(() => {
|
|
725
751
|
t.current = e;
|
|
726
752
|
}, [e]);
|
|
727
|
-
let n =
|
|
753
|
+
let n = F((r) => {
|
|
728
754
|
for (let l of t.current) l != null && (typeof l == "function" ? l(r) : l.current = r);
|
|
729
755
|
});
|
|
730
756
|
return e.every((r) => r == null || (r == null ? void 0 : r[Ut])) ? void 0 : n;
|
|
731
757
|
}
|
|
732
|
-
let vt =
|
|
758
|
+
let vt = _(null);
|
|
733
759
|
vt.displayName = "DescriptionContext";
|
|
734
760
|
function Ht() {
|
|
735
|
-
let e =
|
|
761
|
+
let e = j(vt);
|
|
736
762
|
if (e === null) {
|
|
737
763
|
let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
738
764
|
throw Error.captureStackTrace && Error.captureStackTrace(t, Ht), t;
|
|
739
765
|
}
|
|
740
766
|
return e;
|
|
741
767
|
}
|
|
742
|
-
function
|
|
768
|
+
function qn() {
|
|
743
769
|
let [e, t] = S([]);
|
|
744
770
|
return [e.length > 0 ? e.join(" ") : void 0, C(() => function(n) {
|
|
745
|
-
let r =
|
|
771
|
+
let r = F((i) => (t((a) => [...a, i]), () => t((a) => {
|
|
746
772
|
let s = a.slice(), o = s.indexOf(i);
|
|
747
773
|
return o !== -1 && s.splice(o, 1), s;
|
|
748
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]);
|
|
749
|
-
return
|
|
775
|
+
return $.createElement(vt.Provider, { value: l }, n.children);
|
|
750
776
|
}, [t])];
|
|
751
777
|
}
|
|
752
|
-
let
|
|
753
|
-
function
|
|
754
|
-
let n =
|
|
755
|
-
|
|
756
|
-
let o = r || !1,
|
|
757
|
-
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" });
|
|
758
784
|
}
|
|
759
|
-
let
|
|
785
|
+
let Gn = U(zn), Kn = Object.assign(Gn, {});
|
|
760
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 || {});
|
|
761
|
-
let
|
|
787
|
+
let Zn = _(() => {
|
|
762
788
|
});
|
|
763
|
-
function
|
|
764
|
-
return
|
|
789
|
+
function Jn({ value: e, children: t }) {
|
|
790
|
+
return $.createElement(Zn.Provider, { value: e }, t);
|
|
765
791
|
}
|
|
766
|
-
let
|
|
792
|
+
let Qn = class extends Map {
|
|
767
793
|
constructor(t) {
|
|
768
794
|
super(), this.factory = t;
|
|
769
795
|
}
|
|
@@ -786,7 +812,7 @@ function _t(e, t) {
|
|
|
786
812
|
function Bt(e) {
|
|
787
813
|
return wn(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
788
814
|
}
|
|
789
|
-
let
|
|
815
|
+
let er = new Qn(() => _t(() => [], { ADD(e) {
|
|
790
816
|
return this.includes(e) ? this : [...this, e];
|
|
791
817
|
}, REMOVE(e) {
|
|
792
818
|
let t = this.indexOf(e);
|
|
@@ -795,8 +821,8 @@ let Jn = new Zn(() => _t(() => [], { ADD(e) {
|
|
|
795
821
|
return n.splice(t, 1), n;
|
|
796
822
|
} }));
|
|
797
823
|
function pe(e, t) {
|
|
798
|
-
let n =
|
|
799
|
-
if (
|
|
824
|
+
let n = er.get(t), r = Le(), l = Bt(n);
|
|
825
|
+
if (R(() => {
|
|
800
826
|
if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
|
|
801
827
|
}, [n, e]), !e) return !1;
|
|
802
828
|
let i = l.indexOf(r), a = l.length;
|
|
@@ -815,9 +841,9 @@ function $t(e) {
|
|
|
815
841
|
let r = at.get(e);
|
|
816
842
|
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, at.delete(e));
|
|
817
843
|
}
|
|
818
|
-
function
|
|
844
|
+
function tr(e, { allowed: t, disallowed: n } = {}) {
|
|
819
845
|
let r = pe(e, "inert-others");
|
|
820
|
-
|
|
846
|
+
R(() => {
|
|
821
847
|
var l, i;
|
|
822
848
|
if (!r) return;
|
|
823
849
|
let a = re();
|
|
@@ -825,18 +851,18 @@ function Qn(e, { allowed: t, disallowed: n } = {}) {
|
|
|
825
851
|
let s = (i = t == null ? void 0 : t()) != null ? i : [];
|
|
826
852
|
for (let o of s) {
|
|
827
853
|
if (!o) continue;
|
|
828
|
-
let
|
|
829
|
-
if (!
|
|
830
|
-
let
|
|
831
|
-
for (;
|
|
832
|
-
for (let
|
|
833
|
-
|
|
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;
|
|
834
860
|
}
|
|
835
861
|
}
|
|
836
862
|
return a.dispose;
|
|
837
863
|
}, [r, t, n]);
|
|
838
864
|
}
|
|
839
|
-
function
|
|
865
|
+
function nr(e, t, n) {
|
|
840
866
|
let r = ue((l) => {
|
|
841
867
|
let i = l.getBoundingClientRect();
|
|
842
868
|
i.x === 0 && i.y === 0 && i.width === 0 && i.height === 0 && n();
|
|
@@ -857,18 +883,18 @@ function er(e, t, n) {
|
|
|
857
883
|
return () => i.dispose();
|
|
858
884
|
}, [t, r, e]);
|
|
859
885
|
}
|
|
860
|
-
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(","),
|
|
861
|
-
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 || {}),
|
|
862
|
-
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) {
|
|
863
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)));
|
|
864
890
|
}
|
|
865
|
-
function
|
|
866
|
-
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)));
|
|
867
893
|
}
|
|
868
|
-
var
|
|
869
|
-
function
|
|
894
|
+
var Vt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Vt || {});
|
|
895
|
+
function ar(e, t = 0) {
|
|
870
896
|
var n;
|
|
871
|
-
return e === ((n =
|
|
897
|
+
return e === ((n = Xe(e)) == null ? void 0 : n.body) ? !1 : ne(t, { 0() {
|
|
872
898
|
return e.matches(We);
|
|
873
899
|
}, 1() {
|
|
874
900
|
let r = e;
|
|
@@ -879,7 +905,7 @@ function ir(e, t = 0) {
|
|
|
879
905
|
return !1;
|
|
880
906
|
} });
|
|
881
907
|
}
|
|
882
|
-
var
|
|
908
|
+
var sr = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(sr || {});
|
|
883
909
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
884
910
|
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
885
911
|
}, !0), document.addEventListener("click", (e) => {
|
|
@@ -888,12 +914,12 @@ typeof window < "u" && typeof document < "u" && (document.addEventListener("keyd
|
|
|
888
914
|
function Q(e) {
|
|
889
915
|
e == null || e.focus({ preventScroll: !0 });
|
|
890
916
|
}
|
|
891
|
-
let
|
|
892
|
-
function
|
|
917
|
+
let ur = ["textarea", "input"].join(",");
|
|
918
|
+
function cr(e) {
|
|
893
919
|
var t, n;
|
|
894
|
-
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;
|
|
895
921
|
}
|
|
896
|
-
function
|
|
922
|
+
function dr(e, t = (n) => n) {
|
|
897
923
|
return e.slice().sort((n, r) => {
|
|
898
924
|
let l = t(n), i = t(r);
|
|
899
925
|
if (l === null || i === null) return 0;
|
|
@@ -902,8 +928,8 @@ function ur(e, t = (n) => n) {
|
|
|
902
928
|
});
|
|
903
929
|
}
|
|
904
930
|
function Pe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
|
|
905
|
-
let i = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, a = Array.isArray(e) ? n ?
|
|
906
|
-
l.length > 0 && a.length > 1 && (a = a.filter((
|
|
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;
|
|
907
933
|
let s = (() => {
|
|
908
934
|
if (t & 5) return 1;
|
|
909
935
|
if (t & 10) return -1;
|
|
@@ -914,27 +940,27 @@ function Pe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] }
|
|
|
914
940
|
if (t & 4) return Math.max(0, a.indexOf(r)) + 1;
|
|
915
941
|
if (t & 8) return a.length - 1;
|
|
916
942
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
917
|
-
})(),
|
|
943
|
+
})(), m = t & 32 ? { preventScroll: !0 } : {}, d = 0, g = a.length, x;
|
|
918
944
|
do {
|
|
919
|
-
if (
|
|
920
|
-
let
|
|
921
|
-
if (t & 16)
|
|
945
|
+
if (d >= g || d + g <= 0) return 0;
|
|
946
|
+
let w = o + d;
|
|
947
|
+
if (t & 16) w = (w + g) % g;
|
|
922
948
|
else {
|
|
923
|
-
if (
|
|
924
|
-
if (
|
|
949
|
+
if (w < 0) return 3;
|
|
950
|
+
if (w >= g) return 1;
|
|
925
951
|
}
|
|
926
|
-
|
|
927
|
-
} while (
|
|
928
|
-
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;
|
|
929
955
|
}
|
|
930
|
-
function
|
|
956
|
+
function Xt() {
|
|
931
957
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
932
958
|
}
|
|
933
|
-
function
|
|
959
|
+
function fr() {
|
|
934
960
|
return /Android/gi.test(window.navigator.userAgent);
|
|
935
961
|
}
|
|
936
|
-
function
|
|
937
|
-
return
|
|
962
|
+
function mr() {
|
|
963
|
+
return Xt() || fr();
|
|
938
964
|
}
|
|
939
965
|
function be(e, t, n, r) {
|
|
940
966
|
let l = ue(n);
|
|
@@ -957,36 +983,36 @@ function qt(e, t, n, r) {
|
|
|
957
983
|
}, [e, t, r]);
|
|
958
984
|
}
|
|
959
985
|
const Ot = 30;
|
|
960
|
-
function
|
|
961
|
-
let r = pe(e, "outside-click"), l = ue(n), i =
|
|
986
|
+
function pr(e, t, n) {
|
|
987
|
+
let r = pe(e, "outside-click"), l = ue(n), i = W(function(o, m) {
|
|
962
988
|
if (o.defaultPrevented) return;
|
|
963
|
-
let
|
|
964
|
-
if (
|
|
965
|
-
let
|
|
966
|
-
return typeof
|
|
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];
|
|
967
993
|
}(t);
|
|
968
|
-
for (let
|
|
969
|
-
return !
|
|
970
|
-
}, [l, t]), a =
|
|
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);
|
|
996
|
+
}, [l, t]), a = O(null);
|
|
971
997
|
be(r, "pointerdown", (o) => {
|
|
972
|
-
var
|
|
973
|
-
a.current = ((
|
|
998
|
+
var m, d;
|
|
999
|
+
a.current = ((d = (m = o.composedPath) == null ? void 0 : m.call(o)) == null ? void 0 : d[0]) || o.target;
|
|
974
1000
|
}, !0), be(r, "mousedown", (o) => {
|
|
975
|
-
var
|
|
976
|
-
a.current = ((
|
|
1001
|
+
var m, d;
|
|
1002
|
+
a.current = ((d = (m = o.composedPath) == null ? void 0 : m.call(o)) == null ? void 0 : d[0]) || o.target;
|
|
977
1003
|
}, !0), be(r, "click", (o) => {
|
|
978
|
-
|
|
1004
|
+
mr() || a.current && (i(o, () => a.current), a.current = null);
|
|
979
1005
|
}, !0);
|
|
980
|
-
let s =
|
|
1006
|
+
let s = O({ x: 0, y: 0 });
|
|
981
1007
|
be(r, "touchstart", (o) => {
|
|
982
1008
|
s.current.x = o.touches[0].clientX, s.current.y = o.touches[0].clientY;
|
|
983
1009
|
}, !0), be(r, "touchend", (o) => {
|
|
984
|
-
let
|
|
985
|
-
if (!(Math.abs(
|
|
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);
|
|
986
1012
|
}, !0), qt(r, "blur", (o) => i(o, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
987
1013
|
}
|
|
988
|
-
function
|
|
989
|
-
return C(() =>
|
|
1014
|
+
function Se(...e) {
|
|
1015
|
+
return C(() => Xe(...e), [...e]);
|
|
990
1016
|
}
|
|
991
1017
|
function Yt(e, t, n, r) {
|
|
992
1018
|
let l = ue(n);
|
|
@@ -998,7 +1024,7 @@ function Yt(e, t, n, r) {
|
|
|
998
1024
|
return e.addEventListener(t, i, r), () => e.removeEventListener(t, i, r);
|
|
999
1025
|
}, [e, t, r]);
|
|
1000
1026
|
}
|
|
1001
|
-
function
|
|
1027
|
+
function hr() {
|
|
1002
1028
|
let e;
|
|
1003
1029
|
return { before({ doc: t }) {
|
|
1004
1030
|
var n;
|
|
@@ -1009,8 +1035,8 @@ function mr() {
|
|
|
1009
1035
|
n.style(r, "paddingRight", `${i}px`);
|
|
1010
1036
|
} };
|
|
1011
1037
|
}
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
1038
|
+
function vr() {
|
|
1039
|
+
return Xt() ? { before({ doc: e, d: t, meta: n }) {
|
|
1014
1040
|
function r(l) {
|
|
1015
1041
|
return n.containers.flatMap((i) => i()).some((i) => i.contains(l));
|
|
1016
1042
|
}
|
|
@@ -1025,8 +1051,8 @@ function pr() {
|
|
|
1025
1051
|
if (s.target instanceof HTMLElement) try {
|
|
1026
1052
|
let o = s.target.closest("a");
|
|
1027
1053
|
if (!o) return;
|
|
1028
|
-
let { hash:
|
|
1029
|
-
|
|
1054
|
+
let { hash: m } = new URL(o.href), d = e.querySelector(m);
|
|
1055
|
+
d && !r(d) && (a = d);
|
|
1030
1056
|
} catch {
|
|
1031
1057
|
}
|
|
1032
1058
|
}, !0), t.addEventListener(e, "touchstart", (s) => {
|
|
@@ -1052,12 +1078,12 @@ function pr() {
|
|
|
1052
1078
|
});
|
|
1053
1079
|
} } : {};
|
|
1054
1080
|
}
|
|
1055
|
-
function
|
|
1081
|
+
function gr() {
|
|
1056
1082
|
return { before({ doc: e, d: t }) {
|
|
1057
1083
|
t.style(e.documentElement, "overflow", "hidden");
|
|
1058
1084
|
} };
|
|
1059
1085
|
}
|
|
1060
|
-
function
|
|
1086
|
+
function wr(e) {
|
|
1061
1087
|
let t = {};
|
|
1062
1088
|
for (let n of e) Object.assign(t, n(t));
|
|
1063
1089
|
return t;
|
|
@@ -1070,7 +1096,7 @@ let oe = _t(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
|
1070
1096
|
let n = this.get(e);
|
|
1071
1097
|
return n && (n.count--, n.meta.delete(t)), this;
|
|
1072
1098
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
|
|
1073
|
-
let r = { doc: e, d: t, meta:
|
|
1099
|
+
let r = { doc: e, d: t, meta: wr(n) }, l = [vr(), hr(), gr()];
|
|
1074
1100
|
l.forEach(({ before: i }) => i == null ? void 0 : i(r)), l.forEach(({ after: i }) => i == null ? void 0 : i(r));
|
|
1075
1101
|
}, SCROLL_ALLOW({ d: e }) {
|
|
1076
1102
|
e.dispose();
|
|
@@ -1085,21 +1111,21 @@ oe.subscribe(() => {
|
|
|
1085
1111
|
(l && !r || !l && r) && oe.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && oe.dispatch("TEARDOWN", n);
|
|
1086
1112
|
}
|
|
1087
1113
|
});
|
|
1088
|
-
function
|
|
1114
|
+
function yr(e, t, n = () => ({ containers: [] })) {
|
|
1089
1115
|
let r = Bt(oe), l = t ? r.get(t) : void 0, i = l ? l.count > 0 : !1;
|
|
1090
|
-
return
|
|
1116
|
+
return R(() => {
|
|
1091
1117
|
if (!(!t || !e)) return oe.dispatch("PUSH", t, n), () => oe.dispatch("POP", t, n);
|
|
1092
1118
|
}, [e, t]), i;
|
|
1093
1119
|
}
|
|
1094
|
-
function
|
|
1120
|
+
function xr(e, t, n = () => [document.body]) {
|
|
1095
1121
|
let r = pe(e, "scroll-lock");
|
|
1096
|
-
|
|
1122
|
+
yr(r, t, (l) => {
|
|
1097
1123
|
var i;
|
|
1098
1124
|
return { containers: [...(i = l.containers) != null ? i : [], n] };
|
|
1099
1125
|
});
|
|
1100
1126
|
}
|
|
1101
|
-
function
|
|
1102
|
-
let [t, n] = S(e), r =
|
|
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]);
|
|
1103
1129
|
return { flags: t, setFlag: r, addFlag: l, hasFlag: i, removeFlag: a, toggleFlag: s };
|
|
1104
1130
|
}
|
|
1105
1131
|
var Tt, Pt;
|
|
@@ -1107,41 +1133,41 @@ typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Tt
|
|
|
1107
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(`
|
|
1108
1134
|
`)), [];
|
|
1109
1135
|
});
|
|
1110
|
-
var
|
|
1111
|
-
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) {
|
|
1112
1138
|
let t = {};
|
|
1113
1139
|
for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
|
|
1114
1140
|
return t;
|
|
1115
1141
|
}
|
|
1116
|
-
function
|
|
1117
|
-
let [l, i] = S(n), { hasFlag: a, addFlag: s, removeFlag: o } =
|
|
1118
|
-
return
|
|
1119
|
-
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;
|
|
1120
1146
|
if (e) {
|
|
1121
1147
|
if (n && i(!0), !t) {
|
|
1122
1148
|
n && s(3);
|
|
1123
1149
|
return;
|
|
1124
1150
|
}
|
|
1125
|
-
return (
|
|
1126
|
-
|
|
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)));
|
|
1127
1153
|
}, run() {
|
|
1128
|
-
|
|
1154
|
+
d.current ? n ? (o(3), s(4)) : (o(4), s(3)) : n ? o(1) : s(1);
|
|
1129
1155
|
}, done() {
|
|
1130
|
-
var
|
|
1131
|
-
|
|
1156
|
+
var w;
|
|
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));
|
|
1132
1158
|
} });
|
|
1133
1159
|
}
|
|
1134
|
-
}, [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 }];
|
|
1135
1161
|
}
|
|
1136
|
-
function
|
|
1162
|
+
function Tr(e, { prepare: t, run: n, done: r, inFlight: l }) {
|
|
1137
1163
|
let i = re();
|
|
1138
|
-
return
|
|
1164
|
+
return Mr(e, { prepare: t, inFlight: l }), i.nextFrame(() => {
|
|
1139
1165
|
n(), i.requestAnimationFrame(() => {
|
|
1140
|
-
i.add(
|
|
1166
|
+
i.add(Pr(e, r));
|
|
1141
1167
|
});
|
|
1142
1168
|
}), i.dispose;
|
|
1143
1169
|
}
|
|
1144
|
-
function
|
|
1170
|
+
function Pr(e, t) {
|
|
1145
1171
|
var n, r;
|
|
1146
1172
|
let l = re();
|
|
1147
1173
|
if (!e) return l.dispose;
|
|
@@ -1154,7 +1180,7 @@ function Or(e, t) {
|
|
|
1154
1180
|
i || t();
|
|
1155
1181
|
}), l.dispose);
|
|
1156
1182
|
}
|
|
1157
|
-
function
|
|
1183
|
+
function Mr(e, { inFlight: t, prepare: n }) {
|
|
1158
1184
|
if (t != null && t.current) {
|
|
1159
1185
|
n();
|
|
1160
1186
|
return;
|
|
@@ -1163,7 +1189,7 @@ function Tr(e, { inFlight: t, prepare: n }) {
|
|
|
1163
1189
|
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
|
|
1164
1190
|
}
|
|
1165
1191
|
function gt(e, t) {
|
|
1166
|
-
let n =
|
|
1192
|
+
let n = O([]), r = F(e);
|
|
1167
1193
|
M(() => {
|
|
1168
1194
|
let l = [...n.current];
|
|
1169
1195
|
for (let [i, a] of t.entries()) if (n.current[i] !== a) {
|
|
@@ -1172,26 +1198,26 @@ function gt(e, t) {
|
|
|
1172
1198
|
}
|
|
1173
1199
|
}, [r, ...t]);
|
|
1174
1200
|
}
|
|
1175
|
-
let Ye =
|
|
1201
|
+
let Ye = _(null);
|
|
1176
1202
|
Ye.displayName = "OpenClosedContext";
|
|
1177
|
-
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 || {});
|
|
1178
1204
|
function ze() {
|
|
1179
|
-
return
|
|
1205
|
+
return j(Ye);
|
|
1180
1206
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1207
|
+
function Lr({ value: e, children: t }) {
|
|
1208
|
+
return $.createElement(Ye.Provider, { value: e }, t);
|
|
1183
1209
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return
|
|
1210
|
+
function Sr({ children: e }) {
|
|
1211
|
+
return $.createElement(Ye.Provider, { value: null }, e);
|
|
1186
1212
|
}
|
|
1187
|
-
function
|
|
1213
|
+
function Fr(e) {
|
|
1188
1214
|
function t() {
|
|
1189
1215
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
|
1190
1216
|
}
|
|
1191
1217
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
|
1192
1218
|
}
|
|
1193
1219
|
let ee = [];
|
|
1194
|
-
|
|
1220
|
+
Fr(() => {
|
|
1195
1221
|
function e(t) {
|
|
1196
1222
|
if (!(t.target instanceof HTMLElement) || t.target === document.body || ee[0] === t.target) return;
|
|
1197
1223
|
let n = t.target;
|
|
@@ -1200,33 +1226,33 @@ Lr(() => {
|
|
|
1200
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 });
|
|
1201
1227
|
});
|
|
1202
1228
|
function zt(e) {
|
|
1203
|
-
let t =
|
|
1229
|
+
let t = F(e), n = O(!1);
|
|
1204
1230
|
M(() => (n.current = !1, () => {
|
|
1205
1231
|
n.current = !0, qe(() => {
|
|
1206
1232
|
n.current && t();
|
|
1207
1233
|
});
|
|
1208
1234
|
}), [t]);
|
|
1209
1235
|
}
|
|
1210
|
-
function
|
|
1236
|
+
function Cr() {
|
|
1211
1237
|
let e = typeof document > "u";
|
|
1212
1238
|
return "useSyncExternalStore" in Oe ? ((t) => t.useSyncExternalStore)(Oe)(() => () => {
|
|
1213
1239
|
}, () => !1, () => !e) : !1;
|
|
1214
1240
|
}
|
|
1215
|
-
function
|
|
1216
|
-
let e =
|
|
1241
|
+
function Fe() {
|
|
1242
|
+
let e = Cr(), [t, n] = Oe.useState(ae.isHandoffComplete);
|
|
1217
1243
|
return t && ae.isHandoffComplete === !1 && n(!1), Oe.useEffect(() => {
|
|
1218
1244
|
t !== !0 && n(!0);
|
|
1219
1245
|
}, [t]), Oe.useEffect(() => ae.handoff(), []), e ? !1 : t;
|
|
1220
1246
|
}
|
|
1221
|
-
let Gt =
|
|
1222
|
-
function
|
|
1223
|
-
return
|
|
1247
|
+
let Gt = _(!1);
|
|
1248
|
+
function Ar() {
|
|
1249
|
+
return j(Gt);
|
|
1224
1250
|
}
|
|
1225
1251
|
function Mt(e) {
|
|
1226
|
-
return
|
|
1252
|
+
return $.createElement(Gt.Provider, { value: e.force }, e.children);
|
|
1227
1253
|
}
|
|
1228
|
-
function
|
|
1229
|
-
let t =
|
|
1254
|
+
function Nr(e) {
|
|
1255
|
+
let t = Ar(), n = j(Zt), r = Se(e), [l, i] = S(() => {
|
|
1230
1256
|
var a;
|
|
1231
1257
|
if (!t && n !== null) return (a = n.current) != null ? a : null;
|
|
1232
1258
|
if (ae.isServer) return null;
|
|
@@ -1242,54 +1268,54 @@ function Cr(e) {
|
|
|
1242
1268
|
t || n !== null && i(n.current);
|
|
1243
1269
|
}, [n, i, t]), l;
|
|
1244
1270
|
}
|
|
1245
|
-
let Kt =
|
|
1246
|
-
let n = e, r =
|
|
1247
|
-
r.current =
|
|
1248
|
-
}), t), i =
|
|
1249
|
-
var
|
|
1250
|
-
return ae.isServer ? null : (
|
|
1251
|
-
}), o =
|
|
1252
|
-
|
|
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(() => {
|
|
1253
1279
|
!a || !s || a.contains(s) || (s.setAttribute("data-headlessui-portal", ""), a.appendChild(s));
|
|
1254
|
-
}, [a, s]),
|
|
1280
|
+
}, [a, s]), R(() => {
|
|
1255
1281
|
if (s && o) return o.register(s);
|
|
1256
1282
|
}, [o, s]), zt(() => {
|
|
1257
|
-
var
|
|
1258
|
-
!a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((
|
|
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)));
|
|
1259
1285
|
});
|
|
1260
|
-
let
|
|
1261
|
-
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;
|
|
1262
1288
|
});
|
|
1263
|
-
function
|
|
1264
|
-
let n = Z(t), { enabled: r = !0, ...l } = e, i =
|
|
1265
|
-
return r ?
|
|
1266
|
-
}
|
|
1267
|
-
let
|
|
1268
|
-
function
|
|
1269
|
-
let { target: n, ...r } = e, l = { ref: Z(t) }, i =
|
|
1270
|
-
return
|
|
1271
|
-
}
|
|
1272
|
-
let ut =
|
|
1273
|
-
function
|
|
1274
|
-
let e =
|
|
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) => {
|
|
1275
1301
|
let a = t.current.indexOf(i);
|
|
1276
1302
|
a !== -1 && t.current.splice(a, 1), e && e.unregister(i);
|
|
1277
1303
|
}), l = C(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
|
|
1278
1304
|
return [t, C(() => function({ children: i }) {
|
|
1279
|
-
return
|
|
1305
|
+
return $.createElement(ut.Provider, { value: l }, i);
|
|
1280
1306
|
}, [l])];
|
|
1281
1307
|
}
|
|
1282
|
-
let
|
|
1283
|
-
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) {
|
|
1284
1310
|
let r = pe(e, "escape");
|
|
1285
1311
|
Yt(t, "keydown", (l) => {
|
|
1286
1312
|
r && (l.defaultPrevented || l.key === Wt.Escape && n(l));
|
|
1287
1313
|
});
|
|
1288
1314
|
}
|
|
1289
|
-
function
|
|
1315
|
+
function _r() {
|
|
1290
1316
|
var e;
|
|
1291
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);
|
|
1292
|
-
return
|
|
1318
|
+
return R(() => {
|
|
1293
1319
|
if (!t) return;
|
|
1294
1320
|
function l(i) {
|
|
1295
1321
|
r(i.matches);
|
|
@@ -1297,24 +1323,24 @@ function Hr() {
|
|
|
1297
1323
|
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1298
1324
|
}, [t]), n;
|
|
1299
1325
|
}
|
|
1300
|
-
function
|
|
1301
|
-
let r =
|
|
1326
|
+
function Br({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
|
|
1327
|
+
let r = Se(n), l = F(() => {
|
|
1302
1328
|
var i, a;
|
|
1303
1329
|
let s = [];
|
|
1304
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));
|
|
1305
1331
|
if (t != null && t.current) for (let o of t.current) s.push(o);
|
|
1306
|
-
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((
|
|
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));
|
|
1307
1333
|
return s;
|
|
1308
1334
|
});
|
|
1309
|
-
return { resolveContainers: l, contains:
|
|
1335
|
+
return { resolveContainers: l, contains: F((i) => l().some((a) => a.contains(i))) };
|
|
1310
1336
|
}
|
|
1311
|
-
let Qt =
|
|
1337
|
+
let Qt = _(null);
|
|
1312
1338
|
function Lt({ children: e, node: t }) {
|
|
1313
1339
|
let [n, r] = S(null), l = en(t ?? n);
|
|
1314
|
-
return
|
|
1340
|
+
return $.createElement(Qt.Provider, { value: l }, e, l === null && $.createElement(ot, { features: He.Hidden, ref: (i) => {
|
|
1315
1341
|
var a, s;
|
|
1316
1342
|
if (i) {
|
|
1317
|
-
for (let o of (s = (a =
|
|
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)) {
|
|
1318
1344
|
r(o);
|
|
1319
1345
|
break;
|
|
1320
1346
|
}
|
|
@@ -1323,17 +1349,17 @@ function Lt({ children: e, node: t }) {
|
|
|
1323
1349
|
}
|
|
1324
1350
|
function en(e = null) {
|
|
1325
1351
|
var t;
|
|
1326
|
-
return (t =
|
|
1352
|
+
return (t = j(Qt)) != null ? t : e;
|
|
1327
1353
|
}
|
|
1328
1354
|
function wt() {
|
|
1329
|
-
let e =
|
|
1330
|
-
return
|
|
1355
|
+
let e = O(!1);
|
|
1356
|
+
return R(() => (e.current = !0, () => {
|
|
1331
1357
|
e.current = !1;
|
|
1332
1358
|
}), []), e;
|
|
1333
1359
|
}
|
|
1334
1360
|
var $e = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))($e || {});
|
|
1335
|
-
function
|
|
1336
|
-
let e =
|
|
1361
|
+
function Vr() {
|
|
1362
|
+
let e = O(0);
|
|
1337
1363
|
return qt(!0, "keydown", (t) => {
|
|
1338
1364
|
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
1339
1365
|
}, !0), e;
|
|
@@ -1345,59 +1371,59 @@ function tn(e) {
|
|
|
1345
1371
|
for (let n of e.current) n.current instanceof HTMLElement && t.add(n.current);
|
|
1346
1372
|
return t;
|
|
1347
1373
|
}
|
|
1348
|
-
let
|
|
1374
|
+
let Xr = "div";
|
|
1349
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 || {});
|
|
1350
|
-
function
|
|
1351
|
-
let n =
|
|
1352
|
-
|
|
1353
|
-
let
|
|
1354
|
-
|
|
1355
|
-
let
|
|
1356
|
-
|
|
1357
|
-
let
|
|
1358
|
-
let
|
|
1359
|
-
|
|
1360
|
-
ne(
|
|
1361
|
-
Pe(
|
|
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) => {
|
|
1384
|
+
let v = n.current;
|
|
1385
|
+
v && ((y) => y())(() => {
|
|
1386
|
+
ne(g.current, { [$e.Forwards]: () => {
|
|
1387
|
+
Pe(v, J.First, { skipElements: [u.relatedTarget, i] });
|
|
1362
1388
|
}, [$e.Backwards]: () => {
|
|
1363
|
-
Pe(
|
|
1389
|
+
Pe(v, J.Last, { skipElements: [u.relatedTarget, i] });
|
|
1364
1390
|
} });
|
|
1365
1391
|
});
|
|
1366
|
-
}),
|
|
1367
|
-
|
|
1368
|
-
|
|
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;
|
|
1369
1395
|
}));
|
|
1370
|
-
}, onBlur(
|
|
1396
|
+
}, onBlur(u) {
|
|
1371
1397
|
if (!(s & 4)) return;
|
|
1372
|
-
let
|
|
1373
|
-
n.current instanceof HTMLElement &&
|
|
1374
|
-
let
|
|
1375
|
-
|
|
1376
|
-
} },
|
|
1377
|
-
return
|
|
1378
|
-
}
|
|
1379
|
-
let
|
|
1380
|
-
function
|
|
1381
|
-
let t =
|
|
1398
|
+
let v = tn(a);
|
|
1399
|
+
n.current instanceof HTMLElement && v.add(n.current);
|
|
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 }));
|
|
1404
|
+
}
|
|
1405
|
+
let Yr = U(qr), zr = Object.assign(Yr, { features: ie });
|
|
1406
|
+
function Gr(e = !0) {
|
|
1407
|
+
let t = O(ee.slice());
|
|
1382
1408
|
return gt(([n], [r]) => {
|
|
1383
1409
|
r === !0 && n === !1 && qe(() => {
|
|
1384
1410
|
t.current.splice(0);
|
|
1385
1411
|
}), r === !1 && n === !0 && (t.current = ee.slice());
|
|
1386
|
-
}, [e, ee, t]),
|
|
1412
|
+
}, [e, ee, t]), F(() => {
|
|
1387
1413
|
var n;
|
|
1388
1414
|
return (n = t.current.find((r) => r != null && r.isConnected)) != null ? n : null;
|
|
1389
1415
|
});
|
|
1390
1416
|
}
|
|
1391
|
-
function
|
|
1392
|
-
let n = !!(e & 8), r =
|
|
1417
|
+
function Kr(e, { ownerDocument: t }) {
|
|
1418
|
+
let n = !!(e & 8), r = Gr(n);
|
|
1393
1419
|
gt(() => {
|
|
1394
1420
|
n || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && Q(r());
|
|
1395
1421
|
}, [n]), zt(() => {
|
|
1396
1422
|
n && Q(r());
|
|
1397
1423
|
});
|
|
1398
1424
|
}
|
|
1399
|
-
function
|
|
1400
|
-
let i =
|
|
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();
|
|
1401
1427
|
return gt(() => {
|
|
1402
1428
|
if (e === 0) return;
|
|
1403
1429
|
if (!a) {
|
|
@@ -1407,14 +1433,14 @@ function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
|
|
|
1407
1433
|
let o = n.current;
|
|
1408
1434
|
o && qe(() => {
|
|
1409
1435
|
if (!s.current) return;
|
|
1410
|
-
let
|
|
1436
|
+
let m = t == null ? void 0 : t.activeElement;
|
|
1411
1437
|
if (r != null && r.current) {
|
|
1412
|
-
if ((r == null ? void 0 : r.current) ===
|
|
1413
|
-
i.current =
|
|
1438
|
+
if ((r == null ? void 0 : r.current) === m) {
|
|
1439
|
+
i.current = m;
|
|
1414
1440
|
return;
|
|
1415
1441
|
}
|
|
1416
|
-
} else if (o.contains(
|
|
1417
|
-
i.current =
|
|
1442
|
+
} else if (o.contains(m)) {
|
|
1443
|
+
i.current = m;
|
|
1418
1444
|
return;
|
|
1419
1445
|
}
|
|
1420
1446
|
if (r != null && r.current) Q(r.current);
|
|
@@ -1429,16 +1455,16 @@ function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
|
|
|
1429
1455
|
});
|
|
1430
1456
|
}, [l, a, e]), i;
|
|
1431
1457
|
}
|
|
1432
|
-
function
|
|
1458
|
+
function Jr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
|
|
1433
1459
|
let i = wt(), a = !!(e & 4);
|
|
1434
1460
|
Yt(t == null ? void 0 : t.defaultView, "focus", (s) => {
|
|
1435
1461
|
if (!a || !i.current) return;
|
|
1436
1462
|
let o = tn(r);
|
|
1437
1463
|
n.current instanceof HTMLElement && o.add(n.current);
|
|
1438
|
-
let
|
|
1439
|
-
if (!
|
|
1440
|
-
let
|
|
1441
|
-
|
|
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);
|
|
1442
1468
|
}, !0);
|
|
1443
1469
|
}
|
|
1444
1470
|
function nn(e, t) {
|
|
@@ -1447,196 +1473,196 @@ function nn(e, t) {
|
|
|
1447
1473
|
}
|
|
1448
1474
|
function rn(e) {
|
|
1449
1475
|
var t;
|
|
1450
|
-
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;
|
|
1451
1477
|
}
|
|
1452
|
-
let Ge =
|
|
1478
|
+
let Ge = _(null);
|
|
1453
1479
|
Ge.displayName = "TransitionContext";
|
|
1454
|
-
var
|
|
1455
|
-
function
|
|
1456
|
-
let e =
|
|
1480
|
+
var Qr = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Qr || {});
|
|
1481
|
+
function el() {
|
|
1482
|
+
let e = j(Ge);
|
|
1457
1483
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1458
1484
|
return e;
|
|
1459
1485
|
}
|
|
1460
|
-
function
|
|
1461
|
-
let e =
|
|
1486
|
+
function tl() {
|
|
1487
|
+
let e = j(Ke);
|
|
1462
1488
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1463
1489
|
return e;
|
|
1464
1490
|
}
|
|
1465
|
-
let Ke =
|
|
1491
|
+
let Ke = _(null);
|
|
1466
1492
|
Ke.displayName = "NestingContext";
|
|
1467
1493
|
function Ze(e) {
|
|
1468
1494
|
return "children" in e ? Ze(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1469
1495
|
}
|
|
1470
1496
|
function ln(e, t) {
|
|
1471
|
-
let n = ue(e), r =
|
|
1472
|
-
let
|
|
1473
|
-
|
|
1474
|
-
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);
|
|
1475
1501
|
}, [te.Hidden]() {
|
|
1476
|
-
r.current[
|
|
1502
|
+
r.current[b].state = "hidden";
|
|
1477
1503
|
} }), i.microTask(() => {
|
|
1478
|
-
var
|
|
1479
|
-
!Ze(r) && l.current && ((
|
|
1504
|
+
var h;
|
|
1505
|
+
!Ze(r) && l.current && ((h = n.current) == null || h.call(n));
|
|
1480
1506
|
}));
|
|
1481
|
-
}), s =
|
|
1482
|
-
let
|
|
1483
|
-
return
|
|
1484
|
-
}), o =
|
|
1485
|
-
o.current.splice(0), t && (t.chains.current[
|
|
1486
|
-
o.current.push(
|
|
1487
|
-
})]), t == null || t.chains.current[
|
|
1488
|
-
Promise.all(
|
|
1489
|
-
})]),
|
|
1490
|
-
}),
|
|
1491
|
-
Promise.all(
|
|
1492
|
-
var
|
|
1493
|
-
(
|
|
1494
|
-
}).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));
|
|
1495
1521
|
});
|
|
1496
|
-
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]);
|
|
1497
1523
|
}
|
|
1498
|
-
let on =
|
|
1499
|
-
function
|
|
1524
|
+
let on = z, an = Ue.RenderStrategy;
|
|
1525
|
+
function nl(e, t) {
|
|
1500
1526
|
var n, r;
|
|
1501
|
-
let { transition: l = !0, beforeEnter: i, afterEnter: a, beforeLeave: s, afterLeave: o, enter:
|
|
1502
|
-
|
|
1503
|
-
if (
|
|
1504
|
-
if (
|
|
1505
|
-
|
|
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");
|
|
1506
1532
|
return;
|
|
1507
1533
|
}
|
|
1508
|
-
return ne(
|
|
1534
|
+
return ne(N, { hidden: () => L(v), visible: () => X(v) });
|
|
1509
1535
|
}
|
|
1510
|
-
}, [
|
|
1511
|
-
let
|
|
1512
|
-
|
|
1513
|
-
if (
|
|
1514
|
-
}, [
|
|
1515
|
-
let
|
|
1516
|
-
ve.current || (
|
|
1517
|
-
},
|
|
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) => {
|
|
1518
1544
|
ve.current = !0;
|
|
1519
1545
|
let ke = Qe ? "enter" : "leave";
|
|
1520
|
-
K.onStart(
|
|
1546
|
+
K.onStart(v, ke, (we) => {
|
|
1521
1547
|
we === "enter" ? i == null || i() : we === "leave" && (s == null || s());
|
|
1522
1548
|
});
|
|
1523
|
-
}),
|
|
1549
|
+
}), I = F((Qe) => {
|
|
1524
1550
|
let ke = Qe ? "enter" : "leave";
|
|
1525
|
-
ve.current = !1, K.onStop(
|
|
1551
|
+
ve.current = !1, K.onStop(v, ke, (we) => {
|
|
1526
1552
|
we === "enter" ? a == null || a() : we === "leave" && (o == null || o());
|
|
1527
|
-
}), ke === "leave" && !Ze(K) && (
|
|
1553
|
+
}), ke === "leave" && !Ze(K) && (H("hidden"), L(v));
|
|
1528
1554
|
});
|
|
1529
1555
|
M(() => {
|
|
1530
|
-
|
|
1531
|
-
}, [
|
|
1532
|
-
let
|
|
1533
|
-
|
|
1534
|
-
let fn =
|
|
1535
|
-
return
|
|
1536
|
-
}
|
|
1537
|
-
function
|
|
1538
|
-
let { show: n, appear: r = !1, unmount: l = !0, ...i } = e, a =
|
|
1539
|
-
|
|
1540
|
-
let
|
|
1541
|
-
if (n === void 0 &&
|
|
1542
|
-
let [
|
|
1543
|
-
n ||
|
|
1544
|
-
}), [
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
}, [
|
|
1548
|
-
let
|
|
1549
|
-
|
|
1550
|
-
n ?
|
|
1551
|
-
}, [n,
|
|
1552
|
-
let
|
|
1553
|
-
var
|
|
1554
|
-
|
|
1555
|
-
}),
|
|
1556
|
-
var
|
|
1557
|
-
|
|
1558
|
-
}),
|
|
1559
|
-
return
|
|
1560
|
-
}
|
|
1561
|
-
function
|
|
1562
|
-
let n =
|
|
1563
|
-
return
|
|
1564
|
-
}
|
|
1565
|
-
let ct =
|
|
1566
|
-
var
|
|
1567
|
-
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) {
|
|
1568
1594
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
1569
|
-
} },
|
|
1570
|
-
|
|
1595
|
+
} }, yt = _(null);
|
|
1596
|
+
yt.displayName = "DialogContext";
|
|
1571
1597
|
function Je(e) {
|
|
1572
|
-
let t =
|
|
1598
|
+
let t = j(yt);
|
|
1573
1599
|
if (t === null) {
|
|
1574
1600
|
let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
1575
1601
|
throw Error.captureStackTrace && Error.captureStackTrace(n, Je), n;
|
|
1576
1602
|
}
|
|
1577
1603
|
return t;
|
|
1578
1604
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return ne(t.type,
|
|
1605
|
+
function sl(e, t) {
|
|
1606
|
+
return ne(t.type, al, e, t);
|
|
1581
1607
|
}
|
|
1582
|
-
let St =
|
|
1583
|
-
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);
|
|
1584
1610
|
s = function() {
|
|
1585
|
-
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");
|
|
1586
1612
|
}();
|
|
1587
|
-
let
|
|
1588
|
-
l === void 0 &&
|
|
1589
|
-
let
|
|
1590
|
-
var
|
|
1591
|
-
return (
|
|
1592
|
-
} },
|
|
1593
|
-
|
|
1594
|
-
var
|
|
1595
|
-
return [(
|
|
1596
|
-
}), disallowed:
|
|
1597
|
-
var
|
|
1598
|
-
return [(
|
|
1599
|
-
}) }),
|
|
1600
|
-
|
|
1601
|
-
}),
|
|
1602
|
-
|
|
1603
|
-
}),
|
|
1604
|
-
let [X,
|
|
1605
|
-
|
|
1606
|
-
let Ne =
|
|
1607
|
-
return
|
|
1608
|
-
}),
|
|
1609
|
-
function
|
|
1613
|
+
let w = ze();
|
|
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) {
|
|
1610
1636
|
let { transition: n = !1, open: r, ...l } = e, i = ze(), a = e.hasOwnProperty("open") || i !== null, s = e.hasOwnProperty("onClose");
|
|
1611
1637
|
if (!a && !s) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1612
1638
|
if (!a) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1613
1639
|
if (!s) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1614
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}`);
|
|
1615
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}`);
|
|
1616
|
-
return (r !== void 0 || n) && !l.static ?
|
|
1617
|
-
}
|
|
1618
|
-
let cl = "div";
|
|
1619
|
-
function dl(e, t) {
|
|
1620
|
-
let n = Me(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...i } = e, [{ dialogState: a, unmount: s }, o] = Je("Dialog.Panel"), p = Z(t, o.panelRef), c = C(() => ({ open: a === 0 }), [a]), v = L((u) => {
|
|
1621
|
-
u.stopPropagation();
|
|
1622
|
-
}), y = { ref: p, id: r, onClick: v }, g = l ? he : G, d = l ? { unmount: s } : {}, x = W();
|
|
1623
|
-
return E.createElement(g, { ...d }, x({ ourProps: y, theirProps: i, slot: c, 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 }));
|
|
1624
1643
|
}
|
|
1625
1644
|
let fl = "div";
|
|
1626
1645
|
function ml(e, t) {
|
|
1627
|
-
let {
|
|
1628
|
-
|
|
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" }));
|
|
1629
1650
|
}
|
|
1630
|
-
let pl = "
|
|
1651
|
+
let pl = "div";
|
|
1631
1652
|
function hl(e, t) {
|
|
1632
|
-
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);
|
|
1633
1659
|
M(() => (a(r), () => a(null)), [r, a]);
|
|
1634
|
-
let o = C(() => ({ open: i === 0 }), [i]),
|
|
1635
|
-
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" });
|
|
1636
1662
|
}
|
|
1637
|
-
let
|
|
1638
|
-
|
|
1639
|
-
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 });
|
|
1640
1666
|
function cn({ onClick: e }) {
|
|
1641
1667
|
return /* @__PURE__ */ se(
|
|
1642
1668
|
"button",
|
|
@@ -1645,8 +1671,8 @@ function cn({ onClick: e }) {
|
|
|
1645
1671
|
className: "im-close-button text-gray-400 hover:text-gray-500",
|
|
1646
1672
|
onClick: e,
|
|
1647
1673
|
children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ P("span", { className: "sr-only", children: "Close" }),
|
|
1675
|
+
/* @__PURE__ */ P(
|
|
1650
1676
|
"svg",
|
|
1651
1677
|
{
|
|
1652
1678
|
className: "size-6",
|
|
@@ -1656,7 +1682,7 @@ function cn({ onClick: e }) {
|
|
|
1656
1682
|
strokeWidth: "2",
|
|
1657
1683
|
stroke: "currentColor",
|
|
1658
1684
|
"aria-hidden": "true",
|
|
1659
|
-
children: /* @__PURE__ */
|
|
1685
|
+
children: /* @__PURE__ */ P(
|
|
1660
1686
|
"path",
|
|
1661
1687
|
{
|
|
1662
1688
|
strokeLinecap: "round",
|
|
@@ -1670,9 +1696,9 @@ function cn({ onClick: e }) {
|
|
|
1670
1696
|
}
|
|
1671
1697
|
);
|
|
1672
1698
|
}
|
|
1673
|
-
const
|
|
1699
|
+
const bl = ({ modalContext: e, config: t, children: n }) => {
|
|
1674
1700
|
const [r, l] = S(!1);
|
|
1675
|
-
return /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ P("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ P(
|
|
1676
1702
|
"div",
|
|
1677
1703
|
{
|
|
1678
1704
|
className: je("im-modal-positioner flex min-h-full justify-center", {
|
|
@@ -1680,7 +1706,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1680
1706
|
"items-center": t.position === "center",
|
|
1681
1707
|
"items-end": t.position === "bottom"
|
|
1682
1708
|
}),
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1709
|
+
children: /* @__PURE__ */ P(
|
|
1684
1710
|
he,
|
|
1685
1711
|
{
|
|
1686
1712
|
as: "div",
|
|
@@ -1703,12 +1729,12 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1703
1729
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1704
1730
|
}),
|
|
1705
1731
|
children: /* @__PURE__ */ se(
|
|
1706
|
-
|
|
1732
|
+
xt,
|
|
1707
1733
|
{
|
|
1708
1734
|
className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1709
1735
|
"data-inertiaui-modal-entered": r,
|
|
1710
1736
|
children: [
|
|
1711
|
-
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 }) }),
|
|
1712
1738
|
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1713
1739
|
]
|
|
1714
1740
|
}
|
|
@@ -1717,16 +1743,16 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1717
1743
|
)
|
|
1718
1744
|
}
|
|
1719
1745
|
) });
|
|
1720
|
-
},
|
|
1746
|
+
}, El = ({ modalContext: e, config: t, children: n }) => {
|
|
1721
1747
|
const [r, l] = S(!1);
|
|
1722
|
-
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(
|
|
1723
1749
|
"div",
|
|
1724
1750
|
{
|
|
1725
1751
|
className: je("im-slideover-positioner flex min-h-full items-center", {
|
|
1726
1752
|
"justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
|
|
1727
1753
|
"justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
|
|
1728
1754
|
}),
|
|
1729
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ P(
|
|
1730
1756
|
he,
|
|
1731
1757
|
{
|
|
1732
1758
|
as: "div",
|
|
@@ -1749,12 +1775,12 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1749
1775
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1750
1776
|
}),
|
|
1751
1777
|
children: /* @__PURE__ */ se(
|
|
1752
|
-
|
|
1778
|
+
xt,
|
|
1753
1779
|
{
|
|
1754
1780
|
className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1755
1781
|
"data-inertiaui-modal-entered": r,
|
|
1756
1782
|
children: [
|
|
1757
|
-
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 }) }),
|
|
1758
1784
|
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1759
1785
|
]
|
|
1760
1786
|
}
|
|
@@ -1763,12 +1789,12 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1763
1789
|
)
|
|
1764
1790
|
}
|
|
1765
1791
|
) });
|
|
1766
|
-
},
|
|
1767
|
-
const
|
|
1768
|
-
return Ft(o, () =>
|
|
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(
|
|
1769
1795
|
Rt,
|
|
1770
1796
|
{
|
|
1771
|
-
ref:
|
|
1797
|
+
ref: d,
|
|
1772
1798
|
name: e,
|
|
1773
1799
|
onFocus: n,
|
|
1774
1800
|
onBlur: r,
|
|
@@ -1776,36 +1802,36 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1776
1802
|
onSuccess: i,
|
|
1777
1803
|
...s,
|
|
1778
1804
|
children: ({
|
|
1779
|
-
afterLeave:
|
|
1780
|
-
close:
|
|
1781
|
-
config:
|
|
1782
|
-
emit:
|
|
1783
|
-
getChildModal:
|
|
1784
|
-
getParentModal:
|
|
1785
|
-
id:
|
|
1786
|
-
index:
|
|
1787
|
-
isOpen:
|
|
1788
|
-
modalContext:
|
|
1789
|
-
onTopOfStack:
|
|
1790
|
-
reload:
|
|
1791
|
-
setOpen:
|
|
1792
|
-
shouldRender:
|
|
1793
|
-
}) => /* @__PURE__ */
|
|
1805
|
+
afterLeave: g,
|
|
1806
|
+
close: x,
|
|
1807
|
+
config: w,
|
|
1808
|
+
emit: f,
|
|
1809
|
+
getChildModal: b,
|
|
1810
|
+
getParentModal: h,
|
|
1811
|
+
id: c,
|
|
1812
|
+
index: u,
|
|
1813
|
+
isOpen: v,
|
|
1814
|
+
modalContext: y,
|
|
1815
|
+
onTopOfStack: p,
|
|
1816
|
+
reload: E,
|
|
1817
|
+
setOpen: T,
|
|
1818
|
+
shouldRender: A
|
|
1819
|
+
}) => /* @__PURE__ */ P(
|
|
1794
1820
|
un,
|
|
1795
1821
|
{
|
|
1796
1822
|
appear: !0,
|
|
1797
|
-
show:
|
|
1823
|
+
show: v ?? !1,
|
|
1798
1824
|
afterLeave: a,
|
|
1799
1825
|
children: /* @__PURE__ */ se(
|
|
1800
|
-
|
|
1826
|
+
xl,
|
|
1801
1827
|
{
|
|
1802
1828
|
as: "div",
|
|
1803
1829
|
className: "im-dialog relative z-20",
|
|
1804
|
-
onClose: () =>
|
|
1805
|
-
"data-inertiaui-modal-id":
|
|
1806
|
-
"data-inertiaui-modal-index":
|
|
1830
|
+
onClose: () => w.closeExplicitly ? null : x(),
|
|
1831
|
+
"data-inertiaui-modal-id": c,
|
|
1832
|
+
"data-inertiaui-modal-index": u,
|
|
1807
1833
|
children: [
|
|
1808
|
-
|
|
1834
|
+
u === 0 ? /* @__PURE__ */ P(
|
|
1809
1835
|
he,
|
|
1810
1836
|
{
|
|
1811
1837
|
enter: "transition transform ease-in-out duration-300",
|
|
@@ -1814,58 +1840,58 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1814
1840
|
leave: "transition transform ease-in-out duration-300",
|
|
1815
1841
|
leaveFrom: "opacity-100",
|
|
1816
1842
|
leaveTo: "opacity-0",
|
|
1817
|
-
children:
|
|
1843
|
+
children: p ? /* @__PURE__ */ P(
|
|
1818
1844
|
"div",
|
|
1819
1845
|
{
|
|
1820
1846
|
className: "im-backdrop fixed inset-0 z-30 bg-black/75",
|
|
1821
1847
|
"aria-hidden": "true"
|
|
1822
1848
|
}
|
|
1823
|
-
) : /* @__PURE__ */
|
|
1849
|
+
) : /* @__PURE__ */ P("div", {})
|
|
1824
1850
|
}
|
|
1825
1851
|
) : null,
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
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,
|
|
1829
1855
|
{
|
|
1830
|
-
modalContext:
|
|
1831
|
-
config:
|
|
1832
|
-
children:
|
|
1833
|
-
afterLeave:
|
|
1834
|
-
close:
|
|
1835
|
-
config:
|
|
1836
|
-
emit:
|
|
1837
|
-
getChildModal:
|
|
1838
|
-
getParentModal:
|
|
1839
|
-
id:
|
|
1840
|
-
index:
|
|
1841
|
-
isOpen:
|
|
1842
|
-
modalContext:
|
|
1843
|
-
onTopOfStack:
|
|
1844
|
-
reload:
|
|
1845
|
-
setOpen:
|
|
1846
|
-
shouldRender:
|
|
1856
|
+
modalContext: y,
|
|
1857
|
+
config: w,
|
|
1858
|
+
children: m({
|
|
1859
|
+
afterLeave: g,
|
|
1860
|
+
close: x,
|
|
1861
|
+
config: w,
|
|
1862
|
+
emit: f,
|
|
1863
|
+
getChildModal: b,
|
|
1864
|
+
getParentModal: h,
|
|
1865
|
+
id: c,
|
|
1866
|
+
index: u,
|
|
1867
|
+
isOpen: v,
|
|
1868
|
+
modalContext: y,
|
|
1869
|
+
onTopOfStack: p,
|
|
1870
|
+
reload: E,
|
|
1871
|
+
setOpen: T,
|
|
1872
|
+
shouldRender: A
|
|
1847
1873
|
})
|
|
1848
1874
|
}
|
|
1849
|
-
) : /* @__PURE__ */
|
|
1850
|
-
|
|
1875
|
+
) : /* @__PURE__ */ P(
|
|
1876
|
+
bl,
|
|
1851
1877
|
{
|
|
1852
|
-
modalContext:
|
|
1853
|
-
config:
|
|
1854
|
-
children:
|
|
1855
|
-
afterLeave:
|
|
1856
|
-
close:
|
|
1857
|
-
config:
|
|
1858
|
-
emit:
|
|
1859
|
-
getChildModal:
|
|
1860
|
-
getParentModal:
|
|
1861
|
-
id:
|
|
1862
|
-
index:
|
|
1863
|
-
isOpen:
|
|
1864
|
-
modalContext:
|
|
1865
|
-
onTopOfStack:
|
|
1866
|
-
reload:
|
|
1867
|
-
setOpen:
|
|
1868
|
-
shouldRender:
|
|
1878
|
+
modalContext: y,
|
|
1879
|
+
config: w,
|
|
1880
|
+
children: m({
|
|
1881
|
+
afterLeave: g,
|
|
1882
|
+
close: x,
|
|
1883
|
+
config: w,
|
|
1884
|
+
emit: f,
|
|
1885
|
+
getChildModal: b,
|
|
1886
|
+
getParentModal: h,
|
|
1887
|
+
id: c,
|
|
1888
|
+
index: u,
|
|
1889
|
+
isOpen: v,
|
|
1890
|
+
modalContext: y,
|
|
1891
|
+
onTopOfStack: p,
|
|
1892
|
+
reload: E,
|
|
1893
|
+
setOpen: T,
|
|
1894
|
+
shouldRender: A
|
|
1869
1895
|
})
|
|
1870
1896
|
}
|
|
1871
1897
|
)
|
|
@@ -1877,8 +1903,8 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1877
1903
|
}
|
|
1878
1904
|
);
|
|
1879
1905
|
});
|
|
1880
|
-
|
|
1881
|
-
const
|
|
1906
|
+
$l.displayName = "Modal";
|
|
1907
|
+
const Dl = ({
|
|
1882
1908
|
href: e,
|
|
1883
1909
|
method: t = "get",
|
|
1884
1910
|
data: n = {},
|
|
@@ -1888,73 +1914,120 @@ const kl = ({
|
|
|
1888
1914
|
onAfterLeave: a = null,
|
|
1889
1915
|
onBlur: s = null,
|
|
1890
1916
|
onClose: o = null,
|
|
1891
|
-
onError:
|
|
1892
|
-
onFocus:
|
|
1893
|
-
onStart:
|
|
1894
|
-
onSuccess:
|
|
1895
|
-
navigate:
|
|
1896
|
-
children:
|
|
1897
|
-
...
|
|
1917
|
+
onError: m = null,
|
|
1918
|
+
onFocus: d = null,
|
|
1919
|
+
onStart: g = null,
|
|
1920
|
+
onSuccess: x = null,
|
|
1921
|
+
navigate: w = null,
|
|
1922
|
+
children: f,
|
|
1923
|
+
...b
|
|
1898
1924
|
}) => {
|
|
1899
|
-
const [
|
|
1900
|
-
Object.keys(
|
|
1901
|
-
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]);
|
|
1902
1928
|
});
|
|
1903
|
-
const [
|
|
1929
|
+
const [G, N] = S(!1);
|
|
1904
1930
|
M(() => {
|
|
1905
|
-
|
|
1906
|
-
}, [
|
|
1907
|
-
const
|
|
1931
|
+
u && (u.onTopOfStack && G ? d == null || d() : !u.onTopOfStack && !G && (s == null || s()), N(!u.onTopOfStack));
|
|
1932
|
+
}, [y]);
|
|
1933
|
+
const H = W(() => {
|
|
1908
1934
|
o == null || o();
|
|
1909
|
-
}, [o]),
|
|
1910
|
-
|
|
1911
|
-
}, [a]), X =
|
|
1912
|
-
(
|
|
1913
|
-
|
|
1935
|
+
}, [o]), V = W(() => {
|
|
1936
|
+
v(null), a == null || a();
|
|
1937
|
+
}, [a]), X = W(
|
|
1938
|
+
(L) => {
|
|
1939
|
+
L == null || L.preventDefault(), !h && (e.startsWith("#") || (c(!0), g == null || g()), p(
|
|
1914
1940
|
e,
|
|
1915
1941
|
t,
|
|
1916
1942
|
n,
|
|
1917
1943
|
l,
|
|
1918
|
-
Mn(
|
|
1919
|
-
() =>
|
|
1920
|
-
|
|
1944
|
+
Ln(Mn(b, bt)),
|
|
1945
|
+
() => H(y.length),
|
|
1946
|
+
V,
|
|
1921
1947
|
i,
|
|
1922
|
-
|
|
1923
|
-
).then((
|
|
1924
|
-
|
|
1925
|
-
}).catch((
|
|
1926
|
-
console.error(
|
|
1927
|
-
}).finally(() =>
|
|
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)));
|
|
1928
1954
|
},
|
|
1929
|
-
[e, t, n, l, i,
|
|
1955
|
+
[e, t, n, l, i, b, H, V]
|
|
1930
1956
|
);
|
|
1931
|
-
return /* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ P(
|
|
1932
1958
|
r,
|
|
1933
1959
|
{
|
|
1934
|
-
...
|
|
1960
|
+
...T,
|
|
1935
1961
|
href: e,
|
|
1936
1962
|
onClick: X,
|
|
1937
|
-
children: typeof
|
|
1963
|
+
children: typeof f == "function" ? f({ loading: h }) : f
|
|
1938
1964
|
}
|
|
1939
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;
|
|
1940
2013
|
};
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
}
|
|
1944
|
-
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);
|
|
1945
2016
|
export {
|
|
2017
|
+
Nn as Deferred,
|
|
1946
2018
|
Rt as HeadlessModal,
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2019
|
+
$l as Modal,
|
|
2020
|
+
Dl as ModalLink,
|
|
2021
|
+
An as ModalRoot,
|
|
2022
|
+
Fn as ModalStackProvider,
|
|
2023
|
+
Ol as WhenVisible,
|
|
1951
2024
|
mt as getConfig,
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
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
|
|
1960
2033
|
};
|