@inertiaui/modal-react 0.19.3 → 0.19.4
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 +353 -353
- package/dist/inertiaui-modal.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/inertiaui-modal.js
CHANGED
|
@@ -2,8 +2,8 @@ var fn = Object.defineProperty;
|
|
|
2
2
|
var mn = (e, t, n) => t in e ? fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var q = (e, t, n) => mn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as Ee from "react";
|
|
5
|
-
import E, { createContext as H,
|
|
6
|
-
import {
|
|
5
|
+
import E, { createContext as H, useContext as R, useEffect as M, useRef as O, useState as S, createElement as Re, useMemo as C, forwardRef as ct, useImperativeHandle as St, useLayoutEffect as pn, useCallback as Y, Fragment as G, isValidElement as hn, cloneElement as vn, useId as Pe, useSyncExternalStore as gn, useReducer as wn, createRef as yn } from "react";
|
|
6
|
+
import { jsxs as se, Fragment as dt, jsx as T } from "react/jsx-runtime";
|
|
7
7
|
import De from "axios";
|
|
8
8
|
import { router as xe, usePage as xn } from "@inertiajs/react";
|
|
9
9
|
import { mergeDataIntoQueryString as bn } from "@inertiajs/core";
|
|
@@ -47,8 +47,8 @@ class $n {
|
|
|
47
47
|
}
|
|
48
48
|
const r = t.split(".");
|
|
49
49
|
let l = this.config;
|
|
50
|
-
for (let
|
|
51
|
-
l = l[r[
|
|
50
|
+
for (let o = 0; o < r.length - 1; o++)
|
|
51
|
+
l = l[r[o]] = l[r[o]] || {};
|
|
52
52
|
l[r[r.length - 1]] = n;
|
|
53
53
|
}
|
|
54
54
|
get(t) {
|
|
@@ -64,7 +64,7 @@ class $n {
|
|
|
64
64
|
return r;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const _e = new $n(), Ll = () => _e.reset(), Sl = (e, t) => _e.put(e, t), ft = (e) => _e.get(e),
|
|
67
|
+
const _e = new $n(), Ll = () => _e.reset(), Sl = (e, t) => _e.put(e, t), ft = (e) => _e.get(e), ce = (e, t) => _e.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
68
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
|
}
|
|
@@ -82,15 +82,15 @@ function Pn(e) {
|
|
|
82
82
|
}
|
|
83
83
|
function Mn(e, t = 3, n = 10) {
|
|
84
84
|
return new Promise((r, l) => {
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
r(
|
|
85
|
+
const o = e();
|
|
86
|
+
if (o) {
|
|
87
|
+
r(o);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
let
|
|
90
|
+
let a = t * 1e3 / n;
|
|
91
91
|
const s = setInterval(() => {
|
|
92
92
|
const i = e();
|
|
93
|
-
i && (clearInterval(s), r(i)), --
|
|
93
|
+
i && (clearInterval(s), r(i)), --a <= 0 && (clearInterval(s), l(new Error("Condition not met in time")));
|
|
94
94
|
}, n);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
@@ -99,9 +99,9 @@ function we(e) {
|
|
|
99
99
|
}
|
|
100
100
|
const Be = H(null);
|
|
101
101
|
Be.displayName = "ModalStackContext";
|
|
102
|
-
let Ct = null, kt = null, $e = null, rt = null, Ie = [],
|
|
102
|
+
let Ct = null, kt = null, $e = null, rt = null, Ie = [], de = {};
|
|
103
103
|
const Ln = ({ children: e }) => {
|
|
104
|
-
const [t, n] = S([]), [r, l] = S({}),
|
|
104
|
+
const [t, n] = S([]), [r, l] = S({}), o = (v) => {
|
|
105
105
|
n((u) => {
|
|
106
106
|
const m = v([...u]), p = (g) => {
|
|
107
107
|
var x;
|
|
@@ -115,10 +115,10 @@ const Ln = ({ children: e }) => {
|
|
|
115
115
|
M(() => {
|
|
116
116
|
Ie = t;
|
|
117
117
|
}, [t]);
|
|
118
|
-
class
|
|
118
|
+
class a {
|
|
119
119
|
constructor(u, m, p, g, x) {
|
|
120
120
|
q(this, "show", () => {
|
|
121
|
-
|
|
121
|
+
o(
|
|
122
122
|
(u) => u.map((m) => (m.id === this.id && !m.isOpen && (m.isOpen = !0, m.shouldRender = !0), m))
|
|
123
123
|
);
|
|
124
124
|
});
|
|
@@ -126,7 +126,7 @@ const Ln = ({ children: e }) => {
|
|
|
126
126
|
u ? this.show() : this.close();
|
|
127
127
|
});
|
|
128
128
|
q(this, "close", () => {
|
|
129
|
-
|
|
129
|
+
o(
|
|
130
130
|
(u) => u.map((m) => {
|
|
131
131
|
var p;
|
|
132
132
|
return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((g) => {
|
|
@@ -136,7 +136,7 @@ const Ln = ({ children: e }) => {
|
|
|
136
136
|
);
|
|
137
137
|
});
|
|
138
138
|
q(this, "afterLeave", () => {
|
|
139
|
-
this.isOpen ||
|
|
139
|
+
this.isOpen || o((u) => {
|
|
140
140
|
const m = u.map((p) => {
|
|
141
141
|
var g;
|
|
142
142
|
return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (g = p.afterLeaveCallback) == null || g.call(p), p.afterLeaveCallback = null), p;
|
|
@@ -181,19 +181,19 @@ const Ln = ({ children: e }) => {
|
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
183
|
q(this, "updateProps", (u) => {
|
|
184
|
-
Object.assign(this.props, u),
|
|
184
|
+
Object.assign(this.props, u), o((m) => m);
|
|
185
185
|
});
|
|
186
|
-
if (this.id = m.id ?? et(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = m.props, this.response = m, this.config = p ?? {}, this.onCloseCallback = g, this.afterLeaveCallback = x,
|
|
186
|
+
if (this.id = m.id ?? et(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = m.props, this.response = m, this.config = p ?? {}, this.onCloseCallback = g, this.afterLeaveCallback = x, de[this.id]) {
|
|
187
187
|
this.config = {
|
|
188
188
|
...this.config,
|
|
189
|
-
...
|
|
189
|
+
...de[this.id].config ?? {}
|
|
190
190
|
};
|
|
191
|
-
const h =
|
|
191
|
+
const h = de[this.id].onClose, $ = de[this.id].onAfterLeave;
|
|
192
192
|
h && (this.onCloseCallback = g ? () => {
|
|
193
193
|
g(), h();
|
|
194
194
|
} : h), $ && (this.afterLeaveCallback = x ? () => {
|
|
195
195
|
x(), $();
|
|
196
|
-
} : $), delete
|
|
196
|
+
} : $), delete de[this.id];
|
|
197
197
|
}
|
|
198
198
|
this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
|
|
199
199
|
}
|
|
@@ -202,10 +202,10 @@ const Ln = ({ children: e }) => {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
const s = (v, u = {}, m = null, p = null) => kt(v.component).then((g) => i(g, v, u, m, p)), i = (v, u, m, p, g) => {
|
|
205
|
-
const x = new
|
|
206
|
-
return x.index = t.length,
|
|
205
|
+
const x = new a(v, u, m, p, g);
|
|
206
|
+
return x.index = t.length, o((h) => [...h, x]), x.show(), x;
|
|
207
207
|
};
|
|
208
|
-
function
|
|
208
|
+
function c(v, u, m, p) {
|
|
209
209
|
if (!r[v])
|
|
210
210
|
throw new Error(`The local modal "${v}" has not been registered.`);
|
|
211
211
|
const g = i(null, {}, u, m, p);
|
|
@@ -231,7 +231,7 @@ const Ln = ({ children: e }) => {
|
|
|
231
231
|
const j = et();
|
|
232
232
|
return new Promise((_, N) => {
|
|
233
233
|
if (v.startsWith("#")) {
|
|
234
|
-
_(
|
|
234
|
+
_(c(v.substring(1), g, x, h));
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
const [U, B] = bn(u, v || "", m, $);
|
|
@@ -246,7 +246,7 @@ const Ln = ({ children: e }) => {
|
|
|
246
246
|
"X-InertiaUI-Modal-Use-Router": X ? 1 : 0,
|
|
247
247
|
"X-InertiaUI-Modal-Base-Url": $e
|
|
248
248
|
}, X)
|
|
249
|
-
return rt = null,
|
|
249
|
+
return rt = null, de[j] = {
|
|
250
250
|
config: g,
|
|
251
251
|
onClose: x,
|
|
252
252
|
onAfterLeave: h
|
|
@@ -270,7 +270,7 @@ const Ln = ({ children: e }) => {
|
|
|
270
270
|
N(P);
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
|
-
},
|
|
273
|
+
}, d = {
|
|
274
274
|
stack: t,
|
|
275
275
|
localModals: r,
|
|
276
276
|
push: i,
|
|
@@ -279,7 +279,7 @@ const Ln = ({ children: e }) => {
|
|
|
279
279
|
closeAll: () => {
|
|
280
280
|
Ie.reverse().forEach((v) => v.close());
|
|
281
281
|
},
|
|
282
|
-
reset: () =>
|
|
282
|
+
reset: () => o(() => []),
|
|
283
283
|
visit: y,
|
|
284
284
|
visitModal: f,
|
|
285
285
|
registerLocalModal: (v, u) => {
|
|
@@ -295,7 +295,7 @@ const Ln = ({ children: e }) => {
|
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
-
return /* @__PURE__ */ T(Be.Provider, { value:
|
|
298
|
+
return /* @__PURE__ */ T(Be.Provider, { value: d, children: e });
|
|
299
299
|
}, Xe = () => {
|
|
300
300
|
const e = R(Be);
|
|
301
301
|
if (e === null)
|
|
@@ -303,10 +303,10 @@ const Ln = ({ children: e }) => {
|
|
|
303
303
|
return e;
|
|
304
304
|
}, xt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Sn = (e) => {
|
|
305
305
|
e.initialPage && (Ct = e.initialPage.version), e.resolveComponent && (kt = e.resolveComponent);
|
|
306
|
-
}, Fl = (e, t) => (Sn(t), /* @__PURE__ */ T(Ln, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key:
|
|
306
|
+
}, Fl = (e, t) => (Sn(t), /* @__PURE__ */ T(Ln, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key: o }) => /* @__PURE__ */ se(dt, { children: [
|
|
307
307
|
(() => {
|
|
308
|
-
const s = Re(r, { key:
|
|
309
|
-
return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((
|
|
308
|
+
const s = Re(r, { key: o, ...l });
|
|
309
|
+
return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((c, f) => Re(f, l, c)) : s;
|
|
310
310
|
})(),
|
|
311
311
|
/* @__PURE__ */ T(Fn, {})
|
|
312
312
|
] }) }) })), Fn = ({ children: e }) => {
|
|
@@ -315,17 +315,17 @@ const Ln = ({ children: e }) => {
|
|
|
315
315
|
let n = !1, r = !1;
|
|
316
316
|
M(() => xe.on("start", () => n = !0), []), M(() => xe.on("finish", () => n = !1), []), M(
|
|
317
317
|
() => xe.on("navigate", function(i) {
|
|
318
|
-
const
|
|
319
|
-
if (!
|
|
318
|
+
const c = i.detail.page.props._inertiaui_modal;
|
|
319
|
+
if (!c) {
|
|
320
320
|
r && t.closeAll();
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
r =
|
|
324
|
-
if (!
|
|
323
|
+
r = c, $e = c.baseUrl, t.pushFromResponseData(c, {}, () => {
|
|
324
|
+
if (!c.baseUrl) {
|
|
325
325
|
console.error("No base url in modal response data so cannot navigate back");
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
!n && window.location.href !==
|
|
328
|
+
!n && window.location.href !== c.baseUrl && xe.visit(c.baseUrl, {
|
|
329
329
|
preserveScroll: !0,
|
|
330
330
|
preserveState: !0
|
|
331
331
|
});
|
|
@@ -337,12 +337,12 @@ const Ln = ({ children: e }) => {
|
|
|
337
337
|
);
|
|
338
338
|
const l = (i) => (Ie.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = $e), i);
|
|
339
339
|
M(() => (De.interceptors.request.use(l), () => De.interceptors.request.eject(l)), []);
|
|
340
|
-
const
|
|
340
|
+
const o = xn(), a = O();
|
|
341
341
|
return M(() => {
|
|
342
342
|
var f, y;
|
|
343
|
-
const i = (f =
|
|
344
|
-
|
|
345
|
-
}, [(s =
|
|
343
|
+
const i = (f = o.props) == null ? void 0 : f._inertiaui_modal, c = a.current;
|
|
344
|
+
a.current = i, i && c && i.component === c.component && Tn(i.url, c.url) && ((y = t.stack[0]) == null || y.updateProps(i.props ?? {}));
|
|
345
|
+
}, [(s = o.props) == null ? void 0 : s._inertiaui_modal]), /* @__PURE__ */ se(dt, { children: [
|
|
346
346
|
e,
|
|
347
347
|
t.stack.length > 0 && /* @__PURE__ */ T(At, { index: 0 })
|
|
348
348
|
] });
|
|
@@ -362,44 +362,44 @@ const Nt = () => {
|
|
|
362
362
|
onModalEvent: (...r) => n.emit(...r)
|
|
363
363
|
}
|
|
364
364
|
) });
|
|
365
|
-
}, It =
|
|
366
|
-
const i = Nt(), { stack:
|
|
365
|
+
}, It = ct(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, ...a }, s) => {
|
|
366
|
+
const i = Nt(), { stack: c, registerLocalModal: f, removeLocalModal: y } = Xe(), [b, w] = S(null), d = C(() => e ? b : c[i], [e, b, i, c]), v = C(() => {
|
|
367
367
|
var h;
|
|
368
|
-
return (h =
|
|
369
|
-
}, [i,
|
|
368
|
+
return (h = c.find(($) => $.shouldRender && $.index > (d == null ? void 0 : d.index))) == null ? void 0 : h.index;
|
|
369
|
+
}, [i, c]), u = C(() => (d == null ? void 0 : d.config.slideover) ?? a.slideover ?? ft("type") === "slideover", [a.slideover]), m = C(
|
|
370
370
|
() => ({
|
|
371
371
|
slideover: u,
|
|
372
|
-
closeButton:
|
|
373
|
-
closeExplicitly:
|
|
374
|
-
maxWidth:
|
|
375
|
-
paddingClasses:
|
|
376
|
-
panelClasses:
|
|
377
|
-
position:
|
|
378
|
-
...
|
|
372
|
+
closeButton: a.closeButton ?? ce(u, "closeButton"),
|
|
373
|
+
closeExplicitly: a.closeExplicitly ?? ce(u, "closeExplicitly"),
|
|
374
|
+
maxWidth: a.maxWidth ?? ce(u, "maxWidth"),
|
|
375
|
+
paddingClasses: a.paddingClasses ?? ce(u, "paddingClasses"),
|
|
376
|
+
panelClasses: a.panelClasses ?? ce(u, "panelClasses"),
|
|
377
|
+
position: a.position ?? ce(u, "position"),
|
|
378
|
+
...d == null ? void 0 : d.config
|
|
379
379
|
}),
|
|
380
|
-
[
|
|
380
|
+
[a, d == null ? void 0 : d.config]
|
|
381
381
|
);
|
|
382
382
|
M(() => {
|
|
383
383
|
if (e) {
|
|
384
384
|
let h = null;
|
|
385
385
|
return f(e, ($) => {
|
|
386
|
-
h = $.registerEventListenersFromProps(
|
|
386
|
+
h = $.registerEventListenersFromProps(a), w($);
|
|
387
387
|
}), () => {
|
|
388
388
|
h == null || h(), h = null, y(e);
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
|
-
return
|
|
391
|
+
return d.registerEventListenersFromProps(a);
|
|
392
392
|
}, [e]);
|
|
393
|
-
const p = O(
|
|
393
|
+
const p = O(d);
|
|
394
394
|
M(() => {
|
|
395
|
-
p.current =
|
|
396
|
-
}, [
|
|
397
|
-
|
|
398
|
-
}, [
|
|
395
|
+
p.current = d;
|
|
396
|
+
}, [d]), M(() => {
|
|
397
|
+
d !== null && (d.isOpen ? o == null || o() : l == null || l());
|
|
398
|
+
}, [d == null ? void 0 : d.isOpen]);
|
|
399
399
|
const [g, x] = S(!1);
|
|
400
400
|
return M(() => {
|
|
401
|
-
g &&
|
|
402
|
-
}, [
|
|
401
|
+
g && d !== null && d.isOpen && (d.onTopOfStack ? n == null || n() : r == null || r()), x(!0);
|
|
402
|
+
}, [d == null ? void 0 : d.onTopOfStack]), St(
|
|
403
403
|
s,
|
|
404
404
|
() => ({
|
|
405
405
|
afterLeave: () => {
|
|
@@ -458,23 +458,23 @@ const Nt = () => {
|
|
|
458
458
|
return (h = p.current) == null ? void 0 : h.shouldRender;
|
|
459
459
|
}
|
|
460
460
|
}),
|
|
461
|
-
[
|
|
462
|
-
), (
|
|
461
|
+
[d]
|
|
462
|
+
), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ se(dt, { children: [
|
|
463
463
|
typeof t == "function" ? t({
|
|
464
|
-
afterLeave:
|
|
465
|
-
close:
|
|
464
|
+
afterLeave: d.afterLeave,
|
|
465
|
+
close: d.close,
|
|
466
466
|
config: m,
|
|
467
|
-
emit:
|
|
468
|
-
getChildModal:
|
|
469
|
-
getParentModal:
|
|
470
|
-
id:
|
|
471
|
-
index:
|
|
472
|
-
isOpen:
|
|
473
|
-
modalContext:
|
|
474
|
-
onTopOfStack:
|
|
475
|
-
reload:
|
|
476
|
-
setOpen:
|
|
477
|
-
shouldRender:
|
|
467
|
+
emit: d.emit,
|
|
468
|
+
getChildModal: d.getChildModal,
|
|
469
|
+
getParentModal: d.getParentModal,
|
|
470
|
+
id: d.id,
|
|
471
|
+
index: d.index,
|
|
472
|
+
isOpen: d.isOpen,
|
|
473
|
+
modalContext: d,
|
|
474
|
+
onTopOfStack: d.onTopOfStack,
|
|
475
|
+
reload: d.reload,
|
|
476
|
+
setOpen: d.setOpen,
|
|
477
|
+
shouldRender: d.shouldRender
|
|
478
478
|
}) : t,
|
|
479
479
|
v && /* @__PURE__ */ T(At, { index: v })
|
|
480
480
|
] });
|
|
@@ -522,9 +522,9 @@ let Nn = class {
|
|
|
522
522
|
get isHandoffComplete() {
|
|
523
523
|
return this.handoffState === "complete";
|
|
524
524
|
}
|
|
525
|
-
},
|
|
525
|
+
}, ae = new Nn();
|
|
526
526
|
function Ve(e) {
|
|
527
|
-
return
|
|
527
|
+
return ae.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
|
528
528
|
}
|
|
529
529
|
function qe(e) {
|
|
530
530
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
@@ -532,8 +532,8 @@ function qe(e) {
|
|
|
532
532
|
}));
|
|
533
533
|
}
|
|
534
534
|
function re() {
|
|
535
|
-
let e = [], t = { addEventListener(n, r, l,
|
|
536
|
-
return n.addEventListener(r, l,
|
|
535
|
+
let e = [], t = { addEventListener(n, r, l, o) {
|
|
536
|
+
return n.addEventListener(r, l, o), t.add(() => n.removeEventListener(r, l, o));
|
|
537
537
|
}, requestAnimationFrame(...n) {
|
|
538
538
|
let r = requestAnimationFrame(...n);
|
|
539
539
|
return t.add(() => cancelAnimationFrame(r));
|
|
@@ -550,9 +550,9 @@ function re() {
|
|
|
550
550
|
r.current = !1;
|
|
551
551
|
});
|
|
552
552
|
}, style(n, r, l) {
|
|
553
|
-
let
|
|
553
|
+
let o = n.style.getPropertyValue(r);
|
|
554
554
|
return Object.assign(n.style, { [r]: l }), this.add(() => {
|
|
555
|
-
Object.assign(n.style, { [r]:
|
|
555
|
+
Object.assign(n.style, { [r]: o });
|
|
556
556
|
});
|
|
557
557
|
}, group(n) {
|
|
558
558
|
let r = re();
|
|
@@ -572,7 +572,7 @@ function pt() {
|
|
|
572
572
|
return M(() => () => e.dispose(), [e]), e;
|
|
573
573
|
}
|
|
574
574
|
let A = (e, t) => {
|
|
575
|
-
|
|
575
|
+
ae.isServer ? M(e, t) : pn(e, t);
|
|
576
576
|
};
|
|
577
577
|
function ue(e) {
|
|
578
578
|
let t = O(e);
|
|
@@ -603,48 +603,48 @@ function W() {
|
|
|
603
603
|
let e = Dn();
|
|
604
604
|
return Y((t) => Rn({ mergeRefs: e, ...t }), [e]);
|
|
605
605
|
}
|
|
606
|
-
function Rn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible:
|
|
606
|
+
function Rn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: o = !0, name: a, mergeRefs: s }) {
|
|
607
607
|
s = s ?? jn;
|
|
608
608
|
let i = Dt(t, e);
|
|
609
|
-
if (
|
|
610
|
-
let
|
|
611
|
-
if (
|
|
609
|
+
if (o) return Ae(i, n, r, a, s);
|
|
610
|
+
let c = l ?? 0;
|
|
611
|
+
if (c & 2) {
|
|
612
612
|
let { static: f = !1, ...y } = i;
|
|
613
|
-
if (f) return Ae(y, n, r,
|
|
613
|
+
if (f) return Ae(y, n, r, a, s);
|
|
614
614
|
}
|
|
615
|
-
if (
|
|
615
|
+
if (c & 1) {
|
|
616
616
|
let { unmount: f = !0, ...y } = i;
|
|
617
617
|
return ne(f ? 0 : 1, { 0() {
|
|
618
618
|
return null;
|
|
619
619
|
}, 1() {
|
|
620
|
-
return Ae({ ...y, hidden: !0, style: { display: "none" } }, n, r,
|
|
620
|
+
return Ae({ ...y, hidden: !0, style: { display: "none" } }, n, r, a, s);
|
|
621
621
|
} });
|
|
622
622
|
}
|
|
623
|
-
return Ae(i, n, r,
|
|
623
|
+
return Ae(i, n, r, a, s);
|
|
624
624
|
}
|
|
625
625
|
function Ae(e, t = {}, n, r, l) {
|
|
626
|
-
let { as:
|
|
626
|
+
let { as: o = n, children: a, refName: s = "ref", ...i } = nt(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [s]: e.ref } : {}, f = typeof a == "function" ? a(t) : a;
|
|
627
627
|
"className" in i && i.className && typeof i.className == "function" && (i.className = i.className(t)), i["aria-labelledby"] && i["aria-labelledby"] === i.id && (i["aria-labelledby"] = void 0);
|
|
628
628
|
let y = {};
|
|
629
629
|
if (t) {
|
|
630
630
|
let b = !1, w = [];
|
|
631
|
-
for (let [
|
|
631
|
+
for (let [d, v] of Object.entries(t)) typeof v == "boolean" && (b = !0), v === !0 && w.push(d.replace(/([A-Z])/g, (u) => `-${u.toLowerCase()}`));
|
|
632
632
|
if (b) {
|
|
633
633
|
y["data-headlessui-state"] = w.join(" ");
|
|
634
|
-
for (let
|
|
634
|
+
for (let d of w) y[`data-${d}`] = "";
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
if (
|
|
637
|
+
if (o === G && (Object.keys(le(i)).length > 0 || Object.keys(le(y)).length > 0)) if (!hn(f) || Array.isArray(f) && f.length > 1) {
|
|
638
638
|
if (Object.keys(le(i)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(le(i)).concat(Object.keys(le(y))).map((b) => ` - ${b}`).join(`
|
|
639
639
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((b) => ` - ${b}`).join(`
|
|
640
640
|
`)].join(`
|
|
641
641
|
`));
|
|
642
642
|
} else {
|
|
643
|
-
let b = f.props, w = b == null ? void 0 : b.className,
|
|
643
|
+
let b = f.props, w = b == null ? void 0 : b.className, d = typeof w == "function" ? (...m) => lt(w(...m), i.className) : lt(w, i.className), v = d ? { className: d } : {}, u = Dt(f.props, le(nt(i, ["ref"])));
|
|
644
644
|
for (let m in y) m in u && delete y[m];
|
|
645
|
-
return vn(f, Object.assign({}, u, y,
|
|
645
|
+
return vn(f, Object.assign({}, u, y, c, { ref: l(Un(f), c.ref) }, v));
|
|
646
646
|
}
|
|
647
|
-
return Re(
|
|
647
|
+
return Re(o, Object.assign({}, nt(i, ["ref"]), o !== G && c, o !== G && y), f);
|
|
648
648
|
}
|
|
649
649
|
function Dn() {
|
|
650
650
|
let e = O([]), t = Y((n) => {
|
|
@@ -665,21 +665,21 @@ function Dt(...e) {
|
|
|
665
665
|
let t = {}, n = {};
|
|
666
666
|
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];
|
|
667
667
|
if (t.disabled || t["aria-disabled"]) for (let r in n) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r) && (n[r] = [(l) => {
|
|
668
|
-
var
|
|
669
|
-
return (
|
|
668
|
+
var o;
|
|
669
|
+
return (o = l == null ? void 0 : l.preventDefault) == null ? void 0 : o.call(l);
|
|
670
670
|
}]);
|
|
671
|
-
for (let r in n) Object.assign(t, { [r](l, ...
|
|
672
|
-
let
|
|
673
|
-
for (let s of
|
|
671
|
+
for (let r in n) Object.assign(t, { [r](l, ...o) {
|
|
672
|
+
let a = n[r];
|
|
673
|
+
for (let s of a) {
|
|
674
674
|
if ((l instanceof Event || (l == null ? void 0 : l.nativeEvent) instanceof Event) && l.defaultPrevented) return;
|
|
675
|
-
s(l, ...
|
|
675
|
+
s(l, ...o);
|
|
676
676
|
}
|
|
677
677
|
} });
|
|
678
678
|
return t;
|
|
679
679
|
}
|
|
680
680
|
function D(e) {
|
|
681
681
|
var t;
|
|
682
|
-
return Object.assign(
|
|
682
|
+
return Object.assign(ct(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
683
683
|
}
|
|
684
684
|
function le(e) {
|
|
685
685
|
let t = Object.assign({}, e);
|
|
@@ -698,8 +698,8 @@ let Hn = "span";
|
|
|
698
698
|
var He = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(He || {});
|
|
699
699
|
function Wn(e, t) {
|
|
700
700
|
var n;
|
|
701
|
-
let { features: r = 1, ...l } = e,
|
|
702
|
-
return W()({ ourProps:
|
|
701
|
+
let { features: r = 1, ...l } = e, o = { ref: t, "aria-hidden": (r & 2) === 2 ? !0 : (n = l["aria-hidden"]) != null ? n : void 0, hidden: (r & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } };
|
|
702
|
+
return W()({ ourProps: o, theirProps: l, slot: {}, defaultTag: Hn, name: "Hidden" });
|
|
703
703
|
}
|
|
704
704
|
let it = D(Wn), jt = Symbol();
|
|
705
705
|
function _n(e, t = !0) {
|
|
@@ -728,8 +728,8 @@ function Ut() {
|
|
|
728
728
|
function Bn() {
|
|
729
729
|
let [e, t] = S([]);
|
|
730
730
|
return [e.length > 0 ? e.join(" ") : void 0, C(() => function(n) {
|
|
731
|
-
let r = L((
|
|
732
|
-
let s =
|
|
731
|
+
let r = L((o) => (t((a) => [...a, o]), () => t((a) => {
|
|
732
|
+
let s = a.slice(), i = s.indexOf(o);
|
|
733
733
|
return i !== -1 && s.splice(i, 1), s;
|
|
734
734
|
}))), l = C(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
|
|
735
735
|
return E.createElement(ht.Provider, { value: l }, n.children);
|
|
@@ -737,10 +737,10 @@ function Bn() {
|
|
|
737
737
|
}
|
|
738
738
|
let Xn = "p";
|
|
739
739
|
function Vn(e, t) {
|
|
740
|
-
let n = Pe(), r = In(), { id: l = `headlessui-description-${n}`, ...
|
|
741
|
-
A(() =>
|
|
742
|
-
let i = r || !1,
|
|
743
|
-
return W()({ ourProps: f, theirProps:
|
|
740
|
+
let n = Pe(), r = In(), { id: l = `headlessui-description-${n}`, ...o } = e, a = Ut(), s = Z(t);
|
|
741
|
+
A(() => a.register(l), [l, a.register]);
|
|
742
|
+
let i = r || !1, c = C(() => ({ ...a.slot, disabled: i }), [a.slot, i]), f = { ref: s, ...a.props, id: l };
|
|
743
|
+
return W()({ ourProps: f, theirProps: o, slot: c, defaultTag: Xn, name: a.name || "Description" });
|
|
744
744
|
}
|
|
745
745
|
let qn = D(Vn), Yn = Object.assign(qn, {});
|
|
746
746
|
var Ht = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(Ht || {});
|
|
@@ -764,9 +764,9 @@ function Wt(e, t) {
|
|
|
764
764
|
return n;
|
|
765
765
|
}, subscribe(l) {
|
|
766
766
|
return r.add(l), () => r.delete(l);
|
|
767
|
-
}, dispatch(l, ...
|
|
768
|
-
let
|
|
769
|
-
|
|
767
|
+
}, dispatch(l, ...o) {
|
|
768
|
+
let a = t[l].call(n, ...o);
|
|
769
|
+
a && (n = a, r.forEach((s) => s()));
|
|
770
770
|
} };
|
|
771
771
|
}
|
|
772
772
|
function _t(e) {
|
|
@@ -785,66 +785,66 @@ function fe(e, t) {
|
|
|
785
785
|
if (A(() => {
|
|
786
786
|
if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
|
|
787
787
|
}, [n, e]), !e) return !1;
|
|
788
|
-
let
|
|
789
|
-
return
|
|
788
|
+
let o = l.indexOf(r), a = l.length;
|
|
789
|
+
return o === -1 && (o = a, a += 1), o === a - 1;
|
|
790
790
|
}
|
|
791
|
-
let
|
|
791
|
+
let ot = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map();
|
|
792
792
|
function bt(e) {
|
|
793
793
|
var t;
|
|
794
794
|
let n = (t = Te.get(e)) != null ? t : 0;
|
|
795
|
-
return Te.set(e, n + 1), n !== 0 ? () => Et(e) : (
|
|
795
|
+
return Te.set(e, n + 1), n !== 0 ? () => Et(e) : (ot.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Et(e));
|
|
796
796
|
}
|
|
797
797
|
function Et(e) {
|
|
798
798
|
var t;
|
|
799
799
|
let n = (t = Te.get(e)) != null ? t : 1;
|
|
800
800
|
if (n === 1 ? Te.delete(e) : Te.set(e, n - 1), n !== 1) return;
|
|
801
|
-
let r =
|
|
802
|
-
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert,
|
|
801
|
+
let r = ot.get(e);
|
|
802
|
+
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, ot.delete(e));
|
|
803
803
|
}
|
|
804
804
|
function Jn(e, { allowed: t, disallowed: n } = {}) {
|
|
805
805
|
let r = fe(e, "inert-others");
|
|
806
806
|
A(() => {
|
|
807
|
-
var l,
|
|
807
|
+
var l, o;
|
|
808
808
|
if (!r) return;
|
|
809
|
-
let
|
|
810
|
-
for (let i of (l = n == null ? void 0 : n()) != null ? l : []) i &&
|
|
811
|
-
let s = (
|
|
809
|
+
let a = re();
|
|
810
|
+
for (let i of (l = n == null ? void 0 : n()) != null ? l : []) i && a.add(bt(i));
|
|
811
|
+
let s = (o = t == null ? void 0 : t()) != null ? o : [];
|
|
812
812
|
for (let i of s) {
|
|
813
813
|
if (!i) continue;
|
|
814
|
-
let
|
|
815
|
-
if (!
|
|
814
|
+
let c = Ve(i);
|
|
815
|
+
if (!c) continue;
|
|
816
816
|
let f = i.parentElement;
|
|
817
|
-
for (; f && f !==
|
|
818
|
-
for (let y of f.children) s.some((b) => y.contains(b)) ||
|
|
817
|
+
for (; f && f !== c.body; ) {
|
|
818
|
+
for (let y of f.children) s.some((b) => y.contains(b)) || a.add(bt(y));
|
|
819
819
|
f = f.parentElement;
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
return
|
|
822
|
+
return a.dispose;
|
|
823
823
|
}, [r, t, n]);
|
|
824
824
|
}
|
|
825
825
|
function Qn(e, t, n) {
|
|
826
826
|
let r = ue((l) => {
|
|
827
|
-
let
|
|
828
|
-
|
|
827
|
+
let o = l.getBoundingClientRect();
|
|
828
|
+
o.x === 0 && o.y === 0 && o.width === 0 && o.height === 0 && n();
|
|
829
829
|
});
|
|
830
830
|
M(() => {
|
|
831
831
|
if (!e) return;
|
|
832
832
|
let l = t === null ? null : t instanceof HTMLElement ? t : t.current;
|
|
833
833
|
if (!l) return;
|
|
834
|
-
let
|
|
834
|
+
let o = re();
|
|
835
835
|
if (typeof ResizeObserver < "u") {
|
|
836
|
-
let
|
|
837
|
-
|
|
836
|
+
let a = new ResizeObserver(() => r.current(l));
|
|
837
|
+
a.observe(l), o.add(() => a.disconnect());
|
|
838
838
|
}
|
|
839
839
|
if (typeof IntersectionObserver < "u") {
|
|
840
|
-
let
|
|
841
|
-
|
|
840
|
+
let a = new IntersectionObserver(() => r.current(l));
|
|
841
|
+
a.observe(l), o.add(() => a.disconnect());
|
|
842
842
|
}
|
|
843
|
-
return () =>
|
|
843
|
+
return () => o.dispose();
|
|
844
844
|
}, [t, r, e]);
|
|
845
845
|
}
|
|
846
846
|
let We = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), er = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
847
|
-
var J = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(J || {}),
|
|
847
|
+
var J = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(J || {}), at = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(at || {}), tr = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(tr || {});
|
|
848
848
|
function nr(e = document.body) {
|
|
849
849
|
return e == null ? [] : Array.from(e.querySelectorAll(We)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
850
850
|
}
|
|
@@ -874,33 +874,33 @@ typeof window < "u" && typeof document < "u" && (document.addEventListener("keyd
|
|
|
874
874
|
function Q(e) {
|
|
875
875
|
e == null || e.focus({ preventScroll: !0 });
|
|
876
876
|
}
|
|
877
|
-
let
|
|
878
|
-
function
|
|
877
|
+
let or = ["textarea", "input"].join(",");
|
|
878
|
+
function ar(e) {
|
|
879
879
|
var t, n;
|
|
880
|
-
return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e,
|
|
880
|
+
return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, or)) != null ? n : !1;
|
|
881
881
|
}
|
|
882
882
|
function sr(e, t = (n) => n) {
|
|
883
883
|
return e.slice().sort((n, r) => {
|
|
884
|
-
let l = t(n),
|
|
885
|
-
if (l === null ||
|
|
886
|
-
let
|
|
887
|
-
return
|
|
884
|
+
let l = t(n), o = t(r);
|
|
885
|
+
if (l === null || o === null) return 0;
|
|
886
|
+
let a = l.compareDocumentPosition(o);
|
|
887
|
+
return a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
890
|
function Oe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
|
|
891
|
-
let
|
|
892
|
-
l.length > 0 &&
|
|
891
|
+
let o = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, a = Array.isArray(e) ? n ? sr(e) : e : t & 64 ? rr(e) : nr(e);
|
|
892
|
+
l.length > 0 && a.length > 1 && (a = a.filter((w) => !l.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === w : d === w))), r = r ?? o.activeElement;
|
|
893
893
|
let s = (() => {
|
|
894
894
|
if (t & 5) return 1;
|
|
895
895
|
if (t & 10) return -1;
|
|
896
896
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
897
897
|
})(), i = (() => {
|
|
898
898
|
if (t & 1) return 0;
|
|
899
|
-
if (t & 2) return Math.max(0,
|
|
900
|
-
if (t & 4) return Math.max(0,
|
|
901
|
-
if (t & 8) return
|
|
899
|
+
if (t & 2) return Math.max(0, a.indexOf(r)) - 1;
|
|
900
|
+
if (t & 4) return Math.max(0, a.indexOf(r)) + 1;
|
|
901
|
+
if (t & 8) return a.length - 1;
|
|
902
902
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
903
|
-
})(),
|
|
903
|
+
})(), c = t & 32 ? { preventScroll: !0 } : {}, f = 0, y = a.length, b;
|
|
904
904
|
do {
|
|
905
905
|
if (f >= y || f + y <= 0) return 0;
|
|
906
906
|
let w = i + f;
|
|
@@ -909,9 +909,9 @@ function Oe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] }
|
|
|
909
909
|
if (w < 0) return 3;
|
|
910
910
|
if (w >= y) return 1;
|
|
911
911
|
}
|
|
912
|
-
b =
|
|
913
|
-
} while (b !==
|
|
914
|
-
return t & 6 &&
|
|
912
|
+
b = a[w], b == null || b.focus(c), f += s;
|
|
913
|
+
} while (b !== o.activeElement);
|
|
914
|
+
return t & 6 && ar(b) && b.select(), 2;
|
|
915
915
|
}
|
|
916
916
|
function Xt() {
|
|
917
917
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
@@ -919,57 +919,57 @@ function Xt() {
|
|
|
919
919
|
function ur() {
|
|
920
920
|
return /Android/gi.test(window.navigator.userAgent);
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function cr() {
|
|
923
923
|
return Xt() || ur();
|
|
924
924
|
}
|
|
925
925
|
function ye(e, t, n, r) {
|
|
926
926
|
let l = ue(n);
|
|
927
927
|
M(() => {
|
|
928
928
|
if (!e) return;
|
|
929
|
-
function a
|
|
930
|
-
l.current(
|
|
929
|
+
function o(a) {
|
|
930
|
+
l.current(a);
|
|
931
931
|
}
|
|
932
|
-
return document.addEventListener(t,
|
|
932
|
+
return document.addEventListener(t, o, r), () => document.removeEventListener(t, o, r);
|
|
933
933
|
}, [e, t, r]);
|
|
934
934
|
}
|
|
935
935
|
function Vt(e, t, n, r) {
|
|
936
936
|
let l = ue(n);
|
|
937
937
|
M(() => {
|
|
938
938
|
if (!e) return;
|
|
939
|
-
function a
|
|
940
|
-
l.current(
|
|
939
|
+
function o(a) {
|
|
940
|
+
l.current(a);
|
|
941
941
|
}
|
|
942
|
-
return window.addEventListener(t,
|
|
942
|
+
return window.addEventListener(t, o, r), () => window.removeEventListener(t, o, r);
|
|
943
943
|
}, [e, t, r]);
|
|
944
944
|
}
|
|
945
945
|
const $t = 30;
|
|
946
|
-
function
|
|
947
|
-
let r = fe(e, "outside-click"), l = ue(n),
|
|
946
|
+
function dr(e, t, n) {
|
|
947
|
+
let r = fe(e, "outside-click"), l = ue(n), o = Y(function(i, c) {
|
|
948
948
|
if (i.defaultPrevented) return;
|
|
949
|
-
let f =
|
|
949
|
+
let f = c(i);
|
|
950
950
|
if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
|
|
951
951
|
let y = function b(w) {
|
|
952
952
|
return typeof w == "function" ? b(w()) : Array.isArray(w) || w instanceof Set ? w : [w];
|
|
953
953
|
}(t);
|
|
954
954
|
for (let b of y) if (b !== null && (b.contains(f) || i.composed && i.composedPath().includes(b))) return;
|
|
955
955
|
return !lr(f, Bt.Loose) && f.tabIndex !== -1 && i.preventDefault(), l.current(i, f);
|
|
956
|
-
}, [l, t]),
|
|
956
|
+
}, [l, t]), a = O(null);
|
|
957
957
|
ye(r, "pointerdown", (i) => {
|
|
958
|
-
var
|
|
959
|
-
|
|
958
|
+
var c, f;
|
|
959
|
+
a.current = ((f = (c = i.composedPath) == null ? void 0 : c.call(i)) == null ? void 0 : f[0]) || i.target;
|
|
960
960
|
}, !0), ye(r, "mousedown", (i) => {
|
|
961
|
-
var
|
|
962
|
-
|
|
961
|
+
var c, f;
|
|
962
|
+
a.current = ((f = (c = i.composedPath) == null ? void 0 : c.call(i)) == null ? void 0 : f[0]) || i.target;
|
|
963
963
|
}, !0), ye(r, "click", (i) => {
|
|
964
|
-
|
|
964
|
+
cr() || a.current && (o(i, () => a.current), a.current = null);
|
|
965
965
|
}, !0);
|
|
966
966
|
let s = O({ x: 0, y: 0 });
|
|
967
967
|
ye(r, "touchstart", (i) => {
|
|
968
968
|
s.current.x = i.touches[0].clientX, s.current.y = i.touches[0].clientY;
|
|
969
969
|
}, !0), ye(r, "touchend", (i) => {
|
|
970
|
-
let
|
|
971
|
-
if (!(Math.abs(
|
|
972
|
-
}, !0), Vt(r, "blur", (i) =>
|
|
970
|
+
let c = { x: i.changedTouches[0].clientX, y: i.changedTouches[0].clientY };
|
|
971
|
+
if (!(Math.abs(c.x - s.current.x) >= $t || Math.abs(c.y - s.current.y) >= $t)) return o(i, () => i.target instanceof HTMLElement ? i.target : null);
|
|
972
|
+
}, !0), Vt(r, "blur", (i) => o(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
973
973
|
}
|
|
974
974
|
function Me(...e) {
|
|
975
975
|
return C(() => Ve(...e), [...e]);
|
|
@@ -978,10 +978,10 @@ function qt(e, t, n, r) {
|
|
|
978
978
|
let l = ue(n);
|
|
979
979
|
M(() => {
|
|
980
980
|
e = e ?? window;
|
|
981
|
-
function a
|
|
982
|
-
l.current(
|
|
981
|
+
function o(a) {
|
|
982
|
+
l.current(a);
|
|
983
983
|
}
|
|
984
|
-
return e.addEventListener(t,
|
|
984
|
+
return e.addEventListener(t, o, r), () => e.removeEventListener(t, o, r);
|
|
985
985
|
}, [e, t, r]);
|
|
986
986
|
}
|
|
987
987
|
function fr() {
|
|
@@ -991,14 +991,14 @@ function fr() {
|
|
|
991
991
|
let r = t.documentElement, l = (n = t.defaultView) != null ? n : window;
|
|
992
992
|
e = Math.max(0, l.innerWidth - r.clientWidth);
|
|
993
993
|
}, after({ doc: t, d: n }) {
|
|
994
|
-
let r = t.documentElement, l = Math.max(0, r.clientWidth - r.offsetWidth),
|
|
995
|
-
n.style(r, "paddingRight", `${
|
|
994
|
+
let r = t.documentElement, l = Math.max(0, r.clientWidth - r.offsetWidth), o = Math.max(0, e - l);
|
|
995
|
+
n.style(r, "paddingRight", `${o}px`);
|
|
996
996
|
} };
|
|
997
997
|
}
|
|
998
998
|
function mr() {
|
|
999
999
|
return Xt() ? { before({ doc: e, d: t, meta: n }) {
|
|
1000
1000
|
function r(l) {
|
|
1001
|
-
return n.containers.flatMap((
|
|
1001
|
+
return n.containers.flatMap((o) => o()).some((o) => o.contains(l));
|
|
1002
1002
|
}
|
|
1003
1003
|
t.microTask(() => {
|
|
1004
1004
|
var l;
|
|
@@ -1006,13 +1006,13 @@ function mr() {
|
|
|
1006
1006
|
let s = re();
|
|
1007
1007
|
s.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => s.dispose()));
|
|
1008
1008
|
}
|
|
1009
|
-
let
|
|
1009
|
+
let o = (l = window.scrollY) != null ? l : window.pageYOffset, a = null;
|
|
1010
1010
|
t.addEventListener(e, "click", (s) => {
|
|
1011
1011
|
if (s.target instanceof HTMLElement) try {
|
|
1012
1012
|
let i = s.target.closest("a");
|
|
1013
1013
|
if (!i) return;
|
|
1014
|
-
let { hash:
|
|
1015
|
-
f && !r(f) && (
|
|
1014
|
+
let { hash: c } = new URL(i.href), f = e.querySelector(c);
|
|
1015
|
+
f && !r(f) && (a = f);
|
|
1016
1016
|
} catch {
|
|
1017
1017
|
}
|
|
1018
1018
|
}, !0), t.addEventListener(e, "touchstart", (s) => {
|
|
@@ -1033,7 +1033,7 @@ function mr() {
|
|
|
1033
1033
|
}, { passive: !1 }), t.add(() => {
|
|
1034
1034
|
var s;
|
|
1035
1035
|
let i = (s = window.scrollY) != null ? s : window.pageYOffset;
|
|
1036
|
-
|
|
1036
|
+
o !== i && window.scrollTo(0, o), a && a.isConnected && (a.scrollIntoView({ block: "nearest" }), a = null);
|
|
1037
1037
|
});
|
|
1038
1038
|
});
|
|
1039
1039
|
} } : {};
|
|
@@ -1048,7 +1048,7 @@ function hr(e) {
|
|
|
1048
1048
|
for (let n of e) Object.assign(t, n(t));
|
|
1049
1049
|
return t;
|
|
1050
1050
|
}
|
|
1051
|
-
let
|
|
1051
|
+
let oe = Wt(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
1052
1052
|
var n;
|
|
1053
1053
|
let r = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: re(), meta: /* @__PURE__ */ new Set() };
|
|
1054
1054
|
return r.count++, r.meta.add(t), this.set(e, r), this;
|
|
@@ -1057,36 +1057,36 @@ let ae = Wt(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
|
1057
1057
|
return n && (n.count--, n.meta.delete(t)), this;
|
|
1058
1058
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
|
|
1059
1059
|
let r = { doc: e, d: t, meta: hr(n) }, l = [mr(), fr(), pr()];
|
|
1060
|
-
l.forEach(({ before:
|
|
1060
|
+
l.forEach(({ before: o }) => o == null ? void 0 : o(r)), l.forEach(({ after: o }) => o == null ? void 0 : o(r));
|
|
1061
1061
|
}, SCROLL_ALLOW({ d: e }) {
|
|
1062
1062
|
e.dispose();
|
|
1063
1063
|
}, TEARDOWN({ doc: e }) {
|
|
1064
1064
|
this.delete(e);
|
|
1065
1065
|
} });
|
|
1066
|
-
|
|
1067
|
-
let e =
|
|
1066
|
+
oe.subscribe(() => {
|
|
1067
|
+
let e = oe.getSnapshot(), t = /* @__PURE__ */ new Map();
|
|
1068
1068
|
for (let [n] of e) t.set(n, n.documentElement.style.overflow);
|
|
1069
1069
|
for (let n of e.values()) {
|
|
1070
1070
|
let r = t.get(n.doc) === "hidden", l = n.count !== 0;
|
|
1071
|
-
(l && !r || !l && r) &&
|
|
1071
|
+
(l && !r || !l && r) && oe.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && oe.dispatch("TEARDOWN", n);
|
|
1072
1072
|
}
|
|
1073
1073
|
});
|
|
1074
1074
|
function vr(e, t, n = () => ({ containers: [] })) {
|
|
1075
|
-
let r = _t(
|
|
1075
|
+
let r = _t(oe), l = t ? r.get(t) : void 0, o = l ? l.count > 0 : !1;
|
|
1076
1076
|
return A(() => {
|
|
1077
|
-
if (!(!t || !e)) return
|
|
1078
|
-
}, [e, t]),
|
|
1077
|
+
if (!(!t || !e)) return oe.dispatch("PUSH", t, n), () => oe.dispatch("POP", t, n);
|
|
1078
|
+
}, [e, t]), o;
|
|
1079
1079
|
}
|
|
1080
1080
|
function gr(e, t, n = () => [document.body]) {
|
|
1081
1081
|
let r = fe(e, "scroll-lock");
|
|
1082
1082
|
vr(r, t, (l) => {
|
|
1083
|
-
var
|
|
1084
|
-
return { containers: [...(
|
|
1083
|
+
var o;
|
|
1084
|
+
return { containers: [...(o = l.containers) != null ? o : [], n] };
|
|
1085
1085
|
});
|
|
1086
1086
|
}
|
|
1087
1087
|
function wr(e = 0) {
|
|
1088
|
-
let [t, n] = S(e), r = Y((i) => n(i), [t]), l = Y((i) => n((
|
|
1089
|
-
return { flags: t, setFlag: r, addFlag: l, hasFlag:
|
|
1088
|
+
let [t, n] = S(e), r = Y((i) => n(i), [t]), l = Y((i) => n((c) => c | i), [t]), o = Y((i) => (t & i) === i, [t]), a = Y((i) => n((c) => c & ~i), [n]), s = Y((i) => n((c) => c ^ i), [n]);
|
|
1089
|
+
return { flags: t, setFlag: r, addFlag: l, hasFlag: o, removeFlag: a, toggleFlag: s };
|
|
1090
1090
|
}
|
|
1091
1091
|
var Tt, Ot;
|
|
1092
1092
|
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Tt = process == null ? void 0 : process.env) == null ? void 0 : Tt.NODE_ENV) === "test" && typeof ((Ot = Element == null ? void 0 : Element.prototype) == null ? void 0 : Ot.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
|
|
@@ -1100,44 +1100,44 @@ function xr(e) {
|
|
|
1100
1100
|
return t;
|
|
1101
1101
|
}
|
|
1102
1102
|
function br(e, t, n, r) {
|
|
1103
|
-
let [l,
|
|
1103
|
+
let [l, o] = S(n), { hasFlag: a, addFlag: s, removeFlag: i } = wr(e && l ? 3 : 0), c = O(!1), f = O(!1), y = pt();
|
|
1104
1104
|
return A(() => {
|
|
1105
1105
|
var b;
|
|
1106
1106
|
if (e) {
|
|
1107
|
-
if (n &&
|
|
1107
|
+
if (n && o(!0), !t) {
|
|
1108
1108
|
n && s(3);
|
|
1109
1109
|
return;
|
|
1110
1110
|
}
|
|
1111
|
-
return (b = r == null ? void 0 : r.start) == null || b.call(r, n), Er(t, { inFlight:
|
|
1112
|
-
f.current ? f.current = !1 : f.current =
|
|
1111
|
+
return (b = r == null ? void 0 : r.start) == null || b.call(r, n), Er(t, { inFlight: c, prepare() {
|
|
1112
|
+
f.current ? f.current = !1 : f.current = c.current, c.current = !0, !f.current && (n ? (s(3), i(4)) : (s(4), i(2)));
|
|
1113
1113
|
}, run() {
|
|
1114
1114
|
f.current ? n ? (i(3), s(4)) : (i(4), s(3)) : n ? i(1) : s(1);
|
|
1115
1115
|
}, done() {
|
|
1116
1116
|
var w;
|
|
1117
|
-
f.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (
|
|
1117
|
+
f.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (c.current = !1, i(7), n || o(!1), (w = r == null ? void 0 : r.end) == null || w.call(r, n));
|
|
1118
1118
|
} });
|
|
1119
1119
|
}
|
|
1120
|
-
}, [e, n, t, y]), e ? [l, { closed:
|
|
1120
|
+
}, [e, n, t, y]), e ? [l, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
1121
1121
|
}
|
|
1122
1122
|
function Er(e, { prepare: t, run: n, done: r, inFlight: l }) {
|
|
1123
|
-
let
|
|
1124
|
-
return Tr(e, { prepare: t, inFlight: l }),
|
|
1125
|
-
n(),
|
|
1126
|
-
|
|
1123
|
+
let o = re();
|
|
1124
|
+
return Tr(e, { prepare: t, inFlight: l }), o.nextFrame(() => {
|
|
1125
|
+
n(), o.requestAnimationFrame(() => {
|
|
1126
|
+
o.add($r(e, r));
|
|
1127
1127
|
});
|
|
1128
|
-
}),
|
|
1128
|
+
}), o.dispose;
|
|
1129
1129
|
}
|
|
1130
1130
|
function $r(e, t) {
|
|
1131
1131
|
var n, r;
|
|
1132
1132
|
let l = re();
|
|
1133
1133
|
if (!e) return l.dispose;
|
|
1134
|
-
let
|
|
1134
|
+
let o = !1;
|
|
1135
1135
|
l.add(() => {
|
|
1136
|
-
|
|
1136
|
+
o = !0;
|
|
1137
1137
|
});
|
|
1138
|
-
let
|
|
1139
|
-
return
|
|
1140
|
-
|
|
1138
|
+
let a = (r = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((s) => s instanceof CSSTransition)) != null ? r : [];
|
|
1139
|
+
return a.length === 0 ? (t(), l.dispose) : (Promise.allSettled(a.map((s) => s.finished)).then(() => {
|
|
1140
|
+
o || t();
|
|
1141
1141
|
}), l.dispose);
|
|
1142
1142
|
}
|
|
1143
1143
|
function Tr(e, { inFlight: t, prepare: n }) {
|
|
@@ -1152,7 +1152,7 @@ function vt(e, t) {
|
|
|
1152
1152
|
let n = O([]), r = L(e);
|
|
1153
1153
|
M(() => {
|
|
1154
1154
|
let l = [...n.current];
|
|
1155
|
-
for (let [
|
|
1155
|
+
for (let [o, a] of t.entries()) if (n.current[o] !== a) {
|
|
1156
1156
|
let s = r(t, l);
|
|
1157
1157
|
return n.current = t, s;
|
|
1158
1158
|
}
|
|
@@ -1199,10 +1199,10 @@ function Lr() {
|
|
|
1199
1199
|
}, () => !1, () => !e) : !1;
|
|
1200
1200
|
}
|
|
1201
1201
|
function Le() {
|
|
1202
|
-
let e = Lr(), [t, n] = Ee.useState(
|
|
1203
|
-
return t &&
|
|
1202
|
+
let e = Lr(), [t, n] = Ee.useState(ae.isHandoffComplete);
|
|
1203
|
+
return t && ae.isHandoffComplete === !1 && n(!1), Ee.useEffect(() => {
|
|
1204
1204
|
t !== !0 && n(!0);
|
|
1205
|
-
}, [t]), Ee.useEffect(() =>
|
|
1205
|
+
}, [t]), Ee.useEffect(() => ae.handoff(), []), e ? !1 : t;
|
|
1206
1206
|
}
|
|
1207
1207
|
let zt = H(!1);
|
|
1208
1208
|
function Sr() {
|
|
@@ -1212,10 +1212,10 @@ function Pt(e) {
|
|
|
1212
1212
|
return E.createElement(zt.Provider, { value: e.force }, e.children);
|
|
1213
1213
|
}
|
|
1214
1214
|
function Fr(e) {
|
|
1215
|
-
let t = Sr(), n = R(Kt), r = Me(e), [l,
|
|
1216
|
-
var
|
|
1217
|
-
if (!t && n !== null) return (
|
|
1218
|
-
if (
|
|
1215
|
+
let t = Sr(), n = R(Kt), r = Me(e), [l, o] = S(() => {
|
|
1216
|
+
var a;
|
|
1217
|
+
if (!t && n !== null) return (a = n.current) != null ? a : null;
|
|
1218
|
+
if (ae.isServer) return null;
|
|
1219
1219
|
let s = r == null ? void 0 : r.getElementById("headlessui-portal-root");
|
|
1220
1220
|
if (s) return s;
|
|
1221
1221
|
if (r === null) return null;
|
|
@@ -1225,44 +1225,44 @@ function Fr(e) {
|
|
|
1225
1225
|
return M(() => {
|
|
1226
1226
|
l !== null && (r != null && r.body.contains(l) || r == null || r.body.appendChild(l));
|
|
1227
1227
|
}, [l, r]), M(() => {
|
|
1228
|
-
t || n !== null &&
|
|
1229
|
-
}, [n,
|
|
1228
|
+
t || n !== null && o(n.current);
|
|
1229
|
+
}, [n, o, t]), l;
|
|
1230
1230
|
}
|
|
1231
1231
|
let Gt = G, Cr = D(function(e, t) {
|
|
1232
1232
|
let n = e, r = O(null), l = Z(_n((y) => {
|
|
1233
1233
|
r.current = y;
|
|
1234
|
-
}), t),
|
|
1234
|
+
}), t), o = Me(r), a = Fr(r), [s] = S(() => {
|
|
1235
1235
|
var y;
|
|
1236
|
-
return
|
|
1237
|
-
}), i = R(st),
|
|
1236
|
+
return ae.isServer ? null : (y = o == null ? void 0 : o.createElement("div")) != null ? y : null;
|
|
1237
|
+
}), i = R(st), c = Le();
|
|
1238
1238
|
A(() => {
|
|
1239
|
-
!
|
|
1240
|
-
}, [
|
|
1239
|
+
!a || !s || a.contains(s) || (s.setAttribute("data-headlessui-portal", ""), a.appendChild(s));
|
|
1240
|
+
}, [a, s]), A(() => {
|
|
1241
1241
|
if (s && i) return i.register(s);
|
|
1242
1242
|
}, [i, s]), Yt(() => {
|
|
1243
1243
|
var y;
|
|
1244
|
-
!
|
|
1244
|
+
!a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((y = a.parentElement) == null || y.removeChild(a)));
|
|
1245
1245
|
});
|
|
1246
1246
|
let f = W();
|
|
1247
|
-
return
|
|
1247
|
+
return c ? !a || !s ? null : En(f({ ourProps: { ref: l }, theirProps: n, slot: {}, defaultTag: Gt, name: "Portal" }), s) : null;
|
|
1248
1248
|
});
|
|
1249
1249
|
function kr(e, t) {
|
|
1250
|
-
let n = Z(t), { enabled: r = !0, ...l } = e,
|
|
1251
|
-
return r ? E.createElement(Cr, { ...l, ref: n }) :
|
|
1250
|
+
let n = Z(t), { enabled: r = !0, ...l } = e, o = W();
|
|
1251
|
+
return r ? E.createElement(Cr, { ...l, ref: n }) : o({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag: Gt, name: "Portal" });
|
|
1252
1252
|
}
|
|
1253
1253
|
let Nr = G, Kt = H(null);
|
|
1254
1254
|
function Ar(e, t) {
|
|
1255
|
-
let { target: n, ...r } = e, l = { ref: Z(t) },
|
|
1256
|
-
return E.createElement(Kt.Provider, { value: n },
|
|
1255
|
+
let { target: n, ...r } = e, l = { ref: Z(t) }, o = W();
|
|
1256
|
+
return E.createElement(Kt.Provider, { value: n }, o({ ourProps: l, theirProps: r, defaultTag: Nr, name: "Popover.Group" }));
|
|
1257
1257
|
}
|
|
1258
1258
|
let st = H(null);
|
|
1259
1259
|
function Ir() {
|
|
1260
|
-
let e = R(st), t = O([]), n = L((
|
|
1261
|
-
let
|
|
1262
|
-
|
|
1260
|
+
let e = R(st), t = O([]), n = L((o) => (t.current.push(o), e && e.register(o), () => r(o))), r = L((o) => {
|
|
1261
|
+
let a = t.current.indexOf(o);
|
|
1262
|
+
a !== -1 && t.current.splice(a, 1), e && e.unregister(o);
|
|
1263
1263
|
}), l = C(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
|
|
1264
|
-
return [t, C(() => function({ children:
|
|
1265
|
-
return E.createElement(st.Provider, { value: l },
|
|
1264
|
+
return [t, C(() => function({ children: o }) {
|
|
1265
|
+
return E.createElement(st.Provider, { value: l }, o);
|
|
1266
1266
|
}, [l])];
|
|
1267
1267
|
}
|
|
1268
1268
|
let Rr = D(kr), Zt = D(Ar), Dr = Object.assign(Rr, { Group: Zt });
|
|
@@ -1277,30 +1277,30 @@ function Ur() {
|
|
|
1277
1277
|
let [t] = S(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [n, r] = S((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1278
1278
|
return A(() => {
|
|
1279
1279
|
if (!t) return;
|
|
1280
|
-
function l(
|
|
1281
|
-
r(
|
|
1280
|
+
function l(o) {
|
|
1281
|
+
r(o.matches);
|
|
1282
1282
|
}
|
|
1283
1283
|
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1284
1284
|
}, [t]), n;
|
|
1285
1285
|
}
|
|
1286
1286
|
function Hr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
|
|
1287
1287
|
let r = Me(n), l = L(() => {
|
|
1288
|
-
var
|
|
1288
|
+
var o, a;
|
|
1289
1289
|
let s = [];
|
|
1290
1290
|
for (let i of e) i !== null && (i instanceof HTMLElement ? s.push(i) : "current" in i && i.current instanceof HTMLElement && s.push(i.current));
|
|
1291
1291
|
if (t != null && t.current) for (let i of t.current) s.push(i);
|
|
1292
|
-
for (let i of (
|
|
1292
|
+
for (let i of (o = r == null ? void 0 : r.querySelectorAll("html > *, body > *")) != null ? o : []) i !== document.body && i !== document.head && i instanceof HTMLElement && i.id !== "headlessui-portal-root" && (n && (i.contains(n) || i.contains((a = n == null ? void 0 : n.getRootNode()) == null ? void 0 : a.host)) || s.some((c) => i.contains(c)) || s.push(i));
|
|
1293
1293
|
return s;
|
|
1294
1294
|
});
|
|
1295
|
-
return { resolveContainers: l, contains: L((
|
|
1295
|
+
return { resolveContainers: l, contains: L((o) => l().some((a) => a.contains(o))) };
|
|
1296
1296
|
}
|
|
1297
1297
|
let Jt = H(null);
|
|
1298
1298
|
function Mt({ children: e, node: t }) {
|
|
1299
1299
|
let [n, r] = S(null), l = Qt(t ?? n);
|
|
1300
|
-
return E.createElement(Jt.Provider, { value: l }, e, l === null && E.createElement(it, { features: He.Hidden, ref: (
|
|
1301
|
-
var
|
|
1302
|
-
if (
|
|
1303
|
-
for (let i of (s = (
|
|
1300
|
+
return E.createElement(Jt.Provider, { value: l }, e, l === null && E.createElement(it, { features: He.Hidden, ref: (o) => {
|
|
1301
|
+
var a, s;
|
|
1302
|
+
if (o) {
|
|
1303
|
+
for (let i of (s = (a = Ve(o)) == null ? void 0 : a.querySelectorAll("html > *, body > *")) != null ? s : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(o)) {
|
|
1304
1304
|
r(i);
|
|
1305
1305
|
break;
|
|
1306
1306
|
}
|
|
@@ -1334,28 +1334,28 @@ function en(e) {
|
|
|
1334
1334
|
let _r = "div";
|
|
1335
1335
|
var ie = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))(ie || {});
|
|
1336
1336
|
function Br(e, t) {
|
|
1337
|
-
let n = O(null), r = Z(n, t), { initialFocus: l, initialFocusFallback:
|
|
1337
|
+
let n = O(null), r = Z(n, t), { initialFocus: l, initialFocusFallback: o, containers: a, features: s = 15, ...i } = e;
|
|
1338
1338
|
Le() || (s = 0);
|
|
1339
|
-
let
|
|
1340
|
-
Yr(s, { ownerDocument:
|
|
1341
|
-
let f = zr(s, { ownerDocument:
|
|
1342
|
-
Gr(s, { ownerDocument:
|
|
1339
|
+
let c = Me(n);
|
|
1340
|
+
Yr(s, { ownerDocument: c });
|
|
1341
|
+
let f = zr(s, { ownerDocument: c, container: n, initialFocus: l, initialFocusFallback: o });
|
|
1342
|
+
Gr(s, { ownerDocument: c, container: n, containers: a, previousActiveElement: f });
|
|
1343
1343
|
let y = Wr(), b = L((p) => {
|
|
1344
1344
|
let g = n.current;
|
|
1345
1345
|
g && ((x) => x())(() => {
|
|
1346
1346
|
ne(y.current, { [be.Forwards]: () => {
|
|
1347
|
-
Oe(g, J.First, { skipElements: [p.relatedTarget,
|
|
1347
|
+
Oe(g, J.First, { skipElements: [p.relatedTarget, o] });
|
|
1348
1348
|
}, [be.Backwards]: () => {
|
|
1349
|
-
Oe(g, J.Last, { skipElements: [p.relatedTarget,
|
|
1349
|
+
Oe(g, J.Last, { skipElements: [p.relatedTarget, o] });
|
|
1350
1350
|
} });
|
|
1351
1351
|
});
|
|
1352
|
-
}), w = fe(!!(s & 2), "focus-trap#tab-lock"),
|
|
1353
|
-
p.key == "Tab" && (v.current = !0,
|
|
1352
|
+
}), w = fe(!!(s & 2), "focus-trap#tab-lock"), d = pt(), v = O(!1), u = { ref: r, onKeyDown(p) {
|
|
1353
|
+
p.key == "Tab" && (v.current = !0, d.requestAnimationFrame(() => {
|
|
1354
1354
|
v.current = !1;
|
|
1355
1355
|
}));
|
|
1356
1356
|
}, onBlur(p) {
|
|
1357
1357
|
if (!(s & 4)) return;
|
|
1358
|
-
let g = en(
|
|
1358
|
+
let g = en(a);
|
|
1359
1359
|
n.current instanceof HTMLElement && g.add(n.current);
|
|
1360
1360
|
let x = p.relatedTarget;
|
|
1361
1361
|
x instanceof HTMLElement && x.dataset.headlessuiFocusGuard !== "true" && (tn(g, x) || (v.current ? Oe(n.current, ne(y.current, { [be.Forwards]: () => J.Next, [be.Backwards]: () => J.Previous }) | J.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && Q(p.target)));
|
|
@@ -1383,48 +1383,48 @@ function Yr(e, { ownerDocument: t }) {
|
|
|
1383
1383
|
});
|
|
1384
1384
|
}
|
|
1385
1385
|
function zr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFallback: l }) {
|
|
1386
|
-
let
|
|
1386
|
+
let o = O(null), a = fe(!!(e & 1), "focus-trap#initial-focus"), s = gt();
|
|
1387
1387
|
return vt(() => {
|
|
1388
1388
|
if (e === 0) return;
|
|
1389
|
-
if (!
|
|
1389
|
+
if (!a) {
|
|
1390
1390
|
l != null && l.current && Q(l.current);
|
|
1391
1391
|
return;
|
|
1392
1392
|
}
|
|
1393
1393
|
let i = n.current;
|
|
1394
1394
|
i && qe(() => {
|
|
1395
1395
|
if (!s.current) return;
|
|
1396
|
-
let
|
|
1396
|
+
let c = t == null ? void 0 : t.activeElement;
|
|
1397
1397
|
if (r != null && r.current) {
|
|
1398
|
-
if ((r == null ? void 0 : r.current) ===
|
|
1399
|
-
|
|
1398
|
+
if ((r == null ? void 0 : r.current) === c) {
|
|
1399
|
+
o.current = c;
|
|
1400
1400
|
return;
|
|
1401
1401
|
}
|
|
1402
|
-
} else if (i.contains(
|
|
1403
|
-
|
|
1402
|
+
} else if (i.contains(c)) {
|
|
1403
|
+
o.current = c;
|
|
1404
1404
|
return;
|
|
1405
1405
|
}
|
|
1406
1406
|
if (r != null && r.current) Q(r.current);
|
|
1407
1407
|
else {
|
|
1408
1408
|
if (e & 16) {
|
|
1409
|
-
if (Oe(i, J.First | J.AutoFocus) !==
|
|
1410
|
-
} else if (Oe(i, J.First) !==
|
|
1409
|
+
if (Oe(i, J.First | J.AutoFocus) !== at.Error) return;
|
|
1410
|
+
} else if (Oe(i, J.First) !== at.Error) return;
|
|
1411
1411
|
if (l != null && l.current && (Q(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1412
1412
|
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1413
1413
|
}
|
|
1414
|
-
|
|
1414
|
+
o.current = t == null ? void 0 : t.activeElement;
|
|
1415
1415
|
});
|
|
1416
|
-
}, [l,
|
|
1416
|
+
}, [l, a, e]), o;
|
|
1417
1417
|
}
|
|
1418
1418
|
function Gr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
|
|
1419
|
-
let
|
|
1419
|
+
let o = gt(), a = !!(e & 4);
|
|
1420
1420
|
qt(t == null ? void 0 : t.defaultView, "focus", (s) => {
|
|
1421
|
-
if (!
|
|
1421
|
+
if (!a || !o.current) return;
|
|
1422
1422
|
let i = en(r);
|
|
1423
1423
|
n.current instanceof HTMLElement && i.add(n.current);
|
|
1424
|
-
let
|
|
1425
|
-
if (!
|
|
1424
|
+
let c = l.current;
|
|
1425
|
+
if (!c) return;
|
|
1426
1426
|
let f = s.target;
|
|
1427
|
-
f && f instanceof HTMLElement ? tn(i, f) ? (l.current = f, Q(f)) : (s.preventDefault(), s.stopPropagation(), Q(
|
|
1427
|
+
f && f instanceof HTMLElement ? tn(i, f) ? (l.current = f, Q(f)) : (s.preventDefault(), s.stopPropagation(), Q(c)) : Q(l.current);
|
|
1428
1428
|
}, !0);
|
|
1429
1429
|
}
|
|
1430
1430
|
function tn(e, t) {
|
|
@@ -1454,37 +1454,37 @@ function Ze(e) {
|
|
|
1454
1454
|
return "children" in e ? Ze(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1455
1455
|
}
|
|
1456
1456
|
function rn(e, t) {
|
|
1457
|
-
let n = ue(e), r = O([]), l = gt(),
|
|
1457
|
+
let n = ue(e), r = O([]), l = gt(), o = pt(), a = L((w, d = te.Hidden) => {
|
|
1458
1458
|
let v = r.current.findIndex(({ el: u }) => u === w);
|
|
1459
|
-
v !== -1 && (ne(
|
|
1459
|
+
v !== -1 && (ne(d, { [te.Unmount]() {
|
|
1460
1460
|
r.current.splice(v, 1);
|
|
1461
1461
|
}, [te.Hidden]() {
|
|
1462
1462
|
r.current[v].state = "hidden";
|
|
1463
|
-
} }),
|
|
1463
|
+
} }), o.microTask(() => {
|
|
1464
1464
|
var u;
|
|
1465
1465
|
!Ze(r) && l.current && ((u = n.current) == null || u.call(n));
|
|
1466
1466
|
}));
|
|
1467
1467
|
}), s = L((w) => {
|
|
1468
|
-
let
|
|
1469
|
-
return
|
|
1470
|
-
}), i = O([]),
|
|
1471
|
-
i.current.splice(0), t && (t.chains.current[
|
|
1468
|
+
let d = r.current.find(({ el: v }) => v === w);
|
|
1469
|
+
return d ? d.state !== "visible" && (d.state = "visible") : r.current.push({ el: w, state: "visible" }), () => a(w, te.Unmount);
|
|
1470
|
+
}), i = O([]), c = O(Promise.resolve()), f = O({ enter: [], leave: [] }), y = L((w, d, v) => {
|
|
1471
|
+
i.current.splice(0), t && (t.chains.current[d] = t.chains.current[d].filter(([u]) => u !== w)), t == null || t.chains.current[d].push([w, new Promise((u) => {
|
|
1472
1472
|
i.current.push(u);
|
|
1473
|
-
})]), t == null || t.chains.current[
|
|
1474
|
-
Promise.all(f.current[
|
|
1475
|
-
})]),
|
|
1476
|
-
}), b = L((w,
|
|
1477
|
-
Promise.all(f.current[
|
|
1473
|
+
})]), t == null || t.chains.current[d].push([w, new Promise((u) => {
|
|
1474
|
+
Promise.all(f.current[d].map(([m, p]) => p)).then(() => u());
|
|
1475
|
+
})]), d === "enter" ? c.current = c.current.then(() => t == null ? void 0 : t.wait.current).then(() => v(d)) : v(d);
|
|
1476
|
+
}), b = L((w, d, v) => {
|
|
1477
|
+
Promise.all(f.current[d].splice(0).map(([u, m]) => m)).then(() => {
|
|
1478
1478
|
var u;
|
|
1479
1479
|
(u = i.current.shift()) == null || u();
|
|
1480
|
-
}).then(() => v(
|
|
1480
|
+
}).then(() => v(d));
|
|
1481
1481
|
});
|
|
1482
|
-
return C(() => ({ children: r, register: s, unregister:
|
|
1482
|
+
return C(() => ({ children: r, register: s, unregister: a, onStart: y, onStop: b, wait: c, chains: f }), [s, a, r, y, b, f, c]);
|
|
1483
1483
|
}
|
|
1484
|
-
let ln = G,
|
|
1484
|
+
let ln = G, on = Ue.RenderStrategy;
|
|
1485
1485
|
function Qr(e, t) {
|
|
1486
1486
|
var n, r;
|
|
1487
|
-
let { transition: l = !0, beforeEnter:
|
|
1487
|
+
let { transition: l = !0, beforeEnter: o, afterEnter: a, beforeLeave: s, afterLeave: i, enter: c, enterFrom: f, enterTo: y, entered: b, leave: w, leaveFrom: d, leaveTo: v, ...u } = e, [m, p] = S(null), g = O(null), x = nn(e), h = Z(...x ? [g, t, p] : t === null ? [] : [t]), $ = (n = u.unmount) == null || n ? te.Unmount : te.Hidden, { show: F, appear: j, initial: _ } = Zr(), [N, U] = S(F ? "visible" : "hidden"), B = Jr(), { register: X, unregister: P } = B;
|
|
1488
1488
|
A(() => X(g), [X, g]), A(() => {
|
|
1489
1489
|
if ($ === te.Hidden && g.current) {
|
|
1490
1490
|
if (F && N !== "visible") {
|
|
@@ -1504,51 +1504,51 @@ function Qr(e, t) {
|
|
|
1504
1504
|
pe.current = !0;
|
|
1505
1505
|
let Ne = Qe ? "enter" : "leave";
|
|
1506
1506
|
K.onStart(g, Ne, (ve) => {
|
|
1507
|
-
ve === "enter" ?
|
|
1507
|
+
ve === "enter" ? o == null || o() : ve === "leave" && (s == null || s());
|
|
1508
1508
|
});
|
|
1509
1509
|
}), k = L((Qe) => {
|
|
1510
1510
|
let Ne = Qe ? "enter" : "leave";
|
|
1511
1511
|
pe.current = !1, K.onStop(g, Ne, (ve) => {
|
|
1512
|
-
ve === "enter" ?
|
|
1512
|
+
ve === "enter" ? a == null || a() : ve === "leave" && (i == null || i());
|
|
1513
1513
|
}), Ne === "leave" && !Ze(K) && (U("hidden"), P(g));
|
|
1514
1514
|
});
|
|
1515
1515
|
M(() => {
|
|
1516
1516
|
x && l || (Ce(F), k(F));
|
|
1517
1517
|
}, [F, x, l]);
|
|
1518
|
-
let ke = !(!l || !x || !V || Se), [, I] = br(ke, m, F, { start: Ce, end: k }),
|
|
1518
|
+
let ke = !(!l || !x || !V || Se), [, I] = br(ke, m, F, { start: Ce, end: k }), cn = le({ ref: h, className: ((r = lt(u.className, Fe && c, Fe && f, I.enter && c, I.enter && I.closed && f, I.enter && !I.closed && y, I.leave && w, I.leave && !I.closed && d, I.leave && I.closed && v, !I.transition && F && b)) == null ? void 0 : r.trim()) || void 0, ...xr(I) }), he = 0;
|
|
1519
1519
|
N === "visible" && (he |= z.Open), N === "hidden" && (he |= z.Closed), I.enter && (he |= z.Opening), I.leave && (he |= z.Closing);
|
|
1520
|
-
let
|
|
1521
|
-
return E.createElement(Ke.Provider, { value: K }, E.createElement(Or, { value: he },
|
|
1520
|
+
let dn = W();
|
|
1521
|
+
return E.createElement(Ke.Provider, { value: K }, E.createElement(Or, { value: he }, dn({ ourProps: cn, theirProps: u, defaultTag: ln, features: on, visible: N === "visible", name: "Transition.Child" })));
|
|
1522
1522
|
}
|
|
1523
1523
|
function el(e, t) {
|
|
1524
|
-
let { show: n, appear: r = !1, unmount: l = !0, ...
|
|
1524
|
+
let { show: n, appear: r = !1, unmount: l = !0, ...o } = e, a = O(null), s = nn(e), i = Z(...s ? [a, t] : t === null ? [] : [t]);
|
|
1525
1525
|
Le();
|
|
1526
|
-
let
|
|
1527
|
-
if (n === void 0 &&
|
|
1526
|
+
let c = ze();
|
|
1527
|
+
if (n === void 0 && c !== null && (n = (c & z.Open) === z.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
1528
1528
|
let [f, y] = S(n ? "visible" : "hidden"), b = rn(() => {
|
|
1529
1529
|
n || y("hidden");
|
|
1530
|
-
}), [w,
|
|
1530
|
+
}), [w, d] = S(!0), v = O([n]);
|
|
1531
1531
|
A(() => {
|
|
1532
|
-
w !== !1 && v.current[v.current.length - 1] !== n && (v.current.push(n),
|
|
1532
|
+
w !== !1 && v.current[v.current.length - 1] !== n && (v.current.push(n), d(!1));
|
|
1533
1533
|
}, [v, n]);
|
|
1534
1534
|
let u = C(() => ({ show: n, appear: r, initial: w }), [n, r, w]);
|
|
1535
1535
|
A(() => {
|
|
1536
|
-
n ? y("visible") : !Ze(b) &&
|
|
1536
|
+
n ? y("visible") : !Ze(b) && a.current !== null && y("hidden");
|
|
1537
1537
|
}, [n, b]);
|
|
1538
1538
|
let m = { unmount: l }, p = L(() => {
|
|
1539
1539
|
var h;
|
|
1540
|
-
w &&
|
|
1540
|
+
w && d(!1), (h = e.beforeEnter) == null || h.call(e);
|
|
1541
1541
|
}), g = L(() => {
|
|
1542
1542
|
var h;
|
|
1543
|
-
w &&
|
|
1543
|
+
w && d(!1), (h = e.beforeLeave) == null || h.call(e);
|
|
1544
1544
|
}), x = W();
|
|
1545
|
-
return E.createElement(Ke.Provider, { value: b }, E.createElement(Ge.Provider, { value: u }, x({ ourProps: { ...m, as: G, children: E.createElement(
|
|
1545
|
+
return E.createElement(Ke.Provider, { value: b }, E.createElement(Ge.Provider, { value: u }, x({ ourProps: { ...m, as: G, children: E.createElement(an, { ref: i, ...m, ...o, beforeEnter: p, beforeLeave: g }) }, theirProps: {}, defaultTag: G, features: on, visible: f === "visible", name: "Transition" })));
|
|
1546
1546
|
}
|
|
1547
1547
|
function tl(e, t) {
|
|
1548
1548
|
let n = R(Ge) !== null, r = ze() !== null;
|
|
1549
|
-
return E.createElement(E.Fragment, null, !n && r ? E.createElement(ut, { ref: t, ...e }) : E.createElement(
|
|
1549
|
+
return E.createElement(E.Fragment, null, !n && r ? E.createElement(ut, { ref: t, ...e }) : E.createElement(an, { ref: t, ...e }));
|
|
1550
1550
|
}
|
|
1551
|
-
let ut = D(el),
|
|
1551
|
+
let ut = D(el), an = D(Qr), me = D(tl), sn = Object.assign(ut, { Child: me, Root: ut });
|
|
1552
1552
|
var nl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(nl || {}), rl = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(rl || {});
|
|
1553
1553
|
let ll = { 0(e, t) {
|
|
1554
1554
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
@@ -1566,61 +1566,61 @@ function il(e, t) {
|
|
|
1566
1566
|
return ne(t.type, ll, e, t);
|
|
1567
1567
|
}
|
|
1568
1568
|
let Lt = D(function(e, t) {
|
|
1569
|
-
let n = Pe(), { id: r = `headlessui-dialog-${n}`, open: l, onClose:
|
|
1569
|
+
let n = Pe(), { id: r = `headlessui-dialog-${n}`, open: l, onClose: o, initialFocus: a, role: s = "dialog", autoFocus: i = !0, __demoMode: c = !1, unmount: f = !1, ...y } = e, b = O(!1);
|
|
1570
1570
|
s = function() {
|
|
1571
1571
|
return s === "dialog" || s === "alertdialog" ? s : (b.current || (b.current = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
1572
1572
|
}();
|
|
1573
1573
|
let w = ze();
|
|
1574
1574
|
l === void 0 && w !== null && (l = (w & z.Open) === z.Open);
|
|
1575
|
-
let
|
|
1575
|
+
let d = O(null), v = Z(d, t), u = Me(d), m = l ? 0 : 1, [p, g] = wn(il, { titleId: null, descriptionId: null, panelRef: yn() }), x = L(() => o(!1)), h = L((k) => g({ type: 0, id: k })), $ = Le() ? m === 0 : !1, [F, j] = Ir(), _ = { get current() {
|
|
1576
1576
|
var k;
|
|
1577
|
-
return (k = p.panelRef.current) != null ? k :
|
|
1577
|
+
return (k = p.panelRef.current) != null ? k : d.current;
|
|
1578
1578
|
} }, N = Qt(), { resolveContainers: U } = Hr({ mainTreeNode: N, portals: F, defaultContainers: [_] }), B = w !== null ? (w & z.Closing) === z.Closing : !1;
|
|
1579
|
-
Jn(
|
|
1579
|
+
Jn(c || B ? !1 : $, { allowed: L(() => {
|
|
1580
1580
|
var k, ke;
|
|
1581
|
-
return [(ke = (k =
|
|
1581
|
+
return [(ke = (k = d.current) == null ? void 0 : k.closest("[data-headlessui-portal]")) != null ? ke : null];
|
|
1582
1582
|
}), disallowed: L(() => {
|
|
1583
1583
|
var k;
|
|
1584
1584
|
return [(k = N == null ? void 0 : N.closest("body > *:not(#headlessui-portal-root)")) != null ? k : null];
|
|
1585
|
-
}) }),
|
|
1585
|
+
}) }), dr($, U, (k) => {
|
|
1586
1586
|
k.preventDefault(), x();
|
|
1587
1587
|
}), jr($, u == null ? void 0 : u.defaultView, (k) => {
|
|
1588
1588
|
k.preventDefault(), k.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), x();
|
|
1589
|
-
}), gr(
|
|
1590
|
-
let [X, P] = Bn(), V = C(() => [{ dialogState: m, close: x, setTitleId: h, unmount: f }, p], [m, p, x, h, f]), Se = C(() => ({ open: m === 0 }), [m]), Fe = { ref: v, id: r, role: s, tabIndex: -1, "aria-modal":
|
|
1591
|
-
$ && !
|
|
1589
|
+
}), gr(c || B ? !1 : $, u, U), Qn($, d, x);
|
|
1590
|
+
let [X, P] = Bn(), V = C(() => [{ dialogState: m, close: x, setTitleId: h, unmount: f }, p], [m, p, x, h, f]), Se = C(() => ({ open: m === 0 }), [m]), Fe = { ref: v, id: r, role: s, tabIndex: -1, "aria-modal": c ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": p.titleId, "aria-describedby": X, unmount: f }, pe = !Ur(), K = ie.None;
|
|
1591
|
+
$ && !c && (K |= ie.RestoreFocus, K |= ie.TabLock, i && (K |= ie.AutoFocus), pe && (K |= ie.InitialFocus));
|
|
1592
1592
|
let Ce = W();
|
|
1593
|
-
return E.createElement(Pr, null, E.createElement(Pt, { force: !0 }, E.createElement(Dr, null, E.createElement(wt.Provider, { value: V }, E.createElement(Zt, { target:
|
|
1594
|
-
}),
|
|
1593
|
+
return E.createElement(Pr, null, E.createElement(Pt, { force: !0 }, E.createElement(Dr, null, E.createElement(wt.Provider, { value: V }, E.createElement(Zt, { target: d }, E.createElement(Pt, { force: !1 }, E.createElement(P, { slot: Se }, E.createElement(j, null, E.createElement(Vr, { initialFocus: a, initialFocusFallback: d, containers: U, features: K }, E.createElement(Gn, { value: x }, Ce({ ourProps: Fe, theirProps: y, slot: Se, defaultTag: ol, features: al, visible: m === 0, name: "Dialog" })))))))))));
|
|
1594
|
+
}), ol = "div", al = Ue.RenderStrategy | Ue.Static;
|
|
1595
1595
|
function sl(e, t) {
|
|
1596
|
-
let { transition: n = !1, open: r, ...l } = e,
|
|
1597
|
-
if (!
|
|
1598
|
-
if (!
|
|
1596
|
+
let { transition: n = !1, open: r, ...l } = e, o = ze(), a = e.hasOwnProperty("open") || o !== null, s = e.hasOwnProperty("onClose");
|
|
1597
|
+
if (!a && !s) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1598
|
+
if (!a) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1599
1599
|
if (!s) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1600
|
-
if (!
|
|
1600
|
+
if (!o && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
|
|
1601
1601
|
if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);
|
|
1602
1602
|
return (r !== void 0 || n) && !l.static ? E.createElement(Mt, null, E.createElement(sn, { show: r, transition: n, unmount: l.unmount }, E.createElement(Lt, { ref: t, ...l }))) : E.createElement(Mt, null, E.createElement(Lt, { ref: t, open: r, ...l }));
|
|
1603
1603
|
}
|
|
1604
1604
|
let ul = "div";
|
|
1605
|
-
function
|
|
1606
|
-
let n = Pe(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...
|
|
1605
|
+
function cl(e, t) {
|
|
1606
|
+
let n = Pe(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...o } = e, [{ dialogState: a, unmount: s }, i] = Je("Dialog.Panel"), c = Z(t, i.panelRef), f = C(() => ({ open: a === 0 }), [a]), y = L((u) => {
|
|
1607
1607
|
u.stopPropagation();
|
|
1608
|
-
}), b = { ref:
|
|
1609
|
-
return E.createElement(w, { ...
|
|
1608
|
+
}), b = { ref: c, id: r, onClick: y }, w = l ? me : G, d = l ? { unmount: s } : {}, v = W();
|
|
1609
|
+
return E.createElement(w, { ...d }, v({ ourProps: b, theirProps: o, slot: f, defaultTag: ul, name: "Dialog.Panel" }));
|
|
1610
1610
|
}
|
|
1611
|
-
let
|
|
1611
|
+
let dl = "div";
|
|
1612
1612
|
function fl(e, t) {
|
|
1613
|
-
let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount:
|
|
1614
|
-
return E.createElement(i, { ...
|
|
1613
|
+
let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount: o }] = Je("Dialog.Backdrop"), a = C(() => ({ open: l === 0 }), [l]), s = { ref: t, "aria-hidden": !0 }, i = n ? me : G, c = n ? { unmount: o } : {}, f = W();
|
|
1614
|
+
return E.createElement(i, { ...c }, f({ ourProps: s, theirProps: r, slot: a, defaultTag: dl, name: "Dialog.Backdrop" }));
|
|
1615
1615
|
}
|
|
1616
1616
|
let ml = "h2";
|
|
1617
1617
|
function pl(e, t) {
|
|
1618
|
-
let n = Pe(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState:
|
|
1619
|
-
M(() => (
|
|
1620
|
-
let i = C(() => ({ open:
|
|
1621
|
-
return W()({ ourProps:
|
|
1618
|
+
let n = Pe(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState: o, setTitleId: a }] = Je("Dialog.Title"), s = Z(t);
|
|
1619
|
+
M(() => (a(r), () => a(null)), [r, a]);
|
|
1620
|
+
let i = C(() => ({ open: o === 0 }), [o]), c = { ref: s, id: r };
|
|
1621
|
+
return W()({ ourProps: c, theirProps: l, slot: i, defaultTag: ml, name: "Dialog.Title" });
|
|
1622
1622
|
}
|
|
1623
|
-
let hl = D(sl), yt = D(
|
|
1623
|
+
let hl = D(sl), yt = D(cl);
|
|
1624
1624
|
D(fl);
|
|
1625
1625
|
let vl = D(pl), gl = Object.assign(hl, { Panel: yt, Title: vl, Description: Yn });
|
|
1626
1626
|
function un({ onClick: e }) {
|
|
@@ -1749,8 +1749,8 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1749
1749
|
)
|
|
1750
1750
|
}
|
|
1751
1751
|
) });
|
|
1752
|
-
}, xl =
|
|
1753
|
-
const
|
|
1752
|
+
}, xl = ct(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, onAfterLeave: a = null, ...s }, i) => {
|
|
1753
|
+
const c = (y) => typeof t == "function" ? t(y) : t, f = O(null);
|
|
1754
1754
|
return St(i, () => f.current, [f]), /* @__PURE__ */ T(
|
|
1755
1755
|
It,
|
|
1756
1756
|
{
|
|
@@ -1759,13 +1759,13 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1759
1759
|
onFocus: n,
|
|
1760
1760
|
onBlur: r,
|
|
1761
1761
|
onClose: l,
|
|
1762
|
-
onSuccess:
|
|
1762
|
+
onSuccess: o,
|
|
1763
1763
|
...s,
|
|
1764
1764
|
children: ({
|
|
1765
1765
|
afterLeave: y,
|
|
1766
1766
|
close: b,
|
|
1767
1767
|
config: w,
|
|
1768
|
-
emit:
|
|
1768
|
+
emit: d,
|
|
1769
1769
|
getChildModal: v,
|
|
1770
1770
|
getParentModal: u,
|
|
1771
1771
|
id: m,
|
|
@@ -1781,7 +1781,7 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1781
1781
|
{
|
|
1782
1782
|
appear: !0,
|
|
1783
1783
|
show: g ?? !1,
|
|
1784
|
-
afterLeave:
|
|
1784
|
+
afterLeave: a,
|
|
1785
1785
|
children: /* @__PURE__ */ se(
|
|
1786
1786
|
gl,
|
|
1787
1787
|
{
|
|
@@ -1815,11 +1815,11 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1815
1815
|
{
|
|
1816
1816
|
modalContext: x,
|
|
1817
1817
|
config: w,
|
|
1818
|
-
children:
|
|
1818
|
+
children: c({
|
|
1819
1819
|
afterLeave: y,
|
|
1820
1820
|
close: b,
|
|
1821
1821
|
config: w,
|
|
1822
|
-
emit:
|
|
1822
|
+
emit: d,
|
|
1823
1823
|
getChildModal: v,
|
|
1824
1824
|
getParentModal: u,
|
|
1825
1825
|
id: m,
|
|
@@ -1837,11 +1837,11 @@ const wl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1837
1837
|
{
|
|
1838
1838
|
modalContext: x,
|
|
1839
1839
|
config: w,
|
|
1840
|
-
children:
|
|
1840
|
+
children: c({
|
|
1841
1841
|
afterLeave: y,
|
|
1842
1842
|
close: b,
|
|
1843
1843
|
config: w,
|
|
1844
|
-
emit:
|
|
1844
|
+
emit: d,
|
|
1845
1845
|
getChildModal: v,
|
|
1846
1846
|
getParentModal: u,
|
|
1847
1847
|
id: m,
|
|
@@ -1870,16 +1870,16 @@ const Nl = ({
|
|
|
1870
1870
|
data: n = {},
|
|
1871
1871
|
as: r = "a",
|
|
1872
1872
|
headers: l = {},
|
|
1873
|
-
queryStringArrayFormat:
|
|
1874
|
-
onAfterLeave:
|
|
1873
|
+
queryStringArrayFormat: o = "brackets",
|
|
1874
|
+
onAfterLeave: a = null,
|
|
1875
1875
|
onBlur: s = null,
|
|
1876
1876
|
onClose: i = null,
|
|
1877
|
-
onError:
|
|
1877
|
+
onError: c = null,
|
|
1878
1878
|
onFocus: f = null,
|
|
1879
1879
|
onStart: y = null,
|
|
1880
1880
|
onSuccess: b = null,
|
|
1881
1881
|
navigate: w = null,
|
|
1882
|
-
children:
|
|
1882
|
+
children: d,
|
|
1883
1883
|
...v
|
|
1884
1884
|
}) => {
|
|
1885
1885
|
const [u, m] = S(!1), [p, g] = S(null), { stack: x, visit: h } = Xe(), $ = C(() => w ?? ft("navigate"), [w]), F = {}, j = {};
|
|
@@ -1893,8 +1893,8 @@ const Nl = ({
|
|
|
1893
1893
|
const U = Y(() => {
|
|
1894
1894
|
i == null || i();
|
|
1895
1895
|
}, [i]), B = Y(() => {
|
|
1896
|
-
g(null),
|
|
1897
|
-
}, [
|
|
1896
|
+
g(null), a == null || a();
|
|
1897
|
+
}, [a]), X = Y(
|
|
1898
1898
|
(P) => {
|
|
1899
1899
|
P == null || P.preventDefault(), !u && (e.startsWith("#") || (m(!0), y == null || y()), h(
|
|
1900
1900
|
e,
|
|
@@ -1904,15 +1904,15 @@ const Nl = ({
|
|
|
1904
1904
|
Pn(Ft(v, xt)),
|
|
1905
1905
|
() => U(x.length),
|
|
1906
1906
|
B,
|
|
1907
|
-
|
|
1907
|
+
o,
|
|
1908
1908
|
$
|
|
1909
1909
|
).then((V) => {
|
|
1910
1910
|
g(V), V.registerEventListenersFromProps(j), b == null || b();
|
|
1911
1911
|
}).catch((V) => {
|
|
1912
|
-
console.error(V),
|
|
1912
|
+
console.error(V), c == null || c(V);
|
|
1913
1913
|
}).finally(() => m(!1)));
|
|
1914
1914
|
},
|
|
1915
|
-
[e, t, n, l,
|
|
1915
|
+
[e, t, n, l, o, v, U, B]
|
|
1916
1916
|
);
|
|
1917
1917
|
return /* @__PURE__ */ T(
|
|
1918
1918
|
r,
|
|
@@ -1920,7 +1920,7 @@ const Nl = ({
|
|
|
1920
1920
|
...F,
|
|
1921
1921
|
href: e,
|
|
1922
1922
|
onClick: X,
|
|
1923
|
-
children: typeof
|
|
1923
|
+
children: typeof d == "function" ? d({ loading: u }) : d
|
|
1924
1924
|
}
|
|
1925
1925
|
);
|
|
1926
1926
|
};
|