@octaviaflow/core 3.1.0-beta.82 → 3.1.0-beta.84

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.
package/dist/index.js CHANGED
@@ -11361,7 +11361,7 @@ EmptyState.displayName = "EmptyState";
11361
11361
 
11362
11362
  // src/components/ExecutionConsole/ExecutionConsole.tsx
11363
11363
  import { motion as motion13 } from "framer-motion";
11364
- import { useEffect as useEffect21, useMemo as useMemo13, useRef as useRef21, useState as useState26 } from "react";
11364
+ import { memo, useCallback as useCallback17, useEffect as useEffect21, useMemo as useMemo13, useRef as useRef21, useState as useState26 } from "react";
11365
11365
  import { Fragment as Fragment22, jsx as jsx52, jsxs as jsxs52 } from "react/jsx-runtime";
11366
11366
  var iconProps = {
11367
11367
  xmlns: "http://www.w3.org/2000/svg",
@@ -11471,11 +11471,17 @@ function ExecutionConsole({
11471
11471
  }, [running]);
11472
11472
  useEffect21(() => {
11473
11473
  if (!open || !autoScroll) return;
11474
+ const logsEl = logsRef.current;
11475
+ if (running && logsEl) {
11476
+ logsEl.scrollTop = logsEl.scrollHeight;
11477
+ lastScrollTopRef.current = logsEl.scrollTop;
11478
+ return;
11479
+ }
11474
11480
  const el = logEndRef.current;
11475
11481
  if (el && typeof el.scrollIntoView === "function") {
11476
11482
  el.scrollIntoView({ behavior: "smooth", block: "end" });
11477
11483
  }
11478
- }, [filteredLogs.length, open, autoScroll]);
11484
+ }, [filteredLogs.length, open, autoScroll, running]);
11479
11485
  const handleLogsScroll = () => {
11480
11486
  const el = logsRef.current;
11481
11487
  if (!el) return;
@@ -11495,14 +11501,14 @@ function ExecutionConsole({
11495
11501
  return next;
11496
11502
  });
11497
11503
  };
11498
- const toggleLineExpand = (index) => {
11504
+ const toggleLineExpand = useCallback17((index) => {
11499
11505
  setExpandedLines((prev) => {
11500
11506
  const next = new Set(prev);
11501
11507
  if (next.has(index)) next.delete(index);
11502
11508
  else next.add(index);
11503
11509
  return next;
11504
11510
  });
11505
- };
11511
+ }, []);
11506
11512
  const handleCopy = () => {
11507
11513
  if (onCopy) {
11508
11514
  onCopy();
@@ -11778,38 +11784,17 @@ function ExecutionConsole({
11778
11784
  /* @__PURE__ */ jsx52("span", { className: "ods-console__empty-title", children: logs.length === 0 ? "No log entries" : "No logs match the filters" }),
11779
11785
  logs.length === 0 && /* @__PURE__ */ jsx52("span", { className: "ods-console__empty-hint", children: "Output will appear here when the step runs." })
11780
11786
  ] }) }),
11781
- !loading && filteredLogs.map((log, i) => {
11782
- const expanded = expandedLines.has(i);
11783
- const canExpand = log.detail !== void 0 && log.detail !== null;
11784
- return /* @__PURE__ */ jsxs52(
11785
- "div",
11786
- {
11787
- className: cn("ods-console__line", `ods-console__line--${log.level}`),
11788
- "data-testid": "console-log-line",
11789
- children: [
11790
- /* @__PURE__ */ jsxs52("div", { className: "ods-console__line-row", children: [
11791
- canExpand ? /* @__PURE__ */ jsx52(
11792
- "button",
11793
- {
11794
- type: "button",
11795
- className: "ods-console__line-toggle",
11796
- onClick: () => toggleLineExpand(i),
11797
- "aria-label": expanded ? "Collapse log detail" : "Expand log detail",
11798
- "aria-expanded": expanded,
11799
- children: /* @__PURE__ */ jsx52(ChevronIcon2, { open: expanded })
11800
- }
11801
- ) : /* @__PURE__ */ jsx52("span", { className: "ods-console__line-toggle ods-console__line-toggle--placeholder" }),
11802
- /* @__PURE__ */ jsx52("span", { className: "ods-console__timestamp", children: log.timestamp }),
11803
- /* @__PURE__ */ jsx52("span", { className: cn("ods-console__level", `ods-console__level--${log.level}`), children: log.level.toUpperCase() }),
11804
- log.nodeLabel && /* @__PURE__ */ jsx52("span", { className: "ods-console__node-tag", title: log.nodeId, children: log.nodeLabel }),
11805
- /* @__PURE__ */ jsx52("span", { className: "ods-console__message", children: q(query, log.message) })
11806
- ] }),
11807
- canExpand && expanded && /* @__PURE__ */ jsx52("pre", { className: "ods-console__detail", children: typeof log.detail === "string" ? log.detail : safeStringify(log.detail) })
11808
- ]
11809
- },
11810
- i
11811
- );
11812
- }),
11787
+ !loading && filteredLogs.map((log, i) => /* @__PURE__ */ jsx52(
11788
+ ConsoleLine,
11789
+ {
11790
+ log,
11791
+ index: i,
11792
+ expanded: expandedLines.has(i),
11793
+ query,
11794
+ onToggleExpand: toggleLineExpand
11795
+ },
11796
+ i
11797
+ )),
11813
11798
  /* @__PURE__ */ jsx52("div", { ref: logEndRef })
11814
11799
  ]
11815
11800
  }
@@ -11818,6 +11803,42 @@ function ExecutionConsole({
11818
11803
  }
11819
11804
  );
11820
11805
  }
11806
+ var ConsoleLine = memo(function ConsoleLine2({
11807
+ log,
11808
+ index,
11809
+ expanded,
11810
+ query,
11811
+ onToggleExpand
11812
+ }) {
11813
+ const canExpand = log.detail !== void 0 && log.detail !== null;
11814
+ return /* @__PURE__ */ jsxs52(
11815
+ "div",
11816
+ {
11817
+ className: cn("ods-console__line", `ods-console__line--${log.level}`),
11818
+ "data-testid": "console-log-line",
11819
+ children: [
11820
+ /* @__PURE__ */ jsxs52("div", { className: "ods-console__line-row", children: [
11821
+ canExpand ? /* @__PURE__ */ jsx52(
11822
+ "button",
11823
+ {
11824
+ type: "button",
11825
+ className: "ods-console__line-toggle",
11826
+ onClick: () => onToggleExpand(index),
11827
+ "aria-label": expanded ? "Collapse log detail" : "Expand log detail",
11828
+ "aria-expanded": expanded,
11829
+ children: /* @__PURE__ */ jsx52(ChevronIcon2, { open: expanded })
11830
+ }
11831
+ ) : /* @__PURE__ */ jsx52("span", { className: "ods-console__line-toggle ods-console__line-toggle--placeholder" }),
11832
+ /* @__PURE__ */ jsx52("span", { className: "ods-console__timestamp", children: log.timestamp }),
11833
+ /* @__PURE__ */ jsx52("span", { className: cn("ods-console__level", `ods-console__level--${log.level}`), children: log.level.toUpperCase() }),
11834
+ log.nodeLabel && /* @__PURE__ */ jsx52("span", { className: "ods-console__node-tag", title: log.nodeId, children: log.nodeLabel }),
11835
+ /* @__PURE__ */ jsx52("span", { className: "ods-console__message", children: q(query, log.message) })
11836
+ ] }),
11837
+ canExpand && expanded && /* @__PURE__ */ jsx52("pre", { className: "ods-console__detail", children: typeof log.detail === "string" ? log.detail : safeStringify(log.detail) })
11838
+ ]
11839
+ }
11840
+ );
11841
+ });
11821
11842
  function q(query, text) {
11822
11843
  const trimmed = query.trim();
11823
11844
  if (!trimmed) return text;
@@ -11958,7 +11979,7 @@ import {
11958
11979
  } from "@octaviaflow/icons";
11959
11980
  import {
11960
11981
  forwardRef as forwardRef43,
11961
- useCallback as useCallback17,
11982
+ useCallback as useCallback18,
11962
11983
  useEffect as useEffect22,
11963
11984
  useId as useId22,
11964
11985
  useImperativeHandle as useImperativeHandle5,
@@ -12094,7 +12115,7 @@ var FileDropzone = forwardRef43(
12094
12115
  const [isOver, setOver] = useState27(false);
12095
12116
  const [error, setError] = useState27(null);
12096
12117
  const [autoPreviews, setAutoPreviews] = useState27({});
12097
- const validate = useCallback17(
12118
+ const validate = useCallback18(
12098
12119
  (list) => {
12099
12120
  if (maxFiles && list.length > maxFiles) {
12100
12121
  return { ok: [], error: `Too many files \u2014 max ${maxFiles}` };
@@ -12123,7 +12144,7 @@ var FileDropzone = forwardRef43(
12123
12144
  },
12124
12145
  [accept, maxFiles, maxSize]
12125
12146
  );
12126
- const handleFiles = useCallback17(
12147
+ const handleFiles = useCallback18(
12127
12148
  (incoming) => {
12128
12149
  if (disabled) return;
12129
12150
  const { ok, error: error2 } = validate(incoming);
@@ -12414,7 +12435,7 @@ import {
12414
12435
  SearchIcon as SearchIcon9
12415
12436
  } from "@octaviaflow/icons";
12416
12437
  import {
12417
- useCallback as useCallback22,
12438
+ useCallback as useCallback23,
12418
12439
  useEffect as useEffect26,
12419
12440
  useMemo as useMemo19,
12420
12441
  useRef as useRef23,
@@ -12463,7 +12484,7 @@ import {
12463
12484
  XmlIcon
12464
12485
  } from "@octaviaflow/icons";
12465
12486
  import {
12466
- useCallback as useCallback18,
12487
+ useCallback as useCallback19,
12467
12488
  useMemo as useMemo14,
12468
12489
  useState as useState28
12469
12490
  } from "react";
@@ -12700,7 +12721,7 @@ function FileList({
12700
12721
  }) {
12701
12722
  const [viewState, setViewState] = useState28(defaultView);
12702
12723
  const view = viewProp ?? viewState;
12703
- const setView = useCallback18(
12724
+ const setView = useCallback19(
12704
12725
  (v) => {
12705
12726
  if (viewProp === void 0) setViewState(v);
12706
12727
  onViewChange?.(v);
@@ -12711,7 +12732,7 @@ function FileList({
12711
12732
  const [sortDirState, setSortDirState] = useState28(defaultSortDir);
12712
12733
  const sortKey = sortKeyProp ?? sortKeyState;
12713
12734
  const sortDir = sortDirProp ?? sortDirState;
12714
- const applySort = useCallback18(
12735
+ const applySort = useCallback19(
12715
12736
  (key) => {
12716
12737
  const nextDir = key === sortKey ? sortDir === "asc" ? "desc" : "asc" : "asc";
12717
12738
  if (sortKeyProp === void 0) setSortKeyState(key);
@@ -12725,14 +12746,14 @@ function FileList({
12725
12746
  );
12726
12747
  const selectedPaths = selectedProp ?? selectedState;
12727
12748
  const selectedSet = useMemo14(() => new Set(selectedPaths), [selectedPaths]);
12728
- const commitSelection = useCallback18(
12749
+ const commitSelection = useCallback19(
12729
12750
  (paths) => {
12730
12751
  if (selectedProp === void 0) setSelectedState(paths);
12731
12752
  onSelectionChange?.(paths);
12732
12753
  },
12733
12754
  [selectedProp, onSelectionChange]
12734
12755
  );
12735
- const isSelectable = useCallback18(
12756
+ const isSelectable = useCallback19(
12736
12757
  (it) => !it.disabled && (it.isDirectory ? selectableFolders : selectableFiles),
12737
12758
  [selectableFiles, selectableFolders]
12738
12759
  );
@@ -12758,7 +12779,7 @@ function FileList({
12758
12779
  const selectableItems = useMemo14(() => sorted.filter(isSelectable), [sorted, isSelectable]);
12759
12780
  const allSelected = selectableItems.length > 0 && selectableItems.every((it) => selectedSet.has(it.path));
12760
12781
  const someSelected = selectableItems.some((it) => selectedSet.has(it.path));
12761
- const toggleRow = useCallback18(
12782
+ const toggleRow = useCallback19(
12762
12783
  (it) => {
12763
12784
  if (!isSelectable(it)) return;
12764
12785
  if (multiSelect) {
@@ -12773,11 +12794,11 @@ function FileList({
12773
12794
  },
12774
12795
  [isSelectable, multiSelect, selectedPaths, commitSelection, onSelect]
12775
12796
  );
12776
- const toggleAll = useCallback18(() => {
12797
+ const toggleAll = useCallback19(() => {
12777
12798
  if (allSelected) commitSelection([]);
12778
12799
  else commitSelection(selectableItems.map((it) => it.path));
12779
12800
  }, [allSelected, commitSelection, selectableItems]);
12780
- const activate = useCallback18(
12801
+ const activate = useCallback19(
12781
12802
  (it) => {
12782
12803
  if (it.disabled) return;
12783
12804
  onOpen?.(it);
@@ -12983,7 +13004,7 @@ import {
12983
13004
  import { XMLValidator } from "fast-xml-parser";
12984
13005
  import {
12985
13006
  forwardRef as forwardRef45,
12986
- useCallback as useCallback19,
13007
+ useCallback as useCallback20,
12987
13008
  useEffect as useEffect23,
12988
13009
  useId as useId23,
12989
13010
  useMemo as useMemo15,
@@ -13185,7 +13206,7 @@ function XmlNodeRow({
13185
13206
  const [open, setOpen] = useState29(depth < defaultExpandDepth);
13186
13207
  const [copied, setCopied] = useState29(false);
13187
13208
  const pad2 = depth * 14;
13188
- const onCopy = useCallback19(
13209
+ const onCopy = useCallback20(
13189
13210
  (e) => {
13190
13211
  e.stopPropagation();
13191
13212
  const text = serializeNode(node);
@@ -13369,7 +13390,7 @@ import {
13369
13390
  } from "@octaviaflow/icons";
13370
13391
  import {
13371
13392
  forwardRef as forwardRef46,
13372
- useCallback as useCallback20,
13393
+ useCallback as useCallback21,
13373
13394
  useEffect as useEffect24,
13374
13395
  useId as useId24,
13375
13396
  useMemo as useMemo16,
@@ -13537,7 +13558,7 @@ var YamlViewer = forwardRef46(
13537
13558
  });
13538
13559
  return s;
13539
13560
  });
13540
- const toggle = useCallback20((idx) => {
13561
+ const toggle = useCallback21((idx) => {
13541
13562
  setCollapsed((prev) => {
13542
13563
  const next = new Set(prev);
13543
13564
  if (next.has(idx)) next.delete(idx);
@@ -13561,7 +13582,7 @@ var YamlViewer = forwardRef46(
13561
13582
  return hide;
13562
13583
  }, [tokens, collapsed]);
13563
13584
  const [copied, setCopied] = useState30(false);
13564
- const onCopy = useCallback20(() => {
13585
+ const onCopy = useCallback21(() => {
13565
13586
  if (!navigator?.clipboard?.writeText) return;
13566
13587
  navigator.clipboard.writeText(text).then(
13567
13588
  () => {
@@ -13956,7 +13977,7 @@ import { ChevronRightIcon as ChevronRightIcon5 } from "@octaviaflow/icons";
13956
13977
  import { motion as motion14, useReducedMotion as useReducedMotion7 } from "framer-motion";
13957
13978
  import {
13958
13979
  forwardRef as forwardRef47,
13959
- useCallback as useCallback21,
13980
+ useCallback as useCallback22,
13960
13981
  useEffect as useEffect25,
13961
13982
  useId as useId25,
13962
13983
  useMemo as useMemo18,
@@ -14002,7 +14023,7 @@ var TreeView = forwardRef47(
14002
14023
  const expandedSet = isExpandedControlled ? controlledExpanded : internalExpanded;
14003
14024
  const [loaded, setLoaded] = useState31({});
14004
14025
  const [loading, setLoading] = useState31(/* @__PURE__ */ new Set());
14005
- const resolveChildren = useCallback21(
14026
+ const resolveChildren = useCallback22(
14006
14027
  (node) => node.children ?? loaded[node.id],
14007
14028
  [loaded]
14008
14029
  );
@@ -14018,14 +14039,14 @@ var TreeView = forwardRef47(
14018
14039
  () => buildVisibleList(resolvedNodes, expandedSet),
14019
14040
  [resolvedNodes, expandedSet]
14020
14041
  );
14021
- const setExpanded = useCallback21(
14042
+ const setExpanded = useCallback22(
14022
14043
  (next) => {
14023
14044
  if (!isExpandedControlled) setInternalExpanded(new Set(next));
14024
14045
  onExpandedChange?.(new Set(next));
14025
14046
  },
14026
14047
  [isExpandedControlled, onExpandedChange]
14027
14048
  );
14028
- const toggleExpand = useCallback21(
14049
+ const toggleExpand = useCallback22(
14029
14050
  async (node) => {
14030
14051
  const next = new Set(expandedSet);
14031
14052
  const isOpen = next.has(node.id);
@@ -14054,7 +14075,7 @@ var TreeView = forwardRef47(
14054
14075
  },
14055
14076
  [expandedSet, setExpanded, onLoadChildren, loaded, loading]
14056
14077
  );
14057
- const handleSelect = useCallback21(
14078
+ const handleSelect = useCallback22(
14058
14079
  (node) => {
14059
14080
  if (node.disabled || disabled) return;
14060
14081
  if (!isSelectedControlled) setInternalSelected(node.id);
@@ -14295,7 +14316,7 @@ function FileBrowser({
14295
14316
  const [query, setQuery] = useState32("");
14296
14317
  const [preview, setPreview] = useState32(null);
14297
14318
  const previewEnabled = (showPreview ?? Boolean(getPreview)) && Boolean(getPreview);
14298
- const loadFolder = useCallback22(
14319
+ const loadFolder = useCallback23(
14299
14320
  async (folder) => {
14300
14321
  const cached = cacheRef.current[folder];
14301
14322
  if (cached?.status === "loaded" && cached.items) return cached.items;
@@ -14316,7 +14337,7 @@ function FileBrowser({
14316
14337
  useEffect26(() => {
14317
14338
  void loadFolder(currentPath);
14318
14339
  }, [currentPath, loadFolder]);
14319
- const navigate = useCallback22(
14340
+ const navigate = useCallback23(
14320
14341
  (next) => {
14321
14342
  if (pathProp === void 0) setPathState(next);
14322
14343
  setExpanded((prev) => {
@@ -14328,7 +14349,7 @@ function FileBrowser({
14328
14349
  },
14329
14350
  [pathProp, onNavigate, rootPath, separator]
14330
14351
  );
14331
- const refresh = useCallback22(() => {
14352
+ const refresh = useCallback23(() => {
14332
14353
  setCache((prev) => {
14333
14354
  const next = { ...prev };
14334
14355
  delete next[currentPath];
@@ -14337,18 +14358,18 @@ function FileBrowser({
14337
14358
  setTreeVersion((v) => v + 1);
14338
14359
  void loadFolder(currentPath);
14339
14360
  }, [currentPath, loadFolder]);
14340
- const resolveItems = useCallback22(
14361
+ const resolveItems = useCallback23(
14341
14362
  (paths) => paths.map((p) => seenRef.current.get(p)).filter(Boolean),
14342
14363
  []
14343
14364
  );
14344
- const commitSelection = useCallback22(
14365
+ const commitSelection = useCallback23(
14345
14366
  (paths) => {
14346
14367
  if (selectedProp === void 0) setSelectedState(paths);
14347
14368
  onSelectionChange?.(paths, resolveItems(paths));
14348
14369
  },
14349
14370
  [selectedProp, onSelectionChange, resolveItems]
14350
14371
  );
14351
- const loadPreview = useCallback22(
14372
+ const loadPreview = useCallback23(
14352
14373
  async (item) => {
14353
14374
  if (!getPreview) return;
14354
14375
  setPreview({ path: item.path, name: item.name, loading: true });
@@ -14366,13 +14387,13 @@ function FileBrowser({
14366
14387
  },
14367
14388
  [getPreview]
14368
14389
  );
14369
- const handleSelect = useCallback22(
14390
+ const handleSelect = useCallback23(
14370
14391
  (item) => {
14371
14392
  if (!item.isDirectory && previewEnabled) void loadPreview(item);
14372
14393
  },
14373
14394
  [previewEnabled, loadPreview]
14374
14395
  );
14375
- const handleOpen = useCallback22(
14396
+ const handleOpen = useCallback23(
14376
14397
  (item) => {
14377
14398
  if (item.isDirectory) navigate(item.path);
14378
14399
  else onFileOpen?.(item);
@@ -14386,7 +14407,7 @@ function FileBrowser({
14386
14407
  if (!q2) return rawItems;
14387
14408
  return rawItems.filter((it) => it.name.toLowerCase().includes(q2));
14388
14409
  }, [rawItems, query]);
14389
- const folderToTreeNode = useCallback22(
14410
+ const folderToTreeNode = useCallback23(
14390
14411
  (it) => ({
14391
14412
  id: it.path,
14392
14413
  label: it.name,
@@ -14396,7 +14417,7 @@ function FileBrowser({
14396
14417
  }),
14397
14418
  []
14398
14419
  );
14399
- const loadTreeChildren = useCallback22(
14420
+ const loadTreeChildren = useCallback23(
14400
14421
  async (node) => {
14401
14422
  const children = await loadFolder(String(node.id));
14402
14423
  return children.filter((c) => c.isDirectory).map(folderToTreeNode);
@@ -14575,7 +14596,7 @@ import {
14575
14596
  XmlIcon as XmlIcon3
14576
14597
  } from "@octaviaflow/icons";
14577
14598
  import {
14578
- useCallback as useCallback23,
14599
+ useCallback as useCallback24,
14579
14600
  useEffect as useEffect27,
14580
14601
  useId as useId26,
14581
14602
  useMemo as useMemo20,
@@ -14646,6 +14667,7 @@ function FilePicker({
14646
14667
  searchLimit = 200,
14647
14668
  closeOnEsc = true,
14648
14669
  emptyTitle = "This folder is empty",
14670
+ pathLabels,
14649
14671
  name,
14650
14672
  form,
14651
14673
  id,
@@ -14660,6 +14682,8 @@ function FilePicker({
14660
14682
  const value = valueProp ?? valueState;
14661
14683
  const [open, setOpen] = useState33(false);
14662
14684
  const [navPath, setNavPath] = useState33(rootPath);
14685
+ const [trail, setTrail] = useState33([]);
14686
+ const [nameByPath, setNameByPath] = useState33({});
14663
14687
  const [cache, setCache] = useState33({});
14664
14688
  const cacheRef = useRef24(cache);
14665
14689
  cacheRef.current = cache;
@@ -14673,7 +14697,7 @@ function FilePicker({
14673
14697
  const popoverPos = useAnchoredPopover(triggerRef, open, { popoverRef });
14674
14698
  const canSelectFiles = selectMode !== "folder";
14675
14699
  const canSelectFolders = selectMode !== "file";
14676
- const loadFolder = useCallback23(
14700
+ const loadFolder = useCallback24(
14677
14701
  async (folder) => {
14678
14702
  const cached = cacheRef.current[folder];
14679
14703
  if (cached?.status === "loaded" && cached.items) return cached.items;
@@ -14681,6 +14705,11 @@ function FilePicker({
14681
14705
  try {
14682
14706
  const items2 = await loadChildren(folder);
14683
14707
  setCache((prev) => ({ ...prev, [folder]: { status: "loaded", items: items2 } }));
14708
+ setNameByPath((prev) => {
14709
+ const next = { ...prev };
14710
+ for (const it of items2) next[it.path] = it.name;
14711
+ return next;
14712
+ });
14684
14713
  return items2;
14685
14714
  } catch (e) {
14686
14715
  const err = e?.message || "Failed to load folder.";
@@ -14690,19 +14719,20 @@ function FilePicker({
14690
14719
  },
14691
14720
  [loadChildren]
14692
14721
  );
14693
- const openAt = useCallback23(() => {
14722
+ const openAt = useCallback24(() => {
14694
14723
  const start = initialPath ?? (value ? parentOf(value, rootPath, separator) ?? rootPath : rootPath);
14695
14724
  setNavPath(start);
14725
+ setTrail([]);
14696
14726
  setQuery("");
14697
14727
  setActiveIndex(-1);
14698
14728
  setOpen(true);
14699
14729
  void loadFolder(start);
14700
14730
  }, [initialPath, value, rootPath, separator, loadFolder]);
14701
- const close = useCallback23(() => {
14731
+ const close = useCallback24(() => {
14702
14732
  setOpen(false);
14703
14733
  triggerRef.current?.focus();
14704
14734
  }, []);
14705
- const navigate = useCallback23(
14735
+ const navigate = useCallback24(
14706
14736
  (folder) => {
14707
14737
  setNavPath(folder);
14708
14738
  setQuery("");
@@ -14712,7 +14742,7 @@ function FilePicker({
14712
14742
  },
14713
14743
  [loadFolder]
14714
14744
  );
14715
- const walkSearch = useCallback23(
14745
+ const walkSearch = useCallback24(
14716
14746
  async (root, needle) => {
14717
14747
  const q2 = needle.toLowerCase();
14718
14748
  const out = [];
@@ -14764,7 +14794,7 @@ function FilePicker({
14764
14794
  }, 220);
14765
14795
  return () => clearTimeout(timer);
14766
14796
  }, [query, searchable, open, navPath, selectMode, onSearch, walkSearch]);
14767
- const commit = useCallback23(
14797
+ const commit = useCallback24(
14768
14798
  (path, item) => {
14769
14799
  if (valueProp === void 0) setValueState(path);
14770
14800
  onChange?.(path, item);
@@ -14773,16 +14803,17 @@ function FilePicker({
14773
14803
  },
14774
14804
  [valueProp, onChange]
14775
14805
  );
14776
- const handleRowActivate = useCallback23(
14806
+ const handleRowActivate = useCallback24(
14777
14807
  (item) => {
14778
14808
  if (item.disabled) return;
14779
14809
  if (item.isDirectory) {
14810
+ setTrail((t) => navPath === rootPath ? t : [...t, navPath]);
14780
14811
  navigate(item.path);
14781
14812
  } else if (canSelectFiles) {
14782
14813
  commit(item.path, item);
14783
14814
  }
14784
14815
  },
14785
- [navigate, canSelectFiles, commit]
14816
+ [navigate, canSelectFiles, commit, navPath, rootPath]
14786
14817
  );
14787
14818
  useEffect27(() => {
14788
14819
  if (!open) return;
@@ -14815,11 +14846,30 @@ function FilePicker({
14815
14846
  if (isSearching) return search?.results ?? [];
14816
14847
  return [...rawItems].sort(folderFirstThenName);
14817
14848
  }, [isSearching, search, rawItems]);
14849
+ const displayName = useCallback24(
14850
+ (p) => p === rootPath ? rootLabel : nameByPath[p] ?? pathLabels?.[p] ?? baseName(p, separator),
14851
+ [rootPath, rootLabel, nameByPath, pathLabels, separator]
14852
+ );
14818
14853
  const crumbs = useMemo20(() => {
14819
- const chain = ancestorsOf(navPath, rootPath, separator);
14820
- return chain.map((p, i) => ({ path: p, label: i === 0 ? rootLabel : baseName(p, separator) }));
14821
- }, [navPath, rootPath, rootLabel, separator]);
14822
- const parent = parentOf(navPath, rootPath, separator);
14854
+ if (navPath === rootPath) return [{ path: rootPath, label: rootLabel }];
14855
+ const derived = ancestorsOf(navPath, rootPath, separator);
14856
+ const derivedValid = derived[derived.length - 1] === navPath;
14857
+ const chain = derivedValid && (derived.length > 2 || trail.length === 0) ? derived : [rootPath, ...trail.filter((p) => p !== rootPath), navPath];
14858
+ return chain.map((p, i) => ({ path: p, label: i === 0 ? rootLabel : displayName(p) }));
14859
+ }, [navPath, rootPath, rootLabel, separator, trail, displayName]);
14860
+ const parent = trail.length ? trail[trail.length - 1] : parentOf(navPath, rootPath, separator);
14861
+ const goUp = useCallback24(() => {
14862
+ if (!parent) return;
14863
+ setTrail((t) => t.length ? t.slice(0, -1) : t);
14864
+ navigate(parent);
14865
+ }, [parent, navigate]);
14866
+ const goToCrumb = useCallback24(
14867
+ (path, index) => {
14868
+ setTrail(crumbs.slice(1, index).map((c) => c.path));
14869
+ navigate(path);
14870
+ },
14871
+ [crumbs, navigate]
14872
+ );
14823
14873
  const onPopoverKeyDown = (e) => {
14824
14874
  const inSearch = e.target?.tagName === "INPUT";
14825
14875
  if (e.key === "ArrowDown") {
@@ -14929,7 +14979,7 @@ function FilePicker({
14929
14979
  className: "ods-file-picker__up",
14930
14980
  "aria-label": "Up one folder",
14931
14981
  disabled: !parent,
14932
- onClick: () => parent && navigate(parent),
14982
+ onClick: goUp,
14933
14983
  children: /* @__PURE__ */ jsx62(FolderParentIcon2, { size: "sm" })
14934
14984
  }
14935
14985
  ),
@@ -14946,7 +14996,7 @@ function FilePicker({
14946
14996
  ),
14947
14997
  "aria-current": isLast ? "page" : void 0,
14948
14998
  disabled: isLast,
14949
- onClick: () => !isLast && navigate(c.path),
14999
+ onClick: () => !isLast && goToCrumb(c.path, i),
14950
15000
  children: c.label
14951
15001
  }
14952
15002
  ),
@@ -14998,7 +15048,7 @@ function FilePicker({
14998
15048
  {
14999
15049
  icon: /* @__PURE__ */ jsx62(FolderIcon3, {}),
15000
15050
  title: isSearching ? "No matches" : emptyTitle,
15001
- description: isSearching ? `Nothing under \u201C${baseName(navPath, separator) || rootLabel}\u201D matches \u201C${query.trim()}\u201D.` : void 0
15051
+ description: isSearching ? `Nothing under \u201C${displayName(navPath) || rootLabel}\u201D matches \u201C${query.trim()}\u201D.` : void 0
15002
15052
  }
15003
15053
  ) }) : items.map((it, i) => {
15004
15054
  const active = i === activeIndex;
@@ -15043,14 +15093,14 @@ function FilePicker({
15043
15093
  showFooter && /* @__PURE__ */ jsxs61("div", { className: "ods-file-picker__footer", children: [
15044
15094
  /* @__PURE__ */ jsxs61("span", { className: "ods-file-picker__footer-path", title: navPath, children: [
15045
15095
  /* @__PURE__ */ jsx62("span", { className: "ods-file-picker__footer-label", children: "Selected" }),
15046
- navPath
15096
+ displayName(navPath)
15047
15097
  ] }),
15048
15098
  /* @__PURE__ */ jsxs61(
15049
15099
  "button",
15050
15100
  {
15051
15101
  type: "button",
15052
15102
  className: "ods-file-picker__use",
15053
- onClick: () => commit(navPath, { name: baseName(navPath, separator), path: navPath, isDirectory: true }),
15103
+ onClick: () => commit(navPath, { name: displayName(navPath), path: navPath, isDirectory: true }),
15054
15104
  children: [
15055
15105
  "Use this folder",
15056
15106
  /* @__PURE__ */ jsx62(ChevronRightIcon6, { size: "sm", "aria-hidden": "true" })
@@ -15072,7 +15122,7 @@ FilePicker.displayName = "FilePicker";
15072
15122
 
15073
15123
  // src/components/FlowCanvas/FlowCanvas.tsx
15074
15124
  import { AnimatePresence as AnimatePresence10 } from "framer-motion";
15075
- import { useCallback as useCallback25, useRef as useRef26 } from "react";
15125
+ import { useCallback as useCallback26, useRef as useRef26 } from "react";
15076
15126
 
15077
15127
  // src/components/FlowEdge/FlowEdge.tsx
15078
15128
  import { useId as useId27, useState as useState34 } from "react";
@@ -15259,7 +15309,7 @@ function FlowEdge({
15259
15309
  import { motion as motion15 } from "framer-motion";
15260
15310
  import {
15261
15311
  forwardRef as forwardRef48,
15262
- useCallback as useCallback24,
15312
+ useCallback as useCallback25,
15263
15313
  useEffect as useEffect28,
15264
15314
  useRef as useRef25,
15265
15315
  useState as useState35
@@ -15327,7 +15377,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15327
15377
  const [wasDragged, setWasDragged] = useState35(false);
15328
15378
  const dragStartRef = useRef25(null);
15329
15379
  const zoom = viewport?.zoom ?? 1;
15330
- const handleClick = useCallback24(
15380
+ const handleClick = useCallback25(
15331
15381
  (e) => {
15332
15382
  e.stopPropagation();
15333
15383
  if (wasDragged) {
@@ -15338,7 +15388,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15338
15388
  },
15339
15389
  [node.id, onSelect, wasDragged]
15340
15390
  );
15341
- const handleDelete = useCallback24(
15391
+ const handleDelete = useCallback25(
15342
15392
  (e) => {
15343
15393
  e.stopPropagation();
15344
15394
  if (isLockMode) return;
@@ -15346,7 +15396,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15346
15396
  },
15347
15397
  [node.id, onDelete, isLockMode]
15348
15398
  );
15349
- const handleMouseDown = useCallback24(
15399
+ const handleMouseDown = useCallback25(
15350
15400
  (e) => {
15351
15401
  if (isLockMode) return;
15352
15402
  const target = e.target;
@@ -15359,7 +15409,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15359
15409
  },
15360
15410
  [isLockMode]
15361
15411
  );
15362
- const handleTouchStart = useCallback24(
15412
+ const handleTouchStart = useCallback25(
15363
15413
  (e) => {
15364
15414
  if (isLockMode) return;
15365
15415
  if (e.touches.length !== 1) return;
@@ -15421,7 +15471,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15421
15471
  document.removeEventListener("touchcancel", onTouchEnd);
15422
15472
  };
15423
15473
  }, [isDragging, zoom, node.id, node.position.x, node.position.y, onPositionChange]);
15424
- const handlePortMouseDown = useCallback24(
15474
+ const handlePortMouseDown = useCallback25(
15425
15475
  (e, portId, portType) => {
15426
15476
  e.stopPropagation();
15427
15477
  if (isLockMode) return;
@@ -15431,7 +15481,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15431
15481
  },
15432
15482
  [connectingFrom, isLockMode, node.id, onStartConnecting]
15433
15483
  );
15434
- const handlePortMouseUp = useCallback24(
15484
+ const handlePortMouseUp = useCallback25(
15435
15485
  (e, portId, portType) => {
15436
15486
  e.stopPropagation();
15437
15487
  if (isLockMode) return;
@@ -15440,7 +15490,7 @@ var FlowNode = forwardRef48(function FlowNode2({
15440
15490
  },
15441
15491
  [connectingFrom, isLockMode, node.id, onEndConnecting]
15442
15492
  );
15443
- const isPortEdgeSelected = useCallback24(
15493
+ const isPortEdgeSelected = useCallback25(
15444
15494
  (portId, portType) => edges.some(
15445
15495
  (edge) => edge.selected && (portType === "input" ? edge.target === node.id && edge.targetPort === portId : edge.source === node.id && edge.sourcePort === portId)
15446
15496
  ),
@@ -15675,7 +15725,7 @@ function FlowCanvas2({
15675
15725
  }) {
15676
15726
  const canvasRef = useRef26(null);
15677
15727
  const isEmpty = nodes.length === 0 && edges.length === 0;
15678
- const handleCanvasClick = useCallback25(
15728
+ const handleCanvasClick = useCallback26(
15679
15729
  (e) => {
15680
15730
  const target = e.target;
15681
15731
  if (target === canvasRef.current) {
@@ -15927,7 +15977,7 @@ function FlowDoctor({
15927
15977
 
15928
15978
  // src/components/FlowMinimap/FlowMinimap.tsx
15929
15979
  import {
15930
- useCallback as useCallback26,
15980
+ useCallback as useCallback27,
15931
15981
  useContext,
15932
15982
  useEffect as useEffect29,
15933
15983
  useMemo as useMemo21,
@@ -16071,7 +16121,7 @@ function FlowMinimap(props) {
16071
16121
  h: maxY - minY + bounds_padding * 2
16072
16122
  };
16073
16123
  }, [totalWidthProp, totalHeightProp, contentBounds, bounds_padding]);
16074
- const clampWorldTopLeft = useCallback26(
16124
+ const clampWorldTopLeft = useCallback27(
16075
16125
  (worldX, worldY, vw, vh) => {
16076
16126
  if (!contentBounds) return { x: worldX, y: worldY };
16077
16127
  const minTLX = viewBox.x;
@@ -16084,7 +16134,7 @@ function FlowMinimap(props) {
16084
16134
  },
16085
16135
  [contentBounds, viewBox.x, viewBox.y, viewBox.w, viewBox.h]
16086
16136
  );
16087
- const reportViewportChange = useCallback26(
16137
+ const reportViewportChange = useCallback27(
16088
16138
  (worldX, worldY) => {
16089
16139
  if (effectiveViewportRect) {
16090
16140
  const clamped = clampWorldTopLeft(
@@ -16120,7 +16170,7 @@ function FlowMinimap(props) {
16120
16170
  [onViewportChange, viewportProp?.zoom, instance, liveSnapshot, effectiveViewportRect, clampWorldTopLeft]
16121
16171
  );
16122
16172
  const svgRef = useRef27(null);
16123
- const pointToWorld = useCallback26(
16173
+ const pointToWorld = useCallback27(
16124
16174
  (clientX, clientY) => {
16125
16175
  const svg = svgRef.current;
16126
16176
  if (!svg) return null;
@@ -16147,7 +16197,7 @@ function FlowMinimap(props) {
16147
16197
  });
16148
16198
  const suppressNextClickRef = useRef27(false);
16149
16199
  const [isDragging, setIsDragging] = useState36(false);
16150
- const onViewportPointerDown = useCallback26(
16200
+ const onViewportPointerDown = useCallback27(
16151
16201
  (e) => {
16152
16202
  if (!effectiveViewportRect) return;
16153
16203
  e.stopPropagation();
@@ -16169,7 +16219,7 @@ function FlowMinimap(props) {
16169
16219
  },
16170
16220
  [effectiveViewportRect, pointToWorld]
16171
16221
  );
16172
- const onSvgPointerMove = useCallback26(
16222
+ const onSvgPointerMove = useCallback27(
16173
16223
  (e) => {
16174
16224
  const d = dragRef.current;
16175
16225
  if (!d.dragging || d.pointerId !== e.pointerId) return;
@@ -16185,7 +16235,7 @@ function FlowMinimap(props) {
16185
16235
  },
16186
16236
  [pointToWorld, reportViewportChange]
16187
16237
  );
16188
- const onSvgPointerUp = useCallback26((e) => {
16238
+ const onSvgPointerUp = useCallback27((e) => {
16189
16239
  const d = dragRef.current;
16190
16240
  if (d.dragging && d.pointerId === e.pointerId) {
16191
16241
  d.dragging = false;
@@ -16194,7 +16244,7 @@ function FlowMinimap(props) {
16194
16244
  e.currentTarget.releasePointerCapture?.(e.pointerId);
16195
16245
  }
16196
16246
  }, []);
16197
- const handleSvgClick = useCallback26(
16247
+ const handleSvgClick = useCallback27(
16198
16248
  (e) => {
16199
16249
  if (suppressNextClickRef.current) {
16200
16250
  suppressNextClickRef.current = false;
@@ -16212,7 +16262,7 @@ function FlowMinimap(props) {
16212
16262
  },
16213
16263
  [pointToWorld, effectiveViewportRect, reportViewportChange]
16214
16264
  );
16215
- const handleWheel = useCallback26(
16265
+ const handleWheel = useCallback27(
16216
16266
  (e) => {
16217
16267
  if (!zoomOnScroll) return;
16218
16268
  if (!instance || !liveSnapshot) return;
@@ -16566,7 +16616,7 @@ import {
16566
16616
  import { useEffect as useEffect32, useRef as useRef29, useState as useState39 } from "react";
16567
16617
 
16568
16618
  // src/components/HoverCard/HoverCard.tsx
16569
- import { useCallback as useCallback27, useEffect as useEffect31, useLayoutEffect as useLayoutEffect7, useRef as useRef28, useState as useState38 } from "react";
16619
+ import { useCallback as useCallback28, useEffect as useEffect31, useLayoutEffect as useLayoutEffect7, useRef as useRef28, useState as useState38 } from "react";
16570
16620
  import { createPortal as createPortal11 } from "react-dom";
16571
16621
  import { Fragment as Fragment27, jsx as jsx70, jsxs as jsxs69 } from "react/jsx-runtime";
16572
16622
  function computePosition2(rect, panelRect, placement, offset) {
@@ -16617,7 +16667,7 @@ function HoverCard({
16617
16667
  clearTimers();
16618
16668
  closeTimer.current = setTimeout(() => setOpen(false), closeDelay);
16619
16669
  };
16620
- const reposition = useCallback27(() => {
16670
+ const reposition = useCallback28(() => {
16621
16671
  if (!triggerRef.current || !panelRef.current) return;
16622
16672
  const trigRect = triggerRef.current.getBoundingClientRect();
16623
16673
  const panelRect = panelRef.current.getBoundingClientRect();
@@ -17161,7 +17211,7 @@ import { useEffect as useEffect34, useState as useState41 } from "react";
17161
17211
  // src/components/OTPInput/OTPInput.tsx
17162
17212
  import {
17163
17213
  forwardRef as forwardRef49,
17164
- useCallback as useCallback28,
17214
+ useCallback as useCallback29,
17165
17215
  useId as useId28,
17166
17216
  useImperativeHandle as useImperativeHandle6,
17167
17217
  useRef as useRef30
@@ -17207,7 +17257,7 @@ var OTPInput = forwardRef49(function OTPInput2({
17207
17257
  }),
17208
17258
  [value, length, onChange]
17209
17259
  );
17210
- const setCharAt = useCallback28(
17260
+ const setCharAt = useCallback29(
17211
17261
  (idx, ch) => {
17212
17262
  const cleaned = ch.replace(pattern, "").slice(0, 1);
17213
17263
  const chars = value.split("");
@@ -17293,7 +17343,7 @@ OTPInput.displayName = "OTPInput";
17293
17343
  // src/components/PhoneInput/PhoneInput.tsx
17294
17344
  import {
17295
17345
  forwardRef as forwardRef50,
17296
- useCallback as useCallback29,
17346
+ useCallback as useCallback30,
17297
17347
  useEffect as useEffect33,
17298
17348
  useId as useId29,
17299
17349
  useRef as useRef31,
@@ -17386,7 +17436,7 @@ var PhoneInput = forwardRef50(
17386
17436
  useEffect33(() => {
17387
17437
  setActiveIdx(0);
17388
17438
  }, [query]);
17389
- const handleTriggerKey = useCallback29(
17439
+ const handleTriggerKey = useCallback30(
17390
17440
  (e) => {
17391
17441
  if (disabled) return;
17392
17442
  if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
@@ -17396,7 +17446,7 @@ var PhoneInput = forwardRef50(
17396
17446
  },
17397
17447
  [disabled]
17398
17448
  );
17399
- const handleNavKey = useCallback29(
17449
+ const handleNavKey = useCallback30(
17400
17450
  (e) => {
17401
17451
  if (e.key === "ArrowDown") {
17402
17452
  e.preventDefault();
@@ -19609,7 +19659,7 @@ var Grid2 = Object.assign(GridBase, { Item: GridItem });
19609
19659
  import { AnimatePresence as AnimatePresence11, motion as motion17 } from "framer-motion";
19610
19660
  import {
19611
19661
  forwardRef as forwardRef55,
19612
- useCallback as useCallback30,
19662
+ useCallback as useCallback31,
19613
19663
  useId as useId33,
19614
19664
  useMemo as useMemo23,
19615
19665
  useState as useState45
@@ -19686,14 +19736,14 @@ var Heatmap = forwardRef55(
19686
19736
  [domainMax, data]
19687
19737
  );
19688
19738
  const [hovered, setHovered] = useState45(null);
19689
- const fire = useCallback30(
19739
+ const fire = useCallback31(
19690
19740
  (cell) => {
19691
19741
  setHovered(cell);
19692
19742
  onCellHover?.(cell);
19693
19743
  },
19694
19744
  [onCellHover]
19695
19745
  );
19696
- const handleKey = useCallback30(
19746
+ const handleKey = useCallback31(
19697
19747
  (e, cell) => {
19698
19748
  if (!onCellClick) return;
19699
19749
  if (e.key === "Enter" || e.key === " ") {
@@ -20373,7 +20423,7 @@ KbdGroup.displayName = "KbdGroup";
20373
20423
  import { AnimatePresence as AnimatePresence12, motion as motion18 } from "framer-motion";
20374
20424
  import {
20375
20425
  forwardRef as forwardRef60,
20376
- useCallback as useCallback31,
20426
+ useCallback as useCallback32,
20377
20427
  useEffect as useEffect37,
20378
20428
  useId as useId37,
20379
20429
  useMemo as useMemo24,
@@ -20501,7 +20551,7 @@ var LineChart = forwardRef60(
20501
20551
  const [pointerPct, setPointerPct] = useState46(null);
20502
20552
  const plotRef = useRef32(null);
20503
20553
  const [brush, setBrush] = useState46(null);
20504
- const indexFromPct = useCallback31(
20554
+ const indexFromPct = useCallback32(
20505
20555
  (pct) => {
20506
20556
  if (xCount === 0) return 0;
20507
20557
  return Math.max(
@@ -20511,7 +20561,7 @@ var LineChart = forwardRef60(
20511
20561
  },
20512
20562
  [xCount]
20513
20563
  );
20514
- const handlePlotMove = useCallback31(
20564
+ const handlePlotMove = useCallback32(
20515
20565
  (e) => {
20516
20566
  if (xCount === 0) return;
20517
20567
  const rect = plotRef.current?.getBoundingClientRect();
@@ -20540,12 +20590,12 @@ var LineChart = forwardRef60(
20540
20590
  visibleRange.start
20541
20591
  ]
20542
20592
  );
20543
- const handlePlotLeave = useCallback31(() => {
20593
+ const handlePlotLeave = useCallback32(() => {
20544
20594
  setHoveredIdx(null);
20545
20595
  setPointerPct(null);
20546
20596
  onPointHover?.(null, null, null);
20547
20597
  }, [onPointHover]);
20548
- const handlePlotDown = useCallback31(
20598
+ const handlePlotDown = useCallback32(
20549
20599
  (e) => {
20550
20600
  if (!zoomable) return;
20551
20601
  const rect = plotRef.current?.getBoundingClientRect();
@@ -20579,12 +20629,12 @@ var LineChart = forwardRef60(
20579
20629
  window.addEventListener("mouseup", onUp);
20580
20630
  return () => window.removeEventListener("mouseup", onUp);
20581
20631
  }, [brush, indexFromPct, visibleRange.start, onZoomChange]);
20582
- const handleDoubleClick = useCallback31(() => {
20632
+ const handleDoubleClick = useCallback32(() => {
20583
20633
  if (!zoomable || !zoom) return;
20584
20634
  setZoom(null);
20585
20635
  onZoomChange?.(null);
20586
20636
  }, [zoomable, zoom, onZoomChange]);
20587
- const handlePlotClick = useCallback31(() => {
20637
+ const handlePlotClick = useCallback32(() => {
20588
20638
  if (hoveredIdx === null || !onPointClick) return;
20589
20639
  const s = lines[0];
20590
20640
  const p = s?.data[hoveredIdx];
@@ -20604,11 +20654,11 @@ var LineChart = forwardRef60(
20604
20654
  const showX = showAxis === "x" || showAxis === "both";
20605
20655
  const isMulti = (series?.length ?? 0) > 0;
20606
20656
  const tooltipPoint = hoveredIdx !== null ? lines[0]?.data[hoveredIdx] : void 0;
20607
- const dataXPct = useCallback31(
20657
+ const dataXPct = useCallback32(
20608
20658
  (i) => (PAD + i * stepX) / W * 100,
20609
20659
  [stepX]
20610
20660
  );
20611
- const dataYPct = useCallback31(
20661
+ const dataYPct = useCallback32(
20612
20662
  (v) => (PAD + (1 - (v - lo) / (hi - lo)) * (H - PAD * 2)) / H * 100,
20613
20663
  [lo, hi]
20614
20664
  );
@@ -20993,7 +21043,7 @@ LinkButton.displayName = "LinkButton";
20993
21043
  // src/components/MessageBlockBuilder/MessageBlockBuilder.tsx
20994
21044
  import { AddIcon as AddIcon5, CodeIcon as CodeIcon4, CopyIcon as CopyIcon5, DataConnectedIcon, TrashCanIcon as TrashCanIcon2 } from "@octaviaflow/icons";
20995
21045
  import {
20996
- useCallback as useCallback33,
21046
+ useCallback as useCallback34,
20997
21047
  useEffect as useEffect41,
20998
21048
  useMemo as useMemo26,
20999
21049
  useRef as useRef35,
@@ -21003,7 +21053,7 @@ import {
21003
21053
  // src/components/Sortable/Sortable.tsx
21004
21054
  import {
21005
21055
  forwardRef as forwardRef62,
21006
- useCallback as useCallback32,
21056
+ useCallback as useCallback33,
21007
21057
  useEffect as useEffect38,
21008
21058
  useRef as useRef33,
21009
21059
  useState as useState47
@@ -21030,7 +21080,7 @@ function Sortable({
21030
21080
  const [dropPos, setDropPos] = useState47(null);
21031
21081
  const [kbActiveId, setKbActiveId] = useState47(null);
21032
21082
  const isVertical = direction === "vertical";
21033
- const onDragStart = useCallback32(
21083
+ const onDragStart = useCallback33(
21034
21084
  (id) => (e) => {
21035
21085
  if (disabled) return;
21036
21086
  e.dataTransfer.effectAllowed = "move";
@@ -21041,7 +21091,7 @@ function Sortable({
21041
21091
  },
21042
21092
  [disabled, items]
21043
21093
  );
21044
- const cancelDrag = useCallback32(() => {
21094
+ const cancelDrag = useCallback33(() => {
21045
21095
  setDraggingId(null);
21046
21096
  setDropPos(null);
21047
21097
  originalOrderRef.current = null;
@@ -21050,7 +21100,7 @@ function Sortable({
21050
21100
  scrollTimerRef.current = null;
21051
21101
  }
21052
21102
  }, []);
21053
- const onDragEnd = useCallback32(() => {
21103
+ const onDragEnd = useCallback33(() => {
21054
21104
  cancelDrag();
21055
21105
  }, [cancelDrag]);
21056
21106
  const onItemDragOver = (id) => (e) => {
@@ -21075,7 +21125,7 @@ function Sortable({
21075
21125
  if (sourceId === target.id) return;
21076
21126
  commitMove(sourceId, target.id, target.edge);
21077
21127
  };
21078
- const commitMove = useCallback32(
21128
+ const commitMove = useCallback33(
21079
21129
  (sourceId, targetId, edge) => {
21080
21130
  const from = items.findIndex((i) => i.id === sourceId);
21081
21131
  let to = items.findIndex((i) => i.id === targetId);
@@ -24464,7 +24514,7 @@ function MessageBlockBuilder({
24464
24514
  };
24465
24515
  }
24466
24516
  }, [draft.mode, draft.jsonText]);
24467
- const commit = useCallback33(
24517
+ const commit = useCallback34(
24468
24518
  (next) => {
24469
24519
  setDraft(next);
24470
24520
  if (onChange) {
@@ -25503,7 +25553,7 @@ MetricCard.displayName = "MetricCard";
25503
25553
  import { AnimatePresence as AnimatePresence13, motion as motion20 } from "framer-motion";
25504
25554
  import {
25505
25555
  forwardRef as forwardRef65,
25506
- useCallback as useCallback34,
25556
+ useCallback as useCallback35,
25507
25557
  useEffect as useEffect42,
25508
25558
  useId as useId40,
25509
25559
  useLayoutEffect as useLayoutEffect8,
@@ -25572,7 +25622,7 @@ var MultiSelect = forwardRef65(
25572
25622
  const searchRef = useRef36(null);
25573
25623
  const dropdownRef = useRef36(null);
25574
25624
  const chipRefs = useRef36([]);
25575
- const commit = useCallback34(
25625
+ const commit = useCallback35(
25576
25626
  (next) => {
25577
25627
  if (controlledValue === void 0) setInternalValue(next);
25578
25628
  onChange?.(next);
@@ -25594,7 +25644,7 @@ var MultiSelect = forwardRef65(
25594
25644
  const showSearch = searchable ?? options2.length > 6;
25595
25645
  const getLabel = (v) => options2.find((o) => o.value === v)?.label ?? v;
25596
25646
  const getIcon = (v) => options2.find((o) => o.value === v)?.icon;
25597
- const updatePosition = useCallback34(() => {
25647
+ const updatePosition = useCallback35(() => {
25598
25648
  if (!wrapRef.current) return;
25599
25649
  const rect = wrapRef.current.getBoundingClientRect();
25600
25650
  setDropdownPos({
@@ -25668,7 +25718,7 @@ var MultiSelect = forwardRef65(
25668
25718
  ro.observe(row);
25669
25719
  return () => ro.disconnect();
25670
25720
  }, []);
25671
- const addValue = useCallback34(
25721
+ const addValue = useCallback35(
25672
25722
  (val) => {
25673
25723
  if (maxTags && selectedValues.length >= maxTags) return;
25674
25724
  commit([...selectedValues, val]);
@@ -25678,13 +25728,13 @@ var MultiSelect = forwardRef65(
25678
25728
  },
25679
25729
  [selectedValues, maxTags, commit]
25680
25730
  );
25681
- const removeValue = useCallback34(
25731
+ const removeValue = useCallback35(
25682
25732
  (val) => {
25683
25733
  commit(selectedValues.filter((v) => v !== val));
25684
25734
  },
25685
25735
  [selectedValues, commit]
25686
25736
  );
25687
- const toggleValue = useCallback34(
25737
+ const toggleValue = useCallback35(
25688
25738
  (val) => {
25689
25739
  if (selectedSet.has(val)) {
25690
25740
  removeValue(val);
@@ -25694,11 +25744,11 @@ var MultiSelect = forwardRef65(
25694
25744
  },
25695
25745
  [selectedSet, addValue, removeValue]
25696
25746
  );
25697
- const clearAll = useCallback34(() => {
25747
+ const clearAll = useCallback35(() => {
25698
25748
  commit([]);
25699
25749
  setQuery("");
25700
25750
  }, [commit]);
25701
- const handleSearchKey = useCallback34(
25751
+ const handleSearchKey = useCallback35(
25702
25752
  (e) => {
25703
25753
  if (e.key === "Escape") {
25704
25754
  setOpen(false);
@@ -26114,7 +26164,7 @@ import {
26114
26164
  } from "@octaviaflow/icons";
26115
26165
  import {
26116
26166
  forwardRef as forwardRef66,
26117
- useCallback as useCallback35,
26167
+ useCallback as useCallback36,
26118
26168
  useId as useId41,
26119
26169
  useMemo as useMemo29,
26120
26170
  useState as useState52
@@ -26201,7 +26251,7 @@ var Pagination = forwardRef66(
26201
26251
  totalPages,
26202
26252
  Math.max(1, isControlled ? controlledPage : internalPage)
26203
26253
  );
26204
- const goTo = useCallback35(
26254
+ const goTo = useCallback36(
26205
26255
  (next) => {
26206
26256
  const clamped = Math.min(totalPages, Math.max(1, next));
26207
26257
  if (clamped === currentPage) return;
@@ -26993,7 +27043,7 @@ var PlanPicker = forwardRef69(
26993
27043
  PlanPicker.displayName = "PlanPicker";
26994
27044
 
26995
27045
  // src/components/Popover/Popover.tsx
26996
- import { useCallback as useCallback36, useEffect as useEffect43, useLayoutEffect as useLayoutEffect9, useRef as useRef37, useState as useState53 } from "react";
27046
+ import { useCallback as useCallback37, useEffect as useEffect43, useLayoutEffect as useLayoutEffect9, useRef as useRef37, useState as useState53 } from "react";
26997
27047
  import { createPortal as createPortal13 } from "react-dom";
26998
27048
  import { Fragment as Fragment45, jsx as jsx104, jsxs as jsxs101 } from "react/jsx-runtime";
26999
27049
  function computePosition3(rect, popRect, placement, offset) {
@@ -27027,7 +27077,7 @@ function Popover({
27027
27077
  }) {
27028
27078
  const [openState, setOpenState] = useState53(defaultOpen);
27029
27079
  const open = openProp ?? openState;
27030
- const setOpen = useCallback36(
27080
+ const setOpen = useCallback37(
27031
27081
  (v) => {
27032
27082
  if (openProp === void 0) setOpenState(v);
27033
27083
  onOpenChange?.(v);
@@ -27037,7 +27087,7 @@ function Popover({
27037
27087
  const triggerRef = useRef37(null);
27038
27088
  const popRef = useRef37(null);
27039
27089
  const [coords, setCoords] = useState53(null);
27040
- const reposition = useCallback36(() => {
27090
+ const reposition = useCallback37(() => {
27041
27091
  if (!triggerRef.current || !popRef.current) return;
27042
27092
  const trigRect = triggerRef.current.getBoundingClientRect();
27043
27093
  const popRect = popRef.current.getBoundingClientRect();
@@ -27469,7 +27519,7 @@ ProgressRing.displayName = "ProgressRing";
27469
27519
  // src/components/PromptInput/PromptInput.tsx
27470
27520
  import {
27471
27521
  forwardRef as forwardRef73,
27472
- useCallback as useCallback37,
27522
+ useCallback as useCallback38,
27473
27523
  useEffect as useEffect44,
27474
27524
  useId as useId45,
27475
27525
  useImperativeHandle as useImperativeHandle7,
@@ -27533,7 +27583,7 @@ var PromptInput = forwardRef73(
27533
27583
  const [suggestionIndex, setSuggestionIndex] = useState54(0);
27534
27584
  const [isDragOver, setIsDragOver] = useState54(false);
27535
27585
  const [historyIdx, setHistoryIdx] = useState54(null);
27536
- const setValue = useCallback37(
27586
+ const setValue = useCallback38(
27537
27587
  (next) => {
27538
27588
  if (!isControlled) setInternal(next);
27539
27589
  onChange?.(next);
@@ -28586,7 +28636,7 @@ function BinaryButton({
28586
28636
  // src/components/Resizable/Resizable.tsx
28587
28637
  import {
28588
28638
  forwardRef as forwardRef80,
28589
- useCallback as useCallback38,
28639
+ useCallback as useCallback39,
28590
28640
  useEffect as useEffect45,
28591
28641
  useLayoutEffect as useLayoutEffect10,
28592
28642
  useRef as useRef41,
@@ -28670,7 +28720,7 @@ var Resizable = forwardRef80(
28670
28720
  ro.observe(el);
28671
28721
  return () => ro.disconnect();
28672
28722
  }, [direction, minSecond]);
28673
- const persist = useCallback38(
28723
+ const persist = useCallback39(
28674
28724
  (next) => {
28675
28725
  onSplitChange?.(next);
28676
28726
  if (storageKey && typeof window !== "undefined" && total > 0) {
@@ -29147,7 +29197,7 @@ function Show({ above, below, children, ...rest }) {
29147
29197
  Show.displayName = "Show";
29148
29198
 
29149
29199
  // src/components/Sidebar/Sidebar.tsx
29150
- import { useCallback as useCallback39, useEffect as useEffect47, useRef as useRef42, useState as useState57 } from "react";
29200
+ import { useCallback as useCallback40, useEffect as useEffect47, useRef as useRef42, useState as useState57 } from "react";
29151
29201
  import { Fragment as Fragment50, jsx as jsx121, jsxs as jsxs116 } from "react/jsx-runtime";
29152
29202
  function Sidebar({
29153
29203
  variant = "expanded",
@@ -29179,7 +29229,7 @@ function Sidebar({
29179
29229
  }
29180
29230
  }, []);
29181
29231
  const pinned = pinnedProp ?? internalPinned;
29182
- const setPinned = useCallback39(
29232
+ const setPinned = useCallback40(
29183
29233
  (p) => {
29184
29234
  if (pinnedProp === void 0) setInternalPinned(p);
29185
29235
  try {
@@ -30281,7 +30331,7 @@ VStack.displayName = "VStack";
30281
30331
  import { AnimatePresence as AnimatePresence16, motion as motion24, useReducedMotion as useReducedMotion9 } from "framer-motion";
30282
30332
  import {
30283
30333
  forwardRef as forwardRef85,
30284
- useCallback as useCallback40,
30334
+ useCallback as useCallback41,
30285
30335
  useEffect as useEffect50,
30286
30336
  useLayoutEffect as useLayoutEffect11,
30287
30337
  useMemo as useMemo31,
@@ -30315,7 +30365,7 @@ var Spotlight = forwardRef85(
30315
30365
  () => `ods-spotlight-${Math.random().toString(36).slice(2, 9)}`,
30316
30366
  []
30317
30367
  );
30318
- const measure = useCallback40(() => {
30368
+ const measure = useCallback41(() => {
30319
30369
  if (!open) return;
30320
30370
  const el = target.current;
30321
30371
  if (!el) return;
@@ -30486,7 +30536,7 @@ Stat.displayName = "Stat";
30486
30536
  import { motion as motion25 } from "framer-motion";
30487
30537
  import {
30488
30538
  forwardRef as forwardRef87,
30489
- useCallback as useCallback41,
30539
+ useCallback as useCallback42,
30490
30540
  useId as useId50,
30491
30541
  useMemo as useMemo32,
30492
30542
  useState as useState61
@@ -30531,7 +30581,7 @@ var StatusTiles = forwardRef87(
30531
30581
  [data, max]
30532
30582
  );
30533
30583
  const [hoveredIdx, setHoveredIdx] = useState61(null);
30534
- const fire = useCallback41(
30584
+ const fire = useCallback42(
30535
30585
  (idx) => {
30536
30586
  setHoveredIdx(idx);
30537
30587
  if (idx === null) {
@@ -30543,7 +30593,7 @@ var StatusTiles = forwardRef87(
30543
30593
  },
30544
30594
  [onTileHover, visible]
30545
30595
  );
30546
- const handleKey = useCallback41(
30596
+ const handleKey = useCallback42(
30547
30597
  (e, idx) => {
30548
30598
  if (!onTileClick) return;
30549
30599
  if (e.key === "Enter" || e.key === " ") {
@@ -30629,7 +30679,7 @@ StatusTiles.displayName = "StatusTiles";
30629
30679
  import { motion as motion26 } from "framer-motion";
30630
30680
  import {
30631
30681
  forwardRef as forwardRef88,
30632
- useCallback as useCallback42,
30682
+ useCallback as useCallback43,
30633
30683
  useId as useId51,
30634
30684
  useMemo as useMemo33,
30635
30685
  useState as useState62
@@ -30829,21 +30879,21 @@ var Sankey = forwardRef88(function Sankey2({
30829
30879
  }, [links, layoutNodes, nodeWidth, scale]);
30830
30880
  const [hoveredNode, setHoveredNode] = useState62(null);
30831
30881
  const [hoveredLink, setHoveredLink] = useState62(null);
30832
- const fireNode = useCallback42(
30882
+ const fireNode = useCallback43(
30833
30883
  (n) => {
30834
30884
  setHoveredNode(n);
30835
30885
  onNodeHover?.(n);
30836
30886
  },
30837
30887
  [onNodeHover]
30838
30888
  );
30839
- const fireLink = useCallback42(
30889
+ const fireLink = useCallback43(
30840
30890
  (l) => {
30841
30891
  setHoveredLink(l);
30842
30892
  onLinkHover?.(l);
30843
30893
  },
30844
30894
  [onLinkHover]
30845
30895
  );
30846
- const handleNodeKey = useCallback42(
30896
+ const handleNodeKey = useCallback43(
30847
30897
  (e, n) => {
30848
30898
  if (!onNodeClick) return;
30849
30899
  if (e.key === "Enter" || e.key === " ") {
@@ -30988,7 +31038,7 @@ Sankey.displayName = "Sankey";
30988
31038
  // src/components/Table/Table.tsx
30989
31039
  import {
30990
31040
  forwardRef as forwardRef89,
30991
- useCallback as useCallback43,
31041
+ useCallback as useCallback44,
30992
31042
  useState as useState63
30993
31043
  } from "react";
30994
31044
  import {
@@ -31015,7 +31065,7 @@ function TableInner({
31015
31065
  "aria-label": ariaLabel = "Data table",
31016
31066
  ...rest
31017
31067
  }, ref) {
31018
- const handleSort = useCallback43(
31068
+ const handleSort = useCallback44(
31019
31069
  (key) => {
31020
31070
  if (!onSort) return;
31021
31071
  const col = columns.find((c) => c.key === key);
@@ -31025,7 +31075,7 @@ function TableInner({
31025
31075
  },
31026
31076
  [columns, onSort, sortKey, sortDirection]
31027
31077
  );
31028
- const handleSelectAll = useCallback43(() => {
31078
+ const handleSelectAll = useCallback44(() => {
31029
31079
  if (!onSelectionChange) return;
31030
31080
  const allSelected = selectedRows?.size === data.length;
31031
31081
  if (allSelected) {
@@ -31034,7 +31084,7 @@ function TableInner({
31034
31084
  onSelectionChange(new Set(data.map((_, i) => i)));
31035
31085
  }
31036
31086
  }, [data, onSelectionChange, selectedRows]);
31037
- const handleSelectRow = useCallback43(
31087
+ const handleSelectRow = useCallback44(
31038
31088
  (index) => {
31039
31089
  if (!onSelectionChange || !selectedRows) return;
31040
31090
  const next = new Set(selectedRows);
@@ -31607,7 +31657,7 @@ Timeline.displayName = "Timeline";
31607
31657
  import {
31608
31658
  forwardRef as forwardRef93,
31609
31659
  Fragment as Fragment56,
31610
- useCallback as useCallback44,
31660
+ useCallback as useCallback45,
31611
31661
  useEffect as useEffect51,
31612
31662
  useId as useId54,
31613
31663
  useRef as useRef44,
@@ -31665,7 +31715,7 @@ var TimePicker = forwardRef93(
31665
31715
  null
31666
31716
  );
31667
31717
  const draftRef = useRef44(null);
31668
- const setDraftBoth = useCallback44(
31718
+ const setDraftBoth = useCallback45(
31669
31719
  (next) => {
31670
31720
  draftRef.current = next;
31671
31721
  setDraft(next);
@@ -31689,7 +31739,7 @@ var TimePicker = forwardRef93(
31689
31739
  const minutesRef = useRef44(null);
31690
31740
  const secondsRef = useRef44(null);
31691
31741
  const refOf = (s) => s === "hours" ? hoursRef : s === "minutes" ? minutesRef : secondsRef;
31692
- const commit = useCallback44(
31742
+ const commit = useCallback45(
31693
31743
  (seg, n) => {
31694
31744
  const base = valueRef.current;
31695
31745
  const next = { ...base, [seg]: clampSeg(seg, n, use24h) };
@@ -31721,13 +31771,13 @@ var TimePicker = forwardRef93(
31721
31771
  valueRef.current = next;
31722
31772
  onChange?.(next);
31723
31773
  };
31724
- const clearCommitTimer = useCallback44(() => {
31774
+ const clearCommitTimer = useCallback45(() => {
31725
31775
  if (commitTimerRef.current != null) {
31726
31776
  clearTimeout(commitTimerRef.current);
31727
31777
  commitTimerRef.current = null;
31728
31778
  }
31729
31779
  }, []);
31730
- const commitDraft = useCallback44(
31780
+ const commitDraft = useCallback45(
31731
31781
  (seg, digits) => {
31732
31782
  clearCommitTimer();
31733
31783
  const n = parseInt(digits || "0", 10);
@@ -31739,11 +31789,11 @@ var TimePicker = forwardRef93(
31739
31789
  },
31740
31790
  [clearCommitTimer, commit, use24h, setDraftBoth]
31741
31791
  );
31742
- const flushDraft = useCallback44(() => {
31792
+ const flushDraft = useCallback45(() => {
31743
31793
  const d = draftRef.current;
31744
31794
  if (d) commitDraft(d.seg, d.digits);
31745
31795
  }, [commitDraft]);
31746
- const focusSegment = useCallback44(
31796
+ const focusSegment = useCallback45(
31747
31797
  (seg) => {
31748
31798
  const d = draftRef.current;
31749
31799
  if (d && d.seg !== seg) commitDraft(d.seg, d.digits);
@@ -32026,7 +32076,7 @@ TimePicker.displayName = "TimePicker";
32026
32076
  // src/components/TimezonePicker/TimezonePicker.tsx
32027
32077
  import {
32028
32078
  forwardRef as forwardRef94,
32029
- useCallback as useCallback45,
32079
+ useCallback as useCallback46,
32030
32080
  useEffect as useEffect52,
32031
32081
  useId as useId55,
32032
32082
  useMemo as useMemo34,
@@ -32131,7 +32181,7 @@ var TimezonePicker = forwardRef94(
32131
32181
  );
32132
32182
  active?.scrollIntoView?.({ block: "nearest" });
32133
32183
  }, [activeIndex, open]);
32134
- const select = useCallback45(
32184
+ const select = useCallback46(
32135
32185
  (iana) => {
32136
32186
  onChange?.(iana);
32137
32187
  setOpen(false);
@@ -32140,7 +32190,7 @@ var TimezonePicker = forwardRef94(
32140
32190
  },
32141
32191
  [onChange]
32142
32192
  );
32143
- const handlePopoverKey = useCallback45(
32193
+ const handlePopoverKey = useCallback46(
32144
32194
  (e) => {
32145
32195
  if (e.key === "ArrowDown") {
32146
32196
  e.preventDefault();
@@ -32336,7 +32386,7 @@ TimezonePicker.displayName = "TimezonePicker";
32336
32386
  import { AnimatePresence as AnimatePresence18, motion as motion28 } from "framer-motion";
32337
32387
  import {
32338
32388
  createContext as createContext3,
32339
- useCallback as useCallback46,
32389
+ useCallback as useCallback47,
32340
32390
  useContext as useContext4,
32341
32391
  useMemo as useMemo35,
32342
32392
  useRef as useRef46,
@@ -32593,7 +32643,7 @@ function ToastProvider({
32593
32643
  const [toasts, setToasts] = useState67([]);
32594
32644
  const timers = useRef46(/* @__PURE__ */ new Map());
32595
32645
  const idCounter2 = useRef46(0);
32596
- const dismiss = useCallback46((id) => {
32646
+ const dismiss = useCallback47((id) => {
32597
32647
  setToasts((prev) => prev.filter((t) => t.id !== id));
32598
32648
  const timer = timers.current.get(id);
32599
32649
  if (timer) {
@@ -32601,7 +32651,7 @@ function ToastProvider({
32601
32651
  timers.current.delete(id);
32602
32652
  }
32603
32653
  }, []);
32604
- const dismissAll = useCallback46((position) => {
32654
+ const dismissAll = useCallback47((position) => {
32605
32655
  setToasts((prev) => {
32606
32656
  const remaining = position ? prev.filter((t) => t.position !== position) : [];
32607
32657
  for (const t of prev) {
@@ -32616,7 +32666,7 @@ function ToastProvider({
32616
32666
  return remaining;
32617
32667
  });
32618
32668
  }, []);
32619
- const toast = useCallback46(
32669
+ const toast = useCallback47(
32620
32670
  (options2) => {
32621
32671
  const id = `toast-${++idCounter2.current}`;
32622
32672
  const item = {
@@ -32691,7 +32741,7 @@ function useToast() {
32691
32741
 
32692
32742
  // src/components/Toggle/Toggle.tsx
32693
32743
  import {
32694
- useCallback as useCallback47,
32744
+ useCallback as useCallback48,
32695
32745
  useId as useId56,
32696
32746
  useRef as useRef47
32697
32747
  } from "react";
@@ -32722,7 +32772,7 @@ function Toggle({
32722
32772
  const groupLabelledBy = ariaLabelledBy ?? labelId;
32723
32773
  const groupAriaLabel = !groupLabelledBy ? ariaLabel ?? "Toggle group" : void 0;
32724
32774
  const buttonRefs = useRef47([]);
32725
- const findNextEnabled = useCallback47(
32775
+ const findNextEnabled = useCallback48(
32726
32776
  (from, dir) => {
32727
32777
  if (options2.length === 0) return -1;
32728
32778
  let i = from;
@@ -32735,11 +32785,11 @@ function Toggle({
32735
32785
  },
32736
32786
  [options2, disabled]
32737
32787
  );
32738
- const focusIndex = useCallback47((i) => {
32788
+ const focusIndex = useCallback48((i) => {
32739
32789
  if (i < 0) return;
32740
32790
  buttonRefs.current[i]?.focus();
32741
32791
  }, []);
32742
- const handleKey = useCallback47(
32792
+ const handleKey = useCallback48(
32743
32793
  (e, idx) => {
32744
32794
  if (e.key === "ArrowRight" || e.key === "ArrowDown") {
32745
32795
  e.preventDefault();
@@ -33107,7 +33157,7 @@ function TopBar({
33107
33157
  import { AnimatePresence as AnimatePresence19, motion as motion29 } from "framer-motion";
33108
33158
  import {
33109
33159
  forwardRef as forwardRef96,
33110
- useCallback as useCallback48,
33160
+ useCallback as useCallback49,
33111
33161
  useId as useId58,
33112
33162
  useState as useState68
33113
33163
  } from "react";
@@ -33159,7 +33209,7 @@ var TraceStep = forwardRef96(
33159
33209
  const isControlled = controlledOpen !== void 0;
33160
33210
  const open = isControlled ? controlledOpen : uncontrolledOpen;
33161
33211
  const canExpand = !!children;
33162
- const toggle = useCallback48(() => {
33212
+ const toggle = useCallback49(() => {
33163
33213
  if (!canExpand) return;
33164
33214
  const next = !open;
33165
33215
  if (!isControlled) setUncontrolledOpen(next);
@@ -33514,10 +33564,10 @@ var UserCard = forwardRef98(function UserCard2({
33514
33564
  UserCard.displayName = "UserCard";
33515
33565
 
33516
33566
  // src/components/WorkflowEditor/WorkflowEditor.tsx
33517
- import { useCallback as useCallback50, useMemo as useMemo37, useState as useState69 } from "react";
33567
+ import { useCallback as useCallback51, useMemo as useMemo37, useState as useState69 } from "react";
33518
33568
 
33519
33569
  // src/hooks/useWorkflow.ts
33520
- import { useCallback as useCallback49, useMemo as useMemo36, useReducer } from "react";
33570
+ import { useCallback as useCallback50, useMemo as useMemo36, useReducer } from "react";
33521
33571
 
33522
33572
  // src/workflow/types.ts
33523
33573
  var types_exports = {};
@@ -34031,11 +34081,11 @@ function useWorkflow(options2 = {}) {
34031
34081
  []
34032
34082
  );
34033
34083
  const [workflow, dispatch] = useReducer(reducer, initial);
34034
- const addNode = useCallback49(
34084
+ const addNode = useCallback50(
34035
34085
  (node) => dispatch({ type: "ADD_NODE", payload: node }),
34036
34086
  []
34037
34087
  );
34038
- const createNode = useCallback49(
34088
+ const createNode = useCallback50(
34039
34089
  (partial) => {
34040
34090
  const id = partial.id ?? genId("node");
34041
34091
  const ports = partial.ports ?? {
@@ -34084,27 +34134,27 @@ function useWorkflow(options2 = {}) {
34084
34134
  },
34085
34135
  []
34086
34136
  );
34087
- const updateNode = useCallback49(
34137
+ const updateNode = useCallback50(
34088
34138
  (id, updates) => dispatch({ type: "UPDATE_NODE", payload: { id, updates } }),
34089
34139
  []
34090
34140
  );
34091
- const deleteNode = useCallback49(
34141
+ const deleteNode = useCallback50(
34092
34142
  (id) => dispatch({ type: "DELETE_NODE", payload: id }),
34093
34143
  []
34094
34144
  );
34095
- const deleteNodes = useCallback49(
34145
+ const deleteNodes = useCallback50(
34096
34146
  (ids) => dispatch({ type: "DELETE_NODES", payload: ids }),
34097
34147
  []
34098
34148
  );
34099
- const replaceNodes = useCallback49(
34149
+ const replaceNodes = useCallback50(
34100
34150
  (nodes) => dispatch({ type: "REPLACE_NODES", payload: nodes }),
34101
34151
  []
34102
34152
  );
34103
- const addEdge = useCallback49(
34153
+ const addEdge = useCallback50(
34104
34154
  (edge) => dispatch({ type: "ADD_EDGE", payload: edge }),
34105
34155
  []
34106
34156
  );
34107
- const createEdge = useCallback49(
34157
+ const createEdge = useCallback50(
34108
34158
  (source, sourcePort, target, targetPort) => {
34109
34159
  const edge = {
34110
34160
  id: genId("edge"),
@@ -34122,20 +34172,20 @@ function useWorkflow(options2 = {}) {
34122
34172
  },
34123
34173
  []
34124
34174
  );
34125
- const deleteEdge = useCallback49(
34175
+ const deleteEdge = useCallback50(
34126
34176
  (id) => dispatch({ type: "DELETE_EDGE", payload: id }),
34127
34177
  []
34128
34178
  );
34129
- const replaceEdges = useCallback49(
34179
+ const replaceEdges = useCallback50(
34130
34180
  (edges) => dispatch({ type: "REPLACE_EDGES", payload: edges }),
34131
34181
  []
34132
34182
  );
34133
- const startConnecting = useCallback49(
34183
+ const startConnecting = useCallback50(
34134
34184
  (nodeId, portId, portType) => dispatch({ type: "START_CONNECTING", payload: { nodeId, portId, portType } }),
34135
34185
  []
34136
34186
  );
34137
- const endConnecting = useCallback49(() => dispatch({ type: "END_CONNECTING" }), []);
34138
- const selectNode = useCallback49(
34187
+ const endConnecting = useCallback50(() => dispatch({ type: "END_CONNECTING" }), []);
34188
+ const selectNode = useCallback50(
34139
34189
  (id, multi = false) => {
34140
34190
  if (multi) {
34141
34191
  const current = workflow.canvas.selectedNodes;
@@ -34147,36 +34197,36 @@ function useWorkflow(options2 = {}) {
34147
34197
  },
34148
34198
  [workflow.canvas.selectedNodes]
34149
34199
  );
34150
- const selectNodes = useCallback49(
34200
+ const selectNodes = useCallback50(
34151
34201
  (ids) => dispatch({ type: "SELECT_NODES", payload: ids }),
34152
34202
  []
34153
34203
  );
34154
- const selectEdge = useCallback49(
34204
+ const selectEdge = useCallback50(
34155
34205
  (id) => dispatch({ type: "SELECT_EDGE", payload: id }),
34156
34206
  []
34157
34207
  );
34158
- const deselectAll = useCallback49(() => dispatch({ type: "DESELECT_ALL" }), []);
34159
- const zoomIn = useCallback49(() => {
34208
+ const deselectAll = useCallback50(() => dispatch({ type: "DESELECT_ALL" }), []);
34209
+ const zoomIn = useCallback50(() => {
34160
34210
  const z = Math.min(workflow.canvas.viewport.zoom * 1.2, 2);
34161
34211
  dispatch({ type: "UPDATE_VIEWPORT", payload: { zoom: z } });
34162
34212
  }, [workflow.canvas.viewport.zoom]);
34163
- const zoomOut = useCallback49(() => {
34213
+ const zoomOut = useCallback50(() => {
34164
34214
  const z = Math.max(workflow.canvas.viewport.zoom / 1.2, 0.25);
34165
34215
  dispatch({ type: "UPDATE_VIEWPORT", payload: { zoom: z } });
34166
34216
  }, [workflow.canvas.viewport.zoom]);
34167
- const resetViewport = useCallback49(
34217
+ const resetViewport = useCallback50(
34168
34218
  () => dispatch({ type: "UPDATE_VIEWPORT", payload: { x: 0, y: 0, zoom: 1 } }),
34169
34219
  []
34170
34220
  );
34171
- const setViewport = useCallback49(
34221
+ const setViewport = useCallback50(
34172
34222
  (viewport) => dispatch({ type: "UPDATE_VIEWPORT", payload: viewport }),
34173
34223
  []
34174
34224
  );
34175
- const undo = useCallback49(() => dispatch({ type: "UNDO" }), []);
34176
- const redo = useCallback49(() => dispatch({ type: "REDO" }), []);
34225
+ const undo = useCallback50(() => dispatch({ type: "UNDO" }), []);
34226
+ const redo = useCallback50(() => dispatch({ type: "REDO" }), []);
34177
34227
  const canUndo = workflow.canvas.history.past.length > 0;
34178
34228
  const canRedo = workflow.canvas.history.future.length > 0;
34179
- const validate = useCallback49(() => workflow.validation, [workflow.validation]);
34229
+ const validate = useCallback50(() => workflow.validation, [workflow.validation]);
34180
34230
  return {
34181
34231
  workflow,
34182
34232
  dispatch,
@@ -34290,27 +34340,27 @@ function WorkflowEditor({
34290
34340
  const isDrawerOpen = controlledDrawerOpen ?? uncontrolledDrawer;
34291
34341
  const isHistoryOpen = controlledHistoryOpen ?? uncontrolledHistory;
34292
34342
  const isDebugOpen = controlledDebugOpen ?? uncontrolledDebug;
34293
- const toggleLock = useCallback50(() => {
34343
+ const toggleLock = useCallback51(() => {
34294
34344
  const next = !isLockMode;
34295
34345
  if (controlledLockMode === void 0) setUncontrolledLock(next);
34296
34346
  onToggleLockMode?.(next);
34297
34347
  }, [isLockMode, controlledLockMode, onToggleLockMode]);
34298
- const toggleDrawer = useCallback50(() => {
34348
+ const toggleDrawer = useCallback51(() => {
34299
34349
  const next = !isDrawerOpen;
34300
34350
  if (controlledDrawerOpen === void 0) setUncontrolledDrawer(next);
34301
34351
  onToggleDrawer?.(next);
34302
34352
  }, [isDrawerOpen, controlledDrawerOpen, onToggleDrawer]);
34303
- const toggleHistory = useCallback50(() => {
34353
+ const toggleHistory = useCallback51(() => {
34304
34354
  const next = !isHistoryOpen;
34305
34355
  if (controlledHistoryOpen === void 0) setUncontrolledHistory(next);
34306
34356
  onToggleHistory?.(next);
34307
34357
  }, [isHistoryOpen, controlledHistoryOpen, onToggleHistory]);
34308
- const toggleDebug = useCallback50(() => {
34358
+ const toggleDebug = useCallback51(() => {
34309
34359
  const next = !isDebugOpen;
34310
34360
  if (controlledDebugOpen === void 0) setUncontrolledDebug(next);
34311
34361
  onToggleDebug?.(next);
34312
34362
  }, [isDebugOpen, controlledDebugOpen, onToggleDebug]);
34313
- const handleReset = useCallback50(() => {
34363
+ const handleReset = useCallback51(() => {
34314
34364
  if (onReset) onReset();
34315
34365
  else dispatch({ type: "RESET" });
34316
34366
  }, [onReset, dispatch]);
@@ -34319,7 +34369,7 @@ function WorkflowEditor({
34319
34369
  [workflow.canvas.nodes]
34320
34370
  );
34321
34371
  const nextEdges = useMemo37(() => workflow.canvas.edges.map(toNextEdge), [workflow.canvas.edges]);
34322
- const onNodesChange = useCallback50(
34372
+ const onNodesChange = useCallback51(
34323
34373
  (changes) => {
34324
34374
  const reduced = applyNodeChanges(
34325
34375
  nextNodes,
@@ -34360,7 +34410,7 @@ function WorkflowEditor({
34360
34410
  },
34361
34411
  [nextNodes, workflow.canvas.nodes, wf, onNodeSelect]
34362
34412
  );
34363
- const onEdgesChange = useCallback50(
34413
+ const onEdgesChange = useCallback51(
34364
34414
  (changes) => {
34365
34415
  const reduced = applyEdgeChanges(nextEdges, changes);
34366
34416
  const byId = new Map(reduced.map((e) => [e.id, e]));
@@ -34370,18 +34420,18 @@ function WorkflowEditor({
34370
34420
  },
34371
34421
  [nextEdges, workflow.canvas.edges, wf]
34372
34422
  );
34373
- const onConnect = useCallback50(
34423
+ const onConnect = useCallback51(
34374
34424
  (c) => {
34375
34425
  wf.createEdge(c.source, c.sourceHandle ?? "default", c.target, c.targetHandle ?? "default");
34376
34426
  },
34377
34427
  [wf]
34378
34428
  );
34379
34429
  const [canvasSize, setCanvasSize] = useState69({ w: 0, h: 0 });
34380
- const handleCanvasRef = useCallback50((node) => {
34430
+ const handleCanvasRef = useCallback51((node) => {
34381
34431
  if (!node) return;
34382
34432
  setCanvasSize({ w: node.clientWidth, h: node.clientHeight });
34383
34433
  }, []);
34384
- const fitToView = useCallback50(() => {
34434
+ const fitToView = useCallback51(() => {
34385
34435
  const nodes = workflow.canvas.nodes;
34386
34436
  if (nodes.length === 0) return;
34387
34437
  let minX = Infinity;
@@ -35021,7 +35071,7 @@ function WorkflowHeaderExpanded({
35021
35071
  }
35022
35072
 
35023
35073
  // src/hooks/useBanner.ts
35024
- import { useCallback as useCallback51, useEffect as useEffect54, useRef as useRef48, useState as useState71 } from "react";
35074
+ import { useCallback as useCallback52, useEffect as useEffect54, useRef as useRef48, useState as useState71 } from "react";
35025
35075
  function useBanner(options2 = {}) {
35026
35076
  const { defaultOpen = false, autoDismissAfter, onDismiss } = options2;
35027
35077
  const [open, setOpen] = useState71(defaultOpen);
@@ -35030,20 +35080,20 @@ function useBanner(options2 = {}) {
35030
35080
  useEffect54(() => {
35031
35081
  onDismissRef.current = onDismiss;
35032
35082
  }, [onDismiss]);
35033
- const clearTimer = useCallback51(() => {
35083
+ const clearTimer = useCallback52(() => {
35034
35084
  if (timerRef.current !== null) {
35035
35085
  clearTimeout(timerRef.current);
35036
35086
  timerRef.current = null;
35037
35087
  }
35038
35088
  }, []);
35039
- const hide = useCallback51(() => {
35089
+ const hide = useCallback52(() => {
35040
35090
  clearTimer();
35041
35091
  setOpen((wasOpen) => {
35042
35092
  if (wasOpen) onDismissRef.current?.();
35043
35093
  return false;
35044
35094
  });
35045
35095
  }, [clearTimer]);
35046
- const show = useCallback51(() => {
35096
+ const show = useCallback52(() => {
35047
35097
  clearTimer();
35048
35098
  setOpen(true);
35049
35099
  if (typeof autoDismissAfter === "number" && Number.isFinite(autoDismissAfter) && autoDismissAfter > 0) {
@@ -35054,7 +35104,7 @@ function useBanner(options2 = {}) {
35054
35104
  }, autoDismissAfter);
35055
35105
  }
35056
35106
  }, [autoDismissAfter, clearTimer]);
35057
- const toggle = useCallback51(() => {
35107
+ const toggle = useCallback52(() => {
35058
35108
  if (open) hide();
35059
35109
  else show();
35060
35110
  }, [open, show, hide]);
@@ -35069,7 +35119,7 @@ function useBanner(options2 = {}) {
35069
35119
  }
35070
35120
 
35071
35121
  // src/hooks/useCallout.ts
35072
- import { useCallback as useCallback52, useEffect as useEffect55, useState as useState72 } from "react";
35122
+ import { useCallback as useCallback53, useEffect as useEffect55, useState as useState72 } from "react";
35073
35123
  var STORAGE_PREFIX = "ods:callout:dismissed:";
35074
35124
  function readPersisted(key) {
35075
35125
  if (!key || typeof window === "undefined") return false;
@@ -35098,7 +35148,7 @@ function useCallout(options2 = {}) {
35098
35148
  setOpen(false);
35099
35149
  }
35100
35150
  }, []);
35101
- const dismiss = useCallback52(() => {
35151
+ const dismiss = useCallback53(() => {
35102
35152
  setOpen((wasOpen) => {
35103
35153
  if (wasOpen) {
35104
35154
  writePersisted(persistKey, true);
@@ -35107,10 +35157,10 @@ function useCallout(options2 = {}) {
35107
35157
  return false;
35108
35158
  });
35109
35159
  }, [persistKey, onDismiss]);
35110
- const show = useCallback52(() => {
35160
+ const show = useCallback53(() => {
35111
35161
  setOpen(true);
35112
35162
  }, []);
35113
- const toggle = useCallback52(() => {
35163
+ const toggle = useCallback53(() => {
35114
35164
  setOpen((prev) => {
35115
35165
  const next = !prev;
35116
35166
  if (!next) {
@@ -35120,7 +35170,7 @@ function useCallout(options2 = {}) {
35120
35170
  return next;
35121
35171
  });
35122
35172
  }, [persistKey, onDismiss]);
35123
- const reset = useCallback52(() => {
35173
+ const reset = useCallback53(() => {
35124
35174
  writePersisted(persistKey, false);
35125
35175
  setOpen(true);
35126
35176
  }, [persistKey]);
@@ -35193,7 +35243,7 @@ function breakpointMinWidth(name) {
35193
35243
  }
35194
35244
 
35195
35245
  // src/hooks/useRating.ts
35196
- import { useCallback as useCallback53, useState as useState73 } from "react";
35246
+ import { useCallback as useCallback54, useState as useState73 } from "react";
35197
35247
  function useRating({
35198
35248
  value: controlled,
35199
35249
  defaultValue = 0,
@@ -35204,11 +35254,11 @@ function useRating({
35204
35254
  const [internal, setInternal] = useState73(defaultValue);
35205
35255
  const value = controlled ?? internal;
35206
35256
  const isControlled = controlled !== void 0;
35207
- const clamp = useCallback53(
35257
+ const clamp = useCallback54(
35208
35258
  (v) => Math.max(0, Math.min(max, v)),
35209
35259
  [max]
35210
35260
  );
35211
- const set = useCallback53(
35261
+ const set = useCallback54(
35212
35262
  (next) => {
35213
35263
  const clamped = clamp(next);
35214
35264
  if (!isControlled) setInternal(clamped);
@@ -35233,7 +35283,7 @@ function useBinaryRating({
35233
35283
  const [internal, setInternal] = useState73(defaultValue);
35234
35284
  const value = controlled ?? internal;
35235
35285
  const isControlled = controlled !== void 0;
35236
- const set = useCallback53(
35286
+ const set = useCallback54(
35237
35287
  (next) => {
35238
35288
  if (!isControlled) setInternal(next);
35239
35289
  onChange?.(next);
@@ -35252,7 +35302,7 @@ function useBinaryRating({
35252
35302
  }
35253
35303
 
35254
35304
  // src/hooks/useTimeline.ts
35255
- import { useCallback as useCallback54, useState as useState74 } from "react";
35305
+ import { useCallback as useCallback55, useState as useState74 } from "react";
35256
35306
  function useTimeline({
35257
35307
  items: controlled,
35258
35308
  defaultItems = [],
@@ -35261,21 +35311,21 @@ function useTimeline({
35261
35311
  const [internal, setInternal] = useState74(defaultItems);
35262
35312
  const items = controlled ?? internal;
35263
35313
  const isControlled = controlled !== void 0;
35264
- const commit = useCallback54(
35314
+ const commit = useCallback55(
35265
35315
  (next) => {
35266
35316
  if (!isControlled) setInternal(next);
35267
35317
  onChange?.(next);
35268
35318
  },
35269
35319
  [isControlled, onChange]
35270
35320
  );
35271
- const add = useCallback54(
35321
+ const add = useCallback55(
35272
35322
  (item) => {
35273
35323
  if (items.some((i) => i.id === item.id)) return;
35274
35324
  commit([...items, item]);
35275
35325
  },
35276
35326
  [items, commit]
35277
35327
  );
35278
- const insert = useCallback54(
35328
+ const insert = useCallback55(
35279
35329
  (index, item) => {
35280
35330
  if (items.some((i) => i.id === item.id)) return;
35281
35331
  const at = Math.max(0, Math.min(items.length, index));
@@ -35285,7 +35335,7 @@ function useTimeline({
35285
35335
  },
35286
35336
  [items, commit]
35287
35337
  );
35288
- const remove = useCallback54(
35338
+ const remove = useCallback55(
35289
35339
  (id) => {
35290
35340
  const next = items.filter((i) => i.id !== id);
35291
35341
  if (next.length === items.length) return;
@@ -35293,7 +35343,7 @@ function useTimeline({
35293
35343
  },
35294
35344
  [items, commit]
35295
35345
  );
35296
- const update = useCallback54(
35346
+ const update = useCallback55(
35297
35347
  (id, patch) => {
35298
35348
  let changed = false;
35299
35349
  const next = items.map((i) => {
@@ -35318,7 +35368,7 @@ function useTimeline({
35318
35368
  }
35319
35369
 
35320
35370
  // src/hooks/useTraceTimeline.ts
35321
- import { useCallback as useCallback55, useRef as useRef49, useState as useState75 } from "react";
35371
+ import { useCallback as useCallback56, useRef as useRef49, useState as useState75 } from "react";
35322
35372
  var GLOBAL_SEQ = 0;
35323
35373
  var generateId = () => `ods-trace-${Date.now().toString(36)}-${(GLOBAL_SEQ++).toString(36)}`;
35324
35374
  function useTraceTimeline({
@@ -35331,7 +35381,7 @@ function useTraceTimeline({
35331
35381
  const isControlled = controlled !== void 0;
35332
35382
  const stepsRef = useRef49(steps);
35333
35383
  stepsRef.current = steps;
35334
- const commit = useCallback55(
35384
+ const commit = useCallback56(
35335
35385
  (next) => {
35336
35386
  stepsRef.current = next;
35337
35387
  if (!isControlled) setInternal(next);
@@ -35339,7 +35389,7 @@ function useTraceTimeline({
35339
35389
  },
35340
35390
  [isControlled, onChange]
35341
35391
  );
35342
- const start = useCallback55(
35392
+ const start = useCallback56(
35343
35393
  (input) => {
35344
35394
  const id = input.id ?? generateId();
35345
35395
  const record = {
@@ -35359,7 +35409,7 @@ function useTraceTimeline({
35359
35409
  },
35360
35410
  [commit]
35361
35411
  );
35362
- const update = useCallback55(
35412
+ const update = useCallback56(
35363
35413
  (id, patch) => {
35364
35414
  let changed = false;
35365
35415
  const next = stepsRef.current.map((s) => {
@@ -35371,19 +35421,19 @@ function useTraceTimeline({
35371
35421
  },
35372
35422
  [commit]
35373
35423
  );
35374
- const complete = useCallback55(
35424
+ const complete = useCallback56(
35375
35425
  (id, patch = {}) => {
35376
35426
  update(id, { ...patch, status: "success" });
35377
35427
  },
35378
35428
  [update]
35379
35429
  );
35380
- const fail = useCallback55(
35430
+ const fail = useCallback56(
35381
35431
  (id, patch = {}) => {
35382
35432
  update(id, { ...patch, status: "failed" });
35383
35433
  },
35384
35434
  [update]
35385
35435
  );
35386
- const remove = useCallback55(
35436
+ const remove = useCallback56(
35387
35437
  (id) => {
35388
35438
  const next = stepsRef.current.filter((s) => s.id !== id);
35389
35439
  if (next.length === stepsRef.current.length) return;