@sudobility/email-components 1.0.7

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,1897 @@
1
+ import { jsx as g, jsxs as E } from "react/jsx-runtime";
2
+ import { cn as C, ChainBadge as Te, Label as Ie } from "@sudobility/components";
3
+ import * as u from "react";
4
+ import { useRef as De, useState as Ue, useEffect as Be } from "react";
5
+ import { ChevronRightIcon as Me, ChevronUpIcon as Oe, ChevronDownIcon as We } from "@heroicons/react/24/outline";
6
+ import { textVariants as he } from "@sudobility/design";
7
+ const br = ({
8
+ className: e,
9
+ children: r,
10
+ disabled: t
11
+ }) => /* @__PURE__ */ g(
12
+ "div",
13
+ {
14
+ className: C(
15
+ "p-4 rounded-lg border transition-colors",
16
+ "bg-white dark:bg-gray-900",
17
+ "border-gray-200 dark:border-gray-700",
18
+ "text-gray-900 dark:text-white",
19
+ t && "opacity-50 cursor-not-allowed",
20
+ e
21
+ ),
22
+ role: "region",
23
+ "aria-label": "AbTestEmail",
24
+ children: r || "AbTestEmail Component"
25
+ }
26
+ ), Ve = {
27
+ evm: "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300",
28
+ solana: "bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300",
29
+ bitcoin: "bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300",
30
+ other: "bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-300"
31
+ }, _e = {
32
+ sm: "text-xs px-2 py-0.5",
33
+ md: "text-sm px-2.5 py-0.5",
34
+ lg: "text-base px-3 py-1"
35
+ }, yr = ({
36
+ chainType: e,
37
+ size: r = "md"
38
+ }) => /* @__PURE__ */ g(
39
+ "span",
40
+ {
41
+ className: C(
42
+ "inline-flex items-center rounded-full font-medium",
43
+ Ve[e],
44
+ _e[r]
45
+ ),
46
+ children: e.toUpperCase()
47
+ }
48
+ ), vr = ({
49
+ className: e,
50
+ children: r,
51
+ disabled: t
52
+ }) => /* @__PURE__ */ g(
53
+ "div",
54
+ {
55
+ className: C(
56
+ "p-4 rounded-lg border transition-colors",
57
+ "bg-white dark:bg-gray-900",
58
+ "border-gray-200 dark:border-gray-700",
59
+ "text-gray-900 dark:text-white",
60
+ t && "opacity-50 cursor-not-allowed",
61
+ e
62
+ ),
63
+ role: "region",
64
+ "aria-label": "ContactCard",
65
+ children: r || "ContactCard Component"
66
+ }
67
+ ), je = (e) => e ? e.length <= 10 ? e : `${e.slice(0, 6)}...${e.slice(-4)}` : "", pe = ({ type: e, addressType: r }) => {
68
+ if (e === "primary")
69
+ return /* @__PURE__ */ g(
70
+ Te,
71
+ {
72
+ chainType: r === "solana" ? "solana" : "evm",
73
+ size: "sm"
74
+ }
75
+ );
76
+ const t = () => e.toUpperCase();
77
+ return /* @__PURE__ */ g(
78
+ "span",
79
+ {
80
+ className: C(
81
+ "inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium border",
82
+ (() => {
83
+ switch (e) {
84
+ case "ens":
85
+ return "bg-green-50 text-green-700 border-green-200 dark:bg-green-900/10 dark:text-green-300 dark:border-green-800";
86
+ case "sns":
87
+ return "bg-orange-50 text-orange-700 border-orange-200 dark:bg-orange-900/10 dark:text-orange-300 dark:border-orange-800";
88
+ default:
89
+ return "bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-900/10 dark:text-gray-300 dark:border-gray-800";
90
+ }
91
+ })()
92
+ ),
93
+ children: t()
94
+ }
95
+ );
96
+ }, He = ({
97
+ domainEmails: e,
98
+ isExpanded: r,
99
+ selectedAccount: t,
100
+ onAccountSelect: n,
101
+ onAccountSettings: a
102
+ }) => {
103
+ const l = De(null), [o, s] = Ue(void 0);
104
+ return Be(() => {
105
+ if (l.current) {
106
+ const i = l.current.scrollHeight;
107
+ s(r ? i + 8 : 0);
108
+ }
109
+ }, [r, e]), /* @__PURE__ */ g(
110
+ "div",
111
+ {
112
+ className: "overflow-hidden transition-all duration-300 ease-in-out",
113
+ style: { height: o !== void 0 ? `${o}px` : "auto" },
114
+ children: /* @__PURE__ */ g("div", { ref: l, className: "ml-6 mt-2 space-y-1", children: e.map((i) => /* @__PURE__ */ E(
115
+ "button",
116
+ {
117
+ onClick: () => n(i.address),
118
+ className: C(
119
+ "w-full flex items-center justify-between text-left px-3 py-2 rounded-lg transition-colors h-[44px]",
120
+ he.body.sm(),
121
+ t === i.address ? "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300" : "hover:bg-gray-100 dark:hover:bg-gray-700"
122
+ ),
123
+ children: [
124
+ /* @__PURE__ */ g("span", { className: "truncate flex-1", children: i.name }),
125
+ /* @__PURE__ */ g(pe, { type: i.type, addressType: i.addressType })
126
+ ]
127
+ },
128
+ i.address
129
+ )) })
130
+ }
131
+ );
132
+ }, xr = ({
133
+ walletGroups: e,
134
+ selectedAccount: r,
135
+ expandedWallets: t,
136
+ onAccountSelect: n,
137
+ onToggleWallet: a,
138
+ onAccountSettings: l,
139
+ className: o = ""
140
+ }) => /* @__PURE__ */ g("nav", { className: C("space-y-1", o), children: e.map((s) => /* @__PURE__ */ E("div", { children: [
141
+ /* @__PURE__ */ E(
142
+ "button",
143
+ {
144
+ onClick: () => n(s.primaryEmail.address),
145
+ className: C(
146
+ "w-full flex items-center justify-between text-left px-3 py-2 rounded-lg transition-colors h-[44px]",
147
+ he.body.sm(),
148
+ r === s.primaryEmail.address && s.domainEmails.length === 0 ? "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300" : "hover:bg-gray-100 dark:hover:bg-gray-700"
149
+ ),
150
+ style: s.customColor ? { backgroundColor: s.customColor } : void 0,
151
+ children: [
152
+ /* @__PURE__ */ E("div", { className: "flex items-center flex-1 min-w-0", children: [
153
+ /* @__PURE__ */ g("span", { className: "truncate flex-1", children: je(s.walletAddress) }),
154
+ /* @__PURE__ */ g(
155
+ pe,
156
+ {
157
+ type: s.primaryEmail.type,
158
+ addressType: s.addressType
159
+ }
160
+ )
161
+ ] }),
162
+ s.domainEmails.length > 0 && /* @__PURE__ */ g(
163
+ "div",
164
+ {
165
+ onClick: (i) => {
166
+ i.stopPropagation(), a(s.walletAddress);
167
+ },
168
+ className: "p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors cursor-pointer",
169
+ role: "button",
170
+ tabIndex: 0,
171
+ onKeyDown: (i) => {
172
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), i.stopPropagation(), a(s.walletAddress));
173
+ },
174
+ children: /* @__PURE__ */ g(
175
+ Me,
176
+ {
177
+ className: C(
178
+ "h-4 w-4 text-gray-500 transition-transform duration-300 ease-in-out",
179
+ t.includes(s.walletAddress) ? "rotate-90" : "rotate-0"
180
+ )
181
+ }
182
+ )
183
+ }
184
+ )
185
+ ]
186
+ }
187
+ ),
188
+ s.domainEmails.length > 0 && /* @__PURE__ */ g(
189
+ He,
190
+ {
191
+ domainEmails: s.domainEmails,
192
+ isExpanded: t.includes(s.walletAddress),
193
+ selectedAccount: r,
194
+ onAccountSelect: n,
195
+ onAccountSettings: l
196
+ }
197
+ )
198
+ ] }, s.walletAddress)) }), wr = ({
199
+ className: e,
200
+ children: r,
201
+ disabled: t
202
+ }) => /* @__PURE__ */ g(
203
+ "div",
204
+ {
205
+ className: C(
206
+ "p-4 rounded-lg border transition-colors",
207
+ "bg-white dark:bg-gray-900",
208
+ "border-gray-200 dark:border-gray-700",
209
+ "text-gray-900 dark:text-white",
210
+ t && "opacity-50 cursor-not-allowed",
211
+ e
212
+ ),
213
+ role: "region",
214
+ "aria-label": "EmailAnalytics",
215
+ children: r || "EmailAnalytics Component"
216
+ }
217
+ ), Cr = ({
218
+ className: e,
219
+ children: r,
220
+ disabled: t
221
+ }) => /* @__PURE__ */ g(
222
+ "div",
223
+ {
224
+ className: C(
225
+ "p-4 rounded-lg border transition-colors",
226
+ "bg-white dark:bg-gray-900",
227
+ "border-gray-200 dark:border-gray-700",
228
+ "text-gray-900 dark:text-white",
229
+ t && "opacity-50 cursor-not-allowed",
230
+ e
231
+ ),
232
+ role: "region",
233
+ "aria-label": "EmailCampaign",
234
+ children: r || "EmailCampaign Component"
235
+ }
236
+ ), ge = ({
237
+ label: e,
238
+ value: r,
239
+ onChange: t,
240
+ placeholder: n,
241
+ required: a = !1,
242
+ error: l,
243
+ className: o = ""
244
+ }) => /* @__PURE__ */ E("div", { className: o, children: [
245
+ /* @__PURE__ */ E(
246
+ Ie,
247
+ {
248
+ htmlFor: e.toLowerCase(),
249
+ className: "text-sm font-medium text-gray-700 dark:text-gray-300",
250
+ children: [
251
+ e,
252
+ " ",
253
+ a && /* @__PURE__ */ g("span", { className: "text-red-500", children: "*" })
254
+ ]
255
+ }
256
+ ),
257
+ /* @__PURE__ */ g(
258
+ "input",
259
+ {
260
+ id: e.toLowerCase(),
261
+ type: "email",
262
+ value: r,
263
+ onChange: (s) => t(s.target.value),
264
+ placeholder: n,
265
+ className: `
266
+ mt-1 block w-full px-3 py-2 border rounded-md shadow-sm
267
+ focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500
268
+ dark:bg-gray-800 dark:border-gray-600 dark:text-white
269
+ ${l ? "border-red-300 focus:ring-red-500 focus:border-red-500" : "border-gray-300 dark:border-gray-600"}
270
+ `
271
+ }
272
+ ),
273
+ l && /* @__PURE__ */ g("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: l })
274
+ ] }), ie = ({
275
+ isVisible: e,
276
+ onToggle: r,
277
+ showLabel: t,
278
+ hideLabel: n,
279
+ ...a
280
+ }) => /* @__PURE__ */ E("div", { children: [
281
+ /* @__PURE__ */ E(
282
+ "button",
283
+ {
284
+ type: "button",
285
+ onClick: r,
286
+ className: "flex items-center text-sm text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 mb-2",
287
+ children: [
288
+ e ? /* @__PURE__ */ g(Oe, { className: "h-4 w-4 mr-1" }) : /* @__PURE__ */ g(We, { className: "h-4 w-4 mr-1" }),
289
+ e ? n : t
290
+ ]
291
+ }
292
+ ),
293
+ e && /* @__PURE__ */ g(ge, { ...a })
294
+ ] }), kr = ({
295
+ to: e,
296
+ onToChange: r,
297
+ cc: t = "",
298
+ onCcChange: n,
299
+ bcc: a = "",
300
+ onBccChange: l,
301
+ showCc: o = !1,
302
+ showBcc: s = !1,
303
+ onToggleCc: i,
304
+ onToggleBcc: c,
305
+ errors: d = {},
306
+ className: m = "",
307
+ labels: f = {},
308
+ placeholders: p = {}
309
+ }) => {
310
+ const b = {
311
+ to: "To",
312
+ cc: "CC",
313
+ bcc: "BCC",
314
+ addCc: "Add CC",
315
+ removeCc: "Remove CC",
316
+ addBcc: "Add BCC",
317
+ removeBcc: "Remove BCC"
318
+ }, x = {
319
+ to: "recipient@example.com",
320
+ cc: "cc@example.com",
321
+ bcc: "bcc@example.com"
322
+ }, h = { ...b, ...f }, y = { ...x, ...p };
323
+ return /* @__PURE__ */ E("div", { className: `space-y-4 ${m}`, children: [
324
+ /* @__PURE__ */ g(
325
+ ge,
326
+ {
327
+ label: h.to,
328
+ value: e,
329
+ onChange: r,
330
+ placeholder: y.to,
331
+ required: !0,
332
+ error: d.to
333
+ }
334
+ ),
335
+ i && n && /* @__PURE__ */ g(
336
+ ie,
337
+ {
338
+ label: h.cc,
339
+ value: t,
340
+ onChange: n,
341
+ placeholder: y.cc,
342
+ error: d.cc,
343
+ isVisible: o,
344
+ onToggle: i,
345
+ showLabel: h.addCc,
346
+ hideLabel: h.removeCc
347
+ }
348
+ ),
349
+ c && l && /* @__PURE__ */ g(
350
+ ie,
351
+ {
352
+ label: h.bcc,
353
+ value: a,
354
+ onChange: l,
355
+ placeholder: y.bcc,
356
+ error: d.bcc,
357
+ isVisible: s,
358
+ onToggle: c,
359
+ showLabel: h.addBcc,
360
+ hideLabel: h.removeBcc
361
+ }
362
+ )
363
+ ] });
364
+ }, Er = ({
365
+ className: e,
366
+ children: r,
367
+ disabled: t = !1,
368
+ onClick: n
369
+ }) => /* @__PURE__ */ g(
370
+ "div",
371
+ {
372
+ className: C(
373
+ "p-4 rounded-lg border transition-colors",
374
+ "bg-white dark:bg-gray-900",
375
+ "border-gray-200 dark:border-gray-700",
376
+ "text-gray-900 dark:text-white",
377
+ t && "opacity-50 cursor-not-allowed",
378
+ "hover:bg-gray-50 dark:hover:bg-gray-800",
379
+ e
380
+ ),
381
+ onClick: t ? void 0 : n,
382
+ role: "region",
383
+ "aria-label": "UemailUtemplate",
384
+ children: r || "UemailUtemplate Component"
385
+ }
386
+ );
387
+ function k(e, r) {
388
+ if (e === !1 || e === null || typeof e > "u")
389
+ throw new Error(r);
390
+ }
391
+ function L(e, r) {
392
+ if (!e) {
393
+ typeof console < "u" && console.warn(r);
394
+ try {
395
+ throw new Error(r);
396
+ } catch {
397
+ }
398
+ }
399
+ }
400
+ function q({
401
+ pathname: e = "/",
402
+ search: r = "",
403
+ hash: t = ""
404
+ }) {
405
+ return r && r !== "?" && (e += r.charAt(0) === "?" ? r : "?" + r), t && t !== "#" && (e += t.charAt(0) === "#" ? t : "#" + t), e;
406
+ }
407
+ function X(e) {
408
+ let r = {};
409
+ if (e) {
410
+ let t = e.indexOf("#");
411
+ t >= 0 && (r.hash = e.substring(t), e = e.substring(0, t));
412
+ let n = e.indexOf("?");
413
+ n >= 0 && (r.search = e.substring(n), e = e.substring(0, n)), e && (r.pathname = e);
414
+ }
415
+ return r;
416
+ }
417
+ function be(e, r, t = "/") {
418
+ return ze(e, r, t, !1);
419
+ }
420
+ function ze(e, r, t, n) {
421
+ let a = typeof r == "string" ? X(r) : r, l = $(a.pathname || "/", t);
422
+ if (l == null)
423
+ return null;
424
+ let o = ye(e);
425
+ Ke(o);
426
+ let s = null;
427
+ for (let i = 0; s == null && i < o.length; ++i) {
428
+ let c = nt(l);
429
+ s = tt(
430
+ o[i],
431
+ c,
432
+ n
433
+ );
434
+ }
435
+ return s;
436
+ }
437
+ function ye(e, r = [], t = [], n = "", a = !1) {
438
+ let l = (o, s, i = a, c) => {
439
+ let d = {
440
+ relativePath: c === void 0 ? o.path || "" : c,
441
+ caseSensitive: o.caseSensitive === !0,
442
+ childrenIndex: s,
443
+ route: o
444
+ };
445
+ if (d.relativePath.startsWith("/")) {
446
+ if (!d.relativePath.startsWith(n) && i)
447
+ return;
448
+ k(
449
+ d.relativePath.startsWith(n),
450
+ `Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
451
+ ), d.relativePath = d.relativePath.slice(n.length);
452
+ }
453
+ let m = P([n, d.relativePath]), f = t.concat(d);
454
+ o.children && o.children.length > 0 && (k(
455
+ // Our types know better, but runtime JS may not!
456
+ // @ts-expect-error
457
+ o.index !== !0,
458
+ `Index routes must not have child routes. Please remove all child routes from route path "${m}".`
459
+ ), ye(
460
+ o.children,
461
+ r,
462
+ f,
463
+ m,
464
+ i
465
+ )), !(o.path == null && !o.index) && r.push({
466
+ path: m,
467
+ score: Ze(m, o.index),
468
+ routesMeta: f
469
+ });
470
+ };
471
+ return e.forEach((o, s) => {
472
+ if (o.path === "" || !o.path?.includes("?"))
473
+ l(o, s);
474
+ else
475
+ for (let i of ve(o.path))
476
+ l(o, s, !0, i);
477
+ }), r;
478
+ }
479
+ function ve(e) {
480
+ let r = e.split("/");
481
+ if (r.length === 0) return [];
482
+ let [t, ...n] = r, a = t.endsWith("?"), l = t.replace(/\?$/, "");
483
+ if (n.length === 0)
484
+ return a ? [l, ""] : [l];
485
+ let o = ve(n.join("/")), s = [];
486
+ return s.push(
487
+ ...o.map(
488
+ (i) => i === "" ? l : [l, i].join("/")
489
+ )
490
+ ), a && s.push(...o), s.map(
491
+ (i) => e.startsWith("/") && i === "" ? "/" : i
492
+ );
493
+ }
494
+ function Ke(e) {
495
+ e.sort(
496
+ (r, t) => r.score !== t.score ? t.score - r.score : et(
497
+ r.routesMeta.map((n) => n.childrenIndex),
498
+ t.routesMeta.map((n) => n.childrenIndex)
499
+ )
500
+ );
501
+ }
502
+ var Je = /^:[\w-]+$/, Ge = 3, Ye = 2, qe = 1, Xe = 10, Qe = -2, se = (e) => e === "*";
503
+ function Ze(e, r) {
504
+ let t = e.split("/"), n = t.length;
505
+ return t.some(se) && (n += Qe), r && (n += Ye), t.filter((a) => !se(a)).reduce(
506
+ (a, l) => a + (Je.test(l) ? Ge : l === "" ? qe : Xe),
507
+ n
508
+ );
509
+ }
510
+ function et(e, r) {
511
+ return e.length === r.length && e.slice(0, -1).every((n, a) => n === r[a]) ? (
512
+ // If two routes are siblings, we should try to match the earlier sibling
513
+ // first. This allows people to have fine-grained control over the matching
514
+ // behavior by simply putting routes with identical paths in the order they
515
+ // want them tried.
516
+ e[e.length - 1] - r[r.length - 1]
517
+ ) : (
518
+ // Otherwise, it doesn't really make sense to rank non-siblings by index,
519
+ // so they sort equally.
520
+ 0
521
+ );
522
+ }
523
+ function tt(e, r, t = !1) {
524
+ let { routesMeta: n } = e, a = {}, l = "/", o = [];
525
+ for (let s = 0; s < n.length; ++s) {
526
+ let i = n[s], c = s === n.length - 1, d = l === "/" ? r : r.slice(l.length) || "/", m = H(
527
+ { path: i.relativePath, caseSensitive: i.caseSensitive, end: c },
528
+ d
529
+ ), f = i.route;
530
+ if (!m && c && t && !n[n.length - 1].route.index && (m = H(
531
+ {
532
+ path: i.relativePath,
533
+ caseSensitive: i.caseSensitive,
534
+ end: !1
535
+ },
536
+ d
537
+ )), !m)
538
+ return null;
539
+ Object.assign(a, m.params), o.push({
540
+ // TODO: Can this as be avoided?
541
+ params: a,
542
+ pathname: P([l, m.pathname]),
543
+ pathnameBase: st(
544
+ P([l, m.pathnameBase])
545
+ ),
546
+ route: f
547
+ }), m.pathnameBase !== "/" && (l = P([l, m.pathnameBase]));
548
+ }
549
+ return o;
550
+ }
551
+ function H(e, r) {
552
+ typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
553
+ let [t, n] = rt(
554
+ e.path,
555
+ e.caseSensitive,
556
+ e.end
557
+ ), a = r.match(t);
558
+ if (!a) return null;
559
+ let l = a[0], o = l.replace(/(.)\/+$/, "$1"), s = a.slice(1);
560
+ return {
561
+ params: n.reduce(
562
+ (c, { paramName: d, isOptional: m }, f) => {
563
+ if (d === "*") {
564
+ let b = s[f] || "";
565
+ o = l.slice(0, l.length - b.length).replace(/(.)\/+$/, "$1");
566
+ }
567
+ const p = s[f];
568
+ return m && !p ? c[d] = void 0 : c[d] = (p || "").replace(/%2F/g, "/"), c;
569
+ },
570
+ {}
571
+ ),
572
+ pathname: l,
573
+ pathnameBase: o,
574
+ pattern: e
575
+ };
576
+ }
577
+ function rt(e, r = !1, t = !0) {
578
+ L(
579
+ e === "*" || !e.endsWith("*") || e.endsWith("/*"),
580
+ `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
581
+ );
582
+ let n = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
583
+ /\/:([\w-]+)(\?)?/g,
584
+ (o, s, i) => (n.push({ paramName: s, isOptional: i != null }), i ? "/?([^\\/]+)?" : "/([^\\/]+)")
585
+ ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
586
+ return e.endsWith("*") ? (n.push({ paramName: "*" }), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, r ? void 0 : "i"), n];
587
+ }
588
+ function nt(e) {
589
+ try {
590
+ return e.split("/").map((r) => decodeURIComponent(r).replace(/\//g, "%2F")).join("/");
591
+ } catch (r) {
592
+ return L(
593
+ !1,
594
+ `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`
595
+ ), e;
596
+ }
597
+ }
598
+ function $(e, r) {
599
+ if (r === "/") return e;
600
+ if (!e.toLowerCase().startsWith(r.toLowerCase()))
601
+ return null;
602
+ let t = r.endsWith("/") ? r.length - 1 : r.length, n = e.charAt(t);
603
+ return n && n !== "/" ? null : e.slice(t) || "/";
604
+ }
605
+ var at = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, lt = (e) => at.test(e);
606
+ function ot(e, r = "/") {
607
+ let {
608
+ pathname: t,
609
+ search: n = "",
610
+ hash: a = ""
611
+ } = typeof e == "string" ? X(e) : e, l;
612
+ if (t)
613
+ if (lt(t))
614
+ l = t;
615
+ else {
616
+ if (t.includes("//")) {
617
+ let o = t;
618
+ t = t.replace(/\/\/+/g, "/"), L(
619
+ !1,
620
+ `Pathnames cannot have embedded double slashes - normalizing ${o} -> ${t}`
621
+ );
622
+ }
623
+ t.startsWith("/") ? l = ue(t.substring(1), "/") : l = ue(t, r);
624
+ }
625
+ else
626
+ l = r;
627
+ return {
628
+ pathname: l,
629
+ search: ut(n),
630
+ hash: ct(a)
631
+ };
632
+ }
633
+ function ue(e, r) {
634
+ let t = r.replace(/\/+$/, "").split("/");
635
+ return e.split("/").forEach((a) => {
636
+ a === ".." ? t.length > 1 && t.pop() : a !== "." && t.push(a);
637
+ }), t.length > 1 ? t.join("/") : "/";
638
+ }
639
+ function G(e, r, t, n) {
640
+ return `Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(
641
+ n
642
+ )}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
643
+ }
644
+ function it(e) {
645
+ return e.filter(
646
+ (r, t) => t === 0 || r.route.path && r.route.path.length > 0
647
+ );
648
+ }
649
+ function xe(e) {
650
+ let r = it(e);
651
+ return r.map(
652
+ (t, n) => n === r.length - 1 ? t.pathname : t.pathnameBase
653
+ );
654
+ }
655
+ function we(e, r, t, n = !1) {
656
+ let a;
657
+ typeof e == "string" ? a = X(e) : (a = { ...e }, k(
658
+ !a.pathname || !a.pathname.includes("?"),
659
+ G("?", "pathname", "search", a)
660
+ ), k(
661
+ !a.pathname || !a.pathname.includes("#"),
662
+ G("#", "pathname", "hash", a)
663
+ ), k(
664
+ !a.search || !a.search.includes("#"),
665
+ G("#", "search", "hash", a)
666
+ ));
667
+ let l = e === "" || a.pathname === "", o = l ? "/" : a.pathname, s;
668
+ if (o == null)
669
+ s = t;
670
+ else {
671
+ let m = r.length - 1;
672
+ if (!n && o.startsWith("..")) {
673
+ let f = o.split("/");
674
+ for (; f[0] === ".."; )
675
+ f.shift(), m -= 1;
676
+ a.pathname = f.join("/");
677
+ }
678
+ s = m >= 0 ? r[m] : "/";
679
+ }
680
+ let i = ot(a, s), c = o && o !== "/" && o.endsWith("/"), d = (l || o === ".") && t.endsWith("/");
681
+ return !i.pathname.endsWith("/") && (c || d) && (i.pathname += "/"), i;
682
+ }
683
+ var P = (e) => e.join("/").replace(/\/\/+/g, "/"), st = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), ut = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, ct = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
684
+ function dt(e) {
685
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
686
+ }
687
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
688
+ var Ce = [
689
+ "POST",
690
+ "PUT",
691
+ "PATCH",
692
+ "DELETE"
693
+ ];
694
+ new Set(
695
+ Ce
696
+ );
697
+ var mt = [
698
+ "GET",
699
+ ...Ce
700
+ ];
701
+ new Set(mt);
702
+ var D = u.createContext(null);
703
+ D.displayName = "DataRouter";
704
+ var z = u.createContext(null);
705
+ z.displayName = "DataRouterState";
706
+ u.createContext(!1);
707
+ var ke = u.createContext({
708
+ isTransitioning: !1
709
+ });
710
+ ke.displayName = "ViewTransition";
711
+ var ft = u.createContext(
712
+ /* @__PURE__ */ new Map()
713
+ );
714
+ ft.displayName = "Fetchers";
715
+ var ht = u.createContext(null);
716
+ ht.displayName = "Await";
717
+ var N = u.createContext(
718
+ null
719
+ );
720
+ N.displayName = "Navigation";
721
+ var Q = u.createContext(
722
+ null
723
+ );
724
+ Q.displayName = "Location";
725
+ var S = u.createContext({
726
+ outlet: null,
727
+ matches: [],
728
+ isDataRoute: !1
729
+ });
730
+ S.displayName = "Route";
731
+ var Z = u.createContext(null);
732
+ Z.displayName = "RouteError";
733
+ function pt(e, { relative: r } = {}) {
734
+ k(
735
+ K(),
736
+ // TODO: This error is probably because they somehow have 2 versions of the
737
+ // router loaded. We can help them understand how to avoid that.
738
+ "useHref() may be used only in the context of a <Router> component."
739
+ );
740
+ let { basename: t, navigator: n } = u.useContext(N), { hash: a, pathname: l, search: o } = M(e, { relative: r }), s = l;
741
+ return t !== "/" && (s = l === "/" ? t : P([t, l])), n.createHref({ pathname: s, search: o, hash: a });
742
+ }
743
+ function K() {
744
+ return u.useContext(Q) != null;
745
+ }
746
+ function F() {
747
+ return k(
748
+ K(),
749
+ // TODO: This error is probably because they somehow have 2 versions of the
750
+ // router loaded. We can help them understand how to avoid that.
751
+ "useLocation() may be used only in the context of a <Router> component."
752
+ ), u.useContext(Q).location;
753
+ }
754
+ var Ee = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
755
+ function Re(e) {
756
+ u.useContext(N).static || u.useLayoutEffect(e);
757
+ }
758
+ function gt() {
759
+ let { isDataRoute: e } = u.useContext(S);
760
+ return e ? St() : bt();
761
+ }
762
+ function bt() {
763
+ k(
764
+ K(),
765
+ // TODO: This error is probably because they somehow have 2 versions of the
766
+ // router loaded. We can help them understand how to avoid that.
767
+ "useNavigate() may be used only in the context of a <Router> component."
768
+ );
769
+ let e = u.useContext(D), { basename: r, navigator: t } = u.useContext(N), { matches: n } = u.useContext(S), { pathname: a } = F(), l = JSON.stringify(xe(n)), o = u.useRef(!1);
770
+ return Re(() => {
771
+ o.current = !0;
772
+ }), u.useCallback(
773
+ (i, c = {}) => {
774
+ if (L(o.current, Ee), !o.current) return;
775
+ if (typeof i == "number") {
776
+ t.go(i);
777
+ return;
778
+ }
779
+ let d = we(
780
+ i,
781
+ JSON.parse(l),
782
+ a,
783
+ c.relative === "path"
784
+ );
785
+ e == null && r !== "/" && (d.pathname = d.pathname === "/" ? r : P([r, d.pathname])), (c.replace ? t.replace : t.push)(
786
+ d,
787
+ c.state,
788
+ c
789
+ );
790
+ },
791
+ [
792
+ r,
793
+ t,
794
+ l,
795
+ a,
796
+ e
797
+ ]
798
+ );
799
+ }
800
+ u.createContext(null);
801
+ function M(e, { relative: r } = {}) {
802
+ let { matches: t } = u.useContext(S), { pathname: n } = F(), a = JSON.stringify(xe(t));
803
+ return u.useMemo(
804
+ () => we(
805
+ e,
806
+ JSON.parse(a),
807
+ n,
808
+ r === "path"
809
+ ),
810
+ [e, a, n, r]
811
+ );
812
+ }
813
+ function yt(e, r, t, n, a) {
814
+ k(
815
+ K(),
816
+ // TODO: This error is probably because they somehow have 2 versions of the
817
+ // router loaded. We can help them understand how to avoid that.
818
+ "useRoutes() may be used only in the context of a <Router> component."
819
+ );
820
+ let { navigator: l } = u.useContext(N), { matches: o } = u.useContext(S), s = o[o.length - 1], i = s ? s.params : {}, c = s ? s.pathname : "/", d = s ? s.pathnameBase : "/", m = s && s.route;
821
+ {
822
+ let v = m && m.path || "";
823
+ Le(
824
+ c,
825
+ !m || v.endsWith("*") || v.endsWith("*?"),
826
+ `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
827
+
828
+ Please change the parent <Route path="${v}"> to <Route path="${v === "/" ? "*" : `${v}/*`}">.`
829
+ );
830
+ }
831
+ let f = F(), p;
832
+ p = f;
833
+ let b = p.pathname || "/", x = b;
834
+ if (d !== "/") {
835
+ let v = d.replace(/^\//, "").split("/");
836
+ x = "/" + b.replace(/^\//, "").split("/").slice(v.length).join("/");
837
+ }
838
+ let h = be(e, { pathname: x });
839
+ return L(
840
+ m || h != null,
841
+ `No routes matched location "${p.pathname}${p.search}${p.hash}" `
842
+ ), L(
843
+ h == null || h[h.length - 1].route.element !== void 0 || h[h.length - 1].route.Component !== void 0 || h[h.length - 1].route.lazy !== void 0,
844
+ `Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
845
+ ), kt(
846
+ h && h.map(
847
+ (v) => Object.assign({}, v, {
848
+ params: Object.assign({}, i, v.params),
849
+ pathname: P([
850
+ d,
851
+ // Re-encode pathnames that were decoded inside matchRoutes.
852
+ // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
853
+ // `new URL()` internally and we need to prevent it from treating
854
+ // them as separators
855
+ l.encodeLocation ? l.encodeLocation(
856
+ v.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
857
+ ).pathname : v.pathname
858
+ ]),
859
+ pathnameBase: v.pathnameBase === "/" ? d : P([
860
+ d,
861
+ // Re-encode pathnames that were decoded inside matchRoutes
862
+ // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
863
+ // `new URL()` internally and we need to prevent it from treating
864
+ // them as separators
865
+ l.encodeLocation ? l.encodeLocation(
866
+ v.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
867
+ ).pathname : v.pathnameBase
868
+ ])
869
+ })
870
+ ),
871
+ o,
872
+ t,
873
+ n,
874
+ a
875
+ );
876
+ }
877
+ function vt() {
878
+ let e = Nt(), r = dt(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), t = e instanceof Error ? e.stack : null, n = "rgba(200,200,200, 0.5)", a = { padding: "0.5rem", backgroundColor: n }, l = { padding: "2px 4px", backgroundColor: n }, o = null;
879
+ return console.error(
880
+ "Error handled by React Router default ErrorBoundary:",
881
+ e
882
+ ), o = /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ u.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ u.createElement("code", { style: l }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ u.createElement("code", { style: l }, "errorElement"), " prop on your route.")), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ u.createElement("h3", { style: { fontStyle: "italic" } }, r), t ? /* @__PURE__ */ u.createElement("pre", { style: a }, t) : null, o);
883
+ }
884
+ var xt = /* @__PURE__ */ u.createElement(vt, null), wt = class extends u.Component {
885
+ constructor(e) {
886
+ super(e), this.state = {
887
+ location: e.location,
888
+ revalidation: e.revalidation,
889
+ error: e.error
890
+ };
891
+ }
892
+ static getDerivedStateFromError(e) {
893
+ return { error: e };
894
+ }
895
+ static getDerivedStateFromProps(e, r) {
896
+ return r.location !== e.location || r.revalidation !== "idle" && e.revalidation === "idle" ? {
897
+ error: e.error,
898
+ location: e.location,
899
+ revalidation: e.revalidation
900
+ } : {
901
+ error: e.error !== void 0 ? e.error : r.error,
902
+ location: r.location,
903
+ revalidation: e.revalidation || r.revalidation
904
+ };
905
+ }
906
+ componentDidCatch(e, r) {
907
+ this.props.onError ? this.props.onError(e, r) : console.error(
908
+ "React Router caught the following error during render",
909
+ e
910
+ );
911
+ }
912
+ render() {
913
+ return this.state.error !== void 0 ? /* @__PURE__ */ u.createElement(S.Provider, { value: this.props.routeContext }, /* @__PURE__ */ u.createElement(
914
+ Z.Provider,
915
+ {
916
+ value: this.state.error,
917
+ children: this.props.component
918
+ }
919
+ )) : this.props.children;
920
+ }
921
+ };
922
+ function Ct({ routeContext: e, match: r, children: t }) {
923
+ let n = u.useContext(D);
924
+ return n && n.static && n.staticContext && (r.route.errorElement || r.route.ErrorBoundary) && (n.staticContext._deepestRenderedBoundaryId = r.route.id), /* @__PURE__ */ u.createElement(S.Provider, { value: e }, t);
925
+ }
926
+ function kt(e, r = [], t = null, n = null, a = null) {
927
+ if (e == null) {
928
+ if (!t)
929
+ return null;
930
+ if (t.errors)
931
+ e = t.matches;
932
+ else if (r.length === 0 && !t.initialized && t.matches.length > 0)
933
+ e = t.matches;
934
+ else
935
+ return null;
936
+ }
937
+ let l = e, o = t?.errors;
938
+ if (o != null) {
939
+ let d = l.findIndex(
940
+ (m) => m.route.id && o?.[m.route.id] !== void 0
941
+ );
942
+ k(
943
+ d >= 0,
944
+ `Could not find a matching route for errors on route IDs: ${Object.keys(
945
+ o
946
+ ).join(",")}`
947
+ ), l = l.slice(
948
+ 0,
949
+ Math.min(l.length, d + 1)
950
+ );
951
+ }
952
+ let s = !1, i = -1;
953
+ if (t)
954
+ for (let d = 0; d < l.length; d++) {
955
+ let m = l[d];
956
+ if ((m.route.HydrateFallback || m.route.hydrateFallbackElement) && (i = d), m.route.id) {
957
+ let { loaderData: f, errors: p } = t, b = m.route.loader && !f.hasOwnProperty(m.route.id) && (!p || p[m.route.id] === void 0);
958
+ if (m.route.lazy || b) {
959
+ s = !0, i >= 0 ? l = l.slice(0, i + 1) : l = [l[0]];
960
+ break;
961
+ }
962
+ }
963
+ }
964
+ let c = t && n ? (d, m) => {
965
+ n(d, {
966
+ location: t.location,
967
+ params: t.matches?.[0]?.params ?? {},
968
+ errorInfo: m
969
+ });
970
+ } : void 0;
971
+ return l.reduceRight(
972
+ (d, m, f) => {
973
+ let p, b = !1, x = null, h = null;
974
+ t && (p = o && m.route.id ? o[m.route.id] : void 0, x = m.route.errorElement || xt, s && (i < 0 && f === 0 ? (Le(
975
+ "route-fallback",
976
+ !1,
977
+ "No `HydrateFallback` element provided to render during initial hydration"
978
+ ), b = !0, h = null) : i === f && (b = !0, h = m.route.hydrateFallbackElement || null)));
979
+ let y = r.concat(l.slice(0, f + 1)), v = () => {
980
+ let w;
981
+ return p ? w = x : b ? w = h : m.route.Component ? w = /* @__PURE__ */ u.createElement(m.route.Component, null) : m.route.element ? w = m.route.element : w = d, /* @__PURE__ */ u.createElement(
982
+ Ct,
983
+ {
984
+ match: m,
985
+ routeContext: {
986
+ outlet: d,
987
+ matches: y,
988
+ isDataRoute: t != null
989
+ },
990
+ children: w
991
+ }
992
+ );
993
+ };
994
+ return t && (m.route.ErrorBoundary || m.route.errorElement || f === 0) ? /* @__PURE__ */ u.createElement(
995
+ wt,
996
+ {
997
+ location: t.location,
998
+ revalidation: t.revalidation,
999
+ component: x,
1000
+ error: p,
1001
+ children: v(),
1002
+ routeContext: { outlet: null, matches: y, isDataRoute: !0 },
1003
+ onError: c
1004
+ }
1005
+ ) : v();
1006
+ },
1007
+ null
1008
+ );
1009
+ }
1010
+ function ee(e) {
1011
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1012
+ }
1013
+ function Et(e) {
1014
+ let r = u.useContext(D);
1015
+ return k(r, ee(e)), r;
1016
+ }
1017
+ function Rt(e) {
1018
+ let r = u.useContext(z);
1019
+ return k(r, ee(e)), r;
1020
+ }
1021
+ function Lt(e) {
1022
+ let r = u.useContext(S);
1023
+ return k(r, ee(e)), r;
1024
+ }
1025
+ function te(e) {
1026
+ let r = Lt(e), t = r.matches[r.matches.length - 1];
1027
+ return k(
1028
+ t.route.id,
1029
+ `${e} can only be used on routes that contain a unique "id"`
1030
+ ), t.route.id;
1031
+ }
1032
+ function Pt() {
1033
+ return te(
1034
+ "useRouteId"
1035
+ /* UseRouteId */
1036
+ );
1037
+ }
1038
+ function Nt() {
1039
+ let e = u.useContext(Z), r = Rt(
1040
+ "useRouteError"
1041
+ /* UseRouteError */
1042
+ ), t = te(
1043
+ "useRouteError"
1044
+ /* UseRouteError */
1045
+ );
1046
+ return e !== void 0 ? e : r.errors?.[t];
1047
+ }
1048
+ function St() {
1049
+ let { router: e } = Et(
1050
+ "useNavigate"
1051
+ /* UseNavigateStable */
1052
+ ), r = te(
1053
+ "useNavigate"
1054
+ /* UseNavigateStable */
1055
+ ), t = u.useRef(!1);
1056
+ return Re(() => {
1057
+ t.current = !0;
1058
+ }), u.useCallback(
1059
+ async (a, l = {}) => {
1060
+ L(t.current, Ee), t.current && (typeof a == "number" ? e.navigate(a) : await e.navigate(a, { fromRouteId: r, ...l }));
1061
+ },
1062
+ [e, r]
1063
+ );
1064
+ }
1065
+ var ce = {};
1066
+ function Le(e, r, t) {
1067
+ !r && !ce[e] && (ce[e] = !0, L(!1, t));
1068
+ }
1069
+ u.memo($t);
1070
+ function $t({
1071
+ routes: e,
1072
+ future: r,
1073
+ state: t,
1074
+ unstable_onError: n
1075
+ }) {
1076
+ return yt(e, void 0, t, n, r);
1077
+ }
1078
+ var _ = "get", j = "application/x-www-form-urlencoded";
1079
+ function J(e) {
1080
+ return e != null && typeof e.tagName == "string";
1081
+ }
1082
+ function At(e) {
1083
+ return J(e) && e.tagName.toLowerCase() === "button";
1084
+ }
1085
+ function Ft(e) {
1086
+ return J(e) && e.tagName.toLowerCase() === "form";
1087
+ }
1088
+ function Tt(e) {
1089
+ return J(e) && e.tagName.toLowerCase() === "input";
1090
+ }
1091
+ function It(e) {
1092
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
1093
+ }
1094
+ function Dt(e, r) {
1095
+ return e.button === 0 && // Ignore everything but left clicks
1096
+ (!r || r === "_self") && // Let browser handle "target=_blank" etc.
1097
+ !It(e);
1098
+ }
1099
+ var V = null;
1100
+ function Ut() {
1101
+ if (V === null)
1102
+ try {
1103
+ new FormData(
1104
+ document.createElement("form"),
1105
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
1106
+ 0
1107
+ ), V = !1;
1108
+ } catch {
1109
+ V = !0;
1110
+ }
1111
+ return V;
1112
+ }
1113
+ var Bt = /* @__PURE__ */ new Set([
1114
+ "application/x-www-form-urlencoded",
1115
+ "multipart/form-data",
1116
+ "text/plain"
1117
+ ]);
1118
+ function Y(e) {
1119
+ return e != null && !Bt.has(e) ? (L(
1120
+ !1,
1121
+ `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${j}"`
1122
+ ), null) : e;
1123
+ }
1124
+ function Mt(e, r) {
1125
+ let t, n, a, l, o;
1126
+ if (Ft(e)) {
1127
+ let s = e.getAttribute("action");
1128
+ n = s ? $(s, r) : null, t = e.getAttribute("method") || _, a = Y(e.getAttribute("enctype")) || j, l = new FormData(e);
1129
+ } else if (At(e) || Tt(e) && (e.type === "submit" || e.type === "image")) {
1130
+ let s = e.form;
1131
+ if (s == null)
1132
+ throw new Error(
1133
+ 'Cannot submit a <button> or <input type="submit"> without a <form>'
1134
+ );
1135
+ let i = e.getAttribute("formaction") || s.getAttribute("action");
1136
+ if (n = i ? $(i, r) : null, t = e.getAttribute("formmethod") || s.getAttribute("method") || _, a = Y(e.getAttribute("formenctype")) || Y(s.getAttribute("enctype")) || j, l = new FormData(s, e), !Ut()) {
1137
+ let { name: c, type: d, value: m } = e;
1138
+ if (d === "image") {
1139
+ let f = c ? `${c}.` : "";
1140
+ l.append(`${f}x`, "0"), l.append(`${f}y`, "0");
1141
+ } else c && l.append(c, m);
1142
+ }
1143
+ } else {
1144
+ if (J(e))
1145
+ throw new Error(
1146
+ 'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
1147
+ );
1148
+ t = _, n = null, a = j, o = e;
1149
+ }
1150
+ return l && a === "text/plain" && (o = l, l = void 0), { action: n, method: t.toLowerCase(), encType: a, formData: l, body: o };
1151
+ }
1152
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1153
+ function re(e, r) {
1154
+ if (e === !1 || e === null || typeof e > "u")
1155
+ throw new Error(r);
1156
+ }
1157
+ function Ot(e, r, t) {
1158
+ let n = typeof e == "string" ? new URL(
1159
+ e,
1160
+ // This can be called during the SSR flow via PrefetchPageLinksImpl so
1161
+ // don't assume window is available
1162
+ typeof window > "u" ? "server://singlefetch/" : window.location.origin
1163
+ ) : e;
1164
+ return n.pathname === "/" ? n.pathname = `_root.${t}` : r && $(n.pathname, r) === "/" ? n.pathname = `${r.replace(/\/$/, "")}/_root.${t}` : n.pathname = `${n.pathname.replace(/\/$/, "")}.${t}`, n;
1165
+ }
1166
+ async function Wt(e, r) {
1167
+ if (e.id in r)
1168
+ return r[e.id];
1169
+ try {
1170
+ let t = await import(
1171
+ /* @vite-ignore */
1172
+ /* webpackIgnore: true */
1173
+ e.module
1174
+ );
1175
+ return r[e.id] = t, t;
1176
+ } catch (t) {
1177
+ return console.error(
1178
+ `Error loading route module \`${e.module}\`, reloading page...`
1179
+ ), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
1180
+ });
1181
+ }
1182
+ }
1183
+ function Vt(e) {
1184
+ return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
1185
+ }
1186
+ async function _t(e, r, t) {
1187
+ let n = await Promise.all(
1188
+ e.map(async (a) => {
1189
+ let l = r.routes[a.route.id];
1190
+ if (l) {
1191
+ let o = await Wt(l, t);
1192
+ return o.links ? o.links() : [];
1193
+ }
1194
+ return [];
1195
+ })
1196
+ );
1197
+ return Kt(
1198
+ n.flat(1).filter(Vt).filter((a) => a.rel === "stylesheet" || a.rel === "preload").map(
1199
+ (a) => a.rel === "stylesheet" ? { ...a, rel: "prefetch", as: "style" } : { ...a, rel: "prefetch" }
1200
+ )
1201
+ );
1202
+ }
1203
+ function de(e, r, t, n, a, l) {
1204
+ let o = (i, c) => t[c] ? i.route.id !== t[c].route.id : !0, s = (i, c) => (
1205
+ // param change, /users/123 -> /users/456
1206
+ t[c].pathname !== i.pathname || // splat param changed, which is not present in match.path
1207
+ // e.g. /files/images/avatar.jpg -> files/finances.xls
1208
+ t[c].route.path?.endsWith("*") && t[c].params["*"] !== i.params["*"]
1209
+ );
1210
+ return l === "assets" ? r.filter(
1211
+ (i, c) => o(i, c) || s(i, c)
1212
+ ) : l === "data" ? r.filter((i, c) => {
1213
+ let d = n.routes[i.route.id];
1214
+ if (!d || !d.hasLoader)
1215
+ return !1;
1216
+ if (o(i, c) || s(i, c))
1217
+ return !0;
1218
+ if (i.route.shouldRevalidate) {
1219
+ let m = i.route.shouldRevalidate({
1220
+ currentUrl: new URL(
1221
+ a.pathname + a.search + a.hash,
1222
+ window.origin
1223
+ ),
1224
+ currentParams: t[0]?.params || {},
1225
+ nextUrl: new URL(e, window.origin),
1226
+ nextParams: i.params,
1227
+ defaultShouldRevalidate: !0
1228
+ });
1229
+ if (typeof m == "boolean")
1230
+ return m;
1231
+ }
1232
+ return !0;
1233
+ }) : [];
1234
+ }
1235
+ function jt(e, r, { includeHydrateFallback: t } = {}) {
1236
+ return Ht(
1237
+ e.map((n) => {
1238
+ let a = r.routes[n.route.id];
1239
+ if (!a) return [];
1240
+ let l = [a.module];
1241
+ return a.clientActionModule && (l = l.concat(a.clientActionModule)), a.clientLoaderModule && (l = l.concat(a.clientLoaderModule)), t && a.hydrateFallbackModule && (l = l.concat(a.hydrateFallbackModule)), a.imports && (l = l.concat(a.imports)), l;
1242
+ }).flat(1)
1243
+ );
1244
+ }
1245
+ function Ht(e) {
1246
+ return [...new Set(e)];
1247
+ }
1248
+ function zt(e) {
1249
+ let r = {}, t = Object.keys(e).sort();
1250
+ for (let n of t)
1251
+ r[n] = e[n];
1252
+ return r;
1253
+ }
1254
+ function Kt(e, r) {
1255
+ let t = /* @__PURE__ */ new Set();
1256
+ return new Set(r), e.reduce((n, a) => {
1257
+ let l = JSON.stringify(zt(a));
1258
+ return t.has(l) || (t.add(l), n.push({ key: l, link: a })), n;
1259
+ }, []);
1260
+ }
1261
+ function Pe() {
1262
+ let e = u.useContext(D);
1263
+ return re(
1264
+ e,
1265
+ "You must render this element inside a <DataRouterContext.Provider> element"
1266
+ ), e;
1267
+ }
1268
+ function Jt() {
1269
+ let e = u.useContext(z);
1270
+ return re(
1271
+ e,
1272
+ "You must render this element inside a <DataRouterStateContext.Provider> element"
1273
+ ), e;
1274
+ }
1275
+ var ne = u.createContext(void 0);
1276
+ ne.displayName = "FrameworkContext";
1277
+ function Ne() {
1278
+ let e = u.useContext(ne);
1279
+ return re(
1280
+ e,
1281
+ "You must render this element inside a <HydratedRouter> element"
1282
+ ), e;
1283
+ }
1284
+ function Gt(e, r) {
1285
+ let t = u.useContext(ne), [n, a] = u.useState(!1), [l, o] = u.useState(!1), { onFocus: s, onBlur: i, onMouseEnter: c, onMouseLeave: d, onTouchStart: m } = r, f = u.useRef(null);
1286
+ u.useEffect(() => {
1287
+ if (e === "render" && o(!0), e === "viewport") {
1288
+ let x = (y) => {
1289
+ y.forEach((v) => {
1290
+ o(v.isIntersecting);
1291
+ });
1292
+ }, h = new IntersectionObserver(x, { threshold: 0.5 });
1293
+ return f.current && h.observe(f.current), () => {
1294
+ h.disconnect();
1295
+ };
1296
+ }
1297
+ }, [e]), u.useEffect(() => {
1298
+ if (n) {
1299
+ let x = setTimeout(() => {
1300
+ o(!0);
1301
+ }, 100);
1302
+ return () => {
1303
+ clearTimeout(x);
1304
+ };
1305
+ }
1306
+ }, [n]);
1307
+ let p = () => {
1308
+ a(!0);
1309
+ }, b = () => {
1310
+ a(!1), o(!1);
1311
+ };
1312
+ return t ? e !== "intent" ? [l, f, {}] : [
1313
+ l,
1314
+ f,
1315
+ {
1316
+ onFocus: B(s, p),
1317
+ onBlur: B(i, b),
1318
+ onMouseEnter: B(c, p),
1319
+ onMouseLeave: B(d, b),
1320
+ onTouchStart: B(m, p)
1321
+ }
1322
+ ] : [!1, f, {}];
1323
+ }
1324
+ function B(e, r) {
1325
+ return (t) => {
1326
+ e && e(t), t.defaultPrevented || r(t);
1327
+ };
1328
+ }
1329
+ function Yt({ page: e, ...r }) {
1330
+ let { router: t } = Pe(), n = u.useMemo(
1331
+ () => be(t.routes, e, t.basename),
1332
+ [t.routes, e, t.basename]
1333
+ );
1334
+ return n ? /* @__PURE__ */ u.createElement(Xt, { page: e, matches: n, ...r }) : null;
1335
+ }
1336
+ function qt(e) {
1337
+ let { manifest: r, routeModules: t } = Ne(), [n, a] = u.useState([]);
1338
+ return u.useEffect(() => {
1339
+ let l = !1;
1340
+ return _t(e, r, t).then(
1341
+ (o) => {
1342
+ l || a(o);
1343
+ }
1344
+ ), () => {
1345
+ l = !0;
1346
+ };
1347
+ }, [e, r, t]), n;
1348
+ }
1349
+ function Xt({
1350
+ page: e,
1351
+ matches: r,
1352
+ ...t
1353
+ }) {
1354
+ let n = F(), { manifest: a, routeModules: l } = Ne(), { basename: o } = Pe(), { loaderData: s, matches: i } = Jt(), c = u.useMemo(
1355
+ () => de(
1356
+ e,
1357
+ r,
1358
+ i,
1359
+ a,
1360
+ n,
1361
+ "data"
1362
+ ),
1363
+ [e, r, i, a, n]
1364
+ ), d = u.useMemo(
1365
+ () => de(
1366
+ e,
1367
+ r,
1368
+ i,
1369
+ a,
1370
+ n,
1371
+ "assets"
1372
+ ),
1373
+ [e, r, i, a, n]
1374
+ ), m = u.useMemo(() => {
1375
+ if (e === n.pathname + n.search + n.hash)
1376
+ return [];
1377
+ let b = /* @__PURE__ */ new Set(), x = !1;
1378
+ if (r.forEach((y) => {
1379
+ let v = a.routes[y.route.id];
1380
+ !v || !v.hasLoader || (!c.some((w) => w.route.id === y.route.id) && y.route.id in s && l[y.route.id]?.shouldRevalidate || v.hasClientLoader ? x = !0 : b.add(y.route.id));
1381
+ }), b.size === 0)
1382
+ return [];
1383
+ let h = Ot(e, o, "data");
1384
+ return x && b.size > 0 && h.searchParams.set(
1385
+ "_routes",
1386
+ r.filter((y) => b.has(y.route.id)).map((y) => y.route.id).join(",")
1387
+ ), [h.pathname + h.search];
1388
+ }, [
1389
+ o,
1390
+ s,
1391
+ n,
1392
+ a,
1393
+ c,
1394
+ r,
1395
+ e,
1396
+ l
1397
+ ]), f = u.useMemo(
1398
+ () => jt(d, a),
1399
+ [d, a]
1400
+ ), p = qt(d);
1401
+ return /* @__PURE__ */ u.createElement(u.Fragment, null, m.map((b) => /* @__PURE__ */ u.createElement("link", { key: b, rel: "prefetch", as: "fetch", href: b, ...t })), f.map((b) => /* @__PURE__ */ u.createElement("link", { key: b, rel: "modulepreload", href: b, ...t })), p.map(({ key: b, link: x }) => (
1402
+ // these don't spread `linkProps` because they are full link descriptors
1403
+ // already with their own props
1404
+ /* @__PURE__ */ u.createElement("link", { key: b, nonce: t.nonce, ...x })
1405
+ )));
1406
+ }
1407
+ function Qt(...e) {
1408
+ return (r) => {
1409
+ e.forEach((t) => {
1410
+ typeof t == "function" ? t(r) : t != null && (t.current = r);
1411
+ });
1412
+ };
1413
+ }
1414
+ var Se = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1415
+ try {
1416
+ Se && (window.__reactRouterVersion = // @ts-expect-error
1417
+ "7.9.6");
1418
+ } catch {
1419
+ }
1420
+ var $e = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ae = u.forwardRef(
1421
+ function({
1422
+ onClick: r,
1423
+ discover: t = "render",
1424
+ prefetch: n = "none",
1425
+ relative: a,
1426
+ reloadDocument: l,
1427
+ replace: o,
1428
+ state: s,
1429
+ target: i,
1430
+ to: c,
1431
+ preventScrollReset: d,
1432
+ viewTransition: m,
1433
+ ...f
1434
+ }, p) {
1435
+ let { basename: b } = u.useContext(N), x = typeof c == "string" && $e.test(c), h, y = !1;
1436
+ if (typeof c == "string" && x && (h = c, Se))
1437
+ try {
1438
+ let R = new URL(window.location.href), I = c.startsWith("//") ? new URL(R.protocol + c) : new URL(c), oe = $(I.pathname, b);
1439
+ I.origin === R.origin && oe != null ? c = oe + I.search + I.hash : y = !0;
1440
+ } catch {
1441
+ L(
1442
+ !1,
1443
+ `<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
1444
+ );
1445
+ }
1446
+ let v = pt(c, { relative: a }), [w, T, A] = Gt(
1447
+ n,
1448
+ f
1449
+ ), O = rr(c, {
1450
+ replace: o,
1451
+ state: s,
1452
+ target: i,
1453
+ preventScrollReset: d,
1454
+ relative: a,
1455
+ viewTransition: m
1456
+ });
1457
+ function U(R) {
1458
+ r && r(R), R.defaultPrevented || O(R);
1459
+ }
1460
+ let W = (
1461
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1462
+ /* @__PURE__ */ u.createElement(
1463
+ "a",
1464
+ {
1465
+ ...f,
1466
+ ...A,
1467
+ href: h || v,
1468
+ onClick: y || l ? r : U,
1469
+ ref: Qt(p, T),
1470
+ target: i,
1471
+ "data-discover": !x && t === "render" ? "true" : void 0
1472
+ }
1473
+ )
1474
+ );
1475
+ return w && !x ? /* @__PURE__ */ u.createElement(u.Fragment, null, W, /* @__PURE__ */ u.createElement(Yt, { page: v })) : W;
1476
+ }
1477
+ );
1478
+ ae.displayName = "Link";
1479
+ var Zt = u.forwardRef(
1480
+ function({
1481
+ "aria-current": r = "page",
1482
+ caseSensitive: t = !1,
1483
+ className: n = "",
1484
+ end: a = !1,
1485
+ style: l,
1486
+ to: o,
1487
+ viewTransition: s,
1488
+ children: i,
1489
+ ...c
1490
+ }, d) {
1491
+ let m = M(o, { relative: c.relative }), f = F(), p = u.useContext(z), { navigator: b, basename: x } = u.useContext(N), h = p != null && // Conditional usage is OK here because the usage of a data router is static
1492
+ // eslint-disable-next-line react-hooks/rules-of-hooks
1493
+ ir(m) && s === !0, y = b.encodeLocation ? b.encodeLocation(m).pathname : m.pathname, v = f.pathname, w = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
1494
+ t || (v = v.toLowerCase(), w = w ? w.toLowerCase() : null, y = y.toLowerCase()), w && x && (w = $(w, x) || w);
1495
+ const T = y !== "/" && y.endsWith("/") ? y.length - 1 : y.length;
1496
+ let A = v === y || !a && v.startsWith(y) && v.charAt(T) === "/", O = w != null && (w === y || !a && w.startsWith(y) && w.charAt(y.length) === "/"), U = {
1497
+ isActive: A,
1498
+ isPending: O,
1499
+ isTransitioning: h
1500
+ }, W = A ? r : void 0, R;
1501
+ typeof n == "function" ? R = n(U) : R = [
1502
+ n,
1503
+ A ? "active" : null,
1504
+ O ? "pending" : null,
1505
+ h ? "transitioning" : null
1506
+ ].filter(Boolean).join(" ");
1507
+ let I = typeof l == "function" ? l(U) : l;
1508
+ return /* @__PURE__ */ u.createElement(
1509
+ ae,
1510
+ {
1511
+ ...c,
1512
+ "aria-current": W,
1513
+ className: R,
1514
+ ref: d,
1515
+ style: I,
1516
+ to: o,
1517
+ viewTransition: s
1518
+ },
1519
+ typeof i == "function" ? i(U) : i
1520
+ );
1521
+ }
1522
+ );
1523
+ Zt.displayName = "NavLink";
1524
+ var er = u.forwardRef(
1525
+ ({
1526
+ discover: e = "render",
1527
+ fetcherKey: r,
1528
+ navigate: t,
1529
+ reloadDocument: n,
1530
+ replace: a,
1531
+ state: l,
1532
+ method: o = _,
1533
+ action: s,
1534
+ onSubmit: i,
1535
+ relative: c,
1536
+ preventScrollReset: d,
1537
+ viewTransition: m,
1538
+ ...f
1539
+ }, p) => {
1540
+ let b = lr(), x = or(s, { relative: c }), h = o.toLowerCase() === "get" ? "get" : "post", y = typeof s == "string" && $e.test(s), v = (w) => {
1541
+ if (i && i(w), w.defaultPrevented) return;
1542
+ w.preventDefault();
1543
+ let T = w.nativeEvent.submitter, A = T?.getAttribute("formmethod") || o;
1544
+ b(T || w.currentTarget, {
1545
+ fetcherKey: r,
1546
+ method: A,
1547
+ navigate: t,
1548
+ replace: a,
1549
+ state: l,
1550
+ relative: c,
1551
+ preventScrollReset: d,
1552
+ viewTransition: m
1553
+ });
1554
+ };
1555
+ return /* @__PURE__ */ u.createElement(
1556
+ "form",
1557
+ {
1558
+ ref: p,
1559
+ method: h,
1560
+ action: x,
1561
+ onSubmit: n ? i : v,
1562
+ ...f,
1563
+ "data-discover": !y && e === "render" ? "true" : void 0
1564
+ }
1565
+ );
1566
+ }
1567
+ );
1568
+ er.displayName = "Form";
1569
+ function tr(e) {
1570
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1571
+ }
1572
+ function Ae(e) {
1573
+ let r = u.useContext(D);
1574
+ return k(r, tr(e)), r;
1575
+ }
1576
+ function rr(e, {
1577
+ target: r,
1578
+ replace: t,
1579
+ state: n,
1580
+ preventScrollReset: a,
1581
+ relative: l,
1582
+ viewTransition: o
1583
+ } = {}) {
1584
+ let s = gt(), i = F(), c = M(e, { relative: l });
1585
+ return u.useCallback(
1586
+ (d) => {
1587
+ if (Dt(d, r)) {
1588
+ d.preventDefault();
1589
+ let m = t !== void 0 ? t : q(i) === q(c);
1590
+ s(e, {
1591
+ replace: m,
1592
+ state: n,
1593
+ preventScrollReset: a,
1594
+ relative: l,
1595
+ viewTransition: o
1596
+ });
1597
+ }
1598
+ },
1599
+ [
1600
+ i,
1601
+ s,
1602
+ c,
1603
+ t,
1604
+ n,
1605
+ r,
1606
+ e,
1607
+ a,
1608
+ l,
1609
+ o
1610
+ ]
1611
+ );
1612
+ }
1613
+ var nr = 0, ar = () => `__${String(++nr)}__`;
1614
+ function lr() {
1615
+ let { router: e } = Ae(
1616
+ "useSubmit"
1617
+ /* UseSubmit */
1618
+ ), { basename: r } = u.useContext(N), t = Pt();
1619
+ return u.useCallback(
1620
+ async (n, a = {}) => {
1621
+ let { action: l, method: o, encType: s, formData: i, body: c } = Mt(
1622
+ n,
1623
+ r
1624
+ );
1625
+ if (a.navigate === !1) {
1626
+ let d = a.fetcherKey || ar();
1627
+ await e.fetch(d, t, a.action || l, {
1628
+ preventScrollReset: a.preventScrollReset,
1629
+ formData: i,
1630
+ body: c,
1631
+ formMethod: a.method || o,
1632
+ formEncType: a.encType || s,
1633
+ flushSync: a.flushSync
1634
+ });
1635
+ } else
1636
+ await e.navigate(a.action || l, {
1637
+ preventScrollReset: a.preventScrollReset,
1638
+ formData: i,
1639
+ body: c,
1640
+ formMethod: a.method || o,
1641
+ formEncType: a.encType || s,
1642
+ replace: a.replace,
1643
+ state: a.state,
1644
+ fromRouteId: t,
1645
+ flushSync: a.flushSync,
1646
+ viewTransition: a.viewTransition
1647
+ });
1648
+ },
1649
+ [e, r, t]
1650
+ );
1651
+ }
1652
+ function or(e, { relative: r } = {}) {
1653
+ let { basename: t } = u.useContext(N), n = u.useContext(S);
1654
+ k(n, "useFormAction must be used inside a RouteContext");
1655
+ let [a] = n.matches.slice(-1), l = { ...M(e || ".", { relative: r }) }, o = F();
1656
+ if (e == null) {
1657
+ l.search = o.search;
1658
+ let s = new URLSearchParams(l.search), i = s.getAll("index");
1659
+ if (i.some((d) => d === "")) {
1660
+ s.delete("index"), i.filter((m) => m).forEach((m) => s.append("index", m));
1661
+ let d = s.toString();
1662
+ l.search = d ? `?${d}` : "";
1663
+ }
1664
+ }
1665
+ return (!e || e === ".") && a.route.index && (l.search = l.search ? l.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (l.pathname = l.pathname === "/" ? t : P([t, l.pathname])), q(l);
1666
+ }
1667
+ function ir(e, { relative: r } = {}) {
1668
+ let t = u.useContext(ke);
1669
+ k(
1670
+ t != null,
1671
+ "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1672
+ );
1673
+ let { basename: n } = Ae(
1674
+ "useViewTransitionState"
1675
+ /* useViewTransitionState */
1676
+ ), a = M(e, { relative: r });
1677
+ if (!t.isTransitioning)
1678
+ return !1;
1679
+ let l = $(t.currentLocation.pathname, n) || t.currentLocation.pathname, o = $(t.nextLocation.pathname, n) || t.nextLocation.pathname;
1680
+ return H(a.pathname, o) != null || H(a.pathname, l) != null;
1681
+ }
1682
+ function Fe(e) {
1683
+ var r, t, n = "";
1684
+ if (typeof e == "string" || typeof e == "number") n += e;
1685
+ else if (typeof e == "object") if (Array.isArray(e)) {
1686
+ var a = e.length;
1687
+ for (r = 0; r < a; r++) e[r] && (t = Fe(e[r])) && (n && (n += " "), n += t);
1688
+ } else for (t in e) e[t] && (n && (n += " "), n += t);
1689
+ return n;
1690
+ }
1691
+ function sr() {
1692
+ for (var e, r, t = 0, n = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (r = Fe(e)) && (n && (n += " "), n += r);
1693
+ return n;
1694
+ }
1695
+ const me = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, fe = sr, le = (e, r) => (t) => {
1696
+ var n;
1697
+ if (r?.variants == null) return fe(e, t?.class, t?.className);
1698
+ const { variants: a, defaultVariants: l } = r, o = Object.keys(a).map((c) => {
1699
+ const d = t?.[c], m = l?.[c];
1700
+ if (d === null) return null;
1701
+ const f = me(d) || me(m);
1702
+ return a[c][f];
1703
+ }), s = t && Object.entries(t).reduce((c, d) => {
1704
+ let [m, f] = d;
1705
+ return f === void 0 || (c[m] = f), c;
1706
+ }, {}), i = r == null || (n = r.compoundVariants) === null || n === void 0 ? void 0 : n.reduce((c, d) => {
1707
+ let { class: m, className: f, ...p } = d;
1708
+ return Object.entries(p).every((b) => {
1709
+ let [x, h] = b;
1710
+ return Array.isArray(h) ? h.includes({
1711
+ ...l,
1712
+ ...s
1713
+ }[x]) : {
1714
+ ...l,
1715
+ ...s
1716
+ }[x] === h;
1717
+ }) ? [
1718
+ ...c,
1719
+ m,
1720
+ f
1721
+ ] : c;
1722
+ }, []);
1723
+ return fe(e, o, i, t?.class, t?.className);
1724
+ }, ur = le("border-b transition-all duration-200", {
1725
+ variants: {
1726
+ variant: {
1727
+ default: "bg-gradient-to-r from-green-100 to-blue-100 dark:from-green-900/20 dark:to-blue-900/20 border-green-200 dark:border-green-700",
1728
+ compact: "bg-green-50 dark:bg-green-900/10 border-green-200 dark:border-green-800",
1729
+ minimal: "bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700",
1730
+ vibrant: "bg-gradient-to-r from-blue-600 to-purple-600 border-blue-700"
1731
+ },
1732
+ size: {
1733
+ default: "py-4",
1734
+ compact: "py-3",
1735
+ large: "py-6"
1736
+ }
1737
+ },
1738
+ defaultVariants: {
1739
+ variant: "default",
1740
+ size: "default"
1741
+ }
1742
+ }), cr = le("font-semibold", {
1743
+ variants: {
1744
+ variant: {
1745
+ default: "text-green-800 dark:text-green-200",
1746
+ compact: "text-green-700 dark:text-green-300",
1747
+ minimal: "text-gray-700 dark:text-gray-300",
1748
+ vibrant: "text-white"
1749
+ }
1750
+ },
1751
+ defaultVariants: {
1752
+ variant: "default"
1753
+ }
1754
+ }), dr = le(
1755
+ "inline-flex items-center justify-center px-6 py-2 rounded-lg font-medium transition-all duration-200 hover:transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-offset-2",
1756
+ {
1757
+ variants: {
1758
+ variant: {
1759
+ default: "bg-gradient-to-r from-green-600 to-blue-600 hover:from-green-700 hover:to-blue-700 text-white focus:ring-green-500",
1760
+ compact: "bg-green-600 hover:bg-green-700 text-white focus:ring-green-500",
1761
+ minimal: "bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500",
1762
+ vibrant: "bg-white hover:bg-gray-100 text-blue-600 hover:text-blue-700 focus:ring-white"
1763
+ }
1764
+ },
1765
+ defaultVariants: {
1766
+ variant: "default"
1767
+ }
1768
+ }
1769
+ ), Rr = ({
1770
+ className: e,
1771
+ variant: r = "default",
1772
+ size: t = "default",
1773
+ message: n = "Get Your Free Email Address - Start Using Web3 Email Today",
1774
+ ctaText: a = "Get Free Email",
1775
+ ctaLink: l = "/connect",
1776
+ showBadge: o = !0,
1777
+ badgeText: s = "FREE",
1778
+ onDismiss: i,
1779
+ isDismissible: c = !1,
1780
+ dismissAriaLabel: d = "Dismiss banner"
1781
+ }) => /* @__PURE__ */ g("div", { className: C(ur({ variant: r, size: t }), e), children: /* @__PURE__ */ g("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ E("div", { className: "flex flex-col sm:flex-row items-center justify-center gap-4 text-center relative", children: [
1782
+ c && i && /* @__PURE__ */ g(
1783
+ "button",
1784
+ {
1785
+ onClick: i,
1786
+ className: "absolute right-0 top-1/2 -translate-y-1/2 p-1 rounded-full hover:bg-black/10 dark:hover:bg-white/10 transition-colors",
1787
+ "aria-label": d,
1788
+ children: /* @__PURE__ */ g(
1789
+ "svg",
1790
+ {
1791
+ className: "w-4 h-4 text-current opacity-60",
1792
+ fill: "none",
1793
+ stroke: "currentColor",
1794
+ viewBox: "0 0 24 24",
1795
+ children: /* @__PURE__ */ g(
1796
+ "path",
1797
+ {
1798
+ strokeLinecap: "round",
1799
+ strokeLinejoin: "round",
1800
+ strokeWidth: 2,
1801
+ d: "M6 18L18 6M6 6l12 12"
1802
+ }
1803
+ )
1804
+ }
1805
+ )
1806
+ }
1807
+ ),
1808
+ /* @__PURE__ */ E("div", { className: "flex items-center", children: [
1809
+ o && /* @__PURE__ */ g(
1810
+ "div",
1811
+ {
1812
+ className: C(
1813
+ "text-xs font-bold px-3 py-1 rounded-full mr-3 transition-colors",
1814
+ r === "vibrant" ? "bg-white text-blue-600" : "bg-green-500 text-white"
1815
+ ),
1816
+ children: s
1817
+ }
1818
+ ),
1819
+ /* @__PURE__ */ g("span", { className: C(cr({ variant: r })), children: n })
1820
+ ] }),
1821
+ /* @__PURE__ */ g(ae, { to: l, className: C(dr({ variant: r })), children: a })
1822
+ ] }) }) }), Lr = ({
1823
+ children: e,
1824
+ required: r,
1825
+ className: t,
1826
+ ...n
1827
+ }) => /* @__PURE__ */ E(
1828
+ "label",
1829
+ {
1830
+ className: C(
1831
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
1832
+ t
1833
+ ),
1834
+ ...n,
1835
+ children: [
1836
+ e,
1837
+ r && /* @__PURE__ */ g("span", { className: "text-red-500 ml-1", children: "*" })
1838
+ ]
1839
+ }
1840
+ ), Pr = ({
1841
+ className: e,
1842
+ children: r,
1843
+ disabled: t
1844
+ }) => /* @__PURE__ */ g(
1845
+ "div",
1846
+ {
1847
+ className: C(
1848
+ "p-4 rounded-lg border transition-colors",
1849
+ "bg-white dark:bg-gray-900",
1850
+ "border-gray-200 dark:border-gray-700",
1851
+ "text-gray-900 dark:text-white",
1852
+ t && "opacity-50 cursor-not-allowed",
1853
+ e
1854
+ ),
1855
+ role: "region",
1856
+ "aria-label": "SubscriberList",
1857
+ children: r || "SubscriberList Component"
1858
+ }
1859
+ ), Nr = ({
1860
+ className: e,
1861
+ children: r,
1862
+ disabled: t = !1,
1863
+ onClick: n
1864
+ }) => /* @__PURE__ */ g(
1865
+ "div",
1866
+ {
1867
+ className: C(
1868
+ "p-4 rounded-lg border transition-colors",
1869
+ "bg-white dark:bg-gray-900",
1870
+ "border-gray-200 dark:border-gray-700",
1871
+ "text-gray-900 dark:text-white",
1872
+ t && "opacity-50 cursor-not-allowed",
1873
+ "hover:bg-gray-50 dark:hover:bg-gray-800",
1874
+ e
1875
+ ),
1876
+ onClick: t ? void 0 : n,
1877
+ role: "region",
1878
+ "aria-label": "UsubscriptionUplan",
1879
+ children: r || "UsubscriptionUplan Component"
1880
+ }
1881
+ );
1882
+ export {
1883
+ br as AbTestEmail,
1884
+ yr as ChainBadge,
1885
+ ie as CollapsibleEmailField,
1886
+ vr as ContactCard,
1887
+ xr as EmailAccountsList,
1888
+ wr as EmailAnalytics,
1889
+ Cr as EmailCampaign,
1890
+ ge as EmailInputField,
1891
+ kr as EmailInputGroup,
1892
+ Rr as FreeEmailBanner,
1893
+ Lr as Label,
1894
+ Pr as SubscriberList,
1895
+ Er as UemailUtemplate,
1896
+ Nr as UsubscriptionUplan
1897
+ };