@igstack/app-catalog-frontend-core 6.1.2 → 6.1.3-alpha-20260925194417

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.
Files changed (51) hide show
  1. package/dist/esm/modules/appCatalog/context/AppCatalogContext.js +2 -1
  2. package/dist/esm/modules/appCatalog/context/AppCatalogContext.js.map +1 -1
  3. package/dist/esm/modules/appCatalog/ui/components/PersonBadge.js +2 -1
  4. package/dist/esm/modules/appCatalog/ui/components/PersonBadge.js.map +1 -1
  5. package/dist/esm/modules/appCatalog/ui/components/TierVariantsSection.js +2 -1
  6. package/dist/esm/modules/appCatalog/ui/components/TierVariantsSection.js.map +1 -1
  7. package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js +1 -0
  8. package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js.map +1 -1
  9. package/dist/esm/modules/appCatalog/ui/pages/AppCatalogPage.js +8 -4
  10. package/dist/esm/modules/appCatalog/ui/pages/AppCatalogPage.js.map +1 -1
  11. package/dist/esm/routes/__root.js +2 -5
  12. package/dist/esm/routes/__root.js.map +1 -1
  13. package/dist/esm/ui/components/error/BaseErrorPage.js +2 -4
  14. package/dist/esm/ui/components/error/BaseErrorPage.js.map +1 -1
  15. package/dist/esm/ui/components/header/Header.js +1 -0
  16. package/dist/esm/ui/components/header/Header.js.map +1 -1
  17. package/dist/esm/ui/layout/Devtools.d.ts +4 -0
  18. package/dist/esm/ui/layout/Devtools.js +9 -0
  19. package/dist/esm/ui/layout/Devtools.js.map +1 -0
  20. package/dist/esm/ui/layout/DevtoolsPanels.d.ts +4 -0
  21. package/dist/esm/ui/layout/TopLevelProviders.js +2 -10
  22. package/dist/esm/ui/layout/TopLevelProviders.js.map +1 -1
  23. package/package.json +4 -4
  24. package/src/modules/appCatalog/ui/pages/AppCatalogPage.tsx +18 -9
  25. package/src/routes/__root.tsx +0 -2
  26. package/src/ui/components/error/BaseErrorPage.tsx +2 -4
  27. package/src/ui/layout/Devtools.tsx +17 -0
  28. package/src/ui/layout/DevtoolsPanels.tsx +12 -0
  29. package/src/ui/layout/TopLevelProviders.tsx +2 -7
  30. package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtools.js +0 -72
  31. package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtools.js.map +0 -1
  32. package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtoolsPanel.js +0 -44
  33. package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtoolsPanel.js.map +0 -1
  34. package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/index.js +0 -12
  35. package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/index.js.map +0 -1
  36. package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js +0 -95
  37. package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js.map +0 -1
  38. package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/path.js +0 -107
  39. package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/path.js.map +0 -1
  40. package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/root.js +0 -5
  41. package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/root.js.map +0 -1
  42. package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/BaseTanStackRouterDevtoolsPanel-DxaCaP75.js +0 -1963
  43. package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/BaseTanStackRouterDevtoolsPanel-DxaCaP75.js.map +0 -1
  44. package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/FloatingTanStackRouterDevtools-CaypUmOS.js +0 -284
  45. package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/FloatingTanStackRouterDevtools-CaypUmOS.js.map +0 -1
  46. package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/index-5jfj03XJ.js +0 -1855
  47. package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/index-5jfj03XJ.js.map +0 -1
  48. package/dist/esm/node_modules/.pnpm/goober@2.1.18_csstype@3.2.3/node_modules/goober/dist/goober.modern.js +0 -56
  49. package/dist/esm/node_modules/.pnpm/goober@2.1.18_csstype@3.2.3/node_modules/goober/dist/goober.modern.js.map +0 -1
  50. package/dist/esm/node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +0 -17
  51. package/dist/esm/node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js.map +0 -1
@@ -1,1963 +0,0 @@
1
- import { a as createSignal, b as createEffect, g as createRenderEffect, u as useContext, n as useDevtoolsOnClose, p as untrack, d as createMemo, t as template, f as spread, m as mergeProps, i as insert, o as addEventListener, h as className, e as createComponent, l as memo, M as Match, s as setAttribute, F as For, q as Switch, v as Show, r as onCleanup, S as ShadowDomTargetContext, k as delegateEvents } from "./index-5jfj03XJ.js";
2
- import { clsx } from "clsx";
3
- import invariant from "../../../../../tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js";
4
- import { trimPath, interpolatePath } from "../../../../../@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/path.js";
5
- import { rootRouteId } from "../../../../../@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/root.js";
6
- import { css as u } from "../../../../../goober@2.1.18_csstype@3.2.3/node_modules/goober/dist/goober.modern.js";
7
- const isServer = typeof window === "undefined";
8
- function getStatusColor(match) {
9
- const colorMap = {
10
- pending: "yellow",
11
- success: "green",
12
- error: "red",
13
- notFound: "purple",
14
- redirected: "gray"
15
- };
16
- return match.isFetching && match.status === "success" ? match.isFetching === "beforeLoad" ? "purple" : "blue" : colorMap[match.status];
17
- }
18
- function getRouteStatusColor(matches, route) {
19
- const found = matches.find((d) => d.routeId === route.id);
20
- if (!found) return "gray";
21
- return getStatusColor(found);
22
- }
23
- function useIsMounted() {
24
- const [isMounted, setIsMounted] = createSignal(false);
25
- const effect = isServer ? createEffect : createRenderEffect;
26
- effect(() => {
27
- setIsMounted(true);
28
- });
29
- return isMounted;
30
- }
31
- const displayValue = (value) => {
32
- const name = Object.getOwnPropertyNames(Object(value));
33
- const newValue = typeof value === "bigint" ? `${value.toString()}n` : value;
34
- try {
35
- return JSON.stringify(newValue, name);
36
- } catch (e) {
37
- return `unable to stringify`;
38
- }
39
- };
40
- function multiSortBy(arr, accessors = [(d) => d]) {
41
- return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
42
- for (const accessor of accessors) {
43
- const ao = accessor(a);
44
- const bo = accessor(b);
45
- if (typeof ao === "undefined") {
46
- if (typeof bo === "undefined") {
47
- continue;
48
- }
49
- return 1;
50
- }
51
- if (ao === bo) {
52
- continue;
53
- }
54
- return ao > bo ? 1 : -1;
55
- }
56
- return ai - bi;
57
- }).map(([d]) => d);
58
- }
59
- const tokens = {
60
- colors: {
61
- inherit: "inherit",
62
- current: "currentColor",
63
- transparent: "transparent",
64
- black: "#000000",
65
- white: "#ffffff",
66
- neutral: {
67
- 50: "#f9fafb",
68
- 100: "#f2f4f7",
69
- 200: "#eaecf0",
70
- 300: "#d0d5dd",
71
- 400: "#98a2b3",
72
- 500: "#667085",
73
- 600: "#475467",
74
- 700: "#344054",
75
- 800: "#1d2939",
76
- 900: "#101828"
77
- },
78
- darkGray: {
79
- 50: "#525c7a",
80
- 100: "#49536e",
81
- 200: "#414962",
82
- 300: "#394056",
83
- 400: "#313749",
84
- 500: "#292e3d",
85
- 600: "#212530",
86
- 700: "#191c24",
87
- 800: "#111318",
88
- 900: "#0b0d10"
89
- },
90
- gray: {
91
- 50: "#f9fafb",
92
- 100: "#f2f4f7",
93
- 200: "#eaecf0",
94
- 300: "#d0d5dd",
95
- 400: "#98a2b3",
96
- 500: "#667085",
97
- 600: "#475467",
98
- 700: "#344054",
99
- 800: "#1d2939",
100
- 900: "#101828"
101
- },
102
- blue: {
103
- 25: "#F5FAFF",
104
- 50: "#EFF8FF",
105
- 100: "#D1E9FF",
106
- 200: "#B2DDFF",
107
- 300: "#84CAFF",
108
- 400: "#53B1FD",
109
- 500: "#2E90FA",
110
- 600: "#1570EF",
111
- 700: "#175CD3",
112
- 800: "#1849A9",
113
- 900: "#194185"
114
- },
115
- green: {
116
- 25: "#F6FEF9",
117
- 50: "#ECFDF3",
118
- 100: "#D1FADF",
119
- 200: "#A6F4C5",
120
- 300: "#6CE9A6",
121
- 400: "#32D583",
122
- 500: "#12B76A",
123
- 600: "#039855",
124
- 700: "#027A48",
125
- 800: "#05603A",
126
- 900: "#054F31"
127
- },
128
- red: {
129
- 50: "#fef2f2",
130
- 100: "#fee2e2",
131
- 200: "#fecaca",
132
- 300: "#fca5a5",
133
- 400: "#f87171",
134
- 500: "#ef4444",
135
- 600: "#dc2626",
136
- 700: "#b91c1c",
137
- 800: "#991b1b",
138
- 900: "#7f1d1d",
139
- 950: "#450a0a"
140
- },
141
- yellow: {
142
- 25: "#FFFCF5",
143
- 50: "#FFFAEB",
144
- 100: "#FEF0C7",
145
- 200: "#FEDF89",
146
- 300: "#FEC84B",
147
- 400: "#FDB022",
148
- 500: "#F79009",
149
- 600: "#DC6803",
150
- 700: "#B54708",
151
- 800: "#93370D",
152
- 900: "#7A2E0E"
153
- },
154
- purple: {
155
- 25: "#FAFAFF",
156
- 50: "#F4F3FF",
157
- 100: "#EBE9FE",
158
- 200: "#D9D6FE",
159
- 300: "#BDB4FE",
160
- 400: "#9B8AFB",
161
- 500: "#7A5AF8",
162
- 600: "#6938EF",
163
- 700: "#5925DC",
164
- 800: "#4A1FB8",
165
- 900: "#3E1C96"
166
- },
167
- teal: {
168
- 25: "#F6FEFC",
169
- 50: "#F0FDF9",
170
- 100: "#CCFBEF",
171
- 200: "#99F6E0",
172
- 300: "#5FE9D0",
173
- 400: "#2ED3B7",
174
- 500: "#15B79E",
175
- 600: "#0E9384",
176
- 700: "#107569",
177
- 800: "#125D56",
178
- 900: "#134E48"
179
- },
180
- pink: {
181
- 25: "#fdf2f8",
182
- 50: "#fce7f3",
183
- 100: "#fbcfe8",
184
- 200: "#f9a8d4",
185
- 300: "#f472b6",
186
- 400: "#ec4899",
187
- 500: "#db2777",
188
- 600: "#be185d",
189
- 700: "#9d174d",
190
- 800: "#831843",
191
- 900: "#500724"
192
- },
193
- cyan: {
194
- 25: "#ecfeff",
195
- 50: "#cffafe",
196
- 100: "#a5f3fc",
197
- 200: "#67e8f9",
198
- 300: "#22d3ee",
199
- 400: "#06b6d4",
200
- 500: "#0891b2",
201
- 600: "#0e7490",
202
- 700: "#155e75",
203
- 800: "#164e63",
204
- 900: "#083344"
205
- }
206
- },
207
- alpha: {
208
- 90: "e5",
209
- 70: "b3",
210
- 20: "33"
211
- },
212
- font: {
213
- size: {
214
- "2xs": "calc(var(--tsrd-font-size) * 0.625)",
215
- xs: "calc(var(--tsrd-font-size) * 0.75)",
216
- sm: "calc(var(--tsrd-font-size) * 0.875)",
217
- md: "var(--tsrd-font-size)"
218
- },
219
- lineHeight: {
220
- xs: "calc(var(--tsrd-font-size) * 1)",
221
- sm: "calc(var(--tsrd-font-size) * 1.25)"
222
- },
223
- weight: {
224
- normal: "400",
225
- medium: "500",
226
- semibold: "600",
227
- bold: "700"
228
- },
229
- fontFamily: {
230
- sans: "ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",
231
- mono: `ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace`
232
- }
233
- },
234
- border: {
235
- radius: {
236
- xs: "calc(var(--tsrd-font-size) * 0.125)",
237
- sm: "calc(var(--tsrd-font-size) * 0.25)",
238
- md: "calc(var(--tsrd-font-size) * 0.375)",
239
- full: "9999px"
240
- }
241
- },
242
- size: {
243
- 0: "0px",
244
- 0.5: "calc(var(--tsrd-font-size) * 0.125)",
245
- 1: "calc(var(--tsrd-font-size) * 0.25)",
246
- 1.5: "calc(var(--tsrd-font-size) * 0.375)",
247
- 2: "calc(var(--tsrd-font-size) * 0.5)",
248
- 2.5: "calc(var(--tsrd-font-size) * 0.625)",
249
- 3: "calc(var(--tsrd-font-size) * 0.75)",
250
- 3.5: "calc(var(--tsrd-font-size) * 0.875)",
251
- 4: "calc(var(--tsrd-font-size) * 1)",
252
- 5: "calc(var(--tsrd-font-size) * 1.25)",
253
- 8: "calc(var(--tsrd-font-size) * 2)"
254
- }
255
- };
256
- const stylesFactory$1 = (shadowDOMTarget) => {
257
- const {
258
- colors,
259
- font,
260
- size,
261
- alpha,
262
- border
263
- } = tokens;
264
- const {
265
- fontFamily,
266
- lineHeight,
267
- size: fontSize
268
- } = font;
269
- const css = shadowDOMTarget ? u.bind({
270
- target: shadowDOMTarget
271
- }) : u;
272
- return {
273
- devtoolsPanelContainer: css`
274
- direction: ltr;
275
- position: fixed;
276
- bottom: 0;
277
- right: 0;
278
- z-index: 99999;
279
- width: 100%;
280
- max-height: 90%;
281
- border-top: 1px solid ${colors.gray[700]};
282
- transform-origin: top;
283
- `,
284
- devtoolsPanelContainerVisibility: (isOpen) => {
285
- return css`
286
- visibility: ${isOpen ? "visible" : "hidden"};
287
- `;
288
- },
289
- devtoolsPanelContainerResizing: (isResizing) => {
290
- if (isResizing()) {
291
- return css`
292
- transition: none;
293
- `;
294
- }
295
- return css`
296
- transition: all 0.4s ease;
297
- `;
298
- },
299
- devtoolsPanelContainerAnimation: (isOpen, height) => {
300
- if (isOpen) {
301
- return css`
302
- pointer-events: auto;
303
- transform: translateY(0);
304
- `;
305
- }
306
- return css`
307
- pointer-events: none;
308
- transform: translateY(${height}px);
309
- `;
310
- },
311
- logo: css`
312
- cursor: pointer;
313
- display: flex;
314
- flex-direction: column;
315
- background-color: transparent;
316
- border: none;
317
- font-family: ${fontFamily.sans};
318
- gap: ${tokens.size[0.5]};
319
- padding: 0px;
320
- &:hover {
321
- opacity: 0.7;
322
- }
323
- &:focus-visible {
324
- outline-offset: 4px;
325
- border-radius: ${border.radius.xs};
326
- outline: 2px solid ${colors.blue[800]};
327
- }
328
- `,
329
- tanstackLogo: css`
330
- font-size: ${font.size.md};
331
- font-weight: ${font.weight.bold};
332
- line-height: ${font.lineHeight.xs};
333
- white-space: nowrap;
334
- color: ${colors.gray[300]};
335
- `,
336
- routerLogo: css`
337
- font-weight: ${font.weight.semibold};
338
- font-size: ${font.size.xs};
339
- background: linear-gradient(to right, #84cc16, #10b981);
340
- background-clip: text;
341
- -webkit-background-clip: text;
342
- line-height: 1;
343
- -webkit-text-fill-color: transparent;
344
- white-space: nowrap;
345
- `,
346
- devtoolsPanel: css`
347
- display: flex;
348
- font-size: ${fontSize.sm};
349
- font-family: ${fontFamily.sans};
350
- background-color: ${colors.darkGray[700]};
351
- color: ${colors.gray[300]};
352
-
353
- @media (max-width: 700px) {
354
- flex-direction: column;
355
- }
356
- @media (max-width: 600px) {
357
- font-size: ${fontSize.xs};
358
- }
359
- `,
360
- dragHandle: css`
361
- position: absolute;
362
- left: 0;
363
- top: 0;
364
- width: 100%;
365
- height: 4px;
366
- cursor: row-resize;
367
- z-index: 100000;
368
- &:hover {
369
- background-color: ${colors.purple[400]}${alpha[90]};
370
- }
371
- `,
372
- firstContainer: css`
373
- flex: 1 1 500px;
374
- min-height: 40%;
375
- max-height: 100%;
376
- overflow: auto;
377
- border-right: 1px solid ${colors.gray[700]};
378
- display: flex;
379
- flex-direction: column;
380
- `,
381
- routerExplorerContainer: css`
382
- overflow-y: auto;
383
- flex: 1;
384
- `,
385
- routerExplorer: css`
386
- padding: ${tokens.size[2]};
387
- `,
388
- row: css`
389
- display: flex;
390
- align-items: center;
391
- padding: ${tokens.size[2]} ${tokens.size[2.5]};
392
- gap: ${tokens.size[2.5]};
393
- border-bottom: ${colors.darkGray[500]} 1px solid;
394
- align-items: center;
395
- `,
396
- detailsHeader: css`
397
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
398
- position: sticky;
399
- top: 0;
400
- z-index: 2;
401
- background-color: ${colors.darkGray[600]};
402
- padding: 0px ${tokens.size[2]};
403
- font-weight: ${font.weight.medium};
404
- font-size: ${font.size.xs};
405
- min-height: ${tokens.size[8]};
406
- line-height: ${font.lineHeight.xs};
407
- text-align: left;
408
- display: flex;
409
- align-items: center;
410
- `,
411
- maskedBadge: css`
412
- background: ${colors.yellow[900]}${alpha[70]};
413
- color: ${colors.yellow[300]};
414
- display: inline-block;
415
- padding: ${tokens.size[0]} ${tokens.size[2.5]};
416
- border-radius: ${border.radius.full};
417
- font-size: ${font.size.xs};
418
- font-weight: ${font.weight.normal};
419
- border: 1px solid ${colors.yellow[300]};
420
- `,
421
- maskedLocation: css`
422
- color: ${colors.yellow[300]};
423
- `,
424
- detailsContent: css`
425
- padding: ${tokens.size[1.5]} ${tokens.size[2]};
426
- display: flex;
427
- align-items: center;
428
- justify-content: space-between;
429
- font-size: ${font.size.xs};
430
- `,
431
- routeMatchesToggle: css`
432
- display: flex;
433
- align-items: center;
434
- border: 1px solid ${colors.gray[500]};
435
- border-radius: ${border.radius.sm};
436
- overflow: hidden;
437
- `,
438
- routeMatchesToggleBtn: (active, showBorder) => {
439
- const base = css`
440
- appearance: none;
441
- border: none;
442
- font-size: 12px;
443
- padding: 4px 8px;
444
- background: transparent;
445
- cursor: pointer;
446
- font-family: ${fontFamily.sans};
447
- font-weight: ${font.weight.medium};
448
- `;
449
- const classes = [base];
450
- if (active) {
451
- const activeStyles = css`
452
- background: ${colors.darkGray[400]};
453
- color: ${colors.gray[300]};
454
- `;
455
- classes.push(activeStyles);
456
- } else {
457
- const inactiveStyles = css`
458
- color: ${colors.gray[500]};
459
- background: ${colors.darkGray[800]}${alpha[20]};
460
- `;
461
- classes.push(inactiveStyles);
462
- }
463
- if (showBorder) {
464
- classes.push(css`
465
- border-right: 1px solid ${tokens.colors.gray[500]};
466
- `);
467
- }
468
- return classes;
469
- },
470
- detailsHeaderInfo: css`
471
- flex: 1;
472
- justify-content: flex-end;
473
- display: flex;
474
- align-items: center;
475
- font-weight: ${font.weight.normal};
476
- color: ${colors.gray[400]};
477
- `,
478
- matchRow: (active) => {
479
- const base = css`
480
- display: flex;
481
- border-bottom: 1px solid ${colors.darkGray[400]};
482
- cursor: pointer;
483
- align-items: center;
484
- padding: ${size[1]} ${size[2]};
485
- gap: ${size[2]};
486
- font-size: ${fontSize.xs};
487
- color: ${colors.gray[300]};
488
- `;
489
- const classes = [base];
490
- if (active) {
491
- const activeStyles = css`
492
- background: ${colors.darkGray[500]};
493
- `;
494
- classes.push(activeStyles);
495
- }
496
- return classes;
497
- },
498
- matchIndicator: (color) => {
499
- const base = css`
500
- flex: 0 0 auto;
501
- width: ${size[3]};
502
- height: ${size[3]};
503
- background: ${colors[color][900]};
504
- border: 1px solid ${colors[color][500]};
505
- border-radius: ${border.radius.full};
506
- transition: all 0.25s ease-out;
507
- box-sizing: border-box;
508
- `;
509
- const classes = [base];
510
- if (color === "gray") {
511
- const grayStyles = css`
512
- background: ${colors.gray[700]};
513
- border-color: ${colors.gray[400]};
514
- `;
515
- classes.push(grayStyles);
516
- }
517
- return classes;
518
- },
519
- matchID: css`
520
- flex: 1;
521
- line-height: ${lineHeight["xs"]};
522
- `,
523
- ageTicker: (showWarning) => {
524
- const base = css`
525
- display: flex;
526
- gap: ${size[1]};
527
- font-size: ${fontSize.xs};
528
- color: ${colors.gray[400]};
529
- font-variant-numeric: tabular-nums;
530
- line-height: ${lineHeight["xs"]};
531
- `;
532
- const classes = [base];
533
- if (showWarning) {
534
- const warningStyles = css`
535
- color: ${colors.yellow[400]};
536
- `;
537
- classes.push(warningStyles);
538
- }
539
- return classes;
540
- },
541
- secondContainer: css`
542
- flex: 1 1 500px;
543
- min-height: 40%;
544
- max-height: 100%;
545
- overflow: auto;
546
- border-right: 1px solid ${colors.gray[700]};
547
- display: flex;
548
- flex-direction: column;
549
- `,
550
- thirdContainer: css`
551
- flex: 1 1 500px;
552
- overflow: auto;
553
- display: flex;
554
- flex-direction: column;
555
- height: 100%;
556
- border-right: 1px solid ${colors.gray[700]};
557
-
558
- @media (max-width: 700px) {
559
- border-top: 2px solid ${colors.gray[700]};
560
- }
561
- `,
562
- fourthContainer: css`
563
- flex: 1 1 500px;
564
- min-height: 40%;
565
- max-height: 100%;
566
- overflow: auto;
567
- display: flex;
568
- flex-direction: column;
569
- `,
570
- routesContainer: css`
571
- overflow-x: auto;
572
- overflow-y: visible;
573
- `,
574
- routesRowContainer: (active, isMatch) => {
575
- const base = css`
576
- display: flex;
577
- border-bottom: 1px solid ${colors.darkGray[400]};
578
- align-items: center;
579
- padding: ${size[1]} ${size[2]};
580
- gap: ${size[2]};
581
- font-size: ${fontSize.xs};
582
- color: ${colors.gray[300]};
583
- cursor: ${isMatch ? "pointer" : "default"};
584
- line-height: ${lineHeight["xs"]};
585
- `;
586
- const classes = [base];
587
- if (active) {
588
- const activeStyles = css`
589
- background: ${colors.darkGray[500]};
590
- `;
591
- classes.push(activeStyles);
592
- }
593
- return classes;
594
- },
595
- routesRow: (isMatch) => {
596
- const base = css`
597
- flex: 1 0 auto;
598
- display: flex;
599
- justify-content: space-between;
600
- align-items: center;
601
- font-size: ${fontSize.xs};
602
- line-height: ${lineHeight["xs"]};
603
- `;
604
- const classes = [base];
605
- if (!isMatch) {
606
- const matchStyles = css`
607
- color: ${colors.gray[400]};
608
- `;
609
- classes.push(matchStyles);
610
- }
611
- return classes;
612
- },
613
- routesRowInner: css`
614
- display: 'flex';
615
- align-items: 'center';
616
- flex-grow: 1;
617
- min-width: 0;
618
- `,
619
- routeParamInfo: css`
620
- color: ${colors.gray[400]};
621
- font-size: ${fontSize.xs};
622
- line-height: ${lineHeight["xs"]};
623
- `,
624
- nestedRouteRow: (isRoot) => {
625
- const base = css`
626
- margin-left: ${isRoot ? 0 : size[3.5]};
627
- border-left: ${isRoot ? "" : `solid 1px ${colors.gray[700]}`};
628
- `;
629
- return base;
630
- },
631
- code: css`
632
- font-size: ${fontSize.xs};
633
- line-height: ${lineHeight["xs"]};
634
- white-space: nowrap;
635
- overflow: hidden;
636
- text-overflow: ellipsis;
637
- `,
638
- matchesContainer: css`
639
- flex: 1 1 auto;
640
- overflow-y: auto;
641
- `,
642
- cachedMatchesContainer: css`
643
- flex: 1 1 auto;
644
- overflow-y: auto;
645
- max-height: 50%;
646
- `,
647
- historyContainer: css`
648
- display: flex;
649
- flex: 1 1 auto;
650
- overflow-y: auto;
651
- max-height: 50%;
652
- `,
653
- historyOverflowContainer: css`
654
- padding: ${size[1]} ${size[2]};
655
- font-size: ${tokens.font.size.xs};
656
- `,
657
- maskedBadgeContainer: css`
658
- flex: 1;
659
- justify-content: flex-end;
660
- display: flex;
661
- `,
662
- matchDetails: css`
663
- display: flex;
664
- flex-direction: column;
665
- padding: ${tokens.size[2]};
666
- font-size: ${tokens.font.size.xs};
667
- color: ${tokens.colors.gray[300]};
668
- line-height: ${tokens.font.lineHeight.sm};
669
- `,
670
- matchStatus: (status, isFetching) => {
671
- const colorMap = {
672
- pending: "yellow",
673
- success: "green",
674
- error: "red",
675
- notFound: "purple",
676
- redirected: "gray"
677
- };
678
- const color = isFetching && status === "success" ? isFetching === "beforeLoad" ? "purple" : "blue" : colorMap[status];
679
- return css`
680
- display: flex;
681
- justify-content: center;
682
- align-items: center;
683
- height: 40px;
684
- border-radius: ${tokens.border.radius.sm};
685
- font-weight: ${tokens.font.weight.normal};
686
- background-color: ${tokens.colors[color][900]}${tokens.alpha[90]};
687
- color: ${tokens.colors[color][300]};
688
- border: 1px solid ${tokens.colors[color][600]};
689
- margin-bottom: ${tokens.size[2]};
690
- transition: all 0.25s ease-out;
691
- `;
692
- },
693
- matchDetailsInfo: css`
694
- display: flex;
695
- justify-content: flex-end;
696
- flex: 1;
697
- `,
698
- matchDetailsInfoLabel: css`
699
- display: flex;
700
- `,
701
- mainCloseBtn: css`
702
- background: ${colors.darkGray[700]};
703
- padding: ${size[1]} ${size[2]} ${size[1]} ${size[1.5]};
704
- border-radius: ${border.radius.md};
705
- position: fixed;
706
- z-index: 99999;
707
- display: inline-flex;
708
- width: fit-content;
709
- cursor: pointer;
710
- appearance: none;
711
- border: 0;
712
- gap: 8px;
713
- align-items: center;
714
- border: 1px solid ${colors.gray[500]};
715
- font-size: ${font.size.xs};
716
- cursor: pointer;
717
- transition: all 0.25s ease-out;
718
-
719
- &:hover {
720
- background: ${colors.darkGray[500]};
721
- }
722
- `,
723
- mainCloseBtnPosition: (position) => {
724
- const base = css`
725
- ${position === "top-left" ? `top: ${size[2]}; left: ${size[2]};` : ""}
726
- ${position === "top-right" ? `top: ${size[2]}; right: ${size[2]};` : ""}
727
- ${position === "bottom-left" ? `bottom: ${size[2]}; left: ${size[2]};` : ""}
728
- ${position === "bottom-right" ? `bottom: ${size[2]}; right: ${size[2]};` : ""}
729
- `;
730
- return base;
731
- },
732
- mainCloseBtnAnimation: (isOpen) => {
733
- if (!isOpen) {
734
- return css`
735
- opacity: 1;
736
- pointer-events: auto;
737
- visibility: visible;
738
- `;
739
- }
740
- return css`
741
- opacity: 0;
742
- pointer-events: none;
743
- visibility: hidden;
744
- `;
745
- },
746
- routerLogoCloseButton: css`
747
- font-weight: ${font.weight.semibold};
748
- font-size: ${font.size.xs};
749
- background: linear-gradient(to right, #98f30c, #00f4a3);
750
- background-clip: text;
751
- -webkit-background-clip: text;
752
- line-height: 1;
753
- -webkit-text-fill-color: transparent;
754
- white-space: nowrap;
755
- `,
756
- mainCloseBtnDivider: css`
757
- width: 1px;
758
- background: ${tokens.colors.gray[600]};
759
- height: 100%;
760
- border-radius: 999999px;
761
- color: transparent;
762
- `,
763
- mainCloseBtnIconContainer: css`
764
- position: relative;
765
- width: ${size[5]};
766
- height: ${size[5]};
767
- background: pink;
768
- border-radius: 999999px;
769
- overflow: hidden;
770
- `,
771
- mainCloseBtnIconOuter: css`
772
- width: ${size[5]};
773
- height: ${size[5]};
774
- position: absolute;
775
- top: 50%;
776
- left: 50%;
777
- transform: translate(-50%, -50%);
778
- filter: blur(3px) saturate(1.8) contrast(2);
779
- `,
780
- mainCloseBtnIconInner: css`
781
- width: ${size[4]};
782
- height: ${size[4]};
783
- position: absolute;
784
- top: 50%;
785
- left: 50%;
786
- transform: translate(-50%, -50%);
787
- `,
788
- panelCloseBtn: css`
789
- position: absolute;
790
- cursor: pointer;
791
- z-index: 100001;
792
- display: flex;
793
- align-items: center;
794
- justify-content: center;
795
- outline: none;
796
- background-color: ${colors.darkGray[700]};
797
- &:hover {
798
- background-color: ${colors.darkGray[500]};
799
- }
800
-
801
- top: 0;
802
- right: ${size[2]};
803
- transform: translate(0, -100%);
804
- border-right: ${colors.darkGray[300]} 1px solid;
805
- border-left: ${colors.darkGray[300]} 1px solid;
806
- border-top: ${colors.darkGray[300]} 1px solid;
807
- border-bottom: none;
808
- border-radius: ${border.radius.sm} ${border.radius.sm} 0px 0px;
809
- padding: ${size[1]} ${size[1.5]} ${size[0.5]} ${size[1.5]};
810
-
811
- &::after {
812
- content: ' ';
813
- position: absolute;
814
- top: 100%;
815
- left: -${size[2.5]};
816
- height: ${size[1.5]};
817
- width: calc(100% + ${size[5]});
818
- }
819
- `,
820
- panelCloseBtnIcon: css`
821
- color: ${colors.gray[400]};
822
- width: ${size[2]};
823
- height: ${size[2]};
824
- `,
825
- navigateButton: css`
826
- background: none;
827
- border: none;
828
- padding: 0 0 0 4px;
829
- margin: 0;
830
- color: ${colors.gray[400]};
831
- font-size: ${fontSize.md};
832
- cursor: pointer;
833
- line-height: 1;
834
- vertical-align: middle;
835
- margin-right: 0.5ch;
836
- flex-shrink: 0;
837
- &:hover {
838
- color: ${colors.blue[300]};
839
- }
840
- `
841
- };
842
- };
843
- function useStyles$1() {
844
- const shadowDomTarget = useContext(ShadowDomTargetContext);
845
- const [_styles] = createSignal(stylesFactory$1(shadowDomTarget));
846
- return _styles;
847
- }
848
- const getItem = (key) => {
849
- try {
850
- const itemValue = localStorage.getItem(key);
851
- if (typeof itemValue === "string") {
852
- return JSON.parse(itemValue);
853
- }
854
- return void 0;
855
- } catch {
856
- return void 0;
857
- }
858
- };
859
- function useLocalStorage(key, defaultValue) {
860
- const [value, setValue] = createSignal();
861
- createEffect(() => {
862
- const initialValue = getItem(key);
863
- if (typeof initialValue === "undefined" || initialValue === null) {
864
- setValue(
865
- typeof defaultValue === "function" ? defaultValue() : defaultValue
866
- );
867
- } else {
868
- setValue(initialValue);
869
- }
870
- });
871
- const setter = (updater) => {
872
- setValue((old) => {
873
- let newVal = updater;
874
- if (typeof updater == "function") {
875
- newVal = updater(old);
876
- }
877
- try {
878
- localStorage.setItem(key, JSON.stringify(newVal));
879
- } catch {
880
- }
881
- return newVal;
882
- });
883
- };
884
- return [value, setter];
885
- }
886
- var _tmpl$$3 = /* @__PURE__ */ template(`<span><svg xmlns=http://www.w3.org/2000/svg width=12 height=12 fill=none viewBox="0 0 24 24"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 18l6-6-6-6">`), _tmpl$2$1 = /* @__PURE__ */ template(`<div>`), _tmpl$3$1 = /* @__PURE__ */ template(`<button><span> `), _tmpl$4$1 = /* @__PURE__ */ template(`<div><div><button> [<!> ... <!>]`), _tmpl$5$1 = /* @__PURE__ */ template(`<button><span></span> 🔄 `), _tmpl$6$1 = /* @__PURE__ */ template(`<span>:`), _tmpl$7$1 = /* @__PURE__ */ template(`<span>`);
887
- const Expander = ({
888
- expanded,
889
- style = {}
890
- }) => {
891
- const styles = useStyles();
892
- return (() => {
893
- var _el$ = _tmpl$$3(), _el$2 = _el$.firstChild;
894
- createRenderEffect((_p$) => {
895
- var _v$ = styles().expander, _v$2 = clsx(styles().expanderIcon(expanded));
896
- _v$ !== _p$.e && className(_el$, _p$.e = _v$);
897
- _v$2 !== _p$.t && setAttribute(_el$2, "class", _p$.t = _v$2);
898
- return _p$;
899
- }, {
900
- e: void 0,
901
- t: void 0
902
- });
903
- return _el$;
904
- })();
905
- };
906
- function chunkArray(array, size) {
907
- if (size < 1) return [];
908
- let i = 0;
909
- const result = [];
910
- while (i < array.length) {
911
- result.push(array.slice(i, i + size));
912
- i = i + size;
913
- }
914
- return result;
915
- }
916
- function isIterable(x) {
917
- return Symbol.iterator in x;
918
- }
919
- function Explorer({
920
- value,
921
- defaultExpanded,
922
- pageSize = 100,
923
- filterSubEntries,
924
- ...rest
925
- }) {
926
- const [expanded, setExpanded] = createSignal(Boolean(defaultExpanded));
927
- const toggleExpanded = () => setExpanded((old) => !old);
928
- const type = createMemo(() => typeof value());
929
- const subEntries = createMemo(() => {
930
- let entries = [];
931
- const makeProperty = (sub) => {
932
- const subDefaultExpanded = defaultExpanded === true ? {
933
- [sub.label]: true
934
- } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
935
- return {
936
- ...sub,
937
- value: () => sub.value,
938
- defaultExpanded: subDefaultExpanded
939
- };
940
- };
941
- if (Array.isArray(value())) {
942
- entries = value().map((d, i) => makeProperty({
943
- label: i.toString(),
944
- value: d
945
- }));
946
- } else if (value() !== null && typeof value() === "object" && isIterable(value()) && typeof value()[Symbol.iterator] === "function") {
947
- entries = Array.from(value(), (val, i) => makeProperty({
948
- label: i.toString(),
949
- value: val
950
- }));
951
- } else if (typeof value() === "object" && value() !== null) {
952
- entries = Object.entries(value()).map(([key, val]) => makeProperty({
953
- label: key,
954
- value: val
955
- }));
956
- }
957
- return filterSubEntries ? filterSubEntries(entries) : entries;
958
- });
959
- const subEntryPages = createMemo(() => chunkArray(subEntries(), pageSize));
960
- const [expandedPages, setExpandedPages] = createSignal([]);
961
- const [valueSnapshot, setValueSnapshot] = createSignal(void 0);
962
- const styles = useStyles();
963
- const refreshValueSnapshot = () => {
964
- setValueSnapshot(value()());
965
- };
966
- const handleEntry = (entry) => createComponent(Explorer, mergeProps({
967
- value,
968
- filterSubEntries
969
- }, rest, entry));
970
- return (() => {
971
- var _el$3 = _tmpl$2$1();
972
- insert(_el$3, (() => {
973
- var _c$ = memo(() => !!subEntryPages().length);
974
- return () => _c$() ? [(() => {
975
- var _el$4 = _tmpl$3$1(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild;
976
- _el$4.$$click = () => toggleExpanded();
977
- insert(_el$4, createComponent(Expander, {
978
- get expanded() {
979
- return expanded() ?? false;
980
- }
981
- }), _el$5);
982
- insert(_el$4, () => rest.label, _el$5);
983
- insert(_el$5, () => String(type).toLowerCase() === "iterable" ? "(Iterable) " : "", _el$6);
984
- insert(_el$5, () => subEntries().length, _el$6);
985
- insert(_el$5, () => subEntries().length > 1 ? `items` : `item`, null);
986
- createRenderEffect((_p$) => {
987
- var _v$3 = styles().expandButton, _v$4 = styles().info;
988
- _v$3 !== _p$.e && className(_el$4, _p$.e = _v$3);
989
- _v$4 !== _p$.t && className(_el$5, _p$.t = _v$4);
990
- return _p$;
991
- }, {
992
- e: void 0,
993
- t: void 0
994
- });
995
- return _el$4;
996
- })(), memo(() => memo(() => !!(expanded() ?? false))() ? memo(() => subEntryPages().length === 1)() ? (() => {
997
- var _el$7 = _tmpl$2$1();
998
- insert(_el$7, () => subEntries().map((entry, index) => handleEntry(entry)));
999
- createRenderEffect(() => className(_el$7, styles().subEntries));
1000
- return _el$7;
1001
- })() : (() => {
1002
- var _el$8 = _tmpl$2$1();
1003
- insert(_el$8, () => subEntryPages().map((entries, index) => {
1004
- return (() => {
1005
- var _el$9 = _tmpl$4$1(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$15 = _el$10.nextSibling, _el$12 = _el$15.nextSibling, _el$16 = _el$12.nextSibling;
1006
- _el$16.nextSibling;
1007
- _el$1.$$click = () => setExpandedPages((old) => old.includes(index) ? old.filter((d) => d !== index) : [...old, index]);
1008
- insert(_el$1, createComponent(Expander, {
1009
- get expanded() {
1010
- return expandedPages().includes(index);
1011
- }
1012
- }), _el$10);
1013
- insert(_el$1, index * pageSize, _el$15);
1014
- insert(_el$1, index * pageSize + pageSize - 1, _el$16);
1015
- insert(_el$0, (() => {
1016
- var _c$2 = memo(() => !!expandedPages().includes(index));
1017
- return () => _c$2() ? (() => {
1018
- var _el$17 = _tmpl$2$1();
1019
- insert(_el$17, () => entries.map((entry) => handleEntry(entry)));
1020
- createRenderEffect(() => className(_el$17, styles().subEntries));
1021
- return _el$17;
1022
- })() : null;
1023
- })(), null);
1024
- createRenderEffect((_p$) => {
1025
- var _v$5 = styles().entry, _v$6 = clsx(styles().labelButton, "labelButton");
1026
- _v$5 !== _p$.e && className(_el$0, _p$.e = _v$5);
1027
- _v$6 !== _p$.t && className(_el$1, _p$.t = _v$6);
1028
- return _p$;
1029
- }, {
1030
- e: void 0,
1031
- t: void 0
1032
- });
1033
- return _el$9;
1034
- })();
1035
- }));
1036
- createRenderEffect(() => className(_el$8, styles().subEntries));
1037
- return _el$8;
1038
- })() : null)] : memo(() => type() === "function")() ? createComponent(Explorer, {
1039
- get label() {
1040
- return (() => {
1041
- var _el$18 = _tmpl$5$1(), _el$19 = _el$18.firstChild;
1042
- _el$18.$$click = refreshValueSnapshot;
1043
- insert(_el$19, () => rest.label);
1044
- createRenderEffect(() => className(_el$18, styles().refreshValueBtn));
1045
- return _el$18;
1046
- })();
1047
- },
1048
- value: valueSnapshot,
1049
- defaultExpanded: {}
1050
- }) : [(() => {
1051
- var _el$20 = _tmpl$6$1(), _el$21 = _el$20.firstChild;
1052
- insert(_el$20, () => rest.label, _el$21);
1053
- return _el$20;
1054
- })(), " ", (() => {
1055
- var _el$22 = _tmpl$7$1();
1056
- insert(_el$22, () => displayValue(value()));
1057
- createRenderEffect(() => className(_el$22, styles().value));
1058
- return _el$22;
1059
- })()];
1060
- })());
1061
- createRenderEffect(() => className(_el$3, styles().entry));
1062
- return _el$3;
1063
- })();
1064
- }
1065
- const stylesFactory = (shadowDOMTarget) => {
1066
- const {
1067
- colors,
1068
- font,
1069
- size
1070
- } = tokens;
1071
- const {
1072
- fontFamily,
1073
- lineHeight,
1074
- size: fontSize
1075
- } = font;
1076
- const css = shadowDOMTarget ? u.bind({
1077
- target: shadowDOMTarget
1078
- }) : u;
1079
- return {
1080
- entry: css`
1081
- font-family: ${fontFamily.mono};
1082
- font-size: ${fontSize.xs};
1083
- line-height: ${lineHeight.sm};
1084
- outline: none;
1085
- word-break: break-word;
1086
- `,
1087
- labelButton: css`
1088
- cursor: pointer;
1089
- color: inherit;
1090
- font: inherit;
1091
- outline: inherit;
1092
- background: transparent;
1093
- border: none;
1094
- padding: 0;
1095
- `,
1096
- expander: css`
1097
- display: inline-flex;
1098
- align-items: center;
1099
- justify-content: center;
1100
- width: ${size[3]};
1101
- height: ${size[3]};
1102
- padding-left: 3px;
1103
- box-sizing: content-box;
1104
- `,
1105
- expanderIcon: (expanded) => {
1106
- if (expanded) {
1107
- return css`
1108
- transform: rotate(90deg);
1109
- transition: transform 0.1s ease;
1110
- `;
1111
- }
1112
- return css`
1113
- transform: rotate(0deg);
1114
- transition: transform 0.1s ease;
1115
- `;
1116
- },
1117
- expandButton: css`
1118
- display: flex;
1119
- gap: ${size[1]};
1120
- align-items: center;
1121
- cursor: pointer;
1122
- color: inherit;
1123
- font: inherit;
1124
- outline: inherit;
1125
- background: transparent;
1126
- border: none;
1127
- padding: 0;
1128
- `,
1129
- value: css`
1130
- color: ${colors.purple[400]};
1131
- `,
1132
- subEntries: css`
1133
- margin-left: ${size[2]};
1134
- padding-left: ${size[2]};
1135
- border-left: 2px solid ${colors.darkGray[400]};
1136
- `,
1137
- info: css`
1138
- color: ${colors.gray[500]};
1139
- font-size: ${fontSize["2xs"]};
1140
- padding-left: ${size[1]};
1141
- `,
1142
- refreshValueBtn: css`
1143
- appearance: none;
1144
- border: 0;
1145
- cursor: pointer;
1146
- background: transparent;
1147
- color: inherit;
1148
- padding: 0;
1149
- font-family: ${fontFamily.mono};
1150
- font-size: ${fontSize.xs};
1151
- `
1152
- };
1153
- };
1154
- function useStyles() {
1155
- const shadowDomTarget = useContext(ShadowDomTargetContext);
1156
- const [_styles] = createSignal(stylesFactory(shadowDomTarget));
1157
- return _styles;
1158
- }
1159
- delegateEvents(["click"]);
1160
- var _tmpl$$2 = /* @__PURE__ */ template(`<div><div></div><div>/</div><div></div><div>/</div><div>`);
1161
- function formatTime(ms) {
1162
- const units = ["s", "min", "h", "d"];
1163
- const values = [ms / 1e3, ms / 6e4, ms / 36e5, ms / 864e5];
1164
- let chosenUnitIndex = 0;
1165
- for (let i = 1; i < values.length; i++) {
1166
- if (values[i] < 1) break;
1167
- chosenUnitIndex = i;
1168
- }
1169
- const formatter = new Intl.NumberFormat(navigator.language, {
1170
- compactDisplay: "short",
1171
- notation: "compact",
1172
- maximumFractionDigits: 0
1173
- });
1174
- return formatter.format(values[chosenUnitIndex]) + units[chosenUnitIndex];
1175
- }
1176
- function AgeTicker({
1177
- match,
1178
- router
1179
- }) {
1180
- const styles = useStyles$1();
1181
- if (!match) {
1182
- return null;
1183
- }
1184
- const route = router().looseRoutesById[match.routeId];
1185
- if (!route.options.loader) {
1186
- return null;
1187
- }
1188
- const age = Date.now() - match.updatedAt;
1189
- const staleTime = route.options.staleTime ?? router().options.defaultStaleTime ?? 0;
1190
- const gcTime = route.options.gcTime ?? router().options.defaultGcTime ?? 30 * 60 * 1e3;
1191
- return (() => {
1192
- var _el$ = _tmpl$$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling;
1193
- insert(_el$2, () => formatTime(age));
1194
- insert(_el$4, () => formatTime(staleTime));
1195
- insert(_el$6, () => formatTime(gcTime));
1196
- createRenderEffect(() => className(_el$, clsx(styles().ageTicker(age > staleTime))));
1197
- return _el$;
1198
- })();
1199
- }
1200
- var _tmpl$$1 = /* @__PURE__ */ template(`<button type=button>➔`);
1201
- function NavigateButton({
1202
- to,
1203
- params,
1204
- search,
1205
- router
1206
- }) {
1207
- const styles = useStyles$1();
1208
- return (() => {
1209
- var _el$ = _tmpl$$1();
1210
- _el$.$$click = (e) => {
1211
- e.stopPropagation();
1212
- router().navigate({
1213
- to,
1214
- params,
1215
- search
1216
- });
1217
- };
1218
- setAttribute(_el$, "title", `Navigate to ${to}`);
1219
- createRenderEffect(() => className(_el$, styles().navigateButton));
1220
- return _el$;
1221
- })();
1222
- }
1223
- delegateEvents(["click"]);
1224
- var _tmpl$ = /* @__PURE__ */ template(`<button><div>TANSTACK</div><div>TanStack Router v1`), _tmpl$2 = /* @__PURE__ */ template(`<div style=display:flex;align-items:center;width:100%><div style=flex-grow:1;min-width:0>`), _tmpl$3 = /* @__PURE__ */ template(`<code> `), _tmpl$4 = /* @__PURE__ */ template(`<code>`), _tmpl$5 = /* @__PURE__ */ template(`<div><div role=button><div>`), _tmpl$6 = /* @__PURE__ */ template(`<div>`), _tmpl$7 = /* @__PURE__ */ template(`<div><ul>`), _tmpl$8 = /* @__PURE__ */ template(`<div><button><svg xmlns=http://www.w3.org/2000/svg width=10 height=6 fill=none viewBox="0 0 10 6"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=1.667 d="M1 1l4 4 4-4"></path></svg></button><div><div></div><div><div></div></div></div><div><div><div><span>Pathname</span></div><div><code></code></div><div><div><button type=button>Routes</button><button type=button>Matches</button><button type=button>History</button></div><div><div>age / staleTime / gcTime</div></div></div><div>`), _tmpl$9 = /* @__PURE__ */ template(`<div><span>masked`), _tmpl$0 = /* @__PURE__ */ template(`<div role=button><div>`), _tmpl$1 = /* @__PURE__ */ template(`<li><div>`), _tmpl$10 = /* @__PURE__ */ template(`<li>This panel displays the most recent 15 navigations.`), _tmpl$11 = /* @__PURE__ */ template(`<div><div><div>Cached Matches</div><div>age / staleTime / gcTime</div></div><div>`), _tmpl$12 = /* @__PURE__ */ template(`<div><div>Match Details</div><div><div><div><div></div></div><div><div>ID:</div><div><code></code></div></div><div><div>State:</div><div></div></div><div><div>Last Updated:</div><div></div></div></div></div><div>Explorer</div><div>`), _tmpl$13 = /* @__PURE__ */ template(`<div>Loader Data`), _tmpl$14 = /* @__PURE__ */ template(`<div><div><span>Search Params</span></div><div>`), _tmpl$15 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem>`), _tmpl$16 = /* @__PURE__ */ template(`<button type=button aria-label="Copy value to clipboard"style=cursor:pointer>`);
1225
- const HISTORY_LIMIT = 15;
1226
- function Logo(props) {
1227
- const {
1228
- className: className$1,
1229
- ...rest
1230
- } = props;
1231
- const styles = useStyles$1();
1232
- return (() => {
1233
- var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
1234
- spread(_el$, mergeProps(rest, {
1235
- get ["class"]() {
1236
- return clsx(styles().logo, className$1 ? className$1() : "");
1237
- }
1238
- }), false, true);
1239
- createRenderEffect((_p$) => {
1240
- var _v$ = styles().tanstackLogo, _v$2 = styles().routerLogo;
1241
- _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
1242
- _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
1243
- return _p$;
1244
- }, {
1245
- e: void 0,
1246
- t: void 0
1247
- });
1248
- return _el$;
1249
- })();
1250
- }
1251
- function NavigateLink(props) {
1252
- return (() => {
1253
- var _el$4 = _tmpl$2(), _el$5 = _el$4.firstChild;
1254
- insert(_el$4, () => props.left, _el$5);
1255
- insert(_el$5, () => props.children);
1256
- insert(_el$4, () => props.right, null);
1257
- createRenderEffect(() => className(_el$4, props.class));
1258
- return _el$4;
1259
- })();
1260
- }
1261
- function RouteComp({
1262
- routerState,
1263
- router,
1264
- route,
1265
- isRoot,
1266
- activeId,
1267
- setActiveId
1268
- }) {
1269
- const styles = useStyles$1();
1270
- const matches = createMemo(() => routerState().pendingMatches || routerState().matches);
1271
- const match = createMemo(() => routerState().matches.find((d) => d.routeId === route.id));
1272
- const param = createMemo(() => {
1273
- var _a, _b;
1274
- try {
1275
- if ((_a = match()) == null ? void 0 : _a.params) {
1276
- const p = (_b = match()) == null ? void 0 : _b.params;
1277
- const r = route.path || trimPath(route.id);
1278
- if (r.startsWith("$")) {
1279
- const trimmed = r.slice(1);
1280
- if (p[trimmed]) {
1281
- return `(${p[trimmed]})`;
1282
- }
1283
- }
1284
- }
1285
- return "";
1286
- } catch (error) {
1287
- return "";
1288
- }
1289
- });
1290
- const navigationTarget = createMemo(() => {
1291
- if (isRoot) return void 0;
1292
- if (!route.path) return void 0;
1293
- const allParams = Object.assign({}, ...matches().map((m) => m.params));
1294
- const interpolated = interpolatePath({
1295
- path: route.fullPath,
1296
- params: allParams,
1297
- decodeCharMap: router().pathParamsDecodeCharMap
1298
- });
1299
- return !interpolated.isMissingParams ? interpolated.interpolatedPath : void 0;
1300
- });
1301
- return (() => {
1302
- var _el$6 = _tmpl$5(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild;
1303
- _el$7.$$click = () => {
1304
- if (match()) {
1305
- setActiveId(activeId() === route.id ? "" : route.id);
1306
- }
1307
- };
1308
- insert(_el$7, createComponent(NavigateLink, {
1309
- get ["class"]() {
1310
- return clsx(styles().routesRow(!!match()));
1311
- },
1312
- get left() {
1313
- return createComponent(Show, {
1314
- get when() {
1315
- return navigationTarget();
1316
- },
1317
- children: (navigate) => createComponent(NavigateButton, {
1318
- get to() {
1319
- return navigate();
1320
- },
1321
- router
1322
- })
1323
- });
1324
- },
1325
- get right() {
1326
- return createComponent(AgeTicker, {
1327
- get match() {
1328
- return match();
1329
- },
1330
- router
1331
- });
1332
- },
1333
- get children() {
1334
- return [(() => {
1335
- var _el$9 = _tmpl$3(), _el$0 = _el$9.firstChild;
1336
- insert(_el$9, () => isRoot ? rootRouteId : route.path || trimPath(route.id), _el$0);
1337
- createRenderEffect(() => className(_el$9, styles().code));
1338
- return _el$9;
1339
- })(), (() => {
1340
- var _el$1 = _tmpl$4();
1341
- insert(_el$1, param);
1342
- createRenderEffect(() => className(_el$1, styles().routeParamInfo));
1343
- return _el$1;
1344
- })()];
1345
- }
1346
- }), null);
1347
- insert(_el$6, (() => {
1348
- var _c$ = memo(() => {
1349
- var _a;
1350
- return !!((_a = route.children) == null ? void 0 : _a.length);
1351
- });
1352
- return () => _c$() ? (() => {
1353
- var _el$10 = _tmpl$6();
1354
- insert(_el$10, () => [...route.children].sort((a, b) => {
1355
- return a.rank - b.rank;
1356
- }).map((r) => createComponent(RouteComp, {
1357
- routerState,
1358
- router,
1359
- route: r,
1360
- activeId,
1361
- setActiveId
1362
- })));
1363
- createRenderEffect(() => className(_el$10, styles().nestedRouteRow(!!isRoot)));
1364
- return _el$10;
1365
- })() : null;
1366
- })(), null);
1367
- createRenderEffect((_p$) => {
1368
- var _v$3 = `Open match details for ${route.id}`, _v$4 = clsx(styles().routesRowContainer(route.id === activeId(), !!match())), _v$5 = clsx(styles().matchIndicator(getRouteStatusColor(matches(), route)));
1369
- _v$3 !== _p$.e && setAttribute(_el$7, "aria-label", _p$.e = _v$3);
1370
- _v$4 !== _p$.t && className(_el$7, _p$.t = _v$4);
1371
- _v$5 !== _p$.a && className(_el$8, _p$.a = _v$5);
1372
- return _p$;
1373
- }, {
1374
- e: void 0,
1375
- t: void 0,
1376
- a: void 0
1377
- });
1378
- return _el$6;
1379
- })();
1380
- }
1381
- const BaseTanStackRouterDevtoolsPanel = function BaseTanStackRouterDevtoolsPanel2({
1382
- ...props
1383
- }) {
1384
- const {
1385
- isOpen = true,
1386
- setIsOpen,
1387
- handleDragStart,
1388
- router,
1389
- routerState,
1390
- shadowDOMTarget,
1391
- ...panelProps
1392
- } = props;
1393
- const {
1394
- onCloseClick
1395
- } = useDevtoolsOnClose();
1396
- const styles = useStyles$1();
1397
- const {
1398
- className: className$1,
1399
- style,
1400
- ...otherPanelProps
1401
- } = panelProps;
1402
- invariant(router, "No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.");
1403
- const [currentTab, setCurrentTab] = useLocalStorage("tanstackRouterDevtoolsActiveTab", "routes");
1404
- const [activeId, setActiveId] = useLocalStorage("tanstackRouterDevtoolsActiveRouteId", "");
1405
- const [history, setHistory] = createSignal([]);
1406
- const [hasHistoryOverflowed, setHasHistoryOverflowed] = createSignal(false);
1407
- createEffect(() => {
1408
- const matches = routerState().matches;
1409
- const currentMatch = matches[matches.length - 1];
1410
- if (!currentMatch) {
1411
- return;
1412
- }
1413
- const historyUntracked = untrack(() => history());
1414
- const lastMatch = historyUntracked[0];
1415
- const sameLocation = lastMatch && lastMatch.pathname === currentMatch.pathname && JSON.stringify(lastMatch.search ?? {}) === JSON.stringify(currentMatch.search ?? {});
1416
- if (!lastMatch || !sameLocation) {
1417
- if (historyUntracked.length >= HISTORY_LIMIT) {
1418
- setHasHistoryOverflowed(true);
1419
- }
1420
- setHistory((prev) => {
1421
- const newHistory = [currentMatch, ...prev];
1422
- newHistory.splice(HISTORY_LIMIT);
1423
- return newHistory;
1424
- });
1425
- }
1426
- });
1427
- const activeMatch = createMemo(() => {
1428
- const matches = [...routerState().pendingMatches ?? [], ...routerState().matches, ...routerState().cachedMatches];
1429
- return matches.find((d) => d.routeId === activeId() || d.id === activeId());
1430
- });
1431
- const hasSearch = createMemo(() => Object.keys(routerState().location.search).length);
1432
- const explorerState = createMemo(() => {
1433
- return {
1434
- ...router(),
1435
- state: routerState()
1436
- };
1437
- });
1438
- const routerExplorerValue = createMemo(() => Object.fromEntries(multiSortBy(Object.keys(explorerState()), ["state", "routesById", "routesByPath", "options", "manifest"].map((d) => (dd) => dd !== d)).map((key) => [key, explorerState()[key]]).filter((d) => typeof d[1] !== "function" && !["__store", "basepath", "injectedHtml", "subscribers", "latestLoadPromise", "navigateTimeout", "resetNextScroll", "tempLocationKey", "latestLocation", "routeTree", "history"].includes(d[0]))));
1439
- const activeMatchLoaderData = createMemo(() => {
1440
- var _a;
1441
- return (_a = activeMatch()) == null ? void 0 : _a.loaderData;
1442
- });
1443
- const activeMatchValue = createMemo(() => activeMatch());
1444
- const locationSearchValue = createMemo(() => routerState().location.search);
1445
- return (() => {
1446
- var _el$11 = _tmpl$8(), _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$12.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$14.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild;
1447
- _el$20.firstChild;
1448
- var _el$22 = _el$20.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$25.nextSibling, _el$30 = _el$24.nextSibling;
1449
- spread(_el$11, mergeProps({
1450
- get ["class"]() {
1451
- return clsx(styles().devtoolsPanel, "TanStackRouterDevtoolsPanel", className$1 ? className$1() : "");
1452
- },
1453
- get style() {
1454
- return style ? style() : "";
1455
- }
1456
- }, otherPanelProps), false, true);
1457
- insert(_el$11, handleDragStart ? (() => {
1458
- var _el$34 = _tmpl$6();
1459
- addEventListener(_el$34, "mousedown", handleDragStart, true);
1460
- createRenderEffect(() => className(_el$34, styles().dragHandle));
1461
- return _el$34;
1462
- })() : null, _el$12);
1463
- _el$12.$$click = (e) => {
1464
- if (setIsOpen) {
1465
- setIsOpen(false);
1466
- }
1467
- onCloseClick(e);
1468
- };
1469
- insert(_el$15, createComponent(Logo, {
1470
- "aria-hidden": true,
1471
- onClick: (e) => {
1472
- if (setIsOpen) {
1473
- setIsOpen(false);
1474
- }
1475
- onCloseClick(e);
1476
- }
1477
- }));
1478
- insert(_el$17, createComponent(Explorer, {
1479
- label: "Router",
1480
- value: routerExplorerValue,
1481
- defaultExpanded: {
1482
- state: {},
1483
- context: {},
1484
- options: {}
1485
- },
1486
- filterSubEntries: (subEntries) => {
1487
- return subEntries.filter((d) => typeof d.value() !== "function");
1488
- }
1489
- }));
1490
- insert(_el$20, (() => {
1491
- var _c$2 = memo(() => !!routerState().location.maskedLocation);
1492
- return () => _c$2() ? (() => {
1493
- var _el$35 = _tmpl$9(), _el$36 = _el$35.firstChild;
1494
- createRenderEffect((_p$) => {
1495
- var _v$24 = styles().maskedBadgeContainer, _v$25 = styles().maskedBadge;
1496
- _v$24 !== _p$.e && className(_el$35, _p$.e = _v$24);
1497
- _v$25 !== _p$.t && className(_el$36, _p$.t = _v$25);
1498
- return _p$;
1499
- }, {
1500
- e: void 0,
1501
- t: void 0
1502
- });
1503
- return _el$35;
1504
- })() : null;
1505
- })(), null);
1506
- insert(_el$23, () => routerState().location.pathname);
1507
- insert(_el$22, (() => {
1508
- var _c$3 = memo(() => !!routerState().location.maskedLocation);
1509
- return () => _c$3() ? (() => {
1510
- var _el$37 = _tmpl$4();
1511
- insert(_el$37, () => {
1512
- var _a;
1513
- return (_a = routerState().location.maskedLocation) == null ? void 0 : _a.pathname;
1514
- });
1515
- createRenderEffect(() => className(_el$37, styles().maskedLocation));
1516
- return _el$37;
1517
- })() : null;
1518
- })(), null);
1519
- _el$26.$$click = () => {
1520
- setCurrentTab("routes");
1521
- };
1522
- _el$27.$$click = () => {
1523
- setCurrentTab("matches");
1524
- };
1525
- _el$28.$$click = () => {
1526
- setCurrentTab("history");
1527
- };
1528
- insert(_el$30, createComponent(Switch, {
1529
- get children() {
1530
- return [createComponent(Match, {
1531
- get when() {
1532
- return currentTab() === "routes";
1533
- },
1534
- get children() {
1535
- return createComponent(RouteComp, {
1536
- routerState,
1537
- router,
1538
- get route() {
1539
- return router().routeTree;
1540
- },
1541
- isRoot: true,
1542
- activeId,
1543
- setActiveId
1544
- });
1545
- }
1546
- }), createComponent(Match, {
1547
- get when() {
1548
- return currentTab() === "matches";
1549
- },
1550
- get children() {
1551
- var _el$31 = _tmpl$6();
1552
- insert(_el$31, () => {
1553
- var _a, _b;
1554
- return (_b = ((_a = routerState().pendingMatches) == null ? void 0 : _a.length) ? routerState().pendingMatches : routerState().matches) == null ? void 0 : _b.map((match, _i) => {
1555
- return (() => {
1556
- var _el$38 = _tmpl$0(), _el$39 = _el$38.firstChild;
1557
- _el$38.$$click = () => setActiveId(activeId() === match.id ? "" : match.id);
1558
- insert(_el$38, createComponent(NavigateLink, {
1559
- get left() {
1560
- return createComponent(NavigateButton, {
1561
- get to() {
1562
- return match.pathname;
1563
- },
1564
- get params() {
1565
- return match.params;
1566
- },
1567
- get search() {
1568
- return match.search;
1569
- },
1570
- router
1571
- });
1572
- },
1573
- get right() {
1574
- return createComponent(AgeTicker, {
1575
- match,
1576
- router
1577
- });
1578
- },
1579
- get children() {
1580
- var _el$40 = _tmpl$4();
1581
- insert(_el$40, () => `${match.routeId === rootRouteId ? rootRouteId : match.pathname}`);
1582
- createRenderEffect(() => className(_el$40, styles().matchID));
1583
- return _el$40;
1584
- }
1585
- }), null);
1586
- createRenderEffect((_p$) => {
1587
- var _v$26 = `Open match details for ${match.id}`, _v$27 = clsx(styles().matchRow(match === activeMatch())), _v$28 = clsx(styles().matchIndicator(getStatusColor(match)));
1588
- _v$26 !== _p$.e && setAttribute(_el$38, "aria-label", _p$.e = _v$26);
1589
- _v$27 !== _p$.t && className(_el$38, _p$.t = _v$27);
1590
- _v$28 !== _p$.a && className(_el$39, _p$.a = _v$28);
1591
- return _p$;
1592
- }, {
1593
- e: void 0,
1594
- t: void 0,
1595
- a: void 0
1596
- });
1597
- return _el$38;
1598
- })();
1599
- });
1600
- });
1601
- return _el$31;
1602
- }
1603
- }), createComponent(Match, {
1604
- get when() {
1605
- return currentTab() === "history";
1606
- },
1607
- get children() {
1608
- var _el$32 = _tmpl$7(), _el$33 = _el$32.firstChild;
1609
- insert(_el$33, createComponent(For, {
1610
- get each() {
1611
- return history();
1612
- },
1613
- children: (match, index) => (() => {
1614
- var _el$41 = _tmpl$1(), _el$42 = _el$41.firstChild;
1615
- insert(_el$41, createComponent(NavigateLink, {
1616
- get left() {
1617
- return createComponent(NavigateButton, {
1618
- get to() {
1619
- return match.pathname;
1620
- },
1621
- get params() {
1622
- return match.params;
1623
- },
1624
- get search() {
1625
- return match.search;
1626
- },
1627
- router
1628
- });
1629
- },
1630
- get right() {
1631
- return createComponent(AgeTicker, {
1632
- match,
1633
- router
1634
- });
1635
- },
1636
- get children() {
1637
- var _el$43 = _tmpl$4();
1638
- insert(_el$43, () => `${match.routeId === rootRouteId ? rootRouteId : match.pathname}`);
1639
- createRenderEffect(() => className(_el$43, styles().matchID));
1640
- return _el$43;
1641
- }
1642
- }), null);
1643
- createRenderEffect((_p$) => {
1644
- var _v$29 = clsx(styles().matchRow(match === activeMatch())), _v$30 = clsx(styles().matchIndicator(index() === 0 ? "green" : "gray"));
1645
- _v$29 !== _p$.e && className(_el$41, _p$.e = _v$29);
1646
- _v$30 !== _p$.t && className(_el$42, _p$.t = _v$30);
1647
- return _p$;
1648
- }, {
1649
- e: void 0,
1650
- t: void 0
1651
- });
1652
- return _el$41;
1653
- })()
1654
- }), null);
1655
- insert(_el$33, (() => {
1656
- var _c$4 = memo(() => !!hasHistoryOverflowed());
1657
- return () => _c$4() ? (() => {
1658
- var _el$44 = _tmpl$10();
1659
- createRenderEffect(() => className(_el$44, styles().historyOverflowContainer));
1660
- return _el$44;
1661
- })() : null;
1662
- })(), null);
1663
- return _el$32;
1664
- }
1665
- })];
1666
- }
1667
- }));
1668
- insert(_el$18, (() => {
1669
- var _c$5 = memo(() => !!routerState().cachedMatches.length);
1670
- return () => _c$5() ? (() => {
1671
- var _el$45 = _tmpl$11(), _el$46 = _el$45.firstChild, _el$47 = _el$46.firstChild, _el$48 = _el$47.nextSibling, _el$49 = _el$46.nextSibling;
1672
- insert(_el$49, () => routerState().cachedMatches.map((match) => {
1673
- return (() => {
1674
- var _el$50 = _tmpl$0(), _el$51 = _el$50.firstChild;
1675
- _el$50.$$click = () => setActiveId(activeId() === match.id ? "" : match.id);
1676
- insert(_el$50, createComponent(NavigateLink, {
1677
- get left() {
1678
- return createComponent(NavigateButton, {
1679
- get to() {
1680
- return match.pathname;
1681
- },
1682
- get params() {
1683
- return match.params;
1684
- },
1685
- get search() {
1686
- return match.search;
1687
- },
1688
- router
1689
- });
1690
- },
1691
- get right() {
1692
- return createComponent(AgeTicker, {
1693
- match,
1694
- router
1695
- });
1696
- },
1697
- get children() {
1698
- var _el$52 = _tmpl$4();
1699
- insert(_el$52, () => `${match.id}`);
1700
- createRenderEffect(() => className(_el$52, styles().matchID));
1701
- return _el$52;
1702
- }
1703
- }), null);
1704
- createRenderEffect((_p$) => {
1705
- var _v$34 = `Open match details for ${match.id}`, _v$35 = clsx(styles().matchRow(match === activeMatch())), _v$36 = clsx(styles().matchIndicator(getStatusColor(match)));
1706
- _v$34 !== _p$.e && setAttribute(_el$50, "aria-label", _p$.e = _v$34);
1707
- _v$35 !== _p$.t && className(_el$50, _p$.t = _v$35);
1708
- _v$36 !== _p$.a && className(_el$51, _p$.a = _v$36);
1709
- return _p$;
1710
- }, {
1711
- e: void 0,
1712
- t: void 0,
1713
- a: void 0
1714
- });
1715
- return _el$50;
1716
- })();
1717
- }));
1718
- createRenderEffect((_p$) => {
1719
- var _v$31 = styles().cachedMatchesContainer, _v$32 = styles().detailsHeader, _v$33 = styles().detailsHeaderInfo;
1720
- _v$31 !== _p$.e && className(_el$45, _p$.e = _v$31);
1721
- _v$32 !== _p$.t && className(_el$46, _p$.t = _v$32);
1722
- _v$33 !== _p$.a && className(_el$48, _p$.a = _v$33);
1723
- return _p$;
1724
- }, {
1725
- e: void 0,
1726
- t: void 0,
1727
- a: void 0
1728
- });
1729
- return _el$45;
1730
- })() : null;
1731
- })(), null);
1732
- insert(_el$11, (() => {
1733
- var _c$6 = memo(() => {
1734
- var _a;
1735
- return !!(activeMatch() && ((_a = activeMatch()) == null ? void 0 : _a.status));
1736
- });
1737
- return () => _c$6() ? (() => {
1738
- var _el$53 = _tmpl$12(), _el$54 = _el$53.firstChild, _el$55 = _el$54.nextSibling, _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$57.firstChild, _el$59 = _el$57.nextSibling, _el$60 = _el$59.firstChild, _el$61 = _el$60.nextSibling, _el$62 = _el$61.firstChild, _el$63 = _el$59.nextSibling, _el$64 = _el$63.firstChild, _el$65 = _el$64.nextSibling, _el$66 = _el$63.nextSibling, _el$67 = _el$66.firstChild, _el$68 = _el$67.nextSibling, _el$69 = _el$55.nextSibling, _el$70 = _el$69.nextSibling;
1739
- insert(_el$58, (() => {
1740
- var _c$8 = memo(() => {
1741
- var _a, _b;
1742
- return !!(((_a = activeMatch()) == null ? void 0 : _a.status) === "success" && ((_b = activeMatch()) == null ? void 0 : _b.isFetching));
1743
- });
1744
- return () => {
1745
- var _a;
1746
- return _c$8() ? "fetching" : (_a = activeMatch()) == null ? void 0 : _a.status;
1747
- };
1748
- })());
1749
- insert(_el$62, () => {
1750
- var _a;
1751
- return (_a = activeMatch()) == null ? void 0 : _a.id;
1752
- });
1753
- insert(_el$65, (() => {
1754
- var _c$9 = memo(() => {
1755
- var _a;
1756
- return !!((_a = routerState().pendingMatches) == null ? void 0 : _a.find((d) => {
1757
- var _a2;
1758
- return d.id === ((_a2 = activeMatch()) == null ? void 0 : _a2.id);
1759
- }));
1760
- });
1761
- return () => _c$9() ? "Pending" : routerState().matches.find((d) => {
1762
- var _a;
1763
- return d.id === ((_a = activeMatch()) == null ? void 0 : _a.id);
1764
- }) ? "Active" : "Cached";
1765
- })());
1766
- insert(_el$68, (() => {
1767
- var _c$0 = memo(() => {
1768
- var _a;
1769
- return !!((_a = activeMatch()) == null ? void 0 : _a.updatedAt);
1770
- });
1771
- return () => {
1772
- var _a;
1773
- return _c$0() ? new Date((_a = activeMatch()) == null ? void 0 : _a.updatedAt).toLocaleTimeString() : "N/A";
1774
- };
1775
- })());
1776
- insert(_el$53, (() => {
1777
- var _c$1 = memo(() => !!activeMatchLoaderData());
1778
- return () => _c$1() ? [(() => {
1779
- var _el$71 = _tmpl$13();
1780
- createRenderEffect(() => className(_el$71, styles().detailsHeader));
1781
- return _el$71;
1782
- })(), (() => {
1783
- var _el$72 = _tmpl$6();
1784
- insert(_el$72, createComponent(Explorer, {
1785
- label: "loaderData",
1786
- value: activeMatchLoaderData,
1787
- defaultExpanded: {}
1788
- }));
1789
- createRenderEffect(() => className(_el$72, styles().detailsContent));
1790
- return _el$72;
1791
- })()] : null;
1792
- })(), _el$69);
1793
- insert(_el$70, createComponent(Explorer, {
1794
- label: "Match",
1795
- value: activeMatchValue,
1796
- defaultExpanded: {}
1797
- }));
1798
- createRenderEffect((_p$) => {
1799
- var _a, _b;
1800
- var _v$37 = styles().thirdContainer, _v$38 = styles().detailsHeader, _v$39 = styles().matchDetails, _v$40 = styles().matchStatus((_a = activeMatch()) == null ? void 0 : _a.status, (_b = activeMatch()) == null ? void 0 : _b.isFetching), _v$41 = styles().matchDetailsInfoLabel, _v$42 = styles().matchDetailsInfo, _v$43 = styles().matchDetailsInfoLabel, _v$44 = styles().matchDetailsInfo, _v$45 = styles().matchDetailsInfoLabel, _v$46 = styles().matchDetailsInfo, _v$47 = styles().detailsHeader, _v$48 = styles().detailsContent;
1801
- _v$37 !== _p$.e && className(_el$53, _p$.e = _v$37);
1802
- _v$38 !== _p$.t && className(_el$54, _p$.t = _v$38);
1803
- _v$39 !== _p$.a && className(_el$56, _p$.a = _v$39);
1804
- _v$40 !== _p$.o && className(_el$57, _p$.o = _v$40);
1805
- _v$41 !== _p$.i && className(_el$59, _p$.i = _v$41);
1806
- _v$42 !== _p$.n && className(_el$61, _p$.n = _v$42);
1807
- _v$43 !== _p$.s && className(_el$63, _p$.s = _v$43);
1808
- _v$44 !== _p$.h && className(_el$65, _p$.h = _v$44);
1809
- _v$45 !== _p$.r && className(_el$66, _p$.r = _v$45);
1810
- _v$46 !== _p$.d && className(_el$68, _p$.d = _v$46);
1811
- _v$47 !== _p$.l && className(_el$69, _p$.l = _v$47);
1812
- _v$48 !== _p$.u && className(_el$70, _p$.u = _v$48);
1813
- return _p$;
1814
- }, {
1815
- e: void 0,
1816
- t: void 0,
1817
- a: void 0,
1818
- o: void 0,
1819
- i: void 0,
1820
- n: void 0,
1821
- s: void 0,
1822
- h: void 0,
1823
- r: void 0,
1824
- d: void 0,
1825
- l: void 0,
1826
- u: void 0
1827
- });
1828
- return _el$53;
1829
- })() : null;
1830
- })(), null);
1831
- insert(_el$11, (() => {
1832
- var _c$7 = memo(() => !!hasSearch());
1833
- return () => _c$7() ? (() => {
1834
- var _el$73 = _tmpl$14(), _el$74 = _el$73.firstChild;
1835
- _el$74.firstChild;
1836
- var _el$76 = _el$74.nextSibling;
1837
- insert(_el$74, typeof navigator !== "undefined" ? (() => {
1838
- var _el$77 = _tmpl$15();
1839
- insert(_el$77, createComponent(CopyButton, {
1840
- getValue: () => {
1841
- const search = routerState().location.search;
1842
- return JSON.stringify(search);
1843
- }
1844
- }));
1845
- return _el$77;
1846
- })() : null, null);
1847
- insert(_el$76, createComponent(Explorer, {
1848
- value: locationSearchValue,
1849
- get defaultExpanded() {
1850
- return Object.keys(routerState().location.search).reduce((obj, next) => {
1851
- obj[next] = {};
1852
- return obj;
1853
- }, {});
1854
- }
1855
- }));
1856
- createRenderEffect((_p$) => {
1857
- var _v$49 = styles().fourthContainer, _v$50 = styles().detailsHeader, _v$51 = styles().detailsContent;
1858
- _v$49 !== _p$.e && className(_el$73, _p$.e = _v$49);
1859
- _v$50 !== _p$.t && className(_el$74, _p$.t = _v$50);
1860
- _v$51 !== _p$.a && className(_el$76, _p$.a = _v$51);
1861
- return _p$;
1862
- }, {
1863
- e: void 0,
1864
- t: void 0,
1865
- a: void 0
1866
- });
1867
- return _el$73;
1868
- })() : null;
1869
- })(), null);
1870
- createRenderEffect((_p$) => {
1871
- var _v$6 = styles().panelCloseBtn, _v$7 = styles().panelCloseBtnIcon, _v$8 = styles().firstContainer, _v$9 = styles().row, _v$0 = styles().routerExplorerContainer, _v$1 = styles().routerExplorer, _v$10 = styles().secondContainer, _v$11 = styles().matchesContainer, _v$12 = styles().detailsHeader, _v$13 = styles().detailsContent, _v$14 = styles().detailsHeader, _v$15 = styles().routeMatchesToggle, _v$16 = currentTab() === "routes", _v$17 = clsx(styles().routeMatchesToggleBtn(currentTab() === "routes", true)), _v$18 = currentTab() === "matches", _v$19 = clsx(styles().routeMatchesToggleBtn(currentTab() === "matches", true)), _v$20 = currentTab() === "history", _v$21 = clsx(styles().routeMatchesToggleBtn(currentTab() === "history", false)), _v$22 = styles().detailsHeaderInfo, _v$23 = clsx(styles().routesContainer);
1872
- _v$6 !== _p$.e && className(_el$12, _p$.e = _v$6);
1873
- _v$7 !== _p$.t && setAttribute(_el$13, "class", _p$.t = _v$7);
1874
- _v$8 !== _p$.a && className(_el$14, _p$.a = _v$8);
1875
- _v$9 !== _p$.o && className(_el$15, _p$.o = _v$9);
1876
- _v$0 !== _p$.i && className(_el$16, _p$.i = _v$0);
1877
- _v$1 !== _p$.n && className(_el$17, _p$.n = _v$1);
1878
- _v$10 !== _p$.s && className(_el$18, _p$.s = _v$10);
1879
- _v$11 !== _p$.h && className(_el$19, _p$.h = _v$11);
1880
- _v$12 !== _p$.r && className(_el$20, _p$.r = _v$12);
1881
- _v$13 !== _p$.d && className(_el$22, _p$.d = _v$13);
1882
- _v$14 !== _p$.l && className(_el$24, _p$.l = _v$14);
1883
- _v$15 !== _p$.u && className(_el$25, _p$.u = _v$15);
1884
- _v$16 !== _p$.c && (_el$26.disabled = _p$.c = _v$16);
1885
- _v$17 !== _p$.w && className(_el$26, _p$.w = _v$17);
1886
- _v$18 !== _p$.m && (_el$27.disabled = _p$.m = _v$18);
1887
- _v$19 !== _p$.f && className(_el$27, _p$.f = _v$19);
1888
- _v$20 !== _p$.y && (_el$28.disabled = _p$.y = _v$20);
1889
- _v$21 !== _p$.g && className(_el$28, _p$.g = _v$21);
1890
- _v$22 !== _p$.p && className(_el$29, _p$.p = _v$22);
1891
- _v$23 !== _p$.b && className(_el$30, _p$.b = _v$23);
1892
- return _p$;
1893
- }, {
1894
- e: void 0,
1895
- t: void 0,
1896
- a: void 0,
1897
- o: void 0,
1898
- i: void 0,
1899
- n: void 0,
1900
- s: void 0,
1901
- h: void 0,
1902
- r: void 0,
1903
- d: void 0,
1904
- l: void 0,
1905
- u: void 0,
1906
- c: void 0,
1907
- w: void 0,
1908
- m: void 0,
1909
- f: void 0,
1910
- y: void 0,
1911
- g: void 0,
1912
- p: void 0,
1913
- b: void 0
1914
- });
1915
- return _el$11;
1916
- })();
1917
- };
1918
- function CopyButton({
1919
- getValue
1920
- }) {
1921
- const [copied, setCopied] = createSignal(false);
1922
- let timeoutId = null;
1923
- const handleCopy = async () => {
1924
- var _a;
1925
- if (typeof navigator === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
1926
- console.warn("TanStack Router Devtools: Clipboard API unavailable");
1927
- return;
1928
- }
1929
- try {
1930
- const value = getValue();
1931
- await navigator.clipboard.writeText(value);
1932
- setCopied(true);
1933
- if (timeoutId) clearTimeout(timeoutId);
1934
- timeoutId = setTimeout(() => setCopied(false), 2500);
1935
- } catch (e) {
1936
- console.error("TanStack Router Devtools: Failed to copy", e);
1937
- }
1938
- };
1939
- onCleanup(() => {
1940
- if (timeoutId) clearTimeout(timeoutId);
1941
- });
1942
- return (() => {
1943
- var _el$78 = _tmpl$16();
1944
- _el$78.$$click = handleCopy;
1945
- insert(_el$78, () => copied() ? "✅" : "📋");
1946
- createRenderEffect(() => setAttribute(_el$78, "title", copied() ? "Copied!" : "Copy"));
1947
- return _el$78;
1948
- })();
1949
- }
1950
- delegateEvents(["click", "mousedown"]);
1951
- const BaseTanStackRouterDevtoolsPanel$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1952
- __proto__: null,
1953
- BaseTanStackRouterDevtoolsPanel,
1954
- default: BaseTanStackRouterDevtoolsPanel
1955
- }, Symbol.toStringTag, { value: "Module" }));
1956
- export {
1957
- BaseTanStackRouterDevtoolsPanel as B,
1958
- useIsMounted as a,
1959
- useStyles$1 as b,
1960
- BaseTanStackRouterDevtoolsPanel$1 as c,
1961
- useLocalStorage as u
1962
- };
1963
- //# sourceMappingURL=BaseTanStackRouterDevtoolsPanel-DxaCaP75.js.map