@krak-stack/registry 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/code-block.js +1 -5
- package/dist/components/ui/copy-button.js +1 -5
- package/dist/components/ui/data-table.js +239 -242
- package/dist/components/ui/editing-locale-switcher.js +1 -5
- package/dist/components/ui/effect-form.js +170 -175
- package/dist/components/ui/error-component.d.ts +30 -0
- package/dist/components/ui/error-component.js +811 -0
- package/dist/components/ui/file-picker.js +1 -5
- package/dist/components/ui/form.js +113 -118
- package/dist/components/ui/google-map.js +1 -5
- package/dist/components/ui/icon-input.js +41 -48
- package/dist/components/ui/loading.js +1 -5
- package/dist/components/ui/locale-switcher.js +1 -5
- package/dist/components/ui/pagination.js +3 -7
- package/dist/components/ui/search-menu.js +1 -5
- package/dist/components/ui/sidebar-layout.js +67 -76
- package/dist/components/ui/stats-card.js +1 -5
- package/dist/components/ui/theme-switcher.js +4 -8
- package/dist/components/ui/virtualized-combobox.js +32 -39
- package/dist/lib/docs.js +134 -143
- package/dist/lib/docs.server.js +24 -49
- package/dist/lib/documentation-toolkit.js +25 -50
- package/dist/lib/httpapi-cli.js +7 -7
- package/dist/lib/httpapi-client.js +3 -3
- package/dist/lib/httpapi-helpers.js +11 -11
- package/dist/lib/httpapi-mcp.js +2 -2
- package/dist/lib/httpapi-toolkit.js +2 -2
- package/dist/lib/query.d.ts +16 -6
- package/dist/lib/query.js +17 -8
- package/dist/lib/seo.js +2 -2
- package/dist/lib/utils.d.ts +1 -2
- package/dist/lib/webfetch-toolkit.js +6 -6
- package/dist/services/agent/client/index.js +130 -133
- package/dist/services/agent/index.d.ts +4 -0
- package/dist/services/agent/index.js +1 -1
- package/dist/services/agent/schema.d.ts +6 -0
- package/dist/services/agent/schema.js +6 -5
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/index.js +9 -9
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +6 -10
- package/dist/services/notification/index.js +2 -2
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +8 -12
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.js +2 -2
- package/package.json +7 -4
|
@@ -0,0 +1,811 @@
|
|
|
1
|
+
// ../../src/components/ui/error-component.tsx
|
|
2
|
+
import {
|
|
3
|
+
Link,
|
|
4
|
+
useRouterState
|
|
5
|
+
} from "@tanstack/react-router";
|
|
6
|
+
import { CircleAlert, RefreshCw } from "lucide-react";
|
|
7
|
+
import { useMemo, useState as useState2 } from "react";
|
|
8
|
+
import { Option, Schema } from "effect";
|
|
9
|
+
import { HttpClientError, HttpTraceContext } from "effect/unstable/http";
|
|
10
|
+
|
|
11
|
+
// ../../src/components/ui/button.tsx
|
|
12
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
|
|
15
|
+
// ../../src/lib/utils.ts
|
|
16
|
+
import { cn } from "cn";
|
|
17
|
+
|
|
18
|
+
// ../../src/components/ui/button.tsx
|
|
19
|
+
import { jsx } from "react/jsx-runtime";
|
|
20
|
+
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
24
|
+
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
25
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
26
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
27
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
28
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
32
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
33
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
34
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
35
|
+
icon: "size-9",
|
|
36
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
37
|
+
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
38
|
+
"icon-lg": "size-10"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "default",
|
|
43
|
+
size: "default"
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
function Button({
|
|
47
|
+
className,
|
|
48
|
+
variant = "default",
|
|
49
|
+
size = "default",
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
53
|
+
"data-slot": "button",
|
|
54
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ../../src/components/ui/copy-button.tsx
|
|
60
|
+
import { Check, Copy, TriangleAlert } from "lucide-react";
|
|
61
|
+
import { useEffect, useRef, useState } from "react";
|
|
62
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
63
|
+
function CopyButton({
|
|
64
|
+
value,
|
|
65
|
+
valueDescription,
|
|
66
|
+
copyVariant = "default",
|
|
67
|
+
messages,
|
|
68
|
+
onCopied,
|
|
69
|
+
onCopyError,
|
|
70
|
+
resetDelay = 1500,
|
|
71
|
+
disabled,
|
|
72
|
+
size,
|
|
73
|
+
"aria-label": ariaLabel,
|
|
74
|
+
...props
|
|
75
|
+
}) {
|
|
76
|
+
const [copyState, setCopyState] = useState("idle");
|
|
77
|
+
const copyTimeout = useRef(undefined);
|
|
78
|
+
const labels = {
|
|
79
|
+
copy: messages?.copy ?? "Copy",
|
|
80
|
+
copied: messages?.copied ?? "Copied",
|
|
81
|
+
copyFailed: messages?.copyFailed ?? "Copy failed"
|
|
82
|
+
};
|
|
83
|
+
const accessibleLabel = ariaLabel ?? (valueDescription ? `${labels.copy} ${valueDescription}` : labels.copy);
|
|
84
|
+
const isLarge = copyVariant === "large";
|
|
85
|
+
const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
return () => {
|
|
88
|
+
if (copyTimeout.current)
|
|
89
|
+
clearTimeout(copyTimeout.current);
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
92
|
+
const resetCopyState = () => {
|
|
93
|
+
if (copyTimeout.current)
|
|
94
|
+
clearTimeout(copyTimeout.current);
|
|
95
|
+
copyTimeout.current = setTimeout(() => setCopyState("idle"), resetDelay);
|
|
96
|
+
};
|
|
97
|
+
const copy = async () => {
|
|
98
|
+
try {
|
|
99
|
+
await navigator.clipboard.writeText(value);
|
|
100
|
+
setCopyState("copied");
|
|
101
|
+
onCopied?.();
|
|
102
|
+
} catch (error) {
|
|
103
|
+
setCopyState("failed");
|
|
104
|
+
onCopyError?.(error instanceof Error ? error : new Error("Copy failed", { cause: error }));
|
|
105
|
+
}
|
|
106
|
+
resetCopyState();
|
|
107
|
+
};
|
|
108
|
+
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
109
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
110
|
+
"aria-label": accessibleLabel,
|
|
111
|
+
disabled,
|
|
112
|
+
onClick: copy,
|
|
113
|
+
size: size ?? defaultSize,
|
|
114
|
+
...props,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx2("span", {
|
|
117
|
+
"aria-live": "polite",
|
|
118
|
+
className: "sr-only",
|
|
119
|
+
role: "status",
|
|
120
|
+
children: status
|
|
121
|
+
}),
|
|
122
|
+
copyState === "copied" ? /* @__PURE__ */ jsx2(Check, {
|
|
123
|
+
"aria-hidden": "true"
|
|
124
|
+
}) : null,
|
|
125
|
+
copyState === "failed" ? /* @__PURE__ */ jsx2(TriangleAlert, {
|
|
126
|
+
"aria-hidden": "true"
|
|
127
|
+
}) : null,
|
|
128
|
+
copyState === "idle" ? /* @__PURE__ */ jsx2(Copy, {
|
|
129
|
+
"aria-hidden": "true"
|
|
130
|
+
}) : null,
|
|
131
|
+
isLarge ? /* @__PURE__ */ jsx2("span", {
|
|
132
|
+
children: labels.copy
|
|
133
|
+
}) : null
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ../../src/components/ui/textarea.tsx
|
|
139
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
140
|
+
function Textarea({ className, ...props }) {
|
|
141
|
+
return /* @__PURE__ */ jsx3("textarea", {
|
|
142
|
+
"data-slot": "textarea",
|
|
143
|
+
className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
144
|
+
...props
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ../../src/components/ui/empty.tsx
|
|
149
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
150
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
151
|
+
function Empty({ className, ...props }) {
|
|
152
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
153
|
+
"data-slot": "empty",
|
|
154
|
+
className: cn("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance", className),
|
|
155
|
+
...props
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function EmptyHeader({ className, ...props }) {
|
|
159
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
160
|
+
"data-slot": "empty-header",
|
|
161
|
+
className: cn("flex max-w-sm flex-col items-center gap-2", className),
|
|
162
|
+
...props
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
var emptyMediaVariants = cva2("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
166
|
+
variants: {
|
|
167
|
+
variant: {
|
|
168
|
+
default: "bg-transparent",
|
|
169
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
defaultVariants: {
|
|
173
|
+
variant: "default"
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
function EmptyMedia({
|
|
177
|
+
className,
|
|
178
|
+
variant = "default",
|
|
179
|
+
...props
|
|
180
|
+
}) {
|
|
181
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
182
|
+
"data-slot": "empty-icon",
|
|
183
|
+
"data-variant": variant,
|
|
184
|
+
className: cn(emptyMediaVariants({ variant, className })),
|
|
185
|
+
...props
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function EmptyTitle({ className, ...props }) {
|
|
189
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
190
|
+
"data-slot": "empty-title",
|
|
191
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
192
|
+
...props
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function EmptyDescription({ className, ...props }) {
|
|
196
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
197
|
+
"data-slot": "empty-description",
|
|
198
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
199
|
+
...props
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function EmptyContent({ className, ...props }) {
|
|
203
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
204
|
+
"data-slot": "empty-content",
|
|
205
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
206
|
+
...props
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ../../src/paraglide/runtime.js
|
|
211
|
+
import"@inlang/paraglide-js/urlpattern-polyfill";
|
|
212
|
+
var baseLocale = "en";
|
|
213
|
+
var locales = ["en", "fr"];
|
|
214
|
+
var cookieName = "locale";
|
|
215
|
+
var cookieMaxAge = 34560000;
|
|
216
|
+
var cookieDomain = "";
|
|
217
|
+
var localStorageKey = "PARAGLIDE_LOCALE";
|
|
218
|
+
var strategy = [
|
|
219
|
+
"url",
|
|
220
|
+
"cookie",
|
|
221
|
+
"preferredLanguage",
|
|
222
|
+
"baseLocale"
|
|
223
|
+
];
|
|
224
|
+
var routeStrategies = [
|
|
225
|
+
{
|
|
226
|
+
match: "/api/:path(.*)?",
|
|
227
|
+
exclude: true
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
match: "/sitemap.xml",
|
|
231
|
+
exclude: true
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
match: "/llms.txt",
|
|
235
|
+
exclude: true
|
|
236
|
+
}
|
|
237
|
+
];
|
|
238
|
+
var urlPatterns = [
|
|
239
|
+
{
|
|
240
|
+
pattern: "/:path(.*)?",
|
|
241
|
+
localized: [
|
|
242
|
+
[
|
|
243
|
+
"en",
|
|
244
|
+
"/en/:path(.*)?"
|
|
245
|
+
],
|
|
246
|
+
[
|
|
247
|
+
"fr",
|
|
248
|
+
"/fr/:path(.*)?"
|
|
249
|
+
]
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
];
|
|
253
|
+
var cachedRouteStrategyUrl;
|
|
254
|
+
var cachedRouteStrategy;
|
|
255
|
+
function findMatchingRouteStrategy(url) {
|
|
256
|
+
if (routeStrategies.length === 0) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const urlString = typeof url === "string" ? url : url.href;
|
|
260
|
+
if (cachedRouteStrategyUrl === urlString) {
|
|
261
|
+
return cachedRouteStrategy;
|
|
262
|
+
}
|
|
263
|
+
const urlObject = new URL(urlString, "http://dummy.com");
|
|
264
|
+
let match;
|
|
265
|
+
for (const routeStrategy of routeStrategies) {
|
|
266
|
+
const pattern = new URLPattern(routeStrategy.match, urlObject.href);
|
|
267
|
+
if (pattern.exec(urlObject.href)) {
|
|
268
|
+
match = routeStrategy;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
cachedRouteStrategyUrl = urlString;
|
|
273
|
+
cachedRouteStrategy = match;
|
|
274
|
+
return match;
|
|
275
|
+
}
|
|
276
|
+
function getStrategyForUrl(url) {
|
|
277
|
+
const routeStrategy = findMatchingRouteStrategy(url);
|
|
278
|
+
if (routeStrategy && routeStrategy.exclude !== true && Array.isArray(routeStrategy.strategy)) {
|
|
279
|
+
return routeStrategy.strategy;
|
|
280
|
+
}
|
|
281
|
+
return strategy;
|
|
282
|
+
}
|
|
283
|
+
var serverAsyncLocalStorage = undefined;
|
|
284
|
+
var isServer = import.meta.env?.SSR ?? typeof window === "undefined";
|
|
285
|
+
var experimentalStaticLocale = undefined;
|
|
286
|
+
var TREE_SHAKE_COOKIE_STRATEGY_USED = true;
|
|
287
|
+
var TREE_SHAKE_URL_STRATEGY_USED = true;
|
|
288
|
+
var TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = false;
|
|
289
|
+
var TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = true;
|
|
290
|
+
var TREE_SHAKE_DEFAULT_URL_PATTERN_USED = false;
|
|
291
|
+
var TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;
|
|
292
|
+
globalThis.__paraglide = globalThis.__paraglide ?? {};
|
|
293
|
+
globalThis.__paraglide.ssr = globalThis.__paraglide.ssr ?? {};
|
|
294
|
+
var _locale;
|
|
295
|
+
var localeInitiallySet = false;
|
|
296
|
+
var getLocale = () => {
|
|
297
|
+
if (experimentalStaticLocale !== undefined) {
|
|
298
|
+
return experimentalStaticLocale;
|
|
299
|
+
}
|
|
300
|
+
if (serverAsyncLocalStorage) {
|
|
301
|
+
const locale = serverAsyncLocalStorage?.getStore()?.locale;
|
|
302
|
+
if (locale) {
|
|
303
|
+
return locale;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
let strategyToUse = strategy;
|
|
307
|
+
if (!isServer && typeof window !== "undefined" && window.location?.href) {
|
|
308
|
+
strategyToUse = getStrategyForUrl(window.location.href);
|
|
309
|
+
}
|
|
310
|
+
const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== "undefined" ? window.location?.href : undefined);
|
|
311
|
+
if (resolved) {
|
|
312
|
+
if (!localeInitiallySet) {
|
|
313
|
+
_locale = resolved;
|
|
314
|
+
localeInitiallySet = true;
|
|
315
|
+
setLocale(resolved, { reload: false });
|
|
316
|
+
}
|
|
317
|
+
return resolved;
|
|
318
|
+
}
|
|
319
|
+
throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
|
|
320
|
+
};
|
|
321
|
+
function resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {
|
|
322
|
+
let locale;
|
|
323
|
+
for (const strat of strategyToUse) {
|
|
324
|
+
if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
325
|
+
locale = extractLocaleFromCookie();
|
|
326
|
+
} else if (strat === "baseLocale") {
|
|
327
|
+
locale = baseLocale;
|
|
328
|
+
} else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && !isServer && typeof urlForUrlStrategy === "string") {
|
|
329
|
+
locale = extractLocaleFromUrl(urlForUrlStrategy);
|
|
330
|
+
} else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable" && _locale !== undefined) {
|
|
331
|
+
locale = _locale;
|
|
332
|
+
} else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED && strat === "preferredLanguage" && !isServer) {
|
|
333
|
+
locale = extractLocaleFromNavigator();
|
|
334
|
+
} else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && !isServer) {
|
|
335
|
+
locale = localStorage.getItem(localStorageKey) ?? undefined;
|
|
336
|
+
} else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
337
|
+
const handler = customClientStrategies.get(strat);
|
|
338
|
+
if (handler) {
|
|
339
|
+
const result = handler.getLocale();
|
|
340
|
+
if (result instanceof Promise) {
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
if (result !== undefined) {
|
|
344
|
+
return assertIsLocale(result);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const matchedLocale = toLocale(locale);
|
|
349
|
+
if (matchedLocale) {
|
|
350
|
+
return matchedLocale;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
var rtlLanguages = new Set([
|
|
356
|
+
"ar",
|
|
357
|
+
"dv",
|
|
358
|
+
"fa",
|
|
359
|
+
"he",
|
|
360
|
+
"ks",
|
|
361
|
+
"ku",
|
|
362
|
+
"ps",
|
|
363
|
+
"sd",
|
|
364
|
+
"ug",
|
|
365
|
+
"ur",
|
|
366
|
+
"yi"
|
|
367
|
+
]);
|
|
368
|
+
var navigateOrReload = (newLocation) => {
|
|
369
|
+
if (newLocation) {
|
|
370
|
+
window.location.href = newLocation;
|
|
371
|
+
} else {
|
|
372
|
+
window.location.reload();
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
var setLocale = (newLocale, options) => {
|
|
376
|
+
const optionsWithDefaults = {
|
|
377
|
+
reload: true,
|
|
378
|
+
...options
|
|
379
|
+
};
|
|
380
|
+
let currentLocale;
|
|
381
|
+
try {
|
|
382
|
+
currentLocale = getLocale();
|
|
383
|
+
} catch {}
|
|
384
|
+
const customSetLocalePromises = [];
|
|
385
|
+
let newLocation = undefined;
|
|
386
|
+
let strategyToUse = strategy;
|
|
387
|
+
if (!isServer && typeof window !== "undefined" && window.location?.href) {
|
|
388
|
+
strategyToUse = getStrategyForUrl(window.location.href);
|
|
389
|
+
}
|
|
390
|
+
for (const strat of strategyToUse) {
|
|
391
|
+
if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable") {
|
|
392
|
+
_locale = newLocale;
|
|
393
|
+
} else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
394
|
+
if (isServer || typeof document === "undefined" || typeof window === "undefined") {
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;
|
|
398
|
+
document.cookie = cookieDomain ? `${cookieString}; domain=${cookieDomain}` : cookieString;
|
|
399
|
+
} else if (strat === "baseLocale") {
|
|
400
|
+
continue;
|
|
401
|
+
} else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && typeof window !== "undefined") {
|
|
402
|
+
newLocation = localizeUrl(window.location.href, {
|
|
403
|
+
locale: newLocale
|
|
404
|
+
}).href;
|
|
405
|
+
} else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && typeof window !== "undefined") {
|
|
406
|
+
localStorage.setItem(localStorageKey, newLocale);
|
|
407
|
+
} else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
408
|
+
const handler = customClientStrategies.get(strat);
|
|
409
|
+
if (handler) {
|
|
410
|
+
let result = handler.setLocale(newLocale);
|
|
411
|
+
if (result instanceof Promise) {
|
|
412
|
+
result = result.catch((error) => {
|
|
413
|
+
throw new Error(`Custom strategy "${strat}" setLocale failed.`, {
|
|
414
|
+
cause: error
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
customSetLocalePromises.push(result);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
const runReload = () => {
|
|
423
|
+
if (!isServer && optionsWithDefaults.reload && window.location && newLocale !== currentLocale) {
|
|
424
|
+
navigateOrReload(newLocation);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
if (customSetLocalePromises.length) {
|
|
428
|
+
return Promise.all(customSetLocalePromises).then(() => {
|
|
429
|
+
runReload();
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
runReload();
|
|
433
|
+
return;
|
|
434
|
+
};
|
|
435
|
+
var getUrlOrigin = () => {
|
|
436
|
+
if (serverAsyncLocalStorage) {
|
|
437
|
+
return serverAsyncLocalStorage.getStore()?.origin ?? "http://fallback.com";
|
|
438
|
+
} else if (typeof window !== "undefined") {
|
|
439
|
+
return window.location.origin;
|
|
440
|
+
}
|
|
441
|
+
return "http://fallback.com";
|
|
442
|
+
};
|
|
443
|
+
function toLocale(value) {
|
|
444
|
+
if (typeof value !== "string") {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const lowerValue = value.toLowerCase();
|
|
448
|
+
for (const locale of locales) {
|
|
449
|
+
if (locale.toLowerCase() === lowerValue) {
|
|
450
|
+
return locale;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
function assertIsLocale(input) {
|
|
456
|
+
const locale = toLocale(input);
|
|
457
|
+
if (locale)
|
|
458
|
+
return locale;
|
|
459
|
+
throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(", ")}`);
|
|
460
|
+
}
|
|
461
|
+
function extractLocaleFromCookie() {
|
|
462
|
+
if (typeof document === "undefined" || !document.cookie) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const match = document.cookie.match(new RegExp(`(^| )${cookieName}=([^;]+)`));
|
|
466
|
+
const locale = match?.[2];
|
|
467
|
+
return toLocale(locale);
|
|
468
|
+
}
|
|
469
|
+
function extractLocaleFromNavigator() {
|
|
470
|
+
if (!navigator?.languages?.length) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const languages = navigator.languages.map((lang) => ({
|
|
474
|
+
fullTag: lang,
|
|
475
|
+
baseTag: lang.split("-")[0]
|
|
476
|
+
}));
|
|
477
|
+
for (const lang of languages) {
|
|
478
|
+
const fullLocale = toLocale(lang.fullTag);
|
|
479
|
+
if (fullLocale) {
|
|
480
|
+
return fullLocale;
|
|
481
|
+
}
|
|
482
|
+
const baseLocale2 = toLocale(lang.baseTag);
|
|
483
|
+
if (baseLocale2) {
|
|
484
|
+
return baseLocale2;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
var cachedUrl;
|
|
490
|
+
var cachedLocale;
|
|
491
|
+
function extractLocaleFromUrl(url) {
|
|
492
|
+
const urlString = typeof url === "string" ? url : url.href;
|
|
493
|
+
if (cachedUrl === urlString) {
|
|
494
|
+
return cachedLocale;
|
|
495
|
+
}
|
|
496
|
+
let result;
|
|
497
|
+
if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
|
|
498
|
+
result = defaultUrlPatternExtractLocale(url);
|
|
499
|
+
} else {
|
|
500
|
+
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
501
|
+
for (const element of urlPatterns) {
|
|
502
|
+
for (const [locale, localizedPattern] of element.localized) {
|
|
503
|
+
const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
|
|
504
|
+
if (match) {
|
|
505
|
+
result = locale;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (result)
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
cachedUrl = urlString;
|
|
514
|
+
cachedLocale = result;
|
|
515
|
+
return result;
|
|
516
|
+
}
|
|
517
|
+
function defaultUrlPatternExtractLocale(url) {
|
|
518
|
+
const urlObj = new URL(url, "http://dummy.com");
|
|
519
|
+
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
520
|
+
return toLocale(pathSegments[0]) || baseLocale;
|
|
521
|
+
}
|
|
522
|
+
function localizeUrl(url, options) {
|
|
523
|
+
const targetLocale = options?.locale ? assertIsLocale(options?.locale) : getLocale();
|
|
524
|
+
if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
|
|
525
|
+
return localizeUrlDefaultPattern(url, targetLocale);
|
|
526
|
+
}
|
|
527
|
+
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
528
|
+
for (const element of urlPatterns) {
|
|
529
|
+
for (const [, localizedPattern] of element.localized) {
|
|
530
|
+
const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
|
|
531
|
+
if (!match) {
|
|
532
|
+
continue;
|
|
533
|
+
}
|
|
534
|
+
const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
|
|
535
|
+
if (!targetPattern) {
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);
|
|
539
|
+
return fillMissingUrlParts(localizedUrl, match);
|
|
540
|
+
}
|
|
541
|
+
const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);
|
|
542
|
+
if (unlocalizedMatch) {
|
|
543
|
+
const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
|
|
544
|
+
if (targetPattern) {
|
|
545
|
+
const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);
|
|
546
|
+
return fillMissingUrlParts(localizedUrl, unlocalizedMatch);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return urlObj;
|
|
551
|
+
}
|
|
552
|
+
function localizeUrlDefaultPattern(url, locale) {
|
|
553
|
+
const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
|
|
554
|
+
const currentLocale = extractLocaleFromUrl(urlObj);
|
|
555
|
+
if (currentLocale === locale) {
|
|
556
|
+
return urlObj;
|
|
557
|
+
}
|
|
558
|
+
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
559
|
+
if (pathSegments.length > 0 && toLocale(pathSegments[0])) {
|
|
560
|
+
pathSegments.shift();
|
|
561
|
+
}
|
|
562
|
+
if (locale === baseLocale) {
|
|
563
|
+
urlObj.pathname = "/" + pathSegments.join("/");
|
|
564
|
+
} else {
|
|
565
|
+
urlObj.pathname = "/" + locale + "/" + pathSegments.join("/");
|
|
566
|
+
}
|
|
567
|
+
return urlObj;
|
|
568
|
+
}
|
|
569
|
+
function fillMissingUrlParts(url, match) {
|
|
570
|
+
if (match.protocol.groups["0"]) {
|
|
571
|
+
url.protocol = match.protocol.groups["0"] ?? "";
|
|
572
|
+
}
|
|
573
|
+
if (match.hostname.groups["0"]) {
|
|
574
|
+
url.hostname = match.hostname.groups["0"] ?? "";
|
|
575
|
+
}
|
|
576
|
+
if (match.username.groups["0"]) {
|
|
577
|
+
url.username = match.username.groups["0"] ?? "";
|
|
578
|
+
}
|
|
579
|
+
if (match.password.groups["0"]) {
|
|
580
|
+
url.password = match.password.groups["0"] ?? "";
|
|
581
|
+
}
|
|
582
|
+
if (match.port.groups["0"]) {
|
|
583
|
+
url.port = match.port.groups["0"] ?? "";
|
|
584
|
+
}
|
|
585
|
+
if (match.pathname.groups["0"]) {
|
|
586
|
+
url.pathname = match.pathname.groups["0"] ?? "";
|
|
587
|
+
}
|
|
588
|
+
if (match.search.groups["0"]) {
|
|
589
|
+
url.search = match.search.groups["0"] ?? "";
|
|
590
|
+
}
|
|
591
|
+
if (match.hash.groups["0"]) {
|
|
592
|
+
url.hash = match.hash.groups["0"] ?? "";
|
|
593
|
+
}
|
|
594
|
+
return url;
|
|
595
|
+
}
|
|
596
|
+
function fillPattern(pattern, values, origin) {
|
|
597
|
+
let processedPattern = pattern.replace(/(https?:\/\/[^:/]+):(\d+)(\/|$)/g, (_, protocol, port, slash) => {
|
|
598
|
+
return `${protocol}#PORT-${port}#${slash}`;
|
|
599
|
+
});
|
|
600
|
+
let processedGroupDelimiters = processedPattern.replace(/\{([^{}]*)\}([?+*]?)/g, (_, content, modifier) => {
|
|
601
|
+
if (modifier === "?") {
|
|
602
|
+
return content;
|
|
603
|
+
}
|
|
604
|
+
return content;
|
|
605
|
+
});
|
|
606
|
+
let filled = processedGroupDelimiters.replace(/(\/?):([a-zA-Z0-9_]+)(\([^)]*\))?([?+*]?)/g, (_, slash, name, __, modifier) => {
|
|
607
|
+
const value = values[name];
|
|
608
|
+
if (value === null) {
|
|
609
|
+
return "";
|
|
610
|
+
}
|
|
611
|
+
if (modifier === "?") {
|
|
612
|
+
return value !== undefined ? `${slash}${value}` : "";
|
|
613
|
+
}
|
|
614
|
+
if (modifier === "+" || modifier === "*") {
|
|
615
|
+
if (value === undefined && modifier === "+") {
|
|
616
|
+
throw new Error(`Missing value for "${name}" (one or more required)`);
|
|
617
|
+
}
|
|
618
|
+
return value ? `${slash}${value}` : "";
|
|
619
|
+
}
|
|
620
|
+
if (value === undefined) {
|
|
621
|
+
throw new Error(`Missing value for "${name}"`);
|
|
622
|
+
}
|
|
623
|
+
return `${slash}${value}`;
|
|
624
|
+
});
|
|
625
|
+
filled = filled.replace(/#PORT-(\d+)#/g, ":$1");
|
|
626
|
+
return new URL(filled, origin);
|
|
627
|
+
}
|
|
628
|
+
function aggregateGroups(match) {
|
|
629
|
+
return {
|
|
630
|
+
...match.hash.groups,
|
|
631
|
+
...match.hostname.groups,
|
|
632
|
+
...match.password.groups,
|
|
633
|
+
...match.pathname.groups,
|
|
634
|
+
...match.port.groups,
|
|
635
|
+
...match.protocol.groups,
|
|
636
|
+
...match.search.groups,
|
|
637
|
+
...match.username.groups
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
var customServerStrategies = new Map;
|
|
641
|
+
var customClientStrategies = new Map;
|
|
642
|
+
function isCustomStrategy(strategy2) {
|
|
643
|
+
return typeof strategy2 === "string" && /^custom-[A-Za-z0-9_-]+$/.test(strategy2);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// ../../src/components/ui/error-component.tsx
|
|
647
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
648
|
+
var TraceId = Schema.String.check(Schema.isPattern(/^(?!0+$)(?:[a-f0-9]{16}|[a-f0-9]{32})$/i)).annotate({ identifier: "ErrorTraceId" });
|
|
649
|
+
var decodeTraceId = Schema.decodeUnknownOption(TraceId);
|
|
650
|
+
var getErrorTraceId = (error) => {
|
|
651
|
+
const visited = new Set;
|
|
652
|
+
let current = error;
|
|
653
|
+
while (current instanceof Error && !visited.has(current)) {
|
|
654
|
+
visited.add(current);
|
|
655
|
+
if (HttpClientError.isHttpClientError(current)) {
|
|
656
|
+
const traceId = HttpTraceContext.fromHeaders(current.request.headers).pipe(Option.flatMap((span) => decodeTraceId(span.traceId)));
|
|
657
|
+
if (Option.isSome(traceId))
|
|
658
|
+
return traceId.value;
|
|
659
|
+
}
|
|
660
|
+
current = current.cause;
|
|
661
|
+
}
|
|
662
|
+
return;
|
|
663
|
+
};
|
|
664
|
+
var defaultMessages = {
|
|
665
|
+
en: {
|
|
666
|
+
title: "Unable to load this page",
|
|
667
|
+
description: "Something went wrong while loading this page. Please try again.",
|
|
668
|
+
retry: "Try again",
|
|
669
|
+
home: "Go to homepage",
|
|
670
|
+
copy: "Copy error details",
|
|
671
|
+
copied: "Error details copied",
|
|
672
|
+
copyFailed: "Copy failed. Select and copy the details below.",
|
|
673
|
+
details: "Error details",
|
|
674
|
+
errorLabel: "Error",
|
|
675
|
+
messageLabel: "Message",
|
|
676
|
+
pageLabel: "Page",
|
|
677
|
+
timeLabel: "Time",
|
|
678
|
+
languageLabel: "Language",
|
|
679
|
+
appLabel: "Application",
|
|
680
|
+
versionLabel: "Version",
|
|
681
|
+
referenceLabel: "Reference"
|
|
682
|
+
},
|
|
683
|
+
fr: {
|
|
684
|
+
title: "Impossible de charger cette page",
|
|
685
|
+
description: "Une erreur est survenue lors du chargement de cette page. Veuillez réessayer.",
|
|
686
|
+
retry: "Réessayer",
|
|
687
|
+
home: "Retour à l'accueil",
|
|
688
|
+
copy: "Copier les détails de l'erreur",
|
|
689
|
+
copied: "Détails de l'erreur copiés",
|
|
690
|
+
copyFailed: "La copie a échoué. Sélectionnez et copiez les détails ci-dessous.",
|
|
691
|
+
details: "Détails de l'erreur",
|
|
692
|
+
errorLabel: "Erreur",
|
|
693
|
+
messageLabel: "Message",
|
|
694
|
+
pageLabel: "Page",
|
|
695
|
+
timeLabel: "Date",
|
|
696
|
+
languageLabel: "Langue",
|
|
697
|
+
appLabel: "Application",
|
|
698
|
+
versionLabel: "Version",
|
|
699
|
+
referenceLabel: "Référence"
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
var ErrorComponent = ({
|
|
703
|
+
error,
|
|
704
|
+
messages,
|
|
705
|
+
retryable = true,
|
|
706
|
+
className,
|
|
707
|
+
diagnostics
|
|
708
|
+
}) => {
|
|
709
|
+
const locale = getLocale();
|
|
710
|
+
const pathname = useRouterState({
|
|
711
|
+
select: (state) => state.location.pathname
|
|
712
|
+
});
|
|
713
|
+
const labels = useMemo(() => ({
|
|
714
|
+
...defaultMessages[locale.startsWith("fr") ? "fr" : "en"],
|
|
715
|
+
...messages
|
|
716
|
+
}), [locale, messages]);
|
|
717
|
+
const reference = diagnostics?.reference ?? getErrorTraceId(error);
|
|
718
|
+
const report = useMemo(() => [
|
|
719
|
+
`${labels.errorLabel}: ${error.name}`,
|
|
720
|
+
`${labels.messageLabel}: ${error.message.trim() || labels.description}`,
|
|
721
|
+
"",
|
|
722
|
+
`${labels.pageLabel}: ${pathname}`,
|
|
723
|
+
`${labels.timeLabel}: ${new Date().toISOString()}`,
|
|
724
|
+
`${labels.languageLabel}: ${locale}`,
|
|
725
|
+
...diagnostics?.app ? [`${labels.appLabel}: ${diagnostics.app}`] : [],
|
|
726
|
+
...diagnostics?.version ? [`${labels.versionLabel}: ${diagnostics.version}`] : [],
|
|
727
|
+
...reference ? [`${labels.referenceLabel}: ${reference}`] : []
|
|
728
|
+
].join(`
|
|
729
|
+
`), [
|
|
730
|
+
error,
|
|
731
|
+
pathname,
|
|
732
|
+
locale,
|
|
733
|
+
labels,
|
|
734
|
+
diagnostics?.app,
|
|
735
|
+
diagnostics?.version,
|
|
736
|
+
reference
|
|
737
|
+
]);
|
|
738
|
+
const [copyResult, setCopyResult] = useState2(null);
|
|
739
|
+
const copyStatus = copyResult?.report === report ? copyResult.status : undefined;
|
|
740
|
+
return /* @__PURE__ */ jsx5("main", {
|
|
741
|
+
className: cn("flex min-h-[60vh] items-center justify-center p-6", className),
|
|
742
|
+
children: /* @__PURE__ */ jsxs2(Empty, {
|
|
743
|
+
children: [
|
|
744
|
+
/* @__PURE__ */ jsxs2(EmptyHeader, {
|
|
745
|
+
children: [
|
|
746
|
+
/* @__PURE__ */ jsx5(EmptyMedia, {
|
|
747
|
+
variant: "icon",
|
|
748
|
+
children: /* @__PURE__ */ jsx5(CircleAlert, {})
|
|
749
|
+
}),
|
|
750
|
+
/* @__PURE__ */ jsx5(EmptyTitle, {
|
|
751
|
+
children: /* @__PURE__ */ jsx5("h1", {
|
|
752
|
+
children: labels.title
|
|
753
|
+
})
|
|
754
|
+
}),
|
|
755
|
+
/* @__PURE__ */ jsx5(EmptyDescription, {
|
|
756
|
+
children: error.message.trim() || labels.description
|
|
757
|
+
})
|
|
758
|
+
]
|
|
759
|
+
}),
|
|
760
|
+
/* @__PURE__ */ jsxs2(EmptyContent, {
|
|
761
|
+
children: [
|
|
762
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
763
|
+
className: "flex flex-wrap justify-center gap-2",
|
|
764
|
+
children: [
|
|
765
|
+
retryable && /* @__PURE__ */ jsxs2(Button, {
|
|
766
|
+
onClick: () => window.location.reload(),
|
|
767
|
+
children: [
|
|
768
|
+
/* @__PURE__ */ jsx5(RefreshCw, {
|
|
769
|
+
"data-icon": "inline-start"
|
|
770
|
+
}),
|
|
771
|
+
labels.retry
|
|
772
|
+
]
|
|
773
|
+
}),
|
|
774
|
+
/* @__PURE__ */ jsx5(Link, {
|
|
775
|
+
to: "/",
|
|
776
|
+
className: buttonVariants({ variant: "outline" }),
|
|
777
|
+
children: labels.home
|
|
778
|
+
})
|
|
779
|
+
]
|
|
780
|
+
}),
|
|
781
|
+
/* @__PURE__ */ jsx5(CopyButton, {
|
|
782
|
+
value: report,
|
|
783
|
+
copyVariant: "large",
|
|
784
|
+
variant: "link",
|
|
785
|
+
messages: {
|
|
786
|
+
copy: labels.copy,
|
|
787
|
+
copied: labels.copied,
|
|
788
|
+
copyFailed: labels.copyFailed
|
|
789
|
+
},
|
|
790
|
+
onCopied: () => setCopyResult({ report, status: "copied" }),
|
|
791
|
+
onCopyError: () => setCopyResult({ report, status: "failed" })
|
|
792
|
+
}),
|
|
793
|
+
copyStatus === "failed" && /* @__PURE__ */ jsx5("p", {
|
|
794
|
+
children: labels.copyFailed
|
|
795
|
+
}),
|
|
796
|
+
copyStatus === "failed" && /* @__PURE__ */ jsx5(Textarea, {
|
|
797
|
+
"aria-label": labels.details,
|
|
798
|
+
readOnly: true,
|
|
799
|
+
value: report,
|
|
800
|
+
rows: 10,
|
|
801
|
+
onFocus: (event) => event.currentTarget.select()
|
|
802
|
+
})
|
|
803
|
+
]
|
|
804
|
+
})
|
|
805
|
+
]
|
|
806
|
+
})
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
export {
|
|
810
|
+
ErrorComponent
|
|
811
|
+
};
|