@workflow/web 5.0.0-beta.37 → 5.0.0-beta.39

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 (33) hide show
  1. package/README.md +1 -0
  2. package/build/client/assets/app-BqwHo5GR.css +1 -0
  3. package/build/client/assets/{arrow-up-right-DDNPFYmg.js → arrow-up-right-Ccx_FPfU.js} +1 -1
  4. package/build/client/assets/{highlighted-body-B3W2YXNL-CRgNr0YA.js → highlighted-body-B3W2YXNL-DMawUm9n.js} +1 -1
  5. package/build/client/assets/{home-BqvW8ODs.js → home-B6O_uPSC.js} +3 -2
  6. package/build/client/assets/loader-circle-BrO0dxVn.js +12 -0
  7. package/build/client/assets/manifest-7e8691f4.js +1 -0
  8. package/build/client/assets/{mermaid-3ZIDBTTL-CMP9Tato.js → mermaid-3ZIDBTTL-D20ZkB54.js} +665 -1682
  9. package/build/client/assets/mermaid-3ZIDBTTL-D8CjRQta.css +1 -0
  10. package/build/client/assets/root-CxZylOIf.css +1 -0
  11. package/build/client/assets/{root-2ub-CsWS.js → root-dudvdmvf.js} +6 -2
  12. package/build/client/assets/{run-detail-B1PK-m7y.js → run-detail-DtCCxxv2.js} +277 -359
  13. package/build/client/assets/{workflow-graph-viewer-DOLwtzSv.js → workflow-graph-viewer-B01nH75E.js} +65 -86
  14. package/build/client/assets/{zstd-browser-decoder-BAY5XtBl.js → zstd-browser-decoder-Dw3HhTgO.js} +1 -1
  15. package/build/server/assets/{server-build-C11Xqmwk.js → app-Bd12Opaf.js} +96186 -87164
  16. package/build/server/assets/{highlighted-body-B3W2YXNL-DE3KXslx.js → highlighted-body-B3W2YXNL-CFlRme7u.js} +3 -4
  17. package/build/server/assets/{index-M4Ai7vsa.js → index-B6SJpqpo.js} +65 -63
  18. package/build/server/assets/{mermaid-3ZIDBTTL-DjL45D7x.js → mermaid-3ZIDBTTL-CQsU8DGa.js} +4 -5
  19. package/build/server/assets/{token-Ulh8Tdgw.js → token-XJr1pjmC.js} +1 -2
  20. package/build/server/assets/{token-util-CiVcDWD3.js → token-util-BJaMxWWP.js} +1 -2
  21. package/build/server/assets/{zstd-browser-decoder-tQARkzJ5.js → zstd-browser-decoder-DL7Vc3pV.js} +4 -5
  22. package/build/server/index.js +41 -2
  23. package/handler.d.ts +22 -0
  24. package/handler.js +186 -0
  25. package/package.json +20 -8
  26. package/registry.d.ts +29 -0
  27. package/registry.js +89 -0
  28. package/build/client/assets/manifest-7f03c136.js +0 -1
  29. package/build/client/assets/mermaid-3ZIDBTTL-DDxQhcP4.css +0 -1
  30. package/build/client/assets/root-15oK726f.css +0 -1
  31. package/build/client/assets/server-build-DblSGQ6A.css +0 -1
  32. package/build/client/assets/worker-CqHKTA7D.js +0 -115
  33. package/build/server/assets/app-BaJoK9ck.js +0 -9217
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/zstd-browser-decoder-BAY5XtBl.js","assets/index-PFjW8YjQ.js","assets/highlighted-body-B3W2YXNL-CRgNr0YA.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/zstd-browser-decoder-Dw3HhTgO.js","assets/index-PFjW8YjQ.js","assets/highlighted-body-B3W2YXNL-DMawUm9n.js"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -577,21 +577,21 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
577
577
  function getOppositePlacement(placement) {
578
578
  return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
579
579
  }
580
- function expandPaddingObject(padding2) {
580
+ function expandPaddingObject(padding) {
581
581
  return {
582
582
  top: 0,
583
583
  right: 0,
584
584
  bottom: 0,
585
585
  left: 0,
586
- ...padding2
586
+ ...padding
587
587
  };
588
588
  }
589
- function getPaddingObject(padding2) {
590
- return typeof padding2 !== "number" ? expandPaddingObject(padding2) : {
591
- top: padding2,
592
- right: padding2,
593
- bottom: padding2,
594
- left: padding2
589
+ function getPaddingObject(padding) {
590
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
591
+ top: padding,
592
+ right: padding,
593
+ bottom: padding,
594
+ left: padding
595
595
  };
596
596
  }
597
597
  function rectToClientRect(rect) {
@@ -768,9 +768,9 @@ async function detectOverflow(state, options) {
768
768
  rootBoundary = "viewport",
769
769
  elementContext = "floating",
770
770
  altBoundary = false,
771
- padding: padding2 = 0
771
+ padding = 0
772
772
  } = evaluate(options, state);
773
- const paddingObject = getPaddingObject(padding2);
773
+ const paddingObject = getPaddingObject(padding);
774
774
  const altContext = elementContext === "floating" ? "reference" : "floating";
775
775
  const element2 = elements[altBoundary ? altContext : elementContext];
776
776
  const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
@@ -821,12 +821,12 @@ const arrow$3 = (options) => ({
821
821
  } = state;
822
822
  const {
823
823
  element: element2,
824
- padding: padding2 = 0
824
+ padding = 0
825
825
  } = evaluate(options, state) || {};
826
826
  if (element2 == null) {
827
827
  return {};
828
828
  }
829
- const paddingObject = getPaddingObject(padding2);
829
+ const paddingObject = getPaddingObject(padding);
830
830
  const coords = {
831
831
  x: x2,
832
832
  y: y2
@@ -2310,13 +2310,13 @@ const arrow$1 = (options) => {
2310
2310
  fn(state) {
2311
2311
  const {
2312
2312
  element: element2,
2313
- padding: padding2
2313
+ padding
2314
2314
  } = typeof options === "function" ? options(state) : options;
2315
2315
  if (element2 && isRef(element2)) {
2316
2316
  if (element2.current != null) {
2317
2317
  return arrow$2({
2318
2318
  element: element2.current,
2319
- padding: padding2
2319
+ padding
2320
2320
  }).fn(state);
2321
2321
  }
2322
2322
  return {};
@@ -2324,7 +2324,7 @@ const arrow$1 = (options) => {
2324
2324
  if (element2) {
2325
2325
  return arrow$2({
2326
2326
  element: element2,
2327
- padding: padding2
2327
+ padding
2328
2328
  }).fn(state);
2329
2329
  }
2330
2330
  return {};
@@ -2692,11 +2692,11 @@ var Portal$1 = reactExports.forwardRef((props, forwardedRef) => {
2692
2692
  return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
2693
2693
  });
2694
2694
  Portal$1.displayName = PORTAL_NAME$1;
2695
- function useStateMachine(initialState2, machine) {
2695
+ function useStateMachine(initialState, machine) {
2696
2696
  return reactExports.useReducer((state, event) => {
2697
2697
  const nextState = machine[state][event];
2698
2698
  return nextState ?? state;
2699
- }, initialState2);
2699
+ }, initialState);
2700
2700
  }
2701
2701
  var Presence = (props) => {
2702
2702
  const { present, children: children2 } = props;
@@ -2712,8 +2712,8 @@ function usePresence(present) {
2712
2712
  const stylesRef = reactExports.useRef(null);
2713
2713
  const prevPresentRef = reactExports.useRef(present);
2714
2714
  const prevAnimationNameRef = reactExports.useRef("none");
2715
- const initialState2 = present ? "mounted" : "unmounted";
2716
- const [state, send] = useStateMachine(initialState2, {
2715
+ const initialState = present ? "mounted" : "unmounted";
2716
+ const [state, send] = useStateMachine(initialState, {
2717
2717
  mounted: {
2718
2718
  UNMOUNT: "unmounted",
2719
2719
  ANIMATION_OUT: "unmountSuspended"
@@ -3280,31 +3280,31 @@ function getExitSideFromRect(point2, rect) {
3280
3280
  throw new Error("unreachable");
3281
3281
  }
3282
3282
  }
3283
- function getPaddedExitPoints(exitPoint, exitSide, padding2 = 5) {
3283
+ function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
3284
3284
  const paddedExitPoints = [];
3285
3285
  switch (exitSide) {
3286
3286
  case "top":
3287
3287
  paddedExitPoints.push(
3288
- { x: exitPoint.x - padding2, y: exitPoint.y + padding2 },
3289
- { x: exitPoint.x + padding2, y: exitPoint.y + padding2 }
3288
+ { x: exitPoint.x - padding, y: exitPoint.y + padding },
3289
+ { x: exitPoint.x + padding, y: exitPoint.y + padding }
3290
3290
  );
3291
3291
  break;
3292
3292
  case "bottom":
3293
3293
  paddedExitPoints.push(
3294
- { x: exitPoint.x - padding2, y: exitPoint.y - padding2 },
3295
- { x: exitPoint.x + padding2, y: exitPoint.y - padding2 }
3294
+ { x: exitPoint.x - padding, y: exitPoint.y - padding },
3295
+ { x: exitPoint.x + padding, y: exitPoint.y - padding }
3296
3296
  );
3297
3297
  break;
3298
3298
  case "left":
3299
3299
  paddedExitPoints.push(
3300
- { x: exitPoint.x + padding2, y: exitPoint.y - padding2 },
3301
- { x: exitPoint.x + padding2, y: exitPoint.y + padding2 }
3300
+ { x: exitPoint.x + padding, y: exitPoint.y - padding },
3301
+ { x: exitPoint.x + padding, y: exitPoint.y + padding }
3302
3302
  );
3303
3303
  break;
3304
3304
  case "right":
3305
3305
  paddedExitPoints.push(
3306
- { x: exitPoint.x - padding2, y: exitPoint.y - padding2 },
3307
- { x: exitPoint.x - padding2, y: exitPoint.y + padding2 }
3306
+ { x: exitPoint.x - padding, y: exitPoint.y - padding },
3307
+ { x: exitPoint.x - padding, y: exitPoint.y + padding }
3308
3308
  );
3309
3309
  break;
3310
3310
  }
@@ -6691,7 +6691,7 @@ const hasA11yProp = (props) => {
6691
6691
  */
6692
6692
  const Icon = reactExports.forwardRef(
6693
6693
  ({
6694
- color: color5 = "currentColor",
6694
+ color: color2 = "currentColor",
6695
6695
  size: size2 = 24,
6696
6696
  strokeWidth = 2,
6697
6697
  absoluteStrokeWidth,
@@ -6706,7 +6706,7 @@ const Icon = reactExports.forwardRef(
6706
6706
  ...defaultAttributes,
6707
6707
  width: size2,
6708
6708
  height: size2,
6709
- stroke: color5,
6709
+ stroke: color2,
6710
6710
  strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size2) : strokeWidth,
6711
6711
  className: mergeClasses("lucide", className),
6712
6712
  ...!children2 && !hasA11yProp(rest) && { "aria-hidden": "true" },
@@ -6746,22 +6746,30 @@ const createLucideIcon = (iconName, iconNode) => {
6746
6746
  * This source code is licensed under the ISC license.
6747
6747
  * See the LICENSE file in the root directory of this source tree.
6748
6748
  */
6749
- const __iconNode$5 = [
6749
+ const __iconNode$6 = [
6750
6750
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
6751
6751
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
6752
6752
  ];
6753
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$5);
6753
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$6);
6754
6754
  /**
6755
6755
  * @license lucide-react v0.575.0 - ISC
6756
6756
  *
6757
6757
  * This source code is licensed under the ISC license.
6758
6758
  * See the LICENSE file in the root directory of this source tree.
6759
6759
  */
6760
- const __iconNode$4 = [
6760
+ const __iconNode$5 = [
6761
6761
  ["path", { d: "M5 12h14", key: "1ays0h" }],
6762
6762
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
6763
6763
  ];
6764
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$4);
6764
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$5);
6765
+ /**
6766
+ * @license lucide-react v0.575.0 - ISC
6767
+ *
6768
+ * This source code is licensed under the ISC license.
6769
+ * See the LICENSE file in the root directory of this source tree.
6770
+ */
6771
+ const __iconNode$4 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
6772
+ const Check = createLucideIcon("check", __iconNode$4);
6765
6773
  /**
6766
6774
  * @license lucide-react v0.575.0 - ISC
6767
6775
  *
@@ -6784,8 +6792,11 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$2);
6784
6792
  * This source code is licensed under the ISC license.
6785
6793
  * See the LICENSE file in the root directory of this source tree.
6786
6794
  */
6787
- const __iconNode$1 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
6788
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$1);
6795
+ const __iconNode$1 = [
6796
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
6797
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
6798
+ ];
6799
+ const Copy = createLucideIcon("copy", __iconNode$1);
6789
6800
  /**
6790
6801
  * @license lucide-react v0.575.0 - ISC
6791
6802
  *
@@ -15279,7 +15290,15 @@ AllEventsSchema.and(object({
15279
15290
  eventId: string$2(),
15280
15291
  createdAt: date(),
15281
15292
  occurredAt: date().optional(),
15282
- specVersion: number$3().optional()
15293
+ specVersion: number$3().optional(),
15294
+ /**
15295
+ * Lazy hook resume idempotency key, persisted on `hook_received` events so
15296
+ * the queue consumer can detect that the producer's concurrent direct write
15297
+ * already landed in the run_started preload and skip its own re-ensure.
15298
+ * Mirrors {@link CreateEventParams.resumeId}; absent on all other events and
15299
+ * on legacy (non-lazy) resumes.
15300
+ */
15301
+ resumeId: string$2().optional()
15283
15302
  }));
15284
15303
  const WorkflowRunStatusSchema = _enum([
15285
15304
  "pending",
@@ -15528,7 +15547,9 @@ object({
15528
15547
  retryAfter: NullableDateSchema,
15529
15548
  errorCode: NullableStringSchema,
15530
15549
  workflowCoreVersion: NullableStringSchema,
15531
- workflowEncryptionEnabled: NullableBooleanSchema
15550
+ workflowEncryptionEnabled: NullableBooleanSchema,
15551
+ /** Compute instance of the latest attempt's `step_started`. */
15552
+ computeInstanceId: NullableStringSchema
15532
15553
  });
15533
15554
  object({
15534
15555
  runId: string$2(),
@@ -15545,6 +15566,8 @@ object({
15545
15566
  region: NullableStringSchema,
15546
15567
  vercelId: NullableStringSchema,
15547
15568
  requestId: NullableStringSchema,
15569
+ /** Compute instance that wrote the event. See CreateEventParams. */
15570
+ computeInstanceId: NullableStringSchema,
15548
15571
  resumeAt: NullableDateSchema,
15549
15572
  retryAfter: NullableDateSchema,
15550
15573
  errorCode: NullableStringSchema,
@@ -15601,7 +15624,50 @@ const RunInputSchema = object({
15601
15624
  * `start()` option so resilient run creation validates the same way as
15602
15625
  * the original `run_created` attempt.
15603
15626
  */
15604
- allowReservedAttributes: literal(true).optional()
15627
+ allowReservedAttributes: literal(true).optional(),
15628
+ /**
15629
+ * The environment the creating client's writes are attributed to, as
15630
+ * reported by {@link World.getEnvironment} at `start()` time (on Vercel:
15631
+ * `'production' | 'preview' | 'development'`).
15632
+ *
15633
+ * This exists so the resilient-start path can be checked for a tenant
15634
+ * mismatch. `start()` writes `run_created` under the caller's own
15635
+ * credentials while pinning the queue message to a deployment, and those
15636
+ * two can disagree: if the message is consumed by a deployment in a
15637
+ * DIFFERENT environment, that consumer's `run_started` re-creates the run
15638
+ * under ITS tenant, so the same client-minted `wrun_` id ends up existing
15639
+ * in two environments — one stuck pending forever, the other executing.
15640
+ * Carrying the creator's environment lets the consumer compare it against
15641
+ * its own and refuse the delivery instead of forking the run.
15642
+ *
15643
+ * Absent for worlds with no environment dimension (local, Postgres), and
15644
+ * for older SDKs — consumers must treat it as advisory and skip the check
15645
+ * when it is missing.
15646
+ */
15647
+ environment: string$2().optional()
15648
+ });
15649
+ const HookResumeInputSchema = object({
15650
+ /** Stable idempotency key minted once per `resumeHook()` call. */
15651
+ resumeId: string$2(),
15652
+ /** The hook being resumed. */
15653
+ hookId: string$2(),
15654
+ /**
15655
+ * The hook's token, written into the `hook_received` event's `eventData` so
15656
+ * the consumer's re-ensured event carries the same token the producer would
15657
+ * — replay validates `eventData.token` against the `createHook` token.
15658
+ */
15659
+ token: string$2(),
15660
+ /** The serialized resume payload, reused verbatim from the direct write. */
15661
+ payload: unknown$1(),
15662
+ /**
15663
+ * Content digest of `payload`, computed once by the producer over the
15664
+ * serialized bytes and forwarded verbatim on both the direct `events.create`
15665
+ * and this queue message. The consumer forwards it back to the server so both
15666
+ * writers of the same `resumeId` record an identical digest on the
15667
+ * `(runId, resumeId)` constraint — required because the v4 payload ref is not
15668
+ * content-stable server-side.
15669
+ */
15670
+ payloadDigest: string$2()
15605
15671
  });
15606
15672
  const WorkflowInvokePayloadSchema = object({
15607
15673
  runId: string$2(),
@@ -15612,6 +15678,14 @@ const WorkflowInvokePayloadSchema = object({
15612
15678
  eventId: string$2(),
15613
15679
  count: number$3().int().positive()
15614
15680
  }).optional(),
15681
+ /**
15682
+ * Re-invocations so far in this chain of stale-snapshot (precondition)
15683
+ * rejections. Counted on the message because the in-process restart budget
15684
+ * lives in the invocation closure and the queue's delivery count resets on
15685
+ * every fresh enqueue, so without this a permanently fenced run would cycle
15686
+ * forever instead of failing.
15687
+ */
15688
+ preconditionReinvocations: number$3().int().positive().optional(),
15615
15689
  /** Number of times this message has been re-enqueued due to server errors (5xx) */
15616
15690
  serverErrorRetryCount: number$3().int().optional(),
15617
15691
  /** Step ID for inline step execution in combined handler. If provided, the flow execution
@@ -15620,7 +15694,13 @@ const WorkflowInvokePayloadSchema = object({
15620
15694
  /** Step name, sent alongside stepId to avoid loading the event log just to resolve the name. */
15621
15695
  stepName: string$2().optional(),
15622
15696
  /** Run creation data, only present on the first queue delivery from start() */
15623
- runInput: RunInputSchema.optional()
15697
+ runInput: RunInputSchema.optional(),
15698
+ /**
15699
+ * Lazy hook resume data, only present when `resumeHook()` takes the parallel
15700
+ * fast path. A consumer that understands this field idempotently ensures the
15701
+ * `hook_received` event exists (keyed by `resumeId`) before replaying.
15702
+ */
15703
+ hookInput: HookResumeInputSchema.optional()
15624
15704
  });
15625
15705
  const HealthCheckPayloadSchema = object({
15626
15706
  __healthCheck: literal(true),
@@ -15653,7 +15733,23 @@ const HookResumeContextSchema = object({
15653
15733
  // the run or fetching its symmetric key. Absent on runs created before
15654
15734
  // sealed envelopes and on projects with encryption disabled, where the
15655
15735
  // resume falls back to the symmetric per-run key.
15656
- encryptionPublicKey: string$2().optional()
15736
+ encryptionPublicKey: string$2().optional(),
15737
+ // Feature marker: the version of the lazy-hook-resume consumer protocol the
15738
+ // run's creating deployment supports. Present (>= 1) means that deployment's
15739
+ // `@workflow/core` re-ensures the `hook_received` event from the queue
15740
+ // message's `hookInput` on replay, so `resumeHook()`'s parallel fast path is
15741
+ // safe to use. Because a run is pinned to its creating deployment, this
15742
+ // marker is a reliable per-run attestation — unlike inferring support from a
15743
+ // version compare against a predicted release cutoff. Absent on runs created
15744
+ // before the marker existed (fall back to the sequential path).
15745
+ hookResumeInputVersion: number$3().optional()
15746
+ });
15747
+ const HookResumeCapabilitiesSchema = object({
15748
+ // Present (>= HOOK_RESUME_DEDUP_VERSION) when the live backend enforces the
15749
+ // `(runId, resumeId)` dedup constraint AND no server-side kill switch is
15750
+ // active. Absent against an older/rolled-back server or when the kill switch
15751
+ // is engaged.
15752
+ hookResumeDedupVersion: number$3()
15657
15753
  });
15658
15754
  object({
15659
15755
  runId: string$2(),
@@ -15671,7 +15767,15 @@ object({
15671
15767
  // Present when the server stored it (new hooks) or synthesized it from the
15672
15768
  // run (old hooks). Absent only against an old server, where the resume path
15673
15769
  // falls back to `runs.get`.
15674
- resumeContext: HookResumeContextSchema.optional()
15770
+ resumeContext: HookResumeContextSchema.optional(),
15771
+ // Backend dedup capability, computed FRESH by the server on every by-token
15772
+ // lookup — RESPONSE-ONLY and TRANSIENT. Never persisted on the hook entity
15773
+ // and never part of `resumeContext`, so a server rollback or kill switch
15774
+ // takes effect on the very next lookup (the field simply stops appearing).
15775
+ // `resumeHook()` gates its parallel fast path on this being present and
15776
+ // current. Absent against an older/rolled-back server or when the kill switch
15777
+ // is active.
15778
+ resumeCapabilities: HookResumeCapabilitiesSchema.optional()
15675
15779
  });
15676
15780
  const zodJsonSchema = lazy(() => {
15677
15781
  return union([
@@ -15737,10 +15841,55 @@ function decode_legacy(base642) {
15737
15841
  const native = typeof Uint8Array.fromBase64 === "function";
15738
15842
  const buffer = typeof process === "object" && ((_a2 = process.versions) == null ? void 0 : _a2.node) !== void 0;
15739
15843
  const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
15740
- function parse$3(serialized, revivers) {
15844
+ function merge_operations(defaults, overrides) {
15845
+ return defaults;
15846
+ }
15847
+ const parse_operations = {
15848
+ fromPrimitive: (primitive) => primitive,
15849
+ fromISOString: (iso) => new Date(iso),
15850
+ fromStringValue: (tag, text2) => {
15851
+ if (tag === "URL") return new URL(text2);
15852
+ if (tag === "URLSearchParams") return new URLSearchParams(text2);
15853
+ return Temporal[tag.slice(9)].from(text2);
15854
+ },
15855
+ fromArrayBuffer: (buffer2) => buffer2,
15856
+ fromRegExpInfo: (source, flags) => new RegExp(source, flags),
15857
+ fromViewInfo: (tag, buffer2, byteOffset, length) => {
15858
+ const Constructor = (
15859
+ /** @type {any} */
15860
+ globalThis[tag]
15861
+ );
15862
+ return byteOffset !== void 0 ? new Constructor(buffer2, byteOffset, length) : new Constructor(buffer2);
15863
+ },
15864
+ box: (value) => Object(value),
15865
+ createArray: (length) => new Array(length),
15866
+ createSparseArray: (length) => {
15867
+ const array2 = [];
15868
+ array2[MAX_ARRAY_INDEX] = void 0;
15869
+ delete array2[MAX_ARRAY_INDEX];
15870
+ array2.length = length;
15871
+ return array2;
15872
+ },
15873
+ createObject: () => ({}),
15874
+ createNullPrototypeObject: () => /* @__PURE__ */ Object.create(null),
15875
+ createSet: () => /* @__PURE__ */ new Set(),
15876
+ createMap: () => /* @__PURE__ */ new Map(),
15877
+ set: (target2, key, value) => {
15878
+ target2[key] = value;
15879
+ },
15880
+ addValue: (set, value) => {
15881
+ set.add(value);
15882
+ },
15883
+ addEntry: (map2, key, value) => {
15884
+ map2.set(key, value);
15885
+ }
15886
+ };
15887
+ const default_parse_operations = Object.freeze(parse_operations);
15888
+ function parse$3(serialized, revivers, options) {
15741
15889
  return unflatten(JSON.parse(serialized), revivers);
15742
15890
  }
15743
- function unflatten(parsed, revivers) {
15891
+ function unflatten(parsed, revivers, options) {
15892
+ const ops = merge_operations(default_parse_operations);
15744
15893
  if (typeof parsed === "number") return hydrate(parsed, true);
15745
15894
  if (!Array.isArray(parsed) || parsed.length === 0) {
15746
15895
  throw new Error("Invalid input");
@@ -15752,18 +15901,18 @@ function unflatten(parsed, revivers) {
15752
15901
  const hydrated = Array(values.length);
15753
15902
  let hydrating = null;
15754
15903
  function hydrate(index2, standalone = false) {
15755
- if (index2 === UNDEFINED) return void 0;
15756
- if (index2 === NAN) return NaN;
15757
- if (index2 === POSITIVE_INFINITY) return Infinity;
15758
- if (index2 === NEGATIVE_INFINITY) return -Infinity;
15759
- if (index2 === NEGATIVE_ZERO) return -0;
15904
+ if (index2 === UNDEFINED) return ops.fromPrimitive(void 0);
15905
+ if (index2 === NAN) return ops.fromPrimitive(NaN);
15906
+ if (index2 === POSITIVE_INFINITY) return ops.fromPrimitive(Infinity);
15907
+ if (index2 === NEGATIVE_INFINITY) return ops.fromPrimitive(-Infinity);
15908
+ if (index2 === NEGATIVE_ZERO) return ops.fromPrimitive(-0);
15760
15909
  if (standalone || typeof index2 !== "number") {
15761
15910
  throw new Error(`Invalid input`);
15762
15911
  }
15763
15912
  if (index2 in hydrated) return hydrated[index2];
15764
15913
  const value = values[index2];
15765
15914
  if (!value || typeof value !== "object") {
15766
- hydrated[index2] = value;
15915
+ hydrated[index2] = ops.fromPrimitive(value);
15767
15916
  } else if (Array.isArray(value)) {
15768
15917
  if (typeof value[0] === "string") {
15769
15918
  const type = value[0];
@@ -15773,6 +15922,9 @@ function unflatten(parsed, revivers) {
15773
15922
  if (typeof i !== "number") {
15774
15923
  i = values.push(value[1]) - 1;
15775
15924
  }
15925
+ if (Object.hasOwn(hydrated, i)) {
15926
+ return hydrated[index2] = reviver(hydrated[i]);
15927
+ }
15776
15928
  hydrating ?? (hydrating = /* @__PURE__ */ new Set());
15777
15929
  if (hydrating.has(i)) {
15778
15930
  throw new Error("Invalid circular reference");
@@ -15784,44 +15936,44 @@ function unflatten(parsed, revivers) {
15784
15936
  }
15785
15937
  switch (type) {
15786
15938
  case "Date":
15787
- hydrated[index2] = new Date(value[1]);
15939
+ hydrated[index2] = ops.fromISOString(value[1]);
15788
15940
  break;
15789
15941
  case "Set":
15790
- const set = /* @__PURE__ */ new Set();
15942
+ const set = ops.createSet();
15791
15943
  hydrated[index2] = set;
15792
15944
  for (let i = 1; i < value.length; i += 1) {
15793
- set.add(hydrate(value[i]));
15945
+ ops.addValue(set, hydrate(value[i]));
15794
15946
  }
15795
15947
  break;
15796
15948
  case "Map":
15797
- const map2 = /* @__PURE__ */ new Map();
15949
+ const map2 = ops.createMap();
15798
15950
  hydrated[index2] = map2;
15799
15951
  for (let i = 1; i < value.length; i += 2) {
15800
- map2.set(hydrate(value[i]), hydrate(value[i + 1]));
15952
+ ops.addEntry(map2, hydrate(value[i]), hydrate(value[i + 1]));
15801
15953
  }
15802
15954
  break;
15803
15955
  case "RegExp":
15804
- hydrated[index2] = new RegExp(value[1], value[2]);
15956
+ hydrated[index2] = ops.fromRegExpInfo(value[1], value[2]);
15805
15957
  break;
15806
15958
  case "Object": {
15807
15959
  const wrapped_index = value[1];
15808
15960
  if (typeof values[wrapped_index] === "object" && values[wrapped_index][0] !== "BigInt") {
15809
15961
  throw new Error("Invalid input");
15810
15962
  }
15811
- hydrated[index2] = Object(hydrate(wrapped_index));
15963
+ hydrated[index2] = ops.box(hydrate(wrapped_index));
15812
15964
  break;
15813
15965
  }
15814
15966
  case "BigInt":
15815
- hydrated[index2] = BigInt(value[1]);
15967
+ hydrated[index2] = ops.fromPrimitive(BigInt(value[1]));
15816
15968
  break;
15817
15969
  case "null":
15818
- const obj = /* @__PURE__ */ Object.create(null);
15970
+ const obj = ops.createNullPrototypeObject();
15819
15971
  hydrated[index2] = obj;
15820
15972
  for (let i = 1; i < value.length; i += 2) {
15821
15973
  if (value[i] === "__proto__") {
15822
15974
  throw new Error("Cannot parse an object with a `__proto__` property");
15823
15975
  }
15824
- obj[value[i]] = hydrate(value[i + 1]);
15976
+ ops.set(obj, value[i], hydrate(value[i + 1]));
15825
15977
  }
15826
15978
  break;
15827
15979
  case "Int8Array":
@@ -15840,9 +15992,8 @@ function unflatten(parsed, revivers) {
15840
15992
  if (values[value[1]][0] !== "ArrayBuffer") {
15841
15993
  throw new Error("Invalid data");
15842
15994
  }
15843
- const TypedArrayConstructor = globalThis[type];
15844
15995
  const buffer2 = hydrate(value[1]);
15845
- hydrated[index2] = value[2] !== void 0 ? new TypedArrayConstructor(buffer2, value[2], value[3]) : new TypedArrayConstructor(buffer2);
15996
+ hydrated[index2] = ops.fromViewInfo(type, buffer2, value[2], value[3]);
15846
15997
  break;
15847
15998
  }
15848
15999
  case "ArrayBuffer": {
@@ -15850,10 +16001,11 @@ function unflatten(parsed, revivers) {
15850
16001
  if (typeof base642 !== "string") {
15851
16002
  throw new Error("Invalid ArrayBuffer encoding");
15852
16003
  }
15853
- const arraybuffer = decode64(base642);
15854
- hydrated[index2] = arraybuffer;
16004
+ hydrated[index2] = ops.fromArrayBuffer(decode64(base642));
15855
16005
  break;
15856
16006
  }
16007
+ case "URL":
16008
+ case "URLSearchParams":
15857
16009
  case "Temporal.Duration":
15858
16010
  case "Temporal.Instant":
15859
16011
  case "Temporal.PlainDate":
@@ -15862,18 +16014,7 @@ function unflatten(parsed, revivers) {
15862
16014
  case "Temporal.PlainMonthDay":
15863
16015
  case "Temporal.PlainYearMonth":
15864
16016
  case "Temporal.ZonedDateTime": {
15865
- const temporalName = type.slice(9);
15866
- hydrated[index2] = Temporal[temporalName].from(value[1]);
15867
- break;
15868
- }
15869
- case "URL": {
15870
- const url = new URL(value[1]);
15871
- hydrated[index2] = url;
15872
- break;
15873
- }
15874
- case "URLSearchParams": {
15875
- const url = new URLSearchParams(value[1]);
15876
- hydrated[index2] = url;
16017
+ hydrated[index2] = ops.fromStringValue(type, value[1]);
15877
16018
  break;
15878
16019
  }
15879
16020
  default:
@@ -15884,36 +16025,32 @@ function unflatten(parsed, revivers) {
15884
16025
  if (!is_valid_array_len(len)) {
15885
16026
  throw new Error("Invalid input");
15886
16027
  }
15887
- const array2 = [];
16028
+ const array2 = ops.createSparseArray(len);
15888
16029
  hydrated[index2] = array2;
15889
- array2[MAX_ARRAY_INDEX] = void 0;
15890
- delete array2[MAX_ARRAY_INDEX];
15891
16030
  for (let i = 2; i < value.length; i += 2) {
15892
16031
  const idx = value[i];
15893
16032
  if (!is_valid_array_index(idx) || idx >= len) {
15894
16033
  throw new Error("Invalid input");
15895
16034
  }
15896
- array2[idx] = hydrate(value[i + 1]);
16035
+ ops.set(array2, idx, hydrate(value[i + 1]));
15897
16036
  }
15898
- array2.length = len;
15899
16037
  } else {
15900
- const array2 = new Array(value.length);
16038
+ const array2 = ops.createArray(value.length);
15901
16039
  hydrated[index2] = array2;
15902
16040
  for (let i = 0; i < value.length; i += 1) {
15903
16041
  const n = value[i];
15904
16042
  if (n === HOLE) continue;
15905
- array2[i] = hydrate(n);
16043
+ ops.set(array2, i, hydrate(n));
15906
16044
  }
15907
16045
  }
15908
16046
  } else {
15909
- const object2 = {};
16047
+ const object2 = ops.createObject();
15910
16048
  hydrated[index2] = object2;
15911
16049
  for (const key of Object.keys(value)) {
15912
16050
  if (key === "__proto__") {
15913
16051
  throw new Error("Cannot parse an object with a `__proto__` property");
15914
16052
  }
15915
- const n = value[key];
15916
- object2[key] = hydrate(n);
16053
+ ops.set(object2, key, hydrate(value[key]));
15917
16054
  }
15918
16055
  }
15919
16056
  return hydrated[index2];
@@ -16070,7 +16207,9 @@ function appendFramedDetails(title, details) {
16070
16207
  const head = isLast ? "╰▶ " : "├▶ ";
16071
16208
  const cont = isLast ? " " : "│ ";
16072
16209
  const text2 = `${detail.label}: ${detail.value}`;
16073
- text2.split("\n").forEach((line, i) => lines.push(`${i === 0 ? head : cont}${line}`));
16210
+ text2.split("\n").forEach((line, i) => {
16211
+ lines.push(`${i === 0 ? head : cont}${line}`);
16212
+ });
16074
16213
  });
16075
16214
  return lines.join("\n");
16076
16215
  }
@@ -17254,7 +17393,7 @@ async function hydrateResourceIOAsync(resource, key) {
17254
17393
  return { hydrateDataWithKey: hydrateDataWithKey3, deriveRunPayloadKeys: deriveRunPayloadKeys3 };
17255
17394
  }, true ? void 0 : void 0);
17256
17395
  const { ensureZstdDecoderRegistered } = await __vitePreload(async () => {
17257
- const { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 } = await import("./zstd-browser-decoder-BAY5XtBl.js");
17396
+ const { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 } = await import("./zstd-browser-decoder-Dw3HhTgO.js");
17258
17397
  return { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 };
17259
17398
  }, true ? __vite__mapDeps([0,1]) : void 0);
17260
17399
  ensureZstdDecoderRegistered();
@@ -17726,7 +17865,7 @@ function getDefaultSwipeDirections(position2) {
17726
17865
  }
17727
17866
  const Toast = (props) => {
17728
17867
  var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
17729
- const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
17868
+ const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
17730
17869
  const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
17731
17870
  const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
17732
17871
  const [mounted, setMounted] = ReactExports.useState(false);
@@ -17877,14 +18016,14 @@ const Toast = (props) => {
17877
18016
  deleteToast();
17878
18017
  }, remainingTime.current);
17879
18018
  };
17880
- if (expanded2 || interacting || isDocumentHidden) {
18019
+ if (expanded || interacting || isDocumentHidden) {
17881
18020
  pauseTimer();
17882
18021
  } else {
17883
18022
  startTimer();
17884
18023
  }
17885
18024
  return () => clearTimeout(timeoutId);
17886
18025
  }, [
17887
- expanded2,
18026
+ expanded,
17888
18027
  interacting,
17889
18028
  toast2,
17890
18029
  toastType,
@@ -17938,7 +18077,7 @@ const Toast = (props) => {
17938
18077
  "data-invert": invert,
17939
18078
  "data-swipe-out": swipeOut,
17940
18079
  "data-swipe-direction": swipeOutDirection,
17941
- "data-expanded": Boolean(expanded2 || expandByDefault && mounted),
18080
+ "data-expanded": Boolean(expanded || expandByDefault && mounted),
17942
18081
  "data-testid": toast2.testId,
17943
18082
  style: {
17944
18083
  "--index": index2,
@@ -18160,7 +18299,7 @@ const Toaster = /* @__PURE__ */ ReactExports.forwardRef(function Toaster2(props,
18160
18299
  position2
18161
18300
  ]);
18162
18301
  const [heights, setHeights] = ReactExports.useState([]);
18163
- const [expanded2, setExpanded] = ReactExports.useState(false);
18302
+ const [expanded, setExpanded] = ReactExports.useState(false);
18164
18303
  const [interacting, setInteracting] = ReactExports.useState(false);
18165
18304
  const [actualTheme, setActualTheme] = ReactExports.useState(theme !== "system" ? theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
18166
18305
  const listRef = ReactExports.useRef(null);
@@ -18382,7 +18521,7 @@ const Toaster = /* @__PURE__ */ ReactExports.forwardRef(function Toaster2(props,
18382
18521
  setHeights,
18383
18522
  expandByDefault: expand,
18384
18523
  gap,
18385
- expanded: expanded2,
18524
+ expanded,
18386
18525
  swipeDirections: props.swipeDirections
18387
18526
  });
18388
18527
  }));
@@ -18529,6 +18668,27 @@ const cva = (base, config2) => (props) => {
18529
18668
  }, []);
18530
18669
  return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
18531
18670
  };
18671
+ function CopyButton({ copyText, ariaLabel, className }) {
18672
+ const [copied, setCopied] = reactExports.useState(false);
18673
+ const timeoutRef = reactExports.useRef(null);
18674
+ reactExports.useEffect(() => {
18675
+ return () => {
18676
+ if (timeoutRef.current) {
18677
+ clearTimeout(timeoutRef.current);
18678
+ }
18679
+ };
18680
+ }, []);
18681
+ return jsxRuntimeExports.jsx("button", { type: "button", "aria-label": ariaLabel, className: cn$4("cursor-pointer text-gray-800 hover:text-gray-1000 bg-transparent border-0 p-1 m-0", className), onClick: (e) => {
18682
+ e.stopPropagation();
18683
+ if (timeoutRef.current) {
18684
+ clearTimeout(timeoutRef.current);
18685
+ }
18686
+ void navigator.clipboard.writeText(copyText).then(() => {
18687
+ setCopied(true);
18688
+ timeoutRef.current = setTimeout(() => setCopied(false), 1e3);
18689
+ });
18690
+ }, children: jsxRuntimeExports.jsxs("div", { className: "relative w-3 h-3", children: [jsxRuntimeExports.jsx("div", { className: cn$4("absolute inset-0 flex items-center justify-center transition-all duration-150 ease-out", copied ? "scale-100 opacity-100" : "scale-0 opacity-0"), children: jsxRuntimeExports.jsx(Check, { className: "w-3 h-3" }) }), jsxRuntimeExports.jsx("div", { className: cn$4("absolute inset-0 flex items-center justify-center transition-all duration-150 ease-out", copied ? "scale-0 opacity-0" : "scale-100 opacity-100"), children: jsxRuntimeExports.jsx(Copy, { className: "w-3 h-3" }) })] }) });
18691
+ }
18532
18692
  const CollapsibleContext = reactExports.createContext(null);
18533
18693
  function useCollapsibleContext(part) {
18534
18694
  const context = reactExports.useContext(CollapsibleContext);
@@ -18597,8 +18757,8 @@ const buttonVariants$1 = cva([
18597
18757
  ghost: "[--themed-bg:_transparent] [--themed-fg:_var(--ds-gray-1000)] [--themed-hover-bg:_var(--ds-gray-alpha-100)]"
18598
18758
  },
18599
18759
  size: {
18600
- default: "h-10 px-4 text-[14px]",
18601
- sm: "h-8 px-3 text-[14px]",
18760
+ default: "h-10 px-4 text-button-14",
18761
+ sm: "h-8 px-3 text-button-14",
18602
18762
  xs: "h-6 px-1.5 py-0.5 text-button-12 rounded-[4px]",
18603
18763
  icon: "h-8 w-8"
18604
18764
  }
@@ -18720,7 +18880,7 @@ const JSON_VIEW_STYLES = `
18720
18880
  .${CLS.collapsedContent}::after { content: '...'; }
18721
18881
  `;
18722
18882
  const KEYFRAMES = `@keyframes wf-spinner-fade{0%{opacity:1}100%{opacity:.15}}`;
18723
- function Spinner({ size: size2 = 14, color: color5 }) {
18883
+ function Spinner({ size: size2 = 14, color: color2 }) {
18724
18884
  const config2 = size2 <= 12 ? {
18725
18885
  angle: 45,
18726
18886
  delays: [-875, -750, -625, -500, -375, -250, -125, 0],
@@ -18767,7 +18927,7 @@ function Spinner({ size: size2 = 14, color: color5 }) {
18767
18927
  marginLeft: -config2.lineW / 2,
18768
18928
  marginTop: -config2.lineH / 2,
18769
18929
  borderRadius: 1,
18770
- backgroundColor: color5 ?? "var(--ds-gray-700)",
18930
+ backgroundColor: color2 ?? "var(--ds-gray-700)",
18771
18931
  transform: `rotate(${i * config2.angle}deg) translate(${size2 * 0.36}px)`,
18772
18932
  animation: `wf-spinner-fade ${config2.duration}ms linear infinite`,
18773
18933
  animationDelay: `${delay}ms`
@@ -18875,8 +19035,8 @@ function DecodedBytesChunk({ decodedText, source }) {
18875
19035
  }, onClick: () => setSelectedView("bytes"), "aria-pressed": selectedView === "bytes", "aria-label": "Show raw bytes summary", children: "Bytes" })] }) })] });
18876
19036
  }
18877
19037
  function DecodedBytesInspector({ decodedText, source }) {
18878
- const [expanded2, setExpanded] = reactExports.useState(false);
18879
- return jsxRuntimeExports.jsxs("div", { className: "font-mono", children: [jsxRuntimeExports.jsxs("button", { type: "button", className: "flex max-w-full items-start gap-1 text-left", style: { color: "var(--ds-gray-1000)" }, onClick: () => setExpanded((value) => !value), title: `${source.type} decoded as ${source.encoding.toUpperCase()} text`, children: [jsxRuntimeExports.jsx("span", { className: "select-none", style: { color: "var(--ds-gray-700)" }, children: expanded2 ? "▼" : "▶" }), jsxRuntimeExports.jsx("span", { className: "min-w-0 break-words", children: source.rawSummary })] }), expanded2 && jsxRuntimeExports.jsxs("div", { className: "mt-1 pl-5", children: [jsxRuntimeExports.jsx("span", { style: { color: "var(--ds-gray-700)" }, children: "decoded: " }), jsxRuntimeExports.jsx("span", { className: "whitespace-pre-wrap break-words", style: { color: "var(--ds-green-900)" }, children: JSON.stringify(decodedText) })] })] });
19038
+ const [expanded, setExpanded] = reactExports.useState(false);
19039
+ return jsxRuntimeExports.jsxs("div", { className: "font-mono", children: [jsxRuntimeExports.jsxs("button", { type: "button", className: "flex max-w-full items-start gap-1 text-left", style: { color: "var(--ds-gray-1000)" }, onClick: () => setExpanded((value) => !value), title: `${source.type} decoded as ${source.encoding.toUpperCase()} text`, children: [jsxRuntimeExports.jsx("span", { className: "select-none", style: { color: "var(--ds-gray-700)" }, children: expanded ? "▼" : "▶" }), jsxRuntimeExports.jsx("span", { className: "min-w-0 break-words", children: source.rawSummary })] }), expanded && jsxRuntimeExports.jsxs("div", { className: "mt-1 pl-5", children: [jsxRuntimeExports.jsx("span", { style: { color: "var(--ds-gray-700)" }, children: "decoded: " }), jsxRuntimeExports.jsx("span", { className: "whitespace-pre-wrap break-words", style: { color: "var(--ds-green-900)" }, children: JSON.stringify(decodedText) })] })] });
18880
19040
  }
18881
19041
  function BytesDisplayValue({ display }) {
18882
19042
  if (display.decodedFrom) {
@@ -18994,7 +19154,7 @@ function moveExpanderFocus(outerRef, direction) {
18994
19154
  }
18995
19155
  function ExpandableContainer({ field, entries, open: open2, close, prefix, ctx, isLast }) {
18996
19156
  const { level, shouldExpand, outerRef } = ctx;
18997
- const [expanded2, setExpanded] = reactExports.useState(() => shouldExpand(level));
19157
+ const [expanded, setExpanded] = reactExports.useState(() => shouldExpand(level));
18998
19158
  const rowRef = reactExports.useRef(null);
18999
19159
  const contentsId = reactExports.useId();
19000
19160
  if (entries.length === 0) {
@@ -19027,7 +19187,7 @@ function ExpandableContainer({ field, entries, open: open2, close, prefix, ctx,
19027
19187
  }
19028
19188
  };
19029
19189
  const lastIndex = entries.length - 1;
19030
- return jsxRuntimeExports.jsxs("div", { className: CLS.child, role: "treeitem", "aria-expanded": expanded2, "aria-controls": expanded2 ? contentsId : void 0, "data-json-expander": true, ref: rowRef, tabIndex: level === 0 ? 0 : -1, onClick, onKeyDown, children: [jsxRuntimeExports.jsx("span", { className: expanded2 ? CLS.collapseIcon : CLS.expandIcon, "aria-hidden": "true" }), field !== void 0 && jsxRuntimeExports.jsx("span", { className: CLS.clickableLabel, children: `${formatField(field)}:` }), prefix ? jsxRuntimeExports.jsx("span", { className: CLS.className, children: prefix }) : null, jsxRuntimeExports.jsx("span", { className: CLS.punctuation, children: open2 }), expanded2 ? jsxRuntimeExports.jsx("ul", { id: contentsId, className: CLS.childFields, role: "group", children: entries.map(([childField, childValue], index2) => jsxRuntimeExports.jsx(DataRender, { field: childField, value: childValue, isLast: index2 === lastIndex, ctx: { ...ctx, level: level + 1 } }, childField ?? index2)) }) : jsxRuntimeExports.jsx("span", { className: CLS.collapsedContent, "aria-hidden": "true" }), jsxRuntimeExports.jsx("span", { className: CLS.punctuation, children: close }), jsxRuntimeExports.jsx(Comma, { isLast })] });
19190
+ return jsxRuntimeExports.jsxs("div", { className: CLS.child, role: "treeitem", "aria-expanded": expanded, "aria-controls": expanded ? contentsId : void 0, "data-json-expander": true, ref: rowRef, tabIndex: level === 0 ? 0 : -1, onClick, onKeyDown, children: [jsxRuntimeExports.jsx("span", { className: expanded ? CLS.collapseIcon : CLS.expandIcon, "aria-hidden": "true" }), field !== void 0 && jsxRuntimeExports.jsx("span", { className: CLS.clickableLabel, children: `${formatField(field)}:` }), prefix ? jsxRuntimeExports.jsx("span", { className: CLS.className, children: prefix }) : null, jsxRuntimeExports.jsx("span", { className: CLS.punctuation, children: open2 }), expanded ? jsxRuntimeExports.jsx("ul", { id: contentsId, className: CLS.childFields, role: "group", children: entries.map(([childField, childValue], index2) => jsxRuntimeExports.jsx(DataRender, { field: childField, value: childValue, isLast: index2 === lastIndex, ctx: { ...ctx, level: level + 1 } }, childField ?? index2)) }) : jsxRuntimeExports.jsx("span", { className: CLS.collapsedContent, "aria-hidden": "true" }), jsxRuntimeExports.jsx("span", { className: CLS.punctuation, children: close }), jsxRuntimeExports.jsx(Comma, { isLast })] });
19031
19191
  }
19032
19192
  function DataRender({ field, value, isLast, ctx }) {
19033
19193
  if (isBytesDisplay(value)) {
@@ -19211,6 +19371,29 @@ function isDeepEqual(a2, b2, seen2 = /* @__PURE__ */ new WeakMap()) {
19211
19371
  }
19212
19372
  return true;
19213
19373
  }
19374
+ const encryptedPlaceholderPreview = `{
19375
+ "input": "[encrypted]",
19376
+ "result": "[encrypted]"
19377
+ }`;
19378
+ function EncryptedDataBlock() {
19379
+ const ctx = reactExports.useContext(DecryptClickContext);
19380
+ return jsxRuntimeExports.jsxs("div", { className: "relative min-h-20 overflow-hidden rounded-md border border-gray-alpha-400 bg-background-100", children: [jsxRuntimeExports.jsx("pre", { "aria-hidden": "true", className: "pointer-events-none m-0 select-none p-3 font-mono text-label-12 text-gray-900 blur-[4px]", children: encryptedPlaceholderPreview }), jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: ctx ? jsxRuntimeExports.jsxs(Button$1, { onClick: ctx.onDecrypt, disabled: ctx.isDecrypting, size: "xs", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] }) : jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 rounded border border-gray-alpha-400 bg-gray-100 px-1.5 py-0.5 text-button-12 font-medium text-gray-700", children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), "Encrypted"] }) })] });
19381
+ }
19382
+ const serializeForClipboard = (value) => {
19383
+ if (typeof value === "string")
19384
+ return value;
19385
+ if (typeof value === "number" || typeof value === "boolean" || value === null) {
19386
+ return String(value);
19387
+ }
19388
+ try {
19389
+ return JSON.stringify(value, null, 2);
19390
+ } catch {
19391
+ return String(value);
19392
+ }
19393
+ };
19394
+ function CopyableDataBlock({ data }) {
19395
+ return jsxRuntimeExports.jsxs("div", { className: "relative overflow-x-auto rounded-md border border-gray-alpha-400 p-3", children: [jsxRuntimeExports.jsx(CopyButton, { copyText: serializeForClipboard(data), ariaLabel: "Copy data", className: "absolute right-2 top-2 z-10 flex h-6 w-6 items-center justify-center rounded-md border border-gray-alpha-400 !bg-background-100 p-0 text-gray-900 transition-transform transition-colors duration-100 hover:bg-gray-200 active:scale-95 active:bg-gray-300" }), jsxRuntimeExports.jsx(DataInspector, { data })] });
19396
+ }
19214
19397
  function setRef(ref, value) {
19215
19398
  if (typeof ref === "function") {
19216
19399
  return ref(value);
@@ -19940,7 +20123,7 @@ function ContextCardTrigger({ content: content2, children: children2, side = "ri
19940
20123
  opacity: Number(visible)
19941
20124
  }, children: content2 }) }, id), portalRef.current) : null] });
19942
20125
  }
19943
- function Skeleton$1({ className, style: style2, ...props }) {
20126
+ function Skeleton({ className, style: style2, ...props }) {
19944
20127
  return jsxRuntimeExports.jsx("div", { ...props, className: cn$4("rounded-md", className), style: { backgroundColor: "var(--ds-gray-200)", ...style2 } });
19945
20128
  }
19946
20129
  const TIME_UNITS = [
@@ -20026,12 +20209,12 @@ function ZoneDateTimeRow({ date: date2, zone }) {
20026
20209
  minute: "2-digit",
20027
20210
  second: "2-digit"
20028
20211
  });
20029
- return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5", children: [jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-4 px-1.5 bg-gray-200 rounded-xs", children: jsxRuntimeExports.jsx("span", { className: "text-[12px] font-mono text-gray-900", children: formattedZone }) }), jsxRuntimeExports.jsx("span", { className: "text-[13px] text-gray-1000", children: formattedDate })] }), jsxRuntimeExports.jsx("span", { className: "tabular-nums text-[12px] font-mono text-gray-900", children: formattedTime })] });
20212
+ return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5", children: [jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-4 px-1.5 bg-gray-200 rounded-xs", children: jsxRuntimeExports.jsx("span", { className: "text-label-12-mono text-gray-900", children: formattedZone }) }), jsxRuntimeExports.jsx("span", { className: "text-label-13 text-gray-1000", children: formattedDate })] }), jsxRuntimeExports.jsx("span", { className: "tabular-nums text-label-12-mono text-gray-900", children: formattedTime })] });
20030
20213
  }
20031
20214
  function RelativeTimeContextCardContent({ date: date2 }) {
20032
20215
  const localTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
20033
20216
  const timeAgo = useTimeAgo(date2);
20034
- return jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 min-w-[300px]", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-3", children: jsxRuntimeExports.jsx("span", { className: "tabular-nums text-[13px] text-gray-900", children: timeAgo }) }), jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: "UTC" }), jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: localTimezone })] })] });
20217
+ return jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 min-w-[300px]", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-3", children: jsxRuntimeExports.jsx("span", { className: "tabular-nums text-label-13 text-gray-900", children: timeAgo }) }), jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: "UTC" }), jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: localTimezone })] })] });
20035
20218
  }
20036
20219
  function DefaultTimeText({ date: date2 }) {
20037
20220
  const shortTimeAgo = useShortTimeAgo(date2);
@@ -20219,7 +20402,7 @@ function toResult$1(value) {
20219
20402
  }
20220
20403
  return value === null || value === void 0 ? empty$2 : [value];
20221
20404
  }
20222
- function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
20405
+ function visit$1(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
20223
20406
  let reverse;
20224
20407
  let test;
20225
20408
  let visitor;
@@ -20253,7 +20436,7 @@ function harden({ defaultOrigin = "", allowedLinkPrefixes = [], allowedImagePref
20253
20436
  return (tree) => {
20254
20437
  const visitor = createVisitor(defaultOrigin, allowedLinkPrefixes, allowedImagePrefixes, allowDataImages, allowedProtocols, blockedImageClass, blockedLinkClass, linkBlockPolicy, imageBlockPolicy);
20255
20438
  stripNullChildren(tree);
20256
- visit(tree, visitor);
20439
+ visit$1(tree, visitor);
20257
20440
  };
20258
20441
  }
20259
20442
  function parseUrl(url, defaultOrigin) {
@@ -20459,7 +20642,7 @@ const createVisitor = (defaultOrigin, allowedLinkPrefixes, allowedImagePrefixes,
20459
20642
  const transformedUrl = transformUrl(node2.properties.href, allowedLinkPrefixes, defaultOrigin, false, false, allowedProtocols);
20460
20643
  if (transformedUrl === null) {
20461
20644
  node2[SEEN] = true;
20462
- visit(node2, visitor);
20645
+ visit$1(node2, visitor);
20463
20646
  if (parent && typeof index2 === "number") {
20464
20647
  const result = resolveLinkBlockPolicy(node2, linkBlockPolicy, blockedLinkClass);
20465
20648
  if (result.type === "remove") {
@@ -20480,7 +20663,7 @@ const createVisitor = (defaultOrigin, allowedLinkPrefixes, allowedImagePrefixes,
20480
20663
  const transformedUrl = transformUrl(node2.properties.src, allowedImagePrefixes, defaultOrigin, allowDataImages, true, allowedProtocols);
20481
20664
  if (transformedUrl === null) {
20482
20665
  node2[SEEN] = true;
20483
- visit(node2, visitor);
20666
+ visit$1(node2, visitor);
20484
20667
  if (parent && typeof index2 === "number") {
20485
20668
  const result = resolveImageBlockPolicy(node2, imageBlockPolicy, blockedImageClass);
20486
20669
  if (result.type === "remove") {
@@ -31595,7 +31778,7 @@ function raw(tree, options) {
31595
31778
  file: state.options.file
31596
31779
  });
31597
31780
  if (state.stitches) {
31598
- visit(result, "comment", function(node2, index2, parent) {
31781
+ visit$1(result, "comment", function(node2, index2, parent) {
31599
31782
  const stitch2 = (
31600
31783
  /** @type {Stitch} */
31601
31784
  /** @type {unknown} */
@@ -32367,88 +32550,13 @@ function escapeStringRegexp(string2) {
32367
32550
  }
32368
32551
  return string2.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
32369
32552
  }
32370
- function color(d2) {
32371
- return d2;
32372
- }
32373
- const empty$1 = [];
32374
- const CONTINUE = true;
32375
- const EXIT = false;
32376
- const SKIP = "skip";
32377
- function visitParents(tree, test, visitor, reverse) {
32378
- let check;
32379
- {
32380
- check = test;
32381
- }
32382
- const is = convert(check);
32383
- const step = 1;
32384
- factory(tree, void 0, [])();
32385
- function factory(node2, index2, parents) {
32386
- const value = (
32387
- /** @type {Record<string, unknown>} */
32388
- node2 && typeof node2 === "object" ? node2 : {}
32389
- );
32390
- if (typeof value.type === "string") {
32391
- const name2 = (
32392
- // `hast`
32393
- typeof value.tagName === "string" ? value.tagName : (
32394
- // `xast`
32395
- typeof value.name === "string" ? value.name : void 0
32396
- )
32397
- );
32398
- Object.defineProperty(visit2, "name", {
32399
- value: "node (" + color(node2.type + (name2 ? "<" + name2 + ">" : "")) + ")"
32400
- });
32401
- }
32402
- return visit2;
32403
- function visit2() {
32404
- let result = empty$1;
32405
- let subresult;
32406
- let offset2;
32407
- let grandparents;
32408
- if (is(node2, index2, parents[parents.length - 1] || void 0)) {
32409
- result = toResult(visitor(node2, parents));
32410
- if (result[0] === EXIT) {
32411
- return result;
32412
- }
32413
- }
32414
- if ("children" in node2 && node2.children) {
32415
- const nodeAsParent = (
32416
- /** @type {UnistParent} */
32417
- node2
32418
- );
32419
- if (nodeAsParent.children && result[0] !== SKIP) {
32420
- offset2 = -1 + step;
32421
- grandparents = parents.concat(nodeAsParent);
32422
- while (offset2 > -1 && offset2 < nodeAsParent.children.length) {
32423
- const child = nodeAsParent.children[offset2];
32424
- subresult = factory(child, offset2, grandparents)();
32425
- if (subresult[0] === EXIT) {
32426
- return subresult;
32427
- }
32428
- offset2 = typeof subresult[1] === "number" ? subresult[1] : offset2 + step;
32429
- }
32430
- }
32431
- }
32432
- return result;
32433
- }
32434
- }
32435
- }
32436
- function toResult(value) {
32437
- if (Array.isArray(value)) {
32438
- return value;
32439
- }
32440
- if (typeof value === "number") {
32441
- return [CONTINUE, value];
32442
- }
32443
- return value === null || value === void 0 ? empty$1 : [value];
32444
- }
32445
32553
  function findAndReplace(tree, list2, options) {
32446
32554
  const settings = options || {};
32447
32555
  const ignored = convert(settings.ignore || []);
32448
32556
  const pairs = toPairs(list2);
32449
32557
  let pairIndex = -1;
32450
32558
  while (++pairIndex < pairs.length) {
32451
- visitParents(tree, "text", visitor);
32559
+ visitParents$1(tree, "text", visitor);
32452
32560
  }
32453
32561
  function visitor(node2, parents) {
32454
32562
  let index2 = -1;
@@ -33069,18 +33177,18 @@ function formatCodeAsIndented(node2, state) {
33069
33177
  );
33070
33178
  }
33071
33179
  function checkFence(state) {
33072
- const marker2 = state.options.fence || "`";
33073
- if (marker2 !== "`" && marker2 !== "~") {
33180
+ const marker = state.options.fence || "`";
33181
+ if (marker !== "`" && marker !== "~") {
33074
33182
  throw new Error(
33075
- "Cannot serialize code with `" + marker2 + "` for `options.fence`, expected `` ` `` or `~`"
33183
+ "Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`"
33076
33184
  );
33077
33185
  }
33078
- return marker2;
33186
+ return marker;
33079
33187
  }
33080
33188
  function code$2(node2, _2, state, info) {
33081
- const marker2 = checkFence(state);
33189
+ const marker = checkFence(state);
33082
33190
  const raw2 = node2.value || "";
33083
- const suffix = marker2 === "`" ? "GraveAccent" : "Tilde";
33191
+ const suffix = marker === "`" ? "GraveAccent" : "Tilde";
33084
33192
  if (formatCodeAsIndented(node2, state)) {
33085
33193
  const exit3 = state.enter("codeIndented");
33086
33194
  const value2 = state.indentLines(raw2, map);
@@ -33088,7 +33196,7 @@ function code$2(node2, _2, state, info) {
33088
33196
  return value2;
33089
33197
  }
33090
33198
  const tracker = state.createTracker(info);
33091
- const sequence = marker2.repeat(Math.max(longestStreak(raw2, marker2) + 1, 3));
33199
+ const sequence = marker.repeat(Math.max(longestStreak(raw2, marker) + 1, 3));
33092
33200
  const exit2 = state.enter("codeFenced");
33093
33201
  let value = tracker.move(sequence);
33094
33202
  if (node2.lang) {
@@ -33128,13 +33236,13 @@ function map(line, _2, blank) {
33128
33236
  return (blank ? "" : " ") + line;
33129
33237
  }
33130
33238
  function checkQuote(state) {
33131
- const marker2 = state.options.quote || '"';
33132
- if (marker2 !== '"' && marker2 !== "'") {
33239
+ const marker = state.options.quote || '"';
33240
+ if (marker !== '"' && marker !== "'") {
33133
33241
  throw new Error(
33134
- "Cannot serialize title with `" + marker2 + "` for `options.quote`, expected `\"`, or `'`"
33242
+ "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`"
33135
33243
  );
33136
33244
  }
33137
- return marker2;
33245
+ return marker;
33138
33246
  }
33139
33247
  function definition$1(node2, _2, state, info) {
33140
33248
  const quote = checkQuote(state);
@@ -33191,13 +33299,13 @@ function definition$1(node2, _2, state, info) {
33191
33299
  return value;
33192
33300
  }
33193
33301
  function checkEmphasis(state) {
33194
- const marker2 = state.options.emphasis || "*";
33195
- if (marker2 !== "*" && marker2 !== "_") {
33302
+ const marker = state.options.emphasis || "*";
33303
+ if (marker !== "*" && marker !== "_") {
33196
33304
  throw new Error(
33197
- "Cannot serialize emphasis with `" + marker2 + "` for `options.emphasis`, expected `*`, or `_`"
33305
+ "Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`"
33198
33306
  );
33199
33307
  }
33200
- return marker2;
33308
+ return marker;
33201
33309
  }
33202
33310
  function encodeCharacterReference(code2) {
33203
33311
  return "&#x" + code2.toString(16).toUpperCase() + ";";
@@ -33210,7 +33318,7 @@ function classifyCharacter(code2) {
33210
33318
  return 2;
33211
33319
  }
33212
33320
  }
33213
- function encodeInfo(outside, inside, marker2) {
33321
+ function encodeInfo(outside, inside, marker) {
33214
33322
  const outsideKind = classifyCharacter(outside);
33215
33323
  const insideKind = classifyCharacter(inside);
33216
33324
  if (outsideKind === void 0) {
@@ -33218,7 +33326,7 @@ function encodeInfo(outside, inside, marker2) {
33218
33326
  // Letter inside:
33219
33327
  // we have to encode *both* letters for `_` as it is looser.
33220
33328
  // it already forms for `*` (and GFMs `~`).
33221
- marker2 === "_" ? { inside: true, outside: true } : { inside: false, outside: false }
33329
+ marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false }
33222
33330
  ) : insideKind === 1 ? (
33223
33331
  // Whitespace inside: encode both (letter, whitespace).
33224
33332
  { inside: true, outside: true }
@@ -33252,13 +33360,13 @@ function encodeInfo(outside, inside, marker2) {
33252
33360
  }
33253
33361
  emphasis$1.peek = emphasisPeek;
33254
33362
  function emphasis$1(node2, _2, state, info) {
33255
- const marker2 = checkEmphasis(state);
33363
+ const marker = checkEmphasis(state);
33256
33364
  const exit2 = state.enter("emphasis");
33257
33365
  const tracker = state.createTracker(info);
33258
- const before = tracker.move(marker2);
33366
+ const before = tracker.move(marker);
33259
33367
  let between = tracker.move(
33260
33368
  state.containerPhrasing(node2, {
33261
- after: marker2,
33369
+ after: marker,
33262
33370
  before,
33263
33371
  ...tracker.current()
33264
33372
  })
@@ -33267,17 +33375,17 @@ function emphasis$1(node2, _2, state, info) {
33267
33375
  const open2 = encodeInfo(
33268
33376
  info.before.charCodeAt(info.before.length - 1),
33269
33377
  betweenHead,
33270
- marker2
33378
+ marker
33271
33379
  );
33272
33380
  if (open2.inside) {
33273
33381
  between = encodeCharacterReference(betweenHead) + between.slice(1);
33274
33382
  }
33275
33383
  const betweenTail = between.charCodeAt(between.length - 1);
33276
- const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker2);
33384
+ const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
33277
33385
  if (close.inside) {
33278
33386
  between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
33279
33387
  }
33280
- const after = tracker.move(marker2);
33388
+ const after = tracker.move(marker);
33281
33389
  exit2();
33282
33390
  state.attentionEncodeSurroundingInfo = {
33283
33391
  after: close.outside,
@@ -33325,7 +33433,7 @@ function node(value) {
33325
33433
  }
33326
33434
  function formatHeadingAsSetext(node2, state) {
33327
33435
  let literalWithBreak = false;
33328
- visit(node2, function(node3) {
33436
+ visit$1(node2, function(node3) {
33329
33437
  if ("value" in node3 && /\r?\n|\r/.test(node3.value) || node3.type === "break") {
33330
33438
  literalWithBreak = true;
33331
33439
  return EXIT$1;
@@ -33632,13 +33740,13 @@ function linkReferencePeek() {
33632
33740
  return "[";
33633
33741
  }
33634
33742
  function checkBullet(state) {
33635
- const marker2 = state.options.bullet || "*";
33636
- if (marker2 !== "*" && marker2 !== "+" && marker2 !== "-") {
33743
+ const marker = state.options.bullet || "*";
33744
+ if (marker !== "*" && marker !== "+" && marker !== "-") {
33637
33745
  throw new Error(
33638
- "Cannot serialize items with `" + marker2 + "` for `options.bullet`, expected `*`, `+`, or `-`"
33746
+ "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`"
33639
33747
  );
33640
33748
  }
33641
- return marker2;
33749
+ return marker;
33642
33750
  }
33643
33751
  function checkBulletOther(state) {
33644
33752
  const bullet = checkBullet(state);
@@ -33659,22 +33767,22 @@ function checkBulletOther(state) {
33659
33767
  return bulletOther;
33660
33768
  }
33661
33769
  function checkBulletOrdered(state) {
33662
- const marker2 = state.options.bulletOrdered || ".";
33663
- if (marker2 !== "." && marker2 !== ")") {
33770
+ const marker = state.options.bulletOrdered || ".";
33771
+ if (marker !== "." && marker !== ")") {
33664
33772
  throw new Error(
33665
- "Cannot serialize items with `" + marker2 + "` for `options.bulletOrdered`, expected `.` or `)`"
33773
+ "Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`"
33666
33774
  );
33667
33775
  }
33668
- return marker2;
33776
+ return marker;
33669
33777
  }
33670
33778
  function checkRule(state) {
33671
- const marker2 = state.options.rule || "*";
33672
- if (marker2 !== "*" && marker2 !== "-" && marker2 !== "_") {
33779
+ const marker = state.options.rule || "*";
33780
+ if (marker !== "*" && marker !== "-" && marker !== "_") {
33673
33781
  throw new Error(
33674
- "Cannot serialize rules with `" + marker2 + "` for `options.rule`, expected `*`, `-`, or `_`"
33782
+ "Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`"
33675
33783
  );
33676
33784
  }
33677
- return marker2;
33785
+ return marker;
33678
33786
  }
33679
33787
  function list$2(node2, parent, state, info) {
33680
33788
  const exit2 = state.enter("list");
@@ -33792,23 +33900,23 @@ function root$2(node2, _2, state, info) {
33792
33900
  return container.call(state, node2, info);
33793
33901
  }
33794
33902
  function checkStrong(state) {
33795
- const marker2 = state.options.strong || "*";
33796
- if (marker2 !== "*" && marker2 !== "_") {
33903
+ const marker = state.options.strong || "*";
33904
+ if (marker !== "*" && marker !== "_") {
33797
33905
  throw new Error(
33798
- "Cannot serialize strong with `" + marker2 + "` for `options.strong`, expected `*`, or `_`"
33906
+ "Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`"
33799
33907
  );
33800
33908
  }
33801
- return marker2;
33909
+ return marker;
33802
33910
  }
33803
33911
  strong$1.peek = strongPeek;
33804
33912
  function strong$1(node2, _2, state, info) {
33805
- const marker2 = checkStrong(state);
33913
+ const marker = checkStrong(state);
33806
33914
  const exit2 = state.enter("strong");
33807
33915
  const tracker = state.createTracker(info);
33808
- const before = tracker.move(marker2 + marker2);
33916
+ const before = tracker.move(marker + marker);
33809
33917
  let between = tracker.move(
33810
33918
  state.containerPhrasing(node2, {
33811
- after: marker2,
33919
+ after: marker,
33812
33920
  before,
33813
33921
  ...tracker.current()
33814
33922
  })
@@ -33817,17 +33925,17 @@ function strong$1(node2, _2, state, info) {
33817
33925
  const open2 = encodeInfo(
33818
33926
  info.before.charCodeAt(info.before.length - 1),
33819
33927
  betweenHead,
33820
- marker2
33928
+ marker
33821
33929
  );
33822
33930
  if (open2.inside) {
33823
33931
  between = encodeCharacterReference(betweenHead) + between.slice(1);
33824
33932
  }
33825
33933
  const betweenTail = between.charCodeAt(between.length - 1);
33826
- const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker2);
33934
+ const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
33827
33935
  if (close.inside) {
33828
33936
  between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
33829
33937
  }
33830
- const after = tracker.move(marker2 + marker2);
33938
+ const after = tracker.move(marker + marker);
33831
33939
  exit2();
33832
33940
  state.attentionEncodeSurroundingInfo = {
33833
33941
  after: close.outside,
@@ -33981,10 +34089,10 @@ function replace($0, $1) {
33981
34089
  }
33982
34090
  function gfmTableToMarkdown(options) {
33983
34091
  const settings = options || {};
33984
- const padding2 = settings.tableCellPadding;
34092
+ const padding = settings.tableCellPadding;
33985
34093
  const alignDelimiters = settings.tablePipeAlign;
33986
34094
  const stringLength = settings.stringLength;
33987
- const around = padding2 ? " " : "|";
34095
+ const around = padding ? " " : "|";
33988
34096
  return {
33989
34097
  unsafe: [
33990
34098
  { character: "\r", inConstruct: "tableCell" },
@@ -34037,7 +34145,7 @@ function gfmTableToMarkdown(options) {
34037
34145
  // @ts-expect-error: `markdown-table` types should support `null`.
34038
34146
  alignDelimiters,
34039
34147
  // @ts-expect-error: `markdown-table` types should support `null`.
34040
- padding: padding2,
34148
+ padding,
34041
34149
  // @ts-expect-error: `markdown-table` types should support `null`.
34042
34150
  stringLength
34043
34151
  });
@@ -34724,15 +34832,15 @@ function tokenizeAttention(effects, ok2) {
34724
34832
  const attentionMarkers2 = this.parser.constructs.attentionMarkers.null;
34725
34833
  const previous2 = this.previous;
34726
34834
  const before = classifyCharacter(previous2);
34727
- let marker2;
34835
+ let marker;
34728
34836
  return start;
34729
34837
  function start(code2) {
34730
- marker2 = code2;
34838
+ marker = code2;
34731
34839
  effects.enter("attentionSequence");
34732
34840
  return inside(code2);
34733
34841
  }
34734
34842
  function inside(code2) {
34735
- if (code2 === marker2) {
34843
+ if (code2 === marker) {
34736
34844
  effects.consume(code2);
34737
34845
  return inside;
34738
34846
  }
@@ -34740,8 +34848,8 @@ function tokenizeAttention(effects, ok2) {
34740
34848
  const after = classifyCharacter(code2);
34741
34849
  const open2 = !after || after === 2 && before || attentionMarkers2.includes(code2);
34742
34850
  const close = !before || before === 2 && after || attentionMarkers2.includes(previous2);
34743
- token._open = Boolean(marker2 === 42 ? open2 : open2 && (before || !close));
34744
- token._close = Boolean(marker2 === 42 ? close : close && (after || !open2));
34851
+ token._open = Boolean(marker === 42 ? open2 : open2 && (before || !close));
34852
+ token._close = Boolean(marker === 42 ? close : close && (after || !open2));
34745
34853
  return ok2(code2);
34746
34854
  }
34747
34855
  }
@@ -35042,7 +35150,7 @@ function tokenizeCodeFenced(effects, ok2, nok) {
35042
35150
  };
35043
35151
  let initialPrefix = 0;
35044
35152
  let sizeOpen = 0;
35045
- let marker2;
35153
+ let marker;
35046
35154
  return start;
35047
35155
  function start(code2) {
35048
35156
  return beforeSequenceOpen(code2);
@@ -35050,14 +35158,14 @@ function tokenizeCodeFenced(effects, ok2, nok) {
35050
35158
  function beforeSequenceOpen(code2) {
35051
35159
  const tail = self2.events[self2.events.length - 1];
35052
35160
  initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
35053
- marker2 = code2;
35161
+ marker = code2;
35054
35162
  effects.enter("codeFenced");
35055
35163
  effects.enter("codeFencedFence");
35056
35164
  effects.enter("codeFencedFenceSequence");
35057
35165
  return sequenceOpen(code2);
35058
35166
  }
35059
35167
  function sequenceOpen(code2) {
35060
- if (code2 === marker2) {
35168
+ if (code2 === marker) {
35061
35169
  sizeOpen++;
35062
35170
  effects.consume(code2);
35063
35171
  return sequenceOpen;
@@ -35090,7 +35198,7 @@ function tokenizeCodeFenced(effects, ok2, nok) {
35090
35198
  effects.exit("codeFencedFenceInfo");
35091
35199
  return factorySpace(effects, metaBefore, "whitespace")(code2);
35092
35200
  }
35093
- if (code2 === 96 && code2 === marker2) {
35201
+ if (code2 === 96 && code2 === marker) {
35094
35202
  return nok(code2);
35095
35203
  }
35096
35204
  effects.consume(code2);
@@ -35112,7 +35220,7 @@ function tokenizeCodeFenced(effects, ok2, nok) {
35112
35220
  effects.exit("codeFencedFenceMeta");
35113
35221
  return infoBefore(code2);
35114
35222
  }
35115
- if (code2 === 96 && code2 === marker2) {
35223
+ if (code2 === 96 && code2 === marker) {
35116
35224
  return nok(code2);
35117
35225
  }
35118
35226
  effects.consume(code2);
@@ -35163,14 +35271,14 @@ function tokenizeCodeFenced(effects, ok2, nok) {
35163
35271
  return markdownSpace(code2) ? factorySpace(effects2, beforeSequenceClose, "linePrefix", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2) : beforeSequenceClose(code2);
35164
35272
  }
35165
35273
  function beforeSequenceClose(code2) {
35166
- if (code2 === marker2) {
35274
+ if (code2 === marker) {
35167
35275
  effects2.enter("codeFencedFenceSequence");
35168
35276
  return sequenceClose(code2);
35169
35277
  }
35170
35278
  return nok2(code2);
35171
35279
  }
35172
35280
  function sequenceClose(code2) {
35173
- if (code2 === marker2) {
35281
+ if (code2 === marker) {
35174
35282
  size2++;
35175
35283
  effects2.consume(code2);
35176
35284
  return sequenceClose;
@@ -35941,7 +36049,7 @@ function factoryLabel(effects, ok2, nok, type, markerType, stringType) {
35941
36049
  }
35942
36050
  }
35943
36051
  function factoryTitle(effects, ok2, nok, type, markerType, stringType) {
35944
- let marker2;
36052
+ let marker;
35945
36053
  return start;
35946
36054
  function start(code2) {
35947
36055
  if (code2 === 34 || code2 === 39 || code2 === 40) {
@@ -35949,13 +36057,13 @@ function factoryTitle(effects, ok2, nok, type, markerType, stringType) {
35949
36057
  effects.enter(markerType);
35950
36058
  effects.consume(code2);
35951
36059
  effects.exit(markerType);
35952
- marker2 = code2 === 40 ? 41 : code2;
36060
+ marker = code2 === 40 ? 41 : code2;
35953
36061
  return begin;
35954
36062
  }
35955
36063
  return nok(code2);
35956
36064
  }
35957
36065
  function begin(code2) {
35958
- if (code2 === marker2) {
36066
+ if (code2 === marker) {
35959
36067
  effects.enter(markerType);
35960
36068
  effects.consume(code2);
35961
36069
  effects.exit(markerType);
@@ -35966,9 +36074,9 @@ function factoryTitle(effects, ok2, nok, type, markerType, stringType) {
35966
36074
  return atBreak(code2);
35967
36075
  }
35968
36076
  function atBreak(code2) {
35969
- if (code2 === marker2) {
36077
+ if (code2 === marker) {
35970
36078
  effects.exit(stringType);
35971
- return begin(marker2);
36079
+ return begin(marker);
35972
36080
  }
35973
36081
  if (code2 === null) {
35974
36082
  return nok(code2);
@@ -35985,7 +36093,7 @@ function factoryTitle(effects, ok2, nok, type, markerType, stringType) {
35985
36093
  return inside(code2);
35986
36094
  }
35987
36095
  function inside(code2) {
35988
- if (code2 === marker2 || code2 === null || markdownLineEnding(code2)) {
36096
+ if (code2 === marker || code2 === null || markdownLineEnding(code2)) {
35989
36097
  effects.exit("chunkString");
35990
36098
  return atBreak(code2);
35991
36099
  }
@@ -35993,7 +36101,7 @@ function factoryTitle(effects, ok2, nok, type, markerType, stringType) {
35993
36101
  return code2 === 92 ? escape : inside;
35994
36102
  }
35995
36103
  function escape(code2) {
35996
- if (code2 === marker2 || code2 === 92) {
36104
+ if (code2 === marker || code2 === 92) {
35997
36105
  effects.consume(code2);
35998
36106
  return inside;
35999
36107
  }
@@ -36304,7 +36412,7 @@ function resolveToHtmlFlow(events) {
36304
36412
  }
36305
36413
  function tokenizeHtmlFlow(effects, ok2, nok) {
36306
36414
  const self2 = this;
36307
- let marker2;
36415
+ let marker;
36308
36416
  let closingTag;
36309
36417
  let buffer2;
36310
36418
  let index2;
@@ -36331,7 +36439,7 @@ function tokenizeHtmlFlow(effects, ok2, nok) {
36331
36439
  }
36332
36440
  if (code2 === 63) {
36333
36441
  effects.consume(code2);
36334
- marker2 = 3;
36442
+ marker = 3;
36335
36443
  return self2.interrupt ? ok2 : continuationDeclarationInside;
36336
36444
  }
36337
36445
  if (asciiAlpha(code2)) {
@@ -36344,18 +36452,18 @@ function tokenizeHtmlFlow(effects, ok2, nok) {
36344
36452
  function declarationOpen(code2) {
36345
36453
  if (code2 === 45) {
36346
36454
  effects.consume(code2);
36347
- marker2 = 2;
36455
+ marker = 2;
36348
36456
  return commentOpenInside;
36349
36457
  }
36350
36458
  if (code2 === 91) {
36351
36459
  effects.consume(code2);
36352
- marker2 = 5;
36460
+ marker = 5;
36353
36461
  index2 = 0;
36354
36462
  return cdataOpenInside;
36355
36463
  }
36356
36464
  if (asciiAlpha(code2)) {
36357
36465
  effects.consume(code2);
36358
- marker2 = 4;
36466
+ marker = 4;
36359
36467
  return self2.interrupt ? ok2 : continuationDeclarationInside;
36360
36468
  }
36361
36469
  return nok(code2);
@@ -36391,18 +36499,18 @@ function tokenizeHtmlFlow(effects, ok2, nok) {
36391
36499
  const slash = code2 === 47;
36392
36500
  const name2 = buffer2.toLowerCase();
36393
36501
  if (!slash && !closingTag && htmlRawNames.includes(name2)) {
36394
- marker2 = 1;
36502
+ marker = 1;
36395
36503
  return self2.interrupt ? ok2(code2) : continuation(code2);
36396
36504
  }
36397
36505
  if (htmlBlockNames.includes(buffer2.toLowerCase())) {
36398
- marker2 = 6;
36506
+ marker = 6;
36399
36507
  if (slash) {
36400
36508
  effects.consume(code2);
36401
36509
  return basicSelfClosing;
36402
36510
  }
36403
36511
  return self2.interrupt ? ok2(code2) : continuation(code2);
36404
36512
  }
36405
- marker2 = 7;
36513
+ marker = 7;
36406
36514
  return self2.interrupt && !self2.parser.lazy[self2.now().line] ? nok(code2) : closingTag ? completeClosingTagAfter(code2) : completeAttributeNameBefore(code2);
36407
36515
  }
36408
36516
  if (code2 === 45 || asciiAlphanumeric(code2)) {
@@ -36517,27 +36625,27 @@ function tokenizeHtmlFlow(effects, ok2, nok) {
36517
36625
  return nok(code2);
36518
36626
  }
36519
36627
  function continuation(code2) {
36520
- if (code2 === 45 && marker2 === 2) {
36628
+ if (code2 === 45 && marker === 2) {
36521
36629
  effects.consume(code2);
36522
36630
  return continuationCommentInside;
36523
36631
  }
36524
- if (code2 === 60 && marker2 === 1) {
36632
+ if (code2 === 60 && marker === 1) {
36525
36633
  effects.consume(code2);
36526
36634
  return continuationRawTagOpen;
36527
36635
  }
36528
- if (code2 === 62 && marker2 === 4) {
36636
+ if (code2 === 62 && marker === 4) {
36529
36637
  effects.consume(code2);
36530
36638
  return continuationClose;
36531
36639
  }
36532
- if (code2 === 63 && marker2 === 3) {
36640
+ if (code2 === 63 && marker === 3) {
36533
36641
  effects.consume(code2);
36534
36642
  return continuationDeclarationInside;
36535
36643
  }
36536
- if (code2 === 93 && marker2 === 5) {
36644
+ if (code2 === 93 && marker === 5) {
36537
36645
  effects.consume(code2);
36538
36646
  return continuationCdataInside;
36539
36647
  }
36540
- if (markdownLineEnding(code2) && (marker2 === 6 || marker2 === 7)) {
36648
+ if (markdownLineEnding(code2) && (marker === 6 || marker === 7)) {
36541
36649
  effects.exit("htmlFlowData");
36542
36650
  return effects.check(blankLineBefore, continuationAfter, continuationStart)(code2);
36543
36651
  }
@@ -36607,7 +36715,7 @@ function tokenizeHtmlFlow(effects, ok2, nok) {
36607
36715
  effects.consume(code2);
36608
36716
  return continuationClose;
36609
36717
  }
36610
- if (code2 === 45 && marker2 === 2) {
36718
+ if (code2 === 45 && marker === 2) {
36611
36719
  effects.consume(code2);
36612
36720
  return continuationDeclarationInside;
36613
36721
  }
@@ -36657,7 +36765,7 @@ const htmlText = {
36657
36765
  };
36658
36766
  function tokenizeHtmlText(effects, ok2, nok) {
36659
36767
  const self2 = this;
36660
- let marker2;
36768
+ let marker;
36661
36769
  let index2;
36662
36770
  let returnState;
36663
36771
  return start;
@@ -36885,7 +36993,7 @@ function tokenizeHtmlText(effects, ok2, nok) {
36885
36993
  }
36886
36994
  if (code2 === 34 || code2 === 39) {
36887
36995
  effects.consume(code2);
36888
- marker2 = code2;
36996
+ marker = code2;
36889
36997
  return tagOpenAttributeValueQuoted;
36890
36998
  }
36891
36999
  if (markdownLineEnding(code2)) {
@@ -36900,9 +37008,9 @@ function tokenizeHtmlText(effects, ok2, nok) {
36900
37008
  return tagOpenAttributeValueUnquoted;
36901
37009
  }
36902
37010
  function tagOpenAttributeValueQuoted(code2) {
36903
- if (code2 === marker2) {
37011
+ if (code2 === marker) {
36904
37012
  effects.consume(code2);
36905
- marker2 = void 0;
37013
+ marker = void 0;
36906
37014
  return tagOpenAttributeValueQuotedAfter;
36907
37015
  }
36908
37016
  if (code2 === null) {
@@ -37247,18 +37355,18 @@ const thematicBreak$1 = {
37247
37355
  };
37248
37356
  function tokenizeThematicBreak(effects, ok2, nok) {
37249
37357
  let size2 = 0;
37250
- let marker2;
37358
+ let marker;
37251
37359
  return start;
37252
37360
  function start(code2) {
37253
37361
  effects.enter("thematicBreak");
37254
37362
  return before(code2);
37255
37363
  }
37256
37364
  function before(code2) {
37257
- marker2 = code2;
37365
+ marker = code2;
37258
37366
  return atBreak(code2);
37259
37367
  }
37260
37368
  function atBreak(code2) {
37261
- if (code2 === marker2) {
37369
+ if (code2 === marker) {
37262
37370
  effects.enter("thematicBreakSequence");
37263
37371
  return sequence(code2);
37264
37372
  }
@@ -37269,7 +37377,7 @@ function tokenizeThematicBreak(effects, ok2, nok) {
37269
37377
  return nok(code2);
37270
37378
  }
37271
37379
  function sequence(code2) {
37272
- if (code2 === marker2) {
37380
+ if (code2 === marker) {
37273
37381
  effects.consume(code2);
37274
37382
  size2++;
37275
37383
  return sequence;
@@ -37458,7 +37566,7 @@ function resolveToSetextUnderline(events, context) {
37458
37566
  }
37459
37567
  function tokenizeSetextUnderline(effects, ok2, nok) {
37460
37568
  const self2 = this;
37461
- let marker2;
37569
+ let marker;
37462
37570
  return start;
37463
37571
  function start(code2) {
37464
37572
  let index2 = self2.events.length;
@@ -37471,7 +37579,7 @@ function tokenizeSetextUnderline(effects, ok2, nok) {
37471
37579
  }
37472
37580
  if (!self2.parser.lazy[self2.now().line] && (self2.interrupt || paragraph2)) {
37473
37581
  effects.enter("setextHeadingLine");
37474
- marker2 = code2;
37582
+ marker = code2;
37475
37583
  return before(code2);
37476
37584
  }
37477
37585
  return nok(code2);
@@ -37481,7 +37589,7 @@ function tokenizeSetextUnderline(effects, ok2, nok) {
37481
37589
  return inside(code2);
37482
37590
  }
37483
37591
  function inside(code2) {
37484
- if (code2 === marker2) {
37592
+ if (code2 === marker) {
37485
37593
  effects.consume(code2);
37486
37594
  return inside;
37487
37595
  }
@@ -37574,17 +37682,17 @@ function resolveToPotentialGfmFootnoteCall(events, context) {
37574
37682
  start: Object.assign({}, events[index2 + 3][1].start),
37575
37683
  end: Object.assign({}, events[events.length - 1][1].end)
37576
37684
  };
37577
- const marker2 = {
37685
+ const marker = {
37578
37686
  type: "gfmFootnoteCallMarker",
37579
37687
  start: Object.assign({}, events[index2 + 3][1].end),
37580
37688
  end: Object.assign({}, events[index2 + 3][1].end)
37581
37689
  };
37582
- marker2.end.column++;
37583
- marker2.end.offset++;
37584
- marker2.end._bufferIndex++;
37690
+ marker.end.column++;
37691
+ marker.end.offset++;
37692
+ marker.end._bufferIndex++;
37585
37693
  const string2 = {
37586
37694
  type: "gfmFootnoteCallString",
37587
- start: Object.assign({}, marker2.end),
37695
+ start: Object.assign({}, marker.end),
37588
37696
  end: Object.assign({}, events[events.length - 1][1].start)
37589
37697
  };
37590
37698
  const chunk = {
@@ -37602,8 +37710,8 @@ function resolveToPotentialGfmFootnoteCall(events, context) {
37602
37710
  events[index2 + 3],
37603
37711
  events[index2 + 4],
37604
37712
  // The `^`.
37605
- ["enter", marker2, context],
37606
- ["exit", marker2, context],
37713
+ ["enter", marker, context],
37714
+ ["exit", marker, context],
37607
37715
  // Everything in between.
37608
37716
  ["enter", string2, context],
37609
37717
  ["enter", chunk, context],
@@ -38839,9 +38947,9 @@ function name(name2, options) {
38839
38947
  }
38840
38948
  const re$2 = /[ \t\n\f\r]/g;
38841
38949
  function whitespace(thing) {
38842
- return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
38950
+ return typeof thing === "object" ? thing.type === "text" ? empty$1(thing.value) : false : empty$1(thing);
38843
38951
  }
38844
- function empty(value) {
38952
+ function empty$1(value) {
38845
38953
  return value.replace(re$2, "") === "";
38846
38954
  }
38847
38955
  var cjs$1 = {};
@@ -41866,7 +41974,7 @@ function createState(tree, options) {
41866
41974
  patch,
41867
41975
  wrap: wrap$1
41868
41976
  };
41869
- visit(tree, function(node2) {
41977
+ visit$1(tree, function(node2) {
41870
41978
  if (node2.type === "definition" || node2.type === "footnoteDefinition") {
41871
41979
  const map2 = node2.type === "definition" ? definitionById : footnoteById;
41872
41980
  const id = String(node2.identifier).toUpperCase();
@@ -43568,6 +43676,104 @@ function isUint8Array(value) {
43568
43676
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
43569
43677
  );
43570
43678
  }
43679
+ function color(d2) {
43680
+ return d2;
43681
+ }
43682
+ const empty = [];
43683
+ const CONTINUE = true;
43684
+ const EXIT = false;
43685
+ const SKIP = "skip";
43686
+ function visitParents(tree, test, visitor, reverse) {
43687
+ let check;
43688
+ if (typeof test === "function" && typeof visitor !== "function") {
43689
+ reverse = visitor;
43690
+ visitor = test;
43691
+ } else {
43692
+ check = test;
43693
+ }
43694
+ const is = convert(check);
43695
+ const step = reverse ? -1 : 1;
43696
+ factory(tree, void 0, [])();
43697
+ function factory(node2, index2, parents) {
43698
+ const value = (
43699
+ /** @type {Record<string, unknown>} */
43700
+ node2 && typeof node2 === "object" ? node2 : {}
43701
+ );
43702
+ if (typeof value.type === "string") {
43703
+ const name2 = (
43704
+ // `hast`
43705
+ typeof value.tagName === "string" ? value.tagName : (
43706
+ // `xast`
43707
+ typeof value.name === "string" ? value.name : void 0
43708
+ )
43709
+ );
43710
+ Object.defineProperty(visit2, "name", {
43711
+ value: "node (" + color(node2.type + (name2 ? "<" + name2 + ">" : "")) + ")"
43712
+ });
43713
+ }
43714
+ return visit2;
43715
+ function visit2() {
43716
+ let result = empty;
43717
+ let subresult;
43718
+ let offset2;
43719
+ let grandparents;
43720
+ if (!test || is(node2, index2, parents[parents.length - 1] || void 0)) {
43721
+ result = toResult(visitor(node2, parents));
43722
+ if (result[0] === EXIT) {
43723
+ return result;
43724
+ }
43725
+ }
43726
+ if ("children" in node2 && node2.children) {
43727
+ const nodeAsParent = (
43728
+ /** @type {UnistParent} */
43729
+ node2
43730
+ );
43731
+ if (nodeAsParent.children && result[0] !== SKIP) {
43732
+ offset2 = (reverse ? nodeAsParent.children.length : -1) + step;
43733
+ grandparents = parents.concat(nodeAsParent);
43734
+ while (offset2 > -1 && offset2 < nodeAsParent.children.length) {
43735
+ const child = nodeAsParent.children[offset2];
43736
+ subresult = factory(child, offset2, grandparents)();
43737
+ if (subresult[0] === EXIT) {
43738
+ return subresult;
43739
+ }
43740
+ offset2 = typeof subresult[1] === "number" ? subresult[1] : offset2 + step;
43741
+ }
43742
+ }
43743
+ }
43744
+ return result;
43745
+ }
43746
+ }
43747
+ }
43748
+ function toResult(value) {
43749
+ if (Array.isArray(value)) {
43750
+ return value;
43751
+ }
43752
+ if (typeof value === "number") {
43753
+ return [CONTINUE, value];
43754
+ }
43755
+ return value === null || value === void 0 ? empty : [value];
43756
+ }
43757
+ function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
43758
+ let reverse;
43759
+ let test;
43760
+ let visitor;
43761
+ if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
43762
+ test = void 0;
43763
+ visitor = testOrVisitor;
43764
+ reverse = visitorOrReverse;
43765
+ } else {
43766
+ test = testOrVisitor;
43767
+ visitor = visitorOrReverse;
43768
+ reverse = maybeReverse;
43769
+ }
43770
+ visitParents(tree, test, overload, reverse);
43771
+ function overload(node2, parents) {
43772
+ const parent = parents[parents.length - 1];
43773
+ const index2 = parent ? parent.children.indexOf(node2) : void 0;
43774
+ return visitor(node2, index2, parent);
43775
+ }
43776
+ }
43571
43777
  function M() {
43572
43778
  return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
43573
43779
  }
@@ -44768,7 +44974,7 @@ var Ye = /\s/, qo = /^\s+$/, _o = /* @__PURE__ */ new Set(["code", "pre", "svg",
44768
44974
  }, Uo = (e, t, o, n) => ({ type: "element", tagName: "span", properties: { "data-sd-animate": true, style: `--sd-animation:sd-${t};--sd-duration:${o}ms;--sd-easing:${n}` }, children: [{ type: "text", value: e }] }), Xo = (e, t, o) => {
44769
44975
  let n = t.at(-1);
44770
44976
  if (!(n && "children" in n)) return;
44771
- if (Wo(t)) return SKIP;
44977
+ if (Wo(t)) return SKIP$1;
44772
44978
  let s2 = n, r2 = s2.children.indexOf(e);
44773
44979
  if (r2 === -1) return;
44774
44980
  let i = e.value;
@@ -44780,7 +44986,7 @@ function Q(e) {
44780
44986
  var n, s2, r2, i;
44781
44987
  let t = { animation: (n = e == null ? void 0 : e.animation) != null ? n : "fadeIn", duration: (s2 = e == null ? void 0 : e.duration) != null ? s2 : 150, easing: (r2 = e == null ? void 0 : e.easing) != null ? r2 : "ease", sep: (i = e == null ? void 0 : e.sep) != null ? i : "word" };
44782
44988
  return { name: "animate", type: "animate", rehypePlugin: () => (c) => {
44783
- visitParents(c, "text", (a2, l) => Xo(a2, l, t));
44989
+ visitParents$1(c, "text", (a2, l) => Xo(a2, l, t));
44784
44990
  } };
44785
44991
  }
44786
44992
  Q();
@@ -44813,7 +45019,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
44813
45019
  var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
44814
45020
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
44815
45021
  var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
44816
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-CRgNr0YA.js"), true ? __vite__mapDeps([2,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
45022
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-DMawUm9n.js"), true ? __vite__mapDeps([2,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
44817
45023
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
44818
45024
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
44819
45025
  return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
@@ -45592,1245 +45798,18 @@ function useSidebarData() {
45592
45798
  function useSidebarDataOptional() {
45593
45799
  return reactExports.useContext(SidebarDataContext);
45594
45800
  }
45595
- const MAP_HEIGHT = 56;
45596
- const TIMELINE_PADDING = 8;
45597
- const ROW_PADDING = 2;
45598
- const ROW_HEIGHT = 24;
45599
- const MARKER_HEIGHT = 24;
45600
- const initialState = {
45601
- root: {
45602
- startTime: 0,
45603
- endTime: 1,
45604
- duration: 1,
45605
- depth: 0,
45606
- children: []
45607
- },
45608
- spanMap: {},
45609
- resourceMap: {},
45610
- filter: "",
45611
- selected: null,
45612
- baseScale: 1,
45613
- scaleRatio: 1,
45614
- scale: 1,
45615
- width: 640,
45616
- height: 480,
45617
- timelineWidth: 640,
45618
- timelineHeight: 480,
45619
- panelWidth: 380,
45620
- panelHeight: 480,
45621
- scrollbarWidth: 0,
45622
- timelineRef: { current: null },
45623
- scrollSnapshotRef: { current: void 0 },
45624
- memoCacheRef: { current: /* @__PURE__ */ new Map() },
45625
- getQuickLinks: () => [],
45626
- withPanel: false,
45627
- isMobile: false
45628
- };
45629
- const TraceViewerContext = reactExports.createContext({
45630
- state: initialState,
45631
- dispatch: () => {
45632
- }
45633
- });
45634
- TraceViewerContext.displayName = "TraceViewerContext";
45635
- const useTraceViewer = () => reactExports.useContext(TraceViewerContext);
45636
- reactExports.createContext(null);
45637
- const traceNode = "_traceNode_1ytrx_1";
45638
- const childRow = "_childRow_1ytrx_5";
45639
- const spanNode = "_spanNode_1ytrx_11";
45640
- const huge = "_huge_1ytrx_31";
45641
- const spanName = "_spanName_1ytrx_34";
45642
- const spanSpacer = "_spanSpacer_1ytrx_40";
45643
- const spanDuration = "_spanDuration_1ytrx_44";
45644
- const small = "_small_1ytrx_62";
45645
- const xHover = "_xHover_1ytrx_62";
45646
- const spanNodeEvent = "_spanNodeEvent_1ytrx_118";
45647
- const eventDiamond = "_eventDiamond_1ytrx_124";
45648
- const customEventColor = "_customEventColor_1ytrx_140";
45649
- const hoverInfo = "_hoverInfo_1ytrx_145";
45650
- const eventName = "_eventName_1ytrx_149";
45651
- const eventTimestamp = "_eventTimestamp_1ytrx_153";
45652
- const alignStart = "_alignStart_1ytrx_174";
45653
- const alignEnd = "_alignEnd_1ytrx_178";
45654
- const colorVercel = "_colorVercel_1ytrx_205";
45655
- const color0 = "_color0_1ytrx_213";
45656
- const color1 = "_color1_1ytrx_220";
45657
- const color2 = "_color2_1ytrx_227";
45658
- const color3 = "_color3_1ytrx_234";
45659
- const color4 = "_color4_1ytrx_241";
45660
- const colorHighlight = "_colorHighlight_1ytrx_248";
45661
- const unlit = "_unlit_1ytrx_256";
45662
- const mapContainer = "_mapContainer_1ytrx_262";
45663
- const spanDetailPanel = "_spanDetailPanel_1ytrx_329";
45664
- const spanDetailPanelResizer = "_spanDetailPanelResizer_1ytrx_338";
45665
- const spanDetailPanelTop = "_spanDetailPanelTop_1ytrx_353";
45666
- const spanDetailPanelBody = "_spanDetailPanelBody_1ytrx_362";
45667
- const spanDetailPanelTopInfo = "_spanDetailPanelTopInfo_1ytrx_375";
45668
- const spanNameDetailPanel = "_spanNameDetailPanel_1ytrx_389";
45669
- const spanDetailPanelTruncatedHeading = "_spanDetailPanelTruncatedHeading_1ytrx_395";
45670
- const spanDetailPanelName = "_spanDetailPanelName_1ytrx_405";
45671
- const spanDetailPanelDuration = "_spanDetailPanelDuration_1ytrx_416";
45672
- const spanDetailPanelCorner = "_spanDetailPanelCorner_1ytrx_427";
45673
- const spanDetailPanelCornerInner = "_spanDetailPanelCornerInner_1ytrx_437";
45674
- const spanDetailPanelCloseVerticalRule = "_spanDetailPanelCloseVerticalRule_1ytrx_445";
45675
- const spanDetailPanelClose = "_spanDetailPanelClose_1ytrx_445";
45676
- const spanDetailPanelAttribute = "_spanDetailPanelAttribute_1ytrx_467";
45677
- const spanDetailPanelAttributeKey = "_spanDetailPanelAttributeKey_1ytrx_484";
45678
- const spanDetailPanelAttributeValue = "_spanDetailPanelAttributeValue_1ytrx_492";
45679
- const spanDetailPanelQuickLink = "_spanDetailPanelQuickLink_1ytrx_503";
45680
- const spanDetailPanelQuickLinkLabel = "_spanDetailPanelQuickLinkLabel_1ytrx_506";
45681
- const detailGroup = "_detailGroup_1ytrx_519";
45682
- const expanded = "_expanded_1ytrx_533";
45683
- const collapsed = "_collapsed_1ytrx_534";
45684
- const ancestorGroup = "_ancestorGroup_1ytrx_535";
45685
- const detailHeading = "_detailHeading_1ytrx_539";
45686
- const buttonLink = "_buttonLink_1ytrx_562";
45687
- const note = "_note_1ytrx_581";
45688
- const skeleton = "_skeleton_1ytrx_589";
45689
- const skeletonRounded = "_skeletonRounded_1ytrx_595";
45690
- const detailHeadingIcon = "_detailHeadingIcon_1ytrx_599";
45691
- const infraSpanDescription = "_infraSpanDescription_1ytrx_603";
45692
- const ancestorNode = "_ancestorNode_1ytrx_613";
45693
- const ancestorText = "_ancestorText_1ytrx_629";
45694
- const ancestorName = "_ancestorName_1ytrx_639";
45695
- const ancestorDuration = "_ancestorDuration_1ytrx_644";
45696
- const ancestorLineContainer = "_ancestorLineContainer_1ytrx_649";
45697
- const ancestorLine = "_ancestorLine_1ytrx_649";
45698
- const zoomButtonGroup = "_zoomButtonGroup_1ytrx_701";
45699
- const zoomButton = "_zoomButton_1ytrx_701";
45700
- const divider = "_divider_1ytrx_751";
45701
- const markersContainer = "_markersContainer_1ytrx_758";
45702
- const markers = "_markers_1ytrx_758";
45703
- const marker = "_marker_1ytrx_758";
45704
- const notch = "_notch_1ytrx_792";
45705
- const markerLabel = "_markerLabel_1ytrx_798";
45706
- const markerClockTime = "_markerClockTime_1ytrx_807";
45707
- const eventMarkersContainer = "_eventMarkersContainer_1ytrx_816";
45708
- const eventMarkers = "_eventMarkers_1ytrx_816";
45709
- const eventMarker = "_eventMarker_1ytrx_816";
45710
- const cursorMarkerStickyParent = "_cursorMarkerStickyParent_1ytrx_839";
45711
- const cursorMarkerLabelContainer = "_cursorMarkerLabelContainer_1ytrx_848";
45712
- const cursorMarkerLabel = "_cursorMarkerLabel_1ytrx_848";
45713
- const cursorMarkerContainer = "_cursorMarkerContainer_1ytrx_898";
45714
- const cursorMarker = "_cursorMarker_1ytrx_839";
45715
- const cursorSelection = "_cursorSelection_1ytrx_916";
45716
- const traceViewer = "_traceViewer_1ytrx_966";
45717
- const mapCanvas = "_mapCanvas_1ytrx_972";
45718
- const zoomButtonTraceViewer = "_zoomButtonTraceViewer_1ytrx_988";
45719
- const timeline = "_timeline_1ytrx_1011";
45720
- const searchBar = "_searchBar_1ytrx_1019";
45721
- const searchInput = "_searchInput_1ytrx_1031";
45722
- const searchInputLabel = "_searchInputLabel_1ytrx_1038";
45723
- const searchInputPrefix = "_searchInputPrefix_1ytrx_1063";
45724
- const mapThumb = "_mapThumb_1ytrx_1101";
45725
- const spanDetailPanelTraceViewer = "_spanDetailPanelTraceViewer_1ytrx_1115";
45726
- const traceViewerContent = "_traceViewerContent_1ytrx_1134";
45727
- const inert = "_inert_1ytrx_1144";
45728
- const hidden = "_hidden_1ytrx_1180";
45729
- const mobile = "_mobile_1ytrx_1184";
45730
- const spanRunning = "_spanRunning_1ytrx_1194";
45731
- const spanPending = "_spanPending_1ytrx_1195";
45732
- const spanCompleted = "_spanCompleted_1ytrx_1203";
45733
- const spanCancelled = "_spanCancelled_1ytrx_1211";
45734
- const spanFailed = "_spanFailed_1ytrx_1219";
45735
- const spanPendingStriped = "_spanPendingStriped_1ytrx_1228";
45736
- const hasQueuedTime = "_hasQueuedTime_1ytrx_1242";
45737
- const spanSleep = "_spanSleep_1ytrx_1254";
45738
- const spanHook = "_spanHook_1ytrx_1263";
45739
- const segmentLayer = "_segmentLayer_1ytrx_1275";
45740
- const segment = "_segment_1ytrx_1275";
45741
- const segmentLabel = "_segmentLabel_1ytrx_1291";
45742
- const segmentTag = "_segmentTag_1ytrx_1306";
45743
- const segQueued = "_segQueued_1ytrx_1314";
45744
- const segRunning = "_segRunning_1ytrx_1325";
45745
- const segFailed = "_segFailed_1ytrx_1330";
45746
- const segRetrying = "_segRetrying_1ytrx_1335";
45747
- const segSucceeded = "_segSucceeded_1ytrx_1346";
45748
- const segWaiting = "_segWaiting_1ytrx_1351";
45749
- const segSleeping = "_segSleeping_1ytrx_1362";
45750
- const segReceived = "_segReceived_1ytrx_1367";
45751
- const boundaryMarker = "_boundaryMarker_1ytrx_1372";
45752
- const boundaryLine = "_boundaryLine_1ytrx_1373";
45753
- const hasSegments = "_hasSegments_1ytrx_1395";
45754
- const eventFailed = "_eventFailed_1ytrx_1432";
45755
- const eventRetrying = "_eventRetrying_1ytrx_1441";
45756
- const eventHook = "_eventHook_1ytrx_1450";
45757
- const eventDefault = "_eventDefault_1ytrx_1459";
45758
- const styles$1 = {
45759
- traceNode,
45760
- childRow,
45761
- spanNode,
45762
- huge,
45763
- spanName,
45764
- spanSpacer,
45765
- spanDuration,
45766
- small,
45767
- xHover,
45768
- spanNodeEvent,
45769
- eventDiamond,
45770
- customEventColor,
45771
- hoverInfo,
45772
- eventName,
45773
- eventTimestamp,
45774
- alignStart,
45775
- alignEnd,
45776
- colorVercel,
45777
- color0,
45778
- color1,
45779
- color2,
45780
- color3,
45781
- color4,
45782
- colorHighlight,
45783
- unlit,
45784
- mapContainer,
45785
- spanDetailPanel,
45786
- spanDetailPanelResizer,
45787
- spanDetailPanelTop,
45788
- spanDetailPanelBody,
45789
- spanDetailPanelTopInfo,
45790
- spanNameDetailPanel,
45791
- spanDetailPanelTruncatedHeading,
45792
- spanDetailPanelName,
45793
- spanDetailPanelDuration,
45794
- spanDetailPanelCorner,
45795
- spanDetailPanelCornerInner,
45796
- spanDetailPanelCloseVerticalRule,
45797
- spanDetailPanelClose,
45798
- spanDetailPanelAttribute,
45799
- spanDetailPanelAttributeKey,
45800
- spanDetailPanelAttributeValue,
45801
- spanDetailPanelQuickLink,
45802
- spanDetailPanelQuickLinkLabel,
45803
- detailGroup,
45804
- expanded,
45805
- collapsed,
45806
- ancestorGroup,
45807
- detailHeading,
45808
- buttonLink,
45809
- note,
45810
- skeleton,
45811
- skeletonRounded,
45812
- detailHeadingIcon,
45813
- infraSpanDescription,
45814
- ancestorNode,
45815
- ancestorText,
45816
- ancestorName,
45817
- ancestorDuration,
45818
- ancestorLineContainer,
45819
- ancestorLine,
45820
- zoomButtonGroup,
45821
- "zoom-buttons-fade-in": "_zoom-buttons-fade-in_1ytrx_1",
45822
- zoomButton,
45823
- divider,
45824
- markersContainer,
45825
- markers,
45826
- marker,
45827
- notch,
45828
- markerLabel,
45829
- markerClockTime,
45830
- eventMarkersContainer,
45831
- eventMarkers,
45832
- eventMarker,
45833
- cursorMarkerStickyParent,
45834
- cursorMarkerLabelContainer,
45835
- cursorMarkerLabel,
45836
- cursorMarkerContainer,
45837
- cursorMarker,
45838
- cursorSelection,
45839
- traceViewer,
45840
- "span-skeleton": "_span-skeleton_1ytrx_1",
45841
- mapCanvas,
45842
- zoomButtonTraceViewer,
45843
- timeline,
45844
- searchBar,
45845
- searchInput,
45846
- searchInputLabel,
45847
- searchInputPrefix,
45848
- mapThumb,
45849
- spanDetailPanelTraceViewer,
45850
- traceViewerContent,
45851
- inert,
45852
- hidden,
45853
- mobile,
45854
- spanRunning,
45855
- spanPending,
45856
- spanCompleted,
45857
- spanCancelled,
45858
- spanFailed,
45859
- spanPendingStriped,
45860
- hasQueuedTime,
45861
- spanSleep,
45862
- spanHook,
45863
- segmentLayer,
45864
- segment,
45865
- segmentLabel,
45866
- segmentTag,
45867
- segQueued,
45868
- segRunning,
45869
- segFailed,
45870
- segRetrying,
45871
- segSucceeded,
45872
- segWaiting,
45873
- segSleeping,
45874
- segReceived,
45875
- boundaryMarker,
45876
- boundaryLine,
45877
- hasSegments,
45878
- eventFailed,
45879
- eventRetrying,
45880
- eventHook,
45881
- eventDefault
45882
- };
45883
- function getHighResInMs([seconds, nanoseconds]) {
45884
- return seconds * 1e3 + nanoseconds / 1e6;
45885
- }
45886
- const SEGMENT_CLASS_MAP = {
45887
- queued: "segQueued",
45888
- running: "segRunning",
45889
- failed: "segFailed",
45890
- retrying: "segRetrying",
45891
- succeeded: "segSucceeded",
45892
- waiting: "segWaiting",
45893
- sleeping: "segSleeping",
45894
- received: "segReceived"
45895
- };
45896
- function clampFraction$1(value) {
45897
- return Math.max(0, Math.min(1, value));
45898
- }
45899
- function timeToFraction$1(time2, spanStart, spanDuration2) {
45900
- if (spanDuration2 <= 0)
45901
- return 0;
45902
- return clampFraction$1((time2 - spanStart) / spanDuration2);
45903
- }
45904
- function sortedEvents(events) {
45905
- return [...events].sort((a2, b2) => a2.timestamp - b2.timestamp);
45906
- }
45907
- function computeStepSegments(node2) {
45908
- const events = node2.events ? sortedEvents(node2.events) : [];
45909
- const { startTime, duration: duration2 } = node2;
45910
- const segments = [];
45911
- if (duration2 <= 0)
45912
- return segments;
45913
- const marks = events.filter((e) => [
45914
- "step_started",
45915
- "step_retrying",
45916
- "step_failed",
45917
- "step_completed"
45918
- ].includes(e.event.name)).map((e) => ({ time: e.timestamp, type: e.event.name }));
45919
- if (marks.length === 0) {
45920
- segments.push({ startFraction: 0, endFraction: 1, status: "running" });
45921
- return segments;
45922
- }
45923
- const firstMark = marks[0];
45924
- const firstFraction = timeToFraction$1(firstMark.time, startTime, duration2);
45925
- if (firstFraction > 1e-3) {
45926
- segments.push({
45927
- startFraction: 0,
45928
- endFraction: firstFraction,
45929
- status: "queued"
45930
- });
45931
- }
45932
- for (let i = 0; i < marks.length; i++) {
45933
- const mark2 = marks[i];
45934
- const markFraction = timeToFraction$1(mark2.time, startTime, duration2);
45935
- const nextMark = marks[i + 1];
45936
- const nextFraction = nextMark ? timeToFraction$1(nextMark.time, startTime, duration2) : 1;
45937
- if (mark2.type === "step_started") {
45938
- const isLastMark = i === marks.length - 1;
45939
- if (isLastMark) {
45940
- segments.push({
45941
- startFraction: markFraction,
45942
- endFraction: 1,
45943
- status: "succeeded"
45944
- });
45945
- } else {
45946
- const nextType = nextMark.type;
45947
- const attemptStatus = nextType === "step_retrying" || nextType === "step_failed" ? "failed" : nextType === "step_completed" ? "succeeded" : "running";
45948
- segments.push({
45949
- startFraction: markFraction,
45950
- endFraction: nextFraction,
45951
- status: attemptStatus
45952
- });
45953
- }
45954
- } else if (mark2.type === "step_retrying") {
45955
- segments.push({
45956
- startFraction: markFraction,
45957
- endFraction: nextFraction,
45958
- status: "retrying"
45959
- });
45960
- } else if (mark2.type === "step_failed") {
45961
- if (markFraction < 0.999) {
45962
- segments.push({
45963
- startFraction: markFraction,
45964
- endFraction: 1,
45965
- status: "failed"
45966
- });
45967
- }
45968
- } else if (mark2.type === "step_completed") ;
45969
- }
45970
- return segments;
45971
- }
45972
- function computeHookSegments(node2) {
45973
- const events = node2.events ? sortedEvents(node2.events) : [];
45974
- const { startTime, duration: duration2 } = node2;
45975
- const segments = [];
45976
- if (duration2 <= 0)
45977
- return segments;
45978
- const receivedEvent = events.find((e) => e.event.name === "hook_received");
45979
- const disposedEvent = events.find((e) => e.event.name === "hook_disposed");
45980
- if (!receivedEvent && !disposedEvent) {
45981
- segments.push({ startFraction: 0, endFraction: 1, status: "waiting" });
45982
- return segments;
45983
- }
45984
- const receivedFraction = receivedEvent ? timeToFraction$1(receivedEvent.timestamp, startTime, duration2) : null;
45985
- const disposedFraction = disposedEvent ? timeToFraction$1(disposedEvent.timestamp, startTime, duration2) : null;
45986
- if (receivedFraction !== null && receivedFraction > 1e-3) {
45987
- segments.push({
45988
- startFraction: 0,
45989
- endFraction: receivedFraction,
45990
- status: "waiting"
45991
- });
45992
- } else if (receivedFraction === null && disposedFraction !== null) {
45993
- segments.push({
45994
- startFraction: 0,
45995
- endFraction: disposedFraction,
45996
- status: "waiting"
45997
- });
45998
- }
45999
- if (receivedFraction !== null) {
46000
- const end = disposedFraction ?? 1;
46001
- segments.push({
46002
- startFraction: receivedFraction,
46003
- endFraction: end,
46004
- status: "received"
46005
- });
46006
- }
46007
- if (disposedFraction !== null && disposedFraction < 0.999) {
46008
- segments.push({
46009
- startFraction: disposedFraction,
46010
- endFraction: 1,
46011
- status: "succeeded"
46012
- });
46013
- }
46014
- return segments;
46015
- }
46016
- function computeSleepSegments(node2) {
46017
- const events = node2.events ? sortedEvents(node2.events) : [];
46018
- const { startTime, duration: duration2 } = node2;
46019
- const segments = [];
46020
- if (duration2 <= 0)
46021
- return segments;
46022
- const completedEvent = events.find((e) => e.event.name === "wait_completed");
46023
- if (!completedEvent) {
46024
- segments.push({ startFraction: 0, endFraction: 1, status: "sleeping" });
46025
- return segments;
46026
- }
46027
- const completedFraction = timeToFraction$1(completedEvent.timestamp, startTime, duration2);
46028
- if (completedFraction > 1e-3) {
46029
- segments.push({
46030
- startFraction: 0,
46031
- endFraction: completedFraction,
46032
- status: "sleeping"
46033
- });
46034
- }
46035
- segments.push({
46036
- startFraction: completedFraction,
46037
- endFraction: 1,
46038
- status: "succeeded"
46039
- });
46040
- return segments;
46041
- }
46042
- function computeRunSegments(node2) {
46043
- var _a3;
46044
- const events = node2.events ? sortedEvents(node2.events) : [];
46045
- const { startTime, duration: duration2, activeStartTime } = node2;
46046
- const segments = [];
46047
- if (duration2 <= 0)
46048
- return segments;
46049
- const hasRunCreated = events.some((e) => e.event.name === "run_created");
46050
- if (!hasRunCreated) {
46051
- const runData = (_a3 = node2.span.attributes) == null ? void 0 : _a3.data;
46052
- const runStatus = runData == null ? void 0 : runData.status;
46053
- return computeV1RunSegments$1(startTime, duration2, activeStartTime, runStatus);
46054
- }
46055
- const failedEvent = events.find((e) => e.event.name === "run_failed");
46056
- const completedEvent = events.find((e) => e.event.name === "run_completed");
46057
- let cursor = 0;
46058
- if (activeStartTime && activeStartTime > startTime) {
46059
- const queuedFraction = timeToFraction$1(activeStartTime, startTime, duration2);
46060
- if (queuedFraction > 1e-3) {
46061
- segments.push({
46062
- startFraction: 0,
46063
- endFraction: queuedFraction,
46064
- status: "queued"
46065
- });
46066
- cursor = queuedFraction;
46067
- }
46068
- }
46069
- if (failedEvent) {
46070
- const failedFraction = timeToFraction$1(failedEvent.timestamp, startTime, duration2);
46071
- if (failedFraction > cursor + 1e-3) {
46072
- segments.push({
46073
- startFraction: cursor,
46074
- endFraction: failedFraction,
46075
- status: "running"
46076
- });
46077
- }
46078
- segments.push({
46079
- startFraction: failedFraction,
46080
- endFraction: 1,
46081
- status: "failed"
46082
- });
46083
- } else if (completedEvent) {
46084
- const completedFraction = timeToFraction$1(completedEvent.timestamp, startTime, duration2);
46085
- if (completedFraction > cursor + 1e-3) {
46086
- segments.push({
46087
- startFraction: cursor,
46088
- endFraction: completedFraction,
46089
- status: "running"
46090
- });
46091
- }
46092
- segments.push({
46093
- startFraction: completedFraction,
46094
- endFraction: 1,
46095
- status: "succeeded"
46096
- });
46097
- } else {
46098
- segments.push({
46099
- startFraction: cursor,
46100
- endFraction: 1,
46101
- status: "running"
46102
- });
46103
- }
46104
- return segments;
46105
- }
46106
- function computeV1RunSegments$1(startTime, duration2, activeStartTime, runStatus) {
46107
- const segments = [];
46108
- let cursor = 0;
46109
- if (activeStartTime && activeStartTime > startTime) {
46110
- const queuedFraction = timeToFraction$1(activeStartTime, startTime, duration2);
46111
- if (queuedFraction > 1e-3) {
46112
- segments.push({
46113
- startFraction: 0,
46114
- endFraction: queuedFraction,
46115
- status: "queued"
46116
- });
46117
- cursor = queuedFraction;
46118
- }
46119
- }
46120
- if (runStatus === "failed") {
46121
- segments.push({
46122
- startFraction: cursor,
46123
- endFraction: 1,
46124
- status: "failed"
46125
- });
46126
- } else if (runStatus === "completed" || runStatus === "cancelled") {
46127
- segments.push({
46128
- startFraction: cursor,
46129
- endFraction: 1,
46130
- status: "succeeded"
46131
- });
46132
- } else {
46133
- segments.push({
46134
- startFraction: cursor,
46135
- endFraction: 1,
46136
- status: "running"
46137
- });
46138
- }
46139
- return segments;
46140
- }
46141
- const EVENT_LABELS = {
46142
- step_started: "Started",
46143
- step_retrying: "Retrying",
46144
- step_failed: "Failed",
46145
- hook_created: "Created",
46146
- hook_received: "Received",
46147
- hook_disposed: "Resolved",
46148
- wait_created: "Sleep started",
46149
- wait_completed: "Sleep completed",
46150
- run_completed: "Completed",
46151
- run_failed: "Run failed",
46152
- step_completed: "Completed"
46153
- };
46154
- function computeBoundaries(node2, relevantEventNames) {
46155
- const events = node2.events ? sortedEvents(node2.events) : [];
46156
- const { startTime, duration: duration2 } = node2;
46157
- if (duration2 <= 0)
46158
- return [];
46159
- const boundaries = [];
46160
- for (const e of events) {
46161
- if (!relevantEventNames.includes(e.event.name))
46162
- continue;
46163
- const fraction = timeToFraction$1(e.timestamp, startTime, duration2);
46164
- if (fraction < 0.01 || fraction > 0.99)
46165
- continue;
46166
- boundaries.push({
46167
- fraction,
46168
- label: EVENT_LABELS[e.event.name] ?? e.event.name,
46169
- offsetMs: e.timestamp - startTime
46170
- });
46171
- }
46172
- return boundaries;
46173
- }
46174
- function computeSegments(resourceType, node2) {
46175
- switch (resourceType) {
46176
- case "step":
46177
- return {
46178
- segments: computeStepSegments(node2),
46179
- boundaries: computeBoundaries(node2, [
46180
- "step_started",
46181
- "step_retrying",
46182
- "step_failed",
46183
- "step_completed"
46184
- ])
46185
- };
46186
- case "hook":
46187
- return {
46188
- segments: computeHookSegments(node2),
46189
- boundaries: computeBoundaries(node2, [
46190
- "hook_created",
46191
- "hook_received",
46192
- "hook_disposed"
46193
- ])
46194
- };
46195
- case "sleep":
46196
- return {
46197
- segments: computeSleepSegments(node2),
46198
- boundaries: computeBoundaries(node2, ["wait_created", "wait_completed"])
46199
- };
46200
- case "run":
46201
- return {
46202
- segments: computeRunSegments(node2),
46203
- boundaries: computeBoundaries(node2, ["run_completed", "run_failed"])
46204
- };
46205
- default:
46206
- return { segments: [], boundaries: [] };
46207
- }
46208
- }
46209
- function getDuration(node2) {
46210
- if (node2.isInstrumentationHint) {
46211
- return "Get Started";
46212
- }
46213
- return formatDuration(node2.duration);
46214
- }
46215
- const SEGMENT_LABELS = {
46216
- queued: "Queued",
46217
- running: "",
46218
- failed: "Failed",
46219
- retrying: "Retry wait",
46220
- succeeded: "Executed",
46221
- waiting: "Waiting",
46222
- sleeping: "Sleeping",
46223
- received: "Received"
46224
- };
46225
- function SegmentLayer({ segments, spanDuration: spanDuration2 }) {
46226
- if (segments.length === 0)
46227
- return null;
46228
- return jsxRuntimeExports.jsx("div", { className: styles$1.segmentLayer, children: segments.map((seg, i) => {
46229
- const className = styles$1[SEGMENT_CLASS_MAP[seg.status]];
46230
- const segDuration = (seg.endFraction - seg.startFraction) * spanDuration2;
46231
- const label = SEGMENT_LABELS[seg.status];
46232
- const style2 = {
46233
- left: `${seg.startFraction * 100}%`,
46234
- width: `${(seg.endFraction - seg.startFraction) * 100}%`
46235
- };
46236
- return jsxRuntimeExports.jsx("div", { className: `${styles$1.segment} ${String(className)}`, style: style2, title: label ? `${label} ${formatDuration(segDuration)}` : formatDuration(segDuration) }, `seg-${seg.status}-${String(i)}`);
46237
- }) });
46238
- }
46239
- function getSegmentTags(segments, spanDuration2) {
46240
- const tags = [];
46241
- for (let i = 0; i < segments.length; i++) {
46242
- const seg = segments[i];
46243
- const label = SEGMENT_LABELS[seg.status];
46244
- if (!label)
46245
- continue;
46246
- let segDuration = (seg.endFraction - seg.startFraction) * spanDuration2;
46247
- if (segDuration < 1 && (seg.status === "succeeded" || seg.status === "failed") && i > 0) {
46248
- const prev = segments[i - 1];
46249
- if (prev.status === "running") {
46250
- segDuration = (prev.endFraction - prev.startFraction) * spanDuration2;
46251
- }
46252
- }
46253
- if (segDuration < 1)
46254
- continue;
46255
- tags.push({ label, duration: formatDuration(segDuration) });
46256
- }
46257
- return tags;
46258
- }
46259
- function TextContent({ node: node2, layout, durationMs, segmentTags }) {
46260
- const duration2 = node2.isInstrumentationHint ? getDuration(node2) : formatDuration(durationMs ?? node2.duration);
46261
- if (layout.isSmall && !layout.isHovered) {
46262
- return null;
46263
- }
46264
- const showTags = segmentTags && segmentTags.length > 0 && (layout.isHovered || layout.width > 200);
46265
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs("span", { className: styles$1.spanName, children: [node2.label || node2.span.name, showTags ? segmentTags.map((tag, i) => jsxRuntimeExports.jsxs("span", { className: styles$1.segmentTag, children: [" · ", tag.label, " ", tag.duration] }, i)) : null] }), layout.isHuge ? jsxRuntimeExports.jsx("span", { className: styles$1.spanSpacer }) : null, layout.isHovered || layout.width > 128 ? jsxRuntimeExports.jsx("span", { className: styles$1.spanDuration, children: duration2 }) : null] });
46266
- }
46267
- function DefaultContent({ node: node2, layout }) {
46268
- return jsxRuntimeExports.jsx(TextContent, { node: node2, layout });
46269
- }
46270
- function WorkflowContent({ resourceType, node: node2, layout, durationMs }) {
46271
- const spanDuration2 = durationMs ?? node2.duration;
46272
- const { segments } = computeSegments(resourceType, node2);
46273
- const segmentTags = getSegmentTags(segments, spanDuration2);
46274
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SegmentLayer, { segments, spanDuration: spanDuration2 }), jsxRuntimeExports.jsx(TextContent, { durationMs: spanDuration2, node: node2, layout, segmentTags })] });
46275
- }
46276
- function RunContent(props) {
46277
- return jsxRuntimeExports.jsx(WorkflowContent, { resourceType: "run", ...props });
46278
- }
46279
- function StepContent(props) {
46280
- return jsxRuntimeExports.jsx(WorkflowContent, { resourceType: "step", ...props });
46281
- }
46282
- function HookContent(props) {
46283
- return jsxRuntimeExports.jsx(WorkflowContent, { resourceType: "hook", ...props });
46284
- }
46285
- function SleepContent(props) {
46286
- return jsxRuntimeExports.jsx(WorkflowContent, { resourceType: "sleep", ...props });
46287
- }
46288
- function SpanContent({ resourceType, ...props }) {
46289
- switch (resourceType) {
46290
- case "run":
46291
- return jsxRuntimeExports.jsx(RunContent, { ...props });
46292
- case "step":
46293
- return jsxRuntimeExports.jsx(StepContent, { ...props });
46294
- case "hook":
46295
- return jsxRuntimeExports.jsx(HookContent, { ...props });
46296
- case "sleep":
46297
- return jsxRuntimeExports.jsx(SleepContent, { ...props });
46298
- default:
46299
- return jsxRuntimeExports.jsx(DefaultContent, { ...props });
46300
- }
46301
- }
46302
- const MIN_SPAN_WIDTH = 4;
46303
- function getResourceType(node2) {
46304
- var _a3;
46305
- const resource = (_a3 = node2.span.attributes) == null ? void 0 : _a3.resource;
46306
- if (resource === "run" || resource === "step" || resource === "hook" || resource === "sleep") {
46307
- return resource;
46308
- }
46309
- return "default";
46310
- }
46311
- function computeIsSmall(actualWidth) {
46312
- return actualWidth < 64;
46313
- }
46314
- function computeIsHuge(actualWidth) {
46315
- return actualWidth >= 500;
46316
- }
46317
- function computeIsHovered(node2, isHuge) {
46318
- return node2.isHovered && !isHuge && node2.isHighlighted !== false;
46319
- }
46320
- function computeIsNearRightSide(node2, root2, scrollSnapshotRef, isHovered) {
46321
- if (!isHovered)
46322
- return false;
46323
- let visibleDuration = root2.duration;
46324
- let visibleEndTime = root2.endTime;
46325
- const snapshot = scrollSnapshotRef.current;
46326
- if (snapshot) {
46327
- visibleDuration = snapshot.endTime - snapshot.startTime;
46328
- visibleEndTime = snapshot.endTime;
46329
- }
46330
- return visibleEndTime - node2.startTime < 0.25 * visibleDuration;
46331
- }
46332
- function computeDefaultLayout(node2, root2, scale, scrollSnapshotRef) {
46333
- const left = (node2.startTime - root2.startTime) * scale;
46334
- let top = MARKER_HEIGHT + (ROW_HEIGHT + ROW_PADDING) * node2.row;
46335
- const actualWidth = node2.duration * scale;
46336
- const width = Math.max(actualWidth, MIN_SPAN_WIDTH);
46337
- let height = ROW_HEIGHT;
46338
- const isHuge = computeIsHuge(actualWidth);
46339
- const isSmall = computeIsSmall(actualWidth);
46340
- const isHovered = computeIsHovered(node2, isHuge);
46341
- const isExpanded = isHovered || Boolean(node2.isSelected);
46342
- if (isSmall && !isExpanded) {
46343
- height *= 0.4;
46344
- top += (ROW_HEIGHT - height) * 0.5;
46345
- }
46346
- const isNearRightSide = computeIsNearRightSide(node2, root2, scrollSnapshotRef, isExpanded);
46347
- return {
46348
- width,
46349
- actualWidth,
46350
- height,
46351
- top,
46352
- left,
46353
- isSmall,
46354
- isHuge,
46355
- isHovered,
46356
- isExpanded,
46357
- isNearRightSide
46358
- };
46359
- }
46360
- function getRunLayout(node2, root2, scale, scrollSnapshotRef) {
46361
- return computeDefaultLayout(node2, root2, scale, scrollSnapshotRef);
46362
- }
46363
- function getStepLayout(node2, root2, scale, scrollSnapshotRef) {
46364
- return computeDefaultLayout(node2, root2, scale, scrollSnapshotRef);
46365
- }
46366
- function getHookLayout(node2, root2, scale, scrollSnapshotRef) {
46367
- return computeDefaultLayout(node2, root2, scale, scrollSnapshotRef);
46368
- }
46369
- function getSleepLayout(node2, root2, scale, scrollSnapshotRef) {
46370
- return computeDefaultLayout(node2, root2, scale, scrollSnapshotRef);
46371
- }
46372
- function getSpanLayout(resourceType, node2, root2, scale, scrollSnapshotRef) {
46373
- switch (resourceType) {
46374
- case "run":
46375
- return getRunLayout(node2, root2, scale, scrollSnapshotRef);
46376
- case "step":
46377
- return getStepLayout(node2, root2, scale, scrollSnapshotRef);
46378
- case "hook":
46379
- return getHookLayout(node2, root2, scale, scrollSnapshotRef);
46380
- case "sleep":
46381
- return getSleepLayout(node2, root2, scale, scrollSnapshotRef);
46382
- default:
46383
- return computeDefaultLayout(node2, root2, scale, scrollSnapshotRef);
46384
- }
46385
- }
46386
- const getSpanColorClassName = (node2) => {
46387
- if (node2.isVercel)
46388
- return String(styles$1.colorVercel);
46389
- return String(styles$1[`color${node2.resourceIndex % 5}`]);
46390
- };
46391
- function getTerminalTimestamp(resourceType, node2) {
46392
- const events = node2.events;
46393
- if (!(events == null ? void 0 : events.length))
46394
- return void 0;
46395
- switch (resourceType) {
46396
- case "hook":
46397
- for (let i = events.length; i--; ) {
46398
- if (events[i].event.name === "hook_disposed") {
46399
- return events[i].timestamp;
46400
- }
46401
- }
46402
- return void 0;
46403
- case "sleep":
46404
- for (let i = events.length; i--; ) {
46405
- if (events[i].event.name === "wait_completed") {
46406
- return events[i].timestamp;
46407
- }
46408
- }
46409
- return void 0;
46410
- case "run":
46411
- for (let i = events.length; i--; ) {
46412
- const name2 = events[i].event.name;
46413
- if (name2 === "run_completed" || name2 === "run_failed" || name2 === "run_cancelled") {
46414
- return events[i].timestamp;
46415
- }
46416
- }
46417
- return void 0;
46418
- case "step":
46419
- for (let i = events.length; i--; ) {
46420
- const name2 = events[i].event.name;
46421
- if (name2 === "step_completed" || name2 === "step_failed") {
46422
- return events[i].timestamp;
46423
- }
46424
- if (name2 === "step_started" || name2 === "step_retrying") {
46425
- return void 0;
46426
- }
46427
- }
46428
- return void 0;
46429
- default:
46430
- return void 0;
46431
- }
46432
- }
46433
- reactExports.memo(function SpanNodes({ root: root2, scale, spans, isLive = false, scrollSnapshotRef, cache, customSpanClassNameFunc, customSpanEventClassNameFunc }) {
46434
- return spans.map((x2) => jsxRuntimeExports.jsx(SpanComponent, { cacheKey: cache.get(x2.span.spanId), customSpanEventClassNameFunc, customSpanClassNameFunc, node: x2, root: root2, scale, traceIsLive: isLive, scrollSnapshotRef }, x2.span.spanId));
46435
- });
46436
- function getSpanStyle(layout, node2, root2, scale) {
46437
- const expanded2 = layout.isExpanded;
46438
- return {
46439
- // Use actualWidth for CSS variable so hover expansion is accurate
46440
- "--span-width": `${Math.max(layout.actualWidth, 1)}px`,
46441
- minWidth: expanded2 ? layout.width : void 0,
46442
- width: expanded2 ? void 0 : layout.width,
46443
- height: layout.height,
46444
- maxWidth: expanded2 && !layout.isNearRightSide ? (root2.endTime - node2.startTime) * scale : void 0,
46445
- containIntrinsicWidth: expanded2 ? void 0 : layout.width,
46446
- containIntrinsicHeight: layout.height,
46447
- left: layout.isNearRightSide ? void 0 : layout.left,
46448
- right: layout.isNearRightSide ? (root2.endTime - node2.endTime) * scale : void 0,
46449
- top: layout.top
46450
- };
46451
- }
46452
- const SpanComponent = reactExports.memo(function SpanComponent2({ node: node2, root: root2, scale, traceIsLive = false, scrollSnapshotRef, customSpanClassNameFunc, customSpanEventClassNameFunc }) {
46453
- var _a3;
46454
- const ref = reactExports.useRef(null);
46455
- reactExports.useEffect(() => {
46456
- node2.ref = ref;
46457
- return () => {
46458
- node2.ref = void 0;
46459
- };
46460
- }, [node2]);
46461
- const { span } = node2;
46462
- const resourceType = getResourceType(node2);
46463
- const [liveNow, setLiveNow] = reactExports.useState(0);
46464
- const customClassName = customSpanClassNameFunc ? customSpanClassNameFunc(node2) : "";
46465
- const isWorkflowSpan = resourceType !== "default";
46466
- const data = (_a3 = span.attributes) == null ? void 0 : _a3.data;
46467
- const terminalTimestamp = getTerminalTimestamp(resourceType, node2);
46468
- const hasTerminalEvent = terminalTimestamp != null;
46469
- const isCompletedByData = resourceType === "hook" ? Boolean(data == null ? void 0 : data.disposedAt) : Boolean(data == null ? void 0 : data.completedAt);
46470
- const isCompleted = isCompletedByData || hasTerminalEvent;
46471
- const isLive = traceIsLive && isWorkflowSpan && !isCompleted;
46472
- reactExports.useEffect(() => {
46473
- if (!isLive)
46474
- return;
46475
- setLiveNow(Date.now());
46476
- const interval = setInterval(() => {
46477
- setLiveNow(Date.now());
46478
- }, 250);
46479
- return () => clearInterval(interval);
46480
- }, [isLive]);
46481
- const canonicalStartTime = getHighResInMs(span.startTime);
46482
- const canonicalEndTime = getHighResInMs(span.endTime);
46483
- const canonicalDuration = getHighResInMs(span.duration);
46484
- const canonicalActiveStartTime = span.activeStartTime ? getHighResInMs(span.activeStartTime) : void 0;
46485
- const durationMs = terminalTimestamp != null ? Math.max(0, terminalTimestamp - canonicalStartTime) : isLive ? Math.max(0, (liveNow || Date.now()) - canonicalStartTime) : canonicalDuration;
46486
- const duration2 = node2.isInstrumentationHint ? "Get Started" : formatDuration(durationMs);
46487
- const baseNode = {
46488
- ...node2,
46489
- startTime: canonicalStartTime,
46490
- endTime: canonicalEndTime,
46491
- duration: canonicalDuration,
46492
- activeStartTime: canonicalActiveStartTime
46493
- };
46494
- const segmentNode = isLive ? {
46495
- ...baseNode,
46496
- duration: durationMs,
46497
- endTime: canonicalStartTime + durationMs
46498
- } : baseNode;
46499
- const hasSegments2 = isWorkflowSpan && computeSegments(resourceType, segmentNode).segments.length > 0;
46500
- const layout = getSpanLayout(resourceType, segmentNode, root2, scale, scrollSnapshotRef);
46501
- if (isLive) {
46502
- const elapsed = durationMs;
46503
- const liveActualWidth = elapsed * scale;
46504
- const liveWidth = Math.max(liveActualWidth, 4);
46505
- layout.actualWidth = liveActualWidth;
46506
- layout.width = liveWidth;
46507
- layout.isSmall = liveActualWidth < 64;
46508
- layout.isHuge = liveActualWidth >= 500;
46509
- if (!layout.isSmall) {
46510
- layout.height = ROW_HEIGHT;
46511
- layout.top = MARKER_HEIGHT + (ROW_HEIGHT + ROW_PADDING) * segmentNode.row;
46512
- }
46513
- }
46514
- reactExports.useEffect(() => {
46515
- if (!isLive || !ref.current)
46516
- return;
46517
- let rafId = 0;
46518
- const tick = () => {
46519
- const $el = ref.current;
46520
- if (!$el)
46521
- return;
46522
- const elapsed = Date.now() - canonicalStartTime;
46523
- const w2 = Math.max(elapsed * scale, 2);
46524
- $el.style.width = `${w2}px`;
46525
- $el.style.setProperty("--span-width", `${w2}px`);
46526
- rafId = requestAnimationFrame(tick);
46527
- };
46528
- rafId = requestAnimationFrame(tick);
46529
- return () => cancelAnimationFrame(rafId);
46530
- }, [isLive, canonicalStartTime, scale]);
46531
- const renderNode = segmentNode;
46532
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("button", { "aria-label": `${span.name} - ${duration2}`, className: clsx(styles$1.spanNode, layout.isHuge && styles$1.huge, layout.isSmall && styles$1.small, layout.isExpanded && styles$1.xHover, node2.isHighlighted ? styles$1.colorHighlight : getSpanColorClassName(node2), node2.isHighlighted === false && styles$1.unlit, customClassName, hasSegments2 && styles$1.hasSegments), "data-span-id": span.spanId, "data-start-time": segmentNode.startTime - root2.startTime, "data-right-side": layout.isNearRightSide, "data-selected": node2.isSelected ? "" : void 0, ref, style: getSpanStyle(layout, segmentNode, root2, scale), type: "button", children: jsxRuntimeExports.jsx(SpanContent, { durationMs, resourceType, node: renderNode, layout }) }), segmentNode.events && !layout.isSmall ? segmentNode.events.map((x2) => jsxRuntimeExports.jsx(SpanEventComponent, { customSpanEventClassNameFunc, event: x2, node: segmentNode, root: root2, scale, asBoundary: isWorkflowSpan }, x2.key)) : null] });
46533
- });
46534
- const BOUNDARY_LABELS = {
46535
- step_started: "Started",
46536
- step_retrying: "Retrying",
46537
- step_failed: "Failed",
46538
- hook_created: "Created",
46539
- hook_received: "Received",
46540
- hook_disposed: "Resolved",
46541
- wait_created: "Sleep started",
46542
- wait_completed: "Sleep completed",
46543
- run_started: "Started",
46544
- run_completed: "Completed",
46545
- run_failed: "Run failed",
46546
- step_completed: "Completed",
46547
- attr_set: "Attributes set"
46548
- };
46549
- const SpanEventComponent = reactExports.memo(function SpanEventComponent2({ event, node: node2, root: root2, scale, customSpanEventClassNameFunc, asBoundary = false }) {
46550
- const ref = reactExports.useRef(null);
46551
- reactExports.useEffect(() => {
46552
- event.ref = ref;
46553
- return () => {
46554
- event.ref = void 0;
46555
- };
46556
- }, [event]);
46557
- const { event: { name: name2 } } = event;
46558
- const timestamp = formatDuration(event.timestamp - root2.startTime);
46559
- const displayLabel = asBoundary ? BOUNDARY_LABELS[name2] ?? name2 : name2;
46560
- const isForwardEvent = asBoundary && (name2 === "step_started" || name2 === "run_started" || name2 === "step_retrying");
46561
- const isTerminalEvent = asBoundary && (name2 === "step_completed" || name2 === "run_completed");
46562
- let phaseDuration = null;
46563
- let phaseLabel = null;
46564
- if ((isForwardEvent || isTerminalEvent) && node2.events) {
46565
- const sortedNodeEvents = [...node2.events].sort((a2, b2) => a2.timestamp - b2.timestamp);
46566
- const currentIdx = sortedNodeEvents.findIndex((e) => e.key === event.key);
46567
- if (isTerminalEvent) {
46568
- let prevStartTime = null;
46569
- for (let i = currentIdx - 1; i >= 0; i--) {
46570
- if (sortedNodeEvents[i].event.name === "step_started") {
46571
- prevStartTime = sortedNodeEvents[i].timestamp;
46572
- break;
46573
- }
46574
- }
46575
- if (prevStartTime !== null) {
46576
- phaseDuration = formatDuration(event.timestamp - prevStartTime);
46577
- phaseLabel = "Executed";
46578
- }
46579
- } else {
46580
- const nextEvent = sortedNodeEvents[currentIdx + 1];
46581
- const endTime = nextEvent ? nextEvent.timestamp : node2.endTime;
46582
- phaseDuration = formatDuration(endTime - event.timestamp);
46583
- phaseLabel = name2 === "step_retrying" ? "Waited" : "Executed";
46584
- }
46585
- }
46586
- const left = (event.timestamp - root2.startTime) * scale;
46587
- const top = MARKER_HEIGHT + (ROW_HEIGHT + ROW_PADDING) * node2.row;
46588
- const isLeftAligned = node2.duration <= 0 || (event.timestamp - node2.startTime) / node2.duration < 0.5;
46589
- const customClassName = customSpanEventClassNameFunc ? customSpanEventClassNameFunc(event) : "";
46590
- return jsxRuntimeExports.jsxs("div", { title: phaseDuration ? `${displayLabel} ${timestamp}
46591
- ${phaseLabel} ${phaseDuration}` : `${displayLabel} ${timestamp}`, className: clsx(styles$1.spanNodeEvent, customClassName, asBoundary && styles$1.boundaryMarker, node2.isHighlighted ? styles$1.colorHighlight : getSpanColorClassName(node2), node2.isHighlighted === false && styles$1.unlit), "data-hovered": event.isHovered, ref, style: {
46592
- left,
46593
- top
46594
- }, children: [jsxRuntimeExports.jsx("div", { className: clsx(styles$1.hoverInfo, isLeftAligned ? styles$1.alignStart : styles$1.alignEnd), children: asBoundary ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: styles$1.eventName, children: displayLabel }), jsxRuntimeExports.jsx("span", { className: styles$1.eventTimestamp, children: timestamp }), phaseDuration ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: styles$1.eventName, children: phaseLabel }), jsxRuntimeExports.jsx("span", { className: styles$1.eventTimestamp, children: phaseDuration })] }) : null] }) : jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: styles$1.eventName, children: name2 }), jsxRuntimeExports.jsx("span", { className: styles$1.eventTimestamp, children: timestamp })] }) }), asBoundary ? jsxRuntimeExports.jsx("div", { className: styles$1.boundaryLine }) : jsxRuntimeExports.jsx("div", { className: styles$1.eventDiamond })] });
46595
- });
46596
- const colorTokenMap = {
46597
- "gray-700": "var(--ds-gray-700)",
46598
- "gray-900": "var(--ds-gray-900)"
46599
- };
46600
- function IconChevronDown({ size: size2 = 16 }) {
46601
- return jsxRuntimeExports.jsxs("svg", { width: size2, height: size2, viewBox: "0 0 24 24", fill: "none", "aria-hidden": true, className: styles$1.detailHeadingIcon, children: [jsxRuntimeExports.jsx("title", { children: "Chevron Down" }), jsxRuntimeExports.jsx("path", { d: "M6 9l6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] });
46602
- }
46603
- function IconExternalSmall({ size: size2 = 16, color: color5 = "gray-900" }) {
46604
- const style2 = { color: colorTokenMap[color5] || color5 };
46605
- return jsxRuntimeExports.jsxs("svg", { width: size2, height: size2, viewBox: "0 0 24 24", fill: "none", style: style2, "aria-hidden": true, children: [jsxRuntimeExports.jsx("title", { children: "External Small" }), jsxRuntimeExports.jsx("path", { d: "M14 4h6m0 0v6m0-6L10 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("path", { d: "M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] });
46606
- }
46607
- function Link(props) {
46608
- const { as: asProp, className, href, children: children2, ...rest } = props;
46609
- const Element2 = asProp || "a";
46610
- if (Element2 === "span" || !href) {
46611
- return jsxRuntimeExports.jsx("span", { className, ...rest, children: children2 });
46612
- }
46613
- return jsxRuntimeExports.jsx("a", { className, href, ...rest, children: children2 });
46614
- }
46615
- function Skeleton({ width, height, rounded }) {
46616
- return jsxRuntimeExports.jsx("span", { className: clsx(styles$1.skeleton, rounded && styles$1.skeletonRounded), style: { width, height }, "aria-hidden": true });
46617
- }
46618
- const EXPANDED_STORAGE_KEY_PREFIX = "vc-trace-span-exp:";
46619
- function DetailGroup({ name: name2, className = "", children: children2 }) {
46620
- const [isExpanded, setIsExpanded] = reactExports.useState(() => {
46621
- if (!("localStorage" in globalThis))
46622
- return true;
46623
- return localStorage.getItem(`${EXPANDED_STORAGE_KEY_PREFIX}${name2}`) !== "0";
46624
- });
46625
- const toggleExpanded = reactExports.useCallback(() => {
46626
- setIsExpanded((x2) => {
46627
- const willBeExpanded = !x2;
46628
- localStorage.setItem(`${EXPANDED_STORAGE_KEY_PREFIX}${name2}`, String(Number(willBeExpanded)));
46629
- return willBeExpanded;
46630
- });
46631
- }, [name2]);
46632
- return jsxRuntimeExports.jsxs("div", { className: clsx(styles$1.detailGroup, isExpanded ? styles$1.expanded : styles$1.collapsed, className), children: [jsxRuntimeExports.jsxs("button", { className: styles$1.detailHeading, onClick: toggleExpanded, type: "button", children: [jsxRuntimeExports.jsx("span", { children: name2 }), jsxRuntimeExports.jsx(IconChevronDown, {})] }), isExpanded ? children2 : null] });
46633
- }
46634
- reactExports.memo(function EntrySpanLinks({ getQuickLinks, span }) {
46635
- const links = getQuickLinks(span);
46636
- if (!links.length)
46637
- return null;
46638
- return jsxRuntimeExports.jsx(DetailGroup, { name: "Links", children: links.map(({ key, value }) => jsxRuntimeExports.jsx(EntrySpanLink, { link: value, name: key }, key)) });
46639
- });
46640
- function usePromise(promise) {
46641
- const [_2, setLatest] = reactExports.useState({});
46642
- const fulfilled = promise.__resolvedValue !== void 0 || promise.__rejectedValue !== void 0;
46643
- reactExports.useEffect(() => {
46644
- if (fulfilled)
46645
- return;
46646
- promise.then((value) => {
46647
- promise.__resolvedValue = value;
46648
- }).catch((err) => {
46649
- promise.__rejectedValue = err;
46650
- }).finally(() => setLatest({}));
46651
- }, [promise, fulfilled]);
46652
- return promise.__resolvedValue;
46653
- }
46654
- function EntrySpanLink({ name: name2, link: linkPromise }) {
46655
- const link2 = usePromise(linkPromise);
46656
- return jsxRuntimeExports.jsxs(Link, { as: link2 ? void 0 : "span", className: clsx(styles$1.spanDetailPanelAttribute, styles$1.spanDetailPanelQuickLink), href: (link2 == null ? void 0 : link2.href) || "", children: [jsxRuntimeExports.jsx("span", { className: styles$1.spanDetailPanelAttributeKey, children: name2 }), jsxRuntimeExports.jsx("span", { className: clsx(styles$1.spanDetailPanelAttributeValue, styles$1.spanDetailPanelQuickLinkLabel), children: link2 ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [link2.label, link2.icon || jsxRuntimeExports.jsx(IconExternalSmall, { color: "gray-900" })] }) : jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Skeleton, { height: 18, width: 32 + name2.length * 8 }), jsxRuntimeExports.jsx(Skeleton, { height: 18, rounded: true, width: 18 })] }) })] });
46657
- }
46658
- function useImmediateStyle(ref) {
46659
- const styleRef = reactExports.useRef({});
46660
- const setStyle = reactExports.useCallback((propertyName, value) => {
46661
- styleRef.current[propertyName] = value;
46662
- if (!ref.current)
46663
- return;
46664
- if (!value) {
46665
- ref.current.style.removeProperty(propertyName);
46666
- return;
46667
- }
46668
- ref.current.style.setProperty(propertyName, value);
46669
- }, [ref]);
46670
- return { setStyle, styleRef, style: { ...styleRef.current } };
45801
+ const STREAM_SKELETON_ROWS = [
45802
+ { id: "stream-skeleton-row-1", width: "72%" },
45803
+ { id: "stream-skeleton-row-2", width: "58%" },
45804
+ { id: "stream-skeleton-row-3", width: "80%" },
45805
+ { id: "stream-skeleton-row-4", width: "64%" }
45806
+ ];
45807
+ function StreamViewerSkeleton() {
45808
+ return jsxRuntimeExports.jsxs("output", { "aria-busy": "true", "aria-label": "Loading stream", className: "flex h-full min-h-0 w-full flex-col overflow-hidden bg-background-100", children: [jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Loading stream…" }), jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center border-b border-gray-alpha-400 px-3", children: jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-10" }) }), jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: STREAM_SKELETON_ROWS.map((row) => jsxRuntimeExports.jsxs("div", { className: "flex h-10 items-center gap-2 border-b border-gray-alpha-400 px-3", children: [jsxRuntimeExports.jsx(Skeleton, { className: "h-3", style: { width: row.width } }), jsxRuntimeExports.jsx(Skeleton, { className: "h-4 w-4 shrink-0 rounded-sm" })] }, row.id)) })] });
46671
45809
  }
46672
- const getDpi = () => {
46673
- if ("devicePixelRatio" in globalThis) {
46674
- return globalThis.devicePixelRatio || 1;
46675
- }
46676
- return 1;
46677
- };
46678
- const useDpi = () => {
46679
- const [dpi, setDpi] = reactExports.useState(1);
46680
- reactExports.useLayoutEffect(() => {
46681
- const onChange = () => setDpi(getDpi());
46682
- const media = matchMedia(`(resolution: ${dpi}dppx)`);
46683
- media.addEventListener("change", onChange);
46684
- onChange();
46685
- return () => {
46686
- media.removeEventListener("change", onChange);
46687
- };
46688
- }, [dpi]);
46689
- return dpi;
46690
- };
46691
- const padding = TIMELINE_PADDING;
46692
- reactExports.memo(function MiniMap({ timelineRef, rows, scale }) {
46693
- const { state: { root: root2, baseScale, timelineWidth, width: fullWidth, scrollbarWidth } } = useTraceViewer();
46694
- const mapWidth = fullWidth + TIMELINE_PADDING * 2;
46695
- const dpi = useDpi();
46696
- const containerRef = reactExports.useRef(null);
46697
- const canvasRef = reactExports.useRef(null);
46698
- const thumbRatio = fullWidth / (fullWidth - scrollbarWidth) * Math.min(fullWidth / timelineWidth, baseScale / scale);
46699
- const thumbWidth = Math.min(fullWidth, (timelineWidth - scrollbarWidth) * thumbRatio);
46700
- reactExports.useEffect(() => {
46701
- let isHeld = false;
46702
- let clientX = 0;
46703
- let rect;
46704
- const isValidEventTarget = (target2) => {
46705
- var _a3;
46706
- return Boolean((_a3 = containerRef.current) == null ? void 0 : _a3.contains(target2));
46707
- };
46708
- let nextFrame = 0;
46709
- const onFrame = () => {
46710
- if (!isHeld || !rect)
46711
- return;
46712
- const $timeline = timelineRef.current;
46713
- if (!$timeline)
46714
- return;
46715
- const x2 = clientX - thumbWidth * 0.5 - rect.left;
46716
- $timeline.scrollLeft = x2 / thumbRatio;
46717
- };
46718
- const onPointerMove = (event) => {
46719
- ({ clientX } = event);
46720
- cancelAnimationFrame(nextFrame);
46721
- nextFrame = requestAnimationFrame(onFrame);
46722
- };
46723
- const onPointerDown = (event) => {
46724
- var _a3;
46725
- if (!isValidEventTarget(event.target))
46726
- return;
46727
- isHeld = true;
46728
- rect = (_a3 = containerRef.current) == null ? void 0 : _a3.getBoundingClientRect();
46729
- onPointerMove(event);
46730
- };
46731
- const onPointerUp = () => {
46732
- isHeld = false;
46733
- rect = void 0;
46734
- };
46735
- const onTouchStart = (event) => {
46736
- if (!isValidEventTarget(event.target))
46737
- return;
46738
- if (event.cancelable) {
46739
- event.preventDefault();
46740
- }
46741
- };
46742
- const onTouchMove = (event) => {
46743
- if (!isHeld)
46744
- return;
46745
- if (event.cancelable) {
46746
- event.preventDefault();
46747
- }
46748
- };
46749
- window.addEventListener("pointerdown", onPointerDown);
46750
- window.addEventListener("pointermove", onPointerMove);
46751
- window.addEventListener("pointerup", onPointerUp);
46752
- window.addEventListener("blur", onPointerUp);
46753
- window.addEventListener("touchstart", onTouchStart, { passive: false });
46754
- window.addEventListener("touchmove", onTouchMove, { passive: false });
46755
- return () => {
46756
- window.removeEventListener("pointerdown", onPointerDown);
46757
- window.removeEventListener("pointermove", onPointerMove);
46758
- window.removeEventListener("pointerup", onPointerUp);
46759
- window.removeEventListener("blur", onPointerUp);
46760
- window.removeEventListener("touchstart", onTouchStart);
46761
- window.removeEventListener("touchmove", onTouchMove);
46762
- cancelAnimationFrame(nextFrame);
46763
- };
46764
- }, [timelineRef, thumbRatio, thumbWidth]);
46765
- reactExports.useEffect(() => {
46766
- const canvas = canvasRef.current;
46767
- const ctx = canvas == null ? void 0 : canvas.getContext("2d");
46768
- if (!canvas || !ctx)
46769
- return;
46770
- const render = () => {
46771
- ctx.resetTransform();
46772
- ctx.clearRect(0, 0, canvas.width, canvas.height);
46773
- ctx.scale(dpi, dpi);
46774
- const gap = 1;
46775
- const height = 3;
46776
- const ratio = (mapWidth - padding * 2) / root2.duration;
46777
- ctx.fillStyle = "#ccc";
46778
- ctx.beginPath();
46779
- for (const row of rows) {
46780
- for (const span of row) {
46781
- const y2 = padding - gap + (gap + height) * span.row;
46782
- if (y2 >= MAP_HEIGHT - height - padding)
46783
- break;
46784
- const x2 = padding + (span.startTime - root2.startTime) * ratio;
46785
- const width = span.duration * ratio;
46786
- ctx.roundRect(x2, y2, width, height, height);
46787
- }
46788
- }
46789
- ctx.fill();
46790
- };
46791
- const nextFrame = requestAnimationFrame(render);
46792
- return () => cancelAnimationFrame(nextFrame);
46793
- }, [dpi, root2, mapWidth, rows]);
46794
- const thumbRef = reactExports.useRef(null);
46795
- const { style: thumbStyle, setStyle: setThumbStyle } = useImmediateStyle(thumbRef);
46796
- reactExports.useLayoutEffect(() => {
46797
- const $timeline = timelineRef.current;
46798
- if (!$timeline)
46799
- return;
46800
- let nextFrame = 0;
46801
- const onFrame = () => {
46802
- setThumbStyle("transform", `translateX(${padding + $timeline.scrollLeft * thumbRatio}px)`);
46803
- };
46804
- onFrame();
46805
- const onScroll = () => {
46806
- cancelAnimationFrame(nextFrame);
46807
- nextFrame = requestAnimationFrame(onFrame);
46808
- };
46809
- $timeline.addEventListener("scroll", onScroll);
46810
- return () => {
46811
- cancelAnimationFrame(nextFrame);
46812
- $timeline.removeEventListener("scroll", onScroll);
46813
- };
46814
- }, [timelineRef, thumbRatio, setThumbStyle]);
46815
- return jsxRuntimeExports.jsxs("div", { className: styles$1.mapContainer, ref: containerRef, style: {
46816
- width: thumbWidth > 0 ? mapWidth : "100%",
46817
- height: MAP_HEIGHT
46818
- }, children: [jsxRuntimeExports.jsx("canvas", { className: styles$1.mapCanvas, height: MAP_HEIGHT * dpi, ref: canvasRef, style: { width: mapWidth, height: MAP_HEIGHT }, width: mapWidth * dpi }), jsxRuntimeExports.jsx("div", { className: styles$1.mapThumb, ref: thumbRef, style: {
46819
- transform: thumbStyle.transform,
46820
- width: thumbWidth > 0 ? thumbWidth : `calc(100% - ${TIMELINE_PADDING * 2}px)`,
46821
- top: 2,
46822
- height: MAP_HEIGHT - 4
46823
- } })] });
46824
- });
46825
- const ChunkRow = ReactExports.memo(function ChunkRow2({ chunk, index: index2 }) {
46826
- return jsxRuntimeExports.jsx("div", { className: "text-[11px] rounded-md border p-3", style: {
46827
- borderColor: "var(--ds-gray-300)",
46828
- backgroundColor: "var(--ds-gray-100)"
46829
- }, children: jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2", children: [jsxRuntimeExports.jsxs("span", { className: "select-none pt-px", style: { color: "var(--ds-gray-500)" }, children: ["[", index2, "]"] }), jsxRuntimeExports.jsx("div", { className: "min-w-0 flex-1", children: typeof chunk.value === "string" ? jsxRuntimeExports.jsx("span", { className: "whitespace-pre-wrap break-words", style: { color: "var(--ds-gray-1000)" }, children: chunk.value }) : jsxRuntimeExports.jsx(DataInspector, { data: chunk.value, expandLevel: 1 }) })] }) });
45810
+ const ChunkRow = ReactExports.memo(function ChunkRow2({ chunk }) {
45811
+ return jsxRuntimeExports.jsxs("div", { className: "flex w-full items-start gap-1 border-b border-gray-alpha-400 px-3 py-2", children: [jsxRuntimeExports.jsx("div", { className: "min-w-0 flex-1", children: typeof chunk.value === "string" ? jsxRuntimeExports.jsx("span", { className: "whitespace-pre-wrap break-words text-label-12 font-mono text-gray-1000", children: chunk.value }) : jsxRuntimeExports.jsx(DataInspector, { data: chunk.value, expandLevel: 1 }) }), jsxRuntimeExports.jsx(CopyButton, { copyText: serializeForClipboard(chunk.value), ariaLabel: "Copy chunk", className: "shrink-0 -mr-1 [&>div]:h-4 [&>div]:w-4 [&_svg]:h-4 [&_svg]:w-4" })] });
46830
45812
  });
46831
- function StreamSkeleton() {
46832
- return jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 animate-in fade-in", children: [jsxRuntimeExports.jsx(Skeleton$1, { style: { width: 120, height: 16, borderRadius: 4 } }), [1, 2, 3, 4].map((i) => jsxRuntimeExports.jsx(Skeleton$1, { style: { height: 56, borderRadius: 6 } }, i))] });
46833
- }
46834
45813
  function StreamViewer({ streamId: _streamId, chunks, isLive, error, isLoading, onScrollEnd }) {
46835
45814
  const virtuosoRef = reactExports.useRef(null);
46836
45815
  const prevChunkCountRef = reactExports.useRef(0);
@@ -46845,17 +45824,9 @@ function StreamViewer({ streamId: _streamId, chunks, isLive, error, isLoading, o
46845
45824
  prevChunkCountRef.current = chunks.length;
46846
45825
  }, [chunks.length]);
46847
45826
  if (isLoading && chunks.length === 0) {
46848
- return jsxRuntimeExports.jsx("div", { className: "flex flex-col h-full", children: jsxRuntimeExports.jsx(StreamSkeleton, {}) });
46849
- }
46850
- return jsxRuntimeExports.jsxs("div", { className: "flex flex-col h-full", children: [isLive && jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 mb-2 px-1", children: [jsxRuntimeExports.jsx("span", { className: "inline-block w-2 h-2 rounded-full", style: { backgroundColor: "var(--ds-green-600)" } }), jsxRuntimeExports.jsx("span", { className: "text-xs", style: { color: "var(--ds-green-700)" }, children: "Live" })] }), chunks.length > 0 && jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mb-2 px-1", children: [jsxRuntimeExports.jsx("span", { className: "text-[13px] font-medium", style: { color: "var(--ds-gray-900)" }, children: "Stream Chunks" }), jsxRuntimeExports.jsxs("span", { className: "text-xs tabular-nums", style: { color: "var(--ds-gray-600)" }, children: ["(", chunks.length, ")"] })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0", children: error ? jsxRuntimeExports.jsxs("div", { className: "text-[11px] rounded-md border p-3", style: {
46851
- borderColor: "var(--ds-red-300)",
46852
- backgroundColor: "var(--ds-red-100)",
46853
- color: "var(--ds-red-700)"
46854
- }, children: [jsxRuntimeExports.jsx("div", { children: "Error reading stream:" }), jsxRuntimeExports.jsx("div", { children: error })] }) : chunks.length === 0 ? jsxRuntimeExports.jsx("div", { className: "text-[11px] rounded-md border p-3", style: {
46855
- borderColor: "var(--ds-gray-300)",
46856
- backgroundColor: "var(--ds-gray-100)",
46857
- color: "var(--ds-gray-600)"
46858
- }, children: isLive ? "Waiting for stream data..." : "Stream is empty" }) : jsxRuntimeExports.jsx(Yr, { ref: virtuosoRef, totalCount: chunks.length, overscan: 10, endReached: () => onScrollEnd == null ? void 0 : onScrollEnd(), itemContent: (index2) => jsxRuntimeExports.jsx("div", { style: { paddingBottom: 8 }, children: jsxRuntimeExports.jsx(ChunkRow, { chunk: chunks[index2], index: index2 }) }), style: { flex: 1, minHeight: 0 } }) })] });
45827
+ return jsxRuntimeExports.jsx(StreamViewerSkeleton, {});
45828
+ }
45829
+ return jsxRuntimeExports.jsxs("div", { className: "flex h-full w-full flex-col overflow-hidden bg-background-100", children: [jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center gap-1.5 border-b border-gray-alpha-400 px-3", children: isLive && jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: "inline-block h-2 w-2 rounded-full bg-green-600" }), jsxRuntimeExports.jsx("span", { className: "text-label-12 text-green-700", children: "Live" })] }) }), jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0", children: error ? jsxRuntimeExports.jsxs("div", { className: "border-b border-red-400 bg-red-100 px-3 py-2 text-label-12 text-red-900", children: [jsxRuntimeExports.jsx("div", { children: "Error reading stream:" }), jsxRuntimeExports.jsx("div", { children: error })] }) : chunks.length === 0 ? jsxRuntimeExports.jsx("div", { className: "flex h-10 items-center border-b border-gray-alpha-400 bg-background-200 px-3 text-label-12 text-gray-900", children: isLive ? "Waiting for stream data..." : "Stream is empty" }) : jsxRuntimeExports.jsx(Yr, { ref: virtuosoRef, totalCount: chunks.length, overscan: 10, endReached: () => onScrollEnd == null ? void 0 : onScrollEnd(), itemContent: (index2) => jsxRuntimeExports.jsx("div", { className: "w-full", children: jsxRuntimeExports.jsx(ChunkRow, { chunk: chunks[index2] }) }), style: { flex: 1, minHeight: 0 } }) })] });
46859
45830
  }
46860
45831
  const iconButtonVariants = cva([
46861
45832
  "m-0 inline-flex shrink-0 appearance-none items-center justify-center border-0 bg-transparent p-0 align-baseline font-inherit no-underline [background:none] [-webkit-appearance:none] [-webkit-tap-highlight-color:transparent]",
@@ -47028,10 +45999,10 @@ function getPathValue(source, path2) {
47028
45999
  if (!source || typeof source !== "object")
47029
46000
  return void 0;
47030
46001
  let current = source;
47031
- for (const segment2 of path2.split(".")) {
47032
- if (!segment2)
46002
+ for (const segment of path2.split(".")) {
46003
+ if (!segment)
47033
46004
  return void 0;
47034
- current = getOwnProperty(current, segment2);
46005
+ current = getOwnProperty(current, segment);
47035
46006
  if (current === void 0)
47036
46007
  return void 0;
47037
46008
  }
@@ -47051,6 +46022,9 @@ function valueToSearchString(value) {
47051
46022
  return String(value);
47052
46023
  }
47053
46024
  }
46025
+ function getHighResInMs([seconds, nanoseconds]) {
46026
+ return seconds * 1e3 + nanoseconds / 1e6;
46027
+ }
47054
46028
  function computeRootBounds(spans) {
47055
46029
  let minStart = Number.POSITIVE_INFINITY;
47056
46030
  let maxEnd = Number.NEGATIVE_INFINITY;
@@ -47139,20 +46113,20 @@ function computeTimeMarkers(viewDuration, offset2) {
47139
46113
  const interval = pickInterval(viewDuration, maxTicks);
47140
46114
  const fractionDigits = interval >= MS_IN_SECOND ? 0 : Math.ceil(-Math.log10(interval / MS_IN_SECOND));
47141
46115
  const firstTick = Math.ceil(offset2 / interval) * interval;
47142
- const markers2 = [];
46116
+ const markers = [];
47143
46117
  for (let t = firstTick; t <= offset2 + viewDuration; t += interval) {
47144
46118
  const position2 = (t - offset2) / viewDuration;
47145
46119
  if (position2 < -0.01 || position2 > 1.01)
47146
46120
  continue;
47147
- markers2.push({
46121
+ markers.push({
47148
46122
  position: Math.min(Math.max(position2, 0), 1),
47149
46123
  label: fractionDigits === 0 ? formatDuration(Math.abs(t), true) : formatDurationPrecise(Math.abs(t), fractionDigits),
47150
46124
  value: t
47151
46125
  });
47152
- if (markers2.length >= MAX_MARKERS)
46126
+ if (markers.length >= MAX_MARKERS)
47153
46127
  break;
47154
46128
  }
47155
- return markers2;
46129
+ return markers;
47156
46130
  }
47157
46131
  function toViewportFrac(ms2, viewStart, range) {
47158
46132
  return Math.min(Math.max((ms2 - viewStart) / range, 0), 1);
@@ -47241,10 +46215,10 @@ function getResourceColor(resource) {
47241
46215
  function clampFraction(value) {
47242
46216
  return Math.max(0, Math.min(1, value));
47243
46217
  }
47244
- function timeToFraction(time2, spanStart, spanDuration2) {
47245
- if (spanDuration2 <= 0)
46218
+ function timeToFraction(time2, spanStart, spanDuration) {
46219
+ if (spanDuration <= 0)
47246
46220
  return 0;
47247
- return clampFraction((time2 - spanStart) / spanDuration2);
46221
+ return clampFraction((time2 - spanStart) / spanDuration);
47248
46222
  }
47249
46223
  function sortedEventMarks(events, relevantNames) {
47250
46224
  return events.filter((e) => relevantNames.includes(e.name)).map((e) => ({ time: getHighResInMs(e.timestamp), type: e.name })).sort((a2, b2) => a2.time - b2.time);
@@ -47422,12 +46396,12 @@ function computeSpanMarkers(span) {
47422
46396
  timeMs: mark2.time
47423
46397
  }));
47424
46398
  }
47425
- function computeOffscreenMarkers(markers2, visibleStartMs, visibleEndMs) {
46399
+ function computeOffscreenMarkers(markers, visibleStartMs, visibleEndMs) {
47426
46400
  let leftCount = 0;
47427
46401
  let rightCount = 0;
47428
46402
  let nearestLeft = Number.NEGATIVE_INFINITY;
47429
46403
  let nearestRight = Number.POSITIVE_INFINITY;
47430
- for (const { timeMs } of markers2) {
46404
+ for (const { timeMs } of markers) {
47431
46405
  if (timeMs < visibleStartMs) {
47432
46406
  leftCount++;
47433
46407
  if (timeMs > nearestLeft)
@@ -47515,11 +46489,11 @@ function scrollRowIntoView(listEl, index2, rowHeight, opts) {
47515
46489
  behavior: opts == null ? void 0 : opts.behavior
47516
46490
  });
47517
46491
  }
47518
- function projectMarkers(markers2, visibleStartMs, visibleEndMs) {
46492
+ function projectMarkers(markers, visibleStartMs, visibleEndMs) {
47519
46493
  const visibleDurationMs = visibleEndMs - visibleStartMs;
47520
46494
  if (visibleDurationMs <= 0)
47521
46495
  return [];
47522
- return markers2.flatMap((m2) => {
46496
+ return markers.flatMap((m2) => {
47523
46497
  if (m2.timeMs < visibleStartMs || m2.timeMs > visibleEndMs) {
47524
46498
  return [];
47525
46499
  }
@@ -47547,8 +46521,8 @@ function cullCollidingMarkers(projected, pixelWidth) {
47547
46521
  function MarkerTick({ className }) {
47548
46522
  return jsxRuntimeExports.jsx("span", { className: cn$4("block w-[3px] rounded-full bg-gray-1000", className) });
47549
46523
  }
47550
- function MarkerLayer({ markers: markers2 }) {
47551
- return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: markers2.map((m2) => jsxRuntimeExports.jsx("span", { className: "pointer-events-auto absolute top-0 bottom-0 z-10 flex w-8 -translate-x-1/2 items-center justify-center", style: { left: `clamp(8px, ${m2.leftPct}%, calc(100% - 8px))` }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: m2.timeMs, children: jsxRuntimeExports.jsx("span", { className: "flex h-6 w-8 items-center justify-center", children: jsxRuntimeExports.jsx(MarkerTick, { className: "h-3" }) }) }) }, m2.timeMs)) });
46524
+ function MarkerLayer({ markers }) {
46525
+ return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: markers.map((m2) => jsxRuntimeExports.jsx("span", { className: "pointer-events-auto absolute top-0 bottom-0 z-10 flex w-8 -translate-x-1/2 items-center justify-center", style: { left: `clamp(8px, ${m2.leftPct}%, calc(100% - 8px))` }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: m2.timeMs, children: jsxRuntimeExports.jsx("span", { className: "flex h-6 w-8 items-center justify-center", children: jsxRuntimeExports.jsx(MarkerTick, { className: "h-3" }) }) }) }, m2.timeMs)) });
47552
46526
  }
47553
46527
  function OffscreenMarkerIndicator({ direction, count: count2, targetMs, onReveal }) {
47554
46528
  const Chevron = direction === "right" ? ArrowRight : ArrowLeft;
@@ -47702,9 +46676,9 @@ const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, v
47702
46676
  const baseSegments = reactExports.useMemo(() => computeSpanSegments(span), [span]);
47703
46677
  const segments = reactExports.useMemo(() => geometry.mode.kind === "full" ? projectSegments(baseSegments, startMs, totalDurationMs, geometry) : [], [geometry, baseSegments, startMs, totalDurationMs]);
47704
46678
  const baseMarkers = reactExports.useMemo(() => computeSpanMarkers(span), [span]);
47705
- const markers2 = reactExports.useMemo(() => geometry.mode.kind === "full" ? cullCollidingMarkers(projectMarkers(baseMarkers, geometry.visibleStartMs, geometry.visibleEndMs), geometry.visiblePixelWidth) : [], [geometry, baseMarkers]);
46679
+ const markers = reactExports.useMemo(() => geometry.mode.kind === "full" ? cullCollidingMarkers(projectMarkers(baseMarkers, geometry.visibleStartMs, geometry.visibleEndMs), geometry.visiblePixelWidth) : [], [geometry, baseMarkers]);
47706
46680
  const offscreen = reactExports.useMemo(() => geometry.mode.kind === "full" ? computeOffscreenMarkers(baseMarkers, geometry.visibleStartMs, geometry.visibleEndMs) : { left: null, right: null }, [geometry, baseMarkers]);
47707
- const hasMarkers = markers2.length > 0 || offscreen.left !== null || offscreen.right !== null;
46681
+ const hasMarkers = markers.length > 0 || offscreen.left !== null || offscreen.right !== null;
47708
46682
  const isErrored = isSpanErrored(span);
47709
46683
  const colors = getResourceColor(span.resource);
47710
46684
  const fallbackBg = isErrored ? colors.errorBg ?? "var(--ds-red-200)" : colors.bg;
@@ -47714,7 +46688,7 @@ const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, v
47714
46688
  const handleClick = reactExports.useCallback(() => {
47715
46689
  onSelect(span.spanId);
47716
46690
  }, [onSelect, span.spanId]);
47717
- return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: cn$4("group/timeline-row h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200 transition-opacity", isDimmed && "opacity-35"), onClick: handleClick, children: jsxRuntimeExports.jsxs("div", { className: "absolute inset-y-0", style: TIMELINE_INSET_STYLE, children: [jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 h-6 -translate-y-1/2 overflow-hidden rounded-[0.25rem]", style: getBarPositionStyle(geometry), children: geometry.mode.kind === "arrow" ? jsxRuntimeExports.jsx(BoundaryArrow, { direction: geometry.mode.direction }) : geometry.mode.kind === "tiny" ? jsxRuntimeExports.jsx("div", { className: "h-6 rounded-[0.25rem] border", style: { background: fallbackBg, borderColor: fallbackBorder } }) : segments.length > 0 ? jsxRuntimeExports.jsx(SegmentBar, { segments, showLabels: !hasMarkers }) : jsxRuntimeExports.jsx(PlainBar, { bg: fallbackBg, border: fallbackBorder, label: showTotalLabel ? totalLabel : null }) }), hasMarkers ? jsxRuntimeExports.jsxs("div", { className: "pointer-events-none absolute top-1/2 h-6 -translate-y-1/2", style: getBarPositionStyle(geometry), children: [markers2.length > 0 ? jsxRuntimeExports.jsx(MarkerLayer, { markers: markers2 }) : null, offscreen.left ? jsxRuntimeExports.jsx(OffscreenMarkerIndicator, { direction: "left", count: offscreen.left.count, targetMs: offscreen.left.nearestMs, onReveal: onRevealTime }) : null, offscreen.right ? jsxRuntimeExports.jsx(OffscreenMarkerIndicator, { direction: "right", count: offscreen.right.count, targetMs: offscreen.right.nearestMs, onReveal: onRevealTime }) : null, showTotalLabel ? jsxRuntimeExports.jsx(DurationLabel, {
46691
+ return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: cn$4("group/timeline-row h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200 transition-opacity", isDimmed && "opacity-35"), onClick: handleClick, children: jsxRuntimeExports.jsxs("div", { className: "absolute inset-y-0", style: TIMELINE_INSET_STYLE, children: [jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 h-6 -translate-y-1/2 overflow-hidden rounded-[0.25rem]", style: getBarPositionStyle(geometry), children: geometry.mode.kind === "arrow" ? jsxRuntimeExports.jsx(BoundaryArrow, { direction: geometry.mode.direction }) : geometry.mode.kind === "tiny" ? jsxRuntimeExports.jsx("div", { className: "h-6 rounded-[0.25rem] border", style: { background: fallbackBg, borderColor: fallbackBorder } }) : segments.length > 0 ? jsxRuntimeExports.jsx(SegmentBar, { segments, showLabels: !hasMarkers }) : jsxRuntimeExports.jsx(PlainBar, { bg: fallbackBg, border: fallbackBorder, label: showTotalLabel ? totalLabel : null }) }), hasMarkers ? jsxRuntimeExports.jsxs("div", { className: "pointer-events-none absolute top-1/2 h-6 -translate-y-1/2", style: getBarPositionStyle(geometry), children: [markers.length > 0 ? jsxRuntimeExports.jsx(MarkerLayer, { markers }) : null, offscreen.left ? jsxRuntimeExports.jsx(OffscreenMarkerIndicator, { direction: "left", count: offscreen.left.count, targetMs: offscreen.left.nearestMs, onReveal: onRevealTime }) : null, offscreen.right ? jsxRuntimeExports.jsx(OffscreenMarkerIndicator, { direction: "right", count: offscreen.right.count, targetMs: offscreen.right.nearestMs, onReveal: onRevealTime }) : null, showTotalLabel ? jsxRuntimeExports.jsx(DurationLabel, {
47718
46692
  label: totalLabel,
47719
46693
  // Shift clear of the left edge indicator so it isn't covered.
47720
46694
  className: offscreen.left ? "pl-10" : void 0
@@ -47745,10 +46719,10 @@ const DeltaMeasureLine = reactExports.memo(function DeltaMeasureLine2({ delta, a
47745
46719
  height: guideBottom - guideTop
47746
46720
  } }), jsxRuntimeExports.jsx("div", { className: "absolute h-px bg-amber-800", style: { left: startX, width: Math.max(endX - startX, 1), top: lineY } }), jsxRuntimeExports.jsx("span", { className: cn$4("absolute -translate-y-1/2 font-mono text-[10px] font-medium leading-none tabular-nums whitespace-nowrap rounded-xs bg-background-100 px-1 py-0.5 text-amber-800", labelPlacement.translate), style: { left: labelPlacement.left, top: lineY }, children: label })] });
47747
46721
  });
47748
- function TimelineHeader({ markers: markers2, hoverInfo: hoverInfo2 }) {
47749
- return jsxRuntimeExports.jsx("div", { className: "relative bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-end px-4 pb-1", children: jsxRuntimeExports.jsxs("div", { className: "relative h-full flex-1", children: [markers2.map((m2) => jsxRuntimeExports.jsx("span", { className: "absolute bottom-1 font-mono text-xs font-normal leading-4 text-gray-900 whitespace-nowrap", style: { left: `${m2.position * 100}%` }, children: m2.label }, String(m2.value))), hoverInfo2 && jsxRuntimeExports.jsx("span", { className: "absolute top-1 pointer-events-none z-10 font-mono text-[11px] leading-4 text-gray-1000 whitespace-nowrap bg-background-100 border border-gray-alpha-400 rounded px-1 -translate-x-1/2", style: { left: `${hoverInfo2.fraction * 100}%` }, children: hoverInfo2.label })] }) });
46722
+ function TimelineHeader({ markers, hoverInfo }) {
46723
+ return jsxRuntimeExports.jsx("div", { className: "relative bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-end px-4 pb-1", children: jsxRuntimeExports.jsxs("div", { className: "relative h-full flex-1", children: [markers.map((m2) => jsxRuntimeExports.jsx("span", { className: "absolute bottom-1 text-label-12-mono text-gray-900 whitespace-nowrap", style: { left: `${m2.position * 100}%` }, children: m2.label }, String(m2.value))), hoverInfo && jsxRuntimeExports.jsx("span", { className: "absolute top-1 pointer-events-none z-10 font-mono text-[11px] leading-4 text-gray-1000 whitespace-nowrap bg-background-100 border border-gray-alpha-400 rounded px-1 -translate-x-1/2", style: { left: `${hoverInfo.fraction * 100}%` }, children: hoverInfo.label })] }) });
47750
46724
  }
47751
- function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, searchResult, onSelect, onRevealTime, hover, altHeld = false }) {
46725
+ function Timeline({ spans, viewStart, viewEnd, markers, selectedId, searchResult, onSelect, onRevealTime, hover, altHeld = false }) {
47752
46726
  const containerRef = reactExports.useRef(null);
47753
46727
  const [containerWidth, setContainerWidth] = reactExports.useState(0);
47754
46728
  const viewDuration = viewEnd - viewStart;
@@ -47787,9 +46761,9 @@ function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, se
47787
46761
  const delta = computeSpanDelta(anchorSpan, hoveredSpan, viewStart, viewEnd);
47788
46762
  return delta ? { delta, anchorRowIndex: anchorIndex, hoveredRowIndex: hover.rowIndex } : null;
47789
46763
  }, [altHeld, anchorIndex, hover, spans, viewStart, viewEnd]);
47790
- return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: "relative h-full overflow-hidden", style: { minHeight: spans.length * ROW_HEIGHT_PX }, children: [jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: markers2.map((marker2) => (
46764
+ return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: "relative h-full overflow-hidden", style: { minHeight: spans.length * ROW_HEIGHT_PX }, children: [jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: markers.map((marker) => (
47791
46765
  // Skip the "0s" origin marker since the left edge already implies it.
47792
- Math.abs(marker2.value) > 1e-6 ? jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-300", style: { left: `${marker2.position * 100}%` } }, String(marker2.value)) : null
46766
+ Math.abs(marker.value) > 1e-6 ? jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-300", style: { left: `${marker.position * 100}%` } }, String(marker.value)) : null
47793
46767
  )) }), hover != null && jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0 pointer-events-none z-10", style: TIMELINE_INSET_STYLE, children: jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-500", style: { left: `${hover.fraction * 100}%` } }) }), jsxRuntimeExports.jsx("div", { style: { transform: `translateY(${start * ROW_HEIGHT_PX}px)` }, children: spans.slice(start, end).map((span) => jsxRuntimeExports.jsx(TimelineBar, { span, viewStart, viewDuration, containerWidth: timelineWidth, isSelected: selectedId === span.spanId, isDimmed: isSpanDimmedBySearch(span.spanId, searchResult), onSelect, onRevealTime }, span.spanId)) }), altHeld && anchorIndex < 0 && jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: gapMeasurements.map((gap) => jsxRuntimeExports.jsx(DeltaMeasureLine, { ...gap, timelineWidth }, gap.anchorRowIndex)) }), measurement && jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none z-20", style: TIMELINE_INSET_STYLE, children: jsxRuntimeExports.jsx(DeltaMeasureLine, { ...measurement, timelineWidth }) })] });
47794
46768
  }
47795
46769
  const CANVAS_PAD_Y_PX = 6;
@@ -50379,9 +49353,13 @@ defaultEncoder.encodeAsAsyncIterable;
50379
49353
  const REUSE_BUFFER_MODE = 512;
50380
49354
  const RESET_BUFFER_MODE = 1024;
50381
49355
  const THROW_ON_ITERABLE = 2048;
49356
+ function apiBase() {
49357
+ if (typeof window === "undefined") return "";
49358
+ return window.__WORKFLOW_BASENAME__ ?? "";
49359
+ }
50382
49360
  async function rpc(method, params) {
50383
49361
  var _a3;
50384
- const res = await fetch("/api/rpc", {
49362
+ const res = await fetch(`${apiBase()}/api/rpc`, {
50385
49363
  method: "POST",
50386
49364
  headers: {
50387
49365
  "Content-Type": "application/cbor",
@@ -50471,126 +49449,131 @@ const mermaid3ZIDBTTL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
50471
49449
  Mermaid: Nt
50472
49450
  }, Symbol.toStringTag, { value: "Module" }));
50473
49451
  export {
50474
- Spinner as $,
49452
+ CollapsibleTrigger as $,
50475
49453
  Anchor as A,
50476
49454
  Button as B,
50477
- ChevronRight as C,
49455
+ Check as C,
50478
49456
  DEFAULT_PAGE_SIZE as D,
50479
- useControllableState as E,
50480
- Root2 as F,
50481
- Arrow as G,
50482
- ChevronDown as H,
50483
- useComposedRefs as I,
50484
- fetchRun as J,
49457
+ createSlot as E,
49458
+ Content as F,
49459
+ useControllableState as G,
49460
+ Root2 as H,
49461
+ Arrow as I,
49462
+ ChevronDown as J,
50485
49463
  Ks as K,
50486
- LoaderCircle as L,
50487
- cva as M,
50488
- Presence as N,
50489
- createContext2 as O,
49464
+ useComposedRefs as L,
49465
+ fetchRun as M,
49466
+ cva as N,
49467
+ Presence as O,
50490
49468
  Primitive as P,
50491
49469
  Qe as Q,
50492
49470
  R,
50493
49471
  ServerConfigProvider as S,
50494
49472
  Tooltip as T,
50495
- fetchWorkflowsManifest as U,
49473
+ createContext2 as U,
50496
49474
  VISUALLY_HIDDEN_STYLES as V,
50497
- cn$4 as W,
50498
- DataInspector as X,
50499
- DecryptClickContext as Y,
50500
- Button$1 as Z,
49475
+ fetchWorkflowsManifest as W,
49476
+ cn$4 as X,
49477
+ CopyableDataBlock as Y,
49478
+ CollapsibleRoot as Z,
50501
49479
  __vitePreload as _,
50502
49480
  TooltipTrigger as a,
50503
- fetchEvent as a$,
50504
- Lock as a0,
50505
- CollapsibleRoot as a1,
50506
- CollapsibleTrigger as a2,
50507
- CollapsibleContent as a3,
50508
- RESERVED_ATTRIBUTE_KEY_PREFIX as a4,
50509
- ContextCardProvider as a5,
50510
- Skeleton$1 as a6,
49481
+ Slot as a$,
49482
+ CollapsibleContent as a0,
49483
+ CopyButton as a1,
49484
+ RESERVED_ATTRIBUTE_KEY_PREFIX as a2,
49485
+ Spinner as a3,
49486
+ ContextCardProvider as a4,
49487
+ Skeleton as a5,
49488
+ DecryptClickContext as a6,
50511
49489
  Yr as a7,
50512
49490
  isEncryptedMarker$1 as a8,
50513
49491
  TimestampTooltip as a9,
50514
- getSpanDurationMs as aA,
50515
- isSpanErrored as aB,
50516
- formatDurationPrecise as aC,
50517
- TooltipProvider as aD,
50518
- ActiveSpanProvider as aE,
50519
- useReducedMotion as aF,
50520
- searchSpans as aG,
50521
- computeRootBounds as aH,
50522
- computeTimeMarkers as aI,
50523
- clampViewportToRoot as aJ,
50524
- getHighResInMs as aK,
50525
- scrollRowIntoView as aL,
50526
- TIMELINE_PADDING_PX as aM,
50527
- Minimap as aN,
50528
- Timeline as aO,
50529
- TimelineHeader as aP,
50530
- wheelZoomScaleFactor as aQ,
50531
- wheelDeltaToPixels as aR,
50532
- SidebarDataProvider as aS,
50533
- fetchHook as aT,
50534
- hydrateResourceIOAsync as aU,
50535
- fetchStep as aV,
50536
- hydrateResourceIO as aW,
50537
- fetchStreams as aX,
50538
- Slot as aY,
50539
- Slottable as aZ,
50540
- buttonVariants as a_,
49492
+ isSpanDimmedBySearch as aA,
49493
+ ROW_HEIGHT_PX as aB,
49494
+ getSpanDurationMs as aC,
49495
+ isSpanErrored as aD,
49496
+ formatDurationPrecise as aE,
49497
+ TooltipProvider as aF,
49498
+ ActiveSpanProvider as aG,
49499
+ useReducedMotion as aH,
49500
+ searchSpans as aI,
49501
+ computeRootBounds as aJ,
49502
+ computeTimeMarkers as aK,
49503
+ clampViewportToRoot as aL,
49504
+ getHighResInMs as aM,
49505
+ scrollRowIntoView as aN,
49506
+ TIMELINE_PADDING_PX as aO,
49507
+ Minimap as aP,
49508
+ Timeline as aQ,
49509
+ TimelineHeader as aR,
49510
+ wheelZoomScaleFactor as aS,
49511
+ wheelDeltaToPixels as aT,
49512
+ SidebarDataProvider as aU,
49513
+ fetchHook as aV,
49514
+ hydrateResourceIOAsync as aW,
49515
+ fetchStep as aX,
49516
+ hydrateResourceIO as aY,
49517
+ fetchStreams as aZ,
49518
+ apiBase as a_,
50541
49519
  formatDuration as aa,
50542
- isHookLifecycleEventType as ab,
50543
- isTerminalStepEventType as ac,
50544
- isWaitEventType as ad,
50545
- isStepEventType as ae,
50546
- _r as af,
50547
- RunClickContext as ag,
50548
- StreamClickContext as ah,
50549
- Collapsible as ai,
50550
- isExpiredMarker as aj,
50551
- isDoStreamStep as ak,
50552
- extractConversation as al,
50553
- getEventDataRefFields as am,
50554
- hasEncryptedFields as an,
50555
- useSidebarDataOptional as ao,
50556
- isTerminalWorkflowRunStatus as ap,
50557
- clsx as aq,
50558
- useActiveSpan as ar,
50559
- useSidebarData as as,
50560
- Tooltip$1 as at,
50561
- TooltipTrigger$1 as au,
50562
- IconButton as av,
50563
- TooltipContent$1 as aw,
50564
- useRowWindow as ax,
50565
- isSpanDimmedBySearch as ay,
50566
- ROW_HEIGHT_PX as az,
49520
+ DataInspector as ab,
49521
+ _r as ac,
49522
+ isHookLifecycleEventType as ad,
49523
+ isTerminalStepEventType as ae,
49524
+ isWaitEventType as af,
49525
+ isStepEventType as ag,
49526
+ RunClickContext as ah,
49527
+ StreamClickContext as ai,
49528
+ Collapsible as aj,
49529
+ isExpiredMarker as ak,
49530
+ isDoStreamStep as al,
49531
+ extractConversation as am,
49532
+ EncryptedDataBlock as an,
49533
+ getEventDataRefFields as ao,
49534
+ hasEncryptedFields as ap,
49535
+ useSidebarDataOptional as aq,
49536
+ isTerminalWorkflowRunStatus as ar,
49537
+ clsx as as,
49538
+ useActiveSpan as at,
49539
+ useSidebarData as au,
49540
+ Tooltip$1 as av,
49541
+ TooltipTrigger$1 as aw,
49542
+ IconButton as ax,
49543
+ TooltipContent$1 as ay,
49544
+ useRowWindow as az,
50567
49545
  TooltipContent as b,
50568
- fetchEventsByCorrelationId as b0,
50569
- isEncryptedData as b1,
50570
- hydrateData as b2,
50571
- decrypt as b3,
50572
- deriveRunPayloadKeys as b4,
50573
- getWebRevivers as b5,
50574
- LIVE_UPDATE_INTERVAL_MS as b6,
50575
- getEncryptionKeyForRun as b7,
50576
- StreamViewer as b8,
50577
- composeRefs as b9,
50578
- useFloating as ba,
50579
- offset as bb,
50580
- shift as bc,
50581
- limitShift as bd,
50582
- flip as be,
50583
- size as bf,
50584
- arrow as bg,
50585
- hide as bh,
50586
- autoUpdate as bi,
50587
- VERCEL_403_ERROR_MESSAGE as bj,
50588
- cancelRun as bk,
50589
- reenqueueRun as bl,
50590
- wakeUpRun as bm,
50591
- resumeHook as bn,
50592
- fetchHookToken as bo,
50593
- recreateRun as bp,
49546
+ Slottable as b0,
49547
+ buttonVariants as b1,
49548
+ fetchEvent as b2,
49549
+ fetchEventsByCorrelationId as b3,
49550
+ isEncryptedData as b4,
49551
+ hydrateData as b5,
49552
+ decrypt as b6,
49553
+ deriveRunPayloadKeys as b7,
49554
+ getWebRevivers as b8,
49555
+ LIVE_UPDATE_INTERVAL_MS as b9,
49556
+ getEncryptionKeyForRun as ba,
49557
+ StreamViewerSkeleton as bb,
49558
+ Lock as bc,
49559
+ StreamViewer as bd,
49560
+ composeRefs as be,
49561
+ useFloating as bf,
49562
+ offset as bg,
49563
+ shift as bh,
49564
+ limitShift as bi,
49565
+ flip as bj,
49566
+ size as bk,
49567
+ arrow as bl,
49568
+ hide as bm,
49569
+ autoUpdate as bn,
49570
+ VERCEL_403_ERROR_MESSAGE as bo,
49571
+ cancelRun as bp,
49572
+ reenqueueRun as bq,
49573
+ wakeUpRun as br,
49574
+ resumeHook as bs,
49575
+ fetchHookToken as bt,
49576
+ recreateRun as bu,
50594
49577
  createLucideIcon as c,
50595
49578
  runHealthCheck as d,
50596
49579
  cn as e,
@@ -50600,19 +49583,19 @@ export {
50600
49583
  fetchRuns as i,
50601
49584
  fetchHooks as j,
50602
49585
  getPaginationDisplay as k,
50603
- fetchEvents as l,
50604
- useCallbackRef as m,
50605
- useComposedRefs$1 as n,
50606
- composeEventHandlers as o,
50607
- useLayoutEffect2 as p,
50608
- Portal$1 as q,
49586
+ Copy as l,
49587
+ ChevronRight as m,
49588
+ fetchEvents as n,
49589
+ useCallbackRef as o,
49590
+ useComposedRefs$1 as p,
49591
+ composeEventHandlers as q,
50609
49592
  registerZstdDecoder as r,
50610
- useId as s,
49593
+ useLayoutEffect2 as s,
50611
49594
  toast as t,
50612
49595
  useServerConfig as u,
50613
- createPopperScope as v,
50614
- DismissableLayer as w,
50615
- createContextScope as x,
50616
- createSlot as y,
50617
- Content as z
49596
+ Portal$1 as v,
49597
+ useId as w,
49598
+ createPopperScope as x,
49599
+ DismissableLayer as y,
49600
+ createContextScope as z
50618
49601
  };