@emeryld/rrroutes-openapi 2.6.5 → 2.7.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 (79) hide show
  1. package/dist/index.cjs +0 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.mjs +0 -1
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/public/assets/docs.css +1 -1
  6. package/dist/public/assets/docs.js +189 -90
  7. package/dist/web/v2/AppShell.d.ts +3 -1
  8. package/dist/web/v2/components/request/LastRunPanel.d.ts +0 -5
  9. package/dist/web/v2/hooks/useLeafEndpoint.d.ts +2 -2
  10. package/dist/web/v2/stores/playgroundSettingsStore.d.ts +0 -10
  11. package/dist/web/v2/types/types.cacheLog.d.ts +135 -49
  12. package/dist/web/v2/types/types.endpoint.d.ts +194 -140
  13. package/dist/web/v2/types/types.log.d.ts +48 -19
  14. package/dist/web/v2/types/types.preset.d.ts +168 -84
  15. package/dist/web/v2/types/types.requestLog.d.ts +135 -90
  16. package/dist/web/v2/types/types.scheduling.d.ts +87 -37
  17. package/dist/web/v2/types/types.socket.d.ts +69 -33
  18. package/package.json +9 -12
  19. package/dist/public/assets/Add.js +0 -1
  20. package/dist/public/assets/Autocomplete.js +0 -1
  21. package/dist/public/assets/BaseFilterBar.js +0 -1
  22. package/dist/public/assets/BentoGrid.js +0 -1
  23. package/dist/public/assets/CacheLogsPage.js +0 -1
  24. package/dist/public/assets/DeleteOutline.js +0 -1
  25. package/dist/public/assets/DiffPage.js +0 -7
  26. package/dist/public/assets/Download.js +0 -1
  27. package/dist/public/assets/EndpointDetailPage.js +0 -1
  28. package/dist/public/assets/EndpointDetailPanel.js +0 -1
  29. package/dist/public/assets/EndpointPlaygroundPage.js +0 -1
  30. package/dist/public/assets/ExpandLess.js +0 -1
  31. package/dist/public/assets/ExportButton.js +0 -2
  32. package/dist/public/assets/FlowBuilderPage.js +0 -20
  33. package/dist/public/assets/HistoryPage.js +0 -1
  34. package/dist/public/assets/LogsPage.js +0 -1
  35. package/dist/public/assets/PageContainer.js +0 -3
  36. package/dist/public/assets/PlayArrow.js +0 -1
  37. package/dist/public/assets/PresetsPage.js +0 -4
  38. package/dist/public/assets/RoutesPage.js +0 -1
  39. package/dist/public/assets/SchedulingPage.js +0 -1
  40. package/dist/public/assets/SchemaTreeView.js +0 -1
  41. package/dist/public/assets/SettingsPage.js +0 -1
  42. package/dist/public/assets/SocketsPage.js +0 -1
  43. package/dist/public/assets/filterTypes.js +0 -1
  44. package/dist/public/assets/getValidReactChildren.js +0 -1
  45. package/dist/public/assets/kvRowAdapters.js +0 -1
  46. package/dist/public/assets/schemaDefaults.js +0 -1
  47. package/dist/public/assets/useEndpointOptions.js +0 -1
  48. package/dist/public/assets/useQueryState.js +0 -1
  49. package/dist/public/assets/vendor-recharts.js +0 -99
  50. package/dist/public/assets/vendor-xyflow.js +0 -15
  51. package/dist/web/v2/components/diff/DiffViewer.d.ts +0 -7
  52. package/dist/web/v2/components/diff/RequestDiffSelector.d.ts +0 -15
  53. package/dist/web/v2/components/diff/SchemaDiffViewer.d.ts +0 -7
  54. package/dist/web/v2/components/feedback/CopyAsMenu.d.ts +0 -10
  55. package/dist/web/v2/components/feedback/CopySnackbar.d.ts +0 -1
  56. package/dist/web/v2/components/flows/FlowCanvas.d.ts +0 -13
  57. package/dist/web/v2/components/flows/FlowNodeEditor.d.ts +0 -8
  58. package/dist/web/v2/components/flows/FlowRunProgress.d.ts +0 -7
  59. package/dist/web/v2/components/flows/FlowVariablePanel.d.ts +0 -7
  60. package/dist/web/v2/components/flows/nodes/ConditionNode.d.ts +0 -7
  61. package/dist/web/v2/components/flows/nodes/DelayNode.d.ts +0 -7
  62. package/dist/web/v2/components/flows/nodes/ExtractNode.d.ts +0 -8
  63. package/dist/web/v2/components/flows/nodes/RequestNode.d.ts +0 -10
  64. package/dist/web/v2/components/layout/ActivityBar.d.ts +0 -1
  65. package/dist/web/v2/components/layout/BentoGrid.d.ts +0 -17
  66. package/dist/web/v2/components/layout/ContentArea.d.ts +0 -1
  67. package/dist/web/v2/components/layout/PanelRegistry.d.ts +0 -17
  68. package/dist/web/v2/components/request/TimingBreakdown.d.ts +0 -11
  69. package/dist/web/v2/components/requests/timeline/TimelinePhaseBar.d.ts +0 -13
  70. package/dist/web/v2/components/requests/timeline/TimelineWaterfall.d.ts +0 -12
  71. package/dist/web/v2/pages/DiffPage.d.ts +0 -1
  72. package/dist/web/v2/pages/FlowBuilderPage.d.ts +0 -1
  73. package/dist/web/v2/stores/flowStore.d.ts +0 -70
  74. package/dist/web/v2/stores/layoutStore.d.ts +0 -13
  75. package/dist/web/v2/stores/snackbarStore.d.ts +0 -17
  76. package/dist/web/v2/utils/codeGeneration.d.ts +0 -12
  77. package/dist/web/v2/utils/diffUtils.d.ts +0 -11
  78. package/dist/web/v2/utils/flowRunner.d.ts +0 -17
  79. package/dist/web/v2/utils/templateResolver.d.ts +0 -4
@@ -166,27 +166,55 @@ export declare const schedulingLeaves: readonly [{
166
166
  totalCount: z.ZodOptional<z.ZodNumber>;
167
167
  nextCursor: z.ZodOptional<z.ZodString>;
168
168
  }, z.core.$strip>;
169
- }>> & {
170
- outputSchema: z.ZodObject<{
171
- out: z.ZodArray<z.ZodObject<{
172
- id: z.ZodString;
173
- name: z.ZodString;
174
- description: z.ZodOptional<z.ZodString>;
175
- groupId: z.ZodOptional<z.ZodString>;
176
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
177
- createdAt: z.ZodNumber;
178
- updatedAt: z.ZodNumber;
179
- scheduledAt: z.ZodNumber;
180
- startedAt: z.ZodOptional<z.ZodNumber>;
181
- completedAt: z.ZodOptional<z.ZodNumber>;
182
- status: z.ZodString;
183
- }, z.core.$strip>>;
184
- meta: z.ZodObject<{
185
- totalCount: z.ZodOptional<z.ZodNumber>;
186
- nextCursor: z.ZodOptional<z.ZodString>;
187
- }, z.core.$strip>;
169
+ }>> & import("@emeryld/rrroutes-contract").OutputField<import("@emeryld/rrroutes-contract").Prettify<Omit<{
170
+ feed: true;
171
+ outputSchema: z.ZodArray<z.ZodObject<{
172
+ id: z.ZodString;
173
+ name: z.ZodString;
174
+ description: z.ZodOptional<z.ZodString>;
175
+ groupId: z.ZodOptional<z.ZodString>;
176
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
177
+ createdAt: z.ZodNumber;
178
+ updatedAt: z.ZodNumber;
179
+ scheduledAt: z.ZodNumber;
180
+ startedAt: z.ZodOptional<z.ZodNumber>;
181
+ completedAt: z.ZodOptional<z.ZodNumber>;
182
+ status: z.ZodString;
183
+ }, z.core.$strip>>;
184
+ querySchema: z.ZodObject<{
185
+ beforeDate: z.ZodOptional<z.ZodString>;
186
+ afterDate: z.ZodOptional<z.ZodString>;
187
+ orderBy: z.ZodOptional<z.ZodString>;
188
+ orderDirection: z.ZodOptional<z.ZodEnum<{
189
+ asc: "asc";
190
+ desc: "desc";
191
+ }>>;
192
+ searchQuery: z.ZodOptional<z.ZodString>;
193
+ groupsInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
194
+ groupsExclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
+ tagsInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
196
+ tagsExclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
197
+ statusesInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
198
+ statusesExclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
188
199
  }, z.core.$strip>;
189
- } & {
200
+ outputMetaSchema: z.ZodObject<{
201
+ totalCount: z.ZodOptional<z.ZodNumber>;
202
+ nextCursor: z.ZodOptional<z.ZodString>;
203
+ }, z.core.$strip>;
204
+ queryExtensionSchema: z.ZodObject<{
205
+ cursor: z.ZodOptional<z.ZodString>;
206
+ pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
207
+ }, z.core.$strip>;
208
+ }, "queryExtensionSchema" | "outputMetaSchema"> & {
209
+ queryExtensionSchema: z.ZodObject<{
210
+ cursor: z.ZodOptional<z.ZodString>;
211
+ pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
212
+ }, z.core.$strip>;
213
+ outputMetaSchema: z.ZodObject<{
214
+ totalCount: z.ZodOptional<z.ZodNumber>;
215
+ nextCursor: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strip>;
217
+ }>> & {
190
218
  paramsSchema: undefined;
191
219
  }>, "outputMetaSchema" | "bodySchema" | "querySchema" | "paramsSchema" | "outputSchema"> & {
192
220
  bodySchema: import("@emeryld/rrroutes-contract").RouteSchema<unknown, unknown> | undefined;
@@ -354,18 +382,33 @@ export declare const schedulingLeaves: readonly [{
354
382
  totalCount: z.ZodOptional<z.ZodNumber>;
355
383
  nextCursor: z.ZodOptional<z.ZodString>;
356
384
  }, z.core.$strip>;
357
- }>> & {
358
- outputSchema: z.ZodObject<{
359
- out: z.ZodArray<z.ZodObject<{
360
- name: z.ZodString;
361
- payload: z.ZodString;
362
- }, z.core.$strip>>;
363
- meta: z.ZodObject<{
364
- totalCount: z.ZodOptional<z.ZodNumber>;
365
- nextCursor: z.ZodOptional<z.ZodString>;
366
- }, z.core.$strip>;
385
+ }>> & import("@emeryld/rrroutes-contract").OutputField<import("@emeryld/rrroutes-contract").Prettify<Omit<{
386
+ feed: true;
387
+ outputSchema: z.ZodArray<z.ZodObject<{
388
+ name: z.ZodString;
389
+ payload: z.ZodString;
390
+ }, z.core.$strip>>;
391
+ querySchema: z.ZodObject<{
392
+ name: z.ZodOptional<z.ZodString>;
367
393
  }, z.core.$strip>;
368
- } & {
394
+ outputMetaSchema: z.ZodObject<{
395
+ totalCount: z.ZodOptional<z.ZodNumber>;
396
+ nextCursor: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strip>;
398
+ queryExtensionSchema: z.ZodObject<{
399
+ cursor: z.ZodOptional<z.ZodString>;
400
+ pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
401
+ }, z.core.$strip>;
402
+ }, "queryExtensionSchema" | "outputMetaSchema"> & {
403
+ queryExtensionSchema: z.ZodObject<{
404
+ cursor: z.ZodOptional<z.ZodString>;
405
+ pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
406
+ }, z.core.$strip>;
407
+ outputMetaSchema: z.ZodObject<{
408
+ totalCount: z.ZodOptional<z.ZodNumber>;
409
+ nextCursor: z.ZodOptional<z.ZodString>;
410
+ }, z.core.$strip>;
411
+ }>> & {
369
412
  paramsSchema: undefined;
370
413
  }>, "outputMetaSchema" | "bodySchema" | "querySchema" | "paramsSchema" | "outputSchema"> & {
371
414
  bodySchema: import("@emeryld/rrroutes-contract").RouteSchema<unknown, unknown> | undefined;
@@ -471,14 +514,21 @@ export declare const schedulingLeaves: readonly [{
471
514
  feed?: boolean;
472
515
  } & {
473
516
  querySchema?: undefined;
474
- } & {
517
+ } & import("@emeryld/rrroutes-contract").OutputField<import("@emeryld/rrroutes-contract").Prettify<Omit<import("@emeryld/rrroutes-contract").Prettify<Omit<{
518
+ bodySchema: z.ZodObject<{
519
+ name: z.ZodString;
520
+ payload: z.ZodAny;
521
+ runAt: z.ZodCoercedDate<unknown>;
522
+ }, z.core.$strip>;
475
523
  outputSchema: z.ZodObject<{
476
- out: z.ZodObject<{
477
- success: z.ZodBoolean;
478
- }, z.core.$strip>;
479
- meta: z.ZodOptional<z.ZodString>;
524
+ success: z.ZodBoolean;
480
525
  }, z.core.$strip>;
481
- } & {
526
+ }, "feed"> & {
527
+ feed: false;
528
+ }>, "queryExtensionSchema" | "outputMetaSchema"> & {
529
+ queryExtensionSchema: undefined;
530
+ outputMetaSchema: undefined;
531
+ }>> & {
482
532
  paramsSchema: undefined;
483
533
  }>, "outputMetaSchema" | "bodySchema" | "querySchema" | "paramsSchema" | "outputSchema"> & {
484
534
  bodySchema: import("@emeryld/rrroutes-contract").RouteSchema<{
@@ -192,33 +192,62 @@ export declare const socketLeaves: readonly [{
192
192
  totalCount: z.ZodOptional<z.ZodNumber>;
193
193
  nextCursor: z.ZodOptional<z.ZodString>;
194
194
  }, z.core.$strip>;
195
- }>> & {
196
- outputSchema: z.ZodObject<{
197
- out: z.ZodArray<z.ZodObject<{
198
- id: z.ZodString;
199
- description: z.ZodOptional<z.ZodString>;
200
- groupId: z.ZodOptional<z.ZodString>;
201
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
202
- createdAt: z.ZodNumber;
203
- updatedAt: z.ZodNumber;
204
- name: z.ZodString;
205
- message: z.ZodOptional<z.ZodAny>;
206
- origin: z.ZodUnion<readonly [z.ZodLiteral<"server">, z.ZodString]>;
207
- direction: z.ZodEnum<{
208
- incoming: "incoming";
209
- outgoing: "outgoing";
210
- broadcast: "broadcast";
211
- }>;
212
- socketId: z.ZodOptional<z.ZodString>;
213
- rooms: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
- except: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
- }, z.core.$strip>>;
216
- meta: z.ZodObject<{
217
- totalCount: z.ZodOptional<z.ZodNumber>;
218
- nextCursor: z.ZodOptional<z.ZodString>;
219
- }, z.core.$strip>;
195
+ }>> & import("@emeryld/rrroutes-contract").OutputField<import("@emeryld/rrroutes-contract").Prettify<Omit<{
196
+ feed: true;
197
+ outputSchema: z.ZodArray<z.ZodObject<{
198
+ id: z.ZodString;
199
+ description: z.ZodOptional<z.ZodString>;
200
+ groupId: z.ZodOptional<z.ZodString>;
201
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
202
+ createdAt: z.ZodNumber;
203
+ updatedAt: z.ZodNumber;
204
+ name: z.ZodString;
205
+ message: z.ZodOptional<z.ZodAny>;
206
+ origin: z.ZodUnion<readonly [z.ZodLiteral<"server">, z.ZodString]>;
207
+ direction: z.ZodEnum<{
208
+ incoming: "incoming";
209
+ outgoing: "outgoing";
210
+ broadcast: "broadcast";
211
+ }>;
212
+ socketId: z.ZodOptional<z.ZodString>;
213
+ rooms: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
+ except: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ }, z.core.$strip>>;
216
+ querySchema: z.ZodObject<{
217
+ beforeDate: z.ZodOptional<z.ZodString>;
218
+ afterDate: z.ZodOptional<z.ZodString>;
219
+ orderBy: z.ZodOptional<z.ZodString>;
220
+ orderDirection: z.ZodOptional<z.ZodEnum<{
221
+ asc: "asc";
222
+ desc: "desc";
223
+ }>>;
224
+ searchQuery: z.ZodOptional<z.ZodString>;
225
+ groupsInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
226
+ groupsExclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
227
+ tagsInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
228
+ tagsExclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
+ eventName: z.ZodOptional<z.ZodString>;
230
+ roomsInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
231
+ roomsExclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
220
232
  }, z.core.$strip>;
221
- } & {
233
+ outputMetaSchema: z.ZodObject<{
234
+ totalCount: z.ZodOptional<z.ZodNumber>;
235
+ nextCursor: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strip>;
237
+ queryExtensionSchema: z.ZodObject<{
238
+ cursor: z.ZodOptional<z.ZodString>;
239
+ pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
240
+ }, z.core.$strip>;
241
+ }, "queryExtensionSchema" | "outputMetaSchema"> & {
242
+ queryExtensionSchema: z.ZodObject<{
243
+ cursor: z.ZodOptional<z.ZodString>;
244
+ pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
245
+ }, z.core.$strip>;
246
+ outputMetaSchema: z.ZodObject<{
247
+ totalCount: z.ZodOptional<z.ZodNumber>;
248
+ nextCursor: z.ZodOptional<z.ZodString>;
249
+ }, z.core.$strip>;
250
+ }>> & {
222
251
  paramsSchema: undefined;
223
252
  }>, "outputMetaSchema" | "bodySchema" | "querySchema" | "paramsSchema" | "outputSchema"> & {
224
253
  bodySchema: import("@emeryld/rrroutes-contract").RouteSchema<unknown, unknown> | undefined;
@@ -367,15 +396,22 @@ export declare const socketLeaves: readonly [{
367
396
  feed?: boolean;
368
397
  } & {
369
398
  querySchema?: undefined;
370
- } & {
399
+ } & import("@emeryld/rrroutes-contract").OutputField<import("@emeryld/rrroutes-contract").Prettify<Omit<import("@emeryld/rrroutes-contract").Prettify<Omit<{
400
+ bodySchema: z.ZodObject<{
401
+ eventName: z.ZodString;
402
+ message: z.ZodOptional<z.ZodJSONSchema>;
403
+ toRoomId: z.ZodNullable<z.ZodArray<z.ZodString>>;
404
+ }, z.core.$strip>;
371
405
  outputSchema: z.ZodObject<{
372
- out: z.ZodObject<{
373
- success: z.ZodBoolean;
374
- eventId: z.ZodOptional<z.ZodString>;
375
- }, z.core.$strip>;
376
- meta: z.ZodOptional<z.ZodString>;
406
+ success: z.ZodBoolean;
407
+ eventId: z.ZodOptional<z.ZodString>;
377
408
  }, z.core.$strip>;
378
- } & {
409
+ }, "feed"> & {
410
+ feed: false;
411
+ }>, "queryExtensionSchema" | "outputMetaSchema"> & {
412
+ queryExtensionSchema: undefined;
413
+ outputMetaSchema: undefined;
414
+ }>> & {
379
415
  paramsSchema: undefined;
380
416
  }>, "outputMetaSchema" | "bodySchema" | "querySchema" | "paramsSchema" | "outputSchema"> & {
381
417
  bodySchema: import("@emeryld/rrroutes-contract").RouteSchema<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-openapi",
3
- "version": "2.6.5",
3
+ "version": "2.7.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -17,20 +17,18 @@
17
17
  "dist"
18
18
  ],
19
19
  "dependencies": {
20
- "@emeryld/rrroutes-client": "^2.5.5",
21
- "@emeryld/rrroutes-contract": "^2.5.6",
20
+ "@emeryld/rrroutes-client": "^2.7.13",
21
+ "@emeryld/rrroutes-contract": "^2.6.6",
22
22
  "@emotion/cache": "^11.14.0",
23
23
  "@emotion/react": "^11.14.0",
24
24
  "@emotion/styled": "^11.14.1",
25
- "@mui/icons-material": "^7.3.7",
26
- "@mui/material": "^7.3.7",
27
- "@tanstack/react-query": "^5.90.20",
28
- "@xyflow/react": "^12.10.0",
29
- "diff": "^8.0.3",
25
+ "@mui/icons-material": "^7.3.9",
26
+ "@mui/material": "^7.3.9",
27
+ "@tanstack/react-query": "^5.96.2",
30
28
  "react": "^18.3.1",
31
29
  "react-dom": "^18.3.1",
32
- "react-router-dom": "^7.13.0",
33
- "recharts": "^3.7.0",
30
+ "react-router-dom": "^7.14.0",
31
+ "recharts": "^3.8.1",
34
32
  "socket.io-client": "^4.8.3",
35
33
  "zod": "^4.3.6"
36
34
  },
@@ -38,8 +36,7 @@
38
36
  "express": "^5.1.0"
39
37
  },
40
38
  "devDependencies": {
41
- "@jest/globals": "^30.2.0",
42
- "@types/diff": "^8.0.0",
39
+ "@jest/globals": "^30.3.0",
43
40
  "@types/express": "^5.0.6",
44
41
  "@types/react": "^18.3.28",
45
42
  "@types/react-dom": "^18.3.7",
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-xyflow.js";import{R as t}from"./docs.js";const h=t(o.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}));export{h as A};
@@ -1 +0,0 @@
1
- import{h as b,m as Ge}from"./vendor-recharts.js";import{A as Ft,f as xe,i as ue,o as Ct,a as ut}from"./PageContainer.js";import{ba as Vt,K as ct,bb as Ue,bc as Ht,I as wt,J as Rt,U as Dt,M as Ke,N as Tt,O as E,W as ce,bd as zt,L as dt,b1 as Mt,be as Nt,j as jt,a1 as Et}from"./docs.js";import{j as x}from"./vendor-xyflow.js";function Wt(o){const r=b.useRef({});return b.useEffect(()=>{r.current=o}),r.current}function $t({array1:o,array2:r,parser:p=f=>f}){return o&&r&&o.length===r.length&&o.every((f,C)=>p(f)===p(r[C]))}function St(o){return o.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Bt(o={}){const{ignoreAccents:r=!0,ignoreCase:p=!0,limit:f,matchFrom:C="any",stringify:w,trim:L=!1}=o;return(R,{inputValue:W,getOptionLabel:F})=>{let S=L?W.trim():W;p&&(S=S.toLowerCase()),r&&(S=St(S));const B=S?R.filter(de=>{let D=(w||F)(de);return p&&(D=D.toLowerCase()),r&&(D=St(D)),C==="start"?D.startsWith(S):D.includes(S)}):R;return typeof f=="number"?B.slice(0,f):B}}const Ut=Bt(),At=5,Gt=o=>{var r;return o.current!==null&&((r=o.current.parentElement)==null?void 0:r.contains(document.activeElement))},Kt=[];function Lt(o,r,p,f){if(r||o==null||f)return"";const C=p(o);return typeof C=="string"?C:""}function qt(o){const{unstable_isActiveElementInListbox:r=Gt,unstable_classNamePrefix:p="Mui",autoComplete:f=!1,autoHighlight:C=!1,autoSelect:w=!1,blurOnSelect:L=!1,clearOnBlur:R=!o.freeSolo,clearOnEscape:W=!1,componentName:F="useAutocomplete",defaultValue:S=o.multiple?Kt:null,disableClearable:B=!1,disableCloseOnSelect:de=!1,disabled:D,disabledItemsFocusable:ke=!1,disableListWrap:ve=!1,filterOptions:gt=Ut,filterSelectedOptions:qe=!1,freeSolo:Y=!1,getOptionDisabled:U,getOptionKey:we,getOptionLabel:_e=t=>t.label??t,groupBy:re,handleHomeEndKeys:Je=!o.freeSolo,id:ht,includeInputInList:Ie=!1,inputValue:Re,isOptionEqualToValue:se=(t,e)=>t===e,multiple:u=!1,onChange:Qe,onClose:Xe,onHighlightChange:De,onInputChange:M,onOpen:Te,open:bt,openOnFocus:mt=!1,options:xt,readOnly:K=!1,renderValue:k,selectOnFocus:Ye=!o.freeSolo,value:Me}=o,T=Vt(ht);let I=_e;I=t=>{const e=_e(t);return typeof e!="string"?String(e):e};const ye=b.useRef(!1),Pe=b.useRef(!0),y=b.useRef(null),N=b.useRef(null),[Oe,It]=b.useState(null),[v,ae]=b.useState(-1),Ze=C?0:-1,$=b.useRef(Ze),yt=b.useRef(Lt(S??Me,u,I)).current,[s,et]=ct({controlled:Me,default:S,name:F}),[d,q]=ct({controlled:Re,default:yt,name:F,state:"inputValue"}),[fe,Ne]=b.useState(!1),ge=b.useCallback((t,e,n)=>{if(!(u?s.length<e.length:e!==null)&&!R)return;const i=Lt(e,u,I,k);d!==i&&(q(i),M&&M(t,i,n))},[I,d,u,M,q,R,s,k]),[_,ie]=ct({controlled:bt,default:!1,name:F,state:"open"}),[Pt,he]=b.useState(!0),Ee=!u&&s!=null&&d===I(s),A=_&&!K,g=A?gt(xt.filter(t=>!(qe&&(u?s:[s]).some(e=>e!==null&&se(t,e)))),{inputValue:Ee&&Pt?"":d,getOptionLabel:I}):[],V=Wt({filteredOptions:g,value:s,inputValue:d});b.useEffect(()=>{const t=s!==V.value;fe&&!t||Y&&!t||ge(null,s,"reset")},[s,ge,fe,V.value,Y]);const Fe=_&&g.length>0&&!K,G=Ue(t=>{if(t===-1)y.current.focus();else{const e=k?"data-item-index":"data-tag-index";Oe.querySelector(`[${e}="${t}"]`).focus()}});b.useEffect(()=>{u&&v>s.length-1&&(ae(-1),G(-1))},[s,u,v,G]);function tt(t,e){if(!N.current||t<0||t>=g.length)return-1;let n=t;for(;;){const a=N.current.querySelector(`[data-option-index="${n}"]`),i=ke?!1:!a||a.disabled||a.getAttribute("aria-disabled")==="true";if(a&&a.hasAttribute("tabindex")&&!i)return n;if(e==="next"?n=(n+1)%g.length:n=(n-1+g.length)%g.length,n===t)return-1}}const J=Ue(({event:t,index:e,reason:n})=>{if($.current=e,e===-1?y.current.removeAttribute("aria-activedescendant"):y.current.setAttribute("aria-activedescendant",`${T}-option-${e}`),De&&["mouse","keyboard","touch"].includes(n)&&De(t,e===-1?null:g[e],n),!N.current)return;const a=N.current.querySelector(`[role="option"].${p}-focused`);a&&(a.classList.remove(`${p}-focused`),a.classList.remove(`${p}-focusVisible`));let i=N.current;if(N.current.getAttribute("role")!=="listbox"&&(i=N.current.parentElement.querySelector('[role="listbox"]')),!i)return;if(e===-1){i.scrollTop=0;return}const O=N.current.querySelector(`[data-option-index="${e}"]`);if(O&&(O.classList.add(`${p}-focused`),n==="keyboard"&&O.classList.add(`${p}-focusVisible`),i.scrollHeight>i.clientHeight&&n!=="mouse"&&n!=="touch")){const h=O,j=i.clientHeight+i.scrollTop,je=h.offsetTop+h.offsetHeight;je>j?i.scrollTop=je-i.clientHeight:h.offsetTop-h.offsetHeight*(re?1.3:0)<i.scrollTop&&(i.scrollTop=h.offsetTop-h.offsetHeight*(re?1.3:0))}}),H=Ue(({event:t,diff:e,direction:n="next",reason:a})=>{if(!A)return;const O=tt((()=>{const h=g.length-1;if(e==="reset")return Ze;if(e==="start")return 0;if(e==="end")return h;const j=$.current+e;return j<0?j===-1&&Ie?-1:ve&&$.current!==-1||Math.abs(e)>1?0:h:j>h?j===h+1&&Ie?-1:ve||Math.abs(e)>1?h:0:j})(),n);if(J({index:O,reason:a,event:t}),f&&e!=="reset")if(O===-1)y.current.value=d;else{const h=I(g[O]);y.current.value=h,h.toLowerCase().indexOf(d.toLowerCase())===0&&d.length>0&&y.current.setSelectionRange(d.length,h.length)}}),Ve=!$t({array1:V.filteredOptions,array2:g,parser:I}),ot=()=>{const t=(e,n)=>{const a=e?I(e):"",i=n?I(n):"";return a===i};if($.current!==-1&&!$t({array1:V.filteredOptions,array2:g,parser:I})&&V.inputValue===d&&(u?s.length===V.value.length&&V.value.every((e,n)=>I(s[n])===I(e)):t(V.value,s))){const e=V.filteredOptions[$.current];if(e)return g.findIndex(n=>I(n)===I(e))}return-1},Ce=b.useCallback(()=>{if(!A)return;const t=ot();if(t!==-1){$.current=t;return}const e=u?s[0]:s;if(g.length===0||e==null){H({diff:"reset"});return}if(N.current){if(e!=null){const n=g[$.current];if(u&&n&&s.findIndex(i=>se(n,i))!==-1)return;const a=g.findIndex(i=>se(i,e));a===-1?H({diff:"reset"}):J({index:a});return}if($.current>=g.length-1){J({index:g.length-1});return}J({index:$.current})}},[g.length,u?!1:s,H,J,A,d,u]),Z=Ue(t=>{Ht(N,t),t&&Ce()});b.useEffect(()=>{(Ve||A)&&Ce()},[Ce,Ve,A]);const Q=t=>{_||(ie(!0),he(!0),Te&&Te(t))},le=(t,e)=>{_&&(ie(!1),Xe&&Xe(t,e))},z=(t,e,n,a)=>{if(u){if(s.length===e.length&&s.every((i,O)=>i===e[O]))return}else if(s===e)return;Qe&&Qe(t,e,n,a),et(e)},X=b.useRef(!1),ee=(t,e,n="selectOption",a="options")=>{let i=n,O=e;if(u){O=Array.isArray(s)?s.slice():[];const h=O.findIndex(j=>se(e,j));h===-1?O.push(e):a!=="freeSolo"&&(O.splice(h,1),i="removeOption")}ge(t,O,i),z(t,O,i,{option:e}),!de&&(!t||!t.ctrlKey&&!t.metaKey)&&le(t,i),(L===!0||L==="touch"&&X.current||L==="mouse"&&!X.current)&&y.current.blur()};function nt(t,e){if(t===-1)return-1;let n=t;for(;;){if(e==="next"&&n===s.length||e==="previous"&&n===-1)return-1;const a=k?"data-item-index":"data-tag-index",i=Oe.querySelector(`[${a}="${n}"]`);if(!i||!i.hasAttribute("tabindex")||i.disabled||i.getAttribute("aria-disabled")==="true")n+=e==="next"?1:-1;else return n}}const pe=(t,e)=>{if(!u)return;d===""&&le(t,"toggleInput");let n=v;v===-1&&e==="previous"?(n=s.length-1,Y&&d!==""&&(q(""),M&&M(t,"","reset"))):(n+=e==="next"?1:-1,n<0&&(n=0),n===s.length&&(n=-1)),n=nt(n,e),ae(n),G(n)},He=t=>{ye.current=!0,q(""),M&&M(t,"","clear"),z(t,u?[]:null,"clear")},rt=t=>e=>{if(t.onKeyDown&&t.onKeyDown(e),!e.defaultMuiPrevented&&(v!==-1&&!["ArrowLeft","ArrowRight"].includes(e.key)&&(ae(-1),G(-1)),e.which!==229))switch(e.key){case"Home":A&&Je&&(e.preventDefault(),H({diff:"start",direction:"next",reason:"keyboard",event:e}));break;case"End":A&&Je&&(e.preventDefault(),H({diff:"end",direction:"previous",reason:"keyboard",event:e}));break;case"PageUp":e.preventDefault(),H({diff:-At,direction:"previous",reason:"keyboard",event:e}),Q(e);break;case"PageDown":e.preventDefault(),H({diff:At,direction:"next",reason:"keyboard",event:e}),Q(e);break;case"ArrowDown":e.preventDefault(),H({diff:1,direction:"next",reason:"keyboard",event:e}),Q(e);break;case"ArrowUp":e.preventDefault(),H({diff:-1,direction:"previous",reason:"keyboard",event:e}),Q(e);break;case"ArrowLeft":{const n=y.current;if(!(n&&n.selectionStart===0&&n.selectionEnd===0))return;!u&&k&&s!=null?(Y&&d!==""&&(q(""),M&&M(e,"","reset")),ae(0),G(0)):pe(e,"previous");break}case"ArrowRight":!u&&k?(ae(-1),G(-1)):pe(e,"next");break;case"Enter":if($.current!==-1&&A){const n=g[$.current],a=U?U(n):!1;if(e.preventDefault(),a)return;ee(e,n,"selectOption"),f&&y.current.setSelectionRange(y.current.value.length,y.current.value.length)}else Y&&d!==""&&Ee===!1&&(u&&e.preventDefault(),ee(e,d,"createOption","freeSolo"));break;case"Escape":A?(e.preventDefault(),e.stopPropagation(),le(e,"escape")):W&&(d!==""||u&&s.length>0||k)&&(e.preventDefault(),e.stopPropagation(),He(e));break;case"Backspace":if(u&&!K&&d===""&&s.length>0){const n=v===-1?s.length-1:v,a=s.slice();a.splice(n,1),z(e,a,"removeOption",{option:s[n]})}!u&&k&&!K&&d===""&&z(e,null,"removeOption",{option:s});break;case"Delete":if(u&&!K&&d===""&&s.length>0&&v!==-1){const n=v,a=s.slice();a.splice(n,1),z(e,a,"removeOption",{option:s[n]})}!u&&k&&!K&&d===""&&z(e,null,"removeOption",{option:s});break}},be=t=>{Ne(!0),v!==-1&&(ae(-1),G(-1)),mt&&!ye.current&&Q(t)},me=t=>{if(r(N)){y.current.focus();return}Ne(!1),Pe.current=!0,ye.current=!1,w&&$.current!==-1&&A?ee(t,g[$.current],"blur"):w&&Y&&d!==""?ee(t,d,"blur","freeSolo"):R&&ge(t,s,"blur"),le(t,"blur")},$e=t=>{const e=t.target.value;d!==e&&(q(e),he(!1),M&&M(t,e,"input")),e===""?!B&&!u&&!k&&z(t,null,"clear"):Q(t)},st=t=>{const e=Number(t.currentTarget.getAttribute("data-option-index"));$.current!==e&&J({event:t,index:e,reason:"mouse"})},at=t=>{J({event:t,index:Number(t.currentTarget.getAttribute("data-option-index")),reason:"touch"}),X.current=!0},it=t=>{const e=Number(t.currentTarget.getAttribute("data-option-index"));ee(t,g[e],"selectOption"),X.current=!1},lt=t=>e=>{const n=s.slice();n.splice(t,1),z(e,n,"removeOption",{option:s[t]})},Se=t=>{z(t,null,"removeOption",{option:s})},m=t=>{_?le(t,"toggleInput"):Q(t)},P=t=>{t.currentTarget.contains(t.target)&&t.target.getAttribute("id")!==T&&t.preventDefault()},te=t=>{t.currentTarget.contains(t.target)&&(y.current.focus(),Ye&&Pe.current&&y.current.selectionEnd-y.current.selectionStart===0&&y.current.select(),Pe.current=!1)},pt=t=>{!D&&(d===""||!_)&&m(t)};let Ae=Y&&d.length>0;Ae=Ae||(u?s.length>0:s!==null);let ze=g;return re&&(ze=g.reduce((t,e,n)=>{const a=re(e);return t.length>0&&t[t.length-1].group===a?t[t.length-1].options.push(e):t.push({key:n,index:n,group:a,options:[e]}),t},[])),D&&fe&&me(),{getRootProps:(t={})=>({...t,onKeyDown:rt(t),onMouseDown:P,onClick:te}),getInputLabelProps:()=>({id:`${T}-label`,htmlFor:T}),getInputProps:()=>({id:T,value:d,onBlur:me,onFocus:be,onChange:$e,onMouseDown:pt,"aria-activedescendant":A?"":null,"aria-autocomplete":f?"both":"list","aria-controls":Fe?`${T}-listbox`:void 0,"aria-expanded":Fe,autoComplete:"off",ref:y,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:D}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:He}),getItemProps:({index:t=0}={})=>({...u&&{key:t},...k?{"data-item-index":t}:{"data-tag-index":t},tabIndex:-1,...!K&&{onDelete:u?lt(t):Se}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:m}),getTagProps:({index:t})=>({key:t,"data-tag-index":t,tabIndex:-1,...!K&&{onDelete:lt(t)}}),getListboxProps:()=>({role:"listbox",id:`${T}-listbox`,"aria-labelledby":`${T}-label`,ref:Z,onMouseDown:t=>{t.preventDefault()}}),getOptionProps:({index:t,option:e})=>{const n=(u?s:[s]).some(i=>i!=null&&se(e,i)),a=U?U(e):!1;return{key:(we==null?void 0:we(e))??I(e),tabIndex:-1,role:"option",id:`${T}-option-${t}`,onMouseMove:st,onClick:it,onTouchStart:at,"data-option-index":t,"aria-disabled":a,"aria-selected":n}},id:T,inputValue:d,value:s,dirty:Ae,expanded:A&&Oe,popupOpen:A,focused:fe||v!==-1,anchorEl:Oe,setAnchorEl:It,focusedItem:v,focusedTag:v,groupedOptions:ze}}function _t(o){return wt("MuiListSubheader",o)}Rt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const Jt=o=>{const{classes:r,color:p,disableGutters:f,inset:C,disableSticky:w}=o,L={root:["root",p!=="default"&&`color${Ke(p)}`,!f&&"gutters",C&&"inset",!w&&"sticky"]};return Tt(L,_t,r)},Qt=E("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(o,r)=>{const{ownerState:p}=o;return[r.root,p.color!=="default"&&r[`color${Ke(p.color)}`],!p.disableGutters&&r.gutters,p.inset&&r.inset,!p.disableSticky&&r.sticky]}})(ce(({theme:o})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(o.vars||o).palette.text.secondary,fontFamily:o.typography.fontFamily,fontWeight:o.typography.fontWeightMedium,fontSize:o.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(o.vars||o).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:r})=>!r.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:r})=>r.inset,style:{paddingLeft:72}},{props:({ownerState:r})=>!r.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(o.vars||o).palette.background.paper}}]}))),ft=b.forwardRef(function(r,p){const f=Dt({props:r,name:"MuiListSubheader"}),{className:C,color:w="default",component:L="li",disableGutters:R=!1,disableSticky:W=!1,inset:F=!1,...S}=f,B={...f,color:w,component:L,disableGutters:R,disableSticky:W,inset:F},de=Jt(B);return x.jsx(Qt,{as:L,className:Ge(de.root,C),ref:p,ownerState:B,...S})});ft&&(ft.muiSkipListHighlight=!0);function Xt(o){return wt("MuiAutocomplete",o)}const l=Rt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var kt,vt;const Yt=o=>{const{classes:r,disablePortal:p,expanded:f,focused:C,fullWidth:w,hasClearIcon:L,hasPopupIcon:R,inputFocused:W,popupOpen:F,size:S}=o,B={root:["root",f&&"expanded",C&&"focused",w&&"fullWidth",L&&"hasClearIcon",R&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",W&&"inputFocused"],tag:["tag",`tagSize${Ke(S)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",F&&"popupIndicatorOpen"],popper:["popper",p&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Tt(B,Xt,r)},Zt=E("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(o,r)=>{const{ownerState:p}=o,{fullWidth:f,hasClearIcon:C,hasPopupIcon:w,inputFocused:L,size:R}=p;return[{[`& .${l.tag}`]:r.tag},{[`& .${l.tag}`]:r[`tagSize${Ke(R)}`]},{[`& .${l.inputRoot}`]:r.inputRoot},{[`& .${l.input}`]:r.input},{[`& .${l.input}`]:L&&r.inputFocused},r.root,f&&r.fullWidth,w&&r.hasPopupIcon,C&&r.hasClearIcon]}})({[`&.${l.focused} .${l.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${l.clearIndicator}`]:{visibility:"visible"}},[`& .${l.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${l.inputRoot}`]:{[`.${l.hasPopupIcon}&, .${l.hasClearIcon}&`]:{paddingRight:30},[`.${l.hasPopupIcon}.${l.hasClearIcon}&`]:{paddingRight:56},[`& .${l.input}`]:{width:0,minWidth:30}},[`& .${ut.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${ut.root}.${ue.sizeSmall}`]:{[`& .${ut.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ct.root}`]:{padding:9,[`.${l.hasPopupIcon}&, .${l.hasClearIcon}&`]:{paddingRight:39},[`.${l.hasPopupIcon}.${l.hasClearIcon}&`]:{paddingRight:65},[`& .${l.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${l.endAdornment}`]:{right:9}},[`& .${Ct.root}.${ue.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${l.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${xe.root}`]:{paddingTop:19,paddingLeft:8,[`.${l.hasPopupIcon}&, .${l.hasClearIcon}&`]:{paddingRight:39},[`.${l.hasPopupIcon}.${l.hasClearIcon}&`]:{paddingRight:65},[`& .${xe.input}`]:{padding:"7px 4px"},[`& .${l.endAdornment}`]:{right:9}},[`& .${xe.root}.${ue.sizeSmall}`]:{paddingBottom:1,[`& .${xe.input}`]:{padding:"2.5px 4px"}},[`& .${ue.hiddenLabel}`]:{paddingTop:8},[`& .${xe.root}.${ue.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${l.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${xe.root}.${ue.hiddenLabel}.${ue.sizeSmall}`]:{[`& .${l.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${l.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${l.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${l.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${l.inputRoot}`]:{flexWrap:"wrap"}}}]}),eo=E("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),to=E(Et,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),oo=E(Et,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(o,r)=>{const{ownerState:p}=o;return[r.popupIndicator,p.popupOpen&&r.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),no=E(Nt,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(o,r)=>{const{ownerState:p}=o;return[{[`& .${l.option}`]:r.option},r.popper,p.disablePortal&&r.popperDisablePortal]}})(ce(({theme:o})=>({zIndex:(o.vars||o).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),ro=E(Mt,{name:"MuiAutocomplete",slot:"Paper"})(ce(({theme:o})=>({...o.typography.body1,overflow:"auto"}))),so=E("div",{name:"MuiAutocomplete",slot:"Loading"})(ce(({theme:o})=>({color:(o.vars||o).palette.text.secondary,padding:"14px 16px"}))),ao=E("div",{name:"MuiAutocomplete",slot:"NoOptions"})(ce(({theme:o})=>({color:(o.vars||o).palette.text.secondary,padding:"14px 16px"}))),io=E("ul",{name:"MuiAutocomplete",slot:"Listbox"})(ce(({theme:o})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${l.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[o.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${l.focused}`]:{backgroundColor:(o.vars||o).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${l.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:o.alpha((o.vars||o).palette.primary.main,(o.vars||o).palette.action.selectedOpacity),[`&.${l.focused}`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(o.vars||o).palette.action.selected}},[`&.${l.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.focusOpacity}`)}}}}))),lo=E(ft,{name:"MuiAutocomplete",slot:"GroupLabel"})(ce(({theme:o})=>({backgroundColor:(o.vars||o).palette.background.paper,top:-8}))),po=E("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${l.option}`]:{paddingLeft:24}}),ho=b.forwardRef(function(r,p){const f=Dt({props:r,name:"MuiAutocomplete"}),{autoComplete:C=!1,autoHighlight:w=!1,autoSelect:L=!1,blurOnSelect:R=!1,ChipProps:W,className:F,clearIcon:S=kt||(kt=x.jsx(zt,{fontSize:"small"})),clearOnBlur:B=!f.freeSolo,clearOnEscape:de=!1,clearText:D="Clear",closeText:ke="Close",componentsProps:ve,defaultValue:gt=f.multiple?[]:null,disableClearable:qe=!1,disableCloseOnSelect:Y=!1,disabled:U=!1,disabledItemsFocusable:we=!1,disableListWrap:_e=!1,disablePortal:re=!1,filterOptions:Je,filterSelectedOptions:ht=!1,forcePopupIcon:Ie="auto",freeSolo:Re=!1,fullWidth:se=!1,getLimitTagsText:u=c=>`+${c}`,getOptionDisabled:Qe,getOptionKey:Xe,getOptionLabel:De,isOptionEqualToValue:M,groupBy:Te,handleHomeEndKeys:bt=!f.freeSolo,id:mt,includeInputInList:xt=!1,inputValue:K,limitTags:k=-1,ListboxComponent:Ye,ListboxProps:Me,loading:T=!1,loadingText:I="Loading…",multiple:ye=!1,noOptionsText:Pe="No options",onChange:y,onClose:N,onHighlightChange:Oe,onInputChange:It,onOpen:v,open:ae,openOnFocus:Ze=!1,openText:$="Open",options:yt,PaperComponent:s,PopperComponent:et,popupIcon:d=vt||(vt=x.jsx(Ft,{})),readOnly:q=!1,renderGroup:fe,renderInput:Ne,renderOption:ge,renderTags:_,renderValue:ie,selectOnFocus:Pt=!f.freeSolo,size:he="medium",slots:Ee={},slotProps:A={},value:g,...V}=f,{getRootProps:Fe,getInputProps:G,getInputLabelProps:tt,getPopupIndicatorProps:J,getClearProps:H,getItemProps:Ve,getListboxProps:ot,getOptionProps:Ce,value:Z,dirty:Q,expanded:le,id:z,popupOpen:X,focused:ee,focusedItem:nt,anchorEl:pe,setAnchorEl:He,inputValue:rt,groupedOptions:be}=qt({...f,componentName:"Autocomplete"}),me=!qe&&!U&&Q&&!q,$e=(!Re||Ie===!0)&&Ie!==!1,{onMouseDown:st}=G(),{ref:at,...it}=ot(),Se=De||(c=>c.label??c),m={...f,disablePortal:re,expanded:le,focused:ee,fullWidth:se,getOptionLabel:Se,hasClearIcon:me,hasPopupIcon:$e,inputFocused:nt===-1,popupOpen:X,size:he},P=Yt(m),te={slots:{paper:s,popper:et,...Ee},slotProps:{chip:W,listbox:Me,...ve,...A}},[pt,Ae]=dt("listbox",{elementType:io,externalForwardedProps:te,ownerState:m,className:P.listbox,additionalProps:it,ref:at}),[ze,t]=dt("paper",{elementType:Mt,externalForwardedProps:te,ownerState:m,className:P.paper}),[e,n]=dt("popper",{elementType:Nt,externalForwardedProps:te,ownerState:m,className:P.popper,additionalProps:{disablePortal:re,style:{width:pe?pe.clientWidth:null},role:"presentation",anchorEl:pe,open:X}});let a;const i=c=>({className:P.tag,disabled:U,...Ve(c)});if(ye?Z.length>0&&(_?a=_(Z,i,m):ie?a=ie(Z,i,m):a=Z.map((c,oe)=>{const{key:ne,...Le}=i({index:oe});return x.jsx(jt,{label:Se(c),size:he,...Le,...te.slotProps.chip},ne)})):ie&&Z!=null&&(a=ie(Z,i,m)),k>-1&&Array.isArray(a)){const c=a.length-k;!ee&&c>0&&(a=a.splice(0,k),a.push(x.jsx("span",{className:P.tag,children:u(c)},a.length)))}const h=fe||(c=>x.jsxs("li",{children:[x.jsx(lo,{className:P.groupLabel,ownerState:m,component:"div",children:c.group}),x.jsx(po,{className:P.groupUl,ownerState:m,children:c.children})]},c.key)),je=ge||((c,oe)=>{const{key:ne,...Le}=c;return x.jsx("li",{...Le,children:Se(oe)},ne)}),Ot=(c,oe)=>{const ne=Ce({option:c,index:oe});return je({...ne,className:P.option},c,{selected:ne["aria-selected"],index:oe,inputValue:rt},m)},We=te.slotProps.clearIndicator,Be=te.slotProps.popupIndicator;return x.jsxs(b.Fragment,{children:[x.jsx(Zt,{ref:p,className:Ge(P.root,F),ownerState:m,...Fe(V),children:Ne({id:z,disabled:U,fullWidth:!0,size:he==="small"?"small":void 0,InputLabelProps:tt(),InputProps:{ref:He,className:P.inputRoot,startAdornment:a,onMouseDown:c=>{c.target===c.currentTarget&&st(c)},...(me||$e)&&{endAdornment:x.jsxs(eo,{className:P.endAdornment,ownerState:m,children:[me?x.jsx(to,{...H(),"aria-label":D,title:D,ownerState:m,...We,className:Ge(P.clearIndicator,We==null?void 0:We.className),children:S}):null,$e?x.jsx(oo,{...J(),disabled:U,"aria-label":X?ke:$,title:X?ke:$,ownerState:m,...Be,className:Ge(P.popupIndicator,Be==null?void 0:Be.className),children:d}):null]})}},inputProps:{className:P.input,disabled:U,readOnly:q,...G()}})}),pe?x.jsx(no,{as:e,...n,children:x.jsxs(ro,{as:ze,...t,children:[T&&be.length===0?x.jsx(so,{className:P.loading,ownerState:m,children:I}):null,be.length===0&&!Re&&!T?x.jsx(ao,{className:P.noOptions,ownerState:m,role:"presentation",onMouseDown:c=>{c.preventDefault()},children:Pe}):null,be.length>0?x.jsx(pt,{as:Ye,...Ae,children:be.map((c,oe)=>Te?h({key:c.key,group:c.group,children:c.options.map((ne,Le)=>Ot(ne,c.index+Le))}):Ot(c,oe))}):null]})}):null]})});export{ho as A};
@@ -1 +0,0 @@
1
- import{j as t}from"./vendor-xyflow.js";import{I as B,J as U,U as $,T as G,M as S,N as K,O as V,W as H,R as I,a1 as F,j as _,h as Q,C as J,S as v,G as A,E as X,a3 as T,Z,k as q}from"./docs.js";import{R as Y}from"./useQueryState.js";import{h,m as ee}from"./vendor-recharts.js";import{u as te,F as ne,T as b}from"./PageContainer.js";import{A as se}from"./Autocomplete.js";function oe(e){return B("MuiInputAdornment",e)}const P=U("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var w;const re=(e,n)=>{const{ownerState:s}=e;return[n.root,n[`position${S(s.position)}`],s.disablePointerEvents===!0&&n.disablePointerEvents,n[s.variant]]},ae=e=>{const{classes:n,disablePointerEvents:s,hiddenLabel:r,position:a,size:i,variant:l}=e,u={root:["root",s&&"disablePointerEvents",a&&`position${S(a)}`,l,r&&"hiddenLabel",i&&`size${S(i)}`]};return K(u,oe,n)},ie=V("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:re})(H(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${P.positionStart}&:not(.${P.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),N=h.forwardRef(function(n,s){const r=$({props:n,name:"MuiInputAdornment"}),{children:a,className:i,component:l="div",disablePointerEvents:u=!1,disableTypography:p=!1,position:f,variant:C,...d}=r,m=te()||{};let x=C;C&&m.variant,m&&!x&&(x=m.variant);const y={...r,hiddenLabel:m.hiddenLabel,size:m.size,disablePointerEvents:u,position:f,variant:x},g=ae(y);return t.jsx(ne.Provider,{value:null,children:t.jsx(ie,{as:l,ownerState:y,className:ee(g.root,i),ref:s,...d,children:typeof a=="string"&&!p?t.jsx(G,{color:"textSecondary",children:a}):t.jsxs(h.Fragment,{children:[f==="start"?w||(w=t.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,a]})})})}),le=I(t.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"})),de=I(t.jsx("path",{d:"M19.79 5.61C20.3 4.95 19.83 4 19 4H6.83l7.97 7.97zM2.81 2.81 1.39 4.22 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-2.17l5.78 5.78 1.41-1.41z"})),ce=new Set(["INPUT","TEXTAREA","SELECT"]);function ue({searchInputRef:e}){h.useEffect(()=>{const n=s=>{var a;if(s.defaultPrevented||s.key!=="/"||s.metaKey||s.ctrlKey||s.altKey)return;const r=s.target;r&&ce.has(r.tagName)||(s.preventDefault(),(a=e==null?void 0:e.current)==null||a.focus())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e])}const pe=I(t.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),me=I(t.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}));function xe({value:e,onChange:n,placeholder:s="Search...",onSubmit:r,textFieldProps:a,inputRef:i}){const l=p=>{n(p.target.value)},u=p=>{p.key==="Enter"&&(r==null||r())};return t.jsx(b,{value:e,onChange:l,placeholder:s,onKeyDown:u,fullWidth:!0,inputRef:i,InputProps:{startAdornment:t.jsx(N,{position:"start",children:t.jsx(me,{fontSize:"small"})}),endAdornment:e?t.jsx(N,{position:"end",children:t.jsx(F,{size:"small",onClick:()=>n(""),"aria-label":"Clear search input",children:t.jsx(pe,{fontSize:"small"})})}):void 0},...a})}function k({options:e,selection:n,onChange:s,placeholder:r,label:a}){return t.jsx(se,{multiple:!0,freeSolo:!0,options:e,value:n,onChange:(i,l)=>s(l),renderValue:(i,l)=>i.map((u,p)=>t.jsx(_,{size:"small",label:u,...l({index:p})})),sx:{flex:1},renderInput:i=>t.jsx(b,{...i,label:a,placeholder:r,size:"small"})})}function ve({value:e,onChange:n,children:s,tagOptions:r,groupOptions:a,onRefresh:i,refreshing:l=!1,searchOnly:u=!1}){const p=Q(),[f,C]=h.useState(!1),[d,m]=h.useState("include"),x=h.useRef(null);ue({searchInputRef:x});const y=o=>{n({...e,pageSize:o})},g=(o,j)=>{n({...e,[o]:he(j)})},M=e.searchQuery??"",c=d==="exclude",O=d==="include"?e.tagsInclude:e.tagsExclude,R=d==="include"?e.groupsInclude:e.groupsExclude,z=o=>{n({...e,tagsInclude:d==="include"?o:e.tagsInclude,tagsExclude:d==="exclude"?o:e.tagsExclude})},W=()=>m(o=>o==="include"?"exclude":"include"),E=c?{opacity:.5}:void 0;return t.jsx(J,{title:"Filters",bgcolor:c?q(p.palette.error.main,.08):void 0,children:t.jsxs(v,{spacing:2,children:[t.jsxs(v,{direction:{xs:"column",md:"row"},spacing:2,children:[t.jsx(A,{sx:{flex:1,minWidth:0,...E},children:t.jsx(xe,{value:M,onChange:o=>g("searchQuery",o),placeholder:"Search",inputRef:x,textFieldProps:{disabled:c}})}),!u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{onClick:()=>C(o=>!o),sx:{transform:f?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms ease"},"aria-label":"Toggle advanced filters",children:t.jsx(X,{})}),t.jsx(T,{variant:c?"contained":"outlined",color:c?"error":"primary",onClick:W,startIcon:c?t.jsx(de,{}):t.jsx(le,{}),sx:{minWidth:140},children:c?"Exclude mode":"Include mode"})]}),i?t.jsx(T,{variant:"outlined",color:"primary",onClick:i,startIcon:t.jsx(Y,{sx:l?{animation:"spin 0.9s linear infinite","@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}:void 0}),disabled:l,sx:{minWidth:140},children:"Refresh"}):null]}),t.jsxs(Z,{in:f,timeout:"auto",unmountOnExit:!0,children:[t.jsxs(v,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{xs:"stretch",md:"flex-start"},sx:E,children:[t.jsx(b,{label:"After",type:"datetime-local",value:D(e.afterDate),onChange:o=>g("afterDate",L(o.target.value)),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}},sx:{flex:2},disabled:c}),t.jsx(b,{label:"Before",type:"datetime-local",value:D(e.beforeDate),onChange:o=>g("beforeDate",L(o.target.value)),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}},sx:{flex:2},disabled:c}),t.jsx(b,{label:"Page size",type:"number",value:e.pageSize??"",onChange:o=>{const j=Number(o.target.value);y(Number.isNaN(j)||j<=0?void 0:j)},size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}},sx:{flex:1},disabled:c})]}),t.jsxs(v,{spacing:2,sx:{mt:2,flex:1},children:[t.jsx(k,{options:r??[],selection:O??[],label:`Tags (${d})`,placeholder:"Add tags",onChange:z}),t.jsx(k,{options:a??[],selection:R??[],label:`Groups (${d})`,placeholder:"Add groups",onChange:z})]})]}),s?t.jsx(A,{sx:{borderTop:"1px solid",borderColor:"divider",pt:2},children:s(d,E)}):null]})})}function D(e){if(!e)return"";const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=n.getTimezoneOffset();return new Date(n.getTime()-s*60*1e3).toISOString().slice(0,16)}function L(e){if(!e)return;const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toISOString()}function he(e){if(!(typeof e=="string"&&e.trim()==="")&&!(Array.isArray(e)&&e.length===0))return e}export{ve as B};
@@ -1 +0,0 @@
1
- import{j as t}from"./vendor-xyflow.js";import{E as W}from"./ExpandLess.js";import{S as E,G as k,ak as P,E as B,T as D,aW as A,a9 as $,a1 as G}from"./docs.js";import{h as n}from"./vendor-recharts.js";const M=n.createContext({collapsed:[],toggleCollapse:()=>{},cardCount:1,dragging:!1}),T=n.createContext(0);function N({onResize:o,onDragStart:l,onDragEnd:i}){const s=n.useRef(!1),d=n.useRef(0),w=n.useCallback(r=>{r.preventDefault(),s.current=!0,d.current=r.clientX,document.body.style.cursor="col-resize",document.body.style.userSelect="none",l();const u=p=>{if(!s.current)return;const h=p.clientX-d.current;d.current=p.clientX,o(h)},f=()=>{s.current=!1,document.body.style.cursor="",document.body.style.userSelect="",i(),window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",f)};window.addEventListener("pointermove",u),window.addEventListener("pointerup",f)},[o,l,i]);return t.jsx(k,{onPointerDown:w,sx:{width:"6px",flexShrink:0,cursor:"col-resize",position:"relative",zIndex:1,"&::after":{content:'""',position:"absolute",top:"20%",bottom:"20%",left:"50%",transform:"translateX(-50%)",width:"2px",borderRadius:"1px",bgcolor:"divider"},"&:hover::after, &:active::after":{bgcolor:"primary.main"}}})}function q({children:o}){return t.jsx(E,{spacing:2,children:o})}const L=5;function F({sizes:o,children:l}){const i=Array.isArray(l)?l.filter(e=>e!=null):[l],s=i.length,[d,w]=n.useState(()=>{const e=o??i.map(()=>1),c=e.reduce((a,m)=>a+m,0)||1;return e.map(a=>a/c*100)}),[r,u]=n.useState(()=>i.map(()=>!1)),[f,p]=n.useState(!1),h=n.useRef(null),x=n.useCallback(e=>{u(c=>{const a=[...c];return a[e]=!c[e],a})},[]),j=n.useCallback(()=>p(!0),[]),v=n.useCallback(()=>p(!1),[]),X=n.useCallback((e,c)=>{const a=h.current;if(!a)return;const m=a.offsetWidth;if(m<=0)return;const z=c/m*100;w(y=>{const g=[...y];let C=e,b=e+1;for(;C>=0&&r[C];)C--;for(;b<s&&r[b];)b++;if(C<0||b>=s)return y;const I=g[C]+z,R=g[b]-z;return I<L||R<L?y:(g[C]=I,g[b]=R,g)})},[s,r]),H={collapsed:r,toggleCollapse:x,cardCount:s,dragging:f},S=[];for(let e=0;e<i.length;e++){if(e>0){const a=r[e-1],m=r[e];if(!(a||m)){const y=e-1;S.push(t.jsx(N,{onResize:g=>X(y,g),onDragStart:j,onDragEnd:v},`handle-${e}`))}}const c=r[e];S.push(t.jsx(T.Provider,{value:e,children:t.jsx(k,{sx:{flex:c?s>1?"0 0 36px":void 0:`${d[e]} 0 0%`,minWidth:c&&s>1?"36px":"60px",overflow:"hidden"},children:i[e]})},`card-${e}`))}return t.jsx(M.Provider,{value:H,children:t.jsx(k,{ref:h,sx:{display:"flex",gap:0,width:"100%"},children:S})})}function J({title:o,actions:l,children:i}){const{collapsed:s,toggleCollapse:d,cardCount:w,dragging:r}=n.useContext(M),u=n.useContext(T),f=s[u]??!1,p=w>1,h=f&&p,x=f&&!p,j=n.useCallback(()=>{d(u)},[u,d]);return h?t.jsxs(P,{onClick:j,sx:{height:"100%",cursor:"pointer",bgcolor:"background.paper",border:"none",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:2,overflow:"hidden","&:hover":{bgcolor:"action.hover"}},children:[t.jsx(B,{fontSize:"small",sx:{mb:1,color:"text.secondary",transform:"rotate(-90deg)"}}),o&&t.jsx(D,{variant:"caption",sx:{writingMode:"vertical-rl",textOrientation:"mixed",whiteSpace:"nowrap",color:"text.secondary"},children:o})]}):t.jsx(P,{sx:{height:"100%",bgcolor:"background.paper",border:"none",display:"flex",flexDirection:"column"},children:t.jsxs(A,{sx:{flex:1,display:"flex",flexDirection:"column",...x?{pb:"16px !important"}:{}},children:[(o||l)&&t.jsxs(E,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{mb:x?0:1},children:[t.jsxs(E,{direction:"row",alignItems:"center",spacing:.5,sx:{cursor:"pointer",userSelect:"none"},onClick:j,children:[t.jsx($,{title:x?"Expand":"Collapse",children:t.jsx(G,{size:"small",onClick:v=>{v.stopPropagation(),j()},sx:{p:.25},children:x?t.jsx(B,{fontSize:"small"}):t.jsx(W,{fontSize:"small"})})}),o&&t.jsx(D,{variant:"subtitle1",component:"h2",children:o})]}),l&&!x&&t.jsx(k,{onClick:v=>v.stopPropagation(),children:l})]}),!x&&t.jsx(k,{sx:{flex:1,pointerEvents:r?"none":"auto"},children:i})]})})}export{q as B,F as a,J as b};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-xyflow.js";import{P as me}from"./PageContainer.js";import{B as fe,a as ae,b as N}from"./BentoGrid.js";import{h as d,B as A,C as L,X as v,Y as z,T,q as D,P as xe,v as ge,w as ye,z as be,L as U,t as se,D as je,S as ke}from"./vendor-recharts.js";import{S as F,aI as Se,aJ as Te,x as Q,b as B,e as V,aK as re,h as oe,k as ne,C as W,B as X,D as K,aL as C,z as Y,aB as le,d as ce,aM as Ce,aN as Le,v as ue,aO as ve,a3 as ze,aP as Fe,aQ as J,aR as De,aS as ie,aA as Ee,aT as Pe,aU as Ae,aV as q}from"./docs.js";import{u as G}from"./useQueryState.js";import{D as Z}from"./filterTypes.js";import{B as ee}from"./BaseFilterBar.js";import"./ExpandLess.js";import"./Autocomplete.js";function Ke({groups:o,onGroupSelect:a}){return e.jsx(F,{spacing:2,children:e.jsx(Se,{columns:Te,items:o,onRowClick:s=>a(s.groupId),sortBy:"lastSeen",sortDirection:"desc"})})}const Me={...Z,searchQuery:"",orderBy:"timestamp",orderDirection:"desc",pageSize:200};function $e(){const[o,a]=G("cacheGroupFilters",Me),{openCacheGroup:s}=Q(),i=B("GET /__rrroutes/cache",{cursorParam:"cursor",splitPageSize:500,splitPageSizeParam:"pageSize",getNextPageParam(x){return x.meta.nextCursor}}),{data:r,isLoading:n,error:h,refetch:m,isFetching:p}=i.useEndpoint({query:o}),b=V(r,{reverse:!1}),f=d.useMemo(()=>re(b),[b]),l=d.useCallback(x=>{x&&s(x)},[s]),c=oe(),j=ne(c.palette.divider,.4),g=d.useMemo(()=>we(f),[f]),E=e.jsx(W,{title:"Cache groups",children:e.jsx(Ke,{groups:f.groupSummaries,onGroupSelect:l})}),S=e.jsxs(F,{spacing:3,children:[e.jsx(X,{stats:g.cards}),e.jsx(K,{charts:[{title:"Top groups by key count",chart:e.jsxs(A,{data:f.topGroupsByKeyCount,children:[e.jsx(L,{stroke:j,strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:c.palette.text.secondary,fontSize:12}}),e.jsx(z,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:c.palette.text.secondary,fontSize:12}}),e.jsx(T,{formatter:x=>[`${x}`,"keys"]}),e.jsx(D,{dataKey:"count",fill:c.palette.primary.main})]})},{title:"Top groups by payload",chart:e.jsxs(A,{data:f.topGroupsBySize,layout:"vertical",children:[e.jsx(L,{stroke:j,strokeDasharray:"3 3"}),e.jsx(v,{type:"number",axisLine:!1,tickLine:!1,tick:{fill:c.palette.text.secondary,fontSize:12},tickFormatter:x=>C(Number(x))}),e.jsx(z,{type:"category",dataKey:"label",width:140,axisLine:!1,tickLine:!1,tick:{fill:c.palette.text.secondary,fontSize:12}}),e.jsx(T,{formatter:x=>[C(Number(x)),"payload"]}),e.jsx(D,{dataKey:"size",fill:c.palette.secondary.main})]})}]})]});return e.jsxs(F,{spacing:3,children:[e.jsx(ee,{value:o,onChange:a,onRefresh:m,refreshing:p}),e.jsx(Y,{initialTab:"Table view",tabs:{"Table view":E,Insights:S}})]})}function we(o){const{groupSummaries:a,totalKeys:s,totalSize:i,expiredKeys:r}=o,n=a.filter(l=>typeof l.avgTtl=="number"),h=n.length?n.reduce((l,c)=>l+(c.avgTtl??0),0)/n.length:void 0,m=a.length?s/a.length:void 0,p=a.length?i/a.length:void 0,b=a.filter(l=>(l.expiredCount??0)>0).length,f=a.reduce((l,c)=>l?c.count>l.count?c:l:c,null);return{cards:[{label:"Groups",value:a.length,detail:`${s} keys`},{label:"Keys per group",value:m?m.toFixed(1):"—",detail:f?`${f.groupId??"Ungrouped"} has ${f.count} keys`:"Awaiting data"},{label:"Avg TTL (group)",value:h?le(h):"—",detail:`${n.length} groups with TTL`},{label:"Avg payload (group)",value:p?C(p):"—",detail:`Total ${C(i)}`},{label:"Groups with expired keys",value:b,detail:`${r} expired keys`}]}}const _e={...Z,searchQuery:"",orderBy:"timestamp",orderDirection:"desc",pageSize:200};function Re(){const[o,a]=G("cacheKeyFilters",_e),{openCacheKeyDetail:s}=Q(),i=B("GET /__rrroutes/cache",{cursorParam:"cursor",splitPageSize:500,splitPageSizeParam:"pageSize",getNextPageParam(k){return k.meta.nextCursor}}),r=B("POST /__rrroutes/cache/clear"),{data:n,isLoading:h,error:m,refetch:p,isFetching:b,fetchNextPage:f,hasNextPage:l,isFetchingNextPage:c}=i.useEndpoint({query:o}),j=V(n,{reverse:!1}),g=ce(m,{messageFallback:"Failed to load cache keys.",refetch:p}),E=d.useMemo(()=>re(j),[j]),S=d.useMemo(()=>Ce(j),[j]),x=d.useMemo(()=>Le(j),[j]),P=d.useMemo(()=>Ge(E,S,x),[E,S,x]),[O,M]=d.useState(!1),$=d.useCallback(async k=>{M(!0);try{await r.fetch({query:{...Be(o),...k}},void 0),await p()}catch(H){console.error("Failed to clear cache",H)}finally{M(!1)}},[o,r,p]),w=e.jsx(ze,{variant:"outlined",color:"error",size:"small",onClick:()=>$(),disabled:O||h,children:"Clear cache"});return e.jsxs(F,{spacing:3,children:[e.jsx(ee,{value:o,onChange:a,onRefresh:p,refreshing:b}),e.jsx(Y,{initialTab:"Table view",tabs:{"Table view":e.jsx(W,{title:"Cache keys",actions:w,children:e.jsx(ue,{items:j,endpoint:{data:n,fetchNextPage:f,hasNextPage:l,isFetchingNextPage:c},columns:ve,query:o,setQuery:a,onRowClick:k=>s(k.name??k.id),stateHandler:{isLoading:h,loading:{variant:"table"},emptyFallback:{title:"No cache keys",description:"Adjust filters to surface recent cache activity."},error:g}})}),Insights:e.jsxs(F,{spacing:3,children:[e.jsx(X,{stats:P.stats}),e.jsx(K,{charts:[{title:"TTL distribution",subText:"Key-level TTL buckets",chart:e.jsxs(A,{data:P.ttlHistogram,children:[e.jsx(L,{strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"label",axisLine:!1,tickLine:!1}),e.jsx(z,{allowDecimals:!1,axisLine:!1,tickLine:!1}),e.jsx(T,{formatter:k=>[`${k}`,"keys"]}),e.jsx(D,{dataKey:"count",fill:"#1e88e5"})]})},{title:"Payload distribution",subText:"Bucketed by size range",chart:e.jsxs(A,{data:P.sizeHistogram,children:[e.jsx(L,{strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"label",axisLine:!1,tickLine:!1}),e.jsx(z,{allowDecimals:!1,axisLine:!1,tickLine:!1}),e.jsx(T,{formatter:k=>[`${k}`,"keys"]}),e.jsx(D,{dataKey:"count",fill:"#42a5f5"})]})}]})]})}})]})}function Be(o){const{cursor:a,pageSize:s,...i}=o;return i}function Ge(o,a,s){const{totalKeys:i,totalSize:r,ttlCount:n,ttlSum:h,expiredKeys:m,groupSummaries:p}=o,b=i?n/i*100:0,f=i?m/i*100:0,l=i?r/i:void 0,c=n?h/n:void 0;return{stats:[{label:"Total keys",value:i,detail:`${p.length} groups`},{label:"Keys with TTL",value:n,detail:`${b.toFixed(1)}% of keys`},{label:"Average TTL",value:c!=null?le(c):"—",detail:`${n} TTL samples`},{label:"Expired keys",value:m,detail:`${f.toFixed(1)}% of keys`},{label:"Average payload",value:l!=null?C(l):"—",detail:`Total ${C(r)} across keys`}],ttlHistogram:a,sizeHistogram:s}}const Ie={...Z,searchQuery:"",orderBy:"timestamp",orderDirection:"desc",pageSize:200},Oe={operations:Ae};function He(){const[o,a]=G("cacheTraceFilters",Ie),[s,i]=G("cacheTraceExtras",Oe),{openCacheTraceDetail:r}=Q(),n=d.useMemo(()=>({cursorParam:"cursor",splitPageSize:500,splitPageSizeParam:"pageSize",getNextPageParam(t){return t.meta.nextCursor}}),[]),h=B("GET /__rrroutes/cache/trace",n),m=d.useMemo(()=>{const t=[],u=[];for(const[R,te]of Object.entries(s.operations))te==="include"&&t.push(R),te==="exclude"&&u.push(R);return{...o,...t.length?{operationsInclude:t}:{},...u.length?{operationsExclude:u}:{}}},[o,s]),p=h.useEndpoint({query:m}),{data:b,isLoading:f,error:l,refetch:c,isFetching:j}=p,g=V(b,{reverse:!1}),E=ce(l,{messageFallback:"Failed to load cache traces.",refetch:c}),S=d.useMemo(()=>Ne(g),[g]),x=d.useMemo(()=>Ue(S.operationCounts),[S.operationCounts]),P=d.useMemo(()=>qe(g),[g]),O=d.useMemo(()=>Qe(g),[g]),M=d.useMemo(()=>Ve(g),[g]),$=d.useMemo(()=>We(g),[g]),w=$.reduce((t,u)=>u.total>t.total?u:t,{hour:0,hourLabel:"00",total:0}),k=d.useCallback(t=>{i(u=>({...u,operations:{...u.operations,[t]:Fe(u.operations[t])}}))},[]),H=d.useCallback(t=>{r(t)},[r]),y=oe(),_=ne(y.palette.divider,.4),de=S.operationCounts.hit,he=S.operationCounts.miss,pe=de+he;return e.jsxs(F,{spacing:3,children:[e.jsx(ee,{value:o,onChange:a,onRefresh:c,refreshing:j,children:()=>e.jsx(F,{direction:"row",spacing:1,flexWrap:"wrap",children:J.map(t=>e.jsx(De,{operation:t,state:s.operations[t],onClick:()=>k(t)},t))})}),e.jsx(Y,{initialTab:"Table view",tabs:{"Table view":e.jsx(W,{title:"Trace entries",children:e.jsx(ue,{items:g,endpoint:p,columns:Pe,query:o,setQuery:a,onRowClick:H,stateHandler:{isLoading:f,loading:{variant:"table"},emptyFallback:{title:"No cache traces",description:"Adjust filters to view additional trace events."},error:E}})}),Insights:e.jsxs(F,{spacing:3,children:[e.jsx(X,{stats:S.cards}),e.jsx(K,{charts:[{title:"Operation mix",chart:e.jsxs(xe,{children:[e.jsx(ge,{data:x,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:74,paddingAngle:2,label:({name:t,percent:u})=>`${t} · ${u?(u*100).toFixed(0):"-"}%`,children:x.map(t=>e.jsx(ye,{fill:ie[t.name]},`cell-${t.name}`))}),e.jsx(T,{formatter:t=>[`${t}`,"ops"]})]})},{title:"Hit / miss trend",subText:P.length?`${pe} total operations`:"No hit/miss data available",chart:e.jsxs(be,{data:P,children:[e.jsx(L,{stroke:_,strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"timestamp",type:"number",domain:["dataMin","dataMax"],tickFormatter:t=>new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(z,{allowDecimals:!1,tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(T,{labelFormatter:t=>Ee(t),formatter:(t,u)=>[`${t}`,String(u)]}),e.jsx(U,{}),e.jsx(se,{type:"monotone",dataKey:"hits",stroke:y.palette.primary.main,strokeWidth:2,dot:!1}),e.jsx(se,{type:"monotone",dataKey:"misses",stroke:y.palette.error.main,strokeWidth:2,dot:!1})]})}]}),e.jsx(K,{charts:[{title:"Duration by operation",chart:e.jsxs(A,{data:O,children:[e.jsx(L,{stroke:_,strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"operation",tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(z,{allowDecimals:!1,tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1,tickFormatter:t=>`${Math.round(t)} ms`}),e.jsx(T,{formatter:t=>[`${t} ms`,"Duration"]}),e.jsx(U,{}),e.jsx(D,{dataKey:"avg",stackId:"a",fill:y.palette.primary.main}),e.jsx(D,{dataKey:"p95",stackId:"a",fill:y.palette.secondary.main})]})},{title:"Size vs. duration",chart:e.jsxs(je,{children:[e.jsx(L,{stroke:_,strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"size",name:"Size",tickFormatter:t=>C(Number(t)),tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(z,{dataKey:"duration",name:"Duration",tick:{fill:y.palette.text.secondary,fontSize:12},tickFormatter:t=>`${Math.round(t)} ms`,axisLine:!1,tickLine:!1}),e.jsx(T,{cursor:{strokeDasharray:"3 3"},formatter:(t,u)=>u==="duration"?[`${t?Math.round(Number(t)):"-"} ms`,"Duration"]:[C(Number(t)),"Size"]}),Object.entries(ie).map(([t,u])=>e.jsx(ke,{name:t,data:M.filter(R=>R.operation===t),fill:u},t))]})}]}),e.jsx(K,{charts:[{title:"Activity by hour",subText:`Peak hour: ${String(w.hour).padStart(2,"0")}:00 with ${w.total} events.`,chart:e.jsxs(A,{data:$,children:[e.jsx(L,{stroke:_,strokeDasharray:"3 3"}),e.jsx(v,{dataKey:"hourLabel",tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(z,{allowDecimals:!1,tick:{fill:y.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(T,{formatter:t=>[`${t}`,"events"]}),e.jsx(U,{}),e.jsx(D,{dataKey:"total",fill:y.palette.primary.main})]})}]})]})}})]})}function Ne(o){const a={hit:0,miss:0,set:0,delete:0},s=[];let i=0;o.forEach(l=>{a[l.operation]+=1,typeof l.durationMs=="number"&&s.push(l.durationMs),typeof l.size=="number"&&(i+=l.size)});const r=a.hit,n=a.miss,h=r+n?r/(r+n)*100:null,m=s.length?s.reduce((l,c)=>l+c,0)/s.length:null,p=I(s,95),b=I(s,99);return{cards:[{label:"Hit rate",value:h!=null?`${h.toFixed(1)}%`:"n/a",detail:`${r} hits · ${n} misses`},{label:"Average duration",value:m!=null?`${q(m)} ms`:"—",detail:`P95 ${p?`${q(p)} ms`:"—"}`},{label:"P99 duration",value:b?`${q(b)} ms`:"—",detail:`${s.length} recorded ops`},{label:"Data volume",value:C(i),detail:`${o.length} trace events`}],operationCounts:a}}function Ue(o){return J.map(a=>({name:a,value:o[a]??0}))}function qe(o){const s=new Map;return o.forEach(i=>{const r=Math.floor((i.timestamp??0)/3e5)*3e5,n=s.get(r)??{hits:0,misses:0};i.operation==="hit"&&(n.hits+=1),i.operation==="miss"&&(n.misses+=1),s.set(r,n)}),Array.from(s.entries()).sort((i,r)=>i[0]-r[0]).map(([i,{hits:r,misses:n}])=>({timestamp:i,hits:r,misses:n}))}function Qe(o){const a={hit:[],miss:[],set:[],delete:[]};return o.forEach(s=>{typeof s.durationMs=="number"&&a[s.operation].push(s.durationMs)}),J.map(s=>{const i=a[s],r=i.length===0?0:i.reduce((n,h)=>n+h,0)/i.length;return{operation:s,avg:r,p95:I(i,95)??r,p99:I(i,99)??r}})}function Ve(o){return o.filter(a=>typeof a.size=="number"&&typeof a.durationMs=="number"&&a.size>0).map(a=>({size:a.size??0,duration:a.durationMs??0,operation:a.operation})).slice(-150)}function We(o){const a=Array.from({length:24},(s,i)=>({hour:i,hourLabel:String(i).padStart(2,"0"),total:0}));return o.forEach(s=>{const i=new Date(s.timestamp),r=a[i.getHours()];r&&(r.total+=1)}),a}function I(o,a){if(!o.length)return null;const s=[...o].sort((h,m)=>h-m),i=a/100*(s.length-1),r=Math.floor(i),n=i-r;return r+1>=s.length?s[r]:s[r]+n*(s[r+1]-s[r])}function ot(){return e.jsx(me,{title:"Cache Logs",subtitle:"Inspect cache keys and trace data generated by running requests.",children:e.jsxs(fe,{children:[e.jsxs(ae,{sizes:[6,6],children:[e.jsx(N,{title:"Keys",children:e.jsx(Re,{})}),e.jsx(N,{title:"Groups",children:e.jsx($e,{})})]}),e.jsx(ae,{children:e.jsx(N,{title:"Trace",children:e.jsx(He,{})})})]})})}export{ot as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./vendor-xyflow.js";import{R as o}from"./docs.js";const s=o(t.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}));export{s as D};
@@ -1,7 +0,0 @@
1
- import{j as d}from"./vendor-xyflow.js";import{h as C}from"./vendor-recharts.js";import{h as J,S,T as I,b1 as W,G as T,k as q,H as $,Y as N,b as E,e as H,z as _}from"./docs.js";import{A as F}from"./Autocomplete.js";import{T as V,P as G}from"./PageContainer.js";class D{diff(e,n,t={}){let l;typeof t=="function"?(l=t,t={}):"callback"in t&&(l=t.callback);const s=this.castInput(e,t),r=this.castInput(n,t),a=this.removeEmpty(this.tokenize(s,t)),i=this.removeEmpty(this.tokenize(r,t));return this.diffWithOptionsObj(a,i,t,l)}diffWithOptionsObj(e,n,t,l){var s;const r=p=>{if(p=this.postProcess(p,t),l){setTimeout(function(){l(p)},0);return}else return p},a=n.length,i=e.length;let h=1,c=a+i;t.maxEditLength!=null&&(c=Math.min(c,t.maxEditLength));const y=(s=t.timeout)!==null&&s!==void 0?s:1/0,x=Date.now()+y,u=[{oldPos:-1,lastComponent:void 0}];let f=this.extractCommon(u[0],n,e,0,t);if(u[0].oldPos+1>=i&&f+1>=a)return r(this.buildValues(u[0].lastComponent,n,e));let m=-1/0,g=1/0;const w=()=>{for(let p=Math.max(m,-h);p<=Math.min(g,h);p+=2){let P;const L=u[p-1],v=u[p+1];L&&(u[p-1]=void 0);let z=!1;if(v){const R=v.oldPos-p;z=v&&0<=R&&R<a}const b=L&&L.oldPos+1<i;if(!z&&!b){u[p]=void 0;continue}if(!b||z&&L.oldPos<v.oldPos?P=this.addToPath(v,!0,!1,0,t):P=this.addToPath(L,!1,!0,1,t),f=this.extractCommon(P,n,e,p,t),P.oldPos+1>=i&&f+1>=a)return r(this.buildValues(P.lastComponent,n,e))||!0;u[p]=P,P.oldPos+1>=i&&(g=Math.min(g,p-1)),f+1>=a&&(m=Math.max(m,p+1))}h++};if(l)(function p(){setTimeout(function(){if(h>c||Date.now()>x)return l(void 0);w()||p()},0)})();else for(;h<=c&&Date.now()<=x;){const p=w();if(p)return p}}addToPath(e,n,t,l,s){const r=e.lastComponent;return r&&!s.oneChangePerToken&&r.added===n&&r.removed===t?{oldPos:e.oldPos+l,lastComponent:{count:r.count+1,added:n,removed:t,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+l,lastComponent:{count:1,added:n,removed:t,previousComponent:r}}}extractCommon(e,n,t,l,s){const r=n.length,a=t.length;let i=e.oldPos,h=i-l,c=0;for(;h+1<r&&i+1<a&&this.equals(t[i+1],n[h+1],s);)h++,i++,c++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=i,h}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){const l=[];let s;for(;e;)l.push(e),s=e.previousComponent,delete e.previousComponent,e=s;l.reverse();const r=l.length;let a=0,i=0,h=0;for(;a<r;a++){const c=l[a];if(c.removed)c.value=this.join(t.slice(h,h+c.count)),h+=c.count;else{if(!c.added&&this.useLongestToken){let y=n.slice(i,i+c.count);y=y.map(function(x,u){const f=t[h+u];return f.length>x.length?f:x}),c.value=this.join(y)}else c.value=this.join(n.slice(i,i+c.count));i+=c.count,c.added||(h+=c.count)}}return l}}class K extends D{constructor(){super(...arguments),this.tokenize=B}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
2
- `))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
3
- `))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
4
- `)&&(e=e.slice(0,-1)),n.endsWith(`
5
- `)&&(n=n.slice(0,-1))),super.equals(e,n,t)}}new K;function B(o,e){e.stripTrailingCr&&(o=o.replace(/\r\n/g,`
6
- `));const n=[],t=o.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let l=0;l<t.length;l++){const s=t[l];l%2&&!e.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}class U extends D{constructor(){super(...arguments),this.tokenize=B}get useLongestToken(){return!0}castInput(e,n){const{undefinedReplacement:t,stringifyReplacer:l=(s,r)=>typeof r>"u"?t:r}=n;return typeof e=="string"?e:JSON.stringify(O(e,null,null,l),null," ")}equals(e,n,t){return super.equals(e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),t)}}const Y=new U;function Q(o,e,n){return Y.diff(o,e,n)}function O(o,e,n,t,l){e=e||[],n=n||[],t&&(o=t(l===void 0?"":l,o));let s;for(s=0;s<e.length;s+=1)if(e[s]===o)return n[s];let r;if(Object.prototype.toString.call(o)==="[object Array]"){for(e.push(o),r=new Array(o.length),n.push(r),s=0;s<o.length;s+=1)r[s]=O(o[s],e,n,t,String(s));return e.pop(),n.pop(),r}if(o&&o.toJSON&&(o=o.toJSON()),typeof o=="object"&&o!==null){e.push(o),r={},n.push(r);const a=[];let i;for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);for(a.sort(),s=0;s<a.length;s+=1)i=a[s],r[i]=O(o[i],e,n,t,i);e.pop(),n.pop()}else r=o;return r}function X(o,e){const n=typeof o=="string"?o:JSON.stringify(o,null,2)??"",t=typeof e=="string"?e:JSON.stringify(e,null,2)??"";return Q(n,t)}function j({left:o,right:e,title:n}){const t=J(),l=X(o,e),s=C.useRef(null),r=C.useRef(null),a=C.useRef(!1),i=C.useCallback(u=>()=>{if(a.current)return;a.current=!0;const f=u==="left"?s.current:r.current,m=u==="left"?r.current:s.current;f&&m&&(m.scrollTop=f.scrollTop,m.scrollLeft=f.scrollLeft),a.current=!1},[]),h=[],c=[];for(const u of l){const f=u.value.replace(/\n$/,"").split(`
7
- `);if(u.added)for(const m of f)h.push({text:"",type:"unchanged"}),c.push({text:m,type:"added"});else if(u.removed)for(const m of f)h.push({text:m,type:"removed"}),c.push({text:"",type:"unchanged"});else for(const m of f)h.push({text:m,type:"unchanged"}),c.push({text:m,type:"unchanged"})}const y=u=>{switch(u){case"added":return q(t.palette.success.main,.15);case"removed":return q(t.palette.error.main,.15);default:return"transparent"}},x=(u,f,m,g)=>d.jsxs(W,{sx:{flex:1,minWidth:0,overflow:"hidden",backgroundColor:q(t.palette.background.paper,.5),backdropFilter:"blur(14px)",border:`1px solid ${q("#ffffff",.07)}`},children:[d.jsx(T,{sx:{px:2,py:1,borderBottom:`1px solid ${q("#ffffff",.07)}`},children:d.jsx(I,{variant:"subtitle2",color:"text.secondary",children:g})}),d.jsx(T,{ref:f,onScroll:m,sx:{overflow:"auto",maxHeight:500,p:1},children:u.map((w,p)=>d.jsx(T,{sx:{backgroundColor:y(w.type),px:1.5,py:.25,fontFamily:'"Fira Code", "JetBrains Mono", monospace',fontSize:"0.8rem",lineHeight:1.7,whiteSpace:"pre",minHeight:"1.7em",borderRadius:.5},children:w.text},p))})]});return d.jsxs(S,{spacing:1.5,children:[n&&d.jsx(I,{variant:"h6",color:"text.primary",children:n}),d.jsxs(S,{direction:"row",spacing:2,sx:{width:"100%"},children:[x(h,s,i("left"),"Left"),x(c,r,i("right"),"Right")]})]})}function M(o){return new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function A({requests:o,value:e,onChange:n,label:t="Select request"}){const l=C.useMemo(()=>o.find(s=>s.id===e)??null,[o,e]);return d.jsx(F,{options:o,value:l,onChange:(s,r)=>n((r==null?void 0:r.id)??null),getOptionLabel:s=>`${s.method.toUpperCase()} ${s.path} ${s.status} ${M(s.createdAt)}`,filterOptions:(s,r)=>{const a=r.inputValue.toLowerCase();return a?s.filter(i=>i.method.toLowerCase().includes(a)||i.path.toLowerCase().includes(a)||String(i.status).includes(a)):s},isOptionEqualToValue:(s,r)=>s.id===r.id,renderOption:(s,r)=>{const{key:a,...i}=s;return d.jsx("li",{...i,children:d.jsxs(S,{direction:"row",spacing:1,alignItems:"center",sx:{width:"100%",py:.5},children:[d.jsx($,{method:r.method}),d.jsx(I,{variant:"body2",sx:{flex:1,fontFamily:'"Fira Code", "JetBrains Mono", monospace',fontSize:"0.8rem"},noWrap:!0,children:r.path}),d.jsx(N,{status:r.status}),d.jsx(I,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{minWidth:100,textAlign:"right"},children:M(r.createdAt)})]})},a)},renderInput:s=>d.jsx(V,{...s,label:t,size:"small"}),sx:{minWidth:300}})}function se(){const[o,e]=C.useState(null),[n,t]=C.useState(null),l=C.useMemo(()=>({cursorParam:"cursor",getNextPageParam(g){return g.meta.nextCursor}}),[]),s=E("GET /__rrroutes/requests",l),{data:r}=s.useEndpoint({query:{}}),a=H(r,{reverse:!0}),i=C.useMemo(()=>a.map(g=>({id:g.id,method:g.method,path:g.path,status:g.status,createdAt:g.createdAt})),[a]),h=E("GET /__rrroutes/requests/:requestId",{enabled:!!o}),c=E("GET /__rrroutes/requests/:requestId",{enabled:!!n}),{data:y}=h.useEndpoint({params:{requestId:o??void 0}}),{data:x}=c.useEndpoint({params:{requestId:n??void 0}}),u=y==null?void 0:y.out,f=x==null?void 0:x.out,m=!!(u&&f);return d.jsx(G,{title:"Diff",subtitle:"Compare two requests side by side.",children:d.jsxs(S,{spacing:3,children:[d.jsxs(S,{direction:{xs:"column",sm:"row"},spacing:2,children:[d.jsx(T,{sx:{flex:1},children:d.jsx(A,{requests:i,value:o,onChange:e,label:"Left request"})}),d.jsx(T,{sx:{flex:1},children:d.jsx(A,{requests:i,value:n,onChange:t,label:"Right request"})})]}),m?d.jsx(_,{initialTab:"Headers",tabs:{Headers:d.jsx(j,{left:u.headers,right:f.headers,title:"Headers"}),Params:d.jsx(j,{left:u.params,right:f.params,title:"Params"}),Body:d.jsx(j,{left:u.body,right:f.body,title:"Body"}),Response:d.jsx(j,{left:u.output,right:f.output,title:"Response"}),Timing:d.jsx(j,{left:{durationMs:u.durationMs,status:u.status,requestSize:u.requestSize,responseSize:u.responseSize},right:{durationMs:f.durationMs,status:f.status,requestSize:f.requestSize,responseSize:f.responseSize},title:"Timing"})}}):d.jsx(I,{variant:"body2",color:"text.secondary",children:"Select two requests above to compare them."})]})})}export{se as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-xyflow.js";import{R as t}from"./docs.js";const a=t(o.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}));export{a as D};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-xyflow.js";import{h as n}from"./vendor-recharts.js";import{E as O}from"./EndpointDetailPanel.js";import{u as _,n as D,a as R,o as U,p as x,q as w,r as L,s as P,S as b,C as $}from"./docs.js";import{P as A,T as N}from"./PageContainer.js";import{u as Y,a as M}from"./useEndpointOptions.js";import{A as Q}from"./Autocomplete.js";import"./SchemaTreeView.js";import"./ExpandLess.js";import"./getValidReactChildren.js";import"./filterTypes.js";function V(){const p=_(),{endpointId:h}=D(),s=h?decodeURIComponent(h):"",[i]=R(),d=i.get(U),[k,y]=n.useState(()=>x(d));n.useEffect(()=>{const e=x(d);y(t=>t===e?t:e)},[d]);const[v,f]=n.useState(s);n.useEffect(()=>{f(s)},[s]);const[I,g]=n.useState(""),{options:E,isLoading:T}=Y(I),r=n.useMemo(()=>w(s),[s]),c=(r==null?void 0:r.display)??s??"",{data:u}=M(c),l=n.useMemo(()=>{const e=[...E],t=a=>{a&&(e.some(m=>m.value===a.value)||e.push(a))};return t(r),t(u?L(u):void 0),e},[E,r,u]),S=i.get(P);n.useEffect(()=>{if(S==="playgroundMax"){const e=new URLSearchParams(i);e.delete(P);const t=c?`/playground/${encodeURIComponent(c)}`:"/playground",a=e.toString();p(a?`${t}?${a}`:t,{replace:!0})}},[S,p,i,c]);const C=n.useCallback(e=>{const t=i.toString(),a=`/routes/${encodeURIComponent(e)}`;p(t?`${a}?${t}`:a)},[p,i]),j=(e,t)=>{if(!t)return;const a=l.find(m=>m.value===t);a&&C(a.value)};return o.jsx(A,{title:"Endpoint details",subtitle:"Inspect endpoint contracts, history, and metrics.",children:o.jsxs(b,{spacing:3,children:[o.jsx($,{title:"Endpoint",children:o.jsx(b,{spacing:2,children:o.jsx(Q,{freeSolo:!0,options:l.map(e=>e.value),value:c,inputValue:v,loading:T,onChange:j,onInputChange:(e,t,a)=>{f(t),a==="input"&&g(t),(a==="clear"||a==="reset"&&t==="")&&g("")},getOptionLabel:e=>{const t=l.find(a=>a.value===e);return t?t.display:e},renderInput:e=>o.jsx(N,{...e,label:"Switch endpoint",placeholder:"GET /v1/example",helperText:"Search by method and path"})})})}),o.jsx(O,{endpointId:s})]})})}export{V as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-xyflow.js";import{h as v,A as L,C as R,X as w,Y as D,T as M,x as C}from"./vendor-recharts.js";import{b as S,t as T,d as E,e as A,C as F,S as o,T as c,v as B,w as P,H as z,j as H,x as N,y as _,z as G,h as I,B as Y,D as O,G as K}from"./docs.js";import{S as h}from"./SchemaTreeView.js";import{D as $}from"./filterTypes.js";function Q({method:t,path:r,onSelectRequest:i,onRequestsChange:s}){const[u,l]=v.useState(()=>({...$,pageSize:10})),a=S("GET /__rrroutes/requests",{cursorParam:"cursor",getNextPageParam(g){var x;return(x=g.meta)==null?void 0:x.nextCursor},enabled:!!(t&&r)}).useEndpoint({query:{...u,endpointKeysInclude:r&&t?[T(t,r,!0)]:[]}}),{data:f,isLoading:j,error:y,refetch:n,isFetchingNextPage:m}=a,q=E(y,{messageFallback:"Failed to load requests.",refetch:n}),b=A(f,{reverse:!1});v.useEffect(()=>{s==null||s(b)},[b,s]);const k=(g,x)=>{i(g,x)};return e.jsx(F,{title:"Requests feed",children:e.jsx(o,{spacing:2,children:r&&t?e.jsx(B,{items:b,columns:P,query:u,stateHandler:{emptyFallback:{title:"No requests",description:"This endpoint has not received any requests yet."},error:q,isLoading:j,loading:{variant:"table"}},endpoint:a,setQuery:l,onRowClick:k}):e.jsx(c,{variant:"body2",color:"text.secondary",children:"Endpoint identifier missing."})})})}function U({endpoint:t}){return e.jsxs(o,{spacing:1,children:[e.jsxs(o,{direction:"row",spacing:1.5,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(z,{method:t.method}),e.jsx(c,{variant:"h6",sx:{fontFamily:"monospace",color:"text.primary"},children:t.path}),e.jsx(H,{label:t.stability,size:"small",color:"secondary",sx:{textTransform:"capitalize"}})]}),t.summary&&e.jsx(c,{variant:"body2",color:"text.secondary",children:t.summary})]})}function re({endpointId:t,showHeader:r=!0}){const{openRequestDetail:i}=N(),s=S("GET /__rrroutes/endpoints/:endpointId",{enabled:!!t}),u=v.useMemo(()=>{if(t==null)return;if(t.indexOf(" ")===-1)return t;const[n,m]=t.split(" ");return T(n,m,!0)},[t]),{data:l,isLoading:d,error:a,refetch:f}=s.useEndpoint({params:{endpointId:u}}),j=E(a,{messageFallback:"Unable to load endpoint.",refetch:f}),y=l==null?void 0:l.out;return e.jsx(e.Fragment,{children:e.jsx(_,{loading:{variant:"full"},emptyFallback:t?{title:"Endpoint not found",description:"This endpoint may have been removed."}:{title:"Select an endpoint",description:"Choose an endpoint from the list to inspect its contract and metrics."},data:y,error:j,isLoading:d,children:n=>e.jsxs(o,{spacing:1,children:[r&&e.jsx(U,{endpoint:n}),e.jsx(G,{initialTab:"Request",tabs:{Request:e.jsx(V,{endpoint:n}),Response:e.jsx(W,{endpoint:n}),Meta:e.jsx(X,{endpoint:n}),Metrics:e.jsx(J,{endpoint:n,onSelectRequest:m=>i({requestId:m.id,allowReplay:!0}),onRequestsChange:()=>{}})}})]})})})}function V({endpoint:t}){return e.jsxs(o,{spacing:2.5,children:[e.jsx(h,{title:"Body",schema:t.contract.body}),e.jsx(h,{title:"Params",schema:t.contract.params}),e.jsx(h,{title:"Query",schema:t.contract.query})]})}function W({endpoint:t}){return e.jsx(h,{title:"Response",schema:t.contract.output})}function X({endpoint:t}){const r=Object.entries(t.meta||{});return e.jsxs(o,{spacing:2,children:[e.jsx(p,{label:"Feed",value:t.feed?"Yes":"No"}),e.jsx(p,{label:"Implemented",value:t.implemented?"Yes":"No"}),e.jsx(p,{label:"Hidden",value:t.hidden?"Yes":"No"}),r.length>0&&e.jsxs(K,{children:[e.jsx(c,{variant:"subtitle2",gutterBottom:!0,children:"Metadata"}),e.jsx(o,{spacing:1,children:r.map(([i,s])=>e.jsx(p,{label:i,value:s},i))})]})]})}function J({endpoint:t,onSelectRequest:r,onRequestsChange:i}){var d;const s=I(),u=typeof t.successRate=="number"?`${Math.round(t.successRate*100)}%`:"—",l=t.averageDurationMs?`${Math.round(t.averageDurationMs)} ms`:"—";return e.jsxs(o,{spacing:3,children:[e.jsx(Y,{stats:[{label:"Avg duration",value:l},{label:"Success rate",value:u}]}),e.jsx(O,{charts:[{title:"Request volume",chart:e.jsxs(L,{data:t.volumeTS.map(a=>({...a,date:new Date(a.timestamp)})),children:[e.jsx(R,{stroke:"rgba(255,255,255,0.1)",strokeDasharray:"3 3"}),e.jsx(w,{dataKey:"date",tickFormatter:a=>new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),tick:{fill:s.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1}),e.jsx(D,{tick:{fill:s.palette.text.secondary,fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),e.jsx(M,{labelFormatter:a=>new Date(a).toLocaleString(),formatter:a=>[`${a} requests`,"Volume"],contentStyle:{backgroundColor:s.palette.background.paper,borderColor:s.palette.divider}}),e.jsx(C,{type:"monotone",dataKey:"count",stroke:s.palette.primary.main,fill:s.palette.primary.main,fillOpacity:.22,strokeWidth:2})]})}]}),(d=t.latestErrors)!=null&&d.length?e.jsx(F,{title:"Latest error request IDs",children:e.jsx(o,{spacing:.5,children:t.latestErrors.map(a=>e.jsx(c,{variant:"body2",sx:{fontFamily:"monospace"},children:a.id},a.id))})}):null,e.jsx(Q,{method:t.method,path:t.path,onSelectRequest:r,onRequestsChange:i})]})}function p({label:t,value:r}){return e.jsxs(o,{direction:"row",spacing:1,justifyContent:"space-between",children:[e.jsx(c,{variant:"body2",color:"text.secondary",children:t}),e.jsx(c,{variant:"body2",sx:{fontFamily:"monospace",color:"text.primary"},children:r})]})}export{re as E};