@solostylist/ui-kit 1.0.153 → 1.0.154

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.
@@ -11,8 +11,6 @@ export interface SErrorLayoutProps {
11
11
  description: string | ReactNode;
12
12
  /** Text for the action button. If not provided, button will not be shown */
13
13
  buttonText?: string;
14
- /** Link destination for the button. Default: '#' */
15
- buttonHref?: string;
16
14
  /** Image width. Default: '200px' */
17
15
  imageWidth?: string | number;
18
16
  /** Image height. Default: 'auto' */
@@ -52,5 +50,5 @@ export interface SErrorLayoutProps {
52
50
  /** Custom content to render instead of the button */
53
51
  customActions?: ReactNode;
54
52
  }
55
- declare function SErrorLayout({ imageSrc, imageAlt, title, description, buttonText, buttonHref, imageWidth, imageHeight, maxWidth, height, py, spacing, titleVariant, descriptionVariant, buttonVariant, buttonColor, containerSx, imageContainerSx, contentSx, titleSx, descriptionSx, buttonContainerSx, buttonProps, hideImage, customActions, }: SErrorLayoutProps): React.JSX.Element;
53
+ declare function SErrorLayout({ imageSrc, imageAlt, title, description, buttonText, imageWidth, imageHeight, maxWidth, height, py, spacing, titleVariant, descriptionVariant, buttonVariant, buttonColor, containerSx, imageContainerSx, contentSx, titleSx, descriptionSx, buttonContainerSx, buttonProps, hideImage, customActions, }: SErrorLayoutProps): React.JSX.Element;
56
54
  export default SErrorLayout;
@@ -1,1324 +1,34 @@
1
- import { j as b } from "../jsx-runtime-OVHDjVDe.js";
2
- import { Box as O, Container as Pe, Stack as le, Typography as oe, Button as Le } from "@mui/material";
3
- import Se from "../s-lazy-image/s-lazy-image.js";
4
- import * as i from "react";
5
- /**
6
- * react-router v7.9.3
7
- *
8
- * Copyright (c) Remix Software Inc.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE.md file in the root directory of this source tree.
12
- *
13
- * @license MIT
14
- */
15
- function C(e, t) {
16
- if (e === !1 || e === null || typeof e > "u")
17
- throw new Error(t);
18
- }
19
- function S(e, t) {
20
- if (!e) {
21
- typeof console < "u" && console.warn(t);
22
- try {
23
- throw new Error(t);
24
- } catch {
25
- }
26
- }
27
- }
28
- function q({
29
- pathname: e = "/",
30
- search: t = "",
31
- hash: n = ""
32
- }) {
33
- return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
34
- }
35
- function G(e) {
36
- let t = {};
37
- if (e) {
38
- let n = e.indexOf("#");
39
- n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
40
- let a = e.indexOf("?");
41
- a >= 0 && (t.search = e.substring(a), e = e.substring(0, a)), e && (t.pathname = e);
42
- }
43
- return t;
44
- }
45
- function ce(e, t, n = "/") {
46
- return ke(e, t, n, !1);
47
- }
48
- function ke(e, t, n, a) {
49
- let r = typeof t == "string" ? G(t) : t, l = F(r.pathname || "/", n);
50
- if (l == null)
51
- return null;
52
- let o = fe(e);
53
- $e(o);
54
- let f = null;
55
- for (let u = 0; f == null && u < o.length; ++u) {
56
- let s = je(l);
57
- f = We(
58
- o[u],
59
- s,
60
- a
61
- );
62
- }
63
- return f;
64
- }
65
- function fe(e, t = [], n = [], a = "", r = !1) {
66
- let l = (o, f, u = r, s) => {
67
- let c = {
68
- relativePath: s === void 0 ? o.path || "" : s,
69
- caseSensitive: o.caseSensitive === !0,
70
- childrenIndex: f,
71
- route: o
72
- };
73
- if (c.relativePath.startsWith("/")) {
74
- if (!c.relativePath.startsWith(a) && u)
75
- return;
76
- C(
77
- c.relativePath.startsWith(a),
78
- `Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
79
- ), c.relativePath = c.relativePath.slice(a.length);
80
- }
81
- let d = L([a, c.relativePath]), h = n.concat(c);
82
- o.children && o.children.length > 0 && (C(
83
- // Our types know better, but runtime JS may not!
84
- // @ts-expect-error
85
- o.index !== !0,
86
- `Index routes must not have child routes. Please remove all child routes from route path "${d}".`
87
- ), fe(
88
- o.children,
89
- t,
90
- h,
91
- d,
92
- u
93
- )), !(o.path == null && !o.index) && t.push({
94
- path: d,
95
- score: Ae(d, o.index),
96
- routesMeta: h
97
- });
98
- };
99
- return e.forEach((o, f) => {
100
- var u;
101
- if (o.path === "" || !((u = o.path) != null && u.includes("?")))
102
- l(o, f);
103
- else
104
- for (let s of de(o.path))
105
- l(o, f, !0, s);
106
- }), t;
107
- }
108
- function de(e) {
109
- let t = e.split("/");
110
- if (t.length === 0) return [];
111
- let [n, ...a] = t, r = n.endsWith("?"), l = n.replace(/\?$/, "");
112
- if (a.length === 0)
113
- return r ? [l, ""] : [l];
114
- let o = de(a.join("/")), f = [];
115
- return f.push(
116
- ...o.map(
117
- (u) => u === "" ? l : [l, u].join("/")
118
- )
119
- ), r && f.push(...o), f.map(
120
- (u) => e.startsWith("/") && u === "" ? "/" : u
121
- );
122
- }
123
- function $e(e) {
124
- e.sort(
125
- (t, n) => t.score !== n.score ? n.score - t.score : Be(
126
- t.routesMeta.map((a) => a.childrenIndex),
127
- n.routesMeta.map((a) => a.childrenIndex)
128
- )
129
- );
130
- }
131
- var Fe = /^:[\w-]+$/, Ie = 3, De = 2, Ne = 1, Te = 10, Me = -2, ie = (e) => e === "*";
132
- function Ae(e, t) {
133
- let n = e.split("/"), a = n.length;
134
- return n.some(ie) && (a += Me), t && (a += De), n.filter((r) => !ie(r)).reduce(
135
- (r, l) => r + (Fe.test(l) ? Ie : l === "" ? Ne : Te),
136
- a
137
- );
138
- }
139
- function Be(e, t) {
140
- return e.length === t.length && e.slice(0, -1).every((a, r) => a === t[r]) ? (
141
- // If two routes are siblings, we should try to match the earlier sibling
142
- // first. This allows people to have fine-grained control over the matching
143
- // behavior by simply putting routes with identical paths in the order they
144
- // want them tried.
145
- e[e.length - 1] - t[t.length - 1]
146
- ) : (
147
- // Otherwise, it doesn't really make sense to rank non-siblings by index,
148
- // so they sort equally.
149
- 0
150
- );
151
- }
152
- function We(e, t, n = !1) {
153
- let { routesMeta: a } = e, r = {}, l = "/", o = [];
154
- for (let f = 0; f < a.length; ++f) {
155
- let u = a[f], s = f === a.length - 1, c = l === "/" ? t : t.slice(l.length) || "/", d = H(
156
- { path: u.relativePath, caseSensitive: u.caseSensitive, end: s },
157
- c
158
- ), h = u.route;
159
- if (!d && s && n && !a[a.length - 1].route.index && (d = H(
160
- {
161
- path: u.relativePath,
162
- caseSensitive: u.caseSensitive,
163
- end: !1
164
- },
165
- c
166
- )), !d)
167
- return null;
168
- Object.assign(r, d.params), o.push({
169
- // TODO: Can this as be avoided?
170
- params: r,
171
- pathname: L([l, d.pathname]),
172
- pathnameBase: ze(
173
- L([l, d.pathnameBase])
174
- ),
175
- route: h
176
- }), d.pathnameBase !== "/" && (l = L([l, d.pathnameBase]));
177
- }
178
- return o;
179
- }
180
- function H(e, t) {
181
- typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
182
- let [n, a] = Oe(
183
- e.path,
184
- e.caseSensitive,
185
- e.end
186
- ), r = t.match(n);
187
- if (!r) return null;
188
- let l = r[0], o = l.replace(/(.)\/+$/, "$1"), f = r.slice(1);
189
- return {
190
- params: a.reduce(
191
- (s, { paramName: c, isOptional: d }, h) => {
192
- if (c === "*") {
193
- let y = f[h] || "";
194
- o = l.slice(0, l.length - y.length).replace(/(.)\/+$/, "$1");
195
- }
196
- const p = f[h];
197
- return d && !p ? s[c] = void 0 : s[c] = (p || "").replace(/%2F/g, "/"), s;
198
- },
199
- {}
200
- ),
201
- pathname: l,
202
- pathnameBase: o,
203
- pattern: e
204
- };
205
- }
206
- function Oe(e, t = !1, n = !0) {
207
- S(
208
- e === "*" || !e.endsWith("*") || e.endsWith("/*"),
209
- `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(/\*$/, "/*")}".`
210
- );
211
- let a = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
212
- /\/:([\w-]+)(\?)?/g,
213
- (o, f, u) => (a.push({ paramName: f, isOptional: u != null }), u ? "/?([^\\/]+)?" : "/([^\\/]+)")
214
- ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
215
- return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, t ? void 0 : "i"), a];
216
- }
217
- function je(e) {
218
- try {
219
- return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
220
- } catch (t) {
221
- return S(
222
- !1,
223
- `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
224
- ), e;
225
- }
226
- }
227
- function F(e, t) {
228
- if (t === "/") return e;
229
- if (!e.toLowerCase().startsWith(t.toLowerCase()))
230
- return null;
231
- let n = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(n);
232
- return a && a !== "/" ? null : e.slice(n) || "/";
233
- }
234
- function Ue(e, t = "/") {
235
- let {
236
- pathname: n,
237
- search: a = "",
238
- hash: r = ""
239
- } = typeof e == "string" ? G(e) : e;
240
- return {
241
- pathname: n ? n.startsWith("/") ? n : _e(n, t) : t,
242
- search: Ve(a),
243
- hash: Je(r)
244
- };
245
- }
246
- function _e(e, t) {
247
- let n = t.replace(/\/+$/, "").split("/");
248
- return e.split("/").forEach((r) => {
249
- r === ".." ? n.length > 1 && n.pop() : r !== "." && n.push(r);
250
- }), n.length > 1 ? n.join("/") : "/";
251
- }
252
- function K(e, t, n, a) {
253
- return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
254
- a
255
- )}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
256
- }
257
- function He(e) {
258
- return e.filter(
259
- (t, n) => n === 0 || t.route.path && t.route.path.length > 0
260
- );
261
- }
262
- function he(e) {
263
- let t = He(e);
264
- return t.map(
265
- (n, a) => a === t.length - 1 ? n.pathname : n.pathnameBase
266
- );
267
- }
268
- function me(e, t, n, a = !1) {
269
- let r;
270
- typeof e == "string" ? r = G(e) : (r = { ...e }, C(
271
- !r.pathname || !r.pathname.includes("?"),
272
- K("?", "pathname", "search", r)
273
- ), C(
274
- !r.pathname || !r.pathname.includes("#"),
275
- K("#", "pathname", "hash", r)
276
- ), C(
277
- !r.search || !r.search.includes("#"),
278
- K("#", "search", "hash", r)
279
- ));
280
- let l = e === "" || r.pathname === "", o = l ? "/" : r.pathname, f;
281
- if (o == null)
282
- f = n;
283
- else {
284
- let d = t.length - 1;
285
- if (!a && o.startsWith("..")) {
286
- let h = o.split("/");
287
- for (; h[0] === ".."; )
288
- h.shift(), d -= 1;
289
- r.pathname = h.join("/");
290
- }
291
- f = d >= 0 ? t[d] : "/";
292
- }
293
- let u = Ue(r, f), s = o && o !== "/" && o.endsWith("/"), c = (l || o === ".") && n.endsWith("/");
294
- return !u.pathname.endsWith("/") && (s || c) && (u.pathname += "/"), u;
295
- }
296
- var L = (e) => e.join("/").replace(/\/\/+/g, "/"), ze = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Ve = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Je = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
297
- function Ke(e) {
298
- return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
299
- }
300
- var pe = [
301
- "POST",
302
- "PUT",
303
- "PATCH",
304
- "DELETE"
305
- ];
306
- new Set(
307
- pe
308
- );
309
- var Ye = [
310
- "GET",
311
- ...pe
312
- ];
313
- new Set(Ye);
314
- var A = i.createContext(null);
315
- A.displayName = "DataRouter";
316
- var z = i.createContext(null);
317
- z.displayName = "DataRouterState";
318
- i.createContext(!1);
319
- var ge = i.createContext({
320
- isTransitioning: !1
321
- });
322
- ge.displayName = "ViewTransition";
323
- var qe = i.createContext(
324
- /* @__PURE__ */ new Map()
325
- );
326
- qe.displayName = "Fetchers";
327
- var Ge = i.createContext(null);
328
- Ge.displayName = "Await";
329
- var k = i.createContext(
330
- null
331
- );
332
- k.displayName = "Navigation";
333
- var X = i.createContext(
334
- null
335
- );
336
- X.displayName = "Location";
337
- var $ = i.createContext({
338
- outlet: null,
339
- matches: [],
340
- isDataRoute: !1
341
- });
342
- $.displayName = "Route";
343
- var Q = i.createContext(null);
344
- Q.displayName = "RouteError";
345
- function Xe(e, { relative: t } = {}) {
346
- C(
347
- V(),
348
- // TODO: This error is probably because they somehow have 2 versions of the
349
- // router loaded. We can help them understand how to avoid that.
350
- "useHref() may be used only in the context of a <Router> component."
351
- );
352
- let { basename: n, navigator: a } = i.useContext(k), { hash: r, pathname: l, search: o } = W(e, { relative: t }), f = l;
353
- return n !== "/" && (f = l === "/" ? n : L([n, l])), a.createHref({ pathname: f, search: o, hash: r });
354
- }
355
- function V() {
356
- return i.useContext(X) != null;
357
- }
358
- function N() {
359
- return C(
360
- V(),
361
- // TODO: This error is probably because they somehow have 2 versions of the
362
- // router loaded. We can help them understand how to avoid that.
363
- "useLocation() may be used only in the context of a <Router> component."
364
- ), i.useContext(X).location;
365
- }
366
- var ye = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
367
- function ve(e) {
368
- i.useContext(k).static || i.useLayoutEffect(e);
369
- }
370
- function Qe() {
371
- let { isDataRoute: e } = i.useContext($);
372
- return e ? ft() : Ze();
373
- }
374
- function Ze() {
375
- C(
376
- V(),
377
- // TODO: This error is probably because they somehow have 2 versions of the
378
- // router loaded. We can help them understand how to avoid that.
379
- "useNavigate() may be used only in the context of a <Router> component."
380
- );
381
- let e = i.useContext(A), { basename: t, navigator: n } = i.useContext(k), { matches: a } = i.useContext($), { pathname: r } = N(), l = JSON.stringify(he(a)), o = i.useRef(!1);
382
- return ve(() => {
383
- o.current = !0;
384
- }), i.useCallback(
385
- (u, s = {}) => {
386
- if (S(o.current, ye), !o.current) return;
387
- if (typeof u == "number") {
388
- n.go(u);
389
- return;
390
- }
391
- let c = me(
392
- u,
393
- JSON.parse(l),
394
- r,
395
- s.relative === "path"
396
- );
397
- e == null && t !== "/" && (c.pathname = c.pathname === "/" ? t : L([t, c.pathname])), (s.replace ? n.replace : n.push)(
398
- c,
399
- s.state,
400
- s
401
- );
402
- },
403
- [
404
- t,
405
- n,
406
- l,
407
- r,
408
- e
409
- ]
410
- );
411
- }
412
- i.createContext(null);
413
- function W(e, { relative: t } = {}) {
414
- let { matches: n } = i.useContext($), { pathname: a } = N(), r = JSON.stringify(he(n));
415
- return i.useMemo(
416
- () => me(
417
- e,
418
- JSON.parse(r),
419
- a,
420
- t === "path"
421
- ),
422
- [e, r, a, t]
423
- );
424
- }
425
- function et(e, t, n, a, r) {
426
- C(
427
- V(),
428
- // TODO: This error is probably because they somehow have 2 versions of the
429
- // router loaded. We can help them understand how to avoid that.
430
- "useRoutes() may be used only in the context of a <Router> component."
431
- );
432
- let { navigator: l } = i.useContext(k), { matches: o } = i.useContext($), f = o[o.length - 1], u = f ? f.params : {}, s = f ? f.pathname : "/", c = f ? f.pathnameBase : "/", d = f && f.route;
433
- {
434
- let m = d && d.path || "";
435
- xe(
436
- s,
437
- !d || m.endsWith("*") || m.endsWith("*?"),
438
- `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${m}">) 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.
439
-
440
- Please change the parent <Route path="${m}"> to <Route path="${m === "/" ? "*" : `${m}/*`}">.`
441
- );
442
- }
443
- let h = N(), p;
444
- p = h;
445
- let y = p.pathname || "/", x = y;
446
- if (c !== "/") {
447
- let m = c.replace(/^\//, "").split("/");
448
- x = "/" + y.replace(/^\//, "").split("/").slice(m.length).join("/");
449
- }
450
- let v = ce(e, { pathname: x });
451
- return S(
452
- d || v != null,
453
- `No routes matched location "${p.pathname}${p.search}${p.hash}" `
454
- ), S(
455
- v == null || v[v.length - 1].route.element !== void 0 || v[v.length - 1].route.Component !== void 0 || v[v.length - 1].route.lazy !== void 0,
456
- `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.`
457
- ), lt(
458
- v && v.map(
459
- (m) => Object.assign({}, m, {
460
- params: Object.assign({}, u, m.params),
461
- pathname: L([
462
- c,
463
- // Re-encode pathnames that were decoded inside matchRoutes.
464
- // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
465
- // `new URL()` internally and we need to prevent it from treating
466
- // them as separators
467
- l.encodeLocation ? l.encodeLocation(
468
- m.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
469
- ).pathname : m.pathname
470
- ]),
471
- pathnameBase: m.pathnameBase === "/" ? c : L([
472
- c,
473
- // Re-encode pathnames that were decoded inside matchRoutes
474
- // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
475
- // `new URL()` internally and we need to prevent it from treating
476
- // them as separators
477
- l.encodeLocation ? l.encodeLocation(
478
- m.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
479
- ).pathname : m.pathnameBase
480
- ])
481
- })
482
- ),
483
- o,
484
- n,
485
- a,
486
- r
487
- );
488
- }
489
- function tt() {
490
- let e = ct(), t = Ke(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, l = { padding: "2px 4px", backgroundColor: a }, o = null;
491
- return console.error(
492
- "Error handled by React Router default ErrorBoundary:",
493
- e
494
- ), o = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ i.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ i.createElement("code", { style: l }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ i.createElement("code", { style: l }, "errorElement"), " prop on your route.")), /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ i.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ i.createElement("pre", { style: r }, n) : null, o);
495
- }
496
- var nt = /* @__PURE__ */ i.createElement(tt, null), rt = class extends i.Component {
497
- constructor(e) {
498
- super(e), this.state = {
499
- location: e.location,
500
- revalidation: e.revalidation,
501
- error: e.error
502
- };
503
- }
504
- static getDerivedStateFromError(e) {
505
- return { error: e };
506
- }
507
- static getDerivedStateFromProps(e, t) {
508
- return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
509
- error: e.error,
510
- location: e.location,
511
- revalidation: e.revalidation
512
- } : {
513
- error: e.error !== void 0 ? e.error : t.error,
514
- location: t.location,
515
- revalidation: e.revalidation || t.revalidation
516
- };
517
- }
518
- componentDidCatch(e, t) {
519
- this.props.unstable_onError ? this.props.unstable_onError(e, t) : console.error(
520
- "React Router caught the following error during render",
521
- e
522
- );
523
- }
524
- render() {
525
- return this.state.error !== void 0 ? /* @__PURE__ */ i.createElement($.Provider, { value: this.props.routeContext }, /* @__PURE__ */ i.createElement(
526
- Q.Provider,
527
- {
528
- value: this.state.error,
529
- children: this.props.component
530
- }
531
- )) : this.props.children;
532
- }
533
- };
534
- function at({ routeContext: e, match: t, children: n }) {
535
- let a = i.useContext(A);
536
- return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ i.createElement($.Provider, { value: e }, n);
537
- }
538
- function lt(e, t = [], n = null, a = null, r = null) {
539
- if (e == null) {
540
- if (!n)
541
- return null;
542
- if (n.errors)
543
- e = n.matches;
544
- else if (t.length === 0 && !n.initialized && n.matches.length > 0)
545
- e = n.matches;
546
- else
547
- return null;
548
- }
549
- let l = e, o = n == null ? void 0 : n.errors;
550
- if (o != null) {
551
- let s = l.findIndex(
552
- (c) => c.route.id && (o == null ? void 0 : o[c.route.id]) !== void 0
553
- );
554
- C(
555
- s >= 0,
556
- `Could not find a matching route for errors on route IDs: ${Object.keys(
557
- o
558
- ).join(",")}`
559
- ), l = l.slice(
560
- 0,
561
- Math.min(l.length, s + 1)
562
- );
563
- }
564
- let f = !1, u = -1;
565
- if (n)
566
- for (let s = 0; s < l.length; s++) {
567
- let c = l[s];
568
- if ((c.route.HydrateFallback || c.route.hydrateFallbackElement) && (u = s), c.route.id) {
569
- let { loaderData: d, errors: h } = n, p = c.route.loader && !d.hasOwnProperty(c.route.id) && (!h || h[c.route.id] === void 0);
570
- if (c.route.lazy || p) {
571
- f = !0, u >= 0 ? l = l.slice(0, u + 1) : l = [l[0]];
572
- break;
573
- }
574
- }
575
- }
576
- return l.reduceRight(
577
- (s, c, d) => {
578
- let h, p = !1, y = null, x = null;
579
- n && (h = o && c.route.id ? o[c.route.id] : void 0, y = c.route.errorElement || nt, f && (u < 0 && d === 0 ? (xe(
580
- "route-fallback",
581
- !1,
582
- "No `HydrateFallback` element provided to render during initial hydration"
583
- ), p = !0, x = null) : u === d && (p = !0, x = c.route.hydrateFallbackElement || null)));
584
- let v = t.concat(l.slice(0, d + 1)), g = () => {
585
- let m;
586
- return h ? m = y : p ? m = x : c.route.Component ? m = /* @__PURE__ */ i.createElement(c.route.Component, null) : c.route.element ? m = c.route.element : m = s, /* @__PURE__ */ i.createElement(
587
- at,
588
- {
589
- match: c,
590
- routeContext: {
591
- outlet: s,
592
- matches: v,
593
- isDataRoute: n != null
594
- },
595
- children: m
596
- }
597
- );
598
- };
599
- return n && (c.route.ErrorBoundary || c.route.errorElement || d === 0) ? /* @__PURE__ */ i.createElement(
600
- rt,
601
- {
602
- location: n.location,
603
- revalidation: n.revalidation,
604
- component: y,
605
- error: h,
606
- children: g(),
607
- routeContext: { outlet: null, matches: v, isDataRoute: !0 },
608
- unstable_onError: a
609
- }
610
- ) : g();
611
- },
612
- null
613
- );
614
- }
615
- function Z(e) {
616
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
617
- }
618
- function ot(e) {
619
- let t = i.useContext(A);
620
- return C(t, Z(e)), t;
621
- }
622
- function it(e) {
623
- let t = i.useContext(z);
624
- return C(t, Z(e)), t;
625
- }
626
- function ut(e) {
627
- let t = i.useContext($);
628
- return C(t, Z(e)), t;
629
- }
630
- function ee(e) {
631
- let t = ut(e), n = t.matches[t.matches.length - 1];
632
- return C(
633
- n.route.id,
634
- `${e} can only be used on routes that contain a unique "id"`
635
- ), n.route.id;
636
- }
637
- function st() {
638
- return ee(
639
- "useRouteId"
640
- /* UseRouteId */
641
- );
642
- }
643
- function ct() {
644
- var a;
645
- let e = i.useContext(Q), t = it(
646
- "useRouteError"
647
- /* UseRouteError */
648
- ), n = ee(
649
- "useRouteError"
650
- /* UseRouteError */
651
- );
652
- return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[n];
653
- }
654
- function ft() {
655
- let { router: e } = ot(
656
- "useNavigate"
657
- /* UseNavigateStable */
658
- ), t = ee(
659
- "useNavigate"
660
- /* UseNavigateStable */
661
- ), n = i.useRef(!1);
662
- return ve(() => {
663
- n.current = !0;
664
- }), i.useCallback(
665
- async (r, l = {}) => {
666
- S(n.current, ye), n.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: t, ...l }));
667
- },
668
- [e, t]
669
- );
670
- }
671
- var ue = {};
672
- function xe(e, t, n) {
673
- !t && !ue[e] && (ue[e] = !0, S(!1, n));
674
- }
675
- i.memo(dt);
676
- function dt({
677
- routes: e,
678
- future: t,
679
- state: n,
680
- unstable_onError: a
681
- }) {
682
- return et(e, void 0, n, a, t);
683
- }
684
- var U = "get", _ = "application/x-www-form-urlencoded";
685
- function J(e) {
686
- return e != null && typeof e.tagName == "string";
687
- }
688
- function ht(e) {
689
- return J(e) && e.tagName.toLowerCase() === "button";
690
- }
691
- function mt(e) {
692
- return J(e) && e.tagName.toLowerCase() === "form";
693
- }
694
- function pt(e) {
695
- return J(e) && e.tagName.toLowerCase() === "input";
696
- }
697
- function gt(e) {
698
- return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
699
- }
700
- function yt(e, t) {
701
- return e.button === 0 && // Ignore everything but left clicks
702
- (!t || t === "_self") && // Let browser handle "target=_blank" etc.
703
- !gt(e);
704
- }
705
- var j = null;
706
- function vt() {
707
- if (j === null)
708
- try {
709
- new FormData(
710
- document.createElement("form"),
711
- // @ts-expect-error if FormData supports the submitter parameter, this will throw
712
- 0
713
- ), j = !1;
714
- } catch {
715
- j = !0;
716
- }
717
- return j;
718
- }
719
- var xt = /* @__PURE__ */ new Set([
720
- "application/x-www-form-urlencoded",
721
- "multipart/form-data",
722
- "text/plain"
723
- ]);
724
- function Y(e) {
725
- return e != null && !xt.has(e) ? (S(
726
- !1,
727
- `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_}"`
728
- ), null) : e;
729
- }
730
- function wt(e, t) {
731
- let n, a, r, l, o;
732
- if (mt(e)) {
733
- let f = e.getAttribute("action");
734
- a = f ? F(f, t) : null, n = e.getAttribute("method") || U, r = Y(e.getAttribute("enctype")) || _, l = new FormData(e);
735
- } else if (ht(e) || pt(e) && (e.type === "submit" || e.type === "image")) {
736
- let f = e.form;
737
- if (f == null)
738
- throw new Error(
739
- 'Cannot submit a <button> or <input type="submit"> without a <form>'
740
- );
741
- let u = e.getAttribute("formaction") || f.getAttribute("action");
742
- if (a = u ? F(u, t) : null, n = e.getAttribute("formmethod") || f.getAttribute("method") || U, r = Y(e.getAttribute("formenctype")) || Y(f.getAttribute("enctype")) || _, l = new FormData(f, e), !vt()) {
743
- let { name: s, type: c, value: d } = e;
744
- if (c === "image") {
745
- let h = s ? `${s}.` : "";
746
- l.append(`${h}x`, "0"), l.append(`${h}y`, "0");
747
- } else s && l.append(s, d);
748
- }
749
- } else {
750
- if (J(e))
751
- throw new Error(
752
- 'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
753
- );
754
- n = U, a = null, r = _, o = e;
755
- }
756
- return l && r === "text/plain" && (o = l, l = void 0), { action: a, method: n.toLowerCase(), encType: r, formData: l, body: o };
757
- }
758
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
759
- function te(e, t) {
760
- if (e === !1 || e === null || typeof e > "u")
761
- throw new Error(t);
762
- }
763
- function Ct(e, t, n) {
764
- let a = typeof e == "string" ? new URL(
765
- e,
766
- // This can be called during the SSR flow via PrefetchPageLinksImpl so
767
- // don't assume window is available
768
- typeof window > "u" ? "server://singlefetch/" : window.location.origin
769
- ) : e;
770
- return a.pathname === "/" ? a.pathname = `_root.${n}` : t && F(a.pathname, t) === "/" ? a.pathname = `${t.replace(/\/$/, "")}/_root.${n}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${n}`, a;
771
- }
772
- async function Et(e, t) {
773
- if (e.id in t)
774
- return t[e.id];
775
- try {
776
- let n = await import(
777
- /* @vite-ignore */
778
- /* webpackIgnore: true */
779
- e.module
780
- );
781
- return t[e.id] = n, n;
782
- } catch (n) {
783
- return console.error(
784
- `Error loading route module \`${e.module}\`, reloading page...`
785
- ), console.error(n), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
786
- });
787
- }
788
- }
789
- function Rt(e) {
790
- 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";
791
- }
792
- async function bt(e, t, n) {
793
- let a = await Promise.all(
794
- e.map(async (r) => {
795
- let l = t.routes[r.route.id];
796
- if (l) {
797
- let o = await Et(l, n);
798
- return o.links ? o.links() : [];
799
- }
800
- return [];
801
- })
802
- );
803
- return kt(
804
- a.flat(1).filter(Rt).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
805
- (r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
806
- )
807
- );
808
- }
809
- function se(e, t, n, a, r, l) {
810
- let o = (u, s) => n[s] ? u.route.id !== n[s].route.id : !0, f = (u, s) => {
811
- var c;
812
- return (
813
- // param change, /users/123 -> /users/456
814
- n[s].pathname !== u.pathname || // splat param changed, which is not present in match.path
815
- // e.g. /files/images/avatar.jpg -> files/finances.xls
816
- ((c = n[s].route.path) == null ? void 0 : c.endsWith("*")) && n[s].params["*"] !== u.params["*"]
817
- );
818
- };
819
- return l === "assets" ? t.filter(
820
- (u, s) => o(u, s) || f(u, s)
821
- ) : l === "data" ? t.filter((u, s) => {
822
- var d;
823
- let c = a.routes[u.route.id];
824
- if (!c || !c.hasLoader)
825
- return !1;
826
- if (o(u, s) || f(u, s))
827
- return !0;
828
- if (u.route.shouldRevalidate) {
829
- let h = u.route.shouldRevalidate({
830
- currentUrl: new URL(
831
- r.pathname + r.search + r.hash,
832
- window.origin
833
- ),
834
- currentParams: ((d = n[0]) == null ? void 0 : d.params) || {},
835
- nextUrl: new URL(e, window.origin),
836
- nextParams: u.params,
837
- defaultShouldRevalidate: !0
838
- });
839
- if (typeof h == "boolean")
840
- return h;
841
- }
842
- return !0;
843
- }) : [];
844
- }
845
- function Pt(e, t, { includeHydrateFallback: n } = {}) {
846
- return Lt(
847
- e.map((a) => {
848
- let r = t.routes[a.route.id];
849
- if (!r) return [];
850
- let l = [r.module];
851
- return r.clientActionModule && (l = l.concat(r.clientActionModule)), r.clientLoaderModule && (l = l.concat(r.clientLoaderModule)), n && r.hydrateFallbackModule && (l = l.concat(r.hydrateFallbackModule)), r.imports && (l = l.concat(r.imports)), l;
852
- }).flat(1)
853
- );
854
- }
855
- function Lt(e) {
856
- return [...new Set(e)];
857
- }
858
- function St(e) {
859
- let t = {}, n = Object.keys(e).sort();
860
- for (let a of n)
861
- t[a] = e[a];
862
- return t;
863
- }
864
- function kt(e, t) {
865
- let n = /* @__PURE__ */ new Set();
866
- return new Set(t), e.reduce((a, r) => {
867
- let l = JSON.stringify(St(r));
868
- return n.has(l) || (n.add(l), a.push({ key: l, link: r })), a;
869
- }, []);
870
- }
871
- function we() {
872
- let e = i.useContext(A);
873
- return te(
874
- e,
875
- "You must render this element inside a <DataRouterContext.Provider> element"
876
- ), e;
877
- }
878
- function $t() {
879
- let e = i.useContext(z);
880
- return te(
881
- e,
882
- "You must render this element inside a <DataRouterStateContext.Provider> element"
883
- ), e;
884
- }
885
- var ne = i.createContext(void 0);
886
- ne.displayName = "FrameworkContext";
887
- function Ce() {
888
- let e = i.useContext(ne);
889
- return te(
890
- e,
891
- "You must render this element inside a <HydratedRouter> element"
892
- ), e;
893
- }
894
- function Ft(e, t) {
895
- let n = i.useContext(ne), [a, r] = i.useState(!1), [l, o] = i.useState(!1), { onFocus: f, onBlur: u, onMouseEnter: s, onMouseLeave: c, onTouchStart: d } = t, h = i.useRef(null);
896
- i.useEffect(() => {
897
- if (e === "render" && o(!0), e === "viewport") {
898
- let x = (g) => {
899
- g.forEach((m) => {
900
- o(m.isIntersecting);
901
- });
902
- }, v = new IntersectionObserver(x, { threshold: 0.5 });
903
- return h.current && v.observe(h.current), () => {
904
- v.disconnect();
905
- };
906
- }
907
- }, [e]), i.useEffect(() => {
908
- if (a) {
909
- let x = setTimeout(() => {
910
- o(!0);
911
- }, 100);
912
- return () => {
913
- clearTimeout(x);
914
- };
915
- }
916
- }, [a]);
917
- let p = () => {
918
- r(!0);
919
- }, y = () => {
920
- r(!1), o(!1);
921
- };
922
- return n ? e !== "intent" ? [l, h, {}] : [
923
- l,
924
- h,
925
- {
926
- onFocus: B(f, p),
927
- onBlur: B(u, y),
928
- onMouseEnter: B(s, p),
929
- onMouseLeave: B(c, y),
930
- onTouchStart: B(d, p)
931
- }
932
- ] : [!1, h, {}];
933
- }
934
- function B(e, t) {
935
- return (n) => {
936
- e && e(n), n.defaultPrevented || t(n);
937
- };
938
- }
939
- function It({ page: e, ...t }) {
940
- let { router: n } = we(), a = i.useMemo(
941
- () => ce(n.routes, e, n.basename),
942
- [n.routes, e, n.basename]
943
- );
944
- return a ? /* @__PURE__ */ i.createElement(Nt, { page: e, matches: a, ...t }) : null;
945
- }
946
- function Dt(e) {
947
- let { manifest: t, routeModules: n } = Ce(), [a, r] = i.useState([]);
948
- return i.useEffect(() => {
949
- let l = !1;
950
- return bt(e, t, n).then(
951
- (o) => {
952
- l || r(o);
953
- }
954
- ), () => {
955
- l = !0;
956
- };
957
- }, [e, t, n]), a;
958
- }
959
- function Nt({
960
- page: e,
961
- matches: t,
962
- ...n
963
- }) {
964
- let a = N(), { manifest: r, routeModules: l } = Ce(), { basename: o } = we(), { loaderData: f, matches: u } = $t(), s = i.useMemo(
965
- () => se(
966
- e,
967
- t,
968
- u,
969
- r,
970
- a,
971
- "data"
972
- ),
973
- [e, t, u, r, a]
974
- ), c = i.useMemo(
975
- () => se(
976
- e,
977
- t,
978
- u,
979
- r,
980
- a,
981
- "assets"
982
- ),
983
- [e, t, u, r, a]
984
- ), d = i.useMemo(() => {
985
- if (e === a.pathname + a.search + a.hash)
986
- return [];
987
- let y = /* @__PURE__ */ new Set(), x = !1;
988
- if (t.forEach((g) => {
989
- var w;
990
- let m = r.routes[g.route.id];
991
- !m || !m.hasLoader || (!s.some((E) => E.route.id === g.route.id) && g.route.id in f && ((w = l[g.route.id]) != null && w.shouldRevalidate) || m.hasClientLoader ? x = !0 : y.add(g.route.id));
992
- }), y.size === 0)
993
- return [];
994
- let v = Ct(e, o, "data");
995
- return x && y.size > 0 && v.searchParams.set(
996
- "_routes",
997
- t.filter((g) => y.has(g.route.id)).map((g) => g.route.id).join(",")
998
- ), [v.pathname + v.search];
999
- }, [
1000
- o,
1001
- f,
1002
- a,
1003
- r,
1004
- s,
1005
- t,
1006
- e,
1007
- l
1008
- ]), h = i.useMemo(
1009
- () => Pt(c, r),
1010
- [c, r]
1011
- ), p = Dt(c);
1012
- return /* @__PURE__ */ i.createElement(i.Fragment, null, d.map((y) => /* @__PURE__ */ i.createElement("link", { key: y, rel: "prefetch", as: "fetch", href: y, ...n })), h.map((y) => /* @__PURE__ */ i.createElement("link", { key: y, rel: "modulepreload", href: y, ...n })), p.map(({ key: y, link: x }) => (
1013
- // these don't spread `linkProps` because they are full link descriptors
1014
- // already with their own props
1015
- /* @__PURE__ */ i.createElement("link", { key: y, nonce: n.nonce, ...x })
1016
- )));
1017
- }
1018
- function Tt(...e) {
1019
- return (t) => {
1020
- e.forEach((n) => {
1021
- typeof n == "function" ? n(t) : n != null && (n.current = t);
1022
- });
1023
- };
1024
- }
1025
- var Ee = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1026
- try {
1027
- Ee && (window.__reactRouterVersion = // @ts-expect-error
1028
- "7.9.3");
1029
- } catch {
1030
- }
1031
- var Re = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, re = i.forwardRef(
1032
- function({
1033
- onClick: t,
1034
- discover: n = "render",
1035
- prefetch: a = "none",
1036
- relative: r,
1037
- reloadDocument: l,
1038
- replace: o,
1039
- state: f,
1040
- target: u,
1041
- to: s,
1042
- preventScrollReset: c,
1043
- viewTransition: d,
1044
- ...h
1045
- }, p) {
1046
- let { basename: y } = i.useContext(k), x = typeof s == "string" && Re.test(s), v, g = !1;
1047
- if (typeof s == "string" && x && (v = s, Ee))
1048
- try {
1049
- let R = new URL(window.location.href), M = s.startsWith("//") ? new URL(R.protocol + s) : new URL(s), ae = F(M.pathname, y);
1050
- M.origin === R.origin && ae != null ? s = ae + M.search + M.hash : g = !0;
1051
- } catch {
1052
- S(
1053
- !1,
1054
- `<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
1055
- );
1056
- }
1057
- let m = Xe(s, { relative: r }), [w, E, P] = Ft(
1058
- a,
1059
- h
1060
- ), T = Wt(s, {
1061
- replace: o,
1062
- state: f,
1063
- target: u,
1064
- preventScrollReset: c,
1065
- relative: r,
1066
- viewTransition: d
1067
- });
1068
- function I(R) {
1069
- t && t(R), R.defaultPrevented || T(R);
1070
- }
1071
- let D = (
1072
- // eslint-disable-next-line jsx-a11y/anchor-has-content
1073
- /* @__PURE__ */ i.createElement(
1074
- "a",
1075
- {
1076
- ...h,
1077
- ...P,
1078
- href: v || m,
1079
- onClick: g || l ? t : I,
1080
- ref: Tt(p, E),
1081
- target: u,
1082
- "data-discover": !x && n === "render" ? "true" : void 0
1083
- }
1084
- )
1085
- );
1086
- return w && !x ? /* @__PURE__ */ i.createElement(i.Fragment, null, D, /* @__PURE__ */ i.createElement(It, { page: m })) : D;
1087
- }
1088
- );
1089
- re.displayName = "Link";
1090
- var Mt = i.forwardRef(
1091
- function({
1092
- "aria-current": t = "page",
1093
- caseSensitive: n = !1,
1094
- className: a = "",
1095
- end: r = !1,
1096
- style: l,
1097
- to: o,
1098
- viewTransition: f,
1099
- children: u,
1100
- ...s
1101
- }, c) {
1102
- let d = W(o, { relative: s.relative }), h = N(), p = i.useContext(z), { navigator: y, basename: x } = i.useContext(k), v = p != null && // Conditional usage is OK here because the usage of a data router is static
1103
- // eslint-disable-next-line react-hooks/rules-of-hooks
1104
- Ht(d) && f === !0, g = y.encodeLocation ? y.encodeLocation(d).pathname : d.pathname, m = h.pathname, w = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
1105
- n || (m = m.toLowerCase(), w = w ? w.toLowerCase() : null, g = g.toLowerCase()), w && x && (w = F(w, x) || w);
1106
- const E = g !== "/" && g.endsWith("/") ? g.length - 1 : g.length;
1107
- let P = m === g || !r && m.startsWith(g) && m.charAt(E) === "/", T = w != null && (w === g || !r && w.startsWith(g) && w.charAt(g.length) === "/"), I = {
1108
- isActive: P,
1109
- isPending: T,
1110
- isTransitioning: v
1111
- }, D = P ? t : void 0, R;
1112
- typeof a == "function" ? R = a(I) : R = [
1113
- a,
1114
- P ? "active" : null,
1115
- T ? "pending" : null,
1116
- v ? "transitioning" : null
1117
- ].filter(Boolean).join(" ");
1118
- let M = typeof l == "function" ? l(I) : l;
1119
- return /* @__PURE__ */ i.createElement(
1120
- re,
1121
- {
1122
- ...s,
1123
- "aria-current": D,
1124
- className: R,
1125
- ref: c,
1126
- style: M,
1127
- to: o,
1128
- viewTransition: f
1129
- },
1130
- typeof u == "function" ? u(I) : u
1131
- );
1132
- }
1133
- );
1134
- Mt.displayName = "NavLink";
1135
- var At = i.forwardRef(
1136
- ({
1137
- discover: e = "render",
1138
- fetcherKey: t,
1139
- navigate: n,
1140
- reloadDocument: a,
1141
- replace: r,
1142
- state: l,
1143
- method: o = U,
1144
- action: f,
1145
- onSubmit: u,
1146
- relative: s,
1147
- preventScrollReset: c,
1148
- viewTransition: d,
1149
- ...h
1150
- }, p) => {
1151
- let y = Ut(), x = _t(f, { relative: s }), v = o.toLowerCase() === "get" ? "get" : "post", g = typeof f == "string" && Re.test(f), m = (w) => {
1152
- if (u && u(w), w.defaultPrevented) return;
1153
- w.preventDefault();
1154
- let E = w.nativeEvent.submitter, P = (E == null ? void 0 : E.getAttribute("formmethod")) || o;
1155
- y(E || w.currentTarget, {
1156
- fetcherKey: t,
1157
- method: P,
1158
- navigate: n,
1159
- replace: r,
1160
- state: l,
1161
- relative: s,
1162
- preventScrollReset: c,
1163
- viewTransition: d
1164
- });
1165
- };
1166
- return /* @__PURE__ */ i.createElement(
1167
- "form",
1168
- {
1169
- ref: p,
1170
- method: v,
1171
- action: x,
1172
- onSubmit: a ? u : m,
1173
- ...h,
1174
- "data-discover": !g && e === "render" ? "true" : void 0
1175
- }
1176
- );
1177
- }
1178
- );
1179
- At.displayName = "Form";
1180
- function Bt(e) {
1181
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1182
- }
1183
- function be(e) {
1184
- let t = i.useContext(A);
1185
- return C(t, Bt(e)), t;
1186
- }
1187
- function Wt(e, {
1188
- target: t,
1189
- replace: n,
1190
- state: a,
1191
- preventScrollReset: r,
1192
- relative: l,
1193
- viewTransition: o
1194
- } = {}) {
1195
- let f = Qe(), u = N(), s = W(e, { relative: l });
1196
- return i.useCallback(
1197
- (c) => {
1198
- if (yt(c, t)) {
1199
- c.preventDefault();
1200
- let d = n !== void 0 ? n : q(u) === q(s);
1201
- f(e, {
1202
- replace: d,
1203
- state: a,
1204
- preventScrollReset: r,
1205
- relative: l,
1206
- viewTransition: o
1207
- });
1208
- }
1209
- },
1210
- [
1211
- u,
1212
- f,
1213
- s,
1214
- n,
1215
- a,
1216
- t,
1217
- e,
1218
- r,
1219
- l,
1220
- o
1221
- ]
1222
- );
1223
- }
1224
- var Ot = 0, jt = () => `__${String(++Ot)}__`;
1225
- function Ut() {
1226
- let { router: e } = be(
1227
- "useSubmit"
1228
- /* UseSubmit */
1229
- ), { basename: t } = i.useContext(k), n = st();
1230
- return i.useCallback(
1231
- async (a, r = {}) => {
1232
- let { action: l, method: o, encType: f, formData: u, body: s } = wt(
1233
- a,
1234
- t
1235
- );
1236
- if (r.navigate === !1) {
1237
- let c = r.fetcherKey || jt();
1238
- await e.fetch(c, n, r.action || l, {
1239
- preventScrollReset: r.preventScrollReset,
1240
- formData: u,
1241
- body: s,
1242
- formMethod: r.method || o,
1243
- formEncType: r.encType || f,
1244
- flushSync: r.flushSync
1245
- });
1246
- } else
1247
- await e.navigate(r.action || l, {
1248
- preventScrollReset: r.preventScrollReset,
1249
- formData: u,
1250
- body: s,
1251
- formMethod: r.method || o,
1252
- formEncType: r.encType || f,
1253
- replace: r.replace,
1254
- state: r.state,
1255
- fromRouteId: n,
1256
- flushSync: r.flushSync,
1257
- viewTransition: r.viewTransition
1258
- });
1259
- },
1260
- [e, t, n]
1261
- );
1262
- }
1263
- function _t(e, { relative: t } = {}) {
1264
- let { basename: n } = i.useContext(k), a = i.useContext($);
1265
- C(a, "useFormAction must be used inside a RouteContext");
1266
- let [r] = a.matches.slice(-1), l = { ...W(e || ".", { relative: t }) }, o = N();
1267
- if (e == null) {
1268
- l.search = o.search;
1269
- let f = new URLSearchParams(l.search), u = f.getAll("index");
1270
- if (u.some((c) => c === "")) {
1271
- f.delete("index"), u.filter((d) => d).forEach((d) => f.append("index", d));
1272
- let c = f.toString();
1273
- l.search = c ? `?${c}` : "";
1274
- }
1275
- }
1276
- return (!e || e === ".") && r.route.index && (l.search = l.search ? l.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (l.pathname = l.pathname === "/" ? n : L([n, l.pathname])), q(l);
1277
- }
1278
- function Ht(e, { relative: t } = {}) {
1279
- let n = i.useContext(ge);
1280
- C(
1281
- n != null,
1282
- "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1283
- );
1284
- let { basename: a } = be(
1285
- "useViewTransitionState"
1286
- /* useViewTransitionState */
1287
- ), r = W(e, { relative: t });
1288
- if (!n.isTransitioning)
1289
- return !1;
1290
- let l = F(n.currentLocation.pathname, a) || n.currentLocation.pathname, o = F(n.nextLocation.pathname, a) || n.nextLocation.pathname;
1291
- return H(r.pathname, o) != null || H(r.pathname, l) != null;
1292
- }
1293
- function Kt({
1294
- imageSrc: e,
1295
- imageAlt: t,
1296
- title: n,
1297
- description: a,
1
+ import { j as e } from "../jsx-runtime-OVHDjVDe.js";
2
+ import { Box as n, Container as w, Stack as s, Typography as l, Button as z } from "@mui/material";
3
+ import D from "../s-lazy-image/s-lazy-image.js";
4
+ function F({
5
+ imageSrc: x,
6
+ imageAlt: a,
7
+ title: o,
8
+ description: c,
1298
9
  buttonText: r,
1299
- buttonHref: l = "#",
1300
- imageWidth: o = "200px",
1301
- imageHeight: f = "auto",
1302
- maxWidth: u = "lg",
1303
- height: s = "100vh",
1304
- py: c = 8,
1305
- spacing: d = 6,
1306
- titleVariant: h = "h4",
1307
- descriptionVariant: p = "body1",
1308
- buttonVariant: y = "contained",
1309
- buttonColor: x = "primary",
1310
- containerSx: v,
1311
- imageContainerSx: g,
1312
- contentSx: m,
1313
- titleSx: w,
1314
- descriptionSx: E,
1315
- buttonContainerSx: P,
1316
- buttonProps: T,
1317
- hideImage: I = !1,
1318
- customActions: D
10
+ imageWidth: d = "200px",
11
+ imageHeight: j = "auto",
12
+ maxWidth: h = "lg",
13
+ height: f = "100vh",
14
+ py: p = 8,
15
+ spacing: y = 6,
16
+ titleVariant: m = "h4",
17
+ descriptionVariant: u = "body1",
18
+ buttonVariant: g = "contained",
19
+ buttonColor: v = "primary",
20
+ containerSx: C,
21
+ imageContainerSx: B,
22
+ contentSx: E,
23
+ titleSx: I,
24
+ descriptionSx: L,
25
+ buttonContainerSx: t,
26
+ buttonProps: S,
27
+ hideImage: k = !1,
28
+ customActions: i
1319
29
  }) {
1320
- return /* @__PURE__ */ b.jsx(
1321
- O,
30
+ return /* @__PURE__ */ e.jsx(
31
+ n,
1322
32
  {
1323
33
  component: "main",
1324
34
  sx: {
@@ -1326,21 +36,21 @@ function Kt({
1326
36
  display: "flex",
1327
37
  flexDirection: "column",
1328
38
  justifyContent: "center",
1329
- py: c,
1330
- height: s,
1331
- ...v
39
+ py: p,
40
+ height: f,
41
+ ...C
1332
42
  },
1333
- children: /* @__PURE__ */ b.jsx(Pe, { maxWidth: u, children: /* @__PURE__ */ b.jsxs(le, { spacing: d, children: [
1334
- !I && /* @__PURE__ */ b.jsx(O, { sx: { display: "flex", justifyContent: "center", ...g }, children: /* @__PURE__ */ b.jsx(Se, { src: e, alt: t, width: o, height: f }) }),
1335
- /* @__PURE__ */ b.jsxs(le, { spacing: 1, sx: { textAlign: "center", ...m }, children: [
1336
- /* @__PURE__ */ b.jsx(oe, { variant: h, sx: w, children: n }),
1337
- /* @__PURE__ */ b.jsx(oe, { variant: p, color: "text.secondary", sx: E, children: a })
43
+ children: /* @__PURE__ */ e.jsx(w, { maxWidth: h, children: /* @__PURE__ */ e.jsxs(s, { spacing: y, children: [
44
+ !k && /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", justifyContent: "center", ...B }, children: /* @__PURE__ */ e.jsx(D, { src: x, alt: a, width: d, height: j }) }),
45
+ /* @__PURE__ */ e.jsxs(s, { spacing: 1, sx: { textAlign: "center", ...E }, children: [
46
+ /* @__PURE__ */ e.jsx(l, { variant: m, sx: I, children: o }),
47
+ /* @__PURE__ */ e.jsx(l, { variant: u, color: "text.secondary", sx: L, children: c })
1338
48
  ] }),
1339
- D ? /* @__PURE__ */ b.jsx(O, { sx: { display: "flex", justifyContent: "center", ...P }, children: D }) : r ? /* @__PURE__ */ b.jsx(O, { sx: { display: "flex", justifyContent: "center", ...P }, children: /* @__PURE__ */ b.jsx(Le, { component: re, to: l, variant: y, color: x, ...T, children: r }) }) : null
49
+ i ? /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", justifyContent: "center", ...t }, children: i }) : r ? /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", justifyContent: "center", ...t }, children: /* @__PURE__ */ e.jsx(z, { variant: g, color: v, ...S, children: r }) }) : null
1340
50
  ] }) })
1341
51
  }
1342
52
  );
1343
53
  }
1344
54
  export {
1345
- Kt as default
55
+ F as default
1346
56
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.153",
6
+ "version": "1.0.154",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",