@inertiaui/modal-react 0.20.4 → 0.20.5
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 +567 -564
- package/dist/inertiaui-modal.umd.cjs +3 -3
- package/package.json +2 -2
- package/src/ModalRoot.jsx +4 -2
package/dist/inertiaui-modal.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var mn = Object.defineProperty;
|
|
2
2
|
var pn = (e, t, n) => t in e ? mn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var q = (e, t, n) => pn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import * as
|
|
5
|
-
import E, { createContext as H, useContext as R, useEffect as M, useRef as
|
|
6
|
-
import { jsxs as se, Fragment as ft, jsx as
|
|
4
|
+
import * as Oe from "react";
|
|
5
|
+
import E, { createContext as H, useContext as R, useEffect as M, useRef as T, useState as S, createElement as Re, useMemo as C, forwardRef as dt, useImperativeHandle as Ft, useLayoutEffect as hn, useCallback as Y, Fragment as G, isValidElement as vn, cloneElement as gn, useId as Me, useSyncExternalStore as wn, useReducer as xn, createRef as yn } from "react";
|
|
6
|
+
import { jsxs as se, Fragment as ft, jsx as O } from "react/jsx-runtime";
|
|
7
7
|
import De from "axios";
|
|
8
|
-
import {
|
|
8
|
+
import { usePage as bn, router as Ee } from "@inertiajs/react";
|
|
9
9
|
import { mergeDataIntoQueryString as En } from "@inertiajs/core";
|
|
10
10
|
import { createPortal as $n } from "react-dom";
|
|
11
11
|
const xe = {
|
|
@@ -28,7 +28,7 @@ const xe = {
|
|
|
28
28
|
position: "right"
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
class
|
|
31
|
+
class On {
|
|
32
32
|
constructor() {
|
|
33
33
|
this.config = {}, this.reset();
|
|
34
34
|
}
|
|
@@ -47,8 +47,8 @@ class Tn {
|
|
|
47
47
|
}
|
|
48
48
|
const r = t.split(".");
|
|
49
49
|
let l = this.config;
|
|
50
|
-
for (let
|
|
51
|
-
l = l[r[
|
|
50
|
+
for (let i = 0; i < r.length - 1; i++)
|
|
51
|
+
l = l[r[i]] = l[r[i]] || {};
|
|
52
52
|
l[r[r.length - 1]] = n;
|
|
53
53
|
}
|
|
54
54
|
get(t) {
|
|
@@ -64,8 +64,8 @@ class Tn {
|
|
|
64
64
|
return r;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const _e = new
|
|
68
|
-
function
|
|
67
|
+
const _e = new On(), Sl = () => _e.reset(), Fl = (e, t) => _e.put(e, t), mt = (e) => _e.get(e), ce = (e, t) => _e.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
68
|
+
function Tn(e, t) {
|
|
69
69
|
return e = typeof e == "string" ? new URL(e, window.location.origin) : e, t = typeof t == "string" ? new URL(t, window.location.origin) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
|
|
70
70
|
}
|
|
71
71
|
function et(e = "inertiaui_modal_") {
|
|
@@ -85,15 +85,15 @@ function Mn(e) {
|
|
|
85
85
|
}
|
|
86
86
|
function Ln(e, t = 3, n = 10) {
|
|
87
87
|
return new Promise((r, l) => {
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
r(
|
|
88
|
+
const i = e();
|
|
89
|
+
if (i) {
|
|
90
|
+
r(i);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
let a = t * 1e3 / n;
|
|
94
94
|
const s = setInterval(() => {
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const o = e();
|
|
96
|
+
o && (clearInterval(s), r(o)), --a <= 0 && (clearInterval(s), l(new Error("Condition not met in time")));
|
|
97
97
|
}, n);
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -104,85 +104,85 @@ const Be = H(null);
|
|
|
104
104
|
Be.displayName = "ModalStackContext";
|
|
105
105
|
let Nt = null, At = null, me = null, lt = null, tt = [], de = {};
|
|
106
106
|
const Sn = ({ children: e }) => {
|
|
107
|
-
const [t, n] = S([]), [r, l] = S({}),
|
|
107
|
+
const [t, n] = S([]), [r, l] = S({}), i = (x) => {
|
|
108
108
|
n((u) => {
|
|
109
|
-
const
|
|
110
|
-
var
|
|
111
|
-
return
|
|
109
|
+
const f = x([...u]), m = (w) => {
|
|
110
|
+
var b;
|
|
111
|
+
return f.length < 2 ? !0 : ((b = f.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : b.id) === w;
|
|
112
112
|
};
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
}),
|
|
113
|
+
return f.forEach((w, b) => {
|
|
114
|
+
f[b].onTopOfStack = m(w.id), f[b].getParentModal = () => b < 1 ? null : f.slice(0, b).reverse().find((h) => h.isOpen), f[b].getChildModal = () => b === f.length - 1 ? null : f.slice(b + 1).find((h) => h.isOpen);
|
|
115
|
+
}), f;
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
M(() => {
|
|
119
119
|
tt = t;
|
|
120
120
|
}, [t]);
|
|
121
121
|
class a {
|
|
122
|
-
constructor(u,
|
|
122
|
+
constructor(u, f, m, w, b) {
|
|
123
123
|
q(this, "show", () => {
|
|
124
|
-
|
|
125
|
-
(u) => u.map((
|
|
124
|
+
i(
|
|
125
|
+
(u) => u.map((f) => (f.id === this.id && !f.isOpen && (f.isOpen = !0, f.shouldRender = !0), f))
|
|
126
126
|
);
|
|
127
127
|
});
|
|
128
128
|
q(this, "setOpen", (u) => {
|
|
129
129
|
u ? this.show() : this.close();
|
|
130
130
|
});
|
|
131
131
|
q(this, "close", () => {
|
|
132
|
-
|
|
133
|
-
(u) => u.map((
|
|
134
|
-
var
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
}),
|
|
132
|
+
i(
|
|
133
|
+
(u) => u.map((f) => {
|
|
134
|
+
var m;
|
|
135
|
+
return f.id === this.id && f.isOpen && (Object.keys(f.listeners).forEach((w) => {
|
|
136
|
+
f.off(w);
|
|
137
|
+
}), f.isOpen = !1, (m = f.onCloseCallback) == null || m.call(f)), f;
|
|
138
138
|
})
|
|
139
139
|
);
|
|
140
140
|
});
|
|
141
141
|
q(this, "afterLeave", () => {
|
|
142
|
-
this.isOpen ||
|
|
143
|
-
const
|
|
144
|
-
var
|
|
145
|
-
return
|
|
142
|
+
this.isOpen || i((u) => {
|
|
143
|
+
const f = u.map((m) => {
|
|
144
|
+
var w;
|
|
145
|
+
return m.id === this.id && !m.isOpen && (m.shouldRender = !1, (w = m.afterLeaveCallback) == null || w.call(m), m.afterLeaveCallback = null), m;
|
|
146
146
|
});
|
|
147
|
-
return this.index === 0 ? [] :
|
|
147
|
+
return this.index === 0 ? [] : f;
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
|
-
q(this, "on", (u,
|
|
151
|
-
u = ye(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(
|
|
150
|
+
q(this, "on", (u, f) => {
|
|
151
|
+
u = ye(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(f);
|
|
152
152
|
});
|
|
153
|
-
q(this, "off", (u,
|
|
154
|
-
var
|
|
155
|
-
u = ye(u),
|
|
153
|
+
q(this, "off", (u, f) => {
|
|
154
|
+
var m;
|
|
155
|
+
u = ye(u), f ? this.listeners[u] = ((m = this.listeners[u]) == null ? void 0 : m.filter((w) => w !== f)) ?? [] : delete this.listeners[u];
|
|
156
156
|
});
|
|
157
|
-
q(this, "emit", (u, ...
|
|
158
|
-
var
|
|
159
|
-
(
|
|
157
|
+
q(this, "emit", (u, ...f) => {
|
|
158
|
+
var m;
|
|
159
|
+
(m = this.listeners[ye(u)]) == null || m.forEach((w) => w(...f));
|
|
160
160
|
});
|
|
161
161
|
q(this, "registerEventListenersFromProps", (u) => {
|
|
162
|
-
const
|
|
163
|
-
return Object.keys(u).filter((
|
|
164
|
-
const
|
|
165
|
-
this.on(
|
|
166
|
-
}), () =>
|
|
162
|
+
const f = [];
|
|
163
|
+
return Object.keys(u).filter((m) => m.startsWith("on")).forEach((m) => {
|
|
164
|
+
const w = ye(m).replace(/^on-/, "");
|
|
165
|
+
this.on(w, u[m]), f.push(() => this.off(w, u[m]));
|
|
166
|
+
}), () => f.forEach((m) => m());
|
|
167
167
|
});
|
|
168
168
|
q(this, "reload", (u = {}) => {
|
|
169
|
-
var
|
|
170
|
-
let
|
|
171
|
-
if (u.only && (
|
|
169
|
+
var b;
|
|
170
|
+
let f = Object.keys(this.response.props);
|
|
171
|
+
if (u.only && (f = Ct(f, u.only)), u.except && (f = Pn(f, u.except)), !((b = this.response) != null && b.url))
|
|
172
172
|
return;
|
|
173
|
-
const
|
|
173
|
+
const m = (u.method ?? "get").toLowerCase(), w = u.data ?? {};
|
|
174
174
|
De({
|
|
175
175
|
url: this.response.url,
|
|
176
|
-
method:
|
|
177
|
-
data:
|
|
178
|
-
params:
|
|
176
|
+
method: m,
|
|
177
|
+
data: m === "get" ? {} : w,
|
|
178
|
+
params: m === "get" ? w : {},
|
|
179
179
|
headers: {
|
|
180
180
|
...u.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": f.join(","),
|
|
186
186
|
"X-InertiaUI-Modal": et(),
|
|
187
187
|
"X-InertiaUI-Modal-Use-Router": 0,
|
|
188
188
|
"X-InertiaUI-Modal-Base-Url": me
|
|
@@ -192,18 +192,18 @@ const Sn = ({ children: e }) => {
|
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
194
|
q(this, "updateProps", (u) => {
|
|
195
|
-
Object.assign(this.props, u),
|
|
195
|
+
Object.assign(this.props, u), i((f) => f);
|
|
196
196
|
});
|
|
197
|
-
if (this.id =
|
|
197
|
+
if (this.id = f.id ?? et(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = f.props, this.response = f, this.config = m ?? {}, this.onCloseCallback = w, this.afterLeaveCallback = b, de[this.id]) {
|
|
198
198
|
this.config = {
|
|
199
199
|
...this.config,
|
|
200
200
|
...de[this.id].config ?? {}
|
|
201
201
|
};
|
|
202
202
|
const h = de[this.id].onClose, $ = de[this.id].onAfterLeave;
|
|
203
|
-
h && (this.onCloseCallback =
|
|
204
|
-
|
|
205
|
-
} : h), $ && (this.afterLeaveCallback =
|
|
206
|
-
|
|
203
|
+
h && (this.onCloseCallback = w ? () => {
|
|
204
|
+
w(), h();
|
|
205
|
+
} : h), $ && (this.afterLeaveCallback = b ? () => {
|
|
206
|
+
b(), $();
|
|
207
207
|
} : $), delete de[this.id];
|
|
208
208
|
}
|
|
209
209
|
this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
|
|
@@ -212,18 +212,18 @@ const Sn = ({ children: e }) => {
|
|
|
212
212
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `inertiaui_modal_${crypto.randomUUID()}` : `inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const s = (
|
|
216
|
-
const
|
|
217
|
-
return
|
|
215
|
+
const s = (x, u = {}, f = null, m = null) => At(x.component).then((w) => o(w, x, u, f, m)), o = (x, u, f, m, w) => {
|
|
216
|
+
const b = new a(x, u, f, m, w);
|
|
217
|
+
return b.index = t.length, i((h) => [...h, b]), b.show(), b;
|
|
218
218
|
};
|
|
219
|
-
function
|
|
220
|
-
if (!r[
|
|
221
|
-
throw new Error(`The local modal "${
|
|
222
|
-
const
|
|
223
|
-
return
|
|
219
|
+
function p(x, u, f, m) {
|
|
220
|
+
if (!r[x])
|
|
221
|
+
throw new Error(`The local modal "${x}" has not been registered.`);
|
|
222
|
+
const w = o(null, {}, u, f, m);
|
|
223
|
+
return w.name = x, r[x].callback(w), w;
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
|
|
225
|
+
const c = (x, u = {}) => v(
|
|
226
|
+
x,
|
|
227
227
|
u.method ?? "get",
|
|
228
228
|
u.data ?? {},
|
|
229
229
|
u.headers ?? {},
|
|
@@ -232,23 +232,23 @@ const Sn = ({ children: e }) => {
|
|
|
232
232
|
u.onAfterLeave,
|
|
233
233
|
u.queryStringArrayFormat ?? "brackets",
|
|
234
234
|
u.navigate ?? mt("navigate")
|
|
235
|
-
).then((
|
|
236
|
-
const
|
|
237
|
-
return Object.keys(
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
}),
|
|
241
|
-
}),
|
|
235
|
+
).then((f) => {
|
|
236
|
+
const m = u.listeners ?? {};
|
|
237
|
+
return Object.keys(m).forEach((w) => {
|
|
238
|
+
const b = ye(w);
|
|
239
|
+
f.on(b, m[w]);
|
|
240
|
+
}), f;
|
|
241
|
+
}), v = (x, u, f = {}, m = {}, w = {}, b = null, h = null, $ = "brackets", F = !1) => {
|
|
242
242
|
const j = et();
|
|
243
243
|
return new Promise((_, A) => {
|
|
244
|
-
if (
|
|
245
|
-
_(
|
|
244
|
+
if (x.startsWith("#")) {
|
|
245
|
+
_(p(x.substring(1), w, b, h));
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
const [U, B] = En(u,
|
|
248
|
+
const [U, B] = En(u, x || "", f, $);
|
|
249
249
|
let X = F && t.length === 0;
|
|
250
|
-
if (t.length === 0 && (me = typeof window < "u" ? window.location.href : ""),
|
|
251
|
-
...
|
|
250
|
+
if (t.length === 0 && (me = typeof window < "u" ? window.location.href : ""), m = {
|
|
251
|
+
...m,
|
|
252
252
|
Accept: "text/html, application/xhtml+xml",
|
|
253
253
|
"X-Requested-With": "XMLHttpRequest",
|
|
254
254
|
"X-Inertia": !0,
|
|
@@ -258,13 +258,13 @@ const Sn = ({ children: e }) => {
|
|
|
258
258
|
"X-InertiaUI-Modal-Base-Url": me
|
|
259
259
|
}, X)
|
|
260
260
|
return lt = null, de[j] = {
|
|
261
|
-
config:
|
|
262
|
-
onClose:
|
|
261
|
+
config: w,
|
|
262
|
+
onClose: b,
|
|
263
263
|
onAfterLeave: h
|
|
264
264
|
}, Ee.visit(U, {
|
|
265
265
|
method: u,
|
|
266
266
|
data: B,
|
|
267
|
-
headers:
|
|
267
|
+
headers: m,
|
|
268
268
|
preserveScroll: !0,
|
|
269
269
|
preserveState: !0,
|
|
270
270
|
onError: A,
|
|
@@ -276,37 +276,37 @@ const Sn = ({ children: e }) => {
|
|
|
276
276
|
url: U,
|
|
277
277
|
method: u,
|
|
278
278
|
data: B,
|
|
279
|
-
headers:
|
|
280
|
-
}).then((P) => _(s(P.data,
|
|
279
|
+
headers: m
|
|
280
|
+
}).then((P) => _(s(P.data, w, b, h))).catch((P) => {
|
|
281
281
|
A(P);
|
|
282
282
|
});
|
|
283
283
|
});
|
|
284
284
|
}, d = {
|
|
285
285
|
stack: t,
|
|
286
286
|
localModals: r,
|
|
287
|
-
push:
|
|
287
|
+
push: o,
|
|
288
288
|
pushFromResponseData: s,
|
|
289
289
|
length: () => tt.length,
|
|
290
290
|
closeAll: () => {
|
|
291
|
-
tt.reverse().forEach((
|
|
291
|
+
tt.reverse().forEach((x) => x.close());
|
|
292
292
|
},
|
|
293
|
-
reset: () =>
|
|
294
|
-
visit:
|
|
295
|
-
visitModal:
|
|
296
|
-
registerLocalModal: (
|
|
297
|
-
l((
|
|
298
|
-
...
|
|
299
|
-
[
|
|
293
|
+
reset: () => i(() => []),
|
|
294
|
+
visit: v,
|
|
295
|
+
visitModal: c,
|
|
296
|
+
registerLocalModal: (x, u) => {
|
|
297
|
+
l((f) => ({
|
|
298
|
+
...f,
|
|
299
|
+
[x]: { name: x, callback: u }
|
|
300
300
|
}));
|
|
301
301
|
},
|
|
302
|
-
removeLocalModal: (
|
|
302
|
+
removeLocalModal: (x) => {
|
|
303
303
|
l((u) => {
|
|
304
|
-
const
|
|
305
|
-
return delete
|
|
304
|
+
const f = { ...u };
|
|
305
|
+
return delete f[x], f;
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ O(Be.Provider, { value: d, children: e });
|
|
310
310
|
}, Xe = () => {
|
|
311
311
|
const e = R(Be);
|
|
312
312
|
if (e === null)
|
|
@@ -314,48 +314,51 @@ const Sn = ({ children: e }) => {
|
|
|
314
314
|
return e;
|
|
315
315
|
}, bt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Fn = (e) => {
|
|
316
316
|
e.initialPage && (Nt = e.initialPage.version), e.resolveComponent && (At = e.resolveComponent);
|
|
317
|
-
}, Cl = (e, t) => (Fn(t), /* @__PURE__ */
|
|
317
|
+
}, Cl = (e, t) => (Fn(t), /* @__PURE__ */ O(Sn, { children: /* @__PURE__ */ O(e, { ...t, children: ({ Component: r, props: l, key: i }) => /* @__PURE__ */ se(ft, { children: [
|
|
318
318
|
(() => {
|
|
319
|
-
const s = Re(r, { key:
|
|
320
|
-
return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((
|
|
319
|
+
const s = Re(r, { key: i, ...l });
|
|
320
|
+
return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((p, c) => Re(c, l, p)) : s;
|
|
321
321
|
})(),
|
|
322
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ O(Cn, {})
|
|
323
323
|
] }) }) })), Cn = ({ children: e }) => {
|
|
324
|
-
var
|
|
325
|
-
const t = R(Be);
|
|
326
|
-
let
|
|
327
|
-
M(() => Ee.on("start", () =>
|
|
328
|
-
() => Ee.on("navigate", function(
|
|
329
|
-
const
|
|
330
|
-
if (!
|
|
331
|
-
|
|
324
|
+
var o, p;
|
|
325
|
+
const t = R(Be), n = bn();
|
|
326
|
+
let r = !1, l = !1, i = !!((o = n.props) != null && o._inertiaui_modal);
|
|
327
|
+
M(() => Ee.on("start", () => r = !0), []), M(() => Ee.on("finish", () => r = !1), []), M(
|
|
328
|
+
() => Ee.on("navigate", function(c) {
|
|
329
|
+
const v = c.detail.page.props._inertiaui_modal;
|
|
330
|
+
if (!v) {
|
|
331
|
+
l && t.closeAll(), me = null, i = !1;
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
|
|
335
|
-
if (!
|
|
334
|
+
l = v, me = v.baseUrl, t.pushFromResponseData(v, {}, () => {
|
|
335
|
+
if (!v.baseUrl) {
|
|
336
336
|
console.error("No base url in modal response data so cannot navigate back");
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
!
|
|
339
|
+
!r && window.location.href !== v.baseUrl && Ee.visit(v.baseUrl, {
|
|
340
340
|
preserveScroll: !0,
|
|
341
341
|
preserveState: !0
|
|
342
342
|
});
|
|
343
|
-
}).then((
|
|
344
|
-
lt =
|
|
343
|
+
}).then((y) => {
|
|
344
|
+
lt = y;
|
|
345
345
|
});
|
|
346
346
|
}),
|
|
347
347
|
[]
|
|
348
348
|
);
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
const a = (c) => {
|
|
350
|
+
var v;
|
|
351
|
+
return c.headers["X-InertiaUI-Modal-Base-Url"] = me ?? (i ? (v = n.props._inertiaui_modal) == null ? void 0 : v.baseUrl : null), c;
|
|
352
|
+
};
|
|
353
|
+
M(() => (De.interceptors.request.use(a), () => De.interceptors.request.eject(a)), []);
|
|
354
|
+
const s = T();
|
|
352
355
|
return M(() => {
|
|
353
|
-
var
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
}, [(
|
|
356
|
+
var y, g;
|
|
357
|
+
const c = (y = n.props) == null ? void 0 : y._inertiaui_modal, v = s.current;
|
|
358
|
+
s.current = c, c && v && c.component === v.component && Tn(c.url, v.url) && ((g = t.stack[0]) == null || g.updateProps(c.props ?? {}));
|
|
359
|
+
}, [(p = n.props) == null ? void 0 : p._inertiaui_modal]), /* @__PURE__ */ se(ft, { children: [
|
|
357
360
|
e,
|
|
358
|
-
t.stack.length > 0 && /* @__PURE__ */
|
|
361
|
+
t.stack.length > 0 && /* @__PURE__ */ O(It, { index: 0 })
|
|
359
362
|
] });
|
|
360
363
|
}, pt = E.createContext(null);
|
|
361
364
|
pt.displayName = "ModalIndexContext";
|
|
@@ -366,18 +369,18 @@ const kt = () => {
|
|
|
366
369
|
return e;
|
|
367
370
|
}, It = ({ index: e }) => {
|
|
368
371
|
const { stack: t } = Xe(), n = C(() => t[e], [t, e]);
|
|
369
|
-
return (n == null ? void 0 : n.component) && /* @__PURE__ */
|
|
372
|
+
return (n == null ? void 0 : n.component) && /* @__PURE__ */ O(pt.Provider, { value: e, children: /* @__PURE__ */ O(
|
|
370
373
|
n.component,
|
|
371
374
|
{
|
|
372
375
|
...n.props,
|
|
373
376
|
onModalEvent: (...r) => n.emit(...r)
|
|
374
377
|
}
|
|
375
378
|
) });
|
|
376
|
-
}, Rt = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess:
|
|
377
|
-
const
|
|
379
|
+
}, Rt = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: i = null, ...a }, s) => {
|
|
380
|
+
const o = kt(), { stack: p, registerLocalModal: c, removeLocalModal: v } = Xe(), [y, g] = S(null), d = C(() => e ? y : p[o], [e, y, o, p]), x = C(() => {
|
|
378
381
|
var h;
|
|
379
|
-
return (h =
|
|
380
|
-
}, [
|
|
382
|
+
return (h = p.find(($) => $.shouldRender && $.index > (d == null ? void 0 : d.index))) == null ? void 0 : h.index;
|
|
383
|
+
}, [o, p]), u = C(() => (d == null ? void 0 : d.config.slideover) ?? a.slideover ?? mt("type") === "slideover", [a.slideover]), f = C(
|
|
381
384
|
() => ({
|
|
382
385
|
slideover: u,
|
|
383
386
|
closeButton: a.closeButton ?? ce(u, "closeButton"),
|
|
@@ -393,80 +396,80 @@ const kt = () => {
|
|
|
393
396
|
M(() => {
|
|
394
397
|
if (e) {
|
|
395
398
|
let h = null;
|
|
396
|
-
return
|
|
397
|
-
h = $.registerEventListenersFromProps(a),
|
|
399
|
+
return c(e, ($) => {
|
|
400
|
+
h = $.registerEventListenersFromProps(a), g($);
|
|
398
401
|
}), () => {
|
|
399
|
-
h == null || h(), h = null,
|
|
402
|
+
h == null || h(), h = null, v(e);
|
|
400
403
|
};
|
|
401
404
|
}
|
|
402
405
|
return d.registerEventListenersFromProps(a);
|
|
403
406
|
}, [e]);
|
|
404
|
-
const
|
|
407
|
+
const m = T(d);
|
|
405
408
|
M(() => {
|
|
406
|
-
|
|
409
|
+
m.current = d;
|
|
407
410
|
}, [d]), M(() => {
|
|
408
|
-
d !== null && (d.isOpen ?
|
|
411
|
+
d !== null && (d.isOpen ? i == null || i() : l == null || l());
|
|
409
412
|
}, [d == null ? void 0 : d.isOpen]);
|
|
410
|
-
const [
|
|
413
|
+
const [w, b] = S(!1);
|
|
411
414
|
return M(() => {
|
|
412
|
-
|
|
415
|
+
w && d !== null && d.isOpen && (d.onTopOfStack ? n == null || n() : r == null || r()), b(!0);
|
|
413
416
|
}, [d == null ? void 0 : d.onTopOfStack]), Ft(
|
|
414
417
|
s,
|
|
415
418
|
() => ({
|
|
416
419
|
afterLeave: () => {
|
|
417
420
|
var h;
|
|
418
|
-
return (h =
|
|
421
|
+
return (h = m.current) == null ? void 0 : h.afterLeave();
|
|
419
422
|
},
|
|
420
423
|
close: () => {
|
|
421
424
|
var h;
|
|
422
|
-
return (h =
|
|
425
|
+
return (h = m.current) == null ? void 0 : h.close();
|
|
423
426
|
},
|
|
424
427
|
emit: (...h) => {
|
|
425
428
|
var $;
|
|
426
|
-
return ($ =
|
|
429
|
+
return ($ = m.current) == null ? void 0 : $.emit(...h);
|
|
427
430
|
},
|
|
428
431
|
getChildModal: () => {
|
|
429
432
|
var h;
|
|
430
|
-
return (h =
|
|
433
|
+
return (h = m.current) == null ? void 0 : h.getChildModal();
|
|
431
434
|
},
|
|
432
435
|
getParentModal: () => {
|
|
433
436
|
var h;
|
|
434
|
-
return (h =
|
|
437
|
+
return (h = m.current) == null ? void 0 : h.getParentModal();
|
|
435
438
|
},
|
|
436
439
|
reload: (...h) => {
|
|
437
440
|
var $;
|
|
438
|
-
return ($ =
|
|
441
|
+
return ($ = m.current) == null ? void 0 : $.reload(...h);
|
|
439
442
|
},
|
|
440
443
|
setOpen: () => {
|
|
441
444
|
var h;
|
|
442
|
-
return (h =
|
|
445
|
+
return (h = m.current) == null ? void 0 : h.setOpen();
|
|
443
446
|
},
|
|
444
447
|
get id() {
|
|
445
448
|
var h;
|
|
446
|
-
return (h =
|
|
449
|
+
return (h = m.current) == null ? void 0 : h.id;
|
|
447
450
|
},
|
|
448
451
|
get index() {
|
|
449
452
|
var h;
|
|
450
|
-
return (h =
|
|
453
|
+
return (h = m.current) == null ? void 0 : h.index;
|
|
451
454
|
},
|
|
452
455
|
get isOpen() {
|
|
453
456
|
var h;
|
|
454
|
-
return (h =
|
|
457
|
+
return (h = m.current) == null ? void 0 : h.isOpen;
|
|
455
458
|
},
|
|
456
459
|
get config() {
|
|
457
460
|
var h;
|
|
458
|
-
return (h =
|
|
461
|
+
return (h = m.current) == null ? void 0 : h.config;
|
|
459
462
|
},
|
|
460
463
|
get modalContext() {
|
|
461
|
-
return
|
|
464
|
+
return m.current;
|
|
462
465
|
},
|
|
463
466
|
get onTopOfStack() {
|
|
464
467
|
var h;
|
|
465
|
-
return (h =
|
|
468
|
+
return (h = m.current) == null ? void 0 : h.onTopOfStack;
|
|
466
469
|
},
|
|
467
470
|
get shouldRender() {
|
|
468
471
|
var h;
|
|
469
|
-
return (h =
|
|
472
|
+
return (h = m.current) == null ? void 0 : h.shouldRender;
|
|
470
473
|
}
|
|
471
474
|
}),
|
|
472
475
|
[d]
|
|
@@ -474,7 +477,7 @@ const kt = () => {
|
|
|
474
477
|
typeof t == "function" ? t({
|
|
475
478
|
afterLeave: d.afterLeave,
|
|
476
479
|
close: d.close,
|
|
477
|
-
config:
|
|
480
|
+
config: f,
|
|
478
481
|
emit: d.emit,
|
|
479
482
|
getChildModal: d.getChildModal,
|
|
480
483
|
getParentModal: d.getParentModal,
|
|
@@ -487,7 +490,7 @@ const kt = () => {
|
|
|
487
490
|
setOpen: d.setOpen,
|
|
488
491
|
shouldRender: d.shouldRender
|
|
489
492
|
}) : t,
|
|
490
|
-
|
|
493
|
+
x && /* @__PURE__ */ O(It, { index: x })
|
|
491
494
|
] });
|
|
492
495
|
});
|
|
493
496
|
Rt.displayName = "HeadlessModal";
|
|
@@ -543,8 +546,8 @@ function qe(e) {
|
|
|
543
546
|
}));
|
|
544
547
|
}
|
|
545
548
|
function re() {
|
|
546
|
-
let e = [], t = { addEventListener(n, r, l,
|
|
547
|
-
return n.addEventListener(r, l,
|
|
549
|
+
let e = [], t = { addEventListener(n, r, l, i) {
|
|
550
|
+
return n.addEventListener(r, l, i), t.add(() => n.removeEventListener(r, l, i));
|
|
548
551
|
}, requestAnimationFrame(...n) {
|
|
549
552
|
let r = requestAnimationFrame(...n);
|
|
550
553
|
return t.add(() => cancelAnimationFrame(r));
|
|
@@ -561,9 +564,9 @@ function re() {
|
|
|
561
564
|
r.current = !1;
|
|
562
565
|
});
|
|
563
566
|
}, style(n, r, l) {
|
|
564
|
-
let
|
|
567
|
+
let i = n.style.getPropertyValue(r);
|
|
565
568
|
return Object.assign(n.style, { [r]: l }), this.add(() => {
|
|
566
|
-
Object.assign(n.style, { [r]:
|
|
569
|
+
Object.assign(n.style, { [r]: i });
|
|
567
570
|
});
|
|
568
571
|
}, group(n) {
|
|
569
572
|
let r = re();
|
|
@@ -586,7 +589,7 @@ let k = (e, t) => {
|
|
|
586
589
|
ae.isServer ? M(e, t) : hn(e, t);
|
|
587
590
|
};
|
|
588
591
|
function ue(e) {
|
|
589
|
-
let t =
|
|
592
|
+
let t = T(e);
|
|
590
593
|
return k(() => {
|
|
591
594
|
t.current = e;
|
|
592
595
|
}, [e]), t;
|
|
@@ -614,51 +617,51 @@ function W() {
|
|
|
614
617
|
let e = jn();
|
|
615
618
|
return Y((t) => Dn({ mergeRefs: e, ...t }), [e]);
|
|
616
619
|
}
|
|
617
|
-
function Dn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible:
|
|
620
|
+
function Dn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: i = !0, name: a, mergeRefs: s }) {
|
|
618
621
|
s = s ?? Un;
|
|
619
|
-
let
|
|
620
|
-
if (
|
|
621
|
-
let
|
|
622
|
-
if (
|
|
623
|
-
let { static:
|
|
624
|
-
if (
|
|
622
|
+
let o = jt(t, e);
|
|
623
|
+
if (i) return Ie(o, n, r, a, s);
|
|
624
|
+
let p = l ?? 0;
|
|
625
|
+
if (p & 2) {
|
|
626
|
+
let { static: c = !1, ...v } = o;
|
|
627
|
+
if (c) return Ie(v, n, r, a, s);
|
|
625
628
|
}
|
|
626
|
-
if (
|
|
627
|
-
let { unmount:
|
|
628
|
-
return ne(
|
|
629
|
+
if (p & 1) {
|
|
630
|
+
let { unmount: c = !0, ...v } = o;
|
|
631
|
+
return ne(c ? 0 : 1, { 0() {
|
|
629
632
|
return null;
|
|
630
633
|
}, 1() {
|
|
631
|
-
return Ie({ ...
|
|
634
|
+
return Ie({ ...v, hidden: !0, style: { display: "none" } }, n, r, a, s);
|
|
632
635
|
} });
|
|
633
636
|
}
|
|
634
|
-
return Ie(
|
|
637
|
+
return Ie(o, n, r, a, s);
|
|
635
638
|
}
|
|
636
639
|
function Ie(e, t = {}, n, r, l) {
|
|
637
|
-
let { as:
|
|
638
|
-
"className" in
|
|
639
|
-
let
|
|
640
|
+
let { as: i = n, children: a, refName: s = "ref", ...o } = rt(e, ["unmount", "static"]), p = e.ref !== void 0 ? { [s]: e.ref } : {}, c = typeof a == "function" ? a(t) : a;
|
|
641
|
+
"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 v = {};
|
|
640
643
|
if (t) {
|
|
641
|
-
let
|
|
642
|
-
for (let [d,
|
|
643
|
-
if (
|
|
644
|
-
|
|
645
|
-
for (let d of
|
|
644
|
+
let y = !1, g = [];
|
|
645
|
+
for (let [d, x] of Object.entries(t)) typeof x == "boolean" && (y = !0), x === !0 && g.push(d.replace(/([A-Z])/g, (u) => `-${u.toLowerCase()}`));
|
|
646
|
+
if (y) {
|
|
647
|
+
v["data-headlessui-state"] = g.join(" ");
|
|
648
|
+
for (let d of g) v[`data-${d}`] = "";
|
|
646
649
|
}
|
|
647
650
|
}
|
|
648
|
-
if (
|
|
649
|
-
if (Object.keys(le(
|
|
650
|
-
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((
|
|
651
|
+
if (i === G && (Object.keys(le(o)).length > 0 || Object.keys(le(v)).length > 0)) if (!vn(c) || Array.isArray(c) && c.length > 1) {
|
|
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(v))).map((y) => ` - ${y}`).join(`
|
|
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((y) => ` - ${y}`).join(`
|
|
651
654
|
`)].join(`
|
|
652
655
|
`));
|
|
653
656
|
} else {
|
|
654
|
-
let
|
|
655
|
-
for (let
|
|
656
|
-
return gn(
|
|
657
|
+
let y = c.props, g = y == null ? void 0 : y.className, d = typeof g == "function" ? (...f) => it(g(...f), o.className) : it(g, o.className), x = d ? { className: d } : {}, u = jt(c.props, le(rt(o, ["ref"])));
|
|
658
|
+
for (let f in v) f in u && delete v[f];
|
|
659
|
+
return gn(c, Object.assign({}, u, v, p, { ref: l(Hn(c), p.ref) }, x));
|
|
657
660
|
}
|
|
658
|
-
return Re(
|
|
661
|
+
return Re(i, Object.assign({}, rt(o, ["ref"]), i !== G && p, i !== G && v), c);
|
|
659
662
|
}
|
|
660
663
|
function jn() {
|
|
661
|
-
let e =
|
|
664
|
+
let e = T([]), t = Y((n) => {
|
|
662
665
|
for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n);
|
|
663
666
|
}, []);
|
|
664
667
|
return (...n) => {
|
|
@@ -676,14 +679,14 @@ function jt(...e) {
|
|
|
676
679
|
let t = {}, n = {};
|
|
677
680
|
for (let r of e) for (let l in r) l.startsWith("on") && typeof r[l] == "function" ? (n[l] != null || (n[l] = []), n[l].push(r[l])) : t[l] = r[l];
|
|
678
681
|
if (t.disabled || t["aria-disabled"]) for (let r in n) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r) && (n[r] = [(l) => {
|
|
679
|
-
var
|
|
680
|
-
return (
|
|
682
|
+
var i;
|
|
683
|
+
return (i = l == null ? void 0 : l.preventDefault) == null ? void 0 : i.call(l);
|
|
681
684
|
}]);
|
|
682
|
-
for (let r in n) Object.assign(t, { [r](l, ...
|
|
685
|
+
for (let r in n) Object.assign(t, { [r](l, ...i) {
|
|
683
686
|
let a = n[r];
|
|
684
687
|
for (let s of a) {
|
|
685
688
|
if ((l instanceof Event || (l == null ? void 0 : l.nativeEvent) instanceof Event) && l.defaultPrevented) return;
|
|
686
|
-
s(l, ...
|
|
689
|
+
s(l, ...i);
|
|
687
690
|
}
|
|
688
691
|
} });
|
|
689
692
|
return t;
|
|
@@ -709,15 +712,15 @@ let Wn = "span";
|
|
|
709
712
|
var He = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(He || {});
|
|
710
713
|
function _n(e, t) {
|
|
711
714
|
var n;
|
|
712
|
-
let { features: r = 1, ...l } = e,
|
|
713
|
-
return W()({ ourProps:
|
|
715
|
+
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 W()({ ourProps: i, theirProps: l, slot: {}, defaultTag: Wn, name: "Hidden" });
|
|
714
717
|
}
|
|
715
718
|
let ot = D(_n), Ut = Symbol();
|
|
716
719
|
function Bn(e, t = !0) {
|
|
717
720
|
return Object.assign(e, { [Ut]: t });
|
|
718
721
|
}
|
|
719
722
|
function Z(...e) {
|
|
720
|
-
let t =
|
|
723
|
+
let t = T(e);
|
|
721
724
|
M(() => {
|
|
722
725
|
t.current = e;
|
|
723
726
|
}, [e]);
|
|
@@ -739,19 +742,19 @@ function Ht() {
|
|
|
739
742
|
function Xn() {
|
|
740
743
|
let [e, t] = S([]);
|
|
741
744
|
return [e.length > 0 ? e.join(" ") : void 0, C(() => function(n) {
|
|
742
|
-
let r = L((
|
|
743
|
-
let s = a.slice(),
|
|
744
|
-
return
|
|
745
|
+
let r = L((i) => (t((a) => [...a, i]), () => t((a) => {
|
|
746
|
+
let s = a.slice(), o = s.indexOf(i);
|
|
747
|
+
return o !== -1 && s.splice(o, 1), s;
|
|
745
748
|
}))), l = C(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
|
|
746
749
|
return E.createElement(vt.Provider, { value: l }, n.children);
|
|
747
750
|
}, [t])];
|
|
748
751
|
}
|
|
749
752
|
let Vn = "p";
|
|
750
753
|
function qn(e, t) {
|
|
751
|
-
let n = Me(), r = Rn(), { id: l = `headlessui-description-${n}`, ...
|
|
754
|
+
let n = Me(), r = Rn(), { id: l = `headlessui-description-${n}`, ...i } = e, a = Ht(), s = Z(t);
|
|
752
755
|
k(() => a.register(l), [l, a.register]);
|
|
753
|
-
let
|
|
754
|
-
return W()({ ourProps:
|
|
756
|
+
let o = r || !1, p = C(() => ({ ...a.slot, disabled: o }), [a.slot, o]), c = { ref: s, ...a.props, id: l };
|
|
757
|
+
return W()({ ourProps: c, theirProps: i, slot: p, defaultTag: Vn, name: a.name || "Description" });
|
|
755
758
|
}
|
|
756
759
|
let Yn = D(qn), zn = Object.assign(Yn, {});
|
|
757
760
|
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 || {});
|
|
@@ -775,8 +778,8 @@ function _t(e, t) {
|
|
|
775
778
|
return n;
|
|
776
779
|
}, subscribe(l) {
|
|
777
780
|
return r.add(l), () => r.delete(l);
|
|
778
|
-
}, dispatch(l, ...
|
|
779
|
-
let a = t[l].call(n, ...
|
|
781
|
+
}, dispatch(l, ...i) {
|
|
782
|
+
let a = t[l].call(n, ...i);
|
|
780
783
|
a && (n = a, r.forEach((s) => s()));
|
|
781
784
|
} };
|
|
782
785
|
}
|
|
@@ -796,38 +799,38 @@ function pe(e, t) {
|
|
|
796
799
|
if (k(() => {
|
|
797
800
|
if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
|
|
798
801
|
}, [n, e]), !e) return !1;
|
|
799
|
-
let
|
|
800
|
-
return
|
|
802
|
+
let i = l.indexOf(r), a = l.length;
|
|
803
|
+
return i === -1 && (i = a, a += 1), i === a - 1;
|
|
801
804
|
}
|
|
802
|
-
let at = /* @__PURE__ */ new Map(),
|
|
805
|
+
let at = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map();
|
|
803
806
|
function Et(e) {
|
|
804
807
|
var t;
|
|
805
|
-
let n = (t =
|
|
806
|
-
return
|
|
808
|
+
let n = (t = Te.get(e)) != null ? t : 0;
|
|
809
|
+
return Te.set(e, n + 1), n !== 0 ? () => $t(e) : (at.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => $t(e));
|
|
807
810
|
}
|
|
808
811
|
function $t(e) {
|
|
809
812
|
var t;
|
|
810
|
-
let n = (t =
|
|
811
|
-
if (n === 1 ?
|
|
813
|
+
let n = (t = Te.get(e)) != null ? t : 1;
|
|
814
|
+
if (n === 1 ? Te.delete(e) : Te.set(e, n - 1), n !== 1) return;
|
|
812
815
|
let r = at.get(e);
|
|
813
816
|
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, at.delete(e));
|
|
814
817
|
}
|
|
815
818
|
function Qn(e, { allowed: t, disallowed: n } = {}) {
|
|
816
819
|
let r = pe(e, "inert-others");
|
|
817
820
|
k(() => {
|
|
818
|
-
var l,
|
|
821
|
+
var l, i;
|
|
819
822
|
if (!r) return;
|
|
820
823
|
let a = re();
|
|
821
|
-
for (let
|
|
822
|
-
let s = (
|
|
823
|
-
for (let
|
|
824
|
-
if (!
|
|
825
|
-
let
|
|
826
|
-
if (!
|
|
827
|
-
let
|
|
828
|
-
for (;
|
|
829
|
-
for (let
|
|
830
|
-
|
|
824
|
+
for (let o of (l = n == null ? void 0 : n()) != null ? l : []) o && a.add(Et(o));
|
|
825
|
+
let s = (i = t == null ? void 0 : t()) != null ? i : [];
|
|
826
|
+
for (let o of s) {
|
|
827
|
+
if (!o) continue;
|
|
828
|
+
let p = Ve(o);
|
|
829
|
+
if (!p) continue;
|
|
830
|
+
let c = o.parentElement;
|
|
831
|
+
for (; c && c !== p.body; ) {
|
|
832
|
+
for (let v of c.children) s.some((y) => v.contains(y)) || a.add(Et(v));
|
|
833
|
+
c = c.parentElement;
|
|
831
834
|
}
|
|
832
835
|
}
|
|
833
836
|
return a.dispose;
|
|
@@ -835,23 +838,23 @@ function Qn(e, { allowed: t, disallowed: n } = {}) {
|
|
|
835
838
|
}
|
|
836
839
|
function er(e, t, n) {
|
|
837
840
|
let r = ue((l) => {
|
|
838
|
-
let
|
|
839
|
-
|
|
841
|
+
let i = l.getBoundingClientRect();
|
|
842
|
+
i.x === 0 && i.y === 0 && i.width === 0 && i.height === 0 && n();
|
|
840
843
|
});
|
|
841
844
|
M(() => {
|
|
842
845
|
if (!e) return;
|
|
843
846
|
let l = t === null ? null : t instanceof HTMLElement ? t : t.current;
|
|
844
847
|
if (!l) return;
|
|
845
|
-
let
|
|
848
|
+
let i = re();
|
|
846
849
|
if (typeof ResizeObserver < "u") {
|
|
847
850
|
let a = new ResizeObserver(() => r.current(l));
|
|
848
|
-
a.observe(l),
|
|
851
|
+
a.observe(l), i.add(() => a.disconnect());
|
|
849
852
|
}
|
|
850
853
|
if (typeof IntersectionObserver < "u") {
|
|
851
854
|
let a = new IntersectionObserver(() => r.current(l));
|
|
852
|
-
a.observe(l),
|
|
855
|
+
a.observe(l), i.add(() => a.disconnect());
|
|
853
856
|
}
|
|
854
|
-
return () =>
|
|
857
|
+
return () => i.dispose();
|
|
855
858
|
}, [t, r, e]);
|
|
856
859
|
}
|
|
857
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(","), tr = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
@@ -892,37 +895,37 @@ function sr(e) {
|
|
|
892
895
|
}
|
|
893
896
|
function ur(e, t = (n) => n) {
|
|
894
897
|
return e.slice().sort((n, r) => {
|
|
895
|
-
let l = t(n),
|
|
896
|
-
if (l === null ||
|
|
897
|
-
let a = l.compareDocumentPosition(
|
|
898
|
+
let l = t(n), i = t(r);
|
|
899
|
+
if (l === null || i === null) return 0;
|
|
900
|
+
let a = l.compareDocumentPosition(i);
|
|
898
901
|
return a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
899
902
|
});
|
|
900
903
|
}
|
|
901
904
|
function Pe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
|
|
902
|
-
let
|
|
903
|
-
l.length > 0 && a.length > 1 && (a = a.filter((
|
|
905
|
+
let i = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, a = Array.isArray(e) ? n ? ur(e) : e : t & 64 ? lr(e) : rr(e);
|
|
906
|
+
l.length > 0 && a.length > 1 && (a = a.filter((g) => !l.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === g : d === g))), r = r ?? i.activeElement;
|
|
904
907
|
let s = (() => {
|
|
905
908
|
if (t & 5) return 1;
|
|
906
909
|
if (t & 10) return -1;
|
|
907
910
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
908
|
-
})(),
|
|
911
|
+
})(), o = (() => {
|
|
909
912
|
if (t & 1) return 0;
|
|
910
913
|
if (t & 2) return Math.max(0, a.indexOf(r)) - 1;
|
|
911
914
|
if (t & 4) return Math.max(0, a.indexOf(r)) + 1;
|
|
912
915
|
if (t & 8) return a.length - 1;
|
|
913
916
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
914
|
-
})(),
|
|
917
|
+
})(), p = t & 32 ? { preventScroll: !0 } : {}, c = 0, v = a.length, y;
|
|
915
918
|
do {
|
|
916
|
-
if (
|
|
917
|
-
let
|
|
918
|
-
if (t & 16)
|
|
919
|
+
if (c >= v || c + v <= 0) return 0;
|
|
920
|
+
let g = o + c;
|
|
921
|
+
if (t & 16) g = (g + v) % v;
|
|
919
922
|
else {
|
|
920
|
-
if (
|
|
921
|
-
if (
|
|
923
|
+
if (g < 0) return 3;
|
|
924
|
+
if (g >= v) return 1;
|
|
922
925
|
}
|
|
923
|
-
|
|
924
|
-
} while (
|
|
925
|
-
return t & 6 && sr(
|
|
926
|
+
y = a[g], y == null || y.focus(p), c += s;
|
|
927
|
+
} while (y !== i.activeElement);
|
|
928
|
+
return t & 6 && sr(y) && y.select(), 2;
|
|
926
929
|
}
|
|
927
930
|
function Vt() {
|
|
928
931
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
@@ -937,50 +940,50 @@ function be(e, t, n, r) {
|
|
|
937
940
|
let l = ue(n);
|
|
938
941
|
M(() => {
|
|
939
942
|
if (!e) return;
|
|
940
|
-
function
|
|
943
|
+
function i(a) {
|
|
941
944
|
l.current(a);
|
|
942
945
|
}
|
|
943
|
-
return document.addEventListener(t,
|
|
946
|
+
return document.addEventListener(t, i, r), () => document.removeEventListener(t, i, r);
|
|
944
947
|
}, [e, t, r]);
|
|
945
948
|
}
|
|
946
949
|
function qt(e, t, n, r) {
|
|
947
950
|
let l = ue(n);
|
|
948
951
|
M(() => {
|
|
949
952
|
if (!e) return;
|
|
950
|
-
function
|
|
953
|
+
function i(a) {
|
|
951
954
|
l.current(a);
|
|
952
955
|
}
|
|
953
|
-
return window.addEventListener(t,
|
|
956
|
+
return window.addEventListener(t, i, r), () => window.removeEventListener(t, i, r);
|
|
954
957
|
}, [e, t, r]);
|
|
955
958
|
}
|
|
956
|
-
const
|
|
959
|
+
const Ot = 30;
|
|
957
960
|
function fr(e, t, n) {
|
|
958
|
-
let r = pe(e, "outside-click"), l = ue(n),
|
|
959
|
-
if (
|
|
960
|
-
let
|
|
961
|
-
if (
|
|
962
|
-
let
|
|
963
|
-
return typeof
|
|
961
|
+
let r = pe(e, "outside-click"), l = ue(n), i = Y(function(o, p) {
|
|
962
|
+
if (o.defaultPrevented) return;
|
|
963
|
+
let c = p(o);
|
|
964
|
+
if (c === null || !c.getRootNode().contains(c) || !c.isConnected) return;
|
|
965
|
+
let v = function y(g) {
|
|
966
|
+
return typeof g == "function" ? y(g()) : Array.isArray(g) || g instanceof Set ? g : [g];
|
|
964
967
|
}(t);
|
|
965
|
-
for (let
|
|
966
|
-
return !ir(
|
|
967
|
-
}, [l, t]), a =
|
|
968
|
-
be(r, "pointerdown", (
|
|
969
|
-
var
|
|
970
|
-
a.current = ((
|
|
971
|
-
}, !0), be(r, "mousedown", (
|
|
972
|
-
var
|
|
973
|
-
a.current = ((
|
|
974
|
-
}, !0), be(r, "click", (
|
|
975
|
-
dr() || a.current && (o
|
|
968
|
+
for (let y of v) if (y !== null && (y.contains(c) || o.composed && o.composedPath().includes(y))) return;
|
|
969
|
+
return !ir(c, Xt.Loose) && c.tabIndex !== -1 && o.preventDefault(), l.current(o, c);
|
|
970
|
+
}, [l, t]), a = T(null);
|
|
971
|
+
be(r, "pointerdown", (o) => {
|
|
972
|
+
var p, c;
|
|
973
|
+
a.current = ((c = (p = o.composedPath) == null ? void 0 : p.call(o)) == null ? void 0 : c[0]) || o.target;
|
|
974
|
+
}, !0), be(r, "mousedown", (o) => {
|
|
975
|
+
var p, c;
|
|
976
|
+
a.current = ((c = (p = o.composedPath) == null ? void 0 : p.call(o)) == null ? void 0 : c[0]) || o.target;
|
|
977
|
+
}, !0), be(r, "click", (o) => {
|
|
978
|
+
dr() || a.current && (i(o, () => a.current), a.current = null);
|
|
976
979
|
}, !0);
|
|
977
|
-
let s =
|
|
978
|
-
be(r, "touchstart", (
|
|
979
|
-
s.current.x =
|
|
980
|
-
}, !0), be(r, "touchend", (
|
|
981
|
-
let
|
|
982
|
-
if (!(Math.abs(
|
|
983
|
-
}, !0), qt(r, "blur", (
|
|
980
|
+
let s = T({ x: 0, y: 0 });
|
|
981
|
+
be(r, "touchstart", (o) => {
|
|
982
|
+
s.current.x = o.touches[0].clientX, s.current.y = o.touches[0].clientY;
|
|
983
|
+
}, !0), be(r, "touchend", (o) => {
|
|
984
|
+
let p = { x: o.changedTouches[0].clientX, y: o.changedTouches[0].clientY };
|
|
985
|
+
if (!(Math.abs(p.x - s.current.x) >= Ot || Math.abs(p.y - s.current.y) >= Ot)) return i(o, () => o.target instanceof HTMLElement ? o.target : null);
|
|
986
|
+
}, !0), qt(r, "blur", (o) => i(o, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
984
987
|
}
|
|
985
988
|
function Le(...e) {
|
|
986
989
|
return C(() => Ve(...e), [...e]);
|
|
@@ -989,10 +992,10 @@ function Yt(e, t, n, r) {
|
|
|
989
992
|
let l = ue(n);
|
|
990
993
|
M(() => {
|
|
991
994
|
e = e ?? window;
|
|
992
|
-
function
|
|
995
|
+
function i(a) {
|
|
993
996
|
l.current(a);
|
|
994
997
|
}
|
|
995
|
-
return e.addEventListener(t,
|
|
998
|
+
return e.addEventListener(t, i, r), () => e.removeEventListener(t, i, r);
|
|
996
999
|
}, [e, t, r]);
|
|
997
1000
|
}
|
|
998
1001
|
function mr() {
|
|
@@ -1002,14 +1005,14 @@ function mr() {
|
|
|
1002
1005
|
let r = t.documentElement, l = (n = t.defaultView) != null ? n : window;
|
|
1003
1006
|
e = Math.max(0, l.innerWidth - r.clientWidth);
|
|
1004
1007
|
}, after({ doc: t, d: n }) {
|
|
1005
|
-
let r = t.documentElement, l = Math.max(0, r.clientWidth - r.offsetWidth),
|
|
1006
|
-
n.style(r, "paddingRight", `${
|
|
1008
|
+
let r = t.documentElement, l = Math.max(0, r.clientWidth - r.offsetWidth), i = Math.max(0, e - l);
|
|
1009
|
+
n.style(r, "paddingRight", `${i}px`);
|
|
1007
1010
|
} };
|
|
1008
1011
|
}
|
|
1009
1012
|
function pr() {
|
|
1010
1013
|
return Vt() ? { before({ doc: e, d: t, meta: n }) {
|
|
1011
1014
|
function r(l) {
|
|
1012
|
-
return n.containers.flatMap((
|
|
1015
|
+
return n.containers.flatMap((i) => i()).some((i) => i.contains(l));
|
|
1013
1016
|
}
|
|
1014
1017
|
t.microTask(() => {
|
|
1015
1018
|
var l;
|
|
@@ -1017,34 +1020,34 @@ function pr() {
|
|
|
1017
1020
|
let s = re();
|
|
1018
1021
|
s.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => s.dispose()));
|
|
1019
1022
|
}
|
|
1020
|
-
let
|
|
1023
|
+
let i = (l = window.scrollY) != null ? l : window.pageYOffset, a = null;
|
|
1021
1024
|
t.addEventListener(e, "click", (s) => {
|
|
1022
1025
|
if (s.target instanceof HTMLElement) try {
|
|
1023
|
-
let
|
|
1024
|
-
if (!
|
|
1025
|
-
let { hash:
|
|
1026
|
-
|
|
1026
|
+
let o = s.target.closest("a");
|
|
1027
|
+
if (!o) return;
|
|
1028
|
+
let { hash: p } = new URL(o.href), c = e.querySelector(p);
|
|
1029
|
+
c && !r(c) && (a = c);
|
|
1027
1030
|
} catch {
|
|
1028
1031
|
}
|
|
1029
1032
|
}, !0), t.addEventListener(e, "touchstart", (s) => {
|
|
1030
1033
|
if (s.target instanceof HTMLElement) if (r(s.target)) {
|
|
1031
|
-
let
|
|
1032
|
-
for (;
|
|
1033
|
-
t.style(
|
|
1034
|
+
let o = s.target;
|
|
1035
|
+
for (; o.parentElement && r(o.parentElement); ) o = o.parentElement;
|
|
1036
|
+
t.style(o, "overscrollBehavior", "contain");
|
|
1034
1037
|
} else t.style(s.target, "touchAction", "none");
|
|
1035
1038
|
}), t.addEventListener(e, "touchmove", (s) => {
|
|
1036
1039
|
if (s.target instanceof HTMLElement) {
|
|
1037
1040
|
if (s.target.tagName === "INPUT") return;
|
|
1038
1041
|
if (r(s.target)) {
|
|
1039
|
-
let
|
|
1040
|
-
for (;
|
|
1041
|
-
|
|
1042
|
+
let o = s.target;
|
|
1043
|
+
for (; o.parentElement && o.dataset.headlessuiPortal !== "" && !(o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth); ) o = o.parentElement;
|
|
1044
|
+
o.dataset.headlessuiPortal === "" && s.preventDefault();
|
|
1042
1045
|
} else s.preventDefault();
|
|
1043
1046
|
}
|
|
1044
1047
|
}, { passive: !1 }), t.add(() => {
|
|
1045
1048
|
var s;
|
|
1046
|
-
let
|
|
1047
|
-
|
|
1049
|
+
let o = (s = window.scrollY) != null ? s : window.pageYOffset;
|
|
1050
|
+
i !== o && window.scrollTo(0, i), a && a.isConnected && (a.scrollIntoView({ block: "nearest" }), a = null);
|
|
1048
1051
|
});
|
|
1049
1052
|
});
|
|
1050
1053
|
} } : {};
|
|
@@ -1068,7 +1071,7 @@ let oe = _t(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
|
1068
1071
|
return n && (n.count--, n.meta.delete(t)), this;
|
|
1069
1072
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
|
|
1070
1073
|
let r = { doc: e, d: t, meta: vr(n) }, l = [pr(), mr(), hr()];
|
|
1071
|
-
l.forEach(({ before:
|
|
1074
|
+
l.forEach(({ before: i }) => i == null ? void 0 : i(r)), l.forEach(({ after: i }) => i == null ? void 0 : i(r));
|
|
1072
1075
|
}, SCROLL_ALLOW({ d: e }) {
|
|
1073
1076
|
e.dispose();
|
|
1074
1077
|
}, TEARDOWN({ doc: e }) {
|
|
@@ -1083,24 +1086,24 @@ oe.subscribe(() => {
|
|
|
1083
1086
|
}
|
|
1084
1087
|
});
|
|
1085
1088
|
function gr(e, t, n = () => ({ containers: [] })) {
|
|
1086
|
-
let r = Bt(oe), l = t ? r.get(t) : void 0,
|
|
1089
|
+
let r = Bt(oe), l = t ? r.get(t) : void 0, i = l ? l.count > 0 : !1;
|
|
1087
1090
|
return k(() => {
|
|
1088
1091
|
if (!(!t || !e)) return oe.dispatch("PUSH", t, n), () => oe.dispatch("POP", t, n);
|
|
1089
|
-
}, [e, t]),
|
|
1092
|
+
}, [e, t]), i;
|
|
1090
1093
|
}
|
|
1091
1094
|
function wr(e, t, n = () => [document.body]) {
|
|
1092
1095
|
let r = pe(e, "scroll-lock");
|
|
1093
1096
|
gr(r, t, (l) => {
|
|
1094
|
-
var
|
|
1095
|
-
return { containers: [...(
|
|
1097
|
+
var i;
|
|
1098
|
+
return { containers: [...(i = l.containers) != null ? i : [], n] };
|
|
1096
1099
|
});
|
|
1097
1100
|
}
|
|
1098
1101
|
function xr(e = 0) {
|
|
1099
|
-
let [t, n] = S(e), r = Y((
|
|
1100
|
-
return { flags: t, setFlag: r, addFlag: l, hasFlag:
|
|
1102
|
+
let [t, n] = S(e), r = Y((o) => n(o), [t]), l = Y((o) => n((p) => p | o), [t]), i = Y((o) => (t & o) === o, [t]), a = Y((o) => n((p) => p & ~o), [n]), s = Y((o) => n((p) => p ^ o), [n]);
|
|
1103
|
+
return { flags: t, setFlag: r, addFlag: l, hasFlag: i, removeFlag: a, toggleFlag: s };
|
|
1101
1104
|
}
|
|
1102
|
-
var
|
|
1103
|
-
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((
|
|
1105
|
+
var Tt, Pt;
|
|
1106
|
+
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Tt = process == null ? void 0 : process.env) == null ? void 0 : Tt.NODE_ENV) === "test" && typeof ((Pt = Element == null ? void 0 : Element.prototype) == null ? void 0 : Pt.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
|
|
1104
1107
|
return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
|
|
1105
1108
|
`)), [];
|
|
1106
1109
|
});
|
|
@@ -1111,47 +1114,47 @@ function br(e) {
|
|
|
1111
1114
|
return t;
|
|
1112
1115
|
}
|
|
1113
1116
|
function Er(e, t, n, r) {
|
|
1114
|
-
let [l,
|
|
1117
|
+
let [l, i] = S(n), { hasFlag: a, addFlag: s, removeFlag: o } = xr(e && l ? 3 : 0), p = T(!1), c = T(!1), v = ht();
|
|
1115
1118
|
return k(() => {
|
|
1116
|
-
var
|
|
1119
|
+
var y;
|
|
1117
1120
|
if (e) {
|
|
1118
|
-
if (n &&
|
|
1121
|
+
if (n && i(!0), !t) {
|
|
1119
1122
|
n && s(3);
|
|
1120
1123
|
return;
|
|
1121
1124
|
}
|
|
1122
|
-
return (
|
|
1123
|
-
|
|
1125
|
+
return (y = r == null ? void 0 : r.start) == null || y.call(r, n), $r(t, { inFlight: p, prepare() {
|
|
1126
|
+
c.current ? c.current = !1 : c.current = p.current, p.current = !0, !c.current && (n ? (s(3), o(4)) : (s(4), o(2)));
|
|
1124
1127
|
}, run() {
|
|
1125
|
-
|
|
1128
|
+
c.current ? n ? (o(3), s(4)) : (o(4), s(3)) : n ? o(1) : s(1);
|
|
1126
1129
|
}, done() {
|
|
1127
|
-
var
|
|
1128
|
-
|
|
1130
|
+
var g;
|
|
1131
|
+
c.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (p.current = !1, o(7), n || i(!1), (g = r == null ? void 0 : r.end) == null || g.call(r, n));
|
|
1129
1132
|
} });
|
|
1130
1133
|
}
|
|
1131
|
-
}, [e, n, t,
|
|
1134
|
+
}, [e, n, t, v]), e ? [l, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
1132
1135
|
}
|
|
1133
1136
|
function $r(e, { prepare: t, run: n, done: r, inFlight: l }) {
|
|
1134
|
-
let
|
|
1135
|
-
return
|
|
1136
|
-
n(),
|
|
1137
|
-
|
|
1137
|
+
let i = re();
|
|
1138
|
+
return Tr(e, { prepare: t, inFlight: l }), i.nextFrame(() => {
|
|
1139
|
+
n(), i.requestAnimationFrame(() => {
|
|
1140
|
+
i.add(Or(e, r));
|
|
1138
1141
|
});
|
|
1139
|
-
}),
|
|
1142
|
+
}), i.dispose;
|
|
1140
1143
|
}
|
|
1141
|
-
function
|
|
1144
|
+
function Or(e, t) {
|
|
1142
1145
|
var n, r;
|
|
1143
1146
|
let l = re();
|
|
1144
1147
|
if (!e) return l.dispose;
|
|
1145
|
-
let
|
|
1148
|
+
let i = !1;
|
|
1146
1149
|
l.add(() => {
|
|
1147
|
-
|
|
1150
|
+
i = !0;
|
|
1148
1151
|
});
|
|
1149
1152
|
let a = (r = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((s) => s instanceof CSSTransition)) != null ? r : [];
|
|
1150
1153
|
return a.length === 0 ? (t(), l.dispose) : (Promise.allSettled(a.map((s) => s.finished)).then(() => {
|
|
1151
|
-
|
|
1154
|
+
i || t();
|
|
1152
1155
|
}), l.dispose);
|
|
1153
1156
|
}
|
|
1154
|
-
function
|
|
1157
|
+
function Tr(e, { inFlight: t, prepare: n }) {
|
|
1155
1158
|
if (t != null && t.current) {
|
|
1156
1159
|
n();
|
|
1157
1160
|
return;
|
|
@@ -1160,10 +1163,10 @@ function Or(e, { inFlight: t, prepare: n }) {
|
|
|
1160
1163
|
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
|
|
1161
1164
|
}
|
|
1162
1165
|
function gt(e, t) {
|
|
1163
|
-
let n =
|
|
1166
|
+
let n = T([]), r = L(e);
|
|
1164
1167
|
M(() => {
|
|
1165
1168
|
let l = [...n.current];
|
|
1166
|
-
for (let [
|
|
1169
|
+
for (let [i, a] of t.entries()) if (n.current[i] !== a) {
|
|
1167
1170
|
let s = r(t, l);
|
|
1168
1171
|
return n.current = t, s;
|
|
1169
1172
|
}
|
|
@@ -1197,7 +1200,7 @@ Lr(() => {
|
|
|
1197
1200
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
1198
1201
|
});
|
|
1199
1202
|
function zt(e) {
|
|
1200
|
-
let t = L(e), n =
|
|
1203
|
+
let t = L(e), n = T(!1);
|
|
1201
1204
|
M(() => (n.current = !1, () => {
|
|
1202
1205
|
n.current = !0, qe(() => {
|
|
1203
1206
|
n.current && t();
|
|
@@ -1206,14 +1209,14 @@ function zt(e) {
|
|
|
1206
1209
|
}
|
|
1207
1210
|
function Sr() {
|
|
1208
1211
|
let e = typeof document > "u";
|
|
1209
|
-
return "useSyncExternalStore" in
|
|
1212
|
+
return "useSyncExternalStore" in Oe ? ((t) => t.useSyncExternalStore)(Oe)(() => () => {
|
|
1210
1213
|
}, () => !1, () => !e) : !1;
|
|
1211
1214
|
}
|
|
1212
1215
|
function Se() {
|
|
1213
|
-
let e = Sr(), [t, n] =
|
|
1214
|
-
return t && ae.isHandoffComplete === !1 && n(!1),
|
|
1216
|
+
let e = Sr(), [t, n] = Oe.useState(ae.isHandoffComplete);
|
|
1217
|
+
return t && ae.isHandoffComplete === !1 && n(!1), Oe.useEffect(() => {
|
|
1215
1218
|
t !== !0 && n(!0);
|
|
1216
|
-
}, [t]),
|
|
1219
|
+
}, [t]), Oe.useEffect(() => ae.handoff(), []), e ? !1 : t;
|
|
1217
1220
|
}
|
|
1218
1221
|
let Gt = H(!1);
|
|
1219
1222
|
function Fr() {
|
|
@@ -1223,57 +1226,57 @@ function Mt(e) {
|
|
|
1223
1226
|
return E.createElement(Gt.Provider, { value: e.force }, e.children);
|
|
1224
1227
|
}
|
|
1225
1228
|
function Cr(e) {
|
|
1226
|
-
let t = Fr(), n = R(Zt), r = Le(e), [l,
|
|
1229
|
+
let t = Fr(), n = R(Zt), r = Le(e), [l, i] = S(() => {
|
|
1227
1230
|
var a;
|
|
1228
1231
|
if (!t && n !== null) return (a = n.current) != null ? a : null;
|
|
1229
1232
|
if (ae.isServer) return null;
|
|
1230
1233
|
let s = r == null ? void 0 : r.getElementById("headlessui-portal-root");
|
|
1231
1234
|
if (s) return s;
|
|
1232
1235
|
if (r === null) return null;
|
|
1233
|
-
let
|
|
1234
|
-
return
|
|
1236
|
+
let o = r.createElement("div");
|
|
1237
|
+
return o.setAttribute("id", "headlessui-portal-root"), r.body.appendChild(o);
|
|
1235
1238
|
});
|
|
1236
1239
|
return M(() => {
|
|
1237
1240
|
l !== null && (r != null && r.body.contains(l) || r == null || r.body.appendChild(l));
|
|
1238
1241
|
}, [l, r]), M(() => {
|
|
1239
|
-
t || n !== null &&
|
|
1240
|
-
}, [n,
|
|
1242
|
+
t || n !== null && i(n.current);
|
|
1243
|
+
}, [n, i, t]), l;
|
|
1241
1244
|
}
|
|
1242
1245
|
let Kt = G, Nr = D(function(e, t) {
|
|
1243
|
-
let n = e, r =
|
|
1244
|
-
r.current =
|
|
1245
|
-
}), t),
|
|
1246
|
-
var
|
|
1247
|
-
return ae.isServer ? null : (
|
|
1248
|
-
}),
|
|
1246
|
+
let n = e, r = T(null), l = Z(Bn((v) => {
|
|
1247
|
+
r.current = v;
|
|
1248
|
+
}), t), i = Le(r), a = Cr(r), [s] = S(() => {
|
|
1249
|
+
var v;
|
|
1250
|
+
return ae.isServer ? null : (v = i == null ? void 0 : i.createElement("div")) != null ? v : null;
|
|
1251
|
+
}), o = R(ut), p = Se();
|
|
1249
1252
|
k(() => {
|
|
1250
1253
|
!a || !s || a.contains(s) || (s.setAttribute("data-headlessui-portal", ""), a.appendChild(s));
|
|
1251
1254
|
}, [a, s]), k(() => {
|
|
1252
|
-
if (s &&
|
|
1253
|
-
}, [
|
|
1254
|
-
var
|
|
1255
|
-
!a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((
|
|
1255
|
+
if (s && o) return o.register(s);
|
|
1256
|
+
}, [o, s]), zt(() => {
|
|
1257
|
+
var v;
|
|
1258
|
+
!a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((v = a.parentElement) == null || v.removeChild(a)));
|
|
1256
1259
|
});
|
|
1257
|
-
let
|
|
1258
|
-
return
|
|
1260
|
+
let c = W();
|
|
1261
|
+
return p ? !a || !s ? null : $n(c({ ourProps: { ref: l }, theirProps: n, slot: {}, defaultTag: Kt, name: "Portal" }), s) : null;
|
|
1259
1262
|
});
|
|
1260
1263
|
function Ar(e, t) {
|
|
1261
|
-
let n = Z(t), { enabled: r = !0, ...l } = e,
|
|
1262
|
-
return r ? E.createElement(Nr, { ...l, ref: n }) :
|
|
1264
|
+
let n = Z(t), { enabled: r = !0, ...l } = e, i = W();
|
|
1265
|
+
return r ? E.createElement(Nr, { ...l, ref: n }) : i({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag: Kt, name: "Portal" });
|
|
1263
1266
|
}
|
|
1264
1267
|
let kr = G, Zt = H(null);
|
|
1265
1268
|
function Ir(e, t) {
|
|
1266
|
-
let { target: n, ...r } = e, l = { ref: Z(t) },
|
|
1267
|
-
return E.createElement(Zt.Provider, { value: n },
|
|
1269
|
+
let { target: n, ...r } = e, l = { ref: Z(t) }, i = W();
|
|
1270
|
+
return E.createElement(Zt.Provider, { value: n }, i({ ourProps: l, theirProps: r, defaultTag: kr, name: "Popover.Group" }));
|
|
1268
1271
|
}
|
|
1269
1272
|
let ut = H(null);
|
|
1270
1273
|
function Rr() {
|
|
1271
|
-
let e = R(ut), t =
|
|
1272
|
-
let a = t.current.indexOf(
|
|
1273
|
-
a !== -1 && t.current.splice(a, 1), e && e.unregister(
|
|
1274
|
+
let e = R(ut), t = T([]), n = L((i) => (t.current.push(i), e && e.register(i), () => r(i))), r = L((i) => {
|
|
1275
|
+
let a = t.current.indexOf(i);
|
|
1276
|
+
a !== -1 && t.current.splice(a, 1), e && e.unregister(i);
|
|
1274
1277
|
}), l = C(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
|
|
1275
|
-
return [t, C(() => function({ children:
|
|
1276
|
-
return E.createElement(ut.Provider, { value: l },
|
|
1278
|
+
return [t, C(() => function({ children: i }) {
|
|
1279
|
+
return E.createElement(ut.Provider, { value: l }, i);
|
|
1277
1280
|
}, [l])];
|
|
1278
1281
|
}
|
|
1279
1282
|
let Dr = D(Ar), Jt = D(Ir), jr = Object.assign(Dr, { Group: Jt });
|
|
@@ -1288,31 +1291,31 @@ function Hr() {
|
|
|
1288
1291
|
let [t] = S(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [n, r] = S((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1289
1292
|
return k(() => {
|
|
1290
1293
|
if (!t) return;
|
|
1291
|
-
function l(
|
|
1292
|
-
r(
|
|
1294
|
+
function l(i) {
|
|
1295
|
+
r(i.matches);
|
|
1293
1296
|
}
|
|
1294
1297
|
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1295
1298
|
}, [t]), n;
|
|
1296
1299
|
}
|
|
1297
1300
|
function Wr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
|
|
1298
1301
|
let r = Le(n), l = L(() => {
|
|
1299
|
-
var
|
|
1302
|
+
var i, a;
|
|
1300
1303
|
let s = [];
|
|
1301
|
-
for (let
|
|
1302
|
-
if (t != null && t.current) for (let
|
|
1303
|
-
for (let
|
|
1304
|
+
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
|
+
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((p) => o.contains(p)) || s.push(o));
|
|
1304
1307
|
return s;
|
|
1305
1308
|
});
|
|
1306
|
-
return { resolveContainers: l, contains: L((
|
|
1309
|
+
return { resolveContainers: l, contains: L((i) => l().some((a) => a.contains(i))) };
|
|
1307
1310
|
}
|
|
1308
1311
|
let Qt = H(null);
|
|
1309
1312
|
function Lt({ children: e, node: t }) {
|
|
1310
1313
|
let [n, r] = S(null), l = en(t ?? n);
|
|
1311
|
-
return E.createElement(Qt.Provider, { value: l }, e, l === null && E.createElement(ot, { features: He.Hidden, ref: (
|
|
1314
|
+
return E.createElement(Qt.Provider, { value: l }, e, l === null && E.createElement(ot, { features: He.Hidden, ref: (i) => {
|
|
1312
1315
|
var a, s;
|
|
1313
|
-
if (
|
|
1314
|
-
for (let
|
|
1315
|
-
r(
|
|
1316
|
+
if (i) {
|
|
1317
|
+
for (let o of (s = (a = Ve(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
|
+
r(o);
|
|
1316
1319
|
break;
|
|
1317
1320
|
}
|
|
1318
1321
|
}
|
|
@@ -1323,14 +1326,14 @@ function en(e = null) {
|
|
|
1323
1326
|
return (t = R(Qt)) != null ? t : e;
|
|
1324
1327
|
}
|
|
1325
1328
|
function wt() {
|
|
1326
|
-
let e =
|
|
1329
|
+
let e = T(!1);
|
|
1327
1330
|
return k(() => (e.current = !0, () => {
|
|
1328
1331
|
e.current = !1;
|
|
1329
1332
|
}), []), e;
|
|
1330
1333
|
}
|
|
1331
1334
|
var $e = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))($e || {});
|
|
1332
1335
|
function _r() {
|
|
1333
|
-
let e =
|
|
1336
|
+
let e = T(0);
|
|
1334
1337
|
return qt(!0, "keydown", (t) => {
|
|
1335
1338
|
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
1336
1339
|
}, !0), e;
|
|
@@ -1345,37 +1348,37 @@ function tn(e) {
|
|
|
1345
1348
|
let Br = "div";
|
|
1346
1349
|
var ie = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))(ie || {});
|
|
1347
1350
|
function Xr(e, t) {
|
|
1348
|
-
let n =
|
|
1351
|
+
let n = T(null), r = Z(n, t), { initialFocus: l, initialFocusFallback: i, containers: a, features: s = 15, ...o } = e;
|
|
1349
1352
|
Se() || (s = 0);
|
|
1350
|
-
let
|
|
1351
|
-
zr(s, { ownerDocument:
|
|
1352
|
-
let
|
|
1353
|
-
Kr(s, { ownerDocument:
|
|
1354
|
-
let
|
|
1355
|
-
let
|
|
1356
|
-
|
|
1357
|
-
ne(
|
|
1358
|
-
Pe(
|
|
1353
|
+
let p = Le(n);
|
|
1354
|
+
zr(s, { ownerDocument: p });
|
|
1355
|
+
let c = Gr(s, { ownerDocument: p, container: n, initialFocus: l, initialFocusFallback: i });
|
|
1356
|
+
Kr(s, { ownerDocument: p, container: n, containers: a, previousActiveElement: c });
|
|
1357
|
+
let v = _r(), y = L((m) => {
|
|
1358
|
+
let w = n.current;
|
|
1359
|
+
w && ((b) => b())(() => {
|
|
1360
|
+
ne(v.current, { [$e.Forwards]: () => {
|
|
1361
|
+
Pe(w, J.First, { skipElements: [m.relatedTarget, i] });
|
|
1359
1362
|
}, [$e.Backwards]: () => {
|
|
1360
|
-
Pe(
|
|
1363
|
+
Pe(w, J.Last, { skipElements: [m.relatedTarget, i] });
|
|
1361
1364
|
} });
|
|
1362
1365
|
});
|
|
1363
|
-
}),
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
+
}), g = pe(!!(s & 2), "focus-trap#tab-lock"), d = ht(), x = T(!1), u = { ref: r, onKeyDown(m) {
|
|
1367
|
+
m.key == "Tab" && (x.current = !0, d.requestAnimationFrame(() => {
|
|
1368
|
+
x.current = !1;
|
|
1366
1369
|
}));
|
|
1367
|
-
}, onBlur(
|
|
1370
|
+
}, onBlur(m) {
|
|
1368
1371
|
if (!(s & 4)) return;
|
|
1369
|
-
let
|
|
1370
|
-
n.current instanceof HTMLElement &&
|
|
1371
|
-
let
|
|
1372
|
-
|
|
1373
|
-
} },
|
|
1374
|
-
return E.createElement(E.Fragment, null,
|
|
1372
|
+
let w = tn(a);
|
|
1373
|
+
n.current instanceof HTMLElement && w.add(n.current);
|
|
1374
|
+
let b = m.relatedTarget;
|
|
1375
|
+
b instanceof HTMLElement && b.dataset.headlessuiFocusGuard !== "true" && (nn(w, b) || (x.current ? Pe(n.current, ne(v.current, { [$e.Forwards]: () => J.Next, [$e.Backwards]: () => J.Previous }) | J.WrapAround, { relativeTo: m.target }) : m.target instanceof HTMLElement && Q(m.target)));
|
|
1376
|
+
} }, f = W();
|
|
1377
|
+
return E.createElement(E.Fragment, null, g && E.createElement(ot, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: He.Focusable }), f({ ourProps: u, theirProps: o, defaultTag: Br, name: "FocusTrap" }), g && E.createElement(ot, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: He.Focusable }));
|
|
1375
1378
|
}
|
|
1376
1379
|
let Vr = D(Xr), qr = Object.assign(Vr, { features: ie });
|
|
1377
1380
|
function Yr(e = !0) {
|
|
1378
|
-
let t =
|
|
1381
|
+
let t = T(ee.slice());
|
|
1379
1382
|
return gt(([n], [r]) => {
|
|
1380
1383
|
r === !0 && n === !1 && qe(() => {
|
|
1381
1384
|
t.current.splice(0);
|
|
@@ -1394,48 +1397,48 @@ function zr(e, { ownerDocument: t }) {
|
|
|
1394
1397
|
});
|
|
1395
1398
|
}
|
|
1396
1399
|
function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFallback: l }) {
|
|
1397
|
-
let
|
|
1400
|
+
let i = T(null), a = pe(!!(e & 1), "focus-trap#initial-focus"), s = wt();
|
|
1398
1401
|
return gt(() => {
|
|
1399
1402
|
if (e === 0) return;
|
|
1400
1403
|
if (!a) {
|
|
1401
1404
|
l != null && l.current && Q(l.current);
|
|
1402
1405
|
return;
|
|
1403
1406
|
}
|
|
1404
|
-
let
|
|
1405
|
-
|
|
1407
|
+
let o = n.current;
|
|
1408
|
+
o && qe(() => {
|
|
1406
1409
|
if (!s.current) return;
|
|
1407
|
-
let
|
|
1410
|
+
let p = t == null ? void 0 : t.activeElement;
|
|
1408
1411
|
if (r != null && r.current) {
|
|
1409
|
-
if ((r == null ? void 0 : r.current) ===
|
|
1410
|
-
|
|
1412
|
+
if ((r == null ? void 0 : r.current) === p) {
|
|
1413
|
+
i.current = p;
|
|
1411
1414
|
return;
|
|
1412
1415
|
}
|
|
1413
|
-
} else if (
|
|
1414
|
-
|
|
1416
|
+
} else if (o.contains(p)) {
|
|
1417
|
+
i.current = p;
|
|
1415
1418
|
return;
|
|
1416
1419
|
}
|
|
1417
1420
|
if (r != null && r.current) Q(r.current);
|
|
1418
1421
|
else {
|
|
1419
1422
|
if (e & 16) {
|
|
1420
|
-
if (Pe(
|
|
1421
|
-
} else if (Pe(
|
|
1423
|
+
if (Pe(o, J.First | J.AutoFocus) !== st.Error) return;
|
|
1424
|
+
} else if (Pe(o, J.First) !== st.Error) return;
|
|
1422
1425
|
if (l != null && l.current && (Q(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1423
1426
|
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1424
1427
|
}
|
|
1425
|
-
|
|
1428
|
+
i.current = t == null ? void 0 : t.activeElement;
|
|
1426
1429
|
});
|
|
1427
|
-
}, [l, a, e]),
|
|
1430
|
+
}, [l, a, e]), i;
|
|
1428
1431
|
}
|
|
1429
1432
|
function Kr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
|
|
1430
|
-
let
|
|
1433
|
+
let i = wt(), a = !!(e & 4);
|
|
1431
1434
|
Yt(t == null ? void 0 : t.defaultView, "focus", (s) => {
|
|
1432
|
-
if (!a || !
|
|
1433
|
-
let
|
|
1434
|
-
n.current instanceof HTMLElement &&
|
|
1435
|
-
let
|
|
1436
|
-
if (!
|
|
1437
|
-
let
|
|
1438
|
-
|
|
1435
|
+
if (!a || !i.current) return;
|
|
1436
|
+
let o = tn(r);
|
|
1437
|
+
n.current instanceof HTMLElement && o.add(n.current);
|
|
1438
|
+
let p = l.current;
|
|
1439
|
+
if (!p) return;
|
|
1440
|
+
let c = s.target;
|
|
1441
|
+
c && c instanceof HTMLElement ? nn(o, c) ? (l.current = c, Q(c)) : (s.preventDefault(), s.stopPropagation(), Q(p)) : Q(l.current);
|
|
1439
1442
|
}, !0);
|
|
1440
1443
|
}
|
|
1441
1444
|
function nn(e, t) {
|
|
@@ -1465,95 +1468,95 @@ function Ze(e) {
|
|
|
1465
1468
|
return "children" in e ? Ze(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1466
1469
|
}
|
|
1467
1470
|
function ln(e, t) {
|
|
1468
|
-
let n = ue(e), r =
|
|
1469
|
-
let
|
|
1470
|
-
|
|
1471
|
-
r.current.splice(
|
|
1471
|
+
let n = ue(e), r = T([]), l = wt(), i = ht(), a = L((g, d = te.Hidden) => {
|
|
1472
|
+
let x = r.current.findIndex(({ el: u }) => u === g);
|
|
1473
|
+
x !== -1 && (ne(d, { [te.Unmount]() {
|
|
1474
|
+
r.current.splice(x, 1);
|
|
1472
1475
|
}, [te.Hidden]() {
|
|
1473
|
-
r.current[
|
|
1474
|
-
} }),
|
|
1476
|
+
r.current[x].state = "hidden";
|
|
1477
|
+
} }), i.microTask(() => {
|
|
1475
1478
|
var u;
|
|
1476
1479
|
!Ze(r) && l.current && ((u = n.current) == null || u.call(n));
|
|
1477
1480
|
}));
|
|
1478
|
-
}), s = L((
|
|
1479
|
-
let d = r.current.find(({ el:
|
|
1480
|
-
return d ? d.state !== "visible" && (d.state = "visible") : r.current.push({ el:
|
|
1481
|
-
}),
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
})]), t == null || t.chains.current[d].push([
|
|
1485
|
-
Promise.all(
|
|
1486
|
-
})]), d === "enter" ?
|
|
1487
|
-
}),
|
|
1488
|
-
Promise.all(
|
|
1481
|
+
}), s = L((g) => {
|
|
1482
|
+
let d = r.current.find(({ el: x }) => x === g);
|
|
1483
|
+
return d ? d.state !== "visible" && (d.state = "visible") : r.current.push({ el: g, state: "visible" }), () => a(g, te.Unmount);
|
|
1484
|
+
}), o = T([]), p = T(Promise.resolve()), c = T({ enter: [], leave: [] }), v = L((g, d, x) => {
|
|
1485
|
+
o.current.splice(0), t && (t.chains.current[d] = t.chains.current[d].filter(([u]) => u !== g)), t == null || t.chains.current[d].push([g, new Promise((u) => {
|
|
1486
|
+
o.current.push(u);
|
|
1487
|
+
})]), t == null || t.chains.current[d].push([g, new Promise((u) => {
|
|
1488
|
+
Promise.all(c.current[d].map(([f, m]) => m)).then(() => u());
|
|
1489
|
+
})]), d === "enter" ? p.current = p.current.then(() => t == null ? void 0 : t.wait.current).then(() => x(d)) : x(d);
|
|
1490
|
+
}), y = L((g, d, x) => {
|
|
1491
|
+
Promise.all(c.current[d].splice(0).map(([u, f]) => f)).then(() => {
|
|
1489
1492
|
var u;
|
|
1490
|
-
(u =
|
|
1491
|
-
}).then(() =>
|
|
1493
|
+
(u = o.current.shift()) == null || u();
|
|
1494
|
+
}).then(() => x(d));
|
|
1492
1495
|
});
|
|
1493
|
-
return C(() => ({ children: r, register: s, unregister: a, onStart:
|
|
1496
|
+
return C(() => ({ children: r, register: s, unregister: a, onStart: v, onStop: y, wait: p, chains: c }), [s, a, r, v, y, c, p]);
|
|
1494
1497
|
}
|
|
1495
1498
|
let on = G, an = Ue.RenderStrategy;
|
|
1496
1499
|
function el(e, t) {
|
|
1497
1500
|
var n, r;
|
|
1498
|
-
let { transition: l = !0, beforeEnter:
|
|
1499
|
-
k(() => X(
|
|
1500
|
-
if ($ === te.Hidden &&
|
|
1501
|
+
let { transition: l = !0, beforeEnter: i, afterEnter: a, beforeLeave: s, afterLeave: o, enter: p, enterFrom: c, enterTo: v, entered: y, leave: g, leaveFrom: d, leaveTo: x, ...u } = e, [f, m] = S(null), w = T(null), b = rn(e), h = Z(...b ? [w, t, m] : t === null ? [] : [t]), $ = (n = u.unmount) == null || n ? te.Unmount : te.Hidden, { show: F, appear: j, initial: _ } = Jr(), [A, U] = S(F ? "visible" : "hidden"), B = Qr(), { register: X, unregister: P } = B;
|
|
1502
|
+
k(() => X(w), [X, w]), k(() => {
|
|
1503
|
+
if ($ === te.Hidden && w.current) {
|
|
1501
1504
|
if (F && A !== "visible") {
|
|
1502
1505
|
U("visible");
|
|
1503
1506
|
return;
|
|
1504
1507
|
}
|
|
1505
|
-
return ne(A, { hidden: () => P(
|
|
1508
|
+
return ne(A, { hidden: () => P(w), visible: () => X(w) });
|
|
1506
1509
|
}
|
|
1507
|
-
}, [A,
|
|
1510
|
+
}, [A, w, X, P, F, $]);
|
|
1508
1511
|
let V = Se();
|
|
1509
1512
|
k(() => {
|
|
1510
|
-
if (
|
|
1511
|
-
}, [
|
|
1512
|
-
let Fe = _ && !j, Ce = j && F && _, ve =
|
|
1513
|
-
ve.current || (U("hidden"), P(
|
|
1513
|
+
if (b && V && A === "visible" && w.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
1514
|
+
}, [w, A, V, b]);
|
|
1515
|
+
let Fe = _ && !j, Ce = j && F && _, ve = T(!1), K = ln(() => {
|
|
1516
|
+
ve.current || (U("hidden"), P(w));
|
|
1514
1517
|
}, B), Ne = L((Qe) => {
|
|
1515
1518
|
ve.current = !0;
|
|
1516
1519
|
let ke = Qe ? "enter" : "leave";
|
|
1517
|
-
K.onStart(
|
|
1518
|
-
we === "enter" ?
|
|
1520
|
+
K.onStart(w, ke, (we) => {
|
|
1521
|
+
we === "enter" ? i == null || i() : we === "leave" && (s == null || s());
|
|
1519
1522
|
});
|
|
1520
1523
|
}), N = L((Qe) => {
|
|
1521
1524
|
let ke = Qe ? "enter" : "leave";
|
|
1522
|
-
ve.current = !1, K.onStop(
|
|
1523
|
-
we === "enter" ? a == null || a() : we === "leave" && (
|
|
1524
|
-
}), ke === "leave" && !Ze(K) && (U("hidden"), P(
|
|
1525
|
+
ve.current = !1, K.onStop(w, ke, (we) => {
|
|
1526
|
+
we === "enter" ? a == null || a() : we === "leave" && (o == null || o());
|
|
1527
|
+
}), ke === "leave" && !Ze(K) && (U("hidden"), P(w));
|
|
1525
1528
|
});
|
|
1526
1529
|
M(() => {
|
|
1527
|
-
|
|
1528
|
-
}, [F,
|
|
1529
|
-
let Ae = !(!l || !
|
|
1530
|
+
b && l || (Ne(F), N(F));
|
|
1531
|
+
}, [F, b, l]);
|
|
1532
|
+
let Ae = !(!l || !b || !V || Fe), [, I] = Er(Ae, f, F, { start: Ne, end: N }), dn = le({ ref: h, className: ((r = it(u.className, Ce && p, Ce && c, I.enter && p, I.enter && I.closed && c, I.enter && !I.closed && v, I.leave && g, I.leave && !I.closed && d, I.leave && I.closed && x, !I.transition && F && y)) == null ? void 0 : r.trim()) || void 0, ...br(I) }), ge = 0;
|
|
1530
1533
|
A === "visible" && (ge |= z.Open), A === "hidden" && (ge |= z.Closed), I.enter && (ge |= z.Opening), I.leave && (ge |= z.Closing);
|
|
1531
1534
|
let fn = W();
|
|
1532
1535
|
return E.createElement(Ke.Provider, { value: K }, E.createElement(Pr, { value: ge }, fn({ ourProps: dn, theirProps: u, defaultTag: on, features: an, visible: A === "visible", name: "Transition.Child" })));
|
|
1533
1536
|
}
|
|
1534
1537
|
function tl(e, t) {
|
|
1535
|
-
let { show: n, appear: r = !1, unmount: l = !0, ...
|
|
1538
|
+
let { show: n, appear: r = !1, unmount: l = !0, ...i } = e, a = T(null), s = rn(e), o = Z(...s ? [a, t] : t === null ? [] : [t]);
|
|
1536
1539
|
Se();
|
|
1537
|
-
let
|
|
1538
|
-
if (n === void 0 &&
|
|
1539
|
-
let [
|
|
1540
|
-
n ||
|
|
1541
|
-
}), [
|
|
1540
|
+
let p = ze();
|
|
1541
|
+
if (n === void 0 && p !== null && (n = (p & z.Open) === z.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
1542
|
+
let [c, v] = S(n ? "visible" : "hidden"), y = ln(() => {
|
|
1543
|
+
n || v("hidden");
|
|
1544
|
+
}), [g, d] = S(!0), x = T([n]);
|
|
1542
1545
|
k(() => {
|
|
1543
|
-
|
|
1544
|
-
}, [
|
|
1545
|
-
let u = C(() => ({ show: n, appear: r, initial:
|
|
1546
|
+
g !== !1 && x.current[x.current.length - 1] !== n && (x.current.push(n), d(!1));
|
|
1547
|
+
}, [x, n]);
|
|
1548
|
+
let u = C(() => ({ show: n, appear: r, initial: g }), [n, r, g]);
|
|
1546
1549
|
k(() => {
|
|
1547
|
-
n ?
|
|
1548
|
-
}, [n,
|
|
1549
|
-
let
|
|
1550
|
+
n ? v("visible") : !Ze(y) && a.current !== null && v("hidden");
|
|
1551
|
+
}, [n, y]);
|
|
1552
|
+
let f = { unmount: l }, m = L(() => {
|
|
1550
1553
|
var h;
|
|
1551
|
-
|
|
1552
|
-
}),
|
|
1554
|
+
g && d(!1), (h = e.beforeEnter) == null || h.call(e);
|
|
1555
|
+
}), w = L(() => {
|
|
1553
1556
|
var h;
|
|
1554
|
-
|
|
1555
|
-
}),
|
|
1556
|
-
return E.createElement(Ke.Provider, { value:
|
|
1557
|
+
g && d(!1), (h = e.beforeLeave) == null || h.call(e);
|
|
1558
|
+
}), b = W();
|
|
1559
|
+
return E.createElement(Ke.Provider, { value: y }, E.createElement(Ge.Provider, { value: u }, b({ ourProps: { ...f, as: G, children: E.createElement(sn, { ref: o, ...f, ...i, beforeEnter: m, beforeLeave: w }) }, theirProps: {}, defaultTag: G, features: an, visible: c === "visible", name: "Transition" })));
|
|
1557
1560
|
}
|
|
1558
1561
|
function nl(e, t) {
|
|
1559
1562
|
let n = R(Ge) !== null, r = ze() !== null;
|
|
@@ -1577,59 +1580,59 @@ function ol(e, t) {
|
|
|
1577
1580
|
return ne(t.type, il, e, t);
|
|
1578
1581
|
}
|
|
1579
1582
|
let St = D(function(e, t) {
|
|
1580
|
-
let n = Me(), { id: r = `headlessui-dialog-${n}`, open: l, onClose:
|
|
1583
|
+
let n = Me(), { id: r = `headlessui-dialog-${n}`, open: l, onClose: i, initialFocus: a, role: s = "dialog", autoFocus: o = !0, __demoMode: p = !1, unmount: c = !1, ...v } = e, y = T(!1);
|
|
1581
1584
|
s = function() {
|
|
1582
|
-
return s === "dialog" || s === "alertdialog" ? s : (
|
|
1585
|
+
return s === "dialog" || s === "alertdialog" ? s : (y.current || (y.current = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
1583
1586
|
}();
|
|
1584
|
-
let
|
|
1585
|
-
l === void 0 &&
|
|
1586
|
-
let d =
|
|
1587
|
+
let g = ze();
|
|
1588
|
+
l === void 0 && g !== null && (l = (g & z.Open) === z.Open);
|
|
1589
|
+
let d = T(null), x = Z(d, t), u = Le(d), f = l ? 0 : 1, [m, w] = xn(ol, { titleId: null, descriptionId: null, panelRef: yn() }), b = L(() => i(!1)), h = L((N) => w({ type: 0, id: N })), $ = Se() ? f === 0 : !1, [F, j] = Rr(), _ = { get current() {
|
|
1587
1590
|
var N;
|
|
1588
|
-
return (N =
|
|
1589
|
-
} }, A = en(), { resolveContainers: U } = Wr({ mainTreeNode: A, portals: F, defaultContainers: [_] }), B =
|
|
1590
|
-
Qn(
|
|
1591
|
+
return (N = m.panelRef.current) != null ? N : d.current;
|
|
1592
|
+
} }, A = en(), { resolveContainers: U } = Wr({ mainTreeNode: A, portals: F, defaultContainers: [_] }), B = g !== null ? (g & z.Closing) === z.Closing : !1;
|
|
1593
|
+
Qn(p || B ? !1 : $, { allowed: L(() => {
|
|
1591
1594
|
var N, Ae;
|
|
1592
1595
|
return [(Ae = (N = d.current) == null ? void 0 : N.closest("[data-headlessui-portal]")) != null ? Ae : null];
|
|
1593
1596
|
}), disallowed: L(() => {
|
|
1594
1597
|
var N;
|
|
1595
1598
|
return [(N = A == null ? void 0 : A.closest("body > *:not(#headlessui-portal-root)")) != null ? N : null];
|
|
1596
1599
|
}) }), fr($, U, (N) => {
|
|
1597
|
-
N.preventDefault(),
|
|
1600
|
+
N.preventDefault(), b();
|
|
1598
1601
|
}), Ur($, u == null ? void 0 : u.defaultView, (N) => {
|
|
1599
|
-
N.preventDefault(), N.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(),
|
|
1600
|
-
}), wr(
|
|
1601
|
-
let [X, P] = Xn(), V = C(() => [{ dialogState:
|
|
1602
|
-
$ && !
|
|
1602
|
+
N.preventDefault(), N.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), b();
|
|
1603
|
+
}), wr(p || B ? !1 : $, u, U), er($, d, b);
|
|
1604
|
+
let [X, P] = Xn(), V = C(() => [{ dialogState: f, close: b, setTitleId: h, unmount: c }, m], [f, m, b, h, c]), Fe = C(() => ({ open: f === 0 }), [f]), Ce = { ref: x, id: r, role: s, tabIndex: -1, "aria-modal": p ? void 0 : f === 0 ? !0 : void 0, "aria-labelledby": m.titleId, "aria-describedby": X, unmount: c }, ve = !Hr(), K = ie.None;
|
|
1605
|
+
$ && !p && (K |= ie.RestoreFocus, K |= ie.TabLock, o && (K |= ie.AutoFocus), ve && (K |= ie.InitialFocus));
|
|
1603
1606
|
let Ne = W();
|
|
1604
|
-
return E.createElement(Mr, null, E.createElement(Mt, { force: !0 }, E.createElement(jr, null, E.createElement(xt.Provider, { value: V }, E.createElement(Jt, { target: d }, E.createElement(Mt, { force: !1 }, E.createElement(P, { slot: Fe }, E.createElement(j, null, E.createElement(qr, { initialFocus: a, initialFocusFallback: d, containers: U, features: K }, E.createElement(Kn, { value:
|
|
1607
|
+
return E.createElement(Mr, null, E.createElement(Mt, { force: !0 }, E.createElement(jr, null, E.createElement(xt.Provider, { value: V }, E.createElement(Jt, { target: d }, E.createElement(Mt, { force: !1 }, E.createElement(P, { slot: Fe }, E.createElement(j, null, E.createElement(qr, { initialFocus: a, initialFocusFallback: d, containers: U, features: K }, E.createElement(Kn, { value: b }, Ne({ ourProps: Ce, theirProps: v, slot: Fe, defaultTag: al, features: sl, visible: f === 0, name: "Dialog" })))))))))));
|
|
1605
1608
|
}), al = "div", sl = Ue.RenderStrategy | Ue.Static;
|
|
1606
1609
|
function ul(e, t) {
|
|
1607
|
-
let { transition: n = !1, open: r, ...l } = e,
|
|
1610
|
+
let { transition: n = !1, open: r, ...l } = e, i = ze(), a = e.hasOwnProperty("open") || i !== null, s = e.hasOwnProperty("onClose");
|
|
1608
1611
|
if (!a && !s) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1609
1612
|
if (!a) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1610
1613
|
if (!s) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1611
|
-
if (!
|
|
1614
|
+
if (!i && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
|
|
1612
1615
|
if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);
|
|
1613
1616
|
return (r !== void 0 || n) && !l.static ? E.createElement(Lt, null, E.createElement(un, { show: r, transition: n, unmount: l.unmount }, E.createElement(St, { ref: t, ...l }))) : E.createElement(Lt, null, E.createElement(St, { ref: t, open: r, ...l }));
|
|
1614
1617
|
}
|
|
1615
1618
|
let cl = "div";
|
|
1616
1619
|
function dl(e, t) {
|
|
1617
|
-
let n = Me(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...
|
|
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) => {
|
|
1618
1621
|
u.stopPropagation();
|
|
1619
|
-
}),
|
|
1620
|
-
return E.createElement(
|
|
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" }));
|
|
1621
1624
|
}
|
|
1622
1625
|
let fl = "div";
|
|
1623
1626
|
function ml(e, t) {
|
|
1624
|
-
let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount:
|
|
1625
|
-
return E.createElement(
|
|
1627
|
+
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 : G, p = n ? { unmount: i } : {}, c = W();
|
|
1628
|
+
return E.createElement(o, { ...p }, c({ ourProps: s, theirProps: r, slot: a, defaultTag: fl, name: "Dialog.Backdrop" }));
|
|
1626
1629
|
}
|
|
1627
1630
|
let pl = "h2";
|
|
1628
1631
|
function hl(e, t) {
|
|
1629
|
-
let n = Me(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState:
|
|
1632
|
+
let n = Me(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState: i, setTitleId: a }] = Je("Dialog.Title"), s = Z(t);
|
|
1630
1633
|
M(() => (a(r), () => a(null)), [r, a]);
|
|
1631
|
-
let
|
|
1632
|
-
return W()({ ourProps:
|
|
1634
|
+
let o = C(() => ({ open: i === 0 }), [i]), p = { ref: s, id: r };
|
|
1635
|
+
return W()({ ourProps: p, theirProps: l, slot: o, defaultTag: pl, name: "Dialog.Title" });
|
|
1633
1636
|
}
|
|
1634
1637
|
let vl = D(ul), yt = D(dl);
|
|
1635
1638
|
D(ml);
|
|
@@ -1642,8 +1645,8 @@ function cn({ onClick: e }) {
|
|
|
1642
1645
|
className: "im-close-button text-gray-400 hover:text-gray-500",
|
|
1643
1646
|
onClick: e,
|
|
1644
1647
|
children: [
|
|
1645
|
-
/* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ O("span", { className: "sr-only", children: "Close" }),
|
|
1649
|
+
/* @__PURE__ */ O(
|
|
1647
1650
|
"svg",
|
|
1648
1651
|
{
|
|
1649
1652
|
className: "size-6",
|
|
@@ -1653,7 +1656,7 @@ function cn({ onClick: e }) {
|
|
|
1653
1656
|
strokeWidth: "2",
|
|
1654
1657
|
stroke: "currentColor",
|
|
1655
1658
|
"aria-hidden": "true",
|
|
1656
|
-
children: /* @__PURE__ */
|
|
1659
|
+
children: /* @__PURE__ */ O(
|
|
1657
1660
|
"path",
|
|
1658
1661
|
{
|
|
1659
1662
|
strokeLinecap: "round",
|
|
@@ -1669,7 +1672,7 @@ function cn({ onClick: e }) {
|
|
|
1669
1672
|
}
|
|
1670
1673
|
const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
1671
1674
|
const [r, l] = S(!1);
|
|
1672
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ O("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ O(
|
|
1673
1676
|
"div",
|
|
1674
1677
|
{
|
|
1675
1678
|
className: je("im-modal-positioner flex min-h-full justify-center", {
|
|
@@ -1677,7 +1680,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1677
1680
|
"items-center": t.position === "center",
|
|
1678
1681
|
"items-end": t.position === "bottom"
|
|
1679
1682
|
}),
|
|
1680
|
-
children: /* @__PURE__ */
|
|
1683
|
+
children: /* @__PURE__ */ O(
|
|
1681
1684
|
he,
|
|
1682
1685
|
{
|
|
1683
1686
|
as: "div",
|
|
@@ -1705,7 +1708,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1705
1708
|
className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1706
1709
|
"data-inertiaui-modal-entered": r,
|
|
1707
1710
|
children: [
|
|
1708
|
-
t.closeButton && /* @__PURE__ */
|
|
1711
|
+
t.closeButton && /* @__PURE__ */ O("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ O(cn, { onClick: e.close }) }),
|
|
1709
1712
|
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1710
1713
|
]
|
|
1711
1714
|
}
|
|
@@ -1716,14 +1719,14 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1716
1719
|
) });
|
|
1717
1720
|
}, yl = ({ modalContext: e, config: t, children: n }) => {
|
|
1718
1721
|
const [r, l] = S(!1);
|
|
1719
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ O("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ O(
|
|
1720
1723
|
"div",
|
|
1721
1724
|
{
|
|
1722
1725
|
className: je("im-slideover-positioner flex min-h-full items-center", {
|
|
1723
1726
|
"justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
|
|
1724
1727
|
"justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
|
|
1725
1728
|
}),
|
|
1726
|
-
children: /* @__PURE__ */
|
|
1729
|
+
children: /* @__PURE__ */ O(
|
|
1727
1730
|
he,
|
|
1728
1731
|
{
|
|
1729
1732
|
as: "div",
|
|
@@ -1751,7 +1754,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1751
1754
|
className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1752
1755
|
"data-inertiaui-modal-entered": r,
|
|
1753
1756
|
children: [
|
|
1754
|
-
t.closeButton && /* @__PURE__ */
|
|
1757
|
+
t.closeButton && /* @__PURE__ */ O("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ O(cn, { onClick: e.close }) }),
|
|
1755
1758
|
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1756
1759
|
]
|
|
1757
1760
|
}
|
|
@@ -1760,49 +1763,49 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1760
1763
|
)
|
|
1761
1764
|
}
|
|
1762
1765
|
) });
|
|
1763
|
-
}, bl = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess:
|
|
1764
|
-
const
|
|
1765
|
-
return Ft(
|
|
1766
|
+
}, bl = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: i = null, onAfterLeave: a = null, ...s }, o) => {
|
|
1767
|
+
const p = (v) => typeof t == "function" ? t(v) : t, c = T(null);
|
|
1768
|
+
return Ft(o, () => c.current, [c]), /* @__PURE__ */ O(
|
|
1766
1769
|
Rt,
|
|
1767
1770
|
{
|
|
1768
|
-
ref:
|
|
1771
|
+
ref: c,
|
|
1769
1772
|
name: e,
|
|
1770
1773
|
onFocus: n,
|
|
1771
1774
|
onBlur: r,
|
|
1772
1775
|
onClose: l,
|
|
1773
|
-
onSuccess:
|
|
1776
|
+
onSuccess: i,
|
|
1774
1777
|
...s,
|
|
1775
1778
|
children: ({
|
|
1776
|
-
afterLeave:
|
|
1777
|
-
close:
|
|
1778
|
-
config:
|
|
1779
|
+
afterLeave: v,
|
|
1780
|
+
close: y,
|
|
1781
|
+
config: g,
|
|
1779
1782
|
emit: d,
|
|
1780
|
-
getChildModal:
|
|
1783
|
+
getChildModal: x,
|
|
1781
1784
|
getParentModal: u,
|
|
1782
|
-
id:
|
|
1783
|
-
index:
|
|
1784
|
-
isOpen:
|
|
1785
|
-
modalContext:
|
|
1785
|
+
id: f,
|
|
1786
|
+
index: m,
|
|
1787
|
+
isOpen: w,
|
|
1788
|
+
modalContext: b,
|
|
1786
1789
|
onTopOfStack: h,
|
|
1787
1790
|
reload: $,
|
|
1788
1791
|
setOpen: F,
|
|
1789
1792
|
shouldRender: j
|
|
1790
|
-
}) => /* @__PURE__ */
|
|
1793
|
+
}) => /* @__PURE__ */ O(
|
|
1791
1794
|
un,
|
|
1792
1795
|
{
|
|
1793
1796
|
appear: !0,
|
|
1794
|
-
show:
|
|
1797
|
+
show: w ?? !1,
|
|
1795
1798
|
afterLeave: a,
|
|
1796
1799
|
children: /* @__PURE__ */ se(
|
|
1797
1800
|
wl,
|
|
1798
1801
|
{
|
|
1799
1802
|
as: "div",
|
|
1800
1803
|
className: "im-dialog relative z-20",
|
|
1801
|
-
onClose: () =>
|
|
1802
|
-
"data-inertiaui-modal-id":
|
|
1803
|
-
"data-inertiaui-modal-index":
|
|
1804
|
+
onClose: () => g.closeExplicitly ? null : y(),
|
|
1805
|
+
"data-inertiaui-modal-id": f,
|
|
1806
|
+
"data-inertiaui-modal-index": m,
|
|
1804
1807
|
children: [
|
|
1805
|
-
|
|
1808
|
+
m === 0 ? /* @__PURE__ */ O(
|
|
1806
1809
|
he,
|
|
1807
1810
|
{
|
|
1808
1811
|
enter: "transition transform ease-in-out duration-300",
|
|
@@ -1811,54 +1814,54 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1811
1814
|
leave: "transition transform ease-in-out duration-300",
|
|
1812
1815
|
leaveFrom: "opacity-100",
|
|
1813
1816
|
leaveTo: "opacity-0",
|
|
1814
|
-
children: h ? /* @__PURE__ */
|
|
1817
|
+
children: h ? /* @__PURE__ */ O(
|
|
1815
1818
|
"div",
|
|
1816
1819
|
{
|
|
1817
1820
|
className: "im-backdrop fixed inset-0 z-30 bg-black/75",
|
|
1818
1821
|
"aria-hidden": "true"
|
|
1819
1822
|
}
|
|
1820
|
-
) : /* @__PURE__ */
|
|
1823
|
+
) : /* @__PURE__ */ O("div", {})
|
|
1821
1824
|
}
|
|
1822
1825
|
) : null,
|
|
1823
|
-
|
|
1824
|
-
|
|
1826
|
+
m > 0 && h ? /* @__PURE__ */ O("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
|
|
1827
|
+
g.slideover ? /* @__PURE__ */ O(
|
|
1825
1828
|
yl,
|
|
1826
1829
|
{
|
|
1827
|
-
modalContext:
|
|
1828
|
-
config:
|
|
1829
|
-
children:
|
|
1830
|
-
afterLeave:
|
|
1831
|
-
close:
|
|
1832
|
-
config:
|
|
1830
|
+
modalContext: b,
|
|
1831
|
+
config: g,
|
|
1832
|
+
children: p({
|
|
1833
|
+
afterLeave: v,
|
|
1834
|
+
close: y,
|
|
1835
|
+
config: g,
|
|
1833
1836
|
emit: d,
|
|
1834
|
-
getChildModal:
|
|
1837
|
+
getChildModal: x,
|
|
1835
1838
|
getParentModal: u,
|
|
1836
|
-
id:
|
|
1837
|
-
index:
|
|
1838
|
-
isOpen:
|
|
1839
|
-
modalContext:
|
|
1839
|
+
id: f,
|
|
1840
|
+
index: m,
|
|
1841
|
+
isOpen: w,
|
|
1842
|
+
modalContext: b,
|
|
1840
1843
|
onTopOfStack: h,
|
|
1841
1844
|
reload: $,
|
|
1842
1845
|
setOpen: F,
|
|
1843
1846
|
shouldRender: j
|
|
1844
1847
|
})
|
|
1845
1848
|
}
|
|
1846
|
-
) : /* @__PURE__ */
|
|
1849
|
+
) : /* @__PURE__ */ O(
|
|
1847
1850
|
xl,
|
|
1848
1851
|
{
|
|
1849
|
-
modalContext:
|
|
1850
|
-
config:
|
|
1851
|
-
children:
|
|
1852
|
-
afterLeave:
|
|
1853
|
-
close:
|
|
1854
|
-
config:
|
|
1852
|
+
modalContext: b,
|
|
1853
|
+
config: g,
|
|
1854
|
+
children: p({
|
|
1855
|
+
afterLeave: v,
|
|
1856
|
+
close: y,
|
|
1857
|
+
config: g,
|
|
1855
1858
|
emit: d,
|
|
1856
|
-
getChildModal:
|
|
1859
|
+
getChildModal: x,
|
|
1857
1860
|
getParentModal: u,
|
|
1858
|
-
id:
|
|
1859
|
-
index:
|
|
1860
|
-
isOpen:
|
|
1861
|
-
modalContext:
|
|
1861
|
+
id: f,
|
|
1862
|
+
index: m,
|
|
1863
|
+
isOpen: w,
|
|
1864
|
+
modalContext: b,
|
|
1862
1865
|
onTopOfStack: h,
|
|
1863
1866
|
reload: $,
|
|
1864
1867
|
setOpen: F,
|
|
@@ -1881,51 +1884,51 @@ const kl = ({
|
|
|
1881
1884
|
data: n = {},
|
|
1882
1885
|
as: r = "a",
|
|
1883
1886
|
headers: l = {},
|
|
1884
|
-
queryStringArrayFormat:
|
|
1887
|
+
queryStringArrayFormat: i = "brackets",
|
|
1885
1888
|
onAfterLeave: a = null,
|
|
1886
1889
|
onBlur: s = null,
|
|
1887
|
-
onClose:
|
|
1888
|
-
onError:
|
|
1889
|
-
onFocus:
|
|
1890
|
-
onStart:
|
|
1891
|
-
onSuccess:
|
|
1892
|
-
navigate:
|
|
1890
|
+
onClose: o = null,
|
|
1891
|
+
onError: p = null,
|
|
1892
|
+
onFocus: c = null,
|
|
1893
|
+
onStart: v = null,
|
|
1894
|
+
onSuccess: y = null,
|
|
1895
|
+
navigate: g = null,
|
|
1893
1896
|
children: d,
|
|
1894
|
-
...
|
|
1897
|
+
...x
|
|
1895
1898
|
}) => {
|
|
1896
|
-
const [u,
|
|
1897
|
-
Object.keys(
|
|
1898
|
-
bt.includes(P) || (P.startsWith("on") && typeof
|
|
1899
|
+
const [u, f] = S(!1), [m, w] = S(null), { stack: b, visit: h } = Xe(), $ = C(() => g ?? mt("navigate"), [g]), F = {}, j = {};
|
|
1900
|
+
Object.keys(x).forEach((P) => {
|
|
1901
|
+
bt.includes(P) || (P.startsWith("on") && typeof x[P] == "function" ? P.toLowerCase() in window ? F[P] = x[P] : j[P] = x[P] : F[P] = x[P]);
|
|
1899
1902
|
});
|
|
1900
1903
|
const [_, A] = S(!1);
|
|
1901
1904
|
M(() => {
|
|
1902
|
-
|
|
1903
|
-
}, [
|
|
1905
|
+
m && (m.onTopOfStack && _ ? c == null || c() : !m.onTopOfStack && !_ && (s == null || s()), A(!m.onTopOfStack));
|
|
1906
|
+
}, [b]);
|
|
1904
1907
|
const U = Y(() => {
|
|
1905
|
-
|
|
1906
|
-
}, [
|
|
1907
|
-
|
|
1908
|
+
o == null || o();
|
|
1909
|
+
}, [o]), B = Y(() => {
|
|
1910
|
+
w(null), a == null || a();
|
|
1908
1911
|
}, [a]), X = Y(
|
|
1909
1912
|
(P) => {
|
|
1910
|
-
P == null || P.preventDefault(), !u && (e.startsWith("#") || (
|
|
1913
|
+
P == null || P.preventDefault(), !u && (e.startsWith("#") || (f(!0), v == null || v()), h(
|
|
1911
1914
|
e,
|
|
1912
1915
|
t,
|
|
1913
1916
|
n,
|
|
1914
1917
|
l,
|
|
1915
|
-
Mn(Ct(
|
|
1916
|
-
() => U(
|
|
1918
|
+
Mn(Ct(x, bt)),
|
|
1919
|
+
() => U(b.length),
|
|
1917
1920
|
B,
|
|
1918
|
-
|
|
1921
|
+
i,
|
|
1919
1922
|
$
|
|
1920
1923
|
).then((V) => {
|
|
1921
|
-
|
|
1924
|
+
w(V), V.registerEventListenersFromProps(j), y == null || y();
|
|
1922
1925
|
}).catch((V) => {
|
|
1923
|
-
console.error(V),
|
|
1924
|
-
}).finally(() =>
|
|
1926
|
+
console.error(V), p == null || p(V);
|
|
1927
|
+
}).finally(() => f(!1)));
|
|
1925
1928
|
},
|
|
1926
|
-
[e, t, n, l,
|
|
1929
|
+
[e, t, n, l, i, x, U, B]
|
|
1927
1930
|
);
|
|
1928
|
-
return /* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ O(
|
|
1929
1932
|
r,
|
|
1930
1933
|
{
|
|
1931
1934
|
...F,
|