@uoguelph/react-components 1.9.1 → 1.10.0-rc.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.
@@ -0,0 +1,1506 @@
1
+ "use client";
2
+ import { jsxs as Ge, jsx as F } from "react/jsx-runtime";
3
+ import { e as Qe, d as Ke, o as et, g as tt } from "./solid-CpJcQLq3.js";
4
+ import { FontAwesomeIcon as re } from "@fortawesome/react-fontawesome";
5
+ import k, { isValidElement as ae, cloneElement as se, Children as rt, useState as Xe, useCallback as Ie, useContext as nt, useRef as ot, useEffect as it } from "react";
6
+ import { twJoin as at } from "tailwind-merge";
7
+ import { tv as st } from "tailwind-variants";
8
+ import { ToastContext as Be } from "./toaster-context.js";
9
+ import { g as ut } from "./_commonjsHelpers-C6fGbg64.js";
10
+ import ne from "react-dom";
11
+ function Q() {
12
+ return Q = Object.assign ? Object.assign.bind() : function(e) {
13
+ for (var a = 1; a < arguments.length; a++) {
14
+ var s = arguments[a];
15
+ for (var r in s) ({}).hasOwnProperty.call(s, r) && (e[r] = s[r]);
16
+ }
17
+ return e;
18
+ }, Q.apply(null, arguments);
19
+ }
20
+ function Re(e, a) {
21
+ if (e == null) return {};
22
+ var s = {};
23
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
24
+ if (a.indexOf(r) !== -1) continue;
25
+ s[r] = e[r];
26
+ }
27
+ return s;
28
+ }
29
+ function Oe(e, a) {
30
+ return Oe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(s, r) {
31
+ return s.__proto__ = r, s;
32
+ }, Oe(e, a);
33
+ }
34
+ function Pe(e, a) {
35
+ e.prototype = Object.create(a.prototype), e.prototype.constructor = e, Oe(e, a);
36
+ }
37
+ var oe = { exports: {} }, ie = { exports: {} }, S = {};
38
+ var je;
39
+ function ct() {
40
+ if (je) return S;
41
+ je = 1;
42
+ var e = typeof Symbol == "function" && Symbol.for, a = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, s = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, n = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, t = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, i = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, o = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, u = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, f = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, v = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, m = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, _ = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, A = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, $ = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, w = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, I = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, D = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, J = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
43
+ function M(p) {
44
+ if (typeof p == "object" && p !== null) {
45
+ var W = p.$$typeof;
46
+ switch (W) {
47
+ case a:
48
+ switch (p = p.type, p) {
49
+ case u:
50
+ case f:
51
+ case r:
52
+ case t:
53
+ case n:
54
+ case m:
55
+ return p;
56
+ default:
57
+ switch (p = p && p.$$typeof, p) {
58
+ case o:
59
+ case v:
60
+ case $:
61
+ case A:
62
+ case i:
63
+ return p;
64
+ default:
65
+ return W;
66
+ }
67
+ }
68
+ case s:
69
+ return W;
70
+ }
71
+ }
72
+ }
73
+ function N(p) {
74
+ return M(p) === f;
75
+ }
76
+ return S.AsyncMode = u, S.ConcurrentMode = f, S.ContextConsumer = o, S.ContextProvider = i, S.Element = a, S.ForwardRef = v, S.Fragment = r, S.Lazy = $, S.Memo = A, S.Portal = s, S.Profiler = t, S.StrictMode = n, S.Suspense = m, S.isAsyncMode = function(p) {
77
+ return N(p) || M(p) === u;
78
+ }, S.isConcurrentMode = N, S.isContextConsumer = function(p) {
79
+ return M(p) === o;
80
+ }, S.isContextProvider = function(p) {
81
+ return M(p) === i;
82
+ }, S.isElement = function(p) {
83
+ return typeof p == "object" && p !== null && p.$$typeof === a;
84
+ }, S.isForwardRef = function(p) {
85
+ return M(p) === v;
86
+ }, S.isFragment = function(p) {
87
+ return M(p) === r;
88
+ }, S.isLazy = function(p) {
89
+ return M(p) === $;
90
+ }, S.isMemo = function(p) {
91
+ return M(p) === A;
92
+ }, S.isPortal = function(p) {
93
+ return M(p) === s;
94
+ }, S.isProfiler = function(p) {
95
+ return M(p) === t;
96
+ }, S.isStrictMode = function(p) {
97
+ return M(p) === n;
98
+ }, S.isSuspense = function(p) {
99
+ return M(p) === m;
100
+ }, S.isValidElementType = function(p) {
101
+ return typeof p == "string" || typeof p == "function" || p === r || p === f || p === t || p === n || p === m || p === _ || typeof p == "object" && p !== null && (p.$$typeof === $ || p.$$typeof === A || p.$$typeof === i || p.$$typeof === o || p.$$typeof === v || p.$$typeof === I || p.$$typeof === D || p.$$typeof === J || p.$$typeof === w);
102
+ }, S.typeOf = M, S;
103
+ }
104
+ var R = {};
105
+ var $e;
106
+ function ft() {
107
+ return $e || ($e = 1, process.env.NODE_ENV !== "production" && (function() {
108
+ var e = typeof Symbol == "function" && Symbol.for, a = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, s = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, n = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, t = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, i = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, o = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, u = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, f = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, v = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, m = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, _ = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, A = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, $ = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, w = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, I = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, D = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, J = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
109
+ function M(l) {
110
+ return typeof l == "string" || typeof l == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
111
+ l === r || l === f || l === t || l === n || l === m || l === _ || typeof l == "object" && l !== null && (l.$$typeof === $ || l.$$typeof === A || l.$$typeof === i || l.$$typeof === o || l.$$typeof === v || l.$$typeof === I || l.$$typeof === D || l.$$typeof === J || l.$$typeof === w);
112
+ }
113
+ function N(l) {
114
+ if (typeof l == "object" && l !== null) {
115
+ var L = l.$$typeof;
116
+ switch (L) {
117
+ case a:
118
+ var te = l.type;
119
+ switch (te) {
120
+ case u:
121
+ case f:
122
+ case r:
123
+ case t:
124
+ case n:
125
+ case m:
126
+ return te;
127
+ default:
128
+ var Me = te && te.$$typeof;
129
+ switch (Me) {
130
+ case o:
131
+ case v:
132
+ case $:
133
+ case A:
134
+ case i:
135
+ return Me;
136
+ default:
137
+ return L;
138
+ }
139
+ }
140
+ case s:
141
+ return L;
142
+ }
143
+ }
144
+ }
145
+ var p = u, W = f, ce = o, fe = i, le = a, pe = v, K = r, de = $, ve = A, X = s, he = t, q = n, U = m, ee = !1;
146
+ function me(l) {
147
+ return ee || (ee = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), c(l) || N(l) === u;
148
+ }
149
+ function c(l) {
150
+ return N(l) === f;
151
+ }
152
+ function d(l) {
153
+ return N(l) === o;
154
+ }
155
+ function x(l) {
156
+ return N(l) === i;
157
+ }
158
+ function g(l) {
159
+ return typeof l == "object" && l !== null && l.$$typeof === a;
160
+ }
161
+ function E(l) {
162
+ return N(l) === v;
163
+ }
164
+ function T(l) {
165
+ return N(l) === r;
166
+ }
167
+ function y(l) {
168
+ return N(l) === $;
169
+ }
170
+ function b(l) {
171
+ return N(l) === A;
172
+ }
173
+ function C(l) {
174
+ return N(l) === s;
175
+ }
176
+ function P(l) {
177
+ return N(l) === t;
178
+ }
179
+ function O(l) {
180
+ return N(l) === n;
181
+ }
182
+ function j(l) {
183
+ return N(l) === m;
184
+ }
185
+ R.AsyncMode = p, R.ConcurrentMode = W, R.ContextConsumer = ce, R.ContextProvider = fe, R.Element = le, R.ForwardRef = pe, R.Fragment = K, R.Lazy = de, R.Memo = ve, R.Portal = X, R.Profiler = he, R.StrictMode = q, R.Suspense = U, R.isAsyncMode = me, R.isConcurrentMode = c, R.isContextConsumer = d, R.isContextProvider = x, R.isElement = g, R.isForwardRef = E, R.isFragment = T, R.isLazy = y, R.isMemo = b, R.isPortal = C, R.isProfiler = P, R.isStrictMode = O, R.isSuspense = j, R.isValidElementType = M, R.typeOf = N;
186
+ })()), R;
187
+ }
188
+ var De;
189
+ function He() {
190
+ return De || (De = 1, process.env.NODE_ENV === "production" ? ie.exports = ct() : ie.exports = ft()), ie.exports;
191
+ }
192
+ var Ee, ke;
193
+ function lt() {
194
+ if (ke) return Ee;
195
+ ke = 1;
196
+ var e = Object.getOwnPropertySymbols, a = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
197
+ function r(t) {
198
+ if (t == null)
199
+ throw new TypeError("Object.assign cannot be called with null or undefined");
200
+ return Object(t);
201
+ }
202
+ function n() {
203
+ try {
204
+ if (!Object.assign)
205
+ return !1;
206
+ var t = new String("abc");
207
+ if (t[5] = "de", Object.getOwnPropertyNames(t)[0] === "5")
208
+ return !1;
209
+ for (var i = {}, o = 0; o < 10; o++)
210
+ i["_" + String.fromCharCode(o)] = o;
211
+ var u = Object.getOwnPropertyNames(i).map(function(v) {
212
+ return i[v];
213
+ });
214
+ if (u.join("") !== "0123456789")
215
+ return !1;
216
+ var f = {};
217
+ return "abcdefghijklmnopqrst".split("").forEach(function(v) {
218
+ f[v] = v;
219
+ }), Object.keys(Object.assign({}, f)).join("") === "abcdefghijklmnopqrst";
220
+ } catch {
221
+ return !1;
222
+ }
223
+ }
224
+ return Ee = n() ? Object.assign : function(t, i) {
225
+ for (var o, u = r(t), f, v = 1; v < arguments.length; v++) {
226
+ o = Object(arguments[v]);
227
+ for (var m in o)
228
+ a.call(o, m) && (u[m] = o[m]);
229
+ if (e) {
230
+ f = e(o);
231
+ for (var _ = 0; _ < f.length; _++)
232
+ s.call(o, f[_]) && (u[f[_]] = o[f[_]]);
233
+ }
234
+ }
235
+ return u;
236
+ }, Ee;
237
+ }
238
+ var ye, qe;
239
+ function _e() {
240
+ if (qe) return ye;
241
+ qe = 1;
242
+ var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
243
+ return ye = e, ye;
244
+ }
245
+ var ge, Le;
246
+ function Je() {
247
+ return Le || (Le = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
248
+ }
249
+ var be, Fe;
250
+ function pt() {
251
+ if (Fe) return be;
252
+ Fe = 1;
253
+ var e = function() {
254
+ };
255
+ if (process.env.NODE_ENV !== "production") {
256
+ var a = /* @__PURE__ */ _e(), s = {}, r = /* @__PURE__ */ Je();
257
+ e = function(t) {
258
+ var i = "Warning: " + t;
259
+ typeof console < "u" && console.error(i);
260
+ try {
261
+ throw new Error(i);
262
+ } catch {
263
+ }
264
+ };
265
+ }
266
+ function n(t, i, o, u, f) {
267
+ if (process.env.NODE_ENV !== "production") {
268
+ for (var v in t)
269
+ if (r(t, v)) {
270
+ var m;
271
+ try {
272
+ if (typeof t[v] != "function") {
273
+ var _ = Error(
274
+ (u || "React class") + ": " + o + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
275
+ );
276
+ throw _.name = "Invariant Violation", _;
277
+ }
278
+ m = t[v](i, v, u, o, null, a);
279
+ } catch ($) {
280
+ m = $;
281
+ }
282
+ if (m && !(m instanceof Error) && e(
283
+ (u || "React class") + ": type specification of " + o + " `" + v + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof m + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
284
+ ), m instanceof Error && !(m.message in s)) {
285
+ s[m.message] = !0;
286
+ var A = f ? f() : "";
287
+ e(
288
+ "Failed " + o + " type: " + m.message + (A ?? "")
289
+ );
290
+ }
291
+ }
292
+ }
293
+ }
294
+ return n.resetWarningCache = function() {
295
+ process.env.NODE_ENV !== "production" && (s = {});
296
+ }, be = n, be;
297
+ }
298
+ var xe, Ye;
299
+ function dt() {
300
+ if (Ye) return xe;
301
+ Ye = 1;
302
+ var e = He(), a = lt(), s = /* @__PURE__ */ _e(), r = /* @__PURE__ */ Je(), n = /* @__PURE__ */ pt(), t = function() {
303
+ };
304
+ process.env.NODE_ENV !== "production" && (t = function(o) {
305
+ var u = "Warning: " + o;
306
+ typeof console < "u" && console.error(u);
307
+ try {
308
+ throw new Error(u);
309
+ } catch {
310
+ }
311
+ });
312
+ function i() {
313
+ return null;
314
+ }
315
+ return xe = function(o, u) {
316
+ var f = typeof Symbol == "function" && Symbol.iterator, v = "@@iterator";
317
+ function m(c) {
318
+ var d = c && (f && c[f] || c[v]);
319
+ if (typeof d == "function")
320
+ return d;
321
+ }
322
+ var _ = "<<anonymous>>", A = {
323
+ array: D("array"),
324
+ bigint: D("bigint"),
325
+ bool: D("boolean"),
326
+ func: D("function"),
327
+ number: D("number"),
328
+ object: D("object"),
329
+ string: D("string"),
330
+ symbol: D("symbol"),
331
+ any: J(),
332
+ arrayOf: M,
333
+ element: N(),
334
+ elementType: p(),
335
+ instanceOf: W,
336
+ node: pe(),
337
+ objectOf: fe,
338
+ oneOf: ce,
339
+ oneOfType: le,
340
+ shape: de,
341
+ exact: ve
342
+ };
343
+ function $(c, d) {
344
+ return c === d ? c !== 0 || 1 / c === 1 / d : c !== c && d !== d;
345
+ }
346
+ function w(c, d) {
347
+ this.message = c, this.data = d && typeof d == "object" ? d : {}, this.stack = "";
348
+ }
349
+ w.prototype = Error.prototype;
350
+ function I(c) {
351
+ if (process.env.NODE_ENV !== "production")
352
+ var d = {}, x = 0;
353
+ function g(T, y, b, C, P, O, j) {
354
+ if (C = C || _, O = O || b, j !== s) {
355
+ if (u) {
356
+ var l = new Error(
357
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
358
+ );
359
+ throw l.name = "Invariant Violation", l;
360
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
361
+ var L = C + ":" + b;
362
+ !d[L] && // Avoid spamming the console because they are often not actionable except for lib authors
363
+ x < 3 && (t(
364
+ "You are manually calling a React.PropTypes validation function for the `" + O + "` prop on `" + C + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
365
+ ), d[L] = !0, x++);
366
+ }
367
+ }
368
+ return y[b] == null ? T ? y[b] === null ? new w("The " + P + " `" + O + "` is marked as required " + ("in `" + C + "`, but its value is `null`.")) : new w("The " + P + " `" + O + "` is marked as required in " + ("`" + C + "`, but its value is `undefined`.")) : null : c(y, b, C, P, O);
369
+ }
370
+ var E = g.bind(null, !1);
371
+ return E.isRequired = g.bind(null, !0), E;
372
+ }
373
+ function D(c) {
374
+ function d(x, g, E, T, y, b) {
375
+ var C = x[g], P = q(C);
376
+ if (P !== c) {
377
+ var O = U(C);
378
+ return new w(
379
+ "Invalid " + T + " `" + y + "` of type " + ("`" + O + "` supplied to `" + E + "`, expected ") + ("`" + c + "`."),
380
+ { expectedType: c }
381
+ );
382
+ }
383
+ return null;
384
+ }
385
+ return I(d);
386
+ }
387
+ function J() {
388
+ return I(i);
389
+ }
390
+ function M(c) {
391
+ function d(x, g, E, T, y) {
392
+ if (typeof c != "function")
393
+ return new w("Property `" + y + "` of component `" + E + "` has invalid PropType notation inside arrayOf.");
394
+ var b = x[g];
395
+ if (!Array.isArray(b)) {
396
+ var C = q(b);
397
+ return new w("Invalid " + T + " `" + y + "` of type " + ("`" + C + "` supplied to `" + E + "`, expected an array."));
398
+ }
399
+ for (var P = 0; P < b.length; P++) {
400
+ var O = c(b, P, E, T, y + "[" + P + "]", s);
401
+ if (O instanceof Error)
402
+ return O;
403
+ }
404
+ return null;
405
+ }
406
+ return I(d);
407
+ }
408
+ function N() {
409
+ function c(d, x, g, E, T) {
410
+ var y = d[x];
411
+ if (!o(y)) {
412
+ var b = q(y);
413
+ return new w("Invalid " + E + " `" + T + "` of type " + ("`" + b + "` supplied to `" + g + "`, expected a single ReactElement."));
414
+ }
415
+ return null;
416
+ }
417
+ return I(c);
418
+ }
419
+ function p() {
420
+ function c(d, x, g, E, T) {
421
+ var y = d[x];
422
+ if (!e.isValidElementType(y)) {
423
+ var b = q(y);
424
+ return new w("Invalid " + E + " `" + T + "` of type " + ("`" + b + "` supplied to `" + g + "`, expected a single ReactElement type."));
425
+ }
426
+ return null;
427
+ }
428
+ return I(c);
429
+ }
430
+ function W(c) {
431
+ function d(x, g, E, T, y) {
432
+ if (!(x[g] instanceof c)) {
433
+ var b = c.name || _, C = me(x[g]);
434
+ return new w("Invalid " + T + " `" + y + "` of type " + ("`" + C + "` supplied to `" + E + "`, expected ") + ("instance of `" + b + "`."));
435
+ }
436
+ return null;
437
+ }
438
+ return I(d);
439
+ }
440
+ function ce(c) {
441
+ if (!Array.isArray(c))
442
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? t(
443
+ "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
444
+ ) : t("Invalid argument supplied to oneOf, expected an array.")), i;
445
+ function d(x, g, E, T, y) {
446
+ for (var b = x[g], C = 0; C < c.length; C++)
447
+ if ($(b, c[C]))
448
+ return null;
449
+ var P = JSON.stringify(c, function(j, l) {
450
+ var L = U(l);
451
+ return L === "symbol" ? String(l) : l;
452
+ });
453
+ return new w("Invalid " + T + " `" + y + "` of value `" + String(b) + "` " + ("supplied to `" + E + "`, expected one of " + P + "."));
454
+ }
455
+ return I(d);
456
+ }
457
+ function fe(c) {
458
+ function d(x, g, E, T, y) {
459
+ if (typeof c != "function")
460
+ return new w("Property `" + y + "` of component `" + E + "` has invalid PropType notation inside objectOf.");
461
+ var b = x[g], C = q(b);
462
+ if (C !== "object")
463
+ return new w("Invalid " + T + " `" + y + "` of type " + ("`" + C + "` supplied to `" + E + "`, expected an object."));
464
+ for (var P in b)
465
+ if (r(b, P)) {
466
+ var O = c(b, P, E, T, y + "." + P, s);
467
+ if (O instanceof Error)
468
+ return O;
469
+ }
470
+ return null;
471
+ }
472
+ return I(d);
473
+ }
474
+ function le(c) {
475
+ if (!Array.isArray(c))
476
+ return process.env.NODE_ENV !== "production" && t("Invalid argument supplied to oneOfType, expected an instance of array."), i;
477
+ for (var d = 0; d < c.length; d++) {
478
+ var x = c[d];
479
+ if (typeof x != "function")
480
+ return t(
481
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ee(x) + " at index " + d + "."
482
+ ), i;
483
+ }
484
+ function g(E, T, y, b, C) {
485
+ for (var P = [], O = 0; O < c.length; O++) {
486
+ var j = c[O], l = j(E, T, y, b, C, s);
487
+ if (l == null)
488
+ return null;
489
+ l.data && r(l.data, "expectedType") && P.push(l.data.expectedType);
490
+ }
491
+ var L = P.length > 0 ? ", expected one of type [" + P.join(", ") + "]" : "";
492
+ return new w("Invalid " + b + " `" + C + "` supplied to " + ("`" + y + "`" + L + "."));
493
+ }
494
+ return I(g);
495
+ }
496
+ function pe() {
497
+ function c(d, x, g, E, T) {
498
+ return X(d[x]) ? null : new w("Invalid " + E + " `" + T + "` supplied to " + ("`" + g + "`, expected a ReactNode."));
499
+ }
500
+ return I(c);
501
+ }
502
+ function K(c, d, x, g, E) {
503
+ return new w(
504
+ (c || "React class") + ": " + d + " type `" + x + "." + g + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + E + "`."
505
+ );
506
+ }
507
+ function de(c) {
508
+ function d(x, g, E, T, y) {
509
+ var b = x[g], C = q(b);
510
+ if (C !== "object")
511
+ return new w("Invalid " + T + " `" + y + "` of type `" + C + "` " + ("supplied to `" + E + "`, expected `object`."));
512
+ for (var P in c) {
513
+ var O = c[P];
514
+ if (typeof O != "function")
515
+ return K(E, T, y, P, U(O));
516
+ var j = O(b, P, E, T, y + "." + P, s);
517
+ if (j)
518
+ return j;
519
+ }
520
+ return null;
521
+ }
522
+ return I(d);
523
+ }
524
+ function ve(c) {
525
+ function d(x, g, E, T, y) {
526
+ var b = x[g], C = q(b);
527
+ if (C !== "object")
528
+ return new w("Invalid " + T + " `" + y + "` of type `" + C + "` " + ("supplied to `" + E + "`, expected `object`."));
529
+ var P = a({}, x[g], c);
530
+ for (var O in P) {
531
+ var j = c[O];
532
+ if (r(c, O) && typeof j != "function")
533
+ return K(E, T, y, O, U(j));
534
+ if (!j)
535
+ return new w(
536
+ "Invalid " + T + " `" + y + "` key `" + O + "` supplied to `" + E + "`.\nBad object: " + JSON.stringify(x[g], null, " ") + `
537
+ Valid keys: ` + JSON.stringify(Object.keys(c), null, " ")
538
+ );
539
+ var l = j(b, O, E, T, y + "." + O, s);
540
+ if (l)
541
+ return l;
542
+ }
543
+ return null;
544
+ }
545
+ return I(d);
546
+ }
547
+ function X(c) {
548
+ switch (typeof c) {
549
+ case "number":
550
+ case "string":
551
+ case "undefined":
552
+ return !0;
553
+ case "boolean":
554
+ return !c;
555
+ case "object":
556
+ if (Array.isArray(c))
557
+ return c.every(X);
558
+ if (c === null || o(c))
559
+ return !0;
560
+ var d = m(c);
561
+ if (d) {
562
+ var x = d.call(c), g;
563
+ if (d !== c.entries) {
564
+ for (; !(g = x.next()).done; )
565
+ if (!X(g.value))
566
+ return !1;
567
+ } else
568
+ for (; !(g = x.next()).done; ) {
569
+ var E = g.value;
570
+ if (E && !X(E[1]))
571
+ return !1;
572
+ }
573
+ } else
574
+ return !1;
575
+ return !0;
576
+ default:
577
+ return !1;
578
+ }
579
+ }
580
+ function he(c, d) {
581
+ return c === "symbol" ? !0 : d ? d["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && d instanceof Symbol : !1;
582
+ }
583
+ function q(c) {
584
+ var d = typeof c;
585
+ return Array.isArray(c) ? "array" : c instanceof RegExp ? "object" : he(d, c) ? "symbol" : d;
586
+ }
587
+ function U(c) {
588
+ if (typeof c > "u" || c === null)
589
+ return "" + c;
590
+ var d = q(c);
591
+ if (d === "object") {
592
+ if (c instanceof Date)
593
+ return "date";
594
+ if (c instanceof RegExp)
595
+ return "regexp";
596
+ }
597
+ return d;
598
+ }
599
+ function ee(c) {
600
+ var d = U(c);
601
+ switch (d) {
602
+ case "array":
603
+ case "object":
604
+ return "an " + d;
605
+ case "boolean":
606
+ case "date":
607
+ case "regexp":
608
+ return "a " + d;
609
+ default:
610
+ return d;
611
+ }
612
+ }
613
+ function me(c) {
614
+ return !c.constructor || !c.constructor.name ? _ : c.constructor.name;
615
+ }
616
+ return A.checkPropTypes = n, A.resetWarningCache = n.resetWarningCache, A.PropTypes = A, A;
617
+ }, xe;
618
+ }
619
+ var Te, We;
620
+ function vt() {
621
+ if (We) return Te;
622
+ We = 1;
623
+ var e = /* @__PURE__ */ _e();
624
+ function a() {
625
+ }
626
+ function s() {
627
+ }
628
+ return s.resetWarningCache = a, Te = function() {
629
+ function r(i, o, u, f, v, m) {
630
+ if (m !== e) {
631
+ var _ = new Error(
632
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
633
+ );
634
+ throw _.name = "Invariant Violation", _;
635
+ }
636
+ }
637
+ r.isRequired = r;
638
+ function n() {
639
+ return r;
640
+ }
641
+ var t = {
642
+ array: r,
643
+ bigint: r,
644
+ bool: r,
645
+ func: r,
646
+ number: r,
647
+ object: r,
648
+ string: r,
649
+ symbol: r,
650
+ any: r,
651
+ arrayOf: n,
652
+ element: r,
653
+ elementType: r,
654
+ instanceOf: n,
655
+ node: r,
656
+ objectOf: n,
657
+ oneOf: n,
658
+ oneOfType: n,
659
+ shape: n,
660
+ exact: n,
661
+ checkPropTypes: s,
662
+ resetWarningCache: a
663
+ };
664
+ return t.PropTypes = t, t;
665
+ }, Te;
666
+ }
667
+ var Ue;
668
+ function ht() {
669
+ if (Ue) return oe.exports;
670
+ if (Ue = 1, process.env.NODE_ENV !== "production") {
671
+ var e = He(), a = !0;
672
+ oe.exports = /* @__PURE__ */ dt()(e.isElement, a);
673
+ } else
674
+ oe.exports = /* @__PURE__ */ vt()();
675
+ return oe.exports;
676
+ }
677
+ var mt = /* @__PURE__ */ ht();
678
+ const h = /* @__PURE__ */ ut(mt);
679
+ function Et(e, a) {
680
+ return e.classList ? !!a && e.classList.contains(a) : (" " + (e.className.baseVal || e.className) + " ").indexOf(" " + a + " ") !== -1;
681
+ }
682
+ function yt(e, a) {
683
+ e.classList ? e.classList.add(a) : Et(e, a) || (typeof e.className == "string" ? e.className = e.className + " " + a : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + a));
684
+ }
685
+ function Ve(e, a) {
686
+ return e.replace(new RegExp("(^|\\s)" + a + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
687
+ }
688
+ function gt(e, a) {
689
+ e.classList ? e.classList.remove(a) : typeof e.className == "string" ? e.className = Ve(e.className, a) : e.setAttribute("class", Ve(e.className && e.className.baseVal || "", a));
690
+ }
691
+ const ze = {
692
+ disabled: !1
693
+ };
694
+ var bt = process.env.NODE_ENV !== "production" ? h.oneOfType([h.number, h.shape({
695
+ enter: h.number,
696
+ exit: h.number,
697
+ appear: h.number
698
+ }).isRequired]) : null, xt = process.env.NODE_ENV !== "production" ? h.oneOfType([h.string, h.shape({
699
+ enter: h.string,
700
+ exit: h.string,
701
+ active: h.string
702
+ }), h.shape({
703
+ enter: h.string,
704
+ enterDone: h.string,
705
+ enterActive: h.string,
706
+ exit: h.string,
707
+ exitDone: h.string,
708
+ exitActive: h.string
709
+ })]) : null;
710
+ const ue = k.createContext(null);
711
+ var Ze = function(a) {
712
+ return a.scrollTop;
713
+ }, Z = "unmounted", V = "exited", z = "entering", H = "entered", Se = "exiting", Y = /* @__PURE__ */ (function(e) {
714
+ Pe(a, e);
715
+ function a(r, n) {
716
+ var t;
717
+ t = e.call(this, r, n) || this;
718
+ var i = n, o = i && !i.isMounting ? r.enter : r.appear, u;
719
+ return t.appearStatus = null, r.in ? o ? (u = V, t.appearStatus = z) : u = H : r.unmountOnExit || r.mountOnEnter ? u = Z : u = V, t.state = {
720
+ status: u
721
+ }, t.nextCallback = null, t;
722
+ }
723
+ a.getDerivedStateFromProps = function(n, t) {
724
+ var i = n.in;
725
+ return i && t.status === Z ? {
726
+ status: V
727
+ } : null;
728
+ };
729
+ var s = a.prototype;
730
+ return s.componentDidMount = function() {
731
+ this.updateStatus(!0, this.appearStatus);
732
+ }, s.componentDidUpdate = function(n) {
733
+ var t = null;
734
+ if (n !== this.props) {
735
+ var i = this.state.status;
736
+ this.props.in ? i !== z && i !== H && (t = z) : (i === z || i === H) && (t = Se);
737
+ }
738
+ this.updateStatus(!1, t);
739
+ }, s.componentWillUnmount = function() {
740
+ this.cancelNextCallback();
741
+ }, s.getTimeouts = function() {
742
+ var n = this.props.timeout, t, i, o;
743
+ return t = i = o = n, n != null && typeof n != "number" && (t = n.exit, i = n.enter, o = n.appear !== void 0 ? n.appear : i), {
744
+ exit: t,
745
+ enter: i,
746
+ appear: o
747
+ };
748
+ }, s.updateStatus = function(n, t) {
749
+ if (n === void 0 && (n = !1), t !== null)
750
+ if (this.cancelNextCallback(), t === z) {
751
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
752
+ var i = this.props.nodeRef ? this.props.nodeRef.current : ne.findDOMNode(this);
753
+ i && Ze(i);
754
+ }
755
+ this.performEnter(n);
756
+ } else
757
+ this.performExit();
758
+ else this.props.unmountOnExit && this.state.status === V && this.setState({
759
+ status: Z
760
+ });
761
+ }, s.performEnter = function(n) {
762
+ var t = this, i = this.props.enter, o = this.context ? this.context.isMounting : n, u = this.props.nodeRef ? [o] : [ne.findDOMNode(this), o], f = u[0], v = u[1], m = this.getTimeouts(), _ = o ? m.appear : m.enter;
763
+ if (!n && !i || ze.disabled) {
764
+ this.safeSetState({
765
+ status: H
766
+ }, function() {
767
+ t.props.onEntered(f);
768
+ });
769
+ return;
770
+ }
771
+ this.props.onEnter(f, v), this.safeSetState({
772
+ status: z
773
+ }, function() {
774
+ t.props.onEntering(f, v), t.onTransitionEnd(_, function() {
775
+ t.safeSetState({
776
+ status: H
777
+ }, function() {
778
+ t.props.onEntered(f, v);
779
+ });
780
+ });
781
+ });
782
+ }, s.performExit = function() {
783
+ var n = this, t = this.props.exit, i = this.getTimeouts(), o = this.props.nodeRef ? void 0 : ne.findDOMNode(this);
784
+ if (!t || ze.disabled) {
785
+ this.safeSetState({
786
+ status: V
787
+ }, function() {
788
+ n.props.onExited(o);
789
+ });
790
+ return;
791
+ }
792
+ this.props.onExit(o), this.safeSetState({
793
+ status: Se
794
+ }, function() {
795
+ n.props.onExiting(o), n.onTransitionEnd(i.exit, function() {
796
+ n.safeSetState({
797
+ status: V
798
+ }, function() {
799
+ n.props.onExited(o);
800
+ });
801
+ });
802
+ });
803
+ }, s.cancelNextCallback = function() {
804
+ this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
805
+ }, s.safeSetState = function(n, t) {
806
+ t = this.setNextCallback(t), this.setState(n, t);
807
+ }, s.setNextCallback = function(n) {
808
+ var t = this, i = !0;
809
+ return this.nextCallback = function(o) {
810
+ i && (i = !1, t.nextCallback = null, n(o));
811
+ }, this.nextCallback.cancel = function() {
812
+ i = !1;
813
+ }, this.nextCallback;
814
+ }, s.onTransitionEnd = function(n, t) {
815
+ this.setNextCallback(t);
816
+ var i = this.props.nodeRef ? this.props.nodeRef.current : ne.findDOMNode(this), o = n == null && !this.props.addEndListener;
817
+ if (!i || o) {
818
+ setTimeout(this.nextCallback, 0);
819
+ return;
820
+ }
821
+ if (this.props.addEndListener) {
822
+ var u = this.props.nodeRef ? [this.nextCallback] : [i, this.nextCallback], f = u[0], v = u[1];
823
+ this.props.addEndListener(f, v);
824
+ }
825
+ n != null && setTimeout(this.nextCallback, n);
826
+ }, s.render = function() {
827
+ var n = this.state.status;
828
+ if (n === Z)
829
+ return null;
830
+ var t = this.props, i = t.children;
831
+ t.in, t.mountOnEnter, t.unmountOnExit, t.appear, t.enter, t.exit, t.timeout, t.addEndListener, t.onEnter, t.onEntering, t.onEntered, t.onExit, t.onExiting, t.onExited, t.nodeRef;
832
+ var o = Re(t, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
833
+ return (
834
+ // allows for nested Transitions
835
+ /* @__PURE__ */ k.createElement(ue.Provider, {
836
+ value: null
837
+ }, typeof i == "function" ? i(n, o) : k.cloneElement(k.Children.only(i), o))
838
+ );
839
+ }, a;
840
+ })(k.Component);
841
+ Y.contextType = ue;
842
+ Y.propTypes = process.env.NODE_ENV !== "production" ? {
843
+ /**
844
+ * A React reference to DOM element that need to transition:
845
+ * https://stackoverflow.com/a/51127130/4671932
846
+ *
847
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
848
+ * (e.g. `onEnter`) because user already has direct access to the node.
849
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
850
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
851
+ * (see
852
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
853
+ */
854
+ nodeRef: h.shape({
855
+ current: typeof Element > "u" ? h.any : function(e, a, s, r, n, t) {
856
+ var i = e[a];
857
+ return h.instanceOf(i && "ownerDocument" in i ? i.ownerDocument.defaultView.Element : Element)(e, a, s, r, n, t);
858
+ }
859
+ }),
860
+ /**
861
+ * A `function` child can be used instead of a React element. This function is
862
+ * called with the current transition status (`'entering'`, `'entered'`,
863
+ * `'exiting'`, `'exited'`), which can be used to apply context
864
+ * specific props to a component.
865
+ *
866
+ * ```jsx
867
+ * <Transition in={this.state.in} timeout={150}>
868
+ * {state => (
869
+ * <MyComponent className={`fade fade-${state}`} />
870
+ * )}
871
+ * </Transition>
872
+ * ```
873
+ */
874
+ children: h.oneOfType([h.func.isRequired, h.element.isRequired]).isRequired,
875
+ /**
876
+ * Show the component; triggers the enter or exit states
877
+ */
878
+ in: h.bool,
879
+ /**
880
+ * By default the child component is mounted immediately along with
881
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
882
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
883
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
884
+ */
885
+ mountOnEnter: h.bool,
886
+ /**
887
+ * By default the child component stays mounted after it reaches the `'exited'` state.
888
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
889
+ */
890
+ unmountOnExit: h.bool,
891
+ /**
892
+ * By default the child component does not perform the enter transition when
893
+ * it first mounts, regardless of the value of `in`. If you want this
894
+ * behavior, set both `appear` and `in` to `true`.
895
+ *
896
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
897
+ * > only adds an additional enter transition. However, in the
898
+ * > `<CSSTransition>` component that first enter transition does result in
899
+ * > additional `.appear-*` classes, that way you can choose to style it
900
+ * > differently.
901
+ */
902
+ appear: h.bool,
903
+ /**
904
+ * Enable or disable enter transitions.
905
+ */
906
+ enter: h.bool,
907
+ /**
908
+ * Enable or disable exit transitions.
909
+ */
910
+ exit: h.bool,
911
+ /**
912
+ * The duration of the transition, in milliseconds.
913
+ * Required unless `addEndListener` is provided.
914
+ *
915
+ * You may specify a single timeout for all transitions:
916
+ *
917
+ * ```jsx
918
+ * timeout={500}
919
+ * ```
920
+ *
921
+ * or individually:
922
+ *
923
+ * ```jsx
924
+ * timeout={{
925
+ * appear: 500,
926
+ * enter: 300,
927
+ * exit: 500,
928
+ * }}
929
+ * ```
930
+ *
931
+ * - `appear` defaults to the value of `enter`
932
+ * - `enter` defaults to `0`
933
+ * - `exit` defaults to `0`
934
+ *
935
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
936
+ */
937
+ timeout: function(a) {
938
+ var s = bt;
939
+ a.addEndListener || (s = s.isRequired);
940
+ for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), t = 1; t < r; t++)
941
+ n[t - 1] = arguments[t];
942
+ return s.apply(void 0, [a].concat(n));
943
+ },
944
+ /**
945
+ * Add a custom transition end trigger. Called with the transitioning
946
+ * DOM node and a `done` callback. Allows for more fine grained transition end
947
+ * logic. Timeouts are still used as a fallback if provided.
948
+ *
949
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
950
+ *
951
+ * ```jsx
952
+ * addEndListener={(node, done) => {
953
+ * // use the css transitionend event to mark the finish of a transition
954
+ * node.addEventListener('transitionend', done, false);
955
+ * }}
956
+ * ```
957
+ */
958
+ addEndListener: h.func,
959
+ /**
960
+ * Callback fired before the "entering" status is applied. An extra parameter
961
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
962
+ *
963
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
964
+ *
965
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
966
+ */
967
+ onEnter: h.func,
968
+ /**
969
+ * Callback fired after the "entering" status is applied. An extra parameter
970
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
971
+ *
972
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
973
+ *
974
+ * @type Function(node: HtmlElement, isAppearing: bool)
975
+ */
976
+ onEntering: h.func,
977
+ /**
978
+ * Callback fired after the "entered" status is applied. An extra parameter
979
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
980
+ *
981
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
982
+ *
983
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
984
+ */
985
+ onEntered: h.func,
986
+ /**
987
+ * Callback fired before the "exiting" status is applied.
988
+ *
989
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
990
+ *
991
+ * @type Function(node: HtmlElement) -> void
992
+ */
993
+ onExit: h.func,
994
+ /**
995
+ * Callback fired after the "exiting" status is applied.
996
+ *
997
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
998
+ *
999
+ * @type Function(node: HtmlElement) -> void
1000
+ */
1001
+ onExiting: h.func,
1002
+ /**
1003
+ * Callback fired after the "exited" status is applied.
1004
+ *
1005
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1006
+ *
1007
+ * @type Function(node: HtmlElement) -> void
1008
+ */
1009
+ onExited: h.func
1010
+ } : {};
1011
+ function B() {
1012
+ }
1013
+ Y.defaultProps = {
1014
+ in: !1,
1015
+ mountOnEnter: !1,
1016
+ unmountOnExit: !1,
1017
+ appear: !1,
1018
+ enter: !0,
1019
+ exit: !0,
1020
+ onEnter: B,
1021
+ onEntering: B,
1022
+ onEntered: B,
1023
+ onExit: B,
1024
+ onExiting: B,
1025
+ onExited: B
1026
+ };
1027
+ Y.UNMOUNTED = Z;
1028
+ Y.EXITED = V;
1029
+ Y.ENTERING = z;
1030
+ Y.ENTERED = H;
1031
+ Y.EXITING = Se;
1032
+ var Tt = function(a, s) {
1033
+ return a && s && s.split(" ").forEach(function(r) {
1034
+ return yt(a, r);
1035
+ });
1036
+ }, Ce = function(a, s) {
1037
+ return a && s && s.split(" ").forEach(function(r) {
1038
+ return gt(a, r);
1039
+ });
1040
+ }, we = /* @__PURE__ */ (function(e) {
1041
+ Pe(a, e);
1042
+ function a() {
1043
+ for (var r, n = arguments.length, t = new Array(n), i = 0; i < n; i++)
1044
+ t[i] = arguments[i];
1045
+ return r = e.call.apply(e, [this].concat(t)) || this, r.appliedClasses = {
1046
+ appear: {},
1047
+ enter: {},
1048
+ exit: {}
1049
+ }, r.onEnter = function(o, u) {
1050
+ var f = r.resolveArguments(o, u), v = f[0], m = f[1];
1051
+ r.removeClasses(v, "exit"), r.addClass(v, m ? "appear" : "enter", "base"), r.props.onEnter && r.props.onEnter(o, u);
1052
+ }, r.onEntering = function(o, u) {
1053
+ var f = r.resolveArguments(o, u), v = f[0], m = f[1], _ = m ? "appear" : "enter";
1054
+ r.addClass(v, _, "active"), r.props.onEntering && r.props.onEntering(o, u);
1055
+ }, r.onEntered = function(o, u) {
1056
+ var f = r.resolveArguments(o, u), v = f[0], m = f[1], _ = m ? "appear" : "enter";
1057
+ r.removeClasses(v, _), r.addClass(v, _, "done"), r.props.onEntered && r.props.onEntered(o, u);
1058
+ }, r.onExit = function(o) {
1059
+ var u = r.resolveArguments(o), f = u[0];
1060
+ r.removeClasses(f, "appear"), r.removeClasses(f, "enter"), r.addClass(f, "exit", "base"), r.props.onExit && r.props.onExit(o);
1061
+ }, r.onExiting = function(o) {
1062
+ var u = r.resolveArguments(o), f = u[0];
1063
+ r.addClass(f, "exit", "active"), r.props.onExiting && r.props.onExiting(o);
1064
+ }, r.onExited = function(o) {
1065
+ var u = r.resolveArguments(o), f = u[0];
1066
+ r.removeClasses(f, "exit"), r.addClass(f, "exit", "done"), r.props.onExited && r.props.onExited(o);
1067
+ }, r.resolveArguments = function(o, u) {
1068
+ return r.props.nodeRef ? [r.props.nodeRef.current, o] : [o, u];
1069
+ }, r.getClassNames = function(o) {
1070
+ var u = r.props.classNames, f = typeof u == "string", v = f && u ? u + "-" : "", m = f ? "" + v + o : u[o], _ = f ? m + "-active" : u[o + "Active"], A = f ? m + "-done" : u[o + "Done"];
1071
+ return {
1072
+ baseClassName: m,
1073
+ activeClassName: _,
1074
+ doneClassName: A
1075
+ };
1076
+ }, r;
1077
+ }
1078
+ var s = a.prototype;
1079
+ return s.addClass = function(n, t, i) {
1080
+ var o = this.getClassNames(t)[i + "ClassName"], u = this.getClassNames("enter"), f = u.doneClassName;
1081
+ t === "appear" && i === "done" && f && (o += " " + f), i === "active" && n && Ze(n), o && (this.appliedClasses[t][i] = o, Tt(n, o));
1082
+ }, s.removeClasses = function(n, t) {
1083
+ var i = this.appliedClasses[t], o = i.base, u = i.active, f = i.done;
1084
+ this.appliedClasses[t] = {}, o && Ce(n, o), u && Ce(n, u), f && Ce(n, f);
1085
+ }, s.render = function() {
1086
+ var n = this.props;
1087
+ n.classNames;
1088
+ var t = Re(n, ["classNames"]);
1089
+ return /* @__PURE__ */ k.createElement(Y, Q({}, t, {
1090
+ onEnter: this.onEnter,
1091
+ onEntered: this.onEntered,
1092
+ onEntering: this.onEntering,
1093
+ onExit: this.onExit,
1094
+ onExiting: this.onExiting,
1095
+ onExited: this.onExited
1096
+ }));
1097
+ }, a;
1098
+ })(k.Component);
1099
+ we.defaultProps = {
1100
+ classNames: ""
1101
+ };
1102
+ we.propTypes = process.env.NODE_ENV !== "production" ? Q({}, Y.propTypes, {
1103
+ /**
1104
+ * The animation classNames applied to the component as it appears, enters,
1105
+ * exits or has finished the transition. A single name can be provided, which
1106
+ * will be suffixed for each stage, e.g. `classNames="fade"` applies:
1107
+ *
1108
+ * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
1109
+ * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
1110
+ * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
1111
+ *
1112
+ * A few details to note about how these classes are applied:
1113
+ *
1114
+ * 1. They are _joined_ with the ones that are already defined on the child
1115
+ * component, so if you want to add some base styles, you can use
1116
+ * `className` without worrying that it will be overridden.
1117
+ *
1118
+ * 2. If the transition component mounts with `in={false}`, no classes are
1119
+ * applied yet. You might be expecting `*-exit-done`, but if you think
1120
+ * about it, a component cannot finish exiting if it hasn't entered yet.
1121
+ *
1122
+ * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
1123
+ * allows you to define different behavior for when appearing is done and
1124
+ * when regular entering is done, using selectors like
1125
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
1126
+ * an epic entrance animation when element first appears in the DOM using
1127
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
1128
+ * simply use `fade-enter-done` for defining both cases.
1129
+ *
1130
+ * Each individual classNames can also be specified independently like:
1131
+ *
1132
+ * ```js
1133
+ * classNames={{
1134
+ * appear: 'my-appear',
1135
+ * appearActive: 'my-active-appear',
1136
+ * appearDone: 'my-done-appear',
1137
+ * enter: 'my-enter',
1138
+ * enterActive: 'my-active-enter',
1139
+ * enterDone: 'my-done-enter',
1140
+ * exit: 'my-exit',
1141
+ * exitActive: 'my-active-exit',
1142
+ * exitDone: 'my-done-exit',
1143
+ * }}
1144
+ * ```
1145
+ *
1146
+ * If you want to set these classes using CSS Modules:
1147
+ *
1148
+ * ```js
1149
+ * import styles from './styles.css';
1150
+ * ```
1151
+ *
1152
+ * you might want to use camelCase in your CSS file, that way could simply
1153
+ * spread them instead of listing them one by one:
1154
+ *
1155
+ * ```js
1156
+ * classNames={{ ...styles }}
1157
+ * ```
1158
+ *
1159
+ * @type {string | {
1160
+ * appear?: string,
1161
+ * appearActive?: string,
1162
+ * appearDone?: string,
1163
+ * enter?: string,
1164
+ * enterActive?: string,
1165
+ * enterDone?: string,
1166
+ * exit?: string,
1167
+ * exitActive?: string,
1168
+ * exitDone?: string,
1169
+ * }}
1170
+ */
1171
+ classNames: xt,
1172
+ /**
1173
+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
1174
+ * applied.
1175
+ *
1176
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1177
+ *
1178
+ * @type Function(node: HtmlElement, isAppearing: bool)
1179
+ */
1180
+ onEnter: h.func,
1181
+ /**
1182
+ * A `<Transition>` callback fired immediately after the 'enter-active' or
1183
+ * 'appear-active' class is applied.
1184
+ *
1185
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1186
+ *
1187
+ * @type Function(node: HtmlElement, isAppearing: bool)
1188
+ */
1189
+ onEntering: h.func,
1190
+ /**
1191
+ * A `<Transition>` callback fired immediately after the 'enter' or
1192
+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
1193
+ *
1194
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1195
+ *
1196
+ * @type Function(node: HtmlElement, isAppearing: bool)
1197
+ */
1198
+ onEntered: h.func,
1199
+ /**
1200
+ * A `<Transition>` callback fired immediately after the 'exit' class is
1201
+ * applied.
1202
+ *
1203
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1204
+ *
1205
+ * @type Function(node: HtmlElement)
1206
+ */
1207
+ onExit: h.func,
1208
+ /**
1209
+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
1210
+ *
1211
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1212
+ *
1213
+ * @type Function(node: HtmlElement)
1214
+ */
1215
+ onExiting: h.func,
1216
+ /**
1217
+ * A `<Transition>` callback fired immediately after the 'exit' classes
1218
+ * are **removed** and the `exit-done` class is added to the DOM node.
1219
+ *
1220
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1221
+ *
1222
+ * @type Function(node: HtmlElement)
1223
+ */
1224
+ onExited: h.func
1225
+ }) : {};
1226
+ function Ct(e) {
1227
+ if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1228
+ return e;
1229
+ }
1230
+ function Ae(e, a) {
1231
+ var s = function(t) {
1232
+ return a && ae(t) ? a(t) : t;
1233
+ }, r = /* @__PURE__ */ Object.create(null);
1234
+ return e && rt.map(e, function(n) {
1235
+ return n;
1236
+ }).forEach(function(n) {
1237
+ r[n.key] = s(n);
1238
+ }), r;
1239
+ }
1240
+ function Ot(e, a) {
1241
+ e = e || {}, a = a || {};
1242
+ function s(v) {
1243
+ return v in a ? a[v] : e[v];
1244
+ }
1245
+ var r = /* @__PURE__ */ Object.create(null), n = [];
1246
+ for (var t in e)
1247
+ t in a ? n.length && (r[t] = n, n = []) : n.push(t);
1248
+ var i, o = {};
1249
+ for (var u in a) {
1250
+ if (r[u])
1251
+ for (i = 0; i < r[u].length; i++) {
1252
+ var f = r[u][i];
1253
+ o[r[u][i]] = s(f);
1254
+ }
1255
+ o[u] = s(u);
1256
+ }
1257
+ for (i = 0; i < n.length; i++)
1258
+ o[n[i]] = s(n[i]);
1259
+ return o;
1260
+ }
1261
+ function G(e, a, s) {
1262
+ return s[a] != null ? s[a] : e.props[a];
1263
+ }
1264
+ function St(e, a) {
1265
+ return Ae(e.children, function(s) {
1266
+ return se(s, {
1267
+ onExited: a.bind(null, s),
1268
+ in: !0,
1269
+ appear: G(s, "appear", e),
1270
+ enter: G(s, "enter", e),
1271
+ exit: G(s, "exit", e)
1272
+ });
1273
+ });
1274
+ }
1275
+ function Rt(e, a, s) {
1276
+ var r = Ae(e.children), n = Ot(a, r);
1277
+ return Object.keys(n).forEach(function(t) {
1278
+ var i = n[t];
1279
+ if (ae(i)) {
1280
+ var o = t in a, u = t in r, f = a[t], v = ae(f) && !f.props.in;
1281
+ u && (!o || v) ? n[t] = se(i, {
1282
+ onExited: s.bind(null, i),
1283
+ in: !0,
1284
+ exit: G(i, "exit", e),
1285
+ enter: G(i, "enter", e)
1286
+ }) : !u && o && !v ? n[t] = se(i, {
1287
+ in: !1
1288
+ }) : u && o && ae(f) && (n[t] = se(i, {
1289
+ onExited: s.bind(null, i),
1290
+ in: f.props.in,
1291
+ exit: G(i, "exit", e),
1292
+ enter: G(i, "enter", e)
1293
+ }));
1294
+ }
1295
+ }), n;
1296
+ }
1297
+ var Pt = Object.values || function(e) {
1298
+ return Object.keys(e).map(function(a) {
1299
+ return e[a];
1300
+ });
1301
+ }, _t = {
1302
+ component: "div",
1303
+ childFactory: function(a) {
1304
+ return a;
1305
+ }
1306
+ }, Ne = /* @__PURE__ */ (function(e) {
1307
+ Pe(a, e);
1308
+ function a(r, n) {
1309
+ var t;
1310
+ t = e.call(this, r, n) || this;
1311
+ var i = t.handleExited.bind(Ct(t));
1312
+ return t.state = {
1313
+ contextValue: {
1314
+ isMounting: !0
1315
+ },
1316
+ handleExited: i,
1317
+ firstRender: !0
1318
+ }, t;
1319
+ }
1320
+ var s = a.prototype;
1321
+ return s.componentDidMount = function() {
1322
+ this.mounted = !0, this.setState({
1323
+ contextValue: {
1324
+ isMounting: !1
1325
+ }
1326
+ });
1327
+ }, s.componentWillUnmount = function() {
1328
+ this.mounted = !1;
1329
+ }, a.getDerivedStateFromProps = function(n, t) {
1330
+ var i = t.children, o = t.handleExited, u = t.firstRender;
1331
+ return {
1332
+ children: u ? St(n, o) : Rt(n, i, o),
1333
+ firstRender: !1
1334
+ };
1335
+ }, s.handleExited = function(n, t) {
1336
+ var i = Ae(this.props.children);
1337
+ n.key in i || (n.props.onExited && n.props.onExited(t), this.mounted && this.setState(function(o) {
1338
+ var u = Q({}, o.children);
1339
+ return delete u[n.key], {
1340
+ children: u
1341
+ };
1342
+ }));
1343
+ }, s.render = function() {
1344
+ var n = this.props, t = n.component, i = n.childFactory, o = Re(n, ["component", "childFactory"]), u = this.state.contextValue, f = Pt(this.state.children).map(i);
1345
+ return delete o.appear, delete o.enter, delete o.exit, t === null ? /* @__PURE__ */ k.createElement(ue.Provider, {
1346
+ value: u
1347
+ }, f) : /* @__PURE__ */ k.createElement(ue.Provider, {
1348
+ value: u
1349
+ }, /* @__PURE__ */ k.createElement(t, o, f));
1350
+ }, a;
1351
+ })(k.Component);
1352
+ Ne.propTypes = process.env.NODE_ENV !== "production" ? {
1353
+ /**
1354
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
1355
+ * behavior by providing a `component` prop.
1356
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
1357
+ * you can pass in `component={null}`. This is useful if the wrapping div
1358
+ * borks your css styles.
1359
+ */
1360
+ component: h.any,
1361
+ /**
1362
+ * A set of `<Transition>` components, that are toggled `in` and out as they
1363
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
1364
+ * remember to spread them through if you are wrapping the `<Transition>` as
1365
+ * with our `<Fade>` example.
1366
+ *
1367
+ * While this component is meant for multiple `Transition` or `CSSTransition`
1368
+ * children, sometimes you may want to have a single transition child with
1369
+ * content that you want to be transitioned out and in when you change it
1370
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
1371
+ * the transition child as you change its content, this will cause
1372
+ * `TransitionGroup` to transition the child out and back in.
1373
+ */
1374
+ children: h.node,
1375
+ /**
1376
+ * A convenience prop that enables or disables appear animations
1377
+ * for all children. Note that specifying this will override any defaults set
1378
+ * on individual children Transitions.
1379
+ */
1380
+ appear: h.bool,
1381
+ /**
1382
+ * A convenience prop that enables or disables enter animations
1383
+ * for all children. Note that specifying this will override any defaults set
1384
+ * on individual children Transitions.
1385
+ */
1386
+ enter: h.bool,
1387
+ /**
1388
+ * A convenience prop that enables or disables exit animations
1389
+ * for all children. Note that specifying this will override any defaults set
1390
+ * on individual children Transitions.
1391
+ */
1392
+ exit: h.bool,
1393
+ /**
1394
+ * You may need to apply reactive updates to a child as it is exiting.
1395
+ * This is generally done by using `cloneElement` however in the case of an exiting
1396
+ * child the element has already been removed and not accessible to the consumer.
1397
+ *
1398
+ * If you do need to update a child as it leaves you can provide a `childFactory`
1399
+ * to wrap every child, even the ones that are leaving.
1400
+ *
1401
+ * @type Function(child: ReactElement) -> ReactElement
1402
+ */
1403
+ childFactory: h.func
1404
+ } : {};
1405
+ Ne.defaultProps = _t;
1406
+ const Ft = () => {
1407
+ const e = nt(Be);
1408
+ if (!e)
1409
+ throw new Error("useToast must be used within a ToasterProvider component");
1410
+ return e;
1411
+ };
1412
+ function wt({ toast: e, onRemove: a, ...s }) {
1413
+ const r = ot(null);
1414
+ return /* @__PURE__ */ F(we, { ...s, nodeRef: r, timeout: 300, classNames: "uofg-toast-transition", children: /* @__PURE__ */ F(At, { toast: e, onRemove: a, nodeRef: r }) });
1415
+ }
1416
+ function At({
1417
+ toast: e,
1418
+ onRemove: a,
1419
+ nodeRef: s
1420
+ }) {
1421
+ const [r, n] = Xe(100);
1422
+ it(() => {
1423
+ const i = performance.now();
1424
+ let o;
1425
+ const u = (f) => {
1426
+ const v = f - i, m = Math.max(0, 100 - v / e.timeout * 100);
1427
+ n(m), m > 0 && (o = requestAnimationFrame(u));
1428
+ };
1429
+ return o = requestAnimationFrame(u), () => {
1430
+ cancelAnimationFrame(o);
1431
+ };
1432
+ }, [e.timeout]);
1433
+ const t = st({
1434
+ slots: {
1435
+ toast: "uofg-toast relative flex max-w-[50ch] gap-2 overflow-hidden p-6 text-left text-lg",
1436
+ progress: "uofg-toast-progress absolute right-0 bottom-0 left-0 h-1 origin-left bg-current opacity-70",
1437
+ icon: "uofg-toast-icon text-2xl",
1438
+ message: "uofg-toast-message",
1439
+ close: "uofg-toast-close-button text-md absolute -top-3 -left-3 h-6 w-6 cursor-pointer rounded-full bg-black text-white"
1440
+ },
1441
+ variants: {
1442
+ type: {
1443
+ info: {
1444
+ toast: "bg-blue text-blue-contrast"
1445
+ },
1446
+ success: {
1447
+ toast: "bg-green text-green-contrast"
1448
+ },
1449
+ warning: {
1450
+ toast: "bg-yellow text-yellow-contrast"
1451
+ },
1452
+ error: {
1453
+ toast: "bg-red text-red-contrast"
1454
+ }
1455
+ }
1456
+ }
1457
+ })({ type: e.type });
1458
+ return /* @__PURE__ */ Ge("button", { onClick: () => a(e.id), ref: s, className: t.toast(), children: [
1459
+ e.type === "info" && /* @__PURE__ */ F(re, { className: t.icon(), icon: Qe }),
1460
+ e.type === "success" && /* @__PURE__ */ F(re, { className: t.icon(), icon: Ke }),
1461
+ e.type === "warning" && /* @__PURE__ */ F(re, { className: t.icon(), icon: et }),
1462
+ e.type === "error" && /* @__PURE__ */ F(re, { className: t.icon(), icon: tt }),
1463
+ /* @__PURE__ */ F("span", { className: t.message(), children: e.message }),
1464
+ /* @__PURE__ */ F("span", { className: t.progress(), style: { width: `${r}%` }, "aria-hidden": "true" })
1465
+ ] });
1466
+ }
1467
+ function Yt({ children: e }) {
1468
+ const [a, s] = Xe([]), r = Ie((i) => {
1469
+ s((o) => o.filter((u) => u.id !== i));
1470
+ }, []), n = Ie(
1471
+ (i, o = "info", u = 3e3) => {
1472
+ const f = Date.now().toString();
1473
+ console.log("Adding toast:", f, i, o, u), s((v) => [
1474
+ ...v,
1475
+ {
1476
+ id: f,
1477
+ message: i,
1478
+ type: o,
1479
+ timeout: u
1480
+ }
1481
+ ]), setTimeout(() => {
1482
+ r(f);
1483
+ }, u);
1484
+ },
1485
+ [r]
1486
+ ), t = at(
1487
+ "uofg-toaster",
1488
+ "fixed",
1489
+ "right-4",
1490
+ "bottom-4",
1491
+ "z-1000",
1492
+ "flex",
1493
+ "w-fit",
1494
+ "flex-col",
1495
+ "items-end",
1496
+ "gap-3"
1497
+ );
1498
+ return /* @__PURE__ */ Ge(Be.Provider, { value: { addToast: n }, children: [
1499
+ e,
1500
+ /* @__PURE__ */ F(Ne, { component: "div", className: t, children: a.map((i) => /* @__PURE__ */ F(wt, { toast: i, onRemove: r }, i.id)) })
1501
+ ] });
1502
+ }
1503
+ export {
1504
+ Yt as ToasterProvider,
1505
+ Ft as useToaster
1506
+ };