@tanstack/router-devtools-core 1.132.50 → 1.133.0

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