@inertiaui/modal-react 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inertiaui-modal.js +1059 -1014
- package/dist/inertiaui-modal.umd.cjs +11 -11
- package/package.json +3 -3
- package/src/HeadlessModal.jsx +38 -15
package/dist/inertiaui-modal.js
CHANGED
|
@@ -2,8 +2,8 @@ var Pn = Object.defineProperty;
|
|
|
2
2
|
var Rn = (e, t, r) => t in e ? Pn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var le = (e, t, r) => Rn(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import * as qe from "react";
|
|
5
|
-
import O, { createContext as
|
|
6
|
-
import
|
|
5
|
+
import O, { createContext as oe, useState as V, useEffect as L, useContext as Z, useRef as j, createElement as lt, useMemo as B, forwardRef as Dt, useImperativeHandle as yr, useLayoutEffect as Sn, useCallback as ae, Fragment as ue, isValidElement as Cn, cloneElement as $n, useId as Je, useSyncExternalStore as Fn, useReducer as kn, createRef as jn } from "react";
|
|
6
|
+
import ot from "axios";
|
|
7
7
|
import { router as Ye, usePage as _n } from "@inertiajs/react";
|
|
8
8
|
import { mergeDataIntoQueryString as Mn } from "@inertiajs/core";
|
|
9
9
|
import { createPortal as An } from "react-dom";
|
|
@@ -46,8 +46,8 @@ class Ln {
|
|
|
46
46
|
}
|
|
47
47
|
const n = t.split(".");
|
|
48
48
|
let l = this.config;
|
|
49
|
-
for (let
|
|
50
|
-
l = l[n[
|
|
49
|
+
for (let a = 0; a < n.length - 1; a++)
|
|
50
|
+
l = l[n[a]] = l[n[a]] || {};
|
|
51
51
|
l[n[n.length - 1]] = r;
|
|
52
52
|
}
|
|
53
53
|
get(t) {
|
|
@@ -63,7 +63,7 @@ class Ln {
|
|
|
63
63
|
return n;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
const ct = new Ln(),
|
|
66
|
+
const ct = new Ln(), Ho = () => ct.reset(), Bo = (e, t) => ct.put(e, t), Wt = (e) => ct.get(e), Me = (e, t) => ct.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
67
67
|
var Ft = { exports: {} }, Ue = {};
|
|
68
68
|
/**
|
|
69
69
|
* @license React
|
|
@@ -78,13 +78,13 @@ var sr;
|
|
|
78
78
|
function In() {
|
|
79
79
|
if (sr) return Ue;
|
|
80
80
|
sr = 1;
|
|
81
|
-
var e = O, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, l = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
82
|
-
function s(
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
for (
|
|
86
|
-
if (
|
|
87
|
-
return { $$typeof: t, type:
|
|
81
|
+
var e = O, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, l = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
82
|
+
function s(u, i, p) {
|
|
83
|
+
var c, w = {}, x = null, y = null;
|
|
84
|
+
p !== void 0 && (x = "" + p), i.key !== void 0 && (x = "" + i.key), i.ref !== void 0 && (y = i.ref);
|
|
85
|
+
for (c in i) n.call(i, c) && !a.hasOwnProperty(c) && (w[c] = i[c]);
|
|
86
|
+
if (u && u.defaultProps) for (c in i = u.defaultProps, i) w[c] === void 0 && (w[c] = i[c]);
|
|
87
|
+
return { $$typeof: t, type: u, key: x, ref: y, props: w, _owner: l.current };
|
|
88
88
|
}
|
|
89
89
|
return Ue.Fragment = r, Ue.jsx = s, Ue.jsxs = s, Ue;
|
|
90
90
|
}
|
|
@@ -101,88 +101,88 @@ var He = {};
|
|
|
101
101
|
var ur;
|
|
102
102
|
function Nn() {
|
|
103
103
|
return ur || (ur = 1, process.env.NODE_ENV !== "production" && function() {
|
|
104
|
-
var e = O, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"),
|
|
105
|
-
function
|
|
106
|
-
if (
|
|
104
|
+
var e = O, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), u = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), g = Symbol.iterator, f = "@@iterator";
|
|
105
|
+
function d(o) {
|
|
106
|
+
if (o === null || typeof o != "object")
|
|
107
107
|
return null;
|
|
108
|
-
var
|
|
109
|
-
return typeof
|
|
108
|
+
var v = g && o[g] || o[f];
|
|
109
|
+
return typeof v == "function" ? v : null;
|
|
110
110
|
}
|
|
111
|
-
var
|
|
112
|
-
function
|
|
111
|
+
var m = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
112
|
+
function h(o) {
|
|
113
113
|
{
|
|
114
|
-
for (var
|
|
114
|
+
for (var v = arguments.length, b = new Array(v > 1 ? v - 1 : 0), P = 1; P < v; P++)
|
|
115
115
|
b[P - 1] = arguments[P];
|
|
116
|
-
|
|
116
|
+
E("error", o, b);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function E(o, v, b) {
|
|
120
120
|
{
|
|
121
|
-
var P =
|
|
122
|
-
k !== "" && (
|
|
123
|
-
var M = b.map(function(
|
|
124
|
-
return String(
|
|
121
|
+
var P = m.ReactDebugCurrentFrame, k = P.getStackAddendum();
|
|
122
|
+
k !== "" && (v += "%s", b = b.concat([k]));
|
|
123
|
+
var M = b.map(function(C) {
|
|
124
|
+
return String(C);
|
|
125
125
|
});
|
|
126
|
-
M.unshift("Warning: " +
|
|
126
|
+
M.unshift("Warning: " + v), Function.prototype.apply.call(console[o], console, M);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
var T = !1, F = !1, X = !1, U = !1, ee = !1, te;
|
|
130
130
|
te = Symbol.for("react.module.reference");
|
|
131
|
-
function H(
|
|
132
|
-
return !!(typeof
|
|
131
|
+
function H(o) {
|
|
132
|
+
return !!(typeof o == "string" || typeof o == "function" || o === n || o === a || ee || o === l || o === p || o === c || U || o === y || T || F || X || typeof o == "object" && o !== null && (o.$$typeof === x || o.$$typeof === w || o.$$typeof === s || o.$$typeof === u || o.$$typeof === i || // This needs to include all possible module reference object
|
|
133
133
|
// types supported by any Flight configuration anywhere since
|
|
134
134
|
// we don't know which Flight build this will end up being used
|
|
135
135
|
// with.
|
|
136
|
-
|
|
136
|
+
o.$$typeof === te || o.getModuleId !== void 0));
|
|
137
137
|
}
|
|
138
|
-
function q(
|
|
139
|
-
var P =
|
|
138
|
+
function q(o, v, b) {
|
|
139
|
+
var P = o.displayName;
|
|
140
140
|
if (P)
|
|
141
141
|
return P;
|
|
142
|
-
var k =
|
|
142
|
+
var k = v.displayName || v.name || "";
|
|
143
143
|
return k !== "" ? b + "(" + k + ")" : b;
|
|
144
144
|
}
|
|
145
|
-
function G(
|
|
146
|
-
return
|
|
145
|
+
function G(o) {
|
|
146
|
+
return o.displayName || "Context";
|
|
147
147
|
}
|
|
148
|
-
function _(
|
|
149
|
-
if (
|
|
148
|
+
function _(o) {
|
|
149
|
+
if (o == null)
|
|
150
150
|
return null;
|
|
151
|
-
if (typeof
|
|
152
|
-
return
|
|
153
|
-
if (typeof
|
|
154
|
-
return
|
|
155
|
-
switch (
|
|
151
|
+
if (typeof o.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
|
|
152
|
+
return o.displayName || o.name || null;
|
|
153
|
+
if (typeof o == "string")
|
|
154
|
+
return o;
|
|
155
|
+
switch (o) {
|
|
156
156
|
case n:
|
|
157
157
|
return "Fragment";
|
|
158
158
|
case r:
|
|
159
159
|
return "Portal";
|
|
160
|
-
case
|
|
160
|
+
case a:
|
|
161
161
|
return "Profiler";
|
|
162
162
|
case l:
|
|
163
163
|
return "StrictMode";
|
|
164
|
-
case
|
|
164
|
+
case p:
|
|
165
165
|
return "Suspense";
|
|
166
|
-
case
|
|
166
|
+
case c:
|
|
167
167
|
return "SuspenseList";
|
|
168
168
|
}
|
|
169
|
-
if (typeof
|
|
170
|
-
switch (
|
|
171
|
-
case
|
|
172
|
-
var
|
|
173
|
-
return G(
|
|
169
|
+
if (typeof o == "object")
|
|
170
|
+
switch (o.$$typeof) {
|
|
171
|
+
case u:
|
|
172
|
+
var v = o;
|
|
173
|
+
return G(v) + ".Consumer";
|
|
174
174
|
case s:
|
|
175
|
-
var b =
|
|
175
|
+
var b = o;
|
|
176
176
|
return G(b._context) + ".Provider";
|
|
177
|
-
case
|
|
178
|
-
return q(
|
|
179
|
-
case
|
|
180
|
-
var P =
|
|
181
|
-
return P !== null ? P : _(
|
|
182
|
-
case
|
|
183
|
-
var k =
|
|
177
|
+
case i:
|
|
178
|
+
return q(o, o.render, "ForwardRef");
|
|
179
|
+
case w:
|
|
180
|
+
var P = o.displayName || null;
|
|
181
|
+
return P !== null ? P : _(o.type) || "Memo";
|
|
182
|
+
case x: {
|
|
183
|
+
var k = o, M = k._payload, C = k._init;
|
|
184
184
|
try {
|
|
185
|
-
return _(
|
|
185
|
+
return _(C(M));
|
|
186
186
|
} catch {
|
|
187
187
|
return null;
|
|
188
188
|
}
|
|
@@ -190,70 +190,70 @@ function Nn() {
|
|
|
190
190
|
}
|
|
191
191
|
return null;
|
|
192
192
|
}
|
|
193
|
-
var
|
|
193
|
+
var $ = Object.assign, I = 0, be, xe, ve, re, Ee, N, Te;
|
|
194
194
|
function Y() {
|
|
195
195
|
}
|
|
196
196
|
Y.__reactDisabledLog = !0;
|
|
197
|
-
function
|
|
197
|
+
function xt() {
|
|
198
198
|
{
|
|
199
|
-
if (
|
|
200
|
-
be = console.log,
|
|
201
|
-
var
|
|
199
|
+
if (I === 0) {
|
|
200
|
+
be = console.log, xe = console.info, ve = console.warn, re = console.error, Ee = console.group, N = console.groupCollapsed, Te = console.groupEnd;
|
|
201
|
+
var o = {
|
|
202
202
|
configurable: !0,
|
|
203
203
|
enumerable: !0,
|
|
204
204
|
value: Y,
|
|
205
205
|
writable: !0
|
|
206
206
|
};
|
|
207
207
|
Object.defineProperties(console, {
|
|
208
|
-
info:
|
|
209
|
-
log:
|
|
210
|
-
warn:
|
|
211
|
-
error:
|
|
212
|
-
group:
|
|
213
|
-
groupCollapsed:
|
|
214
|
-
groupEnd:
|
|
208
|
+
info: o,
|
|
209
|
+
log: o,
|
|
210
|
+
warn: o,
|
|
211
|
+
error: o,
|
|
212
|
+
group: o,
|
|
213
|
+
groupCollapsed: o,
|
|
214
|
+
groupEnd: o
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
I++;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
function Oe() {
|
|
221
221
|
{
|
|
222
|
-
if (
|
|
223
|
-
var
|
|
222
|
+
if (I--, I === 0) {
|
|
223
|
+
var o = {
|
|
224
224
|
configurable: !0,
|
|
225
225
|
enumerable: !0,
|
|
226
226
|
writable: !0
|
|
227
227
|
};
|
|
228
228
|
Object.defineProperties(console, {
|
|
229
|
-
log:
|
|
229
|
+
log: $({}, o, {
|
|
230
230
|
value: be
|
|
231
231
|
}),
|
|
232
|
-
info:
|
|
233
|
-
value:
|
|
232
|
+
info: $({}, o, {
|
|
233
|
+
value: xe
|
|
234
234
|
}),
|
|
235
|
-
warn:
|
|
235
|
+
warn: $({}, o, {
|
|
236
236
|
value: ve
|
|
237
237
|
}),
|
|
238
|
-
error:
|
|
238
|
+
error: $({}, o, {
|
|
239
239
|
value: re
|
|
240
240
|
}),
|
|
241
|
-
group:
|
|
242
|
-
value:
|
|
241
|
+
group: $({}, o, {
|
|
242
|
+
value: Ee
|
|
243
243
|
}),
|
|
244
|
-
groupCollapsed:
|
|
245
|
-
value:
|
|
244
|
+
groupCollapsed: $({}, o, {
|
|
245
|
+
value: N
|
|
246
246
|
}),
|
|
247
|
-
groupEnd:
|
|
247
|
+
groupEnd: $({}, o, {
|
|
248
248
|
value: Te
|
|
249
249
|
})
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
I < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
var Ie =
|
|
256
|
-
function de(
|
|
255
|
+
var Ie = m.ReactCurrentDispatcher, Pe;
|
|
256
|
+
function de(o, v, b) {
|
|
257
257
|
{
|
|
258
258
|
if (Pe === void 0)
|
|
259
259
|
try {
|
|
@@ -263,7 +263,7 @@ function Nn() {
|
|
|
263
263
|
Pe = P && P[1] || "";
|
|
264
264
|
}
|
|
265
265
|
return `
|
|
266
|
-
` + Pe +
|
|
266
|
+
` + Pe + o;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
var fe = !1, et;
|
|
@@ -271,11 +271,11 @@ function Nn() {
|
|
|
271
271
|
var Qr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
272
272
|
et = new Qr();
|
|
273
273
|
}
|
|
274
|
-
function Kt(
|
|
275
|
-
if (!
|
|
274
|
+
function Kt(o, v) {
|
|
275
|
+
if (!o || fe)
|
|
276
276
|
return "";
|
|
277
277
|
{
|
|
278
|
-
var b = et.get(
|
|
278
|
+
var b = et.get(o);
|
|
279
279
|
if (b !== void 0)
|
|
280
280
|
return b;
|
|
281
281
|
}
|
|
@@ -284,30 +284,30 @@ function Nn() {
|
|
|
284
284
|
var k = Error.prepareStackTrace;
|
|
285
285
|
Error.prepareStackTrace = void 0;
|
|
286
286
|
var M;
|
|
287
|
-
M = Ie.current, Ie.current = null,
|
|
287
|
+
M = Ie.current, Ie.current = null, xt();
|
|
288
288
|
try {
|
|
289
|
-
if (
|
|
290
|
-
var
|
|
289
|
+
if (v) {
|
|
290
|
+
var C = function() {
|
|
291
291
|
throw Error();
|
|
292
292
|
};
|
|
293
|
-
if (Object.defineProperty(
|
|
293
|
+
if (Object.defineProperty(C.prototype, "props", {
|
|
294
294
|
set: function() {
|
|
295
295
|
throw Error();
|
|
296
296
|
}
|
|
297
297
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
298
298
|
try {
|
|
299
|
-
Reflect.construct(
|
|
299
|
+
Reflect.construct(C, []);
|
|
300
300
|
} catch (J) {
|
|
301
301
|
P = J;
|
|
302
302
|
}
|
|
303
|
-
Reflect.construct(
|
|
303
|
+
Reflect.construct(o, [], C);
|
|
304
304
|
} else {
|
|
305
305
|
try {
|
|
306
|
-
|
|
306
|
+
C.call();
|
|
307
307
|
} catch (J) {
|
|
308
308
|
P = J;
|
|
309
309
|
}
|
|
310
|
-
|
|
310
|
+
o.call(C.prototype);
|
|
311
311
|
}
|
|
312
312
|
} else {
|
|
313
313
|
try {
|
|
@@ -315,180 +315,180 @@ function Nn() {
|
|
|
315
315
|
} catch (J) {
|
|
316
316
|
P = J;
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
o();
|
|
319
319
|
}
|
|
320
320
|
} catch (J) {
|
|
321
321
|
if (J && P && typeof J.stack == "string") {
|
|
322
322
|
for (var S = J.stack.split(`
|
|
323
323
|
`), K = P.stack.split(`
|
|
324
|
-
`),
|
|
324
|
+
`), D = S.length - 1, W = K.length - 1; D >= 1 && W >= 0 && S[D] !== K[W]; )
|
|
325
325
|
W--;
|
|
326
|
-
for (;
|
|
327
|
-
if (S[
|
|
328
|
-
if (
|
|
326
|
+
for (; D >= 1 && W >= 0; D--, W--)
|
|
327
|
+
if (S[D] !== K[W]) {
|
|
328
|
+
if (D !== 1 || W !== 1)
|
|
329
329
|
do
|
|
330
|
-
if (
|
|
330
|
+
if (D--, W--, W < 0 || S[D] !== K[W]) {
|
|
331
331
|
var ne = `
|
|
332
|
-
` + S[
|
|
333
|
-
return
|
|
332
|
+
` + S[D].replace(" at new ", " at ");
|
|
333
|
+
return o.displayName && ne.includes("<anonymous>") && (ne = ne.replace("<anonymous>", o.displayName)), typeof o == "function" && et.set(o, ne), ne;
|
|
334
334
|
}
|
|
335
|
-
while (
|
|
335
|
+
while (D >= 1 && W >= 0);
|
|
336
336
|
break;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
} finally {
|
|
340
340
|
fe = !1, Ie.current = M, Oe(), Error.prepareStackTrace = k;
|
|
341
341
|
}
|
|
342
|
-
var _e =
|
|
343
|
-
return typeof
|
|
342
|
+
var _e = o ? o.displayName || o.name : "", Re = _e ? de(_e) : "";
|
|
343
|
+
return typeof o == "function" && et.set(o, Re), Re;
|
|
344
344
|
}
|
|
345
|
-
function en(
|
|
346
|
-
return Kt(
|
|
345
|
+
function en(o, v, b) {
|
|
346
|
+
return Kt(o, !1);
|
|
347
347
|
}
|
|
348
|
-
function tn(
|
|
349
|
-
var
|
|
350
|
-
return !!(
|
|
348
|
+
function tn(o) {
|
|
349
|
+
var v = o.prototype;
|
|
350
|
+
return !!(v && v.isReactComponent);
|
|
351
351
|
}
|
|
352
|
-
function tt(
|
|
353
|
-
if (
|
|
352
|
+
function tt(o, v, b) {
|
|
353
|
+
if (o == null)
|
|
354
354
|
return "";
|
|
355
|
-
if (typeof
|
|
356
|
-
return Kt(
|
|
357
|
-
if (typeof
|
|
358
|
-
return de(
|
|
359
|
-
switch (
|
|
360
|
-
case
|
|
355
|
+
if (typeof o == "function")
|
|
356
|
+
return Kt(o, tn(o));
|
|
357
|
+
if (typeof o == "string")
|
|
358
|
+
return de(o);
|
|
359
|
+
switch (o) {
|
|
360
|
+
case p:
|
|
361
361
|
return de("Suspense");
|
|
362
|
-
case
|
|
362
|
+
case c:
|
|
363
363
|
return de("SuspenseList");
|
|
364
364
|
}
|
|
365
|
-
if (typeof
|
|
366
|
-
switch (
|
|
367
|
-
case
|
|
368
|
-
return en(
|
|
369
|
-
case
|
|
370
|
-
return tt(
|
|
371
|
-
case
|
|
372
|
-
var P =
|
|
365
|
+
if (typeof o == "object")
|
|
366
|
+
switch (o.$$typeof) {
|
|
367
|
+
case i:
|
|
368
|
+
return en(o.render);
|
|
369
|
+
case w:
|
|
370
|
+
return tt(o.type, v, b);
|
|
371
|
+
case x: {
|
|
372
|
+
var P = o, k = P._payload, M = P._init;
|
|
373
373
|
try {
|
|
374
|
-
return tt(M(k),
|
|
374
|
+
return tt(M(k), v, b);
|
|
375
375
|
} catch {
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
return "";
|
|
380
380
|
}
|
|
381
|
-
var Ne = Object.prototype.hasOwnProperty, zt = {}, Gt =
|
|
382
|
-
function rt(
|
|
383
|
-
if (
|
|
384
|
-
var
|
|
381
|
+
var Ne = Object.prototype.hasOwnProperty, zt = {}, Gt = m.ReactDebugCurrentFrame;
|
|
382
|
+
function rt(o) {
|
|
383
|
+
if (o) {
|
|
384
|
+
var v = o._owner, b = tt(o.type, o._source, v ? v.type : null);
|
|
385
385
|
Gt.setExtraStackFrame(b);
|
|
386
386
|
} else
|
|
387
387
|
Gt.setExtraStackFrame(null);
|
|
388
388
|
}
|
|
389
|
-
function rn(
|
|
389
|
+
function rn(o, v, b, P, k) {
|
|
390
390
|
{
|
|
391
391
|
var M = Function.call.bind(Ne);
|
|
392
|
-
for (var
|
|
393
|
-
if (M(
|
|
392
|
+
for (var C in o)
|
|
393
|
+
if (M(o, C)) {
|
|
394
394
|
var S = void 0;
|
|
395
395
|
try {
|
|
396
|
-
if (typeof
|
|
397
|
-
var K = Error((P || "React class") + ": " + b + " type `" +
|
|
396
|
+
if (typeof o[C] != "function") {
|
|
397
|
+
var K = Error((P || "React class") + ": " + b + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
398
398
|
throw K.name = "Invariant Violation", K;
|
|
399
399
|
}
|
|
400
|
-
S =
|
|
401
|
-
} catch (
|
|
402
|
-
S =
|
|
400
|
+
S = o[C](v, C, P, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
401
|
+
} catch (D) {
|
|
402
|
+
S = D;
|
|
403
403
|
}
|
|
404
|
-
S && !(S instanceof Error) && (rt(k),
|
|
404
|
+
S && !(S instanceof Error) && (rt(k), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", P || "React class", b, C, typeof S), rt(null)), S instanceof Error && !(S.message in zt) && (zt[S.message] = !0, rt(k), h("Failed %s type: %s", b, S.message), rt(null));
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
var nn = Array.isArray;
|
|
409
|
-
function
|
|
410
|
-
return nn(
|
|
409
|
+
function Et(o) {
|
|
410
|
+
return nn(o);
|
|
411
411
|
}
|
|
412
|
-
function ln(
|
|
412
|
+
function ln(o) {
|
|
413
413
|
{
|
|
414
|
-
var
|
|
414
|
+
var v = typeof Symbol == "function" && Symbol.toStringTag, b = v && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
415
415
|
return b;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function on(o) {
|
|
419
419
|
try {
|
|
420
|
-
return Jt(
|
|
420
|
+
return Jt(o), !1;
|
|
421
421
|
} catch {
|
|
422
422
|
return !0;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
function Jt(
|
|
426
|
-
return "" +
|
|
425
|
+
function Jt(o) {
|
|
426
|
+
return "" + o;
|
|
427
427
|
}
|
|
428
|
-
function Zt(
|
|
429
|
-
if (
|
|
430
|
-
return
|
|
428
|
+
function Zt(o) {
|
|
429
|
+
if (on(o))
|
|
430
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ln(o)), Jt(o);
|
|
431
431
|
}
|
|
432
|
-
var De =
|
|
432
|
+
var De = m.ReactCurrentOwner, an = {
|
|
433
433
|
key: !0,
|
|
434
434
|
ref: !0,
|
|
435
435
|
__self: !0,
|
|
436
436
|
__source: !0
|
|
437
437
|
}, Qt, er, Tt;
|
|
438
438
|
Tt = {};
|
|
439
|
-
function sn(
|
|
440
|
-
if (Ne.call(
|
|
441
|
-
var
|
|
442
|
-
if (
|
|
439
|
+
function sn(o) {
|
|
440
|
+
if (Ne.call(o, "ref")) {
|
|
441
|
+
var v = Object.getOwnPropertyDescriptor(o, "ref").get;
|
|
442
|
+
if (v && v.isReactWarning)
|
|
443
443
|
return !1;
|
|
444
444
|
}
|
|
445
|
-
return
|
|
445
|
+
return o.ref !== void 0;
|
|
446
446
|
}
|
|
447
|
-
function un(
|
|
448
|
-
if (Ne.call(
|
|
449
|
-
var
|
|
450
|
-
if (
|
|
447
|
+
function un(o) {
|
|
448
|
+
if (Ne.call(o, "key")) {
|
|
449
|
+
var v = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
450
|
+
if (v && v.isReactWarning)
|
|
451
451
|
return !1;
|
|
452
452
|
}
|
|
453
|
-
return
|
|
453
|
+
return o.key !== void 0;
|
|
454
454
|
}
|
|
455
|
-
function cn(
|
|
456
|
-
if (typeof
|
|
455
|
+
function cn(o, v) {
|
|
456
|
+
if (typeof o.ref == "string" && De.current && v && De.current.stateNode !== v) {
|
|
457
457
|
var b = _(De.current.type);
|
|
458
|
-
Tt[b] || (
|
|
458
|
+
Tt[b] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', _(De.current.type), o.ref), Tt[b] = !0);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
function dn(
|
|
461
|
+
function dn(o, v) {
|
|
462
462
|
{
|
|
463
463
|
var b = function() {
|
|
464
|
-
Qt || (Qt = !0,
|
|
464
|
+
Qt || (Qt = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", v));
|
|
465
465
|
};
|
|
466
|
-
b.isReactWarning = !0, Object.defineProperty(
|
|
466
|
+
b.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
467
467
|
get: b,
|
|
468
468
|
configurable: !0
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
function fn(
|
|
472
|
+
function fn(o, v) {
|
|
473
473
|
{
|
|
474
474
|
var b = function() {
|
|
475
|
-
er || (er = !0,
|
|
475
|
+
er || (er = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", v));
|
|
476
476
|
};
|
|
477
|
-
b.isReactWarning = !0, Object.defineProperty(
|
|
477
|
+
b.isReactWarning = !0, Object.defineProperty(o, "ref", {
|
|
478
478
|
get: b,
|
|
479
479
|
configurable: !0
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
var pn = function(
|
|
483
|
+
var pn = function(o, v, b, P, k, M, C) {
|
|
484
484
|
var S = {
|
|
485
485
|
// This tag allows us to uniquely identify this as a React Element
|
|
486
486
|
$$typeof: t,
|
|
487
487
|
// Built-in properties that belong on the element
|
|
488
|
-
type:
|
|
489
|
-
key:
|
|
488
|
+
type: o,
|
|
489
|
+
key: v,
|
|
490
490
|
ref: b,
|
|
491
|
-
props:
|
|
491
|
+
props: C,
|
|
492
492
|
// Record the component responsible for creating this element.
|
|
493
493
|
_owner: M
|
|
494
494
|
};
|
|
@@ -509,187 +509,187 @@ function Nn() {
|
|
|
509
509
|
value: k
|
|
510
510
|
}), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
|
|
511
511
|
};
|
|
512
|
-
function mn(
|
|
512
|
+
function mn(o, v, b, P, k) {
|
|
513
513
|
{
|
|
514
|
-
var M,
|
|
515
|
-
b !== void 0 && (Zt(b), S = "" + b), un(
|
|
516
|
-
for (M in
|
|
517
|
-
Ne.call(
|
|
518
|
-
if (
|
|
519
|
-
var
|
|
520
|
-
for (M in
|
|
521
|
-
|
|
514
|
+
var M, C = {}, S = null, K = null;
|
|
515
|
+
b !== void 0 && (Zt(b), S = "" + b), un(v) && (Zt(v.key), S = "" + v.key), sn(v) && (K = v.ref, cn(v, k));
|
|
516
|
+
for (M in v)
|
|
517
|
+
Ne.call(v, M) && !an.hasOwnProperty(M) && (C[M] = v[M]);
|
|
518
|
+
if (o && o.defaultProps) {
|
|
519
|
+
var D = o.defaultProps;
|
|
520
|
+
for (M in D)
|
|
521
|
+
C[M] === void 0 && (C[M] = D[M]);
|
|
522
522
|
}
|
|
523
523
|
if (S || K) {
|
|
524
|
-
var W = typeof
|
|
525
|
-
S && dn(
|
|
524
|
+
var W = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
|
|
525
|
+
S && dn(C, W), K && fn(C, W);
|
|
526
526
|
}
|
|
527
|
-
return pn(
|
|
527
|
+
return pn(o, S, K, k, P, De.current, C);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
var Ot =
|
|
531
|
-
function je(
|
|
532
|
-
if (
|
|
533
|
-
var
|
|
530
|
+
var Ot = m.ReactCurrentOwner, tr = m.ReactDebugCurrentFrame;
|
|
531
|
+
function je(o) {
|
|
532
|
+
if (o) {
|
|
533
|
+
var v = o._owner, b = tt(o.type, o._source, v ? v.type : null);
|
|
534
534
|
tr.setExtraStackFrame(b);
|
|
535
535
|
} else
|
|
536
536
|
tr.setExtraStackFrame(null);
|
|
537
537
|
}
|
|
538
538
|
var Pt;
|
|
539
539
|
Pt = !1;
|
|
540
|
-
function Rt(
|
|
541
|
-
return typeof
|
|
540
|
+
function Rt(o) {
|
|
541
|
+
return typeof o == "object" && o !== null && o.$$typeof === t;
|
|
542
542
|
}
|
|
543
543
|
function rr() {
|
|
544
544
|
{
|
|
545
545
|
if (Ot.current) {
|
|
546
|
-
var
|
|
547
|
-
if (
|
|
546
|
+
var o = _(Ot.current.type);
|
|
547
|
+
if (o)
|
|
548
548
|
return `
|
|
549
549
|
|
|
550
|
-
Check the render method of \`` +
|
|
550
|
+
Check the render method of \`` + o + "`.";
|
|
551
551
|
}
|
|
552
552
|
return "";
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
function vn(
|
|
555
|
+
function vn(o) {
|
|
556
556
|
return "";
|
|
557
557
|
}
|
|
558
558
|
var nr = {};
|
|
559
|
-
function hn(
|
|
559
|
+
function hn(o) {
|
|
560
560
|
{
|
|
561
|
-
var
|
|
562
|
-
if (!
|
|
563
|
-
var b = typeof
|
|
564
|
-
b && (
|
|
561
|
+
var v = rr();
|
|
562
|
+
if (!v) {
|
|
563
|
+
var b = typeof o == "string" ? o : o.displayName || o.name;
|
|
564
|
+
b && (v = `
|
|
565
565
|
|
|
566
566
|
Check the top-level render call using <` + b + ">.");
|
|
567
567
|
}
|
|
568
|
-
return
|
|
568
|
+
return v;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
function lr(
|
|
571
|
+
function lr(o, v) {
|
|
572
572
|
{
|
|
573
|
-
if (!
|
|
573
|
+
if (!o._store || o._store.validated || o.key != null)
|
|
574
574
|
return;
|
|
575
|
-
|
|
576
|
-
var b = hn(
|
|
575
|
+
o._store.validated = !0;
|
|
576
|
+
var b = hn(v);
|
|
577
577
|
if (nr[b])
|
|
578
578
|
return;
|
|
579
579
|
nr[b] = !0;
|
|
580
580
|
var P = "";
|
|
581
|
-
|
|
581
|
+
o && o._owner && o._owner !== Ot.current && (P = " It was passed a child from " + _(o._owner.type) + "."), je(o), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, P), je(null);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function or(o, v) {
|
|
585
585
|
{
|
|
586
|
-
if (typeof
|
|
586
|
+
if (typeof o != "object")
|
|
587
587
|
return;
|
|
588
|
-
if (
|
|
589
|
-
for (var b = 0; b <
|
|
590
|
-
var P =
|
|
591
|
-
Rt(P) && lr(P,
|
|
588
|
+
if (Et(o))
|
|
589
|
+
for (var b = 0; b < o.length; b++) {
|
|
590
|
+
var P = o[b];
|
|
591
|
+
Rt(P) && lr(P, v);
|
|
592
592
|
}
|
|
593
|
-
else if (Rt(
|
|
594
|
-
|
|
595
|
-
else if (
|
|
596
|
-
var k =
|
|
597
|
-
if (typeof k == "function" && k !==
|
|
598
|
-
for (var M = k.call(
|
|
599
|
-
Rt(
|
|
593
|
+
else if (Rt(o))
|
|
594
|
+
o._store && (o._store.validated = !0);
|
|
595
|
+
else if (o) {
|
|
596
|
+
var k = d(o);
|
|
597
|
+
if (typeof k == "function" && k !== o.entries)
|
|
598
|
+
for (var M = k.call(o), C; !(C = M.next()).done; )
|
|
599
|
+
Rt(C.value) && lr(C.value, v);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function gn(
|
|
603
|
+
function gn(o) {
|
|
604
604
|
{
|
|
605
|
-
var
|
|
606
|
-
if (
|
|
605
|
+
var v = o.type;
|
|
606
|
+
if (v == null || typeof v == "string")
|
|
607
607
|
return;
|
|
608
608
|
var b;
|
|
609
|
-
if (typeof
|
|
610
|
-
b =
|
|
611
|
-
else if (typeof
|
|
609
|
+
if (typeof v == "function")
|
|
610
|
+
b = v.propTypes;
|
|
611
|
+
else if (typeof v == "object" && (v.$$typeof === i || // Note: Memo only checks outer props here.
|
|
612
612
|
// Inner props are checked in the reconciler.
|
|
613
|
-
|
|
614
|
-
b =
|
|
613
|
+
v.$$typeof === w))
|
|
614
|
+
b = v.propTypes;
|
|
615
615
|
else
|
|
616
616
|
return;
|
|
617
617
|
if (b) {
|
|
618
|
-
var P = _(
|
|
619
|
-
rn(b,
|
|
620
|
-
} else if (
|
|
618
|
+
var P = _(v);
|
|
619
|
+
rn(b, o.props, "prop", P, o);
|
|
620
|
+
} else if (v.PropTypes !== void 0 && !Pt) {
|
|
621
621
|
Pt = !0;
|
|
622
|
-
var k = _(
|
|
623
|
-
|
|
622
|
+
var k = _(v);
|
|
623
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
|
624
624
|
}
|
|
625
|
-
typeof
|
|
625
|
+
typeof v.getDefaultProps == "function" && !v.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
function wn(
|
|
628
|
+
function wn(o) {
|
|
629
629
|
{
|
|
630
|
-
for (var
|
|
631
|
-
var P =
|
|
630
|
+
for (var v = Object.keys(o.props), b = 0; b < v.length; b++) {
|
|
631
|
+
var P = v[b];
|
|
632
632
|
if (P !== "children" && P !== "key") {
|
|
633
|
-
je(
|
|
633
|
+
je(o), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", P), je(null);
|
|
634
634
|
break;
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
|
|
637
|
+
o.ref !== null && (je(o), h("Invalid attribute `ref` supplied to `React.Fragment`."), je(null));
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
|
-
var
|
|
641
|
-
function
|
|
640
|
+
var ir = {};
|
|
641
|
+
function ar(o, v, b, P, k, M) {
|
|
642
642
|
{
|
|
643
|
-
var
|
|
644
|
-
if (
|
|
643
|
+
var C = H(o);
|
|
644
|
+
if (!C) {
|
|
645
645
|
var S = "";
|
|
646
|
-
(
|
|
646
|
+
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (S += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
647
647
|
var K = vn();
|
|
648
648
|
K ? S += K : S += rr();
|
|
649
|
-
var
|
|
650
|
-
|
|
649
|
+
var D;
|
|
650
|
+
o === null ? D = "null" : Et(o) ? D = "array" : o !== void 0 && o.$$typeof === t ? (D = "<" + (_(o.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : D = typeof o, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, S);
|
|
651
651
|
}
|
|
652
|
-
var W = mn(
|
|
652
|
+
var W = mn(o, v, b, k, M);
|
|
653
653
|
if (W == null)
|
|
654
654
|
return W;
|
|
655
|
-
if (
|
|
656
|
-
var ne =
|
|
655
|
+
if (C) {
|
|
656
|
+
var ne = v.children;
|
|
657
657
|
if (ne !== void 0)
|
|
658
658
|
if (P)
|
|
659
|
-
if (
|
|
659
|
+
if (Et(ne)) {
|
|
660
660
|
for (var _e = 0; _e < ne.length; _e++)
|
|
661
|
-
|
|
661
|
+
or(ne[_e], o);
|
|
662
662
|
Object.freeze && Object.freeze(ne);
|
|
663
663
|
} else
|
|
664
|
-
|
|
664
|
+
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
665
665
|
else
|
|
666
|
-
|
|
666
|
+
or(ne, o);
|
|
667
667
|
}
|
|
668
|
-
if (Ne.call(
|
|
669
|
-
var Re = _(
|
|
668
|
+
if (Ne.call(v, "key")) {
|
|
669
|
+
var Re = _(o), J = Object.keys(v).filter(function(On) {
|
|
670
670
|
return On !== "key";
|
|
671
671
|
}), St = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
672
|
-
if (!
|
|
672
|
+
if (!ir[Re + St]) {
|
|
673
673
|
var Tn = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}";
|
|
674
|
-
|
|
674
|
+
h(`A props object containing a "key" prop is being spread into JSX:
|
|
675
675
|
let props = %s;
|
|
676
676
|
<%s {...props} />
|
|
677
677
|
React keys must be passed directly to JSX without using spread:
|
|
678
678
|
let props = %s;
|
|
679
|
-
<%s key={someKey} {...props} />`, St, Re, Tn, Re),
|
|
679
|
+
<%s key={someKey} {...props} />`, St, Re, Tn, Re), ir[Re + St] = !0;
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
return
|
|
682
|
+
return o === n ? wn(W) : gn(W), W;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
function yn(
|
|
686
|
-
return
|
|
685
|
+
function yn(o, v, b) {
|
|
686
|
+
return ar(o, v, b, !0);
|
|
687
687
|
}
|
|
688
|
-
function bn(
|
|
689
|
-
return
|
|
688
|
+
function bn(o, v, b) {
|
|
689
|
+
return ar(o, v, b, !1);
|
|
690
690
|
}
|
|
691
|
-
var
|
|
692
|
-
He.Fragment = n, He.jsx =
|
|
691
|
+
var xn = bn, En = yn;
|
|
692
|
+
He.Fragment = n, He.jsx = xn, He.jsxs = En;
|
|
693
693
|
}()), He;
|
|
694
694
|
}
|
|
695
695
|
process.env.NODE_ENV === "production" ? Ft.exports = In() : Ft.exports = Nn();
|
|
@@ -705,229 +705,229 @@ function Wn(e) {
|
|
|
705
705
|
}
|
|
706
706
|
function Un(e, t = 3, r = 10) {
|
|
707
707
|
return new Promise((n, l) => {
|
|
708
|
-
const
|
|
709
|
-
if (
|
|
710
|
-
n(
|
|
708
|
+
const a = e();
|
|
709
|
+
if (a) {
|
|
710
|
+
n(a);
|
|
711
711
|
return;
|
|
712
712
|
}
|
|
713
713
|
let s = t * 1e3 / r;
|
|
714
|
-
const
|
|
715
|
-
const
|
|
716
|
-
|
|
714
|
+
const u = setInterval(() => {
|
|
715
|
+
const i = e();
|
|
716
|
+
i && (clearInterval(u), n(i)), --s <= 0 && (clearInterval(u), l(new Error("Condition not met in time")));
|
|
717
717
|
}, r);
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
function Be(e) {
|
|
721
721
|
return e ? (e = e.replace(/_/g, "-"), e = e.replace(/-+/g, "-"), /[A-Z]/.test(e) ? (e = e.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (t, r) => r.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : "";
|
|
722
722
|
}
|
|
723
|
-
const dt =
|
|
723
|
+
const dt = oe(null);
|
|
724
724
|
dt.displayName = "ModalStackContext";
|
|
725
|
-
let
|
|
725
|
+
let xr = null, Er = null, Ke = null, kt = null, jt = [];
|
|
726
726
|
const Hn = ({ children: e }) => {
|
|
727
|
-
const [t, r] = V([]), [n, l] = V({}),
|
|
728
|
-
r((
|
|
729
|
-
const
|
|
727
|
+
const [t, r] = V([]), [n, l] = V({}), a = (f) => {
|
|
728
|
+
r((d) => {
|
|
729
|
+
const m = f([...d]), h = (E) => {
|
|
730
730
|
var T;
|
|
731
|
-
return
|
|
731
|
+
return m.length < 2 ? !0 : ((T = m.map((F) => ({ id: F.id, shouldRender: F.shouldRender })).reverse().find((F) => F.shouldRender)) == null ? void 0 : T.id) === E;
|
|
732
732
|
};
|
|
733
|
-
return
|
|
734
|
-
|
|
735
|
-
}),
|
|
733
|
+
return m.forEach((E, T) => {
|
|
734
|
+
m[T].onTopOfStack = h(E.id), m[T].getParentModal = () => T < 1 ? null : m.slice(0, T).reverse().find((F) => F.isOpen), m[T].getChildModal = () => T === m.length - 1 ? null : m.slice(T + 1).find((F) => F.isOpen);
|
|
735
|
+
}), m;
|
|
736
736
|
});
|
|
737
737
|
};
|
|
738
|
-
|
|
738
|
+
L(() => {
|
|
739
739
|
jt = t;
|
|
740
740
|
}, [t]);
|
|
741
741
|
class s {
|
|
742
|
-
constructor(
|
|
743
|
-
le(this, "update", (
|
|
744
|
-
|
|
745
|
-
(
|
|
742
|
+
constructor(d, m, h, E, T) {
|
|
743
|
+
le(this, "update", (d, m, h) => {
|
|
744
|
+
a(
|
|
745
|
+
(E) => E.map((T) => (T.id === this.id && (T.config = d, T.onCloseCallback = m, T.afterLeaveCallback = h), T))
|
|
746
746
|
);
|
|
747
747
|
});
|
|
748
748
|
le(this, "show", () => {
|
|
749
|
-
|
|
750
|
-
(
|
|
749
|
+
a(
|
|
750
|
+
(d) => d.map((m) => (m.id === this.id && !m.isOpen && (m.isOpen = !0, m.shouldRender = !0), m))
|
|
751
751
|
);
|
|
752
752
|
});
|
|
753
|
-
le(this, "setOpen", (
|
|
754
|
-
|
|
753
|
+
le(this, "setOpen", (d) => {
|
|
754
|
+
d ? this.show() : this.close();
|
|
755
755
|
});
|
|
756
756
|
le(this, "close", () => {
|
|
757
|
-
|
|
758
|
-
(
|
|
759
|
-
var
|
|
760
|
-
return
|
|
761
|
-
|
|
762
|
-
}),
|
|
757
|
+
a(
|
|
758
|
+
(d) => d.map((m) => {
|
|
759
|
+
var h;
|
|
760
|
+
return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((E) => {
|
|
761
|
+
m.off(E);
|
|
762
|
+
}), m.isOpen = !1, (h = m.onCloseCallback) == null || h.call(m)), m;
|
|
763
763
|
})
|
|
764
764
|
);
|
|
765
765
|
});
|
|
766
766
|
le(this, "afterLeave", () => {
|
|
767
|
-
this.isOpen ||
|
|
768
|
-
const
|
|
769
|
-
var
|
|
770
|
-
return
|
|
767
|
+
this.isOpen || a((d) => {
|
|
768
|
+
const m = d.map((h) => {
|
|
769
|
+
var E;
|
|
770
|
+
return h.id === this.id && !h.isOpen && (h.shouldRender = !1, (E = h.afterLeaveCallback) == null || E.call(h), h.afterLeaveCallback = null), h;
|
|
771
771
|
});
|
|
772
|
-
return this.index === 0 ? [] :
|
|
772
|
+
return this.index === 0 ? [] : m;
|
|
773
773
|
});
|
|
774
774
|
});
|
|
775
|
-
le(this, "on", (
|
|
776
|
-
|
|
775
|
+
le(this, "on", (d, m) => {
|
|
776
|
+
d = Be(d), this.listeners[d] = this.listeners[d] ?? [], this.listeners[d].push(m);
|
|
777
777
|
});
|
|
778
|
-
le(this, "off", (
|
|
779
|
-
var
|
|
780
|
-
|
|
778
|
+
le(this, "off", (d, m) => {
|
|
779
|
+
var h;
|
|
780
|
+
d = Be(d), m ? this.listeners[d] = ((h = this.listeners[d]) == null ? void 0 : h.filter((E) => E !== m)) ?? [] : delete this.listeners[d];
|
|
781
781
|
});
|
|
782
|
-
le(this, "emit", (
|
|
783
|
-
var
|
|
784
|
-
(
|
|
782
|
+
le(this, "emit", (d, ...m) => {
|
|
783
|
+
var h;
|
|
784
|
+
(h = this.listeners[Be(d)]) == null || h.forEach((E) => E(...m));
|
|
785
785
|
});
|
|
786
|
-
le(this, "registerEventListenersFromProps", (
|
|
787
|
-
const
|
|
788
|
-
return Object.keys(
|
|
789
|
-
const
|
|
790
|
-
this.on(
|
|
791
|
-
}), () =>
|
|
786
|
+
le(this, "registerEventListenersFromProps", (d) => {
|
|
787
|
+
const m = [];
|
|
788
|
+
return Object.keys(d).filter((h) => h.startsWith("on")).forEach((h) => {
|
|
789
|
+
const E = Be(h).replace(/^on-/, "");
|
|
790
|
+
this.on(E, d[h]), m.push(() => this.off(E, d[h]));
|
|
791
|
+
}), () => m.forEach((h) => h());
|
|
792
792
|
});
|
|
793
|
-
le(this, "reload", (
|
|
794
|
-
var
|
|
795
|
-
let
|
|
796
|
-
|
|
793
|
+
le(this, "reload", (d = {}) => {
|
|
794
|
+
var h;
|
|
795
|
+
let m = Object.keys(this.response.props);
|
|
796
|
+
d.only && (m = br(m, d.only)), d.except && (m = Dn(m, d.except)), (h = this.response) != null && h.url && ot.get(this.response.url, {
|
|
797
797
|
headers: {
|
|
798
798
|
Accept: "text/html, application/xhtml+xml",
|
|
799
799
|
"X-Inertia": !0,
|
|
800
800
|
"X-Inertia-Partial-Component": this.response.component,
|
|
801
801
|
"X-Inertia-Version": this.response.version,
|
|
802
|
-
"X-Inertia-Partial-Data":
|
|
802
|
+
"X-Inertia-Partial-Data": m.join(","),
|
|
803
803
|
"X-InertiaUI-Modal": !0,
|
|
804
804
|
"X-InertiaUI-Modal-Use-Router": 0,
|
|
805
805
|
"X-InertiaUI-Modal-Base-Url": Ke
|
|
806
806
|
}
|
|
807
|
-
}).then((
|
|
808
|
-
this.updateProps(
|
|
807
|
+
}).then((E) => {
|
|
808
|
+
this.updateProps(E.data.props);
|
|
809
809
|
});
|
|
810
810
|
});
|
|
811
|
-
le(this, "updateProps", (
|
|
812
|
-
Object.assign(this.props,
|
|
811
|
+
le(this, "updateProps", (d) => {
|
|
812
|
+
Object.assign(this.props, d), a((m) => m);
|
|
813
813
|
});
|
|
814
|
-
this.id = s.generateId(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component =
|
|
814
|
+
this.id = s.generateId(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = d, this.props = m.props, this.response = m, this.config = h, this.onCloseCallback = E, this.afterLeaveCallback = T, this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
|
|
815
815
|
}
|
|
816
816
|
static generateId() {
|
|
817
817
|
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)}`;
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
const
|
|
821
|
-
const T = new s(
|
|
822
|
-
return T.index = t.length,
|
|
820
|
+
const u = (f, d = {}, m = null, h = null) => Er(f.component).then((E) => i(E, f, d, m, h)), i = (f, d, m, h, E) => {
|
|
821
|
+
const T = new s(f, d, m, h, E);
|
|
822
|
+
return T.index = t.length, a((F) => [...F, T]), T.show(), T;
|
|
823
823
|
};
|
|
824
|
-
function
|
|
825
|
-
if (!n[
|
|
826
|
-
throw new Error(`The local modal "${
|
|
827
|
-
const
|
|
828
|
-
return
|
|
824
|
+
function p(f, d, m, h) {
|
|
825
|
+
if (!n[f])
|
|
826
|
+
throw new Error(`The local modal "${f}" has not been registered.`);
|
|
827
|
+
const E = i(null, {}, d, m, h);
|
|
828
|
+
return E.name = f, n[f].callback(E), E;
|
|
829
829
|
}
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
).then((
|
|
841
|
-
const
|
|
842
|
-
return Object.keys(
|
|
843
|
-
const T = Be(
|
|
844
|
-
|
|
845
|
-
}),
|
|
846
|
-
}),
|
|
847
|
-
if (
|
|
848
|
-
ee(
|
|
830
|
+
const c = (f, d = {}) => w(
|
|
831
|
+
f,
|
|
832
|
+
d.method ?? "get",
|
|
833
|
+
d.data ?? {},
|
|
834
|
+
d.headers ?? {},
|
|
835
|
+
d.config ?? {},
|
|
836
|
+
d.onClose,
|
|
837
|
+
d.onAfterLeave,
|
|
838
|
+
d.queryStringArrayFormat ?? "brackets",
|
|
839
|
+
d.navigate ?? Wt("navigate")
|
|
840
|
+
).then((m) => {
|
|
841
|
+
const h = d.listeners ?? {};
|
|
842
|
+
return Object.keys(h).forEach((E) => {
|
|
843
|
+
const T = Be(E);
|
|
844
|
+
m.on(T, h[E]);
|
|
845
|
+
}), m;
|
|
846
|
+
}), w = (f, d, m = {}, h = {}, E = {}, T = null, F = null, X = "brackets", U = !1) => new Promise((ee, te) => {
|
|
847
|
+
if (f.startsWith("#")) {
|
|
848
|
+
ee(p(f.substring(1), E, T, F));
|
|
849
849
|
return;
|
|
850
850
|
}
|
|
851
|
-
const [H, q] = Mn(
|
|
851
|
+
const [H, q] = Mn(d, f || "", m, X);
|
|
852
852
|
let G = U && t.length === 0;
|
|
853
|
-
if (t.length === 0 && (Ke = typeof window < "u" ? window.location.href : ""),
|
|
854
|
-
...
|
|
853
|
+
if (t.length === 0 && (Ke = typeof window < "u" ? window.location.href : ""), h = {
|
|
854
|
+
...h,
|
|
855
855
|
Accept: "text/html, application/xhtml+xml",
|
|
856
856
|
"X-Requested-With": "XMLHttpRequest",
|
|
857
857
|
"X-Inertia": !0,
|
|
858
|
-
"X-Inertia-Version":
|
|
858
|
+
"X-Inertia-Version": xr,
|
|
859
859
|
"X-InertiaUI-Modal": !0,
|
|
860
860
|
"X-InertiaUI-Modal-Use-Router": G ? 1 : 0,
|
|
861
861
|
"X-InertiaUI-Modal-Base-Url": Ke
|
|
862
862
|
}, G)
|
|
863
863
|
return kt = null, Ye.visit(H, {
|
|
864
|
-
method:
|
|
864
|
+
method: d,
|
|
865
865
|
data: q,
|
|
866
|
-
headers:
|
|
866
|
+
headers: h,
|
|
867
867
|
preserveScroll: !0,
|
|
868
868
|
preserveState: !0,
|
|
869
869
|
onError: te,
|
|
870
870
|
onFinish: () => {
|
|
871
871
|
Un(() => kt).then((_) => {
|
|
872
|
-
const
|
|
872
|
+
const $ = _.onCloseCallback, I = _.afterLeaveCallback;
|
|
873
873
|
_.update(
|
|
874
|
-
|
|
874
|
+
E,
|
|
875
875
|
() => {
|
|
876
|
-
T == null || T(),
|
|
876
|
+
T == null || T(), $ == null || $();
|
|
877
877
|
},
|
|
878
878
|
() => {
|
|
879
|
-
F == null || F(),
|
|
879
|
+
F == null || F(), I == null || I();
|
|
880
880
|
}
|
|
881
881
|
), ee(_);
|
|
882
882
|
});
|
|
883
883
|
}
|
|
884
884
|
});
|
|
885
|
-
|
|
885
|
+
ot({
|
|
886
886
|
url: H,
|
|
887
|
-
method:
|
|
887
|
+
method: d,
|
|
888
888
|
data: q,
|
|
889
|
-
headers:
|
|
890
|
-
}).then((_) => ee(
|
|
889
|
+
headers: h
|
|
890
|
+
}).then((_) => ee(u(_.data, E, T, F))).catch((_) => {
|
|
891
891
|
te(_);
|
|
892
892
|
});
|
|
893
|
-
}),
|
|
893
|
+
}), g = {
|
|
894
894
|
stack: t,
|
|
895
895
|
localModals: n,
|
|
896
|
-
push:
|
|
897
|
-
pushFromResponseData:
|
|
896
|
+
push: i,
|
|
897
|
+
pushFromResponseData: u,
|
|
898
898
|
closeAll: () => {
|
|
899
|
-
jt.reverse().forEach((
|
|
899
|
+
jt.reverse().forEach((f) => f.close());
|
|
900
900
|
},
|
|
901
|
-
reset: () =>
|
|
902
|
-
visit:
|
|
903
|
-
visitModal:
|
|
904
|
-
registerLocalModal: (
|
|
905
|
-
l((
|
|
906
|
-
...
|
|
907
|
-
[
|
|
901
|
+
reset: () => a(() => []),
|
|
902
|
+
visit: w,
|
|
903
|
+
visitModal: c,
|
|
904
|
+
registerLocalModal: (f, d) => {
|
|
905
|
+
l((m) => ({
|
|
906
|
+
...m,
|
|
907
|
+
[f]: { name: f, callback: d }
|
|
908
908
|
}));
|
|
909
909
|
},
|
|
910
|
-
removeLocalModal: (
|
|
911
|
-
l((
|
|
912
|
-
const
|
|
913
|
-
return delete
|
|
910
|
+
removeLocalModal: (f) => {
|
|
911
|
+
l((d) => {
|
|
912
|
+
const m = { ...d };
|
|
913
|
+
return delete m[f], m;
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
};
|
|
917
|
-
return /* @__PURE__ */ R.jsx(dt.Provider, { value:
|
|
917
|
+
return /* @__PURE__ */ R.jsx(dt.Provider, { value: g, children: e });
|
|
918
918
|
}, ft = () => {
|
|
919
919
|
const e = Z(dt);
|
|
920
920
|
if (e === null)
|
|
921
921
|
throw new Error("useModalStack must be used within a ModalStackProvider");
|
|
922
922
|
return e;
|
|
923
923
|
}, cr = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Bn = (e) => {
|
|
924
|
-
e.initialPage && (
|
|
925
|
-
},
|
|
924
|
+
e.initialPage && (xr = e.initialPage.version), e.resolveComponent && (Er = e.resolveComponent);
|
|
925
|
+
}, Vo = (e, t) => {
|
|
926
926
|
Bn(t);
|
|
927
|
-
const r = ({ Component: n, props: l, key:
|
|
927
|
+
const r = ({ Component: n, props: l, key: a }) => {
|
|
928
928
|
const s = () => {
|
|
929
|
-
const
|
|
930
|
-
return typeof n.layout == "function" ? n.layout(
|
|
929
|
+
const u = lt(n, { key: a, ...l });
|
|
930
|
+
return typeof n.layout == "function" ? n.layout(u) : Array.isArray(n.layout) ? n.layout.concat(u).reverse().reduce((p, c) => lt(c, l, p)) : u;
|
|
931
931
|
};
|
|
932
932
|
return /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
|
|
933
933
|
s(),
|
|
@@ -936,39 +936,39 @@ const Hn = ({ children: e }) => {
|
|
|
936
936
|
};
|
|
937
937
|
return /* @__PURE__ */ R.jsx(Hn, { children: /* @__PURE__ */ R.jsx(e, { ...t, children: r }) });
|
|
938
938
|
}, Vn = ({ children: e }) => {
|
|
939
|
-
var
|
|
939
|
+
var u;
|
|
940
940
|
const t = Z(dt);
|
|
941
941
|
let r = !1, n = !1;
|
|
942
|
-
|
|
943
|
-
() => Ye.on("navigate", function(
|
|
944
|
-
const
|
|
945
|
-
if (!
|
|
942
|
+
L(() => Ye.on("start", () => r = !0), []), L(() => Ye.on("finish", () => r = !1), []), L(
|
|
943
|
+
() => Ye.on("navigate", function(i) {
|
|
944
|
+
const p = i.detail.page.props._inertiaui_modal;
|
|
945
|
+
if (!p) {
|
|
946
946
|
n && t.closeAll();
|
|
947
947
|
return;
|
|
948
948
|
}
|
|
949
|
-
n =
|
|
950
|
-
if (!
|
|
949
|
+
n = p, Ke = p.baseUrl, t.pushFromResponseData(p, {}, () => {
|
|
950
|
+
if (!p.baseUrl) {
|
|
951
951
|
console.error("No base url in modal response data so cannot navigate back");
|
|
952
952
|
return;
|
|
953
953
|
}
|
|
954
|
-
!r && window.location.href !==
|
|
954
|
+
!r && window.location.href !== p.baseUrl && Ye.visit(p.baseUrl, {
|
|
955
955
|
preserveScroll: !0,
|
|
956
956
|
preserveState: !0
|
|
957
957
|
});
|
|
958
|
-
}).then((
|
|
959
|
-
kt =
|
|
958
|
+
}).then((c) => {
|
|
959
|
+
kt = c;
|
|
960
960
|
});
|
|
961
961
|
}),
|
|
962
962
|
[]
|
|
963
963
|
);
|
|
964
|
-
const l = (
|
|
965
|
-
|
|
966
|
-
const
|
|
967
|
-
return
|
|
968
|
-
var
|
|
969
|
-
const
|
|
970
|
-
s.current =
|
|
971
|
-
}, [(
|
|
964
|
+
const l = (i) => (jt.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = Ke), i);
|
|
965
|
+
L(() => (ot.interceptors.request.use(l), () => ot.interceptors.request.eject(l)), []);
|
|
966
|
+
const a = _n(), s = j();
|
|
967
|
+
return L(() => {
|
|
968
|
+
var c, w;
|
|
969
|
+
const i = (c = a.props) == null ? void 0 : c._inertiaui_modal, p = s.current;
|
|
970
|
+
s.current = i, i && p && i.component === p.component && i.url === p.url && ((w = t.stack[0]) == null || w.updateProps(i.props ?? {}));
|
|
971
|
+
}, [(u = a.props) == null ? void 0 : u._inertiaui_modal]), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
|
|
972
972
|
e,
|
|
973
973
|
t.stack.length > 0 && /* @__PURE__ */ R.jsx(Or, { index: 0 })
|
|
974
974
|
] });
|
|
@@ -989,69 +989,114 @@ const Tr = () => {
|
|
|
989
989
|
}
|
|
990
990
|
) });
|
|
991
991
|
}, Pr = Dt(({ name: e, children: t, ...r }, n) => {
|
|
992
|
-
const l = Tr(), { stack:
|
|
993
|
-
var
|
|
994
|
-
return (
|
|
995
|
-
}, [l,
|
|
992
|
+
const l = Tr(), { stack: a, registerLocalModal: s, removeLocalModal: u } = ft(), [i, p] = V(null), c = B(() => e ? i : a[l], [e, i, l, a]), w = B(() => {
|
|
993
|
+
var f;
|
|
994
|
+
return (f = a.find((d) => d.shouldRender && d.index > (c == null ? void 0 : c.index))) == null ? void 0 : f.index;
|
|
995
|
+
}, [l, a]), x = B(() => (c == null ? void 0 : c.config.slideover) ?? r.slideover ?? Wt("type") === "slideover", [r.slideover]), y = B(
|
|
996
996
|
() => ({
|
|
997
|
-
slideover:
|
|
998
|
-
closeButton: r.closeButton ?? Me(
|
|
999
|
-
closeExplicitly: r.closeExplicitly ?? Me(
|
|
1000
|
-
maxWidth: r.maxWidth ?? Me(
|
|
1001
|
-
paddingClasses: r.paddingClasses ?? Me(
|
|
1002
|
-
panelClasses: r.panelClasses ?? Me(
|
|
1003
|
-
position: r.position ?? Me(
|
|
1004
|
-
...
|
|
997
|
+
slideover: x,
|
|
998
|
+
closeButton: r.closeButton ?? Me(x, "closeButton"),
|
|
999
|
+
closeExplicitly: r.closeExplicitly ?? Me(x, "closeExplicitly"),
|
|
1000
|
+
maxWidth: r.maxWidth ?? Me(x, "maxWidth"),
|
|
1001
|
+
paddingClasses: r.paddingClasses ?? Me(x, "paddingClasses"),
|
|
1002
|
+
panelClasses: r.panelClasses ?? Me(x, "panelClasses"),
|
|
1003
|
+
position: r.position ?? Me(x, "position"),
|
|
1004
|
+
...c == null ? void 0 : c.config
|
|
1005
1005
|
}),
|
|
1006
|
-
[r,
|
|
1006
|
+
[r, c == null ? void 0 : c.config]
|
|
1007
1007
|
);
|
|
1008
|
-
|
|
1008
|
+
L(() => {
|
|
1009
1009
|
if (e) {
|
|
1010
|
-
let
|
|
1011
|
-
return s(e, (
|
|
1012
|
-
|
|
1010
|
+
let f = null;
|
|
1011
|
+
return s(e, (d) => {
|
|
1012
|
+
f = d.registerEventListenersFromProps(r), p(d);
|
|
1013
1013
|
}), () => {
|
|
1014
|
-
|
|
1014
|
+
f == null || f(), f = null, u(e);
|
|
1015
1015
|
};
|
|
1016
1016
|
}
|
|
1017
|
-
return
|
|
1018
|
-
}, [e])
|
|
1017
|
+
return c.registerEventListenersFromProps(r);
|
|
1018
|
+
}, [e]);
|
|
1019
|
+
const g = j(c);
|
|
1020
|
+
return L(() => {
|
|
1021
|
+
g.current = c;
|
|
1022
|
+
}, [c]), yr(
|
|
1019
1023
|
n,
|
|
1020
1024
|
() => ({
|
|
1021
|
-
afterLeave: () =>
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1025
|
+
afterLeave: () => {
|
|
1026
|
+
var f;
|
|
1027
|
+
return (f = g.current) == null ? void 0 : f.afterLeave();
|
|
1028
|
+
},
|
|
1029
|
+
close: () => {
|
|
1030
|
+
var f;
|
|
1031
|
+
return (f = g.current) == null ? void 0 : f.close();
|
|
1032
|
+
},
|
|
1033
|
+
emit: (...f) => {
|
|
1034
|
+
var d;
|
|
1035
|
+
return (d = g.current) == null ? void 0 : d.emit(...f);
|
|
1036
|
+
},
|
|
1037
|
+
getChildModal: () => {
|
|
1038
|
+
var f;
|
|
1039
|
+
return (f = g.current) == null ? void 0 : f.getChildModal();
|
|
1040
|
+
},
|
|
1041
|
+
getParentModal: () => {
|
|
1042
|
+
var f;
|
|
1043
|
+
return (f = g.current) == null ? void 0 : f.getParentModal();
|
|
1044
|
+
},
|
|
1045
|
+
reload: (...f) => {
|
|
1046
|
+
var d;
|
|
1047
|
+
return (d = g.current) == null ? void 0 : d.reload(...f);
|
|
1048
|
+
},
|
|
1049
|
+
setOpen: () => {
|
|
1050
|
+
var f;
|
|
1051
|
+
return (f = g.current) == null ? void 0 : f.setOpen();
|
|
1052
|
+
},
|
|
1053
|
+
get id() {
|
|
1054
|
+
var f;
|
|
1055
|
+
return (f = g.current) == null ? void 0 : f.id;
|
|
1056
|
+
},
|
|
1057
|
+
get index() {
|
|
1058
|
+
var f;
|
|
1059
|
+
return (f = g.current) == null ? void 0 : f.index;
|
|
1060
|
+
},
|
|
1061
|
+
get isOpen() {
|
|
1062
|
+
var f;
|
|
1063
|
+
return (f = g.current) == null ? void 0 : f.isOpen;
|
|
1064
|
+
},
|
|
1065
|
+
get config() {
|
|
1066
|
+
var f;
|
|
1067
|
+
return (f = g.current) == null ? void 0 : f.config;
|
|
1068
|
+
},
|
|
1069
|
+
get modalContext() {
|
|
1070
|
+
return g.current;
|
|
1071
|
+
},
|
|
1072
|
+
get onTopOfStack() {
|
|
1073
|
+
var f;
|
|
1074
|
+
return (f = g.current) == null ? void 0 : f.onTopOfStack;
|
|
1075
|
+
},
|
|
1076
|
+
get shouldRender() {
|
|
1077
|
+
var f;
|
|
1078
|
+
return (f = g.current) == null ? void 0 : f.shouldRender;
|
|
1079
|
+
}
|
|
1035
1080
|
}),
|
|
1036
|
-
[
|
|
1037
|
-
), (
|
|
1081
|
+
[c]
|
|
1082
|
+
), (c == null ? void 0 : c.shouldRender) && /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
|
|
1038
1083
|
typeof t == "function" ? t({
|
|
1039
|
-
afterLeave:
|
|
1040
|
-
close:
|
|
1041
|
-
config:
|
|
1042
|
-
emit:
|
|
1043
|
-
getChildModal:
|
|
1044
|
-
getParentModal:
|
|
1045
|
-
id:
|
|
1046
|
-
index:
|
|
1047
|
-
isOpen:
|
|
1048
|
-
modalContext:
|
|
1049
|
-
onTopOfStack:
|
|
1050
|
-
reload:
|
|
1051
|
-
setOpen:
|
|
1052
|
-
shouldRender:
|
|
1084
|
+
afterLeave: c.afterLeave,
|
|
1085
|
+
close: c.close,
|
|
1086
|
+
config: y,
|
|
1087
|
+
emit: c.emit,
|
|
1088
|
+
getChildModal: c.getChildModal,
|
|
1089
|
+
getParentModal: c.getParentModal,
|
|
1090
|
+
id: c.id,
|
|
1091
|
+
index: c.index,
|
|
1092
|
+
isOpen: c.isOpen,
|
|
1093
|
+
modalContext: c,
|
|
1094
|
+
onTopOfStack: c.onTopOfStack,
|
|
1095
|
+
reload: c.reload,
|
|
1096
|
+
setOpen: c.setOpen,
|
|
1097
|
+
shouldRender: c.shouldRender
|
|
1053
1098
|
}) : t,
|
|
1054
|
-
|
|
1099
|
+
w && /* @__PURE__ */ R.jsx(Or, { index: w })
|
|
1055
1100
|
] });
|
|
1056
1101
|
});
|
|
1057
1102
|
Pr.displayName = "HeadlessModal";
|
|
@@ -1064,14 +1109,14 @@ function Rr(e) {
|
|
|
1064
1109
|
} else for (r in e) e[r] && (n && (n += " "), n += r);
|
|
1065
1110
|
return n;
|
|
1066
1111
|
}
|
|
1067
|
-
function
|
|
1112
|
+
function it() {
|
|
1068
1113
|
for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = Rr(e)) && (n && (n += " "), n += t);
|
|
1069
1114
|
return n;
|
|
1070
1115
|
}
|
|
1071
|
-
var Yn = Object.defineProperty, Xn = (e, t, r) => t in e ? Yn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r,
|
|
1116
|
+
var Yn = Object.defineProperty, Xn = (e, t, r) => t in e ? Yn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ct = (e, t, r) => (Xn(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
1072
1117
|
let qn = class {
|
|
1073
1118
|
constructor() {
|
|
1074
|
-
|
|
1119
|
+
Ct(this, "current", this.detect()), Ct(this, "handoffState", "pending"), Ct(this, "currentId", 0);
|
|
1075
1120
|
}
|
|
1076
1121
|
set(t) {
|
|
1077
1122
|
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
|
|
@@ -1107,8 +1152,8 @@ function mt(e) {
|
|
|
1107
1152
|
}));
|
|
1108
1153
|
}
|
|
1109
1154
|
function ye() {
|
|
1110
|
-
let e = [], t = { addEventListener(r, n, l,
|
|
1111
|
-
return r.addEventListener(n, l,
|
|
1155
|
+
let e = [], t = { addEventListener(r, n, l, a) {
|
|
1156
|
+
return r.addEventListener(n, l, a), t.add(() => r.removeEventListener(n, l, a));
|
|
1112
1157
|
}, requestAnimationFrame(...r) {
|
|
1113
1158
|
let n = requestAnimationFrame(...r);
|
|
1114
1159
|
return t.add(() => cancelAnimationFrame(n));
|
|
@@ -1125,9 +1170,9 @@ function ye() {
|
|
|
1125
1170
|
n.current = !1;
|
|
1126
1171
|
});
|
|
1127
1172
|
}, style(r, n, l) {
|
|
1128
|
-
let
|
|
1173
|
+
let a = r.style.getPropertyValue(n);
|
|
1129
1174
|
return Object.assign(r.style, { [n]: l }), this.add(() => {
|
|
1130
|
-
Object.assign(r.style, { [n]:
|
|
1175
|
+
Object.assign(r.style, { [n]: a });
|
|
1131
1176
|
});
|
|
1132
1177
|
}, group(r) {
|
|
1133
1178
|
let n = ye();
|
|
@@ -1144,10 +1189,10 @@ function ye() {
|
|
|
1144
1189
|
}
|
|
1145
1190
|
function Ht() {
|
|
1146
1191
|
let [e] = V(ye);
|
|
1147
|
-
return
|
|
1192
|
+
return L(() => () => e.dispose(), [e]), e;
|
|
1148
1193
|
}
|
|
1149
1194
|
let z = (e, t) => {
|
|
1150
|
-
Fe.isServer ?
|
|
1195
|
+
Fe.isServer ? L(e, t) : Sn(e, t);
|
|
1151
1196
|
};
|
|
1152
1197
|
function ke(e) {
|
|
1153
1198
|
let t = j(e);
|
|
@@ -1158,7 +1203,7 @@ function ke(e) {
|
|
|
1158
1203
|
let A = function(e) {
|
|
1159
1204
|
let t = ke(e);
|
|
1160
1205
|
return O.useCallback((...r) => t.current(...r), [t]);
|
|
1161
|
-
}, Kn =
|
|
1206
|
+
}, Kn = oe(void 0);
|
|
1162
1207
|
function zn() {
|
|
1163
1208
|
return Z(Kn);
|
|
1164
1209
|
}
|
|
@@ -1173,56 +1218,56 @@ function we(e, t, ...r) {
|
|
|
1173
1218
|
let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
|
|
1174
1219
|
throw Error.captureStackTrace && Error.captureStackTrace(n, we), n;
|
|
1175
1220
|
}
|
|
1176
|
-
var
|
|
1177
|
-
function
|
|
1221
|
+
var at = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(at || {}), ge = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(ge || {});
|
|
1222
|
+
function ie() {
|
|
1178
1223
|
let e = Jn();
|
|
1179
|
-
return
|
|
1180
|
-
}
|
|
1181
|
-
function Gn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible:
|
|
1182
|
-
|
|
1183
|
-
let
|
|
1184
|
-
if (
|
|
1185
|
-
let
|
|
1186
|
-
if (
|
|
1187
|
-
let { static:
|
|
1188
|
-
if (
|
|
1224
|
+
return ae((t) => Gn({ mergeRefs: e, ...t }), [e]);
|
|
1225
|
+
}
|
|
1226
|
+
function Gn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible: a = !0, name: s, mergeRefs: u }) {
|
|
1227
|
+
u = u ?? Zn;
|
|
1228
|
+
let i = Sr(t, e);
|
|
1229
|
+
if (a) return nt(i, r, n, s, u);
|
|
1230
|
+
let p = l ?? 0;
|
|
1231
|
+
if (p & 2) {
|
|
1232
|
+
let { static: c = !1, ...w } = i;
|
|
1233
|
+
if (c) return nt(w, r, n, s, u);
|
|
1189
1234
|
}
|
|
1190
|
-
if (
|
|
1191
|
-
let { unmount:
|
|
1192
|
-
return we(
|
|
1235
|
+
if (p & 1) {
|
|
1236
|
+
let { unmount: c = !0, ...w } = i;
|
|
1237
|
+
return we(c ? 0 : 1, { 0() {
|
|
1193
1238
|
return null;
|
|
1194
1239
|
}, 1() {
|
|
1195
|
-
return nt({ ...
|
|
1240
|
+
return nt({ ...w, hidden: !0, style: { display: "none" } }, r, n, s, u);
|
|
1196
1241
|
} });
|
|
1197
1242
|
}
|
|
1198
|
-
return nt(
|
|
1243
|
+
return nt(i, r, n, s, u);
|
|
1199
1244
|
}
|
|
1200
1245
|
function nt(e, t = {}, r, n, l) {
|
|
1201
|
-
let { as:
|
|
1202
|
-
"className" in
|
|
1203
|
-
let
|
|
1246
|
+
let { as: a = r, children: s, refName: u = "ref", ...i } = $t(e, ["unmount", "static"]), p = e.ref !== void 0 ? { [u]: e.ref } : {}, c = typeof s == "function" ? s(t) : s;
|
|
1247
|
+
"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);
|
|
1248
|
+
let w = {};
|
|
1204
1249
|
if (t) {
|
|
1205
|
-
let
|
|
1206
|
-
for (let [
|
|
1207
|
-
if (
|
|
1208
|
-
|
|
1209
|
-
for (let
|
|
1250
|
+
let x = !1, y = [];
|
|
1251
|
+
for (let [g, f] of Object.entries(t)) typeof f == "boolean" && (x = !0), f === !0 && y.push(g.replace(/([A-Z])/g, (d) => `-${d.toLowerCase()}`));
|
|
1252
|
+
if (x) {
|
|
1253
|
+
w["data-headlessui-state"] = y.join(" ");
|
|
1254
|
+
for (let g of y) w[`data-${g}`] = "";
|
|
1210
1255
|
}
|
|
1211
1256
|
}
|
|
1212
|
-
if (
|
|
1213
|
-
if (Object.keys(Se(
|
|
1214
|
-
`), "", "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((
|
|
1257
|
+
if (a === ue && (Object.keys(Se(i)).length > 0 || Object.keys(Se(w)).length > 0)) if (!Cn(c) || Array.isArray(c) && c.length > 1) {
|
|
1258
|
+
if (Object.keys(Se(i)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(Se(i)).concat(Object.keys(Se(w))).map((x) => ` - ${x}`).join(`
|
|
1259
|
+
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((x) => ` - ${x}`).join(`
|
|
1215
1260
|
`)].join(`
|
|
1216
1261
|
`));
|
|
1217
1262
|
} else {
|
|
1218
|
-
let
|
|
1219
|
-
for (let
|
|
1220
|
-
return
|
|
1263
|
+
let x = c.props, y = x == null ? void 0 : x.className, g = typeof y == "function" ? (...m) => _t(y(...m), i.className) : _t(y, i.className), f = g ? { className: g } : {}, d = Sr(c.props, Se($t(i, ["ref"])));
|
|
1264
|
+
for (let m in w) m in d && delete w[m];
|
|
1265
|
+
return $n(c, Object.assign({}, d, w, p, { ref: l(Qn(c), p.ref) }, f));
|
|
1221
1266
|
}
|
|
1222
|
-
return lt(
|
|
1267
|
+
return lt(a, Object.assign({}, $t(i, ["ref"]), a !== ue && p, a !== ue && w), c);
|
|
1223
1268
|
}
|
|
1224
1269
|
function Jn() {
|
|
1225
|
-
let e = j([]), t =
|
|
1270
|
+
let e = j([]), t = ae((r) => {
|
|
1226
1271
|
for (let n of e.current) n != null && (typeof n == "function" ? n(r) : n.current = r);
|
|
1227
1272
|
}, []);
|
|
1228
1273
|
return (...r) => {
|
|
@@ -1240,14 +1285,14 @@ function Sr(...e) {
|
|
|
1240
1285
|
let t = {}, r = {};
|
|
1241
1286
|
for (let n of e) for (let l in n) l.startsWith("on") && typeof n[l] == "function" ? (r[l] != null || (r[l] = []), r[l].push(n[l])) : t[l] = n[l];
|
|
1242
1287
|
if (t.disabled || t["aria-disabled"]) for (let n in r) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n) && (r[n] = [(l) => {
|
|
1243
|
-
var
|
|
1244
|
-
return (
|
|
1288
|
+
var a;
|
|
1289
|
+
return (a = l == null ? void 0 : l.preventDefault) == null ? void 0 : a.call(l);
|
|
1245
1290
|
}]);
|
|
1246
|
-
for (let n in r) Object.assign(t, { [n](l, ...
|
|
1291
|
+
for (let n in r) Object.assign(t, { [n](l, ...a) {
|
|
1247
1292
|
let s = r[n];
|
|
1248
|
-
for (let
|
|
1293
|
+
for (let u of s) {
|
|
1249
1294
|
if ((l instanceof Event || (l == null ? void 0 : l.nativeEvent) instanceof Event) && l.defaultPrevented) return;
|
|
1250
|
-
|
|
1295
|
+
u(l, ...a);
|
|
1251
1296
|
}
|
|
1252
1297
|
} });
|
|
1253
1298
|
return t;
|
|
@@ -1261,7 +1306,7 @@ function Se(e) {
|
|
|
1261
1306
|
for (let r in t) t[r] === void 0 && delete t[r];
|
|
1262
1307
|
return t;
|
|
1263
1308
|
}
|
|
1264
|
-
function
|
|
1309
|
+
function $t(e, t = []) {
|
|
1265
1310
|
let r = Object.assign({}, e);
|
|
1266
1311
|
for (let n of t) n in r && delete r[n];
|
|
1267
1312
|
return r;
|
|
@@ -1273,53 +1318,53 @@ let el = "span";
|
|
|
1273
1318
|
var st = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(st || {});
|
|
1274
1319
|
function tl(e, t) {
|
|
1275
1320
|
var r;
|
|
1276
|
-
let { features: n = 1, ...l } = e,
|
|
1277
|
-
return
|
|
1321
|
+
let { features: n = 1, ...l } = e, a = { ref: t, "aria-hidden": (n & 2) === 2 ? !0 : (r = l["aria-hidden"]) != null ? r : void 0, hidden: (n & 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", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } };
|
|
1322
|
+
return ie()({ ourProps: a, theirProps: l, slot: {}, defaultTag: el, name: "Hidden" });
|
|
1278
1323
|
}
|
|
1279
|
-
let Mt = Q(tl),
|
|
1324
|
+
let Mt = Q(tl), Cr = Symbol();
|
|
1280
1325
|
function rl(e, t = !0) {
|
|
1281
|
-
return Object.assign(e, { [
|
|
1326
|
+
return Object.assign(e, { [Cr]: t });
|
|
1282
1327
|
}
|
|
1283
1328
|
function ce(...e) {
|
|
1284
1329
|
let t = j(e);
|
|
1285
|
-
|
|
1330
|
+
L(() => {
|
|
1286
1331
|
t.current = e;
|
|
1287
1332
|
}, [e]);
|
|
1288
1333
|
let r = A((n) => {
|
|
1289
1334
|
for (let l of t.current) l != null && (typeof l == "function" ? l(n) : l.current = n);
|
|
1290
1335
|
});
|
|
1291
|
-
return e.every((n) => n == null || (n == null ? void 0 : n[
|
|
1336
|
+
return e.every((n) => n == null || (n == null ? void 0 : n[Cr])) ? void 0 : r;
|
|
1292
1337
|
}
|
|
1293
|
-
let Bt =
|
|
1338
|
+
let Bt = oe(null);
|
|
1294
1339
|
Bt.displayName = "DescriptionContext";
|
|
1295
|
-
function
|
|
1340
|
+
function $r() {
|
|
1296
1341
|
let e = Z(Bt);
|
|
1297
1342
|
if (e === null) {
|
|
1298
1343
|
let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
1299
|
-
throw Error.captureStackTrace && Error.captureStackTrace(t,
|
|
1344
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, $r), t;
|
|
1300
1345
|
}
|
|
1301
1346
|
return e;
|
|
1302
1347
|
}
|
|
1303
1348
|
function nl() {
|
|
1304
1349
|
let [e, t] = V([]);
|
|
1305
1350
|
return [e.length > 0 ? e.join(" ") : void 0, B(() => function(r) {
|
|
1306
|
-
let n = A((
|
|
1307
|
-
let
|
|
1308
|
-
return
|
|
1351
|
+
let n = A((a) => (t((s) => [...s, a]), () => t((s) => {
|
|
1352
|
+
let u = s.slice(), i = u.indexOf(a);
|
|
1353
|
+
return i !== -1 && u.splice(i, 1), u;
|
|
1309
1354
|
}))), l = B(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]);
|
|
1310
1355
|
return O.createElement(Bt.Provider, { value: l }, r.children);
|
|
1311
1356
|
}, [t])];
|
|
1312
1357
|
}
|
|
1313
1358
|
let ll = "p";
|
|
1314
|
-
function
|
|
1315
|
-
let r = Je(), n = zn(), { id: l = `headlessui-description-${r}`, ...
|
|
1359
|
+
function ol(e, t) {
|
|
1360
|
+
let r = Je(), n = zn(), { id: l = `headlessui-description-${r}`, ...a } = e, s = $r(), u = ce(t);
|
|
1316
1361
|
z(() => s.register(l), [l, s.register]);
|
|
1317
|
-
let
|
|
1318
|
-
return
|
|
1362
|
+
let i = n || !1, p = B(() => ({ ...s.slot, disabled: i }), [s.slot, i]), c = { ref: u, ...s.props, id: l };
|
|
1363
|
+
return ie()({ ourProps: c, theirProps: a, slot: p, defaultTag: ll, name: s.name || "Description" });
|
|
1319
1364
|
}
|
|
1320
|
-
let
|
|
1365
|
+
let il = Q(ol), al = Object.assign(il, {});
|
|
1321
1366
|
var Fr = ((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))(Fr || {});
|
|
1322
|
-
let sl =
|
|
1367
|
+
let sl = oe(() => {
|
|
1323
1368
|
});
|
|
1324
1369
|
function ul({ value: e, children: t }) {
|
|
1325
1370
|
return O.createElement(sl.Provider, { value: e }, t);
|
|
@@ -1339,9 +1384,9 @@ function kr(e, t) {
|
|
|
1339
1384
|
return r;
|
|
1340
1385
|
}, subscribe(l) {
|
|
1341
1386
|
return n.add(l), () => n.delete(l);
|
|
1342
|
-
}, dispatch(l, ...
|
|
1343
|
-
let s = t[l].call(r, ...
|
|
1344
|
-
s && (r = s, n.forEach((
|
|
1387
|
+
}, dispatch(l, ...a) {
|
|
1388
|
+
let s = t[l].call(r, ...a);
|
|
1389
|
+
s && (r = s, n.forEach((u) => u()));
|
|
1345
1390
|
} };
|
|
1346
1391
|
}
|
|
1347
1392
|
function jr(e) {
|
|
@@ -1360,8 +1405,8 @@ function Ae(e, t) {
|
|
|
1360
1405
|
if (z(() => {
|
|
1361
1406
|
if (e) return r.dispatch("ADD", n), () => r.dispatch("REMOVE", n);
|
|
1362
1407
|
}, [r, e]), !e) return !1;
|
|
1363
|
-
let
|
|
1364
|
-
return
|
|
1408
|
+
let a = l.indexOf(n), s = l.length;
|
|
1409
|
+
return a === -1 && (a = s, s += 1), a === s - 1;
|
|
1365
1410
|
}
|
|
1366
1411
|
let At = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map();
|
|
1367
1412
|
function dr(e) {
|
|
@@ -1379,19 +1424,19 @@ function fr(e) {
|
|
|
1379
1424
|
function fl(e, { allowed: t, disallowed: r } = {}) {
|
|
1380
1425
|
let n = Ae(e, "inert-others");
|
|
1381
1426
|
z(() => {
|
|
1382
|
-
var l,
|
|
1427
|
+
var l, a;
|
|
1383
1428
|
if (!n) return;
|
|
1384
1429
|
let s = ye();
|
|
1385
|
-
for (let
|
|
1386
|
-
let
|
|
1387
|
-
for (let
|
|
1388
|
-
if (!
|
|
1389
|
-
let
|
|
1390
|
-
if (!
|
|
1391
|
-
let
|
|
1392
|
-
for (;
|
|
1393
|
-
for (let
|
|
1394
|
-
|
|
1430
|
+
for (let i of (l = r == null ? void 0 : r()) != null ? l : []) i && s.add(dr(i));
|
|
1431
|
+
let u = (a = t == null ? void 0 : t()) != null ? a : [];
|
|
1432
|
+
for (let i of u) {
|
|
1433
|
+
if (!i) continue;
|
|
1434
|
+
let p = pt(i);
|
|
1435
|
+
if (!p) continue;
|
|
1436
|
+
let c = i.parentElement;
|
|
1437
|
+
for (; c && c !== p.body; ) {
|
|
1438
|
+
for (let w of c.children) u.some((x) => w.contains(x)) || s.add(dr(w));
|
|
1439
|
+
c = c.parentElement;
|
|
1395
1440
|
}
|
|
1396
1441
|
}
|
|
1397
1442
|
return s.dispose;
|
|
@@ -1399,23 +1444,23 @@ function fl(e, { allowed: t, disallowed: r } = {}) {
|
|
|
1399
1444
|
}
|
|
1400
1445
|
function pl(e, t, r) {
|
|
1401
1446
|
let n = ke((l) => {
|
|
1402
|
-
let
|
|
1403
|
-
|
|
1447
|
+
let a = l.getBoundingClientRect();
|
|
1448
|
+
a.x === 0 && a.y === 0 && a.width === 0 && a.height === 0 && r();
|
|
1404
1449
|
});
|
|
1405
|
-
|
|
1450
|
+
L(() => {
|
|
1406
1451
|
if (!e) return;
|
|
1407
1452
|
let l = t === null ? null : t instanceof HTMLElement ? t : t.current;
|
|
1408
1453
|
if (!l) return;
|
|
1409
|
-
let
|
|
1454
|
+
let a = ye();
|
|
1410
1455
|
if (typeof ResizeObserver < "u") {
|
|
1411
1456
|
let s = new ResizeObserver(() => n.current(l));
|
|
1412
|
-
s.observe(l),
|
|
1457
|
+
s.observe(l), a.add(() => s.disconnect());
|
|
1413
1458
|
}
|
|
1414
1459
|
if (typeof IntersectionObserver < "u") {
|
|
1415
1460
|
let s = new IntersectionObserver(() => n.current(l));
|
|
1416
|
-
s.observe(l),
|
|
1461
|
+
s.observe(l), a.add(() => s.disconnect());
|
|
1417
1462
|
}
|
|
1418
|
-
return () =>
|
|
1463
|
+
return () => a.dispose();
|
|
1419
1464
|
}, [t, n, e]);
|
|
1420
1465
|
}
|
|
1421
1466
|
let ut = ["[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(","), ml = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
@@ -1450,43 +1495,43 @@ function me(e) {
|
|
|
1450
1495
|
e == null || e.focus({ preventScroll: !0 });
|
|
1451
1496
|
}
|
|
1452
1497
|
let bl = ["textarea", "input"].join(",");
|
|
1453
|
-
function
|
|
1498
|
+
function xl(e) {
|
|
1454
1499
|
var t, r;
|
|
1455
1500
|
return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, bl)) != null ? r : !1;
|
|
1456
1501
|
}
|
|
1457
|
-
function
|
|
1502
|
+
function El(e, t = (r) => r) {
|
|
1458
1503
|
return e.slice().sort((r, n) => {
|
|
1459
|
-
let l = t(r),
|
|
1460
|
-
if (l === null ||
|
|
1461
|
-
let s = l.compareDocumentPosition(
|
|
1504
|
+
let l = t(r), a = t(n);
|
|
1505
|
+
if (l === null || a === null) return 0;
|
|
1506
|
+
let s = l.compareDocumentPosition(a);
|
|
1462
1507
|
return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1463
1508
|
});
|
|
1464
1509
|
}
|
|
1465
1510
|
function Ge(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] } = {}) {
|
|
1466
|
-
let
|
|
1467
|
-
l.length > 0 && s.length > 1 && (s = s.filter((
|
|
1468
|
-
let
|
|
1511
|
+
let a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, s = Array.isArray(e) ? r ? El(e) : e : t & 64 ? gl(e) : hl(e);
|
|
1512
|
+
l.length > 0 && s.length > 1 && (s = s.filter((y) => !l.some((g) => g != null && "current" in g ? (g == null ? void 0 : g.current) === y : g === y))), n = n ?? a.activeElement;
|
|
1513
|
+
let u = (() => {
|
|
1469
1514
|
if (t & 5) return 1;
|
|
1470
1515
|
if (t & 10) return -1;
|
|
1471
1516
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1472
|
-
})(),
|
|
1517
|
+
})(), i = (() => {
|
|
1473
1518
|
if (t & 1) return 0;
|
|
1474
1519
|
if (t & 2) return Math.max(0, s.indexOf(n)) - 1;
|
|
1475
1520
|
if (t & 4) return Math.max(0, s.indexOf(n)) + 1;
|
|
1476
1521
|
if (t & 8) return s.length - 1;
|
|
1477
1522
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1478
|
-
})(),
|
|
1523
|
+
})(), p = t & 32 ? { preventScroll: !0 } : {}, c = 0, w = s.length, x;
|
|
1479
1524
|
do {
|
|
1480
|
-
if (
|
|
1481
|
-
let
|
|
1482
|
-
if (t & 16)
|
|
1525
|
+
if (c >= w || c + w <= 0) return 0;
|
|
1526
|
+
let y = i + c;
|
|
1527
|
+
if (t & 16) y = (y + w) % w;
|
|
1483
1528
|
else {
|
|
1484
|
-
if (
|
|
1485
|
-
if (
|
|
1529
|
+
if (y < 0) return 3;
|
|
1530
|
+
if (y >= w) return 1;
|
|
1486
1531
|
}
|
|
1487
|
-
|
|
1488
|
-
} while (
|
|
1489
|
-
return t & 6 &&
|
|
1532
|
+
x = s[y], x == null || x.focus(p), c += u;
|
|
1533
|
+
} while (x !== a.activeElement);
|
|
1534
|
+
return t & 6 && xl(x) && x.select(), 2;
|
|
1490
1535
|
}
|
|
1491
1536
|
function Mr() {
|
|
1492
1537
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
@@ -1499,64 +1544,64 @@ function Ol() {
|
|
|
1499
1544
|
}
|
|
1500
1545
|
function Ve(e, t, r, n) {
|
|
1501
1546
|
let l = ke(r);
|
|
1502
|
-
|
|
1547
|
+
L(() => {
|
|
1503
1548
|
if (!e) return;
|
|
1504
|
-
function
|
|
1549
|
+
function a(s) {
|
|
1505
1550
|
l.current(s);
|
|
1506
1551
|
}
|
|
1507
|
-
return document.addEventListener(t,
|
|
1552
|
+
return document.addEventListener(t, a, n), () => document.removeEventListener(t, a, n);
|
|
1508
1553
|
}, [e, t, n]);
|
|
1509
1554
|
}
|
|
1510
1555
|
function Ar(e, t, r, n) {
|
|
1511
1556
|
let l = ke(r);
|
|
1512
|
-
|
|
1557
|
+
L(() => {
|
|
1513
1558
|
if (!e) return;
|
|
1514
|
-
function
|
|
1559
|
+
function a(s) {
|
|
1515
1560
|
l.current(s);
|
|
1516
1561
|
}
|
|
1517
|
-
return window.addEventListener(t,
|
|
1562
|
+
return window.addEventListener(t, a, n), () => window.removeEventListener(t, a, n);
|
|
1518
1563
|
}, [e, t, n]);
|
|
1519
1564
|
}
|
|
1520
1565
|
const pr = 30;
|
|
1521
1566
|
function Pl(e, t, r) {
|
|
1522
|
-
let n = Ae(e, "outside-click"), l = ke(r),
|
|
1523
|
-
if (
|
|
1524
|
-
let
|
|
1525
|
-
if (
|
|
1526
|
-
let
|
|
1527
|
-
return typeof
|
|
1567
|
+
let n = Ae(e, "outside-click"), l = ke(r), a = ae(function(i, p) {
|
|
1568
|
+
if (i.defaultPrevented) return;
|
|
1569
|
+
let c = p(i);
|
|
1570
|
+
if (c === null || !c.getRootNode().contains(c) || !c.isConnected) return;
|
|
1571
|
+
let w = function x(y) {
|
|
1572
|
+
return typeof y == "function" ? x(y()) : Array.isArray(y) || y instanceof Set ? y : [y];
|
|
1528
1573
|
}(t);
|
|
1529
|
-
for (let
|
|
1530
|
-
return !wl(
|
|
1574
|
+
for (let x of w) if (x !== null && (x.contains(c) || i.composed && i.composedPath().includes(x))) return;
|
|
1575
|
+
return !wl(c, _r.Loose) && c.tabIndex !== -1 && i.preventDefault(), l.current(i, c);
|
|
1531
1576
|
}, [l, t]), s = j(null);
|
|
1532
|
-
Ve(n, "pointerdown", (
|
|
1533
|
-
var
|
|
1534
|
-
s.current = ((
|
|
1535
|
-
}, !0), Ve(n, "mousedown", (
|
|
1536
|
-
var
|
|
1537
|
-
s.current = ((
|
|
1538
|
-
}, !0), Ve(n, "click", (
|
|
1539
|
-
Ol() || s.current && (
|
|
1577
|
+
Ve(n, "pointerdown", (i) => {
|
|
1578
|
+
var p, c;
|
|
1579
|
+
s.current = ((c = (p = i.composedPath) == null ? void 0 : p.call(i)) == null ? void 0 : c[0]) || i.target;
|
|
1580
|
+
}, !0), Ve(n, "mousedown", (i) => {
|
|
1581
|
+
var p, c;
|
|
1582
|
+
s.current = ((c = (p = i.composedPath) == null ? void 0 : p.call(i)) == null ? void 0 : c[0]) || i.target;
|
|
1583
|
+
}, !0), Ve(n, "click", (i) => {
|
|
1584
|
+
Ol() || s.current && (a(i, () => s.current), s.current = null);
|
|
1540
1585
|
}, !0);
|
|
1541
|
-
let
|
|
1542
|
-
Ve(n, "touchstart", (
|
|
1543
|
-
|
|
1544
|
-
}, !0), Ve(n, "touchend", (
|
|
1545
|
-
let
|
|
1546
|
-
if (!(Math.abs(
|
|
1547
|
-
}, !0), Ar(n, "blur", (
|
|
1586
|
+
let u = j({ x: 0, y: 0 });
|
|
1587
|
+
Ve(n, "touchstart", (i) => {
|
|
1588
|
+
u.current.x = i.touches[0].clientX, u.current.y = i.touches[0].clientY;
|
|
1589
|
+
}, !0), Ve(n, "touchend", (i) => {
|
|
1590
|
+
let p = { x: i.changedTouches[0].clientX, y: i.changedTouches[0].clientY };
|
|
1591
|
+
if (!(Math.abs(p.x - u.current.x) >= pr || Math.abs(p.y - u.current.y) >= pr)) return a(i, () => i.target instanceof HTMLElement ? i.target : null);
|
|
1592
|
+
}, !0), Ar(n, "blur", (i) => a(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
1548
1593
|
}
|
|
1549
1594
|
function Ze(...e) {
|
|
1550
1595
|
return B(() => pt(...e), [...e]);
|
|
1551
1596
|
}
|
|
1552
1597
|
function Lr(e, t, r, n) {
|
|
1553
1598
|
let l = ke(r);
|
|
1554
|
-
|
|
1599
|
+
L(() => {
|
|
1555
1600
|
e = e ?? window;
|
|
1556
|
-
function
|
|
1601
|
+
function a(s) {
|
|
1557
1602
|
l.current(s);
|
|
1558
1603
|
}
|
|
1559
|
-
return e.addEventListener(t,
|
|
1604
|
+
return e.addEventListener(t, a, n), () => e.removeEventListener(t, a, n);
|
|
1560
1605
|
}, [e, t, n]);
|
|
1561
1606
|
}
|
|
1562
1607
|
function Rl() {
|
|
@@ -1566,64 +1611,64 @@ function Rl() {
|
|
|
1566
1611
|
let n = t.documentElement, l = (r = t.defaultView) != null ? r : window;
|
|
1567
1612
|
e = Math.max(0, l.innerWidth - n.clientWidth);
|
|
1568
1613
|
}, after({ doc: t, d: r }) {
|
|
1569
|
-
let n = t.documentElement, l = Math.max(0, n.clientWidth - n.offsetWidth),
|
|
1570
|
-
r.style(n, "paddingRight", `${
|
|
1614
|
+
let n = t.documentElement, l = Math.max(0, n.clientWidth - n.offsetWidth), a = Math.max(0, e - l);
|
|
1615
|
+
r.style(n, "paddingRight", `${a}px`);
|
|
1571
1616
|
} };
|
|
1572
1617
|
}
|
|
1573
1618
|
function Sl() {
|
|
1574
1619
|
return Mr() ? { before({ doc: e, d: t, meta: r }) {
|
|
1575
1620
|
function n(l) {
|
|
1576
|
-
return r.containers.flatMap((
|
|
1621
|
+
return r.containers.flatMap((a) => a()).some((a) => a.contains(l));
|
|
1577
1622
|
}
|
|
1578
1623
|
t.microTask(() => {
|
|
1579
1624
|
var l;
|
|
1580
1625
|
if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
|
|
1581
|
-
let
|
|
1582
|
-
|
|
1626
|
+
let u = ye();
|
|
1627
|
+
u.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => u.dispose()));
|
|
1583
1628
|
}
|
|
1584
|
-
let
|
|
1585
|
-
t.addEventListener(e, "click", (
|
|
1586
|
-
if (
|
|
1587
|
-
let
|
|
1588
|
-
if (!
|
|
1589
|
-
let { hash:
|
|
1590
|
-
|
|
1629
|
+
let a = (l = window.scrollY) != null ? l : window.pageYOffset, s = null;
|
|
1630
|
+
t.addEventListener(e, "click", (u) => {
|
|
1631
|
+
if (u.target instanceof HTMLElement) try {
|
|
1632
|
+
let i = u.target.closest("a");
|
|
1633
|
+
if (!i) return;
|
|
1634
|
+
let { hash: p } = new URL(i.href), c = e.querySelector(p);
|
|
1635
|
+
c && !n(c) && (s = c);
|
|
1591
1636
|
} catch {
|
|
1592
1637
|
}
|
|
1593
|
-
}, !0), t.addEventListener(e, "touchstart", (
|
|
1594
|
-
if (
|
|
1595
|
-
let
|
|
1596
|
-
for (;
|
|
1597
|
-
t.style(
|
|
1598
|
-
} else t.style(
|
|
1599
|
-
}), t.addEventListener(e, "touchmove", (
|
|
1600
|
-
if (
|
|
1601
|
-
if (
|
|
1602
|
-
if (n(
|
|
1603
|
-
let
|
|
1604
|
-
for (;
|
|
1605
|
-
|
|
1606
|
-
} else
|
|
1638
|
+
}, !0), t.addEventListener(e, "touchstart", (u) => {
|
|
1639
|
+
if (u.target instanceof HTMLElement) if (n(u.target)) {
|
|
1640
|
+
let i = u.target;
|
|
1641
|
+
for (; i.parentElement && n(i.parentElement); ) i = i.parentElement;
|
|
1642
|
+
t.style(i, "overscrollBehavior", "contain");
|
|
1643
|
+
} else t.style(u.target, "touchAction", "none");
|
|
1644
|
+
}), t.addEventListener(e, "touchmove", (u) => {
|
|
1645
|
+
if (u.target instanceof HTMLElement) {
|
|
1646
|
+
if (u.target.tagName === "INPUT") return;
|
|
1647
|
+
if (n(u.target)) {
|
|
1648
|
+
let i = u.target;
|
|
1649
|
+
for (; i.parentElement && i.dataset.headlessuiPortal !== "" && !(i.scrollHeight > i.clientHeight || i.scrollWidth > i.clientWidth); ) i = i.parentElement;
|
|
1650
|
+
i.dataset.headlessuiPortal === "" && u.preventDefault();
|
|
1651
|
+
} else u.preventDefault();
|
|
1607
1652
|
}
|
|
1608
1653
|
}, { passive: !1 }), t.add(() => {
|
|
1609
|
-
var
|
|
1610
|
-
let
|
|
1611
|
-
|
|
1654
|
+
var u;
|
|
1655
|
+
let i = (u = window.scrollY) != null ? u : window.pageYOffset;
|
|
1656
|
+
a !== i && window.scrollTo(0, a), s && s.isConnected && (s.scrollIntoView({ block: "nearest" }), s = null);
|
|
1612
1657
|
});
|
|
1613
1658
|
});
|
|
1614
1659
|
} } : {};
|
|
1615
1660
|
}
|
|
1616
|
-
function
|
|
1661
|
+
function Cl() {
|
|
1617
1662
|
return { before({ doc: e, d: t }) {
|
|
1618
1663
|
t.style(e.documentElement, "overflow", "hidden");
|
|
1619
1664
|
} };
|
|
1620
1665
|
}
|
|
1621
|
-
function
|
|
1666
|
+
function $l(e) {
|
|
1622
1667
|
let t = {};
|
|
1623
1668
|
for (let r of e) Object.assign(t, r(t));
|
|
1624
1669
|
return t;
|
|
1625
1670
|
}
|
|
1626
|
-
let
|
|
1671
|
+
let $e = kr(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
1627
1672
|
var r;
|
|
1628
1673
|
let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: ye(), meta: /* @__PURE__ */ new Set() };
|
|
1629
1674
|
return n.count++, n.meta.add(t), this.set(e, n), this;
|
|
@@ -1631,37 +1676,37 @@ let Ce = kr(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
|
1631
1676
|
let r = this.get(e);
|
|
1632
1677
|
return r && (r.count--, r.meta.delete(t)), this;
|
|
1633
1678
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: r }) {
|
|
1634
|
-
let n = { doc: e, d: t, meta:
|
|
1635
|
-
l.forEach(({ before:
|
|
1679
|
+
let n = { doc: e, d: t, meta: $l(r) }, l = [Sl(), Rl(), Cl()];
|
|
1680
|
+
l.forEach(({ before: a }) => a == null ? void 0 : a(n)), l.forEach(({ after: a }) => a == null ? void 0 : a(n));
|
|
1636
1681
|
}, SCROLL_ALLOW({ d: e }) {
|
|
1637
1682
|
e.dispose();
|
|
1638
1683
|
}, TEARDOWN({ doc: e }) {
|
|
1639
1684
|
this.delete(e);
|
|
1640
1685
|
} });
|
|
1641
|
-
|
|
1642
|
-
let e =
|
|
1686
|
+
$e.subscribe(() => {
|
|
1687
|
+
let e = $e.getSnapshot(), t = /* @__PURE__ */ new Map();
|
|
1643
1688
|
for (let [r] of e) t.set(r, r.documentElement.style.overflow);
|
|
1644
1689
|
for (let r of e.values()) {
|
|
1645
1690
|
let n = t.get(r.doc) === "hidden", l = r.count !== 0;
|
|
1646
|
-
(l && !n || !l && n) &&
|
|
1691
|
+
(l && !n || !l && n) && $e.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && $e.dispatch("TEARDOWN", r);
|
|
1647
1692
|
}
|
|
1648
1693
|
});
|
|
1649
1694
|
function Fl(e, t, r = () => ({ containers: [] })) {
|
|
1650
|
-
let n = jr(
|
|
1695
|
+
let n = jr($e), l = t ? n.get(t) : void 0, a = l ? l.count > 0 : !1;
|
|
1651
1696
|
return z(() => {
|
|
1652
|
-
if (!(!t || !e)) return
|
|
1653
|
-
}, [e, t]),
|
|
1697
|
+
if (!(!t || !e)) return $e.dispatch("PUSH", t, r), () => $e.dispatch("POP", t, r);
|
|
1698
|
+
}, [e, t]), a;
|
|
1654
1699
|
}
|
|
1655
1700
|
function kl(e, t, r = () => [document.body]) {
|
|
1656
1701
|
let n = Ae(e, "scroll-lock");
|
|
1657
1702
|
Fl(n, t, (l) => {
|
|
1658
|
-
var
|
|
1659
|
-
return { containers: [...(
|
|
1703
|
+
var a;
|
|
1704
|
+
return { containers: [...(a = l.containers) != null ? a : [], r] };
|
|
1660
1705
|
});
|
|
1661
1706
|
}
|
|
1662
1707
|
function jl(e = 0) {
|
|
1663
|
-
let [t, r] = V(e), n =
|
|
1664
|
-
return { flags: t, setFlag: n, addFlag: l, hasFlag:
|
|
1708
|
+
let [t, r] = V(e), n = ae((i) => r(i), [t]), l = ae((i) => r((p) => p | i), [t]), a = ae((i) => (t & i) === i, [t]), s = ae((i) => r((p) => p & ~i), [r]), u = ae((i) => r((p) => p ^ i), [r]);
|
|
1709
|
+
return { flags: t, setFlag: n, addFlag: l, hasFlag: a, removeFlag: s, toggleFlag: u };
|
|
1665
1710
|
}
|
|
1666
1711
|
var mr, vr;
|
|
1667
1712
|
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((mr = process == null ? void 0 : process.env) == null ? void 0 : mr.NODE_ENV) === "test" && typeof ((vr = Element == null ? void 0 : Element.prototype) == null ? void 0 : vr.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
|
|
@@ -1675,44 +1720,44 @@ function Ml(e) {
|
|
|
1675
1720
|
return t;
|
|
1676
1721
|
}
|
|
1677
1722
|
function Al(e, t, r, n) {
|
|
1678
|
-
let [l,
|
|
1723
|
+
let [l, a] = V(r), { hasFlag: s, addFlag: u, removeFlag: i } = jl(e && l ? 3 : 0), p = j(!1), c = j(!1), w = Ht();
|
|
1679
1724
|
return z(() => {
|
|
1680
|
-
var
|
|
1725
|
+
var x;
|
|
1681
1726
|
if (e) {
|
|
1682
|
-
if (r &&
|
|
1683
|
-
r &&
|
|
1727
|
+
if (r && a(!0), !t) {
|
|
1728
|
+
r && u(3);
|
|
1684
1729
|
return;
|
|
1685
1730
|
}
|
|
1686
|
-
return (
|
|
1687
|
-
|
|
1731
|
+
return (x = n == null ? void 0 : n.start) == null || x.call(n, r), Ll(t, { inFlight: p, prepare() {
|
|
1732
|
+
c.current ? c.current = !1 : c.current = p.current, p.current = !0, !c.current && (r ? (u(3), i(4)) : (u(4), i(2)));
|
|
1688
1733
|
}, run() {
|
|
1689
|
-
|
|
1734
|
+
c.current ? r ? (i(3), u(4)) : (i(4), u(3)) : r ? i(1) : u(1);
|
|
1690
1735
|
}, done() {
|
|
1691
|
-
var
|
|
1692
|
-
|
|
1736
|
+
var y;
|
|
1737
|
+
c.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (p.current = !1, i(7), r || a(!1), (y = n == null ? void 0 : n.end) == null || y.call(n, r));
|
|
1693
1738
|
} });
|
|
1694
1739
|
}
|
|
1695
|
-
}, [e, r, t,
|
|
1740
|
+
}, [e, r, t, w]), e ? [l, { closed: s(1), enter: s(2), leave: s(4), transition: s(2) || s(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
1696
1741
|
}
|
|
1697
1742
|
function Ll(e, { prepare: t, run: r, done: n, inFlight: l }) {
|
|
1698
|
-
let
|
|
1699
|
-
return Nl(e, { prepare: t, inFlight: l }),
|
|
1700
|
-
r(),
|
|
1701
|
-
|
|
1743
|
+
let a = ye();
|
|
1744
|
+
return Nl(e, { prepare: t, inFlight: l }), a.nextFrame(() => {
|
|
1745
|
+
r(), a.requestAnimationFrame(() => {
|
|
1746
|
+
a.add(Il(e, n));
|
|
1702
1747
|
});
|
|
1703
|
-
}),
|
|
1748
|
+
}), a.dispose;
|
|
1704
1749
|
}
|
|
1705
1750
|
function Il(e, t) {
|
|
1706
1751
|
var r, n;
|
|
1707
1752
|
let l = ye();
|
|
1708
1753
|
if (!e) return l.dispose;
|
|
1709
|
-
let
|
|
1754
|
+
let a = !1;
|
|
1710
1755
|
l.add(() => {
|
|
1711
|
-
|
|
1756
|
+
a = !0;
|
|
1712
1757
|
});
|
|
1713
|
-
let s = (n = (r = e.getAnimations) == null ? void 0 : r.call(e).filter((
|
|
1714
|
-
return s.length === 0 ? (t(), l.dispose) : (Promise.allSettled(s.map((
|
|
1715
|
-
|
|
1758
|
+
let s = (n = (r = e.getAnimations) == null ? void 0 : r.call(e).filter((u) => u instanceof CSSTransition)) != null ? n : [];
|
|
1759
|
+
return s.length === 0 ? (t(), l.dispose) : (Promise.allSettled(s.map((u) => u.finished)).then(() => {
|
|
1760
|
+
a || t();
|
|
1716
1761
|
}), l.dispose);
|
|
1717
1762
|
}
|
|
1718
1763
|
function Nl(e, { inFlight: t, prepare: r }) {
|
|
@@ -1725,15 +1770,15 @@ function Nl(e, { inFlight: t, prepare: r }) {
|
|
|
1725
1770
|
}
|
|
1726
1771
|
function Vt(e, t) {
|
|
1727
1772
|
let r = j([]), n = A(e);
|
|
1728
|
-
|
|
1773
|
+
L(() => {
|
|
1729
1774
|
let l = [...r.current];
|
|
1730
|
-
for (let [
|
|
1731
|
-
let
|
|
1732
|
-
return r.current = t,
|
|
1775
|
+
for (let [a, s] of t.entries()) if (r.current[a] !== s) {
|
|
1776
|
+
let u = n(t, l);
|
|
1777
|
+
return r.current = t, u;
|
|
1733
1778
|
}
|
|
1734
1779
|
}, [n, ...t]);
|
|
1735
1780
|
}
|
|
1736
|
-
let vt =
|
|
1781
|
+
let vt = oe(null);
|
|
1737
1782
|
vt.displayName = "OpenClosedContext";
|
|
1738
1783
|
var se = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(se || {});
|
|
1739
1784
|
function ht() {
|
|
@@ -1762,7 +1807,7 @@ Ul(() => {
|
|
|
1762
1807
|
});
|
|
1763
1808
|
function Ir(e) {
|
|
1764
1809
|
let t = A(e), r = j(!1);
|
|
1765
|
-
|
|
1810
|
+
L(() => (r.current = !1, () => {
|
|
1766
1811
|
r.current = !0, mt(() => {
|
|
1767
1812
|
r.current && t();
|
|
1768
1813
|
});
|
|
@@ -1779,7 +1824,7 @@ function Qe() {
|
|
|
1779
1824
|
t !== !0 && r(!0);
|
|
1780
1825
|
}, [t]), qe.useEffect(() => Fe.handoff(), []), e ? !1 : t;
|
|
1781
1826
|
}
|
|
1782
|
-
let Nr =
|
|
1827
|
+
let Nr = oe(!1);
|
|
1783
1828
|
function Bl() {
|
|
1784
1829
|
return Z(Nr);
|
|
1785
1830
|
}
|
|
@@ -1787,57 +1832,57 @@ function hr(e) {
|
|
|
1787
1832
|
return O.createElement(Nr.Provider, { value: e.force }, e.children);
|
|
1788
1833
|
}
|
|
1789
1834
|
function Vl(e) {
|
|
1790
|
-
let t = Bl(), r = Z(Wr), n = Ze(e), [l,
|
|
1835
|
+
let t = Bl(), r = Z(Wr), n = Ze(e), [l, a] = V(() => {
|
|
1791
1836
|
var s;
|
|
1792
1837
|
if (!t && r !== null) return (s = r.current) != null ? s : null;
|
|
1793
1838
|
if (Fe.isServer) return null;
|
|
1794
|
-
let
|
|
1795
|
-
if (
|
|
1839
|
+
let u = n == null ? void 0 : n.getElementById("headlessui-portal-root");
|
|
1840
|
+
if (u) return u;
|
|
1796
1841
|
if (n === null) return null;
|
|
1797
|
-
let
|
|
1798
|
-
return
|
|
1842
|
+
let i = n.createElement("div");
|
|
1843
|
+
return i.setAttribute("id", "headlessui-portal-root"), n.body.appendChild(i);
|
|
1799
1844
|
});
|
|
1800
|
-
return
|
|
1845
|
+
return L(() => {
|
|
1801
1846
|
l !== null && (n != null && n.body.contains(l) || n == null || n.body.appendChild(l));
|
|
1802
|
-
}, [l, n]),
|
|
1803
|
-
t || r !== null &&
|
|
1804
|
-
}, [r,
|
|
1847
|
+
}, [l, n]), L(() => {
|
|
1848
|
+
t || r !== null && a(r.current);
|
|
1849
|
+
}, [r, a, t]), l;
|
|
1805
1850
|
}
|
|
1806
1851
|
let Dr = ue, Yl = Q(function(e, t) {
|
|
1807
|
-
let r = e, n = j(null), l = ce(rl((
|
|
1808
|
-
n.current =
|
|
1809
|
-
}), t),
|
|
1810
|
-
var
|
|
1811
|
-
return Fe.isServer ? null : (
|
|
1812
|
-
}),
|
|
1852
|
+
let r = e, n = j(null), l = ce(rl((w) => {
|
|
1853
|
+
n.current = w;
|
|
1854
|
+
}), t), a = Ze(n), s = Vl(n), [u] = V(() => {
|
|
1855
|
+
var w;
|
|
1856
|
+
return Fe.isServer ? null : (w = a == null ? void 0 : a.createElement("div")) != null ? w : null;
|
|
1857
|
+
}), i = Z(It), p = Qe();
|
|
1813
1858
|
z(() => {
|
|
1814
|
-
!s || !
|
|
1815
|
-
}, [s,
|
|
1816
|
-
if (
|
|
1817
|
-
}, [
|
|
1818
|
-
var
|
|
1819
|
-
!s || !
|
|
1859
|
+
!s || !u || s.contains(u) || (u.setAttribute("data-headlessui-portal", ""), s.appendChild(u));
|
|
1860
|
+
}, [s, u]), z(() => {
|
|
1861
|
+
if (u && i) return i.register(u);
|
|
1862
|
+
}, [i, u]), Ir(() => {
|
|
1863
|
+
var w;
|
|
1864
|
+
!s || !u || (u instanceof Node && s.contains(u) && s.removeChild(u), s.childNodes.length <= 0 && ((w = s.parentElement) == null || w.removeChild(s)));
|
|
1820
1865
|
});
|
|
1821
|
-
let
|
|
1822
|
-
return
|
|
1866
|
+
let c = ie();
|
|
1867
|
+
return p ? !s || !u ? null : An(c({ ourProps: { ref: l }, theirProps: r, slot: {}, defaultTag: Dr, name: "Portal" }), u) : null;
|
|
1823
1868
|
});
|
|
1824
1869
|
function Xl(e, t) {
|
|
1825
|
-
let r = ce(t), { enabled: n = !0, ...l } = e,
|
|
1826
|
-
return n ? O.createElement(Yl, { ...l, ref: r }) :
|
|
1870
|
+
let r = ce(t), { enabled: n = !0, ...l } = e, a = ie();
|
|
1871
|
+
return n ? O.createElement(Yl, { ...l, ref: r }) : a({ ourProps: { ref: r }, theirProps: l, slot: {}, defaultTag: Dr, name: "Portal" });
|
|
1827
1872
|
}
|
|
1828
|
-
let ql = ue, Wr =
|
|
1873
|
+
let ql = ue, Wr = oe(null);
|
|
1829
1874
|
function Kl(e, t) {
|
|
1830
|
-
let { target: r, ...n } = e, l = { ref: ce(t) },
|
|
1831
|
-
return O.createElement(Wr.Provider, { value: r },
|
|
1875
|
+
let { target: r, ...n } = e, l = { ref: ce(t) }, a = ie();
|
|
1876
|
+
return O.createElement(Wr.Provider, { value: r }, a({ ourProps: l, theirProps: n, defaultTag: ql, name: "Popover.Group" }));
|
|
1832
1877
|
}
|
|
1833
|
-
let It =
|
|
1878
|
+
let It = oe(null);
|
|
1834
1879
|
function zl() {
|
|
1835
|
-
let e = Z(It), t = j([]), r = A((
|
|
1836
|
-
let s = t.current.indexOf(
|
|
1837
|
-
s !== -1 && t.current.splice(s, 1), e && e.unregister(
|
|
1880
|
+
let e = Z(It), t = j([]), r = A((a) => (t.current.push(a), e && e.register(a), () => n(a))), n = A((a) => {
|
|
1881
|
+
let s = t.current.indexOf(a);
|
|
1882
|
+
s !== -1 && t.current.splice(s, 1), e && e.unregister(a);
|
|
1838
1883
|
}), l = B(() => ({ register: r, unregister: n, portals: t }), [r, n, t]);
|
|
1839
|
-
return [t, B(() => function({ children:
|
|
1840
|
-
return O.createElement(It.Provider, { value: l },
|
|
1884
|
+
return [t, B(() => function({ children: a }) {
|
|
1885
|
+
return O.createElement(It.Provider, { value: l }, a);
|
|
1841
1886
|
}, [l])];
|
|
1842
1887
|
}
|
|
1843
1888
|
let Gl = Q(Xl), Ur = Q(Kl), Jl = Object.assign(Gl, { Group: Ur });
|
|
@@ -1852,31 +1897,31 @@ function Ql() {
|
|
|
1852
1897
|
let [t] = V(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = V((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1853
1898
|
return z(() => {
|
|
1854
1899
|
if (!t) return;
|
|
1855
|
-
function l(
|
|
1856
|
-
n(
|
|
1900
|
+
function l(a) {
|
|
1901
|
+
n(a.matches);
|
|
1857
1902
|
}
|
|
1858
1903
|
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1859
1904
|
}, [t]), r;
|
|
1860
1905
|
}
|
|
1861
|
-
function
|
|
1906
|
+
function eo({ defaultContainers: e = [], portals: t, mainTreeNode: r } = {}) {
|
|
1862
1907
|
let n = Ze(r), l = A(() => {
|
|
1863
|
-
var
|
|
1864
|
-
let
|
|
1865
|
-
for (let
|
|
1866
|
-
if (t != null && t.current) for (let
|
|
1867
|
-
for (let
|
|
1868
|
-
return
|
|
1908
|
+
var a, s;
|
|
1909
|
+
let u = [];
|
|
1910
|
+
for (let i of e) i !== null && (i instanceof HTMLElement ? u.push(i) : "current" in i && i.current instanceof HTMLElement && u.push(i.current));
|
|
1911
|
+
if (t != null && t.current) for (let i of t.current) u.push(i);
|
|
1912
|
+
for (let i of (a = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? a : []) i !== document.body && i !== document.head && i instanceof HTMLElement && i.id !== "headlessui-portal-root" && (r && (i.contains(r) || i.contains((s = r == null ? void 0 : r.getRootNode()) == null ? void 0 : s.host)) || u.some((p) => i.contains(p)) || u.push(i));
|
|
1913
|
+
return u;
|
|
1869
1914
|
});
|
|
1870
|
-
return { resolveContainers: l, contains: A((
|
|
1915
|
+
return { resolveContainers: l, contains: A((a) => l().some((s) => s.contains(a))) };
|
|
1871
1916
|
}
|
|
1872
|
-
let Hr =
|
|
1917
|
+
let Hr = oe(null);
|
|
1873
1918
|
function gr({ children: e, node: t }) {
|
|
1874
1919
|
let [r, n] = V(null), l = Br(t ?? r);
|
|
1875
|
-
return O.createElement(Hr.Provider, { value: l }, e, l === null && O.createElement(Mt, { features: st.Hidden, ref: (
|
|
1876
|
-
var s,
|
|
1877
|
-
if (
|
|
1878
|
-
for (let
|
|
1879
|
-
n(
|
|
1920
|
+
return O.createElement(Hr.Provider, { value: l }, e, l === null && O.createElement(Mt, { features: st.Hidden, ref: (a) => {
|
|
1921
|
+
var s, u;
|
|
1922
|
+
if (a) {
|
|
1923
|
+
for (let i of (u = (s = pt(a)) == null ? void 0 : s.querySelectorAll("html > *, body > *")) != null ? u : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(a)) {
|
|
1924
|
+
n(i);
|
|
1880
1925
|
break;
|
|
1881
1926
|
}
|
|
1882
1927
|
}
|
|
@@ -1893,7 +1938,7 @@ function Yt() {
|
|
|
1893
1938
|
}), []), e;
|
|
1894
1939
|
}
|
|
1895
1940
|
var Xe = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Xe || {});
|
|
1896
|
-
function
|
|
1941
|
+
function to() {
|
|
1897
1942
|
let e = j(0);
|
|
1898
1943
|
return Ar(!0, "keydown", (t) => {
|
|
1899
1944
|
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
@@ -1906,39 +1951,39 @@ function Vr(e) {
|
|
|
1906
1951
|
for (let r of e.current) r.current instanceof HTMLElement && t.add(r.current);
|
|
1907
1952
|
return t;
|
|
1908
1953
|
}
|
|
1909
|
-
let
|
|
1910
|
-
var
|
|
1911
|
-
function
|
|
1912
|
-
let r = j(null), n = ce(r, t), { initialFocus: l, initialFocusFallback:
|
|
1913
|
-
Qe() || (
|
|
1914
|
-
let
|
|
1915
|
-
|
|
1916
|
-
let
|
|
1917
|
-
|
|
1918
|
-
let
|
|
1919
|
-
let
|
|
1920
|
-
|
|
1921
|
-
we(
|
|
1922
|
-
Ge(
|
|
1954
|
+
let ro = "div";
|
|
1955
|
+
var Ce = ((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))(Ce || {});
|
|
1956
|
+
function no(e, t) {
|
|
1957
|
+
let r = j(null), n = ce(r, t), { initialFocus: l, initialFocusFallback: a, containers: s, features: u = 15, ...i } = e;
|
|
1958
|
+
Qe() || (u = 0);
|
|
1959
|
+
let p = Ze(r);
|
|
1960
|
+
ao(u, { ownerDocument: p });
|
|
1961
|
+
let c = so(u, { ownerDocument: p, container: r, initialFocus: l, initialFocusFallback: a });
|
|
1962
|
+
uo(u, { ownerDocument: p, container: r, containers: s, previousActiveElement: c });
|
|
1963
|
+
let w = to(), x = A((h) => {
|
|
1964
|
+
let E = r.current;
|
|
1965
|
+
E && ((T) => T())(() => {
|
|
1966
|
+
we(w.current, { [Xe.Forwards]: () => {
|
|
1967
|
+
Ge(E, pe.First, { skipElements: [h.relatedTarget, a] });
|
|
1923
1968
|
}, [Xe.Backwards]: () => {
|
|
1924
|
-
Ge(
|
|
1969
|
+
Ge(E, pe.Last, { skipElements: [h.relatedTarget, a] });
|
|
1925
1970
|
} });
|
|
1926
1971
|
});
|
|
1927
|
-
}),
|
|
1928
|
-
|
|
1929
|
-
|
|
1972
|
+
}), y = Ae(!!(u & 2), "focus-trap#tab-lock"), g = Ht(), f = j(!1), d = { ref: n, onKeyDown(h) {
|
|
1973
|
+
h.key == "Tab" && (f.current = !0, g.requestAnimationFrame(() => {
|
|
1974
|
+
f.current = !1;
|
|
1930
1975
|
}));
|
|
1931
|
-
}, onBlur(
|
|
1932
|
-
if (!(
|
|
1933
|
-
let
|
|
1934
|
-
r.current instanceof HTMLElement &&
|
|
1935
|
-
let T =
|
|
1936
|
-
T instanceof HTMLElement && T.dataset.headlessuiFocusGuard !== "true" && (Yr(
|
|
1937
|
-
} },
|
|
1938
|
-
return O.createElement(O.Fragment, null,
|
|
1939
|
-
}
|
|
1940
|
-
let
|
|
1941
|
-
function
|
|
1976
|
+
}, onBlur(h) {
|
|
1977
|
+
if (!(u & 4)) return;
|
|
1978
|
+
let E = Vr(s);
|
|
1979
|
+
r.current instanceof HTMLElement && E.add(r.current);
|
|
1980
|
+
let T = h.relatedTarget;
|
|
1981
|
+
T instanceof HTMLElement && T.dataset.headlessuiFocusGuard !== "true" && (Yr(E, T) || (f.current ? Ge(r.current, we(w.current, { [Xe.Forwards]: () => pe.Next, [Xe.Backwards]: () => pe.Previous }) | pe.WrapAround, { relativeTo: h.target }) : h.target instanceof HTMLElement && me(h.target)));
|
|
1982
|
+
} }, m = ie();
|
|
1983
|
+
return O.createElement(O.Fragment, null, y && O.createElement(Mt, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: x, features: st.Focusable }), m({ ourProps: d, theirProps: i, defaultTag: ro, name: "FocusTrap" }), y && O.createElement(Mt, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: x, features: st.Focusable }));
|
|
1984
|
+
}
|
|
1985
|
+
let lo = Q(no), oo = Object.assign(lo, { features: Ce });
|
|
1986
|
+
function io(e = !0) {
|
|
1942
1987
|
let t = j(he.slice());
|
|
1943
1988
|
return Vt(([r], [n]) => {
|
|
1944
1989
|
n === !0 && r === !1 && mt(() => {
|
|
@@ -1949,57 +1994,57 @@ function ai(e = !0) {
|
|
|
1949
1994
|
return (r = t.current.find((n) => n != null && n.isConnected)) != null ? r : null;
|
|
1950
1995
|
});
|
|
1951
1996
|
}
|
|
1952
|
-
function
|
|
1953
|
-
let r = !!(e & 8), n =
|
|
1997
|
+
function ao(e, { ownerDocument: t }) {
|
|
1998
|
+
let r = !!(e & 8), n = io(r);
|
|
1954
1999
|
Vt(() => {
|
|
1955
2000
|
r || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && me(n());
|
|
1956
2001
|
}, [r]), Ir(() => {
|
|
1957
2002
|
r && me(n());
|
|
1958
2003
|
});
|
|
1959
2004
|
}
|
|
1960
|
-
function
|
|
1961
|
-
let
|
|
2005
|
+
function so(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFallback: l }) {
|
|
2006
|
+
let a = j(null), s = Ae(!!(e & 1), "focus-trap#initial-focus"), u = Yt();
|
|
1962
2007
|
return Vt(() => {
|
|
1963
2008
|
if (e === 0) return;
|
|
1964
2009
|
if (!s) {
|
|
1965
2010
|
l != null && l.current && me(l.current);
|
|
1966
2011
|
return;
|
|
1967
2012
|
}
|
|
1968
|
-
let
|
|
1969
|
-
|
|
1970
|
-
if (!
|
|
1971
|
-
let
|
|
2013
|
+
let i = r.current;
|
|
2014
|
+
i && mt(() => {
|
|
2015
|
+
if (!u.current) return;
|
|
2016
|
+
let p = t == null ? void 0 : t.activeElement;
|
|
1972
2017
|
if (n != null && n.current) {
|
|
1973
|
-
if ((n == null ? void 0 : n.current) ===
|
|
1974
|
-
|
|
2018
|
+
if ((n == null ? void 0 : n.current) === p) {
|
|
2019
|
+
a.current = p;
|
|
1975
2020
|
return;
|
|
1976
2021
|
}
|
|
1977
|
-
} else if (
|
|
1978
|
-
|
|
2022
|
+
} else if (i.contains(p)) {
|
|
2023
|
+
a.current = p;
|
|
1979
2024
|
return;
|
|
1980
2025
|
}
|
|
1981
2026
|
if (n != null && n.current) me(n.current);
|
|
1982
2027
|
else {
|
|
1983
2028
|
if (e & 16) {
|
|
1984
|
-
if (Ge(
|
|
1985
|
-
} else if (Ge(
|
|
2029
|
+
if (Ge(i, pe.First | pe.AutoFocus) !== Lt.Error) return;
|
|
2030
|
+
} else if (Ge(i, pe.First) !== Lt.Error) return;
|
|
1986
2031
|
if (l != null && l.current && (me(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1987
2032
|
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1988
2033
|
}
|
|
1989
|
-
|
|
2034
|
+
a.current = t == null ? void 0 : t.activeElement;
|
|
1990
2035
|
});
|
|
1991
|
-
}, [l, s, e]),
|
|
1992
|
-
}
|
|
1993
|
-
function
|
|
1994
|
-
let
|
|
1995
|
-
Lr(t == null ? void 0 : t.defaultView, "focus", (
|
|
1996
|
-
if (!s || !
|
|
1997
|
-
let
|
|
1998
|
-
r.current instanceof HTMLElement &&
|
|
1999
|
-
let
|
|
2000
|
-
if (!
|
|
2001
|
-
let
|
|
2002
|
-
|
|
2036
|
+
}, [l, s, e]), a;
|
|
2037
|
+
}
|
|
2038
|
+
function uo(e, { ownerDocument: t, container: r, containers: n, previousActiveElement: l }) {
|
|
2039
|
+
let a = Yt(), s = !!(e & 4);
|
|
2040
|
+
Lr(t == null ? void 0 : t.defaultView, "focus", (u) => {
|
|
2041
|
+
if (!s || !a.current) return;
|
|
2042
|
+
let i = Vr(n);
|
|
2043
|
+
r.current instanceof HTMLElement && i.add(r.current);
|
|
2044
|
+
let p = l.current;
|
|
2045
|
+
if (!p) return;
|
|
2046
|
+
let c = u.target;
|
|
2047
|
+
c && c instanceof HTMLElement ? Yr(i, c) ? (l.current = c, me(c)) : (u.preventDefault(), u.stopPropagation(), me(p)) : me(l.current);
|
|
2003
2048
|
}, !0);
|
|
2004
2049
|
}
|
|
2005
2050
|
function Yr(e, t) {
|
|
@@ -2010,124 +2055,124 @@ function Xr(e) {
|
|
|
2010
2055
|
var t;
|
|
2011
2056
|
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : Kr) !== ue || O.Children.count(e.children) === 1;
|
|
2012
2057
|
}
|
|
2013
|
-
let gt =
|
|
2058
|
+
let gt = oe(null);
|
|
2014
2059
|
gt.displayName = "TransitionContext";
|
|
2015
|
-
var
|
|
2016
|
-
function
|
|
2060
|
+
var co = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(co || {});
|
|
2061
|
+
function fo() {
|
|
2017
2062
|
let e = Z(gt);
|
|
2018
2063
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
2019
2064
|
return e;
|
|
2020
2065
|
}
|
|
2021
|
-
function
|
|
2066
|
+
function po() {
|
|
2022
2067
|
let e = Z(wt);
|
|
2023
2068
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
2024
2069
|
return e;
|
|
2025
2070
|
}
|
|
2026
|
-
let wt =
|
|
2071
|
+
let wt = oe(null);
|
|
2027
2072
|
wt.displayName = "NestingContext";
|
|
2028
2073
|
function yt(e) {
|
|
2029
2074
|
return "children" in e ? yt(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
2030
2075
|
}
|
|
2031
2076
|
function qr(e, t) {
|
|
2032
|
-
let r = ke(e), n = j([]), l = Yt(),
|
|
2033
|
-
let
|
|
2034
|
-
|
|
2035
|
-
n.current.splice(
|
|
2077
|
+
let r = ke(e), n = j([]), l = Yt(), a = Ht(), s = A((y, g = ge.Hidden) => {
|
|
2078
|
+
let f = n.current.findIndex(({ el: d }) => d === y);
|
|
2079
|
+
f !== -1 && (we(g, { [ge.Unmount]() {
|
|
2080
|
+
n.current.splice(f, 1);
|
|
2036
2081
|
}, [ge.Hidden]() {
|
|
2037
|
-
n.current[
|
|
2038
|
-
} }),
|
|
2039
|
-
var
|
|
2040
|
-
!yt(n) && l.current && ((
|
|
2082
|
+
n.current[f].state = "hidden";
|
|
2083
|
+
} }), a.microTask(() => {
|
|
2084
|
+
var d;
|
|
2085
|
+
!yt(n) && l.current && ((d = r.current) == null || d.call(r));
|
|
2041
2086
|
}));
|
|
2042
|
-
}),
|
|
2043
|
-
let
|
|
2044
|
-
return
|
|
2045
|
-
}),
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
})]), t == null || t.chains.current[
|
|
2049
|
-
Promise.all(
|
|
2050
|
-
})]),
|
|
2051
|
-
}),
|
|
2052
|
-
Promise.all(
|
|
2053
|
-
var
|
|
2054
|
-
(
|
|
2055
|
-
}).then(() =>
|
|
2087
|
+
}), u = A((y) => {
|
|
2088
|
+
let g = n.current.find(({ el: f }) => f === y);
|
|
2089
|
+
return g ? g.state !== "visible" && (g.state = "visible") : n.current.push({ el: y, state: "visible" }), () => s(y, ge.Unmount);
|
|
2090
|
+
}), i = j([]), p = j(Promise.resolve()), c = j({ enter: [], leave: [] }), w = A((y, g, f) => {
|
|
2091
|
+
i.current.splice(0), t && (t.chains.current[g] = t.chains.current[g].filter(([d]) => d !== y)), t == null || t.chains.current[g].push([y, new Promise((d) => {
|
|
2092
|
+
i.current.push(d);
|
|
2093
|
+
})]), t == null || t.chains.current[g].push([y, new Promise((d) => {
|
|
2094
|
+
Promise.all(c.current[g].map(([m, h]) => h)).then(() => d());
|
|
2095
|
+
})]), g === "enter" ? p.current = p.current.then(() => t == null ? void 0 : t.wait.current).then(() => f(g)) : f(g);
|
|
2096
|
+
}), x = A((y, g, f) => {
|
|
2097
|
+
Promise.all(c.current[g].splice(0).map(([d, m]) => m)).then(() => {
|
|
2098
|
+
var d;
|
|
2099
|
+
(d = i.current.shift()) == null || d();
|
|
2100
|
+
}).then(() => f(g));
|
|
2056
2101
|
});
|
|
2057
|
-
return B(() => ({ children: n, register:
|
|
2102
|
+
return B(() => ({ children: n, register: u, unregister: s, onStart: w, onStop: x, wait: p, chains: c }), [u, s, n, w, x, c, p]);
|
|
2058
2103
|
}
|
|
2059
|
-
let Kr = ue, zr =
|
|
2060
|
-
function
|
|
2104
|
+
let Kr = ue, zr = at.RenderStrategy;
|
|
2105
|
+
function mo(e, t) {
|
|
2061
2106
|
var r, n;
|
|
2062
|
-
let { transition: l = !0, beforeEnter:
|
|
2063
|
-
z(() => _(
|
|
2064
|
-
if (X === ge.Hidden &&
|
|
2107
|
+
let { transition: l = !0, beforeEnter: a, afterEnter: s, beforeLeave: u, afterLeave: i, enter: p, enterFrom: c, enterTo: w, entered: x, leave: y, leaveFrom: g, leaveTo: f, ...d } = e, [m, h] = V(null), E = j(null), T = Xr(e), F = ce(...T ? [E, t, h] : t === null ? [] : [t]), X = (r = d.unmount) == null || r ? ge.Unmount : ge.Hidden, { show: U, appear: ee, initial: te } = fo(), [H, q] = V(U ? "visible" : "hidden"), G = po(), { register: _, unregister: $ } = G;
|
|
2108
|
+
z(() => _(E), [_, E]), z(() => {
|
|
2109
|
+
if (X === ge.Hidden && E.current) {
|
|
2065
2110
|
if (U && H !== "visible") {
|
|
2066
2111
|
q("visible");
|
|
2067
2112
|
return;
|
|
2068
2113
|
}
|
|
2069
|
-
return we(H, { hidden: () =>
|
|
2114
|
+
return we(H, { hidden: () => $(E), visible: () => _(E) });
|
|
2070
2115
|
}
|
|
2071
|
-
}, [H,
|
|
2072
|
-
let
|
|
2116
|
+
}, [H, E, _, $, U, X]);
|
|
2117
|
+
let I = Qe();
|
|
2073
2118
|
z(() => {
|
|
2074
|
-
if (T &&
|
|
2075
|
-
}, [
|
|
2076
|
-
let be = te && !ee,
|
|
2077
|
-
ve.current || (q("hidden"),
|
|
2078
|
-
}, G),
|
|
2119
|
+
if (T && I && H === "visible" && E.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
2120
|
+
}, [E, H, I, T]);
|
|
2121
|
+
let be = te && !ee, xe = ee && U && te, ve = j(!1), re = qr(() => {
|
|
2122
|
+
ve.current || (q("hidden"), $(E));
|
|
2123
|
+
}, G), Ee = A((Pe) => {
|
|
2079
2124
|
ve.current = !0;
|
|
2080
2125
|
let de = Pe ? "enter" : "leave";
|
|
2081
|
-
re.onStart(
|
|
2082
|
-
fe === "enter" ?
|
|
2126
|
+
re.onStart(E, de, (fe) => {
|
|
2127
|
+
fe === "enter" ? a == null || a() : fe === "leave" && (u == null || u());
|
|
2083
2128
|
});
|
|
2084
|
-
}),
|
|
2129
|
+
}), N = A((Pe) => {
|
|
2085
2130
|
let de = Pe ? "enter" : "leave";
|
|
2086
|
-
ve.current = !1, re.onStop(
|
|
2087
|
-
fe === "enter" ? s == null || s() : fe === "leave" && (
|
|
2088
|
-
}), de === "leave" && !yt(re) && (q("hidden"),
|
|
2131
|
+
ve.current = !1, re.onStop(E, de, (fe) => {
|
|
2132
|
+
fe === "enter" ? s == null || s() : fe === "leave" && (i == null || i());
|
|
2133
|
+
}), de === "leave" && !yt(re) && (q("hidden"), $(E));
|
|
2089
2134
|
});
|
|
2090
|
-
|
|
2091
|
-
T && l || (
|
|
2135
|
+
L(() => {
|
|
2136
|
+
T && l || (Ee(U), N(U));
|
|
2092
2137
|
}, [U, T, l]);
|
|
2093
|
-
let Te = !(!l || !T || !
|
|
2138
|
+
let Te = !(!l || !T || !I || be), [, Y] = Al(Te, m, U, { start: Ee, end: N }), xt = Se({ ref: F, className: ((n = _t(d.className, xe && p, xe && c, Y.enter && p, Y.enter && Y.closed && c, Y.enter && !Y.closed && w, Y.leave && y, Y.leave && !Y.closed && g, Y.leave && Y.closed && f, !Y.transition && U && x)) == null ? void 0 : n.trim()) || void 0, ...Ml(Y) }), Oe = 0;
|
|
2094
2139
|
H === "visible" && (Oe |= se.Open), H === "hidden" && (Oe |= se.Closed), Y.enter && (Oe |= se.Opening), Y.leave && (Oe |= se.Closing);
|
|
2095
|
-
let Ie =
|
|
2096
|
-
return O.createElement(wt.Provider, { value: re }, O.createElement(Dl, { value: Oe }, Ie({ ourProps:
|
|
2140
|
+
let Ie = ie();
|
|
2141
|
+
return O.createElement(wt.Provider, { value: re }, O.createElement(Dl, { value: Oe }, Ie({ ourProps: xt, theirProps: d, defaultTag: Kr, features: zr, visible: H === "visible", name: "Transition.Child" })));
|
|
2097
2142
|
}
|
|
2098
|
-
function
|
|
2099
|
-
let { show: r, appear: n = !1, unmount: l = !0, ...
|
|
2143
|
+
function vo(e, t) {
|
|
2144
|
+
let { show: r, appear: n = !1, unmount: l = !0, ...a } = e, s = j(null), u = Xr(e), i = ce(...u ? [s, t] : t === null ? [] : [t]);
|
|
2100
2145
|
Qe();
|
|
2101
|
-
let
|
|
2102
|
-
if (r === void 0 &&
|
|
2103
|
-
let [
|
|
2104
|
-
r ||
|
|
2105
|
-
}), [
|
|
2146
|
+
let p = ht();
|
|
2147
|
+
if (r === void 0 && p !== null && (r = (p & se.Open) === se.Open), r === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
2148
|
+
let [c, w] = V(r ? "visible" : "hidden"), x = qr(() => {
|
|
2149
|
+
r || w("hidden");
|
|
2150
|
+
}), [y, g] = V(!0), f = j([r]);
|
|
2106
2151
|
z(() => {
|
|
2107
|
-
|
|
2108
|
-
}, [
|
|
2109
|
-
let
|
|
2152
|
+
y !== !1 && f.current[f.current.length - 1] !== r && (f.current.push(r), g(!1));
|
|
2153
|
+
}, [f, r]);
|
|
2154
|
+
let d = B(() => ({ show: r, appear: n, initial: y }), [r, n, y]);
|
|
2110
2155
|
z(() => {
|
|
2111
|
-
r ?
|
|
2112
|
-
}, [r,
|
|
2113
|
-
let
|
|
2156
|
+
r ? w("visible") : !yt(x) && s.current !== null && w("hidden");
|
|
2157
|
+
}, [r, x]);
|
|
2158
|
+
let m = { unmount: l }, h = A(() => {
|
|
2114
2159
|
var F;
|
|
2115
|
-
|
|
2116
|
-
}),
|
|
2160
|
+
y && g(!1), (F = e.beforeEnter) == null || F.call(e);
|
|
2161
|
+
}), E = A(() => {
|
|
2117
2162
|
var F;
|
|
2118
|
-
|
|
2119
|
-
}), T =
|
|
2120
|
-
return O.createElement(wt.Provider, { value:
|
|
2163
|
+
y && g(!1), (F = e.beforeLeave) == null || F.call(e);
|
|
2164
|
+
}), T = ie();
|
|
2165
|
+
return O.createElement(wt.Provider, { value: x }, O.createElement(gt.Provider, { value: d }, T({ ourProps: { ...m, as: ue, children: O.createElement(Gr, { ref: i, ...m, ...a, beforeEnter: h, beforeLeave: E }) }, theirProps: {}, defaultTag: ue, features: zr, visible: c === "visible", name: "Transition" })));
|
|
2121
2166
|
}
|
|
2122
|
-
function
|
|
2167
|
+
function ho(e, t) {
|
|
2123
2168
|
let r = Z(gt) !== null, n = ht() !== null;
|
|
2124
2169
|
return O.createElement(O.Fragment, null, !r && n ? O.createElement(Nt, { ref: t, ...e }) : O.createElement(Gr, { ref: t, ...e }));
|
|
2125
2170
|
}
|
|
2126
|
-
let Nt = Q(
|
|
2127
|
-
var
|
|
2128
|
-
let
|
|
2171
|
+
let Nt = Q(vo), Gr = Q(mo), Le = Q(ho), Jr = Object.assign(Nt, { Child: Le, Root: Nt });
|
|
2172
|
+
var go = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(go || {}), wo = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(wo || {});
|
|
2173
|
+
let yo = { 0(e, t) {
|
|
2129
2174
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
2130
|
-
} }, Xt =
|
|
2175
|
+
} }, Xt = oe(null);
|
|
2131
2176
|
Xt.displayName = "DialogContext";
|
|
2132
2177
|
function bt(e) {
|
|
2133
2178
|
let t = Z(Xt);
|
|
@@ -2137,67 +2182,67 @@ function bt(e) {
|
|
|
2137
2182
|
}
|
|
2138
2183
|
return t;
|
|
2139
2184
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return we(t.type,
|
|
2185
|
+
function bo(e, t) {
|
|
2186
|
+
return we(t.type, yo, e, t);
|
|
2142
2187
|
}
|
|
2143
2188
|
let wr = Q(function(e, t) {
|
|
2144
|
-
let r = Je(), { id: n = `headlessui-dialog-${r}`, open: l, onClose:
|
|
2145
|
-
|
|
2146
|
-
return
|
|
2189
|
+
let r = Je(), { id: n = `headlessui-dialog-${r}`, open: l, onClose: a, initialFocus: s, role: u = "dialog", autoFocus: i = !0, __demoMode: p = !1, unmount: c = !1, ...w } = e, x = j(!1);
|
|
2190
|
+
u = function() {
|
|
2191
|
+
return u === "dialog" || u === "alertdialog" ? u : (x.current || (x.current = !0, console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
2147
2192
|
}();
|
|
2148
|
-
let
|
|
2149
|
-
l === void 0 &&
|
|
2150
|
-
let
|
|
2151
|
-
var
|
|
2152
|
-
return (
|
|
2153
|
-
} }, H = Br(), { resolveContainers: q } =
|
|
2154
|
-
fl(
|
|
2155
|
-
var
|
|
2156
|
-
return [(Te = (
|
|
2193
|
+
let y = ht();
|
|
2194
|
+
l === void 0 && y !== null && (l = (y & se.Open) === se.Open);
|
|
2195
|
+
let g = j(null), f = ce(g, t), d = Ze(g), m = l ? 0 : 1, [h, E] = kn(bo, { titleId: null, descriptionId: null, panelRef: jn() }), T = A(() => a(!1)), F = A((N) => E({ type: 0, id: N })), X = Qe() ? m === 0 : !1, [U, ee] = zl(), te = { get current() {
|
|
2196
|
+
var N;
|
|
2197
|
+
return (N = h.panelRef.current) != null ? N : g.current;
|
|
2198
|
+
} }, H = Br(), { resolveContainers: q } = eo({ mainTreeNode: H, portals: U, defaultContainers: [te] }), G = y !== null ? (y & se.Closing) === se.Closing : !1;
|
|
2199
|
+
fl(p || G ? !1 : X, { allowed: A(() => {
|
|
2200
|
+
var N, Te;
|
|
2201
|
+
return [(Te = (N = g.current) == null ? void 0 : N.closest("[data-headlessui-portal]")) != null ? Te : null];
|
|
2157
2202
|
}), disallowed: A(() => {
|
|
2158
|
-
var
|
|
2159
|
-
return [(
|
|
2160
|
-
}) }), Pl(X, q, (
|
|
2161
|
-
|
|
2162
|
-
}), Zl(X,
|
|
2163
|
-
|
|
2164
|
-
}), kl(
|
|
2165
|
-
let [_,
|
|
2166
|
-
X && !
|
|
2167
|
-
let
|
|
2168
|
-
return O.createElement(Wl, null, O.createElement(hr, { force: !0 }, O.createElement(Jl, null, O.createElement(Xt.Provider, { value:
|
|
2169
|
-
}),
|
|
2170
|
-
function
|
|
2171
|
-
let { transition: r = !1, open: n, ...l } = e,
|
|
2172
|
-
if (!s && !
|
|
2203
|
+
var N;
|
|
2204
|
+
return [(N = H == null ? void 0 : H.closest("body > *:not(#headlessui-portal-root)")) != null ? N : null];
|
|
2205
|
+
}) }), Pl(X, q, (N) => {
|
|
2206
|
+
N.preventDefault(), T();
|
|
2207
|
+
}), Zl(X, d == null ? void 0 : d.defaultView, (N) => {
|
|
2208
|
+
N.preventDefault(), N.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), T();
|
|
2209
|
+
}), kl(p || G ? !1 : X, d, q), pl(X, g, T);
|
|
2210
|
+
let [_, $] = nl(), I = B(() => [{ dialogState: m, close: T, setTitleId: F, unmount: c }, h], [m, h, T, F, c]), be = B(() => ({ open: m === 0 }), [m]), xe = { ref: f, id: n, role: u, tabIndex: -1, "aria-modal": p ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": h.titleId, "aria-describedby": _, unmount: c }, ve = !Ql(), re = Ce.None;
|
|
2211
|
+
X && !p && (re |= Ce.RestoreFocus, re |= Ce.TabLock, i && (re |= Ce.AutoFocus), ve && (re |= Ce.InitialFocus));
|
|
2212
|
+
let Ee = ie();
|
|
2213
|
+
return O.createElement(Wl, null, O.createElement(hr, { force: !0 }, O.createElement(Jl, null, O.createElement(Xt.Provider, { value: I }, O.createElement(Ur, { target: g }, O.createElement(hr, { force: !1 }, O.createElement($, { slot: be }, O.createElement(ee, null, O.createElement(oo, { initialFocus: s, initialFocusFallback: g, containers: q, features: re }, O.createElement(ul, { value: T }, Ee({ ourProps: xe, theirProps: w, slot: be, defaultTag: xo, features: Eo, visible: m === 0, name: "Dialog" })))))))))));
|
|
2214
|
+
}), xo = "div", Eo = at.RenderStrategy | at.Static;
|
|
2215
|
+
function To(e, t) {
|
|
2216
|
+
let { transition: r = !1, open: n, ...l } = e, a = ht(), s = e.hasOwnProperty("open") || a !== null, u = e.hasOwnProperty("onClose");
|
|
2217
|
+
if (!s && !u) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
2173
2218
|
if (!s) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
2174
|
-
if (!
|
|
2175
|
-
if (!
|
|
2219
|
+
if (!u) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
2220
|
+
if (!a && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
|
|
2176
2221
|
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}`);
|
|
2177
2222
|
return (n !== void 0 || r) && !l.static ? O.createElement(gr, null, O.createElement(Jr, { show: n, transition: r, unmount: l.unmount }, O.createElement(wr, { ref: t, ...l }))) : O.createElement(gr, null, O.createElement(wr, { ref: t, open: n, ...l }));
|
|
2178
2223
|
}
|
|
2179
|
-
let
|
|
2180
|
-
function
|
|
2181
|
-
let r = Je(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...
|
|
2182
|
-
|
|
2183
|
-
}),
|
|
2184
|
-
return O.createElement(
|
|
2185
|
-
}
|
|
2186
|
-
let
|
|
2187
|
-
function
|
|
2188
|
-
let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount:
|
|
2189
|
-
return O.createElement(
|
|
2190
|
-
}
|
|
2191
|
-
let
|
|
2192
|
-
function $
|
|
2193
|
-
let r = Je(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState:
|
|
2194
|
-
|
|
2195
|
-
let
|
|
2196
|
-
return
|
|
2197
|
-
}
|
|
2198
|
-
let
|
|
2199
|
-
Q(
|
|
2200
|
-
let
|
|
2224
|
+
let Oo = "div";
|
|
2225
|
+
function Po(e, t) {
|
|
2226
|
+
let r = Je(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...a } = e, [{ dialogState: s, unmount: u }, i] = bt("Dialog.Panel"), p = ce(t, i.panelRef), c = B(() => ({ open: s === 0 }), [s]), w = A((d) => {
|
|
2227
|
+
d.stopPropagation();
|
|
2228
|
+
}), x = { ref: p, id: n, onClick: w }, y = l ? Le : ue, g = l ? { unmount: u } : {}, f = ie();
|
|
2229
|
+
return O.createElement(y, { ...g }, f({ ourProps: x, theirProps: a, slot: c, defaultTag: Oo, name: "Dialog.Panel" }));
|
|
2230
|
+
}
|
|
2231
|
+
let Ro = "div";
|
|
2232
|
+
function So(e, t) {
|
|
2233
|
+
let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: a }] = bt("Dialog.Backdrop"), s = B(() => ({ open: l === 0 }), [l]), u = { ref: t, "aria-hidden": !0 }, i = r ? Le : ue, p = r ? { unmount: a } : {}, c = ie();
|
|
2234
|
+
return O.createElement(i, { ...p }, c({ ourProps: u, theirProps: n, slot: s, defaultTag: Ro, name: "Dialog.Backdrop" }));
|
|
2235
|
+
}
|
|
2236
|
+
let Co = "h2";
|
|
2237
|
+
function $o(e, t) {
|
|
2238
|
+
let r = Je(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState: a, setTitleId: s }] = bt("Dialog.Title"), u = ce(t);
|
|
2239
|
+
L(() => (s(n), () => s(null)), [n, s]);
|
|
2240
|
+
let i = B(() => ({ open: a === 0 }), [a]), p = { ref: u, id: n };
|
|
2241
|
+
return ie()({ ourProps: p, theirProps: l, slot: i, defaultTag: Co, name: "Dialog.Title" });
|
|
2242
|
+
}
|
|
2243
|
+
let Fo = Q(To), qt = Q(Po);
|
|
2244
|
+
Q(So);
|
|
2245
|
+
let ko = Q($o), jo = Object.assign(Fo, { Panel: qt, Title: ko, Description: al });
|
|
2201
2246
|
function Zr({ onClick: e }) {
|
|
2202
2247
|
return /* @__PURE__ */ R.jsxs(
|
|
2203
2248
|
"button",
|
|
@@ -2231,10 +2276,10 @@ function Zr({ onClick: e }) {
|
|
|
2231
2276
|
}
|
|
2232
2277
|
);
|
|
2233
2278
|
}
|
|
2234
|
-
const
|
|
2279
|
+
const _o = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.jsx("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ R.jsx(
|
|
2235
2280
|
"div",
|
|
2236
2281
|
{
|
|
2237
|
-
className:
|
|
2282
|
+
className: it("im-modal-positioner flex min-h-full justify-center", {
|
|
2238
2283
|
"items-start": t.position === "top",
|
|
2239
2284
|
"items-center": t.position === "center",
|
|
2240
2285
|
"items-end": t.position === "bottom"
|
|
@@ -2247,7 +2292,7 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2247
2292
|
leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
|
|
2248
2293
|
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
2249
2294
|
afterLeave: e.afterLeave,
|
|
2250
|
-
className:
|
|
2295
|
+
className: it("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
2251
2296
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
2252
2297
|
"sm:max-w-md": t.maxWidth === "md",
|
|
2253
2298
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -2266,10 +2311,10 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2266
2311
|
}
|
|
2267
2312
|
)
|
|
2268
2313
|
}
|
|
2269
|
-
) }),
|
|
2314
|
+
) }), Mo = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.jsx("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ R.jsx(
|
|
2270
2315
|
"div",
|
|
2271
2316
|
{
|
|
2272
|
-
className:
|
|
2317
|
+
className: it("im-slideover-positioner flex min-h-full items-center", {
|
|
2273
2318
|
"justify-start": t.position === "left",
|
|
2274
2319
|
"justify-end": t.position === "right"
|
|
2275
2320
|
}),
|
|
@@ -2281,7 +2326,7 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2281
2326
|
leaveFrom: "opacity-100 translate-x-0",
|
|
2282
2327
|
leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
2283
2328
|
afterLeave: e.afterLeave,
|
|
2284
|
-
className:
|
|
2329
|
+
className: it("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
2285
2330
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
2286
2331
|
"sm:max-w-md": t.maxWidth === "md",
|
|
2287
2332
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -2300,44 +2345,44 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2300
2345
|
}
|
|
2301
2346
|
)
|
|
2302
2347
|
}
|
|
2303
|
-
) }),
|
|
2304
|
-
const l = (s) => typeof t == "function" ? t(s) : t,
|
|
2305
|
-
return yr(n, () =>
|
|
2348
|
+
) }), Ao = Dt(({ name: e, children: t, ...r }, n) => {
|
|
2349
|
+
const l = (s) => typeof t == "function" ? t(s) : t, a = j(null);
|
|
2350
|
+
return yr(n, () => a.current, [a]), /* @__PURE__ */ R.jsx(
|
|
2306
2351
|
Pr,
|
|
2307
2352
|
{
|
|
2308
|
-
ref:
|
|
2353
|
+
ref: a,
|
|
2309
2354
|
name: e,
|
|
2310
2355
|
...r,
|
|
2311
2356
|
children: ({
|
|
2312
2357
|
afterLeave: s,
|
|
2313
|
-
close:
|
|
2314
|
-
config:
|
|
2315
|
-
emit:
|
|
2316
|
-
getChildModal:
|
|
2317
|
-
getParentModal:
|
|
2318
|
-
id:
|
|
2319
|
-
index:
|
|
2320
|
-
isOpen:
|
|
2321
|
-
modalContext:
|
|
2322
|
-
onTopOfStack:
|
|
2323
|
-
reload:
|
|
2324
|
-
setOpen:
|
|
2325
|
-
shouldRender:
|
|
2358
|
+
close: u,
|
|
2359
|
+
config: i,
|
|
2360
|
+
emit: p,
|
|
2361
|
+
getChildModal: c,
|
|
2362
|
+
getParentModal: w,
|
|
2363
|
+
id: x,
|
|
2364
|
+
index: y,
|
|
2365
|
+
isOpen: g,
|
|
2366
|
+
modalContext: f,
|
|
2367
|
+
onTopOfStack: d,
|
|
2368
|
+
reload: m,
|
|
2369
|
+
setOpen: h,
|
|
2370
|
+
shouldRender: E
|
|
2326
2371
|
}) => /* @__PURE__ */ R.jsx(
|
|
2327
2372
|
Jr,
|
|
2328
2373
|
{
|
|
2329
2374
|
appear: !0,
|
|
2330
|
-
show:
|
|
2375
|
+
show: g ?? !1,
|
|
2331
2376
|
children: /* @__PURE__ */ R.jsxs(
|
|
2332
|
-
|
|
2377
|
+
jo,
|
|
2333
2378
|
{
|
|
2334
2379
|
as: "div",
|
|
2335
2380
|
className: "im-dialog relative z-20",
|
|
2336
|
-
onClose: () =>
|
|
2337
|
-
"data-inertiaui-modal-id":
|
|
2338
|
-
"data-inertiaui-modal-index":
|
|
2381
|
+
onClose: () => i.closeExplicitly ? null : u(),
|
|
2382
|
+
"data-inertiaui-modal-id": x,
|
|
2383
|
+
"data-inertiaui-modal-index": y,
|
|
2339
2384
|
children: [
|
|
2340
|
-
|
|
2385
|
+
y === 0 ? /* @__PURE__ */ R.jsx(
|
|
2341
2386
|
Le,
|
|
2342
2387
|
{
|
|
2343
2388
|
enter: "transition transform ease-in-out duration-300",
|
|
@@ -2346,7 +2391,7 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2346
2391
|
leave: "transition transform ease-in-out duration-300",
|
|
2347
2392
|
leaveFrom: "opacity-100",
|
|
2348
2393
|
leaveTo: "opacity-0",
|
|
2349
|
-
children:
|
|
2394
|
+
children: d ? /* @__PURE__ */ R.jsx(
|
|
2350
2395
|
"div",
|
|
2351
2396
|
{
|
|
2352
2397
|
className: "im-backdrop fixed inset-0 z-30 bg-black/75",
|
|
@@ -2355,49 +2400,49 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2355
2400
|
) : /* @__PURE__ */ R.jsx("div", {})
|
|
2356
2401
|
}
|
|
2357
2402
|
) : null,
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2403
|
+
y > 0 && d ? /* @__PURE__ */ R.jsx("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
|
|
2404
|
+
i.slideover ? /* @__PURE__ */ R.jsx(
|
|
2405
|
+
Mo,
|
|
2361
2406
|
{
|
|
2362
|
-
modalContext:
|
|
2363
|
-
config:
|
|
2407
|
+
modalContext: f,
|
|
2408
|
+
config: i,
|
|
2364
2409
|
children: l({
|
|
2365
2410
|
afterLeave: s,
|
|
2366
|
-
close:
|
|
2367
|
-
config:
|
|
2368
|
-
emit:
|
|
2369
|
-
getChildModal:
|
|
2370
|
-
getParentModal:
|
|
2371
|
-
id:
|
|
2372
|
-
index:
|
|
2373
|
-
isOpen:
|
|
2374
|
-
modalContext:
|
|
2375
|
-
onTopOfStack:
|
|
2376
|
-
reload:
|
|
2377
|
-
setOpen:
|
|
2378
|
-
shouldRender:
|
|
2411
|
+
close: u,
|
|
2412
|
+
config: i,
|
|
2413
|
+
emit: p,
|
|
2414
|
+
getChildModal: c,
|
|
2415
|
+
getParentModal: w,
|
|
2416
|
+
id: x,
|
|
2417
|
+
index: y,
|
|
2418
|
+
isOpen: g,
|
|
2419
|
+
modalContext: f,
|
|
2420
|
+
onTopOfStack: d,
|
|
2421
|
+
reload: m,
|
|
2422
|
+
setOpen: h,
|
|
2423
|
+
shouldRender: E
|
|
2379
2424
|
})
|
|
2380
2425
|
}
|
|
2381
2426
|
) : /* @__PURE__ */ R.jsx(
|
|
2382
|
-
|
|
2427
|
+
_o,
|
|
2383
2428
|
{
|
|
2384
|
-
modalContext:
|
|
2385
|
-
config:
|
|
2429
|
+
modalContext: f,
|
|
2430
|
+
config: i,
|
|
2386
2431
|
children: l({
|
|
2387
2432
|
afterLeave: s,
|
|
2388
|
-
close:
|
|
2389
|
-
config:
|
|
2390
|
-
emit:
|
|
2391
|
-
getChildModal:
|
|
2392
|
-
getParentModal:
|
|
2393
|
-
id:
|
|
2394
|
-
index:
|
|
2395
|
-
isOpen:
|
|
2396
|
-
modalContext:
|
|
2397
|
-
onTopOfStack:
|
|
2398
|
-
reload:
|
|
2399
|
-
setOpen:
|
|
2400
|
-
shouldRender:
|
|
2433
|
+
close: u,
|
|
2434
|
+
config: i,
|
|
2435
|
+
emit: p,
|
|
2436
|
+
getChildModal: c,
|
|
2437
|
+
getParentModal: w,
|
|
2438
|
+
id: x,
|
|
2439
|
+
index: y,
|
|
2440
|
+
isOpen: g,
|
|
2441
|
+
modalContext: f,
|
|
2442
|
+
onTopOfStack: d,
|
|
2443
|
+
reload: m,
|
|
2444
|
+
setOpen: h,
|
|
2445
|
+
shouldRender: E
|
|
2401
2446
|
})
|
|
2402
2447
|
}
|
|
2403
2448
|
)
|
|
@@ -2409,56 +2454,56 @@ const ji = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ R.js
|
|
|
2409
2454
|
}
|
|
2410
2455
|
);
|
|
2411
2456
|
});
|
|
2412
|
-
|
|
2413
|
-
const
|
|
2457
|
+
Ao.displayName = "Modal";
|
|
2458
|
+
const qo = ({
|
|
2414
2459
|
href: e,
|
|
2415
2460
|
method: t = "get",
|
|
2416
2461
|
data: r = {},
|
|
2417
2462
|
as: n = "a",
|
|
2418
2463
|
headers: l = {},
|
|
2419
|
-
queryStringArrayFormat:
|
|
2464
|
+
queryStringArrayFormat: a = "brackets",
|
|
2420
2465
|
onAfterLeave: s = null,
|
|
2421
|
-
onBlur:
|
|
2422
|
-
onClose:
|
|
2423
|
-
onError:
|
|
2424
|
-
onFocus:
|
|
2425
|
-
onStart:
|
|
2426
|
-
onSuccess:
|
|
2427
|
-
navigate:
|
|
2428
|
-
children:
|
|
2429
|
-
...
|
|
2466
|
+
onBlur: u = null,
|
|
2467
|
+
onClose: i = null,
|
|
2468
|
+
onError: p = null,
|
|
2469
|
+
onFocus: c = null,
|
|
2470
|
+
onStart: w = null,
|
|
2471
|
+
onSuccess: x = null,
|
|
2472
|
+
navigate: y = null,
|
|
2473
|
+
children: g,
|
|
2474
|
+
...f
|
|
2430
2475
|
}) => {
|
|
2431
|
-
const [
|
|
2432
|
-
Object.keys(
|
|
2433
|
-
cr.includes(
|
|
2476
|
+
const [d, m] = V(!1), [h, E] = V(null), { stack: T, visit: F } = ft(), X = B(() => y ?? Wt("navigate"), [y]), U = {}, ee = {};
|
|
2477
|
+
Object.keys(f).forEach(($) => {
|
|
2478
|
+
cr.includes($) || ($.startsWith("on") && typeof f[$] == "function" ? $.toLowerCase() in window ? U[$] = f[$] : ee[$] = f[$] : U[$] = f[$]);
|
|
2434
2479
|
});
|
|
2435
2480
|
const [te, H] = V(!1);
|
|
2436
|
-
|
|
2437
|
-
|
|
2481
|
+
L(() => {
|
|
2482
|
+
h && (h.onTopOfStack && te ? c == null || c() : !h.onTopOfStack && !te && (u == null || u()), H(!h.onTopOfStack));
|
|
2438
2483
|
}, [T]);
|
|
2439
|
-
const q =
|
|
2440
|
-
|
|
2441
|
-
}, [
|
|
2442
|
-
|
|
2443
|
-
}, [s]), _ =
|
|
2444
|
-
(
|
|
2445
|
-
|
|
2484
|
+
const q = ae(() => {
|
|
2485
|
+
i == null || i();
|
|
2486
|
+
}, [i]), G = ae(() => {
|
|
2487
|
+
E(null), s == null || s();
|
|
2488
|
+
}, [s]), _ = ae(
|
|
2489
|
+
($) => {
|
|
2490
|
+
$ == null || $.preventDefault(), !d && (e.startsWith("#") || (m(!0), w == null || w()), F(
|
|
2446
2491
|
e,
|
|
2447
2492
|
t,
|
|
2448
2493
|
r,
|
|
2449
2494
|
l,
|
|
2450
|
-
Wn(br(
|
|
2495
|
+
Wn(br(f, cr)),
|
|
2451
2496
|
() => q(T.length),
|
|
2452
2497
|
G,
|
|
2453
|
-
|
|
2498
|
+
a,
|
|
2454
2499
|
X
|
|
2455
|
-
).then((
|
|
2456
|
-
|
|
2457
|
-
}).catch((
|
|
2458
|
-
console.error(
|
|
2459
|
-
}).finally(() =>
|
|
2500
|
+
).then((I) => {
|
|
2501
|
+
E(I), I.registerEventListenersFromProps(ee), x == null || x();
|
|
2502
|
+
}).catch((I) => {
|
|
2503
|
+
console.error(I), p == null || p(I);
|
|
2504
|
+
}).finally(() => m(!1)));
|
|
2460
2505
|
},
|
|
2461
|
-
[e, t, r, l,
|
|
2506
|
+
[e, t, r, l, a, f, q, G]
|
|
2462
2507
|
);
|
|
2463
2508
|
return /* @__PURE__ */ R.jsx(
|
|
2464
2509
|
n,
|
|
@@ -2466,27 +2511,27 @@ const Xi = ({
|
|
|
2466
2511
|
...U,
|
|
2467
2512
|
href: e,
|
|
2468
2513
|
onClick: _,
|
|
2469
|
-
children: typeof
|
|
2514
|
+
children: typeof g == "function" ? g({ loading: d }) : g
|
|
2470
2515
|
}
|
|
2471
2516
|
);
|
|
2472
2517
|
};
|
|
2473
|
-
function
|
|
2518
|
+
function Ko() {
|
|
2474
2519
|
return ft().stack[Tr()] ?? null;
|
|
2475
2520
|
}
|
|
2476
|
-
const
|
|
2521
|
+
const zo = (e) => (t) => (t.default.layout = (r) => lt(e, {}, r), t);
|
|
2477
2522
|
export {
|
|
2478
2523
|
Pr as HeadlessModal,
|
|
2479
|
-
|
|
2480
|
-
|
|
2524
|
+
Ao as Modal,
|
|
2525
|
+
qo as ModalLink,
|
|
2481
2526
|
Vn as ModalRoot,
|
|
2482
2527
|
Hn as ModalStackProvider,
|
|
2483
2528
|
Wt as getConfig,
|
|
2484
2529
|
Bn as initFromPageProps,
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2530
|
+
Bo as putConfig,
|
|
2531
|
+
Vo as renderApp,
|
|
2532
|
+
Ho as resetConfig,
|
|
2533
|
+
zo as setPageLayout,
|
|
2534
|
+
Ko as useModal,
|
|
2490
2535
|
Tr as useModalIndex,
|
|
2491
2536
|
ft as useModalStack
|
|
2492
2537
|
};
|