@tanstack/router-devtools-core 1.132.50 → 1.132.51

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