@workflow/web 4.1.33 → 4.1.35

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 +11 -34
  2. package/build/client/assets/{encryption-Cu4jq70Y.js → encryption-BhH0xZid.js} +2 -2
  3. package/build/client/assets/{entry.client-C7XgFTHI.js → entry.client-CaUKWFDB.js} +13 -35
  4. package/build/client/assets/{highlighted-body-B3W2YXNL-CK5bxjZc.js → highlighted-body-B3W2YXNL-D5wXP22M.js} +2 -2
  5. package/build/client/assets/{home-vGjXNC_q.js → home-CjokEfcx.js} +92 -164
  6. package/build/client/assets/{index-BQ-Xa8kF.js → index-BbkkdbNz.js} +78 -149
  7. package/build/client/assets/{index-CXBr7N7m.js → index-DY3Cy2uF.js} +20 -23
  8. package/build/client/assets/{manifest-5d325d67.js → manifest-cbe27963.js} +1 -1
  9. package/build/client/assets/{mermaid-3ZIDBTTL-CCVNMOf9.js → mermaid-3ZIDBTTL-8p93TMNC.js} +315 -479
  10. package/build/client/assets/mermaid-3ZIDBTTL-DHICBbcE.css +1 -0
  11. package/build/client/assets/{root-DjobWPwY.js → root-D-ZCwNhI.js} +5 -35
  12. package/build/client/assets/root-DzrclYrK.css +1 -0
  13. package/build/client/assets/{run-detail-nLEl00wq.js → run-detail-H0o7UsyU.js} +141 -205
  14. package/build/client/assets/server-build-DMZyIeNn.css +1 -0
  15. package/build/client/assets/{worker-CqHKTA7D.js → worker-DxRAeS-i.js} +2 -2
  16. package/build/client/assets/{workflow-graph-viewer-CTw33ANm.js → workflow-graph-viewer-C-MZ2XPV.js} +466 -723
  17. package/build/server/assets/{app-DFeBwpXW.js → app-BX9dMsx4.js} +67 -153
  18. package/build/server/assets/{highlighted-body-B3W2YXNL-DucHV668.js → highlighted-body-B3W2YXNL-CHc9_Xzp.js} +2 -2
  19. package/build/server/assets/{index-BUlN7QFn.js → index-BC_EEwAS.js} +2 -2
  20. package/build/server/assets/{index-DOJ452m_.js → index-BNN2zck_.js} +3 -3
  21. package/build/server/assets/{index-CMfOrLiJ.js → index-C-y3EhAf.js} +25 -32
  22. package/build/server/assets/{mermaid-3ZIDBTTL-DCNPJ1qb.js → mermaid-3ZIDBTTL-CP_u5jLd.js} +2 -2
  23. package/build/server/assets/{server-build-D0sUavwG.js → server-build-C0EUGBN0.js} +6483 -7670
  24. package/build/server/assets/{token-v98bLjzH.js → token-DYdYwRhs.js} +6 -6
  25. package/build/server/assets/{token-util-BoIjkgfM.js → token-util-BZHkMK_T.js} +2 -2
  26. package/build/server/index.js +1 -1
  27. package/host-guard.js +176 -0
  28. package/package.json +5 -4
  29. package/server.d.ts +15 -1
  30. package/server.js +28 -3
  31. package/build/client/assets/mermaid-3ZIDBTTL-yyHEMZs4.css +0 -1
  32. package/build/client/assets/root-BOS11TzD.css +0 -1
  33. package/build/client/assets/server-build-CNEy-GiI.css +0 -1
@@ -1,14 +1,10 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-Cu4jq70Y.js","assets/index-CXBr7N7m.js","assets/index-BQ-Xa8kF.js","assets/highlighted-body-B3W2YXNL-CK5bxjZc.js"])))=>i.map(i=>d[i]);
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- var _a2, _b;
6
- import { r as reactExports, j as jsxRuntimeExports, f as reactDomExports, H as React, R as ReactExports, D as ReactDOM, g as getDefaultExportFromCjs } from "./index-BQ-Xa8kF.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-BhH0xZid.js","assets/index-DY3Cy2uF.js","assets/index-BbkkdbNz.js","assets/highlighted-body-B3W2YXNL-D5wXP22M.js"])))=>i.map(i=>d[i]);
2
+ import { r as reactExports, j as jsxRuntimeExports, f as reactDomExports, H as React, R as ReactExports, D as ReactDOM, g as getDefaultExportFromCjs } from "./index-BbkkdbNz.js";
7
3
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
8
4
  return function handleEvent(event) {
9
- originalEventHandler == null ? void 0 : originalEventHandler(event);
5
+ originalEventHandler?.(event);
10
6
  if (checkForDefaultPrevented === false || !event.defaultPrevented) {
11
- return ourEventHandler == null ? void 0 : ourEventHandler(event);
7
+ return ourEventHandler?.(event);
12
8
  }
13
9
  };
14
10
  }
@@ -69,16 +65,14 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
69
65
  const index2 = defaultContexts.length;
70
66
  defaultContexts = [...defaultContexts, defaultContext];
71
67
  const Provider = (props) => {
72
- var _a3;
73
68
  const { scope, children: children2, ...context } = props;
74
- const Context = ((_a3 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a3[index2]) || BaseContext;
69
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
75
70
  const value = reactExports.useMemo(() => context, Object.values(context));
76
71
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children: children2 });
77
72
  };
78
73
  Provider.displayName = rootComponentName + "Provider";
79
74
  function useContext2(consumerName, scope) {
80
- var _a3;
81
- const Context = ((_a3 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a3[index2]) || BaseContext;
75
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
82
76
  const context = reactExports.useContext(Context);
83
77
  if (context) return context;
84
78
  if (defaultContext !== void 0) return defaultContext;
@@ -91,7 +85,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
91
85
  return reactExports.createContext(defaultContext);
92
86
  });
93
87
  return function useScope(scope) {
94
- const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
88
+ const contexts = scope?.[scopeName] || scopeContexts;
95
89
  return reactExports.useMemo(
96
90
  () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
97
91
  [scope, contexts]
@@ -162,7 +156,7 @@ function createSlotClone(ownerName) {
162
156
  SlotClone2.displayName = `${ownerName}.SlotClone`;
163
157
  return SlotClone2;
164
158
  }
165
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
159
+ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
166
160
  // @__NO_SIDE_EFFECTS__
167
161
  function createSlottable(ownerName) {
168
162
  const Slottable2 = ({ children: children2 }) => {
@@ -200,13 +194,12 @@ function mergeProps$1(slotProps, childProps) {
200
194
  return { ...slotProps, ...overrideProps };
201
195
  }
202
196
  function getElementRef$2(element2) {
203
- var _a3, _b2;
204
- let getter = (_a3 = Object.getOwnPropertyDescriptor(element2.props, "ref")) == null ? void 0 : _a3.get;
197
+ let getter = Object.getOwnPropertyDescriptor(element2.props, "ref")?.get;
205
198
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
206
199
  if (mayWarn) {
207
200
  return element2.ref;
208
201
  }
209
- getter = (_b2 = Object.getOwnPropertyDescriptor(element2, "ref")) == null ? void 0 : _b2.get;
202
+ getter = Object.getOwnPropertyDescriptor(element2, "ref")?.get;
210
203
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
211
204
  if (mayWarn) {
212
205
  return element2.props.ref;
@@ -238,7 +231,7 @@ var Primitive = NODES.reduce((primitive, node2) => {
238
231
  const { asChild, ...primitiveProps } = props;
239
232
  const Comp = asChild ? Slot2 : node2;
240
233
  if (typeof window !== "undefined") {
241
- window[Symbol.for("radix-ui")] = true;
234
+ window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
242
235
  }
243
236
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
244
237
  });
@@ -253,12 +246,9 @@ function useCallbackRef(callback) {
253
246
  reactExports.useEffect(() => {
254
247
  callbackRef.current = callback;
255
248
  });
256
- return reactExports.useMemo(() => (...args) => {
257
- var _a3;
258
- return (_a3 = callbackRef.current) == null ? void 0 : _a3.call(callbackRef, ...args);
259
- }, []);
249
+ return reactExports.useMemo(() => (...args) => callbackRef.current?.(...args), []);
260
250
  }
261
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
251
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
262
252
  const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
263
253
  reactExports.useEffect(() => {
264
254
  const handleKeyDown = (event) => {
@@ -293,7 +283,7 @@ var DismissableLayer = reactExports.forwardRef(
293
283
  } = props;
294
284
  const context = reactExports.useContext(DismissableLayerContext);
295
285
  const [node2, setNode] = reactExports.useState(null);
296
- const ownerDocument = (node2 == null ? void 0 : node2.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
286
+ const ownerDocument = node2?.ownerDocument ?? globalThis?.document;
297
287
  const [, force] = reactExports.useState({});
298
288
  const composedRefs = useComposedRefs$1(forwardedRef, (node22) => setNode(node22));
299
289
  const layers = Array.from(context.layers);
@@ -306,22 +296,22 @@ var DismissableLayer = reactExports.forwardRef(
306
296
  const target2 = event.target;
307
297
  const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target2));
308
298
  if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
309
- onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
310
- onInteractOutside == null ? void 0 : onInteractOutside(event);
311
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
299
+ onPointerDownOutside?.(event);
300
+ onInteractOutside?.(event);
301
+ if (!event.defaultPrevented) onDismiss?.();
312
302
  }, ownerDocument);
313
303
  const focusOutside = useFocusOutside((event) => {
314
304
  const target2 = event.target;
315
305
  const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target2));
316
306
  if (isFocusInBranch) return;
317
- onFocusOutside == null ? void 0 : onFocusOutside(event);
318
- onInteractOutside == null ? void 0 : onInteractOutside(event);
319
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
307
+ onFocusOutside?.(event);
308
+ onInteractOutside?.(event);
309
+ if (!event.defaultPrevented) onDismiss?.();
320
310
  }, ownerDocument);
321
311
  useEscapeKeydown((event) => {
322
312
  const isHighestLayer = index2 === context.layers.size - 1;
323
313
  if (!isHighestLayer) return;
324
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
314
+ onEscapeKeyDown?.(event);
325
315
  if (!event.defaultPrevented && onDismiss) {
326
316
  event.preventDefault();
327
317
  onDismiss();
@@ -394,7 +384,7 @@ var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
394
384
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs });
395
385
  });
396
386
  DismissableLayerBranch.displayName = BRANCH_NAME;
397
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
387
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
398
388
  const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
399
389
  const isPointerInsideReactTreeRef = reactExports.useRef(false);
400
390
  const handleClickRef = reactExports.useRef(() => {
@@ -437,7 +427,7 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis
437
427
  onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
438
428
  };
439
429
  }
440
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
430
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
441
431
  const handleFocusOutside = useCallbackRef(onFocusOutside);
442
432
  const isFocusInsideReactTreeRef = reactExports.useRef(false);
443
433
  reactExports.useEffect(() => {
@@ -471,7 +461,7 @@ function handleAndDispatchCustomEvent(name2, handler, detail, { discrete }) {
471
461
  target2.dispatchEvent(event);
472
462
  }
473
463
  }
474
- var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? reactExports.useLayoutEffect : () => {
464
+ var useLayoutEffect2 = globalThis?.document ? reactExports.useLayoutEffect : () => {
475
465
  };
476
466
  var useReactId = React[" useId ".trim().toString()] || (() => void 0);
477
467
  var count = 0;
@@ -2430,7 +2420,7 @@ var PopperAnchor = reactExports.forwardRef(
2430
2420
  const anchorRef = reactExports.useRef(null);
2431
2421
  reactExports.useEffect(() => {
2432
2422
  const previousAnchor = anchorRef.current;
2433
- anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref.current;
2423
+ anchorRef.current = virtualRef?.current || ref.current;
2434
2424
  if (previousAnchor !== anchorRef.current) {
2435
2425
  context.onAnchorChange(anchorRef.current);
2436
2426
  }
@@ -2443,7 +2433,6 @@ var CONTENT_NAME$1 = "PopperContent";
2443
2433
  var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$1);
2444
2434
  var PopperContent = reactExports.forwardRef(
2445
2435
  (props, forwardedRef) => {
2446
- var _a3, _b2, _c, _d, _e2, _f;
2447
2436
  const {
2448
2437
  __scopePopper,
2449
2438
  side = "bottom",
@@ -2465,8 +2454,8 @@ var PopperContent = reactExports.forwardRef(
2465
2454
  const composedRefs = useComposedRefs$1(forwardedRef, (node2) => setContent(node2));
2466
2455
  const [arrow$12, setArrow] = reactExports.useState(null);
2467
2456
  const arrowSize = useSize(arrow$12);
2468
- const arrowWidth = (arrowSize == null ? void 0 : arrowSize.width) ?? 0;
2469
- const arrowHeight = (arrowSize == null ? void 0 : arrowSize.height) ?? 0;
2457
+ const arrowWidth = arrowSize?.width ?? 0;
2458
+ const arrowHeight = arrowSize?.height ?? 0;
2470
2459
  const desiredPlacement = side + (align !== "center" ? "-" + align : "");
2471
2460
  const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
2472
2461
  const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
@@ -2519,12 +2508,12 @@ var PopperContent = reactExports.forwardRef(
2519
2508
  const handlePlaced = useCallbackRef(onPlaced);
2520
2509
  useLayoutEffect2(() => {
2521
2510
  if (isPositioned) {
2522
- handlePlaced == null ? void 0 : handlePlaced();
2511
+ handlePlaced?.();
2523
2512
  }
2524
2513
  }, [isPositioned, handlePlaced]);
2525
- const arrowX = (_a3 = middlewareData.arrow) == null ? void 0 : _a3.x;
2526
- const arrowY = (_b2 = middlewareData.arrow) == null ? void 0 : _b2.y;
2527
- const cannotCenterArrow = ((_c = middlewareData.arrow) == null ? void 0 : _c.centerOffset) !== 0;
2514
+ const arrowX = middlewareData.arrow?.x;
2515
+ const arrowY = middlewareData.arrow?.y;
2516
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
2528
2517
  const [contentZIndex, setContentZIndex] = reactExports.useState();
2529
2518
  useLayoutEffect2(() => {
2530
2519
  if (content2) setContentZIndex(window.getComputedStyle(content2).zIndex);
@@ -2541,13 +2530,13 @@ var PopperContent = reactExports.forwardRef(
2541
2530
  minWidth: "max-content",
2542
2531
  zIndex: contentZIndex,
2543
2532
  ["--radix-popper-transform-origin"]: [
2544
- (_d = middlewareData.transformOrigin) == null ? void 0 : _d.x,
2545
- (_e2 = middlewareData.transformOrigin) == null ? void 0 : _e2.y
2533
+ middlewareData.transformOrigin?.x,
2534
+ middlewareData.transformOrigin?.y
2546
2535
  ].join(" "),
2547
2536
  // hide the content if using the hide middleware and should be hidden
2548
2537
  // set visibility to hidden and disable pointer events so the UI behaves
2549
2538
  // as if the PopperContent isn't there at all
2550
- ...((_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden) && {
2539
+ ...middlewareData.hide?.referenceHidden && {
2551
2540
  visibility: "hidden",
2552
2541
  pointerEvents: "none"
2553
2542
  }
@@ -2646,16 +2635,15 @@ var transformOrigin = (options) => ({
2646
2635
  name: "transformOrigin",
2647
2636
  options,
2648
2637
  fn(data) {
2649
- var _a3, _b2, _c;
2650
2638
  const { placement, rects, middlewareData } = data;
2651
- const cannotCenterArrow = ((_a3 = middlewareData.arrow) == null ? void 0 : _a3.centerOffset) !== 0;
2639
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
2652
2640
  const isArrowHidden = cannotCenterArrow;
2653
2641
  const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
2654
2642
  const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
2655
2643
  const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
2656
2644
  const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
2657
- const arrowXCenter = (((_b2 = middlewareData.arrow) == null ? void 0 : _b2.x) ?? 0) + arrowWidth / 2;
2658
- const arrowYCenter = (((_c = middlewareData.arrow) == null ? void 0 : _c.y) ?? 0) + arrowHeight / 2;
2645
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
2646
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
2659
2647
  let x2 = "";
2660
2648
  let y2 = "";
2661
2649
  if (placedSide === "bottom") {
@@ -2729,7 +2717,7 @@ function usePresence(present) {
2729
2717
  const currentAnimationName = getAnimationName(styles2);
2730
2718
  if (present) {
2731
2719
  send("MOUNT");
2732
- } else if (currentAnimationName === "none" || (styles2 == null ? void 0 : styles2.display) === "none") {
2720
+ } else if (currentAnimationName === "none" || styles2?.display === "none") {
2733
2721
  send("UNMOUNT");
2734
2722
  } else {
2735
2723
  const isAnimating = prevAnimationName !== currentAnimationName;
@@ -2789,16 +2777,15 @@ function usePresence(present) {
2789
2777
  };
2790
2778
  }
2791
2779
  function getAnimationName(styles2) {
2792
- return (styles2 == null ? void 0 : styles2.animationName) || "none";
2780
+ return styles2?.animationName || "none";
2793
2781
  }
2794
2782
  function getElementRef$1(element2) {
2795
- var _a3, _b2;
2796
- let getter = (_a3 = Object.getOwnPropertyDescriptor(element2.props, "ref")) == null ? void 0 : _a3.get;
2783
+ let getter = Object.getOwnPropertyDescriptor(element2.props, "ref")?.get;
2797
2784
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
2798
2785
  if (mayWarn) {
2799
2786
  return element2.ref;
2800
2787
  }
2801
- getter = (_b2 = Object.getOwnPropertyDescriptor(element2, "ref")) == null ? void 0 : _b2.get;
2788
+ getter = Object.getOwnPropertyDescriptor(element2, "ref")?.get;
2802
2789
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
2803
2790
  if (mayWarn) {
2804
2791
  return element2.props.ref;
@@ -2835,11 +2822,10 @@ function useControllableState({
2835
2822
  }
2836
2823
  const setValue = reactExports.useCallback(
2837
2824
  (nextValue) => {
2838
- var _a3;
2839
2825
  if (isControlled) {
2840
2826
  const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
2841
2827
  if (value2 !== prop) {
2842
- (_a3 = onChangeRef.current) == null ? void 0 : _a3.call(onChangeRef, value2);
2828
+ onChangeRef.current?.(value2);
2843
2829
  }
2844
2830
  } else {
2845
2831
  setUncontrolledProp(nextValue);
@@ -2860,9 +2846,8 @@ function useUncontrolledState({
2860
2846
  onChangeRef.current = onChange;
2861
2847
  }, [onChange]);
2862
2848
  reactExports.useEffect(() => {
2863
- var _a3;
2864
2849
  if (prevValueRef.current !== value) {
2865
- (_a3 = onChangeRef.current) == null ? void 0 : _a3.call(onChangeRef, value);
2850
+ onChangeRef.current?.(value);
2866
2851
  prevValueRef.current = value;
2867
2852
  }
2868
2853
  }, [value, prevValueRef]);
@@ -2979,7 +2964,7 @@ var Tooltip$1 = (props) => {
2979
2964
  } else {
2980
2965
  providerContext.onClose();
2981
2966
  }
2982
- onOpenChange == null ? void 0 : onOpenChange(open22);
2967
+ onOpenChange?.(open22);
2983
2968
  },
2984
2969
  caller: TOOLTIP_NAME
2985
2970
  });
@@ -3151,7 +3136,7 @@ var TooltipContentHoverable = reactExports.forwardRef((props, forwardedRef) => {
3151
3136
  const handleTrackPointerGrace = (event) => {
3152
3137
  const target2 = event.target;
3153
3138
  const pointerPosition = { x: event.clientX, y: event.clientY };
3154
- const hasEnteredTarget = (trigger == null ? void 0 : trigger.contains(target2)) || (content2 == null ? void 0 : content2.contains(target2));
3139
+ const hasEnteredTarget = trigger?.contains(target2) || content2?.contains(target2);
3155
3140
  const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
3156
3141
  if (hasEnteredTarget) {
3157
3142
  handleRemoveGraceArea();
@@ -3189,7 +3174,7 @@ var TooltipContentImpl = reactExports.forwardRef(
3189
3174
  if (context.trigger) {
3190
3175
  const handleScroll = (event) => {
3191
3176
  const target2 = event.target;
3192
- if (target2 == null ? void 0 : target2.contains(context.trigger)) onClose();
3177
+ if (target2?.contains(context.trigger)) onClose();
3193
3178
  };
3194
3179
  window.addEventListener("scroll", handleScroll, { capture: true });
3195
3180
  return () => window.removeEventListener("scroll", handleScroll, { capture: true });
@@ -6597,48 +6582,18 @@ const mergeArrayProperties = (baseObject, mergeObject, key) => {
6597
6582
  };
6598
6583
  const extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === "function" ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);
6599
6584
  const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
6600
- /**
6601
- * @license lucide-react v0.575.0 - ISC
6602
- *
6603
- * This source code is licensed under the ISC license.
6604
- * See the LICENSE file in the root directory of this source tree.
6605
- */
6606
6585
  const mergeClasses = (...classes) => classes.filter((className, index2, array2) => {
6607
6586
  return Boolean(className) && className.trim() !== "" && array2.indexOf(className) === index2;
6608
6587
  }).join(" ").trim();
6609
- /**
6610
- * @license lucide-react v0.575.0 - ISC
6611
- *
6612
- * This source code is licensed under the ISC license.
6613
- * See the LICENSE file in the root directory of this source tree.
6614
- */
6615
6588
  const toKebabCase = (string2) => string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
6616
- /**
6617
- * @license lucide-react v0.575.0 - ISC
6618
- *
6619
- * This source code is licensed under the ISC license.
6620
- * See the LICENSE file in the root directory of this source tree.
6621
- */
6622
6589
  const toCamelCase = (string2) => string2.replace(
6623
6590
  /^([A-Z])|[\s-_]+(\w)/g,
6624
6591
  (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
6625
6592
  );
6626
- /**
6627
- * @license lucide-react v0.575.0 - ISC
6628
- *
6629
- * This source code is licensed under the ISC license.
6630
- * See the LICENSE file in the root directory of this source tree.
6631
- */
6632
6593
  const toPascalCase = (string2) => {
6633
6594
  const camelCase = toCamelCase(string2);
6634
6595
  return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
6635
6596
  };
6636
- /**
6637
- * @license lucide-react v0.575.0 - ISC
6638
- *
6639
- * This source code is licensed under the ISC license.
6640
- * See the LICENSE file in the root directory of this source tree.
6641
- */
6642
6597
  var defaultAttributes = {
6643
6598
  xmlns: "http://www.w3.org/2000/svg",
6644
6599
  width: 24,
@@ -6650,12 +6605,6 @@ var defaultAttributes = {
6650
6605
  strokeLinecap: "round",
6651
6606
  strokeLinejoin: "round"
6652
6607
  };
6653
- /**
6654
- * @license lucide-react v0.575.0 - ISC
6655
- *
6656
- * This source code is licensed under the ISC license.
6657
- * See the LICENSE file in the root directory of this source tree.
6658
- */
6659
6608
  const hasA11yProp = (props) => {
6660
6609
  for (const prop in props) {
6661
6610
  if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
@@ -6664,12 +6613,6 @@ const hasA11yProp = (props) => {
6664
6613
  }
6665
6614
  return false;
6666
6615
  };
6667
- /**
6668
- * @license lucide-react v0.575.0 - ISC
6669
- *
6670
- * This source code is licensed under the ISC license.
6671
- * See the LICENSE file in the root directory of this source tree.
6672
- */
6673
6616
  const Icon = reactExports.forwardRef(
6674
6617
  ({
6675
6618
  color: color5 = "currentColor",
@@ -6699,12 +6642,6 @@ const Icon = reactExports.forwardRef(
6699
6642
  ]
6700
6643
  )
6701
6644
  );
6702
- /**
6703
- * @license lucide-react v0.575.0 - ISC
6704
- *
6705
- * This source code is licensed under the ISC license.
6706
- * See the LICENSE file in the root directory of this source tree.
6707
- */
6708
6645
  const createLucideIcon = (iconName, iconNode) => {
6709
6646
  const Component = reactExports.forwardRef(
6710
6647
  ({ className, ...props }, ref) => reactExports.createElement(Icon, {
@@ -6721,20 +6658,8 @@ const createLucideIcon = (iconName, iconNode) => {
6721
6658
  Component.displayName = toPascalCase(iconName);
6722
6659
  return Component;
6723
6660
  };
6724
- /**
6725
- * @license lucide-react v0.575.0 - ISC
6726
- *
6727
- * This source code is licensed under the ISC license.
6728
- * See the LICENSE file in the root directory of this source tree.
6729
- */
6730
6661
  const __iconNode$1 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
6731
6662
  const LoaderCircle = createLucideIcon("loader-circle", __iconNode$1);
6732
- /**
6733
- * @license lucide-react v0.575.0 - ISC
6734
- *
6735
- * This source code is licensed under the ISC license.
6736
- * See the LICENSE file in the root directory of this source tree.
6737
- */
6738
6663
  const __iconNode = [
6739
6664
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
6740
6665
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
@@ -7014,7 +6939,7 @@ function K$3(t, e = [], { singleton: n } = { singleton: true }) {
7014
6939
  singleton: n
7015
6940
  };
7016
6941
  }
7017
- const So$1 = () => Symbol();
6942
+ const So$1 = () => /* @__PURE__ */ Symbol();
7018
6943
  function To(t) {
7019
6944
  const e = /* @__PURE__ */ new Map(), n = ({ constructor: o, dependencies: r2, id: s2, singleton: i }) => {
7020
6945
  if (i && e.has(s2))
@@ -10050,63 +9975,43 @@ const seen = {};
10050
9975
  const __vitePreload = function preload(baseModule, deps, importerUrl) {
10051
9976
  let promise = Promise.resolve();
10052
9977
  if (deps && deps.length > 0) {
10053
- let allSettled2 = function(promises) {
10054
- return Promise.all(
10055
- promises.map(
10056
- (p2) => Promise.resolve(p2).then(
10057
- (value) => ({ status: "fulfilled", value }),
10058
- (reason) => ({ status: "rejected", reason })
10059
- )
10060
- )
10061
- );
9978
+ let allSettled = function(promises$2) {
9979
+ return Promise.all(promises$2.map((p2) => Promise.resolve(p2).then((value$1) => ({
9980
+ status: "fulfilled",
9981
+ value: value$1
9982
+ }), (reason) => ({
9983
+ status: "rejected",
9984
+ reason
9985
+ }))));
10062
9986
  };
10063
9987
  document.getElementsByTagName("link");
10064
- const cspNonceMeta = document.querySelector(
10065
- "meta[property=csp-nonce]"
10066
- );
10067
- const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
10068
- promise = allSettled2(
10069
- deps.map((dep) => {
10070
- dep = assetsURL(dep);
10071
- if (dep in seen) return;
10072
- seen[dep] = true;
10073
- const isCss = dep.endsWith(".css");
10074
- const cssSelector = isCss ? '[rel="stylesheet"]' : "";
10075
- if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
10076
- return;
10077
- }
10078
- const link2 = document.createElement("link");
10079
- link2.rel = isCss ? "stylesheet" : scriptRel;
10080
- if (!isCss) {
10081
- link2.as = "script";
10082
- }
10083
- link2.crossOrigin = "";
10084
- link2.href = dep;
10085
- if (cspNonce) {
10086
- link2.setAttribute("nonce", cspNonce);
10087
- }
10088
- document.head.appendChild(link2);
10089
- if (isCss) {
10090
- return new Promise((res, rej) => {
10091
- link2.addEventListener("load", res);
10092
- link2.addEventListener(
10093
- "error",
10094
- () => rej(new Error(`Unable to preload CSS for ${dep}`))
10095
- );
10096
- });
10097
- }
10098
- })
10099
- );
9988
+ const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
9989
+ const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
9990
+ promise = allSettled(deps.map((dep) => {
9991
+ dep = assetsURL(dep);
9992
+ if (dep in seen) return;
9993
+ seen[dep] = true;
9994
+ const isCss = dep.endsWith(".css");
9995
+ const cssSelector = isCss ? '[rel="stylesheet"]' : "";
9996
+ if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
9997
+ const link2 = document.createElement("link");
9998
+ link2.rel = isCss ? "stylesheet" : scriptRel;
9999
+ if (!isCss) link2.as = "script";
10000
+ link2.crossOrigin = "";
10001
+ link2.href = dep;
10002
+ if (cspNonce) link2.setAttribute("nonce", cspNonce);
10003
+ document.head.appendChild(link2);
10004
+ if (isCss) return new Promise((res, rej) => {
10005
+ link2.addEventListener("load", res);
10006
+ link2.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
10007
+ });
10008
+ }));
10100
10009
  }
10101
- function handlePreloadError(err) {
10102
- const e = new Event("vite:preloadError", {
10103
- cancelable: true
10104
- });
10105
- e.payload = err;
10106
- window.dispatchEvent(e);
10107
- if (!e.defaultPrevented) {
10108
- throw err;
10109
- }
10010
+ function handlePreloadError(err$2) {
10011
+ const e$1 = new Event("vite:preloadError", { cancelable: true });
10012
+ e$1.payload = err$2;
10013
+ window.dispatchEvent(e$1);
10014
+ if (!e$1.defaultPrevented) throw err$2;
10110
10015
  }
10111
10016
  return promise.then((res) => {
10112
10017
  for (const item of res || []) {
@@ -10153,7 +10058,7 @@ function decode_legacy(base642) {
10153
10058
  return array2.buffer;
10154
10059
  }
10155
10060
  const native = typeof Uint8Array.fromBase64 === "function";
10156
- const buffer = typeof process === "object" && ((_a2 = process.versions) == null ? void 0 : _a2.node) !== void 0;
10061
+ const buffer = typeof process === "object" && process.versions?.node !== void 0;
10157
10062
  const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
10158
10063
  function merge_operations(defaults, overrides) {
10159
10064
  return defaults;
@@ -10242,7 +10147,7 @@ function unflatten(parsed, revivers, options) {
10242
10147
  if (Object.hasOwn(hydrated, i)) {
10243
10148
  return hydrated[index2] = reviver(hydrated[i]);
10244
10149
  }
10245
- hydrating ?? (hydrating = /* @__PURE__ */ new Set());
10150
+ hydrating ??= /* @__PURE__ */ new Set();
10246
10151
  if (hydrating.has(i)) {
10247
10152
  throw new Error("Invalid circular reference");
10248
10153
  }
@@ -10444,7 +10349,7 @@ function hydrateData(value, revivers) {
10444
10349
  async function hydrateDataWithKey(value, revivers, key) {
10445
10350
  if (value instanceof Uint8Array && isEncryptedData(value) && key) {
10446
10351
  const { decrypt } = await __vitePreload(async () => {
10447
- const { decrypt: decrypt2 } = await import("./encryption-Cu4jq70Y.js");
10352
+ const { decrypt: decrypt2 } = await import("./encryption-BhH0xZid.js");
10448
10353
  return { decrypt: decrypt2 };
10449
10354
  }, true ? __vite__mapDeps([0,1,2]) : void 0);
10450
10355
  const { payload } = decodeFormatPrefix(value);
@@ -10457,11 +10362,11 @@ const STREAM_ID_PREFIX = "strm_";
10457
10362
  const STREAM_REF_TYPE$1 = "__workflow_stream_ref__";
10458
10363
  const CLASS_INSTANCE_REF_TYPE$1 = "__workflow_class_instance_ref__";
10459
10364
  class ClassInstanceRef {
10365
+ className;
10366
+ classId;
10367
+ data;
10368
+ __type = CLASS_INSTANCE_REF_TYPE$1;
10460
10369
  constructor(className, classId, data) {
10461
- __publicField(this, "className");
10462
- __publicField(this, "classId");
10463
- __publicField(this, "data");
10464
- __publicField(this, "__type", CLASS_INSTANCE_REF_TYPE$1);
10465
10370
  this.className = className;
10466
10371
  this.classId = classId;
10467
10372
  this.data = data;
@@ -10720,7 +10625,7 @@ function assignProp(target2, prop, value) {
10720
10625
  }
10721
10626
  function rawShape(def) {
10722
10627
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
10723
- return (desc == null ? void 0 : desc.get) ? desc.get.raw : desc == null ? void 0 : desc.value;
10628
+ return desc?.get ? desc.get.raw : desc?.value;
10724
10629
  }
10725
10630
  function sourceShape(schema) {
10726
10631
  return rawShape(schema._zod.def) ?? schema._zod.def.shape;
@@ -10788,11 +10693,10 @@ function isObject(data) {
10788
10693
  return typeof data === "object" && data !== null && !Array.isArray(data);
10789
10694
  }
10790
10695
  const allowsEval = /* @__PURE__ */ cached(() => {
10791
- var _a3;
10792
10696
  if (globalConfig.jitless) {
10793
10697
  return false;
10794
10698
  }
10795
- if (typeof navigator !== "undefined" && ((_a3 = navigator == null ? void 0 : navigator.userAgent) == null ? void 0 : _a3.includes("Cloudflare"))) {
10699
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
10796
10700
  return false;
10797
10701
  }
10798
10702
  try {
@@ -10836,7 +10740,7 @@ function escapeRegex(str) {
10836
10740
  }
10837
10741
  function clone(inst, def, params) {
10838
10742
  const cl = new inst._zod.constr(def ?? inst._zod.def);
10839
- if (!def || (params == null ? void 0 : params.parent))
10743
+ if (!def || params?.parent)
10840
10744
  cl._zod.parent = inst;
10841
10745
  return cl;
10842
10746
  }
@@ -10846,8 +10750,8 @@ function normalizeParams(_params) {
10846
10750
  return {};
10847
10751
  if (typeof params === "string")
10848
10752
  return { error: () => params };
10849
- if ((params == null ? void 0 : params.message) !== void 0) {
10850
- if ((params == null ? void 0 : params.error) !== void 0)
10753
+ if (params?.message !== void 0) {
10754
+ if (params?.error !== void 0)
10851
10755
  throw new Error("Cannot specify both `message` and `error` params");
10852
10756
  params.error = params.message;
10853
10757
  }
@@ -10891,11 +10795,10 @@ function pick(schema, mask) {
10891
10795
  return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
10892
10796
  }
10893
10797
  function maskedKeys(schema, mask) {
10894
- var _a3;
10895
10798
  const raw2 = sourceShape(schema);
10896
10799
  const keys2 = [];
10897
10800
  for (const key of Reflect.ownKeys(mask)) {
10898
- if (!((_a3 = Object.getOwnPropertyDescriptor(raw2, key)) == null ? void 0 : _a3.enumerable)) {
10801
+ if (!Object.getOwnPropertyDescriptor(raw2, key)?.enumerable) {
10899
10802
  throw new Error(`Unrecognized key: "${String(key)}"`);
10900
10803
  }
10901
10804
  if (mask[key])
@@ -10944,11 +10847,10 @@ function safeExtend(schema, shape) {
10944
10847
  return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
10945
10848
  }
10946
10849
  function merge$2(a2, b2) {
10947
- var _a3, _b2;
10948
- if (!((_a3 = b2 == null ? void 0 : b2._zod) == null ? void 0 : _a3.def)) {
10850
+ if (!b2?._zod?.def) {
10949
10851
  throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
10950
10852
  }
10951
- if ((_b2 = a2._zod.def.checks) == null ? void 0 : _b2.length) {
10853
+ if (a2._zod.def.checks?.length) {
10952
10854
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
10953
10855
  }
10954
10856
  const newShape = {};
@@ -10985,22 +10887,20 @@ function required(Class, schema, mask) {
10985
10887
  return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
10986
10888
  }
10987
10889
  function aborted(x2, startIndex = 0) {
10988
- var _a3;
10989
10890
  if (x2.aborted === true)
10990
10891
  return true;
10991
10892
  for (let i = startIndex; i < x2.issues.length; i++) {
10992
- if (((_a3 = x2.issues[i]) == null ? void 0 : _a3.continue) !== true) {
10893
+ if (x2.issues[i]?.continue !== true) {
10993
10894
  return true;
10994
10895
  }
10995
10896
  }
10996
10897
  return false;
10997
10898
  }
10998
10899
  function explicitlyAborted(x2, startIndex = 0) {
10999
- var _a3;
11000
10900
  if (x2.aborted === true)
11001
10901
  return true;
11002
10902
  for (let i = startIndex; i < x2.issues.length; i++) {
11003
- if (((_a3 = x2.issues[i]) == null ? void 0 : _a3.continue) === false) {
10903
+ if (x2.issues[i]?.continue === false) {
11004
10904
  return true;
11005
10905
  }
11006
10906
  }
@@ -11008,14 +10908,14 @@ function explicitlyAborted(x2, startIndex = 0) {
11008
10908
  }
11009
10909
  function prefixIssues(path2, issues) {
11010
10910
  return issues.map((iss) => {
11011
- var _a3;
11012
- (_a3 = iss).path ?? (_a3.path = []);
10911
+ var _a2;
10912
+ (_a2 = iss).path ?? (_a2.path = []);
11013
10913
  iss.path.unshift(path2);
11014
10914
  return iss;
11015
10915
  });
11016
10916
  }
11017
10917
  function unwrapMessage(message) {
11018
- return typeof message === "string" ? message : message == null ? void 0 : message.message;
10918
+ return typeof message === "string" ? message : message?.message;
11019
10919
  }
11020
10920
  function sizeCaps(defChecks) {
11021
10921
  const caps = [];
@@ -11030,23 +10930,22 @@ function sizeCaps(defChecks) {
11030
10930
  return caps;
11031
10931
  }
11032
10932
  function attachSchema(issues, start, inst) {
11033
- var _a3;
10933
+ var _a2;
11034
10934
  for (let i = start; i < issues.length; i++) {
11035
- (_a3 = issues[i]).schema ?? (_a3.schema = inst);
10935
+ (_a2 = issues[i]).schema ?? (_a2.schema = inst);
11036
10936
  }
11037
10937
  }
11038
10938
  function finalizeIssue(iss, ctx, config2) {
11039
- var _a4, _b2, _c, _d, _e2, _f, _g, _h, _i, _j;
11040
- var _a3;
11041
- const traits = (_b2 = (_a4 = iss.inst) == null ? void 0 : _a4._zod) == null ? void 0 : _b2.traits;
11042
- if (traits == null ? void 0 : traits.has("$ZodType")) {
10939
+ var _a2;
10940
+ const traits = iss.inst?._zod?.traits;
10941
+ if (traits?.has("$ZodType")) {
11043
10942
  if (traits.has("$ZodCheck"))
11044
- (_a3 = iss).schema ?? (_a3.schema = iss.inst);
10943
+ (_a2 = iss).schema ?? (_a2.schema = iss.inst);
11045
10944
  else
11046
10945
  iss.schema = iss.inst;
11047
10946
  }
11048
- const schemaError = iss.schema !== iss.inst ? (_d = (_c = iss.schema) == null ? void 0 : _c._zod.def) == null ? void 0 : _d.error : void 0;
11049
- const message = iss.message ? iss.message : unwrapMessage((_g = (_f = (_e2 = iss.inst) == null ? void 0 : _e2._zod.def) == null ? void 0 : _f.error) == null ? void 0 : _g.call(_f, iss)) ?? unwrapMessage(schemaError == null ? void 0 : schemaError(iss)) ?? unwrapMessage((_h = ctx == null ? void 0 : ctx.error) == null ? void 0 : _h.call(ctx, iss)) ?? unwrapMessage((_i = config2.customError) == null ? void 0 : _i.call(config2, iss)) ?? unwrapMessage((_j = config2.localeError) == null ? void 0 : _j.call(config2, iss)) ?? "Invalid input";
10947
+ const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
10948
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
11050
10949
  const full = {};
11051
10950
  for (const k2 of Object.keys(iss)) {
11052
10951
  if (k2 === "inst" || k2 === "schema" || k2 === "continue" || k2 === "input" || k2 === "__proto__")
@@ -11055,7 +10954,7 @@ function finalizeIssue(iss, ctx, config2) {
11055
10954
  }
11056
10955
  full.path ?? (full.path = []);
11057
10956
  full.message = message;
11058
- if (ctx == null ? void 0 : ctx.reportInput) {
10957
+ if (ctx?.reportInput) {
11059
10958
  full.input = iss.input;
11060
10959
  }
11061
10960
  return full;
@@ -11293,13 +11192,12 @@ function $constructor(name2, initializer2, proto2, params) {
11293
11192
  }
11294
11193
  }
11295
11194
  }
11296
- const Parent = (params == null ? void 0 : params.Parent) ?? Object;
11195
+ const Parent = params?.Parent ?? Object;
11297
11196
  class Definition extends Parent {
11298
11197
  }
11299
11198
  Object.defineProperty(Definition, "name", { value: name2 });
11300
11199
  function _2(def) {
11301
- var _a3;
11302
- const inst = (params == null ? void 0 : params.Parent) ? newError(Definition) : this;
11200
+ const inst = params?.Parent ? newError(Definition) : this;
11303
11201
  init(inst, def);
11304
11202
  const deferred = inst._zod.deferred;
11305
11203
  if (deferred) {
@@ -11308,7 +11206,7 @@ function $constructor(name2, initializer2, proto2, params) {
11308
11206
  }
11309
11207
  inst._zod.deferred = void 0;
11310
11208
  }
11311
- const pp = (_a3 = globalThis.__zod_globalConfig) == null ? void 0 : _a3.postProcessor;
11209
+ const pp = globalThis.__zod_globalConfig?.postProcessor;
11312
11210
  if (pp)
11313
11211
  pp(inst);
11314
11212
  return inst;
@@ -11316,10 +11214,9 @@ function $constructor(name2, initializer2, proto2, params) {
11316
11214
  Object.defineProperty(_2, "init", { value: init });
11317
11215
  Object.defineProperty(_2, Symbol.hasInstance, {
11318
11216
  value: (inst) => {
11319
- var _a3, _b2;
11320
- if ((params == null ? void 0 : params.Parent) && inst instanceof params.Parent)
11217
+ if (params?.Parent && inst instanceof params.Parent)
11321
11218
  return true;
11322
- return (_b2 = (_a3 = inst == null ? void 0 : inst._zod) == null ? void 0 : _a3.traits) == null ? void 0 : _b2.has(name2);
11219
+ return inst?._zod?.traits?.has(name2);
11323
11220
  }
11324
11221
  });
11325
11222
  Object.defineProperty(_2, "name", { value: name2 });
@@ -11454,7 +11351,7 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
11454
11351
  return fieldErrors;
11455
11352
  }
11456
11353
  function finalizeParams(callee, params) {
11457
- return { callee: (params == null ? void 0 : params.callee) ?? callee, Err: params == null ? void 0 : params.Err };
11354
+ return { callee: params?.callee ?? callee, Err: params?.Err };
11458
11355
  }
11459
11356
  const _parse = (_Err) => {
11460
11357
  const fn2 = (schema, value, _ctx, _params) => {
@@ -11464,8 +11361,8 @@ const _parse = (_Err) => {
11464
11361
  throw new $ZodAsyncError();
11465
11362
  }
11466
11363
  if (result.issues.length) {
11467
- const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
11468
- captureStackTrace(e, (_params == null ? void 0 : _params.callee) ?? fn2);
11364
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
11365
+ captureStackTrace(e, _params?.callee ?? fn2);
11469
11366
  throw e;
11470
11367
  }
11471
11368
  return result.value;
@@ -11479,8 +11376,8 @@ const _parseAsync = (_Err) => {
11479
11376
  if (result instanceof Promise)
11480
11377
  result = await result;
11481
11378
  if (result.issues.length) {
11482
- const e = new ((params == null ? void 0 : params.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
11483
- captureStackTrace(e, (params == null ? void 0 : params.callee) ?? fn2);
11379
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
11380
+ captureStackTrace(e, params?.callee ?? fn2);
11484
11381
  throw e;
11485
11382
  }
11486
11383
  return result.value;
@@ -11658,10 +11555,10 @@ const _undefined$2 = /^undefined$/i;
11658
11555
  const lowercase = /^[^A-Z]*$/;
11659
11556
  const uppercase = /^[^a-z]*$/;
11660
11557
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
11661
- var _a3;
11558
+ var _a2;
11662
11559
  inst._zod ?? (inst._zod = {});
11663
11560
  inst._zod.def = def;
11664
- (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
11561
+ (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
11665
11562
  });
11666
11563
  const _whenHasLength = (payload) => {
11667
11564
  const val = payload.value;
@@ -11730,10 +11627,9 @@ const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf",
11730
11627
  };
11731
11628
  });
11732
11629
  const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
11733
- var _a3;
11734
11630
  $ZodCheck.init(inst, def);
11735
11631
  def.format = def.format || "float64";
11736
- const isInt = (_a3 = def.format) == null ? void 0 : _a3.includes("int");
11632
+ const isInt = def.format?.includes("int");
11737
11633
  const origin = isInt ? "int" : "number";
11738
11634
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
11739
11635
  inst._zod.check = (payload) => {
@@ -11802,9 +11698,9 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
11802
11698
  };
11803
11699
  });
11804
11700
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
11805
- var _a3;
11701
+ var _a2;
11806
11702
  $ZodCheck.init(inst, def);
11807
- (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
11703
+ (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
11808
11704
  inst._zod.check = (payload) => {
11809
11705
  const input = payload.value;
11810
11706
  const units = input.length;
@@ -11824,9 +11720,9 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
11824
11720
  };
11825
11721
  });
11826
11722
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
11827
- var _a3;
11723
+ var _a2;
11828
11724
  $ZodCheck.init(inst, def);
11829
- (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
11725
+ (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
11830
11726
  inst._zod.check = (payload) => {
11831
11727
  const input = payload.value;
11832
11728
  const units = input.length;
@@ -11846,9 +11742,9 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
11846
11742
  };
11847
11743
  });
11848
11744
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
11849
- var _a3;
11745
+ var _a2;
11850
11746
  $ZodCheck.init(inst, def);
11851
- (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
11747
+ (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
11852
11748
  inst._zod.check = (payload) => {
11853
11749
  const input = payload.value;
11854
11750
  const units = input.length;
@@ -11869,10 +11765,10 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
11869
11765
  };
11870
11766
  });
11871
11767
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
11872
- var _a3, _b2;
11768
+ var _a2, _b;
11873
11769
  $ZodCheck.init(inst, def);
11874
11770
  if (def.pattern)
11875
- (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
11771
+ (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
11876
11772
  def.pattern.lastIndex = 0;
11877
11773
  if (def.pattern.test(payload.value))
11878
11774
  return;
@@ -11887,7 +11783,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
11887
11783
  });
11888
11784
  });
11889
11785
  else
11890
- (_b2 = inst._zod).check ?? (_b2.check = () => {
11786
+ (_b = inst._zod).check ?? (_b.check = () => {
11891
11787
  });
11892
11788
  });
11893
11789
  const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
@@ -12041,7 +11937,7 @@ class Doc {
12041
11937
  }
12042
11938
  compile() {
12043
11939
  const F2 = Function;
12044
- const content2 = (this == null ? void 0 : this.content) ?? [``];
11940
+ const content2 = this?.content ?? [``];
12045
11941
  const factory = new F2(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {
12046
11942
  ${content2.join("\n")}
12047
11943
  };`);
@@ -12054,22 +11950,21 @@ const version = {
12054
11950
  patch: 7
12055
11951
  };
12056
11952
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
12057
- var _a4;
12058
- var _a3;
11953
+ var _a2;
12059
11954
  inst ?? (inst = {});
12060
11955
  inst._zod.def = def;
12061
11956
  inst._zod.bag = inst._zod.bag || {};
12062
11957
  inst._zod.version = version;
12063
11958
  const defChecks = inst._zod.def.checks;
12064
- const checks2 = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : (defChecks == null ? void 0 : defChecks.length) ? [...defChecks] : [];
11959
+ const checks2 = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
12065
11960
  for (const ch of checks2) {
12066
11961
  for (const fn2 of ch._zod.onattach) {
12067
11962
  fn2(inst);
12068
11963
  }
12069
11964
  }
12070
11965
  if (checks2.length === 0) {
12071
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
12072
- (_a4 = inst._zod.deferred) == null ? void 0 : _a4.push(() => {
11966
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
11967
+ inst._zod.deferred?.push(() => {
12073
11968
  inst._zod.run = inst._zod.parse;
12074
11969
  });
12075
11970
  } else {
@@ -12090,7 +11985,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
12090
11985
  }
12091
11986
  const currLen = payload.issues.length;
12092
11987
  const _2 = ch._zod.check(payload);
12093
- if (_2 instanceof Promise && (ctx == null ? void 0 : ctx.async) === false) {
11988
+ if (_2 instanceof Promise && ctx?.async === false) {
12094
11989
  throw new $ZodAsyncError();
12095
11990
  }
12096
11991
  if (asyncResult || _2 instanceof Promise) {
@@ -12255,8 +12150,7 @@ function validateURL(trimmed, def) {
12255
12150
  return parseURLObject(trimmed, def);
12256
12151
  }
12257
12152
  function parseURLObject(trimmed, def) {
12258
- var _a3;
12259
- if (!def.normalize && ((_a3 = def.protocol) == null ? void 0 : _a3.source) === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
12153
+ if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
12260
12154
  return URL_BAD_FORMAT;
12261
12155
  }
12262
12156
  try {
@@ -12518,7 +12412,7 @@ function isValidJWT(token, algorithm = null) {
12518
12412
  if (!header)
12519
12413
  return false;
12520
12414
  const parsedHeader = JSON.parse(atob(header));
12521
- if ("typ" in parsedHeader && (parsedHeader == null ? void 0 : parsedHeader.typ) !== "JWT")
12415
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
12522
12416
  return false;
12523
12417
  if (!parsedHeader.alg)
12524
12418
  return false;
@@ -12678,7 +12572,7 @@ function capSize(inst, size2) {
12678
12572
  const parse2 = inst._zod.parse;
12679
12573
  inst._zod.parse = (payload, ctx) => {
12680
12574
  const n = size2(payload.value);
12681
- if (n > cap2 && !(ctx == null ? void 0 : ctx.skipChecks) && (ctx == null ? void 0 : ctx.direction) !== "backward") {
12575
+ if (n > cap2 && !ctx?.skipChecks && ctx?.direction !== "backward") {
12682
12576
  for (const [max2, ch] of sizeCaps(inst._zod.def.checks)) {
12683
12577
  if (n > max2 && ch._zod.def.when(payload)) {
12684
12578
  const start = payload.issues.length;
@@ -12702,7 +12596,7 @@ function handleArrayResult(result, final, index2) {
12702
12596
  const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
12703
12597
  $ZodType.init(inst, def);
12704
12598
  const memo2 = globalConfig.memoizer;
12705
- memo2 == null ? void 0 : memo2.attach(inst);
12599
+ memo2?.attach(inst);
12706
12600
  inst._zod.parse = (payload, ctx) => {
12707
12601
  const input = payload.value;
12708
12602
  if (!Array.isArray(input)) {
@@ -12716,7 +12610,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
12716
12610
  }
12717
12611
  payload.value = memo2 ? memo2.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
12718
12612
  const proms = [];
12719
- const abortEarly = ctx == null ? void 0 : ctx.abortEarly;
12613
+ const abortEarly = ctx?.abortEarly;
12720
12614
  for (let i = 0; i < input.length; i++) {
12721
12615
  const item = input[i];
12722
12616
  const result = def.element._zod.run({
@@ -12771,13 +12665,12 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
12771
12665
  }
12772
12666
  const NO_SYMBOL_KEYS = [];
12773
12667
  function normalizeDef(def) {
12774
- var _a3, _b2, _c, _d;
12775
12668
  const keys2 = Object.keys(def.shape);
12776
12669
  const ownSymbols = Object.getOwnPropertySymbols(def.shape);
12777
12670
  const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
12778
12671
  const allKeys = symbolKeys.length ? [...keys2, ...symbolKeys] : keys2;
12779
12672
  for (const k2 of allKeys) {
12780
- if (!((_d = (_c = (_b2 = (_a3 = def.shape) == null ? void 0 : _a3[k2]) == null ? void 0 : _b2._zod) == null ? void 0 : _c.traits) == null ? void 0 : _d.has("$ZodType"))) {
12673
+ if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) {
12781
12674
  throw new Error(`Invalid element at key "${String(k2)}": expected a Zod schema`);
12782
12675
  }
12783
12676
  }
@@ -12843,7 +12736,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
12843
12736
  const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
12844
12737
  $ZodType.init(inst, def);
12845
12738
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
12846
- const sh = (desc == null ? void 0 : desc.get) ? desc.get.raw : def.shape ?? {};
12739
+ const sh = desc?.get ? desc.get.raw : def.shape ?? {};
12847
12740
  if (sh) {
12848
12741
  const get = () => {
12849
12742
  const newSh = { ...sh };
@@ -12876,7 +12769,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
12876
12769
  const catchall = def.catchall;
12877
12770
  let value;
12878
12771
  const memo2 = globalConfig.memoizer;
12879
- memo2 == null ? void 0 : memo2.attach(inst);
12772
+ memo2?.attach(inst);
12880
12773
  inst._zod.parse = (payload, ctx) => {
12881
12774
  value ?? (value = _normalized.value);
12882
12775
  const input = payload.value;
@@ -12892,7 +12785,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
12892
12785
  payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
12893
12786
  const proms = [];
12894
12787
  const shape = value.shape;
12895
- const abortEarly = ctx == null ? void 0 : ctx.abortEarly;
12788
+ const abortEarly = ctx?.abortEarly;
12896
12789
  let seen2 = payload.issues.length;
12897
12790
  for (const key of value.allKeys) {
12898
12791
  if (abortEarly && payload.issues.length !== seen2) {
@@ -12924,7 +12817,6 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
12924
12817
  const _normalized = cached(() => normalizeDef(def));
12925
12818
  const memo2 = globalConfig.memoizer;
12926
12819
  const generateFastpass = (shape) => {
12927
- var _a3, _b2;
12928
12820
  const normalized = _normalized.value;
12929
12821
  const syms = normalized.symbolKeys;
12930
12822
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
@@ -12955,9 +12847,9 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
12955
12847
  const k2 = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
12956
12848
  const isPresent = `${k2} in input`;
12957
12849
  const schema = shape[key];
12958
- const optin = (_a3 = schema == null ? void 0 : schema._zod) == null ? void 0 : _a3.optin;
12850
+ const optin = schema?._zod?.optin;
12959
12851
  const isOptionalIn = optin !== void 0;
12960
- const isOptionalOut = ((_b2 = schema == null ? void 0 : schema._zod) == null ? void 0 : _b2.optout) === "optional";
12852
+ const isOptionalOut = schema?._zod?.optout === "optional";
12961
12853
  doc.write(`const ${id} = ${parseStr(k2)};`);
12962
12854
  if (isOptionalIn && isOptionalOut) {
12963
12855
  const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
@@ -13035,13 +12927,13 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
13035
12927
  });
13036
12928
  return payload;
13037
12929
  }
13038
- if (jit && fastEnabled && (ctx == null ? void 0 : ctx.async) === false && ctx.jitless !== true) {
12930
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
13039
12931
  if (!fastpass)
13040
12932
  fastpass = generateFastpass(def.shape);
13041
12933
  payload = fastpass(payload, ctx);
13042
12934
  if (!catchall)
13043
12935
  return payload;
13044
- return handleCatchall([], input, payload, ctx, value, inst, (ctx == null ? void 0 : ctx.abortEarly) === true);
12936
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
13045
12937
  }
13046
12938
  return superParse(payload, ctx);
13047
12939
  };
@@ -13112,10 +13004,9 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
13112
13004
  };
13113
13005
  });
13114
13006
  function discriminatorMap(def) {
13115
- var _a3;
13116
13007
  const map2 = /* @__PURE__ */ new Map();
13117
13008
  for (const option of def.options) {
13118
- const values = (_a3 = option._zod.propValues) == null ? void 0 : _a3[def.discriminator];
13009
+ const values = option._zod.propValues?.[def.discriminator];
13119
13010
  if (!values || values.size === 0)
13120
13011
  throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
13121
13012
  for (const value of values) {
@@ -13135,14 +13026,13 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
13135
13026
  $ZodUnion.init(inst, def);
13136
13027
  const _super = inst._zod.parse;
13137
13028
  defineLazyInternal(inst, "propValues", (zod) => {
13138
- var _a3, _b2;
13139
13029
  const propValues = {};
13140
13030
  let undefinedCount = 0;
13141
13031
  for (const option of zod.def.options) {
13142
13032
  const pv = option._zod.propValues;
13143
13033
  if (!pv || Object.keys(pv).length === 0)
13144
13034
  throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
13145
- if ((_a3 = pv[zod.def.discriminator]) == null ? void 0 : _a3.has(void 0))
13035
+ if (pv[zod.def.discriminator]?.has(void 0))
13146
13036
  undefinedCount++;
13147
13037
  for (const [k2, v2] of Object.entries(pv)) {
13148
13038
  if (!Object.prototype.hasOwnProperty.call(propValues, k2)) {
@@ -13154,7 +13044,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
13154
13044
  }
13155
13045
  }
13156
13046
  if (!zod.def.unionFallback && undefinedCount > 1)
13157
- (_b2 = propValues[zod.def.discriminator]) == null ? void 0 : _b2.delete(void 0);
13047
+ propValues[zod.def.discriminator]?.delete(void 0);
13158
13048
  return propValues;
13159
13049
  });
13160
13050
  def.options.forEach((option, i) => {
@@ -13175,7 +13065,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
13175
13065
  });
13176
13066
  return payload;
13177
13067
  }
13178
- const value = input == null ? void 0 : input[def.discriminator];
13068
+ const value = input?.[def.discriminator];
13179
13069
  const opt = disc.value.get(value);
13180
13070
  if (opt && (value !== void 0 || ctx.direction !== "backward")) {
13181
13071
  return opt._zod.run(payload, ctx);
@@ -13264,12 +13154,11 @@ function handleIntersectionResults(result, left, right) {
13264
13154
  let unrecIssue;
13265
13155
  const keyIssues = /* @__PURE__ */ new Map();
13266
13156
  const collect = (iss, side) => {
13267
- var _a3, _b2;
13268
13157
  let keys2;
13269
- if (iss.code === "unrecognized_keys" && !((_a3 = iss.path) == null ? void 0 : _a3.length)) {
13158
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
13270
13159
  unrecIssue ?? (unrecIssue = iss);
13271
13160
  keys2 = iss.keys;
13272
- } else if (iss.code === "invalid_key" && iss.origin === "record" && ((_b2 = iss.path) == null ? void 0 : _b2.length) === 1) {
13161
+ } else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
13273
13162
  const k2 = String(iss.path[0]);
13274
13163
  if (!keyIssues.has(k2))
13275
13164
  keyIssues.set(k2, iss);
@@ -13314,7 +13203,7 @@ function handleIntersectionResults(result, left, right) {
13314
13203
  const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
13315
13204
  $ZodType.init(inst, def);
13316
13205
  const memo2 = globalConfig.memoizer;
13317
- memo2 == null ? void 0 : memo2.attach(inst);
13206
+ memo2?.attach(inst);
13318
13207
  inst._zod.parse = (payload, ctx) => {
13319
13208
  const input = payload.value;
13320
13209
  if (!isPlainObject$1(input)) {
@@ -13512,10 +13401,9 @@ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
13512
13401
  };
13513
13402
  });
13514
13403
  const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
13515
- var _a3;
13516
13404
  $ZodType.init(inst, def);
13517
13405
  inst._zod.optin = "optional";
13518
- (_a3 = globalConfig.memoizer) == null ? void 0 : _a3.guard(inst);
13406
+ globalConfig.memoizer?.guard(inst);
13519
13407
  inst._zod.parse = (payload, ctx) => {
13520
13408
  if (ctx.direction === "backward") {
13521
13409
  throw new $ZodEncodeError(inst.constructor.name);
@@ -13717,14 +13605,8 @@ const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) =>
13717
13605
  $ZodType.init(inst, def);
13718
13606
  defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
13719
13607
  defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
13720
- defineLazyInternal(inst, "optin", (zod) => {
13721
- var _a3, _b2;
13722
- return (_b2 = (_a3 = zod.def.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b2.optin;
13723
- });
13724
- defineLazyInternal(inst, "optout", (zod) => {
13725
- var _a3, _b2;
13726
- return (_b2 = (_a3 = zod.def.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b2.optout;
13727
- });
13608
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
13609
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
13728
13610
  inst._zod.parse = (payload, ctx) => {
13729
13611
  if (ctx.direction === "backward") {
13730
13612
  return def.innerType._zod.run(payload, ctx);
@@ -13749,22 +13631,10 @@ const $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
13749
13631
  d2._cachedInner = def.getter();
13750
13632
  return d2._cachedInner;
13751
13633
  });
13752
- defineLazyInternal(inst, "pattern", (zod) => {
13753
- var _a3, _b2;
13754
- return (_b2 = (_a3 = zod.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b2.pattern;
13755
- });
13756
- defineLazyInternal(inst, "propValues", (zod) => {
13757
- var _a3, _b2;
13758
- return (_b2 = (_a3 = zod.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b2.propValues;
13759
- });
13760
- defineLazyInternal(inst, "optin", (zod) => {
13761
- var _a3, _b2;
13762
- return ((_b2 = (_a3 = zod.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b2.optin) ?? void 0;
13763
- });
13764
- defineLazyInternal(inst, "optout", (zod) => {
13765
- var _a3, _b2;
13766
- return ((_b2 = (_a3 = zod.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b2.optout) ?? void 0;
13767
- });
13634
+ defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
13635
+ defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
13636
+ defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? void 0);
13637
+ defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? void 0);
13768
13638
  inst._zod.parse = (payload, ctx) => {
13769
13639
  const inner = inst._zod.innerType;
13770
13640
  return inner._zod.run(payload, ctx);
@@ -13830,20 +13700,19 @@ function isRecursive(inst, stack, resolve) {
13830
13700
  stack.add(inst);
13831
13701
  let result = NONE;
13832
13702
  const check = (child) => {
13833
- if (result !== PROVEN && (child == null ? void 0 : child._zod)) {
13703
+ if (result !== PROVEN && child?._zod) {
13834
13704
  const answer = isRecursive(child, stack);
13835
13705
  if (answer > result)
13836
13706
  result = answer;
13837
13707
  }
13838
13708
  };
13839
13709
  const shape = (sh, spread) => {
13840
- var _a3;
13841
13710
  let answer = NONE;
13842
13711
  for (const key of Reflect.ownKeys(sh)) {
13843
13712
  const desc = Object.getOwnPropertyDescriptor(sh, key);
13844
13713
  if (!desc.enumerable)
13845
13714
  continue;
13846
- const child = desc.get ? ASSUMED : ((_a3 = desc.value) == null ? void 0 : _a3._zod) ? isRecursive(desc.value, stack) : NONE;
13715
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack) : NONE;
13847
13716
  if (child > answer)
13848
13717
  answer = child;
13849
13718
  }
@@ -13980,8 +13849,8 @@ const memo = {
13980
13849
  return empty2;
13981
13850
  },
13982
13851
  guard(inst) {
13983
- var _a3;
13984
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
13852
+ var _a2;
13853
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
13985
13854
  inst._zod.deferred.push(() => {
13986
13855
  const base = inst._zod.parse;
13987
13856
  const wrapped = (payload, ctx) => {
@@ -13995,12 +13864,12 @@ const memo = {
13995
13864
  });
13996
13865
  },
13997
13866
  attach(inst) {
13998
- var _a3;
13867
+ var _a2;
13999
13868
  let isRecursiveInst;
14000
13869
  let rechecked = false;
14001
13870
  let lastCtx;
14002
13871
  let lastBucket;
14003
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
13872
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
14004
13873
  inst._zod.deferred.push(() => {
14005
13874
  const base = inst._zod.parse;
14006
13875
  const wrapped = (payload, ctx) => {
@@ -14072,8 +13941,7 @@ function memoizer() {
14072
13941
  return memo;
14073
13942
  }
14074
13943
  function isBackEdge(ctx, value) {
14075
- var _a3;
14076
- const backEdges = (_a3 = ctx[STATE]) == null ? void 0 : _a3.backEdges;
13944
+ const backEdges = ctx[STATE]?.backEdges;
14077
13945
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
14078
13946
  }
14079
13947
  const error = () => {
@@ -14798,28 +14666,28 @@ function assignProps(target2, ...sources) {
14798
14666
  return target2;
14799
14667
  }
14800
14668
  function initializeContext(params) {
14801
- let target2 = (params == null ? void 0 : params.target) ?? "draft-2020-12";
14669
+ let target2 = params?.target ?? "draft-2020-12";
14802
14670
  if (target2 === "draft-4")
14803
14671
  target2 = "draft-04";
14804
14672
  if (target2 === "draft-7")
14805
14673
  target2 = "draft-07";
14806
14674
  return {
14807
14675
  processors: params.processors ?? {},
14808
- metadataRegistry: (params == null ? void 0 : params.metadata) ?? globalRegistry,
14676
+ metadataRegistry: params?.metadata ?? globalRegistry,
14809
14677
  target: target2,
14810
- unrepresentable: (params == null ? void 0 : params.unrepresentable) ?? "throw",
14811
- override: (params == null ? void 0 : params.override) ?? (() => {
14678
+ unrepresentable: params?.unrepresentable ?? "throw",
14679
+ override: params?.override ?? (() => {
14812
14680
  }),
14813
- io: (params == null ? void 0 : params.io) ?? "output",
14681
+ io: params?.io ?? "output",
14814
14682
  counter: 0,
14815
14683
  seen: /* @__PURE__ */ new Map(),
14816
14684
  sharedDefsExtractedFor: void 0,
14817
14685
  sharedEmitDoneFor: void 0,
14818
- cycles: (params == null ? void 0 : params.cycles) ?? "ref",
14819
- reused: (params == null ? void 0 : params.reused) ?? "inline",
14686
+ cycles: params?.cycles ?? "ref",
14687
+ reused: params?.reused ?? "inline",
14820
14688
  intersections: [],
14821
14689
  deferred: [],
14822
- external: (params == null ? void 0 : params.external) ?? void 0
14690
+ external: params?.external ?? void 0
14823
14691
  };
14824
14692
  }
14825
14693
  function handleUnrepresentable(schema, ctx, json, params, message) {
@@ -14832,8 +14700,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
14832
14700
  return true;
14833
14701
  }
14834
14702
  function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
14835
- var _a4, _b2;
14836
- var _a3;
14703
+ var _a2;
14837
14704
  const def = schema._zod.def;
14838
14705
  const seen2 = ctx.seen.get(schema);
14839
14706
  if (seen2) {
@@ -14848,7 +14715,7 @@ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
14848
14715
  ctx.seen.set(schema, result);
14849
14716
  ctx.sharedDefsExtractedFor = void 0;
14850
14717
  ctx.sharedEmitDoneFor = void 0;
14851
- const overrideSchema = (_b2 = (_a4 = schema._zod).toJSONSchema) == null ? void 0 : _b2.call(_a4);
14718
+ const overrideSchema = schema._zod.toJSONSchema?.();
14852
14719
  if (overrideSchema) {
14853
14720
  result.schema = overrideSchema;
14854
14721
  } else {
@@ -14883,7 +14750,7 @@ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
14883
14750
  delete result.schema.default;
14884
14751
  }
14885
14752
  if (ctx.io === "input" && "_prefault" in result.schema)
14886
- (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
14753
+ (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
14887
14754
  delete result.schema._prefault;
14888
14755
  const _result = ctx.seen.get(schema);
14889
14756
  return _result.schema;
@@ -14892,7 +14759,6 @@ function encodeJSONPointerSegment(segment2) {
14892
14759
  return segment2.replace(/~/g, "~0").replace(/\//g, "~1");
14893
14760
  }
14894
14761
  function extractDefs(ctx, schema) {
14895
- var _a3, _b2, _c, _d;
14896
14762
  const root2 = ctx.seen.get(schema);
14897
14763
  if (!root2)
14898
14764
  throw new Error("Unprocessed schema. This is a bug in Zod.");
@@ -14900,7 +14766,7 @@ function extractDefs(ctx, schema) {
14900
14766
  return;
14901
14767
  const idToSchema = /* @__PURE__ */ new Map();
14902
14768
  for (const entry of ctx.seen.entries()) {
14903
- const id = (_a3 = ctx.metadataRegistry.get(entry[0])) == null ? void 0 : _a3.id;
14769
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
14904
14770
  if (id) {
14905
14771
  const existing = idToSchema.get(id);
14906
14772
  if (existing && existing !== entry[0]) {
@@ -14910,10 +14776,9 @@ function extractDefs(ctx, schema) {
14910
14776
  }
14911
14777
  }
14912
14778
  const makeURI = (entry) => {
14913
- var _a4;
14914
14779
  const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
14915
14780
  if (ctx.external) {
14916
- const externalId = (_a4 = ctx.external.registry.get(entry[0])) == null ? void 0 : _a4.id;
14781
+ const externalId = ctx.external.registry.get(entry[0])?.id;
14917
14782
  const uriGenerator = ctx.external.uri ?? ((id2) => id2);
14918
14783
  if (externalId) {
14919
14784
  return { ref: uriGenerator(externalId) };
@@ -14949,7 +14814,7 @@ function extractDefs(ctx, schema) {
14949
14814
  for (const entry of ctx.seen.entries()) {
14950
14815
  const seen2 = entry[1];
14951
14816
  if (seen2.cycle) {
14952
- throw new Error(`Cycle detected: #/${(_b2 = seen2.cycle) == null ? void 0 : _b2.join("/")}/<root>
14817
+ throw new Error(`Cycle detected: #/${seen2.cycle?.join("/")}/<root>
14953
14818
 
14954
14819
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
14955
14820
  }
@@ -14962,13 +14827,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14962
14827
  continue;
14963
14828
  }
14964
14829
  if (ctx.external) {
14965
- const ext = (_c = ctx.external.registry.get(entry[0])) == null ? void 0 : _c.id;
14830
+ const ext = ctx.external.registry.get(entry[0])?.id;
14966
14831
  if (schema !== entry[0] && ext) {
14967
14832
  extractToDef(entry);
14968
14833
  continue;
14969
14834
  }
14970
14835
  }
14971
- const id = (_d = ctx.metadataRegistry.get(entry[0])) == null ? void 0 : _d.id;
14836
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
14972
14837
  if (id) {
14973
14838
  extractToDef(entry);
14974
14839
  continue;
@@ -15018,7 +14883,6 @@ function undeclaredConstraint(member) {
15018
14883
  return Object.keys(extra).length ? extra : null;
15019
14884
  }
15020
14885
  function foldObjects(members2) {
15021
- var _a3;
15022
14886
  const objects = [];
15023
14887
  for (const member of members2) {
15024
14888
  if (typeof member !== "object" || member.type !== "object")
@@ -15037,7 +14901,7 @@ function foldObjects(members2) {
15037
14901
  continue;
15038
14902
  const parts = [];
15039
14903
  for (const other of objects) {
15040
- const part = ((_a3 = other.properties) == null ? void 0 : _a3[key]) ?? undeclaredConstraint(other);
14904
+ const part = other.properties?.[key] ?? undeclaredConstraint(other);
15041
14905
  if (part === null || part === void 0)
15042
14906
  continue;
15043
14907
  if (!parts.some((seen2) => JSON.stringify(seen2) === JSON.stringify(part)))
@@ -15096,7 +14960,6 @@ function foldIntersection(json) {
15096
14960
  assignProps(json, folded);
15097
14961
  }
15098
14962
  function finalize(ctx, schema) {
15099
- var _a3, _b2, _c, _d;
15100
14963
  const root2 = ctx.seen.get(schema);
15101
14964
  if (!root2)
15102
14965
  throw new Error("Unprocessed schema. This is a bug in Zod.");
@@ -15143,7 +15006,7 @@ function finalize(ctx, schema) {
15143
15006
  if (parent && parent !== ref) {
15144
15007
  flattenRef(parent);
15145
15008
  const parentSeen = ctx.seen.get(parent);
15146
- if (parentSeen == null ? void 0 : parentSeen.schema.$ref) {
15009
+ if (parentSeen?.schema.$ref) {
15147
15010
  schema2.$ref = parentSeen.schema.$ref;
15148
15011
  if (parentSeen.def) {
15149
15012
  for (const key in schema2) {
@@ -15177,7 +15040,7 @@ function finalize(ctx, schema) {
15177
15040
  const carriers = /* @__PURE__ */ new Map();
15178
15041
  for (const seen2 of ctx.seen.values()) {
15179
15042
  for (const json of [seen2.schema, seen2.def]) {
15180
- const allOf = json == null ? void 0 : json.allOf;
15043
+ const allOf = json?.allOf;
15181
15044
  if (!Array.isArray(allOf))
15182
15045
  continue;
15183
15046
  const existing = carriers.get(allOf);
@@ -15202,17 +15065,17 @@ function finalize(ctx, schema) {
15202
15065
  result.$schema = "http://json-schema.org/draft-04/schema#";
15203
15066
  } else if (ctx.target === "openapi-3.0") ;
15204
15067
  else ;
15205
- if ((_a3 = ctx.external) == null ? void 0 : _a3.uri) {
15206
- const id = (_b2 = ctx.external.registry.get(schema)) == null ? void 0 : _b2.id;
15068
+ if (ctx.external?.uri) {
15069
+ const id = ctx.external.registry.get(schema)?.id;
15207
15070
  if (!id)
15208
15071
  throw new Error("Schema is missing an `id` property");
15209
15072
  result.$id = ctx.external.uri(id);
15210
15073
  }
15211
15074
  assignProps(result, root2.defId ? root2.schema : root2.def ?? root2.schema);
15212
- const rootMetaId = (_c = ctx.metadataRegistry.get(schema)) == null ? void 0 : _c.id;
15075
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
15213
15076
  if (rootMetaId !== void 0 && result.id === rootMetaId)
15214
15077
  delete result.id;
15215
- const defs = ((_d = ctx.external) == null ? void 0 : _d.defs) ?? {};
15078
+ const defs = ctx.external?.defs ?? {};
15216
15079
  if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
15217
15080
  for (const entry of ctx.seen.entries()) {
15218
15081
  const seen2 = entry[1];
@@ -15380,12 +15243,11 @@ const contributors = {
15380
15243
  mime_type: (agg, def) => intersectMime(agg, def.mime)
15381
15244
  };
15382
15245
  function aggregateChecks(schema) {
15383
- var _a3;
15384
15246
  const agg = {};
15385
15247
  const def = schema._zod.def;
15386
15248
  const list2 = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
15387
15249
  for (const ch of list2)
15388
- (_a3 = contributors[ch._zod.def.check]) == null ? void 0 : _a3.call(contributors, agg, ch._zod.def);
15250
+ contributors[ch._zod.def.check]?.(agg, ch._zod.def);
15389
15251
  const bag = schema._zod.bag;
15390
15252
  if (bag.minimum !== void 0)
15391
15253
  narrowMin(agg, "minimum", bag.minimum);
@@ -15604,7 +15466,6 @@ function inputOptin(schema) {
15604
15466
  return schema._zod.optin;
15605
15467
  }
15606
15468
  const objectProcessor = (schema, ctx, _json, params) => {
15607
- var _a3;
15608
15469
  const json = _json;
15609
15470
  const def = schema._zod.def;
15610
15471
  const shape = def.shape;
@@ -15630,7 +15491,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
15630
15491
  if (requiredKeys.length > 0) {
15631
15492
  json.required = requiredKeys;
15632
15493
  }
15633
- if (((_a3 = def.catchall) == null ? void 0 : _a3._zod.def.type) === "never") {
15494
+ if (def.catchall?._zod.def.type === "never") {
15634
15495
  json.additionalProperties = false;
15635
15496
  } else if (!def.catchall) {
15636
15497
  if (ctx.io === "output")
@@ -15674,12 +15535,11 @@ const intersectionProcessor = (schema, ctx, json, params) => {
15674
15535
  ctx.intersections.push(allOf);
15675
15536
  };
15676
15537
  function stringifyKeyNames(bySchema, json, visited) {
15677
- var _a3;
15678
15538
  if (json.$ref) {
15679
15539
  if (visited.has(json))
15680
15540
  return json;
15681
15541
  visited.add(json);
15682
- const def = (_a3 = bySchema.get(json)) == null ? void 0 : _a3.def;
15542
+ const def = bySchema.get(json)?.def;
15683
15543
  if (!def)
15684
15544
  return json;
15685
15545
  const inlined = stringifyKeyNames(bySchema, def, visited);
@@ -15696,7 +15556,7 @@ function stringifyKeyNames(bySchema, json, visited) {
15696
15556
  const types2 = Array.isArray(json.type) ? json.type : [json.type];
15697
15557
  const numericType = !types2.includes("string") && types2.some((t) => t === "number" || t === "integer");
15698
15558
  const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
15699
- if (!numericType && !(values == null ? void 0 : values.some((v2) => typeof v2 === "number")))
15559
+ if (!numericType && !values?.some((v2) => typeof v2 === "number"))
15700
15560
  return json;
15701
15561
  const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
15702
15562
  if (rest.enum)
@@ -15712,7 +15572,6 @@ function stringifyKeyNames(bySchema, json, visited) {
15712
15572
  }
15713
15573
  const pendingRecords = /* @__PURE__ */ new WeakMap();
15714
15574
  function rewriteKeyNames(ctx) {
15715
- var _a3;
15716
15575
  const bySchema = /* @__PURE__ */ new Map();
15717
15576
  for (const entry of ctx.seen.values()) {
15718
15577
  if (entry.def && !bySchema.has(entry.schema))
@@ -15721,7 +15580,7 @@ function rewriteKeyNames(ctx) {
15721
15580
  const rewrites = /* @__PURE__ */ new Map();
15722
15581
  for (const record2 of pendingRecords.get(ctx) ?? []) {
15723
15582
  const seen2 = ctx.seen.get(record2);
15724
- const names = (_a3 = (seen2 == null ? void 0 : seen2.def) ?? (seen2 == null ? void 0 : seen2.schema)) == null ? void 0 : _a3.propertyNames;
15583
+ const names = (seen2?.def ?? seen2?.schema)?.propertyNames;
15725
15584
  if (!names || names === true || rewrites.has(names))
15726
15585
  continue;
15727
15586
  const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
@@ -15798,7 +15657,7 @@ const nonoptionalProcessor = (schema, ctx, _json, params) => {
15798
15657
  const seen2 = ctx.seen.get(schema);
15799
15658
  seen2.ref = def.innerType;
15800
15659
  };
15801
- const UNREPRESENTABLE_DEFAULT = Symbol();
15660
+ const UNREPRESENTABLE_DEFAULT = /* @__PURE__ */ Symbol();
15802
15661
  function serializeDefaultValue(value, schema, ctx, json, params) {
15803
15662
  let unrepresentable = false;
15804
15663
  const serialized = JSON.stringify(value, (_2, val) => {
@@ -16064,7 +15923,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
16064
15923
  },
16065
15924
  // `spa` is an alias: same function object as `safeParseAsync`, as before.
16066
15925
  get spa() {
16067
- return this == null ? void 0 : this.safeParseAsync;
15926
+ return this?.safeParseAsync;
16068
15927
  },
16069
15928
  set spa(value) {
16070
15929
  own$9(this, "spa", value);
@@ -16104,8 +15963,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
16104
15963
  },
16105
15964
  // Reads through to the registry on every access, so it must not cache.
16106
15965
  get description() {
16107
- var _a3;
16108
- return (_a3 = globalRegistry.get(this)) == null ? void 0 : _a3.description;
15966
+ return globalRegistry.get(this)?.description;
16109
15967
  },
16110
15968
  // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
16111
15969
  get _def() {
@@ -16372,7 +16230,7 @@ const ZodNumber = /* @__PURE__ */ $constructor(
16372
16230
  },
16373
16231
  isInt: (inst) => {
16374
16232
  const { isInt, multipleOf } = aggregateChecks(inst);
16375
- return !!isInt || !!(multipleOf == null ? void 0 : multipleOf.some(Number.isSafeInteger));
16233
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
16376
16234
  },
16377
16235
  format: (inst) => aggregateChecks(inst).format ?? null
16378
16236
  }, {
@@ -17514,8 +17372,7 @@ function createEncryptedMarker(data) {
17514
17372
  return obj;
17515
17373
  }
17516
17374
  function isEncryptedMarker(value) {
17517
- var _a3;
17518
- return value !== null && typeof value === "object" && ((_a3 = value.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME;
17375
+ return value !== null && typeof value === "object" && value.constructor?.name === ENCRYPTED_DISPLAY_NAME;
17519
17376
  }
17520
17377
  const EXPIRED_DISPLAY_NAME = "Expired Data";
17521
17378
  function createExpiredMarker() {
@@ -17524,8 +17381,7 @@ function createExpiredMarker() {
17524
17381
  return Object.create(ctor.prototype);
17525
17382
  }
17526
17383
  function isExpiredMarker(value) {
17527
- var _a3;
17528
- return value !== null && typeof value === "object" && ((_a3 = value.constructor) == null ? void 0 : _a3.name) === EXPIRED_DISPLAY_NAME;
17384
+ return value !== null && typeof value === "object" && value.constructor?.name === EXPIRED_DISPLAY_NAME;
17529
17385
  }
17530
17386
  function toDisplayMarker(value) {
17531
17387
  if (isEncryptedData(value))
@@ -17561,7 +17417,7 @@ async function hydrateResourceIOWithKey(resource, key) {
17561
17417
  return { hydrateDataWithKey: hydrateDataWithKey3 };
17562
17418
  }, true ? void 0 : void 0);
17563
17419
  const { importKey } = await __vitePreload(async () => {
17564
- const { importKey: importKey2 } = await import("./encryption-Cu4jq70Y.js");
17420
+ const { importKey: importKey2 } = await import("./encryption-BhH0xZid.js");
17565
17421
  return { importKey: importKey2 };
17566
17422
  }, true ? __vite__mapDeps([0,1,2]) : void 0);
17567
17423
  const cryptoKey = await importKey(key);
@@ -18862,13 +18718,12 @@ function mergeProps(slotProps, childProps) {
18862
18718
  return { ...slotProps, ...overrideProps };
18863
18719
  }
18864
18720
  function getElementRef(element2) {
18865
- var _a3, _b2;
18866
- let getter = (_a3 = Object.getOwnPropertyDescriptor(element2.props, "ref")) == null ? void 0 : _a3.get;
18721
+ let getter = Object.getOwnPropertyDescriptor(element2.props, "ref")?.get;
18867
18722
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
18868
18723
  if (mayWarn) {
18869
18724
  return element2.ref;
18870
18725
  }
18871
- getter = (_b2 = Object.getOwnPropertyDescriptor(element2, "ref")) == null ? void 0 : _b2.get;
18726
+ getter = Object.getOwnPropertyDescriptor(element2, "ref")?.get;
18872
18727
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
18873
18728
  if (mayWarn) {
18874
18729
  return element2.props.ref;
@@ -19138,7 +18993,7 @@ function ContextCardProvider({ children: children2, portalTarget }) {
19138
18993
  setVisible(id !== null);
19139
18994
  }
19140
18995
  const updateActiveContextCard = (update) => {
19141
- if ((update == null ? void 0 : update.id) !== activeId.current && update !== null)
18996
+ if (update?.id !== activeId.current && update !== null)
19142
18997
  return;
19143
18998
  setActiveContextCard(update);
19144
18999
  };
@@ -19180,7 +19035,7 @@ function ContextCardProvider({ children: children2, portalTarget }) {
19180
19035
  }
19181
19036
  return 0;
19182
19037
  }, [activeBounds, lastBounds]);
19183
- const distanceFromLast = reactExports.useMemo(() => Math.sqrt((((lastBounds == null ? void 0 : lastBounds.x) ?? 0) - activeBounds.x) ** 2 + (((lastBounds == null ? void 0 : lastBounds.y) ?? 0) - activeBounds.y) ** 2), [activeBounds.x, activeBounds.y, lastBounds == null ? void 0 : lastBounds.x, lastBounds == null ? void 0 : lastBounds.y]);
19038
+ const distanceFromLast = reactExports.useMemo(() => Math.sqrt(((lastBounds?.x ?? 0) - activeBounds.x) ** 2 + ((lastBounds?.y ?? 0) - activeBounds.y) ** 2), [activeBounds.x, activeBounds.y, lastBounds?.x, lastBounds?.y]);
19184
19039
  const lastOrigin = reactExports.useMemo(() => {
19185
19040
  if (!lastBounds)
19186
19041
  return null;
@@ -19488,7 +19343,7 @@ function ContextCardTrigger({ content: content2, children: children2, side = "ri
19488
19343
  }
19489
19344
  }
19490
19345
  const Comp = asChild ? Root : "div";
19491
- return jsxRuntimeExports.jsxs(Comp, { className: cn$4("inline-flex cursor-pointer flex-[0_1_auto] overflow-hidden", className), onMouseEnter, onMouseLeave, onClick: handleClick, ref: triggerRef, children: [jsxRuntimeExports.jsx(Slottable, { children: children2 }), (portalRef == null ? void 0 : portalRef.current) && (localHover || persisting) ? reactDomExports.createPortal(jsxRuntimeExports.jsx("div", { className: cn$4("absolute top-0 p-3 left-0 max-w-max transition-[transform,width,height] duration-250 ease-[easing-function:cubic-bezier(0.29,0.31,0.05,0.96)] will-change-[transform,width,height] motion-reduce:!transition-none", skipTransition && "!transition-none"), ref: contentRef, style: {
19346
+ return jsxRuntimeExports.jsxs(Comp, { className: cn$4("inline-flex cursor-pointer flex-[0_1_auto] overflow-hidden", className), onMouseEnter, onMouseLeave, onClick: handleClick, ref: triggerRef, children: [jsxRuntimeExports.jsx(Slottable, { children: children2 }), portalRef?.current && (localHover || persisting) ? reactDomExports.createPortal(jsxRuntimeExports.jsx("div", { className: cn$4("absolute top-0 p-3 left-0 max-w-max transition-[transform,width,height] duration-250 ease-[easing-function:cubic-bezier(0.29,0.31,0.05,0.96)] will-change-[transform,width,height] motion-reduce:!transition-none", skipTransition && "!transition-none"), ref: contentRef, style: {
19492
19347
  ...noPadding ? { padding: 0 } : {},
19493
19348
  pointerEvents: rootVisible && visible && !ignoreCardPointerEvents ? "all" : "none"
19494
19349
  }, children: jsxRuntimeExports.jsx("div", { className: cn$4("min-w-max transition-all duration-150 ease-[easing-function:cubic-bezier(0.3,_0.57,_0.07,_0.95)] will-change-[transform,width,height] motion-reduce:!transition-none", skipTransition ? "!transition-none" : "transition-[transform,width,height] duration-250 ease-[easing-function:cubic-bezier(0.29,0.31,0.05,0.96)] will-change-[transform,width,height] motion-reduce:!transition-none"), ref: contentMeasureRef, style: {
@@ -19550,7 +19405,7 @@ function Spinner({ size: size2 = 14, color: color5 }) {
19550
19405
  } }, delay))] });
19551
19406
  }
19552
19407
  var __create = Object.create;
19553
- var __defProp2 = Object.defineProperty;
19408
+ var __defProp = Object.defineProperty;
19554
19409
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
19555
19410
  var __getOwnPropNames = Object.getOwnPropertyNames;
19556
19411
  var __getProtoOf = Object.getPrototypeOf;
@@ -19560,13 +19415,13 @@ var __commonJS = (cb, mod) => function __require() {
19560
19415
  };
19561
19416
  var __export = (target2, all2) => {
19562
19417
  for (var name2 in all2)
19563
- __defProp2(target2, name2, { get: all2[name2], enumerable: true });
19418
+ __defProp(target2, name2, { get: all2[name2], enumerable: true });
19564
19419
  };
19565
19420
  var __copyProps = (to2, from, except, desc) => {
19566
19421
  if (from && typeof from === "object" || typeof from === "function") {
19567
19422
  for (let key of __getOwnPropNames(from))
19568
19423
  if (!__hasOwnProp.call(to2, key) && key !== except)
19569
- __defProp2(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19424
+ __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19570
19425
  }
19571
19426
  return to2;
19572
19427
  };
@@ -19575,7 +19430,7 @@ var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__
19575
19430
  // file that has been converted to a CommonJS file using a Babel-
19576
19431
  // compatible transform (i.e. "__esModule" has not been set), then set
19577
19432
  // "default" to the CommonJS "module.exports" for node compatibility.
19578
- __defProp2(target2, "default", { value: mod, enumerable: true }),
19433
+ __defProp(target2, "default", { value: mod, enumerable: true }),
19579
19434
  mod
19580
19435
  ));
19581
19436
  var require_is_object = __commonJS({
@@ -20472,13 +20327,12 @@ function StreamRefInline({ streamRef }) {
20472
20327
  backgroundColor: "var(--ds-blue-100)",
20473
20328
  color: "var(--ds-blue-800)",
20474
20329
  border: "1px solid var(--ds-blue-300)"
20475
- }, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
20330
+ }, onClick: () => onStreamClick?.(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
20476
20331
  }
20477
20332
  const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
20478
20333
  function NodeRenderer({ depth, name: name2, data, isNonenumerable }) {
20479
- var _a3;
20480
20334
  const extendedTheme = reactExports.useContext(ExtendedThemeContext);
20481
- if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
20335
+ if (data !== null && typeof data === "object" && data.constructor?.name === ENCRYPTED_DISPLAY_NAME) {
20482
20336
  const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
20483
20337
  if (depth === 0) {
20484
20338
  return label;
@@ -20930,7 +20784,7 @@ function stripNullChildren(node2) {
20930
20784
  }
20931
20785
  }
20932
20786
  }
20933
- const SEEN = Symbol("node-seen");
20787
+ const SEEN = /* @__PURE__ */ Symbol("node-seen");
20934
20788
  function resolveLinkBlockPolicy(node2, policy, blockedLinkClass) {
20935
20789
  if (policy === BlockPolicy.remove) {
20936
20790
  return { type: "remove" };
@@ -24692,11 +24546,11 @@ const decodeMap = /* @__PURE__ */ new Map([
24692
24546
  [159, 376]
24693
24547
  ]);
24694
24548
  function replaceCodePoint(codePoint) {
24695
- var _a3;
24549
+ var _a2;
24696
24550
  if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
24697
24551
  return 65533;
24698
24552
  }
24699
- return (_a3 = decodeMap.get(codePoint)) !== null && _a3 !== void 0 ? _a3 : codePoint;
24553
+ return (_a2 = decodeMap.get(codePoint)) !== null && _a2 !== void 0 ? _a2 : codePoint;
24700
24554
  }
24701
24555
  var CharCodes;
24702
24556
  (function(CharCodes2) {
@@ -24891,9 +24745,9 @@ class EntityDecoder {
24891
24745
  * @returns The number of characters that were consumed.
24892
24746
  */
24893
24747
  emitNumericEntity(lastCp, expectedLength) {
24894
- var _a3;
24748
+ var _a2;
24895
24749
  if (this.consumed <= expectedLength) {
24896
- (_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
24750
+ (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed);
24897
24751
  return 0;
24898
24752
  }
24899
24753
  if (lastCp === CharCodes.SEMI) {
@@ -24953,11 +24807,11 @@ class EntityDecoder {
24953
24807
  * @returns The number of characters consumed.
24954
24808
  */
24955
24809
  emitNotTerminatedNamedEntity() {
24956
- var _a3;
24810
+ var _a2;
24957
24811
  const { result, decodeTree } = this;
24958
24812
  const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
24959
24813
  this.emitNamedEntityData(result, valueLength, this.consumed);
24960
- (_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.missingSemicolonAfterCharacterReference();
24814
+ (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.missingSemicolonAfterCharacterReference();
24961
24815
  return this.consumed;
24962
24816
  }
24963
24817
  /**
@@ -24985,7 +24839,7 @@ class EntityDecoder {
24985
24839
  * @returns The number of characters consumed.
24986
24840
  */
24987
24841
  end() {
24988
- var _a3;
24842
+ var _a2;
24989
24843
  switch (this.state) {
24990
24844
  case EntityDecoderState.NamedEntity: {
24991
24845
  return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
@@ -24998,7 +24852,7 @@ class EntityDecoder {
24998
24852
  return this.emitNumericEntity(0, 3);
24999
24853
  }
25000
24854
  case EntityDecoderState.NumericStart: {
25001
- (_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
24855
+ (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed);
25002
24856
  return 0;
25003
24857
  }
25004
24858
  case EntityDecoderState.EntityStart: {
@@ -25437,8 +25291,8 @@ const TAG_NAME_TO_ID = /* @__PURE__ */ new Map([
25437
25291
  [TAG_NAMES.XMP, TAG_ID.XMP]
25438
25292
  ]);
25439
25293
  function getTagID(tagName) {
25440
- var _a3;
25441
- return (_a3 = TAG_NAME_TO_ID.get(tagName)) !== null && _a3 !== void 0 ? _a3 : TAG_ID.UNKNOWN;
25294
+ var _a2;
25295
+ return (_a2 = TAG_NAME_TO_ID.get(tagName)) !== null && _a2 !== void 0 ? _a2 : TAG_ID.UNKNOWN;
25442
25296
  }
25443
25297
  const $$2 = TAG_ID;
25444
25298
  const SPECIAL_ELEMENTS = {
@@ -25700,8 +25554,8 @@ class Tokenizer {
25700
25554
  }
25701
25555
  //Errors
25702
25556
  _err(code2, cpOffset = 0) {
25703
- var _a3, _b2;
25704
- (_b2 = (_a3 = this.handler).onParseError) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, this.preprocessor.getError(code2, cpOffset));
25557
+ var _a2, _b;
25558
+ (_b = (_a2 = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a2, this.preprocessor.getError(code2, cpOffset));
25705
25559
  }
25706
25560
  // NOTE: `offset` may never run across line boundaries.
25707
25561
  getCurrentLocation(offset2) {
@@ -25843,13 +25697,13 @@ class Tokenizer {
25843
25697
  this.currentLocation = this.getCurrentLocation(0);
25844
25698
  }
25845
25699
  _leaveAttrName() {
25846
- var _a3;
25847
- var _b2;
25700
+ var _a2;
25701
+ var _b;
25848
25702
  const token = this.currentToken;
25849
25703
  if (getTokenAttr(token, this.currentAttr.name) === null) {
25850
25704
  token.attrs.push(this.currentAttr);
25851
25705
  if (token.location && this.currentLocation) {
25852
- const attrLocations = (_a3 = (_b2 = token.location).attrs) !== null && _a3 !== void 0 ? _a3 : _b2.attrs = /* @__PURE__ */ Object.create(null);
25706
+ const attrLocations = (_a2 = (_b = token.location).attrs) !== null && _a2 !== void 0 ? _a2 : _b.attrs = /* @__PURE__ */ Object.create(null);
25853
25707
  attrLocations[this.currentAttr.name] = this.currentLocation;
25854
25708
  this._leaveAttrValue();
25855
25709
  }
@@ -29176,10 +29030,10 @@ class Parser {
29176
29030
  //Errors
29177
29031
  /** @internal */
29178
29032
  _err(token, code2, beforeToken) {
29179
- var _a3;
29033
+ var _a2;
29180
29034
  if (!this.onParseError)
29181
29035
  return;
29182
- const loc = (_a3 = token.location) !== null && _a3 !== void 0 ? _a3 : BASE_LOC;
29036
+ const loc = (_a2 = token.location) !== null && _a2 !== void 0 ? _a2 : BASE_LOC;
29183
29037
  const err = {
29184
29038
  code: code2,
29185
29039
  startLine: loc.startLine,
@@ -29194,18 +29048,18 @@ class Parser {
29194
29048
  //Stack events
29195
29049
  /** @internal */
29196
29050
  onItemPush(node2, tid, isTop) {
29197
- var _a3, _b2;
29198
- (_b2 = (_a3 = this.treeAdapter).onItemPush) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, node2);
29051
+ var _a2, _b;
29052
+ (_b = (_a2 = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a2, node2);
29199
29053
  if (isTop && this.openElements.stackTop > 0)
29200
29054
  this._setContextModes(node2, tid);
29201
29055
  }
29202
29056
  /** @internal */
29203
29057
  onItemPop(node2, isTop) {
29204
- var _a3, _b2;
29058
+ var _a2, _b;
29205
29059
  if (this.options.sourceCodeLocationInfo) {
29206
29060
  this._setEndLocation(node2, this.currentToken);
29207
29061
  }
29208
- (_b2 = (_a3 = this.treeAdapter).onItemPop) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, node2, this.openElements.current);
29062
+ (_b = (_a2 = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a2, node2, this.openElements.current);
29209
29063
  if (isTop) {
29210
29064
  let current;
29211
29065
  let currentTagId;
@@ -31268,9 +31122,9 @@ function eofInBody(p2, token) {
31268
31122
  }
31269
31123
  }
31270
31124
  function endTagInText(p2, token) {
31271
- var _a3;
31125
+ var _a2;
31272
31126
  if (token.tagID === TAG_ID.SCRIPT) {
31273
- (_a3 = p2.scriptHandler) === null || _a3 === void 0 ? void 0 : _a3.call(p2, p2.openElements.current);
31127
+ (_a2 = p2.scriptHandler) === null || _a2 === void 0 ? void 0 : _a2.call(p2, p2.openElements.current);
31274
31128
  }
31275
31129
  p2.openElements.pop();
31276
31130
  p2.insertionMode = p2.originalInsertionMode;
@@ -31930,7 +31784,7 @@ function startTagAfterBody(p2, token) {
31930
31784
  }
31931
31785
  }
31932
31786
  function endTagAfterBody(p2, token) {
31933
- var _a3;
31787
+ var _a2;
31934
31788
  if (token.tagID === TAG_ID.HTML) {
31935
31789
  if (!p2.fragmentContext) {
31936
31790
  p2.insertionMode = InsertionMode.AFTER_AFTER_BODY;
@@ -31938,7 +31792,7 @@ function endTagAfterBody(p2, token) {
31938
31792
  if (p2.options.sourceCodeLocationInfo && p2.openElements.tagIDs[0] === TAG_ID.HTML) {
31939
31793
  p2._setEndLocation(p2.openElements.items[0], token);
31940
31794
  const bodyElement = p2.openElements.items[1];
31941
- if (bodyElement && !((_a3 = p2.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a3 === void 0 ? void 0 : _a3.endTag)) {
31795
+ if (bodyElement && !((_a2 = p2.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a2 === void 0 ? void 0 : _a2.endTag)) {
31942
31796
  p2._setEndLocation(bodyElement, token);
31943
31797
  }
31944
31798
  }
@@ -44159,13 +44013,12 @@ function X(u4) {
44159
44013
  return u4;
44160
44014
  }
44161
44015
  function J$1(u4, e) {
44162
- var _a3;
44163
44016
  let t = u4.replace(m.findPipe, (i, s2, a2) => {
44164
44017
  let o = false, l = s2;
44165
44018
  for (; --l >= 0 && a2[l] === "\\"; ) o = !o;
44166
44019
  return o ? "|" : " |";
44167
44020
  }), n = t.split(m.splitPipe), r2 = 0;
44168
- if (n[0].trim() || n.shift(), n.length > 0 && !((_a3 = n.at(-1)) == null ? void 0 : _a3.trim()) && n.pop(), e) if (n.length > e) n.splice(e);
44021
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
44169
44022
  else for (; n.length < e; ) n.push("");
44170
44023
  for (; r2 < n.length; r2++) n[r2] = n[r2].trim().replace(m.slashPipe, "|");
44171
44024
  return n;
@@ -44217,10 +44070,10 @@ function it$1(u4, e, t) {
44217
44070
  `);
44218
44071
  }
44219
44072
  var w = class {
44073
+ options;
44074
+ rules;
44075
+ lexer;
44220
44076
  constructor(e) {
44221
- __publicField(this, "options");
44222
- __publicField(this, "rules");
44223
- __publicField(this, "lexer");
44224
44077
  this.options = e || T;
44225
44078
  }
44226
44079
  space(e) {
@@ -44279,14 +44132,14 @@ ${c}` : c;
44279
44132
  let d2 = this.lexer.state.top;
44280
44133
  if (this.lexer.state.top = true, this.lexer.blockTokens(c, s2, true), this.lexer.state.top = d2, n.length === 0) break;
44281
44134
  let h2 = s2.at(-1);
44282
- if ((h2 == null ? void 0 : h2.type) === "code") break;
44283
- if ((h2 == null ? void 0 : h2.type) === "blockquote") {
44135
+ if (h2?.type === "code") break;
44136
+ if (h2?.type === "blockquote") {
44284
44137
  let R2 = h2, f2 = R2.raw + `
44285
44138
  ` + n.join(`
44286
44139
  `), S = this.blockquote(f2);
44287
44140
  s2[s2.length - 1] = S, r2 = r2.substring(0, r2.length - R2.raw.length) + S.raw, i = i.substring(0, i.length - R2.text.length) + S.text;
44288
44141
  break;
44289
- } else if ((h2 == null ? void 0 : h2.type) === "list") {
44142
+ } else if (h2?.type === "list") {
44290
44143
  let R2 = h2, f2 = R2.raw + `
44291
44144
  ` + n.join(`
44292
44145
  `), S = this.list(f2);
@@ -44299,7 +44152,6 @@ ${c}` : c;
44299
44152
  }
44300
44153
  }
44301
44154
  list(e) {
44302
- var _a3, _b2;
44303
44155
  let t = this.rules.block.list.exec(e);
44304
44156
  if (t) {
44305
44157
  let n = t[1].trim(), r2 = n.length > 1, i = { type: "list", raw: "", ordered: r2, start: r2 ? +n.slice(0, -1) : "", loose: false, items: [] };
@@ -44338,7 +44190,7 @@ ${c}` : c;
44338
44190
  i.raw = i.raw.trimEnd();
44339
44191
  for (let l of i.items) {
44340
44192
  if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
44341
- if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), ((_a3 = l.tokens[0]) == null ? void 0 : _a3.type) === "text" || ((_b2 = l.tokens[0]) == null ? void 0 : _b2.type) === "paragraph") {
44193
+ if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
44342
44194
  l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
44343
44195
  for (let c = this.lexer.inlineQueue.length - 1; c >= 0; c--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
44344
44196
  this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
@@ -44375,10 +44227,9 @@ ${c}` : c;
44375
44227
  }
44376
44228
  }
44377
44229
  table(e) {
44378
- var _a3;
44379
44230
  let t = this.rules.block.table.exec(e);
44380
44231
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
44381
- let n = J$1(t[1]), r2 = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = ((_a3 = t[3]) == null ? void 0 : _a3.trim()) ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
44232
+ let n = J$1(t[1]), r2 = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
44382
44233
  `) : [], s2 = { type: "table", raw: t[0], header: [], align: [], rows: [] };
44383
44234
  if (n.length === r2.length) {
44384
44235
  for (let a2 of r2) this.rules.other.tableAlignRight.test(a2) ? s2.align.push("right") : this.rules.other.tableAlignCenter.test(a2) ? s2.align.push("center") : this.rules.other.tableAlignLeft.test(a2) ? s2.align.push("left") : s2.align.push(null);
@@ -44509,7 +44360,6 @@ ${c}` : c;
44509
44360
  }
44510
44361
  }
44511
44362
  url(e) {
44512
- var _a3;
44513
44363
  let t;
44514
44364
  if (t = this.rules.inline.url.exec(e)) {
44515
44365
  let n, r2;
@@ -44517,7 +44367,7 @@ ${c}` : c;
44517
44367
  else {
44518
44368
  let i;
44519
44369
  do
44520
- i = t[0], t[0] = ((_a3 = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : _a3[0]) ?? "";
44370
+ i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
44521
44371
  while (i !== t[0]);
44522
44372
  n = t[0], t[1] === "www." ? r2 = "http://" + t[0] : r2 = t[0];
44523
44373
  }
@@ -44533,12 +44383,12 @@ ${c}` : c;
44533
44383
  }
44534
44384
  };
44535
44385
  var x = class u2 {
44386
+ tokens;
44387
+ options;
44388
+ state;
44389
+ inlineQueue;
44390
+ tokenizer;
44536
44391
  constructor(e) {
44537
- __publicField(this, "tokens");
44538
- __publicField(this, "options");
44539
- __publicField(this, "state");
44540
- __publicField(this, "inlineQueue");
44541
- __publicField(this, "tokenizer");
44542
44392
  this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
44543
44393
  let t = { other: m, block: E.normal, inline: z.normal };
44544
44394
  this.options.pedantic ? (t.block = E.pedantic, t.inline = z.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = z.breaks : t.inline = z.gfm), this.tokenizer.rules = t;
@@ -44562,10 +44412,9 @@ var x = class u2 {
44562
44412
  return this.inlineQueue = [], this.tokens;
44563
44413
  }
44564
44414
  blockTokens(e, t = [], n = false) {
44565
- var _a3, _b2, _c;
44566
44415
  for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
44567
44416
  let r2;
44568
- if ((_b2 = (_a3 = this.options.extensions) == null ? void 0 : _a3.block) == null ? void 0 : _b2.some((s2) => (r2 = s2.call({ lexer: this }, e, t)) ? (e = e.substring(r2.raw.length), t.push(r2), true) : false)) continue;
44417
+ if (this.options.extensions?.block?.some((s2) => (r2 = s2.call({ lexer: this }, e, t)) ? (e = e.substring(r2.raw.length), t.push(r2), true) : false)) continue;
44569
44418
  if (r2 = this.tokenizer.space(e)) {
44570
44419
  e = e.substring(r2.raw.length);
44571
44420
  let s2 = t.at(-1);
@@ -44576,7 +44425,7 @@ var x = class u2 {
44576
44425
  if (r2 = this.tokenizer.code(e)) {
44577
44426
  e = e.substring(r2.raw.length);
44578
44427
  let s2 = t.at(-1);
44579
- (s2 == null ? void 0 : s2.type) === "paragraph" || (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith(`
44428
+ s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
44580
44429
  `) ? "" : `
44581
44430
  `) + r2.raw, s2.text += `
44582
44431
  ` + r2.text, this.inlineQueue.at(-1).src = s2.text) : t.push(r2);
@@ -44609,7 +44458,7 @@ var x = class u2 {
44609
44458
  if (r2 = this.tokenizer.def(e)) {
44610
44459
  e = e.substring(r2.raw.length);
44611
44460
  let s2 = t.at(-1);
44612
- (s2 == null ? void 0 : s2.type) === "paragraph" || (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith(`
44461
+ s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
44613
44462
  `) ? "" : `
44614
44463
  `) + r2.raw, s2.text += `
44615
44464
  ` + r2.raw, this.inlineQueue.at(-1).src = s2.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t.push(r2));
@@ -44624,7 +44473,7 @@ var x = class u2 {
44624
44473
  continue;
44625
44474
  }
44626
44475
  let i = e;
44627
- if ((_c = this.options.extensions) == null ? void 0 : _c.startBlock) {
44476
+ if (this.options.extensions?.startBlock) {
44628
44477
  let s2 = 1 / 0, a2 = e.slice(1), o;
44629
44478
  this.options.extensions.startBlock.forEach((l) => {
44630
44479
  o = l.call({ lexer: this }, a2), typeof o == "number" && o >= 0 && (s2 = Math.min(s2, o));
@@ -44632,7 +44481,7 @@ var x = class u2 {
44632
44481
  }
44633
44482
  if (this.state.top && (r2 = this.tokenizer.paragraph(i))) {
44634
44483
  let s2 = t.at(-1);
44635
- n && (s2 == null ? void 0 : s2.type) === "paragraph" ? (s2.raw += (s2.raw.endsWith(`
44484
+ n && s2?.type === "paragraph" ? (s2.raw += (s2.raw.endsWith(`
44636
44485
  `) ? "" : `
44637
44486
  `) + r2.raw, s2.text += `
44638
44487
  ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t.push(r2), n = i.length !== e.length, e = e.substring(r2.raw.length);
@@ -44641,7 +44490,7 @@ var x = class u2 {
44641
44490
  if (r2 = this.tokenizer.text(e)) {
44642
44491
  e = e.substring(r2.raw.length);
44643
44492
  let s2 = t.at(-1);
44644
- (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith(`
44493
+ s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
44645
44494
  `) ? "" : `
44646
44495
  `) + r2.raw, s2.text += `
44647
44496
  ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t.push(r2);
@@ -44661,7 +44510,6 @@ var x = class u2 {
44661
44510
  return this.inlineQueue.push({ src: e, tokens: t }), t;
44662
44511
  }
44663
44512
  inlineTokens(e, t = []) {
44664
- var _a3, _b2, _c, _d, _e2;
44665
44513
  let n = e, r2 = null;
44666
44514
  if (this.tokens.links) {
44667
44515
  let o = Object.keys(this.tokens.links);
@@ -44670,12 +44518,12 @@ var x = class u2 {
44670
44518
  for (; (r2 = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r2.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
44671
44519
  let i;
44672
44520
  for (; (r2 = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r2[2] ? r2[2].length : 0, n = n.slice(0, r2.index + i) + "[" + "a".repeat(r2[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
44673
- n = ((_b2 = (_a3 = this.options.hooks) == null ? void 0 : _a3.emStrongMask) == null ? void 0 : _b2.call({ lexer: this }, n)) ?? n;
44521
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
44674
44522
  let s2 = false, a2 = "";
44675
44523
  for (; e; ) {
44676
44524
  s2 || (a2 = ""), s2 = false;
44677
44525
  let o;
44678
- if ((_d = (_c = this.options.extensions) == null ? void 0 : _c.inline) == null ? void 0 : _d.some((p2) => (o = p2.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
44526
+ if (this.options.extensions?.inline?.some((p2) => (o = p2.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
44679
44527
  if (o = this.tokenizer.escape(e)) {
44680
44528
  e = e.substring(o.raw.length), t.push(o);
44681
44529
  continue;
@@ -44691,7 +44539,7 @@ var x = class u2 {
44691
44539
  if (o = this.tokenizer.reflink(e, this.tokens.links)) {
44692
44540
  e = e.substring(o.raw.length);
44693
44541
  let p2 = t.at(-1);
44694
- o.type === "text" && (p2 == null ? void 0 : p2.type) === "text" ? (p2.raw += o.raw, p2.text += o.text) : t.push(o);
44542
+ o.type === "text" && p2?.type === "text" ? (p2.raw += o.raw, p2.text += o.text) : t.push(o);
44695
44543
  continue;
44696
44544
  }
44697
44545
  if (o = this.tokenizer.emStrong(e, n, a2)) {
@@ -44719,7 +44567,7 @@ var x = class u2 {
44719
44567
  continue;
44720
44568
  }
44721
44569
  let l = e;
44722
- if ((_e2 = this.options.extensions) == null ? void 0 : _e2.startInline) {
44570
+ if (this.options.extensions?.startInline) {
44723
44571
  let p2 = 1 / 0, c = e.slice(1), d2;
44724
44572
  this.options.extensions.startInline.forEach((h2) => {
44725
44573
  d2 = h2.call({ lexer: this }, c), typeof d2 == "number" && d2 >= 0 && (p2 = Math.min(p2, d2));
@@ -44728,7 +44576,7 @@ var x = class u2 {
44728
44576
  if (o = this.tokenizer.inlineText(l)) {
44729
44577
  e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a2 = o.raw.slice(-1)), s2 = true;
44730
44578
  let p2 = t.at(-1);
44731
- (p2 == null ? void 0 : p2.type) === "text" ? (p2.raw += o.raw, p2.text += o.text) : t.push(o);
44579
+ p2?.type === "text" ? (p2.raw += o.raw, p2.text += o.text) : t.push(o);
44732
44580
  continue;
44733
44581
  }
44734
44582
  if (e) {
@@ -44743,17 +44591,16 @@ var x = class u2 {
44743
44591
  }
44744
44592
  };
44745
44593
  var y = class {
44594
+ options;
44595
+ parser;
44746
44596
  constructor(e) {
44747
- __publicField(this, "options");
44748
- __publicField(this, "parser");
44749
44597
  this.options = e || T;
44750
44598
  }
44751
44599
  space(e) {
44752
44600
  return "";
44753
44601
  }
44754
44602
  code({ text: e, lang: t, escaped: n }) {
44755
- var _a3;
44756
- let r2 = (_a3 = (t || "").match(m.notSpaceStart)) == null ? void 0 : _a3[0], i = e.replace(m.endingNewline, "") + `
44603
+ let r2 = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
44757
44604
  `;
44758
44605
  return r2 ? '<pre><code class="language-' + O(r2) + '">' + (n ? i : O(i, true)) + `</code></pre>
44759
44606
  ` : "<pre><code>" + (n ? i : O(i, true)) + `</code></pre>
@@ -44894,10 +44741,10 @@ var $ = class {
44894
44741
  }
44895
44742
  };
44896
44743
  var b = class u3 {
44744
+ options;
44745
+ renderer;
44746
+ textRenderer;
44897
44747
  constructor(e) {
44898
- __publicField(this, "options");
44899
- __publicField(this, "renderer");
44900
- __publicField(this, "textRenderer");
44901
44748
  this.options = e || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
44902
44749
  }
44903
44750
  static parse(e, t) {
@@ -44907,11 +44754,10 @@ var b = class u3 {
44907
44754
  return new u3(t).parseInline(e);
44908
44755
  }
44909
44756
  parse(e) {
44910
- var _a3, _b2;
44911
44757
  let t = "";
44912
44758
  for (let n = 0; n < e.length; n++) {
44913
44759
  let r2 = e[n];
44914
- if ((_b2 = (_a3 = this.options.extensions) == null ? void 0 : _a3.renderers) == null ? void 0 : _b2[r2.type]) {
44760
+ if (this.options.extensions?.renderers?.[r2.type]) {
44915
44761
  let s2 = r2, a2 = this.options.extensions.renderers[s2.type].call({ parser: this }, s2);
44916
44762
  if (a2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s2.type)) {
44917
44763
  t += a2 || "";
@@ -44978,11 +44824,10 @@ var b = class u3 {
44978
44824
  return t;
44979
44825
  }
44980
44826
  parseInline(e, t = this.renderer) {
44981
- var _a3, _b2;
44982
44827
  let n = "";
44983
44828
  for (let r2 = 0; r2 < e.length; r2++) {
44984
44829
  let i = e[r2];
44985
- if ((_b2 = (_a3 = this.options.extensions) == null ? void 0 : _a3.renderers) == null ? void 0 : _b2[i.type]) {
44830
+ if (this.options.extensions?.renderers?.[i.type]) {
44986
44831
  let a2 = this.options.extensions.renderers[i.type].call({ parser: this }, i);
44987
44832
  if (a2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
44988
44833
  n += a2 || "";
@@ -45045,12 +44890,14 @@ var b = class u3 {
45045
44890
  return n;
45046
44891
  }
45047
44892
  };
45048
- var P = (_b = class {
44893
+ var P = class {
44894
+ options;
44895
+ block;
45049
44896
  constructor(e) {
45050
- __publicField(this, "options");
45051
- __publicField(this, "block");
45052
44897
  this.options = e || T;
45053
44898
  }
44899
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
44900
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
45054
44901
  preprocess(e) {
45055
44902
  return e;
45056
44903
  }
@@ -45069,23 +44916,22 @@ var P = (_b = class {
45069
44916
  provideParser() {
45070
44917
  return this.block ? b.parse : b.parseInline;
45071
44918
  }
45072
- }, __publicField(_b, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), __publicField(_b, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _b);
44919
+ };
45073
44920
  var B = class {
44921
+ defaults = M();
44922
+ options = this.setOptions;
44923
+ parse = this.parseMarkdown(true);
44924
+ parseInline = this.parseMarkdown(false);
44925
+ Parser = b;
44926
+ Renderer = y;
44927
+ TextRenderer = $;
44928
+ Lexer = x;
44929
+ Tokenizer = w;
44930
+ Hooks = P;
45074
44931
  constructor(...e) {
45075
- __publicField(this, "defaults", M());
45076
- __publicField(this, "options", this.setOptions);
45077
- __publicField(this, "parse", this.parseMarkdown(true));
45078
- __publicField(this, "parseInline", this.parseMarkdown(false));
45079
- __publicField(this, "Parser", b);
45080
- __publicField(this, "Renderer", y);
45081
- __publicField(this, "TextRenderer", $);
45082
- __publicField(this, "Lexer", x);
45083
- __publicField(this, "Tokenizer", w);
45084
- __publicField(this, "Hooks", P);
45085
44932
  this.use(...e);
45086
44933
  }
45087
44934
  walkTokens(e, t) {
45088
- var _a3, _b2;
45089
44935
  let n = [];
45090
44936
  for (let r2 of e) switch (n = n.concat(t.call(this, r2)), r2.type) {
45091
44937
  case "table": {
@@ -45101,7 +44947,7 @@ var B = class {
45101
44947
  }
45102
44948
  default: {
45103
44949
  let i = r2;
45104
- ((_b2 = (_a3 = this.defaults.extensions) == null ? void 0 : _a3.childTokens) == null ? void 0 : _b2[i.type]) ? this.defaults.extensions.childTokens[i.type].forEach((s2) => {
44950
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s2) => {
45105
44951
  let a2 = i[s2].flat(1 / 0);
45106
44952
  n = n.concat(this.walkTokens(a2, t));
45107
44953
  }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
@@ -45365,7 +45211,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
45365
45211
  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 });
45366
45212
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
45367
45213
  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 }) });
45368
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-CK5bxjZc.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
45214
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-D5wXP22M.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
45369
45215
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
45370
45216
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
45371
45217
  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 }) })] }) });
@@ -46189,7 +46035,6 @@ const TraceViewerContext = reactExports.createContext({
46189
46035
  });
46190
46036
  TraceViewerContext.displayName = "TraceViewerContext";
46191
46037
  const reducer = (state, action) => {
46192
- var _a3;
46193
46038
  switch (action.type) {
46194
46039
  case "setRoot":
46195
46040
  state.scrollSnapshotRef.current = void 0;
@@ -46275,7 +46120,7 @@ const reducer = (state, action) => {
46275
46120
  type: "deselect"
46276
46121
  });
46277
46122
  }
46278
- if (((_a3 = state.selected) == null ? void 0 : _a3.span.spanId) === action.id) {
46123
+ if (state.selected?.span.spanId === action.id) {
46279
46124
  return newState;
46280
46125
  }
46281
46126
  return reducer(newState, {
@@ -46453,12 +46298,11 @@ function TraceViewerContextProvider({ getQuickLinks, withPanel = false, children
46453
46298
  memoCacheRef,
46454
46299
  withPanel,
46455
46300
  getQuickLinks: (span) => {
46456
- var _a3;
46457
46301
  const cacheKey = span.spanId;
46458
46302
  const existing = quickLinksCache.current.get(cacheKey);
46459
46303
  if (existing)
46460
46304
  return existing;
46461
- const value2 = ((_a3 = getQuickLinksRef.current) == null ? void 0 : _a3.call(getQuickLinksRef, span)) || [];
46305
+ const value2 = getQuickLinksRef.current?.(span) || [];
46462
46306
  quickLinksCache.current.set(cacheKey, value2);
46463
46307
  return value2;
46464
46308
  }
@@ -46901,7 +46745,6 @@ function computeSleepSegments(node2) {
46901
46745
  return segments;
46902
46746
  }
46903
46747
  function computeRunSegments(node2) {
46904
- var _a3;
46905
46748
  const events = node2.events ? sortedEvents(node2.events) : [];
46906
46749
  const { startTime, duration: duration2, activeStartTime } = node2;
46907
46750
  const segments = [];
@@ -46909,8 +46752,8 @@ function computeRunSegments(node2) {
46909
46752
  return segments;
46910
46753
  const hasRunCreated = events.some((e) => e.event.name === "run_created");
46911
46754
  if (!hasRunCreated) {
46912
- const runData = (_a3 = node2.span.attributes) == null ? void 0 : _a3.data;
46913
- const runStatus = runData == null ? void 0 : runData.status;
46755
+ const runData = node2.span.attributes?.data;
46756
+ const runStatus = runData?.status;
46914
46757
  return computeV1RunSegments(startTime, duration2, activeStartTime, runStatus);
46915
46758
  }
46916
46759
  const failedEvent = events.find((e) => e.event.name === "run_failed");
@@ -47162,8 +47005,7 @@ function SpanContent({ resourceType, ...props }) {
47162
47005
  }
47163
47006
  const MIN_SPAN_WIDTH = 4;
47164
47007
  function getResourceType(node2) {
47165
- var _a3;
47166
- const resource = (_a3 = node2.span.attributes) == null ? void 0 : _a3.resource;
47008
+ const resource = node2.span.attributes?.resource;
47167
47009
  if (resource === "run" || resource === "step" || resource === "hook" || resource === "sleep") {
47168
47010
  return resource;
47169
47011
  }
@@ -47251,7 +47093,7 @@ const getSpanColorClassName = (node2) => {
47251
47093
  };
47252
47094
  function getTerminalTimestamp(resourceType, node2) {
47253
47095
  const events = node2.events;
47254
- if (!(events == null ? void 0 : events.length))
47096
+ if (!events?.length)
47255
47097
  return void 0;
47256
47098
  switch (resourceType) {
47257
47099
  case "hook":
@@ -47311,7 +47153,6 @@ function getSpanStyle(layout, node2, root2, scale) {
47311
47153
  };
47312
47154
  }
47313
47155
  const SpanComponent = reactExports.memo(function SpanComponent2({ node: node2, root: root2, scale, traceIsLive = false, scrollSnapshotRef, customSpanClassNameFunc, customSpanEventClassNameFunc }) {
47314
- var _a3;
47315
47156
  const ref = reactExports.useRef(null);
47316
47157
  reactExports.useEffect(() => {
47317
47158
  node2.ref = ref;
@@ -47324,10 +47165,10 @@ const SpanComponent = reactExports.memo(function SpanComponent2({ node: node2, r
47324
47165
  const [liveNow, setLiveNow] = reactExports.useState(0);
47325
47166
  const customClassName = customSpanClassNameFunc ? customSpanClassNameFunc(node2) : "";
47326
47167
  const isWorkflowSpan = resourceType !== "default";
47327
- const data = (_a3 = span.attributes) == null ? void 0 : _a3.data;
47168
+ const data = span.attributes?.data;
47328
47169
  const terminalTimestamp = getTerminalTimestamp(resourceType, node2);
47329
47170
  const hasTerminalEvent = terminalTimestamp != null;
47330
- const isCompletedByData = resourceType === "hook" ? Boolean(data == null ? void 0 : data.disposedAt) : Boolean(data == null ? void 0 : data.completedAt);
47171
+ const isCompletedByData = resourceType === "hook" ? Boolean(data?.disposedAt) : Boolean(data?.completedAt);
47331
47172
  const isCompleted = isCompletedByData || hasTerminalEvent;
47332
47173
  const isLive = traceIsLive && isWorkflowSpan && !isCompleted;
47333
47174
  reactExports.useEffect(() => {
@@ -47537,12 +47378,11 @@ const getAncestors = (_root, start) => {
47537
47378
  return result;
47538
47379
  };
47539
47380
  const SpanDetailPanelBody = () => {
47540
- var _a3;
47541
47381
  const { state: { root: root2, selected, resourceMap, getQuickLinks }, dispatch } = useTraceViewer();
47542
47382
  const ancestors = reactExports.useMemo(() => getAncestors(root2, selected), [root2, selected]);
47543
- const attributeGroups = reactExports.useMemo(() => getGroupedAttributes((selected == null ? void 0 : selected.span.attributes) ?? {}), [selected]);
47383
+ const attributeGroups = reactExports.useMemo(() => getGroupedAttributes(selected?.span.attributes ?? {}), [selected]);
47544
47384
  const resourceAttributeGroups = reactExports.useMemo(() => {
47545
- const resourceName = selected == null ? void 0 : selected.span.resource;
47385
+ const resourceName = selected?.span.resource;
47546
47386
  if (!resourceName)
47547
47387
  return [];
47548
47388
  const resourceAttributes = resourceMap[resourceName];
@@ -47560,7 +47400,7 @@ const SpanDetailPanelBody = () => {
47560
47400
  }), type: "button", children: [jsxRuntimeExports.jsxs("div", { className: styles.ancestorText, children: [jsxRuntimeExports.jsx("span", { className: styles.ancestorName, children: node2.label || node2.span.name }), jsxRuntimeExports.jsx("span", { className: styles.ancestorDuration, children: formatDuration(node2.duration) })] }), jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: styles.ancestorLineContainer, children: jsxRuntimeExports.jsx("span", { className: clsx(styles.ancestorLine, getSpanColorClassName(node2)), style: {
47561
47401
  left: percentage((node2.startTime - root2.startTime) / root2.duration),
47562
47402
  width: percentage(node2.duration / root2.duration)
47563
- } }) })] }, `${selected.span.spanId}.${node2.span.spanId}`)) }) : null, isEntrySpan ? jsxRuntimeExports.jsx(EntrySpanLinks, { getQuickLinks, span: selected.span }) : null, ((_a3 = selected.events) == null ? void 0 : _a3.length) ? jsxRuntimeExports.jsx(DetailGroup, { name: "Events", children: selected.events.map((event) => jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [jsxRuntimeExports.jsxs("dl", { className: styles.spanDetailPanelAttribute, children: [jsxRuntimeExports.jsx("dt", { className: styles.spanDetailPanelAttributeKey, children: event.event.name }), jsxRuntimeExports.jsx("dd", { className: styles.spanDetailPanelAttributeValue, children: formatDuration(event.timestamp - root2.startTime) })] }), Object.entries(event.event.attributes).map(([key, value]) => jsxRuntimeExports.jsx(DetailLine, { name: `${event.event.name}.${key}`, value }, key))] }, event.key)) }) : null, attributeGroups.length ? jsxRuntimeExports.jsx(DetailGroup, { name: "Attributes", children: attributeGroups.map((group) => jsxRuntimeExports.jsx(reactExports.Fragment, { children: group.attributes.map(({ key, value }) => jsxRuntimeExports.jsx(DetailLine, { name: key, value }, key)) }, group.prefix)) }) : null, resourceAttributeGroups.length ? jsxRuntimeExports.jsx(DetailGroup, { name: "Resource", children: resourceAttributeGroups.map((group) => jsxRuntimeExports.jsx(reactExports.Fragment, { children: group.attributes.map(({ key, value }) => jsxRuntimeExports.jsx(DetailLine, { name: key, value }, key)) }, group.prefix)) }) : null, selected.isInstrumentationHint ? null : jsxRuntimeExports.jsxs(DetailGroup, { name: "Library", children: [jsxRuntimeExports.jsx(DetailLine, { name: "name", value: span.library.name }), span.library.version ? jsxRuntimeExports.jsx(DetailLine, { name: "version", value: span.library.version }) : null] })] });
47403
+ } }) })] }, `${selected.span.spanId}.${node2.span.spanId}`)) }) : null, isEntrySpan ? jsxRuntimeExports.jsx(EntrySpanLinks, { getQuickLinks, span: selected.span }) : null, selected.events?.length ? jsxRuntimeExports.jsx(DetailGroup, { name: "Events", children: selected.events.map((event) => jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [jsxRuntimeExports.jsxs("dl", { className: styles.spanDetailPanelAttribute, children: [jsxRuntimeExports.jsx("dt", { className: styles.spanDetailPanelAttributeKey, children: event.event.name }), jsxRuntimeExports.jsx("dd", { className: styles.spanDetailPanelAttributeValue, children: formatDuration(event.timestamp - root2.startTime) })] }), Object.entries(event.event.attributes).map(([key, value]) => jsxRuntimeExports.jsx(DetailLine, { name: `${event.event.name}.${key}`, value }, key))] }, event.key)) }) : null, attributeGroups.length ? jsxRuntimeExports.jsx(DetailGroup, { name: "Attributes", children: attributeGroups.map((group) => jsxRuntimeExports.jsx(reactExports.Fragment, { children: group.attributes.map(({ key, value }) => jsxRuntimeExports.jsx(DetailLine, { name: key, value }, key)) }, group.prefix)) }) : null, resourceAttributeGroups.length ? jsxRuntimeExports.jsx(DetailGroup, { name: "Resource", children: resourceAttributeGroups.map((group) => jsxRuntimeExports.jsx(reactExports.Fragment, { children: group.attributes.map(({ key, value }) => jsxRuntimeExports.jsx(DetailLine, { name: key, value }, key)) }, group.prefix)) }) : null, selected.isInstrumentationHint ? null : jsxRuntimeExports.jsxs(DetailGroup, { name: "Library", children: [jsxRuntimeExports.jsx(DetailLine, { name: "name", value: span.library.name }), span.library.version ? jsxRuntimeExports.jsx(DetailLine, { name: "version", value: span.library.version }) : null] })] });
47564
47404
  };
47565
47405
  function SpanDetailPanel({ attached = false }) {
47566
47406
  const { state: { selected, isMobile }, dispatch } = useTraceViewer();
@@ -47680,7 +47520,7 @@ function usePromise(promise) {
47680
47520
  }
47681
47521
  function EntrySpanLink({ name: name2, link: linkPromise }) {
47682
47522
  const link2 = usePromise(linkPromise);
47683
- return jsxRuntimeExports.jsxs(Link, { as: link2 ? void 0 : "span", className: clsx(styles.spanDetailPanelAttribute, styles.spanDetailPanelQuickLink), href: (link2 == null ? void 0 : link2.href) || "", children: [jsxRuntimeExports.jsx("span", { className: styles.spanDetailPanelAttributeKey, children: name2 }), jsxRuntimeExports.jsx("span", { className: clsx(styles.spanDetailPanelAttributeValue, styles.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 })] }) })] });
47523
+ return jsxRuntimeExports.jsxs(Link, { as: link2 ? void 0 : "span", className: clsx(styles.spanDetailPanelAttribute, styles.spanDetailPanelQuickLink), href: link2?.href || "", children: [jsxRuntimeExports.jsx("span", { className: styles.spanDetailPanelAttributeKey, children: name2 }), jsxRuntimeExports.jsx("span", { className: clsx(styles.spanDetailPanelAttributeValue, styles.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 })] }) })] });
47684
47524
  }
47685
47525
  function InstrumentationHint() {
47686
47526
  return jsxRuntimeExports.jsx(DetailGroup, { name: "What is this?", children: jsxRuntimeExports.jsxs("div", { className: styles.infraSpanDescription, children: [jsxRuntimeExports.jsx("span", { children: `You can visualize your application's spans alongside Vercel's spans in this viewer.` }), jsxRuntimeExports.jsx(ButtonLink, { href: "https://vercel.com/docs/session-tracing#adding-custom-spans", size: "small", target: "_blank", children: "Get Started" })] }) });
@@ -47793,8 +47633,7 @@ const MiniMap = reactExports.memo(function MiniMap2({ timelineRef, rows, scale }
47793
47633
  let clientX = 0;
47794
47634
  let rect;
47795
47635
  const isValidEventTarget = (target2) => {
47796
- var _a3;
47797
- return Boolean((_a3 = containerRef.current) == null ? void 0 : _a3.contains(target2));
47636
+ return Boolean(containerRef.current?.contains(target2));
47798
47637
  };
47799
47638
  let nextFrame = 0;
47800
47639
  const onFrame = () => {
@@ -47812,11 +47651,10 @@ const MiniMap = reactExports.memo(function MiniMap2({ timelineRef, rows, scale }
47812
47651
  nextFrame = requestAnimationFrame(onFrame);
47813
47652
  };
47814
47653
  const onPointerDown = (event) => {
47815
- var _a3;
47816
47654
  if (!isValidEventTarget(event.target))
47817
47655
  return;
47818
47656
  isHeld = true;
47819
- rect = (_a3 = containerRef.current) == null ? void 0 : _a3.getBoundingClientRect();
47657
+ rect = containerRef.current?.getBoundingClientRect();
47820
47658
  onPointerMove(event);
47821
47659
  };
47822
47660
  const onPointerUp = () => {
@@ -47855,7 +47693,7 @@ const MiniMap = reactExports.memo(function MiniMap2({ timelineRef, rows, scale }
47855
47693
  }, [timelineRef, thumbRatio, thumbWidth]);
47856
47694
  reactExports.useEffect(() => {
47857
47695
  const canvas = canvasRef.current;
47858
- const ctx = canvas == null ? void 0 : canvas.getContext("2d");
47696
+ const ctx = canvas?.getContext("2d");
47859
47697
  if (!canvas || !ctx)
47860
47698
  return;
47861
47699
  const render = () => {
@@ -47945,9 +47783,8 @@ function StreamViewer({ streamId: _streamId, chunks, isLive, error: error2, isLo
47945
47783
  const virtuosoRef = reactExports.useRef(null);
47946
47784
  const prevChunkCountRef = reactExports.useRef(0);
47947
47785
  reactExports.useEffect(() => {
47948
- var _a3;
47949
47786
  if (chunks.length > prevChunkCountRef.current && chunks.length > 0) {
47950
- (_a3 = virtuosoRef.current) == null ? void 0 : _a3.scrollToIndex({
47787
+ virtuosoRef.current?.scrollToIndex({
47951
47788
  index: chunks.length - 1,
47952
47789
  align: "end"
47953
47790
  });
@@ -47965,7 +47802,7 @@ function StreamViewer({ streamId: _streamId, chunks, isLive, error: error2, isLo
47965
47802
  borderColor: "var(--ds-gray-300)",
47966
47803
  backgroundColor: "var(--ds-gray-100)",
47967
47804
  color: "var(--ds-gray-600)"
47968
- }, 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 } }) })] });
47805
+ }, children: isLive ? "Waiting for stream data..." : "Stream is empty" }) : jsxRuntimeExports.jsx(Yr, { ref: virtuosoRef, totalCount: chunks.length, overscan: 10, endReached: () => onScrollEnd?.(), itemContent: (index2) => jsxRuntimeExports.jsx("div", { style: { paddingBottom: 8 }, children: jsxRuntimeExports.jsx(ChunkRow, { chunk: chunks[index2], index: index2 }) }), style: { flex: 1, minHeight: 0 } }) })] });
47969
47806
  }
47970
47807
  const DEFAULT_PAGE_SIZE = 10;
47971
47808
  function cn(...inputs) {
@@ -49155,7 +48992,7 @@ let safeEnd;
49155
48992
  let bundledStrings = null;
49156
48993
  const MAX_BUNDLE_SIZE = 61440;
49157
48994
  const hasNonLatin = /[\u0080-\uFFFF]/;
49158
- const RECORD_SYMBOL = Symbol("record-id");
48995
+ const RECORD_SYMBOL = /* @__PURE__ */ Symbol("record-id");
49159
48996
  class Encoder extends Decoder {
49160
48997
  constructor(options) {
49161
48998
  super(options);
@@ -50318,7 +50155,6 @@ const REUSE_BUFFER_MODE = 512;
50318
50155
  const RESET_BUFFER_MODE = 1024;
50319
50156
  const THROW_ON_ITERABLE = 2048;
50320
50157
  async function rpc(method, params) {
50321
- var _a3;
50322
50158
  const res = await fetch("/api/rpc", {
50323
50159
  method: "POST",
50324
50160
  headers: {
@@ -50331,7 +50167,7 @@ async function rpc(method, params) {
50331
50167
  try {
50332
50168
  const buffer22 = await res.arrayBuffer();
50333
50169
  const errorBody = decode(new Uint8Array(buffer22));
50334
- if ((_a3 = errorBody == null ? void 0 : errorBody.error) == null ? void 0 : _a3.message) {
50170
+ if (errorBody?.error?.message) {
50335
50171
  throw new Error(errorBody.error.message);
50336
50172
  }
50337
50173
  } catch (decodeErr) {